@kardalum/plugin-sdk 0.0.0-stage → 0.15.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 +108 -0
- package/LICENSE +202 -0
- package/README.md +70 -2
- package/dist/admin-section-registry.d.ts +34 -0
- package/dist/admin-section-registry.js +49 -0
- package/dist/built-in-serializers.d.ts +3 -0
- package/dist/built-in-serializers.js +18 -0
- package/dist/built-in-settings-schemas.d.ts +14 -0
- package/dist/built-in-settings-schemas.js +225 -0
- package/dist/built-in-value-schemas.d.ts +4 -0
- package/dist/built-in-value-schemas.js +47 -0
- package/dist/built-ins.d.ts +1 -0
- package/dist/built-ins.js +257 -0
- package/dist/capabilities.d.ts +99 -0
- package/dist/capabilities.js +363 -0
- package/dist/data-type-plugin.d.ts +28 -0
- package/dist/data-type-plugin.js +1 -0
- package/dist/datatype-validation.d.ts +26 -0
- package/dist/datatype-validation.js +110 -0
- package/dist/datatypes-entry.d.ts +4 -0
- package/dist/datatypes-entry.js +18 -0
- package/dist/define-plugin.d.ts +25 -0
- package/dist/define-plugin.js +51 -0
- package/dist/entitlement-entry.d.ts +5 -0
- package/dist/entitlement-entry.js +24 -0
- package/dist/entitlement-gate.d.ts +36 -0
- package/dist/entitlement-gate.js +201 -0
- package/dist/entitlement-types.d.ts +39 -0
- package/dist/entitlement-types.js +1 -0
- package/dist/entitlement.d.ts +57 -0
- package/dist/entitlement.js +170 -0
- package/dist/host-entry.d.ts +1 -0
- package/dist/host-entry.js +11 -0
- package/dist/icon-name.d.ts +1 -0
- package/dist/icon-name.js +1 -0
- package/dist/icons.d.ts +2 -0
- package/dist/icons.js +10 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +93 -0
- package/dist/license-verdict-keys.d.ts +18 -0
- package/dist/license-verdict-keys.js +22 -0
- package/dist/local-host.d.ts +3 -0
- package/dist/local-host.js +38 -0
- package/dist/manifest-entry.d.ts +8 -0
- package/dist/manifest-entry.js +13 -0
- package/dist/manifest-schema.d.ts +408 -0
- package/dist/manifest-schema.js +774 -0
- package/dist/manifest.d.ts +546 -0
- package/dist/manifest.js +86 -0
- package/dist/media/media-picker.d.ts +39 -0
- package/dist/media/media-picker.js +438 -0
- package/dist/media/upload-error.d.ts +12 -0
- package/dist/media/upload-error.js +30 -0
- package/dist/plugin-context.d.ts +75 -0
- package/dist/plugin-context.js +70 -0
- package/dist/plugin-screen-context.d.ts +40 -0
- package/dist/plugin-screen-context.js +16 -0
- package/dist/register-built-ins.d.ts +1 -0
- package/dist/register-built-ins.js +41 -0
- package/dist/registry.d.ts +4 -0
- package/dist/registry.js +17 -0
- package/dist/rendition-eligibility.d.ts +24 -0
- package/dist/rendition-eligibility.js +40 -0
- package/dist/richtext/block-panel.d.ts +27 -0
- package/dist/richtext/block-panel.js +232 -0
- package/dist/richtext/extensions.d.ts +19 -0
- package/dist/richtext/extensions.js +56 -0
- package/dist/richtext/insert-menu.d.ts +24 -0
- package/dist/richtext/insert-menu.js +142 -0
- package/dist/richtext/kardalum-block.d.ts +33 -0
- package/dist/richtext/kardalum-block.js +282 -0
- package/dist/richtext/style-listbox.d.ts +10 -0
- package/dist/richtext/style-listbox.js +69 -0
- package/dist/richtext/text-style-class.d.ts +18 -0
- package/dist/richtext/text-style-class.js +36 -0
- package/dist/simple-storage-value-provider.d.ts +9 -0
- package/dist/simple-storage-value-provider.js +96 -0
- package/dist/structured-storage-types.d.ts +61 -0
- package/dist/structured-storage-types.js +11 -0
- package/dist/tailwind.d.ts +1 -0
- package/dist/tailwind.js +5 -0
- package/dist/tokens/system-dark.css +75 -0
- package/dist/tokens/tokens.css +239 -0
- package/dist/tokens/tokens.json +212 -0
- package/dist/tokens.d.ts +1 -0
- package/dist/tokens.js +11 -0
- package/dist/ui-entry.d.ts +5 -0
- package/dist/ui-entry.js +42 -0
- package/dist/views/content-list-preview.d.ts +1 -0
- package/dist/views/content-list-preview.js +14 -0
- package/dist/views/content-list-settings-view.d.ts +1 -0
- package/dist/views/content-list-settings-view.js +97 -0
- package/dist/views/content-list-view.d.ts +19 -0
- package/dist/views/content-list-view.js +248 -0
- package/dist/views/crop-view.d.ts +55 -0
- package/dist/views/crop-view.js +161 -0
- package/dist/views/date-range-view.d.ts +6 -0
- package/dist/views/date-range-view.js +55 -0
- package/dist/views/file-upload-view.d.ts +43 -0
- package/dist/views/file-upload-view.js +104 -0
- package/dist/views/html-code-editor.d.ts +10 -0
- package/dist/views/html-code-editor.js +101 -0
- package/dist/views/html-view.d.ts +3 -0
- package/dist/views/html-view.js +53 -0
- package/dist/views/image-view.d.ts +3 -0
- package/dist/views/image-view.js +387 -0
- package/dist/views/rich-text-view.d.ts +2 -0
- package/dist/views/rich-text-view.js +429 -0
- package/node_modules/@kardalum/api-schemas/LICENSE +202 -0
- package/node_modules/@kardalum/api-schemas/README.md +56 -0
- package/node_modules/@kardalum/api-schemas/dist/action.schema.d.ts +30 -0
- package/node_modules/@kardalum/api-schemas/dist/action.schema.js +88 -0
- package/node_modules/@kardalum/api-schemas/dist/api-error.schema.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +6 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +75 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +36 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.d.ts +89 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +60 -0
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +24 -0
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +47 -0
- package/node_modules/@kardalum/api-schemas/dist/auth.schema.d.ts +38 -0
- package/node_modules/@kardalum/api-schemas/dist/auth.schema.js +38 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +537 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +353 -0
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +158 -0
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +139 -0
- package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +125 -0
- package/node_modules/@kardalum/api-schemas/dist/content-path.js +256 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.d.ts +20 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +23 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.d.ts +151 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +82 -0
- package/node_modules/@kardalum/api-schemas/dist/content-version.schema.d.ts +18 -0
- package/node_modules/@kardalum/api-schemas/dist/content-version.schema.js +22 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +17 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.js +20 -0
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +302 -0
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +97 -0
- package/node_modules/@kardalum/api-schemas/dist/culture-direction.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/culture-direction.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +36 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +32 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +32 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +296 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +138 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +121 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +147 -0
- package/node_modules/@kardalum/api-schemas/dist/health.schema.d.ts +6 -0
- package/node_modules/@kardalum/api-schemas/dist/health.schema.js +5 -0
- package/node_modules/@kardalum/api-schemas/dist/html-entities.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/html-entities.js +250 -0
- package/node_modules/@kardalum/api-schemas/dist/index.d.ts +102 -0
- package/node_modules/@kardalum/api-schemas/dist/index.js +58 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +15 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +381 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +197 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +167 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +214 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +77 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.js +53 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-use.d.ts +75 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-use.js +117 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +27 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference.js +279 -0
- package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.d.ts +74 -0
- package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.js +157 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +80 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.js +156 -0
- package/node_modules/@kardalum/api-schemas/dist/nav.schema.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/nav.schema.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +846 -0
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +356 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +20 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +169 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +80 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.d.ts +65 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.js +889 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +89 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +134 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +31 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +38 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +369 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +393 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +22 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +87 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.d.ts +31 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +25 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +15 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +24 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +306 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +328 -0
- package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +79 -0
- package/node_modules/@kardalum/api-schemas/dist/render-editing.js +50 -0
- package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/reserved-slugs.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/reserved-slugs.js +16 -0
- package/node_modules/@kardalum/api-schemas/dist/role.schema.d.ts +90 -0
- package/node_modules/@kardalum/api-schemas/dist/role.schema.js +69 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content-outcome.schema.d.ts +17 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content-outcome.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +108 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +93 -0
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +243 -0
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +296 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +43 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.js +25 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +30 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.js +19 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +112 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +74 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +39 -0
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.d.ts +21 -0
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +89 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +68 -0
- package/node_modules/@kardalum/api-schemas/package.json +35 -0
- package/node_modules/@kardalum/design-tokens/LICENSE +202 -0
- package/node_modules/@kardalum/design-tokens/README.md +29 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.d.ts +32 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.js +88 -0
- package/node_modules/@kardalum/design-tokens/dist/generate.d.ts +1 -0
- package/node_modules/@kardalum/design-tokens/dist/generate.js +18 -0
- package/node_modules/@kardalum/design-tokens/dist/index.d.ts +6 -0
- package/node_modules/@kardalum/design-tokens/dist/index.js +4 -0
- package/node_modules/@kardalum/design-tokens/dist/system-dark.css +75 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +33 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +54 -0
- package/node_modules/@kardalum/design-tokens/dist/theme-css.d.ts +12 -0
- package/node_modules/@kardalum/design-tokens/dist/theme-css.js +42 -0
- package/node_modules/@kardalum/design-tokens/dist/theme-types.d.ts +43 -0
- package/node_modules/@kardalum/design-tokens/dist/theme-types.js +1 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.d.ts +13 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.js +120 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/index.d.ts +5 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/index.js +4 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/light.d.ts +9 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/light.js +13 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +239 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +25 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +276 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +212 -0
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +91 -0
- package/node_modules/@kardalum/design-tokens/dist/types.js +5 -0
- package/node_modules/@kardalum/design-tokens/package.json +42 -0
- package/node_modules/@kardalum/plugin-package/LICENSE +202 -0
- package/node_modules/@kardalum/plugin-package/README.md +71 -0
- package/node_modules/@kardalum/plugin-package/dist/docs-contract.d.ts +50 -0
- package/node_modules/@kardalum/plugin-package/dist/docs-contract.js +659 -0
- package/node_modules/@kardalum/plugin-package/dist/envelope.d.ts +19 -0
- package/node_modules/@kardalum/plugin-package/dist/envelope.js +104 -0
- package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +37 -0
- package/node_modules/@kardalum/plugin-package/dist/extract.js +199 -0
- package/node_modules/@kardalum/plugin-package/dist/hash.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/hash.js +69 -0
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +11 -0
- package/node_modules/@kardalum/plugin-package/dist/index.js +7 -0
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +185 -0
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +236 -0
- package/node_modules/@kardalum/plugin-package/dist/package-contract.d.ts +50 -0
- package/node_modules/@kardalum/plugin-package/dist/package-contract.js +115 -0
- package/node_modules/@kardalum/plugin-package/dist/sample-content.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/sample-content.js +17 -0
- package/node_modules/@kardalum/plugin-package/dist/types.d.ts +45 -0
- package/node_modules/@kardalum/plugin-package/dist/types.js +1 -0
- package/node_modules/@kardalum/plugin-package/package.json +49 -0
- package/node_modules/@kardalum/ui/LICENSE +202 -0
- package/node_modules/@kardalum/ui/README.md +35 -0
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.d.ts +14 -0
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.js +38 -0
- package/node_modules/@kardalum/ui/dist/components/badge.d.ts +9 -0
- package/node_modules/@kardalum/ui/dist/components/badge.js +30 -0
- package/node_modules/@kardalum/ui/dist/components/button.d.ts +11 -0
- package/node_modules/@kardalum/ui/dist/components/button.js +37 -0
- package/node_modules/@kardalum/ui/dist/components/checkbox.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/components/checkbox.js +7 -0
- package/node_modules/@kardalum/ui/dist/components/dialog.d.ts +17 -0
- package/node_modules/@kardalum/ui/dist/components/dialog.js +48 -0
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.d.ts +18 -0
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +53 -0
- package/node_modules/@kardalum/ui/dist/components/empty-state.d.ts +30 -0
- package/node_modules/@kardalum/ui/dist/components/empty-state.js +9 -0
- package/node_modules/@kardalum/ui/dist/components/input.d.ts +4 -0
- package/node_modules/@kardalum/ui/dist/components/input.js +6 -0
- package/node_modules/@kardalum/ui/dist/components/panel.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/components/panel.js +6 -0
- package/node_modules/@kardalum/ui/dist/components/property-field.d.ts +19 -0
- package/node_modules/@kardalum/ui/dist/components/property-field.js +86 -0
- package/node_modules/@kardalum/ui/dist/components/sheet.d.ts +17 -0
- package/node_modules/@kardalum/ui/dist/components/sheet.js +55 -0
- package/node_modules/@kardalum/ui/dist/components/skeleton.d.ts +3 -0
- package/node_modules/@kardalum/ui/dist/components/skeleton.js +9 -0
- package/node_modules/@kardalum/ui/dist/components/switch.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/components/switch.js +7 -0
- package/node_modules/@kardalum/ui/dist/components/tab-strip.d.ts +34 -0
- package/node_modules/@kardalum/ui/dist/components/tab-strip.js +72 -0
- package/node_modules/@kardalum/ui/dist/components/toast.d.ts +18 -0
- package/node_modules/@kardalum/ui/dist/components/toast.js +42 -0
- package/node_modules/@kardalum/ui/dist/components/toaster.d.ts +12 -0
- package/node_modules/@kardalum/ui/dist/components/toaster.js +11 -0
- package/node_modules/@kardalum/ui/dist/components/use-toast.d.ts +17 -0
- package/node_modules/@kardalum/ui/dist/components/use-toast.js +62 -0
- package/node_modules/@kardalum/ui/dist/index.d.ts +18 -0
- package/node_modules/@kardalum/ui/dist/index.js +18 -0
- package/node_modules/@kardalum/ui/dist/lib/cn.d.ts +2 -0
- package/node_modules/@kardalum/ui/dist/lib/cn.js +5 -0
- package/node_modules/@kardalum/ui/package.json +63 -0
- package/package.json +146 -4
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
{
|
|
2
|
+
"color": {
|
|
3
|
+
"primary": {
|
|
4
|
+
"50": "#EAF4FB",
|
|
5
|
+
"100": "#CFE6F6",
|
|
6
|
+
"200": "#A9D5F0",
|
|
7
|
+
"300": "#7CC0E8",
|
|
8
|
+
"400": "#4E9CCB",
|
|
9
|
+
"500": "#2A82BC",
|
|
10
|
+
"600": "#1F6FA8",
|
|
11
|
+
"700": "#1A5E8F",
|
|
12
|
+
"800": "#154D75",
|
|
13
|
+
"900": "#113D5C",
|
|
14
|
+
"950": "#0B2A40"
|
|
15
|
+
},
|
|
16
|
+
"secondary": {
|
|
17
|
+
"50": "#F0F0FA",
|
|
18
|
+
"100": "#E9E9F8",
|
|
19
|
+
"200": "#D3D4F1",
|
|
20
|
+
"300": "#B4B6E6",
|
|
21
|
+
"400": "#8F92D8",
|
|
22
|
+
"500": "#5B5FC7",
|
|
23
|
+
"600": "#4B4FB0",
|
|
24
|
+
"700": "#3E4194",
|
|
25
|
+
"800": "#333676",
|
|
26
|
+
"900": "#282A5C",
|
|
27
|
+
"950": "#181A3A"
|
|
28
|
+
},
|
|
29
|
+
"success": {
|
|
30
|
+
"50": "#EEF5EB",
|
|
31
|
+
"100": "#E4F0DF",
|
|
32
|
+
"200": "#C6E0BD",
|
|
33
|
+
"300": "#9CC78E",
|
|
34
|
+
"400": "#6CA85C",
|
|
35
|
+
"500": "#4E9340",
|
|
36
|
+
"600": "#3B7D2E",
|
|
37
|
+
"700": "#306626",
|
|
38
|
+
"800": "#27521F",
|
|
39
|
+
"900": "#1F4119",
|
|
40
|
+
"950": "#122A0E"
|
|
41
|
+
},
|
|
42
|
+
"warning": {
|
|
43
|
+
"50": "#FBF5E8",
|
|
44
|
+
"100": "#F7EBD2",
|
|
45
|
+
"200": "#EFD8A6",
|
|
46
|
+
"300": "#E4BF72",
|
|
47
|
+
"400": "#D6A245",
|
|
48
|
+
"500": "#C98E2D",
|
|
49
|
+
"600": "#B7791F",
|
|
50
|
+
"700": "#96631A",
|
|
51
|
+
"800": "#764E15",
|
|
52
|
+
"900": "#5B3C11",
|
|
53
|
+
"950": "#3B260A"
|
|
54
|
+
},
|
|
55
|
+
"danger": {
|
|
56
|
+
"50": "#FBEFEE",
|
|
57
|
+
"100": "#F6E0DE",
|
|
58
|
+
"200": "#EEC3BF",
|
|
59
|
+
"300": "#E39B95",
|
|
60
|
+
"400": "#D66E66",
|
|
61
|
+
"500": "#C94F46",
|
|
62
|
+
"600": "#B93A32",
|
|
63
|
+
"700": "#9A2F29",
|
|
64
|
+
"800": "#7B2621",
|
|
65
|
+
"900": "#611E1A",
|
|
66
|
+
"950": "#3F120F"
|
|
67
|
+
},
|
|
68
|
+
"neutral": {
|
|
69
|
+
"50": "#FAF9F5",
|
|
70
|
+
"100": "#F3F1EB",
|
|
71
|
+
"200": "#ECEAE3",
|
|
72
|
+
"300": "#E1DED5",
|
|
73
|
+
"400": "#CFCBC0",
|
|
74
|
+
"500": "#8C9490",
|
|
75
|
+
"600": "#5C6663",
|
|
76
|
+
"700": "#3E4644",
|
|
77
|
+
"800": "#2A3230",
|
|
78
|
+
"900": "#1B2321",
|
|
79
|
+
"950": "#111614"
|
|
80
|
+
},
|
|
81
|
+
"background": {
|
|
82
|
+
"base": "#F3F1EB",
|
|
83
|
+
"elevated": "#FFFFFF",
|
|
84
|
+
"subtle": "#FAF9F5",
|
|
85
|
+
"overlay": "rgba(27, 35, 33, 0.5)",
|
|
86
|
+
"hover": "#F0EEE7"
|
|
87
|
+
},
|
|
88
|
+
"text": {
|
|
89
|
+
"primary": "#1B2321",
|
|
90
|
+
"secondary": "#5C6663",
|
|
91
|
+
"tertiary": "#616966",
|
|
92
|
+
"disabled": "#8C9490",
|
|
93
|
+
"inverse": "#FFFFFF"
|
|
94
|
+
},
|
|
95
|
+
"border": {
|
|
96
|
+
"default": "#E1DED5",
|
|
97
|
+
"subtle": "#ECEAE3",
|
|
98
|
+
"strong": "#CFCBC0"
|
|
99
|
+
},
|
|
100
|
+
"code": {
|
|
101
|
+
"keyword": "#1A5E8F",
|
|
102
|
+
"tag": "#4B4FB0",
|
|
103
|
+
"string": "#306626",
|
|
104
|
+
"attr": "#96631A",
|
|
105
|
+
"comment": "#6B6659",
|
|
106
|
+
"punctuation": "#4A463C"
|
|
107
|
+
},
|
|
108
|
+
"artifact": {
|
|
109
|
+
"base": "#0B2A40",
|
|
110
|
+
"raised": "#113D5C",
|
|
111
|
+
"border": "#1A5E8F",
|
|
112
|
+
"text": "#CFE6F6",
|
|
113
|
+
"muted": "#8FA9BC",
|
|
114
|
+
"strong": "#FFFFFF",
|
|
115
|
+
"keyword": "#7CC0E8",
|
|
116
|
+
"string": "#9FD8A8",
|
|
117
|
+
"highlight": "#E7B96B"
|
|
118
|
+
},
|
|
119
|
+
"footer": {
|
|
120
|
+
"base": "#1B2321",
|
|
121
|
+
"border": "#2A3230",
|
|
122
|
+
"text": "#CFCBC0",
|
|
123
|
+
"muted": "#8C9490",
|
|
124
|
+
"strong": "#FFFFFF"
|
|
125
|
+
},
|
|
126
|
+
"brand": {
|
|
127
|
+
"tile": "#113D5C",
|
|
128
|
+
"keep": "#7CC0E8"
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"typography": {
|
|
132
|
+
"fontFamily": {
|
|
133
|
+
"sans": "'IBM Plex Sans', 'IBM Plex Sans Arabic', ui-sans-serif, system-ui, sans-serif",
|
|
134
|
+
"serif": "'Literata', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif",
|
|
135
|
+
"mono": "'IBM Plex Mono', ui-monospace, 'Cascadia Code', Consolas, monospace"
|
|
136
|
+
},
|
|
137
|
+
"fontSize": {
|
|
138
|
+
"xs": "0.75rem",
|
|
139
|
+
"sm": "0.8125rem",
|
|
140
|
+
"base": "0.875rem",
|
|
141
|
+
"lg": "1rem",
|
|
142
|
+
"xl": "1.25rem",
|
|
143
|
+
"2xl": "1.5rem",
|
|
144
|
+
"3xl": "1.875rem",
|
|
145
|
+
"4xl": "clamp(1.9rem, 3.4vw, 2.6rem)",
|
|
146
|
+
"5xl": "clamp(2.6rem, 4.6vw, 3.4rem)"
|
|
147
|
+
},
|
|
148
|
+
"fontWeight": {
|
|
149
|
+
"normal": 400,
|
|
150
|
+
"medium": 500,
|
|
151
|
+
"semibold": 600,
|
|
152
|
+
"bold": 700
|
|
153
|
+
},
|
|
154
|
+
"lineHeight": {
|
|
155
|
+
"tight": 1.25,
|
|
156
|
+
"normal": 1.5,
|
|
157
|
+
"relaxed": 1.75
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"spacing": {
|
|
161
|
+
"0": "0",
|
|
162
|
+
"1": "0.25rem",
|
|
163
|
+
"2": "0.5rem",
|
|
164
|
+
"3": "0.75rem",
|
|
165
|
+
"4": "1rem",
|
|
166
|
+
"5": "1.25rem",
|
|
167
|
+
"6": "1.5rem",
|
|
168
|
+
"7": "1.75rem",
|
|
169
|
+
"8": "2rem",
|
|
170
|
+
"9": "2.25rem",
|
|
171
|
+
"10": "2.5rem",
|
|
172
|
+
"11": "2.75rem",
|
|
173
|
+
"12": "3rem",
|
|
174
|
+
"14": "3.5rem",
|
|
175
|
+
"16": "4rem",
|
|
176
|
+
"20": "5rem",
|
|
177
|
+
"24": "6rem",
|
|
178
|
+
"28": "7rem",
|
|
179
|
+
"32": "8rem",
|
|
180
|
+
"44": "11rem",
|
|
181
|
+
"64": "16rem",
|
|
182
|
+
"72": "18rem",
|
|
183
|
+
"px": "1px"
|
|
184
|
+
},
|
|
185
|
+
"radius": {
|
|
186
|
+
"none": "0",
|
|
187
|
+
"sm": "0.375rem",
|
|
188
|
+
"md": "0.5rem",
|
|
189
|
+
"lg": "0.75rem",
|
|
190
|
+
"xl": "1rem",
|
|
191
|
+
"full": "9999px"
|
|
192
|
+
},
|
|
193
|
+
"shadow": {
|
|
194
|
+
"sm": "0 1px 2px 0 rgba(43, 38, 24, 0.06)",
|
|
195
|
+
"md": "0 1px 2px 0 rgba(43, 38, 24, 0.05), 0 6px 18px 0 rgba(43, 38, 24, 0.07)",
|
|
196
|
+
"lg": "0 2px 4px 0 rgba(43, 38, 24, 0.06), 0 16px 40px 0 rgba(43, 38, 24, 0.12)",
|
|
197
|
+
"xl": "0 4px 8px 0 rgba(43, 38, 24, 0.08), 0 24px 56px 0 rgba(43, 38, 24, 0.16)"
|
|
198
|
+
},
|
|
199
|
+
"motion": {
|
|
200
|
+
"duration": {
|
|
201
|
+
"fast": "150ms",
|
|
202
|
+
"normal": "250ms",
|
|
203
|
+
"slow": "400ms"
|
|
204
|
+
},
|
|
205
|
+
"easing": {
|
|
206
|
+
"standard": "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
207
|
+
"enter": "cubic-bezier(0, 0, 0.2, 1)",
|
|
208
|
+
"exit": "cubic-bezier(0.4, 0, 1, 1)"
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
"direction": "ltr"
|
|
212
|
+
}
|
package/dist/tokens.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@kardalum/design-tokens";
|
package/dist/tokens.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// The `@kardalum/plugin-sdk/tokens` subpath: the design tokens a plugin's UI
|
|
2
|
+
// reads (tokens, the built-in themes, themeOverridesToCss and their types).
|
|
3
|
+
// design-tokens is a private package that rides inside this SDK's tarball,
|
|
4
|
+
// so this subpath is how a plugin author reaches it. The stylesheet itself
|
|
5
|
+
// is the `./tokens.css` subpath (dist/tokens/, copied at build time by
|
|
6
|
+
// scripts/copy-tokens.mjs).
|
|
7
|
+
//
|
|
8
|
+
// Not a federation share key: only the SDK root is shared
|
|
9
|
+
// (apps/admin-ui/src/federation-shared.ts). Tokens carry no state, so a
|
|
10
|
+
// plugin bundling its own copy costs bytes, never correctness.
|
|
11
|
+
export * from "@kardalum/design-tokens";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { PluginValueProvider, PluginSettingsProvider, PluginApiProvider, usePluginValue, usePluginSettings, usePluginSettingsValue, usePluginApi, type PluginFetch, } from "./plugin-context.js";
|
|
2
|
+
export { SimpleStorageValueProvider } from "./simple-storage-value-provider.js";
|
|
3
|
+
export { EntitlementGate, useEntitlement, type EntitlementStatus, type UseEntitlementResult, } from "./entitlement-gate.js";
|
|
4
|
+
export type { Entitlement, EntitlementErrorCode, EntitlementVerdict, PluginTaskContext } from "./entitlement-types.js";
|
|
5
|
+
export * from "@kardalum/ui";
|
package/dist/ui-entry.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// The `@kardalum/plugin-sdk/ui` subpath: the shared UI primitives (all of
|
|
2
|
+
// @kardalum/ui, since R3) + the plugin-context
|
|
3
|
+
// hooks/providers, with none of the package index's richtext (TipTap)
|
|
4
|
+
// exports — same "no weight a consumer didn't ask for" boundary
|
|
5
|
+
// `./manifest` and `./datatypes` already draw, just for the UI-primitives
|
|
6
|
+
// half of the SDK surface.
|
|
7
|
+
//
|
|
8
|
+
// DO NOT import this from a federated plugin's own view code — a
|
|
9
|
+
// datatype/section/etc. plugin remote whose views run inside the admin
|
|
10
|
+
// host. S197 final-review fix F5 tried exactly that (google-maps'
|
|
11
|
+
// location-view.tsx) and it was a Critical regression, caught by the
|
|
12
|
+
// fix-wave re-review, not by any of this wave's five green test suites:
|
|
13
|
+
// every first-party plugin's Module Federation `shared` config names the
|
|
14
|
+
// EXACT string `"@kardalum/plugin-sdk"` as a singleton (vite.config.ts).
|
|
15
|
+
// @module-federation/vite's share matcher only intercepts an EXACT key
|
|
16
|
+
// match (or a hardcoded common-subpath table, or a trailing-slash
|
|
17
|
+
// wildcard key): `@kardalum/plugin-sdk/ui` matches none of those, so
|
|
18
|
+
// importing from it bundles a SECOND, private copy of
|
|
19
|
+
// PluginValueContext/PluginSettingsContext into the plugin's own chunk
|
|
20
|
+
// instead of resolving through the federation runtime to the host's
|
|
21
|
+
// already-loaded singleton. The host wraps every view in a Provider from
|
|
22
|
+
// ITS OWN context object (document-type-form.tsx); a remote reading a
|
|
23
|
+
// different context object throws "must be called from a view rendered
|
|
24
|
+
// inside a PluginValueProvider" (plugin-context.tsx) for every field.
|
|
25
|
+
// Import from the bare `@kardalum/plugin-sdk` main entry instead: it
|
|
26
|
+
// matches the shared key exactly, and (since the F5(a) register-built-ins
|
|
27
|
+
// split below) is now side-effect-free, so it no longer drags in
|
|
28
|
+
// TipTap/CodeMirror either.
|
|
29
|
+
//
|
|
30
|
+
// This subpath still exists for a genuinely non-federated consumer (a
|
|
31
|
+
// script, a test harness, tooling that renders SDK UI outside the Module
|
|
32
|
+
// Federation runtime entirely) where there is no host singleton to miss in
|
|
33
|
+
// the first place. If you're not sure which category you're in, you're
|
|
34
|
+
// almost certainly writing a plugin view — use the bare package index.
|
|
35
|
+
export { PluginValueProvider, PluginSettingsProvider, PluginApiProvider, usePluginValue, usePluginSettings, usePluginSettingsValue, usePluginApi, } from "./plugin-context.js";
|
|
36
|
+
export { SimpleStorageValueProvider } from "./simple-storage-value-provider.js";
|
|
37
|
+
export { EntitlementGate, useEntitlement, } from "./entitlement-gate.js";
|
|
38
|
+
// R3 Task 3 (spec D2): every @kardalum/ui export, not only the curated few
|
|
39
|
+
// the package index carries. ui is a private package that rides inside this
|
|
40
|
+
// SDK's tarball, so this subpath is the one way a non-federated consumer
|
|
41
|
+
// reaches the whole component set.
|
|
42
|
+
export * from "@kardalum/ui";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ContentListPreview(): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useContentHost, usePluginSettings } from "../plugin-context.js";
|
|
3
|
+
import { CONTENT_LIST_HEADER_CELL_CLASS, contentListColumnHeader, contentListColumnKey, resolveContentListColumns, } from "./content-list-view.js";
|
|
4
|
+
// The document type builder's live preview (S232). Deliberately static:
|
|
5
|
+
// the builder is designing a type, so there is no page whose children
|
|
6
|
+
// could be listed, and firing the list request from here would be a read
|
|
7
|
+
// against whatever node happened to be in context. It shows the configured
|
|
8
|
+
// headers and says where the real table appears.
|
|
9
|
+
export function ContentListPreview() {
|
|
10
|
+
const settings = usePluginSettings();
|
|
11
|
+
const host = useContentHost();
|
|
12
|
+
const columns = resolveContentListColumns(settings);
|
|
13
|
+
return (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsxs("table", { className: "w-full border-collapse text-sm text-text-primary", children: [_jsx("caption", { className: "sr-only", children: "Children" }), _jsx("thead", { children: _jsx("tr", { children: columns.map((column) => (_jsx("th", { scope: "col", className: CONTENT_LIST_HEADER_CELL_CLASS, children: contentListColumnHeader(column, host?.documentTypes) }, contentListColumnKey(column)))) }) }), _jsx("tbody", {})] }), _jsx("p", { className: "text-sm text-text-secondary", children: "Shown on a page's editing screen." })] }));
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ContentListSettingsView(): import("react").JSX.Element;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId, useState } from "react";
|
|
3
|
+
import { CONTENT_LIST_PROPERTIES, } from "@kardalum/api-schemas";
|
|
4
|
+
import { Button, Input } from "@kardalum/ui";
|
|
5
|
+
import { useContentHost, usePluginSettingsValue } from "../plugin-context.js";
|
|
6
|
+
import { CONTENT_LIST_PROPERTY_LABELS, contentListColumnKey, findFieldInTypes, resolveContentListColumns, } from "./content-list-view.js";
|
|
7
|
+
// The Content List datatype's column picker (S232). Rendered by the Data
|
|
8
|
+
// Types editor only, so it takes the settings-EDITING hook
|
|
9
|
+
// (usePluginSettingsValue), the same split every other built-in settings
|
|
10
|
+
// view follows. Plain English strings, like the rest of this package.
|
|
11
|
+
const PROPERTY_PREFIX = "property:";
|
|
12
|
+
const FIELD_PREFIX = "field:";
|
|
13
|
+
const SELECT_CLASS = "h-10 rounded-md border border-border-strong bg-background-elevated px-2 text-sm text-text-primary " +
|
|
14
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-600";
|
|
15
|
+
export function ContentListSettingsView() {
|
|
16
|
+
const { value: settings, onChange } = usePluginSettingsValue();
|
|
17
|
+
const host = useContentHost();
|
|
18
|
+
const addId = useId();
|
|
19
|
+
const aliasId = useId();
|
|
20
|
+
const labelIdPrefix = useId();
|
|
21
|
+
const [alias, setAlias] = useState("");
|
|
22
|
+
const columns = resolveContentListColumns(settings);
|
|
23
|
+
const documentTypes = host?.documentTypes;
|
|
24
|
+
const chosenProperties = new Set(columns.flatMap((column) => (column.kind === "property" ? [column.property] : [])));
|
|
25
|
+
const chosenFieldIds = new Set(columns.flatMap((column) => (column.kind === "field" ? [column.fieldId] : [])));
|
|
26
|
+
const availableProperties = CONTENT_LIST_PROPERTIES.filter((property) => !chosenProperties.has(property));
|
|
27
|
+
function commit(next) {
|
|
28
|
+
onChange({ ...settings, columns: next });
|
|
29
|
+
}
|
|
30
|
+
function addField(fieldId) {
|
|
31
|
+
const trimmed = fieldId.trim();
|
|
32
|
+
// A second column for the same alias would render the same value
|
|
33
|
+
// twice under two headers, so it is simply not added.
|
|
34
|
+
if (trimmed === "" || chosenFieldIds.has(trimmed))
|
|
35
|
+
return;
|
|
36
|
+
commit([...columns, { kind: "field", fieldId: trimmed }]);
|
|
37
|
+
}
|
|
38
|
+
function handlePick(raw) {
|
|
39
|
+
if (raw.startsWith(PROPERTY_PREFIX)) {
|
|
40
|
+
const property = raw.slice(PROPERTY_PREFIX.length);
|
|
41
|
+
if (chosenProperties.has(property))
|
|
42
|
+
return;
|
|
43
|
+
commit([...columns, { kind: "property", property }]);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (raw.startsWith(FIELD_PREFIX))
|
|
47
|
+
addField(raw.slice(FIELD_PREFIX.length));
|
|
48
|
+
}
|
|
49
|
+
function move(index, delta) {
|
|
50
|
+
const target = index + delta;
|
|
51
|
+
if (target < 0 || target >= columns.length)
|
|
52
|
+
return;
|
|
53
|
+
const next = [...columns];
|
|
54
|
+
const [moved] = next.splice(index, 1);
|
|
55
|
+
next.splice(target, 0, moved);
|
|
56
|
+
commit(next);
|
|
57
|
+
}
|
|
58
|
+
function remove(index) {
|
|
59
|
+
// ContentListSettingsSchema requires at least one column, and
|
|
60
|
+
// resolveContentListColumns would silently substitute the defaults for
|
|
61
|
+
// an empty list, so the last column is not removable: the floor is
|
|
62
|
+
// enforced here rather than left to a later parse failure.
|
|
63
|
+
if (columns.length <= 1)
|
|
64
|
+
return;
|
|
65
|
+
commit(columns.filter((_, position) => position !== index));
|
|
66
|
+
}
|
|
67
|
+
function setLabel(index, raw) {
|
|
68
|
+
commit(columns.map((column, position) => {
|
|
69
|
+
if (position !== index || column.kind !== "field")
|
|
70
|
+
return column;
|
|
71
|
+
// No `label: undefined` key: the stored settings should say
|
|
72
|
+
// "no override", not "an override that is nothing".
|
|
73
|
+
if (raw === "")
|
|
74
|
+
return { kind: "field", fieldId: column.fieldId };
|
|
75
|
+
return { kind: "field", fieldId: column.fieldId, label: raw };
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
// Every row carries the same three buttons, so "Move up" on its own is
|
|
79
|
+
// three identical names in a list of columns: which one moves is only
|
|
80
|
+
// legible from the row a sighted user can see it in. Each button says
|
|
81
|
+
// the column it acts on, as the row itself names it.
|
|
82
|
+
function label(column) {
|
|
83
|
+
if (column.kind === "property")
|
|
84
|
+
return CONTENT_LIST_PROPERTY_LABELS[column.property];
|
|
85
|
+
const found = findFieldInTypes(column.fieldId, documentTypes);
|
|
86
|
+
return found ? `${column.fieldId} (${found.typeName}: ${found.fieldName})` : column.fieldId;
|
|
87
|
+
}
|
|
88
|
+
return (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx("ul", { className: "flex flex-col gap-2", children: columns.map((column, index) => (_jsxs("li", { className: "flex flex-wrap items-end gap-2 rounded-md border border-border-default p-2", children: [_jsx("span", { className: "text-sm text-text-primary", children: label(column) }), column.kind === "field" && (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("label", { htmlFor: `${labelIdPrefix}-${index}`, className: "text-xs font-medium text-text-secondary", children: "Label" }), _jsx(Input, { id: `${labelIdPrefix}-${index}`, value: column.label ?? "", onChange: (event) => setLabel(index, event.target.value) })] })), _jsxs("div", { className: "flex items-center gap-1 ms-auto", children: [_jsx(Button, { type: "button", variant: "ghost", size: "sm", "aria-label": `Move up ${label(column)}`, disabled: index === 0, onClick: () => move(index, -1), children: "Move up" }), _jsx(Button, { type: "button", variant: "ghost", size: "sm", "aria-label": `Move down ${label(column)}`, disabled: index === columns.length - 1, onClick: () => move(index, 1), children: "Move down" }), _jsx(Button, { type: "button", variant: "ghost", size: "sm", "aria-label": `Remove ${label(column)}`, disabled: columns.length <= 1, onClick: () => remove(index), children: "Remove" })] })] }, contentListColumnKey(column)))) }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("label", { htmlFor: addId, className: "text-xs font-medium text-text-secondary", children: "Add column" }), _jsxs("select", { id: addId, value: "", className: SELECT_CLASS, onChange: (event) => handlePick(event.target.value), children: [_jsx("option", { value: "", children: "Choose a column" }), availableProperties.length > 0 && (_jsx("optgroup", { label: "Properties", children: availableProperties.map((property) => (_jsx("option", { value: `${PROPERTY_PREFIX}${property}`, children: CONTENT_LIST_PROPERTY_LABELS[property] }, property))) })), (documentTypes ?? []).map((documentType) => {
|
|
89
|
+
const fields = documentType.fields.filter((field) => !chosenFieldIds.has(field.id));
|
|
90
|
+
if (fields.length === 0)
|
|
91
|
+
return null;
|
|
92
|
+
return (_jsx("optgroup", { label: documentType.name, children: fields.map((field) => (_jsx("option", { value: `${FIELD_PREFIX}${field.id}`, children: `${field.name} (${field.id})` }, field.id))) }, documentType.id));
|
|
93
|
+
})] })] }), _jsxs("div", { className: "flex flex-wrap items-end gap-2", children: [_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("label", { htmlFor: aliasId, className: "text-xs font-medium text-text-secondary", children: "Other alias" }), _jsx(Input, { id: aliasId, value: alias, onChange: (event) => setAlias(event.target.value) })] }), _jsx(Button, { type: "button", variant: "outline", onClick: () => {
|
|
94
|
+
addField(alias);
|
|
95
|
+
setAlias("");
|
|
96
|
+
}, children: "Add" })] })] }));
|
|
97
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CONTENT_LIST_PROPERTIES, type ContentListColumn, type ContentListSettings } from "@kardalum/api-schemas";
|
|
2
|
+
import { type ContentHostDocumentType } from "../plugin-context.js";
|
|
3
|
+
export type ContentListProperty = (typeof CONTENT_LIST_PROPERTIES)[number];
|
|
4
|
+
/** Column headers for the six built-in row properties. */
|
|
5
|
+
export declare const CONTENT_LIST_PROPERTY_LABELS: Readonly<Record<ContentListProperty, string>>;
|
|
6
|
+
export declare const CONTENT_LIST_HEADER_CELL_CLASS = "border-b border-border-default px-2 py-2 text-start text-xs font-medium text-text-secondary";
|
|
7
|
+
/** A stable React key (and a settings identity) for one column. */
|
|
8
|
+
export declare function contentListColumnKey(column: ContentListColumn): string;
|
|
9
|
+
/** The field's name on the first page document type that declares it. */
|
|
10
|
+
export declare function findFieldInTypes(fieldId: string, documentTypes: ContentHostDocumentType[] | undefined): {
|
|
11
|
+
typeName: string;
|
|
12
|
+
fieldName: string;
|
|
13
|
+
} | null;
|
|
14
|
+
/** The header text for a column: an explicit label wins, then the field's
|
|
15
|
+
* own name where a document type declares it, then the raw alias. */
|
|
16
|
+
export declare function contentListColumnHeader(column: ContentListColumn, documentTypes: ContentHostDocumentType[] | undefined): string;
|
|
17
|
+
export declare function resolveContentListColumns(settings: Partial<ContentListSettings>): ContentListColumn[];
|
|
18
|
+
export declare function ContentListInputView(): import("react").JSX.Element;
|
|
19
|
+
export declare function ContentListReadOnlyView(): import("react").JSX.Element;
|