@kardalum/plugin-sdk 0.19.0 → 0.20.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 (366) hide show
  1. package/CHANGELOG.md +211 -0
  2. package/README.md +19 -0
  3. package/dist/admin-section-registry.d.ts +16 -1
  4. package/dist/admin-section-registry.js +23 -0
  5. package/dist/built-in-editor-ids.d.ts +1 -1
  6. package/dist/built-in-editor-ids.js +2 -20
  7. package/dist/built-in-settings-schemas.d.ts +10 -0
  8. package/dist/built-in-settings-schemas.js +86 -0
  9. package/dist/built-in-value-schemas.js +35 -0
  10. package/dist/built-ins.js +38 -7
  11. package/dist/capabilities.d.ts +11 -1
  12. package/dist/capabilities.js +55 -3
  13. package/dist/cli.d.ts +66 -0
  14. package/dist/cli.js +22 -0
  15. package/dist/content-library.d.ts +85 -0
  16. package/dist/content-library.js +15 -0
  17. package/dist/content-picker/page-picker-sheet.d.ts +13 -0
  18. package/dist/content-picker/page-picker-sheet.js +105 -0
  19. package/dist/content-picker/page-tree.d.ts +25 -0
  20. package/dist/content-picker/page-tree.js +132 -0
  21. package/dist/data-type-plugin.d.ts +7 -1
  22. package/dist/datatype-validation.d.ts +4 -9
  23. package/dist/datatype-validation.js +139 -1
  24. package/dist/entitlement-entry.d.ts +1 -1
  25. package/dist/entitlement-entry.js +1 -1
  26. package/dist/entitlement-gate.d.ts +14 -0
  27. package/dist/entitlement-gate.js +64 -7
  28. package/dist/entitlement-plan.d.ts +6 -0
  29. package/dist/entitlement-plan.js +10 -0
  30. package/dist/entitlement-types.d.ts +36 -12
  31. package/dist/entitlement.d.ts +31 -4
  32. package/dist/entitlement.js +58 -17
  33. package/dist/hook-entry.d.ts +5 -0
  34. package/dist/hook-entry.js +30 -0
  35. package/dist/host-entry.d.ts +1 -1
  36. package/dist/host-entry.js +1 -1
  37. package/dist/index.d.ts +36 -4
  38. package/dist/index.js +50 -3
  39. package/dist/mail.d.ts +30 -0
  40. package/dist/mail.js +1 -0
  41. package/dist/manifest-entry.d.ts +29 -4
  42. package/dist/manifest-entry.js +39 -2
  43. package/dist/manifest-schema.d.ts +443 -29
  44. package/dist/manifest-schema.js +285 -23
  45. package/dist/manifest.d.ts +450 -51
  46. package/dist/manifest.js +1 -1
  47. package/dist/media/media-picker.js +31 -18
  48. package/dist/media/upload-error.d.ts +5 -1
  49. package/dist/media/upload-error.js +14 -2
  50. package/dist/media-library.d.ts +32 -0
  51. package/dist/media-library.js +15 -0
  52. package/dist/nested-field-host.d.ts +76 -0
  53. package/dist/nested-field-host.js +90 -0
  54. package/dist/notify.d.ts +12 -4
  55. package/dist/notify.js +1 -1
  56. package/dist/outbound.d.ts +47 -0
  57. package/dist/outbound.js +1 -0
  58. package/dist/plugin-context.d.ts +5 -0
  59. package/dist/plugin-screen-context.d.ts +112 -0
  60. package/dist/plugin-screen-context.js +26 -0
  61. package/dist/providers.d.ts +268 -0
  62. package/dist/providers.js +74 -0
  63. package/dist/read-all-pages.d.ts +5 -0
  64. package/dist/read-all-pages.js +3 -2
  65. package/dist/richtext/block-panel.js +11 -6
  66. package/dist/richtext/insert-menu.js +9 -6
  67. package/dist/richtext/style-listbox.js +6 -4
  68. package/dist/sdk-strings.d.ts +285 -0
  69. package/dist/sdk-strings.js +347 -0
  70. package/dist/sealing.d.ts +14 -0
  71. package/dist/sealing.js +1 -0
  72. package/dist/simple-storage-value-provider.js +24 -24
  73. package/dist/structured-storage-types.d.ts +309 -9
  74. package/dist/text-entry.d.ts +1 -0
  75. package/dist/text-entry.js +6 -0
  76. package/dist/tokens/tailwind-theme.css +5 -0
  77. package/dist/tokens/tokens.css +15 -3
  78. package/dist/tokens/tokens.json +8 -3
  79. package/dist/views/asset-view.js +4 -1
  80. package/dist/views/content-list-preview.js +3 -1
  81. package/dist/views/content-list-settings-view.js +11 -7
  82. package/dist/views/content-list-view.d.ts +5 -3
  83. package/dist/views/content-list-view.js +38 -34
  84. package/dist/views/content-picker-view.d.ts +3 -0
  85. package/dist/views/content-picker-view.js +143 -0
  86. package/dist/views/crop-view.d.ts +4 -6
  87. package/dist/views/crop-view.js +22 -13
  88. package/dist/views/date-range-view.js +4 -1
  89. package/dist/views/file-upload-view.d.ts +5 -7
  90. package/dist/views/file-upload-view.js +16 -7
  91. package/dist/views/group-view.d.ts +8 -0
  92. package/dist/views/group-view.js +123 -0
  93. package/dist/views/html-view.js +7 -6
  94. package/dist/views/image-view.js +37 -19
  95. package/dist/views/link-view.d.ts +3 -0
  96. package/dist/views/link-view.js +150 -0
  97. package/dist/views/options-list-view.d.ts +3 -0
  98. package/dist/views/options-list-view.js +104 -0
  99. package/dist/views/repeatable-list-view.d.ts +3 -0
  100. package/dist/views/repeatable-list-view.js +113 -0
  101. package/dist/views/rich-text-view.js +28 -13
  102. package/dist/views/suggest-key.d.ts +17 -0
  103. package/dist/views/suggest-key.js +55 -0
  104. package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.d.ts +215 -0
  105. package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.js +179 -0
  106. package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.d.ts +12 -0
  107. package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.js +10 -0
  108. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +10 -0
  109. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +5 -0
  110. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +7 -1
  111. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +4 -2
  112. package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.d.ts +1 -0
  113. package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.js +27 -0
  114. package/node_modules/@kardalum/api-schemas/dist/capability-detail.d.ts +65 -0
  115. package/node_modules/@kardalum/api-schemas/dist/capability-detail.js +126 -0
  116. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +115 -3
  117. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +58 -11
  118. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +57 -2
  119. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +137 -0
  120. package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +1 -1
  121. package/node_modules/@kardalum/api-schemas/dist/content-path.js +1 -1
  122. package/node_modules/@kardalum/api-schemas/dist/content-search.schema.d.ts +50 -0
  123. package/node_modules/@kardalum/api-schemas/dist/content-search.schema.js +42 -0
  124. package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.d.ts +37 -0
  125. package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.js +19 -0
  126. package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.d.ts +23 -0
  127. package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.js +13 -0
  128. package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +3 -0
  129. package/node_modules/@kardalum/api-schemas/dist/content.schema.js +10 -0
  130. package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.d.ts +41 -0
  131. package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.js +86 -0
  132. package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +10 -5
  133. package/node_modules/@kardalum/api-schemas/dist/core-actions.js +7 -4
  134. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +25 -0
  135. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +8 -0
  136. package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +1 -1
  137. package/node_modules/@kardalum/api-schemas/dist/data-type-issue.d.ts +35 -0
  138. package/node_modules/@kardalum/api-schemas/dist/data-type-issue.js +60 -0
  139. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +180 -15
  140. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +41 -5
  141. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +24 -6
  142. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +90 -5
  143. package/node_modules/@kardalum/api-schemas/dist/form-protection.d.ts +23 -0
  144. package/node_modules/@kardalum/api-schemas/dist/form-protection.js +12 -0
  145. package/node_modules/@kardalum/api-schemas/dist/graphql-limits.d.ts +12 -0
  146. package/node_modules/@kardalum/api-schemas/dist/graphql-limits.js +14 -0
  147. package/node_modules/@kardalum/api-schemas/dist/held-embed-words.d.ts +23 -0
  148. package/node_modules/@kardalum/api-schemas/dist/held-embed-words.js +70 -0
  149. package/node_modules/@kardalum/api-schemas/dist/index.d.ts +117 -41
  150. package/node_modules/@kardalum/api-schemas/dist/index.js +89 -26
  151. package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.d.ts +9 -0
  152. package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.js +9 -0
  153. package/node_modules/@kardalum/api-schemas/dist/legal-anchors.d.ts +8 -0
  154. package/node_modules/@kardalum/api-schemas/dist/legal-anchors.js +9 -0
  155. package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +63 -0
  156. package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +54 -0
  157. package/node_modules/@kardalum/api-schemas/dist/mail-rules.d.ts +224 -0
  158. package/node_modules/@kardalum/api-schemas/dist/mail-rules.js +404 -0
  159. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +8 -0
  160. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +4 -0
  161. package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.d.ts +145 -0
  162. package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.js +154 -0
  163. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +312 -8
  164. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +43 -3
  165. package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.d.ts +15 -0
  166. package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.js +14 -0
  167. package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.d.ts +131 -0
  168. package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.js +272 -0
  169. package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.d.ts +84 -0
  170. package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.js +138 -0
  171. package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.d.ts +20 -0
  172. package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.js +49 -0
  173. package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.d.ts +211 -0
  174. package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.js +424 -0
  175. package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.d.ts +78 -0
  176. package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.js +27 -0
  177. package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.d.ts +70 -0
  178. package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.js +43 -0
  179. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +22 -0
  180. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +13 -1
  181. package/node_modules/@kardalum/api-schemas/dist/media-move.schema.d.ts +75 -0
  182. package/node_modules/@kardalum/api-schemas/dist/media-move.schema.js +53 -0
  183. package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +2 -2
  184. package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +2 -0
  185. package/node_modules/@kardalum/api-schemas/dist/media-reference.js +55 -0
  186. package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +1 -0
  187. package/node_modules/@kardalum/api-schemas/dist/media.schema.js +4 -0
  188. package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.d.ts +204 -0
  189. package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.js +370 -0
  190. package/node_modules/@kardalum/api-schemas/dist/nested-validation.d.ts +53 -0
  191. package/node_modules/@kardalum/api-schemas/dist/nested-validation.js +284 -0
  192. package/node_modules/@kardalum/api-schemas/dist/news.schema.d.ts +5 -5
  193. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +1 -2
  194. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +1 -2
  195. package/node_modules/@kardalum/api-schemas/dist/notification-kinds.d.ts +145 -0
  196. package/node_modules/@kardalum/api-schemas/dist/notification-kinds.js +177 -0
  197. package/node_modules/@kardalum/api-schemas/dist/notification.schema.d.ts +258 -7
  198. package/node_modules/@kardalum/api-schemas/dist/notification.schema.js +96 -5
  199. package/node_modules/@kardalum/api-schemas/dist/page-address.d.ts +10 -0
  200. package/node_modules/@kardalum/api-schemas/dist/page-address.js +7 -0
  201. package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.d.ts +34 -0
  202. package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.js +60 -0
  203. package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.d.ts +28 -3
  204. package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.js +55 -8
  205. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +12 -0
  206. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +13 -0
  207. package/node_modules/@kardalum/api-schemas/dist/plugin-caller.d.ts +23 -0
  208. package/node_modules/@kardalum/api-schemas/dist/plugin-caller.js +16 -0
  209. package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.d.ts +76 -0
  210. package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.js +316 -0
  211. package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.d.ts +42 -0
  212. package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.js +74 -0
  213. package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.d.ts +31 -0
  214. package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.js +131 -0
  215. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +26 -2
  216. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +26 -2
  217. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +13 -5
  218. package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.d.ts +228 -0
  219. package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.js +41 -0
  220. package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.d.ts +26 -0
  221. package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.js +55 -0
  222. package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.d.ts +40 -0
  223. package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.js +124 -0
  224. package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.d.ts +41 -0
  225. package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.js +51 -0
  226. package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.d.ts +32 -0
  227. package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.js +102 -0
  228. package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.d.ts +107 -0
  229. package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.js +213 -0
  230. package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.d.ts +5 -0
  231. package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.js +21 -0
  232. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +4 -0
  233. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +3 -0
  234. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +44 -0
  235. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +38 -1
  236. package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +237 -2
  237. package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +205 -6
  238. package/node_modules/@kardalum/api-schemas/dist/plugin-labels.d.ts +26 -0
  239. package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +29 -1
  240. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +32 -8
  241. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +120 -14
  242. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +335 -6
  243. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +242 -2
  244. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +16 -1
  245. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +34 -1
  246. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.d.ts +40 -0
  247. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.js +139 -0
  248. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +22 -1
  249. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +31 -1
  250. package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.d.ts +25 -0
  251. package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.js +43 -0
  252. package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.d.ts +107 -0
  253. package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.js +150 -0
  254. package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.d.ts +5 -0
  255. package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.js +7 -0
  256. package/node_modules/@kardalum/api-schemas/dist/plugin-providers.d.ts +310 -0
  257. package/node_modules/@kardalum/api-schemas/dist/plugin-providers.js +430 -0
  258. package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.d.ts +4 -0
  259. package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.js +2 -0
  260. package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.d.ts +45 -0
  261. package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.js +99 -0
  262. package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.d.ts +68 -0
  263. package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.js +114 -0
  264. package/node_modules/@kardalum/api-schemas/dist/plugin-settings.d.ts +342 -0
  265. package/node_modules/@kardalum/api-schemas/dist/plugin-settings.js +400 -0
  266. package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.d.ts +180 -0
  267. package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.js +612 -0
  268. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +7 -0
  269. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +47 -4
  270. package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.d.ts +45 -0
  271. package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.js +197 -0
  272. package/node_modules/@kardalum/api-schemas/dist/plural-rules.d.ts +9 -0
  273. package/node_modules/@kardalum/api-schemas/dist/plural-rules.js +41 -0
  274. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +41 -0
  275. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +100 -12
  276. package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.d.ts +189 -0
  277. package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.js +164 -0
  278. package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +4 -4
  279. package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +7 -3
  280. package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.d.ts +6 -0
  281. package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.js +82 -0
  282. package/node_modules/@kardalum/api-schemas/dist/rich-text-text.d.ts +66 -0
  283. package/node_modules/@kardalum/api-schemas/dist/rich-text-text.js +497 -0
  284. package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.d.ts +82 -0
  285. package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.js +99 -0
  286. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +13 -0
  287. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +28 -0
  288. package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +91 -1
  289. package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.d.ts +90 -8
  290. package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +59 -1
  291. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +110 -0
  292. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +34 -2
  293. package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.d.ts +384 -0
  294. package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.js +616 -0
  295. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +3 -3
  296. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
  297. package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.d.ts +13 -0
  298. package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.js +26 -0
  299. package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.d.ts +66 -0
  300. package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.js +160 -0
  301. package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +1 -0
  302. package/node_modules/@kardalum/api-schemas/dist/template.schema.js +3 -0
  303. package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.d.ts +13 -0
  304. package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.js +29 -0
  305. package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.d.ts +13 -0
  306. package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.js +6 -0
  307. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +58 -1
  308. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +34 -3
  309. package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.d.ts +5 -1
  310. package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.js +4 -3
  311. package/node_modules/@kardalum/api-schemas/package.json +1 -0
  312. package/node_modules/@kardalum/design-tokens/dist/build-css.js +6 -0
  313. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +5 -0
  314. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -1
  315. package/node_modules/@kardalum/design-tokens/dist/tokens.css +15 -3
  316. package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +1 -1
  317. package/node_modules/@kardalum/design-tokens/dist/tokens.js +12 -3
  318. package/node_modules/@kardalum/design-tokens/dist/tokens.json +8 -3
  319. package/node_modules/@kardalum/design-tokens/dist/types.d.ts +1 -1
  320. package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +21 -2
  321. package/node_modules/@kardalum/plugin-package/dist/build-reference.js +8 -2
  322. package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +17 -10
  323. package/node_modules/@kardalum/plugin-package/dist/capabilities.js +355 -22
  324. package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +1 -1
  325. package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +2 -0
  326. package/node_modules/@kardalum/plugin-package/dist/cms-range.d.ts +17 -0
  327. package/node_modules/@kardalum/plugin-package/dist/cms-range.js +353 -0
  328. package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.d.ts +2 -0
  329. package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.js +26 -0
  330. package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +1 -1
  331. package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +3 -2
  332. package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.d.ts +2 -0
  333. package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.js +34 -0
  334. package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +2 -2
  335. package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.d.ts +2 -0
  336. package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.js +27 -0
  337. package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.d.ts +2 -0
  338. package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.js +22 -0
  339. package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +1 -0
  340. package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +1 -0
  341. package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +47 -5
  342. package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.d.ts +27 -0
  343. package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.js +95 -0
  344. package/node_modules/@kardalum/plugin-package/dist/delivery/locales.js +9 -4
  345. package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.d.ts +3 -0
  346. package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.js +68 -0
  347. package/node_modules/@kardalum/plugin-package/dist/delivery/providers.d.ts +3 -0
  348. package/node_modules/@kardalum/plugin-package/dist/delivery/providers.js +298 -0
  349. package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +25 -4
  350. package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +91 -2
  351. package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.d.ts +6 -0
  352. package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.js +140 -0
  353. package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.d.ts +2 -0
  354. package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.js +36 -0
  355. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +1 -0
  356. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +21 -1
  357. package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +10 -0
  358. package/node_modules/@kardalum/plugin-package/dist/index.d.ts +4 -2
  359. package/node_modules/@kardalum/plugin-package/dist/index.js +2 -1
  360. package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +75 -0
  361. package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +123 -0
  362. package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
  363. package/node_modules/@kardalum/ui/dist/components/tooltip.js +1 -2
  364. package/node_modules/@kardalum/ui/dist/components/truncated-text.d.ts +6 -1
  365. package/node_modules/@kardalum/ui/dist/components/truncated-text.js +5 -4
  366. package/package.json +12 -2
