@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,158 @@
|
|
|
1
|
+
import { isValidComponentId } from './ids';
|
|
2
|
+
import { collectContainerIssues } from './container';
|
|
3
|
+
function issue(code, severity, message, path, nodeId, meta) {
|
|
4
|
+
return { code, severity, message, path: [...path], ...(nodeId ? { nodeId } : {}), ...(meta ? { meta } : {}) };
|
|
5
|
+
}
|
|
6
|
+
function checkBinding(prop, opts, path, nodeId, issues) {
|
|
7
|
+
if (prop.kind !== 'binding')
|
|
8
|
+
return;
|
|
9
|
+
const { knownSourceIds } = opts;
|
|
10
|
+
if (knownSourceIds && !knownSourceIds.has(prop.binding.sourceId)) {
|
|
11
|
+
issues.push(issue('unresolved-binding', 'error', `Binding references unknown data source "${prop.binding.sourceId}".`, path, nodeId, { sourceId: prop.binding.sourceId }));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function walkNode(node, path, opts, seenIds, issues) {
|
|
15
|
+
// duplicate node id detection (graph-wide)
|
|
16
|
+
const prior = seenIds.get(node.id);
|
|
17
|
+
if (prior) {
|
|
18
|
+
issues.push(issue('duplicate-node-id', 'error', `Duplicate node id "${node.id}".`, path, node.id, {
|
|
19
|
+
firstSeenAt: [...prior],
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
seenIds.set(node.id, path);
|
|
24
|
+
}
|
|
25
|
+
// component name well-formedness
|
|
26
|
+
if (!isValidComponentId(node.componentId)) {
|
|
27
|
+
issues.push(issue('invalid-component-name', 'error', `Component id "${node.componentId}" is not namespaced under base.primitives.* or project.*.`, [...path, 'componentId'], node.id));
|
|
28
|
+
}
|
|
29
|
+
// Layout containers (EC-161): Stack/Grid canonical props (direction, gap,
|
|
30
|
+
// alignment, columns) are graph semantics — checked intrinsically, with or
|
|
31
|
+
// without a registry. Malformed values are explicit issues, never crashes.
|
|
32
|
+
issues.push(...collectContainerIssues(node, path));
|
|
33
|
+
const manifest = opts.components?.get(node.componentId);
|
|
34
|
+
if (opts.components && !manifest) {
|
|
35
|
+
issues.push(issue('unknown-component', 'error', `No registered component "${node.componentId}".`, path, node.id));
|
|
36
|
+
}
|
|
37
|
+
// Canvas-eligibility (EC-191): a server-only component cannot live in a
|
|
38
|
+
// client-rendered editor composition. Only enforced when requested.
|
|
39
|
+
if (opts.requireCanvasEligible && manifest && manifest.clientRenderable === false) {
|
|
40
|
+
issues.push(issue('server-only-component', 'error', `Component "${node.componentId}" is server-only (not client-renderable) and can't be placed in the canvas; use it in a dev frame (page.tsx / layout.tsx).`, path, node.id));
|
|
41
|
+
}
|
|
42
|
+
// condition source binding
|
|
43
|
+
if (node.condition && opts.knownSourceIds) {
|
|
44
|
+
const sid = node.condition.source.sourceId;
|
|
45
|
+
if (!opts.knownSourceIds.has(sid)) {
|
|
46
|
+
issues.push(issue('unresolved-binding', 'error', `Condition references unknown data source "${sid}".`, [...path, 'condition'], node.id, { sourceId: sid }));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
// props
|
|
50
|
+
if (node.props) {
|
|
51
|
+
for (const [name, value] of Object.entries(node.props)) {
|
|
52
|
+
const propPath = [...path, 'props', name];
|
|
53
|
+
checkBinding(value, opts, propPath, node.id, issues);
|
|
54
|
+
if (manifest) {
|
|
55
|
+
const spec = manifest.props?.[name];
|
|
56
|
+
if (!spec) {
|
|
57
|
+
issues.push(issue('unknown-prop', 'warning', `Unknown prop "${name}" on "${node.componentId}".`, propPath, node.id));
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
if (value.kind === 'binding' && spec.bindable === false) {
|
|
61
|
+
issues.push(issue('binding-not-allowed', 'error', `Prop "${name}" on "${node.componentId}" does not accept bindings.`, propPath, node.id));
|
|
62
|
+
}
|
|
63
|
+
if (value.kind === 'static' && spec.validate && !spec.validate(value.value)) {
|
|
64
|
+
issues.push(issue('invalid-prop', 'error', `Invalid value for prop "${name}" on "${node.componentId}".`, propPath, node.id));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
// slots
|
|
70
|
+
const slots = node.slots ?? {};
|
|
71
|
+
if (manifest) {
|
|
72
|
+
const declared = new Map((manifest.slots ?? []).map((s) => [s.name, s]));
|
|
73
|
+
for (const slot of manifest.slots ?? []) {
|
|
74
|
+
const children = slots[slot.name];
|
|
75
|
+
if (slot.required && (!children || children.length === 0)) {
|
|
76
|
+
issues.push(issue('missing-required-slot', 'error', `Missing required slot "${slot.name}" on "${node.componentId}".`, [...path, 'slots', slot.name], node.id));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
for (const name of Object.keys(slots)) {
|
|
80
|
+
if (!declared.has(name)) {
|
|
81
|
+
issues.push(issue('unknown-slot', 'warning', `Unknown slot "${name}" on "${node.componentId}".`, [...path, 'slots', name], node.id));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
// Slot placement vocabulary (EC-186): a slot's `allow` restricts which
|
|
85
|
+
// component ids may be inserted; a child outside the set is forbidden.
|
|
86
|
+
for (const slot of manifest.slots ?? []) {
|
|
87
|
+
const allow = slot.allow;
|
|
88
|
+
if (!allow || allow.length === 0)
|
|
89
|
+
continue;
|
|
90
|
+
const allowed = new Set(allow);
|
|
91
|
+
(slots[slot.name] ?? []).forEach((child, i) => {
|
|
92
|
+
if (!allowed.has(child.componentId)) {
|
|
93
|
+
issues.push(issue('forbidden-component', 'error', `Component "${child.componentId}" is not allowed in slot "${slot.name}" of "${node.componentId}".`, [...path, 'slots', slot.name, i, 'componentId'], child.id, { slot: slot.name, allow: [...allow] }));
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
for (const [slotName, children] of Object.entries(slots)) {
|
|
99
|
+
children.forEach((child, i) => walkNode(child, [...path, 'slots', slotName, i], opts, seenIds, issues));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/** Validate a project graph, returning structured issues (never throws on a parsed graph). */
|
|
103
|
+
export function validateProjectGraph(graph, opts = {}) {
|
|
104
|
+
const issues = [];
|
|
105
|
+
const seenIds = new Map();
|
|
106
|
+
// EC-187: the graph is LAYOUTS-ONLY — pages moved into the `page` collection
|
|
107
|
+
// (their `body` is a composition field value validated by
|
|
108
|
+
// `validateCompositionValue`). Layout-ref and route-conflict checks that used
|
|
109
|
+
// to walk `graph.pages` no longer apply here; route conflicts are detected by
|
|
110
|
+
// the CMS router (`createRouter`) over the `routes` collection.
|
|
111
|
+
graph.layouts.forEach((layout, i) => {
|
|
112
|
+
walkNode(layout.root, ['layouts', i, 'root'], opts, seenIds, issues);
|
|
113
|
+
});
|
|
114
|
+
return issues;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Validate a single component-node tree (EC-186, AD-12) — a composition **field
|
|
118
|
+
* value**, not a whole graph. Reuses the exact node-tree walk
|
|
119
|
+
* {@link validateProjectGraph} uses (component/prop/slot/container/binding rules
|
|
120
|
+
* + slot `allow` placement), but applies none of the graph-level invariants
|
|
121
|
+
* (layout refs, route conflicts). Node ids are checked for duplicates within
|
|
122
|
+
* this tree only.
|
|
123
|
+
*/
|
|
124
|
+
export function validateComponentNode(node, opts = {}) {
|
|
125
|
+
const issues = [];
|
|
126
|
+
walkNode(node, ['root'], opts, new Map(), issues);
|
|
127
|
+
return issues;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Validate a composition **field value** (EC-186, AD-12): one root node
|
|
131
|
+
* (`cardinality: 'one'`) or an ordered list (`'many'`). Each root is validated as
|
|
132
|
+
* a component-node tree; the field's `allow` restricts the top-level vocabulary;
|
|
133
|
+
* duplicate node ids are checked across the whole value. The registry + `allow`
|
|
134
|
+
* are code (the leash); the tree is data.
|
|
135
|
+
*/
|
|
136
|
+
export function validateCompositionValue(value, opts = {}) {
|
|
137
|
+
const roots = Array.isArray(value) ? value : [value];
|
|
138
|
+
const issues = [];
|
|
139
|
+
const seenIds = new Map();
|
|
140
|
+
const allowList = opts.allow ?? [];
|
|
141
|
+
const allowed = allowList.length > 0 ? new Set(allowList) : undefined;
|
|
142
|
+
// A composition value is edited + rendered on the client canvas (EC-191), so
|
|
143
|
+
// every node must be canvas-eligible — enforced regardless of the caller's opts.
|
|
144
|
+
const walkOpts = { ...opts, requireCanvasEligible: true };
|
|
145
|
+
roots.forEach((root, i) => {
|
|
146
|
+
const path = ['root', i];
|
|
147
|
+
if (allowed && !allowed.has(root.componentId)) {
|
|
148
|
+
issues.push(issue('forbidden-component', 'error', `Component "${root.componentId}" is not in this field's allowed vocabulary.`, [...path, 'componentId'], root.id, { allow: [...allowList] }));
|
|
149
|
+
}
|
|
150
|
+
walkNode(root, path, walkOpts, seenIds, issues);
|
|
151
|
+
});
|
|
152
|
+
return issues;
|
|
153
|
+
}
|
|
154
|
+
/** True if the graph has no error-severity issues. */
|
|
155
|
+
export function isGraphValid(issues) {
|
|
156
|
+
return !issues.some((i) => i.severity === 'error');
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/project-graph/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAI1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AA0DpD,SAAS,KAAK,CACZ,IAA6B,EAC7B,QAAqC,EACrC,OAAe,EACf,IAAe,EACf,MAAe,EACf,IAA8B;IAE9B,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAA;AAC/G,CAAC;AAED,SAAS,YAAY,CACnB,IAAe,EACf,IAAqB,EACrB,IAAe,EACf,MAAc,EACd,MAAyB;IAEzB,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS;QAAE,OAAM;IACnC,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,CAAA;IAC/B,IAAI,cAAc,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACjE,MAAM,CAAC,IAAI,CACT,KAAK,CACH,oBAAoB,EACpB,OAAO,EACP,2CAA2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CAAC,CAAA;QACnC,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;YAC9C,MAAM,CAAC,IAAI,CACT,KAAK,CACH,qBAAqB,EACrB,OAAO,EACP,cAAc,IAAI,CAAC,WAAW,8CAA8C,EAC5E,CAAC,GAAG,IAAI,EAAE,aAAa,CAAC,EACxB,IAAI,CAAC,EAAE,EACP,EAAE,KAAK,EAAE,CAAC,GAAG,SAAS,CAAC,EAAE,CAC1B,CACF,CAAA;QACH,CAAC;QACD,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAA;IACjD,CAAC,CAAC,CAAA;IACF,OAAO,MAAM,CAAA;AACf,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,YAAY,CAAC,MAAyB;IACpD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAA;AACpD,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { ParseRichTextResult, RichTextDoc, RichTextValue } from './schema';
|
|
3
|
+
import type { RenderRichTextOptions, RichTextRenderIssue } from './render';
|
|
4
|
+
import type { RichTextRegistry } from './registry';
|
|
5
|
+
/**
|
|
6
|
+
* The project-owned rich-text adapter (brief §7.6, EC-025).
|
|
7
|
+
*
|
|
8
|
+
* This interface is the *only* surface consumers (CMS fields, the runtime
|
|
9
|
+
* renderer, export) should depend on. It hides which editor produced the storage
|
|
10
|
+
* JSON: the spike implements it over the directly-modelled ProseMirror format, and
|
|
11
|
+
* a real TipTap-backed adapter can implement the same interface later with no
|
|
12
|
+
* change to callers. Crucially, none of these methods require the editor bundle —
|
|
13
|
+
* read, render, and validate are all server-safe.
|
|
14
|
+
*/
|
|
15
|
+
export interface RichTextAdapter {
|
|
16
|
+
/** Schema version this adapter reads and writes. */
|
|
17
|
+
readonly version: number;
|
|
18
|
+
/** An empty but valid versioned value. */
|
|
19
|
+
empty(): RichTextValue;
|
|
20
|
+
/** Stamp a document tree with the current schema version. */
|
|
21
|
+
create(doc: RichTextDoc): RichTextValue;
|
|
22
|
+
/** Parse/validate stored JSON (string or object). Never throws. */
|
|
23
|
+
parse(input: string | unknown): ParseRichTextResult;
|
|
24
|
+
/** Serialize a value to canonical JSON. */
|
|
25
|
+
serialize(value: RichTextValue): string;
|
|
26
|
+
/** Whether a value's stored version matches this adapter. */
|
|
27
|
+
isCompatible(value: RichTextValue): boolean;
|
|
28
|
+
/** Server-safe read-only render of a value to a React element. */
|
|
29
|
+
render(value: RichTextValue, options?: RenderRichTextOptions): ReactElement;
|
|
30
|
+
/** Collect unknown-node issues without rendering (pre-flight validation). */
|
|
31
|
+
validate(value: RichTextValue): RichTextRenderIssue[];
|
|
32
|
+
}
|
|
33
|
+
export interface CreateAdapterOptions {
|
|
34
|
+
/** Custom block/inline renderers used by {@link RichTextAdapter.render}. */
|
|
35
|
+
registry?: RichTextRegistry;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Build the default, project-owned adapter over the modelled storage format.
|
|
39
|
+
*
|
|
40
|
+
* A future TipTap-backed adapter would satisfy the same {@link RichTextAdapter}
|
|
41
|
+
* interface — only its `render`/editor wiring would differ; storage stays identical.
|
|
42
|
+
*/
|
|
43
|
+
export declare function createRichTextAdapter(options?: CreateAdapterOptions): RichTextAdapter;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { RICH_TEXT_SCHEMA_VERSION, createRichTextValue, emptyRichTextValue, isCompatibleRichTextVersion, parseRichTextValue, serializeRichTextValue, } from './schema';
|
|
2
|
+
import { renderRichTextValue } from './render';
|
|
3
|
+
import { findUnknownNodes } from './render';
|
|
4
|
+
import { emptyRichTextRegistry } from './registry';
|
|
5
|
+
/**
|
|
6
|
+
* Build the default, project-owned adapter over the modelled storage format.
|
|
7
|
+
*
|
|
8
|
+
* A future TipTap-backed adapter would satisfy the same {@link RichTextAdapter}
|
|
9
|
+
* interface — only its `render`/editor wiring would differ; storage stays identical.
|
|
10
|
+
*/
|
|
11
|
+
export function createRichTextAdapter(options = {}) {
|
|
12
|
+
const registry = options.registry ?? emptyRichTextRegistry;
|
|
13
|
+
return {
|
|
14
|
+
version: RICH_TEXT_SCHEMA_VERSION,
|
|
15
|
+
empty: emptyRichTextValue,
|
|
16
|
+
create: createRichTextValue,
|
|
17
|
+
parse: parseRichTextValue,
|
|
18
|
+
serialize: serializeRichTextValue,
|
|
19
|
+
isCompatible: isCompatibleRichTextVersion,
|
|
20
|
+
render: (value, renderOptions = {}) => renderRichTextValue(value, { registry, ...renderOptions }),
|
|
21
|
+
validate: (value) => findUnknownNodes(value.doc, registry),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../src/rich-text/adapter.ts"],"names":[],"mappings":"AACA,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,2BAA2B,EAC3B,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,UAAU,CAAA;AAEjB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AA4ClD;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,UAAgC,EAAE;IACtE,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,qBAAqB,CAAA;IAC1D,OAAO;QACL,OAAO,EAAE,wBAAwB;QACjC,KAAK,EAAE,kBAAkB;QACzB,MAAM,EAAE,mBAAmB;QAC3B,KAAK,EAAE,kBAAkB;QACzB,SAAS,EAAE,sBAAsB;QACjC,YAAY,EAAE,2BAA2B;QACzC,MAAM,EAAE,CAAC,KAAK,EAAE,aAAa,GAAG,EAAE,EAAE,EAAE,CACpC,mBAAmB,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,aAAa,EAAE,CAAC;QAC5D,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,EAAE,QAAQ,CAAC;KAC3D,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { RichTextDoc, RichTextNode } from './schema';
|
|
2
|
+
/**
|
|
3
|
+
* Inline-editing DOM bridge (EC-159).
|
|
4
|
+
*
|
|
5
|
+
* The canvas edits rich text by making the *read-only rendered element itself*
|
|
6
|
+
* contenteditable (the EC-158 approach — typography and layout are identical
|
|
7
|
+
* between render and edit states by construction). This module owns the two
|
|
8
|
+
* pure halves of that session:
|
|
9
|
+
*
|
|
10
|
+
* - **pairing** ({@link collectPreservedPairs}): before editing starts, walk
|
|
11
|
+
* the storage tree and the rendered DOM in parallel (the renderer's mapping
|
|
12
|
+
* is deterministic) and find every node that cannot be reconstructed from
|
|
13
|
+
* markup — custom registry blocks/inlines, unknown nodes, images, embeds.
|
|
14
|
+
* The host stamps those elements with {@link PRESERVE_NODE_ATTR} carrying
|
|
15
|
+
* the node's exact JSON and `contenteditable=false`, so they render
|
|
16
|
+
* correctly *inside* the live editor and survive the session byte-exact.
|
|
17
|
+
*
|
|
18
|
+
* - **parse-back** ({@link richTextDocFromDom}): after editing, invert the
|
|
19
|
+
* renderer's markup (`render.tsx`) back into the storage tree. Stamped
|
|
20
|
+
* elements restore their original node verbatim; everything else maps
|
|
21
|
+
* structurally (p/h1..h6/ul/ol/li/blockquote/pre/br/hr + the built-in mark
|
|
22
|
+
* tags). Never throws.
|
|
23
|
+
*
|
|
24
|
+
* Both halves work against minimal structural DOM interfaces so they are
|
|
25
|
+
* unit-testable in a Node environment (this workspace has no DOM test env);
|
|
26
|
+
* real `Element`/`Text` nodes satisfy them in the browser.
|
|
27
|
+
*
|
|
28
|
+
* Storage-format integrity: an untouched session must leave the stored value
|
|
29
|
+
* byte-identical. The session guarantees that by *comparing*, not rewriting:
|
|
30
|
+
* {@link richTextDocsEquivalent} checks the parsed-back tree against the
|
|
31
|
+
* original (normalizing only DOM-induced text-run splits), and an equivalent
|
|
32
|
+
* tree commits nothing — the stored bytes are never replaced by a re-serialization.
|
|
33
|
+
*/
|
|
34
|
+
/** Attribute carrying a preserved node's exact storage JSON during a session. */
|
|
35
|
+
export declare const PRESERVE_NODE_ATTR = "data-ec-rt-preserve";
|
|
36
|
+
export declare const RT_ELEMENT_NODE = 1;
|
|
37
|
+
export declare const RT_TEXT_NODE = 3;
|
|
38
|
+
export interface RtDomText {
|
|
39
|
+
readonly nodeType: number;
|
|
40
|
+
/** CharacterData.data — the exact text content. */
|
|
41
|
+
readonly data: string;
|
|
42
|
+
}
|
|
43
|
+
export interface RtDomElement {
|
|
44
|
+
readonly nodeType: number;
|
|
45
|
+
/** Uppercase in HTML documents; compared case-insensitively here. */
|
|
46
|
+
readonly tagName: string;
|
|
47
|
+
readonly childNodes: ArrayLike<RtDomNode>;
|
|
48
|
+
getAttribute(name: string): string | null;
|
|
49
|
+
}
|
|
50
|
+
export type RtDomNode = RtDomText | RtDomElement;
|
|
51
|
+
export declare function isRtElement(node: RtDomNode): node is RtDomElement;
|
|
52
|
+
export declare function isRtText(node: RtDomNode): node is RtDomText;
|
|
53
|
+
/**
|
|
54
|
+
* Whether a storage node type can be reconstructed from rendered markup.
|
|
55
|
+
* Images, embeds, custom registry nodes, and unknown nodes are *not* — they
|
|
56
|
+
* must be preserved verbatim during an editing session (atoms, not markup).
|
|
57
|
+
*/
|
|
58
|
+
export declare function isInvertibleRichTextNodeType(type: string): boolean;
|
|
59
|
+
/** A non-invertible storage node paired with the element that renders it. */
|
|
60
|
+
export interface PreservedPair {
|
|
61
|
+
node: RichTextNode;
|
|
62
|
+
element: RtDomElement;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Walk a document tree and its rendered DOM in parallel and return every
|
|
66
|
+
* non-invertible node paired with its element, so the host can stamp them
|
|
67
|
+
* before the DOM becomes editable. Returns `null` when the DOM does not match
|
|
68
|
+
* the renderer's deterministic mapping (the session should then refuse to
|
|
69
|
+
* start rather than risk lossy parsing).
|
|
70
|
+
*/
|
|
71
|
+
export declare function collectPreservedPairs(doc: RichTextDoc, host: RtDomElement): PreservedPair[] | null;
|
|
72
|
+
/** A structured problem found while parsing edited DOM back to storage. */
|
|
73
|
+
export interface DomParseIssue {
|
|
74
|
+
code: 'lossy-node';
|
|
75
|
+
message: string;
|
|
76
|
+
/** The tag or unknown-node type that could not be fully reconstructed. */
|
|
77
|
+
detail: string;
|
|
78
|
+
}
|
|
79
|
+
export interface DomToDocResult {
|
|
80
|
+
doc: RichTextDoc;
|
|
81
|
+
issues: DomParseIssue[];
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Parse an editing host's DOM back into a storage document. Never throws;
|
|
85
|
+
* anything that could not be fully reconstructed is reported as an issue (and
|
|
86
|
+
* still yields a visible node, never silent loss).
|
|
87
|
+
*/
|
|
88
|
+
export declare function richTextDocFromDom(host: RtDomElement): DomToDocResult;
|
|
89
|
+
/**
|
|
90
|
+
* Normalize a tree for comparison only (never for storage): merge adjacent
|
|
91
|
+
* text nodes carrying identical marks and drop empty text nodes — the splits
|
|
92
|
+
* and joins a contenteditable session performs without changing content.
|
|
93
|
+
*/
|
|
94
|
+
export declare function normalizeForComparison(nodes: readonly RichTextNode[]): RichTextNode[];
|
|
95
|
+
/**
|
|
96
|
+
* Whether two documents carry the same content, ignoring object key order and
|
|
97
|
+
* DOM-induced text-run splits. An equivalent parse-back means the editing
|
|
98
|
+
* session changed nothing and must not dispatch — leaving the stored value
|
|
99
|
+
* byte-identical (it is never rewritten).
|
|
100
|
+
*/
|
|
101
|
+
export declare function richTextDocsEquivalent(a: RichTextDoc, b: RichTextDoc): boolean;
|