@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,240 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
* Copyright 2023 Aglyn LLC
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/ import { FIELD_MUTED_STYLES, FieldMuteButton } from "@aglyn/shared-ui-jsx-forms";
|
|
19
|
+
import { Box, Collapse, Stack, ToggleButton, ToggleButtonGroup, Tooltip, Typography } from "@mui/material";
|
|
20
|
+
import { forwardRef, useCallback, useEffect, useRef, useState } from "react";
|
|
21
|
+
import BoxDiagram, { SIDE_LABELS } from "./components/box-diagram.js";
|
|
22
|
+
import Legend, { LegendItem } from "./components/legend.js";
|
|
23
|
+
import SpacingEditor from "./components/spacing-editor.js";
|
|
24
|
+
const MARGIN_KEYS = [
|
|
25
|
+
'marginTop',
|
|
26
|
+
'marginRight',
|
|
27
|
+
'marginBottom',
|
|
28
|
+
'marginLeft'
|
|
29
|
+
];
|
|
30
|
+
const PADDING_KEYS = [
|
|
31
|
+
'paddingTop',
|
|
32
|
+
'paddingRight',
|
|
33
|
+
'paddingBottom',
|
|
34
|
+
'paddingLeft'
|
|
35
|
+
];
|
|
36
|
+
/** The keys an edit to `key` writes, given the active scope. */ export function boxScopeKeys(key, scope) {
|
|
37
|
+
const group = key.startsWith('margin') ? MARGIN_KEYS : PADDING_KEYS;
|
|
38
|
+
if (scope === 'all') return [
|
|
39
|
+
...group
|
|
40
|
+
];
|
|
41
|
+
if (scope === 'axis') {
|
|
42
|
+
const vertical = key.endsWith('Top') || key.endsWith('Bottom');
|
|
43
|
+
return group.filter((item)=>vertical ? item.endsWith('Top') || item.endsWith('Bottom') : item.endsWith('Left') || item.endsWith('Right'));
|
|
44
|
+
}
|
|
45
|
+
return [
|
|
46
|
+
key
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
export const BoxStyler = /*#__PURE__*/ forwardRef(({ measurements, spacingSteps, border, onChange, muteForSide }, ref)=>{
|
|
50
|
+
const [scope, setScope] = useState('each');
|
|
51
|
+
const [editing, setEditing] = useState(null);
|
|
52
|
+
/**
|
|
53
|
+
* The side the collapsing panel keeps showing on the way OUT (AGL-2486).
|
|
54
|
+
*
|
|
55
|
+
* `<Collapse in={...}>{editing ? <Editor/> : null}</Collapse>` opens
|
|
56
|
+
* with an animation and closes with none: the moment `editing` goes
|
|
57
|
+
* null the child is replaced by `null`, so the content is gone before
|
|
58
|
+
* `Collapse` has begun its exit and all one sees is a jump. Holding
|
|
59
|
+
* the last side lets the editor stay mounted for the length of the
|
|
60
|
+
* exit, and `unmountOnExit` on the Collapse — which runs AFTER the
|
|
61
|
+
* transition, not instead of it — does the removal. Closing is then
|
|
62
|
+
* the reverse of opening, which is the whole ask.
|
|
63
|
+
*/ const lastEditing = useRef(null);
|
|
64
|
+
useEffect(()=>{
|
|
65
|
+
if (editing) lastEditing.current = editing;
|
|
66
|
+
}, [
|
|
67
|
+
editing
|
|
68
|
+
]);
|
|
69
|
+
const shown = editing != null ? editing : lastEditing.current;
|
|
70
|
+
// Each side is its own sx declaration, so the mute is resolved for the
|
|
71
|
+
// side on screen rather than for the box as a whole.
|
|
72
|
+
const sideMute = shown ? muteForSide == null ? void 0 : muteForSide(shown, SIDE_LABELS[shown]) : undefined;
|
|
73
|
+
const handleSelect = useCallback((key)=>setEditing((prev)=>prev === key ? null : key), []);
|
|
74
|
+
const handleChange = useCallback((key)=>(value)=>{
|
|
75
|
+
const res = _extends({}, measurements);
|
|
76
|
+
for (const target of boxScopeKeys(key, scope)){
|
|
77
|
+
// The value is stored AS GIVEN: a number stays a number so MUI
|
|
78
|
+
// resolves it through `theme.spacing`, a string stays the CSS
|
|
79
|
+
// length it already is, and `undefined` clears the property.
|
|
80
|
+
// The old handler ran everything through `buildCssMeasurement`
|
|
81
|
+
// first, which is why a step could never be written from here.
|
|
82
|
+
res[target] = value;
|
|
83
|
+
}
|
|
84
|
+
onChange == null ? void 0 : onChange(res);
|
|
85
|
+
}, [
|
|
86
|
+
onChange,
|
|
87
|
+
measurements,
|
|
88
|
+
scope
|
|
89
|
+
]);
|
|
90
|
+
return /*#__PURE__*/ _jsxs(Box, {
|
|
91
|
+
ref: ref,
|
|
92
|
+
children: [
|
|
93
|
+
/*#__PURE__*/ _jsxs(Box, {
|
|
94
|
+
sx: {
|
|
95
|
+
display: 'flex',
|
|
96
|
+
alignItems: 'center',
|
|
97
|
+
justifyContent: 'space-between',
|
|
98
|
+
mb: 1
|
|
99
|
+
},
|
|
100
|
+
children: [
|
|
101
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
102
|
+
variant: "caption",
|
|
103
|
+
color: "text.secondary",
|
|
104
|
+
children: 'Apply to'
|
|
105
|
+
}),
|
|
106
|
+
/*#__PURE__*/ _jsxs(ToggleButtonGroup, {
|
|
107
|
+
size: "small",
|
|
108
|
+
exclusive: true,
|
|
109
|
+
value: scope,
|
|
110
|
+
onChange: (event, value)=>value && setScope(value),
|
|
111
|
+
children: [
|
|
112
|
+
/*#__PURE__*/ _jsx(ToggleButton, {
|
|
113
|
+
value: "each",
|
|
114
|
+
sx: {
|
|
115
|
+
px: 1,
|
|
116
|
+
py: 0.25
|
|
117
|
+
},
|
|
118
|
+
children: /*#__PURE__*/ _jsx(Tooltip, {
|
|
119
|
+
title: "Each side individually",
|
|
120
|
+
children: /*#__PURE__*/ _jsx("span", {
|
|
121
|
+
children: 'Side'
|
|
122
|
+
})
|
|
123
|
+
})
|
|
124
|
+
}),
|
|
125
|
+
/*#__PURE__*/ _jsx(ToggleButton, {
|
|
126
|
+
value: "axis",
|
|
127
|
+
sx: {
|
|
128
|
+
px: 1,
|
|
129
|
+
py: 0.25
|
|
130
|
+
},
|
|
131
|
+
children: /*#__PURE__*/ _jsx(Tooltip, {
|
|
132
|
+
title: "Vertical or horizontal pair together",
|
|
133
|
+
children: /*#__PURE__*/ _jsx("span", {
|
|
134
|
+
children: 'Axis'
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
}),
|
|
138
|
+
/*#__PURE__*/ _jsx(ToggleButton, {
|
|
139
|
+
value: "all",
|
|
140
|
+
sx: {
|
|
141
|
+
px: 1,
|
|
142
|
+
py: 0.25
|
|
143
|
+
},
|
|
144
|
+
children: /*#__PURE__*/ _jsx(Tooltip, {
|
|
145
|
+
title: "All four sides together",
|
|
146
|
+
children: /*#__PURE__*/ _jsx("span", {
|
|
147
|
+
children: 'All'
|
|
148
|
+
})
|
|
149
|
+
})
|
|
150
|
+
})
|
|
151
|
+
]
|
|
152
|
+
})
|
|
153
|
+
]
|
|
154
|
+
}),
|
|
155
|
+
/*#__PURE__*/ _jsx(BoxDiagram, {
|
|
156
|
+
measurements: measurements,
|
|
157
|
+
steps: spacingSteps,
|
|
158
|
+
border: border,
|
|
159
|
+
editing: editing != null ? editing : undefined,
|
|
160
|
+
onSelect: handleSelect
|
|
161
|
+
}),
|
|
162
|
+
/*#__PURE__*/ _jsx(Collapse, {
|
|
163
|
+
in: Boolean(editing),
|
|
164
|
+
unmountOnExit: true,
|
|
165
|
+
children: shown ? /*#__PURE__*/ _jsxs(Stack, {
|
|
166
|
+
sx: [
|
|
167
|
+
{
|
|
168
|
+
mt: 1
|
|
169
|
+
},
|
|
170
|
+
(sideMute == null ? void 0 : sideMute.muted) ? FIELD_MUTED_STYLES : null
|
|
171
|
+
],
|
|
172
|
+
children: [
|
|
173
|
+
/*#__PURE__*/ _jsxs(Box, {
|
|
174
|
+
sx: {
|
|
175
|
+
display: 'flex',
|
|
176
|
+
alignItems: 'center',
|
|
177
|
+
gap: 0.5
|
|
178
|
+
},
|
|
179
|
+
children: [
|
|
180
|
+
/*#__PURE__*/ _jsxs(Typography, {
|
|
181
|
+
variant: "caption",
|
|
182
|
+
sx: {
|
|
183
|
+
fontWeight: 600
|
|
184
|
+
},
|
|
185
|
+
children: [
|
|
186
|
+
SIDE_LABELS[shown],
|
|
187
|
+
scope && scope !== 'each' ? ` (${scope})` : ''
|
|
188
|
+
]
|
|
189
|
+
}),
|
|
190
|
+
/*#__PURE__*/ _jsx(FieldMuteButton, {
|
|
191
|
+
mute: sideMute
|
|
192
|
+
})
|
|
193
|
+
]
|
|
194
|
+
}),
|
|
195
|
+
/*#__PURE__*/ _jsx(SpacingEditor, {
|
|
196
|
+
value: measurements == null ? void 0 : measurements[shown],
|
|
197
|
+
steps: spacingSteps,
|
|
198
|
+
label: SIDE_LABELS[shown],
|
|
199
|
+
// `auto` is offered on the MARGIN sides only. It is the
|
|
200
|
+
// standard way to centre an element and the diagram
|
|
201
|
+
// already draws it there — but `padding: auto` is not
|
|
202
|
+
// valid CSS, so on a padding side it would be a menu
|
|
203
|
+
// entry that silently does nothing.
|
|
204
|
+
allowAuto: shown.startsWith('margin'),
|
|
205
|
+
onChange: handleChange(shown)
|
|
206
|
+
}, shown)
|
|
207
|
+
]
|
|
208
|
+
}) : null
|
|
209
|
+
}),
|
|
210
|
+
/*#__PURE__*/ _jsxs(Legend, {
|
|
211
|
+
direction: "row",
|
|
212
|
+
spacing: 1,
|
|
213
|
+
sx: {
|
|
214
|
+
alignItems: 'center',
|
|
215
|
+
justifyContent: 'space-around',
|
|
216
|
+
mt: 1,
|
|
217
|
+
mb: 2
|
|
218
|
+
},
|
|
219
|
+
children: [
|
|
220
|
+
/*#__PURE__*/ _jsx(LegendItem, {
|
|
221
|
+
item: 'margin'
|
|
222
|
+
}),
|
|
223
|
+
/*#__PURE__*/ _jsx(LegendItem, {
|
|
224
|
+
item: 'border'
|
|
225
|
+
}),
|
|
226
|
+
/*#__PURE__*/ _jsx(LegendItem, {
|
|
227
|
+
item: 'padding'
|
|
228
|
+
}),
|
|
229
|
+
/*#__PURE__*/ _jsx(LegendItem, {
|
|
230
|
+
item: 'contents'
|
|
231
|
+
})
|
|
232
|
+
]
|
|
233
|
+
})
|
|
234
|
+
]
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
BoxStyler.displayName = 'BoxStyler';
|
|
238
|
+
export default BoxStyler;
|
|
239
|
+
|
|
240
|
+
//# sourceMappingURL=box-styler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/box-styler/box-styler.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2023 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n type FieldMuteAction,\n FIELD_MUTED_STYLES,\n FieldMuteButton,\n} from '@aglyn/shared-ui-jsx-forms'\nimport {\n Box,\n Collapse,\n Stack,\n ToggleButton,\n ToggleButtonGroup,\n Tooltip,\n Typography,\n} from '@mui/material'\nimport { forwardRef, useCallback, useEffect, useRef, useState } from 'react'\n\nimport type { SpacingScaleOption } from '../utils/theme-scale-options'\nimport BoxDiagram, { SIDE_LABELS } from './components/box-diagram'\nimport Legend, { LegendItem } from './components/legend'\nimport SpacingEditor from './components/spacing-editor'\nimport type { BoxSpacingValue } from './spacing-value'\nimport type { Measurements } from './types'\n\nexport type { Measurements }\n\n/**\n * The box/spacing styler — ONE implementation (AGL-2486, item 5).\n *\n * There were two, stacked one above the other in the same panel: this\n * trapezoid diagram, and a second nested-box diagram with eight always-on\n * number fields below it. Both edited the same eight properties and they\n * did not agree — the second was built on `parseCssMeasurement`, which\n * takes a string, so every element carrying a theme spacing step (a\n * number) showed its padding in the first diagram and \"default\" in the\n * second. Worse than confusing: touching a field in the second one\n * replaced a theme-tracking step with a flattened `Npx` string.\n *\n * What survives is the diagram that could already read what was stored,\n * now with the border band the box model actually has, one editor that\n * opens under the side you clicked, and the theme's own spacing ladder as\n * the first answer it offers.\n */\n\n/** How an edit fans out across the box sides (AGL-334). */\nexport type BoxScope = 'each' | 'axis' | 'all'\n\nconst MARGIN_KEYS = [\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n] as const\nconst PADDING_KEYS = [\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n] as const\n\n/** The keys an edit to `key` writes, given the active scope. */\nexport function boxScopeKeys(\n key: keyof Measurements,\n scope: BoxScope,\n): Array<keyof Measurements> {\n const group = key.startsWith('margin') ? MARGIN_KEYS : PADDING_KEYS\n if (scope === 'all') return [...group]\n if (scope === 'axis') {\n const vertical = key.endsWith('Top') || key.endsWith('Bottom')\n return group.filter((item) =>\n vertical\n ? item.endsWith('Top') || item.endsWith('Bottom')\n : item.endsWith('Left') || item.endsWith('Right'),\n )\n }\n return [key]\n}\n\nexport interface BoxStylerProps {\n measurements?: Measurements\n /** The site theme's spacing ladder (AGL-2486). */\n spacingSteps?: readonly SpacingScaleOption[]\n /** The element's border shorthand, drawn in the diagram for context. */\n border?: string\n onChange?: (measurements?: Measurements) => void\n /**\n * The mute control for one side, resolved when that side is opened\n * (AGL-2486). Each side is its own declaration, and the editor shows one\n * at a time, so the eye belongs beside the side's own caption.\n */\n muteForSide?: (side: string, label?: unknown) => FieldMuteAction | undefined\n}\n\nexport const BoxStyler = forwardRef<any, BoxStylerProps>(\n (\n {\n measurements,\n spacingSteps,\n border,\n onChange,\n muteForSide,\n }: BoxStylerProps,\n ref,\n ) => {\n const [scope, setScope] = useState<BoxScope>('each')\n const [editing, setEditing] = useState<keyof Measurements | null>(null)\n\n /**\n * The side the collapsing panel keeps showing on the way OUT (AGL-2486).\n *\n * `<Collapse in={...}>{editing ? <Editor/> : null}</Collapse>` opens\n * with an animation and closes with none: the moment `editing` goes\n * null the child is replaced by `null`, so the content is gone before\n * `Collapse` has begun its exit and all one sees is a jump. Holding\n * the last side lets the editor stay mounted for the length of the\n * exit, and `unmountOnExit` on the Collapse — which runs AFTER the\n * transition, not instead of it — does the removal. Closing is then\n * the reverse of opening, which is the whole ask.\n */\n const lastEditing = useRef<keyof Measurements | null>(null)\n useEffect(() => {\n if (editing) lastEditing.current = editing\n }, [editing])\n const shown = editing ?? lastEditing.current\n // Each side is its own sx declaration, so the mute is resolved for the\n // side on screen rather than for the box as a whole.\n const sideMute = shown\n ? muteForSide?.(shown as string, SIDE_LABELS[shown])\n : undefined\n\n const handleSelect = useCallback(\n (key: keyof Measurements) =>\n setEditing((prev) => (prev === key ? null : key)),\n [],\n )\n\n const handleChange = useCallback(\n (key: keyof Measurements) => (value: BoxSpacingValue) => {\n const res: Measurements = { ...measurements }\n for (const target of boxScopeKeys(key, scope)) {\n // The value is stored AS GIVEN: a number stays a number so MUI\n // resolves it through `theme.spacing`, a string stays the CSS\n // length it already is, and `undefined` clears the property.\n // The old handler ran everything through `buildCssMeasurement`\n // first, which is why a step could never be written from here.\n res[target] = value\n }\n onChange?.(res)\n },\n [onChange, measurements, scope],\n )\n\n return (\n <Box ref={ref}>\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n mb: 1,\n }}\n >\n <Typography variant=\"caption\" color=\"text.secondary\">\n {'Apply to'}\n </Typography>\n <ToggleButtonGroup\n size=\"small\"\n exclusive\n value={scope}\n onChange={(event, value) => value && setScope(value)}\n >\n <ToggleButton value=\"each\" sx={{ px: 1, py: 0.25 }}>\n <Tooltip title=\"Each side individually\">\n <span>{'Side'}</span>\n </Tooltip>\n </ToggleButton>\n <ToggleButton value=\"axis\" sx={{ px: 1, py: 0.25 }}>\n <Tooltip title=\"Vertical or horizontal pair together\">\n <span>{'Axis'}</span>\n </Tooltip>\n </ToggleButton>\n <ToggleButton value=\"all\" sx={{ px: 1, py: 0.25 }}>\n <Tooltip title=\"All four sides together\">\n <span>{'All'}</span>\n </Tooltip>\n </ToggleButton>\n </ToggleButtonGroup>\n </Box>\n\n <BoxDiagram\n measurements={measurements}\n steps={spacingSteps}\n border={border}\n editing={editing ?? undefined}\n onSelect={handleSelect}\n />\n\n <Collapse in={Boolean(editing)} unmountOnExit>\n {shown ? (\n <Stack\n sx={[{ mt: 1 }, sideMute?.muted ? FIELD_MUTED_STYLES : null]}\n >\n <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>\n <Typography variant=\"caption\" sx={{ fontWeight: 600 }}>\n {SIDE_LABELS[shown]}\n {scope && scope !== 'each' ? ` (${scope})` : ''}\n </Typography>\n <FieldMuteButton mute={sideMute} />\n </Box>\n <SpacingEditor\n // Keyed by side so moving between sides remounts the\n // editor rather than carrying the previous one's custom\n // latch across.\n key={shown}\n value={measurements?.[shown]}\n steps={spacingSteps}\n label={SIDE_LABELS[shown]}\n // `auto` is offered on the MARGIN sides only. It is the\n // standard way to centre an element and the diagram\n // already draws it there — but `padding: auto` is not\n // valid CSS, so on a padding side it would be a menu\n // entry that silently does nothing.\n allowAuto={shown.startsWith('margin')}\n onChange={handleChange(shown)}\n />\n </Stack>\n ) : null}\n </Collapse>\n\n {/* The legend is the key to the diagram's textures, and it carries a\n swatch for every region the diagram paints — the border ring\n included, since that is where the BORDER label sits. Drop a row\n and the matching texture becomes unexplained. */}\n <Legend\n direction=\"row\"\n spacing={1}\n sx={{\n alignItems: 'center',\n justifyContent: 'space-around',\n mt: 1,\n mb: 2,\n }}\n >\n <LegendItem item={'margin'} />\n <LegendItem item={'border'} />\n <LegendItem item={'padding'} />\n <LegendItem item={'contents'} />\n </Legend>\n </Box>\n )\n },\n)\nBoxStyler.displayName = 'BoxStyler'\n\nexport default BoxStyler\n"],"names":["FIELD_MUTED_STYLES","FieldMuteButton","Box","Collapse","Stack","ToggleButton","ToggleButtonGroup","Tooltip","Typography","forwardRef","useCallback","useEffect","useRef","useState","BoxDiagram","SIDE_LABELS","Legend","LegendItem","SpacingEditor","MARGIN_KEYS","PADDING_KEYS","boxScopeKeys","key","scope","group","startsWith","vertical","endsWith","filter","item","BoxStyler","measurements","spacingSteps","border","onChange","muteForSide","ref","setScope","editing","setEditing","lastEditing","current","shown","sideMute","undefined","handleSelect","prev","handleChange","value","res","target","sx","display","alignItems","justifyContent","mb","variant","color","size","exclusive","event","px","py","title","span","steps","onSelect","in","Boolean","unmountOnExit","mt","muted","gap","fontWeight","mute","label","allowAuto","direction","spacing","displayName"],"mappings":";;AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAEEA,kBAAkB,EAClBC,eAAe,QACV,6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|
@@ -0,0 +1,89 @@
|
|
|
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 ComponentProps } from 'react';
|
|
18
|
+
import type { SpacingScaleOption } from '../../utils/theme-scale-options';
|
|
19
|
+
import type { Measurements } from '../types';
|
|
20
|
+
export type { Measurements };
|
|
21
|
+
/**
|
|
22
|
+
* The narrowest diagram that can carry the PADDING chip (AGL-2486).
|
|
23
|
+
*
|
|
24
|
+
* A chip sits at the top-left of its region and a side's value is centred
|
|
25
|
+
* in its wedge. Measured across panel widths, exactly ONE pair ever meets:
|
|
26
|
+
* the PADDING chip and the `paddingTop` value. The cause is arithmetic
|
|
27
|
+
* rather than styling — the padding band is about 40% of the diagram,
|
|
28
|
+
* because the margin bands take 17% a side and the border ring a further
|
|
29
|
+
* FIXED `RING` px a side, and it is the fixed part that eats a growing
|
|
30
|
+
* share as the panel narrows. At a 260px panel the band is 83px and the
|
|
31
|
+
* chip alone is 54px of it.
|
|
32
|
+
*
|
|
33
|
+
* **There is no placement that fixes this, and the first attempt proved
|
|
34
|
+
* it.** Reserving a column so the value slid right did clear the chip by
|
|
35
|
+
* the numbers `getBoundingClientRect` reports — and the value came out
|
|
36
|
+
* CLIPPED, because the wedge is a trapezoid: `clipPath` narrows the band
|
|
37
|
+
* from 100% at its top edge to 74% at its bottom, and a rect-based check
|
|
38
|
+
* cannot see a clip path any more than it can see an outline. At the
|
|
39
|
+
* value's own row the usable window at 260px is ~54px wide in total. A
|
|
40
|
+
* 54px chip and a 25px value do not both go in it, at any offset.
|
|
41
|
+
*
|
|
42
|
+
* So the chip yields, below the width at which its band can hold both.
|
|
43
|
+
* Nothing is lost by it: the legend directly under the diagram names all
|
|
44
|
+
* four regions and paints each swatch with that region's own material, so
|
|
45
|
+
* the padding region is still named and still identified by its wash —
|
|
46
|
+
* whereas a covered value is data the author simply cannot read.
|
|
47
|
+
*
|
|
48
|
+
* The threshold is measured, with headroom rather than to the millimetre:
|
|
49
|
+
* the value clears naturally at a 307px diagram, by 1.3px, which is a
|
|
50
|
+
* coincidence and not a clearance. At 320px it clears by ~5.5px, and by
|
|
51
|
+
* ~1.5px even for a value half again as wide as the ladder's own. The
|
|
52
|
+
* stock 375px panel gives a 342px diagram, so the chip is well clear of
|
|
53
|
+
* the boundary at every ordinary width.
|
|
54
|
+
*/
|
|
55
|
+
export declare const PADDING_CHIP_MIN_WIDTH = 320;
|
|
56
|
+
export type PolyType = {
|
|
57
|
+
topLX: string;
|
|
58
|
+
topLY: string;
|
|
59
|
+
topRX: string;
|
|
60
|
+
topRY: string;
|
|
61
|
+
btmRX: string;
|
|
62
|
+
btmRY: string;
|
|
63
|
+
btmLX: string;
|
|
64
|
+
btmLY: string;
|
|
65
|
+
};
|
|
66
|
+
declare const StyledWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
67
|
+
/**
|
|
68
|
+
* What each side is called, in the words an author would use.
|
|
69
|
+
*
|
|
70
|
+
* The abbreviations these replace (`mt`, `ml`, `mr`, `mb`) were the panel's
|
|
71
|
+
* plainest example of developer shorthand leaking into a customer-facing
|
|
72
|
+
* control: they are the MUI prop names, and they mean nothing at all to
|
|
73
|
+
* someone who has never written `sx`.
|
|
74
|
+
*/
|
|
75
|
+
export declare const SIDE_LABELS: Record<keyof Measurements, string>;
|
|
76
|
+
/** The one-word name a side shows while it has no value of its own. */
|
|
77
|
+
export declare const SIDE_SHORT: Record<keyof Measurements, string>;
|
|
78
|
+
export interface BoxDiagramProps extends Omit<ComponentProps<typeof StyledWrapper>, 'onChange' | 'onSelect'> {
|
|
79
|
+
measurements?: Measurements;
|
|
80
|
+
/** The theme's spacing ladder, so a step can be shown resolved. */
|
|
81
|
+
steps?: readonly SpacingScaleOption[];
|
|
82
|
+
/** The element's border shorthand, drawn for context only. */
|
|
83
|
+
border?: string;
|
|
84
|
+
/** Which side's editor is open, so the diagram can mark it. */
|
|
85
|
+
editing?: keyof Measurements;
|
|
86
|
+
onSelect?: (key: keyof Measurements) => void;
|
|
87
|
+
}
|
|
88
|
+
export declare const BoxDiagram: import("react").ForwardRefExoticComponent<Omit<BoxDiagramProps, "ref"> & import("react").RefAttributes<any>>;
|
|
89
|
+
export default BoxDiagram;
|