@kardalum/plugin-sdk 0.18.0 → 0.20.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 +253 -0
- package/README.md +20 -1
- package/dist/admin-section-registry.d.ts +16 -1
- package/dist/admin-section-registry.js +23 -0
- package/dist/assets/asset-picker.js +3 -3
- package/dist/built-in-editor-ids.d.ts +1 -1
- package/dist/built-in-editor-ids.js +2 -20
- package/dist/built-in-serializers.js +1 -1
- package/dist/built-in-settings-schemas.d.ts +10 -0
- package/dist/built-in-settings-schemas.js +90 -4
- package/dist/built-in-value-schemas.js +35 -0
- package/dist/built-ins.js +48 -17
- package/dist/capabilities.d.ts +11 -1
- package/dist/capabilities.js +55 -3
- package/dist/cli.d.ts +66 -0
- package/dist/cli.js +22 -0
- package/dist/content-library.d.ts +85 -0
- package/dist/content-library.js +15 -0
- package/dist/content-picker/page-picker-sheet.d.ts +13 -0
- package/dist/content-picker/page-picker-sheet.js +105 -0
- package/dist/content-picker/page-tree.d.ts +25 -0
- package/dist/content-picker/page-tree.js +132 -0
- package/dist/data-type-plugin.d.ts +9 -3
- package/dist/datatype-validation.d.ts +6 -11
- package/dist/datatype-validation.js +141 -3
- package/dist/define-plugin.d.ts +4 -4
- package/dist/define-plugin.js +5 -5
- package/dist/entitlement-entry.d.ts +1 -1
- package/dist/entitlement-entry.js +1 -1
- package/dist/entitlement-gate.d.ts +14 -0
- package/dist/entitlement-gate.js +64 -7
- package/dist/entitlement-plan.d.ts +6 -0
- package/dist/entitlement-plan.js +10 -0
- package/dist/entitlement-types.d.ts +36 -12
- package/dist/entitlement.d.ts +31 -4
- package/dist/entitlement.js +58 -17
- package/dist/hook-entry.d.ts +5 -0
- package/dist/hook-entry.js +30 -0
- package/dist/host-entry.d.ts +1 -1
- package/dist/host-entry.js +1 -1
- package/dist/index.d.ts +38 -4
- package/dist/index.js +54 -3
- package/dist/mail.d.ts +30 -0
- package/dist/mail.js +1 -0
- package/dist/manifest-entry.d.ts +29 -4
- package/dist/manifest-entry.js +39 -2
- package/dist/manifest-schema.d.ts +443 -29
- package/dist/manifest-schema.js +292 -24
- package/dist/manifest.d.ts +450 -51
- package/dist/manifest.js +1 -1
- package/dist/media/media-picker.js +33 -20
- package/dist/media/upload-error.d.ts +5 -1
- package/dist/media/upload-error.js +14 -2
- package/dist/media-library.d.ts +32 -0
- package/dist/media-library.js +15 -0
- package/dist/nested-field-host.d.ts +76 -0
- package/dist/nested-field-host.js +90 -0
- package/dist/notify.d.ts +12 -4
- package/dist/notify.js +1 -1
- package/dist/outbound.d.ts +47 -0
- package/dist/outbound.js +1 -0
- package/dist/plugin-context.d.ts +5 -0
- package/dist/plugin-context.js +3 -3
- package/dist/plugin-screen-context.d.ts +112 -0
- package/dist/plugin-screen-context.js +26 -0
- package/dist/providers.d.ts +268 -0
- package/dist/providers.js +74 -0
- package/dist/read-all-pages.d.ts +5 -0
- package/dist/read-all-pages.js +3 -2
- package/dist/register-built-ins.js +6 -6
- package/dist/registry.js +1 -1
- package/dist/richtext/block-panel.js +12 -7
- package/dist/richtext/extensions.js +7 -7
- package/dist/richtext/insert-menu.js +12 -9
- package/dist/richtext/style-listbox.js +7 -5
- package/dist/richtext/text-style-class.js +1 -1
- package/dist/sdk-strings.d.ts +285 -0
- package/dist/sdk-strings.js +347 -0
- package/dist/sealing.d.ts +14 -0
- package/dist/sealing.js +1 -0
- package/dist/simple-storage-value-provider.js +27 -27
- package/dist/structured-storage-types.d.ts +309 -9
- package/dist/structured-storage-types.js +2 -2
- package/dist/text-entry.d.ts +1 -0
- package/dist/text-entry.js +6 -0
- package/dist/tokens/tailwind-theme.css +5 -0
- package/dist/tokens/tokens.css +15 -3
- package/dist/tokens/tokens.json +8 -3
- package/dist/ui-entry.js +3 -3
- package/dist/views/asset-view.js +6 -3
- package/dist/views/content-list-preview.js +3 -1
- package/dist/views/content-list-settings-view.js +11 -7
- package/dist/views/content-list-view.d.ts +5 -3
- package/dist/views/content-list-view.js +38 -34
- package/dist/views/content-picker-view.d.ts +3 -0
- package/dist/views/content-picker-view.js +143 -0
- package/dist/views/crop-view.d.ts +4 -6
- package/dist/views/crop-view.js +22 -13
- package/dist/views/date-range-view.js +9 -6
- package/dist/views/file-upload-view.d.ts +5 -7
- package/dist/views/file-upload-view.js +16 -7
- package/dist/views/group-view.d.ts +8 -0
- package/dist/views/group-view.js +123 -0
- package/dist/views/html-code-editor.js +2 -2
- package/dist/views/html-view.js +12 -11
- package/dist/views/image-view.js +40 -22
- package/dist/views/link-view.d.ts +3 -0
- package/dist/views/link-view.js +150 -0
- package/dist/views/options-list-view.d.ts +3 -0
- package/dist/views/options-list-view.js +104 -0
- package/dist/views/repeatable-list-view.d.ts +3 -0
- package/dist/views/repeatable-list-view.js +113 -0
- package/dist/views/rich-text-view.js +32 -16
- package/dist/views/suggest-key.d.ts +17 -0
- package/dist/views/suggest-key.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.d.ts +215 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.js +179 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.js +10 -0
- package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +5 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +7 -1
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +4 -2
- package/node_modules/@kardalum/api-schemas/dist/auth.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.d.ts +65 -0
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.js +126 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +116 -3
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +71 -18
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +57 -2
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +137 -0
- package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/content-path.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/content-search.schema.d.ts +50 -0
- package/node_modules/@kardalum/api-schemas/dist/content-search.schema.js +42 -0
- package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.d.ts +37 -0
- package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.js +19 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +3 -3
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +3 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.js +10 -0
- package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.js +86 -0
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +10 -5
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +7 -4
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +25 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +9 -1
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +4 -4
- package/node_modules/@kardalum/api-schemas/dist/data-type-issue.d.ts +35 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-issue.js +60 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +267 -12
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +54 -8
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +24 -6
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +98 -13
- package/node_modules/@kardalum/api-schemas/dist/form-protection.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/form-protection.js +12 -0
- package/node_modules/@kardalum/api-schemas/dist/graphql-limits.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/graphql-limits.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/held-embed-words.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/held-embed-words.js +70 -0
- package/node_modules/@kardalum/api-schemas/dist/index.d.ts +122 -43
- package/node_modules/@kardalum/api-schemas/dist/index.js +92 -27
- package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/legal-anchors.d.ts +8 -0
- package/node_modules/@kardalum/api-schemas/dist/legal-anchors.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +63 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +54 -0
- package/node_modules/@kardalum/api-schemas/dist/listing-categories.schema.d.ts +46 -0
- package/node_modules/@kardalum/api-schemas/dist/listing-categories.schema.js +52 -0
- package/node_modules/@kardalum/api-schemas/dist/mail-rules.d.ts +224 -0
- package/node_modules/@kardalum/api-schemas/dist/mail-rules.js +404 -0
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +8 -0
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +4 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.d.ts +145 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.js +154 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +359 -8
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +85 -11
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.d.ts +15 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.d.ts +131 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.js +272 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.d.ts +84 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.js +138 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.d.ts +20 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.js +49 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.d.ts +211 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.js +424 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.d.ts +78 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.d.ts +70 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.js +43 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +22 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +22 -10
- package/node_modules/@kardalum/api-schemas/dist/media-move.schema.d.ts +75 -0
- package/node_modules/@kardalum/api-schemas/dist/media-move.schema.js +53 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +2 -2
- package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.js +9 -5
- package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.d.ts +204 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.js +370 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-validation.d.ts +53 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-validation.js +284 -0
- package/node_modules/@kardalum/api-schemas/dist/news.schema.d.ts +5 -5
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +1 -2
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +1 -2
- package/node_modules/@kardalum/api-schemas/dist/notification-kinds.d.ts +145 -0
- package/node_modules/@kardalum/api-schemas/dist/notification-kinds.js +177 -0
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.d.ts +258 -7
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.js +96 -5
- package/node_modules/@kardalum/api-schemas/dist/page-address.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/page-address.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.d.ts +34 -0
- package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.js +60 -0
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.d.ts +28 -3
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.js +55 -8
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-caller.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-caller.js +16 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.d.ts +76 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.js +316 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.d.ts +42 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.js +74 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.d.ts +31 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.js +131 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +26 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.js +1 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +26 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +13 -5
- package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.d.ts +228 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.js +41 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.d.ts +26 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.d.ts +40 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.js +124 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.js +51 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.d.ts +32 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.js +102 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.d.ts +107 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.js +213 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.js +21 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +44 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +38 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +237 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +205 -6
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.d.ts +26 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +29 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +32 -8
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +120 -14
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +357 -4
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +279 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +16 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +34 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.d.ts +40 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.js +139 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +22 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +31 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.d.ts +25 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.js +43 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.d.ts +107 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.js +150 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-providers.d.ts +310 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-providers.js +430 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.js +2 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.d.ts +45 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.js +99 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.d.ts +68 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.js +114 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-settings.d.ts +342 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-settings.js +400 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.d.ts +180 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.js +612 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +50 -7
- package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.d.ts +45 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.js +197 -0
- package/node_modules/@kardalum/api-schemas/dist/plural-rules.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/plural-rules.js +41 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +100 -12
- package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.d.ts +189 -0
- package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.js +164 -0
- package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +4 -4
- package/node_modules/@kardalum/api-schemas/dist/render-editing.js +4 -4
- package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +7 -3
- package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.d.ts +6 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.js +82 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-text.d.ts +66 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-text.js +497 -0
- package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.d.ts +82 -0
- package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.js +99 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +28 -0
- package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +91 -1
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.d.ts +289 -0
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +205 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +121 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +51 -10
- package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.d.ts +384 -0
- package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.js +616 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +3 -3
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.js +26 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.d.ts +66 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.js +160 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.js +29 -0
- package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.js +6 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +58 -1
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +35 -4
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.d.ts +5 -1
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.js +4 -3
- package/node_modules/@kardalum/api-schemas/package.json +1 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/build-css.js +8 -2
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +5 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +3 -3
- package/node_modules/@kardalum/design-tokens/dist/theme-css.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/theme-css.js +2 -2
- package/node_modules/@kardalum/design-tokens/dist/theme-types.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.d.ts +3 -3
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.js +3 -3
- package/node_modules/@kardalum/design-tokens/dist/themes/light.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/themes/light.js +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +15 -3
- package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +4 -4
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +17 -8
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +8 -3
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/types.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +21 -2
- package/node_modules/@kardalum/plugin-package/dist/build-reference.js +8 -2
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +17 -10
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +355 -22
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +2 -0
- package/node_modules/@kardalum/plugin-package/dist/cms-range.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/cms-range.js +353 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.js +26 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +3 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.js +34 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +2 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.js +27 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.js +22 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +47 -5
- package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.d.ts +27 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.js +95 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/locales.js +9 -4
- package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.js +68 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/providers.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/providers.js +298 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +27 -5
- package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +91 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.d.ts +6 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.js +140 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.js +36 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +21 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +10 -0
- package/node_modules/@kardalum/plugin-package/dist/envelope.d.ts +2 -2
- package/node_modules/@kardalum/plugin-package/dist/envelope.js +2 -2
- package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +3 -3
- package/node_modules/@kardalum/plugin-package/dist/extract.js +9 -9
- package/node_modules/@kardalum/plugin-package/dist/hash.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/hash.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +4 -2
- package/node_modules/@kardalum/plugin-package/dist/index.js +2 -1
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +75 -0
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +123 -0
- package/node_modules/@kardalum/plugin-package/dist/package-contract.d.ts +2 -2
- package/node_modules/@kardalum/plugin-package/dist/package-contract.js +5 -5
- package/node_modules/@kardalum/plugin-package/dist/types.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.js +8 -3
- package/node_modules/@kardalum/ui/dist/components/badge.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/button.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.js +49 -4
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.d.ts +5 -1
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +18 -5
- package/node_modules/@kardalum/ui/dist/components/empty-state.d.ts +4 -4
- package/node_modules/@kardalum/ui/dist/components/input.js +6 -1
- package/node_modules/@kardalum/ui/dist/components/property-field.js +3 -3
- package/node_modules/@kardalum/ui/dist/components/sheet.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/sheet.js +12 -7
- package/node_modules/@kardalum/ui/dist/components/skeleton.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/tab-strip.d.ts +3 -3
- package/node_modules/@kardalum/ui/dist/components/toast.js +4 -3
- package/node_modules/@kardalum/ui/dist/components/tooltip.d.ts +27 -0
- package/node_modules/@kardalum/ui/dist/components/tooltip.js +81 -0
- package/node_modules/@kardalum/ui/dist/components/truncated-text.d.ts +16 -0
- package/node_modules/@kardalum/ui/dist/components/truncated-text.js +95 -0
- package/node_modules/@kardalum/ui/dist/components/use-toast.js +2 -2
- package/node_modules/@kardalum/ui/dist/index.d.ts +3 -1
- package/node_modules/@kardalum/ui/dist/index.js +3 -1
- package/node_modules/@kardalum/ui/dist/lib/menu-host.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/lib/menu-host.js +17 -0
- package/node_modules/@kardalum/ui/package.json +8 -6
- package/package.json +18 -7
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Settings schemas for built-in editors that have real, validated settings
|
|
2
|
-
// (Session 69)
|
|
2
|
+
// (Session 69), keyed by the SAME id built-ins.tsx registers under
|
|
3
3
|
// (com.kardalum.<name>). Editors with no entry here have no server-side
|
|
4
4
|
// settings validation: either they have no settings at all (empty
|
|
5
5
|
// settingsSchema, e.g. number/boolean/date), or they're a third-party/
|
|
6
6
|
// remote plugin the server has no way to load code for (Module Federation
|
|
7
|
-
// remotes only ever run in the browser
|
|
7
|
+
// remotes only ever run in the browser, see manifest-entry.ts). This is a
|
|
8
8
|
// deliberate, documented scope boundary, not an oversight.
|
|
9
9
|
//
|
|
10
10
|
// Zero React import: this file (and the @kardalum/plugin-sdk/datatypes
|
|
@@ -17,7 +17,7 @@ export const TEXT_SETTINGS_SCHEMA = {
|
|
|
17
17
|
},
|
|
18
18
|
additionalProperties: false,
|
|
19
19
|
};
|
|
20
|
-
// Deliberately {}
|
|
20
|
+
// Deliberately {}: resolve-data-type.ts falls back to editor.defaultSettings
|
|
21
21
|
// for any config with empty settings (all six seeded built-ins today), so a
|
|
22
22
|
// non-empty default here would silently change every existing Text field's
|
|
23
23
|
// behavior the moment this ships.
|
|
@@ -72,7 +72,7 @@ export const IMAGE_SETTINGS_SCHEMA = {
|
|
|
72
72
|
};
|
|
73
73
|
export const IMAGE_DEFAULT_SETTINGS = {};
|
|
74
74
|
// S197 Task 8 (spec §7, D7): the raw-HTML datatype's one setting is an
|
|
75
|
-
// honest trust boundary, not a UX preference
|
|
75
|
+
// honest trust boundary, not a UX preference. It is default OFF, and the
|
|
76
76
|
// input view's settings screen states the trade-off inline (verbatim
|
|
77
77
|
// copy lives in html-view.tsx's HtmlSettingsView, not duplicated here).
|
|
78
78
|
export const HTML_SETTINGS_SCHEMA = {
|
|
@@ -234,6 +234,87 @@ export const ASSET_SETTINGS_SCHEMA = {
|
|
|
234
234
|
};
|
|
235
235
|
// The settings migration 0033 seeds (ASSET_DATA_TYPE_CONFIG in @kardalum/api-schemas).
|
|
236
236
|
export const ASSET_DEFAULT_SETTINGS = { accepts: "images", startFolder: null };
|
|
237
|
+
// M32 C: hand-kept mirror of ContentPickerSettingsSchema, input mode.
|
|
238
|
+
const UUID_PATTERN = "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$";
|
|
239
|
+
export const CONTENT_PICKER_SETTINGS_SCHEMA = {
|
|
240
|
+
type: "object",
|
|
241
|
+
properties: {
|
|
242
|
+
startNode: { anyOf: [{ type: "string", format: "uuid", pattern: UUID_PATTERN }, { type: "null" }] },
|
|
243
|
+
documentTypes: { maxItems: 500, type: "array", items: { type: "string", format: "uuid", pattern: UUID_PATTERN } },
|
|
244
|
+
multiple: { default: false, type: "boolean" },
|
|
245
|
+
max: { default: null, anyOf: [{ type: "integer", minimum: 1, maximum: 50 }, { type: "null" }] },
|
|
246
|
+
},
|
|
247
|
+
additionalProperties: false,
|
|
248
|
+
};
|
|
249
|
+
export const CONTENT_PICKER_DEFAULT_SETTINGS = { startNode: null, documentTypes: [], multiple: false, max: null };
|
|
250
|
+
// M32 C: hand-kept mirror of OptionsListSettingsSchema, input mode. It cannot say "distinct values";
|
|
251
|
+
// the server checks that with the Zod schema after ajv.
|
|
252
|
+
export const OPTIONS_SETTINGS_SCHEMA = {
|
|
253
|
+
type: "object",
|
|
254
|
+
properties: {
|
|
255
|
+
options: {
|
|
256
|
+
minItems: 1,
|
|
257
|
+
maxItems: 200,
|
|
258
|
+
type: "array",
|
|
259
|
+
items: {
|
|
260
|
+
type: "object",
|
|
261
|
+
properties: {
|
|
262
|
+
label: { type: "string", minLength: 1, maxLength: 200 },
|
|
263
|
+
value: { type: "string", minLength: 1, maxLength: 200 },
|
|
264
|
+
},
|
|
265
|
+
required: ["label", "value"],
|
|
266
|
+
additionalProperties: false,
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
multiple: { default: false, type: "boolean" },
|
|
270
|
+
},
|
|
271
|
+
required: ["options"],
|
|
272
|
+
additionalProperties: false,
|
|
273
|
+
};
|
|
274
|
+
// The editor's empty start; a save asks for one option ("Add at least one option.").
|
|
275
|
+
export const OPTIONS_DEFAULT_SETTINGS = { options: [], multiple: false };
|
|
276
|
+
// M32 C: hand-kept mirror of LinkSettingsSchema, input mode.
|
|
277
|
+
export const LINK_SETTINGS_SCHEMA = {
|
|
278
|
+
type: "object",
|
|
279
|
+
properties: { allow: { default: "both", type: "string", enum: ["internal", "external", "both"] } },
|
|
280
|
+
additionalProperties: false,
|
|
281
|
+
};
|
|
282
|
+
export const LINK_DEFAULT_SETTINGS = { allow: "both" };
|
|
283
|
+
// M32 D: hand-kept mirrors of GroupSettingsSchema and RepeatableListSettingsSchema, input mode.
|
|
284
|
+
// They cannot say "distinct aliases" or "min not above max"; the server checks those with the Zod
|
|
285
|
+
// schemas before ajv.
|
|
286
|
+
export const GROUP_SETTINGS_SCHEMA = {
|
|
287
|
+
type: "object",
|
|
288
|
+
properties: {
|
|
289
|
+
fields: {
|
|
290
|
+
maxItems: 20,
|
|
291
|
+
type: "array",
|
|
292
|
+
items: {
|
|
293
|
+
type: "object",
|
|
294
|
+
properties: {
|
|
295
|
+
alias: { type: "string", maxLength: 64, pattern: "^[a-zA-Z][a-zA-Z0-9_]*$" },
|
|
296
|
+
name: { type: "string", minLength: 1, maxLength: 200 },
|
|
297
|
+
dataTypeId: { type: "string", format: "uuid", pattern: UUID_PATTERN },
|
|
298
|
+
required: { default: false, type: "boolean" },
|
|
299
|
+
},
|
|
300
|
+
required: ["alias", "name", "dataTypeId"],
|
|
301
|
+
additionalProperties: false,
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
additionalProperties: false,
|
|
306
|
+
};
|
|
307
|
+
export const GROUP_DEFAULT_SETTINGS = { fields: [] };
|
|
308
|
+
export const REPEATABLE_LIST_SETTINGS_SCHEMA = {
|
|
309
|
+
type: "object",
|
|
310
|
+
properties: {
|
|
311
|
+
itemDataTypeId: { anyOf: [{ type: "string", format: "uuid", pattern: UUID_PATTERN }, { type: "null" }] },
|
|
312
|
+
min: { default: null, anyOf: [{ type: "integer", minimum: 0, maximum: 100 }, { type: "null" }] },
|
|
313
|
+
max: { default: null, anyOf: [{ type: "integer", minimum: 1, maximum: 100 }, { type: "null" }] },
|
|
314
|
+
},
|
|
315
|
+
additionalProperties: false,
|
|
316
|
+
};
|
|
317
|
+
export const REPEATABLE_LIST_DEFAULT_SETTINGS = { itemDataTypeId: null, min: null, max: null };
|
|
237
318
|
// com.kardalum.contentlist is the first entry whose schema has a REQUIRED
|
|
238
319
|
// member (`columns`), so unlike the three above it cannot fall back to the
|
|
239
320
|
// "stored settings are {} until a webmaster edits them" convention: its
|
|
@@ -249,4 +330,9 @@ export const BUILT_IN_SETTINGS_SCHEMAS = {
|
|
|
249
330
|
"com.kardalum.crop": CROP_SETTINGS_SCHEMA,
|
|
250
331
|
"com.kardalum.thumbnail": THUMBNAIL_SETTINGS_SCHEMA,
|
|
251
332
|
"com.kardalum.asset": ASSET_SETTINGS_SCHEMA,
|
|
333
|
+
"com.kardalum.contentpicker": CONTENT_PICKER_SETTINGS_SCHEMA,
|
|
334
|
+
"com.kardalum.options": OPTIONS_SETTINGS_SCHEMA,
|
|
335
|
+
"com.kardalum.link": LINK_SETTINGS_SCHEMA,
|
|
336
|
+
"com.kardalum.group": GROUP_SETTINGS_SCHEMA,
|
|
337
|
+
"com.kardalum.list": REPEATABLE_LIST_SETTINGS_SCHEMA,
|
|
252
338
|
};
|
|
@@ -47,4 +47,39 @@ export const BUILT_IN_VALUE_SCHEMAS = {
|
|
|
47
47
|
// S314p (D3). A path under public/, as Settings, Assets names the file; the address a template
|
|
48
48
|
// prints is worked out at render.
|
|
49
49
|
"com.kardalum.asset": { type: "string" },
|
|
50
|
+
// M32 C (D2, D10): one page id, or a list of distinct page ids (at most 50); null when empty.
|
|
51
|
+
"com.kardalum.contentpicker": {
|
|
52
|
+
anyOf: [
|
|
53
|
+
{ type: "string", format: "uuid" },
|
|
54
|
+
{ type: "array", items: { type: "string", format: "uuid" }, maxItems: 50, uniqueItems: true },
|
|
55
|
+
{ type: "null" },
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
// M32 C (D3): one option's value, or a list of distinct values; null when empty.
|
|
59
|
+
"com.kardalum.options": {
|
|
60
|
+
anyOf: [{ type: "string" }, { type: "array", items: { type: "string" }, uniqueItems: true }, { type: "null" }],
|
|
61
|
+
},
|
|
62
|
+
// M32 C (D4): a page on this site or an outside address, with a label and a new-tab flag.
|
|
63
|
+
"com.kardalum.link": {
|
|
64
|
+
anyOf: [
|
|
65
|
+
{
|
|
66
|
+
type: "object",
|
|
67
|
+
properties: { page: { type: "string", format: "uuid" }, label: { type: "string", maxLength: 200 }, newTab: { type: "boolean" } },
|
|
68
|
+
required: ["page"],
|
|
69
|
+
additionalProperties: false,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
type: "object",
|
|
73
|
+
properties: { url: { type: "string", maxLength: 2048 }, label: { type: "string", maxLength: 200 }, newTab: { type: "boolean" } },
|
|
74
|
+
required: ["url"],
|
|
75
|
+
additionalProperties: false,
|
|
76
|
+
},
|
|
77
|
+
{ type: "null" },
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
// M32 D (D1): a Group stores an object keyed by its sub-fields' aliases; a Repeatable list an array
|
|
81
|
+
// of at most 100 items. The per-field schema built from the data type tree replaces these on the
|
|
82
|
+
// delivery API.
|
|
83
|
+
"com.kardalum.group": { anyOf: [{ type: "object" }, { type: "null" }] },
|
|
84
|
+
"com.kardalum.list": { anyOf: [{ type: "array", maxItems: 100 }, { type: "null" }] },
|
|
50
85
|
};
|
package/dist/built-ins.js
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { CONTENT_LIST_DEFAULT_SETTINGS } from "@kardalum/api-schemas";
|
|
3
3
|
import { Checkbox, Input, PropertyField, usePropertyFieldControl } from "@kardalum/ui";
|
|
4
|
-
import { ASSET_DEFAULT_SETTINGS, ASSET_SETTINGS_SCHEMA, CONTENT_LIST_SETTINGS_SCHEMA, CROP_DEFAULT_SETTINGS, CROP_SETTINGS_SCHEMA, FILE_UPLOAD_SETTINGS_SCHEMA, HTML_DEFAULT_SETTINGS, HTML_SETTINGS_SCHEMA, IMAGE_DEFAULT_SETTINGS, IMAGE_SETTINGS_SCHEMA, TEXT_DEFAULT_SETTINGS, TEXT_SETTINGS_SCHEMA, THUMBNAIL_DEFAULT_SETTINGS, THUMBNAIL_SETTINGS_SCHEMA, } from "./built-in-settings-schemas.js";
|
|
4
|
+
import { ASSET_DEFAULT_SETTINGS, ASSET_SETTINGS_SCHEMA, CONTENT_LIST_SETTINGS_SCHEMA, CONTENT_PICKER_DEFAULT_SETTINGS, CONTENT_PICKER_SETTINGS_SCHEMA, CROP_DEFAULT_SETTINGS, CROP_SETTINGS_SCHEMA, FILE_UPLOAD_SETTINGS_SCHEMA, HTML_DEFAULT_SETTINGS, HTML_SETTINGS_SCHEMA, IMAGE_DEFAULT_SETTINGS, IMAGE_SETTINGS_SCHEMA, LINK_DEFAULT_SETTINGS, LINK_SETTINGS_SCHEMA, OPTIONS_DEFAULT_SETTINGS, OPTIONS_SETTINGS_SCHEMA, GROUP_DEFAULT_SETTINGS, GROUP_SETTINGS_SCHEMA, REPEATABLE_LIST_DEFAULT_SETTINGS, REPEATABLE_LIST_SETTINGS_SCHEMA, TEXT_DEFAULT_SETTINGS, TEXT_SETTINGS_SCHEMA, THUMBNAIL_DEFAULT_SETTINGS, THUMBNAIL_SETTINGS_SCHEMA, } from "./built-in-settings-schemas.js";
|
|
5
5
|
import { BUILT_IN_VALUE_SCHEMAS } from "./built-in-value-schemas.js";
|
|
6
6
|
import { BUILT_IN_SERIALIZERS, identitySerializer } from "./built-in-serializers.js";
|
|
7
7
|
import { BUILT_IN_DATATYPE_VALIDATORS } from "./datatype-validation.js";
|
|
8
8
|
import { definePlugin } from "./define-plugin.js";
|
|
9
9
|
import { usePluginSettings, usePluginSettingsValue, usePluginValue } from "./plugin-context.js";
|
|
10
10
|
import { registerDataType } from "./registry.js";
|
|
11
|
+
import { useSdkString } from "./sdk-strings.js";
|
|
11
12
|
import { AssetInputView, AssetReadOnlyView, AssetSettingsView } from "./views/asset-view.js";
|
|
13
|
+
import { ContentPickerInputView, ContentPickerReadOnlyView, ContentPickerSettingsView } from "./views/content-picker-view.js";
|
|
14
|
+
import { GroupInputView, GroupReadOnlyView, GroupSettingsView } from "./views/group-view.js";
|
|
15
|
+
import { RepeatableListInputView, RepeatableListReadOnlyView, RepeatableListSettingsView } from "./views/repeatable-list-view.js";
|
|
16
|
+
import { LinkInputView, LinkReadOnlyView, LinkSettingsView } from "./views/link-view.js";
|
|
17
|
+
import { OptionsListInputView, OptionsListReadOnlyView, OptionsListSettingsView } from "./views/options-list-view.js";
|
|
12
18
|
import { ContentListPreview } from "./views/content-list-preview.js";
|
|
13
19
|
import { ContentListSettingsView } from "./views/content-list-settings-view.js";
|
|
14
20
|
import { ContentListInputView, ContentListReadOnlyView } from "./views/content-list-view.js";
|
|
@@ -29,14 +35,14 @@ function NotImplementedView() {
|
|
|
29
35
|
// Every built-in input view spreads usePropertyFieldControl(): the host
|
|
30
36
|
// renders these inside a PropertyField whose <label> has no child element
|
|
31
37
|
// to point at (the view is a component, not a DOM node), so without this
|
|
32
|
-
// the control has no accessible name at all
|
|
38
|
+
// the control has no accessible name at all (WCAG 4.1.2), and exactly
|
|
33
39
|
// what axe reports as `label` / `aria-input-field-name`.
|
|
34
40
|
function TextInputView() {
|
|
35
41
|
const { value, onChange } = usePluginValue();
|
|
36
42
|
const settings = usePluginSettings();
|
|
37
43
|
const field = usePropertyFieldControl();
|
|
38
44
|
return (_jsx(Input, { ...field, value: value ?? "", placeholder: settings.placeholder,
|
|
39
|
-
// Hard limit: the browser physically blocks keystrokes past this
|
|
45
|
+
// Hard limit: the browser physically blocks keystrokes past this,
|
|
40
46
|
// a different, config-level concept from FieldValidation.maxLength
|
|
41
47
|
// (field-row.tsx), which is a soft, validated-on-blur field rule.
|
|
42
48
|
maxLength: settings.maxLength, onChange: (e) => onChange(e.target.value) }));
|
|
@@ -45,16 +51,15 @@ function TextReadOnlyView() {
|
|
|
45
51
|
const { value } = usePluginValue();
|
|
46
52
|
return _jsx("p", { children: value ?? "" });
|
|
47
53
|
}
|
|
48
|
-
// Rendered by the Data Types editor only (data-type-editor.tsx)
|
|
54
|
+
// Rendered by the Data Types editor only (data-type-editor.tsx), a
|
|
49
55
|
// settings-EDITING view, so it uses usePluginSettingsValue() (write path),
|
|
50
56
|
// not usePluginSettings() (read-only, used by the input/readOnly views
|
|
51
|
-
// above).
|
|
52
|
-
//
|
|
53
|
-
// deliberately deferred piece of SDK scope, not yet implemented,
|
|
54
|
-
// matching ImageInputView's existing "Remove"/"Loading…" precedent.
|
|
57
|
+
// above). Its words come from useSdkString() (S366f D11), the host's
|
|
58
|
+
// language inside the admin and English anywhere else.
|
|
55
59
|
function TextSettingsView() {
|
|
56
60
|
const { value: settings, onChange } = usePluginSettingsValue();
|
|
57
|
-
|
|
61
|
+
const s = useSdkString();
|
|
62
|
+
return (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(PropertyField, { label: s("text.placeholderLabel"), htmlFor: "text-settings-placeholder", children: _jsx(Input, { id: "text-settings-placeholder", value: settings.placeholder ?? "", onChange: (e) => onChange({ ...settings, placeholder: e.target.value || undefined }) }) }), _jsx(PropertyField, { label: s("text.maxLengthLabel"), htmlFor: "text-settings-max-length", helpText: s("text.maxLengthHelp"), children: _jsx(Input, { id: "text-settings-max-length", type: "number", min: 1, value: settings.maxLength ?? "", onChange: (e) => onChange({ ...settings, maxLength: e.target.value === "" ? undefined : Number(e.target.value) }) }) })] }));
|
|
58
63
|
}
|
|
59
64
|
function NumberInputView() {
|
|
60
65
|
const { value, onChange } = usePluginValue();
|
|
@@ -72,7 +77,8 @@ function BooleanInputView() {
|
|
|
72
77
|
}
|
|
73
78
|
function BooleanReadOnlyView() {
|
|
74
79
|
const { value } = usePluginValue();
|
|
75
|
-
|
|
80
|
+
const s = useSdkString();
|
|
81
|
+
return _jsx("p", { children: value ? s("boolean.yes") : s("boolean.no") });
|
|
76
82
|
}
|
|
77
83
|
function DateInputView() {
|
|
78
84
|
const { value, onChange } = usePluginValue();
|
|
@@ -91,7 +97,7 @@ const NOT_IMPLEMENTED_VIEWS = {
|
|
|
91
97
|
const NO_SETTINGS = { type: "object", properties: {} };
|
|
92
98
|
function builtIn(id, name, icon, schema, views = NOT_IMPLEMENTED_VIEWS, options = {}) {
|
|
93
99
|
// Through definePlugin (Session 61) so built-ins take the exact
|
|
94
|
-
// validation path external plugins do
|
|
100
|
+
// validation path external plugins do, so a regression in any built-in
|
|
95
101
|
// definition fails loudly at module load, not silently at render.
|
|
96
102
|
return definePlugin({
|
|
97
103
|
id: `com.kardalum.${id}`,
|
|
@@ -111,12 +117,12 @@ function builtIn(id, name, icon, schema, views = NOT_IMPLEMENTED_VIEWS, options
|
|
|
111
117
|
isEmpty: BUILT_IN_DATATYPE_VALIDATORS[`com.kardalum.${id}`]?.isEmpty,
|
|
112
118
|
});
|
|
113
119
|
}
|
|
114
|
-
// Real views (Session 35)
|
|
120
|
+
// Real views (Session 35): settings stays NotImplementedView for four
|
|
115
121
|
// of six (number/boolean/date/richtext) since they have no configurable
|
|
116
122
|
// settings yet (empty settingsSchema). text and image gained real
|
|
117
123
|
// settings + settingsSchema in Session 69, proving the settings pipeline
|
|
118
124
|
// before Google Maps uses the exact same path.
|
|
119
|
-
// `preview` is aliased to the same `readOnly` view (Session 41)
|
|
125
|
+
// `preview` is aliased to the same `readOnly` view (Session 41), used by
|
|
120
126
|
// the document type builder's per-field live preview while designing a
|
|
121
127
|
// field, deliberately not a `disabled`-attribute wrapper around `input`:
|
|
122
128
|
// the rich text view is TipTap/contenteditable, which a native `disabled`
|
|
@@ -146,7 +152,7 @@ registerDataType(builtIn("date", "Date", "calendar", BUILT_IN_VALUE_SCHEMAS["com
|
|
|
146
152
|
settings: NotImplementedView,
|
|
147
153
|
preview: DateReadOnlyView,
|
|
148
154
|
}));
|
|
149
|
-
// Stores a media reference id
|
|
155
|
+
// Stores a media reference id; the Media Library item itself is
|
|
150
156
|
// fetched separately (GET /api/manage/v1/media/:id), not embedded in the field
|
|
151
157
|
// value. S234d gave the view a second way to fill that id: Choose opens
|
|
152
158
|
// the shared media picker over the library, beside the upload it has had
|
|
@@ -188,10 +194,10 @@ registerDataType(builtIn("richtext", "Rich Text", "file-text", BUILT_IN_VALUE_SC
|
|
|
188
194
|
preview: RichTextReadOnlyView,
|
|
189
195
|
}));
|
|
190
196
|
// S197 Task 8 (spec §7, D7): developer-authored raw HTML, distinct from
|
|
191
|
-
// the rich (TipTap) editor above
|
|
197
|
+
// the rich (TipTap) editor above: a plain string value edited in
|
|
192
198
|
// CodeMirror. `trusted` (default false) is the datatype's one setting;
|
|
193
199
|
// the render pipeline (apps/server/src/render/render-context.ts) is what
|
|
194
|
-
// actually enforces the posture this settings flag configures
|
|
200
|
+
// actually enforces the posture this settings flag configures; this
|
|
195
201
|
// registration only carries the flag, it doesn't interpret it.
|
|
196
202
|
registerDataType(builtIn("html", "HTML", "code", BUILT_IN_VALUE_SCHEMAS["com.kardalum.html"], {
|
|
197
203
|
input: HtmlInputView,
|
|
@@ -199,7 +205,7 @@ registerDataType(builtIn("html", "HTML", "code", BUILT_IN_VALUE_SCHEMAS["com.kar
|
|
|
199
205
|
settings: HtmlSettingsView,
|
|
200
206
|
preview: HtmlReadOnlyView,
|
|
201
207
|
}, { settingsSchema: HTML_SETTINGS_SCHEMA, defaultSettings: HTML_DEFAULT_SETTINGS }));
|
|
202
|
-
// S198 Task 3: the first composite built-in datatype
|
|
208
|
+
// S198 Task 3: the first composite built-in datatype: its value has two
|
|
203
209
|
// interdependent members ({ start, end }), which is exactly what forces
|
|
204
210
|
// the validate hook's shape to be honest: `path` names which sub-input is
|
|
205
211
|
// at fault, and `isEmpty` lets `required` mean "a range must be provided"
|
|
@@ -264,3 +270,28 @@ registerDataType(builtIn("asset", "Asset", "folder-open", BUILT_IN_VALUE_SCHEMAS
|
|
|
264
270
|
settings: AssetSettingsView,
|
|
265
271
|
preview: AssetReadOnlyView,
|
|
266
272
|
}, { settingsSchema: ASSET_SETTINGS_SCHEMA, defaultSettings: ASSET_DEFAULT_SETTINGS }));
|
|
273
|
+
// M32 C (D1): the Content Picker, Options List and Link editors. Views arrive in their own tasks;
|
|
274
|
+
// until then the placeholders render nothing.
|
|
275
|
+
registerDataType(builtIn("contentpicker", "Content Picker", "file-search", BUILT_IN_VALUE_SCHEMAS["com.kardalum.contentpicker"], { input: ContentPickerInputView, readOnly: ContentPickerReadOnlyView, settings: ContentPickerSettingsView, preview: ContentPickerReadOnlyView }, {
|
|
276
|
+
settingsSchema: CONTENT_PICKER_SETTINGS_SCHEMA,
|
|
277
|
+
defaultSettings: CONTENT_PICKER_DEFAULT_SETTINGS,
|
|
278
|
+
}));
|
|
279
|
+
registerDataType(builtIn("options", "Options List", "list", BUILT_IN_VALUE_SCHEMAS["com.kardalum.options"], { input: OptionsListInputView, readOnly: OptionsListReadOnlyView, settings: OptionsListSettingsView, preview: OptionsListReadOnlyView }, {
|
|
280
|
+
settingsSchema: OPTIONS_SETTINGS_SCHEMA,
|
|
281
|
+
defaultSettings: OPTIONS_DEFAULT_SETTINGS,
|
|
282
|
+
}));
|
|
283
|
+
registerDataType(builtIn("link", "Link", "link", BUILT_IN_VALUE_SCHEMAS["com.kardalum.link"], { input: LinkInputView, readOnly: LinkReadOnlyView, settings: LinkSettingsView, preview: LinkReadOnlyView }, {
|
|
284
|
+
settingsSchema: LINK_SETTINGS_SCHEMA,
|
|
285
|
+
defaultSettings: LINK_DEFAULT_SETTINGS,
|
|
286
|
+
}));
|
|
287
|
+
// M32 D (D1): the Group and Repeatable List editors.
|
|
288
|
+
const GROUP_VIEWS = { input: GroupInputView, readOnly: GroupReadOnlyView, settings: GroupSettingsView, preview: GroupReadOnlyView };
|
|
289
|
+
const LIST_VIEWS = { input: RepeatableListInputView, readOnly: RepeatableListReadOnlyView, settings: RepeatableListSettingsView, preview: RepeatableListReadOnlyView };
|
|
290
|
+
registerDataType(builtIn("group", "Group", "layers", BUILT_IN_VALUE_SCHEMAS["com.kardalum.group"], GROUP_VIEWS, {
|
|
291
|
+
settingsSchema: GROUP_SETTINGS_SCHEMA,
|
|
292
|
+
defaultSettings: GROUP_DEFAULT_SETTINGS,
|
|
293
|
+
}));
|
|
294
|
+
registerDataType(builtIn("list", "Repeatable List", "list-ordered", BUILT_IN_VALUE_SCHEMAS["com.kardalum.list"], LIST_VIEWS, {
|
|
295
|
+
settingsSchema: REPEATABLE_LIST_SETTINGS_SCHEMA,
|
|
296
|
+
defaultSettings: REPEATABLE_LIST_DEFAULT_SETTINGS,
|
|
297
|
+
}));
|
package/dist/capabilities.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { CapabilityNote } from "@kardalum/api-schemas";
|
|
2
|
+
export { CAPABILITY_IDS, deriveCapabilities, derivesCapability, isActionGated, type Capability, type CapabilityMediation, type CapabilityPayload, } from "@kardalum/plugin-package/reference";
|
|
2
3
|
/**
|
|
3
4
|
* S289 (S347): the one sentence every surface uses for what declaring a
|
|
4
5
|
* promised capability means for review. Every submission that passes
|
|
@@ -18,6 +19,15 @@ export declare const PROMISED_CAPABILITY_SENTENCE = "is a promised capability, s
|
|
|
18
19
|
export type CapabilityAudience = "operator" | "shopper";
|
|
19
20
|
export type CapabilityLabels = Record<CapabilityAudience, string>;
|
|
20
21
|
export declare const CAPABILITY_LABELS: Record<string, CapabilityLabels>;
|
|
22
|
+
/**
|
|
23
|
+
* M33 K2: the core's notes a capability's detail may carry beside the
|
|
24
|
+
* plugin's own words, in English. The admin's locales (`capabilityNotes`)
|
|
25
|
+
* and the marketplace's dictionaries hold the same words in every language
|
|
26
|
+
* they carry, the English held to this table by their label tests. A note's
|
|
27
|
+
* words may hold one `{{value}}`, where the detail's value is printed as
|
|
28
|
+
* written (formatCapabilityDetail in @kardalum/api-schemas).
|
|
29
|
+
*/
|
|
30
|
+
export declare const CAPABILITY_NOTE_WORDS: Record<CapabilityNote, string>;
|
|
21
31
|
/**
|
|
22
32
|
* The heading a renderer puts in front of a capability's details.
|
|
23
33
|
*
|
package/dist/capabilities.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// S289: the derivation moved to @kardalum/plugin-package/reference so the one
|
|
2
2
|
// reference builder can call it (the SDK depends on plugin-package, never the
|
|
3
3
|
// reverse). The SDK's public names are unchanged; the labels stay here.
|
|
4
|
-
export { CAPABILITY_IDS, deriveCapabilities, isActionGated, } from "@kardalum/plugin-package/reference";
|
|
4
|
+
export { CAPABILITY_IDS, deriveCapabilities, derivesCapability, isActionGated, } from "@kardalum/plugin-package/reference";
|
|
5
5
|
// A contribution or assertion added to the manifest and not classified in
|
|
6
6
|
// the derivation is a compile error here, as it was before the move.
|
|
7
7
|
const contributionKeysAreTotal = true;
|
|
@@ -35,14 +35,16 @@ export const CAPABILITY_LABELS = {
|
|
|
35
35
|
"admin.section": { operator: "Admin sections", shopper: "Adds admin screens" },
|
|
36
36
|
"admin.railEntry": { operator: "Admin rail entries", shopper: "Adds screens to built-in sections" },
|
|
37
37
|
"admin.dashboardWidget": { operator: "Dashboard widgets", shopper: "Adds dashboard widgets" },
|
|
38
|
+
"admin.editorPanel": { operator: "Editor panels", shopper: "Adds panels to the page editor" },
|
|
39
|
+
"admin.treeAction": { operator: "Tree actions", shopper: "Adds actions to the content tree" },
|
|
38
40
|
"admin.notifications": {
|
|
39
41
|
operator: "Notifications",
|
|
40
|
-
shopper: "Sends notifications
|
|
42
|
+
shopper: "Sends notifications of the kinds it lists, each to the people the kind names.",
|
|
41
43
|
},
|
|
42
44
|
"render.template": { operator: "Render templates", shopper: "Ships render templates" },
|
|
43
45
|
"render.asset": { operator: "Editable assets", shopper: "Ships editable assets" },
|
|
44
46
|
"theme.tokens": { operator: "Theme tokens", shopper: "Restyles the admin" },
|
|
45
|
-
"server.hook": { operator: "Lifecycle hooks", shopper: "Reacts to
|
|
47
|
+
"server.hook": { operator: "Lifecycle hooks", shopper: "Reacts to events on your site: the ones listed" },
|
|
46
48
|
"server.scheduledTask": { operator: "Scheduled tasks", shopper: "Runs work on a schedule" },
|
|
47
49
|
"media.processor": { operator: "Media processors", shopper: "Processes uploaded media" },
|
|
48
50
|
"api.serializer": { operator: "Response extensions", shopper: "Extends content API responses" },
|
|
@@ -51,11 +53,61 @@ export const CAPABILITY_LABELS = {
|
|
|
51
53
|
"api.route.public": { operator: "Public API routes", shopper: "Adds routes anyone can call" },
|
|
52
54
|
"service.exposed": { operator: "Services for other plugins", shopper: "Offers services to other plugins" },
|
|
53
55
|
"bundle.plugin": { operator: "Bundled plugins", shopper: "Installs other plugins with it" },
|
|
56
|
+
"content.access": { operator: "Content access", shopper: "Reads, creates or changes content of the types it names" },
|
|
57
|
+
// M32 F4c (D10)
|
|
58
|
+
"media.access": { operator: "Media access", shopper: "Reads every media file, private ones included, or adds media files" },
|
|
59
|
+
"site.route": { operator: "Site addresses", shopper: "Answers at addresses of your site" },
|
|
60
|
+
"site.fallback": { operator: "Unclaimed addresses", shopper: "Answers addresses no page answers, for example with a redirect" },
|
|
61
|
+
"render.templateFilter": { operator: "Template filters", shopper: "Adds template filters" },
|
|
62
|
+
"render.templateTag": { operator: "Template tags", shopper: "Adds template tags" },
|
|
63
|
+
"render.pageHead": { operator: "Page head", shopper: "Adds tags to the head of every page, scripts only from the places it names" },
|
|
64
|
+
// M32 F4 (D8, D10)
|
|
65
|
+
"provider.formProtection": { operator: "Form protection provider", shopper: "Can check your site's forms" },
|
|
66
|
+
"provider.search": { operator: "Search provider", shopper: "Receives every published page to answer site search" },
|
|
67
|
+
"provider.mediaStore": { operator: "Media store", shopper: "Can store every uploaded file" },
|
|
68
|
+
// M32 H (H2, H19)
|
|
69
|
+
"provider.mail": { operator: "Mail sender", shopper: "Sends every email the site sends, password reset links included" },
|
|
70
|
+
// M33 K11
|
|
71
|
+
"mail.direct": { operator: "Plugin emails", shopper: "Sends emails of the kinds it lists, each to one person, such as an order confirmation to a buyer, when you switch each kind on" },
|
|
72
|
+
"mail.formReplies": { operator: "Form replies", shopper: "Can send one reply email to the address a visitor types into a form, when you switch it on" },
|
|
73
|
+
// M32 F4b (D48)
|
|
74
|
+
"provider.signIn": { operator: "Sign-in provider", shopper: "Can let people sign in to the admin, and vouches for who they are" },
|
|
75
|
+
secrets: { operator: "Secrets", shopper: "Keeps secret values you enter, encrypted" },
|
|
76
|
+
// M33 K42
|
|
77
|
+
"render.heldEmbed": { operator: "Content from other sites", shopper: "Shows content from the sites it names on your pages, only after a visitor clicks to show it" },
|
|
78
|
+
// M33 K17
|
|
79
|
+
"secrets.sealedValues": { operator: "Sealed values", shopper: "Keeps secrets it makes, encrypted with your server's key" },
|
|
80
|
+
// M33 K16
|
|
81
|
+
"network.outbound": {
|
|
82
|
+
operator: "Outbound requests",
|
|
83
|
+
shopper: "Calls web addresses through the server's checked connection, which refuses this server and private networks unless whoever runs the server allows a range",
|
|
84
|
+
},
|
|
54
85
|
"bundle.template": { operator: "Bundled starter", shopper: "Comes with a frontend starter" },
|
|
55
86
|
"network.external": { operator: "External network", shopper: "Reaches the network" },
|
|
56
87
|
"network.vendorService": { operator: "Vendor service", shopper: "Serves its paid features from the author's server" },
|
|
57
88
|
"filesystem.access": { operator: "Filesystem access", shopper: "Reads or writes files" },
|
|
58
89
|
};
|
|
90
|
+
/**
|
|
91
|
+
* M33 K2: the core's notes a capability's detail may carry beside the
|
|
92
|
+
* plugin's own words, in English. The admin's locales (`capabilityNotes`)
|
|
93
|
+
* and the marketplace's dictionaries hold the same words in every language
|
|
94
|
+
* they carry, the English held to this table by their label tests. A note's
|
|
95
|
+
* words may hold one `{{value}}`, where the detail's value is printed as
|
|
96
|
+
* written (formatCapabilityDetail in @kardalum/api-schemas).
|
|
97
|
+
*/
|
|
98
|
+
export const CAPABILITY_NOTE_WORDS = {
|
|
99
|
+
rawBody: "reads the request exactly as sent",
|
|
100
|
+
identifiesPeople: "identifies people",
|
|
101
|
+
durable: "kept across restarts",
|
|
102
|
+
methods: "may use: {{value}}",
|
|
103
|
+
leavesServer: "handed to visitors as a sealed token, readable only by this server",
|
|
104
|
+
setsTitle: "may set the page title",
|
|
105
|
+
embedFrom: "from {{value}}",
|
|
106
|
+
embedKindMap: "a map",
|
|
107
|
+
embedKindContent: "content",
|
|
108
|
+
privacyNoticeAt: "privacy notice: {{value}}",
|
|
109
|
+
addsScript: "adds its own script to pages with a protected form",
|
|
110
|
+
};
|
|
59
111
|
/**
|
|
60
112
|
* The heading a renderer puts in front of a capability's details.
|
|
61
113
|
*
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/** M32 I3 (B13): what a command may do with standard input, without `@types/node`. */
|
|
2
|
+
export interface CliReadableStream {
|
|
3
|
+
readonly isTTY?: boolean;
|
|
4
|
+
read(size?: number): string | Uint8Array | null;
|
|
5
|
+
setEncoding(encoding: "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex"): this;
|
|
6
|
+
pause(): this;
|
|
7
|
+
resume(): this;
|
|
8
|
+
on(event: string, listener: (...args: any[]) => void): this;
|
|
9
|
+
once(event: string, listener: (...args: any[]) => void): this;
|
|
10
|
+
off(event: string, listener: (...args: any[]) => void): this;
|
|
11
|
+
pipe(destination: any, options?: {
|
|
12
|
+
end?: boolean;
|
|
13
|
+
}): any;
|
|
14
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<string | Uint8Array>;
|
|
15
|
+
}
|
|
16
|
+
/** M32 I3 (B13): what a command may do with standard output or error, without `@types/node`. */
|
|
17
|
+
export interface CliWritableStream {
|
|
18
|
+
readonly isTTY?: boolean;
|
|
19
|
+
readonly columns?: number;
|
|
20
|
+
write(chunk: string | Uint8Array, callback?: (error?: Error | null) => void): boolean;
|
|
21
|
+
end(callback?: () => void): this;
|
|
22
|
+
on(event: string, listener: (...args: any[]) => void): this;
|
|
23
|
+
once(event: string, listener: (...args: any[]) => void): this;
|
|
24
|
+
off(event: string, listener: (...args: any[]) => void): this;
|
|
25
|
+
}
|
|
26
|
+
/** What a command receives. No environment copy, no profile record and no key. */
|
|
27
|
+
export interface PluginCliContext {
|
|
28
|
+
command: {
|
|
29
|
+
/** The plugin id's last segment (cut at 32): the first word of the command line. */
|
|
30
|
+
prefix: string;
|
|
31
|
+
/** The command's declared name: the second word. */
|
|
32
|
+
name: string;
|
|
33
|
+
packageName: string;
|
|
34
|
+
packageVersion: string;
|
|
35
|
+
};
|
|
36
|
+
/** The arguments after the command name, unchanged and frozen. */
|
|
37
|
+
argv: readonly string[];
|
|
38
|
+
cwd: string;
|
|
39
|
+
cliVersion: string;
|
|
40
|
+
stdin: CliReadableStream;
|
|
41
|
+
/** `stdout` and `stderr` are the raw streams: what is written to them is not redacted, unlike `out` and `err`. */
|
|
42
|
+
stdout: CliWritableStream;
|
|
43
|
+
stderr: CliWritableStream;
|
|
44
|
+
/** One line to stdout, through the CLI's redaction. */
|
|
45
|
+
out(line: string): void;
|
|
46
|
+
/** One line to stderr, through the CLI's redaction. */
|
|
47
|
+
err(line: string): void;
|
|
48
|
+
/**
|
|
49
|
+
* The developer's own management client (`KardalumManageClient` from `@kardalum/client`), made
|
|
50
|
+
* on first call: a command that never calls this never resolves a profile or reads a credential.
|
|
51
|
+
* The profile is resolved as for every command (the `KARDALUM_URL` and `KARDALUM_API_KEY` pair,
|
|
52
|
+
* then `options.profile`, `KARDALUM_PROFILE`, the default). A production profile is refused
|
|
53
|
+
* unless the command names it in `options.profile`, so forward the user's own `--profile`.
|
|
54
|
+
* Typed `unknown` here so the SDK carries no dependency on the client; cast it to
|
|
55
|
+
* `KardalumManageClient`.
|
|
56
|
+
*/
|
|
57
|
+
client(options?: {
|
|
58
|
+
profile?: string;
|
|
59
|
+
}): Promise<unknown>;
|
|
60
|
+
}
|
|
61
|
+
/** A command answers nothing (exit 0) or an integer 0 to 255 (that exit code). */
|
|
62
|
+
export type PluginCliCommand = (context: PluginCliContext) => void | number | Promise<void | number>;
|
|
63
|
+
/** A commands module's `commands` export: a plain object, one function per declared name. */
|
|
64
|
+
export type PluginCliCommands = Record<string, PluginCliCommand>;
|
|
65
|
+
/** Returns `commands` unchanged; it only checks each command against `PluginCliCommand`. */
|
|
66
|
+
export declare function defineCliCommands<T extends PluginCliCommands>(commands: T): T;
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// The `@kardalum/plugin-sdk/cli` subpath (M32 F3b, D7): the types of the commands a plugin package adds
|
|
2
|
+
// to the `kardalum` CLI, and `defineCliCommands`, an identity helper that checks a commands object
|
|
3
|
+
// against them. Types only, plus that one function: nothing here imports React or a Node module at
|
|
4
|
+
// run time, so the commands module of a package can import it cheaply.
|
|
5
|
+
//
|
|
6
|
+
// A package declares its commands in its own package.json (`kardalum.cli`: `plugin`, `module` and
|
|
7
|
+
// `commands`, each with a `name` and a `summary`) and the module exports them as `commands`:
|
|
8
|
+
//
|
|
9
|
+
// import { defineCliCommands } from "@kardalum/plugin-sdk/cli";
|
|
10
|
+
// export const commands = defineCliCommands({
|
|
11
|
+
// audit: async (context) => {
|
|
12
|
+
// const client = await context.client();
|
|
13
|
+
// context.out("checked");
|
|
14
|
+
// },
|
|
15
|
+
// });
|
|
16
|
+
//
|
|
17
|
+
// The CLI runs `kardalum <prefix> <name> [arguments]`, where the prefix is the last segment of the
|
|
18
|
+
// plugin id. A command is code the developer installed: it runs with their rights.
|
|
19
|
+
/** Returns `commands` unchanged; it only checks each command against `PluginCliCommand`. */
|
|
20
|
+
export function defineCliCommands(commands) {
|
|
21
|
+
return commands;
|
|
22
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { FORM_REPLY_REASONS, ContentChildrenQuery, ContentChildrenResponse, ContentItemQuery, ContentItemResponse, ContentTrashBody, ContentTrashResult, CreateContentRequest, LatestVersionQuery, LatestVersionResponse, PublishContentRequest, PublishContentResponse, SaveContentRequest, SaveContentResponse, UnpublishContentRequest, UnpublishContentResponse, ProtectionTellWord } from "@kardalum/api-schemas";
|
|
2
|
+
/** A page of rows plus a way to walk every page. `all()` follows `nextCursor` for you. */
|
|
3
|
+
export interface PluginContentList<T> {
|
|
4
|
+
items: T[];
|
|
5
|
+
nextCursor: string | null;
|
|
6
|
+
all(): AsyncIterable<T>;
|
|
7
|
+
}
|
|
8
|
+
type ContentRow = ContentChildrenResponse["items"][number];
|
|
9
|
+
/**
|
|
10
|
+
* M32 F (D8): the content half of the management client, acting as this plugin within its
|
|
11
|
+
* `contributions.contentAccess`. A call outside the declaration throws ContentAccessRefusedError
|
|
12
|
+
* and sends nothing.
|
|
13
|
+
*/
|
|
14
|
+
export interface PluginContentLibrary {
|
|
15
|
+
getById(id: string, opts?: Partial<Pick<ContentItemQuery, "locale">>): Promise<ContentItemResponse>;
|
|
16
|
+
getLatestVersion(id: string, opts?: Partial<Pick<LatestVersionQuery, "locale">>): Promise<LatestVersionResponse>;
|
|
17
|
+
getChildren(id: string, opts?: Partial<Pick<ContentChildrenQuery, "cursor" | "limit">>): Promise<PluginContentList<ContentRow>>;
|
|
18
|
+
create(body: CreateContentRequest): Promise<ContentItemResponse>;
|
|
19
|
+
save(id: string, body: SaveContentRequest): Promise<SaveContentResponse>;
|
|
20
|
+
publish(id: string, body?: PublishContentRequest): Promise<PublishContentResponse>;
|
|
21
|
+
unpublish(id: string, body?: UnpublishContentRequest): Promise<UnpublishContentResponse>;
|
|
22
|
+
delete(id: string, opts?: Partial<Pick<NonNullable<ContentTrashBody>, "confirm">>): Promise<ContentTrashResult>;
|
|
23
|
+
/** M32 F3 (D19, D20): the id of a document type this plugin's contentAccess names, or null when no type, or
|
|
24
|
+
* more than one, has that name. A name the declaration does not hold throws ContentAccessRefusedError.
|
|
25
|
+
* The plugin's own type of that name answers first; otherwise the one site type of that name, found
|
|
26
|
+
* among the first 2,000 types. The name matches exactly (case and spaces count) and is 1 to 200 characters,
|
|
27
|
+
* the contentAccess name limit. */
|
|
28
|
+
documentTypeId(name: string): Promise<string | null>;
|
|
29
|
+
}
|
|
30
|
+
/** M32 F (D9): thrown by context.content when a call falls outside the plugin's contentAccess. Nothing was sent. */
|
|
31
|
+
export declare class ContentAccessRefusedError extends Error {
|
|
32
|
+
readonly code: "content_access";
|
|
33
|
+
constructor(message: string);
|
|
34
|
+
}
|
|
35
|
+
/** Structural, never instanceof: the plugin's bundle carries its own copy of this class. */
|
|
36
|
+
export declare function isContentAccessRefusedError(value: unknown): value is ContentAccessRefusedError;
|
|
37
|
+
/** M32 H (H20): why a form reply was not queued. */
|
|
38
|
+
export type FormReplyReason = (typeof FORM_REPLY_REASONS)[number];
|
|
39
|
+
export type FormReplyResult = {
|
|
40
|
+
queued: true;
|
|
41
|
+
} | {
|
|
42
|
+
queued: false;
|
|
43
|
+
reason: FormReplyReason;
|
|
44
|
+
};
|
|
45
|
+
/** M32 H (H19): sends one reply to the address a visitor typed into the form, when the site owner switched it on. */
|
|
46
|
+
export type FormReply = (input: {
|
|
47
|
+
field: string;
|
|
48
|
+
subject: string;
|
|
49
|
+
text: string;
|
|
50
|
+
}) => Promise<FormReplyResult>;
|
|
51
|
+
export type ProtectionResult = {
|
|
52
|
+
ok: true;
|
|
53
|
+
reply?: FormReply;
|
|
54
|
+
} | {
|
|
55
|
+
ok: false;
|
|
56
|
+
check: "rate";
|
|
57
|
+
retryAfterSeconds: number;
|
|
58
|
+
} | {
|
|
59
|
+
ok: false;
|
|
60
|
+
check: "hiddenField" | "tooFast" | "token";
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* M32 F4 (D14, D15): the chosen protection provider refused the send (`provider_refused`) or did
|
|
64
|
+
* not answer usably (`provider_unavailable`: a throw, a timeout or a malformed answer). The
|
|
65
|
+
* provider's own reason is logged, never handed on; answer it as the other silent refusals.
|
|
66
|
+
*/
|
|
67
|
+
| {
|
|
68
|
+
ok: false;
|
|
69
|
+
check: "provider";
|
|
70
|
+
reason: "provider_unavailable";
|
|
71
|
+
}
|
|
72
|
+
/** M33 K53: a refusal may carry `tell`, the one word the provider's `verify` answered from `PROTECTION_TELL_WORDS`
|
|
73
|
+
* (`"needsScript"`: the send came without the check's script; `"expired"`: the answer's challenge had run
|
|
74
|
+
* out; `"unavailable"`: the provider could not check). It is a plain word, never provider text; a caller
|
|
75
|
+
* that does not know it answers as it always did. A caller that tells its visitor answers `"expired"`,
|
|
76
|
+
* `"unavailable"` and `provider_unavailable` alike ("not sent, please send it again") and keeps every
|
|
77
|
+
* refusal without a word silent: a wrong or reused answer is never told. */
|
|
78
|
+
| {
|
|
79
|
+
ok: false;
|
|
80
|
+
check: "provider";
|
|
81
|
+
reason: "provider_refused";
|
|
82
|
+
tell?: ProtectionTellWord;
|
|
83
|
+
};
|
|
84
|
+
/** Defined once in `@kardalum/api-schemas`: the field names, a fresh token and the live minimum time. */
|
|
85
|
+
export type { ProtectionFields } from "@kardalum/api-schemas";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** M32 F (D9): thrown by context.content when a call falls outside the plugin's contentAccess. Nothing was sent. */
|
|
2
|
+
export class ContentAccessRefusedError extends Error {
|
|
3
|
+
code = "content_access";
|
|
4
|
+
constructor(message) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.name = "ContentAccessRefusedError";
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/** Structural, never instanceof: the plugin's bundle carries its own copy of this class. */
|
|
10
|
+
export function isContentAccessRefusedError(value) {
|
|
11
|
+
if (typeof value !== "object" || value === null)
|
|
12
|
+
return false;
|
|
13
|
+
const candidate = value;
|
|
14
|
+
return candidate.name === "ContentAccessRefusedError" && candidate.code === "content_access";
|
|
15
|
+
}
|