@@ -7,7 +7,8 @@ import { MANAGE_API, usePluginApi } from "../plugin-context.js";
7
7
  import { gridArrowStep } from "../grid-arrow-step.js";
8
8
  import { readAllPages } from "../read-all-pages.js";
9
9
  import { isRenditionIneligible } from "../rendition-eligibility.js";
10
- import { uploadFailureMessage } from "./upload-error.js";
10
+ import { sdkStringWithNodes, useContentTypingProps, useSdkString } from "../sdk-strings.js";
11
+ import { mediaUploadCodeMessage, uploadFailureMessage } from "./upload-error.js";
11
12
  // GET /api/manage/v1/media page size for the picker's grid (S197 Task 2). Additional
12
13
  // pages are fetched on demand via the "Load more" button below, following
13
14
  // MediaListQuerySchema's cursor contract (media-api.schema.ts) rather than
@@ -20,9 +21,6 @@ const FOLDER_PAGE_CAP = 50;
20
21
  // accepted-types setting of its own and has always shown images only, so
21
22
  // this is that behaviour written down rather than a new default.
22
23
  const DEFAULT_ACCEPTED_TYPES = ["image/*"];
23
- // The word the breadcrumb already uses for the library root, reused by the
24
- // upload affordance so both name the same place the same way.
25
- const ROOT_LABEL = "Root";
26
24
  // --- Type filtering (S234d Task 6) ----------------------------------------
