@kardalum/plugin-sdk 0.20.0 → 0.21.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 (323) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/dist/admin-section-registry.d.ts +33 -1
  3. package/dist/admin-section-registry.js +67 -0
  4. package/dist/capabilities.js +46 -1
  5. package/dist/consent-entry.d.ts +11 -0
  6. package/dist/consent-entry.js +18 -0
  7. package/dist/content-library.d.ts +17 -0
  8. package/dist/content-list-extensions.d.ts +50 -0
  9. package/dist/content-list-extensions.js +11 -0
  10. package/dist/content-picker/page-picker-sheet.d.ts +2 -0
  11. package/dist/content-picker/page-picker-sheet.js +1 -1
  12. package/dist/content-picker/page-picker.d.ts +18 -0
  13. package/dist/content-picker/page-picker.js +20 -0
  14. package/dist/datatype-validation.js +10 -2
  15. package/dist/datatypes-entry.d.ts +1 -0
  16. package/dist/datatypes-entry.js +2 -0
  17. package/dist/entitlement-types.d.ts +18 -1
  18. package/dist/host-entry.d.ts +7 -1
  19. package/dist/host-entry.js +14 -1
  20. package/dist/index.d.ts +35 -7
  21. package/dist/index.js +46 -5
  22. package/dist/mail.d.ts +6 -2
  23. package/dist/manifest-entry.d.ts +22 -4
  24. package/dist/manifest-entry.js +25 -1
  25. package/dist/manifest-schema.d.ts +570 -31
  26. package/dist/manifest-schema.js +240 -12
  27. package/dist/manifest.d.ts +757 -32
  28. package/dist/manifest.js +8 -4
  29. package/dist/plugin-context.d.ts +47 -0
  30. package/dist/plugin-context.js +27 -0
  31. package/dist/plugin-permissions.d.ts +18 -0
  32. package/dist/plugin-permissions.js +25 -0
  33. package/dist/plugin-screen-context.d.ts +152 -11
  34. package/dist/plugin-screen-context.js +30 -0
  35. package/dist/providers.d.ts +47 -2
  36. package/dist/render-page.d.ts +15 -0
  37. package/dist/render-page.js +20 -0
  38. package/dist/richtext/block-panel.d.ts +12 -1
  39. package/dist/richtext/block-panel.js +27 -21
  40. package/dist/richtext/button-view.d.ts +11 -0
  41. package/dist/richtext/button-view.js +45 -0
  42. package/dist/richtext/content-guard.d.ts +4 -0
  43. package/dist/richtext/content-guard.js +27 -0
  44. package/dist/richtext/editor-handle.d.ts +34 -0
  45. package/dist/richtext/editor-handle.js +225 -0
  46. package/dist/richtext/extensions.d.ts +6 -0
  47. package/dist/richtext/extensions.js +16 -0
  48. package/dist/richtext/insert-menu.d.ts +6 -1
  49. package/dist/richtext/insert-menu.js +38 -18
  50. package/dist/richtext/item-attributes.d.ts +6 -0
  51. package/dist/richtext/item-attributes.js +19 -0
  52. package/dist/richtext/item-panel.d.ts +25 -0
  53. package/dist/richtext/item-panel.js +118 -0
  54. package/dist/richtext/item-view.d.ts +58 -0
  55. package/dist/richtext/item-view.js +172 -0
  56. package/dist/richtext/mark-form.d.ts +10 -0
  57. package/dist/richtext/mark-form.js +38 -0
  58. package/dist/richtext/paste-choice.d.ts +9 -0
  59. package/dist/richtext/paste-choice.js +13 -0
  60. package/dist/richtext/plugin-items.d.ts +72 -0
  61. package/dist/richtext/plugin-items.js +562 -0
  62. package/dist/richtext/plugin-mark-tooltips.d.ts +5 -0
  63. package/dist/richtext/plugin-mark-tooltips.js +44 -0
  64. package/dist/richtext/plugin-toolbar.d.ts +57 -0
  65. package/dist/richtext/plugin-toolbar.js +186 -0
  66. package/dist/richtext/rich-item-icons.d.ts +5 -0
  67. package/dist/richtext/rich-item-icons.js +42 -0
  68. package/dist/richtext/rich-items.d.ts +42 -0
  69. package/dist/richtext/rich-items.js +68 -0
  70. package/dist/richtext/rich-text-view-host.d.ts +24 -0
  71. package/dist/richtext/rich-text-view-host.js +11 -0
  72. package/dist/richtext/toolbar-button.d.ts +16 -0
  73. package/dist/richtext/toolbar-button.js +9 -0
  74. package/dist/richtext/url-paste.d.ts +20 -0
  75. package/dist/richtext/url-paste.js +82 -0
  76. package/dist/richtext-html-entry.d.ts +5 -0
  77. package/dist/richtext-html-entry.js +11 -0
  78. package/dist/sdk-strings.d.ts +59 -0
  79. package/dist/sdk-strings.js +64 -0
  80. package/dist/service-contract.d.ts +17 -0
  81. package/dist/service-contract.js +39 -0
  82. package/dist/services.d.ts +114 -0
  83. package/dist/services.js +1 -0
  84. package/dist/structured-storage-types.d.ts +124 -4
  85. package/dist/tailwind.js +10 -5
  86. package/dist/template-reads.d.ts +16 -0
  87. package/dist/template-reads.js +21 -0
  88. package/dist/testing-entry.d.ts +38 -0
  89. package/dist/testing-entry.js +173 -0
  90. package/dist/text-entry.d.ts +1 -1
  91. package/dist/text-entry.js +3 -2
  92. package/dist/tokens/system-dark.css +1 -0
  93. package/dist/tokens/tailwind-theme.css +2 -0
  94. package/dist/tokens/tokens.css +4 -0
  95. package/dist/tokens/tokens.json +5 -1
  96. package/dist/uploads.d.ts +43 -0
  97. package/dist/uploads.js +1 -0
  98. package/dist/user-library.d.ts +51 -0
  99. package/dist/user-library.js +15 -0
  100. package/dist/view-helpers.d.ts +18 -0
  101. package/dist/view-helpers.js +64 -0
  102. package/dist/views/content-list-view.js +207 -8
  103. package/dist/views/content-picker-view.js +1 -1
  104. package/dist/views/rich-text-view.d.ts +2 -0
  105. package/dist/views/rich-text-view.js +182 -24
  106. package/dist/views/unreadable-rich-text.d.ts +17 -0
  107. package/dist/views/unreadable-rich-text.js +40 -0
  108. package/dist/visitors.d.ts +81 -0
  109. package/dist/visitors.js +1 -0
  110. package/node_modules/@kardalum/api-schemas/dist/ai-app-hosts.d.ts +21 -0
  111. package/node_modules/@kardalum/api-schemas/dist/ai-app-hosts.js +39 -0
  112. package/node_modules/@kardalum/api-schemas/dist/ai-app-redirects.d.ts +2 -0
  113. package/node_modules/@kardalum/api-schemas/dist/ai-app-redirects.js +31 -0
  114. package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.d.ts +127 -8
  115. package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.js +82 -7
  116. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +5 -1
  117. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +2 -2
  118. package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.d.ts +7 -0
  119. package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.js +11 -0
  120. package/node_modules/@kardalum/api-schemas/dist/capability-detail.d.ts +1 -1
  121. package/node_modules/@kardalum/api-schemas/dist/capability-detail.js +18 -0
  122. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +80 -0
  123. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +41 -2
  124. package/node_modules/@kardalum/api-schemas/dist/content-reads.schema.d.ts +213 -0
  125. package/node_modules/@kardalum/api-schemas/dist/content-reads.schema.js +234 -0
  126. package/node_modules/@kardalum/api-schemas/dist/contribution-issues.d.ts +11 -0
  127. package/node_modules/@kardalum/api-schemas/dist/contribution-issues.js +14 -0
  128. package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +50 -13
  129. package/node_modules/@kardalum/api-schemas/dist/core-actions.js +19 -10
  130. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +77 -0
  131. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +37 -0
  132. package/node_modules/@kardalum/api-schemas/dist/experimental-points.d.ts +19 -0
  133. package/node_modules/@kardalum/api-schemas/dist/experimental-points.js +250 -0
  134. package/node_modules/@kardalum/api-schemas/dist/form-protection-callers.d.ts +29 -0
  135. package/node_modules/@kardalum/api-schemas/dist/form-protection-callers.js +31 -0
  136. package/node_modules/@kardalum/api-schemas/dist/html-scan.d.ts +22 -0
  137. package/node_modules/@kardalum/api-schemas/dist/html-scan.js +122 -0
  138. package/node_modules/@kardalum/api-schemas/dist/html-start-tags.d.ts +48 -0
  139. package/node_modules/@kardalum/api-schemas/dist/html-start-tags.js +381 -0
  140. package/node_modules/@kardalum/api-schemas/dist/index.d.ts +52 -14
  141. package/node_modules/@kardalum/api-schemas/dist/index.js +53 -9
  142. package/node_modules/@kardalum/api-schemas/dist/json-depth.d.ts +3 -0
  143. package/node_modules/@kardalum/api-schemas/dist/json-depth.js +20 -0
  144. package/node_modules/@kardalum/api-schemas/dist/mail-rules.d.ts +4 -2
  145. package/node_modules/@kardalum/api-schemas/dist/mail-rules.js +6 -1
  146. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +178 -2
  147. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +10 -0
  148. package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.d.ts +3 -3
  149. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +16 -0
  150. package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +4 -0
  151. package/node_modules/@kardalum/api-schemas/dist/media.schema.js +4 -0
  152. package/node_modules/@kardalum/api-schemas/dist/nested-validation.d.ts +7 -0
  153. package/node_modules/@kardalum/api-schemas/dist/nested-validation.js +51 -2
  154. package/node_modules/@kardalum/api-schemas/dist/page-audience.schema.d.ts +87 -0
  155. package/node_modules/@kardalum/api-schemas/dist/page-audience.schema.js +44 -0
  156. package/node_modules/@kardalum/api-schemas/dist/plugin-admin-slots.d.ts +11 -0
  157. package/node_modules/@kardalum/api-schemas/dist/plugin-admin-slots.js +61 -0
  158. package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.d.ts +4 -2
  159. package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.js +12 -2
  160. package/node_modules/@kardalum/api-schemas/dist/plugin-content-slots.d.ts +136 -0
  161. package/node_modules/@kardalum/api-schemas/dist/plugin-content-slots.js +254 -0
  162. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-checks.d.ts +22 -0
  163. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-checks.js +66 -0
  164. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-document.d.ts +130 -0
  165. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-document.js +173 -0
  166. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-fetch.d.ts +16 -0
  167. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-fetch.js +112 -0
  168. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-schema.d.ts +70 -0
  169. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-schema.js +380 -0
  170. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-types.d.ts +3 -0
  171. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-types.js +68 -0
  172. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +18 -0
  173. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +18 -0
  174. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +5 -2
  175. package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.d.ts +10 -2
  176. package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.js +48 -1
  177. package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.d.ts +5 -2
  178. package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.js +6 -4
  179. package/node_modules/@kardalum/api-schemas/dist/plugin-events.d.ts +24 -0
  180. package/node_modules/@kardalum/api-schemas/dist/plugin-events.js +53 -0
  181. package/node_modules/@kardalum/api-schemas/dist/plugin-guards.d.ts +112 -0
  182. package/node_modules/@kardalum/api-schemas/dist/plugin-guards.js +118 -0
  183. package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.d.ts +12 -0
  184. package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.js +3 -0
  185. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +2 -0
  186. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +3 -0
  187. package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +67 -0
  188. package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +15 -0
  189. package/node_modules/@kardalum/api-schemas/dist/plugin-kept-parts.d.ts +138 -0
  190. package/node_modules/@kardalum/api-schemas/dist/plugin-kept-parts.js +110 -0
  191. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +80 -15
  192. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +67 -23
  193. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +10 -3
  194. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +33 -8
  195. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +2 -1
  196. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +7 -1
  197. package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.d.ts +1 -1
  198. package/node_modules/@kardalum/api-schemas/dist/plugin-providers.d.ts +43 -7
  199. package/node_modules/@kardalum/api-schemas/dist/plugin-providers.js +36 -5
  200. package/node_modules/@kardalum/api-schemas/dist/plugin-rich-text.d.ts +638 -0
  201. package/node_modules/@kardalum/api-schemas/dist/plugin-rich-text.js +533 -0
  202. package/node_modules/@kardalum/api-schemas/dist/plugin-service-call.d.ts +36 -0
  203. package/node_modules/@kardalum/api-schemas/dist/plugin-service-call.js +32 -0
  204. package/node_modules/@kardalum/api-schemas/dist/plugin-service-connections.d.ts +193 -0
  205. package/node_modules/@kardalum/api-schemas/dist/plugin-service-connections.js +123 -0
  206. package/node_modules/@kardalum/api-schemas/dist/plugin-service-declarations.d.ts +209 -0
  207. package/node_modules/@kardalum/api-schemas/dist/plugin-service-declarations.js +372 -0
  208. package/node_modules/@kardalum/api-schemas/dist/plugin-services.d.ts +90 -0
  209. package/node_modules/@kardalum/api-schemas/dist/plugin-services.js +204 -0
  210. package/node_modules/@kardalum/api-schemas/dist/plugin-settings.d.ts +10 -0
  211. package/node_modules/@kardalum/api-schemas/dist/plugin-settings.js +10 -1
  212. package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.d.ts +171 -4
  213. package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.js +406 -42
  214. package/node_modules/@kardalum/api-schemas/dist/plugin-site-requests.d.ts +69 -0
  215. package/node_modules/@kardalum/api-schemas/dist/plugin-site-requests.js +149 -0
  216. package/node_modules/@kardalum/api-schemas/dist/plugin-styles.d.ts +5 -0
  217. package/node_modules/@kardalum/api-schemas/dist/plugin-styles.js +13 -0
  218. package/node_modules/@kardalum/api-schemas/dist/plugin-uploads.d.ts +96 -0
  219. package/node_modules/@kardalum/api-schemas/dist/plugin-uploads.js +185 -0
  220. package/node_modules/@kardalum/api-schemas/dist/plugin-user-accounts.d.ts +213 -0
  221. package/node_modules/@kardalum/api-schemas/dist/plugin-user-accounts.js +131 -0
  222. package/node_modules/@kardalum/api-schemas/dist/plugin-view-kit.d.ts +54 -0
  223. package/node_modules/@kardalum/api-schemas/dist/plugin-view-kit.js +154 -0
  224. package/node_modules/@kardalum/api-schemas/dist/plugin-visitor-points.d.ts +37 -0
  225. package/node_modules/@kardalum/api-schemas/dist/plugin-visitor-points.js +124 -0
  226. package/node_modules/@kardalum/api-schemas/dist/render-cache.d.ts +126 -0
  227. package/node_modules/@kardalum/api-schemas/dist/render-cache.js +263 -0
  228. package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +303 -0
  229. package/node_modules/@kardalum/api-schemas/dist/render-editing.js +61 -0
  230. package/node_modules/@kardalum/api-schemas/dist/rich-text-paste-hosts.d.ts +14 -0
  231. package/node_modules/@kardalum/api-schemas/dist/rich-text-paste-hosts.js +108 -0
  232. package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.d.ts +66 -1
  233. package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.js +465 -7
  234. package/node_modules/@kardalum/api-schemas/dist/rich-text-text.js +15 -118
  235. package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +110 -0
  236. package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.js +36 -0
  237. package/node_modules/@kardalum/api-schemas/dist/security-overview.schema.d.ts +64 -0
  238. package/node_modules/@kardalum/api-schemas/dist/security-overview.schema.js +38 -0
  239. package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.d.ts +9 -2
  240. package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +7 -2
  241. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +26 -0
  242. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +19 -0
  243. package/node_modules/@kardalum/api-schemas/dist/sign-in-steps.d.ts +724 -0
  244. package/node_modules/@kardalum/api-schemas/dist/sign-in-steps.js +408 -0
  245. package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.d.ts +5 -3
  246. package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.js +3 -1
  247. package/node_modules/@kardalum/api-schemas/dist/site-consent.d.ts +77 -0
  248. package/node_modules/@kardalum/api-schemas/dist/site-consent.js +122 -0
  249. package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.d.ts +4 -0
  250. package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.js +28 -0
  251. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +33 -0
  252. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +26 -1
  253. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +14 -0
  254. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +2 -0
  255. package/node_modules/@kardalum/api-schemas/dist/visitor-accounts.d.ts +482 -0
  256. package/node_modules/@kardalum/api-schemas/dist/visitor-accounts.js +380 -0
  257. package/node_modules/@kardalum/api-schemas/dist/visitor-groups.d.ts +109 -0
  258. package/node_modules/@kardalum/api-schemas/dist/visitor-groups.js +62 -0
  259. package/node_modules/@kardalum/api-schemas/package.json +1 -0
  260. package/node_modules/@kardalum/design-tokens/dist/build-css.js +9 -1
  261. package/node_modules/@kardalum/design-tokens/dist/system-dark.css +1 -0
  262. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +2 -0
  263. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -0
  264. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +2 -0
  265. package/node_modules/@kardalum/design-tokens/dist/tokens.css +4 -0
  266. package/node_modules/@kardalum/design-tokens/dist/tokens.js +6 -0
  267. package/node_modules/@kardalum/design-tokens/dist/tokens.json +5 -1
  268. package/node_modules/@kardalum/design-tokens/dist/types.d.ts +4 -0
  269. package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +17 -0
  270. package/node_modules/@kardalum/plugin-package/dist/build-reference.js +9 -0
  271. package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +1 -1
  272. package/node_modules/@kardalum/plugin-package/dist/capabilities.js +276 -19
  273. package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +1 -1
  274. package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +23 -0
  275. package/node_modules/@kardalum/plugin-package/dist/contract-fingerprint.d.ts +17 -0
  276. package/node_modules/@kardalum/plugin-package/dist/contract-fingerprint.js +39 -0
  277. package/node_modules/@kardalum/plugin-package/dist/delivery/admin-styles.d.ts +23 -0
  278. package/node_modules/@kardalum/plugin-package/dist/delivery/admin-styles.js +351 -0
  279. package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.d.ts +2 -0
  280. package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.js +1 -1
  281. package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.js +21 -8
  282. package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +1 -1
  283. package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.js +23 -10
  284. package/node_modules/@kardalum/plugin-package/dist/delivery/icons.js +3 -2
  285. package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +2 -0
  286. package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +2 -0
  287. package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +30 -2
  288. package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.js +6 -2
  289. package/node_modules/@kardalum/plugin-package/dist/delivery/limits.d.ts +6 -0
  290. package/node_modules/@kardalum/plugin-package/dist/delivery/limits.js +6 -0
  291. package/node_modules/@kardalum/plugin-package/dist/delivery/providers.d.ts +2 -0
  292. package/node_modules/@kardalum/plugin-package/dist/delivery/providers.js +24 -6
  293. package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +15 -0
  294. package/node_modules/@kardalum/plugin-package/dist/delivery/rich-text.d.ts +2 -0
  295. package/node_modules/@kardalum/plugin-package/dist/delivery/rich-text.js +173 -0
  296. package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +1 -1
  297. package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.js +14 -4
  298. package/node_modules/@kardalum/plugin-package/dist/delivery/services-events.d.ts +3 -0
  299. package/node_modules/@kardalum/plugin-package/dist/delivery/services-events.js +35 -0
  300. package/node_modules/@kardalum/plugin-package/dist/delivery/sign-in-steps.d.ts +3 -0
  301. package/node_modules/@kardalum/plugin-package/dist/delivery/sign-in-steps.js +71 -0
  302. package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.js +44 -11
  303. package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +7 -0
  304. package/node_modules/@kardalum/plugin-package/dist/delivery/user-accounts.d.ts +3 -0
  305. package/node_modules/@kardalum/plugin-package/dist/delivery/user-accounts.js +36 -0
  306. package/node_modules/@kardalum/plugin-package/dist/delivery/visitor-points.d.ts +3 -0
  307. package/node_modules/@kardalum/plugin-package/dist/delivery/visitor-points.js +33 -0
  308. package/node_modules/@kardalum/plugin-package/dist/index.d.ts +4 -0
  309. package/node_modules/@kardalum/plugin-package/dist/index.js +5 -0
  310. package/node_modules/@kardalum/plugin-package/dist/public-suffix.d.ts +7 -0
  311. package/node_modules/@kardalum/plugin-package/dist/public-suffix.js +23 -0
  312. package/node_modules/@kardalum/plugin-package/dist/rich-text-summary.d.ts +1 -0
  313. package/node_modules/@kardalum/plugin-package/dist/rich-text-summary.js +27 -0
  314. package/node_modules/@kardalum/plugin-package/dist/stylesheet-load-hook.d.ts +2 -0
  315. package/node_modules/@kardalum/plugin-package/dist/stylesheet-load-hook.js +28 -0
  316. package/node_modules/@kardalum/plugin-package/package.json +4 -0
  317. package/node_modules/@kardalum/ui/dist/components/select.d.ts +6 -0
  318. package/node_modules/@kardalum/ui/dist/components/select.js +7 -0
  319. package/node_modules/@kardalum/ui/dist/components/textarea.d.ts +6 -0
  320. package/node_modules/@kardalum/ui/dist/components/textarea.js +7 -0
  321. package/node_modules/@kardalum/ui/dist/index.d.ts +2 -0
  322. package/node_modules/@kardalum/ui/dist/index.js +2 -0
  323. package/package.json +15 -3
