@kardalum/plugin-sdk 0.17.0 → 0.19.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 +109 -0
- package/README.md +4 -3
- 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-serializers.js +1 -1
- package/dist/built-in-settings-schemas.d.ts +2 -0
- package/dist/built-in-settings-schemas.js +31 -4
- package/dist/built-in-value-schemas.js +3 -0
- package/dist/built-ins.js +20 -11
- package/dist/capabilities.js +5 -0
- package/dist/data-type-plugin.d.ts +2 -2
- package/dist/datatype-validation.d.ts +2 -2
- package/dist/datatype-validation.js +20 -6
- package/dist/datatypes-entry.d.ts +1 -0
- package/dist/datatypes-entry.js +1 -0
- package/dist/define-plugin.d.ts +4 -4
- package/dist/define-plugin.js +5 -5
- 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/index.d.ts +8 -1
- package/dist/index.js +11 -12
- package/dist/manifest-entry.d.ts +4 -0
- package/dist/manifest-entry.js +4 -0
- package/dist/manifest-schema.d.ts +5 -1
- package/dist/manifest-schema.js +14 -2
- package/dist/manifest.d.ts +21 -1
- package/dist/media/media-picker.js +34 -34
- package/dist/notify.d.ts +17 -0
- package/dist/notify.js +17 -0
- package/dist/plugin-context.js +3 -3
- package/dist/register-built-ins.js +6 -6
- package/dist/registry.js +1 -1
- package/dist/richtext/block-panel.js +19 -20
- package/dist/richtext/extensions.js +17 -8
- package/dist/richtext/insert-menu.js +4 -4
- package/dist/richtext/kardalum-block.js +17 -17
- package/dist/richtext/style-listbox.js +2 -2
- package/dist/richtext/text-style-class.js +1 -1
- package/dist/richtext-html-entry.d.ts +35 -0
- package/dist/richtext-html-entry.js +73 -0
- package/dist/simple-storage-value-provider.js +3 -3
- package/dist/structured-storage-types.d.ts +12 -1
- package/dist/structured-storage-types.js +2 -2
- package/dist/tailwind.js +10 -3
- package/dist/tokens/tailwind-theme.css +176 -0
- package/dist/tokens/tokens.css +1 -0
- package/dist/tokens/tokens.json +2 -1
- package/dist/ui-entry.js +3 -3
- 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/date-range-view.js +5 -5
- package/dist/views/html-code-editor.js +2 -3
- package/dist/views/html-view.js +7 -7
- package/dist/views/image-view.js +5 -5
- package/dist/views/rich-text-view.js +33 -32
- package/node_modules/@kardalum/api-schemas/README.md +1 -1
- package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +17 -15
- 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 +1 -0
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +10 -3
- package/node_modules/@kardalum/api-schemas/dist/auth.schema.js +1 -1
- 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 +13 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +30 -9
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +3 -3
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +12 -6
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +11 -6
- 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 +26 -6
- 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 +6 -3
- 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.d.ts +90 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +56 -6
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +8 -8
- 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 +48 -19
- package/node_modules/@kardalum/api-schemas/dist/index.js +34 -12
- 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/listing-categories.schema.d.ts +46 -0
- package/node_modules/@kardalum/api-schemas/dist/listing-categories.schema.js +52 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +162 -1
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +144 -9
- 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 +15 -9
- 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/media.schema.js +5 -5
- 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-docs-api.schema.d.ts +7 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.js +1 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +251 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +196 -31
- 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.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +3 -3
- package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.d.ts +10 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.js +24 -4
- 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 +23 -20
- package/node_modules/@kardalum/api-schemas/dist/render-editing.js +4 -4
- package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.js +1 -1
- 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/server-settings-api.schema.d.ts +207 -0
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +147 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +11 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +17 -8
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +14 -0
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +3 -3
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +27 -12
- package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +7 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +22 -10
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +6 -1
- 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 +13 -0
- package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.js +5 -0
- package/node_modules/@kardalum/design-tokens/README.md +1 -1
- package/node_modules/@kardalum/design-tokens/dist/build-css.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/build-css.js +2 -2
- 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 +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +3 -3
- package/node_modules/@kardalum/design-tokens/dist/theme-css.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/theme-css.js +2 -2
- package/node_modules/@kardalum/design-tokens/dist/theme-types.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.d.ts +3 -3
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.js +3 -3
- package/node_modules/@kardalum/design-tokens/dist/themes/light.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/themes/light.js +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +1 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +3 -3
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +6 -5
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +2 -1
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +2 -1
- package/node_modules/@kardalum/design-tokens/dist/types.js +1 -1
- package/node_modules/@kardalum/design-tokens/package.json +6 -3
- package/node_modules/@kardalum/plugin-package/README.md +1 -1
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +4 -4
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +54 -6
- package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +18 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +9 -4
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +58 -1
- package/node_modules/@kardalum/plugin-package/dist/envelope.d.ts +2 -2
- package/node_modules/@kardalum/plugin-package/dist/envelope.js +2 -2
- package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +3 -3
- package/node_modules/@kardalum/plugin-package/dist/extract.js +10 -10
- package/node_modules/@kardalum/plugin-package/dist/hash.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/hash.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +4 -2
- package/node_modules/@kardalum/plugin-package/dist/index.js +3 -1
- 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/package-contract.d.ts +2 -2
- package/node_modules/@kardalum/plugin-package/dist/package-contract.js +5 -5
- package/node_modules/@kardalum/plugin-package/dist/types.d.ts +1 -1
- 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/ui/README.md +1 -1
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.js +8 -3
- package/node_modules/@kardalum/ui/dist/components/badge.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/button.js +2 -2
- package/node_modules/@kardalum/ui/dist/components/checkbox.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.js +52 -4
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.d.ts +5 -1
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +20 -7
- package/node_modules/@kardalum/ui/dist/components/empty-state.d.ts +4 -4
- package/node_modules/@kardalum/ui/dist/components/input.js +6 -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/property-field.js +3 -3
- package/node_modules/@kardalum/ui/dist/components/sheet.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/sheet.js +15 -9
- package/node_modules/@kardalum/ui/dist/components/skeleton.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/tab-strip.d.ts +3 -3
- package/node_modules/@kardalum/ui/dist/components/tab-strip.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/toast.js +4 -3
- package/node_modules/@kardalum/ui/dist/components/tooltip.d.ts +27 -0
- package/node_modules/@kardalum/ui/dist/components/tooltip.js +82 -0
- package/node_modules/@kardalum/ui/dist/components/truncated-text.d.ts +11 -0
- package/node_modules/@kardalum/ui/dist/components/truncated-text.js +94 -0
- package/node_modules/@kardalum/ui/dist/components/use-toast.js +2 -2
- package/node_modules/@kardalum/ui/dist/index.d.ts +4 -1
- package/node_modules/@kardalum/ui/dist/index.js +4 -1
- package/node_modules/@kardalum/ui/dist/lib/menu-host.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/lib/menu-host.js +17 -0
- package/node_modules/@kardalum/ui/package.json +8 -6
- package/package.json +21 -7
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { BuiltInTheme } from '../theme-types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Dark theme overrides (S177/S178): warm charcoal, not GitHub-black. The
|
|
4
|
-
* light blue (#7CC0E8) becomes the ACTION colour itself
|
|
4
|
+
* light blue (#7CC0E8) becomes the ACTION colour itself: primary-600 is
|
|
5
5
|
* remapped to it, and text.inverse flips to near-black so `bg-primary-600
|
|
6
6
|
* text-text-inverse` (every primary button) stays legible without any
|
|
7
7
|
* component knowing which theme is active. Status scales remap the steps
|
|
8
|
-
* components use accordingly (100 fill, 600, and the AA text step
|
|
9
|
-
* for success/danger, 800 for warning). Colour only
|
|
8
|
+
* components use accordingly (100 fill, 600, and the AA text step: 700
|
|
9
|
+
* for success/danger, 800 for warning). Colour only; the
|
|
10
10
|
* Theme System contract keeps typography/spacing/shadow/motion in the
|
|
11
11
|
* base set.
|
|
12
12
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Dark theme overrides (S177/S178): warm charcoal, not GitHub-black. The
|
|
3
|
-
* light blue (#7CC0E8) becomes the ACTION colour itself
|
|
3
|
+
* light blue (#7CC0E8) becomes the ACTION colour itself: primary-600 is
|
|
4
4
|
* remapped to it, and text.inverse flips to near-black so `bg-primary-600
|
|
5
5
|
* text-text-inverse` (every primary button) stays legible without any
|
|
6
6
|
* component knowing which theme is active. Status scales remap the steps
|
|
7
|
-
* components use accordingly (100 fill, 600, and the AA text step
|
|
8
|
-
* for success/danger, 800 for warning). Colour only
|
|
7
|
+
* components use accordingly (100 fill, 600, and the AA text step: 700
|
|
8
|
+
* for success/danger, 800 for warning). Colour only; the
|
|
9
9
|
* Theme System contract keeps typography/spacing/shadow/motion in the
|
|
10
10
|
* base set.
|
|
11
11
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BuiltInTheme } from '../theme-types.js';
|
|
2
2
|
/**
|
|
3
|
-
* Light needs no overrides
|
|
3
|
+
* Light needs no overrides: the base token set generated to :root
|
|
4
4
|
* (tokens.ts) already IS the light theme. Still modeled as a real
|
|
5
5
|
* BuiltInTheme, not a special case: applying any theme is always
|
|
6
6
|
* "set data-theme to this id," whether or not that theme happens to
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Light needs no overrides
|
|
2
|
+
* Light needs no overrides: the base token set generated to :root
|
|
3
3
|
* (tokens.ts) already IS the light theme. Still modeled as a real
|
|
4
4
|
* BuiltInTheme, not a special case: applying any theme is always
|
|
5
5
|
* "set data-theme to this id," whether or not that theme happens to
|
|
@@ -6,12 +6,12 @@ import type { KardalumDesignTokens } from './types.js';
|
|
|
6
6
|
*
|
|
7
7
|
* Colour roles: the primary scale runs sky (50–300, atmosphere:
|
|
8
8
|
* selection, focus, the version rail) into cerulean (600–800, action:
|
|
9
|
-
* buttons, links). THE ACTION COLOUR IS primary-600
|
|
9
|
+
* buttons, links). THE ACTION COLOUR IS primary-600. This supersedes the
|
|
10
10
|
* Session-27 "brand = 500 step" convention for primary; 500 is a
|
|
11
11
|
* mid-step used for nothing in particular. Status scales pair a 100-step
|
|
12
12
|
* soft fill with the lightest text step that clears 4.5:1 on that fill
|
|
13
13
|
* (success/danger 700, warning 800). Neutrals are warm stone, not grey. The
|
|
14
|
-
* dark set (themes/dark.ts) overrides colour only
|
|
14
|
+
* dark set (themes/dark.ts) overrides colour only, and themes never touch
|
|
15
15
|
* typography/spacing/shadow/motion.
|
|
16
16
|
*/
|
|
17
17
|
export declare const tokens: KardalumDesignTokens;
|
|
@@ -19,7 +19,7 @@ export declare const tokens: KardalumDesignTokens;
|
|
|
19
19
|
* Under an Arabic document language the SAME sans token leads with Plex
|
|
20
20
|
* Sans Arabic (its Latin glyphs are Plex-compatible), so RTL locales get a
|
|
21
21
|
* native UI face without any component knowing. Emitted by build-css.ts
|
|
22
|
-
* as a `[lang="ar"]` block
|
|
22
|
+
* as a `[lang="ar"]` block, a language-conditional value of an existing
|
|
23
23
|
* token, not a new one.
|
|
24
24
|
*/
|
|
25
25
|
export declare const ARABIC_SANS_FONT_FAMILY = "'IBM Plex Sans Arabic', 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif";
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Colour roles: the primary scale runs sky (50–300, atmosphere:
|
|
7
7
|
* selection, focus, the version rail) into cerulean (600–800, action:
|
|
8
|
-
* buttons, links). THE ACTION COLOUR IS primary-600
|
|
8
|
+
* buttons, links). THE ACTION COLOUR IS primary-600. This supersedes the
|
|
9
9
|
* Session-27 "brand = 500 step" convention for primary; 500 is a
|
|
10
10
|
* mid-step used for nothing in particular. Status scales pair a 100-step
|
|
11
11
|
* soft fill with the lightest text step that clears 4.5:1 on that fill
|
|
12
12
|
* (success/danger 700, warning 800). Neutrals are warm stone, not grey. The
|
|
13
|
-
* dark set (themes/dark.ts) overrides colour only
|
|
13
|
+
* dark set (themes/dark.ts) overrides colour only, and themes never touch
|
|
14
14
|
* typography/spacing/shadow/motion.
|
|
15
15
|
*/
|
|
16
16
|
export const tokens = {
|
|
@@ -100,7 +100,7 @@ export const tokens = {
|
|
|
100
100
|
subtle: '#FAF9F5',
|
|
101
101
|
overlay: 'rgba(27, 35, 33, 0.5)',
|
|
102
102
|
// Nudged from #ECEAE3 (S179): the original wash put primary-600 text
|
|
103
|
-
// at 4.48:1 against it, just under AA
|
|
103
|
+
// at 4.48:1 against it, just under AA; #F0EEE7 clears 4.5:1 while
|
|
104
104
|
// staying the darkest of the four light surfaces (the hover-wash
|
|
105
105
|
// hierarchy is unchanged).
|
|
106
106
|
hover: '#F0EEE7',
|
|
@@ -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',
|
|
@@ -236,7 +237,7 @@ export const tokens = {
|
|
|
236
237
|
'44': '11rem',
|
|
237
238
|
'64': '16rem',
|
|
238
239
|
// 72 (18rem): the persistent tree panel's width (S49 structure, S177 spec
|
|
239
|
-
// 284px)
|
|
240
|
+
// 284px), and Tailwind's `w-72` resolves only through this scale.
|
|
240
241
|
'72': '18rem',
|
|
241
242
|
},
|
|
242
243
|
// 6 small · 8 controls · 12 cards · 16 dialogs
|
|
@@ -273,7 +274,7 @@ export const tokens = {
|
|
|
273
274
|
* Under an Arabic document language the SAME sans token leads with Plex
|
|
274
275
|
* Sans Arabic (its Latin glyphs are Plex-compatible), so RTL locales get a
|
|
275
276
|
* native UI face without any component knowing. Emitted by build-css.ts
|
|
276
|
-
* as a `[lang="ar"]` block
|
|
277
|
+
* as a `[lang="ar"]` block, a language-conditional value of an existing
|
|
277
278
|
* token, not a new one.
|
|
278
279
|
*/
|
|
279
280
|
export const ARABIC_SANS_FONT_FAMILY = "'IBM Plex Sans Arabic', 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Design token type definitions
|
|
2
|
+
* Design token type definitions: the shape every theme (built-in or
|
|
3
3
|
* plugin) targets.
|
|
4
4
|
*/
|
|
5
5
|
export type ColorScaleStep = '50' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | '950';
|
|
@@ -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;
|
|
@@ -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",
|
|
@@ -66,11 +66,11 @@ export interface Capability {
|
|
|
66
66
|
* them, and they read as a closing caveat rather than as a feature.
|
|
67
67
|
*
|
|
68
68
|
* This package cannot name the SDK's `PluginContributions` (the SDK depends
|
|
69
|
-
* on it), so the SDK asserts at the type level that these
|
|
70
|
-
* exactly `keyof PluginContributions`:
|
|
69
|
+
* on it), so the SDK asserts at the type level that these 17 keys are
|
|
70
|
+
* exactly `keyof PluginContributions`: an eighteenth contribution added to the
|
|
71
71
|
* contract and not classified here is a compile error in the SDK's build.
|
|
72
72
|
*/
|
|
73
|
-
export declare const CONTRIBUTION_EMISSION_ORDER: readonly ["dataTypes", "documentTypes", "adminSections", "railEntries", "dashboardWidgets", "templates", "assets", "themeTokens", "hooks", "scheduledTasks", "mediaProcessors", "serializers", "apiRoutes", "exposedServices", "bundledPlugins", "bundledTemplate"];
|
|
73
|
+
export declare const CONTRIBUTION_EMISSION_ORDER: readonly ["dataTypes", "documentTypes", "adminSections", "railEntries", "dashboardWidgets", "templates", "assets", "themeTokens", "hooks", "scheduledTasks", "mediaProcessors", "serializers", "apiRoutes", "exposedServices", "notifications", "bundledPlugins", "bundledTemplate"];
|
|
74
74
|
export type ContributionKey = (typeof CONTRIBUTION_EMISSION_ORDER)[number];
|
|
75
75
|
/** The assertion kinds, in emission order. The SDK asserts these are
|
|
76
76
|
* exactly `keyof PluginAssertions`, for the reason above. */
|
|
@@ -78,7 +78,7 @@ export declare const ASSERTION_KEYS: readonly ["externalNetwork", "filesystemAcc
|
|
|
78
78
|
export type AssertionKey = (typeof ASSERTION_KEYS)[number];
|
|
79
79
|
/** Whether this contribution kind sits behind a named permission action.
|
|
80
80
|
* Lives on CONTRIBUTION_RULES rather than in a separate list, because that
|
|
81
|
-
* record is compiler-total over the
|
|
81
|
+
* record is compiler-total over the 17 contribution keys: an eighteenth key
|
|
82
82
|
* cannot be added without classifying it here. */
|
|
83
83
|
export declare function isActionGated(key: ContributionKey): boolean;
|
|
84
84
|
/** Every capability id this contract can produce, for the readers that
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
* them, and they read as a closing caveat rather than as a feature.
|
|
31
31
|
*
|
|
32
32
|
* This package cannot name the SDK's `PluginContributions` (the SDK depends
|
|
33
|
-
* on it), so the SDK asserts at the type level that these
|
|
34
|
-
* exactly `keyof PluginContributions`:
|
|
33
|
+
* on it), so the SDK asserts at the type level that these 17 keys are
|
|
34
|
+
* exactly `keyof PluginContributions`: an eighteenth contribution added to the
|
|
35
35
|
* contract and not classified here is a compile error in the SDK's build.
|
|
36
36
|
*/
|
|
37
37
|
export const CONTRIBUTION_EMISSION_ORDER = [
|
|
@@ -49,6 +49,7 @@ export const CONTRIBUTION_EMISSION_ORDER = [
|
|
|
49
49
|
"serializers",
|
|
50
50
|
"apiRoutes",
|
|
51
51
|
"exposedServices",
|
|
52
|
+
"notifications",
|
|
52
53
|
"bundledPlugins",
|
|
53
54
|
"bundledTemplate",
|
|
54
55
|
];
|
|
@@ -64,11 +65,12 @@ export const ASSERTION_KEYS = ["externalNetwork", "filesystemAccess"];
|
|
|
64
65
|
*
|
|
65
66
|
* Classification follows S267 section 6 and its stated principle: a
|
|
66
67
|
* capability is mediated when the platform decides the outcome, and promised
|
|
67
|
-
* when the plugin does. Every contribution below is mediated
|
|
68
|
+
* when the plugin does. Every contribution below is mediated but `notifications`,
|
|
68
69
|
* because every one of them is consumed by the host: it mounts the view,
|
|
69
70
|
* dispatches the hook, runs the task, registers the template. The only
|
|
70
|
-
* contribution that is not wholly mediated is
|
|
71
|
-
* the tiers that let traffic reach a handler
|
|
71
|
+
* contribution besides `notifications` that is not wholly mediated is
|
|
72
|
+
* `apiRoutes`, and only for the tiers that let traffic reach a handler
|
|
73
|
+
* without a signed-in session.
|
|
72
74
|
*
|
|
73
75
|
* `exposedServices`, `bundledPlugins` and `bundledTemplate` are not named
|
|
74
76
|
* in section 6's automatic list, which enumerates a policy rather than the
|
|
@@ -101,13 +103,16 @@ const CONTRIBUTION_RULES = {
|
|
|
101
103
|
mediaProcessors: { derives: "one", id: "media.processor", mediation: "mediated", actionGated: false },
|
|
102
104
|
serializers: { derives: "one", id: "api.serializer", mediation: "mediated", actionGated: false },
|
|
103
105
|
exposedServices: { derives: "one", id: "service.exposed", mediation: "mediated", actionGated: false },
|
|
106
|
+
// S314n3 (D1): the one contribution that is promised. The host delivers each send, but
|
|
107
|
+
// what the plugin sends, to whom and how often is the plugin's code, so a reviewer reads it.
|
|
108
|
+
notifications: { derives: "one", id: "admin.notifications", mediation: "promised", actionGated: false },
|
|
104
109
|
bundledPlugins: { derives: "one", id: "bundle.plugin", mediation: "mediated", actionGated: false },
|
|
105
110
|
bundledTemplate: { derives: "one", id: "bundle.template", mediation: "mediated", actionGated: false },
|
|
106
111
|
apiRoutes: { derives: "perApiRouteTier", actionGated: true },
|
|
107
112
|
};
|
|
108
113
|
/** Whether this contribution kind sits behind a named permission action.
|
|
109
114
|
* Lives on CONTRIBUTION_RULES rather than in a separate list, because that
|
|
110
|
-
* record is compiler-total over the
|
|
115
|
+
* record is compiler-total over the 17 contribution keys: an eighteenth key
|
|
111
116
|
* cannot be added without classifying it here. */
|
|
112
117
|
export function isActionGated(key) {
|
|
113
118
|
return CONTRIBUTION_RULES[key].actionGated;
|
|
@@ -169,6 +174,37 @@ const ASSERTION_ENTRIES = ASSERTION_KEYS.map((key) => [key, ASSERTION_RULES[key]
|
|
|
169
174
|
* has to answer that question without the manifest.
|
|
170
175
|
*/
|
|
171
176
|
const STRUCTURED_STORAGE_ID = "storage.structured";
|
|
177
|
+
/** S320 (plan P7): derived from the top-level `vendorService`, not from a
|
|
178
|
+
* contribution: the host makes the call, so it is mediated. */
|
|
179
|
+
const VENDOR_SERVICE_ID = "network.vendorService";
|
|
180
|
+
const VendorUrlCtor = globalThis.URL;
|
|
181
|
+
const VENDOR_LOCAL_HOSTS = ["localhost", "127.0.0.1", "[::1]"];
|
|
182
|
+
const VENDOR_ORIGIN_MAX = 255;
|
|
183
|
+
/** The declared vendor service's host, or null when the origin is malformed. */
|
|
184
|
+
function vendorServiceHost(declaration) {
|
|
185
|
+
if (declaration === null || typeof declaration !== "object")
|
|
186
|
+
return null;
|
|
187
|
+
const value = declaration.origin;
|
|
188
|
+
if (typeof value !== "string" || value.length === 0 || value.length > VENDOR_ORIGIN_MAX)
|
|
189
|
+
return null;
|
|
190
|
+
let url;
|
|
191
|
+
try {
|
|
192
|
+
url = new VendorUrlCtor(value);
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
if (url.username !== "" || url.password !== "")
|
|
198
|
+
return null;
|
|
199
|
+
if (url.protocol === "http:") {
|
|
200
|
+
if (!VENDOR_LOCAL_HOSTS.includes(url.hostname))
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
else if (url.protocol !== "https:") {
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
return url.origin === value ? url.host : null;
|
|
207
|
+
}
|
|
172
208
|
/** Every capability id this contract can produce, for the readers that
|
|
173
209
|
* need to be pinned against it (the marketplace's static mirror) and for
|
|
174
210
|
* the reference page S289 generates. */
|
|
@@ -179,6 +215,7 @@ export const CAPABILITY_IDS = [
|
|
|
179
215
|
return rule.derives === "one" ? [rule.id] : API_ROUTE_TIERS.map((entry) => entry.id);
|
|
180
216
|
}),
|
|
181
217
|
...ASSERTION_ENTRIES.map(([, id]) => id),
|
|
218
|
+
VENDOR_SERVICE_ID,
|
|
182
219
|
];
|
|
183
220
|
// ---------------------------------------------------------------------------
|
|
184
221
|
// Reading a declaration's readable detail
|
|
@@ -327,6 +364,14 @@ export function deriveCapabilities(manifest) {
|
|
|
327
364
|
});
|
|
328
365
|
}
|
|
329
366
|
}
|
|
367
|
+
// S320 (plan P7): the vendor service. Mediated: the host makes the call, to
|
|
368
|
+
// this origin only, and sends a token, never the key. Its detail is the host
|
|
369
|
+
// the install screen names. Declaring one implies outbound network use, so
|
|
370
|
+
// `network.external` is emitted below even without the assertion.
|
|
371
|
+
const vendorHost = vendorServiceHost(source.vendorService);
|
|
372
|
+
if (vendorHost !== null) {
|
|
373
|
+
capabilities.push({ id: VENDOR_SERVICE_ID, payload: { count: 1, details: [vendorHost] }, mediation: "mediated" });
|
|
374
|
+
}
|
|
330
375
|
const assertions = source.assertions !== null && typeof source.assertions === "object"
|
|
331
376
|
? source.assertions
|
|
332
377
|
: {};
|
|
@@ -342,5 +387,8 @@ export function deriveCapabilities(manifest) {
|
|
|
342
387
|
continue;
|
|
343
388
|
capabilities.push({ id, payload: { count: 1, details: [reason] }, mediation: "promised" });
|
|
344
389
|
}
|
|
390
|
+
if (vendorHost !== null && !capabilities.some((c) => c.id === ASSERTION_RULES.externalNetwork)) {
|
|
391
|
+
capabilities.push({ id: ASSERTION_RULES.externalNetwork, payload: { count: 1, details: [] }, mediation: "promised" });
|
|
392
|
+
}
|
|
345
393
|
return capabilities;
|
|
346
394
|
}
|
|
@@ -4,7 +4,7 @@ import { gzipSync } from "node:zlib";
|
|
|
4
4
|
import { declaresClientBundle } from "../client-bundle.js";
|
|
5
5
|
import { BUNDLE_MAX_GZIP_BYTES, BUNDLE_WARN_SHARE, formatBinarySize } from "./limits.js";
|
|
6
6
|
import { failed, passed, warning } from "./support.js";
|
|
7
|
-
const kb = (bytes) => `${Math.ceil(bytes / 1024)}
|
|
7
|
+
const kb = (bytes) => `${Math.ceil(bytes / 1024)} KiB`;
|
|
8
8
|
/** Every regular file under `dir`, at any depth, never following a link. */
|
|
9
9
|
function filesUnder(dir) {
|
|
10
10
|
const files = [];
|
|
@@ -3,3 +3,6 @@ export { iconNamesCheck } from "./icons.js";
|
|
|
3
3
|
export declare const requiredViewsCheck: DeliveryCheck;
|
|
4
4
|
export declare const apiRoutesCheck: DeliveryCheck;
|
|
5
5
|
export declare const databaseCheck: DeliveryCheck;
|
|
6
|
+
/** S320 (spec 3c): a listed plugin's vendor service is https. A manifest may
|
|
7
|
+
* name http://localhost while in development; nothing published may. */
|
|
8
|
+
export declare const vendorServiceCheck: DeliveryCheck;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { API_ROUTE_ACCESS_TIERS, API_ROUTE_METHODS, TIER1_DIALECTS, checkApiRouteTiers, listIssues } from "@kardalum/api-schemas";
|
|
1
|
+
import { API_ROUTE_ACCESS_TIERS, API_ROUTE_METHODS, TIER1_DIALECTS, checkApiRouteTiers, listIssues, parseVendorServiceOrigin } from "@kardalum/api-schemas";
|
|
2
2
|
import { contributionsOf, failed, list, passed, record } from "./support.js";
|
|
3
3
|
export { iconNamesCheck } from "./icons.js";
|
|
4
4
|
function hasContent(value) {
|
|
@@ -58,3 +58,20 @@ export const databaseCheck = {
|
|
|
58
58
|
return passed(`declared: ${supported.map(String).join(", ")}`);
|
|
59
59
|
},
|
|
60
60
|
};
|
|
61
|
+
/** S320 (spec 3c): a listed plugin's vendor service is https. A manifest may
|
|
62
|
+
* name http://localhost while in development; nothing published may. */
|
|
63
|
+
export const vendorServiceCheck = {
|
|
64
|
+
name: "vendor service origin is https",
|
|
65
|
+
rule: "`vendorService.origin`, when declared, is an https origin only (scheme, host and port, no path): an http origin, localhost included, is for development and is refused at publish.",
|
|
66
|
+
gates: ["cli", "door"],
|
|
67
|
+
needsManifest: true,
|
|
68
|
+
run: ({ manifest }) => {
|
|
69
|
+
if (manifest.vendorService === undefined)
|
|
70
|
+
return passed("none declared");
|
|
71
|
+
const origin = record(manifest.vendorService)?.origin;
|
|
72
|
+
const parsed = parseVendorServiceOrigin(origin, { allowLocalHttp: false });
|
|
73
|
+
if (!parsed.ok)
|
|
74
|
+
return failed(`vendorService.origin ${parsed.reason}`);
|
|
75
|
+
return passed(`declared: ${parsed.origin}`);
|
|
76
|
+
},
|
|
77
|
+
};
|
|
@@ -10,5 +10,5 @@ export declare const BUNDLE_WARN_SHARE = 0.9;
|
|
|
10
10
|
/** A byte count as the delivery page and every rule string write it (S311 docs
|
|
11
11
|
* wave): binary units, 1 KiB being 1024 bytes, the largest that divides the
|
|
12
12
|
* count exactly, so a limit is never rounded into a different number. A check's
|
|
13
|
-
* own message prints the same size
|
|
13
|
+
* own message prints the same size, with the same units. */
|
|
14
14
|
export declare function formatBinarySize(bytes: number): string;
|
|
@@ -11,7 +11,7 @@ export const BUNDLE_WARN_SHARE = 0.9;
|
|
|
11
11
|
/** A byte count as the delivery page and every rule string write it (S311 docs
|
|
12
12
|
* wave): binary units, 1 KiB being 1024 bytes, the largest that divides the
|
|
13
13
|
* count exactly, so a limit is never rounded into a different number. A check's
|
|
14
|
-
* own message prints the same size
|
|
14
|
+
* own message prints the same size, with the same units. */
|
|
15
15
|
export function formatBinarySize(bytes) {
|
|
16
16
|
if (bytes % (1024 * 1024) === 0)
|
|
17
17
|
return `${bytes / 1024 / 1024} MiB`;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { FILE_NAME_MAX, MAX_DOC_PAGE_BYTES, MAX_DOC_PAGES, MAX_TEMPLATE_PAYLOAD_ENTRIES, PLUGIN_AUTHOR_MAX, PLUGIN_CMS_VERSION_MAX, PLUGIN_DESCRIPTION_MAX, PLUGIN_ID_MAX, PLUGIN_LICENSE_MAX, PLUGIN_LOCALE_KEY_MAX_LENGTH, PLUGIN_LOCALE_MAX_BYTES, PLUGIN_LOCALE_MAX_KEYS, PLUGIN_LOCALE_VALUE_MAX_LENGTH, PLUGIN_NAME_MAX, PLUGIN_VERSION_MAX, SAMPLE_CONTENT_MAX_MEDIA, SAMPLE_CONTENT_MAX_NODES, } from "@kardalum/api-schemas";
|
|
1
|
+
import { FILE_NAME_MAX, MAX_DOC_PAGE_BYTES, MAX_ASSET_CONTENT_BYTES, MAX_DOC_PAGES, MAX_TEMPLATE_CONTENT_BYTES, MAX_TEMPLATE_PAYLOAD_ENTRIES, PLUGIN_AUTHOR_MAX, PLUGIN_CMS_VERSION_MAX, PLUGIN_DESCRIPTION_MAX, PLUGIN_ID_MAX, PLUGIN_LICENSE_MAX, PLUGIN_LOCALE_KEY_MAX_LENGTH, PLUGIN_LOCALE_MAX_BYTES, PLUGIN_LOCALE_MAX_KEYS, PLUGIN_LOCALE_VALUE_MAX_LENGTH, PLUGIN_NAME_MAX, PLUGIN_VERSION_MAX, SAMPLE_CONTENT_MAX_MEDIA, SAMPLE_CONTENT_MAX_NODES, } from "@kardalum/api-schemas";
|
|
2
2
|
import { ENTRY_NAME_MAX, ENTRY_SEGMENTS_MAX, MAX_ENTRIES, MAX_ENTRY_BYTES, MAX_TOTAL_BYTES } from "../extract.js";
|
|
3
3
|
import { COVER_HEIGHT, COVER_WIDTH } from "../package-contract.js";
|
|
4
4
|
import { archiveNamesCheck } from "./archive-names.js";
|
|
5
5
|
import { bundleSizeCheck } from "./bundle.js";
|
|
6
|
-
import { apiRoutesCheck, databaseCheck, iconNamesCheck, requiredViewsCheck } from "./contributions.js";
|
|
6
|
+
import { apiRoutesCheck, databaseCheck, iconNamesCheck, requiredViewsCheck, vendorServiceCheck } from "./contributions.js";
|
|
7
7
|
import { labelLanguagesCheck } from "./label-languages.js";
|
|
8
8
|
import { BUNDLE_MAX_GZIP_BYTES, MANIFEST_MAX_BYTES, formatBinarySize } from "./limits.js";
|
|
9
9
|
import { localeParityCheck, localesCheck } from "./locales.js";
|
|
@@ -11,7 +11,7 @@ import { coverCheck, docsContractCheck, docsLinksCheck, readmeCheck } from "./pa
|
|
|
11
11
|
import { installOptionsCheck, sampleContentCheck } from "./sample-content.js";
|
|
12
12
|
import { SAMPLE_CONTENT_MAX_BYTES, readShippedSampleContent } from "../sample-content.js";
|
|
13
13
|
import { describeError } from "./support.js";
|
|
14
|
-
import { assetsCheck, entryBudgetCheck, templateDeclarationsCheck, templateFilesCheck, templateWiringCheck } from "./templates.js";
|
|
14
|
+
import { assetsCheck, entryBudgetCheck, payloadSizesCheck, templateDeclarationsCheck, templateFilesCheck, templateWiringCheck } from "./templates.js";
|
|
15
15
|
/** Runs the checks of one gate in order. A check that cannot run because the
|
|
16
16
|
* manifest did not parse says so; a check that throws is a failed result, never
|
|
17
17
|
* an exception that escapes the gate (a directory where a file belongs is the
|
|
@@ -42,6 +42,7 @@ export const DELIVERY_CHECKS = [
|
|
|
42
42
|
requiredViewsCheck,
|
|
43
43
|
apiRoutesCheck,
|
|
44
44
|
databaseCheck,
|
|
45
|
+
vendorServiceCheck,
|
|
45
46
|
iconNamesCheck,
|
|
46
47
|
readmeCheck,
|
|
47
48
|
coverCheck,
|
|
@@ -56,6 +57,7 @@ export const DELIVERY_CHECKS = [
|
|
|
56
57
|
templateFilesCheck,
|
|
57
58
|
templateWiringCheck,
|
|
58
59
|
assetsCheck,
|
|
60
|
+
payloadSizesCheck,
|
|
59
61
|
entryBudgetCheck,
|
|
60
62
|
archiveNamesCheck,
|
|
61
63
|
bundleSizeCheck,
|
|
@@ -73,12 +75,13 @@ export const GATE_ONLY_CHECKS = [
|
|
|
73
75
|
{ name: "template references resolve", gate: "cli", rule: "Every `render` and `layout` target names a declared alias; the marketplace does not read template text and reports it skipped.", skippedAtDoor: true },
|
|
74
76
|
{ name: "reference", gate: "cli", rule: "The manifest yields a valid `reference.json`, which the build writes and the marketplace reads.", skippedAtDoor: false },
|
|
75
77
|
{ name: "plugin SDK federation share key correct", gate: "cli", rule: "The federation config shares the SDK under its package name, and react, react-dom and the SDK each set `singleton: true` and `import: false`, so the bundle carries no fallback copy of what the host provides. The check reads the literal `shared: { ... }` in `vite.config.ts`, so write every entry out in it: it cannot follow a spread, a variable or a helper.", skippedAtDoor: false },
|
|
78
|
+
{ name: "federation type declarations off", gate: "cli", rule: "Advisory: the `federation()` options in `vite.config.ts` set `dts: false`. No Kardalum host reads federated type declarations, so generating them only costs build time, and the build leaves them out of the package either way. The check reads the options with the TypeScript parser and warns, never fails, when it cannot find `dts: false` there.", skippedAtDoor: false },
|
|
76
79
|
{ name: "archive-safety", gate: "door", rule: "The archive extracts safely: no unsafe path, no entry that carries a second name for itself, no path twice in any spelling, within the entry and byte ceilings; a link is extracted as a plain file, never as a link. The upload's reader applies the same rules.", skippedAtDoor: false },
|
|
77
80
|
{ name: "manifest-schema", gate: "door", rule: `\`manifest.json\` is at most ${formatBinarySize(MANIFEST_MAX_BYTES)}, parses, and matches the shape rule built from the shared vocabularies, declaration rules and field limits.`, skippedAtDoor: false },
|
|
78
81
|
{ name: "required-files", gate: "door", rule: "`manifest.json`, `server/plugin.js` and `server/package.json` (declaring the ESM marker) are present, plus `remoteEntry.js` when a view-bearing contribution is declared.", skippedAtDoor: false },
|
|
79
82
|
{ name: "manifest-consistency", gate: "door", rule: "The manifest's id and version match the submission record, and the extracted `manifest.json` is byte for byte the one read at upload.", skippedAtDoor: false },
|
|
80
83
|
{ name: "reserved-names", gate: "door", rule: "Nothing at the package root is named `kardalum-license.json`, in any case: the marketplace writes that file into every licensed download.", skippedAtDoor: false },
|
|
81
|
-
{ name: "bundle-members", gate: "door", rule: "
|
|
84
|
+
{ name: "bundle-members", gate: "door", rule: "Every plugin that declares bundledPlugins: each member id is a published listing, and a paid member belongs to the bundle's author; a listing labelled bundle must declare at least one member.", skippedAtDoor: false },
|
|
82
85
|
{ name: "internal-validation-error", gate: "door", rule: "Not a rule a package breaks: the marketplace could not read the stored package, or could not finish checking it in time. Submit again under a new version number and every check runs afresh.", skippedAtDoor: false },
|
|
83
86
|
];
|
|
84
87
|
export function runDeliveryChecks(context, gate) {
|
|
@@ -116,6 +119,8 @@ export function renderDeliveryLimits() {
|
|
|
116
119
|
["Cover image", `${COVER_WIDTH} by ${COVER_HEIGHT} pixels`, "`marketplace/cover.png`, exactly"],
|
|
117
120
|
["Docs pages", `${MAX_DOC_PAGES} pages`, "listed in the manifest's `docs`"],
|
|
118
121
|
["One docs page", formatBinarySize(MAX_DOC_PAGE_BYTES), "each page other than `README.md`"],
|
|
122
|
+
["One template file", formatBinarySize(MAX_TEMPLATE_CONTENT_BYTES), "each declared file under `templates/`: a site's default limit, which the site may raise"],
|
|
123
|
+
["One asset", formatBinarySize(MAX_ASSET_CONTENT_BYTES), "each declared asset under `public/`: a site's default limit, which the site may raise"],
|
|
119
124
|
["One locale file", formatBinarySize(PLUGIN_LOCALE_MAX_BYTES), "each `locales/<language>.json`"],
|
|
120
125
|
["Keys in a locale file", `${PLUGIN_LOCALE_MAX_KEYS} keys`, "each `locales/<language>.json`"],
|
|
121
126
|
["A locale key", `${PLUGIN_LOCALE_KEY_MAX_LENGTH} characters`, "letters, digits, `_` and `-`, in segments joined by dots"],
|
|
@@ -4,3 +4,4 @@ export declare const templateFilesCheck: DeliveryCheck;
|
|
|
4
4
|
export declare const templateWiringCheck: DeliveryCheck;
|
|
5
5
|
export declare const assetsCheck: DeliveryCheck;
|
|
6
6
|
export declare const entryBudgetCheck: DeliveryCheck;
|
|
7
|
+
export declare const payloadSizesCheck: DeliveryCheck;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { lstatSync } from "node:fs";
|
|
1
2
|
import { join } from "node:path";
|
|
2
|
-
import { MAX_TEMPLATE_PAYLOAD_ENTRIES, PluginAssetPathSchema, PluginTemplateFileSchema, PluginTemplatePayloadSchema, RESERVED_ASSET_ROOTS, TEMPLATE_KINDS, checkTemplateAndAssetDeclarations, effectiveDocsPages, listIssues, } from "@kardalum/api-schemas";
|
|
3
|
+
import { MAX_ASSET_CONTENT_BYTES, MAX_TEMPLATE_CONTENT_BYTES, MAX_TEMPLATE_PAYLOAD_ENTRIES, PluginAssetPathSchema, PluginTemplateFileSchema, PluginTemplatePayloadSchema, RESERVED_ASSET_ROOTS, TEMPLATE_KINDS, checkTemplateAndAssetDeclarations, effectiveDocsPages, isAssetTextPath, listIssues, } from "@kardalum/api-schemas";
|
|
3
4
|
import { docsFilesToShip } from "../docs-contract.js";
|
|
4
5
|
import { createShippedLookup, walkShipped } from "../shipped-files.js";
|
|
6
|
+
import { formatBinarySize } from "./limits.js";
|
|
5
7
|
import { contributionsOf, failed, list, orList, passed, plural, record } from "./support.js";
|
|
6
8
|
// S196 and S268: any plugin may declare templates and assets, whatever its
|
|
7
9
|
// listing label. Each check here asks its own question of the declaration and
|
|
@@ -156,3 +158,58 @@ export const entryBudgetCheck = {
|
|
|
156
158
|
return passed(message);
|
|
157
159
|
},
|
|
158
160
|
};
|
|
161
|
+
/** A regular file's size, or null for anything else (a missing file is the files checks' to report). */
|
|
162
|
+
function fileSize(path) {
|
|
163
|
+
try {
|
|
164
|
+
const stat = lstatSync(path, { throwIfNoEntry: false });
|
|
165
|
+
return stat?.isFile() ? stat.size : null;
|
|
166
|
+
}
|
|
167
|
+
catch {
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
// S314c3 (D10): a site holds a template to KARDALUM_MAX_TEMPLATE_BYTES and an asset to
|
|
172
|
+
// KARDALUM_MAX_ASSET_BYTES, and an install refuses a package with a larger file whole (D9). A build
|
|
173
|
+
// cannot know the site, so it holds the package to the defaults, and a package that passes installs
|
|
174
|
+
// on any site left at them.
|
|
175
|
+
export const payloadSizesCheck = {
|
|
176
|
+
name: "template and asset sizes",
|
|
177
|
+
rule: `Every declared template file is at most ${formatBinarySize(MAX_TEMPLATE_CONTENT_BYTES)}, and every declared asset and every text file under \`public/\` at most ${formatBinarySize(MAX_ASSET_CONTENT_BYTES)}: ` +
|
|
178
|
+
"the defaults of a site's own limits (`KARDALUM_MAX_TEMPLATE_BYTES`, `KARDALUM_MAX_ASSET_BYTES`), so the package installs on any site left at them.",
|
|
179
|
+
gates: ["cli", "door"],
|
|
180
|
+
needsManifest: true,
|
|
181
|
+
run: ({ dir, manifest }) => {
|
|
182
|
+
const c = contributionsOf(manifest);
|
|
183
|
+
const templates = list(c.templates).flatMap((raw) => {
|
|
184
|
+
const file = record(raw)?.file;
|
|
185
|
+
// An unusable path is reported by `template declarations valid`; never join it.
|
|
186
|
+
return typeof file === "string" && PluginTemplateFileSchema.safeParse(file).success ? [file] : [];
|
|
187
|
+
});
|
|
188
|
+
const assets = list(c.assets).filter((a) => typeof a === "string" && PluginAssetPathSchema.safeParse(a).success);
|
|
189
|
+
// The install also holds an undeclared text file under public/ to the asset limit (it lands as
|
|
190
|
+
// a plain file the asset editor opens), so the build does too, from the same extension list.
|
|
191
|
+
const declared = new Set(assets);
|
|
192
|
+
const undeclaredText = walkShipped(join(dir, "public")).filter((e) => !e.isDirectory && !declared.has(e.path) && isAssetTextPath(e.path)).map((e) => e.path);
|
|
193
|
+
if (templates.length === 0 && assets.length === 0 && undeclaredText.length === 0)
|
|
194
|
+
return passed("no templates or assets declared");
|
|
195
|
+
const problems = [];
|
|
196
|
+
for (const file of templates) {
|
|
197
|
+
const size = fileSize(join(dir, "templates", ...file.split("/")));
|
|
198
|
+
if (size !== null && size > MAX_TEMPLATE_CONTENT_BYTES)
|
|
199
|
+
problems.push(`${file}: ${size} bytes, over the ${formatBinarySize(MAX_TEMPLATE_CONTENT_BYTES)} a template may hold`);
|
|
200
|
+
}
|
|
201
|
+
for (const path of assets) {
|
|
202
|
+
const size = fileSize(join(dir, "public", ...path.split("/")));
|
|
203
|
+
if (size !== null && size > MAX_ASSET_CONTENT_BYTES)
|
|
204
|
+
problems.push(`${path}: ${size} bytes, over the ${formatBinarySize(MAX_ASSET_CONTENT_BYTES)} an asset may hold`);
|
|
205
|
+
}
|
|
206
|
+
for (const path of undeclaredText) {
|
|
207
|
+
const size = fileSize(join(dir, "public", ...path.split("/")));
|
|
208
|
+
if (size !== null && size > MAX_ASSET_CONTENT_BYTES)
|
|
209
|
+
problems.push(`${path}: ${size} bytes, over the ${formatBinarySize(MAX_ASSET_CONTENT_BYTES)} an asset may hold`);
|
|
210
|
+
}
|
|
211
|
+
if (problems.length > 0)
|
|
212
|
+
return failed(`${plural(problems.length, "file")} over the size a site holds by default`, problems);
|
|
213
|
+
return passed(`${plural(templates.length, "template")}, ${plural(assets.length, "asset")}: within the default limits`);
|
|
214
|
+
},
|
|
215
|
+
};
|
|
@@ -5,7 +5,7 @@ export declare function generateSigningKeyPair(): {
|
|
|
5
5
|
publicKey: string;
|
|
6
6
|
keyId: string;
|
|
7
7
|
};
|
|
8
|
-
/** Deterministic serialization. Deliberately NOT full JCS
|
|
8
|
+
/** Deterministic serialization. Deliberately NOT full JCS, since we own both
|
|
9
9
|
* ends, and a fixed-order literal is the entire requirement. */
|
|
10
10
|
export declare function canonicalizeEnvelope(envelope: SignatureEnvelope): Buffer;
|
|
11
11
|
export declare function signEnvelope(envelope: SignatureEnvelope, privateKeyBase64: string): string;
|
|
@@ -13,7 +13,7 @@ export declare function signEnvelope(envelope: SignatureEnvelope, privateKeyBase
|
|
|
13
13
|
* Check order is deliberate and produces better diagnostics than the
|
|
14
14
|
* reverse: authenticate the envelope FIRST (bad-signature = forged or
|
|
15
15
|
* corrupt), then compare it to the artifact we actually have
|
|
16
|
-
* (hash-mismatch = authentic envelope, tampered bytes
|
|
16
|
+
* (hash-mismatch = authentic envelope, tampered bytes: the flipped-byte
|
|
17
17
|
* case). Never throws.
|
|
18
18
|
*/
|
|
19
19
|
export declare function verifyEnvelope(sidecar: unknown, tarballSha256: string, trustedKeys: TrustedKey[]): VerifyResult;
|
|
@@ -20,7 +20,7 @@ export function generateSigningKeyPair() {
|
|
|
20
20
|
const publicKey = pair.publicKey.export({ format: "der", type: "spki" }).toString("base64");
|
|
21
21
|
return { privateKey, publicKey, keyId: deriveKeyId(publicKey) };
|
|
22
22
|
}
|
|
23
|
-
/** Deterministic serialization. Deliberately NOT full JCS
|
|
23
|
+
/** Deterministic serialization. Deliberately NOT full JCS, since we own both
|
|
24
24
|
* ends, and a fixed-order literal is the entire requirement. */
|
|
25
25
|
export function canonicalizeEnvelope(envelope) {
|
|
26
26
|
return Buffer.from(JSON.stringify({
|
|
@@ -60,7 +60,7 @@ function isSidecar(value) {
|
|
|
60
60
|
* Check order is deliberate and produces better diagnostics than the
|
|
61
61
|
* reverse: authenticate the envelope FIRST (bad-signature = forged or
|
|
62
62
|
* corrupt), then compare it to the artifact we actually have
|
|
63
|
-
* (hash-mismatch = authentic envelope, tampered bytes
|
|
63
|
+
* (hash-mismatch = authentic envelope, tampered bytes: the flipped-byte
|
|
64
64
|
* case). Never throws.
|
|
65
65
|
*/
|
|
66
66
|
export function verifyEnvelope(sidecar, tarballSha256, trustedKeys) {
|
|
@@ -14,7 +14,7 @@ export declare const ENTRY_NAME_MAX = 260;
|
|
|
14
14
|
/** The most segments, folders and a file, one name may have. */
|
|
15
15
|
export declare const ENTRY_SEGMENTS_MAX = 32;
|
|
16
16
|
/** Pure gate over one entry's (path, type, declaredSize). Returns the
|
|
17
|
-
* violation message or null. Exported for direct unit testing
|
|
17
|
+
* violation message or null. Exported for direct unit testing: a
|
|
18
18
|
* well-formed writer can't produce hostile names, but attackers hand-craft
|
|
19
19
|
* archives directly. The path rules are nameViolation's: what a Linux
|
|
20
20
|
* extraction and a Windows or macOS one would read as different files is
|
|
@@ -24,7 +24,7 @@ export declare const ENTRY_SEGMENTS_MAX = 32;
|
|
|
24
24
|
* "OldFile" and "ContiguousFile" are accepted alongside "File" for
|
|
25
25
|
* historical (tar-era) compatibility with entries this gate has always
|
|
26
26
|
* allowed; the ZIP reader below only ever derives "File" or "Directory"
|
|
27
|
-
* for an entry, so those two never occur in practice post-migration
|
|
27
|
+
* for an entry, so those two never occur in practice post-migration: the
|
|
28
28
|
* allow-list simply isn't narrowed, since narrowing it wouldn't change zip
|
|
29
29
|
* behavior and would only risk breaking direct callers of this exported
|
|
30
30
|
* function. */
|
|
@@ -114,7 +114,7 @@ export declare function plannedEntryRefusal(entries: readonly PlannedEntry[]): s
|
|
|
114
114
|
* written to disk incrementally as the archive streams in, so anything
|
|
115
115
|
* admitted before the violation was detected is already sitting under
|
|
116
116
|
* `targetDir`. Callers MUST treat `{ ok: false }` as fatal and delete
|
|
117
|
-
* `targetDir` themselves
|
|
117
|
+
* `targetDir` themselves. This function does not roll back a partial
|
|
118
118
|
* extraction.
|
|
119
119
|
*/
|
|
120
120
|
export declare function extractArtifact(archivePath: string, targetDir: string): Promise<{
|