27
25
  // The spec's sentence is that the picker offers items whose media type's
28
26
  // file upload accepts the field's accepted types. An item's STORED media
@@ -162,6 +160,13 @@ function folderPath(folderId, byId) {
162
160
  // attention has moved on.
163
161
  export function MediaPicker({ onPick, onClose, collectAlt, acceptedTypes, rendition }) {
164
162
  const fetchApi = usePluginApi();
163
+ const s = useSdkString();
164
+ // The alt text is written in the content's language, not the admin's
165
+ // (S366f D10): the drawer is the admin's, the words typed here are the page's.
166
+ const altTyping = useContentTypingProps();
167
+ // The word the breadcrumb uses for the library root, reused by the upload
168
+ // affordance so both name the same place the same way.
169
+ const rootLabel = s("picker.root");
165
170
  const [folders, setFolders] = useState([]);
166
171
  const [currentFolderId, setCurrentFolderId] = useState(null);
167
172
  // As the server sent them. The accepted-types filter is applied on the
@@ -196,7 +201,7 @@ export function MediaPicker({ onPick, onClose, collectAlt, acceptedTypes, rendit
196
201
  const foldersByParent = useMemo(() => groupFoldersByParent(folders), [folders]);
197
202
  const visibleFolders = useMemo(() => childFoldersOf(foldersByParent, currentFolderId), [foldersByParent, currentFolderId]);
198
203
  const breadcrumbPath = useMemo(() => folderPath(currentFolderId, foldersById), [currentFolderId, foldersById]);
199
- const currentFolderName = breadcrumbPath.at(-1)?.name ?? ROOT_LABEL;
204
+ const currentFolderName = breadcrumbPath.at(-1)?.name ?? rootLabel;
200
205
  // The whole folder tree loads once. A failed folder fetch surfaces
201
206
  // through the SAME error banner the image list uses (review fix:
202
207
  // silently-empty folders are indistinguishable from "no subfolders
@@ -208,6 +213,7 @@ export function MediaPicker({ onPick, onClose, collectAlt, acceptedTypes, rendit
208
213
  itemKey: "folders",
209
214
  limit: FOLDER_PAGE_LIMIT,
210
215
  cap: FOLDER_PAGE_CAP,
216
+ failure: ({ status }) => s("picker.foldersFailed", { detail: status ?? s("shared.unexpectedAnswer") }),
211
217
  })
212
218
  .then(({ items, complete }) => {
213
219
  if (cancelled)
@@ -215,7 +221,7 @@ export function MediaPicker({ onPick, onClose, collectAlt, acceptedTypes, rendit
215
221
  setFolders(items);
216
222
  // A tree that was not read to its end is a subset of the folders: say so through the banner the list uses.
217
223
  if (!complete)
218
- setError(`Only the first ${FOLDER_PAGE_CAP * FOLDER_PAGE_LIMIT} media folders could be read`);
224
+ setError(s("picker.foldersTruncated", { limit: FOLDER_PAGE_CAP * FOLDER_PAGE_LIMIT }));
219
225
  })
220
226
  .catch((err) => {
221
227
  if (!cancelled)
@@ -224,7 +230,7 @@ export function MediaPicker({ onPick, onClose, collectAlt, acceptedTypes, rendit
224
230
  return () => {
225
231
  cancelled = true;
226
232
  };
227
- }, [fetchApi]);
233
+ }, [fetchApi, s]);
228
234
  // `rendition` rides along as a query parameter, once per page, and the
229
235
  // server answers it on every item through `hasRendition` (S234d Task 3).
230
236
  // It is the whole fallback marking: nothing is asked per tile, and
@@ -251,7 +257,7 @@ export function MediaPicker({ onPick, onClose, collectAlt, acceptedTypes, rendit
251
257
  fetchApi(listUrl(folderId, null))
252
258
  .then(async (response) => {
253
259
  if (!response.ok)
254
- throw new Error(`Failed to load media (${response.status})`);
260
+ throw new Error(s("picker.loadFailed", { status: response.status }));
255
261
  const body = (await response.json());
256
262
  if (requestId !== loadRequestIdRef.current)
257
263
  return;
@@ -267,7 +273,7 @@ export function MediaPicker({ onPick, onClose, collectAlt, acceptedTypes, rendit
267
273
  if (requestId === loadRequestIdRef.current)
268
274
  setLoading(false);
269
275
  });
270
- }, [fetchApi, listUrl]);
276
+ }, [fetchApi, listUrl, s]);
271
277
  useEffect(() => {
272
278
  loadFirstPage(currentFolderId);
273
279
  }, [currentFolderId, loadFirstPage]);
@@ -297,7 +303,7 @@ export function MediaPicker({ onPick, onClose, collectAlt, acceptedTypes, rendit
297
303
  try {
298
304
  const response = await fetchApi(listUrl(currentFolderId, nextCursor));
299
305
  if (!response.ok)
300
- throw new Error(`Failed to load media (${response.status})`);
306
+ throw new Error(s("picker.loadFailed", { status: response.status }));
301
307
  const body = (await response.json());
302
308
  setRawItems((current) => [...current, ...body.items]);
303
309
  setNextCursor(body.nextCursor);
@@ -348,8 +354,9 @@ export function MediaPicker({ onPick, onClose, collectAlt, acceptedTypes, rendit
348
354
  // land on, which nothing here knows until the server has resolved
349
355
  // it. Relaying what it said is this surface's whole part in that
350
356
  // rule.
351
- if (!response.ok)
352
- throw new Error(await uploadFailureMessage(response));
357
+ if (!response.ok) {
358
+ throw new Error(await uploadFailureMessage(response, (status) => s("shared.uploadFailed", { status }), (code) => mediaUploadCodeMessage(code, () => s("shared.mediaStoreSwitchedOff"))));
359
+ }
353
360
  const media = (await response.json());
354
361
  // A fresh upload goes through the same door as an existing item: it
355
362
  // still needs alt text authored where alt text is collected, and it
@@ -424,10 +431,12 @@ export function MediaPicker({ onPick, onClose, collectAlt, acceptedTypes, rendit
424
431
  event.preventDefault();
425
432
  opener.focus();
426
433
  }
427
- }, children: [_jsxs(SheetHeader, { className: "flex-col items-start gap-1", children: [_jsx(SheetTitle, { children: "Choose an image" }), _jsxs(SheetDescription, { children: ["Showing images from your library.", rendition ? (_jsxs(_Fragment, { children: [" ", "This field asks for a ", _jsx("strong", { className: "font-medium text-text-primary", children: requestedShape }), " crop."] })) : null] })] }), _jsx("nav", { "aria-label": "Folder location", className: "shrink-0 border-b border-border-default px-4 py-2", children: _jsxs("ol", { className: "flex flex-wrap items-center gap-1 text-sm text-text-tertiary", children: [_jsx("li", { children: currentFolderId === null ? (_jsx("span", { "aria-current": "page", className: "font-medium text-text-primary", children: ROOT_LABEL })) : (_jsx("button", { type: "button", onClick: () => openFolder(null), className: "rounded-md px-1 hover:text-primary-600 hover:underline focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-600", children: ROOT_LABEL })) }), breadcrumbPath.map((folder, index) => {
434
+ }, children: [_jsxs(SheetHeader, { className: "flex-col items-start gap-1", children: [_jsx(SheetTitle, { children: s("picker.title") }), _jsxs(SheetDescription, { children: [s("picker.description"), rendition ? (_jsxs(_Fragment, { children: [" ", sdkStringWithNodes(s, "picker.asksForCrop", {
435
+ shape: _jsx("strong", { className: "font-medium text-text-primary", children: requestedShape }),
436
+ })] })) : null] })] }), _jsx("nav", { "aria-label": s("picker.location"), className: "shrink-0 border-b border-border-default px-4 py-2", children: _jsxs("ol", { className: "flex flex-wrap items-center gap-1 text-sm text-text-tertiary", children: [_jsx("li", { children: currentFolderId === null ? (_jsx("span", { "aria-current": "page", className: "font-medium text-text-primary", children: rootLabel })) : (_jsx("button", { type: "button", onClick: () => openFolder(null), className: "rounded-md px-1 hover:text-primary-600 hover:underline focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-600", children: rootLabel })) }), breadcrumbPath.map((folder, index) => {
428
437
  const isCurrent = index === breadcrumbPath.length - 1;
429
438
  return (_jsxs("li", { className: "flex min-w-0 items-center gap-1", children: [_jsx(ChevronRight, { "aria-hidden": "true", className: "size-3 shrink-0 rtl:rotate-180" }), isCurrent ? (_jsx(TruncatedText, { "aria-current": "page", className: "truncate font-medium text-text-primary", children: folder.name })) : (_jsx("button", { type: "button", onClick: () => openFolder(folder.id), className: "min-w-0 rounded-md px-1 hover:text-primary-600 hover:underline focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-600", children: _jsx(TruncatedText, { className: "block truncate", children: folder.name }) }))] }, folder.id));
430
- })] }) }), _jsxs("div", { className: "flex flex-1 flex-col gap-4 overflow-y-auto p-4", children: [error && _jsx("p", { className: "text-sm text-danger-600", children: error }), visibleFolders.length > 0 && (_jsx("ul", { "aria-label": "Folders", className: "flex flex-wrap gap-2", children: visibleFolders.map((folder) => (_jsx("li", { className: "min-w-0", children: _jsxs("button", { type: "button", onClick: () => openFolder(folder.id), className: "flex max-w-full items-center gap-2 rounded-full border border-border-default bg-background-elevated px-3 py-1 text-xs text-text-secondary hover:bg-background-hover focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-600", children: [_jsx(FolderIcon, { "aria-hidden": "true", className: "size-4 shrink-0 text-text-tertiary" }), _jsx(TruncatedText, { className: "truncate", children: folder.name })] }) }, folder.id))) })), loading && _jsx("p", { className: "text-sm text-text-secondary", children: "Loading\u2026" }), emptyBecauseFiltered && (_jsx("p", { className: "text-sm text-text-secondary", children: "Nothing here is a kind this field accepts." })), !loading && rawItems.length === 0 && visibleFolders.length === 0 && (_jsx("p", { className: "text-sm text-text-secondary", children: currentFolderId === null ? "No images in the media library yet." : "No images in this folder yet." })), !loading && items.length > 0 && (_jsx("div", { role: "listbox", "aria-label": "Media library", onKeyDown: handleGridKeyDown, className: "grid grid-cols-3 gap-3", children: items.map((item, index) => {
439
+ })] }) }), _jsxs("div", { className: "flex flex-1 flex-col gap-4 overflow-y-auto p-4", children: [error && _jsx("p", { className: "text-sm text-danger-600", children: error }), visibleFolders.length > 0 && (_jsx("ul", { "aria-label": s("picker.folders"), className: "flex flex-wrap gap-2", children: visibleFolders.map((folder) => (_jsx("li", { className: "min-w-0", children: _jsxs("button", { type: "button", onClick: () => openFolder(folder.id), className: "flex max-w-full items-center gap-2 rounded-full border border-border-default bg-background-elevated px-3 py-1 text-xs text-text-secondary hover:bg-background-hover focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-600", children: [_jsx(FolderIcon, { "aria-hidden": "true", className: "size-4 shrink-0 text-text-tertiary" }), _jsx(TruncatedText, { className: "truncate", children: folder.name })] }) }, folder.id))) })), loading && _jsx("p", { className: "text-sm text-text-secondary", children: s("picker.loading") }), emptyBecauseFiltered && (_jsx("p", { className: "text-sm text-text-secondary", children: s("picker.nothingAccepted") })), !loading && rawItems.length === 0 && visibleFolders.length === 0 && (_jsx("p", { className: "text-sm text-text-secondary", children: currentFolderId === null ? s("picker.emptyLibrary") : s("picker.emptyFolder") })), !loading && items.length > 0 && (_jsx("div", { role: "listbox", "aria-label": s("picker.library"), onKeyDown: handleGridKeyDown, className: "grid grid-cols-3 gap-3", children: items.map((item, index) => {
431
440
  const selected = pending?.id === item.id;
432
441
  // `hasRendition` is only set when the listing was asked
433
442
  // about a crop, so absent means nothing was asked and
@@ -436,12 +445,16 @@ export function MediaPicker({ onPick, onClose, collectAlt, acceptedTypes, rendit
436
445
  const title = !fallsBack
437
446
  ? item.filename
438
447
  : isRenditionIneligible(item.mimeType)
439
- ? `${item.filename}: this format is never cut, so this field shows the full image.`
440
- : `${item.filename}: no ${requestedShape} crop yet, so this field shows the full image.`;
448
+ ? s("picker.neverCut", { file: item.filename })
449
+ : s("picker.noCropYet", { file: item.filename, shape: requestedShape });
441
450
  return (_jsxs("button", { type: "button", ref: (el) => {
442
451
  optionRefs.current[index] = el;
443
452
  }, role: "option", "aria-selected": selected, title: title, tabIndex: index === activeIndex ? 0 : -1, onFocus: () => setActiveIndex(index), onClick: () => selectItem(item), className: cn("flex flex-col overflow-hidden rounded-md border text-start focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-600", selected
444
453
  ? "border-primary-600 bg-primary-100"
445
- : "border-border-subtle hover:bg-background-elevated"), children: [_jsx("span", { className: "block aspect-square overflow-hidden bg-background-subtle", children: _jsx("img", { src: item.downloadUrl, alt: "", className: "h-full w-full object-cover" }) }), _jsxs("span", { className: "block min-w-0 px-2 py-1", children: [_jsx(TruncatedText, { className: "block truncate font-mono text-xs text-text-tertiary", children: item.filename }), fallsBack && (_jsx("span", { className: "mt-1 inline-block rounded-sm bg-warning-100 px-1 text-xs text-warning-800", children: "full image" }))] })] }, item.id));
446
- }) })), !loading && nextCursor && (_jsx("div", { className: "flex justify-center", children: _jsx(Button, { type: "button", variant: "outline", size: "sm", disabled: loadingMore, onClick: () => void loadMore(), children: loadingMore ? "Loading…" : "Load more" }) }))] }), pending && (_jsxs("div", { className: "flex shrink-0 items-center gap-3 border-t border-border-default px-4 py-3", children: [_jsx("img", { src: pending.downloadUrl, alt: "", className: "h-12 w-12 shrink-0 rounded-md border border-border-subtle object-cover" }), _jsxs("div", { className: "flex-1", children: [_jsx("label", { htmlFor: "media-picker-alt", className: "mb-1 block text-xs font-medium text-text-secondary", children: "Alt text" }), _jsx("input", { id: "media-picker-alt", ref: altInputRef, type: "text", value: altText, onChange: (event) => setAltText(event.target.value), placeholder: "Describe this image for screen readers (optional)", className: "w-full rounded-md border border-border-default bg-background-elevated px-2 py-1 text-sm text-text-primary focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-600" })] })] })), _jsxs(SheetFooter, { className: "items-center justify-start", children: [_jsxs("p", { className: "text-sm text-text-tertiary", children: ["Or", " ", _jsx("button", { type: "button", disabled: uploading, onClick: () => uploadInputRef.current?.click(), className: "rounded-md text-primary-600 underline focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-600", children: uploading ? `uploading into ${currentFolderName}…` : `upload into ${currentFolderName}` })] }), _jsx("input", { id: "media-picker-upload", ref: uploadInputRef, type: "file", className: "hidden", accept: acceptAttribute(acceptedTypes), "aria-label": `Upload into ${currentFolderName}`, disabled: uploading, onChange: (event) => void handleUpload(event) }), _jsx("span", { className: "ms-auto flex gap-2", children: pending ? (_jsxs(_Fragment, { children: [_jsx(Button, { type: "button", variant: "outline", onClick: onClose, children: "Cancel" }), _jsx(Button, { type: "button", onClick: () => onPick({ id: pending.id, downloadUrl: pending.downloadUrl, alt: altText }), children: "Insert" })] })) : (_jsx(Button, { type: "button", variant: "outline", onClick: onClose, children: "Close" })) })] })] }) }));
454
+ : "border-border-subtle hover:bg-background-elevated"), children: [_jsx("span", { className: "block aspect-square overflow-hidden bg-background-subtle", children: _jsx("img", { src: item.downloadUrl, alt: "", className: "h-full w-full object-cover" }) }), _jsxs("span", { className: "block min-w-0 px-2 py-1", children: [_jsx(TruncatedText, { className: "block truncate font-mono text-xs text-text-tertiary", children: item.filename }), fallsBack && (_jsx("span", { className: "mt-1 inline-block rounded-sm bg-warning-100 px-1 text-xs text-warning-800", children: s("picker.fullImage") }))] })] }, item.id));
455
+ }) })), !loading && nextCursor && (_jsx("div", { className: "flex justify-center", children: _jsx(Button, { type: "button", variant: "outline", size: "sm", disabled: loadingMore, onClick: () => void loadMore(), children: loadingMore ? s("picker.loading") : s("picker.loadMore") }) }))] }), pending && (_jsxs("div", { className: "flex shrink-0 items-center gap-3 border-t border-border-default px-4 py-3", children: [_jsx("img", { src: pending.downloadUrl, alt: "", className: "h-12 w-12 shrink-0 rounded-md border border-border-subtle object-cover" }), _jsxs("div", { className: "flex-1", children: [_jsx("label", { htmlFor: "media-picker-alt", className: "mb-1 block text-xs font-medium text-text-secondary", children: s("picker.altLabel") }), _jsx("input", { id: "media-picker-alt", ref: altInputRef, ...altTyping, type: "text", value: altText, onChange: (event) => setAltText(event.target.value), placeholder: s("picker.altPlaceholder"), className: "w-full rounded-md border border-border-default bg-background-elevated px-2 py-1 text-sm text-text-primary focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-600" })] })] })), _jsxs(SheetFooter, { className: "items-center justify-start", children: [_jsx("p", { className: "text-sm text-text-tertiary", children: sdkStringWithNodes(s, "picker.uploadPrompt", {
456
+ action: (_jsx("button", { type: "button", disabled: uploading, onClick: () => uploadInputRef.current?.click(), className: "rounded-md text-primary-600 underline focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-600", children: uploading
457
+ ? s("picker.uploadingInto", { folder: currentFolderName })
458
+ : s("picker.uploadInto", { folder: currentFolderName }) })),
459
+ }) }), _jsx("input", { id: "media-picker-upload", ref: uploadInputRef, type: "file", className: "hidden", accept: acceptAttribute(acceptedTypes), "aria-label": s("picker.uploadIntoAria", { folder: currentFolderName }), disabled: uploading, onChange: (event) => void handleUpload(event) }), _jsx("span", { className: "ms-auto flex gap-2", children: pending ? (_jsxs(_Fragment, { children: [_jsx(Button, { type: "button", variant: "outline", onClick: onClose, children: s("picker.cancel") }), _jsx(Button, { type: "button", onClick: () => onPick({ id: pending.id, downloadUrl: pending.downloadUrl, alt: altText }), children: s("picker.insert") })] })) : (_jsx(Button, { type: "button", variant: "outline", onClick: onClose, children: s("picker.close") })) })] })] }) }));
447
460
  }
