@docengine/editor 0.0.0-stage → 0.0.105
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +112 -2
- package/dist/DocEnginePdfViewer.zip +0 -0
- package/dist/editor-lwc.css +7425 -0
- package/dist/editor-lwc.js +1595 -0
- package/dist/editor-lwc.js.map +1 -0
- package/dist/editor.js +89754 -0
- package/dist/pdf-viewer/viewer.html +40 -0
- package/dist/pdf-viewer/viewer.js +1 -0
- package/lib/.tsbuildinfo +1 -0
- package/lib/catalog/catalog-provider.d.ts +27 -0
- package/lib/catalog/catalog-provider.d.ts.map +1 -0
- package/lib/catalog/catalog-provider.js +88 -0
- package/lib/catalog/catalog-provider.js.map +1 -0
- package/lib/core/computed-formula.d.ts +3 -0
- package/lib/core/computed-formula.d.ts.map +1 -0
- package/lib/core/computed-formula.js +2 -0
- package/lib/core/computed-formula.js.map +1 -0
- package/lib/core/computed-formula.test.d.ts +2 -0
- package/lib/core/computed-formula.test.d.ts.map +1 -0
- package/lib/core/computed-formula.test.js +204 -0
- package/lib/core/computed-formula.test.js.map +1 -0
- package/lib/core/document-display-defaults.d.ts +2 -0
- package/lib/core/document-display-defaults.d.ts.map +1 -0
- package/lib/core/document-display-defaults.js +2 -0
- package/lib/core/document-display-defaults.js.map +1 -0
- package/lib/core/document-history.d.ts +23 -0
- package/lib/core/document-history.d.ts.map +1 -0
- package/lib/core/document-history.js +87 -0
- package/lib/core/document-history.js.map +1 -0
- package/lib/core/document-history.test.d.ts +2 -0
- package/lib/core/document-history.test.d.ts.map +1 -0
- package/lib/core/document-history.test.js +47 -0
- package/lib/core/document-history.test.js.map +1 -0
- package/lib/core/document-io.d.ts +2 -0
- package/lib/core/document-io.d.ts.map +1 -0
- package/lib/core/document-io.js +2 -0
- package/lib/core/document-io.js.map +1 -0
- package/lib/core/document-io.test.d.ts +2 -0
- package/lib/core/document-io.test.d.ts.map +1 -0
- package/lib/core/document-io.test.js +616 -0
- package/lib/core/document-io.test.js.map +1 -0
- package/lib/core/document-section-defaults.d.ts +27 -0
- package/lib/core/document-section-defaults.d.ts.map +1 -0
- package/lib/core/document-section-defaults.js +60 -0
- package/lib/core/document-section-defaults.js.map +1 -0
- package/lib/core/document-section-defaults.test.d.ts +2 -0
- package/lib/core/document-section-defaults.test.d.ts.map +1 -0
- package/lib/core/document-section-defaults.test.js +47 -0
- package/lib/core/document-section-defaults.test.js.map +1 -0
- package/lib/core/field-id.d.ts +2 -0
- package/lib/core/field-id.d.ts.map +1 -0
- package/lib/core/field-id.js +2 -0
- package/lib/core/field-id.js.map +1 -0
- package/lib/core/field-id.test.d.ts +2 -0
- package/lib/core/field-id.test.d.ts.map +1 -0
- package/lib/core/field-id.test.js +253 -0
- package/lib/core/field-id.test.js.map +1 -0
- package/lib/core/field-io/sectioned-document-io.d.ts +2 -0
- package/lib/core/field-io/sectioned-document-io.d.ts.map +1 -0
- package/lib/core/field-io/sectioned-document-io.js +2 -0
- package/lib/core/field-io/sectioned-document-io.js.map +1 -0
- package/lib/core/field-io/sectioned-document-io.test.d.ts +2 -0
- package/lib/core/field-io/sectioned-document-io.test.d.ts.map +1 -0
- package/lib/core/field-io/sectioned-document-io.test.js +511 -0
- package/lib/core/field-io/sectioned-document-io.test.js.map +1 -0
- package/lib/core/field-io/table-field-io.d.ts +2 -0
- package/lib/core/field-io/table-field-io.d.ts.map +1 -0
- package/lib/core/field-io/table-field-io.js +2 -0
- package/lib/core/field-io/table-field-io.js.map +1 -0
- package/lib/core/field-io/table-field-io.test.d.ts +2 -0
- package/lib/core/field-io/table-field-io.test.d.ts.map +1 -0
- package/lib/core/field-io/table-field-io.test.js +193 -0
- package/lib/core/field-io/table-field-io.test.js.map +1 -0
- package/lib/core/field-schemas.d.ts +2 -0
- package/lib/core/field-schemas.d.ts.map +1 -0
- package/lib/core/field-schemas.js +7 -0
- package/lib/core/field-schemas.js.map +1 -0
- package/lib/core/field-schemas.test.d.ts +2 -0
- package/lib/core/field-schemas.test.d.ts.map +1 -0
- package/lib/core/field-schemas.test.js +369 -0
- package/lib/core/field-schemas.test.js.map +1 -0
- package/lib/core/formula-field-index.d.ts +2 -0
- package/lib/core/formula-field-index.d.ts.map +1 -0
- package/lib/core/formula-field-index.js +2 -0
- package/lib/core/formula-field-index.js.map +1 -0
- package/lib/core/formula-field-index.test.d.ts +2 -0
- package/lib/core/formula-field-index.test.d.ts.map +1 -0
- package/lib/core/formula-field-index.test.js +110 -0
- package/lib/core/formula-field-index.test.js.map +1 -0
- package/lib/core/page-setup-styles.d.ts +69 -0
- package/lib/core/page-setup-styles.d.ts.map +1 -0
- package/lib/core/page-setup-styles.js +147 -0
- package/lib/core/page-setup-styles.js.map +1 -0
- package/lib/core/page-setup-styles.test.d.ts +2 -0
- package/lib/core/page-setup-styles.test.d.ts.map +1 -0
- package/lib/core/page-setup-styles.test.js +204 -0
- package/lib/core/page-setup-styles.test.js.map +1 -0
- package/lib/core/repeater-io.d.ts +2 -0
- package/lib/core/repeater-io.d.ts.map +1 -0
- package/lib/core/repeater-io.js +2 -0
- package/lib/core/repeater-io.js.map +1 -0
- package/lib/core/repeater-io.test.d.ts +2 -0
- package/lib/core/repeater-io.test.d.ts.map +1 -0
- package/lib/core/repeater-io.test.js +754 -0
- package/lib/core/repeater-io.test.js.map +1 -0
- package/lib/core/segment-tree.d.ts +2 -0
- package/lib/core/segment-tree.d.ts.map +1 -0
- package/lib/core/segment-tree.js +2 -0
- package/lib/core/segment-tree.js.map +1 -0
- package/lib/core/segment-tree.test.d.ts +2 -0
- package/lib/core/segment-tree.test.d.ts.map +1 -0
- package/lib/core/segment-tree.test.js +39 -0
- package/lib/core/segment-tree.test.js.map +1 -0
- package/lib/create-editor.d.ts +160 -0
- package/lib/create-editor.d.ts.map +1 -0
- package/lib/create-editor.js +3373 -0
- package/lib/create-editor.js.map +1 -0
- package/lib/design/collection-tree-picker.d.ts +17 -0
- package/lib/design/collection-tree-picker.d.ts.map +1 -0
- package/lib/design/collection-tree-picker.js +295 -0
- package/lib/design/collection-tree-picker.js.map +1 -0
- package/lib/design/collection-tree-picker.test.d.ts +2 -0
- package/lib/design/collection-tree-picker.test.d.ts.map +1 -0
- package/lib/design/collection-tree-picker.test.js +94 -0
- package/lib/design/collection-tree-picker.test.js.map +1 -0
- package/lib/design/design-mode.d.ts +3 -0
- package/lib/design/design-mode.d.ts.map +1 -0
- package/lib/design/design-mode.js +7 -0
- package/lib/design/design-mode.js.map +1 -0
- package/lib/design/design-shell.d.ts +16 -0
- package/lib/design/design-shell.d.ts.map +1 -0
- package/lib/design/design-shell.js +68 -0
- package/lib/design/design-shell.js.map +1 -0
- package/lib/design/display-style-form.d.ts +10 -0
- package/lib/design/display-style-form.d.ts.map +1 -0
- package/lib/design/display-style-form.js +182 -0
- package/lib/design/display-style-form.js.map +1 -0
- package/lib/design/display-style-form.test.d.ts +2 -0
- package/lib/design/display-style-form.test.d.ts.map +1 -0
- package/lib/design/display-style-form.test.js +137 -0
- package/lib/design/display-style-form.test.js.map +1 -0
- package/lib/design/field-highlight-form.d.ts +10 -0
- package/lib/design/field-highlight-form.d.ts.map +1 -0
- package/lib/design/field-highlight-form.js +160 -0
- package/lib/design/field-highlight-form.js.map +1 -0
- package/lib/design/field-highlight-form.test.d.ts +2 -0
- package/lib/design/field-highlight-form.test.d.ts.map +1 -0
- package/lib/design/field-highlight-form.test.js +58 -0
- package/lib/design/field-highlight-form.test.js.map +1 -0
- package/lib/design/field-palette.d.ts +55 -0
- package/lib/design/field-palette.d.ts.map +1 -0
- package/lib/design/field-palette.js +216 -0
- package/lib/design/field-palette.js.map +1 -0
- package/lib/design/field-palette.test.d.ts +2 -0
- package/lib/design/field-palette.test.d.ts.map +1 -0
- package/lib/design/field-palette.test.js +79 -0
- package/lib/design/field-palette.test.js.map +1 -0
- package/lib/design/formula-field-picker.d.ts +15 -0
- package/lib/design/formula-field-picker.d.ts.map +1 -0
- package/lib/design/formula-field-picker.js +170 -0
- package/lib/design/formula-field-picker.js.map +1 -0
- package/lib/design/formula-field-picker.test.d.ts +2 -0
- package/lib/design/formula-field-picker.test.d.ts.map +1 -0
- package/lib/design/formula-field-picker.test.js +136 -0
- package/lib/design/formula-field-picker.test.js.map +1 -0
- package/lib/design/palette-block-drop.d.ts +7 -0
- package/lib/design/palette-block-drop.d.ts.map +1 -0
- package/lib/design/palette-block-drop.js +62 -0
- package/lib/design/palette-block-drop.js.map +1 -0
- package/lib/design/properties-panel.d.ts +22 -0
- package/lib/design/properties-panel.d.ts.map +1 -0
- package/lib/design/properties-panel.js +848 -0
- package/lib/design/properties-panel.js.map +1 -0
- package/lib/design/schema-editor-controller.d.ts +22 -0
- package/lib/design/schema-editor-controller.d.ts.map +1 -0
- package/lib/design/schema-editor-controller.js +1033 -0
- package/lib/design/schema-editor-controller.js.map +1 -0
- package/lib/design/schema-editor-controller.test.d.ts +2 -0
- package/lib/design/schema-editor-controller.test.d.ts.map +1 -0
- package/lib/design/schema-editor-controller.test.js +259 -0
- package/lib/design/schema-editor-controller.test.js.map +1 -0
- package/lib/design/schema-editor-modal.d.ts +4 -0
- package/lib/design/schema-editor-modal.d.ts.map +1 -0
- package/lib/design/schema-editor-modal.js +68 -0
- package/lib/design/schema-editor-modal.js.map +1 -0
- package/lib/design/schema-items-designer-modal.d.ts +3 -0
- package/lib/design/schema-items-designer-modal.d.ts.map +1 -0
- package/lib/design/schema-items-designer-modal.js +187 -0
- package/lib/design/schema-items-designer-modal.js.map +1 -0
- package/lib/design/schema-items-designer.d.ts +20 -0
- package/lib/design/schema-items-designer.d.ts.map +1 -0
- package/lib/design/schema-items-designer.js +394 -0
- package/lib/design/schema-items-designer.js.map +1 -0
- package/lib/design/schema-items-designer.test.d.ts +2 -0
- package/lib/design/schema-items-designer.test.d.ts.map +1 -0
- package/lib/design/schema-items-designer.test.js +115 -0
- package/lib/design/schema-items-designer.test.js.map +1 -0
- package/lib/design/style-toolbar-shared.d.ts +53 -0
- package/lib/design/style-toolbar-shared.d.ts.map +1 -0
- package/lib/design/style-toolbar-shared.js +196 -0
- package/lib/design/style-toolbar-shared.js.map +1 -0
- package/lib/domain/ophthalmology/catalogs.d.ts +107 -0
- package/lib/domain/ophthalmology/catalogs.d.ts.map +1 -0
- package/lib/domain/ophthalmology/catalogs.js +65 -0
- package/lib/domain/ophthalmology/catalogs.js.map +1 -0
- package/lib/domain/ophthalmology/life-anamnesis-tree.d.ts +13 -0
- package/lib/domain/ophthalmology/life-anamnesis-tree.d.ts.map +1 -0
- package/lib/domain/ophthalmology/life-anamnesis-tree.js +44 -0
- package/lib/domain/ophthalmology/life-anamnesis-tree.js.map +1 -0
- package/lib/domain/ophthalmology/norm-options.d.ts +9 -0
- package/lib/domain/ophthalmology/norm-options.d.ts.map +1 -0
- package/lib/domain/ophthalmology/norm-options.js +24 -0
- package/lib/domain/ophthalmology/norm-options.js.map +1 -0
- package/lib/domain/ophthalmology/ophthalmology-complaints-tree.d.ts +13 -0
- package/lib/domain/ophthalmology/ophthalmology-complaints-tree.d.ts.map +1 -0
- package/lib/domain/ophthalmology/ophthalmology-complaints-tree.js +48 -0
- package/lib/domain/ophthalmology/ophthalmology-complaints-tree.js.map +1 -0
- package/lib/domain/ophthalmology/ophthalmology-diagnoses.d.ts +6 -0
- package/lib/domain/ophthalmology/ophthalmology-diagnoses.d.ts.map +1 -0
- package/lib/domain/ophthalmology/ophthalmology-diagnoses.js +13 -0
- package/lib/domain/ophthalmology/ophthalmology-diagnoses.js.map +1 -0
- package/lib/domain/ophthalmology/vision-values.d.ts +21 -0
- package/lib/domain/ophthalmology/vision-values.d.ts.map +1 -0
- package/lib/domain/ophthalmology/vision-values.js +55 -0
- package/lib/domain/ophthalmology/vision-values.js.map +1 -0
- package/lib/export/document-pdf.d.ts +20 -0
- package/lib/export/document-pdf.d.ts.map +1 -0
- package/lib/export/document-pdf.js +39 -0
- package/lib/export/document-pdf.js.map +1 -0
- package/lib/export/document-pdf.sf-stub.d.ts +13 -0
- package/lib/export/document-pdf.sf-stub.d.ts.map +1 -0
- package/lib/export/document-pdf.sf-stub.js +19 -0
- package/lib/export/document-pdf.sf-stub.js.map +1 -0
- package/lib/export/preview-export-options.d.ts +17 -0
- package/lib/export/preview-export-options.d.ts.map +1 -0
- package/lib/export/preview-export-options.js +28 -0
- package/lib/export/preview-export-options.js.map +1 -0
- package/lib/export/preview-html-document.d.ts +10 -0
- package/lib/export/preview-html-document.d.ts.map +1 -0
- package/lib/export/preview-html-document.js +29 -0
- package/lib/export/preview-html-document.js.map +1 -0
- package/lib/export/preview-html-styles.d.ts +10 -0
- package/lib/export/preview-html-styles.d.ts.map +1 -0
- package/lib/export/preview-html-styles.js +527 -0
- package/lib/export/preview-html-styles.js.map +1 -0
- package/lib/export/preview-html-styles.test.d.ts +2 -0
- package/lib/export/preview-html-styles.test.d.ts.map +1 -0
- package/lib/export/preview-html-styles.test.js +56 -0
- package/lib/export/preview-html-styles.test.js.map +1 -0
- package/lib/export/preview-pdf-mount.d.ts +14 -0
- package/lib/export/preview-pdf-mount.d.ts.map +1 -0
- package/lib/export/preview-pdf-mount.js +41 -0
- package/lib/export/preview-pdf-mount.js.map +1 -0
- package/lib/export/preview-pdf-parity.test.d.ts +2 -0
- package/lib/export/preview-pdf-parity.test.d.ts.map +1 -0
- package/lib/export/preview-pdf-parity.test.js +217 -0
- package/lib/export/preview-pdf-parity.test.js.map +1 -0
- package/lib/fields/barcode-encode.d.ts +33 -0
- package/lib/fields/barcode-encode.d.ts.map +1 -0
- package/lib/fields/barcode-encode.js +118 -0
- package/lib/fields/barcode-encode.js.map +1 -0
- package/lib/fields/barcode-encode.test.d.ts +2 -0
- package/lib/fields/barcode-encode.test.d.ts.map +1 -0
- package/lib/fields/barcode-encode.test.js +38 -0
- package/lib/fields/barcode-encode.test.js.map +1 -0
- package/lib/fields/collect-field-values.test.d.ts +2 -0
- package/lib/fields/collect-field-values.test.d.ts.map +1 -0
- package/lib/fields/collect-field-values.test.js +71 -0
- package/lib/fields/collect-field-values.test.js.map +1 -0
- package/lib/fields/columns-serialize.test.d.ts +2 -0
- package/lib/fields/columns-serialize.test.d.ts.map +1 -0
- package/lib/fields/columns-serialize.test.js +68 -0
- package/lib/fields/columns-serialize.test.js.map +1 -0
- package/lib/fields/cross-section-reposition.d.ts +19 -0
- package/lib/fields/cross-section-reposition.d.ts.map +1 -0
- package/lib/fields/cross-section-reposition.js +185 -0
- package/lib/fields/cross-section-reposition.js.map +1 -0
- package/lib/fields/cross-section-reposition.test.d.ts +2 -0
- package/lib/fields/cross-section-reposition.test.d.ts.map +1 -0
- package/lib/fields/cross-section-reposition.test.js +190 -0
- package/lib/fields/cross-section-reposition.test.js.map +1 -0
- package/lib/fields/document-preview.d.ts +10 -0
- package/lib/fields/document-preview.d.ts.map +1 -0
- package/lib/fields/document-preview.js +781 -0
- package/lib/fields/document-preview.js.map +1 -0
- package/lib/fields/document-preview.test.d.ts +2 -0
- package/lib/fields/document-preview.test.d.ts.map +1 -0
- package/lib/fields/document-preview.test.js +1433 -0
- package/lib/fields/document-preview.test.js.map +1 -0
- package/lib/fields/field-clipboard.d.ts +32 -0
- package/lib/fields/field-clipboard.d.ts.map +1 -0
- package/lib/fields/field-clipboard.js +642 -0
- package/lib/fields/field-clipboard.js.map +1 -0
- package/lib/fields/field-clipboard.test.d.ts +2 -0
- package/lib/fields/field-clipboard.test.d.ts.map +1 -0
- package/lib/fields/field-clipboard.test.js +281 -0
- package/lib/fields/field-clipboard.test.js.map +1 -0
- package/lib/fields/field-display-style.d.ts +76 -0
- package/lib/fields/field-display-style.d.ts.map +1 -0
- package/lib/fields/field-display-style.js +429 -0
- package/lib/fields/field-display-style.js.map +1 -0
- package/lib/fields/field-display-style.test.d.ts +2 -0
- package/lib/fields/field-display-style.test.d.ts.map +1 -0
- package/lib/fields/field-display-style.test.js +299 -0
- package/lib/fields/field-display-style.test.js.map +1 -0
- package/lib/fields/field-keyboard.d.ts +9 -0
- package/lib/fields/field-keyboard.d.ts.map +1 -0
- package/lib/fields/field-keyboard.js +1118 -0
- package/lib/fields/field-keyboard.js.map +1 -0
- package/lib/fields/field-keyboard.test.d.ts +2 -0
- package/lib/fields/field-keyboard.test.d.ts.map +1 -0
- package/lib/fields/field-keyboard.test.js +390 -0
- package/lib/fields/field-keyboard.test.js.map +1 -0
- package/lib/fields/field-selection.d.ts +12 -0
- package/lib/fields/field-selection.d.ts.map +1 -0
- package/lib/fields/field-selection.js +123 -0
- package/lib/fields/field-selection.js.map +1 -0
- package/lib/fields/field-selection.test.d.ts +2 -0
- package/lib/fields/field-selection.test.d.ts.map +1 -0
- package/lib/fields/field-selection.test.js +67 -0
- package/lib/fields/field-selection.test.js.map +1 -0
- package/lib/fields/field-token-drag.test.d.ts +2 -0
- package/lib/fields/field-token-drag.test.d.ts.map +1 -0
- package/lib/fields/field-token-drag.test.js +55 -0
- package/lib/fields/field-token-drag.test.js.map +1 -0
- package/lib/fields/fill-defaults.test.d.ts +2 -0
- package/lib/fields/fill-defaults.test.d.ts.map +1 -0
- package/lib/fields/fill-defaults.test.js +70 -0
- package/lib/fields/fill-defaults.test.js.map +1 -0
- package/lib/fields/fill-field-focus.d.ts +51 -0
- package/lib/fields/fill-field-focus.d.ts.map +1 -0
- package/lib/fields/fill-field-focus.js +230 -0
- package/lib/fields/fill-field-focus.js.map +1 -0
- package/lib/fields/fill-field-focus.test.d.ts +2 -0
- package/lib/fields/fill-field-focus.test.d.ts.map +1 -0
- package/lib/fields/fill-field-focus.test.js +201 -0
- package/lib/fields/fill-field-focus.test.js.map +1 -0
- package/lib/fields/handlers/builtins.d.ts +3 -0
- package/lib/fields/handlers/builtins.d.ts.map +1 -0
- package/lib/fields/handlers/builtins.js +869 -0
- package/lib/fields/handlers/builtins.js.map +1 -0
- package/lib/fields/handlers/index.d.ts +4 -0
- package/lib/fields/handlers/index.d.ts.map +1 -0
- package/lib/fields/handlers/index.js +5 -0
- package/lib/fields/handlers/index.js.map +1 -0
- package/lib/fields/handlers/registry.d.ts +27 -0
- package/lib/fields/handlers/registry.d.ts.map +1 -0
- package/lib/fields/handlers/registry.js +69 -0
- package/lib/fields/handlers/registry.js.map +1 -0
- package/lib/fields/handlers/registry.test.d.ts +2 -0
- package/lib/fields/handlers/registry.test.d.ts.map +1 -0
- package/lib/fields/handlers/registry.test.js +203 -0
- package/lib/fields/handlers/registry.test.js.map +1 -0
- package/lib/fields/handlers/schema-form-dom.d.ts +36 -0
- package/lib/fields/handlers/schema-form-dom.d.ts.map +1 -0
- package/lib/fields/handlers/schema-form-dom.js +114 -0
- package/lib/fields/handlers/schema-form-dom.js.map +1 -0
- package/lib/fields/heading-line-breaks.test.d.ts +2 -0
- package/lib/fields/heading-line-breaks.test.d.ts.map +1 -0
- package/lib/fields/heading-line-breaks.test.js +755 -0
- package/lib/fields/heading-line-breaks.test.js.map +1 -0
- package/lib/fields/inline-field-from-selection.test.d.ts +2 -0
- package/lib/fields/inline-field-from-selection.test.d.ts.map +1 -0
- package/lib/fields/inline-field-from-selection.test.js +185 -0
- package/lib/fields/inline-field-from-selection.test.js.map +1 -0
- package/lib/fields/inline-fields.d.ts +150 -0
- package/lib/fields/inline-fields.d.ts.map +1 -0
- package/lib/fields/inline-fields.js +3408 -0
- package/lib/fields/inline-fields.js.map +1 -0
- package/lib/fields/logical-display.d.ts +8 -0
- package/lib/fields/logical-display.d.ts.map +1 -0
- package/lib/fields/logical-display.js +29 -0
- package/lib/fields/logical-display.js.map +1 -0
- package/lib/fields/logical-display.test.d.ts +2 -0
- package/lib/fields/logical-display.test.d.ts.map +1 -0
- package/lib/fields/logical-display.test.js +31 -0
- package/lib/fields/logical-display.test.js.map +1 -0
- package/lib/fields/manual-field-values.d.ts +87 -0
- package/lib/fields/manual-field-values.d.ts.map +1 -0
- package/lib/fields/manual-field-values.js +189 -0
- package/lib/fields/manual-field-values.js.map +1 -0
- package/lib/fields/manual-field-values.test.d.ts +2 -0
- package/lib/fields/manual-field-values.test.d.ts.map +1 -0
- package/lib/fields/manual-field-values.test.js +84 -0
- package/lib/fields/manual-field-values.test.js.map +1 -0
- package/lib/fields/pivot-table-field.d.ts +25 -0
- package/lib/fields/pivot-table-field.d.ts.map +1 -0
- package/lib/fields/pivot-table-field.js +408 -0
- package/lib/fields/pivot-table-field.js.map +1 -0
- package/lib/fields/plain-text-newlines.test.d.ts +2 -0
- package/lib/fields/plain-text-newlines.test.d.ts.map +1 -0
- package/lib/fields/plain-text-newlines.test.js +40 -0
- package/lib/fields/plain-text-newlines.test.js.map +1 -0
- package/lib/fields/repeater-field.d.ts +10 -0
- package/lib/fields/repeater-field.d.ts.map +1 -0
- package/lib/fields/repeater-field.js +48 -0
- package/lib/fields/repeater-field.js.map +1 -0
- package/lib/fields/rich-text.d.ts +27 -0
- package/lib/fields/rich-text.d.ts.map +1 -0
- package/lib/fields/rich-text.js +984 -0
- package/lib/fields/rich-text.js.map +1 -0
- package/lib/fields/table-field.d.ts +57 -0
- package/lib/fields/table-field.d.ts.map +1 -0
- package/lib/fields/table-field.js +836 -0
- package/lib/fields/table-field.js.map +1 -0
- package/lib/fields/table-field.test.d.ts +2 -0
- package/lib/fields/table-field.test.d.ts.map +1 -0
- package/lib/fields/table-field.test.js +456 -0
- package/lib/fields/table-field.test.js.map +1 -0
- package/lib/fields/tree-paths.d.ts +5 -0
- package/lib/fields/tree-paths.d.ts.map +1 -0
- package/lib/fields/tree-paths.js +7 -0
- package/lib/fields/tree-paths.js.map +1 -0
- package/lib/fields/tree-selection.d.ts +9 -0
- package/lib/fields/tree-selection.d.ts.map +1 -0
- package/lib/fields/tree-selection.js +39 -0
- package/lib/fields/tree-selection.js.map +1 -0
- package/lib/fields/tree.d.ts +7 -0
- package/lib/fields/tree.d.ts.map +1 -0
- package/lib/fields/tree.js +7 -0
- package/lib/fields/tree.js.map +1 -0
- package/lib/fields/wire-columns-resize.d.ts +6 -0
- package/lib/fields/wire-columns-resize.d.ts.map +1 -0
- package/lib/fields/wire-columns-resize.js +130 -0
- package/lib/fields/wire-columns-resize.js.map +1 -0
- package/lib/fields/wire-columns-resize.test.d.ts +2 -0
- package/lib/fields/wire-columns-resize.test.d.ts.map +1 -0
- package/lib/fields/wire-columns-resize.test.js +38 -0
- package/lib/fields/wire-columns-resize.test.js.map +1 -0
- package/lib/fields/wire-editorjs-native-drop-guard.d.ts +34 -0
- package/lib/fields/wire-editorjs-native-drop-guard.d.ts.map +1 -0
- package/lib/fields/wire-editorjs-native-drop-guard.js +453 -0
- package/lib/fields/wire-editorjs-native-drop-guard.js.map +1 -0
- package/lib/fields/wire-editorjs-native-drop-guard.test.d.ts +2 -0
- package/lib/fields/wire-editorjs-native-drop-guard.test.d.ts.map +1 -0
- package/lib/fields/wire-editorjs-native-drop-guard.test.js +230 -0
- package/lib/fields/wire-editorjs-native-drop-guard.test.js.map +1 -0
- package/lib/fields/wire-table-column-reorder.d.ts +23 -0
- package/lib/fields/wire-table-column-reorder.d.ts.map +1 -0
- package/lib/fields/wire-table-column-reorder.js +207 -0
- package/lib/fields/wire-table-column-reorder.js.map +1 -0
- package/lib/fields/wire-table-column-reorder.test.d.ts +2 -0
- package/lib/fields/wire-table-column-reorder.test.d.ts.map +1 -0
- package/lib/fields/wire-table-column-reorder.test.js +133 -0
- package/lib/fields/wire-table-column-reorder.test.js.map +1 -0
- package/lib/fields/wire-table-column-resize.d.ts +118 -0
- package/lib/fields/wire-table-column-resize.d.ts.map +1 -0
- package/lib/fields/wire-table-column-resize.js +406 -0
- package/lib/fields/wire-table-column-resize.js.map +1 -0
- package/lib/fields/wire-table-column-resize.test.d.ts +2 -0
- package/lib/fields/wire-table-column-resize.test.d.ts.map +1 -0
- package/lib/fields/wire-table-column-resize.test.js +407 -0
- package/lib/fields/wire-table-column-resize.test.js.map +1 -0
- package/lib/index.d.ts +39 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +37 -0
- package/lib/index.js.map +1 -0
- package/lib/node.d.ts +20 -0
- package/lib/node.d.ts.map +1 -0
- package/lib/node.js +20 -0
- package/lib/node.js.map +1 -0
- package/lib/registry/registry-context.d.ts +6 -0
- package/lib/registry/registry-context.d.ts.map +1 -0
- package/lib/registry/registry-context.js +39 -0
- package/lib/registry/registry-context.js.map +1 -0
- package/lib/registry/schema-registry.d.ts +18 -0
- package/lib/registry/schema-registry.d.ts.map +1 -0
- package/lib/registry/schema-registry.js +67 -0
- package/lib/registry/schema-registry.js.map +1 -0
- package/lib/services/image-upload.d.ts +27 -0
- package/lib/services/image-upload.d.ts.map +1 -0
- package/lib/services/image-upload.js +159 -0
- package/lib/services/image-upload.js.map +1 -0
- package/lib/services/image-upload.test.d.ts +2 -0
- package/lib/services/image-upload.test.d.ts.map +1 -0
- package/lib/services/image-upload.test.js +141 -0
- package/lib/services/image-upload.test.js.map +1 -0
- package/lib/sf-entry.d.ts +5 -0
- package/lib/sf-entry.d.ts.map +1 -0
- package/lib/sf-entry.js +15 -0
- package/lib/sf-entry.js.map +1 -0
- package/lib/sf-pdf-viewer/main.d.ts +2 -0
- package/lib/sf-pdf-viewer/main.d.ts.map +1 -0
- package/lib/sf-pdf-viewer/main.js +57 -0
- package/lib/sf-pdf-viewer/main.js.map +1 -0
- package/lib/tools/document-section.d.ts +54 -0
- package/lib/tools/document-section.d.ts.map +1 -0
- package/lib/tools/document-section.js +591 -0
- package/lib/tools/document-section.js.map +1 -0
- package/lib/tools/template-block.d.ts +18 -0
- package/lib/tools/template-block.d.ts.map +1 -0
- package/lib/tools/template-block.js +243 -0
- package/lib/tools/template-block.js.map +1 -0
- package/lib/ui/action-icons.d.ts +10 -0
- package/lib/ui/action-icons.d.ts.map +1 -0
- package/lib/ui/action-icons.js +11 -0
- package/lib/ui/action-icons.js.map +1 -0
- package/lib/ui/document-actions.d.ts +12 -0
- package/lib/ui/document-actions.d.ts.map +1 -0
- package/lib/ui/document-actions.js +37 -0
- package/lib/ui/document-actions.js.map +1 -0
- package/lib/ui/drag-handle.d.ts +11 -0
- package/lib/ui/drag-handle.d.ts.map +1 -0
- package/lib/ui/drag-handle.js +38 -0
- package/lib/ui/drag-handle.js.map +1 -0
- package/lib/ui/existing-image-modal.d.ts +10 -0
- package/lib/ui/existing-image-modal.d.ts.map +1 -0
- package/lib/ui/existing-image-modal.js +153 -0
- package/lib/ui/existing-image-modal.js.map +1 -0
- package/lib/ui/field-form-modal.d.ts +33 -0
- package/lib/ui/field-form-modal.d.ts.map +1 -0
- package/lib/ui/field-form-modal.js +103 -0
- package/lib/ui/field-form-modal.js.map +1 -0
- package/lib/ui/field-form-modal.test.d.ts +2 -0
- package/lib/ui/field-form-modal.test.d.ts.map +1 -0
- package/lib/ui/field-form-modal.test.js +81 -0
- package/lib/ui/field-form-modal.test.js.map +1 -0
- package/lib/ui/field-mapping-badges.d.ts +9 -0
- package/lib/ui/field-mapping-badges.d.ts.map +1 -0
- package/lib/ui/field-mapping-badges.js +208 -0
- package/lib/ui/field-mapping-badges.js.map +1 -0
- package/lib/ui/field-mapping-badges.test.d.ts +2 -0
- package/lib/ui/field-mapping-badges.test.d.ts.map +1 -0
- package/lib/ui/field-mapping-badges.test.js +81 -0
- package/lib/ui/field-mapping-badges.test.js.map +1 -0
- package/lib/ui/field-mapping-modal-open.test.d.ts +2 -0
- package/lib/ui/field-mapping-modal-open.test.d.ts.map +1 -0
- package/lib/ui/field-mapping-modal-open.test.js +58 -0
- package/lib/ui/field-mapping-modal-open.test.js.map +1 -0
- package/lib/ui/field-mapping-modal.d.ts +4 -0
- package/lib/ui/field-mapping-modal.d.ts.map +1 -0
- package/lib/ui/field-mapping-modal.js +992 -0
- package/lib/ui/field-mapping-modal.js.map +1 -0
- package/lib/ui/filename-prompt.d.ts +6 -0
- package/lib/ui/filename-prompt.d.ts.map +1 -0
- package/lib/ui/filename-prompt.js +85 -0
- package/lib/ui/filename-prompt.js.map +1 -0
- package/lib/ui/format-icons.d.ts +23 -0
- package/lib/ui/format-icons.d.ts.map +1 -0
- package/lib/ui/format-icons.js +23 -0
- package/lib/ui/format-icons.js.map +1 -0
- package/lib/ui/html-text-modal.d.ts +6 -0
- package/lib/ui/html-text-modal.d.ts.map +1 -0
- package/lib/ui/html-text-modal.js +195 -0
- package/lib/ui/html-text-modal.js.map +1 -0
- package/lib/ui/image-modal.d.ts +6 -0
- package/lib/ui/image-modal.d.ts.map +1 -0
- package/lib/ui/image-modal.js +237 -0
- package/lib/ui/image-modal.js.map +1 -0
- package/lib/ui/integer-modal.d.ts +12 -0
- package/lib/ui/integer-modal.d.ts.map +1 -0
- package/lib/ui/integer-modal.js +71 -0
- package/lib/ui/integer-modal.js.map +1 -0
- package/lib/ui/list-modal.d.ts +6 -0
- package/lib/ui/list-modal.d.ts.map +1 -0
- package/lib/ui/list-modal.js +627 -0
- package/lib/ui/list-modal.js.map +1 -0
- package/lib/ui/list-modal.test.d.ts +2 -0
- package/lib/ui/list-modal.test.d.ts.map +1 -0
- package/lib/ui/list-modal.test.js +185 -0
- package/lib/ui/list-modal.test.js.map +1 -0
- package/lib/ui/logical-modal.d.ts +11 -0
- package/lib/ui/logical-modal.d.ts.map +1 -0
- package/lib/ui/logical-modal.js +104 -0
- package/lib/ui/logical-modal.js.map +1 -0
- package/lib/ui/mapping-drag-drop.d.ts +44 -0
- package/lib/ui/mapping-drag-drop.d.ts.map +1 -0
- package/lib/ui/mapping-drag-drop.js +339 -0
- package/lib/ui/mapping-drag-drop.js.map +1 -0
- package/lib/ui/mapping-drag-drop.test.d.ts +2 -0
- package/lib/ui/mapping-drag-drop.test.d.ts.map +1 -0
- package/lib/ui/mapping-drag-drop.test.js +47 -0
- package/lib/ui/mapping-drag-drop.test.js.map +1 -0
- package/lib/ui/mapping-result-helper.d.ts +130 -0
- package/lib/ui/mapping-result-helper.d.ts.map +1 -0
- package/lib/ui/mapping-result-helper.js +640 -0
- package/lib/ui/mapping-result-helper.js.map +1 -0
- package/lib/ui/mapping-result-helper.test.d.ts +2 -0
- package/lib/ui/mapping-result-helper.test.d.ts.map +1 -0
- package/lib/ui/mapping-result-helper.test.js +147 -0
- package/lib/ui/mapping-result-helper.test.js.map +1 -0
- package/lib/ui/modal-picker-keyboard.d.ts +12 -0
- package/lib/ui/modal-picker-keyboard.d.ts.map +1 -0
- package/lib/ui/modal-picker-keyboard.js +72 -0
- package/lib/ui/modal-picker-keyboard.js.map +1 -0
- package/lib/ui/modal-picker-keyboard.test.d.ts +2 -0
- package/lib/ui/modal-picker-keyboard.test.d.ts.map +1 -0
- package/lib/ui/modal-picker-keyboard.test.js +53 -0
- package/lib/ui/modal-picker-keyboard.test.js.map +1 -0
- package/lib/ui/modal-picker-pills.d.ts +2 -0
- package/lib/ui/modal-picker-pills.d.ts.map +1 -0
- package/lib/ui/modal-picker-pills.js +26 -0
- package/lib/ui/modal-picker-pills.js.map +1 -0
- package/lib/ui/notification.d.ts +2 -0
- package/lib/ui/notification.d.ts.map +1 -0
- package/lib/ui/notification.js +47 -0
- package/lib/ui/notification.js.map +1 -0
- package/lib/ui/palette-icons.d.ts +5 -0
- package/lib/ui/palette-icons.d.ts.map +1 -0
- package/lib/ui/palette-icons.js +28 -0
- package/lib/ui/palette-icons.js.map +1 -0
- package/lib/ui/pdf-canvas-preview.d.ts +11 -0
- package/lib/ui/pdf-canvas-preview.d.ts.map +1 -0
- package/lib/ui/pdf-canvas-preview.js +88 -0
- package/lib/ui/pdf-canvas-preview.js.map +1 -0
- package/lib/ui/preview-modal.d.ts +24 -0
- package/lib/ui/preview-modal.d.ts.map +1 -0
- package/lib/ui/preview-modal.js +536 -0
- package/lib/ui/preview-modal.js.map +1 -0
- package/lib/ui/recent-fill-colors.d.ts +21 -0
- package/lib/ui/recent-fill-colors.d.ts.map +1 -0
- package/lib/ui/recent-fill-colors.js +95 -0
- package/lib/ui/recent-fill-colors.js.map +1 -0
- package/lib/ui/recent-fill-colors.test.d.ts +2 -0
- package/lib/ui/recent-fill-colors.test.d.ts.map +1 -0
- package/lib/ui/recent-fill-colors.test.js +56 -0
- package/lib/ui/recent-fill-colors.test.js.map +1 -0
- package/lib/ui/repeater-editor-modal.d.ts +10 -0
- package/lib/ui/repeater-editor-modal.d.ts.map +1 -0
- package/lib/ui/repeater-editor-modal.js +124 -0
- package/lib/ui/repeater-editor-modal.js.map +1 -0
- package/lib/ui/rich-text-toolbar.d.ts +13 -0
- package/lib/ui/rich-text-toolbar.d.ts.map +1 -0
- package/lib/ui/rich-text-toolbar.js +670 -0
- package/lib/ui/rich-text-toolbar.js.map +1 -0
- package/lib/ui/rich-text-toolbar.test.d.ts +2 -0
- package/lib/ui/rich-text-toolbar.test.d.ts.map +1 -0
- package/lib/ui/rich-text-toolbar.test.js +167 -0
- package/lib/ui/rich-text-toolbar.test.js.map +1 -0
- package/lib/ui/signature-modal.d.ts +13 -0
- package/lib/ui/signature-modal.d.ts.map +1 -0
- package/lib/ui/signature-modal.js +219 -0
- package/lib/ui/signature-modal.js.map +1 -0
- package/lib/ui/source-path-canvas-drop.d.ts +121 -0
- package/lib/ui/source-path-canvas-drop.d.ts.map +1 -0
- package/lib/ui/source-path-canvas-drop.js +300 -0
- package/lib/ui/source-path-canvas-drop.js.map +1 -0
- package/lib/ui/source-path-canvas-drop.test.d.ts +2 -0
- package/lib/ui/source-path-canvas-drop.test.d.ts.map +1 -0
- package/lib/ui/source-path-canvas-drop.test.js +216 -0
- package/lib/ui/source-path-canvas-drop.test.js.map +1 -0
- package/lib/ui/source-schema-tree.d.ts +33 -0
- package/lib/ui/source-schema-tree.d.ts.map +1 -0
- package/lib/ui/source-schema-tree.js +322 -0
- package/lib/ui/source-schema-tree.js.map +1 -0
- package/lib/ui/text-modal.d.ts +13 -0
- package/lib/ui/text-modal.d.ts.map +1 -0
- package/lib/ui/text-modal.js +31 -0
- package/lib/ui/text-modal.js.map +1 -0
- package/lib/ui/tree-modal.d.ts +8 -0
- package/lib/ui/tree-modal.d.ts.map +1 -0
- package/lib/ui/tree-modal.js +586 -0
- package/lib/ui/tree-modal.js.map +1 -0
- package/lib/ui/tree-modal.test.d.ts +2 -0
- package/lib/ui/tree-modal.test.d.ts.map +1 -0
- package/lib/ui/tree-modal.test.js +390 -0
- package/lib/ui/tree-modal.test.js.map +1 -0
- package/lib/ui/wire-modal-escape.d.ts +13 -0
- package/lib/ui/wire-modal-escape.d.ts.map +1 -0
- package/lib/ui/wire-modal-escape.js +26 -0
- package/lib/ui/wire-modal-escape.js.map +1 -0
- package/lib/ui/wire-modal-escape.test.d.ts +2 -0
- package/lib/ui/wire-modal-escape.test.d.ts.map +1 -0
- package/lib/ui/wire-modal-escape.test.js +57 -0
- package/lib/ui/wire-modal-escape.test.js.map +1 -0
- package/lib/ui/wire-modal-focus-trap.test.d.ts +2 -0
- package/lib/ui/wire-modal-focus-trap.test.d.ts.map +1 -0
- package/lib/ui/wire-modal-focus-trap.test.js +264 -0
- package/lib/ui/wire-modal-focus-trap.test.js.map +1 -0
- package/lib/ui/wire-modal-move.d.ts +23 -0
- package/lib/ui/wire-modal-move.d.ts.map +1 -0
- package/lib/ui/wire-modal-move.js +179 -0
- package/lib/ui/wire-modal-move.js.map +1 -0
- package/lib/ui/wire-modal-move.test.d.ts +2 -0
- package/lib/ui/wire-modal-move.test.d.ts.map +1 -0
- package/lib/ui/wire-modal-move.test.js +84 -0
- package/lib/ui/wire-modal-move.test.js.map +1 -0
- package/lib/ui/wire-modal-palette.d.ts +56 -0
- package/lib/ui/wire-modal-palette.d.ts.map +1 -0
- package/lib/ui/wire-modal-palette.js +501 -0
- package/lib/ui/wire-modal-palette.js.map +1 -0
- package/lib/ui/wire-modal-resize.d.ts +27 -0
- package/lib/ui/wire-modal-resize.d.ts.map +1 -0
- package/lib/ui/wire-modal-resize.js +146 -0
- package/lib/ui/wire-modal-resize.js.map +1 -0
- package/lib/ui/wire-modal-resize.test.d.ts +2 -0
- package/lib/ui/wire-modal-resize.test.d.ts.map +1 -0
- package/lib/ui/wire-modal-resize.test.js +61 -0
- package/lib/ui/wire-modal-resize.test.js.map +1 -0
- package/lib/ui/wire-panel-splitter.d.ts +67 -0
- package/lib/ui/wire-panel-splitter.d.ts.map +1 -0
- package/lib/ui/wire-panel-splitter.js +361 -0
- package/lib/ui/wire-panel-splitter.js.map +1 -0
- package/lib/ui/wire-panel-splitter.test.d.ts +2 -0
- package/lib/ui/wire-panel-splitter.test.d.ts.map +1 -0
- package/lib/ui/wire-panel-splitter.test.js +152 -0
- package/lib/ui/wire-panel-splitter.test.js.map +1 -0
- package/lib/utils/export-filename.d.ts +24 -0
- package/lib/utils/export-filename.d.ts.map +1 -0
- package/lib/utils/export-filename.js +42 -0
- package/lib/utils/export-filename.js.map +1 -0
- package/lib/utils/export-filename.test.d.ts +2 -0
- package/lib/utils/export-filename.test.d.ts.map +1 -0
- package/lib/utils/export-filename.test.js +42 -0
- package/lib/utils/export-filename.test.js.map +1 -0
- package/lib/utils/print-document.d.ts +17 -0
- package/lib/utils/print-document.d.ts.map +1 -0
- package/lib/utils/print-document.js +132 -0
- package/lib/utils/print-document.js.map +1 -0
- package/lib/utils/save-blob.d.ts +9 -0
- package/lib/utils/save-blob.d.ts.map +1 -0
- package/lib/utils/save-blob.js +41 -0
- package/lib/utils/save-blob.js.map +1 -0
- package/lib/web-component.d.ts +6 -0
- package/lib/web-component.d.ts.map +1 -0
- package/lib/web-component.js +59 -0
- package/lib/web-component.js.map +1 -0
- package/package.json +61 -6
- package/src/catalog/catalog-provider.ts +91 -0
- package/src/core/computed-formula.test.ts +258 -0
- package/src/core/computed-formula.ts +18 -0
- package/src/core/document-display-defaults.ts +13 -0
- package/src/core/document-history.test.ts +54 -0
- package/src/core/document-history.ts +102 -0
- package/src/core/document-io.test.ts +739 -0
- package/src/core/document-io.ts +27 -0
- package/src/core/document-section-defaults.test.ts +56 -0
- package/src/core/document-section-defaults.ts +67 -0
- package/src/core/field-id.test.ts +299 -0
- package/src/core/field-id.ts +23 -0
- package/src/core/field-io/sectioned-document-io.test.ts +568 -0
- package/src/core/field-io/sectioned-document-io.ts +15 -0
- package/src/core/field-io/table-field-io.test.ts +242 -0
- package/src/core/field-io/table-field-io.ts +13 -0
- package/src/core/field-schemas.test.ts +472 -0
- package/src/core/field-schemas.ts +46 -0
- package/src/core/formula-field-index.test.ts +140 -0
- package/src/core/formula-field-index.ts +16 -0
- package/src/core/page-setup-styles.test.ts +274 -0
- package/src/core/page-setup-styles.ts +213 -0
- package/src/core/repeater-io.test.ts +899 -0
- package/src/core/repeater-io.ts +37 -0
- package/src/core/segment-tree.test.ts +41 -0
- package/src/core/segment-tree.ts +6 -0
- package/src/create-editor.ts +3848 -0
- package/src/design/collection-tree-picker.test.ts +105 -0
- package/src/design/collection-tree-picker.ts +340 -0
- package/src/design/design-mode.ts +7 -0
- package/src/design/design-shell.ts +76 -0
- package/src/design/display-style-form.test.ts +174 -0
- package/src/design/display-style-form.ts +217 -0
- package/src/design/field-highlight-form.test.ts +64 -0
- package/src/design/field-highlight-form.ts +169 -0
- package/src/design/field-palette.test.ts +97 -0
- package/src/design/field-palette.ts +250 -0
- package/src/design/formula-field-picker.test.ts +158 -0
- package/src/design/formula-field-picker.ts +189 -0
- package/src/design/palette-block-drop.ts +66 -0
- package/src/design/properties-panel.ts +900 -0
- package/src/design/schema-editor-controller.test.ts +296 -0
- package/src/design/schema-editor-controller.ts +1122 -0
- package/src/design/schema-editor-modal.ts +83 -0
- package/src/design/schema-items-designer-modal.ts +209 -0
- package/src/design/schema-items-designer.test.ts +148 -0
- package/src/design/schema-items-designer.ts +442 -0
- package/src/design/style-toolbar-shared.ts +218 -0
- package/src/dom-pragmatic.d.ts +83 -0
- package/src/domain/ophthalmology/catalogs.ts +72 -0
- package/src/domain/ophthalmology/life-anamnesis-tree.ts +43 -0
- package/src/domain/ophthalmology/norm-options.ts +24 -0
- package/src/domain/ophthalmology/ophthalmology-complaints-tree.ts +47 -0
- package/src/domain/ophthalmology/ophthalmology-diagnoses.ts +12 -0
- package/src/domain/ophthalmology/vision-values.ts +58 -0
- package/src/editorjs-shim.d.ts +2 -0
- package/src/export/document-pdf.sf-stub.ts +23 -0
- package/src/export/document-pdf.ts +44 -0
- package/src/export/preview-export-options.ts +29 -0
- package/src/export/preview-html-document.ts +34 -0
- package/src/export/preview-html-styles.test.ts +60 -0
- package/src/export/preview-html-styles.ts +551 -0
- package/src/export/preview-pdf-mount.ts +48 -0
- package/src/export/preview-pdf-parity.test.ts +237 -0
- package/src/fields/barcode-encode.test.ts +43 -0
- package/src/fields/barcode-encode.ts +147 -0
- package/src/fields/collect-field-values.test.ts +95 -0
- package/src/fields/columns-serialize.test.ts +75 -0
- package/src/fields/cross-section-reposition.test.ts +206 -0
- package/src/fields/cross-section-reposition.ts +214 -0
- package/src/fields/document-preview.test.ts +1621 -0
- package/src/fields/document-preview.ts +910 -0
- package/src/fields/field-clipboard.test.ts +312 -0
- package/src/fields/field-clipboard.ts +705 -0
- package/src/fields/field-display-style.test.ts +403 -0
- package/src/fields/field-display-style.ts +435 -0
- package/src/fields/field-keyboard.test.ts +446 -0
- package/src/fields/field-keyboard.ts +1281 -0
- package/src/fields/field-selection.test.ts +85 -0
- package/src/fields/field-selection.ts +137 -0
- package/src/fields/field-token-drag.test.ts +65 -0
- package/src/fields/fill-defaults.test.ts +89 -0
- package/src/fields/fill-field-focus.test.ts +239 -0
- package/src/fields/fill-field-focus.ts +249 -0
- package/src/fields/handlers/builtins.ts +879 -0
- package/src/fields/handlers/index.ts +16 -0
- package/src/fields/handlers/registry.test.ts +266 -0
- package/src/fields/handlers/registry.ts +88 -0
- package/src/fields/handlers/schema-form-dom.ts +135 -0
- package/src/fields/heading-line-breaks.test.ts +931 -0
- package/src/fields/inline-field-from-selection.test.ts +202 -0
- package/src/fields/inline-fields.ts +3760 -0
- package/src/fields/logical-display.test.ts +37 -0
- package/src/fields/logical-display.ts +29 -0
- package/src/fields/manual-field-values.test.ts +152 -0
- package/src/fields/manual-field-values.ts +207 -0
- package/src/fields/pivot-table-field.ts +458 -0
- package/src/fields/plain-text-newlines.test.ts +48 -0
- package/src/fields/repeater-field.ts +61 -0
- package/src/fields/rich-text.ts +1018 -0
- package/src/fields/table-field.test.ts +504 -0
- package/src/fields/table-field.ts +1026 -0
- package/src/fields/tree-paths.ts +6 -0
- package/src/fields/tree-selection.ts +50 -0
- package/src/fields/tree.ts +11 -0
- package/src/fields/wire-columns-resize.test.ts +40 -0
- package/src/fields/wire-columns-resize.ts +138 -0
- package/src/fields/wire-editorjs-native-drop-guard.test.ts +273 -0
- package/src/fields/wire-editorjs-native-drop-guard.ts +491 -0
- package/src/fields/wire-table-column-reorder.test.ts +163 -0
- package/src/fields/wire-table-column-reorder.ts +223 -0
- package/src/fields/wire-table-column-resize.test.ts +459 -0
- package/src/fields/wire-table-column-resize.ts +433 -0
- package/src/index.ts +287 -0
- package/src/node.ts +114 -0
- package/src/registry/registry-context.ts +36 -0
- package/src/registry/schema-registry.ts +80 -0
- package/src/services/image-upload.test.ts +180 -0
- package/src/services/image-upload.ts +185 -0
- package/src/sf-entry.ts +19 -0
- package/src/sf-pdf-viewer/main.ts +57 -0
- package/src/sf-pdf-viewer/viewer.html +40 -0
- package/src/styles/editor.css +5450 -0
- package/src/themes/bridge.css +1952 -0
- package/src/themes/prime.css +116 -0
- package/src/themes/slds.css +123 -0
- package/src/tools/document-section.ts +692 -0
- package/src/tools/template-block.ts +289 -0
- package/src/types.d.ts +1782 -0
- package/src/ui/action-icons.ts +13 -0
- package/src/ui/document-actions.ts +41 -0
- package/src/ui/drag-handle.ts +52 -0
- package/src/ui/existing-image-modal.ts +164 -0
- package/src/ui/field-form-modal.test.ts +92 -0
- package/src/ui/field-form-modal.ts +168 -0
- package/src/ui/field-mapping-badges.test.ts +93 -0
- package/src/ui/field-mapping-badges.ts +243 -0
- package/src/ui/field-mapping-modal-open.test.ts +72 -0
- package/src/ui/field-mapping-modal.ts +1277 -0
- package/src/ui/filename-prompt.ts +96 -0
- package/src/ui/format-icons.ts +42 -0
- package/src/ui/html-text-modal.ts +224 -0
- package/src/ui/image-modal.ts +264 -0
- package/src/ui/integer-modal.ts +76 -0
- package/src/ui/list-modal.test.ts +220 -0
- package/src/ui/list-modal.ts +701 -0
- package/src/ui/mapping-drag-drop.test.ts +61 -0
- package/src/ui/mapping-drag-drop.ts +382 -0
- package/src/ui/mapping-result-helper.test.ts +190 -0
- package/src/ui/mapping-result-helper.ts +707 -0
- package/src/ui/modal-picker-keyboard.test.ts +65 -0
- package/src/ui/modal-picker-keyboard.ts +87 -0
- package/src/ui/modal-picker-pills.ts +31 -0
- package/src/ui/notification.ts +54 -0
- package/src/ui/palette-icons.ts +64 -0
- package/src/ui/pdf-canvas-preview.ts +93 -0
- package/src/ui/preview-modal.ts +580 -0
- package/src/ui/recent-fill-colors.test.ts +66 -0
- package/src/ui/recent-fill-colors.ts +91 -0
- package/src/ui/repeater-editor-modal.ts +137 -0
- package/src/ui/rich-text-toolbar.test.ts +180 -0
- package/src/ui/rich-text-toolbar.ts +740 -0
- package/src/ui/signature-modal.ts +240 -0
- package/src/ui/source-path-canvas-drop.test.ts +256 -0
- package/src/ui/source-path-canvas-drop.ts +367 -0
- package/src/ui/source-schema-tree.ts +381 -0
- package/src/ui/text-modal.ts +37 -0
- package/src/ui/tree-modal.test.ts +484 -0
- package/src/ui/tree-modal.ts +682 -0
- package/src/ui/wire-modal-escape.test.ts +66 -0
- package/src/ui/wire-modal-escape.ts +23 -0
- package/src/ui/wire-modal-focus-trap.test.ts +307 -0
- package/src/ui/wire-modal-move.test.ts +107 -0
- package/src/ui/wire-modal-move.ts +201 -0
- package/src/ui/wire-modal-palette.ts +533 -0
- package/src/ui/wire-modal-resize.test.ts +76 -0
- package/src/ui/wire-modal-resize.ts +176 -0
- package/src/ui/wire-panel-splitter.test.ts +178 -0
- package/src/ui/wire-panel-splitter.ts +381 -0
- package/src/utils/export-filename.test.ts +54 -0
- package/src/utils/export-filename.ts +58 -0
- package/src/utils/print-document.ts +136 -0
- package/src/utils/save-blob.ts +40 -0
- package/src/web-component.ts +68 -0
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,1782 @@
|
|
|
1
|
+
/** @docengine/editor — TypeScript declarations */
|
|
2
|
+
|
|
3
|
+
export const IO_VERSION = 2;
|
|
4
|
+
|
|
5
|
+
export type FieldType =
|
|
6
|
+
| 'text'
|
|
7
|
+
| 'integer'
|
|
8
|
+
| 'date'
|
|
9
|
+
| 'logical'
|
|
10
|
+
| 'choice'
|
|
11
|
+
| 'list'
|
|
12
|
+
| 'tree'
|
|
13
|
+
| 'image'
|
|
14
|
+
| 'signature'
|
|
15
|
+
| 'barcode'
|
|
16
|
+
| 'table'
|
|
17
|
+
| 'pivotTable'
|
|
18
|
+
| 'child'
|
|
19
|
+
| 'computed';
|
|
20
|
+
|
|
21
|
+
export type BarcodeSymbology = 'qr' | 'code128' | 'ean13' | 'code39';
|
|
22
|
+
|
|
23
|
+
export type PivotAggregation = 'sum' | 'count' | 'avg' | 'min' | 'max' | 'first';
|
|
24
|
+
export type PivotSort = 'asc' | 'desc' | 'none';
|
|
25
|
+
|
|
26
|
+
export type TextAlign = 'left' | 'center' | 'right';
|
|
27
|
+
|
|
28
|
+
export interface ImageValue {
|
|
29
|
+
url: string;
|
|
30
|
+
caption?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type FieldValue =
|
|
34
|
+
| string
|
|
35
|
+
| string[]
|
|
36
|
+
| boolean
|
|
37
|
+
| ImageValue
|
|
38
|
+
| PivotTableValue
|
|
39
|
+
| RepeaterValue
|
|
40
|
+
| null
|
|
41
|
+
| undefined;
|
|
42
|
+
|
|
43
|
+
/** Document export shape for a table field: one object per row keyed by column keys. */
|
|
44
|
+
export type TableDocumentRows = Array<Record<string, FieldValue>>;
|
|
45
|
+
|
|
46
|
+
export interface ListItem {
|
|
47
|
+
id: string;
|
|
48
|
+
label: string;
|
|
49
|
+
code?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface TreeNode {
|
|
53
|
+
id?: string;
|
|
54
|
+
label: string;
|
|
55
|
+
children?: TreeNode[];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface FieldDisplayStyle {
|
|
59
|
+
fontFamily?: string;
|
|
60
|
+
fontSize?: string;
|
|
61
|
+
fontWeight?: 'normal' | 'bold';
|
|
62
|
+
fontStyle?: 'normal' | 'italic';
|
|
63
|
+
color?: string;
|
|
64
|
+
/** Cell / field background fill (e.g. table column shading). */
|
|
65
|
+
backgroundColor?: string;
|
|
66
|
+
textDecoration?: 'none' | 'underline' | 'line-through';
|
|
67
|
+
textAlign?: TextAlign;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface FieldValueStyleOptions {
|
|
71
|
+
/** Default display styling for field values when a field has no displayStyle override. */
|
|
72
|
+
default?: FieldDisplayStyle;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Mention-style colors for editable fields in fill mode. */
|
|
76
|
+
export interface FieldHighlightStyle {
|
|
77
|
+
/** Text and underline color. */
|
|
78
|
+
color?: string;
|
|
79
|
+
backgroundColor?: string;
|
|
80
|
+
/** Highlight text weight (500 = medium, 600 = semibold). */
|
|
81
|
+
fontWeight?: '500' | '600';
|
|
82
|
+
/** Bottom border width, e.g. `1px` or `2px`. */
|
|
83
|
+
borderWidth?: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface FieldSchemaBase {
|
|
87
|
+
type: FieldType;
|
|
88
|
+
/** Export / logical field name (design-editable). */
|
|
89
|
+
name: string;
|
|
90
|
+
label: string;
|
|
91
|
+
required?: boolean;
|
|
92
|
+
/** When true, the field cannot be edited interactively in fill mode. */
|
|
93
|
+
readonly?: boolean;
|
|
94
|
+
/** Per-field value display styling; overrides createEditor fieldValueStyle.default. */
|
|
95
|
+
displayStyle?: FieldDisplayStyle;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface TextFieldSchema extends FieldSchemaBase {
|
|
99
|
+
type: 'text';
|
|
100
|
+
defaultText?: string;
|
|
101
|
+
/** WYSIWYG HTML picker and rendered HTML in field value. */
|
|
102
|
+
htmlEditor?: boolean;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface IntegerFieldSchema extends FieldSchemaBase {
|
|
106
|
+
type: 'integer';
|
|
107
|
+
min?: number;
|
|
108
|
+
max?: number;
|
|
109
|
+
defaultValue?: string | number;
|
|
110
|
+
/** Unit text appended for plain/number display (e.g. mmHg). Not stored in the value. */
|
|
111
|
+
suffix?: string;
|
|
112
|
+
/**
|
|
113
|
+
* How the number is shown in the document / PDF.
|
|
114
|
+
* - `plain` (default): raw value + optional suffix
|
|
115
|
+
* - `number`: locale-grouped number (optional fractionDigits + suffix)
|
|
116
|
+
* - `currency`: locale currency via `currencyCode` (default EUR)
|
|
117
|
+
*/
|
|
118
|
+
displayFormat?: 'plain' | 'number' | 'currency';
|
|
119
|
+
/** ISO 4217 code when `displayFormat` is `currency`. Default: `EUR`. */
|
|
120
|
+
currencyCode?: string;
|
|
121
|
+
/** Fraction digits for `number` / `currency` display. */
|
|
122
|
+
fractionDigits?: number;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** Display format for date field values. Stored value remains ISO `YYYY-MM-DD`. */
|
|
126
|
+
export type DateDisplayFormat = 'iso' | 'dd/mm/yyyy' | 'mm/dd/yyyy' | 'd mmm yyyy' | 'custom';
|
|
127
|
+
|
|
128
|
+
export interface DateFieldSchema extends FieldSchemaBase {
|
|
129
|
+
type: 'date';
|
|
130
|
+
defaultMode?: 'today' | 'fixed';
|
|
131
|
+
defaultDate?: string;
|
|
132
|
+
/** How the date is shown in the document / PDF. Default: `dd/mm/yyyy`. */
|
|
133
|
+
dateFormat?: DateDisplayFormat;
|
|
134
|
+
/** Pattern when `dateFormat` is `custom` (tokens: YYYY YY MMMM MMM MM M DD D). */
|
|
135
|
+
customDateFormat?: string;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export type ListSource = 'static' | 'remote';
|
|
139
|
+
|
|
140
|
+
export interface RemoteListCollectionOption {
|
|
141
|
+
id: string;
|
|
142
|
+
label: string;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface RemoteListCollectionTreeNode {
|
|
146
|
+
id: string;
|
|
147
|
+
label: string;
|
|
148
|
+
kind: 'folder' | 'collection' | 'preset';
|
|
149
|
+
/** Directus collection slug for collection and preset nodes. */
|
|
150
|
+
collectionId?: string;
|
|
151
|
+
/** Directus preset id when kind is preset. */
|
|
152
|
+
presetId?: string;
|
|
153
|
+
children?: RemoteListCollectionTreeNode[];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface RemoteListCollectionCatalog {
|
|
157
|
+
bookmarks?: RemoteListCollectionOption[];
|
|
158
|
+
tree: RemoteListCollectionTreeNode[];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export interface RemoteListLabelFieldOption {
|
|
162
|
+
id: string;
|
|
163
|
+
label: string;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface ChoiceFieldSchema extends FieldSchemaBase {
|
|
167
|
+
type: 'choice';
|
|
168
|
+
multi?: false;
|
|
169
|
+
items?: ListItem[];
|
|
170
|
+
commonListId?: string;
|
|
171
|
+
/** When `'remote'`, options are fetched via `resolveListItems` at picker open / search. */
|
|
172
|
+
listSource?: ListSource;
|
|
173
|
+
/** Collection key passed to the host `resolveListItems` implementation (e.g. Directus collection). */
|
|
174
|
+
sourceCollection?: string;
|
|
175
|
+
/** Field on `sourceCollection` used as the option label. */
|
|
176
|
+
sourceLabelField?: string;
|
|
177
|
+
/** Directus bookmark preset id (`directus_presets`) applied when querying options. */
|
|
178
|
+
sourcePresetId?: string;
|
|
179
|
+
withCode?: boolean;
|
|
180
|
+
defaultValue?: string;
|
|
181
|
+
/** When true, users can enter free text outside catalog options. */
|
|
182
|
+
allowManualEdit?: boolean;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export interface ListFieldSchema extends FieldSchemaBase {
|
|
186
|
+
type: 'list';
|
|
187
|
+
multi?: true;
|
|
188
|
+
items?: ListItem[];
|
|
189
|
+
commonListId?: string;
|
|
190
|
+
listSource?: ListSource;
|
|
191
|
+
sourceCollection?: string;
|
|
192
|
+
sourceLabelField?: string;
|
|
193
|
+
sourcePresetId?: string;
|
|
194
|
+
withCode?: boolean;
|
|
195
|
+
itemLayout?: 'inline' | 'lines' | 'bullet' | 'numeric' | 'custom';
|
|
196
|
+
itemPrefix?: string;
|
|
197
|
+
defaultValue?: string[];
|
|
198
|
+
/** When true, users can enter free text outside catalog options. */
|
|
199
|
+
allowManualEdit?: boolean;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export interface TreeFieldSchema extends FieldSchemaBase {
|
|
203
|
+
type: 'tree';
|
|
204
|
+
tree?: TreeNode[];
|
|
205
|
+
commonTreeId?: string;
|
|
206
|
+
defaultValue?: string[];
|
|
207
|
+
/** When true, users can enter free text outside catalog options. */
|
|
208
|
+
allowManualEdit?: boolean;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export interface ImageFieldSchema extends FieldSchemaBase {
|
|
212
|
+
type: 'image';
|
|
213
|
+
maxWidth?: number;
|
|
214
|
+
altText?: string;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export interface LogicalFieldSchema extends FieldSchemaBase {
|
|
218
|
+
type: 'logical';
|
|
219
|
+
defaultValue?: boolean | null;
|
|
220
|
+
/** How true values are shown: Yes/No (default), X, or ✓. False is blank for mark modes. */
|
|
221
|
+
trueMark?: 'yesNo' | 'x' | 'check';
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export interface SignatureFieldSchema extends FieldSchemaBase {
|
|
225
|
+
type: 'signature';
|
|
226
|
+
maxWidth?: number;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export interface BarcodeFieldSchema extends FieldSchemaBase {
|
|
230
|
+
type: 'barcode';
|
|
231
|
+
symbology?: BarcodeSymbology;
|
|
232
|
+
maxWidth?: number;
|
|
233
|
+
/** 1D bar height (bwip-js units); ignored for QR. */
|
|
234
|
+
height?: number;
|
|
235
|
+
/** Human-readable text under 1D bars. */
|
|
236
|
+
displayValue?: boolean;
|
|
237
|
+
quietZone?: boolean;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export interface PivotTableFieldSchema extends FieldSchemaBase {
|
|
241
|
+
type: 'pivotTable';
|
|
242
|
+
rowProperty?: string;
|
|
243
|
+
columnProperty?: string;
|
|
244
|
+
valueProperty?: string;
|
|
245
|
+
aggregation?: PivotAggregation;
|
|
246
|
+
showRowTotals?: boolean;
|
|
247
|
+
showColumnTotals?: boolean;
|
|
248
|
+
showGrandTotal?: boolean;
|
|
249
|
+
emptyCell?: string;
|
|
250
|
+
sortRows?: PivotSort;
|
|
251
|
+
sortColumns?: PivotSort;
|
|
252
|
+
/** Display format for aggregation / total cells (same as Number fields). */
|
|
253
|
+
displayFormat?: 'plain' | 'number' | 'currency';
|
|
254
|
+
/** ISO 4217 code when `displayFormat` is `currency`. Default: `EUR`. */
|
|
255
|
+
currencyCode?: string;
|
|
256
|
+
fractionDigits?: number;
|
|
257
|
+
/** Optional unit suffix for plain/number cells (e.g. `kg`). */
|
|
258
|
+
suffix?: string;
|
|
259
|
+
/** Horizontal alignment for aggregation value cells (not row labels). */
|
|
260
|
+
valueAlign?: TextAlign;
|
|
261
|
+
/** Width of the first (row-label) column, e.g. `8em` or `120px`. */
|
|
262
|
+
rowLabelWidth?: string;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export interface PivotColumnDef {
|
|
266
|
+
key: string;
|
|
267
|
+
label: string;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export interface PivotRowValue {
|
|
271
|
+
key: string;
|
|
272
|
+
label: string;
|
|
273
|
+
cells: Record<string, number | string | null>;
|
|
274
|
+
rowTotal?: number | string | null;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/** Structured value written by auto-pivot mapping. */
|
|
278
|
+
export interface PivotTableValue {
|
|
279
|
+
columns: PivotColumnDef[];
|
|
280
|
+
rows: PivotRowValue[];
|
|
281
|
+
columnTotals?: Record<string, number | string | null>;
|
|
282
|
+
grandTotal?: number | string | null;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export interface TableColumnDef {
|
|
286
|
+
key: string;
|
|
287
|
+
label: string;
|
|
288
|
+
/** Logical column field name; defaults to label. Used to derive `key`. */
|
|
289
|
+
name?: string;
|
|
290
|
+
/** CSS width, e.g. `120px`, `25%`, `auto`. */
|
|
291
|
+
width?: string;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export interface TableFieldSchema extends FieldSchemaBase {
|
|
295
|
+
type: 'table';
|
|
296
|
+
columns: TableColumnDef[];
|
|
297
|
+
rows?: Array<{ key: string; label: string }>;
|
|
298
|
+
cellType?: 'choice' | 'list' | 'text' | 'integer';
|
|
299
|
+
cellItems?: ListItem[];
|
|
300
|
+
cellCommonListId?: string;
|
|
301
|
+
/** Applied to choice/list table cells when set to `'remote'`. */
|
|
302
|
+
cellListSource?: ListSource;
|
|
303
|
+
cellSourceCollection?: string;
|
|
304
|
+
cellSourceLabelField?: string;
|
|
305
|
+
/** When true, omit the column header row. */
|
|
306
|
+
hideHeader?: boolean;
|
|
307
|
+
/** When true, render the table without cell borders. */
|
|
308
|
+
hideBorders?: boolean;
|
|
309
|
+
/** When true, show a leading column of row labels (e.g. OD / OS). */
|
|
310
|
+
showRowLabels?: boolean;
|
|
311
|
+
/**
|
|
312
|
+
* When true, show Add row / Paste / Import controls while filling.
|
|
313
|
+
* Off by default — design mode still shows the panel for editing.
|
|
314
|
+
*/
|
|
315
|
+
allowAddRows?: boolean;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export interface RepeaterInstanceDef {
|
|
319
|
+
key: string;
|
|
320
|
+
label: string;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
export interface RepeaterEditorTemplate {
|
|
324
|
+
time?: number;
|
|
325
|
+
fieldSchemas: Record<string, FieldSchema>;
|
|
326
|
+
blocks?: EditorBlock[];
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export interface RepeaterValue extends Record<string, FieldValue> {
|
|
330
|
+
/** @deprecated Legacy multi-instance wrapper — migrated on load. */
|
|
331
|
+
instances?: Record<string, Record<string, FieldValue>>;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export interface RepeaterFieldSchema extends FieldSchemaBase {
|
|
335
|
+
type: 'child';
|
|
336
|
+
fieldSchemas: Record<string, FieldSchema>;
|
|
337
|
+
/** @deprecated Legacy nested-editor template wrapper. */
|
|
338
|
+
template?: RepeaterEditorTemplate;
|
|
339
|
+
/** @deprecated Legacy multi-instance definitions. */
|
|
340
|
+
instances?: RepeaterInstanceDef[];
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export interface ComputedFieldSchema extends FieldSchemaBase {
|
|
344
|
+
type: 'computed';
|
|
345
|
+
formula: string;
|
|
346
|
+
/** Unit text appended for plain/number display (e.g. mmHg). Not stored in the value. */
|
|
347
|
+
suffix?: string;
|
|
348
|
+
/**
|
|
349
|
+
* How the computed result is shown in the document / PDF.
|
|
350
|
+
* Same options as Number (`integer`) fields.
|
|
351
|
+
*/
|
|
352
|
+
displayFormat?: 'plain' | 'number' | 'currency';
|
|
353
|
+
/** ISO 4217 code when `displayFormat` is `currency`. Default: `EUR`. */
|
|
354
|
+
currencyCode?: string;
|
|
355
|
+
/** Fraction digits for `number` / `currency` display. */
|
|
356
|
+
fractionDigits?: number;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
export type FieldSchema =
|
|
360
|
+
| TextFieldSchema
|
|
361
|
+
| IntegerFieldSchema
|
|
362
|
+
| DateFieldSchema
|
|
363
|
+
| LogicalFieldSchema
|
|
364
|
+
| ChoiceFieldSchema
|
|
365
|
+
| ListFieldSchema
|
|
366
|
+
| TreeFieldSchema
|
|
367
|
+
| ImageFieldSchema
|
|
368
|
+
| SignatureFieldSchema
|
|
369
|
+
| BarcodeFieldSchema
|
|
370
|
+
| TableFieldSchema
|
|
371
|
+
| PivotTableFieldSchema
|
|
372
|
+
| RepeaterFieldSchema
|
|
373
|
+
| ComputedFieldSchema;
|
|
374
|
+
|
|
375
|
+
export interface ColumnsSegment {
|
|
376
|
+
type: 'columns';
|
|
377
|
+
/** Stable id for design-mode selection and width editing. */
|
|
378
|
+
id?: string;
|
|
379
|
+
/** CSS grid track sizes for each column (e.g. `1fr`, `50%`, `200px`). Defaults to equal columns. */
|
|
380
|
+
widths?: [string?, string?];
|
|
381
|
+
columns: [Segment[], Segment[]];
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export interface TableRowInstance {
|
|
385
|
+
key: string;
|
|
386
|
+
label: string;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export interface TableSegment {
|
|
390
|
+
type: 'table';
|
|
391
|
+
id: string;
|
|
392
|
+
/** Runtime rows for this table instance (seeded from schema on first use). */
|
|
393
|
+
rows?: TableRowInstance[];
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export interface RepeaterSegment {
|
|
397
|
+
type: 'child';
|
|
398
|
+
id: string;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
export type Segment =
|
|
402
|
+
| { type: 'text'; content?: string; html?: string; align?: TextAlign }
|
|
403
|
+
| { type: 'field'; id: string; placeholder?: string; align?: TextAlign }
|
|
404
|
+
| ColumnsSegment
|
|
405
|
+
| TableSegment
|
|
406
|
+
| RepeaterSegment;
|
|
407
|
+
|
|
408
|
+
export interface TemplatePageSetup {
|
|
409
|
+
format?: 'a4' | 'letter' | 'custom';
|
|
410
|
+
/** Page orientation. Defaults to portrait. */
|
|
411
|
+
orientation?: 'portrait' | 'landscape';
|
|
412
|
+
/** Custom page width in mm (portrait base). Used when format is "custom". */
|
|
413
|
+
widthMm?: number;
|
|
414
|
+
/** Custom page height in mm (portrait base). Used when format is "custom". */
|
|
415
|
+
heightMm?: number;
|
|
416
|
+
margin?: number | [number, number, number, number];
|
|
417
|
+
title?: string;
|
|
418
|
+
/** Default font and style for static text in document sections. */
|
|
419
|
+
textStyle?: FieldDisplayStyle;
|
|
420
|
+
/** Default font and style for field values (overrides createEditor fieldValueStyle.default). */
|
|
421
|
+
valueStyle?: FieldDisplayStyle;
|
|
422
|
+
/** Mention-style highlight colors for fields in fill mode. */
|
|
423
|
+
fieldHighlight?: FieldHighlightStyle;
|
|
424
|
+
/** When true (default), Backspace/Delete cannot remove field tokens in fill mode. */
|
|
425
|
+
protectFieldsInFillMode?: boolean;
|
|
426
|
+
/** When true (default), after saving a fill field open the next field's editor. */
|
|
427
|
+
autoAdvanceFillFields?: boolean;
|
|
428
|
+
header?: {
|
|
429
|
+
height?: number;
|
|
430
|
+
/** @deprecated Static header lines are no longer edited in Page setup. Ignored at render time. */
|
|
431
|
+
lines?: string[];
|
|
432
|
+
/** @deprecated Use repeatable section content for dynamic PDF headers. */
|
|
433
|
+
variables?: Record<string, string>;
|
|
434
|
+
/** Set at PDF render time when the repeatable section drives the page header. */
|
|
435
|
+
fromRepeatableSection?: boolean;
|
|
436
|
+
};
|
|
437
|
+
footer?: {
|
|
438
|
+
height?: number;
|
|
439
|
+
text?: string;
|
|
440
|
+
showPageNumbers?: boolean;
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
export type SectionVisibilityOperator =
|
|
445
|
+
| 'equals'
|
|
446
|
+
| 'notEquals'
|
|
447
|
+
| 'contains'
|
|
448
|
+
| 'notContains'
|
|
449
|
+
| 'empty'
|
|
450
|
+
| 'notEmpty';
|
|
451
|
+
|
|
452
|
+
export type SectionVisibilityMode = 'show' | 'hide';
|
|
453
|
+
|
|
454
|
+
export interface SectionVisibilityRule {
|
|
455
|
+
/** Field whose value controls this section. */
|
|
456
|
+
fieldId?: string;
|
|
457
|
+
/** Show the section when the rule matches, or hide it when the rule matches. */
|
|
458
|
+
mode?: SectionVisibilityMode;
|
|
459
|
+
operator?: SectionVisibilityOperator;
|
|
460
|
+
value?: unknown;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
export interface DocumentSectionData {
|
|
464
|
+
/** Stable section name for document export keys and field ID prefix. Defaults to `label`. */
|
|
465
|
+
name?: string;
|
|
466
|
+
/** Display header in editor and preview. */
|
|
467
|
+
label?: string;
|
|
468
|
+
collapsed?: boolean;
|
|
469
|
+
/** When true, PDF repeats this section once per instance in document data. */
|
|
470
|
+
repeatable?: boolean;
|
|
471
|
+
/** When true, the section title is omitted from document preview and PDF. */
|
|
472
|
+
hideTitleInPreview?: boolean;
|
|
473
|
+
/** When true, draw a horizontal rule above the section (editor + preview/PDF). */
|
|
474
|
+
borderTop?: boolean;
|
|
475
|
+
/** When true, draw a horizontal rule below the section (editor + preview/PDF). */
|
|
476
|
+
borderBottom?: boolean;
|
|
477
|
+
/**
|
|
478
|
+
* When true and the section repeats from a source array (`_source` / loaded instances),
|
|
479
|
+
* each row starts on a new PDF/print page.
|
|
480
|
+
*/
|
|
481
|
+
eachRowOnNewPage?: boolean;
|
|
482
|
+
/**
|
|
483
|
+
* When true, PDF keeps this section's content (title, fields, tables) on one page
|
|
484
|
+
* via pdfmake `unbreakable` — avoids orphaning headers from following rows.
|
|
485
|
+
* Does not affect HTML preview.
|
|
486
|
+
*/
|
|
487
|
+
keepOnOnePage?: boolean;
|
|
488
|
+
/** Optional rule that controls whether the section is visible for current field values. */
|
|
489
|
+
visibility?: SectionVisibilityRule | null;
|
|
490
|
+
segments: Segment[];
|
|
491
|
+
fieldValues: Record<string, FieldValue>;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
export interface TemplateBlockData {
|
|
495
|
+
fieldType: FieldType;
|
|
496
|
+
fieldId: string;
|
|
497
|
+
label: string;
|
|
498
|
+
prefixText?: string;
|
|
499
|
+
value?: FieldValue | RepeaterValue;
|
|
500
|
+
cells?: Record<string, FieldValue>;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
export interface VisionTableData {
|
|
504
|
+
fieldId: string;
|
|
505
|
+
cells: Record<string, FieldValue>;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
export interface EditorBlock {
|
|
509
|
+
type: string;
|
|
510
|
+
data: DocumentSectionData | TemplateBlockData | VisionTableData | Record<string, unknown>;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
export interface EditorDocument {
|
|
514
|
+
time: number;
|
|
515
|
+
fieldSchemas: Record<string, FieldSchema>;
|
|
516
|
+
blocks: EditorBlock[];
|
|
517
|
+
pageSetup?: TemplatePageSetup;
|
|
518
|
+
fieldMapping?: FieldMappingSpec;
|
|
519
|
+
/** Populated during template+document merge for multipage PDF rendering. */
|
|
520
|
+
repeatableSectionInstances?: Record<string, Array<Record<string, FieldValue | TableDocumentRows>>>;
|
|
521
|
+
/** Resolved page plan for repeatable PDF rendering. */
|
|
522
|
+
repeatablePagePlan?: RepeatablePagePlan;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
export interface DocExport {
|
|
526
|
+
kind: 'document';
|
|
527
|
+
version: 1 | 2;
|
|
528
|
+
time: number;
|
|
529
|
+
fieldSchemas: Record<string, FieldSchema>;
|
|
530
|
+
blocks: EditorBlock[];
|
|
531
|
+
pageSetup?: TemplatePageSetup;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
export interface TemplateExport {
|
|
535
|
+
kind: 'template';
|
|
536
|
+
version: 1;
|
|
537
|
+
time: number;
|
|
538
|
+
fieldSchemas: Record<string, FieldSchema>;
|
|
539
|
+
blocks: EditorBlock[];
|
|
540
|
+
pageSetup?: TemplatePageSetup;
|
|
541
|
+
fieldMapping?: FieldMappingSpec;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
export interface FieldMappingSpec {
|
|
545
|
+
kind: 'fieldMapping';
|
|
546
|
+
version: 1;
|
|
547
|
+
/** Design-time sample payload for preview only. */
|
|
548
|
+
sourceSample?: unknown;
|
|
549
|
+
/** Visual drag-and-drop mapping rules (primary). */
|
|
550
|
+
rules?: FieldMappingRule[];
|
|
551
|
+
/** Optional compiled JS expression (advanced / legacy). */
|
|
552
|
+
expression?: string;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
export interface FieldMappingRule {
|
|
556
|
+
section: string;
|
|
557
|
+
field: string;
|
|
558
|
+
childField?: string;
|
|
559
|
+
/** Dot-separated child field path, e.g. "Address.City". */
|
|
560
|
+
childFieldPath?: string;
|
|
561
|
+
/** Table column key when mapping a table column to a source array. */
|
|
562
|
+
columnKey?: string;
|
|
563
|
+
sourcePath: string;
|
|
564
|
+
/** Base source array path for table column mapping. */
|
|
565
|
+
sourceArrayPath?: string;
|
|
566
|
+
fieldId?: string;
|
|
567
|
+
childFieldId?: string;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
/** Reserved section-map key / rule field for array-sourced (repeatable) sections. */
|
|
571
|
+
export const SECTION_SOURCE_KEY: '_source';
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* Unresolved Mapping result shape for a table field (`_source` + relative `items`).
|
|
575
|
+
* Legacy `source` is still accepted when reading.
|
|
576
|
+
*/
|
|
577
|
+
export interface TableMappingResult {
|
|
578
|
+
_source: string;
|
|
579
|
+
/** @deprecated Prefer `_source` (same key as section maps). */
|
|
580
|
+
source?: string;
|
|
581
|
+
items: Record<string, string>;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* Unresolved section mapping may include `_source` (payload array path) next to field maps.
|
|
586
|
+
* Resolved sections with `_source` become an array of per-item field maps.
|
|
587
|
+
*/
|
|
588
|
+
export type SectionMappingResult = Record<string, unknown> & {
|
|
589
|
+
_source?: string;
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
export interface FieldMappingValidationIssue {
|
|
593
|
+
section: string;
|
|
594
|
+
field: string;
|
|
595
|
+
message: string;
|
|
596
|
+
/** Present when the issue refers to a missing/invalid source path. */
|
|
597
|
+
sourcePath?: string;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
export interface FieldMappingValidationResult {
|
|
601
|
+
valid: boolean;
|
|
602
|
+
errors: FieldMappingValidationIssue[];
|
|
603
|
+
warnings: FieldMappingValidationIssue[];
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
export interface FieldMappingPreviewResult {
|
|
607
|
+
fieldsExport: FieldsExport;
|
|
608
|
+
validation: FieldMappingValidationResult;
|
|
609
|
+
mappingResult?: FieldsExport | null;
|
|
610
|
+
raw: unknown;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
export interface TargetSchemaTreeField {
|
|
614
|
+
name: string;
|
|
615
|
+
type: FieldType;
|
|
616
|
+
fieldId: string;
|
|
617
|
+
children?: Array<{ name: string; type: FieldType }>;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
export interface TargetSchemaTree {
|
|
621
|
+
sections: Array<{
|
|
622
|
+
name: string;
|
|
623
|
+
fields: TargetSchemaTreeField[];
|
|
624
|
+
}>;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
/** Section field map or array of maps when the section is repeatable. */
|
|
628
|
+
export type DocumentSectionValues =
|
|
629
|
+
| Record<string, FieldValue | TableDocumentRows>
|
|
630
|
+
| Array<Record<string, FieldValue | TableDocumentRows>>;
|
|
631
|
+
|
|
632
|
+
export interface RepeatablePagePlan {
|
|
633
|
+
sectionName: string;
|
|
634
|
+
repeatableBlockIndex: number;
|
|
635
|
+
/** Explicit document instance arrays only (not table row counts). */
|
|
636
|
+
instances: Array<Record<string, FieldValue | TableDocumentRows>>;
|
|
637
|
+
companionBlockIndex: number | null;
|
|
638
|
+
companionTableRows: TableDocumentRows | null;
|
|
639
|
+
companionTableName?: string | null;
|
|
640
|
+
companionTableId?: string | null;
|
|
641
|
+
companionBlockKind?: 'vision' | 'template' | 'section' | null;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
export interface FieldsExport {
|
|
645
|
+
kind: 'field';
|
|
646
|
+
version: 1 | 2;
|
|
647
|
+
time: number;
|
|
648
|
+
/** v1 flat field-id map */
|
|
649
|
+
values?: Record<string, FieldValue | TableDocumentRows>;
|
|
650
|
+
/** v2 nested section → field name → value (or array for repeatable sections) */
|
|
651
|
+
sections?: Record<string, DocumentSectionValues>;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
/** @deprecated Renamed to FieldsExport (kind is now `'field'` instead of `'document'`) */
|
|
655
|
+
export interface DocumentExport extends Omit<FieldsExport, 'kind'> {
|
|
656
|
+
kind: 'document';
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
export interface ValidationResult {
|
|
660
|
+
valid: boolean;
|
|
661
|
+
missing: Array<{ fieldId: string; label: string }>;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
export interface CatalogListEntry {
|
|
665
|
+
id?: string;
|
|
666
|
+
label?: string;
|
|
667
|
+
items: ListItem[];
|
|
668
|
+
withCode?: boolean;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
export interface CatalogTreeEntry {
|
|
672
|
+
id?: string;
|
|
673
|
+
label?: string;
|
|
674
|
+
tree: TreeNode[];
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
export interface CatalogsInput {
|
|
678
|
+
lists?: Record<string, CatalogListEntry>;
|
|
679
|
+
trees?: Record<string, CatalogTreeEntry>;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
export interface CatalogProvider {
|
|
683
|
+
getList(id: string): CatalogListEntry | null;
|
|
684
|
+
getTree(id: string): CatalogTreeEntry | null;
|
|
685
|
+
listIds(): { lists: string[]; trees: string[] };
|
|
686
|
+
listCommonValueLists(): Array<{ id: string; label: string; itemCount: number; withCode: boolean }>;
|
|
687
|
+
listCommonValueTrees(): Array<{ id: string; label: string; nodeCount: number; rootLabels: string[] }>;
|
|
688
|
+
resolveSchemaItems(schema: FieldSchema): ListItem[];
|
|
689
|
+
resolveSchemaWithCode(schema: FieldSchema): boolean;
|
|
690
|
+
resolveSchemaTree(schema: FieldSchema): TreeNode[];
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
export interface ImageUploadFileResult {
|
|
694
|
+
success: 1;
|
|
695
|
+
file: { url: string; name?: string; stub?: boolean };
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
export interface ExistingImageItem {
|
|
699
|
+
id: string;
|
|
700
|
+
name: string;
|
|
701
|
+
url?: string;
|
|
702
|
+
extension?: string;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
export interface ImageUploadConfig {
|
|
706
|
+
uploadUrl?: string;
|
|
707
|
+
stub?: boolean;
|
|
708
|
+
/** Host-provided uploader (e.g. Salesforce Apex). When set, skips fetch/stub. */
|
|
709
|
+
uploadByFile?: (file: File) => Promise<ImageUploadFileResult>;
|
|
710
|
+
uploadByUrl?: (url: string) => Promise<ImageUploadFileResult>;
|
|
711
|
+
/** Optional browse list of existing host images (e.g. Salesforce Files on the record). */
|
|
712
|
+
listExistingImages?: () => Promise<ExistingImageItem[]>;
|
|
713
|
+
/** Resolve a selected existing image id to a persistable URL. */
|
|
714
|
+
resolveExistingImage?: (id: string) => Promise<ImageUploadFileResult>;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
export interface ResolveListItemsContext {
|
|
718
|
+
/** Field Name from schema (`schema.name`, or `schema.label` when name is unset). */
|
|
719
|
+
fieldName: string;
|
|
720
|
+
schema: FieldSchema;
|
|
721
|
+
fieldValues: Record<string, FieldValue>;
|
|
722
|
+
query: string;
|
|
723
|
+
selected: string[];
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
export type ResolveListItemsFn = (ctx: ResolveListItemsContext) => Promise<ListItem[]>;
|
|
727
|
+
|
|
728
|
+
export interface ListPickerRemoteSearch {
|
|
729
|
+
search(query: string): Promise<ListItem[]>;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
export interface ListPickerOptions {
|
|
733
|
+
title: string;
|
|
734
|
+
items: ListItem[];
|
|
735
|
+
selected: string[];
|
|
736
|
+
withCode?: boolean;
|
|
737
|
+
multi: boolean;
|
|
738
|
+
/** When set, search input triggers debounced remote lookups instead of filtering local items. */
|
|
739
|
+
remoteSearch?: ListPickerRemoteSearch;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
export interface TreePickerOptions {
|
|
743
|
+
title: string;
|
|
744
|
+
tree: TreeNode[];
|
|
745
|
+
selected: string[];
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
export interface TextPickerOptions {
|
|
749
|
+
title: string;
|
|
750
|
+
value: string;
|
|
751
|
+
placeholder?: string;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
export interface HtmlTextPickerOptions extends TextPickerOptions {}
|
|
755
|
+
|
|
756
|
+
export interface IntegerPickerOptions {
|
|
757
|
+
title: string;
|
|
758
|
+
value: string;
|
|
759
|
+
min: number;
|
|
760
|
+
max: number;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
export interface ImagePickerOptions {
|
|
764
|
+
title: string;
|
|
765
|
+
value: ImageValue;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
export interface LogicalPickerOptions {
|
|
769
|
+
title: string;
|
|
770
|
+
value?: boolean | null;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
export interface SignaturePickerOptions {
|
|
774
|
+
title: string;
|
|
775
|
+
value?: string | ImageValue | null;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
export interface DatePickerOptions {
|
|
779
|
+
title: string;
|
|
780
|
+
value: string;
|
|
781
|
+
/** Mount overlay under this host (fill editor shell). */
|
|
782
|
+
parent?: HTMLElement | null;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
export interface PickerCallbacks {
|
|
786
|
+
openListPicker(opts: ListPickerOptions): Promise<string | string[]>;
|
|
787
|
+
openTreePicker(opts: TreePickerOptions): Promise<string[]>;
|
|
788
|
+
openTextPicker(opts: TextPickerOptions): Promise<string>;
|
|
789
|
+
openHtmlTextPicker(opts: HtmlTextPickerOptions): Promise<string>;
|
|
790
|
+
openIntegerPicker(opts: IntegerPickerOptions): Promise<string>;
|
|
791
|
+
openImagePicker(opts: ImagePickerOptions): Promise<ImageValue>;
|
|
792
|
+
openLogicalPicker(opts: LogicalPickerOptions): Promise<boolean | null>;
|
|
793
|
+
openSignaturePicker(opts: SignaturePickerOptions): Promise<string>;
|
|
794
|
+
openDatePicker(opts: DatePickerOptions): Promise<string>;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
export interface CreateEditorUiOptions {
|
|
798
|
+
palette?: boolean;
|
|
799
|
+
richTextToolbar?: boolean;
|
|
800
|
+
documentActions?: boolean;
|
|
801
|
+
/**
|
|
802
|
+
* Append palette + format toolbar inside this container (e.g. a sticky page header wrapper).
|
|
803
|
+
*/
|
|
804
|
+
chromeParent?: HTMLElement | string;
|
|
805
|
+
/** Pin palette + format toolbar while scrolling. Default: true (unless chromeParent is set). */
|
|
806
|
+
stickyChrome?: boolean;
|
|
807
|
+
/**
|
|
808
|
+
* Design mode layout: `chrome` (horizontal palette bar) or `panels` (3-column shell).
|
|
809
|
+
*/
|
|
810
|
+
designLayout?: 'chrome' | 'panels';
|
|
811
|
+
/** When true, nested/embedded editors hide repeater and other chrome. */
|
|
812
|
+
embedded?: boolean;
|
|
813
|
+
paletteAfter?: HTMLElement | string;
|
|
814
|
+
paletteParent?: HTMLElement | string;
|
|
815
|
+
toolbarParent?: HTMLElement | string;
|
|
816
|
+
toolbarBefore?: HTMLElement | string;
|
|
817
|
+
/** Append document actions inside this container (e.g. app header toolbar). */
|
|
818
|
+
documentActionsContainer?: HTMLElement | string;
|
|
819
|
+
documentActionsParent?: HTMLElement | string;
|
|
820
|
+
documentActionsAfter?: HTMLElement | string;
|
|
821
|
+
/** Default filename suggested when saving PDF from preview or exportPdf(). */
|
|
822
|
+
pdfFilename?: string;
|
|
823
|
+
/** Optional title prepended in PDF exports from the document actions bar. */
|
|
824
|
+
pdfTitle?: string;
|
|
825
|
+
/**
|
|
826
|
+
* When false, PDF preview downloads the file instead of embedding via blob: iframe.
|
|
827
|
+
* Required under Salesforce LWS (blob: iframe.src is blocked). Default: true.
|
|
828
|
+
*/
|
|
829
|
+
embedPdfInIframe?: boolean;
|
|
830
|
+
/**
|
|
831
|
+
* When true (default), fill mode highlights editable fields so users can find them.
|
|
832
|
+
* Ignored in design mode.
|
|
833
|
+
*/
|
|
834
|
+
showFieldsInFillMode?: boolean;
|
|
835
|
+
/** Default field highlight colors when page setup has no fieldHighlight. */
|
|
836
|
+
fieldHighlight?: FieldHighlightStyle;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
export type FormulaFunctionKind = 'scalar' | 'aggregate';
|
|
840
|
+
|
|
841
|
+
export type FormulaFunctionArity = number | { min?: number; max?: number };
|
|
842
|
+
|
|
843
|
+
/** Host/plugin function for computed formulas. See `registerFormulaFunction`. */
|
|
844
|
+
export interface FormulaFunctionDef {
|
|
845
|
+
name: string;
|
|
846
|
+
kind?: FormulaFunctionKind;
|
|
847
|
+
arity?: FormulaFunctionArity;
|
|
848
|
+
impl: (args: unknown[]) => unknown;
|
|
849
|
+
label?: string;
|
|
850
|
+
description?: string;
|
|
851
|
+
picker?: boolean;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
export interface CreateEditorOptions {
|
|
855
|
+
holder: HTMLElement | string;
|
|
856
|
+
data?: EditorDocument;
|
|
857
|
+
defaultDocument?: EditorDocument;
|
|
858
|
+
catalogs?: CatalogsInput;
|
|
859
|
+
/**
|
|
860
|
+
* Remote list resolver for fields with `listSource: 'remote'`.
|
|
861
|
+
* Called when the list picker opens and on each debounced search input.
|
|
862
|
+
* Receives `fieldName` (schema Field Name), not the internal field ID.
|
|
863
|
+
*/
|
|
864
|
+
resolveListItems?: ResolveListItemsFn;
|
|
865
|
+
/**
|
|
866
|
+
* Optional PDF generator for hosts where client pdfmake is unavailable
|
|
867
|
+
* (e.g. Salesforce Static Resource). Used by preview "View as PDF" / exportPdf.
|
|
868
|
+
*/
|
|
869
|
+
generatePdfBlob?: (
|
|
870
|
+
doc: EditorDocument,
|
|
871
|
+
options?: PdfExportOptions,
|
|
872
|
+
) => Promise<Blob>;
|
|
873
|
+
/**
|
|
874
|
+
* When false, hide "View as PDF" / PDF save in preview.
|
|
875
|
+
* Prefer an explicit host check (e.g. Salesforce DocEngine_PDF Named Credential).
|
|
876
|
+
* When omitted, PDF UI is shown if `generatePdfBlob` is set or client pdfmake is bundled.
|
|
877
|
+
*/
|
|
878
|
+
pdfAvailable?: boolean | Promise<boolean> | (() => boolean | Promise<boolean>);
|
|
879
|
+
/**
|
|
880
|
+
* Optional http(s)/relative URL for iframe PDF preview when blob: is blocked (e.g. Salesforce LWS).
|
|
881
|
+
*/
|
|
882
|
+
generatePdfPreviewUrl?: (
|
|
883
|
+
doc: EditorDocument,
|
|
884
|
+
options?: PdfExportOptions,
|
|
885
|
+
) => Promise<string>;
|
|
886
|
+
/** Fired when Document preview modal opens/closes. */
|
|
887
|
+
onPreviewStateChange?: (open: boolean) => void;
|
|
888
|
+
/**
|
|
889
|
+
* Fired when a nested field dialog (list/tree/text/… picker) opens/closes.
|
|
890
|
+
* Hosts such as Salesforce LightningModal should set `disableClose` while true
|
|
891
|
+
* so Escape closes only the nested dialog, not the editor shell.
|
|
892
|
+
*/
|
|
893
|
+
onNestedModalStateChange?: (open: boolean) => void;
|
|
894
|
+
/**
|
|
895
|
+
* Fired when a nested field picker applies a result (OK / Clear), not when cancelled.
|
|
896
|
+
* Hosts can use this for unsaved-changes tracking without false positives from open/close.
|
|
897
|
+
*/
|
|
898
|
+
onFieldPickerApplied?: () => void;
|
|
899
|
+
/**
|
|
900
|
+
* Host share/email/Slack handler. When set, preview shows a Share button.
|
|
901
|
+
* Receives the current-format artifact from `getPreviewArtifact`.
|
|
902
|
+
*/
|
|
903
|
+
onShareDocument?: (artifact: PreviewArtifact) => void | Promise<void>;
|
|
904
|
+
/** Collections offered in the field designer when list source is Remote search. */
|
|
905
|
+
remoteListCollections?: () =>
|
|
906
|
+
| RemoteListCollectionOption[]
|
|
907
|
+
| RemoteListCollectionCatalog
|
|
908
|
+
| Promise<RemoteListCollectionOption[] | RemoteListCollectionCatalog>;
|
|
909
|
+
/** Label fields for a collection, used by the Remote search designer UI. */
|
|
910
|
+
remoteListLabelFields?: (
|
|
911
|
+
collection: string,
|
|
912
|
+
) => RemoteListLabelFieldOption[] | Promise<RemoteListLabelFieldOption[]>;
|
|
913
|
+
/** Default + per-field value styling (see FieldDisplayStyle on schema). */
|
|
914
|
+
fieldValueStyle?: FieldValueStyleOptions;
|
|
915
|
+
designMode?: boolean;
|
|
916
|
+
/** Read-only field mapping mode: drag source paths onto field tokens. */
|
|
917
|
+
mappingMode?: boolean;
|
|
918
|
+
/** Called when a source path is dropped onto a template field. */
|
|
919
|
+
onMappingRuleChange?: (rule: FieldMappingRule) => void;
|
|
920
|
+
/** Current mapping rules (used in mapping mode for section `_source` relative paths). */
|
|
921
|
+
getMappingRules?: () => FieldMappingRule[];
|
|
922
|
+
tools?: Array<'documentSection' | 'templateBlock' | 'visionTable'>;
|
|
923
|
+
visionTableTool?: new (args: { data: unknown; config: EditorToolConfig }) => unknown;
|
|
924
|
+
visionTableFieldId?: string;
|
|
925
|
+
imageUpload?: ImageUploadConfig;
|
|
926
|
+
/**
|
|
927
|
+
* Extra computed-formula functions for this process (add or override built-ins).
|
|
928
|
+
* Same as calling `registerFormulaFunction` before createEditor. n8n / PDF hosts
|
|
929
|
+
* that evaluate formulas must register the same functions.
|
|
930
|
+
*/
|
|
931
|
+
formulaFunctions?: FormulaFunctionDef[];
|
|
932
|
+
pickers?: Partial<PickerCallbacks>;
|
|
933
|
+
ui?: CreateEditorUiOptions;
|
|
934
|
+
onChange?: (doc: EditorDocument) => void;
|
|
935
|
+
onSchemaChange?: (fieldSchemas: Record<string, FieldSchema>) => void;
|
|
936
|
+
onError?: (error: Error) => void;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
export interface EditorToolConfig extends PickerCallbacks {
|
|
940
|
+
editorHolder: HTMLElement;
|
|
941
|
+
getRegistry: () => SchemaRegistry;
|
|
942
|
+
resolveListItems?: ResolveListItemsFn;
|
|
943
|
+
fieldValueStyle?: FieldValueStyleOptions;
|
|
944
|
+
designMode: boolean;
|
|
945
|
+
mappingMode?: boolean;
|
|
946
|
+
onMappingRuleChange?: (rule: FieldMappingRule) => void;
|
|
947
|
+
/** Current mapping rules (used in mapping mode for section `_source` relative paths). */
|
|
948
|
+
getMappingRules?: () => FieldMappingRule[];
|
|
949
|
+
designPropertiesPanel?: boolean;
|
|
950
|
+
onEditSchema: (fieldId: string) => void;
|
|
951
|
+
onDeleteSchema: (fieldId: string) => void;
|
|
952
|
+
onSectionNameChange?: () => void;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
export interface DocEditorInstance {
|
|
956
|
+
holder: HTMLElement;
|
|
957
|
+
registry: SchemaRegistry;
|
|
958
|
+
palette: { element: HTMLElement };
|
|
959
|
+
richTextToolbar: {
|
|
960
|
+
element: HTMLElement;
|
|
961
|
+
show: (editable: HTMLElement) => void;
|
|
962
|
+
showForField: (options: {
|
|
963
|
+
getResolvedStyle?: () => FieldDisplayStyle;
|
|
964
|
+
getOverrideStyle?: () => FieldDisplayStyle;
|
|
965
|
+
getGlobalDefault?: () => FieldDisplayStyle;
|
|
966
|
+
hint?: string;
|
|
967
|
+
onStyleChange?: (style: FieldDisplayStyle) => void;
|
|
968
|
+
onClearStyle?: () => void;
|
|
969
|
+
}) => void;
|
|
970
|
+
clearActive: () => void;
|
|
971
|
+
clearFieldMode: () => void;
|
|
972
|
+
isFieldModeActive: () => boolean;
|
|
973
|
+
};
|
|
974
|
+
documentActions: {
|
|
975
|
+
element: HTMLElement;
|
|
976
|
+
setBusy(busy: boolean): void;
|
|
977
|
+
};
|
|
978
|
+
readonly ready: Promise<void>;
|
|
979
|
+
getDocument(): Promise<EditorDocument>;
|
|
980
|
+
save(): Promise<EditorDocument>;
|
|
981
|
+
exportDoc(): Promise<DocExport>;
|
|
982
|
+
exportTemplate(): Promise<TemplateExport>;
|
|
983
|
+
exportFields(options?: FieldsExportOptions): Promise<FieldsExport>;
|
|
984
|
+
/** @deprecated Use exportFields() */
|
|
985
|
+
exportDocument(options?: FieldsExportOptions): Promise<FieldsExport>;
|
|
986
|
+
load(
|
|
987
|
+
data: DocExport | TemplateExport | FieldsExport | DocumentExport,
|
|
988
|
+
options?: { omitMappedFields?: boolean },
|
|
989
|
+
): Promise<void>;
|
|
990
|
+
undo(): Promise<boolean>;
|
|
991
|
+
redo(): Promise<boolean>;
|
|
992
|
+
canUndo(): boolean;
|
|
993
|
+
canRedo(): boolean;
|
|
994
|
+
getFieldMapping(): FieldMappingSpec | null;
|
|
995
|
+
setFieldMapping(spec: FieldMappingSpec | null): void;
|
|
996
|
+
previewFieldMapping(payload: unknown): Promise<FieldMappingPreviewResult>;
|
|
997
|
+
applyFieldMapping(payload: unknown): Promise<{
|
|
998
|
+
fieldsExport: FieldsExport;
|
|
999
|
+
validation: FieldMappingValidationResult;
|
|
1000
|
+
blocks: EditorBlock[];
|
|
1001
|
+
fieldSchemas: Record<string, FieldSchema>;
|
|
1002
|
+
applied: number;
|
|
1003
|
+
skipped: number;
|
|
1004
|
+
}>;
|
|
1005
|
+
openFieldMapping(options?: {
|
|
1006
|
+
spec?: FieldMappingSpec;
|
|
1007
|
+
/** Lazy-load related object / child relationship fields when a source-tree node is expanded. */
|
|
1008
|
+
onExpandSourcePath?: (path: string) => Promise<unknown>;
|
|
1009
|
+
}): Promise<FieldMappingSpec>;
|
|
1010
|
+
setDesignMode(enabled: boolean): Promise<void>;
|
|
1011
|
+
getDesignMode(): boolean;
|
|
1012
|
+
setShowFieldsInFillMode(enabled: boolean): void;
|
|
1013
|
+
getShowFieldsInFillMode(): boolean;
|
|
1014
|
+
preview(options?: { hideEmptyValues?: boolean }): Promise<void>;
|
|
1015
|
+
isPreviewOpen(): boolean;
|
|
1016
|
+
closePreview(): void;
|
|
1017
|
+
/** Standalone HTML document string for Simple preview (export/attach). */
|
|
1018
|
+
exportPreviewHtml(options?: {
|
|
1019
|
+
hideEmptyValues?: boolean;
|
|
1020
|
+
title?: string;
|
|
1021
|
+
}): Promise<string>;
|
|
1022
|
+
/**
|
|
1023
|
+
* Build an HTML or PDF artifact for the host to email / Slack / attach.
|
|
1024
|
+
* `format: 'current'` follows the open preview view mode (defaults to html).
|
|
1025
|
+
*/
|
|
1026
|
+
getPreviewArtifact(options?: PreviewArtifactOptions): Promise<PreviewArtifact>;
|
|
1027
|
+
exportPdf(options?: PdfExportOptions): Promise<void>;
|
|
1028
|
+
validate(): Promise<ValidationResult>;
|
|
1029
|
+
destroy(): void;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
export class SchemaRegistry {
|
|
1033
|
+
constructor(catalogProvider?: CatalogProvider);
|
|
1034
|
+
catalogs: CatalogProvider;
|
|
1035
|
+
setFieldSchemas(schemas: Record<string, FieldSchema>): void;
|
|
1036
|
+
getFieldSchemas(): Record<string, FieldSchema>;
|
|
1037
|
+
updateFieldSchema(fieldId: string, schema: FieldSchema): void;
|
|
1038
|
+
removeFieldSchema(fieldId: string): void;
|
|
1039
|
+
getFieldDef(fieldId: string): Record<string, unknown> | null;
|
|
1040
|
+
schemaToPickerConfig(schema: FieldSchema): Record<string, unknown> | null;
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
export function createEditor(options: CreateEditorOptions): DocEditorInstance;
|
|
1044
|
+
export function createCatalogProvider(catalogs?: CatalogsInput): CatalogProvider;
|
|
1045
|
+
export function getRegistryFromConfig(config: EditorToolConfig): SchemaRegistry | null;
|
|
1046
|
+
export function getRegistryFromNode(node: Node | null): SchemaRegistry | null;
|
|
1047
|
+
|
|
1048
|
+
export function buildDocExport(doc: EditorDocument): DocExport;
|
|
1049
|
+
export function buildTemplateExport(doc: EditorDocument): TemplateExport;
|
|
1050
|
+
export function buildFieldsExport(
|
|
1051
|
+
doc: EditorDocument,
|
|
1052
|
+
options?: FieldsExportOptions,
|
|
1053
|
+
): FieldsExport;
|
|
1054
|
+
/** @deprecated Use buildFieldsExport */
|
|
1055
|
+
export function buildDocumentExport(
|
|
1056
|
+
doc: EditorDocument,
|
|
1057
|
+
options?: FieldsExportOptions,
|
|
1058
|
+
): FieldsExport;
|
|
1059
|
+
export function normalizeImportedDoc(data: unknown): EditorDocument;
|
|
1060
|
+
export function isFieldsExport(data: unknown): data is FieldsExport;
|
|
1061
|
+
export function isDocExport(data: unknown): data is DocExport;
|
|
1062
|
+
export function validateRequiredFields(doc: EditorDocument): ValidationResult;
|
|
1063
|
+
|
|
1064
|
+
export const FIELD_MAPPING_KIND: 'fieldMapping';
|
|
1065
|
+
export const FIELD_MAPPING_VERSION: 1;
|
|
1066
|
+
export function isSectionSourceRule(rule: unknown): boolean;
|
|
1067
|
+
export function isAbsoluteMappingPath(sourcePath: string): boolean;
|
|
1068
|
+
export function isRelativeMappingPath(sourcePath: string): boolean;
|
|
1069
|
+
export function createSectionSourceRule(sectionName: string, sourceArrayPath: string): FieldMappingRule;
|
|
1070
|
+
export function resolvePathForSectionItem(
|
|
1071
|
+
sourcePath: string,
|
|
1072
|
+
payload: unknown,
|
|
1073
|
+
item: unknown,
|
|
1074
|
+
): unknown;
|
|
1075
|
+
export function applySectionSourceRepeatable(
|
|
1076
|
+
blocks: EditorBlock[],
|
|
1077
|
+
rules: FieldMappingRule[] | null | undefined,
|
|
1078
|
+
): EditorBlock[];
|
|
1079
|
+
export function isFieldMappingSpec(data: unknown): data is FieldMappingSpec;
|
|
1080
|
+
export function getPayloadByPath(path: string, data: unknown): unknown;
|
|
1081
|
+
export function payloadPathExists(path: string, data: unknown): boolean;
|
|
1082
|
+
export function sourcePathExists(sourcePath: string, payload: unknown): boolean;
|
|
1083
|
+
export function unwrapMappingExpression(expression: string): string;
|
|
1084
|
+
export function evaluateFieldMappingExpression(
|
|
1085
|
+
expression: string,
|
|
1086
|
+
payload: unknown,
|
|
1087
|
+
template?: { blocks?: EditorBlock[]; fieldSchemas?: Record<string, FieldSchema> },
|
|
1088
|
+
): unknown;
|
|
1089
|
+
export function normalizeMappingResult(
|
|
1090
|
+
raw: unknown,
|
|
1091
|
+
blocks: EditorBlock[],
|
|
1092
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1093
|
+
): FieldsExport;
|
|
1094
|
+
export function validateMappedValues(
|
|
1095
|
+
fieldsExport: FieldsExport,
|
|
1096
|
+
blocks: EditorBlock[],
|
|
1097
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1098
|
+
): FieldMappingValidationResult;
|
|
1099
|
+
export function validateMappingSourcePaths(
|
|
1100
|
+
rules: FieldMappingRule[],
|
|
1101
|
+
payload: unknown,
|
|
1102
|
+
): FieldMappingValidationResult;
|
|
1103
|
+
export function buildTargetSchemaTree(
|
|
1104
|
+
blocks: EditorBlock[],
|
|
1105
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1106
|
+
): TargetSchemaTree;
|
|
1107
|
+
export function applyFieldMapping(
|
|
1108
|
+
payload: unknown,
|
|
1109
|
+
mappingSpec: FieldMappingSpec,
|
|
1110
|
+
template: { blocks: EditorBlock[]; fieldSchemas: Record<string, FieldSchema> },
|
|
1111
|
+
): {
|
|
1112
|
+
fieldsExport: FieldsExport;
|
|
1113
|
+
validation: FieldMappingValidationResult;
|
|
1114
|
+
blocks: EditorBlock[];
|
|
1115
|
+
fieldSchemas: Record<string, FieldSchema>;
|
|
1116
|
+
applied: number;
|
|
1117
|
+
skipped: number;
|
|
1118
|
+
};
|
|
1119
|
+
export function previewFieldMapping(
|
|
1120
|
+
payload: unknown,
|
|
1121
|
+
mappingSpec: FieldMappingSpec,
|
|
1122
|
+
template: { blocks: EditorBlock[]; fieldSchemas: Record<string, FieldSchema> },
|
|
1123
|
+
): FieldMappingPreviewResult;
|
|
1124
|
+
export function normalizeFieldMappingSpec(
|
|
1125
|
+
spec: FieldMappingSpec | null | undefined,
|
|
1126
|
+
): FieldMappingSpec;
|
|
1127
|
+
export function collectMappedSectionFieldKeys(
|
|
1128
|
+
mappingSpec: FieldMappingSpec | { rules?: FieldMappingRule[] } | null | undefined,
|
|
1129
|
+
): Set<string>;
|
|
1130
|
+
export function omitMappedFields(
|
|
1131
|
+
fieldsExport: FieldsExport | Record<string, unknown> | null | undefined,
|
|
1132
|
+
mappingSpec: FieldMappingSpec | { rules?: FieldMappingRule[] } | null | undefined,
|
|
1133
|
+
): FieldsExport | Record<string, unknown> | null | undefined;
|
|
1134
|
+
|
|
1135
|
+
export function buildSourcePayloadTree(
|
|
1136
|
+
payload: unknown,
|
|
1137
|
+
basePath?: string,
|
|
1138
|
+
): Array<{ key: string; path: string; type: string; children?: unknown[] }>;
|
|
1139
|
+
export function resolveSourcePath(sourcePath: string, payload: unknown): unknown;
|
|
1140
|
+
export function buildMappingResultFromRules(rules: FieldMappingRule[]): FieldsExport;
|
|
1141
|
+
export function parseMappingResultToRules(
|
|
1142
|
+
mappingResult: unknown,
|
|
1143
|
+
blocks: EditorBlock[],
|
|
1144
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1145
|
+
): FieldMappingRule[];
|
|
1146
|
+
export function isTableMappingObject(value: unknown): value is TableMappingResult;
|
|
1147
|
+
export function getTableMappingSourcePath(value: unknown): string;
|
|
1148
|
+
export function toRelativeItemPath(sourcePath: string, sourceArrayPath: string): string;
|
|
1149
|
+
export function toAbsoluteColumnPath(source: string, itemPath: string): string;
|
|
1150
|
+
export function resolveRulesToFieldsExport(
|
|
1151
|
+
rules: FieldMappingRule[],
|
|
1152
|
+
payload: unknown,
|
|
1153
|
+
template: { blocks: EditorBlock[]; fieldSchemas: Record<string, FieldSchema> },
|
|
1154
|
+
): FieldsExport;
|
|
1155
|
+
export function upsertMappingRule(
|
|
1156
|
+
rules: FieldMappingRule[],
|
|
1157
|
+
rule: FieldMappingRule,
|
|
1158
|
+
): FieldMappingRule[];
|
|
1159
|
+
export function upsertMappingRules(
|
|
1160
|
+
rules: FieldMappingRule[],
|
|
1161
|
+
incoming: FieldMappingRule[],
|
|
1162
|
+
): FieldMappingRule[];
|
|
1163
|
+
export function createMappingRuleFromDrop(
|
|
1164
|
+
fieldId: string,
|
|
1165
|
+
sourcePath: string,
|
|
1166
|
+
blocks: EditorBlock[],
|
|
1167
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1168
|
+
childFieldId?: string | null,
|
|
1169
|
+
): FieldMappingRule | null;
|
|
1170
|
+
export function createMappingRulesFromDrop(
|
|
1171
|
+
fieldId: string,
|
|
1172
|
+
sourcePath: string,
|
|
1173
|
+
blocks: EditorBlock[],
|
|
1174
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1175
|
+
options?: { childFieldIds?: string[]; bulkChild?: boolean },
|
|
1176
|
+
): FieldMappingRule[];
|
|
1177
|
+
export function collectRepeaterLeafFields(
|
|
1178
|
+
repeaterSchema: FieldSchema,
|
|
1179
|
+
pathNames?: string[],
|
|
1180
|
+
pathIds?: string[],
|
|
1181
|
+
): Array<{ pathNames: string[]; pathIds: string[] }>;
|
|
1182
|
+
export function flattenSourcePayloadPaths(payload: unknown): string[];
|
|
1183
|
+
export function parsePathTokenContext(token: string): {
|
|
1184
|
+
basePath: string;
|
|
1185
|
+
segmentPrefix: string;
|
|
1186
|
+
segmentStartInToken: number;
|
|
1187
|
+
} | null;
|
|
1188
|
+
export function getSourceFieldsAtPath(
|
|
1189
|
+
payload: unknown,
|
|
1190
|
+
pathToken: string,
|
|
1191
|
+
): Array<{ key: string; path: string; type: string }>;
|
|
1192
|
+
export function resolveFieldMappingTarget(
|
|
1193
|
+
fieldId: string,
|
|
1194
|
+
blocks: EditorBlock[],
|
|
1195
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1196
|
+
childFieldId?: string | null,
|
|
1197
|
+
): {
|
|
1198
|
+
section: string;
|
|
1199
|
+
field: string;
|
|
1200
|
+
childField?: string;
|
|
1201
|
+
childFieldPath?: string;
|
|
1202
|
+
fieldId: string;
|
|
1203
|
+
childFieldId?: string;
|
|
1204
|
+
} | null;
|
|
1205
|
+
export function syncMappingRulesToSchema(
|
|
1206
|
+
rules: FieldMappingRule[],
|
|
1207
|
+
blocks: EditorBlock[],
|
|
1208
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1209
|
+
options?: { fieldIdRenames?: Record<string, string> | Map<string, string> },
|
|
1210
|
+
): FieldMappingRule[];
|
|
1211
|
+
export function syncFieldMappingSpecToSchema(
|
|
1212
|
+
spec: FieldMappingSpec | null | undefined,
|
|
1213
|
+
blocks: EditorBlock[],
|
|
1214
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1215
|
+
options?: { fieldIdRenames?: Record<string, string> | Map<string, string> },
|
|
1216
|
+
): FieldMappingSpec;
|
|
1217
|
+
|
|
1218
|
+
export function collectAllValues(blocks: EditorBlock[]): Record<string, FieldValue>;
|
|
1219
|
+
export function applyDocumentValues(
|
|
1220
|
+
blocks: EditorBlock[],
|
|
1221
|
+
values: Record<string, FieldValue>,
|
|
1222
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1223
|
+
): { blocks: EditorBlock[]; fieldSchemas: Record<string, FieldSchema>; applied: number; skipped: number };
|
|
1224
|
+
export function enrichComputedValues(
|
|
1225
|
+
values: Record<string, FieldValue>,
|
|
1226
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1227
|
+
blocks: EditorBlock[],
|
|
1228
|
+
): Record<string, FieldValue>;
|
|
1229
|
+
export function collectFieldIdsInBlocks(
|
|
1230
|
+
blocks: EditorBlock[],
|
|
1231
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1232
|
+
): Set<string>;
|
|
1233
|
+
export function collectReferencedFieldSchemaIds(
|
|
1234
|
+
blocks: EditorBlock[],
|
|
1235
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1236
|
+
): Set<string>;
|
|
1237
|
+
export function pruneUnusedFieldSchemas(
|
|
1238
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1239
|
+
blocks: EditorBlock[],
|
|
1240
|
+
): Record<string, FieldSchema>;
|
|
1241
|
+
export function pruneUnusedBlockValues(
|
|
1242
|
+
blocks: EditorBlock[],
|
|
1243
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1244
|
+
): EditorBlock[];
|
|
1245
|
+
|
|
1246
|
+
export const ROOT_SECTION_KEY: '_root';
|
|
1247
|
+
|
|
1248
|
+
export function normalizeDocumentValues(
|
|
1249
|
+
data: { values?: Record<string, FieldValue>; sections?: Record<string, Record<string, FieldValue | TableDocumentRows>> },
|
|
1250
|
+
blocks: EditorBlock[],
|
|
1251
|
+
fieldSchemas?: Record<string, FieldSchema>,
|
|
1252
|
+
): Record<string, FieldValue>;
|
|
1253
|
+
export function buildSectionedDocumentFromValues(
|
|
1254
|
+
blocks: EditorBlock[],
|
|
1255
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1256
|
+
flatValues: Record<string, FieldValue>,
|
|
1257
|
+
): Record<string, Record<string, FieldValue | TableDocumentRows>>;
|
|
1258
|
+
export function expandSectionedDocument(
|
|
1259
|
+
sections: Record<string, Record<string, FieldValue | TableDocumentRows>>,
|
|
1260
|
+
blocks: EditorBlock[],
|
|
1261
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1262
|
+
): Record<string, FieldValue>;
|
|
1263
|
+
export function slugSectionKey(sectionName?: string | null): string;
|
|
1264
|
+
export function deriveFieldId(sectionName: string | null | undefined, fieldName: string, usedIds?: Set<string>): string;
|
|
1265
|
+
export function deriveUniqueFieldName(baseName: string, usedNames?: Set<string>): string;
|
|
1266
|
+
export function allocateFieldIdentity(
|
|
1267
|
+
sectionBody: HTMLElement,
|
|
1268
|
+
registry: { getFieldSchemas?: () => Record<string, FieldSchema> } | Record<string, FieldSchema> | null | undefined,
|
|
1269
|
+
baseName: string,
|
|
1270
|
+
options?: { reservedIds?: Set<string>; reservedNames?: Set<string>; excludeFieldId?: string | null },
|
|
1271
|
+
): { fieldId: string; fieldName: string };
|
|
1272
|
+
export function resolveSectionName(data?: DocumentSectionData | Record<string, unknown> | null): string;
|
|
1273
|
+
export function collectUsedSectionNames(
|
|
1274
|
+
blocks?: EditorBlock[] | null,
|
|
1275
|
+
options?: { reservedNames?: Set<string> },
|
|
1276
|
+
): Set<string>;
|
|
1277
|
+
export function allocateUniqueSectionName(usedNames?: Set<string>, baseName?: string): string;
|
|
1278
|
+
export const DEFAULT_SECTION_NAME: string;
|
|
1279
|
+
export function deriveCellFieldId(tableFieldId: string, rowKey: string, colKey: string): string;
|
|
1280
|
+
export function ensureSchemaName(schema: FieldSchema, fallback?: string): FieldSchema;
|
|
1281
|
+
export function ensureSchemasHaveName(fieldSchemas?: Record<string, FieldSchema>): Record<string, FieldSchema>;
|
|
1282
|
+
export function findFieldPlacement(
|
|
1283
|
+
fieldId: string,
|
|
1284
|
+
blocks?: EditorBlock[],
|
|
1285
|
+
): { sectionName: string; sectionLabel: string; sectionKey: string; blockIndex: number; blockType: string };
|
|
1286
|
+
export function collectFieldsInSection(
|
|
1287
|
+
block: EditorBlock,
|
|
1288
|
+
fieldSchemas?: Record<string, FieldSchema>,
|
|
1289
|
+
): Array<{ fieldId: string; name: string; type: string }>;
|
|
1290
|
+
export function isFieldNameTakenInSection(
|
|
1291
|
+
sectionName: string,
|
|
1292
|
+
fieldName: string,
|
|
1293
|
+
currentFieldId: string,
|
|
1294
|
+
blocks: EditorBlock[],
|
|
1295
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1296
|
+
): boolean;
|
|
1297
|
+
export function resolveFieldIdByName(
|
|
1298
|
+
sectionName: string,
|
|
1299
|
+
fieldName: string,
|
|
1300
|
+
blocks: EditorBlock[],
|
|
1301
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1302
|
+
): string | null;
|
|
1303
|
+
export function rebuildFieldIdsForSection(
|
|
1304
|
+
block: EditorBlock,
|
|
1305
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1306
|
+
allBlocks: EditorBlock[],
|
|
1307
|
+
): {
|
|
1308
|
+
fieldSchemas: Record<string, FieldSchema>;
|
|
1309
|
+
blocks: EditorBlock[];
|
|
1310
|
+
idRenames: Record<string, string>;
|
|
1311
|
+
};
|
|
1312
|
+
export function migrateFieldIds(
|
|
1313
|
+
blocks: EditorBlock[],
|
|
1314
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1315
|
+
): { fieldSchemas: Record<string, FieldSchema>; blocks: EditorBlock[] };
|
|
1316
|
+
export function findSectionNameForNode(editable?: HTMLElement | null): string;
|
|
1317
|
+
/** @deprecated Use findSectionNameForNode */
|
|
1318
|
+
export function findSectionLabelForNode(editable?: HTMLElement | null): string;
|
|
1319
|
+
|
|
1320
|
+
export function expandTableArraysInValues(
|
|
1321
|
+
values: Record<string, FieldValue>,
|
|
1322
|
+
fieldSchemas?: Record<string, FieldSchema>,
|
|
1323
|
+
): Record<string, FieldValue>;
|
|
1324
|
+
export function collapseTablesInValues(
|
|
1325
|
+
values: Record<string, FieldValue>,
|
|
1326
|
+
fieldSchemas?: Record<string, FieldSchema>,
|
|
1327
|
+
blocks?: EditorBlock[],
|
|
1328
|
+
): Record<string, FieldValue>;
|
|
1329
|
+
export function tableRowsToFlatValues(
|
|
1330
|
+
tableId: string,
|
|
1331
|
+
rows: TableDocumentRows,
|
|
1332
|
+
tableSchema: TableFieldSchema,
|
|
1333
|
+
rowKeys?: string[],
|
|
1334
|
+
): Record<string, FieldValue>;
|
|
1335
|
+
export function flatValuesToTableRows(
|
|
1336
|
+
tableId: string,
|
|
1337
|
+
flatValues: Record<string, FieldValue>,
|
|
1338
|
+
tableSchema: TableFieldSchema,
|
|
1339
|
+
instanceRows?: TableRowInstance[],
|
|
1340
|
+
): TableDocumentRows;
|
|
1341
|
+
export function collectTableInstancesInBlocks(
|
|
1342
|
+
blocks: EditorBlock[],
|
|
1343
|
+
fieldSchemas?: Record<string, FieldSchema>,
|
|
1344
|
+
): Array<{ tableId: string; rows?: TableRowInstance[] }>;
|
|
1345
|
+
export function isTableRowArray(value: unknown): value is TableDocumentRows;
|
|
1346
|
+
|
|
1347
|
+
export function generateFieldId(prefix?: string): string;
|
|
1348
|
+
export function isValidFieldId(id: string): boolean;
|
|
1349
|
+
export function createDefaultSchema(type: FieldType, label?: string, name?: string): FieldSchema;
|
|
1350
|
+
export function createDefaultBlockData(fieldType: FieldType): TemplateBlockData;
|
|
1351
|
+
export function ensureCellSchemas(
|
|
1352
|
+
tableSchema: TableFieldSchema,
|
|
1353
|
+
tableId: string,
|
|
1354
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1355
|
+
rows?: TableRowInstance[],
|
|
1356
|
+
): Record<string, FieldSchema>;
|
|
1357
|
+
export function ensureCellSchemasForRows(
|
|
1358
|
+
tableSchema: TableFieldSchema,
|
|
1359
|
+
tableId: string,
|
|
1360
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1361
|
+
rows: TableRowInstance[],
|
|
1362
|
+
): Record<string, FieldSchema>;
|
|
1363
|
+
export function ensureSchemaForFieldProperties(
|
|
1364
|
+
fieldId: string,
|
|
1365
|
+
fieldSchemas?: Record<string, FieldSchema>,
|
|
1366
|
+
hint?: {
|
|
1367
|
+
tableId?: string;
|
|
1368
|
+
rowKey?: string;
|
|
1369
|
+
colKey?: string;
|
|
1370
|
+
rows?: TableRowInstance[];
|
|
1371
|
+
},
|
|
1372
|
+
): { fieldSchemas: Record<string, FieldSchema>; schema: FieldSchema | null };
|
|
1373
|
+
export function generateTableRowKey(existingRows?: TableRowInstance[]): string;
|
|
1374
|
+
export function resolveTableInstanceRows(
|
|
1375
|
+
segmentRows: TableRowInstance[] | undefined,
|
|
1376
|
+
tableSchema: TableFieldSchema,
|
|
1377
|
+
): TableRowInstance[];
|
|
1378
|
+
export function extractRowKeysFromTableValues(
|
|
1379
|
+
tableId: string,
|
|
1380
|
+
tableSchema: TableFieldSchema,
|
|
1381
|
+
values: Record<string, FieldValue>,
|
|
1382
|
+
): Set<string>;
|
|
1383
|
+
export function labelToFieldKey(label: string, usedKeys?: Set<string>): string;
|
|
1384
|
+
export function buildTableColumnsFromLabels(
|
|
1385
|
+
labels: string[],
|
|
1386
|
+
widths?: string[],
|
|
1387
|
+
previousColumns?: TableColumnDef[],
|
|
1388
|
+
columnNames?: string[],
|
|
1389
|
+
): TableColumnDef[];
|
|
1390
|
+
export function syncTableColumnKeyChanges(
|
|
1391
|
+
tableFieldId: string,
|
|
1392
|
+
oldColumns: TableColumnDef[] | undefined,
|
|
1393
|
+
newColumns: TableColumnDef[] | undefined,
|
|
1394
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1395
|
+
blocks: EditorBlock[],
|
|
1396
|
+
): { fieldSchemas: Record<string, FieldSchema>; blocks: EditorBlock[] };
|
|
1397
|
+
export function mergeTableInstanceRows(
|
|
1398
|
+
existingRows: TableRowInstance[] | undefined,
|
|
1399
|
+
discoveredRowKeys: Iterable<string>,
|
|
1400
|
+
tableSchema: TableFieldSchema,
|
|
1401
|
+
): TableRowInstance[];
|
|
1402
|
+
export function removeTableRowCellData(
|
|
1403
|
+
tableFieldId: string,
|
|
1404
|
+
rowKey: string,
|
|
1405
|
+
fieldValues: Record<string, FieldValue>,
|
|
1406
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1407
|
+
): { fieldValues: Record<string, FieldValue>; fieldSchemas: Record<string, FieldSchema> };
|
|
1408
|
+
export function getRepeaterFieldSchemas(
|
|
1409
|
+
repeaterSchema: RepeaterFieldSchema | null | undefined,
|
|
1410
|
+
): Record<string, FieldSchema>;
|
|
1411
|
+
export function normalizeRepeaterSchema(repeaterSchema: RepeaterFieldSchema): RepeaterFieldSchema;
|
|
1412
|
+
export function isLegacyRepeaterInstancesWrapper(value: unknown): boolean;
|
|
1413
|
+
export function createEmptyRepeaterValue(repeaterSchema: RepeaterFieldSchema): RepeaterValue;
|
|
1414
|
+
export function normalizeRepeaterValue(
|
|
1415
|
+
value: RepeaterValue | null | undefined | unknown,
|
|
1416
|
+
repeaterSchema: RepeaterFieldSchema,
|
|
1417
|
+
): RepeaterValue;
|
|
1418
|
+
export function buildRepeaterPreviewDocument(
|
|
1419
|
+
repeaterSchema: RepeaterFieldSchema,
|
|
1420
|
+
repeaterValue: RepeaterValue,
|
|
1421
|
+
): EditorDocument;
|
|
1422
|
+
export function buildRepeaterFillDocument(
|
|
1423
|
+
repeaterSchema: RepeaterFieldSchema,
|
|
1424
|
+
repeaterValue: RepeaterValue | unknown,
|
|
1425
|
+
): EditorDocument;
|
|
1426
|
+
export function repeaterHasTemplate(repeaterSchema: RepeaterFieldSchema | null | undefined): boolean;
|
|
1427
|
+
export function repeaterChildNamespacePrefix(repeaterFieldId: string): string;
|
|
1428
|
+
export function namespaceRepeaterChildTemplate(
|
|
1429
|
+
doc: EditorDocument,
|
|
1430
|
+
repeaterFieldId: string,
|
|
1431
|
+
): EditorDocument;
|
|
1432
|
+
export function createDefaultRepeaterTemplateDocument(): EditorDocument;
|
|
1433
|
+
export function buildRepeaterTemplateDocument(repeaterSchema: RepeaterFieldSchema): EditorDocument;
|
|
1434
|
+
export function extractRepeaterFieldSchemasFromDocument(
|
|
1435
|
+
doc: EditorDocument,
|
|
1436
|
+
): RepeaterFieldSchema['fieldSchemas'];
|
|
1437
|
+
export function extractRepeaterValueFromDocument(
|
|
1438
|
+
doc: EditorDocument,
|
|
1439
|
+
repeaterSchema: RepeaterFieldSchema,
|
|
1440
|
+
): RepeaterValue;
|
|
1441
|
+
export function sanitizeRepeaterChildSchemas(
|
|
1442
|
+
repeaterSchema: RepeaterFieldSchema,
|
|
1443
|
+
parentFieldSchemas?: Record<string, FieldSchema>,
|
|
1444
|
+
blocks?: EditorBlock[],
|
|
1445
|
+
): RepeaterFieldSchema;
|
|
1446
|
+
export function inferRepeaterChildSchemasFromValue(
|
|
1447
|
+
value: unknown,
|
|
1448
|
+
repeaterSchema?: RepeaterFieldSchema,
|
|
1449
|
+
parentFieldSchemas?: Record<string, FieldSchema>,
|
|
1450
|
+
blocks?: EditorBlock[],
|
|
1451
|
+
): RepeaterFieldSchema['fieldSchemas'];
|
|
1452
|
+
export function ensureRepeaterChildSchemas(
|
|
1453
|
+
repeaterSchema: RepeaterFieldSchema,
|
|
1454
|
+
value?: unknown,
|
|
1455
|
+
parentFieldSchemas?: Record<string, FieldSchema>,
|
|
1456
|
+
blocks?: EditorBlock[],
|
|
1457
|
+
): RepeaterFieldSchema;
|
|
1458
|
+
export function extractRepeaterFieldValueFromBlocks(
|
|
1459
|
+
fieldId: string,
|
|
1460
|
+
blocks: EditorBlock[],
|
|
1461
|
+
): unknown;
|
|
1462
|
+
export function stripForeignKeysFromRepeaterValue(
|
|
1463
|
+
value: unknown,
|
|
1464
|
+
parentFieldSchemas?: Record<string, FieldSchema>,
|
|
1465
|
+
repeaterSchema?: RepeaterFieldSchema | null,
|
|
1466
|
+
): unknown;
|
|
1467
|
+
export function ensureRepeaterSchemasFromBlockValues(
|
|
1468
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1469
|
+
blocks: EditorBlock[],
|
|
1470
|
+
): Record<string, FieldSchema>;
|
|
1471
|
+
export const REPEATER_CHILD_FIELD_PREFIX: '_repeater_';
|
|
1472
|
+
export function toRepeaterChildEditorFieldId(storageKey: string): string;
|
|
1473
|
+
export function fromRepeaterChildEditorFieldId(editorFieldId: string): string;
|
|
1474
|
+
export function buildRepeaterTemplateExport(repeaterSchema: RepeaterFieldSchema): Record<string, unknown>;
|
|
1475
|
+
export function parseRepeaterTemplateImport(
|
|
1476
|
+
data: unknown,
|
|
1477
|
+
repeaterFieldId?: string,
|
|
1478
|
+
): {
|
|
1479
|
+
fieldSchemas: RepeaterFieldSchema['fieldSchemas'];
|
|
1480
|
+
template?: RepeaterFieldSchema['template'];
|
|
1481
|
+
};
|
|
1482
|
+
export function applyRepeaterTemplateImport(
|
|
1483
|
+
repeaterSchema: RepeaterFieldSchema,
|
|
1484
|
+
imported: ReturnType<typeof parseRepeaterTemplateImport>,
|
|
1485
|
+
): RepeaterFieldSchema;
|
|
1486
|
+
export const REPEATER_TEMPLATE_FILE_KIND: 'repeater-template';
|
|
1487
|
+
export const REPEATER_TEMPLATE_FILE_VERSION: 3;
|
|
1488
|
+
export function repeaterHasContent(
|
|
1489
|
+
value: RepeaterValue | null | undefined | unknown,
|
|
1490
|
+
repeaterSchema: RepeaterFieldSchema,
|
|
1491
|
+
): boolean;
|
|
1492
|
+
export function syncBlocksAfterSchemaChange(
|
|
1493
|
+
blocks: EditorBlock[],
|
|
1494
|
+
fieldId: string,
|
|
1495
|
+
newSchema: FieldSchema,
|
|
1496
|
+
): EditorBlock[];
|
|
1497
|
+
export function applyFieldIdChange(
|
|
1498
|
+
oldId: string,
|
|
1499
|
+
newId: string,
|
|
1500
|
+
updatedSchema: FieldSchema,
|
|
1501
|
+
fieldSchemas: Record<string, FieldSchema>,
|
|
1502
|
+
blocks: EditorBlock[],
|
|
1503
|
+
): { fieldSchemas: Record<string, FieldSchema>; blocks: EditorBlock[] };
|
|
1504
|
+
export function resolveSchemaDefaultValue(
|
|
1505
|
+
schema: FieldSchema | undefined,
|
|
1506
|
+
options?: { forTemplate?: boolean },
|
|
1507
|
+
): FieldValue;
|
|
1508
|
+
export function convertSchemaType(
|
|
1509
|
+
schema: FieldSchema,
|
|
1510
|
+
newType: FieldType,
|
|
1511
|
+
catalogProvider?: CatalogProvider | null,
|
|
1512
|
+
): FieldSchema;
|
|
1513
|
+
export function cellFieldId(tableId: string, rowKey: string, colKey: string): string;
|
|
1514
|
+
export function parseCellFieldId(
|
|
1515
|
+
fieldId: string,
|
|
1516
|
+
fieldSchemas?: Record<string, FieldSchema>,
|
|
1517
|
+
): { tableFieldId: string; rowKey: string; colKey: string } | null;
|
|
1518
|
+
export function isCellFieldId(fieldId: string, fieldSchemas?: Record<string, FieldSchema>): boolean;
|
|
1519
|
+
export function listColumnCellFieldIds(
|
|
1520
|
+
tableFieldId: string,
|
|
1521
|
+
colKey: string,
|
|
1522
|
+
fieldSchemas?: Record<string, FieldSchema>,
|
|
1523
|
+
): string[];
|
|
1524
|
+
export function tagTableCellToken(
|
|
1525
|
+
token: HTMLElement,
|
|
1526
|
+
tableFieldId: string,
|
|
1527
|
+
rowKey: string,
|
|
1528
|
+
colKey: string,
|
|
1529
|
+
): void;
|
|
1530
|
+
export function isSchemaRequired(schema: FieldSchema | undefined): boolean;
|
|
1531
|
+
export function isSchemaReadonly(schema: FieldSchema | undefined): boolean;
|
|
1532
|
+
export function isTableCellInheritedReadonly(
|
|
1533
|
+
fieldId: string | undefined,
|
|
1534
|
+
fieldSchemas?: Record<string, FieldSchema>,
|
|
1535
|
+
): boolean;
|
|
1536
|
+
export function isFieldEditableInFillMode(
|
|
1537
|
+
schema: FieldSchema | undefined,
|
|
1538
|
+
options?: { fieldId?: string; fieldSchemas?: Record<string, FieldSchema> },
|
|
1539
|
+
): boolean;
|
|
1540
|
+
|
|
1541
|
+
/** Palette field entry. Prefer getFieldTypes() so host-registered plugins are included. */
|
|
1542
|
+
export const FIELD_TYPES: Array<{ kind?: 'field'; type: FieldType | string; label: string }>;
|
|
1543
|
+
|
|
1544
|
+
export function getFieldTypes(): Array<{ kind: 'field'; type: string; label: string }>;
|
|
1545
|
+
|
|
1546
|
+
export type FieldInsertionMode = 'inline' | 'table' | 'block';
|
|
1547
|
+
|
|
1548
|
+
/**
|
|
1549
|
+
* Plugin interface for a field type. Built-ins are registered at package load;
|
|
1550
|
+
* hosts may call registerField() to add or replace types.
|
|
1551
|
+
*/
|
|
1552
|
+
export interface FieldHandler {
|
|
1553
|
+
type: string;
|
|
1554
|
+
label: string;
|
|
1555
|
+
paletteOrder?: number;
|
|
1556
|
+
insertion?: FieldInsertionMode;
|
|
1557
|
+
editableInFill?: boolean;
|
|
1558
|
+
blockLabel?: string;
|
|
1559
|
+
createSchema(label: string, name: string): FieldSchema | Record<string, unknown>;
|
|
1560
|
+
getEmptyValue(): unknown;
|
|
1561
|
+
resolveDefaultValue(
|
|
1562
|
+
schema: FieldSchema | Record<string, unknown>,
|
|
1563
|
+
options?: { forTemplate?: boolean },
|
|
1564
|
+
): unknown;
|
|
1565
|
+
toDisplayConfig(schema: FieldSchema | Record<string, unknown>): Record<string, unknown> | null;
|
|
1566
|
+
toPickerConfig(
|
|
1567
|
+
schema: FieldSchema | Record<string, unknown>,
|
|
1568
|
+
catalogs: CatalogProvider,
|
|
1569
|
+
): Record<string, unknown> | null;
|
|
1570
|
+
/** Render type-specific designer controls into the schema form extra host. */
|
|
1571
|
+
renderSchemaFields?(
|
|
1572
|
+
host: HTMLElement,
|
|
1573
|
+
schema: FieldSchema | Record<string, unknown>,
|
|
1574
|
+
ctx?: Record<string, unknown>,
|
|
1575
|
+
): void;
|
|
1576
|
+
/** Read type-specific designer controls; `undefined` values remove keys from the schema. */
|
|
1577
|
+
readSchemaFields?(
|
|
1578
|
+
host: ParentNode,
|
|
1579
|
+
schema: FieldSchema | Record<string, unknown>,
|
|
1580
|
+
): Record<string, unknown>;
|
|
1581
|
+
/**
|
|
1582
|
+
* Format a filled value for tokens / preview / PDF.
|
|
1583
|
+
* Return `null`/`undefined` to fall back to core formatting.
|
|
1584
|
+
*/
|
|
1585
|
+
formatDisplay?(
|
|
1586
|
+
value: unknown,
|
|
1587
|
+
ctx: {
|
|
1588
|
+
schema?: FieldSchema | Record<string, unknown>;
|
|
1589
|
+
def?: Record<string, unknown> | null;
|
|
1590
|
+
emptyLabel?: string;
|
|
1591
|
+
fieldId?: string;
|
|
1592
|
+
context?: unknown;
|
|
1593
|
+
},
|
|
1594
|
+
): string | null | undefined;
|
|
1595
|
+
/** Return true/false when the handler owns emptiness; omit/`undefined` uses core fallback. */
|
|
1596
|
+
isEmpty?(value: unknown, schema: FieldSchema | Record<string, unknown>): boolean | undefined;
|
|
1597
|
+
/** How PDF should render the field. `html` uses HTML→PDF blocks; default is plain text via formatDisplay. */
|
|
1598
|
+
pdfRenderMode?(schema: FieldSchema | Record<string, unknown>): 'plain' | 'html' | undefined;
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
export function registerField(handler: FieldHandler): FieldHandler;
|
|
1602
|
+
export function unregisterField(type: string): boolean;
|
|
1603
|
+
export function getFieldHandler(type: string): FieldHandler | undefined;
|
|
1604
|
+
export function hasFieldHandler(type: string): boolean;
|
|
1605
|
+
export function listFieldHandlers(): FieldHandler[];
|
|
1606
|
+
export function getInlineFieldTypes(): string[];
|
|
1607
|
+
export function isInlineFieldType(type: string): boolean;
|
|
1608
|
+
export function registerBuiltinFields(): void;
|
|
1609
|
+
|
|
1610
|
+
export function registerFormulaFunction(def: FormulaFunctionDef): FormulaFunctionDef;
|
|
1611
|
+
export function unregisterFormulaFunction(name: string): boolean;
|
|
1612
|
+
export function resetFormulaFunctions(): void;
|
|
1613
|
+
export function getFormulaFunction(
|
|
1614
|
+
name: string,
|
|
1615
|
+
overlay?: FormulaFunctionDef[],
|
|
1616
|
+
): FormulaFunctionDef | undefined;
|
|
1617
|
+
export function listFormulaFunctions(overlay?: FormulaFunctionDef[]): FormulaFunctionDef[];
|
|
1618
|
+
export function listFormulaPickerFunctions(overlay?: FormulaFunctionDef[]): FormulaFunctionDef[];
|
|
1619
|
+
|
|
1620
|
+
export function applyDesignMode(enabled: boolean): void;
|
|
1621
|
+
export function isDesignMode(): boolean;
|
|
1622
|
+
export function configureImageUpload(config: ImageUploadConfig): void;
|
|
1623
|
+
|
|
1624
|
+
|
|
1625
|
+
export interface PreviewExportOptions {
|
|
1626
|
+
fieldValueStyle?: FieldValueStyleOptions;
|
|
1627
|
+
fieldHighlight?: FieldHighlightStyle;
|
|
1628
|
+
pageSetup?: TemplatePageSetup;
|
|
1629
|
+
/** When true, omit empty fields, table rows, and repeaters from preview/PDF. Default false. */
|
|
1630
|
+
hideEmptyValues?: boolean;
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
export interface PreviewArtifactOptions extends PreviewExportOptions {
|
|
1634
|
+
/** Explicit format, or `current` to follow the open preview (default html when closed). */
|
|
1635
|
+
format?: 'html' | 'pdf' | 'current';
|
|
1636
|
+
filename?: string;
|
|
1637
|
+
title?: string;
|
|
1638
|
+
generatePdfBlob?: (
|
|
1639
|
+
doc: EditorDocument,
|
|
1640
|
+
options?: PdfExportOptions,
|
|
1641
|
+
) => Promise<Blob>;
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
export interface PreviewArtifact {
|
|
1645
|
+
blob: Blob;
|
|
1646
|
+
filename: string;
|
|
1647
|
+
mimeType: string;
|
|
1648
|
+
format: 'html' | 'pdf';
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
export interface PdfExportOptions extends PreviewExportOptions {
|
|
1652
|
+
filename?: string;
|
|
1653
|
+
format?: 'a4' | 'letter' | 'custom';
|
|
1654
|
+
margin?: number | [number, number, number, number];
|
|
1655
|
+
title?: string;
|
|
1656
|
+
/** Clone of visible preview DOM (e.g. from preview modal) for reliable capture. */
|
|
1657
|
+
sourceElement?: HTMLElement;
|
|
1658
|
+
/** When true (default), save to disk after generation. Set false to only return a blob via generateDocumentPdfBlob. */
|
|
1659
|
+
download?: boolean;
|
|
1660
|
+
generatePdfBlob?: (
|
|
1661
|
+
doc: EditorDocument,
|
|
1662
|
+
options?: PdfExportOptions,
|
|
1663
|
+
) => Promise<Blob>;
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
export interface FieldsExportOptions {
|
|
1667
|
+
/** When true, omit empty fields, table rows, and repeaters from exported values. Default false. */
|
|
1668
|
+
hideEmptyValues?: boolean;
|
|
1669
|
+
/**
|
|
1670
|
+
* When true, drop fields that have any field-mapping rule (scenario packs).
|
|
1671
|
+
* Uses the document's current fieldMapping.rules. Default false.
|
|
1672
|
+
*/
|
|
1673
|
+
omitMappedFields?: boolean;
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
/** @deprecated Use FieldsExportOptions */
|
|
1677
|
+
export type DocumentExportOptions = FieldsExportOptions;
|
|
1678
|
+
|
|
1679
|
+
export function renderDocumentPreview(
|
|
1680
|
+
doc: EditorDocument,
|
|
1681
|
+
options?: PreviewExportOptions,
|
|
1682
|
+
): HTMLElement;
|
|
1683
|
+
export function exportDocumentPdf(
|
|
1684
|
+
doc: EditorDocument,
|
|
1685
|
+
options?: PdfExportOptions,
|
|
1686
|
+
): Promise<Blob>;
|
|
1687
|
+
export function generateDocumentPdfBlob(
|
|
1688
|
+
doc: EditorDocument,
|
|
1689
|
+
options?: PdfExportOptions,
|
|
1690
|
+
): Promise<Blob>;
|
|
1691
|
+
|
|
1692
|
+
export function createFieldToken(
|
|
1693
|
+
fieldId: string,
|
|
1694
|
+
value: FieldValue,
|
|
1695
|
+
placeholder?: string,
|
|
1696
|
+
): HTMLElement;
|
|
1697
|
+
export function updateFieldToken(
|
|
1698
|
+
token: HTMLElement,
|
|
1699
|
+
value: FieldValue,
|
|
1700
|
+
placeholder?: string,
|
|
1701
|
+
): void;
|
|
1702
|
+
export function readTokenValue(token: HTMLElement): FieldValue;
|
|
1703
|
+
export function readRepeaterTokenValue(token: HTMLElement): Record<string, FieldValue>;
|
|
1704
|
+
export function openFieldPicker(
|
|
1705
|
+
fieldId: string,
|
|
1706
|
+
currentValue: FieldValue,
|
|
1707
|
+
callbacks: PickerCallbacks & { getRegistry?: () => SchemaRegistry },
|
|
1708
|
+
): Promise<FieldValue>;
|
|
1709
|
+
export function pickFillFieldFromToken(
|
|
1710
|
+
token: HTMLElement,
|
|
1711
|
+
callbacks: PickerCallbacks & {
|
|
1712
|
+
getRegistry?: () => SchemaRegistry;
|
|
1713
|
+
editorHolder?: ParentNode;
|
|
1714
|
+
fieldValues?: Record<string, FieldValue>;
|
|
1715
|
+
fieldSchemas?: Record<string, FieldSchema>;
|
|
1716
|
+
},
|
|
1717
|
+
onUpdate?: (fieldId: string, value: FieldValue) => void,
|
|
1718
|
+
options?: {
|
|
1719
|
+
schema?: FieldSchema;
|
|
1720
|
+
placeholder?: string;
|
|
1721
|
+
currentValue?: FieldValue;
|
|
1722
|
+
updateContext?: unknown;
|
|
1723
|
+
root?: ParentNode;
|
|
1724
|
+
/** When set, overrides pageSetup.autoAdvanceFillFields for this pick. */
|
|
1725
|
+
advanceToNext?: boolean;
|
|
1726
|
+
},
|
|
1727
|
+
): Promise<FieldValue | undefined>;
|
|
1728
|
+
|
|
1729
|
+
export function showNotification(
|
|
1730
|
+
message: string,
|
|
1731
|
+
options?: { type?: 'error' | 'status'; durationMs?: number },
|
|
1732
|
+
): void;
|
|
1733
|
+
|
|
1734
|
+
export function defineDocEditorElement(tagName?: string): void;
|
|
1735
|
+
|
|
1736
|
+
/** Shared fill-mode field dialog used by text, integer, date, and plugins. */
|
|
1737
|
+
export function createFieldFormModal<TOpen extends { title?: string; parent?: HTMLElement | null }>(
|
|
1738
|
+
options: {
|
|
1739
|
+
parent?: HTMLElement | null;
|
|
1740
|
+
bodyHtml: string;
|
|
1741
|
+
modalClass?: string;
|
|
1742
|
+
focusSelector?: string;
|
|
1743
|
+
submitOnEnter?: boolean;
|
|
1744
|
+
selectAll?: boolean | ((opts: TOpen) => boolean);
|
|
1745
|
+
getValue: (els: {
|
|
1746
|
+
overlay: HTMLElement;
|
|
1747
|
+
modal: HTMLElement;
|
|
1748
|
+
body: HTMLElement;
|
|
1749
|
+
header: HTMLElement;
|
|
1750
|
+
}) => string;
|
|
1751
|
+
validate?: (
|
|
1752
|
+
els: {
|
|
1753
|
+
overlay: HTMLElement;
|
|
1754
|
+
modal: HTMLElement;
|
|
1755
|
+
body: HTMLElement;
|
|
1756
|
+
header: HTMLElement;
|
|
1757
|
+
},
|
|
1758
|
+
value: string,
|
|
1759
|
+
) => string | null;
|
|
1760
|
+
onOpen?: (
|
|
1761
|
+
els: {
|
|
1762
|
+
overlay: HTMLElement;
|
|
1763
|
+
modal: HTMLElement;
|
|
1764
|
+
body: HTMLElement;
|
|
1765
|
+
header: HTMLElement;
|
|
1766
|
+
},
|
|
1767
|
+
opts: TOpen,
|
|
1768
|
+
) => void;
|
|
1769
|
+
onClose?: (els: {
|
|
1770
|
+
overlay: HTMLElement;
|
|
1771
|
+
modal: HTMLElement;
|
|
1772
|
+
body: HTMLElement;
|
|
1773
|
+
header: HTMLElement;
|
|
1774
|
+
}) => void;
|
|
1775
|
+
},
|
|
1776
|
+
): {
|
|
1777
|
+
open(opts?: TOpen): Promise<string>;
|
|
1778
|
+
overlay: HTMLElement;
|
|
1779
|
+
modal: HTMLElement;
|
|
1780
|
+
body: HTMLElement;
|
|
1781
|
+
header: HTMLElement;
|
|
1782
|
+
};
|