@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 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/custom-css-form.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type * as Aglyn from '@aglyn/aglyn'\nimport {\n canvas,\n collectThirdPartyAuthorCssUrlHosts,\n collectThirdPartyAuthorSxUrlHosts,\n} from '@aglyn/aglyn'\nimport { mdiClose, mdiPlus } from '@aglyn/shared-data-mdi'\nimport {\n canonicalSxProperties,\n expandSxAliases,\n isAtomicSxValue,\n} from '@aglyn/shared-data-enums'\nimport { MdiIcon } from '@aglyn/shared-ui-jsx'\nimport { FIELD_MUTED_STYLES, FieldMuteButton } from '@aglyn/shared-ui-jsx-forms'\nimport {\n Autocomplete,\n Button,\n IconButton,\n Stack,\n TextField,\n ToggleButton,\n ToggleButtonGroup,\n Typography,\n} from '@mui/material'\nimport { observer } from 'mobx-react-lite'\nimport { useCallback, useEffect, useMemo, useState } from 'react'\nimport useAglynBesignerFlag from '../hooks/use-aglyn-besigner-flag'\nimport { buildStyleMute, toggleMutedStyle } from '../utils/muted-styles'\nimport type { SxBreakpoint } from '../utils/responsive-sx'\nimport { readSxValue } from '../utils/responsive-sx'\nimport { applyStylePartialToSx } from '../utils/style-field-groups'\nimport { getNodeStyleTarget } from '../utils/style-target'\n\n/**\n * Curated, grouped suggestions for the builder's property picker\n * (freeSolo, so any CSS/sx property still works).\n */\nconst CSS_PROPERTY_SUGGESTIONS: Array<{ group: string; name: string }> = [\n ...[\n 'width',\n 'height',\n 'minWidth',\n 'maxWidth',\n 'minHeight',\n 'maxHeight',\n 'overflow',\n 'position',\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'zIndex',\n ].map((name) => ({ group: 'Layout', name })),\n ...['margin', 'padding', 'gap', 'rowGap', 'columnGap'].map((name) => ({\n group: 'Spacing',\n name,\n })),\n ...[\n 'fontSize',\n 'fontWeight',\n 'fontFamily',\n 'lineHeight',\n 'letterSpacing',\n 'textTransform',\n 'textDecoration',\n 'whiteSpace',\n ].map((name) => ({ group: 'Typography', name })),\n ...[\n 'color',\n 'backgroundColor',\n 'background',\n 'backgroundImage',\n 'backgroundSize',\n 'backgroundPosition',\n 'opacity',\n ].map((name) => ({ group: 'Background & color', name })),\n ...[\n 'border',\n 'borderRadius',\n 'borderColor',\n 'borderWidth',\n 'borderStyle',\n 'outline',\n ].map((name) => ({ group: 'Border', name })),\n ...[\n 'boxShadow',\n 'transform',\n 'transition',\n 'filter',\n 'cursor',\n 'objectFit',\n 'aspectRatio',\n ].map((name) => ({ group: 'Effects', name })),\n]\n\nconst kebabToCamel = (name: string) =>\n name.replace(/-([a-z])/g, (match, letter: string) => letter.toUpperCase())\nconst camelToKebab = (name: string) =>\n name.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)\n\n/** Parses `prop: value;` CSS declarations into a JSS record (AGL-332). */\nexport function parseCssDeclarations(css: string): Record<string, string> {\n const result: Record<string, string> = {}\n for (const raw of css.split(';')) {\n const declaration = raw.trim()\n if (!declaration) continue\n const colon = declaration.indexOf(':')\n if (colon <= 0) continue\n const property = kebabToCamel(declaration.slice(0, colon).trim())\n const value = declaration.slice(colon + 1).trim()\n if (property && value) result[property] = value\n }\n return result\n}\n\n/**\n * The scalar declarations the Builder rows and the CSS tab show for `sx`,\n * named in the Styles panel's own spelling (AGL-2390).\n *\n * MUI honours two names for the same declaration, and every other control\n * in this panel is named for the CSS longhand (AGL-2207). Listing the raw\n * keys made this form the one place that said `bgcolor` where the Colors\n * group said `backgroundColor` and BoxStyler said `paddingTop` — the same\n * node, two vocabularies, and the author with no way to tell that the two\n * rows were one declaration. The expansion is a pure renaming of what\n * already renders (order preserved, non-atomic values left alone), and it\n * is what makes the row's × and the CSS tab's clear reach the key that is\n * actually painting.\n *\n * The JSS tab deliberately does NOT go through here: it edits the stored\n * document verbatim, which is the escape hatch for everything the named\n * controls cannot express.\n */\nexport function customCssDeclarations(\n sx: Record<string, any> | undefined,\n breakpoint: SxBreakpoint | null,\n): Array<{ property: string; value: string }> {\n const source = expandSxAliases((sx ?? {}) as Record<string, any>, {\n deep: true,\n })\n const out: Array<{ property: string; value: string }> = []\n for (const property of Object.keys(source)) {\n const value = readSxValue(source, property, breakpoint)\n if (value === undefined || value === null) continue\n if (typeof value === 'object') continue // selectors/nested — JSON tab\n out.push({ property, value: String(value) })\n }\n return out\n}\n\n/** Serializes scalar sx entries into CSS declarations for the CSS tab. */\nexport function serializeCssDeclarations(\n sx: Record<string, any> | undefined,\n breakpoint: SxBreakpoint | null,\n): string {\n return customCssDeclarations(sx, breakpoint)\n .map(({ property, value }) => `${camelToKebab(property)}: ${value};`)\n .join('\\n')\n}\n\n/**\n * The declaration(s) one named property writes, in the panel's spelling.\n *\n * The property field is free-solo and the CSS tab takes any declaration, so\n * an author can type `bgcolor` or `py` at any time — this form is the one\n * seam in the product where a fresh alias can still enter a document. It\n * resolves the name the same way {@link expandSxAliases} resolves a stored\n * one, so what the author typed and what the panel reads back agree.\n *\n * A value the expansion cannot carry per-side — `p: '10px 20px'`, the CSS\n * shorthand's own syntax — keeps the name the author gave it rather than\n * being copied onto four longhands CSS would drop. Clearing always expands,\n * because a cleared alias has to take every longhand it was painting with\n * it.\n */\nexport function canonicalCssPartial(\n property: string,\n value: string | undefined,\n): Record<string, unknown> {\n const canonical = canonicalSxProperties(property)\n const expandable =\n canonical.length === 1 || value === undefined || isAtomicSxValue(value)\n if (!canonical.length || !expandable) return { [property]: value }\n return Object.fromEntries(canonical.map((name) => [name, value]))\n}\n\n/**\n * Applies custom-CSS edits to `sx` — the write both the Builder rows and\n * the CSS tab's Apply go through (AGL-2390).\n *\n * Routed through the Styles panel's own write seam so this form cannot\n * drift from it again: {@link applyStylePartialToSx} expands the alias keys\n * the edit COLLIDES with before writing, which is what makes clearing a\n * declaration actually clear (deleting `backgroundColor` while a `bgcolor`\n * underneath keeps painting is AGL-2207's sharper failure) and what stops a\n * write leaving two spellings of one declaration in the record.\n *\n * Scheme-agnostic (`null`): this form has always written the base slice,\n * and the dark-preview scoping belongs to the named color fields.\n */\nexport function applyCustomCssEdits(\n sx: Record<string, any> | undefined,\n edits: Record<string, string | undefined>,\n breakpoint: SxBreakpoint | null,\n): Record<string, any> {\n const partial: Record<string, unknown> = {}\n for (const [property, value] of Object.entries(edits)) {\n if (!property) continue\n Object.assign(\n partial,\n canonicalCssPartial(property, value === '' ? undefined : value),\n )\n }\n return applyStylePartialToSx(sx, partial, breakpoint, null)\n}\n\n/**\n * Un-applied CSS / JSS text, held ACROSS an unmount of this form (AGL-2486).\n *\n * The JSS tab is the one control in the Styles panel whose work lives only\n * in React state until Apply — and this form is mounted under\n * `withLastSelectedNode`, which renders \"Select an element\" the instant the\n * canvas selection empties. Anything that clears the selection therefore\n * UNMOUNTS the editor, and a `useState('')` buffer takes the author's\n * half-typed sx document with it. Measured on a live besigner: a selection\n * held with no keyboard or pointer input at all lost the editor 46s in, so\n * this is not something the author can avoid by typing carefully — it is\n * why the wipe reads as random, and why it gets blamed on whichever key was\n * pressed last.\n *\n * Keyed by node AND style target, so a component instance's root and its\n * leaves each keep their own pending text, and re-selecting the element\n * hands the author back exactly what they had typed. An entry lives only\n * while the text DIFFERS from the stored document: applying it, or typing\n * it back to what sx already says, drops the entry, so this never resurrects\n * a draft the author has already resolved.\n *\n * Deliberately not persisted beyond the page: it is un-applied text, not a\n * document, and the crash-recovery draft store is the thing that owns\n * surviving a reload.\n */\nconst pendingDrafts = new Map<string, string>()\n\nconst draftKey = (\n nodeId: string,\n overrideKey: string,\n mode: 'css' | 'json',\n): string => [nodeId, overrideKey, mode].join('\\x00')\n\n/** Drops every pending draft — test seam, and a hard reset for the canvas. */\nexport function resetPendingCustomCssDrafts(): void {\n pendingDrafts.clear()\n}\n\n/**\n * Why a JSS buffer cannot be applied, or `null` when it is ready\n * (AGL-2486). Rendered live as the author types, so \"nothing happened when\n * I pressed Apply\" is never the first sign that the text does not parse.\n *\n * Mid-edit JSON is TRANSIENTLY invalid by nature — `{\"a\": 1,` is what every\n * new property looks like a keystroke before it is finished — so this is a\n * hint, never a block on typing and never a reason to touch the document.\n *\n * An empty buffer is called out rather than treated as `{}`: `JSON.parse`\n * would need a fallback to accept it at all, and silently reading \"\" as\n * \"delete every style on this element\" is the most destructive thing this\n * panel could do with an accidental Select-All. Clearing all styles stays\n * available, spelled `{}`, which nobody types by accident.\n */\nexport function jsonDraftProblem(text: string): string | null {\n const trimmed = (text ?? '').trim()\n if (!trimmed) {\n return 'Empty — type {} to clear every style on this element.'\n }\n let parsed: unknown\n try {\n parsed = JSON.parse(trimmed)\n } catch {\n return 'Not valid JSON yet — Apply will not change anything until it parses.'\n }\n // Explicit `=== null` and an array check: `strictNullChecks` is off\n // repo-wide, so `!parsed` would fold `null`, `0` and `\"\"` together, and\n // `typeof null` is `'object'`.\n if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {\n return 'The sx value must be a JSON object.'\n }\n return null\n}\n\nexport interface CustomCssFormProps {\n node?: Aglyn.NodeSchema\n /** Active artboard breakpoint; builder/CSS edits scope to it (AGL-333). */\n breakpoint: SxBreakpoint | null\n /**\n * Which `styleOverrides` slice to edit on a component instance\n * (AGL-1332) — the Styles panel's current style target. Ignored for a\n * plain node; defaults to the component root.\n */\n overrideKey?: string\n}\n\ntype BuilderRow = { property: string; value: string }\n\n/**\n * Custom CSS for the selected element's `sx` (AGL-332): a friendly\n * builder (property + value rows), a raw CSS mode, and a raw JSS/JSON\n * mode. Builder and CSS edits respect the active breakpoint scope; the\n * JSON mode edits the full sx document (including responsive objects and\n * nested selectors) verbatim.\n */\nexport const CustomCssForm = observer((props: CustomCssFormProps) => {\n const { node, breakpoint, overrideKey } = props\n // Same target the rest of the Styles panel writes (AGL-1306/1332): a\n // plain node's own sx, or the instance override slice the panel's style\n // target names — root, or one leaf inside the component.\n const target = useMemo(\n () => getNodeStyleTarget(node, overrideKey),\n [node, overrideKey],\n )\n const nodeSx = (target.sx ?? {}) as Record<string, any>\n const [mode, setMode] = useState<'builder' | 'css' | 'json'>('builder')\n const [cssDraft, setCssDraft] = useState('')\n const [jsonDraft, setJsonDraft] = useState('')\n const [error, setError] = useState<string | null>(null)\n\n const rows = useMemo<BuilderRow[]>(\n () => customCssDeclarations(nodeSx, breakpoint),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [JSON.stringify(nodeSx), breakpoint],\n )\n const [draftRow, setDraftRow] = useState<BuilderRow>({\n property: '',\n value: '',\n })\n\n // Declarations switched off for comparison (AGL-2486). Canvas only, and\n // the same flag every other row in the panel writes, so a property muted\n // here and the same property muted from its typed field are one state.\n // The builder lists BASE scalar declarations only — a state slice is a\n // nested object it skips — so these mutes carry no state scope.\n const [mutedStyles, setMutedStyles] = useAglynBesignerFlag('mutedStyles')\n const rowMute = useCallback(\n (property: string) =>\n buildStyleMute(property, property, {\n nodeId: node?.$id,\n state: null,\n breakpoint,\n // Every row the builder lists is, by construction, declared.\n scopeValues: { [property]: true },\n mutedStyles,\n onToggle: (target) =>\n setMutedStyles((current) => toggleMutedStyle(current, target)),\n }),\n [node, breakpoint, mutedStyles, setMutedStyles],\n )\n\n const nodeId = node?.$id ?? ''\n /** What the STORED document says, in each tab's spelling. */\n const storedCss = useMemo(\n () => serializeCssDeclarations(nodeSx, breakpoint),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [JSON.stringify(nodeSx), breakpoint],\n )\n const storedJson = useMemo(\n () => JSON.stringify(nodeSx, null, 2),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [JSON.stringify(nodeSx)],\n )\n\n /**\n * Records (or drops) the author's un-applied text for one tab, so an\n * unmount cannot take it (AGL-2486). Text equal to the stored document is\n * not a draft at all, so it clears the entry rather than pinning a value\n * that would then shadow a later change from elsewhere in the panel.\n */\n const rememberDraft = useCallback(\n (draftMode: 'css' | 'json', value: string, stored: string) => {\n const key = draftKey(nodeId, target.overrideKey, draftMode)\n if (value === stored) pendingDrafts.delete(key)\n else pendingDrafts.set(key, value)\n },\n [nodeId, target.overrideKey],\n )\n\n useEffect(() => {\n // A pending draft wins over the stored document — that is the whole\n // point of keeping it. `!== undefined` rather than a truthiness test:\n // `''` is a legitimate buffer the author emptied on purpose, and with\n // `strictNullChecks` off `if (!pending)` would silently discard it.\n const pendingCss = pendingDrafts.get(\n draftKey(nodeId, target.overrideKey, 'css'),\n )\n const pendingJson = pendingDrafts.get(\n draftKey(nodeId, target.overrideKey, 'json'),\n )\n setCssDraft(pendingCss !== undefined ? pendingCss : storedCss)\n setJsonDraft(pendingJson !== undefined ? pendingJson : storedJson)\n setError(null)\n // Re-seeded on the override target too (AGL-1332): switching from the\n // component root to a leaf must reload the drafts, or a stale CSS\n // buffer would be written back onto the newly picked target.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [mode, nodeId, target.overrideKey])\n\n /**\n * Live \"is this appliable yet\" verdict for the JSS tab (AGL-2486) — a\n * caption only. Nothing here writes, so a buffer that stops parsing\n * mid-property changes the hint and leaves the document alone.\n */\n const jsonProblem = useMemo(\n () => (mode === 'json' ? jsonDraftProblem(jsonDraft) : null),\n [mode, jsonDraft],\n )\n\n // Passive off-site url() hint (AGL-1737) — the \"warn\" half of AGL-1725's\n // warn-and-disclose, for the panel with no per-field description to carry\n // it. Names the hosts a url() in the CURRENT value would make every\n // visitor's browser contact: the live draft in the CSS and JSON modes\n // (ahead of Apply, so the author reads it while typing), the committed sx\n // in the builder (whose rows write live). A caption and nothing more — it\n // never blocks a value, and it deliberately does not touch how or when\n // this form commits (an attribute panel edit commits on blur, and that\n // behavior is load-bearing).\n const thirdPartyHosts = useMemo<string[]>(() => {\n if (mode === 'css') return collectThirdPartyAuthorCssUrlHosts(cssDraft)\n if (mode === 'json') {\n try {\n return collectThirdPartyAuthorSxUrlHosts(JSON.parse(jsonDraft || '{}'))\n } catch {\n // Mid-edit JSON — scan the raw text so the hint tracks typing.\n return collectThirdPartyAuthorCssUrlHosts(jsonDraft)\n }\n }\n return collectThirdPartyAuthorSxUrlHosts(nodeSx)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [mode, cssDraft, jsonDraft, JSON.stringify(nodeSx)])\n\n const writeProperty = useCallback(\n (property: string, value: string | undefined) => {\n if (!node || !property) return\n // Coalesced per property (AGL-1204): the builder rows write on every\n // keystroke, so typing one value is one undo step, and editing a\n // different property starts another. The write goes through the style\n // target (AGL-1306), so this is undoable on an instance's override\n // layer exactly as on a plain node's own sx.\n canvas.transact(\n () => {\n target.setSx(\n applyCustomCssEdits(\n (target.sx ?? {}) as Record<string, any>,\n { [property]: value },\n breakpoint,\n ),\n )\n },\n ['sx', node.$id, breakpoint ?? 'base', property].join(':'),\n )\n },\n [node, target, breakpoint],\n )\n\n const applyCss = useCallback(() => {\n if (!node) return\n const parsed = parseCssDeclarations(cssDraft)\n // Uncoalesced: pressing Apply is one deliberate commit, however many\n // declarations it carries (AGL-1204).\n canvas.transact(() => {\n // One edit map, applied once: declarations no longer in the draft\n // clear, the rest write. Both halves resolve their spelling through\n // `applyCustomCssEdits`, so a row the author deleted takes the alias\n // that was painting it with it, and a declaration they typed under\n // MUI's spelling lands where every other control can read it.\n const edits: Record<string, string | undefined> = {}\n for (const row of rows) {\n if (!(row.property in parsed)) edits[row.property] = undefined\n }\n Object.assign(edits, parsed)\n target.setSx(\n applyCustomCssEdits(\n (target.sx ?? {}) as Record<string, any>,\n edits,\n breakpoint,\n ),\n )\n })\n setError(null)\n // Applied text is no longer un-applied.\n pendingDrafts.delete(draftKey(nodeId, target.overrideKey, 'css'))\n }, [node, target, cssDraft, rows, breakpoint, nodeId])\n\n /**\n * Commits the JSS buffer — the ONLY path from this tab to the document\n * (AGL-2486).\n *\n * A buffer that does not parse to a JSON object is a NON-COMMIT: it sets\n * the inline error and returns, leaving both the document and the text\n * exactly as they are, so the author can keep editing from where they\n * were. There is no blur, change or unmount handler anywhere in this form\n * that reaches the document — Apply is the whole seam, which is what\n * makes a transiently invalid buffer harmless.\n */\n const applyJson = useCallback(() => {\n if (!node) return\n const problem = jsonDraftProblem(jsonDraft)\n if (problem !== null) {\n setError(problem)\n return\n }\n // Re-parsed rather than carried out of the guard: `jsonDraftProblem`\n // owns the verdict, and one function deciding while another commits is\n // how \"valid enough to pass, wrong shape to store\" gets in.\n const parsed = JSON.parse(jsonDraft.trim())\n // Replacing sx wholesale is the single most destructive edit this panel\n // offers, so it is the one that most needs to be undoable (AGL-1204).\n canvas.transact(() => {\n target.setSx(parsed)\n })\n setError(null)\n pendingDrafts.delete(draftKey(nodeId, target.overrideKey, 'json'))\n }, [node, target, jsonDraft, nodeId])\n\n return (\n <Stack spacing={1.5}>\n <ToggleButtonGroup\n size=\"small\"\n exclusive\n fullWidth\n value={mode}\n onChange={(event, value) => value && setMode(value)}\n >\n <ToggleButton value=\"builder\">{'Builder'}</ToggleButton>\n <ToggleButton value=\"css\">{'CSS'}</ToggleButton>\n <ToggleButton value=\"json\">{'JSS (sx)'}</ToggleButton>\n </ToggleButtonGroup>\n\n {mode === 'builder' ? (\n <Stack spacing={1}>\n {rows.map((row) => {\n const mute = rowMute(row.property)\n return (\n <Stack\n key={row.property}\n direction=\"row\"\n spacing={1}\n sx={[\n { alignItems: 'center' },\n mute?.muted ? FIELD_MUTED_STYLES : null,\n ]}\n >\n <TextField\n size=\"small\"\n value={row.property}\n disabled\n sx={{ flex: 1 }}\n />\n <TextField\n size=\"small\"\n value={row.value}\n onChange={(event) =>\n writeProperty(row.property, event.target.value)\n }\n sx={{ flex: 1 }}\n />\n {/* The eye stops the declaration applying and keeps its\n value; the ✕ beside it is still the only thing that\n takes the declaration off the element. */}\n <FieldMuteButton mute={mute} />\n <IconButton\n size=\"small\"\n aria-label={`Remove ${row.property}`}\n onClick={() => writeProperty(row.property, undefined)}\n >\n <MdiIcon path={mdiClose.path} size={0.7} />\n </IconButton>\n </Stack>\n )\n })}\n <Stack direction=\"row\" spacing={1} sx={{ alignItems: 'center' }}>\n <Autocomplete\n freeSolo\n size=\"small\"\n options={CSS_PROPERTY_SUGGESTIONS}\n groupBy={(option) =>\n typeof option === 'string' ? '' : option.group\n }\n getOptionLabel={(option) =>\n typeof option === 'string' ? option : option.name\n }\n inputValue={draftRow.property}\n onInputChange={(event, value) =>\n setDraftRow((prev) => ({ ...prev, property: value }))\n }\n renderInput={(params) => (\n <TextField {...params} placeholder=\"property\" />\n )}\n sx={{ flex: 1 }}\n />\n <TextField\n size=\"small\"\n placeholder=\"value\"\n value={draftRow.value}\n onChange={(event) =>\n setDraftRow((prev) => ({ ...prev, value: event.target.value }))\n }\n sx={{ flex: 1 }}\n />\n <IconButton\n size=\"small\"\n aria-label=\"Add property\"\n disabled={!draftRow.property.trim() || !draftRow.value.trim()}\n onClick={() => {\n writeProperty(\n kebabToCamel(draftRow.property.trim()),\n draftRow.value.trim(),\n )\n setDraftRow({ property: '', value: '' })\n }}\n >\n <MdiIcon path={mdiPlus.path} size={0.8} />\n </IconButton>\n </Stack>\n </Stack>\n ) : null}\n\n {mode === 'css' ? (\n <Stack spacing={1}>\n <TextField\n multiline\n minRows={5}\n value={cssDraft}\n onChange={(event) => {\n setCssDraft(event.target.value)\n rememberDraft('css', event.target.value, storedCss)\n }}\n placeholder={\n 'border-radius: 8px;\\nbox-shadow: 0 2px 8px rgba(0,0,0,0.2);'\n }\n slotProps={{\n htmlInput: {\n style: { fontFamily: 'monospace', fontSize: 12 },\n },\n }}\n />\n <Button size=\"small\" variant=\"outlined\" onClick={applyCss}>\n {'Apply CSS'}\n </Button>\n </Stack>\n ) : null}\n\n {mode === 'json' ? (\n <Stack spacing={1}>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {'Full sx document — supports responsive objects ' +\n '({ xs, sm, … }) and nested selectors (\"&:hover\").'}\n </Typography>\n <TextField\n multiline\n minRows={6}\n value={jsonDraft}\n onChange={(event) => {\n setJsonDraft(event.target.value)\n rememberDraft('json', event.target.value, storedJson)\n // A keystroke that fixes the JSON clears a stale Apply error;\n // it never raises one, so typing is not nagged mid-property.\n if (error && jsonDraftProblem(event.target.value) === null) {\n setError(null)\n }\n }}\n error={Boolean(error)}\n helperText={error ?? jsonProblem ?? undefined}\n slotProps={{\n htmlInput: {\n style: { fontFamily: 'monospace', fontSize: 12 },\n },\n }}\n />\n <Button size=\"small\" variant=\"outlined\" onClick={applyJson}>\n {'Apply JSS'}\n </Button>\n </Stack>\n ) : null}\n\n {thirdPartyHosts.length ? (\n // Same voice as the Custom HTML `css` description (AGL-1737), with\n // the host named back so the consequence is attached to the value\n // the author typed rather than left as general prose.\n <Typography variant=\"caption\" color=\"text.secondary\">\n {'A url() here points off your site — every visitor’s browser ' +\n `will contact ${thirdPartyHosts.join(', ')}, disclosing their ` +\n 'IP address and which page they are on. Insecure http:// URLs ' +\n 'are not loaded.'}\n </Typography>\n ) : null}\n </Stack>\n )\n})\nCustomCssForm.displayName = 'CustomCssForm'\n\nexport default CustomCssForm\n"],"names":["canvas","collectThirdPartyAuthorCssUrlHosts","collectThirdPartyAuthorSxUrlHosts","mdiClose","mdiPlus","canonicalSxProperties","expandSxAliases","isAtomicSxValue","MdiIcon","FIELD_MUTED_STYLES","FieldMuteButton","Autocomplete","Button","IconButton","Stack","TextField","ToggleButton","ToggleButtonGroup","Typography","observer","useCallback","useEffect","useMemo","useState","useAglynBesignerFlag","buildStyleMute","toggleMutedStyle","readSxValue","applyStylePartialToSx","getNodeStyleTarget","CSS_PROPERTY_SUGGESTIONS","map","name","group","kebabToCamel","replace","match","letter","toUpperCase","camelToKebab","toLowerCase","parseCssDeclarations","css","result","raw","split","declaration","trim","colon","indexOf","property","slice","value","customCssDeclarations","sx","breakpoint","source","deep","out","Object","keys","undefined","push","String","serializeCssDeclarations","join","canonicalCssPartial","canonical","expandable","length","fromEntries","applyCustomCssEdits","edits","partial","entries","assign","pendingDrafts","Map","draftKey","nodeId","overrideKey","mode","resetPendingCustomCssDrafts","clear","jsonDraftProblem","text","trimmed","parsed","JSON","parse","Array","isArray","CustomCssForm","props","target","error","node","nodeSx","setMode","cssDraft","setCssDraft","jsonDraft","setJsonDraft","setError","rows","stringify","draftRow","setDraftRow","mutedStyles","setMutedStyles","rowMute","$id","state","scopeValues","onToggle","current","storedCss","storedJson","rememberDraft","draftMode","stored","key","delete","set","pendingCss","get","pendingJson","jsonProblem","thirdPartyHosts","writeProperty","transact","setSx","applyCss","row","applyJson","problem","spacing","size","exclusive","fullWidth","onChange","event","mute","direction","alignItems","muted","disabled","flex","aria-label","onClick","path","freeSolo","options","groupBy","option","getOptionLabel","inputValue","onInputChange","prev","renderInput","params","placeholder","multiline","minRows","slotProps","htmlInput","style","fontFamily","fontSize","variant","color","Boolean","helperText","displayName"],"mappings":"AAAA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+
* 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 { MenuProps } from '@aglyn/shared-ui-jsx';
|
|
18
|
+
export interface DevicePreviewControlsProps extends Partial<MenuProps> {
|
|
19
|
+
}
|
|
20
|
+
declare const DevicePreviewControlsComponent: import("react").ForwardRefExoticComponent<Omit<DevicePreviewControlsProps, "ref"> & import("react").RefAttributes<any>>;
|
|
21
|
+
export { DevicePreviewControlsComponent };
|
|
22
|
+
export default DevicePreviewControlsComponent;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
* Copyright 2026 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 { BesignerDeviceFlag } from "@aglyn/besigner";
|
|
19
|
+
import { ICON_VARIANT_FLUID_RESPONSIVE, ICON_VARIANT_LAPTOP, ICON_VARIANT_MENU_DOWN, ICON_VARIANT_MOBILE, ICON_VARIANT_MONITOR_LARGE, ICON_VARIANT_MONITOR_SMALL, ICON_VARIANT_SYMBOL_CONFIRMED, ICON_VARIANT_TABLET } from "@aglyn/shared-data-enums";
|
|
20
|
+
import { MdiIcon, Menu } from "@aglyn/shared-ui-jsx";
|
|
21
|
+
import { Button as MuiButton, ButtonGroup as MuiButtonGroup, Tooltip as MuiTooltip } from "@mui/material";
|
|
22
|
+
import { forwardRef, useCallback, useMemo, useState } from "react";
|
|
23
|
+
import useAglynBesignerFlag from "../hooks/use-aglyn-besigner-flag.js";
|
|
24
|
+
const devicePreviewOptions = [
|
|
25
|
+
{
|
|
26
|
+
children: 'Fluid Responsive',
|
|
27
|
+
value: BesignerDeviceFlag.RESPONSIVE,
|
|
28
|
+
icon: {
|
|
29
|
+
path: ICON_VARIANT_FLUID_RESPONSIVE.path
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
children: 'XS - Mobile',
|
|
34
|
+
value: BesignerDeviceFlag.XS,
|
|
35
|
+
icon: {
|
|
36
|
+
path: ICON_VARIANT_MOBILE.path
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
children: 'SM - Tablet',
|
|
41
|
+
value: BesignerDeviceFlag.SM,
|
|
42
|
+
icon: {
|
|
43
|
+
path: ICON_VARIANT_TABLET.path
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
children: 'MD - Laptop',
|
|
48
|
+
value: BesignerDeviceFlag.MD,
|
|
49
|
+
icon: {
|
|
50
|
+
path: ICON_VARIANT_LAPTOP.path
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
children: 'LG - Desktop',
|
|
55
|
+
value: BesignerDeviceFlag.LG,
|
|
56
|
+
icon: {
|
|
57
|
+
path: ICON_VARIANT_MONITOR_SMALL.path
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
children: 'XL - Widescreen',
|
|
62
|
+
value: BesignerDeviceFlag.XL,
|
|
63
|
+
icon: {
|
|
64
|
+
path: ICON_VARIANT_MONITOR_LARGE.path
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
];
|
|
68
|
+
const DevicePreviewControlsComponent = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
69
|
+
const {} = props, rest = _extends({}, props);
|
|
70
|
+
const [devicePreview, setDevicePreview] = useAglynBesignerFlag('devicePreview');
|
|
71
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
72
|
+
const [devicesMenuOpen, setDevicesMenuOpen] = useState(false);
|
|
73
|
+
const activeDevice = useMemo(()=>devicePreviewOptions.find((i)=>i.value === devicePreview) || devicePreviewOptions[0], [
|
|
74
|
+
devicePreview
|
|
75
|
+
]);
|
|
76
|
+
const handleMenuClose = useCallback((event)=>{
|
|
77
|
+
setDevicesMenuOpen(false);
|
|
78
|
+
}, []);
|
|
79
|
+
const handleOpenMenu = useCallback((event)=>{
|
|
80
|
+
setDevicesMenuOpen(true);
|
|
81
|
+
}, []);
|
|
82
|
+
const handleMenuClick = (device)=>(event)=>{
|
|
83
|
+
setDevicePreview(device);
|
|
84
|
+
setDevicesMenuOpen(false);
|
|
85
|
+
};
|
|
86
|
+
return /*#__PURE__*/ _jsx(Menu, _extends({
|
|
87
|
+
ref: ref,
|
|
88
|
+
id: "aglyn:device-preview",
|
|
89
|
+
onClick: handleMenuClose,
|
|
90
|
+
horizontalOrigin: "right",
|
|
91
|
+
items: [
|
|
92
|
+
{
|
|
93
|
+
type: 'subheader',
|
|
94
|
+
children: 'Artboard preview mode',
|
|
95
|
+
sx: {
|
|
96
|
+
lineHeight: (theme)=>theme.typography.pxToRem(32)
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
...devicePreviewOptions.map((item)=>_extends({
|
|
100
|
+
key: item.value,
|
|
101
|
+
selected: item.value === activeDevice.value,
|
|
102
|
+
disabled: item.value === activeDevice.value,
|
|
103
|
+
onClick: handleMenuClick(item.value),
|
|
104
|
+
endIcon: item.value !== activeDevice.value ? undefined : {
|
|
105
|
+
path: ICON_VARIANT_SYMBOL_CONFIRMED.path
|
|
106
|
+
}
|
|
107
|
+
}, item))
|
|
108
|
+
]
|
|
109
|
+
}, rest, {
|
|
110
|
+
children: /*#__PURE__*/ _jsx(MuiButtonGroup, {
|
|
111
|
+
size: "small",
|
|
112
|
+
variant: "outlined",
|
|
113
|
+
color: "inherit",
|
|
114
|
+
children: /*#__PURE__*/ _jsx(MuiTooltip, {
|
|
115
|
+
title: 'Device preview mode',
|
|
116
|
+
children: /*#__PURE__*/ _jsx(MuiButton, {
|
|
117
|
+
"aria-label": "device preview mode",
|
|
118
|
+
"aria-haspopup": "menu",
|
|
119
|
+
"aria-controls": devicesMenuOpen ? 'aglyn:device-preview' : undefined,
|
|
120
|
+
"aria-expanded": devicesMenuOpen ? 'true' : undefined,
|
|
121
|
+
ref: setAnchorEl,
|
|
122
|
+
onClick: handleOpenMenu,
|
|
123
|
+
startIcon: /*#__PURE__*/ _jsx(MdiIcon, _extends({
|
|
124
|
+
fontSize: "inherit"
|
|
125
|
+
}, activeDevice.icon)),
|
|
126
|
+
endIcon: /*#__PURE__*/ _jsx(MdiIcon, {
|
|
127
|
+
fontSize: "inherit",
|
|
128
|
+
path: ICON_VARIANT_MENU_DOWN.path
|
|
129
|
+
}),
|
|
130
|
+
sx: {
|
|
131
|
+
borderColor: 'divider',
|
|
132
|
+
'& .MuiButton-endIcon': {
|
|
133
|
+
ml: 0.15
|
|
134
|
+
},
|
|
135
|
+
'& .MuiButton-startIcon': {
|
|
136
|
+
mr: 0.85
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
children: activeDevice.children
|
|
140
|
+
})
|
|
141
|
+
})
|
|
142
|
+
})
|
|
143
|
+
}));
|
|
144
|
+
});
|
|
145
|
+
DevicePreviewControlsComponent.displayName = 'DevicePreviewControlsComponent';
|
|
146
|
+
DevicePreviewControlsComponent.aglyn = true;
|
|
147
|
+
export { DevicePreviewControlsComponent };
|
|
148
|
+
export default DevicePreviewControlsComponent;
|
|
149
|
+
|
|
150
|
+
//# sourceMappingURL=device-preview-controls.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/device-preview-controls.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BesignerDeviceFlag } from '@aglyn/besigner'\nimport {\n ICON_VARIANT_FLUID_RESPONSIVE,\n ICON_VARIANT_LAPTOP,\n ICON_VARIANT_MENU_DOWN,\n ICON_VARIANT_MOBILE,\n ICON_VARIANT_MONITOR_LARGE,\n ICON_VARIANT_MONITOR_SMALL,\n ICON_VARIANT_SYMBOL_CONFIRMED,\n ICON_VARIANT_TABLET,\n} from '@aglyn/shared-data-enums'\nimport { MdiIcon, Menu, MenuProps } from '@aglyn/shared-ui-jsx'\nimport {\n Button as MuiButton,\n ButtonGroup as MuiButtonGroup,\n Tooltip as MuiTooltip,\n} from '@mui/material'\nimport {\n forwardRef,\n type MouseEvent,\n useCallback,\n useMemo,\n useState,\n} from 'react'\nimport useAglynBesignerFlag from '../hooks/use-aglyn-besigner-flag'\n\nconst devicePreviewOptions = [\n {\n children: 'Fluid Responsive',\n value: BesignerDeviceFlag.RESPONSIVE,\n icon: { path: ICON_VARIANT_FLUID_RESPONSIVE.path },\n },\n {\n children: 'XS - Mobile',\n value: BesignerDeviceFlag.XS,\n icon: { path: ICON_VARIANT_MOBILE.path },\n },\n {\n children: 'SM - Tablet',\n value: BesignerDeviceFlag.SM,\n icon: { path: ICON_VARIANT_TABLET.path },\n },\n {\n children: 'MD - Laptop',\n value: BesignerDeviceFlag.MD,\n icon: { path: ICON_VARIANT_LAPTOP.path },\n },\n {\n children: 'LG - Desktop',\n value: BesignerDeviceFlag.LG,\n icon: { path: ICON_VARIANT_MONITOR_SMALL.path },\n },\n {\n children: 'XL - Widescreen',\n value: BesignerDeviceFlag.XL,\n icon: { path: ICON_VARIANT_MONITOR_LARGE.path },\n },\n]\n\nexport interface DevicePreviewControlsProps extends Partial<MenuProps> {}\n\nconst DevicePreviewControlsComponent = forwardRef<\n any,\n DevicePreviewControlsProps\n>((props, ref) => {\n const { ...rest } = props\n\n const [devicePreview, setDevicePreview] =\n useAglynBesignerFlag('devicePreview')\n const [anchorEl, setAnchorEl] = useState<Element>(null)\n const [devicesMenuOpen, setDevicesMenuOpen] = useState(false)\n const activeDevice = useMemo(\n () =>\n devicePreviewOptions.find((i) => i.value === devicePreview) ||\n devicePreviewOptions[0],\n [devicePreview],\n )\n\n const handleMenuClose = useCallback((event: MouseEvent<HTMLElement>) => {\n setDevicesMenuOpen(false)\n }, [])\n const handleOpenMenu = useCallback((event: MouseEvent<HTMLElement>) => {\n setDevicesMenuOpen(true)\n }, [])\n const handleMenuClick =\n (device: BesignerDeviceFlag) => (event: MouseEvent<HTMLElement>) => {\n setDevicePreview(device)\n setDevicesMenuOpen(false)\n }\n\n return (\n <Menu\n ref={ref}\n id=\"aglyn:device-preview\"\n onClick={handleMenuClose}\n horizontalOrigin=\"right\"\n items={[\n {\n type: 'subheader',\n children: 'Artboard preview mode',\n sx: { lineHeight: (theme) => theme.typography.pxToRem(32) },\n },\n ...devicePreviewOptions.map((item) => ({\n key: item.value,\n selected: item.value === activeDevice.value,\n disabled: item.value === activeDevice.value,\n onClick: handleMenuClick(item.value),\n endIcon:\n item.value !== activeDevice.value\n ? undefined\n : {\n path: ICON_VARIANT_SYMBOL_CONFIRMED.path,\n },\n ...item,\n })),\n ]}\n {...rest}\n >\n <MuiButtonGroup size=\"small\" variant=\"outlined\" color=\"inherit\">\n <MuiTooltip title={'Device preview mode'}>\n <MuiButton\n aria-label=\"device preview mode\"\n aria-haspopup=\"menu\"\n aria-controls={devicesMenuOpen ? 'aglyn:device-preview' : undefined}\n aria-expanded={devicesMenuOpen ? 'true' : undefined}\n ref={setAnchorEl}\n onClick={handleOpenMenu}\n startIcon={<MdiIcon fontSize=\"inherit\" {...activeDevice.icon} />}\n endIcon={\n <MdiIcon fontSize=\"inherit\" path={ICON_VARIANT_MENU_DOWN.path} />\n }\n sx={{\n borderColor: 'divider',\n '& .MuiButton-endIcon': { ml: 0.15 },\n '& .MuiButton-startIcon': { mr: 0.85 },\n }}\n >\n {activeDevice.children}\n </MuiButton>\n </MuiTooltip>\n </MuiButtonGroup>\n </Menu>\n )\n})\nDevicePreviewControlsComponent.displayName = 'DevicePreviewControlsComponent'\nDevicePreviewControlsComponent.aglyn = true\n\nexport { DevicePreviewControlsComponent }\nexport default DevicePreviewControlsComponent\n"],"names":["BesignerDeviceFlag","ICON_VARIANT_FLUID_RESPONSIVE","ICON_VARIANT_LAPTOP","ICON_VARIANT_MENU_DOWN","ICON_VARIANT_MOBILE","ICON_VARIANT_MONITOR_LARGE","ICON_VARIANT_MONITOR_SMALL","ICON_VARIANT_SYMBOL_CONFIRMED","ICON_VARIANT_TABLET","MdiIcon","Menu","Button","MuiButton","ButtonGroup","MuiButtonGroup","Tooltip","MuiTooltip","forwardRef","useCallback","useMemo","useState","useAglynBesignerFlag","devicePreviewOptions","children","value","RESPONSIVE","icon","path","XS","SM","MD","LG","XL","DevicePreviewControlsComponent","props","ref","rest","devicePreview","setDevicePreview","anchorEl","setAnchorEl","devicesMenuOpen","setDevicesMenuOpen","activeDevice","find","i","handleMenuClose","event","handleOpenMenu","handleMenuClick","device","id","onClick","horizontalOrigin","items","type","sx","lineHeight","theme","typography","pxToRem","map","item","key","selected","disabled","endIcon","undefined","size","variant","color","title","aria-label","aria-haspopup","aria-controls","aria-expanded","startIcon","fontSize","borderColor","ml","mr","displayName","aglyn"],"mappings":";;AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,kBAAkB,QAAQ,kBAAiB;AACpD,SACEC,6BAA6B,EAC7BC,mBAAmB,EACnBC,sBAAsB,EACtBC,mBAAmB,EACnBC,0BAA0B,EAC1BC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,mBAAmB,QACd,2BAA0B;AACjC,SAASC,OAAO,EAAEC,IAAI,QAAmB,uBAAsB;AAC/D,SACEC,UAAUC,SAAS,EACnBC,eAAeC,cAAc,EAC7BC,WAAWC,UAAU,QAChB,gBAAe;AACtB,SACEC,UAAU,EAEVC,WAAW,EACXC,OAAO,EACPC,QAAQ,QACH,QAAO;AACd,OAAOC,0BAA0B,sCAAkC;AAEnE,MAAMC,uBAAuB;IAC3B;QACEC,UAAU;QACVC,OAAOxB,mBAAmByB,UAAU;QACpCC,MAAM;YAAEC,MAAM1B,8BAA8B0B,IAAI;QAAC;IACnD;IACA;QACEJ,UAAU;QACVC,OAAOxB,mBAAmB4B,EAAE;QAC5BF,MAAM;YAAEC,MAAMvB,oBAAoBuB,IAAI;QAAC;IACzC;IACA;QACEJ,UAAU;QACVC,OAAOxB,mBAAmB6B,EAAE;QAC5BH,MAAM;YAAEC,MAAMnB,oBAAoBmB,IAAI;QAAC;IACzC;IACA;QACEJ,UAAU;QACVC,OAAOxB,mBAAmB8B,EAAE;QAC5BJ,MAAM;YAAEC,MAAMzB,oBAAoByB,IAAI;QAAC;IACzC;IACA;QACEJ,UAAU;QACVC,OAAOxB,mBAAmB+B,EAAE;QAC5BL,MAAM;YAAEC,MAAMrB,2BAA2BqB,IAAI;QAAC;IAChD;IACA;QACEJ,UAAU;QACVC,OAAOxB,mBAAmBgC,EAAE;QAC5BN,MAAM;YAAEC,MAAMtB,2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AAWC,OAAM;sBACpD,cAAA,KAACtD;gBAAWuD,OAAO;0BACjB,cAAA,KAAC3D;oBACC4D,cAAW;oBACXC,iBAAc;oBACdC,iBAAejC,kBAAkB,yBAAyB0B;oBAC1DQ,iBAAelC,kBAAkB,SAAS0B;oBAC1ChC,KAAKK;oBACLY,SAASJ;oBACT4B,yBAAW,KAACnE;wBAAQoE,UAAS;uBAAclC,aAAajB,IAAI;oBAC5DwC,uBACE,KAACzD;wBAAQoE,UAAS;wBAAUlD,MAAMxB,uBAAuBwB,IAAI;;oBAE/D6B,IAAI;wBACFsB,aAAa;wBACb,wBAAwB;4BAAEC,IAAI;wBAAK;wBACnC,0BAA0B;4BAAEC,IAAI;wBAAK;oBACvC;8BAECrC,aAAapB,QAAQ;;;;;AAMlC;AACAU,+BAA+BgD,WAAW,GAAG;AAC7ChD,+BAA+BiD,KAAK,GAAG;AAEvC,SAASjD,8BAA8B,GAAE;AACzC,eAAeA,+BAA8B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 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
|
+
export declare const CanvasDropIndicator: (() => import("react").JSX.Element) & {
|
|
18
|
+
displayName: string;
|
|
19
|
+
};
|
|
20
|
+
export default CanvasDropIndicator;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
import { jsx as _jsx } 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 * as Besigner from "@aglyn/besigner";
|
|
19
|
+
import { useDndMonitor } from "@dnd-kit/core";
|
|
20
|
+
import { observer } from "mobx-react-lite";
|
|
21
|
+
import { useState } from "react";
|
|
22
|
+
import DropIndicator from "./drop-indicator.js";
|
|
23
|
+
const DEFAULT = {
|
|
24
|
+
region: Besigner.DropRegion.CHILDREN,
|
|
25
|
+
rect: {
|
|
26
|
+
left: 0,
|
|
27
|
+
top: 0,
|
|
28
|
+
height: 0,
|
|
29
|
+
right: 0,
|
|
30
|
+
bottom: 0,
|
|
31
|
+
width: 0
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
export const CanvasDropIndicator = observer(()=>{
|
|
35
|
+
const [visible, setVisible] = useState(false);
|
|
36
|
+
const [rect, setRect] = useState(()=>_extends({}, DEFAULT.rect));
|
|
37
|
+
const [region, setRegion] = useState(DEFAULT.region);
|
|
38
|
+
useDndMonitor({
|
|
39
|
+
onDragStart: (event)=>setVisible(true),
|
|
40
|
+
onDragEnd: (event)=>setVisible(false),
|
|
41
|
+
onDragCancel: (event)=>setVisible(false),
|
|
42
|
+
onDragOver (event) {
|
|
43
|
+
var _event_over;
|
|
44
|
+
setVisible(Boolean(event.over));
|
|
45
|
+
if (event.over) setRect((_event_over = event.over) == null ? void 0 : _event_over.rect);
|
|
46
|
+
},
|
|
47
|
+
onDragMove: (event)=>{
|
|
48
|
+
var _event_over;
|
|
49
|
+
setRegion(((_event_over = event.over) == null ? void 0 : _event_over.data.current.region) || DEFAULT.region);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
return /*#__PURE__*/ _jsx(DropIndicator, {
|
|
53
|
+
rect: rect,
|
|
54
|
+
visible: visible,
|
|
55
|
+
region: region
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
CanvasDropIndicator.displayName = 'CanvasDropIndicator';
|
|
59
|
+
export default CanvasDropIndicator;
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=canvas-drop-indicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../libs/besigner/feature/designer/src/lib/components/dnd/canvas-drop-indicator.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 * as Besigner from '@aglyn/besigner'\nimport {\n type ClientRect,\n type DragCancelEvent,\n type DragEndEvent,\n type DragMoveEvent,\n DragOverEvent,\n type DragStartEvent,\n useDndMonitor,\n} from '@dnd-kit/core'\nimport { observer } from 'mobx-react-lite'\nimport { useState } from 'react'\nimport DropIndicator from './drop-indicator'\n\nconst DEFAULT: { region: Besigner.DropRegion; rect: ClientRect } = {\n region: Besigner.DropRegion.CHILDREN,\n rect: {\n left: 0,\n top: 0,\n height: 0,\n right: 0,\n bottom: 0,\n width: 0,\n },\n}\n\nexport const CanvasDropIndicator = observer(() => {\n const [visible, setVisible] = useState(false)\n const [rect, setRect] = useState<ClientRect>(() => ({ ...DEFAULT.rect }))\n const [region, setRegion] = useState<Besigner.DropRegion>(DEFAULT.region)\n\n useDndMonitor({\n onDragStart: (event: DragStartEvent) => setVisible(true),\n onDragEnd: (event: DragEndEvent) => setVisible(false),\n onDragCancel: (event: DragCancelEvent) => setVisible(false),\n onDragOver(event: DragOverEvent) {\n setVisible(Boolean(event.over))\n if (event.over) setRect(event.over?.rect)\n },\n onDragMove: (event: DragMoveEvent) => {\n setRegion(event.over?.data.current.region || DEFAULT.region)\n },\n })\n\n return <DropIndicator rect={rect} visible={visible} region={region} />\n})\nCanvasDropIndicator.displayName = 'CanvasDropIndicator'\n\nexport default CanvasDropIndicator\n"],"names":["Besigner","useDndMonitor","observer","useState","DropIndicator","DEFAULT","region","DropRegion","CHILDREN","rect","left","top","height","right","bottom","width","CanvasDropIndicator","visible","setVisible","setRect","setRegion","onDragStart","event","onDragEnd","onDragCancel","onDragOver","Boolean","over","onDragMove","data","current","displayName"],"mappings":";;AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,cAAc,kBAAiB;AAC3C,SAOEC,aAAa,QACR,gBAAe;AACtB,SAASC,QAAQ,QAAQ,kBAAiB;AAC1C,SAASC,QAAQ,QAAQ,QAAO;AAChC,OAAOC,mBAAmB,sBAAkB;AAE5C,MAAMC,UAA6D;IACjEC,QAAQN,SAASO,UAAU,CAACC,QAAQ;IACpCC,MAAM;QACJC,MAAM;QACNC,KAAK;QACLC,QAAQ;QACRC,OAAO;QACPC,QAAQ;QACRC,OAAO;IACT;AACF;AAEA,OAAO,MAAMC,sBAAsBd,SAAS;IAC1C,MAAM,CAACe,SAASC,WAAW,GAAGf,SAAS;IACvC,MAAM,CAACM,MAAMU,QAAQ,GAAGhB,SAAqB,IAAO,aAAKE,QAAQI,IAAI;IACrE,MAAM,CAACH,QAAQc,UAAU,GAAGjB,SAA8BE,QAAQC,MAAM;IAExEL,cAAc;QACZoB,aAAa,CAACC,QAA0BJ,WAAW;QACnDK,WAAW,CAACD,QAAwBJ,WAAW;QAC/CM,cAAc,CAACF,QAA2BJ,WAAW;QACrDO,YAAWH,KAAoB;gBAELA;YADxBJ,WAAWQ,QAAQJ,MAAMK,IAAI;YAC7B,IAAIL,MAAMK,IAAI,EAAER,SAAQG,cAAAA,MAAMK,IAAI,qBAAVL,YAAYb,IAAI;QAC1C;QACAmB,YAAY,CAACN;gBACDA;YAAVF,UAAUE,EAAAA,cAAAA,MAAMK,IAAI,qBAAVL,YAAYO,IAAI,CAACC,OAAO,CAACxB,MAAM,KAAID,QAAQC,MAAM;QAC7D;IACF;IAEA,qBAAO,KAACF;QAAcK,MAAMA;QAAMQ,SAASA;QAASX,QAAQA;;AAC9D,GAAE;AACFU,oBAAoBe,WAAW,GAAG;AAElC,eAAef,oBAAmB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 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 * as Aglyn from '@aglyn/aglyn';
|
|
18
|
+
import * as Besigner from '@aglyn/besigner';
|
|
19
|
+
export interface DraggableDroppableProps<T extends Aglyn.NodeSchema<any>> {
|
|
20
|
+
children: JSX.Element;
|
|
21
|
+
node: T;
|
|
22
|
+
type: Besigner.DragType;
|
|
23
|
+
accept: Besigner.DragType[];
|
|
24
|
+
disableDragging?: boolean;
|
|
25
|
+
disableDropping?: boolean;
|
|
26
|
+
idSuffix?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const DraggableDroppable: (<T extends Aglyn.NodeSchema<any>>(props: DraggableDroppableProps<T>) => import("react").FunctionComponentElement<any>) & {
|
|
29
|
+
displayName: string;
|
|
30
|
+
};
|
|
31
|
+
export default DraggableDroppable;
|