@argusvane/datum-form-test 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/NOTICE +26 -0
- package/README.md +52 -2
- package/bin/datum-form-test.mjs +11 -0
- package/dist/bundle-size.txt +3 -0
- package/dist/cli.mjs +3 -0
- package/dist/datum-form-test.LICENSE.txt +510 -0
- package/dist/index.mjs +68728 -0
- package/dist/types/engine/form-engine/agent/builder/agent-texts-en.d.ts +53 -0
- package/dist/types/engine/form-engine/builder/controller/builder-controller.d.ts +2534 -0
- package/dist/types/engine/form-engine/builder/controller/dependents.d.ts +122 -0
- package/dist/types/engine/form-engine/builder/controller/language-edits.d.ts +48 -0
- package/dist/types/engine/form-engine/builder/controller/simulated-options.d.ts +20 -0
- package/dist/types/engine/form-engine/builder/controller/translation-rules.d.ts +71 -0
- package/dist/types/engine/form-engine/builder/controller/try-submission.d.ts +45 -0
- package/dist/types/engine/form-engine/builder/data/data-loader.d.ts +6 -0
- package/dist/types/engine/form-engine/builder/data/data-model-import.d.ts +119 -0
- package/dist/types/engine/form-engine/builder/data/data-model-plan.d.ts +52 -0
- package/dist/types/engine/form-engine/builder/data/data-surface.d.ts +139 -0
- package/dist/types/engine/form-engine/builder/data/data-texts-en.d.ts +205 -0
- package/dist/types/engine/form-engine/builder/data/schema-rows.d.ts +56 -0
- package/dist/types/engine/form-engine/builder/data-model/compare.d.ts +37 -0
- package/dist/types/engine/form-engine/builder/data-model/data-model.d.ts +113 -0
- package/dist/types/engine/form-engine/builder/data-model/example.d.ts +6 -0
- package/dist/types/engine/form-engine/builder/data-model/from-form.d.ts +43 -0
- package/dist/types/engine/form-engine/builder/data-model/from-json-schema.d.ts +22 -0
- package/dist/types/engine/form-engine/builder/data-model/from-sample.d.ts +13 -0
- package/dist/types/engine/form-engine/builder/data-model/generate.d.ts +101 -0
- package/dist/types/engine/form-engine/builder/data-model/index.d.ts +10 -0
- package/dist/types/engine/form-engine/builder/data-model/mapping.d.ts +26 -0
- package/dist/types/engine/form-engine/builder/data-model/read-input.d.ts +39 -0
- package/dist/types/engine/form-engine/builder/data-model/to-json-schema.d.ts +10 -0
- package/dist/types/engine/form-engine/builder/definition-budget.d.ts +27 -0
- package/dist/types/engine/form-engine/builder/drag-drop/html5-drag-drop.d.ts +57 -0
- package/dist/types/engine/form-engine/builder/drag-drop/move-legality.d.ts +23 -0
- package/dist/types/engine/form-engine/builder/drag-drop/move-texts-en.d.ts +22 -0
- package/dist/types/engine/form-engine/builder/drag-drop/move-ui.d.ts +72 -0
- package/dist/types/engine/form-engine/builder/form-tests/tests-accept.d.ts +18 -0
- package/dist/types/engine/form-engine/builder/form-tests/tests-add-step.d.ts +51 -0
- package/dist/types/engine/form-engine/builder/form-tests/tests-completions.d.ts +66 -0
- package/dist/types/engine/form-engine/builder/form-tests/tests-coverage.d.ts +32 -0
- package/dist/types/engine/form-engine/builder/form-tests/tests-editor-loader.d.ts +10 -0
- package/dist/types/engine/form-engine/builder/form-tests/tests-editor-texts-en.d.ts +72 -0
- package/dist/types/engine/form-engine/builder/form-tests/tests-editor.d.ts +50 -0
- package/dist/types/engine/form-engine/builder/form-tests/tests-model.d.ts +422 -0
- package/dist/types/engine/form-engine/builder/form-tests/tests-panel-styles.d.ts +8 -0
- package/dist/types/engine/form-engine/builder/form-tests/tests-panel-texts-en.d.ts +174 -0
- package/dist/types/engine/form-engine/builder/form-tests/tests-record.d.ts +55 -0
- package/dist/types/engine/form-engine/builder/form-tests/tests-rename.d.ts +93 -0
- package/dist/types/engine/form-engine/builder/form-tests/tests-rules.d.ts +42 -0
- package/dist/types/engine/form-engine/builder/form-tests/tests-runner.d.ts +2 -0
- package/dist/types/engine/form-engine/builder/form-tests/tests-scaffold.d.ts +13 -0
- package/dist/types/engine/form-engine/builder/form-tests/tests-textarea.d.ts +88 -0
- package/dist/types/engine/form-engine/builder/form-tests/tests-texts-en.d.ts +222 -0
- package/dist/types/engine/form-engine/builder/form-tests/tests-words.d.ts +12 -0
- package/dist/types/engine/form-engine/builder/formula/feel-functions.d.ts +98 -0
- package/dist/types/engine/form-engine/builder/formula/feel-print.d.ts +47 -0
- package/dist/types/engine/form-engine/builder/formula/formula-editor-loader.d.ts +16 -0
- package/dist/types/engine/form-engine/builder/formula/formula-editor-styles.d.ts +19 -0
- package/dist/types/engine/form-engine/builder/formula/formula-editor.d.ts +104 -0
- package/dist/types/engine/form-engine/builder/formula/formula-fields.d.ts +44 -0
- package/dist/types/engine/form-engine/builder/formula/formula-textarea.d.ts +75 -0
- package/dist/types/engine/form-engine/builder/formula/formula-texts-en.d.ts +18 -0
- package/dist/types/engine/form-engine/builder/formula/rename.d.ts +98 -0
- package/dist/types/engine/form-engine/builder/history/command-history.d.ts +31 -0
- package/dist/types/engine/form-engine/builder/history/form-steps-on-page.d.ts +104 -0
- package/dist/types/engine/form-engine/builder/history/rename-step.d.ts +68 -0
- package/dist/types/engine/form-engine/builder/index.d.ts +48 -0
- package/dist/types/engine/form-engine/builder/journey-designer/journey-authoring-texts-en.d.ts +20 -0
- package/dist/types/engine/form-engine/builder/journey-designer/journey-authoring.d.ts +119 -0
- package/dist/types/engine/form-engine/builder/journey-designer/journey-builder-mode.d.ts +385 -0
- package/dist/types/engine/form-engine/builder/journey-designer/journey-catalog.d.ts +212 -0
- package/dist/types/engine/form-engine/builder/journey-designer/journey-checks.d.ts +175 -0
- package/dist/types/engine/form-engine/builder/journey-designer/journey-components.d.ts +183 -0
- package/dist/types/engine/form-engine/builder/journey-designer/journey-config-rename.d.ts +43 -0
- package/dist/types/engine/form-engine/builder/journey-designer/journey-designer-panels.d.ts +67 -0
- package/dist/types/engine/form-engine/builder/journey-designer/journey-designer.d.ts +296 -0
- package/dist/types/engine/form-engine/builder/journey-designer/journey-finding-words.d.ts +30 -0
- package/dist/types/engine/form-engine/builder/journey-designer/journey-findings.d.ts +74 -0
- package/dist/types/engine/form-engine/builder/journey-designer/journey-from-form.d.ts +89 -0
- package/dist/types/engine/form-engine/builder/journey-designer/journey-mode-loader.d.ts +19 -0
- package/dist/types/engine/form-engine/builder/journey-designer/journey-mode-model.d.ts +100 -0
- package/dist/types/engine/form-engine/builder/journey-designer/journey-preview-texts-en.d.ts +28 -0
- package/dist/types/engine/form-engine/builder/journey-designer/journey-preview.d.ts +163 -0
- package/dist/types/engine/form-engine/builder/journey-designer/journey-references.d.ts +104 -0
- package/dist/types/engine/form-engine/builder/journey-designer/journey-texts-en.d.ts +151 -0
- package/dist/types/engine/form-engine/builder/journey-designer/journey-texts.d.ts +51 -0
- package/dist/types/engine/form-engine/builder/journey-designer/journey-tree.d.ts +139 -0
- package/dist/types/engine/form-engine/builder/journey-designer/journey-try-map.d.ts +49 -0
- package/dist/types/engine/form-engine/builder/journey-designer/step-canvas-adapter.d.ts +253 -0
- package/dist/types/engine/form-engine/builder/journey-designer/step-history.d.ts +71 -0
- package/dist/types/engine/form-engine/builder/journey-designer/step-review.d.ts +79 -0
- package/dist/types/engine/form-engine/builder/journey-designer/step-view.d.ts +75 -0
- package/dist/types/engine/form-engine/builder/journey-map/journey-map-layout.d.ts +135 -0
- package/dist/types/engine/form-engine/builder/journey-map/journey-map-model.d.ts +346 -0
- package/dist/types/engine/form-engine/builder/journey-map/journey-map-preferences.d.ts +30 -0
- package/dist/types/engine/form-engine/builder/journey-map/journey-map-styles.d.ts +32 -0
- package/dist/types/engine/form-engine/builder/journey-map/journey-map-svg.d.ts +17 -0
- package/dist/types/engine/form-engine/builder/journey-map/journey-map-texts-en.d.ts +138 -0
- package/dist/types/engine/form-engine/builder/journey-map/journey-map.d.ts +138 -0
- package/dist/types/engine/form-engine/builder/languages/engine-texts.d.ts +19 -0
- package/dist/types/engine/form-engine/builder/languages/exchange.d.ts +199 -0
- package/dist/types/engine/form-engine/builder/languages/languages-cells.d.ts +106 -0
- package/dist/types/engine/form-engine/builder/languages/languages-exchange-dialog.d.ts +58 -0
- package/dist/types/engine/form-engine/builder/languages/languages-exchange-texts-en.d.ts +101 -0
- package/dist/types/engine/form-engine/builder/languages/languages-loader.d.ts +7 -0
- package/dist/types/engine/form-engine/builder/languages/languages-model.d.ts +180 -0
- package/dist/types/engine/form-engine/builder/languages/languages-surface.d.ts +418 -0
- package/dist/types/engine/form-engine/builder/languages/languages-texts-en.d.ts +174 -0
- package/dist/types/engine/form-engine/builder/logic/builder-texts.d.ts +1127 -0
- package/dist/types/engine/form-engine/builder/logic/coverage.d.ts +86 -0
- package/dist/types/engine/form-engine/builder/logic/index.d.ts +5 -0
- package/dist/types/engine/form-engine/builder/logic/logic-journey-host.d.ts +92 -0
- package/dist/types/engine/form-engine/builder/logic/logic-loader.d.ts +7 -0
- package/dist/types/engine/form-engine/builder/logic/logic-model.d.ts +158 -0
- package/dist/types/engine/form-engine/builder/logic/logic-surface.d.ts +359 -0
- package/dist/types/engine/form-engine/builder/logic/logic-texts-en.d.ts +216 -0
- package/dist/types/engine/form-engine/builder/logic/logic-types.d.ts +183 -0
- package/dist/types/engine/form-engine/builder/overview/overview-loader.d.ts +7 -0
- package/dist/types/engine/form-engine/builder/overview/overview-surface.d.ts +84 -0
- package/dist/types/engine/form-engine/builder/overview/overview-texts-en.d.ts +27 -0
- package/dist/types/engine/form-engine/builder/palette/command-palette.d.ts +46 -0
- package/dist/types/engine/form-engine/builder/palette/palette-filter.d.ts +37 -0
- package/dist/types/engine/form-engine/builder/palette/palette-loader.d.ts +6 -0
- package/dist/types/engine/form-engine/builder/palette/palette-texts-en.d.ts +18 -0
- package/dist/types/engine/form-engine/builder/pdf-designer/layout-bindings.d.ts +13 -0
- package/dist/types/engine/form-engine/builder/pdf-designer/layout-catalog.d.ts +108 -0
- package/dist/types/engine/form-engine/builder/pdf-designer/layout-conditions.d.ts +172 -0
- package/dist/types/engine/form-engine/builder/pdf-designer/pdf-builder-mode.d.ts +406 -0
- package/dist/types/engine/form-engine/builder/pdf-designer/pdf-canvas-adapters.d.ts +55 -0
- package/dist/types/engine/form-engine/builder/pdf-designer/pdf-designer-chunk.d.ts +13 -0
- package/dist/types/engine/form-engine/builder/pdf-designer/pdf-designer-loader.d.ts +10 -0
- package/dist/types/engine/form-engine/builder/pdf-designer/pdf-designer-panels.d.ts +89 -0
- package/dist/types/engine/form-engine/builder/pdf-designer/pdf-designer.d.ts +95 -0
- package/dist/types/engine/form-engine/builder/pdf-designer/pdf-layout-texts.d.ts +86 -0
- package/dist/types/engine/form-engine/builder/pdf-designer/pdf-mode-loader.d.ts +17 -0
- package/dist/types/engine/form-engine/builder/pdf-designer/pdf-mode-model.d.ts +88 -0
- package/dist/types/engine/form-engine/builder/pdf-designer/pdf-panel-styles.d.ts +1 -0
- package/dist/types/engine/form-engine/builder/pdf-designer/pdf-template-designer.d.ts +139 -0
- package/dist/types/engine/form-engine/builder/pdf-designer/pdf-template-source.d.ts +22 -0
- package/dist/types/engine/form-engine/builder/pdf-designer/pdf-texts-en.d.ts +405 -0
- package/dist/types/engine/form-engine/builder/pdf-designer/template-mode.d.ts +186 -0
- package/dist/types/engine/form-engine/builder/pdf-designer/template-pages.d.ts +57 -0
- package/dist/types/engine/form-engine/builder/popover-place.d.ts +14 -0
- package/dist/types/engine/form-engine/builder/preview/builder-preview-runtime.d.ts +284 -0
- package/dist/types/engine/form-engine/builder/print/print-breaks.d.ts +46 -0
- package/dist/types/engine/form-engine/builder/print/print-loader.d.ts +6 -0
- package/dist/types/engine/form-engine/builder/print/print-preview.d.ts +121 -0
- package/dist/types/engine/form-engine/builder/print/print-samples.d.ts +43 -0
- package/dist/types/engine/form-engine/builder/print/print-settings-model.d.ts +138 -0
- package/dist/types/engine/form-engine/builder/print/print-styles.d.ts +1 -0
- package/dist/types/engine/form-engine/builder/print/print-surface.d.ts +284 -0
- package/dist/types/engine/form-engine/builder/print/print-texts-en.d.ts +104 -0
- package/dist/types/engine/form-engine/builder/property-editor/component-editor-context.d.ts +8 -0
- package/dist/types/engine/form-engine/builder/property-editor/component-json.d.ts +83 -0
- package/dist/types/engine/form-engine/builder/property-editor/condition-words.d.ts +26 -0
- package/dist/types/engine/form-engine/builder/property-editor/css-classes.d.ts +84 -0
- package/dist/types/engine/form-engine/builder/property-editor/editor-composer.d.ts +9 -0
- package/dist/types/engine/form-engine/builder/property-editor/inspector-model.d.ts +376 -0
- package/dist/types/engine/form-engine/builder/property-editor/rule-source.d.ts +8 -0
- package/dist/types/engine/form-engine/builder/property-editor/rules-model.d.ts +179 -0
- package/dist/types/engine/form-engine/builder/tree-editor/nested-tree-view.d.ts +43 -0
- package/dist/types/engine/form-engine/builder/tree-editor/slot-constraints.d.ts +17 -0
- package/dist/types/engine/form-engine/builder/tree-editor/tree-editor.d.ts +185 -0
- package/dist/types/engine/form-engine/builder/web-component/assistants-settings.d.ts +43 -0
- package/dist/types/engine/form-engine/builder/web-component/builder-chrome-panel.d.ts +179 -0
- package/dist/types/engine/form-engine/builder/web-component/builder-features.d.ts +97 -0
- package/dist/types/engine/form-engine/builder/web-component/builder-form-fields-panel.d.ts +42 -0
- package/dist/types/engine/form-engine/builder/web-component/builder-modes.d.ts +704 -0
- package/dist/types/engine/form-engine/builder/web-component/builder-outline.d.ts +24 -0
- package/dist/types/engine/form-engine/builder/web-component/builder-panels.d.ts +1872 -0
- package/dist/types/engine/form-engine/builder/web-component/builder-shared.d.ts +917 -0
- package/dist/types/engine/form-engine/builder/web-component/builder-tests-panel.d.ts +454 -0
- package/dist/types/engine/form-engine/builder/web-component/builder-theme-registry.d.ts +36 -0
- package/dist/types/engine/form-engine/builder/web-component/builder-variables-panel.d.ts +158 -0
- package/dist/types/engine/form-engine/builder/web-component/canvas-hooks.d.ts +53 -0
- package/dist/types/engine/form-engine/builder/web-component/chrome-panel-loader.d.ts +17 -0
- package/dist/types/engine/form-engine/builder/web-component/default-builder-element.d.ts +2012 -0
- package/dist/types/engine/form-engine/builder/web-component/definition-size.d.ts +12 -0
- package/dist/types/engine/form-engine/builder/web-component/dialog-frame.d.ts +36 -0
- package/dist/types/engine/form-engine/builder/web-component/formula-settings.d.ts +31 -0
- package/dist/types/engine/form-engine/builder/web-component/host-control-styles.d.ts +38 -0
- package/dist/types/engine/form-engine/builder/web-component/json-viewer-loader.d.ts +18 -0
- package/dist/types/engine/form-engine/builder/web-component/json-viewer.d.ts +38 -0
- package/dist/types/engine/form-engine/builder/web-component/modal-place.d.ts +55 -0
- package/dist/types/engine/form-engine/builder/web-component/palette-glyphs.d.ts +14 -0
- package/dist/types/engine/form-engine/builder/web-component/panel-memory.d.ts +68 -0
- package/dist/types/engine/form-engine/builder/web-component/phone-menu.d.ts +67 -0
- package/dist/types/engine/form-engine/builder/web-component/phone-styles.d.ts +30 -0
- package/dist/types/engine/form-engine/builder/web-component/remote-images.d.ts +25 -0
- package/dist/types/engine/form-engine/builder/web-component/sheet-gestures.d.ts +59 -0
- package/dist/types/engine/form-engine/builder/web-component/starter-submit.d.ts +14 -0
- package/dist/types/engine/form-engine/builder/web-component/studio-dark-theme.d.ts +22 -0
- package/dist/types/engine/form-engine/builder/web-component/studio-tokens.d.ts +46 -0
- package/dist/types/engine/form-engine/builder/web-component/surface-sheet.d.ts +31 -0
- package/dist/types/engine/form-engine/builder/web-component/tests-panel-loader.d.ts +17 -0
- package/dist/types/engine/form-engine/builder/web-component/toolbar-roving.d.ts +21 -0
- package/dist/types/engine/form-engine/builder/web-component/try-it-types.d.ts +262 -0
- package/dist/types/engine/form-engine/builder/web-component/try-it.d.ts +85 -0
- package/dist/types/engine/form-engine/builder/web-component/try-texts-en.d.ts +64 -0
- package/dist/types/engine/form-engine/builder/web-component/variables-panel-loader.d.ts +17 -0
- package/dist/types/engine/form-engine/core/accessibility/accessibility-semantics.d.ts +51 -0
- package/dist/types/engine/form-engine/core/accessibility/keyboard-navigation.d.ts +8 -0
- package/dist/types/engine/form-engine/core/crypto/sha256.d.ts +18 -0
- package/dist/types/engine/form-engine/core/errors/error-navigation.d.ts +14 -0
- package/dist/types/engine/form-engine/core/errors/form-error.d.ts +32 -0
- package/dist/types/engine/form-engine/core/events/event-bus.d.ts +18 -0
- package/dist/types/engine/form-engine/core/events/event-types.d.ts +236 -0
- package/dist/types/engine/form-engine/core/events/hooks.d.ts +107 -0
- package/dist/types/engine/form-engine/core/expressions/compile.d.ts +565 -0
- package/dist/types/engine/form-engine/core/expressions/condition-shape.d.ts +11 -0
- package/dist/types/engine/form-engine/core/expressions/definition-structure.d.ts +329 -0
- package/dist/types/engine/form-engine/core/expressions/expression.d.ts +102 -0
- package/dist/types/engine/form-engine/core/expressions/formula-types.d.ts +114 -0
- package/dist/types/engine/form-engine/core/expressions/formula.d.ts +150 -0
- package/dist/types/engine/form-engine/core/expressions/function-docs.d.ts +13 -0
- package/dist/types/engine/form-engine/core/expressions/function-table.d.ts +396 -0
- package/dist/types/engine/form-engine/core/expressions/inspect.d.ts +292 -0
- package/dist/types/engine/form-engine/core/form-tests/form-test-lint.d.ts +28 -0
- package/dist/types/engine/form-engine/core/form-tests/form-test-parse.d.ts +200 -0
- package/dist/types/engine/form-engine/core/form-tests/form-test-read.d.ts +11 -0
- package/dist/types/engine/form-engine/core/form-tests/form-test-run.d.ts +58 -0
- package/dist/types/engine/form-engine/core/form-tests/form-test-types.d.ts +413 -0
- package/dist/types/engine/form-engine/core/form-tests/index.d.ts +7 -0
- package/dist/types/engine/form-engine/core/index.d.ts +75 -0
- package/dist/types/engine/form-engine/core/journey/journey-diagnostics.d.ts +249 -0
- package/dist/types/engine/form-engine/core/journey/journey-flow.d.ts +77 -0
- package/dist/types/engine/form-engine/core/journey/journey-path.d.ts +213 -0
- package/dist/types/engine/form-engine/core/journey/journey-server-check.d.ts +66 -0
- package/dist/types/engine/form-engine/core/journey/journey-shared.d.ts +39 -0
- package/dist/types/engine/form-engine/core/journey/journey-types.d.ts +246 -0
- package/dist/types/engine/form-engine/core/journey/presentation.d.ts +163 -0
- package/dist/types/engine/form-engine/core/journey/worked-out-text.d.ts +10 -0
- package/dist/types/engine/form-engine/core/localization/form-texts.d.ts +283 -0
- package/dist/types/engine/form-engine/core/localization/locale-documents.d.ts +74 -0
- package/dist/types/engine/form-engine/core/localization/localized-text.d.ts +21 -0
- package/dist/types/engine/form-engine/core/localization/supported-locales.d.ts +49 -0
- package/dist/types/engine/form-engine/core/localization/translations.d.ts +312 -0
- package/dist/types/engine/form-engine/core/localization/validation-messages.d.ts +120 -0
- package/dist/types/engine/form-engine/core/schema/agent-tools-setting.d.ts +5 -0
- package/dist/types/engine/form-engine/core/schema/answer-kinds.d.ts +92 -0
- package/dist/types/engine/form-engine/core/schema/button-group.d.ts +24 -0
- package/dist/types/engine/form-engine/core/schema/button.d.ts +75 -0
- package/dist/types/engine/form-engine/core/schema/collection.d.ts +29 -0
- package/dist/types/engine/form-engine/core/schema/component-classes.d.ts +26 -0
- package/dist/types/engine/form-engine/core/schema/component-kinds.d.ts +76 -0
- package/dist/types/engine/form-engine/core/schema/contracts.d.ts +614 -0
- package/dist/types/engine/form-engine/core/schema/control-hints.d.ts +45 -0
- package/dist/types/engine/form-engine/core/schema/data-grid.d.ts +138 -0
- package/dist/types/engine/form-engine/core/schema/data-source-capability.d.ts +20 -0
- package/dist/types/engine/form-engine/core/schema/file-upload.d.ts +114 -0
- package/dist/types/engine/form-engine/core/schema/form-chrome.d.ts +301 -0
- package/dist/types/engine/form-engine/core/schema/grid.d.ts +88 -0
- package/dist/types/engine/form-engine/core/schema/image.d.ts +19 -0
- package/dist/types/engine/form-engine/core/schema/inline-options.d.ts +69 -0
- package/dist/types/engine/form-engine/core/schema/journey.d.ts +336 -0
- package/dist/types/engine/form-engine/core/schema/legend-mark.d.ts +10 -0
- package/dist/types/engine/form-engine/core/schema/length-limits.d.ts +33 -0
- package/dist/types/engine/form-engine/core/schema/pattern-validity.d.ts +2 -0
- package/dist/types/engine/form-engine/core/schema/pdf-layout-read.d.ts +508 -0
- package/dist/types/engine/form-engine/core/schema/pdf-layout-table.d.ts +25 -0
- package/dist/types/engine/form-engine/core/schema/pdf-layout.d.ts +224 -0
- package/dist/types/engine/form-engine/core/schema/pdf-renditions.d.ts +46 -0
- package/dist/types/engine/form-engine/core/schema/pdf-signature-configuration.d.ts +6 -0
- package/dist/types/engine/form-engine/core/schema/print.d.ts +76 -0
- package/dist/types/engine/form-engine/core/schema/signature.d.ts +13 -0
- package/dist/types/engine/form-engine/core/schema/static-html.d.ts +44 -0
- package/dist/types/engine/form-engine/core/schema/steps.d.ts +28 -0
- package/dist/types/engine/form-engine/core/schema/types.d.ts +186 -0
- package/dist/types/engine/form-engine/core/schema/validate-on-setting.d.ts +16 -0
- package/dist/types/engine/form-engine/core/state/answer-shape.d.ts +28 -0
- package/dist/types/engine/form-engine/core/state/effective-state.d.ts +42 -0
- package/dist/types/engine/form-engine/core/state/form-state.d.ts +160 -0
- package/dist/types/engine/form-engine/core/state/hidden-value-policy.d.ts +34 -0
- package/dist/types/engine/form-engine/core/state/host-context.d.ts +24 -0
- package/dist/types/engine/form-engine/core/state/semantic-state.d.ts +19 -0
- package/dist/types/engine/form-engine/core/state/submittable-fold.d.ts +460 -0
- package/dist/types/engine/form-engine/core/submission/canonical-submission.d.ts +62 -0
- package/dist/types/engine/form-engine/core/submission/envelope-completeness.d.ts +20 -0
- package/dist/types/engine/form-engine/core/submission/form-notice.d.ts +43 -0
- package/dist/types/engine/form-engine/core/submission/jcs.d.ts +20 -0
- package/dist/types/engine/form-engine/core/submission/signing.d.ts +110 -0
- package/dist/types/engine/form-engine/core/submission/submission-file.d.ts +34 -0
- package/dist/types/engine/form-engine/core/submission/submission-handler.d.ts +25 -0
- package/dist/types/engine/form-engine/core/submission/submission-modes.d.ts +11 -0
- package/dist/types/engine/form-engine/core/submission/webauthn-assertion.d.ts +41 -0
- package/dist/types/engine/form-engine/core/text/placeholders.d.ts +20 -0
- package/dist/types/engine/form-engine/core/text/spreadsheet-cell.d.ts +14 -0
- package/dist/types/engine/form-engine/core/tree/component-id.d.ts +14 -0
- package/dist/types/engine/form-engine/core/tree/component-path.d.ts +6 -0
- package/dist/types/engine/form-engine/core/tree/component-tree.d.ts +60 -0
- package/dist/types/engine/form-engine/core/tree/data-scope.d.ts +151 -0
- package/dist/types/engine/form-engine/core/tree/nesting.d.ts +10 -0
- package/dist/types/engine/form-engine/core/tree/prototype-names.d.ts +6 -0
- package/dist/types/engine/form-engine/data/client/client-data-source-runtime.d.ts +7 -0
- package/dist/types/engine/form-engine/data/client/registered-client-data-source-runtime.d.ts +6 -0
- package/dist/types/engine/form-engine/data/host/data-source-set.d.ts +46 -0
- package/dist/types/engine/form-engine/data/index.d.ts +9 -0
- package/dist/types/engine/form-engine/data/providers/data-source-provider-registry.d.ts +11 -0
- package/dist/types/engine/form-engine/data/providers/registered-data-source-runtime.d.ts +10 -0
- package/dist/types/engine/form-engine/data/providers/remote-data-source-provider.d.ts +30 -0
- package/dist/types/engine/form-engine/data/providers/static-data-source-provider.d.ts +20 -0
- package/dist/types/engine/form-engine/data/server/registered-server-data-source-runtime.d.ts +6 -0
- package/dist/types/engine/form-engine/data/server/server-data-source-runtime.d.ts +7 -0
- package/dist/types/engine/form-engine/index.d.ts +29 -0
- package/dist/types/engine/form-engine/persistence/core/draft-compatibility.d.ts +22 -0
- package/dist/types/engine/form-engine/persistence/core/draft-store.d.ts +96 -0
- package/dist/types/engine/form-engine/persistence/file-draft/draft-file.d.ts +3 -0
- package/dist/types/engine/form-engine/persistence/index.d.ts +7 -0
- package/dist/types/engine/form-engine/persistence/indexeddb/indexeddb-draft-store.d.ts +15 -0
- package/dist/types/engine/form-engine/persistence/local-storage/browser-local-draft-store.d.ts +22 -0
- package/dist/types/engine/form-engine/persistence/local-storage/in-memory-draft-store.d.ts +8 -0
- package/dist/types/engine/form-engine/persistence/server/server-draft-store.d.ts +15 -0
- package/dist/types/engine/form-engine/plugins/component-adapters.d.ts +66 -0
- package/dist/types/engine/form-engine/plugins/index.d.ts +4 -0
- package/dist/types/engine/form-engine/plugins/lifecycle/plugin-lifecycle.d.ts +11 -0
- package/dist/types/engine/form-engine/plugins/manifest/load-plugin-manifest.d.ts +23 -0
- package/dist/types/engine/form-engine/plugins/platform/plugin-platform.d.ts +81 -0
- package/dist/types/engine/form-engine/registry/capabilities/drawing-capabilities.d.ts +52 -0
- package/dist/types/engine/form-engine/registry/capabilities/field-capabilities.d.ts +205 -0
- package/dist/types/engine/form-engine/registry/components/component-registry.d.ts +9 -0
- package/dist/types/engine/form-engine/registry/data-sources/data-source-registry.d.ts +9 -0
- package/dist/types/engine/form-engine/registry/engine-component-types.d.ts +20 -0
- package/dist/types/engine/form-engine/registry/engine-version.d.ts +5 -0
- package/dist/types/engine/form-engine/registry/formula-functions/formula-function-registry.d.ts +33 -0
- package/dist/types/engine/form-engine/registry/index.d.ts +13 -0
- package/dist/types/engine/form-engine/registry/kinds.d.ts +83 -0
- package/dist/types/engine/form-engine/registry/pdf/pdf-rendition-registry.d.ts +15 -0
- package/dist/types/engine/form-engine/registry/plugins/plugin-registry.d.ts +14 -0
- package/dist/types/engine/form-engine/registry/submission/submission-handler-registry.d.ts +7 -0
- package/dist/types/engine/form-engine/registry/validators/validator-registry.d.ts +6 -0
- package/dist/types/engine/form-engine/registry/version-range.d.ts +15 -0
- package/dist/types/engine/form-engine/registry/versioned-theme-registry.d.ts +30 -0
- package/dist/types/engine/form-engine/registry/versioning.d.ts +5 -0
- package/dist/types/engine/form-engine/render/core/component-model.d.ts +292 -0
- package/dist/types/engine/form-engine/render/core/component-options.d.ts +58 -0
- package/dist/types/engine/form-engine/render/core/css-rules.d.ts +68 -0
- package/dist/types/engine/form-engine/render/core/error-accessibility.d.ts +23 -0
- package/dist/types/engine/form-engine/render/core/error-summary.d.ts +62 -0
- package/dist/types/engine/form-engine/render/core/error-wording.d.ts +104 -0
- package/dist/types/engine/form-engine/render/core/escape-html.d.ts +2 -0
- package/dist/types/engine/form-engine/render/core/file-storage.d.ts +59 -0
- package/dist/types/engine/form-engine/render/core/host-data-sources.d.ts +44 -0
- package/dist/types/engine/form-engine/render/core/journey-render-kit-default.d.ts +5 -0
- package/dist/types/engine/form-engine/render/core/journey-render-kit-eager.d.ts +10 -0
- package/dist/types/engine/form-engine/render/core/journey-render-kit-factory.d.ts +13 -0
- package/dist/types/engine/form-engine/render/core/journey-render-kit.d.ts +61 -0
- package/dist/types/engine/form-engine/render/core/journey-render.d.ts +132 -0
- package/dist/types/engine/form-engine/render/core/journey-review-kit-eager.d.ts +9 -0
- package/dist/types/engine/form-engine/render/core/journey-review-kit.d.ts +33 -0
- package/dist/types/engine/form-engine/render/core/journey-review.d.ts +134 -0
- package/dist/types/engine/form-engine/render/core/presentation-tree.d.ts +374 -0
- package/dist/types/engine/form-engine/render/core/print-options.d.ts +89 -0
- package/dist/types/engine/form-engine/render/core/render-contracts.d.ts +7 -0
- package/dist/types/engine/form-engine/render/core/render-orchestrator.d.ts +139 -0
- package/dist/types/engine/form-engine/render/core/render-policy.d.ts +52 -0
- package/dist/types/engine/form-engine/render/core/runtime-render-bridge.d.ts +154 -0
- package/dist/types/engine/form-engine/render/core/scalar-text.d.ts +10 -0
- package/dist/types/engine/form-engine/render/core/tab-slots.d.ts +25 -0
- package/dist/types/engine/form-engine/render/core/token-style-vars.d.ts +45 -0
- package/dist/types/engine/form-engine/render/icons/builtin-icons.d.ts +24 -0
- package/dist/types/engine/form-engine/render/icons/icon-names.d.ts +67 -0
- package/dist/types/engine/form-engine/render/icons/icon-set.d.ts +102 -0
- package/dist/types/engine/form-engine/render/index.d.ts +68 -0
- package/dist/types/engine/form-engine/render/live/announcer.d.ts +10 -0
- package/dist/types/engine/form-engine/render/live/assets-feature.d.ts +12 -0
- package/dist/types/engine/form-engine/render/live/assets-policy.d.ts +6 -0
- package/dist/types/engine/form-engine/render/live/assets.d.ts +109 -0
- package/dist/types/engine/form-engine/render/live/binding-registry.d.ts +46 -0
- package/dist/types/engine/form-engine/render/live/buttons.d.ts +12 -0
- package/dist/types/engine/form-engine/render/live/chrome.d.ts +15 -0
- package/dist/types/engine/form-engine/render/live/component-text.d.ts +10 -0
- package/dist/types/engine/form-engine/render/live/contract.d.ts +1267 -0
- package/dist/types/engine/form-engine/render/live/data-grid.d.ts +51 -0
- package/dist/types/engine/form-engine/render/live/datum/buttons.d.ts +44 -0
- package/dist/types/engine/form-engine/render/live/datum/choice-fields.d.ts +8 -0
- package/dist/types/engine/form-engine/render/live/datum/chrome-files.d.ts +43 -0
- package/dist/types/engine/form-engine/render/live/datum/chrome.d.ts +49 -0
- package/dist/types/engine/form-engine/render/live/datum/container-kit.d.ts +66 -0
- package/dist/types/engine/form-engine/render/live/datum/containers.d.ts +25 -0
- package/dist/types/engine/form-engine/render/live/datum/content.d.ts +5 -0
- package/dist/types/engine/form-engine/render/live/datum/css.d.ts +40 -0
- package/dist/types/engine/form-engine/render/live/datum/date.d.ts +66 -0
- package/dist/types/engine/form-engine/render/live/datum/default-tokens.d.ts +30 -0
- package/dist/types/engine/form-engine/render/live/datum/field-scaffold.d.ts +131 -0
- package/dist/types/engine/form-engine/render/live/datum/file.d.ts +6 -0
- package/dist/types/engine/form-engine/render/live/datum/frames.d.ts +33 -0
- package/dist/types/engine/form-engine/render/live/datum/grid.d.ts +26 -0
- package/dist/types/engine/form-engine/render/live/datum/groups.d.ts +45 -0
- package/dist/types/engine/form-engine/render/live/datum/icons.d.ts +18 -0
- package/dist/types/engine/form-engine/render/live/datum/leaf-kit.d.ts +17 -0
- package/dist/types/engine/form-engine/render/live/datum/month-names.d.ts +2 -0
- package/dist/types/engine/form-engine/render/live/datum/notice.d.ts +25 -0
- package/dist/types/engine/form-engine/render/live/datum/options.d.ts +133 -0
- package/dist/types/engine/form-engine/render/live/datum/page.d.ts +13 -0
- package/dist/types/engine/form-engine/render/live/datum/parts.d.ts +120 -0
- package/dist/types/engine/form-engine/render/live/datum/signature.d.ts +25 -0
- package/dist/types/engine/form-engine/render/live/datum/steps.d.ts +30 -0
- package/dist/types/engine/form-engine/render/live/datum/summary.d.ts +26 -0
- package/dist/types/engine/form-engine/render/live/datum/tabs.d.ts +23 -0
- package/dist/types/engine/form-engine/render/live/datum/text-fields.d.ts +7 -0
- package/dist/types/engine/form-engine/render/live/datum/tokens.d.ts +1030 -0
- package/dist/types/engine/form-engine/render/live/error-target.d.ts +12 -0
- package/dist/types/engine/form-engine/render/live/field-preview.d.ts +22 -0
- package/dist/types/engine/form-engine/render/live/fields.d.ts +26 -0
- package/dist/types/engine/form-engine/render/live/files.d.ts +20 -0
- package/dist/types/engine/form-engine/render/live/form-notices.d.ts +17 -0
- package/dist/types/engine/form-engine/render/live/guards.d.ts +37 -0
- package/dist/types/engine/form-engine/render/live/journey-page.d.ts +45 -0
- package/dist/types/engine/form-engine/render/live/journey-review.d.ts +50 -0
- package/dist/types/engine/form-engine/render/live/lit.d.ts +48 -0
- package/dist/types/engine/form-engine/render/live/look-classes.d.ts +27 -0
- package/dist/types/engine/form-engine/render/live/media-labels.d.ts +16 -0
- package/dist/types/engine/form-engine/render/live/mount.d.ts +450 -0
- package/dist/types/engine/form-engine/render/live/notices.d.ts +3 -0
- package/dist/types/engine/form-engine/render/live/readonly-sizing.d.ts +14 -0
- package/dist/types/engine/form-engine/render/live/renderer.d.ts +12 -0
- package/dist/types/engine/form-engine/render/live/sources.d.ts +4 -0
- package/dist/types/engine/form-engine/render/live/steps.d.ts +6 -0
- package/dist/types/engine/form-engine/render/live/summary.d.ts +33 -0
- package/dist/types/engine/form-engine/render/live/tabs.d.ts +8 -0
- package/dist/types/engine/form-engine/render/live/tooltips.d.ts +30 -0
- package/dist/types/engine/form-engine/render/pdf/default-layout.d.ts +51 -0
- package/dist/types/engine/form-engine/render/pdf/pdf-abi.d.ts +819 -0
- package/dist/types/engine/form-engine/render/pdf/pdf-agent-signer.d.ts +92 -0
- package/dist/types/engine/form-engine/render/pdf/pdf-attachments.d.ts +76 -0
- package/dist/types/engine/form-engine/render/pdf/pdf-components.d.ts +282 -0
- package/dist/types/engine/form-engine/render/pdf/pdf-designer-styles.d.ts +12 -0
- package/dist/types/engine/form-engine/render/pdf/pdf-document.d.ts +412 -0
- package/dist/types/engine/form-engine/render/pdf/pdf-layout-selection.d.ts +54 -0
- package/dist/types/engine/form-engine/render/pdf/pdf-pages.d.ts +25 -0
- package/dist/types/engine/form-engine/render/pdf/pdf-provider.d.ts +219 -0
- package/dist/types/engine/form-engine/render/pdf/pdf-render-mode.d.ts +2 -0
- package/dist/types/engine/form-engine/render/pdf/pdf-render-model.d.ts +124 -0
- package/dist/types/engine/form-engine/render/pdf/pdf-renditions.d.ts +160 -0
- package/dist/types/engine/form-engine/render/pdf/pdf-service.d.ts +161 -0
- package/dist/types/engine/form-engine/render/pdf/pdf-signer.d.ts +26 -0
- package/dist/types/engine/form-engine/render/pdf/pdf-template-components.d.ts +168 -0
- package/dist/types/engine/form-engine/render/pdf/pdf-template-constants.d.ts +14 -0
- package/dist/types/engine/form-engine/render/pdf/pdf-template.d.ts +84 -0
- package/dist/types/engine/form-engine/render/pdf/pdf-text-addresses.d.ts +20 -0
- package/dist/types/engine/form-engine/render/pdf/pdf-theme-defaults.d.ts +410 -0
- package/dist/types/engine/form-engine/render/pdf/pdf-theme-registry.d.ts +25 -0
- package/dist/types/engine/form-engine/render/pdf/pdf-theme.d.ts +91 -0
- package/dist/types/engine/form-engine/render/pdf/pdf-values.d.ts +47 -0
- package/dist/types/engine/form-engine/render/pdf/standard-renditions.d.ts +33 -0
- package/dist/types/engine/form-engine/render/pdf/template-text.d.ts +52 -0
- package/dist/types/engine/form-engine/render/print/answer-text.d.ts +3 -0
- package/dist/types/engine/form-engine/render/print/basic.d.ts +18 -0
- package/dist/types/engine/form-engine/render/print/datum.d.ts +2 -0
- package/dist/types/engine/form-engine/render/print/document.d.ts +65 -0
- package/dist/types/engine/form-engine/render/print/field-answer.d.ts +47 -0
- package/dist/types/engine/form-engine/render/print/index.d.ts +12 -0
- package/dist/types/engine/form-engine/render/print/model.d.ts +346 -0
- package/dist/types/engine/form-engine/render/print/safe-html.d.ts +41 -0
- package/dist/types/engine/form-engine/render/print/slot-text.d.ts +30 -0
- package/dist/types/engine/form-engine/render/print/theme.d.ts +86 -0
- package/dist/types/engine/form-engine/render/react/interactive-renderer.d.ts +9 -0
- package/dist/types/engine/form-engine/render/readonly/readonly-renderer.d.ts +12 -0
- package/dist/types/engine/form-engine/render/web-component/custom-element-base.d.ts +3 -0
- package/dist/types/engine/form-engine/render/web-component/form-features.d.ts +76 -0
- package/dist/types/engine/form-engine/render/web-component/form-host-element.d.ts +310 -0
- package/dist/types/engine/form-engine/render/web-component/form-renderer-element.d.ts +846 -0
- package/dist/types/engine/form-engine/render/web-component/locale-select-element.d.ts +24 -0
- package/dist/types/engine/form-engine/render/web-component/pdf-download.d.ts +75 -0
- package/dist/types/engine/form-engine/render/web-component/print-frame.d.ts +85 -0
- package/dist/types/engine/form-engine/render/web-component/print-pipeline.d.ts +11 -0
- package/dist/types/engine/form-engine/render/web-component/print-policy.d.ts +2 -0
- package/dist/types/engine/form-engine/render/web-component/submission-download.d.ts +47 -0
- package/dist/types/engine/form-engine/render/web-component/typed-answers.d.ts +26 -0
- package/dist/types/engine/form-engine/render/webauthn/assertion.d.ts +69 -0
- package/dist/types/engine/form-engine/render/webauthn/authenticator-data.d.ts +21 -0
- package/dist/types/engine/form-engine/render/webauthn/errors.d.ts +30 -0
- package/dist/types/engine/form-engine/render/webauthn/registration-verify.d.ts +44 -0
- package/dist/types/engine/form-engine/render/webauthn/registration.d.ts +77 -0
- package/dist/types/engine/form-engine/render/webauthn/signal.d.ts +27 -0
- package/dist/types/engine/form-engine/render/webauthn/signing-provider.d.ts +70 -0
- package/dist/types/engine/form-engine/rules/dependencies/calculation-cycle.d.ts +25 -0
- package/dist/types/engine/form-engine/rules/dependencies/dependency-extractor.d.ts +9 -0
- package/dist/types/engine/form-engine/rules/dependencies/dependency-graph.d.ts +26 -0
- package/dist/types/engine/form-engine/rules/evaluator/evaluator.d.ts +209 -0
- package/dist/types/engine/form-engine/rules/evaluator/functions-date.d.ts +26 -0
- package/dist/types/engine/form-engine/rules/evaluator/functions-list.d.ts +28 -0
- package/dist/types/engine/form-engine/rules/evaluator/functions-number.d.ts +6 -0
- package/dist/types/engine/form-engine/rules/evaluator/functions-text.d.ts +23 -0
- package/dist/types/engine/form-engine/runtime/browser/collection-runtime.d.ts +34 -0
- package/dist/types/engine/form-engine/runtime/browser/draft-read.d.ts +27 -0
- package/dist/types/engine/form-engine/runtime/browser/form-runtime.d.ts +1470 -0
- package/dist/types/engine/form-engine/runtime/browser/form-test-runtime-driver.d.ts +83 -0
- package/dist/types/engine/form-engine/runtime/browser/journey/journey-action.d.ts +42 -0
- package/dist/types/engine/form-engine/runtime/browser/journey/journey-navigation.d.ts +200 -0
- package/dist/types/engine/form-engine/runtime/browser/journey/journey-presentation-overlay.d.ts +69 -0
- package/dist/types/engine/form-engine/runtime/browser/journey/journey-server-checks.d.ts +89 -0
- package/dist/types/engine/form-engine/runtime/browser/journey-engine-eager.d.ts +11 -0
- package/dist/types/engine/form-engine/runtime/browser/journey-engine.d.ts +462 -0
- package/dist/types/engine/form-engine/runtime/browser/path-validation-runs.d.ts +91 -0
- package/dist/types/engine/form-engine/runtime/browser/runtime-orchestrator.d.ts +530 -0
- package/dist/types/engine/form-engine/runtime/browser/submission-key.d.ts +12 -0
- package/dist/types/engine/form-engine/runtime/index.d.ts +8 -0
- package/dist/types/engine/form-engine/validation/core/error-store.d.ts +70 -0
- package/dist/types/engine/form-engine/validation/core/field-constraints.d.ts +293 -0
- package/dist/types/engine/form-engine/validation/core/test-vectors.d.ts +20 -0
- package/dist/types/engine/form-engine/validation/core/validation-pipeline.d.ts +65 -0
- package/dist/types/engine/form-engine/validation/parity/browser-adapter.d.ts +4 -0
- package/dist/types/engine/form-engine/validation/parity/formula-function-parity.d.ts +27 -0
- package/dist/types/engine/form-engine/validation/parity/index.d.ts +7 -0
- package/dist/types/engine/form-engine/validation/parity/parity-runner.d.ts +21 -0
- package/dist/types/engine/form-engine/validation/parity/runtime-adapter.d.ts +9 -0
- package/dist/types/engine/form-engine/validation/parity/server-adapter.d.ts +7 -0
- package/dist/types/engine/form-engine/validation/parity/vectors.d.ts +28 -0
- package/dist/types/engine/form-engine/validation/parity/wasm-adapter.d.ts +9 -0
- package/dist/types/engine/form-engine/validation/server/server-validation.d.ts +49 -0
- package/dist/types/engine/form-engine/validation/wasm/form-test-kernel-driver.d.ts +95 -0
- package/dist/types/engine/form-engine/validation/wasm/in-process-host.d.ts +56 -0
- package/dist/types/engine/form-engine/validation/wasm/portable-kernel.d.ts +1926 -0
- package/dist/types/engine/form-engine/validation/wasm/portable-options.d.ts +282 -0
- package/dist/types/engine/form-engine/validation/wasm/wasm-validation-host.d.ts +429 -0
- package/dist/types/engine/form-engine/verification/gate-inputs.d.ts +26 -0
- package/dist/types/engine/form-engine/verification/release-gates.d.ts +32 -0
- package/dist/types/engine/form-engine/verification/telemetry-bridge.d.ts +15 -0
- package/dist/types/engine/form-engine/verification/telemetry-sinks.d.ts +13 -0
- package/dist/types/engine/form-engine/verification/telemetry.d.ts +29 -0
- package/dist/types/packages/form-test/src/api.d.ts +75 -0
- package/dist/types/packages/form-test/src/args.d.ts +27 -0
- package/dist/types/packages/form-test/src/cli.d.ts +10 -0
- package/dist/types/packages/form-test/src/coverage.d.ts +11 -0
- package/dist/types/packages/form-test/src/drivers.d.ts +23 -0
- package/dist/types/packages/form-test/src/exit-codes.d.ts +17 -0
- package/dist/types/packages/form-test/src/index.d.ts +28 -0
- package/dist/types/packages/form-test/src/load.d.ts +25 -0
- package/dist/types/packages/form-test/src/parity.d.ts +14 -0
- package/dist/types/packages/form-test/src/report/json.d.ts +7 -0
- package/dist/types/packages/form-test/src/report/junit.d.ts +14 -0
- package/dist/types/packages/form-test/src/report/markdown.d.ts +14 -0
- package/dist/types/packages/form-test/src/report/model.d.ts +137 -0
- package/dist/types/packages/form-test/src/report/schema.d.ts +449 -0
- package/dist/types/packages/form-test/src/report/words.d.ts +48 -0
- package/dist/types/packages/form-test/src/run.d.ts +15 -0
- package/dist/types/packages/form-test/src/version.d.ts +3 -0
- package/dist/types/packages/form-test/src/vitest.d.ts +43 -0
- package/dist/types/packages/quickjs-wasm-host/src/fresh-sandbox-host.d.ts +70 -0
- package/dist/types/packages/quickjs-wasm-host/src/heap-recycle.d.ts +44 -0
- package/dist/types/packages/quickjs-wasm-host/src/index.d.ts +4 -0
- package/dist/types/packages/quickjs-wasm-host/src/program-host.d.ts +179 -0
- package/dist/types/packages/quickjs-wasm-host/src/quickjs-wasm-host-adapter.d.ts +218 -0
- package/dist/types/packages/quickjs-wasm-host/src/sandbox-program.d.ts +108 -0
- package/dist/vitest.mjs +189 -0
- package/fixtures/clock.json +35 -0
- package/fixtures/failing.datum-test +2 -0
- package/fixtures/main.datum-test +17 -0
- package/fixtures/main.json +435 -0
- package/package.json +93 -4
|
@@ -0,0 +1,2534 @@
|
|
|
1
|
+
import type { ComponentDefinition, ComponentPaletteEntry, PropertyEditorField } from "../../core/schema/contracts.js";
|
|
2
|
+
import type { ComponentNode, ComponentRules, LocalizationConfiguration, SlotDefinition } from "../../core/schema/types.js";
|
|
3
|
+
import type { FormTestConfiguration } from "../../core/form-tests/form-test-types.js";
|
|
4
|
+
import type { AdapterEntry, LiveAssets, LiveBinding } from "../../render/live/contract.js";
|
|
5
|
+
import { type ComponentAdapterContext, type ComponentDrawing } from "../../plugins/component-adapters.js";
|
|
6
|
+
import type { DataSourceResolver } from "../../render/core/component-options.js";
|
|
7
|
+
import type { DataSourceResult, DataSourceSet } from "../../core/schema/contracts.js";
|
|
8
|
+
import type { FormChromeConfiguration } from "../../core/schema/form-chrome.js";
|
|
9
|
+
import { type DataKeyProblem } from "../../core/tree/data-scope.js";
|
|
10
|
+
import type { TranslationCatalog } from "../../core/schema/contracts.js";
|
|
11
|
+
import { type LocaleOption } from "../../core/localization/supported-locales.js";
|
|
12
|
+
import { type DroppedTranslations, type FormTranslations, type TextAddress } from "../../core/localization/translations.js";
|
|
13
|
+
import { type OutsideDocument } from "../../core/localization/locale-documents.js";
|
|
14
|
+
import { type RenamedTextId } from "./translation-rules.js";
|
|
15
|
+
import { type BuilderDragPayload, type DataTransferLike } from "../drag-drop/html5-drag-drop.js";
|
|
16
|
+
import { type BuilderMutationEvent } from "../tree-editor/tree-editor.js";
|
|
17
|
+
import type { BuilderCommand } from "../history/command-history.js";
|
|
18
|
+
import { type ValuePathMove } from "../formula/rename.js";
|
|
19
|
+
import { type NestedTreeNodeLabeler, type NestedTreeNodeView } from "../tree-editor/nested-tree-view.js";
|
|
20
|
+
import type { JourneyView } from "../../core/journey/journey-types.js";
|
|
21
|
+
import { type HostValidationCode, type BuilderDrawingSource, type InspectorChoice, type InspectorDrawnBy, type InspectorModel } from "../property-editor/inspector-model.js";
|
|
22
|
+
import { type BuilderTextCatalog } from "../logic/builder-texts.js";
|
|
23
|
+
import { type TrySubmissionSettings, type TrySubmissionUpdate } from "./try-submission.js";
|
|
24
|
+
import { type Dependent } from "./dependents.js";
|
|
25
|
+
export { dependentLines, dependentsHeading, dependentsOf, withoutDependents } from "./dependents.js";
|
|
26
|
+
export type { Dependent, DependentsSource, JourneyDependent, PdfDependent, RuleDependent, WithoutDependents } from "./dependents.js";
|
|
27
|
+
import { type CssClassChoice } from "../property-editor/css-classes.js";
|
|
28
|
+
/**
|
|
29
|
+
* One translatable text of the form as {@link BuilderController.translatableTexts} lists it: a string in the form's default language and the address its translations live at.
|
|
30
|
+
* The builder still names the text by its `propertyPath` (`label`, `options.2.label`,
|
|
31
|
+
* `messages.required`, `chrome.header.0.text`) to read and write the default; `address`
|
|
32
|
+
* is the same text as the map keys it, by ids and values, never an index.
|
|
33
|
+
*/
|
|
34
|
+
export interface TranslatableText {
|
|
35
|
+
componentId: string;
|
|
36
|
+
/** The component's own label (the form's title on the root), resolved in the builder's locale. */
|
|
37
|
+
componentLabel: string;
|
|
38
|
+
propertyPath: string;
|
|
39
|
+
/** The inspector's name for the property ("Label", "Pattern message"). */
|
|
40
|
+
label: string;
|
|
41
|
+
/** The inspector section the property sits in, when it has one. */
|
|
42
|
+
section?: string;
|
|
43
|
+
/** The text in the form's default language: what every language without a translation shows. */
|
|
44
|
+
default: string;
|
|
45
|
+
address: TextAddress;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The language list's actions ({@link BuilderController.localizationActions}): each changes
|
|
49
|
+
* `localization` and the translations map together as one undo step.
|
|
50
|
+
*/
|
|
51
|
+
export interface LocalizationActions {
|
|
52
|
+
/** Adds a language; with no languages declared yet, `sourceLocale` declares the language the strings are written in first. */
|
|
53
|
+
addLocale(code: string, label?: string, options?: {
|
|
54
|
+
sourceLocale?: string;
|
|
55
|
+
}): boolean;
|
|
56
|
+
/** Removes a language and its translations; the default language can go when another is left (it is made the default first). */
|
|
57
|
+
removeLocale(code: string): boolean;
|
|
58
|
+
/** Renames a language code: its translations, its place as the default and the canvas's language follow. */
|
|
59
|
+
renameLocale(from: string, to: string): boolean;
|
|
60
|
+
/** Makes a language the one the strings are written in: its wording becomes the strings, the old strings its translations. */
|
|
61
|
+
makeDefaultLocale(code: string): boolean;
|
|
62
|
+
/** Names a language (blank: its own name stands in). */
|
|
63
|
+
relabelLocale(code: string, label: string): boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface BuilderComponentType {
|
|
66
|
+
type: string;
|
|
67
|
+
label: string;
|
|
68
|
+
/**
|
|
69
|
+
* Overrides the palette glyph for this type. One or two characters (an emoji, a symbol) —
|
|
70
|
+
* it is escaped, so it cannot carry markup. Omit and the palette picks a built-in icon for
|
|
71
|
+
* the type name, falling back to a generic one.
|
|
72
|
+
*/
|
|
73
|
+
icon?: string;
|
|
74
|
+
/**
|
|
75
|
+
* The palette group this type is listed under. Omit and the palette infers a natural one
|
|
76
|
+
* from the type name (Fields / Choices / Layout / Content / Actions, else Other); name one
|
|
77
|
+
* to gather a host's custom components under their own heading, which is what keeps a
|
|
78
|
+
* palette of dozens findable.
|
|
79
|
+
*/
|
|
80
|
+
group?: string;
|
|
81
|
+
/**
|
|
82
|
+
* The id of the design-system binding this type belongs to (`ComponentPaletteEntry.binding`):
|
|
83
|
+
* the palette and the add command offer it only while that binding draws the canvas
|
|
84
|
+
* ({@link BuilderController.offeredTypes}); a form that already holds one keeps it, labelled.
|
|
85
|
+
*/
|
|
86
|
+
binding?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Not listed in the palette or offered by the add command, yet still a type the builder takes
|
|
89
|
+
* (a drop, a paste, a panel's own add): the Journeys Step view hides its Page, Form field and
|
|
90
|
+
* Route entries while its Form fields panel still places a form field there.
|
|
91
|
+
*/
|
|
92
|
+
hidden?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* What the inspector's first tab calls a node of this type, where it is not a field: `"step"`
|
|
95
|
+
* (a journey's step) reads Step, in the builder's own words (`inspector.tab.step`). Absent:
|
|
96
|
+
* Field, and Settings on the root.
|
|
97
|
+
*/
|
|
98
|
+
inspectorTab?: "step";
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* One component type as the builder knows it ({@link BuilderController.typeInfo}): what a new
|
|
102
|
+
* one starts as, the slots it offers children, how the palette lists it and the inspector
|
|
103
|
+
* model a new one would be edited with. What the builder agent tools read to list
|
|
104
|
+
* the insertable types and to check a slot before an insert; nothing in the builder's own UI
|
|
105
|
+
* needs it.
|
|
106
|
+
*/
|
|
107
|
+
export interface BuilderTypeInfo {
|
|
108
|
+
type: string;
|
|
109
|
+
/** What a new node of the type starts as: the registered default, else the generic shape with the type as its id. */
|
|
110
|
+
template: ComponentNode;
|
|
111
|
+
/** The type's child slots, as its definition declares them; absent for a leaf or without a registry. */
|
|
112
|
+
slots: SlotDefinition[] | undefined;
|
|
113
|
+
/** The palette entry: the one the builder lists now, else the definition's own; absent when neither has one. */
|
|
114
|
+
palette: ComponentPaletteEntry | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* Always `false`: fixed is a fact about a node a PDF template listed
|
|
117
|
+
* ({@link BuilderController.isFixedNode}), never about a type the agent could insert.
|
|
118
|
+
*/
|
|
119
|
+
fixed: boolean;
|
|
120
|
+
/** The inspector model a new node of the type is edited with, composed as {@link BuilderController.inspectorModel} composes it. */
|
|
121
|
+
model: InspectorModel | undefined;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The palette entries a list of component definitions declares (`ComponentDefinition.palette`):
|
|
125
|
+
* one {@link BuilderComponentType} per definition that carries one, in the definitions'
|
|
126
|
+
* order. A definition without one is not the palette's to offer — the form root, a type the
|
|
127
|
+
* host lists itself through `componentTypes` — so it is skipped rather than given a made-up
|
|
128
|
+
* label. What a plugin's components (`FormPlugin.components`) contribute to the palette.
|
|
129
|
+
*/
|
|
130
|
+
export declare function paletteEntriesOf(definitions: readonly ComponentDefinition[]): BuilderComponentType[];
|
|
131
|
+
/**
|
|
132
|
+
* One entry of the canvas's locale switcher. The same shape the rendered switcher offers
|
|
133
|
+
* (`LocaleOption`): both are derived from the form's own `localization`.
|
|
134
|
+
*/
|
|
135
|
+
export type BuilderLocaleOption = LocaleOption;
|
|
136
|
+
/**
|
|
137
|
+
* One design-system binding the canvas can preview the form in (the binding picker's entry).
|
|
138
|
+
*
|
|
139
|
+
* The canvas previews through the real renderer, so the design system is part of what is being
|
|
140
|
+
* authored: "does this label still fit in the department's design system" is a question about the
|
|
141
|
+
* form, asked while designing it. `binding` is the object to draw with; left out, the id is looked
|
|
142
|
+
* up in the page's binding registry (`registerBinding`), and `"datum"` is Datum's own.
|
|
143
|
+
*/
|
|
144
|
+
export interface BuilderBindingOption {
|
|
145
|
+
id: string;
|
|
146
|
+
label: string;
|
|
147
|
+
binding?: LiveBinding | undefined;
|
|
148
|
+
/**
|
|
149
|
+
* The design system's files the canvas draws this entry with. Left out, the entry draws with
|
|
150
|
+
* none, unless it is the host's own binding, which draws with the host's `assets`: one design
|
|
151
|
+
* system's files never style another's form.
|
|
152
|
+
*/
|
|
153
|
+
assets?: LiveAssets | undefined;
|
|
154
|
+
}
|
|
155
|
+
/** One entry of the binding picker ({@link BuilderController.bindingChoices}). */
|
|
156
|
+
export interface BuilderBindingChoice {
|
|
157
|
+
/** The offered binding choosing this entry picks. */
|
|
158
|
+
id: string;
|
|
159
|
+
/** The name of the binding the canvas draws for it under the builder's scheme. */
|
|
160
|
+
label: string;
|
|
161
|
+
/** Whether the canvas draws with it now. */
|
|
162
|
+
selected: boolean;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* The definition's own name and versions — `FormDefinition.id`, `version` and
|
|
166
|
+
* `schemaVersion` — the fields that name a form in a submission envelope, a draft's
|
|
167
|
+
* compatibility check and a host's storage. Definition-level like `localization`: the Form
|
|
168
|
+
* panel edits them, and the host reads them back to persist beside the tree.
|
|
169
|
+
*/
|
|
170
|
+
export interface FormIdentity {
|
|
171
|
+
id: string;
|
|
172
|
+
version: string;
|
|
173
|
+
schemaVersion: string;
|
|
174
|
+
}
|
|
175
|
+
export interface BuilderControllerOptions {
|
|
176
|
+
componentTypes?: BuilderComponentType[];
|
|
177
|
+
initialRoot?: ComponentNode;
|
|
178
|
+
/** When supplied, the controller uses a registry-backed editor (slot constraints + composed inspector). */
|
|
179
|
+
componentDefinitions?: ComponentDefinition[];
|
|
180
|
+
/** The language the canvas and the inspector show the form in (a label resolves through the translations). Defaults to `"en"`. */
|
|
181
|
+
locale?: string;
|
|
182
|
+
/**
|
|
183
|
+
* The `FormDefinition.localization` of the form being edited. Like `initialRoot`, this is
|
|
184
|
+
* the *initial* value: the form-level properties panel edits it (supported locales and
|
|
185
|
+
* their labels, default locale), and the host reads the authored result back via
|
|
186
|
+
* {@link BuilderController.localization} to persist on the definition beside the tree.
|
|
187
|
+
* The canvas's locale switcher and the inspector's per-locale editors are derived from it;
|
|
188
|
+
* with no localization configured, neither is offered.
|
|
189
|
+
*/
|
|
190
|
+
localization?: LocalizationConfiguration | undefined;
|
|
191
|
+
/**
|
|
192
|
+
* The `FormDefinition.translations` of the form being edited: the *initial* value,
|
|
193
|
+
* like {@link localization}. Read through the tolerant reader, so a hand-edited file with an
|
|
194
|
+
* unsafe segment or a malformed leaf loads without them. The builder's rules (delete prunes,
|
|
195
|
+
* duplicate copies, renames move) and the Languages workspace edit it from here on, and the
|
|
196
|
+
* host reads the result back via {@link BuilderController.translations} to persist beside
|
|
197
|
+
* the tree.
|
|
198
|
+
*/
|
|
199
|
+
translations?: FormTranslations | undefined;
|
|
200
|
+
/**
|
|
201
|
+
* The definition's identity (`id`, `version`, `schemaVersion`), edited like
|
|
202
|
+
* {@link localization}: this is the *initial* value, the form-level properties panel's
|
|
203
|
+
* Identity section edits it, and the host reads the authored result back via
|
|
204
|
+
* {@link BuilderController.identity} to persist on the definition. Absent, the builder
|
|
205
|
+
* offers no Identity section — the host owns the identity outright.
|
|
206
|
+
*/
|
|
207
|
+
identity?: FormIdentity | undefined;
|
|
208
|
+
/**
|
|
209
|
+
* The design-system binding the canvas draws the form with, as the host's form element is
|
|
210
|
+
* given it: a binding, the id of one registered on the page (or offered in
|
|
211
|
+
* {@link availableBindings}), or nothing for Datum's own. A pick in the binding picker wins
|
|
212
|
+
* over it until the host sets another. Choosing a binding changes nothing in the form or its
|
|
213
|
+
* PDF layouts.
|
|
214
|
+
*/
|
|
215
|
+
binding?: LiveBinding | string | undefined;
|
|
216
|
+
/** The design system's files, as the host serves them to its form element (`assets`). */
|
|
217
|
+
assets?: LiveAssets | undefined;
|
|
218
|
+
/** The design-system bindings the canvas offers in its binding picker ({@link BuilderController.availableBindings}). */
|
|
219
|
+
availableBindings?: BuilderBindingOption[];
|
|
220
|
+
/**
|
|
221
|
+
* Adapters by component type laid over the binding the canvas draws with
|
|
222
|
+
* (`extendBinding(binding, { components })`): how a designer's own tree draws on the canvas
|
|
223
|
+
* (the PDF designer's bands, the journey designer's pages and routes).
|
|
224
|
+
*/
|
|
225
|
+
canvasComponents?: Readonly<Record<string, AdapterEntry>> | undefined;
|
|
226
|
+
/**
|
|
227
|
+
* When supplied, the sheet's width is the tree's to decide, not the author's. The canvas
|
|
228
|
+
* calls this with the tree it is about to preview (drafts laid over, so an unsaved edit
|
|
229
|
+
* shows) and lays the form out exactly that many CSS pixels wide, its own sheet padding
|
|
230
|
+
* around it; the Preview width picker and the sheet's drag grips are put away, and
|
|
231
|
+
* {@link BuilderController.previewWidth} is set aside until the option is cleared. The PDF
|
|
232
|
+
* designer sizes the sheet from the document's page setup this way, so a page previews at
|
|
233
|
+
* its paper width and turns with its orientation. `undefined` from the function means
|
|
234
|
+
* "no opinion": the sheet falls back to the author's width for that repaint.
|
|
235
|
+
*/
|
|
236
|
+
sheetWidth?: ((root: ComponentNode) => number | undefined) | undefined;
|
|
237
|
+
/**
|
|
238
|
+
* Whether the sheet's width is the author's to pick (default true). False puts the Preview
|
|
239
|
+
* width picker and the sheet's drag grips away without fixing a width: the journey designer's
|
|
240
|
+
* sheet is fluid but shows no devices.
|
|
241
|
+
*/
|
|
242
|
+
previewWidths?: boolean | undefined;
|
|
243
|
+
/**
|
|
244
|
+
* Resolves `select` options in the canvas preview. Without one a data-source-backed select
|
|
245
|
+
* previews with just its placeholder; with it, the author sees the real options.
|
|
246
|
+
*/
|
|
247
|
+
dataSourceResolver?: DataSourceResolver | undefined;
|
|
248
|
+
/**
|
|
249
|
+
* Data sources the host defined at wiring time (`defineDataSources`) — the same set it hands
|
|
250
|
+
* the renderer. The canvas previews them ahead of {@link dataSourceResolver}, and the
|
|
251
|
+
* inspector's Data source picker lists their ids.
|
|
252
|
+
*/
|
|
253
|
+
dataSources?: DataSourceSet | undefined;
|
|
254
|
+
/**
|
|
255
|
+
* Further data source ids the picker should offer: sources registered on the runtime rather
|
|
256
|
+
* than defined at wiring time, which the builder cannot see on its own.
|
|
257
|
+
*/
|
|
258
|
+
dataSourceIds?: string[];
|
|
259
|
+
/**
|
|
260
|
+
* Validation codes the host knows about beyond the engine's own — the keys of its page's
|
|
261
|
+
* message catalog, the codes its server or sandboxed rules return — which the messages
|
|
262
|
+
* editor offers after the engine's. A bare code, or `{ code, label, message }`
|
|
263
|
+
* — `message` being the page's own wording for the code, which the editor shows as the
|
|
264
|
+
* fallback a blank row keeps and offers to copy in.
|
|
265
|
+
*/
|
|
266
|
+
validationCodes?: HostValidationCode[];
|
|
267
|
+
/**
|
|
268
|
+
* What the outline and the tree view call a node (see `NestedTreeNodeLabeler`), drafts
|
|
269
|
+
* applied. `undefined` or blank: its `label`, else its id.
|
|
270
|
+
*/
|
|
271
|
+
nodeLabel?: NestedTreeNodeLabeler | undefined;
|
|
272
|
+
/**
|
|
273
|
+
* How the inspector draws a node's ID row: editable (the default below the root), read-only
|
|
274
|
+
* with the given text, or not at all — for a tree whose ids are the builder's own bookkeeping.
|
|
275
|
+
* `help` replaces the row's "?" text. Called with the edited node; `undefined` keeps the default.
|
|
276
|
+
*/
|
|
277
|
+
idRow?: ((node: ComponentNode, place: {
|
|
278
|
+
isRoot: boolean;
|
|
279
|
+
}) => BuilderIdRow | undefined) | undefined;
|
|
280
|
+
/**
|
|
281
|
+
* What else holds a node's Save back, for the tree's own rules — a journey page id
|
|
282
|
+
* that another page, or a form component, already has. Called with the edited node (drafts
|
|
283
|
+
* applied), the committed tree and the node's committed id. A problem counts only while the
|
|
284
|
+
* draft changes the property its `target` names (`"id"` for the id): a clash the tree
|
|
285
|
+
* already had is the mode's to report elsewhere, and never holds up an unrelated edit.
|
|
286
|
+
* Listed by {@link BuilderController.problemsOf} and refused by
|
|
287
|
+
* {@link BuilderController.commitDraft}, the unsaved-changes prompt's Save included.
|
|
288
|
+
*/
|
|
289
|
+
problems?: ((edited: ComponentNode, tree: ComponentNode, componentId: string) => readonly BuilderProblem[]) | undefined;
|
|
290
|
+
/**
|
|
291
|
+
* The choices of a `select` property that declares none (see `InspectorModelOptions.fieldChoices`):
|
|
292
|
+
* the form's components for a journey question, the pages a route may go to. Called with the
|
|
293
|
+
* edited node and the field; `undefined` leaves the field as declared.
|
|
294
|
+
*/
|
|
295
|
+
fieldChoices?: ((node: ComponentNode, field: PropertyEditorField) => InspectorChoice[] | undefined) | undefined;
|
|
296
|
+
/**
|
|
297
|
+
* What the tree's owner has to say about a node that holds nothing back (the advisory
|
|
298
|
+
* side): a journey page no path reaches, a question whose component the form no
|
|
299
|
+
* longer has. Each note is drawn under the box its `target` names, or above the sections when
|
|
300
|
+
* it names none the panel draws; a Save never waits on one. Called with the edited node
|
|
301
|
+
* (drafts applied), the committed tree and the node's committed id, like {@link problems}.
|
|
302
|
+
*/
|
|
303
|
+
notes?: ((edited: ComponentNode, tree: ComponentNode, componentId: string) => readonly BuilderNote[]) | undefined;
|
|
304
|
+
/**
|
|
305
|
+
* What a Save writes for a node, from what its draft holds: the tree's owner keeping a value
|
|
306
|
+
* inside what it can mean — a PDF template area's rectangle kept on its page. Called with the
|
|
307
|
+
* edited node (drafts applied) on {@link BuilderController.commitDraft}; the configuration it
|
|
308
|
+
* returns is what lands, in the same undo entry. `undefined` lands the draft as it is.
|
|
309
|
+
*/
|
|
310
|
+
normalizeCommit?: ((edited: ComponentNode, tree: ComponentNode) => Record<string, unknown> | undefined) | undefined;
|
|
311
|
+
/**
|
|
312
|
+
* The inspector sections of a node that start folded, by section id — what an author opens
|
|
313
|
+
* only now and then (a journey's Wording). The author's own fold wins once they toggle one.
|
|
314
|
+
* `undefined` or empty: every section starts open, as on the form.
|
|
315
|
+
*/
|
|
316
|
+
foldedSections?: ((node: ComponentNode) => readonly string[] | undefined) | undefined;
|
|
317
|
+
/**
|
|
318
|
+
* Ghost text for a text box the node leaves empty: what an unset property stands for — the
|
|
319
|
+
* id a journey page is written under while its page id is blank. `undefined` keeps the
|
|
320
|
+
* builder's own (the Data key's component id).
|
|
321
|
+
*/
|
|
322
|
+
fieldPlaceholder?: ((node: ComponentNode, field: PropertyEditorField) => string | undefined) | undefined;
|
|
323
|
+
/**
|
|
324
|
+
* Boxes a node's inspector draws beyond what its definition declares, each in the section
|
|
325
|
+
* `section` names (by id): what changes with the canvas rather than with the type — the
|
|
326
|
+
* Journeys Step view's Wording box for the row of a Check answers step the author pressed.
|
|
327
|
+
* Read each time the inspector is composed; the box's id must be unique among the node's.
|
|
328
|
+
* Only the inspector's drawing and the draft's reading of it follow: the definition (what the
|
|
329
|
+
* Languages workspace lists, what a draft is checked against) is not changed.
|
|
330
|
+
*/
|
|
331
|
+
inspectorFields?: ((node: ComponentNode) => ReadonlyArray<{
|
|
332
|
+
section: string;
|
|
333
|
+
field: PropertyEditorField;
|
|
334
|
+
}> | undefined) | undefined;
|
|
335
|
+
/**
|
|
336
|
+
* Ids a new node never takes although no node has them now: a journey's deleted pages, which
|
|
337
|
+
* a route may still name, so a page added later is not the one it goes to. Read
|
|
338
|
+
* each time an id is made (the palette's add, a drop from it).
|
|
339
|
+
*/
|
|
340
|
+
reservedIds?: (() => Iterable<string>) | undefined;
|
|
341
|
+
/**
|
|
342
|
+
* Whether {@link BuilderController.renameId} rewrites the tree's rules that read the old id
|
|
343
|
+
* (one undo step beside the rename; see there). Absent: it does. `false` for a tree whose
|
|
344
|
+
* owner follows a rename into its rules itself (a journey designer's own nodes,
|
|
345
|
+
* whose mode writes the follow-up as one step with its worked-out values).
|
|
346
|
+
*/
|
|
347
|
+
renameFollowsRules?: boolean | undefined;
|
|
348
|
+
/**
|
|
349
|
+
* Configuration property paths whose value is a formula the tree's owner reads as a rule
|
|
350
|
+
* (a PDF layout root's `when`, written through {@link BuilderController.setDraftProperty}
|
|
351
|
+
* rather than `rules`). A draft that changes one to text the parser refuses is a
|
|
352
|
+
* `rules:<path>` problem and held back at Save, as for `rules[key]`.
|
|
353
|
+
*/
|
|
354
|
+
ruleTargets?: readonly string[] | undefined;
|
|
355
|
+
/**
|
|
356
|
+
* Ids something beside the tree already owns: the nodes a presentation holds of its own, which the Journeys mode claims for the form. A new node never takes one, and a
|
|
357
|
+
* rename to one is refused with an {@link BuilderController.idError}. Read each time.
|
|
358
|
+
*/
|
|
359
|
+
claimedIds?: (() => Iterable<string>) | undefined;
|
|
360
|
+
/**
|
|
361
|
+
* What a new node of `type` is numbered under (`<prefix>_<n>`), when not its type: a
|
|
362
|
+
* journey's worked-out value (`journey-value`), whose type starts with the prefix
|
|
363
|
+
* the designer keeps for its own nodes. `undefined` keeps the type. Read each time an id is
|
|
364
|
+
* made (the palette's add, a drop from it).
|
|
365
|
+
*/
|
|
366
|
+
idPrefix?: ((type: string) => string | undefined) | undefined;
|
|
367
|
+
/**
|
|
368
|
+
* What the canvas draws of the tree (drafts laid over), when not the tree itself: a journey's
|
|
369
|
+
* copy whose nodes of its own carry no `rules`, so a rule the canvas would evaluate
|
|
370
|
+
* against blank answers never hides a card. Everything else — the inspector, the outline, the
|
|
371
|
+
* owner's own reads of {@link BuilderController.previewSnapshot} — sees the tree as it is.
|
|
372
|
+
*/
|
|
373
|
+
canvasRoot?: ((root: ComponentNode) => ComponentNode) | undefined;
|
|
374
|
+
/**
|
|
375
|
+
* The canvas's own tree view, when the canvas draws a tree that is not the controller's (one
|
|
376
|
+
* journey step, its root the page node and its nodes not the journey tree's). Set, the canvas
|
|
377
|
+
* walks, marks drop zones from and names the selection by {@link BuilderController.canvasTreeView}:
|
|
378
|
+
* the view the controller builds over {@link BuilderController.canvasSnapshot} with its own
|
|
379
|
+
* resolver, locale, labeler and label sources, handed through this hook, which may prune it
|
|
380
|
+
* (a placed form container's slots are the form's, not the step's) or name a node as the node
|
|
381
|
+
* it stands for (`tools.viewOf`). `undefined` (every canvas but the step's): the canvas reads
|
|
382
|
+
* {@link BuilderController.treeView} and {@link BuilderController.rootId}, as it always has.
|
|
383
|
+
*/
|
|
384
|
+
canvasView?: ((view: NestedTreeNodeView, tools: CanvasViewTools) => NestedTreeNodeView) | undefined;
|
|
385
|
+
/**
|
|
386
|
+
* The journey page the canvas draws its tree as (one journey step in edit mode): handed to the
|
|
387
|
+
* preview with the tree (`BuilderPreviewRuntime.setFormRoot`), so the renderer draws the page's
|
|
388
|
+
* own heading, counter, Back and Continue. Called with {@link BuilderController.previewSnapshot}.
|
|
389
|
+
* `undefined`, or a hook answering `undefined`: the tree is drawn as the whole form. Never saved.
|
|
390
|
+
*/
|
|
391
|
+
canvasJourneyView?: ((root: ComponentNode) => JourneyView | undefined) | undefined;
|
|
392
|
+
/**
|
|
393
|
+
* A word on a drawn component's box, by drawn id, in the caller's words (one journey step's
|
|
394
|
+
* journey-only field: "Not sent"). Called with {@link BuilderController.previewSnapshot} each
|
|
395
|
+
* time the canvas builds its hooks. `undefined`: no tags (every canvas but the step's).
|
|
396
|
+
*/
|
|
397
|
+
canvasTags?: ((root: ComponentNode) => ReadonlyMap<string, string>) | undefined;
|
|
398
|
+
/**
|
|
399
|
+
* What the page's own chrome on the canvas selects (one journey step's heading, counter, Back
|
|
400
|
+
* and Continue: the page node), and the name its boxes carry. Called with
|
|
401
|
+
* {@link BuilderController.previewSnapshot}. `undefined`, or a hook answering `undefined`: the
|
|
402
|
+
* chrome is drawn unwrapped and selects nothing.
|
|
403
|
+
*/
|
|
404
|
+
canvasRegionOwner?: ((root: ComponentNode) => CanvasRegionOwner | undefined) | undefined;
|
|
405
|
+
/**
|
|
406
|
+
* The drawn ids a click selects another for, and what it selects (a field inside a placed form
|
|
407
|
+
* container -> the placement): drawn as part of that box, with no box of its own.
|
|
408
|
+
* Called with {@link BuilderController.previewSnapshot}. `undefined`: every drawn id is its own.
|
|
409
|
+
*/
|
|
410
|
+
canvasSelectTarget?: ((root: ComponentNode) => ReadonlyMap<string, string>) | undefined;
|
|
411
|
+
/**
|
|
412
|
+
* The step picker on the canvas bar (the Previous and Next buttons and the "Step 2 of 4 · name"
|
|
413
|
+
* line) for a canvas that walks something the tree does not hold as a steps container: one
|
|
414
|
+
* journey step at a time. Called each time the bar is drawn. `undefined`, or a hook answering
|
|
415
|
+
* `undefined`: the bar's picker walks the steps container of the tree drawn, as it always has.
|
|
416
|
+
*/
|
|
417
|
+
canvasStepper?: (() => CanvasStepper | undefined) | undefined;
|
|
418
|
+
/**
|
|
419
|
+
* The colour scheme the canvas draws in, for a controller drawing another's form (a journey's
|
|
420
|
+
* Step view draws the form's sheet with the form's binding): read at each draw in place of
|
|
421
|
+
* {@link BuilderController.canvasColorScheme}'s own answer, which follows the shell's scheme
|
|
422
|
+
* only on the controller the shell gives it. `undefined`, or a hook answering `undefined`: the
|
|
423
|
+
* controller's own.
|
|
424
|
+
*/
|
|
425
|
+
canvasScheme?: (() => "light" | "dark" | undefined) | undefined;
|
|
426
|
+
/**
|
|
427
|
+
* What a slot a node's type does not declare takes, by the node's type (`ParentConstraints.
|
|
428
|
+
* otherSlots`): a journey's own layouts — a grid's columns, a type the host does not define —
|
|
429
|
+
* take only what a page-only layout may hold. `undefined`: anything.
|
|
430
|
+
*/
|
|
431
|
+
otherSlots?: ((type: string) => Omit<SlotDefinition, "id"> | undefined) | undefined;
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Something the tree's owner says about a component that never holds its Save back (see
|
|
435
|
+
* {@link BuilderControllerOptions.notes}): `target` is the property path of the box it is about
|
|
436
|
+
* (`rules:<key>` for a rule on the Rules tab); absent, or naming no box the panel draws, the
|
|
437
|
+
* note sits above the sections.
|
|
438
|
+
*/
|
|
439
|
+
export interface BuilderNote {
|
|
440
|
+
target?: string | undefined;
|
|
441
|
+
message: string;
|
|
442
|
+
/** How much it matters; a note is advisory either way. Default `"warning"`. */
|
|
443
|
+
severity?: "error" | "warning" | undefined;
|
|
444
|
+
/**
|
|
445
|
+
* The definition check's code when the note says what that check says (`component.limits.inverted`),
|
|
446
|
+
* so a reader that lists the check's findings as well can list it once.
|
|
447
|
+
*/
|
|
448
|
+
code?: string | undefined;
|
|
449
|
+
}
|
|
450
|
+
/** How the inspector draws a node's ID row; see {@link BuilderControllerOptions.idRow}. */
|
|
451
|
+
export interface BuilderIdRow {
|
|
452
|
+
/** `edit`: the id box (the root is always read-only, having no parent to be re-seated in); `static`: text; `hidden`: no row. */
|
|
453
|
+
mode: "edit" | "static" | "hidden";
|
|
454
|
+
/** What a `static` row shows. Default: the node's id. */
|
|
455
|
+
text?: string | undefined;
|
|
456
|
+
/** What the row's "?" says. Default: the builder's own words about ids. */
|
|
457
|
+
help?: string | undefined;
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* A definition-level setting that something beside the tree owns — a builder mode's catalog
|
|
461
|
+
* (the Journeys mode's "Opens as") — edited on the form root's draft like the form's
|
|
462
|
+
* identity: {@link BuilderController.setDraftRootSetting} drafts a value, Save commits it
|
|
463
|
+
* through `set`, Cancel forgets it, and the unsaved-changes prompt counts it. The owner's `set`
|
|
464
|
+
* decides how the change enters the undo history.
|
|
465
|
+
*/
|
|
466
|
+
export interface BuilderRootSetting {
|
|
467
|
+
/** Unique among the settings drafted on one controller. */
|
|
468
|
+
id: string;
|
|
469
|
+
/** The committed value, read live. */
|
|
470
|
+
get(): string;
|
|
471
|
+
/** Commits a value a Save found changed. */
|
|
472
|
+
set(value: string): void;
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* `"preview"` marks a change that restyled or repopulated the canvas without touching the
|
|
476
|
+
* tree (a binding / dataSourceResolver swap via {@link BuilderController.setOptions}): the
|
|
477
|
+
* canvas repaints on it like any other change, but a host must not treat it as an edit — its
|
|
478
|
+
* `root` is the same tree, and rebuilding a runtime from it would wipe live form state.
|
|
479
|
+
*/
|
|
480
|
+
export type BuilderChangeReason = "init" | "add" | "move" | "remove" | "edit" | "select" | "preview";
|
|
481
|
+
/** What {@link BuilderController.add} seeds a new component with, beyond its type's default. */
|
|
482
|
+
export interface AddComponentInit {
|
|
483
|
+
/** The id to create it under, when free and valid; otherwise the controller numbers it. */
|
|
484
|
+
id?: string | undefined;
|
|
485
|
+
/** Configuration laid over the type's default. */
|
|
486
|
+
configuration?: Record<string, unknown> | undefined;
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* One whole subtree for {@link BuilderController.insertComponents} to place: under `parentId`
|
|
490
|
+
* (default: the root) in `slotId` (default: where a palette click would put it), at `index`
|
|
491
|
+
* (default: the end of the slot as the entries before it left it).
|
|
492
|
+
*/
|
|
493
|
+
export interface InsertComponentEntry {
|
|
494
|
+
node: ComponentNode;
|
|
495
|
+
parentId?: string | undefined;
|
|
496
|
+
slotId?: string | undefined;
|
|
497
|
+
index?: number | undefined;
|
|
498
|
+
/**
|
|
499
|
+
* What a paste carries from another form: that form's translations for the
|
|
500
|
+
* components of `node`'s subtree, as a map fragment keyed by their ids as they stand in `node`.
|
|
501
|
+
* Only the languages this form declares and the texts the inserted subtree words are taken;
|
|
502
|
+
* an entry that was stale in the clipboard stays stale.
|
|
503
|
+
*/
|
|
504
|
+
translations?: FormTranslations | undefined;
|
|
505
|
+
}
|
|
506
|
+
export interface InsertComponentsOptions {
|
|
507
|
+
/** Whether the first inserted component takes the selection (the default) or it stays put. */
|
|
508
|
+
select?: "first" | "none";
|
|
509
|
+
/**
|
|
510
|
+
* New component id → the id whose translations it carries, for a copy made within this form
|
|
511
|
+
* (a duplicate): the original keeps its own entries and the copy gets the same under its id,
|
|
512
|
+
* in the same undo entry.
|
|
513
|
+
*/
|
|
514
|
+
copiedFrom?: Readonly<Record<string, string>> | undefined;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Something that holds a component's Save back, and where it is: `"id"` for its id, else the
|
|
518
|
+
* property path of the box that holds the unusable value (`cssClass`, `dataKey`). A panel
|
|
519
|
+
* draws the message under that box and leads the author there when Save is pressed.
|
|
520
|
+
*/
|
|
521
|
+
export interface BuilderProblem {
|
|
522
|
+
target: "id" | (string & {});
|
|
523
|
+
message: string;
|
|
524
|
+
}
|
|
525
|
+
/** What the page's own chrome on the canvas selects ({@link BuilderControllerOptions.canvasRegionOwner}). */
|
|
526
|
+
export interface CanvasRegionOwner {
|
|
527
|
+
/** The node selected (a journey step's page node). */
|
|
528
|
+
id: string;
|
|
529
|
+
/** The accessible name of the chrome's boxes, worded by the caller ("Step 2 · How to reach you"). */
|
|
530
|
+
label: string;
|
|
531
|
+
/**
|
|
532
|
+
* Called as a press on the chrome is about to select `id`: `"buttons"` for a region holding the
|
|
533
|
+
* page's Continue, Submit or Back (marked `data-journey-continue` / `data-journey-back`, whatever
|
|
534
|
+
* the binding drew), `"heading"` for the rest. The Journeys Step view opens the step's Wording
|
|
535
|
+
* section for the first. `element` is the id of the drawn element inside the chrome the press
|
|
536
|
+
* landed on, when it landed on one that has an id (a row of a Check answers step's list).
|
|
537
|
+
*/
|
|
538
|
+
onPress?(part: "buttons" | "heading", element?: string): void;
|
|
539
|
+
}
|
|
540
|
+
/** The step the canvas bar's picker shows and walks ({@link BuilderControllerOptions.canvasStepper}). */
|
|
541
|
+
export interface CanvasStepper {
|
|
542
|
+
/** Which step is shown, from 0. */
|
|
543
|
+
index: number;
|
|
544
|
+
/** How many steps there are. */
|
|
545
|
+
total: number;
|
|
546
|
+
/** The shown step's name, worded by the caller. */
|
|
547
|
+
label: string;
|
|
548
|
+
/** Shows the previous (-1) or the next (1) step. */
|
|
549
|
+
go(delta: -1 | 1): void;
|
|
550
|
+
}
|
|
551
|
+
/** What {@link BuilderControllerOptions.canvasView} is handed beside the view. */
|
|
552
|
+
export interface CanvasViewTools {
|
|
553
|
+
/** The tree the canvas root was made from: {@link BuilderController.previewSnapshot}, taken once for this view. */
|
|
554
|
+
root: ComponentNode;
|
|
555
|
+
/** `node`'s view as the controller builds its own ({@link BuilderController.treeView}): its slots' definitions, its label in the locale. */
|
|
556
|
+
viewOf(node: ComponentNode): NestedTreeNodeView;
|
|
557
|
+
}
|
|
558
|
+
/** What an insert or a replace did: the ids it placed, or why it placed nothing. */
|
|
559
|
+
export interface InsertComponentsResult {
|
|
560
|
+
ok: boolean;
|
|
561
|
+
/** The top-level ids placed, in order; empty on a refusal. */
|
|
562
|
+
ids: string[];
|
|
563
|
+
/** Why nothing was placed. */
|
|
564
|
+
error?: string;
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* A slot a component may move to, from {@link BuilderController.moveTargets}: by the
|
|
568
|
+
* rules a drop meets (`drag-drop/move-legality.ts`) plus a fixed node and a data-place clash.
|
|
569
|
+
*/
|
|
570
|
+
export interface BuilderMoveTarget {
|
|
571
|
+
parentId: string;
|
|
572
|
+
slotId: string;
|
|
573
|
+
/** A journey page's own id when the parent is one; its node id stays internal. */
|
|
574
|
+
pageId?: string;
|
|
575
|
+
/** The outline's name for the parent (a journey page by its title). */
|
|
576
|
+
label: string;
|
|
577
|
+
/** The slot's name, when the parent has more than one slot that takes the component (a tab's label, a column). */
|
|
578
|
+
slotLabel?: string;
|
|
579
|
+
/** How deep the parent sits: 0 for the tree's root. */
|
|
580
|
+
depth: number;
|
|
581
|
+
/** What the slot holds already, the moving component left out, in order. */
|
|
582
|
+
siblings: Array<{
|
|
583
|
+
id: string;
|
|
584
|
+
label: string;
|
|
585
|
+
}>;
|
|
586
|
+
/** The component's own position, when this is the slot it sits in. */
|
|
587
|
+
current?: number;
|
|
588
|
+
}
|
|
589
|
+
/** What {@link BuilderController.moveToResult} did: whether it moved, and what it left empty. */
|
|
590
|
+
export interface BuilderMoveToResult {
|
|
591
|
+
moved: boolean;
|
|
592
|
+
/**
|
|
593
|
+
* The container the component came out of when the move left it empty: a journey page by its
|
|
594
|
+
* `pageId`, any other container by its component id. Empty otherwise, and on a refusal.
|
|
595
|
+
*/
|
|
596
|
+
leftEmpty: string[];
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* What the author was doing when the selection's unsaved edits held it back — see
|
|
600
|
+
* {@link BuilderController.unsavedChangesPrompt}. The panel's wording follows it. `leave` is
|
|
601
|
+
* the host's: switching away from the builder page, closing it (see {@link BuilderController.requestLeave}).
|
|
602
|
+
*/
|
|
603
|
+
export type HeldActionKind = "select" | "add" | "drop" | "leave" | "replace" | "remove" | "panel";
|
|
604
|
+
/**
|
|
605
|
+
* A selection-changing action the controller is holding until the author says what to do
|
|
606
|
+
* with the selected component's unsaved edits.
|
|
607
|
+
*/
|
|
608
|
+
export interface UnsavedChangesPrompt {
|
|
609
|
+
/** The component whose draft is in the way — the current selection — or, for a leave guard's edits, what the guard names. */
|
|
610
|
+
componentId: string;
|
|
611
|
+
action: HeldActionKind;
|
|
612
|
+
/** Set when the edits are a {@link LeaveGuard}'s rather than a draft's: the guard's owner puts up the prompt, not the panels. */
|
|
613
|
+
external?: LeaveGuardSubject;
|
|
614
|
+
}
|
|
615
|
+
/** The answer to an {@link UnsavedChangesPrompt}. */
|
|
616
|
+
export type UnsavedChangesDecision = "save" | "discard" | "stay";
|
|
617
|
+
/** How a leave guard's unsaved edits are named to the author. */
|
|
618
|
+
export interface LeaveGuardSubject {
|
|
619
|
+
/** An id-like tag for them — a layout's id. */
|
|
620
|
+
id: string;
|
|
621
|
+
label: string;
|
|
622
|
+
/** Save is refused (an unusable id, say): the prompt offers Keep editing and Discard only. */
|
|
623
|
+
blocked: boolean;
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* Unsaved edits kept outside the tree — a mode's own editor, such as the PDF designer's
|
|
627
|
+
* template mapping — that leaving the builder must not walk past either. Once the tree's own
|
|
628
|
+
* draft is clean, {@link BuilderController.requestLeave} asks the guard, holds the departure
|
|
629
|
+
* while it has edits pending, and settles them through `save` or `discard` when the prompt is
|
|
630
|
+
* answered. The prompt names no component, so the panels leave drawing it to the guard's owner.
|
|
631
|
+
*/
|
|
632
|
+
export interface LeaveGuard {
|
|
633
|
+
pending(): boolean;
|
|
634
|
+
subject(): LeaveGuardSubject;
|
|
635
|
+
/** Saves the edits; `false` refuses, the edits stay, and the refusal shows where the owner shows it. */
|
|
636
|
+
save(): boolean;
|
|
637
|
+
discard(): void;
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* Trims a {@link FormIdentity}'s fields. A field left blank is not a new value: it takes the
|
|
641
|
+
* `fallback`'s (the committed identity, on Save), because a form with no id or version is
|
|
642
|
+
* not something a host can store or submit against. `keepWhitespace` is the draft path's —
|
|
643
|
+
* the panel repaints its boxes from the draft per keystroke, and trimming there would erase
|
|
644
|
+
* the space just typed; Save trims. `undefined` in means `undefined` out: no identity at all.
|
|
645
|
+
*/
|
|
646
|
+
export declare function normalizeFormIdentity(value: FormIdentity | undefined, options?: {
|
|
647
|
+
fallback?: FormIdentity | undefined;
|
|
648
|
+
keepWhitespace?: boolean;
|
|
649
|
+
}): FormIdentity | undefined;
|
|
650
|
+
/**
|
|
651
|
+
* Collapses a `tests` block to its meaningful content: entries that are not an object
|
|
652
|
+
* with a non-empty string `id` and a string `source` are dropped, a repeated id keeps its first
|
|
653
|
+
* entry, and a block with nothing left is `undefined`, so a form with no scenarios carries no
|
|
654
|
+
* `tests` key at all. The source text is kept exactly: it is what the author typed.
|
|
655
|
+
*/
|
|
656
|
+
export declare function normalizeTestsConfiguration(value: FormTestConfiguration | undefined): FormTestConfiguration | undefined;
|
|
657
|
+
/**
|
|
658
|
+
* Collapses a {@link LocalizationConfiguration} to its meaningful content: blank codes and
|
|
659
|
+
* strings are dropped, and a configuration with nothing left collapses to `undefined` — the
|
|
660
|
+
* same philosophy as `fromLocalizedTextParts`, so a single-language form carries no
|
|
661
|
+
* localization block at all.
|
|
662
|
+
*
|
|
663
|
+
* Labels are trimmed.
|
|
664
|
+
*/
|
|
665
|
+
export declare function normalizeLocalizationConfiguration(value: LocalizationConfiguration | undefined): LocalizationConfiguration | undefined;
|
|
666
|
+
/** A rename as {@link BuilderChangeEvent.renamed} carries it, with the rules that followed and the formulas that could not. */
|
|
667
|
+
export interface BuilderRename {
|
|
668
|
+
from: string;
|
|
669
|
+
to: string;
|
|
670
|
+
/**
|
|
671
|
+
* The ids of the components whose rules were rewritten to read the new id (the renamed one among
|
|
672
|
+
* them when its own rules read it), or, inside a grid's row, the row key the rename moved.
|
|
673
|
+
*/
|
|
674
|
+
rules?: string[];
|
|
675
|
+
/** Formulas that spell the old id but do not parse, left as written: the Logic diagnostics show them (see {@link BuilderController.renameNotes}). */
|
|
676
|
+
unparsed?: BuilderRenameNote[];
|
|
677
|
+
/**
|
|
678
|
+
* Where the renamed component's data went when that is more than its id changing (`applicant.email` to
|
|
679
|
+
* `applicant.mail`, `items[].sku` to `items[].code`), for a reference that reads answers by path (a PDF
|
|
680
|
+
* template source) to follow by the move, not by the id. Absent when the data path is the id itself, which
|
|
681
|
+
* `from` and `to` already say, and when the data stayed where it was (a component with a data key of its own).
|
|
682
|
+
*/
|
|
683
|
+
dataPath?: ValuePathMove;
|
|
684
|
+
}
|
|
685
|
+
/** A rename an Undo or a Redo moved: the component now answers to `to` again ({@link BuilderChangeEvent.renameStepped}). */
|
|
686
|
+
export interface BuilderRenameStepped {
|
|
687
|
+
from: string;
|
|
688
|
+
to: string;
|
|
689
|
+
by: "undo" | "redo";
|
|
690
|
+
}
|
|
691
|
+
/** One formula a rename could not follow: a rule of `componentId` the parser rejects while it spells the old id. */
|
|
692
|
+
export interface BuilderRenameNote {
|
|
693
|
+
componentId: string;
|
|
694
|
+
/** The rule's key: `visibleWhen`, `value` and the rest. */
|
|
695
|
+
rule: string;
|
|
696
|
+
from: string;
|
|
697
|
+
to: string;
|
|
698
|
+
/** The formula as it stands, unchanged. */
|
|
699
|
+
formula: string;
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* The net change to the form's languages since a baseline — the form as loaded, or as the host
|
|
703
|
+
* last saved it: what a host keeping per-locale data of its own (a translation
|
|
704
|
+
* catalog) must do to it when it saves the form. A rename chain is one move from the baseline
|
|
705
|
+
* code to the code the form has now; an Undo takes its part back; a language removed and
|
|
706
|
+
* brought back is no change at all.
|
|
707
|
+
*/
|
|
708
|
+
export interface LocaleChanges {
|
|
709
|
+
/** Baseline codes the form no longer has under any code: drop everything held under them. */
|
|
710
|
+
removed: string[];
|
|
711
|
+
/**
|
|
712
|
+
* Baseline codes the form now has under another code: move what is held under `from` to `to`.
|
|
713
|
+
* Apply the removals first, then the moves as one simultaneous mapping (two codes may swap); a
|
|
714
|
+
* moved entry replaces whatever the host held under `to`. A code both removed and a rename's
|
|
715
|
+
* target means its old wording is dropped and the moved wording takes its place.
|
|
716
|
+
*/
|
|
717
|
+
renamed: Array<{
|
|
718
|
+
from: string;
|
|
719
|
+
to: string;
|
|
720
|
+
}>;
|
|
721
|
+
}
|
|
722
|
+
export interface BuilderChangeEvent {
|
|
723
|
+
root: ComponentNode;
|
|
724
|
+
selectedComponentId: string | undefined;
|
|
725
|
+
reason: BuilderChangeReason;
|
|
726
|
+
/**
|
|
727
|
+
* Present only on the change that re-seated a component under a new id ({@link
|
|
728
|
+
* BuilderController.renameId}, a Save of a drafted id among them). The tree's own rules that
|
|
729
|
+
* read the old id are rewritten with it ({@link BuilderRename.rules}); whoever keeps
|
|
730
|
+
* references of its own (a journey's pages and conditions; a PDF layout's
|
|
731
|
+
* condition) follows them from here.
|
|
732
|
+
*/
|
|
733
|
+
renamed?: BuilderRename;
|
|
734
|
+
/**
|
|
735
|
+
* Present only on the change an Undo or a Redo of a rename's history entry made: the component
|
|
736
|
+
* is back under `to` (its id before the rename, after an Undo). The entry held the rename and
|
|
737
|
+
* what followed it in the form's own documents (its rules, translations and scenarios, a PDF
|
|
738
|
+
* layout's conditions and sources), which the step has already put back; whoever keeps
|
|
739
|
+
* references of its own outside the form's history (a journey's pages) follows from here.
|
|
740
|
+
*/
|
|
741
|
+
renameStepped?: BuilderRenameStepped;
|
|
742
|
+
/**
|
|
743
|
+
* Present on every change an Undo or a Redo made. A follow-up whose rewrite is a part of the
|
|
744
|
+
* step's entry (a mode's, the scenarios') is already taken back or made again with it and
|
|
745
|
+
* must not run again; only one that was dropped while the step was undone
|
|
746
|
+
* ({@link BuilderController.followRename} answered false) runs on the Redo.
|
|
747
|
+
*/
|
|
748
|
+
historyStep?: "undo" | "redo";
|
|
749
|
+
/**
|
|
750
|
+
* Present only on the change of an edit that moved where answers are stored (a data key, a
|
|
751
|
+
* container's key or `scopeData`): each data-holding component's value path before
|
|
752
|
+
* and after, `[]` for a collection's entries. The rules inside a grid row that read a moved row
|
|
753
|
+
* key (`row.<key>`) are rewritten with it, in the same step of the history; whoever reads answers
|
|
754
|
+
* by value path (the scenarios, a PDF layout's sources) follows from here, all moves as one map
|
|
755
|
+
* (a path moves once, so two keys swapped stay swapped), and joins the step with
|
|
756
|
+
* {@link BuilderController.followRename} given the first move. On the change of a rename saved
|
|
757
|
+
* with a new data key, beside {@link renamed}: the moves the new id alone does not explain, each
|
|
758
|
+
* from where the answer was before the Save. On the change an Undo of such a step made (with
|
|
759
|
+
* {@link historyStep}), each move the other way round, as {@link renameStepped} names a rename's
|
|
760
|
+
* ids; on the change a Redo of it made, the same moves again.
|
|
761
|
+
*/
|
|
762
|
+
dataMoved?: ValuePathMove[];
|
|
763
|
+
/**
|
|
764
|
+
* Present only on the change that moved translations to a new id (translations are addressed by
|
|
765
|
+
* id): a host keeping a catalog under the same addresses renames its entries with it. Every
|
|
766
|
+
* kind of id is announced with its kind: a component id (`components`), a header or footer part
|
|
767
|
+
* (`chrome`), a journey (`journeys`), a PDF layout (`pdf`), and the keys inside an owner (an
|
|
768
|
+
* option's value, a journey page's id, a layout node's id) with their `owner` and `within`
|
|
769
|
+
* ({@link RenamedTextId}).
|
|
770
|
+
*/
|
|
771
|
+
renamedIds?: RenamedTextId[];
|
|
772
|
+
/**
|
|
773
|
+
* Present on an `edit` made under a control still being typed into (a formula box, see
|
|
774
|
+
* {@link BuilderController.setDraftRules}'s `live`): the draft changed, but the author has not
|
|
775
|
+
* left the box. A surface that mirrors the draft refreshes what it shows in place; the canvas
|
|
776
|
+
* and anything else that rebuilds from the tree wait for the plain `edit` that follows when
|
|
777
|
+
* the author leaves the box or saves.
|
|
778
|
+
*/
|
|
779
|
+
live?: true;
|
|
780
|
+
}
|
|
781
|
+
interface BuilderControllerEventMap {
|
|
782
|
+
change: BuilderChangeEvent;
|
|
783
|
+
selection: {
|
|
784
|
+
selectedComponentId: string | undefined;
|
|
785
|
+
};
|
|
786
|
+
mutation: BuilderMutationEvent;
|
|
787
|
+
/** How the selection is drawn moved (its adapter, or what the surface answers for its type): see {@link BuilderController.drawingChanged}. */
|
|
788
|
+
drawing: Record<string, never>;
|
|
789
|
+
}
|
|
790
|
+
type Listener<T> = (event: T) => void;
|
|
791
|
+
/**
|
|
792
|
+
* Framework-neutral state + operations shared by the builder panels
|
|
793
|
+
* (`<datum-builder-toolbar>`, `<datum-builder-canvas>`, `<datum-builder-properties>`).
|
|
794
|
+
* A host can create one controller and hand it to any subset of panels, or lay them out
|
|
795
|
+
* however it likes. The wrapper `<datum-builder>` element also uses this internally.
|
|
796
|
+
*/
|
|
797
|
+
export declare class BuilderController {
|
|
798
|
+
private editor;
|
|
799
|
+
private resolver;
|
|
800
|
+
private componentRegistry;
|
|
801
|
+
/** The registered definitions' types in registration order: the registry resolves a type but cannot list them ({@link typeInfo}). */
|
|
802
|
+
private registeredTypes;
|
|
803
|
+
private mutationOff;
|
|
804
|
+
private types;
|
|
805
|
+
private selectedId;
|
|
806
|
+
private counter;
|
|
807
|
+
private locale;
|
|
808
|
+
/** Committed `FormDefinition.localization` — what the Languages workspace's actions and {@link setLocalization} have written. */
|
|
809
|
+
private localizationValue;
|
|
810
|
+
/**
|
|
811
|
+
* Committed `FormDefinition.tests`: the form's scenarios, one source block each. Held
|
|
812
|
+
* beside the localization, not in the tree: Save has nothing to write for it, an edit is its own
|
|
813
|
+
* history step, and the Tests panel reads and writes it through {@link tests} and {@link setTests}.
|
|
814
|
+
*/
|
|
815
|
+
private testsValue;
|
|
816
|
+
/**
|
|
817
|
+
* Committed `FormDefinition.translations`: every text of the form in a language other
|
|
818
|
+
* than its default. Held beside the localization, not in the tree, and written only through the
|
|
819
|
+
* commands that go by way of {@link rewriteTranslations}, so each rule is one undo step with the
|
|
820
|
+
* edit that caused it.
|
|
821
|
+
*/
|
|
822
|
+
private translationsValue;
|
|
823
|
+
/** The component renames {@link renameId} just made, carried on the change event ({@link BuilderChangeEvent.renamedIds}). */
|
|
824
|
+
private renamedIdsToAnnounce;
|
|
825
|
+
/** How deep {@link joinSteps} runs are nested, and the entry the steps recorded in them join. */
|
|
826
|
+
private joinDepth;
|
|
827
|
+
private joinedStep;
|
|
828
|
+
/** Committed {@link FormIdentity} — the same way; `undefined` when the host handed over none. */
|
|
829
|
+
private identityValue;
|
|
830
|
+
/** The builder's own colour scheme, as the shell reports it ({@link setPreviewScheme}). */
|
|
831
|
+
private previewSchemeValue;
|
|
832
|
+
private bindingOptions;
|
|
833
|
+
/** What {@link offeredTypes} last answered, and what it was made from. */
|
|
834
|
+
private offeredMemo;
|
|
835
|
+
/** The picker's choice; `undefined` until the author picks (the host's {@link hostBinding} draws). */
|
|
836
|
+
private bindingIdValue;
|
|
837
|
+
/** The host's binding (`binding`). */
|
|
838
|
+
private hostBinding;
|
|
839
|
+
private assetsValue;
|
|
840
|
+
private canvasComponentsValue;
|
|
841
|
+
/** The canvas's account of how the form is drawn, for the inspector ({@link setDrawingSource}). */
|
|
842
|
+
private drawingSource;
|
|
843
|
+
private previewDataSources;
|
|
844
|
+
private previewDataSourceSet;
|
|
845
|
+
/** Lists the author tries the form with in place of a data source's (the Settings panel): the session's, never the definition's. */
|
|
846
|
+
private simulatedSources;
|
|
847
|
+
/** What Submit does in Try it (the Settings panel): the session's, never the definition's. */
|
|
848
|
+
private trySubmissionValue;
|
|
849
|
+
/** The host values Try it previews with (see {@link tryHostContext}). */
|
|
850
|
+
private tryHostContextValue;
|
|
851
|
+
/** The set {@link dataSources} hands out, kept while neither layer changes: the canvas reloads its options when the set changes. */
|
|
852
|
+
private layeredSources;
|
|
853
|
+
/** The host chrome the canvas previews the form under (the View panel). */
|
|
854
|
+
private previewChromeValue;
|
|
855
|
+
private hostDataSourceIds;
|
|
856
|
+
/** Codes the host named for the messages editor, beyond the engine's own. */
|
|
857
|
+
private hostValidationCodes;
|
|
858
|
+
/** Uncommitted properties-panel edits, keyed by the component they belong to. */
|
|
859
|
+
private drafts;
|
|
860
|
+
/**
|
|
861
|
+
* An action held back by the selection's unsaved edits until the author answers the
|
|
862
|
+
* prompt (see {@link requestSelect}); `run` performs it once the draft is dealt with.
|
|
863
|
+
*/
|
|
864
|
+
private heldAction;
|
|
865
|
+
/** Unsaved edits outside the tree that leaving is held for too (see {@link LeaveGuard}). */
|
|
866
|
+
private leaveGuard;
|
|
867
|
+
/**
|
|
868
|
+
* Guards stacked over {@link leaveGuard} with {@link pushLeaveGuard}, newest last. The slot is
|
|
869
|
+
* the surfaces' (Logic, Languages, a designer's mapping) and they set and clear it whole; an
|
|
870
|
+
* editor that can be open beside them (the Tests panel) stacks instead, so neither
|
|
871
|
+
* throws the other's edits away.
|
|
872
|
+
*/
|
|
873
|
+
private stackedLeaveGuards;
|
|
874
|
+
/** The languages as of the baseline (a load, or the host's last Save): what {@link localeChangesSinceSave} measures from. */
|
|
875
|
+
private localeBaseline;
|
|
876
|
+
/** Each language the form has now that descends from a baseline one, by the baseline code it started as. */
|
|
877
|
+
private localeLineage;
|
|
878
|
+
/** The rename {@link renameId} just made, carried on its change event (see {@link BuilderChangeEvent.renamed}). */
|
|
879
|
+
private renamedToAnnounce;
|
|
880
|
+
/** The rename an Undo or a Redo just moved, carried on its change event (see {@link BuilderChangeEvent.renameStepped}). */
|
|
881
|
+
private renameSteppedToAnnounce;
|
|
882
|
+
/** The last rename's history entry while it is still the last thing done ({@link followRename}). */
|
|
883
|
+
private openRename;
|
|
884
|
+
/** The latest renames and moves of data, newest last, so a late follow-up of one an Undo took back is known as such ({@link followRename}). */
|
|
885
|
+
private recentSteps;
|
|
886
|
+
/** The rename or move of data a Redo just made again: open to follow-ups once the Redo is through. */
|
|
887
|
+
private redoneStep;
|
|
888
|
+
/** Which way the history just stepped, carried on its change event (see {@link BuilderChangeEvent.historyStep}). */
|
|
889
|
+
private historyStepToAnnounce;
|
|
890
|
+
/** Where the data the last edit moved went, carried on its change event (see {@link BuilderChangeEvent.dataMoved}). */
|
|
891
|
+
private dataMovedToAnnounce;
|
|
892
|
+
/** What the last load of the translations map left out ({@link translationsDropped}). */
|
|
893
|
+
private translationsDroppedValue;
|
|
894
|
+
/** The formulas the last rename left as written (see {@link renameNotes}); replaced by the next rename that re-seats a component. */
|
|
895
|
+
private renameNotesValue;
|
|
896
|
+
/** {@link BuilderControllerOptions.nodeLabel}. */
|
|
897
|
+
private nodeLabeler;
|
|
898
|
+
/** {@link BuilderControllerOptions.idRow}. */
|
|
899
|
+
private idRowResolver;
|
|
900
|
+
/** {@link BuilderControllerOptions.problems}. */
|
|
901
|
+
private problemsHook;
|
|
902
|
+
/** {@link BuilderControllerOptions.fieldChoices}. */
|
|
903
|
+
private fieldChoicesHook;
|
|
904
|
+
/** The host's translation catalog, when the builder was lent one: frame labels resolve through it as the form does. */
|
|
905
|
+
private translationCatalogValue;
|
|
906
|
+
/** {@link BuilderControllerOptions.notes}. */
|
|
907
|
+
private notesHook;
|
|
908
|
+
/** {@link BuilderControllerOptions.normalizeCommit}. */
|
|
909
|
+
private normalizeCommitHook;
|
|
910
|
+
/** {@link BuilderControllerOptions.foldedSections}. */
|
|
911
|
+
private foldedSectionsHook;
|
|
912
|
+
/** {@link BuilderControllerOptions.fieldPlaceholder}. */
|
|
913
|
+
private fieldPlaceholderHook;
|
|
914
|
+
/** {@link BuilderControllerOptions.inspectorFields}. */
|
|
915
|
+
private inspectorFieldsHook;
|
|
916
|
+
/** {@link BuilderControllerOptions.reservedIds}. */
|
|
917
|
+
private reservedIdsHook;
|
|
918
|
+
/** {@link BuilderControllerOptions.renameFollowsRules}; absent: true. */
|
|
919
|
+
private renameFollowsRulesOption;
|
|
920
|
+
/** {@link BuilderControllerOptions.ruleTargets}. */
|
|
921
|
+
private ruleTargetsOption;
|
|
922
|
+
/** {@link BuilderControllerOptions.claimedIds}. */
|
|
923
|
+
private claimedIdsHook;
|
|
924
|
+
/** {@link BuilderControllerOptions.idPrefix}. */
|
|
925
|
+
private idPrefixHook;
|
|
926
|
+
/** {@link BuilderControllerOptions.canvasRoot}. */
|
|
927
|
+
private canvasRootHook;
|
|
928
|
+
/** {@link BuilderControllerOptions.canvasView}. */
|
|
929
|
+
private canvasViewHook;
|
|
930
|
+
/** {@link BuilderControllerOptions.canvasJourneyView}. */
|
|
931
|
+
private canvasJourneyViewHook;
|
|
932
|
+
/** {@link BuilderControllerOptions.canvasTags}. */
|
|
933
|
+
private canvasTagsHook;
|
|
934
|
+
/** {@link BuilderControllerOptions.canvasRegionOwner}. */
|
|
935
|
+
private canvasRegionOwnerHook;
|
|
936
|
+
/** {@link BuilderControllerOptions.canvasSelectTarget}. */
|
|
937
|
+
private canvasSelectTargetHook;
|
|
938
|
+
/** {@link BuilderControllerOptions.canvasStepper}. */
|
|
939
|
+
private canvasStepperHook;
|
|
940
|
+
/** {@link BuilderControllerOptions.canvasScheme}. */
|
|
941
|
+
private canvasSchemeHook;
|
|
942
|
+
/** Bumped when what the canvas draws the tree as is swapped; see {@link canvasRevision}. */
|
|
943
|
+
private canvasRevisionValue;
|
|
944
|
+
/** {@link BuilderControllerOptions.otherSlots}, read by {@link resolver} each time. */
|
|
945
|
+
private otherSlotsHook;
|
|
946
|
+
private showHidden;
|
|
947
|
+
private previewWidthValue;
|
|
948
|
+
/** The modes' blocks that carry default texts outside the tree (see {@link setOutsideDocuments}). */
|
|
949
|
+
private outsideDocuments;
|
|
950
|
+
/** {@link BuilderControllerOptions.sheetWidth}: the tree's say over the sheet, when a host gives it one. */
|
|
951
|
+
private sheetWidthResolver;
|
|
952
|
+
/** {@link BuilderControllerOptions.previewWidths}. */
|
|
953
|
+
private previewWidthsValue;
|
|
954
|
+
/**
|
|
955
|
+
* Last slot-constraint rejection message, if any — or what an Undo or Redo could not do.
|
|
956
|
+
* Cleared by the next successful op.
|
|
957
|
+
*/
|
|
958
|
+
dropError: string | undefined;
|
|
959
|
+
/** While Undo or Redo steps: listeners are {@link emit}'s `guarded`. */
|
|
960
|
+
private stepping;
|
|
961
|
+
/**
|
|
962
|
+
* Last id-rename validation message, if any — the selection's, as the fields below are too.
|
|
963
|
+
* A panel asks {@link problemsOf} for the component it shows instead.
|
|
964
|
+
*/
|
|
965
|
+
idError: string | undefined;
|
|
966
|
+
/**
|
|
967
|
+
* Why the selection's `cssClass` value is unusable: a malformed token the renderer would
|
|
968
|
+
* silently drop (see `css-classes.ts`). Follows the selection the way {@link idError}
|
|
969
|
+
* does, and blocks {@link commitDraft} the same way.
|
|
970
|
+
*/
|
|
971
|
+
cssClassError: string | undefined;
|
|
972
|
+
/**
|
|
973
|
+
* Why the selection's data key cannot be saved: a key that is not usable, or one
|
|
974
|
+
* that puts its answer where another component's already is. Checked only for a key the
|
|
975
|
+
* draft changes, so an edit to anything else is never held up by the form as it was.
|
|
976
|
+
* Follows the selection the way {@link idError} does, and blocks {@link commitDraft} the same way.
|
|
977
|
+
*/
|
|
978
|
+
dataKeyError: string | undefined;
|
|
979
|
+
/** Per type: whether its inspector offers a Data key; see {@link offersDataKey}. */
|
|
980
|
+
private readonly dataKeyOffers;
|
|
981
|
+
/** Bumped by every change, so what is derived from the drafts can be kept until the next one. */
|
|
982
|
+
private revision;
|
|
983
|
+
/** {@link problemsOf} per component, as of {@link revision}. */
|
|
984
|
+
private problemCache;
|
|
985
|
+
/**
|
|
986
|
+
* Advisory note that the selection's `cssClass` names classes the chosen binding does not
|
|
987
|
+
* declare. Shown, never blocking: the class may mean nothing under this binding, but another
|
|
988
|
+
* binding — or the host page — may give it meaning, so Save proceeds.
|
|
989
|
+
*/
|
|
990
|
+
cssClassWarning: string | undefined;
|
|
991
|
+
/** The class vocabulary of the chosen binding ({@link cssClassNames}), keyed by the binding it came from. */
|
|
992
|
+
private classNamesCache;
|
|
993
|
+
/** The drawing the component definitions bring ({@link componentDrawing}), keyed by the registry it was read from. */
|
|
994
|
+
private drawingCache;
|
|
995
|
+
private readonly listeners;
|
|
996
|
+
constructor(options?: BuilderControllerOptions);
|
|
997
|
+
on<K extends keyof BuilderControllerEventMap>(type: K, listener: Listener<BuilderControllerEventMap[K]>): () => void;
|
|
998
|
+
/**
|
|
999
|
+
* `guarded` while Undo or Redo steps (see {@link stepThroughHistory}): a listener that throws
|
|
1000
|
+
* then never makes the bar's Undo or Redo throw, nor keeps the others from hearing; its error
|
|
1001
|
+
* is reported as a DOM event listener's is (`reportError`, else the console).
|
|
1002
|
+
*/
|
|
1003
|
+
private emit;
|
|
1004
|
+
/**
|
|
1005
|
+
* A step of the history made, undone or redone. A follow-up a rename takes into its own entry
|
|
1006
|
+
* is no step, nor is a part a {@link joinSteps} entry takes in after its first (nor a write
|
|
1007
|
+
* with no entry made while that entry tops the history): none is announced, so a count of the
|
|
1008
|
+
* steps stays the history's. The joined entry's first part is announced as it is made, since
|
|
1009
|
+
* it is the entry. Any step ends the window in which a late follow-up may join the last
|
|
1010
|
+
* rename.
|
|
1011
|
+
*/
|
|
1012
|
+
private mutated;
|
|
1013
|
+
private emitChange;
|
|
1014
|
+
setOptions(options: BuilderControllerOptions, meta?: {
|
|
1015
|
+
silent?: boolean;
|
|
1016
|
+
}): void;
|
|
1017
|
+
private registryOf;
|
|
1018
|
+
/** `registry`, which `editor` now reads, and its constraints, the slots the other-slots hook adds laid over them. */
|
|
1019
|
+
private useRegistry;
|
|
1020
|
+
/**
|
|
1021
|
+
* Swaps the component definitions under the tree as it stands — a PDF template layout's
|
|
1022
|
+
* pickers following the form's components — without the rebuild {@link setOptions} makes of
|
|
1023
|
+
* `componentDefinitions`: the tree, its undo history, open drafts and the selection all stay.
|
|
1024
|
+
* A controller with no registry yet (or none left) takes the full rebuild instead.
|
|
1025
|
+
*/
|
|
1026
|
+
setComponentDefinitions(definitions: readonly ComponentDefinition[], componentTypes?: BuilderControllerOptions["componentTypes"]): void;
|
|
1027
|
+
componentTypes(): BuilderComponentType[];
|
|
1028
|
+
/**
|
|
1029
|
+
* The types the palette and the add command offer now: every type, less those that belong to a
|
|
1030
|
+
* design-system binding (`binding`) other than the one drawing the canvas. The same list
|
|
1031
|
+
* (`componentTypes()` itself) when no type names a binding.
|
|
1032
|
+
*/
|
|
1033
|
+
offeredTypes(): BuilderComponentType[];
|
|
1034
|
+
/** Locale used to resolve `LocalizedText` in the canvas tree view and inspector model. */
|
|
1035
|
+
currentLocale(): string;
|
|
1036
|
+
/**
|
|
1037
|
+
* Whether the canvas paints components a rule is currently hiding: an X-ray of every component
|
|
1038
|
+
* the form *has*, the way to reach a field gated behind a `visibleWhen` without first
|
|
1039
|
+
* satisfying the rule. On by default (an author edits what the form has, and Try it
|
|
1040
|
+
* shows what a person sees); the View panel turns it off.
|
|
1041
|
+
*/
|
|
1042
|
+
showHiddenComponents(): boolean;
|
|
1043
|
+
setShowHiddenComponents(value: boolean): void;
|
|
1044
|
+
/**
|
|
1045
|
+
* Width the canvas constrains the previewed form to, in CSS pixels — `undefined` for the
|
|
1046
|
+
* canvas's full width. A form is authored on a wide screen and filled in on whatever the
|
|
1047
|
+
* filler has, so being able to see it at 414px without leaving the builder is the difference
|
|
1048
|
+
* between finding a layout problem now and hearing about it later.
|
|
1049
|
+
*/
|
|
1050
|
+
/**
|
|
1051
|
+
* Repaints the canvas over the same tree: for a host whose previews changed behind the
|
|
1052
|
+
* component definitions (the PDF designer's field previews, rebuilt over other sample
|
|
1053
|
+
* answers) without anything in the tree changing.
|
|
1054
|
+
*/
|
|
1055
|
+
repaintPreview(): void;
|
|
1056
|
+
previewWidth(): number | undefined;
|
|
1057
|
+
setPreviewWidth(value: number | undefined): void;
|
|
1058
|
+
/** Whether the author may pick the sheet's width ({@link BuilderControllerOptions.previewWidths}). */
|
|
1059
|
+
previewWidths(): boolean;
|
|
1060
|
+
/**
|
|
1061
|
+
* The width the tree fixes the sheet at, in CSS pixels, when the host gave the controller a
|
|
1062
|
+
* {@link BuilderControllerOptions.sheetWidth}; `undefined` otherwise, and the sheet is the
|
|
1063
|
+
* author's ({@link previewWidth}). Read over the tree the canvas previews — `root` lets the
|
|
1064
|
+
* canvas pass the snapshot it already took rather than clone the tree twice per repaint.
|
|
1065
|
+
*/
|
|
1066
|
+
sheetWidth(root?: ComponentNode): number | undefined;
|
|
1067
|
+
/**
|
|
1068
|
+
* Locale options the canvas renders its switcher from: the form's own `supportedLocales`
|
|
1069
|
+
* as committed (the Languages workspace's actions and {@link setLocalization} write them
|
|
1070
|
+
* straight to it), each under its authored label — the same list, from the same helper,
|
|
1071
|
+
* the rendered form's switcher offers. Empty when the form declares no localization, and
|
|
1072
|
+
* the switcher hides.
|
|
1073
|
+
*/
|
|
1074
|
+
localeOptions(): BuilderLocaleOption[];
|
|
1075
|
+
/**
|
|
1076
|
+
* The committed `FormDefinition.localization` for the form being edited — what Save has
|
|
1077
|
+
* written, and what a host should persist on the definition beside {@link snapshot}.
|
|
1078
|
+
* `undefined` means the form declares no localization configuration (single-language).
|
|
1079
|
+
*/
|
|
1080
|
+
localization(): LocalizationConfiguration | undefined;
|
|
1081
|
+
/**
|
|
1082
|
+
* The committed `FormDefinition.tests` for the form being edited: what a host should
|
|
1083
|
+
* persist on the definition beside {@link snapshot} and {@link localization}. `undefined` means
|
|
1084
|
+
* the form has no scenarios.
|
|
1085
|
+
*/
|
|
1086
|
+
tests(): FormTestConfiguration | undefined;
|
|
1087
|
+
/** The translations written in `codes` that a removal takes away: the entries of those languages in the map. */
|
|
1088
|
+
localeTranslationCount(codes: readonly string[]): number;
|
|
1089
|
+
/**
|
|
1090
|
+
* Lends the controller the modes' blocks of the definition that carry default texts outside
|
|
1091
|
+
* the tree (a journey catalog, a PDF layout catalog). Their translations are in the one map
|
|
1092
|
+
* like the tree's; what the blocks still own is the default strings. The controller reads
|
|
1093
|
+
* them to know every text's default (a translation's `source`, Make default's list) and
|
|
1094
|
+
* writes new defaults back in the same history entry as the tree and the map (Make default,
|
|
1095
|
+
* a layout language rename), so one Undo takes all of it back. `undefined` clears it: the
|
|
1096
|
+
* tree alone is then what the controller knows.
|
|
1097
|
+
*/
|
|
1098
|
+
setOutsideDocuments(provider: (() => readonly OutsideDocument[]) | undefined): void;
|
|
1099
|
+
/**
|
|
1100
|
+
* One history command rewriting the outside documents `rewrite` changes, or `undefined` when
|
|
1101
|
+
* it changes none. Its first run writes the rewritten block; an Undo or Redo carries just that
|
|
1102
|
+
* change onto the block as it stands then ({@link carryChange}), so what the author did to a
|
|
1103
|
+
* journey or a layout in its own tab since is not thrown away with it.
|
|
1104
|
+
*/
|
|
1105
|
+
private outsideCommand;
|
|
1106
|
+
/**
|
|
1107
|
+
* The localization as a history command: Undo and Redo put the languages (and the default)
|
|
1108
|
+
* back with the texts that went with them. `renamed` moves the canvas's language along.
|
|
1109
|
+
* The first run writes `after`; an Undo or Redo carries just this entry's change onto the
|
|
1110
|
+
* localization as it stands then ({@link carryLocalization}), so a language added since —
|
|
1111
|
+
* which is no step of the history — is not lost with it.
|
|
1112
|
+
*/
|
|
1113
|
+
private localizationCommand;
|
|
1114
|
+
/**
|
|
1115
|
+
* The `tests` block as a history command: Undo and Redo swap the whole block, so the panel's
|
|
1116
|
+
* Apply, Accept new behaviour and a rename's rewrite are each one step.
|
|
1117
|
+
* The block is replaced rather than carried (as {@link localizationCommand} carries): nothing
|
|
1118
|
+
* else edits it between a step and its undo, because every writer goes through {@link setTests}.
|
|
1119
|
+
*/
|
|
1120
|
+
private testsCommand;
|
|
1121
|
+
/**
|
|
1122
|
+
* Brings the lineage of the languages in step with the committed localization, after it moved
|
|
1123
|
+
* (`move`: by a rename of `move.from` to `move.to`): a rename carries the baseline origin along,
|
|
1124
|
+
* a language gone loses it, and a baseline language that has come back (an Undo of its removal)
|
|
1125
|
+
* takes its own origin again unless a rename already holds it.
|
|
1126
|
+
*/
|
|
1127
|
+
private followLocales;
|
|
1128
|
+
/**
|
|
1129
|
+
* The net change to the form's languages since the baseline: the form as loaded, or as the host
|
|
1130
|
+
* last saved it ({@link markLocalesSaved}). A host keeping per-locale data of its own (a
|
|
1131
|
+
* translation catalog) applies it when it saves the form, so an Undo before that loses
|
|
1132
|
+
* nothing. Empty (both lists) when the languages are as they were.
|
|
1133
|
+
*/
|
|
1134
|
+
localeChangesSinceSave(): LocaleChanges;
|
|
1135
|
+
/** The languages as they stand are the baseline now: the host has saved the form, or has just loaded it. */
|
|
1136
|
+
markLocalesSaved(): void;
|
|
1137
|
+
/**
|
|
1138
|
+
* The committed `FormDefinition.translations` of the form being edited — what a host persists
|
|
1139
|
+
* on the definition beside {@link snapshot} and {@link localization}. The committed object
|
|
1140
|
+
* itself, not a copy: every writer goes through the history, which swaps in a new object,
|
|
1141
|
+
* so a caller treats it as frozen and never mutates it. `undefined` when the form has none.
|
|
1142
|
+
*/
|
|
1143
|
+
translations(): FormTranslations | undefined;
|
|
1144
|
+
/**
|
|
1145
|
+
* What the last load of the map (the `translations` option, {@link replaceTranslations}) left
|
|
1146
|
+
* out: how many values and the addresses of the first few (locale, kind, owner, then property
|
|
1147
|
+
* segments; `[]` is the map itself). A key that differs from a declared language only in case
|
|
1148
|
+
* or `_` against `-` is not left out: it is filed under the declared spelling. For a host to
|
|
1149
|
+
* say what a file it opened lost; the form loads, and a Save writes what was kept.
|
|
1150
|
+
*/
|
|
1151
|
+
translationsDropped(): DroppedTranslations;
|
|
1152
|
+
/** `value` through the tolerant reader against the declared languages, its report kept. */
|
|
1153
|
+
private loadTranslations;
|
|
1154
|
+
/**
|
|
1155
|
+
* Replaces the whole map (read through the tolerant reader, against the declared languages, see
|
|
1156
|
+
* {@link translationsDropped}). A host loading or mirroring it
|
|
1157
|
+
* passes `silent`: stored, announced to no one, no history (a mode's own controller keeps such
|
|
1158
|
+
* a mirror of the form's map). Without `silent` it is an edit of the form like any other: one
|
|
1159
|
+
* undo step, announced as one `change`.
|
|
1160
|
+
*/
|
|
1161
|
+
replaceTranslations(value: FormTranslations | undefined, meta?: {
|
|
1162
|
+
silent?: boolean;
|
|
1163
|
+
}): void;
|
|
1164
|
+
/**
|
|
1165
|
+
* The map as a history command: Undo and Redo put the entries back with the edit that moved
|
|
1166
|
+
* them, or alone. The first run writes `after`; an Undo or Redo carries just this entry's change
|
|
1167
|
+
* onto the map as it stands then ({@link carryChange}), so a translation typed since is not
|
|
1168
|
+
* lost with it.
|
|
1169
|
+
* `undefined` when `after` is the map as it was.
|
|
1170
|
+
*/
|
|
1171
|
+
private translationsCommand;
|
|
1172
|
+
/**
|
|
1173
|
+
* One undo step that runs `update` over the map (pure functions of `translations.ts`: a prune,
|
|
1174
|
+
* a move, a copy, a write). For a mode whose own rule touches its texts (a journey page deleted,
|
|
1175
|
+
* a layout removed) when the step is not one of the controller's own. `false` and no step when
|
|
1176
|
+
* `update` changes nothing.
|
|
1177
|
+
*
|
|
1178
|
+
* `alongside` is a command (or several) the mode's own change of the definition made: it is
|
|
1179
|
+
* composed with the map's command into one history entry, so "journey removed + its entries
|
|
1180
|
+
* pruned" is one Undo that brings both back. The mode has already applied its change when it
|
|
1181
|
+
* calls, so an `alongside` command's first `execute()` must leave things as they are (the
|
|
1182
|
+
* entry's first run is the call itself); its `undo()` and later `execute()` do the work. It is
|
|
1183
|
+
* recorded only when the map changes: a mode whose change is a step of the form's history
|
|
1184
|
+
* either way (a journey or layout removed) records it alone through {@link recordStep} on
|
|
1185
|
+
* `false`. `renamed` lists the ids the update re-keyed, for the change event's `renamedIds`
|
|
1186
|
+
* ({@link BuilderChangeEvent.renamedIds}).
|
|
1187
|
+
*/
|
|
1188
|
+
rewriteTranslations(update: (map: FormTranslations) => FormTranslations, alongside?: BuilderCommand | readonly BuilderCommand[], renamed?: readonly RenamedTextId[]): boolean;
|
|
1189
|
+
/**
|
|
1190
|
+
* A change a mode has already made to a block of the definition it owns (a PDF layout's
|
|
1191
|
+
* condition and sources following a rename), recorded as a step of the form's history so Undo
|
|
1192
|
+
* and Redo take it with the form. `command`'s first `execute()` must leave things as they are,
|
|
1193
|
+
* as `alongside`'s does in {@link rewriteTranslations}. Made while a rename is heard (or
|
|
1194
|
+
* {@link followRename} runs), it joins the rename's own entry instead of making one. A step
|
|
1195
|
+
* of its own is a change of the form's, announced once as `rewriteTranslations`' is ("edit"),
|
|
1196
|
+
* so the bar's Undo and a host following the changes see it; one the rename takes is the
|
|
1197
|
+
* rename's change.
|
|
1198
|
+
*/
|
|
1199
|
+
recordStep(command: BuilderCommand): void;
|
|
1200
|
+
/**
|
|
1201
|
+
* Runs `run` as one action of a mode's (a catalog action, with whatever a host's handler of its
|
|
1202
|
+
* change does meanwhile): the first step {@link recordStep} or {@link rewriteTranslations}
|
|
1203
|
+
* records while it runs is an entry that takes in every later step as one of its parts, a
|
|
1204
|
+
* plain edit of the form's included, so the action is one Undo however many writes it took. A
|
|
1205
|
+
* step made before that first one (a host's edit while the mode reports its change, ahead of
|
|
1206
|
+
* the action's own rewrite) is an entry of its own, under the action's. A part taken in is no
|
|
1207
|
+
* step: it publishes no mutation ({@link mutated}), and one {@link recordStep} records says no
|
|
1208
|
+
* change of its own either, the entry's first change event having told the form's change.
|
|
1209
|
+
*/
|
|
1210
|
+
joinSteps(run: () => void): void;
|
|
1211
|
+
/** Executes `command` as {@link joinSteps} joins it, or as an entry of its own outside a join. */
|
|
1212
|
+
private executeJoining;
|
|
1213
|
+
/** Adds the ids a step re-keyed to what the next change event carries ({@link BuilderChangeEvent.renamedIds}). */
|
|
1214
|
+
private announceRenames;
|
|
1215
|
+
/**
|
|
1216
|
+
* Writes the translations typed in the Languages workspace, an import or an agent as **one**
|
|
1217
|
+
* undo step. Each edit names its language, the text's address and the wording;
|
|
1218
|
+
* an empty `text` deletes the entry. The entry's `source` is the fingerprint of the text's
|
|
1219
|
+
* current default, so it is current when written, unless the edit carries a `source` of its
|
|
1220
|
+
* own (an import row whose file was made against other wording): then the entry is written
|
|
1221
|
+
* with exactly that fingerprint (`writeTranslationEntry`) and so comes in flagged stale
|
|
1222
|
+
* when it is not the current default's. An edit is passed over when the
|
|
1223
|
+
* address names no text of the form (the tree's, the journeys' or the layouts'), when the
|
|
1224
|
+
* language is not one the form declares, or when it is the default language (the default is
|
|
1225
|
+
* the string itself, edited as a property). Returns how many entries were written or deleted.
|
|
1226
|
+
*
|
|
1227
|
+
* `addLocales` declares languages first, in the same history entry (an import that brings new
|
|
1228
|
+
* languages is one Undo, not one per language and one for the entries): the edits are checked
|
|
1229
|
+
* against the languages as they stand after the additions. A code the form already has, or a
|
|
1230
|
+
* malformed one, is passed over like in {@link localizationActions}`.addLocale`. The entry is
|
|
1231
|
+
* made when a language was added even if no entry was written.
|
|
1232
|
+
*/
|
|
1233
|
+
setTranslations(edits: ReadonlyArray<{
|
|
1234
|
+
locale: string;
|
|
1235
|
+
address: TextAddress;
|
|
1236
|
+
text: string;
|
|
1237
|
+
source?: string;
|
|
1238
|
+
}>, options?: {
|
|
1239
|
+
addLocales?: ReadonlyArray<{
|
|
1240
|
+
code: string;
|
|
1241
|
+
label?: string;
|
|
1242
|
+
sourceLocale?: string;
|
|
1243
|
+
}>;
|
|
1244
|
+
}): number;
|
|
1245
|
+
/**
|
|
1246
|
+
* Confirms stale translations against the text's current default without changing what they
|
|
1247
|
+
* say ("this still reads right"), as **one** undo step. Returns how many entries
|
|
1248
|
+
* were confirmed; an address with no entry, or an entry already current, is passed over.
|
|
1249
|
+
*/
|
|
1250
|
+
reconcileTranslations(items: ReadonlyArray<{
|
|
1251
|
+
locale: string;
|
|
1252
|
+
address: TextAddress;
|
|
1253
|
+
}>): number;
|
|
1254
|
+
/**
|
|
1255
|
+
* The default of every text the form words — the tree's and the outside documents' — and of
|
|
1256
|
+
* the engine's own words (their English), by {@link addressKey}.
|
|
1257
|
+
*/
|
|
1258
|
+
private defaultsByAddress;
|
|
1259
|
+
/**
|
|
1260
|
+
* Every text of the form with its default: the tree's ({@link translatableTexts}) and the
|
|
1261
|
+
* journeys' and layouts' (`OutsideDocument.texts`). The list Make default swaps and a
|
|
1262
|
+
* translation's `source` is read against.
|
|
1263
|
+
*/
|
|
1264
|
+
private allTexts;
|
|
1265
|
+
/**
|
|
1266
|
+
* The language list's actions: each changes `localization` and the map together as **one**
|
|
1267
|
+
* undoable step, so a language and its translations cannot drift apart. They return `false`
|
|
1268
|
+
* and change nothing for a code the form does not have (or already has), a blank or malformed
|
|
1269
|
+
* code, or — for the two that rewrite the form's texts, rename and make-default — while the
|
|
1270
|
+
* form's own settings have changes not applied.
|
|
1271
|
+
*/
|
|
1272
|
+
readonly localizationActions: LocalizationActions;
|
|
1273
|
+
/**
|
|
1274
|
+
* Adds a language (one undo step). A form that declares none is given `sourceLocale` first
|
|
1275
|
+
* when it names one other than `code`: the language its strings are written in, which stays
|
|
1276
|
+
* the default.
|
|
1277
|
+
*/
|
|
1278
|
+
private addLocale;
|
|
1279
|
+
/**
|
|
1280
|
+
* `current` with the language added (and `sourceLocale` first, for a form that declares none),
|
|
1281
|
+
* or `undefined` when the code is malformed or taken. Shared by {@link addLocale} and the
|
|
1282
|
+
* additions {@link setTranslations} makes in its one step.
|
|
1283
|
+
*/
|
|
1284
|
+
private localizationWithAdded;
|
|
1285
|
+
/** Names a language (one undo step); `false` for a code the form does not have or a label it already has. */
|
|
1286
|
+
private relabelLocale;
|
|
1287
|
+
/**
|
|
1288
|
+
* Removes a language and its translations (one undo step). The default language can go when
|
|
1289
|
+
* another is left: that one is made the default first, so its wording becomes the strings
|
|
1290
|
+
* (Make default), and the old default's wording goes with the language.
|
|
1291
|
+
*/
|
|
1292
|
+
private removeLocale;
|
|
1293
|
+
/**
|
|
1294
|
+
* Makes `code` the language the strings are written in (one undo step): every text that has a
|
|
1295
|
+
* wording in `code` takes it as its string and keeps the old string as the translation in the
|
|
1296
|
+
* old default (`makeDefaultLocale` in `translations.ts`); a text with no wording in `code`
|
|
1297
|
+
* keeps its string. The configuration, the journeys' and layouts' strings and the map change
|
|
1298
|
+
* together.
|
|
1299
|
+
*/
|
|
1300
|
+
private makeDefaultLocale;
|
|
1301
|
+
/**
|
|
1302
|
+
* What making `to` the default does to the form's texts: the map after
|
|
1303
|
+
* `makeDefaultLocale` over every text, and the commands that write the new default strings
|
|
1304
|
+
* into the tree's configurations and the outside documents. `drafts` are the configuration
|
|
1305
|
+
* edits an open draft of the same component needs so its later Save does not write the old
|
|
1306
|
+
* string straight back.
|
|
1307
|
+
*/
|
|
1308
|
+
private defaultSwapPlan;
|
|
1309
|
+
/**
|
|
1310
|
+
* Runs one language-list change as a single history entry: the languages lead (so a host
|
|
1311
|
+
* hearing a mode's change mid-step reads a definition that already declares them), then the
|
|
1312
|
+
* map, then whatever rewrites the strings. A change that moves nothing but the list is the
|
|
1313
|
+
* list's own entry.
|
|
1314
|
+
*/
|
|
1315
|
+
private runLanguageStep;
|
|
1316
|
+
/**
|
|
1317
|
+
* Renames the language `from` to `to` as **one** undoable step: its translations
|
|
1318
|
+
* move to the new code in the map — the journeys' and layouts' with the form's — the language
|
|
1319
|
+
* keeps its label and, if it was, its place as the default; the canvas's language follows. A
|
|
1320
|
+
* layout's own document language (`accessibility.lang`) is the code as plain text outside
|
|
1321
|
+
* any translation, so it follows too. A host keeping a catalog of its own reads the move at
|
|
1322
|
+
* its Save ({@link localeChangesSinceSave}).
|
|
1323
|
+
* Refused (`false`, nothing changed) for a code the form does not have, a new code already
|
|
1324
|
+
* taken (any case), blank or not a language code (`languageRenameProblem`), or while the form's own settings have changes not applied.
|
|
1325
|
+
*/
|
|
1326
|
+
renameLocale(from: string, to: string): boolean;
|
|
1327
|
+
/**
|
|
1328
|
+
* The canvas and inspector locale, when the form supported it (`before`) and no longer does:
|
|
1329
|
+
* the form's default locale, else the first left. A form left with no languages keeps it.
|
|
1330
|
+
*/
|
|
1331
|
+
private leaveLocaleIfGone;
|
|
1332
|
+
/**
|
|
1333
|
+
* Writes the localization configuration straight to the committed value — the direct path
|
|
1334
|
+
* for a host driving the builder programmatically, and with the Languages workspace's
|
|
1335
|
+
* {@link localizationActions} one of the two writers of the languages. `silent` skips
|
|
1336
|
+
* the change event, for a caller whose tree did not change and who repaints itself (a mode
|
|
1337
|
+
* declaring the form's locales on its own controller).
|
|
1338
|
+
*/
|
|
1339
|
+
setLocalization(value: LocalizationConfiguration | undefined, meta?: {
|
|
1340
|
+
silent?: boolean;
|
|
1341
|
+
}): void;
|
|
1342
|
+
/**
|
|
1343
|
+
* Replaces the form's `tests` block. The value is normalised ({@link
|
|
1344
|
+
* normalizeTestsConfiguration}) and compared with the block held; a different one is an edit
|
|
1345
|
+
* of the form with its own history step, announced as one `change` with reason `"edit"` (the
|
|
1346
|
+
* Tests panel re-runs on it, a host persists on it). `silent` is the shell's initial feed from
|
|
1347
|
+
* a host's `tests` property: it stores the value and announces nothing, adds no history entry,
|
|
1348
|
+
* and leaves the undo stack as it was, as {@link setLocalization} does for a mode's mirror.
|
|
1349
|
+
*/
|
|
1350
|
+
setTests(value: FormTestConfiguration | undefined, meta?: {
|
|
1351
|
+
silent?: boolean;
|
|
1352
|
+
}): void;
|
|
1353
|
+
/**
|
|
1354
|
+
* The committed {@link FormIdentity} of the form being edited — what Save has written, and
|
|
1355
|
+
* what a host persists as the definition's `id`, `version` and `schemaVersion` beside
|
|
1356
|
+
* {@link snapshot}. `undefined` when the host handed the builder no identity to edit.
|
|
1357
|
+
*/
|
|
1358
|
+
identity(): FormIdentity | undefined;
|
|
1359
|
+
/**
|
|
1360
|
+
* The identity as the author currently sees it: the form root's uncommitted draft when one
|
|
1361
|
+
* is open, else the committed value. The Form panel's Identity section renders from this.
|
|
1362
|
+
*/
|
|
1363
|
+
draftIdentity(): FormIdentity | undefined;
|
|
1364
|
+
/**
|
|
1365
|
+
* What is wrong with the identity as the author currently sees it, by field, in words: an id
|
|
1366
|
+
* or version longer than the kernel stores. Save refuses while there is one, so a form is never
|
|
1367
|
+
* written that Open would refuse. Empty when the identity is fine or there is none.
|
|
1368
|
+
*/
|
|
1369
|
+
identityProblems(): {
|
|
1370
|
+
id?: string;
|
|
1371
|
+
version?: string;
|
|
1372
|
+
};
|
|
1373
|
+
/**
|
|
1374
|
+
* Buffers an edit to the form's identity through the root's draft, so Save / Cancel govern
|
|
1375
|
+
* it like every other form-root property. Whitespace is kept while drafting (the panel
|
|
1376
|
+
* repaints its boxes from here per keystroke); Save trims, and a field left blank keeps
|
|
1377
|
+
* its committed value. Ignored while the builder has no identity to edit.
|
|
1378
|
+
*/
|
|
1379
|
+
setDraftIdentity(value: FormIdentity): void;
|
|
1380
|
+
/**
|
|
1381
|
+
* Writes the identity straight to the committed value — the direct path for a host driving
|
|
1382
|
+
* the builder programmatically ({@link setDraftIdentity} is the panel's). An open root
|
|
1383
|
+
* draft is kept in step so the panel does not fall behind. `undefined` takes the Identity
|
|
1384
|
+
* section away again.
|
|
1385
|
+
*/
|
|
1386
|
+
setIdentity(value: FormIdentity | undefined, meta?: {
|
|
1387
|
+
silent?: boolean;
|
|
1388
|
+
}): void;
|
|
1389
|
+
/** The design-system bindings the host offers the canvas; empty when it offers none. */
|
|
1390
|
+
availableBindings(): BuilderBindingOption[];
|
|
1391
|
+
/**
|
|
1392
|
+
* Id of the binding the canvas draws with: the picker's choice, else the host's binding when it
|
|
1393
|
+
* is one the picker offers (by id, or the very object an entry carries). `undefined` while
|
|
1394
|
+
* the canvas draws with a binding the picker does not list, or with Datum's own and the
|
|
1395
|
+
* picker offers no `"datum"` entry.
|
|
1396
|
+
*/
|
|
1397
|
+
bindingId(): string | undefined;
|
|
1398
|
+
/**
|
|
1399
|
+
* Draws the canvas with one of the offered bindings (`undefined`: the host's own, else
|
|
1400
|
+
* Datum's). A `"preview"` change: the tree is untouched, and nothing is written into the form
|
|
1401
|
+
* or its PDF layouts. An id nobody offered is ignored.
|
|
1402
|
+
*/
|
|
1403
|
+
setBindingId(id: string | undefined): void;
|
|
1404
|
+
/** The binding chosen, before the builder's scheme: the picker's entry, else the host's. */
|
|
1405
|
+
private chosenBinding;
|
|
1406
|
+
/** A binding as the picker or the registry knows it, for its `darkVariant` and label. */
|
|
1407
|
+
private bindingObject;
|
|
1408
|
+
/**
|
|
1409
|
+
* A binding as the builder's scheme draws it: while the builder is dark, the binding named as
|
|
1410
|
+
* its `darkVariant` (an offered entry, else one registered on the page); else itself. Datum's
|
|
1411
|
+
* own dark look is no other binding: it is the dark colour scheme ({@link canvasColorScheme}).
|
|
1412
|
+
*/
|
|
1413
|
+
private underScheme;
|
|
1414
|
+
/**
|
|
1415
|
+
* What the canvas's form element draws with ({@link chosenBinding} under the builder's scheme):
|
|
1416
|
+
* a binding, a registered id, or `undefined` for Datum's. The canvas lays
|
|
1417
|
+
* {@link canvasComponents} over it. Never written into the form.
|
|
1418
|
+
*/
|
|
1419
|
+
canvasBinding(): LiveBinding | string | undefined;
|
|
1420
|
+
/**
|
|
1421
|
+
* The colour scheme the canvas draws in: dark while the builder is dark and the canvas draws
|
|
1422
|
+
* with Datum's binding (whose dark look is its dark scheme) or with a binding's dark variant;
|
|
1423
|
+
* light for a binding that has no dark look, which shows as itself.
|
|
1424
|
+
*/
|
|
1425
|
+
canvasColorScheme(): "light" | "dark";
|
|
1426
|
+
/**
|
|
1427
|
+
* The design system's files the canvas draws with: the offered entry's own `assets` for the
|
|
1428
|
+
* binding drawn (or the entry picked, when the builder's scheme draws its dark variant), else
|
|
1429
|
+
* the host's `assets` while the canvas draws the host's own binding, else none. A pick of
|
|
1430
|
+
* Datum's or another design system's binding never draws with the host's files.
|
|
1431
|
+
*/
|
|
1432
|
+
canvasAssets(): LiveAssets | undefined;
|
|
1433
|
+
/** Adapters laid over the canvas's binding for this tree's own types (a designer's); `undefined` for none. */
|
|
1434
|
+
canvasComponents(): Readonly<Record<string, AdapterEntry>> | undefined;
|
|
1435
|
+
/**
|
|
1436
|
+
* The canvas lends the controller its account of how the form is drawn (the mounted form's
|
|
1437
|
+
* adapters and the binding's capability answers) so the inspector can say which adapter draws
|
|
1438
|
+
* the selection and leave out the settings the binding does not draw. Silent: the canvas
|
|
1439
|
+
* calls {@link drawingChanged} once a draw has landed and moved what the inspector reads.
|
|
1440
|
+
*/
|
|
1441
|
+
setDrawingSource(source: BuilderDrawingSource | undefined): void;
|
|
1442
|
+
/** Tells whoever listens to `drawing` that how the selection is drawn moved, so the inspector reads it again. */
|
|
1443
|
+
drawingChanged(): void;
|
|
1444
|
+
/**
|
|
1445
|
+
* How the form is drawn for `componentId`, as the inspector reads it: the adapter that drew it
|
|
1446
|
+
* and what the surface answers for its type. `undefined` without a source from the canvas.
|
|
1447
|
+
*/
|
|
1448
|
+
drawingOf(componentId: string | undefined): {
|
|
1449
|
+
adapter: InspectorDrawnBy | undefined;
|
|
1450
|
+
answers: ReturnType<BuilderDrawingSource["capabilitiesOf"]>;
|
|
1451
|
+
binding: string;
|
|
1452
|
+
} | undefined;
|
|
1453
|
+
/**
|
|
1454
|
+
* The line the inspector shows above the sections: which adapter draws the component and
|
|
1455
|
+
* whose it is. Empty before the canvas has drawn it, for the root (no adapter of its own) and
|
|
1456
|
+
* without a source.
|
|
1457
|
+
*/
|
|
1458
|
+
drawnByLine(componentId: string | undefined): string | undefined;
|
|
1459
|
+
/**
|
|
1460
|
+
* The notes beside the settings the binding does not draw in full: a reduced one says how, and
|
|
1461
|
+
* a setting the binding does not draw that the component still holds says the value is kept.
|
|
1462
|
+
* Read off the inspector model, so the boxes and the notes cannot disagree.
|
|
1463
|
+
*/
|
|
1464
|
+
private drawingNotes;
|
|
1465
|
+
/**
|
|
1466
|
+
* The binding picker's entries: the offered bindings, each named as the canvas draws it under
|
|
1467
|
+
* the builder's scheme, and the one the canvas draws with marked. While the builder is dark, a
|
|
1468
|
+
* binding with a dark variant reads under the variant's name (the offered entry's label, else
|
|
1469
|
+
* the binding's own) and the variant's own entry is left out: the two would draw the same form.
|
|
1470
|
+
* Choosing an entry picks its `id`, so a pick made in a dark builder is the light binding, and
|
|
1471
|
+
* the form follows the builder back to light.
|
|
1472
|
+
*/
|
|
1473
|
+
bindingChoices(): BuilderBindingChoice[];
|
|
1474
|
+
/**
|
|
1475
|
+
* The builder's own colour scheme, from the shell. A `"preview"` change when it moves what the
|
|
1476
|
+
* canvas draws ({@link canvasBinding}, {@link canvasColorScheme}); silent for a binding with no
|
|
1477
|
+
* dark look.
|
|
1478
|
+
*/
|
|
1479
|
+
setPreviewScheme(scheme: "light" | "dark"): void;
|
|
1480
|
+
/** The builder's own colour scheme, as the shell last reported it. */
|
|
1481
|
+
previewScheme(): "light" | "dark";
|
|
1482
|
+
/**
|
|
1483
|
+
* The classes the chosen binding declares (`LiveBinding.cssClasses`) that apply to a component,
|
|
1484
|
+
* for the inspector's Style tab: a toggle each, or one choice among the classes of a group.
|
|
1485
|
+
* Only the classes that name no type are offered without a component. Datum's own binding, when
|
|
1486
|
+
* no object stands for it, declares the shared panel looks, as `createDatumBinding()` does.
|
|
1487
|
+
*/
|
|
1488
|
+
styleOptions(componentId?: string): CssClassChoice[];
|
|
1489
|
+
/**
|
|
1490
|
+
* Ticks or clears one of the Style tab's classes in the component's draft in a single write:
|
|
1491
|
+
* ticking a class of a group takes the others of that group away with it, so undoing the edit
|
|
1492
|
+
* (after Save) brings the component back as it was in one step. `live` marks a write whose
|
|
1493
|
+
* panel keeps its own markup (see {@link setDraftProperty}).
|
|
1494
|
+
*/
|
|
1495
|
+
setStyleClass(componentId: string, name: string, on: boolean, meta?: {
|
|
1496
|
+
live?: boolean;
|
|
1497
|
+
}): void;
|
|
1498
|
+
/** Takes every class of `group` off the component's draft: the way back to the binding's default look. */
|
|
1499
|
+
clearStyleGroup(componentId: string, group: string, meta?: {
|
|
1500
|
+
live?: boolean;
|
|
1501
|
+
}): void;
|
|
1502
|
+
/**
|
|
1503
|
+
* The vocabulary a component's `cssClass` is checked against: the class names the chosen binding
|
|
1504
|
+
* declares plus the shared panel looks, which every binding accepts. Empty, so no vocabulary,
|
|
1505
|
+
* when the binding declares no class beyond those looks: the GC Design System's and Datum's own
|
|
1506
|
+
* (an object, or the default with none) all draw the looks and name nothing else, so a class a
|
|
1507
|
+
* page's CSS gives a meaning to is not a mistake there ({@link bindingClassVocabulary}).
|
|
1508
|
+
*/
|
|
1509
|
+
cssClassNames(): string[];
|
|
1510
|
+
/** What declares the classes: the chosen binding, else Datum's own, whose declaration is the shared panel looks. */
|
|
1511
|
+
private declaringBinding;
|
|
1512
|
+
/** The chosen binding as an object (an id resolved through the picker's entries, else the page's registry); `undefined` for Datum's own. */
|
|
1513
|
+
private chosenBindingObject;
|
|
1514
|
+
/**
|
|
1515
|
+
* How the component definitions' own types are drawn (`ComponentDefinition.adapter`): their adapters and stylesheets, which the canvas lays
|
|
1516
|
+
* over the binding it draws with under any designer's own ({@link canvasComponents}). `context` is what an adapter factory is
|
|
1517
|
+
* called with (the canvas's lit namespace and Datum binding); without it a factory draws
|
|
1518
|
+
* nothing. `undefined` when no definition brings one. The same object until the definitions
|
|
1519
|
+
* change.
|
|
1520
|
+
*/
|
|
1521
|
+
componentDrawing(context?: ComponentAdapterContext): ComponentDrawing | undefined;
|
|
1522
|
+
/** Checks the edited (draft-or-committed) `cssClass` of one component. */
|
|
1523
|
+
private checkCssClassesFor;
|
|
1524
|
+
/** Re-runs the cssClass checks for the selection — after an edit, or a binding swap. */
|
|
1525
|
+
private refreshCssClassChecks;
|
|
1526
|
+
/** Resolver backing `select` options in the canvas preview, if the host supplied one. */
|
|
1527
|
+
dataSourceResolver(): DataSourceResolver | undefined;
|
|
1528
|
+
/**
|
|
1529
|
+
* The data sources the canvas previews with: the host's wiring-time set, with the author's
|
|
1530
|
+
* simulated lists laid over it (a simulated id wins over the host's own).
|
|
1531
|
+
*/
|
|
1532
|
+
dataSources(): DataSourceSet | undefined;
|
|
1533
|
+
/** Every data source id the inspector's picker offers: the wired set's, the host's extra ids, then the simulated ones. */
|
|
1534
|
+
dataSourceIds(): string[];
|
|
1535
|
+
/** The host's own data source ids, without the simulated ones: what the Settings panel says the host provides. */
|
|
1536
|
+
hostDataSourceIdList(): string[];
|
|
1537
|
+
/** The author's simulated lists, by data source id. */
|
|
1538
|
+
simulatedDataSources(): ReadonlyMap<string, DataSourceResult["items"]>;
|
|
1539
|
+
/**
|
|
1540
|
+
* Tries the form with `items` in place of data source `id` (the Settings panel's simulator), or
|
|
1541
|
+
* stops with `undefined`. The canvas previews it at once; the definition never holds it.
|
|
1542
|
+
*/
|
|
1543
|
+
setSimulatedDataSource(id: string, items: DataSourceResult["items"] | undefined): void;
|
|
1544
|
+
/** What Submit does while the author tries the form: a stand-in for the page's server. */
|
|
1545
|
+
trySubmission(): TrySubmissionSettings;
|
|
1546
|
+
/**
|
|
1547
|
+
* Changes some of what Submit does in Try it, the rest kept; each value is kept to what it may
|
|
1548
|
+
* be (the delay to 0 to 10000 ms, a placement to the top, the bottom or both). Session state,
|
|
1549
|
+
* as the simulated data sources are: the definition never holds it.
|
|
1550
|
+
*/
|
|
1551
|
+
setTrySubmission(update: TrySubmissionUpdate): void;
|
|
1552
|
+
/**
|
|
1553
|
+
* The host values the author gave Try it's Settings: what the form's rules read under `host.`
|
|
1554
|
+
* while it is previewed (plain JSON data, as `plainHostContext` keeps it); `undefined` when none.
|
|
1555
|
+
*/
|
|
1556
|
+
tryHostContext(): Record<string, unknown> | undefined;
|
|
1557
|
+
/**
|
|
1558
|
+
* Gives the preview these host values, or none with `undefined`. Session state, as the
|
|
1559
|
+
* simulated data sources and the stand-in server are: the definition never holds it, the change
|
|
1560
|
+
* is a `"preview"` one (never an edit, so nothing to undo), and the canvas computes the rules
|
|
1561
|
+
* again over the answers typed. A record equal to the one held changes nothing.
|
|
1562
|
+
*/
|
|
1563
|
+
setTryHostContext(context: Record<string, unknown> | undefined): void;
|
|
1564
|
+
/** The frames the form can sit in under the chosen binding, labelled for the locale. */
|
|
1565
|
+
frameChoices(): Array<{
|
|
1566
|
+
id: string;
|
|
1567
|
+
label: string;
|
|
1568
|
+
}>;
|
|
1569
|
+
/** The frame presets the chosen binding adds to the built-ins (`LiveBinding.frames`): a Datum binding's `frame` option. */
|
|
1570
|
+
private chosenFrames;
|
|
1571
|
+
/** Lends the controller the host's translation catalog (undefined: none), so labels it keys resolve as the form resolves them. */
|
|
1572
|
+
setTranslationCatalog(catalog: TranslationCatalog | (() => TranslationCatalog | undefined) | undefined): void;
|
|
1573
|
+
/**
|
|
1574
|
+
* Lends the controller the builder's own words (the host's `textCatalog` and the builder's
|
|
1575
|
+
* text locale) for the messages it makes itself: the class-name checks that reach the
|
|
1576
|
+
* Inspector and Save, the labels the catalog lists. Absent: English, in the form's locale.
|
|
1577
|
+
*/
|
|
1578
|
+
setTextWords(words: {
|
|
1579
|
+
locale?: string | undefined;
|
|
1580
|
+
catalog?: BuilderTextCatalog | (() => BuilderTextCatalog | undefined) | undefined;
|
|
1581
|
+
}): void;
|
|
1582
|
+
private textLocaleValue;
|
|
1583
|
+
private textCatalogValue;
|
|
1584
|
+
/** The builder's words for what this controller words itself. */
|
|
1585
|
+
private builderWords;
|
|
1586
|
+
/** What a text resolves through here: the form's own translations, then the host's catalog. */
|
|
1587
|
+
private labelSources;
|
|
1588
|
+
/** The catalog lent now (a lent function is asked each time, so the host's latest shows). */
|
|
1589
|
+
translationCatalog(): TranslationCatalog | undefined;
|
|
1590
|
+
/** The host chrome the canvas previews under: a frame, the form's own parts kept or left out, its language switcher. */
|
|
1591
|
+
previewChrome(): FormChromeConfiguration | undefined;
|
|
1592
|
+
setPreviewChrome(value: FormChromeConfiguration | undefined): void;
|
|
1593
|
+
/** The validation codes the host named for the messages editor, as given. */
|
|
1594
|
+
validationCodes(): HostValidationCode[];
|
|
1595
|
+
/**
|
|
1596
|
+
* The committed tree — what Save has written, and what a host should persist. Its nodes are
|
|
1597
|
+
* fresh copies, but their `configuration` and `rules` objects are the tree's own (a deep copy
|
|
1598
|
+
* on every change would cost a keystroke several times over): a host must never write into a
|
|
1599
|
+
* snapshot, and copies one it keeps as it is (`structuredClone`), since an edit made in place
|
|
1600
|
+
* later (`setProperty`) shows in it.
|
|
1601
|
+
*/
|
|
1602
|
+
snapshot(): ComponentNode;
|
|
1603
|
+
/**
|
|
1604
|
+
* The `kinds` map of the definition the host has open (the entries its own file carries), read
|
|
1605
|
+
* each time it is wanted: a host that opens or seeds definitions sets it once (`() => opened.kinds`).
|
|
1606
|
+
* Try it passes it to {@link definitionKinds} as `current`, so it checks a type the page's
|
|
1607
|
+
* catalogue does not offer as the saved file, the runtime and a server do. Unset: no file's map.
|
|
1608
|
+
*/
|
|
1609
|
+
openedKinds: (() => Readonly<Record<string, string>> | undefined) | undefined;
|
|
1610
|
+
/**
|
|
1611
|
+
* The `kinds` map the form saves with: an entry for every type the committed tree
|
|
1612
|
+
* uses that the engine does not know, naming the engine type it reads as. The base comes from
|
|
1613
|
+
* the component definitions' own `base` (a plugin's types), then the binding the canvas draws
|
|
1614
|
+
* with, then every other binding the picker offers or the page registered (a tier-2 type such
|
|
1615
|
+
* as `gcds-date`), else the entry `current` (the map the form was loaded with) gives it.
|
|
1616
|
+
* Entries for types the form no longer uses go. What the host's save writes, so validation, the
|
|
1617
|
+
* sandbox and the PDF read the type as its base without the plugin's or binding's code.
|
|
1618
|
+
* `current` itself when nothing changes; `undefined` when the form needs no entry.
|
|
1619
|
+
*/
|
|
1620
|
+
definitionKinds(current?: Readonly<Record<string, string>>): Record<string, string> | undefined;
|
|
1621
|
+
/** The type-to-base map the component definitions, the chosen binding, the picker's bindings and the page's registered ones offer. */
|
|
1622
|
+
private kindsOffered;
|
|
1623
|
+
/**
|
|
1624
|
+
* The tree as the author currently sees it: committed, with every uncommitted draft laid
|
|
1625
|
+
* over it. The canvas previews from this so typing a label is visible immediately, while the
|
|
1626
|
+
* snapshot a host reads stays exactly what Save has written.
|
|
1627
|
+
*
|
|
1628
|
+
* A pending id rename is deliberately *not* applied — selection, drop targets and any rule
|
|
1629
|
+
* referencing the field all address it by its committed id until the rename actually lands.
|
|
1630
|
+
*/
|
|
1631
|
+
previewSnapshot(): ComponentNode;
|
|
1632
|
+
/**
|
|
1633
|
+
* What the canvas draws: {@link previewSnapshot}, through the tree owner's
|
|
1634
|
+
* {@link BuilderControllerOptions.canvasRoot} when it has one.
|
|
1635
|
+
*/
|
|
1636
|
+
canvasSnapshot(): ComponentNode;
|
|
1637
|
+
/**
|
|
1638
|
+
* The tree view the canvas walks, marks drop zones from and names the selection by: with a
|
|
1639
|
+
* {@link BuilderControllerOptions.canvasView} hook, the view of {@link canvasSnapshot} built as
|
|
1640
|
+
* {@link treeView} builds its own (resolver, locale, labeler, label sources) and handed through
|
|
1641
|
+
* the hook; without one, {@link treeView} itself.
|
|
1642
|
+
*/
|
|
1643
|
+
canvasTreeView(): NestedTreeNodeView;
|
|
1644
|
+
/** The id of the root the canvas draws: {@link canvasSnapshot}'s with a {@link BuilderControllerOptions.canvasView} hook, else {@link rootId}. */
|
|
1645
|
+
canvasRootId(): string;
|
|
1646
|
+
/** The journey page the canvas draws its tree as ({@link BuilderControllerOptions.canvasJourneyView}); `undefined`: the whole form. */
|
|
1647
|
+
canvasJourneyView(): JourneyView | undefined;
|
|
1648
|
+
/** The words on drawn components' boxes ({@link BuilderControllerOptions.canvasTags}); `undefined`: none. */
|
|
1649
|
+
canvasTags(): ReadonlyMap<string, string> | undefined;
|
|
1650
|
+
/** What the page's own chrome on the canvas selects ({@link BuilderControllerOptions.canvasRegionOwner}); `undefined`: nothing. */
|
|
1651
|
+
canvasRegionOwner(): CanvasRegionOwner | undefined;
|
|
1652
|
+
/** The step picker the canvas bar shows ({@link BuilderControllerOptions.canvasStepper}); `undefined`: the tree's own steps container. */
|
|
1653
|
+
canvasStepper(): CanvasStepper | undefined;
|
|
1654
|
+
/** The drawn ids a click selects another for ({@link BuilderControllerOptions.canvasSelectTarget}); `undefined`: every id is its own. */
|
|
1655
|
+
canvasSelectTargets(): ReadonlyMap<string, string> | undefined;
|
|
1656
|
+
/**
|
|
1657
|
+
* Bumped each time {@link BuilderControllerOptions.canvasRoot}, `canvasView` or
|
|
1658
|
+
* `canvasJourneyView` is swapped for another: the canvas draws a sheet of another kind over the
|
|
1659
|
+
* same controller, and takes its renderer off the runtime so it is drawn once, whole. Never
|
|
1660
|
+
* bumped by an edit, a selection or any other option.
|
|
1661
|
+
*/
|
|
1662
|
+
canvasRevision(): number;
|
|
1663
|
+
/**
|
|
1664
|
+
* Bumped by every change this controller announces (an edit, a draft, a selection, a repaint,
|
|
1665
|
+
* new options), so what is worked out from its tree can be kept until the next one. Only ever
|
|
1666
|
+
* grows; compare for equality.
|
|
1667
|
+
*/
|
|
1668
|
+
changeRevision(): number;
|
|
1669
|
+
/** Id of the form root node — pass to {@link select} to edit form-level properties. */
|
|
1670
|
+
rootId(): string;
|
|
1671
|
+
isRootSelected(): boolean;
|
|
1672
|
+
selectedComponentId(): string | undefined;
|
|
1673
|
+
selectedNode(): ComponentNode | undefined;
|
|
1674
|
+
/**
|
|
1675
|
+
* The component with its uncommitted draft applied — what a properties panel edits and what
|
|
1676
|
+
* Save would write. {@link selectedNode} stays the committed selection.
|
|
1677
|
+
*
|
|
1678
|
+
* The subject is explicit. The panels each name their own: the inspector asks for
|
|
1679
|
+
* the selection and draws nothing without one, the Form panel asks for {@link rootId}. The
|
|
1680
|
+
* root is a *place* an author goes, not what the inspector falls back to while nothing is
|
|
1681
|
+
* selected, so there is no longer one "inspected component" the controller can name — both
|
|
1682
|
+
* panels may hold a draft at once, and {@link drafts} has always allowed that.
|
|
1683
|
+
*/
|
|
1684
|
+
editedNode(componentId?: string | undefined): ComponentNode | undefined;
|
|
1685
|
+
treeView(): NestedTreeNodeView;
|
|
1686
|
+
/**
|
|
1687
|
+
* How the inspector draws `componentId`'s ID row, when the tree's owner says (see
|
|
1688
|
+
* {@link BuilderControllerOptions.idRow}); `undefined` for the builder's default.
|
|
1689
|
+
*/
|
|
1690
|
+
idRow(componentId: string | undefined): BuilderIdRow | undefined;
|
|
1691
|
+
/**
|
|
1692
|
+
* Capabilities the registered definition declares for a type. These are what
|
|
1693
|
+
* `composePropertyEditor` composes the inspector from; a type declaring none falls back to
|
|
1694
|
+
* the engine's default label / description / required trio.
|
|
1695
|
+
*/
|
|
1696
|
+
private capabilitiesFor;
|
|
1697
|
+
/**
|
|
1698
|
+
* Whether a component of `type` offers Required: its registered definition
|
|
1699
|
+
* declares the `required` capability, or declares none — the inspector then falls back to the
|
|
1700
|
+
* engine's label / description / required trio. What the Rules tab reads before offering
|
|
1701
|
+
* "Required when": a plugin's display component (a link, a notice, a heading) declares other
|
|
1702
|
+
* capabilities and no `required`, holds no answer, and a rule on it would refuse every
|
|
1703
|
+
* submission while it held — which the kernel, having no registry, cannot know. Without a
|
|
1704
|
+
* registry every type offers it.
|
|
1705
|
+
*/
|
|
1706
|
+
typeOffersRequired(type: string): boolean;
|
|
1707
|
+
/** The inspector model for `componentId` (default: the selection); see {@link editedNode}. */
|
|
1708
|
+
inspectorModel(componentId?: string | undefined): InspectorModel | undefined;
|
|
1709
|
+
/**
|
|
1710
|
+
* The inspector model for `node`: what {@link inspectorModel} answers for a node in the tree,
|
|
1711
|
+
* and {@link typeInfo} for a type's template under an unused id.
|
|
1712
|
+
*/
|
|
1713
|
+
private composeInspectorModel;
|
|
1714
|
+
/** `editor` with the boxes the tree's owner adds for `node` ({@link BuilderControllerOptions.inspectorFields}), each in its section. */
|
|
1715
|
+
private withInspectorFields;
|
|
1716
|
+
/** The inspector model's `drawing` for `node`: what the canvas's binding answers for its type, once the canvas lends it. */
|
|
1717
|
+
private drawingFor;
|
|
1718
|
+
/** The inspector model's `fieldChoices` for `node`, when the tree's owner supplies them. */
|
|
1719
|
+
private fieldChoicesFor;
|
|
1720
|
+
/** The inspector model's folded sections and placeholders for `node`, when the tree's owner says. */
|
|
1721
|
+
private presentationFor;
|
|
1722
|
+
/** Whether the registry has a definition for the type; without a registry, every type is the tree editor's to keep. */
|
|
1723
|
+
private knowsType;
|
|
1724
|
+
/**
|
|
1725
|
+
* Every translatable text of the committed form, component by component in tree order, as the
|
|
1726
|
+
* inspector would edit it — the label, description, placeholder, tooltip or pattern message
|
|
1727
|
+
* each component *declares*, whether or not the author has written it yet — and the texts
|
|
1728
|
+
* beside the declared fields: the validation messages a component (or the form) words, a tabs
|
|
1729
|
+
* container's captions, an inline option's label and description, and the form's header and
|
|
1730
|
+
* footer parts. Each carries its string in the default language and the address its
|
|
1731
|
+
* translations live at. What the Languages workspace lists, so it agrees with the
|
|
1732
|
+
* builder's own inspector rather than with a walk over the configuration, which cannot see a
|
|
1733
|
+
* text nobody typed. Committed, not drafted: translations are made against the form the
|
|
1734
|
+
* renderer shows. The journeys' and layouts' texts are their modes' to list.
|
|
1735
|
+
*/
|
|
1736
|
+
translatableTexts(): TranslatableText[];
|
|
1737
|
+
/**
|
|
1738
|
+
* The translatable texts of `root` and every component under it, as {@link translatableTexts}
|
|
1739
|
+
* lists the form's — each type's declared texts, read through this controller's registry —
|
|
1740
|
+
* for a tree that is not this one: a presentation's own nodes, whose types are the form's. `group` is the catalog group every row is listed under (its `componentId`, which
|
|
1741
|
+
* must name no form component) and `groupLabel` what the group is called. The addresses are
|
|
1742
|
+
* those of a component with the node's id; whoever owns the tree overrides them with its own.
|
|
1743
|
+
*/
|
|
1744
|
+
translatableTextsOf(root: ComponentNode, options?: {
|
|
1745
|
+
group?: string | undefined;
|
|
1746
|
+
groupLabel?: string | undefined;
|
|
1747
|
+
}): TranslatableText[];
|
|
1748
|
+
private textsOf;
|
|
1749
|
+
/** Reads a component's committed configuration value at `propertyPath` (dot notation). */
|
|
1750
|
+
getProperty(componentId: string, propertyPath: string): unknown;
|
|
1751
|
+
/** Creates the draft for `componentId` from its committed state, if there isn't one yet. */
|
|
1752
|
+
private ensureDraft;
|
|
1753
|
+
/**
|
|
1754
|
+
* Whether `componentId` has edits waiting to be saved — or, with no id, whether *any*
|
|
1755
|
+
* component has. The panels each ask about their own subject; a host asking
|
|
1756
|
+
* "is anything unsaved here" means the whole builder, which is both panels and any draft
|
|
1757
|
+
* left open on a component neither is showing.
|
|
1758
|
+
*/
|
|
1759
|
+
hasPendingChanges(componentId?: string): boolean;
|
|
1760
|
+
/** The drafted {@link BuilderRootSetting} values that differ from what their owners hold now. */
|
|
1761
|
+
private changedRootSettings;
|
|
1762
|
+
/**
|
|
1763
|
+
* A {@link BuilderRootSetting} as the author currently sees it: the root draft's pending
|
|
1764
|
+
* value when one is drafted, else what its owner holds.
|
|
1765
|
+
*/
|
|
1766
|
+
draftRootSetting(setting: BuilderRootSetting): string;
|
|
1767
|
+
/**
|
|
1768
|
+
* Buffers a value for a {@link BuilderRootSetting} on the form root's draft, so the Form
|
|
1769
|
+
* panel's Save and Cancel govern it with the root's own properties.
|
|
1770
|
+
*/
|
|
1771
|
+
setDraftRootSetting(setting: BuilderRootSetting, value: string): void;
|
|
1772
|
+
/** Reads a draft configuration value, falling back to the committed one. */
|
|
1773
|
+
draftProperty(componentId: string, propertyPath: string): unknown;
|
|
1774
|
+
/**
|
|
1775
|
+
* Buffers a configuration edit. Nothing reaches the tree until {@link commitDraft}. `live`
|
|
1776
|
+
* marks a write made under a control still being typed into (see {@link setDraftRules}).
|
|
1777
|
+
*/
|
|
1778
|
+
setDraftProperty(componentId: string, propertyPath: string, value: unknown, meta?: {
|
|
1779
|
+
live?: boolean;
|
|
1780
|
+
}): void;
|
|
1781
|
+
/**
|
|
1782
|
+
* Whether `value` is what the panel shows for `propertyPath` while the node sets nothing there:
|
|
1783
|
+
* its field's declared default when it has one, else a blank — nothing, an empty box, an
|
|
1784
|
+
* unticked switch.
|
|
1785
|
+
*/
|
|
1786
|
+
private showsAsUnset;
|
|
1787
|
+
/** The rules the Rules tab is editing — draft first, then committed. */
|
|
1788
|
+
draftRules(componentId: string): ComponentRules | undefined;
|
|
1789
|
+
/**
|
|
1790
|
+
* Buffers a whole-rules replacement. See {@link draftRules}. `live` marks a write made under
|
|
1791
|
+
* a formula box the author is still typing into: the change event carries `live`, so the
|
|
1792
|
+
* panel that made it refreshes in place and the canvas waits for the plain `edit` the panel
|
|
1793
|
+
* sends when the author leaves the box (the draft always holds what the box holds,
|
|
1794
|
+
* parseable or not; {@link problemsOf} says when it does not parse).
|
|
1795
|
+
*/
|
|
1796
|
+
setDraftRules(componentId: string, rules: ComponentRules | undefined, meta?: {
|
|
1797
|
+
live?: boolean;
|
|
1798
|
+
}): void;
|
|
1799
|
+
/** The pending id for `componentId`, which is its committed id until one is typed. */
|
|
1800
|
+
draftId(componentId: string): string;
|
|
1801
|
+
/**
|
|
1802
|
+
* Buffers an id rename, validating eagerly so the author sees a clash or a malformed id
|
|
1803
|
+
* while typing rather than being refused at Save.
|
|
1804
|
+
*/
|
|
1805
|
+
setDraftId(componentId: string, nextIdRaw: string): void;
|
|
1806
|
+
private validateId;
|
|
1807
|
+
/**
|
|
1808
|
+
* Everything holding back a Save of `componentId`'s draft, in the order a panel lists them:
|
|
1809
|
+
* a pending id that cannot be used, a CSS class the renderer would drop, a data key that is
|
|
1810
|
+
* unusable or clashes, then what the tree's owner checks of the properties the
|
|
1811
|
+
* draft changes (`BuilderControllerOptions.problems`). Kept per component — the Form panel asks about the root
|
|
1812
|
+
* and the inspector about the selection, and neither is held back by the other's problem.
|
|
1813
|
+
* Empty for a component with nothing wrong, or none at all.
|
|
1814
|
+
*/
|
|
1815
|
+
problemsOf(componentId: string | undefined): BuilderProblem[];
|
|
1816
|
+
/** How many components of the committed tree carry `componentId` (counted once per revision). */
|
|
1817
|
+
private twinCount;
|
|
1818
|
+
/**
|
|
1819
|
+
* {@link identityProblems} as `identity.id` / `identity.version` problems of the form root, so
|
|
1820
|
+
* the Save that {@link commitDraft} would refuse leads to them like every other held-back Save
|
|
1821
|
+
* instead of doing nothing.
|
|
1822
|
+
*/
|
|
1823
|
+
private identityProblemsFor;
|
|
1824
|
+
/**
|
|
1825
|
+
* The settings and rules of `componentId`'s draft that would nest the form past
|
|
1826
|
+
* {@link NESTING_MAX} where the component now sits. Each was measured where it was typed, but a
|
|
1827
|
+
* move since may have put the component deeper; what the draft holds unchanged moved with the
|
|
1828
|
+
* committed tree, which never nests past the limit, so only a changed value can be at fault.
|
|
1829
|
+
*/
|
|
1830
|
+
private nestingProblemsFor;
|
|
1831
|
+
/**
|
|
1832
|
+
* The words for a header or footer part id the other region (or a sibling) already uses (ids are
|
|
1833
|
+
* unique across both regions, since a part's translations are keyed by it).
|
|
1834
|
+
*/
|
|
1835
|
+
private repeatedChromeIdMessage;
|
|
1836
|
+
/**
|
|
1837
|
+
* The root's chrome as its draft holds it, when it repeats a part id the committed chrome did
|
|
1838
|
+
* not (the agent's writes refuse the same, `repeatedChromeIds`): a problem under the
|
|
1839
|
+
* chrome, so the Form panel's Save leads to it and nothing is written. An id the two regions
|
|
1840
|
+
* already shared is not made worse by a draft that leaves it alone.
|
|
1841
|
+
*/
|
|
1842
|
+
private chromeIdProblemsFor;
|
|
1843
|
+
/**
|
|
1844
|
+
* A component set to print on paper only (`print.on: "paper"`) that holds an answer, or holds
|
|
1845
|
+
* a component that does: the form still shows it on screen (`paperOnlyApplies`), so the box
|
|
1846
|
+
* says so. Read from the draft when there is one, so choosing another value clears it at once.
|
|
1847
|
+
* The inspector never offers the choice here; this is for a definition written elsewhere, or
|
|
1848
|
+
* a component moved into a place that holds answers.
|
|
1849
|
+
*/
|
|
1850
|
+
private paperOnlyProblemsFor;
|
|
1851
|
+
/** A journey page id `componentId`'s draft gives that no translation could be keyed by ({@link newReservedPageId}). */
|
|
1852
|
+
private pageIdProblemsFor;
|
|
1853
|
+
/** Throws, before any step is made, when a write would give a node a page id no translation could be keyed by. */
|
|
1854
|
+
private refuseReservedPageId;
|
|
1855
|
+
/** Throws, before any step is made, when a write to the root would repeat a part id the committed chrome did not ({@link chromeIdProblemsFor}). */
|
|
1856
|
+
private refuseRepeatedChromeId;
|
|
1857
|
+
/**
|
|
1858
|
+
* A data grid's row bounds as its draft holds them: a bound past the cap
|
|
1859
|
+
* is said under its own box, and a maximum below the minimum under the maximum's. The form
|
|
1860
|
+
* still works with either (the grid reads a bound past the cap as the cap and a maximum below
|
|
1861
|
+
* the minimum as the minimum, `dataGridSettingsOf`), so this only tells the author that what
|
|
1862
|
+
* they typed is not what will be used. Kept to bounds the draft changes, like the tree owner's
|
|
1863
|
+
* own problems: a grid stored with a bad bound is not held up by it until someone edits one.
|
|
1864
|
+
*/
|
|
1865
|
+
private rowBoundProblemsFor;
|
|
1866
|
+
/**
|
|
1867
|
+
* The rules of `componentId`'s draft whose formula does not parse, as `rules:<key>` problems:
|
|
1868
|
+
* the Logic tab writes every keystroke to the draft as typed, so the draft always
|
|
1869
|
+
* equals the box, and this is what holds its Save back. Kept to the rules the draft changes:
|
|
1870
|
+
* a rule stored unparseable by someone else is said under its box, never a Save problem here.
|
|
1871
|
+
* The parser is given the built-in functions only; a call the controller does not know is
|
|
1872
|
+
* left to the panel, which knows the functions the host wired, and to the compile step.
|
|
1873
|
+
*/
|
|
1874
|
+
private ruleProblemsFor;
|
|
1875
|
+
/**
|
|
1876
|
+
* The tree owner's own problems with `componentId`'s draft (see
|
|
1877
|
+
* {@link BuilderControllerOptions.problems}), kept to those whose property the draft changes.
|
|
1878
|
+
*/
|
|
1879
|
+
private hookProblemsFor;
|
|
1880
|
+
/**
|
|
1881
|
+
* What the tree's owner notes about `componentId` as it is being edited (see
|
|
1882
|
+
* {@link BuilderControllerOptions.notes}), then what the chosen binding asks to be noted
|
|
1883
|
+
* (its `unwordedErrors`): advisory, so neither {@link problemsOf} nor
|
|
1884
|
+
* {@link commitDraft} counts it. Empty without either, or without the component.
|
|
1885
|
+
*/
|
|
1886
|
+
notesOf(componentId: string | undefined): BuilderNote[];
|
|
1887
|
+
/**
|
|
1888
|
+
* A tabs container's tabs with no label at all: the form shows them by place, never by id, so
|
|
1889
|
+
* the author is told to word them. Advisory.
|
|
1890
|
+
*/
|
|
1891
|
+
private tabLabelNotes;
|
|
1892
|
+
/**
|
|
1893
|
+
* The note a binding whose `unwordedErrors` is `"noted"` asks for (GOV.UK: each error written
|
|
1894
|
+
* for its question): which errors the component's own checks raise that no message words —
|
|
1895
|
+
* its own `messages`, a pattern's own message, or a container's or the form's messages above
|
|
1896
|
+
* it, which apply to it too. Under the messages box; the engine's wording stands in on the
|
|
1897
|
+
* form meanwhile.
|
|
1898
|
+
*/
|
|
1899
|
+
private unwordedErrorNotes;
|
|
1900
|
+
/** The advisory note for `componentId`'s CSS classes (a class the binding does not declare); never blocks a Save. */
|
|
1901
|
+
cssClassWarningOf(componentId: string | undefined): string | undefined;
|
|
1902
|
+
/**
|
|
1903
|
+
* Why `componentId`'s edited data key cannot be saved — not usable, or its answer would land
|
|
1904
|
+
* where another component's is — or `undefined`, including while the draft leaves the key as
|
|
1905
|
+
* committed (see {@link dataKeyError}).
|
|
1906
|
+
*/
|
|
1907
|
+
private checkDataKeyFor;
|
|
1908
|
+
/**
|
|
1909
|
+
* Throws, in words, when `value` would nest the form past {@link NESTING_MAX} once written
|
|
1910
|
+
* under `componentId`. The limit is the form's, counted from its root as Open counts it, so a
|
|
1911
|
+
* value is measured where it lands, not on its own: the same rule tree fits on a field near the
|
|
1912
|
+
* top and not on one deep in containers. `levels` is how many records stand between the
|
|
1913
|
+
* component's own record and the value: a setting's path segments (`configuration` and the
|
|
1914
|
+
* records its dots make), one for a single rule, none for the whole `rules` or `children`.
|
|
1915
|
+
*/
|
|
1916
|
+
private assertFitsAt;
|
|
1917
|
+
/**
|
|
1918
|
+
* Whether an edit to the committed tree would give two components one place in the data, or
|
|
1919
|
+
* file a place under one that cannot hold it: `mutate` makes the edit on a scratch
|
|
1920
|
+
* copy, and the first problem it adds is returned in words. Problems the form already had are
|
|
1921
|
+
* not the edit's, so they never hold it up; the Data workspace lists those. A tree the edit
|
|
1922
|
+
* would nest past the server's depth is a problem too, unless it already was.
|
|
1923
|
+
*/
|
|
1924
|
+
private dataPathProblemAfter;
|
|
1925
|
+
/**
|
|
1926
|
+
* The re-filing a grid needs once `nextConfiguration` is its configuration: children in a
|
|
1927
|
+
* column it will no longer declare move into its last column (see
|
|
1928
|
+
* `foldGridChildrenIntoColumns`), so reducing the count never loses a field. `undefined`
|
|
1929
|
+
* for any other component, or when every child already sits in a declared column.
|
|
1930
|
+
*/
|
|
1931
|
+
private gridColumnFoldFor;
|
|
1932
|
+
/**
|
|
1933
|
+
* Writes the draft to the tree as a single undoable edit, then clears it. Refuses — leaving
|
|
1934
|
+
* the draft intact so nothing is lost — when the pending id is not usable.
|
|
1935
|
+
*/
|
|
1936
|
+
commitDraft(componentId?: string | undefined): boolean;
|
|
1937
|
+
/** Throws the draft away. The tree was never touched, so there is nothing to undo. */
|
|
1938
|
+
discardDraft(componentId?: string | undefined): void;
|
|
1939
|
+
canUndo(): boolean;
|
|
1940
|
+
canRedo(): boolean;
|
|
1941
|
+
/**
|
|
1942
|
+
* The step atop the undo side of the history, as an opaque mark compared by identity:
|
|
1943
|
+
* `undefined` when there is nothing to undo. A history kept over more than one controller (the
|
|
1944
|
+
* journeys Step view's) knows each step it recorded by the mark it left, and takes a
|
|
1945
|
+
* step back only while its controller's mark is still that one: a step undone elsewhere, or a
|
|
1946
|
+
* history started over (a rebuild), is never undone blind. A part absorbed into the step
|
|
1947
|
+
* atop (a rename's follow-ups) leaves the mark as it was.
|
|
1948
|
+
*/
|
|
1949
|
+
undoMark(): object | undefined;
|
|
1950
|
+
/** The step atop the redo side of the history, as {@link undoMark} reads the undo side. */
|
|
1951
|
+
redoMark(): object | undefined;
|
|
1952
|
+
/**
|
|
1953
|
+
* Ends the redo side of the history with no entry made, when it holds an entry (a mark, as
|
|
1954
|
+
* {@link redoMark} gives) that `holding` picks; whether it did. A step made elsewhere ends it as
|
|
1955
|
+
* a new step here would: a designer page's edit after the page's Undo took that edit's
|
|
1956
|
+
* follow-up off this history (`formSteps.followUp`). It announces nothing, the tree being as it
|
|
1957
|
+
* was: the caller says so to whatever shows the history (the mode's history listeners), and a
|
|
1958
|
+
* bar bound to this controller reads `canRedo()` afresh when it is next drawn.
|
|
1959
|
+
*/
|
|
1960
|
+
dropRedo(holding: (entry: object) => boolean): boolean;
|
|
1961
|
+
/**
|
|
1962
|
+
* The node inserted for a newly-added `type`, taken from the registered definition's
|
|
1963
|
+
* `createDefault()` when there is one so a component ships its own starting configuration
|
|
1964
|
+
* (a button's `action`, a container's slots) instead of the generic label below. The id is
|
|
1965
|
+
* always the controller's generated one — `createDefault()` returns a template, and its own
|
|
1966
|
+
* id would collide on the second add.
|
|
1967
|
+
*/
|
|
1968
|
+
private newNodeForType;
|
|
1969
|
+
private componentEditorFor;
|
|
1970
|
+
private allNodeIds;
|
|
1971
|
+
/**
|
|
1972
|
+
* The ids something beside the tree owns ({@link BuilderControllerOptions.claimedIds}): a
|
|
1973
|
+
* planner building components for this form — the Data workspace's import, a PDF template's
|
|
1974
|
+
* "Create form fields" — takes them as taken, as {@link insertComponents} refuses them.
|
|
1975
|
+
*/
|
|
1976
|
+
claimedIds(): string[];
|
|
1977
|
+
/** Why `id` cannot be taken although no node has it: something beside the tree owns it ({@link BuilderControllerOptions.claimedIds}). */
|
|
1978
|
+
private claimedIdError;
|
|
1979
|
+
/** Every id a node, a reserved id or a claimed id holds. */
|
|
1980
|
+
private takenIds;
|
|
1981
|
+
private nextId;
|
|
1982
|
+
slotChildCount(parentId: string, slotId: string): number;
|
|
1983
|
+
/**
|
|
1984
|
+
* The panels' path to a selection change. {@link select} switches at once — the direct
|
|
1985
|
+
* path for a host driving the builder — while this asks first when the selected component
|
|
1986
|
+
* has edits that have not been saved. The canvas previews a draft as though it were real,
|
|
1987
|
+
* so an author who clicks away believes the edit landed; finding it gone, or finding an
|
|
1988
|
+
* "Unsaved" flag on a field they left an hour ago, is exactly the surprise the draft model
|
|
1989
|
+
* must not spring. Returns whether the selection moved now; `false` means the prompt is up.
|
|
1990
|
+
*/
|
|
1991
|
+
requestSelect(componentId: string | undefined): boolean;
|
|
1992
|
+
/** {@link add} through the same guard: a new component takes the selection with it. */
|
|
1993
|
+
requestAdd(type: string, parentId?: string, slotId?: string, init?: AddComponentInit): boolean;
|
|
1994
|
+
/**
|
|
1995
|
+
* Where a component goes when the caller names no parent or slot (the palette's click):
|
|
1996
|
+
* the tree's root, in its `content` slot when it has one, else the first of its slots that
|
|
1997
|
+
* takes the type, else its first slot — so a PDF document (`document`, whose slots are
|
|
1998
|
+
* `body`, `header`, `footer`) takes it in the body, and a PDF template (whose first slot
|
|
1999
|
+
* holds the PDF's own fields and takes nothing else) takes an area in its `areas` slot.
|
|
2000
|
+
*/
|
|
2001
|
+
private addTarget;
|
|
2002
|
+
/** Whether `node`'s slot takes `type` by what the node's type declares; an undeclared slot does only when the node restricts none. */
|
|
2003
|
+
private slotTakes;
|
|
2004
|
+
/** The first slot `node` declares for `type` by name, else the first it declares open to any type. */
|
|
2005
|
+
private acceptingSlotOf;
|
|
2006
|
+
/**
|
|
2007
|
+
* The node the canvas draws as its root (a journey's step in the Step view, {@link BuilderControllerOptions.canvasView}),
|
|
2008
|
+
* when it declares a slot taking `type`: what a palette click with nothing selected adds to, rather than the last place in the tree.
|
|
2009
|
+
*/
|
|
2010
|
+
private acceptingCanvasRoot;
|
|
2011
|
+
/** The selection, or the nearest node above it, that declares a slot taking `type`. */
|
|
2012
|
+
private acceptingAncestor;
|
|
2013
|
+
/** The last node in document order that declares a slot taking `type`. */
|
|
2014
|
+
private lastAccepting;
|
|
2015
|
+
/**
|
|
2016
|
+
* The host's path out of the builder — switching to another page, closing a dialog the
|
|
2017
|
+
* builder sits in — through the same guard. Leaving the builder is leaving the component
|
|
2018
|
+
* being edited, and the draft model must not let it go quietly there either: the author
|
|
2019
|
+
* who moves to the renderer to try their edit has to be told it has not been saved. `run`
|
|
2020
|
+
* performs the departure once the draft is dealt with; it runs at once when nothing is
|
|
2021
|
+
* unsaved. Returns whether it ran now.
|
|
2022
|
+
*/
|
|
2023
|
+
requestLeave(run: () => void): boolean;
|
|
2024
|
+
/**
|
|
2025
|
+
* Puts away the panel that edits the form root's draft (the Form panel, the Header & footer
|
|
2026
|
+
* panel): `run` waits behind the same prompt the inspector asks with while the root
|
|
2027
|
+
* has unapplied edits, and runs at once otherwise. The selection's draft is not asked about:
|
|
2028
|
+
* the inspector holding it stays on screen.
|
|
2029
|
+
*/
|
|
2030
|
+
requestPanelLeave(run: () => void): boolean;
|
|
2031
|
+
/**
|
|
2032
|
+
* Registers (or, with `undefined`, removes) the editor outside the tree whose unsaved edits
|
|
2033
|
+
* {@link requestLeave} holds for once the tree's draft is clean — see {@link LeaveGuard}.
|
|
2034
|
+
*/
|
|
2035
|
+
setLeaveGuard(guard: LeaveGuard | undefined): void;
|
|
2036
|
+
/**
|
|
2037
|
+
* Whether the leave guard holds edits not yet written — the Logic surface's open rule, the PDF
|
|
2038
|
+
* designer's template mapping — that {@link requestLeave} would ask about.
|
|
2039
|
+
*/
|
|
2040
|
+
hasPendingLeaveGuard(): boolean;
|
|
2041
|
+
/**
|
|
2042
|
+
* The id a held leave would name for the guard in force (`LeaveGuardSubject.id`: the Languages
|
|
2043
|
+
* texts editor, the Tests panel, a template layout's mapping) — the one holding edits first when
|
|
2044
|
+
* guards are stacked — or `undefined` when no guard is installed. Today a page reads it only
|
|
2045
|
+
* from a raised prompt; the browser-assistant tools read it here to name what
|
|
2046
|
+
* is in the way exactly, without raising one. Pair it with {@link hasPendingLeaveGuard}: a guard
|
|
2047
|
+
* with nothing pending holds nothing back.
|
|
2048
|
+
*
|
|
2049
|
+
* @internal
|
|
2050
|
+
*/
|
|
2051
|
+
leaveGuardSubject(): string | undefined;
|
|
2052
|
+
/**
|
|
2053
|
+
* Stacks a guard over the slot {@link setLeaveGuard} fills, for an editor that can be open
|
|
2054
|
+
* while a surface holds the slot (the Tests panel beside Logic). A leave asks the
|
|
2055
|
+
* stacked guards first, newest first, then the slot's; Save saves every one that holds edits
|
|
2056
|
+
* and stops at the first refusal. Returns the remover; `setLeaveGuard` never touches the stack.
|
|
2057
|
+
*/
|
|
2058
|
+
pushLeaveGuard(guard: LeaveGuard): () => void;
|
|
2059
|
+
/** The slot's guard alone, or the stack and the slot asked as one. */
|
|
2060
|
+
private guardInForce;
|
|
2061
|
+
/**
|
|
2062
|
+
* The guard in the slot {@link setLeaveGuard} fills (the Logic surface's while connected), the
|
|
2063
|
+
* stacked ones aside. A second editor stacks with {@link pushLeaveGuard} rather than chaining
|
|
2064
|
+
* over this one, because a surface clears the slot whole when it goes.
|
|
2065
|
+
*/
|
|
2066
|
+
leaveGuardInForce(): LeaveGuard | undefined;
|
|
2067
|
+
/** The prompt the author must answer before the held action runs, if one is up. */
|
|
2068
|
+
unsavedChangesPrompt(): UnsavedChangesPrompt | undefined;
|
|
2069
|
+
/**
|
|
2070
|
+
* Answers the prompt. `save` commits the draft and carries on with what was held — unless
|
|
2071
|
+
* the save is refused (an unusable id or class), in which case nothing moves and the
|
|
2072
|
+
* refusal shows where it always does. `discard` throws the draft away and carries on.
|
|
2073
|
+
* `stay` drops the held action: the author is where they were, draft intact. A prompt
|
|
2074
|
+
* held for a leave guard's edits is settled through the guard the same way.
|
|
2075
|
+
*/
|
|
2076
|
+
answerUnsavedChangesPrompt(decision: UnsavedChangesDecision): void;
|
|
2077
|
+
/**
|
|
2078
|
+
* Runs `run` now, or holds it behind a prompt while the selection has unsaved edits. A
|
|
2079
|
+
* newer held action replaces an older one: the author's latest click is the one that counts.
|
|
2080
|
+
*/
|
|
2081
|
+
private holdUnlessClean;
|
|
2082
|
+
/** Forgets a held action once the draft it was waiting on is gone. */
|
|
2083
|
+
private releaseHeldAction;
|
|
2084
|
+
select(componentIdRaw: string | undefined): void;
|
|
2085
|
+
/**
|
|
2086
|
+
* Adds a component of `type` (one undo entry). `init` seeds it: an id, when the caller has a
|
|
2087
|
+
* meaningful one (an area's `area_3`) and nothing holds it yet, and configuration laid over
|
|
2088
|
+
* the type's default — a rectangle drawn on a page lands with the node rather than as a
|
|
2089
|
+
* second edit to undo. It lands at the end of the slot, or just before an untouched seeded
|
|
2090
|
+
* Submit button that closes a `content` slot, so Submit stays last (see {@link addNode}).
|
|
2091
|
+
*/
|
|
2092
|
+
add(type: string, parentId?: string, slotId?: string, init?: AddComponentInit): void;
|
|
2093
|
+
/** {@link add} at `index` in the slot (the end when `undefined`); the new id, or `undefined` when refused. */
|
|
2094
|
+
private addNode;
|
|
2095
|
+
/** The seeded Submit's index when it closes `target`'s `content` slot (see {@link addNode}); else `undefined`, the end. */
|
|
2096
|
+
private beforeSeededSubmit;
|
|
2097
|
+
/**
|
|
2098
|
+
* Places several whole subtrees as **one** undoable edit — a form built from a data model is
|
|
2099
|
+
* one thing to the author, and one Undo takes it all back. Each entry lands where
|
|
2100
|
+
* {@link add} would put its type unless it names a parent, a slot and an index.
|
|
2101
|
+
*
|
|
2102
|
+
* Everything is checked before anything is placed, and a refusal places nothing: every id in
|
|
2103
|
+
* every subtree must be usable, new and claimed by nothing beside the tree ({@link
|
|
2104
|
+
* BuilderControllerOptions.claimedIds}; the tree only checks a subtree's top node), every
|
|
2105
|
+
* child must be one its parent's slot takes, and no answer may land where another component's
|
|
2106
|
+
* is. A refusal sets {@link dropError}, as a refused drop does.
|
|
2107
|
+
*/
|
|
2108
|
+
insertComponents(entries: readonly InsertComponentEntry[], options?: InsertComponentsOptions): InsertComponentsResult;
|
|
2109
|
+
/**
|
|
2110
|
+
* {@link insertComponents} through the unsaved-edits guard, as a palette click goes through
|
|
2111
|
+
* it. `entries` may be a function, so a plan is made against the tree as it stands when the
|
|
2112
|
+
* insert actually runs — after the author has saved or discarded what was held.
|
|
2113
|
+
*/
|
|
2114
|
+
requestInsertComponents(entries: readonly InsertComponentEntry[] | (() => readonly InsertComponentEntry[]), options?: InsertComponentsOptions & {
|
|
2115
|
+
onResult?: (result: InsertComponentsResult) => void;
|
|
2116
|
+
}): boolean;
|
|
2117
|
+
/**
|
|
2118
|
+
* Replaces what the form root's slot (`content` by default) holds with `nodes`, as **one**
|
|
2119
|
+
* undoable edit; the root's own settings stay. Components named in `keep` stay too, after the
|
|
2120
|
+
* new ones, in their order — a form's closing buttons, say. Checked like
|
|
2121
|
+
* {@link insertComponents}: the new ids only have to avoid what remains (the root, its other
|
|
2122
|
+
* slots and what is kept) and what is claimed beside the tree, so a rebuilt form may reuse the
|
|
2123
|
+
* ids it replaces. Drafts of the removed components go with them; the selection is dropped if
|
|
2124
|
+
* it went too.
|
|
2125
|
+
*/
|
|
2126
|
+
replaceContent(nodes: readonly ComponentNode[], options?: {
|
|
2127
|
+
slotId?: string;
|
|
2128
|
+
keep?: readonly string[];
|
|
2129
|
+
}): InsertComponentsResult;
|
|
2130
|
+
/** {@link replaceContent} through the unsaved-edits guard; see {@link requestInsertComponents}. */
|
|
2131
|
+
requestReplaceContent(nodes: readonly ComponentNode[] | (() => readonly ComponentNode[]), options?: {
|
|
2132
|
+
slotId?: string;
|
|
2133
|
+
keep?: readonly string[];
|
|
2134
|
+
onResult?: (result: InsertComponentsResult) => void;
|
|
2135
|
+
}): boolean;
|
|
2136
|
+
/**
|
|
2137
|
+
* Puts `node` in the place of the component `componentId` — its parent, its slot, its index —
|
|
2138
|
+
* as **one** undoable edit: a journey's question asked differently. Only what comes
|
|
2139
|
+
* is checked, as {@link insertComponents} checks it (its ids usable, new but for what goes,
|
|
2140
|
+
* claimed by nothing; its parent's slot taking it), so nothing else the tree holds — a
|
|
2141
|
+
* hand-written node the slots would refuse now — stands in its way. Drafts of what goes go
|
|
2142
|
+
* with it, and a selection inside it is put down.
|
|
2143
|
+
*/
|
|
2144
|
+
replaceComponent(componentId: string, node: ComponentNode): InsertComponentsResult;
|
|
2145
|
+
/**
|
|
2146
|
+
* {@link replaceComponent} through the unsaved-edits guard; `node` may be a function, planned
|
|
2147
|
+
* when the replacement runs (`undefined`: nothing to put there now, and nothing is done).
|
|
2148
|
+
*/
|
|
2149
|
+
requestReplaceComponent(componentId: string, node: ComponentNode | (() => ComponentNode | undefined), options?: {
|
|
2150
|
+
onResult?: (result: InsertComponentsResult) => void;
|
|
2151
|
+
}): boolean;
|
|
2152
|
+
/**
|
|
2153
|
+
* `map` with the translations of another form's `fragment` for the subtree `node` written in
|
|
2154
|
+
* (paste carries what the clipboard holds). Only languages this form declares and
|
|
2155
|
+
* texts `node`'s subtree words are taken. Each entry is written as the clipboard held it
|
|
2156
|
+
* (`writeTranslationEntry`): a current one stays current, and a stale one keeps its exact
|
|
2157
|
+
* `source`, so it stays flagged "Source changed" against the text it answered.
|
|
2158
|
+
*/
|
|
2159
|
+
private withPastedTranslations;
|
|
2160
|
+
/**
|
|
2161
|
+
* The command that prunes everything under the component ids `ids` from every language (a delete prunes), or `undefined` when the map holds nothing for them. It rides the same
|
|
2162
|
+
* undo entry as the removal, so an Undo brings the translations back with the components.
|
|
2163
|
+
*/
|
|
2164
|
+
private pruneOwnersCommand;
|
|
2165
|
+
private refuseInsert;
|
|
2166
|
+
/**
|
|
2167
|
+
* The first child in `node`'s subtree its parent's slot would refuse, in words; the top node's
|
|
2168
|
+
* place is its caller's to check. A node of the subtree, the top one included, carrying a page
|
|
2169
|
+
* id no translation could be keyed by is refused here too, so every insert says so.
|
|
2170
|
+
*/
|
|
2171
|
+
private subtreeSlotProblem;
|
|
2172
|
+
/** Whether the builder can draw and edit `type`: the registry has it (always, without a registry). */
|
|
2173
|
+
hasComponentType(type: string): boolean;
|
|
2174
|
+
/** What a new `type` starts as — its registered default, or nothing without one. The caller gives it an id. */
|
|
2175
|
+
componentTemplate(type: string): ComponentNode | undefined;
|
|
2176
|
+
/**
|
|
2177
|
+
* Every component type the builder can insert, or the one named, or none when it is unknown
|
|
2178
|
+
* (what the builder agent tools list and check a slot against). With a registry the
|
|
2179
|
+
* types are its definitions', in registration order; without one, the palette's. A pure read:
|
|
2180
|
+
* the tree, the history, the selection, the drafts and the id counter are left as they were,
|
|
2181
|
+
* and every answer is a copy.
|
|
2182
|
+
*/
|
|
2183
|
+
typeInfo(type?: string): readonly BuilderTypeInfo[];
|
|
2184
|
+
private typeInfoOf;
|
|
2185
|
+
/** An id for `type` no node, reserved id or claimed id holds, read without moving the counter. */
|
|
2186
|
+
private unusedIdFor;
|
|
2187
|
+
/**
|
|
2188
|
+
* Whether the inspector offers `type` a Data key: the value-bearing types and the
|
|
2189
|
+
* data-scoping container do, a button or static HTML does not. A host's own type answers by
|
|
2190
|
+
* what its editor declares.
|
|
2191
|
+
*/
|
|
2192
|
+
offersDataKey(type: string): boolean;
|
|
2193
|
+
/**
|
|
2194
|
+
* Where a component's data sits in the document the form describes (`billing.street`,
|
|
2195
|
+
* `items[].sku`), open drafts applied; `undefined` for one with no place of its own — a
|
|
2196
|
+
* grouping container, a button, the root.
|
|
2197
|
+
*/
|
|
2198
|
+
dataPathOf(componentId: string): string | undefined;
|
|
2199
|
+
/** Everything wrong with where the form's answers would be stored, open drafts applied. */
|
|
2200
|
+
dataKeyProblems(): DataKeyProblem[];
|
|
2201
|
+
/** Whether the node's type is `fixed` (see `ComponentDefinition.fixed`): edited, never removed. */
|
|
2202
|
+
isFixedNode(componentId: string): boolean;
|
|
2203
|
+
/** {@link isFixedType} of a node, as `moveRefusal` asks it. */
|
|
2204
|
+
private readonly isFixedComponent;
|
|
2205
|
+
/** Why a fixed component may not move to `target`, in the move-legality rules' words. */
|
|
2206
|
+
private fixedMoveReason;
|
|
2207
|
+
private isFixedType;
|
|
2208
|
+
/**
|
|
2209
|
+
* What else in the form names the component or something inside it: other components'
|
|
2210
|
+
* rules, journey pages, PDF layouts. The delete confirmation lists them
|
|
2211
|
+
* ({@link dependentLines}), and {@link remove} can clear them. The journeys and layouts are
|
|
2212
|
+
* read through the modes' documents ({@link setOutsideDocuments}); with none lent, only the
|
|
2213
|
+
* rules are found. Empty for a component the form does not have.
|
|
2214
|
+
*/
|
|
2215
|
+
dependentsOf(componentId: string): Dependent[];
|
|
2216
|
+
/** The tree and the modes' blocks, as {@link dependentsOf} reads them. */
|
|
2217
|
+
private dependentsSource;
|
|
2218
|
+
/**
|
|
2219
|
+
* The commands that clear what names `componentId`: the rules of other components, and the
|
|
2220
|
+
* journeys' and layouts' blocks through the modes' documents (the same seam a language change
|
|
2221
|
+
* rewrites them by, so an Undo carries just this change back onto what the author did there since).
|
|
2222
|
+
*/
|
|
2223
|
+
private referenceClearing;
|
|
2224
|
+
/**
|
|
2225
|
+
* Removes the component and its subtree (one undo entry). With `removeReferences` the
|
|
2226
|
+
* references to it go in the same entry — rules that read it, journey questions and conditions,
|
|
2227
|
+
* PDF bindings ({@link withoutDependents}) — so one Undo brings back the component and
|
|
2228
|
+
* everything that named it. Without it they stay, and show as missing where the builder
|
|
2229
|
+
* already says so (a rule's field gone, a journey page's question, a PDF field's source).
|
|
2230
|
+
*/
|
|
2231
|
+
remove(componentId: string, options?: {
|
|
2232
|
+
removeReferences?: boolean;
|
|
2233
|
+
}): void;
|
|
2234
|
+
/**
|
|
2235
|
+
* Removes several components as **one** undoable edit — a journey's questions whose component
|
|
2236
|
+
* the form no longer has. Ids not in the tree, fixed ones, the root, and ones inside
|
|
2237
|
+
* another listed component (which goes with it) are passed over. Drafts go with what they
|
|
2238
|
+
* belonged to, and a selection inside what went is dropped. Returns the ids removed, in the
|
|
2239
|
+
* order given; nothing removed is no edit and no change.
|
|
2240
|
+
*/
|
|
2241
|
+
removeComponents(componentIds: readonly string[]): string[];
|
|
2242
|
+
/**
|
|
2243
|
+
* {@link removeComponents} through the unsaved-edits guard, as a palette click goes through
|
|
2244
|
+
* it. `componentIds` may be a function, so what goes is decided against the tree as it stands
|
|
2245
|
+
* when the removal actually runs — after the author has saved or discarded what was held.
|
|
2246
|
+
*
|
|
2247
|
+
* Listed ids are known up front, so a draft of what they take away (the selected component
|
|
2248
|
+
* deleted from the canvas, or one inside a deleted container) is not asked about: it goes
|
|
2249
|
+
* with its component. Only a draft of something that stays holds the removal.
|
|
2250
|
+
* `removeReferences` removes each listed component with what names it, as {@link remove}
|
|
2251
|
+
* does with the option (one undo entry per component).
|
|
2252
|
+
*/
|
|
2253
|
+
requestRemoveComponents(componentIds: readonly string[] | (() => readonly string[]), options?: {
|
|
2254
|
+
onResult?: (removed: string[]) => void;
|
|
2255
|
+
removeReferences?: boolean;
|
|
2256
|
+
}): boolean;
|
|
2257
|
+
/** {@link remove} with `removeReferences` for each of `componentIds` the tree can give up; the ids removed. */
|
|
2258
|
+
private removeEachWithReferences;
|
|
2259
|
+
/** Where `componentId` sits: its parent, the slot and its index there; `undefined` for the root or an id not in the tree. */
|
|
2260
|
+
parentOf(componentId: string): {
|
|
2261
|
+
parentId: string;
|
|
2262
|
+
slotId: string;
|
|
2263
|
+
index: number;
|
|
2264
|
+
} | undefined;
|
|
2265
|
+
/**
|
|
2266
|
+
* Moves a component to `target` as one undo entry, by the path a canvas drop of it takes —
|
|
2267
|
+
* the same slot constraints and data-place checks — and keeps it selected.
|
|
2268
|
+
*
|
|
2269
|
+
* `target.index` is a gap among the target slot's children as they stand **before** the
|
|
2270
|
+
* move, as a drop's is: in `[a, b, c]`, moving `a` to index 2 puts it between `b` and `c`
|
|
2271
|
+
* (`[b, a, c]`); index 3 puts it last. Returns `false`, changing nothing, when the move is
|
|
2272
|
+
* refused — the root, a fixed node (see {@link isFixedNode}; {@link dropError} says why, as
|
|
2273
|
+
* for a drop of it), an id or parent not in the tree, an index outside `0..length`, a slot
|
|
2274
|
+
* that does not take it (which sets {@link dropError}) — and when the component is already there.
|
|
2275
|
+
*/
|
|
2276
|
+
move(componentId: string, target: {
|
|
2277
|
+
parentId: string;
|
|
2278
|
+
slotId: string;
|
|
2279
|
+
index: number;
|
|
2280
|
+
}): boolean;
|
|
2281
|
+
/**
|
|
2282
|
+
* Moves a component one place up (`-1`) or down (`1`) within its own slot, past its
|
|
2283
|
+
* neighbour, as {@link move} does. `false` at either end of the slot, or when refused.
|
|
2284
|
+
*/
|
|
2285
|
+
moveBy(componentId: string, delta: -1 | 1): boolean;
|
|
2286
|
+
/**
|
|
2287
|
+
* Every slot `componentId` may move to, its own included, in the canvas's reading
|
|
2288
|
+
* order: the tree's root first, then each container depth first. Legal by the rules a drop
|
|
2289
|
+
* meets (`moveRefusal`), less a slot where the move would give two components one place in
|
|
2290
|
+
* the data. Empty for the root, a fixed node or an id not in the tree.
|
|
2291
|
+
*/
|
|
2292
|
+
moveTargets(componentId: string): BuilderMoveTarget[];
|
|
2293
|
+
/** Whether `componentId` may move into `parentId`'s `slotId`: a drop's rules, then the data places. */
|
|
2294
|
+
private moveAllowed;
|
|
2295
|
+
/**
|
|
2296
|
+
* Moves `componentId` into `container` at `index`: the position it ends at among
|
|
2297
|
+
* the slot's other components, 0 first and their count last. `container` is a component id,
|
|
2298
|
+
* or a journey page's `pageId` when no component has that id (the page's node id is
|
|
2299
|
+
* internal). Without `slotId`, the container's first slot that takes it. As {@link move}: one
|
|
2300
|
+
* undo entry by a drop's path, the component keeps its id, configuration, rules and data
|
|
2301
|
+
* binding and stays selected; only its parent and place change. `false`, changing nothing,
|
|
2302
|
+
* when the move is refused ({@link moveTargets} does not list the slot, or `index` is outside
|
|
2303
|
+
* `0..count`) or the component is already there.
|
|
2304
|
+
*/
|
|
2305
|
+
moveTo(componentId: string, container: string, index: number, slotId?: string): boolean;
|
|
2306
|
+
/**
|
|
2307
|
+
* {@link moveTo}, saying what the move left behind: `leftEmpty` names the container it came
|
|
2308
|
+
* out of when that holds nothing now — a journey page by its `pageId` once its
|
|
2309
|
+
* questions slot is empty, its routes aside; any other container by its component id once
|
|
2310
|
+
* every slot of it is empty. The tree's root is never named, nor a container the component
|
|
2311
|
+
* moved within. The caller warns; nothing is refused for it.
|
|
2312
|
+
*/
|
|
2313
|
+
moveToResult(componentId: string, container: string, index: number, slotId?: string): BuilderMoveToResult;
|
|
2314
|
+
/**
|
|
2315
|
+
* {@link moveTo} through the unsaved-edits guard, as {@link requestMoveBy}. Whether it ran now.
|
|
2316
|
+
* `after` hears whether it moved, and the {@link moveToResult} (what it left empty).
|
|
2317
|
+
*/
|
|
2318
|
+
requestMoveTo(componentId: string, container: string, index: number, slotId?: string, after?: (moved: boolean, result: BuilderMoveToResult) => void): boolean;
|
|
2319
|
+
/** A container named by its component id, else by a journey page's `pageId` naming exactly one node. */
|
|
2320
|
+
private moveContainerId;
|
|
2321
|
+
/**
|
|
2322
|
+
* Copies a component and everything in it, placing the copy right after it in the same slot
|
|
2323
|
+
* as one undo entry, and selects the copy. Returns the copy's id; `undefined` when refused —
|
|
2324
|
+
* the root, an id not in the tree, a fixed node or a subtree holding one, a slot with no room
|
|
2325
|
+
* (which sets {@link dropError}, as {@link insertComponents} does).
|
|
2326
|
+
*
|
|
2327
|
+
* - **Ids:** every id in the copy is new, numbered after its original's (`email` → `email_2`,
|
|
2328
|
+
* `text_3` → `text_4`, the next free number).
|
|
2329
|
+
* - **Data:** the copy would store its answer where the original does, so the
|
|
2330
|
+
* data key is dropped from the copy and from every copied node in the same data scope —
|
|
2331
|
+
* the place then falls back to the new id. Nodes under a copied data-scoping container or
|
|
2332
|
+
* repeating section keep their keys: the container's place is new, so theirs are too. A
|
|
2333
|
+
* copied repeating section's `collectionPath` is dropped the same way (a collection path is
|
|
2334
|
+
* not prefixed by anything above it), and its `itemFields` name the copied fields. A
|
|
2335
|
+
* copy that would still share a place is refused.
|
|
2336
|
+
* - **Rules:** a rule in the copy that reads a component inside the copied subtree reads
|
|
2337
|
+
* that component's copy; one that reads a component outside it is unchanged.
|
|
2338
|
+
*/
|
|
2339
|
+
duplicate(componentId: string): string | undefined;
|
|
2340
|
+
/** {@link duplicate}'s copy of `original`: new ids, keys out of the original's place, rules re-pointed; with the old id → new id pairs. `undefined` when no id can be found. */
|
|
2341
|
+
private copyOf;
|
|
2342
|
+
/**
|
|
2343
|
+
* Adds a component of `type` right after `afterId` in `afterId`'s slot when that slot takes
|
|
2344
|
+
* it (its types and its room); otherwise — no `afterId`, the root, an id not in the tree, a
|
|
2345
|
+
* slot that refuses — where {@link add} would put it. One undo entry; the new component is
|
|
2346
|
+
* selected. Returns its id, or `undefined` when refused (which sets {@link dropError}).
|
|
2347
|
+
*/
|
|
2348
|
+
addAfter(type: string, afterId?: string, init?: AddComponentInit): string | undefined;
|
|
2349
|
+
/** {@link move} through the unsaved-edits guard, as a drop goes through it. Whether it ran now. */
|
|
2350
|
+
requestMove(componentId: string, target: {
|
|
2351
|
+
parentId: string;
|
|
2352
|
+
slotId: string;
|
|
2353
|
+
index: number;
|
|
2354
|
+
}): boolean;
|
|
2355
|
+
/** {@link moveBy} through the unsaved-edits guard. Whether it ran now. */
|
|
2356
|
+
requestMoveBy(componentId: string, delta: -1 | 1): boolean;
|
|
2357
|
+
/** {@link duplicate} through the unsaved-edits guard: the copy takes the selection, as an add does. Whether it ran now. */
|
|
2358
|
+
requestDuplicate(componentId: string): boolean;
|
|
2359
|
+
/** {@link addAfter} through the unsaved-edits guard, as {@link requestAdd}. Whether it ran now. */
|
|
2360
|
+
requestAddAfter(type: string, afterId?: string, init?: AddComponentInit): boolean;
|
|
2361
|
+
/**
|
|
2362
|
+
* Writes rules straight to the tree (one undo entry). The Rules tab goes through
|
|
2363
|
+
* {@link setDraftRules} instead; this is the direct path for a host driving the builder.
|
|
2364
|
+
*/
|
|
2365
|
+
setRules(componentId: string, rules: ComponentRules | undefined): void;
|
|
2366
|
+
/**
|
|
2367
|
+
* Writes a configuration value straight to the tree (one undo entry per call). The
|
|
2368
|
+
* properties panel goes through {@link setDraftProperty} instead; this stays the direct path
|
|
2369
|
+
* for a host driving the builder programmatically. An open draft is kept in step so the
|
|
2370
|
+
* canvas preview does not fall behind the tree.
|
|
2371
|
+
*/
|
|
2372
|
+
setProperty(componentId: string, propertyPath: string, value: unknown): void;
|
|
2373
|
+
/**
|
|
2374
|
+
* Writes a configuration value straight to the tree **without** an undo entry, the open draft
|
|
2375
|
+
* kept in step as {@link setProperty} keeps it. For a value a catalog owns and mirrors into
|
|
2376
|
+
* the tree, whose changes are not the tree's to undo: a journey renamed from the documents
|
|
2377
|
+
* menu, so the author's next Undo takes back their own last edit.
|
|
2378
|
+
*/
|
|
2379
|
+
setPropertyUnrecorded(componentId: string, propertyPath: string, value: unknown): void;
|
|
2380
|
+
/**
|
|
2381
|
+
* Writes several configuration values straight to the tree as **one** undo entry: the PDF
|
|
2382
|
+
* designer filling every field of a template at once, say. Each is written as
|
|
2383
|
+
* {@link setProperty} writes it, in order, and a grid's column fold joins the same entry.
|
|
2384
|
+
* An edit with `target: "rules"` sets the node's rule `propertyPath` (a key of its `rules`;
|
|
2385
|
+
* `undefined` removes it) in the same entry instead — a journey following a rename into the
|
|
2386
|
+
* rules of a presentation's own nodes; one with `target: "children"` puts `value`
|
|
2387
|
+
* as the node's whole children map, unchecked — a journey following a rename into nodes that
|
|
2388
|
+
* share an id, which no edit by id reaches. Every id is checked first, so an unknown one
|
|
2389
|
+
* throws before anything is written. The translations of an option, message, tab or header
|
|
2390
|
+
* or footer part an edit deletes go in the same entry. Translations are written
|
|
2391
|
+
* with {@link setTranslations}, never here. `unrecorded` writes them with no entry at all, as
|
|
2392
|
+
* {@link setPropertyUnrecorded} does: a journey's tree following a form rename, which the form's
|
|
2393
|
+
* step re-derives on its Undo and Redo.
|
|
2394
|
+
*/
|
|
2395
|
+
setProperties(edits: ReadonlyArray<{
|
|
2396
|
+
componentId: string;
|
|
2397
|
+
propertyPath: string;
|
|
2398
|
+
value: unknown;
|
|
2399
|
+
target?: "rules" | "children" | undefined;
|
|
2400
|
+
}>, options?: {
|
|
2401
|
+
unrecorded?: boolean;
|
|
2402
|
+
}): void;
|
|
2403
|
+
/**
|
|
2404
|
+
* Re-seats a component under another id (refused, with {@link idError}, for one the tree or
|
|
2405
|
+
* {@link BuilderControllerOptions.claimedIds} has, or outside the grammar). The rename is one
|
|
2406
|
+
* step of the history with everything it rewrites: its
|
|
2407
|
+
* collection path and the row fields that list it, the rules that read it, its translations,
|
|
2408
|
+
* and what a listener of the change writes as it hears of it (a PDF layout's conditions and
|
|
2409
|
+
* sources) or a moment later through {@link followRename} (the scenarios). Undo takes all of it
|
|
2410
|
+
* back and Redo makes it again, and the steps before it are undone on the component under the
|
|
2411
|
+
* id it had then. A draft left under the new id is dropped. Its change carries
|
|
2412
|
+
* {@link BuilderChangeEvent.renamed}; an Undo or Redo of it, {@link BuilderChangeEvent.renameStepped}.
|
|
2413
|
+
*/
|
|
2414
|
+
renameId(currentId: string, nextIdRaw: string): void;
|
|
2415
|
+
/**
|
|
2416
|
+
* {@link renameId}, with `edit` (an edit of the component made against `currentId`, a Save's)
|
|
2417
|
+
* as the first part of the rename's entry. Whether the rename was made: when it is not, `edit`
|
|
2418
|
+
* has not run and is the caller's to make.
|
|
2419
|
+
*/
|
|
2420
|
+
private renameWith;
|
|
2421
|
+
/**
|
|
2422
|
+
* Runs `command` (an edit that may move where answers are stored) as a step of the history.
|
|
2423
|
+
* When it moved a data-holding component's value path, the step stays open to the follow-ups
|
|
2424
|
+
* like a rename's ({@link followRename}): the rules inside a grid row that read a moved row
|
|
2425
|
+
* key follow at once, the moves are announced ({@link BuilderChangeEvent.dataMoved}), and the
|
|
2426
|
+
* step is returned so the caller announces its change inside it. `undefined` otherwise.
|
|
2427
|
+
*/
|
|
2428
|
+
private executeMovingData;
|
|
2429
|
+
/**
|
|
2430
|
+
* The rules inside a grid row read its fields by key (`row.<key>`), so they follow the keys
|
|
2431
|
+
* that moved in that row's collection, in the tree and in the open drafts: all of one edit's
|
|
2432
|
+
* keys as one map, so a swap stays a swap. Run inside the step that moved them. The ids of the
|
|
2433
|
+
* components whose rules in the tree it rewrote.
|
|
2434
|
+
*/
|
|
2435
|
+
private followRowKeys;
|
|
2436
|
+
/**
|
|
2437
|
+
* Runs `run` — a follow-up of the rename `rename` made a moment after it (the scenarios,
|
|
2438
|
+
* rewritten once the Tests chunk is in) — so that what it writes joins the rename's own entry
|
|
2439
|
+
* of the history, and an Undo takes it back with the id. That holds while the rename is still
|
|
2440
|
+
* the last thing done, and again on the change a Redo of it makes. While the rename is undone,
|
|
2441
|
+
* `run` is not run at all: it would write what the Undo took away and cost the Redo; the Redo
|
|
2442
|
+
* announces the rename again ({@link BuilderChangeEvent.historyStep}) for it to follow then.
|
|
2443
|
+
* After another edit, or for a rename the builder does not know, `run` writes a step of its
|
|
2444
|
+
* own. Whether it joined.
|
|
2445
|
+
*/
|
|
2446
|
+
followRename(rename: {
|
|
2447
|
+
from: string;
|
|
2448
|
+
to: string;
|
|
2449
|
+
}, run: () => void): boolean;
|
|
2450
|
+
/** Keeps `step` among the latest renames and moves of data, for {@link followRename} to know. */
|
|
2451
|
+
private remember;
|
|
2452
|
+
/**
|
|
2453
|
+
* An Undo or a Redo (`by`) took a rename or a move of data back or made it again. A step that
|
|
2454
|
+
* moved data announces its moves, reversed on an Undo and as at first on a Redo, and a Redo
|
|
2455
|
+
* leaves the step open to follow-ups once it is through.
|
|
2456
|
+
*/
|
|
2457
|
+
private historyStepped;
|
|
2458
|
+
/**
|
|
2459
|
+
* An Undo or a Redo moved a rename's ids (`by`): the change says which way
|
|
2460
|
+
* ({@link BuilderChangeEvent.renameStepped}), the translations' hosts hear the ids move as at
|
|
2461
|
+
* the rename, and a selection on the id it left goes with it.
|
|
2462
|
+
*/
|
|
2463
|
+
private renameStepped;
|
|
2464
|
+
/**
|
|
2465
|
+
* The formulas the last {@link renameId} could not follow: rules that spell the old id yet
|
|
2466
|
+
* do not parse, left as written. For the Logic diagnostics to show beside the rules they name;
|
|
2467
|
+
* empty until a rename leaves one, and replaced by the next rename.
|
|
2468
|
+
*/
|
|
2469
|
+
renameNotes(): readonly BuilderRenameNote[];
|
|
2470
|
+
/**
|
|
2471
|
+
* Every rule of every component that reads `from` rewritten to read `to` (a string formula
|
|
2472
|
+
* over the parser's spans, a tree through its path nodes, the object form through both) in
|
|
2473
|
+
* the tree and in the open drafts alike, whatever the rule's key (`visibleWhen`, `value`,
|
|
2474
|
+
* `defaultValue`, `filter`, `navigationGating` and the rest). A read of a grid row's key
|
|
2475
|
+
* (`row.sku`) is not the id's and is left to {@link followRowKeys}. Written to the tree as one
|
|
2476
|
+
* command, which {@link renameId} runs inside the rename's own history entry. A rule that is
|
|
2477
|
+
* left byte for byte is not written at all. A formula the parser rejects is left as it stands and reported in
|
|
2478
|
+
* `unparsed`, once per component and rule.
|
|
2479
|
+
*/
|
|
2480
|
+
private followRenameInRules;
|
|
2481
|
+
/**
|
|
2482
|
+
* Takes back the last step. It never throws: a step the tree no longer matches leaves the tree
|
|
2483
|
+
* as it was, takes the steps before it along, and says so in {@link dropError}; a listener that
|
|
2484
|
+
* throws is reported, not thrown (see {@link emit}).
|
|
2485
|
+
*/
|
|
2486
|
+
undo(): void;
|
|
2487
|
+
redo(): void;
|
|
2488
|
+
/**
|
|
2489
|
+
* One step through the history. A step that cannot be taken — the tree no longer holds what
|
|
2490
|
+
* it recorded — is never thrown at the bar's Undo or Redo: the tree stays as it was, the steps
|
|
2491
|
+
* beyond it go with it (`CommandHistory.undo`), and {@link dropError} says so on the canvas.
|
|
2492
|
+
* Drafts of components the step took away go with them.
|
|
2493
|
+
*/
|
|
2494
|
+
private stepThroughHistory;
|
|
2495
|
+
/** A node's own content, children left out: what a draft of it edits. */
|
|
2496
|
+
private ownSignature;
|
|
2497
|
+
/**
|
|
2498
|
+
* After a step that changed only `was`'s configuration or rules into `now`'s (same id, type and
|
|
2499
|
+
* everything else), writes each path the step touched into `draft` as the tree holds it now,
|
|
2500
|
+
* so the draft's own pending edits elsewhere survive while undo's restored values are
|
|
2501
|
+
* what both the tree and the draft hold. `false` when the step changed more than that, or
|
|
2502
|
+
* when nothing is left pending: the caller discards the draft (and any prompt held on it) then.
|
|
2503
|
+
*/
|
|
2504
|
+
private restoreIntoDraft;
|
|
2505
|
+
/**
|
|
2506
|
+
* A step through the history may take the selected component away (undoing its add, redoing
|
|
2507
|
+
* its removal): the selection is put down then, as {@link remove} puts it down, so the next
|
|
2508
|
+
* edit's checks do not run over a component the tree no longer has.
|
|
2509
|
+
*/
|
|
2510
|
+
private reconcileSelection;
|
|
2511
|
+
dragPayloadForType(type: string): BuilderDragPayload;
|
|
2512
|
+
applyDrop(dataTransfer: DataTransferLike, parentId: string, slotId: string, index: number): void;
|
|
2513
|
+
/**
|
|
2514
|
+
* The node a dragged template stands for: a new one of its type, the dragged configuration (a
|
|
2515
|
+
* plain object, copied, keys the type's template declares) over the type's own. `undefined` when the payload names no type, a type
|
|
2516
|
+
* this builder does not offer, or the form's root type, which is never placed twice.
|
|
2517
|
+
*/
|
|
2518
|
+
private templateFromDragged;
|
|
2519
|
+
/** Whether `type` is one the palette lists and the registry (when the builder has one) knows. */
|
|
2520
|
+
private offersType;
|
|
2521
|
+
/**
|
|
2522
|
+
* Whether `target` — a gap among the slot's children as they stand — is where the component
|
|
2523
|
+
* already is: the gap before it or the one after it.
|
|
2524
|
+
*/
|
|
2525
|
+
private isOwnPlace;
|
|
2526
|
+
/**
|
|
2527
|
+
* `target.index` is a gap among the slot's children *before* the move; the tree's move takes
|
|
2528
|
+
* the component out first and places it among what is left. Within its own slot, a gap past
|
|
2529
|
+
* it is therefore one less.
|
|
2530
|
+
*/
|
|
2531
|
+
private moveIndexAfterRemoval;
|
|
2532
|
+
/** Places the drop; whether it landed (a refusal sets {@link dropError}). */
|
|
2533
|
+
private performDrop;
|
|
2534
|
+
}
|