@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/besigner-conflict-alert.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 { Alert, Button } from '@mui/material'\n\nexport interface BesignerConflictAlertProps {\n /** 'screen', 'layout', 'component', 'template', 'email'. */\n noun: string\n}\n\n/**\n * The concurrent-save conflict banner (AGL-1301): someone else saved this\n * document while the author was editing, so saving is paused until they\n * reload. Shown as soon as the remote save lands, not on Save — finding\n * out after twenty more minutes of editing is the bad version of this\n * (AGL-674).\n *\n * One component for every besigner editor so the copy names the document\n * kind the author is actually in — the AGL-1301 adoption copy-pasted the\n * banner per page and two editors kept another page's noun. The single\n * action is Reload, deliberately: there is no \"save anyway\" that could\n * silently destroy a teammate's work, and the canvas keeps everything\n * until the reload.\n */\nexport function BesignerConflictAlertComponent(\n props: BesignerConflictAlertProps,\n) {\n const { noun } = props\n return (\n <Alert\n severity=\"warning\"\n sx={{ borderRadius: 0, position: 'relative', zIndex: 'appBar' }}\n action={\n <Button\n color=\"inherit\"\n size=\"small\"\n onClick={() => window.location.reload()}\n >\n {'Reload'}\n </Button>\n }\n >\n {`Someone else saved this ${noun} while you were editing. ` +\n 'Saving is paused so their work is not overwritten — ' +\n 'reload to pick up their changes. Nothing you have done ' +\n 'here is lost until you do.'}\n </Alert>\n )\n}\n\nexport default BesignerConflictAlertComponent\n"],"names":["Alert","Button","BesignerConflictAlertComponent","props","noun","severity","sx","borderRadius","position","zIndex","action","color","size","onClick","window","location","reload"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,KAAK,EAAEC,MAAM,QAAQ,gBAAe;AAO7C;;;;;;;;;;;;;CAaC,GACD,OAAO,SAASC,+BACdC,KAAiC;IAEjC,MAAM,EAAEC,IAAI,EAAE,GAAGD;IACjB,qBACE,KAACH;QACCK,UAAS;QACTC,IAAI;YAAEC,cAAc;YAAGC,UAAU;YAAYC,QAAQ;QAAS;QAC9DC,sBACE,KAACT;YACCU,OAAM;YACNC,MAAK;YACLC,SAAS,IAAMC,OAAOC,QAAQ,CAACC,MAAM;sBAEpC;;kBAIJ,CAAC,wBAAwB,EAAEZ,KAAK,yBAAyB,CAAC,GACzD,yDACA,4DACA;;AAGR;AAEA,eAAeF,+BAA8B"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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 { Modifier } from '@dnd-kit/core';
|
|
18
|
+
import type { BackendFactory } from 'dnd-core';
|
|
19
|
+
export declare const snapDraggingToCursor: Modifier;
|
|
20
|
+
export interface BesignerDndContextProps<BackendContext, BackendOptions> {
|
|
21
|
+
children?: JSX.Children;
|
|
22
|
+
backend?: BackendFactory;
|
|
23
|
+
context?: BackendContext;
|
|
24
|
+
options?: BackendOptions;
|
|
25
|
+
debugMode?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare function BesignerDndContext<T, U>(props: BesignerDndContextProps<T, U>): import("react").JSX.Element;
|
|
28
|
+
export declare namespace BesignerDndContext {
|
|
29
|
+
var displayName: string;
|
|
30
|
+
var aglyn: boolean;
|
|
31
|
+
}
|
|
32
|
+
export default BesignerDndContext;
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
*/ import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
17
|
+
import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
import { DndContext, KeyboardSensor, MeasuringStrategy, MouseSensor, PointerSensor, pointerWithin, TouchSensor, useSensor, useSensors } from "@dnd-kit/core";
|
|
20
|
+
import { getEventCoordinates } from "@dnd-kit/utilities";
|
|
21
|
+
import { DndProvider } from "react-dnd";
|
|
22
|
+
import { HTML5Backend } from "react-dnd-html5-backend";
|
|
23
|
+
export const snapDraggingToCursor = ({ activatorEvent, draggingNodeRect, transform })=>{
|
|
24
|
+
if (draggingNodeRect && activatorEvent) {
|
|
25
|
+
const activatorCoordinates = getEventCoordinates(activatorEvent);
|
|
26
|
+
if (!activatorCoordinates) return transform;
|
|
27
|
+
const offsetX = activatorCoordinates.x - draggingNodeRect.left;
|
|
28
|
+
const offsetY = activatorCoordinates.y - draggingNodeRect.top;
|
|
29
|
+
return _extends({}, transform, {
|
|
30
|
+
x: transform.x + offsetX + 2,
|
|
31
|
+
y: transform.y + offsetY + 2
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return transform;
|
|
35
|
+
};
|
|
36
|
+
export function BesignerDndContext(props) {
|
|
37
|
+
const { children, options } = props, rest = _object_without_properties_loose(props, [
|
|
38
|
+
"children",
|
|
39
|
+
"options"
|
|
40
|
+
]);
|
|
41
|
+
const opts = _extends({
|
|
42
|
+
enableTouchEvents: true,
|
|
43
|
+
enableMouseEvents: true,
|
|
44
|
+
enableKeyboardEvents: true,
|
|
45
|
+
delay: 0,
|
|
46
|
+
delayTouchStart: 0,
|
|
47
|
+
delayMouseStart: 0,
|
|
48
|
+
touchSlop: 0
|
|
49
|
+
}, options);
|
|
50
|
+
const sensors = useSensors(useSensor(MouseSensor), useSensor(PointerSensor), useSensor(TouchSensor), useSensor(KeyboardSensor));
|
|
51
|
+
return /*#__PURE__*/ _jsx(DndProvider, _extends({
|
|
52
|
+
backend: HTML5Backend,
|
|
53
|
+
options: opts
|
|
54
|
+
}, rest, {
|
|
55
|
+
debugMode: true,
|
|
56
|
+
children: /*#__PURE__*/ _jsx(DndContext, {
|
|
57
|
+
sensors: sensors,
|
|
58
|
+
modifiers: [
|
|
59
|
+
snapDraggingToCursor
|
|
60
|
+
],
|
|
61
|
+
collisionDetection: pointerWithin,
|
|
62
|
+
measuring: {
|
|
63
|
+
droppable: {
|
|
64
|
+
strategy: MeasuringStrategy.Always
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
children: children
|
|
68
|
+
})
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
BesignerDndContext.displayName = 'BesignerDndContext';
|
|
72
|
+
BesignerDndContext.aglyn = true;
|
|
73
|
+
export default BesignerDndContext;
|
|
74
|
+
|
|
75
|
+
//# sourceMappingURL=besigner-dnd-context.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/besigner-dnd-context.component.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 type { Modifier } from '@dnd-kit/core'\nimport {\n DndContext,\n KeyboardSensor,\n MeasuringStrategy,\n MouseSensor,\n PointerSensor,\n pointerWithin,\n TouchSensor,\n useSensor,\n useSensors,\n} from '@dnd-kit/core'\nimport { getEventCoordinates } from '@dnd-kit/utilities'\nimport type { BackendFactory } from 'dnd-core'\nimport { DndProvider } from 'react-dnd'\nimport { HTML5Backend } from 'react-dnd-html5-backend'\n\nexport const snapDraggingToCursor: Modifier = ({\n activatorEvent,\n draggingNodeRect,\n transform,\n}) => {\n if (draggingNodeRect && activatorEvent) {\n const activatorCoordinates = getEventCoordinates(activatorEvent)\n if (!activatorCoordinates) return transform\n\n const offsetX = activatorCoordinates.x - draggingNodeRect.left\n const offsetY = activatorCoordinates.y - draggingNodeRect.top\n\n return {\n ...transform,\n x: transform.x + offsetX + 2,\n y: transform.y + offsetY + 2,\n }\n }\n\n return transform\n}\nexport interface BesignerDndContextProps<BackendContext, BackendOptions> {\n children?: JSX.Children\n backend?: BackendFactory\n context?: BackendContext\n options?: BackendOptions\n debugMode?: boolean\n}\n\nexport function BesignerDndContext<T, U>(props: BesignerDndContextProps<T, U>) {\n const { children, options, ...rest } = props\n const opts = {\n enableTouchEvents: true,\n enableMouseEvents: true,\n enableKeyboardEvents: true,\n delay: 0,\n delayTouchStart: 0,\n delayMouseStart: 0,\n touchSlop: 0,\n ...options,\n }\n\n const sensors = useSensors(\n useSensor(MouseSensor),\n useSensor(PointerSensor),\n useSensor(TouchSensor),\n useSensor(KeyboardSensor),\n )\n\n return (\n <DndProvider backend={HTML5Backend} options={opts} {...rest} debugMode>\n <DndContext\n sensors={sensors}\n modifiers={[snapDraggingToCursor]}\n collisionDetection={pointerWithin}\n measuring={{\n droppable: {\n strategy: MeasuringStrategy.Always,\n },\n }}\n >\n {children}\n </DndContext>\n </DndProvider>\n )\n}\nBesignerDndContext.displayName = 'BesignerDndContext'\nBesignerDndContext.aglyn = true\n\nexport default BesignerDndContext\n"],"names":["DndContext","KeyboardSensor","MeasuringStrategy","MouseSensor","PointerSensor","pointerWithin","TouchSensor","useSensor","useSensors","getEventCoordinates","DndProvider","HTML5Backend","snapDraggingToCursor","activatorEvent","draggingNodeRect","transform","activatorCoordinates","offsetX","x","left","offsetY","y","top","BesignerDndContext","props","children","options","rest","opts","enableTouchEvents","enableMouseEvents","enableKeyboardEvents","delay","delayTouchStart","delayMouseStart","touchSlop","sensors","backend","debugMode","modifiers","collisionDetection","measuring","droppable","strategy","Always","displayName","aglyn"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC;;;AAGD,SACEA,UAAU,EACVC,cAAc,EACdC,iBAAiB,EACjBC,WAAW,EACXC,aAAa,EACbC,aAAa,EACbC,WAAW,EACXC,SAAS,EACTC,UAAU,QACL,gBAAe;AACtB,SAASC,mBAAmB,QAAQ,qBAAoB;AAExD,SAASC,WAAW,QAAQ,YAAW;AACvC,SAASC,YAAY,QAAQ,0BAAyB;AAEtD,OAAO,MAAMC,uBAAiC,CAAC,EAC7CC,cAAc,EACdC,gBAAgB,EAChBC,SAAS,EACV;IACC,IAAID,oBAAoBD,gBAAgB;QACtC,MAAMG,uBAAuBP,oBAAoBI;QACjD,IAAI,CAACG,sBAAsB,OAAOD;QAElC,MAAME,UAAUD,qBAAqBE,CAAC,GAAGJ,iBAAiBK,IAAI;QAC9D,MAAMC,UAAUJ,qBAAqBK,CAAC,GAAGP,iBAAiBQ,GAAG;QAE7D,OAAO,aACFP;YACHG,GAAGH,UAAUG,CAAC,GAAGD,UAAU;YAC3BI,GAAGN,UAAUM,CAAC,GAAGD,UAAU;;IAE/B;IAEA,OAAOL;AACT,EAAC;AASD,OAAO,SAASQ,mBAAyBC,KAAoC;IAC3E,MAAM,EAAEC,QAAQ,EAAEC,OAAO,EAAW,GAAGF,OAATG,wCAASH;;;;IACvC,MAAMI,OAAO;QACXC,mBAAmB;QACnBC,mBAAmB;QACnBC,sBAAsB;QACtBC,OAAO;QACPC,iBAAiB;QACjBC,iBAAiB;QACjBC,WAAW;OACRT;IAGL,MAAMU,UAAU5B,WACdD,UAAUJ,cACVI,UAAUH,gBACVG,UAAUD,cACVC,UAAUN;IAGZ,qBACE,KAACS;QAAY2B,SAAS1B;QAAce,SAASE;OAAUD;QAAMW,SAAS;kBACpE,cAAA,KAACtC;YACCoC,SAASA;YACTG,WAAW;gBAAC3B;aAAqB;YACjC4B,oBAAoBnC;YACpBoC,WAAW;gBACTC,WAAW;oBACTC,UAAUzC,kBAAkB0C,MAAM;gBACpC;YACF;sBAECnB;;;AAIT;AACAF,mBAAmBsB,WAAW,GAAG;AACjCtB,mBAAmBuB,KAAK,GAAG;AAE3B,eAAevB,mBAAkB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import type { BesignerDraftState } from '../hooks/use-besigner-draft';
|
|
18
|
+
export interface BesignerDraftAlertProps {
|
|
19
|
+
draft: BesignerDraftState;
|
|
20
|
+
/** 'screen', 'layout', 'component', 'template', 'email'. */
|
|
21
|
+
noun: string;
|
|
22
|
+
/**
|
|
23
|
+
* Someone else saved this document since it loaded, i.e. what
|
|
24
|
+
* `BesignerConflictAlertComponent` says on its own (AGL-2486).
|
|
25
|
+
*
|
|
26
|
+
* Passed in so ONE banner covers the condition. Stacked, the two describe a
|
|
27
|
+
* single event — a colleague's save — in two voices, and reassure in
|
|
28
|
+
* opposite directions. An editor that renders this alert must render the
|
|
29
|
+
* conflict alert only while this one is absent.
|
|
30
|
+
*/
|
|
31
|
+
remoteChanged?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/** "3 minutes ago" — coarse on purpose; the exact second helps nobody. */
|
|
34
|
+
export declare function describeDraftAge(takenAt: number | null, now: number): string;
|
|
35
|
+
/**
|
|
36
|
+
* The message this alert carries, given what the draft can and cannot do.
|
|
37
|
+
*
|
|
38
|
+
* Exported for its spec: the copy is the product decision in AGL-2486 —
|
|
39
|
+
* which of two "unsaved" states the author is looking at, and whether the
|
|
40
|
+
* one in this browser may still be put back — so it is asserted directly
|
|
41
|
+
* rather than through a rendered tree.
|
|
42
|
+
*/
|
|
43
|
+
export declare function describeDraftOffer(draft: BesignerDraftState, noun: string, now: number, remoteChanged?: boolean): string;
|
|
44
|
+
/**
|
|
45
|
+
* Offers back unsaved work a crash or reload took away (AGL-1256), and says
|
|
46
|
+
* when it may not be offered (AGL-2486).
|
|
47
|
+
*
|
|
48
|
+
* It asks rather than restoring on its own. Silently replacing a document
|
|
49
|
+
* with a local snapshot would be a worse bug than the one being fixed — and
|
|
50
|
+
* the author is the only one who knows whether the version they are looking
|
|
51
|
+
* at is the one they meant to be in.
|
|
52
|
+
*
|
|
53
|
+
* When the room is SHARED this banner does not render at all. Discard never
|
|
54
|
+
* touches the canvas, so nothing anybody is looking at changes when it is
|
|
55
|
+
* pressed — but it does delete the draft, in both stores, and a prompt whose
|
|
56
|
+
* only remaining button is a delete, over a document several people are
|
|
57
|
+
* mid-edit in, is a question that should not be asked. See `roomIsShared` in
|
|
58
|
+
* `use-besigner-draft`.
|
|
59
|
+
*
|
|
60
|
+
* What is left here is the case where this editor is alone and something
|
|
61
|
+
* still stands in the way of a restore: a colleague SAVED while the draft
|
|
62
|
+
* was stranded, or the mirror replayed work onto the canvas while presence
|
|
63
|
+
* could not report the room. Restoring is a whole-map replace that the
|
|
64
|
+
* co-edit mirror publishes verbatim, so the older "restoring will not
|
|
65
|
+
* overwrite their work" was not true from the colleague's side of the
|
|
66
|
+
* screen: their unsaved node was deleted on their own canvas, and a stale
|
|
67
|
+
* restore survived the reload this banner asks for.
|
|
68
|
+
*/
|
|
69
|
+
export declare function BesignerDraftAlertComponent(props: BesignerDraftAlertProps): import("react").JSX.Element;
|
|
70
|
+
export default BesignerDraftAlertComponent;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2026 Aglyn LLC
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/ import { Alert, Button, Stack } from "@mui/material";
|
|
18
|
+
/** "3 minutes ago" — coarse on purpose; the exact second helps nobody. */ export function describeDraftAge(takenAt, now) {
|
|
19
|
+
if (!takenAt) return 'a moment ago';
|
|
20
|
+
const minutes = Math.floor(Math.max(0, now - takenAt) / 60000);
|
|
21
|
+
if (minutes < 1) return 'less than a minute ago';
|
|
22
|
+
if (minutes === 1) return '1 minute ago';
|
|
23
|
+
if (minutes < 60) return `${minutes} minutes ago`;
|
|
24
|
+
const hours = Math.round(minutes / 60);
|
|
25
|
+
if (hours === 1) return 'about an hour ago';
|
|
26
|
+
if (hours < 24) return `about ${hours} hours ago`;
|
|
27
|
+
const days = Math.round(hours / 24);
|
|
28
|
+
return days === 1 ? 'about a day ago' : `about ${days} days ago`;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The message this alert carries, given what the draft can and cannot do.
|
|
32
|
+
*
|
|
33
|
+
* Exported for its spec: the copy is the product decision in AGL-2486 —
|
|
34
|
+
* which of two "unsaved" states the author is looking at, and whether the
|
|
35
|
+
* one in this browser may still be put back — so it is asserted directly
|
|
36
|
+
* rather than through a rendered tree.
|
|
37
|
+
*/ export function describeDraftOffer(draft, noun, now, remoteChanged = false) {
|
|
38
|
+
const age = describeDraftAge(draft.takenAt, now);
|
|
39
|
+
/**
|
|
40
|
+
* A saved draft whose store recorded no time names no age: "a moment ago"
|
|
41
|
+
* would claim a recency nobody measured, and a stranded draft described as
|
|
42
|
+
* brand new reads as somebody's work in progress (AGL-2868).
|
|
43
|
+
*/ const savedFrom = draft.takenAt ? ` from ${age}` : '';
|
|
44
|
+
/**
|
|
45
|
+
* The SHARED working draft is a different sentence from the crash net, and
|
|
46
|
+
* saying the crash net's one over it is the AGL-2508 defect: an author who
|
|
47
|
+
* pressed Save draft, was told "Draft saved", and came back to
|
|
48
|
+
* "Unsaved changes … were recovered from this browser" reads a save that
|
|
49
|
+
* failed and a browser that rescued them. Both halves are wrong — it saved,
|
|
50
|
+
* and it is on the server — and the reasonable conclusion is that the
|
|
51
|
+
* editor loses work, which sends people re-doing edits they already have.
|
|
52
|
+
*
|
|
53
|
+
* The canvas loads the stored document and the draft is OFFERED rather than
|
|
54
|
+
* applied, which is the right call and is not what changes here. What
|
|
55
|
+
* changes is that the offer now says which of the two it is.
|
|
56
|
+
*/ const found = draft.origin === 'shared' ? `This ${noun} has a saved draft${savedFrom} that has not been ` + 'published. It is stored with the site, so anyone who opens this ' + `${noun} sees it offered. ` : `Unsaved changes to this ${noun} from ${age} were recovered from ` + 'this browser. ';
|
|
57
|
+
switch(draft.restoreBlockedBy){
|
|
58
|
+
case 'saved-since':
|
|
59
|
+
/*
|
|
60
|
+
* A SAVED draft the document has moved past (AGL-2874). The crash-net
|
|
61
|
+
* sentences below speak of unsaved changes in this browser, and a saved
|
|
62
|
+
* draft is neither (AGL-2508). What the author needs instead is that it
|
|
63
|
+
* cannot be opened and that Discard is what stops it being offered.
|
|
64
|
+
*/ if (draft.origin === 'shared') {
|
|
65
|
+
return `This ${noun} has a saved draft${savedFrom}, but the ${noun} has ` + 'been saved since it was taken, so opening it would undo that save ' + '— it can no longer be opened. ' + (remoteChanged ? `Someone else has also saved this ${noun} since it loaded, so ` + 'saving is paused until you reload.' : 'Discard it once nobody needs it; nothing else is affected.');
|
|
66
|
+
}
|
|
67
|
+
// Whether saving is PAUSED is a different fact from whether the draft
|
|
68
|
+
// may be put back, and only `remoteChanged` can answer it. A draft
|
|
69
|
+
// stranded by a save that landed before this editor even opened blocks
|
|
70
|
+
// nothing: the canvas holds the stored document, Save works, and there
|
|
71
|
+
// is no conflict to reload out of. Claiming otherwise sent authors
|
|
72
|
+
// reloading a document nobody had touched in days, looking for a
|
|
73
|
+
// colleague who was not there.
|
|
74
|
+
if (!remoteChanged) {
|
|
75
|
+
return `This ${noun} has been saved since the unsaved changes from ${age} ` + 'in this browser were taken, so putting them back would undo that ' + 'save — they are not offered. Nothing else is affected: this ' + 'canvas holds the saved document and saving works as usual.';
|
|
76
|
+
}
|
|
77
|
+
// One banner for one event. The conflict half comes first because it
|
|
78
|
+
// is the thing that already happened; the draft half is what the
|
|
79
|
+
// author is being told they cannot do about it.
|
|
80
|
+
return `Someone else saved this ${noun} while you were editing, so saving ` + 'is paused until you reload — nothing on this canvas is lost until ' + `then. Unsaved changes from ${age} were also found in this browser, ` + 'but they pre-date their save: putting them back would roll it ' + 'back, so they are not offered.';
|
|
81
|
+
default:
|
|
82
|
+
return found + (remoteChanged ? `Someone else has also saved this ${noun} since it loaded, so ` + 'saving is paused until you reload. Restoring puts your changes ' + 'back on the canvas without saving; you can undo it.' : draft.origin === 'shared' ? 'Opening it puts it back on the canvas; publish when you are ' + 'ready, or discard it to go back to what is live.' : 'Restoring puts them back on the canvas without saving; you ' + 'can undo it.');
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Offers back unsaved work a crash or reload took away (AGL-1256), and says
|
|
87
|
+
* when it may not be offered (AGL-2486).
|
|
88
|
+
*
|
|
89
|
+
* It asks rather than restoring on its own. Silently replacing a document
|
|
90
|
+
* with a local snapshot would be a worse bug than the one being fixed — and
|
|
91
|
+
* the author is the only one who knows whether the version they are looking
|
|
92
|
+
* at is the one they meant to be in.
|
|
93
|
+
*
|
|
94
|
+
* When the room is SHARED this banner does not render at all. Discard never
|
|
95
|
+
* touches the canvas, so nothing anybody is looking at changes when it is
|
|
96
|
+
* pressed — but it does delete the draft, in both stores, and a prompt whose
|
|
97
|
+
* only remaining button is a delete, over a document several people are
|
|
98
|
+
* mid-edit in, is a question that should not be asked. See `roomIsShared` in
|
|
99
|
+
* `use-besigner-draft`.
|
|
100
|
+
*
|
|
101
|
+
* What is left here is the case where this editor is alone and something
|
|
102
|
+
* still stands in the way of a restore: a colleague SAVED while the draft
|
|
103
|
+
* was stranded, or the mirror replayed work onto the canvas while presence
|
|
104
|
+
* could not report the room. Restoring is a whole-map replace that the
|
|
105
|
+
* co-edit mirror publishes verbatim, so the older "restoring will not
|
|
106
|
+
* overwrite their work" was not true from the colleague's side of the
|
|
107
|
+
* screen: their unsaved node was deleted on their own canvas, and a stale
|
|
108
|
+
* restore survived the reload this banner asks for.
|
|
109
|
+
*/ export function BesignerDraftAlertComponent(props) {
|
|
110
|
+
const { draft, noun, remoteChanged = false } = props;
|
|
111
|
+
if (!draft.available) return null;
|
|
112
|
+
const blocked = draft.restoreBlockedBy !== null;
|
|
113
|
+
// The reload is the way out of a CONFLICT, so it is offered exactly while
|
|
114
|
+
// this banner is standing in for the conflict one. A stranded draft with no
|
|
115
|
+
// conflict behind it has nothing to reload for — the canvas already holds
|
|
116
|
+
// the stored document — and a Reload button there reads as an instruction
|
|
117
|
+
// to fix something that is not broken.
|
|
118
|
+
const offerReload = remoteChanged;
|
|
119
|
+
return /*#__PURE__*/ _jsx(Alert, {
|
|
120
|
+
severity: blocked || remoteChanged ? 'warning' : 'info',
|
|
121
|
+
sx: {
|
|
122
|
+
borderRadius: 0,
|
|
123
|
+
position: 'relative',
|
|
124
|
+
zIndex: 'appBar'
|
|
125
|
+
},
|
|
126
|
+
action: /*#__PURE__*/ _jsxs(Stack, {
|
|
127
|
+
direction: "row",
|
|
128
|
+
spacing: 1,
|
|
129
|
+
children: [
|
|
130
|
+
offerReload ? /*#__PURE__*/ _jsx(Button, {
|
|
131
|
+
color: "inherit",
|
|
132
|
+
size: "small",
|
|
133
|
+
onClick: ()=>window.location.reload(),
|
|
134
|
+
children: 'Reload'
|
|
135
|
+
}) : null,
|
|
136
|
+
blocked ? null : /*#__PURE__*/ _jsx(Button, {
|
|
137
|
+
color: "inherit",
|
|
138
|
+
size: "small",
|
|
139
|
+
onClick: draft.restore,
|
|
140
|
+
children: draft.origin === 'shared' ? 'Open draft' : 'Restore'
|
|
141
|
+
}),
|
|
142
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
143
|
+
color: "inherit",
|
|
144
|
+
size: "small",
|
|
145
|
+
onClick: draft.discard,
|
|
146
|
+
children: 'Discard'
|
|
147
|
+
})
|
|
148
|
+
]
|
|
149
|
+
}),
|
|
150
|
+
children: describeDraftOffer(draft, noun, Date.now(), remoteChanged)
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
export default BesignerDraftAlertComponent;
|
|
154
|
+
|
|
155
|
+
//# sourceMappingURL=besigner-draft-alert.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/besigner-draft-alert.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 { Alert, Button, Stack } from '@mui/material'\nimport type { BesignerDraftState } from '../hooks/use-besigner-draft'\n\nexport interface BesignerDraftAlertProps {\n draft: BesignerDraftState\n /** 'screen', 'layout', 'component', 'template', 'email'. */\n noun: string\n /**\n * Someone else saved this document since it loaded, i.e. what\n * `BesignerConflictAlertComponent` says on its own (AGL-2486).\n *\n * Passed in so ONE banner covers the condition. Stacked, the two describe a\n * single event — a colleague's save — in two voices, and reassure in\n * opposite directions. An editor that renders this alert must render the\n * conflict alert only while this one is absent.\n */\n remoteChanged?: boolean\n}\n\n/** \"3 minutes ago\" — coarse on purpose; the exact second helps nobody. */\nexport function describeDraftAge(takenAt: number | null, now: number): string {\n if (!takenAt) return 'a moment ago'\n const minutes = Math.floor(Math.max(0, now - takenAt) / 60_000)\n if (minutes < 1) return 'less than a minute ago'\n if (minutes === 1) return '1 minute ago'\n if (minutes < 60) return `${minutes} minutes ago`\n const hours = Math.round(minutes / 60)\n if (hours === 1) return 'about an hour ago'\n if (hours < 24) return `about ${hours} hours ago`\n const days = Math.round(hours / 24)\n return days === 1 ? 'about a day ago' : `about ${days} days ago`\n}\n\n/**\n * The message this alert carries, given what the draft can and cannot do.\n *\n * Exported for its spec: the copy is the product decision in AGL-2486 —\n * which of two \"unsaved\" states the author is looking at, and whether the\n * one in this browser may still be put back — so it is asserted directly\n * rather than through a rendered tree.\n */\nexport function describeDraftOffer(\n draft: BesignerDraftState,\n noun: string,\n now: number,\n remoteChanged = false,\n): string {\n const age = describeDraftAge(draft.takenAt, now)\n /**\n * A saved draft whose store recorded no time names no age: \"a moment ago\"\n * would claim a recency nobody measured, and a stranded draft described as\n * brand new reads as somebody's work in progress (AGL-2868).\n */\n const savedFrom = draft.takenAt ? ` from ${age}` : ''\n /**\n * The SHARED working draft is a different sentence from the crash net, and\n * saying the crash net's one over it is the AGL-2508 defect: an author who\n * pressed Save draft, was told \"Draft saved\", and came back to\n * \"Unsaved changes … were recovered from this browser\" reads a save that\n * failed and a browser that rescued them. Both halves are wrong — it saved,\n * and it is on the server — and the reasonable conclusion is that the\n * editor loses work, which sends people re-doing edits they already have.\n *\n * The canvas loads the stored document and the draft is OFFERED rather than\n * applied, which is the right call and is not what changes here. What\n * changes is that the offer now says which of the two it is.\n */\n const found =\n draft.origin === 'shared'\n ? `This ${noun} has a saved draft${savedFrom} that has not been ` +\n 'published. It is stored with the site, so anyone who opens this ' +\n `${noun} sees it offered. `\n : `Unsaved changes to this ${noun} from ${age} were recovered from ` +\n 'this browser. '\n switch (draft.restoreBlockedBy) {\n case 'saved-since':\n /*\n * A SAVED draft the document has moved past (AGL-2874). The crash-net\n * sentences below speak of unsaved changes in this browser, and a saved\n * draft is neither (AGL-2508). What the author needs instead is that it\n * cannot be opened and that Discard is what stops it being offered.\n */\n if (draft.origin === 'shared') {\n return (\n `This ${noun} has a saved draft${savedFrom}, but the ${noun} has ` +\n 'been saved since it was taken, so opening it would undo that save ' +\n '— it can no longer be opened. ' +\n (remoteChanged\n ? `Someone else has also saved this ${noun} since it loaded, so ` +\n 'saving is paused until you reload.'\n : 'Discard it once nobody needs it; nothing else is affected.')\n )\n }\n // Whether saving is PAUSED is a different fact from whether the draft\n // may be put back, and only `remoteChanged` can answer it. A draft\n // stranded by a save that landed before this editor even opened blocks\n // nothing: the canvas holds the stored document, Save works, and there\n // is no conflict to reload out of. Claiming otherwise sent authors\n // reloading a document nobody had touched in days, looking for a\n // colleague who was not there.\n if (!remoteChanged) {\n return (\n `This ${noun} has been saved since the unsaved changes from ${age} ` +\n 'in this browser were taken, so putting them back would undo that ' +\n 'save — they are not offered. Nothing else is affected: this ' +\n 'canvas holds the saved document and saving works as usual.'\n )\n }\n // One banner for one event. The conflict half comes first because it\n // is the thing that already happened; the draft half is what the\n // author is being told they cannot do about it.\n return (\n `Someone else saved this ${noun} while you were editing, so saving ` +\n 'is paused until you reload — nothing on this canvas is lost until ' +\n `then. Unsaved changes from ${age} were also found in this browser, ` +\n 'but they pre-date their save: putting them back would roll it ' +\n 'back, so they are not offered.'\n )\n default:\n return (\n found +\n (remoteChanged\n ? `Someone else has also saved this ${noun} since it loaded, so ` +\n 'saving is paused until you reload. Restoring puts your changes ' +\n 'back on the canvas without saving; you can undo it.'\n : draft.origin === 'shared'\n ? 'Opening it puts it back on the canvas; publish when you are ' +\n 'ready, or discard it to go back to what is live.'\n : 'Restoring puts them back on the canvas without saving; you ' +\n 'can undo it.')\n )\n }\n}\n\n/**\n * Offers back unsaved work a crash or reload took away (AGL-1256), and says\n * when it may not be offered (AGL-2486).\n *\n * It asks rather than restoring on its own. Silently replacing a document\n * with a local snapshot would be a worse bug than the one being fixed — and\n * the author is the only one who knows whether the version they are looking\n * at is the one they meant to be in.\n *\n * When the room is SHARED this banner does not render at all. Discard never\n * touches the canvas, so nothing anybody is looking at changes when it is\n * pressed — but it does delete the draft, in both stores, and a prompt whose\n * only remaining button is a delete, over a document several people are\n * mid-edit in, is a question that should not be asked. See `roomIsShared` in\n * `use-besigner-draft`.\n *\n * What is left here is the case where this editor is alone and something\n * still stands in the way of a restore: a colleague SAVED while the draft\n * was stranded, or the mirror replayed work onto the canvas while presence\n * could not report the room. Restoring is a whole-map replace that the\n * co-edit mirror publishes verbatim, so the older \"restoring will not\n * overwrite their work\" was not true from the colleague's side of the\n * screen: their unsaved node was deleted on their own canvas, and a stale\n * restore survived the reload this banner asks for.\n */\nexport function BesignerDraftAlertComponent(props: BesignerDraftAlertProps) {\n const { draft, noun, remoteChanged = false } = props\n if (!draft.available) return null\n const blocked = draft.restoreBlockedBy !== null\n // The reload is the way out of a CONFLICT, so it is offered exactly while\n // this banner is standing in for the conflict one. A stranded draft with no\n // conflict behind it has nothing to reload for — the canvas already holds\n // the stored document — and a Reload button there reads as an instruction\n // to fix something that is not broken.\n const offerReload = remoteChanged\n\n return (\n <Alert\n severity={blocked || remoteChanged ? 'warning' : 'info'}\n sx={{ borderRadius: 0, position: 'relative', zIndex: 'appBar' }}\n action={\n <Stack direction=\"row\" spacing={1}>\n {offerReload ? (\n <Button\n color=\"inherit\"\n size=\"small\"\n onClick={() => window.location.reload()}\n >\n {'Reload'}\n </Button>\n ) : null}\n {blocked ? null : (\n <Button color=\"inherit\" size=\"small\" onClick={draft.restore}>\n {/* A saved draft is OPENED; only unsaved work is restored. */}\n {draft.origin === 'shared' ? 'Open draft' : 'Restore'}\n </Button>\n )}\n <Button color=\"inherit\" size=\"small\" onClick={draft.discard}>\n {'Discard'}\n </Button>\n </Stack>\n }\n >\n {describeDraftOffer(draft, noun, Date.now(), remoteChanged)}\n </Alert>\n )\n}\n\nexport default BesignerDraftAlertComponent\n"],"names":["Alert","Button","Stack","describeDraftAge","takenAt","now","minutes","Math","floor","max","hours","round","days","describeDraftOffer","draft","noun","remoteChanged","age","savedFrom","found","origin","restoreBlockedBy","BesignerDraftAlertComponent","props","available","blocked","offerReload","severity","sx","borderRadius","position","zIndex","action","direction","spacing","color","size","onClick","window","location","reload","restore","discard","Date"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,KAAK,EAAEC,MAAM,EAAEC,KAAK,QAAQ,gBAAe;AAmBpD,wEAAwE,GACxE,OAAO,SAASC,iBAAiBC,OAAsB,EAAEC,GAAW;IAClE,IAAI,CAACD,SAAS,OAAO;IACrB,MAAME,UAAUC,KAAKC,KAAK,CAACD,KAAKE,GAAG,CAAC,GAAGJ,MAAMD,WAAW;IACxD,IAAIE,UAAU,GAAG,OAAO;IACxB,IAAIA,YAAY,GAAG,OAAO;IAC1B,IAAIA,UAAU,IAAI,OAAO,GAAGA,QAAQ,YAAY,CAAC;IACjD,MAAMI,QAAQH,KAAKI,KAAK,CAACL,UAAU;IACnC,IAAII,UAAU,GAAG,OAAO;IACxB,IAAIA,QAAQ,IAAI,OAAO,CAAC,MAAM,EAAEA,MAAM,UAAU,CAAC;IACjD,MAAME,OAAOL,KAAKI,KAAK,CAACD,QAAQ;IAChC,OAAOE,SAAS,IAAI,oBAAoB,CAAC,MAAM,EAAEA,KAAK,SAAS,CAAC;AAClE;AAEA;;;;;;;CAOC,GACD,OAAO,SAASC,mBACdC,KAAyB,EACzBC,IAAY,EACZV,GAAW,EACXW,gBAAgB,KAAK;IAErB,MAAMC,MAAMd,iBAAiBW,MAAMV,OAAO,EAAEC;IAC5C;;;;GAIC,GACD,MAAMa,YAAYJ,MAAMV,OAAO,GAAG,CAAC,MAAM,EAAEa,KAAK,GAAG;IACnD;;;;;;;;;;;;GAYC,GACD,MAAME,QACJL,MAAMM,MAAM,KAAK,WACb,CAAC,KAAK,EAAEL,KAAK,kBAAkB,EAAEG,UAAU,mBAAmB,CAAC,GAC/D,qEACA,GAAGH,KAAK,kBAAkB,CAAC,GAC3B,CAAC,wBAAwB,EAAEA,KAAK,MAAM,EAAEE,IAAI,qBAAqB,CAAC,GAClE;IACN,OAAQH,MAAMO,gBAAgB;QAC5B,KAAK;YACH;;;;;OAKC,GACD,IAAIP,MAAMM,MAAM,KAAK,UAAU;gBAC7B,OACE,CAAC,KAAK,EAAEL,KAAK,kBAAkB,EAAEG,UAAU,UAAU,EAAEH,KAAK,KAAK,CAAC,GAClE,uEACA,mCACCC,CAAAA,gBACG,CAAC,iCAAiC,EAAED,KAAK,qBAAqB,CAAC,GAC/D,uCACA,4DAA2D;YAEnE;YACA,sEAAsE;YACtE,mEAAmE;YACnE,uEAAuE;YACvE,uEAAuE;YACvE,mEAAmE;YACnE,iEAAiE;YACjE,+BAA+B;YAC/B,IAAI,CAACC,eAAe;gBAClB,OACE,CAAC,KAAK,EAAED,KAAK,+CAA+C,EAAEE,IAAI,CAAC,CAAC,GACpE,sEACA,iEACA;YAEJ;YACA,qEAAqE;YACrE,iEAAiE;YACjE,gDAAgD;YAChD,OACE,CAAC,wBAAwB,EAAEF,KAAK,mCAAmC,CAAC,GACpE,uEACA,CAAC,2BAA2B,EAAEE,IAAI,kCAAkC,CAAC,GACrE,mEACA;QAEJ;YACE,OACEE,QACCH,CAAAA,gBACG,CAAC,iCAAiC,EAAED,KAAK,qBAAqB,CAAC,GAC/D,oEACA,wDACAD,MAAMM,MAAM,KAAK,WACf,iEACA,qDACA,gEACA,cAAa;IAEzB;AACF;AAEA;;;;;;;;;;;;;;;;;;;;;;;;CAwBC,GACD,OAAO,SAASE,4BAA4BC,KAA8B;IACxE,MAAM,EAAET,KAAK,EAAEC,IAAI,EAAEC,gBAAgB,KAAK,EAAE,GAAGO;IAC/C,IAAI,CAACT,MAAMU,SAAS,EAAE,OAAO;IAC7B,MAAMC,UAAUX,MAAMO,gBAAgB,KAAK;IAC3C,0EAA0E;IAC1E,4EAA4E;IAC5E,0EAA0E;IAC1E,0EAA0E;IAC1E,uCAAuC;IACvC,MAAMK,cAAcV;IAEpB,qBACE,KAAChB;QACC2B,UAAUF,WAAWT,gBAAgB,YAAY;QACjDY,IAAI;YAAEC,cAAc;YAAGC,UAAU;YAAYC,QAAQ;QAAS;QAC9DC,sBACE,MAAC9B;YAAM+B,WAAU;YAAMC,SAAS;;gBAC7BR,4BACC,KAACzB;oBACCkC,OAAM;oBACNC,MAAK;oBACLC,SAAS,IAAMC,OAAOC,QAAQ,CAACC,MAAM;8BAEpC;qBAED;gBACHf,UAAU,qBACT,KAACxB;oBAAOkC,OAAM;oBAAUC,MAAK;oBAAQC,SAASvB,MAAM2B,OAAO;8BAExD3B,MAAMM,MAAM,KAAK,WAAW,eAAe;;8BAGhD,KAACnB;oBAAOkC,OAAM;oBAAUC,MAAK;oBAAQC,SAASvB,MAAM4B,OAAO;8BACxD;;;;kBAKN7B,mBAAmBC,OAAOC,MAAM4B,KAAKtC,GAAG,IAAIW;;AAGnD;AAEA,eAAeM,4BAA2B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { AppUUN } from '@aglyn/besigner';
|
|
18
|
+
import { type ComponentType } from 'react';
|
|
19
|
+
export interface BesignerComponentProps {
|
|
20
|
+
noSsr?: boolean;
|
|
21
|
+
appName?: AppUUN;
|
|
22
|
+
children?: JSX.Children;
|
|
23
|
+
}
|
|
24
|
+
export declare const withBesignerContext: <P>(Component: ComponentType<P>) => {
|
|
25
|
+
(props: BesignerComponentProps & P): import("react").JSX.Element;
|
|
26
|
+
displayName: string;
|
|
27
|
+
};
|
|
28
|
+
export declare const BesignerRootProviderComponent: {
|
|
29
|
+
(props: BesignerComponentProps): import("react").JSX.Element;
|
|
30
|
+
displayName: string;
|
|
31
|
+
aglyn: boolean;
|
|
32
|
+
};
|
|
33
|
+
export default BesignerRootProviderComponent;
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
*/ import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
17
|
+
import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
import { getDisplayName } from "@aglyn/shared-util-tools";
|
|
20
|
+
import { hoistNonReactStatics } from "@aglyn/shared-util-vendor";
|
|
21
|
+
import { NoSsr } from "@mui/material";
|
|
22
|
+
import { Fragment } from "react";
|
|
23
|
+
import ComponentsDrawerContextProvider from "../contexts/components-drawer-context.provider.js";
|
|
24
|
+
import RenderedCanvasElementsProvider from "../contexts/rendered-canvas-elements.js";
|
|
25
|
+
import { BesignerAppProvider } from "../contexts/besigner-app-context.js";
|
|
26
|
+
import useClipboardShortcuts from "../hooks/use-clipboard-shortcuts.js";
|
|
27
|
+
import BesignerDndContext from "./besigner-dnd-context.component.js";
|
|
28
|
+
export const withBesignerContext = (Component)=>{
|
|
29
|
+
const displayName = getDisplayName(Component);
|
|
30
|
+
const WithBesignerContext = (props)=>{
|
|
31
|
+
const { noSsr, appName } = props, rest = _object_without_properties_loose(props, [
|
|
32
|
+
"noSsr",
|
|
33
|
+
"appName"
|
|
34
|
+
]);
|
|
35
|
+
return /*#__PURE__*/ _jsx(BesignerRootProviderComponent, {
|
|
36
|
+
children: /*#__PURE__*/ _jsx(Component, _extends({}, rest))
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
WithBesignerContext.displayName = `WithBesignerComponent(${displayName})`;
|
|
40
|
+
hoistNonReactStatics(WithBesignerContext, Component);
|
|
41
|
+
return WithBesignerContext;
|
|
42
|
+
};
|
|
43
|
+
export const BesignerRootProviderComponent = (props)=>{
|
|
44
|
+
/*forwardRef<any, BesignerComponentProps>(
|
|
45
|
+
(props, ref) => {*/ const { noSsr, appName, children } = props;
|
|
46
|
+
const Wrapper = noSsr ? NoSsr : Fragment;
|
|
47
|
+
// Element copy/paste + select-all (AGL-1202). Bound once here so every
|
|
48
|
+
// besigner surface — screens, layouts, components, templates, emails —
|
|
49
|
+
// gets the same shortcuts.
|
|
50
|
+
useClipboardShortcuts();
|
|
51
|
+
return /*#__PURE__*/ _jsx(Wrapper, {
|
|
52
|
+
children: /*#__PURE__*/ _jsx(BesignerAppProvider, {
|
|
53
|
+
appName: appName,
|
|
54
|
+
children: /*#__PURE__*/ _jsx(BesignerDndContext, {
|
|
55
|
+
children: /*#__PURE__*/ _jsx(RenderedCanvasElementsProvider, {
|
|
56
|
+
children: /*#__PURE__*/ _jsx(ComponentsDrawerContextProvider, {
|
|
57
|
+
children: children
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
BesignerRootProviderComponent.displayName = 'BesignerRootProviderComponent';
|
|
65
|
+
BesignerRootProviderComponent.aglyn = true;
|
|
66
|
+
export default BesignerRootProviderComponent;
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=besigner-root-provider.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/besigner-root-provider.component.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 type { AppUUN } from '@aglyn/besigner'\nimport { getDisplayName } from '@aglyn/shared-util-tools'\nimport { hoistNonReactStatics } from '@aglyn/shared-util-vendor'\nimport { NoSsr } from '@mui/material'\nimport { type ComponentType, Fragment } from 'react'\nimport ComponentsDrawerContextProvider from '../contexts/components-drawer-context.provider'\nimport RenderedCanvasElementsProvider from '../contexts/rendered-canvas-elements'\nimport { BesignerAppProvider } from '../contexts/besigner-app-context'\nimport useClipboardShortcuts from '../hooks/use-clipboard-shortcuts'\nimport BesignerDndContext from './besigner-dnd-context.component'\n\nexport interface BesignerComponentProps {\n noSsr?: boolean\n appName?: AppUUN\n children?: JSX.Children\n}\n\nexport const withBesignerContext = <P,>(Component: ComponentType<P>) => {\n const displayName = getDisplayName(Component)\n const WithBesignerContext = (props: BesignerComponentProps & P) => {\n const { noSsr, appName, ...rest } = props\n return (\n <BesignerRootProviderComponent>\n <Component {...(rest as P)} />\n </BesignerRootProviderComponent>\n )\n }\n WithBesignerContext.displayName = `WithBesignerComponent(${displayName})`\n hoistNonReactStatics(WithBesignerContext, Component)\n return WithBesignerContext\n}\n\nexport const BesignerRootProviderComponent = (\n props: BesignerComponentProps,\n) => {\n /*forwardRef<any, BesignerComponentProps>(\n (props, ref) => {*/\n const { noSsr, appName, children } = props\n const Wrapper = noSsr ? NoSsr : Fragment\n\n // Element copy/paste + select-all (AGL-1202). Bound once here so every\n // besigner surface — screens, layouts, components, templates, emails —\n // gets the same shortcuts.\n useClipboardShortcuts()\n\n return (\n <Wrapper>\n <BesignerAppProvider appName={appName}>\n <BesignerDndContext>\n <RenderedCanvasElementsProvider>\n <ComponentsDrawerContextProvider>\n {children}\n </ComponentsDrawerContextProvider>\n </RenderedCanvasElementsProvider>\n </BesignerDndContext>\n </BesignerAppProvider>\n </Wrapper>\n )\n}\n\nBesignerRootProviderComponent.displayName = 'BesignerRootProviderComponent'\nBesignerRootProviderComponent.aglyn = true\n\nexport default BesignerRootProviderComponent\n"],"names":["getDisplayName","hoistNonReactStatics","NoSsr","Fragment","ComponentsDrawerContextProvider","RenderedCanvasElementsProvider","BesignerAppProvider","useClipboardShortcuts","BesignerDndContext","withBesignerContext","Component","displayName","WithBesignerContext","props","noSsr","appName","rest","BesignerRootProviderComponent","children","Wrapper","aglyn"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC;;;AAGD,SAASA,cAAc,QAAQ,2BAA0B;AACzD,SAASC,oBAAoB,QAAQ,4BAA2B;AAChE,SAASC,KAAK,QAAQ,gBAAe;AACrC,SAA6BC,QAAQ,QAAQ,QAAO;AACpD,OAAOC,qCAAqC,oDAAgD;AAC5F,OAAOC,oCAAoC,0CAAsC;AACjF,SAASC,mBAAmB,QAAQ,sCAAkC;AACtE,OAAOC,2BAA2B,sCAAkC;AACpE,OAAOC,wBAAwB,sCAAkC;AAQjE,OAAO,MAAMC,sBAAsB,CAAKC;IACtC,MAAMC,cAAcX,eAAeU;IACnC,MAAME,sBAAsB,CAACC;QAC3B,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAW,GAAGF,OAATG,wCAASH;;;;QACpC,qBACE,KAACI;sBACC,cAAA,KAACP,wBAAeM;;IAGtB;IACAJ,oBAAoBD,WAAW,GAAG,CAAC,sBAAsB,EAAEA,YAAY,CAAC,CAAC;IACzEV,qBAAqBW,qBAAqBF;IAC1C,OAAOE;AACT,EAAC;AAED,OAAO,MAAMK,gCAAgC,CAC3CJ;IAEA;kBACgB,GAChB,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAEG,QAAQ,EAAE,GAAGL;IACrC,MAAMM,UAAUL,QAAQZ,QAAQC;IAEhC,uEAAuE;IACvE,uEAAuE;IACvE,2BAA2B;IAC3BI;IAEA,qBACE,KAACY;kBACC,cAAA,KAACb;YAAoBS,SAASA;sBAC5B,cAAA,KAACP;0BACC,cAAA,KAACH;8BACC,cAAA,KAACD;kCACEc;;;;;;AAOf,EAAC;AAEDD,8BAA8BN,WAAW,GAAG;AAC5CM,8BAA8BG,KAAK,GAAG;AAEtC,eAAeH,8BAA6B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { type IconButtonProps as MuiIconButtonProps } from '@mui/material';
|
|
18
|
+
export interface BindingPreviewControlsProps extends Partial<MuiIconButtonProps> {
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* WYSIWYG bindings toggle (AGL-97): the canvas resolves variable, function
|
|
22
|
+
* and host variable tokens live by default; this switches to raw tokens for
|
|
23
|
+
* editing clarity. Hidden when the host app provides nothing to resolve
|
|
24
|
+
* with — no variables, no functions, and no site for `{{host.*}}` (AGL-2881).
|
|
25
|
+
*/
|
|
26
|
+
declare const BindingPreviewControlsComponent: import("react").ForwardRefExoticComponent<Omit<BindingPreviewControlsProps, "ref"> & import("react").RefAttributes<any>>;
|
|
27
|
+
export { BindingPreviewControlsComponent };
|
|
28
|
+
export default BindingPreviewControlsComponent;
|
|
@@ -0,0 +1,63 @@
|
|
|
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 { mdiCodeBraces } from "@aglyn/shared-data-mdi";
|
|
19
|
+
import { MdiIcon } from "@aglyn/shared-ui-jsx";
|
|
20
|
+
import { IconButton as MuiIconButton, Tooltip as MuiTooltip } from "@mui/material";
|
|
21
|
+
import { forwardRef, useCallback, useContext } from "react";
|
|
22
|
+
import BindingPickerContext from "../contexts/binding-picker-context.js";
|
|
23
|
+
import useAglynBesignerFlag from "../hooks/use-aglyn-besigner-flag.js";
|
|
24
|
+
/**
|
|
25
|
+
* WYSIWYG bindings toggle (AGL-97): the canvas resolves variable, function
|
|
26
|
+
* and host variable tokens live by default; this switches to raw tokens for
|
|
27
|
+
* editing clarity. Hidden when the host app provides nothing to resolve
|
|
28
|
+
* with — no variables, no functions, and no site for `{{host.*}}` (AGL-2881).
|
|
29
|
+
*/ const BindingPreviewControlsComponent = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
30
|
+
const {} = props, rest = _extends({}, props);
|
|
31
|
+
const [resolveFlag, setResolveFlag] = useAglynBesignerFlag('resolveBindings');
|
|
32
|
+
const { variables, functions, host } = useContext(BindingPickerContext);
|
|
33
|
+
const showingRaw = resolveFlag === false;
|
|
34
|
+
const handleToggle = useCallback(()=>{
|
|
35
|
+
setResolveFlag((prev)=>prev === false);
|
|
36
|
+
}, [
|
|
37
|
+
setResolveFlag
|
|
38
|
+
]);
|
|
39
|
+
if (!Object.keys(variables != null ? variables : {}).length && !Object.keys(functions != null ? functions : {}).length && !host) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
return /*#__PURE__*/ _jsx(MuiTooltip, {
|
|
43
|
+
title: showingRaw ? 'Show resolved binding values on the artboard' : 'Show raw binding tokens on the artboard',
|
|
44
|
+
children: /*#__PURE__*/ _jsx(MuiIconButton, _extends({
|
|
45
|
+
ref: ref,
|
|
46
|
+
"aria-label": "toggle binding resolution",
|
|
47
|
+
size: "small",
|
|
48
|
+
color: showingRaw ? 'primary' : 'inherit',
|
|
49
|
+
onClick: handleToggle
|
|
50
|
+
}, rest, {
|
|
51
|
+
children: /*#__PURE__*/ _jsx(MdiIcon, {
|
|
52
|
+
fontSize: "inherit",
|
|
53
|
+
path: mdiCodeBraces.path
|
|
54
|
+
})
|
|
55
|
+
}))
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
BindingPreviewControlsComponent.displayName = 'BindingPreviewControlsComponent';
|
|
59
|
+
BindingPreviewControlsComponent.aglyn = true;
|
|
60
|
+
export { BindingPreviewControlsComponent };
|
|
61
|
+
export default BindingPreviewControlsComponent;
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=binding-preview-controls.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/binding-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 { mdiCodeBraces } from '@aglyn/shared-data-mdi'\nimport { MdiIcon } from '@aglyn/shared-ui-jsx'\nimport {\n IconButton as MuiIconButton,\n type IconButtonProps as MuiIconButtonProps,\n Tooltip as MuiTooltip,\n} from '@mui/material'\nimport { forwardRef, useCallback, useContext } from 'react'\nimport BindingPickerContext from '../contexts/binding-picker-context'\nimport useAglynBesignerFlag from '../hooks/use-aglyn-besigner-flag'\n\nexport interface BindingPreviewControlsProps\n extends Partial<MuiIconButtonProps> {}\n\n/**\n * WYSIWYG bindings toggle (AGL-97): the canvas resolves variable, function\n * and host variable tokens live by default; this switches to raw tokens for\n * editing clarity. Hidden when the host app provides nothing to resolve\n * with — no variables, no functions, and no site for `{{host.*}}` (AGL-2881).\n */\nconst BindingPreviewControlsComponent = forwardRef<\n any,\n BindingPreviewControlsProps\n>((props, ref) => {\n const { ...rest } = props\n const [resolveFlag, setResolveFlag] =\n useAglynBesignerFlag('resolveBindings')\n const { variables, functions, host } = useContext(BindingPickerContext)\n const showingRaw = resolveFlag === false\n\n const handleToggle = useCallback(() => {\n setResolveFlag((prev) => prev === false)\n }, [setResolveFlag])\n\n if (\n !Object.keys(variables ?? {}).length &&\n !Object.keys(functions ?? {}).length &&\n !host\n ) {\n return null\n }\n\n return (\n <MuiTooltip\n title={\n showingRaw\n ? 'Show resolved binding values on the artboard'\n : 'Show raw binding tokens on the artboard'\n }\n >\n <MuiIconButton\n ref={ref}\n aria-label=\"toggle binding resolution\"\n size=\"small\"\n color={showingRaw ? 'primary' : 'inherit'}\n onClick={handleToggle}\n {...rest}\n >\n <MdiIcon fontSize=\"inherit\" path={mdiCodeBraces.path} />\n </MuiIconButton>\n </MuiTooltip>\n )\n})\nBindingPreviewControlsComponent.displayName = 'BindingPreviewControlsComponent'\nBindingPreviewControlsComponent.aglyn = true\n\nexport { BindingPreviewControlsComponent }\nexport default BindingPreviewControlsComponent\n"],"names":["mdiCodeBraces","MdiIcon","IconButton","MuiIconButton","Tooltip","MuiTooltip","forwardRef","useCallback","useContext","BindingPickerContext","useAglynBesignerFlag","BindingPreviewControlsComponent","props","ref","rest","resolveFlag","setResolveFlag","variables","functions","host","showingRaw","handleToggle","prev","Object","keys","length","title","aria-label","size","color","onClick","fontSize","path","displayName","aglyn"],"mappings":";;AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,aAAa,QAAQ,yBAAwB;AACtD,SAASC,OAAO,QAAQ,uBAAsB;AAC9C,SACEC,cAAcC,aAAa,EAE3BC,WAAWC,UAAU,QAChB,gBAAe;AACtB,SAASC,UAAU,EAAEC,WAAW,EAAEC,UAAU,QAAQ,QAAO;AAC3D,OAAOC,0BAA0B,wCAAoC;AACrE,OAAOC,0BAA0B,sCAAkC;AAKnE;;;;;CAKC,GACD,MAAMC,gDAAkCL,WAGtC,CAACM,OAAOC;IACR,MAAM,EAAW,GAAGD,OAATE,oBAASF;IACpB,MAAM,CAACG,aAAaC,eAAe,GACjCN,qBAAqB;IACvB,MAAM,EAAEO,SAAS,EAAEC,SAAS,EAAEC,IAAI,EAAE,GAAGX,WAAWC;IAClD,MAAMW,aAAaL,gBAAgB;IAEnC,MAAMM,eAAed,YAAY;QAC/BS,eAAe,CAACM,OAASA,SAAS;IACpC,GAAG;QAACN;KAAe;IAEnB,IACE,CAACO,OAAOC,IAAI,CAACP,oBAAAA,YAAa,CAAC,GAAGQ,MAAM,IACpC,CAACF,OAAOC,IAAI,CAACN,oBAAAA,YAAa,CAAC,GAAGO,MAAM,IACpC,CAACN,MACD;QACA,OAAO;IACT;IAEA,qBACE,KAACd;QACCqB,OACEN,aACI,iDACA;kBAGN,cAAA,KAACjB;YACCU,KAAKA;YACLc,cAAW;YACXC,MAAK;YACLC,OAAOT,aAAa,YAAY;YAChCU,SAAST;WACLP;sBAEJ,cAAA,KAACb;gBAAQ8B,UAAS;gBAAUC,MAAMhC,cAAcgC,IAAI;;;;AAI5D;AACArB,gCAAgCsB,WAAW,GAAG;AAC9CtB,gCAAgCuB,KAAK,GAAG;AAExC,SAASvB,+BAA+B,GAAE;AAC1C,eAAeA,gCAA+B"}
|