@@ -1,3 +1,5 @@
1
+ /** M32 I4 (C3): the codes an upload refusal can carry that the SDK says in its own words. */
2
+ export declare function mediaUploadCodeMessage(code: string, said: () => string): string | undefined;
1
3
  /**
2
4
  * The sentence a failed `POST /api/manage/v1/media` should show. The server's own
3
5
  * message when there is one (every refusal on that route answers with
@@ -9,4 +11,6 @@
9
11
  * own error page or a dropped connection looks like from here, is a
10
12
  * missing message rather than a second failure on top of the first.
11
13
  */
12
- export declare function uploadFailureMessage(response: Response): Promise<string>;
14
+ export declare function uploadFailureMessage(response: Response, fallback?: (status: number) => string,
15
+ /** M32 I4 (C3): the sentence for a refusal's `code` in the host's language, or undefined to show the server's. */
16
+ forCode?: (code: string) => string | undefined): Promise<string>;
@@ -1,3 +1,4 @@
1
+ import { MEDIA_STORE_SWITCHED_OFF_CODE } from "@kardalum/api-schemas";
1
2
  // S234d Task 8: what a failed upload says to the person who started it.
2
3
  //
3
4
  // Both of this package's upload affordances, an image field's own Upload
@@ -11,6 +12,10 @@
11
12
  // same field (the drawer is opened by Choose, a few lines from Upload) and
