@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,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook system (EC-135). A deterministic, extensible lifecycle bus: plugins register handlers at
|
|
3
|
+
* named points, and the host runs each point as a transform chain — every handler receives the
|
|
4
|
+
* current payload and may return a replacement, threading the result to the next handler. Ordering
|
|
5
|
+
* is fully deterministic: handlers run by ascending `order`, ties broken by registration sequence
|
|
6
|
+
* (never insertion-hash or wall-clock), so a given set of plugins always produces the same result.
|
|
7
|
+
*/
|
|
8
|
+
/** Well-known lifecycle points the studio and packages fire. Plugins may also define their own. */
|
|
9
|
+
export const HOOK_POINTS = [
|
|
10
|
+
'graph:beforeValidate',
|
|
11
|
+
'graph:afterValidate',
|
|
12
|
+
'document:beforeSave',
|
|
13
|
+
'document:afterSave',
|
|
14
|
+
'export:beforeGenerate',
|
|
15
|
+
'export:afterGenerate',
|
|
16
|
+
'plugin:installed',
|
|
17
|
+
];
|
|
18
|
+
const isThenable = (v) => typeof v === 'object' && v !== null && typeof v.then === 'function';
|
|
19
|
+
/**
|
|
20
|
+
* A deterministic hook bus. Synchronous (`run`) and async (`runAsync`) execution both thread the
|
|
21
|
+
* payload through handlers ordered by `(order, registration-sequence)`. Never throws on an empty
|
|
22
|
+
* point — running an unregistered point returns the payload unchanged.
|
|
23
|
+
*/
|
|
24
|
+
export class HookBus {
|
|
25
|
+
taps = new Map();
|
|
26
|
+
seq = 0;
|
|
27
|
+
/** Register a handler at a point. Returns an unsubscribe function. */
|
|
28
|
+
on(point, handler, opts = {}) {
|
|
29
|
+
const list = this.taps.get(point) ?? [];
|
|
30
|
+
const tap = {
|
|
31
|
+
order: opts.order ?? 0,
|
|
32
|
+
seq: this.seq++,
|
|
33
|
+
handler: handler,
|
|
34
|
+
...(opts.id !== undefined ? { id: opts.id } : {}),
|
|
35
|
+
...(opts.plugin !== undefined ? { plugin: opts.plugin } : {}),
|
|
36
|
+
};
|
|
37
|
+
list.push(tap);
|
|
38
|
+
this.taps.set(point, list);
|
|
39
|
+
return () => {
|
|
40
|
+
const arr = this.taps.get(point);
|
|
41
|
+
if (arr)
|
|
42
|
+
this.taps.set(point, arr.filter((t) => t !== tap));
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/** Handlers at a point in deterministic run order. */
|
|
46
|
+
ordered(point) {
|
|
47
|
+
return [...(this.taps.get(point) ?? [])].sort((a, b) => a.order - b.order || a.seq - b.seq);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Run a point synchronously, threading `payload` through each handler. A handler that returns a
|
|
51
|
+
* Promise is skipped for threading (use {@link runAsync} for async handlers) but still fires.
|
|
52
|
+
*/
|
|
53
|
+
run(point, payload) {
|
|
54
|
+
let current = payload;
|
|
55
|
+
for (const tap of this.ordered(point)) {
|
|
56
|
+
const next = tap.handler(current);
|
|
57
|
+
if (next !== undefined && !isThenable(next))
|
|
58
|
+
current = next;
|
|
59
|
+
}
|
|
60
|
+
return current;
|
|
61
|
+
}
|
|
62
|
+
/** Run a point asynchronously, awaiting each handler in deterministic order. */
|
|
63
|
+
async runAsync(point, payload) {
|
|
64
|
+
let current = payload;
|
|
65
|
+
for (const tap of this.ordered(point)) {
|
|
66
|
+
const next = await tap.handler(current);
|
|
67
|
+
if (next !== undefined)
|
|
68
|
+
current = next;
|
|
69
|
+
}
|
|
70
|
+
return current;
|
|
71
|
+
}
|
|
72
|
+
/** All points that have at least one handler, sorted. */
|
|
73
|
+
points() {
|
|
74
|
+
return [...this.taps.keys()].filter((p) => (this.taps.get(p)?.length ?? 0) > 0).sort();
|
|
75
|
+
}
|
|
76
|
+
/** Number of handlers registered at a point. */
|
|
77
|
+
count(point) {
|
|
78
|
+
return this.taps.get(point)?.length ?? 0;
|
|
79
|
+
}
|
|
80
|
+
/** Inspect registered taps at a point (deterministic order). */
|
|
81
|
+
list(point) {
|
|
82
|
+
return this.ordered(point).map((t) => ({
|
|
83
|
+
point,
|
|
84
|
+
order: t.order,
|
|
85
|
+
...(t.id !== undefined ? { id: t.id } : {}),
|
|
86
|
+
...(t.plugin !== undefined ? { plugin: t.plugin } : {}),
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
89
|
+
/** Inspect every registered tap across all points (deterministic order). */
|
|
90
|
+
all() {
|
|
91
|
+
return this.points().flatMap((p) => this.list(p));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/plug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ility layer (brief §4.10, §11, Phase 11). One coherent plugin
|
|
3
|
+
* model over every extension surface:
|
|
4
|
+
*
|
|
5
|
+
* - Hook system (EC-135) — deterministic lifecycle bus.
|
|
6
|
+
* - Field-type plugins (EC-131) — new CMS field types behind a validated interface.
|
|
7
|
+
* - Data-source adapters (EC-132) — new source kinds that resolve through the shared binding model.
|
|
8
|
+
* - Asset-storage adapters (EC-133) — pluggable blob backends.
|
|
9
|
+
* - Export-target adapters (EC-134) — pluggable export pipelines; Next.js is the reference target.
|
|
10
|
+
* - Component package conventions (EC-130) — namespaced, versioned, distributable components.
|
|
11
|
+
* - Project templates (EC-136) — third-party seeds validated like first-party kits.
|
|
12
|
+
* - Marketplace / private registry (EC-137) — publish + install, public and private.
|
|
13
|
+
*
|
|
14
|
+
* Everything is deterministic and validation-first: registration and install collect structured
|
|
15
|
+
* issues rather than throwing, so broken extensions surface visibly instead of crashing.
|
|
16
|
+
*/
|
|
17
|
+
export declare const PACKAGE = "@elytracms/core/plugins";
|
|
18
|
+
export * from './hooks';
|
|
19
|
+
export * from './field-types';
|
|
20
|
+
export * from './data-sources';
|
|
21
|
+
export * from './asset-storage';
|
|
22
|
+
export * from './export-targets';
|
|
23
|
+
export * from './component-package';
|
|
24
|
+
export * from './templates';
|
|
25
|
+
export * from './plugin';
|
|
26
|
+
export * from './marketplace';
|
|
27
|
+
export * from './examples';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @elytracms/plugins — the extensibility layer (brief §4.10, §11, Phase 11). One coherent plugin
|
|
3
|
+
* model over every extension surface:
|
|
4
|
+
*
|
|
5
|
+
* - Hook system (EC-135) — deterministic lifecycle bus.
|
|
6
|
+
* - Field-type plugins (EC-131) — new CMS field types behind a validated interface.
|
|
7
|
+
* - Data-source adapters (EC-132) — new source kinds that resolve through the shared binding model.
|
|
8
|
+
* - Asset-storage adapters (EC-133) — pluggable blob backends.
|
|
9
|
+
* - Export-target adapters (EC-134) — pluggable export pipelines; Next.js is the reference target.
|
|
10
|
+
* - Component package conventions (EC-130) — namespaced, versioned, distributable components.
|
|
11
|
+
* - Project templates (EC-136) — third-party seeds validated like first-party kits.
|
|
12
|
+
* - Marketplace / private registry (EC-137) — publish + install, public and private.
|
|
13
|
+
*
|
|
14
|
+
* Everything is deterministic and validation-first: registration and install collect structured
|
|
15
|
+
* issues rather than throwing, so broken extensions surface visibly instead of crashing.
|
|
16
|
+
*/
|
|
17
|
+
export const PACKAGE = '@elytracms/core/plugins';
|
|
18
|
+
export * from './hooks';
|
|
19
|
+
export * from './field-types';
|
|
20
|
+
export * from './data-sources';
|
|
21
|
+
export * from './asset-storage';
|
|
22
|
+
export * from './export-targets';
|
|
23
|
+
export * from './component-package';
|
|
24
|
+
export * from './templates';
|
|
25
|
+
export * from './plugin';
|
|
26
|
+
export * from './marketplace';
|
|
27
|
+
export * from './examples';
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,yBAAyB,CAAA;AAEhD,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { PluginHost } from './plugin';
|
|
2
|
+
import type { Plugin, PluginIssue } from './plugin';
|
|
3
|
+
/**
|
|
4
|
+
* Marketplace / private registry (EC-137). A registry is a named catalogue of installable
|
|
5
|
+
* extensions (each modelled uniformly as a {@link Plugin}, so a single field type and a full
|
|
6
|
+
* bundle install the same way). Registries are `public` or `private`; private ones gate access
|
|
7
|
+
* behind tokens. A {@link MarketplaceClient} federates several registries, searches the ones it can
|
|
8
|
+
* access, and installs a listing into a {@link PluginHost} — the consume flow.
|
|
9
|
+
*/
|
|
10
|
+
/** What a marketplace listing contributes (for filtering / badges). */
|
|
11
|
+
export type ExtensionKind = 'plugin' | 'component-package' | 'field-type' | 'data-source' | 'asset-storage' | 'export-target' | 'template';
|
|
12
|
+
/** A published, installable extension. */
|
|
13
|
+
export interface ExtensionListing {
|
|
14
|
+
id: string;
|
|
15
|
+
kind: ExtensionKind;
|
|
16
|
+
name: string;
|
|
17
|
+
version: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
author?: string;
|
|
20
|
+
tags?: string[];
|
|
21
|
+
/** The installable bundle. Single-surface extensions are plugins with one populated field. */
|
|
22
|
+
plugin: Plugin;
|
|
23
|
+
}
|
|
24
|
+
export interface RegistryConfig {
|
|
25
|
+
id: string;
|
|
26
|
+
label: string;
|
|
27
|
+
mode: 'public' | 'private';
|
|
28
|
+
/** For `private` registries: tokens that grant read/install access. */
|
|
29
|
+
accessTokens?: readonly string[];
|
|
30
|
+
}
|
|
31
|
+
/** Derive the listing kind from a plugin's populated surfaces (a multi-surface plugin → 'plugin'). */
|
|
32
|
+
export declare function inferExtensionKind(plugin: Plugin): ExtensionKind;
|
|
33
|
+
export interface ListingFilter {
|
|
34
|
+
kind?: ExtensionKind;
|
|
35
|
+
/** Case-insensitive substring over name / description / tags / author. */
|
|
36
|
+
query?: string;
|
|
37
|
+
}
|
|
38
|
+
/** A named catalogue of installable extensions (public or private). */
|
|
39
|
+
export declare class ExtensionRegistry {
|
|
40
|
+
readonly id: string;
|
|
41
|
+
readonly label: string;
|
|
42
|
+
readonly mode: 'public' | 'private';
|
|
43
|
+
private readonly accessTokens;
|
|
44
|
+
private readonly listings;
|
|
45
|
+
constructor(config: RegistryConfig, listings?: Iterable<ExtensionListing>);
|
|
46
|
+
/** Publish (or replace) a listing. */
|
|
47
|
+
publish(listing: ExtensionListing): void;
|
|
48
|
+
/** Whether a caller with `token` may read/install from this registry. */
|
|
49
|
+
canAccess(token?: string): boolean;
|
|
50
|
+
get(id: string): ExtensionListing | undefined;
|
|
51
|
+
has(id: string): boolean;
|
|
52
|
+
list(filter?: ListingFilter): ExtensionListing[];
|
|
53
|
+
get size(): number;
|
|
54
|
+
}
|
|
55
|
+
/** The reason an install was blocked (distinct from validation failures). */
|
|
56
|
+
export type InstallBlockedReason = 'not-found' | 'access-denied';
|
|
57
|
+
export interface MarketplaceInstallResult {
|
|
58
|
+
ok: boolean;
|
|
59
|
+
listingId: string;
|
|
60
|
+
/** The registry the listing was installed from, when found+accessible. */
|
|
61
|
+
registryId?: string;
|
|
62
|
+
/** Why a non-ok install was blocked before validation, if applicable. */
|
|
63
|
+
blocked?: InstallBlockedReason;
|
|
64
|
+
/** Validation/registration issues from the host install (when it ran). */
|
|
65
|
+
issues: PluginIssue[];
|
|
66
|
+
}
|
|
67
|
+
/** A federated marketplace client over several registries, with per-registry credentials (EC-137). */
|
|
68
|
+
export declare class MarketplaceClient {
|
|
69
|
+
private readonly registries;
|
|
70
|
+
private readonly credentials;
|
|
71
|
+
constructor(registries: ExtensionRegistry[], credentials?: Record<string, string>);
|
|
72
|
+
/** The registries this client can access with its current credentials. */
|
|
73
|
+
accessibleRegistries(): ExtensionRegistry[];
|
|
74
|
+
/** Search across accessible registries (private ones the client lacks tokens for are excluded). */
|
|
75
|
+
search(filter?: ListingFilter): {
|
|
76
|
+
registryId: string;
|
|
77
|
+
listing: ExtensionListing;
|
|
78
|
+
}[];
|
|
79
|
+
/** Resolve a listing by id across accessible registries (first match wins). */
|
|
80
|
+
find(listingId: string): {
|
|
81
|
+
registry: ExtensionRegistry;
|
|
82
|
+
listing: ExtensionListing;
|
|
83
|
+
} | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Install a listing into a host (EC-137): locate it in an accessible registry (honoring
|
|
86
|
+
* public/private access), then run `host.install`. A missing listing, or one only present in a
|
|
87
|
+
* registry the client cannot access, is `blocked` — never a throw.
|
|
88
|
+
*/
|
|
89
|
+
install(host: PluginHost, listingId: string): MarketplaceInstallResult;
|
|
90
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { PluginHost } from './plugin';
|
|
2
|
+
/** Derive the listing kind from a plugin's populated surfaces (a multi-surface plugin → 'plugin'). */
|
|
3
|
+
export function inferExtensionKind(plugin) {
|
|
4
|
+
const surfaces = [];
|
|
5
|
+
if (plugin.components)
|
|
6
|
+
surfaces.push('component-package');
|
|
7
|
+
if (plugin.fieldTypes?.length)
|
|
8
|
+
surfaces.push('field-type');
|
|
9
|
+
if (plugin.dataSources?.length)
|
|
10
|
+
surfaces.push('data-source');
|
|
11
|
+
if (plugin.assetStorage?.length)
|
|
12
|
+
surfaces.push('asset-storage');
|
|
13
|
+
if (plugin.exportTargets?.length)
|
|
14
|
+
surfaces.push('export-target');
|
|
15
|
+
if (plugin.templates?.length)
|
|
16
|
+
surfaces.push('template');
|
|
17
|
+
return surfaces.length === 1 ? surfaces[0] : 'plugin';
|
|
18
|
+
}
|
|
19
|
+
/** A named catalogue of installable extensions (public or private). */
|
|
20
|
+
export class ExtensionRegistry {
|
|
21
|
+
id;
|
|
22
|
+
label;
|
|
23
|
+
mode;
|
|
24
|
+
accessTokens;
|
|
25
|
+
listings = new Map();
|
|
26
|
+
constructor(config, listings = []) {
|
|
27
|
+
this.id = config.id;
|
|
28
|
+
this.label = config.label;
|
|
29
|
+
this.mode = config.mode;
|
|
30
|
+
this.accessTokens = new Set(config.accessTokens ?? []);
|
|
31
|
+
for (const listing of listings)
|
|
32
|
+
this.publish(listing);
|
|
33
|
+
}
|
|
34
|
+
/** Publish (or replace) a listing. */
|
|
35
|
+
publish(listing) {
|
|
36
|
+
this.listings.set(listing.id, listing);
|
|
37
|
+
}
|
|
38
|
+
/** Whether a caller with `token` may read/install from this registry. */
|
|
39
|
+
canAccess(token) {
|
|
40
|
+
if (this.mode === 'public')
|
|
41
|
+
return true;
|
|
42
|
+
return token !== undefined && this.accessTokens.has(token);
|
|
43
|
+
}
|
|
44
|
+
get(id) {
|
|
45
|
+
return this.listings.get(id);
|
|
46
|
+
}
|
|
47
|
+
has(id) {
|
|
48
|
+
return this.listings.has(id);
|
|
49
|
+
}
|
|
50
|
+
list(filter = {}) {
|
|
51
|
+
const q = filter.query?.toLowerCase();
|
|
52
|
+
return [...this.listings.values()]
|
|
53
|
+
.filter((l) => {
|
|
54
|
+
if (filter.kind && l.kind !== filter.kind)
|
|
55
|
+
return false;
|
|
56
|
+
if (q) {
|
|
57
|
+
const hay = `${l.name} ${l.description ?? ''} ${(l.tags ?? []).join(' ')} ${l.author ?? ''}`.toLowerCase();
|
|
58
|
+
if (!hay.includes(q))
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
return true;
|
|
62
|
+
})
|
|
63
|
+
.sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0));
|
|
64
|
+
}
|
|
65
|
+
get size() {
|
|
66
|
+
return this.listings.size;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/** A federated marketplace client over several registries, with per-registry credentials (EC-137). */
|
|
70
|
+
export class MarketplaceClient {
|
|
71
|
+
registries;
|
|
72
|
+
credentials;
|
|
73
|
+
constructor(registries, credentials = {}) {
|
|
74
|
+
this.registries = registries;
|
|
75
|
+
this.credentials = credentials;
|
|
76
|
+
}
|
|
77
|
+
/** The registries this client can access with its current credentials. */
|
|
78
|
+
accessibleRegistries() {
|
|
79
|
+
return this.registries.filter((r) => r.canAccess(this.credentials[r.id]));
|
|
80
|
+
}
|
|
81
|
+
/** Search across accessible registries (private ones the client lacks tokens for are excluded). */
|
|
82
|
+
search(filter = {}) {
|
|
83
|
+
return this.accessibleRegistries().flatMap((r) => r.list(filter).map((listing) => ({ registryId: r.id, listing })));
|
|
84
|
+
}
|
|
85
|
+
/** Resolve a listing by id across accessible registries (first match wins). */
|
|
86
|
+
find(listingId) {
|
|
87
|
+
for (const registry of this.accessibleRegistries()) {
|
|
88
|
+
const listing = registry.get(listingId);
|
|
89
|
+
if (listing)
|
|
90
|
+
return { registry, listing };
|
|
91
|
+
}
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Install a listing into a host (EC-137): locate it in an accessible registry (honoring
|
|
96
|
+
* public/private access), then run `host.install`. A missing listing, or one only present in a
|
|
97
|
+
* registry the client cannot access, is `blocked` — never a throw.
|
|
98
|
+
*/
|
|
99
|
+
install(host, listingId) {
|
|
100
|
+
const found = this.find(listingId);
|
|
101
|
+
if (!found) {
|
|
102
|
+
// Distinguish "exists but no access" from "does not exist anywhere".
|
|
103
|
+
const existsPrivately = this.registries.some((r) => r.has(listingId));
|
|
104
|
+
return { ok: false, listingId, blocked: existsPrivately ? 'access-denied' : 'not-found', issues: [] };
|
|
105
|
+
}
|
|
106
|
+
const result = host.install(found.listing.plugin);
|
|
107
|
+
return { ok: result.ok, listingId, registryId: found.registry.id, issues: result.issues };
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=marketplace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketplace.js","sourceRoot":"","sources":["../../src/plugins/marketplace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AA0CrC,sGAAsG;AACtG,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,MAAM,QAAQ,GAAoB,EAAE,CAAA;IACpC,IAAI,MAAM,CAAC,UAAU;QAAE,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAA;IACzD,IAAI,MAAM,CAAC,UAAU,EAAE,MAAM;QAAE,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;IAC1D,IAAI,MAAM,CAAC,WAAW,EAAE,MAAM;QAAE,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,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,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QAClC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,qEAAqE;YACrE,MAAM,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAA;YACrE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,CAAA;QACvG,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QACjD,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAA;IAC3F,CAAC;CACF"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { ComponentRegistry } from '@elytracms/core/component-registry';
|
|
2
|
+
import { HookBus } from './hooks';
|
|
3
|
+
import type { HookHandler } from './hooks';
|
|
4
|
+
import { FieldTypeRegistry } from './field-types';
|
|
5
|
+
import type { FieldTypePlugin } from './field-types';
|
|
6
|
+
import { DataSourceAdapterRegistry } from './data-sources';
|
|
7
|
+
import type { DataSourceAdapter } from './data-sources';
|
|
8
|
+
import { AssetStorageRegistry } from './asset-storage';
|
|
9
|
+
import type { AssetStorageAdapter } from './asset-storage';
|
|
10
|
+
import { ExportTargetRegistry } from './export-targets';
|
|
11
|
+
import type { ExportTargetAdapter } from './export-targets';
|
|
12
|
+
import { TemplateRegistry } from './templates';
|
|
13
|
+
import type { ProjectTemplate } from './templates';
|
|
14
|
+
import type { ComponentPackage } from './component-package';
|
|
15
|
+
/**
|
|
16
|
+
* The plugin model + host (Phase 11). A {@link Plugin} bundles any subset of the extensibility
|
|
17
|
+
* surfaces — a component package, field types, data-source/asset/export adapters, project
|
|
18
|
+
* templates, and lifecycle hooks. The {@link PluginHost} composes one of every registry plus a
|
|
19
|
+
* shared {@link HookBus}, and `install` wires a plugin's parts in, collecting structured issues
|
|
20
|
+
* and firing the `plugin:installed` hook. This is the single coherent entry point the studio,
|
|
21
|
+
* marketplace, and export pipeline extend through.
|
|
22
|
+
*/
|
|
23
|
+
/** A lifecycle hook a plugin registers. */
|
|
24
|
+
export interface PluginHookRegistration {
|
|
25
|
+
point: string;
|
|
26
|
+
handler: HookHandler<unknown>;
|
|
27
|
+
order?: number;
|
|
28
|
+
id?: string;
|
|
29
|
+
}
|
|
30
|
+
/** A composable extension bundle (Phase 11). Every field is optional — a plugin can carry just one. */
|
|
31
|
+
export interface Plugin {
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
version: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
author?: string;
|
|
37
|
+
/** Distributable component package (EC-130). */
|
|
38
|
+
components?: ComponentPackage;
|
|
39
|
+
/** Field-type plugins (EC-131). */
|
|
40
|
+
fieldTypes?: FieldTypePlugin[];
|
|
41
|
+
/** Data-source adapters (EC-132). */
|
|
42
|
+
dataSources?: DataSourceAdapter[];
|
|
43
|
+
/** Asset-storage adapters (EC-133). */
|
|
44
|
+
assetStorage?: AssetStorageAdapter[];
|
|
45
|
+
/** Export-target adapters (EC-134). */
|
|
46
|
+
exportTargets?: ExportTargetAdapter[];
|
|
47
|
+
/** Project templates (EC-136). */
|
|
48
|
+
templates?: ProjectTemplate[];
|
|
49
|
+
/** Lifecycle hooks (EC-135). */
|
|
50
|
+
hooks?: PluginHookRegistration[];
|
|
51
|
+
}
|
|
52
|
+
/** A structured issue produced while installing a plugin. */
|
|
53
|
+
export interface PluginIssue {
|
|
54
|
+
pluginId: string;
|
|
55
|
+
surface: 'components' | 'field-types' | 'data-sources' | 'asset-storage' | 'export-targets' | 'templates';
|
|
56
|
+
severity: 'error' | 'warning';
|
|
57
|
+
message: string;
|
|
58
|
+
ref?: string;
|
|
59
|
+
}
|
|
60
|
+
/** The result of installing a plugin. */
|
|
61
|
+
export interface InstallResult {
|
|
62
|
+
ok: boolean;
|
|
63
|
+
issues: PluginIssue[];
|
|
64
|
+
}
|
|
65
|
+
/** A summary of an installed plugin and what it contributed (for inspection / the Extensions UI). */
|
|
66
|
+
export interface InstalledPlugin {
|
|
67
|
+
id: string;
|
|
68
|
+
name: string;
|
|
69
|
+
version: string;
|
|
70
|
+
description?: string;
|
|
71
|
+
author?: string;
|
|
72
|
+
contributes: {
|
|
73
|
+
components: number;
|
|
74
|
+
fieldTypes: number;
|
|
75
|
+
dataSources: number;
|
|
76
|
+
assetStorage: number;
|
|
77
|
+
exportTargets: number;
|
|
78
|
+
templates: number;
|
|
79
|
+
hooks: number;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
export interface PluginHostOptions {
|
|
83
|
+
/** Reuse an existing component registry (e.g. the studio's) instead of a fresh one. */
|
|
84
|
+
components?: ComponentRegistry;
|
|
85
|
+
}
|
|
86
|
+
/** The extensibility host: one registry per surface plus a shared hook bus (Phase 11). */
|
|
87
|
+
export declare class PluginHost {
|
|
88
|
+
readonly components: ComponentRegistry;
|
|
89
|
+
readonly fieldTypes: FieldTypeRegistry;
|
|
90
|
+
readonly dataSources: DataSourceAdapterRegistry;
|
|
91
|
+
readonly assetStorage: AssetStorageRegistry;
|
|
92
|
+
readonly exportTargets: ExportTargetRegistry;
|
|
93
|
+
readonly templates: TemplateRegistry;
|
|
94
|
+
readonly hooks: HookBus;
|
|
95
|
+
private readonly installed;
|
|
96
|
+
constructor(options?: PluginHostOptions);
|
|
97
|
+
/**
|
|
98
|
+
* Install a plugin: validate + register each surface, collecting structured issues. A surface
|
|
99
|
+
* with errors is skipped (the rest still install). When no errors occur the plugin is recorded
|
|
100
|
+
* and the `plugin:installed` hook fires. Never throws.
|
|
101
|
+
*/
|
|
102
|
+
install(plugin: Plugin): InstallResult;
|
|
103
|
+
/** True when a plugin id is installed. */
|
|
104
|
+
isInstalled(id: string): boolean;
|
|
105
|
+
/** Summaries of every installed plugin (in install order). */
|
|
106
|
+
list(): InstalledPlugin[];
|
|
107
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { ComponentRegistry } from '@elytracms/core/component-registry';
|
|
2
|
+
import { HookBus } from './hooks';
|
|
3
|
+
import { FieldTypeRegistry } from './field-types';
|
|
4
|
+
import { DataSourceAdapterRegistry } from './data-sources';
|
|
5
|
+
import { AssetStorageRegistry } from './asset-storage';
|
|
6
|
+
import { ExportTargetRegistry } from './export-targets';
|
|
7
|
+
import { TemplateRegistry } from './templates';
|
|
8
|
+
import { registerComponentPackage } from './component-package';
|
|
9
|
+
/** The extensibility host: one registry per surface plus a shared hook bus (Phase 11). */
|
|
10
|
+
export class PluginHost {
|
|
11
|
+
components;
|
|
12
|
+
fieldTypes = new FieldTypeRegistry();
|
|
13
|
+
dataSources = new DataSourceAdapterRegistry();
|
|
14
|
+
assetStorage = new AssetStorageRegistry();
|
|
15
|
+
exportTargets = new ExportTargetRegistry();
|
|
16
|
+
templates = new TemplateRegistry();
|
|
17
|
+
hooks = new HookBus();
|
|
18
|
+
installed = [];
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this.components = options.components ?? new ComponentRegistry();
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Install a plugin: validate + register each surface, collecting structured issues. A surface
|
|
24
|
+
* with errors is skipped (the rest still install). When no errors occur the plugin is recorded
|
|
25
|
+
* and the `plugin:installed` hook fires. Never throws.
|
|
26
|
+
*/
|
|
27
|
+
install(plugin) {
|
|
28
|
+
const issues = [];
|
|
29
|
+
const contributes = {
|
|
30
|
+
components: 0,
|
|
31
|
+
fieldTypes: 0,
|
|
32
|
+
dataSources: 0,
|
|
33
|
+
assetStorage: 0,
|
|
34
|
+
exportTargets: 0,
|
|
35
|
+
templates: 0,
|
|
36
|
+
hooks: 0,
|
|
37
|
+
};
|
|
38
|
+
if (plugin.components) {
|
|
39
|
+
const pkgIssues = registerComponentPackage(this.components, plugin.components);
|
|
40
|
+
for (const i of pkgIssues) {
|
|
41
|
+
issues.push({ pluginId: plugin.id, surface: 'components', severity: i.severity, message: i.message, ...(i.ref ? { ref: i.ref } : {}) });
|
|
42
|
+
}
|
|
43
|
+
if (!pkgIssues.some((i) => i.severity === 'error'))
|
|
44
|
+
contributes.components = plugin.components.manifests.length;
|
|
45
|
+
}
|
|
46
|
+
// Registries accumulate their `issues` for the host's lifetime. Snapshot each one's length
|
|
47
|
+
// before this install's registrations and forward ONLY the newly-appended slice, so issues
|
|
48
|
+
// from earlier installs are never re-emitted or mis-attributed to this plugin.
|
|
49
|
+
const ftStart = this.fieldTypes.issues.length;
|
|
50
|
+
for (const ft of plugin.fieldTypes ?? []) {
|
|
51
|
+
const before = this.fieldTypes.size;
|
|
52
|
+
this.fieldTypes.register(ft);
|
|
53
|
+
if (this.fieldTypes.size > before)
|
|
54
|
+
contributes.fieldTypes++;
|
|
55
|
+
}
|
|
56
|
+
pushRegistryIssues(issues, plugin.id, 'field-types', this.fieldTypes.issues.slice(ftStart));
|
|
57
|
+
const dsStart = this.dataSources.issues.length;
|
|
58
|
+
for (const ds of plugin.dataSources ?? []) {
|
|
59
|
+
const before = this.dataSources.size;
|
|
60
|
+
this.dataSources.register(ds);
|
|
61
|
+
if (this.dataSources.size > before)
|
|
62
|
+
contributes.dataSources++;
|
|
63
|
+
}
|
|
64
|
+
pushRegistryIssues(issues, plugin.id, 'data-sources', this.dataSources.issues.slice(dsStart));
|
|
65
|
+
const storageStart = this.assetStorage.issues.length;
|
|
66
|
+
for (const storage of plugin.assetStorage ?? []) {
|
|
67
|
+
const before = this.assetStorage.size;
|
|
68
|
+
this.assetStorage.register(storage);
|
|
69
|
+
if (this.assetStorage.size > before)
|
|
70
|
+
contributes.assetStorage++;
|
|
71
|
+
}
|
|
72
|
+
pushRegistryIssues(issues, plugin.id, 'asset-storage', this.assetStorage.issues.slice(storageStart));
|
|
73
|
+
const targetStart = this.exportTargets.issues.length;
|
|
74
|
+
for (const target of plugin.exportTargets ?? []) {
|
|
75
|
+
const before = this.exportTargets.size;
|
|
76
|
+
this.exportTargets.register(target);
|
|
77
|
+
if (this.exportTargets.size > before)
|
|
78
|
+
contributes.exportTargets++;
|
|
79
|
+
}
|
|
80
|
+
pushRegistryIssues(issues, plugin.id, 'export-targets', this.exportTargets.issues.slice(targetStart));
|
|
81
|
+
const templateStart = this.templates.issues.length;
|
|
82
|
+
for (const template of plugin.templates ?? []) {
|
|
83
|
+
const before = this.templates.size;
|
|
84
|
+
this.templates.register(template);
|
|
85
|
+
if (this.templates.size > before)
|
|
86
|
+
contributes.templates++;
|
|
87
|
+
}
|
|
88
|
+
pushRegistryIssues(issues, plugin.id, 'templates', this.templates.issues.slice(templateStart));
|
|
89
|
+
for (const hook of plugin.hooks ?? []) {
|
|
90
|
+
this.hooks.on(hook.point, hook.handler, { plugin: plugin.id, ...(hook.order !== undefined ? { order: hook.order } : {}), ...(hook.id !== undefined ? { id: hook.id } : {}) });
|
|
91
|
+
contributes.hooks++;
|
|
92
|
+
}
|
|
93
|
+
const ok = !issues.some((i) => i.severity === 'error');
|
|
94
|
+
if (ok) {
|
|
95
|
+
this.installed.push({
|
|
96
|
+
id: plugin.id,
|
|
97
|
+
name: plugin.name,
|
|
98
|
+
version: plugin.version,
|
|
99
|
+
...(plugin.description !== undefined ? { description: plugin.description } : {}),
|
|
100
|
+
...(plugin.author !== undefined ? { author: plugin.author } : {}),
|
|
101
|
+
contributes,
|
|
102
|
+
});
|
|
103
|
+
this.hooks.run('plugin:installed', plugin);
|
|
104
|
+
}
|
|
105
|
+
return { ok, issues };
|
|
106
|
+
}
|
|
107
|
+
/** True when a plugin id is installed. */
|
|
108
|
+
isInstalled(id) {
|
|
109
|
+
return this.installed.some((p) => p.id === id);
|
|
110
|
+
}
|
|
111
|
+
/** Summaries of every installed plugin (in install order). */
|
|
112
|
+
list() {
|
|
113
|
+
return [...this.installed];
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/** Append this install's newly-appended registry issues (the caller passes only the new slice). */
|
|
117
|
+
function pushRegistryIssues(issues, pluginId, surface, newIssues) {
|
|
118
|
+
for (const i of newIssues) {
|
|
119
|
+
issues.push({ pluginId, surface, severity: 'error', message: i.message, ...(i.ref ? { ref: i.ref } : {}) });
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAA;AAE1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAEtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAiF9D,0FAA0F;AAC1F,MAAM,OAAO,UAAU;IACZ,UAAU,CAAmB;IAC7B,UAAU,GAAG,IAAI,iBAAiB,EAAE,CAAA;IACpC,WAAW,GAAG,IAAI,yBAAyB,EAAE,CAAA;IAC7C,YAAY,GAAG,IAAI,oBAAoB,EAAE,CAAA;IACzC,aAAa,GAAG,IAAI,oBAAoB,EAAE,CAAA;IAC1C,SAAS,GAAG,IAAI,gBAAgB,EAAE,CAAA;IAClC,KAAK,GAAG,IAAI,OAAO,EAAE,CAAA;IACb,SAAS,GAAsB,EAAE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