@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,64 @@
|
|
|
1
|
+
import type { CollectionDef, DocumentRef, RelationFieldDef } from '@elytracms/cms-core';
|
|
2
|
+
import type { ReferenceEntryView } from './reference-model';
|
|
3
|
+
/**
|
|
4
|
+
* Pure impact model for the EC-173 safe-unpublish/delete flows: given the
|
|
5
|
+
* inbound reference entries of one or more target documents (the EC-172 panel
|
|
6
|
+
* views), compute what *breaks* when the action proceeds and what *blocks* it
|
|
7
|
+
* outright (strict relation fields). No data fetching, no React — fully
|
|
8
|
+
* deterministic and node-testable, like `reference-model.ts`.
|
|
9
|
+
*
|
|
10
|
+
* Semantics (weak by default, vision 3.6):
|
|
11
|
+
* - **unpublish** breaks only the *published* variant of an entry — a
|
|
12
|
+
* draft-only reference never serves the published site, so it neither
|
|
13
|
+
* counts nor blocks.
|
|
14
|
+
* - **delete** breaks both variants — the stored value dangles either way.
|
|
15
|
+
* - An entry **blocks** when its holding field is a relation declared
|
|
16
|
+
* `strict: true` in the schema (and, for unpublish, it is published).
|
|
17
|
+
* - Entries whose *source* is itself among the acted-on documents are
|
|
18
|
+
* excluded: a reference between two documents deleted/unpublished together
|
|
19
|
+
* does not survive the action, so it cannot break.
|
|
20
|
+
*/
|
|
21
|
+
export type ReferenceAction = 'unpublish' | 'delete';
|
|
22
|
+
/** Does this entry break (dangle / fall back) when `action` proceeds? */
|
|
23
|
+
export declare function entryBreaksOnAction(entry: ReferenceEntryView, action: ReferenceAction): boolean;
|
|
24
|
+
/** The relation field holding a document-sourced relation entry, if resolvable. */
|
|
25
|
+
export declare function relationFieldOfEntry(collections: readonly CollectionDef[], entry: ReferenceEntryView): RelationFieldDef | undefined;
|
|
26
|
+
/** Does this entry *block* the action (strict opt-in, EC-173)? */
|
|
27
|
+
export declare function entryBlocksAction(collections: readonly CollectionDef[], entry: ReferenceEntryView, action: ReferenceAction): boolean;
|
|
28
|
+
/** The impact of one action on one target document. */
|
|
29
|
+
export interface DocumentReferenceImpact {
|
|
30
|
+
ref: DocumentRef;
|
|
31
|
+
/** Inbound entries that will break (fallbacks + validation issues). */
|
|
32
|
+
broken: ReferenceEntryView[];
|
|
33
|
+
/** The subset held by strict relation fields — these block the action. */
|
|
34
|
+
blocking: ReferenceEntryView[];
|
|
35
|
+
}
|
|
36
|
+
/** The aggregate impact of one action over a set of target documents. */
|
|
37
|
+
export interface ReferenceImpact {
|
|
38
|
+
action: ReferenceAction;
|
|
39
|
+
documents: DocumentReferenceImpact[];
|
|
40
|
+
/** Sum of `broken` across documents ("M inbound references will break"). */
|
|
41
|
+
totalBroken: number;
|
|
42
|
+
totalBlocking: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Build the impact of `action` over `targets` from their raw inbound entry
|
|
46
|
+
* views (keyed by `documentKey`). Sources that are themselves targets are
|
|
47
|
+
* excluded — they do not survive the action.
|
|
48
|
+
*/
|
|
49
|
+
export declare function buildReferenceImpact(collections: readonly CollectionDef[], action: ReferenceAction, targets: readonly {
|
|
50
|
+
ref: DocumentRef;
|
|
51
|
+
inbound: readonly ReferenceEntryView[];
|
|
52
|
+
}[]): ReferenceImpact;
|
|
53
|
+
/**
|
|
54
|
+
* Impact of deleting an ASSET (EC-202), reusing the document break/block model.
|
|
55
|
+
* A delete dangles EVERY inbound reference (`delete` breaks both variants), and
|
|
56
|
+
* nothing *blocks*: assets are held by `asset` fields / `asset`-typed props,
|
|
57
|
+
* never by `strict: true` relation fields, so the asset path has no block
|
|
58
|
+
* concept — it is always weak-by-default. Returns the same `{ broken, blocking }`
|
|
59
|
+
* shape the shared EC-173 impact rows render.
|
|
60
|
+
*/
|
|
61
|
+
export declare function buildAssetReferenceImpact(inbound: readonly ReferenceEntryView[]): {
|
|
62
|
+
broken: ReferenceEntryView[];
|
|
63
|
+
blocking: ReferenceEntryView[];
|
|
64
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { documentKey } from '@elytracms/cms-core';
|
|
2
|
+
import { parseDocumentFieldPath, parseDocumentKey } from './reference-model';
|
|
3
|
+
/** Does this entry break (dangle / fall back) when `action` proceeds? */
|
|
4
|
+
export function entryBreaksOnAction(entry, action) {
|
|
5
|
+
return action === 'delete' ? entry.draft || entry.published : entry.published;
|
|
6
|
+
}
|
|
7
|
+
/** The relation field holding a document-sourced relation entry, if resolvable. */
|
|
8
|
+
export function relationFieldOfEntry(collections, entry) {
|
|
9
|
+
if (entry.kind !== 'relation-field' || entry.source.type !== 'document')
|
|
10
|
+
return undefined;
|
|
11
|
+
const sourceRef = parseDocumentKey(entry.source.id);
|
|
12
|
+
const parsedPath = parseDocumentFieldPath(entry.path);
|
|
13
|
+
if (!sourceRef || !parsedPath)
|
|
14
|
+
return undefined;
|
|
15
|
+
const collection = collections.find((c) => c.id === sourceRef.collection);
|
|
16
|
+
const field = collection?.fields.find((f) => f.name === parsedPath.field);
|
|
17
|
+
return field?.type === 'relation' ? field : undefined;
|
|
18
|
+
}
|
|
19
|
+
/** Does this entry *block* the action (strict opt-in, EC-173)? */
|
|
20
|
+
export function entryBlocksAction(collections, entry, action) {
|
|
21
|
+
if (!entryBreaksOnAction(entry, action))
|
|
22
|
+
return false;
|
|
23
|
+
return relationFieldOfEntry(collections, entry)?.strict === true;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Build the impact of `action` over `targets` from their raw inbound entry
|
|
27
|
+
* views (keyed by `documentKey`). Sources that are themselves targets are
|
|
28
|
+
* excluded — they do not survive the action.
|
|
29
|
+
*/
|
|
30
|
+
export function buildReferenceImpact(collections, action, targets) {
|
|
31
|
+
const actedKeys = new Set(targets.map((target) => documentKey(target.ref)));
|
|
32
|
+
const documents = targets.map((target) => {
|
|
33
|
+
const surviving = target.inbound.filter((entry) => !(entry.source.type === 'document' && actedKeys.has(entry.source.id)));
|
|
34
|
+
const broken = surviving.filter((entry) => entryBreaksOnAction(entry, action));
|
|
35
|
+
return {
|
|
36
|
+
ref: target.ref,
|
|
37
|
+
broken,
|
|
38
|
+
blocking: broken.filter((entry) => entryBlocksAction(collections, entry, action)),
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
action,
|
|
43
|
+
documents,
|
|
44
|
+
totalBroken: documents.reduce((sum, doc) => sum + doc.broken.length, 0),
|
|
45
|
+
totalBlocking: documents.reduce((sum, doc) => sum + doc.blocking.length, 0),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Impact of deleting an ASSET (EC-202), reusing the document break/block model.
|
|
50
|
+
* A delete dangles EVERY inbound reference (`delete` breaks both variants), and
|
|
51
|
+
* nothing *blocks*: assets are held by `asset` fields / `asset`-typed props,
|
|
52
|
+
* never by `strict: true` relation fields, so the asset path has no block
|
|
53
|
+
* concept — it is always weak-by-default. Returns the same `{ broken, blocking }`
|
|
54
|
+
* shape the shared EC-173 impact rows render.
|
|
55
|
+
*/
|
|
56
|
+
export function buildAssetReferenceImpact(inbound) {
|
|
57
|
+
return {
|
|
58
|
+
broken: inbound.filter((entry) => entryBreaksOnAction(entry, 'delete')),
|
|
59
|
+
blocking: [],
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=impact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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M,CAAC,MAAM,EAAE,CAAC,CAAC;QACvE,aAAa,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;KAC5E,CAAA;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAAsC;IAI9E,OAAO;QACL,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,mBAAmB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACvE,QAAQ,EAAE,EAAE;KACb,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* References & used-by data layer (EC-172): pure presentation model over the
|
|
3
|
+
* EC-155 reference index plus the operations-backed panel store.
|
|
4
|
+
*/
|
|
5
|
+
export * from './reference-model';
|
|
6
|
+
export * from './references-store';
|
|
7
|
+
export * from './impact';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/references/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { CmsDocument, CollectionDef } from '@elytracms/cms-core';
|
|
2
|
+
import type { ComponentNode, ProjectGraph } from '@elytracms/project-graph';
|
|
3
|
+
import type { ReferenceEntryRecord, ReferenceKind, ReferenceSource, ReferenceTarget } from '@elytracms/persistence';
|
|
4
|
+
/**
|
|
5
|
+
* Pure presentation model for the EC-172 references panels.
|
|
6
|
+
*
|
|
7
|
+
* The EC-155 index stores entries as `(source, path, target, kind)` per
|
|
8
|
+
* variant; this module turns those records into renderable rows: variants
|
|
9
|
+
* merged onto one row (draft/published badges), human-readable source/
|
|
10
|
+
* location/target labels, and deep-link descriptors that pinpoint the exact
|
|
11
|
+
* field (CMS) or graph node (builder) a path identifies. No data fetching, no
|
|
12
|
+
* React — everything here is a deterministic function of its inputs, so it is
|
|
13
|
+
* fully testable in the node environment.
|
|
14
|
+
*/
|
|
15
|
+
/** Split a `collection:id` document key (the index's document source/target id). */
|
|
16
|
+
export declare function parseDocumentKey(key: string): {
|
|
17
|
+
collection: string;
|
|
18
|
+
id: string;
|
|
19
|
+
} | null;
|
|
20
|
+
export interface DocumentFieldPath {
|
|
21
|
+
/** Present for `localized/<locale>/<field>` paths. */
|
|
22
|
+
locale?: string;
|
|
23
|
+
field: string;
|
|
24
|
+
/** Tokens below the field value (array indices, rich-text node paths). */
|
|
25
|
+
rest: readonly string[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Parse a document index path (`values/<field>/…` or
|
|
29
|
+
* `localized/<locale>/<field>/…`) onto the owning field.
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseDocumentFieldPath(path: string): DocumentFieldPath | null;
|
|
32
|
+
export interface ResolvedGraphPath {
|
|
33
|
+
/** The deepest node the structural prefix resolves to; `null` when the path no longer matches the graph. */
|
|
34
|
+
node: ComponentNode | null;
|
|
35
|
+
/** Tokens below the node (`componentId`, `props/<name>/binding`, `condition/source`). */
|
|
36
|
+
remainder: readonly string[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Resolve a graph index path (`root`, then repeated `slots/<slot>/<index>`
|
|
40
|
+
* hops, then a structure suffix) to the node it identifies. Walks the
|
|
41
|
+
* slot/index prefix structurally; a prefix that no longer exists (the graph
|
|
42
|
+
* drifted since indexing) resolves to `null`.
|
|
43
|
+
*/
|
|
44
|
+
export declare function resolveGraphNodePath(root: ComponentNode, path: string): ResolvedGraphPath;
|
|
45
|
+
/** One panel row: the same logical entry across both variants, with flags. */
|
|
46
|
+
export interface MergedReferenceEntry {
|
|
47
|
+
/** Stable row key (source + path + target + kind). */
|
|
48
|
+
key: string;
|
|
49
|
+
source: ReferenceSource;
|
|
50
|
+
path: string;
|
|
51
|
+
target: ReferenceTarget;
|
|
52
|
+
kind: ReferenceKind;
|
|
53
|
+
/** Present in the draft variant of the index. */
|
|
54
|
+
draft: boolean;
|
|
55
|
+
/** Present in the published variant (a live reference). */
|
|
56
|
+
published: boolean;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Merge per-variant index records onto one row per logical entry. A
|
|
60
|
+
* draft-only row (`draft && !published`) is the Sanity hidden-draft-reference
|
|
61
|
+
* case the panel must make visible. Order is deterministic:
|
|
62
|
+
* source type → source id → path → target type → target id → kind.
|
|
63
|
+
*/
|
|
64
|
+
export declare function mergeReferenceVariants(records: readonly ReferenceEntryRecord[]): MergedReferenceEntry[];
|
|
65
|
+
/** Human label per reference kind (entry-row badge). */
|
|
66
|
+
export declare const REFERENCE_KIND_LABELS: Record<ReferenceKind, string>;
|
|
67
|
+
/**
|
|
68
|
+
* A deep-link descriptor the panel renders as a router link. `cms-field`
|
|
69
|
+
* carries the full index path so the document editor can highlight the exact
|
|
70
|
+
* field control; `builder-node` carries the resolved node id so the builder
|
|
71
|
+
* can select + scroll to the node.
|
|
72
|
+
*/
|
|
73
|
+
export type ReferenceDeepLink = {
|
|
74
|
+
kind: 'cms-field';
|
|
75
|
+
collectionId: string;
|
|
76
|
+
documentId: string;
|
|
77
|
+
fieldPath?: string;
|
|
78
|
+
} | {
|
|
79
|
+
kind: 'builder-node';
|
|
80
|
+
pageId?: string;
|
|
81
|
+
nodeId?: string;
|
|
82
|
+
} | {
|
|
83
|
+
kind: 'component';
|
|
84
|
+
componentId: string;
|
|
85
|
+
} | {
|
|
86
|
+
kind: 'asset';
|
|
87
|
+
assetId: string;
|
|
88
|
+
};
|
|
89
|
+
/** Everything the model needs to label entries (loaded once per panel). */
|
|
90
|
+
export interface ReferenceLabelContext {
|
|
91
|
+
collections: readonly CollectionDef[];
|
|
92
|
+
/** Live documents keyed by `collection:id`. */
|
|
93
|
+
documents: ReadonlyMap<string, CmsDocument>;
|
|
94
|
+
/** Latest draft graph (page/layout names + node resolution); `null` when absent. */
|
|
95
|
+
graph: ProjectGraph | null;
|
|
96
|
+
/** Asset metadata keyed by asset id. */
|
|
97
|
+
assets: ReadonlyMap<string, {
|
|
98
|
+
filename: string;
|
|
99
|
+
title?: string | undefined;
|
|
100
|
+
}>;
|
|
101
|
+
/** Resolves a component id to its manifest title (live registry lookup). */
|
|
102
|
+
componentTitle: (componentId: string) => string | undefined;
|
|
103
|
+
}
|
|
104
|
+
/** One fully-labelled panel row. */
|
|
105
|
+
export interface ReferenceEntryView extends MergedReferenceEntry {
|
|
106
|
+
kindLabel: string;
|
|
107
|
+
/** The holding entity, e.g. `Post · Hello World` or `Page · Home`. */
|
|
108
|
+
sourceLabel: string;
|
|
109
|
+
/** The exact location inside the source, e.g. `Author` or `Text (n-post-title)`. */
|
|
110
|
+
locationLabel: string;
|
|
111
|
+
/** The referenced entity, e.g. `Ada Lovelace` or `cover.jpg`. */
|
|
112
|
+
targetLabel: string;
|
|
113
|
+
/** Deep link to the exact source location (field control / graph node). */
|
|
114
|
+
sourceLink: ReferenceDeepLink | null;
|
|
115
|
+
/** Link to the referenced entity's surface. */
|
|
116
|
+
targetLink: ReferenceDeepLink | null;
|
|
117
|
+
}
|
|
118
|
+
/** Resolve a document's display title (titleField value, default locale first). */
|
|
119
|
+
export declare function documentTitleOf(collection: CollectionDef | undefined, document: CmsDocument | undefined, fallback: string): string;
|
|
120
|
+
/** Strip the namespace off a component id for compact labels. */
|
|
121
|
+
export declare function shortComponentId(componentId: string): string;
|
|
122
|
+
/** Label + link one merged entry (see {@link buildReferenceEntryViews}). */
|
|
123
|
+
export declare function buildReferenceEntryView(entry: MergedReferenceEntry, context: ReferenceLabelContext): ReferenceEntryView;
|
|
124
|
+
/** Merge variants and label every record — the panel's full render model. */
|
|
125
|
+
export declare function buildReferenceEntryViews(records: readonly ReferenceEntryRecord[], context: ReferenceLabelContext): ReferenceEntryView[];
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure presentation model for the EC-172 references panels.
|
|
3
|
+
*
|
|
4
|
+
* The EC-155 index stores entries as `(source, path, target, kind)` per
|
|
5
|
+
* variant; this module turns those records into renderable rows: variants
|
|
6
|
+
* merged onto one row (draft/published badges), human-readable source/
|
|
7
|
+
* location/target labels, and deep-link descriptors that pinpoint the exact
|
|
8
|
+
* field (CMS) or graph node (builder) a path identifies. No data fetching, no
|
|
9
|
+
* React — everything here is a deterministic function of its inputs, so it is
|
|
10
|
+
* fully testable in the node environment.
|
|
11
|
+
*/
|
|
12
|
+
// --- Path parsing -------------------------------------------------------------
|
|
13
|
+
/** Split a `collection:id` document key (the index's document source/target id). */
|
|
14
|
+
export function parseDocumentKey(key) {
|
|
15
|
+
const separator = key.indexOf(':');
|
|
16
|
+
if (separator <= 0 || separator === key.length - 1)
|
|
17
|
+
return null;
|
|
18
|
+
return { collection: key.slice(0, separator), id: key.slice(separator + 1) };
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Parse a document index path (`values/<field>/…` or
|
|
22
|
+
* `localized/<locale>/<field>/…`) onto the owning field.
|
|
23
|
+
*/
|
|
24
|
+
export function parseDocumentFieldPath(path) {
|
|
25
|
+
const tokens = path.split('/');
|
|
26
|
+
if (tokens[0] === 'values' && tokens[1]) {
|
|
27
|
+
return { field: tokens[1], rest: tokens.slice(2) };
|
|
28
|
+
}
|
|
29
|
+
if (tokens[0] === 'localized' && tokens[1] && tokens[2]) {
|
|
30
|
+
return { locale: tokens[1], field: tokens[2], rest: tokens.slice(3) };
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Resolve a graph index path (`root`, then repeated `slots/<slot>/<index>`
|
|
36
|
+
* hops, then a structure suffix) to the node it identifies. Walks the
|
|
37
|
+
* slot/index prefix structurally; a prefix that no longer exists (the graph
|
|
38
|
+
* drifted since indexing) resolves to `null`.
|
|
39
|
+
*/
|
|
40
|
+
export function resolveGraphNodePath(root, path) {
|
|
41
|
+
const tokens = path.split('/');
|
|
42
|
+
if (tokens[0] !== 'root')
|
|
43
|
+
return { node: null, remainder: tokens };
|
|
44
|
+
let node = root;
|
|
45
|
+
let index = 1;
|
|
46
|
+
while (index < tokens.length && tokens[index] === 'slots') {
|
|
47
|
+
const slot = tokens[index + 1];
|
|
48
|
+
const childIndex = Number(tokens[index + 2]);
|
|
49
|
+
const child = slot !== undefined && Number.isInteger(childIndex)
|
|
50
|
+
? node.slots?.[slot]?.[childIndex]
|
|
51
|
+
: undefined;
|
|
52
|
+
if (!child)
|
|
53
|
+
return { node: null, remainder: tokens.slice(index) };
|
|
54
|
+
node = child;
|
|
55
|
+
index += 3;
|
|
56
|
+
}
|
|
57
|
+
return { node, remainder: tokens.slice(index) };
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Merge per-variant index records onto one row per logical entry. A
|
|
61
|
+
* draft-only row (`draft && !published`) is the Sanity hidden-draft-reference
|
|
62
|
+
* case the panel must make visible. Order is deterministic:
|
|
63
|
+
* source type → source id → path → target type → target id → kind.
|
|
64
|
+
*/
|
|
65
|
+
export function mergeReferenceVariants(records) {
|
|
66
|
+
const byKey = new Map();
|
|
67
|
+
for (const record of records) {
|
|
68
|
+
const key = `${record.source.type} ${record.source.id} ${record.path} ${record.target.type} ${record.target.id} ${record.kind}`;
|
|
69
|
+
const existing = byKey.get(key);
|
|
70
|
+
if (existing) {
|
|
71
|
+
if (record.variant === 'draft')
|
|
72
|
+
existing.draft = true;
|
|
73
|
+
else
|
|
74
|
+
existing.published = true;
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
byKey.set(key, {
|
|
78
|
+
key,
|
|
79
|
+
source: record.source,
|
|
80
|
+
path: record.path,
|
|
81
|
+
target: record.target,
|
|
82
|
+
kind: record.kind,
|
|
83
|
+
draft: record.variant === 'draft',
|
|
84
|
+
published: record.variant === 'published',
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return [...byKey.values()].sort((a, b) => (a.key < b.key ? -1 : a.key > b.key ? 1 : 0));
|
|
88
|
+
}
|
|
89
|
+
// --- Labels & deep links --------------------------------------------------------
|
|
90
|
+
/** Human label per reference kind (entry-row badge). */
|
|
91
|
+
export const REFERENCE_KIND_LABELS = {
|
|
92
|
+
'relation-field': 'relation',
|
|
93
|
+
'asset-field': 'asset field',
|
|
94
|
+
'rich-text-link': 'rich-text link',
|
|
95
|
+
'rich-text-node': 'rich-text node',
|
|
96
|
+
'component-usage': 'component usage',
|
|
97
|
+
'prop-binding': 'prop binding',
|
|
98
|
+
'condition-binding': 'condition binding',
|
|
99
|
+
};
|
|
100
|
+
function fieldLabelOf(collection, fieldName) {
|
|
101
|
+
const field = collection?.fields.find((f) => f.name === fieldName);
|
|
102
|
+
return field?.form?.label ?? fieldName;
|
|
103
|
+
}
|
|
104
|
+
function collectionLabelOf(collection, collectionId) {
|
|
105
|
+
return collection?.form?.labelSingular ?? collection?.form?.label ?? collectionId;
|
|
106
|
+
}
|
|
107
|
+
/** Resolve a document's display title (titleField value, default locale first). */
|
|
108
|
+
export function documentTitleOf(collection, document, fallback) {
|
|
109
|
+
if (!collection || !document)
|
|
110
|
+
return fallback;
|
|
111
|
+
const field = collection.titleField ?? 'title';
|
|
112
|
+
const direct = document.values[field];
|
|
113
|
+
if (typeof direct === 'string' && direct.length > 0)
|
|
114
|
+
return direct;
|
|
115
|
+
const locales = Object.keys(document.localized ?? {}).sort();
|
|
116
|
+
const preferred = document.defaultLocale;
|
|
117
|
+
for (const locale of [preferred, ...locales]) {
|
|
118
|
+
if (!locale)
|
|
119
|
+
continue;
|
|
120
|
+
const value = document.localized?.[locale]?.[field];
|
|
121
|
+
if (typeof value === 'string' && value.length > 0)
|
|
122
|
+
return value;
|
|
123
|
+
}
|
|
124
|
+
return fallback;
|
|
125
|
+
}
|
|
126
|
+
/** Strip the namespace off a component id for compact labels. */
|
|
127
|
+
export function shortComponentId(componentId) {
|
|
128
|
+
return componentId.replace('base.primitives.', '').replace('project.', '');
|
|
129
|
+
}
|
|
130
|
+
function documentParts(context, key) {
|
|
131
|
+
const ref = parseDocumentKey(key);
|
|
132
|
+
if (!ref)
|
|
133
|
+
return null;
|
|
134
|
+
const collection = context.collections.find((c) => c.id === ref.collection);
|
|
135
|
+
return {
|
|
136
|
+
collection,
|
|
137
|
+
collectionId: ref.collection,
|
|
138
|
+
documentId: ref.id,
|
|
139
|
+
title: documentTitleOf(collection, context.documents.get(key), ref.id),
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
function describeDocumentSource(context, entry) {
|
|
143
|
+
const parts = documentParts(context, entry.source.id);
|
|
144
|
+
if (!parts) {
|
|
145
|
+
return { sourceLabel: entry.source.id, locationLabel: entry.path, sourceLink: null };
|
|
146
|
+
}
|
|
147
|
+
const parsed = parseDocumentFieldPath(entry.path);
|
|
148
|
+
const fieldLabel = parsed ? fieldLabelOf(parts.collection, parsed.field) : entry.path;
|
|
149
|
+
const qualifiers = [];
|
|
150
|
+
if (parsed?.locale)
|
|
151
|
+
qualifiers.push(parsed.locale);
|
|
152
|
+
if (entry.kind === 'rich-text-link')
|
|
153
|
+
qualifiers.push('link');
|
|
154
|
+
if (entry.kind === 'rich-text-node')
|
|
155
|
+
qualifiers.push('embedded node');
|
|
156
|
+
if (entry.kind === 'relation-field' &&
|
|
157
|
+
parsed &&
|
|
158
|
+
parsed.rest.length === 1 &&
|
|
159
|
+
/^\d+$/.test(parsed.rest[0])) {
|
|
160
|
+
qualifiers.push(`item ${parsed.rest[0]}`);
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
sourceLabel: `${collectionLabelOf(parts.collection, parts.collectionId)} · ${parts.title}`,
|
|
164
|
+
locationLabel: qualifiers.length > 0 ? `${fieldLabel} (${qualifiers.join(', ')})` : fieldLabel,
|
|
165
|
+
sourceLink: {
|
|
166
|
+
kind: 'cms-field',
|
|
167
|
+
collectionId: parts.collectionId,
|
|
168
|
+
documentId: parts.documentId,
|
|
169
|
+
fieldPath: entry.path,
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
function describeGraphSource(context, entry) {
|
|
174
|
+
const isPage = entry.source.type === 'page';
|
|
175
|
+
// The canonical graph is layouts-only now (EC-187): a `page` source is no
|
|
176
|
+
// longer addressable in the graph (page bodies are CMS documents), so only a
|
|
177
|
+
// layout owner resolves a node; a page source labels by its id.
|
|
178
|
+
const owner = isPage
|
|
179
|
+
? undefined
|
|
180
|
+
: context.graph?.layouts.find((l) => l.id === entry.source.id);
|
|
181
|
+
const ownerLabel = `${isPage ? 'Page' : 'Layout'} · ${owner?.name ?? entry.source.id}`;
|
|
182
|
+
const resolved = owner ? resolveGraphNodePath(owner.root, entry.path) : null;
|
|
183
|
+
const node = resolved?.node ?? null;
|
|
184
|
+
const nodeLabel = node ? `${shortComponentId(node.componentId)} (${node.id})` : entry.path;
|
|
185
|
+
const remainder = resolved && node ? resolved.remainder.join('/') : null;
|
|
186
|
+
const locationLabel = remainder && remainder !== 'componentId' ? `${nodeLabel} · ${remainder}` : nodeLabel;
|
|
187
|
+
return {
|
|
188
|
+
sourceLabel: ownerLabel,
|
|
189
|
+
locationLabel,
|
|
190
|
+
// Layout nodes are not addressable in the page-scoped builder; link to the
|
|
191
|
+
// builder without a node selection in that case.
|
|
192
|
+
sourceLink: isPage
|
|
193
|
+
? { kind: 'builder-node', pageId: entry.source.id, ...(node ? { nodeId: node.id } : {}) }
|
|
194
|
+
: { kind: 'builder-node' },
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
function describeTarget(context, target) {
|
|
198
|
+
switch (target.type) {
|
|
199
|
+
case 'document': {
|
|
200
|
+
const parts = documentParts(context, target.id);
|
|
201
|
+
if (!parts)
|
|
202
|
+
return { targetLabel: target.id, targetLink: null };
|
|
203
|
+
return {
|
|
204
|
+
targetLabel: `${collectionLabelOf(parts.collection, parts.collectionId)} · ${parts.title}`,
|
|
205
|
+
targetLink: {
|
|
206
|
+
kind: 'cms-field',
|
|
207
|
+
collectionId: parts.collectionId,
|
|
208
|
+
documentId: parts.documentId,
|
|
209
|
+
},
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
case 'component':
|
|
213
|
+
return {
|
|
214
|
+
targetLabel: context.componentTitle(target.id) ?? shortComponentId(target.id),
|
|
215
|
+
targetLink: { kind: 'component', componentId: target.id },
|
|
216
|
+
};
|
|
217
|
+
case 'asset': {
|
|
218
|
+
const asset = context.assets.get(target.id);
|
|
219
|
+
return {
|
|
220
|
+
targetLabel: asset ? (asset.title ?? asset.filename) : target.id,
|
|
221
|
+
targetLink: { kind: 'asset', assetId: target.id },
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
/** Label + link one merged entry (see {@link buildReferenceEntryViews}). */
|
|
227
|
+
export function buildReferenceEntryView(entry, context) {
|
|
228
|
+
const sourceParts = entry.source.type === 'document'
|
|
229
|
+
? describeDocumentSource(context, entry)
|
|
230
|
+
: describeGraphSource(context, entry);
|
|
231
|
+
return {
|
|
232
|
+
...entry,
|
|
233
|
+
kindLabel: REFERENCE_KIND_LABELS[entry.kind],
|
|
234
|
+
...sourceParts,
|
|
235
|
+
...describeTarget(context, entry.target),
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
/** Merge variants and label every record — the panel's full render model. */
|
|
239
|
+
export function buildReferenceEntryViews(records, context) {
|
|
240
|
+
return mergeReferenceVariants(records).map((entry) => buildReferenceEntryView(entry, context));
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=reference-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference-model.js","sourceRoot":"","sources":["../../../src/lib/references/reference-model.ts"],"names":[],"mappings":"AASA;;;;;;;;;;GAUG;AAEH,iFAAiF;AAEjF,oFAAoF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AK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE;gBAChE,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,EAAE;aAClD,CAAA;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,uBAAuB,CACrC,KAA2B,EAC3B,OAA8B;IAE9B,MAAM,WAAW,GACf,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,UAAU;QAC9B,CAAC,CAAC,sBAAsB,CAAC,OAAO,EAAE,KAAK,CAAC;QACxC,CAAC,CAAC,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IACzC,OAAO;QACL,GAAG,KAAK;QACR,SAAS,EAAE,qBAAqB,CAAC,KAAK,CAAC,IAAI,CAAC;QAC5C,GAAG,WAAW;QACd,GAAG,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC;KACzC,CAAA;AACH,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,wBAAwB,CACtC,OAAwC,EACxC,OAA8B;IAE9B,OAAO,sBAAsB,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,uBAAuB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAA;AAChG,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { DocumentRef } from '@elytracms/cms-core';
|
|
2
|
+
import type { ReferenceSource, ReferenceTarget } from '@elytracms/persistence';
|
|
3
|
+
import type { StudioOperations } from '../operations';
|
|
4
|
+
import type { ReferenceEntryView } from './reference-model';
|
|
5
|
+
/**
|
|
6
|
+
* Data layer for the EC-172 references panels. All reads go through
|
|
7
|
+
* `@elytracms/operations` queries (`references.outbound` / `references.inbound`
|
|
8
|
+
* plus the labeling queries) — UI code never touches persistence repositories
|
|
9
|
+
* or index tables. The hook keeps panels live: any succeeded command in a
|
|
10
|
+
* content-bearing domain re-queries after the EC-155 maintained-on-write
|
|
11
|
+
* attachment has flushed.
|
|
12
|
+
*/
|
|
13
|
+
export interface ReferencePanelQuery {
|
|
14
|
+
projectId: string;
|
|
15
|
+
/** Enables the outbound ("references") section. */
|
|
16
|
+
source?: ReferenceSource | undefined;
|
|
17
|
+
/** Enables the inbound ("used by") section. */
|
|
18
|
+
target?: ReferenceTarget | undefined;
|
|
19
|
+
}
|
|
20
|
+
export interface ReferencePanelData {
|
|
21
|
+
outbound: ReferenceEntryView[];
|
|
22
|
+
inbound: ReferenceEntryView[];
|
|
23
|
+
/**
|
|
24
|
+
* Per-direction read error (EC-205): a direction whose query returns a
|
|
25
|
+
* structured non-ok degrades to an empty list plus this message, surfaced as a
|
|
26
|
+
* visible per-section error — instead of collapsing the whole panel into its
|
|
27
|
+
* hard-error state. `null` when the direction loaded (or was not requested).
|
|
28
|
+
*/
|
|
29
|
+
outboundError: string | null;
|
|
30
|
+
inboundError: string | null;
|
|
31
|
+
}
|
|
32
|
+
export declare function ensureReferenceIndex(studio: StudioOperations, projectId: string): Promise<void>;
|
|
33
|
+
/** Load both directions + labels for one panel (operations queries only). */
|
|
34
|
+
export declare function loadReferencePanelData(query: ReferencePanelQuery): Promise<ReferencePanelData>;
|
|
35
|
+
/**
|
|
36
|
+
* Load the labelled inbound entry views for a set of target documents in ONE
|
|
37
|
+
* pass (one index flush, one label-context load) — the pre-flight data of the
|
|
38
|
+
* EC-173 confirmation dialogs, including the bulk flows. Returns entries in
|
|
39
|
+
* `targets` order; pair with `buildReferenceImpact` for break/block semantics.
|
|
40
|
+
*/
|
|
41
|
+
export declare function loadInboundReferenceViews(projectId: string, targets: readonly DocumentRef[]): Promise<{
|
|
42
|
+
ref: DocumentRef;
|
|
43
|
+
inbound: ReferenceEntryView[];
|
|
44
|
+
}[]>;
|
|
45
|
+
/**
|
|
46
|
+
* Inbound reference views for ONE asset (EC-202): the "what uses this asset"
|
|
47
|
+
* pre-flight of the asset-delete dialog, index-accurate (the EC-155 reference
|
|
48
|
+
* index, not the retired `find-asset-usages` string scan). Mirrors
|
|
49
|
+
* {@link loadInboundReferenceViews} for a single `{ type: 'asset' }` target —
|
|
50
|
+
* the source labels resolve the referencing documents/graph-nodes identically.
|
|
51
|
+
*/
|
|
52
|
+
export declare function loadInboundAssetReferenceViews(projectId: string, assetId: string): Promise<ReferenceEntryView[]>;
|
|
53
|
+
export type ReferencePanelStatus = 'loading' | 'ready' | 'error';
|
|
54
|
+
export interface ReferencePanelState {
|
|
55
|
+
status: ReferencePanelStatus;
|
|
56
|
+
data: ReferencePanelData | null;
|
|
57
|
+
errorMessage: string | null;
|
|
58
|
+
refresh: () => void;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Live panel state for one entity: loads on mount, exposes explicit
|
|
62
|
+
* loading/error states, and re-queries whenever a content-bearing command
|
|
63
|
+
* succeeds anywhere in the studio (the index is maintained on write).
|
|
64
|
+
*/
|
|
65
|
+
export declare function useReferencePanel(query: ReferencePanelQuery): ReferencePanelState;
|