@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.
Files changed (247) hide show
  1. package/CHANGELOG.md +109 -0
  2. package/README.md +4 -3
  3. package/dist/assets/asset-picker.d.ts +11 -0
  4. package/dist/assets/asset-picker.js +109 -0
  5. package/dist/assets/asset-tree.d.ts +30 -0
  6. package/dist/assets/asset-tree.js +150 -0
  7. package/dist/built-in-editor-ids.d.ts +1 -0
  8. package/dist/built-in-editor-ids.js +20 -0
  9. package/dist/built-in-serializers.js +1 -1
  10. package/dist/built-in-settings-schemas.d.ts +2 -0
  11. package/dist/built-in-settings-schemas.js +31 -4
  12. package/dist/built-in-value-schemas.js +3 -0
  13. package/dist/built-ins.js +20 -11
  14. package/dist/capabilities.js +5 -0
  15. package/dist/data-type-plugin.d.ts +2 -2
  16. package/dist/datatype-validation.d.ts +2 -2
  17. package/dist/datatype-validation.js +20 -6
  18. package/dist/datatypes-entry.d.ts +1 -0
  19. package/dist/datatypes-entry.js +1 -0
  20. package/dist/define-plugin.d.ts +4 -4
  21. package/dist/define-plugin.js +5 -5
  22. package/dist/entitlement-entry.d.ts +3 -2
  23. package/dist/entitlement-entry.js +13 -1
  24. package/dist/entitlement-gate.d.ts +18 -0
  25. package/dist/entitlement-gate.js +95 -21
  26. package/dist/entitlement-plan.d.ts +21 -0
  27. package/dist/entitlement-plan.js +26 -0
  28. package/dist/entitlement-types.d.ts +21 -4
  29. package/dist/entitlement.d.ts +29 -1
  30. package/dist/entitlement.js +39 -0
  31. package/dist/grid-arrow-step.d.ts +7 -0
  32. package/dist/grid-arrow-step.js +20 -0
  33. package/dist/index.d.ts +8 -1
  34. package/dist/index.js +11 -12
  35. package/dist/manifest-entry.d.ts +4 -0
  36. package/dist/manifest-entry.js +4 -0
  37. package/dist/manifest-schema.d.ts +5 -1
  38. package/dist/manifest-schema.js +14 -2
  39. package/dist/manifest.d.ts +21 -1
  40. package/dist/media/media-picker.js +34 -34
  41. package/dist/notify.d.ts +17 -0
  42. package/dist/notify.js +17 -0
  43. package/dist/plugin-context.js +3 -3
  44. package/dist/register-built-ins.js +6 -6
  45. package/dist/registry.js +1 -1
  46. package/dist/richtext/block-panel.js +19 -20
  47. package/dist/richtext/extensions.js +17 -8
  48. package/dist/richtext/insert-menu.js +4 -4
  49. package/dist/richtext/kardalum-block.js +17 -17
  50. package/dist/richtext/style-listbox.js +2 -2
  51. package/dist/richtext/text-style-class.js +1 -1
  52. package/dist/richtext-html-entry.d.ts +35 -0
  53. package/dist/richtext-html-entry.js +73 -0
  54. package/dist/simple-storage-value-provider.js +3 -3
  55. package/dist/structured-storage-types.d.ts +12 -1
  56. package/dist/structured-storage-types.js +2 -2
  57. package/dist/tailwind.js +10 -3
  58. package/dist/tokens/tailwind-theme.css +176 -0
  59. package/dist/tokens/tokens.css +1 -0
  60. package/dist/tokens/tokens.json +2 -1
  61. package/dist/ui-entry.js +3 -3
  62. package/dist/vendor-check.d.ts +39 -0
  63. package/dist/vendor-check.js +79 -0
  64. package/dist/vendor-entry.d.ts +3 -0
  65. package/dist/vendor-entry.js +9 -0
  66. package/dist/vendor-service.d.ts +20 -0
  67. package/dist/vendor-service.js +20 -0
  68. package/dist/views/asset-view.d.ts +6 -0
  69. package/dist/views/asset-view.js +55 -0
  70. package/dist/views/content-list-settings-view.js +1 -1
  71. package/dist/views/content-list-view.js +1 -1
  72. package/dist/views/date-range-view.js +5 -5
  73. package/dist/views/html-code-editor.js +2 -3
  74. package/dist/views/html-view.js +7 -7
  75. package/dist/views/image-view.js +5 -5
  76. package/dist/views/rich-text-view.js +33 -32
  77. package/node_modules/@kardalum/api-schemas/README.md +1 -1
  78. package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +1 -1
  79. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +17 -15
  80. package/node_modules/@kardalum/api-schemas/dist/asset-field.schema.d.ts +21 -0
  81. package/node_modules/@kardalum/api-schemas/dist/asset-field.schema.js +42 -0
  82. package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +1 -0
  83. package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +10 -3
  84. package/node_modules/@kardalum/api-schemas/dist/auth.schema.js +1 -1
  85. package/node_modules/@kardalum/api-schemas/dist/checkout-shown.schema.d.ts +36 -0
  86. package/node_modules/@kardalum/api-schemas/dist/checkout-shown.schema.js +46 -0
  87. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +13 -0
  88. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +30 -9
  89. package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +3 -3
  90. package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +1 -1
  91. package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +12 -6
  92. package/node_modules/@kardalum/api-schemas/dist/core-actions.js +11 -6
  93. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +50 -0
  94. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +26 -6
  95. package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.d.ts +1 -0
  96. package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +6 -3
  97. package/node_modules/@kardalum/api-schemas/dist/data-type-cursor.d.ts +11 -0
  98. package/node_modules/@kardalum/api-schemas/dist/data-type-cursor.js +28 -0
  99. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +90 -0
  100. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +56 -6
  101. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +8 -8
  102. package/node_modules/@kardalum/api-schemas/dist/home.schema.d.ts +130 -0
  103. package/node_modules/@kardalum/api-schemas/dist/home.schema.js +87 -0
  104. package/node_modules/@kardalum/api-schemas/dist/index.d.ts +48 -19
  105. package/node_modules/@kardalum/api-schemas/dist/index.js +34 -12
  106. package/node_modules/@kardalum/api-schemas/dist/kardalum-latest.schema.d.ts +7 -0
  107. package/node_modules/@kardalum/api-schemas/dist/kardalum-latest.schema.js +9 -0
  108. package/node_modules/@kardalum/api-schemas/dist/listing-categories.schema.d.ts +46 -0
  109. package/node_modules/@kardalum/api-schemas/dist/listing-categories.schema.js +52 -0
  110. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +162 -1
  111. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +144 -9
  112. package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.d.ts +17 -0
  113. package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.js +16 -0
  114. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +26 -0
  115. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +15 -9
  116. package/node_modules/@kardalum/api-schemas/dist/media-reference-use.d.ts +10 -0
  117. package/node_modules/@kardalum/api-schemas/dist/media-reference-use.js +4 -4
  118. package/node_modules/@kardalum/api-schemas/dist/media.schema.js +5 -5
  119. package/node_modules/@kardalum/api-schemas/dist/news.schema.d.ts +93 -0
  120. package/node_modules/@kardalum/api-schemas/dist/news.schema.js +86 -0
  121. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +13 -0
  122. package/node_modules/@kardalum/api-schemas/dist/notification.schema.d.ts +410 -0
  123. package/node_modules/@kardalum/api-schemas/dist/notification.schema.js +193 -0
  124. package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.d.ts +86 -0
  125. package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.js +92 -0
  126. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +7 -2
  127. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +7 -0
  128. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.js +1 -0
  129. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +251 -0
  130. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +196 -31
  131. package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.d.ts +19 -0
  132. package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.js +33 -0
  133. package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +1 -1
  134. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +3 -3
  135. package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.d.ts +10 -1
  136. package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.js +24 -4
  137. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +5 -0
  138. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +23 -20
  139. package/node_modules/@kardalum/api-schemas/dist/render-editing.js +4 -4
  140. package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.js +1 -1
  141. package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.d.ts +83 -0
  142. package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +73 -0
  143. package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.d.ts +207 -0
  144. package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +147 -0
  145. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +11 -0
  146. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +17 -8
  147. package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +14 -0
  148. package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +7 -0
  149. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +3 -3
  150. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
  151. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.js +1 -1
  152. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +10 -0
  153. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +27 -12
  154. package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +7 -0
  155. package/node_modules/@kardalum/api-schemas/dist/template.schema.js +22 -10
  156. package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.d.ts +1 -1
  157. package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.js +1 -1
  158. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +12 -0
  159. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +6 -1
  160. package/node_modules/@kardalum/api-schemas/dist/uuid.schema.d.ts +2 -0
  161. package/node_modules/@kardalum/api-schemas/dist/uuid.schema.js +4 -0
  162. package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.d.ts +88 -0
  163. package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.js +100 -0
  164. package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.d.ts +13 -0
  165. package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.js +5 -0
  166. package/node_modules/@kardalum/design-tokens/README.md +1 -1
  167. package/node_modules/@kardalum/design-tokens/dist/build-css.d.ts +1 -1
  168. package/node_modules/@kardalum/design-tokens/dist/build-css.js +2 -2
  169. package/node_modules/@kardalum/design-tokens/dist/build-theme-css.d.ts +16 -0
  170. package/node_modules/@kardalum/design-tokens/dist/build-theme-css.js +76 -0
  171. package/node_modules/@kardalum/design-tokens/dist/generate.js +4 -1
  172. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +176 -0
  173. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -1
  174. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +3 -3
  175. package/node_modules/@kardalum/design-tokens/dist/theme-css.d.ts +2 -2
  176. package/node_modules/@kardalum/design-tokens/dist/theme-css.js +2 -2
  177. package/node_modules/@kardalum/design-tokens/dist/theme-types.d.ts +2 -2
  178. package/node_modules/@kardalum/design-tokens/dist/themes/dark.d.ts +3 -3
  179. package/node_modules/@kardalum/design-tokens/dist/themes/dark.js +3 -3
  180. package/node_modules/@kardalum/design-tokens/dist/themes/light.d.ts +1 -1
  181. package/node_modules/@kardalum/design-tokens/dist/themes/light.js +1 -1
  182. package/node_modules/@kardalum/design-tokens/dist/tokens.css +1 -0
  183. package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +3 -3
  184. package/node_modules/@kardalum/design-tokens/dist/tokens.js +6 -5
  185. package/node_modules/@kardalum/design-tokens/dist/tokens.json +2 -1
  186. package/node_modules/@kardalum/design-tokens/dist/types.d.ts +2 -1
  187. package/node_modules/@kardalum/design-tokens/dist/types.js +1 -1
  188. package/node_modules/@kardalum/design-tokens/package.json +6 -3
  189. package/node_modules/@kardalum/plugin-package/README.md +1 -1
  190. package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +4 -4
  191. package/node_modules/@kardalum/plugin-package/dist/capabilities.js +54 -6
  192. package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.js +1 -1
  193. package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.d.ts +3 -0
  194. package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +18 -1
  195. package/node_modules/@kardalum/plugin-package/dist/delivery/limits.d.ts +1 -1
  196. package/node_modules/@kardalum/plugin-package/dist/delivery/limits.js +1 -1
  197. package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +9 -4
  198. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +1 -0
  199. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +58 -1
  200. package/node_modules/@kardalum/plugin-package/dist/envelope.d.ts +2 -2
  201. package/node_modules/@kardalum/plugin-package/dist/envelope.js +2 -2
  202. package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +3 -3
  203. package/node_modules/@kardalum/plugin-package/dist/extract.js +10 -10
  204. package/node_modules/@kardalum/plugin-package/dist/hash.d.ts +1 -1
  205. package/node_modules/@kardalum/plugin-package/dist/hash.js +1 -1
  206. package/node_modules/@kardalum/plugin-package/dist/index.d.ts +4 -2
  207. package/node_modules/@kardalum/plugin-package/dist/index.js +3 -1
  208. package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +56 -19
  209. package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +119 -25
  210. package/node_modules/@kardalum/plugin-package/dist/package-contract.d.ts +2 -2
  211. package/node_modules/@kardalum/plugin-package/dist/package-contract.js +5 -5
  212. package/node_modules/@kardalum/plugin-package/dist/types.d.ts +1 -1
  213. package/node_modules/@kardalum/plugin-package/dist/vendor-token.d.ts +24 -0
  214. package/node_modules/@kardalum/plugin-package/dist/vendor-token.js +118 -0
  215. package/node_modules/@kardalum/ui/README.md +1 -1
  216. package/node_modules/@kardalum/ui/dist/components/alert-dialog.d.ts +1 -1
  217. package/node_modules/@kardalum/ui/dist/components/alert-dialog.js +8 -3
  218. package/node_modules/@kardalum/ui/dist/components/badge.js +1 -1
  219. package/node_modules/@kardalum/ui/dist/components/button.js +2 -2
  220. package/node_modules/@kardalum/ui/dist/components/checkbox.js +1 -1
  221. package/node_modules/@kardalum/ui/dist/components/dialog.d.ts +1 -1
  222. package/node_modules/@kardalum/ui/dist/components/dialog.js +52 -4
  223. package/node_modules/@kardalum/ui/dist/components/dropdown-menu.d.ts +5 -1
  224. package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +20 -7
  225. package/node_modules/@kardalum/ui/dist/components/empty-state.d.ts +4 -4
  226. package/node_modules/@kardalum/ui/dist/components/input.js +6 -1
  227. package/node_modules/@kardalum/ui/dist/components/popover-panel.d.ts +4 -0
  228. package/node_modules/@kardalum/ui/dist/components/popover-panel.js +13 -0
  229. package/node_modules/@kardalum/ui/dist/components/property-field.js +3 -3
  230. package/node_modules/@kardalum/ui/dist/components/sheet.d.ts +1 -1
  231. package/node_modules/@kardalum/ui/dist/components/sheet.js +15 -9
  232. package/node_modules/@kardalum/ui/dist/components/skeleton.js +1 -1
  233. package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
  234. package/node_modules/@kardalum/ui/dist/components/tab-strip.d.ts +3 -3
  235. package/node_modules/@kardalum/ui/dist/components/tab-strip.js +1 -1
  236. package/node_modules/@kardalum/ui/dist/components/toast.js +4 -3
  237. package/node_modules/@kardalum/ui/dist/components/tooltip.d.ts +27 -0
  238. package/node_modules/@kardalum/ui/dist/components/tooltip.js +82 -0
  239. package/node_modules/@kardalum/ui/dist/components/truncated-text.d.ts +11 -0
  240. package/node_modules/@kardalum/ui/dist/components/truncated-text.js +94 -0
  241. package/node_modules/@kardalum/ui/dist/components/use-toast.js +2 -2
  242. package/node_modules/@kardalum/ui/dist/index.d.ts +4 -1
  243. package/node_modules/@kardalum/ui/dist/index.js +4 -1
  244. package/node_modules/@kardalum/ui/dist/lib/menu-host.d.ts +5 -0
  245. package/node_modules/@kardalum/ui/dist/lib/menu-host.js +17 -0
  246. package/node_modules/@kardalum/ui/package.json +8 -6
  247. package/package.json +21 -7
