@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,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session-expiry detection + plain-language mapping (EC-177 gap 9).
|
|
3
|
+
*
|
|
4
|
+
* An expired Convex session surfaces as a raw backend blob thrown by the
|
|
5
|
+
* transport — e.g. `{"code":"Unauthenticated","message":"Could not verify
|
|
6
|
+
* OIDC token claim…"}` — which `toOperationError` can only normalize to an
|
|
7
|
+
* `unknown`/`backend-unavailable` `OperationError` whose message *is* that
|
|
8
|
+
* blob. Rendering it verbatim is editor-hostile, and the real problem (edits
|
|
9
|
+
* silently stop persisting) is invisible.
|
|
10
|
+
*
|
|
11
|
+
* This module is the one chokepoint that recognizes that shape on the
|
|
12
|
+
* structured `OperationError` (the seam every studio failure already flows
|
|
13
|
+
* through), so UI surfaces never string-match raw messages themselves: the
|
|
14
|
+
* shared banner asks {@link isSessionExpiredError} and renders the
|
|
15
|
+
* plain-language copy + a "Sign in again" action instead.
|
|
16
|
+
*/
|
|
17
|
+
/** Editor-facing copy: plain language, no auth/transport jargon. */
|
|
18
|
+
export const SESSION_EXPIRED_MESSAGE = "You've been signed out, so your latest changes aren't being saved. Sign in again to keep editing — you'll come back to this screen.";
|
|
19
|
+
export const SIGN_IN_AGAIN_LABEL = 'Sign in again';
|
|
20
|
+
/**
|
|
21
|
+
* Extract the `code` of a JSON object embedded in a transport error message.
|
|
22
|
+
* Convex auth failures carry `{"code":"Unauthenticated", …}`, sometimes
|
|
23
|
+
* wrapped in client prefixes (`[CONVEX M(graph:save)] … Server Error: {…}`).
|
|
24
|
+
*/
|
|
25
|
+
function embeddedJsonCode(message) {
|
|
26
|
+
const start = message.indexOf('{');
|
|
27
|
+
const end = message.lastIndexOf('}');
|
|
28
|
+
if (start === -1 || end <= start)
|
|
29
|
+
return undefined;
|
|
30
|
+
try {
|
|
31
|
+
const parsed = JSON.parse(message.slice(start, end + 1));
|
|
32
|
+
if (parsed !== null && typeof parsed === 'object') {
|
|
33
|
+
const code = parsed.code;
|
|
34
|
+
if (typeof code === 'string')
|
|
35
|
+
return code;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
// Not a JSON payload — fall through to the marker checks.
|
|
40
|
+
}
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Does this operation failure mean "the session is no longer valid"?
|
|
45
|
+
*
|
|
46
|
+
* Only the transport-shaped codes can carry the backend auth blob: structured
|
|
47
|
+
* studio-level failures (`validation`, `unauthorized` from the role hook,
|
|
48
|
+
* `not-found`, `conflict`) are never session expiry. Within those, detect the
|
|
49
|
+
* Convex unauthenticated shape: an embedded `{"code":"Unauthenticated"}`
|
|
50
|
+
* payload, the bare `Unauthenticated` server-error marker, or the OIDC claim
|
|
51
|
+
* message it ships with.
|
|
52
|
+
*/
|
|
53
|
+
export function isSessionExpiredError(error) {
|
|
54
|
+
if (error.code !== 'unknown' && error.code !== 'backend-unavailable')
|
|
55
|
+
return false;
|
|
56
|
+
if (embeddedJsonCode(error.message) === 'Unauthenticated')
|
|
57
|
+
return true;
|
|
58
|
+
if (/\bUnauthenticated\b/.test(error.message))
|
|
59
|
+
return true;
|
|
60
|
+
return /could not verify oidc token/i.test(error.message);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Where the "Sign in again" action navigates: the sign-in screen, carrying the
|
|
64
|
+
* current location so a successful sign-in returns the editor to the exact
|
|
65
|
+
* screen they were on (the sign-in route's `redirect` search param, EC-150).
|
|
66
|
+
* External/protocol-relative targets are rejected, mirroring
|
|
67
|
+
* `postSignInTarget`.
|
|
68
|
+
*/
|
|
69
|
+
export function signInHref(location) {
|
|
70
|
+
const target = `${location.pathname}${location.search ?? ''}`;
|
|
71
|
+
const redirect = target.startsWith('/') && !target.startsWith('//') ? target : '/';
|
|
72
|
+
return `/sign-in?redirect=${encodeURIComponent(redirect)}`;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=auth-errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-errors.js","sourceRoot":"","sources":["../../src/lib/auth-errors.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AAEH,oEAAoE;AACpE,MAAM,CAAC,MAAM,uBAAuB,GAClC,qIAAqI,CAAA;AAEvI,MAAM,CAAC,MAAM,mBAAmB,GAAG,eAAe,CAAA;AAElD;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,OAAe;IACvC,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IAClC,MAAM,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;IACpC,IAAI,KAAK,KAAK,CAAC,CAAC,IAAI,GAAG,IAAI,KAAK;QAAE,OAAO,SAAS,CAAA;IAClD,IAAI,CAAC;QACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAA;QACjE,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAClD,MAAM,IAAI,GAAI,MAA6B,CAAC,IAAI,CAAA;YAChD,IAAI,OAAO,IAAI,KAAK,QAAQ;gBAAE,OAAO,IAAI,CAAA;QAC3C,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,0DAA0D;IAC5D,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAqB;IACzD,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,qBAAqB;QAAE,OAAO,KAAK,CAAA;IAClF,IAAI,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,iBAAiB;QAAE,OAAO,IAAI,CAAA;IACtE,IAAI,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAA;IAC1D,OAAO,8BAA8B,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;AAC3D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,QAA+C;IACxE,MAAM,MAAM,GAAG,GAAG,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,EAAE,EAAE,CAAA;IAC7D,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAA;IAClF,OAAO,qBAAqB,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAA;AAC5D,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CmsSource } from '@elytracms/data-binding';
|
|
2
|
+
import type { ListDocumentsQuery } from '@elytracms/content';
|
|
3
|
+
/**
|
|
4
|
+
* Stored repeating-section / template-page query config (EC-166), reduced to
|
|
5
|
+
* what survives the EC-190 v1 realignment.
|
|
6
|
+
*
|
|
7
|
+
* The editor surfaces that AUTHORED these queries — the repeating-section and
|
|
8
|
+
* template-page binding panels — are gone (the v1 canvas edits static props
|
|
9
|
+
* only). What remains is the read-only side the canvas preview and the
|
|
10
|
+
* locale-fallback marker still need: replaying a STORED query config as the
|
|
11
|
+
* exact delivery `listDocuments` query, so a parked section/template source
|
|
12
|
+
* previews through the same `@elytracms/content` resolution delivery runs. The
|
|
13
|
+
* query-building, picker-vocabulary, and plain-language description helpers were
|
|
14
|
+
* removed with the panels.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* The CMS source config of a section/template source — exactly the canonical
|
|
18
|
+
* `@elytracms/data-binding` cms config: the AD-3 `where` shape is valid JSON and
|
|
19
|
+
* stores verbatim in `filter`; `sort` and `limit` are first-class
|
|
20
|
+
* `cmsConfigSchema` fields, so the full query round-trips Zod validation.
|
|
21
|
+
*/
|
|
22
|
+
export type QueryCmsConfig = CmsSource['config'];
|
|
23
|
+
/** The `listDocuments` query a stored source config replays (delivery parity). */
|
|
24
|
+
export declare function listQueryOfConfig(config: QueryCmsConfig): ListDocumentsQuery;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** The `listDocuments` query a stored source config replays (delivery parity). */
|
|
2
|
+
export function listQueryOfConfig(config) {
|
|
3
|
+
return {
|
|
4
|
+
...(Object.keys(config.filter).length > 0 ? { where: config.filter } : {}),
|
|
5
|
+
...(config.sort !== undefined ? { sort: config.sort } : {}),
|
|
6
|
+
...(config.limit !== undefined ? { limit: config.limit } : {}),
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=section-bindings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section-bindings.js","sourceRoot":"","sources":["../../../src/lib/bindings/section-bindings.ts"],"names":[],"mappings":"AAyBA,kFAAkF;AAClF,MAAM,UAAU,iBAAiB,CAAC,MAAsB;IACtD,OAAO;QACL,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAoB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACxF,GAAG,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,GAAG,CAAC,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC/D,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Studio clipboard helpers (EC-175): paste-target resolution, permissive-paste
|
|
3
|
+
* diffing, and the OS-clipboard transport over the EC-174 fragment format.
|
|
4
|
+
*/
|
|
5
|
+
export * from './paste-target';
|
|
6
|
+
export * from './paste-issues';
|
|
7
|
+
export * from './os-clipboard';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Studio clipboard helpers (EC-175): paste-target resolution, permissive-paste
|
|
3
|
+
* diffing, and the OS-clipboard transport over the EC-174 fragment format.
|
|
4
|
+
*/
|
|
5
|
+
export * from './paste-target';
|
|
6
|
+
export * from './paste-issues';
|
|
7
|
+
export * from './os-clipboard';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/clipboard/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ClipboardFragment, ParseFragmentResult } from '@elytracms/clipboard';
|
|
2
|
+
/**
|
|
3
|
+
* OS-clipboard transport (EC-175). The studio NEVER keeps an app-internal
|
|
4
|
+
* copy buffer: every copy writes the EC-174 fragment representations to the
|
|
5
|
+
* operating-system clipboard, and every paste reads them back — which is what
|
|
6
|
+
* makes copy/paste work across documents, pages, projects, and browser tabs
|
|
7
|
+
* for free.
|
|
8
|
+
*
|
|
9
|
+
* Two transports, by trigger:
|
|
10
|
+
* - **ClipboardEvent / DataTransfer** (synchronous, no permissions): native
|
|
11
|
+
* copy/cut/paste events expose `clipboardData` and accept arbitrary types,
|
|
12
|
+
* so the canonical JSON travels as `application/json` alongside
|
|
13
|
+
* `text/plain` + `text/html`.
|
|
14
|
+
* - **navigator.clipboard** (async, used by explicit button affordances):
|
|
15
|
+
* `write()` with a `ClipboardItem` carrying `text/html` + `text/plain`
|
|
16
|
+
* (the JSON rides in `text/plain` and embedded in the HTML), falling back
|
|
17
|
+
* to `writeText(json)` where `write`/`ClipboardItem` are unavailable.
|
|
18
|
+
*/
|
|
19
|
+
/** The DataTransfer type carrying the canonical fragment JSON. */
|
|
20
|
+
export declare const DATA_TRANSFER_JSON_TYPE = "application/json";
|
|
21
|
+
interface DataTransferWriter {
|
|
22
|
+
setData(type: string, data: string): void;
|
|
23
|
+
}
|
|
24
|
+
interface DataTransferReader {
|
|
25
|
+
getData(type: string): string;
|
|
26
|
+
}
|
|
27
|
+
/** Write all three EC-174 representations onto a clipboard event's DataTransfer. */
|
|
28
|
+
export declare function writeFragmentToDataTransfer(dt: DataTransferWriter, fragment: ClipboardFragment): void;
|
|
29
|
+
/** Read a fragment from a paste event's DataTransfer, in fidelity order. */
|
|
30
|
+
export declare function readFragmentFromDataTransfer(dt: DataTransferReader): ParseFragmentResult;
|
|
31
|
+
/** The async-clipboard surface we use (subset of `Navigator['clipboard']`). */
|
|
32
|
+
export interface AsyncClipboard {
|
|
33
|
+
write?(items: ClipboardItem[]): Promise<void>;
|
|
34
|
+
writeText?(text: string): Promise<void>;
|
|
35
|
+
read?(): Promise<ClipboardItems>;
|
|
36
|
+
readText?(): Promise<string>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Write a fragment via the async Clipboard API. Tries the multi-representation
|
|
40
|
+
* `ClipboardItem` first; falls back to `writeText` with the canonical JSON
|
|
41
|
+
* (which `parseFragmentFromClipboard` restores from `text/plain`).
|
|
42
|
+
*/
|
|
43
|
+
export declare function writeFragmentToClipboard(clipboard: AsyncClipboard | undefined, fragment: ClipboardFragment): Promise<void>;
|
|
44
|
+
/** Read a fragment via the async Clipboard API (`read`, falling back to `readText`). */
|
|
45
|
+
export declare function readFragmentFromClipboard(clipboard: AsyncClipboard | undefined): Promise<ParseFragmentResult>;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { parseFragmentFromClipboard, toClipboardRepresentations, } from '@elytracms/clipboard';
|
|
2
|
+
/**
|
|
3
|
+
* OS-clipboard transport (EC-175). The studio NEVER keeps an app-internal
|
|
4
|
+
* copy buffer: every copy writes the EC-174 fragment representations to the
|
|
5
|
+
* operating-system clipboard, and every paste reads them back — which is what
|
|
6
|
+
* makes copy/paste work across documents, pages, projects, and browser tabs
|
|
7
|
+
* for free.
|
|
8
|
+
*
|
|
9
|
+
* Two transports, by trigger:
|
|
10
|
+
* - **ClipboardEvent / DataTransfer** (synchronous, no permissions): native
|
|
11
|
+
* copy/cut/paste events expose `clipboardData` and accept arbitrary types,
|
|
12
|
+
* so the canonical JSON travels as `application/json` alongside
|
|
13
|
+
* `text/plain` + `text/html`.
|
|
14
|
+
* - **navigator.clipboard** (async, used by explicit button affordances):
|
|
15
|
+
* `write()` with a `ClipboardItem` carrying `text/html` + `text/plain`
|
|
16
|
+
* (the JSON rides in `text/plain` and embedded in the HTML), falling back
|
|
17
|
+
* to `writeText(json)` where `write`/`ClipboardItem` are unavailable.
|
|
18
|
+
*/
|
|
19
|
+
/** The DataTransfer type carrying the canonical fragment JSON. */
|
|
20
|
+
export const DATA_TRANSFER_JSON_TYPE = 'application/json';
|
|
21
|
+
/** Write all three EC-174 representations onto a clipboard event's DataTransfer. */
|
|
22
|
+
export function writeFragmentToDataTransfer(dt, fragment) {
|
|
23
|
+
const reps = toClipboardRepresentations(fragment);
|
|
24
|
+
dt.setData('text/plain', reps.text);
|
|
25
|
+
dt.setData('text/html', reps.html);
|
|
26
|
+
dt.setData(DATA_TRANSFER_JSON_TYPE, reps.json);
|
|
27
|
+
}
|
|
28
|
+
/** Read a fragment from a paste event's DataTransfer, in fidelity order. */
|
|
29
|
+
export function readFragmentFromDataTransfer(dt) {
|
|
30
|
+
const json = dt.getData(DATA_TRANSFER_JSON_TYPE);
|
|
31
|
+
const html = dt.getData('text/html');
|
|
32
|
+
const text = dt.getData('text/plain');
|
|
33
|
+
return parseFragmentFromClipboard({
|
|
34
|
+
json: json || undefined,
|
|
35
|
+
html: html || undefined,
|
|
36
|
+
text: text || undefined,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Write a fragment via the async Clipboard API. Tries the multi-representation
|
|
41
|
+
* `ClipboardItem` first; falls back to `writeText` with the canonical JSON
|
|
42
|
+
* (which `parseFragmentFromClipboard` restores from `text/plain`).
|
|
43
|
+
*/
|
|
44
|
+
export async function writeFragmentToClipboard(clipboard, fragment) {
|
|
45
|
+
if (!clipboard)
|
|
46
|
+
throw new Error('Clipboard API is unavailable.');
|
|
47
|
+
const reps = toClipboardRepresentations(fragment);
|
|
48
|
+
const ClipboardItemCtor = globalThis.ClipboardItem;
|
|
49
|
+
if (clipboard.write && ClipboardItemCtor) {
|
|
50
|
+
try {
|
|
51
|
+
await clipboard.write([
|
|
52
|
+
new ClipboardItemCtor({
|
|
53
|
+
'text/plain': new Blob([reps.text], { type: 'text/plain' }),
|
|
54
|
+
'text/html': new Blob([reps.html], { type: 'text/html' }),
|
|
55
|
+
}),
|
|
56
|
+
]);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
// fall through to writeText
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (!clipboard.writeText)
|
|
64
|
+
throw new Error('Clipboard API is unavailable.');
|
|
65
|
+
await clipboard.writeText(reps.json);
|
|
66
|
+
}
|
|
67
|
+
/** Read a fragment via the async Clipboard API (`read`, falling back to `readText`). */
|
|
68
|
+
export async function readFragmentFromClipboard(clipboard) {
|
|
69
|
+
if (clipboard?.read) {
|
|
70
|
+
try {
|
|
71
|
+
const items = await clipboard.read();
|
|
72
|
+
let html;
|
|
73
|
+
let text;
|
|
74
|
+
for (const item of items) {
|
|
75
|
+
if (item.types.includes('text/html'))
|
|
76
|
+
html = await (await item.getType('text/html')).text();
|
|
77
|
+
if (item.types.includes('text/plain'))
|
|
78
|
+
text = await (await item.getType('text/plain')).text();
|
|
79
|
+
}
|
|
80
|
+
if (html !== undefined || text !== undefined) {
|
|
81
|
+
return parseFragmentFromClipboard({ html, text });
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
// fall through to readText
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (clipboard?.readText) {
|
|
89
|
+
try {
|
|
90
|
+
const text = await clipboard.readText();
|
|
91
|
+
return parseFragmentFromClipboard({ text });
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
// fall through to the structured error below
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
ok: false,
|
|
99
|
+
error: {
|
|
100
|
+
code: 'foreign-format',
|
|
101
|
+
message: 'The clipboard could not be read (no permission or unsupported browser).',
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=os-clipboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"os-clipboard.js","sourceRoot":"","sources":["../../../src/lib/clipboard/os-clipboard.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,sBAAsB,CAAA;AAG7B;;;;;;;;;;;;;;;;GAg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B,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;YACnD,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,2BAA2B;QAC7B,CAAC;IACH,CAAC;IACD,IAAI,SAAS,EAAE,QAAQ,EAAE,CAAC;QACxB,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,QAAQ,EAAE,CAAA;YACvC,OAAO,0BAA0B,CAAC,EAAE,IAAI,EAAE,CAAC,CAAA;QAC7C,CAAC;QAAC,MAAM,CAAC;YACP,6CAA6C;QAC/C,CAAC;IACH,CAAC;IACD,OAAO;QACL,EAAE,EAAE,KAAK;QACT,KAAK,EAAE;YACL,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE,yEAAyE;SACnF;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ComponentNode } from '@elytracms/project-graph';
|
|
2
|
+
/**
|
|
3
|
+
* Permissive-paste validation (EC-175): pasting NEVER refuses a structurally
|
|
4
|
+
* valid fragment. Instead, the inserted subtree is diffed against the TARGET
|
|
5
|
+
* project's registry and data sources at paste time (cross-project semantics:
|
|
6
|
+
* the fragment's source project is irrelevant — what matters is what *this*
|
|
7
|
+
* project can resolve), and every mismatch becomes a visible, node-addressed
|
|
8
|
+
* issue the notice deep-links. The renderer's existing fallbacks keep the
|
|
9
|
+
* pasted nodes visible meanwhile.
|
|
10
|
+
*/
|
|
11
|
+
export interface PasteIssue {
|
|
12
|
+
kind: 'missing-component' | 'unresolved-binding';
|
|
13
|
+
message: string;
|
|
14
|
+
/** The inserted node carrying the problem — deep-link target. */
|
|
15
|
+
nodeId: string;
|
|
16
|
+
}
|
|
17
|
+
export interface PasteDiff {
|
|
18
|
+
/** Distinct component ids absent from the target registry. */
|
|
19
|
+
missingComponents: string[];
|
|
20
|
+
/** Distinct binding source ids the target cannot resolve. */
|
|
21
|
+
unresolvedBindings: string[];
|
|
22
|
+
issues: PasteIssue[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Diff an inserted subtree (with its final, session-assigned node ids)
|
|
26
|
+
* against the target project's registry + known data sources.
|
|
27
|
+
*/
|
|
28
|
+
export declare function diffPastedSubtree(args: {
|
|
29
|
+
node: ComponentNode;
|
|
30
|
+
hasComponent: (componentId: string) => boolean;
|
|
31
|
+
knownSourceIds: ReadonlySet<string>;
|
|
32
|
+
}): PasteDiff;
|
|
33
|
+
/** “Pasted — 2 bindings unresolved, 1 component missing”, or just “Pasted”. */
|
|
34
|
+
export declare function pasteSummaryMessage(diff: PasteDiff): string;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
function walk(node, visit) {
|
|
2
|
+
visit(node);
|
|
3
|
+
for (const children of Object.values(node.slots ?? {})) {
|
|
4
|
+
for (const child of children)
|
|
5
|
+
walk(child, visit);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Diff an inserted subtree (with its final, session-assigned node ids)
|
|
10
|
+
* against the target project's registry + known data sources.
|
|
11
|
+
*/
|
|
12
|
+
export function diffPastedSubtree(args) {
|
|
13
|
+
const missingComponents = new Map(); // componentId -> first nodeId
|
|
14
|
+
const unresolvedBindings = new Map(); // nodeId+sourceId -> issue
|
|
15
|
+
const unresolvedSourceIds = new Set();
|
|
16
|
+
walk(args.node, (node) => {
|
|
17
|
+
if (!args.hasComponent(node.componentId) && !missingComponents.has(node.componentId)) {
|
|
18
|
+
missingComponents.set(node.componentId, node.id);
|
|
19
|
+
}
|
|
20
|
+
const bindings = [];
|
|
21
|
+
for (const value of Object.values(node.props ?? {})) {
|
|
22
|
+
if (value.kind === 'binding')
|
|
23
|
+
bindings.push(value.binding);
|
|
24
|
+
}
|
|
25
|
+
if (node.condition)
|
|
26
|
+
bindings.push(node.condition.source);
|
|
27
|
+
for (const binding of bindings) {
|
|
28
|
+
if (args.knownSourceIds.has(binding.sourceId))
|
|
29
|
+
continue;
|
|
30
|
+
unresolvedSourceIds.add(binding.sourceId);
|
|
31
|
+
const key = `${node.id} ${binding.sourceId}`;
|
|
32
|
+
if (!unresolvedBindings.has(key)) {
|
|
33
|
+
unresolvedBindings.set(key, {
|
|
34
|
+
kind: 'unresolved-binding',
|
|
35
|
+
message: `Binding source "${binding.sourceId}" is not available in this project.`,
|
|
36
|
+
nodeId: node.id,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
const issues = [
|
|
42
|
+
...[...unresolvedBindings.values()],
|
|
43
|
+
...[...missingComponents.entries()].map(([componentId, nodeId]) => ({
|
|
44
|
+
kind: 'missing-component',
|
|
45
|
+
message: `Component "${componentId}" is not registered in this project.`,
|
|
46
|
+
nodeId,
|
|
47
|
+
})),
|
|
48
|
+
];
|
|
49
|
+
return {
|
|
50
|
+
missingComponents: [...missingComponents.keys()],
|
|
51
|
+
unresolvedBindings: [...unresolvedSourceIds],
|
|
52
|
+
issues,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/** “Pasted — 2 bindings unresolved, 1 component missing”, or just “Pasted”. */
|
|
56
|
+
export function pasteSummaryMessage(diff) {
|
|
57
|
+
const parts = [];
|
|
58
|
+
const bindings = diff.issues.filter((i) => i.kind === 'unresolved-binding').length;
|
|
59
|
+
if (bindings > 0)
|
|
60
|
+
parts.push(`${bindings} binding${bindings === 1 ? '' : 's'} unresolved`);
|
|
61
|
+
if (diff.missingComponents.length > 0) {
|
|
62
|
+
const n = diff.missingComponents.length;
|
|
63
|
+
parts.push(`${n} component${n === 1 ? '' : 's'} missing`);
|
|
64
|
+
}
|
|
65
|
+
return parts.length > 0 ? `Pasted — ${parts.join(', ')}` : 'Pasted';
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=paste-issues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paste-issues.js","sourceRoot":"","sources":["../../../src/lib/clipboard/paste-issues.ts"],"names":[],"mappings":"AA2BA,S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,CAAC,CAAC,MAAM,CAAA;IAClF,IAAI,QAAQ,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,QAAQ,WAAW,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAA;IAC1F,IAAI,IAAI,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtC,MAAM,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAA;QACvC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAA;IAC3D,CAAC;IACD,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAA;AACrE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ComponentNode, InsertTarget } from '@elytracms/project-graph';
|
|
2
|
+
import type { ComponentManifest } from '@elytracms/component-registry';
|
|
3
|
+
/**
|
|
4
|
+
* Paste landing-spot resolution (EC-175) — the same placement rule the Insert
|
|
5
|
+
* dialog uses (`insert-context.ts`): a pasted subtree lands *into*
|
|
6
|
+
* the anchor node's child slot when it has one, else *after* the anchor as a
|
|
7
|
+
* sibling, else appended to the page root. Pure and selection-driven so the
|
|
8
|
+
* canvas, the page tree, and keyboard paste all share one rule.
|
|
9
|
+
*/
|
|
10
|
+
export interface PasteTarget {
|
|
11
|
+
target: InsertTarget;
|
|
12
|
+
/** Human label of where the paste lands (notices/debugging). */
|
|
13
|
+
destinationLabel: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function resolvePasteTarget(args: {
|
|
16
|
+
root: ComponentNode;
|
|
17
|
+
/** The anchor node (usually the selection); `null` falls back to the root. */
|
|
18
|
+
anchorId: string | null;
|
|
19
|
+
getManifest: (componentId: string) => ComponentManifest | undefined;
|
|
20
|
+
}): PasteTarget;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { getNode, getParentInfo } from '@elytracms/project-graph';
|
|
2
|
+
function shortId(componentId) {
|
|
3
|
+
return componentId.replace('base.primitives.', '').replace('project.', '');
|
|
4
|
+
}
|
|
5
|
+
export function resolvePasteTarget(args) {
|
|
6
|
+
const { root, getManifest } = args;
|
|
7
|
+
const anchor = args.anchorId !== null ? getNode(root, args.anchorId) : undefined;
|
|
8
|
+
const node = anchor ?? root;
|
|
9
|
+
const manifest = getManifest(node.componentId);
|
|
10
|
+
const childSlot = manifest?.slots.find((s) => s.name === 'children') ??
|
|
11
|
+
manifest?.slots.find((s) => s.name !== 'outlet');
|
|
12
|
+
if (childSlot) {
|
|
13
|
+
return {
|
|
14
|
+
target: { parentId: node.id, slot: childSlot.name },
|
|
15
|
+
destinationLabel: `${shortId(node.componentId)} · ${childSlot.name}`,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
const info = getParentInfo(root, node.id);
|
|
19
|
+
if (info) {
|
|
20
|
+
return {
|
|
21
|
+
target: { parentId: info.parent.id, slot: info.slot, index: info.index + 1 },
|
|
22
|
+
destinationLabel: `${shortId(info.parent.componentId)} · ${info.slot}`,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
// Leaf root with no declared slots (degenerate graphs): append to `children`.
|
|
26
|
+
return { target: { parentId: root.id, slot: 'children' }, destinationLabel: 'root' };
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=paste-target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paste-target.js","sourceRoot":"","sources":["../../../src/lib/clipboard/paste-target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAkBjE,SAAS,OAAO,CAAC,WAAmB;IAClC,OAAO,WAAW,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CAAC,EAAE;YAC5E,gBAAgB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE;SACvE,CAAA;IACH,CAAC;IAED,8EAA8E;IAC9E,OAAO,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,gBAAgB,EAAE,MAAM,EAAE,CAAA;AACtF,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { CmsDocument } from '@elytracms/cms-core';
|
|
2
|
+
import type { OperationsClient } from '../operations';
|
|
3
|
+
/**
|
|
4
|
+
* The PUBLISHED-perspective documents of a collection (EC-205, "live = published")
|
|
5
|
+
* — the pinned published snapshot of each currently-published document, keyed by
|
|
6
|
+
* id. Live surfaces (a document's live URL + "View live", EC-216) MUST derive
|
|
7
|
+
* from this, never from the draft rows the studio edits: an unpublished document,
|
|
8
|
+
* or an unpublished `slug`/`parent` edit, must never leak into a "live" URL. The
|
|
9
|
+
* pool is exactly the set the live site would serve, so composing a nested page's
|
|
10
|
+
* URL from these ancestors yields the URL the live site actually resolves.
|
|
11
|
+
*
|
|
12
|
+
* Loaded lazily; reloaded only when a publish/unpublish/restore/delete command
|
|
13
|
+
* succeeds (NOT on every autosave upsert — a draft edit doesn't change what's
|
|
14
|
+
* published). Cost: one `listVersions` per published document (there is no bulk
|
|
15
|
+
* published-content query yet) — fine for v1 collections; a bulk
|
|
16
|
+
* `documents.listPublished` is the perf follow-up for large collections.
|
|
17
|
+
*/
|
|
18
|
+
export interface PublishedDocuments {
|
|
19
|
+
/** Pinned published snapshot per published document id. Empty while loading. */
|
|
20
|
+
byId: ReadonlyMap<string, CmsDocument>;
|
|
21
|
+
status: 'loading' | 'ready';
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Build the published pool of a collection (pure over the operations client): the
|
|
25
|
+
* pinned published snapshot of every currently-published document, keyed by id.
|
|
26
|
+
* The `publishedVersion` pointer comes from the document record; its snapshot
|
|
27
|
+
* from the recorded versions. Read failures degrade to an empty pool.
|
|
28
|
+
*/
|
|
29
|
+
export declare function loadPublishedDocuments(operations: OperationsClient, projectId: string, collectionId: string): Promise<Map<string, CmsDocument>>;
|
|
30
|
+
export declare function usePublishedDocuments(projectId: string | undefined, collectionId: string): PublishedDocuments;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { getStudioOperations } from '../operations';
|
|
3
|
+
/** Commands that change which version is pinned live (and thus the pool). */
|
|
4
|
+
const RELOAD_OPS = new Set([
|
|
5
|
+
'documents.publish',
|
|
6
|
+
'documents.unpublish',
|
|
7
|
+
'documents.restore',
|
|
8
|
+
'documents.delete',
|
|
9
|
+
]);
|
|
10
|
+
/**
|
|
11
|
+
* Build the published pool of a collection (pure over the operations client): the
|
|
12
|
+
* pinned published snapshot of every currently-published document, keyed by id.
|
|
13
|
+
* The `publishedVersion` pointer comes from the document record; its snapshot
|
|
14
|
+
* from the recorded versions. Read failures degrade to an empty pool.
|
|
15
|
+
*/
|
|
16
|
+
export async function loadPublishedDocuments(operations, projectId, collectionId) {
|
|
17
|
+
const listed = await operations.documents.list({ projectId, collection: collectionId });
|
|
18
|
+
if (!listed.ok)
|
|
19
|
+
return new Map();
|
|
20
|
+
const published = listed.value.filter((record) => record.publishedVersion !== undefined);
|
|
21
|
+
const snapshots = await Promise.all(published.map(async (record) => {
|
|
22
|
+
const ref = { collection: record.document.collection, id: record.document.id };
|
|
23
|
+
const versions = await operations.documents.listVersions({ projectId, ref });
|
|
24
|
+
if (!versions.ok)
|
|
25
|
+
return null;
|
|
26
|
+
return versions.value.find((v) => v.version === record.publishedVersion)?.snapshot ?? null;
|
|
27
|
+
}));
|
|
28
|
+
const byId = new Map();
|
|
29
|
+
for (const snapshot of snapshots)
|
|
30
|
+
if (snapshot)
|
|
31
|
+
byId.set(snapshot.id, snapshot);
|
|
32
|
+
return byId;
|
|
33
|
+
}
|
|
34
|
+
export function usePublishedDocuments(projectId, collectionId) {
|
|
35
|
+
const [state, setState] = useState({ byId: new Map(), status: 'loading' });
|
|
36
|
+
const epochRef = useRef(0);
|
|
37
|
+
const load = useCallback(async () => {
|
|
38
|
+
const epoch = ++epochRef.current;
|
|
39
|
+
const settle = (byId) => {
|
|
40
|
+
if (epochRef.current === epoch)
|
|
41
|
+
setState({ byId, status: 'ready' });
|
|
42
|
+
};
|
|
43
|
+
// Playground/fixture mode (no backend): nothing is published via versions.
|
|
44
|
+
if (projectId === undefined) {
|
|
45
|
+
settle(new Map());
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const { operations } = await getStudioOperations();
|
|
49
|
+
settle(await loadPublishedDocuments(operations, projectId, collectionId));
|
|
50
|
+
}, [projectId, collectionId]);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
setState((prev) => ({ byId: prev.byId, status: 'loading' }));
|
|
53
|
+
void load();
|
|
54
|
+
let disposed = false;
|
|
55
|
+
let unsubscribe;
|
|
56
|
+
void getStudioOperations().then((studio) => {
|
|
57
|
+
if (disposed)
|
|
58
|
+
return;
|
|
59
|
+
unsubscribe = studio.operations.events.subscribe((event) => {
|
|
60
|
+
if (event.kind !== 'command' || event.status !== 'succeeded')
|
|
61
|
+
return;
|
|
62
|
+
if (!RELOAD_OPS.has(event.operation))
|
|
63
|
+
return;
|
|
64
|
+
void load();
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
return () => {
|
|
68
|
+
disposed = true;
|
|
69
|
+
epochRef.current += 1;
|
|
70
|
+
unsubscribe?.();
|
|
71
|
+
};
|
|
72
|
+
}, [load]);
|
|
73
|
+
return state;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=published-documents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"published-documents.js","sourceRoot":"","sources":["../../../src/lib/cms/published-documents.ts"],"names":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,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,CAAA;QAC5D,KAAK,IAAI,EAAE,CAAA;QACX,IAAI,QAAQ,GAAG,KAAK,CAAA;QACpB,IAAI,WAAqC,CAAA;QACzC,KAAK,mBAAmB,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YACzC,IAAI,QAAQ;gBAAE,OAAM;YACpB,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;gBACzD,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,WAAW;oBAAE,OAAM;gBACpE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC;oBAAE,OAAM;gBAC5C,KAAK,IAAI,EAAE,CAAA;YACb,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QACF,OAAO,GAAG,EAAE;YACV,QAAQ,GAAG,IAAI,CAAA;YACf,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;YACrB,WAAW,EAAE,EAAE,CAAA;QACjB,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;IAEV,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Saved views & table-view model for the CMS collection table (EC-169):
|
|
3
|
+
* the pure filter/sort/column model (`view-model`), row selection
|
|
4
|
+
* (`selection`), and project-scoped persistence through `@elytracms/operations`
|
|
5
|
+
* (`views-store`).
|
|
6
|
+
*/
|
|
7
|
+
export * from './view-model';
|
|
8
|
+
export * from './selection';
|
|
9
|
+
export * from './views-store';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Saved views & table-view model for the CMS collection table (EC-169):
|
|
3
|
+
* the pure filter/sort/column model (`view-model`), row selection
|
|
4
|
+
* (`selection`), and project-scoped persistence through `@elytracms/operations`
|
|
5
|
+
* (`views-store`).
|
|
6
|
+
*/
|
|
7
|
+
export * from './view-model';
|
|
8
|
+
export * from './selection';
|
|
9
|
+
export * from './views-store';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/cms-views/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Row-selection model for the collection table (EC-169). Pure data +
|
|
3
|
+
* functions: plain click toggles one row (and moves the range anchor),
|
|
4
|
+
* shift-click selects the whole anchor→row range, the header checkbox selects
|
|
5
|
+
* everything in the current view. The table prunes against the *visible*
|
|
6
|
+
* (filtered) row order at read time, so a selection never silently includes
|
|
7
|
+
* rows the active view filtered out.
|
|
8
|
+
*/
|
|
9
|
+
export interface SelectionState {
|
|
10
|
+
/** Selected document ids, in click order (pruned/re-ordered at read time). */
|
|
11
|
+
ids: readonly string[];
|
|
12
|
+
/** The last plainly-clicked row — the start of a shift-range. */
|
|
13
|
+
anchorId: string | null;
|
|
14
|
+
}
|
|
15
|
+
export declare const EMPTY_SELECTION: SelectionState;
|
|
16
|
+
/**
|
|
17
|
+
* Apply one row-checkbox click. `shiftRange` (shift held, with a valid anchor)
|
|
18
|
+
* selects every row between the anchor and the clicked row inclusive; a plain
|
|
19
|
+
* click toggles the row and re-anchors on it.
|
|
20
|
+
*/
|
|
21
|
+
export declare function toggleRow(state: SelectionState, orderedIds: readonly string[], id: string, shiftRange: boolean): SelectionState;
|
|
22
|
+
/** Select every row in the current view (header checkbox). */
|
|
23
|
+
export declare function selectAll(orderedIds: readonly string[]): SelectionState;
|
|
24
|
+
export declare function clearSelection(): SelectionState;
|
|
25
|
+
/**
|
|
26
|
+
* The selection that is actually in the current view, in view order — what
|
|
27
|
+
* the count, the header checkbox, and every bulk action operate on.
|
|
28
|
+
*/
|
|
29
|
+
export declare function visibleSelection(state: SelectionState, visibleIds: readonly string[]): string[];
|