@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,25 @@
|
|
|
1
|
+
import type { RichTextDoc, RichTextValue } from './schema';
|
|
2
|
+
import type { CustomNodeDefinition, RichTextRegistry } from './registry';
|
|
3
|
+
/**
|
|
4
|
+
* `callout` — a custom *block* component (e.g. surfaced from the project
|
|
5
|
+
* component registry). Reads a `tone` and renders its inline children.
|
|
6
|
+
*/
|
|
7
|
+
export declare const calloutBlock: CustomNodeDefinition;
|
|
8
|
+
/**
|
|
9
|
+
* `mention` — a custom *inline* atom (a data reference / @-mention). Renders a
|
|
10
|
+
* compact badge from its `label` and `id` attrs.
|
|
11
|
+
*/
|
|
12
|
+
export declare const mentionInline: CustomNodeDefinition;
|
|
13
|
+
/** A registry wired with the sample custom block + inline definitions. */
|
|
14
|
+
export declare const sampleRichTextRegistry: RichTextRegistry;
|
|
15
|
+
/**
|
|
16
|
+
* A representative document exercising headings, marks, lists, quote, code, a
|
|
17
|
+
* link, an image, an embed, plus the custom block and inline atom.
|
|
18
|
+
*/
|
|
19
|
+
export declare const sampleDoc: RichTextDoc;
|
|
20
|
+
/** The same sample content as a stored, versioned value. */
|
|
21
|
+
export declare const sampleRichTextValue: RichTextValue;
|
|
22
|
+
/** A document containing an unknown node type, to exercise fallback rendering. */
|
|
23
|
+
export declare const docWithUnknownNode: RichTextDoc;
|
|
24
|
+
/** A value at a future, incompatible schema version (for version checks). */
|
|
25
|
+
export declare const futureVersionValue: RichTextValue;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { createElement } from 'react';
|
|
2
|
+
import { RICH_TEXT_SCHEMA_VERSION, createRichTextValue } from './schema';
|
|
3
|
+
import { createRichTextRegistry } from './registry';
|
|
4
|
+
/**
|
|
5
|
+
* Fixtures for the rich-text spike (brief §7.6: "fixtures for every custom block").
|
|
6
|
+
*
|
|
7
|
+
* Every important rendered state is reproducible from these fixtures, per the
|
|
8
|
+
* determinism convention in AGENTS.md.
|
|
9
|
+
*/
|
|
10
|
+
function str(value) {
|
|
11
|
+
return typeof value === 'string' ? value : '';
|
|
12
|
+
}
|
|
13
|
+
// ---- Custom block + inline definitions -----------------------------------
|
|
14
|
+
/**
|
|
15
|
+
* `callout` — a custom *block* component (e.g. surfaced from the project
|
|
16
|
+
* component registry). Reads a `tone` and renders its inline children.
|
|
17
|
+
*/
|
|
18
|
+
export const calloutBlock = {
|
|
19
|
+
type: 'callout',
|
|
20
|
+
group: 'block',
|
|
21
|
+
render: ({ node, children }) => createElement('aside', { className: 'callout', 'data-tone': str(node.attrs?.tone) || 'info', role: 'note' }, children),
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* `mention` — a custom *inline* atom (a data reference / @-mention). Renders a
|
|
25
|
+
* compact badge from its `label` and `id` attrs.
|
|
26
|
+
*/
|
|
27
|
+
export const mentionInline = {
|
|
28
|
+
type: 'mention',
|
|
29
|
+
group: 'inline',
|
|
30
|
+
render: ({ node }) => createElement('span', { className: 'mention', 'data-mention-id': str(node.attrs?.id) }, `@${str(node.attrs?.label)}`),
|
|
31
|
+
};
|
|
32
|
+
/** A registry wired with the sample custom block + inline definitions. */
|
|
33
|
+
export const sampleRichTextRegistry = createRichTextRegistry([
|
|
34
|
+
calloutBlock,
|
|
35
|
+
mentionInline,
|
|
36
|
+
]);
|
|
37
|
+
// ---- Sample documents -----------------------------------------------------
|
|
38
|
+
/**
|
|
39
|
+
* A representative document exercising headings, marks, lists, quote, code, a
|
|
40
|
+
* link, an image, an embed, plus the custom block and inline atom.
|
|
41
|
+
*/
|
|
42
|
+
export const sampleDoc = {
|
|
43
|
+
type: 'doc',
|
|
44
|
+
content: [
|
|
45
|
+
{ type: 'heading', attrs: { level: 1 }, content: [{ type: 'text', text: 'Elytra' }] },
|
|
46
|
+
{
|
|
47
|
+
type: 'paragraph',
|
|
48
|
+
content: [
|
|
49
|
+
{ type: 'text', text: 'A ' },
|
|
50
|
+
{ type: 'text', text: 'code-first', marks: [{ type: 'bold' }] },
|
|
51
|
+
{ type: 'text', text: ' website builder with ' },
|
|
52
|
+
{ type: 'text', text: 'rich text', marks: [{ type: 'italic' }] },
|
|
53
|
+
{ type: 'text', text: ' and ' },
|
|
54
|
+
{ type: 'text', text: 'inline code', marks: [{ type: 'code' }] },
|
|
55
|
+
{ type: 'text', text: '.' },
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
type: 'paragraph',
|
|
60
|
+
content: [
|
|
61
|
+
{ type: 'text', text: 'See the ' },
|
|
62
|
+
{ type: 'text', text: 'project brief', marks: [{ type: 'link', attrs: { href: 'https://example.com/brief' } }] },
|
|
63
|
+
{ type: 'text', text: ' for details.' },
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
type: 'bulletList',
|
|
68
|
+
content: [
|
|
69
|
+
{ type: 'listItem', content: [{ type: 'paragraph', content: [{ type: 'text', text: 'First point' }] }] },
|
|
70
|
+
{ type: 'listItem', content: [{ type: 'paragraph', content: [{ type: 'text', text: 'Second point' }] }] },
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
type: 'orderedList',
|
|
75
|
+
content: [
|
|
76
|
+
{ type: 'listItem', content: [{ type: 'paragraph', content: [{ type: 'text', text: 'Step one' }] }] },
|
|
77
|
+
{ type: 'listItem', content: [{ type: 'paragraph', content: [{ type: 'text', text: 'Step two' }] }] },
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
{ type: 'blockquote', content: [{ type: 'paragraph', content: [{ type: 'text', text: 'Stay determined.' }] }] },
|
|
81
|
+
{ type: 'codeBlock', attrs: { language: 'ts' }, content: [{ type: 'text', text: 'const x = 1' }] },
|
|
82
|
+
{ type: 'image', attrs: { src: 'https://example.com/a.png', alt: 'Diagram' } },
|
|
83
|
+
{ type: 'embed', attrs: { src: 'https://example.com/video', provider: 'video', title: 'Demo video' } },
|
|
84
|
+
{
|
|
85
|
+
type: 'callout',
|
|
86
|
+
attrs: { tone: 'warning' },
|
|
87
|
+
content: [{ type: 'text', text: 'Heads up: this is a custom block.' }],
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
type: 'paragraph',
|
|
91
|
+
content: [
|
|
92
|
+
{ type: 'text', text: 'Owned by ' },
|
|
93
|
+
{ type: 'mention', attrs: { id: 'user-1', label: 'ada' } },
|
|
94
|
+
{ type: 'text', text: '.' },
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
};
|
|
99
|
+
/** The same sample content as a stored, versioned value. */
|
|
100
|
+
export const sampleRichTextValue = createRichTextValue(sampleDoc);
|
|
101
|
+
/** A document containing an unknown node type, to exercise fallback rendering. */
|
|
102
|
+
export const docWithUnknownNode = {
|
|
103
|
+
type: 'doc',
|
|
104
|
+
content: [
|
|
105
|
+
{ type: 'paragraph', content: [{ type: 'text', text: 'Before.' }] },
|
|
106
|
+
{ type: 'mysteryWidget', attrs: { foo: 'bar' } },
|
|
107
|
+
{ type: 'paragraph', content: [{ type: 'text', text: 'After.' }] },
|
|
108
|
+
],
|
|
109
|
+
};
|
|
110
|
+
/** A value at a future, incompatible schema version (for version checks). */
|
|
111
|
+
export const futureVersionValue = {
|
|
112
|
+
version: RICH_TEXT_SCHEMA_VERSION + 1,
|
|
113
|
+
doc: { type: 'doc', content: [{ type: 'paragraph', content: [{ type: 'text', text: 'newer' }] }] },
|
|
114
|
+
};
|
|
115
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../src/rich-text/fixtures.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAExE,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AAGnD;;;;;GAKG;AAEH,SAAS,GAAG,CAAC,KAA4B;IACvC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;AAC/C,CAAC;AAED,6EAA6E;AAE7E;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAyB;IAChD,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAC7B,aAAa,CACX,OAAO,EACP,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE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EAAE,KAAK,EAAE,EAAE;gBAC1D,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE;aAC5B;SACF;KACF;CACF,CAAA;AAED,4DAA4D;AAC5D,MAAM,CAAC,MAAM,mBAAmB,GAAkB,mBAAmB,CAAC,SAAS,CAAC,CAAA;AAEhF,kFAAkF;AAClF,MAAM,CAAC,MAAM,kBAAkB,GAAgB;IAC7C,IAAI,EAAE,KAAK;IACX,OAAO,EAAE;QACP,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAAE;QACnE,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,EAAkB;QAChE,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE;KACnE;CACF,CAAA;AAED,6EAA6E;AAC7E,MAAM,CAAC,MAAM,kBAAkB,GAAkB;IAC/C,OAAO,EAAE,wBAAwB,GAAG,CAAC;IACrC,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE;CACnG,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RichTextDoc } from './schema';
|
|
2
|
+
/** Serialize a document to a lossy HTML string. */
|
|
3
|
+
export declare function richTextToHtml(doc: RichTextDoc): string;
|
|
4
|
+
/** Parse a lossy HTML string into a document tree (pragmatic subset). */
|
|
5
|
+
export declare function htmlToRichText(html: string): RichTextDoc;
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lossy HTML import/export helpers (brief §7.6).
|
|
3
|
+
*
|
|
4
|
+
* Treated as lossy by design: export serializes the built-in node/mark set to
|
|
5
|
+
* semantic HTML and drops anything it does not recognise (custom blocks become a
|
|
6
|
+
* commented placeholder); import parses a pragmatic subset of HTML back into the
|
|
7
|
+
* storage tree. No DOM dependency — a tiny tokenizer keeps this server-safe.
|
|
8
|
+
*
|
|
9
|
+
* The goal is a faithful *enough* round-trip for the common cases (headings,
|
|
10
|
+
* paragraphs, lists, quotes, code, links, bold/italic/code marks), not a spec-
|
|
11
|
+
* complete HTML engine.
|
|
12
|
+
*/
|
|
13
|
+
const VOID_TAGS = new Set(['br', 'hr', 'img']);
|
|
14
|
+
const HEADING_TAGS = { h1: 1, h2: 2, h3: 3, h4: 4, h5: 5, h6: 6 };
|
|
15
|
+
const MARK_TAGS = {
|
|
16
|
+
strong: 'bold',
|
|
17
|
+
b: 'bold',
|
|
18
|
+
em: 'italic',
|
|
19
|
+
i: 'italic',
|
|
20
|
+
code: 'code',
|
|
21
|
+
s: 'strike',
|
|
22
|
+
strike: 'strike',
|
|
23
|
+
del: 'strike',
|
|
24
|
+
u: 'underline',
|
|
25
|
+
};
|
|
26
|
+
function escapeHtml(text) {
|
|
27
|
+
return text
|
|
28
|
+
.replace(/&/g, '&')
|
|
29
|
+
.replace(/</g, '<')
|
|
30
|
+
.replace(/>/g, '>');
|
|
31
|
+
}
|
|
32
|
+
function escapeAttr(text) {
|
|
33
|
+
return escapeHtml(text).replace(/"/g, '"');
|
|
34
|
+
}
|
|
35
|
+
function decodeEntities(text) {
|
|
36
|
+
return text
|
|
37
|
+
.replace(/</g, '<')
|
|
38
|
+
.replace(/>/g, '>')
|
|
39
|
+
.replace(/"/g, '"')
|
|
40
|
+
.replace(/'/g, "'")
|
|
41
|
+
.replace(/&/g, '&');
|
|
42
|
+
}
|
|
43
|
+
function attr(node, name) {
|
|
44
|
+
const v = node.attrs?.[name];
|
|
45
|
+
return typeof v === 'string' ? v : undefined;
|
|
46
|
+
}
|
|
47
|
+
// ---------------------------------------------------------------------------
|
|
48
|
+
// Export: storage tree → HTML
|
|
49
|
+
// ---------------------------------------------------------------------------
|
|
50
|
+
function markToTag(mark) {
|
|
51
|
+
switch (mark.type) {
|
|
52
|
+
case 'bold':
|
|
53
|
+
return { open: '<strong>', close: '</strong>' };
|
|
54
|
+
case 'italic':
|
|
55
|
+
return { open: '<em>', close: '</em>' };
|
|
56
|
+
case 'code':
|
|
57
|
+
return { open: '<code>', close: '</code>' };
|
|
58
|
+
case 'strike':
|
|
59
|
+
return { open: '<s>', close: '</s>' };
|
|
60
|
+
case 'underline':
|
|
61
|
+
return { open: '<u>', close: '</u>' };
|
|
62
|
+
case 'link': {
|
|
63
|
+
const href = typeof mark.attrs?.href === 'string' ? mark.attrs.href : '#';
|
|
64
|
+
return { open: `<a href="${escapeAttr(href)}">`, close: '</a>' };
|
|
65
|
+
}
|
|
66
|
+
default:
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function inlineToHtml(node) {
|
|
71
|
+
if (node.type === 'hardBreak')
|
|
72
|
+
return '<br>';
|
|
73
|
+
if (node.type !== 'text')
|
|
74
|
+
return childrenToHtml(node.content);
|
|
75
|
+
let html = escapeHtml(node.text ?? '');
|
|
76
|
+
for (const mark of node.marks ?? []) {
|
|
77
|
+
const tag = markToTag(mark);
|
|
78
|
+
if (tag)
|
|
79
|
+
html = `${tag.open}${html}${tag.close}`;
|
|
80
|
+
}
|
|
81
|
+
return html;
|
|
82
|
+
}
|
|
83
|
+
function childrenToHtml(nodes) {
|
|
84
|
+
return (nodes ?? []).map(nodeToHtml).join('');
|
|
85
|
+
}
|
|
86
|
+
function nodeToHtml(node) {
|
|
87
|
+
switch (node.type) {
|
|
88
|
+
case 'paragraph':
|
|
89
|
+
return `<p>${childrenToHtml(node.content)}</p>`;
|
|
90
|
+
case 'heading': {
|
|
91
|
+
const level = typeof node.attrs?.level === 'number' ? node.attrs.level : 1;
|
|
92
|
+
const l = level >= 1 && level <= 6 ? level : 1;
|
|
93
|
+
return `<h${l}>${childrenToHtml(node.content)}</h${l}>`;
|
|
94
|
+
}
|
|
95
|
+
case 'bulletList':
|
|
96
|
+
return `<ul>${childrenToHtml(node.content)}</ul>`;
|
|
97
|
+
case 'orderedList':
|
|
98
|
+
return `<ol>${childrenToHtml(node.content)}</ol>`;
|
|
99
|
+
case 'listItem':
|
|
100
|
+
return `<li>${childrenToHtml(node.content)}</li>`;
|
|
101
|
+
case 'blockquote':
|
|
102
|
+
return `<blockquote>${childrenToHtml(node.content)}</blockquote>`;
|
|
103
|
+
case 'codeBlock':
|
|
104
|
+
return `<pre><code>${childrenToHtml(node.content)}</code></pre>`;
|
|
105
|
+
case 'horizontalRule':
|
|
106
|
+
return '<hr>';
|
|
107
|
+
case 'hardBreak':
|
|
108
|
+
return '<br>';
|
|
109
|
+
case 'image': {
|
|
110
|
+
const src = escapeAttr(attr(node, 'src') ?? '');
|
|
111
|
+
const alt = escapeAttr(attr(node, 'alt') ?? '');
|
|
112
|
+
return `<img src="${src}" alt="${alt}">`;
|
|
113
|
+
}
|
|
114
|
+
case 'text':
|
|
115
|
+
return inlineToHtml(node);
|
|
116
|
+
default:
|
|
117
|
+
// Lossy: custom/unknown blocks are not representable in plain HTML. Emit a
|
|
118
|
+
// comment placeholder so the loss is visible and round-trippable-ish.
|
|
119
|
+
return `<!-- rich-text:${node.type} -->`;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/** Serialize a document to a lossy HTML string. */
|
|
123
|
+
export function richTextToHtml(doc) {
|
|
124
|
+
return childrenToHtml(doc.content);
|
|
125
|
+
}
|
|
126
|
+
function parseAttrs(raw) {
|
|
127
|
+
const attrs = {};
|
|
128
|
+
const re = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)\s*=\s*"([^"]*)"/g;
|
|
129
|
+
let m;
|
|
130
|
+
while ((m = re.exec(raw)) !== null) {
|
|
131
|
+
const name = m[1];
|
|
132
|
+
const value = m[2];
|
|
133
|
+
if (name !== undefined && value !== undefined)
|
|
134
|
+
attrs[name.toLowerCase()] = decodeEntities(value);
|
|
135
|
+
}
|
|
136
|
+
return attrs;
|
|
137
|
+
}
|
|
138
|
+
function tokenize(html) {
|
|
139
|
+
const tokens = [];
|
|
140
|
+
const tagRe = /<!--[\s\S]*?-->|<\/?([a-zA-Z][a-zA-Z0-9]*)((?:[^>"']|"[^"]*"|'[^']*')*)\/?>/g;
|
|
141
|
+
let last = 0;
|
|
142
|
+
let m;
|
|
143
|
+
while ((m = tagRe.exec(html)) !== null) {
|
|
144
|
+
if (m.index > last) {
|
|
145
|
+
tokens.push({ kind: 'text', text: html.slice(last, m.index) });
|
|
146
|
+
}
|
|
147
|
+
last = tagRe.lastIndex;
|
|
148
|
+
const full = m[0];
|
|
149
|
+
if (full.startsWith('<!--'))
|
|
150
|
+
continue; // drop comments (incl. our placeholders)
|
|
151
|
+
const tag = (m[1] ?? '').toLowerCase();
|
|
152
|
+
const isClose = full.startsWith('</');
|
|
153
|
+
const isSelfClose = full.endsWith('/>') || VOID_TAGS.has(tag);
|
|
154
|
+
if (isClose) {
|
|
155
|
+
tokens.push({ kind: 'close', tag });
|
|
156
|
+
}
|
|
157
|
+
else if (isSelfClose) {
|
|
158
|
+
tokens.push({ kind: 'void', tag, attrs: parseAttrs(m[2] ?? '') });
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
tokens.push({ kind: 'open', tag, attrs: parseAttrs(m[2] ?? '') });
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
if (last < html.length)
|
|
165
|
+
tokens.push({ kind: 'text', text: html.slice(last) });
|
|
166
|
+
return tokens;
|
|
167
|
+
}
|
|
168
|
+
function textNode(text, marks) {
|
|
169
|
+
return marks.length > 0 ? { type: 'text', text, marks: [...marks] } : { type: 'text', text };
|
|
170
|
+
}
|
|
171
|
+
/** Parse a run of inline tokens into text nodes, tracking active marks. */
|
|
172
|
+
function parseInline(tokens, start, stopTags) {
|
|
173
|
+
const nodes = [];
|
|
174
|
+
const stack = [{ marks: [] }];
|
|
175
|
+
let i = start;
|
|
176
|
+
const activeMarks = () => stack[stack.length - 1]?.marks ?? [];
|
|
177
|
+
for (; i < tokens.length; i++) {
|
|
178
|
+
const tok = tokens[i];
|
|
179
|
+
if (!tok)
|
|
180
|
+
break;
|
|
181
|
+
if (tok.kind === 'close' && stopTags.has(tok.tag))
|
|
182
|
+
break;
|
|
183
|
+
if (tok.kind === 'open' && (MARK_TAGS[tok.tag] || tok.tag === 'a')) {
|
|
184
|
+
const markType = tok.tag === 'a' ? 'link' : MARK_TAGS[tok.tag];
|
|
185
|
+
if (markType) {
|
|
186
|
+
const mark = tok.tag === 'a' && tok.attrs.href ? { type: 'link', attrs: { href: tok.attrs.href } } : { type: markType };
|
|
187
|
+
stack.push({ marks: [...activeMarks(), mark] });
|
|
188
|
+
}
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
if (tok.kind === 'close' && (MARK_TAGS[tok.tag] || tok.tag === 'a')) {
|
|
192
|
+
if (stack.length > 1)
|
|
193
|
+
stack.pop();
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
if (tok.kind === 'void' && tok.tag === 'br') {
|
|
197
|
+
nodes.push({ type: 'hardBreak' });
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
if (tok.kind === 'text') {
|
|
201
|
+
const text = decodeEntities(tok.text);
|
|
202
|
+
if (text.length > 0)
|
|
203
|
+
nodes.push(textNode(text, activeMarks()));
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
// Any other tag inside inline context: stop (caller handles blocks).
|
|
207
|
+
if (tok.kind === 'open' || tok.kind === 'close' || tok.kind === 'void')
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
return { nodes, next: i };
|
|
211
|
+
}
|
|
212
|
+
const BLOCK_STOP = new Set(['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'li', 'blockquote', 'pre']);
|
|
213
|
+
function parseBlocks(tokens, start, stopTag) {
|
|
214
|
+
const nodes = [];
|
|
215
|
+
let i = start;
|
|
216
|
+
while (i < tokens.length) {
|
|
217
|
+
const tok = tokens[i];
|
|
218
|
+
if (!tok)
|
|
219
|
+
break;
|
|
220
|
+
if (tok.kind === 'close' && stopTag && tok.tag === stopTag) {
|
|
221
|
+
i++;
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
if (tok.kind === 'text') {
|
|
225
|
+
// Bare text outside a block — wrap loose text in a paragraph if non-empty.
|
|
226
|
+
if (tok.text.trim().length > 0)
|
|
227
|
+
nodes.push({ type: 'paragraph', content: [textNode(decodeEntities(tok.text).trim(), [])] });
|
|
228
|
+
i++;
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
if (tok.kind === 'open') {
|
|
232
|
+
const tag = tok.tag;
|
|
233
|
+
if (HEADING_TAGS[tag] !== undefined) {
|
|
234
|
+
const inline = parseInline(tokens, i + 1, new Set([tag]));
|
|
235
|
+
nodes.push({ type: 'heading', attrs: { level: HEADING_TAGS[tag] }, content: inline.nodes });
|
|
236
|
+
i = inline.next + 1;
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
if (tag === 'p') {
|
|
240
|
+
const inline = parseInline(tokens, i + 1, BLOCK_STOP);
|
|
241
|
+
nodes.push({ type: 'paragraph', content: inline.nodes });
|
|
242
|
+
i = inline.next + 1;
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
if (tag === 'ul' || tag === 'ol') {
|
|
246
|
+
const inner = parseBlocks(tokens, i + 1, tag);
|
|
247
|
+
nodes.push({ type: tag === 'ul' ? 'bulletList' : 'orderedList', content: inner.nodes });
|
|
248
|
+
i = inner.next;
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
if (tag === 'li') {
|
|
252
|
+
const inner = parseBlocks(tokens, i + 1, 'li');
|
|
253
|
+
// Normalise: a list item always wraps its content in at least one block.
|
|
254
|
+
const itemContent = inner.nodes.length > 0 ? inner.nodes : [{ type: 'paragraph', content: [] }];
|
|
255
|
+
nodes.push({ type: 'listItem', content: itemContent });
|
|
256
|
+
i = inner.next;
|
|
257
|
+
continue;
|
|
258
|
+
}
|
|
259
|
+
if (tag === 'blockquote') {
|
|
260
|
+
const inner = parseBlocks(tokens, i + 1, 'blockquote');
|
|
261
|
+
nodes.push({ type: 'blockquote', content: inner.nodes });
|
|
262
|
+
i = inner.next;
|
|
263
|
+
continue;
|
|
264
|
+
}
|
|
265
|
+
if (tag === 'pre') {
|
|
266
|
+
// Collect raw text until </pre>, stripping an optional <code> wrapper.
|
|
267
|
+
const inline = parseInline(tokens, i + 1, new Set(['pre', 'code']));
|
|
268
|
+
const text = inline.nodes.map((n) => n.text ?? '').join('');
|
|
269
|
+
// skip to matching </pre>
|
|
270
|
+
let j = inline.next;
|
|
271
|
+
for (; j < tokens.length; j++) {
|
|
272
|
+
const t = tokens[j];
|
|
273
|
+
if (t && t.kind === 'close' && t.tag === 'pre')
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
nodes.push({ type: 'codeBlock', content: text ? [{ type: 'text', text }] : [] });
|
|
277
|
+
i = j + 1;
|
|
278
|
+
continue;
|
|
279
|
+
}
|
|
280
|
+
if (tag === 'code') {
|
|
281
|
+
// <code> at block level without <pre>: treat its run as a paragraph.
|
|
282
|
+
const inline = parseInline(tokens, i, BLOCK_STOP);
|
|
283
|
+
nodes.push({ type: 'paragraph', content: inline.nodes });
|
|
284
|
+
i = inline.next;
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
if (tok.kind === 'void') {
|
|
289
|
+
if (tok.tag === 'hr')
|
|
290
|
+
nodes.push({ type: 'horizontalRule' });
|
|
291
|
+
else if (tok.tag === 'img')
|
|
292
|
+
nodes.push({ type: 'image', attrs: { src: tok.attrs.src ?? '', alt: tok.attrs.alt ?? '' } });
|
|
293
|
+
else if (tok.tag === 'br')
|
|
294
|
+
nodes.push({ type: 'paragraph', content: [{ type: 'hardBreak' }] });
|
|
295
|
+
i++;
|
|
296
|
+
continue;
|
|
297
|
+
}
|
|
298
|
+
// Unhandled token: skip.
|
|
299
|
+
i++;
|
|
300
|
+
}
|
|
301
|
+
return { nodes, next: i };
|
|
302
|
+
}
|
|
303
|
+
/** Parse a lossy HTML string into a document tree (pragmatic subset). */
|
|
304
|
+
export function htmlToRichText(html) {
|
|
305
|
+
const tokens = tokenize(html);
|
|
306
|
+
const { nodes } = parseBlocks(tokens, 0, undefined);
|
|
307
|
+
return { type: 'doc', content: nodes };
|
|
308
|
+
}
|
|
309
|
+
//# sourceMappingURL=html.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html.js","sourceRoot":"","sources":["../../src/rich-text/html.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AAEH,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAA;AAE9C,MAAM,YAAY,GAA2B,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAA;AAEzF,MAAM,SAAS,GAA2B;IACxC,MAAM,EAAE,MAAM;IACd,CAAC,EAAE,MAAM;IACT,EAAE,EAAE,QAAQ;IACZ,CAAC,EAAE,QAAQ;IACX,IAAI,EAAE,MAAM;IACZ,CAAC,EAAE,QAAQ;IACX,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,QAAQ;IACb,CAAC,EAAE,WAAW;CACf,CAAA;AAED,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,IAAI;SACR,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IA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E,CAAC,EAAE,CAAC,CAAA;YAC9F,CAAC,EAAE,CAAA;YACH,SAAQ;QACV,CAAC;QACD,yBAAyB;QACzB,CAAC,EAAE,CAAA;IACL,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,CAAA;AAC3B,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC7B,MAAM,EAAE,KAAK,EAAE,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,SAAS,CAAC,CAAA;IACnD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAA;AACxC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @elytracms/rich-text — a TipTap-OSS-shaped, adapter-backed rich-text system.
|
|
3
|
+
*
|
|
4
|
+
* Storage is a versioned, ProseMirror-shaped JSON document; the renderer is
|
|
5
|
+
* server-safe (React, no editor bundle); custom blocks and inline atoms plug in
|
|
6
|
+
* through a registry; HTML/Markdown helpers provide lossy import/export. The
|
|
7
|
+
* {@link RichTextAdapter} seam hides the editor so a real TipTap editor can be
|
|
8
|
+
* dropped in later without changing consumers. See brief §7.6 / task EC-025.
|
|
9
|
+
*/
|
|
10
|
+
export * from './schema';
|
|
11
|
+
export * from './embed';
|
|
12
|
+
export * from './registry';
|
|
13
|
+
export * from './render';
|
|
14
|
+
export * from './adapter';
|
|
15
|
+
export * from './html';
|
|
16
|
+
export * from './markdown';
|
|
17
|
+
export * from './portable-text';
|
|
18
|
+
export * from './fixtures';
|
|
19
|
+
export * from './dom-editor';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @elytracms/rich-text — a TipTap-OSS-shaped, adapter-backed rich-text system.
|
|
3
|
+
*
|
|
4
|
+
* Storage is a versioned, ProseMirror-shaped JSON document; the renderer is
|
|
5
|
+
* server-safe (React, no editor bundle); custom blocks and inline atoms plug in
|
|
6
|
+
* through a registry; HTML/Markdown helpers provide lossy import/export. The
|
|
7
|
+
* {@link RichTextAdapter} seam hides the editor so a real TipTap editor can be
|
|
8
|
+
* dropped in later without changing consumers. See brief §7.6 / task EC-025.
|
|
9
|
+
*/
|
|
10
|
+
export * from './schema';
|
|
11
|
+
export * from './embed';
|
|
12
|
+
export * from './registry';
|
|
13
|
+
export * from './render';
|
|
14
|
+
export * from './adapter';
|
|
15
|
+
export * from './html';
|
|
16
|
+
export * from './markdown';
|
|
17
|
+
export * from './portable-text';
|
|
18
|
+
export * from './fixtures';
|
|
19
|
+
export * from './dom-editor';
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rich-text/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RichTextDoc, RichTextNode } from './schema';
|
|
2
|
+
/** Serialize a document to a lossy Markdown string. */
|
|
3
|
+
export declare function richTextToMarkdown(doc: RichTextDoc): string;
|
|
4
|
+
/** Parse inline Markdown (bold/italic/code/link) into text nodes. Lossy. */
|
|
5
|
+
export declare function parseInlineMarkdown(text: string): RichTextNode[];
|
|
6
|
+
/** Parse a lossy Markdown string into a document tree. */
|
|
7
|
+
export declare function markdownToRichText(markdown: string): RichTextDoc;
|