@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,357 @@
|
|
|
1
|
+
import { documentKey, refOf } from './documents';
|
|
2
|
+
/**
|
|
3
|
+
* Sample CMS model used across tests and as a worked example (mirrors the role of
|
|
4
|
+
* `validSampleGraph` in `@elytracms/core/project-graph`). Provider-neutral, deterministic.
|
|
5
|
+
*/
|
|
6
|
+
export const sampleLocaleConfig = {
|
|
7
|
+
default: 'en',
|
|
8
|
+
locales: ['en', 'de'],
|
|
9
|
+
};
|
|
10
|
+
/** An asset collection (EC-017). */
|
|
11
|
+
export const assetCollection = {
|
|
12
|
+
id: 'asset',
|
|
13
|
+
kind: 'asset',
|
|
14
|
+
titleField: 'filename',
|
|
15
|
+
fields: [
|
|
16
|
+
{ name: 'filename', type: 'text', validation: { required: true } },
|
|
17
|
+
{ name: 'alt', type: 'text', localized: true },
|
|
18
|
+
{ name: 'url', type: 'text', validation: { required: true } },
|
|
19
|
+
],
|
|
20
|
+
};
|
|
21
|
+
/** An author collection used as a relation target. */
|
|
22
|
+
export const authorCollection = {
|
|
23
|
+
id: 'author',
|
|
24
|
+
kind: 'document',
|
|
25
|
+
titleField: 'name',
|
|
26
|
+
fields: [
|
|
27
|
+
{ name: 'name', type: 'text', validation: { required: true } },
|
|
28
|
+
{ name: 'bio', type: 'richText' },
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
/** A localized blog-post collection exercising every field type. */
|
|
32
|
+
export const postCollection = {
|
|
33
|
+
id: 'post',
|
|
34
|
+
kind: 'document',
|
|
35
|
+
localized: true,
|
|
36
|
+
titleField: 'title',
|
|
37
|
+
form: {
|
|
38
|
+
label: 'Posts',
|
|
39
|
+
labelSingular: 'Post',
|
|
40
|
+
groups: ['content', 'meta'],
|
|
41
|
+
tabs: ['main', 'seo'],
|
|
42
|
+
},
|
|
43
|
+
fields: [
|
|
44
|
+
{
|
|
45
|
+
name: 'title',
|
|
46
|
+
type: 'text',
|
|
47
|
+
localized: true,
|
|
48
|
+
validation: { required: true, min: 1, max: 120 },
|
|
49
|
+
form: { label: 'Title', group: 'content', tab: 'main', order: 1 },
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'slug',
|
|
53
|
+
type: 'text',
|
|
54
|
+
validation: { required: true, pattern: '^[a-z0-9-]+$', unique: true },
|
|
55
|
+
form: { label: 'Slug', group: 'content', tab: 'main', order: 2 },
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'body',
|
|
59
|
+
type: 'richText',
|
|
60
|
+
localized: true,
|
|
61
|
+
form: { label: 'Body', group: 'content', tab: 'main', order: 3 },
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'views',
|
|
65
|
+
type: 'number',
|
|
66
|
+
validation: { min: 0 },
|
|
67
|
+
form: { label: 'Views', group: 'meta', tab: 'main' },
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'featured',
|
|
71
|
+
type: 'boolean',
|
|
72
|
+
form: { label: 'Featured', group: 'meta', tab: 'main' },
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'publishedAt',
|
|
76
|
+
type: 'date',
|
|
77
|
+
form: { label: 'Published at', group: 'meta', tab: 'main' },
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'status',
|
|
81
|
+
type: 'select',
|
|
82
|
+
options: [
|
|
83
|
+
{ value: 'news', label: 'News' },
|
|
84
|
+
{ value: 'guide', label: 'Guide' },
|
|
85
|
+
],
|
|
86
|
+
form: { label: 'Status', group: 'meta', tab: 'main' },
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: 'author',
|
|
90
|
+
type: 'relation',
|
|
91
|
+
target: 'author',
|
|
92
|
+
cardinality: 'one',
|
|
93
|
+
validation: { required: true },
|
|
94
|
+
form: { label: 'Author', group: 'meta', tab: 'main' },
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: 'related',
|
|
98
|
+
type: 'relation',
|
|
99
|
+
target: 'post',
|
|
100
|
+
cardinality: 'many',
|
|
101
|
+
form: { label: 'Related posts', group: 'meta', tab: 'main' },
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: 'cover',
|
|
105
|
+
type: 'asset',
|
|
106
|
+
cardinality: 'one',
|
|
107
|
+
accept: ['image'],
|
|
108
|
+
form: { label: 'Cover image', group: 'content', tab: 'main' },
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* EC-187: the `page` collection — a document collection whose body IS a
|
|
114
|
+
* composition (`blocks`) field, surfaced on its own "Canvas" fieldset tab
|
|
115
|
+
* (EC-188). This is the config-owned model a routed page document is authored
|
|
116
|
+
* against: `name` (title), the `body` canvas, structured SEO, and a `layoutId`
|
|
117
|
+
* selecting which graph layout wraps the rendered composition at delivery.
|
|
118
|
+
*
|
|
119
|
+
* ADDITIVE + INERT (EC-187 slices 1–3): the collection exists in config so the
|
|
120
|
+
* studio can author page documents and the reference index walks their `body`
|
|
121
|
+
* tree, but NOTHING routes to it yet — the OLD `graph.pages` delivery path stays
|
|
122
|
+
* canonical until the breaking cutover wires routes/host/seed to `page`.
|
|
123
|
+
*
|
|
124
|
+
* The `body` field mirrors the post `content` blocks field EXACTLY (same `allow`
|
|
125
|
+
* code-leashed vocabulary, same `cardinality: 'many'`) so both composition
|
|
126
|
+
* surfaces deliver and index through one identical code path.
|
|
127
|
+
*/
|
|
128
|
+
export const pageCollection = {
|
|
129
|
+
id: 'page',
|
|
130
|
+
kind: 'document',
|
|
131
|
+
titleField: 'name',
|
|
132
|
+
form: {
|
|
133
|
+
label: 'Pages',
|
|
134
|
+
labelSingular: 'Page',
|
|
135
|
+
tabs: ['main', 'canvas', 'seo'],
|
|
136
|
+
},
|
|
137
|
+
fields: [
|
|
138
|
+
{
|
|
139
|
+
name: 'name',
|
|
140
|
+
type: 'text',
|
|
141
|
+
validation: { required: true },
|
|
142
|
+
form: { tab: 'main' },
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'body',
|
|
146
|
+
type: 'blocks',
|
|
147
|
+
allow: [
|
|
148
|
+
'base.primitives.Heading',
|
|
149
|
+
'base.primitives.Text',
|
|
150
|
+
'base.primitives.Image',
|
|
151
|
+
'base.primitives.Button',
|
|
152
|
+
'base.primitives.Stack',
|
|
153
|
+
'project.MarketingHero',
|
|
154
|
+
'project.FeatureCard',
|
|
155
|
+
'project.PricingCallout',
|
|
156
|
+
],
|
|
157
|
+
cardinality: 'many',
|
|
158
|
+
form: { label: 'Canvas', tab: 'canvas' },
|
|
159
|
+
},
|
|
160
|
+
{ name: 'layoutId', type: 'text', form: { tab: 'main' } },
|
|
161
|
+
{ name: 'seoTitle', type: 'text', form: { tab: 'seo' } },
|
|
162
|
+
{ name: 'seoDescription', type: 'text', form: { tab: 'seo' } },
|
|
163
|
+
{ name: 'seoCanonical', type: 'text', form: { tab: 'seo' } },
|
|
164
|
+
{ name: 'seoOgTitle', type: 'text', form: { tab: 'seo' } },
|
|
165
|
+
{ name: 'seoOgImage', type: 'text', form: { tab: 'seo' } },
|
|
166
|
+
{ name: 'seoNoindex', type: 'boolean', form: { tab: 'seo' } },
|
|
167
|
+
],
|
|
168
|
+
};
|
|
169
|
+
export const sampleCollections = [
|
|
170
|
+
assetCollection,
|
|
171
|
+
authorCollection,
|
|
172
|
+
postCollection,
|
|
173
|
+
pageCollection,
|
|
174
|
+
];
|
|
175
|
+
/**
|
|
176
|
+
* The canonical EC-143 `filterable` declarations for the sample model — the
|
|
177
|
+
* single set the seeded schema (`@elytracms/core/persistence`), the accessor
|
|
178
|
+
* fixtures (`@elytracms/core/content`), and the studio sessions share, so the
|
|
179
|
+
* filter/sort pickers and the delivery engine agree on exactly one
|
|
180
|
+
* declaration set (EC-169 fix-pack).
|
|
181
|
+
*
|
|
182
|
+
* Deliberately *not* filterable: `title` (tests prove that filtering a
|
|
183
|
+
* real-but-undeclared field fails as a structured error) and the whole
|
|
184
|
+
* `asset` collection (a collection with no filterable fields).
|
|
185
|
+
*/
|
|
186
|
+
export const sampleFilterableFields = {
|
|
187
|
+
author: ['name'],
|
|
188
|
+
post: ['slug', 'views', 'featured', 'publishedAt', 'status', 'author'],
|
|
189
|
+
};
|
|
190
|
+
function withSampleFilterable(collection) {
|
|
191
|
+
const filterable = new Set(sampleFilterableFields[collection.id] ?? []);
|
|
192
|
+
if (filterable.size === 0)
|
|
193
|
+
return collection;
|
|
194
|
+
return {
|
|
195
|
+
...collection,
|
|
196
|
+
fields: collection.fields.map((field) => filterable.has(field.name) ? { ...field, filterable: true } : field),
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* `sampleCollections` with the canonical `filterable` declarations applied —
|
|
201
|
+
* same ids, same field shapes. `sampleCollections` itself stays undeclared on
|
|
202
|
+
* purpose (fixtures proving "no declarations → nothing offered" rely on it);
|
|
203
|
+
* schema-bearing surfaces (the persistence seed, accessor fixtures) use this
|
|
204
|
+
* variant.
|
|
205
|
+
*/
|
|
206
|
+
export const sampleFilterableCollections = sampleCollections.map(withSampleFilterable);
|
|
207
|
+
// ---- Sample documents ----
|
|
208
|
+
export const coverAsset = {
|
|
209
|
+
collection: 'asset',
|
|
210
|
+
id: 'asset-cover',
|
|
211
|
+
values: { filename: 'cover.png', url: 'https://cdn/cover.png' },
|
|
212
|
+
localized: { en: { alt: 'A cover' }, de: { alt: 'Ein Titelbild' } },
|
|
213
|
+
defaultLocale: 'en',
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* The CMS counterpart of the seeded asset-library record (`@elytracms/core/persistence`
|
|
217
|
+
* `SEED_ASSET`, id `asset_cover` — the EC-152 library). Sharing the library's
|
|
218
|
+
* id means picking that real library asset validates clean against the asset
|
|
219
|
+
* collection (EC-168/EC-172 fix-pack: the seeded post's `cover` previously had
|
|
220
|
+
* no library-matching asset document, so a re-pick failed validation).
|
|
221
|
+
* `coverAsset` above ('asset-cover') intentionally has NO library record — it
|
|
222
|
+
* remains the "missing asset record" delivery demo.
|
|
223
|
+
*/
|
|
224
|
+
export const libraryCoverAsset = {
|
|
225
|
+
collection: 'asset',
|
|
226
|
+
id: 'asset_cover',
|
|
227
|
+
values: { filename: 'cover.jpg', url: 'https://cdn/cover.jpg' },
|
|
228
|
+
localized: { en: { alt: 'Cover image' }, de: { alt: 'Titelbild' } },
|
|
229
|
+
defaultLocale: 'en',
|
|
230
|
+
};
|
|
231
|
+
export const authorAda = {
|
|
232
|
+
collection: 'author',
|
|
233
|
+
id: 'author-ada',
|
|
234
|
+
values: { name: 'Ada Lovelace', bio: 'Pioneer.' },
|
|
235
|
+
};
|
|
236
|
+
/** A valid, localized post that resolves all of its relations/assets. */
|
|
237
|
+
export const validPost = {
|
|
238
|
+
collection: 'post',
|
|
239
|
+
id: 'post-hello',
|
|
240
|
+
values: {
|
|
241
|
+
slug: 'hello-world',
|
|
242
|
+
views: 10,
|
|
243
|
+
featured: true,
|
|
244
|
+
publishedAt: '2026-01-02T00:00:00.000Z',
|
|
245
|
+
status: 'news',
|
|
246
|
+
author: { collection: 'author', id: 'author-ada' },
|
|
247
|
+
related: [],
|
|
248
|
+
cover: 'asset-cover',
|
|
249
|
+
},
|
|
250
|
+
localized: {
|
|
251
|
+
en: { title: 'Hello World', body: '<p>Hi</p>' },
|
|
252
|
+
de: { title: 'Hallo Welt', body: '<p>Hallo</p>' },
|
|
253
|
+
},
|
|
254
|
+
defaultLocale: 'en',
|
|
255
|
+
};
|
|
256
|
+
/** A post localized only in the default locale (exercises fallback, EC-018). */
|
|
257
|
+
export const partiallyLocalizedPost = {
|
|
258
|
+
collection: 'post',
|
|
259
|
+
id: 'post-fallback',
|
|
260
|
+
values: {
|
|
261
|
+
slug: 'fallback',
|
|
262
|
+
author: { collection: 'author', id: 'author-ada' },
|
|
263
|
+
},
|
|
264
|
+
localized: {
|
|
265
|
+
en: { title: 'Only English', body: '<p>en</p>' },
|
|
266
|
+
// no `de` variant — `de` requests must fall back to `en`
|
|
267
|
+
},
|
|
268
|
+
defaultLocale: 'en',
|
|
269
|
+
};
|
|
270
|
+
/**
|
|
271
|
+
* The home page as a `page`-collection document (EC-187): `name`, a static
|
|
272
|
+
* `body` composition (no bindings — v1 static props), a `layoutId` selecting the
|
|
273
|
+
* graph layout, and flat `seo*` fields. This is what a routed page resolves to;
|
|
274
|
+
* the catch-all renders `body` into `layoutId` via `renderCompositionInLayout`.
|
|
275
|
+
*/
|
|
276
|
+
export const samplePageHome = {
|
|
277
|
+
collection: 'page',
|
|
278
|
+
id: 'home',
|
|
279
|
+
values: {
|
|
280
|
+
name: 'Home',
|
|
281
|
+
layoutId: 'layout.main',
|
|
282
|
+
seoTitle: 'Welcome to Elytra',
|
|
283
|
+
seoDescription: 'A code-first website builder.',
|
|
284
|
+
body: [
|
|
285
|
+
{
|
|
286
|
+
id: 'p-home-heading',
|
|
287
|
+
componentId: 'base.primitives.Heading',
|
|
288
|
+
props: {
|
|
289
|
+
level: { kind: 'static', value: 1 },
|
|
290
|
+
text: { kind: 'static', value: 'Welcome to Elytra' },
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
id: 'p-home-intro',
|
|
295
|
+
componentId: 'base.primitives.Text',
|
|
296
|
+
props: { value: { kind: 'static', value: 'A code-first website builder.' } },
|
|
297
|
+
},
|
|
298
|
+
],
|
|
299
|
+
},
|
|
300
|
+
defaultLocale: 'en',
|
|
301
|
+
};
|
|
302
|
+
export const samplePageDocuments = [samplePageHome];
|
|
303
|
+
export const sampleDocuments = [
|
|
304
|
+
coverAsset,
|
|
305
|
+
authorAda,
|
|
306
|
+
validPost,
|
|
307
|
+
partiallyLocalizedPost,
|
|
308
|
+
libraryCoverAsset,
|
|
309
|
+
samplePageHome,
|
|
310
|
+
];
|
|
311
|
+
/**
|
|
312
|
+
* The sample documents that are PUBLISHED (EC-224), as an explicit
|
|
313
|
+
* version-POINTER set — computed from each doc's identity, never a flat `state`
|
|
314
|
+
* flag, so it survives the field's removal (B-3c-4). Seeds pin exactly these;
|
|
315
|
+
* the playground/preview treat exactly these as live. (Every current sample doc
|
|
316
|
+
* is published; a future draft sample would be omitted here.)
|
|
317
|
+
*/
|
|
318
|
+
export const samplePublishedKeys = sampleDocuments.map((doc) => documentKey(refOf(doc)));
|
|
319
|
+
// ---- Sample routes & redirects ----
|
|
320
|
+
export const sampleRoutes = [
|
|
321
|
+
{ id: 'r-home', pattern: '/', locale: 'en', document: { collection: 'page', id: 'home' } },
|
|
322
|
+
{ id: 'r-home-de', pattern: '/', locale: 'de', document: { collection: 'page', id: 'home' } },
|
|
323
|
+
{
|
|
324
|
+
id: 'r-post',
|
|
325
|
+
pattern: '/blog/:slug',
|
|
326
|
+
locale: 'en',
|
|
327
|
+
document: { collection: 'post', id: ':slug' },
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
id: 'r-about',
|
|
331
|
+
pattern: '/about',
|
|
332
|
+
locale: 'en',
|
|
333
|
+
document: { collection: 'post', id: 'post-hello' },
|
|
334
|
+
},
|
|
335
|
+
];
|
|
336
|
+
export const sampleRedirects = [
|
|
337
|
+
{ id: 'rd-1', from: '/old', to: '/about', permanent: true },
|
|
338
|
+
{ id: 'rd-chain-1', from: '/a', to: '/b', permanent: true },
|
|
339
|
+
{ id: 'rd-chain-2', from: '/b', to: '/c', permanent: true },
|
|
340
|
+
{ id: 'rd-chain-3', from: '/c', to: '/about', permanent: false },
|
|
341
|
+
];
|
|
342
|
+
/** Two routes that match the exact same concrete URLs (EC-020 conflict). */
|
|
343
|
+
export const conflictingRoutes = [
|
|
344
|
+
{
|
|
345
|
+
id: 'r-a',
|
|
346
|
+
pattern: '/blog/:slug',
|
|
347
|
+
locale: 'en',
|
|
348
|
+
document: { collection: 'post', id: ':slug' },
|
|
349
|
+
},
|
|
350
|
+
{ id: 'r-b', pattern: '/blog/:id', locale: 'en', document: { collection: 'post', id: ':id' } },
|
|
351
|
+
];
|
|
352
|
+
/** A redirect loop (EC-020). */
|
|
353
|
+
export const loopingRedirects = [
|
|
354
|
+
{ id: 'l1', from: '/x', to: '/y', permanent: true },
|
|
355
|
+
{ id: 'l2', from: '/y', to: '/x', permanent: true },
|
|
356
|
+
];
|
|
357
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../src/cms-core/fixtures.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAIhD;;;GAGG;AA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I,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE;CACjE,CAAA;AAED,4EAA4E;AAC5E,MAAM,CAAC,MAAM,iBAAiB,GAAkB;IAC9C;QACE,EAAE,EAAE,KAAK;QACT,OAAO,EAAE,aAAa;QACtB,MAAM,EAAE,IAAI;QACZ,QAAQ,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE;KAC9C;IACD,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE;CAC/F,CAAA;AAED,gCAAgC;AAChC,MAAM,CAAC,MAAM,gBAAgB,GAAqB;IAChD,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE;IACnD,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE;CACpD,CAAA"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import type { CollectionDef } from './collections';
|
|
2
|
+
import type { CmsDocument } from './documents';
|
|
3
|
+
import type { RelationFieldDef } from './fields';
|
|
4
|
+
import type { RouteRecord } from './routes';
|
|
5
|
+
/**
|
|
6
|
+
* Page hierarchy (EC-218, vision §3.4 / AD-6).
|
|
7
|
+
*
|
|
8
|
+
* A routable collection models nesting with a **`parent` self-relation** + a
|
|
9
|
+
* local **`slug`** — never a stored full path. The full nested URL is *composed*
|
|
10
|
+
* by walking the parent chain (the Payload nested-docs / Sanity page-tree
|
|
11
|
+
* pattern), so moving or renaming a parent re-derives every descendant's URL
|
|
12
|
+
* with no denormalized bulk rewrite. Every walk here is cycle-safe by
|
|
13
|
+
* construction: a parent chain that loops stops at the repeat and is surfaced as
|
|
14
|
+
* a structured issue, never an infinite loop or a crash.
|
|
15
|
+
*
|
|
16
|
+
* The slug is read non-localized (one segment per document, per the EC-218
|
|
17
|
+
* decision); locale-specific routes are still expressed by the route record's
|
|
18
|
+
* own `locale`.
|
|
19
|
+
*/
|
|
20
|
+
export interface HierarchyConfig {
|
|
21
|
+
/** Self-relation field naming a document's parent (default `parent`). */
|
|
22
|
+
parentField?: string;
|
|
23
|
+
/** Text field holding the local URL segment (default `slug`). */
|
|
24
|
+
slugField?: string;
|
|
25
|
+
}
|
|
26
|
+
/** Resolve a {@link HierarchyConfig} to its concrete field names. */
|
|
27
|
+
export declare function hierarchyFields(config?: HierarchyConfig): {
|
|
28
|
+
parentField: string;
|
|
29
|
+
slugField: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The self-relation field that names a document's parent, if this collection
|
|
33
|
+
* declares one: a single-valued `relation` field, named per the config, whose
|
|
34
|
+
* target is the collection itself.
|
|
35
|
+
*/
|
|
36
|
+
export declare function parentRelationField(collection: CollectionDef, config?: HierarchyConfig): RelationFieldDef | undefined;
|
|
37
|
+
/** Does this collection model a parent/child hierarchy (a `parent` self-relation)? */
|
|
38
|
+
export declare function isHierarchical(collection: CollectionDef, config?: HierarchyConfig): boolean;
|
|
39
|
+
export interface ComposedPath {
|
|
40
|
+
/** Slug segments from root to leaf. */
|
|
41
|
+
segments: string[];
|
|
42
|
+
/** True iff the path is clean: no cycle, no missing slug, no dangling parent. */
|
|
43
|
+
ok: boolean;
|
|
44
|
+
/** The parent chain loops. */
|
|
45
|
+
cycle: boolean;
|
|
46
|
+
/** A document in the chain (this one or an ancestor) has no slug. */
|
|
47
|
+
missingSlug: boolean;
|
|
48
|
+
/** A parent ref pointed at a document that is not present. */
|
|
49
|
+
danglingParent: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Compose a document's full path segments by walking its parent chain from the
|
|
53
|
+
* leaf up, then ordering root → leaf. Cycle-safe: revisiting a document stops
|
|
54
|
+
* the walk and flags `cycle`. `getById` looks documents up *within the same
|
|
55
|
+
* collection* (a self-relation never crosses collections).
|
|
56
|
+
*/
|
|
57
|
+
export declare function composePath(doc: CmsDocument, getById: (id: string) => CmsDocument | undefined, config?: HierarchyConfig): ComposedPath;
|
|
58
|
+
/** Does a document's parent chain loop? (cycle-safe; uses {@link composePath}). */
|
|
59
|
+
export declare function hasParentCycle(doc: CmsDocument, getById: (id: string) => CmsDocument | undefined, config?: HierarchyConfig): boolean;
|
|
60
|
+
export interface HierarchyRow {
|
|
61
|
+
doc: CmsDocument;
|
|
62
|
+
/** Nesting depth: 0 for roots, 1 for their children, … */
|
|
63
|
+
depth: number;
|
|
64
|
+
/** Whether this document has at least one child. */
|
|
65
|
+
hasChildren: boolean;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Order documents as a depth-first hierarchy (parents immediately before their
|
|
69
|
+
* children, siblings in input order), annotating each with its depth. Roots are
|
|
70
|
+
* documents with no parent, or whose parent is absent (orphans surface at the
|
|
71
|
+
* root). Cycle-safe: documents trapped in a parent cycle are never lost — they
|
|
72
|
+
* are appended at depth 0 rather than recursed into. The read-side of the
|
|
73
|
+
* hierarchical list view (EC-218).
|
|
74
|
+
*/
|
|
75
|
+
export declare function orderHierarchically(docs: readonly CmsDocument[], config?: HierarchyConfig): HierarchyRow[];
|
|
76
|
+
/**
|
|
77
|
+
* The ids of every descendant of `rootId` (children, grandchildren, …). Used to
|
|
78
|
+
* keep a `parent` picker from offering a document its own subtree — which would
|
|
79
|
+
* create a cycle. Excludes `rootId` itself; cycle-safe.
|
|
80
|
+
*/
|
|
81
|
+
export declare function descendantIds(rootId: string, docs: readonly CmsDocument[], config?: HierarchyConfig): Set<string>;
|
|
82
|
+
/**
|
|
83
|
+
* Is this route a hierarchy mount? — its pattern ends with a catch-all param
|
|
84
|
+
* segment (`:name*`), declaring "this collection's documents are served by their
|
|
85
|
+
* composed nested paths under this prefix" (EC-218). The host pulls these out of
|
|
86
|
+
* the router and resolves them per-request with {@link resolveByPath}, so the
|
|
87
|
+
* URL→document mapping stays perspective-aware (draft vs published) and the path
|
|
88
|
+
* stays derived, never stored.
|
|
89
|
+
*/
|
|
90
|
+
export declare function isHierarchyTemplate(route: RouteRecord): boolean;
|
|
91
|
+
export interface HierarchyMount {
|
|
92
|
+
/** The collection whose documents are served by composed path. */
|
|
93
|
+
collection: string;
|
|
94
|
+
/** Static URL segments before the catch-all (empty = mounted at the root). */
|
|
95
|
+
prefix: string[];
|
|
96
|
+
/** Locale this mount serves, if the template declared one. */
|
|
97
|
+
locale?: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Parse a hierarchy mount from a catch-all template route (EC-218), or undefined
|
|
101
|
+
* when the route is not a valid mount (not a catch-all, or its prefix contains a
|
|
102
|
+
* dynamic segment, which a composed-path mount does not support).
|
|
103
|
+
*/
|
|
104
|
+
export declare function hierarchyMount(route: RouteRecord): HierarchyMount | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* Resolve a path (its slug segments, prefix already stripped) to the one document
|
|
107
|
+
* whose composed nested path matches (EC-218). The caller supplies the documents
|
|
108
|
+
* already selected for the active perspective (draft/published), so resolution is
|
|
109
|
+
* perspective-aware. Documents with a broken or cyclic chain never match.
|
|
110
|
+
* Deterministic on the rare duplicate composed path: the lowest id wins (the same
|
|
111
|
+
* tie-break the single-slug fallback uses).
|
|
112
|
+
*/
|
|
113
|
+
export declare function resolveByPath(segments: readonly string[], docs: readonly CmsDocument[], config?: HierarchyConfig): CmsDocument | undefined;
|