@aglyn/besigner-ui 1.0.0-beta.143
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 +201 -0
- package/README.md +7 -0
- package/package.json +73 -0
- package/src/besigner.d.ts +88 -0
- package/src/besigner.js +89 -0
- package/src/besigner.js.map +1 -0
- package/src/index.d.ts +17 -0
- package/src/index.js +18 -0
- package/src/index.js.map +1 -0
- package/src/lib/box-styler/box-styler.d.ts +57 -0
- package/src/lib/box-styler/box-styler.js +240 -0
- package/src/lib/box-styler/box-styler.js.map +1 -0
- package/src/lib/box-styler/components/box-diagram.d.ts +89 -0
- package/src/lib/box-styler/components/box-diagram.js +661 -0
- package/src/lib/box-styler/components/box-diagram.js.map +1 -0
- package/src/lib/box-styler/components/legend.d.ts +56 -0
- package/src/lib/box-styler/components/legend.js +130 -0
- package/src/lib/box-styler/components/legend.js.map +1 -0
- package/src/lib/box-styler/components/spacing-editor.d.ts +55 -0
- package/src/lib/box-styler/components/spacing-editor.js +347 -0
- package/src/lib/box-styler/components/spacing-editor.js.map +1 -0
- package/src/lib/box-styler/constants.d.ts +17 -0
- package/src/lib/box-styler/constants.js +30 -0
- package/src/lib/box-styler/constants.js.map +1 -0
- package/src/lib/box-styler/index.d.ts +2 -0
- package/src/lib/box-styler/index.js +4 -0
- package/src/lib/box-styler/index.js.map +1 -0
- package/src/lib/box-styler/region-fills.d.ts +107 -0
- package/src/lib/box-styler/region-fills.js +139 -0
- package/src/lib/box-styler/region-fills.js.map +1 -0
- package/src/lib/box-styler/spacing-value.d.ts +104 -0
- package/src/lib/box-styler/spacing-value.js +223 -0
- package/src/lib/box-styler/spacing-value.js.map +1 -0
- package/src/lib/box-styler/types.d.ts +29 -0
- package/src/lib/box-styler/types.js +18 -0
- package/src/lib/box-styler/types.js.map +1 -0
- package/src/lib/components/accordion-list.component.d.ts +50 -0
- package/src/lib/components/accordion-list.component.js +228 -0
- package/src/lib/components/accordion-list.component.js.map +1 -0
- package/src/lib/components/add-controls.component.d.ts +22 -0
- package/src/lib/components/add-controls.component.js +50 -0
- package/src/lib/components/add-controls.component.js.map +1 -0
- package/src/lib/components/app-bar-breadcrumbs.component.d.ts +29 -0
- package/src/lib/components/app-bar-breadcrumbs.component.js +279 -0
- package/src/lib/components/app-bar-breadcrumbs.component.js.map +1 -0
- package/src/lib/components/app-bar-primary.component.d.ts +21 -0
- package/src/lib/components/app-bar-primary.component.js +108 -0
- package/src/lib/components/app-bar-primary.component.js.map +1 -0
- package/src/lib/components/app-bar-secondary.component.d.ts +21 -0
- package/src/lib/components/app-bar-secondary.component.js +94 -0
- package/src/lib/components/app-bar-secondary.component.js.map +1 -0
- package/src/lib/components/aside-panel.component.d.ts +23 -0
- package/src/lib/components/aside-panel.component.js +505 -0
- package/src/lib/components/aside-panel.component.js.map +1 -0
- package/src/lib/components/besigner-conflict-alert.component.d.ts +36 -0
- package/src/lib/components/besigner-conflict-alert.component.js +51 -0
- package/src/lib/components/besigner-conflict-alert.component.js.map +1 -0
- package/src/lib/components/besigner-dnd-context.component.d.ts +32 -0
- package/src/lib/components/besigner-dnd-context.component.js +75 -0
- package/src/lib/components/besigner-dnd-context.component.js.map +1 -0
- package/src/lib/components/besigner-draft-alert.component.d.ts +70 -0
- package/src/lib/components/besigner-draft-alert.component.js +155 -0
- package/src/lib/components/besigner-draft-alert.component.js.map +1 -0
- package/src/lib/components/besigner-root-provider.component.d.ts +33 -0
- package/src/lib/components/besigner-root-provider.component.js +68 -0
- package/src/lib/components/besigner-root-provider.component.js.map +1 -0
- package/src/lib/components/binding-preview-controls.component.d.ts +28 -0
- package/src/lib/components/binding-preview-controls.component.js +63 -0
- package/src/lib/components/binding-preview-controls.component.js.map +1 -0
- package/src/lib/components/closeable-drawer.component.d.ts +32 -0
- package/src/lib/components/closeable-drawer.component.js +134 -0
- package/src/lib/components/closeable-drawer.component.js.map +1 -0
- package/src/lib/components/component-accordion-list.d.ts +28 -0
- package/src/lib/components/component-accordion-list.js +205 -0
- package/src/lib/components/component-accordion-list.js.map +1 -0
- package/src/lib/components/component-icon.component.d.ts +32 -0
- package/src/lib/components/component-icon.component.js +51 -0
- package/src/lib/components/component-icon.component.js.map +1 -0
- package/src/lib/components/component-picker.d.ts +27 -0
- package/src/lib/components/component-picker.js +368 -0
- package/src/lib/components/component-picker.js.map +1 -0
- package/src/lib/components/components-grid-list.component.d.ts +31 -0
- package/src/lib/components/components-grid-list.component.js +162 -0
- package/src/lib/components/components-grid-list.component.js.map +1 -0
- package/src/lib/components/custom-css-form.component.d.ts +115 -0
- package/src/lib/components/custom-css-form.component.js +699 -0
- package/src/lib/components/custom-css-form.component.js.map +1 -0
- package/src/lib/components/device-preview-controls.component.d.ts +22 -0
- package/src/lib/components/device-preview-controls.component.js +150 -0
- package/src/lib/components/device-preview-controls.component.js.map +1 -0
- package/src/lib/components/dnd/canvas-drop-indicator.d.ts +20 -0
- package/src/lib/components/dnd/canvas-drop-indicator.js +61 -0
- package/src/lib/components/dnd/canvas-drop-indicator.js.map +1 -0
- package/src/lib/components/dnd/draggable-droppable.d.ts +31 -0
- package/src/lib/components/dnd/draggable-droppable.js +383 -0
- package/src/lib/components/dnd/draggable-droppable.js.map +1 -0
- package/src/lib/components/dnd/draggable.d.ts +42 -0
- package/src/lib/components/dnd/draggable.js +66 -0
- package/src/lib/components/dnd/draggable.js.map +1 -0
- package/src/lib/components/dnd/drop-indicator.d.ts +31 -0
- package/src/lib/components/dnd/drop-indicator.js +139 -0
- package/src/lib/components/dnd/drop-indicator.js.map +1 -0
- package/src/lib/components/dnd/droppable.d.ts +43 -0
- package/src/lib/components/dnd/droppable.js +63 -0
- package/src/lib/components/dnd/droppable.js.map +1 -0
- package/src/lib/components/element-card.component.d.ts +23 -0
- package/src/lib/components/element-card.component.js +49 -0
- package/src/lib/components/element-card.component.js.map +1 -0
- package/src/lib/components/element-classes-field.component.d.ts +41 -0
- package/src/lib/components/element-classes-field.component.js +140 -0
- package/src/lib/components/element-classes-field.component.js.map +1 -0
- package/src/lib/components/element-detail-overlay.component.d.ts +55 -0
- package/src/lib/components/element-detail-overlay.component.js +157 -0
- package/src/lib/components/element-detail-overlay.component.js.map +1 -0
- package/src/lib/components/element-detail.component.d.ts +56 -0
- package/src/lib/components/element-detail.component.js +171 -0
- package/src/lib/components/element-detail.component.js.map +1 -0
- package/src/lib/components/element-info-details.component.d.ts +18 -0
- package/src/lib/components/element-info-details.component.js +169 -0
- package/src/lib/components/element-info-details.component.js.map +1 -0
- package/src/lib/components/element-interactions-form.component.d.ts +21 -0
- package/src/lib/components/element-interactions-form.component.js +199 -0
- package/src/lib/components/element-interactions-form.component.js.map +1 -0
- package/src/lib/components/element-preview.component.d.ts +75 -0
- package/src/lib/components/element-preview.component.js +346 -0
- package/src/lib/components/element-preview.component.js.map +1 -0
- package/src/lib/components/element-props-form.component.d.ts +565 -0
- package/src/lib/components/element-props-form.component.js +2392 -0
- package/src/lib/components/element-props-form.component.js.map +1 -0
- package/src/lib/components/element-styles-form-template.component.d.ts +27 -0
- package/src/lib/components/element-styles-form-template.component.js +89 -0
- package/src/lib/components/element-styles-form-template.component.js.map +1 -0
- package/src/lib/components/element-styles-form.component.d.ts +52 -0
- package/src/lib/components/element-styles-form.component.js +1350 -0
- package/src/lib/components/element-styles-form.component.js.map +1 -0
- package/src/lib/components/empty-document-slot.d.ts +39 -0
- package/src/lib/components/empty-document-slot.js +121 -0
- package/src/lib/components/empty-document-slot.js.map +1 -0
- package/src/lib/components/empty-results.d.ts +22 -0
- package/src/lib/components/empty-results.js +131 -0
- package/src/lib/components/empty-results.js.map +1 -0
- package/src/lib/components/history-controls.component.d.ts +21 -0
- package/src/lib/components/history-controls.component.js +67 -0
- package/src/lib/components/history-controls.component.js.map +1 -0
- package/src/lib/components/inline-markdown-editor.component.d.ts +17 -0
- package/src/lib/components/inline-markdown-editor.component.js +220 -0
- package/src/lib/components/inline-markdown-editor.component.js.map +1 -0
- package/src/lib/components/inline-text-editor.component.d.ts +48 -0
- package/src/lib/components/inline-text-editor.component.js +905 -0
- package/src/lib/components/inline-text-editor.component.js.map +1 -0
- package/src/lib/components/insert-token-menu.component.d.ts +86 -0
- package/src/lib/components/insert-token-menu.component.js +232 -0
- package/src/lib/components/insert-token-menu.component.js.map +1 -0
- package/src/lib/components/instance-attr-overrides.component.d.ts +50 -0
- package/src/lib/components/instance-attr-overrides.component.js +298 -0
- package/src/lib/components/instance-attr-overrides.component.js.map +1 -0
- package/src/lib/components/interact-controls.component.d.ts +22 -0
- package/src/lib/components/interact-controls.component.js +74 -0
- package/src/lib/components/interact-controls.component.js.map +1 -0
- package/src/lib/components/markdown-attribute-field.component.d.ts +40 -0
- package/src/lib/components/markdown-attribute-field.component.js +103 -0
- package/src/lib/components/markdown-attribute-field.component.js.map +1 -0
- package/src/lib/components/node-card.d.ts +24 -0
- package/src/lib/components/node-card.js +86 -0
- package/src/lib/components/node-card.js.map +1 -0
- package/src/lib/components/node-context-menu.d.ts +25 -0
- package/src/lib/components/node-context-menu.js +558 -0
- package/src/lib/components/node-context-menu.js.map +1 -0
- package/src/lib/components/node-leaf.d.ts +39 -0
- package/src/lib/components/node-leaf.js +628 -0
- package/src/lib/components/node-leaf.js.map +1 -0
- package/src/lib/components/node-outline.d.ts +24 -0
- package/src/lib/components/node-outline.js +156 -0
- package/src/lib/components/node-outline.js.map +1 -0
- package/src/lib/components/node-overlay.d.ts +23 -0
- package/src/lib/components/node-overlay.js +299 -0
- package/src/lib/components/node-overlay.js.map +1 -0
- package/src/lib/components/node-quick-actions.d.ts +24 -0
- package/src/lib/components/node-quick-actions.js +284 -0
- package/src/lib/components/node-quick-actions.js.map +1 -0
- package/src/lib/components/node-tree-view.d.ts +106 -0
- package/src/lib/components/node-tree-view.js +820 -0
- package/src/lib/components/node-tree-view.js.map +1 -0
- package/src/lib/components/panel-controls.component.d.ts +22 -0
- package/src/lib/components/panel-controls.component.js +76 -0
- package/src/lib/components/panel-controls.component.js.map +1 -0
- package/src/lib/components/picker-search-field.d.ts +38 -0
- package/src/lib/components/picker-search-field.js +79 -0
- package/src/lib/components/picker-search-field.js.map +1 -0
- package/src/lib/components/plugin-settings-field.component.d.ts +38 -0
- package/src/lib/components/plugin-settings-field.component.js +264 -0
- package/src/lib/components/plugin-settings-field.component.js.map +1 -0
- package/src/lib/components/properties-dialog.component.d.ts +22 -0
- package/src/lib/components/properties-dialog.component.js +40 -0
- package/src/lib/components/properties-dialog.component.js.map +1 -0
- package/src/lib/components/property-binding-field.component.d.ts +142 -0
- package/src/lib/components/property-binding-field.component.js +325 -0
- package/src/lib/components/property-binding-field.component.js.map +1 -0
- package/src/lib/components/property-values-form.component.d.ts +43 -0
- package/src/lib/components/property-values-form.component.js +223 -0
- package/src/lib/components/property-values-form.component.js.map +1 -0
- package/src/lib/components/scheme-preview-controls.component.d.ts +26 -0
- package/src/lib/components/scheme-preview-controls.component.js +56 -0
- package/src/lib/components/scheme-preview-controls.component.js.map +1 -0
- package/src/lib/components/screen-link-field.component.d.ts +118 -0
- package/src/lib/components/screen-link-field.component.js +282 -0
- package/src/lib/components/screen-link-field.component.js.map +1 -0
- package/src/lib/components/site-theme-color-tokens-provider.component.d.ts +33 -0
- package/src/lib/components/site-theme-color-tokens-provider.component.js +53 -0
- package/src/lib/components/site-theme-color-tokens-provider.component.js.map +1 -0
- package/src/lib/components/subtree-json-dialog.component.d.ts +46 -0
- package/src/lib/components/subtree-json-dialog.component.js +125 -0
- package/src/lib/components/subtree-json-dialog.component.js.map +1 -0
- package/src/lib/components/token-pill.component.d.ts +51 -0
- package/src/lib/components/token-pill.component.js +164 -0
- package/src/lib/components/token-pill.component.js.map +1 -0
- package/src/lib/components/token-text-field.component.d.ts +146 -0
- package/src/lib/components/token-text-field.component.js +603 -0
- package/src/lib/components/token-text-field.component.js.map +1 -0
- package/src/lib/components/tree/tree-list.d.ts +6 -0
- package/src/lib/components/tree/tree-list.js +108 -0
- package/src/lib/components/tree/tree-list.js.map +1 -0
- package/src/lib/components/viewport-canvas.component.d.ts +23 -0
- package/src/lib/components/viewport-canvas.component.js +128 -0
- package/src/lib/components/viewport-canvas.component.js.map +1 -0
- package/src/lib/components/viewport-frame.component.d.ts +47 -0
- package/src/lib/components/viewport-frame.component.js +332 -0
- package/src/lib/components/viewport-frame.component.js.map +1 -0
- package/src/lib/components/viewport-root.component.d.ts +22 -0
- package/src/lib/components/viewport-root.component.js +112 -0
- package/src/lib/components/viewport-root.component.js.map +1 -0
- package/src/lib/components/viewport-zoom-controls.d.ts +29 -0
- package/src/lib/components/viewport-zoom-controls.js +147 -0
- package/src/lib/components/viewport-zoom-controls.js.map +1 -0
- package/src/lib/components/workspace-editor.component.d.ts +23 -0
- package/src/lib/components/workspace-editor.component.js +191 -0
- package/src/lib/components/workspace-editor.component.js.map +1 -0
- package/src/lib/components/workspace-panel.component.d.ts +28 -0
- package/src/lib/components/workspace-panel.component.js +147 -0
- package/src/lib/components/workspace-panel.component.js.map +1 -0
- package/src/lib/constants/sample-data.d.ts +18 -0
- package/src/lib/constants/sample-data.js +106 -0
- package/src/lib/constants/sample-data.js.map +1 -0
- package/src/lib/constants/shared.d.ts +17 -0
- package/src/lib/constants/shared.js +18 -0
- package/src/lib/constants/shared.js.map +1 -0
- package/src/lib/contexts/besigner-app-context.d.ts +30 -0
- package/src/lib/contexts/besigner-app-context.js +41 -0
- package/src/lib/contexts/besigner-app-context.js.map +1 -0
- package/src/lib/contexts/binding-picker-context.d.ts +78 -0
- package/src/lib/contexts/binding-picker-context.js +21 -0
- package/src/lib/contexts/binding-picker-context.js.map +1 -0
- package/src/lib/contexts/canvas-host-tokens-context.d.ts +49 -0
- package/src/lib/contexts/canvas-host-tokens-context.js +63 -0
- package/src/lib/contexts/canvas-host-tokens-context.js.map +1 -0
- package/src/lib/contexts/canvas-reveal-context.d.ts +32 -0
- package/src/lib/contexts/canvas-reveal-context.js +34 -0
- package/src/lib/contexts/canvas-reveal-context.js.map +1 -0
- package/src/lib/contexts/component-promotion-context.d.ts +89 -0
- package/src/lib/contexts/component-promotion-context.js +21 -0
- package/src/lib/contexts/component-promotion-context.js.map +1 -0
- package/src/lib/contexts/components-drawer-context.provider.d.ts +32 -0
- package/src/lib/contexts/components-drawer-context.provider.js +80 -0
- package/src/lib/contexts/components-drawer-context.provider.js.map +1 -0
- package/src/lib/contexts/element-drawer-context.d.ts +1005 -0
- package/src/lib/contexts/element-drawer-context.js +45 -0
- package/src/lib/contexts/element-drawer-context.js.map +1 -0
- package/src/lib/contexts/inspected-selection.d.ts +32 -0
- package/src/lib/contexts/inspected-selection.js +38 -0
- package/src/lib/contexts/inspected-selection.js.map +1 -0
- package/src/lib/contexts/inspector-extras-context.d.ts +56 -0
- package/src/lib/contexts/inspector-extras-context.js +35 -0
- package/src/lib/contexts/inspector-extras-context.js.map +1 -0
- package/src/lib/contexts/interactions-context.d.ts +99 -0
- package/src/lib/contexts/interactions-context.js +22 -0
- package/src/lib/contexts/interactions-context.js.map +1 -0
- package/src/lib/contexts/layout-chrome-context.d.ts +37 -0
- package/src/lib/contexts/layout-chrome-context.js +75 -0
- package/src/lib/contexts/layout-chrome-context.js.map +1 -0
- package/src/lib/contexts/media-asset-facts-context.d.ts +74 -0
- package/src/lib/contexts/media-asset-facts-context.js +27 -0
- package/src/lib/contexts/media-asset-facts-context.js.map +1 -0
- package/src/lib/contexts/media-picker-context.d.ts +88 -0
- package/src/lib/contexts/media-picker-context.js +21 -0
- package/src/lib/contexts/media-picker-context.js.map +1 -0
- package/src/lib/contexts/rendered-canvas-elements.d.ts +42 -0
- package/src/lib/contexts/rendered-canvas-elements.js +79 -0
- package/src/lib/contexts/rendered-canvas-elements.js.map +1 -0
- package/src/lib/contexts/repeat-record-context.d.ts +38 -0
- package/src/lib/contexts/repeat-record-context.js +21 -0
- package/src/lib/contexts/repeat-record-context.js.map +1 -0
- package/src/lib/contexts/repeat-rows-context.d.ts +53 -0
- package/src/lib/contexts/repeat-rows-context.js +38 -0
- package/src/lib/contexts/repeat-rows-context.js.map +1 -0
- package/src/lib/contexts/toolbar-extras-context.d.ts +31 -0
- package/src/lib/contexts/toolbar-extras-context.js +33 -0
- package/src/lib/contexts/toolbar-extras-context.js.map +1 -0
- package/src/lib/drafts/besigner-draft-store.d.ts +110 -0
- package/src/lib/drafts/besigner-draft-store.js +125 -0
- package/src/lib/drafts/besigner-draft-store.js.map +1 -0
- package/src/lib/drafts/besigner-server-draft.d.ts +130 -0
- package/src/lib/drafts/besigner-server-draft.js +211 -0
- package/src/lib/drafts/besigner-server-draft.js.map +1 -0
- package/src/lib/form-fields/components/shared/inline-form-control.d.ts +32 -0
- package/src/lib/form-fields/components/shared/inline-form-control.js +85 -0
- package/src/lib/form-fields/components/shared/inline-form-control.js.map +1 -0
- package/src/lib/form-fields/components/shared/toggle-button-form-control.d.ts +33 -0
- package/src/lib/form-fields/components/shared/toggle-button-form-control.js +83 -0
- package/src/lib/form-fields/components/shared/toggle-button-form-control.js.map +1 -0
- package/src/lib/form-fields/form-fields.d.ts +20 -0
- package/src/lib/form-fields/form-fields.js +21 -0
- package/src/lib/form-fields/form-fields.js.map +1 -0
- package/src/lib/form-fields/index.d.ts +1 -0
- package/src/lib/form-fields/index.js +3 -0
- package/src/lib/form-fields/index.js.map +1 -0
- package/src/lib/hooks/use-add-element-drawer-callback.d.ts +28 -0
- package/src/lib/hooks/use-add-element-drawer-callback.js +112 -0
- package/src/lib/hooks/use-add-element-drawer-callback.js.map +1 -0
- package/src/lib/hooks/use-aglyn-besigner-flag.d.ts +23 -0
- package/src/lib/hooks/use-aglyn-besigner-flag.js +47 -0
- package/src/lib/hooks/use-aglyn-besigner-flag.js.map +1 -0
- package/src/lib/hooks/use-aglyn-besigner-panel-value.d.ts +23 -0
- package/src/lib/hooks/use-aglyn-besigner-panel-value.js +54 -0
- package/src/lib/hooks/use-aglyn-besigner-panel-value.js.map +1 -0
- package/src/lib/hooks/use-aglyn-besigner-panel.d.ts +23 -0
- package/src/lib/hooks/use-aglyn-besigner-panel.js +47 -0
- package/src/lib/hooks/use-aglyn-besigner-panel.js.map +1 -0
- package/src/lib/hooks/use-anchored-rect.d.ts +68 -0
- package/src/lib/hooks/use-anchored-rect.js +131 -0
- package/src/lib/hooks/use-anchored-rect.js.map +1 -0
- package/src/lib/hooks/use-besigner-app-context.d.ts +18 -0
- package/src/lib/hooks/use-besigner-app-context.js +19 -0
- package/src/lib/hooks/use-besigner-app-context.js.map +1 -0
- package/src/lib/hooks/use-besigner-document.d.ts +309 -0
- package/src/lib/hooks/use-besigner-document.js +500 -0
- package/src/lib/hooks/use-besigner-document.js.map +1 -0
- package/src/lib/hooks/use-besigner-draft.d.ts +209 -0
- package/src/lib/hooks/use-besigner-draft.js +429 -0
- package/src/lib/hooks/use-besigner-draft.js.map +1 -0
- package/src/lib/hooks/use-clipboard-callbacks.d.ts +29 -0
- package/src/lib/hooks/use-clipboard-callbacks.js +82 -0
- package/src/lib/hooks/use-clipboard-callbacks.js.map +1 -0
- package/src/lib/hooks/use-clipboard-shortcuts.d.ts +52 -0
- package/src/lib/hooks/use-clipboard-shortcuts.js +102 -0
- package/src/lib/hooks/use-clipboard-shortcuts.js.map +1 -0
- package/src/lib/hooks/use-component-propagation-notice.d.ts +96 -0
- package/src/lib/hooks/use-component-propagation-notice.js +177 -0
- package/src/lib/hooks/use-component-propagation-notice.js.map +1 -0
- package/src/lib/hooks/use-debounced-commit.d.ts +43 -0
- package/src/lib/hooks/use-debounced-commit.js +88 -0
- package/src/lib/hooks/use-debounced-commit.js.map +1 -0
- package/src/lib/hooks/use-delete-element-callback.d.ts +24 -0
- package/src/lib/hooks/use-delete-element-callback.js +82 -0
- package/src/lib/hooks/use-delete-element-callback.js.map +1 -0
- package/src/lib/hooks/use-detail-hover-intent.d.ts +76 -0
- package/src/lib/hooks/use-detail-hover-intent.js +123 -0
- package/src/lib/hooks/use-detail-hover-intent.js.map +1 -0
- package/src/lib/hooks/use-document-repair-callbacks.d.ts +50 -0
- package/src/lib/hooks/use-document-repair-callbacks.js +237 -0
- package/src/lib/hooks/use-document-repair-callbacks.js.map +1 -0
- package/src/lib/hooks/use-insert-token-options.d.ts +52 -0
- package/src/lib/hooks/use-insert-token-options.js +230 -0
- package/src/lib/hooks/use-insert-token-options.js.map +1 -0
- package/src/lib/hooks/use-leaf-drag.d.ts +24 -0
- package/src/lib/hooks/use-leaf-drag.js +28 -0
- package/src/lib/hooks/use-leaf-drag.js.map +1 -0
- package/src/lib/hooks/use-leaf-drop.d.ts +31 -0
- package/src/lib/hooks/use-leaf-drop.js +43 -0
- package/src/lib/hooks/use-leaf-drop.js.map +1 -0
- package/src/lib/hooks/use-markdown-media-picker.d.ts +63 -0
- package/src/lib/hooks/use-markdown-media-picker.js +110 -0
- package/src/lib/hooks/use-markdown-media-picker.js.map +1 -0
- package/src/lib/hooks/use-media-asset-facts-overlay.d.ts +43 -0
- package/src/lib/hooks/use-media-asset-facts-overlay.js +133 -0
- package/src/lib/hooks/use-media-asset-facts-overlay.js.map +1 -0
- package/src/lib/hooks/use-move-node-callbacks.d.ts +22 -0
- package/src/lib/hooks/use-move-node-callbacks.js +57 -0
- package/src/lib/hooks/use-move-node-callbacks.js.map +1 -0
- package/src/lib/hooks/use-node-with-host-tokens.d.ts +42 -0
- package/src/lib/hooks/use-node-with-host-tokens.js +59 -0
- package/src/lib/hooks/use-node-with-host-tokens.js.map +1 -0
- package/src/lib/hooks/use-picker-filter.d.ts +61 -0
- package/src/lib/hooks/use-picker-filter.js +122 -0
- package/src/lib/hooks/use-picker-filter.js.map +1 -0
- package/src/lib/hooks/use-repeat-preview.d.ts +64 -0
- package/src/lib/hooks/use-repeat-preview.js +214 -0
- package/src/lib/hooks/use-repeat-preview.js.map +1 -0
- package/src/lib/hooks/use-repeat-sources.d.ts +17 -0
- package/src/lib/hooks/use-repeat-sources.js +41 -0
- package/src/lib/hooks/use-repeat-sources.js.map +1 -0
- package/src/lib/hooks/use-visible-component-categories.d.ts +37 -0
- package/src/lib/hooks/use-visible-component-categories.js +79 -0
- package/src/lib/hooks/use-visible-component-categories.js.map +1 -0
- package/src/lib/utils/active-host-theme.d.ts +28 -0
- package/src/lib/utils/active-host-theme.js +77 -0
- package/src/lib/utils/active-host-theme.js.map +1 -0
- package/src/lib/utils/attr-target.d.ts +170 -0
- package/src/lib/utils/attr-target.js +229 -0
- package/src/lib/utils/attr-target.js.map +1 -0
- package/src/lib/utils/attribute-field-value.d.ts +21 -0
- package/src/lib/utils/attribute-field-value.js +28 -0
- package/src/lib/utils/attribute-field-value.js.map +1 -0
- package/src/lib/utils/canvas-context-menu.d.ts +28 -0
- package/src/lib/utils/canvas-context-menu.js +56 -0
- package/src/lib/utils/canvas-context-menu.js.map +1 -0
- package/src/lib/utils/canvas-reveal.d.ts +115 -0
- package/src/lib/utils/canvas-reveal.js +165 -0
- package/src/lib/utils/canvas-reveal.js.map +1 -0
- package/src/lib/utils/describe-element.d.ts +72 -0
- package/src/lib/utils/describe-element.js +159 -0
- package/src/lib/utils/describe-element.js.map +1 -0
- package/src/lib/utils/device-preview-styles.d.ts +89 -0
- package/src/lib/utils/device-preview-styles.js +228 -0
- package/src/lib/utils/device-preview-styles.js.map +1 -0
- package/src/lib/utils/docs-help.d.ts +22 -0
- package/src/lib/utils/docs-help.generated.d.ts +47 -0
- package/src/lib/utils/docs-help.generated.js +229 -0
- package/src/lib/utils/docs-help.generated.js.map +1 -0
- package/src/lib/utils/docs-help.js +37 -0
- package/src/lib/utils/docs-help.js.map +1 -0
- package/src/lib/utils/held-answers-store.d.ts +59 -0
- package/src/lib/utils/held-answers-store.js +94 -0
- package/src/lib/utils/held-answers-store.js.map +1 -0
- package/src/lib/utils/in-place-edit-surface.d.ts +118 -0
- package/src/lib/utils/in-place-edit-surface.js +164 -0
- package/src/lib/utils/in-place-edit-surface.js.map +1 -0
- package/src/lib/utils/inline-markdown-edit.store.d.ts +71 -0
- package/src/lib/utils/inline-markdown-edit.store.js +90 -0
- package/src/lib/utils/inline-markdown-edit.store.js.map +1 -0
- package/src/lib/utils/inline-text-edit.store.d.ts +85 -0
- package/src/lib/utils/inline-text-edit.store.js +78 -0
- package/src/lib/utils/inline-text-edit.store.js.map +1 -0
- package/src/lib/utils/instance-leaf-hit.d.ts +39 -0
- package/src/lib/utils/instance-leaf-hit.js +56 -0
- package/src/lib/utils/instance-leaf-hit.js.map +1 -0
- package/src/lib/utils/muted-classes.d.ts +76 -0
- package/src/lib/utils/muted-classes.js +108 -0
- package/src/lib/utils/muted-classes.js.map +1 -0
- package/src/lib/utils/muted-styles.d.ts +125 -0
- package/src/lib/utils/muted-styles.js +193 -0
- package/src/lib/utils/muted-styles.js.map +1 -0
- package/src/lib/utils/numeric-text-value.d.ts +42 -0
- package/src/lib/utils/numeric-text-value.js +47 -0
- package/src/lib/utils/numeric-text-value.js.map +1 -0
- package/src/lib/utils/preset-interactions.d.ts +37 -0
- package/src/lib/utils/preset-interactions.js +87 -0
- package/src/lib/utils/preset-interactions.js.map +1 -0
- package/src/lib/utils/publish-failure-message.d.ts +35 -0
- package/src/lib/utils/publish-failure-message.js +51 -0
- package/src/lib/utils/publish-failure-message.js.map +1 -0
- package/src/lib/utils/rank-picker-results.d.ts +45 -0
- package/src/lib/utils/rank-picker-results.js +136 -0
- package/src/lib/utils/rank-picker-results.js.map +1 -0
- package/src/lib/utils/responsive-sx.d.ts +65 -0
- package/src/lib/utils/responsive-sx.js +129 -0
- package/src/lib/utils/responsive-sx.js.map +1 -0
- package/src/lib/utils/rich-text-commands.d.ts +28 -0
- package/src/lib/utils/rich-text-commands.js +43 -0
- package/src/lib/utils/rich-text-commands.js.map +1 -0
- package/src/lib/utils/sanitize-rich-text.d.ts +52 -0
- package/src/lib/utils/sanitize-rich-text.js +173 -0
- package/src/lib/utils/sanitize-rich-text.js.map +1 -0
- package/src/lib/utils/state-sx.d.ts +255 -0
- package/src/lib/utils/state-sx.js +338 -0
- package/src/lib/utils/state-sx.js.map +1 -0
- package/src/lib/utils/style-field-groups.d.ts +136 -0
- package/src/lib/utils/style-field-groups.js +874 -0
- package/src/lib/utils/style-field-groups.js.map +1 -0
- package/src/lib/utils/style-field-search.d.ts +84 -0
- package/src/lib/utils/style-field-search.js +505 -0
- package/src/lib/utils/style-field-search.js.map +1 -0
- package/src/lib/utils/style-target.d.ts +69 -0
- package/src/lib/utils/style-target.js +203 -0
- package/src/lib/utils/style-target.js.map +1 -0
- package/src/lib/utils/theme-scale-options.d.ts +169 -0
- package/src/lib/utils/theme-scale-options.js +702 -0
- package/src/lib/utils/theme-scale-options.js.map +1 -0
- package/src/lib/utils/token-editable-dom.d.ts +82 -0
- package/src/lib/utils/token-editable-dom.js +280 -0
- package/src/lib/utils/token-editable-dom.js.map +1 -0
- package/src/lib/utils/token-segments.d.ts +111 -0
- package/src/lib/utils/token-segments.js +246 -0
- package/src/lib/utils/token-segments.js.map +1 -0
- package/src/lib/utils/visibility-styles.d.ts +38 -0
- package/src/lib/utils/visibility-styles.js +54 -0
- package/src/lib/utils/visibility-styles.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/element-props-form.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport PluginSettingsField, {\n PLUGIN_SETTINGS_FIELD_COMPONENT,\n} from './plugin-settings-field.component'\nimport type * as Aglyn from '@aglyn/aglyn'\nimport {\n ANIMATION_DEFAULT_DELAY_MS,\n ANIMATION_DEFAULT_DURATION_MS,\n ANIMATION_DEFAULT_EASE,\n ANIMATION_DEFAULT_STAGGER_STEP_MS,\n ANIMATION_DEFAULT_TRIGGER,\n ANIMATION_MAX_DURATION_MS,\n ANIMATION_MAX_STAGGER_STEP_MS,\n ANIMATION_NONE,\n ANIMATION_PRESETS,\n canvas,\n COMPONENT_PROP_NAME_PATTERN,\n components,\n displayBindingTokens,\n ENTITY_PICKER_BROWSE_LIMIT,\n entityListState,\n EntityPickerContext,\n entityValueNeedsResolution,\n FEATURE_FLAG,\n FieldComponentType,\n getKnownPluginInstalls,\n getKnownPluginInstallsVersion,\n hasBindings,\n inheritedMediaAlt,\n intrinsicMediaSize,\n linkTargetKind,\n VIDEO_COMPONENT_ID,\n videoMediaProps,\n MISSING_BINDING_LABEL,\n NODE_ANIMATION_DELAY_PROP,\n NODE_ANIMATION_DURATION_PROP,\n NODE_ANIMATION_EASE_PROP,\n NODE_ANIMATION_PROP,\n NODE_ANIMATION_REPEAT_PROP,\n NODE_ANIMATION_STAGGER_PROP,\n NODE_ANIMATION_STAGGER_STEP_PROP,\n NODE_ANIMATION_TRIGGER_PROP,\n NODE_HIDE_IF_PROP,\n NODE_HIDE_UNLESS_PROP,\n normalizeBindingTokens,\n readInstanceIconValue,\n readReusablePropValue,\n readYesNoValue,\n reusablePropConditionValue,\n reusablePropDefaultValue,\n reusablePropKind,\n reusablePropTakesSeveral,\n evaluateReusablePropRule,\n REUSABLE_INSTANCE_COMPONENT_ID,\n REUSABLE_INSTANCE_PROP_VALUES_KEY,\n ScreenLinkContext,\n screenLinkTargetOptions,\n subscribeKnownPluginInstalls,\n unresolvedScreenOption,\n} from '@aglyn/aglyn'\n// By path, not the `@aglyn/aglyn` barrel: a repeat's bounds and the sources\n// an editor offers are editor business, and a published page must not pull\n// either in behind them.\nimport { repeatScope } from '@aglyn/aglyn/app-utils/expand-repeatables'\nimport { REPEAT_NODE_CAPABILITY } from '@aglyn/aglyn/app-utils/node-capabilities'\nimport {\n type RepeatSource,\n repeatSourceOf,\n} from '@aglyn/aglyn/app-utils/repeat-sources'\nimport { useAglynSiteTheme } from '@aglyn/aglyn-node-renderer'\nimport {\n FormRenderer,\n type FormRendererProps,\n FormSpy,\n type FormTemplateRenderProps,\n FIELD_MAP_BREAKPOINT_SPAN,\n FIELD_MAP_CHECKBOX,\n FIELD_MAP_COLOR_PICKER,\n FIELD_MAP_CSS_BORDER,\n FIELD_MAP_CSS_DIMENSION,\n FIELD_MAP_CSS_GRADIENT,\n FIELD_MAP_DATA_TABLE,\n FIELD_MAP_DUAL_LIST_SELECT,\n FIELD_MAP_ICON_PICKER,\n FIELD_MAP_PRESET_CHOICE,\n FIELD_MAP_RADIO,\n FIELD_MAP_SLIDER,\n FIELD_MAP_THEME_SCALE,\n FIELD_MAP_TOGGLE_BUTTON,\n simpleComponentMapper,\n useFormApi,\n} from '@aglyn/shared-ui-jsx-forms'\nimport { useHostThemeDocument } from '@aglyn/shared-ui-theme'\nimport {\n getMdiIconPath,\n iconPathPropName,\n mdiContentSave,\n} from '@aglyn/shared-data-mdi'\nimport {\n HelpTip,\n MdiIcon,\n} from '@aglyn/shared-ui-jsx'\nimport {\n Alert,\n IconButton,\n NoSsr,\n Stack,\n Switch,\n TextField,\n Tooltip,\n Typography,\n} from '@mui/material'\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport FormControl from '@mui/material/FormControl'\nimport MuiMenuItem from '@mui/material/MenuItem'\nimport { Grid } from '@mui/material'\nimport { observer } from 'mobx-react-lite'\nimport * as Besigner from '@aglyn/besigner'\nimport { forwardRef, memo, type SyntheticEvent, useCallback, useContext, useEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react'\nimport { BindingPickerContext } from '../contexts/binding-picker-context'\nimport { InsertTokenMenu } from './insert-token-menu.component'\nimport {\n TokenTextField,\n TOKEN_TEXT_FIELD_COMPONENT,\n} from './token-text-field.component'\nimport {\n MarkdownAttributeField,\n MARKDOWN_ATTRIBUTE_FIELD_COMPONENT,\n} from './markdown-attribute-field.component'\nimport {\n ScreenLinkField,\n ScreenTargetField,\n SCREEN_LINK_FIELD_COMPONENT,\n SCREEN_TARGET_FIELD_COMPONENT,\n} from './screen-link-field.component'\nimport {\n PropertyBindingField,\n type PropertyBindingControl,\n PROPERTY_BINDING_FIELD_COMPONENT,\n withPropertyBinding,\n} from './property-binding-field.component'\nimport { readAttributeFieldValue } from '../utils/attribute-field-value'\nimport { besignerDocsUrl } from '../utils/docs-help'\nimport { buildStyleThemeScales } from '../utils/theme-scale-options'\nimport { numericTextValue } from '../utils/numeric-text-value'\nimport ElementInfoDetails from './element-info-details.component'\nimport useInsertTokenOptions from '../hooks/use-insert-token-options'\nimport useRepeatSources from '../hooks/use-repeat-sources'\nimport {\n InteractionsContext,\n nodeElementSelector,\n type InteractionTriggerEvent,\n} from '../contexts/interactions-context'\nimport { MediaPickerContext } from '../contexts/media-picker-context'\nimport { ComponentPromotionContext } from '../contexts/component-promotion-context'\nimport { InstanceAttrOverrides } from './instance-attr-overrides.component'\nimport useDeleteElementCallback from '../hooks/use-delete-element-callback'\n\n// The AGL-567 debounce now lives in `../hooks/use-debounced-commit` so the\n// draft snapshotter can share it (AGL-1256) without importing this form and\n// its whole data-driven-forms dependency tree. Re-exported here because this\n// is where every existing caller and test imports it from.\nexport {\n ATTRIBUTE_COMMIT_DEBOUNCE_MS,\n useDebouncedCommit,\n} from '../hooks/use-debounced-commit'\nexport { readAttributeFieldValue } from '../utils/attribute-field-value'\nimport { useDebouncedCommit } from '../hooks/use-debounced-commit'\nimport { useNodeWithMediaAssetFacts } from '../hooks/use-media-asset-facts-overlay'\n\n// Subscribes to form value changes via FormSpy and schedules a debounced\n// commit when dirty. The spy is needed because MUI Select uses a Portal, so\n// its onChange never bubbles through the <form> element as a DOM event.\nconst AutoSaveOnChange = memo(function AutoSaveOnChange({\n values,\n pristine,\n valid,\n onSchedule,\n}: {\n values: unknown\n pristine: boolean\n valid: boolean\n onSchedule: () => void\n}) {\n const isFirstRender = useRef(true)\n useEffect(() => {\n if (isFirstRender.current) {\n isFirstRender.current = false\n return\n }\n if (!pristine && valid) {\n onSchedule()\n }\n }, [values]) // eslint-disable-line react-hooks/exhaustive-deps\n return null\n})\n\n/**\n * @TODO ⚠️ remove and reimplement following PR merge\n * https://github.com/data-driven-forms/react-forms/pull/1218\n */\n/**\n * Whether a node's text is FORMATTED — it carries a `html` prop the renderer\n * draws in preference to `children` (AGL-2486).\n *\n * An instance is excluded: its text rides `propValues`, not a `html` prop of\n * its own, so the question does not arise there.\n */\nexport function isFormattedText(\n node: Aglyn.NodeSchema<any> | undefined | null,\n): boolean {\n if (!node) return false\n if (node.componentId === REUSABLE_INSTANCE_COMPONENT_ID) return false\n const html = (node.props as { html?: unknown } | undefined)?.html\n return typeof html === 'string' && html.length > 0\n}\n\n/**\n * The same props with the formatting dropped and the words kept\n * (AGL-2486).\n *\n * `children` is deliberately untouched. It already holds the plain reading\n * of the markup — and since `richTextToPlain` keeps line breaks, that\n * reading has the author's breaks in it — so the element goes on saying the\n * same thing in the same shape, in a form this panel can edit.\n */\nexport function withoutFormatting(\n props: Record<string, unknown> | undefined,\n): Record<string, unknown> {\n const next = { ...(props ?? {}) }\n delete next['html']\n return next\n}\n\nexport const ElementPropsFormTemplate = forwardRef<\n any,\n FormTemplateRenderProps\n>((props, ref) => {\n const { formFields, schema, ...rest } = props\n const { handleSubmit } = useFormApi()\n const { schedule, flush } = useDebouncedCommit(handleSubmit)\n return (\n <form\n ref={ref}\n onSubmit={handleSubmit}\n noValidate\n {...rest}\n // Focus leaving any field (clicking another node, tabbing away, pressing\n // Save) forces the pending debounced commit out immediately, so an edit\n // is never stranded in the debounce window while switching selection\n // (AGL-567). Placed after {...rest} so this handler always wins.\n onBlur={flush}\n >\n {schema.title}\n <Grid spacing={2} container>\n {formFields as unknown as JSX.Node}\n </Grid>\n <FormSpy subscription={{ values: true, pristine: true, valid: true }}>\n {({ values, pristine, valid }) => (\n <AutoSaveOnChange\n values={values}\n pristine={pristine}\n valid={valid}\n onSchedule={schedule}\n />\n )}\n </FormSpy>\n <FormSpy>\n {({ submitting, pristine, valid }) => (\n <Box sx={{ mt: 2 }}>\n <FormControl margin=\"normal\" fullWidth>\n <Button\n color=\"primary\"\n disabled={submitting || !valid || pristine}\n startIcon={<MdiIcon path={mdiContentSave.path} />}\n style={{ marginRight: 8 }}\n type=\"submit\"\n variant=\"contained\"\n fullWidth\n >\n Save Element\n </Button>\n </FormControl>\n </Box>\n )}\n </FormSpy>\n </form>\n );\n})\nElementPropsFormTemplate.displayName = 'ElementPropsFormTemplate'\nElementPropsFormTemplate.aglyn = true\n\nexport interface ElementPropsFormProps\n extends Omit<FormRendererProps, 'schema' | 'componentMapper'> {\n node?: Aglyn.NodeSchema<any>\n /**\n * Supplied by the component, not the caller: `ElementPropsFormRaw` reads\n * `node.componentSchema` and ignores anything passed in, and the production\n * mount (`withLastSelectedNode(withTabPanelInner(...))`) passes neither. They\n * stayed required only because the interface extended `FormRendererProps`\n * wholesale, so any direct render was a type error for props the component\n * discards.\n */\n schema?: FormRendererProps['schema']\n componentMapper?: FormRendererProps['componentMapper']\n}\n\n// Attribute editors available to canvas component schemas: the simple set\n// plus pickers components actually declare (icon picker AGL-146, checkbox\n// AGL-162, color picker AGL-584 — the email blocks declare 5 color\n// attributes and an unregistered type makes the form renderer throw,\n// which blanked the email designer's whole attributes panel).\nexport const elementPropsComponentMapper = {\n ...simpleComponentMapper,\n [FieldComponentType.ICON_PICKER]: FIELD_MAP_ICON_PICKER,\n [FieldComponentType.CHECKBOX]: FIELD_MAP_CHECKBOX,\n [FieldComponentType.COLOR_PICKER]: FIELD_MAP_COLOR_PICKER,\n // Number + unit editor for CSS length attributes (AGL-1219): width,\n // height and friends were free text, so the author had to type the unit\n // and a bare `320` silently did nothing.\n [FieldComponentType.CSS_DIMENSION]: FIELD_MAP_CSS_DIMENSION,\n // Background fill editor for gradient-capable attributes (AGL-1331);\n // the Styles panel reaches it through the shared componentMapper.\n [FieldComponentType.CSS_GRADIENT]: FIELD_MAP_CSS_GRADIENT,\n [FieldComponentType.DATA_TABLE]: FIELD_MAP_DATA_TABLE,\n // Per-breakpoint span/offset row for Grid cells (AGL-2486). Registered\n // here or the attributes memo's unknown-editor filter drops Span and\n // Offset from the panel entirely rather than throwing (AGL-584).\n [FieldComponentType.BREAKPOINT_SPAN]: FIELD_MAP_BREAKPOINT_SPAN,\n // The rest of the attribute schema's value-holding field kinds (AGL-2893).\n // A coded component could always declare them and the panel silently\n // dropped them; a component or layout property of the same kind is edited\n // with the same control, so each is registered here once, for both.\n [FieldComponentType.CSS_BORDER]: FIELD_MAP_CSS_BORDER,\n [FieldComponentType.PRESET_CHOICE]: FIELD_MAP_PRESET_CHOICE,\n [FieldComponentType.THEME_SCALE]: FIELD_MAP_THEME_SCALE,\n [FieldComponentType.RADIO]: FIELD_MAP_RADIO,\n [FieldComponentType.SLIDER]: FIELD_MAP_SLIDER,\n [FieldComponentType.TOGGLE_BUTTON]: FIELD_MAP_TOGGLE_BUTTON,\n [FieldComponentType.DUAL_LIST_SELECT]: FIELD_MAP_DUAL_LIST_SELECT,\n // Pill-rendering editor for token-capable free-text attributes\n // (AGL-586); the attributes memo rewrites TEXT_FIELD/TEXTAREA to it.\n [TOKEN_TEXT_FIELD_COMPONENT]: TokenTextField,\n // Screen picker + external-URL escape hatch for `Link`-typed component\n // props (AGL-1335), which were plain text boxes storing a raw path.\n [SCREEN_LINK_FIELD_COMPONENT]: ScreenLinkField,\n // The attributes' own Screen pickers (`SCREEN_SELECT`), searchable and\n // offering entries (AGL-3119); `resolveAttributeField` rewrites to it.\n [SCREEN_TARGET_FIELD_COMPONENT]: ScreenTargetField,\n // The markdown-lite WYSIWYG for document-valued attributes (AGL-1616),\n // registered under BOTH the schema-declared type and the internal key so a\n // schema can ask for it directly and the memo below can rewrite to it.\n [FieldComponentType.MARKDOWN]: MarkdownAttributeField,\n [MARKDOWN_ATTRIBUTE_FIELD_COMPONENT]: MarkdownAttributeField,\n // A placed plugin's declared settings as real fields (AGL-1049); the\n // attributes memo rewrites the plugin's JSON attribute to it.\n [PLUGIN_SETTINGS_FIELD_COMPONENT]: PluginSettingsField,\n // A field with no text box inside a component editor, wrapped so it can be\n // bound to one of the component's properties; the attributes memo wraps\n // them (see `withPropertyBinding`).\n [PROPERTY_BINDING_FIELD_COMPONENT]: PropertyBindingField,\n}\n\n/**\n * A number-typed field persists a NUMBER, not the text that was typed.\n *\n * Every control in this panel can only hand back a string, and for a prop\n * the renderer reads as a number that changes what the value DOES: MUI\n * renders `size: 24` as 24px and passes the string `'24'` through verbatim,\n * where it is not CSS and the declaration is dropped — the icon silently\n * goes back to its default size. Clearing the box to retype the same number\n * is enough to do it.\n *\n * Gated on the field's declared `type: 'number'` rather than on the value's\n * shape, which is how the styles panel decides ({@link numericTextValue}):\n * every value there is CSS, while an attribute holds arbitrary authored\n * content, and a Text element reading `2026` is text that must stay text.\n *\n * Implemented as final-form's `parse` rather than data-driven-forms'\n * `dataType`, which converts the same way but ALSO attaches a pattern\n * validator. These fields are token-capable, so a `{{var:id}}` binding —\n * legitimate in a numeric prop — would make the form invalid, and this\n * panel's autosave only commits while it is valid: every attribute on the\n * element would stop saving, with nothing on screen to say so.\n */\nexport function withNumericValueParse<T extends Record<string, unknown>>(\n field: T,\n): T {\n if (field['type'] !== 'number') return field\n return {\n ...field,\n FieldProps: {\n ...((field['FieldProps'] as Record<string, unknown>) ?? {}),\n parse: numericTextValue,\n },\n }\n}\n\n/**\n * The field, with its `resolveProps` handed the element it edits as a fourth\n * argument (see {@link Aglyn.AttributeFieldContext}).\n *\n * data-driven-forms calls `resolveProps` with the field's value and the form's\n * values, which are the element's own props. A warning about the element as a\n * whole also needs what is inside it — a Link Container holding only an icon\n * renders an unnamed link (AGL-2886) — and nothing else tells a field which\n * element on the canvas it belongs to.\n *\n * The context is read when the field renders, not when this runs, so the\n * lookup answers from the live canvas rather than from a copy taken when the\n * element was selected. A field that declares no `resolveProps` is returned\n * untouched.\n */\nexport function withAttributeFieldContext<T extends Record<string, unknown>>(\n field: T,\n context: Aglyn.AttributeFieldContext | undefined,\n): T {\n const resolveProps = field['resolveProps']\n if (!context || typeof resolveProps !== 'function') return field\n return {\n ...field,\n resolveProps: (\n ...args: Parameters<Aglyn.AttributeResolveProps>\n ): ReturnType<Aglyn.AttributeResolveProps> =>\n (resolveProps as Aglyn.AttributeResolveProps)(\n args[0],\n args[1],\n args[2],\n context,\n ),\n }\n}\n\n/**\n * The switch's position as the page stores it: a real boolean, read with the\n * spellings every Yes / no reader accepts, so a value stored as the text\n * `'false'` or `'off'` shows off rather than on.\n *\n * Unset is not a position a switch has, and it is the one a page needs to hand\n * the choice back to the default — so the field's clear button is the way\n * there, and it removes the value rather than storing either answer.\n */\nexport function parseYesNoPropValue(value: unknown): boolean | undefined {\n if (value === undefined || value === null || value === '') return undefined\n return readYesNoValue(value)\n}\n\n/**\n * The path each icon picker's companion prop should hold once these values\n * are saved: `iconId` → `iconPath`, `startIconId` → `startIconPath`\n * (AGL-1212).\n *\n * The id stays the source of truth and the path travels with the document,\n * because the catalog is ~2.9 MB, only picker surfaces load it, and a\n * published page has to draw the icon without it.\n *\n * The lookup runs on every save of the panel, and the panel saves edits to\n * every other attribute too — from the moment it opens, before the picker has\n * finished loading the catalog (AGL-2879). So a miss is not evidence the icon\n * has no path: for an id that did NOT change it keeps the path already\n * stored. For a changed id the lookup decides, and a miss clears the path,\n * because the old icon's path is never the new icon's.\n */\nexport function iconPathsForSave(\n attributes: readonly Aglyn.AglynAttributeSchema[] | undefined | null,\n values: Record<string, unknown>,\n stored: Record<string, unknown> | undefined | null,\n): Record<string, string | undefined> {\n const paths: Record<string, string | undefined> = {}\n for (const attribute of attributes ?? []) {\n if (attribute?.component !== FieldComponentType.ICON_PICKER) continue\n const pathProp = iconPathPropName(attribute.name)\n if (pathProp === attribute.name) continue\n const pickedId = values[attribute.name]\n if (typeof pickedId !== 'string' || !pickedId) {\n paths[pathProp] = undefined\n continue\n }\n const unchanged = pickedId === stored?.[attribute.name]\n const storedPath = stored?.[pathProp]\n paths[pathProp] =\n getMdiIconPath(pickedId) ??\n (unchanged && typeof storedPath === 'string' ? storedPath : undefined)\n }\n return paths\n}\n\n/**\n * An icon property's stored pick as the icon picker shows it: the icon's id,\n * or `''` for nothing picked.\n */\nexport function formatIconPropValue(value: unknown): string {\n return readInstanceIconValue(value)?.iconId ?? ''\n}\n\n/**\n * The icon picker's choice as the instance stores it: the id AND its SVG path,\n * or unset.\n *\n * The path is looked up here, at the moment of the pick, for the reason\n * `handleElementSave` stores `iconPath` beside an Icon element's `iconId`\n * (AGL-1212): a published page never loads the icon catalog, so an id alone\n * draws the empty Icon placeholder. This is the one moment the catalog is\n * certainly loaded — the picker needed it to offer the icon — and an\n * untouched field is never parsed again, so no later edit can look the id up\n * against a catalog that has not arrived.\n */\nexport function parseIconPropValue(\n value: unknown,\n): Aglyn.ReusableComponentIcon | undefined {\n if (typeof value !== 'string' || !value) return undefined\n const iconPath = getMdiIconPath(value)\n return iconPath ? { iconId: value, iconPath } : { iconId: value }\n}\n\n/** Who a property belongs to, in the words its fields speak. */\nexport type PropertyOwnerNoun = 'component' | 'layout'\n\n/** How {@link buildPropertyField} draws one property. */\nexport interface PropertyFieldOptions {\n /** The form path the field saves to, e.g. `propValues.headline`. */\n name: string\n /**\n * `value` for a page setting the property, where an empty field means \"use\n * the default\" and says so; `default` for the Properties dialog declaring\n * that default, where it means \"no default\".\n */\n role: 'value' | 'default'\n /** Every property the owner declares, so a condition can read the others. */\n declared?: readonly Aglyn.ReusableComponentProp[]\n /** The form path a declared property's value sits at, by name. */\n valuePath?: (propName: string) => string\n noun?: PropertyOwnerNoun\n /** Token-capable fields offer these in their `{}` menu. */\n tokenOptions?: unknown\n tokenLabelContext?: unknown\n /** The site theme's scales, for the Theme scale and Theme preset kinds. */\n themeScales?: Partial<Record<string, unknown>>\n}\n\n/** The attribute controls that draw the reset-to-unset corner button. */\nconst CLEARABLE_FIELD_KINDS: ReadonlySet<string> = new Set([\n FieldComponentType.CHECKBOX,\n FieldComponentType.COLOR_PICKER,\n FieldComponentType.CSS_BORDER,\n FieldComponentType.CSS_DIMENSION,\n FieldComponentType.CSS_GRADIENT,\n FieldComponentType.ICON_PICKER,\n FieldComponentType.PRESET_CHOICE,\n FieldComponentType.RADIO,\n FieldComponentType.SELECT,\n FieldComponentType.SLIDER,\n FieldComponentType.SWITCH,\n FieldComponentType.THEME_SCALE,\n FieldComponentType.TOGGLE_BUTTON,\n // Drawn as dropdowns once resolved.\n FieldComponentType.CATEGORY_SELECT,\n FieldComponentType.COLLECTION_SELECT,\n FieldComponentType.DATASET_FIELD_SELECT,\n FieldComponentType.DATASET_SELECT,\n FieldComponentType.FORM_SELECT,\n FieldComponentType.NODE_SELECT,\n FieldComponentType.PLUGIN_SELECT,\n FieldComponentType.PRODUCT_SELECT,\n])\n\n/** A property's answers as a field's options: by label, falling back to the value. */\nfunction propertyAnswers(\n prop: Aglyn.ReusableComponentProp,\n): Array<{ value: string; label: string }> {\n return (prop.options ?? [])\n .filter((option) => option?.value)\n .map((option) => ({ value: option.value, label: option.label || option.value }))\n}\n\n/**\n * The line under a page's field naming the default an empty field falls back\n * to, or `undefined` where there is none to name or the control names it\n * itself.\n */\nfunction describePropertyDefault(\n prop: Aglyn.ReusableComponentProp,\n answers: Array<{ value: string; label: string }>,\n): string | undefined {\n const fallback = reusablePropDefaultValue(prop)\n if (fallback === undefined) return undefined\n if (answers.length) {\n const chosen = (Array.isArray(fallback) ? fallback : [fallback])\n .map((value) => answers.find((answer) => answer.value === value)?.label)\n .filter(Boolean)\n return chosen.length ? `Defaults to ${chosen.join(', ')}` : undefined\n }\n const text = Array.isArray(fallback) ? fallback.join(', ') : String(fallback)\n return text ? `Defaults to \"${text}\"` : undefined\n}\n\n/**\n * A property's condition as the form renderer evaluates one (AGL-2893): each\n * rule reads the named property's field, and compares what that property is\n * worth on the page — its own value, else its default — the way the published\n * page compares it, so the field shows exactly where the value applies.\n *\n * The operators are data-driven-forms' own; each rule becomes a function `is`\n * only so an unset field can be read as its default first.\n */\nexport function propertyFieldCondition(\n condition: Aglyn.ReusableComponentProp['condition'],\n declared: readonly Aglyn.ReusableComponentProp[],\n valuePath: (propName: string) => string,\n): unknown {\n if (condition == null) return undefined\n const byName = new Map(declared.map((prop) => [prop.name, prop]))\n const convert = (entry: unknown): unknown => {\n if (Array.isArray(entry)) return entry.map(convert)\n if (!entry || typeof entry !== 'object') return entry\n if ('and' in entry) {\n const and = (entry as { and: unknown }).and\n return { and: (Array.isArray(and) ? and : [and]).map(convert) }\n }\n if ('or' in entry) {\n const or = (entry as { or: unknown }).or\n return { or: (Array.isArray(or) ? or : [or]).map(convert) }\n }\n if ('not' in entry) return { not: convert((entry as { not: unknown }).not) }\n const { when, ...rule } = entry as Aglyn.ReusableComponentPropRule\n const target = byName.get(when)\n return {\n when: valuePath(when),\n is: (value: unknown) => {\n const own = readReusablePropValue(value, target)\n return evaluateReusablePropRule(\n rule,\n reusablePropConditionValue(\n target,\n own === undefined ? reusablePropDefaultValue(target) : own,\n ),\n )\n },\n }\n }\n return convert(condition)\n}\n\n/**\n * One component or layout property as an Attributes field (AGL-1247,\n * AGL-2893): the attribute schema field its kind names — a switch for a\n * Yes / no, the icon picker for an Icon, the color picker for a Color — with\n * the kind's options and settings, and the property's condition.\n *\n * The result is an attribute field like any coded component's, so it is\n * finished by {@link resolveAttributeField} and drawn by\n * `elementPropsComponentMapper`: the Properties dialog's Default, an\n * instance's Attributes and a screen's layout values all edit a property with\n * the control a coded component's attribute of that kind gets.\n */\nexport function buildPropertyField(\n prop: Aglyn.ReusableComponentProp,\n options: PropertyFieldOptions,\n): Record<string, unknown> {\n const {\n name,\n role,\n declared = [],\n valuePath = (propName: string) => propName,\n noun = 'component',\n tokenOptions,\n tokenLabelContext,\n themeScales,\n } = options\n const kind = reusablePropKind(prop.type)\n const type = prop.type ?? 'text'\n const label = prop.label || prop.name\n const settings = prop.settings ?? {}\n const answers = propertyAnswers(prop)\n const pageSets = role === 'value'\n const defaultNote = pageSets ? describePropertyDefault(prop, answers) : undefined\n const condition = pageSets\n ? propertyFieldCondition(prop.condition, declared, valuePath)\n : undefined\n const base: Record<string, unknown> = {\n name,\n label,\n component: kind.field,\n ...(kind.fieldProps ?? {}),\n ...(prop.description\n ? { help: { title: label, excerpt: prop.description } }\n : {}),\n ...(defaultNote ? { description: defaultNote } : {}),\n ...(condition ? { condition } : {}),\n // The corner ✕ that hands a value back to unset, on the controls that\n // draw one; a free-text field empties by being emptied.\n ...(CLEARABLE_FIELD_KINDS.has(kind.field) ? { clearable: true } : {}),\n }\n const ownersDefault = `the ${noun} default`\n\n switch (type) {\n case 'boolean':\n case FieldComponentType.CHECKBOX: {\n if (reusablePropTakesSeveral(prop)) {\n return { ...base, clearable: undefined, options: answers }\n }\n // Yes, No, or the owner's default — three answers, and a switch shows\n // two. So an empty field shows the position of the default it renders\n // with, says that is where the position comes from, and the corner ✕\n // is the way back to it once the page has chosen.\n const fallback = pageSets ? prop.defaultValue : undefined\n const fallbackAnswer = readYesNoValue(fallback) === true ? 'Yes' : 'No'\n return {\n ...base,\n description: undefined,\n // The default's position while the page has set nothing, since that\n // is what the page renders.\n unsetChecked: readYesNoValue(fallback) === true,\n // Read with the spellings every Yes / no reader accepts, so a value\n // stored as the text `'false'` shows off rather than on.\n FieldProps: { parse: parseYesNoPropValue },\n ...(pageSets\n ? {\n resolveProps: (\n _props: unknown,\n _field: unknown,\n formOptions?: { getFieldState?: (path: string) => { value?: unknown } | undefined },\n ) => {\n const stored = formOptions?.getFieldState?.(name)?.value\n return stored === undefined || stored === null || stored === ''\n ? { description: `Uses ${ownersDefault} (${fallbackAnswer})` }\n : {}\n },\n }\n : {}),\n }\n }\n case 'choice': {\n const several = reusablePropTakesSeveral(prop)\n const fallback = reusablePropDefaultValue(prop)\n const fallbackLabels = (Array.isArray(fallback) ? fallback : [fallback])\n .map((value) => answers.find((answer) => answer.value === value)?.label)\n .filter(Boolean)\n return {\n ...base,\n options: answers,\n ...(several ? { isMulti: true } : {}),\n description: undefined,\n placeholder: pageSets\n ? fallbackLabels.length\n ? `Use ${ownersDefault} (${fallbackLabels.join(', ')})`\n : 'Not set'\n : 'No default',\n }\n }\n case FieldComponentType.RADIO:\n case FieldComponentType.TOGGLE_BUTTON:\n case FieldComponentType.DUAL_LIST_SELECT:\n return { ...base, options: answers }\n case 'icon':\n // An icon has no placeholder to show, so what unset means is said in\n // the help tip, and the corner ✕ is the way back to it.\n return {\n ...base,\n description: undefined,\n ...(pageSets\n ? {\n help: {\n title: label,\n excerpt: [\n prop.description,\n prop.defaultValue\n ? `Leave it unset to show the ${noun}'s default icon.`\n : 'Leave it unset to show no icon.',\n ]\n .filter(Boolean)\n .join(' '),\n },\n }\n : {}),\n FieldProps: {\n format: formatIconPropValue,\n parse: parseIconPropValue,\n },\n }\n case 'href':\n // The screen picker a Button's own \"Link to screen\" field offers, with\n // the external-address escape hatch built in (AGL-1335). The default\n // travels under its own key: `defaultValue` would be read by the form\n // renderer as an initial value and saved onto every instance.\n return {\n ...base,\n component: SCREEN_LINK_FIELD_COMPONENT,\n description: undefined,\n ...(pageSets\n ? { propDefault: prop.defaultValue, propDefaultOwner: noun }\n : { emptyLabel: 'No default' }),\n }\n case 'number':\n return {\n ...base,\n ...(pageSets && prop.defaultValue !== undefined\n ? { placeholder: String(prop.defaultValue) }\n : {}),\n }\n case FieldComponentType.SLIDER:\n return {\n ...base,\n ...(['min', 'max', 'step'] as const).reduce<Record<string, number>>(\n (range, key) => {\n const numeric = Number(settings[key])\n if (settings[key] !== undefined && Number.isFinite(numeric)) {\n range[key] = numeric\n }\n return range\n },\n {},\n ),\n }\n case FieldComponentType.THEME_SCALE:\n return {\n ...base,\n scaleOptions: themeScales?.[String(settings['scale'] ?? '')] ?? [],\n }\n case FieldComponentType.PRESET_CHOICE: {\n const presets = String(settings['presets'] ?? '')\n return {\n ...base,\n choices: themeScales?.[presets] ?? [],\n ...(presets === 'shadow' || presets === 'fontFamily'\n ? { previewKind: presets === 'shadow' ? 'shadow' : 'font' }\n : {}),\n }\n }\n case FieldComponentType.DATASET_FIELD_SELECT:\n return {\n ...base,\n ...(settings['datasetId'] ? { datasetId: String(settings['datasetId']) } : {}),\n }\n case FieldComponentType.PLUGIN_SETTINGS: {\n const pluginProperty = String(settings['pluginProperty'] ?? '')\n const plugin = declared.find((entry) => entry.name === pluginProperty)\n const pluginDefault = reusablePropDefaultValue(plugin)\n return {\n ...base,\n ...(pluginProperty\n ? {\n listingField: pageSets ? valuePath(pluginProperty) : undefined,\n listingFallback:\n typeof pluginDefault === 'string' ? pluginDefault : undefined,\n }\n : {}),\n }\n }\n case 'text':\n case 'richText':\n case 'image':\n // Token-capable, so an override can itself carry a `{{var:id}}`: the\n // graft substitutes first and the binding resolver runs after it, so\n // those still resolve.\n return {\n ...base,\n ...(pageSets && prop.defaultValue !== undefined\n ? { placeholder: String(prop.defaultValue) }\n : {}),\n tokenOptions,\n tokenLabelContext,\n }\n default:\n return base\n }\n}\n\n/**\n * One Attributes field per prop a reusable component declares (AGL-1247),\n * so the same hero can carry different copy on eleven pages instead of\n * being copied onto each — each drawn by {@link buildPropertyField} and\n * finished by {@link resolveAttributeField}, like the component's own\n * attributes.\n *\n * Fields are named for the `propValues.<name>` path the graft reads, so the\n * form round-trips them through final-form's nested-path handling with no\n * flatten/unflatten step. A name that is not an identifier is skipped\n * rather than rendered as a field that could not save.\n */\nexport function buildInstancePropFields(\n declared: Aglyn.ReusableComponentProp[] | undefined,\n tokenOptions?: unknown,\n tokenLabelContext?: unknown,\n context?: AttributeFieldResolveContext & {\n themeScales?: Partial<Record<string, unknown>>\n },\n): Array<Record<string, unknown>> {\n return buildPropertyValueFields(declared, {\n pathOf: (name) => `${REUSABLE_INSTANCE_PROP_VALUES_KEY}.${name}`,\n noun: 'component',\n context: { ...context, insertOptions: tokenOptions, tokenLabelContext },\n themeScales: context?.themeScales,\n })\n}\n\n/**\n * One field per declared property for a page setting their values, at the\n * paths `pathOf` names — an instance's `propValues`, or a screen's values for\n * its layout.\n */\nexport function buildPropertyValueFields(\n declared: readonly Aglyn.ReusableComponentProp[] | undefined,\n options: {\n pathOf: (propName: string) => string\n noun: PropertyOwnerNoun\n context?: AttributeFieldResolveContext\n themeScales?: Partial<Record<string, unknown>>\n },\n): Array<Record<string, unknown>> {\n if (!declared?.length) return []\n const valid = declared.filter((prop) =>\n COMPONENT_PROP_NAME_PATTERN.test(prop?.name ?? ''),\n )\n return valid.map((prop) =>\n resolveAttributeField(\n buildPropertyField(prop, {\n name: options.pathOf(prop.name),\n role: 'value',\n declared: valid,\n valuePath: options.pathOf,\n noun: options.noun,\n tokenOptions: options.context?.insertOptions,\n tokenLabelContext: options.context?.tokenLabelContext,\n themeScales: options.themeScales,\n }),\n options.context,\n ),\n )\n}\n\n/** What {@link resolveAttributeField} reads beyond the field itself. */\nexport interface AttributeFieldResolveContext {\n /** The routing map and screen names, for Screen pickers. */\n screens?: Aglyn.ScreenLinkContextValue['screens']\n labels?: Aglyn.ScreenLinkContextValue['labels']\n /** The values the form holds, so a picker can name what is stored. */\n values?: Record<string, unknown> | null\n entityOptions?: Aglyn.EntityPickerContextValue\n /** The canvas's other elements, for element pickers. */\n nodeOptions?: ReadonlyArray<{ value: string; label: string }>\n /** The dataset of the nearest ancestor that chose one. */\n ancestorDatasetId?: string\n /** Whether the edited element's text is formatted markup. */\n hasFormattedText?: boolean\n insertOptions?: unknown\n tokenLabelContext?: unknown\n /**\n * Bumped when the installed-plugin set changes, so a memo holding this\n * context re-resolves the Plugin picker (AGL-1030).\n */\n pluginInstallsVersion?: number\n}\n\n/**\n * An attribute field as the panel draws it: a declared kind that needs the\n * site's data resolved into a dropdown the form renderer knows, a free-text\n * field upgraded to the token editor, and every other field as declared.\n *\n * Pure, and the one place this happens — the element's own attributes, a\n * component instance's properties and a screen's layout values all pass\n * through it, so a kind cannot draw one way as an attribute and another as a\n * property.\n */\nexport function resolveAttributeField<T extends Record<string, any>>(\n field: T,\n context: AttributeFieldResolveContext = {},\n): Record<string, any> {\n const {\n screens,\n labels,\n values,\n entityOptions = {} as Aglyn.EntityPickerContextValue,\n nodeOptions = [],\n ancestorDatasetId,\n hasFormattedText,\n insertOptions,\n tokenLabelContext,\n } = context\n const stored = readAttributeFieldValue(values, field.name)\n if (field.component === FieldComponentType.SCREEN_SELECT) {\n // The host's screens by path, then its collection listings\n // (AGL-2799) and feeds — built by the function the `Link`-typed prop\n // picker uses too, so neither can offer a target the other does not.\n const options = [\n { value: '', label: 'None (use external URL)' },\n ...screenLinkTargetOptions(screens, labels, 'path').map(\n ({ value, label }) => ({ value, label }),\n ),\n ]\n // A stored target the host no longer has renders as a BLANK\n // picker, which reads as \"no link set\" while the element still\n // behaves as linked (AGL-1893). Naming it is the only way the\n // author finds out before publishing rather than after. An entry is\n // not stranded for being absent here — the map holds no entries, and\n // the lookup names one by reading it (AGL-3119).\n const stranded = unresolvedScreenOption(stored, screens)\n if (\n stranded &&\n linkTargetKind(stranded.value) !== 'entry' &&\n !options.some((o) => o.value === stranded.value)\n ) {\n options.push(stranded)\n }\n // Drawn by the searchable lookup (AGL-3119), which offers these and\n // finds entries as the author types.\n return {\n ...field,\n component: SCREEN_TARGET_FIELD_COMPONENT,\n options,\n }\n }\n if (field.component === FieldComponentType.PLUGIN_SETTINGS) {\n // Rendered by a bespoke editor rather than expanded into N fields\n // here: the settings live in ONE stored JSON attribute, and the\n // editor reads the sibling plugin selection to know which manifest's\n // props to offer.\n return {\n ...field,\n component: PLUGIN_SETTINGS_FIELD_COMPONENT,\n }\n }\n if (field.component === FieldComponentType.PLUGIN_SELECT) {\n // Installed plugins (AGL-1030), from the set the console publishes\n // for the drawer — host and org pins both, host winning where it\n // shadows. No extra read: the pins already carry the display name.\n const installs = getKnownPluginInstalls()\n return {\n ...field,\n component: FieldComponentType.SELECT,\n options: [\n {\n value: '',\n label: installs.length\n ? 'None'\n : 'No plugins installed for this site',\n },\n ...installs.map((install) => ({\n value: install.listingId,\n label:\n install.displayName ??\n /* An install with no name is still choosable — better a raw\n id in one option than a plugin that cannot be placed. */\n install.listingId,\n })),\n ],\n }\n }\n if (field.component === FieldComponentType.NODE_SELECT) {\n // Canvas-element picker (AGL-557).\n return {\n ...field,\n component: FieldComponentType.SELECT,\n options: [{ value: '', label: 'None' }, ...nodeOptions],\n }\n }\n if (field.component === FieldComponentType.DATASET_FIELD_SELECT) {\n // Model order, never alphabetized — it mirrors the schema dialog. A\n // field naming its own dataset (a Dataset field property) reads that\n // one; every other reads the nearest ancestor's.\n const datasetId =\n typeof field['datasetId'] === 'string' && field['datasetId']\n ? field['datasetId']\n : ancestorDatasetId\n const modelFields = datasetId\n ? entityOptions.datasetFields?.[datasetId] ?? []\n : []\n return {\n ...field,\n component: FieldComponentType.SELECT,\n options: [\n {\n value: '',\n label: modelFields.length\n ? 'None (match by field name)'\n : 'No dataset selected on the form',\n },\n ...modelFields.map((modelField) => ({\n value: modelField.id,\n label: modelField.label,\n })),\n ],\n }\n }\n // Id-based entity pickers (AGL-343/344), including the Form element's\n // `formId`. Recognised by the attribute's declared type, so a surface\n // whose picker context is missing renders a picker that SAYS so instead\n // of one that is not there. The stored value travels with the field: a\n // selection outside the browse window is offered from its own keyed read,\n // so a bound element never renders as unbound.\n const entityKind = ENTITY_PICKER_KINDS[field.component as Aglyn.FieldComponentType]\n if (entityKind) {\n return buildEntityPickerField(\n field as unknown as Aglyn.AglynAttributeSchema,\n entityKind,\n entityOptions,\n stored,\n )\n }\n if (\n field.component === FieldComponentType.DATE_PICKER ||\n field.component === FieldComponentType.TIME_PICKER\n ) {\n // The browser's own date and time inputs, storing `YYYY-MM-DD` and\n // `HH:mm` — the text every renderer reads (a Video's publication date is\n // one). The date-picker editors hand back a date object instead, and need\n // a date adapter the besigner does not load, so a field declared as one\n // is drawn as the input that stores what it means.\n return {\n ...field,\n component: FieldComponentType.TEXT_FIELD,\n type: field.component === FieldComponentType.DATE_PICKER ? 'date' : 'time',\n }\n }\n // Formatted text is owned by the canvas (AGL-2486). Shown, with\n // the reason, rather than silently editable into a prop the\n // renderer ignores.\n if (field.name === 'children' && hasFormattedText) {\n return {\n ...field,\n component: TOKEN_TEXT_FIELD_COMPONENT,\n multiline: true,\n isReadOnly: true,\n description:\n 'This text is formatted — double-click the element on the ' +\n 'canvas to edit it. Remove formatting to edit it here.',\n tokenOptions: insertOptions,\n tokenLabelContext,\n }\n }\n if (\n (field.component === FieldComponentType.TEXT_FIELD ||\n field.component === FieldComponentType.TEXTAREA) &&\n !(field as any).isReadOnly\n ) {\n // Token-capable free-text fields (children, href, src, …)\n // render through the pill editor (AGL-586): stored `{{...}}`\n // tokens display as named colored pills, the {x} adornment\n // inserts at the caret (AGL-583), and raw {{...}} typing keeps\n // working (it materializes into a pill on blur).\n return {\n ...field,\n component: TOKEN_TEXT_FIELD_COMPONENT,\n multiline: field.component === FieldComponentType.TEXTAREA,\n tokenOptions: field['tokenOptions'] ?? insertOptions,\n tokenLabelContext: field['tokenLabelContext'] ?? tokenLabelContext,\n }\n }\n return field\n}\n\n/**\n * What a \"Browse media\" pick should ALSO write for `alt` (AGL-1896).\n *\n * The DAM has stored per-asset alt text since AGL-173 and nothing ever read\n * it back, so an author placing the same logo on eight pages typed its alt\n * eight times — and a field that must be retyped per placement is a field\n * that ships blank, on the customer's published site.\n *\n * Exported and pure so the decision is testable on real inputs; the handler\n * that calls it is inside a component wired to the live canvas.\n *\n * Two narrowings, both deliberate:\n *\n * * **`src` only.** The Browse button is offered on every media-ish\n * attribute — `poster`, `background`, `thumbnail`, `logo`. A poster\n * frame's description is not the element's alt text, and no attribute\n * pairing anywhere says which of those an `alt` belongs to. Guessing would\n * put the wrong sentence on the element and look like a bug.\n * * **Only where the SCHEMA declares an `alt`.** Read off the element's own\n * attributes rather than assumed, so a component without one is never\n * handed a prop its renderer would drop on the floor.\n *\n * Returns `{}` — not `{ alt: undefined }` — whenever nothing should change,\n * because the caller spreads the result into a props object that\n * `updateNodeProps` REPLACES wholesale. An `alt` key present with an\n * undefined value is indistinguishable from an authored empty alt to\n * everything downstream, and would silently clear one.\n */\nexport function inheritedAltPatch(options: {\n /** The attribute the Browse button was pressed for. */\n propName: string\n /** Whether this element's schema declares an `alt` attribute at all. */\n declaresAlt: boolean\n /** The node's CURRENT props, snapshotted from the canvas. */\n props?: Record<string, unknown> | null\n /** The chosen DAM asset's own stored alt. */\n assetAlt?: unknown\n}): { alt?: string } {\n const { propName, declaresAlt, props, assetAlt } = options ?? ({} as never)\n if (!declaresAlt || propName !== 'src') return {}\n const alt = inheritedMediaAlt({\n placementAlt: props?.['alt'],\n // The author's explicit \"screen readers should skip this\" (AGL-1305).\n // `image.tsx` forces `alt=\"\"` over any alt text when it is on, so\n // inheriting into such a node writes text the renderer discards.\n decorative: props?.['decorative'],\n assetAlt,\n })\n return alt ? { alt } : {}\n}\n\n/**\n * The one kind of file a \"Browse media\" pick can place in an attribute, or\n * `undefined` where the picker stays unnarrowed (AGL-2953).\n *\n * The Video element's `src` plays a film and its `poster` is the still shown\n * before anyone presses play, so each opens a picker that lists only what it\n * can use and uploads nothing else. Every other media attribute is left as it\n * was, because nothing on it says what the element's renderer accepts.\n *\n * Exported and pure for the reason {@link inheritedAltPatch} is; keyed on the\n * persisted component id, which is never renamed.\n */\nexport function browseMediaKind(options: {\n /** The element being written to. */\n componentId?: unknown\n /** The attribute the Browse button was pressed for. */\n propName: string\n}): Aglyn.MediaPickerKind | undefined {\n const { componentId, propName } = options ?? ({} as never)\n if (componentId !== VIDEO_COMPONENT_ID) return undefined\n if (propName === 'src') return 'video'\n if (propName === 'poster') return 'image'\n return undefined\n}\n\n/**\n * The two visibility fields every node inside a component definition gets\n * (AGL-1314), so \"this part is optional\" is something an author declares by\n * clicking rather than something the component hard-codes.\n *\n * Token-capable, because the value that decides is almost always the\n * definition's own `{{prop.*}}`: `hideIf` takes a `boolean` prop (\"Hide the\n * mockup\"), `hideUnless` takes the prop that would have supplied the\n * content (\"no link, no button\" — AGL-1348).\n *\n * Offered ONLY where `{{prop.*}}` exists — inside a component editor,\n * signalled by `BindingPickerContext.componentProps` exactly as the insert\n * picker uses it. On an ordinary screen the directive is inert (the graft\n * is the only thing that evaluates it), and a field that silently does\n * nothing is worse than no field.\n */\nexport function buildVisibilityFields(\n tokenOptions?: unknown,\n tokenLabelContext?: unknown,\n): Array<Record<string, unknown>> {\n const field = (name: string, label: string, description: string) => ({\n name,\n label,\n description,\n // Same tooltip treatment the schema attributes get (AGL-600); this\n // list never reaches the `withAttributeHelp` map above.\n help: { title: label, excerpt: description },\n component: TOKEN_TEXT_FIELD_COMPONENT,\n tokenOptions,\n tokenLabelContext,\n })\n return [\n field(\n NODE_HIDE_IF_PROP,\n 'Hide when',\n 'Remove this element (and everything inside it) from pages where ' +\n 'this value is on. Usually a property of this component, e.g. ' +\n '{{prop.hideMedia}}.',\n ),\n field(\n NODE_HIDE_UNLESS_PROP,\n 'Hide unless',\n 'The reverse: remove this element from pages that leave this value ' +\n 'empty. Point it at the property that fills the element — a button ' +\n 'bound to {{prop.ctaLink}} then disappears instead of shipping a ' +\n 'link with nowhere to go.',\n ),\n ]\n}\n\n/**\n * The animation fields every element gets (AGL-2486).\n *\n * Presets rather than a keyframes box, because the audience includes people\n * who have never written CSS: an author picks \"Slide up\", \"on scroll into\n * view\", and adjusts a few obvious knobs. The knobs named — duration,\n * delay, easing — plus stagger, and this is that list and nothing more. There\n * is deliberately no keyframe editor and no general trigger picker; the\n * things that are NOT offered (the distance a slide travels, the difference\n * between a transition and a keyframe run, arbitrary curves) are decided for\n * the author, and an author who needs them has the sx tab.\n *\n * Easing is a named list, never a `cubic-bezier()` text box. That keeps the\n * curve out of author free-text — the id becomes a class and the curve is\n * looked up in the tenant's own stylesheet — so there is nothing here for the\n * sx sanitizer to have to catch.\n *\n * \"Stagger children\" is the one control that changes WHAT animates rather\n * than how: the element stops animating and its children animate in\n * sequence instead. It reads as a switch rather than a separate \"Stagger\"\n * preset because stagger is orthogonal to fade/slide/zoom — a \"Stagger\"\n * preset would have had to answer \"stagger which animation?\".\n *\n * Offered on every element, unlike the visibility directives above, because an\n * animation is meaningful on any node on any screen — there is no context in\n * which the field would be inert.\n *\n * The \"None\" option carries a real value, never `''` (AGL-1451/AGL-1191): an\n * empty value cannot persist, so an author who picked a preset could never\n * turn it back off.\n *\n * The dependent fields are gated on the PRESET rather than on \"not none\", so\n * an element that has never been animated shows one dropdown and nothing else.\n * `is` takes the explicit list; a `notMatch` against `'none'` would be true for\n * the undefined case too and would show all five fields on every element.\n */\nexport function buildAnimationFields(): Array<Record<string, unknown>> {\n const animated = {\n when: NODE_ANIMATION_PROP,\n is: ANIMATION_PRESETS.filter(\n (preset) => preset !== ANIMATION_NONE,\n ),\n }\n // Stagger is an entrance idea. Named rather than inlined twice so the\n // switch and its step field can never drift apart and leave a step control\n // visible for a trigger that ignores it.\n const staggerable = {\n when: NODE_ANIMATION_TRIGGER_PROP,\n is: ['scroll', 'load'],\n }\n const help = (label: string, description: string) => ({\n label,\n description,\n // Same tooltip treatment the schema attributes get (AGL-600); this list\n // never reaches the `withAttributeHelp` map above.\n help: { title: label, excerpt: description },\n })\n return [\n {\n name: NODE_ANIMATION_PROP,\n ...help(\n 'Animation',\n 'Adds movement to this element. Motion is skipped automatically for ' +\n 'visitors who have asked their device to reduce it.',\n ),\n component: FieldComponentType.SELECT,\n options: [\n { value: ANIMATION_NONE, label: 'None' },\n { value: 'fade', label: 'Fade in' },\n { value: 'slide-up', label: 'Slide up' },\n { value: 'slide-down', label: 'Slide down' },\n { value: 'slide-left', label: 'Slide left' },\n { value: 'slide-right', label: 'Slide right' },\n { value: 'zoom-in', label: 'Zoom in' },\n { value: 'zoom-out', label: 'Zoom out' },\n ],\n },\n {\n name: NODE_ANIMATION_TRIGGER_PROP,\n ...help(\n 'Plays',\n 'When the animation runs. \"On scroll into view\" is the usual choice ' +\n 'for anything below the top of the page.',\n ),\n component: FieldComponentType.SELECT,\n condition: animated,\n initialValue: ANIMATION_DEFAULT_TRIGGER,\n options: [\n { value: 'scroll', label: 'On scroll into view' },\n { value: 'load', label: 'On page load' },\n { value: 'hover', label: 'On hover' },\n ],\n },\n {\n name: NODE_ANIMATION_DURATION_PROP,\n ...help(\n 'Duration (ms)',\n `How long the animation takes, in milliseconds. ${ANIMATION_DEFAULT_DURATION_MS} is a ` +\n `natural default; anything over ${ANIMATION_MAX_DURATION_MS} is capped.`,\n ),\n component: FieldComponentType.TEXT_FIELD,\n type: 'number',\n condition: animated,\n initialValue: ANIMATION_DEFAULT_DURATION_MS,\n },\n {\n name: NODE_ANIMATION_DELAY_PROP,\n ...help(\n 'Delay (ms)',\n 'How long to wait before starting. Stagger a row of cards by giving ' +\n 'each one a slightly larger delay.',\n ),\n component: FieldComponentType.TEXT_FIELD,\n type: 'number',\n condition: animated,\n initialValue: ANIMATION_DEFAULT_DELAY_MS,\n },\n {\n name: NODE_ANIMATION_EASE_PROP,\n ...help(\n 'Easing',\n 'The shape of the motion — whether it eases off as it arrives, moves ' +\n 'at one steady speed, or travels a little past its mark and comes ' +\n 'back to it.',\n ),\n component: FieldComponentType.SELECT,\n condition: animated,\n initialValue: ANIMATION_DEFAULT_EASE,\n options: [\n { value: 'smooth', label: 'Smooth' },\n { value: 'steady', label: 'Steady' },\n { value: 'gentle-start', label: 'Gentle start' },\n { value: 'gentle-end', label: 'Gentle end' },\n { value: 'gentle-both', label: 'Gentle start and end' },\n // The LABEL changed, the value did not (AGL-2486). `overshoot` is the\n // stored id: it is written into `aglynAnimationEase` on every node\n // that uses it, published as the `aglyn-anim-ease--overshoot` class,\n // and keyed in `EASE_CURVES`. Renaming the value would silently drop\n // the easing from every document already using it, which is why only\n // the human-facing string here moves.\n { value: 'overshoot', label: 'Settles into place' },\n ],\n },\n {\n name: NODE_ANIMATION_STAGGER_PROP,\n ...help(\n 'Stagger children',\n 'Animate the things inside this element one after another, instead ' +\n 'of animating the element as a whole. Turn this on for a row of ' +\n 'cards or a list.',\n ),\n component: FieldComponentType.SWITCH,\n // Not offered for hover: a hover effect has to reverse the moment the\n // pointer leaves, and a staggered one would strand half a row.\n condition: [animated, staggerable],\n },\n {\n name: NODE_ANIMATION_STAGGER_STEP_PROP,\n ...help(\n 'Stagger step (ms)',\n `How much later each one starts than the one before it. ` +\n `${ANIMATION_DEFAULT_STAGGER_STEP_MS} is a natural default; ` +\n `anything over ${ANIMATION_MAX_STAGGER_STEP_MS} is capped, ` +\n `because this gap multiplies down the row.`,\n ),\n component: FieldComponentType.TEXT_FIELD,\n type: 'number',\n // `is` accepts the string form too: a switch that has been round-tripped\n // through a text-shaped store comes back as `'true'`, and a step field\n // that silently stopped appearing would be blamed on the switch.\n condition: [animated, staggerable, { when: NODE_ANIMATION_STAGGER_PROP, is: [true, 'true'] }],\n initialValue: ANIMATION_DEFAULT_STAGGER_STEP_MS,\n },\n {\n name: NODE_ANIMATION_REPEAT_PROP,\n ...help(\n 'Replay each time',\n 'Play the animation again every time the element scrolls back into ' +\n 'view, instead of only the first time.',\n ),\n component: FieldComponentType.SWITCH,\n // Both conditions must hold: DDF ANDs an array of conditions. Replay is\n // meaningless for the other two triggers — a page loads once, and hover\n // is a transition that already reverses.\n condition: [\n animated,\n { when: NODE_ANIMATION_TRIGGER_PROP, is: 'scroll' },\n ],\n },\n ]\n}\n\n/**\n * The Repeat fields every element gets (AGL-3111).\n *\n * Repeating used to be one component's feature: only the MUI Stack declared\n * `repeatDataset`, so a card, an image or a placed component could not be\n * data-driven at all. It is a node capability now, offered here the way\n * visibility and animation are — and on a component instance too, which is the\n * shape most authors reach for first.\n *\n * WHAT an element repeats over is not decided here. Each registered\n * {@link RepeatSource} contributes its own key field under its own prop name,\n * and the plugin that owns the rows registers it; this list names no kind of\n * data. With nothing registered there is no Repeat section at all, which is\n * correct rather than degraded: an editor with no source has nothing to repeat\n * over.\n *\n * The bounds are shared by every source, because they are properties of the\n * REPEAT and not of the rows: the composition applies the same filter, sort\n * and limit whatever answered with the records. They are declared once, in\n * core, as {@link REPEAT_NODE_CAPABILITY} — this panel draws them, and\n * anything that has to describe what an author can build reads the same list.\n * While the list lived here it was invisible to every other reader, and a\n * reader that walked component schemas to find repeat found nothing at all.\n *\n * `hasChildren` decides whether the scope field is offered at all. An element\n * with nothing inside it has only one possible reading — it repeats itself —\n * and a control whose two options do the same thing is worse than no control.\n */\nexport function buildRepeatFields(options: {\n sources: readonly RepeatSource[]\n /** Whether the edited node holds a child list, which the scope field needs. */\n hasChildren: boolean\n /** Finishes a key field that names an entity picker, as an attribute is. */\n resolveKeyField: (\n field: Record<string, unknown>,\n ) => Record<string, unknown>\n}): Array<Record<string, unknown>> {\n const { sources, hasChildren, resolveKeyField } = options\n if (!sources.length) return []\n const help = (label: string, description: string, anchor?: string) => ({\n label,\n description,\n // Same tooltip treatment the schema attributes get (AGL-600); these\n // fields never reach the `withAttributeHelp` map above. The docs link is\n // the one thing a tooltip cannot carry: which scope to pick and what the\n // hundred-record ceiling means are a page, not a sentence.\n help: {\n title: label,\n excerpt: description,\n href: besignerDocsUrl('repeat', anchor as never),\n },\n })\n /**\n * True while the element repeats over ANYTHING. One rule per source, ORed,\n * so a second source added later widens it without touching the fields the\n * bounds are on.\n */\n const repeating =\n sources.length === 1\n ? { when: sources[0].keyProp, isNotEmpty: true }\n : {\n or: sources.map((source) => ({\n when: source.keyProp,\n isNotEmpty: true,\n })),\n }\n return [\n ...sources.map((source) =>\n resolveKeyField({\n ...source.keyAttribute,\n name: source.keyProp,\n help: {\n title: source.keyAttribute.label ?? source.label,\n excerpt: source.keyAttribute.description ?? '',\n href: besignerDocsUrl('repeat'),\n },\n } as Record<string, unknown>),\n ),\n ...REPEAT_NODE_CAPABILITY.attributes\n .filter((attribute) => hasChildren || !attribute.requiresChildren)\n .map((attribute) => {\n const {\n label,\n description,\n docsAnchor,\n requiresChildren: _requiresChildren,\n ...field\n } = attribute\n return {\n ...field,\n ...help(String(label ?? ''), description ?? '', docsAnchor),\n condition: repeating,\n }\n }),\n ]\n}\n\n/**\n * The list each entity picker DISPLAYS, keyed by the attribute type a\n * component schema declares.\n *\n * One table rather than two switches, because the demand signal and the\n * option list have to agree about which list a picker means. When they\n * disagreed the failure was silent and total: the panel would open a\n * listener on one collection and read its options out of another, and the\n * dropdown stayed empty on a site full of data.\n *\n * `DATASET_FIELD_SELECT` is deliberately absent. Its options are the model\n * fields of the dataset an ANCESTOR chose, so it needs the dataset list to\n * resolve against but is not itself a picker OF datasets — it asks for the\n * list below and renders its own options.\n */\nexport const ENTITY_PICKER_KINDS: Readonly<\n Partial<Record<Aglyn.FieldComponentType, Aglyn.EntityPickerKind>>\n> = {\n [FieldComponentType.PRODUCT_SELECT]: 'products',\n [FieldComponentType.COLLECTION_SELECT]: 'collections',\n [FieldComponentType.CATEGORY_SELECT]: 'categories',\n [FieldComponentType.DATASET_SELECT]: 'datasets',\n [FieldComponentType.FORM_SELECT]: 'forms',\n}\n\n/** Where an author makes more of each kind, named in the empty picker. */\nconst ENTITY_PICKER_ORIGIN: Readonly<\n Record<\n Aglyn.EntityPickerKind,\n { singular: string; plural: string; page: string }\n >\n> = {\n products: {\n singular: 'product',\n plural: 'products',\n page: 'the Products page',\n },\n collections: {\n singular: 'collection',\n plural: 'collections',\n page: 'the Collections page',\n },\n categories: {\n singular: 'category',\n plural: 'categories',\n page: 'the Categories page',\n },\n datasets: {\n singular: 'dataset',\n plural: 'datasets',\n page: 'the Data page',\n },\n forms: { singular: 'form', plural: 'forms', page: 'the Forms page' },\n}\n\n/**\n * The label on an entity picker's empty first option.\n *\n * An empty dropdown and a broken dropdown look identical, and an author who\n * cannot tell them apart goes looking for a form they already made. So the\n * four reasons a picker has nothing say four different things, and only the\n * settled one claims anything about the site.\n */\nexport function entityPickerPlaceholder(\n kind: Aglyn.EntityPickerKind,\n state: Aglyn.EntityListState,\n count: number,\n): string {\n if (count > 0) return 'None'\n const { plural, page } = ENTITY_PICKER_ORIGIN[kind]\n switch (state) {\n case 'error':\n return `Could not load ${plural} — reopen this panel to try again`\n case 'loading':\n return `Loading ${plural}…`\n case 'unavailable':\n return `This editor cannot list ${plural}`\n default:\n return `No ${plural} yet — add one on ${page}`\n }\n}\n\n/**\n * What a picker owes the reader about the list it is showing.\n *\n * A browse window is a PAGE of the site's catalog, and a page that does not\n * say so is the silent-truncation defect: \"not in the picker\" and \"does not\n * exist\" are the same absence to look at, and only one of them is a fact\n * about their site. The inbox's form filter carries the same sentence for the\n * same reason.\n *\n * Two sentences, because the second half is only true for a kind whose\n * documents carry the name-search keys. A picker that promised to search the\n * whole catalog and then searched 25 rows would be a worse lie than saying\n * nothing.\n */\nexport function entityPickerBrowseNotice(\n kind: Aglyn.EntityPickerKind,\n context: Aglyn.EntityPickerContextValue | undefined,\n): string | undefined {\n if (!context?.truncated?.[kind]) return undefined\n const { plural } = ENTITY_PICKER_ORIGIN[kind]\n const first = `Showing the first ${ENTITY_PICKER_BROWSE_LIMIT} ${plural} — this site has more. `\n return context.searchable?.[kind]\n ? `${first}Type to search all of them.`\n : `${first}Typing narrows these ${ENTITY_PICKER_BROWSE_LIMIT} only.`\n}\n\n/**\n * What the dropdown says when the reader's typing matches nothing it holds.\n *\n * On a truncated list that cannot be searched on the server, \"no match\" is a\n * statement about the WINDOW and must not be read as one about the site —\n * this is where an author concludes a form they already made does not exist\n * and makes a second one.\n */\nexport function entityPickerNoMatchText(\n kind: Aglyn.EntityPickerKind,\n context: Aglyn.EntityPickerContextValue | undefined,\n): string {\n const { plural } = ENTITY_PICKER_ORIGIN[kind]\n if (context?.truncated?.[kind] && !context?.searchable?.[kind]) {\n return `No match in the first ${ENTITY_PICKER_BROWSE_LIMIT} ${plural} — this site has more.`\n }\n return `No ${plural} match.`\n}\n\n/**\n * The extra option a picker needs when its stored value is not in the window.\n *\n * The counterpart to {@link Aglyn.unresolvedScreenOption}, and it exists for\n * the same reason: a picker whose value matches no option renders BLANK, which\n * reads as \"nothing chosen\" on an element that is bound. An author repairs\n * that by choosing again — which is how a correct reference gets replaced with\n * a different one.\n *\n * Returns the stored value UNCHANGED as the option's value. Naming a\n * selection must never rewrite it.\n *\n * A value nothing has answered for yet shows as the raw id, NOT as a warning.\n * Flashing \"unavailable\" over every live reference for the beat before the\n * keyed read lands would teach authors to ignore the one warning that means\n * something — the same call `unavailableScreenLabel` makes.\n *\n * The exception is a picker that has settled and has no way to look anything\n * up. There is no answer coming, so the raw value is all there will ever be,\n * and left unmarked it would read as a resolved name — which is exactly what\n * a free-text caption stored where an id belongs looks like.\n */\nexport function entitySelectionOption(\n context: Aglyn.EntityPickerContextValue | undefined,\n kind: Aglyn.EntityPickerKind,\n value: unknown,\n): { value: string; label: string } | undefined {\n const id = typeof value === 'string' ? value.trim() : ''\n if (!id) return undefined\n if ((context?.[kind] ?? []).some((entity) => entity.id === id)) {\n return undefined\n }\n const resolved = context?.resolved?.[kind]?.[id]\n if (resolved) return { value: id, label: resolved.label }\n const { singular } = ENTITY_PICKER_ORIGIN[kind]\n if (resolved === null) {\n return { value: id, label: `⚠ Unavailable ${singular} (${id}) — deleted` }\n }\n const settledWithNoLookup =\n entityListState(context, kind) === 'ready' && !context?.resolve\n return {\n value: id,\n label: settledWithNoLookup ? `⚠ Unrecognized ${singular} (${id})` : id,\n }\n}\n\n/**\n * An entity picker rendered as the SELECT the form renderer knows how to\n * draw, resolved against whatever the surface's picker context can offer.\n *\n * Three things this must not do, each of which renders as something other\n * than a broken picker.\n *\n * Every option carries the entity's ID, never its label. The label is\n * resolved fresh at edit time and a rename moves it; the id is the whole\n * reference, and for a form it is the difference between one submission list\n * and two (`docs/specs/reusable-forms.md` §2c).\n *\n * The field is decided by the attribute's own TYPE, not by whether a list\n * happens to have arrived. Keying off the list meant a surface with no picker\n * context dropped the attribute from the panel entirely — no control, no\n * explanation, indistinguishable from a component that simply has no such\n * setting. A picker with nothing to offer must still be a picker, and must\n * say what is wrong.\n *\n * And the STORED VALUE is offered whether or not the browse window contains\n * it, which is what lets that window be a console page rather than hundreds\n * of documents. A picker that took its options and its current selection from\n * one list needs the list wide enough to hold whatever an author picked last\n * month, and past that width renders a bound element as unbound anyway. The\n * selection is a keyed read; this is where its answer is offered.\n */\nexport function buildEntityPickerField<\n T extends Aglyn.AglynAttributeSchema,\n>(\n field: T,\n kind: Aglyn.EntityPickerKind,\n context: Aglyn.EntityPickerContextValue | undefined,\n value?: unknown,\n) {\n const entities = context?.[kind] ?? []\n const selected = entitySelectionOption(context, kind, value)\n const notice = entityPickerBrowseNotice(kind, context)\n const search = context?.search\n const request = context?.request\n return {\n ...field,\n component: FieldComponentType.SELECT,\n /*\n * Opening the dropdown asks for the list (AGL-703, AGL-3111).\n *\n * The demand used to come only from the selected node's SCHEMA, which\n * worked while a picker was something a component declared. Repeat is\n * offered on every element now, so a schema-driven demand would read the\n * dataset list the moment any element was selected — the read AGL-703\n * removed, back again under a different name.\n *\n * Asking here instead is the same signal at its narrowest: an author who\n * opens the picker is the author who wants the list. `request` is\n * idempotent, so an already-demanded kind costs nothing, and the schema\n * demand below still runs for the pickers a component declares — a field\n * an author expects to arrive populated should not have to be opened\n * twice.\n */\n ...(request ? { onOpen: () => request(kind) } : {}),\n // The dropdown's input is read-only without this, so a list of any size\n // could only be scrolled. Narrowing 25 rows by typing is the cheapest\n // half of reaching past them.\n isSearchable: true,\n ...(search\n ? {\n // `onSearchInput` and NOT `onInputChange`: the latter is owned by\n // `@data-driven-forms/common/select`, which assigns it after\n // spreading the field's props, so a handler declared here would be\n // overwritten before the mapper saw it — and a dropped handler is\n // invisible, since the dropdown still opens and still filters.\n //\n // Only a typed character asks for anything. A `reset` fires when\n // the field takes its own value back on mount and when a choice is\n // made, and treating those as a query would spend a search read on\n // opening the panel — the read this whole arc is about not making.\n onSearchInput: (text: string, reason?: string) => {\n if (reason && reason !== 'input') return\n search(kind, text)\n },\n }\n : {}),\n ...(notice ? { helperText: notice } : {}),\n noOptionsText: () => entityPickerNoMatchText(kind, context),\n options: [\n {\n value: '',\n label: entityPickerPlaceholder(\n kind,\n entityListState(context, kind),\n entities.length,\n ),\n },\n ...[...entities]\n .sort((a, b) => a.label.localeCompare(b.label))\n .map((entity) => ({ value: entity.id, label: entity.label })),\n ...(selected ? [selected] : []),\n ],\n }\n}\n\n/**\n * Which entity lists a node's attributes will need (AGL-703).\n *\n * The provider that owns those lists reads them from Firestore, and it used\n * to read all four the moment the besigner opened — up to 300 products, 200\n * catalog collections, 200 categories and 200 datasets — for pickers most\n * editing sessions never open. This is the demand signal that replaced that:\n * a node whose schema declares the picker.\n *\n * `DATASET_FIELD_SELECT` asks for `datasets` and not for some list of its\n * own, which is the one mapping worth stating: its options are the model\n * fields of the dataset an ANCESTOR chose, so it cannot resolve one without\n * the dataset list to resolve it against.\n *\n * Exported for the test that pins the mapping — a picker silently missing\n * from {@link ENTITY_PICKER_KINDS} renders as a permanently empty dropdown,\n * which looks exactly like a site with no products.\n */\nexport function entityKindsForAttributes(\n attributes: readonly Aglyn.AglynAttributeSchema[] | undefined,\n): Aglyn.EntityPickerKind[] {\n const kinds = new Set<Aglyn.EntityPickerKind>()\n for (const field of attributes ?? []) {\n if (field.component === FieldComponentType.DATASET_FIELD_SELECT) {\n kinds.add('datasets')\n continue\n }\n const kind = ENTITY_PICKER_KINDS[field.component]\n if (kind) kinds.add(kind)\n }\n return [...kinds]\n}\n\nconst ElementPropsFormRaw = forwardRef<any, ElementPropsFormProps>(\n (props, ref) => {\n const { node, ...rest } = props\n const schema = node?.componentSchema\n const nodeProps = node?.props\n const deleteElementCallback = useDeleteElementCallback()\n const rawAttributes = schema?.attributes\n // Reusable-component flows (AGL-35): actions appear only when the host\n // app provides callbacks; locked nodes (layout chrome) never promote.\n const { onPromote, onDemote, onEditComponent, definitions } = useContext(\n ComponentPromotionContext,\n )\n const isInstance =\n node?.componentId === REUSABLE_INSTANCE_COMPONENT_ID\n const unlocked = Besigner.dnd.canDragNode(node)\n // The properties the placed component declares (AGL-1247), when this is\n // an instance.\n const instanceDeclared = useMemo(() => {\n if (!isInstance) return undefined\n const refId = (node?.props as { refId?: string } | undefined)?.refId\n return refId ? definitions?.[refId]?.props : undefined\n }, [isInstance, node, definitions])\n // Every field the panel will draw, as its schema DECLARES it — the\n // element's attributes and the instance's properties as the attribute\n // kinds they are edited with. What the panel reads for its pickers\n // (entity lists, canvas elements, the ancestor dataset) follows this, so\n // a property of a picker kind is fed exactly as an attribute of one.\n const demandAttributes = useMemo<Aglyn.AglynAttributeSchema[]>(\n () => [\n ...(rawAttributes ?? []),\n ...(instanceDeclared ?? []).map((prop) => ({\n name: `${REUSABLE_INSTANCE_PROP_VALUES_KEY}.${prop?.name}`,\n component: reusablePropKind(prop?.type).field,\n })),\n ],\n [rawAttributes, instanceDeclared],\n )\n // Screen-select fields can't carry static options (the host's screens\n // are only known at edit time), so resolve them here from the routing\n // map + labels the console provides via ScreenLinkContext. Entity\n // pickers (AGL-343/344) resolve the same way from EntityPickerContext.\n const { screens, labels } = useContext(ScreenLinkContext)\n const entityOptions = useContext(EntityPickerContext)\n /**\n * Ask for the entity lists this node's pickers will actually show\n * (AGL-703).\n *\n * The provider used to read all four collections when the besigner\n * opened — up to 900 documents on a site with a catalog — for pickers\n * most editing sessions never open. Moving a heading does not need the\n * product list.\n *\n * The demand signal is the node's own schema, which is already scanned\n * twice below for exactly this kind of question (`wantsNodes`,\n * `hasDatasetFieldSelect`). `DATASET_FIELD_SELECT` asks for `datasets`\n * too: its options come from the chosen dataset's model, so it cannot\n * resolve one without the list.\n */\n const requestEntities = entityOptions.request\n useEffect(() => {\n if (!requestEntities) return\n for (const kind of entityKindsForAttributes(demandAttributes)) {\n requestEntities(kind)\n }\n }, [demandAttributes, requestEntities])\n /**\n * Learn the name of the entity this node is ALREADY bound to.\n *\n * The browse list is a page now, so it answers this only by luck. A keyed\n * read answers it always, and asking for one is gated hard: only for a\n * node that carries a value, only once the browse read has settled\n * without supplying it, and never twice for the same id. A site whose\n * catalog fits in the window makes no such read at all.\n */\n const resolveEntity = entityOptions.resolve\n useEffect(() => {\n if (!resolveEntity) return\n for (const field of demandAttributes) {\n const kind = ENTITY_PICKER_KINDS[field.component]\n if (!kind) continue\n const id = entityValueNeedsResolution(\n entityOptions,\n kind,\n readAttributeFieldValue(nodeProps, field.name),\n )\n if (id) resolveEntity(kind, id)\n }\n }, [demandAttributes, nodeProps, entityOptions, resolveEntity])\n /**\n * The same keyed read for the entity a REPEAT already names (AGL-3111).\n *\n * Its picker is not in `demandAttributes` — Repeat is offered on every\n * element, so a schema-shaped demand there would read a whole list for\n * every selection. This asks for the one document instead, and only for a\n * node that already repeats, so an existing repeat opens showing its\n * dataset's name rather than a bare id.\n */\n const repeatSources = useRepeatSources()\n useEffect(() => {\n if (!resolveEntity) return\n const repeat = repeatSourceOf({ props: nodeProps })\n const kind = repeat && ENTITY_PICKER_KINDS[repeat.source.keyAttribute\n .component as Aglyn.FieldComponentType]\n if (!kind) return\n const id = entityValueNeedsResolution(entityOptions, kind, repeat?.key)\n if (id) resolveEntity(kind, id)\n }, [repeatSources, nodeProps, entityOptions, resolveEntity])\n\n // Canvas-node options for NODE_SELECT attributes (AGL-557): every\n // other element on the canvas, labeled by component name + a text\n // snippet, with a short id suffix to tell repeats apart. The edited\n // node itself is excluded (revealing yourself is never meaningful).\n const nodeOptions = useMemo(() => {\n const wantsNodes = demandAttributes.some(\n (field) =>\n field.component === FieldComponentType.NODE_SELECT,\n )\n if (!wantsNodes) return []\n const canvasNodes = (canvas.toJSON().nodes ?? {}) as Record<\n string,\n any\n >\n return Object.entries(canvasNodes)\n .filter(([id]) => id && id !== node?.$id)\n .map(([id, candidate]) => {\n const displayName =\n components.getSchema(candidate?.componentId)\n ?.displayName ??\n candidate?.componentId ??\n 'Element'\n const text =\n typeof candidate?.props?.children === 'string'\n ? candidate.props.children.trim().slice(0, 24)\n : ''\n return {\n value: id,\n label: `${displayName}${text ? ` \"${text}\"` : ''} · ${id.slice(\n 0,\n 6,\n )}`,\n }\n })\n .sort((a, b) => a.label.localeCompare(b.label))\n }, [demandAttributes, node?.$id])\n // Dataset-field selects (AGL-556) list the model fields of the nearest\n // ancestor's chosen dataset (e.g. the form field's parent form). The\n // ancestor persists the dataset id; legacy nodes carrying only a name\n // resolve it by matching the current display labels.\n const hasDatasetFieldSelect = demandAttributes.some(\n (field) =>\n field.component === FieldComponentType.DATASET_FIELD_SELECT,\n )\n const ancestorDatasetId = useMemo(() => {\n if (!hasDatasetFieldSelect || !node?.$id) return undefined\n const nodes = canvas.toJSON().nodes as Record<string, any>\n let current = nodes[node.$id]\n for (let hops = 0; current && hops < 100; hops += 1) {\n const props = current.props ?? {}\n if (typeof props.datasetId === 'string' && props.datasetId) {\n return props.datasetId as string\n }\n if (typeof props.datasetName === 'string' && props.datasetName) {\n const byLabel = (entityOptions.datasets ?? []).find(\n (dataset) => dataset.label === props.datasetName,\n )\n if (byLabel) return byLabel.id\n }\n current = current.parentId ? nodes[current.parentId] : undefined\n }\n return undefined\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [hasDatasetFieldSelect, node, entityOptions.datasets])\n // Insert-picker options + pill display-name inputs (AGL-583/586),\n // assembled from this node's ancestor context — shared with the\n // inline text editor via the extracted hook.\n const { options: insertOptions, labelContext: tokenLabelContext } =\n useInsertTokenOptions(node)\n // Re-render when the installed-plugin set changes (AGL-1030).\n const knownPluginInstallsVersion = useSyncExternalStore(\n subscribeKnownPluginInstalls,\n getKnownPluginInstallsVersion,\n getKnownPluginInstallsVersion,\n )\n\n /**\n * Whether this element's text is FORMATTED, i.e. it carries a `html`\n * prop that the renderer draws in preference to `children` (AGL-2486).\n *\n * When it does, the two fields disagree about which one is the content:\n * the canvas draws `html`, and this panel's Text field edits `children`,\n * so typing here changes a prop nothing renders. The field appears to do\n * nothing, which is the worst of the three possible behaviours.\n *\n * The alternative considered and rejected was letting a plain edit\n * silently clear `html`. Its failure mode is typing one character and\n * losing every link in the paragraph, with no sign until the damage is\n * done. Merging plain text back into markup was rejected too: mapping\n * arbitrary text onto a marked-up tree has no correct answer once the\n * edit is structural. So the canvas owns formatted text, this field\n * shows it read-only and says why, and dropping the formatting is an\n * explicit, undoable act — see {@link handleRemoveFormatting}.\n */\n const hasFormattedText = isFormattedText(node)\n\n // The props of the component being edited, set ONLY inside a component\n // editor — the same \"am I editing a definition\" signal the insert picker\n // keys `{{prop.*}}` off. It decides whether a field with no text box can\n // be bound to a property, and whether the visibility directives below\n // are offered.\n const {\n componentProps: editedComponentProps,\n componentPropsOwner,\n } = useContext(BindingPickerContext)\n\n // What an attribute's `resolveProps` may read beyond the element's props:\n // the element itself and the canvas lookup for what is inside it.\n const fieldContext = useMemo<Aglyn.AttributeFieldContext | undefined>(\n () =>\n node ? { node, getNode: (id: string) => canvas.getNode(id) } : undefined,\n [node],\n )\n\n // The site theme's own scales, for Theme scale and Theme preset\n // properties — the lists the Styles panel offers through the same\n // controls (AGL-2486).\n const hostThemeDoc = useHostThemeDocument()\n const siteTheme = useAglynSiteTheme({ theme: hostThemeDoc })\n const themeScales = useMemo(\n () => buildStyleThemeScales(siteTheme as any) as unknown as Record<string, unknown>,\n [siteTheme],\n )\n\n // What `resolveAttributeField` reads beyond each field. Its identity\n // moves when a different node is selected or a save commits — the form\n // owns the values the author is typing, so not on every keystroke.\n const resolveContext = useMemo<AttributeFieldResolveContext>(\n () => ({\n screens,\n labels,\n // Read by the Screen pickers to name a target the map has lost\n // (AGL-1893), and by entity pickers to offer what is stored.\n values: nodeProps,\n entityOptions,\n nodeOptions,\n ancestorDatasetId,\n hasFormattedText,\n insertOptions,\n tokenLabelContext,\n // The installed-plugin set arrives from a live subscription and can\n // land after this memo first ran (AGL-1030) — without it the picker\n // would sit on \"No plugins installed for this site\" until the panel\n // remounted.\n pluginInstallsVersion: knownPluginInstallsVersion,\n }),\n [\n screens,\n labels,\n nodeProps,\n entityOptions,\n nodeOptions,\n ancestorDatasetId,\n hasFormattedText,\n insertOptions,\n tokenLabelContext,\n knownPluginInstallsVersion,\n ],\n )\n\n const attributes = useMemo(() => {\n // Every described attribute gets a help tooltip beside the field\n // (AGL-600) — the definition's own description, no docs link since\n // attributes are component-specific.\n const withAttributeHelp = <T extends Aglyn.AglynAttributeSchema>(\n field: T,\n ): T =>\n field.description && !field['help']\n ? {\n ...field,\n help: {\n title: field['label'] ?? field.name,\n excerpt: field.description,\n },\n }\n : field\n\n return (rawAttributes ?? [])\n .map(withAttributeHelp)\n .map((field) => resolveAttributeField(field, resolveContext))\n .map((field, index) =>\n // One field in, one out, so `index` still names the attribute as\n // the schema DECLARED it. The rewrites above change `component` —\n // a Screen picker is the link lookup by now — and what a field can\n // be bound to follows what it holds, not how it is drawn.\n withPropertyBinding(field, {\n declaredComponent: rawAttributes?.[index]?.component,\n declaredField: rawAttributes?.[index],\n componentProps: editedComponentProps,\n owner: componentPropsOwner,\n control: (\n elementPropsComponentMapper as Record<\n string,\n PropertyBindingControl\n >\n )[field.component as string],\n tokenLabelContext,\n }),\n )\n // Every rewrite above spreads the field, so a declared `resolveProps`\n // is still on it here to be handed the element.\n .map((field) => withAttributeFieldContext(field, fieldContext))\n .filter((field) => {\n // Unknown editor types must degrade to a skipped attribute, never\n // kill the whole form: the renderer throws on unregistered\n // components, which blanked the email designer's attributes panel\n // when COLOR_PICKER wasn't mapped (AGL-584).\n const known =\n (field.component as string) in elementPropsComponentMapper\n if (!known && process.env.NODE_ENV !== 'production') {\n console.warn(\n `[ElementPropsForm] attribute \"${field.name}\" uses unregistered ` +\n `editor \"${field.component}\" — skipped; register it in ` +\n 'elementPropsComponentMapper.',\n )\n }\n return known\n })\n }, [\n rawAttributes,\n resolveContext,\n tokenLabelContext,\n editedComponentProps,\n componentPropsOwner,\n fieldContext,\n ])\n\n // The placed component's properties (AGL-1247), each drawn with the\n // control its kind names and finished by the same resolver as the\n // attributes above (AGL-2893).\n const instancePropFields = useMemo(\n () =>\n isInstance\n ? buildInstancePropFields(\n instanceDeclared,\n insertOptions,\n tokenLabelContext,\n { ...resolveContext, themeScales },\n )\n : [],\n [\n isInstance,\n instanceDeclared,\n insertOptions,\n tokenLabelContext,\n resolveContext,\n themeScales,\n ],\n )\n\n // Visibility directives (AGL-1314), inside a component editor only —\n // `componentProps` is the same \"am I editing a definition\" signal the\n // insert picker keys `{{prop.*}}` off.\n const visibilityFields = useMemo(\n () =>\n editedComponentProps\n ? buildVisibilityFields(insertOptions, tokenLabelContext)\n : [],\n [editedComponentProps, insertOptions, tokenLabelContext],\n )\n\n // Element animation (AGL-2486). Static, so it is built once rather than\n // per render; unlike the visibility directives it is offered everywhere.\n const animationFields = useMemo(() => buildAnimationFields(), [])\n\n /**\n * Repeat (AGL-3111), offered on every element and every instance — the\n * whole point of the capability — from whatever sources the loaded plugins\n * registered. Nothing registered, no section.\n *\n * The key field is finished by the same resolver the schema attributes go\n * through, so a source that names an entity picker gets the real picker\n * with its options, its search and its stored value resolved.\n */\n const repeatFields = useMemo(\n () =>\n buildRepeatFields({\n sources: repeatSources,\n hasChildren: Boolean((node?.nodes as unknown[] | undefined)?.length),\n resolveKeyField: (field) =>\n resolveAttributeField(field as never, resolveContext),\n }),\n [repeatSources, node?.nodes, resolveContext],\n )\n\n /**\n * What this element's repeat does, in words, or nothing when it does not\n * repeat (AGL-168, AGL-3111).\n *\n * Named through {@link repeatSourceOf} rather than by reading a prop, so\n * the sentence follows whatever source the author picked and core stays\n * free of the word \"dataset\".\n */\n const repeatNotice = useMemo(() => {\n const repeat = repeatSourceOf({ props: nodeProps })\n if (!repeat) return ''\n // The key as an author knows it, when the source's control is a picker\n // that can name it. A source drawn with anything else — and a picker\n // whose list has not answered — is named by the stored key itself.\n const kind =\n ENTITY_PICKER_KINDS[\n repeat.source.keyAttribute.component as Aglyn.FieldComponentType\n ]\n const label =\n (kind\n ? entitySelectionOption(entityOptions, kind, repeat.key)?.label\n : undefined) ?? repeat.key\n return repeatScope({ props: nodeProps, nodes: node?.nodes }) === 'self'\n ? `This element renders once per record of ${repeat.source.label.toLowerCase()} \"${label}\" on the live site.`\n : `What is inside this element renders once per record of ${repeat.source.label.toLowerCase()} \"${label}\" on the live site.`\n // `repeatSources` keys it: a source registering later changes the answer.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [nodeProps, node?.nodes, entityOptions, repeatSources])\n\n const formFieldSchema = useMemo(\n () =>\n [\n ...attributes,\n ...instancePropFields,\n ...visibilityFields,\n ...animationFields,\n ...repeatFields,\n ].map(withNumericValueParse),\n [\n attributes,\n instancePropFields,\n visibilityFields,\n animationFields,\n repeatFields,\n ],\n )\n\n // Image-typed declared props get the same library browse button the\n // component's own media attributes get (AGL-341).\n const instanceMediaProps = useMemo(() => {\n if (!isInstance) return []\n return (instanceDeclared ?? [])\n .filter(\n (prop) =>\n prop?.type === 'image' &&\n COMPONENT_PROP_NAME_PATTERN.test(prop.name ?? ''),\n )\n .map((prop) => ({\n name: prop.name,\n label: prop.label || prop.name,\n }))\n }, [isInstance, instanceDeclared])\n\n // Text elements (AGL-130): text-editable elements and any element\n // declaring text attributes.\n const textEditable =\n ((schema?.flags?.textEditable ?? FEATURE_FLAG.DISABLED) &\n FEATURE_FLAG.ENABLED) !==\n 0\n const hasTextAttributes = (schema?.attributes ?? []).some(\n (field) =>\n field.component === FieldComponentType.TEXT_FIELD ||\n field.component === FieldComponentType.TEXTAREA,\n )\n\n // Insert binding (AGL-100): appends a {{token}} to the element text.\n // Variable/function docs come from the host app; the commit spreads\n // current props — updateNodeProps REPLACES the props object.\n const { variables: bindingVariables, functions: bindingFunctions } =\n useContext(BindingPickerContext)\n const [bindingAnchor, setBindingAnchor] = useState<HTMLElement | null>(\n null,\n )\n // Friendly summary of bound string props (AGL-193): id tokens display\n // as current names; missing referents surface in warning color.\n const boundPropSummaries = useMemo(() => {\n const summaries: Array<{\n prop: string\n display: string\n missing: boolean\n }> = []\n for (const [key, value] of Object.entries(nodeProps ?? {})) {\n if (typeof value !== 'string' || !hasBindings(value)) continue\n const display = displayBindingTokens(\n value,\n (bindingVariables ?? {}) as any,\n (bindingFunctions ?? {}) as any,\n )\n summaries.push({\n prop: key,\n display,\n missing: display.includes(MISSING_BINDING_LABEL),\n })\n }\n return summaries\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [JSON.stringify(nodeProps ?? {}), bindingVariables, bindingFunctions])\n\n const handleInsertBinding = useCallback(\n (token: string) => {\n setBindingAnchor(null)\n const current = (canvas.toJSON().nodes as Record<string, any>)[\n node?.$id\n ]\n const text =\n typeof current?.props?.children === 'string'\n ? (current.props.children as string)\n : ''\n canvas.updateNodeProps(node, {\n ...current?.props,\n children: text ? `${text} ${token}` : token,\n })\n },\n [node],\n )\n\n // Browse media (AGL-106): elements with a `src` attribute can pick an\n // asset from the host's media library; the commit spreads current props\n // (updateNodeProps REPLACES the props object).\n const { onPickMedia } = useContext(MediaPickerContext)\n // Interactions (AGL-258): element-scoped automations + section A/B.\n const interactions = useContext(InteractionsContext)\n const nodeSelector = node?.$id ? nodeElementSelector(node.$id) : ''\n const nodeAutomations = (interactions.automations ?? []).filter(\n (automation) => automation.selector === nodeSelector,\n )\n const nodeExperiment = (interactions.sectionExperiments ?? []).find(\n (experiment) => experiment.nodeId === node?.$id,\n )\n // Media-bearing attributes (AGL-341): every image/media URL field gets\n // a library browse button; the text field itself stays as the manual\n // URL escape hatch.\n const mediaAttributes = useMemo(\n () =>\n (rawAttributes ?? []).filter(\n (field: any) =>\n field?.component === FieldComponentType.TEXT_FIELD &&\n typeof field?.name === 'string' &&\n /^(src|poster)$|(image|logo|avatar|media|thumbnail|photo|background)(Url)?$/i.test(\n field.name,\n ),\n ),\n [rawAttributes],\n )\n /**\n * True when this element declares an `alt` attribute of its own — Image\n * and Email image today. Read off the SCHEMA rather than assumed, so a\n * component without one is never handed a prop its renderer would drop.\n */\n const declaresAlt = useMemo(\n () => (rawAttributes ?? []).some((field: any) => field?.name === 'alt'),\n [rawAttributes],\n )\n /**\n * Drops the formatting and keeps the words (AGL-2486).\n *\n * Destructive to formatting and labelled as such. It is ONE\n * `updateNodeProps`, so it is one undo entry — undo restores the markup,\n * not merely the text, which is what makes offering it honest.\n *\n * `children` is left exactly as it is: since the projection keeps line\n * breaks it already holds the plain reading of the markup, so the\n * element goes on saying the same thing in the same shape.\n */\n const handleRemoveFormatting = useCallback(() => {\n if (!node?.$id) return\n const current = (canvas.toJSON().nodes as Record<string, any>)[\n node.$id\n ]\n canvas.updateNodeProps(node, withoutFormatting(current?.props))\n }, [node])\n\n const handleBrowseMedia = useCallback(\n (propName: string) => () => {\n // The one kind this attribute can hold, when there is one (AGL-2953).\n const kind = browseMediaKind({\n componentId: node?.componentId,\n propName,\n })\n // Written through verbatim: the host app decides the persisted form\n // (today a media reference — AGL-1215), the renderer resolves it.\n onPickMedia?.((value, asset) => {\n const current = (\n canvas.toJSON().nodes as Record<string, any>\n )[node?.$id]\n canvas.updateNodeProps(node, {\n ...current?.props,\n [propName]: value,\n ...inheritedAltPatch({\n propName,\n declaresAlt,\n props: current?.props,\n assetAlt: asset?.alt,\n }),\n // The asset's own pixel size, so the published `<img>` can\n // reserve its box before the bytes arrive (AGL-2486). Gated on\n // the component id inside the helper: an element whose renderer\n // does not read these would spread them onto the DOM.\n ...intrinsicMediaSize({\n componentId: node?.componentId,\n propName,\n assetWidth: asset?.width,\n assetHeight: asset?.height,\n }),\n // The video companions (AGL-2749): the running time a published\n // page's `VideoObject` needs, the pixel pair that reserves the\n // player's box before any byte of video arrives, and a flag\n // saying the DAM generated a poster still. Gated on the component\n // id inside the helper for the same reason as the pair above.\n // Spread AFTER `intrinsicMediaSize` deliberately — a video's\n // dimensions come from its own `video` record, and this is the\n // one that has them.\n ...videoMediaProps({\n componentId: node?.componentId,\n propName,\n assetVideo: asset?.video,\n assetPoster: asset?.poster,\n }),\n })\n }, { kind })\n },\n [onPickMedia, node, declaresAlt],\n )\n\n // The same picker for an instance's image-typed declared prop, writing\n // into the nested `propValues` object (AGL-1247). Both levels are\n // spread because `updateNodeProps` REPLACES the props object rather\n // than merging into it.\n const handleBrowseInstanceMedia = useCallback(\n (propName: string) => () => {\n if (!node?.$id) return\n onPickMedia?.((value) => {\n const current = (\n canvas.toJSON().nodes as Record<string, any>\n )[node.$id]\n canvas.updateNodeProps(node, {\n ...current?.props,\n [REUSABLE_INSTANCE_PROP_VALUES_KEY]: {\n ...current?.props?.[REUSABLE_INSTANCE_PROP_VALUES_KEY],\n [propName]: value,\n },\n })\n })\n },\n [onPickMedia, node],\n )\n\n /**\n * Hang the media browser off the FIELDS it fills (AGL-2236).\n *\n * The picker has existed since AGL-341, but as full-width buttons after\n * the form — below `Save Element`, past every attribute the element\n * declares. The `src` field's own helper text says to \"Pick from your\n * media library with 'Browse media'\", so an author who read it looked\n * beside the field, found nothing, and concluded the only way to change\n * an image was to hand-type a `media:org:…/…` reference. Attaching the\n * control to the field makes the instruction true.\n *\n * Only fields the token editor renders get one: a read-only attribute\n * keeps no picker, because a control that writes an unwritable field is\n * the same class of lie this issue is about.\n */\n const fieldsWithMediaPickers = useMemo(() => {\n if (!onPickMedia) return formFieldSchema\n const browse = new Map<string, () => void>()\n for (const field of mediaAttributes) {\n browse.set(field.name, handleBrowseMedia(field.name))\n }\n for (const field of instanceMediaProps) {\n browse.set(\n `${REUSABLE_INSTANCE_PROP_VALUES_KEY}.${field.name}`,\n handleBrowseInstanceMedia(field.name),\n )\n }\n if (!browse.size) return formFieldSchema\n return formFieldSchema.map((field: any) =>\n browse.has(field.name) &&\n field.component === TOKEN_TEXT_FIELD_COMPONENT\n ? { ...field, onBrowseMedia: browse.get(field.name) }\n : field,\n )\n }, [\n formFieldSchema,\n mediaAttributes,\n instanceMediaProps,\n onPickMedia,\n handleBrowseMedia,\n handleBrowseInstanceMedia,\n ])\n\n /**\n * Which running time the published page uses, beside the one the field\n * holds (AGL-2838).\n *\n * The page lays a placed film's current DAM records over its node, and the\n * asset's running time wins over the one the pick stored, so after a\n * replace the field can hold a number the page no longer publishes. The\n * field goes on editing the stored value — nothing here writes a draft —\n * and says which value the page uses rather than implying it is this one.\n */\n const shownNode = useNodeWithMediaAssetFacts(node)\n const answered = shownNode !== node\n const answeredSeconds = answered\n ? (shownNode?.props as Record<string, unknown> | undefined)?.[\n 'durationSeconds'\n ]\n : undefined\n const storedSeconds = (nodeProps as Record<string, unknown> | undefined)?.[\n 'durationSeconds'\n ]\n const fieldsWithAssetFacts = useMemo(() => {\n if (!answered || answeredSeconds === storedSeconds) {\n return fieldsWithMediaPickers\n }\n const note =\n answeredSeconds === undefined\n ? 'The media library no longer records a running time for this ' +\n 'film, so the published page gives none.'\n : `The media library records ${answeredSeconds} seconds for this ` +\n 'film, and the published page uses that.'\n return fieldsWithMediaPickers.map((field: any) =>\n field.name === 'durationSeconds' ? { ...field, helperText: note } : field,\n )\n }, [fieldsWithMediaPickers, answered, answeredSeconds, storedSeconds])\n\n // The field names whose value is a number, instance overrides included\n // under the `propValues.` path the schema names them by.\n const numericFieldNames = useMemo(\n () =>\n new Set(\n formFieldSchema\n .filter((field: any) => field?.type === 'number')\n .map((field: any) => field.name as string),\n ),\n [formFieldSchema],\n )\n\n const handleFormCancel = useCallback((e: SyntheticEvent, reason?: string) => {}, [])\n const handleElementSave = useCallback(\n (values: Record<string, unknown>) => {\n // Hand-typed {{name}} tokens normalize to their rename-safe\n // {{var:id}} form at save (AGL-186); unknown names pass through.\n const normalizeToken = (value: unknown) =>\n typeof value === 'string' && hasBindings(value)\n ? normalizeBindingTokens(\n value,\n (bindingVariables ?? {}) as any,\n (bindingFunctions ?? {}) as any,\n )\n : value\n // Numbers typed as text are converted by the field's own `parse`\n // (see `withNumericValueParse`) — repeated here because a document\n // authored before that landed carries the string, and an untouched\n // field never parses. The element goes on rendering at its default\n // until something rewrites the prop, so the next commit does.\n const normalizeNumeric = (name: string, value: unknown) =>\n numericFieldNames.has(name) ? numericTextValue(value) : value\n const normalized: Record<string, unknown> = { ...values }\n for (const [key, value] of Object.entries(values)) {\n normalized[key] = normalizeNumeric(key, normalizeToken(value))\n }\n // A component instance's overrides sit one level down (AGL-1247),\n // so the walk above skips them — normalize inside, or a hand-typed\n // {{name}} in an override would persist in its rename-unsafe form.\n const overrides = values[REUSABLE_INSTANCE_PROP_VALUES_KEY]\n if (overrides && typeof overrides === 'object') {\n const nextOverrides: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(overrides)) {\n nextOverrides[key] = normalizeNumeric(\n `${REUSABLE_INSTANCE_PROP_VALUES_KEY}.${key}`,\n normalizeToken(value),\n )\n }\n normalized[REUSABLE_INSTANCE_PROP_VALUES_KEY] = nextOverrides\n }\n // Denormalize each picked icon's SVG path next to its id (AGL-1212) —\n // see `iconPathsForSave` for why a miss does not always clear it.\n Object.assign(\n normalized,\n iconPathsForSave(\n node?.componentSchema?.attributes,\n normalized,\n node?.props as Record<string, unknown> | undefined,\n ),\n )\n canvas.updateNodeProps(node, normalized)\n },\n [node, bindingVariables, bindingFunctions, numericFieldNames],\n )\n\n return (\n <>\n <NoSsr>\n <FormRenderer\n componentMapper={elementPropsComponentMapper}\n onCancel={handleFormCancel}\n onSubmit={handleElementSave}\n initialValues={nodeProps}\n schema={{ fields: fieldsWithAssetFacts }}\n {...rest}\n >\n {({ formFields, schema, ...rest }) => (\n <>\n {/* Text-capable elements only (AGL-2167): the Text\n attribute here and double-click-to-edit on the canvas\n are the same value, which is the single thing about\n this panel that surprises people. */}\n {textEditable || hasTextAttributes ? (\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-end',\n // The pull-up closes the gap under a row that holds\n // only the help icon, which is shorter than the line\n // box it sits in. `Remove formatting` is a full-height\n // Button, so the same -8px drives its label into the\n // outlined field's notch and overprints the `Text`\n // legend (AGL-2486) — found while capturing the docs\n // shot of this exact control.\n mb: hasFormattedText ? 0 : -1,\n }}\n >\n {/* The escape hatch beside the read-only field\n (AGL-2486). Named for what it DOES — it throws the\n formatting away — and it is one `updateNodeProps`,\n so a single undo brings the markup back. */}\n {hasFormattedText ? (\n /* A warning-coloured button named for a deletion has to\n say WHAT it deletes before it is pressed, not after\n (AGL-2486). The words and the line breaks survive —\n which is the half an author actually worries about —\n so the tooltip leads with that, then names what goes,\n then says it is undoable. Without it the only way to\n find out is to press it. */\n <Tooltip\n title={\n 'Keeps every word and line break. Removes bold, ' +\n 'italic, underline, links and lists, so the text ' +\n 'becomes editable in this field. One undo brings ' +\n 'the formatting back.'\n }\n >\n <Button\n size=\"small\"\n color=\"warning\"\n onClick={handleRemoveFormatting}\n sx={{ mr: 'auto', textTransform: 'none' }}\n >\n {'Remove formatting'}\n </Button>\n </Tooltip>\n ) : null}\n {/* The help tip follows the state the author is IN: with\n formatted text the live question is what the greyed\n field and that button mean, so it deep-links there\n rather than to the section's opening paragraph. */}\n {hasFormattedText ? (\n <HelpTip\n title=\"This text is formatted\"\n excerpt=\"Formatted text is edited on the canvas — double-click the element. Remove formatting to edit it in this field instead; the words and line breaks are kept.\"\n href={besignerDocsUrl(\n 'textEditing',\n '#text-field-read-only',\n )}\n sx={{ fontSize: '0.9em' }}\n />\n ) : (\n <HelpTip\n title=\"Editing text\"\n excerpt=\"The Text attribute and double-clicking the element on the canvas edit the same value. Rich text is opt-in per element.\"\n href={besignerDocsUrl(\n 'textEditing',\n '#the-text-attribute',\n )}\n sx={{ fontSize: '0.9em' }}\n />\n )}\n </Box>\n ) : null}\n <ElementPropsFormTemplate\n formFields={formFields}\n schema={schema}\n {...rest}\n />\n\n {/* Per-instance ATTRIBUTE overrides (AGL-1899), the\n attribute-side twin of the Styles panel's override\n section. Rendered OUTSIDE `ElementPropsFormTemplate` —\n which is the `<form>` — because it runs a form of its own:\n nesting them would produce invalid markup and a submit\n from the inner one would be the outer one's submit.\n\n It writes `node.attrOverrides`, a first-class node field,\n and reads its values from the component DEFINITION rather\n than from this node's props, so it shares no value plumbing\n with the form above and cannot become a second writer on\n anything the form above owns. */}\n {isInstance ? (\n <InstanceAttrOverrides\n node={node}\n componentMapper={elementPropsComponentMapper}\n />\n ) : null}\n\n {boundPropSummaries.length ? (\n <Box sx={{ mt: 2 }}>\n <Box\n component=\"span\"\n sx={{\n fontSize: 12,\n color: 'text.secondary',\n textTransform: 'uppercase',\n letterSpacing: 0.5,\n }}\n >\n {'Bindings on this element'}\n {/* AGL-2167. A summary in warning color is the only\n signal that a referent went missing, and nothing\n here says what to do about it. */}\n <HelpTip\n title=\"Bindings on this element\"\n excerpt=\"Each row is a bound attribute, shown with its current value. A row in warning color means the variable or function it points at no longer exists.\"\n href={besignerDocsUrl('bindings', '#where-used--safety')}\n sx={{ ml: 0.25, fontSize: '0.9em' }}\n />\n </Box>\n {boundPropSummaries.map((summary) => (\n <Box\n key={summary.prop}\n sx={{\n display: 'flex',\n gap: 1,\n fontSize: 13,\n mt: 0.5,\n color: summary.missing\n ? 'warning.main'\n : 'text.primary',\n }}\n >\n <Box component=\"span\" sx={{ color: 'text.secondary' }}>\n {summary.prop}\n </Box>\n <Box\n component=\"span\"\n sx={{\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n }}\n >\n {summary.display}\n </Box>\n </Box>\n ))}\n </Box>\n ) : null}\n {insertOptions.length && textEditable ? (\n <FormControl margin=\"none\" fullWidth>\n <Button\n color=\"primary\"\n onClick={(event) =>\n setBindingAnchor(event.currentTarget)\n }\n sx={{ mt: 2 }}\n fullWidth\n >\n Insert binding\n </Button>\n {/* Element-level picker (AGL-100), now serving the\n full catalog (AGL-583); appends to the text. */}\n <InsertTokenMenu\n anchorEl={bindingAnchor}\n open={Boolean(bindingAnchor)}\n onClose={() => setBindingAnchor(null)}\n options={insertOptions}\n onInsert={handleInsertBinding}\n />\n </FormControl>\n ) : null}\n {/* The \"Browse media\" buttons that used to sit here — after\n the form, below Save Element — now ride on the fields\n themselves as end adornments (AGL-2236). See\n `fieldsWithMediaPickers`. */}\n {/* Interactions moved to their own panel tab.\n They are not attributes: a behaviour authored in a\n dialog rather than a field, and sitting below every\n declared attribute put them under the fold on anything\n with more than a handful. See\n `element-interactions-form.component.tsx`. */}\n {repeatNotice ? (\n <FormControl margin=\"none\" fullWidth>\n {/* What this element's repeat DOES, in the panel where it\n was set (AGL-168, AGL-3111). The canvas carries the\n badge; this says which of the two scopes applies,\n which the canvas cannot show without naming it. */}\n <Alert severity=\"info\" sx={{ mt: 2 }}>\n {repeatNotice}\n </Alert>\n </FormControl>\n ) : null}\n {onPromote && !isInstance && unlocked ? (\n <FormControl margin=\"none\" fullWidth>\n <Button\n color=\"primary\"\n onClick={() => onPromote(node)}\n sx={{ mt: 2 }}\n fullWidth\n >\n Save as reusable component\n </Button>\n </FormControl>\n ) : null}\n {/* Edit component (AGL-1303): navigation, not a mutation of\n THIS document, so unlike Detach it is not gated on the\n node being unlocked — locked layout-chrome instances\n need it most. */}\n {onEditComponent && isInstance ? (\n <FormControl margin=\"none\" fullWidth>\n <Button\n color=\"primary\"\n onClick={() => onEditComponent(node)}\n sx={{ mt: 2 }}\n fullWidth\n >\n Edit component\n </Button>\n </FormControl>\n ) : null}\n {onDemote && isInstance && unlocked ? (\n <FormControl margin=\"none\" fullWidth>\n <Button\n color=\"primary\"\n onClick={() => onDemote(node)}\n sx={{ mt: 2 }}\n fullWidth\n >\n Detach from component\n </Button>\n </FormControl>\n ) : null}\n <FormControl margin=\"none\" fullWidth>\n <Button\n onClick={() => deleteElementCallback(node)}\n sx={{ mt: 2, color: 'error.main' }}\n fullWidth\n >\n Delete Element\n </Button>\n </FormControl>\n {/* What this element IS: the component's own\n description and the node's ids, in two collapsed\n accordions. They were a tab of their own, which cost every\n reader a third of the panel's header for reference detail\n most of them never open. Last, and closed, so they cost\n nothing until wanted. */}\n <ElementInfoDetails node={node} />\n </>\n )}\n </FormRenderer>\n </NoSsr>\n </>\n )\n },\n)\nElementPropsFormRaw.displayName = 'ElementPropsForm'\nElementPropsFormRaw.aglyn = true\n\nexport const ElementPropsForm = observer(ElementPropsFormRaw)\nexport default ElementPropsForm\n"],"names":["PluginSettingsField","PLUGIN_SETTINGS_FIELD_COMPONENT","ANIMATION_DEFAULT_DELAY_MS","ANIMATION_DEFAULT_DURATION_MS","ANIMATION_DEFAULT_EASE","ANIMATION_DEFAULT_STAGGER_STEP_MS","ANIMATION_DEFAULT_TRIGGER","ANIMATION_MAX_DURATION_MS","ANIMATION_MAX_STAGGER_STEP_MS","ANIMATION_NONE","ANIMATION_PRESETS","canvas","COMPONENT_PROP_NAME_PATTERN","components","displayBindingTokens","ENTITY_PICKER_BROWSE_LIMIT","entityListState","EntityPickerContext","entityValueNeedsResolution","FEATURE_FLAG","FieldComponentType","getKnownPluginInstalls","getKnownPluginInstallsVersion","hasBindings","inheritedMediaAlt","intrinsicMediaSize","linkTargetKind","VIDEO_COMPONENT_ID","videoMediaProps","MISSING_BINDING_LABEL","NODE_ANIMATION_DELAY_PROP","NODE_ANIMATION_DURATION_PROP","NODE_ANIMATION_EASE_PROP","NODE_ANIMATION_PROP","NODE_ANIMATION_REPEAT_PROP","NODE_ANIMATION_STAGGER_PROP","NODE_ANIMATION_STAGGER_STEP_PROP","NODE_ANIMATION_TRIGGER_PROP","NODE_HIDE_IF_PROP","NODE_HIDE_UNLESS_PROP","normalizeBindingTokens","readInstanceIconValue","readReusablePropValue","readYesNoValue","reusablePropConditionValue","reusablePropDefaultValue","reusablePropKind","reusablePropTakesSeveral","evaluateReusablePropRule","REUSABLE_INSTANCE_COMPONENT_ID","REUSABLE_INSTANCE_PROP_VALUES_KEY","ScreenLinkContext","screenLinkTargetOptions","subscribeKnownPluginInstalls","unresolvedScreenOption","repeatScope","REPEAT_NODE_CAPABILITY","repeatSourceOf","useAglynSiteTheme","FormRenderer","FormSpy","FIELD_MAP_BREAKPOINT_SPAN","FIELD_MAP_CHECKBOX","FIELD_MAP_COLOR_PICKER","FIELD_MAP_CSS_BORDER","FIELD_MAP_CSS_DIMENSION","FIELD_MAP_CSS_GRADIENT","FIELD_MAP_DATA_TABLE","FIELD_MAP_DUAL_LIST_SELECT","FIELD_MAP_ICON_PICKER","FIELD_MAP_PRESET_CHOICE","FIELD_MAP_RADIO","FIELD_MAP_SLIDER","FIELD_MAP_THEME_SCALE","FIELD_MAP_TOGGLE_BUTTON","simpleComponentMapper","useFormApi","useHostThemeDocument","getMdiIconPath","iconPathPropName","mdiContentSave","HelpTip","MdiIcon","Alert","NoSsr","Tooltip","Box","Button","FormControl","Grid","observer","Besigner","forwardRef","memo","useCallback","useContext","useEffect","useMemo","useRef","useState","useSyncExternalStore","BindingPickerContext","InsertTokenMenu","TokenTextField","TOKEN_TEXT_FIELD_COMPONENT","MarkdownAttributeField","MARKDOWN_ATTRIBUTE_FIELD_COMPONENT","ScreenLinkField","ScreenTargetField","SCREEN_LINK_FIELD_COMPONENT","SCREEN_TARGET_FIELD_COMPONENT","PropertyBindingField","PROPERTY_BINDING_FIELD_COMPONENT","withPropertyBinding","readAttributeFieldValue","besignerDocsUrl","buildStyleThemeScales","numericTextValue","ElementInfoDetails","useInsertTokenOptions","useRepeatSources","InteractionsContext","nodeElementSelector","MediaPickerContext","ComponentPromotionContext","InstanceAttrOverrides","useDeleteElementCallback","ATTRIBUTE_COMMIT_DEBOUNCE_MS","useDebouncedCommit","useNodeWithMediaAssetFacts","AutoSaveOnChange","values","pristine","valid","onSchedule","isFirstRender","current","isFormattedText","node","componentId","html","props","length","withoutFormatting","next","ElementPropsFormTemplate","ref","formFields","schema","rest","handleSubmit","schedule","flush","form","onSubmit","noValidate","onBlur","title","spacing","container","subscription","submitting","sx","mt","margin","fullWidth","color","disabled","startIcon","path","style","marginRight","type","variant","displayName","aglyn","elementPropsComponentMapper","ICON_PICKER","CHECKBOX","COLOR_PICKER","CSS_DIMENSION","CSS_GRADIENT","DATA_TABLE","BREAKPOINT_SPAN","CSS_BORDER","PRESET_CHOICE","THEME_SCALE","RADIO","SLIDER","TOGGLE_BUTTON","DUAL_LIST_SELECT","MARKDOWN","withNumericValueParse","field","FieldProps","parse","withAttributeFieldContext","context","resolveProps","args","parseYesNoPropValue","value","undefined","iconPathsForSave","attributes","stored","paths","attribute","component","pathProp","name","pickedId","unchanged","storedPath","formatIconPropValue","iconId","parseIconPropValue","iconPath","CLEARABLE_FIELD_KINDS","Set","SELECT","SWITCH","CATEGORY_SELECT","COLLECTION_SELECT","DATASET_FIELD_SELECT","DATASET_SELECT","FORM_SELECT","NODE_SELECT","PLUGIN_SELECT","PRODUCT_SELECT","propertyAnswers","prop","options","filter","option","map","label","describePropertyDefault","answers","fallback","chosen","Array","isArray","find","answer","Boolean","join","text","String","propertyFieldCondition","condition","declared","valuePath","byName","Map","convert","entry","and","or","not","when","rule","target","get","is","own","buildPropertyField","kind","role","propName","noun","tokenOptions","tokenLabelContext","themeScales","settings","pageSets","defaultNote","base","fieldProps","description","help","excerpt","has","clearable","ownersDefault","defaultValue","fallbackAnswer","unsetChecked","_props","_field","formOptions","getFieldState","several","fallbackLabels","isMulti","placeholder","format","propDefault","propDefaultOwner","emptyLabel","reduce","range","key","numeric","Number","isFinite","scaleOptions","presets","choices","previewKind","datasetId","PLUGIN_SETTINGS","pluginProperty","plugin","pluginDefault","listingField","listingFallback","buildInstancePropFields","buildPropertyValueFields","pathOf","insertOptions","test","resolveAttributeField","screens","labels","entityOptions","nodeOptions","ancestorDatasetId","hasFormattedText","SCREEN_SELECT","stranded","some","o","push","installs","install","listingId","modelFields","datasetFields","modelField","id","entityKind","ENTITY_PICKER_KINDS","buildEntityPickerField","DATE_PICKER","TIME_PICKER","TEXT_FIELD","multiline","isReadOnly","TEXTAREA","inheritedAltPatch","declaresAlt","assetAlt","alt","placementAlt","decorative","browseMediaKind","buildVisibilityFields","buildAnimationFields","animated","preset","staggerable","initialValue","buildRepeatFields","sources","hasChildren","resolveKeyField","anchor","href","repeating","keyProp","isNotEmpty","source","keyAttribute","requiresChildren","docsAnchor","_requiresChildren","ENTITY_PICKER_ORIGIN","products","singular","plural","page","collections","categories","datasets","forms","entityPickerPlaceholder","state","count","entityPickerBrowseNotice","truncated","first","searchable","entityPickerNoMatchText","entitySelectionOption","trim","entity","resolved","settledWithNoLookup","resolve","entities","selected","notice","search","request","onOpen","isSearchable","onSearchInput","reason","helperText","noOptionsText","sort","a","b","localeCompare","entityKindsForAttributes","kinds","add","ElementPropsFormRaw","interactions","shownNode","componentSchema","nodeProps","deleteElementCallback","rawAttributes","onPromote","onDemote","onEditComponent","definitions","isInstance","unlocked","dnd","canDragNode","instanceDeclared","refId","demandAttributes","requestEntities","resolveEntity","repeatSources","repeat","wantsNodes","canvasNodes","toJSON","nodes","Object","entries","$id","candidate","getSchema","children","slice","hasDatasetFieldSelect","hops","datasetName","byLabel","dataset","parentId","labelContext","knownPluginInstallsVersion","componentProps","editedComponentProps","componentPropsOwner","fieldContext","getNode","hostThemeDoc","siteTheme","theme","resolveContext","pluginInstallsVersion","withAttributeHelp","index","declaredComponent","declaredField","owner","control","known","process","env","NODE_ENV","console","warn","instancePropFields","visibilityFields","animationFields","repeatFields","repeatNotice","toLowerCase","formFieldSchema","instanceMediaProps","textEditable","flags","DISABLED","ENABLED","hasTextAttributes","variables","bindingVariables","functions","bindingFunctions","bindingAnchor","setBindingAnchor","boundPropSummaries","summaries","display","missing","includes","JSON","stringify","handleInsertBinding","token","updateNodeProps","onPickMedia","nodeSelector","nodeAutomations","automations","automation","selector","nodeExperiment","sectionExperiments","experiment","nodeId","mediaAttributes","handleRemoveFormatting","handleBrowseMedia","asset","assetWidth","width","assetHeight","height","assetVideo","video","assetPoster","poster","handleBrowseInstanceMedia","fieldsWithMediaPickers","browse","set","size","onBrowseMedia","answered","answeredSeconds","storedSeconds","fieldsWithAssetFacts","note","numericFieldNames","handleFormCancel","e","handleElementSave","normalizeToken","normalizeNumeric","normalized","overrides","nextOverrides","assign","componentMapper","onCancel","initialValues","fields","alignItems","justifyContent","mb","onClick","mr","textTransform","fontSize","letterSpacing","ml","summary","gap","overflow","textOverflow","whiteSpace","event","currentTarget","anchorEl","open","onClose","onInsert","severity","ElementPropsForm"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,OAAOA,uBACLC,+BAA+B,QAC1B,uCAAmC;AAE1C,SACEC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,sBAAsB,EACtBC,iCAAiC,EACjCC,yBAAyB,EACzBC,yBAAyB,EACzBC,6BAA6B,EAC7BC,cAAc,EACdC,iBAAiB,EACjBC,MAAM,EACNC,2BAA2B,EAC3BC,UAAU,EACVC,oBAAoB,EACpBC,0BAA0B,EAC1BC,e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ACxBwB,IAAI;wCAAEC,IAAI;oCAAE;oCACZE,SAAS;8CACV;;iCAID;0CACJ,KAAC7E;gCAAY4E,QAAO;gCAAOC,SAAS;0CAClC,cAAA,KAAC9E;oCACCyd,SAAS,IAAMzI,sBAAsB7R;oCACrCwB,IAAI;wCAAEC,IAAI;wCAAGG,OAAO;oCAAa;oCACjCD,SAAS;8CACV;;;0CAUH,KAAC/C;gCAAmBoB,MAAMA;;;;;;;;AAOxC;AAEFwR,oBAAoBpP,WAAW,GAAG;AAClCoP,oBAAoBnP,KAAK,GAAG;AAE5B,OAAO,MAAMmZ,mBAAmBxe,SAASwU,qBAAoB;AAC7D,eAAegK,iBAAgB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { type FormTemplateRenderProps } from '@aglyn/shared-ui-jsx-forms';
|
|
18
|
+
/**
|
|
19
|
+
* Immediate-apply form template for the styles panel (AGL-587): style
|
|
20
|
+
* edits commit on a short debounce with no "Save Element" button, so
|
|
21
|
+
* every control in the panel shares one interaction model with the
|
|
22
|
+
* toggle accordions and the BoxStyler. Focus leaving a field flushes
|
|
23
|
+
* the pending commit, matching the attributes form's behavior
|
|
24
|
+
* (AGL-567); teardown flushes too, so the last edit is never dropped.
|
|
25
|
+
*/
|
|
26
|
+
export declare const ElementStylesFormTemplate: import("react").ForwardRefExoticComponent<Omit<FormTemplateRenderProps, "ref"> & import("react").RefAttributes<any>>;
|
|
27
|
+
export default ElementStylesFormTemplate;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
/**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright 2026 Aglyn LLC
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*/ import { FormSpy, useFormApi } from "@aglyn/shared-ui-jsx-forms";
|
|
20
|
+
import { Grid } from "@mui/material";
|
|
21
|
+
import { forwardRef, memo, useEffect, useRef } from "react";
|
|
22
|
+
import { useDebouncedCommit } from "./element-props-form.component.js";
|
|
23
|
+
// Subscribes to form value changes via FormSpy and schedules a debounced
|
|
24
|
+
// commit when dirty. The spy is needed because MUI Select uses a Portal, so
|
|
25
|
+
// its onChange never bubbles through the <form> element as a DOM event.
|
|
26
|
+
const AutoApplyOnChange = /*#__PURE__*/ memo(function AutoApplyOnChange({ values, pristine, valid, onSchedule }) {
|
|
27
|
+
const isFirstRender = useRef(true);
|
|
28
|
+
useEffect(()=>{
|
|
29
|
+
if (isFirstRender.current) {
|
|
30
|
+
isFirstRender.current = false;
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (!pristine && valid) {
|
|
34
|
+
onSchedule();
|
|
35
|
+
}
|
|
36
|
+
}, [
|
|
37
|
+
values
|
|
38
|
+
]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
39
|
+
return null;
|
|
40
|
+
});
|
|
41
|
+
/**
|
|
42
|
+
* Immediate-apply form template for the styles panel (AGL-587): style
|
|
43
|
+
* edits commit on a short debounce with no "Save Element" button, so
|
|
44
|
+
* every control in the panel shares one interaction model with the
|
|
45
|
+
* toggle accordions and the BoxStyler. Focus leaving a field flushes
|
|
46
|
+
* the pending commit, matching the attributes form's behavior
|
|
47
|
+
* (AGL-567); teardown flushes too, so the last edit is never dropped.
|
|
48
|
+
*/ export const ElementStylesFormTemplate = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
49
|
+
const { formFields, schema } = props, rest = _object_without_properties_loose(props, [
|
|
50
|
+
"formFields",
|
|
51
|
+
"schema"
|
|
52
|
+
]);
|
|
53
|
+
const { handleSubmit } = useFormApi();
|
|
54
|
+
const { schedule, flush } = useDebouncedCommit(handleSubmit);
|
|
55
|
+
return /*#__PURE__*/ _jsxs("form", _extends({
|
|
56
|
+
ref: ref,
|
|
57
|
+
onSubmit: handleSubmit,
|
|
58
|
+
noValidate: true
|
|
59
|
+
}, rest, {
|
|
60
|
+
// Placed after {...rest} so this handler always wins.
|
|
61
|
+
onBlur: flush,
|
|
62
|
+
children: [
|
|
63
|
+
schema.title,
|
|
64
|
+
/*#__PURE__*/ _jsx(Grid, {
|
|
65
|
+
spacing: 2,
|
|
66
|
+
container: true,
|
|
67
|
+
children: formFields
|
|
68
|
+
}),
|
|
69
|
+
/*#__PURE__*/ _jsx(FormSpy, {
|
|
70
|
+
subscription: {
|
|
71
|
+
values: true,
|
|
72
|
+
pristine: true,
|
|
73
|
+
valid: true
|
|
74
|
+
},
|
|
75
|
+
children: ({ values, pristine, valid })=>/*#__PURE__*/ _jsx(AutoApplyOnChange, {
|
|
76
|
+
values: values,
|
|
77
|
+
pristine: pristine,
|
|
78
|
+
valid: valid,
|
|
79
|
+
onSchedule: schedule
|
|
80
|
+
})
|
|
81
|
+
})
|
|
82
|
+
]
|
|
83
|
+
}));
|
|
84
|
+
});
|
|
85
|
+
ElementStylesFormTemplate.displayName = 'ElementStylesFormTemplate';
|
|
86
|
+
ElementStylesFormTemplate.aglyn = true;
|
|
87
|
+
export default ElementStylesFormTemplate;
|
|
88
|
+
|
|
89
|
+
//# sourceMappingURL=element-styles-form-template.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/element-styles-form-template.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FormSpy,\n type FormTemplateRenderProps,\n useFormApi,\n} from '@aglyn/shared-ui-jsx-forms'\nimport { Grid } from '@mui/material'\nimport { forwardRef, memo, useEffect, useRef } from 'react'\nimport { useDebouncedCommit } from './element-props-form.component'\n\n// Subscribes to form value changes via FormSpy and schedules a debounced\n// commit when dirty. The spy is needed because MUI Select uses a Portal, so\n// its onChange never bubbles through the <form> element as a DOM event.\nconst AutoApplyOnChange = memo(function AutoApplyOnChange({\n values,\n pristine,\n valid,\n onSchedule,\n}: {\n values: unknown\n pristine: boolean\n valid: boolean\n onSchedule: () => void\n}) {\n const isFirstRender = useRef(true)\n useEffect(() => {\n if (isFirstRender.current) {\n isFirstRender.current = false\n return\n }\n if (!pristine && valid) {\n onSchedule()\n }\n }, [values]) // eslint-disable-line react-hooks/exhaustive-deps\n return null\n})\n\n/**\n * Immediate-apply form template for the styles panel (AGL-587): style\n * edits commit on a short debounce with no \"Save Element\" button, so\n * every control in the panel shares one interaction model with the\n * toggle accordions and the BoxStyler. Focus leaving a field flushes\n * the pending commit, matching the attributes form's behavior\n * (AGL-567); teardown flushes too, so the last edit is never dropped.\n */\nexport const ElementStylesFormTemplate = forwardRef<\n any,\n FormTemplateRenderProps\n>((props, ref) => {\n const { formFields, schema, ...rest } = props\n const { handleSubmit } = useFormApi()\n const { schedule, flush } = useDebouncedCommit(handleSubmit)\n return (\n <form\n ref={ref}\n onSubmit={handleSubmit}\n noValidate\n {...rest}\n // Placed after {...rest} so this handler always wins.\n onBlur={flush}\n >\n {schema.title}\n <Grid spacing={2} container>\n {formFields as unknown as JSX.Node}\n </Grid>\n <FormSpy subscription={{ values: true, pristine: true, valid: true }}>\n {({ values, pristine, valid }) => (\n <AutoApplyOnChange\n values={values}\n pristine={pristine}\n valid={valid}\n onSchedule={schedule}\n />\n )}\n </FormSpy>\n </form>\n )\n})\nElementStylesFormTemplate.displayName = 'ElementStylesFormTemplate'\nElementStylesFormTemplate.aglyn = true\n\nexport default ElementStylesFormTemplate\n"],"names":["FormSpy","useFormApi","Grid","forwardRef","memo","useEffect","useRef","useDebouncedCommit","AutoApplyOnChange","values","pristine","valid","onSchedule","isFirstRender","current","ElementStylesFormTemplate","props","ref","formFields","schema","rest","handleSubmit","schedule","flush","form","onSubmit","noValidate","onBlur","title","spacing","container","subscription","displayName","aglyn"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,SACEA,OAAO,EAEPC,UAAU,QACL,6BAA4B;AACnC,SAASC,IAAI,QAAQ,gBAAe;AACpC,SAASC,UAAU,EAAEC,IAAI,EAAEC,SAAS,EAAEC,MAAM,QAAQ,QAAO;AAC3D,SAASC,kBAAkB,QAAQ,oCAAgC;AAEnE,yEAAyE;AACzE,4EAA4E;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