@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,661 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
/**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright 2026 Aglyn LLC
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*/ import { ButtonBase, styled, Tooltip, Typography } from "@mui/material";
|
|
20
|
+
import { forwardRef, useCallback, useEffect, useRef, useState } from "react";
|
|
21
|
+
import { regionFills } from "../region-fills.js";
|
|
22
|
+
import { isThemeSpacingStep, spacingDescription, spacingDisplayText } from "../spacing-value.js";
|
|
23
|
+
/**
|
|
24
|
+
* The box diagram (AGL-2486).
|
|
25
|
+
*
|
|
26
|
+
* The geometry is the original's — wedge-shaped bands framing the content,
|
|
27
|
+
* because that shape is what says these are frames AROUND something rather
|
|
28
|
+
* than four unrelated numbers.
|
|
29
|
+
*
|
|
30
|
+
* The regions are told apart by TEXTURE — stripes, cross-hatch, a wash, a
|
|
31
|
+
* dotted grid — carried by `text.primary` and low-alpha hues rather than by
|
|
32
|
+
* saturation. Saturated paint makes one band shout over its neighbours;
|
|
33
|
+
* removing the texture along with the paint leaves four flat greys that no
|
|
34
|
+
* legend can distinguish. The declarations live once in `region-fills.ts`, so
|
|
35
|
+
* the legend swatches are painted from the same source as the regions they
|
|
36
|
+
* name.
|
|
37
|
+
*
|
|
38
|
+
* The proportions follow from the same reading:
|
|
39
|
+
*
|
|
40
|
+
* - The BORDER band is 26px, not 20, and carries the densest texture. Any
|
|
41
|
+
* thinner and the region carrying a chip reads as a gap between two
|
|
42
|
+
* better-resolved neighbours.
|
|
43
|
+
* - `Contents` is 48% of the padding box, not 33%, so it reads as the thing
|
|
44
|
+
* everything else surrounds rather than as a label in a gap.
|
|
45
|
+
* - All three chips — MARGIN, PADDING, BORDER — sit TOP-LEFT of their own
|
|
46
|
+
* band on the same opaque ground, so they step inward along the left edge
|
|
47
|
+
* as the regions nest. See `.label.border` below for why the ground and
|
|
48
|
+
* the placement are one decision rather than two.
|
|
49
|
+
*
|
|
50
|
+
* Every colour is a palette token or a channel form of one. Nothing is a
|
|
51
|
+
* literal, so the console's class-based colour-scheme variables re-resolve
|
|
52
|
+
* the whole diagram when the theme flips. That is what gives the dark scheme
|
|
53
|
+
* its own values without a second mechanism, and what keeps this file at zero
|
|
54
|
+
* entries in the hardcoded-colour ratchet.
|
|
55
|
+
*/ const GAP = 2;
|
|
56
|
+
/** Thickness of each margin band, as a % of the diagram. */ const MARGIN_BAND = 17;
|
|
57
|
+
/** Thickness of each padding band, as a % of the padding box. */ const PAD_BAND = 26;
|
|
58
|
+
/** Thickness of the border band, in px. */ const RING = 26;
|
|
59
|
+
const HEIGHT = 244;
|
|
60
|
+
/**
|
|
61
|
+
* The narrowest diagram that can carry the PADDING chip (AGL-2486).
|
|
62
|
+
*
|
|
63
|
+
* A chip sits at the top-left of its region and a side's value is centred
|
|
64
|
+
* in its wedge. Measured across panel widths, exactly ONE pair ever meets:
|
|
65
|
+
* the PADDING chip and the `paddingTop` value. The cause is arithmetic
|
|
66
|
+
* rather than styling — the padding band is about 40% of the diagram,
|
|
67
|
+
* because the margin bands take 17% a side and the border ring a further
|
|
68
|
+
* FIXED `RING` px a side, and it is the fixed part that eats a growing
|
|
69
|
+
* share as the panel narrows. At a 260px panel the band is 83px and the
|
|
70
|
+
* chip alone is 54px of it.
|
|
71
|
+
*
|
|
72
|
+
* **There is no placement that fixes this, and the first attempt proved
|
|
73
|
+
* it.** Reserving a column so the value slid right did clear the chip by
|
|
74
|
+
* the numbers `getBoundingClientRect` reports — and the value came out
|
|
75
|
+
* CLIPPED, because the wedge is a trapezoid: `clipPath` narrows the band
|
|
76
|
+
* from 100% at its top edge to 74% at its bottom, and a rect-based check
|
|
77
|
+
* cannot see a clip path any more than it can see an outline. At the
|
|
78
|
+
* value's own row the usable window at 260px is ~54px wide in total. A
|
|
79
|
+
* 54px chip and a 25px value do not both go in it, at any offset.
|
|
80
|
+
*
|
|
81
|
+
* So the chip yields, below the width at which its band can hold both.
|
|
82
|
+
* Nothing is lost by it: the legend directly under the diagram names all
|
|
83
|
+
* four regions and paints each swatch with that region's own material, so
|
|
84
|
+
* the padding region is still named and still identified by its wash —
|
|
85
|
+
* whereas a covered value is data the author simply cannot read.
|
|
86
|
+
*
|
|
87
|
+
* The threshold is measured, with headroom rather than to the millimetre:
|
|
88
|
+
* the value clears naturally at a 307px diagram, by 1.3px, which is a
|
|
89
|
+
* coincidence and not a clearance. At 320px it clears by ~5.5px, and by
|
|
90
|
+
* ~1.5px even for a value half again as wide as the ladder's own. The
|
|
91
|
+
* stock 375px panel gives a 342px diagram, so the chip is well clear of
|
|
92
|
+
* the boundary at every ordinary width.
|
|
93
|
+
*/ export const PADDING_CHIP_MIN_WIDTH = 320;
|
|
94
|
+
/** The query container the threshold is measured against. */ const CONTAINER_NAME = 'aglynBoxDiagram';
|
|
95
|
+
const polygon = (options)=>{
|
|
96
|
+
const topL = `${options.topLX || '0%'} ${options.topLY || '0%'}`;
|
|
97
|
+
const topR = `${options.topRX || '0%'} ${options.topRY || '0%'}`;
|
|
98
|
+
const btmR = `${options.btmRX || '0%'} ${options.btmRY || '0%'}`;
|
|
99
|
+
const btmL = `${options.btmLX || '0%'} ${options.btmLY || '0%'}`;
|
|
100
|
+
return `polygon(${topL}, ${topR}, ${btmR}, ${btmL})`;
|
|
101
|
+
};
|
|
102
|
+
/** The four mitred wedges of one band, given its thickness in percent. */ const wedges = (band)=>({
|
|
103
|
+
top: polygon({
|
|
104
|
+
topLX: '0%',
|
|
105
|
+
topLY: '0%',
|
|
106
|
+
topRX: '100%',
|
|
107
|
+
topRY: '0%',
|
|
108
|
+
btmRX: `${100 - band}%`,
|
|
109
|
+
btmRY: '100%',
|
|
110
|
+
btmLX: `${band}%`,
|
|
111
|
+
btmLY: '100%'
|
|
112
|
+
}),
|
|
113
|
+
bottom: polygon({
|
|
114
|
+
topLX: `${band}%`,
|
|
115
|
+
topLY: '0%',
|
|
116
|
+
topRX: `${100 - band}%`,
|
|
117
|
+
topRY: '0%',
|
|
118
|
+
btmRX: '100%',
|
|
119
|
+
btmRY: '100%',
|
|
120
|
+
btmLX: '0%',
|
|
121
|
+
btmLY: '100%'
|
|
122
|
+
}),
|
|
123
|
+
left: polygon({
|
|
124
|
+
topLX: '0%',
|
|
125
|
+
topLY: '0%',
|
|
126
|
+
topRX: '100%',
|
|
127
|
+
topRY: `${band}%`,
|
|
128
|
+
btmRX: '100%',
|
|
129
|
+
btmRY: `${100 - band}%`,
|
|
130
|
+
btmLX: '0%',
|
|
131
|
+
btmLY: '100%'
|
|
132
|
+
}),
|
|
133
|
+
right: polygon({
|
|
134
|
+
topLX: '0%',
|
|
135
|
+
topLY: `${band}%`,
|
|
136
|
+
topRX: '100%',
|
|
137
|
+
topRY: '0%',
|
|
138
|
+
btmRX: '100%',
|
|
139
|
+
btmRY: '100%',
|
|
140
|
+
btmLX: '0%',
|
|
141
|
+
btmLY: `${100 - band}%`
|
|
142
|
+
})
|
|
143
|
+
});
|
|
144
|
+
const StyledWrapper = styled('div')(({ theme })=>{
|
|
145
|
+
// In CSS vars mode theme.palette.* returns the static LIGHT values, so
|
|
146
|
+
// every reference here goes through (theme.vars || theme): that is what
|
|
147
|
+
// makes the diagram re-resolve when the dark class toggles on <html>.
|
|
148
|
+
const tv = theme.vars || theme;
|
|
149
|
+
const fills = regionFills(tv);
|
|
150
|
+
const ink = tv.palette.text.primaryChannel;
|
|
151
|
+
const marginWedge = wedges(MARGIN_BAND);
|
|
152
|
+
const padWedge = wedges(PAD_BAND);
|
|
153
|
+
return {
|
|
154
|
+
width: '100%',
|
|
155
|
+
height: HEIGHT,
|
|
156
|
+
display: 'flex',
|
|
157
|
+
flexDirection: 'column',
|
|
158
|
+
position: 'relative',
|
|
159
|
+
textAlign: 'center',
|
|
160
|
+
overflow: 'hidden',
|
|
161
|
+
boxSizing: 'border-box',
|
|
162
|
+
// The figure answers to its OWN width, not the window's. The panel is
|
|
163
|
+
// resizable, so a viewport media query would be measuring the wrong
|
|
164
|
+
// thing entirely — a 260px panel and a 375px panel sit in the same
|
|
165
|
+
// window. `inline-size` only contains the inline axis, and the height
|
|
166
|
+
// here is a fixed `HEIGHT`, so nothing about the layout moves.
|
|
167
|
+
containerType: 'inline-size',
|
|
168
|
+
containerName: CONTAINER_NAME,
|
|
169
|
+
borderRadius: theme.shape.borderRadius,
|
|
170
|
+
borderWidth: 1,
|
|
171
|
+
borderStyle: fills.margin.borderStyle,
|
|
172
|
+
borderColor: fills.margin.borderColor,
|
|
173
|
+
// The ground the margin wedges sit on — it shows through the 2px gaps
|
|
174
|
+
// between them as the diagonal corner seams.
|
|
175
|
+
background: fills.margin.seam,
|
|
176
|
+
color: tv.palette.text.primary,
|
|
177
|
+
padding: 1,
|
|
178
|
+
'.marginButton': {
|
|
179
|
+
overflow: 'hidden',
|
|
180
|
+
textAlign: 'center',
|
|
181
|
+
cursor: 'pointer',
|
|
182
|
+
backfaceVisibility: 'hidden',
|
|
183
|
+
color: 'inherit',
|
|
184
|
+
// The material is on the WEDGE, not on the region behind it: a
|
|
185
|
+
// transparent button clips to nothing and the band reads as a plain
|
|
186
|
+
// rectangle, which is exactly the geometry that had to come back.
|
|
187
|
+
background: fills.margin.background,
|
|
188
|
+
transition: theme.transitions.create([
|
|
189
|
+
'filter'
|
|
190
|
+
], {
|
|
191
|
+
duration: 120
|
|
192
|
+
}),
|
|
193
|
+
'&:hover': {
|
|
194
|
+
filter: 'brightness(1.04)'
|
|
195
|
+
},
|
|
196
|
+
'&.marginTop': {
|
|
197
|
+
width: `calc(100% - ${GAP * 2}px)`,
|
|
198
|
+
marginLeft: GAP,
|
|
199
|
+
marginRight: GAP,
|
|
200
|
+
height: `calc(${MARGIN_BAND}% - ${GAP}px)`,
|
|
201
|
+
clipPath: marginWedge.top
|
|
202
|
+
},
|
|
203
|
+
'&.marginBottom': {
|
|
204
|
+
width: `calc(100% - ${GAP}px)`,
|
|
205
|
+
marginLeft: GAP,
|
|
206
|
+
height: `${MARGIN_BAND}%`,
|
|
207
|
+
clipPath: marginWedge.bottom
|
|
208
|
+
},
|
|
209
|
+
'&.marginLeft': {
|
|
210
|
+
left: 1,
|
|
211
|
+
top: 0,
|
|
212
|
+
position: 'absolute',
|
|
213
|
+
height: `calc(100% - ${GAP}px)`,
|
|
214
|
+
width: `${MARGIN_BAND}%`,
|
|
215
|
+
clipPath: marginWedge.left
|
|
216
|
+
},
|
|
217
|
+
'&.marginRight': {
|
|
218
|
+
right: 1,
|
|
219
|
+
height: `calc(100% - ${GAP * 2}px)`,
|
|
220
|
+
width: `${MARGIN_BAND}%`,
|
|
221
|
+
position: 'absolute',
|
|
222
|
+
clipPath: marginWedge.right
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
// The border band. Thicker and densely hatched, because it is the
|
|
226
|
+
// thinnest region and was reading as an afterthought between two
|
|
227
|
+
// better-resolved bands.
|
|
228
|
+
'.borderRing': {
|
|
229
|
+
width: `calc(${100 - MARGIN_BAND * 2}% - ${GAP * 2}px)`,
|
|
230
|
+
height: `${100 - MARGIN_BAND * 2}%`,
|
|
231
|
+
margin: `${GAP}px auto`,
|
|
232
|
+
padding: RING,
|
|
233
|
+
position: 'relative',
|
|
234
|
+
boxSizing: 'border-box',
|
|
235
|
+
borderRadius: 2,
|
|
236
|
+
borderWidth: 1,
|
|
237
|
+
borderStyle: fills.border.borderStyle,
|
|
238
|
+
borderColor: fills.border.borderColor,
|
|
239
|
+
background: fills.border.background
|
|
240
|
+
},
|
|
241
|
+
'.paddingContainer': {
|
|
242
|
+
width: '100%',
|
|
243
|
+
height: '100%',
|
|
244
|
+
display: 'flex',
|
|
245
|
+
flexDirection: 'column',
|
|
246
|
+
position: 'relative',
|
|
247
|
+
textAlign: 'center',
|
|
248
|
+
overflow: 'hidden',
|
|
249
|
+
borderRadius: 2,
|
|
250
|
+
borderWidth: 1,
|
|
251
|
+
borderStyle: fills.padding.borderStyle,
|
|
252
|
+
borderColor: fills.padding.borderColor,
|
|
253
|
+
background: fills.padding.seam,
|
|
254
|
+
boxSizing: 'border-box'
|
|
255
|
+
},
|
|
256
|
+
'.paddingButton': {
|
|
257
|
+
overflow: 'hidden',
|
|
258
|
+
backfaceVisibility: 'hidden',
|
|
259
|
+
cursor: 'pointer',
|
|
260
|
+
color: 'inherit',
|
|
261
|
+
background: fills.padding.background,
|
|
262
|
+
transition: theme.transitions.create([
|
|
263
|
+
'filter'
|
|
264
|
+
], {
|
|
265
|
+
duration: 120
|
|
266
|
+
}),
|
|
267
|
+
'&:hover': {
|
|
268
|
+
filter: 'brightness(1.04)'
|
|
269
|
+
},
|
|
270
|
+
'&.paddingTop': {
|
|
271
|
+
width: `calc(100% - ${GAP * 2}px)`,
|
|
272
|
+
height: `${PAD_BAND}%`,
|
|
273
|
+
marginLeft: GAP,
|
|
274
|
+
clipPath: padWedge.top
|
|
275
|
+
},
|
|
276
|
+
'&.paddingBottom': {
|
|
277
|
+
width: `calc(100% - ${GAP * 2}px)`,
|
|
278
|
+
height: `${PAD_BAND}%`,
|
|
279
|
+
marginLeft: GAP,
|
|
280
|
+
marginRight: GAP,
|
|
281
|
+
clipPath: padWedge.bottom
|
|
282
|
+
},
|
|
283
|
+
'&.paddingLeft': {
|
|
284
|
+
position: 'absolute',
|
|
285
|
+
top: 0,
|
|
286
|
+
left: 1,
|
|
287
|
+
height: `calc(100% - ${GAP * 2}px)`,
|
|
288
|
+
width: `${PAD_BAND}%`,
|
|
289
|
+
marginTop: GAP,
|
|
290
|
+
marginBottom: GAP,
|
|
291
|
+
clipPath: padWedge.left
|
|
292
|
+
},
|
|
293
|
+
'&.paddingRight': {
|
|
294
|
+
position: 'absolute',
|
|
295
|
+
top: 0,
|
|
296
|
+
right: 1,
|
|
297
|
+
height: `calc(100% - ${GAP * 2}px)`,
|
|
298
|
+
width: `${PAD_BAND}%`,
|
|
299
|
+
marginTop: GAP,
|
|
300
|
+
marginBottom: GAP,
|
|
301
|
+
clipPath: padWedge.right
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
// 48% of the padding box rather than 33%: this is the thing the other
|
|
305
|
+
// three regions exist to surround, and it was reading as a label
|
|
306
|
+
// squeezed into a gap.
|
|
307
|
+
'.contents': {
|
|
308
|
+
width: `calc(${100 - PAD_BAND * 2}% - ${GAP * 2}px)`,
|
|
309
|
+
height: `calc(${100 - PAD_BAND * 2}% - ${GAP * 2}px)`,
|
|
310
|
+
margin: `${GAP}px auto`,
|
|
311
|
+
position: 'relative',
|
|
312
|
+
textAlign: 'center',
|
|
313
|
+
display: 'flex',
|
|
314
|
+
flexDirection: 'column',
|
|
315
|
+
alignItems: 'center',
|
|
316
|
+
justifyContent: 'center',
|
|
317
|
+
borderRadius: 2,
|
|
318
|
+
borderWidth: 1,
|
|
319
|
+
borderStyle: fills.contents.borderStyle,
|
|
320
|
+
borderColor: fills.contents.borderColor,
|
|
321
|
+
background: fills.contents.background,
|
|
322
|
+
color: tv.palette.text.secondary,
|
|
323
|
+
fontSize: theme.typography.pxToRem(11),
|
|
324
|
+
letterSpacing: '0.02em'
|
|
325
|
+
},
|
|
326
|
+
/**
|
|
327
|
+
* Selection is a fill, not an outline: two darker outlines inside a
|
|
328
|
+
* figure built from dashed outlines read as one more outline rather
|
|
329
|
+
* than as "this is the side you are editing".
|
|
330
|
+
*
|
|
331
|
+
* The fill itself is defined in `region-fills` alongside the four
|
|
332
|
+
* region materials, so the answer to "what colour is a region, in
|
|
333
|
+
* which state" lives in one file. It is a TINT of primary rather
|
|
334
|
+
* than solid primary — solid was the brightest thing in a figure
|
|
335
|
+
* made of low-alpha tints, so it dominated instead of indicating.
|
|
336
|
+
*/ '.isSelected': {
|
|
337
|
+
background: fills.selected.background,
|
|
338
|
+
color: fills.selected.color,
|
|
339
|
+
fontWeight: 700,
|
|
340
|
+
'&:hover': {
|
|
341
|
+
filter: 'brightness(0.96)'
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
// A value that follows the theme carries a dot: the number alone
|
|
345
|
+
// cannot say so, since `16px` and the step that resolves to 16px look
|
|
346
|
+
// identical and behave differently when the theme changes.
|
|
347
|
+
'.themeStep .sideValue::after': {
|
|
348
|
+
content: '""',
|
|
349
|
+
display: 'block',
|
|
350
|
+
width: 3,
|
|
351
|
+
height: 3,
|
|
352
|
+
borderRadius: '50%',
|
|
353
|
+
margin: '1px auto 0',
|
|
354
|
+
backgroundColor: 'currentColor',
|
|
355
|
+
opacity: 0.6
|
|
356
|
+
},
|
|
357
|
+
'.sideValue': {
|
|
358
|
+
fontSize: theme.typography.pxToRem(11),
|
|
359
|
+
fontWeight: 600,
|
|
360
|
+
lineHeight: 1.2
|
|
361
|
+
},
|
|
362
|
+
'.sideEmpty': {
|
|
363
|
+
fontSize: theme.typography.pxToRem(10),
|
|
364
|
+
fontWeight: 400,
|
|
365
|
+
lineHeight: 1.2,
|
|
366
|
+
color: tv.palette.text.secondary
|
|
367
|
+
},
|
|
368
|
+
'.label': {
|
|
369
|
+
width: 'auto',
|
|
370
|
+
position: 'absolute',
|
|
371
|
+
textAlign: 'left',
|
|
372
|
+
pointerEvents: 'none',
|
|
373
|
+
left: 2,
|
|
374
|
+
top: 2,
|
|
375
|
+
zIndex: 2,
|
|
376
|
+
paddingLeft: theme.spacing(0.5),
|
|
377
|
+
paddingRight: theme.spacing(0.5),
|
|
378
|
+
borderRadius: 2,
|
|
379
|
+
borderWidth: 1,
|
|
380
|
+
borderStyle: 'solid',
|
|
381
|
+
fontSize: theme.typography.pxToRem(9),
|
|
382
|
+
lineHeight: 1.5,
|
|
383
|
+
letterSpacing: '0.05em',
|
|
384
|
+
textTransform: 'uppercase',
|
|
385
|
+
fontWeight: 700,
|
|
386
|
+
color: tv.palette.text.secondary,
|
|
387
|
+
backgroundColor: tv.palette.background.paper,
|
|
388
|
+
borderColor: `rgba(${ink} / 0.28)`,
|
|
389
|
+
'&.margin': {
|
|
390
|
+
borderColor: fills.margin.borderColor
|
|
391
|
+
},
|
|
392
|
+
'&.padding': {
|
|
393
|
+
borderColor: fills.padding.borderColor
|
|
394
|
+
},
|
|
395
|
+
/**
|
|
396
|
+
* BORDER, on the same opaque chip as MARGIN and PADDING, in the
|
|
397
|
+
* same TOP-LEFT corner of its own band (decided; top-left
|
|
398
|
+
* supersedes a top-right pass earlier the same day).
|
|
399
|
+
*
|
|
400
|
+
* Two asks that turn out to be one change. The chip painted
|
|
401
|
+
* `fills.border.background` — the band's own stripes — which is how
|
|
402
|
+
* it stayed identifiably the border's while it lay across two
|
|
403
|
+
* neighbouring regions at the bottom right. But `background` is a
|
|
404
|
+
* SHORTHAND, so it also reset the base chip's opaque
|
|
405
|
+
* `background.paper` ground: BORDER was the only one of the three
|
|
406
|
+
* labels reading off a 45° hatch, and since the border band is the
|
|
407
|
+
* figure's only patterned region, the label most in need of a
|
|
408
|
+
* ground was the one without one.
|
|
409
|
+
*
|
|
410
|
+
* Removing that single declaration restores the base treatment
|
|
411
|
+
* untouched — not a variant of the chip, the same chip. The dashed
|
|
412
|
+
* edge in the band's own info hue is what still says "border", and
|
|
413
|
+
* it is enough now that the chip no longer has to survive lying
|
|
414
|
+
* across two other materials.
|
|
415
|
+
*
|
|
416
|
+
* The ground is also what frees the placement: with one it no
|
|
417
|
+
* longer has to overlap to be read, so it takes its own band's
|
|
418
|
+
* top-left corner and the three chips step inward together as the
|
|
419
|
+
* regions nest — which is the pattern MARGIN and PADDING already
|
|
420
|
+
* set. Nothing about the position is declared here: the base rule's
|
|
421
|
+
* `left: 2, top: 2` is the placement, and each chip is positioned
|
|
422
|
+
* against its OWN region (`.borderRing` here, `.paddingContainer`
|
|
423
|
+
* for PADDING, the wrapper for MARGIN), so the inward step is the
|
|
424
|
+
* geometry rather than three hand-tuned offsets. It CLEARS the 26px
|
|
425
|
+
* band — 9px type at 1.5 plus two 1px edges is ~16px tall — checked
|
|
426
|
+
* at a 260px panel, not only at a comfortable width.
|
|
427
|
+
*/ '&.border': {
|
|
428
|
+
pointerEvents: 'auto',
|
|
429
|
+
cursor: 'help',
|
|
430
|
+
borderStyle: 'dashed',
|
|
431
|
+
borderColor: fills.border.borderColor,
|
|
432
|
+
color: tv.palette.text.primary
|
|
433
|
+
}
|
|
434
|
+
},
|
|
435
|
+
/**
|
|
436
|
+
* Below `PADDING_CHIP_MIN_WIDTH` the padding band cannot hold its chip
|
|
437
|
+
* AND its value, so the chip goes and the value stays — see the
|
|
438
|
+
* constant for why there is no placement that keeps both.
|
|
439
|
+
*
|
|
440
|
+
* Only this chip. MARGIN's band is the full width of the diagram and
|
|
441
|
+
* BORDER's carries no value at all, so neither can ever reach one;
|
|
442
|
+
* hiding them here would remove information for no reason. The rule is
|
|
443
|
+
* "a chip is drawn where its own band has room for it", which is why
|
|
444
|
+
* it reads as one chip short rather than as an arbitrary breakpoint.
|
|
445
|
+
*/ [`@container ${CONTAINER_NAME} (max-width: ${PADDING_CHIP_MIN_WIDTH - 1}px)`]: {
|
|
446
|
+
'.label.padding': {
|
|
447
|
+
display: 'none'
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
});
|
|
452
|
+
/**
|
|
453
|
+
* What each side is called, in the words an author would use.
|
|
454
|
+
*
|
|
455
|
+
* The abbreviations these replace (`mt`, `ml`, `mr`, `mb`) were the panel's
|
|
456
|
+
* plainest example of developer shorthand leaking into a customer-facing
|
|
457
|
+
* control: they are the MUI prop names, and they mean nothing at all to
|
|
458
|
+
* someone who has never written `sx`.
|
|
459
|
+
*/ export const SIDE_LABELS = {
|
|
460
|
+
marginTop: 'Space outside — top',
|
|
461
|
+
marginRight: 'Space outside — right',
|
|
462
|
+
marginBottom: 'Space outside — bottom',
|
|
463
|
+
marginLeft: 'Space outside — left',
|
|
464
|
+
paddingTop: 'Space inside — top',
|
|
465
|
+
paddingRight: 'Space inside — right',
|
|
466
|
+
paddingBottom: 'Space inside — bottom',
|
|
467
|
+
paddingLeft: 'Space inside — left'
|
|
468
|
+
};
|
|
469
|
+
/** The one-word name a side shows while it has no value of its own. */ export const SIDE_SHORT = {
|
|
470
|
+
marginTop: 'Top',
|
|
471
|
+
marginRight: 'Right',
|
|
472
|
+
marginBottom: 'Bottom',
|
|
473
|
+
marginLeft: 'Left',
|
|
474
|
+
paddingTop: 'Top',
|
|
475
|
+
paddingRight: 'Right',
|
|
476
|
+
paddingBottom: 'Bottom',
|
|
477
|
+
paddingLeft: 'Left'
|
|
478
|
+
};
|
|
479
|
+
/**
|
|
480
|
+
* Where each side's tooltip opens — OUTWARD, away from the middle of the
|
|
481
|
+
* figure (fix 3).
|
|
482
|
+
*
|
|
483
|
+
* One placement for all eight cannot work here: this is a set of nested
|
|
484
|
+
* bands, so whichever direction a tooltip opens it lands on top of a
|
|
485
|
+
* neighbouring target unless the direction is chosen per side. Opening away
|
|
486
|
+
* from the centre is the only choice with no neighbour behind it.
|
|
487
|
+
*/ const TOOLTIP_PLACEMENT = {
|
|
488
|
+
marginTop: 'top',
|
|
489
|
+
marginRight: 'right',
|
|
490
|
+
marginBottom: 'bottom',
|
|
491
|
+
marginLeft: 'left',
|
|
492
|
+
paddingTop: 'top',
|
|
493
|
+
paddingRight: 'right',
|
|
494
|
+
paddingBottom: 'bottom',
|
|
495
|
+
paddingLeft: 'left'
|
|
496
|
+
};
|
|
497
|
+
/**
|
|
498
|
+
* How long the pointer must rest on a region before its tooltip opens.
|
|
499
|
+
*
|
|
500
|
+
* MUI's own `enterDelay` is ignored once `open` is controlled, and these
|
|
501
|
+
* have to be controlled for only-one-at-a-time. So the delay moves to the
|
|
502
|
+
* state that drives them. Without it, dragging the pointer across a figure
|
|
503
|
+
* this dense fires a tooltip per region crossed.
|
|
504
|
+
*/ const HOVER_DELAY_MS = 400;
|
|
505
|
+
export const BoxDiagram = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
506
|
+
const { measurements, steps, border, editing, onSelect } = props, rest = _object_without_properties_loose(props, [
|
|
507
|
+
"measurements",
|
|
508
|
+
"steps",
|
|
509
|
+
"border",
|
|
510
|
+
"editing",
|
|
511
|
+
"onSelect"
|
|
512
|
+
]);
|
|
513
|
+
const ladder = steps != null ? steps : [];
|
|
514
|
+
/**
|
|
515
|
+
* Exactly ONE tooltip is open, because ONE piece of state says which
|
|
516
|
+
* (fix 3).
|
|
517
|
+
*
|
|
518
|
+
* Nine independently-controlled tooltips could and did stack up: the
|
|
519
|
+
* bands overlap, so a pointer crossing the figure is inside several hit
|
|
520
|
+
* areas in quick succession and each tooltip decided its own visibility.
|
|
521
|
+
* An enter delay alone would have hidden that without fixing it.
|
|
522
|
+
*/ const [hovered, setHovered] = useState(null);
|
|
523
|
+
const timer = useRef(null);
|
|
524
|
+
const clearTimer = ()=>{
|
|
525
|
+
if (timer.current) clearTimeout(timer.current);
|
|
526
|
+
timer.current = null;
|
|
527
|
+
};
|
|
528
|
+
// A pending open must not fire after the diagram has gone.
|
|
529
|
+
useEffect(()=>clearTimer, []);
|
|
530
|
+
const hoverOn = useCallback((target)=>{
|
|
531
|
+
clearTimer();
|
|
532
|
+
timer.current = setTimeout(()=>setHovered(target), HOVER_DELAY_MS);
|
|
533
|
+
}, []);
|
|
534
|
+
const hoverOff = useCallback((target)=>{
|
|
535
|
+
clearTimer();
|
|
536
|
+
setHovered((prev)=>prev === target ? null : prev);
|
|
537
|
+
}, []);
|
|
538
|
+
const sideButton = (key)=>{
|
|
539
|
+
const value = measurements == null ? void 0 : measurements[key];
|
|
540
|
+
const text = spacingDisplayText(value, ladder);
|
|
541
|
+
const isStep = isThemeSpacingStep(value);
|
|
542
|
+
const selected = editing === key;
|
|
543
|
+
return /*#__PURE__*/ _jsx(Tooltip, {
|
|
544
|
+
open: hovered === key,
|
|
545
|
+
placement: TOOLTIP_PLACEMENT[key],
|
|
546
|
+
// The tooltip must never be a click target: it used to open over
|
|
547
|
+
// the button that summoned it and swallow the click.
|
|
548
|
+
disableInteractive: true,
|
|
549
|
+
slotProps: {
|
|
550
|
+
popper: {
|
|
551
|
+
sx: {
|
|
552
|
+
pointerEvents: 'none'
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
},
|
|
556
|
+
title: `${SIDE_LABELS[key]} · ${spacingDescription(value, ladder)}`,
|
|
557
|
+
children: /*#__PURE__*/ _jsx(ButtonBase, {
|
|
558
|
+
className: [
|
|
559
|
+
key.startsWith('margin') ? 'marginButton' : 'paddingButton',
|
|
560
|
+
key,
|
|
561
|
+
isStep ? 'themeStep' : '',
|
|
562
|
+
selected ? 'isSelected' : ''
|
|
563
|
+
].filter(Boolean).join(' '),
|
|
564
|
+
onClick: ()=>{
|
|
565
|
+
clearTimer();
|
|
566
|
+
setHovered(null);
|
|
567
|
+
onSelect == null ? void 0 : onSelect(key);
|
|
568
|
+
},
|
|
569
|
+
onMouseEnter: ()=>hoverOn(key),
|
|
570
|
+
onMouseLeave: ()=>hoverOff(key),
|
|
571
|
+
onFocus: ()=>hoverOn(key),
|
|
572
|
+
onBlur: ()=>hoverOff(key),
|
|
573
|
+
onMouseDown: clearTimer,
|
|
574
|
+
"aria-label": SIDE_LABELS[key],
|
|
575
|
+
"aria-pressed": selected,
|
|
576
|
+
children: /*#__PURE__*/ _jsx(Typography, {
|
|
577
|
+
component: "span",
|
|
578
|
+
className: text === '' ? 'sideEmpty' : 'sideValue',
|
|
579
|
+
children: text === '' ? SIDE_SHORT[key] : text
|
|
580
|
+
})
|
|
581
|
+
})
|
|
582
|
+
});
|
|
583
|
+
};
|
|
584
|
+
return /*#__PURE__*/ _jsxs(StyledWrapper, _extends({
|
|
585
|
+
ref: ref
|
|
586
|
+
}, rest, {
|
|
587
|
+
children: [
|
|
588
|
+
sideButton('marginTop'),
|
|
589
|
+
sideButton('marginLeft'),
|
|
590
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
591
|
+
className: "borderRing",
|
|
592
|
+
children: [
|
|
593
|
+
/*#__PURE__*/ _jsx(Tooltip, {
|
|
594
|
+
open: hovered === 'border',
|
|
595
|
+
placement: "left",
|
|
596
|
+
disableInteractive: true,
|
|
597
|
+
slotProps: {
|
|
598
|
+
popper: {
|
|
599
|
+
sx: {
|
|
600
|
+
pointerEvents: 'none'
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
},
|
|
604
|
+
title: `Border: ${border || 'none'} — edit it under Borders & Shadows`,
|
|
605
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
606
|
+
className: "label border",
|
|
607
|
+
"aria-label": `Border: ${border || 'none'}`,
|
|
608
|
+
onMouseEnter: ()=>hoverOn('border'),
|
|
609
|
+
onMouseLeave: ()=>hoverOff('border'),
|
|
610
|
+
children: [
|
|
611
|
+
/*#__PURE__*/ _jsx("div", {
|
|
612
|
+
className: "arrow"
|
|
613
|
+
}),
|
|
614
|
+
'Border'
|
|
615
|
+
]
|
|
616
|
+
})
|
|
617
|
+
}),
|
|
618
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
619
|
+
className: "paddingContainer",
|
|
620
|
+
children: [
|
|
621
|
+
sideButton('paddingTop'),
|
|
622
|
+
sideButton('paddingLeft'),
|
|
623
|
+
/*#__PURE__*/ _jsx("div", {
|
|
624
|
+
className: "contents",
|
|
625
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
626
|
+
children: 'Contents'
|
|
627
|
+
})
|
|
628
|
+
}),
|
|
629
|
+
sideButton('paddingRight'),
|
|
630
|
+
sideButton('paddingBottom'),
|
|
631
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
632
|
+
className: "label padding",
|
|
633
|
+
children: [
|
|
634
|
+
/*#__PURE__*/ _jsx("div", {
|
|
635
|
+
className: "arrow"
|
|
636
|
+
}),
|
|
637
|
+
'Padding'
|
|
638
|
+
]
|
|
639
|
+
})
|
|
640
|
+
]
|
|
641
|
+
})
|
|
642
|
+
]
|
|
643
|
+
}),
|
|
644
|
+
sideButton('marginRight'),
|
|
645
|
+
sideButton('marginBottom'),
|
|
646
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
647
|
+
className: "label margin",
|
|
648
|
+
children: [
|
|
649
|
+
/*#__PURE__*/ _jsx("div", {
|
|
650
|
+
className: "arrow"
|
|
651
|
+
}),
|
|
652
|
+
'Margin'
|
|
653
|
+
]
|
|
654
|
+
})
|
|
655
|
+
]
|
|
656
|
+
}));
|
|
657
|
+
});
|
|
658
|
+
BoxDiagram.displayName = 'BoxDiagram';
|
|
659
|
+
export default BoxDiagram;
|
|
660
|
+
|
|
661
|
+
//# sourceMappingURL=box-diagram.js.map
|