@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,127 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Boxes, Check, Image, Link2, Minus } from 'lucide-react';
|
|
3
|
+
import { blockRootsOf } from '@elytracms/project-graph';
|
|
4
|
+
import { Badge, Code, Text } from '@elytracms/studio/ui';
|
|
5
|
+
import { localeChipLabel, resolveDisplayedValue } from '@elytracms/studio/lib/locale';
|
|
6
|
+
import { useOptionalAssets } from '../assets/assets-store';
|
|
7
|
+
import { useCms } from './cms-store';
|
|
8
|
+
/**
|
|
9
|
+
* Render a document's field value for a table cell, by field type (brief
|
|
10
|
+
* §8.4, EC-070), resolved in the studio's ambient active locale (EC-176).
|
|
11
|
+
* A value served via EC-018 locale fallback carries a visible chip — never
|
|
12
|
+
* silently mixed in as if it were translated.
|
|
13
|
+
*/
|
|
14
|
+
export function CellValue({ collection, doc, field, }) {
|
|
15
|
+
const cms = useCms();
|
|
16
|
+
const { value, fallback } = resolveDisplayedValue(collection, doc, field.name, cms.activeLocale, cms.localeConfig);
|
|
17
|
+
if (value === undefined || value === null || value === '') {
|
|
18
|
+
return _jsx(Minus, { className: "size-3.5 text-muted-foreground/50" });
|
|
19
|
+
}
|
|
20
|
+
return (_jsxs("span", { className: "inline-flex min-w-0 max-w-full items-center gap-1.5", children: [_jsx(TypedCellValue, { field: field, value: value }), _jsx(FallbackChip, { fallback: fallback, testId: `cell-fallback-${doc.id}-${field.name}` })] }));
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Subtle source-locale chip on a fallback-displayed value (EC-176): e.g. a
|
|
24
|
+
* German view showing untranslated English content gets an "EN" marker.
|
|
25
|
+
*/
|
|
26
|
+
export function FallbackChip({ fallback, testId, }) {
|
|
27
|
+
if (fallback === null)
|
|
28
|
+
return null;
|
|
29
|
+
return (_jsx(Badge, { variant: "outline", "data-testid": testId, title: fallbackTitle(fallback), className: "shrink-0 px-1 py-0 text-[0.6rem] uppercase tracking-wide text-muted-foreground", children: localeChipLabel(fallback.sourceLocale) }));
|
|
30
|
+
}
|
|
31
|
+
/** Plain-language tooltip of a fallback chip. */
|
|
32
|
+
export function fallbackTitle(fallback) {
|
|
33
|
+
return `Showing ${localeChipLabel(fallback.sourceLocale)} (fallback) — no ${localeChipLabel(fallback.requestedLocale)} translation yet. Edit to translate.`;
|
|
34
|
+
}
|
|
35
|
+
function TypedCellValue({ field, value }) {
|
|
36
|
+
switch (field.type) {
|
|
37
|
+
case 'boolean':
|
|
38
|
+
return value === true ? (_jsx(Check, { className: "size-4 text-success" })) : (_jsx(Minus, { className: "size-3.5 text-muted-foreground/50" }));
|
|
39
|
+
case 'select':
|
|
40
|
+
return _jsx(Badge, { variant: "outline", children: String(value) });
|
|
41
|
+
case 'number':
|
|
42
|
+
return _jsx(Text, { size: "sm", mono: true, children: String(value) });
|
|
43
|
+
case 'date':
|
|
44
|
+
return (_jsx(Text, { size: "sm", tone: "muted", mono: true, children: String(value).slice(0, 10) }));
|
|
45
|
+
case 'richText':
|
|
46
|
+
return (_jsx(Text, { size: "xs", tone: "subtle", children: stripHtml(String(value)).slice(0, 40) || 'rich text' }));
|
|
47
|
+
case 'relation':
|
|
48
|
+
return _jsx(RelationCell, { value: value });
|
|
49
|
+
case 'asset':
|
|
50
|
+
return _jsx(AssetCell, { value: value });
|
|
51
|
+
case 'blocks':
|
|
52
|
+
return _jsx(BlocksCell, { value: value });
|
|
53
|
+
case 'object': {
|
|
54
|
+
// EC-253: list-view summary, never `[object Object]`. A repeater shows its
|
|
55
|
+
// item count; a single object is edited in the detail form, not the cell.
|
|
56
|
+
if (field.cardinality === 'many') {
|
|
57
|
+
const count = Array.isArray(value) ? value.length : 0;
|
|
58
|
+
return (_jsxs(Badge, { variant: "outline", children: [count, " ", count === 1 ? 'item' : 'items'] }));
|
|
59
|
+
}
|
|
60
|
+
return (_jsx(Text, { size: "xs", tone: "subtle", children: value && typeof value === 'object' ? 'object' : '—' }));
|
|
61
|
+
}
|
|
62
|
+
default:
|
|
63
|
+
return (_jsx(Text, { size: "sm", className: "truncate", children: String(value) }));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function RelationCell({ value }) {
|
|
67
|
+
const cms = useCms();
|
|
68
|
+
const refs = toRefArray(value);
|
|
69
|
+
if (refs.length === 0)
|
|
70
|
+
return _jsx(Minus, { className: "size-3.5 text-muted-foreground/50" });
|
|
71
|
+
return (_jsxs("div", { className: "flex flex-wrap items-center gap-1", children: [refs.slice(0, 3).map((ref, i) => (_jsxs(Badge, { variant: "info", children: [_jsx(Link2, { className: "size-3" }), " ", cms.titleOf(ref)] }, `${ref.id}-${i}`))), refs.length > 3 ? _jsxs(Text, { size: "xs", tone: "subtle", children: ["+", refs.length - 3] }) : null] }));
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A blocks/composition cell: a count of TOP-LEVEL blocks (EC-212) — matching
|
|
75
|
+
* what the canvas/page-tree present as the block list, never `[object Object]`.
|
|
76
|
+
*/
|
|
77
|
+
function BlocksCell({ value }) {
|
|
78
|
+
const count = blockRootsOf(value).length;
|
|
79
|
+
if (count === 0)
|
|
80
|
+
return _jsx(Minus, { className: "size-3.5 text-muted-foreground/50" });
|
|
81
|
+
return (_jsxs(Badge, { variant: "outline", children: [_jsx(Boxes, { className: "size-3" }), " ", count, " ", count === 1 ? 'block' : 'blocks'] }));
|
|
82
|
+
}
|
|
83
|
+
function AssetCell({ value }) {
|
|
84
|
+
const cms = useCms();
|
|
85
|
+
const assetStore = useOptionalAssets();
|
|
86
|
+
const assetCollectionId = cms.collections.find((c) => c.kind === 'asset')?.id ?? 'asset';
|
|
87
|
+
const ids = (Array.isArray(value) ? value : [value]).filter((v) => typeof v === 'string');
|
|
88
|
+
if (ids.length === 0)
|
|
89
|
+
return _jsx(Minus, { className: "size-3.5 text-muted-foreground/50" });
|
|
90
|
+
const first = ids[0];
|
|
91
|
+
const record = assetStore?.assets.find((asset) => asset.id === first);
|
|
92
|
+
const label = record?.title ?? record?.filename ?? cms.titleOf({ collection: assetCollectionId, id: first });
|
|
93
|
+
return (_jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [_jsx(AssetPreview, { record: record, label: label }), ids.length > 1 ? _jsxs(Text, { size: "xs", tone: "subtle", children: ["+", ids.length - 1] }) : null] }));
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* An asset reference in a cell: an image thumbnail for image assets with a
|
|
97
|
+
* resolvable URL (EC-212), otherwise the labelled icon badge (and the same
|
|
98
|
+
* badge whenever no `<AssetsProvider>` is mounted to resolve the record).
|
|
99
|
+
*/
|
|
100
|
+
function AssetPreview({ record, label }) {
|
|
101
|
+
const isImage = record?.contentType.startsWith('image/') ?? false;
|
|
102
|
+
const url = record?.url;
|
|
103
|
+
if (isImage && url && url.startsWith('http')) {
|
|
104
|
+
return (_jsxs("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [_jsx("img", { src: url, alt: record?.alt ?? label, loading: "lazy", className: "size-7 shrink-0 rounded border border-border bg-muted object-cover" }), _jsx(Text, { size: "xs", tone: "subtle", className: "max-w-[10rem] truncate", children: label })] }));
|
|
105
|
+
}
|
|
106
|
+
return (_jsxs(Badge, { variant: "outline", children: [_jsx(Image, { className: "size-3" }), " ", label] }));
|
|
107
|
+
}
|
|
108
|
+
/** Normalize a relation value (single ref or array of refs) into an array. */
|
|
109
|
+
export function toRefArray(value) {
|
|
110
|
+
if (Array.isArray(value))
|
|
111
|
+
return value.filter(isRef);
|
|
112
|
+
return isRef(value) ? [value] : [];
|
|
113
|
+
}
|
|
114
|
+
function isRef(value) {
|
|
115
|
+
return (typeof value === 'object' &&
|
|
116
|
+
value !== null &&
|
|
117
|
+
typeof value.collection === 'string' &&
|
|
118
|
+
typeof value.id === 'string');
|
|
119
|
+
}
|
|
120
|
+
function stripHtml(html) {
|
|
121
|
+
return html.replace(/<[^>]*>/g, ' ').replace(/\s+/g, ' ').trim();
|
|
122
|
+
}
|
|
123
|
+
/** Render a small mono code for the raw stored value (debug/primary-cell hint). */
|
|
124
|
+
export function RawValue({ value }) {
|
|
125
|
+
return _jsx(Code, { tone: "muted", children: typeof value === 'string' ? value : JSON.stringify(value) });
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=cell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell.js","sourceRoot":"","sources":["../../../src/components/cms/cell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEvD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAErF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,EACxB,UAAU,EACV,GAAG,EACH,KAAK,GAKN;IACC,MAAM,GAAG,GAAG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AAC,wBAAwB,YAC7D,KAAK,GACD,IACF,CACR,CAAA;IACH,CAAC;IACD,OAAO,CACL,MAAC,KAAK,IAAC,OAAO,EAAC,SAAS,aACtB,KAAC,KAAK,IAAC,SAAS,EAAC,QAAQ,GAAG,OAAE,KAAK,IAC7B,CACT,CAAA;AACH,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IACpD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AACpC,CAAC;AAED,SAAS,KAAK,CAAC,KAAc;IAC3B,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,OAAQ,KAAqB,CAAC,UAAU,KAAK,QAAQ;QACrD,OAAQ,KAAqB,CAAC,EAAE,KAAK,QAAQ,CAC9C,CAAA;AACH,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAA;AAClE,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAsB;IACpD,OAAO,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,YAAE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAQ,CAAA;AAC9F,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The CMS section landing view (EC-223 Stage 6): the collection grid, shown when
|
|
3
|
+
* no collection is selected. Takes `projectId` as a prop; the splat resolver
|
|
4
|
+
* mounts it inside the CMS provider so {@link useCms} resolves.
|
|
5
|
+
*/
|
|
6
|
+
export declare function CmsIndex({ projectId }: {
|
|
7
|
+
projectId: string;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Database, FileCog } from 'lucide-react';
|
|
3
|
+
import { isSingleton } from '@elytracms/cms-core';
|
|
4
|
+
import { Link, STUDIO_PROJECT_ROUTE, studioPath } from '@elytracms/studio/router';
|
|
5
|
+
import { useCms } from '@elytracms/studio/components/cms/cms-store';
|
|
6
|
+
import { CollectionsSidebar } from '@elytracms/studio/components/cms/collections-sidebar';
|
|
7
|
+
import { Card, Code, Heading, Spacer, Stack, Text } from '@elytracms/studio/ui';
|
|
8
|
+
/**
|
|
9
|
+
* The CMS section landing view (EC-223 Stage 6): the collection grid, shown when
|
|
10
|
+
* no collection is selected. Takes `projectId` as a prop; the splat resolver
|
|
11
|
+
* mounts it inside the CMS provider so {@link useCms} resolves.
|
|
12
|
+
*/
|
|
13
|
+
export function CmsIndex({ projectId }) {
|
|
14
|
+
const cms = useCms();
|
|
15
|
+
return (_jsxs("div", { className: "mx-auto w-full max-w-3xl p-4 sm:p-6", children: [_jsx("div", { className: "mb-6 h-72 overflow-hidden rounded-lg border border-border md:hidden", children: _jsx(CollectionsSidebar, { projectId: projectId }) }), _jsxs(Stack, { gap: "6", children: [_jsxs(Stack, { gap: "1", children: [_jsx(Heading, { size: "display", children: "Content" }), _jsx(Text, { tone: "muted", children: "Schema-driven collections. Open a collection to browse its documents as a table and edit them in the detail editor." })] }), _jsx("div", { className: "grid gap-3 sm:grid-cols-2", children: cms.collections.map((collection) => {
|
|
16
|
+
// EC-217: a singleton reads as one fixed document — a distinct icon
|
|
17
|
+
// and a "Single document" note instead of a (always-1) row count.
|
|
18
|
+
const singleton = isSingleton(collection);
|
|
19
|
+
const Icon = singleton ? FileCog : Database;
|
|
20
|
+
return (_jsx(Link, { to: STUDIO_PROJECT_ROUTE, params: { projectId, _splat: studioPath.cmsCollection(collection.id) }, children: _jsxs(Card, { className: "flex items-center gap-3 p-4 transition-colors hover:border-primary/30", children: [_jsx("span", { className: "grid size-9 shrink-0 place-items-center rounded-lg bg-muted text-muted-foreground", children: _jsx(Icon, { className: "size-4" }) }), _jsxs(Stack, { gap: "none", className: "min-w-0", children: [_jsx(Text, { weight: "semibold", className: "truncate", children: collection.form?.label ?? collection.id }), _jsxs(Code, { tone: "muted", className: "w-fit", children: [collection.id, " \u00B7 ", collection.fields.length, " fields"] })] }), _jsx(Spacer, {}), singleton ? (_jsx(Text, { size: "xs", tone: "muted", className: "whitespace-nowrap", children: "Single document" })) : (_jsx(Text, { size: "sm", tone: "muted", mono: true, children: cms.documentsOf(collection.id).length }))] }) }, collection.id));
|
|
21
|
+
}) })] })] }));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=cms-index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cms-index.js","sourceRoot":"","sources":["../../../src/components/cms/cms-index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,4CAA4C,CAAA;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAA;AACzF,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAE/E;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,SAAS,EAAyB;IAC3D,MAAM,GAAG,GAAG,MAAM,EAAE,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AC,MAAM,KAAG,EACT,SAAS,CAAC,CAAC,CAAC,CACX,KAAC,IAAI,IAAC,IAAI,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,mBAAmB,gCAEnD,CACR,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,IAAI,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAC,IAAI,kBAC9B,GAAG,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,MAAM,GACjC,CACR,IACI,IA1BF,UAAU,CAAC,EAAE,CA2Bb,CACR,CAAA;wBACH,CAAC,CAAC,GACE,IACA,IACJ,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { CmsDocument, CmsValidationIssue, CollectionDef, DocumentRef, FieldDef, Locale, LocaleConfig } from '@elytracms/cms-core';
|
|
3
|
+
import type { DocumentVersionRecord } from '@elytracms/persistence';
|
|
4
|
+
import type { OperationError } from '@elytracms/studio/lib/operations';
|
|
5
|
+
import type { TableViewState } from '@elytracms/studio/lib/cms-views';
|
|
6
|
+
import type { CellCommitInput, CellCommitOutcome } from './cell-edit';
|
|
7
|
+
import type { BulkAction, BulkReport } from './bulk-actions';
|
|
8
|
+
/**
|
|
9
|
+
* A saved table view (EC-169, supersedes the EC-071 column presets): a named
|
|
10
|
+
* bundle of filters (closed AD-3 vocabulary), sort, and visible/ordered
|
|
11
|
+
* columns. Named views persist project-scoped through operations (see
|
|
12
|
+
* `lib/cms-views/views-store`); the unnamed "All documents" default is derived
|
|
13
|
+
* per collection and never persisted.
|
|
14
|
+
*/
|
|
15
|
+
export interface SavedView {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
state: TableViewState;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Mint a collision-safe, slug-derived page id (EC-192): the slug of the page name,
|
|
22
|
+
* suffixed `-2`/`-3`/… until it is free among the ids already taken. Empty or
|
|
23
|
+
* symbol-only names fall back to `page`. Pure so the id rule is testable without
|
|
24
|
+
* the store; `createPage` applies it against the live page documents.
|
|
25
|
+
*/
|
|
26
|
+
export declare function nextPageId(name: string, taken: ReadonlySet<string>): string;
|
|
27
|
+
export interface ImportReport {
|
|
28
|
+
added: number;
|
|
29
|
+
rejected: {
|
|
30
|
+
id: string;
|
|
31
|
+
issues: CmsValidationIssue[];
|
|
32
|
+
}[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A document's recorded version history plus its live pin (EC-224), as the
|
|
36
|
+
* Versions inspector pane reads it. `versions` is newest-first; `publishedVersion`
|
|
37
|
+
* is the recorded version currently pinned live, absent when unpublished.
|
|
38
|
+
*/
|
|
39
|
+
export interface DocumentVersionsView {
|
|
40
|
+
versions: DocumentVersionRecord[];
|
|
41
|
+
publishedVersion?: number;
|
|
42
|
+
}
|
|
43
|
+
export interface CmsStore {
|
|
44
|
+
/** The project this CMS session edits (set when persistence is enabled); the asset picker scopes the real library by it (EC-152). */
|
|
45
|
+
projectId?: string;
|
|
46
|
+
collections: readonly CollectionDef[];
|
|
47
|
+
localeConfig: LocaleConfig;
|
|
48
|
+
/**
|
|
49
|
+
* The studio's ambient active locale (EC-176): table cells, detail forms,
|
|
50
|
+
* and inline edits all display and write THIS locale. Switched once via the
|
|
51
|
+
* shared `LocaleSwitcher`, never per control.
|
|
52
|
+
*/
|
|
53
|
+
activeLocale: Locale;
|
|
54
|
+
getCollection(id: string): CollectionDef | undefined;
|
|
55
|
+
documentsOf(collectionId: string): CmsDocument[];
|
|
56
|
+
getDocument(ref: DocumentRef): CmsDocument | undefined;
|
|
57
|
+
/** Resolve a relation/asset target's display title. */
|
|
58
|
+
titleOf(ref: DocumentRef): string;
|
|
59
|
+
saveDocument(doc: CmsDocument): void;
|
|
60
|
+
/**
|
|
61
|
+
* Commit ONE field edit from the table (EC-168): optimistic session apply +
|
|
62
|
+
* exactly one `documents.upsert` operations command, awaited. Validation
|
|
63
|
+
* failures and operation rejections return a structured error (the caller
|
|
64
|
+
* renders it on the cell) and leave the session rolled back.
|
|
65
|
+
*/
|
|
66
|
+
commitFieldEdit(input: CellCommitInput): Promise<CellCommitOutcome>;
|
|
67
|
+
createDocument(collectionId: string): DocumentRef;
|
|
68
|
+
/** Create a named page (`page` collection) with a stable, slug-derived id. */
|
|
69
|
+
createPage(input: {
|
|
70
|
+
name: string;
|
|
71
|
+
}): DocumentRef;
|
|
72
|
+
/**
|
|
73
|
+
* Ensure a singleton collection's one fixed document exists (EC-217): the
|
|
74
|
+
* document id is the collection id ({@link singletonDocId}). Idempotent —
|
|
75
|
+
* returns the ref whether it created the (empty) document or it was already
|
|
76
|
+
* present. The detail editor for a singleton opens through this so the single
|
|
77
|
+
* document always exists to edit.
|
|
78
|
+
*/
|
|
79
|
+
ensureSingletonDocument(collectionId: string): DocumentRef;
|
|
80
|
+
deleteDocument(ref: DocumentRef): void;
|
|
81
|
+
/**
|
|
82
|
+
* Is this document currently published? Sourced from the version POINTER
|
|
83
|
+
* (EC-224), not the flat `state` enum — seeded from hydration and updated by
|
|
84
|
+
* {@link publishDocument}/{@link unpublishDocument}.
|
|
85
|
+
*/
|
|
86
|
+
isPublished(ref: DocumentRef): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Publish: snapshot the draft as a new version and pin it live (EC-224).
|
|
89
|
+
* Flips published-ness optimistically, then reconciles against the backend
|
|
90
|
+
* record (EC-225) so the badge can never claim a publish the backend refused
|
|
91
|
+
* (e.g. blocked by publish-time field validation).
|
|
92
|
+
*/
|
|
93
|
+
publishDocument(ref: DocumentRef): Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* Unpublish: clear the live version pin (EC-224). Blocked at the operations
|
|
96
|
+
* layer while strict relation fields published-reference it (EC-173); the
|
|
97
|
+
* optimistic flip reconciles against the backend on rejection (EC-225).
|
|
98
|
+
*/
|
|
99
|
+
unpublishDocument(ref: DocumentRef): Promise<void>;
|
|
100
|
+
/**
|
|
101
|
+
* Load this document's recorded version history + live pin (EC-224) for the
|
|
102
|
+
* Versions inspector pane. Fixture/playground sessions (no project) have no
|
|
103
|
+
* persisted history → an empty view. Failures surface as {@link persistError}.
|
|
104
|
+
*/
|
|
105
|
+
loadDocumentVersions(ref: DocumentRef): Promise<DocumentVersionsView>;
|
|
106
|
+
/**
|
|
107
|
+
* Restore a recorded version as the new working draft (EC-224): the operation
|
|
108
|
+
* snapshots the current draft first (so the rollback is itself undoable), then
|
|
109
|
+
* loads the chosen snapshot. Returns the restored draft (or null on
|
|
110
|
+
* failure/fixture session) so the open editor can adopt it.
|
|
111
|
+
*/
|
|
112
|
+
restoreDocumentVersion(ref: DocumentRef, version: number): Promise<CmsDocument | null>;
|
|
113
|
+
importDocuments(collectionId: string, docs: unknown[]): ImportReport;
|
|
114
|
+
validate(doc: CmsDocument): CmsValidationIssue[];
|
|
115
|
+
isFieldReadOnly(collectionId: string, field: FieldDef): boolean;
|
|
116
|
+
viewsOf(collectionId: string): SavedView[];
|
|
117
|
+
activeViewId(collectionId: string): string;
|
|
118
|
+
/** Switch views — resets the working table state to the view's state. */
|
|
119
|
+
setActiveView(collectionId: string, viewId: string): void;
|
|
120
|
+
/** The live table state (the active view's state plus unsaved edits). */
|
|
121
|
+
tableStateOf(collectionId: string): TableViewState;
|
|
122
|
+
/**
|
|
123
|
+
* Update the working state. Always pass an updater when deriving from the
|
|
124
|
+
* previous state — render-time snapshots go stale across rapid events.
|
|
125
|
+
*/
|
|
126
|
+
setTableState(collectionId: string, update: TableViewState | ((prev: TableViewState) => TableViewState)): void;
|
|
127
|
+
/** Does the working state diverge from the active view ("unsaved changes")? */
|
|
128
|
+
isViewDirty(collectionId: string): boolean;
|
|
129
|
+
/** Discard working-state edits, back to the active view. */
|
|
130
|
+
resetTableState(collectionId: string): void;
|
|
131
|
+
/** Persist the working state into the active named view. False on rejection. */
|
|
132
|
+
saveActiveView(collectionId: string): Promise<boolean>;
|
|
133
|
+
/** Persist the working state as a new named view and activate it. */
|
|
134
|
+
saveViewAs(collectionId: string, name: string): Promise<boolean>;
|
|
135
|
+
/** Delete a named view — a view-only operation; documents are never touched. */
|
|
136
|
+
deleteView(collectionId: string, viewId: string): Promise<boolean>;
|
|
137
|
+
/**
|
|
138
|
+
* Bulk publish/unpublish/delete (EC-169): one operations command PER item,
|
|
139
|
+
* per-item outcomes in the report — partial failure is enumerated, never
|
|
140
|
+
* silent. Only succeeded items mutate the session.
|
|
141
|
+
*/
|
|
142
|
+
runBulk(collectionId: string, ids: readonly string[], action: BulkAction): Promise<BulkReport>;
|
|
143
|
+
/**
|
|
144
|
+
* Mirror a collection into the session (e.g. an accepted AI-generated
|
|
145
|
+
* schema, EC-097). Replaces by id. Session-only: persistence happens through
|
|
146
|
+
* the accept flow's changeset (`schema.upsertCollection`), not here.
|
|
147
|
+
*/
|
|
148
|
+
addCollection(def: CollectionDef): void;
|
|
149
|
+
/**
|
|
150
|
+
* Most recent failed/denied persisted mutation (structured, from the
|
|
151
|
+
* operation result). Rendered by the CMS surface — never a silent failure.
|
|
152
|
+
*/
|
|
153
|
+
persistError: OperationError | null;
|
|
154
|
+
clearPersistError(): void;
|
|
155
|
+
/** Seed the persisted baseline now (e.g. before applying an AI changeset). */
|
|
156
|
+
ensurePersistedBaseline(): Promise<void>;
|
|
157
|
+
/** Await all queued persisted mutations (tests, publish flows). */
|
|
158
|
+
flushPersistence(): Promise<void>;
|
|
159
|
+
}
|
|
160
|
+
declare function primaryField(collection: CollectionDef): string;
|
|
161
|
+
/**
|
|
162
|
+
* The CMS session store (EC-141): documents and collections are optimistic,
|
|
163
|
+
* synchronous session state (live validation while typing); every mutation —
|
|
164
|
+
* create/save/delete/state transitions — is mirrored onto the operations
|
|
165
|
+
* layer (`documents.*` / `schema.*` commands) through {@link createCmsPersister}.
|
|
166
|
+
* Failed/denied commands surface as {@link CmsStore.persistError}.
|
|
167
|
+
*/
|
|
168
|
+
export declare function CmsProvider({ children, projectId, initialCollections, initialDocuments, initialPublishedKeys, initialLocaleConfig, }: {
|
|
169
|
+
children: ReactNode;
|
|
170
|
+
/** Enables persistence through the shared operations client. */
|
|
171
|
+
projectId?: string;
|
|
172
|
+
/** Seed collections (e.g. from an imported starter kit, EC-119); defaults to the samples. */
|
|
173
|
+
initialCollections?: CollectionDef[];
|
|
174
|
+
initialDocuments?: CmsDocument[];
|
|
175
|
+
/**
|
|
176
|
+
* Published document keys from hydration (EC-224): the version pointer
|
|
177
|
+
* (`publishedVersion` set). Absent (kit / fixture sessions) → the sample
|
|
178
|
+
* fixtures' published set (`samplePublishedKeys`).
|
|
179
|
+
*/
|
|
180
|
+
initialPublishedKeys?: readonly string[];
|
|
181
|
+
/** Locale config for the seeded content; defaults to the sample config. */
|
|
182
|
+
initialLocaleConfig?: LocaleConfig;
|
|
183
|
+
}): import("react").JSX.Element;
|
|
184
|
+
export declare function useCms(): CmsStore;
|
|
185
|
+
/** Export a locale-aware label for a field (form label or name). */
|
|
186
|
+
export declare function fieldLabel(field: FieldDef): string;
|
|
187
|
+
export { primaryField };
|
|
188
|
+
export type { Locale };
|