@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
@@ -0,0 +1,39 @@
1
+ import { CONTRACT_DOCUMENT_FORMAT, CONTRACT_FINGERPRINT_PREFIX, ContractDocumentSchema, ServiceContractDeclarationSchema, contractFingerprintText, contractId, contractOfDocument, formatContractVersion, parseContractVersion, readServiceDeclarations, } from "@kardalum/api-schemas";
2
+ import { hashBuffer } from "./hash.js";
3
+ // M35 B1c (plan decision 3): node:crypto lives here, not in api-schemas, which the admin's browser bundle
4
+ // imports too. The CLI's build and validate and the marketplace's door and routes all call these.
5
+ export function contractFingerprint(contract) {
6
+ return `${CONTRACT_FINGERPRINT_PREFIX}${hashBuffer(Buffer.from(contractFingerprintText(contract), "utf8"))}`;
7
+ }
8
+ /** Whether a document's methods still hash to the fingerprint it carries (a copy edited by hand does not). */
9
+ export function documentFingerprintHolds(document) {
10
+ const contract = contractOfDocument(document);
11
+ return contract !== null && contractFingerprint(contract) === document.fingerprint;
12
+ }
13
+ export function contractDocumentFor(input) {
14
+ const written = ServiceContractDeclarationSchema.safeParse(input.declaration);
15
+ if (!written.success)
16
+ return null;
17
+ const contract = readServiceDeclarations({ id: input.owner.id, contributions: { serviceContracts: [written.data] } }).contracts[0];
18
+ if (contract === undefined)
19
+ return null;
20
+ const version = formatContractVersion(contract.version);
21
+ const appended = input.history.some((entry) => entry.version === version) ? [...input.history] : [...input.history, { version, methods: contract.methods.map((m) => m.name).sort() }];
22
+ // Plan decision 1: oldest first, also when the history already holds a newer minor than the declaration's.
23
+ const minor = (entry) => parseContractVersion(entry.version)?.minor ?? Number.MAX_SAFE_INTEGER;
24
+ const history = appended.sort((a, b) => minor(a) - minor(b));
25
+ const parsed = ContractDocumentSchema.safeParse({
26
+ format: CONTRACT_DOCUMENT_FORMAT,
27
+ contract: contractId(input.owner.id, contract.name),
28
+ version,
29
+ owner: input.owner,
30
+ pluginVersion: input.pluginVersion,
31
+ label: written.data.label,
32
+ ...(written.data.description !== undefined ? { description: written.data.description } : {}),
33
+ methods: written.data.methods,
34
+ ...(contract.providersUse.length > 0 ? { providersUse: contract.providersUse } : {}),
35
+ published: history.map((entry) => ({ version: entry.version, methods: [...entry.methods] })),
36
+ fingerprint: contractFingerprint(contract),
37
+ });
38
+ return parsed.success ? parsed.data : null;
39
+ }
@@ -0,0 +1,23 @@
1
+ import type { DeliveryCheck } from "./types.js";
2
+ /** D3: the whole file in the plugin's layer; a leading @charset stays first, outside it. Idempotent. */
3
+ export declare function wrapPluginStylesheet(css: string, pluginId: string): string;
4
+ /** Every `.css` file beside remoteEntry.js and under assets/, at any depth, never following a link. */
5
+ export declare function clientStylesheetsOf(root: string): string[];
6
+ /**
7
+ * D4: whether a selector's first compound holds a class or an id, so the rule can only meet elements that
8
+ * carry a name the plugin chose. A leading `:where(` or `:is(` (Tailwind's space and divide utilities) is
9
+ * read through: it scopes the compound only when every comma-separated alternative in it is itself scoped
10
+ * (`:is(.x, body)` is refused), and otherwise the rest of the compound must hold the class or id
11
+ * (`:where(a).b`). Read-throughs nest at most READ_THROUGH_MAX deep; each level scans its own slice once.
12
+ */
13
+ export declare function isScopedSelector(selector: string, level?: number): boolean;
14
+ /**
15
+ * Tailwind 4.3.3's `@supports` condition around its initial values (the fallback for browsers without
16
+ * `@property`), as Tailwind writes it and as its build's minifier writes it. Compared without white space.
17
+ */
18
+ export declare const TAILWIND_PROPERTIES_FALLBACK_CONDITIONS: readonly ["((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b))))", "(((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b))))"];
19
+ /** The selector list Tailwind 4.3.3 gives its initial values; the minifier's `:before` and `:after` read as the same. */
20
+ export declare const TAILWIND_PROPERTIES_SELECTORS: readonly ["*", "::before", "::after", "::backdrop"];
21
+ /** D4: what keeps one stylesheet of plugin `pluginId` from passing, as sentences; empty when it passes. */
22
+ export declare function pluginStylesheetProblems(css: string, pluginId: string): string[];
23
+ export declare const adminStylesCheck: DeliveryCheck;
@@ -0,0 +1,351 @@
1
+ import { lstatSync, readFileSync, readdirSync, statSync } from "node:fs";
2
+ import { join, relative } from "node:path";
3
+ import postcss from "postcss";
4
+ import { pluginStylesLayerName } from "@kardalum/api-schemas";
5
+ import { declaresClientBundle } from "../client-bundle.js";
6
+ import { NOT_VIEW_BEARING, filesUnder } from "./bundle.js";
7
+ import { ADMIN_STYLESHEET_MAX_BYTES, ADMIN_STYLESHEET_NESTING_MAX, formatBinarySize } from "./limits.js";
8
+ import { failed, listCapped, passed } from "./support.js";
9
+ // M35 C3 (design D2 to D4): a plugin's stylesheet styles its own markup only. The build wraps each one in
10
+ // the plugin's layer; this file reads it back with PostCSS (never a pattern) and refuses what would reach
11
+ // an admin screen or another plugin: a rule starting at a global or element selector, !important, @import,
12
+ // @namespace, @page and an @property Tailwind does not own. Messages quote at most 60 characters of the
13
+ // plugin's text, without control characters.
14
+ const CHARSET = '@charset "';
15
+ const TAILWIND_VARIABLE = "--tw-";
16
+ const QUOTE_MAX = 60;
17
+ const REFUSED_AT_RULES = new Set(["import", "namespace", "page"]);
18
+ /** The text after leading white space and comments, by one linear scan; null at an unclosed comment. */
19
+ function afterLeadingComments(text) {
20
+ let at = 0;
21
+ for (;;) {
22
+ while (at < text.length && (text[at] === " " || text[at] === "\t" || text[at] === "\n" || text[at] === "\r" || text[at] === "\f"))
23
+ at++;
24
+ if (!text.startsWith("/*", at))
25
+ return text.slice(at);
26
+ const end = text.indexOf("*/", at + 2);
27
+ if (end === -1)
28
+ return null;
29
+ at = end + 2;
30
+ }
31
+ }
32
+ /** Whether the file already is one block of this layer, past a leading @charset and comments, as the check reads it. */
33
+ function isWrapped(css, layer) {
34
+ const body = css.startsWith(CHARSET) ? css.slice(css.indexOf(";") + 1) : css;
35
+ const rest = afterLeadingComments(body);
36
+ return rest !== null && rest.startsWith(`@layer ${layer} {`);
37
+ }
38
+ /** D3: the whole file in the plugin's layer; a leading @charset stays first, outside it. Idempotent. */
39
+ export function wrapPluginStylesheet(css, pluginId) {
40
+ const layer = pluginStylesLayerName(pluginId);
41
+ if (isWrapped(css, layer))
42
+ return css;
43
+ let charset = "";
44
+ let body = css;
45
+ if (body.startsWith(CHARSET)) {
46
+ const end = body.indexOf(";");
47
+ if (end !== -1) {
48
+ charset = `${body.slice(0, end + 1)}\n`;
49
+ body = body.slice(end + 1);
50
+ }
51
+ }
52
+ return `${charset}@layer ${layer} {\n${body}\n}\n`;
53
+ }
54
+ /** Every `.css` file beside remoteEntry.js and under assets/, at any depth, never following a link. */
55
+ export function clientStylesheetsOf(root) {
56
+ const out = [];
57
+ const isCss = (name) => name.toLowerCase().endsWith(".css");
58
+ for (const entry of readdirSync(root, { withFileTypes: true })) {
59
+ if (entry.isFile() && isCss(entry.name))
60
+ out.push(join(root, entry.name));
61
+ }
62
+ const assets = join(root, "assets");
63
+ try {
64
+ if (lstatSync(assets).isDirectory())
65
+ out.push(...filesUnder(assets).filter((path) => isCss(path)));
66
+ }
67
+ catch {
68
+ // No assets/ folder.
69
+ }
70
+ return out;
71
+ }
72
+ /** A short, printable quote of the plugin's own text for a message. */
73
+ function quote(text) {
74
+ let out = "";
75
+ for (const char of text) {
76
+ const code = char.codePointAt(0);
77
+ out += code < 32 || code === 127 ? " " : char;
78
+ if (out.length >= QUOTE_MAX)
79
+ return `${out}...`;
80
+ }
81
+ return out;
82
+ }
83
+ /** How deep a leading `:is(` / `:where(` is read through; deeper is refused, so the scan stays linear. */
84
+ const READ_THROUGH_MAX = 4;
85
+ /**
86
+ * One linear pass over `text` from `from`, tracking brackets, parentheses, strings and escapes. Answers the
87
+ * index of the `)` that closes depth 0 (or -1), and the depth-0 commas met before it.
88
+ */
89
+ function scanArgument(text, from) {
90
+ const commas = [];
91
+ let depth = 0;
92
+ let quoteChar = "";
93
+ for (let i = from; i < text.length; i++) {
94
+ const char = text[i];
95
+ if (quoteChar !== "") {
96
+ if (char === "\\")
97
+ i++;
98
+ else if (char === quoteChar)
99
+ quoteChar = "";
100
+ continue;
101
+ }
102
+ if (char === "\\")
103
+ i++;
104
+ else if (char === '"' || char === "'")
105
+ quoteChar = char;
106
+ else if (char === "(" || char === "[")
107
+ depth++;
108
+ else if (char === ")" || char === "]") {
109
+ if (depth === 0)
110
+ return char === ")" ? { close: i, commas } : { close: -1, commas };
111
+ depth--;
112
+ }
113
+ else if (char === "," && depth === 0)
114
+ commas.push(i);
115
+ }
116
+ return { close: -1, commas };
117
+ }
118
+ /**
119
+ * D4: whether a selector's first compound holds a class or an id, so the rule can only meet elements that
120
+ * carry a name the plugin chose. A leading `:where(` or `:is(` (Tailwind's space and divide utilities) is
121
+ * read through: it scopes the compound only when every comma-separated alternative in it is itself scoped
122
+ * (`:is(.x, body)` is refused), and otherwise the rest of the compound must hold the class or id
123
+ * (`:where(a).b`). Read-throughs nest at most READ_THROUGH_MAX deep; each level scans its own slice once.
124
+ */
125
+ export function isScopedSelector(selector, level = 0) {
126
+ const text = selector.trim();
127
+ const head = text.slice(0, 7).toLowerCase();
128
+ const open = head.startsWith(":where(") ? 7 : head.startsWith(":is(") ? 4 : 0;
129
+ if (open === 0)
130
+ return firstCompoundHoldsName(text);
131
+ if (level >= READ_THROUGH_MAX)
132
+ return false;
133
+ const { close, commas } = scanArgument(text, open);
134
+ if (close === -1)
135
+ return false;
136
+ const bounds = [open - 1, ...commas, close];
137
+ let everyScoped = true;
138
+ for (let k = 0; k + 1 < bounds.length && everyScoped; k++) {
139
+ everyScoped = isScopedSelector(text.slice(bounds[k] + 1, bounds[k + 1]), level + 1);
140
+ }
141
+ return everyScoped || firstCompoundHoldsName(text.slice(close + 1));
142
+ }
143
+ /** Whether the first compound of `text` holds a "." or "#" at depth 0, before any combinator. */
144
+ function firstCompoundHoldsName(text) {
145
+ let depth = 0;
146
+ let quoteChar = "";
147
+ for (let i = 0; i < text.length; i++) {
148
+ const char = text[i];
149
+ if (quoteChar !== "") {
150
+ if (char === "\\")
151
+ i++;
152
+ else if (char === quoteChar)
153
+ quoteChar = "";
154
+ continue;
155
+ }
156
+ if (char === "\\") {
157
+ i++;
158
+ continue;
159
+ }
160
+ if (char === '"' || char === "'") {
161
+ quoteChar = char;
162
+ continue;
163
+ }
164
+ if (char === "(" || char === "[") {
165
+ depth++;
166
+ continue;
167
+ }
168
+ if (char === ")" || char === "]") {
169
+ // An unmatched close: not a selector this check admits.
170
+ if (depth === 0)
171
+ return false;
172
+ depth--;
173
+ continue;
174
+ }
175
+ if (depth > 0)
176
+ continue;
177
+ if (char === " " || char === "\t" || char === "\n" || char === ">" || char === "+" || char === "~" || char === ",")
178
+ return false;
179
+ if (char === "." || char === "#")
180
+ return true;
181
+ }
182
+ return false;
183
+ }
184
+ function setsOnlyTailwindVariables(rule) {
185
+ const nodes = rule.nodes ?? [];
186
+ return nodes.length > 0 && nodes.every((node) => node.type === "comment" || (node.type === "decl" && node.prop.startsWith(TAILWIND_VARIABLE)));
187
+ }
188
+ /**
189
+ * Tailwind 4.3.3's `@supports` condition around its initial values (the fallback for browsers without
190
+ * `@property`), as Tailwind writes it and as its build's minifier writes it. Compared without white space.
191
+ */
192
+ export const TAILWIND_PROPERTIES_FALLBACK_CONDITIONS = [
193
+ "((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b))))",
194
+ "(((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b))))",
195
+ ];
196
+ /** The selector list Tailwind 4.3.3 gives its initial values; the minifier's `:before` and `:after` read as the same. */
197
+ export const TAILWIND_PROPERTIES_SELECTORS = ["*", "::before", "::after", "::backdrop"];
198
+ /** The text without white space, by one linear scan. */
199
+ function withoutSpace(text) {
200
+ let out = "";
201
+ for (const char of text)
202
+ if (char !== " " && char !== "\t" && char !== "\n" && char !== "\r" && char !== "\f")
203
+ out += char;
204
+ return out;
205
+ }
206
+ const FALLBACK_CONDITIONS = new Set(TAILWIND_PROPERTIES_FALLBACK_CONDITIONS.map(withoutSpace));
207
+ function isTailwindSelectorList(rule) {
208
+ const selectors = rule.selectors.map((selector) => {
209
+ const text = selector.trim();
210
+ return text === ":before" || text === ":after" ? `:${text}` : text;
211
+ });
212
+ return selectors.length === TAILWIND_PROPERTIES_SELECTORS.length && selectors.every((selector, i) => selector === TAILWIND_PROPERTIES_SELECTORS[i]);
213
+ }
214
+ /**
215
+ * D4: Tailwind 4's initial values, exactly as Tailwind emits them: a rule on Tailwind's selector list
216
+ * (TAILWIND_PROPERTIES_SELECTORS) that sets only `--tw-` variables, inside an `@supports` on Tailwind's own
217
+ * fallback condition (TAILWIND_PROPERTIES_FALLBACK_CONDITIONS), inside an `@layer properties` that sits
218
+ * directly in the plugin's block. A `--tw-` rule anywhere else, or under any other condition or selector,
219
+ * is read like any other rule.
220
+ */
221
+ function isTailwindInitialValues(rule, block) {
222
+ if (!setsOnlyTailwindVariables(rule) || !isTailwindSelectorList(rule))
223
+ return false;
224
+ const supports = rule.parent;
225
+ if (supports?.type !== "atrule" || supports.name.toLowerCase() !== "supports")
226
+ return false;
227
+ if (!FALLBACK_CONDITIONS.has(withoutSpace(supports.params)))
228
+ return false;
229
+ const layer = supports.parent;
230
+ return layer?.type === "atrule" && layer.name.toLowerCase() === "layer" && layer.params.trim() === "properties" && layer.parent === block;
231
+ }
232
+ /** D4: what keeps one stylesheet of plugin `pluginId` from passing, as sentences; empty when it passes. */
233
+ export function pluginStylesheetProblems(css, pluginId) {
234
+ if (Buffer.byteLength(css, "utf8") > ADMIN_STYLESHEET_MAX_BYTES) {
235
+ return [`is larger than ${formatBinarySize(ADMIN_STYLESHEET_MAX_BYTES)}`];
236
+ }
237
+ let root;
238
+ try {
239
+ root = postcss.parse(css);
240
+ }
241
+ catch (error) {
242
+ const reason = error instanceof Error && "reason" in error ? String(error.reason) : "a syntax error";
243
+ return [`does not parse as CSS (${quote(reason)})`];
244
+ }
245
+ const layer = pluginStylesLayerName(pluginId);
246
+ const problems = [];
247
+ const top = (root.nodes ?? []).filter((node) => node.type !== "comment");
248
+ if (top.length === 0)
249
+ return problems;
250
+ const [first, ...rest] = top;
251
+ const charset = first?.type === "atrule" && first.name.toLowerCase() === "charset";
252
+ const body = charset ? rest : top;
253
+ const block = body[0];
254
+ if (body.length !== 1 || block?.type !== "atrule" || block.name.toLowerCase() !== "layer" || block.params.trim() !== layer || block.nodes === undefined) {
255
+ const imported = top.find((node) => node.type === "atrule" && node.name.toLowerCase() === "import");
256
+ if (imported)
257
+ problems.push("holds an @import, which a plugin stylesheet may not: bundle the file instead");
258
+ problems.push(`is not wrapped in its own layer \`@layer ${layer} { ... }\`: build the plugin with \`kardalum plugin build\``);
259
+ return problems;
260
+ }
261
+ // One pass in document order over an explicit stack (never recursion, so no depth overflows the call
262
+ // stack), each node carrying its ancestors' state down instead of walking back up to them.
263
+ const pending = [];
264
+ const readChildren = (nodes, level, inKeyframes, inRule) => {
265
+ for (let i = nodes.length - 1; i >= 0; i--)
266
+ pending.push({ node: nodes[i], level, inKeyframes, inRule });
267
+ };
268
+ readChildren(block.nodes, 1, false, false);
269
+ let tooDeep = false;
270
+ while (pending.length > 0) {
271
+ const { node, level, inKeyframes, inRule } = pending.pop();
272
+ if (node.type === "decl") {
273
+ if (node.important)
274
+ problems.push(`marks "${quote(node.prop)}" !important, which beats the admin's own rules`);
275
+ continue;
276
+ }
277
+ if (node.type !== "atrule" && node.type !== "rule")
278
+ continue;
279
+ if (level > ADMIN_STYLESHEET_NESTING_MAX) {
280
+ if (!tooDeep)
281
+ problems.push(`nests blocks deeper than ${ADMIN_STYLESHEET_NESTING_MAX} levels, which a plugin stylesheet may not: flatten the nesting`);
282
+ tooDeep = true;
283
+ continue;
284
+ }
285
+ let keyframes = inKeyframes;
286
+ if (node.type === "atrule") {
287
+ const name = node.name.toLowerCase();
288
+ if (REFUSED_AT_RULES.has(name))
289
+ problems.push(`holds an @${name}, which reaches outside the plugin's own markup`);
290
+ else if (name === "property" && !node.params.trim().startsWith(TAILWIND_VARIABLE)) {
291
+ problems.push(`registers the custom property "${quote(node.params.trim())}" with @property, which applies to the whole admin; only Tailwind's own --tw- properties may be registered`);
292
+ }
293
+ if (name.endsWith("keyframes"))
294
+ keyframes = true;
295
+ }
296
+ else if (!inKeyframes && !inRule && !isTailwindInitialValues(node, block)) {
297
+ // A rule nested in a style rule, directly or through an at-rule (`.c{@media (x){& span{}}}`), is
298
+ // relative to its parent's selector, so only a rule outside every style rule is read here.
299
+ for (const selector of node.selectors) {
300
+ if (!isScopedSelector(selector)) {
301
+ problems.push(`styles "${quote(selector)}", which reaches elements outside the plugin's own markup: start the selector with a class of your own`);
302
+ }
303
+ }
304
+ }
305
+ if (node.nodes !== undefined)
306
+ readChildren(node.nodes, level + 1, keyframes, inRule || node.type === "rule");
307
+ }
308
+ return problems;
309
+ }
310
+ export const adminStylesCheck = {
311
+ name: "admin styles",
312
+ rule: `Every \`.css\` file of the client bundle (beside \`remoteEntry.js\` and under \`assets/\`) is at most ${formatBinarySize(ADMIN_STYLESHEET_MAX_BYTES)} and is one ` +
313
+ "`@layer plugins.<id>` block, as `kardalum plugin build` writes it, whose rules style only the plugin's own markup: each selector starts with a class or an id " +
314
+ "(every alternative of a leading `:is()` or `:where()` too; Tailwind's `--tw-` initial values on its own selector list in its own `@layer properties { @supports ... }` fallback excepted), with no `!important`, `@import`, `@namespace`, `@page`, or `@property` other than Tailwind's own, and no block nested more than " +
315
+ `${ADMIN_STYLESHEET_NESTING_MAX} deep; ` +
316
+ "not applicable when nothing view-bearing is declared or no stylesheet ships.",
317
+ gates: ["cli", "door"],
318
+ needsManifest: true,
319
+ run: ({ dir, manifest, bundle }) => {
320
+ if (!declaresClientBundle(manifest.contributions))
321
+ return { status: "skipped", message: NOT_VIEW_BEARING };
322
+ if (bundle?.buildError !== undefined)
323
+ return failed(`federation build failed: ${bundle.buildError}`);
324
+ const root = bundle?.dir ?? dir;
325
+ const pluginId = typeof manifest.id === "string" ? manifest.id : "";
326
+ let files;
327
+ try {
328
+ files = clientStylesheetsOf(root);
329
+ }
330
+ catch {
331
+ return { status: "skipped", message: "not applicable: no client bundle to read" };
332
+ }
333
+ if (files.length === 0)
334
+ return { status: "skipped", message: "not applicable: the client bundle ships no stylesheet" };
335
+ const found = [];
336
+ for (const path of files) {
337
+ const name = relative(root, path).split("\\").join("/");
338
+ // The size on disk first, so the cap bounds memory too (the CLI reads a local outDir the door's
339
+ // extraction limits never saw).
340
+ if (statSync(path).size > ADMIN_STYLESHEET_MAX_BYTES) {
341
+ found.push(`${name} is larger than ${formatBinarySize(ADMIN_STYLESHEET_MAX_BYTES)}`);
342
+ continue;
343
+ }
344
+ for (const problem of pluginStylesheetProblems(readFileSync(path, "utf8"), pluginId))
345
+ found.push(`${name} ${problem}`);
346
+ }
347
+ if (found.length > 0)
348
+ return failed(listCapped(found));
349
+ return passed(`${files.length} stylesheet${files.length === 1 ? "" : "s"} in the plugin's own layer`);
350
+ },
351
+ };
@@ -1,3 +1,5 @@
1
1
  import type { DeliveryCheck } from "./types.js";