@@ -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
+ }
@@ -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;
@@ -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",
package/dist/ui-entry.js CHANGED
@@ -1,11 +1,11 @@
1
1
  // The `@kardalum/plugin-sdk/ui` subpath: the shared UI primitives (all of
2
2
  // @kardalum/ui, since R3) + the plugin-context
3
3
  // hooks/providers, with none of the package index's richtext (TipTap)
4
- // exports — same "no weight a consumer didn't ask for" boundary
4
+ // exports, with the same "no weight a consumer didn't ask for" boundary
5
5
  // `./manifest` and `./datatypes` already draw, just for the UI-primitives
6
6
  // half of the SDK surface.
7
7
  //
8
- // DO NOT import this from a federated plugin's own view code — a
8
+ // DO NOT import this from a federated plugin's own view code: a
9
9
  // datatype/section/etc. plugin remote whose views run inside the admin
10
10
  // host. S197 final-review fix F5 tried exactly that (google-maps'
11
11
  // location-view.tsx) and it was a Critical regression, caught by the
@@ -31,7 +31,7 @@
31
31
  // script, a test harness, tooling that renders SDK UI outside the Module
32
32
  // Federation runtime entirely) where there is no host singleton to miss in
33
33
  // the first place. If you're not sure which category you're in, you're
