@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
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
3
|
-
import { CONTENT_LIST_DEFAULT_SETTINGS, } from "@kardalum/api-schemas";
|
|
4
|
-
import { Badge, Button, Input } from "@kardalum/ui";
|
|
5
|
-
import { Lock } from "lucide-react";
|
|
3
|
+
import { BULK_ACTION_ROWS_MAX, CONTENT_LIST_DEFAULT_SETTINGS, LIST_FILTER_UNAVAILABLE_CODE, } from "@kardalum/api-schemas";
|
|
4
|
+
import { Badge, Button, Checkbox, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, IconTooltip, Input, } from "@kardalum/ui";
|
|
5
|
+
import { Ellipsis, Lock } from "lucide-react";
|
|
6
|
+
import { useContentListExtensions } from "../content-list-extensions.js";
|
|
6
7
|
import { MANAGE_API, useContentHost, usePluginApi, usePluginSettings, } from "../plugin-context.js";
|
|
7
8
|
import { useAdminChromeProps, useContentTypingProps, useSdkLocale, useSdkString, } from "../sdk-strings.js";
|
|
8
9
|
/** Column headers for the six built-in row properties, as keys of the
|
|
@@ -44,6 +45,32 @@ function LockMark() {
|
|
|
44
45
|
const NAME_BUTTON_CLASS = "text-start text-sm font-medium text-primary-600 hover:underline " +
|
|
45
46
|
"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-600";
|
|
46
47
|
export const CONTENT_LIST_HEADER_CELL_CLASS = "border-b border-border-default px-2 py-2 text-start text-xs font-medium text-text-secondary";
|
|
48
|
+
// M35 C2: a row's menu trigger, the tree row's own shape (a square icon button).
|
|
49
|
+
const ROW_MENU_TRIGGER_CLASS = "grid size-6 place-items-center rounded-md text-text-secondary hover:bg-background-hover hover:text-text-primary " +
|
|
50
|
+
"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-600";
|
|
51
|
+
// M35 C2: the filter select looks like the search box beside it (the Input component's own classes).
|
|
52
|
+
const FILTER_SELECT_CLASS = "flex h-10 rounded-md border border-border-strong bg-background-elevated px-3 py-2 text-sm text-text-primary " +
|
|
53
|
+
"transition-colors duration-fast focus-visible:border-primary-600 focus-visible:outline-hidden " +
|
|
54
|
+
"focus-visible:ring-4 focus-visible:ring-primary-50";
|
|
55
|
+
// M35 C2 (W5): a filter choice is `<key>::<value>`; `::` occurs in neither (a key is a plugin id and a
|
|
56
|
+
// slot id, a value an option value: none holds a ":"). "" is All pages.
|
|
57
|
+
const FILTER_CHOICE_SEPARATOR = "::";
|
|
58
|
+
function mergePluginCells(previous, answer, rowIds) {
|
|
59
|
+
const next = { ...previous };
|
|
60
|
+
for (const [key, column] of Object.entries(answer)) {
|
|
61
|
+
const before = next[key] ?? { failed: false, cells: {} };
|
|
62
|
+
if (column.failed) {
|
|
63
|
+
next[key] = { failed: true, cells: before.cells };
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
const cells = { ...before.cells };
|
|
67
|
+
for (const id of rowIds) {
|
|
68
|
+
cells[id] = Object.prototype.hasOwnProperty.call(column.cells, id) ? (column.cells[id] ?? null) : null;
|
|
69
|
+
}
|
|
70
|
+
next[key] = { failed: before.failed, cells };
|
|
71
|
+
}
|
|
72
|
+
return next;
|
|
73
|
+
}
|
|
47
74
|
/** A stable React key (and a settings identity) for one column. */
|
|
48
75
|
export function contentListColumnKey(column) {
|
|
49
76
|
return column.kind === "property" ? `property:${column.property}` : `field:${column.fieldId}`;
|
|
@@ -119,6 +146,10 @@ function ContentListTable({ canCreate = false }) {
|
|
|
119
146
|
const locale = useSdkLocale();
|
|
120
147
|
const chrome = useAdminChromeProps();
|
|
121
148
|
const typing = useContentTypingProps();
|
|
149
|
+
// M35 C2 (W5): the plugin columns, filters and actions the admin hands this table; null elsewhere
|
|
150
|
+
// (a plugin's own tests, the dev harness), and then the table is exactly as before.
|
|
151
|
+
const extensions = useContentListExtensions();
|
|
152
|
+
const filterId = useId();
|
|
122
153
|
const columns = useMemo(() => resolveContentListColumns(settings), [settings]);
|
|
123
154
|
// Only the aliases the configured columns actually show, so the
|
|
124
155
|
// response stays bounded by the table rather than the whole document.
|
|
@@ -134,6 +165,22 @@ function ContentListTable({ canCreate = false }) {
|
|
|
134
165
|
// starting over. null is the first page, which is also what a failed
|
|
135
166
|
// first page should retry.
|
|
136
167
|
const [failedCursor, setFailedCursor] = useState(null);
|
|
168
|
+
const [filterChoice, setFilterChoice] = useState("");
|
|
169
|
+
const [pluginCells, setPluginCells] = useState({});
|
|
170
|
+
const [scanCapped, setScanCapped] = useState(false);
|
|
171
|
+
const [filterFailed, setFilterFailed] = useState(false);
|
|
172
|
+
// Bumped whenever the list starts over, so a column answer for the rows of a list that was replaced
|
|
173
|
+
// (a new search, a filter change) is dropped. An append keeps it: Load more does not make the cells
|
|
174
|
+
// of the pages already shown stale.
|
|
175
|
+
const listGeneration = useRef(0);
|
|
176
|
+
// M35 C2: the rows chosen for a bulk action, by id. It survives Load more and is cleared by a new
|
|
177
|
+
// search, a filter change or a refresh. At most BULK_ACTION_ROWS_MAX; a tick past it is refused and
|
|
178
|
+
// `selectionLimitHit` says so.
|
|
179
|
+
const [selected, setSelected] = useState(() => new Set());
|
|
180
|
+
const [selectionLimitHit, setSelectionLimitHit] = useState(false);
|
|
181
|
+
const rowMenuTriggers = useRef(new Map());
|
|
182
|
+
const bulkButtons = useRef(new Map());
|
|
183
|
+
const selectLoadedRef = useRef(null);
|
|
137
184
|
// Set when Load more is clicked, to the row index the first appended row
|
|
138
185
|
// will land on. Load more can be the last page, in which case the button
|
|
139
186
|
// unmounts and focus would fall to the body.
|
|
@@ -154,24 +201,76 @@ function ContentListTable({ canCreate = false }) {
|
|
|
154
201
|
// Guards against an out-of-order response overwriting a newer one
|
|
155
202
|
// (a slow first page landing after a fast filtered page).
|
|
156
203
|
const id = ++requestId.current;
|
|
204
|
+
if (!cursor)
|
|
205
|
+
listGeneration.current += 1;
|
|
206
|
+
const generation = listGeneration.current;
|
|
157
207
|
setLoading(true);
|
|
158
208
|
setError(null);
|
|
209
|
+
setFilterFailed(false);
|
|
159
210
|
try {
|
|
160
211
|
const params = new URLSearchParams({ limit: String(PAGE_SIZE) });
|
|
161
212
|
if (fieldsParam)
|
|
162
213
|
params.set("fields", fieldsParam);
|
|
163
214
|
if (appliedSearch)
|
|
164
215
|
params.set("name", appliedSearch);
|
|
216
|
+
if (filterChoice) {
|
|
217
|
+
const at = filterChoice.indexOf(FILTER_CHOICE_SEPARATOR);
|
|
218
|
+
params.set("filter", filterChoice.slice(0, at));
|
|
219
|
+
params.set("filterValue", filterChoice.slice(at + FILTER_CHOICE_SEPARATOR.length));
|
|
220
|
+
// The filter matches in the language the plugin columns are read in.
|
|
221
|
+
if (extensions?.culture)
|
|
222
|
+
params.set("culture", extensions.culture);
|
|
223
|
+
}
|
|
165
224
|
if (cursor)
|
|
166
225
|
params.set("cursor", cursor);
|
|
167
226
|
const response = await fetchApi(`${MANAGE_API}/content/${nodeId}/list?${params.toString()}`);
|
|
168
|
-
if (!response.ok)
|
|
227
|
+
if (!response.ok) {
|
|
228
|
+
// A filter the plugin could not answer is its own state, not the list failing: the person
|
|
229
|
+
// can try again or go back to All pages. Any other refusal is the existing error.
|
|
230
|
+
let code;
|
|
231
|
+
try {
|
|
232
|
+
code = (await response.json())?.code;
|
|
233
|
+
}
|
|
234
|
+
catch {
|
|
235
|
+
code = undefined;
|
|
236
|
+
}
|
|
237
|
+
if (code === LIST_FILTER_UNAVAILABLE_CODE) {
|
|
238
|
+
if (id !== requestId.current)
|
|
239
|
+
return;
|
|
240
|
+
if (!cursor)
|
|
241
|
+
setItems([]);
|
|
242
|
+
// Retry asks for this page again, so a failed Load more keeps its place in the list.
|
|
243
|
+
setFailedCursor(cursor);
|
|
244
|
+
setNextCursor(null);
|
|
245
|
+
setScanCapped(false);
|
|
246
|
+
setFilterFailed(true);
|
|
247
|
+
focusRowIndex.current = null;
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
169
250
|
throw new Error(`Request failed (${response.status})`);
|
|
251
|
+
}
|
|
170
252
|
const body = (await response.json());
|
|
171
253
|
if (id !== requestId.current)
|
|
172
254
|
return;
|
|
173
255
|
setItems((previous) => (cursor ? [...previous, ...body.items] : body.items));
|
|
174
256
|
setNextCursor(body.nextCursor);
|
|
257
|
+
setScanCapped(body.scanCapped === true);
|
|
258
|
+
if (!cursor)
|
|
259
|
+
setPluginCells({});
|
|
260
|
+
const rowIds = body.items.map((row) => row.id);
|
|
261
|
+
if (extensions && extensions.columns.length > 0 && rowIds.length > 0) {
|
|
262
|
+
void extensions.loadCells(rowIds).then((answer) => {
|
|
263
|
+
if (generation !== listGeneration.current)
|
|
264
|
+
return;
|
|
265
|
+
setPluginCells((previous) => mergePluginCells(previous, answer, rowIds));
|
|
266
|
+
}, () => {
|
|
267
|
+
// loadCells answers a failed column itself; a throw is the same failure for every column.
|
|
268
|
+
if (generation !== listGeneration.current)
|
|
269
|
+
return;
|
|
270
|
+
const failed = Object.fromEntries(extensions.columns.map((column) => [column.key, { failed: true, cells: {} }]));
|
|
271
|
+
setPluginCells((previous) => mergePluginCells(previous, failed, rowIds));
|
|
272
|
+
});
|
|
273
|
+
}
|
|
175
274
|
}
|
|
176
275
|
catch {
|
|
177
276
|
if (id !== requestId.current)
|
|
@@ -185,7 +284,7 @@ function ContentListTable({ canCreate = false }) {
|
|
|
185
284
|
if (id === requestId.current)
|
|
186
285
|
setLoading(false);
|
|
187
286
|
}
|
|
188
|
-
}, [appliedSearch, fetchApi, fieldsParam, nodeId, s]);
|
|
287
|
+
}, [appliedSearch, extensions, fetchApi, fieldsParam, filterChoice, nodeId, s]);
|
|
189
288
|
// `load` changes identity whenever the filter does, which is what makes
|
|
190
289
|
// a changed search term restart from the first page: a cursor minted
|
|
191
290
|
// against the unfiltered list points into a different result set and is
|
|
@@ -203,9 +302,28 @@ function ContentListTable({ canCreate = false }) {
|
|
|
203
302
|
if (index === null || items.length <= index)
|
|
204
303
|
return;
|
|
205
304
|
focusRowIndex.current = null;
|
|
206
|
-
|
|
305
|
+
// The name button by its mark: a row's checkbox and menu trigger are buttons too (M35 C2).
|
|
306
|
+
bodyRef.current?.querySelectorAll("tr")[index]?.querySelector("button[data-content-list-name]")?.focus();
|
|
207
307
|
}, [items]);
|
|
208
308
|
const dateFormat = useMemo(() => new Intl.DateTimeFormat(locale, { dateStyle: "medium" }), [locale]);
|
|
309
|
+
// M35 C2: whenever the list starts over (a new search or filter, new extensions when the editor's or
|
|
310
|
+
// the admin's language switched), it is a different list, so what was chosen in the old one is dropped.
|
|
311
|
+
// `load` changes identity exactly then, as the effect that loads the first page says.
|
|
312
|
+
useEffect(() => {
|
|
313
|
+
setSelected((previous) => (previous.size === 0 ? previous : new Set()));
|
|
314
|
+
setSelectionLimitHit(false);
|
|
315
|
+
}, [load]);
|
|
316
|
+
const clearSelection = useCallback(() => {
|
|
317
|
+
setSelected(new Set());
|
|
318
|
+
setSelectionLimitHit(false);
|
|
319
|
+
}, []);
|
|
320
|
+
// A plugin action that changed pages asks for the first page again; the old selection goes with it.
|
|
321
|
+
const refresh = useCallback(() => {
|
|
322
|
+
clearSelection();
|
|
323
|
+
void load(null);
|
|
324
|
+
}, [clearSelection, load]);
|
|
325
|
+
// M35 C2: each row's tree actions, asked once per list of rows.
|
|
326
|
+
const rowActionLists = useMemo(() => new Map(items.map((row) => [row.id, extensions?.rowActions(row) ?? []])), [items, extensions]);
|
|
209
327
|
// A host with no page (the Data Types editor, which hosts this
|
|
210
328
|
// context only for its document types) is the same state as no host at
|
|
211
329
|
// all as far as a table of children goes.
|
|
@@ -225,7 +343,7 @@ function ContentListTable({ canCreate = false }) {
|
|
|
225
343
|
}
|
|
226
344
|
switch (column.property) {
|
|
227
345
|
case "name":
|
|
228
|
-
return (_jsxs("span", { className: "inline-flex items-center gap-2", children: [readable ? (_jsx("button", { type: "button", dir: "auto", className: NAME_BUTTON_CLASS, onClick: () => page.openContent(row.id), children: row.name })) : (_jsx("span", { dir: "auto", className: "text-sm text-text-tertiary", children: row.name })), isRestrictedForYou(row) && _jsx(LockMark, {})] }));
|
|
346
|
+
return (_jsxs("span", { className: "inline-flex items-center gap-2", children: [readable ? (_jsx("button", { type: "button", dir: "auto", "data-content-list-name": "", className: NAME_BUTTON_CLASS, onClick: () => page.openContent(row.id), children: row.name })) : (_jsx("span", { dir: "auto", className: "text-sm text-text-tertiary", children: row.name })), isRestrictedForYou(row) && _jsx(LockMark, {})] }));
|
|
229
347
|
case "id":
|
|
230
348
|
return _jsx("span", { className: "font-mono text-xs text-text-secondary", children: row.id });
|
|
231
349
|
case "url":
|
|
@@ -239,7 +357,88 @@ function ContentListTable({ canCreate = false }) {
|
|
|
239
357
|
}
|
|
240
358
|
}
|
|
241
359
|
const documentTypes = host.documentTypes;
|
|
242
|
-
|
|
360
|
+
const pluginColumns = extensions?.columns ?? [];
|
|
361
|
+
const pluginFilters = extensions?.filters ?? [];
|
|
362
|
+
// M35 C2: a plugin column's cell is the plugin's plain text, rendered as a text child (never HTML).
|
|
363
|
+
function renderPluginCell(row, key) {
|
|
364
|
+
if (row.access?.read === false) {
|
|
365
|
+
return _jsx("span", { className: "text-text-tertiary", children: s("contentList.restricted") });
|
|
366
|
+
}
|
|
367
|
+
const column = pluginCells[key];
|
|
368
|
+
if (column && Object.prototype.hasOwnProperty.call(column.cells, row.id)) {
|
|
369
|
+
const text = column.cells[row.id];
|
|
370
|
+
return text === null || text === undefined ? null : _jsx("span", { dir: "auto", children: text });
|
|
371
|
+
}
|
|
372
|
+
if (column?.failed)
|
|
373
|
+
return _jsx("span", { className: "text-text-tertiary", children: s("contentList.cellUnavailable") });
|
|
374
|
+
return null;
|
|
375
|
+
}
|
|
376
|
+
// M35 C2: row menus show while any loaded row has a tree action; the checkbox column while any bulk
|
|
377
|
+
// action is usable. A row the person may not read can be neither acted on nor selected.
|
|
378
|
+
const anyRowActions = [...rowActionLists.values()].some((list) => list.length > 0);
|
|
379
|
+
const bulkActions = extensions?.bulkActions ?? [];
|
|
380
|
+
const selecting = bulkActions.length > 0;
|
|
381
|
+
const readableRows = items.filter((row) => row.access?.read !== false);
|
|
382
|
+
const selectedRows = items.filter((row) => selected.has(row.id));
|
|
383
|
+
const allLoadedSelected = readableRows.length > 0 && readableRows.every((row) => selected.has(row.id));
|
|
384
|
+
function toggleRow(row) {
|
|
385
|
+
if (selected.has(row.id)) {
|
|
386
|
+
const next = new Set(selected);
|
|
387
|
+
next.delete(row.id);
|
|
388
|
+
setSelected(next);
|
|
389
|
+
setSelectionLimitHit(false);
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
if (selected.size >= BULK_ACTION_ROWS_MAX) {
|
|
393
|
+
setSelectionLimitHit(true);
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
setSelected(new Set(selected).add(row.id));
|
|
397
|
+
}
|
|
398
|
+
function toggleLoaded() {
|
|
399
|
+
if (allLoadedSelected) {
|
|
400
|
+
clearSelection();
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
const next = new Set(selected);
|
|
404
|
+
for (const row of readableRows) {
|
|
405
|
+
if (next.size >= BULK_ACTION_ROWS_MAX)
|
|
406
|
+
break;
|
|
407
|
+
next.add(row.id);
|
|
408
|
+
}
|
|
409
|
+
setSelected(next);
|
|
410
|
+
setSelectionLimitHit(readableRows.some((row) => !next.has(row.id)));
|
|
411
|
+
}
|
|
412
|
+
function openBulk(key) {
|
|
413
|
+
extensions?.openBulkAction(key, selectedRows, (result) => {
|
|
414
|
+
if (result.refresh) {
|
|
415
|
+
refresh();
|
|
416
|
+
selectLoadedRef.current?.focus();
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
const button = bulkButtons.current.get(key);
|
|
420
|
+
if (button?.isConnected)
|
|
421
|
+
button.focus();
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
function openRowAction(key, row) {
|
|
425
|
+
extensions?.openRowAction(key, row, (result) => {
|
|
426
|
+
if (result.refresh)
|
|
427
|
+
refresh();
|
|
428
|
+
rowMenuTriggers.current.get(row.id)?.focus();
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
return (_jsxs("div", { ...chrome, className: "flex flex-col gap-3", children: [_jsxs("div", { className: "flex flex-wrap items-end gap-3", children: [_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("label", { htmlFor: searchId, className: "text-xs font-medium text-text-secondary", children: s("contentList.search") }), _jsx(Input, { id: searchId, ...typing, value: search, onChange: (event) => setSearch(event.target.value) })] }), pluginFilters.length > 0 && (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("label", { htmlFor: filterId, className: "text-xs font-medium text-text-secondary", children: s("contentList.filter") }), _jsxs("select", { id: filterId, className: FILTER_SELECT_CLASS, value: filterChoice, onChange: (event) => setFilterChoice(event.target.value), children: [_jsx("option", { value: "", children: s("contentList.filterAll") }), pluginFilters.map((filter) => (_jsx("optgroup", { label: filter.label, children: filter.options.map((option) => (_jsx("option", { value: `${filter.key}${FILTER_CHOICE_SEPARATOR}${option.value}`, children: option.label }, option.value))) }, filter.key)))] })] })), canCreate && (_jsx(Button, { type: "button", className: "ms-auto", onClick: () => page.createChild(page.nodeId), children: s("contentList.new") }))] }), error && (_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("p", { role: "alert", className: "text-sm text-danger-600", children: error }), _jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: () => void load(failedCursor), children: s("contentList.retry") })] })), selecting && selected.size > 0 && (_jsxs("div", { role: "group", "aria-label": s("contentList.bulkActionsLabel"), className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "text-sm text-text-secondary", children: s("contentList.selectedCount", { selected: selected.size }) }), bulkActions.map((action) => (_jsx(Button, { ref: (element) => {
|
|
432
|
+
if (element)
|
|
433
|
+
bulkButtons.current.set(action.key, element);
|
|
434
|
+
else
|
|
435
|
+
bulkButtons.current.delete(action.key);
|
|
436
|
+
}, type: "button", variant: "outline", size: "sm", disabled: action.admits !== undefined && !selectedRows.some(action.admits), onClick: () => openBulk(action.key), children: _jsx("span", { dir: "auto", children: action.label }) }, action.key))), _jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: clearSelection, children: s("contentList.clearSelection") })] })), selecting && selectionLimitHit && (_jsx("p", { role: "status", className: "text-sm text-text-secondary", children: s("contentList.selectionLimit", { max: BULK_ACTION_ROWS_MAX }) })), items.length > 0 && (_jsxs("table", { className: "w-full border-collapse text-sm text-text-primary", children: [_jsx("caption", { className: "sr-only", children: s("contentList.caption") }), _jsx("thead", { children: _jsxs("tr", { children: [selecting && (_jsx("th", { scope: "col", className: CONTENT_LIST_HEADER_CELL_CLASS, children: _jsx(Checkbox, { ref: selectLoadedRef, "aria-label": s("contentList.selectLoaded"), checked: allLoadedSelected ? true : selected.size > 0 ? "indeterminate" : false, disabled: readableRows.length === 0, onCheckedChange: toggleLoaded }) })), columns.map((column) => (_jsx("th", { scope: "col", className: CONTENT_LIST_HEADER_CELL_CLASS, children: contentListColumnHeader(column, documentTypes, s) }, contentListColumnKey(column)))), pluginColumns.map((column) => (_jsx("th", { scope: "col", className: CONTENT_LIST_HEADER_CELL_CLASS, children: _jsx("span", { dir: "auto", children: column.header }) }, `plugin:${column.key}`))), anyRowActions && (_jsx("th", { scope: "col", className: CONTENT_LIST_HEADER_CELL_CLASS, children: _jsx("span", { className: "sr-only", children: s("contentList.rowActionsHeader") }) }))] }) }), _jsx("tbody", { ref: bodyRef, children: items.map((row) => (_jsxs("tr", { children: [selecting && (_jsx("td", { className: "border-b border-border-subtle px-2 py-2 align-top", children: _jsx(Checkbox, { "aria-label": s("contentList.select", { name: row.name }), checked: selected.has(row.id), disabled: row.access?.read === false, onCheckedChange: () => toggleRow(row) }) })), columns.map((column) => (_jsx("td", { className: "border-b border-border-subtle px-2 py-2 align-top", children: renderCell(row, column, page) }, contentListColumnKey(column)))), pluginColumns.map((column) => (_jsx("td", { className: "border-b border-border-subtle px-2 py-2 align-top", children: renderPluginCell(row, column.key) }, `plugin:${column.key}`))), anyRowActions && (_jsx("td", { className: "border-b border-border-subtle px-2 py-2 align-top", children: (rowActionLists.get(row.id) ?? []).length > 0 && (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(IconTooltip, { children: _jsx("button", { ref: (element) => {
|
|
437
|
+
if (element)
|
|
438
|
+
rowMenuTriggers.current.set(row.id, element);
|
|
439
|
+
else
|
|
440
|
+
rowMenuTriggers.current.delete(row.id);
|
|
441
|
+
}, type: "button", "aria-label": s("contentList.rowActions", { name: row.name }), className: ROW_MENU_TRIGGER_CLASS, children: _jsx(Ellipsis, { "aria-hidden": "true", className: "size-4" }) }) }) }), _jsx(DropdownMenuContent, { align: "end", children: (rowActionLists.get(row.id) ?? []).map((action) => (_jsx(DropdownMenuItem, { onSelect: () => openRowAction(action.key, row), children: _jsx("span", { dir: "auto", children: action.label }) }, action.key))) })] })) }))] }, row.id))) })] })), loading && (_jsx("p", { role: "status", className: "text-sm text-text-secondary", children: s("contentList.loading") })), filterFailed && (_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("p", { role: "alert", className: "text-sm text-danger-600", children: s("contentList.filterUnavailable") }), _jsx(Button, { type: "button", variant: "outline", size: "sm", disabled: loading, onClick: () => void load(failedCursor), children: s("contentList.retry") })] })), scanCapped && !loading && (_jsx("p", { role: "status", className: "text-sm text-text-secondary", children: s("contentList.scanCapped") })), !loading && !error && !filterFailed && items.length === 0 && (_jsx("p", { role: "status", className: "text-sm text-text-secondary", children: appliedSearch || filterChoice ? s("contentList.noMatches") : s("contentList.noChildren") })), nextCursor !== null && (_jsx(Button, { type: "button", variant: "outline", size: "sm", className: "self-start", disabled: loading, onClick: () => {
|
|
243
442
|
focusRowIndex.current = items.length;
|
|
244
443
|
void load(nextCursor);
|
|
245
444
|
}, children: s("contentList.loadMore") }))] }));
|
|
@@ -55,7 +55,7 @@ export function ContentPickerInputView() {
|
|
|
55
55
|
const markText = mark === null ? null : t(`contentPicker.${mark}`);
|
|
56
56
|
const name = summary?.name ?? markText ?? t("contentPicker.loading");
|
|
57
57
|
return (_jsxs("li", { className: "flex items-center gap-2 rounded-md border border-border-default px-3 py-2", children: [_jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [summary?.name != null && _jsx(TruncatedText, { className: "truncate text-sm text-text-primary", children: summary.name }), summary === undefined && inFlight && _jsx(TruncatedText, { className: "truncate text-sm text-text-tertiary", children: name }), summary?.path && _jsx(TruncatedText, { className: "truncate text-xs text-text-tertiary", children: summary.path }), markText !== null && (_jsx("span", { className: cn("text-xs", summary?.name != null ? "text-text-secondary" : "text-sm text-text-primary"), children: markText }))] }), settings.multiple && (_jsxs(_Fragment, { children: [_jsx(IconTooltip, { children: _jsx(Button, { type: "button", variant: "ghost", size: "sm", disabled: index === 0, "aria-label": t("contentPicker.moveUp", { name }), onClick: () => move(index, -1), children: _jsx("span", { "aria-hidden": "true", children: "\u2191" }) }) }), _jsx(IconTooltip, { children: _jsx(Button, { type: "button", variant: "ghost", size: "sm", disabled: index === ids.length - 1, "aria-label": t("contentPicker.moveDown", { name }), onClick: () => move(index, 1), children: _jsx("span", { "aria-hidden": "true", children: "\u2193" }) }) })] })), _jsx(IconTooltip, { children: _jsx(Button, { type: "button", variant: "ghost", size: "sm", "aria-label": t("contentPicker.removeNamed", { name }), onClick: () => store(ids.filter((entry) => entry !== id)), children: _jsx("span", { "aria-hidden": "true", children: "\u00D7" }) }) })] }, id));
|
|
58
|
-
}) })), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Button, { id: controlId, "aria-label": t(openKey), "aria-invalid": invalid, "aria-describedby": describedBy, type: "button", variant: "outline", size: "sm", disabled: full, onClick: () => setOpen(true), children: t(openKey) }), full && _jsx("span", { className: "text-xs text-text-secondary", children: t("contentPicker.atMax", { max: limit }) })] }), _jsx(PagePickerSheet, { open: open, onOpenChange: setOpen, startNode: settings.startNode, documentTypes: offeredTypes, multiple: settings.multiple, remaining: settings.multiple ? remaining : 1, chosen: ids, onChoose: (picked) => {
|
|
58
|
+
}) })), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Button, { id: controlId, "aria-label": t(openKey), "aria-invalid": invalid, "aria-describedby": describedBy, type: "button", variant: "outline", size: "sm", disabled: full, onClick: () => setOpen(true), children: t(openKey) }), full && _jsx("span", { className: "text-xs text-text-secondary", children: t("contentPicker.atMax", { max: limit }) })] }), _jsx(PagePickerSheet, { open: open, onOpenChange: setOpen, startNode: settings.startNode, documentTypes: offeredTypes, multiple: settings.multiple, remaining: settings.multiple ? remaining : 1, max: settings.multiple ? limit : 1, chosen: ids, onChoose: (picked) => {
|
|
59
59
|
if (settings.multiple)
|
|
60
60
|
store([...ids, ...picked.filter((id) => !ids.includes(id))].slice(0, limit));
|
|
61
61
|
else
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
/** M35 C4a (design section 5): two values equal by value, whatever order a database kept their keys in. */
|
|
2
|
+
export declare function richTextValuesEqual(a: unknown, b: unknown): boolean;
|
|
1
3
|
export declare function RichTextInputView(): import("react").JSX.Element;
|
|
2
4
|
export declare function RichTextReadOnlyView(): import("react").JSX.Element;
|