2
+ /** Every regular file under `dir`, at any depth, never following a link. */
3
+ export declare function filesUnder(dir: string): string[];
2
4
  export declare const NOT_VIEW_BEARING = "not applicable: this plugin declares nothing view-bearing, so it ships no client bundle";
3
5
  export declare const bundleSizeCheck: DeliveryCheck;
@@ -6,7 +6,7 @@ import { BUNDLE_MAX_GZIP_BYTES, BUNDLE_WARN_SHARE, formatBinarySize } from "./li
6
6
  import { failed, passed, warning } from "./support.js";
7
7
  const kb = (bytes) => `${Math.ceil(bytes / 1024)} KiB`;
8
8
  /** Every regular file under `dir`, at any depth, never following a link. */
9
- function filesUnder(dir) {
9
+ export function filesUnder(dir) {
10
10
  const files = [];
11
11
  const pending = [dir];
12
12
  while (pending.length > 0) {
@@ -1,14 +1,19 @@
1
- import { PLUGIN_CONTENT_ACCESS_ACTIONS, PLUGIN_CONTENT_ACCESS_MAX_ENTRIES, PLUGIN_MEDIA_ACCESS_ACTIONS, checkContentAccessDeclarations, checkMediaAccessDeclarations, listIssues, } from "@kardalum/api-schemas";
1
+ import { GUARD_DOCUMENT_TYPES_MAX, GUARD_POINTS, PLUGIN_CONTENT_ACCESS_ACTIONS, PLUGIN_CONTENT_ACCESS_MAX_ENTRIES, PLUGIN_MEDIA_ACCESS_ACTIONS, checkContentAccessDeclarations, checkGuardDeclarations, checkMediaAccessDeclarations, experimentalPointsDeclared, listIssues, } from "@kardalum/api-schemas";
2
2
  import { contributionsOf, failed, list, passed, record } from "./support.js";
3
3
  // M32 F (D6): the declaration's rule, the one the SDK's manifest schema runs, read here from
4
4
  // manifest.json so the CLI and the marketplace door cannot disagree. M32 F4c (D10): the media
5
5
  // declaration joins this check rather than adding one, since both say what the plugin's code may
6
- // do through a host library as its own subject.
6
+ // do through a host library as its own subject. M35 B2: guard declarations join this check too: a
7
+ // guard sees content of the types this plugin may read.
8
+ /** The contribution keys this check reads, so its pass line names only their experimental points. */
9
+ const CONTENT_ACCESS_KEYS = new Set(["contentAccess", "mediaAccess", "guards"]);
7
10
  export const contentAccessCheck = {
8
11
  name: "content access",
9
- rule: `\`contentAccess\` names at most ${PLUGIN_CONTENT_ACCESS_MAX_ENTRIES} document types, each once, by name, each with 1 or more of ` +
10
- `${PLUGIN_CONTENT_ACCESS_ACTIONS.map((a) => `\`${a}\``).join(", ")} (an entry that writes also declares \`content.read\`), and optionally the parent types it may be acted on under. ` +
11
- `\`mediaAccess\` is an object whose \`actions\` names 1 or more of ${PLUGIN_MEDIA_ACCESS_ACTIONS.map((a) => `\`${a}\``).join(", ")}, each once.`,
12
+ rule: `\`contentAccess\` names at most ${PLUGIN_CONTENT_ACCESS_MAX_ENTRIES} entries: a document type, each once, by name, each with 1 or more of ` +
13
+ `${PLUGIN_CONTENT_ACCESS_ACTIONS.map((a) => `\`${a}\``).join(", ")} (an entry that writes also declares \`content.read\`), and optionally the parent types it may be acted on under, ` +
14
+ `or one \`{ allContent: true, actions: ["content.read"] }\` that reads every page. ` +
15
+ `\`mediaAccess\` is an object whose \`actions\` names 1 or more of ${PLUGIN_MEDIA_ACCESS_ACTIONS.map((a) => `\`${a}\``).join(", ")}, each once.` +
16
+ ` \`guards\` declares each of ${GUARD_POINTS.map((p) => `\`${p}\``).join(", ")} at most once, optionally with up to ${GUARD_DOCUMENT_TYPES_MAX} \`documentTypes\` by name, each once, and \`onFailure\` \`refuse\` or \`allow\`.`,
12
17
  gates: ["cli", "door"],
