@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,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { createContext, createElement, useContext } from 'react';
|
|
3
|
+
const ContentClientContext = createContext(null);
|
|
4
|
+
/**
|
|
5
|
+
* Provide a `ContentClient` to the rendered subtree. The renderer wraps its public
|
|
6
|
+
* composite entry points (page/composition) in this when `ctx.content` is set; a
|
|
7
|
+
* host rendering nodes directly can wrap manually.
|
|
8
|
+
*/
|
|
9
|
+
export function ContentClientProvider({ client, children, }) {
|
|
10
|
+
return createElement(ContentClientContext.Provider, { value: client }, children);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Read the injected `ContentClient` inside a component implementation (EC-191).
|
|
14
|
+
* Returns `null` when none is provided (e.g. a pure-static render) — a self-fetching
|
|
15
|
+
* component must degrade visibly, never crash, when content access is absent.
|
|
16
|
+
*/
|
|
17
|
+
export function useContentClient() {
|
|
18
|
+
return useContext(ContentClientContext);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A deterministic, in-memory `ContentClient` over fixed documents + assets (EC-191).
|
|
22
|
+
* The studio preview and tests use it so a self-fetching component renders the same
|
|
23
|
+
* content every time. `limit` is the only query knob in v1.
|
|
24
|
+
*/
|
|
25
|
+
export function createFixtureContentClient(fixtures) {
|
|
26
|
+
const docs = fixtures.documents ?? [];
|
|
27
|
+
const assets = new Map((fixtures.assets ?? []).map((a) => [a.id, a]));
|
|
28
|
+
return {
|
|
29
|
+
getDocument: (collection, id) => docs.find((d) => d.collection === collection && d.id === id),
|
|
30
|
+
listDocuments: (query) => {
|
|
31
|
+
const matched = docs.filter((d) => d.collection === query.collection);
|
|
32
|
+
return query.limit === undefined ? matched : matched.slice(0, query.limit);
|
|
33
|
+
},
|
|
34
|
+
resolveAsset: (id) => assets.get(id),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=content-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-client.js","sourceRoot":"","sources":["../../src/runtime-renderer/content-client.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AA4ChE,MAAM,oBAAoB,GAAG,aAAa,CAAuB,IAAI,CAAC,CAAA;AAEtE;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,EACpC,MAAM,EACN,QAAQ,GAIT;IACC,OAAO,aAAa,CAAC,oBAAoB,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,QAAQ,CAAC,CAAA;AAClF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,UAAU,CAAC,oBAAoB,CAAC,CAAA;AACzC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,QAG1C;IACC,MAAM,IAAI,GAAG,QAAQ,CAAC,SAAS,IAAI,EAAE,CAAA;IACrC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;IACrE,OAAO;QACL,WAAW,EAAE,CAAC,UAAU,EAAE,EAAE,EAAE,EAAE,CAC9B,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,UAAU,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;QAC9D,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;YACvB,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU,CAAC,CAAA;YACrE,OAAO,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAA;QAC5E,CAAC;QACD,YAAY,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;KACrC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import type { BindingReference, ComponentNode } from '@elytracms/core/project-graph';
|
|
3
|
+
import type { ComponentRegistry } from '@elytracms/core/component-registry';
|
|
4
|
+
import type { ContentClient } from './content-client';
|
|
5
|
+
/**
|
|
6
|
+
* A single repeater item scope. When set, `repeaterItem`-mode bindings resolve against
|
|
7
|
+
* `item` rather than the root data source (brief §4.6 — uniform binding model).
|
|
8
|
+
*/
|
|
9
|
+
export interface ItemContext {
|
|
10
|
+
item: unknown;
|
|
11
|
+
index: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Resolves a binding to a runtime value. INJECTED by the host (builder preview, export
|
|
15
|
+
* runtime, tests) so the renderer never imports `@elytracms/core/data-binding`. When an
|
|
16
|
+
* `ItemContext` is active, it is passed through so `repeaterItem` bindings resolve
|
|
17
|
+
* relative to the current item.
|
|
18
|
+
*/
|
|
19
|
+
export type ResolveBinding = (ref: BindingReference, item?: ItemContext) => unknown;
|
|
20
|
+
/**
|
|
21
|
+
* A resolved asset, ready to hand to an image implementation (EC-195). The
|
|
22
|
+
* delivery-shaped subset of `@elytracms/core/content`'s `ResolvedAsset` the renderer
|
|
23
|
+
* needs — kept minimal so the renderer takes no dependency on the content or
|
|
24
|
+
* persistence packages. `width`/`height` are intrinsic dimensions (so the host
|
|
25
|
+
* can reserve space and `next/image` can size variants); `null` when unknown.
|
|
26
|
+
*/
|
|
27
|
+
export interface RenderAsset {
|
|
28
|
+
url: string;
|
|
29
|
+
width: number | null;
|
|
30
|
+
height: number | null;
|
|
31
|
+
alt: string | null;
|
|
32
|
+
/**
|
|
33
|
+
* Normalized focal point `{ x, y }` in 0–1 (EC-230) → CSS `object-position` so
|
|
34
|
+
* an art-directed image keeps its subject in frame when cropped; `null` when
|
|
35
|
+
* none. Kept as a plain pair so the renderer stays free of content/persistence.
|
|
36
|
+
*/
|
|
37
|
+
focalPoint: {
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
} | null;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Resolves a stored asset id to a usable asset (EC-195), or `null` when the
|
|
44
|
+
* asset is missing (the renderer then shows the EC-015 visible fallback rather
|
|
45
|
+
* than crashing). INJECTED by the host/studio exactly like {@link ResolveBinding},
|
|
46
|
+
* so the renderer never imports the asset store or content packages.
|
|
47
|
+
*/
|
|
48
|
+
export type ResolveAsset = (assetId: string) => RenderAsset | null;
|
|
49
|
+
/**
|
|
50
|
+
* A relation target populated to delivery shape (EC-254): identity plus the
|
|
51
|
+
* target document's resolved fields (relations inside stay `{ id, collection }`
|
|
52
|
+
* stubs at depth-1; assets inside resolve to objects). Opaque to the renderer —
|
|
53
|
+
* the host's content layer produces it, the component implementation reads its
|
|
54
|
+
* fields. The minimal structural face is `{ id, collection }`.
|
|
55
|
+
*/
|
|
56
|
+
export type RelationTarget = {
|
|
57
|
+
id: string;
|
|
58
|
+
collection: string;
|
|
59
|
+
} & Record<string, unknown>;
|
|
60
|
+
/**
|
|
61
|
+
* Resolves a composition-node `relation` PROP's stored reference to its populated
|
|
62
|
+
* target (EC-254), or `null` when the target is missing or not visible in the
|
|
63
|
+
* delivery perspective — the prop is then omitted (`one`) or dropped from the
|
|
64
|
+
* array (`many`), the same graceful degradation as a missing {@link ResolveAsset}.
|
|
65
|
+
*
|
|
66
|
+
* INJECTED by the host/studio exactly like {@link ResolveAsset}, wired to
|
|
67
|
+
* `@elytracms/core/content`'s depth-1 population (`ContentClient.resolveRelation`), so
|
|
68
|
+
* the renderer never imports the content/persistence packages. This populates the
|
|
69
|
+
* relation props of the nodes INSIDE a page's `blocks` composition — which
|
|
70
|
+
* document resolution leaves raw, never descending into a composition value.
|
|
71
|
+
*/
|
|
72
|
+
export type ResolveRelation = (ref: {
|
|
73
|
+
collection: string;
|
|
74
|
+
id: string;
|
|
75
|
+
}) => RelationTarget | null;
|
|
76
|
+
/**
|
|
77
|
+
* A resolved listing query (EC-255): the collection to list plus a closed,
|
|
78
|
+
* AND-only filter (`field → required scalar`, a relation field reduced to its
|
|
79
|
+
* target id — the v1 AD-3 vocabulary), with optional single-field sort and
|
|
80
|
+
* limit. Built by {@link listingQueryOf} from a node's `listing` manifest and
|
|
81
|
+
* its filter-source prop pick. Plain & serializable — primitives only, no
|
|
82
|
+
* content/query-package types — so a host can key a baked result by it and the
|
|
83
|
+
* renderer stays free of the content/persistence packages.
|
|
84
|
+
*/
|
|
85
|
+
export interface ListingQuery {
|
|
86
|
+
collection: string;
|
|
87
|
+
/** Field → required scalar; every entry must hold (AND). Empty matches all. */
|
|
88
|
+
where: Record<string, string | number | boolean>;
|
|
89
|
+
sort?: {
|
|
90
|
+
field: string;
|
|
91
|
+
direction?: 'asc' | 'desc';
|
|
92
|
+
};
|
|
93
|
+
limit?: number;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Resolves a {@link ListingQuery} to its matching documents in depth-1 delivery
|
|
97
|
+
* shape (EC-255), or `null` when no resolver is wired / the query is unresolvable.
|
|
98
|
+
* The first un-parked **listing binding** (AD-9): a block renders documents from a
|
|
99
|
+
* live query, not a static pick. INJECTED by the host exactly like
|
|
100
|
+
* {@link ResolveRelation} — the Next host bakes a serialized-query→docs map and
|
|
101
|
+
* the studio runs the query live — so the renderer never imports the content/query
|
|
102
|
+
* packages. A `null`/absent result degrades to the block's own empty state, the
|
|
103
|
+
* same graceful degradation as a missing relation target.
|
|
104
|
+
*/
|
|
105
|
+
export type ResolveListing = (query: ListingQuery) => RelationTarget[] | null;
|
|
106
|
+
/**
|
|
107
|
+
* A composition renderer injected as a PROP (EC-254 transclusion) into any
|
|
108
|
+
* component that declares a `relation` prop — server-safe like the EC-189 embed
|
|
109
|
+
* renderer (a function cannot cross the RSC boundary through a `'use client'`
|
|
110
|
+
* context provider). The implementation calls it on a populated relation target's
|
|
111
|
+
* `blocks`-typed field value (e.g. `project.Reusable` rendering the referenced
|
|
112
|
+
* `reusable`'s `content`), so a referenced document's sub-blocks compose inline.
|
|
113
|
+
*/
|
|
114
|
+
export type RenderBlocks = (value: unknown) => ReactNode;
|
|
115
|
+
/**
|
|
116
|
+
* Maps namespaced component ids to their React implementations. Implementations receive
|
|
117
|
+
* resolved props plus rendered slot children: the default slot `children` maps to React
|
|
118
|
+
* `children`, and every other named slot is passed as a prop named after the slot.
|
|
119
|
+
*/
|
|
120
|
+
export type ComponentImplementations = Record<string, ComponentType<Record<string, unknown>>> | Map<string, ComponentType<Record<string, unknown>>>;
|
|
121
|
+
/** Everything the renderer needs to turn a node into React, with no builder-only imports. */
|
|
122
|
+
export interface RenderContext {
|
|
123
|
+
/** Source of component manifests (prop schemas, slots, iterate specs). */
|
|
124
|
+
registry: ComponentRegistry;
|
|
125
|
+
/** React implementations keyed by component id. */
|
|
126
|
+
implementations: ComponentImplementations;
|
|
127
|
+
/** Injected binding resolver — the renderer's only link to data. */
|
|
128
|
+
resolveBinding: ResolveBinding;
|
|
129
|
+
/**
|
|
130
|
+
* Injected asset resolver (EC-195). When set, a static `asset`-typed prop
|
|
131
|
+
* holding an asset id resolves to a {@link RenderAsset} (url + intrinsic
|
|
132
|
+
* dimensions + alt) before reaching the implementation — so an uploaded image
|
|
133
|
+
* placed on a page renders optimized on the host. Unset → asset-typed props
|
|
134
|
+
* pass through unresolved (raw value), the same graceful degradation as a
|
|
135
|
+
* missing binding resolver.
|
|
136
|
+
*/
|
|
137
|
+
resolveAsset?: ResolveAsset;
|
|
138
|
+
/**
|
|
139
|
+
* Injected relation resolver (EC-254). When set, a static `relation`-typed prop
|
|
140
|
+
* holding a `{ collection, id }` ref (the editor's document pick on a block,
|
|
141
|
+
* e.g. a ProductGrid's `products`) is populated to its depth-1 delivery shape
|
|
142
|
+
* before reaching the implementation — so a block reads `product.title` /
|
|
143
|
+
* `product.gallery[0].url`, not a raw ref. Unset → relation props pass through
|
|
144
|
+
* unresolved (raw ref), the same graceful degradation as a missing asset
|
|
145
|
+
* resolver. Wired by the host to `ContentClient.resolveRelation`.
|
|
146
|
+
*/
|
|
147
|
+
resolveRelation?: ResolveRelation;
|
|
148
|
+
/**
|
|
149
|
+
* Injected listing resolver (EC-255). When set, a component whose manifest
|
|
150
|
+
* declares a `listing` (e.g. a ProductGrid keyed to a picked `category`) has
|
|
151
|
+
* its declared listing prop populated with the documents the query matches —
|
|
152
|
+
* a live, dynamic grid, not a hand-maintained static relation. Built from the
|
|
153
|
+
* node's filter-source prop via {@link listingQueryOf}; the host runs the query
|
|
154
|
+
* (Next bakes it, the studio runs it live). Unset → the listing prop is an empty
|
|
155
|
+
* array (the block shows its empty state), the same graceful degradation as a
|
|
156
|
+
* missing relation resolver. Wired by the host to `ContentClient.listDocuments`.
|
|
157
|
+
*/
|
|
158
|
+
resolveListing?: ResolveListing;
|
|
159
|
+
/**
|
|
160
|
+
* Read-content client for self-fetching components (EC-191). When set, the
|
|
161
|
+
* renderer's composite entry points wrap the output in a `ContentClientProvider`
|
|
162
|
+
* so components reach it via `useContentClient()`. Host-injected (live), studio
|
|
163
|
+
* (read), or fixture-backed (tests) — components render real data uniformly.
|
|
164
|
+
*/
|
|
165
|
+
content?: ContentClient;
|
|
166
|
+
/**
|
|
167
|
+
* The chain of relation-target keys (`collection:id`) currently being
|
|
168
|
+
* TRANSCLUDED through {@link RenderBlocks} (EC-254). Extended each time a
|
|
169
|
+
* component transcludes a populated relation target's blocks; a relation prop
|
|
170
|
+
* whose ref is already in this chain is NOT re-populated, breaking reference
|
|
171
|
+
* cycles (a `reusable` that transitively references itself) without looping.
|
|
172
|
+
* Empty/absent on an ordinary page render — no relation is ever skipped.
|
|
173
|
+
*/
|
|
174
|
+
transcludePath?: readonly string[];
|
|
175
|
+
/** Active repeater item scope, when rendering inside a repeater item slot. */
|
|
176
|
+
item?: ItemContext;
|
|
177
|
+
/**
|
|
178
|
+
* Optional per-node decorator (brief §8.2). When set, the renderer wraps every
|
|
179
|
+
* rendered node so a host (the Builder) can attach selection markers/overlays.
|
|
180
|
+
* Unset for export/preview — zero overhead and identical output.
|
|
181
|
+
*/
|
|
182
|
+
decorateNode?: (node: ComponentNode, rendered: ReactNode) => ReactNode;
|
|
183
|
+
}
|
|
184
|
+
/** Read an implementation regardless of whether implementations is a Map or a record. */
|
|
185
|
+
export declare function getImplementation(implementations: ComponentImplementations, id: string): ComponentType<Record<string, unknown>> | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Read an implementation regardless of whether implementations is a Map or a record. */
|
|
2
|
+
export function getImplementation(implementations, id) {
|
|
3
|
+
if (implementations instanceof Map)
|
|
4
|
+
return implementations.get(id);
|
|
5
|
+
return implementations[id];
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/runtime-renderer/context.ts"],"names":[],"mappings":"AAyLA,yFAAyF;AACzF,MAAM,UAAU,iBAAiB,CAC/B,eAAyC,EACzC,EAAU;IAEV,IAAI,eAAe,YAAY,GAAG;QAAE,OAAO,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IAClE,OAAO,eAAe,CAAC,EAAE,CAAC,CAAA;AAC5B,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import type { ErrorInfo, ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Visible fallback for a node whose component has no manifest or no implementation.
|
|
5
|
+
* Renders instead of throwing so a single bad reference never blanks the page (brief §4.11).
|
|
6
|
+
*/
|
|
7
|
+
export declare function MissingComponentFallback(props: {
|
|
8
|
+
nodeId: string;
|
|
9
|
+
componentId: string;
|
|
10
|
+
}): ReactNode;
|
|
11
|
+
/** Visible placeholder rendered in the position of a required slot that has no children. */
|
|
12
|
+
export declare function MissingSlotPlaceholder(props: {
|
|
13
|
+
nodeId: string;
|
|
14
|
+
slot: string;
|
|
15
|
+
}): ReactNode;
|
|
16
|
+
/** Visible fallback for a node that threw while resolving props/bindings or while rendering. */
|
|
17
|
+
export declare function RenderErrorFallback(props: {
|
|
18
|
+
nodeId: string;
|
|
19
|
+
message?: string;
|
|
20
|
+
}): ReactNode;
|
|
21
|
+
interface ErrorBoundaryProps {
|
|
22
|
+
nodeId: string;
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
interface ErrorBoundaryState {
|
|
26
|
+
error: Error | null;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Client-side error boundary: when a descendant component throws during render, this swaps
|
|
30
|
+
* in a visible fallback rather than unmounting the whole tree. Server rendering cannot use
|
|
31
|
+
* boundaries to recover, so the renderer additionally wraps resolution in try/catch.
|
|
32
|
+
*/
|
|
33
|
+
export declare class RenderErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
34
|
+
constructor(props: ErrorBoundaryProps);
|
|
35
|
+
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
36
|
+
componentDidCatch(_error: Error, _info: ErrorInfo): void;
|
|
37
|
+
render(): ReactNode;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Component } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* Visible fallback for a node whose component has no manifest or no implementation.
|
|
6
|
+
* Renders instead of throwing so a single bad reference never blanks the page (brief §4.11).
|
|
7
|
+
*/
|
|
8
|
+
export function MissingComponentFallback(props) {
|
|
9
|
+
return (_jsx("div", { "data-ec-fallback": "missing-component", "data-ec-node-id": props.nodeId, "data-ec-component-id": props.componentId, children: `Missing component "${props.componentId}" (node ${props.nodeId})` }));
|
|
10
|
+
}
|
|
11
|
+
/** Visible placeholder rendered in the position of a required slot that has no children. */
|
|
12
|
+
export function MissingSlotPlaceholder(props) {
|
|
13
|
+
return (_jsx("div", { "data-ec-fallback": "missing-slot", "data-ec-node-id": props.nodeId, "data-ec-slot": props.slot, children: `Missing required slot "${props.slot}" (node ${props.nodeId})` }));
|
|
14
|
+
}
|
|
15
|
+
/** Visible fallback for a node that threw while resolving props/bindings or while rendering. */
|
|
16
|
+
export function RenderErrorFallback(props) {
|
|
17
|
+
return (_jsx("div", { "data-ec-fallback": "render-error", "data-ec-node-id": props.nodeId, children: props.message
|
|
18
|
+
? `Render error in node ${props.nodeId}: ${props.message}`
|
|
19
|
+
: `Render error in node ${props.nodeId}` }));
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Client-side error boundary: when a descendant component throws during render, this swaps
|
|
23
|
+
* in a visible fallback rather than unmounting the whole tree. Server rendering cannot use
|
|
24
|
+
* boundaries to recover, so the renderer additionally wraps resolution in try/catch.
|
|
25
|
+
*/
|
|
26
|
+
export class RenderErrorBoundary extends Component {
|
|
27
|
+
constructor(props) {
|
|
28
|
+
super(props);
|
|
29
|
+
this.state = { error: null };
|
|
30
|
+
}
|
|
31
|
+
static getDerivedStateFromError(error) {
|
|
32
|
+
return { error };
|
|
33
|
+
}
|
|
34
|
+
componentDidCatch(_error, _info) {
|
|
35
|
+
// Intentionally swallowed: the fallback is the user-visible signal. Hosts may add
|
|
36
|
+
// their own logging by wrapping this boundary.
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
if (this.state.error) {
|
|
40
|
+
return _jsx(RenderErrorFallback, { nodeId: this.props.nodeId, message: this.state.error.message });
|
|
41
|
+
}
|
|
42
|
+
return this.props.children;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=fallback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fallback.js","sourceRoot":"","sources":["../../src/runtime-renderer/fallback.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGjC;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAGxC;IACC,OAAO,CACL,kCACmB,mBAAmB,qBACnB,KAAK,CAAC,MAAM,0BACP,KAAK,CAAC,WAAW,YAEtC,sBAAsB,KAAK,CAAC,WAAW,WAAW,KAAK,CAAC,MAAM,GAAG,GAC9D,CACP,CAAA;AACH,CAAC;AAED,4FAA4F;AAC5F,MAAM,UAAU,sBAAsB,CAAC,KAAuC;IAC5E,OAAO,CACL,kCAAsB,cAAc,qBAAkB,KAAK,CAAC,MAAM,kBAAgB,KAAK,CAAC,IAAI,YACzF,0BAA0B,KAAK,CAAC,IAAI,WAAW,KAAK,CAAC,MAAM,GAAG,GAC3D,CACP,CAAA;AACH,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,mBAAmB,CAAC,KAA2C;IAC7E,OAAO,CACL,kCAAsB,cAAc,qBAAkB,KAAK,CAAC,MAAM,YAC/D,KAAK,CAAC,OAAO;YACZ,CAAC,CAAC,wBAAwB,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,OAAO,EAAE;YAC1D,CAAC,CAAC,wBAAwB,KAAK,CAAC,MAAM,EAAE,GACtC,CACP,CAAA;AACH,CAAC;AAWD;;;;GAIG;AACH,MAAM,OAAO,mBAAoB,SAAQ,SAAiD;IACxF,YAAY,KAAyB;QACnC,KAAK,CAAC,KAAK,CAAC,CAAA;QACZ,IAAI,CAAC,KAAK,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;IAC9B,CAAC;IAED,MAAM,CAAC,wBAAwB,CAAC,KAAY;QAC1C,OAAO,EAAE,KAAK,EAAE,CAAA;IAClB,CAAC;IAEQ,iBAAiB,CAAC,MAAa,EAAE,KAAgB;QACxD,kFAAkF;QAClF,+CAA+C;IACjD,CAAC;IAEQ,MAAM;QACb,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YACrB,OAAO,KAAC,mBAAmB,IAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,GAAI,CAAA;QAC9F,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAA;IAC5B,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const PACKAGE = "@elytracms/core/runtime-renderer";
|
|
2
|
+
export type { ComponentImplementations, ItemContext, ListingQuery, RelationTarget, RenderAsset, RenderBlocks, RenderContext, ResolveAsset, ResolveBinding, ResolveListing, ResolveRelation, } from './context';
|
|
3
|
+
export { getImplementation } from './context';
|
|
4
|
+
export { evaluateCondition } from './condition';
|
|
5
|
+
export { renderNode, renderComposition, renderCompositionInLayout, createEmbedRenderer, createBlocksRenderer, collectReferencedAssetIds, collectReferencedRelations, collectReferencedListings, listingQueryOf, serializeListingQuery, } from './render';
|
|
6
|
+
export type { ContentClient, ContentDocumentView, ContentAssetView, ContentQuery, } from './content-client';
|
|
7
|
+
export { ContentClientProvider, useContentClient, createFixtureContentClient, } from './content-client';
|
|
8
|
+
export { MissingComponentFallback, MissingSlotPlaceholder, RenderErrorFallback, RenderErrorBoundary, } from './fallback';
|
|
9
|
+
export type { BasePrimitives, ImageSource } from './primitives';
|
|
10
|
+
export { basePrimitives, createPrimitiveRegistry, normalizeImageSource } from './primitives';
|
|
11
|
+
export { GRID_MOBILE_BREAKPOINT_PX, GRID_STACK_CSS } from './primitives';
|
|
12
|
+
export { Container, Stack, Grid, Text, Heading, Image, Button, Repeater, Switch, ContainerManifest, StackManifest, GridManifest, TextManifest, HeadingManifest, ImageManifest, ButtonManifest, RepeaterManifest, SwitchManifest, } from './primitives';
|
|
13
|
+
export { RichText, RichTextManifest, RICH_TEXT_DEFAULT_VALUE, richTextPrimitiveRegistry, } from './rich-text';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const PACKAGE = '@elytracms/core/runtime-renderer';
|
|
2
|
+
export { getImplementation } from './context';
|
|
3
|
+
export { evaluateCondition } from './condition';
|
|
4
|
+
export { renderNode, renderComposition, renderCompositionInLayout, createEmbedRenderer, createBlocksRenderer, collectReferencedAssetIds, collectReferencedRelations, collectReferencedListings, listingQueryOf, serializeListingQuery, } from './render';
|
|
5
|
+
export { ContentClientProvider, useContentClient, createFixtureContentClient, } from './content-client';
|
|
6
|
+
export { MissingComponentFallback, MissingSlotPlaceholder, RenderErrorFallback, RenderErrorBoundary, } from './fallback';
|
|
7
|
+
export { basePrimitives, createPrimitiveRegistry, normalizeImageSource } from './primitives';
|
|
8
|
+
// Responsive defaults (EC-163): the stack-on-mobile breakpoint + emitted rule.
|
|
9
|
+
export { GRID_MOBILE_BREAKPOINT_PX, GRID_STACK_CSS } from './primitives';
|
|
10
|
+
export { Container, Stack, Grid, Text, Heading, Image, Button, Repeater, Switch, ContainerManifest, StackManifest, GridManifest, TextManifest, HeadingManifest, ImageManifest, ButtonManifest, RepeaterManifest, SwitchManifest, } from './primitives';
|
|
11
|
+
// Rich-text content primitive (EC-159).
|
|
12
|
+
export { RichText, RichTextManifest, RICH_TEXT_DEFAULT_VALUE, richTextPrimitiveRegistry, } from './rich-text';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime-renderer/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,kCAAkC,CAAA;AAezD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAE/C,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EACzB,cAAc,EACd,qBAAqB,GACtB,MAAM,UAAU,CAAA;AASjB,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,YAAY,CAAA;AAGnB,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAC5F,+EAA+E;AAC/E,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AACxE,OAAO,EACL,SAAS,EACT,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,KAAK,EACL,MAAM,EACN,QAAQ,EACR,MAAM,EACN,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,cAAc,GACf,MAAM,cAAc,CAAA;AAErB,wCAAwC;AACxC,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ComponentManifest } from '@elytracms/core/component-registry';
|
|
3
|
+
import { ComponentRegistry } from '@elytracms/core/component-registry';
|
|
4
|
+
import type { ComponentImplementations } from './context';
|
|
5
|
+
/**
|
|
6
|
+
* Common shape for primitive implementations: resolved props (arbitrary keys) plus React
|
|
7
|
+
* children for the default slot and any named-slot props.
|
|
8
|
+
*/
|
|
9
|
+
type PrimitiveProps = Record<string, unknown> & {
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
declare function Container(props: PrimitiveProps): ReactNode;
|
|
13
|
+
declare const ContainerManifest: ComponentManifest;
|
|
14
|
+
declare function Stack(props: PrimitiveProps): ReactNode;
|
|
15
|
+
declare const StackManifest: ComponentManifest;
|
|
16
|
+
/**
|
|
17
|
+
* Responsive defaults (EC-163): below this viewport width a Grid's columns
|
|
18
|
+
* stack into one. 640px (the Tailwind `sm` boundary) sits between the
|
|
19
|
+
* builder's deterministic preview widths — phone (390px) stacks, tablet
|
|
20
|
+
* (768px) keeps columns.
|
|
21
|
+
*/
|
|
22
|
+
export declare const GRID_MOBILE_BREAKPOINT_PX = 640;
|
|
23
|
+
/**
|
|
24
|
+
* The stack-on-mobile rule a stacking Grid carries with it. A **viewport media
|
|
25
|
+
* query** (not a container query), deliberately: the builder canvas renders
|
|
26
|
+
* into an iframe — a true viewport — so constraining the iframe to the phone
|
|
27
|
+
* width makes this exact rule fire in the preview; and the identical markup
|
|
28
|
+
* server-renders in `@elytracms/next` (App Router SSR) with no client JS, no
|
|
29
|
+
* extra stylesheet wiring, and no `container-type` context that every consumer
|
|
30
|
+
* would otherwise have to guarantee around every grid. The rule is emitted as
|
|
31
|
+
* an inline `<style>` child of the grid itself (style elements generate no
|
|
32
|
+
* grid item), so the behavior is self-contained wherever the implementation
|
|
33
|
+
* renders — canvas iframe portal, static markup, or RSC payload — and the
|
|
34
|
+
* `!important` lets the stylesheet rule beat the grid's own inline column
|
|
35
|
+
* template. Opted-out grids (`stackOnMobile: false`) carry neither the
|
|
36
|
+
* attribute nor the rule.
|
|
37
|
+
*/
|
|
38
|
+
export declare const GRID_STACK_CSS = "@media (max-width: 640px){[data-ec-grid-stack]{grid-template-columns:minmax(0,1fr) !important}}";
|
|
39
|
+
declare function Grid(props: PrimitiveProps): ReactNode;
|
|
40
|
+
declare const GridManifest: ComponentManifest;
|
|
41
|
+
declare function Text(props: PrimitiveProps): ReactNode;
|
|
42
|
+
declare const TextManifest: ComponentManifest;
|
|
43
|
+
declare function Heading(props: PrimitiveProps): ReactNode;
|
|
44
|
+
declare const HeadingManifest: ComponentManifest;
|
|
45
|
+
/**
|
|
46
|
+
* The Image `src` may be a resolved asset (EC-195: an `asset`-typed prop the
|
|
47
|
+
* renderer resolved from an asset id) or a plain URL string. Normalize to
|
|
48
|
+
* `{ url, width, height, alt }`, letting the asset's intrinsic dimensions/alt
|
|
49
|
+
* fill in when the explicit props are unset — so an uploaded image reserves the
|
|
50
|
+
* right box (no layout shift) and carries its alt text by default.
|
|
51
|
+
*/
|
|
52
|
+
export interface ImageSource {
|
|
53
|
+
url: string;
|
|
54
|
+
width: number | undefined;
|
|
55
|
+
height: number | undefined;
|
|
56
|
+
alt: string;
|
|
57
|
+
/** Normalized focal point `{ x, y }` 0–1 (EC-230) → CSS object-position; null when none. */
|
|
58
|
+
focalPoint: {
|
|
59
|
+
x: number;
|
|
60
|
+
y: number;
|
|
61
|
+
} | null;
|
|
62
|
+
}
|
|
63
|
+
export declare function normalizeImageSource(props: PrimitiveProps): ImageSource;
|
|
64
|
+
/** EC-230: a focal point becomes a CSS `object-position` string (percent of each axis). */
|
|
65
|
+
export declare function focalPointObjectPosition(focalPoint: {
|
|
66
|
+
x: number;
|
|
67
|
+
y: number;
|
|
68
|
+
} | null): string | undefined;
|
|
69
|
+
declare function Image(props: PrimitiveProps): ReactNode;
|
|
70
|
+
declare const ImageManifest: ComponentManifest;
|
|
71
|
+
declare function Button(props: PrimitiveProps): ReactNode;
|
|
72
|
+
declare const ButtonManifest: ComponentManifest;
|
|
73
|
+
declare function Repeater(props: PrimitiveProps): ReactNode;
|
|
74
|
+
declare const RepeaterManifest: ComponentManifest;
|
|
75
|
+
declare function Switch(props: PrimitiveProps): ReactNode;
|
|
76
|
+
declare const SwitchManifest: ComponentManifest;
|
|
77
|
+
export interface BasePrimitives {
|
|
78
|
+
manifests: ComponentManifest[];
|
|
79
|
+
implementations: ComponentImplementations;
|
|
80
|
+
}
|
|
81
|
+
/** The platform starter components: every `base.primitives.*` manifest + implementation. */
|
|
82
|
+
export declare function basePrimitives(): BasePrimitives;
|
|
83
|
+
/** A `ComponentRegistry` preloaded with the primitive manifests. */
|
|
84
|
+
export declare function createPrimitiveRegistry(): ComponentRegistry;
|
|
85
|
+
export { Container, Stack, Grid, Text, Heading, Image, Button, Repeater, Switch, ContainerManifest, StackManifest, GridManifest, TextManifest, HeadingManifest, ImageManifest, ButtonManifest, RepeaterManifest, SwitchManifest, };
|