@vef-framework-react/form-editor 2.4.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/dist/cjs/_internal/_rolldown/runtime.cjs +1 -0
- package/dist/cjs/components/button/index.cjs +1 -0
- package/dist/cjs/components/checkbox-group-field/index.cjs +1 -0
- package/dist/cjs/components/code-editor/code-editor-input.cjs +1 -0
- package/dist/cjs/components/code-editor/index.cjs +1 -0
- package/dist/cjs/components/containers/index.cjs +1 -0
- package/dist/cjs/components/date-field/index.cjs +1 -0
- package/dist/cjs/components/display/index.cjs +1 -0
- package/dist/cjs/components/field-entries.cjs +1 -0
- package/dist/cjs/components/mobile/alert-block.cjs +1 -0
- package/dist/cjs/components/mobile/button.cjs +1 -0
- package/dist/cjs/components/mobile/checkbox-group.cjs +1 -0
- package/dist/cjs/components/mobile/date-adapters.cjs +1 -0
- package/dist/cjs/components/mobile/date.cjs +1 -0
- package/dist/cjs/components/mobile/daterange.cjs +1 -0
- package/dist/cjs/components/mobile/datetime.cjs +1 -0
- package/dist/cjs/components/mobile/definitions.cjs +1 -0
- package/dist/cjs/components/mobile/divider.cjs +1 -0
- package/dist/cjs/components/mobile/input-cell.cjs +1 -0
- package/dist/cjs/components/mobile/number.cjs +1 -0
- package/dist/cjs/components/mobile/option-group.cjs +1 -0
- package/dist/cjs/components/mobile/paragraph.cjs +1 -0
- package/dist/cjs/components/mobile/picker-trigger.cjs +1 -0
- package/dist/cjs/components/mobile/radio.cjs +1 -0
- package/dist/cjs/components/mobile/scope.cjs +1 -0
- package/dist/cjs/components/mobile/select.cjs +1 -0
- package/dist/cjs/components/mobile/switch.cjs +1 -0
- package/dist/cjs/components/mobile/textarea.cjs +1 -0
- package/dist/cjs/components/mobile/textfield.cjs +1 -0
- package/dist/cjs/components/mobile/theme.cjs +1 -0
- package/dist/cjs/components/number-field/index.cjs +1 -0
- package/dist/cjs/components/radio-field/index.cjs +1 -0
- package/dist/cjs/components/select-field/index.cjs +1 -0
- package/dist/cjs/components/switch-field/index.cjs +1 -0
- package/dist/cjs/components/textarea-field/index.cjs +1 -0
- package/dist/cjs/components/textfield/index.cjs +1 -0
- package/dist/cjs/editor/canvas/canvas-field.cjs +1 -0
- package/dist/cjs/editor/canvas/canvas.cjs +1 -0
- package/dist/cjs/editor/canvas/drop-indicator.cjs +1 -0
- package/dist/cjs/editor/canvas/drop-zones.cjs +1 -0
- package/dist/cjs/editor/canvas/json-split-view.cjs +1 -0
- package/dist/cjs/editor/canvas/mobile-seed-state.cjs +2 -0
- package/dist/cjs/editor/canvas/phone-frame.cjs +1 -0
- package/dist/cjs/editor/dnd.cjs +1 -0
- package/dist/cjs/editor/editor-layout-context.cjs +1 -0
- package/dist/cjs/editor/footer/footer.cjs +1 -0
- package/dist/cjs/editor/form-config/form-basics-tab.cjs +1 -0
- package/dist/cjs/editor/form-config/form-config-drawer.cjs +1 -0
- package/dist/cjs/editor/form-config/outline-tab.cjs +1 -0
- package/dist/cjs/editor/form-editor.cjs +1 -0
- package/dist/cjs/editor/palette/field-groups.cjs +1 -0
- package/dist/cjs/editor/palette/palette-group.cjs +1 -0
- package/dist/cjs/editor/palette/palette-item.cjs +1 -0
- package/dist/cjs/editor/palette/palette-panel.cjs +1 -0
- package/dist/cjs/editor/preview-effects.cjs +1 -0
- package/dist/cjs/editor/preview-runtime-context.cjs +1 -0
- package/dist/cjs/editor/properties/block-layout-section.cjs +1 -0
- package/dist/cjs/editor/properties/container-properties.cjs +1 -0
- package/dist/cjs/editor/properties/entries/built-ins.cjs +1 -0
- package/dist/cjs/editor/properties/entries/checkbox-entry.cjs +1 -0
- package/dist/cjs/editor/properties/entries/coerce.cjs +1 -0
- package/dist/cjs/editor/properties/entries/entry-field.cjs +1 -0
- package/dist/cjs/editor/properties/entries/icon-entry.cjs +1 -0
- package/dist/cjs/editor/properties/entries/index.cjs +1 -0
- package/dist/cjs/editor/properties/entries/key-entry.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/action-editor.cjs +2 -0
- package/dist/cjs/editor/properties/entries/linkage/actions-editor.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/condition-editor.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/container-linkage-section.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/expression-assist.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/index.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/linkage-rules-entry.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/mutators.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/options.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/rule-diagnostics.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/rule-list-editor.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/styles.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/trigger-editor.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/use-linkage-editor-model.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/use-stable-options.cjs +1 -0
- package/dist/cjs/editor/properties/entries/number-entry.cjs +1 -0
- package/dist/cjs/editor/properties/entries/options-source/index.cjs +1 -0
- package/dist/cjs/editor/properties/entries/options-source/source-mutators.cjs +1 -0
- package/dist/cjs/editor/properties/entries/select-entry.cjs +1 -0
- package/dist/cjs/editor/properties/entries/text-entry.cjs +1 -0
- package/dist/cjs/editor/properties/form-data-sources-panel.cjs +1 -0
- package/dist/cjs/editor/properties/form-linkage-panel.cjs +1 -0
- package/dist/cjs/editor/properties/form-variables-panel.cjs +1 -0
- package/dist/cjs/editor/properties/option-editors.cjs +1 -0
- package/dist/cjs/editor/properties/panel-header.cjs +1 -0
- package/dist/cjs/editor/properties/properties-empty.cjs +1 -0
- package/dist/cjs/editor/properties/properties-header.cjs +1 -0
- package/dist/cjs/editor/properties/properties-panel.cjs +1 -0
- package/dist/cjs/editor/properties/properties-provider.cjs +1 -0
- package/dist/cjs/editor/properties/properties-tabs.cjs +1 -0
- package/dist/cjs/editor/properties/use-confirmable-kind-switch.cjs +1 -0
- package/dist/cjs/editor/remove-node-confirm.cjs +1 -0
- package/dist/cjs/editor/schema-apply.cjs +2 -0
- package/dist/cjs/editor/styles.cjs +1 -0
- package/dist/cjs/editor/toolbar/notify.cjs +1 -0
- package/dist/cjs/editor/toolbar/schema-io.cjs +1 -0
- package/dist/cjs/editor/toolbar/toolbar.cjs +1 -0
- package/dist/cjs/editor/use-editor-shortcuts.cjs +1 -0
- package/dist/cjs/editor/validation-summary.cjs +1 -0
- package/dist/cjs/engine/assert-never.cjs +1 -0
- package/dist/cjs/engine/conversion/index.cjs +1 -0
- package/dist/cjs/engine/ids.cjs +1 -0
- package/dist/cjs/engine/keys.cjs +1 -0
- package/dist/cjs/engine/linkage/cycle.cjs +1 -0
- package/dist/cjs/engine/linkage/default-evaluator.cjs +1 -0
- package/dist/cjs/engine/linkage/effects.cjs +1 -0
- package/dist/cjs/engine/linkage/evaluator.cjs +1 -0
- package/dist/cjs/engine/linkage/index.cjs +1 -0
- package/dist/cjs/engine/linkage/operators.cjs +1 -0
- package/dist/cjs/engine/linkage/source-tracking.cjs +1 -0
- package/dist/cjs/engine/linkage/taxonomy.cjs +1 -0
- package/dist/cjs/engine/linkage/validator.cjs +1 -0
- package/dist/cjs/engine/registry/defaults-mobile.cjs +1 -0
- package/dist/cjs/engine/registry/defaults.cjs +1 -0
- package/dist/cjs/engine/registry/form-field-registry.cjs +1 -0
- package/dist/cjs/engine/schema/edit-ops.cjs +1 -0
- package/dist/cjs/engine/schema/mutate.cjs +1 -0
- package/dist/cjs/engine/schema/nodes.cjs +1 -0
- package/dist/cjs/engine/schema/permission-bridge.cjs +1 -0
- package/dist/cjs/engine/schema/presentation.cjs +1 -0
- package/dist/cjs/engine/schema/reconcile.cjs +1 -0
- package/dist/cjs/engine/schema/removal-impact.cjs +1 -0
- package/dist/cjs/engine/schema/rewrite.cjs +1 -0
- package/dist/cjs/engine/schema/validate.cjs +1 -0
- package/dist/cjs/engine/schema/walk.cjs +1 -0
- package/dist/cjs/engine/validation.cjs +1 -0
- package/dist/cjs/icons.cjs +1 -0
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/render/chrome/mobile-chrome.cjs +1 -0
- package/dist/cjs/render/chrome/pc-chrome.cjs +1 -0
- package/dist/cjs/render/chrome/subform-shell.cjs +1 -0
- package/dist/cjs/render/data-source-context.cjs +0 -0
- package/dist/cjs/render/flex-style.cjs +1 -0
- package/dist/cjs/render/form-field.cjs +1 -0
- package/dist/cjs/render/form-renderer.cjs +1 -0
- package/dist/cjs/render/grid-style.cjs +1 -0
- package/dist/cjs/render/parts/field-shell.cjs +1 -0
- package/dist/cjs/render/parts/label.cjs +1 -0
- package/dist/cjs/render/parts/options-status.cjs +1 -0
- package/dist/cjs/render/stack-style.cjs +1 -0
- package/dist/cjs/render/subform-columns.cjs +1 -0
- package/dist/cjs/render/submit.cjs +1 -0
- package/dist/cjs/runtime/effects.cjs +1 -0
- package/dist/cjs/runtime/resolve-scope-values.cjs +1 -0
- package/dist/cjs/runtime/runtime-context.cjs +1 -0
- package/dist/cjs/runtime/runtime-state-controller.cjs +1 -0
- package/dist/cjs/runtime/stabilize-state-map.cjs +1 -0
- package/dist/cjs/store/engine-provider.cjs +1 -0
- package/dist/cjs/store/form-store.cjs +1 -0
- package/dist/cjs/types/chrome.cjs +0 -0
- package/dist/cjs/types/component.cjs +1 -0
- package/dist/cjs/types/data-source.cjs +1 -0
- package/dist/cjs/types/index.cjs +1 -0
- package/dist/cjs/types/linkage.cjs +0 -0
- package/dist/cjs/types/properties.cjs +1 -0
- package/dist/cjs/types/schema.cjs +1 -0
- package/dist/es/components/button/index.js +183 -0
- package/dist/es/components/checkbox-group-field/index.js +103 -0
- package/dist/es/components/code-editor/code-editor-input.js +3 -0
- package/dist/es/components/code-editor/index.js +212 -0
- package/dist/es/components/containers/index.js +72 -0
- package/dist/es/components/date-field/index.js +197 -0
- package/dist/es/components/display/index.js +276 -0
- package/dist/es/components/field-entries.js +184 -0
- package/dist/es/components/mobile/alert-block.js +40 -0
- package/dist/es/components/mobile/button.js +41 -0
- package/dist/es/components/mobile/checkbox-group.js +35 -0
- package/dist/es/components/mobile/date-adapters.js +16 -0
- package/dist/es/components/mobile/date.js +42 -0
- package/dist/es/components/mobile/daterange.js +48 -0
- package/dist/es/components/mobile/datetime.js +42 -0
- package/dist/es/components/mobile/definitions.js +58 -0
- package/dist/es/components/mobile/divider.js +10 -0
- package/dist/es/components/mobile/input-cell.js +56 -0
- package/dist/es/components/mobile/number.js +73 -0
- package/dist/es/components/mobile/option-group.js +34 -0
- package/dist/es/components/mobile/paragraph.js +30 -0
- package/dist/es/components/mobile/picker-trigger.js +94 -0
- package/dist/es/components/mobile/radio.js +35 -0
- package/dist/es/components/mobile/scope.js +61 -0
- package/dist/es/components/mobile/select.js +45 -0
- package/dist/es/components/mobile/switch.js +22 -0
- package/dist/es/components/mobile/textarea.js +32 -0
- package/dist/es/components/mobile/textfield.js +30 -0
- package/dist/es/components/mobile/theme.js +8 -0
- package/dist/es/components/number-field/index.js +186 -0
- package/dist/es/components/radio-field/index.js +139 -0
- package/dist/es/components/select-field/index.js +128 -0
- package/dist/es/components/switch-field/index.js +133 -0
- package/dist/es/components/textarea-field/index.js +137 -0
- package/dist/es/components/textfield/index.js +138 -0
- package/dist/es/editor/canvas/canvas-field.js +202 -0
- package/dist/es/editor/canvas/canvas.js +415 -0
- package/dist/es/editor/canvas/drop-indicator.js +42 -0
- package/dist/es/editor/canvas/drop-zones.js +42 -0
- package/dist/es/editor/canvas/json-split-view.js +148 -0
- package/dist/es/editor/canvas/mobile-seed-state.js +103 -0
- package/dist/es/editor/canvas/phone-frame.js +109 -0
- package/dist/es/editor/dnd.js +75 -0
- package/dist/es/editor/editor-layout-context.js +34 -0
- package/dist/es/editor/footer/footer.js +154 -0
- package/dist/es/editor/form-config/form-basics-tab.js +184 -0
- package/dist/es/editor/form-config/form-config-drawer.js +224 -0
- package/dist/es/editor/form-config/outline-tab.js +132 -0
- package/dist/es/editor/form-editor.js +179 -0
- package/dist/es/editor/palette/field-groups.js +19 -0
- package/dist/es/editor/palette/palette-group.js +147 -0
- package/dist/es/editor/palette/palette-item.js +153 -0
- package/dist/es/editor/palette/palette-panel.js +109 -0
- package/dist/es/editor/preview-effects.js +22 -0
- package/dist/es/editor/preview-runtime-context.js +24 -0
- package/dist/es/editor/properties/block-layout-section.js +161 -0
- package/dist/es/editor/properties/container-properties.js +575 -0
- package/dist/es/editor/properties/entries/built-ins.js +21 -0
- package/dist/es/editor/properties/entries/checkbox-entry.js +31 -0
- package/dist/es/editor/properties/entries/coerce.js +8 -0
- package/dist/es/editor/properties/entries/entry-field.js +43 -0
- package/dist/es/editor/properties/entries/icon-entry.js +21 -0
- package/dist/es/editor/properties/entries/index.js +9 -0
- package/dist/es/editor/properties/entries/key-entry.js +29 -0
- package/dist/es/editor/properties/entries/linkage/action-editor.js +260 -0
- package/dist/es/editor/properties/entries/linkage/actions-editor.js +64 -0
- package/dist/es/editor/properties/entries/linkage/condition-editor.js +265 -0
- package/dist/es/editor/properties/entries/linkage/container-linkage-section.js +71 -0
- package/dist/es/editor/properties/entries/linkage/expression-assist.js +87 -0
- package/dist/es/editor/properties/entries/linkage/index.js +3 -0
- package/dist/es/editor/properties/entries/linkage/linkage-rules-entry.js +110 -0
- package/dist/es/editor/properties/entries/linkage/mutators.js +209 -0
- package/dist/es/editor/properties/entries/linkage/options.js +155 -0
- package/dist/es/editor/properties/entries/linkage/rule-diagnostics.js +58 -0
- package/dist/es/editor/properties/entries/linkage/rule-list-editor.js +126 -0
- package/dist/es/editor/properties/entries/linkage/styles.js +276 -0
- package/dist/es/editor/properties/entries/linkage/trigger-editor.js +64 -0
- package/dist/es/editor/properties/entries/linkage/use-linkage-editor-model.js +20 -0
- package/dist/es/editor/properties/entries/linkage/use-stable-options.js +12 -0
- package/dist/es/editor/properties/entries/number-entry.js +25 -0
- package/dist/es/editor/properties/entries/options-source/index.js +122 -0
- package/dist/es/editor/properties/entries/options-source/source-mutators.js +31 -0
- package/dist/es/editor/properties/entries/select-entry.js +23 -0
- package/dist/es/editor/properties/entries/text-entry.js +23 -0
- package/dist/es/editor/properties/form-data-sources-panel.js +170 -0
- package/dist/es/editor/properties/form-linkage-panel.js +36 -0
- package/dist/es/editor/properties/form-variables-panel.js +184 -0
- package/dist/es/editor/properties/option-editors.js +170 -0
- package/dist/es/editor/properties/panel-header.js +93 -0
- package/dist/es/editor/properties/properties-empty.js +62 -0
- package/dist/es/editor/properties/properties-header.js +31 -0
- package/dist/es/editor/properties/properties-panel.js +195 -0
- package/dist/es/editor/properties/properties-provider.js +95 -0
- package/dist/es/editor/properties/properties-tabs.js +91 -0
- package/dist/es/editor/properties/use-confirmable-kind-switch.js +26 -0
- package/dist/es/editor/remove-node-confirm.js +60 -0
- package/dist/es/editor/schema-apply.js +36 -0
- package/dist/es/editor/styles.js +74 -0
- package/dist/es/editor/toolbar/notify.js +59 -0
- package/dist/es/editor/toolbar/schema-io.js +107 -0
- package/dist/es/editor/toolbar/toolbar.js +394 -0
- package/dist/es/editor/use-editor-shortcuts.js +43 -0
- package/dist/es/editor/validation-summary.js +66 -0
- package/dist/es/engine/assert-never.js +8 -0
- package/dist/es/engine/conversion/index.js +127 -0
- package/dist/es/engine/ids.js +18 -0
- package/dist/es/engine/keys.js +48 -0
- package/dist/es/engine/linkage/cycle.js +25 -0
- package/dist/es/engine/linkage/default-evaluator.js +79 -0
- package/dist/es/engine/linkage/effects.js +41 -0
- package/dist/es/engine/linkage/evaluator.js +119 -0
- package/dist/es/engine/linkage/index.js +9 -0
- package/dist/es/engine/linkage/operators.js +44 -0
- package/dist/es/engine/linkage/source-tracking.js +17 -0
- package/dist/es/engine/linkage/taxonomy.js +51 -0
- package/dist/es/engine/linkage/validator.js +360 -0
- package/dist/es/engine/registry/defaults-mobile.js +12 -0
- package/dist/es/engine/registry/defaults.js +25 -0
- package/dist/es/engine/registry/form-field-registry.js +52 -0
- package/dist/es/engine/schema/edit-ops.js +264 -0
- package/dist/es/engine/schema/mutate.js +39 -0
- package/dist/es/engine/schema/nodes.js +61 -0
- package/dist/es/engine/schema/permission-bridge.js +46 -0
- package/dist/es/engine/schema/presentation.js +37 -0
- package/dist/es/engine/schema/reconcile.js +258 -0
- package/dist/es/engine/schema/removal-impact.js +59 -0
- package/dist/es/engine/schema/rewrite.js +11 -0
- package/dist/es/engine/schema/validate.js +320 -0
- package/dist/es/engine/schema/walk.js +103 -0
- package/dist/es/engine/validation.js +122 -0
- package/dist/es/icons.js +74 -0
- package/dist/es/index.js +54 -0
- package/dist/es/render/chrome/mobile-chrome.js +119 -0
- package/dist/es/render/chrome/pc-chrome.js +76 -0
- package/dist/es/render/chrome/subform-shell.js +38 -0
- package/dist/es/render/data-source-context.js +0 -0
- package/dist/es/render/flex-style.js +24 -0
- package/dist/es/render/form-field.js +37 -0
- package/dist/es/render/form-renderer.js +516 -0
- package/dist/es/render/grid-style.js +23 -0
- package/dist/es/render/parts/field-shell.js +119 -0
- package/dist/es/render/parts/label.js +44 -0
- package/dist/es/render/parts/options-status.js +19 -0
- package/dist/es/render/stack-style.js +13 -0
- package/dist/es/render/subform-columns.js +118 -0
- package/dist/es/render/submit.js +112 -0
- package/dist/es/runtime/effects.js +109 -0
- package/dist/es/runtime/resolve-scope-values.js +14 -0
- package/dist/es/runtime/runtime-context.js +10 -0
- package/dist/es/runtime/runtime-state-controller.js +99 -0
- package/dist/es/runtime/stabilize-state-map.js +14 -0
- package/dist/es/store/engine-provider.js +37 -0
- package/dist/es/store/form-store.js +306 -0
- package/dist/es/types/chrome.js +1 -0
- package/dist/es/types/component.js +13 -0
- package/dist/es/types/data-source.js +5 -0
- package/dist/es/types/index.js +5 -0
- package/dist/es/types/linkage.js +1 -0
- package/dist/es/types/properties.js +7 -0
- package/dist/es/types/schema.js +15 -0
- package/dist/types/src/components/button/index.d.ts +8 -0
- package/dist/types/src/components/checkbox-group-field/index.d.ts +2 -0
- package/dist/types/src/components/code-editor/code-editor-input.d.ts +1 -0
- package/dist/types/src/components/code-editor/index.d.ts +4 -0
- package/dist/types/src/components/containers/index.d.ts +12 -0
- package/dist/types/src/components/date-field/index.d.ts +4 -0
- package/dist/types/src/components/display/index.d.ts +4 -0
- package/dist/types/src/components/field-entries.d.ts +103 -0
- package/dist/types/src/components/mobile/alert-block.d.ts +12 -0
- package/dist/types/src/components/mobile/button.d.ts +9 -0
- package/dist/types/src/components/mobile/checkbox-group.d.ts +11 -0
- package/dist/types/src/components/mobile/date-adapters.d.ts +28 -0
- package/dist/types/src/components/mobile/date.d.ts +10 -0
- package/dist/types/src/components/mobile/daterange.d.ts +11 -0
- package/dist/types/src/components/mobile/datetime.d.ts +10 -0
- package/dist/types/src/components/mobile/definitions.d.ts +9 -0
- package/dist/types/src/components/mobile/divider.d.ts +10 -0
- package/dist/types/src/components/mobile/input-cell.d.ts +30 -0
- package/dist/types/src/components/mobile/number.d.ts +25 -0
- package/dist/types/src/components/mobile/option-group.d.ts +17 -0
- package/dist/types/src/components/mobile/paragraph.d.ts +10 -0
- package/dist/types/src/components/mobile/picker-trigger.d.ts +31 -0
- package/dist/types/src/components/mobile/radio.d.ts +12 -0
- package/dist/types/src/components/mobile/scope.d.ts +42 -0
- package/dist/types/src/components/mobile/select.d.ts +12 -0
- package/dist/types/src/components/mobile/switch.d.ts +14 -0
- package/dist/types/src/components/mobile/textarea.d.ts +3 -0
- package/dist/types/src/components/mobile/textfield.d.ts +11 -0
- package/dist/types/src/components/mobile/theme.d.ts +16 -0
- package/dist/types/src/components/number-field/index.d.ts +2 -0
- package/dist/types/src/components/radio-field/index.d.ts +2 -0
- package/dist/types/src/components/select-field/index.d.ts +2 -0
- package/dist/types/src/components/switch-field/index.d.ts +2 -0
- package/dist/types/src/components/textarea-field/index.d.ts +2 -0
- package/dist/types/src/components/textfield/index.d.ts +11 -0
- package/dist/types/src/editor/canvas/canvas-field.d.ts +24 -0
- package/dist/types/src/editor/canvas/canvas.d.ts +11 -0
- package/dist/types/src/editor/canvas/drop-indicator.d.ts +14 -0
- package/dist/types/src/editor/canvas/drop-zones.d.ts +48 -0
- package/dist/types/src/editor/canvas/json-split-view.d.ts +15 -0
- package/dist/types/src/editor/canvas/mobile-seed-state.d.ts +9 -0
- package/dist/types/src/editor/canvas/phone-frame.d.ts +15 -0
- package/dist/types/src/editor/dnd.d.ts +88 -0
- package/dist/types/src/editor/editor-layout-context.d.ts +53 -0
- package/dist/types/src/editor/footer/footer.d.ts +7 -0
- package/dist/types/src/editor/form-config/form-basics-tab.d.ts +34 -0
- package/dist/types/src/editor/form-config/form-config-drawer.d.ts +8 -0
- package/dist/types/src/editor/form-config/outline-tab.d.ts +2 -0
- package/dist/types/src/editor/form-editor.d.ts +142 -0
- package/dist/types/src/editor/palette/field-groups.d.ts +12 -0
- package/dist/types/src/editor/palette/palette-group.d.ts +31 -0
- package/dist/types/src/editor/palette/palette-item.d.ts +34 -0
- package/dist/types/src/editor/palette/palette-panel.d.ts +17 -0
- package/dist/types/src/editor/preview-effects.d.ts +14 -0
- package/dist/types/src/editor/preview-runtime-context.d.ts +23 -0
- package/dist/types/src/editor/properties/block-layout-section.d.ts +19 -0
- package/dist/types/src/editor/properties/container-properties.d.ts +19 -0
- package/dist/types/src/editor/properties/entries/built-ins.d.ts +19 -0
- package/dist/types/src/editor/properties/entries/checkbox-entry.d.ts +3 -0
- package/dist/types/src/editor/properties/entries/coerce.d.ts +6 -0
- package/dist/types/src/editor/properties/entries/entry-field.d.ts +29 -0
- package/dist/types/src/editor/properties/entries/icon-entry.d.ts +8 -0
- package/dist/types/src/editor/properties/entries/index.d.ts +8 -0
- package/dist/types/src/editor/properties/entries/key-entry.d.ts +14 -0
- package/dist/types/src/editor/properties/entries/linkage/action-editor.d.ts +42 -0
- package/dist/types/src/editor/properties/entries/linkage/actions-editor.d.ts +43 -0
- package/dist/types/src/editor/properties/entries/linkage/condition-editor.d.ts +28 -0
- package/dist/types/src/editor/properties/entries/linkage/container-linkage-section.d.ts +14 -0
- package/dist/types/src/editor/properties/entries/linkage/expression-assist.d.ts +33 -0
- package/dist/types/src/editor/properties/entries/linkage/index.d.ts +1 -0
- package/dist/types/src/editor/properties/entries/linkage/linkage-rules-entry.d.ts +17 -0
- package/dist/types/src/editor/properties/entries/linkage/mutators.d.ts +73 -0
- package/dist/types/src/editor/properties/entries/linkage/options.d.ts +72 -0
- package/dist/types/src/editor/properties/entries/linkage/rule-diagnostics.d.ts +20 -0
- package/dist/types/src/editor/properties/entries/linkage/rule-list-editor.d.ts +75 -0
- package/dist/types/src/editor/properties/entries/linkage/styles.d.ts +46 -0
- package/dist/types/src/editor/properties/entries/linkage/trigger-editor.d.ts +35 -0
- package/dist/types/src/editor/properties/entries/linkage/use-linkage-editor-model.d.ts +46 -0
- package/dist/types/src/editor/properties/entries/linkage/use-stable-options.d.ts +17 -0
- package/dist/types/src/editor/properties/entries/number-entry.d.ts +3 -0
- package/dist/types/src/editor/properties/entries/options-source/index.d.ts +9 -0
- package/dist/types/src/editor/properties/entries/options-source/source-mutators.d.ts +14 -0
- package/dist/types/src/editor/properties/entries/select-entry.d.ts +3 -0
- package/dist/types/src/editor/properties/entries/text-entry.d.ts +3 -0
- package/dist/types/src/editor/properties/form-data-sources-panel.d.ts +16 -0
- package/dist/types/src/editor/properties/form-linkage-panel.d.ts +13 -0
- package/dist/types/src/editor/properties/form-variables-panel.d.ts +17 -0
- package/dist/types/src/editor/properties/option-editors.d.ts +33 -0
- package/dist/types/src/editor/properties/panel-header.d.ts +21 -0
- package/dist/types/src/editor/properties/properties-empty.d.ts +13 -0
- package/dist/types/src/editor/properties/properties-header.d.ts +13 -0
- package/dist/types/src/editor/properties/properties-panel.d.ts +18 -0
- package/dist/types/src/editor/properties/properties-provider.d.ts +42 -0
- package/dist/types/src/editor/properties/properties-tabs.d.ts +24 -0
- package/dist/types/src/editor/properties/use-confirmable-kind-switch.d.ts +38 -0
- package/dist/types/src/editor/remove-node-confirm.d.ts +8 -0
- package/dist/types/src/editor/schema-apply.d.ts +25 -0
- package/dist/types/src/editor/styles.d.ts +37 -0
- package/dist/types/src/editor/toolbar/notify.d.ts +13 -0
- package/dist/types/src/editor/toolbar/schema-io.d.ts +12 -0
- package/dist/types/src/editor/toolbar/toolbar.d.ts +42 -0
- package/dist/types/src/editor/use-editor-shortcuts.d.ts +23 -0
- package/dist/types/src/editor/validation-summary.d.ts +19 -0
- package/dist/types/src/engine/assert-never.d.ts +18 -0
- package/dist/types/src/engine/conversion/index.d.ts +87 -0
- package/dist/types/src/engine/ids.d.ts +14 -0
- package/dist/types/src/engine/keys.d.ts +70 -0
- package/dist/types/src/engine/linkage/cycle.d.ts +28 -0
- package/dist/types/src/engine/linkage/default-evaluator.d.ts +10 -0
- package/dist/types/src/engine/linkage/effects.d.ts +76 -0
- package/dist/types/src/engine/linkage/evaluator.d.ts +72 -0
- package/dist/types/src/engine/linkage/index.d.ts +8 -0
- package/dist/types/src/engine/linkage/operators.d.ts +23 -0
- package/dist/types/src/engine/linkage/source-tracking.d.ts +25 -0
- package/dist/types/src/engine/linkage/taxonomy.d.ts +49 -0
- package/dist/types/src/engine/linkage/validator.d.ts +23 -0
- package/dist/types/src/engine/registry/defaults-mobile.d.ts +17 -0
- package/dist/types/src/engine/registry/defaults.d.ts +22 -0
- package/dist/types/src/engine/registry/form-field-registry.d.ts +79 -0
- package/dist/types/src/engine/schema/edit-ops.d.ts +101 -0
- package/dist/types/src/engine/schema/mutate.d.ts +41 -0
- package/dist/types/src/engine/schema/nodes.d.ts +34 -0
- package/dist/types/src/engine/schema/permission-bridge.d.ts +37 -0
- package/dist/types/src/engine/schema/presentation.d.ts +30 -0
- package/dist/types/src/engine/schema/reconcile.d.ts +80 -0
- package/dist/types/src/engine/schema/removal-impact.d.ts +39 -0
- package/dist/types/src/engine/schema/rewrite.d.ts +15 -0
- package/dist/types/src/engine/schema/validate.d.ts +36 -0
- package/dist/types/src/engine/schema/walk.d.ts +90 -0
- package/dist/types/src/engine/validation.d.ts +139 -0
- package/dist/types/src/icons.d.ts +8 -0
- package/dist/types/src/index.d.ts +39 -0
- package/dist/types/src/render/chrome/mobile-chrome.d.ts +9 -0
- package/dist/types/src/render/chrome/pc-chrome.d.ts +7 -0
- package/dist/types/src/render/chrome/subform-shell.d.ts +17 -0
- package/dist/types/src/render/data-source-context.d.ts +42 -0
- package/dist/types/src/render/flex-style.d.ts +26 -0
- package/dist/types/src/render/form-field.d.ts +32 -0
- package/dist/types/src/render/form-renderer.d.ts +65 -0
- package/dist/types/src/render/grid-style.d.ts +24 -0
- package/dist/types/src/render/parts/field-shell.d.ts +33 -0
- package/dist/types/src/render/parts/label.d.ts +20 -0
- package/dist/types/src/render/parts/options-status.d.ts +14 -0
- package/dist/types/src/render/stack-style.d.ts +19 -0
- package/dist/types/src/render/subform-columns.d.ts +16 -0
- package/dist/types/src/render/submit.d.ts +91 -0
- package/dist/types/src/runtime/effects.d.ts +77 -0
- package/dist/types/src/runtime/resolve-scope-values.d.ts +8 -0
- package/dist/types/src/runtime/runtime-context.d.ts +21 -0
- package/dist/types/src/runtime/runtime-state-controller.d.ts +33 -0
- package/dist/types/src/runtime/stabilize-state-map.d.ts +12 -0
- package/dist/types/src/runtime/types.d.ts +13 -0
- package/dist/types/src/store/engine-provider.d.ts +50 -0
- package/dist/types/src/store/form-store.d.ts +234 -0
- package/dist/types/src/types/chrome.d.ts +51 -0
- package/dist/types/src/types/component.d.ts +116 -0
- package/dist/types/src/types/data-source.d.ts +70 -0
- package/dist/types/src/types/index.d.ts +6 -0
- package/dist/types/src/types/linkage.d.ts +350 -0
- package/dist/types/src/types/properties.d.ts +122 -0
- package/dist/types/src/types/schema.d.ts +839 -0
- package/package.json +77 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { EffectAction, ExpressionContext, FieldLinkageRule, LinkageCondition, LinkageEvaluators, LinkageTriggerKind, RuntimeSchema } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* The side-effect lane (pure half).
|
|
4
|
+
*
|
|
5
|
+
* Effect actions fire on a *trigger edge*, never on the continuous state fold.
|
|
6
|
+
* The two edge sources are:
|
|
7
|
+
*
|
|
8
|
+
* - **Condition rising edge** — a `condition`-triggered rule whose effect
|
|
9
|
+
* actions run once when the condition transitions false→true. The runtime
|
|
10
|
+
* tracks each rule's previous truth; this module supplies the rule inventory
|
|
11
|
+
* ({@link collectConditionEffectRules}) and the per-evaluation truth vector
|
|
12
|
+
* ({@link evaluateConditionEffectTruths}).
|
|
13
|
+
* - **Field event** — a `change` / `focus` / `blur` / `click`-triggered rule
|
|
14
|
+
* whose effect actions the renderer dispatches imperatively from the field's
|
|
15
|
+
* own DOM events ({@link getTriggerEffectActions},
|
|
16
|
+
* {@link getFieldEventTriggerKinds}).
|
|
17
|
+
*
|
|
18
|
+
* Everything here is pure; the form api, host `dispatchEffect`, and React wiring
|
|
19
|
+
* live in `runtime/effects.tsx`.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* A `condition`-triggered rule that carries at least one effect action, reduced
|
|
23
|
+
* to just the pieces the edge tracker needs.
|
|
24
|
+
*/
|
|
25
|
+
export interface ConditionEffectRule {
|
|
26
|
+
ruleId: string;
|
|
27
|
+
condition: LinkageCondition;
|
|
28
|
+
/**
|
|
29
|
+
* The source fields this condition reads (leaf / group keys; empty for an
|
|
30
|
+
* opaque `expression` condition). The `"always"` tracker diffs these between
|
|
31
|
+
* evaluations so an unrelated field change does not re-fire {@link alwaysActions}.
|
|
32
|
+
*/
|
|
33
|
+
sourceKeys: string[];
|
|
34
|
+
/**
|
|
35
|
+
* The rule's effect actions, in declaration order — every one fires on the
|
|
36
|
+
* condition's false→true rising edge. State actions (if any) are excluded;
|
|
37
|
+
* they are handled by the state lane.
|
|
38
|
+
*/
|
|
39
|
+
actions: EffectAction[];
|
|
40
|
+
/**
|
|
41
|
+
* The subset of {@link actions} whose `retrigger` is `"always"`. These repeat
|
|
42
|
+
* (in declaration order) whenever the condition keeps holding and a source
|
|
43
|
+
* field changes — past the rising edge that already fired every action.
|
|
44
|
+
*/
|
|
45
|
+
alwaysActions: EffectAction[];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Gather, for one value scope, every `condition`-triggered rule that carries
|
|
49
|
+
* effect actions. Mirrors `evaluateRuntimeStates`' scoping: it walks only the
|
|
50
|
+
* root-scope nodes of `schema` (a subform template is passed as its own schema
|
|
51
|
+
* by the per-row controller), skipping deeper subform scopes.
|
|
52
|
+
*
|
|
53
|
+
* Memoize the result by `schema` — it is schema-stable, so the runtime computes
|
|
54
|
+
* it once per scope rather than per value change.
|
|
55
|
+
*/
|
|
56
|
+
export declare function collectConditionEffectRules(schema: RuntimeSchema): ConditionEffectRule[];
|
|
57
|
+
/**
|
|
58
|
+
* Evaluate the current truth of each condition-effect rule, positionally
|
|
59
|
+
* aligned with {@link collectConditionEffectRules}'s output, so the runtime can
|
|
60
|
+
* diff against the previous vector to detect rising edges.
|
|
61
|
+
*/
|
|
62
|
+
export declare function evaluateConditionEffectTruths(rules: ConditionEffectRule[], values: Record<string, unknown>, evaluators: Required<LinkageEvaluators>, context?: ExpressionContext): boolean[];
|
|
63
|
+
/**
|
|
64
|
+
* The effect actions to run when a given edge trigger fires. Returns the
|
|
65
|
+
* flattened effect actions of every rule whose trigger matches `kind` (state
|
|
66
|
+
* actions are excluded — they have no meaning on an edge and the validator
|
|
67
|
+
* rejects them there). Used for both field events (`change` / `focus` / `blur` /
|
|
68
|
+
* `click`) and form lifecycle moments (`load` / `beforeSubmit` / `afterSubmit`).
|
|
69
|
+
*/
|
|
70
|
+
export declare function getTriggerEffectActions(rules: FieldLinkageRule[] | undefined, kind: LinkageTriggerKind): EffectAction[];
|
|
71
|
+
/**
|
|
72
|
+
* The set of field-event edge kinds (`change` / `focus` / `blur` / `click`) a
|
|
73
|
+
* field listens for — drives which DOM handlers the renderer attaches, so a
|
|
74
|
+
* field with no event rules pays nothing.
|
|
75
|
+
*/
|
|
76
|
+
export declare function getFieldEventTriggerKinds(rules: FieldLinkageRule[] | undefined): Set<LinkageTriggerKind>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Block, ExpressionContext, LinkageActionValue, LinkageCondition, LinkageEvaluators, RuntimeSchema } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Runtime state derived for a single field from its linkage rules. Mirrors
|
|
4
|
+
* the shape consumed by `FormRenderer` / `RuntimeStateController` — kept as a
|
|
5
|
+
* plain record so React equality comparisons stay cheap.
|
|
6
|
+
*/
|
|
7
|
+
export interface RuntimeFieldState {
|
|
8
|
+
hidden: boolean;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
required: boolean;
|
|
11
|
+
assigned: boolean;
|
|
12
|
+
assignedValue?: unknown;
|
|
13
|
+
}
|
|
14
|
+
export declare const emptyRuntimeState: RuntimeFieldState;
|
|
15
|
+
export interface EvaluateLinkageOptions {
|
|
16
|
+
evaluators?: LinkageEvaluators;
|
|
17
|
+
/**
|
|
18
|
+
* Extra scope (`$vars` / `$user` / `$node`) surfaced to expressions and
|
|
19
|
+
* scripts. Omitted at design time; the runtime composes it from the form's
|
|
20
|
+
* variables and the host context.
|
|
21
|
+
*/
|
|
22
|
+
expressionContext?: ExpressionContext;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Evaluates one field's linkage in two phases:
|
|
26
|
+
*
|
|
27
|
+
* 1. Seed the state from `linkage.defaults` (visibility / disabled /
|
|
28
|
+
* required overrides applied before any rule fires).
|
|
29
|
+
* 2. Walk `linkage.rules` in declaration order. Only `condition`-triggered
|
|
30
|
+
* rules feed this lane; for each whose condition matches, its **state**
|
|
31
|
+
* actions are applied (effect actions belong to the side-effect lane and are
|
|
32
|
+
* skipped). Later rules overwrite earlier ones — order is the user's
|
|
33
|
+
* tie-breaker.
|
|
34
|
+
*/
|
|
35
|
+
export declare function evaluateLinkage(node: Block, values: Record<string, unknown>, options?: EvaluateLinkageOptions): RuntimeFieldState;
|
|
36
|
+
/**
|
|
37
|
+
* Evaluates linkage for every field in a schema. Used by the renderer to
|
|
38
|
+
* derive the full runtime-state map in one pass per value change.
|
|
39
|
+
*/
|
|
40
|
+
export declare function evaluateRuntimeStates(schema: RuntimeSchema, values: Record<string, unknown>, options?: EvaluateLinkageOptions): Record<string, RuntimeFieldState>;
|
|
41
|
+
/**
|
|
42
|
+
* Recursive condition matcher. The three condition kinds short-circuit
|
|
43
|
+
* appropriately so a large tree never evaluates more leaves than needed.
|
|
44
|
+
* Exported so the effect lane can re-evaluate a rule's trigger condition for
|
|
45
|
+
* rising-edge detection without duplicating the recursion.
|
|
46
|
+
*/
|
|
47
|
+
export declare function matchCondition(condition: LinkageCondition, values: Record<string, unknown>, evaluators: Required<LinkageEvaluators>, context?: ExpressionContext): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Resolve a {@link LinkageActionValue} to a concrete value: a literal verbatim,
|
|
50
|
+
* or an expression run through the injected evaluator. Shared by the state
|
|
51
|
+
* lane's `assign` and the effect lane's value-bearing actions (`set_field` /
|
|
52
|
+
* `alert` / `navigate`).
|
|
53
|
+
*/
|
|
54
|
+
export declare function resolveActionValue(actionValue: LinkageActionValue, values: Record<string, unknown>, evaluators: Required<LinkageEvaluators>, context?: ExpressionContext): unknown;
|
|
55
|
+
/**
|
|
56
|
+
* Build the `$vars` map from a schema's form-global variable declarations,
|
|
57
|
+
* keyed by variable name with each `defaultValue`. The runtime merges this with
|
|
58
|
+
* any host-supplied overrides to form the expression context's `variables`.
|
|
59
|
+
*/
|
|
60
|
+
export declare function deriveExpressionVariables(schema: RuntimeSchema): Record<string, unknown>;
|
|
61
|
+
/**
|
|
62
|
+
* Builds the initial value map for a form from its schema. Each root-scope
|
|
63
|
+
* keyed field is seeded with a type-appropriate empty value (see
|
|
64
|
+
* {@link getFieldDefaultValue}) so the runtime form always has a defined slot —
|
|
65
|
+
* TanStack Form treats `undefined` as "uncontrolled". A subform is seeded from
|
|
66
|
+
* the supplied initial array — each supplied row merged over a fresh blank-row
|
|
67
|
+
* seed, so a row record missing a template key still gets that field's default
|
|
68
|
+
* slot rather than an uncontrolled `undefined` — or to `minRows` blank rows
|
|
69
|
+
* (each built from its template) so a required-minimum group renders its rows
|
|
70
|
+
* on load.
|
|
71
|
+
*/
|
|
72
|
+
export declare function deriveDefaultValues(schema: RuntimeSchema, initialValues?: Record<string, unknown>): Record<string, unknown>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { formatIssueMessage, type ValidationIssue, type ValidationIssueCode, type ValidationSeverity } from '../validation';
|
|
2
|
+
export { defaultEvaluateAssignExpression, defaultEvaluateExpression, defaultEvaluateScriptAction, resolveLinkageEvaluators } from './default-evaluator';
|
|
3
|
+
export { collectConditionEffectRules, evaluateConditionEffectTruths, getFieldEventTriggerKinds, getTriggerEffectActions, type ConditionEffectRule } from './effects';
|
|
4
|
+
export { deriveDefaultValues, deriveExpressionVariables, emptyRuntimeState, evaluateLinkage, evaluateRuntimeStates, resolveActionValue, type EvaluateLinkageOptions, type RuntimeFieldState } from './evaluator';
|
|
5
|
+
export { isEmptyRuntimeValue, LINKAGE_OPERATORS } from './operators';
|
|
6
|
+
export { getLinkageSourceKeys } from './source-tracking';
|
|
7
|
+
export { ALERT_LEVELS, EFFECT_ACTION_TYPES, FIELD_EVENT_TRIGGER_KINDS, FIELD_TRIGGER_KINDS, FORM_TRIGGER_KINDS, isEffectAction, isFieldEventTriggerKind, isStateAction, KEYED_ONLY_ACTIONS, LINKAGE_ACTION_TYPES, STATE_ACTION_TYPES } from './taxonomy';
|
|
8
|
+
export { validateLinkageSchema, type LinkageValidationResult } from './validator';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { LinkageConditionLeaf, LinkageOperator } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* The full set of supported leaf operators, in display order. Mirrors the
|
|
4
|
+
* union `LinkageOperator` and is used both by the editor UI (to render the
|
|
5
|
+
* operator dropdown) and the validator (to reject unknown operators in
|
|
6
|
+
* externally-supplied schemas).
|
|
7
|
+
*/
|
|
8
|
+
export declare const LINKAGE_OPERATORS: readonly LinkageOperator[];
|
|
9
|
+
/**
|
|
10
|
+
* True when a value is considered "empty" for linkage purposes — covers
|
|
11
|
+
* the typical user-facing notion of empty (nullish / `""` / `[]`). Numbers
|
|
12
|
+
* (including `0`), booleans, and non-empty objects are NOT empty. An array
|
|
13
|
+
* counts as empty when it holds no meaningful entry, so a date range cleared
|
|
14
|
+
* to `["", ""]` is treated the same as an unset `[]` by `required` and the
|
|
15
|
+
* `empty` / `notEmpty` operators.
|
|
16
|
+
*/
|
|
17
|
+
export declare function isEmptyRuntimeValue(value: unknown): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Evaluates a leaf condition against the current form values. Operators
|
|
20
|
+
* fall back to `false` rather than throw when the source value is of an
|
|
21
|
+
* unexpected type, so a malformed condition can never crash the renderer.
|
|
22
|
+
*/
|
|
23
|
+
export declare function matchLeaf(leaf: LinkageConditionLeaf, values: Record<string, unknown>): boolean;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FieldLinkage, LinkageCondition } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Any node that may carry linkage — a leaf field or a container block.
|
|
4
|
+
*/
|
|
5
|
+
interface LinkageBearer {
|
|
6
|
+
linkage?: FieldLinkage;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Collects the keys of every source field whose value drives this node's
|
|
10
|
+
* derived state. Used by the runtime renderer to scope per-field re-validation
|
|
11
|
+
* (TanStack Form's `onChangeListenTo`).
|
|
12
|
+
*
|
|
13
|
+
* Only `condition`-triggered rules carrying a **state** action are counted: they
|
|
14
|
+
* are the rules that make this field's hidden / disabled / required state — and
|
|
15
|
+
* therefore its validation — depend on another field's value. Effect-only rules
|
|
16
|
+
* and edge-triggered (event) rules add no keys; their work happens on the
|
|
17
|
+
* effect lane, not in this field's validator.
|
|
18
|
+
*
|
|
19
|
+
* Expression conditions return no keys — the host-supplied evaluator is
|
|
20
|
+
* opaque to the framework. Authors using `expression` must trust the
|
|
21
|
+
* runtime to re-evaluate on any value change.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getLinkageSourceKeys(node: LinkageBearer): string[];
|
|
24
|
+
export declare function collectConditionSourceKeys(condition: LinkageCondition, out: Set<string>): void;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { EffectAction, EffectActionType, FieldLinkageAction, LinkageActionType, LinkageAlertLevel, LinkageTriggerKind, StateAction, StateActionType } from '../../types';
|
|
2
|
+
export declare const STATE_ACTION_TYPES: readonly StateActionType[];
|
|
3
|
+
export declare const EFFECT_ACTION_TYPES: readonly EffectActionType[];
|
|
4
|
+
/**
|
|
5
|
+
* Every action discriminator. Used by the validator to reject unknown action
|
|
6
|
+
* types in externally-supplied schemas.
|
|
7
|
+
*/
|
|
8
|
+
export declare const LINKAGE_ACTION_TYPES: readonly LinkageActionType[];
|
|
9
|
+
/**
|
|
10
|
+
* Narrows an action to the state family — folded into `RuntimeFieldState` by
|
|
11
|
+
* the state lane, skipped by the effect lane.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isStateAction(action: FieldLinkageAction): action is StateAction;
|
|
14
|
+
/**
|
|
15
|
+
* Narrows an action to the effect family — fired by the side-effect lane,
|
|
16
|
+
* skipped by the state lane. The complement of {@link isStateAction} over the
|
|
17
|
+
* closed {@link FieldLinkageAction} union, which is sound because
|
|
18
|
+
* {@link STATE_ACTION_TYPE_TABLE} is compile-checked to be complete.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isEffectAction(action: FieldLinkageAction): action is EffectAction;
|
|
21
|
+
/**
|
|
22
|
+
* State actions that produce or alter form-data state. They are only meaningful
|
|
23
|
+
* on keyed leaf fields (those that contribute a value); the validator and the
|
|
24
|
+
* action editor both reject them on non-keyed targets. A deliberate subset (no
|
|
25
|
+
* completeness claim), unlike the derived lists above.
|
|
26
|
+
*/
|
|
27
|
+
export declare const KEYED_ONLY_ACTIONS: ReadonlySet<LinkageActionType>;
|
|
28
|
+
/**
|
|
29
|
+
* Trigger kinds valid on a **field** (leaf / container) rule.
|
|
30
|
+
*/
|
|
31
|
+
export declare const FIELD_TRIGGER_KINDS: readonly LinkageTriggerKind[];
|
|
32
|
+
/**
|
|
33
|
+
* Trigger kinds valid on a **form-scope** rule. The form has no self field to
|
|
34
|
+
* derive state for, so its rules carry effect actions only (enforced by the
|
|
35
|
+
* validator).
|
|
36
|
+
*/
|
|
37
|
+
export declare const FORM_TRIGGER_KINDS: readonly LinkageTriggerKind[];
|
|
38
|
+
/**
|
|
39
|
+
* Field-event edge triggers — the kinds dispatched imperatively from a field's
|
|
40
|
+
* DOM events (as opposed to the value-derived `condition` and form-lifecycle
|
|
41
|
+
* triggers).
|
|
42
|
+
*/
|
|
43
|
+
export declare const FIELD_EVENT_TRIGGER_KINDS: readonly LinkageTriggerKind[];
|
|
44
|
+
/**
|
|
45
|
+
* Whether a trigger is a field DOM event (`change` / `focus` / `blur` /
|
|
46
|
+
* `click`) — the triggers the renderer wires to a field's own events.
|
|
47
|
+
*/
|
|
48
|
+
export declare function isFieldEventTriggerKind(kind: LinkageTriggerKind): boolean;
|
|
49
|
+
export declare const ALERT_LEVELS: readonly LinkageAlertLevel[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FieldLinkage, PresentationLayer } from '../../types';
|
|
2
|
+
import { ValidationIssue } from '../validation';
|
|
3
|
+
export interface LinkageValidationResult {
|
|
4
|
+
issues: ValidationIssue[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Validates linkage data for one device presentation (import dialog / API
|
|
8
|
+
* payload). The editor's own mutators always produce well-formed trees, so this
|
|
9
|
+
* is the boundary guard. The **tree** must already be structurally valid (run
|
|
10
|
+
* `validateSchema` first); the linkage payloads hanging off it are treated as
|
|
11
|
+
* untrusted JSON and plain-object-guarded before any member access.
|
|
12
|
+
* `formLinkage` is the shared form-scope linkage; pass it alongside the tree it
|
|
13
|
+
* should resolve against (the pc presentation).
|
|
14
|
+
*
|
|
15
|
+
* Walks the presentation's node tree — leaf fields AND containers carry
|
|
16
|
+
* linkage — to (a) flag malformed nodes, (b) confirm referenced source / target
|
|
17
|
+
* keys exist within the rule's value scope (dangling references are warnings:
|
|
18
|
+
* the editor legitimately produces them mid-authoring), (c) reject state
|
|
19
|
+
* actions on edge triggers and keyed-only actions on non-keyed blocks, and
|
|
20
|
+
* (d) accumulate scope-namespaced edges (condition → value-writing state
|
|
21
|
+
* action) for the cycle detector.
|
|
22
|
+
*/
|
|
23
|
+
export declare function validateLinkageSchema(layer: PresentationLayer, formLinkage?: FieldLinkage): LinkageValidationResult;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FormFieldRegistry } from './form-field-registry';
|
|
2
|
+
/**
|
|
3
|
+
* Build the default **mobile** field registry: antd-mobile leaf renderers and
|
|
4
|
+
* the antd-mobile container chrome.
|
|
5
|
+
*
|
|
6
|
+
* Like {@link createDefaultRegistry}, this registers no property-entry
|
|
7
|
+
* renderers — property editing is a design-time concern shared across devices,
|
|
8
|
+
* resolved by the properties panel from its statically imported built-ins
|
|
9
|
+
* (`editor/properties/entries/built-ins.ts`), so a renderer-only host never
|
|
10
|
+
* bundles the editor's properties-panel tree.
|
|
11
|
+
*
|
|
12
|
+
* Kept in its own module so a pure-PC consumer that only ever builds
|
|
13
|
+
* {@link createDefaultRegistry} never pulls antd-mobile into its bundle — the
|
|
14
|
+
* `sideEffects: ["*.css"]` package config tree-shakes this module out when it is
|
|
15
|
+
* not referenced.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createDefaultMobileRegistry(): FormFieldRegistry;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FormFieldRegistry } from './form-field-registry';
|
|
2
|
+
/**
|
|
3
|
+
* Register the built-in field definitions (runtime `Component` + chrome) on
|
|
4
|
+
* the given registry.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately registers **no** property-entry renderers: those are
|
|
7
|
+
* design-time editor UI, resolved by the properties panel from its statically
|
|
8
|
+
* imported built-ins (`editor/properties/entries/built-ins.ts`). Keeping them
|
|
9
|
+
* out of this module means a renderer-only host that builds
|
|
10
|
+
* {@link createDefaultRegistry} never pulls the editor's properties-panel tree
|
|
11
|
+
* into its bundle.
|
|
12
|
+
*/
|
|
13
|
+
export declare function registerDefaults(registry: FormFieldRegistry): void;
|
|
14
|
+
/**
|
|
15
|
+
* Build a fresh registry pre-populated with the built-in field definitions
|
|
16
|
+
* and the PC container chrome.
|
|
17
|
+
*
|
|
18
|
+
* Convenience helper used by `<FormEditor />` when the consumer does not
|
|
19
|
+
* supply its own registry. Exported so callers that want to extend the
|
|
20
|
+
* defaults can compose on top of it.
|
|
21
|
+
*/
|
|
22
|
+
export declare function createDefaultRegistry(): FormFieldRegistry;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ContainerChromeSet, EntryComponentProps, EntryType, FieldDefinition } from '../../types';
|
|
3
|
+
type Listener = () => void;
|
|
4
|
+
/**
|
|
5
|
+
* Runtime registry of field types and property-entry renderers.
|
|
6
|
+
*
|
|
7
|
+
* Editor surfaces (palette, canvas, properties panel) read from the registry
|
|
8
|
+
* to discover available fields and editors. The registry is intentionally
|
|
9
|
+
* mutable so consumers can register custom fields and entry renderers at
|
|
10
|
+
* boot or even on the fly; subscribers are notified on every mutation so
|
|
11
|
+
* surfaces can re-render without a full reload.
|
|
12
|
+
*/
|
|
13
|
+
export declare class FormFieldRegistry {
|
|
14
|
+
private readonly fields;
|
|
15
|
+
private readonly entries;
|
|
16
|
+
private readonly listeners;
|
|
17
|
+
private containerChrome;
|
|
18
|
+
/**
|
|
19
|
+
* Monotonic version bumped on every mutation. Consumers using
|
|
20
|
+
* `useSyncExternalStore` snapshot this number to know when to re-read.
|
|
21
|
+
*/
|
|
22
|
+
private revision;
|
|
23
|
+
register(definition: FieldDefinition): void;
|
|
24
|
+
unregister(type: string): boolean;
|
|
25
|
+
get(type: string): FieldDefinition | undefined;
|
|
26
|
+
has(type: string): boolean;
|
|
27
|
+
list(): FieldDefinition[];
|
|
28
|
+
/**
|
|
29
|
+
* Register a property-entry renderer for an `EntryType` on this instance.
|
|
30
|
+
* The properties panel resolves entries through {@link getPropertyEntry},
|
|
31
|
+
* so consumers can either override a built-in entry (e.g. swap the default
|
|
32
|
+
* text input) or add an entirely new entry type after augmenting
|
|
33
|
+
* `PropertyEntryTypeMap`.
|
|
34
|
+
*/
|
|
35
|
+
registerPropertyEntry(type: EntryType, component: FC<EntryComponentProps>): void;
|
|
36
|
+
/**
|
|
37
|
+
* Resolve an entry renderer registered on this instance. The properties
|
|
38
|
+
* panel falls back to its statically imported built-ins
|
|
39
|
+
* (`editor/properties/entries/built-ins.ts`) when this returns `undefined`,
|
|
40
|
+
* so the engine layer never references editor code and the wiring survives
|
|
41
|
+
* downstream tree-shaking. Property entries are a design-time concern — a
|
|
42
|
+
* renderer-only host neither registers nor reads them.
|
|
43
|
+
*/
|
|
44
|
+
getPropertyEntry(type: EntryType): FC<EntryComponentProps> | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Install the device's container chrome — the presentational shells for
|
|
47
|
+
* `section` / `tabs` / `subform`. Set once when the registry is built
|
|
48
|
+
* ({@link createDefaultRegistry} / `createDefaultMobileRegistry`); resolved by
|
|
49
|
+
* the renderer and canvas through {@link getContainerChrome}.
|
|
50
|
+
*/
|
|
51
|
+
setContainerChrome(chrome: ContainerChromeSet): void;
|
|
52
|
+
/**
|
|
53
|
+
* The device's container chrome. Throws when none is registered — a registry
|
|
54
|
+
* that renders containers must have chrome installed; building it via the
|
|
55
|
+
* `createDefault*Registry` helpers guarantees this.
|
|
56
|
+
*/
|
|
57
|
+
getContainerChrome(): ContainerChromeSet;
|
|
58
|
+
/**
|
|
59
|
+
* Subscribe to registry mutations. Returns an unsubscribe function.
|
|
60
|
+
*/
|
|
61
|
+
subscribe(listener: Listener): () => void;
|
|
62
|
+
/**
|
|
63
|
+
* Snapshot used by `useSyncExternalStore`. The value itself is opaque;
|
|
64
|
+
* only its identity (changing on every mutation) matters.
|
|
65
|
+
*/
|
|
66
|
+
getRevision(): number;
|
|
67
|
+
private notify;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* One {@link FormFieldRegistry} per target device. The editor and renderer
|
|
71
|
+
* resolve the active registry from the current {@link PresentationDevice}, so
|
|
72
|
+
* the palette, properties panel, and field renderers all switch with the device.
|
|
73
|
+
* `pc` and `mobile` may register different field sets / renderers / defaults.
|
|
74
|
+
*/
|
|
75
|
+
export interface DeviceRegistries {
|
|
76
|
+
pc: FormFieldRegistry;
|
|
77
|
+
mobile: FormFieldRegistry;
|
|
78
|
+
}
|
|
79
|
+
export {};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Block, FlexSlot, PresentationLayer } from '../../types';
|
|
2
|
+
import { ScopePath } from './walk';
|
|
3
|
+
/**
|
|
4
|
+
* Structural edit operations driven by the canvas. Every function is pure and
|
|
5
|
+
* returns a new schema. These compose the primitive tree mutators in
|
|
6
|
+
* `mutate.ts` into the gestures the editor exposes: drop-beside, drop-into-
|
|
7
|
+
* container, append, move, and width.
|
|
8
|
+
*
|
|
9
|
+
* **Identity contract** (shared with `mutate.ts`, part of the public API of
|
|
10
|
+
* every op in this module): an op that changes nothing — a stale anchor, a
|
|
11
|
+
* missing container, a value already in place — returns the **input layer
|
|
12
|
+
* reference unchanged**, and a successful op rebuilds only the path to the
|
|
13
|
+
* mutation, keeping every untouched node and block-list reference identical.
|
|
14
|
+
* The store detects no-ops with `===`; the canvas memoizes blocks by
|
|
15
|
+
* reference.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Where a dragged block lands.
|
|
19
|
+
*
|
|
20
|
+
* - `beside` — immediately `before`/`after` the block `anchorId`, sharing its
|
|
21
|
+
* parent list (a sibling in the document stack, or a cell/slot inside a grid /
|
|
22
|
+
* flex). The inserted block auto-sizes (no span).
|
|
23
|
+
* - `container` — appended into a container's body (a tab panel selected by
|
|
24
|
+
* `tabIndex`).
|
|
25
|
+
* - `append` — appended at the end of the form.
|
|
26
|
+
*/
|
|
27
|
+
export type DropTarget = {
|
|
28
|
+
kind: "beside";
|
|
29
|
+
anchorId: string;
|
|
30
|
+
side: "before" | "after";
|
|
31
|
+
} | {
|
|
32
|
+
kind: "container";
|
|
33
|
+
containerId: string;
|
|
34
|
+
tabIndex?: number;
|
|
35
|
+
} | {
|
|
36
|
+
kind: "append";
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The value {@link ScopePath} a block dropped at `target` will live in. A drop
|
|
40
|
+
* into a subform's body opens that subform's scope; every other target keeps
|
|
41
|
+
* the anchor's scope. Used to allocate per-scope-unique keys.
|
|
42
|
+
*/
|
|
43
|
+
export declare function targetScope(schema: PresentationLayer, target: DropTarget): ScopePath;
|
|
44
|
+
/**
|
|
45
|
+
* Insert a freshly-created block at a drop target. Returns the input layer
|
|
46
|
+
* unchanged when the target cannot be resolved (a stale anchor id, or a
|
|
47
|
+
* container id that is missing or not a container).
|
|
48
|
+
*/
|
|
49
|
+
export declare function insertBlock(schema: PresentationLayer, block: Block, target: DropTarget): PresentationLayer;
|
|
50
|
+
/**
|
|
51
|
+
* Move an existing block (field or container) to a drop target. Removes it
|
|
52
|
+
* from its current spot and re-inserts it; a move that crosses value scopes
|
|
53
|
+
* re-keys the moved subtree so its keys stay unique in the destination scope.
|
|
54
|
+
*
|
|
55
|
+
* The move is **transactional**: if the node does not actually land — a stale
|
|
56
|
+
* target id, or a drop nested inside the dragged subtree — it rolls back to the
|
|
57
|
+
* original schema (returning the input layer reference) rather than silently
|
|
58
|
+
* dropping the node.
|
|
59
|
+
*/
|
|
60
|
+
export declare function moveBlock(schema: PresentationLayer, nodeId: string, target: DropTarget): PresentationLayer;
|
|
61
|
+
/**
|
|
62
|
+
* Set (or clear) a block's column span (honored when the block is a grid cell).
|
|
63
|
+
*
|
|
64
|
+
* The span is normalized at the write so the schema only ever persists what
|
|
65
|
+
* `validateSchema` accepts: floored to an integer and clamped into
|
|
66
|
+
* `1..ROW_COLS`; `undefined` (or a non-finite number) clears it back to auto.
|
|
67
|
+
* Writing the value already in place returns the input layer unchanged.
|
|
68
|
+
*/
|
|
69
|
+
export declare function setSpan(schema: PresentationLayer, blockId: string, span: number | undefined): PresentationLayer;
|
|
70
|
+
/**
|
|
71
|
+
* Set (or clear) a block's per-slot flex sizing — applied when the block is a
|
|
72
|
+
* direct child of a {@link FlexNode}.
|
|
73
|
+
*
|
|
74
|
+
* The slot is normalized at the write so the schema only ever persists what
|
|
75
|
+
* `validateSchema` accepts: `grow` / `shrink` are clamped to non-negative
|
|
76
|
+
* numbers, non-finite values are dropped. Writing a slot equal to the one
|
|
77
|
+
* already in place returns the input layer unchanged.
|
|
78
|
+
*/
|
|
79
|
+
export declare function setFlex(schema: PresentationLayer, blockId: string, flex: FlexSlot | undefined): PresentationLayer;
|
|
80
|
+
/**
|
|
81
|
+
* A key-minting strategy for a tree rebuild (clone or cross-scope move). A
|
|
82
|
+
* function reallocates each keyed node's key in the rebuilt block's own value
|
|
83
|
+
* scope; `null` preserves keys verbatim (used inside a subform template, a
|
|
84
|
+
* self-contained scope whose keys cannot collide with anything outside it).
|
|
85
|
+
*/
|
|
86
|
+
type KeyPolicy = ((base: string) => string) | null;
|
|
87
|
+
/**
|
|
88
|
+
* Deep-clone a block with fresh node ids throughout. The source tree is
|
|
89
|
+
* deep-copied up front (shared `cloneDeep`), so the clone never shares a
|
|
90
|
+
* nested value object with its source — `validate` rules, `dataSource`
|
|
91
|
+
* options, `flex` sizing, and every linkage payload included. `allocateKey`
|
|
92
|
+
* mints a unique key for every keyed node **in the clone's own value scope**;
|
|
93
|
+
* pass `null` to preserve keys verbatim. A nested subform opens a fresh scope,
|
|
94
|
+
* so its template always recurses with `null` (keys preserved), even when the
|
|
95
|
+
* outer block is reallocating. Linkage rules get fresh ids so the clone and
|
|
96
|
+
* source never share a rule identity, and `leaf.sourceKey` /
|
|
97
|
+
* `set_field.targetKey` references between cloned nodes are remapped to the
|
|
98
|
+
* reallocated keys.
|
|
99
|
+
*/
|
|
100
|
+
export declare function cloneBlock(block: Block, allocateKey: KeyPolicy): Block;
|
|
101
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Block, FormField, PresentationLayer } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Pure tree mutators over the block-tree schema. Every function returns a new
|
|
4
|
+
* schema; inputs are never mutated. Matching is by node `id`, which is unique
|
|
5
|
+
* across the whole tree, so a single id locates a node at any depth.
|
|
6
|
+
*
|
|
7
|
+
* The editor store composes these with positional helpers (insert / beside /
|
|
8
|
+
* move); these are the structural primitives underneath.
|
|
9
|
+
*/
|
|
10
|
+
type BlockUpdater = (block: Block) => Block;
|
|
11
|
+
/**
|
|
12
|
+
* Replace the node whose id matches via a pure updater. The updater must
|
|
13
|
+
* return a block of the same kind; callers that narrow first (see
|
|
14
|
+
* {@link editField}) keep this safe.
|
|
15
|
+
*
|
|
16
|
+
* Identity contract: when nothing changes — the id is not in the tree, or the
|
|
17
|
+
* updater returns its input — the **input schema reference** is returned.
|
|
18
|
+
*/
|
|
19
|
+
export declare function updateNode(schema: PresentationLayer, id: string, updater: BlockUpdater): PresentationLayer;
|
|
20
|
+
/**
|
|
21
|
+
* Remove the block with the given id from anywhere in the tree. A container
|
|
22
|
+
* emptied of its last block stays in place (it remains a valid drop target);
|
|
23
|
+
* only the targeted node is removed.
|
|
24
|
+
*
|
|
25
|
+
* Raw tree mutator: it does NOT touch linkage references (named `removeBlock`
|
|
26
|
+
* so it can never be mistaken for the store's `removeNode` action, which
|
|
27
|
+
* additionally prunes references to the dying keys in the same undo step).
|
|
28
|
+
*
|
|
29
|
+
* Identity contract: when the id is not in the tree, the **input schema
|
|
30
|
+
* reference** is returned.
|
|
31
|
+
*/
|
|
32
|
+
export declare function removeBlock(schema: PresentationLayer, id: string): PresentationLayer;
|
|
33
|
+
/**
|
|
34
|
+
* Apply a pure updater to a single leaf field, matched by id. Non-field nodes
|
|
35
|
+
* with that id are left untouched (returning the input schema reference, per
|
|
36
|
+
* the {@link updateNode} identity contract). The properties panel forwards
|
|
37
|
+
* updaters from typed `PropertyEntry.write` lenses, so per-property type
|
|
38
|
+
* safety is preserved at the entry-declaration site.
|
|
39
|
+
*/
|
|
40
|
+
export declare function editField(schema: PresentationLayer, fieldId: string, updater: (field: FormField) => FormField): PresentationLayer;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Block, ContainerNode, FormSchema } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Map an array through `transform`, returning the original array reference when
|
|
4
|
+
* no element changed. The foundational structural-sharing primitive: it is what
|
|
5
|
+
* lets a single deep edit rebuild only its own path while every untouched branch
|
|
6
|
+
* keeps its identity, so memoized canvas rows and reconcile passes can bail on
|
|
7
|
+
* reference equality.
|
|
8
|
+
*/
|
|
9
|
+
export declare function mapPreservingIdentity<T>(items: T[], transform: (item: T) => T): T[];
|
|
10
|
+
/**
|
|
11
|
+
* A fresh, empty schema.
|
|
12
|
+
*/
|
|
13
|
+
export declare function createEmptySchema(): FormSchema;
|
|
14
|
+
/**
|
|
15
|
+
* The child block-lists a container owns, in a stable order: `[children]` for a
|
|
16
|
+
* section, one list per tab for `tabs`, `[template]` for a subform.
|
|
17
|
+
*
|
|
18
|
+
* This is the single place the heterogeneous container shape is encoded —
|
|
19
|
+
* walkers, mutators, and structural edit-ops consume it (together with
|
|
20
|
+
* {@link withContainerBodies}) instead of each re-switching on node type.
|
|
21
|
+
*/
|
|
22
|
+
export declare function containerBodies(node: ContainerNode): Block[][];
|
|
23
|
+
/**
|
|
24
|
+
* Rebuild a container from transformed block-lists, in the same order and arity
|
|
25
|
+
* {@link containerBodies} produced them. The inverse of `containerBodies`;
|
|
26
|
+
* together they let a consumer transform a container's bodies without knowing
|
|
27
|
+
* which field holds them.
|
|
28
|
+
*/
|
|
29
|
+
export declare function withContainerBodies(node: ContainerNode, bodies: Block[][]): ContainerNode;
|
|
30
|
+
/**
|
|
31
|
+
* The subform key a container opens as a new value scope, or `undefined` when
|
|
32
|
+
* the container keeps the enclosing scope (sections and tabs do not rebind).
|
|
33
|
+
*/
|
|
34
|
+
export declare function bodyScopeKey(node: ContainerNode): string | undefined;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { FieldOption, FormSchema } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Coarse field kind understood by the approval flow editor and the Go backend
|
|
4
|
+
* (`approval/form_definition.go` `FieldKind`). The form editor's own field
|
|
5
|
+
* types are richer; this is the lowest-common-denominator the cross-package
|
|
6
|
+
* field-permission matrix keys off.
|
|
7
|
+
*/
|
|
8
|
+
export type FieldKind = "input" | "textarea" | "select" | "number" | "date" | "upload";
|
|
9
|
+
/**
|
|
10
|
+
* A form field flattened to the shape the approval flow editor consumes through
|
|
11
|
+
* its `EditorPlugins.formFields` seam (structurally equal to the backend's
|
|
12
|
+
* `FormFieldDefinition`). The approval side renders one permission row per entry,
|
|
13
|
+
* keyed by `key`.
|
|
14
|
+
*/
|
|
15
|
+
export interface FormFieldDefinition {
|
|
16
|
+
key: string;
|
|
17
|
+
kind: FieldKind;
|
|
18
|
+
label: string;
|
|
19
|
+
options?: FieldOption[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Flatten a form schema to the field inventory the approval flow editor needs
|
|
23
|
+
* to drive its per-node field-permission matrix. Only root-scope keyed leaf
|
|
24
|
+
* fields are emitted: the matrix (and the backend's `FilterEditableFormData`)
|
|
25
|
+
* address fields by their bare `key`, which cannot reach a subform-template
|
|
26
|
+
* field's scoped key — those are intentionally excluded. Non-keyed presentation
|
|
27
|
+
* fields (divider / alert / button) carry no value and are skipped.
|
|
28
|
+
*
|
|
29
|
+
* Both device presentations are scanned and de-duplicated by `key`: the data
|
|
30
|
+
* contract is shared, so any field present on either device contributes a
|
|
31
|
+
* permission row. The pc tree is scanned first, so it wins a label collision.
|
|
32
|
+
*
|
|
33
|
+
* The form editor owns this derivation; the approval editor owns the matrix UI;
|
|
34
|
+
* the backend owns enforcement. A host wires the three together by passing the
|
|
35
|
+
* result into `EditorPlugins.formFields`.
|
|
36
|
+
*/
|
|
37
|
+
export declare function toFormFieldDefinitions(schema: FormSchema): FormFieldDefinition[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FormSchema, PresentationDevice, PresentationLayer, RuntimeSchema } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* The shared empty presentation layer. Used to materialize a device on first
|
|
4
|
+
* edit and as the blank seed for "start from scratch".
|
|
5
|
+
*/
|
|
6
|
+
export declare function emptyLayer(): PresentationLayer;
|
|
7
|
+
/**
|
|
8
|
+
* The layer designed for `device`, or `undefined` when that device has no design
|
|
9
|
+
* yet. Render-time semantics: `mobile` does **not** fall back to `pc` — the
|
|
10
|
+
* renderer shows an empty state instead.
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolvePresentation(schema: FormSchema, device: PresentationDevice): PresentationLayer | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The editable layer for `device`. `pc` always exists; an undesigned `mobile`
|
|
15
|
+
* resolves to an empty layer so the first edit (or a drag onto the empty canvas)
|
|
16
|
+
* materializes it via {@link withPresentation}.
|
|
17
|
+
*/
|
|
18
|
+
export declare function currentLayer(schema: FormSchema, device: PresentationDevice): PresentationLayer;
|
|
19
|
+
/**
|
|
20
|
+
* Write `layer` back to `device`, leaving the other device and the shared data
|
|
21
|
+
* layer untouched.
|
|
22
|
+
*/
|
|
23
|
+
export declare function withPresentation(schema: FormSchema, device: PresentationDevice, layer: PresentationLayer): FormSchema;
|
|
24
|
+
/**
|
|
25
|
+
* Flatten a device's design and the shared data layer into the {@link
|
|
26
|
+
* RuntimeSchema} the renderer / linkage engine evaluate. Returns `undefined`
|
|
27
|
+
* when the device has no design yet (an undesigned mobile) — the renderer shows
|
|
28
|
+
* an empty state rather than falling back to the other device.
|
|
29
|
+
*/
|
|
30
|
+
export declare function toRuntimeSchema(schema: FormSchema, device: PresentationDevice): RuntimeSchema | undefined;
|