@kardalum/plugin-sdk 0.19.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 +281 -0
- package/README.md +19 -0
- package/dist/admin-section-registry.d.ts +48 -1
- package/dist/admin-section-registry.js +90 -0
- package/dist/built-in-editor-ids.d.ts +1 -1
- package/dist/built-in-editor-ids.js +2 -20
- package/dist/built-in-settings-schemas.d.ts +10 -0
- package/dist/built-in-settings-schemas.js +86 -0
- package/dist/built-in-value-schemas.js +35 -0
- package/dist/built-ins.js +38 -7
- package/dist/capabilities.d.ts +11 -1
- package/dist/capabilities.js +101 -4
- package/dist/cli.d.ts +66 -0
- package/dist/cli.js +22 -0
- package/dist/consent-entry.d.ts +11 -0
- package/dist/consent-entry.js +18 -0
- package/dist/content-library.d.ts +102 -0
- package/dist/content-library.js +15 -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 +15 -0
- package/dist/content-picker/page-picker-sheet.js +105 -0
- package/dist/content-picker/page-picker.d.ts +18 -0
- package/dist/content-picker/page-picker.js +20 -0
- package/dist/content-picker/page-tree.d.ts +25 -0
- package/dist/content-picker/page-tree.js +132 -0
- package/dist/data-type-plugin.d.ts +7 -1
- package/dist/datatype-validation.d.ts +4 -9
- package/dist/datatype-validation.js +147 -1
- package/dist/datatypes-entry.d.ts +1 -0
- package/dist/datatypes-entry.js +2 -0
- package/dist/entitlement-entry.d.ts +1 -1
- package/dist/entitlement-entry.js +1 -1
- package/dist/entitlement-gate.d.ts +14 -0
- package/dist/entitlement-gate.js +64 -7
- package/dist/entitlement-plan.d.ts +6 -0
- package/dist/entitlement-plan.js +10 -0
- package/dist/entitlement-types.d.ts +53 -12
- package/dist/entitlement.d.ts +31 -4
- package/dist/entitlement.js +58 -17
- package/dist/hook-entry.d.ts +5 -0
- package/dist/hook-entry.js +30 -0
- package/dist/host-entry.d.ts +7 -1
- package/dist/host-entry.js +14 -1
- package/dist/index.d.ts +67 -7
- package/dist/index.js +94 -6
- package/dist/mail.d.ts +34 -0
- package/dist/mail.js +1 -0
- package/dist/manifest-entry.d.ts +47 -4
- package/dist/manifest-entry.js +63 -2
- package/dist/manifest-schema.d.ts +993 -40
- package/dist/manifest-schema.js +516 -26
- package/dist/manifest.d.ts +1186 -62
- package/dist/manifest.js +8 -4
- package/dist/media/media-picker.js +31 -18
- package/dist/media/upload-error.d.ts +5 -1
- package/dist/media/upload-error.js +14 -2
- package/dist/media-library.d.ts +32 -0
- package/dist/media-library.js +15 -0
- package/dist/nested-field-host.d.ts +76 -0
- package/dist/nested-field-host.js +90 -0
- package/dist/notify.d.ts +12 -4
- package/dist/notify.js +1 -1
- package/dist/outbound.d.ts +47 -0
- package/dist/outbound.js +1 -0
- package/dist/plugin-context.d.ts +52 -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 +262 -9
- package/dist/plugin-screen-context.js +56 -0
- package/dist/providers.d.ts +313 -0
- package/dist/providers.js +74 -0
- package/dist/read-all-pages.d.ts +5 -0
- package/dist/read-all-pages.js +3 -2
- package/dist/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 +36 -25
- 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 +45 -22
- 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/style-listbox.js +6 -4
- 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 +344 -0
- package/dist/sdk-strings.js +411 -0
- package/dist/sealing.d.ts +14 -0
- package/dist/sealing.js +1 -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/simple-storage-value-provider.js +24 -24
- package/dist/structured-storage-types.d.ts +429 -9
- 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 -0
- package/dist/text-entry.js +7 -0
- package/dist/tokens/system-dark.css +1 -0
- package/dist/tokens/tailwind-theme.css +7 -0
- package/dist/tokens/tokens.css +19 -3
- package/dist/tokens/tokens.json +13 -4
- 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/asset-view.js +4 -1
- package/dist/views/content-list-preview.js +3 -1
- package/dist/views/content-list-settings-view.js +11 -7
- package/dist/views/content-list-view.d.ts +5 -3
- package/dist/views/content-list-view.js +243 -40
- package/dist/views/content-picker-view.d.ts +3 -0
- package/dist/views/content-picker-view.js +143 -0
- package/dist/views/crop-view.d.ts +4 -6
- package/dist/views/crop-view.js +22 -13
- package/dist/views/date-range-view.js +4 -1
- package/dist/views/file-upload-view.d.ts +5 -7
- package/dist/views/file-upload-view.js +16 -7
- package/dist/views/group-view.d.ts +8 -0
- package/dist/views/group-view.js +123 -0
- package/dist/views/html-view.js +7 -6
- package/dist/views/image-view.js +37 -19
- package/dist/views/link-view.d.ts +3 -0
- package/dist/views/link-view.js +150 -0
- package/dist/views/options-list-view.d.ts +3 -0
- package/dist/views/options-list-view.js +104 -0
- package/dist/views/repeatable-list-view.d.ts +3 -0
- package/dist/views/repeatable-list-view.js +113 -0
- package/dist/views/rich-text-view.d.ts +2 -0
- package/dist/views/rich-text-view.js +208 -35
- package/dist/views/suggest-key.d.ts +17 -0
- package/dist/views/suggest-key.js +55 -0
- 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 +334 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.js +254 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.js +10 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +5 -0
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +11 -1
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +4 -2
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.d.ts +8 -0
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.js +38 -0
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.d.ts +65 -0
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.js +144 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +115 -3
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +58 -11
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +137 -2
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +178 -2
- package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/content-path.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/content-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/content-search.schema.d.ts +50 -0
- package/node_modules/@kardalum/api-schemas/dist/content-search.schema.js +42 -0
- package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.d.ts +37 -0
- package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.js +19 -0
- package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +3 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.js +10 -0
- package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.js +86 -0
- package/node_modules/@kardalum/api-schemas/dist/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 +55 -13
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +22 -10
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +25 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +8 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/data-type-issue.d.ts +35 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-issue.js +60 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +257 -15
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +78 -5
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +24 -6
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +90 -5
- 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/form-protection.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/form-protection.js +12 -0
- package/node_modules/@kardalum/api-schemas/dist/graphql-limits.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/graphql-limits.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/held-embed-words.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/held-embed-words.js +70 -0
- package/node_modules/@kardalum/api-schemas/dist/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 +162 -48
- package/node_modules/@kardalum/api-schemas/dist/index.js +137 -30
- package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/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/legal-anchors.d.ts +8 -0
- package/node_modules/@kardalum/api-schemas/dist/legal-anchors.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +63 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +54 -0
- package/node_modules/@kardalum/api-schemas/dist/mail-rules.d.ts +226 -0
- package/node_modules/@kardalum/api-schemas/dist/mail-rules.js +409 -0
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +8 -0
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +4 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.d.ts +145 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.js +154 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +490 -10
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +53 -3
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.d.ts +15 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.d.ts +131 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.js +272 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.d.ts +84 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.js +138 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.d.ts +20 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.js +49 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.d.ts +211 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.js +424 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.d.ts +78 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.d.ts +70 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.js +43 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +38 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +13 -1
- package/node_modules/@kardalum/api-schemas/dist/media-move.schema.d.ts +75 -0
- package/node_modules/@kardalum/api-schemas/dist/media-move.schema.js +53 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +2 -2
- package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.js +8 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.d.ts +204 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.js +370 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-validation.d.ts +60 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-validation.js +333 -0
- package/node_modules/@kardalum/api-schemas/dist/news.schema.d.ts +5 -5
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +1 -2
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +1 -2
- package/node_modules/@kardalum/api-schemas/dist/notification-kinds.d.ts +145 -0
- package/node_modules/@kardalum/api-schemas/dist/notification-kinds.js +177 -0
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.d.ts +258 -7
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.js +96 -5
- package/node_modules/@kardalum/api-schemas/dist/page-address.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/page-address.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/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/password-reset.schema.d.ts +34 -0
- package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.js +60 -0
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.d.ts +28 -3
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.js +55 -8
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-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-caller.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-caller.js +16 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.d.ts +76 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.js +316 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.d.ts +44 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.js +84 -0
- 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-data-type-configs.d.ts +31 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.js +131 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +44 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +44 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +16 -5
- package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.d.ts +228 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.js +41 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.d.ts +34 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.js +102 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.d.ts +43 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.js +126 -0
- 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-field-info.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.js +51 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.d.ts +32 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.js +102 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-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 +119 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.js +216 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.js +21 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +46 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +41 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +304 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +220 -6
- 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-labels.d.ts +26 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +29 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +32 -8
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +120 -14
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +408 -14
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +307 -23
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +23 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +61 -3
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.d.ts +40 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.js +139 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +23 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +37 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.d.ts +25 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.js +43 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.d.ts +107 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.js +150 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-providers.d.ts +346 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-providers.js +461 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.js +2 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-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-sealed-values.d.ts +45 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.js +99 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.d.ts +68 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.js +114 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-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 +352 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-settings.js +409 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.d.ts +347 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.js +976 -0
- 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-storage-api.schema.d.ts +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +47 -4
- 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-tasks.d.ts +45 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.js +197 -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/plural-rules.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/plural-rules.js +41 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +100 -12
- package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.d.ts +189 -0
- package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.js +164 -0
- package/node_modules/@kardalum/api-schemas/dist/render-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 +307 -4
- package/node_modules/@kardalum/api-schemas/dist/render-editing.js +61 -0
- package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +7 -3
- 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 +71 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.js +540 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-text.d.ts +66 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-text.js +394 -0
- package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.d.ts +82 -0
- package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.js +99 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +28 -0
- package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +201 -1
- 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 +97 -8
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +64 -1
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +136 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +53 -2
- 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 +386 -0
- package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.js +618 -0
- 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/snapshot-api.schema.d.ts +3 -3
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.js +26 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.d.ts +70 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.js +188 -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/template.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.js +29 -0
- package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.js +6 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +72 -1
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +36 -3
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.d.ts +5 -1
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.js +4 -3
- package/node_modules/@kardalum/api-schemas/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 +2 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.js +15 -1
- package/node_modules/@kardalum/design-tokens/dist/system-dark.css +1 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +7 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +2 -1
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +2 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +19 -3
- package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +18 -3
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +13 -4
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +5 -1
- package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +38 -2
- package/node_modules/@kardalum/plugin-package/dist/build-reference.js +17 -2
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +17 -10
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +625 -35
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +25 -0
- package/node_modules/@kardalum/plugin-package/dist/cms-range.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/cms-range.js +353 -0
- package/node_modules/@kardalum/plugin-package/dist/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/ai-declarations.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.js +26 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +3 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/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.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.js +47 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +2 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.js +40 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.js +22 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/icons.js +3 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +76 -6
- package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.d.ts +27 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.js +99 -0
- 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/locales.js +9 -4
- package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.js +68 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/providers.d.ts +5 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/providers.js +316 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +40 -4
- 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 +91 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.d.ts +6 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.js +150 -0
- 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.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.js +69 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +21 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +17 -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 +8 -2
- package/node_modules/@kardalum/plugin-package/dist/index.js +7 -1
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +75 -0
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +123 -0
- package/node_modules/@kardalum/plugin-package/dist/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/switch.js +1 -1
- 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/components/tooltip.js +1 -2
- package/node_modules/@kardalum/ui/dist/components/truncated-text.d.ts +6 -1
- package/node_modules/@kardalum/ui/dist/components/truncated-text.js +5 -4
- package/node_modules/@kardalum/ui/dist/index.d.ts +2 -0
- package/node_modules/@kardalum/ui/dist/index.js +2 -0
- package/package.json +25 -3
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useId, useState } from "react";
|
|
3
|
+
import { CONTENT_PICKER_MAX_ITEMS, readContentPickerSettings, readPickedIds } from "@kardalum/api-schemas";
|
|
4
|
+
import { Button, Checkbox, IconTooltip, Input, PropertyField, TruncatedText, cn, usePropertyFieldControl } from "@kardalum/ui";
|
|
5
|
+
import { PagePickerSheet } from "../content-picker/page-picker-sheet.js";
|
|
6
|
+
import { summaryMark, usePageSummaries } from "../content-picker/page-tree.js";
|
|
7
|
+
import { MANAGE_API, usePluginApi, usePluginSettings, usePluginSettingsValue, usePluginValue } from "../plugin-context.js";
|
|
8
|
+
import { usePluginTranslate } from "../plugin-screen-context.js";
|
|
9
|
+
import { readAllPages } from "../read-all-pages.js";
|
|
10
|
+
import { useAdminChromeProps } from "../sdk-strings.js";
|
|
11
|
+
export function ContentPickerInputView() {
|
|
12
|
+
const { value, onChange } = usePluginValue();
|
|
13
|
+
const settings = readContentPickerSettings(usePluginSettings());
|
|
14
|
+
// M32 J (fix wave 2): an id that names no page type (one deleted since, or named by a restored
|
|
15
|
+
// data type) is ignored, as the server ignores it: the types that still exist are offered, and a
|
|
16
|
+
// list with none left offers every page type. Until the types are read, the list is used as stored.
|
|
17
|
+
const pageTypes = usePageTypes(settings.documentTypes.length > 0);
|
|
18
|
+
const offeredTypes = pageTypes.loaded
|
|
19
|
+
? settings.documentTypes.filter((id) => pageTypes.types.some((type) => type.id.toLowerCase() === id))
|
|
20
|
+
: settings.documentTypes;
|
|
21
|
+
const field = usePropertyFieldControl();
|
|
22
|
+
// M32 I2: the group is named and described by the field; the label's `for` (the control id)
|
|
23
|
+
// names the choose button, so a click on the label reaches it, and the button keeps its own
|
|
24
|
+
// name. M32 I5: aria-invalid sits on the button the label names (not a group attribute), and the
|
|
25
|
+
// button carries the error description too.
|
|
26
|
+
// The error description sits on the button only (not the group too), so it is read once.
|
|
27
|
+
const { id: controlId, "aria-invalid": invalid, "aria-describedby": describedBy, ...groupWiring } = field;
|
|
28
|
+
const t = usePluginTranslate();
|
|
29
|
+
const chrome = useAdminChromeProps();
|
|
30
|
+
const [open, setOpen] = useState(false);
|
|
31
|
+
// A list stored under a single setting still shows every entry; the validator asks to keep one.
|
|
32
|
+
const ids = readPickedIds(value);
|
|
33
|
+
const summaries = usePageSummaries(ids);
|
|
34
|
+
const limit = settings.multiple ? (settings.max ?? CONTENT_PICKER_MAX_ITEMS) : 1;
|
|
35
|
+
const remaining = Math.max(0, limit - ids.length);
|
|
36
|
+
const full = remaining === 0 && settings.multiple;
|
|
37
|
+
const store = (next) => {
|
|
38
|
+
if (settings.multiple)
|
|
39
|
+
onChange(next);
|
|
40
|
+
else
|
|
41
|
+
onChange(next[0] ?? null);
|
|
42
|
+
};
|
|
43
|
+
const move = (index, by) => {
|
|
44
|
+
const next = [...ids];
|
|
45
|
+
const [id] = next.splice(index, 1);
|
|
46
|
+
next.splice(index + by, 0, id);
|
|
47
|
+
store(next);
|
|
48
|
+
};
|
|
49
|
+
const openKey = !settings.multiple ? (ids.length === 0 ? "contentPicker.choose" : "contentPicker.change") : "contentPicker.add";
|
|
50
|
+
return (_jsxs("div", { ...chrome, ...groupWiring, role: "group", className: "flex flex-col gap-2", children: [ids.length === 0 && _jsx("p", { className: "text-sm text-text-tertiary", children: t("contentPicker.none") }), ids.length > 0 && (_jsx("ul", { className: "flex flex-col gap-2", children: ids.map((id, index) => {
|
|
51
|
+
const summary = summaries.byId.get(id);
|
|
52
|
+
const inFlight = summaries.status === "loading";
|
|
53
|
+
const mark = summary !== undefined ? summaryMark(summary) : inFlight ? null : summaries.status === "failed" ? "noAccess" : "missing";
|
|
54
|
+
// A page with no readable name shows its mark alone, never its id.
|
|
55
|
+
const markText = mark === null ? null : t(`contentPicker.${mark}`);
|
|
56
|
+
const name = summary?.name ?? markText ?? t("contentPicker.loading");
|
|
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, max: settings.multiple ? limit : 1, chosen: ids, onChoose: (picked) => {
|
|
59
|
+
if (settings.multiple)
|
|
60
|
+
store([...ids, ...picked.filter((id) => !ids.includes(id))].slice(0, limit));
|
|
61
|
+
else
|
|
62
|
+
store([picked[0]]);
|
|
63
|
+
} })] }));
|
|
64
|
+
}
|
|
65
|
+
export function ContentPickerReadOnlyView() {
|
|
66
|
+
const { value } = usePluginValue();
|
|
67
|
+
const t = usePluginTranslate();
|
|
68
|
+
const chrome = useAdminChromeProps();
|
|
69
|
+
const ids = readPickedIds(value);
|
|
70
|
+
const summaries = usePageSummaries(ids);
|
|
71
|
+
const parts = ids.map((id) => {
|
|
72
|
+
const summary = summaries.byId.get(id);
|
|
73
|
+
const mark = summary !== undefined ? summaryMark(summary) : summaries.status === "loading" ? null : summaries.status === "failed" ? "noAccess" : "missing";
|
|
74
|
+
const markText = mark === null ? null : t(`contentPicker.${mark}`);
|
|
75
|
+
if (summary?.name == null)
|
|
76
|
+
return markText !== null ? `[${markText}]` : t("contentPicker.loading");
|
|
77
|
+
return markText === null ? summary.name : `${summary.name} [${markText}]`;
|
|
78
|
+
});
|
|
79
|
+
return (_jsx("span", { ...chrome, className: cn("text-sm", parts.length === 0 ? "text-text-tertiary" : "text-text-primary"), children: parts.length === 0 ? t("contentPicker.none") : parts.join(", ") }));
|
|
80
|
+
}
|
|
81
|
+
function usePageTypes(enabled = true) {
|
|
82
|
+
const fetchApi = usePluginApi();
|
|
83
|
+
const [state, setState] = useState({ types: [], failed: false, loaded: false });
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
if (!enabled)
|
|
86
|
+
return;
|
|
87
|
+
let cancelled = false;
|
|
88
|
+
readAllPages(fetchApi, `${MANAGE_API}/document-types`, "document types", { limit: 100 })
|
|
89
|
+
.then((result) => {
|
|
90
|
+
if (cancelled)
|
|
91
|
+
return;
|
|
92
|
+
const types = result.items.filter((type) => type.kind === "page").map((type) => ({ id: type.id, name: type.name }));
|
|
93
|
+
setState({ types, failed: false, loaded: true });
|
|
94
|
+
})
|
|
95
|
+
.catch(() => {
|
|
96
|
+
if (!cancelled)
|
|
97
|
+
setState({ types: [], failed: true, loaded: false });
|
|
98
|
+
});
|
|
99
|
+
return () => {
|
|
100
|
+
cancelled = true;
|
|
101
|
+
};
|
|
102
|
+
}, [fetchApi, enabled]);
|
|
103
|
+
return state;
|
|
104
|
+
}
|
|
105
|
+
export function ContentPickerSettingsView() {
|
|
106
|
+
const { value: stored, onChange } = usePluginSettingsValue();
|
|
107
|
+
const settings = readContentPickerSettings(stored);
|
|
108
|
+
const t = usePluginTranslate();
|
|
109
|
+
const groupName = useId();
|
|
110
|
+
const maxId = useId();
|
|
111
|
+
const [open, setOpen] = useState(false);
|
|
112
|
+
const startSummary = usePageSummaries(settings.startNode === null ? [] : [settings.startNode]);
|
|
113
|
+
const { types, failed } = usePageTypes();
|
|
114
|
+
const write = (patch) => onChange({ ...stored, ...patch });
|
|
115
|
+
// The start page by its name, or its mark when it is missing, trashed or unreadable, never its id.
|
|
116
|
+
// Only a read in flight is "loading".
|
|
117
|
+
const startName = (() => {
|
|
118
|
+
if (settings.startNode === null)
|
|
119
|
+
return null;
|
|
120
|
+
const summary = startSummary.byId.get(settings.startNode);
|
|
121
|
+
const inFlight = startSummary.status === "loading" || startSummary.status === "idle";
|
|
122
|
+
const mark = summary !== undefined ? summaryMark(summary) : inFlight ? null : startSummary.status === "failed" ? "noAccess" : "missing";
|
|
123
|
+
const markText = mark === null ? null : t(`contentPicker.${mark}`);
|
|
124
|
+
if (summary?.name == null)
|
|
125
|
+
return markText !== null ? `[${markText}]` : t("contentPicker.loading");
|
|
126
|
+
return markText === null ? summary.name : `${summary.name} [${markText}]`;
|
|
127
|
+
})();
|
|
128
|
+
return (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(PropertyField, { label: t("contentPicker.startLabel"), helpText: t("contentPicker.startHint"), children: _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "text-sm text-text-primary", children: startName ?? t("contentPicker.wholeTree") }), _jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: () => setOpen(true), children: t("contentPicker.chooseStart") }), settings.startNode !== null && (_jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: () => write({ startNode: null }), children: t("contentPicker.clearStart") }))] }) }), _jsx(PagePickerSheet, { open: open, onOpenChange: setOpen, startNode: null, documentTypes: [], multiple: false, remaining: 1, chosen: [], onChoose: (picked) => write({ startNode: picked[0] ?? null }) }), _jsxs("fieldset", { className: "flex flex-col gap-2", children: [_jsx("legend", { className: "text-sm font-medium text-text-primary", children: t("contentPicker.typesLabel") }), _jsx("p", { className: "text-xs text-text-tertiary", children: t("contentPicker.typesHint") }), failed && (_jsx("p", { role: "alert", className: "text-sm text-danger-600", children: t("contentPicker.typesLoadFailed") })), types.map((type) => {
|
|
129
|
+
const id = `${groupName}-${type.id}`;
|
|
130
|
+
return (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Checkbox, { id: id, checked: settings.documentTypes.includes(type.id), onCheckedChange: (checked) => write({
|
|
131
|
+
documentTypes: checked === true
|
|
132
|
+
? [...settings.documentTypes, type.id]
|
|
133
|
+
: settings.documentTypes.filter((entry) => entry !== type.id),
|
|
134
|
+
}) }), _jsx("label", { htmlFor: id, className: "text-sm text-text-primary", children: type.name })] }, type.id));
|
|
135
|
+
})] }), _jsxs("fieldset", { className: "flex flex-col gap-2", children: [_jsx("legend", { className: "text-sm font-medium text-text-primary", children: t("contentPicker.modeLabel") }), [false, true].map((mode) => (_jsxs("label", { className: "flex items-center gap-2 text-sm text-text-primary", children: [_jsx("input", { type: "radio", name: groupName, checked: settings.multiple === mode, onChange: () => write(mode ? { multiple: true } : { multiple: false, max: null }), className: "accent-primary-600" }), t(mode ? "contentPicker.modeMultiple" : "contentPicker.modeSingle")] }, String(mode))))] }), settings.multiple && (_jsx(PropertyField, { label: t("contentPicker.maxLabel"), htmlFor: maxId, helpText: t("contentPicker.maxHint"), children: _jsx(Input, { id: maxId, type: "number", min: 1, max: CONTENT_PICKER_MAX_ITEMS, value: settings.max ?? "", onChange: (event) => {
|
|
136
|
+
const text = event.target.value.trim();
|
|
137
|
+
if (text === "")
|
|
138
|
+
return write({ max: null });
|
|
139
|
+
const n = Math.trunc(Number(text));
|
|
140
|
+
if (Number.isFinite(n))
|
|
141
|
+
write({ max: Math.min(CONTENT_PICKER_MAX_ITEMS, Math.max(1, n)) });
|
|
142
|
+
} }) }))] }));
|
|
143
|
+
}
|
|
@@ -11,12 +11,10 @@ export interface MediaRenditionCut {
|
|
|
11
11
|
/** Opens the host's cropper. Nothing is cut or uploaded here. */
|
|
12
12
|
onCut: () => void;
|
|
13
13
|
/**
|
|
14
|
-
* The control's visible label, from the host
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* package cannot reach. Required, so this package never needs an English
|
|
19
|
-
* default for a string only the host can say.
|
|
14
|
+
* The control's visible label, from the host: the host already has to be
|
|
15
|
+
* involved for the control to exist, and it names the action in its own
|
|
16
|
+
* words. Required, so this package never needs a default for a string
|
|
17
|
+
* only the host can say.
|
|
20
18
|
*/
|
|
21
19
|
label: string;
|
|
22
20
|
/** A cut is in flight: the control does not respond. */
|
package/dist/views/crop-view.js
CHANGED
|
@@ -4,6 +4,7 @@ import { CROP_EDITOR_ID, CropSettingsSchema, THUMBNAIL_EDITOR_ID, ThumbnailSetti
|
|
|
4
4
|
import { Button, Input, PropertyField } from "@kardalum/ui";
|
|
5
5
|
import { usePluginSettings, usePluginSettingsValue, usePluginValue } from "../plugin-context.js";
|
|
6
6
|
import { isRenditionIneligible } from "../rendition-eligibility.js";
|
|
7
|
+
import { sdkStringWithNodes, useSdkString } from "../sdk-strings.js";
|
|
7
8
|
// S234c: the crop and thumbnail editors' field views. A media document
|
|
8
9
|
// type carries one field per rendition it wants, and this is the tile the
|
|
9
10
|
// admin renders for each of them.
|
|
@@ -59,6 +60,7 @@ function CropDisplay({ actionable }) {
|
|
|
59
60
|
const settings = usePluginSettings();
|
|
60
61
|
const { value } = usePluginValue();
|
|
61
62
|
const host = useMediaRendition();
|
|
63
|
+
const s = useSdkString();
|
|
62
64
|
// The builder's field preview mounts every view with an unset value
|
|
63
65
|
// (field-row.tsx's FieldPreview), so undefined and null are one state
|
|
64
66
|
// here: this field holds no rectangle.
|
|
@@ -71,14 +73,16 @@ function CropDisplay({ actionable }) {
|
|
|
71
73
|
// and one this view is not the place to catch.
|
|
72
74
|
const ratio = settings.ratio;
|
|
73
75
|
const status = uncuttable
|
|
74
|
-
? "
|
|
76
|
+
? s("crop.cannotCut")
|
|
75
77
|
: rect === null
|
|
76
|
-
? "
|
|
77
|
-
:
|
|
78
|
-
return (_jsxs("div", { className: "flex flex-col gap-1 text-sm text-text-primary", children: [ratio ? (
|
|
78
|
+
? s("crop.notCut")
|
|
79
|
+
: s("crop.cutRegion", { width: percent(rect.w), height: percent(rect.h) });
|
|
80
|
+
return (_jsxs("div", { className: "flex flex-col gap-1 text-sm text-text-primary", children: [ratio ? (_jsx("p", { className: "font-medium", children: sdkStringWithNodes(s, "crop.ratio", { ratio: _jsx("span", { className: "font-mono", children: ratio }) }) })) : (_jsx("p", { className: "font-medium", children: s("crop.noRatio") })), ratio ? (_jsx("p", { className: "text-xs text-text-secondary", children: sdkStringWithNodes(s, "crop.savesAs", {
|
|
81
|
+
name: (_jsx("span", { className: "font-mono", children: renditionName({
|
|
79
82
|
editorId: CROP_EDITOR_ID,
|
|
80
83
|
settings: { ratio, maxWidth: settings.maxWidth ?? null },
|
|
81
|
-
}) })
|
|
84
|
+
}) })),
|
|
85
|
+
}) })) : null, settings.maxWidth != null ? (_jsx("p", { className: "text-xs text-text-secondary", children: s("crop.maxWidth", { width: settings.maxWidth }) })) : null, _jsx("p", { className: "text-xs text-text-secondary", children: status }), cut ? (_jsx("div", { className: "mt-2 flex items-center gap-2", children: _jsx(Button, { type: "button", variant: "outline", size: "sm", disabled: cut.busy, onClick: cut.onCut, children: cut.label }) })) : null] }));
|
|
82
86
|
}
|
|
83
87
|
export function CropInputView() {
|
|
84
88
|
return _jsx(CropDisplay, { actionable: true });
|
|
@@ -91,11 +95,14 @@ export function CropReadOnlyView() {
|
|
|
91
95
|
function ThumbnailDisplay() {
|
|
92
96
|
const settings = usePluginSettings();
|
|
93
97
|
const host = useMediaRendition();
|
|
98
|
+
const s = useSdkString();
|
|
94
99
|
const longestEdge = settings.longestEdge;
|
|
95
100
|
if (host !== null && isRenditionIneligible(host.sourceMimeType)) {
|
|
96
|
-
return _jsx("p", { className: "text-xs text-text-secondary", children: "
|
|
101
|
+
return _jsx("p", { className: "text-xs text-text-secondary", children: s("thumbnail.cannotCut") });
|
|
97
102
|
}
|
|
98
|
-
return (_jsxs("div", { className: "flex flex-col gap-1 text-sm text-text-primary", children: [_jsx("p", { className: "font-medium", children: "
|
|
103
|
+
return (_jsxs("div", { className: "flex flex-col gap-1 text-sm text-text-primary", children: [_jsx("p", { className: "font-medium", children: s("thumbnail.automatic") }), longestEdge != null ? (_jsxs(_Fragment, { children: [_jsx("p", { className: "text-xs text-text-secondary", children: s("thumbnail.longestEdge", { size: longestEdge }) }), _jsx("p", { className: "text-xs text-text-secondary", children: sdkStringWithNodes(s, "thumbnail.savesAs", {
|
|
104
|
+
name: (_jsx("span", { className: "font-mono", children: renditionName({ editorId: THUMBNAIL_EDITOR_ID, settings: { longestEdge } }) })),
|
|
105
|
+
}) })] })) : null] }));
|
|
99
106
|
}
|
|
100
107
|
export function ThumbnailInputView() {
|
|
101
108
|
return _jsx(ThumbnailDisplay, {});
|
|
@@ -115,6 +122,7 @@ export function ThumbnailReadOnlyView() {
|
|
|
115
122
|
// mirror of these same Zod schemas (built-in-settings-schemas.ts).
|
|
116
123
|
export function CropSettingsView() {
|
|
117
124
|
const { value: settings, onChange } = usePluginSettingsValue();
|
|
125
|
+
const s = useSdkString();
|
|
118
126
|
const [ratio, setRatio] = useState(settings.ratio ?? "");
|
|
119
127
|
const [maxWidth, setMaxWidth] = useState(settings.maxWidth == null ? "" : String(settings.maxWidth));
|
|
120
128
|
// The whole object, parsed by the schema that owns the shape, and
|
|
@@ -131,20 +139,21 @@ export function CropSettingsView() {
|
|
|
131
139
|
}
|
|
132
140
|
const ratioError = ratio === "" || CropSettingsSchema.shape.ratio.safeParse(ratio).success
|
|
133
141
|
? undefined
|
|
134
|
-
: "
|
|
142
|
+
: s("crop.ratioError");
|
|
135
143
|
const maxWidthError = maxWidth === "" || CropSettingsSchema.shape.maxWidth.safeParse(Number(maxWidth)).success
|
|
136
144
|
? undefined
|
|
137
|
-
: "
|
|
138
|
-
return (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(PropertyField, { label: "
|
|
145
|
+
: s("crop.maxWidthError");
|
|
146
|
+
return (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(PropertyField, { label: s("crop.ratioLabel"), htmlFor: "crop-settings-ratio", required: true, requiredText: s("crop.required"), helpText: s("crop.ratioHelp"), error: ratioError, children: _jsx(Input, { id: "crop-settings-ratio", value: ratio, onChange: (e) => {
|
|
139
147
|
setRatio(e.target.value);
|
|
140
148
|
commit(e.target.value, maxWidth);
|
|
141
|
-
} }) }), _jsx(PropertyField, { label: "
|
|
149
|
+
} }) }), _jsx(PropertyField, { label: s("crop.maxWidthLabel"), htmlFor: "crop-settings-max-width", helpText: s("crop.maxWidthHelp"), error: maxWidthError, children: _jsx(Input, { id: "crop-settings-max-width", type: "number", min: 1, value: maxWidth, onChange: (e) => {
|
|
142
150
|
setMaxWidth(e.target.value);
|
|
143
151
|
commit(ratio, e.target.value);
|
|
144
152
|
} }) })] }));
|
|
145
153
|
}
|
|
146
154
|
export function ThumbnailSettingsView() {
|
|
147
155
|
const { value: settings, onChange } = usePluginSettingsValue();
|
|
156
|
+
const s = useSdkString();
|
|
148
157
|
const [longestEdge, setLongestEdge] = useState(settings.longestEdge == null ? "" : String(settings.longestEdge));
|
|
149
158
|
function commit(next) {
|
|
150
159
|
const parsed = ThumbnailSettingsSchema.safeParse({ longestEdge: Number(next) });
|
|
@@ -153,8 +162,8 @@ export function ThumbnailSettingsView() {
|
|
|
153
162
|
}
|
|
154
163
|
const longestEdgeError = longestEdge === "" || ThumbnailSettingsSchema.safeParse({ longestEdge: Number(longestEdge) }).success
|
|
155
164
|
? undefined
|
|
156
|
-
: "
|
|
157
|
-
return (_jsx("div", { className: "flex flex-col gap-4", children: _jsx(PropertyField, { label: "
|
|
165
|
+
: s("thumbnail.longestEdgeError");
|
|
166
|
+
return (_jsx("div", { className: "flex flex-col gap-4", children: _jsx(PropertyField, { label: s("thumbnail.longestEdgeLabel"), htmlFor: "thumbnail-settings-longest-edge", required: true, requiredText: s("thumbnail.required"), helpText: s("thumbnail.longestEdgeHelp"), error: longestEdgeError, children: _jsx(Input, { id: "thumbnail-settings-longest-edge", type: "number", min: 1, value: longestEdge, onChange: (e) => {
|
|
158
167
|
setLongestEdge(e.target.value);
|
|
159
168
|
commit(e.target.value);
|
|
160
169
|
} }) }) }));
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useId } from "react";
|
|
3
3
|
import { Input, usePropertyFieldControl } from "@kardalum/ui";
|
|
4
4
|
import { usePluginValue } from "../plugin-context.js";
|
|
5
|
+
import { useAdminChromeProps, useSdkString } from "../sdk-strings.js";
|
|
5
6
|
const EMPTY_RANGE = { start: null, end: null };
|
|
6
7
|
// Two independently-labeled <input type="date"> controls, not one, unlike
|
|
7
8
|
// every other built-in view, this value has two members a person needs to
|
|
@@ -22,6 +23,8 @@ const EMPTY_RANGE = { start: null, end: null };
|
|
|
22
23
|
export function DateRangeInputView() {
|
|
23
24
|
const { value, onChange } = usePluginValue();
|
|
24
25
|
const field = usePropertyFieldControl();
|
|
26
|
+
const s = useSdkString();
|
|
27
|
+
const chrome = useAdminChromeProps();
|
|
25
28
|
const range = value ?? EMPTY_RANGE;
|
|
26
29
|
const reactId = useId();
|
|
27
30
|
const startId = `${field.id ?? reactId}-start`;
|
|
@@ -37,7 +40,7 @@ export function DateRangeInputView() {
|
|
|
37
40
|
"aria-describedby": field["aria-describedby"],
|
|
38
41
|
"aria-invalid": field["aria-invalid"],
|
|
39
42
|
};
|
|
40
|
-
return (_jsxs("div", { className: "flex flex-wrap items-end gap-3", children: [_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("label", { htmlFor: startId, className: "text-xs font-medium text-text-secondary", children: "
|
|
43
|
+
return (_jsxs("div", { ...chrome, className: "flex flex-wrap items-end gap-3", children: [_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("label", { htmlFor: startId, className: "text-xs font-medium text-text-secondary", children: s("dateRange.start") }), _jsx(Input, { id: startId, type: "date", value: range.start ?? "", onChange: (e) => update("start", e.target.value), ...shared })] }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("label", { htmlFor: endId, className: "text-xs font-medium text-text-secondary", children: s("dateRange.end") }), _jsx(Input, { id: endId, type: "date", value: range.end ?? "", onChange: (e) => update("end", e.target.value), ...shared })] })] }));
|
|
41
44
|
}
|
|
42
45
|
export function DateRangeReadOnlyView() {
|
|
43
46
|
const { value } = usePluginValue();
|
|
@@ -11,12 +11,10 @@ export interface MediaFileReplace {
|
|
|
11
11
|
*/
|
|
12
12
|
onReplace: (file: File) => void;
|
|
13
13
|
/**
|
|
14
|
-
* The control's visible label, from the host
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* this package cannot reach. Required, so this package never needs an
|
|
19
|
-
* English default for a string only the host can say.
|
|
14
|
+
* The control's visible label, from the host: the host already has to be
|
|
15
|
+
* involved for the control to exist at all, and it names the action in
|
|
16
|
+
* its own words. Required, so this package never needs a default for a
|
|
17
|
+
* string only the host can say.
|
|
20
18
|
*/
|
|
21
19
|
label: string;
|
|
22
20
|
/** A replace is in flight: the control does not respond. */
|
|
@@ -30,7 +28,7 @@ export interface MediaFileProviderProps {
|
|
|
30
28
|
* control renders. One object rather than a handler, a label and a busy
|
|
31
29
|
* flag side by side, so `label` is required at the type level: a host
|
|
32
30
|
* that offers the control cannot forget to name it, and this package
|
|
33
|
-
* needs no
|
|
31
|
+
* needs no default for a string only the host can say.
|
|
34
32
|
*/
|
|
35
33
|
replace?: MediaFileReplace;
|
|
36
34
|
children: ReactNode;
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { createContext, useContext, useRef } from "react";
|
|
3
3
|
import { Button, Input, PropertyField } from "@kardalum/ui";
|
|
4
4
|
import { usePluginSettings, usePluginSettingsValue } from "../plugin-context.js";
|
|
5
|
+
import { useAdminChromeProps, useSdkLocale, useSdkString } from "../sdk-strings.js";
|
|
5
6
|
const MediaFileContext = createContext({ file: null, replace: null });
|
|
6
7
|
// The context value is rebuilt on every render rather than memoized: both
|
|
7
8
|
// halves of it are objects the host owns, and a host that passes fresh
|
|
@@ -21,11 +22,13 @@ export function useMediaFileReplace() {
|
|
|
21
22
|
// KB/MB conversion: exact and unambiguous, and this does not claim any
|
|
22
23
|
// locale-specific unit convention beyond the separators toLocaleString()
|
|
23
24
|
// already applies.
|
|
24
|
-
function formatSize(size) {
|
|
25
|
-
return
|
|
25
|
+
function formatSize(size, s, locale) {
|
|
26
|
+
return s("fileUpload.size", { size: size.toLocaleString(locale) });
|
|
26
27
|
}
|
|
27
|
-
function acceptedExtensionsText(extensions) {
|
|
28
|
-
return extensions && extensions.length > 0
|
|
28
|
+
function acceptedExtensionsText(extensions, s) {
|
|
29
|
+
return extensions && extensions.length > 0
|
|
30
|
+
? s("fileUpload.accepts", { extensions: extensions.join(", ") })
|
|
31
|
+
: s("fileUpload.acceptsAny");
|
|
29
32
|
}
|
|
30
33
|
// The picker, and only the picker. Piece A shipped this field with no
|
|
31
34
|
// Replace control on purpose, because versioned replacement did not exist
|
|
@@ -66,7 +69,12 @@ function FileUploadDisplay({ replaceable }) {
|
|
|
66
69
|
const settings = usePluginSettings();
|
|
67
70
|
const file = useMediaFile();
|
|
68
71
|
const replace = useMediaFileReplace();
|
|
69
|
-
|
|
72
|
+
const s = useSdkString();
|
|
73
|
+
const locale = useSdkLocale();
|
|
74
|
+
// The size line, the accepts line and Replace are the admin's words, so
|
|
75
|
+
// they take the admin's direction and language (S366f D10).
|
|
76
|
+
const chrome = useAdminChromeProps();
|
|
77
|
+
return (_jsxs("div", { ...chrome, className: "flex flex-col gap-1 text-sm text-text-primary", children: [file ? (_jsxs(_Fragment, { children: [_jsx("p", { className: "font-medium", dir: "auto", children: file.filename }), _jsx("p", { className: "text-xs text-text-secondary", children: formatSize(file.size, s, locale) })] })) : (_jsx("p", { className: "text-text-secondary", children: s("fileUpload.noFile") })), _jsx("p", { className: "text-xs text-text-secondary", children: acceptedExtensionsText(settings.extensions, s) }), replaceable && replace && (_jsx(ReplaceControl, { replace: replace, extensions: settings.extensions }))] }));
|
|
70
78
|
}
|
|
71
79
|
export function FileUploadInputView() {
|
|
72
80
|
return _jsx(FileUploadDisplay, { replaceable: true });
|
|
@@ -94,11 +102,12 @@ export function FileUploadReadOnlyView() {
|
|
|
94
102
|
// optional and the server reads an absent one as "anything fits".
|
|
95
103
|
export function FileUploadSettingsView() {
|
|
96
104
|
const { value: settings, onChange } = usePluginSettingsValue();
|
|
97
|
-
|
|
105
|
+
const s = useSdkString();
|
|
106
|
+
return (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(PropertyField, { label: s("fileUpload.extensionsLabel"), htmlFor: "file-upload-settings-extensions", helpText: s("fileUpload.extensionsHelp"), children: _jsx(Input, { id: "file-upload-settings-extensions", value: (settings.extensions ?? []).join(","), onChange: (e) => {
|
|
98
107
|
const extensions = e.target.value
|
|
99
108
|
.split(",")
|
|
100
109
|
.map((ext) => ext.trim().toLowerCase())
|
|
101
110
|
.filter((ext) => ext.length > 0);
|
|
102
111
|
onChange({ ...settings, extensions });
|
|
103
|
-
} }) }), _jsx(PropertyField, { label: "
|
|
112
|
+
} }) }), _jsx(PropertyField, { label: s("fileUpload.maxSizeLabel"), htmlFor: "file-upload-settings-max-size", helpText: s("fileUpload.maxSizeHelp"), children: _jsx(Input, { id: "file-upload-settings-max-size", type: "number", min: 1, value: settings.maxSizeBytes ?? "", onChange: (e) => onChange({ ...settings, maxSizeBytes: e.target.value === "" ? undefined : Number(e.target.value) }) }) })] }));
|
|
104
113
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const SELECT_CLASS = "flex h-10 w-full rounded-md border border-border-strong bg-background-elevated px-3 py-2 text-sm text-text-primary transition-colors duration-fast focus-visible:border-primary-600 focus-visible:outline-hidden focus-visible:ring-4 focus-visible:ring-primary-50 disabled:cursor-not-allowed disabled:opacity-50";
|
|
2
|
+
export declare function GroupInputView(): import("react").JSX.Element;
|
|
3
|
+
export declare function GroupReadOnlyView(): import("react").JSX.Element;
|
|
4
|
+
/** Without a nested field host (a plugin preview) a sub-value is shown as its JSON, not as missing. */
|
|
5
|
+
export declare function ValueSummary({ value }: {
|
|
6
|
+
value: unknown;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
export declare function GroupSettingsView(): import("react").JSX.Element;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
import { GROUP_FIELDS_MAX, SUB_FIELD_ALIAS_MAX, SUB_FIELD_NAME_MAX, isPlainRecord, readGroupSettings, } from "@kardalum/api-schemas";
|
|
4
|
+
import { Button, Checkbox, IconTooltip, Input, PropertyField } from "@kardalum/ui";
|
|
5
|
+
import { NestedField, holdsRichText, isNestableEditor, repeatedByList, useNestedFieldHost } from "../nested-field-host.js";
|
|
6
|
+
import { usePluginSettings, usePluginSettingsValue, usePluginValue } from "../plugin-context.js";
|
|
7
|
+
import { usePluginTranslate } from "../plugin-screen-context.js";
|
|
8
|
+
import { useAdminChromeProps } from "../sdk-strings.js";
|
|
9
|
+
import { suggestKey, useHandEditedKeys } from "./suggest-key.js";
|
|
10
|
+
// Month 32 D: the Group data type's views. The value is an object keyed by sub-field alias; each
|
|
11
|
+
// sub-field is mounted through the nested field host with its own data type's views.
|
|
12
|
+
// The same classes as the UI package's Input, for a native select.
|
|
13
|
+
export const SELECT_CLASS = "flex h-10 w-full rounded-md border border-border-strong bg-background-elevated px-3 py-2 text-sm text-text-primary transition-colors duration-fast focus-visible:border-primary-600 focus-visible:outline-hidden focus-visible:ring-4 focus-visible:ring-primary-50 disabled:cursor-not-allowed disabled:opacity-50";
|
|
14
|
+
export function GroupInputView() {
|
|
15
|
+
const { value, onChange } = usePluginValue();
|
|
16
|
+
const settings = readGroupSettings(usePluginSettings());
|
|
17
|
+
const host = useNestedFieldHost();
|
|
18
|
+
const t = usePluginTranslate();
|
|
19
|
+
const chrome = useAdminChromeProps();
|
|
20
|
+
if (!host) {
|
|
21
|
+
return (_jsxs("div", { ...chrome, className: "flex flex-col gap-2", children: [_jsx(GroupReadOnlyView, {}), _jsx("p", { className: "text-sm text-text-tertiary", children: t("group.noHost") })] }));
|
|
22
|
+
}
|
|
23
|
+
if (settings.fields.length === 0) {
|
|
24
|
+
return (_jsx("p", { ...chrome, className: "text-sm text-text-tertiary", children: t("group.noFields") }));
|
|
25
|
+
}
|
|
26
|
+
const current = isPlainRecord(value) ? value : {};
|
|
27
|
+
// The base keeps only the aliases the group has now, so a removed sub-field's value is dropped.
|
|
28
|
+
const base = {};
|
|
29
|
+
// Own keys only: an alias such as `constructor` must not read Object.prototype's member.
|
|
30
|
+
for (const field of settings.fields)
|
|
31
|
+
if (Object.hasOwn(current, field.alias))
|
|
32
|
+
base[field.alias] = current[field.alias];
|
|
33
|
+
return (_jsx("div", { ...chrome, className: "flex flex-col gap-4", children: settings.fields.map((field) => {
|
|
34
|
+
const type = host.resolve(field.dataTypeId);
|
|
35
|
+
return (_jsx(PropertyField, { label: field.name, required: field.required, requiredText: t("group.required"), helpText: type?.readOnlyNote, children: type ? (_jsx(NestedField, { type: type, value: base[field.alias], onChange: (next) => onChange({ ...base, [field.alias]: next }) })) : (_jsx("p", { className: "text-sm text-text-tertiary", children: t("group.missingType") })) }, field.alias));
|
|
36
|
+
}) }));
|
|
37
|
+
}
|
|
38
|
+
export function GroupReadOnlyView() {
|
|
39
|
+
const { value } = usePluginValue();
|
|
40
|
+
const settings = readGroupSettings(usePluginSettings());
|
|
41
|
+
const host = useNestedFieldHost();
|
|
42
|
+
const t = usePluginTranslate();
|
|
43
|
+
const chrome = useAdminChromeProps();
|
|
44
|
+
const current = isPlainRecord(value) ? value : {};
|
|
45
|
+
const filled = settings.fields.filter((field) => Object.hasOwn(current, field.alias) && current[field.alias] !== undefined && current[field.alias] !== null);
|
|
46
|
+
if (filled.length === 0) {
|
|
47
|
+
return (_jsx("span", { ...chrome, className: "text-sm text-text-tertiary", children: t("group.empty") }));
|
|
48
|
+
}
|
|
49
|
+
return (_jsx("dl", { ...chrome, className: "flex flex-col gap-3", children: filled.map((field) => {
|
|
50
|
+
const type = host?.resolve(field.dataTypeId) ?? null;
|
|
51
|
+
return (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("dt", { className: "text-sm font-medium text-text-secondary", children: field.name }), _jsx("dd", { className: "text-sm text-text-primary", children: !host ? (_jsx(ValueSummary, { value: current[field.alias] })) : type ? (_jsx(NestedField, { type: type, value: current[field.alias], onChange: () => { }, readOnly: true })) : (_jsx("span", { className: "text-text-tertiary", children: t("group.missingType") })) })] }, field.alias));
|
|
52
|
+
}) }));
|
|
53
|
+
}
|
|
54
|
+
/** Without a nested field host (a plugin preview) a sub-value is shown as its JSON, not as missing. */
|
|
55
|
+
export function ValueSummary({ value }) {
|
|
56
|
+
return _jsx("pre", { className: "whitespace-pre-wrap break-words font-mono text-xs text-text-secondary", children: JSON.stringify(value ?? null, null, 2) });
|
|
57
|
+
}
|
|
58
|
+
function rawRows(settings) {
|
|
59
|
+
if (!Array.isArray(settings.fields))
|
|
60
|
+
return [];
|
|
61
|
+
return settings.fields.slice(0, GROUP_FIELDS_MAX).map((entry) => {
|
|
62
|
+
const bag = isPlainRecord(entry) ? entry : {};
|
|
63
|
+
return {
|
|
64
|
+
alias: typeof bag.alias === "string" ? bag.alias : "",
|
|
65
|
+
name: typeof bag.name === "string" ? bag.name : "",
|
|
66
|
+
dataTypeId: typeof bag.dataTypeId === "string" ? bag.dataTypeId : "",
|
|
67
|
+
required: bag.required === true,
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
const ALIAS_PATTERN = /^[a-zA-Z][a-zA-Z0-9_]*$/;
|
|
72
|
+
export function GroupSettingsView() {
|
|
73
|
+
const { value: settings, onChange } = usePluginSettingsValue();
|
|
74
|
+
const host = useNestedFieldHost();
|
|
75
|
+
const t = usePluginTranslate();
|
|
76
|
+
const idPrefix = useId();
|
|
77
|
+
const rows = rawRows(settings);
|
|
78
|
+
const write = (next) => onChange({ ...settings, fields: next });
|
|
79
|
+
const update = (index, patch) => write(rows.map((r, i) => (i === index ? { ...r, ...patch } : r)));
|
|
80
|
+
const keys = useHandEditedKeys(rows.map((r) => r.alias));
|
|
81
|
+
const move = (index, by) => {
|
|
82
|
+
keys.moved(index, by);
|
|
83
|
+
const next = [...rows];
|
|
84
|
+
const [row] = next.splice(index, 1);
|
|
85
|
+
next.splice(index + by, 0, row);
|
|
86
|
+
write(next);
|
|
87
|
+
};
|
|
88
|
+
const counts = new Map();
|
|
89
|
+
for (const row of rows)
|
|
90
|
+
if (row.alias !== "")
|
|
91
|
+
counts.set(row.alias, (counts.get(row.alias) ?? 0) + 1);
|
|
92
|
+
// M32 I5 (D10): a Group a Repeatable list repeats may not hold rich text, so its picker leaves out
|
|
93
|
+
// rich text and Groups holding it, as the list view's item picker does.
|
|
94
|
+
const repeated = host?.editingDataTypeId !== undefined && repeatedByList(host, host.editingDataTypeId);
|
|
95
|
+
const choices = host
|
|
96
|
+
? host.listDataTypes().filter((d) => isNestableEditor(host, d.editorId) && !(repeated && holdsRichText(host, d.id)))
|
|
97
|
+
: [];
|
|
98
|
+
return (_jsxs("div", { className: "flex flex-col gap-4", children: [rows.map((row, index) => {
|
|
99
|
+
const label = row.name !== "" ? row.name : String(index + 1);
|
|
100
|
+
// M32 I5 (D9): a blank alias is as bad as a malformed one, and a name needs more than spaces.
|
|
101
|
+
// Hints only: the save is not blocked here, the server judges it.
|
|
102
|
+
const badAlias = row.alias === "" || row.alias.length > SUB_FIELD_ALIAS_MAX || !ALIAS_PATTERN.test(row.alias);
|
|
103
|
+
const noName = row.name.trim() === "";
|
|
104
|
+
const duplicate = row.alias !== "" && (counts.get(row.alias) ?? 0) > 1;
|
|
105
|
+
const known = choices.some((d) => d.id === row.dataTypeId);
|
|
106
|
+
const noType = row.dataTypeId === "" && Boolean(host);
|
|
107
|
+
const base = `${idPrefix}-${index}`;
|
|
108
|
+
const aliasErrorIds = [badAlias && `${base}-alias-bad`, duplicate && `${base}-alias-duplicate`].filter(Boolean).join(" ");
|
|
109
|
+
return (_jsxs("div", { className: "flex flex-col gap-2 rounded-md border border-border-default p-4", children: [_jsxs("div", { className: "flex flex-wrap items-start gap-2", children: [_jsxs("div", { className: "flex min-w-32 flex-1 flex-col gap-1", children: [_jsx("label", { htmlFor: `${base}-name`, className: "text-xs font-medium text-text-secondary", children: t("group.nameColumn") }), _jsx(Input, { id: `${base}-name`, placeholder: t("group.namePlaceholder"), value: row.name, maxLength: SUB_FIELD_NAME_MAX, "aria-invalid": noName || undefined, "aria-describedby": noName ? `${base}-name-error` : undefined, onChange: (event) => {
|
|
110
|
+
const name = event.target.value;
|
|
111
|
+
update(index, keys.follows(index) ? { name, alias: suggestKey(name, SUB_FIELD_ALIAS_MAX, true) } : { name });
|
|
112
|
+
} }), noName && (_jsx("p", { id: `${base}-name-error`, className: "text-xs text-danger-600", children: t("group.nameRequired") }))] }), _jsxs("div", { className: "flex min-w-32 flex-1 flex-col gap-1", children: [_jsx("label", { htmlFor: `${base}-alias`, className: "text-xs font-medium text-text-secondary", children: t("group.aliasColumn") }), _jsx(Input, { id: `${base}-alias`, placeholder: t("group.aliasPlaceholder"), value: row.alias, "aria-invalid": badAlias || duplicate || undefined, "aria-describedby": aliasErrorIds || undefined, onChange: (event) => {
|
|
113
|
+
keys.markByHand(index);
|
|
114
|
+
update(index, { alias: event.target.value });
|
|
115
|
+
} }), badAlias && (_jsx("p", { id: `${base}-alias-bad`, className: "text-xs text-danger-600", children: t("group.badAlias") })), duplicate && (_jsx("p", { id: `${base}-alias-duplicate`, className: "text-xs text-danger-600", children: t("group.duplicateAlias", { alias: row.alias }) }))] })] }), host ? (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("label", { htmlFor: `${base}-type`, className: "text-xs font-medium text-text-secondary", children: t("group.dataTypeColumn") }), _jsxs("select", { id: `${base}-type`, className: SELECT_CLASS, value: row.dataTypeId, "aria-invalid": noType || undefined, "aria-describedby": noType ? `${base}-type-error` : undefined, onChange: (event) => update(index, { dataTypeId: event.target.value }), children: [_jsx("option", { value: "", children: t("group.chooseDataType") }), row.dataTypeId !== "" && !known && (_jsx("option", { value: row.dataTypeId, disabled: true, children: t("group.missingType") })), choices.map((d) => (_jsx("option", { value: d.id, children: d.name }, d.id)))] }), noType && (_jsx("p", { id: `${base}-type-error`, className: "text-xs text-danger-600", children: t("group.typeRequired") }))] })) : (_jsx("p", { className: "text-sm text-text-tertiary", children: t("group.noHost") })), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Checkbox, { id: `group-required-${index}`, checked: row.required, onCheckedChange: (checked) => update(index, { required: checked === true }) }), _jsx("label", { htmlFor: `group-required-${index}`, className: "text-sm text-text-primary", children: t("group.requiredColumn") }), _jsx(IconTooltip, { children: _jsx(Button, { type: "button", variant: "ghost", size: "sm", className: "ms-auto", disabled: index === 0, "aria-label": t("group.moveUp", { name: label }), 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 === rows.length - 1, "aria-label": t("group.moveDown", { name: label }), 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("group.removeField", { name: label }), onClick: () => {
|
|
116
|
+
keys.removed(index);
|
|
117
|
+
write(rows.filter((_, i) => i !== index));
|
|
118
|
+
}, children: _jsx("span", { "aria-hidden": "true", children: "\u2715" }) }) })] })] }, index));
|
|
119
|
+
}), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Button, { type: "button", variant: "outline", size: "sm", disabled: rows.length >= GROUP_FIELDS_MAX, onClick: () => {
|
|
120
|
+
keys.added();
|
|
121
|
+
write([...rows, { alias: "", name: "", dataTypeId: "", required: false }]);
|
|
122
|
+
}, children: t("group.addField") }), rows.length >= GROUP_FIELDS_MAX && (_jsx("span", { className: "text-sm text-text-tertiary", children: t("group.atMax", { max: GROUP_FIELDS_MAX }) }))] })] }));
|
|
123
|
+
}
|
package/dist/views/html-view.js
CHANGED
|
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { lazy, Suspense } from "react";
|
|
3
3
|
import { PropertyField, Switch, usePropertyFieldControl } from "@kardalum/ui";
|
|
4
4
|
import { usePluginSettingsValue, usePluginValue } from "../plugin-context.js";
|
|
5
|
+
import { useSdkString } from "../sdk-strings.js";
|
|
5
6
|
// The only React.lazy() boundary in this package's views so far, mirrors
|
|
6
7
|
// apps/admin-ui/src/editor/lazy-code-editor.tsx's split (html-code-editor.js
|
|
7
8
|
// pulls in the whole @codemirror/* graph, ~six packages' worth, which must
|
|
@@ -11,11 +12,10 @@ import { usePluginSettingsValue, usePluginValue } from "../plugin-context.js";
|
|
|
11
12
|
// point for the com.kardalum.html editor.
|
|
12
13
|
const HtmlCodeEditorLazy = lazy(() => import("./html-code-editor.js").then((module) => ({ default: module.HtmlCodeEditor })));
|
|
13
14
|
// Same role="status" + aria-hidden placeholder pattern as
|
|
14
|
-
// lazy-code-editor.tsx's CodeEditorFallback
|
|
15
|
-
// package's views deliberately hardcode English strings today, see
|
|
16
|
-
// built-ins.tsx's TextReadOnlyView/ImageInputView precedent).
|
|
15
|
+
// lazy-code-editor.tsx's CodeEditorFallback, named through useSdkString().
|
|
17
16
|
function HtmlEditorFallback() {
|
|
18
|
-
|
|
17
|
+
const s = useSdkString();
|
|
18
|
+
return (_jsx("div", { role: "status", "aria-label": s("html.loading"), children: _jsx("div", { "aria-hidden": "true", className: "h-44 w-full animate-pulse rounded-md border border-border-default bg-background-subtle" }) }));
|
|
19
19
|
}
|
|
20
20
|
// The Trusted setting has no bearing on how this field is EDITED (both
|
|
21
21
|
// modes get the same CodeMirror surface), only on how it's RENDERED
|
|
@@ -46,8 +46,9 @@ export function HtmlReadOnlyView() {
|
|
|
46
46
|
// settings-EDITING view, same usePluginSettingsValue() convention as
|
|
47
47
|
// TextSettingsView/ImageSettingsView in built-ins.tsx. The help copy is
|
|
48
48
|
// spec-binding verbatim text (S197 spec §7 / task brief), not a paraphrase,
|
|
49
|
-
// so do not reword it.
|
|
49
|
+
// so do not reword it (its English lives in SDK_STRINGS_EN, html.trustedHelp).
|
|
50
50
|
export function HtmlSettingsView() {
|
|
51
51
|
const { value: settings, onChange } = usePluginSettingsValue();
|
|
52
|
-
|
|
52
|
+
const s = useSdkString();
|
|
53
|
+
return (_jsx("div", { className: "flex flex-col gap-4", children: _jsx(PropertyField, { label: s("html.trustedLabel"), htmlFor: "html-settings-trusted", helpText: s("html.trustedHelp"), children: _jsx(Switch, { id: "html-settings-trusted", checked: settings.trusted === true, onCheckedChange: (checked) => onChange({ ...settings, trusted: checked === true }) }) }) }));
|
|
53
54
|
}
|