13
18
  needsManifest: true,
14
19
  run: ({ manifest }) => {
@@ -19,16 +24,24 @@ export const contentAccessCheck = {
19
24
  problems.push(`manifest.json declares its content access wrongly: ${listIssues(contentIssues)}`);
20
25
  if (mediaIssues.length > 0)
21
26
  problems.push(`manifest.json declares its media access wrongly: ${listIssues(mediaIssues)}`);
27
+ const guardIssues = checkGuardDeclarations(manifest);
28
+ if (guardIssues.length > 0)
29
+ problems.push(`manifest.json declares its guards wrongly: ${listIssues(guardIssues)}`);
22
30
  if (problems.length > 0)
23
31
  return failed(problems.join("; "));
24
32
  const entries = list(contributionsOf(manifest).contentAccess);
25
33
  const content = entries.length === 0
26
34
  ? "no content access declared"
27
- : `${entries.length} document type${entries.length === 1 ? "" : "s"}: ${entries.map((entry) => String(record(entry)?.documentType ?? "")).join(", ")}`;
35
+ : `${entries.length} entr${entries.length === 1 ? "y" : "ies"}: ${entries.map((entry) => (record(entry)?.allContent === true ? "all content (read)" : String(record(entry)?.documentType ?? ""))).join(", ")}`;
36
+ const guards = list(contributionsOf(manifest).guards).map((entry) => String(record(entry)?.point ?? ""));
37
+ const guarded = guards.length === 0 ? "" : `; guards: ${guards.join(", ")}`;
38
+ // M35: the experimental points among these keys (C1's allContent entry, B2's guards), so an author knows what may still change.
39
+ const experimental = experimentalPointsDeclared(manifest).filter((point) => CONTENT_ACCESS_KEYS.has(point.split(".")[0]));
40
+ const note = experimental.length > 0 ? ` (experimental: ${experimental.join(", ")})` : "";
28
41
  const media = record(contributionsOf(manifest).mediaAccess);
29
42
  if (!media)
30
- return passed(content);
43
+ return passed(`${content}${guarded}${note}`);
31
44
  const actions = list(media.actions).map(String).join(", ");
32
- return passed(`${content}; media access: ${actions}`);
45
+ return passed(`${content}; media access: ${actions}${guarded}${note}`);
33
46
  },
34
47
  };
