@kardalum/plugin-sdk 0.20.0 → 0.21.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 +70 -0
- package/dist/admin-section-registry.d.ts +33 -1
- package/dist/admin-section-registry.js +67 -0
- package/dist/capabilities.js +46 -1
- package/dist/consent-entry.d.ts +11 -0
- package/dist/consent-entry.js +18 -0
- package/dist/content-library.d.ts +17 -0
- package/dist/content-list-extensions.d.ts +50 -0
- package/dist/content-list-extensions.js +11 -0
- package/dist/content-picker/page-picker-sheet.d.ts +2 -0
- package/dist/content-picker/page-picker-sheet.js +1 -1
- package/dist/content-picker/page-picker.d.ts +18 -0
- package/dist/content-picker/page-picker.js +20 -0
- package/dist/datatype-validation.js +10 -2
- package/dist/datatypes-entry.d.ts +1 -0
- package/dist/datatypes-entry.js +2 -0
- package/dist/entitlement-types.d.ts +18 -1
- package/dist/host-entry.d.ts +7 -1
- package/dist/host-entry.js +14 -1
- package/dist/index.d.ts +35 -7
- package/dist/index.js +46 -5
- package/dist/mail.d.ts +6 -2
- package/dist/manifest-entry.d.ts +22 -4
- package/dist/manifest-entry.js +25 -1
- package/dist/manifest-schema.d.ts +570 -31
- package/dist/manifest-schema.js +240 -12
- package/dist/manifest.d.ts +757 -32
- package/dist/manifest.js +8 -4
- package/dist/plugin-context.d.ts +47 -0
- package/dist/plugin-context.js +27 -0
- package/dist/plugin-permissions.d.ts +18 -0
- package/dist/plugin-permissions.js +25 -0
- package/dist/plugin-screen-context.d.ts +152 -11
- package/dist/plugin-screen-context.js +30 -0
- package/dist/providers.d.ts +47 -2
- package/dist/render-page.d.ts +15 -0
- package/dist/render-page.js +20 -0
- package/dist/richtext/block-panel.d.ts +12 -1
- package/dist/richtext/block-panel.js +27 -21
- package/dist/richtext/button-view.d.ts +11 -0
- package/dist/richtext/button-view.js +45 -0
- package/dist/richtext/content-guard.d.ts +4 -0
- package/dist/richtext/content-guard.js +27 -0
- package/dist/richtext/editor-handle.d.ts +34 -0
- package/dist/richtext/editor-handle.js +225 -0
- package/dist/richtext/extensions.d.ts +6 -0
- package/dist/richtext/extensions.js +16 -0
- package/dist/richtext/insert-menu.d.ts +6 -1
- package/dist/richtext/insert-menu.js +38 -18
- package/dist/richtext/item-attributes.d.ts +6 -0
- package/dist/richtext/item-attributes.js +19 -0
- package/dist/richtext/item-panel.d.ts +25 -0
- package/dist/richtext/item-panel.js +118 -0
- package/dist/richtext/item-view.d.ts +58 -0
- package/dist/richtext/item-view.js +172 -0
- package/dist/richtext/mark-form.d.ts +10 -0
- package/dist/richtext/mark-form.js +38 -0
- package/dist/richtext/paste-choice.d.ts +9 -0
- package/dist/richtext/paste-choice.js +13 -0
- package/dist/richtext/plugin-items.d.ts +72 -0
- package/dist/richtext/plugin-items.js +562 -0
- package/dist/richtext/plugin-mark-tooltips.d.ts +5 -0
- package/dist/richtext/plugin-mark-tooltips.js +44 -0
- package/dist/richtext/plugin-toolbar.d.ts +57 -0
- package/dist/richtext/plugin-toolbar.js +186 -0
- package/dist/richtext/rich-item-icons.d.ts +5 -0
- package/dist/richtext/rich-item-icons.js +42 -0
- package/dist/richtext/rich-items.d.ts +42 -0
- package/dist/richtext/rich-items.js +68 -0
- package/dist/richtext/rich-text-view-host.d.ts +24 -0
- package/dist/richtext/rich-text-view-host.js +11 -0
- package/dist/richtext/toolbar-button.d.ts +16 -0
- package/dist/richtext/toolbar-button.js +9 -0
- package/dist/richtext/url-paste.d.ts +20 -0
- package/dist/richtext/url-paste.js +82 -0
- package/dist/richtext-html-entry.d.ts +5 -0
- package/dist/richtext-html-entry.js +11 -0
- package/dist/sdk-strings.d.ts +59 -0
- package/dist/sdk-strings.js +64 -0
- package/dist/service-contract.d.ts +17 -0
- package/dist/service-contract.js +39 -0
- package/dist/services.d.ts +114 -0
- package/dist/services.js +1 -0
- package/dist/structured-storage-types.d.ts +124 -4
- package/dist/tailwind.js +10 -5
- package/dist/template-reads.d.ts +16 -0
- package/dist/template-reads.js +21 -0
- package/dist/testing-entry.d.ts +38 -0
- package/dist/testing-entry.js +173 -0
- package/dist/text-entry.d.ts +1 -1
- package/dist/text-entry.js +3 -2
- package/dist/tokens/system-dark.css +1 -0
- package/dist/tokens/tailwind-theme.css +2 -0
- package/dist/tokens/tokens.css +4 -0
- package/dist/tokens/tokens.json +5 -1
- package/dist/uploads.d.ts +43 -0
- package/dist/uploads.js +1 -0
- package/dist/user-library.d.ts +51 -0
- package/dist/user-library.js +15 -0
- package/dist/view-helpers.d.ts +18 -0
- package/dist/view-helpers.js +64 -0
- package/dist/views/content-list-view.js +207 -8
- package/dist/views/content-picker-view.js +1 -1
- package/dist/views/rich-text-view.d.ts +2 -0
- package/dist/views/rich-text-view.js +182 -24
- package/dist/views/unreadable-rich-text.d.ts +17 -0
- package/dist/views/unreadable-rich-text.js +40 -0
- package/dist/visitors.d.ts +81 -0
- package/dist/visitors.js +1 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-app-hosts.d.ts +21 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-app-hosts.js +39 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-app-redirects.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-app-redirects.js +31 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.d.ts +127 -8
- package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.js +82 -7
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +5 -1
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +2 -2
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.d.ts +7 -0
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.js +11 -0
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.js +18 -0
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +80 -0
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +41 -2
- package/node_modules/@kardalum/api-schemas/dist/content-reads.schema.d.ts +213 -0
- package/node_modules/@kardalum/api-schemas/dist/content-reads.schema.js +234 -0
- package/node_modules/@kardalum/api-schemas/dist/contribution-issues.d.ts +11 -0
- package/node_modules/@kardalum/api-schemas/dist/contribution-issues.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +50 -13
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +19 -10
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +77 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +37 -0
- package/node_modules/@kardalum/api-schemas/dist/experimental-points.d.ts +19 -0
- package/node_modules/@kardalum/api-schemas/dist/experimental-points.js +250 -0
- package/node_modules/@kardalum/api-schemas/dist/form-protection-callers.d.ts +29 -0
- package/node_modules/@kardalum/api-schemas/dist/form-protection-callers.js +31 -0
- package/node_modules/@kardalum/api-schemas/dist/html-scan.d.ts +22 -0
- package/node_modules/@kardalum/api-schemas/dist/html-scan.js +122 -0
- package/node_modules/@kardalum/api-schemas/dist/html-start-tags.d.ts +48 -0
- package/node_modules/@kardalum/api-schemas/dist/html-start-tags.js +381 -0
- package/node_modules/@kardalum/api-schemas/dist/index.d.ts +52 -14
- package/node_modules/@kardalum/api-schemas/dist/index.js +53 -9
- package/node_modules/@kardalum/api-schemas/dist/json-depth.d.ts +3 -0
- package/node_modules/@kardalum/api-schemas/dist/json-depth.js +20 -0
- package/node_modules/@kardalum/api-schemas/dist/mail-rules.d.ts +4 -2
- package/node_modules/@kardalum/api-schemas/dist/mail-rules.js +6 -1
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +178 -2
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +10 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.d.ts +3 -3
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +16 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.js +4 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-validation.d.ts +7 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-validation.js +51 -2
- package/node_modules/@kardalum/api-schemas/dist/page-audience.schema.d.ts +87 -0
- package/node_modules/@kardalum/api-schemas/dist/page-audience.schema.js +44 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-admin-slots.d.ts +11 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-admin-slots.js +61 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.d.ts +4 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.js +12 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-slots.d.ts +136 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-slots.js +254 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-checks.d.ts +22 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-checks.js +66 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-document.d.ts +130 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-document.js +173 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-fetch.d.ts +16 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-fetch.js +112 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-schema.d.ts +70 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-schema.js +380 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-types.d.ts +3 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-types.js +68 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +18 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +18 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +5 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.d.ts +10 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.js +48 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.d.ts +5 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.js +6 -4
- package/node_modules/@kardalum/api-schemas/dist/plugin-events.d.ts +24 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-events.js +53 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-guards.d.ts +112 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-guards.js +118 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +67 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +15 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-kept-parts.d.ts +138 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-kept-parts.js +110 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +80 -15
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +67 -23
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +10 -3
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +33 -8
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +2 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +7 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-providers.d.ts +43 -7
- package/node_modules/@kardalum/api-schemas/dist/plugin-providers.js +36 -5
- package/node_modules/@kardalum/api-schemas/dist/plugin-rich-text.d.ts +638 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-rich-text.js +533 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-call.d.ts +36 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-call.js +32 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-connections.d.ts +193 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-connections.js +123 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-declarations.d.ts +209 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-declarations.js +372 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-services.d.ts +90 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-services.js +204 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-settings.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-settings.js +10 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.d.ts +171 -4
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.js +406 -42
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-requests.d.ts +69 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-requests.js +149 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-styles.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-styles.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-uploads.d.ts +96 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-uploads.js +185 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-user-accounts.d.ts +213 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-user-accounts.js +131 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-view-kit.d.ts +54 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-view-kit.js +154 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-visitor-points.d.ts +37 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-visitor-points.js +124 -0
- package/node_modules/@kardalum/api-schemas/dist/render-cache.d.ts +126 -0
- package/node_modules/@kardalum/api-schemas/dist/render-cache.js +263 -0
- package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +303 -0
- package/node_modules/@kardalum/api-schemas/dist/render-editing.js +61 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-paste-hosts.d.ts +14 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-paste-hosts.js +108 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.d.ts +66 -1
- package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.js +465 -7
- package/node_modules/@kardalum/api-schemas/dist/rich-text-text.js +15 -118
- package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +110 -0
- package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.js +36 -0
- package/node_modules/@kardalum/api-schemas/dist/security-overview.schema.d.ts +64 -0
- package/node_modules/@kardalum/api-schemas/dist/security-overview.schema.js +38 -0
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.d.ts +9 -2
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +7 -2
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +26 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +19 -0
- package/node_modules/@kardalum/api-schemas/dist/sign-in-steps.d.ts +724 -0
- package/node_modules/@kardalum/api-schemas/dist/sign-in-steps.js +408 -0
- package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.d.ts +5 -3
- package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.js +3 -1
- package/node_modules/@kardalum/api-schemas/dist/site-consent.d.ts +77 -0
- package/node_modules/@kardalum/api-schemas/dist/site-consent.js +122 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.js +28 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +33 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +26 -1
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +14 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +2 -0
- package/node_modules/@kardalum/api-schemas/dist/visitor-accounts.d.ts +482 -0
- package/node_modules/@kardalum/api-schemas/dist/visitor-accounts.js +380 -0
- package/node_modules/@kardalum/api-schemas/dist/visitor-groups.d.ts +109 -0
- package/node_modules/@kardalum/api-schemas/dist/visitor-groups.js +62 -0
- package/node_modules/@kardalum/api-schemas/package.json +1 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.js +9 -1
- package/node_modules/@kardalum/design-tokens/dist/system-dark.css +1 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +2 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +2 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +4 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +6 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +5 -1
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +4 -0
- package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/build-reference.js +9 -0
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +276 -19
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +23 -0
- package/node_modules/@kardalum/plugin-package/dist/contract-fingerprint.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/contract-fingerprint.js +39 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/admin-styles.d.ts +23 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/admin-styles.js +351 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.js +21 -8
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.js +23 -10
- package/node_modules/@kardalum/plugin-package/dist/delivery/icons.js +3 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +30 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.js +6 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.d.ts +6 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.js +6 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/providers.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/providers.js +24 -6
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +15 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/rich-text.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/rich-text.js +173 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.js +14 -4
- package/node_modules/@kardalum/plugin-package/dist/delivery/services-events.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/services-events.js +35 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/sign-in-steps.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/sign-in-steps.js +71 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.js +44 -11
- package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +7 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/user-accounts.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/user-accounts.js +36 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/visitor-points.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/visitor-points.js +33 -0
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +4 -0
- package/node_modules/@kardalum/plugin-package/dist/index.js +5 -0
- package/node_modules/@kardalum/plugin-package/dist/public-suffix.d.ts +7 -0
- package/node_modules/@kardalum/plugin-package/dist/public-suffix.js +23 -0
- package/node_modules/@kardalum/plugin-package/dist/rich-text-summary.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/rich-text-summary.js +27 -0
- package/node_modules/@kardalum/plugin-package/dist/stylesheet-load-hook.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/stylesheet-load-hook.js +28 -0
- package/node_modules/@kardalum/plugin-package/package.json +4 -0
- package/node_modules/@kardalum/ui/dist/components/select.d.ts +6 -0
- package/node_modules/@kardalum/ui/dist/components/select.js +7 -0
- package/node_modules/@kardalum/ui/dist/components/textarea.d.ts +6 -0
- package/node_modules/@kardalum/ui/dist/components/textarea.js +7 -0
- package/node_modules/@kardalum/ui/dist/index.d.ts +2 -0
- package/node_modules/@kardalum/ui/dist/index.js +2 -0
- package/package.json +15 -3
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,76 @@ Subpaths are noted per entry. `.` is the package index; `./manifest` is the
|
|
|
8
8
|
server-safe manifest contract subpath, which pulls in no React and no
|
|
9
9
|
`@kardalum/ui`.
|
|
10
10
|
|
|
11
|
+
## 0.21.0
|
|
12
|
+
|
|
13
|
+
Plugins may change the HTML of the pages Kardalum renders and write inline code into the page head (month 35, session P1). Both points are experimental: they may change before they come under the version 1 promise.
|
|
14
|
+
|
|
15
|
+
Plugins may guard every public request before it is answered, add security headers to every public answer, and check a signature over a form post's exact bytes (month 35, session P2). The two new keys and the site route `rawBody` are experimental.
|
|
16
|
+
|
|
17
|
+
Plugins may read content widely (session C1). Every point month 35 adds is experimental; the list is `EXPERIMENTAL_POINTS` in `@kardalum/api-schemas`.
|
|
18
|
+
|
|
19
|
+
User accounts for plugins and the permission question (M35 U1). Every point below is experimental: it may still change before version 1, when the plugin interface starts to only grow.
|
|
20
|
+
|
|
21
|
+
Guards and eleven new hook events (M35 B2). Every point below is experimental: it may still change before version 1, when the plugin interface starts to only grow.
|
|
22
|
+
|
|
23
|
+
Content list and tree slots, and panels in core screens (35-C2). Every point below is experimental: it may still change before version 1, when the plugin interface starts to only grow.
|
|
24
|
+
|
|
25
|
+
Plugins working together (M35 B1a): versioned service contracts, calls through the core, and plugin events. Experimental.
|
|
26
|
+
|
|
27
|
+
Site visitor accounts (M35 U2a). Every point below is experimental: it may still change before version 1, when the plugin interface starts to only grow.
|
|
28
|
+
|
|
29
|
+
Building for another plugin (M35 B1c): the author's tools for contracts. Experimental.
|
|
30
|
+
|
|
31
|
+
M35 B3 (experimental): `uploads` on POST, PUT and PATCH API routes and POST site routes; `request.files` and `context.uploads` (`bytes`, `keep`) on those routes.
|
|
32
|
+
|
|
33
|
+
### Added
|
|
34
|
+
|
|
35
|
+
- Experimental (M35 P5): `consentTools`, a consent tool the site owner chooses as the site's one consent banner; capability `provider.consent`.
|
|
36
|
+
- Experimental (M35 P5): `@kardalum/plugin-sdk/consent` (`readConsent`, `kardalumConsent`, the categories and the API type), `consent` on `PageHeadContext` and `TemplateCallContext`, and `consent` on a `script` or `inlineScript` page head entry and on a held embed.
|
|
37
|
+
- `./testing` and `./manifest` (M35 B1c). Added (experimental): `@kardalum/plugin-sdk/testing` with `serviceHarness`, `fakeProvider` and `sampleInput`; `providersUse` on a service contract.
|
|
38
|
+
- `./manifest`: `contributions.pageOutput` (`PageOutputContribution`, `PageOutputContext`), a transform run after a public page is rendered, in plugin id order, within `PAGE_OUTPUT_TIME_MS` (100) each and `PAGE_OUTPUT_TIME_PER_RENDER_MS` (250) a render, at most `PAGE_OUTPUT_TRANSFORMS_MAX` (8) a render, on pages of at most `PAGE_OUTPUT_INPUT_MAX_BYTES`, an answer adding at most `PAGE_OUTPUT_GROWTH_MAX_BYTES`. It derives `render.pageOutput`, a promised capability. Experimental.
|
|
39
|
+
- `./manifest`: `pageHead.inlineSnippets: true` and the head entries `{ tag: "inlineScript", text, module? }` and `{ tag: "inlineStyle", text, media? }`, at most `PAGE_HEAD_INLINE_SNIPPETS_MAX` (4) a plugin and `PAGE_HEAD_INLINE_TEXT_MAX_BYTES` (16,384) each, checked by `inlineSnippetProblem`. The page head's install line notes "writes its own code into every page". Experimental.
|
|
40
|
+
- `./text`: `rewriteStartTags`, a one-pass start tag rewriter for transforms, with `HTML_REWRITE_INPUT_MAX`, `HTML_REWRITE_TAGS_MAX`, `HTML_TAG_ATTRIBUTES_MAX`, `HTML_ATTRIBUTE_NAME_MAX` and the types `HtmlAttribute`, `HtmlStartTag`, `HtmlStartTagChange` and `RewriteStartTagsOptions`. Experimental.
|
|
41
|
+
- `./manifest`: `contributions.requestGuard` (`RequestGuardContribution`, `SiteRequest`, `SiteRequestContext`, `RequestGuardAnswer`), asked before anything answers a request for the site's own addresses, `/media/` or `/api/v1/`, at most `REQUEST_GUARDS_MAX` (4) a request within `REQUEST_GUARD_TIME_MS` (50) each and `REQUEST_GUARD_TIME_PER_REQUEST_MS` (100) together; a block is one of `REQUEST_GUARD_BLOCK_STATUSES`. A failing guard lets the request through. Derives `site.requestGuard`, a promised capability. Experimental.
|
|
42
|
+
- `./manifest`: `contributions.responseHeaders` (`ResponseHeadersContribution`, `SiteResponse`), headers from `RESPONSE_HEADER_NAMES` on the same answers, with the inline snippet hashes a policy needs; at most `RESPONSE_HEADERS_PER_PLUGIN_MAX` (8) names, values checked by `responseHeaderValueProblem`. Derives `site.responseHeaders`. Experimental.
|
|
43
|
+
- `./manifest`: `rawBody: true` takes a form-encoded body on an API route, and a POST site route may declare it (`siteRoutes[].rawBody`, experimental), with the exact bytes of a JSON, text or form body.
|
|
44
|
+
- `.` and `./manifest`: BREAKING for code that builds a `PluginServerContextBase` or a `PluginApiRouteContext` itself (a test's fake hook, task or route context) (35-C1, experimental). The context gains two required members: `listPublished(opts)`, published pages sorted (`published`, `order`, `_tree` or a field) and filtered by field values, a cursor at a time, answering `{ items, nextCursor, scanCapped }`; and `searchPublished(opts)`, the delivery search by text, answering `{ items, nextCursor }`. Both are open to every plugin. A fake adds both members.
|
|
45
|
+
- `./manifest`: BREAKING for code that builds a `PluginContentLibrary` itself (a test's fake `context.content`) (35-C1, experimental). The library gains a required `walk({ under?, after?, limit? })`: the pages below a page in the tree's order, drafts included, up to `CONTENT_WALK_LIMIT_MAX` at a time. A fake adds the member.
|
|
46
|
+
- `./manifest`: `contributions.contentAccess` takes one `{ allContent: true, actions: ["content.read"] }` entry (35-C1, experimental): it reads every page, the top level and drafts included, never writes, and is the only entry that lets `walk` start at the top level.
|
|
47
|
+
- `.` and `./manifest`: the types `ListPublishedOptions`, `PublishedFilter`, `PublishedListItem`, `PublishedListPage`, `PublishedSearchPage` and `SearchPublishedOptions`, and the constants `PUBLISHED_QUERY_LIMIT_MAX`, `PUBLISHED_QUERY_SCAN_MAX`, `PUBLISHED_QUERY_WHERE_MAX`, `PUBLISHED_QUERY_IN_MAX` and `PUBLISHED_QUERY_VALUE_MAX`, all defined once in `@kardalum/api-schemas`.
|
|
48
|
+
- `./manifest` and `.`, experimental: `contributions.userAccess` (`PluginUserAccess` in `@kardalum/api-schemas`, `{ actions }`, 1 to 3 of `users.read`, `users.update` and `roles.read` from `PLUGIN_USER_ACCESS_ACTIONS`, each once, `users.update` only with `users.read`), deriving the mediated capability `users.access`. It gives route, site route and scheduled task contexts `context.users` (`PluginUserLibrary`: `list`, `get`, `setRole`, `listRoles`, answering `PluginUserPage` and `PluginRolePage`), acting as the plugin through the management user routes. `setRole` moves a person only between Editor and the roles the plugin offered and the site accepted, never to or from a role that manages the site (403 `plugin_role_refused`). A call outside the declaration throws `UserAccessRefusedError` (narrow it with `isUserAccessRefusedError`); a hook's context has no `users`.
|
|
49
|
+
- `./manifest` and `.`, experimental: `contributions.userFields` (`PluginUserField[]`, at most `PLUGIN_USER_FIELDS_MAX`, 16, fields of the plugin settings field types other than `secret`, never `askAtInstall`), deriving the mediated capability `users.fields`. Route, site route, hook and scheduled task contexts get `context.userFields` (`PluginUserFields`: `get(userId)` answers every declared field with its stored value or its default, or `null` for an unknown account; `set(userId, values)` checks and merges, throws `TypeError` for a wrong value and answers `false` for an unknown account). The values are shown and changed on the person's Details in the admin, go with a deleted account, and are kept in an uninstall's snapshot.
|
|
50
|
+
- `./manifest`, experimental: `PluginApiRouteContext` gains the optional `can(action)` and `canAccessPage(pageId, "read" | "edit")`, on `admin` and `apiKey` routes: the core's one permission gate answers for the caller. `can` takes a core action or one of the plugin's own and throws `TypeError` for any other; `canAccessPage` answers `false` for a missing or trashed page. Both are optional, so a test's hand-built route context needs no change.
|
|
51
|
+
- `.`, experimental: `usePluginCan(action)`, a view hook answering whether the signed-in person holds a core action or one of the plugin's own (another plugin's throws `TypeError`; `false` outside the admin's provider), with `PluginPermissionsProvider` (and the `PluginPermissions` type) for tests and `isAskableAction`, the one rule both use.
|
|
52
|
+
- `kardalum plugin validate` and the marketplace: the 43rd delivery check, `user accounts`, checks both declarations.
|
|
53
|
+
- Templates, experimental: `{% form_protection "<plugin id>" %}` names the plugin whose route receives the form, so the widget of the form protection the site owner chose for that plugin is drawn; `context.protectionWidget()` answers the route's own plugin's choice. A provider's `verify` is unchanged: it already receives `formPlugin`.
|
|
54
|
+
- `./manifest`, experimental: `contributions.guards`, at most one guard per point in `GUARD_POINTS` (`content:beforeSave`, `content:beforePublish`, `content:beforeUnpublish`, `content:beforeMove`, `content:beforeTrash`, `content:beforeRestore`), each with an optional `documentTypes` list and an `onFailure` of `refuse` (the default) or `allow`. The server asks every listening guard at once, waits at most `GUARD_TIME_MS` (2,000), and answers the first refusal in plugin id order with 409 `plugin_refused`. A handler receives the request and a `PluginGuardContext` (the server context with a `signal` aborted at the time limit, and `outbound` for a plugin that declares `outboundRequests`) and answers a `GuardAnswer`: `{ allow: true }`, or a refusal with a snake_case `code` and a `message`. A guard never changes what is saved. It derives `server.guard`, a promised capability.
|
|
55
|
+
- `./manifest` and `.`, experimental: eleven new hook events, so `HOOK_EVENTS` now lists 30: `content:afterSort`, `content:afterAccessChange`, `documentType:afterChange`, `dataType:afterChange`, `role:afterChange`, `user:afterChange`, `site:afterAddressChange`, `site:afterPageViews`, `system:afterStart`, `system:beforeShutdown` and `system:afterError`.
|
|
56
|
+
- `./manifest`, experimental: `ContentMoveHookPayload.previousAddresses`, where the moved page's places were before the move. It is left out (absent) when the site has more than `EVENT_ADDRESSES_MAX` (64) languages.
|
|
57
|
+
- `./manifest` and `.`, experimental: `system:beforeShutdown` is never durable, because its moment is gone after a restart; `NON_DURABLE_HOOK_EVENTS` lists it, and a manifest that declares it `durable` is refused.
|
|
58
|
+
- `./manifest` and `.`, experimental: `site:afterPageViews` (`SitePageViewsHookPayload`, with `PageViewCount` per page), one event for the page views of each `PAGE_VIEW_BATCH_MS` (10,000) window, itemising at most `PAGE_VIEW_BATCH_PAGES_MAX` (500) pages; `SYSTEM_ERROR_EVENTS_PER_MINUTE` (30) limits `system:afterError`.
|
|
59
|
+
- `./manifest` and `.`, experimental (35-C2): `contributions.contentColumns` (`ContentColumnContribution`, at most `CONTENT_COLUMNS_MAX`, 3, a plugin) and `contributions.treeBadges` (`TreeBadgeContribution`, at most `TREE_BADGES_MAX`, 1), each `{ id, label, action, documentTypes?, values(input, context) }`, deriving `admin.contentColumn` and `admin.treeBadge`. The core calls `values` with one page of at most `CONTENT_SLOT_ROWS_MAX` (50) rows (`ContentSlotInput`: frozen `ContentSlotRow`s `{ id, path, name, parentId, documentTypeId, documentType, culture }`, the `culture` and the admin's `language`) and a `PluginContentSlotContext` (the server context with a `signal`), within `CONTENT_SLOT_CALL_TIME_MS` (1,000); it answers row id to text (cut at `CONTENT_COLUMN_TEXT_MAX`, 80) or to `{ text, tone }` (cut at `TREE_BADGE_TEXT_MAX`, 24, `tone` one of `BADGE_TONES`). A throw, an answer out of shape or the time limit answers that slot failed, never the others.
|
|
60
|
+
- `./manifest` and `.`, experimental (35-C2): `contributions.listFilters` (`ListFilterContribution`, at most `LIST_FILTERS_MAX`, 2), `{ id, label, action, documentTypes?, options, match(input, context) }`, deriving `admin.listFilter`: 1 to `LIST_FILTER_OPTIONS_MAX` (12) options, each a value and a label, and a `match` handed `ListFilterInput` (the rows and the chosen `value`) that answers the matching ids, an array of at most `LIST_FILTER_ANSWER_MAX` (200). A filtered Content List reads the children in their order and stops at `CONTENT_LIST_FILTER_SCAN_MAX` (500) rows or after `CONTENT_LIST_FILTER_TIME_MS` (3,000), answering `scanCapped`; a failed `match` answers 503 `list_filter_unavailable`.
|
|
61
|
+
- `./manifest` and `.`, experimental (35-C2): `contributions.bulkActions` (`BulkActionContribution`, at most `BULK_ACTIONS_MAX`, 3), `{ id, label, action, documentTypes?, view }`, deriving `admin.bulkAction`: a button over the Content List table while rows are selected, at most `BULK_ACTION_ROWS_MAX` (100). The view reads `{ rows, close(result?) }` through `usePluginBulkAction()` (`BulkActionContext`, `BulkActionRow`; `BulkActionProvider` for tests).
|
|
62
|
+
- `./manifest` and `.`, experimental (35-C2): `contributions.adminSlots` (`AdminSlotContribution`, at most `ADMIN_SLOTS_MAX`, 8, a plugin and `ADMIN_SLOTS_PER_PLACE_MAX`, 2, in one place), `{ id, slot, label, action, view, icon? }`, deriving `admin.slot`. `slot` is one of `ADMIN_SLOT_PLACES`: `topBar.item` (a top bar button that opens the view in a dialog; it needs an `icon`), `users.panel`, `account.panel`, `documentType.panel` and `media.panel`. The view reads its place through `usePluginAdminSlot()` (`AdminSlotContext`, with `AdminSlotUser`, `AdminSlotDocumentType` and `AdminSlotMedia`; `AdminSlotProvider` for tests).
|
|
63
|
+
- `kardalum plugin validate` and the marketplace, experimental (35-C2): the `editor extensions` check counts and checks the five keys (ids, counts, `documentTypes`, a filter's options and their labels, a slot's place), and `icon names` checks a `topBar.item` icon.
|
|
64
|
+
- `.`: BREAKING for code that switches over every `PluginScreenContext["slot"]` kind (35-C2, experimental). The union gains `{ kind: "bulkAction", actionId }` and `{ kind: "adminSlot", slotId, place }`, so an exhaustive switch (one ending in a `never` check) no longer compiles until it adds both cases. A view that reads only its own kind is unchanged.
|
|
65
|
+
- `@kardalum/api-schemas`: BREAKING for code that builds a `ContentListRow` itself (a test's fake row of `GET /api/manage/v1/content/:id/list`) (35-C2, experimental). Each row gains the required `path`, `documentTypeId` and `childCount`, as a tree row carries them. The list query gains the optional `filter`, `filterValue` and `culture`, and the answer the optional `scanCapped`. A fake row adds the three members.
|
|
66
|
+
- `./manifest` and `.`, experimental: `serviceContracts`, `usedServices`, `events` and the new shape of `exposedServices`; `context.services` and `context.events`; plugin event hook keys; `contractMethod`, `personal`, `pageIdSchema`, `toContractSchema`. The limits are the `SERVICE_*` and `PLUGIN_EVENT_*` constants of `@kardalum/api-schemas` (`plugin-services.ts`); `kardalum plugin validate` and the marketplace check the declarations as the 44th delivery check, `services and events`.
|
|
67
|
+
- `./manifest`, experimental: `UserChangeHookPayload.change` gains `"fields"`, and the payload gains `pluginId` (the plugin whose account fields changed, `null` otherwise) and `fieldIds` (the changed field ids, sorted, `[]` otherwise), never a value. `user:afterChange` is raised for a change of a plugin's account fields too, from the fields route and from `context.userFields.set` (`actorId` `null`). A handler that switches over `change` handles the new value.
|
|
68
|
+
- Experimental (M35 P3): site routes with `:name` parameters, a last `*` and clean `GET` addresses, answered after the pages, with `schema.params` and `context.address`; block template tags (`block: true`, `keepBody` answers, `onFailure`); `onFailure` on template filters; `getPublishedContent`, `listPublished`, `searchPublished`, `pageAddresses` and `publicMediaUrl` on `TemplateCallContext`, with `TemplateReadRefusedError`.
|
|
69
|
+
- `./manifest`: BREAKING for code that builds a `TemplateCallContext` itself (a test's fake tag or filter context) (M35 P3, experimental). The context gains the five required readers above. A fake adds them, or casts the literal as the first-party plugins' tests do.
|
|
70
|
+
- `./manifest`: `contributions.pageCache` (`PageCacheContribution`, `PageCachePage`, `PageCacheAnswer`) and `contributions.pageGate` (`PageGateContribution`, `PageGatePage`), derive `render.pageCache` and `site.pageGate`; `context.renderPage` (`PluginRenderPage`, `RenderPageRefusedError`) and `context.renderCache` (`PluginRenderCache`) on hook, task and route contexts; `PublishedContent.rendered`. Experimental.
|
|
71
|
+
- `./manifest`: BREAKING for code that builds a `PublishedContent` itself (a test's fake `getPublishedContent`) (M35 P4, experimental). The answer gains the required `rendered: boolean | null`. A fake adds `rendered: null`.
|
|
72
|
+
- `./manifest` and `.`: `AuditActorKind` (and so `HookActor.actorKind` and the `audit:afterRecord` payload's `actorKind`) gains `visitor`, an entry recorded for a site visitor's own account action; `SettingsChangeArea` gains `visitorAccounts`. A handler that switches over either handles the new value.
|
|
73
|
+
- `richTextExtensions` (experimental): rich text items with no plugin code in the editor. A named constant for every built-in editor id.
|
|
74
|
+
- `.` and `./manifest`, experimental (M35 C4b): a rich text node or mark may bring its own `view`, shown in the item's side panel instead of the core form (both mounts), hosted by the admin with the plugin's providers and an error boundary. The view reads and writes the item through `useRichTextItem()` (`RichTextItemContext`: `plugin`, `name`, `version`, a frozen `data`, `text`, `culture`, `readOnly`, `setData(next, { text?, version? })`, `close()`); every write is checked against the declaration first and answers `RichTextWriteResult` (`readOnly`, `invalid`, `tooLarge`, `notOwnItem` or `gone` when refused, changing nothing). manifest.json writes a view as `hasView: true`. A node may declare the `json` attribute type and `textFromView` when it has a view. `PluginScreenContext.slot` gains `{ kind: "richTextItem", itemName }` and `{ kind: "richTextButton", buttonId }`: BREAKING for an exhaustive switch over the slot kinds.
|
|
75
|
+
- `.` and `./manifest`, experimental (M35 C4b): a rich text toolbar button may open the plugin's own tool in a dialog (`does: { view, action }`), offered only to a person who holds the plugin-prefixed action. The tool reads and changes the text through `useRichTextEditorHandle()` (`RichTextEditorHandle`: `selection`, a frozen `document` in which another plugin's editorial items carry no data, `culture`, `readOnly`, `insertItem`, `setMark`, `unsetMark`, `insertText`, `insertContent`, `setLink`, `close`): each write is one transaction, judged by the document's shape check before it is applied, and touches only the plugin's own items and marks. Closing the dialog returns focus to the button.
|
|
76
|
+
|
|
77
|
+
### Changed
|
|
78
|
+
|
|
79
|
+
- `./manifest`, experimental: `exposedServices` takes `{ contract, version, label, implementation }` (the opaque `{ id, name, service }` form is gone; nothing used it).
|
|
80
|
+
|
|
11
81
|
## 0.20.0
|
|
12
82
|
|
|
13
83
|
The built-in views follow the admin's language and direction.
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentType } from "react";
|
|
2
|
+
import type { AdminSlotPlace } from "@kardalum/api-schemas";
|
|
3
|
+
import type { AdminSectionContribution, AdminSlotContribution, BuiltInRailEntryContribution, BuiltInRailSection, BulkActionContribution, ContentColumnContribution, DashboardWidgetContribution, EditorPanelContribution, ListFilterContribution, PluginManifest, TreeActionContribution, TreeBadgeContribution } from "./manifest.js";
|
|
4
|
+
/** @internal M35 C4b (design D15, D16): a plugin's rich text node, mark or button view, registered from its live manifest. */
|
|
5
|
+
export interface RegisteredRichTextView {
|
|
6
|
+
pluginId: string;
|
|
7
|
+
kind: "node" | "mark" | "button";
|
|
8
|
+
name: string;
|
|
9
|
+
view: ComponentType;
|
|
10
|
+
/** A button view's action; null for an item's or a mark's view, which the right to edit the page gates. */
|
|
11
|
+
action: string | null;
|
|
12
|
+
}
|
|
13
|
+
/** @internal Whether a live richTextExtensions declares any view. */
|
|
14
|
+
export declare function richTextDeclaresViews(contributions: PluginManifest["contributions"]): boolean;
|
|
2
15
|
/** @internal A section in the host's registry, with the plugin it came from. */
|
|
3
16
|
export interface RegisteredSection {
|
|
4
17
|
pluginId: string;
|
|
@@ -25,6 +38,11 @@ export interface RegisteredTreeAction {
|
|
|
25
38
|
pluginId: string;
|
|
26
39
|
action: TreeActionContribution;
|
|
27
40
|
}
|
|
41
|
+
/** @internal A content slot or an admin slot in the host's registry, with its plugin (M35 C2). */
|
|
42
|
+
export interface RegisteredEntry<T> {
|
|
43
|
+
pluginId: string;
|
|
44
|
+
entry: T;
|
|
45
|
+
}
|
|
28
46
|
/**
|
|
29
47
|
* Register every slot a plugin's manifest declares: its top-level sections
|
|
30
48
|
* (each with its own rail), its rail entries in built-in sections and its
|
|
@@ -35,6 +53,10 @@ export interface RegisteredTreeAction {
|
|
|
35
53
|
* @internal Host-only: the admin calls it with a validated manifest.
|
|
36
54
|
*/
|
|
37
55
|
export declare function registerPluginSlots(pluginId: string, manifest: PluginManifest): void;
|
|
56
|
+
/** @internal M35 C4b: one plugin's rich text view of a kind and a name (a node's or a mark's name, a button's id). */
|
|
57
|
+
export declare function getRichTextView(pluginId: string, kind: RegisteredRichTextView["kind"], name: string): RegisteredRichTextView | undefined;
|
|
58
|
+
/** @internal M35 C4b: every registered rich text view, in registration order. A copy. */
|
|
59
|
+
export declare function listRichTextViews(): RegisteredRichTextView[];
|
|
38
60
|
/** @internal Host-only lookup of one plugin's section by its id. */
|
|
39
61
|
export declare function getPluginSection(pluginId: string, sectionId: string): RegisteredSection | undefined;
|
|
40
62
|
/** @internal Every registered plugin section, in registration order. A
|
|
@@ -53,6 +75,16 @@ export declare function listDashboardWidgets(): RegisteredDashboardWidget[];
|
|
|
53
75
|
export declare function listEditorPanels(): RegisteredEditorPanel[];
|
|
54
76
|
/** @internal Every registered tree action, sorted like listEditorPanels. A copy. */
|
|
55
77
|
export declare function listTreeActions(): RegisteredTreeAction[];
|
|
78
|
+
/** @internal Every registered content list column, sorted like listEditorPanels (M35 C2). A copy. */
|
|
79
|
+
export declare function listContentColumns(): RegisteredEntry<ContentColumnContribution>[];
|
|
80
|
+
/** @internal Every registered tree badge, sorted like listEditorPanels (M35 C2). A copy. */
|
|
81
|
+
export declare function listTreeBadges(): RegisteredEntry<TreeBadgeContribution>[];
|
|
82
|
+
/** @internal Every registered list filter, sorted like listEditorPanels (M35 C2). A copy. */
|
|
83
|
+
export declare function listListFilters(): RegisteredEntry<ListFilterContribution>[];
|
|
84
|
+
/** @internal Every registered bulk action, sorted like listEditorPanels (M35 C2). A copy. */
|
|
85
|
+
export declare function listBulkActions(): RegisteredEntry<BulkActionContribution>[];
|
|
86
|
+
/** @internal The admin slots of one place, sorted by plugin id then declaration order (M35 C2). A copy. */
|
|
87
|
+
export declare function listAdminSlots(place: AdminSlotPlace): RegisteredEntry<AdminSlotContribution>[];
|
|
56
88
|
/** @internal Clears every registered slot and plugin id. Tests only: the
|
|
57
89
|
* admin registers once per page load. */
|
|
58
90
|
export declare function resetPluginSlotsForTests(): void;
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
+
const richTextViews = [];
|
|
2
|
+
/** @internal Whether a live richTextExtensions declares any view. */
|
|
3
|
+
export function richTextDeclaresViews(contributions) {
|
|
4
|
+
const rich = contributions.richTextExtensions;
|
|
5
|
+
return (rich?.nodes ?? []).some((node) => node.view !== undefined) || (rich?.marks ?? []).some((mark) => mark.view !== undefined) || (rich?.buttons ?? []).some((button) => "view" in button.does);
|
|
6
|
+
}
|
|
1
7
|
const registeredPlugins = new Set();
|
|
2
8
|
const sections = [];
|
|
3
9
|
const railEntries = [];
|
|
4
10
|
const dashboardWidgets = [];
|
|
5
11
|
const editorPanels = [];
|
|
6
12
|
const treeActions = [];
|
|
13
|
+
const contentColumns = [];
|
|
14
|
+
const treeBadges = [];
|
|
15
|
+
const listFilters = [];
|
|
16
|
+
const bulkActions = [];
|
|
17
|
+
const adminSlots = [];
|
|
7
18
|
/**
|
|
8
19
|
* Register every slot a plugin's manifest declares: its top-level sections
|
|
9
20
|
* (each with its own rail), its rail entries in built-in sections and its
|
|
@@ -33,6 +44,36 @@ export function registerPluginSlots(pluginId, manifest) {
|
|
|
33
44
|
for (const action of manifest.contributions.treeActions ?? []) {
|
|
34
45
|
treeActions.push({ pluginId, action });
|
|
35
46
|
}
|
|
47
|
+
// M35 C2 (W5, W26): content list columns, tree badges, list filters, bulk actions and admin slots.
|
|
48
|
+
for (const entry of manifest.contributions.contentColumns ?? [])
|
|
49
|
+
contentColumns.push({ pluginId, entry });
|
|
50
|
+
for (const entry of manifest.contributions.treeBadges ?? [])
|
|
51
|
+
treeBadges.push({ pluginId, entry });
|
|
52
|
+
for (const entry of manifest.contributions.listFilters ?? [])
|
|
53
|
+
listFilters.push({ pluginId, entry });
|
|
54
|
+
for (const entry of manifest.contributions.bulkActions ?? [])
|
|
55
|
+
bulkActions.push({ pluginId, entry });
|
|
56
|
+
for (const entry of manifest.contributions.adminSlots ?? [])
|
|
57
|
+
adminSlots.push({ pluginId, entry });
|
|
58
|
+
// M35 C4b (design D15, D16): rich text item, mark and button views.
|
|
59
|
+
const rich = manifest.contributions.richTextExtensions;
|
|
60
|
+
for (const node of rich?.nodes ?? [])
|
|
61
|
+
if (node.view)
|
|
62
|
+
richTextViews.push({ pluginId, kind: "node", name: node.name, view: node.view, action: null });
|
|
63
|
+
for (const mark of rich?.marks ?? [])
|
|
64
|
+
if (mark.view)
|
|
65
|
+
richTextViews.push({ pluginId, kind: "mark", name: mark.name, view: mark.view, action: null });
|
|
66
|
+
for (const button of rich?.buttons ?? [])
|
|
67
|
+
if ("view" in button.does)
|
|
68
|
+
richTextViews.push({ pluginId, kind: "button", name: button.id, view: button.does.view, action: button.does.action });
|
|
69
|
+
}
|
|
70
|
+
/** @internal M35 C4b: one plugin's rich text view of a kind and a name (a node's or a mark's name, a button's id). */
|
|
71
|
+
export function getRichTextView(pluginId, kind, name) {
|
|
72
|
+
return richTextViews.find((entry) => entry.pluginId === pluginId && entry.kind === kind && entry.name === name);
|
|
73
|
+
}
|
|
74
|
+
/** @internal M35 C4b: every registered rich text view, in registration order. A copy. */
|
|
75
|
+
export function listRichTextViews() {
|
|
76
|
+
return [...richTextViews];
|
|
36
77
|
}
|
|
37
78
|
/** @internal Host-only lookup of one plugin's section by its id. */
|
|
38
79
|
export function getPluginSection(pluginId, sectionId) {
|
|
@@ -66,6 +107,26 @@ export function listEditorPanels() {
|
|
|
66
107
|
export function listTreeActions() {
|
|
67
108
|
return sortedByPlugin(treeActions);
|
|
68
109
|
}
|
|
110
|
+
/** @internal Every registered content list column, sorted like listEditorPanels (M35 C2). A copy. */
|
|
111
|
+
export function listContentColumns() {
|
|
112
|
+
return sortedByPlugin(contentColumns);
|
|
113
|
+
}
|
|
114
|
+
/** @internal Every registered tree badge, sorted like listEditorPanels (M35 C2). A copy. */
|
|
115
|
+
export function listTreeBadges() {
|
|
116
|
+
return sortedByPlugin(treeBadges);
|
|
117
|
+
}
|
|
118
|
+
/** @internal Every registered list filter, sorted like listEditorPanels (M35 C2). A copy. */
|
|
119
|
+
export function listListFilters() {
|
|
120
|
+
return sortedByPlugin(listFilters);
|
|
121
|
+
}
|
|
122
|
+
/** @internal Every registered bulk action, sorted like listEditorPanels (M35 C2). A copy. */
|
|
123
|
+
export function listBulkActions() {
|
|
124
|
+
return sortedByPlugin(bulkActions);
|
|
125
|
+
}
|
|
126
|
+
/** @internal The admin slots of one place, sorted by plugin id then declaration order (M35 C2). A copy. */
|
|
127
|
+
export function listAdminSlots(place) {
|
|
128
|
+
return sortedByPlugin(adminSlots).filter((registered) => registered.entry.slot === place);
|
|
129
|
+
}
|
|
69
130
|
// Array.prototype.sort is stable, so declaration order (registration order) holds within one plugin.
|
|
70
131
|
function sortedByPlugin(list) {
|
|
71
132
|
return [...list].sort((a, b) => (a.pluginId < b.pluginId ? -1 : a.pluginId > b.pluginId ? 1 : 0));
|
|
@@ -79,4 +140,10 @@ export function resetPluginSlotsForTests() {
|
|
|
79
140
|
dashboardWidgets.length = 0;
|
|
80
141
|
editorPanels.length = 0;
|
|
81
142
|
treeActions.length = 0;
|
|
143
|
+
contentColumns.length = 0;
|
|
144
|
+
treeBadges.length = 0;
|
|
145
|
+
listFilters.length = 0;
|
|
146
|
+
bulkActions.length = 0;
|
|
147
|
+
adminSlots.length = 0;
|
|
148
|
+
richTextViews.length = 0;
|
|
82
149
|
}
|
package/dist/capabilities.js
CHANGED
|
@@ -37,6 +37,11 @@ export const CAPABILITY_LABELS = {
|
|
|
37
37
|
"admin.dashboardWidget": { operator: "Dashboard widgets", shopper: "Adds dashboard widgets" },
|
|
38
38
|
"admin.editorPanel": { operator: "Editor panels", shopper: "Adds panels to the page editor" },
|
|
39
39
|
"admin.treeAction": { operator: "Tree actions", shopper: "Adds actions to the content tree" },
|
|
40
|
+
"admin.contentColumn": { operator: "Content list columns", shopper: "Adds columns to content lists" },
|
|
41
|
+
"admin.treeBadge": { operator: "Content tree badges", shopper: "Adds badges to rows of the content tree" },
|
|
42
|
+
"admin.listFilter": { operator: "Content list filters", shopper: "Adds filters to content lists" },
|
|
43
|
+
"admin.bulkAction": { operator: "Bulk actions", shopper: "Adds actions for several selected pages" },
|
|
44
|
+
"admin.slot": { operator: "Panels in core screens", shopper: "Adds panels and buttons to the admin's own screens" },
|
|
40
45
|
"admin.notifications": {
|
|
41
46
|
operator: "Notifications",
|
|
42
47
|
shopper: "Sends notifications of the kinds it lists, each to the people the kind names.",
|
|
@@ -45,19 +50,36 @@ export const CAPABILITY_LABELS = {
|
|
|
45
50
|
"render.asset": { operator: "Editable assets", shopper: "Ships editable assets" },
|
|
46
51
|
"theme.tokens": { operator: "Theme tokens", shopper: "Restyles the admin" },
|
|
47
52
|
"server.hook": { operator: "Lifecycle hooks", shopper: "Reacts to events on your site: the ones listed" },
|
|
53
|
+
"server.guard": { operator: "Write guards", shopper: "Can refuse saving, publishing, moving or deleting pages: at the points listed" },
|
|
48
54
|
"server.scheduledTask": { operator: "Scheduled tasks", shopper: "Runs work on a schedule" },
|
|
49
55
|
"media.processor": { operator: "Media processors", shopper: "Processes uploaded media" },
|
|
50
56
|
"api.serializer": { operator: "Response extensions", shopper: "Extends content API responses" },
|
|
51
57
|
"api.route.admin": { operator: "Admin API routes", shopper: "Adds admin-only API routes" },
|
|
52
58
|
"api.route.apiKey": { operator: "API-key routes", shopper: "Adds API-key routes" },
|
|
53
59
|
"api.route.public": { operator: "Public API routes", shopper: "Adds routes anyone can call" },
|
|
54
|
-
|
|
60
|
+
// M35 B1a (W16)
|
|
61
|
+
"service.contract": { operator: "Service contracts", shopper: "Lets other plugins offer and use services it defines: the ones listed" },
|
|
62
|
+
"service.offer": { operator: "Services offered", shopper: "Offers services to other plugins: the ones listed" },
|
|
63
|
+
"service.use": { operator: "Services used", shopper: "Calls services other plugins offer: the ones listed" },
|
|
64
|
+
"event.raise": { operator: "Plugin events", shopper: "Tells other plugins when something happens: the events listed" },
|
|
55
65
|
"bundle.plugin": { operator: "Bundled plugins", shopper: "Installs other plugins with it" },
|
|
56
66
|
"content.access": { operator: "Content access", shopper: "Reads, creates or changes content of the types it names" },
|
|
57
67
|
// M32 F4c (D10)
|
|
58
68
|
"media.access": { operator: "Media access", shopper: "Reads every media file, private ones included, or adds media files" },
|
|
69
|
+
// M35 U1 (W6)
|
|
70
|
+
"users.access": { operator: "Account access", shopper: "Reads your admin users' accounts (names, email addresses, roles) or moves people between the roles it offers" },
|
|
71
|
+
"users.fields": { operator: "Account fields", shopper: "Keeps fields of its own on your admin users' accounts" },
|
|
72
|
+
// M35 U2b (W8)
|
|
73
|
+
"visitors.identify": { operator: "Visitor identity", shopper: "Knows which signed-in visitor of your site is reading, by name and groups" },
|
|
74
|
+
"visitors.groups": { operator: "Visitor groups", shopper: "Puts visitors into groups of its own and takes them out, such as paying members" },
|
|
75
|
+
"visitors.accountSections": { operator: "Account page sections", shopper: "Adds a section to your visitors' account page, such as their orders" },
|
|
76
|
+
"visitors.data": { operator: "Visitor data", shopper: "Keeps data about your visitors, which their data download and account deletion reach" },
|
|
59
77
|
"site.route": { operator: "Site addresses", shopper: "Answers at addresses of your site" },
|
|
60
78
|
"site.fallback": { operator: "Unclaimed addresses", shopper: "Answers addresses no page answers, for example with a redirect" },
|
|
79
|
+
// M35 P2 (W2)
|
|
80
|
+
"site.requestGuard": { operator: "Request guard", shopper: "Sees every visit to your site's pages, files and API before it is answered, and may refuse or redirect it" },
|
|
81
|
+
"site.responseHeaders": { operator: "Response headers", shopper: "Adds security and search engine headers to your site's answers, such as a content security policy" },
|
|
82
|
+
"site.pageGate": { operator: "Page gate", shopper: "Is asked before each page of your site is shown, and may redirect it or mark it as gone" },
|
|
61
83
|
"render.templateFilter": { operator: "Template filters", shopper: "Adds template filters" },
|
|
62
84
|
"render.templateTag": { operator: "Template tags", shopper: "Adds template tags" },
|
|
63
85
|
"render.pageHead": { operator: "Page head", shopper: "Adds tags to the head of every page, scripts only from the places it names" },
|
|
@@ -67,14 +89,22 @@ export const CAPABILITY_LABELS = {
|
|
|
67
89
|
"provider.mediaStore": { operator: "Media store", shopper: "Can store every uploaded file" },
|
|
68
90
|
// M32 H (H2, H19)
|
|
69
91
|
"provider.mail": { operator: "Mail sender", shopper: "Sends every email the site sends, password reset links included" },
|
|
92
|
+
"provider.consent": { operator: "Consent tool", shopper: "Can show your visitors a consent banner and keep which kinds of scripts and content they allow" },
|
|
70
93
|
// M33 K11
|
|
71
94
|
"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
95
|
"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
96
|
// M32 F4b (D48)
|
|
74
97
|
"provider.signIn": { operator: "Sign-in provider", shopper: "Can let people sign in to the admin, and vouches for who they are" },
|
|
98
|
+
// M35 U3a (D5)
|
|
99
|
+
"provider.signInStep": { operator: "Sign-in step", shopper: "Can stop people signing in to the admin, and asks them a second time who they are" },
|
|
75
100
|
secrets: { operator: "Secrets", shopper: "Keeps secret values you enter, encrypted" },
|
|
76
101
|
// M33 K42
|
|
77
102
|
"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" },
|
|
103
|
+
// M35 P1 (W3)
|
|
104
|
+
"render.pageOutput": { operator: "Page output", shopper: "Changes the HTML of every page after it is rendered, such as its links and images" },
|
|
105
|
+
"render.pageCache": { operator: "Page caching", shopper: "Tells caches and CDNs how long your pages may be kept, and labels them so they can be cleared" },
|
|
106
|
+
// M35 C4a (W9)
|
|
107
|
+
"content.richText": { operator: "Rich text items", shopper: "Adds items you can place in rich text, such as cards and highlights, which Kardalum draws and stores" },
|
|
78
108
|
// M33 K17
|
|
79
109
|
"secrets.sealedValues": { operator: "Sealed values", shopper: "Keeps secrets it makes, encrypted with your server's key" },
|
|
80
110
|
// M33 K16
|
|
@@ -107,6 +137,21 @@ export const CAPABILITY_NOTE_WORDS = {
|
|
|
107
137
|
embedKindContent: "content",
|
|
108
138
|
privacyNoticeAt: "privacy notice: {{value}}",
|
|
109
139
|
addsScript: "adds its own script to pages with a protected form",
|
|
140
|
+
inlineCode: "writes its own code into every page",
|
|
141
|
+
optionalUse: "optional",
|
|
142
|
+
carriesPersonalData: "its answers carry personal data",
|
|
143
|
+
takesFiles: "takes files sent to it ({{value}}); those it keeps are private in the media library",
|
|
144
|
+
richTextBlock: "a block",
|
|
145
|
+
richTextInline: "inside a sentence",
|
|
146
|
+
richTextWrapper: "a box around text",
|
|
147
|
+
richTextMark: "a mark on text",
|
|
148
|
+
richTextButtons: "{{value}} toolbar buttons",
|
|
149
|
+
// M35 C4b: an editorial item, a node made from pasted addresses, a button that opens a view.
|
|
150
|
+
richTextEditorial: "editorial, never on the public site",
|
|
151
|
+
richTextPasteHosts: "made from pasted addresses of {{value}}",
|
|
152
|
+
richTextButtonView: "opens a tool that reads and changes the text you are editing ({{value}})",
|
|
153
|
+
// M35 U2b: visitorIdentity with email: true.
|
|
154
|
+
readsVisitorEmail: "reads the email of signed-in visitors",
|
|
110
155
|
};
|
|
111
156
|
/**
|
|
112
157
|
* The heading a renderer puts in front of a capability's details.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ConsentState, type KardalumConsentApi } from "@kardalum/api-schemas";
|
|
2
|
+
export { CONSENT_CATEGORIES, CONSENT_COOKIE_NAME, CONSENT_COOKIE_SECURE_NAME, CONSENT_EVENT, CONSENT_MARK_ATTRIBUTE, CONSENT_MAX_AGE_DAYS_DEFAULT, CONSENT_MAX_AGE_DAYS_MAX, CONSENT_OPEN_ATTRIBUTE, CONSENT_OPEN_EVENT, CONSENT_REVISION_MAX, UNDECIDED_CONSENT, consentCookieName, isConsentCategory, type ConsentCategory, type ConsentChoice, type ConsentState, type KardalumConsentApi, type PluginConsentView, } from "@kardalum/api-schemas";
|
|
3
|
+
/** The visitor's consent as a Cookie header carries it. `secure`: whether the request came over https (the cookie is
|
|
4
|
+
* `__Host-kardalum_consent` there and `kardalum_consent` on plain http); left out, https. It reads the cookie only: it
|
|
5
|
+
* cannot tell whether a consent tool is chosen, which a page render honours (P5-D9). */
|
|
6
|
+
export declare function readConsent(cookieHeader: unknown, options?: {
|
|
7
|
+
secure?: boolean;
|
|
8
|
+
}): ConsentState;
|
|
9
|
+
/** The site's consent API in a visitor's browser, or null where the core's consent loader is not on the page (no tool
|
|
10
|
+
* chosen and nothing on the page waits for consent, an edit render, or code that runs on the server). */
|
|
11
|
+
export declare function kardalumConsent(): KardalumConsentApi | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// @experimental M35 P5 (W37): the `@kardalum/plugin-sdk/consent` subpath, the site's one consent state. No React, no DOM
|
|
2
|
+
// type, no node built-in: a plugin imports it in its server code (`readConsent` over the Cookie header its route or guard
|
|
3
|
+
// is handed) and in its browser code (`kardalumConsent()`, the API the core's consent loader defines), and its bundle
|
|
4
|
+
// carries it. The rules are the core's own, from the shared schemas.
|
|
5
|
+
import { consentOfCookieHeader } from "@kardalum/api-schemas";
|
|
6
|
+
export { CONSENT_CATEGORIES, CONSENT_COOKIE_NAME, CONSENT_COOKIE_SECURE_NAME, CONSENT_EVENT, CONSENT_MARK_ATTRIBUTE, CONSENT_MAX_AGE_DAYS_DEFAULT, CONSENT_MAX_AGE_DAYS_MAX, CONSENT_OPEN_ATTRIBUTE, CONSENT_OPEN_EVENT, CONSENT_REVISION_MAX, UNDECIDED_CONSENT, consentCookieName, isConsentCategory, } from "@kardalum/api-schemas";
|
|
7
|
+
/** The visitor's consent as a Cookie header carries it. `secure`: whether the request came over https (the cookie is
|
|
8
|
+
* `__Host-kardalum_consent` there and `kardalum_consent` on plain http); left out, https. It reads the cookie only: it
|
|
9
|
+
* cannot tell whether a consent tool is chosen, which a page render honours (P5-D9). */
|
|
10
|
+
export function readConsent(cookieHeader, options) {
|
|
11
|
+
return consentOfCookieHeader(cookieHeader, options?.secure ?? true);
|
|
12
|
+
}
|
|
13
|
+
/** The site's consent API in a visitor's browser, or null where the core's consent loader is not on the page (no tool
|
|
14
|
+
* chosen and nothing on the page waits for consent, an edit render, or code that runs on the server). */
|
|
15
|
+
export function kardalumConsent() {
|
|
16
|
+
const root = globalThis.kardalum;
|
|
17
|
+
return root?.consent ?? null;
|
|
18
|
+
}
|
|
@@ -15,6 +15,23 @@ export interface PluginContentLibrary {
|
|
|
15
15
|
getById(id: string, opts?: Partial<Pick<ContentItemQuery, "locale">>): Promise<ContentItemResponse>;
|
|
16
16
|
getLatestVersion(id: string, opts?: Partial<Pick<LatestVersionQuery, "locale">>): Promise<LatestVersionResponse>;
|
|
17
17
|
getChildren(id: string, opts?: Partial<Pick<ContentChildrenQuery, "cursor" | "limit">>): Promise<PluginContentList<ContentRow>>;
|
|
18
|
+
/**
|
|
19
|
+
* M35 C1 (W12): the pages below `under` in the tree's order (the stored path, bytewise, then the id), drafts
|
|
20
|
+
* included and trashed pages left out, up to 100 at a time (CONTENT_WALK_LIMIT_MAX, 50 by default); `after` is
|
|
21
|
+
* the previous nextCursor, a position that a page moved or removed between two calls never breaks. Without
|
|
22
|
+
* `under` it walks every page from the top level, which only a `{ allContent: true }` entry allows. Rows of
|
|
23
|
+
* types the declaration does not read (its parents rule included) are left out of `items`, so a page may be
|
|
24
|
+
* short while nextCursor is set. nextCursor names the last row examined, which may be one left out of
|
|
25
|
+
* `items`: it holds that row's stored path and id, readable by anyone who decodes it, so keep it in server
|
|
26
|
+
* code. Each row carries `access`, as the admin's tree and getChildren do: a row the plugin's page access
|
|
27
|
+
* does not read comes flagged `access.read: false` with its name and path, never left out.
|
|
28
|
+
* @experimental
|
|
29
|
+
*/
|
|
30
|
+
walk(opts?: {
|
|
31
|
+
under?: string;
|
|
32
|
+
after?: string;
|
|
33
|
+
limit?: number;
|
|
34
|
+
}): Promise<PluginContentList<ContentRow>>;
|
|
18
35
|
create(body: CreateContentRequest): Promise<ContentItemResponse>;
|
|
19
36
|
save(id: string, body: SaveContentRequest): Promise<SaveContentResponse>;
|
|
20
37
|
publish(id: string, body?: PublishContentRequest): Promise<PublishContentResponse>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { ContentListRow } from "@kardalum/api-schemas";
|
|
3
|
+
/** @internal What the admin hands the Content List table. Keys are `<pluginId>/<slotId>`. */
|
|
4
|
+
export interface ContentListExtensions {
|
|
5
|
+
/** The content language the plugin columns are read in; a filtered list asks its filter in it too,
|
|
6
|
+
* so the filtered rows and their cells agree. Absent, the site's default language. */
|
|
7
|
+
culture?: string;
|
|
8
|
+
columns: ReadonlyArray<{
|
|
9
|
+
key: string;
|
|
10
|
+
header: string;
|
|
11
|
+
}>;
|
|
12
|
+
/** Cell texts by column key, then row id; a column whose call failed answers failed: true. */
|
|
13
|
+
loadCells(rowIds: readonly string[]): Promise<Record<string, {
|
|
14
|
+
failed: boolean;
|
|
15
|
+
cells: Record<string, string | null>;
|
|
16
|
+
}>>;
|
|
17
|
+
filters: ReadonlyArray<{
|
|
18
|
+
key: string;
|
|
19
|
+
label: string;
|
|
20
|
+
options: ReadonlyArray<{
|
|
21
|
+
value: string;
|
|
22
|
+
label: string;
|
|
23
|
+
}>;
|
|
24
|
+
}>;
|
|
25
|
+
/** The tree actions this row may show, in the menu's order. */
|
|
26
|
+
rowActions(row: ContentListRow): ReadonlyArray<{
|
|
27
|
+
key: string;
|
|
28
|
+
label: string;
|
|
29
|
+
}>;
|
|
30
|
+
openRowAction(key: string, row: ContentListRow, done: (result: {
|
|
31
|
+
refresh?: boolean;
|
|
32
|
+
}) => void): void;
|
|
33
|
+
/** `admits` says whether a row is of the action's types; absent, every readable row is. While no
|
|
34
|
+
* selected row is admitted, the action's button is disabled. */
|
|
35
|
+
bulkActions: ReadonlyArray<{
|
|
36
|
+
key: string;
|
|
37
|
+
label: string;
|
|
38
|
+
admits?: (row: ContentListRow) => boolean;
|
|
39
|
+
}>;
|
|
40
|
+
openBulkAction(key: string, rows: readonly ContentListRow[], done: (result: {
|
|
41
|
+
refresh?: boolean;
|
|
42
|
+
}) => void): void;
|
|
43
|
+
}
|
|
44
|
+
/** @internal */
|
|
45
|
+
export declare function ContentListExtensionsProvider({ value, children }: {
|
|
46
|
+
value: ContentListExtensions | null;
|
|
47
|
+
children: ReactNode;
|
|
48
|
+
}): import("react").JSX.Element;
|
|
49
|
+
/** @internal Read by the built-in Content List view only. */
|
|
50
|
+
export declare function useContentListExtensions(): ContentListExtensions | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
const ContentListExtensionsContext = createContext(null);
|
|
4
|
+
/** @internal */
|
|
5
|
+
export function ContentListExtensionsProvider({ value, children }) {
|
|
6
|
+
return _jsx(ContentListExtensionsContext.Provider, { value: value, children: children });
|
|
7
|
+
}
|
|
8
|
+
/** @internal Read by the built-in Content List view only. */
|
|
9
|
+
export function useContentListExtensions() {
|
|
10
|
+
return useContext(ContentListExtensionsContext);
|
|
11
|
+
}
|
|
@@ -6,6 +6,8 @@ export interface PagePickerSheetProps {
|
|
|
6
6
|
multiple: boolean;
|
|
7
7
|
/** How many more pages the field takes. */
|
|
8
8
|
remaining: number;
|
|
9
|
+
/** How many pages the field holds at most, which the at-maximum note names; `remaining` when left out. */
|
|
10
|
+
max?: number;
|
|
9
11
|
/** The pages the field holds already. */
|
|
10
12
|
chosen: string[];
|
|
11
13
|
onChoose: (ids: string[]) => void;
|
|
@@ -95,7 +95,7 @@ function SheetBody(props) {
|
|
|
95
95
|
};
|
|
96
96
|
const atMax = props.multiple && selected.length >= props.remaining;
|
|
97
97
|
const title = t(props.multiple ? "contentPicker.sheetTitleMany" : "contentPicker.sheetTitle");
|
|
98
|
-
return (_jsxs(_Fragment, { children: [_jsxs(SheetHeader, { className: "flex-col items-start gap-1", children: [_jsx(SheetTitle, { children: title }), _jsx(SheetDescription, { children: t("contentPicker.sheetHint") })] }), _jsx("div", { role: "group", "aria-label": title, className: "min-h-0 flex-1 overflow-y-auto px-4 py-2", children: props.startNode !== null ? (_jsx(StartBranch, { startNode: props.startNode, selection: selection })) : (_jsx(Branch, { parentId: null, depth: 0, selection: selection })) }), atMax && (_jsx("p", { role: "status", className: "px-4 text-sm text-text-secondary", children: t("contentPicker.atMax", { max: props.remaining }) })), _jsxs(SheetFooter, { children: [_jsx(Button, { type: "button", variant: "outline", onClick: () => props.onOpenChange(false), children: t("contentPicker.cancel") }), _jsx(Button, { type: "button", disabled: selected.length === 0, onClick: () => {
|
|
98
|
+
return (_jsxs(_Fragment, { children: [_jsxs(SheetHeader, { className: "flex-col items-start gap-1", children: [_jsx(SheetTitle, { children: title }), _jsx(SheetDescription, { children: t("contentPicker.sheetHint") })] }), _jsx("div", { role: "group", "aria-label": title, className: "min-h-0 flex-1 overflow-y-auto px-4 py-2", children: props.startNode !== null ? (_jsx(StartBranch, { startNode: props.startNode, selection: selection })) : (_jsx(Branch, { parentId: null, depth: 0, selection: selection })) }), atMax && (_jsx("p", { role: "status", className: "px-4 text-sm text-text-secondary", children: t("contentPicker.atMax", { max: props.max ?? props.remaining }) })), _jsxs(SheetFooter, { children: [_jsx(Button, { type: "button", variant: "outline", onClick: () => props.onOpenChange(false), children: t("contentPicker.cancel") }), _jsx(Button, { type: "button", disabled: selected.length === 0, onClick: () => {
|
|
99
99
|
props.onChoose(selected);
|
|
100
100
|
props.onOpenChange(false);
|
|
101
101
|
}, children: t("contentPicker.done") })] })] }));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** @experimental */
|
|
2
|
+
export interface PagePickerProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onOpenChange(open: boolean): void;
|
|
5
|
+
/** The ids chosen, in the order the person ticked them. */
|
|
6
|
+
onChoose(ids: string[]): void;
|
|
7
|
+
multiple?: boolean;
|
|
8
|
+
/** How many pages the field holds at most, with `multiple`: 1 to PAGE_PICKER_CHOICES_MAX (the default). */
|
|
9
|
+
max?: number;
|
|
10
|
+
/** Only pages of these document type ids can be chosen; others show dimmed. */
|
|
11
|
+
documentTypeIds?: readonly string[];
|
|
12
|
+
/** The page whose children the sheet opens at; the top of the tree when left out. */
|
|
13
|
+
startNode?: string | null;
|
|
14
|
+
/** Pages already chosen, shown ticked. */
|
|
15
|
+
chosen?: readonly string[];
|
|
16
|
+
}
|
|
17
|
+
/** @experimental */
|
|
18
|
+
export declare function PagePicker(props: PagePickerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { PAGE_PICKER_CHOICES_MAX } from "@kardalum/api-schemas";
|
|
4
|
+
import { PluginTranslateProvider } from "../plugin-screen-context.js";
|
|
5
|
+
import { useSdkString } from "../sdk-strings.js";
|
|
6
|
+
import { PagePickerSheet } from "./page-picker-sheet.js";
|
|
7
|
+
// M35 C3 (W25, experimental): the SDK's page sheet for a plugin screen. It pages through the tree one
|
|
8
|
+
// cursor-paged level at a time, as the link and content picker fields do. Its words are the SDK's own
|
|
9
|
+
// (`pagePicker.*`, in the admin's language), never the plugin's translator, which holds none of them.
|
|
10
|
+
const PREFIX = "contentPicker.";
|
|
11
|
+
/** @experimental */
|
|
12
|
+
export function PagePicker(props) {
|
|
13
|
+
const sdk = useSdkString();
|
|
14
|
+
const t = useMemo(() => (key, values) => (key.startsWith(PREFIX) ? sdk(`pagePicker.${key.slice(PREFIX.length)}`, values) : key), [sdk]);
|
|
15
|
+
const chosen = props.chosen ?? [];
|
|
16
|
+
// A max that is not a finite number (`Number(setting)` of an empty setting) is the default.
|
|
17
|
+
const asked = props.max !== undefined && Number.isFinite(props.max) ? props.max : PAGE_PICKER_CHOICES_MAX;
|
|
18
|
+
const max = props.multiple === true ? Math.min(Math.max(1, Math.floor(asked)), PAGE_PICKER_CHOICES_MAX) : 1;
|
|
19
|
+
return (_jsx(PluginTranslateProvider, { t: t, children: _jsx(PagePickerSheet, { open: props.open, onOpenChange: props.onOpenChange, startNode: props.startNode ?? null, documentTypes: [...(props.documentTypeIds ?? [])], multiple: props.multiple === true, remaining: Math.max(0, max - chosen.length), max: max, chosen: [...chosen], onChoose: props.onChoose }) }));
|
|
20
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssetPathSchema, CONTENT_PICKER_MAX_ITEMS, LINK_LABEL_MAX, LIST_ITEMS_MAX, RICHTEXT_EDITOR_ID, UuidStringSchema, assetPathAccepted, isOutsideLinkAddress, isPlainRecord, readContentPickerSettings, readLinkSettings, readOptionsListSettings, richTextShapeProblem, } from "@kardalum/api-schemas";
|
|
1
|
+
import { AssetPathSchema, CONTENT_PICKER_MAX_ITEMS, LINK_LABEL_MAX, LIST_ITEMS_MAX, RICHTEXT_EDITOR_ID, UuidStringSchema, assetPathAccepted, isOutsideLinkAddress, isPlainRecord, readContentPickerSettings, readLinkSettings, readOptionsListSettings, RICH_TEXT_ITEMS_MAX, richTextShapeProblem, } from "@kardalum/api-schemas";
|
|
2
2
|
const ISO_DATE = /^\d{4}-\d{2}-\d{2}$/;
|
|
3
3
|
// A member reads as its string, as null (absent), or as MALFORMED when it
|
|
4
4
|
// is present but not a string at all. Keeping the two failure modes apart
|
|
@@ -224,9 +224,17 @@ export const BUILT_IN_DATATYPE_VALIDATORS = {
|
|
|
224
224
|
// M32 I2 (A5): a rich text value is stored only in a shape the editor can open and the renderer
|
|
225
225
|
// knows (the node and mark lists of api-schemas). Every problem answers one key. Null and an
|
|
226
226
|
// empty value are left to the default emptiness rule, so this sees only a value that is there.
|
|
227
|
+
// M35 C4a (design D6.1): a plugin item in a form that cannot be stored, and too many items, get their own keys.
|
|
227
228
|
[RICHTEXT_EDITOR_ID]: {
|
|
228
229
|
validate(value) {
|
|
229
|
-
|
|
230
|
+
const problem = richTextShapeProblem(value);
|
|
231
|
+
if (problem === null)
|
|
232
|
+
return [];
|
|
233
|
+
if (problem === "badItem")
|
|
234
|
+
return [{ key: "dataTypes.richText.errors.badItem" }];
|
|
235
|
+
if (problem === "tooManyItems")
|
|
236
|
+
return [{ key: "dataTypes.richText.errors.tooManyItems", params: { max: RICH_TEXT_ITEMS_MAX } }];
|
|
237
|
+
return [{ key: "dataTypes.richText.errors.shape" }];
|
|
230
238
|
},
|
|
231
239
|
},
|
|
232
240
|
// M32 D (D1, D8): a Group's value is an object keyed by its sub-fields' aliases. Empty is structural,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { BUILT_IN_SETTINGS_SCHEMAS } from "./built-in-settings-schemas.js";
|
|
2
2
|
export { BUILT_IN_VALUE_SCHEMAS } from "./built-in-value-schemas.js";
|
|
3
3
|
export { BUILT_IN_EDITOR_IDS } from "./built-in-editor-ids.js";
|
|
4
|
+
export { TEXT_EDITOR_ID, NUMBER_EDITOR_ID, BOOLEAN_EDITOR_ID, DATE_EDITOR_ID, IMAGE_EDITOR_ID, FILE_UPLOAD_EDITOR_ID, RICHTEXT_EDITOR_ID, HTML_EDITOR_ID, DATE_RANGE_EDITOR_ID, CONTENT_LIST_EDITOR_ID, CROP_EDITOR_ID, THUMBNAIL_EDITOR_ID, ASSET_EDITOR_ID, CONTENT_PICKER_EDITOR_ID, OPTIONS_EDITOR_ID, LINK_EDITOR_ID, GROUP_EDITOR_ID, REPEATABLE_LIST_EDITOR_ID, } from "@kardalum/api-schemas";
|
|
4
5
|
export { BUILT_IN_SERIALIZERS, identitySerializer, type DataTypeSerializer, } from "./built-in-serializers.js";
|
|
5
6
|
export { RENDITION_INELIGIBLE_TYPES, isRenditionIneligible } from "./rendition-eligibility.js";
|
package/dist/datatypes-entry.js
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
export { BUILT_IN_SETTINGS_SCHEMAS } from "./built-in-settings-schemas.js";
|
|
11
11
|
export { BUILT_IN_VALUE_SCHEMAS } from "./built-in-value-schemas.js";
|
|
12
12
|
export { BUILT_IN_EDITOR_IDS } from "./built-in-editor-ids.js";
|
|
13
|
+
// M35 C4a (evidence 121): a named constant for every built-in editor id, so a plugin never retypes one.
|
|
14
|
+
export { TEXT_EDITOR_ID, NUMBER_EDITOR_ID, BOOLEAN_EDITOR_ID, DATE_EDITOR_ID, IMAGE_EDITOR_ID, FILE_UPLOAD_EDITOR_ID, RICHTEXT_EDITOR_ID, HTML_EDITOR_ID, DATE_RANGE_EDITOR_ID, CONTENT_LIST_EDITOR_ID, CROP_EDITOR_ID, THUMBNAIL_EDITOR_ID, ASSET_EDITOR_ID, CONTENT_PICKER_EDITOR_ID, OPTIONS_EDITOR_ID, LINK_EDITOR_ID, GROUP_EDITOR_ID, REPEATABLE_LIST_EDITOR_ID, } from "@kardalum/api-schemas";
|
|
13
15
|
export { BUILT_IN_SERIALIZERS, identitySerializer, } from "./built-in-serializers.js";
|
|
14
16
|
// S234c fix wave: the "no GIF, no SVG" rule, read by the cut route so a
|
|
15
17
|
// signed-in caller cannot post a "crop" of a format the browser refuses to
|