@@ -6,10 +6,10 @@ export declare const McpPluginToolSchema: z.ZodObject<{
6
6
  description: z.ZodString;
7
7
  inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
8
8
  method: z.ZodEnum<{
9
- GET: "GET";
10
9
  POST: "POST";
11
10
  PUT: "PUT";
12
11
  PATCH: "PATCH";
12
+ GET: "GET";
13
13
  DELETE: "DELETE";
14
14
  }>;
15
15
  path: z.ZodString;
@@ -31,10 +31,10 @@ export declare const McpPluginEntrySchema: z.ZodObject<{
31
31
  description: z.ZodString;
32
32
  inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
33
33
  method: z.ZodEnum<{
34
- GET: "GET";
35
34
  POST: "POST";
36
35
  PUT: "PUT";
37
36
  PATCH: "PATCH";
37
+ GET: "GET";
38
38
  DELETE: "DELETE";
39
39
  }>;
40
40
  path: z.ZodString;
@@ -58,10 +58,10 @@ export declare const McpPluginsResponseSchema: z.ZodObject<{
58
58
  description: z.ZodString;
59
59
  inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
60
60
  method: z.ZodEnum<{
61
- GET: "GET";
62
61
  POST: "POST";
63
62
  PUT: "PUT";
64
63
  PATCH: "PATCH";
64
+ GET: "GET";
65
65
  DELETE: "DELETE";
66
66
  }>;
67
67
  path: z.ZodString;
@@ -39,6 +39,10 @@ export declare const MediaFileResponseSchema: z.ZodObject<{
39
39
  folderId: z.ZodNullable<z.ZodString>;
40
40
  uploadedBy: z.ZodString;
41
41
  uploadedAt: z.ZodString;
42
+ visitorUpload: z.ZodOptional<z.ZodNullable<z.ZodObject<{
43
+ pluginId: z.ZodString;
44
+ signedIn: z.ZodBoolean;
45
+ }, z.core.$strip>>>;
42
46
  documentTypeId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
43
47
  data: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<Record<string, unknown>, Record<string, unknown> | null | undefined>>;
44
48
  currentVersion: z.ZodDefault<z.ZodNumber>;
@@ -61,6 +65,10 @@ export declare const MediaItemSaveResponseSchema: z.ZodObject<{
61
65
  folderId: z.ZodNullable<z.ZodString>;
62
66
  uploadedBy: z.ZodString;
63
67
  uploadedAt: z.ZodString;
68
+ visitorUpload: z.ZodOptional<z.ZodNullable<z.ZodObject<{
69
+ pluginId: z.ZodString;
70
+ signedIn: z.ZodBoolean;
71
+ }, z.core.$strip>>>;
64
72
  documentTypeId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
65
73
  data: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<Record<string, unknown>, Record<string, unknown> | null | undefined>>;
66
74
  currentVersion: z.ZodDefault<z.ZodNumber>;
@@ -115,6 +123,10 @@ export declare const MediaListResponseSchema: z.ZodObject<{
115
123
  folderId: z.ZodNullable<z.ZodString>;
116
124
  uploadedBy: z.ZodString;
117
125
  uploadedAt: z.ZodString;
126
+ visitorUpload: z.ZodOptional<z.ZodNullable<z.ZodObject<{
127
+ pluginId: z.ZodString;
128
+ signedIn: z.ZodBoolean;
129
+ }, z.core.$strip>>>;
118
130
  documentTypeId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
119
131
  data: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<Record<string, unknown>, Record<string, unknown> | null | undefined>>;
120
132
  currentVersion: z.ZodDefault<z.ZodNumber>;
@@ -185,6 +197,10 @@ export declare const MediaTrashListResponseSchema: z.ZodObject<{
185
197
  folderId: z.ZodNullable<z.ZodString>;
186
198
  uploadedBy: z.ZodString;
187
199
  uploadedAt: z.ZodString;
200
+ visitorUpload: z.ZodOptional<z.ZodNullable<z.ZodObject<{
201
+ pluginId: z.ZodString;
202
+ signedIn: z.ZodBoolean;
203
+ }, z.core.$strip>>>;
188
204
  documentTypeId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
189
205
  data: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<Record<string, unknown>, Record<string, unknown> | null | undefined>>;
190
206
  currentVersion: z.ZodDefault<z.ZodNumber>;
@@ -17,6 +17,10 @@ export declare const MediaFileSchema: z.ZodObject<{
17
17
  folderId: z.ZodNullable<z.ZodString>;
18
18
  uploadedBy: z.ZodString;
19
19
  uploadedAt: z.ZodString;
20
+ visitorUpload: z.ZodOptional<z.ZodNullable<z.ZodObject<{
21
+ pluginId: z.ZodString;
22
+ signedIn: z.ZodBoolean;
23
+ }, z.core.$strip>>>;
20
24
  documentTypeId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
21
25
  data: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<Record<string, unknown>, Record<string, unknown> | null | undefined>>;
22
26
  currentVersion: z.ZodDefault<z.ZodNumber>;
@@ -25,6 +25,10 @@ export const MediaFileSchema = z.object({
25
25
  folderId: z.string().uuid().nullable(),
26
26
  uploadedBy: z.string().uuid(),
27
27
  uploadedAt: z.string().datetime(),
28
+ // M35 B3 (W17, experimental): who sent the file when a site visitor did, through which plugin. Set by
29
+ // GET /media/:id only, so the item screen can say so, and left out there for a plugin subject; every other
30
+ // answer leaves it out.
31
+ visitorUpload: z.object({ pluginId: z.string(), signedIn: z.boolean() }).nullable().optional(),
28
32
  // S234a: the media document type this item is, and that type's field
29
33
  // values. Null and empty for rows written before media had types, which
30
34
  // the upgrade backfills. The reference is by id with no foreign key:
@@ -41,6 +41,13 @@ export declare function removePickedPages(tree: DataTypeTree, value: unknown, dr
41
41
  removed: number;
42
42
  untyped: number;
43
43
  };
44
+ /**
45
+ * M35 C1 (D2): the value with every content picker entry that names a page (a uuid string)
46
+ * lowercased, at every level of a Group or Repeatable list, so a write stores the form readPickedIds
47
+ * reads and a published query's `has` compares bytewise. Any other entry or shape is kept as sent,
48
+ * for the validator to judge. Copy-on-write: the answer is `value` itself when nothing changed.
49
+ */
50
+ export declare function lowercasePickedIds(tree: DataTypeTree | null, value: unknown): unknown;
44
51
  /**
45
52
  * Every page id a stored value picks or links to, lowercased, walking every list item and every
46
53
  * picker entry with no cap (`pickedPagesInValue` stops where the validator's limits do). The copy
@@ -228,8 +228,9 @@ export function removePickedPages(tree, value, drop, options) {
228
228
  return copy ? copy.filter((item) => item !== undefined) : v;
229
229
  }
230
230
  if (node.editorId === CONTENT_PICKER_EDITOR_ID) {
231
- // Each stored entry is read on its own (lowercased, as the validator accepts an upper-case
232
- // uuid and stores it as sent), with no item cap, so a value over the cap is pruned whole.
231
+ // Each stored entry is read on its own (lowercased: the validator accepts an upper-case uuid,
232
+ // and although a write stores it lowercased since M35 C1, see lowercasePickedIds, a read
233
+ // never relies on that), with no item cap, so a value over the cap is pruned whole.
233
234
  const gone = new Set();
234
235
  const entries = Array.isArray(v) ? v : [v];
235
236
  const kept = entries.filter((entry) => {
@@ -256,6 +257,54 @@ export function removePickedPages(tree, value, drop, options) {
256
257
  const result = walk(tree, value);
257
258
  return { value: result, removed: removed + untyped, untyped };
258
259
  }
260
+ /**
261
+ * M35 C1 (D2): the value with every content picker entry that names a page (a uuid string)
262
+ * lowercased, at every level of a Group or Repeatable list, so a write stores the form readPickedIds
263
+ * reads and a published query's `has` compares bytewise. Any other entry or shape is kept as sent,
264
+ * for the validator to judge. Copy-on-write: the answer is `value` itself when nothing changed.
265
+ */
266
+ export function lowercasePickedIds(tree, value) {
267
+ if (!tree)
268
+ return value;
269
+ if (tree.group) {
270
+ if (!isPlainRecord(value))
271
+ return value;
272
+ let copy = null;
273
+ for (const sub of tree.group.fields) {
274
+ if (!Object.prototype.hasOwnProperty.call(value, sub.alias))
275
+ continue;
276
+ const next = lowercasePickedIds(sub.type, value[sub.alias]);
277
+ if (next === value[sub.alias])
278
+ continue;
279
+ copy ??= { ...value };
280
+ copy[sub.alias] = next;
281
+ }
282
+ return copy ?? value;
283
+ }
284
+ if (tree.list) {
285
+ if (!Array.isArray(value))
286
+ return value;
287
+ let copy = null;
288
+ for (let i = 0; i < value.length; i++) {
289
+ const next = lowercasePickedIds(tree.list.item, value[i]);
290
+ if (next === value[i])
291
+ continue;
292
+ copy ??= [...value];
293
+ copy[i] = next;
294
+ }
295
+ return copy ?? value;
296
+ }
297
+ if (tree.editorId !== CONTENT_PICKER_EDITOR_ID)
298
+ return value;
299
+ const lower = (entry) => {
300
+ const id = typeof entry === "string" ? pickedIdOf(entry) : null;
301
+ return id !== null && id !== entry ? id : entry;
302
+ };
303
+ if (!Array.isArray(value))
304
+ return lower(value);
305
+ const mapped = value.map(lower);
306
+ return mapped.some((entry, i) => entry !== value[i]) ? mapped : value;
307
+ }
259
308
  /** One stored picker entry's page id, lowercased, or null when it names no page. */
260
309
  function pickedIdOf(entry) {
261
310
  return readPickedIds([entry])[0] ?? null;
@@ -0,0 +1,87 @@
1
+ import { z } from "zod";
2
+ export declare const AUDIENCE_MODES: readonly ["everyone", "signed_in", "groups"];
3
+ export type AudienceMode = (typeof AUDIENCE_MODES)[number];
4
+ /** Live nodes that may carry an entry (the node access bound). */
5
+ export declare const MAX_AUDIENCE_NODES = 1000;
6
+ /** Nodes that may carry an entry, those in the trash included: what one load reads at most. */
7
+ export declare const MAX_AUDIENCE_NODES_WITH_TRASH = 1250;
8
+ export declare const AUDIENCE_GROUPS_MAX = 20;
9
+ /** The most paths (branches and reopenings) one published read's filter carries. */
10
+ export declare const AUDIENCE_FILTER_PATHS_MAX = 1250;
11
+ export declare const PageAudienceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
12
+ mode: z.ZodLiteral<"everyone">;
13
+ }, z.core.$strict>, z.ZodObject<{
14
+ mode: z.ZodLiteral<"signed_in">;
15
+ }, z.core.$strict>, z.ZodObject<{
16
+ mode: z.ZodLiteral<"groups">;
17
+ groupIds: z.ZodArray<z.ZodString>;
18
+ }, z.core.$strict>], "mode">;
19
+ export type PageAudience = z.infer<typeof PageAudienceSchema>;
20
+ /** As stored: a groups entry whose every group was deleted keeps the mode with no id, and admits nobody. */
21
+ export declare const StoredPageAudienceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
22
+ mode: z.ZodLiteral<"everyone">;
23
+ }, z.core.$strip>, z.ZodObject<{
24
+ mode: z.ZodLiteral<"signed_in">;
25
+ }, z.core.$strip>, z.ZodObject<{
26
+ mode: z.ZodLiteral<"groups">;
27
+ groupIds: z.ZodArray<z.ZodString>;
28
+ }, z.core.$strip>], "mode">;
29
+ /** The one definition of the stored shape: `@kardalum/db-adapter` re-exports this type, it never writes it again. */
30
+ export type StoredPageAudience = z.infer<typeof StoredPageAudienceSchema>;
31
+ export declare function normalGroupIds(ids: readonly string[]): string[];
32
+ export declare const SetPageAudienceRequestSchema: z.ZodObject<{
33
+ audience: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
34
+ mode: z.ZodLiteral<"everyone">;
35
+ }, z.core.$strict>, z.ZodObject<{
36
+ mode: z.ZodLiteral<"signed_in">;
37
+ }, z.core.$strict>, z.ZodObject<{
38
+ mode: z.ZodLiteral<"groups">;
39
+ groupIds: z.ZodArray<z.ZodString>;
40
+ }, z.core.$strict>], "mode">>;
41
+ }, z.core.$strict>;
42
+ export declare const PageAudienceResponseSchema: z.ZodObject<{
43
+ nodeId: z.ZodString;
44
+ own: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
45
+ mode: z.ZodLiteral<"everyone">;
46
+ }, z.core.$strip>, z.ZodObject<{
47
+ mode: z.ZodLiteral<"signed_in">;
48
+ }, z.core.$strip>, z.ZodObject<{
49
+ mode: z.ZodLiteral<"groups">;
50
+ groupIds: z.ZodArray<z.ZodString>;
51
+ }, z.core.$strip>], "mode">>;
52
+ decidedBy: z.ZodNullable<z.ZodObject<{
53
+ nodeId: z.ZodString;
54
+ path: z.ZodString;
55
+ audience: z.ZodDiscriminatedUnion<[z.ZodObject<{
56
+ mode: z.ZodLiteral<"everyone">;
57
+ }, z.core.$strip>, z.ZodObject<{
58
+ mode: z.ZodLiteral<"signed_in">;
59
+ }, z.core.$strip>, z.ZodObject<{
60
+ mode: z.ZodLiteral<"groups">;
61
+ groupIds: z.ZodArray<z.ZodString>;
62
+ }, z.core.$strip>], "mode">;
63
+ }, z.core.$strip>>;
64
+ accountsOn: z.ZodBoolean;
65
+ groups: z.ZodArray<z.ZodObject<{
66
+ id: z.ZodString;
67
+ siteId: z.ZodNullable<z.ZodString>;
68
+ key: z.ZodString;
69
+ label: z.ZodPreprocess<z.ZodObject<{
70
+ en: z.ZodString;
71
+ }, z.core.$catchall<z.ZodString>>, unknown>;
72
+ ownerPluginId: z.ZodNullable<z.ZodString>;
73
+ members: z.ZodNumber;
74
+ }, z.core.$strip>>;
75
+ }, z.core.$strip>;
76
+ export type PageAudienceResponse = z.infer<typeof PageAudienceResponseSchema>;
77
+ export declare const AUDIENCE_REFUSAL_REASONS: readonly ["sign_in", "not_included", "unavailable"];
78
+ export type AudienceRefusalReason = (typeof AUDIENCE_REFUSAL_REASONS)[number];
79
+ export declare const AUDIENCE_LIMIT_CODE = "audience_limit";
80
+ export declare const AUDIENCE_GROUP_NOT_OF_SITE_CODE = "group_not_of_site";
81
+ export declare const AudienceConflictSchema: z.ZodObject<{
82
+ code: z.ZodEnum<{
83
+ group_not_of_site: "group_not_of_site";
84
+ audience_limit: "audience_limit";
85
+ }>;
86
+ message: z.ZodString;
87
+ }, z.core.$strip>;
@@ -0,0 +1,44 @@
1
+ import { z } from "zod";
2
+ import { VisitorGroupSchema } from "./visitor-groups.js";
3
+ // M35 U2b (W8, design 4.12): who may see a page on the public site. An entry is inherited down the tree by
4
+ // the stored path and the nearest one decides (packages/content-service/src/page-audience.ts), so
5
+ // `everyone` reopens a subtree. The adapter keeps the entries (content_node_audiences, migration 0041).
6
+ export const AUDIENCE_MODES = ["everyone", "signed_in", "groups"];
7
+ /** Live nodes that may carry an entry (the node access bound). */
8
+ export const MAX_AUDIENCE_NODES = 1000;
9
+ /** Nodes that may carry an entry, those in the trash included: what one load reads at most. */
10
+ export const MAX_AUDIENCE_NODES_WITH_TRASH = 1250;
11
+ export const AUDIENCE_GROUPS_MAX = 20;
12
+ /** The most paths (branches and reopenings) one published read's filter carries. */
13
+ export const AUDIENCE_FILTER_PATHS_MAX = MAX_AUDIENCE_NODES_WITH_TRASH;
14
+ const GroupId = z.string().max(36).uuid();
15
+ export const PageAudienceSchema = z.discriminatedUnion("mode", [
16
+ z.strictObject({ mode: z.literal("everyone") }),
17
+ z.strictObject({ mode: z.literal("signed_in") }),
18
+ z.strictObject({ mode: z.literal("groups"), groupIds: z.array(GroupId).min(1).max(AUDIENCE_GROUPS_MAX) }),
19
+ ]);
20
+ /** As stored: a groups entry whose every group was deleted keeps the mode with no id, and admits nobody. */
21
+ export const StoredPageAudienceSchema = z.discriminatedUnion("mode", [
22
+ z.object({ mode: z.literal("everyone") }),
23
+ z.object({ mode: z.literal("signed_in") }),
24
+ z.object({ mode: z.literal("groups"), groupIds: z.array(z.string()).max(AUDIENCE_GROUPS_MAX) }),
25
+ ]);
26
+ export function normalGroupIds(ids) {
27
+ return [...new Set(ids.map((id) => id.toLowerCase()))].sort();
28
+ }
29
+ export const SetPageAudienceRequestSchema = z.strictObject({ audience: PageAudienceSchema.nullable() });
30
+ export const PageAudienceResponseSchema = z.object({
31
+ nodeId: z.string().uuid(),
32
+ /** The page's own entry; null when it inherits. */
33
+ own: StoredPageAudienceSchema.nullable(),
34
+ /** The entry that decides for the page (its own or the nearest above it); null: everyone. */
35
+ decidedBy: z.object({ nodeId: z.string(), path: z.string(), audience: StoredPageAudienceSchema }).nullable(),
36
+ /** Whether the page's site has visitor accounts on. Off, a page that is not for everyone is shown to nobody. */
37
+ accountsOn: z.boolean(),
38
+ /** The groups an entry on this page may name: the site's own and every plugin's. */
39
+ groups: z.array(VisitorGroupSchema),
40
+ });
41
+ export const AUDIENCE_REFUSAL_REASONS = ["sign_in", "not_included", "unavailable"];
42
+ export const AUDIENCE_LIMIT_CODE = "audience_limit";
43
+ export const AUDIENCE_GROUP_NOT_OF_SITE_CODE = "group_not_of_site";
44
+ export const AudienceConflictSchema = z.object({ code: z.enum([AUDIENCE_LIMIT_CODE, AUDIENCE_GROUP_NOT_OF_SITE_CODE]), message: z.string() });
@@ -0,0 +1,11 @@
1
+ import { type EditorExtensionIssue } from "./plugin-editor-extensions.js";
2
+ export declare const ADMIN_SLOT_PLACES: readonly ["topBar.item", "users.panel", "account.panel", "documentType.panel", "media.panel"];
3
+ export type AdminSlotPlace = (typeof ADMIN_SLOT_PLACES)[number];
4
+ /** The most admin slot entries one plugin may declare. */
5
+ export declare const ADMIN_SLOTS_MAX = 8;
6
+ /** The most entries one plugin may put in one place. */
7
+ export declare const ADMIN_SLOTS_PER_PLACE_MAX = 2;
8
+ /** The shape rules for `adminSlots` beyond label, action and view (the manifest schema checks those). */
9
+ export declare function checkAdminSlotDeclarations(manifest: {
10
+ contributions?: unknown;
11
+ }): EditorExtensionIssue[];
@@ -0,0 +1,61 @@
1
+ import { EDITOR_SLOT_ID_MAX, isEditorSlotId } from "./plugin-editor-extensions.js";
2
+ // M35 C2 (W26, experimental): the closed list of places in the core's own screens where a plugin's
3
+ // view may sit. A place is added here, with its context type in the SDK and its host in the admin,
4
+ // never named by a plugin freely.
5
+ export const ADMIN_SLOT_PLACES = ["topBar.item", "users.panel", "account.panel", "documentType.panel", "media.panel"];
6
+ /** The most admin slot entries one plugin may declare. */
7
+ export const ADMIN_SLOTS_MAX = 8;
8
+ /** The most entries one plugin may put in one place. */
9
+ export const ADMIN_SLOTS_PER_PLACE_MAX = 2;
10
+ const PLACE_LIST = ADMIN_SLOT_PLACES.map((place) => `"${place}"`).join(", ");
11
+ /** The shape rules for `adminSlots` beyond label, action and view (the manifest schema checks those). */
12
+ export function checkAdminSlotDeclarations(manifest) {
13
+ const issues = [];
14
+ const contributions = manifest.contributions;
15
+ if (!contributions || typeof contributions !== "object")
16
+ return issues;
17
+ const entries = contributions.adminSlots;
18
+ if (entries === undefined)
19
+ return issues;
20
+ const keyPath = ["contributions", "adminSlots"];
21
+ if (!Array.isArray(entries))
22
+ return [{ path: keyPath, message: "adminSlots must be a list" }];
23
+ const seen = new Set();
24
+ const perPlace = new Map();
25
+ entries.forEach((entry, index) => {
26
+ if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
27
+ issues.push({ path: [...keyPath, index], message: "each admin slot must be an object" });
28
+ return;
29
+ }
30
+ const item = entry;
31
+ if (typeof item.id !== "string" || !isEditorSlotId(item.id)) {
32
+ issues.push({ path: [...keyPath, index, "id"], message: `admin slot id must be 1 to ${EDITOR_SLOT_ID_MAX} lower-case letters, digits and "-", starting with a letter` });
33
+ }
34
+ else if (seen.has(item.id)) {
35
+ issues.push({ path: [...keyPath, index, "id"], message: `admin slot "${item.id}" is declared more than once` });
36
+ }
37
+ else {
38
+ seen.add(item.id);
39
+ }
40
+ const place = item.slot;
41
+ if (typeof place !== "string" || !ADMIN_SLOT_PLACES.includes(place)) {
42
+ issues.push({ path: [...keyPath, index, "slot"], message: `slot must be one of ${PLACE_LIST}` });
43
+ return;
44
+ }
45
+ perPlace.set(place, (perPlace.get(place) ?? 0) + 1);
46
+ const hasIcon = typeof item.icon === "string" && item.icon.length > 0;
47
+ if (place === "topBar.item" && !hasIcon)
48
+ issues.push({ path: [...keyPath, index, "icon"], message: "a topBar.item needs an icon" });
49
+ if (place !== "topBar.item" && item.icon !== undefined)
50
+ issues.push({ path: [...keyPath, index, "icon"], message: "only a topBar.item has an icon" });
51
+ });
52
+ for (const [place, count] of perPlace) {
53
+ if (count > ADMIN_SLOTS_PER_PLACE_MAX) {
54
+ issues.push({ path: keyPath, message: `a plugin may put at most ${ADMIN_SLOTS_PER_PLACE_MAX} entries in ${place}; this one puts ${count}` });
55
+ }
56
+ }
57
+ if (entries.length > ADMIN_SLOTS_MAX) {
58
+ issues.push({ path: keyPath, message: `a plugin may declare at most ${ADMIN_SLOTS_MAX} admin slots; this one declares ${entries.length}` });
59
+ }
60
+ return issues;
61
+ }
@@ -6,7 +6,8 @@ export declare const PLUGIN_CONTENT_ACCESS_MAX_PARENTS = 20;
6
6
  export declare const PLUGIN_CONTENT_ACCESS_NAME_MAX = 200;
7
7
  export declare function isPluginContentAccessAction(value: unknown): value is PluginContentAccessAction;
8
8
  export declare const PluginContentAccessEntrySchema: z.ZodObject<{
9
- documentType: z.ZodString;
9
+ documentType: z.ZodOptional<z.ZodString>;
10
+ allContent: z.ZodOptional<z.ZodLiteral<true>>;
10
11
  actions: z.ZodArray<z.ZodEnum<{
11
12
  "content.read": "content.read";
12
13
  "content.create": "content.create";
@@ -19,7 +20,8 @@ export declare const PluginContentAccessEntrySchema: z.ZodObject<{
19
20
  }, z.core.$strict>;
20
21
  export type PluginContentAccessEntry = z.infer<typeof PluginContentAccessEntrySchema>;
21
22
  export declare const PluginContentAccessSchema: z.ZodArray<z.ZodObject<{
22
- documentType: z.ZodString;
23
+ documentType: z.ZodOptional<z.ZodString>;
24
+ allContent: z.ZodOptional<z.ZodLiteral<true>>;
23
25
  actions: z.ZodArray<z.ZodEnum<{
24
26
  "content.read": "content.read";
25
27
  "content.create": "content.create";
@@ -24,7 +24,10 @@ const nameSchema = z
24
24
  const distinct = (values) => new Set(values).size === values.length;
25
25
  export const PluginContentAccessEntrySchema = z
26
26
  .object({
27
- documentType: nameSchema,
27
+ documentType: nameSchema.optional(),
28
+ // M35 C1 (W12), experimental: every page of the site, drafts included, top level included, for reading only.
29
+ // Writes across all content and a create at the top level are not offered (35-B6 decides them).
30
+ allContent: z.literal(true).optional(),
28
31
  actions: z
29
32
  .array(z.enum(PLUGIN_CONTENT_ACCESS_ACTIONS))
30
33
  .min(1)
@@ -33,6 +36,12 @@ export const PluginContentAccessEntrySchema = z
33
36
  parents: z.array(nameSchema).min(1).max(PLUGIN_CONTENT_ACCESS_MAX_PARENTS).refine(distinct, { message: "names each parent type once" }).optional(),
34
37
  })
35
38
  .strict()
39
+ .refine((entry) => (entry.documentType === undefined) !== (entry.allContent === undefined), { message: "names a documentType, or is allContent: true", path: ["documentType"] })
40
+ .refine((entry) => entry.allContent === undefined || (entry.actions.length === 1 && entry.actions[0] === "content.read"), {
41
+ message: 'allContent reads only: its actions are ["content.read"]',
42
+ path: ["actions"],
43
+ })
44
+ .refine((entry) => entry.allContent === undefined || entry.parents === undefined, { message: "allContent takes no parents", path: ["parents"] })
36
45
  // Every write route reads the place it writes first (node access asks content.read at the node,
37
46
  // or at the parent for a create), so a write declared without the read could never run.
38
47
  .refine((entry) => !entry.actions.some((action) => action !== "content.read") || entry.actions.includes("content.read"), {
@@ -43,7 +52,8 @@ export const PluginContentAccessSchema = z
43
52
  .array(PluginContentAccessEntrySchema)
44
53
  .min(1, { error: "declares at least one document type (leave contentAccess out when the plugin writes no content)" })
45
54
  .max(PLUGIN_CONTENT_ACCESS_MAX_ENTRIES)
46
- .refine((entries) => distinct(entries.map((entry) => entry.documentType)), { message: "declares each document type once" });
55
+ .refine((entries) => distinct(entries.flatMap((entry) => (entry.documentType === undefined ? [] : [entry.documentType]))), { message: "declares each document type once" })
56
+ .refine((entries) => entries.filter((entry) => entry.allContent === true).length <= 1, { message: "declares allContent once" });
47
57
  /** The rule over a manifest (live or manifest.json), as `path: message` issues. */
48
58
  export function checkContentAccessDeclarations(manifest) {
49
59
  const contributions = manifest.contributions;
@@ -0,0 +1,136 @@
1
+ import { z } from "zod";
2
+ import { type EditorExtensionIssue } from "./plugin-editor-extensions.js";
3
+ /** The most content list columns one plugin may declare. */
4
+ export declare const CONTENT_COLUMNS_MAX = 3;
5
+ /** The most tree badges one plugin may declare. */
6
+ export declare const TREE_BADGES_MAX = 1;
7
+ /** The most content list filters one plugin may declare. */
8
+ export declare const LIST_FILTERS_MAX = 2;
9
+ /** The most bulk actions one plugin may declare. */
10
+ export declare const BULK_ACTIONS_MAX = 3;
11
+ /** The most options one list filter may offer. */
12
+ export declare const LIST_FILTER_OPTIONS_MAX = 12;
13
+ /** The most rows one value or match call is handed: one page of the tree or the list. */
14
+ export declare const CONTENT_SLOT_ROWS_MAX = 50;
15
+ /** How long one value or match call may take before it is answered as failed. */
16
+ export declare const CONTENT_SLOT_CALL_TIME_MS = 1000;
17
+ /** The longest text a column cell shows. */
18
+ export declare const CONTENT_COLUMN_TEXT_MAX = 80;
19
+ /** The longest text a tree badge shows. */
20
+ export declare const TREE_BADGE_TEXT_MAX = 24;
21
+ /** The longest one filtered list call scans before it answers what it found. Checked before each page
22
+ * is read, so a call can run past it by one page's read and one match call: a soft bound. */
23
+ export declare const CONTENT_LIST_FILTER_TIME_MS = 3000;
24
+ /** The most rows a bulk action is handed. */
25
+ export declare const BULK_ACTION_ROWS_MAX = 100;
26
+ export declare const CONTENT_SLOT_KINDS: readonly ["column", "badge"];
27
+ export type ContentSlotKind = (typeof CONTENT_SLOT_KINDS)[number];
28
+ export declare const BADGE_TONES: readonly ["neutral", "primary", "success", "warning", "danger"];
29
+ export type BadgeTone = (typeof BADGE_TONES)[number];
30
+ export interface BadgeCell {
31
+ text: string;
32
+ tone: BadgeTone;
33
+ }
34
+ export declare const LIST_FILTER_UNAVAILABLE_CODE = "list_filter_unavailable";
35
+ export declare const LIST_FILTER_REFUSED_CODE = "list_filter_refused";
36
+ export declare const LIST_FILTER_UNKNOWN_CODE = "list_filter_unknown";
37
+ /** A filtered list's refusal (403, 404, 503): `ApiErrorSchema` is a plain object schema, so the
38
+ * serializer would strip `code` from a body answered through it. Coded, as plugin-guards'
39
+ * `plugin_refused` body is. */
40
+ export declare const ListFilterErrorSchema: z.ZodObject<{
41
+ message: z.ZodString;
42
+ code: z.ZodEnum<{
43
+ list_filter_unavailable: "list_filter_unavailable";
44
+ list_filter_refused: "list_filter_refused";
45
+ list_filter_unknown: "list_filter_unknown";
46
+ }>;
47
+ }, z.core.$strip>;
48
+ export type ListFilterError = z.infer<typeof ListFilterErrorSchema>;
49
+ export declare const CONTENT_SLOT_KEYS: readonly [{
50
+ readonly key: "contentColumns";
51
+ readonly max: 3;
52
+ readonly noun: "content column";
53
+ }, {
54
+ readonly key: "treeBadges";
55
+ readonly max: 1;
56
+ readonly noun: "tree badge";
57
+ }, {
58
+ readonly key: "listFilters";
59
+ readonly max: 2;
60
+ readonly noun: "list filter";
61
+ }, {
62
+ readonly key: "bulkActions";
63
+ readonly max: 3;
64
+ readonly noun: "bulk action";
65
+ }];
66
+ /** The shape rules for the four content slot keys beyond label, action and the functions (the manifest schema checks those). */
67
+ export declare function checkContentSlotDeclarations(manifest: {
68
+ contributions?: unknown;
69
+ }): EditorExtensionIssue[];
70
+ /** A column's answer: every asked id with its text or null; null when the answer is not a plain object, a getter throws or a Proxy trap throws. */
71
+ export declare function readColumnAnswer(answer: unknown, asked: readonly string[]): Record<string, string | null> | null;
72
+ /** A badge's answer: every asked id with `{ text, tone }` or null; null as readColumnAnswer. */
73
+ export declare function readBadgeAnswer(answer: unknown, asked: readonly string[]): Record<string, BadgeCell | null> | null;
74
+ /** The longest array a filter may answer: the asked page, with room for repeats and ids not asked. */
75
+ export declare const LIST_FILTER_ANSWER_MAX: number;
76
+ /** A filter's answer: the asked ids it names; null when it is not an array of strings, is longer than
77
+ * LIST_FILTER_ANSWER_MAX, or a getter or Proxy trap throws. Read by index with the length taken once,
78
+ * never through the array's own iterator, so the loop has a bound of its own. */
79
+ export declare function readFilterAnswer(answer: unknown, asked: readonly string[]): Set<string> | null;
80
+ /** `ids` of the slot read: 1 to CONTENT_SLOT_ROWS_MAX distinct uuids, comma separated, lower-cased; else null. */
81
+ export declare function parseSlotRowIds(text: string): string[] | null;
82
+ /** The admin's language for a plugin's words: 2 to 35 letters, digits and "-", else "en". */
83
+ export declare function slotLanguageOf(value: unknown): string;
84
+ export declare const ContentSlotValuesQuerySchema: z.ZodObject<{
85
+ kind: z.ZodEnum<{
86
+ column: "column";
87
+ badge: "badge";
88
+ }>;
89
+ ids: z.ZodString;
90
+ culture: z.ZodOptional<z.ZodString>;
91
+ lang: z.ZodOptional<z.ZodString>;
92
+ }, z.core.$strict>;
93
+ export declare const BadgeCellSchema: z.ZodObject<{
94
+ text: z.ZodString;
95
+ tone: z.ZodEnum<{
96
+ success: "success";
97
+ neutral: "neutral";
98
+ primary: "primary";
99
+ warning: "warning";
100
+ danger: "danger";
101
+ }>;
102
+ }, z.core.$strict>;
103
+ export declare const ContentSlotValuesSlotSchema: z.ZodObject<{
104
+ pluginId: z.ZodString;
105
+ slotId: z.ZodString;
106
+ failed: z.ZodBoolean;
107
+ cells: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
108
+ text: z.ZodString;
109
+ tone: z.ZodEnum<{
110
+ success: "success";
111
+ neutral: "neutral";
112
+ primary: "primary";
113
+ warning: "warning";
114
+ danger: "danger";
115
+ }>;
116
+ }, z.core.$strict>, z.ZodNull]>>;
117
+ }, z.core.$strict>;
118
+ export type ContentSlotValuesSlot = z.infer<typeof ContentSlotValuesSlotSchema>;
119
+ export declare const ContentSlotValuesResponseSchema: z.ZodObject<{
120
+ slots: z.ZodArray<z.ZodObject<{
121
+ pluginId: z.ZodString;
122
+ slotId: z.ZodString;
123
+ failed: z.ZodBoolean;
124
+ cells: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
125
+ text: z.ZodString;
126
+ tone: z.ZodEnum<{
127
+ success: "success";
128
+ neutral: "neutral";
129
+ primary: "primary";
130
+ warning: "warning";
131
+ danger: "danger";
132
+ }>;
133
+ }, z.core.$strict>, z.ZodNull]>>;
134
+ }, z.core.$strict>>;
135
+ }, z.core.$strict>;
136
+ export type ContentSlotValuesResponse = z.infer<typeof ContentSlotValuesResponseSchema>;