@@ -31,7 +31,7 @@ export const requiredViewsCheck = {
31
31
  };
32
32
  export const apiRoutesCheck = {
33
33
  name: "api route methods and access",
34
- rule: `Every apiRoute declares a method (${API_ROUTE_METHODS.join(", ")}) and, if it names an \`access\` tier, one of (${API_ROUTE_ACCESS_TIERS.join(", ")}); a \`rawBody\` it declares is \`true\`, on a ${API_ROUTE_RAW_BODY_METHODS.slice(0, -1).join(", ")} or ${API_ROUTE_RAW_BODY_METHODS.at(-1)} route only.`,
34
+ rule: `Every apiRoute declares a method (${API_ROUTE_METHODS.join(", ")}) and, if it names an \`access\` tier, one of (${API_ROUTE_ACCESS_TIERS.join(", ")}); a \`rawBody\` it declares is \`true\`, on a ${API_ROUTE_RAW_BODY_METHODS.slice(0, -1).join(", ")} or ${API_ROUTE_RAW_BODY_METHODS.at(-1)} route only; an \`uploads\` it declares is { maxFiles, maxFileBytes, maxTotalBytes?, types } within UPLOAD_FILES_MAX, UPLOAD_FILE_BYTES_MAX, UPLOAD_REQUEST_BYTES_MAX and UPLOAD_TYPES, on a POST, PUT or PATCH route without rawBody.`,
35
35
  gates: ["cli", "door"],
36
36
  needsManifest: true,
37
37
  run: ({ manifest }) => {
@@ -1,27 +1,40 @@
1
- import { EDITOR_PANELS_MAX, EDITOR_SLOT_ID_MAX, EDITOR_SLOT_TYPES_MAX, TREE_ACTIONS_MAX, checkEditorExtensionDeclarations, listIssues, } from "@kardalum/api-schemas";
1
+ import { ADMIN_SLOTS_MAX, ADMIN_SLOTS_PER_PLACE_MAX, BULK_ACTIONS_MAX, CONTENT_COLUMNS_MAX, EDITOR_PANELS_MAX, EDITOR_SLOT_ID_MAX, EDITOR_SLOT_TYPES_MAX, LIST_FILTERS_MAX, LIST_FILTER_OPTIONS_MAX, TREE_ACTIONS_MAX, TREE_BADGES_MAX, checkAdminSlotDeclarations, checkContentSlotDeclarations, checkEditorExtensionDeclarations, listIssues, } from "@kardalum/api-schemas";
2
2
  import { contributionsOf, failed, list, passed } from "./support.js";
3
3
  const count = (n, one, many) => `${n} ${n === 1 ? one : many}`;
4
+ /** The keys the pass line counts, in its order: the two editor keys, then M35 C2's five. */
5
+ const COUNTED = [
6
+ ["editorPanels", "editor panel"],
7
+ ["treeActions", "tree action"],
8
+ ["contentColumns", "content column"],
9
+ ["treeBadges", "tree badge"],
10
+ ["listFilters", "list filter"],
11
+ ["bulkActions", "bulk action"],
12
+ ["adminSlots", "admin slot"],
13
+ ];
4
14
  // M32 F3: the rules the SDK's manifest schema runs, read here from manifest.json so the CLI and the
5
- // marketplace door cannot disagree.
15
+ // marketplace door cannot disagree. M35 C2: the content slots and the admin slots too.
6
16
  export const editorExtensionsCheck = {
7
17
  name: "editor extensions",
8
18
  rule: `\`editorPanels\` (at most ${EDITOR_PANELS_MAX}) and \`treeActions\` (at most ${TREE_ACTIONS_MAX}) have ids of 1 to ${EDITOR_SLOT_ID_MAX} ` +
9
19
  `lower-case letters, digits and "-" starting with a letter, each used once; a \`documentTypes\` list, when given, ` +
10
- `holds 1 to ${EDITOR_SLOT_TYPES_MAX} distinct document type names.`,
20
+ `holds 1 to ${EDITOR_SLOT_TYPES_MAX} distinct document type names. ` +
21
+ `\`contentColumns\` (at most ${CONTENT_COLUMNS_MAX}), \`treeBadges\` (at most ${TREE_BADGES_MAX}), \`listFilters\` ` +
22
+ `(at most ${LIST_FILTERS_MAX}, each with 1 to ${LIST_FILTER_OPTIONS_MAX} options) and \`bulkActions\` (at most ${BULK_ACTIONS_MAX}) ` +
23
+ `follow the same id and document type rules; \`adminSlots\` (at most ${ADMIN_SLOTS_MAX}, at most ${ADMIN_SLOTS_PER_PLACE_MAX} in one place) ` +
24
+ `name a known place, and only a top bar item has an icon, which it needs.`,
11
25
  gates: ["cli", "door"],
12
26
  needsManifest: true,
13
27
  run: ({ manifest }) => {
14
- const issues = checkEditorExtensionDeclarations(manifest);
28
+ const issues = [...checkEditorExtensionDeclarations(manifest), ...checkContentSlotDeclarations(manifest), ...checkAdminSlotDeclarations(manifest)];
15
29
  if (issues.length > 0)
16
30
  return failed(`manifest.json declares its editor extensions wrongly: ${listIssues(issues)}`);
17
31
  const contributions = contributionsOf(manifest);
18
32
  const parts = [];
19
- const panels = list(contributions.editorPanels).length;
20
- if (panels > 0)
21
- parts.push(count(panels, "editor panel", "editor panels"));
22
- const actions = list(contributions.treeActions).length;
23
- if (actions > 0)
24
- parts.push(count(actions, "tree action", "tree actions"));
33
+ for (const [key, one] of COUNTED) {
34
+ const n = list(contributions[key]).length;
35
+ if (n > 0)
36
+ parts.push(count(n, one, `${one}s`));
37
+ }
25
38
  return parts.length === 0 ? passed("no editor extensions declared") : passed(parts.join(", "));
26
39
  },
27
40
  };
@@ -9,8 +9,9 @@ const VALID = new Set(ICON_NAMES);
9
9
  // Every contribution kind whose schema carries an `icon`: adminSections (and
10
10
  // each entry of its optional `rail`, reported as `adminSections.rail`),
11
11
  // railEntries, dataTypes and documentTypes (optional, "" means the default
12
- // icon). No other contribution has an icon field.
13
- const ICON_BEARING = ["adminSections", "railEntries", "dataTypes", "documentTypes"];
12
+ // icon), and adminSlots (a topBar.item needs one; the other places carry
13
+ // none). No other contribution has an icon field.
14
+ const ICON_BEARING = ["adminSections", "railEntries", "dataTypes", "documentTypes", "adminSlots"];
14
15
  /** Every (where, icon) pair the icon-bearing contributions carry, a section's
15
16
  * own rail entries included, in declaration order. */
16
17
  function declaredIcons(contributions) {
@@ -2,8 +2,10 @@ export * from "./types.js";
2
2
  export * from "./limits.js";
3
3
  export { describeError, listCapped } from "./support.js";
4
4
  export { DELIVERY_CHECKS, GATE_ONLY_CHECKS, renderDeliveryLimits, renderDeliveryTable, runChecks, runDeliveryChecks } from "./registry.js";
5
+ export { TAILWIND_PROPERTIES_FALLBACK_CONDITIONS, TAILWIND_PROPERTIES_SELECTORS, adminStylesCheck, clientStylesheetsOf, isScopedSelector, pluginStylesheetProblems, wrapPluginStylesheet, } from "./admin-styles.js";
5
6
  export { archiveNameProblems, shippedEntries } from "./archive-names.js";
6
7
  export { collectLabelLanguages, collectLabelMaps } from "./label-languages.js";
7
8
  export type { LabelMapRef } from "./label-languages.js";
8
9
  export { ICON_NAMES } from "./icon-names.generated.js";
10
+ export { richTextCheck } from "./rich-text.js";
9
11
  export { LICENCE_CHECK_KEY_TEXTS, LICENCE_CHECK_MARKERS, LICENCE_CHECK_NAME, NO_LICENCE_CHECK_FOUND, SERVER_CODE_CONTRIBUTIONS, hasServerCode, licenceCheck, passedLicenceCheck } from "./licence-check.js";
@@ -2,7 +2,9 @@ export * from "./types.js";
2
2
  export * from "./limits.js";
3
3
  export { describeError, listCapped } from "./support.js";
4
4
  export { DELIVERY_CHECKS, GATE_ONLY_CHECKS, renderDeliveryLimits, renderDeliveryTable, runChecks, runDeliveryChecks } from "./registry.js";
5
+ export { TAILWIND_PROPERTIES_FALLBACK_CONDITIONS, TAILWIND_PROPERTIES_SELECTORS, adminStylesCheck, clientStylesheetsOf, isScopedSelector, pluginStylesheetProblems, wrapPluginStylesheet, } from "./admin-styles.js";
5
6
  export { archiveNameProblems, shippedEntries } from "./archive-names.js";
6
7
  export { collectLabelLanguages, collectLabelMaps } from "./label-languages.js";
7
8
  export { ICON_NAMES } from "./icon-names.generated.js";
9
+ export { richTextCheck } from "./rich-text.js";
8
10
  export { LICENCE_CHECK_KEY_TEXTS, LICENCE_CHECK_MARKERS, LICENCE_CHECK_NAME, NO_LICENCE_CHECK_FOUND, SERVER_CODE_CONTRIBUTIONS, hasServerCode, licenceCheck, passedLicenceCheck } from "./licence-check.js";