12
13
  // a person meeting two different sentences for one refusal would have no
13
14
  // way to tell they are the same rule.
15
+ /** M32 I4 (C3): the codes an upload refusal can carry that the SDK says in its own words. */
16
+ export function mediaUploadCodeMessage(code, said) {
17
+ return code === MEDIA_STORE_SWITCHED_OFF_CODE ? said() : undefined;
18
+ }
14
19
  /**
15
20
  * The sentence a failed `POST /api/manage/v1/media` should show. The server's own
16
21
  * message when there is one (every refusal on that route answers with
@@ -22,9 +27,16 @@
22
27
  * own error page or a dropped connection looks like from here, is a
23
28
  * missing message rather than a second failure on top of the first.
24
29
  */
25
- export async function uploadFailureMessage(response) {
30
+ export async function uploadFailureMessage(response, fallback = (status) => `Upload failed (${status})`,
31
+ /** M32 I4 (C3): the sentence for a refusal's `code` in the host's language, or undefined to show the server's. */
32
+ forCode = () => undefined) {
26
33
  const body = (await response.json().catch(() => null));
34
+ if (body && typeof body.code === "string") {
35
+ const said = forCode(body.code);
36
+ if (said !== undefined)
37
+ return said;
38
+ }
27
39
  if (body && typeof body.message === "string" && body.message.length > 0)
28
40
  return body.message;
29
- return `Upload failed (${response.status})`;
41
+ return fallback(response.status);
30
42
  }
@@ -0,0 +1,32 @@
1
+ import type { MediaFileResponse, MediaVisibility } from "@kardalum/api-schemas";
2
+ /** M32 F4c (D10): one file a plugin adds to the media library. `data` is copied once, after the
3
+ * site's upload size setting is read and before anything is sent; leave the array unchanged until
4
+ * the call resolves, and a change after that changes nothing sent. Data over the setting is refused
5
+ * with the route's 413 and never copied. */
6
+ export interface PluginMediaUpload {
7
+ filename: string;
8
+ mimeType: string;
9
+ data: Uint8Array;
10
+ folderId?: string;
11
+ visibility?: MediaVisibility;
12
+ }
13
+ /**
14
+ * M32 F4c (D10): the media library, acting as this plugin within its `contributions.mediaAccess`.
15
+ * `upload` needs `media.create` and `get` needs `media.read`; a call outside the declaration throws
16
+ * MediaAccessRefusedError and sends nothing. An upload meets the same size ceiling, file name check
17
+ * and media type rules as a person's upload, is recorded as uploaded by the system account and
18
+ * raises `media:afterUpload`. `get` reads any file, private ones included; its `downloadUrl` is
19
+ * where the bytes are read. For a private file that `downloadUrl` carries a time-limited token: anyone
20
+ * holding it reads the bytes until it expires, so never pass it to a visitor.
21
+ */
22
+ export interface PluginMediaLibrary {
23
+ upload(input: PluginMediaUpload): Promise<MediaFileResponse>;
24
+ get(id: string): Promise<MediaFileResponse>;
25
+ }
26
+ /** M32 F4c (D10): thrown by context.media when a call falls outside the plugin's mediaAccess. Nothing was sent. */
27
+ export declare class MediaAccessRefusedError extends Error {
28
+ readonly code: "media_access";
29
+ constructor(message: string);
30
+ }
31
+ /** Structural, never instanceof: the plugin's bundle carries its own copy of this class. */
32
+ export declare function isMediaAccessRefusedError(value: unknown): value is MediaAccessRefusedError;
@@ -0,0 +1,15 @@
1
+ /** M32 F4c (D10): thrown by context.media when a call falls outside the plugin's mediaAccess. Nothing was sent. */
2
+ export class MediaAccessRefusedError extends Error {
3
+ code = "media_access";
4
+ constructor(message) {
5
+ super(message);
6
+ this.name = "MediaAccessRefusedError";
7
+ }
8
+ }
9
+ /** Structural, never instanceof: the plugin's bundle carries its own copy of this class. */
10
+ export function isMediaAccessRefusedError(value) {
11
+ if (typeof value !== "object" || value === null)
12
+ return false;
13
+ const candidate = value;
14
+ return candidate.name === "MediaAccessRefusedError" && candidate.code === "media_access";
15
+ }
@@ -0,0 +1,76 @@
1
+ import { type ComponentType, type ReactNode } from "react";
2
+ export interface NestedFieldType {
3
+ dataTypeId: string;
4
+ name: string;
5
+ editorId: string;
6
+ editorName: string;
7
+ /** The editor's defaults already applied to {}. */
8
+ settings: Record<string, unknown>;
9
+ InputView: ComponentType;
10
+ ReadOnlyView: ComponentType | null;
11
+ /**
12
+ * M32 F4d (D16): set when the sub-field's plugin is read-only (its licence lapsed). The
13
+ * sub-field then shows its read-only view and the container shows this note beside it, as a
14
+ * top-level field of that plugin's type does. Optional: a host that leaves it out gets editors.
15
+ */
16
+ readOnlyNote?: string;
17
+ /**
18
+ * M32 F4d (D16): true when a sub-field below this type (at any depth) is read-only while this
19
+ * type itself is not. A Repeatable List of such items keeps them editable but offers no add,
20
+ * move or remove, since the server keeps that list whole on a count change. Default false.
21
+ */
22
+ holdsReadOnly?: boolean;
23
+ /** The read-only sub-field's note, shown once by the list when `holdsReadOnly` is true. */
24
+ holdsReadOnlyNote?: string;
25
+ }
26
+ export interface NestedFieldHost {
27
+ resolve(dataTypeId: string): NestedFieldType | null;
28
+ listDataTypes(): Array<{
29
+ id: string;
30
+ name: string;
31
+ editorId: string;
32
+ }>;
33
+ /**
34
+ * M32 F4d (D16): the editor ids a Group or Repeatable List may hold, the core set plus the
35
+ * attached plugin data types declaring `nestable: true`. Optional: without it the pickers
36
+ * offer the core set (`NESTABLE_EDITOR_IDS`).
37
+ */
38
+ nestableEditorIds?: readonly string[];
39
+ /**
40
+ * M32 I5 (D10): the id of the data type whose settings are being edited, so a Group's settings
41
+ * view can tell whether a Repeatable List repeats it. Optional: unset when creating or outside
42
+ * the data type editor.
43
+ */
44
+ editingDataTypeId?: string;
45
+ /** Wraps a nested view in the host's translate provider and error boundary. */
46
+ Frame: ComponentType<{
47
+ editorId: string;
48
+ editorName: string;
49
+ children: ReactNode;
50
+ }>;
51
+ }
52
+ export declare function NestedFieldHostProvider({ host, children }: {
53
+ host: NestedFieldHost;
54
+ children: ReactNode;
55
+ }): import("react").JSX.Element;
56
+ /** True under a `NestedField` (a view mounted inside a Group or Repeatable List), false elsewhere. */
57
+ export declare function useInsideNestedField(): boolean;
58
+ export declare function useNestedFieldHost(): NestedFieldHost | null;
59
+ /**
60
+ * M32 I2 (A4): whether a data type is rich text, or a Group (at any depth) holding rich text. A
61
+ * Repeatable List may repeat neither, so its item picker leaves them out.
62
+ */
63
+ export declare function holdsRichText(host: NestedFieldHost, dataTypeId: string, seen?: Set<string>): boolean;
64
+ /**
65
+ * M32 I5 (D10): whether a Repeatable List repeats `dataTypeId`: its item is that data type, or a
66
+ * Group at any depth below the item holds it. A visited set keeps a cyclic config linear.
67
+ */
68
+ export declare function repeatedByList(host: NestedFieldHost, dataTypeId: string): boolean;
69
+ /** Whether a picker may offer a data type with this editor inside a Group or Repeatable List. */
70
+ export declare function isNestableEditor(host: NestedFieldHost, editorId: string): boolean;
71
+ export declare function NestedField({ type, value, onChange, readOnly, }: {
72
+ type: NestedFieldType;
73
+ value: unknown;
74
+ onChange: (next: unknown) => void;
75
+ readOnly?: boolean;
76
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,90 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext } from "react";
3
+ import { GROUP_EDITOR_ID, NESTABLE_EDITOR_IDS, REPEATABLE_LIST_EDITOR_ID, RICHTEXT_EDITOR_ID } from "@kardalum/api-schemas";
4
+ import { PluginSettingsProvider, PluginValueProvider } from "./plugin-context.js";
5
+ const NestedFieldHostContext = createContext(null);
6
+ export function NestedFieldHostProvider({ host, children }) {
7
+ return _jsx(NestedFieldHostContext.Provider, { value: host, children: children });
8
+ }
9
+ const InsideNestedFieldContext = createContext(false);
10
+ /** True under a `NestedField` (a view mounted inside a Group or Repeatable List), false elsewhere. */
11
+ export function useInsideNestedField() {
12
+ return useContext(InsideNestedFieldContext);
13
+ }
14
+ export function useNestedFieldHost() {
15
+ return useContext(NestedFieldHostContext);
16
+ }
17
+ /**
18
+ * M32 I2 (A4): whether a data type is rich text, or a Group (at any depth) holding rich text. A
19
+ * Repeatable List may repeat neither, so its item picker leaves them out.
20
+ */
21
+ export function holdsRichText(host, dataTypeId, seen = new Set()) {
22
+ // Each data type is walked once, so a cyclic Group config ends and the walk stays linear.
23
+ if (seen.has(dataTypeId))
24
+ return false;
25
+ seen.add(dataTypeId);
26
+ const type = host.resolve(dataTypeId);
27
+ if (!type)
28
+ return false;
29
+ if (type.editorId === RICHTEXT_EDITOR_ID)
30
+ return true;
31
+ if (type.editorId !== GROUP_EDITOR_ID)
32
+ return false;
33
+ const fields = type.settings.fields;
34
+ if (!Array.isArray(fields))
35
+ return false;
36
+ return fields.some((f) => {
37
+ const id = typeof f === "object" && f !== null ? f.dataTypeId : null;
38
+ return typeof id === "string" && holdsRichText(host, id, seen);
39
+ });
40
+ }
41
+ function subFieldIds(settings) {
42
+ const fields = settings.fields;
43
+ if (!Array.isArray(fields))
44
+ return [];
45
+ const ids = [];
46
+ for (const f of fields) {
47
+ const id = typeof f === "object" && f !== null ? f.dataTypeId : null;
48
+ if (typeof id === "string")
49
+ ids.push(id.toLowerCase());
50
+ }
51
+ return ids;
52
+ }
53
+ function reaches(host, fromId, targetId, seen) {
54
+ if (fromId === targetId)
55
+ return true;
56
+ if (seen.has(fromId))
57
+ return false;
58
+ seen.add(fromId);
59
+ const type = host.resolve(fromId);
60
+ if (!type || type.editorId !== GROUP_EDITOR_ID)
61
+ return false;
62
+ return subFieldIds(type.settings).some((id) => reaches(host, id, targetId, seen));
63
+ }
64
+ /**
65
+ * M32 I5 (D10): whether a Repeatable List repeats `dataTypeId`: its item is that data type, or a
66
+ * Group at any depth below the item holds it. A visited set keeps a cyclic config linear.
67
+ */
68
+ export function repeatedByList(host, dataTypeId) {
69
+ const target = dataTypeId.toLowerCase();
70
+ const seen = new Set();
71
+ for (const d of host.listDataTypes()) {
72
+ if (d.editorId !== REPEATABLE_LIST_EDITOR_ID)
73
+ continue;
74
+ const itemId = host.resolve(d.id)?.settings.itemDataTypeId;
75
+ if (typeof itemId === "string" && reaches(host, itemId.toLowerCase(), target, seen))
76
+ return true;
77
+ }
78
+ return false;
79
+ }
80
+ /** Whether a picker may offer a data type with this editor inside a Group or Repeatable List. */
81
+ export function isNestableEditor(host, editorId) {
82
+ return host.nestableEditorIds ? host.nestableEditorIds.includes(editorId) : NESTABLE_EDITOR_IDS.has(editorId);
83
+ }
84
+ export function NestedField({ type, value, onChange, readOnly, }) {
85
+ const host = useNestedFieldHost();
86
+ if (!host)
87
+ return null;
88
+ const { Frame } = host;
89
+ return (_jsx(InsideNestedFieldContext.Provider, { value: true, children: _jsx(PluginValueProvider, { value: value, onChange: onChange, children: _jsx(PluginSettingsProvider, { settings: type.settings, children: _jsx(Frame, { editorId: type.editorId, editorName: type.editorName, children: readOnly || type.readOnlyNote ? (type.ReadOnlyView ? (_jsx(type.ReadOnlyView, {})) : (_jsx("pre", { children: JSON.stringify(value ?? null, null, 2) }))) : (_jsx(type.InputView, {})) }) }) }) }));
90
+ }
package/dist/notify.d.ts CHANGED
@@ -1,13 +1,21 @@
1
- import type { SendNotificationRequestInput } from "@kardalum/api-schemas";
2
- /** What `context.notify` takes: `to` (actions, roles, people), a title, an optional text and link. */
3
- export type PluginNotifyInput = SendNotificationRequestInput;
1
+ import type { PluginNotifyRequestInput } from "@kardalum/api-schemas";
2
+ /**
3
+ * What `context.notify` takes: the `kind` id, a title, an optional text and link. M33 K6: the
4
+ * link may also open one of the plugin's own admin screens at a row, named by its ids, never by
5
+ * an address: `{ kind: "screen", section, entry?, item? }` for its own section (and a rail entry
6
+ * of it), or `{ kind: "screen", builtIn, entry, item? }` for its entry in a built-in section's
7
+ * rail. `item` is 1 to 100 letters, digits, "-" and "_"; the screen reads it as
8
+ * `usePluginScreen().item`. A screen the plugin does not declare, or another item, is refused
9
+ * with `unknownTarget`. A reader who may not open the screen sees the notification without it.
10
+ */
11
+ export type PluginNotifyInput = PluginNotifyRequestInput;
4
12
  export interface PluginNotifyResult {
5
13
  /** How many people it reached. */
6
14
  recipients: number;
7
15
  }
8
16
  export type PluginNotify = (input: PluginNotifyInput) => Promise<PluginNotifyResult>;
9
17
  /** Why a send was refused. */
10
- export declare const NOTIFICATION_REFUSAL_REASONS: readonly ["invalid", "unknownTarget", "nobody", "overLimit", "rateLimited", "inactive"];
18
+ export declare const NOTIFICATION_REFUSAL_REASONS: readonly ["invalid", "unknownKind", "unknownTarget", "nobody", "overLimit", "rateLimited", "inactive"];
11
19
  export type NotificationRefusalReason = (typeof NOTIFICATION_REFUSAL_REASONS)[number];
12
20
  export declare class NotificationRefusedError extends Error {
13
21
  readonly reason: NotificationRefusalReason;
package/dist/notify.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /** Why a send was refused. */
2
- export const NOTIFICATION_REFUSAL_REASONS = ["invalid", "unknownTarget", "nobody", "overLimit", "rateLimited", "inactive"];
2
+ export const NOTIFICATION_REFUSAL_REASONS = ["invalid", "unknownKind", "unknownTarget", "nobody", "overLimit", "rateLimited", "inactive"];
3
3
  export class NotificationRefusedError extends Error {
4
4
  reason;
5
5
  constructor(reason, message) {
@@ -0,0 +1,47 @@
1
+ import type { OutboundAddressRefusal, OutboundCheckRefusal, OutboundErrorKind, OutboundMethod, PluginOutboundRequests } from "@kardalum/api-schemas";
2
+ export type { OutboundAddressRefusal, OutboundCheckRefusal, OutboundErrorKind, OutboundMethod };
3
+ /** `contributions.outboundRequests`: the reason shown at install and the methods the plugin calls with. */
4
+ export type OutboundRequestsContribution = PluginOutboundRequests;
5
+ /** What `check` answers: the checked form of the address (its fragment dropped), or why it is
6
+ * refused: an address refusal, `busy` (more than OUTBOUND_CHECK_IN_FLIGHT_MAX of the plugin's checks
7
+ * at once, or the server's lookups are full) or `inactive` (the plugin is no longer active). */
8
+ export type OutboundCheckResult = {
9
+ ok: true;
10
+ url: string;
11
+ } | {
12
+ ok: false;
13
+ reason: OutboundCheckRefusal;
14
+ };
15
+ export interface OutboundInit {
16
+ /** One of the methods the manifest declares; another is refused as `method`. */
17
+ method: string;
18
+ /** At most 30; a value at most 8,192 characters with no CR, LF or NUL. `host`, `connection`,
19
+ * `content-length`, `transfer-encoding`, `te`, `upgrade`, `keep-alive`, `expect`, `trailer` and
20
+ * `proxy-*` are refused (`header`). */
21
+ headers?: Record<string, string>;
22
+ /** At most 1,048,576 bytes (`tooLarge`). */
23
+ body?: string | Uint8Array;
24
+ /** The whole exchange, body included: 10,000 when not given, at most 30,000. */
25
+ timeoutMs?: number;
26
+ /** The body read: 65,536 when not given, at most 1,048,576; past it the body is cut and `truncated` is true. */
27
+ maxResponseBytes?: number;
28
+ /** Redirects followed: 0 when not given, at most 3. Each hop is checked like the first address. */
29
+ redirects?: number;
30
+ signal?: AbortSignal;
31
+ }
32
+ export interface OutboundResponse {
33
+ status: number;
34
+ headers: Record<string, string>;
35
+ body: Uint8Array;
36
+ /** The body was longer than `maxResponseBytes` and was cut there. */
37
+ truncated: boolean;
38
+ /** The address that answered, after any redirect followed. */
39
+ url: string;
40
+ durationMs: number;
41
+ }
42
+ export interface PluginOutbound {
43
+ /** Checks an address as `request` would, without calling it. Never throws. */
44
+ check(url: string): Promise<OutboundCheckResult>;
45
+ /** Calls an address through the checked connection. A 3xx not followed is answered as the response. */
46
+ request(url: string, init: OutboundInit): Promise<OutboundResponse>;
47
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -65,13 +65,18 @@ export interface ContentHostPage {
65
65
  * fields while no content is open). A view checks `page` once instead of
66
66
  * an id and two callbacks separately, and no state can spell "a page with
67
67
  * no way to open a row".
68
+ *
69
+ * `culture` is the culture being edited (M32 I2, A7); the content picker
70
+ * reads page names in it when it is set.
68
71
  */
69
72
  export type ContentHost = {
70
73
  page: null;
71
74
  documentTypes?: ContentHostDocumentType[];
75
+ culture?: string;
72
76
  } | {
73
77
  page: ContentHostPage;
74
78
  documentTypes?: ContentHostDocumentType[];
79
+ culture?: string;
75
80
  };
76
81
  interface ContentHostProviderProps {
77
82
  host: ContentHost;