@elytracms/core 0.0.6
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/dist/clipboard/build.d.ts +77 -0
- package/dist/clipboard/build.js +128 -0
- package/dist/clipboard/build.js.map +1 -0
- package/dist/clipboard/clipboard.d.ts +33 -0
- package/dist/clipboard/clipboard.js +45 -0
- package/dist/clipboard/clipboard.js.map +1 -0
- package/dist/clipboard/fragment.d.ts +112 -0
- package/dist/clipboard/fragment.js +79 -0
- package/dist/clipboard/fragment.js.map +1 -0
- package/dist/clipboard/html.d.ts +26 -0
- package/dist/clipboard/html.js +82 -0
- package/dist/clipboard/html.js.map +1 -0
- package/dist/clipboard/index.d.ts +15 -0
- package/dist/clipboard/index.js +16 -0
- package/dist/clipboard/index.js.map +1 -0
- package/dist/clipboard/references.d.ts +50 -0
- package/dist/clipboard/references.js +0 -0
- package/dist/clipboard/references.js.map +1 -0
- package/dist/clipboard/serialize.d.ts +69 -0
- package/dist/clipboard/serialize.js +130 -0
- package/dist/clipboard/serialize.js.map +1 -0
- package/dist/cms-core/collections.d.ts +82 -0
- package/dist/cms-core/collections.js +187 -0
- package/dist/cms-core/collections.js.map +1 -0
- package/dist/cms-core/documents.d.ts +71 -0
- package/dist/cms-core/documents.js +67 -0
- package/dist/cms-core/documents.js.map +1 -0
- package/dist/cms-core/envelopes.d.ts +80 -0
- package/dist/cms-core/envelopes.js +124 -0
- package/dist/cms-core/envelopes.js.map +1 -0
- package/dist/cms-core/fields.d.ts +220 -0
- package/dist/cms-core/fields.js +250 -0
- package/dist/cms-core/fields.js.map +1 -0
- package/dist/cms-core/fixtures.d.ts +92 -0
- package/dist/cms-core/fixtures.js +357 -0
- package/dist/cms-core/fixtures.js.map +1 -0
- package/dist/cms-core/hierarchy.d.ts +113 -0
- package/dist/cms-core/hierarchy.js +223 -0
- package/dist/cms-core/hierarchy.js.map +1 -0
- package/dist/cms-core/index.d.ts +25 -0
- package/dist/cms-core/index.js +26 -0
- package/dist/cms-core/index.js.map +1 -0
- package/dist/cms-core/infer.d.ts +103 -0
- package/dist/cms-core/infer.js +57 -0
- package/dist/cms-core/infer.js.map +1 -0
- package/dist/cms-core/issues.d.ts +92 -0
- package/dist/cms-core/issues.js +74 -0
- package/dist/cms-core/issues.js.map +1 -0
- package/dist/cms-core/json-schema.d.ts +25 -0
- package/dist/cms-core/json-schema.js +110 -0
- package/dist/cms-core/json-schema.js.map +1 -0
- package/dist/cms-core/localization.d.ts +51 -0
- package/dist/cms-core/localization.js +89 -0
- package/dist/cms-core/localization.js.map +1 -0
- package/dist/cms-core/routes.d.ts +76 -0
- package/dist/cms-core/routes.js +220 -0
- package/dist/cms-core/routes.js.map +1 -0
- package/dist/cms-core/self-type.d.ts +41 -0
- package/dist/cms-core/self-type.js +191 -0
- package/dist/cms-core/self-type.js.map +1 -0
- package/dist/cms-core/url-for-document.d.ts +39 -0
- package/dist/cms-core/url-for-document.js +138 -0
- package/dist/cms-core/url-for-document.js.map +1 -0
- package/dist/cms-core/validate-document.d.ts +121 -0
- package/dist/cms-core/validate-document.js +871 -0
- package/dist/cms-core/validate-document.js.map +1 -0
- package/dist/cms-core/versions.d.ts +75 -0
- package/dist/cms-core/versions.js +97 -0
- package/dist/cms-core/versions.js.map +1 -0
- package/dist/collaboration/approval.d.ts +68 -0
- package/dist/collaboration/approval.js +104 -0
- package/dist/collaboration/approval.js.map +1 -0
- package/dist/collaboration/collaboration.d.ts +49 -0
- package/dist/collaboration/collaboration.js +56 -0
- package/dist/collaboration/collaboration.js.map +1 -0
- package/dist/collaboration/comments.d.ts +72 -0
- package/dist/collaboration/comments.js +118 -0
- package/dist/collaboration/comments.js.map +1 -0
- package/dist/collaboration/core.d.ts +25 -0
- package/dist/collaboration/core.js +26 -0
- package/dist/collaboration/core.js.map +1 -0
- package/dist/collaboration/index.d.ts +14 -0
- package/dist/collaboration/index.js +15 -0
- package/dist/collaboration/index.js.map +1 -0
- package/dist/collaboration/presence.d.ts +62 -0
- package/dist/collaboration/presence.js +85 -0
- package/dist/collaboration/presence.js.map +1 -0
- package/dist/collaboration/publishing.d.ts +60 -0
- package/dist/collaboration/publishing.js +93 -0
- package/dist/collaboration/publishing.js.map +1 -0
- package/dist/collaboration/versions.d.ts +52 -0
- package/dist/collaboration/versions.js +81 -0
- package/dist/collaboration/versions.js.map +1 -0
- package/dist/component-registry/index.d.ts +3 -0
- package/dist/component-registry/index.js +4 -0
- package/dist/component-registry/index.js.map +1 -0
- package/dist/component-registry/issues.d.ts +6 -0
- package/dist/component-registry/issues.js +2 -0
- package/dist/component-registry/issues.js.map +1 -0
- package/dist/component-registry/manifest.d.ts +164 -0
- package/dist/component-registry/manifest.js +129 -0
- package/dist/component-registry/manifest.js.map +1 -0
- package/dist/component-registry/registry.d.ts +33 -0
- package/dist/component-registry/registry.js +90 -0
- package/dist/component-registry/registry.js.map +1 -0
- package/dist/content/__fixtures__/filterable-collections.d.ts +14 -0
- package/dist/content/__fixtures__/filterable-collections.js +15 -0
- package/dist/content/__fixtures__/filterable-collections.js.map +1 -0
- package/dist/content/__fixtures__/sample-accessor-types.d.ts +56 -0
- package/dist/content/__fixtures__/sample-accessor-types.js +5 -0
- package/dist/content/__fixtures__/sample-accessor-types.js.map +1 -0
- package/dist/content/__fixtures__/sample-delivery-types.d.ts +122 -0
- package/dist/content/__fixtures__/sample-delivery-types.js +5 -0
- package/dist/content/__fixtures__/sample-delivery-types.js.map +1 -0
- package/dist/content/assets.d.ts +53 -0
- package/dist/content/assets.js +38 -0
- package/dist/content/assets.js.map +1 -0
- package/dist/content/binding-sources.d.ts +53 -0
- package/dist/content/binding-sources.js +73 -0
- package/dist/content/binding-sources.js.map +1 -0
- package/dist/content/client.d.ts +90 -0
- package/dist/content/client.js +383 -0
- package/dist/content/client.js.map +1 -0
- package/dist/content/codegen.d.ts +54 -0
- package/dist/content/codegen.js +305 -0
- package/dist/content/codegen.js.map +1 -0
- package/dist/content/context.d.ts +38 -0
- package/dist/content/context.js +21 -0
- package/dist/content/context.js.map +1 -0
- package/dist/content/cursor.d.ts +33 -0
- package/dist/content/cursor.js +104 -0
- package/dist/content/cursor.js.map +1 -0
- package/dist/content/index.d.ts +28 -0
- package/dist/content/index.js +29 -0
- package/dist/content/index.js.map +1 -0
- package/dist/content/locale.d.ts +30 -0
- package/dist/content/locale.js +26 -0
- package/dist/content/locale.js.map +1 -0
- package/dist/content/perspective.d.ts +29 -0
- package/dist/content/perspective.js +31 -0
- package/dist/content/perspective.js.map +1 -0
- package/dist/content/populate.d.ts +25 -0
- package/dist/content/populate.js +22 -0
- package/dist/content/populate.js.map +1 -0
- package/dist/content/query.d.ts +122 -0
- package/dist/content/query.js +257 -0
- package/dist/content/query.js.map +1 -0
- package/dist/content/raw.d.ts +13 -0
- package/dist/content/raw.js +14 -0
- package/dist/content/raw.js.map +1 -0
- package/dist/content/resolve.d.ts +97 -0
- package/dist/content/resolve.js +261 -0
- package/dist/content/resolve.js.map +1 -0
- package/dist/content/serialize.d.ts +30 -0
- package/dist/content/serialize.js +57 -0
- package/dist/content/serialize.js.map +1 -0
- package/dist/content/tags.d.ts +54 -0
- package/dist/content/tags.js +40 -0
- package/dist/content/tags.js.map +1 -0
- package/dist/data-binding/fixtures.d.ts +20 -0
- package/dist/data-binding/fixtures.js +47 -0
- package/dist/data-binding/fixtures.js.map +1 -0
- package/dist/data-binding/index.d.ts +14 -0
- package/dist/data-binding/index.js +15 -0
- package/dist/data-binding/index.js.map +1 -0
- package/dist/data-binding/issues.d.ts +45 -0
- package/dist/data-binding/issues.js +46 -0
- package/dist/data-binding/issues.js.map +1 -0
- package/dist/data-binding/resolve.d.ts +87 -0
- package/dist/data-binding/resolve.js +204 -0
- package/dist/data-binding/resolve.js.map +1 -0
- package/dist/data-binding/sample.d.ts +21 -0
- package/dist/data-binding/sample.js +23 -0
- package/dist/data-binding/sample.js.map +1 -0
- package/dist/data-binding/sources.d.ts +225 -0
- package/dist/data-binding/sources.js +154 -0
- package/dist/data-binding/sources.js.map +1 -0
- package/dist/data-binding/tokens.d.ts +62 -0
- package/dist/data-binding/tokens.js +150 -0
- package/dist/data-binding/tokens.js.map +1 -0
- package/dist/design-tokens/css.d.ts +34 -0
- package/dist/design-tokens/css.js +51 -0
- package/dist/design-tokens/css.js.map +1 -0
- package/dist/design-tokens/index.d.ts +10 -0
- package/dist/design-tokens/index.js +11 -0
- package/dist/design-tokens/index.js.map +1 -0
- package/dist/design-tokens/style-guide.d.ts +30 -0
- package/dist/design-tokens/style-guide.js +31 -0
- package/dist/design-tokens/style-guide.js.map +1 -0
- package/dist/design-tokens/tokens.d.ts +89 -0
- package/dist/design-tokens/tokens.js +112 -0
- package/dist/design-tokens/tokens.js.map +1 -0
- package/dist/export-sync/builder-source.d.ts +85 -0
- package/dist/export-sync/builder-source.js +124 -0
- package/dist/export-sync/builder-source.js.map +1 -0
- package/dist/export-sync/check.d.ts +61 -0
- package/dist/export-sync/check.js +126 -0
- package/dist/export-sync/check.js.map +1 -0
- package/dist/export-sync/cli.d.ts +89 -0
- package/dist/export-sync/cli.js +323 -0
- package/dist/export-sync/cli.js.map +1 -0
- package/dist/export-sync/core.d.ts +58 -0
- package/dist/export-sync/core.js +41 -0
- package/dist/export-sync/core.js.map +1 -0
- package/dist/export-sync/eject.d.ts +28 -0
- package/dist/export-sync/eject.js +21 -0
- package/dist/export-sync/eject.js.map +1 -0
- package/dist/export-sync/fixtures.d.ts +25 -0
- package/dist/export-sync/fixtures.js +87 -0
- package/dist/export-sync/fixtures.js.map +1 -0
- package/dist/export-sync/generate.d.ts +7 -0
- package/dist/export-sync/generate.js +505 -0
- package/dist/export-sync/generate.js.map +1 -0
- package/dist/export-sync/index.d.ts +37 -0
- package/dist/export-sync/index.js +39 -0
- package/dist/export-sync/index.js.map +1 -0
- package/dist/export-sync/init.d.ts +123 -0
- package/dist/export-sync/init.js +234 -0
- package/dist/export-sync/init.js.map +1 -0
- package/dist/export-sync/manifest-host.d.ts +48 -0
- package/dist/export-sync/manifest-host.js +73 -0
- package/dist/export-sync/manifest-host.js.map +1 -0
- package/dist/export-sync/node.d.ts +20 -0
- package/dist/export-sync/node.js +101 -0
- package/dist/export-sync/node.js.map +1 -0
- package/dist/export-sync/push.d.ts +76 -0
- package/dist/export-sync/push.js +197 -0
- package/dist/export-sync/push.js.map +1 -0
- package/dist/export-sync/registry-sync-client.d.ts +59 -0
- package/dist/export-sync/registry-sync-client.js +97 -0
- package/dist/export-sync/registry-sync-client.js.map +1 -0
- package/dist/export-sync/sync.d.ts +47 -0
- package/dist/export-sync/sync.js +47 -0
- package/dist/export-sync/sync.js.map +1 -0
- package/dist/export-sync/typegen.d.ts +40 -0
- package/dist/export-sync/typegen.js +45 -0
- package/dist/export-sync/typegen.js.map +1 -0
- package/dist/export-sync/validate.d.ts +19 -0
- package/dist/export-sync/validate.js +102 -0
- package/dist/export-sync/validate.js.map +1 -0
- package/dist/export-sync/watch.d.ts +66 -0
- package/dist/export-sync/watch.js +70 -0
- package/dist/export-sync/watch.js.map +1 -0
- package/dist/operations/assets.d.ts +198 -0
- package/dist/operations/assets.js +75 -0
- package/dist/operations/assets.js.map +1 -0
- package/dist/operations/authorization.d.ts +49 -0
- package/dist/operations/authorization.js +128 -0
- package/dist/operations/authorization.js.map +1 -0
- package/dist/operations/changesets.d.ts +160 -0
- package/dist/operations/changesets.js +442 -0
- package/dist/operations/changesets.js.map +1 -0
- package/dist/operations/client.d.ts +49 -0
- package/dist/operations/client.js +57 -0
- package/dist/operations/client.js.map +1 -0
- package/dist/operations/core.d.ts +238 -0
- package/dist/operations/core.js +269 -0
- package/dist/operations/core.js.map +1 -0
- package/dist/operations/documents.d.ts +432 -0
- package/dist/operations/documents.js +344 -0
- package/dist/operations/documents.js.map +1 -0
- package/dist/operations/graph.d.ts +138 -0
- package/dist/operations/graph.js +78 -0
- package/dist/operations/graph.js.map +1 -0
- package/dist/operations/index.d.ts +19 -0
- package/dist/operations/index.js +20 -0
- package/dist/operations/index.js.map +1 -0
- package/dist/operations/members.d.ts +87 -0
- package/dist/operations/members.js +56 -0
- package/dist/operations/members.js.map +1 -0
- package/dist/operations/publishing.d.ts +89 -0
- package/dist/operations/publishing.js +57 -0
- package/dist/operations/publishing.js.map +1 -0
- package/dist/operations/references.d.ts +222 -0
- package/dist/operations/references.js +177 -0
- package/dist/operations/references.js.map +1 -0
- package/dist/operations/schema.d.ts +413 -0
- package/dist/operations/schema.js +138 -0
- package/dist/operations/schema.js.map +1 -0
- package/dist/operations/tokens.d.ts +79 -0
- package/dist/operations/tokens.js +102 -0
- package/dist/operations/tokens.js.map +1 -0
- package/dist/persistence/adapter.d.ts +79 -0
- package/dist/persistence/adapter.js +55 -0
- package/dist/persistence/adapter.js.map +1 -0
- package/dist/persistence/assets.d.ts +120 -0
- package/dist/persistence/assets.js +141 -0
- package/dist/persistence/assets.js.map +1 -0
- package/dist/persistence/backend-validation.d.ts +43 -0
- package/dist/persistence/backend-validation.js +57 -0
- package/dist/persistence/backend-validation.js.map +1 -0
- package/dist/persistence/cli-tokens.d.ts +50 -0
- package/dist/persistence/cli-tokens.js +66 -0
- package/dist/persistence/cli-tokens.js.map +1 -0
- package/dist/persistence/cms.d.ts +148 -0
- package/dist/persistence/cms.js +232 -0
- package/dist/persistence/cms.js.map +1 -0
- package/dist/persistence/contract-scenarios.d.ts +73 -0
- package/dist/persistence/contract-scenarios.js +496 -0
- package/dist/persistence/contract-scenarios.js.map +1 -0
- package/dist/persistence/core.d.ts +96 -0
- package/dist/persistence/core.js +110 -0
- package/dist/persistence/core.js.map +1 -0
- package/dist/persistence/graph.d.ts +61 -0
- package/dist/persistence/graph.js +98 -0
- package/dist/persistence/graph.js.map +1 -0
- package/dist/persistence/index.d.ts +22 -0
- package/dist/persistence/index.js +23 -0
- package/dist/persistence/index.js.map +1 -0
- package/dist/persistence/members.d.ts +70 -0
- package/dist/persistence/members.js +0 -0
- package/dist/persistence/members.js.map +1 -0
- package/dist/persistence/publishing.d.ts +59 -0
- package/dist/persistence/publishing.js +95 -0
- package/dist/persistence/publishing.js.map +1 -0
- package/dist/persistence/reference-extraction.d.ts +44 -0
- package/dist/persistence/reference-extraction.js +204 -0
- package/dist/persistence/reference-extraction.js.map +1 -0
- package/dist/persistence/reference-indexing.d.ts +68 -0
- package/dist/persistence/reference-indexing.js +112 -0
- package/dist/persistence/reference-indexing.js.map +1 -0
- package/dist/persistence/references.d.ts +257 -0
- package/dist/persistence/references.js +0 -0
- package/dist/persistence/references.js.map +1 -0
- package/dist/persistence/seed.d.ts +55 -0
- package/dist/persistence/seed.js +102 -0
- package/dist/persistence/seed.js.map +1 -0
- package/dist/persistence/self-maintaining-adapter.d.ts +41 -0
- package/dist/persistence/self-maintaining-adapter.js +79 -0
- package/dist/persistence/self-maintaining-adapter.js.map +1 -0
- package/dist/plugins/asset-storage.d.ts +76 -0
- package/dist/plugins/asset-storage.js +104 -0
- package/dist/plugins/asset-storage.js.map +1 -0
- package/dist/plugins/component-package.d.ts +54 -0
- package/dist/plugins/component-package.js +92 -0
- package/dist/plugins/component-package.js.map +1 -0
- package/dist/plugins/data-sources.d.ts +78 -0
- package/dist/plugins/data-sources.js +99 -0
- package/dist/plugins/data-sources.js.map +1 -0
- package/dist/plugins/examples.d.ts +47 -0
- package/dist/plugins/examples.js +205 -0
- package/dist/plugins/examples.js.map +1 -0
- package/dist/plugins/export-targets.d.ts +47 -0
- package/dist/plugins/export-targets.js +78 -0
- package/dist/plugins/export-targets.js.map +1 -0
- package/dist/plugins/field-types.d.ts +86 -0
- package/dist/plugins/field-types.js +93 -0
- package/dist/plugins/field-types.js.map +1 -0
- package/dist/plugins/hooks.d.ts +60 -0
- package/dist/plugins/hooks.js +94 -0
- package/dist/plugins/hooks.js.map +1 -0
- package/dist/plugins/index.d.ts +27 -0
- package/dist/plugins/index.js +28 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/marketplace.d.ts +90 -0
- package/dist/plugins/marketplace.js +110 -0
- package/dist/plugins/marketplace.js.map +1 -0
- package/dist/plugins/plugin.d.ts +107 -0
- package/dist/plugins/plugin.js +122 -0
- package/dist/plugins/plugin.js.map +1 -0
- package/dist/plugins/templates.d.ts +66 -0
- package/dist/plugins/templates.js +74 -0
- package/dist/plugins/templates.js.map +1 -0
- package/dist/project-graph/binding.d.ts +68 -0
- package/dist/project-graph/binding.js +39 -0
- package/dist/project-graph/binding.js.map +1 -0
- package/dist/project-graph/container.d.ts +126 -0
- package/dist/project-graph/container.js +221 -0
- package/dist/project-graph/container.js.map +1 -0
- package/dist/project-graph/edit.d.ts +66 -0
- package/dist/project-graph/edit.js +201 -0
- package/dist/project-graph/edit.js.map +1 -0
- package/dist/project-graph/fixtures.d.ts +51 -0
- package/dist/project-graph/fixtures.js +224 -0
- package/dist/project-graph/fixtures.js.map +1 -0
- package/dist/project-graph/ids.d.ts +17 -0
- package/dist/project-graph/ids.js +19 -0
- package/dist/project-graph/ids.js.map +1 -0
- package/dist/project-graph/index.d.ts +12 -0
- package/dist/project-graph/index.js +13 -0
- package/dist/project-graph/index.js.map +1 -0
- package/dist/project-graph/issues.d.ts +61 -0
- package/dist/project-graph/issues.js +44 -0
- package/dist/project-graph/issues.js.map +1 -0
- package/dist/project-graph/json.d.ts +6 -0
- package/dist/project-graph/json.js +10 -0
- package/dist/project-graph/json.js.map +1 -0
- package/dist/project-graph/node.d.ts +48 -0
- package/dist/project-graph/node.js +42 -0
- package/dist/project-graph/node.js.map +1 -0
- package/dist/project-graph/normalize.d.ts +17 -0
- package/dist/project-graph/normalize.js +110 -0
- package/dist/project-graph/normalize.js.map +1 -0
- package/dist/project-graph/serialize.d.ts +36 -0
- package/dist/project-graph/serialize.js +51 -0
- package/dist/project-graph/serialize.js.map +1 -0
- package/dist/project-graph/structure.d.ts +40 -0
- package/dist/project-graph/structure.js +36 -0
- package/dist/project-graph/structure.js.map +1 -0
- package/dist/project-graph/validate.d.ts +84 -0
- package/dist/project-graph/validate.js +158 -0
- package/dist/project-graph/validate.js.map +1 -0
- package/dist/rich-text/adapter.d.ts +43 -0
- package/dist/rich-text/adapter.js +24 -0
- package/dist/rich-text/adapter.js.map +1 -0
- package/dist/rich-text/dom-editor.d.ts +101 -0
- package/dist/rich-text/dom-editor.js +482 -0
- package/dist/rich-text/dom-editor.js.map +1 -0
- package/dist/rich-text/embed.d.ts +70 -0
- package/dist/rich-text/embed.js +70 -0
- package/dist/rich-text/embed.js.map +1 -0
- package/dist/rich-text/fixtures.d.ts +25 -0
- package/dist/rich-text/fixtures.js +115 -0
- package/dist/rich-text/fixtures.js.map +1 -0
- package/dist/rich-text/html.d.ts +5 -0
- package/dist/rich-text/html.js +309 -0
- package/dist/rich-text/html.js.map +1 -0
- package/dist/rich-text/index.d.ts +19 -0
- package/dist/rich-text/index.js +20 -0
- package/dist/rich-text/index.js.map +1 -0
- package/dist/rich-text/markdown.d.ts +7 -0
- package/dist/rich-text/markdown.js +235 -0
- package/dist/rich-text/markdown.js.map +1 -0
- package/dist/rich-text/portable-text.d.ts +50 -0
- package/dist/rich-text/portable-text.js +223 -0
- package/dist/rich-text/portable-text.js.map +1 -0
- package/dist/rich-text/registry.d.ts +48 -0
- package/dist/rich-text/registry.js +16 -0
- package/dist/rich-text/registry.js.map +1 -0
- package/dist/rich-text/render.d.ts +69 -0
- package/dist/rich-text/render.js +205 -0
- package/dist/rich-text/render.js.map +1 -0
- package/dist/rich-text/schema.d.ts +86 -0
- package/dist/rich-text/schema.js +80 -0
- package/dist/rich-text/schema.js.map +1 -0
- package/dist/rich-text/test-support.d.ts +7 -0
- package/dist/rich-text/test-support.js +8 -0
- package/dist/rich-text/test-support.js.map +1 -0
- package/dist/runtime-renderer/client.d.ts +14 -0
- package/dist/runtime-renderer/client.js +15 -0
- package/dist/runtime-renderer/client.js.map +1 -0
- package/dist/runtime-renderer/condition.d.ts +8 -0
- package/dist/runtime-renderer/condition.js +48 -0
- package/dist/runtime-renderer/condition.js.map +1 -0
- package/dist/runtime-renderer/content-client.d.ts +62 -0
- package/dist/runtime-renderer/content-client.js +37 -0
- package/dist/runtime-renderer/content-client.js.map +1 -0
- package/dist/runtime-renderer/context.d.ts +185 -0
- package/dist/runtime-renderer/context.js +7 -0
- package/dist/runtime-renderer/context.js.map +1 -0
- package/dist/runtime-renderer/fallback.d.ts +39 -0
- package/dist/runtime-renderer/fallback.js +45 -0
- package/dist/runtime-renderer/fallback.js.map +1 -0
- package/dist/runtime-renderer/index.d.ts +13 -0
- package/dist/runtime-renderer/index.js +13 -0
- package/dist/runtime-renderer/index.js.map +1 -0
- package/dist/runtime-renderer/primitives.d.ts +85 -0
- package/dist/runtime-renderer/primitives.js +442 -0
- package/dist/runtime-renderer/primitives.js.map +1 -0
- package/dist/runtime-renderer/render.d.ts +138 -0
- package/dist/runtime-renderer/render.js +825 -0
- package/dist/runtime-renderer/render.js.map +1 -0
- package/dist/runtime-renderer/rich-text.d.ts +26 -0
- package/dist/runtime-renderer/rich-text.js +113 -0
- package/dist/runtime-renderer/rich-text.js.map +1 -0
- package/dist/starter-kits/index.d.ts +13 -0
- package/dist/starter-kits/index.js +14 -0
- package/dist/starter-kits/index.js.map +1 -0
- package/dist/starter-kits/instantiate.d.ts +29 -0
- package/dist/starter-kits/instantiate.js +24 -0
- package/dist/starter-kits/instantiate.js.map +1 -0
- package/dist/starter-kits/kit.d.ts +61 -0
- package/dist/starter-kits/kit.js +37 -0
- package/dist/starter-kits/kit.js.map +1 -0
- package/dist/starter-kits/kits.d.ts +7 -0
- package/dist/starter-kits/kits.js +201 -0
- package/dist/starter-kits/kits.js.map +1 -0
- package/dist/starter-kits/manifests.d.ts +7 -0
- package/dist/starter-kits/manifests.js +111 -0
- package/dist/starter-kits/manifests.js.map +1 -0
- package/dist/starter-kits/upgrade.d.ts +39 -0
- package/dist/starter-kits/upgrade.js +54 -0
- package/dist/starter-kits/upgrade.js.map +1 -0
- package/dist/starter-kits/validate.d.ts +16 -0
- package/dist/starter-kits/validate.js +77 -0
- package/dist/starter-kits/validate.js.map +1 -0
- package/dist/studio-core/context.d.ts +27 -0
- package/dist/studio-core/context.js +44 -0
- package/dist/studio-core/context.js.map +1 -0
- package/dist/studio-core/errors.d.ts +58 -0
- package/dist/studio-core/errors.js +74 -0
- package/dist/studio-core/errors.js.map +1 -0
- package/dist/studio-core/fixtures.d.ts +18 -0
- package/dist/studio-core/fixtures.js +83 -0
- package/dist/studio-core/fixtures.js.map +1 -0
- package/dist/studio-core/ids.d.ts +22 -0
- package/dist/studio-core/ids.js +33 -0
- package/dist/studio-core/ids.js.map +1 -0
- package/dist/studio-core/index.d.ts +11 -0
- package/dist/studio-core/index.js +12 -0
- package/dist/studio-core/index.js.map +1 -0
- package/dist/studio-core/issues.d.ts +50 -0
- package/dist/studio-core/issues.js +33 -0
- package/dist/studio-core/issues.js.map +1 -0
- package/dist/studio-core/metadata.d.ts +109 -0
- package/dist/studio-core/metadata.js +74 -0
- package/dist/studio-core/metadata.js.map +1 -0
- package/dist/studio-core/repository.d.ts +73 -0
- package/dist/studio-core/repository.js +202 -0
- package/dist/studio-core/repository.js.map +1 -0
- package/dist/studio-core/sections.d.ts +73 -0
- package/dist/studio-core/sections.js +68 -0
- package/dist/studio-core/sections.js.map +1 -0
- package/dist/studio-core/validate.d.ts +15 -0
- package/dist/studio-core/validate.js +119 -0
- package/dist/studio-core/validate.js.map +1 -0
- package/dist/studio-core/workspace-config.d.ts +587 -0
- package/dist/studio-core/workspace-config.js +434 -0
- package/dist/studio-core/workspace-config.js.map +1 -0
- package/package.json +104 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sample-accessor-types.js","sourceRoot":"","sources":["../../../src/content/__fixtures__/sample-accessor-types.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,gEAAgE;AAChE,sEAAsE"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reference stub for an unpopulated relation: `populate: false` opt-outs,
|
|
3
|
+
* unknown/missing targets, and relations nested inside a populated document
|
|
4
|
+
* (population never recurses past depth-1). Never a bare id string.
|
|
5
|
+
*/
|
|
6
|
+
export interface DocumentStub<TCollection extends string = string> {
|
|
7
|
+
id: string;
|
|
8
|
+
collection: TCollection;
|
|
9
|
+
}
|
|
10
|
+
/** Delivery shape of a resolved asset; absent metadata is `null`. */
|
|
11
|
+
export interface ResolvedAsset {
|
|
12
|
+
id: string;
|
|
13
|
+
url: string;
|
|
14
|
+
width: number | null;
|
|
15
|
+
height: number | null;
|
|
16
|
+
alt: string | null;
|
|
17
|
+
mimeType: string;
|
|
18
|
+
focalPoint: {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
} | null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* One node of a composition (`blocks`) field tree (EC-188), delivered verbatim.
|
|
25
|
+
* Opaque and recursive — render it with `renderComposition` rather than reading
|
|
26
|
+
* into it; `props`/`slots` are intentionally loose.
|
|
27
|
+
*/
|
|
28
|
+
export interface CompositionBlock {
|
|
29
|
+
id: string;
|
|
30
|
+
componentId: string;
|
|
31
|
+
props?: Record<string, unknown>;
|
|
32
|
+
slots?: Record<string, CompositionBlock[]>;
|
|
33
|
+
condition?: unknown;
|
|
34
|
+
}
|
|
35
|
+
/** Delivery shape for documents in the "asset" collection. */
|
|
36
|
+
export interface Asset {
|
|
37
|
+
id: string;
|
|
38
|
+
collection: 'asset';
|
|
39
|
+
filename: string;
|
|
40
|
+
alt?: string;
|
|
41
|
+
url: string;
|
|
42
|
+
}
|
|
43
|
+
/** Depth-1 populated reference to the "asset" collection. */
|
|
44
|
+
export interface AssetRef {
|
|
45
|
+
id: string;
|
|
46
|
+
collection: 'asset';
|
|
47
|
+
filename: string;
|
|
48
|
+
alt?: string;
|
|
49
|
+
url: string;
|
|
50
|
+
}
|
|
51
|
+
/** Delivery shape for documents in the "author" collection. */
|
|
52
|
+
export interface Author {
|
|
53
|
+
id: string;
|
|
54
|
+
collection: 'author';
|
|
55
|
+
name: string;
|
|
56
|
+
bio?: string;
|
|
57
|
+
}
|
|
58
|
+
/** Depth-1 populated reference to the "author" collection. */
|
|
59
|
+
export interface AuthorRef {
|
|
60
|
+
id: string;
|
|
61
|
+
collection: 'author';
|
|
62
|
+
name: string;
|
|
63
|
+
bio?: string;
|
|
64
|
+
}
|
|
65
|
+
/** Delivery shape for documents in the "page" collection. */
|
|
66
|
+
export interface Page {
|
|
67
|
+
id: string;
|
|
68
|
+
collection: 'page';
|
|
69
|
+
name: string;
|
|
70
|
+
body?: CompositionBlock[];
|
|
71
|
+
layoutId?: string;
|
|
72
|
+
seoTitle?: string;
|
|
73
|
+
seoDescription?: string;
|
|
74
|
+
seoCanonical?: string;
|
|
75
|
+
seoOgTitle?: string;
|
|
76
|
+
seoOgImage?: string;
|
|
77
|
+
seoNoindex?: boolean;
|
|
78
|
+
}
|
|
79
|
+
/** Depth-1 populated reference to the "page" collection. */
|
|
80
|
+
export interface PageRef {
|
|
81
|
+
id: string;
|
|
82
|
+
collection: 'page';
|
|
83
|
+
name: string;
|
|
84
|
+
body?: CompositionBlock[];
|
|
85
|
+
layoutId?: string;
|
|
86
|
+
seoTitle?: string;
|
|
87
|
+
seoDescription?: string;
|
|
88
|
+
seoCanonical?: string;
|
|
89
|
+
seoOgTitle?: string;
|
|
90
|
+
seoOgImage?: string;
|
|
91
|
+
seoNoindex?: boolean;
|
|
92
|
+
}
|
|
93
|
+
/** Delivery shape for documents in the "post" collection. */
|
|
94
|
+
export interface Post {
|
|
95
|
+
id: string;
|
|
96
|
+
collection: 'post';
|
|
97
|
+
title: string;
|
|
98
|
+
slug: string;
|
|
99
|
+
body?: string;
|
|
100
|
+
views?: number;
|
|
101
|
+
featured?: boolean;
|
|
102
|
+
publishedAt?: string | number;
|
|
103
|
+
status?: 'news' | 'guide';
|
|
104
|
+
author: AuthorRef;
|
|
105
|
+
related?: PostRef[];
|
|
106
|
+
cover?: ResolvedAsset | null;
|
|
107
|
+
}
|
|
108
|
+
/** Depth-1 populated reference to the "post" collection. */
|
|
109
|
+
export interface PostRef {
|
|
110
|
+
id: string;
|
|
111
|
+
collection: 'post';
|
|
112
|
+
title: string;
|
|
113
|
+
slug: string;
|
|
114
|
+
body?: string;
|
|
115
|
+
views?: number;
|
|
116
|
+
featured?: boolean;
|
|
117
|
+
publishedAt?: string | number;
|
|
118
|
+
status?: 'news' | 'guide';
|
|
119
|
+
author: DocumentStub<'author'>;
|
|
120
|
+
related?: DocumentStub<'post'>[];
|
|
121
|
+
cover?: ResolvedAsset | null;
|
|
122
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sample-delivery-types.js","sourceRoot":"","sources":["../../../src/content/__fixtures__/sample-delivery-types.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,gEAAgE;AAChE,sEAAsE"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { CmsPath, CmsValidationIssue } from '@elytracms/core/cms-core';
|
|
2
|
+
import type { AssetRecord } from '@elytracms/core/persistence';
|
|
3
|
+
/**
|
|
4
|
+
* The delivery shape of an asset (vision AD-4): a directly usable object, not
|
|
5
|
+
* an id. Optional metadata that the stored record lacks is `null` (never
|
|
6
|
+
* `undefined`) so resolved documents stay JSON-stable.
|
|
7
|
+
*/
|
|
8
|
+
export interface ResolvedAsset {
|
|
9
|
+
/** The asset id the field stored (kept for cache keys and re-lookup). */
|
|
10
|
+
id: string;
|
|
11
|
+
/** Resolvable URL for the asset bytes (EC-044 blob storage locator). */
|
|
12
|
+
url: string;
|
|
13
|
+
width: number | null;
|
|
14
|
+
height: number | null;
|
|
15
|
+
alt: string | null;
|
|
16
|
+
mimeType: string;
|
|
17
|
+
/**
|
|
18
|
+
* Normalized image focal point `{ x, y }` in 0–1 (EC-230), or `null`. Threaded
|
|
19
|
+
* to the image primitive's CSS `object-position` so a migrated hotspot keeps
|
|
20
|
+
* the subject in frame when a layout crops the image (`object-fit: cover`).
|
|
21
|
+
*/
|
|
22
|
+
focalPoint: {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
} | null;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Pure lookup boundary for asset metadata (EC-044). The caller pre-fetches;
|
|
29
|
+
* resolution only reads. `assetUrl` turns a metadata record into a resolvable
|
|
30
|
+
* URL (e.g. via the blob storage adapter's `url(storageKey)`).
|
|
31
|
+
*/
|
|
32
|
+
export interface AssetLookup {
|
|
33
|
+
asset(id: string): AssetRecord | undefined;
|
|
34
|
+
assetUrl(asset: AssetRecord): string;
|
|
35
|
+
}
|
|
36
|
+
/** Map a persisted asset record (+ resolved URL) to its delivery shape. */
|
|
37
|
+
export declare function resolvedAsset(record: AssetRecord, url: string): ResolvedAsset;
|
|
38
|
+
export interface AssetResolution {
|
|
39
|
+
/** The delivery-shaped asset, or `null` when the asset is missing. */
|
|
40
|
+
asset: ResolvedAsset | null;
|
|
41
|
+
issues: CmsValidationIssue[];
|
|
42
|
+
}
|
|
43
|
+
export interface AssetResolutionLocation {
|
|
44
|
+
path: CmsPath;
|
|
45
|
+
collectionId?: string;
|
|
46
|
+
documentId?: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Resolve one stored asset id to its delivery shape. A missing asset is a
|
|
50
|
+
* structured `unknown-asset` issue plus a `null` value — never a crash
|
|
51
|
+
* (EC-142 acceptance).
|
|
52
|
+
*/
|
|
53
|
+
export declare function resolveAssetValue(lookup: AssetLookup, assetId: string, location: AssetResolutionLocation): AssetResolution;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { cmsIssue } from '@elytracms/core/cms-core';
|
|
2
|
+
/** Map a persisted asset record (+ resolved URL) to its delivery shape. */
|
|
3
|
+
export function resolvedAsset(record, url) {
|
|
4
|
+
return {
|
|
5
|
+
id: record.id,
|
|
6
|
+
url,
|
|
7
|
+
width: record.width ?? null,
|
|
8
|
+
height: record.height ?? null,
|
|
9
|
+
alt: record.alt ?? null,
|
|
10
|
+
mimeType: record.contentType,
|
|
11
|
+
focalPoint: record.focalPoint ?? null,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Resolve one stored asset id to its delivery shape. A missing asset is a
|
|
16
|
+
* structured `unknown-asset` issue plus a `null` value — never a crash
|
|
17
|
+
* (EC-142 acceptance).
|
|
18
|
+
*/
|
|
19
|
+
export function resolveAssetValue(lookup, assetId, location) {
|
|
20
|
+
const record = lookup.asset(assetId);
|
|
21
|
+
if (!record) {
|
|
22
|
+
return {
|
|
23
|
+
asset: null,
|
|
24
|
+
issues: [
|
|
25
|
+
cmsIssue({
|
|
26
|
+
code: 'unknown-asset',
|
|
27
|
+
message: `Asset "${assetId}" could not be resolved.`,
|
|
28
|
+
path: location.path,
|
|
29
|
+
...(location.collectionId ? { collectionId: location.collectionId } : {}),
|
|
30
|
+
...(location.documentId ? { documentId: location.documentId } : {}),
|
|
31
|
+
meta: { assetId },
|
|
32
|
+
}),
|
|
33
|
+
],
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return { asset: resolvedAsset(record, lookup.assetUrl(record)), issues: [] };
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=assets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.js","sourceRoot":"","sources":["../../src/content/assets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAoCnD,2EAA2E;AAC3E,MAAM,UAAU,aAAa,CAAC,MAAmB,EAAE,GAAW;IAC5D,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,GAAG;QACH,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,IAAI;QAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,IAAI;QAC7B,GAAG,EAAE,MAAM,CAAC,GAAG,IAAI,IAAI;QACvB,QAAQ,EAAE,MAAM,CAAC,WAAW;QAC5B,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,IAAI;KACtC,CAAA;AACH,CAAC;AAcD;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,MAAmB,EACnB,OAAe,EACf,QAAiC;IAEjC,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACpC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO;YACL,KAAK,EAAE,IAAI;YACX,MAAM,EAAE;gBACN,QAAQ,CAAC;oBACP,IAAI,EAAE,eAAe;oBACrB,OAAO,EAAE,UAAU,OAAO,0BAA0B;oBACpD,IAAI,EAAE,QAAQ,CAAC,IAAI;oBACnB,GAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;oBACzE,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;oBACnE,IAAI,EAAE,EAAE,OAAO,EAAE;iBAClB,CAAC;aACH;SACF,CAAA;IACH,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAA;AAC9E,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ListDocumentsQuery, SortInput, WhereInput } from './query';
|
|
2
|
+
/**
|
|
3
|
+
* Binding-source identities & stored-query replay (EC-166 delivery half).
|
|
4
|
+
*
|
|
5
|
+
* The builder models collection-driven layouts as per-scope CMS sources. A
|
|
6
|
+
* repeating section is a per-section list source `cms.section.<nodeId>` whose
|
|
7
|
+
* config carries the closed AD-3 query (where/sort/limit).
|
|
8
|
+
*
|
|
9
|
+
* This prefix is a delivery contract: when a published graph renders in the
|
|
10
|
+
* embedded runtime, the host materializes each section source by replaying the
|
|
11
|
+
* stored query through `listDocuments` (published perspective, ambient locale).
|
|
12
|
+
* The constant lives here — the delivery side — so the builder and every host
|
|
13
|
+
* speak the same identity scheme.
|
|
14
|
+
*
|
|
15
|
+
* EC-187: the `cms.template.<pageId>` "current document" source is RETIRED.
|
|
16
|
+
* Pages are `page`-collection documents (no template page), and a collection
|
|
17
|
+
* detail route binds its document directly via the route's `document` ref —
|
|
18
|
+
* the dev route component reads it, no per-page source indirection.
|
|
19
|
+
*/
|
|
20
|
+
export declare const SECTION_SOURCE_PREFIX = "cms.section.";
|
|
21
|
+
/** The per-section list source id of a repeating section node. */
|
|
22
|
+
export declare function sectionSourceId(nodeId: string): string;
|
|
23
|
+
export declare function isSectionSourceId(sourceId: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The stored config of a CMS query source, as the builder persists it
|
|
26
|
+
* (`@elytracms/core/data-binding`'s cms config): the AD-3 `where` shape stored
|
|
27
|
+
* verbatim in `filter`, plus optional `sort` and `limit`. Structural — this
|
|
28
|
+
* package does not depend on the builder-side source schemas.
|
|
29
|
+
*/
|
|
30
|
+
export interface CmsSourceQueryConfig {
|
|
31
|
+
collectionId: string;
|
|
32
|
+
/** Set on single-document sources (template pages); list sources omit it. */
|
|
33
|
+
documentId?: string;
|
|
34
|
+
/** AD-3 `where` input (eq/in/lt/lte/gt/gte, AND-only), stored verbatim. */
|
|
35
|
+
filter?: WhereInput;
|
|
36
|
+
sort?: SortInput;
|
|
37
|
+
limit?: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Read a stored source config back into its structural shape. Total and
|
|
41
|
+
* lenient by design: only the envelope is checked here — `where`/`sort`/
|
|
42
|
+
* `limit` *contents* are validated by `listDocuments` itself, which answers
|
|
43
|
+
* invalid queries as structured errors (never a throw). A malformed envelope
|
|
44
|
+
* yields `undefined`, so the caller degrades to an unresolved binding (the
|
|
45
|
+
* renderer's visible fallback), never a crash.
|
|
46
|
+
*/
|
|
47
|
+
export declare function parseCmsSourceQueryConfig(value: unknown): CmsSourceQueryConfig | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* The `listDocuments` query a stored section config replays at delivery —
|
|
50
|
+
* exactly the where/sort/limit the editor picked in the builder (the canonical
|
|
51
|
+
* validators run inside `listDocuments`; nothing is widened here).
|
|
52
|
+
*/
|
|
53
|
+
export declare function listQueryOfCmsConfig(config: CmsSourceQueryConfig): ListDocumentsQuery;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Binding-source identities & stored-query replay (EC-166 delivery half).
|
|
3
|
+
*
|
|
4
|
+
* The builder models collection-driven layouts as per-scope CMS sources. A
|
|
5
|
+
* repeating section is a per-section list source `cms.section.<nodeId>` whose
|
|
6
|
+
* config carries the closed AD-3 query (where/sort/limit).
|
|
7
|
+
*
|
|
8
|
+
* This prefix is a delivery contract: when a published graph renders in the
|
|
9
|
+
* embedded runtime, the host materializes each section source by replaying the
|
|
10
|
+
* stored query through `listDocuments` (published perspective, ambient locale).
|
|
11
|
+
* The constant lives here — the delivery side — so the builder and every host
|
|
12
|
+
* speak the same identity scheme.
|
|
13
|
+
*
|
|
14
|
+
* EC-187: the `cms.template.<pageId>` "current document" source is RETIRED.
|
|
15
|
+
* Pages are `page`-collection documents (no template page), and a collection
|
|
16
|
+
* detail route binds its document directly via the route's `document` ref —
|
|
17
|
+
* the dev route component reads it, no per-page source indirection.
|
|
18
|
+
*/
|
|
19
|
+
export const SECTION_SOURCE_PREFIX = 'cms.section.';
|
|
20
|
+
/** The per-section list source id of a repeating section node. */
|
|
21
|
+
export function sectionSourceId(nodeId) {
|
|
22
|
+
return `${SECTION_SOURCE_PREFIX}${nodeId}`;
|
|
23
|
+
}
|
|
24
|
+
export function isSectionSourceId(sourceId) {
|
|
25
|
+
return sourceId.startsWith(SECTION_SOURCE_PREFIX);
|
|
26
|
+
}
|
|
27
|
+
const isPlainObject = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
28
|
+
/**
|
|
29
|
+
* Read a stored source config back into its structural shape. Total and
|
|
30
|
+
* lenient by design: only the envelope is checked here — `where`/`sort`/
|
|
31
|
+
* `limit` *contents* are validated by `listDocuments` itself, which answers
|
|
32
|
+
* invalid queries as structured errors (never a throw). A malformed envelope
|
|
33
|
+
* yields `undefined`, so the caller degrades to an unresolved binding (the
|
|
34
|
+
* renderer's visible fallback), never a crash.
|
|
35
|
+
*/
|
|
36
|
+
export function parseCmsSourceQueryConfig(value) {
|
|
37
|
+
if (!isPlainObject(value))
|
|
38
|
+
return undefined;
|
|
39
|
+
const collectionId = value.collectionId;
|
|
40
|
+
if (typeof collectionId !== 'string' || collectionId.length === 0)
|
|
41
|
+
return undefined;
|
|
42
|
+
const config = { collectionId };
|
|
43
|
+
if (typeof value.documentId === 'string')
|
|
44
|
+
config.documentId = value.documentId;
|
|
45
|
+
if (isPlainObject(value.filter))
|
|
46
|
+
config.filter = value.filter;
|
|
47
|
+
if (typeof value.limit === 'number')
|
|
48
|
+
config.limit = value.limit;
|
|
49
|
+
const sort = value.sort;
|
|
50
|
+
if (isPlainObject(sort) && typeof sort.field === 'string') {
|
|
51
|
+
const direction = sort.direction;
|
|
52
|
+
config.sort = {
|
|
53
|
+
field: sort.field,
|
|
54
|
+
...(direction === 'asc' || direction === 'desc' ? { direction } : {}),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
return config;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The `listDocuments` query a stored section config replays at delivery —
|
|
61
|
+
* exactly the where/sort/limit the editor picked in the builder (the canonical
|
|
62
|
+
* validators run inside `listDocuments`; nothing is widened here).
|
|
63
|
+
*/
|
|
64
|
+
export function listQueryOfCmsConfig(config) {
|
|
65
|
+
return {
|
|
66
|
+
...(config.filter !== undefined && Object.keys(config.filter).length > 0
|
|
67
|
+
? { where: config.filter }
|
|
68
|
+
: {}),
|
|
69
|
+
...(config.sort !== undefined ? { sort: config.sort } : {}),
|
|
70
|
+
...(config.limit !== undefined ? { limit: config.limit } : {}),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=binding-sources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binding-sources.js","sourceRoot":"","sources":["../../src/content/binding-sources.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,cAAc,CAAA;AAEnD,kEAAkE;AAClE,MAAM,UAAU,eAAe,CAAC,MAAc;IAC5C,OAAO,GAAG,qBAAqB,GAAG,MAAM,EAAE,CAAA;AAC5C,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,QAAgB;IAChD,OAAO,QAAQ,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAA;AACnD,CAAC;AAkBD,MAAM,aAAa,GAAG,CAAC,KAAc,EAAoC,EAAE,CACzE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAEtE;;;;;;;GAOG;AACH,MAAM,UAAU,yBAAyB,CAAC,KAAc;IACtD,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAA;IAC3C,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,CAAA;IACvC,IAAI,OAAO,YAAY,KAAK,QAAQ,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAA;IAEnF,MAAM,MAAM,GAAyB,EAAE,YAAY,EAAE,CAAA;IACrD,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,QAAQ;QAAE,MAAM,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAA;IAC9E,IAAI,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC;QAAE,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,MAAoB,CAAA;IAC3E,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;QAAE,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAA;IAE/D,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAA;IACvB,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC1D,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAA;QAChC,MAAM,CAAC,IAAI,GAAG;YACZ,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,GAAG,CAAC,SAAS,KAAK,KAAK,IAAI,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACtE,CAAA;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAA4B;IAC/D,OAAO;QACL,GAAG,CAAC,MAAM,CAAC,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC;YACtE,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE;YAC1B,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,GAAG,CAAC,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC/D,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { CmsValidationIssue, DocumentRef, Locale, RedirectRecord, ResolveStatus, RouteRecord } from '@elytracms/core/cms-core';
|
|
2
|
+
import type { ContentContext } from './context';
|
|
3
|
+
import type { ContentQueryError, ListDocumentsQuery, WhereInput } from './query';
|
|
4
|
+
import type { ContentLookup, DeliveryDocument, ResolutionInfo, ResolvedDocument } from './resolve';
|
|
5
|
+
import type { CacheTags } from './tags';
|
|
6
|
+
/**
|
|
7
|
+
* The closed-form v1 query surface (EC-143, vision AD-3): `resolvePage`,
|
|
8
|
+
* `getDocument`, `listDocuments` — no query language. Every result is
|
|
9
|
+
* delivery-shaped (EC-142) and carries deterministic `CacheTags` for EC-146.
|
|
10
|
+
*
|
|
11
|
+
* Pure and synchronous like the rest of the package: the client reads through
|
|
12
|
+
* a `ContentLookup`; EC-144/EC-145 bind it to Convex/Next later. The ambient
|
|
13
|
+
* `{ locale, perspective }` context is taken once at creation — never per-call
|
|
14
|
+
* ceremony (per-call `locale` overrides exist for route-level needs only).
|
|
15
|
+
*/
|
|
16
|
+
export interface ResolvePageResult {
|
|
17
|
+
/** Route resolution status (EC-019 parity): ok | redirect | notFound. */
|
|
18
|
+
status: ResolveStatus;
|
|
19
|
+
/** The matched route record, when status is `ok`. */
|
|
20
|
+
route: RouteRecord | null;
|
|
21
|
+
/** Extracted dynamic params, e.g. `{ slug: 'hello-world' }`. */
|
|
22
|
+
dynamicParams: Record<string, string>;
|
|
23
|
+
/** True when route matching fell back to the default locale (EC-018). */
|
|
24
|
+
localeFallback: boolean;
|
|
25
|
+
/** Terminal redirect target + permanence, when status is `redirect`. */
|
|
26
|
+
redirect: {
|
|
27
|
+
target: string;
|
|
28
|
+
permanent: boolean;
|
|
29
|
+
} | null;
|
|
30
|
+
/**
|
|
31
|
+
* The document this URL resolves to, delivery-shaped (EC-142, EC-187). A
|
|
32
|
+
* `page`-collection document (its `body` composition renders into a layout)
|
|
33
|
+
* or a content-collection document (rendered by a dev route component). SEO
|
|
34
|
+
* for a page is read from this document's flat `seo*` fields — there is no
|
|
35
|
+
* separate page-graph `seo` block anymore.
|
|
36
|
+
*/
|
|
37
|
+
document: ResolvedDocument | null;
|
|
38
|
+
issues: CmsValidationIssue[];
|
|
39
|
+
tags: CacheTags;
|
|
40
|
+
}
|
|
41
|
+
export interface GetDocumentResult<TDoc extends DeliveryDocument = ResolvedDocument> {
|
|
42
|
+
/**
|
|
43
|
+
* The delivery-shaped document, or `null` when not found / not visible in
|
|
44
|
+
* the context perspective (correct behavior, not an error — see EC-142).
|
|
45
|
+
*/
|
|
46
|
+
document: TDoc | null;
|
|
47
|
+
info: ResolutionInfo | null;
|
|
48
|
+
issues: CmsValidationIssue[];
|
|
49
|
+
tags: CacheTags;
|
|
50
|
+
}
|
|
51
|
+
export type ListDocumentsResult<TDoc extends DeliveryDocument = ResolvedDocument> = {
|
|
52
|
+
ok: true;
|
|
53
|
+
documents: TDoc[];
|
|
54
|
+
/** Cursor for the next page, `null` when this page exhausts the list. */
|
|
55
|
+
nextCursor: string | null;
|
|
56
|
+
issues: CmsValidationIssue[];
|
|
57
|
+
tags: CacheTags;
|
|
58
|
+
} | {
|
|
59
|
+
/** The query itself was invalid (never thrown — structured errors). */
|
|
60
|
+
ok: false;
|
|
61
|
+
errors: ContentQueryError[];
|
|
62
|
+
tags: CacheTags;
|
|
63
|
+
};
|
|
64
|
+
export interface ContentClient {
|
|
65
|
+
readonly context: ContentContext;
|
|
66
|
+
/** Structural route issues from construction (conflicts, redirect loops). */
|
|
67
|
+
readonly routerIssues: readonly CmsValidationIssue[];
|
|
68
|
+
resolvePage(url: string, locale?: Locale): ResolvePageResult;
|
|
69
|
+
getDocument<TDoc extends DeliveryDocument = ResolvedDocument>(collection: string, idOrSlug: string, locale?: Locale): GetDocumentResult<TDoc>;
|
|
70
|
+
listDocuments<TDoc extends DeliveryDocument = ResolvedDocument, TWhere extends WhereInput = WhereInput>(collection: string, query?: ListDocumentsQuery<TWhere>): ListDocumentsResult<TDoc>;
|
|
71
|
+
/**
|
|
72
|
+
* Populate a relation reference to depth-1 delivery shape (EC-254), or `null`
|
|
73
|
+
* when the target is missing or not visible in the active perspective. A
|
|
74
|
+
* renderer host wires this as `RenderContext.resolveRelation` to populate the
|
|
75
|
+
* COMPOSITION-NODE relation props of the nodes inside a page's `blocks` field
|
|
76
|
+
* (e.g. a ProductGrid block's picked `product`s) — which `resolvePage` leaves
|
|
77
|
+
* raw, since document resolution does not descend into a composition value.
|
|
78
|
+
*/
|
|
79
|
+
resolveRelation(ref: DocumentRef): ResolvedDocument | null;
|
|
80
|
+
}
|
|
81
|
+
export interface ContentClientInit {
|
|
82
|
+
lookup: ContentLookup;
|
|
83
|
+
context: ContentContext;
|
|
84
|
+
/** Route records for `resolvePage` (EC-019). */
|
|
85
|
+
routes?: readonly RouteRecord[];
|
|
86
|
+
/** Redirect records for `resolvePage` (EC-019/020). */
|
|
87
|
+
redirects?: readonly RedirectRecord[];
|
|
88
|
+
}
|
|
89
|
+
/** Create the typed accessor client (vision AD-3 ladder, rungs 1–3). */
|
|
90
|
+
export declare function createContentClient(init: ContentClientInit): ContentClient;
|