@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,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ /**
|
|
17
|
+
* The four region materials of the box diagram, defined ONCE (AGL-2486).
|
|
18
|
+
*
|
|
19
|
+
* Two reasons this is not inline in the component.
|
|
20
|
+
*
|
|
21
|
+
* **The legend has to be readable.** Four abstract swatches beside a textured
|
|
22
|
+
* diagram is a puzzle. A swatch painted with the *same* declaration as the
|
|
23
|
+
* region it names needs no decoding — so the diagram and the legend both read
|
|
24
|
+
* their fills from here, and the two cannot drift.
|
|
25
|
+
*
|
|
26
|
+
* **Dark mode has to come from the theme.** Every value below is a palette
|
|
27
|
+
* TOKEN or a channel form of one, never a literal, so the console's
|
|
28
|
+
* `colorSchemeSelector: 'class'` CSS variables re-resolve them when the
|
|
29
|
+
* scheme flips. That is also what keeps this file at zero entries in the
|
|
30
|
+
* hardcoded-colour ratchet, whose baseline may not rise.
|
|
31
|
+
*
|
|
32
|
+
* The texture is deliberate and so is its weight. Stripes and hatching are
|
|
33
|
+
* what tell one region from another; a saturated hue does the same job but
|
|
34
|
+
* shouts over its neighbours, and flat greys leave the regions
|
|
35
|
+
* indistinguishable. So the pattern is carried by `text.primary` at a low
|
|
36
|
+
* alpha rather than by a hue, which reads as material instead of decoration
|
|
37
|
+
* and survives both schemes: `text.primary` is near-black on light and
|
|
38
|
+
* near-white on dark, so the tint always contrasts gently with its ground.
|
|
39
|
+
*/ /** The subset of a theme these fills read (a CSS-vars theme's `vars`). */ /** An opaque stack: a flat tint layered ON a background token. */ const tint = (channel, alpha, ground)=>[
|
|
40
|
+
`linear-gradient(0deg,`,
|
|
41
|
+
` rgba(${channel} / ${alpha}),`,
|
|
42
|
+
` rgba(${channel} / ${alpha}))`,
|
|
43
|
+
`, ${ground}`
|
|
44
|
+
].join('');
|
|
45
|
+
export function regionFills(tv) {
|
|
46
|
+
const ink = tv.palette.text.primaryChannel;
|
|
47
|
+
const info = tv.palette.info.mainChannel;
|
|
48
|
+
const primary = tv.palette.primary.mainChannel;
|
|
49
|
+
const paper = tv.palette.background.paper;
|
|
50
|
+
const ground = tv.palette.background.default;
|
|
51
|
+
return {
|
|
52
|
+
/**
|
|
53
|
+
* The calmest material in the figure, because it is the largest area
|
|
54
|
+
* in it — whatever the margin wears sets the overall noise level.
|
|
55
|
+
*
|
|
56
|
+
* It used to carry the stripes. That put the two loudest materials on
|
|
57
|
+
* the two outermost regions and the diagram read as busy rather than
|
|
58
|
+
* author looks at last.
|
|
59
|
+
*/ margin: {
|
|
60
|
+
background: tint(ink, 0.05, paper),
|
|
61
|
+
seam: tint(ink, 0.15, paper),
|
|
62
|
+
borderColor: `rgba(${ink} / 0.28)`,
|
|
63
|
+
borderStyle: 'dashed'
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* The stripes, and the only striped region — "only the border area".
|
|
67
|
+
*
|
|
68
|
+
* This is where they were always headed: it is the thinnest band, the
|
|
69
|
+
* one that needed the most help reading as its own material, and the
|
|
70
|
+
* one whose name an author is least likely to already understand.
|
|
71
|
+
* Being the only patterned region is what makes it identifiable at a
|
|
72
|
+
* glance rather than one texture among several.
|
|
73
|
+
*/ border: {
|
|
74
|
+
background: [
|
|
75
|
+
`repeating-linear-gradient(45deg,`,
|
|
76
|
+
` rgba(${info} / 0.34) 0 4px,`,
|
|
77
|
+
` rgba(${info} / 0.10) 4px 9px)`,
|
|
78
|
+
`, ${ground}`
|
|
79
|
+
].join(''),
|
|
80
|
+
seam: tint(info, 0.26, ground),
|
|
81
|
+
borderColor: `rgba(${info} / 0.55)`,
|
|
82
|
+
borderStyle: 'dashed'
|
|
83
|
+
},
|
|
84
|
+
/**
|
|
85
|
+
* The original's faint diagonal wash between the two brand hues. It
|
|
86
|
+
* was never the thing that was too loud, and it stays a tint on an
|
|
87
|
+
* opaque ground rather than a gradient in its own right.
|
|
88
|
+
*/ padding: {
|
|
89
|
+
background: [
|
|
90
|
+
`linear-gradient(65deg,`,
|
|
91
|
+
` rgba(${tv.palette.secondary.mainChannel} / 0.16),`,
|
|
92
|
+
` rgba(${primary} / 0.16))`,
|
|
93
|
+
`, ${paper}`
|
|
94
|
+
].join(''),
|
|
95
|
+
seam: tint(primary, 0.24, paper),
|
|
96
|
+
borderColor: `rgba(${primary} / 0.42)`,
|
|
97
|
+
borderStyle: 'dashed'
|
|
98
|
+
},
|
|
99
|
+
/**
|
|
100
|
+
* "Plain white inside it looks boring" — a fine dotted grid, the
|
|
101
|
+
* visual shorthand for an empty canvas, and the quietest texture of
|
|
102
|
+
* the four because this is the region the others exist to surround.
|
|
103
|
+
*/ contents: {
|
|
104
|
+
background: [
|
|
105
|
+
`radial-gradient(rgba(${ink} / 0.16) 0.5px, transparent 0.5px)`,
|
|
106
|
+
` 0 0 / 5px 5px`,
|
|
107
|
+
`, ${ground}`
|
|
108
|
+
].join(''),
|
|
109
|
+
seam: tint(ink, 0.15, ground),
|
|
110
|
+
borderColor: `rgba(${ink} / 0.42)`,
|
|
111
|
+
borderStyle: 'solid'
|
|
112
|
+
},
|
|
113
|
+
/**
|
|
114
|
+
* Selection: the same hue, given alpha — "use the same color but
|
|
115
|
+
* maybe make it have less opacity and add an alpha to the color".
|
|
116
|
+
*
|
|
117
|
+
* It was solid `primary.main`, the one fully saturated thing in a
|
|
118
|
+
* figure built out of low-alpha tints, so it dominated instead of
|
|
119
|
+
* indicating. At 0.42 over the region's own ground it is still the
|
|
120
|
+
* strongest colour present — nothing else uses primary above 0.24 —
|
|
121
|
+
* without being the brightest thing on screen.
|
|
122
|
+
*
|
|
123
|
+
* The text goes to `text.primary` rather than `primary.contrastText`.
|
|
124
|
+
* A contrast-text token is computed for a SOLID primary; over a
|
|
125
|
+
* translucent tint the actual backdrop is the region behind it, which
|
|
126
|
+
* is near-white on light and near-black on dark. `text.primary` is
|
|
127
|
+
* the token that flips with exactly that, so the label stays legible
|
|
128
|
+
* in both schemes instead of being right in one.
|
|
129
|
+
*/ selected: {
|
|
130
|
+
background: tint(primary, 0.42, paper),
|
|
131
|
+
seam: tint(primary, 0.42, paper),
|
|
132
|
+
borderColor: `rgba(${primary} / 0.75)`,
|
|
133
|
+
borderStyle: 'solid',
|
|
134
|
+
color: tv.palette.text.primary
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
//# sourceMappingURL=region-fills.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/box-styler/region-fills.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The four region materials of the box diagram, defined ONCE (AGL-2486).\n *\n * Two reasons this is not inline in the component.\n *\n * **The legend has to be readable.** Four abstract swatches beside a textured\n * diagram is a puzzle. A swatch painted with the *same* declaration as the\n * region it names needs no decoding — so the diagram and the legend both read\n * their fills from here, and the two cannot drift.\n *\n * **Dark mode has to come from the theme.** Every value below is a palette\n * TOKEN or a channel form of one, never a literal, so the console's\n * `colorSchemeSelector: 'class'` CSS variables re-resolve them when the\n * scheme flips. That is also what keeps this file at zero entries in the\n * hardcoded-colour ratchet, whose baseline may not rise.\n *\n * The texture is deliberate and so is its weight. Stripes and hatching are\n * what tell one region from another; a saturated hue does the same job but\n * shouts over its neighbours, and flat greys leave the regions\n * indistinguishable. So the pattern is carried by `text.primary` at a low\n * alpha rather than by a hue, which reads as material instead of decoration\n * and survives both schemes: `text.primary` is near-black on light and\n * near-white on dark, so the tint always contrasts gently with its ground.\n */\n\n/** The subset of a theme these fills read (a CSS-vars theme's `vars`). */\nexport interface RegionFillTheme {\n palette: {\n text: { primary: string; primaryChannel: string }\n info: { mainChannel: string }\n primary: { mainChannel: string }\n secondary: { mainChannel: string }\n background: { paper: string; default: string }\n }\n}\n\nexport interface RegionFill {\n /** `background` shorthand — a texture layer over a ground. */\n background: string\n /**\n * The ground BEHIND the wedges of this band.\n *\n * The band is drawn as four mitred wedges with a 2px gap between them,\n * and that gap is what makes the diagonal seams at the corners visible —\n * which is the whole reason the shape reads as a frame around something\n * rather than as a plain rectangle. The wedges carry `background`; this\n * shows through between them. The original used `common.black` here,\n * which is what made the seams read as harsh slashes; a low-alpha ink\n * tint gives the same geometry as fine lines instead.\n *\n * **Opaque, like every other value here.** A translucent seam is what\n * put the border band's texture underneath the padding controls: the\n * padding box's ground let the ring's material show straight through\n * it. A region paints its own material and nothing else's, so every\n * ground ends in a `background.*` token and each tint is layered ON it\n * rather than left to composite against whatever happens to be behind.\n */\n seam: string\n /** The edge drawn around the region. */\n borderColor: string\n borderStyle: 'dashed' | 'solid'\n}\n\nexport interface RegionFills {\n margin: RegionFill\n border: RegionFill\n padding: RegionFill\n contents: RegionFill\n /**\n * The side whose editor is open.\n *\n * It lives here rather than in the component because \"what colour is a\n * region, in which state\" should have one answer in one file — and\n * because this is the value that was wrong: a fully saturated\n * `primary.main` inside a figure built deliberately from low-alpha\n * tints, so the selected wedge was the brightest thing on screen.\n */\n selected: RegionFill & { color: string }\n}\n\n/** An opaque stack: a flat tint layered ON a background token. */\nconst tint = (channel: string, alpha: number, ground: string) =>\n [\n `linear-gradient(0deg,`,\n ` rgba(${channel} / ${alpha}),`,\n ` rgba(${channel} / ${alpha}))`,\n `, ${ground}`,\n ].join('')\n\nexport function regionFills(tv: RegionFillTheme): RegionFills {\n const ink = tv.palette.text.primaryChannel\n const info = tv.palette.info.mainChannel\n const primary = tv.palette.primary.mainChannel\n const paper = tv.palette.background.paper\n const ground = tv.palette.background.default\n\n return {\n /**\n * The calmest material in the figure, because it is the largest area\n * in it — whatever the margin wears sets the overall noise level.\n *\n * It used to carry the stripes. That put the two loudest materials on\n * the two outermost regions and the diagram read as busy rather than\n * author looks at last.\n */\n margin: {\n background: tint(ink, 0.05, paper),\n seam: tint(ink, 0.15, paper),\n borderColor: `rgba(${ink} / 0.28)`,\n borderStyle: 'dashed',\n },\n\n /**\n * The stripes, and the only striped region — \"only the border area\".\n *\n * This is where they were always headed: it is the thinnest band, the\n * one that needed the most help reading as its own material, and the\n * one whose name an author is least likely to already understand.\n * Being the only patterned region is what makes it identifiable at a\n * glance rather than one texture among several.\n */\n border: {\n background: [\n `repeating-linear-gradient(45deg,`,\n ` rgba(${info} / 0.34) 0 4px,`,\n ` rgba(${info} / 0.10) 4px 9px)`,\n `, ${ground}`,\n ].join(''),\n seam: tint(info, 0.26, ground),\n borderColor: `rgba(${info} / 0.55)`,\n borderStyle: 'dashed',\n },\n\n /**\n * The original's faint diagonal wash between the two brand hues. It\n * was never the thing that was too loud, and it stays a tint on an\n * opaque ground rather than a gradient in its own right.\n */\n padding: {\n background: [\n `linear-gradient(65deg,`,\n ` rgba(${tv.palette.secondary.mainChannel} / 0.16),`,\n ` rgba(${primary} / 0.16))`,\n `, ${paper}`,\n ].join(''),\n seam: tint(primary, 0.24, paper),\n borderColor: `rgba(${primary} / 0.42)`,\n borderStyle: 'dashed',\n },\n\n /**\n * \"Plain white inside it looks boring\" — a fine dotted grid, the\n * visual shorthand for an empty canvas, and the quietest texture of\n * the four because this is the region the others exist to surround.\n */\n contents: {\n background: [\n `radial-gradient(rgba(${ink} / 0.16) 0.5px, transparent 0.5px)`,\n ` 0 0 / 5px 5px`,\n `, ${ground}`,\n ].join(''),\n seam: tint(ink, 0.15, ground),\n borderColor: `rgba(${ink} / 0.42)`,\n borderStyle: 'solid',\n },\n\n /**\n * Selection: the same hue, given alpha — \"use the same color but\n * maybe make it have less opacity and add an alpha to the color\".\n *\n * It was solid `primary.main`, the one fully saturated thing in a\n * figure built out of low-alpha tints, so it dominated instead of\n * indicating. At 0.42 over the region's own ground it is still the\n * strongest colour present — nothing else uses primary above 0.24 —\n * without being the brightest thing on screen.\n *\n * The text goes to `text.primary` rather than `primary.contrastText`.\n * A contrast-text token is computed for a SOLID primary; over a\n * translucent tint the actual backdrop is the region behind it, which\n * is near-white on light and near-black on dark. `text.primary` is\n * the token that flips with exactly that, so the label stays legible\n * in both schemes instead of being right in one.\n */\n selected: {\n background: tint(primary, 0.42, paper),\n seam: tint(primary, 0.42, paper),\n borderColor: `rgba(${primary} / 0.75)`,\n borderStyle: 'solid',\n color: tv.palette.text.primary,\n },\n }\n}\n"],"names":["tint","channel","alpha","ground","join","regionFills","tv","ink","palette","text","primaryChannel","info","mainChannel","primary","paper","background","default","margin","seam","borderColor","borderStyle","border","padding","secondary","contents","selected","color"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;;;;;CAuBC,GAED,wEAAwE,GAuDxE,gEAAgE,GAChE,MAAMA,OAAO,CAACC,SAAiBC,OAAeC,SAC5C;QACE,CAAC,qBAAqB,CAAC;QACvB,CAAC,MAAM,EAAEF,QAAQ,GAAG,EAAEC,MAAM,EAAE,CAAC;QAC/B,CAAC,MAAM,EAAED,QAAQ,GAAG,EAAEC,MAAM,EAAE,CAAC;QAC/B,CAAC,EAAE,EAAEC,QAAQ;KACd,CAACC,IAAI,CAAC;AAET,OAAO,SAASC,YAAYC,EAAmB;IAC7C,MAAMC,MAAMD,GAAGE,OAAO,CAACC,IAAI,CAACC,cAAc;IAC1C,MAAMC,OAAOL,GAAGE,OAAO,CAACG,IAAI,CAACC,WAAW;IACxC,MAAMC,UAAUP,GAAGE,OAAO,CAACK,OAAO,CAACD,WAAW;IAC9C,MAAME,QAAQR,GAAGE,OAAO,CAACO,UAAU,CAACD,KAAK;IACzC,MAAMX,SAASG,GAAGE,OAAO,CAACO,UAAU,CAACC,OAAO;IAE5C,OAAO;QACL;;;;;;;KAOC,GACDC,QAAQ;YACNF,YAAYf,KAAKO,KAAK,MAAMO;YAC5BI,MAAMlB,KAAKO,KAAK,MAAMO;YACtBK,aAAa,CAAC,KAAK,EAAEZ,IAAI,QAAQ,CAAC;YAClCa,aAAa;QACf;QAEA;;;;;;;;KAQC,GACDC,QAAQ;YACNN,YAAY;gBACV,CAAC,gCAAgC,CAAC;gBAClC,CAAC,MAAM,EAAEJ,KAAK,eAAe,CAAC;gBAC9B,CAA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
|
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 { CssUnit } from '@aglyn/shared-data-enums';
|
|
18
|
+
import type { SpacingScaleOption } from '../utils/theme-scale-options';
|
|
19
|
+
import type { BesignerDocsAnchor } from '../utils/docs-help';
|
|
20
|
+
/**
|
|
21
|
+
* The box styler's value logic (AGL-2486, item 5), kept apart from the
|
|
22
|
+
* components so the rules can be asserted rather than described.
|
|
23
|
+
*
|
|
24
|
+
* A side of the box holds one of three things, and telling them apart is
|
|
25
|
+
* the whole job:
|
|
26
|
+
*
|
|
27
|
+
* - a **theme spacing step**, stored as a NUMBER, which MUI resolves
|
|
28
|
+
* through `theme.spacing` at render (`2` → 16px under `spacing: 8`);
|
|
29
|
+
* - a **custom amount**, stored as a CSS string (`'12px'`, `'2rem'`,
|
|
30
|
+
* `'auto'`);
|
|
31
|
+
* - **nothing** — the property is absent and the element inherits.
|
|
32
|
+
*
|
|
33
|
+
* `0` belongs to the first group, not the third. It means "no space", it
|
|
34
|
+
* renders as `0px`, and it is the value an author picks to cancel space a
|
|
35
|
+
* parent or a preset put there. `strictNullChecks` is off repo-wide, so
|
|
36
|
+
* every `if (!value)` in this file's neighbourhood would have silently
|
|
37
|
+
* folded that answer into "unset" — hence the explicit predicates below.
|
|
38
|
+
*/
|
|
39
|
+
/** A box spacing value as STORED: a theme step, or a CSS string. */
|
|
40
|
+
export type BoxSpacingValue = string | number | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Whether the author has set this side at all.
|
|
43
|
+
*
|
|
44
|
+
* The one that matters: `isSpacingSet(0)` is TRUE. `0` is a decision, and
|
|
45
|
+
* an editor that reads it as "unset" both hides it from the author and
|
|
46
|
+
* loses it on the next write.
|
|
47
|
+
*/
|
|
48
|
+
export declare function isSpacingSet(value: BoxSpacingValue): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Whether this value is a theme spacing step — the form that keeps
|
|
51
|
+
* following the theme — rather than a flattened CSS string.
|
|
52
|
+
*
|
|
53
|
+
* A numeric STRING is deliberately not a step: MUI passes strings through
|
|
54
|
+
* untouched, so `'2'` reaches the browser as `margin-top: 2` and is
|
|
55
|
+
* dropped by the CSS parser. Only a real number is resolved.
|
|
56
|
+
*/
|
|
57
|
+
export declare function isThemeSpacingStep(value: BoxSpacingValue): boolean;
|
|
58
|
+
/** The ladder entry a stored value corresponds to, if any. */
|
|
59
|
+
export declare function findSpacingStep(value: BoxSpacingValue, steps: readonly SpacingScaleOption[]): SpacingScaleOption | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* The compact text one side of the diagram shows — what the element
|
|
62
|
+
* actually renders, so the diagram reads as a measurement rather than as a
|
|
63
|
+
* vocabulary quiz. `''` when nothing is set, which is the caller's cue to
|
|
64
|
+
* show the side's name instead.
|
|
65
|
+
*
|
|
66
|
+
* A step resolves to its hint (`16px`) so an author comparing two sides is
|
|
67
|
+
* comparing like with like; which of them is theme-backed is carried by
|
|
68
|
+
* the marker and the tooltip, not by making the numbers incomparable.
|
|
69
|
+
*/
|
|
70
|
+
export declare function spacingDisplayText(value: BoxSpacingValue, steps: readonly SpacingScaleOption[]): string;
|
|
71
|
+
/**
|
|
72
|
+
* The long form used in tooltips and the editor's title, e.g.
|
|
73
|
+
* `Medium (theme spacing) — 16px`. Names the theme connection explicitly,
|
|
74
|
+
* because that is the property an author cannot see from the number.
|
|
75
|
+
*/
|
|
76
|
+
export declare function spacingDescription(value: BoxSpacingValue, steps: readonly SpacingScaleOption[]): string;
|
|
77
|
+
/** How the unit menu groups itself, so a long list stays readable. */
|
|
78
|
+
export declare const UNIT_GROUPS: ReadonlyArray<{
|
|
79
|
+
label: string;
|
|
80
|
+
units: readonly CssUnit[];
|
|
81
|
+
}>;
|
|
82
|
+
/**
|
|
83
|
+
* Units in the shared list that are NOT lengths, and so are never offered
|
|
84
|
+
* as an amount of space.
|
|
85
|
+
*
|
|
86
|
+
* `dpi` is a resolution — it answers "how dense are the dots?", not "how
|
|
87
|
+
* far?" — and `margin-top: 2dpi` is not a thing. It is named here rather
|
|
88
|
+
* than quietly left out so the coverage check below stays a real check:
|
|
89
|
+
* a unit added to `CssUnit` and forgotten still fails.
|
|
90
|
+
*/
|
|
91
|
+
export declare const UNITS_NOT_SPACING: readonly CssUnit[];
|
|
92
|
+
/**
|
|
93
|
+
* The plain-language gloss shown beside each unit in the menu — the
|
|
94
|
+
* one-line version of what the docs page explains at length.
|
|
95
|
+
*/
|
|
96
|
+
export declare const UNIT_GLOSS: Partial<Record<CssUnit, string>>;
|
|
97
|
+
type ResponsiveStylingAnchor = BesignerDocsAnchor<'responsiveStyling'>;
|
|
98
|
+
/**
|
|
99
|
+
* The docs anchor for a unit. Units with no section of their own fall back
|
|
100
|
+
* to the custom-amounts section, so every entry in the menu has somewhere
|
|
101
|
+
* to send an author who does not recognise it.
|
|
102
|
+
*/
|
|
103
|
+
export declare function unitDocsAnchor(unit: CssUnit): ResponsiveStylingAnchor;
|
|
104
|
+
export {};
|
|
@@ -0,0 +1,223 @@
|
|
|
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 { CssUnit } from "@aglyn/shared-data-enums";
|
|
17
|
+
/**
|
|
18
|
+
* Whether the author has set this side at all.
|
|
19
|
+
*
|
|
20
|
+
* The one that matters: `isSpacingSet(0)` is TRUE. `0` is a decision, and
|
|
21
|
+
* an editor that reads it as "unset" both hides it from the author and
|
|
22
|
+
* loses it on the next write.
|
|
23
|
+
*/ export function isSpacingSet(value) {
|
|
24
|
+
if (value === undefined || value === null) return false;
|
|
25
|
+
if (typeof value === 'number') return Number.isFinite(value);
|
|
26
|
+
return `${value}`.trim() !== '';
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Whether this value is a theme spacing step — the form that keeps
|
|
30
|
+
* following the theme — rather than a flattened CSS string.
|
|
31
|
+
*
|
|
32
|
+
* A numeric STRING is deliberately not a step: MUI passes strings through
|
|
33
|
+
* untouched, so `'2'` reaches the browser as `margin-top: 2` and is
|
|
34
|
+
* dropped by the CSS parser. Only a real number is resolved.
|
|
35
|
+
*/ export function isThemeSpacingStep(value) {
|
|
36
|
+
return typeof value === 'number' && Number.isFinite(value);
|
|
37
|
+
}
|
|
38
|
+
/** The ladder entry a stored value corresponds to, if any. */ export function findSpacingStep(value, steps) {
|
|
39
|
+
if (!isThemeSpacingStep(value)) return undefined;
|
|
40
|
+
return (steps != null ? steps : []).find((step)=>step.value === value);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The theme's spacing UNIT, inferred from the ladder itself.
|
|
44
|
+
*
|
|
45
|
+
* The ladder already carries the answer — a rung of 1 whose hint is `8px`
|
|
46
|
+
* says the unit is 8 — so nothing extra has to be threaded through to
|
|
47
|
+
* resolve a step that has no rung of its own. Returns 0 when the ladder
|
|
48
|
+
* cannot say, which callers read as "cannot resolve".
|
|
49
|
+
*/ function spacingUnitOf(steps) {
|
|
50
|
+
for (const step of steps != null ? steps : []){
|
|
51
|
+
if (!step || step.value === 0) continue;
|
|
52
|
+
const px = Number.parseFloat(`${step.hint}`);
|
|
53
|
+
if (Number.isFinite(px) && `${step.hint}`.endsWith('px')) {
|
|
54
|
+
const unit = px / step.value;
|
|
55
|
+
if (Number.isFinite(unit) && unit > 0) return unit;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return 0;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The compact text one side of the diagram shows — what the element
|
|
62
|
+
* actually renders, so the diagram reads as a measurement rather than as a
|
|
63
|
+
* vocabulary quiz. `''` when nothing is set, which is the caller's cue to
|
|
64
|
+
* show the side's name instead.
|
|
65
|
+
*
|
|
66
|
+
* A step resolves to its hint (`16px`) so an author comparing two sides is
|
|
67
|
+
* comparing like with like; which of them is theme-backed is carried by
|
|
68
|
+
* the marker and the tooltip, not by making the numbers incomparable.
|
|
69
|
+
*/ export function spacingDisplayText(value, steps) {
|
|
70
|
+
if (!isSpacingSet(value)) return '';
|
|
71
|
+
const step = findSpacingStep(value, steps);
|
|
72
|
+
if (step) return step.hint;
|
|
73
|
+
// A number the current theme has no rung for is still a valid step, and
|
|
74
|
+
// it is common — `p: 10` is an ordinary thing to find on a hero. It is
|
|
75
|
+
// resolved through the theme's own unit rather than shown as `10×`,
|
|
76
|
+
// which named the step but not the amount, and so could not be compared
|
|
77
|
+
// with the `32px` sitting next to it.
|
|
78
|
+
if (typeof value === 'number') {
|
|
79
|
+
const unit = spacingUnitOf(steps);
|
|
80
|
+
return unit ? `${Math.round(value * unit * 100) / 100}px` : `${value}×`;
|
|
81
|
+
}
|
|
82
|
+
return `${value}`;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The long form used in tooltips and the editor's title, e.g.
|
|
86
|
+
* `Medium (theme spacing) — 16px`. Names the theme connection explicitly,
|
|
87
|
+
* because that is the property an author cannot see from the number.
|
|
88
|
+
*/ export function spacingDescription(value, steps) {
|
|
89
|
+
if (!isSpacingSet(value)) return 'Not set';
|
|
90
|
+
const step = findSpacingStep(value, steps);
|
|
91
|
+
if (step) return `${step.label} (theme spacing) — ${step.hint}`;
|
|
92
|
+
if (typeof value === 'number') {
|
|
93
|
+
const unit = spacingUnitOf(steps);
|
|
94
|
+
const resolved = unit ? ` — ${Math.round(value * unit * 100) / 100}px` : '';
|
|
95
|
+
return `${value}× the theme spacing unit${resolved}`;
|
|
96
|
+
}
|
|
97
|
+
return `${value}`;
|
|
98
|
+
}
|
|
99
|
+
/* ── Units ────────────────────────────────────────────────────────────── */ /** How the unit menu groups itself, so a long list stays readable. */ export const UNIT_GROUPS = [
|
|
100
|
+
{
|
|
101
|
+
label: 'Common',
|
|
102
|
+
units: [
|
|
103
|
+
CssUnit.PIXELS,
|
|
104
|
+
CssUnit.REM,
|
|
105
|
+
CssUnit.EM,
|
|
106
|
+
CssUnit.PERCENT
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
label: 'Relative to text',
|
|
111
|
+
units: [
|
|
112
|
+
CssUnit.CH
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
label: 'Relative to the screen',
|
|
117
|
+
units: [
|
|
118
|
+
CssUnit.VIEWPORT_WIDTH,
|
|
119
|
+
CssUnit.VIEWPORT_HEIGHT,
|
|
120
|
+
CssUnit.SMALL_VIEWPORT_WIDTH,
|
|
121
|
+
CssUnit.SMALL_VIEWPORT_HEIGHT,
|
|
122
|
+
CssUnit.LARGE_VIEWPORT_WIDTH,
|
|
123
|
+
CssUnit.LARGE_VIEWPORT_HEIGHT,
|
|
124
|
+
CssUnit.DYNAMIC_VIEWPORT_WIDTH,
|
|
125
|
+
CssUnit.DYNAMIC_VIEWPORT_HEIGHT,
|
|
126
|
+
CssUnit.VIEWPORT_MIN,
|
|
127
|
+
CssUnit.VIEWPORT_MAX
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
label: 'Keywords',
|
|
132
|
+
units: [
|
|
133
|
+
CssUnit.AUTO,
|
|
134
|
+
CssUnit.INHERIT,
|
|
135
|
+
CssUnit.INITIAL,
|
|
136
|
+
CssUnit.UNSET
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
label: 'Print',
|
|
141
|
+
units: [
|
|
142
|
+
CssUnit.POINTS,
|
|
143
|
+
CssUnit.PICAS,
|
|
144
|
+
CssUnit.MILLIMETERS,
|
|
145
|
+
CssUnit.CENTIMETERS,
|
|
146
|
+
CssUnit.INCHES
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
];
|
|
150
|
+
/**
|
|
151
|
+
* Units in the shared list that are NOT lengths, and so are never offered
|
|
152
|
+
* as an amount of space.
|
|
153
|
+
*
|
|
154
|
+
* `dpi` is a resolution — it answers "how dense are the dots?", not "how
|
|
155
|
+
* far?" — and `margin-top: 2dpi` is not a thing. It is named here rather
|
|
156
|
+
* than quietly left out so the coverage check below stays a real check:
|
|
157
|
+
* a unit added to `CssUnit` and forgotten still fails.
|
|
158
|
+
*/ export const UNITS_NOT_SPACING = [
|
|
159
|
+
CssUnit.DPI
|
|
160
|
+
];
|
|
161
|
+
/**
|
|
162
|
+
* The plain-language gloss shown beside each unit in the menu — the
|
|
163
|
+
* one-line version of what the docs page explains at length.
|
|
164
|
+
*/ export const UNIT_GLOSS = {
|
|
165
|
+
[CssUnit.PIXELS]: 'a fixed dot on screen',
|
|
166
|
+
[CssUnit.REM]: "multiples of the page's base text size",
|
|
167
|
+
[CssUnit.EM]: "multiples of THIS element's text size",
|
|
168
|
+
[CssUnit.PERCENT]: "a share of the parent's width",
|
|
169
|
+
[CssUnit.CH]: 'the width of one character',
|
|
170
|
+
[CssUnit.VIEWPORT_WIDTH]: '1% of the window width',
|
|
171
|
+
[CssUnit.VIEWPORT_HEIGHT]: '1% of the window height',
|
|
172
|
+
[CssUnit.SMALL_VIEWPORT_WIDTH]: 'window width at its smallest',
|
|
173
|
+
[CssUnit.SMALL_VIEWPORT_HEIGHT]: 'window height with the address bar showing',
|
|
174
|
+
[CssUnit.LARGE_VIEWPORT_WIDTH]: 'window width at its largest',
|
|
175
|
+
[CssUnit.LARGE_VIEWPORT_HEIGHT]: 'window height with the address bar hidden',
|
|
176
|
+
[CssUnit.DYNAMIC_VIEWPORT_WIDTH]: 'window width right now',
|
|
177
|
+
[CssUnit.DYNAMIC_VIEWPORT_HEIGHT]: 'window height right now',
|
|
178
|
+
[CssUnit.VIEWPORT_MIN]: 'the smaller of the two window sides',
|
|
179
|
+
[CssUnit.VIEWPORT_MAX]: 'the larger of the two window sides',
|
|
180
|
+
[CssUnit.AUTO]: 'let the browser decide',
|
|
181
|
+
[CssUnit.INHERIT]: 'take the parent’s value',
|
|
182
|
+
[CssUnit.INITIAL]: "back to CSS's own default",
|
|
183
|
+
[CssUnit.UNSET]: 'inherit, or reset if it cannot',
|
|
184
|
+
[CssUnit.POINTS]: 'points, as in print',
|
|
185
|
+
[CssUnit.PICAS]: 'picas (12 points)',
|
|
186
|
+
[CssUnit.MILLIMETERS]: 'millimetres, for print',
|
|
187
|
+
[CssUnit.CENTIMETERS]: 'centimetres, for print',
|
|
188
|
+
[CssUnit.INCHES]: 'inches, for print'
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Which section of the responsive-styling page explains a unit
|
|
192
|
+
* (AGL-2486, item 5).
|
|
193
|
+
*
|
|
194
|
+
* Typed against the page's REAL heading anchors, so renaming a docs
|
|
195
|
+
* heading turns this map into a compile error rather than a dead link —
|
|
196
|
+
* which is the point of the generated registry.
|
|
197
|
+
*/ const UNIT_ANCHORS = {
|
|
198
|
+
[CssUnit.PIXELS]: '#unit-px',
|
|
199
|
+
[CssUnit.REM]: '#unit-rem',
|
|
200
|
+
[CssUnit.EM]: '#unit-em',
|
|
201
|
+
[CssUnit.PERCENT]: '#unit-percent',
|
|
202
|
+
[CssUnit.CH]: '#unit-ch',
|
|
203
|
+
[CssUnit.VIEWPORT_WIDTH]: '#unit-viewport',
|
|
204
|
+
[CssUnit.VIEWPORT_HEIGHT]: '#unit-viewport',
|
|
205
|
+
[CssUnit.VIEWPORT_MIN]: '#unit-viewport',
|
|
206
|
+
[CssUnit.VIEWPORT_MAX]: '#unit-viewport',
|
|
207
|
+
[CssUnit.SMALL_VIEWPORT_WIDTH]: '#unit-small-viewport',
|
|
208
|
+
[CssUnit.SMALL_VIEWPORT_HEIGHT]: '#unit-small-viewport',
|
|
209
|
+
[CssUnit.LARGE_VIEWPORT_WIDTH]: '#unit-small-viewport',
|
|
210
|
+
[CssUnit.LARGE_VIEWPORT_HEIGHT]: '#unit-small-viewport',
|
|
211
|
+
[CssUnit.DYNAMIC_VIEWPORT_WIDTH]: '#unit-small-viewport',
|
|
212
|
+
[CssUnit.DYNAMIC_VIEWPORT_HEIGHT]: '#unit-small-viewport'
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* The docs anchor for a unit. Units with no section of their own fall back
|
|
216
|
+
* to the custom-amounts section, so every entry in the menu has somewhere
|
|
217
|
+
* to send an author who does not recognise it.
|
|
218
|
+
*/ export function unitDocsAnchor(unit) {
|
|
219
|
+
var _UNIT_ANCHORS_unit;
|
|
220
|
+
return (_UNIT_ANCHORS_unit = UNIT_ANCHORS[unit]) != null ? _UNIT_ANCHORS_unit : '#spacing-custom-amounts';
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
//# sourceMappingURL=spacing-value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/box-styler/spacing-value.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 { CssUnit } from '@aglyn/shared-data-enums'\nimport type { SpacingScaleOption } from '../utils/theme-scale-options'\nimport type { BesignerDocsAnchor } from '../utils/docs-help'\n\n/**\n * The box styler's value logic (AGL-2486, item 5), kept apart from the\n * components so the rules can be asserted rather than described.\n *\n * A side of the box holds one of three things, and telling them apart is\n * the whole job:\n *\n * - a **theme spacing step**, stored as a NUMBER, which MUI resolves\n * through `theme.spacing` at render (`2` → 16px under `spacing: 8`);\n * - a **custom amount**, stored as a CSS string (`'12px'`, `'2rem'`,\n * `'auto'`);\n * - **nothing** — the property is absent and the element inherits.\n *\n * `0` belongs to the first group, not the third. It means \"no space\", it\n * renders as `0px`, and it is the value an author picks to cancel space a\n * parent or a preset put there. `strictNullChecks` is off repo-wide, so\n * every `if (!value)` in this file's neighbourhood would have silently\n * folded that answer into \"unset\" — hence the explicit predicates below.\n */\n\n/** A box spacing value as STORED: a theme step, or a CSS string. */\nexport type BoxSpacingValue = string | number | undefined\n\n/**\n * Whether the author has set this side at all.\n *\n * The one that matters: `isSpacingSet(0)` is TRUE. `0` is a decision, and\n * an editor that reads it as \"unset\" both hides it from the author and\n * loses it on the next write.\n */\nexport function isSpacingSet(value: BoxSpacingValue): boolean {\n if (value === undefined || value === null) return false\n if (typeof value === 'number') return Number.isFinite(value)\n return `${value}`.trim() !== ''\n}\n\n/**\n * Whether this value is a theme spacing step — the form that keeps\n * following the theme — rather than a flattened CSS string.\n *\n * A numeric STRING is deliberately not a step: MUI passes strings through\n * untouched, so `'2'` reaches the browser as `margin-top: 2` and is\n * dropped by the CSS parser. Only a real number is resolved.\n */\nexport function isThemeSpacingStep(value: BoxSpacingValue): boolean {\n return typeof value === 'number' && Number.isFinite(value)\n}\n\n/** The ladder entry a stored value corresponds to, if any. */\nexport function findSpacingStep(\n value: BoxSpacingValue,\n steps: readonly SpacingScaleOption[],\n): SpacingScaleOption | undefined {\n if (!isThemeSpacingStep(value)) return undefined\n return (steps ?? []).find((step) => step.value === value)\n}\n\n/**\n * The theme's spacing UNIT, inferred from the ladder itself.\n *\n * The ladder already carries the answer — a rung of 1 whose hint is `8px`\n * says the unit is 8 — so nothing extra has to be threaded through to\n * resolve a step that has no rung of its own. Returns 0 when the ladder\n * cannot say, which callers read as \"cannot resolve\".\n */\nfunction spacingUnitOf(steps: readonly SpacingScaleOption[]): number {\n for (const step of steps ?? []) {\n if (!step || step.value === 0) continue\n const px = Number.parseFloat(`${step.hint}`)\n if (Number.isFinite(px) && `${step.hint}`.endsWith('px')) {\n const unit = px / step.value\n if (Number.isFinite(unit) && unit > 0) return unit\n }\n }\n return 0\n}\n\n/**\n * The compact text one side of the diagram shows — what the element\n * actually renders, so the diagram reads as a measurement rather than as a\n * vocabulary quiz. `''` when nothing is set, which is the caller's cue to\n * show the side's name instead.\n *\n * A step resolves to its hint (`16px`) so an author comparing two sides is\n * comparing like with like; which of them is theme-backed is carried by\n * the marker and the tooltip, not by making the numbers incomparable.\n */\nexport function spacingDisplayText(\n value: BoxSpacingValue,\n steps: readonly SpacingScaleOption[],\n): string {\n if (!isSpacingSet(value)) return ''\n const step = findSpacingStep(value, steps)\n if (step) return step.hint\n // A number the current theme has no rung for is still a valid step, and\n // it is common — `p: 10` is an ordinary thing to find on a hero. It is\n // resolved through the theme's own unit rather than shown as `10×`,\n // which named the step but not the amount, and so could not be compared\n // with the `32px` sitting next to it.\n if (typeof value === 'number') {\n const unit = spacingUnitOf(steps)\n return unit ? `${Math.round(value * unit * 100) / 100}px` : `${value}×`\n }\n return `${value}`\n}\n\n/**\n * The long form used in tooltips and the editor's title, e.g.\n * `Medium (theme spacing) — 16px`. Names the theme connection explicitly,\n * because that is the property an author cannot see from the number.\n */\nexport function spacingDescription(\n value: BoxSpacingValue,\n steps: readonly SpacingScaleOption[],\n): string {\n if (!isSpacingSet(value)) return 'Not set'\n const step = findSpacingStep(value, steps)\n if (step) return `${step.label} (theme spacing) — ${step.hint}`\n if (typeof value === 'number') {\n const unit = spacingUnitOf(steps)\n const resolved = unit ? ` — ${Math.round(value * unit * 100) / 100}px` : ''\n return `${value}× the theme spacing unit${resolved}`\n }\n return `${value}`\n}\n\n/* ── Units ────────────────────────────────────────────────────────────── */\n\n/** How the unit menu groups itself, so a long list stays readable. */\nexport const UNIT_GROUPS: ReadonlyArray<{\n label: string\n units: readonly CssUnit[]\n}> = [\n {\n label: 'Common',\n units: [CssUnit.PIXELS, CssUnit.REM, CssUnit.EM, CssUnit.PERCENT],\n },\n { label: 'Relative to text', units: [CssUnit.CH] },\n {\n label: 'Relative to the screen',\n units: [\n CssUnit.VIEWPORT_WIDTH,\n CssUnit.VIEWPORT_HEIGHT,\n CssUnit.SMALL_VIEWPORT_WIDTH,\n CssUnit.SMALL_VIEWPORT_HEIGHT,\n CssUnit.LARGE_VIEWPORT_WIDTH,\n CssUnit.LARGE_VIEWPORT_HEIGHT,\n CssUnit.DYNAMIC_VIEWPORT_WIDTH,\n CssUnit.DYNAMIC_VIEWPORT_HEIGHT,\n CssUnit.VIEWPORT_MIN,\n CssUnit.VIEWPORT_MAX,\n ],\n },\n {\n label: 'Keywords',\n units: [CssUnit.AUTO, CssUnit.INHERIT, CssUnit.INITIAL, CssUnit.UNSET],\n },\n {\n label: 'Print',\n units: [\n CssUnit.POINTS,\n CssUnit.PICAS,\n CssUnit.MILLIMETERS,\n CssUnit.CENTIMETERS,\n CssUnit.INCHES,\n ],\n },\n]\n\n/**\n * Units in the shared list that are NOT lengths, and so are never offered\n * as an amount of space.\n *\n * `dpi` is a resolution — it answers \"how dense are the dots?\", not \"how\n * far?\" — and `margin-top: 2dpi` is not a thing. It is named here rather\n * than quietly left out so the coverage check below stays a real check:\n * a unit added to `CssUnit` and forgotten still fails.\n */\nexport const UNITS_NOT_SPACING: readonly CssUnit[] = [CssUnit.DPI]\n\n/**\n * The plain-language gloss shown beside each unit in the menu — the\n * one-line version of what the docs page explains at length.\n */\nexport const UNIT_GLOSS: Partial<Record<CssUnit, string>> = {\n [CssUnit.PIXELS]: 'a fixed dot on screen',\n [CssUnit.REM]: \"multiples of the page's base text size\",\n [CssUnit.EM]: \"multiples of THIS element's text size\",\n [CssUnit.PERCENT]: \"a share of the parent's width\",\n [CssUnit.CH]: 'the width of one character',\n [CssUnit.VIEWPORT_WIDTH]: '1% of the window width',\n [CssUnit.VIEWPORT_HEIGHT]: '1% of the window height',\n [CssUnit.SMALL_VIEWPORT_WIDTH]: 'window width at its smallest',\n [CssUnit.SMALL_VIEWPORT_HEIGHT]: 'window height with the address bar showing',\n [CssUnit.LARGE_VIEWPORT_WIDTH]: 'window width at its largest',\n [CssUnit.LARGE_VIEWPORT_HEIGHT]: 'window height with the address bar hidden',\n [CssUnit.DYNAMIC_VIEWPORT_WIDTH]: 'window width right now',\n [CssUnit.DYNAMIC_VIEWPORT_HEIGHT]: 'window height right now',\n [CssUnit.VIEWPORT_MIN]: 'the smaller of the two window sides',\n [CssUnit.VIEWPORT_MAX]: 'the larger of the two window sides',\n [CssUnit.AUTO]: 'let the browser decide',\n [CssUnit.INHERIT]: 'take the parent’s value',\n [CssUnit.INITIAL]: \"back to CSS's own default\",\n [CssUnit.UNSET]: 'inherit, or reset if it cannot',\n [CssUnit.POINTS]: 'points, as in print',\n [CssUnit.PICAS]: 'picas (12 points)',\n [CssUnit.MILLIMETERS]: 'millimetres, for print',\n [CssUnit.CENTIMETERS]: 'centimetres, for print',\n [CssUnit.INCHES]: 'inches, for print',\n}\n\ntype ResponsiveStylingAnchor = BesignerDocsAnchor<'responsiveStyling'>\n\n/**\n * Which section of the responsive-styling page explains a unit\n * (AGL-2486, item 5).\n *\n * Typed against the page's REAL heading anchors, so renaming a docs\n * heading turns this map into a compile error rather than a dead link —\n * which is the point of the generated registry.\n */\nconst UNIT_ANCHORS: Partial<Record<CssUnit, ResponsiveStylingAnchor>> = {\n [CssUnit.PIXELS]: '#unit-px',\n [CssUnit.REM]: '#unit-rem',\n [CssUnit.EM]: '#unit-em',\n [CssUnit.PERCENT]: '#unit-percent',\n [CssUnit.CH]: '#unit-ch',\n [CssUnit.VIEWPORT_WIDTH]: '#unit-viewport',\n [CssUnit.VIEWPORT_HEIGHT]: '#unit-viewport',\n [CssUnit.VIEWPORT_MIN]: '#unit-viewport',\n [CssUnit.VIEWPORT_MAX]: '#unit-viewport',\n [CssUnit.SMALL_VIEWPORT_WIDTH]: '#unit-small-viewport',\n [CssUnit.SMALL_VIEWPORT_HEIGHT]: '#unit-small-viewport',\n [CssUnit.LARGE_VIEWPORT_WIDTH]: '#unit-small-viewport',\n [CssUnit.LARGE_VIEWPORT_HEIGHT]: '#unit-small-viewport',\n [CssUnit.DYNAMIC_VIEWPORT_WIDTH]: '#unit-small-viewport',\n [CssUnit.DYNAMIC_VIEWPORT_HEIGHT]: '#unit-small-viewport',\n}\n\n/**\n * The docs anchor for a unit. Units with no section of their own fall back\n * to the custom-amounts section, so every entry in the menu has somewhere\n * to send an author who does not recognise it.\n */\nexport function unitDocsAnchor(unit: CssUnit): ResponsiveStylingAnchor {\n return UNIT_ANCHORS[unit] ?? '#spacing-custom-amounts'\n}\n"],"names":["CssUnit","isSpacingSet","value","undefined","Number","isFinite","trim","isThemeSpacingStep","findSpacingStep","steps","find","step","spacingUnitOf","px","parseFloat","hint","endsWith","unit","spacingDisplayText","Math","round","spacingDescription","label","resolved","UNIT_GROUPS","units","PIXELS","REM","EM","PERCENT","CH","VIEWPORT_WIDTH","VIEWPORT_HEIGHT","SMALL_VIEWPORT_WIDTH","SMALL_VIEWPORT_HEIGHT","LARGE_VIEWPORT_WIDTH","LARGE_VIEWPORT_HEIGHT","DYNAMIC_VIEWPORT_WIDTH","DYNAMIC_VIEWPORT_HEIGHT","VIEWPORT_MIN","VIEWPORT_MAX","AUTO","INHERIT","INITIAL","UNSET","POINTS","PICAS","MILLIMETERS","CENTIMETERS","INCHES","UNITS_NOT_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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 { BoxSpacingValue } from './spacing-value';
|
|
18
|
+
/**
|
|
19
|
+
* A side's value is `string | number`, NOT the `CSSStyleDeclaration` string
|
|
20
|
+
* these types used to borrow (AGL-2486).
|
|
21
|
+
*
|
|
22
|
+
* The narrower type was not merely inconvenient — it was the bug. A theme
|
|
23
|
+
* spacing step is stored as a NUMBER so MUI resolves it through
|
|
24
|
+
* `theme.spacing`, and a string-only type meant the styler could neither
|
|
25
|
+
* read one an author already had nor ever write a new one.
|
|
26
|
+
*/
|
|
27
|
+
export type PaddingMeasurements = Partial<Record<'paddingTop' | 'paddingRight' | 'paddingBottom' | 'paddingLeft', BoxSpacingValue>>;
|
|
28
|
+
export type MarginMeasurements = Partial<Record<'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft', BoxSpacingValue>>;
|
|
29
|
+
export type Measurements = PaddingMeasurements & MarginMeasurements;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 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
|
+
*/ export { };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/box-styler/types.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2022 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 { BoxSpacingValue } from './spacing-value'\n\n/**\n * A side's value is `string | number`, NOT the `CSSStyleDeclaration` string\n * these types used to borrow (AGL-2486).\n *\n * The narrower type was not merely inconvenient — it was the bug. A theme\n * spacing step is stored as a NUMBER so MUI resolves it through\n * `theme.spacing`, and a string-only type meant the styler could neither\n * read one an author already had nor ever write a new one.\n */\nexport type PaddingMeasurements = Partial<\n Record<\n 'paddingTop' | 'paddingRight' | 'paddingBottom' | 'paddingLeft',\n BoxSpacingValue\n >\n>\nexport type MarginMeasurements = Partial<\n Record<\n 'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft',\n BoxSpacingValue\n >\n>\nexport type Measurements = PaddingMeasurements & MarginMeasurements\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAyBD,WAAmE"}
|
|
@@ -0,0 +1,50 @@
|
|
|
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 HelpTipContent } from '@aglyn/shared-ui-jsx';
|
|
18
|
+
import { type AccordionDetailsProps as MuiAccordionDetailsProps, AccordionProps as MuiAccordionProps, type AccordionSummaryProps as MuiAccordionSummaryProps } from '@mui/material';
|
|
19
|
+
export interface AccordionProps extends MuiAccordionProps {
|
|
20
|
+
AccordionSummaryProps?: MuiAccordionSummaryProps;
|
|
21
|
+
AccordionDetailsProps?: MuiAccordionDetailsProps;
|
|
22
|
+
summary?: JSX.Children;
|
|
23
|
+
/** Contextual help affordance rendered after the summary label (AGL-600). */
|
|
24
|
+
help?: HelpTipContent;
|
|
25
|
+
}
|
|
26
|
+
export declare const Accordion: import("react").ForwardRefExoticComponent<Omit<AccordionProps, "ref"> & import("react").RefAttributes<any>>;
|
|
27
|
+
export interface AccordionListProps<T = any> {
|
|
28
|
+
items: T[];
|
|
29
|
+
unique?: boolean;
|
|
30
|
+
defaultExpanded?: JSX.Key[];
|
|
31
|
+
AccordionProps?: MuiAccordionProps;
|
|
32
|
+
AccordionSummaryProps?: MuiAccordionSummaryProps;
|
|
33
|
+
AccordionDetailsProps?: MuiAccordionDetailsProps;
|
|
34
|
+
onRenderSummary: (props: {
|
|
35
|
+
item: T;
|
|
36
|
+
}) => JSX.Children;
|
|
37
|
+
onRenderDetail: (props: {
|
|
38
|
+
item: T;
|
|
39
|
+
}) => JSX.Children;
|
|
40
|
+
getItemId: (item: T) => string | number;
|
|
41
|
+
/** Per-item help affordance on the accordion summary (AGL-2167). Returns
|
|
42
|
+
* undefined for the groups that need no explanation, so a list can help
|
|
43
|
+
* one group without captioning every one of them — which `AccordionProps`
|
|
44
|
+
* cannot do, since it applies to all of them alike. */
|
|
45
|
+
getItemHelp?: (item: T) => HelpTipContent | undefined;
|
|
46
|
+
}
|
|
47
|
+
export declare const AccordionListComponent: (<T>(props: AccordionListProps<T>) => import("react").JSX.Element) & {
|
|
48
|
+
displayName: string;
|
|
49
|
+
};
|
|
50
|
+
export default AccordionListComponent;
|