@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,59 @@
|
|
|
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
|
+
/**
|
|
18
|
+
* The canvas's side of a read it cannot make itself (AGL-2838, AGL-3111).
|
|
19
|
+
*
|
|
20
|
+
* The designer does not read Firestore — it renders inside a plugin sandbox,
|
|
21
|
+
* and the documents are the host app's to know. So a canvas element HOLDS what
|
|
22
|
+
* it needs read, the host app renders one reader per held request, and each
|
|
23
|
+
* reader files its answer back here under the request's key, where the element
|
|
24
|
+
* reads it.
|
|
25
|
+
*/
|
|
26
|
+
export interface HeldAnswersSource<Request, Answer> {
|
|
27
|
+
/**
|
|
28
|
+
* The answer filed under `key`, or `undefined` while nothing has answered.
|
|
29
|
+
*/
|
|
30
|
+
get(key: string): Answer | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Keeps the request read while the caller holds it, and returns the
|
|
33
|
+
* release. Holds are counted, so two holders of one request share a read
|
|
34
|
+
* and the read ends with the last of them.
|
|
35
|
+
*/
|
|
36
|
+
retain(request: Request): () => void;
|
|
37
|
+
/** Called after any answer changes. Returns the unsubscribe. */
|
|
38
|
+
subscribe(listener: () => void): () => void;
|
|
39
|
+
/** Moves on every change, so a subscriber can tell a new answer apart. */
|
|
40
|
+
getVersion(): number;
|
|
41
|
+
}
|
|
42
|
+
/** The source, plus the two ends the host app drives it from. */
|
|
43
|
+
export interface HeldAnswersStore<Request, Answer> extends HeldAnswersSource<Request, Answer> {
|
|
44
|
+
/** Files a request's answer; no answer withdraws it. */
|
|
45
|
+
set(key: string, answer: Answer | undefined): void;
|
|
46
|
+
/**
|
|
47
|
+
* The requests something currently holds, one per key. The array is
|
|
48
|
+
* replaced only when that set changes, which is the stable snapshot
|
|
49
|
+
* `useSyncExternalStore` needs to render one reader per request.
|
|
50
|
+
*/
|
|
51
|
+
getRetained(): readonly Request[];
|
|
52
|
+
/** Called after the held set changes. Returns the unsubscribe. */
|
|
53
|
+
subscribeRetained(listener: () => void): () => void;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* An in-memory store keyed by `keyOf`. How each request is read is the host
|
|
57
|
+
* app's business.
|
|
58
|
+
*/
|
|
59
|
+
export declare function createHeldAnswersStore<Request, Answer>(keyOf: (request: Request) => string): HeldAnswersStore<Request, Answer>;
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
* The canvas's side of a read it cannot make itself (AGL-2838, AGL-3111).
|
|
18
|
+
*
|
|
19
|
+
* The designer does not read Firestore — it renders inside a plugin sandbox,
|
|
20
|
+
* and the documents are the host app's to know. So a canvas element HOLDS what
|
|
21
|
+
* it needs read, the host app renders one reader per held request, and each
|
|
22
|
+
* reader files its answer back here under the request's key, where the element
|
|
23
|
+
* reads it.
|
|
24
|
+
*/ /**
|
|
25
|
+
* An in-memory store keyed by `keyOf`. How each request is read is the host
|
|
26
|
+
* app's business.
|
|
27
|
+
*/ export function createHeldAnswersStore(keyOf) {
|
|
28
|
+
const answers = new Map();
|
|
29
|
+
const holds = new Map();
|
|
30
|
+
const listeners = new Set();
|
|
31
|
+
const retainedListeners = new Set();
|
|
32
|
+
let version = 0;
|
|
33
|
+
let retained = [];
|
|
34
|
+
const notify = (targets)=>{
|
|
35
|
+
for (const listener of [
|
|
36
|
+
...targets
|
|
37
|
+
])listener();
|
|
38
|
+
};
|
|
39
|
+
const publishRetained = ()=>{
|
|
40
|
+
retained = [
|
|
41
|
+
...holds.values()
|
|
42
|
+
].map((hold)=>hold.request);
|
|
43
|
+
notify(retainedListeners);
|
|
44
|
+
};
|
|
45
|
+
return {
|
|
46
|
+
get: (key)=>answers.get(key),
|
|
47
|
+
getVersion: ()=>version,
|
|
48
|
+
subscribe: (listener)=>{
|
|
49
|
+
listeners.add(listener);
|
|
50
|
+
return ()=>{
|
|
51
|
+
listeners.delete(listener);
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
retain: (request)=>{
|
|
55
|
+
const key = keyOf(request);
|
|
56
|
+
const hold = holds.get(key);
|
|
57
|
+
if (hold) {
|
|
58
|
+
hold.count += 1;
|
|
59
|
+
} else {
|
|
60
|
+
holds.set(key, {
|
|
61
|
+
request,
|
|
62
|
+
count: 1
|
|
63
|
+
});
|
|
64
|
+
publishRetained();
|
|
65
|
+
}
|
|
66
|
+
let released = false;
|
|
67
|
+
return ()=>{
|
|
68
|
+
if (released) return;
|
|
69
|
+
released = true;
|
|
70
|
+
const current = holds.get(key);
|
|
71
|
+
if (!current) return;
|
|
72
|
+
current.count -= 1;
|
|
73
|
+
if (current.count > 0) return;
|
|
74
|
+
holds.delete(key);
|
|
75
|
+
publishRetained();
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
set: (key, answer)=>{
|
|
79
|
+
if (answer) answers.set(key, answer);
|
|
80
|
+
else if (!answers.delete(key)) return;
|
|
81
|
+
version += 1;
|
|
82
|
+
notify(listeners);
|
|
83
|
+
},
|
|
84
|
+
getRetained: ()=>retained,
|
|
85
|
+
subscribeRetained: (listener)=>{
|
|
86
|
+
retainedListeners.add(listener);
|
|
87
|
+
return ()=>{
|
|
88
|
+
retainedListeners.delete(listener);
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
//# sourceMappingURL=held-answers-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/utils/held-answers-store.ts"],"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\n/**\n * The canvas's side of a read it cannot make itself (AGL-2838, AGL-3111).\n *\n * The designer does not read Firestore — it renders inside a plugin sandbox,\n * and the documents are the host app's to know. So a canvas element HOLDS what\n * it needs read, the host app renders one reader per held request, and each\n * reader files its answer back here under the request's key, where the element\n * reads it.\n */\nexport interface HeldAnswersSource<Request, Answer> {\n /**\n * The answer filed under `key`, or `undefined` while nothing has answered.\n */\n get(key: string): Answer | undefined\n /**\n * Keeps the request read while the caller holds it, and returns the\n * release. Holds are counted, so two holders of one request share a read\n * and the read ends with the last of them.\n */\n retain(request: Request): () => void\n /** Called after any answer changes. Returns the unsubscribe. */\n subscribe(listener: () => void): () => void\n /** Moves on every change, so a subscriber can tell a new answer apart. */\n getVersion(): number\n}\n\n/** The source, plus the two ends the host app drives it from. */\nexport interface HeldAnswersStore<Request, Answer>\n extends HeldAnswersSource<Request, Answer> {\n /** Files a request's answer; no answer withdraws it. */\n set(key: string, answer: Answer | undefined): void\n /**\n * The requests something currently holds, one per key. The array is\n * replaced only when that set changes, which is the stable snapshot\n * `useSyncExternalStore` needs to render one reader per request.\n */\n getRetained(): readonly Request[]\n /** Called after the held set changes. Returns the unsubscribe. */\n subscribeRetained(listener: () => void): () => void\n}\n\n/**\n * An in-memory store keyed by `keyOf`. How each request is read is the host\n * app's business.\n */\nexport function createHeldAnswersStore<Request, Answer>(\n keyOf: (request: Request) => string,\n): HeldAnswersStore<Request, Answer> {\n const answers = new Map<string, Answer>()\n const holds = new Map<string, { request: Request; count: number }>()\n const listeners = new Set<() => void>()\n const retainedListeners = new Set<() => void>()\n let version = 0\n let retained: readonly Request[] = []\n const notify = (targets: Set<() => void>) => {\n for (const listener of [...targets]) listener()\n }\n const publishRetained = () => {\n retained = [...holds.values()].map((hold) => hold.request)\n notify(retainedListeners)\n }\n return {\n get: (key) => answers.get(key),\n getVersion: () => version,\n subscribe: (listener) => {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n },\n retain: (request) => {\n const key = keyOf(request)\n const hold = holds.get(key)\n if (hold) {\n hold.count += 1\n } else {\n holds.set(key, { request, count: 1 })\n publishRetained()\n }\n let released = false\n return () => {\n if (released) return\n released = true\n const current = holds.get(key)\n if (!current) return\n current.count -= 1\n if (current.count > 0) return\n holds.delete(key)\n publishRetained()\n }\n },\n set: (key, answer) => {\n if (answer) answers.set(key, answer)\n else if (!answers.delete(key)) return\n version += 1\n notify(listeners)\n },\n getRetained: () => retained,\n subscribeRetained: (listener) => {\n retainedListeners.add(listener)\n return () => {\n retainedListeners.delete(listener)\n }\n },\n }\n}\n"],"names":["createHeldAnswersStore","keyOf","answers","Map","holds","listeners","Set","retainedListeners","version","retained","notify","targets","listener","publishRetained","values","map","hold","request","get","key","getVersion","subscribe","add","delete","retain","count","set","released","current","answer","getRetained","subscribeRetained"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;CAQC,GAiCD;;;CAGC,GACD,OAAO,SAASA,uBACdC,KAAmC;IAEnC,MAAMC,UAAU,IAAIC;IACpB,MAAMC,QAAQ,IAAID;IAClB,MAAME,YAAY,IAAIC;IACtB,MAAMC,oBAAoB,IAAID;IAC9B,IAAIE,UAAU;IACd,IAAIC,WAA+B,EAAE;IACrC,MAAMC,SAAS,CAACC;QACd,KAAK,MAAMC,YAAY;eAAID;SAAQ,CAAEC;IACvC;IACA,MAAMC,kBAAkB;QACtBJ,WAAW;eAAIL,MAAMU,MAAM;SAAG,CAACC,GAAG,CAAC,CAACC,OAASA,KAAKC,OAAO;QACzDP,OAAOH;IACT;IACA,OAAO;QACLW,KAAK,CAACC,MAAQjB,QAAQgB,GAAG,CAACC;QAC1BC,YAAY,IAAMZ;QAClBa,WAAW,CAACT;YACVP,UAAUiB,GAAG,CAACV;YACd,OAAO;gBACLP,UAAUkB,MAAM,CAACX;YACnB;QACF;QACAY,QAAQ,CAACP;YACP,MAAME,MAAMlB,MAAMgB;YAClB,MAAMD,OAAOZ,MAAMc,GAAG,CAACC;YACvB,IAAIH,MAAM;gBACRA,KAAKS,KAAK,IAAI;YAChB,OAAO;gBACLrB,MAAMsB,GAAG,CAACP,KAAK;oBAAEF;oBAASQ,OAAO;gBAAE;gBACnCZ;YACF;YACA,IAAIc,WAAW;YACf,OAAO;gBACL,IAAIA,UAAU;gBACdA,WAAW;gBACX,MAAMC,UAAUxB,MAAMc,GAAG,CAACC;gBAC1B,IAAI,CAACS,SAAS;gBACdA,QAAQH,KAAK,IAAI;gBACjB,IAAIG,QAAQH,KAAK,GAAG,GAAG;gBACvBrB,MAAMmB,MAAM,CAACJ;gBACbN;YACF;QACF;QACAa,KAAK,CAACP,KAAKU;YACT,IAAIA,QAAQ3B,QAAQwB,GAAG,CAACP,KAAKU;iBACxB,IAAI,CAAC3B,QAAQqB,MAAM,CAACJ,MAAM;YAC/BX,WAAW;YACXE,OAAOL;QACT;QACAyB,aAAa,IAAMrB;QACnBsB,mBAAmB,CAACnB;YAClBL,kBAAkBe,GAAG,CAACV;YACtB,OAAO;gBACLL,kBAAkBgB,MAAM,CAACX;YAC3B;QACF;IACF;AACF"}
|
|
@@ -0,0 +1,118 @@
|
|
|
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
|
+
/** Marks the element currently being edited in place, for tests and probes. */
|
|
18
|
+
export declare const IN_PLACE_EDITING_ATTR = "data-aglyn-editing";
|
|
19
|
+
export interface InPlaceEditSurface {
|
|
20
|
+
/** The element the author is typing into — the canvas leaf itself. */
|
|
21
|
+
readonly element: HTMLElement;
|
|
22
|
+
/** The selection root to ask for the caret; see {@link selectionOf}. */
|
|
23
|
+
readonly selection: () => Selection | null;
|
|
24
|
+
/** Ends the edit and gives the element back to React, untouched. */
|
|
25
|
+
dispose(): void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The caret, across a CLOSED shadow root.
|
|
29
|
+
*
|
|
30
|
+
* The canvas renders into `mode="closed"` (`viewport-frame.component.tsx`),
|
|
31
|
+
* so `document.getSelection()` cannot see a caret inside it — it retargets to
|
|
32
|
+
* the host, and `host.shadowRoot` is null from outside. What still works is
|
|
33
|
+
* that a node INSIDE the tree can always reach its own root:
|
|
34
|
+
* `Node.getRootNode()` returns the `ShadowRoot` whatever its mode, and Chrome
|
|
35
|
+
* implements `ShadowRoot.getSelection()`. So the caret is readable as long as
|
|
36
|
+
* you ask from an element that is already in there — which the edited leaf
|
|
37
|
+
* is.
|
|
38
|
+
*
|
|
39
|
+
* Falls back to the document selection for a light-DOM element and for
|
|
40
|
+
* engines without the non-standard accessor, so this is never the reason an
|
|
41
|
+
* edit fails.
|
|
42
|
+
*/
|
|
43
|
+
export declare function selectionOf(element: Node): Selection | null;
|
|
44
|
+
/**
|
|
45
|
+
* Turns the canvas leaf ITSELF into the editing surface (AGL-2486).
|
|
46
|
+
*
|
|
47
|
+
* A boxed editing overlay is a rectangle; the thing it stands in for is a
|
|
48
|
+
* flow of line boxes, and those two geometries always end up disagreeing.
|
|
49
|
+
* Every bug in this area — the surface wrapping before the element does, the
|
|
50
|
+
* reserved space not growing, an inline run overflowing onto its sibling — is
|
|
51
|
+
* one instance of that disagreement.
|
|
52
|
+
*
|
|
53
|
+
* Editing the element directly does not solve the geometry problem; it
|
|
54
|
+
* deletes it. There is no second rectangle to keep in sync, so the text
|
|
55
|
+
* cannot move, resize or restyle when editing begins, the surrounding layout
|
|
56
|
+
* re-flows because the real element really did grow, and the
|
|
57
|
+
* transparent-if-and-only-if-reserved invariant is satisfied by construction
|
|
58
|
+
* rather than by a check. The sizing ghost this replaces is no longer needed
|
|
59
|
+
* for the same reason.
|
|
60
|
+
*
|
|
61
|
+
* ## Living with React
|
|
62
|
+
*
|
|
63
|
+
* The leaf's children are React's. `contentEditable` hands the same subtree
|
|
64
|
+
* to the browser, which will split, merge and delete those nodes as the
|
|
65
|
+
* author types — so the two owners have to be separated for the duration.
|
|
66
|
+
*
|
|
67
|
+
* The separation is the same one the layout ghost used, and it is the whole
|
|
68
|
+
* trick: the original child nodes are PARKED BY REFERENCE, not serialized.
|
|
69
|
+
* Editing happens on a fresh subtree; on dispose the parked nodes — the very
|
|
70
|
+
* same objects — go back under the very same parent. React's fibers still
|
|
71
|
+
* point at live nodes in their expected places, so a later update or unmount
|
|
72
|
+
* finds what it is looking for instead of throwing `NotFoundError` on a node
|
|
73
|
+
* that was replaced by an equal-looking copy.
|
|
74
|
+
*
|
|
75
|
+
* While the edit is open nothing writes to the store, so React has no reason
|
|
76
|
+
* to reconcile this subtree at all: `props.children` does not change, and a
|
|
77
|
+
* re-render for an unrelated reason (hover, selection) leaves an unchanged
|
|
78
|
+
* text child alone. The single `updateNodeProps` at commit is the only
|
|
79
|
+
* crossing, exactly as it is for the rest of this editor.
|
|
80
|
+
*
|
|
81
|
+
* `contentEditable` is set as a DOM property rather than through React, so a
|
|
82
|
+
* re-render cannot clear it: React only removes properties it set itself.
|
|
83
|
+
*/
|
|
84
|
+
export declare function beginInPlaceEdit(anchor: Element | undefined | null, build: (surface: HTMLElement) => void): InPlaceEditSurface | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* The `<aglyn-text>` holding THIS node's authored text, when it renders one.
|
|
87
|
+
*
|
|
88
|
+
* `beginInPlaceEdit` empties whatever element it is handed, so the choice of
|
|
89
|
+
* element decides how much of a component survives being edited. Handing it
|
|
90
|
+
* the node's ROOT is only harmless when the root is itself the text host —
|
|
91
|
+
* `Typography` renders `<p><aglyn-text>…</aglyn-text></p>` and losing the
|
|
92
|
+
* `<aglyn-text>` for the duration costs nothing.
|
|
93
|
+
*
|
|
94
|
+
* It is not harmless for a COMPOSITE. `Accordion Summary` renders a MUI
|
|
95
|
+
* `<button>` whose children are `.MuiAccordionSummary-content` and the
|
|
96
|
+
* chevron wrapper, and MUI puts `textAlign: 'start'` on that content div for
|
|
97
|
+
* one reason: the UA stylesheet centres text in a `<button>`, and the div is
|
|
98
|
+
* what cancels it. Wipe the button's children and the authored text lands
|
|
99
|
+
* directly in a `text-align: center` button — the label centres itself and
|
|
100
|
+
* the chevron disappears, both for as long as the edit is open (AGL-2556).
|
|
101
|
+
* `Button` and `Screen Link` have the same shape, one icon slot along.
|
|
102
|
+
*
|
|
103
|
+
* The `<aglyn-text>` is the authored text by construction — `Leaf` renders
|
|
104
|
+
* `<Component>{children}<AglynText>{textContent}</AglynText></Component>` —
|
|
105
|
+
* so editing it leaves every sibling the component built untouched, and the
|
|
106
|
+
* text stays in the box whose styling it was authored against.
|
|
107
|
+
*
|
|
108
|
+
* Scoped by the leaf stamp `Leaf` puts on every node root: a candidate whose
|
|
109
|
+
* nearest stamped ancestor is not `root` belongs to a CHILD node rendered
|
|
110
|
+
* into this one's slot, and editing that would write this node's commit onto
|
|
111
|
+
* someone else's text. An unstamped root (a test, a bare render) has no such
|
|
112
|
+
* ancestor and its first candidate stands.
|
|
113
|
+
*
|
|
114
|
+
* Returns undefined when there is none, and the caller falls back to the
|
|
115
|
+
* root — a component that renders its text without the leaf wrapper keeps
|
|
116
|
+
* exactly the behaviour it had.
|
|
117
|
+
*/
|
|
118
|
+
export declare function findLeafTextElement(root: Element | null | undefined): HTMLElement | undefined;
|
|
@@ -0,0 +1,164 @@
|
|
|
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
|
+
*/ /** Marks the element currently being edited in place, for tests and probes. */ export const IN_PLACE_EDITING_ATTR = 'data-aglyn-editing';
|
|
17
|
+
/**
|
|
18
|
+
* The caret, across a CLOSED shadow root.
|
|
19
|
+
*
|
|
20
|
+
* The canvas renders into `mode="closed"` (`viewport-frame.component.tsx`),
|
|
21
|
+
* so `document.getSelection()` cannot see a caret inside it — it retargets to
|
|
22
|
+
* the host, and `host.shadowRoot` is null from outside. What still works is
|
|
23
|
+
* that a node INSIDE the tree can always reach its own root:
|
|
24
|
+
* `Node.getRootNode()` returns the `ShadowRoot` whatever its mode, and Chrome
|
|
25
|
+
* implements `ShadowRoot.getSelection()`. So the caret is readable as long as
|
|
26
|
+
* you ask from an element that is already in there — which the edited leaf
|
|
27
|
+
* is.
|
|
28
|
+
*
|
|
29
|
+
* Falls back to the document selection for a light-DOM element and for
|
|
30
|
+
* engines without the non-standard accessor, so this is never the reason an
|
|
31
|
+
* edit fails.
|
|
32
|
+
*/ export function selectionOf(element) {
|
|
33
|
+
const root = element.getRootNode();
|
|
34
|
+
const scoped = root;
|
|
35
|
+
if (typeof scoped.getSelection === 'function') return scoped.getSelection();
|
|
36
|
+
if (typeof document !== 'undefined') return document.getSelection();
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Turns the canvas leaf ITSELF into the editing surface (AGL-2486).
|
|
41
|
+
*
|
|
42
|
+
* A boxed editing overlay is a rectangle; the thing it stands in for is a
|
|
43
|
+
* flow of line boxes, and those two geometries always end up disagreeing.
|
|
44
|
+
* Every bug in this area — the surface wrapping before the element does, the
|
|
45
|
+
* reserved space not growing, an inline run overflowing onto its sibling — is
|
|
46
|
+
* one instance of that disagreement.
|
|
47
|
+
*
|
|
48
|
+
* Editing the element directly does not solve the geometry problem; it
|
|
49
|
+
* deletes it. There is no second rectangle to keep in sync, so the text
|
|
50
|
+
* cannot move, resize or restyle when editing begins, the surrounding layout
|
|
51
|
+
* re-flows because the real element really did grow, and the
|
|
52
|
+
* transparent-if-and-only-if-reserved invariant is satisfied by construction
|
|
53
|
+
* rather than by a check. The sizing ghost this replaces is no longer needed
|
|
54
|
+
* for the same reason.
|
|
55
|
+
*
|
|
56
|
+
* ## Living with React
|
|
57
|
+
*
|
|
58
|
+
* The leaf's children are React's. `contentEditable` hands the same subtree
|
|
59
|
+
* to the browser, which will split, merge and delete those nodes as the
|
|
60
|
+
* author types — so the two owners have to be separated for the duration.
|
|
61
|
+
*
|
|
62
|
+
* The separation is the same one the layout ghost used, and it is the whole
|
|
63
|
+
* trick: the original child nodes are PARKED BY REFERENCE, not serialized.
|
|
64
|
+
* Editing happens on a fresh subtree; on dispose the parked nodes — the very
|
|
65
|
+
* same objects — go back under the very same parent. React's fibers still
|
|
66
|
+
* point at live nodes in their expected places, so a later update or unmount
|
|
67
|
+
* finds what it is looking for instead of throwing `NotFoundError` on a node
|
|
68
|
+
* that was replaced by an equal-looking copy.
|
|
69
|
+
*
|
|
70
|
+
* While the edit is open nothing writes to the store, so React has no reason
|
|
71
|
+
* to reconcile this subtree at all: `props.children` does not change, and a
|
|
72
|
+
* re-render for an unrelated reason (hover, selection) leaves an unchanged
|
|
73
|
+
* text child alone. The single `updateNodeProps` at commit is the only
|
|
74
|
+
* crossing, exactly as it is for the rest of this editor.
|
|
75
|
+
*
|
|
76
|
+
* `contentEditable` is set as a DOM property rather than through React, so a
|
|
77
|
+
* re-render cannot clear it: React only removes properties it set itself.
|
|
78
|
+
*/ export function beginInPlaceEdit(anchor, build) {
|
|
79
|
+
const element = anchor;
|
|
80
|
+
if (!element || typeof element.style !== 'object') return undefined;
|
|
81
|
+
if (!element.isConnected || !element.ownerDocument) return undefined;
|
|
82
|
+
// Same objects, kept alive off-tree — see "Living with React".
|
|
83
|
+
const parked = Array.from(element.childNodes);
|
|
84
|
+
const previousEditable = element.getAttribute('contenteditable');
|
|
85
|
+
while(element.firstChild)element.removeChild(element.firstChild);
|
|
86
|
+
try {
|
|
87
|
+
build(element);
|
|
88
|
+
} catch (unused) {
|
|
89
|
+
// A failed build must not leave the leaf empty on the canvas.
|
|
90
|
+
while(element.firstChild)element.removeChild(element.firstChild);
|
|
91
|
+
for (const child of parked)element.appendChild(child);
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
element.setAttribute(IN_PLACE_EDITING_ATTR, '');
|
|
95
|
+
// The ATTRIBUTE, not the property: the property is what a browser reflects
|
|
96
|
+
// from it, and setting it alone leaves nothing for a non-browser DOM (or a
|
|
97
|
+
// serializer, or a test) to see.
|
|
98
|
+
element.setAttribute('contenteditable', 'true');
|
|
99
|
+
element.spellcheck = true;
|
|
100
|
+
let disposed = false;
|
|
101
|
+
return {
|
|
102
|
+
element,
|
|
103
|
+
selection: ()=>selectionOf(element),
|
|
104
|
+
dispose () {
|
|
105
|
+
if (disposed) return;
|
|
106
|
+
disposed = true;
|
|
107
|
+
element.removeAttribute(IN_PLACE_EDITING_ATTR);
|
|
108
|
+
// `removeAttribute`, not `contentEditable = 'false'`: an explicit
|
|
109
|
+
// `false` would override an editable ancestor, which the element did
|
|
110
|
+
// not do before this edit.
|
|
111
|
+
if (previousEditable === null) {
|
|
112
|
+
element.removeAttribute('contenteditable');
|
|
113
|
+
} else {
|
|
114
|
+
element.setAttribute('contenteditable', previousEditable);
|
|
115
|
+
}
|
|
116
|
+
while(element.firstChild)element.removeChild(element.firstChild);
|
|
117
|
+
for (const child of parked)element.appendChild(child);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The `<aglyn-text>` holding THIS node's authored text, when it renders one.
|
|
123
|
+
*
|
|
124
|
+
* `beginInPlaceEdit` empties whatever element it is handed, so the choice of
|
|
125
|
+
* element decides how much of a component survives being edited. Handing it
|
|
126
|
+
* the node's ROOT is only harmless when the root is itself the text host —
|
|
127
|
+
* `Typography` renders `<p><aglyn-text>…</aglyn-text></p>` and losing the
|
|
128
|
+
* `<aglyn-text>` for the duration costs nothing.
|
|
129
|
+
*
|
|
130
|
+
* It is not harmless for a COMPOSITE. `Accordion Summary` renders a MUI
|
|
131
|
+
* `<button>` whose children are `.MuiAccordionSummary-content` and the
|
|
132
|
+
* chevron wrapper, and MUI puts `textAlign: 'start'` on that content div for
|
|
133
|
+
* one reason: the UA stylesheet centres text in a `<button>`, and the div is
|
|
134
|
+
* what cancels it. Wipe the button's children and the authored text lands
|
|
135
|
+
* directly in a `text-align: center` button — the label centres itself and
|
|
136
|
+
* the chevron disappears, both for as long as the edit is open (AGL-2556).
|
|
137
|
+
* `Button` and `Screen Link` have the same shape, one icon slot along.
|
|
138
|
+
*
|
|
139
|
+
* The `<aglyn-text>` is the authored text by construction — `Leaf` renders
|
|
140
|
+
* `<Component>{children}<AglynText>{textContent}</AglynText></Component>` —
|
|
141
|
+
* so editing it leaves every sibling the component built untouched, and the
|
|
142
|
+
* text stays in the box whose styling it was authored against.
|
|
143
|
+
*
|
|
144
|
+
* Scoped by the leaf stamp `Leaf` puts on every node root: a candidate whose
|
|
145
|
+
* nearest stamped ancestor is not `root` belongs to a CHILD node rendered
|
|
146
|
+
* into this one's slot, and editing that would write this node's commit onto
|
|
147
|
+
* someone else's text. An unstamped root (a test, a bare render) has no such
|
|
148
|
+
* ancestor and its first candidate stands.
|
|
149
|
+
*
|
|
150
|
+
* Returns undefined when there is none, and the caller falls back to the
|
|
151
|
+
* root — a component that renders its text without the leaf wrapper keeps
|
|
152
|
+
* exactly the behaviour it had.
|
|
153
|
+
*/ export function findLeafTextElement(root) {
|
|
154
|
+
if (!root || typeof root.querySelectorAll !== 'function') return undefined;
|
|
155
|
+
for (const candidate of Array.from(root.querySelectorAll('aglyn-text'))){
|
|
156
|
+
var _candidate_parentElement;
|
|
157
|
+
const owner = (_candidate_parentElement = candidate.parentElement) == null ? void 0 : _candidate_parentElement.closest('[data-aglyn^="leaf:"]');
|
|
158
|
+
if (owner && owner !== root) continue;
|
|
159
|
+
return candidate;
|
|
160
|
+
}
|
|
161
|
+
return undefined;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
//# sourceMappingURL=in-place-edit-surface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/utils/in-place-edit-surface.ts"],"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\n/** Marks the element currently being edited in place, for tests and probes. */\nexport const IN_PLACE_EDITING_ATTR = 'data-aglyn-editing'\n\nexport interface InPlaceEditSurface {\n /** The element the author is typing into — the canvas leaf itself. */\n readonly element: HTMLElement\n /** The selection root to ask for the caret; see {@link selectionOf}. */\n readonly selection: () => Selection | null\n /** Ends the edit and gives the element back to React, untouched. */\n dispose(): void\n}\n\n/**\n * The caret, across a CLOSED shadow root.\n *\n * The canvas renders into `mode=\"closed\"` (`viewport-frame.component.tsx`),\n * so `document.getSelection()` cannot see a caret inside it — it retargets to\n * the host, and `host.shadowRoot` is null from outside. What still works is\n * that a node INSIDE the tree can always reach its own root:\n * `Node.getRootNode()` returns the `ShadowRoot` whatever its mode, and Chrome\n * implements `ShadowRoot.getSelection()`. So the caret is readable as long as\n * you ask from an element that is already in there — which the edited leaf\n * is.\n *\n * Falls back to the document selection for a light-DOM element and for\n * engines without the non-standard accessor, so this is never the reason an\n * edit fails.\n */\nexport function selectionOf(element: Node): Selection | null {\n const root = element.getRootNode() as Document | ShadowRoot\n const scoped = root as { getSelection?: () => Selection | null }\n if (typeof scoped.getSelection === 'function') return scoped.getSelection()\n if (typeof document !== 'undefined') return document.getSelection()\n return null\n}\n\n/**\n * Turns the canvas leaf ITSELF into the editing surface (AGL-2486).\n *\n * A boxed editing overlay is a rectangle; the thing it stands in for is a\n * flow of line boxes, and those two geometries always end up disagreeing.\n * Every bug in this area — the surface wrapping before the element does, the\n * reserved space not growing, an inline run overflowing onto its sibling — is\n * one instance of that disagreement.\n *\n * Editing the element directly does not solve the geometry problem; it\n * deletes it. There is no second rectangle to keep in sync, so the text\n * cannot move, resize or restyle when editing begins, the surrounding layout\n * re-flows because the real element really did grow, and the\n * transparent-if-and-only-if-reserved invariant is satisfied by construction\n * rather than by a check. The sizing ghost this replaces is no longer needed\n * for the same reason.\n *\n * ## Living with React\n *\n * The leaf's children are React's. `contentEditable` hands the same subtree\n * to the browser, which will split, merge and delete those nodes as the\n * author types — so the two owners have to be separated for the duration.\n *\n * The separation is the same one the layout ghost used, and it is the whole\n * trick: the original child nodes are PARKED BY REFERENCE, not serialized.\n * Editing happens on a fresh subtree; on dispose the parked nodes — the very\n * same objects — go back under the very same parent. React's fibers still\n * point at live nodes in their expected places, so a later update or unmount\n * finds what it is looking for instead of throwing `NotFoundError` on a node\n * that was replaced by an equal-looking copy.\n *\n * While the edit is open nothing writes to the store, so React has no reason\n * to reconcile this subtree at all: `props.children` does not change, and a\n * re-render for an unrelated reason (hover, selection) leaves an unchanged\n * text child alone. The single `updateNodeProps` at commit is the only\n * crossing, exactly as it is for the rest of this editor.\n *\n * `contentEditable` is set as a DOM property rather than through React, so a\n * re-render cannot clear it: React only removes properties it set itself.\n */\nexport function beginInPlaceEdit(\n anchor: Element | undefined | null,\n build: (surface: HTMLElement) => void,\n): InPlaceEditSurface | undefined {\n const element = anchor as HTMLElement | null | undefined\n if (!element || typeof element.style !== 'object') return undefined\n if (!element.isConnected || !element.ownerDocument) return undefined\n\n // Same objects, kept alive off-tree — see \"Living with React\".\n const parked = Array.from(element.childNodes)\n const previousEditable = element.getAttribute('contenteditable')\n\n while (element.firstChild) element.removeChild(element.firstChild)\n try {\n build(element)\n } catch {\n // A failed build must not leave the leaf empty on the canvas.\n while (element.firstChild) element.removeChild(element.firstChild)\n for (const child of parked) element.appendChild(child)\n return undefined\n }\n\n element.setAttribute(IN_PLACE_EDITING_ATTR, '')\n // The ATTRIBUTE, not the property: the property is what a browser reflects\n // from it, and setting it alone leaves nothing for a non-browser DOM (or a\n // serializer, or a test) to see.\n element.setAttribute('contenteditable', 'true')\n element.spellcheck = true\n\n let disposed = false\n return {\n element,\n selection: () => selectionOf(element),\n dispose() {\n if (disposed) return\n disposed = true\n element.removeAttribute(IN_PLACE_EDITING_ATTR)\n // `removeAttribute`, not `contentEditable = 'false'`: an explicit\n // `false` would override an editable ancestor, which the element did\n // not do before this edit.\n if (previousEditable === null) {\n element.removeAttribute('contenteditable')\n } else {\n element.setAttribute('contenteditable', previousEditable)\n }\n while (element.firstChild) element.removeChild(element.firstChild)\n for (const child of parked) element.appendChild(child)\n },\n }\n}\n\n/**\n * The `<aglyn-text>` holding THIS node's authored text, when it renders one.\n *\n * `beginInPlaceEdit` empties whatever element it is handed, so the choice of\n * element decides how much of a component survives being edited. Handing it\n * the node's ROOT is only harmless when the root is itself the text host —\n * `Typography` renders `<p><aglyn-text>…</aglyn-text></p>` and losing the\n * `<aglyn-text>` for the duration costs nothing.\n *\n * It is not harmless for a COMPOSITE. `Accordion Summary` renders a MUI\n * `<button>` whose children are `.MuiAccordionSummary-content` and the\n * chevron wrapper, and MUI puts `textAlign: 'start'` on that content div for\n * one reason: the UA stylesheet centres text in a `<button>`, and the div is\n * what cancels it. Wipe the button's children and the authored text lands\n * directly in a `text-align: center` button — the label centres itself and\n * the chevron disappears, both for as long as the edit is open (AGL-2556).\n * `Button` and `Screen Link` have the same shape, one icon slot along.\n *\n * The `<aglyn-text>` is the authored text by construction — `Leaf` renders\n * `<Component>{children}<AglynText>{textContent}</AglynText></Component>` —\n * so editing it leaves every sibling the component built untouched, and the\n * text stays in the box whose styling it was authored against.\n *\n * Scoped by the leaf stamp `Leaf` puts on every node root: a candidate whose\n * nearest stamped ancestor is not `root` belongs to a CHILD node rendered\n * into this one's slot, and editing that would write this node's commit onto\n * someone else's text. An unstamped root (a test, a bare render) has no such\n * ancestor and its first candidate stands.\n *\n * Returns undefined when there is none, and the caller falls back to the\n * root — a component that renders its text without the leaf wrapper keeps\n * exactly the behaviour it had.\n */\nexport function findLeafTextElement(\n root: Element | null | undefined,\n): HTMLElement | undefined {\n if (!root || typeof root.querySelectorAll !== 'function') return undefined\n for (const candidate of Array.from(root.querySelectorAll('aglyn-text'))) {\n const owner = candidate.parentElement?.closest('[data-aglyn^=\"leaf:\"]')\n if (owner && owner !== root) continue\n return candidate as HTMLElement\n }\n return undefined\n}\n"],"names":["IN_PLACE_EDITING_ATTR","selectionOf","element","root","getRootNode","scoped","getSelection","document","beginInPlaceEdit","anchor","build","style","undefined","isConnected","ownerDocument","parked","Array","from","childNodes","previousEditable","getAttribute","firstChild","removeChild","child","appendChild","setAttribute","spellcheck","disposed","selection","dispose","removeAttribute","findLeafTextElement","querySelectorAll","candidate","owner","parentElement","closest"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,6EAA6E,GAC7E,OAAO,MAAMA,wBAAwB,qBAAoB;AAWzD;;;;;;;;;;;;;;;CAeC,GACD,OAAO,SAASC,YAAYC,OAAa;IACvC,MAAMC,OAAOD,QAAQE,WAAW;IAChC,MAAMC,SAASF;IACf,IAAI,OAAOE,OAAOC,YAAY,KAAK,YAAY,OAAOD,OAAOC,YAAY;IACzE,IAAI,OAAOC,aAAa,aAAa,OAAOA,SAASD,YAAY;IACjE,OAAO;AACT;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCC,GACD,OAAO,SAASE,iBACdC,MAAkC,EAClCC,KAAqC;IAErC,MAAMR,UAAUO;IAChB,IAAI,CAACP,WAAW,OAAOA,QAAQS,KAAK,KAAK,UAAU,OAAOC;IAC1D,IAAI,CAACV,QAAQW,WAAW,IAAI,CAACX,QAAQY,aAAa,EAAE,OAAOF;IAE3D,+DAA+D;IAC/D,MAAMG,SAASC,MAAMC,IAAI,CAACf,QAAQgB,UAAU;IAC5C,MAAMC,mBAAmBjB,QAAQkB,YAAY,CAAC;IAE9C,MAAOlB,QAAQmB,UAAU,CAAEnB,QAAQoB,WAAW,CAACpB,QAAQmB,UAAU;IACjE,IAAI;QACFX,MAAMR;IACR,EAAE,eAAM;QACN,8DAA8D;QAC9D,MAAOA,QAAQmB,UAAU,CAAEnB,QAAQoB,WAAW,CAACpB,QAAQmB,UAAU;QACjE,KAAK,MAAME,SAASR,OAAQb,QAAQsB,WAAW,CAACD;QAChD,OAAOX;IACT;IAEAV,QAAQuB,YAAY,CAACzB,uBAAuB;IAC5C,2EAA2E;IAC3E,2EAA2E;IAC3E,iCAAiC;IACjCE,QAAQuB,YAAY,CAAC,mBAAmB;IACxCvB,QAAQwB,UAAU,GAAG;IAErB,IAAIC,WAAW;IACf,OAAO;QACLzB;QACA0B,WAAW,IAAM3B,YAAYC;QAC7B2B;YACE,IAAIF,UAAU;YACdA,WAAW;YACXzB,QAAQ4B,eAAe,CAAC9B;YACxB,kEAAkE;YAClE,qEAAqE;YACrE,2BAA2B;YAC3B,IAAImB,qBAAqB,MAAM;gBAC7BjB,QAAQ4B,eAAe,CAAC;YAC1B,OAAO;gBACL5B,QAAQuB,YAAY,CAAC,mBAAmBN;YAC1C;YACA,MAAOjB,QAAQmB,UAAU,CAAEnB,QAAQoB,WAAW,CAACpB,QAAQmB,UAAU;YACjE,KAAK,MAAME,SAASR,OAAQb,QAAQsB,WAAW,CAACD;QAClD;IACF;AACF;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCC,GACD,OAAO,SAASQ,oBACd5B,IAAgC;IAEhC,IAAI,CAACA,QAAQ,OAAOA,KAAK6B,gBAAgB,KAAK,YAAY,OAAOpB;IACjE,KAAK,MAAMqB,aAAajB,MAAMC,IAAI,CAACd,KAAK6B,gBAAgB,CAAC,eAAgB;YACzDC;QAAd,MAAMC,SAAQD,2BAAAA,UAAUE,aAAa,qBAAvBF,yBAAyBG,OAAO,CAAC;QAC/C,IAAIF,SAASA,UAAU/B,MAAM;QAC7B,OAAO8B;IACT;IACA,OAAOrB;AACT"}
|
|
@@ -0,0 +1,71 @@
|
|
|
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 * as Aglyn from '@aglyn/aglyn';
|
|
18
|
+
export interface InlineMarkdownEditRect {
|
|
19
|
+
left: number;
|
|
20
|
+
top: number;
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The attribute a double-click edits in place, or `undefined` when the
|
|
26
|
+
* component declares none.
|
|
27
|
+
*
|
|
28
|
+
* The trigger is the component schema's OWN declaration — the same
|
|
29
|
+
* `FieldComponentType.MARKDOWN` that already makes the attributes panel render
|
|
30
|
+
* the WYSIWYG (AGL-1616) — not a component id and not a bespoke DOM attribute.
|
|
31
|
+
* The canvas exposes no per-leaf marker to hang one on, and a hardcoded
|
|
32
|
+
* `componentId === 'markdown'` would leave the next component that declares a
|
|
33
|
+
* document attribute (an email block, a plugin's own) editable in the panel and
|
|
34
|
+
* not on the canvas. One declaration, both surfaces.
|
|
35
|
+
*/
|
|
36
|
+
export declare function findMarkdownAttributeName(node: Aglyn.NodeSchema<any> | undefined): string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* State for the in-place canvas markdown editor (AGL-1624): which node is
|
|
39
|
+
* being edited, which of its attributes holds the document, the value the
|
|
40
|
+
* editor opened on, and where the element sits in viewport coordinates.
|
|
41
|
+
*
|
|
42
|
+
* Screen coordinates because the editor renders as a fixed overlay OUTSIDE the
|
|
43
|
+
* closed canvas shadow root — the same frame of reference `inlineTextEdit`
|
|
44
|
+
* uses, and the only one the two sides share.
|
|
45
|
+
*
|
|
46
|
+
* `anchor` is the element the rect was measured from, kept so the editor can
|
|
47
|
+
* re-measure instead of drifting when the canvas scrolls (AGL-1644). `rect` is
|
|
48
|
+
* still carried and still used: it is the value the first paint positions on,
|
|
49
|
+
* before any layout effect has run, and the fallback when there is no anchor.
|
|
50
|
+
*
|
|
51
|
+
* It is an `observable.ref` — a DOM node is a foreign object graph and mobx has
|
|
52
|
+
* no business walking into it.
|
|
53
|
+
*
|
|
54
|
+
* `initialValue` is captured at open and never re-read. The editor re-parses
|
|
55
|
+
* its row model whenever the incoming value differs from the string it last
|
|
56
|
+
* emitted, which resets the undo history and drops the caret; feeding the
|
|
57
|
+
* node's live props back in would do that on every commit, and again whenever
|
|
58
|
+
* a co-editing peer touched the same node.
|
|
59
|
+
*/
|
|
60
|
+
declare class InlineMarkdownEditStore {
|
|
61
|
+
node?: Aglyn.NodeSchema<any>;
|
|
62
|
+
rect?: InlineMarkdownEditRect;
|
|
63
|
+
anchor?: Element;
|
|
64
|
+
attributeName?: string;
|
|
65
|
+
initialValue: string;
|
|
66
|
+
constructor();
|
|
67
|
+
open(node: Aglyn.NodeSchema<any>, rect: InlineMarkdownEditRect, attributeName: string, initialValue: string, anchor?: Element): void;
|
|
68
|
+
close(): void;
|
|
69
|
+
}
|
|
70
|
+
export declare const inlineMarkdownEdit: InlineMarkdownEditStore;
|
|
71
|
+
export default inlineMarkdownEdit;
|
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
*/ import { FieldComponentType } from "@aglyn/aglyn";
|
|
17
|
+
import { makeAutoObservable, observable } from "mobx";
|
|
18
|
+
/**
|
|
19
|
+
* The attribute a double-click edits in place, or `undefined` when the
|
|
20
|
+
* component declares none.
|
|
21
|
+
*
|
|
22
|
+
* The trigger is the component schema's OWN declaration — the same
|
|
23
|
+
* `FieldComponentType.MARKDOWN` that already makes the attributes panel render
|
|
24
|
+
* the WYSIWYG (AGL-1616) — not a component id and not a bespoke DOM attribute.
|
|
25
|
+
* The canvas exposes no per-leaf marker to hang one on, and a hardcoded
|
|
26
|
+
* `componentId === 'markdown'` would leave the next component that declares a
|
|
27
|
+
* document attribute (an email block, a plugin's own) editable in the panel and
|
|
28
|
+
* not on the canvas. One declaration, both surfaces.
|
|
29
|
+
*/ export function findMarkdownAttributeName(node) {
|
|
30
|
+
var _ref;
|
|
31
|
+
var _node_componentSchema;
|
|
32
|
+
for (const attribute of (_ref = node == null ? void 0 : (_node_componentSchema = node.componentSchema) == null ? void 0 : _node_componentSchema.attributes) != null ? _ref : []){
|
|
33
|
+
if ((attribute == null ? void 0 : attribute.component) === FieldComponentType.MARKDOWN) {
|
|
34
|
+
return attribute.name;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* State for the in-place canvas markdown editor (AGL-1624): which node is
|
|
41
|
+
* being edited, which of its attributes holds the document, the value the
|
|
42
|
+
* editor opened on, and where the element sits in viewport coordinates.
|
|
43
|
+
*
|
|
44
|
+
* Screen coordinates because the editor renders as a fixed overlay OUTSIDE the
|
|
45
|
+
* closed canvas shadow root — the same frame of reference `inlineTextEdit`
|
|
46
|
+
* uses, and the only one the two sides share.
|
|
47
|
+
*
|
|
48
|
+
* `anchor` is the element the rect was measured from, kept so the editor can
|
|
49
|
+
* re-measure instead of drifting when the canvas scrolls (AGL-1644). `rect` is
|
|
50
|
+
* still carried and still used: it is the value the first paint positions on,
|
|
51
|
+
* before any layout effect has run, and the fallback when there is no anchor.
|
|
52
|
+
*
|
|
53
|
+
* It is an `observable.ref` — a DOM node is a foreign object graph and mobx has
|
|
54
|
+
* no business walking into it.
|
|
55
|
+
*
|
|
56
|
+
* `initialValue` is captured at open and never re-read. The editor re-parses
|
|
57
|
+
* its row model whenever the incoming value differs from the string it last
|
|
58
|
+
* emitted, which resets the undo history and drops the caret; feeding the
|
|
59
|
+
* node's live props back in would do that on every commit, and again whenever
|
|
60
|
+
* a co-editing peer touched the same node.
|
|
61
|
+
*/ let InlineMarkdownEditStore = class InlineMarkdownEditStore {
|
|
62
|
+
open(node, rect, attributeName, initialValue, anchor) {
|
|
63
|
+
this.node = node;
|
|
64
|
+
this.rect = rect;
|
|
65
|
+
this.anchor = anchor;
|
|
66
|
+
this.attributeName = attributeName;
|
|
67
|
+
this.initialValue = initialValue;
|
|
68
|
+
}
|
|
69
|
+
close() {
|
|
70
|
+
this.node = undefined;
|
|
71
|
+
this.rect = undefined;
|
|
72
|
+
this.anchor = undefined;
|
|
73
|
+
this.attributeName = undefined;
|
|
74
|
+
this.initialValue = '';
|
|
75
|
+
}
|
|
76
|
+
constructor(){
|
|
77
|
+
this.node = undefined;
|
|
78
|
+
this.rect = undefined;
|
|
79
|
+
this.anchor = undefined;
|
|
80
|
+
this.attributeName = undefined;
|
|
81
|
+
this.initialValue = '';
|
|
82
|
+
makeAutoObservable(this, {
|
|
83
|
+
anchor: observable.ref
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
export const inlineMarkdownEdit = new InlineMarkdownEditStore();
|
|
88
|
+
export default inlineMarkdownEdit;
|
|
89
|
+
|
|
90
|
+
//# sourceMappingURL=inline-markdown-edit.store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/utils/inline-markdown-edit.store.ts"],"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 type * as Aglyn from '@aglyn/aglyn'\nimport { FieldComponentType } from '@aglyn/aglyn'\nimport { makeAutoObservable, observable } from 'mobx'\n\nexport interface InlineMarkdownEditRect {\n left: number\n top: number\n width: number\n height: number\n}\n\n/**\n * The attribute a double-click edits in place, or `undefined` when the\n * component declares none.\n *\n * The trigger is the component schema's OWN declaration — the same\n * `FieldComponentType.MARKDOWN` that already makes the attributes panel render\n * the WYSIWYG (AGL-1616) — not a component id and not a bespoke DOM attribute.\n * The canvas exposes no per-leaf marker to hang one on, and a hardcoded\n * `componentId === 'markdown'` would leave the next component that declares a\n * document attribute (an email block, a plugin's own) editable in the panel and\n * not on the canvas. One declaration, both surfaces.\n */\nexport function findMarkdownAttributeName(\n node: Aglyn.NodeSchema<any> | undefined,\n): string | undefined {\n for (const attribute of node?.componentSchema?.attributes ?? []) {\n if (attribute?.component === FieldComponentType.MARKDOWN) {\n return attribute.name\n }\n }\n return undefined\n}\n\n/**\n * State for the in-place canvas markdown editor (AGL-1624): which node is\n * being edited, which of its attributes holds the document, the value the\n * editor opened on, and where the element sits in viewport coordinates.\n *\n * Screen coordinates because the editor renders as a fixed overlay OUTSIDE the\n * closed canvas shadow root — the same frame of reference `inlineTextEdit`\n * uses, and the only one the two sides share.\n *\n * `anchor` is the element the rect was measured from, kept so the editor can\n * re-measure instead of drifting when the canvas scrolls (AGL-1644). `rect` is\n * still carried and still used: it is the value the first paint positions on,\n * before any layout effect has run, and the fallback when there is no anchor.\n *\n * It is an `observable.ref` — a DOM node is a foreign object graph and mobx has\n * no business walking into it.\n *\n * `initialValue` is captured at open and never re-read. The editor re-parses\n * its row model whenever the incoming value differs from the string it last\n * emitted, which resets the undo history and drops the caret; feeding the\n * node's live props back in would do that on every commit, and again whenever\n * a co-editing peer touched the same node.\n */\nclass InlineMarkdownEditStore {\n node?: Aglyn.NodeSchema<any> = undefined\n rect?: InlineMarkdownEditRect = undefined\n anchor?: Element = undefined\n attributeName?: string = undefined\n initialValue = ''\n\n constructor() {\n makeAutoObservable(this, { anchor: observable.ref })\n }\n\n open(\n node: Aglyn.NodeSchema<any>,\n rect: InlineMarkdownEditRect,\n attributeName: string,\n initialValue: string,\n anchor?: Element,\n ) {\n this.node = node\n this.rect = rect\n this.anchor = anchor\n this.attributeName = attributeName\n this.initialValue = initialValue\n }\n\n close() {\n this.node = undefined\n this.rect = undefined\n this.anchor = undefined\n this.attributeName = undefined\n this.initialValue = ''\n }\n}\n\nexport const inlineMarkdownEdit = new InlineMarkdownEditStore()\nexport default inlineMarkdownEdit\n"],"names":["FieldComponentType","makeAutoObservable","observable","findMarkdownAttributeName","node","attribute","componentSchema","attributes","component","MARKDOWN","name","undefined","InlineMarkdownEditStore","open","rect","attributeName","initialValue","anchor","close","ref","inlineMarkdownEdit"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAGD,SAASA,kBAAkB,QAAQ,eAAc;AACjD,SAASC,kBAAkB,EAAEC,UAAU,QAAQ,OAAM;AASrD;;;;;;;;;;;CAWC,GACD,OAAO,SAASC,0BACdC,IAAuC;;QAEfA;IAAxB,KAAK,MAAMC,qBAAaD,yBAAAA,wBAAAA,KAAME,eAAe,qBAArBF,sBAAuBG,UAAU,mBAAI,EAAE,CAAE;QAC/D,IAAIF,CAAAA,6BAAAA,UAAWG,SAAS,MAAKR,mBAAmBS,QAAQ,EAAE;YACxD,OAAOJ,UAAUK,IAAI;QACvB;IACF;IACA,OAAOC;AACT;AAEA;;;;;;;;;;;;;;;;;;;;;;CAsBC,GACD,IAAA,AAAMC,0BAAN,MAAMA;IAWJC,KACET,IAA2B,EAC3BU,IAA4B,EAC5BC,aAAqB,EACrBC,YAAoB,EACpBC,MAAgB,EAChB;QACA,IAAI,CAACb,IAAI,GAAGA;QACZ,IAAI,CAACU,IAAI,GAAGA;QACZ,IAAI,CAACG,MAAM,GAAGA;QACd,IAAI,CAACF,aAAa,GAAGA;QACrB,IAAI,CAACC,YAAY,GAAGA;IACtB;IAEAE,QAAQ;QACN,IAAI,CAACd,IAAI,GAAGO;QACZ,IAAI,CAACG,IAAI,GAAGH;QACZ,IAAI,CAACM,MAAM,GAAGN;QACd,IAAI,CAACI,aAAa,GAAGJ;QACrB,IAAI,CAACK,YAAY,GAAG;IACtB;IAxBA,aAAc;aANdZ,OAA+BO;aAC/BG,OAAgCH;aAChCM,SAAmBN;aACnBI,gBAAyBJ;aACzBK,eAAe;QAGbf,mBAAmB,IAAI,EAAE;YAAEgB,QAAQf,WAAWiB,GAAG;QAAC;IACpD;AAuBF;AAEA,OAAO,MAAMC,qBAAqB,IAAIR,0BAAyB;AAC/D,eAAeQ,mBAAkB"}
|