@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 @@
|
|
|
1
|
+
{"version":3,"file":"graph-commands.js","sourceRoot":"","sources":["../../../src/lib/operations/graph-commands.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAoEjD;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAChC,SAAiB,EACjB,MAAqB,EACrB,IAAqB,EACrB,IAA+B;IAE/B,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM,CAAC,CAAC,CAAC;YACZ,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,OAAO;gBAAE,OAAO,IAAI,CAAA;YAC9C,OAAO;gBACL,SAAS,EAAE,YAAY;gBACvB,KAAK,EAAE;oBACL,SAAS;oBACT,wDAAwD;oBACxD,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC;oBACnC,OAAO,EAAE,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;iBAClD;aACF,CAAA;QACH,CAAC;QAED,KAAK,WAAW;YACd,OAAO;gBACL,SAAS,EAAE,YAAY;gBACvB,uEA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AAiB,EACjB,YAAyC;IAEzC,MAAM,QAAQ,GAAG,MAAM,mBAAmB,CAAC,UAAU,EAAE,SAAS,EAAE,YAAY,CAAC,CAAA;IAC/E,IAAI,CAAC,QAAQ,CAAC,EAAE;QAAE,OAAO,QAAQ,CAAA;IACjC,OAAO,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC,CAAA;AACrD,CAAC;AAED,4DAA4D;AAC5D,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,UAA4B,EAC5B,SAAiB;IAEjB,OAAO,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,CAAA;AACvD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BuilderAction, BuilderSnapshot } from './graph-commands';
|
|
2
|
+
import type { WorkingGraph } from '../working-graph';
|
|
3
|
+
import type { OperationError, OperationsClient } from './operations-package';
|
|
4
|
+
/**
|
|
5
|
+
* Builder → operations persistence (EC-141). Mirrors every committed builder
|
|
6
|
+
* mutation onto the operations layer as the matching `graph.*` command, in
|
|
7
|
+
* dispatch order, against a guaranteed-identical baseline revision.
|
|
8
|
+
*
|
|
9
|
+
* Failures are *surfaced, never silent, and never block local editing*: a
|
|
10
|
+
* rejected/denied/failed command reaches `onError` (the store renders it) and
|
|
11
|
+
* invalidates the baseline, so the next mutation re-syncs — which re-surfaces
|
|
12
|
+
* a standing denial instead of silently dropping edits.
|
|
13
|
+
*/
|
|
14
|
+
export interface GraphPersister {
|
|
15
|
+
/** Queue the command mirroring a dispatched action (no-op for pure-UI actions). */
|
|
16
|
+
enqueue(action: BuilderAction, prev: BuilderSnapshot, next: {
|
|
17
|
+
present: WorkingGraph;
|
|
18
|
+
}): void;
|
|
19
|
+
/** Await every queued command (test/publish synchronization point). */
|
|
20
|
+
flush(): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export interface GraphPersisterOptions {
|
|
23
|
+
projectId: string;
|
|
24
|
+
getOperations: () => Promise<OperationsClient>;
|
|
25
|
+
onError: (error: OperationError) => void;
|
|
26
|
+
}
|
|
27
|
+
export declare function createGraphPersister(options: GraphPersisterOptions): GraphPersister;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ensureGraphBaseline, graphInvocationFor } from './graph-commands';
|
|
2
|
+
import { createPersistQueue } from './persist-queue';
|
|
3
|
+
export function createGraphPersister(options) {
|
|
4
|
+
const queue = createPersistQueue();
|
|
5
|
+
let baselineReady = false;
|
|
6
|
+
return {
|
|
7
|
+
enqueue(action, prev, next) {
|
|
8
|
+
const invocation = graphInvocationFor(options.projectId, action, prev, next);
|
|
9
|
+
if (!invocation)
|
|
10
|
+
return;
|
|
11
|
+
queue.push(async () => {
|
|
12
|
+
const operations = await options.getOperations();
|
|
13
|
+
// graph.save replaces the whole graph, so it *is* a baseline; the
|
|
14
|
+
// node-level commands need the persisted latest to equal the
|
|
15
|
+
// session's pre-edit graph first.
|
|
16
|
+
if (!baselineReady && invocation.operation !== 'graph.save') {
|
|
17
|
+
const baseline = await ensureGraphBaseline(operations, options.projectId, prev.present);
|
|
18
|
+
if (!baseline.ok) {
|
|
19
|
+
options.onError(baseline.error);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const result = await operations.execute(invocation.operation, invocation.input);
|
|
24
|
+
if (!result.ok) {
|
|
25
|
+
baselineReady = false;
|
|
26
|
+
options.onError(result.error);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
baselineReady = true;
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
flush: () => queue.flush(),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=graph-persistence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-persistence.js","sourceRoot":"","sources":["../../../src/lib/operations/graph-persistence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAA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CAAA;QACJ,CAAC;QACD,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE;KAC3B,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Studio operations layer (EC-141). The single seam every studio mutation
|
|
3
|
+
* goes through — see `studio-operations.ts` for the bootstrap and
|
|
4
|
+
* `operations-package.ts` for why the package is bridged by path.
|
|
5
|
+
*/
|
|
6
|
+
export * from './operations-package';
|
|
7
|
+
export * from './studio-operations';
|
|
8
|
+
export * from './persist-queue';
|
|
9
|
+
export * from './graph-commands';
|
|
10
|
+
export * from './graph-persistence';
|
|
11
|
+
export * from './cms-persistence';
|
|
12
|
+
export * from './asset-repository';
|
|
13
|
+
export * from './session-hydration';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Studio operations layer (EC-141). The single seam every studio mutation
|
|
3
|
+
* goes through — see `studio-operations.ts` for the bootstrap and
|
|
4
|
+
* `operations-package.ts` for why the package is bridged by path.
|
|
5
|
+
*/
|
|
6
|
+
export * from './operations-package';
|
|
7
|
+
export * from './studio-operations';
|
|
8
|
+
export * from './persist-queue';
|
|
9
|
+
export * from './graph-commands';
|
|
10
|
+
export * from './graph-persistence';
|
|
11
|
+
export * from './cms-persistence';
|
|
12
|
+
export * from './asset-repository';
|
|
13
|
+
export * from './session-hydration';
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/operations/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bridge to `@elytracms/operations` (EC-141). Every studio import of operations
|
|
3
|
+
* types/functions goes through `lib/operations`, keeping the app's dependency
|
|
4
|
+
* on the layer a single, swappable seam.
|
|
5
|
+
*/
|
|
6
|
+
export * from '@elytracms/operations';
|
|
7
|
+
//# sourceMappingURL=operations-package.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations-package.js","sourceRoot":"","sources":["../../../src/lib/operations/operations-package.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serial persistence queue (EC-141). Studio stores keep their working state
|
|
3
|
+
* optimistic (synchronous, in-memory) and mirror each mutation onto the
|
|
4
|
+
* operations layer; this queue guarantees the mirrored commands run strictly
|
|
5
|
+
* in dispatch order, one at a time, so the persisted timeline is deterministic.
|
|
6
|
+
*
|
|
7
|
+
* Tasks report their failures through their own structured channels
|
|
8
|
+
* (`OperationResult` handling inside the task); an unexpected *throw* is routed
|
|
9
|
+
* to `onTaskError` and never breaks the chain.
|
|
10
|
+
*/
|
|
11
|
+
export interface PersistQueue {
|
|
12
|
+
push(task: () => Promise<void>): void;
|
|
13
|
+
/** Await every task queued so far (drains work queued while awaiting too). */
|
|
14
|
+
flush(): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export declare function createPersistQueue(onTaskError?: (error: unknown) => void): PersistQueue;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function createPersistQueue(onTaskError) {
|
|
2
|
+
let pending = Promise.resolve();
|
|
3
|
+
return {
|
|
4
|
+
push(task) {
|
|
5
|
+
pending = pending.then(task).catch((error) => {
|
|
6
|
+
onTaskError?.(error);
|
|
7
|
+
});
|
|
8
|
+
},
|
|
9
|
+
async flush() {
|
|
10
|
+
let current;
|
|
11
|
+
do {
|
|
12
|
+
current = pending;
|
|
13
|
+
await current;
|
|
14
|
+
} while (current !== pending);
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=persist-queue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persist-queue.js","sourceRoot":"","sources":["../../../src/lib/operations/persist-queue.ts"],"names":[],"mappings":"AAgBA,MAAM,UAAU,kBAAkB,CAAC,WAAsC;IACvE,IAAI,OAAO,GAAkB,OAAO,CAAC,OAAO,EAAE,CAAA;IAC9C,OAAO;QACL,IAAI,CAAC,IAAI;YACP,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;gBACpD,WAAW,EAAE,CAAC,KAAK,CAAC,CAAA;YACtB,CAAC,CAAC,CAAA;QACJ,CAAC;QACD,KAAK,CAAC,KAAK;YACT,IAAI,OAAsB,CAAA;YAC1B,GAAG,CAAC;gBACF,OAAO,GAAG,OAAO,CAAA;gBACjB,MAAM,OAAO,CAAA;YACf,CAAC,QAAQ,OAAO,KAAK,OAAO,EAAC;QAC/B,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { ProjectGraph } from '@elytracms/project-graph';
|
|
2
|
+
import type { CmsDocument, CollectionDef } from '@elytracms/cms-core';
|
|
3
|
+
import type { AssetRecord } from '@elytracms/persistence';
|
|
4
|
+
import type { OperationResult, OperationsClient } from './operations-package';
|
|
5
|
+
/**
|
|
6
|
+
* Persisted-session hydration (Milestone B sign-off fix, EC-177 gap 1).
|
|
7
|
+
*
|
|
8
|
+
* Against a persistent backend (Convex mode) a studio session must BOOT from
|
|
9
|
+
* what is persisted — the latest graph revision, the saved CMS schema +
|
|
10
|
+
* documents, and the per-environment publishing state — and fall back to the
|
|
11
|
+
* deterministic fixtures only when the project has nothing persisted yet
|
|
12
|
+
* (first run). Before this, every session seeded from fixtures, so reloads
|
|
13
|
+
* hid the editor's work and the next publish pinned fixture-derived state
|
|
14
|
+
* over production.
|
|
15
|
+
*
|
|
16
|
+
* This module is the pure load half: read-only `@elytracms/operations` queries
|
|
17
|
+
* composed into one hydration result. `not-found` is a *normal* answer (the
|
|
18
|
+
* first-run fallback); every other failure propagates as the structured
|
|
19
|
+
* operation error so the gate renders it — never a silent fixture fallback.
|
|
20
|
+
* The React gate that applies it lives in
|
|
21
|
+
* `components/studio/project-session.tsx`; playground mode never calls this.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Collections owned by studio subsystems (data sources, saved views). They live
|
|
25
|
+
* in the same persisted schema but are NOT content: the CMS session, the
|
|
26
|
+
* sidebar, and the content preview engine must never offer them as authorable
|
|
27
|
+
* collections. Routes/redirects are NO LONGER system collections (EC-207): they
|
|
28
|
+
* are config-sourced and never persisted to the backend.
|
|
29
|
+
*/
|
|
30
|
+
export declare const STUDIO_SYSTEM_COLLECTION_IDS: ReadonlySet<string>;
|
|
31
|
+
/** The persisted CMS content of a project: schema + documents, system collections excluded. */
|
|
32
|
+
export interface HydratedCms {
|
|
33
|
+
collections: CollectionDef[];
|
|
34
|
+
documents: CmsDocument[];
|
|
35
|
+
/**
|
|
36
|
+
* Published document keys (EC-224), via the version pointer: a record is
|
|
37
|
+
* published iff `publishedVersion` is set. The session boots its
|
|
38
|
+
* `publishedKeys` from this — published-ness is the pointer, nothing else.
|
|
39
|
+
*/
|
|
40
|
+
publishedKeys: string[];
|
|
41
|
+
/**
|
|
42
|
+
* The project's asset records (the `assets` table — NOT cms `asset`-collection
|
|
43
|
+
* documents). The preview content engine wires these into its lookup so listing/
|
|
44
|
+
* relation results resolve their `asset`-typed FIELDS (e.g. a ProductGrid product's
|
|
45
|
+
* `gallery`) to delivery shape — matching what the renderer's `resolveAsset` already
|
|
46
|
+
* does for static `asset` props (EC-262). Without them, the studio canvas renders
|
|
47
|
+
* such nested images blank even though the documents reference real assets.
|
|
48
|
+
*/
|
|
49
|
+
assets: AssetRecord[];
|
|
50
|
+
}
|
|
51
|
+
/** The deployment's persisted publish, with the pinned revision's graph snapshot. */
|
|
52
|
+
export interface HydratedPublish {
|
|
53
|
+
/** The pinned graph revision number. */
|
|
54
|
+
revision: number;
|
|
55
|
+
/** Serialized graph of the pinned revision (collab version snapshot shape). */
|
|
56
|
+
serializedGraph: string;
|
|
57
|
+
publishedAt?: string;
|
|
58
|
+
}
|
|
59
|
+
/** Everything a Convex-mode session boots from. `null` fields mean "nothing persisted" (first run). */
|
|
60
|
+
export interface HydratedProjectSession {
|
|
61
|
+
/** The latest persisted graph revision's graph, or `null` when no revision exists. */
|
|
62
|
+
graph: ProjectGraph | null;
|
|
63
|
+
/** Persisted CMS schema + documents, or `null` when no content schema was ever saved. */
|
|
64
|
+
cms: HydratedCms | null;
|
|
65
|
+
/**
|
|
66
|
+
* The currently-published revision snapshot, or `null` when nothing is
|
|
67
|
+
* published. Single-environment (EC-179): a deployment IS one environment.
|
|
68
|
+
*/
|
|
69
|
+
publish: HydratedPublish | null;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Load the persisted CMS content state. `null` when the project has no
|
|
73
|
+
* persisted content schema (first run — the session seeds fixtures and the
|
|
74
|
+
* persister's baseline will persist them on the first edit). A schema that
|
|
75
|
+
* contains only studio system collections counts as "no content persisted":
|
|
76
|
+
* system stores (saved views, routes) may create the schema record before any
|
|
77
|
+
* content baseline ran.
|
|
78
|
+
*/
|
|
79
|
+
export declare function loadHydratedCms(operations: OperationsClient, projectId: string): Promise<OperationResult<HydratedCms | null>>;
|
|
80
|
+
/**
|
|
81
|
+
* Load everything a project session hydrates from: latest graph, CMS content,
|
|
82
|
+
* and the currently-published revision snapshot (single-environment, EC-179).
|
|
83
|
+
*/
|
|
84
|
+
export declare function loadProjectSession(operations: OperationsClient, projectId: string): Promise<OperationResult<HydratedProjectSession>>;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { serializeProjectGraph } from '@elytracms/project-graph';
|
|
2
|
+
import { documentKey } from '@elytracms/cms-core';
|
|
3
|
+
import { DATA_SOURCES_COLLECTION } from '../data/sources-store';
|
|
4
|
+
import { VIEWS_COLLECTION } from '../cms-views/views-store';
|
|
5
|
+
/**
|
|
6
|
+
* Persisted-session hydration (Milestone B sign-off fix, EC-177 gap 1).
|
|
7
|
+
*
|
|
8
|
+
* Against a persistent backend (Convex mode) a studio session must BOOT from
|
|
9
|
+
* what is persisted — the latest graph revision, the saved CMS schema +
|
|
10
|
+
* documents, and the per-environment publishing state — and fall back to the
|
|
11
|
+
* deterministic fixtures only when the project has nothing persisted yet
|
|
12
|
+
* (first run). Before this, every session seeded from fixtures, so reloads
|
|
13
|
+
* hid the editor's work and the next publish pinned fixture-derived state
|
|
14
|
+
* over production.
|
|
15
|
+
*
|
|
16
|
+
* This module is the pure load half: read-only `@elytracms/operations` queries
|
|
17
|
+
* composed into one hydration result. `not-found` is a *normal* answer (the
|
|
18
|
+
* first-run fallback); every other failure propagates as the structured
|
|
19
|
+
* operation error so the gate renders it — never a silent fixture fallback.
|
|
20
|
+
* The React gate that applies it lives in
|
|
21
|
+
* `components/studio/project-session.tsx`; playground mode never calls this.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Collections owned by studio subsystems (data sources, saved views). They live
|
|
25
|
+
* in the same persisted schema but are NOT content: the CMS session, the
|
|
26
|
+
* sidebar, and the content preview engine must never offer them as authorable
|
|
27
|
+
* collections. Routes/redirects are NO LONGER system collections (EC-207): they
|
|
28
|
+
* are config-sourced and never persisted to the backend.
|
|
29
|
+
*/
|
|
30
|
+
export const STUDIO_SYSTEM_COLLECTION_IDS = new Set([
|
|
31
|
+
DATA_SOURCES_COLLECTION,
|
|
32
|
+
VIEWS_COLLECTION,
|
|
33
|
+
]);
|
|
34
|
+
/**
|
|
35
|
+
* Load the persisted CMS content state. `null` when the project has no
|
|
36
|
+
* persisted content schema (first run — the session seeds fixtures and the
|
|
37
|
+
* persister's baseline will persist them on the first edit). A schema that
|
|
38
|
+
* contains only studio system collections counts as "no content persisted":
|
|
39
|
+
* system stores (saved views, routes) may create the schema record before any
|
|
40
|
+
* content baseline ran.
|
|
41
|
+
*/
|
|
42
|
+
export async function loadHydratedCms(operations, projectId) {
|
|
43
|
+
const schema = await operations.schema.get({ projectId });
|
|
44
|
+
if (!schema.ok) {
|
|
45
|
+
return schema.error.code === 'not-found' ? { ok: true, value: null } : schema;
|
|
46
|
+
}
|
|
47
|
+
const collections = schema.value.collections.filter((collection) => !STUDIO_SYSTEM_COLLECTION_IDS.has(collection.id));
|
|
48
|
+
if (collections.length === 0)
|
|
49
|
+
return { ok: true, value: null };
|
|
50
|
+
const documents = await operations.documents.list({ projectId });
|
|
51
|
+
if (!documents.ok)
|
|
52
|
+
return documents;
|
|
53
|
+
// The project's asset records (assets table), wired into the preview lookup so
|
|
54
|
+
// listing/relation results resolve their nested `asset` fields (EC-262). Non-fatal:
|
|
55
|
+
// a failed asset list degrades previews to no images, never blocks the session.
|
|
56
|
+
const assets = await operations.assets.list({ projectId });
|
|
57
|
+
const contentIds = new Set(collections.map((collection) => collection.id));
|
|
58
|
+
const contentRecords = documents.value.filter((record) => contentIds.has(record.document.collection));
|
|
59
|
+
// EC-224: a record is published when its version pointer is set — the same
|
|
60
|
+
// gate delivery reads. There is no flat-state fallback (the field is gone).
|
|
61
|
+
const isRecordPublished = (record) => record.publishedVersion !== undefined;
|
|
62
|
+
return {
|
|
63
|
+
ok: true,
|
|
64
|
+
value: {
|
|
65
|
+
collections,
|
|
66
|
+
// The live row hydrates AS PERSISTED — a continuous draft (EC-224). We no
|
|
67
|
+
// longer stamp a `state:'published'` mirror: published-ness is the version
|
|
68
|
+
// pointer (`publishedKeys`), which every studio reader now consults (the
|
|
69
|
+
// table badge/$state via `isPublished`, the preview engine via the pin).
|
|
70
|
+
documents: contentRecords.map((record) => record.document),
|
|
71
|
+
publishedKeys: contentRecords
|
|
72
|
+
.filter(isRecordPublished)
|
|
73
|
+
.map((record) => documentKey(record.document)),
|
|
74
|
+
assets: assets.ok ? assets.value : [],
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Load everything a project session hydrates from: latest graph, CMS content,
|
|
80
|
+
* and the currently-published revision snapshot (single-environment, EC-179).
|
|
81
|
+
*/
|
|
82
|
+
export async function loadProjectSession(operations, projectId) {
|
|
83
|
+
const latest = await operations.graph.getLatest({ projectId });
|
|
84
|
+
if (!latest.ok && latest.error.code !== 'not-found')
|
|
85
|
+
return latest;
|
|
86
|
+
const graph = latest.ok ? latest.value.graph : null;
|
|
87
|
+
const cms = await loadHydratedCms(operations, projectId);
|
|
88
|
+
if (!cms.ok)
|
|
89
|
+
return cms;
|
|
90
|
+
const state = await operations.publishing.getState({ projectId });
|
|
91
|
+
if (!state.ok)
|
|
92
|
+
return state;
|
|
93
|
+
let publish = null;
|
|
94
|
+
if (state.value &&
|
|
95
|
+
state.value.status === 'published' &&
|
|
96
|
+
state.value.publishedRevision !== undefined) {
|
|
97
|
+
const publishedRevision = state.value.publishedRevision;
|
|
98
|
+
const revision = await operations.graph.getRevision({ projectId, revision: publishedRevision });
|
|
99
|
+
if (!revision.ok && revision.error.code !== 'not-found')
|
|
100
|
+
return revision;
|
|
101
|
+
// A dangling pin (revision record gone) leaves `publish` null, not fatal.
|
|
102
|
+
if (revision.ok) {
|
|
103
|
+
publish = {
|
|
104
|
+
revision: publishedRevision,
|
|
105
|
+
serializedGraph: serializeProjectGraph(revision.value.graph),
|
|
106
|
+
...(state.value.publishedAt !== undefined ? { publishedAt: state.value.publishedAt } : {}),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return { ok: true, value: { graph, cms: cms.value, publish } };
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=session-hydration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-hydration.js","sourceRoot":"","sources":["../../../src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CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC3F,CAAA;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAA;AAChE,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { PersistenceAdapter } from '@elytracms/persistence';
|
|
2
|
+
import type { ChangesetOperations, OperationsClient, Principal, ReferenceIndexAttachment } from './operations-package';
|
|
3
|
+
/**
|
|
4
|
+
* The studio's single operations bootstrap (EC-141, vision AD-7).
|
|
5
|
+
*
|
|
6
|
+
* One `OperationsClient` + one `ChangesetOperations` instance, built over the
|
|
7
|
+
* selected persistence adapter, shared by every store and surface in the app.
|
|
8
|
+
* The UI never talks to a repository for writes — every mutation is a typed
|
|
9
|
+
* operation command (validate → authorize → mutate → event), so the studio
|
|
10
|
+
* dogfoods the same seam plugins, AI changesets, and the CLI use.
|
|
11
|
+
*
|
|
12
|
+
* The EC-155 reference index is attached to the shared event bus here, so any
|
|
13
|
+
* document/graph/publishing command issued anywhere in the studio keeps the
|
|
14
|
+
* index maintained.
|
|
15
|
+
*/
|
|
16
|
+
export interface StudioOperations {
|
|
17
|
+
readonly operations: OperationsClient;
|
|
18
|
+
readonly changesets: ChangesetOperations;
|
|
19
|
+
/**
|
|
20
|
+
* The raw adapter, exposed for *transport and read paths only*: blob byte
|
|
21
|
+
* upload/download (`adapter.blobs`) and existing read stores. Studio code
|
|
22
|
+
* must not call repository write methods on it — writes go through
|
|
23
|
+
* `operations`.
|
|
24
|
+
*/
|
|
25
|
+
readonly adapter: PersistenceAdapter;
|
|
26
|
+
/** EC-155 maintained-on-write index attachment (flushable in tests). */
|
|
27
|
+
readonly references: ReferenceIndexAttachment;
|
|
28
|
+
}
|
|
29
|
+
export interface CreateStudioOperationsOptions {
|
|
30
|
+
/**
|
|
31
|
+
* The signed-in principal (EC-150). When present, the EC-150 role hook
|
|
32
|
+
* (`createRoleAuthorization` over `adapter.members`) becomes the
|
|
33
|
+
* authorization chokepoint for every command and query — viewers get
|
|
34
|
+
* structured denials on mutations, editors on administration. Without an
|
|
35
|
+
* actor the client runs pass-through (seeds, fixtures, tests that exercise
|
|
36
|
+
* domain logic rather than permissions); the route guard keeps
|
|
37
|
+
* unauthenticated users away from every operation surface.
|
|
38
|
+
*/
|
|
39
|
+
actor?: Principal;
|
|
40
|
+
}
|
|
41
|
+
/** Build a studio operations bundle over an adapter (exported for tests). */
|
|
42
|
+
export declare function createStudioOperations(adapter: PersistenceAdapter, options?: CreateStudioOperationsOptions): StudioOperations;
|
|
43
|
+
/**
|
|
44
|
+
* The shared studio operations client for the active backend (lazily
|
|
45
|
+
* bootstrapped, cached per deployment). In-memory mode this owns the one seeded
|
|
46
|
+
* adapter the whole session mutates; against Convex it owns one client per
|
|
47
|
+
* deployment — the active project (EC-179) selects which.
|
|
48
|
+
*/
|
|
49
|
+
export declare function getStudioOperations(): Promise<StudioOperations>;
|
|
50
|
+
/**
|
|
51
|
+
* Bind (or clear) the session principal (EC-150). Called by the auth context
|
|
52
|
+
* on sign-in/sign-out. Rebuilds the operations clients over the *same* adapters
|
|
53
|
+
* — the persisted state (and, in-memory, the whole session's edits) survives;
|
|
54
|
+
* only the authorization identity changes. All cached backends are rebuilt so a
|
|
55
|
+
* later switch picks up the new actor too.
|
|
56
|
+
*/
|
|
57
|
+
export declare function setStudioSession(actor: Principal | null): void;
|
|
58
|
+
/** Test seam: replace (or clear) the singleton for the active backend. */
|
|
59
|
+
export declare function setStudioOperationsForTests(next: StudioOperations | null): void;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { activeDeploymentKey, selectPersistenceAdapter } from '../persistence';
|
|
2
|
+
import { studioManifestLookup } from '../registry';
|
|
3
|
+
import { attachConfiguredRevalidationWebhooks } from '../webhooks';
|
|
4
|
+
import { attachReferenceIndex, createChangesets, createOperations, createRoleAuthorization, } from './operations-package';
|
|
5
|
+
/** Build a studio operations bundle over an adapter (exported for tests). */
|
|
6
|
+
export function createStudioOperations(adapter, options = {}) {
|
|
7
|
+
const authorized = options.actor
|
|
8
|
+
? { actor: options.actor, authorize: createRoleAuthorization(adapter.members) }
|
|
9
|
+
: {};
|
|
10
|
+
const operations = createOperations({ adapter, ...authorized });
|
|
11
|
+
// EC-190: thread the live registry as a manifest lookup so relation/asset
|
|
12
|
+
// props inside compositions index field-type-driven (manifests are code,
|
|
13
|
+
// AD-11 — persistence never depends on the registry).
|
|
14
|
+
const references = attachReferenceIndex(operations.events, adapter, {
|
|
15
|
+
lookupManifest: studioManifestLookup(),
|
|
16
|
+
});
|
|
17
|
+
const changesets = createChangesets({ adapter, events: operations.events, ...authorized });
|
|
18
|
+
// EC-146 instant publish: when a host revalidate endpoint is configured via
|
|
19
|
+
// env, every successful publish-shaped command (document upsert/delete/
|
|
20
|
+
// setState, graph publish/unpublish) fires a signed revalidation webhook.
|
|
21
|
+
// No env (dev/tests) → no-op.
|
|
22
|
+
attachConfiguredRevalidationWebhooks(operations.events);
|
|
23
|
+
return { operations, changesets, adapter, references };
|
|
24
|
+
}
|
|
25
|
+
// One adapter + one operations bundle per backend (EC-179): keyed by the active
|
|
26
|
+
// deployment so switching to a project on another Convex deployment selects (or
|
|
27
|
+
// lazily builds) that backend's client, rather than reusing the first one.
|
|
28
|
+
const adaptersByKey = new Map();
|
|
29
|
+
const instancesByKey = new Map();
|
|
30
|
+
let currentActor = null;
|
|
31
|
+
/**
|
|
32
|
+
* The active backend key, tolerant of an unconfigured env: the real app never
|
|
33
|
+
* reaches `getStudioOperations` while misconfigured (the `BackendGate` renders a
|
|
34
|
+
* boot error first), but tests inject a bundle directly via the seam below — so
|
|
35
|
+
* a missing backend resolves to one stable key rather than throwing.
|
|
36
|
+
*/
|
|
37
|
+
function deploymentKey() {
|
|
38
|
+
try {
|
|
39
|
+
return activeDeploymentKey();
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return '__unconfigured__';
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function getAdapter(key) {
|
|
46
|
+
let adapter = adaptersByKey.get(key);
|
|
47
|
+
if (!adapter) {
|
|
48
|
+
adapter = selectPersistenceAdapter();
|
|
49
|
+
adaptersByKey.set(key, adapter);
|
|
50
|
+
}
|
|
51
|
+
return adapter;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The shared studio operations client for the active backend (lazily
|
|
55
|
+
* bootstrapped, cached per deployment). In-memory mode this owns the one seeded
|
|
56
|
+
* adapter the whole session mutates; against Convex it owns one client per
|
|
57
|
+
* deployment — the active project (EC-179) selects which.
|
|
58
|
+
*/
|
|
59
|
+
export function getStudioOperations() {
|
|
60
|
+
const key = deploymentKey();
|
|
61
|
+
let instance = instancesByKey.get(key);
|
|
62
|
+
if (!instance) {
|
|
63
|
+
const actor = currentActor;
|
|
64
|
+
instance = getAdapter(key).then((adapter) => createStudioOperations(adapter, actor ? { actor } : {}));
|
|
65
|
+
instancesByKey.set(key, instance);
|
|
66
|
+
}
|
|
67
|
+
return instance;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Bind (or clear) the session principal (EC-150). Called by the auth context
|
|
71
|
+
* on sign-in/sign-out. Rebuilds the operations clients over the *same* adapters
|
|
72
|
+
* — the persisted state (and, in-memory, the whole session's edits) survives;
|
|
73
|
+
* only the authorization identity changes. All cached backends are rebuilt so a
|
|
74
|
+
* later switch picks up the new actor too.
|
|
75
|
+
*/
|
|
76
|
+
export function setStudioSession(actor) {
|
|
77
|
+
if (currentActor?.id === actor?.id)
|
|
78
|
+
return; // same user (or both null) — keep the clients
|
|
79
|
+
currentActor = actor;
|
|
80
|
+
instancesByKey.clear();
|
|
81
|
+
}
|
|
82
|
+
/** Test seam: replace (or clear) the singleton for the active backend. */
|
|
83
|
+
export function setStudioOperationsForTests(next) {
|
|
84
|
+
if (next) {
|
|
85
|
+
instancesByKey.set(deploymentKey(), Promise.resolve(next));
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
instancesByKey.clear();
|
|
89
|
+
adaptersByKey.clear();
|
|
90
|
+
currentActor = null;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=studio-operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"studio-operations.js","sourceRoot":"","sources":["../../../src/lib/operations/studio-operations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,oCAAoC,EAAE,MAAM,aAAa,CAAA;AAClE,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,sBAAsB,CAAA;AAgD7B,6EAA6E;AAC7E,MAAM,UAAU,sBAAsB,CACpC,OAA2B,EAC3B,UAAyC,EAAE;IAE3C,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK;QAC9B,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,uBAAuB,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC/E,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,UAAU,GAAG,gBAAgB,CAAC,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,CAAC,CAAA;IAC/D,0EAA0E;IAC1E,yEAAyE;IACzE,sDAAsD;IACtD,MAAM,UAAU,GAAG,oBAAoB,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE;QAClE,cAAc,EAAE,oBAAoB,EAAE;KACvC,CAAC,CAAA;IACF,MAAM,UAAU,GAAG,gBAAgB,CAAC,EAAE,OAAO,EAAE,MAAM,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C,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CACxD,CAAA;QACD,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;IACnC,CAAC;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAuB;IACtD,IAAI,YAAY,EAAE,EAAE,KAAK,KAAK,EAAE,EAAE;QAAE,OAAM,CAAC,8CAA8C;IACzF,YAAY,GAAG,KAAK,CAAA;IACpB,cAAc,CAAC,KAAK,EAAE,CAAA;AACxB,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,2BAA2B,CAAC,IAA6B;IACvE,IAAI,IAAI,EAAE,CAAC;QACT,cAAc,CAAC,GAAG,CAAC,aAAa,EAAE,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;QAC1D,OAAM;IACR,CAAC;IACD,cAAc,CAAC,KAAK,EAAE,CAAA;IACtB,aAAa,CAAC,KAAK,EAAE,CAAA;IACrB,YAAY,GAAG,IAAI,CAAA;AACrB,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Studio backend mode resolution (EC-153). Convex is the **default and primary**
|
|
3
|
+
* persistence backend; the deterministic in-memory adapter is demoted to an
|
|
4
|
+
* explicit, labeled **playground** mode and is never an automatic fallback:
|
|
5
|
+
*
|
|
6
|
+
* - `VITE_CONVEX_URL` set → Convex mode (the production/dev default).
|
|
7
|
+
* - `VITE_ELYTRA_MODE=playground` → playground mode (seeded in-memory adapter,
|
|
8
|
+
* local + ephemeral). The flag wins over a configured URL — explicit beats
|
|
9
|
+
* implicit — so a checked-out `.env.local` can be flipped without deleting it.
|
|
10
|
+
* - Neither → **misconfigured**: the studio renders a deterministic boot-error
|
|
11
|
+
* screen (see `BackendGate`) telling the developer exactly what to set.
|
|
12
|
+
* Likewise, a Convex backend that is unreachable at runtime is a visible
|
|
13
|
+
* error state — the studio never silently swaps in in-memory storage.
|
|
14
|
+
*/
|
|
15
|
+
export declare const MODE_ENV_VAR = "VITE_ELYTRA_MODE";
|
|
16
|
+
export declare const PLAYGROUND_MODE = "playground";
|
|
17
|
+
export declare const CONVEX_URL_ENV_VAR = "VITE_CONVEX_URL";
|
|
18
|
+
export type StudioBackendMode = 'convex' | 'playground';
|
|
19
|
+
export type StudioBackendConfig = {
|
|
20
|
+
kind: 'convex';
|
|
21
|
+
url: string;
|
|
22
|
+
} | {
|
|
23
|
+
kind: 'playground';
|
|
24
|
+
} | {
|
|
25
|
+
kind: 'misconfigured';
|
|
26
|
+
reason: 'missing-convex-url' | 'unknown-mode';
|
|
27
|
+
detail: string;
|
|
28
|
+
};
|
|
29
|
+
/** The studio's env surface: Vite client env first, Node/SSR env second. */
|
|
30
|
+
export type EnvRecord = Record<string, string | undefined>;
|
|
31
|
+
/**
|
|
32
|
+
* Test seam: pin the env the selectors see. `vi.stubEnv` cannot reach the
|
|
33
|
+
* `import.meta.env` snapshot Vitest hands this module, so suites that exercise
|
|
34
|
+
* `selectPersistenceAdapter`/`selectAuthAdapter` against specific configurations
|
|
35
|
+
* use this instead — keeping results independent of any developer `.env.local`.
|
|
36
|
+
*/
|
|
37
|
+
export declare function setStudioEnvOverrideForTests(env: EnvRecord | null): void;
|
|
38
|
+
/** Resolve the configured studio env (Vite client env wins over process.env). */
|
|
39
|
+
export declare function studioEnv(): EnvRecord;
|
|
40
|
+
/**
|
|
41
|
+
* Pure mode decision — testable with a plain env record. The app calls it with
|
|
42
|
+
* {@link studioEnv}; `CONVEX_URL` (Node-side alias) is honored for SSR/tools.
|
|
43
|
+
*/
|
|
44
|
+
export declare function resolveBackendConfig(env?: EnvRecord): StudioBackendConfig;
|
|
45
|
+
/** True when the studio runs in the explicit, labeled playground mode. */
|
|
46
|
+
export declare function isPlaygroundMode(): boolean;
|
|
47
|
+
/** `email:password` for unattended dev sign-in (gitignored `.env.local`). */
|
|
48
|
+
export declare const DEV_LOGIN_ENV_VAR = "VITE_ELYTRA_DEV_LOGIN";
|
|
49
|
+
/** Parsed dev auto-login credentials. */
|
|
50
|
+
export interface DevAutoLoginCredentials {
|
|
51
|
+
email: string;
|
|
52
|
+
password: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Dev-only unattended auth — **not a bypass**. When `VITE_ELYTRA_DEV_LOGIN=
|
|
56
|
+
* email:password` is set in a dev build, the studio auto-signs-in with those
|
|
57
|
+
* credentials on load (see {@link DevAutoLoginAdapter}) so local/automated
|
|
58
|
+
* testing skips the sign-in screen while still establishing a REAL backend
|
|
59
|
+
* session: Convex's server-side `requireRole` guards still apply, so the dev
|
|
60
|
+
* user must exist and be a member. Returns null in production builds (gated by
|
|
61
|
+
* {@link isViteDevBuild}) and when unset/malformed, so it can never weaken a
|
|
62
|
+
* deployed app. `isDevBuild` is a parameter purely so the decision is unit
|
|
63
|
+
* testable (`import.meta.env.DEV` is not reachable via `vi.stubEnv`).
|
|
64
|
+
*
|
|
65
|
+
* `password` may itself contain `:` — only the first colon separates the fields.
|
|
66
|
+
*/
|
|
67
|
+
export declare function resolveDevAutoLogin(env?: EnvRecord, isDevBuild?: boolean): DevAutoLoginCredentials | null;
|
|
68
|
+
/** True when dev auto-login is configured (dev build only) — for the UI marker. */
|
|
69
|
+
export declare function isDevAutoLoginActive(): boolean;
|