@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,173 @@
|
|
|
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
|
+
*/ // The one escaper (AGL-2706). The local `escapeAttribute` this replaces
|
|
17
|
+
// omitted `'`, which single-quoted attributes delimit just as double quotes
|
|
18
|
+
// do — the omission was survivable only because every value here lands in a
|
|
19
|
+
// double-quoted slot, and a rule that holds by where its callers happen to
|
|
20
|
+
// put it is the kind that stops holding quietly. `escapeText` below stays
|
|
21
|
+
// local: it is the TEXT half, and a text node has no quote to break.
|
|
22
|
+
import { escapeHtml } from "@aglyn/shared-util-tools/escape-html";
|
|
23
|
+
/** Tags the inline rich-text editor may persist (AGL-54). */ const ALLOWED_TAGS = new Set([
|
|
24
|
+
'b',
|
|
25
|
+
'strong',
|
|
26
|
+
'i',
|
|
27
|
+
'em',
|
|
28
|
+
'u',
|
|
29
|
+
'a',
|
|
30
|
+
'ul',
|
|
31
|
+
'ol',
|
|
32
|
+
'li',
|
|
33
|
+
'br',
|
|
34
|
+
'p',
|
|
35
|
+
'div',
|
|
36
|
+
'span'
|
|
37
|
+
]);
|
|
38
|
+
/**
|
|
39
|
+
* The subset a PHRASING-ONLY surface may persist (AGL-2557) — the label of a
|
|
40
|
+
* Button, a Screen Link or an Accordion Summary, which ships inside a
|
|
41
|
+
* `<button>` or an `<a>`.
|
|
42
|
+
*
|
|
43
|
+
* Neither element may contain a block or a second control. A `<div>` here is
|
|
44
|
+
* not merely untidy: the parser closes the control on that start tag and
|
|
45
|
+
* promotes the rest to a sibling, which reaches the browser as a React
|
|
46
|
+
* hydration mismatch on the published page. The renderer enforces the same
|
|
47
|
+
* narrowing on the way out (`INLINE_AUTHOR_HTML_ELEMENTS`); this end of the
|
|
48
|
+
* round trip means what is STORED is what will be drawn, so the Attributes
|
|
49
|
+
* panel and the plain-text fallback describe the same element as the canvas.
|
|
50
|
+
*
|
|
51
|
+
* `br` stays: it is phrasing content, and Shift+Enter is the one line break
|
|
52
|
+
* these surfaces still offer.
|
|
53
|
+
*/ const PHRASING_TAGS = new Set([
|
|
54
|
+
'b',
|
|
55
|
+
'strong',
|
|
56
|
+
'i',
|
|
57
|
+
'em',
|
|
58
|
+
'u',
|
|
59
|
+
'br',
|
|
60
|
+
'span'
|
|
61
|
+
]);
|
|
62
|
+
const SAFE_HREF = /^(https?:\/\/|mailto:|tel:|\/)/i;
|
|
63
|
+
/**
|
|
64
|
+
* Allowlist HTML sanitizer for inline rich text: keeps basic formatting
|
|
65
|
+
* tags, strips every attribute except a safe `href` on links (which gains
|
|
66
|
+
* `rel="noopener noreferrer"`), and unwraps disallowed elements to their
|
|
67
|
+
* text content (so nothing script-capable survives). Runs at commit time in
|
|
68
|
+
* the editor (browser DOM available).
|
|
69
|
+
*
|
|
70
|
+
* `options.phrasingOnly` narrows the allowlist for a surface that ships
|
|
71
|
+
* inside a control (AGL-2557); omitted, every existing caller is unchanged.
|
|
72
|
+
*/ export function sanitizeRichText(html, options) {
|
|
73
|
+
if (typeof document === 'undefined') return '';
|
|
74
|
+
const allowed = (options == null ? void 0 : options.phrasingOnly) ? PHRASING_TAGS : ALLOWED_TAGS;
|
|
75
|
+
const template = document.createElement('template');
|
|
76
|
+
template.innerHTML = html;
|
|
77
|
+
const sanitizeNode = (node)=>{
|
|
78
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
79
|
+
var _node_textContent;
|
|
80
|
+
return escapeText((_node_textContent = node.textContent) != null ? _node_textContent : '');
|
|
81
|
+
}
|
|
82
|
+
if (node.nodeType !== Node.ELEMENT_NODE) return '';
|
|
83
|
+
const element = node;
|
|
84
|
+
const tag = element.tagName.toLowerCase();
|
|
85
|
+
const inner = Array.from(element.childNodes).map(sanitizeNode).join('');
|
|
86
|
+
if (!allowed.has(tag)) return inner;
|
|
87
|
+
// A bare `span` is INERT and is unwrapped (AGL-2486). Every attribute is
|
|
88
|
+
// stripped here, so a surviving `<span>` carries no styling, no class and
|
|
89
|
+
// no binding — it renders exactly as its own text. Keeping it would be
|
|
90
|
+
// dead weight with a cost: `html` is what marks a node as "formatted", so
|
|
91
|
+
// an inert wrapper left behind by a contentEditable merge would pin the
|
|
92
|
+
// Attributes Text field read-only forever over markup that does nothing.
|
|
93
|
+
// Measured on test-org: deleting the line break out of
|
|
94
|
+
// `About <div>us</div>` left Chrome with `About<span>us</span>`.
|
|
95
|
+
if (tag === 'span') return inner;
|
|
96
|
+
if (tag === 'br') return '<br>';
|
|
97
|
+
if (tag === 'a') {
|
|
98
|
+
var _element_getAttribute;
|
|
99
|
+
const href = (_element_getAttribute = element.getAttribute('href')) != null ? _element_getAttribute : '';
|
|
100
|
+
if (!SAFE_HREF.test(href)) return inner;
|
|
101
|
+
return `<a href="${escapeHtml(href)}" rel="noopener noreferrer">${inner}</a>`;
|
|
102
|
+
}
|
|
103
|
+
return `<${tag}>${inner}</${tag}>`;
|
|
104
|
+
};
|
|
105
|
+
return Array.from(template.content.childNodes).map(sanitizeNode).join('');
|
|
106
|
+
}
|
|
107
|
+
function escapeText(text) {
|
|
108
|
+
return text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Tags that end the line they are on. `br` is the explicit one; the rest are
|
|
112
|
+
* the block-level members of {@link ALLOWED_TAGS}, which a contentEditable
|
|
113
|
+
* produces on its own — pressing Enter in the rich surface forks the DOM
|
|
114
|
+
* into `div`s, and that fork IS the author's line break.
|
|
115
|
+
*/ const LINE_BREAKING_TAGS = new Set([
|
|
116
|
+
'BR',
|
|
117
|
+
'DIV',
|
|
118
|
+
'P',
|
|
119
|
+
'LI',
|
|
120
|
+
'UL',
|
|
121
|
+
'OL'
|
|
122
|
+
]);
|
|
123
|
+
/**
|
|
124
|
+
* Plain-text projection of markup, for the `children` fallback prop.
|
|
125
|
+
*
|
|
126
|
+
* Line breaks SURVIVE (AGL-2486). A node that carries one stores
|
|
127
|
+
* `html: "Your entire web <div>presence. </div>"` beside
|
|
128
|
+
* `children: "Your entire web presence. "`. The canvas renders `html` and
|
|
129
|
+
* shows two lines; the Attributes panel renders `children`. Projected with
|
|
130
|
+
* `template.content.textContent` the panel shows one, because `textContent`
|
|
131
|
+
* concatenates across every element boundary — a `<div>` fork and a `<br>`
|
|
132
|
+
* both vanish into nothing.
|
|
133
|
+
*
|
|
134
|
+
* That is a real break silently dropped by the projection, not the soft wrap
|
|
135
|
+
* a bounding box misreports. `children` is not a display detail either: it is
|
|
136
|
+
* what every
|
|
137
|
+
* plain renderer, the SSR fallback and the panel field all read, so the
|
|
138
|
+
* break was being lost to all three.
|
|
139
|
+
*
|
|
140
|
+
* Only the trailing newline is trimmed — a block element closes at the end
|
|
141
|
+
* of the string and that boundary separates nothing.
|
|
142
|
+
*/ export function richTextToPlain(html) {
|
|
143
|
+
if (typeof document === 'undefined') return html;
|
|
144
|
+
const template = document.createElement('template');
|
|
145
|
+
template.innerHTML = html;
|
|
146
|
+
const parts = [];
|
|
147
|
+
const endsOpen = ()=>parts.length > 0 && !parts[parts.length - 1].endsWith('\n');
|
|
148
|
+
const walk = (parent)=>{
|
|
149
|
+
for (const child of Array.from(parent.childNodes)){
|
|
150
|
+
if (child.nodeType === 3 /* TEXT_NODE */ ) {
|
|
151
|
+
var _child_nodeValue;
|
|
152
|
+
parts.push((_child_nodeValue = child.nodeValue) != null ? _child_nodeValue : '');
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
if (child.nodeType !== 1 /* ELEMENT_NODE */ ) continue;
|
|
156
|
+
const element = child;
|
|
157
|
+
if (element.tagName === 'BR') {
|
|
158
|
+
parts.push('\n');
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
const breaks = LINE_BREAKING_TAGS.has(element.tagName);
|
|
162
|
+
// A block that FOLLOWS content starts its own line; one that opens the
|
|
163
|
+
// string, or already sits after a break, does not add an empty one.
|
|
164
|
+
if (breaks && endsOpen()) parts.push('\n');
|
|
165
|
+
walk(element);
|
|
166
|
+
if (breaks && endsOpen()) parts.push('\n');
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
walk(template.content);
|
|
170
|
+
return parts.join('').replace(/\n+$/, '');
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
//# sourceMappingURL=sanitize-rich-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/utils/sanitize-rich-text.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// The one escaper (AGL-2706). The local `escapeAttribute` this replaces\n// omitted `'`, which single-quoted attributes delimit just as double quotes\n// do — the omission was survivable only because every value here lands in a\n// double-quoted slot, and a rule that holds by where its callers happen to\n// put it is the kind that stops holding quietly. `escapeText` below stays\n// local: it is the TEXT half, and a text node has no quote to break.\nimport { escapeHtml } from '@aglyn/shared-util-tools/escape-html'\n\n/** Tags the inline rich-text editor may persist (AGL-54). */\nconst ALLOWED_TAGS = new Set([\n 'b',\n 'strong',\n 'i',\n 'em',\n 'u',\n 'a',\n 'ul',\n 'ol',\n 'li',\n 'br',\n 'p',\n 'div',\n 'span',\n])\n\n/**\n * The subset a PHRASING-ONLY surface may persist (AGL-2557) — the label of a\n * Button, a Screen Link or an Accordion Summary, which ships inside a\n * `<button>` or an `<a>`.\n *\n * Neither element may contain a block or a second control. A `<div>` here is\n * not merely untidy: the parser closes the control on that start tag and\n * promotes the rest to a sibling, which reaches the browser as a React\n * hydration mismatch on the published page. The renderer enforces the same\n * narrowing on the way out (`INLINE_AUTHOR_HTML_ELEMENTS`); this end of the\n * round trip means what is STORED is what will be drawn, so the Attributes\n * panel and the plain-text fallback describe the same element as the canvas.\n *\n * `br` stays: it is phrasing content, and Shift+Enter is the one line break\n * these surfaces still offer.\n */\nconst PHRASING_TAGS = new Set(['b', 'strong', 'i', 'em', 'u', 'br', 'span'])\n\n/** How much markup one commit may keep — see {@link PHRASING_TAGS}. */\nexport interface SanitizeRichTextOptions {\n phrasingOnly?: boolean\n}\n\nconst SAFE_HREF = /^(https?:\\/\\/|mailto:|tel:|\\/)/i\n\n/**\n * Allowlist HTML sanitizer for inline rich text: keeps basic formatting\n * tags, strips every attribute except a safe `href` on links (which gains\n * `rel=\"noopener noreferrer\"`), and unwraps disallowed elements to their\n * text content (so nothing script-capable survives). Runs at commit time in\n * the editor (browser DOM available).\n *\n * `options.phrasingOnly` narrows the allowlist for a surface that ships\n * inside a control (AGL-2557); omitted, every existing caller is unchanged.\n */\nexport function sanitizeRichText(\n html: string,\n options?: SanitizeRichTextOptions,\n): string {\n if (typeof document === 'undefined') return ''\n const allowed = options?.phrasingOnly ? PHRASING_TAGS : ALLOWED_TAGS\n const template = document.createElement('template')\n template.innerHTML = html\n\n const sanitizeNode = (node: Node): string => {\n if (node.nodeType === Node.TEXT_NODE) {\n return escapeText(node.textContent ?? '')\n }\n if (node.nodeType !== Node.ELEMENT_NODE) return ''\n const element = node as Element\n const tag = element.tagName.toLowerCase()\n const inner = Array.from(element.childNodes).map(sanitizeNode).join('')\n if (!allowed.has(tag)) return inner\n // A bare `span` is INERT and is unwrapped (AGL-2486). Every attribute is\n // stripped here, so a surviving `<span>` carries no styling, no class and\n // no binding — it renders exactly as its own text. Keeping it would be\n // dead weight with a cost: `html` is what marks a node as \"formatted\", so\n // an inert wrapper left behind by a contentEditable merge would pin the\n // Attributes Text field read-only forever over markup that does nothing.\n // Measured on test-org: deleting the line break out of\n // `About <div>us</div>` left Chrome with `About<span>us</span>`.\n if (tag === 'span') return inner\n if (tag === 'br') return '<br>'\n if (tag === 'a') {\n const href = element.getAttribute('href') ?? ''\n if (!SAFE_HREF.test(href)) return inner\n return `<a href=\"${escapeHtml(href)}\" rel=\"noopener noreferrer\">${inner}</a>`\n }\n return `<${tag}>${inner}</${tag}>`\n }\n\n return Array.from(template.content.childNodes).map(sanitizeNode).join('')\n}\n\nfunction escapeText(text: string): string {\n return text\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n}\n\n/**\n * Tags that end the line they are on. `br` is the explicit one; the rest are\n * the block-level members of {@link ALLOWED_TAGS}, which a contentEditable\n * produces on its own — pressing Enter in the rich surface forks the DOM\n * into `div`s, and that fork IS the author's line break.\n */\nconst LINE_BREAKING_TAGS = new Set(['BR', 'DIV', 'P', 'LI', 'UL', 'OL'])\n\n/**\n * Plain-text projection of markup, for the `children` fallback prop.\n *\n * Line breaks SURVIVE (AGL-2486). A node that carries one stores\n * `html: \"Your entire web <div>presence. </div>\"` beside\n * `children: \"Your entire web presence. \"`. The canvas renders `html` and\n * shows two lines; the Attributes panel renders `children`. Projected with\n * `template.content.textContent` the panel shows one, because `textContent`\n * concatenates across every element boundary — a `<div>` fork and a `<br>`\n * both vanish into nothing.\n *\n * That is a real break silently dropped by the projection, not the soft wrap\n * a bounding box misreports. `children` is not a display detail either: it is\n * what every\n * plain renderer, the SSR fallback and the panel field all read, so the\n * break was being lost to all three.\n *\n * Only the trailing newline is trimmed — a block element closes at the end\n * of the string and that boundary separates nothing.\n */\nexport function richTextToPlain(html: string): string {\n if (typeof document === 'undefined') return html\n const template = document.createElement('template')\n template.innerHTML = html\n const parts: string[] = []\n const endsOpen = () =>\n parts.length > 0 && !parts[parts.length - 1]!.endsWith('\\n')\n\n const walk = (parent: Node): void => {\n for (const child of Array.from(parent.childNodes)) {\n if (child.nodeType === 3 /* TEXT_NODE */) {\n parts.push(child.nodeValue ?? '')\n continue\n }\n if (child.nodeType !== 1 /* ELEMENT_NODE */) continue\n const element = child as Element\n if (element.tagName === 'BR') {\n parts.push('\\n')\n continue\n }\n const breaks = LINE_BREAKING_TAGS.has(element.tagName)\n // A block that FOLLOWS content starts its own line; one that opens the\n // string, or already sits after a break, does not add an empty one.\n if (breaks && endsOpen()) parts.push('\\n')\n walk(element)\n if (breaks && endsOpen()) parts.push('\\n')\n }\n }\n\n walk(template.content)\n return parts.join('').replace(/\\n+$/, '')\n}\n"],"names":["escapeHtml","ALLOWED_TAGS","Set","PHRASING_TAGS","SAFE_HREF","sanitizeRichText","html","options","document","allowed","phrasingOnly","template","createElement","innerHTML","sanitizeNode","node","nodeType","Node","TEXT_NODE","escapeText","textContent","ELEMENT_NODE","element","tag","tagName","toLowerCase","inner","Array","from","childNodes","map","join","has","href","getAttribute","test","content","text","replace","LINE_BREAKING_TAGS","richTextToPlain","parts","endsOpen","length","endsWith","walk","parent","child","push","nodeValue","breaks"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,wEAAwE;AACxE,4EAA4E;AAC5E,4EAA4E;AAC5E,2EAA2E;AAC3E,0EAA0E;AAC1E,qEAAqE;AACrE,SAASA,UAAU,QAAQ,uCAAsC;AAEjE,2DAA2D,GAC3D,MAAMC,eAAe,IAAIC,IAAI;IAC3B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED;;;;;;;;;;;;;;;CAeC,GACD,MAAMC,gBAAgB,IAAID,IAAI;IAAC;IAAK;IAAU;IAAK;IAAM;IAAK;IAAM;CAAO;AAO3E,MAAME,YAAY;AAElB;;;;;;;;;CASC,GACD,OAAO,SAASC,iBACdC,IAAY,EACZC,OAAiC;IAEjC,IAAI,OAAOC,aAAa,aAAa,OAAO;IAC5C,MAAMC,UAAUF,CAAAA,2BAAAA,QAASG,YAAY,IAAGP,gBAAgBF;IACxD,MAAMU,WAAWH,SAASI,aAAa,CAAC;IACxCD,SAASE,SAAS,GAAGP;IAErB,MAAMQ,eAAe,CAACC;QACpB,IAAIA,KAAKC,QAAQ,KAAKC,KAAKC,SAAS,EAAE;gBAClBH;YAAlB,OAAOI,YAAWJ,oBAAAA,KAAKK,WAAW,YAAhBL,oBAAoB;QACxC;QACA,IAAIA,KAAKC,QAAQ,KAAKC,KAAKI,YAAY,EAAE,OAAO;QAChD,MAAMC,UAAUP;QAChB,MAAMQ,MAAMD,QAAQE,OAAO,CAACC,WAAW;QACvC,MAAMC,QAAQC,MAAMC,IAAI,CAACN,QAAQO,UAAU,EAAEC,GAAG,CAAChB,cAAciB,IAAI,CAAC;QACpE,IAAI,CAACtB,QAAQuB,GAAG,CAACT,MAAM,OAAOG;QAC9B,yEAAyE;QACzE,0EAA0E;QAC1E,uEAAuE;QACvE,0EAA0E;QAC1E,wEAAwE;QACxE,yEAAyE;QACzE,uDAAuD;QACvD,iEAAiE;QACjE,IAAIH,QAAQ,QAAQ,OAAOG;QAC3B,IAAIH,QAAQ,MAAM,OAAO;QACzB,IAAIA,QAAQ,KAAK;gBACFD;YAAb,MAAMW,QAAOX,wBAAAA,QAAQY,YAAY,CAAC,mBAArBZ,wBAAgC;YAC7C,IAAI,CAAClB,UAAU+B,IAAI,CAACF,OAAO,OAAOP;YAClC,OAAO,CAAC,SAAS,EAAE1B,WAAWiC,MAAM,4BAA4B,EAAEP,MAAM,IAAI,CAAC;QAC/E;QACA,OAAO,CAAC,CAAC,EAAEH,IAAI,CAAC,EAAEG,MAAM,EAAE,EAAEH,IAAI,CAAC,CAAC;IACpC;IAEA,OAAOI,MAAMC,IAAI,CAACjB,SAASyB,OAAO,CAACP,UAAU,EAAEC,GAAG,CAAChB,cAAciB,IAAI,CAAC;AACxE;AAEA,SAASZ,WAAWkB,IAAY;IAC9B,OAAOA,KACJC,OAAO,CAAC,MAAM,SACdA,OAAO,CAAC,MAAM,QACdA,OAAO,CAAC,MAAM;AACnB;AAEA;;;;;CAKC,GACD,MAAMC,qBAAqB,IAAIrC,IAAI;IAAC;IAAM;IAAO;IAAK;IAAM;IAAM;CAAK;AAEvE;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,SAASsC,gBAAgBlC,IAAY;IAC1C,IAAI,OAAOE,aAAa,aAAa,OAAOF;IAC5C,MAAMK,WAAWH,SAASI,aAAa,CAAC;IACxCD,SAASE,SAAS,GAAGP;IACrB,MAAMmC,QAAkB,EAAE;IAC1B,MAAMC,WAAW,IACfD,MAAME,MAAM,GAAG,KAAK,CAACF,KAAK,CAACA,MAAME,MAAM,GAAG,EAAE,CAAEC,QAAQ,CAAC;IAEzD,MAAMC,OAAO,CAACC;QACZ,KAAK,MAAMC,SAASpB,MAAMC,IAAI,CAACkB,OAAOjB,UAAU,EAAG;YACjD,IAAIkB,MAAM/B,QAAQ,KAAK,EAAE,aAAa,KAAI;oBAC7B+B;gBAAXN,MAAMO,IAAI,EAACD,mBAAAA,MAAME,SAAS,YAAfF,mBAAmB;gBAC9B;YACF;YACA,IAAIA,MAAM/B,QAAQ,KAAK,EAAE,gBAAgB,KAAI;YAC7C,MAAMM,UAAUyB;YAChB,IAAIzB,QAAQE,OAAO,KAAK,MAAM;gBAC5BiB,MAAMO,IAAI,CAAC;gBACX;YACF;YACA,MAAME,SAASX,mBAAmBP,GAAG,CAACV,QAAQE,OAAO;YACrD,uEAAuE;YACvE,oEAAoE;YACpE,IAAI0B,UAAUR,YAAYD,MAAMO,IAAI,CAAC;YACrCH,KAAKvB;YACL,IAAI4B,UAAUR,YAAYD,MAAMO,IAAI,CAAC;QACvC;IACF;IAEAH,KAAKlC,SAASyB,OAAO;IACrB,OAAOK,MAAMV,IAAI,CAAC,IAAIO,OAAO,CAAC,QAAQ;AACxC"}
|
|
@@ -0,0 +1,255 @@
|
|
|
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 { BesignerStateFlag } from '@aglyn/besigner';
|
|
18
|
+
/**
|
|
19
|
+
* Interaction-state style slices for the Styles panel (AGL-2486 item 39).
|
|
20
|
+
*
|
|
21
|
+
* Hover, focus and active states are reachable in the document already — the
|
|
22
|
+
* JSS tab's own caption advertises nested selectors — but only by typing raw
|
|
23
|
+
* sx, which most of this panel's audience cannot do. These slices are the
|
|
24
|
+
* picker for the same capability.
|
|
25
|
+
*
|
|
26
|
+
* ## What is stored is the REAL selector
|
|
27
|
+
*
|
|
28
|
+
* A state slice is `node.sx['&:hover']`, not a reserved `@state hover` key.
|
|
29
|
+
* That choice is what makes this feature need NO renderer change at all:
|
|
30
|
+
* MUI's `styleFunctionSx` hands an unrecognised object key straight back to
|
|
31
|
+
* itself (`wrapper.sx = value; css[styleKey] = styleFunctionSx(wrapper)`), so
|
|
32
|
+
* the slice gets the full sx treatment — palette tokens, system-prop aliases
|
|
33
|
+
* (`bgcolor`), and responsive breakpoint objects — identically on the canvas,
|
|
34
|
+
* in Preview and on the published page. A reserved key would have needed a
|
|
35
|
+
* substitution pass on every render path, and the recorded reason the scheme
|
|
36
|
+
* slices work is that there is exactly ONE such path.
|
|
37
|
+
*
|
|
38
|
+
* It also means the panel and the JSS tab are editing the same thing rather
|
|
39
|
+
* than two representations of it, and that an author who already hand-wrote
|
|
40
|
+
* `&:hover` finds the panel showing it.
|
|
41
|
+
*
|
|
42
|
+
* ## Nesting order: state OUTER, scheme INNER, breakpoints innermost
|
|
43
|
+
*
|
|
44
|
+
* ```ts
|
|
45
|
+
* { '&:hover': { '@scheme dark': { color: { xs: '#eee', md: '#fff' } } } }
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* Not a new invariant — `scheme-rendering.spec.tsx` already proves
|
|
49
|
+
* `resolveSchemeSx` resolves exactly this shape, because it recurses into
|
|
50
|
+
* nested selector objects. The REVERSE order would be a bug: `mergeSchemeValue`
|
|
51
|
+
* replaces a nested object wholesale, so a `@scheme dark` slice containing
|
|
52
|
+
* `&:hover` would clobber the light hover block rather than merge with it.
|
|
53
|
+
*
|
|
54
|
+
* ## The scrub is not bypassed
|
|
55
|
+
*
|
|
56
|
+
* `sanitizeAuthorSx` walks nested records with no key filtering, and
|
|
57
|
+
* `leaf-author-css.spec.tsx` already asserts that a `url(http://…)` inside an
|
|
58
|
+
* `&:hover` slice is rewritten to `about:invalid`. Author CSS in a state slice
|
|
59
|
+
* goes through the same scrub as author CSS anywhere else.
|
|
60
|
+
*/
|
|
61
|
+
/**
|
|
62
|
+
* The interaction states the panel offers, in the order the chip row shows
|
|
63
|
+
* them.
|
|
64
|
+
*
|
|
65
|
+
* ## Why plain `:focus` is deliberately absent — do not "fix" this
|
|
66
|
+
*
|
|
67
|
+
* `:focus` matches on mouse and touch focus as well as keyboard focus, so the
|
|
68
|
+
* overwhelmingly common thing an author does with a `:focus` control is remove
|
|
69
|
+
* the ring they consider ugly on click — and that removes it for keyboard
|
|
70
|
+
* users too, who have no other way to tell where they are on the page. Adding
|
|
71
|
+
* the field would mean shipping a purpose-built UI for an accessibility
|
|
72
|
+
* regression, on a product whose authors are explicitly not expected to know
|
|
73
|
+
* CSS.
|
|
74
|
+
*
|
|
75
|
+
* `:focus-visible` is the same capability without that failure mode: the
|
|
76
|
+
* browser only matches it when it judges a focus indicator should be shown
|
|
77
|
+
* (keyboard and programmatic focus, not a mouse click), so styling it can
|
|
78
|
+
* essentially only ADD an indicator. That covers the legitimate reason to
|
|
79
|
+
* style focus — making the ring match the brand — while making the harmful
|
|
80
|
+
* one much harder to reach by accident.
|
|
81
|
+
*
|
|
82
|
+
* An author with a genuine `:focus` need still has the JSS (sx) tab, which
|
|
83
|
+
* accepts any selector. That friction is the point: it is reachable by someone
|
|
84
|
+
* who knows what they are doing and not by someone clicking through a panel.
|
|
85
|
+
*/
|
|
86
|
+
export declare const SX_STATES: readonly BesignerStateFlag[];
|
|
87
|
+
/**
|
|
88
|
+
* Alias of the canvas flag union, which is declared in `@aglyn/besigner` so
|
|
89
|
+
* the flag store that HOLDS the state and the panel that WRITES the slice
|
|
90
|
+
* cannot drift apart.
|
|
91
|
+
*/
|
|
92
|
+
export type SxState = BesignerStateFlag;
|
|
93
|
+
/** The CSS selector each state is stored under in `node.sx`. */
|
|
94
|
+
export declare const SX_STATE_SELECTORS: Readonly<Record<SxState, string>>;
|
|
95
|
+
/**
|
|
96
|
+
* Chip labels. **Keep them short — this row must never wrap.**
|
|
97
|
+
*
|
|
98
|
+
* These shipped once as "Focus (keyboard)", to stop a bare "Focus" implying
|
|
99
|
+
* that the mouse-click ring is what you are styling. The reasoning was right
|
|
100
|
+
* and the label was wrong: measured against the styles panel, the five chips
|
|
101
|
+
* needed **368px** of the **359px** a default 375px panel has, so `Disabled`
|
|
102
|
+
*
|
|
103
|
+
* Short labels bring the row to 272px, which fits every panel width down to
|
|
104
|
+
* about 290px, and {@link SX_STATE_LABEL_MAX} pins them so the next person to
|
|
105
|
+
* reach for a clarifying parenthetical gets a failing test instead of a
|
|
106
|
+
* wrapped row.
|
|
107
|
+
*
|
|
108
|
+
* The keyboard nuance did not get dropped, it moved somewhere better than a
|
|
109
|
+
* label: {@link SX_STATE_DESCRIPTIONS} carries the full rule in the chip
|
|
110
|
+
* tooltip, and {@link SX_STATE_PROSE} puts "keyboard focus" in the preview
|
|
111
|
+
* banner — which appears the moment Focus is selected, so it is READ rather
|
|
112
|
+
* than hovered for. That is the same job the long label was doing, done where
|
|
113
|
+
* there is room for it.
|
|
114
|
+
*/
|
|
115
|
+
export declare const SX_STATE_LABELS: Readonly<Record<SxState, string>>;
|
|
116
|
+
/**
|
|
117
|
+
* The longest a chip label may be before the row stops fitting a narrow
|
|
118
|
+
* panel. `Disabled` is 8 and is the longest today; the budget is measured,
|
|
119
|
+
* not guessed — see {@link SX_STATE_LABELS}.
|
|
120
|
+
*/
|
|
121
|
+
export declare const SX_STATE_LABEL_MAX = 8;
|
|
122
|
+
/** The same states in running prose — banners, the override chips. */
|
|
123
|
+
export declare const SX_STATE_PROSE: Readonly<Record<SxState, string>>;
|
|
124
|
+
/**
|
|
125
|
+
* What each state means, in the panel's voice — shown as the chip tooltip so
|
|
126
|
+
* an author can tell `Active` (held down) from `Focus` (keyboard) without
|
|
127
|
+
* knowing the selectors.
|
|
128
|
+
*/
|
|
129
|
+
export declare const SX_STATE_DESCRIPTIONS: Readonly<Record<SxState, string>>;
|
|
130
|
+
/** Whether an sx key is one of the state selectors this module owns. */
|
|
131
|
+
export declare function isSxStateSelector(key: string): boolean;
|
|
132
|
+
/**
|
|
133
|
+
* The state a stored selector belongs to, or null when the key is not one of
|
|
134
|
+
* ours. Lets a surface that lists RAW sx keys — the instance-override chips —
|
|
135
|
+
* name a slice the way the chip row does instead of printing `&:hover` at an
|
|
136
|
+
* author who never typed it.
|
|
137
|
+
*/
|
|
138
|
+
export declare function sxStateForSelector(key: string): SxState | null;
|
|
139
|
+
/** The override-chip label for a raw sx key, or null to fall through. */
|
|
140
|
+
export declare function sxStateSliceLabel(key: string): string | null;
|
|
141
|
+
/**
|
|
142
|
+
* The stored slice for a state, or undefined when the element has none.
|
|
143
|
+
*
|
|
144
|
+
* `state: null` is the base scope and returns the record itself, so callers
|
|
145
|
+
* can pass the panel's active scope through without branching.
|
|
146
|
+
*/
|
|
147
|
+
export declare function readStateSlice(sx: Record<string, any> | undefined, state: SxState | null): Record<string, any> | undefined;
|
|
148
|
+
/**
|
|
149
|
+
* What the element actually LOOKS like in a state: the base styles with the
|
|
150
|
+
* state slice merged over them, which is what the browser paints because a
|
|
151
|
+
* `:hover` block only overrides the properties it names.
|
|
152
|
+
*
|
|
153
|
+
* This is what the panel reads from, so a field the author has not overridden
|
|
154
|
+
* for hover shows the inherited base value rather than empty — the same
|
|
155
|
+
* reading the breakpoint scope gives, and the reason the write seam can skip
|
|
156
|
+
* a value that would not change anything.
|
|
157
|
+
*
|
|
158
|
+
* `mergeNodeSx` is the house merge: responsive objects cascade mobile-first,
|
|
159
|
+
* `@scheme dark` and nested selector blocks merge key by key. Reusing it keeps
|
|
160
|
+
* the panel's reading identical to the graft's.
|
|
161
|
+
*
|
|
162
|
+
* Returns the input BY IDENTITY at base scope or when no slice exists, which
|
|
163
|
+
* is every element that has never been given a state style.
|
|
164
|
+
*/
|
|
165
|
+
/**
|
|
166
|
+
* The element's base styles with every state selector removed — the baseline a
|
|
167
|
+
* state slice is a difference FROM. Returned by identity when the element
|
|
168
|
+
* carries no state slices at all, which is every element today.
|
|
169
|
+
*/
|
|
170
|
+
export declare function stripStateSlices(sx: Record<string, any> | undefined): Record<string, any> | undefined;
|
|
171
|
+
export declare function stateScopedSx(sx: Record<string, any> | undefined, state: SxState | null): Record<string, any> | undefined;
|
|
172
|
+
/**
|
|
173
|
+
* Replaces one state's slice, removing it entirely when it comes back empty.
|
|
174
|
+
*
|
|
175
|
+
* An emptied slice is DELETED rather than stored as `{}` — the same rule
|
|
176
|
+
* `writeSxValue` applies to an emptied scheme slice and `getNodeStyleTarget`
|
|
177
|
+
* applies to an emptied instance override. A `{}` left behind would make
|
|
178
|
+
* "does this element have a hover style" answer yes forever, which the chip's
|
|
179
|
+
* own dot indicator and the override badge both read.
|
|
180
|
+
*
|
|
181
|
+
* Returns a new record; the input is never mutated.
|
|
182
|
+
*/
|
|
183
|
+
export declare function writeStateSlice(sx: Record<string, any> | undefined, state: SxState, slice: Record<string, any> | undefined): Record<string, any>;
|
|
184
|
+
/**
|
|
185
|
+
* The slice implied by an edited state-scope reading (AGL-2486).
|
|
186
|
+
*
|
|
187
|
+
* The panel edits the MERGED record — base with the slice over it, which is
|
|
188
|
+
* what the element actually looks like in that state — so the write has to be
|
|
189
|
+
* split back out: only what genuinely differs from the base belongs in the
|
|
190
|
+
* slice. That split is what gives the three behaviours the panel needs, all
|
|
191
|
+
* from one rule:
|
|
192
|
+
*
|
|
193
|
+
* - a property the author changed for this state lands in the slice;
|
|
194
|
+
* - a property the author set back to the base value LEAVES the slice, because
|
|
195
|
+
* a `:hover` block that restates the base paints nothing and would show as a
|
|
196
|
+
* permanent override in the chip's dot;
|
|
197
|
+
* - a property the author cleared leaves the slice too, so the state falls
|
|
198
|
+
* back to inheriting the base — which is the only thing a pseudo-class block
|
|
199
|
+
* can express, since CSS has no way to un-declare a property.
|
|
200
|
+
*
|
|
201
|
+
* `base` must already have the state selectors stripped (which
|
|
202
|
+
* {@link stateScopedSx} does), or a sibling state's block would read as a
|
|
203
|
+
* difference and be copied in.
|
|
204
|
+
*/
|
|
205
|
+
export declare function deriveStateSlice(base: Record<string, any> | undefined, edited: Record<string, any> | undefined): Record<string, any>;
|
|
206
|
+
/** Whether the element carries any styles for this state. */
|
|
207
|
+
export declare function sxHasStateSlice(sx: Record<string, any> | undefined, state: SxState): boolean;
|
|
208
|
+
/** Every state the element currently carries a slice for, in chip order. */
|
|
209
|
+
export declare function sxStatesWithSlices(sx: Record<string, any> | undefined): SxState[];
|
|
210
|
+
/**
|
|
211
|
+
* The advisory to show under the state chips, or null when the state makes
|
|
212
|
+
* plain sense on this element (AGL-2486 item 39).
|
|
213
|
+
*
|
|
214
|
+
* States are deliberately NOT constrained by element type. A hover effect on a
|
|
215
|
+
* Box or Section wrapping a link is among the commonest real designs, and
|
|
216
|
+
* refusing it would block more good work than it prevents mistakes. But
|
|
217
|
+
* `:focus-visible` on something with no tab stop and `:disabled` on something
|
|
218
|
+
* that cannot be disabled will simply never fire, and an author who styles one
|
|
219
|
+
* and sees nothing has no way to find out why. So: allow it, and say so.
|
|
220
|
+
*/
|
|
221
|
+
export declare function stateAdvisory(state: SxState | null, element: {
|
|
222
|
+
componentId?: string;
|
|
223
|
+
hasHref?: boolean;
|
|
224
|
+
hasTabIndex?: boolean;
|
|
225
|
+
}): string | null;
|
|
226
|
+
/**
|
|
227
|
+
* CANVAS ONLY: renders an element as if it were in the given state, by
|
|
228
|
+
* hoisting that state's slice over the base declarations (AGL-2486 item 39).
|
|
229
|
+
*
|
|
230
|
+
* You cannot hover an element while working in a side panel, so a state whose
|
|
231
|
+
* styles you cannot see is a state you cannot design. This is what holds the
|
|
232
|
+
* state on — and it is deliberately NOT a toggle that can be left on and
|
|
233
|
+
* published by mistake: selecting the state in the panel's chip row IS the
|
|
234
|
+
* hold, so you cannot be editing the hover slice and not see hover, and
|
|
235
|
+
* returning to `Default` ends it. It lives in editor UI state and never enters
|
|
236
|
+
* the document, so Preview and the published page cannot receive it.
|
|
237
|
+
*
|
|
238
|
+
* Applied through `LeafSxTransformContext` — the SAME canvas-only seam the
|
|
239
|
+
* artboard device-width transform already uses, at the one point in `Leaf`
|
|
240
|
+
* where the merged sx reaches the element. There is still exactly one
|
|
241
|
+
* substitution path, and the tenant never mounts the provider.
|
|
242
|
+
*
|
|
243
|
+
* Runs on the fully merged sx AFTER scheme resolution, so a slice that carried
|
|
244
|
+
* `@scheme dark` has already collapsed to the active scheme's values by the
|
|
245
|
+
* time it is hoisted. `mergeSchemeValue` does the per-value merge so a
|
|
246
|
+
* responsive override keeps the base's other breakpoints.
|
|
247
|
+
*
|
|
248
|
+
* The hoisted selector is removed, so what renders is exactly the state's
|
|
249
|
+
* appearance rather than the state's appearance plus a live `:hover` that
|
|
250
|
+
* would repaint the same declarations. Sibling states are left untouched.
|
|
251
|
+
*
|
|
252
|
+
* Returns the input BY IDENTITY when there is nothing to hoist.
|
|
253
|
+
*/
|
|
254
|
+
export declare function hoistStateSx<T>(sx: T, state: SxState | null): T;
|
|
255
|
+
export default SX_STATES;
|