@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,66 @@
|
|
|
1
|
+
import type { Condition } from './binding';
|
|
2
|
+
import type { ComponentNode, PropValue } from './node';
|
|
3
|
+
/**
|
|
4
|
+
* Pure, immutable editing operations over a node tree (brief §4.4, §8.2). Every
|
|
5
|
+
* function returns a NEW root and never mutates its input, so the Builder can
|
|
6
|
+
* keep an undo/redo history of graph snapshots. Nodes are addressed by id.
|
|
7
|
+
*/
|
|
8
|
+
/** A generator of fresh, unique node ids (injected for determinism in tests). */
|
|
9
|
+
export type GenerateId = () => string;
|
|
10
|
+
/** Create a deterministic, monotonic id generator (e.g. for fixtures/tests). */
|
|
11
|
+
export declare function createNodeIdGenerator(prefix?: string): GenerateId;
|
|
12
|
+
/**
|
|
13
|
+
* The highest numeric suffix among `${prefix}-<n>` ids anywhere in the tree, or
|
|
14
|
+
* 0 if none — the namespace {@link createNodeIdGenerator} mints into. Seeds a
|
|
15
|
+
* fresh generator/counter so newly minted ids never collide with ids already
|
|
16
|
+
* present in a hydrated graph (EC-203): a page restored from a saved revision
|
|
17
|
+
* already carries minted `node-<n>` ids, so a counter started at 0 would re-mint
|
|
18
|
+
* `node-1` on the first insert. Ids not matching `${prefix}-<n>` are ignored —
|
|
19
|
+
* they share no namespace with minted ids and cannot collide.
|
|
20
|
+
*/
|
|
21
|
+
export declare function maxNodeIdSeq(root: ComponentNode, prefix?: string): number;
|
|
22
|
+
/** Find a node by id anywhere in the tree (depth-first). */
|
|
23
|
+
export declare function getNode(root: ComponentNode, id: string): ComponentNode | undefined;
|
|
24
|
+
export interface ParentInfo {
|
|
25
|
+
parent: ComponentNode;
|
|
26
|
+
slot: string;
|
|
27
|
+
index: number;
|
|
28
|
+
}
|
|
29
|
+
/** Locate a node's parent, the slot it lives in, and its index. Null for the root. */
|
|
30
|
+
export declare function getParentInfo(root: ComponentNode, id: string): ParentInfo | null;
|
|
31
|
+
/** True when `ancestorId` is `id` or contains it (used to block invalid moves). */
|
|
32
|
+
export declare function isDescendantOf(root: ComponentNode, ancestorId: string, id: string): boolean;
|
|
33
|
+
/** Update a node in place (returns a new root). No-op if the node is absent. */
|
|
34
|
+
export declare function updateNode(root: ComponentNode, id: string, updater: (node: ComponentNode) => ComponentNode): ComponentNode;
|
|
35
|
+
/** Replace a node's props map. */
|
|
36
|
+
export declare function setNodeProps(root: ComponentNode, id: string, props: Record<string, PropValue>): ComponentNode;
|
|
37
|
+
/** Set a single prop value. */
|
|
38
|
+
export declare function setNodeProp(root: ComponentNode, id: string, name: string, value: PropValue): ComponentNode;
|
|
39
|
+
/** Set or clear a node's render condition (EC-088). Passing `undefined` removes it. */
|
|
40
|
+
export declare function setNodeCondition(root: ComponentNode, id: string, condition: Condition | undefined): ComponentNode;
|
|
41
|
+
/** Remove a single prop. */
|
|
42
|
+
export declare function removeNodeProp(root: ComponentNode, id: string, name: string): ComponentNode;
|
|
43
|
+
export interface InsertTarget {
|
|
44
|
+
parentId: string;
|
|
45
|
+
slot?: string;
|
|
46
|
+
/** Insert position; defaults to end of the slot. */
|
|
47
|
+
index?: number;
|
|
48
|
+
}
|
|
49
|
+
/** Insert a node into a parent's slot at an index (default: append to `children`). */
|
|
50
|
+
export declare function insertNode(root: ComponentNode, target: InsertTarget, node: ComponentNode): ComponentNode;
|
|
51
|
+
/** Remove a node by id. The root itself cannot be removed (returns root unchanged). */
|
|
52
|
+
export declare function removeNode(root: ComponentNode, id: string): ComponentNode;
|
|
53
|
+
/** Deep-clone a subtree assigning fresh ids to every node (pre-order: parent first). */
|
|
54
|
+
export declare function cloneWithNewIds(node: ComponentNode, genId: GenerateId): ComponentNode;
|
|
55
|
+
/** Duplicate a node, inserting the clone immediately after the original. Returns {root, newId}. */
|
|
56
|
+
export declare function duplicateNode(root: ComponentNode, id: string, genId: GenerateId): {
|
|
57
|
+
root: ComponentNode;
|
|
58
|
+
newId: string | null;
|
|
59
|
+
};
|
|
60
|
+
/** Move a node up (-1) or down (+1) within its current slot. */
|
|
61
|
+
export declare function reorderNode(root: ComponentNode, id: string, delta: -1 | 1): ComponentNode;
|
|
62
|
+
/**
|
|
63
|
+
* Move a node to a new parent/slot/index. No-ops on invalid moves (into itself or
|
|
64
|
+
* a descendant, or missing target). Returns the new root.
|
|
65
|
+
*/
|
|
66
|
+
export declare function moveNode(root: ComponentNode, id: string, target: InsertTarget): ComponentNode;
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { DEFAULT_SLOT } from './ids';
|
|
2
|
+
/** Create a deterministic, monotonic id generator (e.g. for fixtures/tests). */
|
|
3
|
+
export function createNodeIdGenerator(prefix = 'node') {
|
|
4
|
+
let n = 0;
|
|
5
|
+
return () => {
|
|
6
|
+
n += 1;
|
|
7
|
+
return `${prefix}-${n}`;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The highest numeric suffix among `${prefix}-<n>` ids anywhere in the tree, or
|
|
12
|
+
* 0 if none — the namespace {@link createNodeIdGenerator} mints into. Seeds a
|
|
13
|
+
* fresh generator/counter so newly minted ids never collide with ids already
|
|
14
|
+
* present in a hydrated graph (EC-203): a page restored from a saved revision
|
|
15
|
+
* already carries minted `node-<n>` ids, so a counter started at 0 would re-mint
|
|
16
|
+
* `node-1` on the first insert. Ids not matching `${prefix}-<n>` are ignored —
|
|
17
|
+
* they share no namespace with minted ids and cannot collide.
|
|
18
|
+
*/
|
|
19
|
+
export function maxNodeIdSeq(root, prefix = 'node') {
|
|
20
|
+
const pattern = new RegExp(`^${prefix}-(\\d+)$`);
|
|
21
|
+
let max = 0;
|
|
22
|
+
const visit = (node) => {
|
|
23
|
+
const match = pattern.exec(node.id);
|
|
24
|
+
if (match)
|
|
25
|
+
max = Math.max(max, Number(match[1]));
|
|
26
|
+
for (const children of Object.values(node.slots ?? {}))
|
|
27
|
+
for (const child of children)
|
|
28
|
+
visit(child);
|
|
29
|
+
};
|
|
30
|
+
visit(root);
|
|
31
|
+
return max;
|
|
32
|
+
}
|
|
33
|
+
/** Find a node by id anywhere in the tree (depth-first). */
|
|
34
|
+
export function getNode(root, id) {
|
|
35
|
+
if (root.id === id)
|
|
36
|
+
return root;
|
|
37
|
+
for (const children of Object.values(root.slots ?? {})) {
|
|
38
|
+
for (const child of children) {
|
|
39
|
+
const found = getNode(child, id);
|
|
40
|
+
if (found)
|
|
41
|
+
return found;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
/** Locate a node's parent, the slot it lives in, and its index. Null for the root. */
|
|
47
|
+
export function getParentInfo(root, id) {
|
|
48
|
+
for (const [slot, children] of Object.entries(root.slots ?? {})) {
|
|
49
|
+
const index = children.findIndex((c) => c.id === id);
|
|
50
|
+
if (index >= 0)
|
|
51
|
+
return { parent: root, slot, index };
|
|
52
|
+
for (const child of children) {
|
|
53
|
+
const found = getParentInfo(child, id);
|
|
54
|
+
if (found)
|
|
55
|
+
return found;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
/** True when `ancestorId` is `id` or contains it (used to block invalid moves). */
|
|
61
|
+
export function isDescendantOf(root, ancestorId, id) {
|
|
62
|
+
const ancestor = getNode(root, ancestorId);
|
|
63
|
+
if (!ancestor)
|
|
64
|
+
return false;
|
|
65
|
+
return getNode(ancestor, id) !== undefined;
|
|
66
|
+
}
|
|
67
|
+
/** Rebuild the tree, replacing the node with `id` by `fn(node)` (or removing it if fn returns null). */
|
|
68
|
+
function rewrite(node, id, fn) {
|
|
69
|
+
if (node.id === id)
|
|
70
|
+
return fn(node);
|
|
71
|
+
if (!node.slots)
|
|
72
|
+
return node;
|
|
73
|
+
const slots = {};
|
|
74
|
+
for (const [slot, children] of Object.entries(node.slots)) {
|
|
75
|
+
slots[slot] = children
|
|
76
|
+
.map((child) => rewrite(child, id, fn))
|
|
77
|
+
.filter((c) => c !== null);
|
|
78
|
+
}
|
|
79
|
+
return { ...node, slots };
|
|
80
|
+
}
|
|
81
|
+
/** Update a node in place (returns a new root). No-op if the node is absent. */
|
|
82
|
+
export function updateNode(root, id, updater) {
|
|
83
|
+
return rewrite(root, id, updater) ?? root;
|
|
84
|
+
}
|
|
85
|
+
/** Replace a node's props map. */
|
|
86
|
+
export function setNodeProps(root, id, props) {
|
|
87
|
+
return updateNode(root, id, (node) => ({ ...node, props }));
|
|
88
|
+
}
|
|
89
|
+
/** Set a single prop value. */
|
|
90
|
+
export function setNodeProp(root, id, name, value) {
|
|
91
|
+
return updateNode(root, id, (node) => ({ ...node, props: { ...node.props, [name]: value } }));
|
|
92
|
+
}
|
|
93
|
+
/** Set or clear a node's render condition (EC-088). Passing `undefined` removes it. */
|
|
94
|
+
export function setNodeCondition(root, id, condition) {
|
|
95
|
+
return updateNode(root, id, (node) => {
|
|
96
|
+
if (condition === undefined) {
|
|
97
|
+
if (node.condition === undefined)
|
|
98
|
+
return node;
|
|
99
|
+
const { condition: _removed, ...rest } = node;
|
|
100
|
+
return rest;
|
|
101
|
+
}
|
|
102
|
+
return { ...node, condition };
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/** Remove a single prop. */
|
|
106
|
+
export function removeNodeProp(root, id, name) {
|
|
107
|
+
return updateNode(root, id, (node) => {
|
|
108
|
+
if (!node.props || !(name in node.props))
|
|
109
|
+
return node;
|
|
110
|
+
const props = { ...node.props };
|
|
111
|
+
delete props[name];
|
|
112
|
+
return { ...node, props };
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/** Insert a node into a parent's slot at an index (default: append to `children`). */
|
|
116
|
+
export function insertNode(root, target, node) {
|
|
117
|
+
const slot = target.slot ?? DEFAULT_SLOT;
|
|
118
|
+
return updateNode(root, target.parentId, (parent) => {
|
|
119
|
+
const slots = { ...(parent.slots ?? {}) };
|
|
120
|
+
const children = [...(slots[slot] ?? [])];
|
|
121
|
+
const index = target.index ?? children.length;
|
|
122
|
+
children.splice(Math.max(0, Math.min(index, children.length)), 0, node);
|
|
123
|
+
slots[slot] = children;
|
|
124
|
+
return { ...parent, slots };
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
/** Remove a node by id. The root itself cannot be removed (returns root unchanged). */
|
|
128
|
+
export function removeNode(root, id) {
|
|
129
|
+
if (root.id === id)
|
|
130
|
+
return root;
|
|
131
|
+
return rewrite(root, id, () => null) ?? root;
|
|
132
|
+
}
|
|
133
|
+
/** Deep-clone a subtree assigning fresh ids to every node (pre-order: parent first). */
|
|
134
|
+
export function cloneWithNewIds(node, genId) {
|
|
135
|
+
const id = genId();
|
|
136
|
+
const slots = node.slots
|
|
137
|
+
? Object.fromEntries(Object.entries(node.slots).map(([slot, children]) => [
|
|
138
|
+
slot,
|
|
139
|
+
children.map((child) => cloneWithNewIds(child, genId)),
|
|
140
|
+
]))
|
|
141
|
+
: undefined;
|
|
142
|
+
return {
|
|
143
|
+
...node,
|
|
144
|
+
id,
|
|
145
|
+
...(node.props ? { props: { ...node.props } } : {}),
|
|
146
|
+
...(slots ? { slots } : {}),
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/** Duplicate a node, inserting the clone immediately after the original. Returns {root, newId}. */
|
|
150
|
+
export function duplicateNode(root, id, genId) {
|
|
151
|
+
const original = getNode(root, id);
|
|
152
|
+
const info = getParentInfo(root, id);
|
|
153
|
+
if (!original || !info)
|
|
154
|
+
return { root, newId: null };
|
|
155
|
+
const clone = cloneWithNewIds(original, genId);
|
|
156
|
+
const next = insertNode(root, { parentId: info.parent.id, slot: info.slot, index: info.index + 1 }, clone);
|
|
157
|
+
return { root: next, newId: clone.id };
|
|
158
|
+
}
|
|
159
|
+
/** Move a node up (-1) or down (+1) within its current slot. */
|
|
160
|
+
export function reorderNode(root, id, delta) {
|
|
161
|
+
const info = getParentInfo(root, id);
|
|
162
|
+
if (!info)
|
|
163
|
+
return root;
|
|
164
|
+
const target = info.index + delta;
|
|
165
|
+
return updateNode(root, info.parent.id, (parent) => {
|
|
166
|
+
const slots = { ...(parent.slots ?? {}) };
|
|
167
|
+
const children = [...(slots[info.slot] ?? [])];
|
|
168
|
+
if (target < 0 || target >= children.length)
|
|
169
|
+
return parent;
|
|
170
|
+
const [moved] = children.splice(info.index, 1);
|
|
171
|
+
children.splice(target, 0, moved);
|
|
172
|
+
slots[info.slot] = children;
|
|
173
|
+
return { ...parent, slots };
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Move a node to a new parent/slot/index. No-ops on invalid moves (into itself or
|
|
178
|
+
* a descendant, or missing target). Returns the new root.
|
|
179
|
+
*/
|
|
180
|
+
export function moveNode(root, id, target) {
|
|
181
|
+
if (id === target.parentId || isDescendantOf(root, id, target.parentId))
|
|
182
|
+
return root;
|
|
183
|
+
const node = getNode(root, id);
|
|
184
|
+
if (!node || root.id === id)
|
|
185
|
+
return root;
|
|
186
|
+
const before = getParentInfo(root, id);
|
|
187
|
+
const removed = removeNode(root, id);
|
|
188
|
+
// Removing the node shifts later siblings left by one, so when re-inserting into
|
|
189
|
+
// the SAME slot at a later index, decrement the requested index to compensate.
|
|
190
|
+
const slot = target.slot ?? DEFAULT_SLOT;
|
|
191
|
+
let index = target.index;
|
|
192
|
+
if (index != null &&
|
|
193
|
+
before &&
|
|
194
|
+
before.parent.id === target.parentId &&
|
|
195
|
+
before.slot === slot &&
|
|
196
|
+
before.index < index) {
|
|
197
|
+
index -= 1;
|
|
198
|
+
}
|
|
199
|
+
return insertNode(removed, { ...target, index }, node);
|
|
200
|
+
}
|
|
201
|
+
//# sourceMappingURL=edit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../src/project-graph/edit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAYpC,gFAAgF;AAChF,MAAM,UAAU,qBAAqB,CAAC,MAAM,GAAG,MAAM;IACnD,IAAI,CAAC,GAAG,CAAC,CAAA;IACT,OAAO,GAAG,EAAE;QACV,CAAC,IAAI,CAAC,CAAA;QACN,OAAO,GAAG,MAAM,IAAI,CAAC,EAAE,CAAA;IACzB,CAAC,CAAA;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,IAAmB,EAAE,MAAM,GAAG,MAAM;IAC/D,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,IAAI,MAAM,UAAU,CAAC,CAAA;IAChD,IAAI,GAAG,GAAG,CAAC,CAAA;IACX,MAAM,KAAK,GAAG,CAAC,IAAmB,EAAQ,EAAE;QAC1C,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';
|
|
2
|
+
import type { ProjectGraph } from './structure';
|
|
3
|
+
import type { ManifestView } from './validate';
|
|
4
|
+
/**
|
|
5
|
+
* Minimal manifest views for the primitives used by the sample graphs. Lets the graph
|
|
6
|
+
* package validate its own fixtures without depending on the component registry. The
|
|
7
|
+
* registry's real manifests satisfy the same `ManifestView` shape.
|
|
8
|
+
*/
|
|
9
|
+
export declare const sampleManifestViews: Record<string, ManifestView>;
|
|
10
|
+
export declare const sampleKnownSourceIds: ReadonlySet<string>;
|
|
11
|
+
/**
|
|
12
|
+
* A sample composition (EC-187): the home page's `body` field value — an ordered
|
|
13
|
+
* list of component nodes the renderer composes into a layout outlet. This is the
|
|
14
|
+
* page content that used to live on `validSampleGraph.pages[0].root`; the graph is
|
|
15
|
+
* now layouts-only, so the page body lives here (and, at delivery, in a `page`
|
|
16
|
+
* collection document — see `@elytracms/core/cms-core` `samplePageDocuments`).
|
|
17
|
+
*/
|
|
18
|
+
export declare const sampleHomeComposition: ComponentNode[];
|
|
19
|
+
/** A valid sample project graph (brief §10 / Phase 1) — LAYOUTS-ONLY (EC-187). */
|
|
20
|
+
export declare const validSampleGraph: ProjectGraph;
|
|
21
|
+
export declare const nodeWithInvalidComponentName: ComponentNode;
|
|
22
|
+
export declare const graphWithInvalidComponentName: ProjectGraph;
|
|
23
|
+
export declare const nodeWithUnknownComponent: ComponentNode;
|
|
24
|
+
export declare const graphWithUnknownComponent: ProjectGraph;
|
|
25
|
+
export declare const nodeWithMissingRequiredSlot: ComponentNode;
|
|
26
|
+
export declare const graphWithMissingRequiredSlot: ProjectGraph;
|
|
27
|
+
export declare const nodeWithUnresolvedBinding: ComponentNode;
|
|
28
|
+
export declare const graphWithUnresolvedBinding: ProjectGraph;
|
|
29
|
+
export declare const nodeWithDuplicateIds: ComponentNode;
|
|
30
|
+
export declare const graphWithDuplicateIds: ProjectGraph;
|
|
31
|
+
/** A simple in-memory `ComponentLookup` over the sample manifest views. */
|
|
32
|
+
export declare const sampleComponentLookup: {
|
|
33
|
+
has: (id: string) => boolean;
|
|
34
|
+
get: (id: string) => ManifestView | undefined;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* A valid container graph with every canonical prop token-bound: a vertical Stack
|
|
38
|
+
* (gap `4`, align `start`) holding a 2-column Grid (gap `2`) of mixed children and
|
|
39
|
+
* a horizontal Stack. Round-trips losslessly through serialization.
|
|
40
|
+
*/
|
|
41
|
+
export declare const tokenizedContainersGraph: ProjectGraph;
|
|
42
|
+
/**
|
|
43
|
+
* Degenerate "wrapper soup": single-child Stack chains, an empty Grid, and a
|
|
44
|
+
* container-of-containers — the canonical input for normalization tests.
|
|
45
|
+
* `normalizeContainers` collapses it to a root Stack with two Text children.
|
|
46
|
+
*/
|
|
47
|
+
export declare const wrapperSoupGraph: ProjectGraph;
|
|
48
|
+
export declare const graphWithInvalidContainerDirection: ProjectGraph;
|
|
49
|
+
export declare const graphWithInvalidContainerGap: ProjectGraph;
|
|
50
|
+
export declare const graphWithInvalidContainerColumns: ProjectGraph;
|
|
51
|
+
export declare const graphWithInvalidContainerAlignment: ProjectGraph;
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { OUTLET_SLOT } from './ids';
|
|
2
|
+
import { PROJECT_GRAPH_SCHEMA_VERSION } from './structure';
|
|
3
|
+
import { containerAlignmentSchema, gridColumnsSchema, gridContainerNode, isSpacingTokenName, stackContainerNode, stackDirectionSchema, } from './container';
|
|
4
|
+
const isGapValue = (v) => isSpacingTokenName(v) || (typeof v === 'number' && Number.isInteger(v) && v >= 0);
|
|
5
|
+
/**
|
|
6
|
+
* Minimal manifest views for the primitives used by the sample graphs. Lets the graph
|
|
7
|
+
* package validate its own fixtures without depending on the component registry. The
|
|
8
|
+
* registry's real manifests satisfy the same `ManifestView` shape.
|
|
9
|
+
*/
|
|
10
|
+
export const sampleManifestViews = {
|
|
11
|
+
'base.primitives.Stack': {
|
|
12
|
+
id: 'base.primitives.Stack',
|
|
13
|
+
props: {
|
|
14
|
+
// Token name (canonical) or legacy non-negative integer (EC-161).
|
|
15
|
+
gap: { bindable: true, validate: isGapValue },
|
|
16
|
+
direction: { bindable: false, validate: (v) => stackDirectionSchema.safeParse(v).success },
|
|
17
|
+
align: { bindable: false, validate: (v) => containerAlignmentSchema.safeParse(v).success },
|
|
18
|
+
},
|
|
19
|
+
slots: [{ name: 'children' }],
|
|
20
|
+
},
|
|
21
|
+
'base.primitives.Grid': {
|
|
22
|
+
id: 'base.primitives.Grid',
|
|
23
|
+
props: {
|
|
24
|
+
columns: { bindable: true, validate: (v) => gridColumnsSchema.safeParse(v).success },
|
|
25
|
+
gap: { bindable: true, validate: isGapValue },
|
|
26
|
+
align: { bindable: false, validate: (v) => containerAlignmentSchema.safeParse(v).success },
|
|
27
|
+
},
|
|
28
|
+
slots: [{ name: 'children' }],
|
|
29
|
+
},
|
|
30
|
+
'base.primitives.Heading': {
|
|
31
|
+
id: 'base.primitives.Heading',
|
|
32
|
+
props: {
|
|
33
|
+
level: { bindable: false, validate: (v) => typeof v === 'number' && v >= 1 && v <= 6 },
|
|
34
|
+
text: { bindable: true, validate: (v) => typeof v === 'string' },
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
'base.primitives.Text': {
|
|
38
|
+
id: 'base.primitives.Text',
|
|
39
|
+
props: { value: { bindable: true, validate: (v) => typeof v === 'string' } },
|
|
40
|
+
},
|
|
41
|
+
'base.primitives.Repeater': {
|
|
42
|
+
id: 'base.primitives.Repeater',
|
|
43
|
+
props: { items: { bindable: true } },
|
|
44
|
+
slots: [{ name: 'item', required: true }],
|
|
45
|
+
},
|
|
46
|
+
'base.primitives.Container': {
|
|
47
|
+
id: 'base.primitives.Container',
|
|
48
|
+
// The outlet is filled by the renderer (composition injection), so it is not authored-required.
|
|
49
|
+
slots: [{ name: OUTLET_SLOT }],
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
export const sampleKnownSourceIds = new Set(['cms.posts']);
|
|
53
|
+
const mainLayoutRoot = {
|
|
54
|
+
id: 'n-layout-root',
|
|
55
|
+
componentId: 'base.primitives.Container',
|
|
56
|
+
slots: { [OUTLET_SLOT]: [] },
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* A sample composition (EC-187): the home page's `body` field value — an ordered
|
|
60
|
+
* list of component nodes the renderer composes into a layout outlet. This is the
|
|
61
|
+
* page content that used to live on `validSampleGraph.pages[0].root`; the graph is
|
|
62
|
+
* now layouts-only, so the page body lives here (and, at delivery, in a `page`
|
|
63
|
+
* collection document — see `@elytracms/core/cms-core` `samplePageDocuments`).
|
|
64
|
+
*/
|
|
65
|
+
export const sampleHomeComposition = [
|
|
66
|
+
{
|
|
67
|
+
id: 'n-heading',
|
|
68
|
+
componentId: 'base.primitives.Heading',
|
|
69
|
+
props: {
|
|
70
|
+
level: { kind: 'static', value: 1 },
|
|
71
|
+
text: { kind: 'static', value: 'Welcome to Elytra' },
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: 'n-intro',
|
|
76
|
+
componentId: 'base.primitives.Text',
|
|
77
|
+
props: { value: { kind: 'static', value: 'A code-first website builder.' } },
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 'n-repeater',
|
|
81
|
+
componentId: 'base.primitives.Repeater',
|
|
82
|
+
props: { items: { kind: 'binding', binding: { sourceId: 'cms.posts', token: '/', mode: 'value' } } },
|
|
83
|
+
slots: {
|
|
84
|
+
item: [
|
|
85
|
+
{
|
|
86
|
+
id: 'n-post-title',
|
|
87
|
+
componentId: 'base.primitives.Text',
|
|
88
|
+
props: {
|
|
89
|
+
value: { kind: 'binding', binding: { sourceId: 'cms.posts', token: '/title', mode: 'repeaterItem' } },
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
];
|
|
96
|
+
/** A valid sample project graph (brief §10 / Phase 1) — LAYOUTS-ONLY (EC-187). */
|
|
97
|
+
export const validSampleGraph = {
|
|
98
|
+
id: 'proj-sample',
|
|
99
|
+
schemaVersion: PROJECT_GRAPH_SCHEMA_VERSION,
|
|
100
|
+
metadata: { name: 'Sample Project' },
|
|
101
|
+
layouts: [{ id: 'layout.main', name: 'Main', root: mainLayoutRoot }],
|
|
102
|
+
};
|
|
103
|
+
// ---- Invalid-state fixtures (each isolates exactly one issue) ----
|
|
104
|
+
//
|
|
105
|
+
// EC-187: `validateProjectGraph` walks LAYOUTS only — a page is a composition
|
|
106
|
+
// field value validated by `validateCompositionValue`. So each invalid-state
|
|
107
|
+
// fixture places its single defect on a LAYOUT root, and the matching bare
|
|
108
|
+
// `ComponentNode` is also exported for tests that validate a composition value
|
|
109
|
+
// directly (`validateComponentNode` / `validateCompositionValue`).
|
|
110
|
+
/** A layouts-only graph wrapping one defective root as a layout. */
|
|
111
|
+
function layoutGraph(id, root) {
|
|
112
|
+
return {
|
|
113
|
+
id,
|
|
114
|
+
schemaVersion: PROJECT_GRAPH_SCHEMA_VERSION,
|
|
115
|
+
layouts: [{ id: `${id}.layout`, name: 'Layout', root }],
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
export const nodeWithInvalidComponentName = {
|
|
119
|
+
id: 'n-bad',
|
|
120
|
+
componentId: 'NotNamespaced',
|
|
121
|
+
props: {},
|
|
122
|
+
};
|
|
123
|
+
export const graphWithInvalidComponentName = layoutGraph('proj-bad-name', nodeWithInvalidComponentName);
|
|
124
|
+
export const nodeWithUnknownComponent = {
|
|
125
|
+
id: 'n-missing',
|
|
126
|
+
componentId: 'project.DoesNotExist',
|
|
127
|
+
};
|
|
128
|
+
export const graphWithUnknownComponent = layoutGraph('proj-unknown', nodeWithUnknownComponent);
|
|
129
|
+
export const nodeWithMissingRequiredSlot = {
|
|
130
|
+
id: 'n-empty-repeater',
|
|
131
|
+
componentId: 'base.primitives.Repeater',
|
|
132
|
+
props: {},
|
|
133
|
+
slots: {},
|
|
134
|
+
};
|
|
135
|
+
export const graphWithMissingRequiredSlot = layoutGraph('proj-missing-slot', nodeWithMissingRequiredSlot);
|
|
136
|
+
export const nodeWithUnresolvedBinding = {
|
|
137
|
+
id: 'n-text',
|
|
138
|
+
componentId: 'base.primitives.Text',
|
|
139
|
+
props: { value: { kind: 'binding', binding: { sourceId: 'missing.source', token: '/x', mode: 'value' } } },
|
|
140
|
+
};
|
|
141
|
+
export const graphWithUnresolvedBinding = layoutGraph('proj-unresolved', nodeWithUnresolvedBinding);
|
|
142
|
+
export const nodeWithDuplicateIds = {
|
|
143
|
+
id: 'dup',
|
|
144
|
+
componentId: 'base.primitives.Stack',
|
|
145
|
+
slots: { children: [{ id: 'dup', componentId: 'base.primitives.Text', props: { value: { kind: 'static', value: 'x' } } }] },
|
|
146
|
+
};
|
|
147
|
+
export const graphWithDuplicateIds = layoutGraph('proj-dupe', nodeWithDuplicateIds);
|
|
148
|
+
/** A simple in-memory `ComponentLookup` over the sample manifest views. */
|
|
149
|
+
export const sampleComponentLookup = {
|
|
150
|
+
has: (id) => id in sampleManifestViews,
|
|
151
|
+
get: (id) => sampleManifestViews[id],
|
|
152
|
+
};
|
|
153
|
+
// ---- Layout-container fixtures (EC-161) ----
|
|
154
|
+
const textNode = (id, value) => ({
|
|
155
|
+
id,
|
|
156
|
+
componentId: 'base.primitives.Text',
|
|
157
|
+
props: { value: { kind: 'static', value } },
|
|
158
|
+
});
|
|
159
|
+
function containerGraph(id, root) {
|
|
160
|
+
return {
|
|
161
|
+
id,
|
|
162
|
+
schemaVersion: PROJECT_GRAPH_SCHEMA_VERSION,
|
|
163
|
+
layouts: [{ id: `${id}.layout`, name: 'Layout', root }],
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* A valid container graph with every canonical prop token-bound: a vertical Stack
|
|
168
|
+
* (gap `4`, align `start`) holding a 2-column Grid (gap `2`) of mixed children and
|
|
169
|
+
* a horizontal Stack. Round-trips losslessly through serialization.
|
|
170
|
+
*/
|
|
171
|
+
export const tokenizedContainersGraph = containerGraph('proj-containers', stackContainerNode('n-root', { direction: 'vertical', gap: '4', align: 'start' }, [
|
|
172
|
+
gridContainerNode('n-grid', { columns: 2, gap: '2', align: 'stretch' }, [
|
|
173
|
+
textNode('n-cell-1', 'Cell one'),
|
|
174
|
+
{
|
|
175
|
+
id: 'n-cell-2',
|
|
176
|
+
componentId: 'base.primitives.Heading',
|
|
177
|
+
props: { level: { kind: 'static', value: 2 }, text: { kind: 'static', value: 'Cell two' } },
|
|
178
|
+
},
|
|
179
|
+
]),
|
|
180
|
+
stackContainerNode('n-row', { direction: 'horizontal', gap: '2', align: 'center' }, [
|
|
181
|
+
textNode('n-row-a', 'Left'),
|
|
182
|
+
textNode('n-row-b', 'Right'),
|
|
183
|
+
]),
|
|
184
|
+
]));
|
|
185
|
+
/**
|
|
186
|
+
* Degenerate "wrapper soup": single-child Stack chains, an empty Grid, and a
|
|
187
|
+
* container-of-containers — the canonical input for normalization tests.
|
|
188
|
+
* `normalizeContainers` collapses it to a root Stack with two Text children.
|
|
189
|
+
*/
|
|
190
|
+
export const wrapperSoupGraph = containerGraph('proj-soup', stackContainerNode('n-root', { gap: '4' }, [
|
|
191
|
+
stackContainerNode('n-wrap-1', { gap: '2' }, [
|
|
192
|
+
stackContainerNode('n-wrap-2', {}, [
|
|
193
|
+
gridContainerNode('n-wrap-3', { columns: 2 }, [textNode('n-deep', 'Deeply wrapped')]),
|
|
194
|
+
]),
|
|
195
|
+
]),
|
|
196
|
+
gridContainerNode('n-empty-grid', { columns: 3, gap: '2' }, []),
|
|
197
|
+
textNode('n-plain', 'Plain sibling'),
|
|
198
|
+
]));
|
|
199
|
+
// Malformed-container fixtures — each isolates exactly one issue.
|
|
200
|
+
export const graphWithInvalidContainerDirection = containerGraph('proj-bad-direction', {
|
|
201
|
+
id: 'n-bad-direction',
|
|
202
|
+
componentId: 'base.primitives.Stack',
|
|
203
|
+
props: { direction: { kind: 'static', value: 'diagonal' } },
|
|
204
|
+
slots: { children: [textNode('n-d1', 'a'), textNode('n-d2', 'b')] },
|
|
205
|
+
});
|
|
206
|
+
export const graphWithInvalidContainerGap = containerGraph('proj-bad-gap', {
|
|
207
|
+
id: 'n-bad-gap',
|
|
208
|
+
componentId: 'base.primitives.Stack',
|
|
209
|
+
props: { gap: { kind: 'static', value: '17rem' } },
|
|
210
|
+
slots: { children: [textNode('n-g1', 'a'), textNode('n-g2', 'b')] },
|
|
211
|
+
});
|
|
212
|
+
export const graphWithInvalidContainerColumns = containerGraph('proj-bad-columns', {
|
|
213
|
+
id: 'n-bad-columns',
|
|
214
|
+
componentId: 'base.primitives.Grid',
|
|
215
|
+
props: { columns: { kind: 'static', value: 0 } },
|
|
216
|
+
slots: { children: [textNode('n-c1', 'a'), textNode('n-c2', 'b')] },
|
|
217
|
+
});
|
|
218
|
+
export const graphWithInvalidContainerAlignment = containerGraph('proj-bad-align', {
|
|
219
|
+
id: 'n-bad-align',
|
|
220
|
+
componentId: 'base.primitives.Grid',
|
|
221
|
+
props: { columns: { kind: 'static', value: 2 }, align: { kind: 'static', value: 'justify' } },
|
|
222
|
+
slots: { children: [textNode('n-a1', 'a'), textNode('n-a2', 'b')] },
|
|
223
|
+
});
|
|
224
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../src/project-graph/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAGnC,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAE1D,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,aAAa,CAAA;AAEpB,MAAM,UAAU,GAAG,CAAC,CAAU,EAAW,EAAE,CACzC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,SA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E,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE;IAC7F,KAAK,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE;CACpE,CAAC,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Generic non-empty identifier used for node / page / layout / project ids. */
|
|
3
|
+
export declare const idSchema: z.ZodString;
|
|
4
|
+
export type Id = z.infer<typeof idSchema>;
|
|
5
|
+
/**
|
|
6
|
+
* Namespaced component id, e.g. `base.primitives.Stack` or `project.MarketingHero`.
|
|
7
|
+
*
|
|
8
|
+
* NOTE: the graph schema stores component ids as plain non-empty strings so that a
|
|
9
|
+
* graph referencing a badly-named or unknown component still *parses* (the renderer
|
|
10
|
+
* can show a fallback and the validator can emit a structured issue). Naming is
|
|
11
|
+
* checked semantically in `validate.ts`, not at parse time.
|
|
12
|
+
*/
|
|
13
|
+
export declare const COMPONENT_ID_PATTERN: RegExp;
|
|
14
|
+
export declare function isValidComponentId(componentId: string): boolean;
|
|
15
|
+
/** The reserved default-children slot name and the layout outlet slot name. */
|
|
16
|
+
export declare const DEFAULT_SLOT = "children";
|
|
17
|
+
export declare const OUTLET_SLOT = "outlet";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Generic non-empty identifier used for node / page / layout / project ids. */
|
|
3
|
+
export const idSchema = z.string().min(1);
|
|
4
|
+
/**
|
|
5
|
+
* Namespaced component id, e.g. `base.primitives.Stack` or `project.MarketingHero`.
|
|
6
|
+
*
|
|
7
|
+
* NOTE: the graph schema stores component ids as plain non-empty strings so that a
|
|
8
|
+
* graph referencing a badly-named or unknown component still *parses* (the renderer
|
|
9
|
+
* can show a fallback and the validator can emit a structured issue). Naming is
|
|
10
|
+
* checked semantically in `validate.ts`, not at parse time.
|
|
11
|
+
*/
|
|
12
|
+
export const COMPONENT_ID_PATTERN = /^(base\.primitives|project)\.[A-Za-z][A-Za-z0-9]*(\.[A-Za-z][A-Za-z0-9]*)*$/;
|
|
13
|
+
export function isValidComponentId(componentId) {
|
|
14
|
+
return COMPONENT_ID_PATTERN.test(componentId);
|
|
15
|
+
}
|
|
16
|
+
/** The reserved default-children slot name and the layout outlet slot name. */
|
|
17
|
+
export const DEFAULT_SLOT = 'children';
|
|
18
|
+
export const OUTLET_SLOT = 'outlet';
|
|
19
|
+
//# sourceMappingURL=ids.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids.js","sourceRoot":"","sources":["../../src/project-graph/ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,gFAAgF;AAChF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AAGzC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAC/B,6EAA6E,CAAA;AAE/E,MAAM,UAAU,kBAAkB,CAAC,WAAmB;IACpD,OAAO,oBAAoB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;AAC/C,CAAC;AAED,+EAA+E;AAC/E,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAA;AACtC,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './json';
|
|
2
|
+
export * from './ids';
|
|
3
|
+
export * from './binding';
|
|
4
|
+
export * from './node';
|
|
5
|
+
export * from './structure';
|
|
6
|
+
export * from './container';
|
|
7
|
+
export * from './normalize';
|
|
8
|
+
export * from './issues';
|
|
9
|
+
export * from './validate';
|
|
10
|
+
export * from './serialize';
|
|
11
|
+
export * from './edit';
|
|
12
|
+
export * from './fixtures';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './json';
|
|
2
|
+
export * from './ids';
|
|
3
|
+
export * from './binding';
|
|
4
|
+
export * from './node';
|
|
5
|
+
export * from './structure';
|
|
6
|
+
export * from './container';
|
|
7
|
+
export * from './normalize';
|
|
8
|
+
export * from './issues';
|
|
9
|
+
export * from './validate';
|
|
10
|
+
export * from './serialize';
|
|
11
|
+
export * from './edit';
|
|
12
|
+
export * from './fixtures';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/project-graph/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,OAAO,CAAA;AACrB,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA"}
|