@kardalum/plugin-sdk 0.16.0 → 0.18.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 +105 -0
- package/README.md +4 -3
- package/dist/admin-section-registry.d.ts +14 -5
- package/dist/admin-section-registry.js +14 -4
- package/dist/assets/asset-picker.d.ts +11 -0
- package/dist/assets/asset-picker.js +109 -0
- package/dist/assets/asset-tree.d.ts +30 -0
- package/dist/assets/asset-tree.js +150 -0
- package/dist/built-in-editor-ids.d.ts +1 -0
- package/dist/built-in-editor-ids.js +20 -0
- package/dist/built-in-settings-schemas.d.ts +2 -0
- package/dist/built-in-settings-schemas.js +27 -0
- package/dist/built-in-value-schemas.js +3 -0
- package/dist/built-ins.js +10 -1
- package/dist/capabilities.js +5 -3
- package/dist/datatype-validation.js +18 -4
- package/dist/datatypes-entry.d.ts +1 -0
- package/dist/datatypes-entry.js +1 -0
- package/dist/entitlement-entry.d.ts +3 -2
- package/dist/entitlement-entry.js +13 -1
- package/dist/entitlement-gate.d.ts +18 -0
- package/dist/entitlement-gate.js +95 -21
- package/dist/entitlement-plan.d.ts +21 -0
- package/dist/entitlement-plan.js +26 -0
- package/dist/entitlement-types.d.ts +21 -4
- package/dist/entitlement.d.ts +29 -1
- package/dist/entitlement.js +39 -0
- package/dist/grid-arrow-step.d.ts +7 -0
- package/dist/grid-arrow-step.js +20 -0
- package/dist/host-entry.d.ts +1 -1
- package/dist/host-entry.js +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.js +13 -18
- package/dist/license-verdict-keys.d.ts +4 -3
- package/dist/license-verdict-keys.js +4 -7
- package/dist/manifest-entry.d.ts +6 -2
- package/dist/manifest-entry.js +5 -1
- package/dist/manifest-schema.d.ts +56 -63
- package/dist/manifest-schema.js +103 -249
- package/dist/manifest.d.ts +61 -73
- package/dist/manifest.js +13 -36
- package/dist/media/media-picker.js +32 -32
- package/dist/notify.d.ts +17 -0
- package/dist/notify.js +17 -0
- package/dist/plugin-screen-context.d.ts +11 -1
- package/dist/richtext/block-panel.js +19 -20
- package/dist/richtext/extensions.js +10 -1
- package/dist/richtext/insert-menu.js +1 -1
- package/dist/richtext/kardalum-block.js +17 -17
- package/dist/richtext/style-listbox.js +4 -4
- package/dist/richtext-html-entry.d.ts +35 -0
- package/dist/richtext-html-entry.js +73 -0
- package/dist/structured-storage-types.d.ts +11 -0
- package/dist/tailwind.js +10 -3
- package/dist/tokens/tailwind-theme.css +176 -0
- package/dist/tokens/tokens.css +2 -0
- package/dist/tokens/tokens.json +4 -2
- package/dist/type-equality.d.ts +2 -0
- package/dist/type-equality.js +1 -0
- package/dist/vendor-check.d.ts +39 -0
- package/dist/vendor-check.js +79 -0
- package/dist/vendor-entry.d.ts +3 -0
- package/dist/vendor-entry.js +9 -0
- package/dist/vendor-service.d.ts +20 -0
- package/dist/vendor-service.js +20 -0
- package/dist/views/asset-view.d.ts +6 -0
- package/dist/views/asset-view.js +55 -0
- package/dist/views/content-list-settings-view.js +1 -1
- package/dist/views/content-list-view.js +1 -1
- package/dist/views/html-code-editor.js +0 -1
- package/dist/views/html-view.js +1 -1
- package/dist/views/image-view.js +1 -1
- package/dist/views/rich-text-view.js +30 -30
- package/node_modules/@kardalum/api-schemas/README.md +1 -1
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.d.ts +90 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +43 -10
- package/node_modules/@kardalum/api-schemas/dist/asset-field.schema.d.ts +21 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-field.schema.js +42 -0
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +23 -1
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +60 -18
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +204 -0
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +134 -0
- package/node_modules/@kardalum/api-schemas/dist/checkout-shown.schema.d.ts +36 -0
- package/node_modules/@kardalum/api-schemas/dist/checkout-shown.schema.js +46 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +22 -6
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +2 -2
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +2 -1
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +52 -10
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +33 -14
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +50 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +25 -5
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-cursor.d.ts +11 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-cursor.js +28 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +42 -2
- package/node_modules/@kardalum/api-schemas/dist/home.schema.d.ts +130 -0
- package/node_modules/@kardalum/api-schemas/dist/home.schema.js +87 -0
- package/node_modules/@kardalum/api-schemas/dist/index.d.ts +73 -31
- package/node_modules/@kardalum/api-schemas/dist/index.js +47 -17
- package/node_modules/@kardalum/api-schemas/dist/install-warnings.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/install-warnings.schema.js +8 -0
- package/node_modules/@kardalum/api-schemas/dist/issue-list.d.ts +6 -0
- package/node_modules/@kardalum/api-schemas/dist/issue-list.js +6 -0
- package/node_modules/@kardalum/api-schemas/dist/kardalum-latest.schema.d.ts +7 -0
- package/node_modules/@kardalum/api-schemas/dist/kardalum-latest.schema.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +216 -63
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +117 -5
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.d.ts +17 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.js +16 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +26 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +6 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-use.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-use.js +4 -4
- package/node_modules/@kardalum/api-schemas/dist/news.schema.d.ts +93 -0
- package/node_modules/@kardalum/api-schemas/dist/news.schema.js +86 -0
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.d.ts +410 -0
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.js +193 -0
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.d.ts +86 -0
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.js +92 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +6 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +8 -6
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +8 -18
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +3 -19
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +13 -15
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +17 -7
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +18 -8
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +97 -85
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +35 -68
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.d.ts +60 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +116 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +9 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +22 -7
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +240 -6
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +164 -32
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +4 -3
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +14 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +37 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-fields.d.ts +64 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-fields.js +134 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.d.ts +19 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.js +33 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +4 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.d.ts +83 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.js +152 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-vocabulary.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-vocabulary.js +15 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +35 -23
- package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.d.ts +83 -0
- package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +73 -0
- package/node_modules/@kardalum/api-schemas/dist/role.schema.d.ts +11 -0
- package/node_modules/@kardalum/api-schemas/dist/role.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +11 -2
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +21 -3
- package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +126 -0
- package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.js +70 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +6 -6
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +58 -25
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +194 -48
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +18 -6
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +2 -2
- package/node_modules/@kardalum/api-schemas/dist/strict-url.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/strict-url.js +31 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +115 -1
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +65 -10
- package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +37 -2
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +34 -8
- package/node_modules/@kardalum/api-schemas/dist/trash-cursor.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/trash-cursor.schema.js +29 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +16 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +8 -0
- package/node_modules/@kardalum/api-schemas/dist/uuid.schema.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/uuid.schema.js +4 -0
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.d.ts +88 -0
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.js +100 -0
- package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.d.ts +32 -0
- package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/package.json +2 -2
- package/node_modules/@kardalum/design-tokens/README.md +1 -1
- package/node_modules/@kardalum/design-tokens/dist/build-theme-css.d.ts +16 -0
- package/node_modules/@kardalum/design-tokens/dist/build-theme-css.js +76 -0
- package/node_modules/@kardalum/design-tokens/dist/generate.js +4 -1
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +176 -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 +2 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +4 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +4 -2
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +2 -0
- package/node_modules/@kardalum/design-tokens/package.json +6 -3
- package/node_modules/@kardalum/plugin-package/README.md +5 -2
- package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +6 -21
- package/node_modules/@kardalum/plugin-package/dist/build-reference.js +13 -8
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +4 -4
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +59 -16
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +4 -0
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +25 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +25 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +203 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.js +73 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.d.ts +8 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +77 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/icon-names.generated.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/icon-names.generated.js +2052 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/icons.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/icons.js +51 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +8 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +7 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +119 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.d.ts +14 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.js +21 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/locales.d.ts +5 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/locales.js +148 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/package-files.d.ts +5 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/package-files.js +76 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.d.ts +22 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +137 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +90 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/support.d.ts +24 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/support.js +55 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +7 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +215 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +53 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/types.js +1 -0
- package/node_modules/@kardalum/plugin-package/dist/docs-contract.d.ts +3 -2
- package/node_modules/@kardalum/plugin-package/dist/docs-contract.js +4 -2
- package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +92 -3
- package/node_modules/@kardalum/plugin-package/dist/extract.js +251 -41
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +13 -4
- package/node_modules/@kardalum/plugin-package/dist/index.js +10 -3
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +56 -19
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +119 -25
- package/node_modules/@kardalum/plugin-package/dist/manifest-entry.d.ts +5 -0
- package/node_modules/@kardalum/plugin-package/dist/manifest-entry.js +20 -0
- package/node_modules/@kardalum/plugin-package/dist/reference-entry.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/reference-entry.js +1 -0
- package/node_modules/@kardalum/plugin-package/dist/sample-content.d.ts +21 -3
- package/node_modules/@kardalum/plugin-package/dist/sample-content.js +37 -9
- package/node_modules/@kardalum/plugin-package/dist/shipped-files.d.ts +39 -0
- package/node_modules/@kardalum/plugin-package/dist/shipped-files.js +133 -0
- package/node_modules/@kardalum/plugin-package/dist/shipped-locales.d.ts +7 -0
- package/node_modules/@kardalum/plugin-package/dist/shipped-locales.js +27 -0
- package/node_modules/@kardalum/plugin-package/dist/vendor-token.d.ts +24 -0
- package/node_modules/@kardalum/plugin-package/dist/vendor-token.js +118 -0
- package/node_modules/@kardalum/plugin-package/package.json +4 -2
- package/node_modules/@kardalum/ui/README.md +1 -1
- package/node_modules/@kardalum/ui/dist/components/button.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/checkbox.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.js +5 -2
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +3 -3
- package/node_modules/@kardalum/ui/dist/components/input.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/popover-panel.d.ts +4 -0
- package/node_modules/@kardalum/ui/dist/components/popover-panel.js +13 -0
- package/node_modules/@kardalum/ui/dist/components/sheet.js +5 -4
- package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/tab-strip.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/toast.js +1 -1
- package/node_modules/@kardalum/ui/dist/index.d.ts +1 -0
- package/node_modules/@kardalum/ui/dist/index.js +1 -0
- package/node_modules/@kardalum/ui/package.json +1 -1
- package/package.json +19 -6
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PLAN_KEY_MAX, PLAN_NAME_MAX } from "./plan-editor.schema.js";
|
|
3
|
+
// S320 (2026-11-01-s320-vendor-service-design.md): the vendor service. A paid
|
|
4
|
+
// plugin's server-side code calls its author's server through the CMS, which
|
|
5
|
+
// sends a 5-minute token the marketplace signed, never the licence key (D4).
|
|
6
|
+
// The token codec lives in @kardalum/plugin-package (vendor-token.ts); these
|
|
7
|
+
// are its shapes and the one origin rule every side applies.
|
|
8
|
+
/** The token's `typ`, and (with a trailing ".") the purpose string in its signed bytes (D5). */
|
|
9
|
+
export const VENDOR_TOKEN_TYPE = "kardalum-vendor-token/1";
|
|
10
|
+
/** D4: a token lives 5 minutes. */
|
|
11
|
+
export const VENDOR_TOKEN_TTL_SECONDS = 300;
|
|
12
|
+
/** Spec 3a: the decoded payload is at most 4 KiB. */
|
|
13
|
+
export const VENDOR_TOKEN_PAYLOAD_MAX_BYTES = 4096;
|
|
14
|
+
/** The whole token as it travels: both base64url segments and the dot. */
|
|
15
|
+
export const VENDOR_TOKEN_MAX_LENGTH = 8192;
|
|
16
|
+
export const VENDOR_SERVICE_ORIGIN_MAX = 255;
|
|
17
|
+
/** Spec 3b: the one refusal the marketplace gives, whatever the reason. */
|
|
18
|
+
export const VENDOR_TOKEN_REFUSAL_CODE = "no_vendor_token";
|
|
19
|
+
/** A licence term's states (S317). Mirrors LicenseTermState in
|
|
20
|
+
* @kardalum/plugin-package, which pins the two as equal at compile time. */
|
|
21
|
+
export const VENDOR_TOKEN_TERM_STATES = ["active", "renewing", "past_due", "lapsed"];
|
|
22
|
+
/** D3: the states a token calls live. */
|
|
23
|
+
export const VENDOR_TOKEN_LIVE_STATES = ["active", "renewing", "past_due"];
|
|
24
|
+
const UrlCtor = globalThis.URL;
|
|
25
|
+
const LOCAL_HOSTS = ["localhost", "127.0.0.1", "[::1]"];
|
|
26
|
+
/** True for the hosts a development install may reach over plain http. */
|
|
27
|
+
export function isLocalVendorHost(hostname) {
|
|
28
|
+
return LOCAL_HOSTS.includes(hostname);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The origin rule (spec 3b, 3c, 3d). `https:` with any host; `http:` only for
|
|
32
|
+
* localhost, 127.0.0.1 or [::1] and only with `allowLocalHttp`. The value must
|
|
33
|
+
* be exactly the URL's origin: no path (not even "/"), query, fragment or
|
|
34
|
+
* userinfo, a lower-case host, at most 255 characters. No regex: the URL
|
|
35
|
+
* parser and exact comparisons.
|
|
36
|
+
*/
|
|
37
|
+
export function parseVendorServiceOrigin(value, opts) {
|
|
38
|
+
if (typeof value !== "string" || value.length === 0)
|
|
39
|
+
return { ok: false, reason: "must be a non-empty string" };
|
|
40
|
+
if (value.length > VENDOR_SERVICE_ORIGIN_MAX)
|
|
41
|
+
return { ok: false, reason: `must be at most ${VENDOR_SERVICE_ORIGIN_MAX} characters` };
|
|
42
|
+
let url;
|
|
43
|
+
try {
|
|
44
|
+
url = new UrlCtor(value);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return { ok: false, reason: "must be a URL origin such as https://api.example.com" };
|
|
48
|
+
}
|
|
49
|
+
if (url.username !== "" || url.password !== "")
|
|
50
|
+
return { ok: false, reason: "must not carry a user name or password" };
|
|
51
|
+
if (url.protocol === "http:") {
|
|
52
|
+
if (!opts.allowLocalHttp || !isLocalVendorHost(url.hostname))
|
|
53
|
+
return { ok: false, reason: "must use https (http only for localhost in development)" };
|
|
54
|
+
}
|
|
55
|
+
else if (url.protocol !== "https:") {
|
|
56
|
+
return { ok: false, reason: "must use https" };
|
|
57
|
+
}
|
|
58
|
+
if (url.origin !== value)
|
|
59
|
+
return { ok: false, reason: "must be an origin only: scheme, lower-case host and port, no path or trailing slash" };
|
|
60
|
+
return { ok: true, origin: url.origin, host: url.host };
|
|
61
|
+
}
|
|
62
|
+
const VendorServiceOriginSchema = z.string().superRefine((value, ctx) => {
|
|
63
|
+
const parsed = parseVendorServiceOrigin(value, { allowLocalHttp: true });
|
|
64
|
+
if (!parsed.ok)
|
|
65
|
+
ctx.addIssue({ code: "custom", message: parsed.reason });
|
|
66
|
+
});
|
|
67
|
+
/** D6: the manifest's top-level `vendorService`. An http://localhost origin
|
|
68
|
+
* parses here (a plugin in development); both publish gates refuse it. */
|
|
69
|
+
export const PluginVendorServiceSchema = z.object({ origin: VendorServiceOriginSchema }).strict();
|
|
70
|
+
const instant = z.iso.datetime({ offset: false });
|
|
71
|
+
/** Spec 3a: the token payload. `exp` is after `iat` and at most 300 s later. */
|
|
72
|
+
export const VendorTokenPayloadSchema = z
|
|
73
|
+
.object({
|
|
74
|
+
typ: z.literal(VENDOR_TOKEN_TYPE),
|
|
75
|
+
kid: z.string().min(1).max(64),
|
|
76
|
+
pluginId: z.string().min(1).max(128),
|
|
77
|
+
aud: z.string().min(1).max(VENDOR_SERVICE_ORIGIN_MAX),
|
|
78
|
+
domain: z.string().min(1).max(253),
|
|
79
|
+
live: z.boolean(),
|
|
80
|
+
plan: z.object({ id: z.string().min(1).max(64), key: z.string().min(1).max(PLAN_KEY_MAX), name: z.string().min(1).max(PLAN_NAME_MAX) }).strict(),
|
|
81
|
+
term: z.object({ state: z.enum(VENDOR_TOKEN_TERM_STATES), endsAt: instant.nullable() }).strict(),
|
|
82
|
+
iat: z.number().int().nonnegative(),
|
|
83
|
+
exp: z.number().int().nonnegative(),
|
|
84
|
+
jti: z.string().min(16).max(64),
|
|
85
|
+
})
|
|
86
|
+
.strict()
|
|
87
|
+
.refine((p) => p.exp > p.iat && p.exp - p.iat <= VENDOR_TOKEN_TTL_SECONDS, { message: "exp must be after iat and at most 300 seconds later", path: ["exp"] });
|
|
88
|
+
/** Spec 3b: what the CMS sends. The key is the credential. */
|
|
89
|
+
export const VendorTokenRequestSchema = z
|
|
90
|
+
.object({
|
|
91
|
+
key: z.string().min(1).max(128),
|
|
92
|
+
pluginId: z.string().min(1).max(128),
|
|
93
|
+
// Trimmed before the length check, so a whitespace-only domain is a 400
|
|
94
|
+
// here and never reaches the signer as "" (S320 fix wave, M7).
|
|
95
|
+
domain: z.string().trim().min(1).max(253),
|
|
96
|
+
aud: z.string().min(1).max(VENDOR_SERVICE_ORIGIN_MAX),
|
|
97
|
+
})
|
|
98
|
+
.strict();
|
|
99
|
+
export const VendorTokenResponseSchema = z.object({ token: z.string().min(3).max(VENDOR_TOKEN_MAX_LENGTH), expiresAt: instant });
|
|
100
|
+
export const VendorTokenRefusalSchema = z.object({ code: z.literal(VENDOR_TOKEN_REFUSAL_CODE), error: z.string() });
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ContentLimitsSchema: z.ZodObject<{
|
|
3
|
+
assetBytes: z.ZodNumber;
|
|
4
|
+
templateBytes: z.ZodNumber;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export type ContentLimits = z.infer<typeof ContentLimitsSchema>;
|
|
7
|
+
export declare const WhoamiResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
8
|
+
kind: z.ZodLiteral<"key">;
|
|
9
|
+
actions: z.ZodArray<z.ZodString>;
|
|
10
|
+
limits: z.ZodObject<{
|
|
11
|
+
assetBytes: z.ZodNumber;
|
|
12
|
+
templateBytes: z.ZodNumber;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
key: z.ZodObject<{
|
|
15
|
+
id: z.ZodString;
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
expiresAt: z.ZodNullable<z.ZodString>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
20
|
+
kind: z.ZodLiteral<"session">;
|
|
21
|
+
actions: z.ZodArray<z.ZodString>;
|
|
22
|
+
limits: z.ZodObject<{
|
|
23
|
+
assetBytes: z.ZodNumber;
|
|
24
|
+
templateBytes: z.ZodNumber;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
user: z.ZodObject<{
|
|
27
|
+
id: z.ZodString;
|
|
28
|
+
name: z.ZodNullable<z.ZodString>;
|
|
29
|
+
role: z.ZodString;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
}, z.core.$strip>], "kind">;
|
|
32
|
+
export type WhoamiResponse = z.infer<typeof WhoamiResponseSchema>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// GET /api/manage/v1/whoami: what the calling credential is and what it may do
|
|
3
|
+
// (2026-10-19-s306-the-cli-skeleton-design.md section 3). Never a hash, a
|
|
4
|
+
// plaintext key or an email: the key is described by id, name and expiry, the
|
|
5
|
+
// user by id, name and role. One branch per kind, so an answer always carries
|
|
6
|
+
// exactly the description that matches it.
|
|
7
|
+
// S314c3 (D8): the site's size limits, in UTF-8 bytes (KARDALUM_MAX_ASSET_BYTES and
|
|
8
|
+
// KARDALUM_MAX_TEMPLATE_BYTES), so the admin's editors show the numbers the server holds a write to.
|
|
9
|
+
export const ContentLimitsSchema = z.object({ assetBytes: z.number().int().positive(), templateBytes: z.number().int().positive() });
|
|
10
|
+
export const WhoamiResponseSchema = z.discriminatedUnion("kind", [
|
|
11
|
+
z.object({
|
|
12
|
+
kind: z.literal("key"),
|
|
13
|
+
// Exactly the actions the credential holds, sorted. For a key this includes
|
|
14
|
+
// managementApi.use, because a key that reaches the route holds it.
|
|
15
|
+
actions: z.array(z.string()),
|
|
16
|
+
limits: ContentLimitsSchema,
|
|
17
|
+
key: z.object({ id: z.string().uuid(), name: z.string(), expiresAt: z.string().datetime().nullable() }),
|
|
18
|
+
}),
|
|
19
|
+
z.object({
|
|
20
|
+
kind: z.literal("session"),
|
|
21
|
+
// Exactly the actions the session holds, sorted.
|
|
22
|
+
actions: z.array(z.string()),
|
|
23
|
+
limits: ContentLimitsSchema,
|
|
24
|
+
// The name is null for a user who never set one.
|
|
25
|
+
user: z.object({ id: z.string(), name: z.string().nullable(), role: z.string() }),
|
|
26
|
+
}),
|
|
27
|
+
]);
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
},
|
|
24
24
|
"homepage": "https://kardalum.com",
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"zod": "4.
|
|
26
|
+
"zod": "4.6.6"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"zod": "4.
|
|
29
|
+
"zod": "4.6.6"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p .",
|
|
@@ -26,4 +26,4 @@ console.log(tokens.color.primary[500]);
|
|
|
26
26
|
|
|
27
27
|
Kardalum's source is not public. Questions and bug reports:
|
|
28
28
|
[kardalum-devkit](https://github.com/kardalum/kardalum-devkit). Docs at
|
|
29
|
-
https://
|
|
29
|
+
https://dev.kardalum.com/docs/. Apache-2.0.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Each tailwindTheme scale and the Tailwind 4 namespace it becomes. */
|
|
2
|
+
export declare const THEME_NAMESPACES: {
|
|
3
|
+
readonly colors: "color";
|
|
4
|
+
readonly fontFamily: "font";
|
|
5
|
+
readonly fontSize: "text";
|
|
6
|
+
readonly fontWeight: "font-weight";
|
|
7
|
+
readonly lineHeight: "leading";
|
|
8
|
+
readonly spacing: "spacing";
|
|
9
|
+
readonly borderRadius: "radius";
|
|
10
|
+
readonly boxShadow: "shadow";
|
|
11
|
+
readonly transitionTimingFunction: "ease";
|
|
12
|
+
readonly transitionDuration: "transition-duration";
|
|
13
|
+
};
|
|
14
|
+
/** A token key as a theme variable name part; a key that would need escaping throws. */
|
|
15
|
+
export declare function themeVariableKey(name: string): string;
|
|
16
|
+
export declare function buildTailwindThemeCss(): string;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Tailwind 4 theme (S314e2, spec C1): the same scales as tailwindTheme,
|
|
3
|
+
* written as one `@theme inline reference` block, generated from
|
|
4
|
+
* tailwindTheme itself so the v3 preset (kept for plugin authors) and this
|
|
5
|
+
* file cannot drift. generate.ts writes it to dist/tailwind-theme.css.
|
|
6
|
+
*
|
|
7
|
+
* - `--<namespace>-*: initial` first, per replaced scale: our scales replace
|
|
8
|
+
* Tailwind's, as `theme: { ...tailwindTheme }` did in v3, so a step
|
|
9
|
+
* outside them (p-13, w-40) still emits nothing. Scales the tokens do not
|
|
10
|
+
* cover (max-width, z-index, opacity, tracking, breakpoints) keep
|
|
11
|
+
* Tailwind's defaults, as in v3.
|
|
12
|
+
* - `inline`: a utility gets the value itself, `var(--color-primary-500)`,
|
|
13
|
+
* resolved against tokens.css at runtime, so theme plugins still re-skin
|
|
14
|
+
* by overriding variables.
|
|
15
|
+
* - `reference`: the block writes no variable into the page. Our token names
|
|
16
|
+
* are Tailwind's own for colour, spacing, radius and shadow, so without it
|
|
17
|
+
* Tailwind would emit `--color-primary-500: var(--color-primary-500)`, a
|
|
18
|
+
* self-reference that makes every colour invalid wherever tokens.css is
|
|
19
|
+
* absent.
|
|
20
|
+
* - `--default-transition-duration: 0s`: v3's replaced duration scale had no
|
|
21
|
+
* DEFAULT, so a bare `transition-colors` ran in 0s; v4 always applies this
|
|
22
|
+
* default, and 0s keeps that behaviour.
|
|
23
|
+
*/
|
|
24
|
+
import { tailwindTheme } from './tailwind-theme.js';
|
|
25
|
+
/** Each tailwindTheme scale and the Tailwind 4 namespace it becomes. */
|
|
26
|
+
export const THEME_NAMESPACES = {
|
|
27
|
+
colors: 'color',
|
|
28
|
+
fontFamily: 'font',
|
|
29
|
+
fontSize: 'text',
|
|
30
|
+
fontWeight: 'font-weight',
|
|
31
|
+
lineHeight: 'leading',
|
|
32
|
+
spacing: 'spacing',
|
|
33
|
+
borderRadius: 'radius',
|
|
34
|
+
boxShadow: 'shadow',
|
|
35
|
+
transitionTimingFunction: 'ease',
|
|
36
|
+
transitionDuration: 'transition-duration',
|
|
37
|
+
};
|
|
38
|
+
// CSS keywords in the v3 colours, not theme values: Tailwind 4 has
|
|
39
|
+
// bg-transparent, bg-current and bg-inherit built in.
|
|
40
|
+
const KEYWORD_COLORS = new Set(['transparent', 'current', 'inherit']);
|
|
41
|
+
const SAFE_KEY = /^[A-Za-z0-9-]+$/;
|
|
42
|
+
/** A token key as a theme variable name part; a key that would need escaping throws. */
|
|
43
|
+
export function themeVariableKey(name) {
|
|
44
|
+
if (!SAFE_KEY.test(name)) {
|
|
45
|
+
throw new Error(`The token key "${name}" cannot be part of a Tailwind 4 theme variable without escaping: teach build-theme-css.ts to escape it first.`);
|
|
46
|
+
}
|
|
47
|
+
return name;
|
|
48
|
+
}
|
|
49
|
+
export function buildTailwindThemeCss() {
|
|
50
|
+
const lines = [];
|
|
51
|
+
for (const namespace of Object.values(THEME_NAMESPACES))
|
|
52
|
+
lines.push(` --${namespace}-*: initial;`);
|
|
53
|
+
for (const [scaleName, namespace] of Object.entries(THEME_NAMESPACES)) {
|
|
54
|
+
const scale = tailwindTheme[scaleName];
|
|
55
|
+
for (const [name, value] of Object.entries(scale)) {
|
|
56
|
+
if (scaleName === 'colors' && KEYWORD_COLORS.has(name))
|
|
57
|
+
continue;
|
|
58
|
+
if (typeof value === 'string') {
|
|
59
|
+
lines.push(` --${namespace}-${themeVariableKey(name)}: ${value};`);
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
for (const [step, ref] of Object.entries(value)) {
|
|
63
|
+
lines.push(` --${namespace}-${themeVariableKey(name)}-${themeVariableKey(step)}: ${ref};`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
lines.push(' --default-transition-duration: 0s;');
|
|
68
|
+
return [
|
|
69
|
+
'/* Generated by @kardalum/design-tokens: do not edit by hand. */',
|
|
70
|
+
'/* The Tailwind 4 theme: import it after `@import "tailwindcss"`. Every value is a token variable from tokens.css. */',
|
|
71
|
+
'@theme inline reference {',
|
|
72
|
+
...lines,
|
|
73
|
+
'}',
|
|
74
|
+
'',
|
|
75
|
+
].join('\n');
|
|
76
|
+
}
|
|
@@ -8,6 +8,7 @@ import { writeFile } from 'node:fs/promises';
|
|
|
8
8
|
import { dirname, join } from 'node:path';
|
|
9
9
|
import { fileURLToPath } from 'node:url';
|
|
10
10
|
import { buildSystemDarkCss, buildTokensCss, countVariables } from './build-css.js';
|
|
11
|
+
import { buildTailwindThemeCss } from './build-theme-css.js';
|
|
11
12
|
import { tokens } from './tokens.js';
|
|
12
13
|
const outDir = dirname(fileURLToPath(import.meta.url));
|
|
13
14
|
await writeFile(join(outDir, 'tokens.css'), buildTokensCss(), 'utf8');
|
|
@@ -15,4 +16,6 @@ await writeFile(join(outDir, 'tokens.css'), buildTokensCss(), 'utf8');
|
|
|
15
16
|
// buildSystemDarkCss's comment for why it is not part of tokens.css.
|
|
16
17
|
await writeFile(join(outDir, 'system-dark.css'), buildSystemDarkCss(), 'utf8');
|
|
17
18
|
await writeFile(join(outDir, 'tokens.json'), JSON.stringify(tokens, null, 2) + '\n', 'utf8');
|
|
18
|
-
|
|
19
|
+
// The Tailwind 4 theme, from the same source as the v3 tailwindTheme (S314e2).
|
|
20
|
+
await writeFile(join(outDir, 'tailwind-theme.css'), buildTailwindThemeCss(), 'utf8');
|
|
21
|
+
console.log(`Generated tokens.css (${countVariables()} variables), system-dark.css, tokens.json and tailwind-theme.css`);
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/* Generated by @kardalum/design-tokens: do not edit by hand. */
|
|
2
|
+
/* The Tailwind 4 theme: import it after `@import "tailwindcss"`. Every value is a token variable from tokens.css. */
|
|
3
|
+
@theme inline reference {
|
|
4
|
+
--color-*: initial;
|
|
5
|
+
--font-*: initial;
|
|
6
|
+
--text-*: initial;
|
|
7
|
+
--font-weight-*: initial;
|
|
8
|
+
--leading-*: initial;
|
|
9
|
+
--spacing-*: initial;
|
|
10
|
+
--radius-*: initial;
|
|
11
|
+
--shadow-*: initial;
|
|
12
|
+
--ease-*: initial;
|
|
13
|
+
--transition-duration-*: initial;
|
|
14
|
+
--color-primary-50: var(--color-primary-50);
|
|
15
|
+
--color-primary-100: var(--color-primary-100);
|
|
16
|
+
--color-primary-200: var(--color-primary-200);
|
|
17
|
+
--color-primary-300: var(--color-primary-300);
|
|
18
|
+
--color-primary-400: var(--color-primary-400);
|
|
19
|
+
--color-primary-500: var(--color-primary-500);
|
|
20
|
+
--color-primary-600: var(--color-primary-600);
|
|
21
|
+
--color-primary-700: var(--color-primary-700);
|
|
22
|
+
--color-primary-800: var(--color-primary-800);
|
|
23
|
+
--color-primary-900: var(--color-primary-900);
|
|
24
|
+
--color-primary-950: var(--color-primary-950);
|
|
25
|
+
--color-secondary-50: var(--color-secondary-50);
|
|
26
|
+
--color-secondary-100: var(--color-secondary-100);
|
|
27
|
+
--color-secondary-200: var(--color-secondary-200);
|
|
28
|
+
--color-secondary-300: var(--color-secondary-300);
|
|
29
|
+
--color-secondary-400: var(--color-secondary-400);
|
|
30
|
+
--color-secondary-500: var(--color-secondary-500);
|
|
31
|
+
--color-secondary-600: var(--color-secondary-600);
|
|
32
|
+
--color-secondary-700: var(--color-secondary-700);
|
|
33
|
+
--color-secondary-800: var(--color-secondary-800);
|
|
34
|
+
--color-secondary-900: var(--color-secondary-900);
|
|
35
|
+
--color-secondary-950: var(--color-secondary-950);
|
|
36
|
+
--color-success-50: var(--color-success-50);
|
|
37
|
+
--color-success-100: var(--color-success-100);
|
|
38
|
+
--color-success-200: var(--color-success-200);
|
|
39
|
+
--color-success-300: var(--color-success-300);
|
|
40
|
+
--color-success-400: var(--color-success-400);
|
|
41
|
+
--color-success-500: var(--color-success-500);
|
|
42
|
+
--color-success-600: var(--color-success-600);
|
|
43
|
+
--color-success-700: var(--color-success-700);
|
|
44
|
+
--color-success-800: var(--color-success-800);
|
|
45
|
+
--color-success-900: var(--color-success-900);
|
|
46
|
+
--color-success-950: var(--color-success-950);
|
|
47
|
+
--color-warning-50: var(--color-warning-50);
|
|
48
|
+
--color-warning-100: var(--color-warning-100);
|
|
49
|
+
--color-warning-200: var(--color-warning-200);
|
|
50
|
+
--color-warning-300: var(--color-warning-300);
|
|
51
|
+
--color-warning-400: var(--color-warning-400);
|
|
52
|
+
--color-warning-500: var(--color-warning-500);
|
|
53
|
+
--color-warning-600: var(--color-warning-600);
|
|
54
|
+
--color-warning-700: var(--color-warning-700);
|
|
55
|
+
--color-warning-800: var(--color-warning-800);
|
|
56
|
+
--color-warning-900: var(--color-warning-900);
|
|
57
|
+
--color-warning-950: var(--color-warning-950);
|
|
58
|
+
--color-danger-50: var(--color-danger-50);
|
|
59
|
+
--color-danger-100: var(--color-danger-100);
|
|
60
|
+
--color-danger-200: var(--color-danger-200);
|
|
61
|
+
--color-danger-300: var(--color-danger-300);
|
|
62
|
+
--color-danger-400: var(--color-danger-400);
|
|
63
|
+
--color-danger-500: var(--color-danger-500);
|
|
64
|
+
--color-danger-600: var(--color-danger-600);
|
|
65
|
+
--color-danger-700: var(--color-danger-700);
|
|
66
|
+
--color-danger-800: var(--color-danger-800);
|
|
67
|
+
--color-danger-900: var(--color-danger-900);
|
|
68
|
+
--color-danger-950: var(--color-danger-950);
|
|
69
|
+
--color-neutral-50: var(--color-neutral-50);
|
|
70
|
+
--color-neutral-100: var(--color-neutral-100);
|
|
71
|
+
--color-neutral-200: var(--color-neutral-200);
|
|
72
|
+
--color-neutral-300: var(--color-neutral-300);
|
|
73
|
+
--color-neutral-400: var(--color-neutral-400);
|
|
74
|
+
--color-neutral-500: var(--color-neutral-500);
|
|
75
|
+
--color-neutral-600: var(--color-neutral-600);
|
|
76
|
+
--color-neutral-700: var(--color-neutral-700);
|
|
77
|
+
--color-neutral-800: var(--color-neutral-800);
|
|
78
|
+
--color-neutral-900: var(--color-neutral-900);
|
|
79
|
+
--color-neutral-950: var(--color-neutral-950);
|
|
80
|
+
--color-background-base: var(--color-background-base);
|
|
81
|
+
--color-background-elevated: var(--color-background-elevated);
|
|
82
|
+
--color-background-subtle: var(--color-background-subtle);
|
|
83
|
+
--color-background-overlay: var(--color-background-overlay);
|
|
84
|
+
--color-background-hover: var(--color-background-hover);
|
|
85
|
+
--color-text-primary: var(--color-text-primary);
|
|
86
|
+
--color-text-secondary: var(--color-text-secondary);
|
|
87
|
+
--color-text-tertiary: var(--color-text-tertiary);
|
|
88
|
+
--color-text-disabled: var(--color-text-disabled);
|
|
89
|
+
--color-text-inverse: var(--color-text-inverse);
|
|
90
|
+
--color-text-placeholder: var(--color-text-placeholder);
|
|
91
|
+
--color-border-default: var(--color-border-default);
|
|
92
|
+
--color-border-subtle: var(--color-border-subtle);
|
|
93
|
+
--color-border-strong: var(--color-border-strong);
|
|
94
|
+
--color-code-keyword: var(--color-code-keyword);
|
|
95
|
+
--color-code-tag: var(--color-code-tag);
|
|
96
|
+
--color-code-string: var(--color-code-string);
|
|
97
|
+
--color-code-attr: var(--color-code-attr);
|
|
98
|
+
--color-code-comment: var(--color-code-comment);
|
|
99
|
+
--color-code-punctuation: var(--color-code-punctuation);
|
|
100
|
+
--color-artifact-base: var(--color-artifact-base);
|
|
101
|
+
--color-artifact-raised: var(--color-artifact-raised);
|
|
102
|
+
--color-artifact-border: var(--color-artifact-border);
|
|
103
|
+
--color-artifact-text: var(--color-artifact-text);
|
|
104
|
+
--color-artifact-muted: var(--color-artifact-muted);
|
|
105
|
+
--color-artifact-strong: var(--color-artifact-strong);
|
|
106
|
+
--color-artifact-keyword: var(--color-artifact-keyword);
|
|
107
|
+
--color-artifact-string: var(--color-artifact-string);
|
|
108
|
+
--color-artifact-highlight: var(--color-artifact-highlight);
|
|
109
|
+
--color-footer-base: var(--color-footer-base);
|
|
110
|
+
--color-footer-border: var(--color-footer-border);
|
|
111
|
+
--color-footer-text: var(--color-footer-text);
|
|
112
|
+
--color-footer-muted: var(--color-footer-muted);
|
|
113
|
+
--color-footer-strong: var(--color-footer-strong);
|
|
114
|
+
--color-brand-tile: var(--color-brand-tile);
|
|
115
|
+
--color-brand-keep: var(--color-brand-keep);
|
|
116
|
+
--color-canvas: var(--color-canvas);
|
|
117
|
+
--font-sans: var(--font-family-sans);
|
|
118
|
+
--font-serif: var(--font-family-serif);
|
|
119
|
+
--font-mono: var(--font-family-mono);
|
|
120
|
+
--text-xs: var(--font-size-xs);
|
|
121
|
+
--text-sm: var(--font-size-sm);
|
|
122
|
+
--text-base: var(--font-size-base);
|
|
123
|
+
--text-lg: var(--font-size-lg);
|
|
124
|
+
--text-xl: var(--font-size-xl);
|
|
125
|
+
--text-2xl: var(--font-size-2xl);
|
|
126
|
+
--text-3xl: var(--font-size-3xl);
|
|
127
|
+
--text-4xl: var(--font-size-4xl);
|
|
128
|
+
--text-5xl: var(--font-size-5xl);
|
|
129
|
+
--font-weight-normal: var(--font-weight-normal);
|
|
130
|
+
--font-weight-medium: var(--font-weight-medium);
|
|
131
|
+
--font-weight-semibold: var(--font-weight-semibold);
|
|
132
|
+
--font-weight-bold: var(--font-weight-bold);
|
|
133
|
+
--leading-tight: var(--line-height-tight);
|
|
134
|
+
--leading-normal: var(--line-height-normal);
|
|
135
|
+
--leading-relaxed: var(--line-height-relaxed);
|
|
136
|
+
--spacing-0: var(--spacing-0);
|
|
137
|
+
--spacing-1: var(--spacing-1);
|
|
138
|
+
--spacing-2: var(--spacing-2);
|
|
139
|
+
--spacing-3: var(--spacing-3);
|
|
140
|
+
--spacing-4: var(--spacing-4);
|
|
141
|
+
--spacing-5: var(--spacing-5);
|
|
142
|
+
--spacing-6: var(--spacing-6);
|
|
143
|
+
--spacing-7: var(--spacing-7);
|
|
144
|
+
--spacing-8: var(--spacing-8);
|
|
145
|
+
--spacing-9: var(--spacing-9);
|
|
146
|
+
--spacing-10: var(--spacing-10);
|
|
147
|
+
--spacing-11: var(--spacing-11);
|
|
148
|
+
--spacing-12: var(--spacing-12);
|
|
149
|
+
--spacing-14: var(--spacing-14);
|
|
150
|
+
--spacing-16: var(--spacing-16);
|
|
151
|
+
--spacing-20: var(--spacing-20);
|
|
152
|
+
--spacing-24: var(--spacing-24);
|
|
153
|
+
--spacing-28: var(--spacing-28);
|
|
154
|
+
--spacing-32: var(--spacing-32);
|
|
155
|
+
--spacing-44: var(--spacing-44);
|
|
156
|
+
--spacing-64: var(--spacing-64);
|
|
157
|
+
--spacing-72: var(--spacing-72);
|
|
158
|
+
--spacing-px: var(--spacing-px);
|
|
159
|
+
--radius-none: var(--radius-none);
|
|
160
|
+
--radius-sm: var(--radius-sm);
|
|
161
|
+
--radius-md: var(--radius-md);
|
|
162
|
+
--radius-lg: var(--radius-lg);
|
|
163
|
+
--radius-xl: var(--radius-xl);
|
|
164
|
+
--radius-full: var(--radius-full);
|
|
165
|
+
--shadow-sm: var(--shadow-sm);
|
|
166
|
+
--shadow-md: var(--shadow-md);
|
|
167
|
+
--shadow-lg: var(--shadow-lg);
|
|
168
|
+
--shadow-xl: var(--shadow-xl);
|
|
169
|
+
--ease-standard: var(--motion-easing-standard);
|
|
170
|
+
--ease-enter: var(--motion-easing-enter);
|
|
171
|
+
--ease-exit: var(--motion-easing-exit);
|
|
172
|
+
--transition-duration-fast: var(--motion-duration-fast);
|
|
173
|
+
--transition-duration-normal: var(--motion-duration-normal);
|
|
174
|
+
--transition-duration-slow: var(--motion-duration-slow);
|
|
175
|
+
--default-transition-duration: 0s;
|
|
176
|
+
}
|
|
@@ -10,12 +10,13 @@ export declare const tailwindTheme: {
|
|
|
10
10
|
danger: Record<import("./types.js").ColorScaleStep, string>;
|
|
11
11
|
neutral: Record<import("./types.js").ColorScaleStep, string>;
|
|
12
12
|
background: Record<"base" | "elevated" | "subtle" | "overlay" | "hover", string>;
|
|
13
|
-
text: Record<"primary" | "secondary" | "tertiary" | "disabled" | "inverse", string>;
|
|
13
|
+
text: Record<"primary" | "secondary" | "tertiary" | "disabled" | "inverse" | "placeholder", string>;
|
|
14
14
|
border: Record<"subtle" | "default" | "strong", string>;
|
|
15
15
|
code: Record<"string" | "keyword" | "tag" | "attr" | "comment" | "punctuation", string>;
|
|
16
16
|
artifact: Record<"string" | "base" | "text" | "border" | "strong" | "keyword" | "raised" | "muted" | "highlight", string>;
|
|
17
17
|
footer: Record<"base" | "text" | "border" | "strong" | "muted", string>;
|
|
18
18
|
brand: Record<"tile" | "keep", string>;
|
|
19
|
+
canvas: string;
|
|
19
20
|
};
|
|
20
21
|
fontFamily: {
|
|
21
22
|
sans: string;
|
|
@@ -37,6 +37,8 @@ export const tailwindTheme = {
|
|
|
37
37
|
artifact: scaleRefs(tokens.color.artifact, 'color-artifact'),
|
|
38
38
|
footer: scaleRefs(tokens.color.footer, 'color-footer'),
|
|
39
39
|
brand: scaleRefs(tokens.color.brand, 'color-brand'),
|
|
40
|
+
// A single colour, not a group: bg-canvas.
|
|
41
|
+
canvas: 'var(--color-canvas)',
|
|
40
42
|
},
|
|
41
43
|
fontFamily: {
|
|
42
44
|
sans: 'var(--font-family-sans)',
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
--color-text-tertiary: #616966;
|
|
78
78
|
--color-text-disabled: #8C9490;
|
|
79
79
|
--color-text-inverse: #FFFFFF;
|
|
80
|
+
--color-text-placeholder: #9CA3AF;
|
|
80
81
|
--color-border-default: #E1DED5;
|
|
81
82
|
--color-border-subtle: #ECEAE3;
|
|
82
83
|
--color-border-strong: #CFCBC0;
|
|
@@ -102,6 +103,7 @@
|
|
|
102
103
|
--color-footer-strong: #FFFFFF;
|
|
103
104
|
--color-brand-tile: #113D5C;
|
|
104
105
|
--color-brand-keep: #7CC0E8;
|
|
106
|
+
--color-canvas: #FFFFFF;
|
|
105
107
|
--spacing-0: 0;
|
|
106
108
|
--spacing-1: 0.25rem;
|
|
107
109
|
--spacing-2: 0.5rem;
|
|
@@ -111,6 +111,7 @@ export const tokens = {
|
|
|
111
111
|
tertiary: '#616966',
|
|
112
112
|
disabled: '#8C9490',
|
|
113
113
|
inverse: '#FFFFFF',
|
|
114
|
+
placeholder: '#9CA3AF',
|
|
114
115
|
},
|
|
115
116
|
border: {
|
|
116
117
|
default: '#E1DED5',
|
|
@@ -165,6 +166,9 @@ export const tokens = {
|
|
|
165
166
|
tile: '#113D5C',
|
|
166
167
|
keep: '#7CC0E8',
|
|
167
168
|
},
|
|
169
|
+
// S314c: the visitor page's ground in the edit-on-page preview, never
|
|
170
|
+
// themed (see types.ts). Dark mode must not paint it.
|
|
171
|
+
canvas: '#FFFFFF',
|
|
168
172
|
},
|
|
169
173
|
typography: {
|
|
170
174
|
fontFamily: {
|
|
@@ -90,7 +90,8 @@
|
|
|
90
90
|
"secondary": "#5C6663",
|
|
91
91
|
"tertiary": "#616966",
|
|
92
92
|
"disabled": "#8C9490",
|
|
93
|
-
"inverse": "#FFFFFF"
|
|
93
|
+
"inverse": "#FFFFFF",
|
|
94
|
+
"placeholder": "#9CA3AF"
|
|
94
95
|
},
|
|
95
96
|
"border": {
|
|
96
97
|
"default": "#E1DED5",
|
|
@@ -126,7 +127,8 @@
|
|
|
126
127
|
"brand": {
|
|
127
128
|
"tile": "#113D5C",
|
|
128
129
|
"keep": "#7CC0E8"
|
|
129
|
-
}
|
|
130
|
+
},
|
|
131
|
+
"canvas": "#FFFFFF"
|
|
130
132
|
},
|
|
131
133
|
"typography": {
|
|
132
134
|
"fontFamily": {
|
|
@@ -33,6 +33,7 @@ export interface KardalumDesignTokens {
|
|
|
33
33
|
tertiary: string;
|
|
34
34
|
disabled: string;
|
|
35
35
|
inverse: string;
|
|
36
|
+
placeholder: string;
|
|
36
37
|
};
|
|
37
38
|
border: {
|
|
38
39
|
default: string;
|
|
@@ -69,6 +70,7 @@ export interface KardalumDesignTokens {
|
|
|
69
70
|
tile: string;
|
|
70
71
|
keep: string;
|
|
71
72
|
};
|
|
73
|
+
canvas: string;
|
|
72
74
|
};
|
|
73
75
|
typography: {
|
|
74
76
|
fontFamily: {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"version": "0.14.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
-
"description": "Kardalum's design token source, generating the Tailwind
|
|
6
|
+
"description": "Kardalum's design token source, generating the Tailwind 4 theme, the Tailwind 3 theme and CSS variables consumed by the UI library, admin UI, and plugin UIs.",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": ">=22.12"
|
|
9
9
|
},
|
|
@@ -30,10 +30,13 @@
|
|
|
30
30
|
},
|
|
31
31
|
"./tokens.css": "./dist/tokens.css",
|
|
32
32
|
"./system-dark.css": "./dist/system-dark.css",
|
|
33
|
-
"./tokens.json": "./dist/tokens.json"
|
|
33
|
+
"./tokens.json": "./dist/tokens.json",
|
|
34
|
+
"./tailwind-theme.css": "./dist/tailwind-theme.css"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
|
-
"@
|
|
37
|
+
"@tailwindcss/node": "4.3.3",
|
|
38
|
+
"@types/node": "20.19.43",
|
|
39
|
+
"tailwindcss": "4.3.3"
|
|
37
40
|
},
|
|
38
41
|
"scripts": {
|
|
39
42
|
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p . && node dist/generate.js",
|
|
@@ -39,7 +39,10 @@ const result = verifyEnvelope({ envelope, signature }, sha256, [{ keyId, publicK
|
|
|
39
39
|
|
|
40
40
|
**Safe extraction.** `extractArtifact` unpacks a plugin `.zip` with hard
|
|
41
41
|
limits on entry count, per-entry size, and total size, and rejects
|
|
42
|
-
zip-slip-style paths (leading `/`, drive letters, `..` segments)
|
|
42
|
+
zip-slip-style paths (leading `/`, drive letters, `..` segments), any name
|
|
43
|
+
another filesystem would read differently (a backslash, a colon, a control
|
|
44
|
+
or non-ASCII character, a segment ending in `.` or a space, `~` followed by
|
|
45
|
+
a digit), a second name for an entry, and any path held twice, before
|
|
43
46
|
anything is written to disk:
|
|
44
47
|
|
|
45
48
|
```ts
|
|
@@ -68,4 +71,4 @@ between the two install paths, not a gap in this package.
|
|
|
68
71
|
## Source & support
|
|
69
72
|
|
|
70
73
|
Source: [kardalum-starter](https://github.com/kardalum/kardalum-starter).
|
|
71
|
-
Docs: https://
|
|
74
|
+
Docs: https://dev.kardalum.com/docs/. Apache-2.0.
|