UNPKG

@open-formulieren/formio-builder

Version:

An opinionated Formio webform builder for Open Forms

83 lines (82 loc) 2.38 kB
import { jsx as e, jsxs as O, Fragment as S } from "react/jsx-runtime"; import { JSONEditor as T } from "@open-formulieren/monaco-json-editor"; import { FormattedMessage as b } from "react-intl"; import { BuilderContext as J } from "../context.js"; import { isKnownComponentType as M } from "../registry/index.js"; import P from "./ComponentEditForm.js"; const A = ({ 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, getDocumentTypes: h, getConfidentialityLevels: C, getAuthPlugins: k, isNew: w, component: n, builderInfo: x, formType: E = "regular", onCancel: F, onRemove: N, onSubmit: j }) => M(n) ? /* @__PURE__ */ e(J.Provider, { value: { uniquifyKey: o, supportedLanguageCodes: r, richTextColors: t, formType: E, 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, getDocumentTypes: h, getConfidentialityLevels: C, getAuthPlugins: k }, children: /* @__PURE__ */ e(P, { isNew: w, component: n, builderInfo: x, onCancel: F, onRemove: N, onSubmit: j }) }) : /* @__PURE__ */ e(B, { theme: i, component: n }), B = ({ component: o, theme: r }) => /* @__PURE__ */ O(S, { children: [ /* @__PURE__ */ e(b, { 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(T, { wrapperProps: { className: "json-editor" }, value: o, onChange: () => alert("Editing is not possible in unknown components."), theme: r, readOnly: !0 }) ] }); export { A as default };