@kardalum/plugin-sdk 0.0.0-stage → 0.15.0
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/CHANGELOG.md +108 -0
- package/LICENSE +202 -0
- package/README.md +70 -2
- package/dist/admin-section-registry.d.ts +34 -0
- package/dist/admin-section-registry.js +49 -0
- package/dist/built-in-serializers.d.ts +3 -0
- package/dist/built-in-serializers.js +18 -0
- package/dist/built-in-settings-schemas.d.ts +14 -0
- package/dist/built-in-settings-schemas.js +225 -0
- package/dist/built-in-value-schemas.d.ts +4 -0
- package/dist/built-in-value-schemas.js +47 -0
- package/dist/built-ins.d.ts +1 -0
- package/dist/built-ins.js +257 -0
- package/dist/capabilities.d.ts +99 -0
- package/dist/capabilities.js +363 -0
- package/dist/data-type-plugin.d.ts +28 -0
- package/dist/data-type-plugin.js +1 -0
- package/dist/datatype-validation.d.ts +26 -0
- package/dist/datatype-validation.js +110 -0
- package/dist/datatypes-entry.d.ts +4 -0
- package/dist/datatypes-entry.js +18 -0
- package/dist/define-plugin.d.ts +25 -0
- package/dist/define-plugin.js +51 -0
- package/dist/entitlement-entry.d.ts +5 -0
- package/dist/entitlement-entry.js +24 -0
- package/dist/entitlement-gate.d.ts +36 -0
- package/dist/entitlement-gate.js +201 -0
- package/dist/entitlement-types.d.ts +39 -0
- package/dist/entitlement-types.js +1 -0
- package/dist/entitlement.d.ts +57 -0
- package/dist/entitlement.js +170 -0
- package/dist/host-entry.d.ts +1 -0
- package/dist/host-entry.js +11 -0
- package/dist/icon-name.d.ts +1 -0
- package/dist/icon-name.js +1 -0
- package/dist/icons.d.ts +2 -0
- package/dist/icons.js +10 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +93 -0
- package/dist/license-verdict-keys.d.ts +18 -0
- package/dist/license-verdict-keys.js +22 -0
- package/dist/local-host.d.ts +3 -0
- package/dist/local-host.js +38 -0
- package/dist/manifest-entry.d.ts +8 -0
- package/dist/manifest-entry.js +13 -0
- package/dist/manifest-schema.d.ts +408 -0
- package/dist/manifest-schema.js +774 -0
- package/dist/manifest.d.ts +546 -0
- package/dist/manifest.js +86 -0
- package/dist/media/media-picker.d.ts +39 -0
- package/dist/media/media-picker.js +438 -0
- package/dist/media/upload-error.d.ts +12 -0
- package/dist/media/upload-error.js +30 -0
- package/dist/plugin-context.d.ts +75 -0
- package/dist/plugin-context.js +70 -0
- package/dist/plugin-screen-context.d.ts +40 -0
- package/dist/plugin-screen-context.js +16 -0
- package/dist/register-built-ins.d.ts +1 -0
- package/dist/register-built-ins.js +41 -0
- package/dist/registry.d.ts +4 -0
- package/dist/registry.js +17 -0
- package/dist/rendition-eligibility.d.ts +24 -0
- package/dist/rendition-eligibility.js +40 -0
- package/dist/richtext/block-panel.d.ts +27 -0
- package/dist/richtext/block-panel.js +232 -0
- package/dist/richtext/extensions.d.ts +19 -0
- package/dist/richtext/extensions.js +56 -0
- package/dist/richtext/insert-menu.d.ts +24 -0
- package/dist/richtext/insert-menu.js +142 -0
- package/dist/richtext/kardalum-block.d.ts +33 -0
- package/dist/richtext/kardalum-block.js +282 -0
- package/dist/richtext/style-listbox.d.ts +10 -0
- package/dist/richtext/style-listbox.js +69 -0
- package/dist/richtext/text-style-class.d.ts +18 -0
- package/dist/richtext/text-style-class.js +36 -0
- package/dist/simple-storage-value-provider.d.ts +9 -0
- package/dist/simple-storage-value-provider.js +96 -0
- package/dist/structured-storage-types.d.ts +61 -0
- package/dist/structured-storage-types.js +11 -0
- package/dist/tailwind.d.ts +1 -0
- package/dist/tailwind.js +5 -0
- package/dist/tokens/system-dark.css +75 -0
- package/dist/tokens/tokens.css +239 -0
- package/dist/tokens/tokens.json +212 -0
- package/dist/tokens.d.ts +1 -0
- package/dist/tokens.js +11 -0
- package/dist/ui-entry.d.ts +5 -0
- package/dist/ui-entry.js +42 -0
- package/dist/views/content-list-preview.d.ts +1 -0
- package/dist/views/content-list-preview.js +14 -0
- package/dist/views/content-list-settings-view.d.ts +1 -0
- package/dist/views/content-list-settings-view.js +97 -0
- package/dist/views/content-list-view.d.ts +19 -0
- package/dist/views/content-list-view.js +248 -0
- package/dist/views/crop-view.d.ts +55 -0
- package/dist/views/crop-view.js +161 -0
- package/dist/views/date-range-view.d.ts +6 -0
- package/dist/views/date-range-view.js +55 -0
- package/dist/views/file-upload-view.d.ts +43 -0
- package/dist/views/file-upload-view.js +104 -0
- package/dist/views/html-code-editor.d.ts +10 -0
- package/dist/views/html-code-editor.js +101 -0
- package/dist/views/html-view.d.ts +3 -0
- package/dist/views/html-view.js +53 -0
- package/dist/views/image-view.d.ts +3 -0
- package/dist/views/image-view.js +387 -0
- package/dist/views/rich-text-view.d.ts +2 -0
- package/dist/views/rich-text-view.js +429 -0
- package/node_modules/@kardalum/api-schemas/LICENSE +202 -0
- package/node_modules/@kardalum/api-schemas/README.md +56 -0
- package/node_modules/@kardalum/api-schemas/dist/action.schema.d.ts +30 -0
- package/node_modules/@kardalum/api-schemas/dist/action.schema.js +88 -0
- package/node_modules/@kardalum/api-schemas/dist/api-error.schema.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +6 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +75 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +36 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.d.ts +89 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +60 -0
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +24 -0
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +47 -0
- package/node_modules/@kardalum/api-schemas/dist/auth.schema.d.ts +38 -0
- package/node_modules/@kardalum/api-schemas/dist/auth.schema.js +38 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +537 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +353 -0
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +158 -0
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +139 -0
- package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +125 -0
- package/node_modules/@kardalum/api-schemas/dist/content-path.js +256 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.d.ts +20 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +23 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.d.ts +151 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +82 -0
- package/node_modules/@kardalum/api-schemas/dist/content-version.schema.d.ts +18 -0
- package/node_modules/@kardalum/api-schemas/dist/content-version.schema.js +22 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +17 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.js +20 -0
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +302 -0
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +97 -0
- package/node_modules/@kardalum/api-schemas/dist/culture-direction.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/culture-direction.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +36 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +32 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +32 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +296 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +138 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +121 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +147 -0
- package/node_modules/@kardalum/api-schemas/dist/health.schema.d.ts +6 -0
- package/node_modules/@kardalum/api-schemas/dist/health.schema.js +5 -0
- package/node_modules/@kardalum/api-schemas/dist/html-entities.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/html-entities.js +250 -0
- package/node_modules/@kardalum/api-schemas/dist/index.d.ts +102 -0
- package/node_modules/@kardalum/api-schemas/dist/index.js +58 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +15 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +381 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +197 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +167 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +214 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +77 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.js +53 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-use.d.ts +75 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-use.js +117 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +27 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference.js +279 -0
- package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.d.ts +74 -0
- package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.js +157 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +80 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.js +156 -0
- package/node_modules/@kardalum/api-schemas/dist/nav.schema.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/nav.schema.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +846 -0
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +356 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +20 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +169 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +80 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.d.ts +65 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.js +889 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +89 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +134 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +31 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +38 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +369 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +393 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +22 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +87 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.d.ts +31 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +25 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +15 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +24 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +306 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +328 -0
- package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +79 -0
- package/node_modules/@kardalum/api-schemas/dist/render-editing.js +50 -0
- package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/reserved-slugs.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/reserved-slugs.js +16 -0
- package/node_modules/@kardalum/api-schemas/dist/role.schema.d.ts +90 -0
- package/node_modules/@kardalum/api-schemas/dist/role.schema.js +69 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content-outcome.schema.d.ts +17 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content-outcome.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +108 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +93 -0
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +243 -0
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +296 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +43 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.js +25 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +30 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.js +19 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +112 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +74 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +39 -0
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.d.ts +21 -0
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +89 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +68 -0
- package/node_modules/@kardalum/api-schemas/package.json +35 -0
- package/node_modules/@kardalum/design-tokens/LICENSE +202 -0
- package/node_modules/@kardalum/design-tokens/README.md +29 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.d.ts +32 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.js +88 -0
- package/node_modules/@kardalum/design-tokens/dist/generate.d.ts +1 -0
- package/node_modules/@kardalum/design-tokens/dist/generate.js +18 -0
- package/node_modules/@kardalum/design-tokens/dist/index.d.ts +6 -0
- package/node_modules/@kardalum/design-tokens/dist/index.js +4 -0
- package/node_modules/@kardalum/design-tokens/dist/system-dark.css +75 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +33 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +54 -0
- package/node_modules/@kardalum/design-tokens/dist/theme-css.d.ts +12 -0
- package/node_modules/@kardalum/design-tokens/dist/theme-css.js +42 -0
- package/node_modules/@kardalum/design-tokens/dist/theme-types.d.ts +43 -0
- package/node_modules/@kardalum/design-tokens/dist/theme-types.js +1 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.d.ts +13 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.js +120 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/index.d.ts +5 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/index.js +4 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/light.d.ts +9 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/light.js +13 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +239 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +25 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +276 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +212 -0
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +91 -0
- package/node_modules/@kardalum/design-tokens/dist/types.js +5 -0
- package/node_modules/@kardalum/design-tokens/package.json +42 -0
- package/node_modules/@kardalum/plugin-package/LICENSE +202 -0
- package/node_modules/@kardalum/plugin-package/README.md +71 -0
- package/node_modules/@kardalum/plugin-package/dist/docs-contract.d.ts +50 -0
- package/node_modules/@kardalum/plugin-package/dist/docs-contract.js +659 -0
- package/node_modules/@kardalum/plugin-package/dist/envelope.d.ts +19 -0
- package/node_modules/@kardalum/plugin-package/dist/envelope.js +104 -0
- package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +37 -0
- package/node_modules/@kardalum/plugin-package/dist/extract.js +199 -0
- package/node_modules/@kardalum/plugin-package/dist/hash.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/hash.js +69 -0
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +11 -0
- package/node_modules/@kardalum/plugin-package/dist/index.js +7 -0
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +185 -0
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +236 -0
- package/node_modules/@kardalum/plugin-package/dist/package-contract.d.ts +50 -0
- package/node_modules/@kardalum/plugin-package/dist/package-contract.js +115 -0
- package/node_modules/@kardalum/plugin-package/dist/sample-content.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/sample-content.js +17 -0
- package/node_modules/@kardalum/plugin-package/dist/types.d.ts +45 -0
- package/node_modules/@kardalum/plugin-package/dist/types.js +1 -0
- package/node_modules/@kardalum/plugin-package/package.json +49 -0
- package/node_modules/@kardalum/ui/LICENSE +202 -0
- package/node_modules/@kardalum/ui/README.md +35 -0
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.d.ts +14 -0
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.js +38 -0
- package/node_modules/@kardalum/ui/dist/components/badge.d.ts +9 -0
- package/node_modules/@kardalum/ui/dist/components/badge.js +30 -0
- package/node_modules/@kardalum/ui/dist/components/button.d.ts +11 -0
- package/node_modules/@kardalum/ui/dist/components/button.js +37 -0
- package/node_modules/@kardalum/ui/dist/components/checkbox.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/components/checkbox.js +7 -0
- package/node_modules/@kardalum/ui/dist/components/dialog.d.ts +17 -0
- package/node_modules/@kardalum/ui/dist/components/dialog.js +48 -0
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.d.ts +18 -0
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +53 -0
- package/node_modules/@kardalum/ui/dist/components/empty-state.d.ts +30 -0
- package/node_modules/@kardalum/ui/dist/components/empty-state.js +9 -0
- package/node_modules/@kardalum/ui/dist/components/input.d.ts +4 -0
- package/node_modules/@kardalum/ui/dist/components/input.js +6 -0
- package/node_modules/@kardalum/ui/dist/components/panel.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/components/panel.js +6 -0
- package/node_modules/@kardalum/ui/dist/components/property-field.d.ts +19 -0
- package/node_modules/@kardalum/ui/dist/components/property-field.js +86 -0
- package/node_modules/@kardalum/ui/dist/components/sheet.d.ts +17 -0
- package/node_modules/@kardalum/ui/dist/components/sheet.js +55 -0
- package/node_modules/@kardalum/ui/dist/components/skeleton.d.ts +3 -0
- package/node_modules/@kardalum/ui/dist/components/skeleton.js +9 -0
- package/node_modules/@kardalum/ui/dist/components/switch.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/components/switch.js +7 -0
- package/node_modules/@kardalum/ui/dist/components/tab-strip.d.ts +34 -0
- package/node_modules/@kardalum/ui/dist/components/tab-strip.js +72 -0
- package/node_modules/@kardalum/ui/dist/components/toast.d.ts +18 -0
- package/node_modules/@kardalum/ui/dist/components/toast.js +42 -0
- package/node_modules/@kardalum/ui/dist/components/toaster.d.ts +12 -0
- package/node_modules/@kardalum/ui/dist/components/toaster.js +11 -0
- package/node_modules/@kardalum/ui/dist/components/use-toast.d.ts +17 -0
- package/node_modules/@kardalum/ui/dist/components/use-toast.js +62 -0
- package/node_modules/@kardalum/ui/dist/index.d.ts +18 -0
- package/node_modules/@kardalum/ui/dist/index.js +18 -0
- package/node_modules/@kardalum/ui/dist/lib/cn.d.ts +2 -0
- package/node_modules/@kardalum/ui/dist/lib/cn.js +5 -0
- package/node_modules/@kardalum/ui/package.json +63 -0
- package/package.json +146 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Notable changes to the public surface of `@kardalum/plugin-sdk`. Newest
|
|
4
|
+
first. Kardalum is pre-1.0, so a breaking change lands without a deprecation
|
|
5
|
+
window, but it is written down here so a release can carry it forward.
|
|
6
|
+
|
|
7
|
+
Subpaths are noted per entry. `.` is the package index; `./manifest` is the
|
|
8
|
+
server-safe manifest contract subpath, which pulls in no React and no
|
|
9
|
+
`@kardalum/ui`.
|
|
10
|
+
|
|
11
|
+
## Unreleased (after 0.14.0, the last release under the former scope)
|
|
12
|
+
|
|
13
|
+
The plugin manifest is no longer a discriminated union on `type`. One
|
|
14
|
+
`PluginManifest` carries a single ungated `contributions` object, and
|
|
15
|
+
`type` keeps only its marketplace listing meaning. Capabilities are
|
|
16
|
+
**derived** from what a manifest declares rather than declared beside it.
|
|
17
|
+
|
|
18
|
+
### Removed
|
|
19
|
+
|
|
20
|
+
- `CLIENT_BUNDLE_TYPES` (`./manifest`). The question it answered, does this
|
|
21
|
+
plugin ship a federated client bundle, now comes from the declarations.
|
|
22
|
+
Use `declaresClientBundle(contributions)`.
|
|
23
|
+
- The seven per-type manifest types (`.` and `./manifest`):
|
|
24
|
+
`DataTypePluginManifest`, `SectionPluginManifest`,
|
|
25
|
+
`TemplatePluginManifest`, `ThemePluginManifest`,
|
|
26
|
+
`IntegrationPluginManifest`, `UtilityPluginManifest`,
|
|
27
|
+
`BundlePluginManifest`. Use `PluginManifest`, which is now the one shape.
|
|
28
|
+
- Their seven `*PluginContributions` counterparts, likewise. Use
|
|
29
|
+
`PluginContributions`.
|
|
30
|
+
- `CMSPlugin`, the union of those seven (`.` and `./manifest`). Use
|
|
31
|
+
`PluginManifest`. No alias was left behind, on purpose: an alias would
|
|
32
|
+
let a caller keep narrowing on a variant that no longer constrains
|
|
33
|
+
anything. The runtime schema `CMSPluginSchema` is unaffected and keeps
|
|
34
|
+
its name.
|
|
35
|
+
- `PluginPermissions` (`.` and `./manifest`), replaced by
|
|
36
|
+
`PluginAssertions` (see Added). `needsStructuredData` is gone with it:
|
|
37
|
+
the declaration that a plugin owns real relational tables is
|
|
38
|
+
`databaseCompatibility.storageType === "structured"`, which is where the
|
|
39
|
+
server has always read it from.
|
|
40
|
+
|
|
41
|
+
### Renamed
|
|
42
|
+
|
|
43
|
+
- `hasClientBundle` is now `declaresClientBundle` (`./manifest`), and it
|
|
44
|
+
takes a `PluginContributions` object where the old name took a `type`
|
|
45
|
+
string. **Renamed rather than re-signatured deliberately.** Keeping the
|
|
46
|
+
name would make every stale caller return a silent `false`, a wrong
|
|
47
|
+
answer that looks like a legitimate one. Under the new name a stale
|
|
48
|
+
caller fails at module load, before it can decide anything. That is not
|
|
49
|
+
hypothetical: the rename caught a real stale build in this repository
|
|
50
|
+
that had been skipping a federation build and still reporting "Built".
|
|
51
|
+
- `PluginPermissions` is now `PluginAssertions`, with a `PluginAssertion`
|
|
52
|
+
type for a single entry (`.` and `./manifest`). It is an object keyed by
|
|
53
|
+
assertion name, not an array, so one manifest cannot carry two entries of
|
|
54
|
+
the same kind with contradicting reasons. The two surviving kinds,
|
|
55
|
+
`externalNetwork` and `filesystemAccess`, each now require a non-empty
|
|
56
|
+
`reason`, because a bare boolean cannot be consented to.
|
|
57
|
+
|
|
58
|
+
### Added
|
|
59
|
+
|
|
60
|
+
- Six subpaths that carry what a plugin author used to install as two
|
|
61
|
+
separate packages. The component library and the design tokens are now
|
|
62
|
+
internal packages that ship inside this SDK, so a plugin depends on the
|
|
63
|
+
SDK alone:
|
|
64
|
+
- `./ui`: the whole component library plus the plugin-context hooks and
|
|
65
|
+
providers (it existed before with a curated set; it now carries every
|
|
66
|
+
component). Not for a federated plugin's views, which import from `.`:
|
|
67
|
+
only `.` is a federation share key.
|
|
68
|
+
- `./tokens`: `tokens`, `themes`, `lightTheme`, `darkTheme`,
|
|
69
|
+
`themeOverridesToCss` and their types, including
|
|
70
|
+
`ThemeTokenOverrides`, the shape of a manifest's `themeTokens`.
|
|
71
|
+
- `./tokens.css`, `./tokens/system-dark.css`, `./tokens.json`: the token
|
|
72
|
+
stylesheet, its system dark-mode companion, and the tokens as JSON.
|
|
73
|
+
- `./tailwind`: `tailwindTheme`, the Tailwind preset built from the
|
|
74
|
+
tokens.
|
|
75
|
+
- `./icons`: the Lucide icon components and the `IconName` type.
|
|
76
|
+
|
|
77
|
+
None of them is a federation share key; each is bundled into the plugin
|
|
78
|
+
that imports it.
|
|
79
|
+
- `deriveCapabilities(manifest)` (`.` and `./manifest`), which returns the
|
|
80
|
+
`Capability[]` that the install screen, marketplace review and the
|
|
81
|
+
generated reference page all read. This is the single derivation. Do not
|
|
82
|
+
hand-maintain a second copy of it.
|
|
83
|
+
- `CAPABILITY_IDS`, `CAPABILITY_LABELS` and `capabilityLabel()` (`.` and
|
|
84
|
+
`./manifest`), for rendering a capability to a person.
|
|
85
|
+
- Types `Capability`, `CapabilityPayload`, `CapabilityMediation`,
|
|
86
|
+
`CapabilityAudience`, `CapabilityLabels` (`.` and `./manifest`).
|
|
87
|
+
- `CONTRIBUTION_KEYS` (`./manifest`), the 18 contribution key names.
|
|
88
|
+
- `AssertionsSchema` and `ASSERTION_KINDS` (`./manifest`).
|
|
89
|
+
- `VIEW_BEARING_CONTRIBUTIONS` and the `ViewBearingContribution` type
|
|
90
|
+
(`./manifest`), the six contribution keys that imply a client bundle.
|
|
91
|
+
|
|
92
|
+
### Two additions that will be awkward to change later
|
|
93
|
+
|
|
94
|
+
Recorded here rather than left for whoever has to change them.
|
|
95
|
+
|
|
96
|
+
- `CapabilityAudience` is `"operator" | "shopper"`, which puts marketplace
|
|
97
|
+
jargon into a published SDK type. A plugin author consuming the SDK has
|
|
98
|
+
no shopper.
|
|
99
|
+
- `CAPABILITY_LABELS` ships English copy as public API. Third parties will
|
|
100
|
+
pin against those strings, so rewording a label breaks anyone who matched
|
|
101
|
+
on it, and the SDK has no locale bundles to put a translation in. Tracked
|
|
102
|
+
as a ticket.
|
|
103
|
+
|
|
104
|
+
### Not an API change, but worth knowing
|
|
105
|
+
|
|
106
|
+
A plugin whose contributions are all non-view-bearing now packs with no
|
|
107
|
+
`remoteEntry.js` and needs no `vite.config.ts` at all. Under the old rule
|
|
108
|
+
its `type` demanded a client bundle it had no way to produce.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,71 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @kardalum/plugin-sdk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The SDK for building plugins for [Kardalum](https://kardalum.com), the free
|
|
4
|
+
CMS that never loses your data. One package holds everything a plugin
|
|
5
|
+
imports. The root has `definePlugin`, the manifest types and
|
|
6
|
+
`deriveCapabilities`; the data type registry (`registerDataType`,
|
|
7
|
+
`getDataType`, `listDataTypes`); the hooks a view reads its value, settings
|
|
8
|
+
and API through (`usePluginValue`, `usePluginSettings`, `usePluginApi`);
|
|
9
|
+
`SimpleStorageValueProvider`, which keeps a field's value in simple storage;
|
|
10
|
+
and a curated set of the admin's components. The subpaths below add the
|
|
11
|
+
design tokens, a Tailwind preset and icons, so a plugin's screens match the
|
|
12
|
+
active admin theme without any work.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
Needs Node.js 22.12 or later, and React 19 as a peer. The quickest start is a
|
|
17
|
+
scaffolded plugin, which depends on this package already:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
npm create kardalum-plugin@latest
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
To add it to an existing project:
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
npm install @kardalum/plugin-sdk react react-dom
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { definePlugin } from "@kardalum/plugin-sdk";
|
|
31
|
+
|
|
32
|
+
export default definePlugin({
|
|
33
|
+
id: "com.example.my-field",
|
|
34
|
+
type: "datatype",
|
|
35
|
+
// ...
|
|
36
|
+
});
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Subpaths
|
|
40
|
+
|
|
41
|
+
Only the package root is shared with the admin through Module Federation, so
|
|
42
|
+
a plugin's views always run against the host's one copy. Views import from
|
|
43
|
+
the root; the subpaths below are bundled into whatever imports them.
|
|
44
|
+
|
|
45
|
+
| Subpath | What it holds |
|
|
46
|
+
|---|---|
|
|
47
|
+
| `@kardalum/plugin-sdk/manifest` | The manifest contract (`definePlugin`, `validatePluginManifest`, the types) with no React, safe in Node. |
|
|
48
|
+
| `@kardalum/plugin-sdk/ui` | The whole component library and the plugin-context providers, for code outside the admin such as a test harness. Not for a plugin view: the root re-exports the components a view needs. |
|
|
49
|
+
| `@kardalum/plugin-sdk/tokens` | The design tokens and theme types (`ThemeTokenOverrides`, the shape of a manifest's `themeTokens`). |
|
|
50
|
+
| `@kardalum/plugin-sdk/tokens.css` | Every token as a CSS custom property, light theme by default. |
|
|
51
|
+
| `@kardalum/plugin-sdk/tokens/system-dark.css` | The dark theme's custom properties under `prefers-color-scheme: dark`. |
|
|
52
|
+
| `@kardalum/plugin-sdk/tokens.json` | The same tokens as JSON, for build tools. |
|
|
53
|
+
| `@kardalum/plugin-sdk/tailwind` | `tailwindTheme`, the Tailwind preset generated from the tokens. |
|
|
54
|
+
| `@kardalum/plugin-sdk/icons` | The Lucide icons the admin draws with, and the `IconName` type a manifest's `icon` takes. |
|
|
55
|
+
| `@kardalum/plugin-sdk/entitlement` | A paid plugin's licence check (`requireEntitlement`), for plugin server code only. |
|
|
56
|
+
| `@kardalum/plugin-sdk/datatypes` | The built-in data types' settings schemas and serializers, for server code. |
|
|
57
|
+
| `@kardalum/plugin-sdk/host` | What the admin uses to register plugin slots. Host-only: a plugin never imports it. |
|
|
58
|
+
|
|
59
|
+
Two more entries in `exports`, `./datatype-validation` and
|
|
60
|
+
`./register-built-ins`, are host and server internals a plugin never imports.
|
|
61
|
+
|
|
62
|
+
## Docs
|
|
63
|
+
|
|
64
|
+
The plugin guide, the manifest reference and the storage reference are at
|
|
65
|
+
[docs.kardalum.com](https://docs.kardalum.com/v1/learn/build-a-plugin/).
|
|
66
|
+
|
|
67
|
+
## Support
|
|
68
|
+
|
|
69
|
+
Kardalum's source is not public. Questions and bug reports:
|
|
70
|
+
[kardalum-devkit](https://github.com/kardalum/kardalum-devkit).
|
|
71
|
+
Licensed Apache-2.0.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AdminSectionContribution, BuiltInRailEntryContribution, BuiltInRailSection, PluginManifest } from "./manifest.js";
|
|
2
|
+
/** @internal A section in the host's registry, with the plugin it came from. */
|
|
3
|
+
export interface RegisteredSection {
|
|
4
|
+
pluginId: string;
|
|
5
|
+
section: AdminSectionContribution;
|
|
6
|
+
}
|
|
7
|
+
/** @internal A built-in rail entry in the host's registry, with its plugin. */
|
|
8
|
+
export interface RegisteredRailEntry {
|
|
9
|
+
pluginId: string;
|
|
10
|
+
entry: BuiltInRailEntryContribution;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Register every slot a plugin's manifest declares: its top-level sections
|
|
14
|
+
* (each with its own rail) and its rail entries in built-in sections.
|
|
15
|
+
* Replaces `registerAdminSection`. Throws on a second registration of the
|
|
16
|
+
* same plugin id, slots or not, so a caller that boots a plugin twice finds
|
|
17
|
+
* out rather than doubling its entries in the app bar.
|
|
18
|
+
*
|
|
19
|
+
* @internal Host-only: the admin calls it with a validated manifest.
|
|
20
|
+
*/
|
|
21
|
+
export declare function registerPluginSlots(pluginId: string, manifest: PluginManifest): void;
|
|
22
|
+
/** @internal Host-only lookup of one plugin's section by its id. */
|
|
23
|
+
export declare function getPluginSection(pluginId: string, sectionId: string): RegisteredSection | undefined;
|
|
24
|
+
/** @internal Every registered plugin section, in registration order. A
|
|
25
|
+
* copy: changing it changes nothing registered. */
|
|
26
|
+
export declare function listPluginSections(): RegisteredSection[];
|
|
27
|
+
/** @internal The rail entries plugins add to one built-in section, in
|
|
28
|
+
* registration order. */
|
|
29
|
+
export declare function listRailEntries(section: BuiltInRailSection): RegisteredRailEntry[];
|
|
30
|
+
/** @internal Host-only lookup of one plugin's entry in a built-in rail. */
|
|
31
|
+
export declare function getRailEntry(section: BuiltInRailSection, pluginId: string, entryId: string): RegisteredRailEntry | undefined;
|
|
32
|
+
/** @internal Clears every registered slot and plugin id. Tests only: the
|
|
33
|
+
* admin registers once per page load. */
|
|
34
|
+
export declare function resetPluginSlotsForTests(): void;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const registeredPlugins = new Set();
|
|
2
|
+
const sections = [];
|
|
3
|
+
const railEntries = [];
|
|
4
|
+
/**
|
|
5
|
+
* Register every slot a plugin's manifest declares: its top-level sections
|
|
6
|
+
* (each with its own rail) and its rail entries in built-in sections.
|
|
7
|
+
* Replaces `registerAdminSection`. Throws on a second registration of the
|
|
8
|
+
* same plugin id, slots or not, so a caller that boots a plugin twice finds
|
|
9
|
+
* out rather than doubling its entries in the app bar.
|
|
10
|
+
*
|
|
11
|
+
* @internal Host-only: the admin calls it with a validated manifest.
|
|
12
|
+
*/
|
|
13
|
+
export function registerPluginSlots(pluginId, manifest) {
|
|
14
|
+
if (registeredPlugins.has(pluginId)) {
|
|
15
|
+
throw new Error(`The slots of plugin "${pluginId}" are already registered`);
|
|
16
|
+
}
|
|
17
|
+
registeredPlugins.add(pluginId);
|
|
18
|
+
for (const section of manifest.contributions.adminSections ?? []) {
|
|
19
|
+
sections.push({ pluginId, section });
|
|
20
|
+
}
|
|
21
|
+
for (const entry of manifest.contributions.railEntries ?? []) {
|
|
22
|
+
railEntries.push({ pluginId, entry });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** @internal Host-only lookup of one plugin's section by its id. */
|
|
26
|
+
export function getPluginSection(pluginId, sectionId) {
|
|
27
|
+
return sections.find((registered) => registered.pluginId === pluginId && registered.section.id === sectionId);
|
|
28
|
+
}
|
|
29
|
+
/** @internal Every registered plugin section, in registration order. A
|
|
30
|
+
* copy: changing it changes nothing registered. */
|
|
31
|
+
export function listPluginSections() {
|
|
32
|
+
return [...sections];
|
|
33
|
+
}
|
|
34
|
+
/** @internal The rail entries plugins add to one built-in section, in
|
|
35
|
+
* registration order. */
|
|
36
|
+
export function listRailEntries(section) {
|
|
37
|
+
return railEntries.filter((registered) => registered.entry.section === section);
|
|
38
|
+
}
|
|
39
|
+
/** @internal Host-only lookup of one plugin's entry in a built-in rail. */
|
|
40
|
+
export function getRailEntry(section, pluginId, entryId) {
|
|
41
|
+
return railEntries.find((registered) => registered.entry.section === section && registered.pluginId === pluginId && registered.entry.id === entryId);
|
|
42
|
+
}
|
|
43
|
+
/** @internal Clears every registered slot and plugin id. Tests only: the
|
|
44
|
+
* admin registers once per page load. */
|
|
45
|
+
export function resetPluginSlotsForTests() {
|
|
46
|
+
registeredPlugins.clear();
|
|
47
|
+
sections.length = 0;
|
|
48
|
+
railEntries.length = 0;
|
|
49
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// The built-in datatypes' serialize/deserialize implementations, in a
|
|
2
|
+
// deliberately React-free module: apps/server invokes these through the
|
|
3
|
+
// ./datatypes subpath (Session 69's "no browser weight in the server
|
|
4
|
+
// process" boundary), while built-ins.tsx re-imports them so the browser
|
|
5
|
+
// registry contract is unchanged. All six are identity today (Session
|
|
6
|
+
// 111 wires the PIPELINE, not new output shapes) — a built-in that needs
|
|
7
|
+
// a real serialized projection later changes its entry here and nowhere
|
|
8
|
+
// else. Keys are editor ids (DataTypeConfig.editorId), matching
|
|
9
|
+
// BUILT_IN_DATA_TYPE_CONFIGS in @kardalum/api-schemas.
|
|
10
|
+
export const identitySerializer = (value) => value;
|
|
11
|
+
export const BUILT_IN_SERIALIZERS = {
|
|
12
|
+
"com.kardalum.text": identitySerializer,
|
|
13
|
+
"com.kardalum.number": identitySerializer,
|
|
14
|
+
"com.kardalum.boolean": identitySerializer,
|
|
15
|
+
"com.kardalum.date": identitySerializer,
|
|
16
|
+
"com.kardalum.image": identitySerializer,
|
|
17
|
+
"com.kardalum.richtext": identitySerializer,
|
|
18
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { JSONSchema7 } from "json-schema";
|
|
2
|
+
export declare const TEXT_SETTINGS_SCHEMA: JSONSchema7;
|
|
3
|
+
export declare const TEXT_DEFAULT_SETTINGS: Record<string, unknown>;
|
|
4
|
+
export declare const IMAGE_SETTINGS_SCHEMA: JSONSchema7;
|
|
5
|
+
export declare const IMAGE_DEFAULT_SETTINGS: Record<string, unknown>;
|
|
6
|
+
export declare const HTML_SETTINGS_SCHEMA: JSONSchema7;
|
|
7
|
+
export declare const HTML_DEFAULT_SETTINGS: Record<string, unknown>;
|
|
8
|
+
export declare const CONTENT_LIST_SETTINGS_SCHEMA: JSONSchema7;
|
|
9
|
+
export declare const FILE_UPLOAD_SETTINGS_SCHEMA: JSONSchema7;
|
|
10
|
+
export declare const CROP_SETTINGS_SCHEMA: JSONSchema7;
|
|
11
|
+
export declare const THUMBNAIL_SETTINGS_SCHEMA: JSONSchema7;
|
|
12
|
+
export declare const CROP_DEFAULT_SETTINGS: Record<string, unknown>;
|
|
13
|
+
export declare const THUMBNAIL_DEFAULT_SETTINGS: Record<string, unknown>;
|
|
14
|
+
export declare const BUILT_IN_SETTINGS_SCHEMAS: Readonly<Record<string, JSONSchema7>>;
|