@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,136 @@
|
|
|
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
|
+
* Best-match ranking for the element picker (AGL-2486).
|
|
18
|
+
*
|
|
19
|
+
* The picker searched a pile of fields with no ranking at all, so typing
|
|
20
|
+
* `icon` returned nearly the whole catalogue with the element actually
|
|
21
|
+
* CALLED `Icon` near the bottom — every component whose description merely
|
|
22
|
+
* mentions an icon scored the same as the one named after it.
|
|
23
|
+
*
|
|
24
|
+
* This does not narrow the search: the caller still hands over whatever the
|
|
25
|
+
* fuzzy pass found across every field. It only decides the ORDER, and the
|
|
26
|
+
* rule it enforces is that a hit on the name always outranks a hit in prose.
|
|
27
|
+
*/ /** The fields that carry the element's NAME, best first. */ const NAME_KEYS = [
|
|
28
|
+
'displayName',
|
|
29
|
+
'label',
|
|
30
|
+
'title'
|
|
31
|
+
];
|
|
32
|
+
/**
|
|
33
|
+
* Everything else worth searching. A hit here can never outrank a name hit,
|
|
34
|
+
* which is the whole point — but it still has to COUNT, or the picker would
|
|
35
|
+
* stop finding "the one with the video in it" by typing `video`.
|
|
36
|
+
*/ const OTHER_KEYS = [
|
|
37
|
+
'description',
|
|
38
|
+
'subtitle',
|
|
39
|
+
'category',
|
|
40
|
+
'tags',
|
|
41
|
+
'keywords',
|
|
42
|
+
'kind',
|
|
43
|
+
'pluginId',
|
|
44
|
+
'$id'
|
|
45
|
+
];
|
|
46
|
+
/**
|
|
47
|
+
* Match quality, best first. Lower sorts earlier.
|
|
48
|
+
*
|
|
49
|
+
* `FUZZY_ONLY` is the floor: the caller's fuzzy pass matched it but no field
|
|
50
|
+
* literally contains the term (a typo, a transposition). Those keep their
|
|
51
|
+
* incoming order and sit behind every literal hit.
|
|
52
|
+
*/ export const PICKER_RANK = {
|
|
53
|
+
EXACT_NAME: 0,
|
|
54
|
+
NAME_PREFIX: 1,
|
|
55
|
+
NAME_WORD_PREFIX: 2,
|
|
56
|
+
NAME_SUBSTRING: 3,
|
|
57
|
+
OTHER_FIELD: 4,
|
|
58
|
+
FUZZY_ONLY: 5
|
|
59
|
+
};
|
|
60
|
+
/** Searchable text of one field: arrays (tags) join, everything else stringifies. */ function fieldText(value) {
|
|
61
|
+
if (typeof value === 'string') return value.toLowerCase();
|
|
62
|
+
if (Array.isArray(value)) {
|
|
63
|
+
return value.filter((i)=>typeof i === 'string').join(' ').toLowerCase();
|
|
64
|
+
}
|
|
65
|
+
return '';
|
|
66
|
+
}
|
|
67
|
+
function namesOf(item) {
|
|
68
|
+
const record = item != null ? item : {};
|
|
69
|
+
return NAME_KEYS.map((key)=>fieldText(record[key])).filter(Boolean);
|
|
70
|
+
}
|
|
71
|
+
function otherTextOf(item) {
|
|
72
|
+
const record = item != null ? item : {};
|
|
73
|
+
return OTHER_KEYS.map((key)=>fieldText(record[key])).filter(Boolean).join(' ');
|
|
74
|
+
}
|
|
75
|
+
/** Whether `term` starts a word inside `text` ("Icon button" for `but`). */ function hasWordPrefix(text, term) {
|
|
76
|
+
let from = text.indexOf(term);
|
|
77
|
+
while(from !== -1){
|
|
78
|
+
const before = from === 0 ? '' : text[from - 1];
|
|
79
|
+
if (!before || !/[a-z0-9]/.test(before)) return true;
|
|
80
|
+
from = text.indexOf(term, from + 1);
|
|
81
|
+
}
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
function rankOfTerm(item, term) {
|
|
85
|
+
const names = namesOf(item);
|
|
86
|
+
if (names.some((name)=>name === term)) return PICKER_RANK.EXACT_NAME;
|
|
87
|
+
if (names.some((name)=>name.startsWith(term))) return PICKER_RANK.NAME_PREFIX;
|
|
88
|
+
if (names.some((name)=>hasWordPrefix(name, term))) {
|
|
89
|
+
return PICKER_RANK.NAME_WORD_PREFIX;
|
|
90
|
+
}
|
|
91
|
+
if (names.some((name)=>name.includes(term))) return PICKER_RANK.NAME_SUBSTRING;
|
|
92
|
+
if (otherTextOf(item).includes(term)) return PICKER_RANK.OTHER_FIELD;
|
|
93
|
+
return PICKER_RANK.FUZZY_ONLY;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* How well `item` matches `query`.
|
|
97
|
+
*
|
|
98
|
+
* A multi-word query is scored by its WEAKEST term: "icon button" must not
|
|
99
|
+
* be reported as an exact name match on the strength of `icon` alone.
|
|
100
|
+
*/ export function rankPickerItem(item, query) {
|
|
101
|
+
const terms = String(query != null ? query : '').toLowerCase().split(/\s+/).filter(Boolean);
|
|
102
|
+
if (!terms.length) return PICKER_RANK.FUZZY_ONLY;
|
|
103
|
+
// Per-term, the WEAKEST term decides.
|
|
104
|
+
let byTerm = PICKER_RANK.EXACT_NAME;
|
|
105
|
+
for (const term of terms){
|
|
106
|
+
const termRank = rankOfTerm(item, term);
|
|
107
|
+
if (termRank > byTerm) byTerm = termRank;
|
|
108
|
+
}
|
|
109
|
+
// The whole query as one phrase can only ever help: `icon button` should
|
|
110
|
+
// read as an exact name match against an element called "Icon button",
|
|
111
|
+
// which per-term scoring alone would grade as a mid-word hit on `button`.
|
|
112
|
+
const byPhrase = terms.length > 1 ? rankOfTerm(item, terms.join(' ')) : byTerm;
|
|
113
|
+
return byPhrase < byTerm ? byPhrase : byTerm;
|
|
114
|
+
}
|
|
115
|
+
/** Shortest name, then alphabetical — a stable order inside a rank. */ function tieBreak(a, b) {
|
|
116
|
+
var _namesOf_, _namesOf_1;
|
|
117
|
+
const nameA = (_namesOf_ = namesOf(a)[0]) != null ? _namesOf_ : '';
|
|
118
|
+
const nameB = (_namesOf_1 = namesOf(b)[0]) != null ? _namesOf_1 : '';
|
|
119
|
+
return nameA.length - nameB.length || nameA.localeCompare(nameB);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* `items` reordered best-match first. Nothing is dropped — the caller has
|
|
123
|
+
* already decided what matches.
|
|
124
|
+
*/ export function rankPickerItems(items, query) {
|
|
125
|
+
if (!query || !Array.isArray(items)) return items != null ? items : [];
|
|
126
|
+
return items.map((item, index)=>({
|
|
127
|
+
item,
|
|
128
|
+
index,
|
|
129
|
+
rank: rankPickerItem(item, query)
|
|
130
|
+
})).sort((a, b)=>a.rank - b.rank || tieBreak(a.item, b.item) || // Incoming order last, so a fuzzy-only tail keeps the fuzzy
|
|
131
|
+
// matcher's own idea of which typo was closest.
|
|
132
|
+
a.index - b.index).map((i)=>i.item);
|
|
133
|
+
}
|
|
134
|
+
export default rankPickerItems;
|
|
135
|
+
|
|
136
|
+
//# sourceMappingURL=rank-picker-results.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/utils/rank-picker-results.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 * Best-match ranking for the element picker (AGL-2486).\n *\n * The picker searched a pile of fields with no ranking at all, so typing\n * `icon` returned nearly the whole catalogue with the element actually\n * CALLED `Icon` near the bottom — every component whose description merely\n * mentions an icon scored the same as the one named after it.\n *\n * This does not narrow the search: the caller still hands over whatever the\n * fuzzy pass found across every field. It only decides the ORDER, and the\n * rule it enforces is that a hit on the name always outranks a hit in prose.\n */\n\n/** The fields that carry the element's NAME, best first. */\nconst NAME_KEYS = ['displayName', 'label', 'title'] as const\n\n/**\n * Everything else worth searching. A hit here can never outrank a name hit,\n * which is the whole point — but it still has to COUNT, or the picker would\n * stop finding \"the one with the video in it\" by typing `video`.\n */\nconst OTHER_KEYS = [\n 'description',\n 'subtitle',\n 'category',\n 'tags',\n 'keywords',\n 'kind',\n 'pluginId',\n '$id',\n] as const\n\n/**\n * Match quality, best first. Lower sorts earlier.\n *\n * `FUZZY_ONLY` is the floor: the caller's fuzzy pass matched it but no field\n * literally contains the term (a typo, a transposition). Those keep their\n * incoming order and sit behind every literal hit.\n */\nexport const PICKER_RANK = {\n EXACT_NAME: 0,\n NAME_PREFIX: 1,\n NAME_WORD_PREFIX: 2,\n NAME_SUBSTRING: 3,\n OTHER_FIELD: 4,\n FUZZY_ONLY: 5,\n} as const\n\nexport type PickerRank = (typeof PICKER_RANK)[keyof typeof PICKER_RANK]\n\n/** Searchable text of one field: arrays (tags) join, everything else stringifies. */\nfunction fieldText(value: unknown): string {\n if (typeof value === 'string') return value.toLowerCase()\n if (Array.isArray(value)) {\n return value.filter((i) => typeof i === 'string').join(' ').toLowerCase()\n }\n return ''\n}\n\nfunction namesOf(item: unknown): string[] {\n const record = (item ?? {}) as Record<string, unknown>\n return NAME_KEYS.map((key) => fieldText(record[key])).filter(Boolean)\n}\n\nfunction otherTextOf(item: unknown): string {\n const record = (item ?? {}) as Record<string, unknown>\n return OTHER_KEYS.map((key) => fieldText(record[key]))\n .filter(Boolean)\n .join(' ')\n}\n\n/** Whether `term` starts a word inside `text` (\"Icon button\" for `but`). */\nfunction hasWordPrefix(text: string, term: string): boolean {\n let from = text.indexOf(term)\n while (from !== -1) {\n const before = from === 0 ? '' : text[from - 1]\n if (!before || !/[a-z0-9]/.test(before)) return true\n from = text.indexOf(term, from + 1)\n }\n return false\n}\n\nfunction rankOfTerm(item: unknown, term: string): PickerRank {\n const names = namesOf(item)\n if (names.some((name) => name === term)) return PICKER_RANK.EXACT_NAME\n if (names.some((name) => name.startsWith(term))) return PICKER_RANK.NAME_PREFIX\n if (names.some((name) => hasWordPrefix(name, term))) {\n return PICKER_RANK.NAME_WORD_PREFIX\n }\n if (names.some((name) => name.includes(term))) return PICKER_RANK.NAME_SUBSTRING\n if (otherTextOf(item).includes(term)) return PICKER_RANK.OTHER_FIELD\n return PICKER_RANK.FUZZY_ONLY\n}\n\n/**\n * How well `item` matches `query`.\n *\n * A multi-word query is scored by its WEAKEST term: \"icon button\" must not\n * be reported as an exact name match on the strength of `icon` alone.\n */\nexport function rankPickerItem(item: unknown, query: string): PickerRank {\n const terms = String(query ?? '')\n .toLowerCase()\n .split(/\\s+/)\n .filter(Boolean)\n if (!terms.length) return PICKER_RANK.FUZZY_ONLY\n // Per-term, the WEAKEST term decides.\n let byTerm: PickerRank = PICKER_RANK.EXACT_NAME\n for (const term of terms) {\n const termRank = rankOfTerm(item, term)\n if (termRank > byTerm) byTerm = termRank\n }\n // The whole query as one phrase can only ever help: `icon button` should\n // read as an exact name match against an element called \"Icon button\",\n // which per-term scoring alone would grade as a mid-word hit on `button`.\n const byPhrase = terms.length > 1 ? rankOfTerm(item, terms.join(' ')) : byTerm\n return byPhrase < byTerm ? byPhrase : byTerm\n}\n\n/** Shortest name, then alphabetical — a stable order inside a rank. */\nfunction tieBreak(a: unknown, b: unknown): number {\n const nameA = namesOf(a)[0] ?? ''\n const nameB = namesOf(b)[0] ?? ''\n return nameA.length - nameB.length || nameA.localeCompare(nameB)\n}\n\n/**\n * `items` reordered best-match first. Nothing is dropped — the caller has\n * already decided what matches.\n */\nexport function rankPickerItems<T>(items: T[], query: string): T[] {\n if (!query || !Array.isArray(items)) return items ?? []\n return items\n .map((item, index) => ({ item, index, rank: rankPickerItem(item, query) }))\n .sort(\n (a, b) =>\n a.rank - b.rank ||\n tieBreak(a.item, b.item) ||\n // Incoming order last, so a fuzzy-only tail keeps the fuzzy\n // matcher's own idea of which typo was closest.\n a.index - b.index,\n )\n .map((i) => i.item)\n}\n\nexport default rankPickerItems\n"],"names":["NAME_KEYS","OTHER_KEYS","PICKER_RANK","EXACT_NAME","NAME_PREFIX","NAME_WORD_PREFIX","NAME_SUBSTRING","OTHER_FIELD","FUZZY_ONLY","fieldText","value","toLowerCase","Array","isArray","filter","i","join","namesOf","item","record","map","key","Boolean","otherTextOf","hasWordPrefix","text","term","from","indexOf","before","test","rankOfTerm","names","some","name","startsWith","includes","rankPickerItem","query","terms","String","split","length","byTerm","termRank","byPhrase","tieBreak","a","b","nameA","nameB","localeCompare","rankPickerItems","items","index","rank","sort"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;CAWC,GAED,0DAA0D,GAC1D,MAAMA,YAAY;IAAC;IAAe;IAAS;CAAQ;AAEnD;;;;CAIC,GACD,MAAMC,aAAa;IACjB;IACA;IACA;I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AACD;AAC5D;AAEA;;;CAGC,GACD,OAAO,SAASE,gBAAmBC,KAAU,EAAEf,KAAa;IAC1D,IAAI,CAACA,SAAS,CAAC1B,MAAMC,OAAO,CAACwC,QAAQ,OAAOA,gBAAAA,QAAS,EAAE;IACvD,OAAOA,MACJjC,GAAG,CAAC,CAACF,MAAMoC,QAAW,CAAA;YAAEpC;YAAMoC;YAAOC,MAAMlB,eAAenB,MAAMoB;QAAO,CAAA,GACvEkB,IAAI,CACH,CAACT,GAAGC,IACFD,EAAEQ,IAAI,GAAGP,EAAEO,IAAI,IACfT,SAASC,EAAE7B,IAAI,EAAE8B,EAAE9B,IAAI,KACvB,4DAA4D;QAC5D,gDAAgD;QAChD6B,EAAEO,KAAK,GAAGN,EAAEM,KAAK,EAEpBlC,GAAG,CAAC,CAACL,IAAMA,EAAEG,IAAI;AACtB;AAEA,eAAekC,gBAAe"}
|
|
@@ -0,0 +1,65 @@
|
|
|
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 SxScheme } from '@aglyn/aglyn-node-renderer';
|
|
18
|
+
import { BesignerDeviceFlag } from '@aglyn/besigner';
|
|
19
|
+
import type { HostThemeScheme } from '@aglyn/shared-data-types';
|
|
20
|
+
/** MUI breakpoint keys, smallest to largest (`xs` doubles as the base). */
|
|
21
|
+
export declare const SX_BREAKPOINTS: readonly ["xs", "sm", "md", "lg", "xl"];
|
|
22
|
+
export type SxBreakpoint = (typeof SX_BREAKPOINTS)[number];
|
|
23
|
+
/**
|
|
24
|
+
* The sx scheme scope a styles-panel edit should target for the given
|
|
25
|
+
* artboard canvas scheme (AGL-588). Light is the base — only the dark
|
|
26
|
+
* preview scopes edits into the {@link SX_SCHEME_DARK_KEY} slice — so
|
|
27
|
+
* this returns null unless the artboard previews dark.
|
|
28
|
+
*/
|
|
29
|
+
export declare function canvasSchemeToSxScheme(scheme: HostThemeScheme | undefined): SxScheme | null;
|
|
30
|
+
/**
|
|
31
|
+
* The breakpoint a styles-panel edit should scope to for the given
|
|
32
|
+
* artboard preview mode (AGL-333). Fluid/scale preview edits the base
|
|
33
|
+
* value, so they return null.
|
|
34
|
+
*/
|
|
35
|
+
export declare function deviceFlagToBreakpoint(flag: BesignerDeviceFlag | undefined): SxBreakpoint | null;
|
|
36
|
+
/**
|
|
37
|
+
* The value a property resolves to at a breakpoint, following MUI's
|
|
38
|
+
* mobile-first cascade (a breakpoint inherits the nearest smaller slice).
|
|
39
|
+
* `breakpoint: null` reads the base value.
|
|
40
|
+
*
|
|
41
|
+
* Scheme dimension (AGL-588): the persisted nesting is scheme OUTER,
|
|
42
|
+
* breakpoints INNER — `sx['@scheme dark']` holds ordinary properties
|
|
43
|
+
* whose values may be responsive objects. `scheme: 'dark'` reads the
|
|
44
|
+
* dark slice first and falls back to the base, mirroring how the
|
|
45
|
+
* renderer merges the slice over base styles at render time; `'light'`,
|
|
46
|
+
* null, and undefined all read the base (light IS the base).
|
|
47
|
+
*/
|
|
48
|
+
export declare function readSxValue(sx: Record<string, any> | undefined, property: string, breakpoint: SxBreakpoint | null, scheme?: SxScheme | null): unknown;
|
|
49
|
+
/** Whether the property carries per-breakpoint overrides beyond the base. */
|
|
50
|
+
export declare function sxHasBreakpointOverrides(sx: Record<string, any> | undefined, property: string): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Returns a new sx object with `property` written at `breakpoint`
|
|
53
|
+
* (`null` = base). Plain values promote to MUI's responsive-object form
|
|
54
|
+
* only when a non-base breakpoint diverges; single-`xs` objects collapse
|
|
55
|
+
* back to plain values; `undefined` clears the slice (and the property
|
|
56
|
+
* once no slice remains).
|
|
57
|
+
*
|
|
58
|
+
* Scheme dimension (AGL-588): `scheme: 'dark'` applies the exact same
|
|
59
|
+
* write to the {@link SX_SCHEME_DARK_KEY} slice instead of the base
|
|
60
|
+
* (scheme OUTER, breakpoints INNER — see {@link readSxValue}); an empty
|
|
61
|
+
* slice is removed entirely. `'light'`/null/undefined write the base.
|
|
62
|
+
* Purely additive: sx documents without dark overrides never change
|
|
63
|
+
* shape.
|
|
64
|
+
*/
|
|
65
|
+
export declare function writeSxValue(sx: Record<string, any> | undefined, property: string, value: unknown, breakpoint: SxBreakpoint | null, scheme?: SxScheme | null): Record<string, any>;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2026 Aglyn LLC
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/ import { SX_SCHEME_DARK_KEY } from "@aglyn/aglyn-node-renderer";
|
|
18
|
+
import { BesignerDeviceFlag } from "@aglyn/besigner";
|
|
19
|
+
/** MUI breakpoint keys, smallest to largest (`xs` doubles as the base). */ export const SX_BREAKPOINTS = [
|
|
20
|
+
'xs',
|
|
21
|
+
'sm',
|
|
22
|
+
'md',
|
|
23
|
+
'lg',
|
|
24
|
+
'xl'
|
|
25
|
+
];
|
|
26
|
+
/**
|
|
27
|
+
* The sx scheme scope a styles-panel edit should target for the given
|
|
28
|
+
* artboard canvas scheme (AGL-588). Light is the base — only the dark
|
|
29
|
+
* preview scopes edits into the {@link SX_SCHEME_DARK_KEY} slice — so
|
|
30
|
+
* this returns null unless the artboard previews dark.
|
|
31
|
+
*/ export function canvasSchemeToSxScheme(scheme) {
|
|
32
|
+
return scheme === 'dark' ? 'dark' : null;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The breakpoint a styles-panel edit should scope to for the given
|
|
36
|
+
* artboard preview mode (AGL-333). Fluid/scale preview edits the base
|
|
37
|
+
* value, so they return null.
|
|
38
|
+
*/ export function deviceFlagToBreakpoint(flag) {
|
|
39
|
+
switch(flag){
|
|
40
|
+
case BesignerDeviceFlag.XS:
|
|
41
|
+
return 'xs';
|
|
42
|
+
case BesignerDeviceFlag.SM:
|
|
43
|
+
return 'sm';
|
|
44
|
+
case BesignerDeviceFlag.MD:
|
|
45
|
+
return 'md';
|
|
46
|
+
case BesignerDeviceFlag.LG:
|
|
47
|
+
return 'lg';
|
|
48
|
+
case BesignerDeviceFlag.XL:
|
|
49
|
+
return 'xl';
|
|
50
|
+
default:
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const isResponsiveObject = (value)=>typeof value === 'object' && value !== null && !Array.isArray(value) && Object.keys(value).every((key)=>SX_BREAKPOINTS.includes(key)) && Object.keys(value).length > 0;
|
|
55
|
+
/**
|
|
56
|
+
* The value a property resolves to at a breakpoint, following MUI's
|
|
57
|
+
* mobile-first cascade (a breakpoint inherits the nearest smaller slice).
|
|
58
|
+
* `breakpoint: null` reads the base value.
|
|
59
|
+
*
|
|
60
|
+
* Scheme dimension (AGL-588): the persisted nesting is scheme OUTER,
|
|
61
|
+
* breakpoints INNER — `sx['@scheme dark']` holds ordinary properties
|
|
62
|
+
* whose values may be responsive objects. `scheme: 'dark'` reads the
|
|
63
|
+
* dark slice first and falls back to the base, mirroring how the
|
|
64
|
+
* renderer merges the slice over base styles at render time; `'light'`,
|
|
65
|
+
* null, and undefined all read the base (light IS the base).
|
|
66
|
+
*/ export function readSxValue(sx, property, breakpoint, scheme) {
|
|
67
|
+
if (scheme === 'dark') {
|
|
68
|
+
const slice = sx == null ? void 0 : sx[SX_SCHEME_DARK_KEY];
|
|
69
|
+
const override = readSxValue(slice, property, breakpoint);
|
|
70
|
+
if (override !== undefined) return override;
|
|
71
|
+
return readSxValue(sx, property, breakpoint);
|
|
72
|
+
}
|
|
73
|
+
const value = sx == null ? void 0 : sx[property];
|
|
74
|
+
if (!isResponsiveObject(value)) return value;
|
|
75
|
+
if (breakpoint === null) return value['xs'];
|
|
76
|
+
const index = SX_BREAKPOINTS.indexOf(breakpoint);
|
|
77
|
+
for(let i = index; i >= 0; i -= 1){
|
|
78
|
+
const slice = value[SX_BREAKPOINTS[i]];
|
|
79
|
+
if (slice !== undefined) return slice;
|
|
80
|
+
}
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
/** Whether the property carries per-breakpoint overrides beyond the base. */ export function sxHasBreakpointOverrides(sx, property) {
|
|
84
|
+
const value = sx == null ? void 0 : sx[property];
|
|
85
|
+
return isResponsiveObject(value) && Object.keys(value).some((key)=>key !== 'xs');
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Returns a new sx object with `property` written at `breakpoint`
|
|
89
|
+
* (`null` = base). Plain values promote to MUI's responsive-object form
|
|
90
|
+
* only when a non-base breakpoint diverges; single-`xs` objects collapse
|
|
91
|
+
* back to plain values; `undefined` clears the slice (and the property
|
|
92
|
+
* once no slice remains).
|
|
93
|
+
*
|
|
94
|
+
* Scheme dimension (AGL-588): `scheme: 'dark'` applies the exact same
|
|
95
|
+
* write to the {@link SX_SCHEME_DARK_KEY} slice instead of the base
|
|
96
|
+
* (scheme OUTER, breakpoints INNER — see {@link readSxValue}); an empty
|
|
97
|
+
* slice is removed entirely. `'light'`/null/undefined write the base.
|
|
98
|
+
* Purely additive: sx documents without dark overrides never change
|
|
99
|
+
* shape.
|
|
100
|
+
*/ export function writeSxValue(sx, property, value, breakpoint, scheme) {
|
|
101
|
+
if (scheme === 'dark') {
|
|
102
|
+
var _ref;
|
|
103
|
+
const current = (_ref = sx == null ? void 0 : sx[SX_SCHEME_DARK_KEY]) != null ? _ref : {};
|
|
104
|
+
const slice = writeSxValue(current, property, value, breakpoint);
|
|
105
|
+
const next = _extends({}, sx);
|
|
106
|
+
if (Object.keys(slice).length === 0) delete next[SX_SCHEME_DARK_KEY];
|
|
107
|
+
else next[SX_SCHEME_DARK_KEY] = slice;
|
|
108
|
+
return next;
|
|
109
|
+
}
|
|
110
|
+
const next = _extends({}, sx);
|
|
111
|
+
const current = next[property];
|
|
112
|
+
const key = breakpoint != null ? breakpoint : 'xs';
|
|
113
|
+
const slices = isResponsiveObject(current) ? _extends({}, current) : current !== undefined ? {
|
|
114
|
+
xs: current
|
|
115
|
+
} : {};
|
|
116
|
+
if (value === undefined || value === '') delete slices[key];
|
|
117
|
+
else slices[key] = value;
|
|
118
|
+
const keys = Object.keys(slices);
|
|
119
|
+
if (keys.length === 0) {
|
|
120
|
+
delete next[property];
|
|
121
|
+
} else if (keys.length === 1 && keys[0] === 'xs') {
|
|
122
|
+
next[property] = slices['xs'];
|
|
123
|
+
} else {
|
|
124
|
+
next[property] = slices;
|
|
125
|
+
}
|
|
126
|
+
return next;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
//# sourceMappingURL=responsive-sx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/utils/responsive-sx.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 { SX_SCHEME_DARK_KEY, type SxScheme } from '@aglyn/aglyn-node-renderer'\nimport { BesignerDeviceFlag } from '@aglyn/besigner'\nimport type { HostThemeScheme } from '@aglyn/shared-data-types'\n\n/** MUI breakpoint keys, smallest to largest (`xs` doubles as the base). */\nexport const SX_BREAKPOINTS = ['xs', 'sm', 'md', 'lg', 'xl'] as const\nexport type SxBreakpoint = (typeof SX_BREAKPOINTS)[number]\n\n/**\n * The sx scheme scope a styles-panel edit should target for the given\n * artboard canvas scheme (AGL-588). Light is the base — only the dark\n * preview scopes edits into the {@link SX_SCHEME_DARK_KEY} slice — so\n * this returns null unless the artboard previews dark.\n */\nexport function canvasSchemeToSxScheme(\n scheme: HostThemeScheme | undefined,\n): SxScheme | null {\n return scheme === 'dark' ? 'dark' : null\n}\n\n/**\n * The breakpoint a styles-panel edit should scope to for the given\n * artboard preview mode (AGL-333). Fluid/scale preview edits the base\n * value, so they return null.\n */\nexport function deviceFlagToBreakpoint(\n flag: BesignerDeviceFlag | undefined,\n): SxBreakpoint | null {\n switch (flag) {\n case BesignerDeviceFlag.XS:\n return 'xs'\n case BesignerDeviceFlag.SM:\n return 'sm'\n case BesignerDeviceFlag.MD:\n return 'md'\n case BesignerDeviceFlag.LG:\n return 'lg'\n case BesignerDeviceFlag.XL:\n return 'xl'\n default:\n return null\n }\n}\n\nconst isResponsiveObject = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' &&\n value !== null &&\n !Array.isArray(value) &&\n Object.keys(value).every((key) =>\n (SX_BREAKPOINTS as readonly string[]).includes(key),\n ) &&\n Object.keys(value).length > 0\n\n/**\n * The value a property resolves to at a breakpoint, following MUI's\n * mobile-first cascade (a breakpoint inherits the nearest smaller slice).\n * `breakpoint: null` reads the base value.\n *\n * Scheme dimension (AGL-588): the persisted nesting is scheme OUTER,\n * breakpoints INNER — `sx['@scheme dark']` holds ordinary properties\n * whose values may be responsive objects. `scheme: 'dark'` reads the\n * dark slice first and falls back to the base, mirroring how the\n * renderer merges the slice over base styles at render time; `'light'`,\n * null, and undefined all read the base (light IS the base).\n */\nexport function readSxValue(\n sx: Record<string, any> | undefined,\n property: string,\n breakpoint: SxBreakpoint | null,\n scheme?: SxScheme | null,\n): unknown {\n if (scheme === 'dark') {\n const slice = sx?.[SX_SCHEME_DARK_KEY] as Record<string, any> | undefined\n const override = readSxValue(slice, property, breakpoint)\n if (override !== undefined) return override\n return readSxValue(sx, property, breakpoint)\n }\n const value = sx?.[property]\n if (!isResponsiveObject(value)) return value\n if (breakpoint === null) return value['xs']\n const index = SX_BREAKPOINTS.indexOf(breakpoint)\n for (let i = index; i >= 0; i -= 1) {\n const slice = value[SX_BREAKPOINTS[i]]\n if (slice !== undefined) return slice\n }\n return undefined\n}\n\n/** Whether the property carries per-breakpoint overrides beyond the base. */\nexport function sxHasBreakpointOverrides(\n sx: Record<string, any> | undefined,\n property: string,\n): boolean {\n const value = sx?.[property]\n return (\n isResponsiveObject(value) &&\n Object.keys(value).some((key) => key !== 'xs')\n )\n}\n\n/**\n * Returns a new sx object with `property` written at `breakpoint`\n * (`null` = base). Plain values promote to MUI's responsive-object form\n * only when a non-base breakpoint diverges; single-`xs` objects collapse\n * back to plain values; `undefined` clears the slice (and the property\n * once no slice remains).\n *\n * Scheme dimension (AGL-588): `scheme: 'dark'` applies the exact same\n * write to the {@link SX_SCHEME_DARK_KEY} slice instead of the base\n * (scheme OUTER, breakpoints INNER — see {@link readSxValue}); an empty\n * slice is removed entirely. `'light'`/null/undefined write the base.\n * Purely additive: sx documents without dark overrides never change\n * shape.\n */\nexport function writeSxValue(\n sx: Record<string, any> | undefined,\n property: string,\n value: unknown,\n breakpoint: SxBreakpoint | null,\n scheme?: SxScheme | null,\n): Record<string, any> {\n if (scheme === 'dark') {\n const current = (sx?.[SX_SCHEME_DARK_KEY] ?? {}) as Record<string, any>\n const slice = writeSxValue(current, property, value, breakpoint)\n const next: Record<string, any> = { ...sx }\n if (Object.keys(slice).length === 0) delete next[SX_SCHEME_DARK_KEY]\n else next[SX_SCHEME_DARK_KEY] = slice\n return next\n }\n const next: Record<string, any> = { ...sx }\n const current = next[property]\n const key: SxBreakpoint = breakpoint ?? 'xs'\n\n const slices: Record<string, unknown> = isResponsiveObject(current)\n ? { ...current }\n : current !== undefined\n ? { xs: current }\n : {}\n\n if (value === undefined || value === '') delete slices[key]\n else slices[key] = value\n\n const keys = Object.keys(slices)\n if (keys.length === 0) {\n delete next[property]\n } else if (keys.length === 1 && keys[0] === 'xs') {\n next[property] = slices['xs']\n } else {\n next[property] = slices\n }\n return next\n}\n"],"names":["SX_SCHEME_DARK_KEY","BesignerDeviceFlag","SX_BREAKPOINTS","canvasSchemeToSxScheme","scheme","deviceFlagToBreakpoint","flag","XS","SM","MD","LG","XL","isResponsiveObject","value","Array","isArray","Object","keys","every","key","includes","length","readSxValue","sx","property","breakpoint","slice","override","undefined","index","indexOf","i","sxHasBreakpointOverrides","some","writeSxValue","current","next","slices","xs"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,kBAAkB,QAAuB,6BAA4B;AAC9E,SAASC,kBAAkB,QAAQ,kBAAiB;AAGpD,yEAAyE,GACzE,OAAO,MAAMC,iBAAiB;IAAC;IAAM;IAAM;IAAM;IAAM;CAAK,CAAS;AAGrE;;;;;CAKC,GACD,OAAO,SAASC,uBACdC,MAAmC;IAEnC,OAAOA,WAAW,SAAS,SAAS;AACtC;AAEA;;;;CAIC,GACD,OAAO,SAASC,uBACdC,IAAoC;IAEpC,OAAQA;QACN,KAAKL,mBAAmBM,EAAE;YACxB,OAAO;QACT,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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
|
+
/**
|
|
19
|
+
* The formatting groups this component's inline editor may offer.
|
|
20
|
+
*
|
|
21
|
+
* An EMPTY declared list is read as "nothing declared" rather than as "no
|
|
22
|
+
* formatting". A schema turns formatting off by leaving `richTextEditable`
|
|
23
|
+
* alone, which is the switch the editor already reads; `richTextCommands: []`
|
|
24
|
+
* is what a mistaken spread or a stripped-empty-array produces, and reading
|
|
25
|
+
* it as a silent opt-out would give an author a rich surface with an empty
|
|
26
|
+
* toolbar and no way to tell why.
|
|
27
|
+
*/
|
|
28
|
+
export declare function richTextCommandGroups(schema: Aglyn.ComponentSchema<any> | undefined | null): ReadonlySet<Aglyn.RICH_TEXT_COMMANDS>;
|
|
@@ -0,0 +1,43 @@
|
|
|
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 { RICH_TEXT_COMMANDS } from "@aglyn/aglyn";
|
|
17
|
+
/**
|
|
18
|
+
* What a schema gets when it names nothing — everything (AGL-2557).
|
|
19
|
+
*
|
|
20
|
+
* The default has to be permissive rather than restrictive: `richTextEditable`
|
|
21
|
+
* meant "the whole toolbar" before this existed, and Typography, the one
|
|
22
|
+
* component carrying it, says nothing about groups. A restrictive default
|
|
23
|
+
* would silently take bold away from the element that had it.
|
|
24
|
+
*/ const EVERY_GROUP = [
|
|
25
|
+
RICH_TEXT_COMMANDS.EMPHASIS,
|
|
26
|
+
RICH_TEXT_COMMANDS.LIST,
|
|
27
|
+
RICH_TEXT_COMMANDS.LINK
|
|
28
|
+
];
|
|
29
|
+
/**
|
|
30
|
+
* The formatting groups this component's inline editor may offer.
|
|
31
|
+
*
|
|
32
|
+
* An EMPTY declared list is read as "nothing declared" rather than as "no
|
|
33
|
+
* formatting". A schema turns formatting off by leaving `richTextEditable`
|
|
34
|
+
* alone, which is the switch the editor already reads; `richTextCommands: []`
|
|
35
|
+
* is what a mistaken spread or a stripped-empty-array produces, and reading
|
|
36
|
+
* it as a silent opt-out would give an author a rich surface with an empty
|
|
37
|
+
* toolbar and no way to tell why.
|
|
38
|
+
*/ export function richTextCommandGroups(schema) {
|
|
39
|
+
const declared = schema == null ? void 0 : schema.richTextCommands;
|
|
40
|
+
return new Set((declared == null ? void 0 : declared.length) ? declared : EVERY_GROUP);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=rich-text-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/utils/rich-text-commands.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 { RICH_TEXT_COMMANDS } from '@aglyn/aglyn'\n\n/**\n * What a schema gets when it names nothing — everything (AGL-2557).\n *\n * The default has to be permissive rather than restrictive: `richTextEditable`\n * meant \"the whole toolbar\" before this existed, and Typography, the one\n * component carrying it, says nothing about groups. A restrictive default\n * would silently take bold away from the element that had it.\n */\nconst EVERY_GROUP: readonly Aglyn.RICH_TEXT_COMMANDS[] = [\n RICH_TEXT_COMMANDS.EMPHASIS,\n RICH_TEXT_COMMANDS.LIST,\n RICH_TEXT_COMMANDS.LINK,\n]\n\n/**\n * The formatting groups this component's inline editor may offer.\n *\n * An EMPTY declared list is read as \"nothing declared\" rather than as \"no\n * formatting\". A schema turns formatting off by leaving `richTextEditable`\n * alone, which is the switch the editor already reads; `richTextCommands: []`\n * is what a mistaken spread or a stripped-empty-array produces, and reading\n * it as a silent opt-out would give an author a rich surface with an empty\n * toolbar and no way to tell why.\n */\nexport function richTextCommandGroups(\n schema: Aglyn.ComponentSchema<any> | undefined | null,\n): ReadonlySet<Aglyn.RICH_TEXT_COMMANDS> {\n const declared = schema?.richTextCommands\n return new Set(declared?.length ? declared : EVERY_GROUP)\n}\n"],"names":["RICH_TEXT_COMMANDS","EVERY_GROUP","EMPHASIS","LIST","LINK","richTextCommandGroups","schema","declared","richTextCommands","Set","length"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAGD,SAASA,kBAAkB,QAAQ,eAAc;AAEjD;;;;;;;CAOC,GACD,MAAMC,cAAmD;IACvDD,mBAAmBE,QAAQ;IAC3BF,mBAAmBG,IAAI;IACvBH,mBAAmBI,IAAI;CACxB;AAED;;;;;;;;;CASC,GACD,OAAO,SAASC,sBACdC,MAAqD;IAErD,MAAMC,WAAWD,0BAAAA,OAAQE,gBAAgB;IACzC,OAAO,IAAIC,IAAIF,CAAAA,4BAAAA,SAAUG,MAAM,IAAGH,WAAWN;AAC/C"}
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
/** How much markup one commit may keep — see {@link PHRASING_TAGS}. */
|
|
18
|
+
export interface SanitizeRichTextOptions {
|
|
19
|
+
phrasingOnly?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Allowlist HTML sanitizer for inline rich text: keeps basic formatting
|
|
23
|
+
* tags, strips every attribute except a safe `href` on links (which gains
|
|
24
|
+
* `rel="noopener noreferrer"`), and unwraps disallowed elements to their
|
|
25
|
+
* text content (so nothing script-capable survives). Runs at commit time in
|
|
26
|
+
* the editor (browser DOM available).
|
|
27
|
+
*
|
|
28
|
+
* `options.phrasingOnly` narrows the allowlist for a surface that ships
|
|
29
|
+
* inside a control (AGL-2557); omitted, every existing caller is unchanged.
|
|
30
|
+
*/
|
|
31
|
+
export declare function sanitizeRichText(html: string, options?: SanitizeRichTextOptions): string;
|
|
32
|
+
/**
|
|
33
|
+
* Plain-text projection of markup, for the `children` fallback prop.
|
|
34
|
+
*
|
|
35
|
+
* Line breaks SURVIVE (AGL-2486). A node that carries one stores
|
|
36
|
+
* `html: "Your entire web <div>presence. </div>"` beside
|
|
37
|
+
* `children: "Your entire web presence. "`. The canvas renders `html` and
|
|
38
|
+
* shows two lines; the Attributes panel renders `children`. Projected with
|
|
39
|
+
* `template.content.textContent` the panel shows one, because `textContent`
|
|
40
|
+
* concatenates across every element boundary — a `<div>` fork and a `<br>`
|
|
41
|
+
* both vanish into nothing.
|
|
42
|
+
*
|
|
43
|
+
* That is a real break silently dropped by the projection, not the soft wrap
|
|
44
|
+
* a bounding box misreports. `children` is not a display detail either: it is
|
|
45
|
+
* what every
|
|
46
|
+
* plain renderer, the SSR fallback and the panel field all read, so the
|
|
47
|
+
* break was being lost to all three.
|
|
48
|
+
*
|
|
49
|
+
* Only the trailing newline is trimmed — a block element closes at the end
|
|
50
|
+
* of the string and that boundary separates nothing.
|
|
51
|
+
*/
|
|
52
|
+
export declare function richTextToPlain(html: string): string;
|