@elytracms/studio 0.0.1
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 +21 -0
- package/README.md +3 -0
- package/convex/assets.ts +107 -0
- package/convex/auth.config.ts +15 -0
- package/convex/auth.ts +50 -0
- package/convex/cliTokens.ts +63 -0
- package/convex/cms.ts +174 -0
- package/convex/content.ts +316 -0
- package/convex/delivery.ts +266 -0
- package/convex/functions.ts +35 -0
- package/convex/graphs.ts +51 -0
- package/convex/guard.ts +67 -0
- package/convex/http.ts +30 -0
- package/convex/members.ts +83 -0
- package/convex/publishing.ts +102 -0
- package/convex/references.ts +168 -0
- package/convex/schema.ts +173 -0
- package/convex/sync.ts +322 -0
- package/convex/tsconfig.json +12 -0
- package/convex/users.ts +23 -0
- package/convex/webhooks.ts +85 -0
- package/dist/components/assets/asset-library.d.ts +14 -0
- package/dist/components/assets/asset-library.js +191 -0
- package/dist/components/assets/asset-library.js.map +1 -0
- package/dist/components/assets/asset-metadata.d.ts +34 -0
- package/dist/components/assets/asset-metadata.js +40 -0
- package/dist/components/assets/asset-metadata.js.map +1 -0
- package/dist/components/assets/asset-search.d.ts +7 -0
- package/dist/components/assets/asset-search.js +12 -0
- package/dist/components/assets/asset-search.js.map +1 -0
- package/dist/components/assets/asset-selection.d.ts +17 -0
- package/dist/components/assets/asset-selection.js +33 -0
- package/dist/components/assets/asset-selection.js.map +1 -0
- package/dist/components/assets/assets-store.d.ts +51 -0
- package/dist/components/assets/assets-store.js +153 -0
- package/dist/components/assets/assets-store.js.map +1 -0
- package/dist/components/auth-context.d.ts +38 -0
- package/dist/components/auth-context.js +88 -0
- package/dist/components/auth-context.js.map +1 -0
- package/dist/components/backend-gate.d.ts +19 -0
- package/dist/components/backend-gate.js +63 -0
- package/dist/components/backend-gate.js.map +1 -0
- package/dist/components/breadcrumb-context.d.ts +39 -0
- package/dist/components/breadcrumb-context.js +38 -0
- package/dist/components/breadcrumb-context.js.map +1 -0
- package/dist/components/builder/blocks-model.d.ts +80 -0
- package/dist/components/builder/blocks-model.js +181 -0
- package/dist/components/builder/blocks-model.js.map +1 -0
- package/dist/components/builder/blocks-panel.d.ts +44 -0
- package/dist/components/builder/blocks-panel.js +147 -0
- package/dist/components/builder/blocks-panel.js.map +1 -0
- package/dist/components/builder/builder-store.d.ts +69 -0
- package/dist/components/builder/builder-store.js +294 -0
- package/dist/components/builder/builder-store.js.map +1 -0
- package/dist/components/builder/canvas-stylesheet.d.ts +4 -0
- package/dist/components/builder/canvas-stylesheet.js +24 -0
- package/dist/components/builder/canvas-stylesheet.js.map +1 -0
- package/dist/components/builder/canvas.d.ts +8 -0
- package/dist/components/builder/canvas.js +723 -0
- package/dist/components/builder/canvas.js.map +1 -0
- package/dist/components/builder/clipboard-actions.d.ts +93 -0
- package/dist/components/builder/clipboard-actions.js +246 -0
- package/dist/components/builder/clipboard-actions.js.map +1 -0
- package/dist/components/builder/composition-field-editor.d.ts +11 -0
- package/dist/components/builder/composition-field-editor.js +150 -0
- package/dist/components/builder/composition-field-editor.js.map +1 -0
- package/dist/components/builder/composition-scope.d.ts +16 -0
- package/dist/components/builder/composition-scope.js +7 -0
- package/dist/components/builder/composition-scope.js.map +1 -0
- package/dist/components/builder/drag-session.d.ts +41 -0
- package/dist/components/builder/drag-session.js +51 -0
- package/dist/components/builder/drag-session.js.map +1 -0
- package/dist/components/builder/fixture-thumbnail.d.ts +18 -0
- package/dist/components/builder/fixture-thumbnail.js +97 -0
- package/dist/components/builder/fixture-thumbnail.js.map +1 -0
- package/dist/components/builder/inline-edit.d.ts +142 -0
- package/dist/components/builder/inline-edit.js +136 -0
- package/dist/components/builder/inline-edit.js.map +1 -0
- package/dist/components/builder/insert-context.d.ts +14 -0
- package/dist/components/builder/insert-context.js +65 -0
- package/dist/components/builder/insert-context.js.map +1 -0
- package/dist/components/builder/insert-menu.d.ts +9 -0
- package/dist/components/builder/insert-menu.js +9 -0
- package/dist/components/builder/insert-menu.js.map +1 -0
- package/dist/components/builder/layout-inspector.d.ts +14 -0
- package/dist/components/builder/layout-inspector.js +84 -0
- package/dist/components/builder/layout-inspector.js.map +1 -0
- package/dist/components/builder/node-factory.d.ts +17 -0
- package/dist/components/builder/node-factory.js +90 -0
- package/dist/components/builder/node-factory.js.map +1 -0
- package/dist/components/builder/page-tree.d.ts +3 -0
- package/dist/components/builder/page-tree.js +207 -0
- package/dist/components/builder/page-tree.js.map +1 -0
- package/dist/components/builder/property-inspector.d.ts +1 -0
- package/dist/components/builder/property-inspector.js +233 -0
- package/dist/components/builder/property-inspector.js.map +1 -0
- package/dist/components/builder/rich-text-toolbar.d.ts +4 -0
- package/dist/components/builder/rich-text-toolbar.js +104 -0
- package/dist/components/builder/rich-text-toolbar.js.map +1 -0
- package/dist/components/builder/spacing-handles.d.ts +22 -0
- package/dist/components/builder/spacing-handles.js +213 -0
- package/dist/components/builder/spacing-handles.js.map +1 -0
- package/dist/components/cms/asset-picker.d.ts +12 -0
- package/dist/components/cms/asset-picker.js +60 -0
- package/dist/components/cms/asset-picker.js.map +1 -0
- package/dist/components/cms/bulk-actions.d.ts +60 -0
- package/dist/components/cms/bulk-actions.js +95 -0
- package/dist/components/cms/bulk-actions.js.map +1 -0
- package/dist/components/cms/bulk-bar.d.ts +23 -0
- package/dist/components/cms/bulk-bar.js +26 -0
- package/dist/components/cms/bulk-bar.js.map +1 -0
- package/dist/components/cms/cell-edit.d.ts +91 -0
- package/dist/components/cms/cell-edit.js +144 -0
- package/dist/components/cms/cell-edit.js.map +1 -0
- package/dist/components/cms/cell.d.ts +29 -0
- package/dist/components/cms/cell.js +127 -0
- package/dist/components/cms/cell.js.map +1 -0
- package/dist/components/cms/cms-index.d.ts +8 -0
- package/dist/components/cms/cms-index.js +23 -0
- package/dist/components/cms/cms-index.js.map +1 -0
- package/dist/components/cms/cms-store.d.ts +188 -0
- package/dist/components/cms/cms-store.js +702 -0
- package/dist/components/cms/cms-store.js.map +1 -0
- package/dist/components/cms/collection-table.d.ts +6 -0
- package/dist/components/cms/collection-table.js +250 -0
- package/dist/components/cms/collection-table.js.map +1 -0
- package/dist/components/cms/collections-sidebar.d.ts +9 -0
- package/dist/components/cms/collections-sidebar.js +25 -0
- package/dist/components/cms/collections-sidebar.js.map +1 -0
- package/dist/components/cms/detail-editor.d.ts +7 -0
- package/dist/components/cms/detail-editor.js +386 -0
- package/dist/components/cms/detail-editor.js.map +1 -0
- package/dist/components/cms/doc-state.d.ts +13 -0
- package/dist/components/cms/doc-state.js +18 -0
- package/dist/components/cms/doc-state.js.map +1 -0
- package/dist/components/cms/document-editor-context.d.ts +48 -0
- package/dist/components/cms/document-editor-context.js +23 -0
- package/dist/components/cms/document-editor-context.js.map +1 -0
- package/dist/components/cms/editable-cell.d.ts +22 -0
- package/dist/components/cms/editable-cell.js +176 -0
- package/dist/components/cms/editable-cell.js.map +1 -0
- package/dist/components/cms/field-control.d.ts +8 -0
- package/dist/components/cms/field-control.js +149 -0
- package/dist/components/cms/field-control.js.map +1 -0
- package/dist/components/cms/filter-builder.d.ts +12 -0
- package/dist/components/cms/filter-builder.js +84 -0
- package/dist/components/cms/filter-builder.js.map +1 -0
- package/dist/components/cms/import-export.d.ts +6 -0
- package/dist/components/cms/import-export.js +33 -0
- package/dist/components/cms/import-export.js.map +1 -0
- package/dist/components/cms/new-page-dialog.d.ts +22 -0
- package/dist/components/cms/new-page-dialog.js +42 -0
- package/dist/components/cms/new-page-dialog.js.map +1 -0
- package/dist/components/cms/reference-confirm.d.ts +25 -0
- package/dist/components/cms/reference-confirm.js +124 -0
- package/dist/components/cms/reference-confirm.js.map +1 -0
- package/dist/components/cms/relation-picker.d.ts +16 -0
- package/dist/components/cms/relation-picker.js +47 -0
- package/dist/components/cms/relation-picker.js.map +1 -0
- package/dist/components/cms/use-cell-edit.d.ts +33 -0
- package/dist/components/cms/use-cell-edit.js +125 -0
- package/dist/components/cms/use-cell-edit.js.map +1 -0
- package/dist/components/cms/versions-model.d.ts +15 -0
- package/dist/components/cms/versions-model.js +23 -0
- package/dist/components/cms/versions-model.js.map +1 -0
- package/dist/components/cms/versions-pane.d.ts +14 -0
- package/dist/components/cms/versions-pane.js +86 -0
- package/dist/components/cms/versions-pane.js.map +1 -0
- package/dist/components/cms/view-bar.d.ts +11 -0
- package/dist/components/cms/view-bar.js +80 -0
- package/dist/components/cms/view-bar.js.map +1 -0
- package/dist/components/collab/collab-context.d.ts +34 -0
- package/dist/components/collab/collab-context.js +52 -0
- package/dist/components/collab/collab-context.js.map +1 -0
- package/dist/components/collab/collab-seed.d.ts +27 -0
- package/dist/components/collab/collab-seed.js +42 -0
- package/dist/components/collab/collab-seed.js.map +1 -0
- package/dist/components/components/component-detail.d.ts +9 -0
- package/dist/components/components/component-detail.js +30 -0
- package/dist/components/components/component-detail.js.map +1 -0
- package/dist/components/components/component-status.d.ts +10 -0
- package/dist/components/components/component-status.js +30 -0
- package/dist/components/components/component-status.js.map +1 -0
- package/dist/components/components/components-index.d.ts +8 -0
- package/dist/components/components/components-index.js +42 -0
- package/dist/components/components/components-index.js.map +1 -0
- package/dist/components/components/field-inspector.d.ts +9 -0
- package/dist/components/components/field-inspector.js +38 -0
- package/dist/components/components/field-inspector.js.map +1 -0
- package/dist/components/components/fixture-runner.d.ts +10 -0
- package/dist/components/components/fixture-runner.js +24 -0
- package/dist/components/components/fixture-runner.js.map +1 -0
- package/dist/components/components/registry-browser.d.ts +4 -0
- package/dist/components/components/registry-browser.js +64 -0
- package/dist/components/components/registry-browser.js.map +1 -0
- package/dist/components/current-user-menu.d.ts +13 -0
- package/dist/components/current-user-menu.js +31 -0
- package/dist/components/current-user-menu.js.map +1 -0
- package/dist/components/dev-login-badge.d.ts +9 -0
- package/dist/components/dev-login-badge.js +18 -0
- package/dist/components/dev-login-badge.js.map +1 -0
- package/dist/components/extensions/extensions-view.d.ts +7 -0
- package/dist/components/extensions/extensions-view.js +126 -0
- package/dist/components/extensions/extensions-view.js.map +1 -0
- package/dist/components/guards.d.ts +27 -0
- package/dist/components/guards.js +46 -0
- package/dist/components/guards.js.map +1 -0
- package/dist/components/inspector/inspector-sidebar.d.ts +26 -0
- package/dist/components/inspector/inspector-sidebar.js +17 -0
- package/dist/components/inspector/inspector-sidebar.js.map +1 -0
- package/dist/components/operation-error.d.ts +17 -0
- package/dist/components/operation-error.js +54 -0
- package/dist/components/operation-error.js.map +1 -0
- package/dist/components/playground-badge.d.ts +10 -0
- package/dist/components/playground-badge.js +19 -0
- package/dist/components/playground-badge.js.map +1 -0
- package/dist/components/project-list.d.ts +15 -0
- package/dist/components/project-list.js +52 -0
- package/dist/components/project-list.js.map +1 -0
- package/dist/components/project-session.d.ts +46 -0
- package/dist/components/project-session.js +107 -0
- package/dist/components/project-session.js.map +1 -0
- package/dist/components/project-switcher.d.ts +11 -0
- package/dist/components/project-switcher.js +44 -0
- package/dist/components/project-switcher.js.map +1 -0
- package/dist/components/references/builder-deep-link.d.ts +12 -0
- package/dist/components/references/builder-deep-link.js +53 -0
- package/dist/components/references/builder-deep-link.js.map +1 -0
- package/dist/components/references/references-panel.d.ts +17 -0
- package/dist/components/references/references-panel.js +66 -0
- package/dist/components/references/references-panel.js.map +1 -0
- package/dist/components/routes/redirect-chain.d.ts +9 -0
- package/dist/components/routes/redirect-chain.js +16 -0
- package/dist/components/routes/redirect-chain.js.map +1 -0
- package/dist/components/routes/redirect-manager.d.ts +13 -0
- package/dist/components/routes/redirect-manager.js +24 -0
- package/dist/components/routes/redirect-manager.js.map +1 -0
- package/dist/components/routes/route-list.d.ts +35 -0
- package/dist/components/routes/route-list.js +69 -0
- package/dist/components/routes/route-list.js.map +1 -0
- package/dist/components/routes/routes-shell.d.ts +14 -0
- package/dist/components/routes/routes-shell.js +68 -0
- package/dist/components/routes/routes-shell.js.map +1 -0
- package/dist/components/section-nav.d.ts +17 -0
- package/dist/components/section-nav.js +33 -0
- package/dist/components/section-nav.js.map +1 -0
- package/dist/components/section-state.d.ts +24 -0
- package/dist/components/section-state.js +78 -0
- package/dist/components/section-state.js.map +1 -0
- package/dist/components/section-surface.d.ts +31 -0
- package/dist/components/section-surface.js +46 -0
- package/dist/components/section-surface.js.map +1 -0
- package/dist/components/sections.d.ts +38 -0
- package/dist/components/sections.js +72 -0
- package/dist/components/sections.js.map +1 -0
- package/dist/components/settings-form.d.ts +10 -0
- package/dist/components/settings-form.js +17 -0
- package/dist/components/settings-form.js.map +1 -0
- package/dist/components/studio-context.d.ts +22 -0
- package/dist/components/studio-context.js +48 -0
- package/dist/components/studio-context.js.map +1 -0
- package/dist/components/studio-project-screen.d.ts +19 -0
- package/dist/components/studio-project-screen.js +195 -0
- package/dist/components/studio-project-screen.js.map +1 -0
- package/dist/components/studio-shell.d.ts +18 -0
- package/dist/components/studio-shell.js +64 -0
- package/dist/components/studio-shell.js.map +1 -0
- package/dist/components/theme-context.d.ts +17 -0
- package/dist/components/theme-context.js +26 -0
- package/dist/components/theme-context.js.map +1 -0
- package/dist/components/workspace-gate.d.ts +12 -0
- package/dist/components/workspace-gate.js +27 -0
- package/dist/components/workspace-gate.js.map +1 -0
- package/dist/components/workspace-projects.d.ts +13 -0
- package/dist/components/workspace-projects.js +18 -0
- package/dist/components/workspace-projects.js.map +1 -0
- package/dist/lib/assets/delete-asset.d.ts +34 -0
- package/dist/lib/assets/delete-asset.js +34 -0
- package/dist/lib/assets/delete-asset.js.map +1 -0
- package/dist/lib/assets/image-dimensions.d.ts +18 -0
- package/dist/lib/assets/image-dimensions.js +26 -0
- package/dist/lib/assets/image-dimensions.js.map +1 -0
- package/dist/lib/assets/index.d.ts +9 -0
- package/dist/lib/assets/index.js +10 -0
- package/dist/lib/assets/index.js.map +1 -0
- package/dist/lib/assets/upload-state.d.ts +53 -0
- package/dist/lib/assets/upload-state.js +59 -0
- package/dist/lib/assets/upload-state.js.map +1 -0
- package/dist/lib/assets/upload.d.ts +56 -0
- package/dist/lib/assets/upload.js +125 -0
- package/dist/lib/assets/upload.js.map +1 -0
- package/dist/lib/auth/auth-adapter.d.ts +57 -0
- package/dist/lib/auth/auth-adapter.js +13 -0
- package/dist/lib/auth/auth-adapter.js.map +1 -0
- package/dist/lib/auth/convex-auth-adapter.d.ts +39 -0
- package/dist/lib/auth/convex-auth-adapter.js +171 -0
- package/dist/lib/auth/convex-auth-adapter.js.map +1 -0
- package/dist/lib/auth/dev-auto-login-adapter.d.ts +25 -0
- package/dist/lib/auth/dev-auto-login-adapter.js +40 -0
- package/dist/lib/auth/dev-auto-login-adapter.js.map +1 -0
- package/dist/lib/auth/index.d.ts +28 -0
- package/dist/lib/auth/index.js +61 -0
- package/dist/lib/auth/index.js.map +1 -0
- package/dist/lib/auth/local-auth-adapter.d.ts +57 -0
- package/dist/lib/auth/local-auth-adapter.js +78 -0
- package/dist/lib/auth/local-auth-adapter.js.map +1 -0
- package/dist/lib/auth/route-guard.d.ts +33 -0
- package/dist/lib/auth/route-guard.js +51 -0
- package/dist/lib/auth/route-guard.js.map +1 -0
- package/dist/lib/auth-errors.d.ts +42 -0
- package/dist/lib/auth-errors.js +74 -0
- package/dist/lib/auth-errors.js.map +1 -0
- package/dist/lib/bindings/section-bindings.d.ts +24 -0
- package/dist/lib/bindings/section-bindings.js +9 -0
- package/dist/lib/bindings/section-bindings.js.map +1 -0
- package/dist/lib/clipboard/index.d.ts +7 -0
- package/dist/lib/clipboard/index.js +8 -0
- package/dist/lib/clipboard/index.js.map +1 -0
- package/dist/lib/clipboard/os-clipboard.d.ts +46 -0
- package/dist/lib/clipboard/os-clipboard.js +105 -0
- package/dist/lib/clipboard/os-clipboard.js.map +1 -0
- package/dist/lib/clipboard/paste-issues.d.ts +34 -0
- package/dist/lib/clipboard/paste-issues.js +67 -0
- package/dist/lib/clipboard/paste-issues.js.map +1 -0
- package/dist/lib/clipboard/paste-target.d.ts +20 -0
- package/dist/lib/clipboard/paste-target.js +28 -0
- package/dist/lib/clipboard/paste-target.js.map +1 -0
- package/dist/lib/cms/published-documents.d.ts +30 -0
- package/dist/lib/cms/published-documents.js +75 -0
- package/dist/lib/cms/published-documents.js.map +1 -0
- package/dist/lib/cms-views/index.d.ts +9 -0
- package/dist/lib/cms-views/index.js +10 -0
- package/dist/lib/cms-views/index.js.map +1 -0
- package/dist/lib/cms-views/selection.d.ts +29 -0
- package/dist/lib/cms-views/selection.js +46 -0
- package/dist/lib/cms-views/selection.js.map +1 -0
- package/dist/lib/cms-views/view-model.d.ts +192 -0
- package/dist/lib/cms-views/view-model.js +353 -0
- package/dist/lib/cms-views/view-model.js.map +1 -0
- package/dist/lib/cms-views/views-store.d.ts +70 -0
- package/dist/lib/cms-views/views-store.js +129 -0
- package/dist/lib/cms-views/views-store.js.map +1 -0
- package/dist/lib/data/collection-content.d.ts +105 -0
- package/dist/lib/data/collection-content.js +196 -0
- package/dist/lib/data/collection-content.js.map +1 -0
- package/dist/lib/data/data-store.d.ts +97 -0
- package/dist/lib/data/data-store.js +205 -0
- package/dist/lib/data/data-store.js.map +1 -0
- package/dist/lib/data/index.d.ts +4 -0
- package/dist/lib/data/index.js +8 -0
- package/dist/lib/data/index.js.map +1 -0
- package/dist/lib/data/providers.d.ts +143 -0
- package/dist/lib/data/providers.js +255 -0
- package/dist/lib/data/providers.js.map +1 -0
- package/dist/lib/data/sample-capture.d.ts +30 -0
- package/dist/lib/data/sample-capture.js +70 -0
- package/dist/lib/data/sample-capture.js.map +1 -0
- package/dist/lib/data/sources-store.d.ts +42 -0
- package/dist/lib/data/sources-store.js +120 -0
- package/dist/lib/data/sources-store.js.map +1 -0
- package/dist/lib/dnd/drop-rules.d.ts +219 -0
- package/dist/lib/dnd/drop-rules.js +257 -0
- package/dist/lib/dnd/drop-rules.js.map +1 -0
- package/dist/lib/dnd/gap-drag.d.ts +66 -0
- package/dist/lib/dnd/gap-drag.js +95 -0
- package/dist/lib/dnd/gap-drag.js.map +1 -0
- package/dist/lib/locale/binding-fallback.d.ts +28 -0
- package/dist/lib/locale/binding-fallback.js +66 -0
- package/dist/lib/locale/binding-fallback.js.map +1 -0
- package/dist/lib/locale/fallback.d.ts +43 -0
- package/dist/lib/locale/fallback.js +52 -0
- package/dist/lib/locale/fallback.js.map +1 -0
- package/dist/lib/locale/index.d.ts +6 -0
- package/dist/lib/locale/index.js +7 -0
- package/dist/lib/locale/index.js.map +1 -0
- package/dist/lib/locale/locale-store.d.ts +40 -0
- package/dist/lib/locale/locale-store.js +61 -0
- package/dist/lib/locale/locale-store.js.map +1 -0
- package/dist/lib/locale/locale-switcher.d.ts +10 -0
- package/dist/lib/locale/locale-switcher.js +24 -0
- package/dist/lib/locale/locale-switcher.js.map +1 -0
- package/dist/lib/locale/route-variant.d.ts +14 -0
- package/dist/lib/locale/route-variant.js +11 -0
- package/dist/lib/locale/route-variant.js.map +1 -0
- package/dist/lib/locale/use-studio-locale.d.ts +10 -0
- package/dist/lib/locale/use-studio-locale.js +8 -0
- package/dist/lib/locale/use-studio-locale.js.map +1 -0
- package/dist/lib/operations/asset-repository.d.ts +15 -0
- package/dist/lib/operations/asset-repository.js +56 -0
- package/dist/lib/operations/asset-repository.js.map +1 -0
- package/dist/lib/operations/cms-persistence.d.ts +35 -0
- package/dist/lib/operations/cms-persistence.js +75 -0
- package/dist/lib/operations/cms-persistence.js.map +1 -0
- package/dist/lib/operations/graph-commands.d.ts +140 -0
- package/dist/lib/operations/graph-commands.js +86 -0
- package/dist/lib/operations/graph-commands.js.map +1 -0
- package/dist/lib/operations/graph-persistence.d.ts +27 -0
- package/dist/lib/operations/graph-persistence.js +35 -0
- package/dist/lib/operations/graph-persistence.js.map +1 -0
- package/dist/lib/operations/index.d.ts +13 -0
- package/dist/lib/operations/index.js +14 -0
- package/dist/lib/operations/index.js.map +1 -0
- package/dist/lib/operations/operations-package.d.ts +6 -0
- package/dist/lib/operations/operations-package.js +7 -0
- package/dist/lib/operations/operations-package.js.map +1 -0
- package/dist/lib/operations/persist-queue.d.ts +16 -0
- package/dist/lib/operations/persist-queue.js +18 -0
- package/dist/lib/operations/persist-queue.js.map +1 -0
- package/dist/lib/operations/session-hydration.d.ts +84 -0
- package/dist/lib/operations/session-hydration.js +112 -0
- package/dist/lib/operations/session-hydration.js.map +1 -0
- package/dist/lib/operations/studio-operations.d.ts +59 -0
- package/dist/lib/operations/studio-operations.js +92 -0
- package/dist/lib/operations/studio-operations.js.map +1 -0
- package/dist/lib/persistence/backend-mode.d.ts +69 -0
- package/dist/lib/persistence/backend-mode.js +120 -0
- package/dist/lib/persistence/backend-mode.js.map +1 -0
- package/dist/lib/persistence/convex-adapter.d.ts +34 -0
- package/dist/lib/persistence/convex-adapter.js +681 -0
- package/dist/lib/persistence/convex-adapter.js.map +1 -0
- package/dist/lib/persistence/convex-blob-storage.d.ts +57 -0
- package/dist/lib/persistence/convex-blob-storage.js +97 -0
- package/dist/lib/persistence/convex-blob-storage.js.map +1 -0
- package/dist/lib/persistence/convex-client.d.ts +19 -0
- package/dist/lib/persistence/convex-client.js +40 -0
- package/dist/lib/persistence/convex-client.js.map +1 -0
- package/dist/lib/persistence/index.d.ts +30 -0
- package/dist/lib/persistence/index.js +60 -0
- package/dist/lib/persistence/index.js.map +1 -0
- package/dist/lib/persona/labels.d.ts +23 -0
- package/dist/lib/persona/labels.js +122 -0
- package/dist/lib/persona/labels.js.map +1 -0
- package/dist/lib/rail.d.ts +11 -0
- package/dist/lib/rail.js +26 -0
- package/dist/lib/rail.js.map +1 -0
- package/dist/lib/references/impact.d.ts +64 -0
- package/dist/lib/references/impact.js +62 -0
- package/dist/lib/references/impact.js.map +1 -0
- package/dist/lib/references/index.d.ts +7 -0
- package/dist/lib/references/index.js +8 -0
- package/dist/lib/references/index.js.map +1 -0
- package/dist/lib/references/reference-model.d.ts +125 -0
- package/dist/lib/references/reference-model.js +242 -0
- package/dist/lib/references/reference-model.js.map +1 -0
- package/dist/lib/references/references-store.d.ts +65 -0
- package/dist/lib/references/references-store.js +221 -0
- package/dist/lib/references/references-store.js.map +1 -0
- package/dist/lib/registry/index.d.ts +65 -0
- package/dist/lib/registry/index.js +114 -0
- package/dist/lib/registry/index.js.map +1 -0
- package/dist/lib/registry/preview.d.ts +15 -0
- package/dist/lib/registry/preview.js +110 -0
- package/dist/lib/registry/preview.js.map +1 -0
- package/dist/lib/registry/project-components.d.ts +16 -0
- package/dist/lib/registry/project-components.js +152 -0
- package/dist/lib/registry/project-components.js.map +1 -0
- package/dist/lib/routing/index.d.ts +10 -0
- package/dist/lib/routing/index.js +11 -0
- package/dist/lib/routing/index.js.map +1 -0
- package/dist/lib/routing/routing-analysis.d.ts +26 -0
- package/dist/lib/routing/routing-analysis.js +37 -0
- package/dist/lib/routing/routing-analysis.js.map +1 -0
- package/dist/lib/routing/routing-store.d.ts +50 -0
- package/dist/lib/routing/routing-store.js +72 -0
- package/dist/lib/routing/routing-store.js.map +1 -0
- package/dist/lib/starters/kit-session.d.ts +5 -0
- package/dist/lib/starters/kit-session.js +17 -0
- package/dist/lib/starters/kit-session.js.map +1 -0
- package/dist/lib/theme.d.ts +21 -0
- package/dist/lib/theme.js +32 -0
- package/dist/lib/theme.js.map +1 -0
- package/dist/lib/utils.d.ts +11 -0
- package/dist/lib/utils.js +28 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/webhooks/config.d.ts +15 -0
- package/dist/lib/webhooks/config.js +64 -0
- package/dist/lib/webhooks/config.js.map +1 -0
- package/dist/lib/webhooks/dispatcher.d.ts +67 -0
- package/dist/lib/webhooks/dispatcher.js +61 -0
- package/dist/lib/webhooks/dispatcher.js.map +1 -0
- package/dist/lib/webhooks/index.d.ts +11 -0
- package/dist/lib/webhooks/index.js +10 -0
- package/dist/lib/webhooks/index.js.map +1 -0
- package/dist/lib/webhooks/signing.d.ts +15 -0
- package/dist/lib/webhooks/signing.js +24 -0
- package/dist/lib/webhooks/signing.js.map +1 -0
- package/dist/lib/webhooks/tags.d.ts +25 -0
- package/dist/lib/webhooks/tags.js +173 -0
- package/dist/lib/webhooks/tags.js.map +1 -0
- package/dist/lib/working-graph.d.ts +82 -0
- package/dist/lib/working-graph.js +113 -0
- package/dist/lib/working-graph.js.map +1 -0
- package/dist/lib/workspace/index.d.ts +109 -0
- package/dist/lib/workspace/index.js +206 -0
- package/dist/lib/workspace/index.js.map +1 -0
- package/dist/lib/workspace/switcher-source.d.ts +39 -0
- package/dist/lib/workspace/switcher-source.js +23 -0
- package/dist/lib/workspace/switcher-source.js.map +1 -0
- package/dist/lib/workspace/workspace-source.d.ts +47 -0
- package/dist/lib/workspace/workspace-source.js +67 -0
- package/dist/lib/workspace/workspace-source.js.map +1 -0
- package/dist/router/index.d.ts +32 -0
- package/dist/router/index.js +32 -0
- package/dist/router/index.js.map +1 -0
- package/dist/router/match.d.ts +75 -0
- package/dist/router/match.js +87 -0
- package/dist/router/match.js.map +1 -0
- package/dist/router/search.d.ts +22 -0
- package/dist/router/search.js +16 -0
- package/dist/router/search.js.map +1 -0
- package/dist/ui/avatar.d.ts +17 -0
- package/dist/ui/avatar.js +38 -0
- package/dist/ui/avatar.js.map +1 -0
- package/dist/ui/badge.d.ts +9 -0
- package/dist/ui/badge.js +23 -0
- package/dist/ui/badge.js.map +1 -0
- package/dist/ui/button.d.ts +11 -0
- package/dist/ui/button.js +30 -0
- package/dist/ui/button.js.map +1 -0
- package/dist/ui/card.d.ts +11 -0
- package/dist/ui/card.js +23 -0
- package/dist/ui/card.js.map +1 -0
- package/dist/ui/dialog.d.ts +12 -0
- package/dist/ui/dialog.js +27 -0
- package/dist/ui/dialog.js.map +1 -0
- package/dist/ui/dropdown-menu.d.ts +15 -0
- package/dist/ui/dropdown-menu.js +24 -0
- package/dist/ui/dropdown-menu.js.map +1 -0
- package/dist/ui/field.d.ts +15 -0
- package/dist/ui/field.js +14 -0
- package/dist/ui/field.js.map +1 -0
- package/dist/ui/index.d.ts +14 -0
- package/dist/ui/index.js +15 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/input.d.ts +3 -0
- package/dist/ui/input.js +7 -0
- package/dist/ui/input.js.map +1 -0
- package/dist/ui/inspector.d.ts +18 -0
- package/dist/ui/inspector.js +14 -0
- package/dist/ui/inspector.js.map +1 -0
- package/dist/ui/layout.d.ts +45 -0
- package/dist/ui/layout.js +48 -0
- package/dist/ui/layout.js.map +1 -0
- package/dist/ui/panel.d.ts +12 -0
- package/dist/ui/panel.js +20 -0
- package/dist/ui/panel.js.map +1 -0
- package/dist/ui/separator.d.ts +6 -0
- package/dist/ui/separator.js +7 -0
- package/dist/ui/separator.js.map +1 -0
- package/dist/ui/toolbar.d.ts +9 -0
- package/dist/ui/toolbar.js +16 -0
- package/dist/ui/toolbar.js.map +1 -0
- package/dist/ui/typography.d.ts +50 -0
- package/dist/ui/typography.js +43 -0
- package/dist/ui/typography.js.map +1 -0
- package/package.json +149 -0
- package/src/styles/studio.css +101 -0
- package/src/styles/tokens.css +63 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ComponentNode } from '@elytracms/project-graph';
|
|
2
|
+
import type { DragSubject } from '@elytracms/studio/lib/dnd/drop-rules';
|
|
3
|
+
/**
|
|
4
|
+
* The one live drag session (EC-160). HTML5 `dataTransfer` payloads are
|
|
5
|
+
* unreadable during `dragover`, so the canvas, page tree, and blocks panel
|
|
6
|
+
* share this module-level session instead: the source begins it, every
|
|
7
|
+
* surface reads it to resolve drop eligibility (via the pure rules in
|
|
8
|
+
* `lib/dnd/drop-rules`), and exactly one place ends it — the drop handler
|
|
9
|
+
* (`dropped`) or the source's `dragend` (`cancelled`). `endDrag` is
|
|
10
|
+
* idempotent, so the source's trailing `dragend` after a successful drop
|
|
11
|
+
* cannot double-commit or double-notify.
|
|
12
|
+
*
|
|
13
|
+
* The iframe canvas shares the parent window's JS realm (listeners are wired
|
|
14
|
+
* from the parent), so one module instance covers all surfaces.
|
|
15
|
+
*/
|
|
16
|
+
/** Custom MIME marking Elytra drags (lets surfaces ignore foreign drags). */
|
|
17
|
+
export declare const ELYTRA_DND_MIME = "application/x-elytra-canvas";
|
|
18
|
+
export type DragSource = 'canvas' | 'tree' | 'blocks';
|
|
19
|
+
export type DragOutcome = 'dropped' | 'cancelled';
|
|
20
|
+
export interface DragSession {
|
|
21
|
+
subject: DragSubject;
|
|
22
|
+
source: DragSource;
|
|
23
|
+
/** Human label (drag text fallback). */
|
|
24
|
+
label: string;
|
|
25
|
+
/** For `component` subjects: builds the subtree to insert (ids reassigned by the store). */
|
|
26
|
+
buildNode?: () => ComponentNode;
|
|
27
|
+
}
|
|
28
|
+
type EndListener = (outcome: DragOutcome, session: DragSession) => void;
|
|
29
|
+
/** Begin a drag session and stamp the dataTransfer (Firefox requires data to drag). */
|
|
30
|
+
export declare function beginDrag(session: DragSession, dataTransfer: DataTransfer | null): void;
|
|
31
|
+
/** The live session, or null when nothing Elytra-owned is being dragged. */
|
|
32
|
+
export declare function activeDrag(): DragSession | null;
|
|
33
|
+
/**
|
|
34
|
+
* End the live session (no-op when none is active) and notify subscribers.
|
|
35
|
+
* Call with `dropped` from the drop handler that dispatched the action, and
|
|
36
|
+
* with `cancelled` from the source's `dragend`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function endDrag(outcome: DragOutcome): void;
|
|
39
|
+
/** Subscribe to session end (indicator cleanup, blocks-panel close-on-drop). */
|
|
40
|
+
export declare function onDragSessionEnd(listener: EndListener): () => void;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one live drag session (EC-160). HTML5 `dataTransfer` payloads are
|
|
3
|
+
* unreadable during `dragover`, so the canvas, page tree, and blocks panel
|
|
4
|
+
* share this module-level session instead: the source begins it, every
|
|
5
|
+
* surface reads it to resolve drop eligibility (via the pure rules in
|
|
6
|
+
* `lib/dnd/drop-rules`), and exactly one place ends it — the drop handler
|
|
7
|
+
* (`dropped`) or the source's `dragend` (`cancelled`). `endDrag` is
|
|
8
|
+
* idempotent, so the source's trailing `dragend` after a successful drop
|
|
9
|
+
* cannot double-commit or double-notify.
|
|
10
|
+
*
|
|
11
|
+
* The iframe canvas shares the parent window's JS realm (listeners are wired
|
|
12
|
+
* from the parent), so one module instance covers all surfaces.
|
|
13
|
+
*/
|
|
14
|
+
/** Custom MIME marking Elytra drags (lets surfaces ignore foreign drags). */
|
|
15
|
+
export const ELYTRA_DND_MIME = 'application/x-elytra-canvas';
|
|
16
|
+
let active = null;
|
|
17
|
+
const endListeners = new Set();
|
|
18
|
+
/** Begin a drag session and stamp the dataTransfer (Firefox requires data to drag). */
|
|
19
|
+
export function beginDrag(session, dataTransfer) {
|
|
20
|
+
active = session;
|
|
21
|
+
if (dataTransfer) {
|
|
22
|
+
dataTransfer.setData(ELYTRA_DND_MIME, session.label);
|
|
23
|
+
dataTransfer.setData('text/plain', session.label);
|
|
24
|
+
dataTransfer.effectAllowed = session.subject.kind === 'node' ? 'move' : 'copy';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/** The live session, or null when nothing Elytra-owned is being dragged. */
|
|
28
|
+
export function activeDrag() {
|
|
29
|
+
return active;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* End the live session (no-op when none is active) and notify subscribers.
|
|
33
|
+
* Call with `dropped` from the drop handler that dispatched the action, and
|
|
34
|
+
* with `cancelled` from the source's `dragend`.
|
|
35
|
+
*/
|
|
36
|
+
export function endDrag(outcome) {
|
|
37
|
+
if (!active)
|
|
38
|
+
return;
|
|
39
|
+
const session = active;
|
|
40
|
+
active = null;
|
|
41
|
+
for (const listener of [...endListeners])
|
|
42
|
+
listener(outcome, session);
|
|
43
|
+
}
|
|
44
|
+
/** Subscribe to session end (indicator cleanup, blocks-panel close-on-drop). */
|
|
45
|
+
export function onDragSessionEnd(listener) {
|
|
46
|
+
endListeners.add(listener);
|
|
47
|
+
return () => {
|
|
48
|
+
endListeners.delete(listener);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=drag-session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drag-session.js","sourceRoot":"","sources":["../../../src/components/builder/drag-session.ts"],"names":[],"mappings":"AAGA;;;;;;;;;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elytracms/studio/lib/registry';
|
|
3
|
+
export declare function ScaledFixtureThumbnail({ node, studio, designWidth, eager, className, }: {
|
|
4
|
+
/** The preview subtree to render live (deterministic ids). */
|
|
5
|
+
node: ComponentNode;
|
|
6
|
+
/**
|
|
7
|
+
* Registry the preview renders against. Defaults to the active project's live
|
|
8
|
+
* registry (`getStudioRegistry()`) — the blocks panel's tiles and their
|
|
9
|
+
* thumbnails share one registry. Pass an explicit registry to render against a
|
|
10
|
+
* specific component set (deterministic previews/tests).
|
|
11
|
+
*/
|
|
12
|
+
studio?: StudioRegistry;
|
|
13
|
+
/** Layout width of the unscaled preview, in CSS pixels. */
|
|
14
|
+
designWidth?: number;
|
|
15
|
+
/** Mount the live render immediately instead of waiting for visibility. */
|
|
16
|
+
eager?: boolean;
|
|
17
|
+
className?: string;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Component, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import { AlertTriangle } from 'lucide-react';
|
|
4
|
+
import { renderNode } from '@elytracms/runtime-renderer';
|
|
5
|
+
import { getStudioRegistry, previewContext } from '@elytracms/studio/lib/registry';
|
|
6
|
+
import { cn } from '@elytracms/studio/lib/utils';
|
|
7
|
+
/**
|
|
8
|
+
* Live, scaled fixture thumbnail (EC-164). Renders a preview node through the
|
|
9
|
+
* runtime renderer — the exact render path the canvas, fixture runner, and
|
|
10
|
+
* export use — inside a fixed-aspect tile, scaled down with a CSS transform.
|
|
11
|
+
* Never a screenshot, never interactive (pointer events are disabled), and
|
|
12
|
+
* never a crash: render errors degrade to a visible fallback inside the tile.
|
|
13
|
+
*
|
|
14
|
+
* Off-screen thumbnails mount lazily via IntersectionObserver so a large
|
|
15
|
+
* registry doesn't render its whole library up front; pass `eager` to render
|
|
16
|
+
* immediately (first-fold tiles, non-DOM tests).
|
|
17
|
+
*/
|
|
18
|
+
/** Width the preview is laid out at before being scaled into the tile. */
|
|
19
|
+
const DESIGN_WIDTH = 420;
|
|
20
|
+
/** Fallback scale used for the single frame before the tile is measured. */
|
|
21
|
+
const FALLBACK_SCALE = 0.45;
|
|
22
|
+
function LiveRender({ node, studio }) {
|
|
23
|
+
const ctx = useMemo(() => previewContext(studio), [studio]);
|
|
24
|
+
// Called inside a component render so the boundary catches sync throws too.
|
|
25
|
+
return _jsx(_Fragment, { children: renderNode(node, ctx) });
|
|
26
|
+
}
|
|
27
|
+
function ThumbnailFallback({ message }) {
|
|
28
|
+
return (_jsxs("div", { "data-block-thumbnail-fallback": true, className: "flex h-full w-full items-start gap-1.5 p-2 text-[0.7rem] leading-snug text-amber-700 dark:text-amber-400", children: [_jsx(AlertTriangle, { "aria-hidden": true, className: "mt-px size-3 shrink-0" }), _jsx("span", { className: "line-clamp-3", children: message })] }));
|
|
29
|
+
}
|
|
30
|
+
/** Tile-local error boundary: one broken fixture never takes down the panel. */
|
|
31
|
+
class ThumbnailErrorBoundary extends Component {
|
|
32
|
+
state = { error: null };
|
|
33
|
+
static getDerivedStateFromError(error) {
|
|
34
|
+
return { error };
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
if (this.state.error) {
|
|
38
|
+
return _jsx(ThumbnailFallback, { message: `Preview failed: ${this.state.error.message}` });
|
|
39
|
+
}
|
|
40
|
+
return this.props.children;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export function ScaledFixtureThumbnail({ node, studio, designWidth = DESIGN_WIDTH, eager = false, className, }) {
|
|
44
|
+
const registry = studio ?? getStudioRegistry();
|
|
45
|
+
const ref = useRef(null);
|
|
46
|
+
const [inView, setInView] = useState(eager);
|
|
47
|
+
const [scale, setScale] = useState(null);
|
|
48
|
+
// Lazy mount: render the live preview only once the tile scrolls into view.
|
|
49
|
+
// IntersectionObserver always delivers an initial report (intersecting or
|
|
50
|
+
// not) within a rendering frame — when no report arrives at all the page
|
|
51
|
+
// isn't producing frames (occluded/headless automation windows), so a
|
|
52
|
+
// safety-net timer mounts the preview rather than leaving tiles blank.
|
|
53
|
+
// Frame-producing browsers report long before the timer and keep laziness.
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (inView)
|
|
56
|
+
return;
|
|
57
|
+
const el = ref.current;
|
|
58
|
+
if (!el || typeof IntersectionObserver === 'undefined') {
|
|
59
|
+
setInView(true);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
let reported = false;
|
|
63
|
+
const observer = new IntersectionObserver((entries) => {
|
|
64
|
+
reported = true;
|
|
65
|
+
if (entries.some((entry) => entry.isIntersecting))
|
|
66
|
+
setInView(true);
|
|
67
|
+
});
|
|
68
|
+
observer.observe(el);
|
|
69
|
+
const fallback = setTimeout(() => {
|
|
70
|
+
if (!reported)
|
|
71
|
+
setInView(true);
|
|
72
|
+
}, 400);
|
|
73
|
+
return () => {
|
|
74
|
+
observer.disconnect();
|
|
75
|
+
clearTimeout(fallback);
|
|
76
|
+
};
|
|
77
|
+
}, [inView]);
|
|
78
|
+
// Fit-to-tile scale, kept in sync with the tile's measured width.
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
const el = ref.current;
|
|
81
|
+
if (!el)
|
|
82
|
+
return;
|
|
83
|
+
const update = () => {
|
|
84
|
+
const width = el.clientWidth;
|
|
85
|
+
if (width > 0)
|
|
86
|
+
setScale(width / designWidth);
|
|
87
|
+
};
|
|
88
|
+
update();
|
|
89
|
+
if (typeof ResizeObserver === 'undefined')
|
|
90
|
+
return;
|
|
91
|
+
const observer = new ResizeObserver(update);
|
|
92
|
+
observer.observe(el);
|
|
93
|
+
return () => observer.disconnect();
|
|
94
|
+
}, [designWidth]);
|
|
95
|
+
return (_jsx("div", { ref: ref, "aria-hidden": true, "data-block-thumbnail": true, className: cn('relative w-full overflow-hidden rounded-md border border-border bg-background', className), style: { aspectRatio: '16 / 10' }, children: inView ? (_jsx(ThumbnailErrorBoundary, { children: _jsx("div", { className: "pointer-events-none absolute left-0 top-0 origin-top-left select-none p-3", style: { width: designWidth, transform: `scale(${scale ?? FALLBACK_SCALE})` }, children: _jsx(LiveRender, { node: node, studio: registry }) }) })) : null }));
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=fixture-thumbnail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixture-thumbnail.js","sourceRoot":"","sources":["../../../src/components/builder/fixture-thumbnail.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEvE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAExD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAElF,OAAO,EAAE,EAAE,EAAE,MAAM,6BAA6B,CAAA;AAEhD;;;;;;;;;;GAUG;AAEH,0EAA0E;AAC1E,MAAM,YAAY,GAAG,GAAG,CAAA;AACxB,4EAA4E;AAC5E,MAAM,cAAc,GAAG,IAAI,CAAA;AAE3B,SAAS,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAmD;IACnF,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAA;IAC3D,4EAA4E;IAC5E,OAAO,4BAAG,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,GAAI,CAAA;AACrC,CAAC;AAED,SAAS,iBAAiB,CAAC,EAAE,OAAO,EAAuB;IACzD,OAAO,CACL,sDAEE,SAAS,EAAC,0GAA0G,aAEpH,KAAC,aAAa,yBAAa,SAAS,EAAC,uBAAuB,GAAG,EAC/D,eAAM,SAAS,EAAC,cAAc,YAAE,OAAO,GAAQ,IAC3C,CACP,CAAA;AACH,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,GAAG,qDAGR,SAAS,EAAE,EAAE,CACX,+EAA+E,EAC/E,SAAS,CACV,EACD,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,YAEhC,MAAM,CAAC,CAAC,CAAC,CACR,KAAC,sBAAsB,cACrB,cACE,SAAS,EAAC,2EAA2E,EACrF,KAAK,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,KAAK,IAAI,cAAc,GAAG,EAAE,YAE7E,KAAC,UAAU,IAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAI,GACxC,GACiB,CAC1B,CAAC,CAAC,CAAC,IAAI,GACJ,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import type { ComponentManifest } from '@elytracms/component-registry';
|
|
2
|
+
import type { ComponentNode } from '@elytracms/project-graph';
|
|
3
|
+
import type { RichTextDoc, RichTextValue } from '@elytracms/rich-text';
|
|
4
|
+
/**
|
|
5
|
+
* Inline text editing on the canvas (EC-158) — framework-free core.
|
|
6
|
+
*
|
|
7
|
+
* The canvas wires DOM events (dblclick/keydown/blur) to this module; the
|
|
8
|
+
* module owns the editing-session state machine and the
|
|
9
|
+
* one-gesture-one-command guarantee. A session finishes exactly once: the
|
|
10
|
+
* first `commit()`/`cancel()` wins and every later call returns `null`, so
|
|
11
|
+
* overlapping DOM signals (Enter immediately followed by blur, blur racing a
|
|
12
|
+
* teardown) can never dispatch a second operations command or stack a second
|
|
13
|
+
* undo step.
|
|
14
|
+
*
|
|
15
|
+
* Locale semantics (EC-176): inline editing targets STATIC graph props only,
|
|
16
|
+
* and static graph props are locale-independent by design — the canonical
|
|
17
|
+
* graph stores one value per prop, not per-locale variants. Bound props are
|
|
18
|
+
* never inline-editable (below), so fallback-shown BOUND text on the canvas
|
|
19
|
+
* cannot be edited in place either: translating localized content happens in
|
|
20
|
+
* the CMS surfaces, where the active-locale variant is created explicitly.
|
|
21
|
+
* Nothing here needs the ambient locale.
|
|
22
|
+
*/
|
|
23
|
+
/** The single graph mutation a finished session may produce. */
|
|
24
|
+
export interface InlineEditCommit {
|
|
25
|
+
kind: 'commit';
|
|
26
|
+
nodeId: string;
|
|
27
|
+
propName: string;
|
|
28
|
+
/** The edited text to write as the prop's static value. */
|
|
29
|
+
value: string;
|
|
30
|
+
}
|
|
31
|
+
/** A cancelled session: restore this text on the DOM, dispatch nothing. */
|
|
32
|
+
export interface InlineEditCancel {
|
|
33
|
+
kind: 'cancel';
|
|
34
|
+
/** The original rendered value to restore. */
|
|
35
|
+
value: string;
|
|
36
|
+
}
|
|
37
|
+
export interface InlineEditSession {
|
|
38
|
+
readonly nodeId: string;
|
|
39
|
+
readonly propName: string;
|
|
40
|
+
readonly original: string;
|
|
41
|
+
/** False once the session committed or cancelled. */
|
|
42
|
+
readonly active: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Finish by committing `text`. Returns the one commit outcome, or `null`
|
|
45
|
+
* when the session already finished or the text is unchanged (an unchanged
|
|
46
|
+
* commit finishes the session but dispatches nothing — graph untouched).
|
|
47
|
+
*/
|
|
48
|
+
commit(text: string): InlineEditCommit | null;
|
|
49
|
+
/** Finish by cancelling. Returns the restore outcome once, then `null`. */
|
|
50
|
+
cancel(): InlineEditCancel | null;
|
|
51
|
+
}
|
|
52
|
+
export declare function createInlineEditSession(args: {
|
|
53
|
+
nodeId: string;
|
|
54
|
+
propName: string;
|
|
55
|
+
original: string;
|
|
56
|
+
}): InlineEditSession;
|
|
57
|
+
/** A node prop that can be edited in place right now. */
|
|
58
|
+
export interface InlineEditableProp {
|
|
59
|
+
propName: string;
|
|
60
|
+
/** The current static string value (or string default when unset). */
|
|
61
|
+
value: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Resolve which prop of `node` an inline-edit gesture should target: the
|
|
65
|
+
* first manifest prop flagged `inlineEditable` whose *current* value is a
|
|
66
|
+
* plain static string (or unset with a string default). Bound props and
|
|
67
|
+
* non-string values are never inline-editable — they stay inspector-only.
|
|
68
|
+
*/
|
|
69
|
+
export declare function resolveInlineEditableProp(manifest: ComponentManifest | undefined, node: ComponentNode): InlineEditableProp | null;
|
|
70
|
+
/** A node prop carrying rich-text content that can be edited in place now. */
|
|
71
|
+
export interface InlineRichTextProp {
|
|
72
|
+
propName: string;
|
|
73
|
+
/** The current stored value (or the manifest default when unset). */
|
|
74
|
+
value: RichTextValue;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Resolve which rich-text prop of `node` an inline-edit gesture should
|
|
78
|
+
* target: the first manifest prop flagged `inlineEditable` whose inspector
|
|
79
|
+
* control is `richtext` and whose *current* value is a static, schema-valid
|
|
80
|
+
* rich-text value (or unset with a valid rich-text default). Bound props are
|
|
81
|
+
* never inline-editable — translating/bound content stays inspector- and
|
|
82
|
+
* CMS-owned, exactly like EC-158's plain-text rule.
|
|
83
|
+
*/
|
|
84
|
+
export declare function resolveInlineRichTextProp(manifest: ComponentManifest | undefined, node: ComponentNode): InlineRichTextProp | null;
|
|
85
|
+
/** The single graph mutation a finished rich-text session may produce. */
|
|
86
|
+
export interface InlineRichTextCommit {
|
|
87
|
+
kind: 'commit';
|
|
88
|
+
nodeId: string;
|
|
89
|
+
propName: string;
|
|
90
|
+
/** The edited content to write as the prop's static value. */
|
|
91
|
+
value: RichTextValue;
|
|
92
|
+
}
|
|
93
|
+
export interface InlineRichTextSession {
|
|
94
|
+
readonly nodeId: string;
|
|
95
|
+
readonly propName: string;
|
|
96
|
+
readonly original: RichTextValue;
|
|
97
|
+
/** False once the session committed or cancelled. */
|
|
98
|
+
readonly active: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Finish by committing the parsed-back document. Returns the one commit
|
|
101
|
+
* outcome, or `null` when the session already finished or the document is
|
|
102
|
+
* equivalent to the original. An equivalent commit finishes the session and
|
|
103
|
+
* dispatches nothing — the stored value is never rewritten, so untouched
|
|
104
|
+
* content round-trips byte-identical.
|
|
105
|
+
*/
|
|
106
|
+
commit(doc: RichTextDoc): InlineRichTextCommit | null;
|
|
107
|
+
/** Finish by cancelling. Returns `true` exactly once (restore the DOM). */
|
|
108
|
+
cancel(): boolean;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* One rich-text editing session (EC-159), with EC-158's one-finish guarantee:
|
|
112
|
+
* the first `commit()`/`cancel()` wins and every later call is inert, so
|
|
113
|
+
* overlapping DOM signals can never dispatch a second operations command or
|
|
114
|
+
* stack a second undo step. The committed value keeps the original's stored
|
|
115
|
+
* schema `version` stamp — only the document tree changes.
|
|
116
|
+
*/
|
|
117
|
+
export declare function createInlineRichTextSession(args: {
|
|
118
|
+
nodeId: string;
|
|
119
|
+
propName: string;
|
|
120
|
+
original: RichTextValue;
|
|
121
|
+
}): InlineRichTextSession;
|
|
122
|
+
/**
|
|
123
|
+
* The structural slice of `Element` the host finder needs — kept minimal so
|
|
124
|
+
* the descent logic is unit-testable without a DOM.
|
|
125
|
+
*/
|
|
126
|
+
export interface InlineHostElement {
|
|
127
|
+
readonly childElementCount: number;
|
|
128
|
+
readonly firstElementChild: InlineHostElement | null;
|
|
129
|
+
readonly textContent: string | null;
|
|
130
|
+
getAttribute(name: string): string | null;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Find the rendered element inside a node's `.ec-editable` wrapper that hosts
|
|
134
|
+
* the editable text. Descends single-child chains as long as no text is lost,
|
|
135
|
+
* never crossing into another node's wrapper, and only accepts a host whose
|
|
136
|
+
* text content is *exactly* the stored prop value — if the component renders
|
|
137
|
+
* the prop transformed (or alongside other text), inline editing is skipped
|
|
138
|
+
* and the inspector remains the editing surface. That exactness is what makes
|
|
139
|
+
* edit-mode typography pixel-identical to render state: we edit the rendered
|
|
140
|
+
* element itself.
|
|
141
|
+
*/
|
|
142
|
+
export declare function findInlineTextHost(wrapper: InlineHostElement, expected: string): InlineHostElement | null;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { inlineEditablePropNames } from '@elytracms/component-registry';
|
|
2
|
+
import { parseRichTextValue, richTextDocsEquivalent } from '@elytracms/rich-text';
|
|
3
|
+
export function createInlineEditSession(args) {
|
|
4
|
+
let active = true;
|
|
5
|
+
return {
|
|
6
|
+
nodeId: args.nodeId,
|
|
7
|
+
propName: args.propName,
|
|
8
|
+
original: args.original,
|
|
9
|
+
get active() {
|
|
10
|
+
return active;
|
|
11
|
+
},
|
|
12
|
+
commit(text) {
|
|
13
|
+
if (!active)
|
|
14
|
+
return null;
|
|
15
|
+
active = false;
|
|
16
|
+
if (text === args.original)
|
|
17
|
+
return null;
|
|
18
|
+
return { kind: 'commit', nodeId: args.nodeId, propName: args.propName, value: text };
|
|
19
|
+
},
|
|
20
|
+
cancel() {
|
|
21
|
+
if (!active)
|
|
22
|
+
return null;
|
|
23
|
+
active = false;
|
|
24
|
+
return { kind: 'cancel', value: args.original };
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Resolve which prop of `node` an inline-edit gesture should target: the
|
|
30
|
+
* first manifest prop flagged `inlineEditable` whose *current* value is a
|
|
31
|
+
* plain static string (or unset with a string default). Bound props and
|
|
32
|
+
* non-string values are never inline-editable — they stay inspector-only.
|
|
33
|
+
*/
|
|
34
|
+
export function resolveInlineEditableProp(manifest, node) {
|
|
35
|
+
if (!manifest)
|
|
36
|
+
return null;
|
|
37
|
+
for (const propName of inlineEditablePropNames(manifest)) {
|
|
38
|
+
const current = node.props?.[propName];
|
|
39
|
+
if (current === undefined) {
|
|
40
|
+
const fallback = manifest.props[propName]?.default;
|
|
41
|
+
if (typeof fallback === 'string')
|
|
42
|
+
return { propName, value: fallback };
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (current.kind === 'static' && typeof current.value === 'string') {
|
|
46
|
+
return { propName, value: current.value };
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Resolve which rich-text prop of `node` an inline-edit gesture should
|
|
53
|
+
* target: the first manifest prop flagged `inlineEditable` whose inspector
|
|
54
|
+
* control is `richtext` and whose *current* value is a static, schema-valid
|
|
55
|
+
* rich-text value (or unset with a valid rich-text default). Bound props are
|
|
56
|
+
* never inline-editable — translating/bound content stays inspector- and
|
|
57
|
+
* CMS-owned, exactly like EC-158's plain-text rule.
|
|
58
|
+
*/
|
|
59
|
+
export function resolveInlineRichTextProp(manifest, node) {
|
|
60
|
+
if (!manifest)
|
|
61
|
+
return null;
|
|
62
|
+
for (const propName of inlineEditablePropNames(manifest)) {
|
|
63
|
+
// EC-190: a rich-text prop is the `richText` field-def type (was control.kind 'richtext').
|
|
64
|
+
if (manifest.props[propName]?.type !== 'richText')
|
|
65
|
+
continue;
|
|
66
|
+
const current = node.props?.[propName];
|
|
67
|
+
const raw = current === undefined ? manifest.props[propName]?.default : undefined;
|
|
68
|
+
if (current !== undefined && current.kind !== 'static')
|
|
69
|
+
continue;
|
|
70
|
+
const parsed = parseRichTextValue(current?.kind === 'static' ? current.value : raw);
|
|
71
|
+
if (parsed.ok)
|
|
72
|
+
return { propName, value: parsed.value };
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* One rich-text editing session (EC-159), with EC-158's one-finish guarantee:
|
|
78
|
+
* the first `commit()`/`cancel()` wins and every later call is inert, so
|
|
79
|
+
* overlapping DOM signals can never dispatch a second operations command or
|
|
80
|
+
* stack a second undo step. The committed value keeps the original's stored
|
|
81
|
+
* schema `version` stamp — only the document tree changes.
|
|
82
|
+
*/
|
|
83
|
+
export function createInlineRichTextSession(args) {
|
|
84
|
+
let active = true;
|
|
85
|
+
return {
|
|
86
|
+
nodeId: args.nodeId,
|
|
87
|
+
propName: args.propName,
|
|
88
|
+
original: args.original,
|
|
89
|
+
get active() {
|
|
90
|
+
return active;
|
|
91
|
+
},
|
|
92
|
+
commit(doc) {
|
|
93
|
+
if (!active)
|
|
94
|
+
return null;
|
|
95
|
+
active = false;
|
|
96
|
+
if (richTextDocsEquivalent(doc, args.original.doc))
|
|
97
|
+
return null;
|
|
98
|
+
return {
|
|
99
|
+
kind: 'commit',
|
|
100
|
+
nodeId: args.nodeId,
|
|
101
|
+
propName: args.propName,
|
|
102
|
+
value: { version: args.original.version, doc },
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
cancel() {
|
|
106
|
+
if (!active)
|
|
107
|
+
return false;
|
|
108
|
+
active = false;
|
|
109
|
+
return true;
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Find the rendered element inside a node's `.ec-editable` wrapper that hosts
|
|
115
|
+
* the editable text. Descends single-child chains as long as no text is lost,
|
|
116
|
+
* never crossing into another node's wrapper, and only accepts a host whose
|
|
117
|
+
* text content is *exactly* the stored prop value — if the component renders
|
|
118
|
+
* the prop transformed (or alongside other text), inline editing is skipped
|
|
119
|
+
* and the inspector remains the editing surface. That exactness is what makes
|
|
120
|
+
* edit-mode typography pixel-identical to render state: we edit the rendered
|
|
121
|
+
* element itself.
|
|
122
|
+
*/
|
|
123
|
+
export function findInlineTextHost(wrapper, expected) {
|
|
124
|
+
let el = wrapper.firstElementChild;
|
|
125
|
+
if (!el)
|
|
126
|
+
return null;
|
|
127
|
+
if (el.getAttribute('data-ec-node-id') !== null)
|
|
128
|
+
return null;
|
|
129
|
+
while (el.childElementCount === 1 &&
|
|
130
|
+
el.firstElementChild.getAttribute('data-ec-node-id') === null &&
|
|
131
|
+
el.firstElementChild.textContent === el.textContent) {
|
|
132
|
+
el = el.firstElementChild;
|
|
133
|
+
}
|
|
134
|
+
return (el.textContent ?? '') === expected ? el : null;
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=inline-edit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-edit.js","sourceRoot":"","sources":["../../../src/components/builder/inline-edit.ts"],"names":[],"mappings":"A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E,CAAC,iBAAkB,CAAC,YAAY,CAAC,iBAAiB,CAAC,KAAK,IAAI;QAC9D,EAAE,CAAC,iBAAkB,CAAC,WAAW,KAAK,EAAE,CAAC,WAAW,EACpD,CAAC;QACD,EAAE,GAAG,EAAE,CAAC,iBAAkB,CAAA;IAC5B,CAAC;IACD,OAAO,CAAC,EAAE,CAAC,WAAW,IAAI,EAAE,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;AACxD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { InsertContext } from './insert-menu';
|
|
2
|
+
import { useBuilder } from './builder-store';
|
|
3
|
+
/**
|
|
4
|
+
* Resolve where an insert lands: into the node's child slot, else as a sibling.
|
|
5
|
+
*
|
|
6
|
+
* `fieldAllow` (EC-188) is the composition field's TOP-LEVEL vocabulary
|
|
7
|
+
* (`field.allow`). It constrains ONLY inserts that land as a direct child of the
|
|
8
|
+
* active page root — the top level of a composition field value — where it is
|
|
9
|
+
* intersected into `slotAllow` so forbidden components are never even offered,
|
|
10
|
+
* mirroring the top-level leash in `validateCompositionValue`. Deeper inserts keep
|
|
11
|
+
* following each component's own slot `allow`. Callers that omit `fieldAllow` get
|
|
12
|
+
* an unconstrained top level.
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveInsertContext(builder: ReturnType<typeof useBuilder>, nodeId: string, fieldAllow?: readonly string[]): InsertContext | null;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { getNode, getParentInfo } from '@elytracms/project-graph';
|
|
2
|
+
import { getStudioRegistry } from '@elytracms/studio/lib/registry';
|
|
3
|
+
import { intersectAllow } from './blocks-model';
|
|
4
|
+
import { useBuilder } from './builder-store';
|
|
5
|
+
/**
|
|
6
|
+
* Where an insert lands: the canvas insert-context resolution, shared by every
|
|
7
|
+
* surface that mounts the canvas engine.
|
|
8
|
+
*
|
|
9
|
+
* Extracted from the retired standalone `BuilderShell` (EC-210) so the in-CMS
|
|
10
|
+
* Canvas editor (`composition-field-editor.tsx`, EC-188/AD-12) can own it without
|
|
11
|
+
* importing the dead shell. No UI here — pure graph/registry resolution.
|
|
12
|
+
*/
|
|
13
|
+
function shortId(componentId) {
|
|
14
|
+
return componentId.replace('base.primitives.', '').replace('project.', '');
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Resolve where an insert lands: into the node's child slot, else as a sibling.
|
|
18
|
+
*
|
|
19
|
+
* `fieldAllow` (EC-188) is the composition field's TOP-LEVEL vocabulary
|
|
20
|
+
* (`field.allow`). It constrains ONLY inserts that land as a direct child of the
|
|
21
|
+
* active page root — the top level of a composition field value — where it is
|
|
22
|
+
* intersected into `slotAllow` so forbidden components are never even offered,
|
|
23
|
+
* mirroring the top-level leash in `validateCompositionValue`. Deeper inserts keep
|
|
24
|
+
* following each component's own slot `allow`. Callers that omit `fieldAllow` get
|
|
25
|
+
* an unconstrained top level.
|
|
26
|
+
*/
|
|
27
|
+
export function resolveInsertContext(builder, nodeId, fieldAllow) {
|
|
28
|
+
const studio = getStudioRegistry();
|
|
29
|
+
const root = builder.present.pages.find((p) => p.id === builder.pageId).root;
|
|
30
|
+
const node = getNode(root, nodeId);
|
|
31
|
+
if (!node)
|
|
32
|
+
return null;
|
|
33
|
+
const manifest = studio.registry.getManifest(node.componentId);
|
|
34
|
+
const childSlot = manifest?.slots.find((s) => s.name === 'children') ??
|
|
35
|
+
manifest?.slots.find((s) => s.name !== 'outlet');
|
|
36
|
+
const ctx = childSlot
|
|
37
|
+
? {
|
|
38
|
+
target: { parentId: nodeId, slot: childSlot.name },
|
|
39
|
+
slotAllow: manifest.slots.find((s) => s.name === childSlot.name)?.allow,
|
|
40
|
+
destinationLabel: `${shortId(node.componentId)} · ${childSlot.name}`,
|
|
41
|
+
}
|
|
42
|
+
: resolveSiblingContext(studio, root, nodeId);
|
|
43
|
+
// The field vocabulary governs only the top level (a direct child of the page
|
|
44
|
+
// root). `length > 0` matches the validator, which treats an empty allow as
|
|
45
|
+
// "allow any" (validate.ts).
|
|
46
|
+
if (fieldAllow && fieldAllow.length > 0 && ctx.target.parentId === root.id) {
|
|
47
|
+
return { ...ctx, slotAllow: intersectAllow(ctx.slotAllow, fieldAllow) };
|
|
48
|
+
}
|
|
49
|
+
return ctx;
|
|
50
|
+
}
|
|
51
|
+
/** Sibling-or-root insert context for a node with no insertable child slot. */
|
|
52
|
+
function resolveSiblingContext(studio, root, nodeId) {
|
|
53
|
+
const info = getParentInfo(root, nodeId);
|
|
54
|
+
if (info) {
|
|
55
|
+
const pManifest = studio.registry.getManifest(info.parent.componentId);
|
|
56
|
+
const allow = pManifest?.slots.find((s) => s.name === info.slot)?.allow;
|
|
57
|
+
return {
|
|
58
|
+
target: { parentId: info.parent.id, slot: info.slot, index: info.index + 1 },
|
|
59
|
+
slotAllow: allow,
|
|
60
|
+
destinationLabel: `${shortId(info.parent.componentId)} · ${info.slot}`,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
return { target: { parentId: nodeId, slot: 'children' }, destinationLabel: 'root' };
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=insert-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insert-context.js","sourceRoot":"","sources":["../../../src/components/builder/insert-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C;;;;;;;GAOG;AACH,SAAS,OAAO,CAAC,WAAmB;IAClC,OAAO,WAAW,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;AAC5E,CAAC;AAED;;;;;;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
* EC-164: the text-list insert dialog is replaced by the visual blocks panel.
|
|
3
|
+
* This module keeps the `InsertMenu` entry point name the shell mounts; the
|
|
4
|
+
* implementation (including the outside-dismiss guard and viewport-aware
|
|
5
|
+
* max-height behaviours carried over from the old dialog) lives in
|
|
6
|
+
* `blocks-panel.tsx`.
|
|
7
|
+
*/
|
|
8
|
+
export { BlocksPanel as InsertMenu, preventOutsideDismiss } from './blocks-panel';
|
|
9
|
+
export type { InsertContext } from './blocks-panel';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EC-164: the text-list insert dialog is replaced by the visual blocks panel.
|
|
3
|
+
* This module keeps the `InsertMenu` entry point name the shell mounts; the
|
|
4
|
+
* implementation (including the outside-dismiss guard and viewport-aware
|
|
5
|
+
* max-height behaviours carried over from the old dialog) lives in
|
|
6
|
+
* `blocks-panel.tsx`.
|
|
7
|
+
*/
|
|
8
|
+
export { BlocksPanel as InsertMenu, preventOutsideDismiss } from './blocks-panel';
|
|
9
|
+
//# sourceMappingURL=insert-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insert-menu.js","sourceRoot":"","sources":["../../../src/components/builder/insert-menu.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,WAAW,IAAI,UAAU,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentNode, SpacingTokenName } from '@elytracms/project-graph';
|
|
2
|
+
export declare function layoutManagedPropNames(node: ComponentNode): readonly string[];
|
|
3
|
+
/**
|
|
4
|
+
* Plain-language label per spacing token step (EC-161 scale) — no CSS lengths.
|
|
5
|
+
* Shared with the canvas gap handles (EC-163): the live drag label and this
|
|
6
|
+
* select speak the same vocabulary for the same token.
|
|
7
|
+
*/
|
|
8
|
+
export declare const GAP_LABELS: Record<SpacingTokenName, string>;
|
|
9
|
+
/** Plain-language label for the "no gap" step (gap prop absent). */
|
|
10
|
+
export declare const GAP_NONE_LABEL = "None";
|
|
11
|
+
/** The contextual layout section. Renders nothing for non-container nodes. */
|
|
12
|
+
export declare function LayoutSection({ node }: {
|
|
13
|
+
node: ComponentNode;
|
|
14
|
+
}): import("react").JSX.Element | null;
|