34
- // almost certainly writing a plugin view — use the bare package index.
34
+ // almost certainly writing a plugin view, so use the bare package index.
35
35
  export { PluginValueProvider, PluginSettingsProvider, PluginApiProvider, usePluginValue, usePluginSettings, usePluginSettingsValue, usePluginApi, } from "./plugin-context.js";
36
36
  export { SimpleStorageValueProvider } from "./simple-storage-value-provider.js";
37
37
  export { EntitlementGate, useEntitlement, } from "./entitlement-gate.js";
@@ -0,0 +1,39 @@
1
+ import { type TrustedKey } from "@kardalum/plugin-package";
2
+ import { type VendorTokenPayload } from "@kardalum/api-schemas";
3
+ export declare const VENDOR_AUTH_SCHEME = "Kardalum-Vendor";
4
+ export type VendorLicenceReason = "missing" | "malformed" | "bad_signature" | "wrong_plugin" | "wrong_audience" | "expired" | "not_live";
5
+ export interface VendorLicence {
6
+ ok: true;
7
+ live: boolean;
8
+ plan: VendorTokenPayload["plan"];
9
+ term: VendorTokenPayload["term"];
10
+ domain: string;
11
+ jti: string;
12
+ }
13
+ export type VendorLicenceAnswer = VendorLicence | {
14
+ ok: false;
15
+ reason: VendorLicenceReason;
16
+ };
17
+ export declare class VendorLicenceError extends Error {
18
+ readonly reason: VendorLicenceReason;
19
+ /** 402 for a licence that is not live (renew to continue), 401 otherwise. */
20
+ readonly status: 401 | 402;
21
+ constructor(reason: VendorLicenceReason);
22
+ }
23
+ export declare function isVendorLicenceError(value: unknown): value is VendorLicenceError;
24
+ export interface VendorLicenceCheckOptions {
25
+ pluginId: string;
26
+ /** This server's own origin, exactly as the manifest declares it. */
27
+ origin: string;
28
+ /** Defaults to LICENSE_VERDICT_PUBLIC_KEYS; tests pass their own. */
29
+ trustedKeys?: TrustedKey[];
30
+ now?: () => Date;
31
+ /** Clock leeway for the expiry check, 0 to 60 seconds (default 60). It may
32
+ * only be narrowed: a wider window would stretch the 5-minute token. */
33
+ leewaySeconds?: number;
34
+ }
35
+ export interface VendorLicenceCheck {
36
+ check(header: unknown): VendorLicenceAnswer;
37
+ requireLive(header: unknown): VendorLicence;
38
+ }
39
+ export declare function createVendorLicenceCheck(options: VendorLicenceCheckOptions): VendorLicenceCheck;
@@ -0,0 +1,79 @@
1
+ import { VENDOR_TOKEN_LEEWAY_SECONDS, verifyVendorToken } from "@kardalum/plugin-package";
2
+ import { isPluginManifestId, parseVendorServiceOrigin } from "@kardalum/api-schemas";
3
+ import { LICENSE_VERDICT_PUBLIC_KEYS } from "./license-verdict-keys.js";
4
+ // S320 (spec 3e): the author's server's check of the token the CMS sends.
5
+ // Offline: the marketplace's public key and the clock, no network call.
6
+ export const VENDOR_AUTH_SCHEME = "Kardalum-Vendor";
7
+ const REASONS = ["missing", "malformed", "bad_signature", "wrong_plugin", "wrong_audience", "expired", "not_live"];
8
+ export class VendorLicenceError extends Error {
9
+ reason;
10
+ /** 402 for a licence that is not live (renew to continue), 401 otherwise. */
11
+ status;
12
+ constructor(reason) {
13
+ super(reason === "not_live" ? "The licence term has lapsed: renew to continue." : `The vendor licence token was refused: ${reason}.`);
14
+ this.name = "VendorLicenceError";
15
+ this.reason = reason;
16
+ this.status = reason === "not_live" ? 402 : 401;
17
+ }
18
+ }
19
+ export function isVendorLicenceError(value) {
20
+ if (!(value instanceof Error) || value.name !== "VendorLicenceError")
21
+ return false;
22
+ const reason = value.reason;
23
+ return typeof reason === "string" && REASONS.includes(reason);
24
+ }
25
+ /** The token from an Authorization header value, by a linear read: the
26
+ * scheme, one space, the rest. */
27
+ function tokenFrom(header) {
28
+ if (header === undefined || header === null || header === "")
29
+ return { reason: "missing" };
30
+ if (typeof header !== "string")
31
+ return { reason: "malformed" };
32
+ const space = header.indexOf(" ");
33
+ if (space === -1 || header.slice(0, space).toLowerCase() !== VENDOR_AUTH_SCHEME.toLowerCase())
34
+ return { reason: "malformed" };
35
+ const token = header.slice(space + 1).trim();
36
+ return token === "" ? { reason: "missing" } : { token };
37
+ }
38
+ export function createVendorLicenceCheck(options) {
39
+ const parsed = parseVendorServiceOrigin(options.origin, { allowLocalHttp: true });
40
+ if (!parsed.ok)
41
+ throw new RangeError(`createVendorLicenceCheck: origin ${parsed.reason}`);
42
+ const audience = parsed.origin;
43
+ // The id is compared exactly with the token's, so a typo or an upper-case
44
+ // letter would refuse every call as wrong_plugin; refuse it here instead.
45
+ if (typeof options.pluginId !== "string" || !isPluginManifestId(options.pluginId)) {
46
+ throw new RangeError("createVendorLicenceCheck: pluginId must be the plugin's manifest id (lower-case reverse domain, at most 128 characters)");
47
+ }
48
+ const trustedKeys = options.trustedKeys ?? LICENSE_VERDICT_PUBLIC_KEYS;
49
+ const now = options.now ?? (() => new Date());
50
+ const leewaySeconds = options.leewaySeconds ?? VENDOR_TOKEN_LEEWAY_SECONDS;
51
+ if (!Number.isFinite(leewaySeconds) || leewaySeconds < 0 || leewaySeconds > VENDOR_TOKEN_LEEWAY_SECONDS) {
52
+ throw new RangeError(`createVendorLicenceCheck: leewaySeconds must be between 0 and ${VENDOR_TOKEN_LEEWAY_SECONDS}`);
53
+ }
54
+ function check(header) {
55
+ const read = tokenFrom(header);
56
+ if ("reason" in read)
57
+ return { ok: false, reason: read.reason };
58
+ const verified = verifyVendorToken(read.token, trustedKeys, { now: now(), leewaySeconds });
59
+ if (!verified.ok)
60
+ return { ok: false, reason: verified.reason };
61
+ const p = verified.payload;
62
+ if (p.pluginId !== options.pluginId)
63
+ return { ok: false, reason: "wrong_plugin" };
64
+ if (p.aud !== audience)
65
+ return { ok: false, reason: "wrong_audience" };
66
+ return { ok: true, live: p.live, plan: p.plan, term: p.term, domain: p.domain, jti: p.jti };
67
+ }
68
+ return {
69
+ check,
70
+ requireLive(header) {
71
+ const answer = check(header);
72
+ if (!answer.ok)
73
+ throw new VendorLicenceError(answer.reason);
74
+ if (!answer.live)
75
+ throw new VendorLicenceError("not_live");
76
+ return answer;
77
+ },
78
+ };
79
+ }
@@ -0,0 +1,3 @@
1
+ export { VENDOR_AUTH_SCHEME, VendorLicenceError, createVendorLicenceCheck, isVendorLicenceError, type VendorLicence, type VendorLicenceAnswer, type VendorLicenceCheck, type VendorLicenceCheckOptions, type VendorLicenceReason, } from "./vendor-check.js";
2
+ export { LICENSE_VERDICT_PUBLIC_KEYS } from "./license-verdict-keys.js";
3
+ export type { TrustedKey } from "@kardalum/plugin-package";
@@ -0,0 +1,9 @@
1
+ // The `@kardalum/plugin-sdk/vendor` subpath (S320, spec 3e): for the AUTHOR'S
2
+ // server, any Node server. It verifies through @kardalum/plugin-package and so
3
+ // node:crypto, which is why it is not on the browser index.
4
+ //
5
+ // const licence = createVendorLicenceCheck({ pluginId: "com.acme.reports", origin: "https://api.acme.com" });
6
+ // const answer = licence.check(request.headers.authorization);
7
+ // licence.requireLive(request.headers.authorization); // throws VendorLicenceError (status 401 or 402)
8
+ export { VENDOR_AUTH_SCHEME, VendorLicenceError, createVendorLicenceCheck, isVendorLicenceError, } from "./vendor-check.js";
9
+ export { LICENSE_VERDICT_PUBLIC_KEYS } from "./license-verdict-keys.js";
@@ -0,0 +1,20 @@
1
+ export declare const VENDOR_SERVICE_ERROR_CODES: readonly ["token_unavailable", "bad_path", "insecure_origin", "timeout", "unreachable", "response_too_large"];
2
+ export type VendorServiceErrorCode = (typeof VENDOR_SERVICE_ERROR_CODES)[number];
3
+ export declare class VendorServiceError extends Error {
4
+ readonly code: VendorServiceErrorCode;
5
+ constructor(code: VendorServiceErrorCode, message: string);
6
+ }
7
+ /** True for a VendorServiceError from ANY copy of this SDK (a plugin bundles its own). */
8
+ export declare function isVendorServiceError(value: unknown): value is VendorServiceError;
9
+ /** `fetch`'s options, plus a lower timeout or size cap than the host's (15 s, 10 MiB). */
10
+ export type VendorServiceRequestInit = RequestInit & {
11
+ timeoutMs?: number;
12
+ maxBytes?: number;
13
+ };
14
+ export interface PluginVendorService {
15
+ /** Calls the declared origin plus `path` (which starts with "/"). Redirects
16
+ * are not followed. Throws VendorServiceError: `token_unavailable` when the
17
+ * marketplace gave no token (the call was not made), `bad_path`,
18
+ * `insecure_origin`, `timeout`, `unreachable`, `response_too_large`. */
19
+ fetch(path: string, init?: VendorServiceRequestInit): Promise<Response>;
20
+ }
@@ -0,0 +1,20 @@
1
+ // S320 (spec 3d): `context.vendorService`, which the host hands a plugin whose
2
+ // manifest declares `vendorService`, in its API routes and hooks. The host
3
+ // sends the declared origin a 5-minute licence token, never the key, and
4
+ // refuses to send anywhere else.
5
+ export const VENDOR_SERVICE_ERROR_CODES = ["token_unavailable", "bad_path", "insecure_origin", "timeout", "unreachable", "response_too_large"];
6
+ export class VendorServiceError extends Error {
7
+ code;
8
+ constructor(code, message) {
9
+ super(message);
10
+ this.name = "VendorServiceError";
11
+ this.code = code;
12
+ }
13
+ }
14
+ /** True for a VendorServiceError from ANY copy of this SDK (a plugin bundles its own). */
15
+ export function isVendorServiceError(value) {
16
+ if (!(value instanceof Error) || value.name !== "VendorServiceError")
17
+ return false;
18
+ const code = value.code;
19
+ return typeof code === "string" && VENDOR_SERVICE_ERROR_CODES.includes(code);
20
+ }
@@ -0,0 +1,6 @@
1
+ /** Board 2: empty, filled, and a path whose file no longer exists. */
2
+ export declare function AssetInputView(): import("react").JSX.Element;
3
+ /** Board 1: what the picker lets a person choose, and the folder it opens in. */
4
+ export declare function AssetSettingsView(): import("react").JSX.Element;
5
+ /** Read-only and preview: the file's name and path, no request. */
6
+ export declare function AssetReadOnlyView(): import("react").JSX.Element;
@@ -0,0 +1,55 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId, useState } from "react";
3
+ import { assetPathIsImage } from "@kardalum/api-schemas";
4
+ import { Button, Input, PropertyField, TruncatedText, usePropertyFieldControl } from "@kardalum/ui";
5
+ import { AssetPicker } from "../assets/asset-picker.js";
6
+ import { assetBaseName, normalizeStartFolder, useAssetThumbnail, useAssetTree } from "../assets/asset-tree.js";
7
+ import { usePluginSettings, usePluginSettingsValue, usePluginValue } from "../plugin-context.js";
8
+ import { usePluginTranslate } from "../plugin-screen-context.js";
9
+ function readAccepts(settings) {
10
+ return settings.accepts === "any" ? "any" : "images";
11
+ }
12
+ function readStartFolder(settings) {
13
+ return typeof settings.startFolder === "string" ? normalizeStartFolder(settings.startFolder) : null;
14
+ }
15
+ /** Board 2: empty, filled, and a path whose file no longer exists. */
16
+ export function AssetInputView() {
17
+ const { value, onChange } = usePluginValue();
18
+ const settings = usePluginSettings();
19
+ const field = usePropertyFieldControl();
20
+ const t = usePluginTranslate();
21
+ const [picking, setPicking] = useState(false);
22
+ const path = typeof value === "string" && value !== "" ? value : null;
23
+ // A file picked a moment ago counts as existing whatever the shared tree copy says.
24
+ const [justPicked, setJustPicked] = useState(null);
25
+ // No request for an empty field; the read is shared with every other Asset field on the screen.
26
+ const tree = useAssetTree(path !== null);
27
+ const fresh = path !== null && path === justPicked;
28
+ const checked = path !== null && tree.status === "ready";
29
+ const exists = fresh || (checked && tree.entries.some((entry) => entry.kind === "file" && entry.path === path));
30
+ // "Gone" only from a tree read to its end: a 403, a failed read or a truncated tree claims nothing.
31
+ const missing = checked && !exists && !tree.truncated;
32
+ const isImage = path !== null && assetPathIsImage(path);
33
+ const thumbnail = useAssetThumbnail(path !== null && exists && isImage ? path : null);
34
+ return (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsxs("div", { className: "flex items-center gap-3 rounded-md border border-border-default bg-background-subtle p-3", children: [path !== null && !missing && isImage && (_jsx("span", { className: "block h-12 w-12 shrink-0 overflow-hidden rounded-md border border-border-subtle bg-background-elevated", children: thumbnail ? _jsx("img", { src: thumbnail, alt: "", className: "h-full w-full object-cover" }) : null })), _jsx("div", { className: "flex min-w-0 flex-1 flex-col", children: path === null ? (_jsx("span", { className: "text-sm text-text-tertiary", children: t("asset.noFile") })) : (_jsxs(_Fragment, { children: [_jsx(TruncatedText, { className: "truncate text-sm font-medium text-text-primary", children: missing ? t("asset.missing") : assetBaseName(path) }), _jsx(TruncatedText, { className: "truncate font-mono text-xs text-text-tertiary", children: path })] })) }), _jsxs("div", { ...field, role: "group", className: "flex shrink-0 items-center gap-2", children: [_jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: () => setPicking(true), children: path === null ? t("asset.choose") : missing ? t("asset.chooseAnother") : t("asset.change") }), path !== null && (_jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: () => onChange(null), children: t("asset.remove") }))] })] }), picking && (_jsx(AssetPicker, { accepts: readAccepts(settings), startFolder: readStartFolder(settings), currentPath: path, onPick: (picked) => {
35
+ setJustPicked(picked);
36
+ onChange(picked);
37
+ }, onClose: () => setPicking(false) }))] }));
38
+ }
39
+ /** Board 1: what the picker lets a person choose, and the folder it opens in. */
40
+ export function AssetSettingsView() {
41
+ const { value: settings, onChange } = usePluginSettingsValue();
42
+ const t = usePluginTranslate();
43
+ const groupName = useId();
44
+ const hintId = useId();
45
+ const accepts = readAccepts(settings);
46
+ return (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs("fieldset", { className: "flex flex-col gap-2", "aria-describedby": hintId, children: [_jsx("legend", { className: "text-sm font-medium text-text-primary", children: t("asset.acceptsLabel") }), _jsx("p", { id: hintId, className: "text-xs text-text-tertiary", children: t("asset.acceptsHint") }), ["images", "any"].map((option) => (_jsxs("label", { className: "flex items-center gap-2 text-sm text-text-primary", children: [_jsx("input", { type: "radio", name: groupName, value: option, checked: accepts === option, onChange: () => onChange({ ...settings, accepts: option }), className: "accent-primary-600" }), t(option === "images" ? "asset.acceptsImages" : "asset.acceptsAny")] }, option)))] }), _jsx(PropertyField, { label: t("asset.startFolderLabel"), htmlFor: "asset-settings-start-folder", helpText: t("asset.startFolderHint"), children: _jsx(Input, { id: "asset-settings-start-folder", value: typeof settings.startFolder === "string" ? settings.startFolder : "", onChange: (event) => onChange({ ...settings, startFolder: event.target.value === "" ? null : event.target.value }) }) })] }));
47
+ }
48
+ /** Read-only and preview: the file's name and path, no request. */
49
+ export function AssetReadOnlyView() {
50
+ const { value } = usePluginValue();
51
+ const t = usePluginTranslate();
52
+ if (typeof value !== "string" || value === "")
53
+ return _jsx("p", { className: "text-sm text-text-tertiary", children: t("asset.noFile") });
54
+ return (_jsxs("div", { className: "flex min-w-0 flex-col", children: [_jsx(TruncatedText, { className: "truncate text-sm font-medium text-text-primary", children: assetBaseName(value) }), _jsx(TruncatedText, { className: "truncate font-mono text-xs text-text-tertiary", children: value })] }));
55
+ }
@@ -11,7 +11,7 @@ import { CONTENT_LIST_PROPERTY_LABELS, contentListColumnKey, findFieldInTypes, r
11
11
  const PROPERTY_PREFIX = "property:";
12
12
  const FIELD_PREFIX = "field:";
13
13
  const SELECT_CLASS = "h-10 rounded-md border border-border-strong bg-background-elevated px-2 text-sm text-text-primary " +
14
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-600";
14
+ "focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-600";
15
15
  export function ContentListSettingsView() {
16
16
  const { value: settings, onChange } = usePluginSettingsValue();
17
17
  const host = useContentHost();
@@ -42,7 +42,7 @@ function LockMark() {
42
42
  // The row's own keyboard stop: the name is the only control in a row, so
43
43
  // it carries the focus ring the row would otherwise need.
44
44
  const NAME_BUTTON_CLASS = "text-start text-sm font-medium text-primary-600 hover:underline " +
45
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-600";
45
+ "focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-600";
46
46
  export const CONTENT_LIST_HEADER_CELL_CLASS = "border-b border-border-default px-2 py-2 text-start text-xs font-medium text-text-secondary";
47
47
  /** A stable React key (and a settings identity) for one column. */
48
48
  export function contentListColumnKey(column) {
@@ -3,7 +3,7 @@ import { useId } from "react";
3
3
  import { Input, usePropertyFieldControl } from "@kardalum/ui";
4
4
  import { usePluginValue } from "../plugin-context.js";
5
5
  const EMPTY_RANGE = { start: null, end: null };
6
- // Two independently-labeled <input type="date"> controls, not one — unlike
6
+ // Two independently-labeled <input type="date"> controls, not one, unlike
7
7
  // every other built-in view, this value has two members a person needs to
8
8
  // tell apart by NAME ("Start" vs "End"), so each gets its own visible
9
9
  // <label>. That's why this doesn't follow the single-control idiom the
@@ -17,8 +17,8 @@ const EMPTY_RANGE = { start: null, end: null };
17
17
  // child is left unchanged ... the control deep inside it calls
18
18
  // usePropertyFieldControl() itself"), each half still shares the outer
19
19
  // field's help/error text (aria-describedby) and invalid state
20
- // (aria-invalid) — one field, one error message underneath both inputs —
21
- // it just doesn't take the field's id/aria-labelledby.
20
+ // (aria-invalid), so one field has one error message underneath both inputs.
21
+ // It just doesn't take the field's id/aria-labelledby.
22
22
  export function DateRangeInputView() {
23
23
  const { value, onChange } = usePluginValue();
24
24
  const field = usePropertyFieldControl();
@@ -26,7 +26,7 @@ export function DateRangeInputView() {
26
26
  const reactId = useId();
27
27
  const startId = `${field.id ?? reactId}-start`;
28
28
  const endId = `${field.id ?? reactId}-end`;
29
- // Clearing a date input hands back "" — normalized to null so downstream
29
+ // Clearing a date input hands back "", normalized to null so downstream
30
30
  // (the validate hook, isEmpty, serialization) only ever sees the two
31
31
  // states asDateRange() understands: a real ISO string or null, never an
32
32
  // empty string standing in for "no value".
@@ -44,7 +44,7 @@ export function DateRangeReadOnlyView() {
44
44
  const range = value ?? EMPTY_RANGE;
45
45
  // A half-filled or fully-empty range never reaches a saved, validated
46
46
  // value (the hook above rejects both), but this view renders whatever
47
- // it's handed — an in-progress preview, say — without crashing on it.
47
+ // it's handed (an in-progress preview, say) without crashing on it.
48
48
  // An en dash, not an arrow: "→" is a fixed left-to-right glyph that
49
49
  // still points right in an RTL locale, where the two dates read the
50
50
  // other way round. A dash carries the same "from … to" sense in both.
@@ -8,7 +8,7 @@ import { bracketMatching, defaultHighlightStyle, indentOnInput, syntaxHighlighti
8
8
  import { autocompletion, closeBrackets, closeBracketsKeymap, completionKeymap } from "@codemirror/autocomplete";
9
9
  // Tags a dispatch made by the value-sync effect below so the update
10
10
  // listener can tell "we just replaced the doc from a new `value` prop"
11
- // apart from a real user edit and skip the onChange echo — same pattern
11
+ // apart from a real user edit and skip the onChange echo, the same pattern
12
12
  // (and same rationale) as admin-ui's code-editor.tsx.
13
13
  const externalSync = Annotation.define();
14
14
  export function HtmlCodeEditor({ value, onChange, readOnly = false, fieldId, ariaLabelledBy, ariaDescribedBy, ariaInvalid, }) {
@@ -68,9 +68,8 @@ export function HtmlCodeEditor({ value, onChange, readOnly = false, fieldId, ari
68
68
  view.destroy();
69
69
  viewRef.current = null;
70
70
  };
71
- // Mount-only by design — see admin-ui's code-editor.tsx for the same
71
+ // Mount-only by design; see admin-ui's code-editor.tsx for the same
72
72
  // convention and rationale.
73
- // eslint-disable-next-line react-hooks/exhaustive-deps
74
73
  }, []);
75
74
  // Sync an externally-changed `value` into the view, guarded against
76
75
  // feedback from our own updateListener echoing the same string back.
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { lazy, Suspense } from "react";
3
3
  import { PropertyField, Switch, usePropertyFieldControl } from "@kardalum/ui";
4
4
  import { usePluginSettingsValue, usePluginValue } from "../plugin-context.js";
5
- // The only React.lazy() boundary in this package's views so far — mirrors
5
+ // The only React.lazy() boundary in this package's views so far, mirrors
6
6
  // apps/admin-ui/src/editor/lazy-code-editor.tsx's split (html-code-editor.js
7
7
  // pulls in the whole @codemirror/* graph, ~six packages' worth, which must
8
8
  // stay out of whatever chunk loads this file / built-ins.tsx's static
@@ -11,15 +11,15 @@ import { usePluginSettingsValue, usePluginValue } from "../plugin-context.js";
11
11
  // point for the com.kardalum.html editor.
12
12
  const HtmlCodeEditorLazy = lazy(() => import("./html-code-editor.js").then((module) => ({ default: module.HtmlCodeEditor })));
13
13
  // Same role="status" + aria-hidden placeholder pattern as
14
- // lazy-code-editor.tsx's CodeEditorFallback — no react-i18next here (this
14
+ // lazy-code-editor.tsx's CodeEditorFallback: no react-i18next here (this
15
15
  // package's views deliberately hardcode English strings today, see
16
16
  // built-ins.tsx's TextReadOnlyView/ImageInputView precedent).
17
17
  function HtmlEditorFallback() {
18
18
  return (_jsx("div", { role: "status", "aria-label": "Loading code editor\u2026", children: _jsx("div", { "aria-hidden": "true", className: "h-44 w-full animate-pulse rounded-md border border-border-default bg-background-subtle" }) }));
19
19
  }
20
20
  // The Trusted setting has no bearing on how this field is EDITED (both
21
- // modes get the same CodeMirror surface) — only on how it's RENDERED
22
- // (render-context.ts's html branch, S197 Task 8) — so neither the input
21
+ // modes get the same CodeMirror surface), only on how it's RENDERED
22
+ // (render-context.ts's html branch, S197 Task 8), so neither the input
23
23
  // nor the readOnly view reads settings at all, matching the datatype's
24
24
  // posture that `trusted` is purely a render-pipeline decision.
25
25
  function HtmlEditor({ editable }) {
@@ -42,11 +42,11 @@ export function HtmlInputView() {
42
42
  export function HtmlReadOnlyView() {
43
43
  return _jsx(HtmlEditor, { editable: false });
44
44
  }
45
- // Rendered by the Data Types editor only (data-type-editor.tsx) — a
45
+ // Rendered by the Data Types editor only (data-type-editor.tsx): a
46
46
  // settings-EDITING view, same usePluginSettingsValue() convention as
47
47
  // TextSettingsView/ImageSettingsView in built-ins.tsx. The help copy is
48
- // spec-binding verbatim text (S197 spec §7 / task brief), not a paraphrase
49
- // — do not reword it.
48
+ // spec-binding verbatim text (S197 spec §7 / task brief), not a paraphrase,
49
+ // so do not reword it.
50
50
  export function HtmlSettingsView() {
51
51
  const { value: settings, onChange } = usePluginSettingsValue();
52
52
  return (_jsx("div", { className: "flex flex-col gap-4", children: _jsx(PropertyField, { label: "Trusted", htmlFor: "html-settings-trusted", helpText: "Trusted HTML renders exactly as written: including scripts. Only enable for fields edited by people you'd let deploy code.", children: _jsx(Switch, { id: "html-settings-trusted", checked: settings.trusted === true, onCheckedChange: (checked) => onChange({ ...settings, trusted: checked === true }) }) }) }));
@@ -1,13 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useEffect, useId, useRef, useState } from "react";
3
3
  import { CROP_EDITOR_ID, CropSettingsSchema, renditionName, renditionShape, THUMBNAIL_EDITOR_ID, ThumbnailSettingsSchema, } from "@kardalum/api-schemas";
4
- import { Button, cn, Input, PropertyField, usePropertyFieldControl } from "@kardalum/ui";
4
+ import { Button, cn, Input, PropertyField, TruncatedText, usePropertyFieldControl } from "@kardalum/ui";
5
5
  import { MediaPicker } from "../media/media-picker.js";
6
6
  import { uploadFailureMessage } from "../media/upload-error.js";
7
7
  import { MANAGE_API, usePluginApi, usePluginSettings, usePluginSettingsValue, usePluginValue, } from "../plugin-context.js";
8
8
  import { readAllPages } from "../read-all-pages.js";
9
9
  // downloadUrl is the stable app path for a public item (S186c §1/§3) but
10
- // carries a freshly minted, short-lived `?token=` for a private one —
10
+ // carries a freshly minted, short-lived `?token=` for a private one,
11
11
  // never persisted; refetch GET /api/manage/v1/media/:id whenever the field's value
12
12
  // (media id) changes rather than caching one, so a private item's
13
13
  // preview always has a live token.
@@ -127,7 +127,7 @@ function requestedRendition(settings) {
127
127
  // known at all.
128
128
  function PictureFacts({ preview }) {
129
129
  const cut = preview.cut;
130
- return (_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate font-mono text-xs text-text-primary", dir: "auto", children: cut.state === "found" ? cut.filename : preview.filename }), cut.state === "found" && (_jsx("span", { className: "block truncate text-xs text-text-tertiary", dir: "auto", children: `${cut.name} of ${preview.filename}` })), cut.state === "absent" && (_jsx("span", { className: "mt-1 inline-block rounded-sm bg-warning-100 px-1 text-xs text-warning-800", children: "full image" }))] }));
130
+ return (_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx(TruncatedText, { className: "block truncate font-mono text-xs text-text-primary", dir: "auto", children: cut.state === "found" ? cut.filename : preview.filename }), cut.state === "found" && (_jsx(TruncatedText, { className: "block truncate text-xs text-text-tertiary", dir: "auto", children: `${cut.name} of ${preview.filename}` })), cut.state === "absent" && (_jsx("span", { className: "mt-1 inline-block rounded-sm bg-warning-100 px-1 text-xs text-warning-800", children: "full image" }))] }));
131
131
  }
132
132
  export function ImageInputView() {
133
133
  const { value, onChange } = usePluginValue();
@@ -221,7 +221,7 @@ const TYPE_PAGE_LIMIT = 100;
221
221
  // crops, but it cannot be read as the whole set.
222
222
  const TYPE_PAGE_CAP = 20;
223
223
  const SELECT_CLASS = "h-10 w-full rounded-md border border-border-strong bg-background-elevated px-2 text-sm text-text-primary " +
224
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-600";
224
+ "focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-600";
225
225
  /** A listing read to its end, or as far as the cap allowed.
226
226
  *
227
227
  * `complete` is false when the cursor was still running when the cap was
@@ -309,7 +309,7 @@ function useRenditionChoices() {
309
309
  }, [fetchApi]);
310
310
  return { groups, loading, error, complete };
311
311
  }
312
- // Rendered by the Data Types editor only — a settings-EDITING view (see
312
+ // Rendered by the Data Types editor only, a settings-EDITING view (see
313
313
  // TextSettingsView in built-ins.tsx for the same pattern/rationale).
314
314
  // acceptedTypes is edited as a comma-separated string (no multi-select
315
315
  // widget precedent in this codebase) and parsed to string[] on change.