@kardalum/plugin-sdk 0.0.0-stage → 0.16.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 +118 -0
- package/LICENSE +202 -0
- package/README.md +80 -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 +29 -0
- package/dist/capabilities.js +67 -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 +94 -0
- package/dist/license-verdict-keys.d.ts +18 -0
- package/dist/license-verdict-keys.js +26 -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 +476 -0
- package/dist/manifest-schema.js +823 -0
- package/dist/manifest.d.ts +611 -0
- package/dist/manifest.js +86 -0
- package/dist/media/media-picker.d.ts +39 -0
- package/dist/media/media-picker.js +447 -0
- package/dist/media/upload-error.d.ts +12 -0
- package/dist/media/upload-error.js +30 -0
- package/dist/plugin-context.d.ts +82 -0
- package/dist/plugin-context.js +77 -0
- package/dist/plugin-screen-context.d.ts +71 -0
- package/dist/plugin-screen-context.js +41 -0
- package/dist/read-all-pages.d.ts +23 -0
- package/dist/read-all-pages.js +30 -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 +372 -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 +17 -0
- package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +25 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +93 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +88 -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 +542 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +357 -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 +260 -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 +152 -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 +352 -0
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +133 -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 +37 -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 +298 -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 +113 -0
- package/node_modules/@kardalum/api-schemas/dist/index.js +64 -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/management-multipart.schema.d.ts +73 -0
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +104 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +682 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +269 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +177 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +222 -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 +249 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +84 -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 +172 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +196 -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-install-record.schema.d.ts +69 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +59 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +585 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +536 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +75 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +213 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +391 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +413 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +29 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +100 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +44 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +162 -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 +314 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +338 -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 +96 -0
- package/node_modules/@kardalum/api-schemas/dist/role.schema.js +75 -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/sample-content.schema.d.ts +35 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +79 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +138 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +105 -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 +47 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.js +27 -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 +97 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +73 -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/build-reference.d.ts +111 -0
- package/node_modules/@kardalum/plugin-package/dist/build-reference.js +61 -0
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +103 -0
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +351 -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 +13 -0
- package/node_modules/@kardalum/plugin-package/dist/index.js +8 -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/reference-entry.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/reference-entry.js +6 -0
- package/node_modules/@kardalum/plugin-package/dist/sample-content.d.ts +20 -0
- package/node_modules/@kardalum/plugin-package/dist/sample-content.js +57 -0
- package/node_modules/@kardalum/plugin-package/dist/types.d.ts +43 -0
- package/node_modules/@kardalum/plugin-package/dist/types.js +15 -0
- package/node_modules/@kardalum/plugin-package/package.json +54 -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 +89 -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
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const PLUGIN_DOC_ROLES: readonly ["overview", "setup", "configuration", "guide", "troubleshooting"];
|
|
3
|
+
export type PluginDocRole = (typeof PLUGIN_DOC_ROLES)[number];
|
|
4
|
+
export declare const MAX_DOC_PAGES = 40;
|
|
5
|
+
export declare const MAX_DOC_PAGE_BYTES: number;
|
|
6
|
+
export declare const RESERVED_DOC_SLUGS: ReadonlySet<string>;
|
|
7
|
+
export declare const PluginDocsPageSchema: z.ZodObject<{
|
|
8
|
+
role: z.ZodEnum<{
|
|
9
|
+
overview: "overview";
|
|
10
|
+
setup: "setup";
|
|
11
|
+
configuration: "configuration";
|
|
12
|
+
guide: "guide";
|
|
13
|
+
troubleshooting: "troubleshooting";
|
|
14
|
+
}>;
|
|
15
|
+
path: z.ZodString;
|
|
16
|
+
title: z.ZodString;
|
|
17
|
+
}, z.core.$strict>;
|
|
18
|
+
export type PluginDocsPage = z.infer<typeof PluginDocsPageSchema>;
|
|
19
|
+
/** The page's URL slug on every surface: its file name without ".md", and
|
|
20
|
+
* "overview" for the README. */
|
|
21
|
+
export declare function docSlug(path: string): string;
|
|
22
|
+
/** No `docs` field means the README is the one page (spec D2). */
|
|
23
|
+
export declare function effectiveDocsPages(docs: PluginDocsPage[] | undefined, pluginName: string): PluginDocsPage[];
|
|
24
|
+
export interface DocsDeclarationIssue {
|
|
25
|
+
path: (string | number)[];
|
|
26
|
+
message: string;
|
|
27
|
+
}
|
|
28
|
+
/** The rules over a declared list that one page's shape cannot express. */
|
|
29
|
+
export declare function checkDocsDeclaration(docs: ReadonlyArray<PluginDocsPage>): DocsDeclarationIssue[];
|
|
30
|
+
export interface DocsFacts {
|
|
31
|
+
hasMigrations: boolean;
|
|
32
|
+
hasDependencies: boolean;
|
|
33
|
+
hasPrice: boolean;
|
|
34
|
+
hasDocumentTypes: boolean;
|
|
35
|
+
hasSettingsPages: boolean;
|
|
36
|
+
}
|
|
37
|
+
/** Reads the five facts from a live manifest or from manifest.json. The
|
|
38
|
+
* summary keeps each contribution list as a list of redacted entries,
|
|
39
|
+
* reduces migrations to their ids, and says `paid: true` where the live
|
|
40
|
+
* manifest has a price above 0: the amount itself never reaches
|
|
41
|
+
* manifest.json, because the marketplace would seed a listing price from
|
|
42
|
+
* it. */
|
|
43
|
+
export declare function docsFactsFrom(manifest: unknown): DocsFacts;
|
|
44
|
+
/** Which roles the door requires, each with the declaration that requires
|
|
45
|
+
* it, so a refusal can say why. Derived, never declared (spec D1). */
|
|
46
|
+
export declare function requiredDocRoles(facts: DocsFacts): Array<{
|
|
47
|
+
role: PluginDocRole;
|
|
48
|
+
because: string;
|
|
49
|
+
}>;
|
|
50
|
+
/** A slot label as reference.json carries it: language code to text, with
|
|
51
|
+
* the English text every slot label must have. */
|
|
52
|
+
export declare const ReferenceLabelMapSchema: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
53
|
+
export declare const PluginReferenceSchema: z.ZodObject<{
|
|
54
|
+
actions: z.ZodArray<z.ZodObject<{
|
|
55
|
+
id: z.ZodString;
|
|
56
|
+
label: z.ZodString;
|
|
57
|
+
}, z.core.$strip>>;
|
|
58
|
+
roles: z.ZodArray<z.ZodObject<{
|
|
59
|
+
id: z.ZodString;
|
|
60
|
+
label: z.ZodString;
|
|
61
|
+
actions: z.ZodArray<z.ZodString>;
|
|
62
|
+
}, z.core.$strip>>;
|
|
63
|
+
apiRoutes: z.ZodArray<z.ZodObject<{
|
|
64
|
+
method: z.ZodString;
|
|
65
|
+
path: z.ZodString;
|
|
66
|
+
access: z.ZodString;
|
|
67
|
+
action: z.ZodOptional<z.ZodString>;
|
|
68
|
+
}, z.core.$strict>>;
|
|
69
|
+
capabilities: z.ZodArray<z.ZodObject<{
|
|
70
|
+
id: z.ZodString;
|
|
71
|
+
mediation: z.ZodEnum<{
|
|
72
|
+
mediated: "mediated";
|
|
73
|
+
promised: "promised";
|
|
74
|
+
}>;
|
|
75
|
+
payload: z.ZodObject<{
|
|
76
|
+
count: z.ZodNumber;
|
|
77
|
+
details: z.ZodArray<z.ZodString>;
|
|
78
|
+
}, z.core.$strict>;
|
|
79
|
+
}, z.core.$strict>>;
|
|
80
|
+
documentTypes: z.ZodArray<z.ZodObject<{
|
|
81
|
+
name: z.ZodString;
|
|
82
|
+
kind: z.ZodString;
|
|
83
|
+
fields: z.ZodArray<z.ZodUnknown>;
|
|
84
|
+
}, z.core.$loose>>;
|
|
85
|
+
dataTypes: z.ZodArray<z.ZodObject<{
|
|
86
|
+
id: z.ZodString;
|
|
87
|
+
name: z.ZodString;
|
|
88
|
+
}, z.core.$loose>>;
|
|
89
|
+
templates: z.ZodArray<z.ZodObject<{
|
|
90
|
+
name: z.ZodString;
|
|
91
|
+
alias: z.ZodString;
|
|
92
|
+
kind: z.ZodString;
|
|
93
|
+
documentType: z.ZodOptional<z.ZodString>;
|
|
94
|
+
}, z.core.$strict>>;
|
|
95
|
+
settingsPages: z.ZodArray<z.ZodObject<{
|
|
96
|
+
id: z.ZodString;
|
|
97
|
+
name: z.ZodString;
|
|
98
|
+
action: z.ZodString;
|
|
99
|
+
}, z.core.$strict>>;
|
|
100
|
+
adminSections: z.ZodArray<z.ZodObject<{
|
|
101
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
102
|
+
rail: z.ZodArray<z.ZodObject<{
|
|
103
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
104
|
+
id: z.ZodString;
|
|
105
|
+
action: z.ZodString;
|
|
106
|
+
}, z.core.$strict>>;
|
|
107
|
+
id: z.ZodString;
|
|
108
|
+
action: z.ZodString;
|
|
109
|
+
}, z.core.$strict>>;
|
|
110
|
+
railEntries: z.ZodArray<z.ZodObject<{
|
|
111
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
112
|
+
section: z.ZodString;
|
|
113
|
+
id: z.ZodString;
|
|
114
|
+
action: z.ZodString;
|
|
115
|
+
}, z.core.$strict>>;
|
|
116
|
+
dashboardWidgets: z.ZodArray<z.ZodObject<{
|
|
117
|
+
name: z.ZodString;
|
|
118
|
+
id: z.ZodString;
|
|
119
|
+
action: z.ZodString;
|
|
120
|
+
}, z.core.$strict>>;
|
|
121
|
+
editorToolbar: z.ZodArray<z.ZodObject<{
|
|
122
|
+
label: z.ZodString;
|
|
123
|
+
id: z.ZodString;
|
|
124
|
+
action: z.ZodString;
|
|
125
|
+
}, z.core.$strict>>;
|
|
126
|
+
contentTreeActions: z.ZodArray<z.ZodObject<{
|
|
127
|
+
label: z.ZodString;
|
|
128
|
+
id: z.ZodString;
|
|
129
|
+
action: z.ZodString;
|
|
130
|
+
}, z.core.$strict>>;
|
|
131
|
+
hooks: z.ZodArray<z.ZodString>;
|
|
132
|
+
scheduledTasks: z.ZodArray<z.ZodObject<{
|
|
133
|
+
id: z.ZodString;
|
|
134
|
+
name: z.ZodString;
|
|
135
|
+
cron: z.ZodString;
|
|
136
|
+
}, z.core.$strict>>;
|
|
137
|
+
migrations: z.ZodArray<z.ZodObject<{
|
|
138
|
+
id: z.ZodString;
|
|
139
|
+
name: z.ZodString;
|
|
140
|
+
}, z.core.$strict>>;
|
|
141
|
+
assertions: z.ZodArray<z.ZodObject<{
|
|
142
|
+
key: z.ZodString;
|
|
143
|
+
reason: z.ZodString;
|
|
144
|
+
}, z.core.$strict>>;
|
|
145
|
+
installOptions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
146
|
+
step: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
147
|
+
id: z.ZodString;
|
|
148
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
149
|
+
kind: z.ZodString;
|
|
150
|
+
choices: z.ZodArray<z.ZodObject<{
|
|
151
|
+
id: z.ZodString;
|
|
152
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
153
|
+
}, z.core.$strict>>;
|
|
154
|
+
default: z.ZodNullable<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
155
|
+
required: z.ZodBoolean;
|
|
156
|
+
}, z.core.$strict>>>;
|
|
157
|
+
}, z.core.$strict>;
|
|
158
|
+
export type PluginReference = z.infer<typeof PluginReferenceSchema>;
|
|
159
|
+
export declare function emptyPluginReference(): PluginReference;
|
|
160
|
+
export declare const REFERENCE_PAGE_SLUGS: readonly ["permissions", "api-routes", "capabilities", "content", "settings", "admin-surfaces", "lifecycle"];
|
|
161
|
+
export type ReferencePageSlug = (typeof REFERENCE_PAGE_SLUGS)[number];
|
|
162
|
+
/** Which lists each page's tables are drawn from. Every list belongs to
|
|
163
|
+
* exactly one page (pinned by plugin-docs.test.ts), so a list added to the
|
|
164
|
+
* schema without a page is a red test, not a fact nobody sees. */
|
|
165
|
+
export declare const REFERENCE_PAGE_TABLES: Record<ReferencePageSlug, readonly (keyof PluginReference)[]>;
|
|
166
|
+
export declare function isReferencePageSlug(slug: string): slug is ReferencePageSlug;
|
|
167
|
+
/** The one rule (S289): a reference page exists when at least one of its
|
|
168
|
+
* tables has a row. The renderer, the admin, the server, the door, the
|
|
169
|
+
* marketplace and its sitemap all ask this function. */
|
|
170
|
+
export declare function referencePageHasContent(reference: PluginReference, slug: string): boolean;
|
|
171
|
+
/** The generated pages this plugin gets, in their fixed order. */
|
|
172
|
+
export declare function referencePageSlugs(reference: PluginReference): ReferencePageSlug[];
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PluginActionDeclarationSchema, PluginRoleOfferSchema } from "./plugin-actions.schema.js";
|
|
3
|
+
import { HOSTILE_CHARS_MESSAGE, hasHostileChars } from "./plugin-docs-text.js";
|
|
4
|
+
// S286, the docs contract (2026-10-04-s285-the-docs-contract-design.md).
|
|
5
|
+
// The contract's pure parts live here so the SDK's manifest schema, the
|
|
6
|
+
// CLI and the package door run the same definitions.
|
|
7
|
+
export const PLUGIN_DOC_ROLES = ["overview", "setup", "configuration", "guide", "troubleshooting"];
|
|
8
|
+
/** A guide may repeat; every other role appears at most once. */
|
|
9
|
+
const SINGLE_USE_ROLES = new Set(["overview", "setup", "configuration", "troubleshooting"]);
|
|
10
|
+
export const MAX_DOC_PAGES = 40;
|
|
11
|
+
export const MAX_DOC_PAGE_BYTES = 256 * 1024;
|
|
12
|
+
export const RESERVED_DOC_SLUGS = new Set(["reference", "search"]);
|
|
13
|
+
const DOC_PATH = /^(README\.md|docs\/[a-z0-9][a-z0-9-]*\.md)$/;
|
|
14
|
+
export const PluginDocsPageSchema = z
|
|
15
|
+
.object({
|
|
16
|
+
role: z.enum(PLUGIN_DOC_ROLES),
|
|
17
|
+
path: z.string().regex(DOC_PATH, 'must be "README.md" or a lower-case file directly under "docs/" ending ".md"'),
|
|
18
|
+
title: z.string().trim().min(1).max(80).refine((title) => !hasHostileChars(title), HOSTILE_CHARS_MESSAGE),
|
|
19
|
+
})
|
|
20
|
+
.strict();
|
|
21
|
+
/** The page's URL slug on every surface: its file name without ".md", and
|
|
22
|
+
* "overview" for the README. */
|
|
23
|
+
export function docSlug(path) {
|
|
24
|
+
if (path === "README.md")
|
|
25
|
+
return "overview";
|
|
26
|
+
return path.slice("docs/".length, -".md".length);
|
|
27
|
+
}
|
|
28
|
+
/** No `docs` field means the README is the one page (spec D2). */
|
|
29
|
+
export function effectiveDocsPages(docs, pluginName) {
|
|
30
|
+
return docs ?? [{ role: "overview", path: "README.md", title: pluginName }];
|
|
31
|
+
}
|
|
32
|
+
/** The rules over a declared list that one page's shape cannot express. */
|
|
33
|
+
export function checkDocsDeclaration(docs) {
|
|
34
|
+
const issues = [];
|
|
35
|
+
if (docs.length > MAX_DOC_PAGES) {
|
|
36
|
+
issues.push({ path: ["docs"], message: `a plugin may declare at most ${MAX_DOC_PAGES} docs pages` });
|
|
37
|
+
}
|
|
38
|
+
const rolesSeen = new Set();
|
|
39
|
+
const pathsSeen = new Set();
|
|
40
|
+
const pathBySlug = new Map();
|
|
41
|
+
docs.forEach((page, index) => {
|
|
42
|
+
if (SINGLE_USE_ROLES.has(page.role)) {
|
|
43
|
+
if (rolesSeen.has(page.role)) {
|
|
44
|
+
issues.push({ path: ["docs", index, "role"], message: `docs role "${page.role}" may appear only once` });
|
|
45
|
+
}
|
|
46
|
+
rolesSeen.add(page.role);
|
|
47
|
+
}
|
|
48
|
+
if (pathsSeen.has(page.path)) {
|
|
49
|
+
issues.push({ path: ["docs", index, "path"], message: `docs path "${page.path}" is declared more than once` });
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
pathsSeen.add(page.path);
|
|
53
|
+
const slug = docSlug(page.path);
|
|
54
|
+
if (RESERVED_DOC_SLUGS.has(slug)) {
|
|
55
|
+
issues.push({ path: ["docs", index, "path"], message: `docs page "${page.path}" uses the reserved slug "${slug}"` });
|
|
56
|
+
}
|
|
57
|
+
const earlier = pathBySlug.get(slug);
|
|
58
|
+
if (earlier !== undefined) {
|
|
59
|
+
issues.push({ path: ["docs", index, "path"], message: `docs pages "${earlier}" and "${page.path}" share the slug "${slug}"` });
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
pathBySlug.set(slug, page.path);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
return issues;
|
|
66
|
+
}
|
|
67
|
+
function present(value) {
|
|
68
|
+
if (Array.isArray(value))
|
|
69
|
+
return value.length > 0;
|
|
70
|
+
return value === true;
|
|
71
|
+
}
|
|
72
|
+
/** Reads the five facts from a live manifest or from manifest.json. The
|
|
73
|
+
* summary keeps each contribution list as a list of redacted entries,
|
|
74
|
+
* reduces migrations to their ids, and says `paid: true` where the live
|
|
75
|
+
* manifest has a price above 0: the amount itself never reaches
|
|
76
|
+
* manifest.json, because the marketplace would seed a listing price from
|
|
77
|
+
* it. */
|
|
78
|
+
export function docsFactsFrom(manifest) {
|
|
79
|
+
const source = (manifest && typeof manifest === "object" ? manifest : {});
|
|
80
|
+
const contributions = (source.contributions && typeof source.contributions === "object" ? source.contributions : {});
|
|
81
|
+
return {
|
|
82
|
+
hasMigrations: present(source.migrations),
|
|
83
|
+
hasDependencies: present(source.pluginDependencies),
|
|
84
|
+
hasPrice: (typeof source.price === "number" && source.price > 0) || source.paid === true,
|
|
85
|
+
hasDocumentTypes: present(contributions.documentTypes),
|
|
86
|
+
hasSettingsPages: present(contributions.settingsPages),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/** Which roles the door requires, each with the declaration that requires
|
|
90
|
+
* it, so a refusal can say why. Derived, never declared (spec D1). */
|
|
91
|
+
export function requiredDocRoles(facts) {
|
|
92
|
+
const required = [{ role: "overview", because: "every plugin" }];
|
|
93
|
+
const setup = [
|
|
94
|
+
facts.hasMigrations ? "migrations" : null,
|
|
95
|
+
facts.hasDependencies ? "pluginDependencies" : null,
|
|
96
|
+
facts.hasPrice ? "a price" : null,
|
|
97
|
+
facts.hasDocumentTypes ? "documentTypes" : null,
|
|
98
|
+
].filter((reason) => reason !== null);
|
|
99
|
+
if (setup.length > 0)
|
|
100
|
+
required.push({ role: "setup", because: setup.join(", ") });
|
|
101
|
+
if (facts.hasSettingsPages)
|
|
102
|
+
required.push({ role: "configuration", because: "settingsPages" });
|
|
103
|
+
return required;
|
|
104
|
+
}
|
|
105
|
+
// reference.json: the serialisable facts the generated Reference pages are
|
|
106
|
+
// rendered from (S285 section 7, widened to seven pages by S289). Written by
|
|
107
|
+
// `kardalum plugin build` through buildReference in
|
|
108
|
+
// @kardalum/plugin-package/reference; built live from the attached manifest
|
|
109
|
+
// by the server for an installed plugin. JSON schemas and field definitions
|
|
110
|
+
// are carried as plain data, never validated here beyond being JSON. Every
|
|
111
|
+
// string is shown as text, never as markup.
|
|
112
|
+
/** A slot label as reference.json carries it: language code to text, with
|
|
113
|
+
* the English text every slot label must have. */
|
|
114
|
+
export const ReferenceLabelMapSchema = z
|
|
115
|
+
.record(z.string(), z.string())
|
|
116
|
+
.refine((label) => typeof label.en === "string" && label.en.trim().length > 0, 'a label carries its English text under "en"');
|
|
117
|
+
const gated = { id: z.string(), action: z.string() };
|
|
118
|
+
// S292: one row per option a manifest's `install` declares, carrying its
|
|
119
|
+
// step's label, for the lifecycle page's "Install asks" table. `required` is
|
|
120
|
+
// installOptionNeedsAnswer's answer, which buildReference writes inline (it
|
|
121
|
+
// may take only types from this package). The list defaults to empty, so a
|
|
122
|
+
// reference.json written by a CLI older than S292 still parses.
|
|
123
|
+
const ReferenceInstallOptionSchema = z
|
|
124
|
+
.object({
|
|
125
|
+
step: ReferenceLabelMapSchema,
|
|
126
|
+
id: z.string(),
|
|
127
|
+
label: ReferenceLabelMapSchema,
|
|
128
|
+
kind: z.string(),
|
|
129
|
+
choices: z.array(z.object({ id: z.string(), label: ReferenceLabelMapSchema }).strict()),
|
|
130
|
+
default: z.union([z.boolean(), z.string(), z.array(z.string())]).nullable(),
|
|
131
|
+
required: z.boolean(),
|
|
132
|
+
})
|
|
133
|
+
.strict();
|
|
134
|
+
export const PluginReferenceSchema = z
|
|
135
|
+
.object({
|
|
136
|
+
actions: z.array(PluginActionDeclarationSchema),
|
|
137
|
+
roles: z.array(PluginRoleOfferSchema),
|
|
138
|
+
apiRoutes: z.array(z.object({ method: z.string(), path: z.string(), access: z.string(), action: z.string().optional() }).strict()),
|
|
139
|
+
capabilities: z.array(z
|
|
140
|
+
.object({
|
|
141
|
+
id: z.string(),
|
|
142
|
+
mediation: z.enum(["mediated", "promised"]),
|
|
143
|
+
payload: z.object({ count: z.number().int().nonnegative(), details: z.array(z.string()) }).strict(),
|
|
144
|
+
})
|
|
145
|
+
.strict()),
|
|
146
|
+
documentTypes: z.array(z.object({ name: z.string(), kind: z.string(), fields: z.array(z.unknown()) }).passthrough()),
|
|
147
|
+
dataTypes: z.array(z.object({ id: z.string(), name: z.string() }).passthrough()),
|
|
148
|
+
templates: z.array(z.object({ name: z.string(), alias: z.string(), kind: z.string(), documentType: z.string().optional() }).strict()),
|
|
149
|
+
settingsPages: z.array(z.object({ id: z.string(), name: z.string(), action: z.string() }).strict()),
|
|
150
|
+
adminSections: z.array(z.object({ ...gated, label: ReferenceLabelMapSchema, rail: z.array(z.object({ ...gated, label: ReferenceLabelMapSchema }).strict()) }).strict()),
|
|
151
|
+
railEntries: z.array(z.object({ ...gated, label: ReferenceLabelMapSchema, section: z.string() }).strict()),
|
|
152
|
+
dashboardWidgets: z.array(z.object({ ...gated, name: z.string() }).strict()),
|
|
153
|
+
editorToolbar: z.array(z.object({ ...gated, label: z.string() }).strict()),
|
|
154
|
+
contentTreeActions: z.array(z.object({ ...gated, label: z.string() }).strict()),
|
|
155
|
+
hooks: z.array(z.string()),
|
|
156
|
+
scheduledTasks: z.array(z.object({ id: z.string(), name: z.string(), cron: z.string() }).strict()),
|
|
157
|
+
migrations: z.array(z.object({ id: z.string(), name: z.string() }).strict()),
|
|
158
|
+
assertions: z.array(z.object({ key: z.string(), reason: z.string() }).strict()),
|
|
159
|
+
installOptions: z.array(ReferenceInstallOptionSchema).default([]),
|
|
160
|
+
})
|
|
161
|
+
.strict();
|
|
162
|
+
export function emptyPluginReference() {
|
|
163
|
+
return {
|
|
164
|
+
actions: [], roles: [], apiRoutes: [], capabilities: [], documentTypes: [], dataTypes: [], templates: [],
|
|
165
|
+
settingsPages: [], adminSections: [], railEntries: [], dashboardWidgets: [], editorToolbar: [],
|
|
166
|
+
contentTreeActions: [], hooks: [], scheduledTasks: [], migrations: [], assertions: [], installOptions: [],
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
export const REFERENCE_PAGE_SLUGS = ["permissions", "api-routes", "capabilities", "content", "settings", "admin-surfaces", "lifecycle"];
|
|
170
|
+
/** Which lists each page's tables are drawn from. Every list belongs to
|
|
171
|
+
* exactly one page (pinned by plugin-docs.test.ts), so a list added to the
|
|
172
|
+
* schema without a page is a red test, not a fact nobody sees. */
|
|
173
|
+
export const REFERENCE_PAGE_TABLES = {
|
|
174
|
+
permissions: ["actions", "roles"],
|
|
175
|
+
"api-routes": ["apiRoutes"],
|
|
176
|
+
capabilities: ["capabilities"],
|
|
177
|
+
content: ["documentTypes", "dataTypes", "templates"],
|
|
178
|
+
settings: ["settingsPages"],
|
|
179
|
+
"admin-surfaces": ["adminSections", "railEntries", "dashboardWidgets", "editorToolbar", "contentTreeActions"],
|
|
180
|
+
lifecycle: ["installOptions", "hooks", "scheduledTasks", "migrations", "assertions"],
|
|
181
|
+
};
|
|
182
|
+
export function isReferencePageSlug(slug) {
|
|
183
|
+
return REFERENCE_PAGE_SLUGS.includes(slug);
|
|
184
|
+
}
|
|
185
|
+
/** The one rule (S289): a reference page exists when at least one of its
|
|
186
|
+
* tables has a row. The renderer, the admin, the server, the door, the
|
|
187
|
+
* marketplace and its sitemap all ask this function. */
|
|
188
|
+
export function referencePageHasContent(reference, slug) {
|
|
189
|
+
if (!isReferencePageSlug(slug))
|
|
190
|
+
return false;
|
|
191
|
+
return REFERENCE_PAGE_TABLES[slug].some((list) => reference[list].length > 0);
|
|
192
|
+
}
|
|
193
|
+
/** The generated pages this plugin gets, in their fixed order. */
|
|
194
|
+
export function referencePageSlugs(reference) {
|
|
195
|
+
return REFERENCE_PAGE_SLUGS.filter((slug) => referencePageHasContent(reference, slug));
|
|
196
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A reverse-domain id such as "com.vendor.plugin": every segment is
|
|
3
|
+
* lowercase, starts with a letter, and uses only a-z, 0-9 and hyphens.
|
|
4
|
+
* Shared by manifest ids, datatype ids and plugin references, so it carries
|
|
5
|
+
* no segment count.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PLUGIN_ID_REGEX: RegExp;
|
|
8
|
+
/**
|
|
9
|
+
* The most segments a plugin manifest's own id may have: every action is the
|
|
10
|
+
* plugin id plus at least an object and a verb, and an action has at most
|
|
11
|
+
* ACTION_SEGMENT_MAX segments.
|
|
12
|
+
*/
|
|
13
|
+
export declare const MANIFEST_ID_SEGMENT_MAX: number;
|
|
14
|
+
/**
|
|
15
|
+
* Whether `id` is an id a plugin manifest may have: PLUGIN_ID_REGEX and at
|
|
16
|
+
* most MANIFEST_ID_SEGMENT_MAX segments, exactly what the SDK's manifest
|
|
17
|
+
* validator applies. Every door that turns a plugin id into a directory name
|
|
18
|
+
* (an install, an upload, a marketplace submission) runs this first, so an id
|
|
19
|
+
* the validator would refuse never reaches the filesystem: a lookalike such
|
|
20
|
+
* as "COM.KARDALUM.SEO" names another plugin's folder on a case-insensitive
|
|
21
|
+
* filesystem (S283).
|
|
22
|
+
*/
|
|
23
|
+
export declare function isPluginManifestId(id: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* A slot's id (S280): a segment of its screen's URL, so lowercase letters,
|
|
26
|
+
* digits and single hyphens only, which need no encoding and can never be
|
|
27
|
+
* read as "." or "..".
|
|
28
|
+
*/
|
|
29
|
+
export declare const SLOT_ID_REGEX: RegExp;
|
|
30
|
+
/** The longest a slot's id may be. */
|
|
31
|
+
export declare const SLOT_ID_MAX = 64;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ACTION_SEGMENT_MAX } from "./action.schema.js";
|
|
2
|
+
// The character rules for a plugin's id and for a slot's id, kept here so
|
|
3
|
+
// that the plugin SDK's manifest schema and the nav setting (S281) read one
|
|
4
|
+
// rule each and cannot drift apart. The SDK's manifest-schema.ts explains
|
|
5
|
+
// why each rule is what it is; it wraps these in its own messages.
|
|
6
|
+
/**
|
|
7
|
+
* A reverse-domain id such as "com.vendor.plugin": every segment is
|
|
8
|
+
* lowercase, starts with a letter, and uses only a-z, 0-9 and hyphens.
|
|
9
|
+
* Shared by manifest ids, datatype ids and plugin references, so it carries
|
|
10
|
+
* no segment count.
|
|
11
|
+
*/
|
|
12
|
+
export const PLUGIN_ID_REGEX = /^[a-z][a-z0-9-]*(\.[a-z][a-z0-9-]*)+$/;
|
|
13
|
+
/**
|
|
14
|
+
* The most segments a plugin manifest's own id may have: every action is the
|
|
15
|
+
* plugin id plus at least an object and a verb, and an action has at most
|
|
16
|
+
* ACTION_SEGMENT_MAX segments.
|
|
17
|
+
*/
|
|
18
|
+
export const MANIFEST_ID_SEGMENT_MAX = ACTION_SEGMENT_MAX - 2;
|
|
19
|
+
/**
|
|
20
|
+
* Whether `id` is an id a plugin manifest may have: PLUGIN_ID_REGEX and at
|
|
21
|
+
* most MANIFEST_ID_SEGMENT_MAX segments, exactly what the SDK's manifest
|
|
22
|
+
* validator applies. Every door that turns a plugin id into a directory name
|
|
23
|
+
* (an install, an upload, a marketplace submission) runs this first, so an id
|
|
24
|
+
* the validator would refuse never reaches the filesystem: a lookalike such
|
|
25
|
+
* as "COM.KARDALUM.SEO" names another plugin's folder on a case-insensitive
|
|
26
|
+
* filesystem (S283).
|
|
27
|
+
*/
|
|
28
|
+
export function isPluginManifestId(id) {
|
|
29
|
+
return PLUGIN_ID_REGEX.test(id) && id.split(".").length <= MANIFEST_ID_SEGMENT_MAX;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A slot's id (S280): a segment of its screen's URL, so lowercase letters,
|
|
33
|
+
* digits and single hyphens only, which need no encoding and can never be
|
|
34
|
+
* read as "." or "..".
|
|
35
|
+
*/
|
|
36
|
+
export const SLOT_ID_REGEX = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
37
|
+
/** The longest a slot's id may be. */
|
|
38
|
+
export const SLOT_ID_MAX = 64;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** What the install itself created; a role whose id was already taken is never here. */
|
|
3
|
+
export declare const PluginInstallCreatedSchema: z.ZodObject<{
|
|
4
|
+
sampleContentNodeIds: z.ZodArray<z.ZodString>;
|
|
5
|
+
mediaIds: z.ZodArray<z.ZodString>;
|
|
6
|
+
roleIds: z.ZodArray<z.ZodString>;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
export declare const PluginInstallRecordSchema: z.ZodObject<{
|
|
9
|
+
answers: z.ZodObject<{
|
|
10
|
+
sampleContent: z.ZodBoolean;
|
|
11
|
+
roles: z.ZodArray<z.ZodString>;
|
|
12
|
+
options: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
created: z.ZodObject<{
|
|
15
|
+
sampleContentNodeIds: z.ZodArray<z.ZodString>;
|
|
16
|
+
mediaIds: z.ZodArray<z.ZodString>;
|
|
17
|
+
roleIds: z.ZodArray<z.ZodString>;
|
|
18
|
+
}, z.core.$strict>;
|
|
19
|
+
}, z.core.$strict>;
|
|
20
|
+
export type PluginInstallRecord = z.infer<typeof PluginInstallRecordSchema>;
|
|
21
|
+
/** A fresh `created`, never a shared one. */
|
|
22
|
+
export declare function emptyInstallCreated(): PluginInstallRecord["created"];
|
|
23
|
+
/** The stored column through the schema: null for a plugin installed before
|
|
24
|
+
* S293 (the column is null) or a value that does not parse. */
|
|
25
|
+
export declare function readInstallRecord(value: unknown): PluginInstallRecord | null;
|
|
26
|
+
/** What the install did with each offered role its answers named. */
|
|
27
|
+
export declare const INSTALL_ROLE_OUTCOMES: readonly ["created", "already-exists", "failed"];
|
|
28
|
+
export declare const InstallRoleOutcomeSchema: z.ZodObject<{
|
|
29
|
+
id: z.ZodString;
|
|
30
|
+
outcome: z.ZodEnum<{
|
|
31
|
+
created: "created";
|
|
32
|
+
"already-exists": "already-exists";
|
|
33
|
+
failed: "failed";
|
|
34
|
+
}>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
export type InstallRoleOutcome = z.infer<typeof InstallRoleOutcomeSchema>;
|
|
37
|
+
/** The 400 every install door answers for answers it refuses, every issue at
|
|
38
|
+
* once: `message` is "The answers were refused: " and the reasons joined with
|
|
39
|
+
* "; ", each reason "path: message". */
|
|
40
|
+
export declare const InstallAnswersRefusedSchema: z.ZodObject<{
|
|
41
|
+
message: z.ZodString;
|
|
42
|
+
reason: z.ZodLiteral<"answers-refused">;
|
|
43
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export type InstallAnswersRefused = z.infer<typeof InstallAnswersRefusedSchema>;
|
|
46
|
+
/** The most page titles a record summary names. */
|
|
47
|
+
export declare const INSTALL_RECORD_SUMMARY_TITLES = 20;
|
|
48
|
+
/** What the admin is told about a plugin's record (the uninstall dialog, an update). */
|
|
49
|
+
export declare const PluginInstallRecordSummarySchema: z.ZodObject<{
|
|
50
|
+
answers: z.ZodNullable<z.ZodObject<{
|
|
51
|
+
sampleContent: z.ZodBoolean;
|
|
52
|
+
roles: z.ZodArray<z.ZodString>;
|
|
53
|
+
options: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
54
|
+
}, z.core.$strict>>;
|
|
55
|
+
pages: z.ZodObject<{
|
|
56
|
+
liveCount: z.ZodNumber;
|
|
57
|
+
titles: z.ZodArray<z.ZodObject<{
|
|
58
|
+
id: z.ZodString;
|
|
59
|
+
title: z.ZodString;
|
|
60
|
+
}, z.core.$strip>>;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
mediaCount: z.ZodNumber;
|
|
63
|
+
roles: z.ZodArray<z.ZodObject<{
|
|
64
|
+
id: z.ZodString;
|
|
65
|
+
label: z.ZodString;
|
|
66
|
+
userCount: z.ZodNumber;
|
|
67
|
+
}, z.core.$strip>>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
export type PluginInstallRecordSummary = z.infer<typeof PluginInstallRecordSummarySchema>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ResolvedInstallAnswersSchema } from "./plugin-install.js";
|
|
3
|
+
import { RoleIdSchema } from "./role.schema.js";
|
|
4
|
+
// S293 (2026-10-13-s293-the-wizard-installed-design.md 3.1): what a plugin's
|
|
5
|
+
// install is remembered by, on its registry row (PluginRegistry.installRecord):
|
|
6
|
+
// the answers it was installed with, every default filled, and what the install
|
|
7
|
+
// itself created, so an update can carry the answers over and an uninstall can
|
|
8
|
+
// offer to remove exactly that. Written by the server only.
|
|
9
|
+
/** What the install itself created; a role whose id was already taken is never here. */
|
|
10
|
+
export const PluginInstallCreatedSchema = z
|
|
11
|
+
.object({
|
|
12
|
+
/** The sample's pages, in the order the seeder created them (parents first). */
|
|
13
|
+
sampleContentNodeIds: z.array(z.string().min(1)),
|
|
14
|
+
/** The media items the sample's `media` section uploaded. */
|
|
15
|
+
mediaIds: z.array(z.string().min(1)),
|
|
16
|
+
/** The offered roles this install created. */
|
|
17
|
+
roleIds: z.array(RoleIdSchema),
|
|
18
|
+
})
|
|
19
|
+
.strict();
|
|
20
|
+
export const PluginInstallRecordSchema = z
|
|
21
|
+
.object({ answers: ResolvedInstallAnswersSchema, created: PluginInstallCreatedSchema })
|
|
22
|
+
.strict();
|
|
23
|
+
/** A fresh `created`, never a shared one. */
|
|
24
|
+
export function emptyInstallCreated() {
|
|
25
|
+
return { sampleContentNodeIds: [], mediaIds: [], roleIds: [] };
|
|
26
|
+
}
|
|
27
|
+
/** The stored column through the schema: null for a plugin installed before
|
|
28
|
+
* S293 (the column is null) or a value that does not parse. */
|
|
29
|
+
export function readInstallRecord(value) {
|
|
30
|
+
const parsed = PluginInstallRecordSchema.safeParse(value);
|
|
31
|
+
return parsed.success ? parsed.data : null;
|
|
32
|
+
}
|
|
33
|
+
/** What the install did with each offered role its answers named. */
|
|
34
|
+
export const INSTALL_ROLE_OUTCOMES = ["created", "already-exists", "failed"];
|
|
35
|
+
export const InstallRoleOutcomeSchema = z.object({ id: RoleIdSchema, outcome: z.enum(INSTALL_ROLE_OUTCOMES) });
|
|
36
|
+
/** The 400 every install door answers for answers it refuses, every issue at
|
|
37
|
+
* once: `message` is "The answers were refused: " and the reasons joined with
|
|
38
|
+
* "; ", each reason "path: message". */
|
|
39
|
+
export const InstallAnswersRefusedSchema = z.object({
|
|
40
|
+
message: z.string(),
|
|
41
|
+
reason: z.literal("answers-refused"),
|
|
42
|
+
reasons: z.array(z.string()),
|
|
43
|
+
});
|
|
44
|
+
/** The most page titles a record summary names. */
|
|
45
|
+
export const INSTALL_RECORD_SUMMARY_TITLES = 20;
|
|
46
|
+
/** What the admin is told about a plugin's record (the uninstall dialog, an update). */
|
|
47
|
+
export const PluginInstallRecordSummarySchema = z.object({
|
|
48
|
+
/** Null for a plugin installed before S293. */
|
|
49
|
+
answers: ResolvedInstallAnswersSchema.nullable(),
|
|
50
|
+
pages: z.object({
|
|
51
|
+
/** Recorded pages not in the Recycle Bin. */
|
|
52
|
+
liveCount: z.number().int().nonnegative(),
|
|
53
|
+
titles: z.array(z.object({ id: z.string(), title: z.string() })).max(INSTALL_RECORD_SUMMARY_TITLES),
|
|
54
|
+
}),
|
|
55
|
+
/** Recorded media not in the media Recycle Bin; an uninstall keeps them. */
|
|
56
|
+
mediaCount: z.number().int().nonnegative(),
|
|
57
|
+
/** The recorded roles that still exist. */
|
|
58
|
+
roles: z.array(z.object({ id: RoleIdSchema, label: z.string(), userCount: z.number().int().nonnegative() })),
|
|
59
|
+
});
|