UNPKG

@open-formulieren/formio-builder

Version:

An opinionated Formio webform builder for Open Forms

78 lines (77 loc) 2.23 kB
import { jsx as e, jsxs as F, Fragment as N } from "react/jsx-runtime"; import { JSONEditor as j } from "@open-formulieren/monaco-json-editor"; import { FormattedMessage as O } from "react-intl"; import { BuilderContext as S } from "../context.js"; import { isKnownComponentType as T } from "../registry/index.js"; import b from "./ComponentEditForm.js"; const W = ({ uniquifyKey: o, supportedLanguageCodes: r = ["nl", "en"], richTextColors: t, getMapTileLayers: a, getMapOverlayTileLayers: l, theme: i, getFormComponents: p, getValidatorPlugins: s, getRegistrationAttributes: d, getServices: m, getReferenceListsTables: u, getReferenceListsTableItems: y, getPrefillPlugins: c, getPrefillAttributes: f, getFileTypes: g, serverUploadLimit: v, getAuthPlugins: h, isNew: C, component: n, formType: k = "regular", onCancel: w, onRemove: x, onSubmit: E }) => T(n) ? /* @__PURE__ */ e(S.Provider, { value: { uniquifyKey: o, supportedLanguageCodes: r, richTextColors: t, formType: k, getMapTileLayers: a, getMapOverlayTileLayers: l, theme: i, getFormComponents: p, getValidatorPlugins: s, getRegistrationAttributes: d, getServices: m, getReferenceListsTables: u, getReferenceListsTableItems: y, getPrefillPlugins: c, getPrefillAttributes: f, getFileTypes: g, serverUploadLimit: v, getAuthPlugins: h }, children: /* @__PURE__ */ e(b, { isNew: C, component: n, onCancel: w, onRemove: x, onSubmit: E }) }) : /* @__PURE__ */ e(J, { theme: i, component: n }), J = ({ component: o, theme: r }) => /* @__PURE__ */ F(N, { children: [ /* @__PURE__ */ e(O, { id: "ISVTEk", tagName: "p", defaultMessage: [{ type: 0, value: "The component type " }, { type: 8, value: "code", children: [{ type: 1, value: "type" }] }, { type: 0, value: " is unknown. We can only display the JSON definition." }], values: { type: o.type ?? "-", code: (t) => /* @__PURE__ */ e("code", { children: t }) } }), /* @__PURE__ */ e(j, { wrapperProps: { className: "json-editor" }, value: o, onChange: () => alert("Editing is not possible in unknown components."), theme: r, readOnly: !0 }) ] }); export { W as default };