@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/dist/manifest.js
CHANGED
|
@@ -13,15 +13,19 @@ export function slotLabel(label, locale) {
|
|
|
13
13
|
* The contributions that put code in the browser, and so the ones that
|
|
14
14
|
* make a plugin ship a client bundle (S267 section 5, implemented by
|
|
15
15
|
* S268 Task 3). `dataTypes`, `adminSections`, `railEntries` (S280) and
|
|
16
|
-
* `dashboardWidgets`, `editorPanels` and `
|
|
16
|
+
* `dashboardWidgets`, `editorPanels`, `treeActions`, `bulkActions` and `adminSlots` carry React views;
|
|
17
|
+
* `contentColumns`, `treeBadges` and `listFilters` (M35 C2) carry none, but the admin registers them
|
|
18
|
+
* for their labels and options. S313b retired `settingsPages`,
|
|
17
19
|
* `contentTreeActions` and `editorToolbar`, which no admin screen hosted;
|
|
18
20
|
* the last two return when a host and an editor-handle API are designed.
|
|
21
|
+
* M35 C4a: rich text gained `richTextExtensions` (the 35-C4 design); `editorToolbar` is not revived.
|
|
19
22
|
*
|
|
20
23
|
* Everything else is absent on purpose: `apiRoutes`, `hooks`,
|
|
21
24
|
* `scheduledTasks`, `mediaProcessors` and `serializers` run on the
|
|
22
|
-
* server, and `documentTypes`, `themeTokens`, `templates
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
+
* server, and `documentTypes`, `themeTokens`, `templates` and `assets` are
|
|
26
|
+
* data the host consumes rather than code the browser runs.
|
|
27
|
+
* `bundledPlugins` and `bundledTemplate` are data the marketplace resolves;
|
|
28
|
+
* `exposedServices` (M35 B1a) carries functions, like `apiRoutes`.
|
|
25
29
|
*
|
|
26
30
|
* This replaces the type-keyed CLIENT_BUNDLE_TYPES. It is more correct
|
|
27
31
|
* than that list was, not merely equivalent: a plugin listed as
|
package/dist/plugin-context.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PluginSettingValue } from "@kardalum/api-schemas";
|
|
1
2
|
import { type ReactNode } from "react";
|
|
2
3
|
interface PluginValueProviderProps {
|
|
3
4
|
value: unknown;
|
|
@@ -84,4 +85,50 @@ interface ContentHostProviderProps {
|
|
|
84
85
|
}
|
|
85
86
|
export declare function ContentHostProvider({ host, children }: ContentHostProviderProps): import("react").JSX.Element;
|
|
86
87
|
export declare function useContentHost(): ContentHost | null;
|
|
88
|
+
/** M35 C3 (W28): the plugin settings the plugin marks `inViews`, as the host read them.
|
|
89
|
+
* @experimental */
|
|
90
|
+
export type PluginViewSettingsState = {
|
|
91
|
+
status: "loading";
|
|
92
|
+
} | {
|
|
93
|
+
status: "ready";
|
|
94
|
+
values: Readonly<Record<string, PluginSettingValue>>;
|
|
95
|
+
} | {
|
|
96
|
+
status: "unavailable";
|
|
97
|
+
};
|
|
98
|
+
/** @internal Host-only: the admin supplies it around every plugin view and a plugin's data type views; a
|
|
99
|
+
* plugin never renders it (its own tests may, as they render the other host providers). Not a point. */
|
|
100
|
+
export declare function PluginViewSettingsProvider({ value, children }: {
|
|
101
|
+
value: PluginViewSettingsState;
|
|
102
|
+
children: ReactNode;
|
|
103
|
+
}): import("react").JSX.Element;
|
|
104
|
+
/** The plugin's own settings marked `inViews`. Outside a host-rendered provider it is a host wiring bug, so it throws.
|
|
105
|
+
* @experimental */
|
|
106
|
+
export declare function usePluginViewSettings(): PluginViewSettingsState;
|
|
107
|
+
/** M35 C3 (W48): the field a data type's view is drawn for, in the content editor or a media item's form.
|
|
108
|
+
* @experimental */
|
|
109
|
+
export interface PluginFieldContext {
|
|
110
|
+
fieldId: string;
|
|
111
|
+
fieldName: string;
|
|
112
|
+
/** The language the value is written in; null on a media item. */
|
|
113
|
+
culture: string | null;
|
|
114
|
+
/** The plugin that owns the data type cannot change the value now (a lapsed licence). */
|
|
115
|
+
readOnly: boolean;
|
|
116
|
+
/** The value on screen is the default language's: the page has none of its own in `culture`. */
|
|
117
|
+
inherited: boolean;
|
|
118
|
+
/** Every language shares this field's one value. */
|
|
119
|
+
shared: boolean;
|
|
120
|
+
/** Every top-level value of the page or item as the form last settled (EDITOR_PANEL_VALUES_DEBOUNCE_MS),
|
|
121
|
+
* this field's own included; frozen at every level. Write only your own value, through `onChange`. */
|
|
122
|
+
values: Readonly<Record<string, unknown>>;
|
|
123
|
+
}
|
|
124
|
+
/** @internal Host-only: the admin supplies it around a data type view of a top-level field; `null` resets it
|
|
125
|
+
* for a nested view. Not a point. */
|
|
126
|
+
export declare function PluginFieldContextProvider({ value, children }: {
|
|
127
|
+
value: PluginFieldContext | null;
|
|
128
|
+
children: ReactNode;
|
|
129
|
+
}): import("react").JSX.Element;
|
|
130
|
+
/** The field this view is drawn for, or null where there is none: the document type builder's preview, the
|
|
131
|
+
* Data Types editor, and inside a Group or Repeatable list. Null is a real state here, as useContentHost's is.
|
|
132
|
+
* @experimental */
|
|
133
|
+
export declare function usePluginFieldContext(): PluginFieldContext | null;
|
|
87
134
|
export {};
|
package/dist/plugin-context.js
CHANGED
|
@@ -75,3 +75,30 @@ export function ContentHostProvider({ host, children }) {
|
|
|
75
75
|
export function useContentHost() {
|
|
76
76
|
return useContext(ContentHostContext);
|
|
77
77
|
}
|
|
78
|
+
const PluginViewSettingsContext = createContext(null);
|
|
79
|
+
/** @internal Host-only: the admin supplies it around every plugin view and a plugin's data type views; a
|
|
80
|
+
* plugin never renders it (its own tests may, as they render the other host providers). Not a point. */
|
|
81
|
+
export function PluginViewSettingsProvider({ value, children }) {
|
|
82
|
+
return _jsx(PluginViewSettingsContext.Provider, { value: value, children: children });
|
|
83
|
+
}
|
|
84
|
+
/** The plugin's own settings marked `inViews`. Outside a host-rendered provider it is a host wiring bug, so it throws.
|
|
85
|
+
* @experimental */
|
|
86
|
+
export function usePluginViewSettings() {
|
|
87
|
+
const ctx = useContext(PluginViewSettingsContext);
|
|
88
|
+
if (!ctx) {
|
|
89
|
+
throw new Error("usePluginViewSettings must be called from a view rendered inside a PluginViewSettingsProvider");
|
|
90
|
+
}
|
|
91
|
+
return ctx;
|
|
92
|
+
}
|
|
93
|
+
const PluginFieldReactContext = createContext(null);
|
|
94
|
+
/** @internal Host-only: the admin supplies it around a data type view of a top-level field; `null` resets it
|
|
95
|
+
* for a nested view. Not a point. */
|
|
96
|
+
export function PluginFieldContextProvider({ value, children }) {
|
|
97
|
+
return _jsx(PluginFieldReactContext.Provider, { value: value, children: children });
|
|
98
|
+
}
|
|
99
|
+
/** The field this view is drawn for, or null where there is none: the document type builder's preview, the
|
|
100
|
+
* Data Types editor, and inside a Group or Repeatable list. Null is a real state here, as useContentHost's is.
|
|
101
|
+
* @experimental */
|
|
102
|
+
export function usePluginFieldContext() {
|
|
103
|
+
return useContext(PluginFieldReactContext);
|
|
104
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { isAskableAction } from "@kardalum/api-schemas";
|
|
3
|
+
export interface PluginPermissions {
|
|
4
|
+
pluginId: string;
|
|
5
|
+
actions: ReadonlySet<string>;
|
|
6
|
+
}
|
|
7
|
+
export declare function PluginPermissionsProvider({ value, children }: {
|
|
8
|
+
value: PluginPermissions;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
/** The one rule (api-schemas): a core action, or one of this plugin's own. Re-exported for views. */
|
|
12
|
+
export { isAskableAction };
|
|
13
|
+
/**
|
|
14
|
+
* @experimental M35 U1 (W52): whether the signed-in person holds `action`, a core action or one of
|
|
15
|
+
* this plugin's own. Another plugin's action throws TypeError. Outside the admin's provider (an older
|
|
16
|
+
* admin, a test without one) it answers false.
|
|
17
|
+
*/
|
|
18
|
+
export declare function usePluginCan(action: string): boolean;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
import { isAskableAction } from "@kardalum/api-schemas";
|
|
4
|
+
const PermissionsContext = createContext(null);
|
|
5
|
+
export function PluginPermissionsProvider({ value, children }) {
|
|
6
|
+
return _jsx(PermissionsContext.Provider, { value: value, children: children });
|
|
7
|
+
}
|
|
8
|
+
/** The one rule (api-schemas): a core action, or one of this plugin's own. Re-exported for views. */
|
|
9
|
+
export { isAskableAction };
|
|
10
|
+
/**
|
|
11
|
+
* @experimental M35 U1 (W52): whether the signed-in person holds `action`, a core action or one of
|
|
12
|
+
* this plugin's own. Another plugin's action throws TypeError. Outside the admin's provider (an older
|
|
13
|
+
* admin, a test without one) it answers false.
|
|
14
|
+
*/
|
|
15
|
+
export function usePluginCan(action) {
|
|
16
|
+
const permissions = useContext(PermissionsContext);
|
|
17
|
+
if (permissions === null)
|
|
18
|
+
return false;
|
|
19
|
+
// Taken before the check: the rule is a type guard, so `action` reads as never in the refusal.
|
|
20
|
+
const shown = action.slice(0, 120);
|
|
21
|
+
if (!isAskableAction(permissions.pluginId, action)) {
|
|
22
|
+
throw new TypeError(`usePluginCan: "${shown}" is neither a core action nor one of ${permissions.pluginId}'s own`);
|
|
23
|
+
}
|
|
24
|
+
return permissions.actions.has(action);
|
|
25
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import type { PanelProposeRefusal, PluginFieldInfo } from "@kardalum/api-schemas";
|
|
2
|
+
import type { AdminSlotPlace, PanelProposeRefusal, PluginFieldInfo, PluginNavigateTarget } from "@kardalum/api-schemas";
|
|
3
3
|
/**
|
|
4
4
|
* Translates one of the plugin's own strings (S290): a key from its
|
|
5
5
|
* locales/<language>.json, in the admin's language, falling back to the
|
|
@@ -35,7 +35,17 @@ export type PluginTranslate = (key: string, values?: Record<string, string | num
|
|
|
35
35
|
* - `kind: "editorPanel"`: a panel beside an existing page's editor (M32 F3).
|
|
36
36
|
* `panelId` is the panel's id; `sectionId` and `entryId` are null.
|
|
37
37
|
* - `kind: "treeAction"`: a dialog opened from a content tree row's menu
|
|
38
|
-
* (M32 F3)
|
|
38
|
+
* (M32 F3), or since M35 C2 from a Content List row's menu. `actionId` is
|
|
39
|
+
* the action's id; `sectionId` and `entryId` are null.
|
|
40
|
+
* - `kind: "bulkAction"`: a dialog opened over the Content List table for the
|
|
41
|
+
* selected rows (M35 C2, experimental). `actionId` is the bulk action's id.
|
|
42
|
+
* - `kind: "adminSlot"`: a view in one of the core's own screens (M35 C2,
|
|
43
|
+
* experimental). `slotId` is the entry's id and `place` its ADMIN_SLOT_PLACES
|
|
44
|
+
* place.
|
|
45
|
+
* - `kind: "richTextItem"`: a rich text item's or mark's own view in its side
|
|
46
|
+
* panel (M35 C4b, experimental); `itemName` is the node's or mark's name.
|
|
47
|
+
* - `kind: "richTextButton"`: a rich text toolbar button's view in a dialog
|
|
48
|
+
* (M35 C4b, experimental); `buttonId` is the button's id.
|
|
39
49
|
*/
|
|
40
50
|
export interface PluginScreenContext {
|
|
41
51
|
pluginId: string;
|
|
@@ -58,6 +68,27 @@ export interface PluginScreenContext {
|
|
|
58
68
|
sectionId: null;
|
|
59
69
|
entryId: null;
|
|
60
70
|
actionId: string;
|
|
71
|
+
} | {
|
|
72
|
+
kind: "bulkAction";
|
|
73
|
+
sectionId: null;
|
|
74
|
+
entryId: null;
|
|
75
|
+
actionId: string;
|
|
76
|
+
} | {
|
|
77
|
+
kind: "adminSlot";
|
|
78
|
+
sectionId: null;
|
|
79
|
+
entryId: null;
|
|
80
|
+
slotId: string;
|
|
81
|
+
place: AdminSlotPlace;
|
|
82
|
+
} | {
|
|
83
|
+
kind: "richTextItem";
|
|
84
|
+
sectionId: null;
|
|
85
|
+
entryId: null;
|
|
86
|
+
itemName: string;
|
|
87
|
+
} | {
|
|
88
|
+
kind: "richTextButton";
|
|
89
|
+
sectionId: null;
|
|
90
|
+
entryId: null;
|
|
91
|
+
buttonId: string;
|
|
61
92
|
};
|
|
62
93
|
/** The admin's active language, for formatting dates and numbers. A
|
|
63
94
|
* screen's words come from `t`. */
|
|
@@ -65,16 +96,23 @@ export interface PluginScreenContext {
|
|
|
65
96
|
/** The plugin's own strings in the admin's language (S290). */
|
|
66
97
|
t: PluginTranslate;
|
|
67
98
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* plugin's
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
99
|
+
* Moves the admin to another screen (M35 C3, W29: the targets are experimental). A string or null keeps
|
|
100
|
+
* today's meaning: a rail entry of the plugin's own section, or that section's landing, for a section
|
|
101
|
+
* screen only. A target (`PluginNavigateTarget`) opens one of the plugin's own screens with an optional
|
|
102
|
+
* `item`, another installed plugin's declared screen (`plugin`), a core screen (`core`), or the plugin's
|
|
103
|
+
* own docs (`docs`). The host resolves it to its own route, asks the leave guard, and checks that the
|
|
104
|
+
* person may open it; a target it cannot read or the person may not open does nothing, with a console
|
|
105
|
+
* warning in development. In a dialog (a tree action, a bulk action, a top bar item) it closes the
|
|
106
|
+
* dialog first.
|
|
76
107
|
*/
|
|
77
|
-
navigate
|
|
108
|
+
navigate(target: PluginNavigateTarget | string | null): void;
|
|
109
|
+
/**
|
|
110
|
+
* M35 C3 (W29): the admin address `target` opens for this person, or null when it opens nothing for
|
|
111
|
+
* them, so a view draws a real link and hides one the person cannot follow. The admin always sets it;
|
|
112
|
+
* it is optional in the type only so a context a plugin's own test builds stays valid.
|
|
113
|
+
* @experimental
|
|
114
|
+
*/
|
|
115
|
+
hrefFor?(target: PluginNavigateTarget): string | null;
|
|
78
116
|
/**
|
|
79
117
|
* M33 K6: the row a notification link opened this screen at (the link's `item`, from the
|
|
80
118
|
* screen's `?item=` query), or null. It is only ever 1 to 100 letters, digits, "-" and "_";
|
|
@@ -143,6 +181,14 @@ export interface EditorPanelContext {
|
|
|
143
181
|
publishedVersion: number | null;
|
|
144
182
|
/** Whether the signed-in user may change this page. */
|
|
145
183
|
canUpdate: boolean;
|
|
184
|
+
/** M35 C3 (W48): the ids of the fields `propose` refuses as read-only (a lapsed plugin's field, a field
|
|
185
|
+
* that stores nothing). Frozen. The admin always sets it.
|
|
186
|
+
* @experimental */
|
|
187
|
+
readOnlyFields?: readonly string[];
|
|
188
|
+
/** M35 C3 (W48): the ids of the fields whose value on screen comes from the default language, because the
|
|
189
|
+
* page has none of its own in `culture`. Empty on the default language. Frozen. The admin always sets it.
|
|
190
|
+
* @experimental */
|
|
191
|
+
inheritedFields?: readonly string[];
|
|
146
192
|
/**
|
|
147
193
|
* M32 F4c (D11): proposes values for the page's fields, by field id. The editor checks each one
|
|
148
194
|
* (a field of this page, the panel's document types, `canUpdate`, not read-only, plain JSON of at
|
|
@@ -191,3 +237,98 @@ export declare function TreeActionProvider({ value, children }: {
|
|
|
191
237
|
export declare function usePluginEditorPanel(): EditorPanelContext;
|
|
192
238
|
/** The tree row a tree action was opened from. Outside a host-rendered TreeActionProvider it throws. */
|
|
193
239
|
export declare function usePluginTreeAction(): TreeActionContext;
|
|
240
|
+
/** M35 C2: one selected row of the Content List table a bulk action is handed.
|
|
241
|
+
* @experimental */
|
|
242
|
+
export interface BulkActionRow {
|
|
243
|
+
id: string;
|
|
244
|
+
path: string;
|
|
245
|
+
name: string;
|
|
246
|
+
parentId: string | null;
|
|
247
|
+
documentTypeId: string;
|
|
248
|
+
/** The document type's name, as `documentTypes` names it. */
|
|
249
|
+
documentType: string;
|
|
250
|
+
status: "draft" | "published" | "changes";
|
|
251
|
+
}
|
|
252
|
+
/** M35 C2: what a bulk action's view reads through usePluginBulkAction(). `rows` are the selected rows the
|
|
253
|
+
* action's `documentTypes` admit (at most BULK_ACTION_ROWS_MAX). `close` shuts the dialog; `refresh: true`
|
|
254
|
+
* asks for one reload of the list, and `message` (at most TREE_ACTION_MESSAGE_MAX characters, plain text)
|
|
255
|
+
* is shown as a notice.
|
|
256
|
+
* @experimental */
|
|
257
|
+
export interface BulkActionContext {
|
|
258
|
+
rows: ReadonlyArray<Readonly<BulkActionRow>>;
|
|
259
|
+
close(result?: {
|
|
260
|
+
refresh?: boolean;
|
|
261
|
+
message?: string;
|
|
262
|
+
}): void;
|
|
263
|
+
}
|
|
264
|
+
/** Supplied by the host around a bulk action's view, inside its PluginScreenProvider.
|
|
265
|
+
* @experimental */
|
|
266
|
+
export declare function BulkActionProvider({ value, children }: {
|
|
267
|
+
value: BulkActionContext;
|
|
268
|
+
children: ReactNode;
|
|
269
|
+
}): import("react").JSX.Element;
|
|
270
|
+
/** The rows a bulk action was opened for. Outside a host-rendered BulkActionProvider it throws.
|
|
271
|
+
* @experimental */
|
|
272
|
+
export declare function usePluginBulkAction(): BulkActionContext;
|
|
273
|
+
/** M35 C2: a person as a core screen's panel sees them.
|
|
274
|
+
* @experimental */
|
|
275
|
+
export interface AdminSlotUser {
|
|
276
|
+
id: string;
|
|
277
|
+
name: string | null;
|
|
278
|
+
role: string;
|
|
279
|
+
disabled: boolean;
|
|
280
|
+
}
|
|
281
|
+
/** M35 C2: the saved document type a `documentType.panel` is shown for (never the unsaved draft).
|
|
282
|
+
* @experimental */
|
|
283
|
+
export interface AdminSlotDocumentType {
|
|
284
|
+
id: string;
|
|
285
|
+
name: string;
|
|
286
|
+
kind: "page" | "element";
|
|
287
|
+
fields: ReadonlyArray<{
|
|
288
|
+
id: string;
|
|
289
|
+
name: string;
|
|
290
|
+
dataTypeId: string;
|
|
291
|
+
private: boolean;
|
|
292
|
+
}>;
|
|
293
|
+
}
|
|
294
|
+
/** M35 C2: the media item a `media.panel` is shown for.
|
|
295
|
+
* @experimental */
|
|
296
|
+
export interface AdminSlotMedia {
|
|
297
|
+
id: string;
|
|
298
|
+
filename: string;
|
|
299
|
+
mimeType: string;
|
|
300
|
+
size: number;
|
|
301
|
+
visibility: "public" | "private";
|
|
302
|
+
documentTypeId: string | null;
|
|
303
|
+
}
|
|
304
|
+
/** M35 C2 (W26, experimental): what a view in a core screen reads, by place. `canUpdate` says whether the
|
|
305
|
+
* reader may change what the screen shows (`users.update`, `documentTypes.update`, `media.update`).
|
|
306
|
+
* @experimental */
|
|
307
|
+
export type AdminSlotContext = {
|
|
308
|
+
slot: "topBar.item";
|
|
309
|
+
close(): void;
|
|
310
|
+
} | {
|
|
311
|
+
slot: "users.panel";
|
|
312
|
+
user: Readonly<AdminSlotUser>;
|
|
313
|
+
canUpdate: boolean;
|
|
314
|
+
} | {
|
|
315
|
+
slot: "account.panel";
|
|
316
|
+
user: Readonly<AdminSlotUser>;
|
|
317
|
+
} | {
|
|
318
|
+
slot: "documentType.panel";
|
|
319
|
+
documentType: Readonly<AdminSlotDocumentType>;
|
|
320
|
+
canUpdate: boolean;
|
|
321
|
+
} | {
|
|
322
|
+
slot: "media.panel";
|
|
323
|
+
media: Readonly<AdminSlotMedia>;
|
|
324
|
+
canUpdate: boolean;
|
|
325
|
+
};
|
|
326
|
+
/** Supplied by the host around a core screen slot's view, inside its PluginScreenProvider.
|
|
327
|
+
* @experimental */
|
|
328
|
+
export declare function AdminSlotProvider({ value, children }: {
|
|
329
|
+
value: AdminSlotContext;
|
|
330
|
+
children: ReactNode;
|
|
331
|
+
}): import("react").JSX.Element;
|
|
332
|
+
/** The place a core screen slot's view sits in. Outside a host-rendered AdminSlotProvider it throws.
|
|
333
|
+
* @experimental */
|
|
334
|
+
export declare function usePluginAdminSlot(): AdminSlotContext;
|
|
@@ -65,3 +65,33 @@ export function usePluginTreeAction() {
|
|
|
65
65
|
}
|
|
66
66
|
return ctx;
|
|
67
67
|
}
|
|
68
|
+
const BulkActionReactContext = createContext(null);
|
|
69
|
+
/** Supplied by the host around a bulk action's view, inside its PluginScreenProvider.
|
|
70
|
+
* @experimental */
|
|
71
|
+
export function BulkActionProvider({ value, children }) {
|
|
72
|
+
return _jsx(BulkActionReactContext.Provider, { value: value, children: children });
|
|
73
|
+
}
|
|
74
|
+
/** The rows a bulk action was opened for. Outside a host-rendered BulkActionProvider it throws.
|
|
75
|
+
* @experimental */
|
|
76
|
+
export function usePluginBulkAction() {
|
|
77
|
+
const ctx = useContext(BulkActionReactContext);
|
|
78
|
+
if (!ctx) {
|
|
79
|
+
throw new Error("usePluginBulkAction must be called from a view rendered inside a BulkActionProvider");
|
|
80
|
+
}
|
|
81
|
+
return ctx;
|
|
82
|
+
}
|
|
83
|
+
const AdminSlotReactContext = createContext(null);
|
|
84
|
+
/** Supplied by the host around a core screen slot's view, inside its PluginScreenProvider.
|
|
85
|
+
* @experimental */
|
|
86
|
+
export function AdminSlotProvider({ value, children }) {
|
|
87
|
+
return _jsx(AdminSlotReactContext.Provider, { value: value, children: children });
|
|
88
|
+
}
|
|
89
|
+
/** The place a core screen slot's view sits in. Outside a host-rendered AdminSlotProvider it throws.
|
|
90
|
+
* @experimental */
|
|
91
|
+
export function usePluginAdminSlot() {
|
|
92
|
+
const ctx = useContext(AdminSlotReactContext);
|
|
93
|
+
if (!ctx) {
|
|
94
|
+
throw new Error("usePluginAdminSlot must be called from a view rendered inside an AdminSlotProvider");
|
|
95
|
+
}
|
|
96
|
+
return ctx;
|
|
97
|
+
}
|
package/dist/providers.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { MailPurpose, PluginLabel, PluginSettingValue, ProtectionTellWord, SignInClientAuth, SignInIcon, SignInProtocol } from "@kardalum/api-schemas";
|
|
1
|
+
import type { MailPurpose, PluginLabel, PluginSettingValue, ProtectionTellWord, SignInClientAuth, SignInIcon, SignInProtocol, SignInStepAnswerInput, SignInStepChallenge, SignInStepKind, SignInStepPerson, SignInStepStatus, SignInStepVerdict } from "@kardalum/api-schemas";
|
|
2
2
|
import type { Entitlement } from "./entitlement-types.js";
|
|
3
3
|
import type { ScopedStructuredStorage } from "./structured-storage-types.js";
|
|
4
4
|
import type { PluginSealing } from "./sealing.js";
|
|
5
|
-
export type { SignInIcon } from "@kardalum/api-schemas";
|
|
5
|
+
export type { SignInIcon, SignInStepAnswerInput, SignInStepChallenge, SignInStepKind, SignInStepPerson, SignInStepStatus, SignInStepVerdict } from "@kardalum/api-schemas";
|
|
6
6
|
/** D12: what `context.secrets` offers plugin server code. Only a declared name is readable. */
|
|
7
7
|
export interface PluginSecrets {
|
|
8
8
|
/** The stored value, or null when the person has not entered it (or it can no longer be decrypted). An undeclared name throws PluginSecretUndeclaredError. */
|
|
@@ -213,6 +213,22 @@ export interface MailSenderContribution {
|
|
|
213
213
|
/** True when the sender can send now; absent means always ready. */
|
|
214
214
|
ready?(context: ProviderContext): Promise<boolean>;
|
|
215
215
|
}
|
|
216
|
+
/**
|
|
217
|
+
* @experimental M35 P5 (W37): a consent tool the site owner may choose in Server settings, Providers. While chosen, the
|
|
218
|
+
* core writes its stylesheet and its script (`<script src defer>`) in the head of every public page, right after the
|
|
219
|
+
* core's consent loader, so the script finds `window.kardalum.consent` (`KardalumConsentApi`). The script shows the
|
|
220
|
+
* banner, calls `set` and `reset`, and opens its settings on the `kardalum:consentopen` event. Only the chosen tool calls
|
|
221
|
+
* `set` and `reset`. Derives `provider.consent`, a promised capability.
|
|
222
|
+
*/
|
|
223
|
+
export interface ConsentToolContribution {
|
|
224
|
+
id: string;
|
|
225
|
+
label: PluginLabel;
|
|
226
|
+
description?: PluginLabel;
|
|
227
|
+
/** A `.js` file in the plugin's own `public/` folder, such as "consent.js". */
|
|
228
|
+
script: string;
|
|
229
|
+
/** A `.css` file in the plugin's own `public/` folder. */
|
|
230
|
+
stylesheet?: string;
|
|
231
|
+
}
|
|
216
232
|
/** M32 F4b (D33): who a person is, as an oauth2 provider's `profile` reads the userinfo answers. */
|
|
217
233
|
export interface SignInProfile {
|
|
218
234
|
/** The provider's stable id for the person, 1 to 255 characters. */
|
|
@@ -266,3 +282,32 @@ export interface SignInProviderContribution {
|
|
|
266
282
|
responses: unknown[];
|
|
267
283
|
}, context: ProviderContext): Promise<SignInProfile>;
|
|
268
284
|
}
|
|
285
|
+
/**
|
|
286
|
+
* M35 U3a (experimental): a step in the admin sign-in, asked after the password or a sign-in provider and
|
|
287
|
+
* before the session exists. A factor proves the person a second time; it is offered only to people who set
|
|
288
|
+
* it up (35-U3a). The core decides when a step applies, draws it from your answer's parts (data, never
|
|
289
|
+
* markup), checks every answer against what you asked before calling `verify`, and keeps your `state`
|
|
290
|
+
* sealed. You never learn the email, the name, the password, a token, a cookie or the request.
|
|
291
|
+
* Unions may widen (an audience, a sign-in method, a kind, a part): treat an input you do not know as not
|
|
292
|
+
* yours and answer `notSetUp`. Keep a factor's secret sealed with `context.sealing` in your structured
|
|
293
|
+
* storage; never in an account field. After a `JWT_SECRET` change, answer `setUp` for any record you hold.
|
|
294
|
+
*/
|
|
295
|
+
export interface SignInStepContribution {
|
|
296
|
+
/** The provider id rule, 1 to 40. */
|
|
297
|
+
id: string;
|
|
298
|
+
/** On the step page's heading, the Steps card and Sign-in methods. */
|
|
299
|
+
label: PluginLabel;
|
|
300
|
+
/** One line for the owner and the person, at most 160 characters a language. */
|
|
301
|
+
description?: PluginLabel;
|
|
302
|
+
kind: SignInStepKind;
|
|
303
|
+
status(input: SignInStepPerson, context: ProviderContext): Promise<SignInStepStatus>;
|
|
304
|
+
/** Factor: required. Called once per pending sign-in; may send a message. */
|
|
305
|
+
challenge?(input: SignInStepPerson, context: ProviderContext): Promise<SignInStepChallenge>;
|
|
306
|
+
verify?(input: SignInStepPerson & SignInStepAnswerInput, context: ProviderContext): Promise<SignInStepVerdict>;
|
|
307
|
+
/** Factor: required. A setup's challenge may carry `setupKey` and `keepCodes`. */
|
|
308
|
+
setupBegin?(input: SignInStepPerson, context: ProviderContext): Promise<SignInStepChallenge>;
|
|
309
|
+
setupFinish?(input: SignInStepPerson & SignInStepAnswerInput, context: ProviderContext): Promise<SignInStepVerdict>;
|
|
310
|
+
setupRemove?(input: {
|
|
311
|
+
userId: string;
|
|
312
|
+
}, context: ProviderContext): Promise<void>;
|
|
313
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RenderPageRefusal } from "@kardalum/api-schemas";
|
|
2
|
+
/**
|
|
3
|
+
* M35 P4 (W53): thrown by `context.renderPage` when the render cannot run: `unavailable` (the server renders no
|
|
4
|
+
* site), `inactive` (the plugin is switched off), `nested` (called while a render runs: a template call or a page
|
|
5
|
+
* transform cannot start another render), `busy` (RENDER_PAGE_RUNNING_PER_PLUGIN_MAX, RENDER_PAGE_RUNNING_MAX or
|
|
6
|
+
* RENDER_PAGE_PER_MINUTE_MAX), `timeout` (RENDER_PAGE_TIME_MS), `tooLarge` (RENDER_PAGE_HTML_MAX_BYTES) or `failed`
|
|
7
|
+
* (the template failed). Test it with isRenderPageRefusedError, never `instanceof`.
|
|
8
|
+
* @experimental
|
|
9
|
+
*/
|
|
10
|
+
export declare class RenderPageRefusedError extends Error {
|
|
11
|
+
readonly reason: RenderPageRefusal;
|
|
12
|
+
constructor(reason: RenderPageRefusal);
|
|
13
|
+
}
|
|
14
|
+
/** True for a RenderPageRefusedError from ANY copy of this SDK (a plugin bundles its own copy). */
|
|
15
|
+
export declare function isRenderPageRefusedError(value: unknown): value is RenderPageRefusedError;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* M35 P4 (W53): thrown by `context.renderPage` when the render cannot run: `unavailable` (the server renders no
|
|
3
|
+
* site), `inactive` (the plugin is switched off), `nested` (called while a render runs: a template call or a page
|
|
4
|
+
* transform cannot start another render), `busy` (RENDER_PAGE_RUNNING_PER_PLUGIN_MAX, RENDER_PAGE_RUNNING_MAX or
|
|
5
|
+
* RENDER_PAGE_PER_MINUTE_MAX), `timeout` (RENDER_PAGE_TIME_MS), `tooLarge` (RENDER_PAGE_HTML_MAX_BYTES) or `failed`
|
|
6
|
+
* (the template failed). Test it with isRenderPageRefusedError, never `instanceof`.
|
|
7
|
+
* @experimental
|
|
8
|
+
*/
|
|
9
|
+
export class RenderPageRefusedError extends Error {
|
|
10
|
+
reason;
|
|
11
|
+
constructor(reason) {
|
|
12
|
+
super(`render page refused: ${reason}`);
|
|
13
|
+
this.name = "RenderPageRefusedError";
|
|
14
|
+
this.reason = reason;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/** True for a RenderPageRefusedError from ANY copy of this SDK (a plugin bundles its own copy). */
|
|
18
|
+
export function isRenderPageRefusedError(value) {
|
|
19
|
+
return value instanceof Error && value.name === "RenderPageRefusedError";
|
|
20
|
+
}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import type { Editor } from "@tiptap/react";
|
|
2
|
-
import { type BlockListing } from "./insert-menu.js";
|
|
2
|
+
import { type BlockListing, type BlockParamSpec } from "./insert-menu.js";
|
|
3
|
+
export interface BlockParamFieldProps {
|
|
4
|
+
spec: BlockParamSpec;
|
|
5
|
+
value: unknown;
|
|
6
|
+
onChange: (next: unknown) => void;
|
|
7
|
+
error?: string;
|
|
8
|
+
/** M35 C4a: a text or textarea item attribute's declared max, so the field stops where the save would refuse. */
|
|
9
|
+
maxLength?: number;
|
|
10
|
+
/** M35 C4a: the field id's prefix, so a block's, an item's and a mark's panels open together never share an id. */
|
|
11
|
+
idPrefix?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function BlockParamField({ spec, value, onChange, error, maxLength, idPrefix }: BlockParamFieldProps): import("react").JSX.Element | null;
|
|
3
14
|
export interface BlockParamFieldsProps {
|
|
4
15
|
listing: BlockListing | null;
|
|
5
16
|
listingsError: string | null;
|
|
@@ -41,19 +41,19 @@ function useMediaParamPreview(mediaId) {
|
|
|
41
41
|
}
|
|
42
42
|
// One field per declared param, keyed by its type (S197 Task 3 brief:
|
|
43
43
|
// text/textarea/number/boolean(switch)/image(MediaPicker)/choice(select)).
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const
|
|
44
|
+
// M35 C4a: exported, so the item panel (item-panel.tsx) draws the six shared types with these same fields. A value
|
|
45
|
+
// is content, so its input takes the content's direction (`dir="auto"`); the label keeps the admin's.
|
|
46
|
+
// The image field is its own component, so only it reads the media API: the
|
|
47
|
+
// other five types draw outside a PluginApiProvider too.
|
|
48
|
+
export function BlockParamField({ spec, value, onChange, error, maxLength, idPrefix = "block-param" }) {
|
|
49
|
+
const fieldId = `${idPrefix}-${spec.key}`;
|
|
50
50
|
switch (spec.type) {
|
|
51
51
|
case "text":
|
|
52
|
-
return (_jsx(PropertyField, { label: spec.label, htmlFor: fieldId, error: error, children: _jsx(Input, { id: fieldId, type: "text", value: value ?? "", onChange: (event) => onChange(event.target.value) }) }));
|
|
52
|
+
return (_jsx(PropertyField, { label: spec.label, htmlFor: fieldId, error: error, children: _jsx(Input, { id: fieldId, type: "text", dir: "auto", maxLength: maxLength, value: value ?? "", onChange: (event) => onChange(event.target.value) }) }));
|
|
53
53
|
case "textarea":
|
|
54
|
-
return (_jsx(PropertyField, { label: spec.label, htmlFor: fieldId, error: error, children: _jsx("textarea", { id: fieldId, rows: 3, value: value ?? "", onChange: (event) => onChange(event.target.value), className: "w-full rounded-md border border-border-strong bg-background-elevated px-3 py-2 text-sm text-text-primary focus-visible:border-primary-600 focus-visible:outline-hidden focus-visible:ring-4 focus-visible:ring-primary-50" }) }));
|
|
54
|
+
return (_jsx(PropertyField, { label: spec.label, htmlFor: fieldId, error: error, children: _jsx("textarea", { id: fieldId, rows: 3, dir: "auto", maxLength: maxLength, value: value ?? "", onChange: (event) => onChange(event.target.value), className: "w-full rounded-md border border-border-strong bg-background-elevated px-3 py-2 text-sm text-text-primary focus-visible:border-primary-600 focus-visible:outline-hidden focus-visible:ring-4 focus-visible:ring-primary-50" }) }));
|
|
55
55
|
case "number":
|
|
56
|
-
return (_jsx(PropertyField, { label: spec.label, htmlFor: fieldId, error: error, children: _jsx(Input, { id: fieldId, type: "number", value: value ?? 0, onChange: (event) => {
|
|
56
|
+
return (_jsx(PropertyField, { label: spec.label, htmlFor: fieldId, error: error, children: _jsx(Input, { id: fieldId, type: "number", dir: "auto", value: value ?? 0, onChange: (event) => {
|
|
57
57
|
// A `type="number"` input still hands back an empty or
|
|
58
58
|
// otherwise unparseable string in plenty of real situations
|
|
59
59
|
// (cleared entirely, "-", "1e", a paste): Number() turns
|
|
@@ -69,22 +69,28 @@ function BlockParamField({ spec, value, onChange, error }) {
|
|
|
69
69
|
case "choice":
|
|
70
70
|
return (_jsx(PropertyField, { label: spec.label, htmlFor: fieldId, error: error, children: _jsx("select", { id: fieldId, value: value ?? "", onChange: (event) => onChange(event.target.value), className: "h-10 w-full rounded-md border border-border-strong bg-background-elevated px-3 text-sm text-text-primary focus-visible:border-primary-600 focus-visible:outline-hidden focus-visible:ring-4 focus-visible:ring-primary-50", children: (spec.options ?? []).map((option) => (_jsx("option", { value: option, children: option }, option))) }) }));
|
|
71
71
|
case "image":
|
|
72
|
-
return (
|
|
73
|
-
// A block param stores the media id and nothing else, so
|
|
74
|
-
// there is nowhere for alt text to go: asking for it here
|
|
75
|
-
// would be collecting something this field then discards.
|
|
76
|
-
, {
|
|
77
|
-
// A block param stores the media id and nothing else, so
|
|
78
|
-
// there is nowhere for alt text to go: asking for it here
|
|
79
|
-
// would be collecting something this field then discards.
|
|
80
|
-
collectAlt: false, onPick: (item) => {
|
|
81
|
-
onChange(item.id);
|
|
82
|
-
setPickerOpen(false);
|
|
83
|
-
}, onClose: () => setPickerOpen(false) }))] }));
|
|
72
|
+
return _jsx(ImageParamField, { spec: spec, value: value, onChange: onChange, error: error });
|
|
84
73
|
default:
|
|
85
74
|
return null;
|
|
86
75
|
}
|
|
87
76
|
}
|
|
77
|
+
function ImageParamField({ spec, value, onChange, error }) {
|
|
78
|
+
const s = useSdkString();
|
|
79
|
+
const [pickerOpen, setPickerOpen] = useState(false);
|
|
80
|
+
const { preview } = useMediaParamPreview(value ?? null);
|
|
81
|
+
return (_jsxs(PropertyField, { label: spec.label, error: error, children: [_jsxs("div", { className: "flex items-center gap-3 rounded-md border border-border-default bg-background-subtle p-2", children: [preview ? (_jsx("img", { src: preview.downloadUrl, alt: "", className: "h-10 w-10 shrink-0 rounded-md object-cover" })) : (_jsx("div", { "aria-hidden": "true", className: "h-10 w-10 shrink-0 rounded-md bg-background-hover" })), _jsx(TruncatedText, { className: "flex-1 truncate text-sm text-text-secondary", children: preview?.filename ?? s("blockPanel.noImage") }), _jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: () => setPickerOpen(true), children: s("blockPanel.change") })] }), pickerOpen && (_jsx(MediaPicker
|
|
82
|
+
// A block param stores the media id and nothing else, so
|
|
83
|
+
// there is nowhere for alt text to go: asking for it here
|
|
84
|
+
// would be collecting something this field then discards.
|
|
85
|
+
, {
|
|
86
|
+
// A block param stores the media id and nothing else, so
|
|
87
|
+
// there is nowhere for alt text to go: asking for it here
|
|
88
|
+
// would be collecting something this field then discards.
|
|
89
|
+
collectAlt: false, onPick: (item) => {
|
|
90
|
+
onChange(item.id);
|
|
91
|
+
setPickerOpen(false);
|
|
92
|
+
}, onClose: () => setPickerOpen(false) }))] }));
|
|
93
|
+
}
|
|
88
94
|
// The typed param field list, extracted out of BlockPanel (S197 Task 12:
|
|
89
95
|
// same reasoning as StyleListbox's own extraction) so the on-page side
|
|
90
96
|
// panel (apps/admin-ui's block-overlay.tsx) can render the exact same
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/core";
|
|
2
|
+
import type { RichItemDirectory } from "./rich-items.js";
|
|
3
|
+
import type { ToolbarEntry } from "./plugin-toolbar.js";
|
|
4
|
+
export declare function PluginButtonViewDialog({ editor, entry, items, culture, returnFocusTo, onClose }: {
|
|
5
|
+
editor: Editor;
|
|
6
|
+
entry: ToolbarEntry;
|
|
7
|
+
items: RichItemDirectory;
|
|
8
|
+
culture: string | null;
|
|
9
|
+
returnFocusTo: HTMLElement | null;
|
|
10
|
+
onClose(): void;
|
|
11
|
+
}): import("react").JSX.Element | null;
|