@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 { z } from 'zod';
|
|
2
|
+
import type { StarterKit } from '@elytracms/core/starter-kits';
|
|
3
|
+
/**
|
|
4
|
+
* Project templates (EC-136). A project template is a third-party-authored, distributable seed: an
|
|
5
|
+
* envelope (id/name/version/author/source/tags) wrapping a validated {@link StarterKit}. Templates
|
|
6
|
+
* extend the starter-kit format (EC-114–121) with provenance + distribution metadata, and reuse
|
|
7
|
+
* the canonical kit validation so an imported template is checked exactly like a first-party seed
|
|
8
|
+
* (graph, manifests, CMS schemas, seed content) before it can create a project.
|
|
9
|
+
*/
|
|
10
|
+
/** Where a template came from — drives trust UI and private/marketplace flows. */
|
|
11
|
+
export declare const templateSourceSchema: z.ZodEnum<{
|
|
12
|
+
builtin: "builtin";
|
|
13
|
+
community: "community";
|
|
14
|
+
private: "private";
|
|
15
|
+
}>;
|
|
16
|
+
export type TemplateSource = z.infer<typeof templateSourceSchema>;
|
|
17
|
+
export declare const templateMetaSchema: z.ZodObject<{
|
|
18
|
+
id: z.ZodString;
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
version: z.ZodString;
|
|
21
|
+
author: z.ZodOptional<z.ZodString>;
|
|
22
|
+
source: z.ZodDefault<z.ZodEnum<{
|
|
23
|
+
builtin: "builtin";
|
|
24
|
+
community: "community";
|
|
25
|
+
private: "private";
|
|
26
|
+
}>>;
|
|
27
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export type TemplateMeta = z.infer<typeof templateMetaSchema>;
|
|
30
|
+
/** A distributable project template (EC-136). */
|
|
31
|
+
export interface ProjectTemplate extends TemplateMeta {
|
|
32
|
+
/** The seed this template instantiates. */
|
|
33
|
+
kit: StarterKit;
|
|
34
|
+
}
|
|
35
|
+
/** A structured validation issue for a project template. */
|
|
36
|
+
export interface TemplateIssue {
|
|
37
|
+
code: 'meta' | 'kit';
|
|
38
|
+
severity: 'error' | 'warning';
|
|
39
|
+
message: string;
|
|
40
|
+
ref?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Validate a project template before import (EC-136): the envelope, then the bundled kit via the
|
|
44
|
+
* canonical `validateKit`. Returns structured issues; never throws. A template with any `error`
|
|
45
|
+
* must not be imported.
|
|
46
|
+
*/
|
|
47
|
+
export declare function validateProjectTemplate(template: ProjectTemplate): TemplateIssue[];
|
|
48
|
+
/** True when a template validates with no errors. */
|
|
49
|
+
export declare function isProjectTemplateValid(template: ProjectTemplate): boolean;
|
|
50
|
+
/** A structured registration issue for the template registry. */
|
|
51
|
+
export interface TemplateRegistryIssue {
|
|
52
|
+
code: 'duplicate' | 'invalid';
|
|
53
|
+
message: string;
|
|
54
|
+
ref: string;
|
|
55
|
+
}
|
|
56
|
+
/** Registry of project templates keyed by id; validates on registration. */
|
|
57
|
+
export declare class TemplateRegistry {
|
|
58
|
+
private readonly byId;
|
|
59
|
+
readonly issues: TemplateRegistryIssue[];
|
|
60
|
+
constructor(templates?: Iterable<ProjectTemplate>);
|
|
61
|
+
register(template: ProjectTemplate): void;
|
|
62
|
+
has(id: string): boolean;
|
|
63
|
+
get(id: string): ProjectTemplate | undefined;
|
|
64
|
+
list(): ProjectTemplate[];
|
|
65
|
+
get size(): number;
|
|
66
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { validateKit } from '@elytracms/core/starter-kits';
|
|
3
|
+
/**
|
|
4
|
+
* Project templates (EC-136). A project template is a third-party-authored, distributable seed: an
|
|
5
|
+
* envelope (id/name/version/author/source/tags) wrapping a validated {@link StarterKit}. Templates
|
|
6
|
+
* extend the starter-kit format (EC-114–121) with provenance + distribution metadata, and reuse
|
|
7
|
+
* the canonical kit validation so an imported template is checked exactly like a first-party seed
|
|
8
|
+
* (graph, manifests, CMS schemas, seed content) before it can create a project.
|
|
9
|
+
*/
|
|
10
|
+
/** Where a template came from — drives trust UI and private/marketplace flows. */
|
|
11
|
+
export const templateSourceSchema = z.enum(['builtin', 'community', 'private']);
|
|
12
|
+
export const templateMetaSchema = z.object({
|
|
13
|
+
id: z.string().min(1),
|
|
14
|
+
name: z.string().min(1),
|
|
15
|
+
version: z.string().regex(/^\d+\.\d+\.\d+$/, 'must be semver (major.minor.patch)'),
|
|
16
|
+
author: z.string().optional(),
|
|
17
|
+
source: templateSourceSchema.default('community'),
|
|
18
|
+
tags: z.array(z.string()).default([]),
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* Validate a project template before import (EC-136): the envelope, then the bundled kit via the
|
|
22
|
+
* canonical `validateKit`. Returns structured issues; never throws. A template with any `error`
|
|
23
|
+
* must not be imported.
|
|
24
|
+
*/
|
|
25
|
+
export function validateProjectTemplate(template) {
|
|
26
|
+
const issues = [];
|
|
27
|
+
const meta = templateMetaSchema.safeParse(template);
|
|
28
|
+
if (!meta.success) {
|
|
29
|
+
for (const i of meta.error.issues) {
|
|
30
|
+
issues.push({ code: 'meta', severity: 'error', message: `${i.path.join('.') || 'meta'}: ${i.message}` });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
for (const kitIssue of validateKit(template.kit)) {
|
|
34
|
+
issues.push({ code: 'kit', severity: kitIssue.severity, message: kitIssue.message, ...(kitIssue.ref ? { ref: kitIssue.ref } : {}) });
|
|
35
|
+
}
|
|
36
|
+
return issues;
|
|
37
|
+
}
|
|
38
|
+
/** True when a template validates with no errors. */
|
|
39
|
+
export function isProjectTemplateValid(template) {
|
|
40
|
+
return !validateProjectTemplate(template).some((i) => i.severity === 'error');
|
|
41
|
+
}
|
|
42
|
+
/** Registry of project templates keyed by id; validates on registration. */
|
|
43
|
+
export class TemplateRegistry {
|
|
44
|
+
byId = new Map();
|
|
45
|
+
issues = [];
|
|
46
|
+
constructor(templates = []) {
|
|
47
|
+
for (const template of templates)
|
|
48
|
+
this.register(template);
|
|
49
|
+
}
|
|
50
|
+
register(template) {
|
|
51
|
+
if (this.byId.has(template.id)) {
|
|
52
|
+
this.issues.push({ code: 'duplicate', ref: template.id, message: `Duplicate template "${template.id}" — keeping the first registration.` });
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (!isProjectTemplateValid(template)) {
|
|
56
|
+
this.issues.push({ code: 'invalid', ref: template.id, message: `Template "${template.id}" failed validation and was not registered.` });
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
this.byId.set(template.id, template);
|
|
60
|
+
}
|
|
61
|
+
has(id) {
|
|
62
|
+
return this.byId.has(id);
|
|
63
|
+
}
|
|
64
|
+
get(id) {
|
|
65
|
+
return this.byId.get(id);
|
|
66
|
+
}
|
|
67
|
+
list() {
|
|
68
|
+
return [...this.byId.values()];
|
|
69
|
+
}
|
|
70
|
+
get size() {
|
|
71
|
+
return this.byId.size;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/plugins/templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAG1D;;;;;;GAMG;AAEH,kFAAkF;AAClF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,CAAA;AAG/E,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,iBAAiB,EAAE,oCAAoC,CAAC;IAClF,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,MAAM,EAAE,oBAAoB,CAAC,OAAO,CAAC,WAAW,CAAC;IACjD,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CACtC,CAAC,CAAA;AAiBF;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAAyB;IAC/D,MAAM,MAAM,GAAoB,EAAE,CAAA;IA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
|
|
5
|
+
* - `value` bind a primitive value
|
|
6
|
+
* - `object` bind an object value
|
|
7
|
+
* - `spread` spread an object's keys across the component's props
|
|
8
|
+
* - `repeaterItem` resolve relative to the current repeater item context
|
|
9
|
+
* - `condition` used as the source of a conditional render
|
|
10
|
+
*/
|
|
11
|
+
export declare const bindingModeSchema: z.ZodEnum<{
|
|
12
|
+
object: "object";
|
|
13
|
+
value: "value";
|
|
14
|
+
spread: "spread";
|
|
15
|
+
repeaterItem: "repeaterItem";
|
|
16
|
+
condition: "condition";
|
|
17
|
+
}>;
|
|
18
|
+
export type BindingMode = z.infer<typeof bindingModeSchema>;
|
|
19
|
+
/** A pointer from the graph into a data source via a stable path token. */
|
|
20
|
+
export declare const bindingReferenceSchema: z.ZodObject<{
|
|
21
|
+
sourceId: z.ZodString;
|
|
22
|
+
token: z.ZodString;
|
|
23
|
+
mode: z.ZodEnum<{
|
|
24
|
+
object: "object";
|
|
25
|
+
value: "value";
|
|
26
|
+
spread: "spread";
|
|
27
|
+
repeaterItem: "repeaterItem";
|
|
28
|
+
condition: "condition";
|
|
29
|
+
}>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
export type BindingReference = z.infer<typeof bindingReferenceSchema>;
|
|
32
|
+
export declare const conditionOperatorSchema: z.ZodEnum<{
|
|
33
|
+
truthy: "truthy";
|
|
34
|
+
exists: "exists";
|
|
35
|
+
eq: "eq";
|
|
36
|
+
neq: "neq";
|
|
37
|
+
gt: "gt";
|
|
38
|
+
gte: "gte";
|
|
39
|
+
lt: "lt";
|
|
40
|
+
lte: "lte";
|
|
41
|
+
}>;
|
|
42
|
+
export type ConditionOperator = z.infer<typeof conditionOperatorSchema>;
|
|
43
|
+
/** Gates whether a node renders. The left operand is resolved from a binding. */
|
|
44
|
+
export declare const conditionSchema: z.ZodObject<{
|
|
45
|
+
source: z.ZodObject<{
|
|
46
|
+
sourceId: z.ZodString;
|
|
47
|
+
token: z.ZodString;
|
|
48
|
+
mode: z.ZodEnum<{
|
|
49
|
+
object: "object";
|
|
50
|
+
value: "value";
|
|
51
|
+
spread: "spread";
|
|
52
|
+
repeaterItem: "repeaterItem";
|
|
53
|
+
condition: "condition";
|
|
54
|
+
}>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
operator: z.ZodEnum<{
|
|
57
|
+
truthy: "truthy";
|
|
58
|
+
exists: "exists";
|
|
59
|
+
eq: "eq";
|
|
60
|
+
neq: "neq";
|
|
61
|
+
gt: "gt";
|
|
62
|
+
gte: "gte";
|
|
63
|
+
lt: "lt";
|
|
64
|
+
lte: "lte";
|
|
65
|
+
}>;
|
|
66
|
+
value: z.ZodOptional<z.ZodType<import("./json").JsonValue, unknown, z.core.$ZodTypeInternals<import("./json").JsonValue, unknown>>>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
export type Condition = z.infer<typeof conditionSchema>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { idSchema } from './ids';
|
|
3
|
+
import { jsonValueSchema } from './json';
|
|
4
|
+
/**
|
|
5
|
+
* How a bound prop is applied. Shared by REST, CMS, and Convex sources (one uniform
|
|
6
|
+
* binding model — see brief §4.6).
|
|
7
|
+
* - `value` bind a primitive value
|
|
8
|
+
* - `object` bind an object value
|
|
9
|
+
* - `spread` spread an object's keys across the component's props
|
|
10
|
+
* - `repeaterItem` resolve relative to the current repeater item context
|
|
11
|
+
* - `condition` used as the source of a conditional render
|
|
12
|
+
*/
|
|
13
|
+
export const bindingModeSchema = z.enum(['value', 'object', 'spread', 'repeaterItem', 'condition']);
|
|
14
|
+
/** A pointer from the graph into a data source via a stable path token. */
|
|
15
|
+
export const bindingReferenceSchema = z.object({
|
|
16
|
+
/** Id of a data source (REST / CMS query / Convex query). */
|
|
17
|
+
sourceId: idSchema,
|
|
18
|
+
/** Stable path token (JSON Pointer / JSONPath) that survives UI label changes. */
|
|
19
|
+
token: z.string().min(1),
|
|
20
|
+
mode: bindingModeSchema,
|
|
21
|
+
});
|
|
22
|
+
export const conditionOperatorSchema = z.enum([
|
|
23
|
+
'truthy',
|
|
24
|
+
'exists',
|
|
25
|
+
'eq',
|
|
26
|
+
'neq',
|
|
27
|
+
'gt',
|
|
28
|
+
'gte',
|
|
29
|
+
'lt',
|
|
30
|
+
'lte',
|
|
31
|
+
]);
|
|
32
|
+
/** Gates whether a node renders. The left operand is resolved from a binding. */
|
|
33
|
+
export const conditionSchema = z.object({
|
|
34
|
+
source: bindingReferenceSchema,
|
|
35
|
+
operator: conditionOperatorSchema,
|
|
36
|
+
/** Right-hand comparison value for binary operators (omitted for truthy/exists). */
|
|
37
|
+
value: jsonValueSchema.optional(),
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=binding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binding.js","sourceRoot":"","sources":["../../src/project-graph/binding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAExC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC,CAAA;AAGnG,2EAA2E;AAC3E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,6DAA6D;IAC7D,QAAQ,EAAE,QAAQ;IAClB,kFAAkF;IAClF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,IAAI,EAAE,iBAAiB;CACxB,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC5C,QAAQ;IACR,QAAQ;IACR,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,KAAK;CACN,CAAC,CAAA;AAGF,iFAAiF;AACjF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,MAAM,EAAE,sBAAsB;IAC9B,QAAQ,EAAE,uBAAuB;IACjC,oFAAoF;IACpF,KAAK,EAAE,eAAe,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAA"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ComponentNode } from './node';
|
|
3
|
+
import type { GraphPath, ValidationIssue } from './issues';
|
|
4
|
+
/**
|
|
5
|
+
* Canonical layout-container semantics (EC-161, vision §3.1 / AD-10).
|
|
6
|
+
*
|
|
7
|
+
* `Stack` and `Grid` are the two layout containers of the project graph. They are
|
|
8
|
+
* ordinary `ComponentNode`s (componentId `base.primitives.Stack` / `base.primitives.Grid`)
|
|
9
|
+
* — the registry renders them — but their *semantics* are owned here, by the graph:
|
|
10
|
+
* direction, gap, alignment and columns are canonical graph values, normalization
|
|
11
|
+
* (see `normalize.ts`) keeps them healthy, and malformed values surface as explicit
|
|
12
|
+
* validation issues.
|
|
13
|
+
*
|
|
14
|
+
* Spacing values are stored as **token references** into the design-token spacing
|
|
15
|
+
* scale (step names such as `'4'`), never raw CSS lengths. The scale below mirrors
|
|
16
|
+
* `@elytracms/core/design-tokens` `spacingScale` (the graph package stays dependency-free,
|
|
17
|
+
* so the names + CSS lengths are restated here as the canonical contract).
|
|
18
|
+
*/
|
|
19
|
+
export declare const STACK_COMPONENT_ID = "base.primitives.Stack";
|
|
20
|
+
export declare const GRID_COMPONENT_ID = "base.primitives.Grid";
|
|
21
|
+
/** The component ids the graph treats as layout containers (normalized, token-validated). */
|
|
22
|
+
export declare const LAYOUT_CONTAINER_COMPONENT_IDS: readonly string[];
|
|
23
|
+
/** True when a component id is a canonical layout container (`Stack`/`Grid`). */
|
|
24
|
+
export declare function isLayoutContainerId(componentId: string): boolean;
|
|
25
|
+
/** True when a node is a canonical layout container node. */
|
|
26
|
+
export declare function isLayoutContainerNode(node: ComponentNode): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* The spacing scale step names a container `gap` may reference. Mirrors the
|
|
29
|
+
* `@elytracms/core/design-tokens` `spacingScale` step names — gap values are token
|
|
30
|
+
* references, never CSS lengths (AD-10).
|
|
31
|
+
*/
|
|
32
|
+
export declare const SPACING_TOKEN_NAMES: readonly ["px", "1", "2", "3", "4", "6", "8"];
|
|
33
|
+
export declare const spacingTokenNameSchema: z.ZodEnum<{
|
|
34
|
+
4: "4";
|
|
35
|
+
1: "1";
|
|
36
|
+
2: "2";
|
|
37
|
+
3: "3";
|
|
38
|
+
6: "6";
|
|
39
|
+
8: "8";
|
|
40
|
+
px: "px";
|
|
41
|
+
}>;
|
|
42
|
+
export type SpacingTokenName = z.infer<typeof spacingTokenNameSchema>;
|
|
43
|
+
/** CSS length per spacing step — the resolution the renderer/export emit. */
|
|
44
|
+
export declare const SPACING_TOKEN_CSS: Record<SpacingTokenName, string>;
|
|
45
|
+
export declare function isSpacingTokenName(value: unknown): value is SpacingTokenName;
|
|
46
|
+
/** Resolve a spacing token name to its CSS length (undefined for unknown names). */
|
|
47
|
+
export declare function spacingTokenCss(name: string): string | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Map a legacy numeric gap (pre-token graphs stored small integers, rendered as
|
|
50
|
+
* `n * 4px`) onto the token scale. `0` means "no gap" (no token needed) and maps to
|
|
51
|
+
* `null`; off-scale numbers return `undefined` (not representable as a token).
|
|
52
|
+
*/
|
|
53
|
+
export declare function spacingTokenFromLegacyGap(value: number): SpacingTokenName | null | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Responsive defaults (EC-163, vision §3.1 / AD-10): a `Grid`'s columns stack
|
|
56
|
+
* vertically on phones **by default** — pages are responsive by construction,
|
|
57
|
+
* not by editor diligence. The per-container override is an explicit opt-OUT
|
|
58
|
+
* stored in the graph: `stackOnMobile: false` keeps the column tracks on
|
|
59
|
+
* phones. Absence of the prop means the default (stack) — so the default
|
|
60
|
+
* never needs to be written, and the override is always a visible, explicit
|
|
61
|
+
* graph value.
|
|
62
|
+
*/
|
|
63
|
+
export declare const STACK_ON_MOBILE_PROP = "stackOnMobile";
|
|
64
|
+
export declare const stackOnMobileSchema: z.ZodBoolean;
|
|
65
|
+
/**
|
|
66
|
+
* Whether a `Grid` node stacks its columns on mobile. `true` unless the node
|
|
67
|
+
* carries the explicit static opt-out (`stackOnMobile: false`). Non-Grid nodes
|
|
68
|
+
* never stack (the prop is Grid semantics). Bound or malformed values keep the
|
|
69
|
+
* default — validation flags them; rendering degrades to the safe default.
|
|
70
|
+
*/
|
|
71
|
+
export declare function gridStacksOnMobile(node: ComponentNode): boolean;
|
|
72
|
+
export declare const STACK_DIRECTIONS: readonly ["vertical", "horizontal"];
|
|
73
|
+
export declare const stackDirectionSchema: z.ZodEnum<{
|
|
74
|
+
vertical: "vertical";
|
|
75
|
+
horizontal: "horizontal";
|
|
76
|
+
}>;
|
|
77
|
+
export type StackDirection = z.infer<typeof stackDirectionSchema>;
|
|
78
|
+
export declare const CONTAINER_ALIGNMENTS: readonly ["start", "center", "end", "stretch"];
|
|
79
|
+
export declare const containerAlignmentSchema: z.ZodEnum<{
|
|
80
|
+
start: "start";
|
|
81
|
+
center: "center";
|
|
82
|
+
end: "end";
|
|
83
|
+
stretch: "stretch";
|
|
84
|
+
}>;
|
|
85
|
+
export type ContainerAlignment = z.infer<typeof containerAlignmentSchema>;
|
|
86
|
+
/** Grid column-count bounds: a constrained count, validated at graph level. */
|
|
87
|
+
export declare const GRID_MIN_COLUMNS = 1;
|
|
88
|
+
export declare const GRID_MAX_COLUMNS = 12;
|
|
89
|
+
export declare const gridColumnsSchema: z.ZodNumber;
|
|
90
|
+
/**
|
|
91
|
+
* A container gap as stored in the graph: a spacing token name (canonical) or a
|
|
92
|
+
* legacy non-negative integer (accepted for backward compatibility; on-scale
|
|
93
|
+
* integers are equivalent to their token, off-scale ones are flagged by validation).
|
|
94
|
+
*/
|
|
95
|
+
export declare const containerGapValueSchema: z.ZodUnion<readonly [z.ZodEnum<{
|
|
96
|
+
4: "4";
|
|
97
|
+
1: "1";
|
|
98
|
+
2: "2";
|
|
99
|
+
3: "3";
|
|
100
|
+
6: "6";
|
|
101
|
+
8: "8";
|
|
102
|
+
px: "px";
|
|
103
|
+
}>, z.ZodNumber]>;
|
|
104
|
+
export type ContainerGapValue = z.infer<typeof containerGapValueSchema>;
|
|
105
|
+
export interface StackContainerOptions {
|
|
106
|
+
direction?: StackDirection;
|
|
107
|
+
gap?: SpacingTokenName;
|
|
108
|
+
align?: ContainerAlignment;
|
|
109
|
+
}
|
|
110
|
+
export interface GridContainerOptions {
|
|
111
|
+
columns?: number;
|
|
112
|
+
gap?: SpacingTokenName;
|
|
113
|
+
align?: ContainerAlignment;
|
|
114
|
+
/** Explicit opt-out of the responsive default: `false` keeps columns on phones (EC-163). */
|
|
115
|
+
stackOnMobile?: boolean;
|
|
116
|
+
}
|
|
117
|
+
/** Build a canonical `Stack` container node with token-bound props. */
|
|
118
|
+
export declare function stackContainerNode(id: string, options: StackContainerOptions, children: ComponentNode[]): ComponentNode;
|
|
119
|
+
/** Build a canonical `Grid` container node with token-bound props. */
|
|
120
|
+
export declare function gridContainerNode(id: string, options: GridContainerOptions, children: ComponentNode[]): ComponentNode;
|
|
121
|
+
/**
|
|
122
|
+
* Collect validation issues for a layout container node's canonical props. Only
|
|
123
|
+
* static values are checked — bound props resolve at runtime and degrade in the
|
|
124
|
+
* renderer. Non-container nodes yield no issues.
|
|
125
|
+
*/
|
|
126
|
+
export declare function collectContainerIssues(node: ComponentNode, path: GraphPath): ValidationIssue[];
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { DEFAULT_SLOT } from './ids';
|
|
3
|
+
/**
|
|
4
|
+
* Canonical layout-container semantics (EC-161, vision §3.1 / AD-10).
|
|
5
|
+
*
|
|
6
|
+
* `Stack` and `Grid` are the two layout containers of the project graph. They are
|
|
7
|
+
* ordinary `ComponentNode`s (componentId `base.primitives.Stack` / `base.primitives.Grid`)
|
|
8
|
+
* — the registry renders them — but their *semantics* are owned here, by the graph:
|
|
9
|
+
* direction, gap, alignment and columns are canonical graph values, normalization
|
|
10
|
+
* (see `normalize.ts`) keeps them healthy, and malformed values surface as explicit
|
|
11
|
+
* validation issues.
|
|
12
|
+
*
|
|
13
|
+
* Spacing values are stored as **token references** into the design-token spacing
|
|
14
|
+
* scale (step names such as `'4'`), never raw CSS lengths. The scale below mirrors
|
|
15
|
+
* `@elytracms/core/design-tokens` `spacingScale` (the graph package stays dependency-free,
|
|
16
|
+
* so the names + CSS lengths are restated here as the canonical contract).
|
|
17
|
+
*/
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
// Container identity
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
export const STACK_COMPONENT_ID = 'base.primitives.Stack';
|
|
22
|
+
export const GRID_COMPONENT_ID = 'base.primitives.Grid';
|
|
23
|
+
/** The component ids the graph treats as layout containers (normalized, token-validated). */
|
|
24
|
+
export const LAYOUT_CONTAINER_COMPONENT_IDS = [
|
|
25
|
+
STACK_COMPONENT_ID,
|
|
26
|
+
GRID_COMPONENT_ID,
|
|
27
|
+
];
|
|
28
|
+
/** True when a component id is a canonical layout container (`Stack`/`Grid`). */
|
|
29
|
+
export function isLayoutContainerId(componentId) {
|
|
30
|
+
return componentId === STACK_COMPONENT_ID || componentId === GRID_COMPONENT_ID;
|
|
31
|
+
}
|
|
32
|
+
/** True when a node is a canonical layout container node. */
|
|
33
|
+
export function isLayoutContainerNode(node) {
|
|
34
|
+
return isLayoutContainerId(node.componentId);
|
|
35
|
+
}
|
|
36
|
+
// ---------------------------------------------------------------------------
|
|
37
|
+
// Token-bound values
|
|
38
|
+
// ---------------------------------------------------------------------------
|
|
39
|
+
/**
|
|
40
|
+
* The spacing scale step names a container `gap` may reference. Mirrors the
|
|
41
|
+
* `@elytracms/core/design-tokens` `spacingScale` step names — gap values are token
|
|
42
|
+
* references, never CSS lengths (AD-10).
|
|
43
|
+
*/
|
|
44
|
+
export const SPACING_TOKEN_NAMES = ['px', '1', '2', '3', '4', '6', '8'];
|
|
45
|
+
export const spacingTokenNameSchema = z.enum(SPACING_TOKEN_NAMES);
|
|
46
|
+
/** CSS length per spacing step — the resolution the renderer/export emit. */
|
|
47
|
+
export const SPACING_TOKEN_CSS = {
|
|
48
|
+
px: '1px',
|
|
49
|
+
'1': '0.25rem',
|
|
50
|
+
'2': '0.5rem',
|
|
51
|
+
'3': '0.75rem',
|
|
52
|
+
'4': '1rem',
|
|
53
|
+
'6': '1.5rem',
|
|
54
|
+
'8': '2rem',
|
|
55
|
+
};
|
|
56
|
+
export function isSpacingTokenName(value) {
|
|
57
|
+
return typeof value === 'string' && SPACING_TOKEN_NAMES.includes(value);
|
|
58
|
+
}
|
|
59
|
+
/** Resolve a spacing token name to its CSS length (undefined for unknown names). */
|
|
60
|
+
export function spacingTokenCss(name) {
|
|
61
|
+
return isSpacingTokenName(name) ? SPACING_TOKEN_CSS[name] : undefined;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Map a legacy numeric gap (pre-token graphs stored small integers, rendered as
|
|
65
|
+
* `n * 4px`) onto the token scale. `0` means "no gap" (no token needed) and maps to
|
|
66
|
+
* `null`; off-scale numbers return `undefined` (not representable as a token).
|
|
67
|
+
*/
|
|
68
|
+
export function spacingTokenFromLegacyGap(value) {
|
|
69
|
+
if (!Number.isInteger(value) || value < 0)
|
|
70
|
+
return undefined;
|
|
71
|
+
if (value === 0)
|
|
72
|
+
return null;
|
|
73
|
+
const name = String(value);
|
|
74
|
+
return isSpacingTokenName(name) ? name : undefined;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Responsive defaults (EC-163, vision §3.1 / AD-10): a `Grid`'s columns stack
|
|
78
|
+
* vertically on phones **by default** — pages are responsive by construction,
|
|
79
|
+
* not by editor diligence. The per-container override is an explicit opt-OUT
|
|
80
|
+
* stored in the graph: `stackOnMobile: false` keeps the column tracks on
|
|
81
|
+
* phones. Absence of the prop means the default (stack) — so the default
|
|
82
|
+
* never needs to be written, and the override is always a visible, explicit
|
|
83
|
+
* graph value.
|
|
84
|
+
*/
|
|
85
|
+
export const STACK_ON_MOBILE_PROP = 'stackOnMobile';
|
|
86
|
+
export const stackOnMobileSchema = z.boolean();
|
|
87
|
+
/**
|
|
88
|
+
* Whether a `Grid` node stacks its columns on mobile. `true` unless the node
|
|
89
|
+
* carries the explicit static opt-out (`stackOnMobile: false`). Non-Grid nodes
|
|
90
|
+
* never stack (the prop is Grid semantics). Bound or malformed values keep the
|
|
91
|
+
* default — validation flags them; rendering degrades to the safe default.
|
|
92
|
+
*/
|
|
93
|
+
export function gridStacksOnMobile(node) {
|
|
94
|
+
if (node.componentId !== GRID_COMPONENT_ID)
|
|
95
|
+
return false;
|
|
96
|
+
const prop = node.props?.[STACK_ON_MOBILE_PROP];
|
|
97
|
+
return !(prop?.kind === 'static' && prop.value === false);
|
|
98
|
+
}
|
|
99
|
+
export const STACK_DIRECTIONS = ['vertical', 'horizontal'];
|
|
100
|
+
export const stackDirectionSchema = z.enum(STACK_DIRECTIONS);
|
|
101
|
+
export const CONTAINER_ALIGNMENTS = ['start', 'center', 'end', 'stretch'];
|
|
102
|
+
export const containerAlignmentSchema = z.enum(CONTAINER_ALIGNMENTS);
|
|
103
|
+
/** Grid column-count bounds: a constrained count, validated at graph level. */
|
|
104
|
+
export const GRID_MIN_COLUMNS = 1;
|
|
105
|
+
export const GRID_MAX_COLUMNS = 12;
|
|
106
|
+
export const gridColumnsSchema = z.number().int().min(GRID_MIN_COLUMNS).max(GRID_MAX_COLUMNS);
|
|
107
|
+
/**
|
|
108
|
+
* A container gap as stored in the graph: a spacing token name (canonical) or a
|
|
109
|
+
* legacy non-negative integer (accepted for backward compatibility; on-scale
|
|
110
|
+
* integers are equivalent to their token, off-scale ones are flagged by validation).
|
|
111
|
+
*/
|
|
112
|
+
export const containerGapValueSchema = z.union([
|
|
113
|
+
spacingTokenNameSchema,
|
|
114
|
+
z.number().int().nonnegative(),
|
|
115
|
+
]);
|
|
116
|
+
function staticProps(values) {
|
|
117
|
+
const entries = Object.entries(values).filter(([, v]) => v !== undefined);
|
|
118
|
+
if (entries.length === 0)
|
|
119
|
+
return undefined;
|
|
120
|
+
return Object.fromEntries(entries.map(([name, value]) => [name, { kind: 'static', value }]));
|
|
121
|
+
}
|
|
122
|
+
/** Build a canonical `Stack` container node with token-bound props. */
|
|
123
|
+
export function stackContainerNode(id, options, children) {
|
|
124
|
+
const props = staticProps({
|
|
125
|
+
direction: options.direction,
|
|
126
|
+
gap: options.gap,
|
|
127
|
+
align: options.align,
|
|
128
|
+
});
|
|
129
|
+
return {
|
|
130
|
+
id,
|
|
131
|
+
componentId: STACK_COMPONENT_ID,
|
|
132
|
+
...(props ? { props } : {}),
|
|
133
|
+
slots: { [DEFAULT_SLOT]: children },
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
/** Build a canonical `Grid` container node with token-bound props. */
|
|
137
|
+
export function gridContainerNode(id, options, children) {
|
|
138
|
+
const props = staticProps({
|
|
139
|
+
columns: options.columns,
|
|
140
|
+
gap: options.gap,
|
|
141
|
+
align: options.align,
|
|
142
|
+
stackOnMobile: options.stackOnMobile,
|
|
143
|
+
});
|
|
144
|
+
return {
|
|
145
|
+
id,
|
|
146
|
+
componentId: GRID_COMPONENT_ID,
|
|
147
|
+
...(props ? { props } : {}),
|
|
148
|
+
slots: { [DEFAULT_SLOT]: children },
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
// ---------------------------------------------------------------------------
|
|
152
|
+
// Container validation (called from validate.ts for every Stack/Grid node)
|
|
153
|
+
// ---------------------------------------------------------------------------
|
|
154
|
+
function containerIssue(code, severity, message, path, nodeId, meta) {
|
|
155
|
+
return { code, severity, message, path: [...path], nodeId, ...(meta ? { meta } : {}) };
|
|
156
|
+
}
|
|
157
|
+
/** The static value of a prop, or `undefined` when absent or bound (bindings resolve at runtime). */
|
|
158
|
+
function staticValueOf(node, name) {
|
|
159
|
+
const prop = node.props?.[name];
|
|
160
|
+
return prop?.kind === 'static' ? prop.value : undefined;
|
|
161
|
+
}
|
|
162
|
+
function hasStaticProp(node, name) {
|
|
163
|
+
return node.props?.[name]?.kind === 'static';
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Collect validation issues for a layout container node's canonical props. Only
|
|
167
|
+
* static values are checked — bound props resolve at runtime and degrade in the
|
|
168
|
+
* renderer. Non-container nodes yield no issues.
|
|
169
|
+
*/
|
|
170
|
+
export function collectContainerIssues(node, path) {
|
|
171
|
+
if (!isLayoutContainerNode(node))
|
|
172
|
+
return [];
|
|
173
|
+
const issues = [];
|
|
174
|
+
// gap — token name (canonical) or legacy non-negative integer on the scale.
|
|
175
|
+
if (hasStaticProp(node, 'gap')) {
|
|
176
|
+
const gap = staticValueOf(node, 'gap');
|
|
177
|
+
const gapPath = [...path, 'props', 'gap'];
|
|
178
|
+
if (typeof gap === 'string') {
|
|
179
|
+
if (!isSpacingTokenName(gap)) {
|
|
180
|
+
issues.push(containerIssue('invalid-container-gap', 'error', `Container gap "${gap}" is not a spacing token (expected one of ${SPACING_TOKEN_NAMES.join(', ')}).`, gapPath, node.id, { gap }));
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
else if (typeof gap === 'number') {
|
|
184
|
+
const token = spacingTokenFromLegacyGap(gap);
|
|
185
|
+
if (token === undefined) {
|
|
186
|
+
issues.push(containerIssue('invalid-container-gap', gap >= 0 && Number.isInteger(gap) ? 'warning' : 'error', `Container gap ${gap} is not on the spacing token scale (${SPACING_TOKEN_NAMES.join(', ')}).`, gapPath, node.id, { gap }));
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
issues.push(containerIssue('invalid-container-gap', 'error', `Container gap must be a spacing token name, got ${JSON.stringify(gap)}.`, gapPath, node.id));
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
// align — both containers share the alignment enum.
|
|
194
|
+
if (hasStaticProp(node, 'align')) {
|
|
195
|
+
const align = staticValueOf(node, 'align');
|
|
196
|
+
if (!containerAlignmentSchema.safeParse(align).success) {
|
|
197
|
+
issues.push(containerIssue('invalid-container-alignment', 'error', `Container alignment ${JSON.stringify(align)} is invalid (expected ${CONTAINER_ALIGNMENTS.join(', ')}).`, [...path, 'props', 'align'], node.id));
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
if (node.componentId === STACK_COMPONENT_ID && hasStaticProp(node, 'direction')) {
|
|
201
|
+
const direction = staticValueOf(node, 'direction');
|
|
202
|
+
if (!stackDirectionSchema.safeParse(direction).success) {
|
|
203
|
+
issues.push(containerIssue('invalid-container-direction', 'error', `Stack direction ${JSON.stringify(direction)} is invalid (expected ${STACK_DIRECTIONS.join(' or ')}).`, [...path, 'props', 'direction'], node.id));
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
// stackOnMobile — Grid-only responsive override (EC-163): a boolean or nothing.
|
|
207
|
+
if (node.componentId === GRID_COMPONENT_ID && hasStaticProp(node, STACK_ON_MOBILE_PROP)) {
|
|
208
|
+
const value = staticValueOf(node, STACK_ON_MOBILE_PROP);
|
|
209
|
+
if (!stackOnMobileSchema.safeParse(value).success) {
|
|
210
|
+
issues.push(containerIssue('invalid-container-responsive', 'error', `Grid ${STACK_ON_MOBILE_PROP} must be true or false, got ${JSON.stringify(value)}.`, [...path, 'props', STACK_ON_MOBILE_PROP], node.id));
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (node.componentId === GRID_COMPONENT_ID && hasStaticProp(node, 'columns')) {
|
|
214
|
+
const columns = staticValueOf(node, 'columns');
|
|
215
|
+
if (!gridColumnsSchema.safeParse(columns).success) {
|
|
216
|
+
issues.push(containerIssue('invalid-container-columns', 'error', `Grid column count ${JSON.stringify(columns)} is invalid (expected an integer between ${GRID_MIN_COLUMNS} and ${GRID_MAX_COLUMNS}).`, [...path, 'props', 'columns'], node.id));
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
return issues;
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container.js","sourceRoot":"","sources":["../../src/project-graph/container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAIpC;;;;;;;;;;;;;;GAcG;AAEH,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E;AAE9E,MAAM,CAAC,MAAM,kBAAkB,GAAG,uBAAuB,CAAA;AACzD,MAAM,CAAC,MAAM,iBAAiB,GAAG,sBAAsB,CAAA;AAEvD,6FAA6F;AAC7F,MAAM,CAAC,MAAM,8BAA8B,GAAsB;IAC/D,kBAAkB;IAClB,iBAAiB;CAClB,CAAA;AAED,iFAAiF;AACjF,MAAM,UAAU,mBAAmB,CAAC,WAAmB;IACrD,OAAO,WAAW,KAAK,kBAAkB,IAAI,WAAW,KAAK,iBAAiB,CAAA;AAChF,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,qBAAqB,CAAC,IAAmB;IACvD,OAAO,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;AAC9C,CAAC;AAED,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAA;AAChF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAA;AAGjE,6EAA6E;AAC7E,MA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