@jini-ai/admin 0.3.10 → 0.4.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 (399) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +71 -37
  3. package/dist/agent-plugins/adapters/http.d.ts +7 -0
  4. package/dist/agent-plugins/adapters/http.js +15 -0
  5. package/dist/agent-plugins/adapters/memory.d.ts +8 -0
  6. package/dist/agent-plugins/adapters/memory.js +25 -0
  7. package/dist/agent-plugins/agent-plugins.module.d.ts +51 -0
  8. package/dist/agent-plugins/agent-plugins.module.js +6 -0
  9. package/dist/agent-plugins/conformance/agent-plugins-api.conformance.d.ts +12 -0
  10. package/dist/agent-plugins/conformance/agent-plugins-api.conformance.js +47 -0
  11. package/dist/agent-plugins/controllers/agent-plugin-files.controller.d.ts +20 -0
  12. package/dist/agent-plugins/controllers/agent-plugin-files.controller.js +43 -0
  13. package/dist/agent-plugins/controllers/agent-plugins.controller.d.ts +25 -0
  14. package/dist/agent-plugins/controllers/agent-plugins.controller.js +91 -0
  15. package/dist/agent-plugins/index.d.ts +9 -0
  16. package/dist/agent-plugins/index.js +9 -0
  17. package/dist/agent-plugins/messages.en.d.ts +23 -0
  18. package/dist/agent-plugins/messages.en.js +14 -0
  19. package/dist/agent-plugins/models.d.ts +57 -0
  20. package/dist/agent-plugins/models.js +2 -0
  21. package/dist/agent-plugins/package-file-tree.d.ts +111 -0
  22. package/dist/agent-plugins/package-file-tree.js +188 -0
  23. package/dist/agent-plugins/ports.d.ts +18 -0
  24. package/dist/agent-plugins/ports.js +3 -0
  25. package/dist/agent-plugins/react/components/AgentPluginFileContent.d.ts +5 -0
  26. package/dist/agent-plugins/react/components/AgentPluginFileContent.js +9 -0
  27. package/dist/agent-plugins/react/components/AgentPluginFileTree.d.ts +9 -0
  28. package/dist/agent-plugins/react/components/AgentPluginFileTree.js +7 -0
  29. package/dist/agent-plugins/react/components/AgentPluginInspector.d.ts +3 -0
  30. package/dist/agent-plugins/react/components/AgentPluginInspector.js +11 -0
  31. package/dist/agent-plugins/react/components/AgentPluginListPanel.d.ts +6 -0
  32. package/dist/agent-plugins/react/components/AgentPluginListPanel.js +10 -0
  33. package/dist/agent-plugins/react/components/AgentPluginRow.d.ts +5 -0
  34. package/dist/agent-plugins/react/components/AgentPluginRow.js +8 -0
  35. package/dist/agent-plugins/react/hooks/AgentPluginInspector.hooks.d.ts +90 -0
  36. package/dist/agent-plugins/react/hooks/AgentPluginInspector.hooks.js +74 -0
  37. package/dist/agent-plugins/react/hooks/AgentPluginPanel.hooks.d.ts +67 -0
  38. package/dist/agent-plugins/react/hooks/AgentPluginPanel.hooks.js +50 -0
  39. package/dist/agent-plugins/react/hooks/AgentPluginRow.hooks.d.ts +55 -0
  40. package/dist/agent-plugins/react/hooks/AgentPluginRow.hooks.js +6 -0
  41. package/dist/agent-plugins/react/hooks/AgentPluginsPage.hooks.d.ts +64 -0
  42. package/dist/agent-plugins/react/hooks/AgentPluginsPage.hooks.js +39 -0
  43. package/dist/agent-plugins/react/hooks/AgentPluginsPorts.hooks.d.ts +7 -0
  44. package/dist/agent-plugins/react/hooks/AgentPluginsPorts.hooks.js +10 -0
  45. package/dist/agent-plugins/react/hooks/MarketplaceTab.hooks.d.ts +6 -0
  46. package/dist/agent-plugins/react/hooks/MarketplaceTab.hooks.js +3 -0
  47. package/dist/agent-plugins/react/index.d.ts +245 -0
  48. package/dist/agent-plugins/react/index.js +13 -0
  49. package/dist/agent-plugins/react/pages/AgentPluginsPage.d.ts +4 -0
  50. package/dist/agent-plugins/react/pages/AgentPluginsPage.js +12 -0
  51. package/dist/agent-plugins/react/tabs/DownloadedTab.d.ts +4 -0
  52. package/dist/agent-plugins/react/tabs/DownloadedTab.js +5 -0
  53. package/dist/agent-plugins/react/tabs/InstalledTab.d.ts +4 -0
  54. package/dist/agent-plugins/react/tabs/InstalledTab.js +5 -0
  55. package/dist/agent-plugins/react/tabs/MarketplaceTab.d.ts +4 -0
  56. package/dist/agent-plugins/react/tabs/MarketplaceTab.js +10 -0
  57. package/dist/agent-plugins/rules.d.ts +33 -0
  58. package/dist/agent-plugins/rules.js +51 -0
  59. package/dist/browser/index.d.ts +1 -0
  60. package/dist/browser/index.js +1 -0
  61. package/dist/browser/navigation.d.ts +19 -4
  62. package/dist/browser/navigation.js +8 -8
  63. package/dist/browser/shell-navigation.d.ts +12 -0
  64. package/dist/browser/shell-navigation.js +16 -0
  65. package/dist/contracts/credential-management.d.ts +8 -0
  66. package/dist/contracts/credential-management.js +3 -0
  67. package/dist/contracts/media-picker.d.ts +17 -0
  68. package/dist/contracts/media-picker.js +5 -0
  69. package/dist/contracts/playground-render-target.d.ts +18 -0
  70. package/dist/contracts/playground-render-target.js +3 -0
  71. package/dist/core/entities/rules.d.ts +138 -0
  72. package/dist/core/entities/rules.js +344 -0
  73. package/dist/core/gated/types.d.ts +8 -4
  74. package/dist/core/index.d.ts +4 -0
  75. package/dist/core/index.js +1 -0
  76. package/dist/core/manifest/rules.d.ts +24 -6
  77. package/dist/core/manifest/rules.js +12 -11
  78. package/dist/core/module/controller-store.d.ts +22 -0
  79. package/dist/core/module/controller-store.js +32 -0
  80. package/dist/core/module/create-admin.d.ts +41 -0
  81. package/dist/core/module/create-admin.js +187 -0
  82. package/dist/core/module/define-admin-module.d.ts +4 -0
  83. package/dist/core/module/define-admin-module.js +5 -0
  84. package/dist/core/module/index.d.ts +7 -0
  85. package/dist/core/module/index.js +4 -0
  86. package/dist/core/module/token.d.ts +19 -0
  87. package/dist/core/module/token.js +4 -0
  88. package/dist/core/module/types.d.ts +79 -0
  89. package/dist/core/module/types.js +2 -0
  90. package/dist/core/permissions/rules.d.ts +4 -1
  91. package/dist/core/permissions/rules.js +1 -1
  92. package/dist/core/ports/analytics.d.ts +1 -1
  93. package/dist/core/ports/auth.d.ts +2 -2
  94. package/dist/core/ports/comments.d.ts +9 -6
  95. package/dist/core/ports/database.d.ts +13 -10
  96. package/dist/core/ports/entities.d.ts +302 -0
  97. package/dist/core/ports/entities.js +47 -0
  98. package/dist/core/ports/forms.d.ts +19 -7
  99. package/dist/core/ports/identity.d.ts +42 -17
  100. package/dist/core/ports/index.d.ts +2 -0
  101. package/dist/core/ports/integrations.d.ts +9 -4
  102. package/dist/core/ports/media.d.ts +16 -7
  103. package/dist/core/ports/members.d.ts +7 -3
  104. package/dist/core/ports/menus.d.ts +43 -0
  105. package/dist/core/ports/menus.js +43 -0
  106. package/dist/core/ports/plugins.d.ts +3 -2
  107. package/dist/core/ports/recovery.d.ts +10 -6
  108. package/dist/core/ports/redirects.d.ts +17 -7
  109. package/dist/core/ports/seo.d.ts +12 -6
  110. package/dist/core/ports/shell.d.ts +41 -0
  111. package/dist/core/ports/shell.js +2 -0
  112. package/dist/core/ports/workspace.d.ts +3 -3
  113. package/dist/core/routing/rules.d.ts +17 -4
  114. package/dist/core/routing/rules.js +4 -4
  115. package/dist/core/transport/errors.d.ts +13 -4
  116. package/dist/core/transport/errors.js +4 -4
  117. package/dist/core/transport/http.d.ts +26 -16
  118. package/dist/core/transport/http.js +59 -21
  119. package/dist/core/transport/types.d.ts +26 -14
  120. package/dist/core/transport/types.js +9 -7
  121. package/dist/media/adapters/http.d.ts +27 -0
  122. package/dist/media/adapters/http.js +44 -0
  123. package/dist/media/adapters/memory.d.ts +11 -0
  124. package/dist/media/adapters/memory.js +139 -0
  125. package/dist/media/conformance/media-api.conformance.d.ts +7 -0
  126. package/dist/media/conformance/media-api.conformance.js +69 -0
  127. package/dist/media/controllers/edit-media.controller.d.ts +24 -0
  128. package/dist/media/controllers/edit-media.controller.js +69 -0
  129. package/dist/media/controllers/library.controller.d.ts +47 -0
  130. package/dist/media/controllers/library.controller.js +173 -0
  131. package/dist/media/controllers/providers.controller.d.ts +30 -0
  132. package/dist/media/controllers/providers.controller.js +76 -0
  133. package/dist/media/html-attributes.d.ts +82 -0
  134. package/dist/media/html-attributes.js +204 -0
  135. package/dist/media/index.d.ts +12 -0
  136. package/dist/media/index.js +9 -0
  137. package/dist/media/media.module.d.ts +83 -0
  138. package/dist/media/media.module.js +43 -0
  139. package/dist/media/messages.en.d.ts +24 -0
  140. package/dist/media/messages.en.js +24 -0
  141. package/dist/media/models.d.ts +72 -0
  142. package/dist/media/models.js +2 -0
  143. package/dist/media/ports.d.ts +75 -0
  144. package/dist/media/ports.js +7 -0
  145. package/dist/media/react/components/EditMediaPanel.d.ts +3 -0
  146. package/dist/media/react/components/EditMediaPanel.js +10 -0
  147. package/dist/media/react/components/MediaCard.d.ts +5 -0
  148. package/dist/media/react/components/MediaCard.js +17 -0
  149. package/dist/media/react/components/MediaDialog.d.ts +3 -0
  150. package/dist/media/react/components/MediaDialog.js +8 -0
  151. package/dist/media/react/components/MediaGrid.d.ts +4 -0
  152. package/dist/media/react/components/MediaGrid.js +8 -0
  153. package/dist/media/react/components/MediaIcons.d.ts +14 -0
  154. package/dist/media/react/components/MediaIcons.js +39 -0
  155. package/dist/media/react/components/MediaLightbox.d.ts +5 -0
  156. package/dist/media/react/components/MediaLightbox.js +12 -0
  157. package/dist/media/react/components/MediaPicker.d.ts +3 -0
  158. package/dist/media/react/components/MediaPicker.js +10 -0
  159. package/dist/media/react/components/MediaPurgeDialog.d.ts +4 -0
  160. package/dist/media/react/components/MediaPurgeDialog.js +9 -0
  161. package/dist/media/react/components/UploadButton.d.ts +3 -0
  162. package/dist/media/react/components/UploadButton.js +8 -0
  163. package/dist/media/react/hooks/EditMediaPanel.hooks.d.ts +84 -0
  164. package/dist/media/react/hooks/EditMediaPanel.hooks.js +105 -0
  165. package/dist/media/react/hooks/LibraryTab.hooks.d.ts +103 -0
  166. package/dist/media/react/hooks/LibraryTab.hooks.js +164 -0
  167. package/dist/media/react/hooks/MediaCard.hooks.d.ts +79 -0
  168. package/dist/media/react/hooks/MediaCard.hooks.js +63 -0
  169. package/dist/media/react/hooks/MediaDialog.hooks.d.ts +10 -0
  170. package/dist/media/react/hooks/MediaDialog.hooks.js +20 -0
  171. package/dist/media/react/hooks/MediaGrid.hooks.d.ts +28 -0
  172. package/dist/media/react/hooks/MediaGrid.hooks.js +6 -0
  173. package/dist/media/react/hooks/MediaLightbox.hooks.d.ts +27 -0
  174. package/dist/media/react/hooks/MediaLightbox.hooks.js +64 -0
  175. package/dist/media/react/hooks/MediaPage.hooks.d.ts +68 -0
  176. package/dist/media/react/hooks/MediaPage.hooks.js +68 -0
  177. package/dist/media/react/hooks/MediaPicker.hooks.d.ts +26 -0
  178. package/dist/media/react/hooks/MediaPicker.hooks.js +25 -0
  179. package/dist/media/react/hooks/MediaPorts.hooks.d.ts +9 -0
  180. package/dist/media/react/hooks/MediaPorts.hooks.js +10 -0
  181. package/dist/media/react/hooks/MediaPurgeDialog.hooks.d.ts +22 -0
  182. package/dist/media/react/hooks/MediaPurgeDialog.hooks.js +6 -0
  183. package/dist/media/react/hooks/ProvidersTab.hooks.d.ts +55 -0
  184. package/dist/media/react/hooks/ProvidersTab.hooks.js +124 -0
  185. package/dist/media/react/hooks/UploadButton.hooks.d.ts +48 -0
  186. package/dist/media/react/hooks/UploadButton.hooks.js +118 -0
  187. package/dist/media/react/index.d.ts +373 -0
  188. package/dist/media/react/index.js +73 -0
  189. package/dist/media/react/pages/MediaPage.d.ts +4 -0
  190. package/dist/media/react/pages/MediaPage.js +9 -0
  191. package/dist/media/react/tabs/LibraryTab.d.ts +4 -0
  192. package/dist/media/react/tabs/LibraryTab.js +14 -0
  193. package/dist/media/react/tabs/ProvidersTab.d.ts +4 -0
  194. package/dist/media/react/tabs/ProvidersTab.js +10 -0
  195. package/dist/media/rules.d.ts +80 -0
  196. package/dist/media/rules.js +127 -0
  197. package/dist/media/styles.d.ts +4 -0
  198. package/dist/media/styles.js +5 -0
  199. package/dist/playground/adapters/http.d.ts +8 -0
  200. package/dist/playground/adapters/http.js +4 -0
  201. package/dist/playground/adapters/memory.d.ts +10 -0
  202. package/dist/playground/adapters/memory.js +30 -0
  203. package/dist/playground/conformance/playground-api.conformance.d.ts +6 -0
  204. package/dist/playground/conformance/playground-api.conformance.js +37 -0
  205. package/dist/playground/controllers/playground.controller.d.ts +16 -0
  206. package/dist/playground/controllers/playground.controller.js +21 -0
  207. package/dist/playground/index.d.ts +7 -0
  208. package/dist/playground/index.js +5 -0
  209. package/dist/playground/messages.en.d.ts +9 -0
  210. package/dist/playground/messages.en.js +2 -0
  211. package/dist/playground/models.d.ts +4 -0
  212. package/dist/playground/models.js +2 -0
  213. package/dist/playground/playground.module.d.ts +31 -0
  214. package/dist/playground/playground.module.js +5 -0
  215. package/dist/playground/ports.d.ts +5 -0
  216. package/dist/playground/ports.js +2 -0
  217. package/dist/playground/react/components/Canvas.d.ts +3 -0
  218. package/dist/playground/react/components/Canvas.js +9 -0
  219. package/dist/playground/react/hooks/Canvas.hooks.d.ts +7 -0
  220. package/dist/playground/react/hooks/Canvas.hooks.js +18 -0
  221. package/dist/playground/react/hooks/PlaygroundPage.hooks.d.ts +8 -0
  222. package/dist/playground/react/hooks/PlaygroundPage.hooks.js +2 -0
  223. package/dist/playground/react/hooks/PlaygroundPorts.hooks.d.ts +4 -0
  224. package/dist/playground/react/hooks/PlaygroundPorts.hooks.js +6 -0
  225. package/dist/playground/react/index.d.ts +136 -0
  226. package/dist/playground/react/index.js +10 -0
  227. package/dist/playground/react/pages/PlaygroundPage.d.ts +4 -0
  228. package/dist/playground/react/pages/PlaygroundPage.js +11 -0
  229. package/dist/playground/react/tabs/CanvasTab.d.ts +4 -0
  230. package/dist/playground/react/tabs/CanvasTab.js +5 -0
  231. package/dist/playground/rules.d.ts +4 -0
  232. package/dist/playground/rules.js +2 -0
  233. package/dist/react/OverlayHost.d.ts +3 -0
  234. package/dist/react/OverlayHost.hooks.d.ts +9 -0
  235. package/dist/react/OverlayHost.hooks.js +9 -0
  236. package/dist/react/OverlayHost.js +7 -0
  237. package/dist/react/bind-react.d.ts +46 -0
  238. package/dist/react/bind-react.js +28 -0
  239. package/dist/react/components/ConfirmButton/ConfirmButton.hooks.d.ts +7 -1
  240. package/dist/react/components/ConfirmButton/ConfirmButton.hooks.js +2 -2
  241. package/dist/react/components/ConfirmButton/ConfirmButton.js +1 -1
  242. package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.d.ts +17 -3
  243. package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.js +3 -3
  244. package/dist/react/components/ConfirmDialog/ConfirmDialog.js +5 -5
  245. package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.d.ts +6 -2
  246. package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.js +7 -8
  247. package/dist/react/components/RowMenu/RowMenu.d.ts +5 -1
  248. package/dist/react/components/RowMenu/RowMenu.hooks.d.ts +8 -2
  249. package/dist/react/components/RowMenu/RowMenu.hooks.js +4 -4
  250. package/dist/react/components/RowMenu/RowMenu.js +6 -6
  251. package/dist/react/components/Sidebar.d.ts +1 -1
  252. package/dist/react/components/Sidebar.js +103 -7
  253. package/dist/react/entities/EntityCell.d.ts +10 -0
  254. package/dist/react/entities/EntityCell.js +18 -0
  255. package/dist/react/entities/EntityDetail.d.ts +3 -0
  256. package/dist/react/entities/EntityDetail.js +21 -0
  257. package/dist/react/entities/EntityEdit.d.ts +13 -0
  258. package/dist/react/entities/EntityEdit.js +45 -0
  259. package/dist/react/entities/EntityField.d.ts +20 -0
  260. package/dist/react/entities/EntityField.js +31 -0
  261. package/dist/react/entities/EntityIndex.d.ts +3 -0
  262. package/dist/react/entities/EntityIndex.js +10 -0
  263. package/dist/react/entities/EntityList.d.ts +7 -0
  264. package/dist/react/entities/EntityList.js +52 -0
  265. package/dist/react/entities/contribution.d.ts +26 -0
  266. package/dist/react/entities/contribution.js +78 -0
  267. package/dist/react/entities/index.d.ts +10 -0
  268. package/dist/react/entities/index.js +7 -0
  269. package/dist/react/entities/rules.d.ts +179 -0
  270. package/dist/react/entities/rules.js +224 -0
  271. package/dist/react/entities/types.d.ts +45 -0
  272. package/dist/react/entities/types.js +5 -0
  273. package/dist/react/entities/use-entity-edit.d.ts +35 -0
  274. package/dist/react/entities/use-entity-edit.js +98 -0
  275. package/dist/react/entities/use-entity-read.d.ts +22 -0
  276. package/dist/react/entities/use-entity-read.js +27 -0
  277. package/dist/react/hooks/use-nav-sections.d.ts +12 -3
  278. package/dist/react/hooks/use-nav-sections.js +14 -14
  279. package/dist/react/hooks/use-sidebar-rail.d.ts +7 -1
  280. package/dist/react/hooks/use-sidebar-rail.js +11 -11
  281. package/dist/react/index.d.ts +3 -1
  282. package/dist/react/index.js +5 -2
  283. package/dist/react/kit/Kit.hooks.d.ts +13 -0
  284. package/dist/react/kit/Kit.hooks.js +10 -0
  285. package/dist/react/kit/Native.hooks.d.ts +38 -0
  286. package/dist/react/kit/Native.hooks.js +65 -0
  287. package/dist/react/kit/index.d.ts +12 -0
  288. package/dist/react/kit/index.js +21 -0
  289. package/dist/react/kit/native.d.ts +3 -0
  290. package/dist/react/kit/native.js +21 -0
  291. package/dist/react/kit/types.d.ts +40 -0
  292. package/dist/react/kit/types.js +2 -0
  293. package/dist/react/overlay.d.ts +36 -0
  294. package/dist/react/overlay.js +35 -0
  295. package/dist/react/overlays.d.ts +38 -0
  296. package/dist/react/overlays.js +46 -0
  297. package/dist/react/shell/AdminShell.d.ts +9 -0
  298. package/dist/react/shell/AdminShell.hooks.d.ts +15 -0
  299. package/dist/react/shell/AdminShell.hooks.js +27 -0
  300. package/dist/react/shell/AdminShell.js +46 -0
  301. package/dist/react/shell/index.d.ts +7 -0
  302. package/dist/react/shell/index.js +5 -0
  303. package/dist/react/shell/model.d.ts +25 -0
  304. package/dist/react/shell/model.js +29 -0
  305. package/dist/react/shell/theme-ports.d.ts +28 -0
  306. package/dist/react/shell/theme-ports.js +2 -0
  307. package/dist/react/shell/types.d.ts +99 -0
  308. package/dist/react/shell/types.js +2 -0
  309. package/dist/react/shell/use-admin-shell-session.d.ts +13 -0
  310. package/dist/react/shell/use-admin-shell-session.js +81 -0
  311. package/dist/react/shell/use-admin-theme.d.ts +16 -0
  312. package/dist/react/shell/use-admin-theme.js +57 -0
  313. package/dist/react/types.d.ts +6 -4
  314. package/dist/react/types.js +2 -2
  315. package/dist/react/use-controller.d.ts +16 -0
  316. package/dist/react/use-controller.js +18 -0
  317. package/dist/security/adapters/http.d.ts +16 -0
  318. package/dist/security/adapters/http.js +94 -0
  319. package/dist/security/adapters/memory.d.ts +15 -0
  320. package/dist/security/adapters/memory.js +60 -0
  321. package/dist/security/conformance/security-api.conformance.d.ts +10 -0
  322. package/dist/security/conformance/security-api.conformance.js +48 -0
  323. package/dist/security/controllers/access-tokens.controller.d.ts +44 -0
  324. package/dist/security/controllers/access-tokens.controller.js +112 -0
  325. package/dist/security/controllers/other-credentials.controller.d.ts +30 -0
  326. package/dist/security/controllers/other-credentials.controller.js +74 -0
  327. package/dist/security/controllers/root-key.controller.d.ts +35 -0
  328. package/dist/security/controllers/root-key.controller.js +90 -0
  329. package/dist/security/index.d.ts +9 -0
  330. package/dist/security/index.js +9 -0
  331. package/dist/security/messages.en.d.ts +12 -0
  332. package/dist/security/messages.en.js +2 -0
  333. package/dist/security/models.d.ts +112 -0
  334. package/dist/security/models.js +2 -0
  335. package/dist/security/ports.d.ts +58 -0
  336. package/dist/security/ports.js +5 -0
  337. package/dist/security/react/components/CredentialEditor.d.ts +3 -0
  338. package/dist/security/react/components/CredentialEditor.js +8 -0
  339. package/dist/security/react/hooks/AccessTokensTab.hooks.d.ts +94 -0
  340. package/dist/security/react/hooks/AccessTokensTab.hooks.js +36 -0
  341. package/dist/security/react/hooks/CredentialEditor.hooks.d.ts +49 -0
  342. package/dist/security/react/hooks/CredentialEditor.hooks.js +14 -0
  343. package/dist/security/react/hooks/RootKeyTab.hooks.d.ts +29 -0
  344. package/dist/security/react/hooks/RootKeyTab.hooks.js +19 -0
  345. package/dist/security/react/hooks/SecurityPage.hooks.d.ts +17 -0
  346. package/dist/security/react/hooks/SecurityPage.hooks.js +12 -0
  347. package/dist/security/react/hooks/SecurityPorts.hooks.d.ts +9 -0
  348. package/dist/security/react/hooks/SecurityPorts.hooks.js +6 -0
  349. package/dist/security/react/index.d.ts +215 -0
  350. package/dist/security/react/index.js +10 -0
  351. package/dist/security/react/pages/SecurityPage.d.ts +4 -0
  352. package/dist/security/react/pages/SecurityPage.js +10 -0
  353. package/dist/security/react/tabs/AccessTokensTab.d.ts +4 -0
  354. package/dist/security/react/tabs/AccessTokensTab.js +10 -0
  355. package/dist/security/react/tabs/RootKeyTab.d.ts +4 -0
  356. package/dist/security/react/tabs/RootKeyTab.js +9 -0
  357. package/dist/security/rules.d.ts +57 -0
  358. package/dist/security/rules.js +63 -0
  359. package/dist/security/security.module.d.ts +45 -0
  360. package/dist/security/security.module.js +5 -0
  361. package/dist/source-control/adapters/http.d.ts +6 -0
  362. package/dist/source-control/adapters/http.js +13 -0
  363. package/dist/source-control/adapters/memory.d.ts +9 -0
  364. package/dist/source-control/adapters/memory.js +35 -0
  365. package/dist/source-control/conformance/source-control-api.conformance.d.ts +10 -0
  366. package/dist/source-control/conformance/source-control-api.conformance.js +48 -0
  367. package/dist/source-control/controllers/source-control.controller.d.ts +26 -0
  368. package/dist/source-control/controllers/source-control.controller.js +70 -0
  369. package/dist/source-control/index.d.ts +8 -0
  370. package/dist/source-control/index.js +6 -0
  371. package/dist/source-control/messages.en.d.ts +11 -0
  372. package/dist/source-control/messages.en.js +2 -0
  373. package/dist/source-control/models.d.ts +70 -0
  374. package/dist/source-control/models.js +2 -0
  375. package/dist/source-control/ports.d.ts +23 -0
  376. package/dist/source-control/ports.js +3 -0
  377. package/dist/source-control/react/components/SourceControlCredentialFields.d.ts +5 -0
  378. package/dist/source-control/react/components/SourceControlCredentialFields.js +8 -0
  379. package/dist/source-control/react/components/SourceControlProviderRow.d.ts +5 -0
  380. package/dist/source-control/react/components/SourceControlProviderRow.js +7 -0
  381. package/dist/source-control/react/hooks/ProvidersTab.hooks.d.ts +45 -0
  382. package/dist/source-control/react/hooks/ProvidersTab.hooks.js +20 -0
  383. package/dist/source-control/react/hooks/SourceControlCredentialFields.hooks.d.ts +43 -0
  384. package/dist/source-control/react/hooks/SourceControlCredentialFields.hooks.js +9 -0
  385. package/dist/source-control/react/hooks/SourceControlPage.hooks.d.ts +17 -0
  386. package/dist/source-control/react/hooks/SourceControlPage.hooks.js +5 -0
  387. package/dist/source-control/react/hooks/SourceControlPorts.hooks.d.ts +9 -0
  388. package/dist/source-control/react/hooks/SourceControlPorts.hooks.js +6 -0
  389. package/dist/source-control/react/index.d.ts +156 -0
  390. package/dist/source-control/react/index.js +10 -0
  391. package/dist/source-control/react/pages/SourceControlPage.d.ts +4 -0
  392. package/dist/source-control/react/pages/SourceControlPage.js +11 -0
  393. package/dist/source-control/react/tabs/ProvidersTab.d.ts +4 -0
  394. package/dist/source-control/react/tabs/ProvidersTab.js +10 -0
  395. package/dist/source-control/rules.d.ts +32 -0
  396. package/dist/source-control/rules.js +35 -0
  397. package/dist/source-control/source-control.module.d.ts +36 -0
  398. package/dist/source-control/source-control.module.js +6 -0
  399. package/package.json +207 -4
@@ -0,0 +1,136 @@
1
+ export { usePlaygroundPorts } from './hooks/PlaygroundPorts.hooks.js';
2
+ export declare function playground(_required: Record<string, never>, _optional?: {}): {
3
+ id: "playground";
4
+ requires: {
5
+ readonly playgroundTargets: import("../../core/module/token.js").AdminPortToken<import("../../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
6
+ };
7
+ messages: Readonly<{
8
+ title: "Playground";
9
+ studio: "Studio";
10
+ canvas: "Canvas";
11
+ description: "Ask the assistant to build anything — try “Show a pie chart of my data.”";
12
+ empty: "Nothing drawn yet — ask the assistant.";
13
+ denied: "Permission denied";
14
+ }>;
15
+ pages: {
16
+ readonly playground: {
17
+ readonly path: "/playground";
18
+ readonly label: "Playground";
19
+ readonly permissions: readonly ["playground.read"];
20
+ readonly nav: {
21
+ readonly group: "studio";
22
+ readonly icon: "canvas";
23
+ };
24
+ readonly tabs: {
25
+ readonly canvas: {
26
+ readonly label: "Canvas";
27
+ };
28
+ };
29
+ };
30
+ };
31
+ } & {
32
+ react: {
33
+ module: {
34
+ id: "playground";
35
+ requires: {
36
+ readonly playgroundTargets: import("../../core/module/token.js").AdminPortToken<import("../../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
37
+ };
38
+ messages: Readonly<{
39
+ title: "Playground";
40
+ studio: "Studio";
41
+ canvas: "Canvas";
42
+ description: "Ask the assistant to build anything — try “Show a pie chart of my data.”";
43
+ empty: "Nothing drawn yet — ask the assistant.";
44
+ denied: "Permission denied";
45
+ }>;
46
+ pages: {
47
+ readonly playground: {
48
+ readonly path: "/playground";
49
+ readonly label: "Playground";
50
+ readonly permissions: readonly ["playground.read"];
51
+ readonly nav: {
52
+ readonly group: "studio";
53
+ readonly icon: "canvas";
54
+ };
55
+ readonly tabs: {
56
+ readonly canvas: {
57
+ readonly label: "Canvas";
58
+ };
59
+ };
60
+ };
61
+ };
62
+ };
63
+ pages: {
64
+ readonly playground: {
65
+ Page: import("react").LazyExoticComponent<import("react").ComponentType<import("../../react/bind-react.js").ModulePageProps>>;
66
+ tabs: {
67
+ readonly canvas: import("react").LazyExoticComponent<import("react").ComponentType<import("../../react/bind-react.js").TabViewProps>>;
68
+ };
69
+ };
70
+ };
71
+ Provider: ({ admin, children }: {
72
+ admin: import("../../core/module/types.js").AdminInstance;
73
+ children: import("react").ReactNode;
74
+ }, _optional?: Record<string, never>) => import("react").FunctionComponentElement<import("react").ProviderProps<import("../../core/module/types.js").ScopedPorts<{
75
+ id: "playground";
76
+ requires: {
77
+ readonly playgroundTargets: import("../../core/module/token.js").AdminPortToken<import("../../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
78
+ };
79
+ messages: Readonly<{
80
+ title: "Playground";
81
+ studio: "Studio";
82
+ canvas: "Canvas";
83
+ description: "Ask the assistant to build anything — try “Show a pie chart of my data.”";
84
+ empty: "Nothing drawn yet — ask the assistant.";
85
+ denied: "Permission denied";
86
+ }>;
87
+ pages: {
88
+ readonly playground: {
89
+ readonly path: "/playground";
90
+ readonly label: "Playground";
91
+ readonly permissions: readonly ["playground.read"];
92
+ readonly nav: {
93
+ readonly group: "studio";
94
+ readonly icon: "canvas";
95
+ };
96
+ readonly tabs: {
97
+ readonly canvas: {
98
+ readonly label: "Canvas";
99
+ };
100
+ };
101
+ };
102
+ };
103
+ }> | null>>;
104
+ usePorts: (_required?: Record<string, never>, _optional?: Record<string, never>) => import("../../core/module/types.js").ScopedPorts<{
105
+ id: "playground";
106
+ requires: {
107
+ readonly playgroundTargets: import("../../core/module/token.js").AdminPortToken<import("../../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
108
+ };
109
+ messages: Readonly<{
110
+ title: "Playground";
111
+ studio: "Studio";
112
+ canvas: "Canvas";
113
+ description: "Ask the assistant to build anything — try “Show a pie chart of my data.”";
114
+ empty: "Nothing drawn yet — ask the assistant.";
115
+ denied: "Permission denied";
116
+ }>;
117
+ pages: {
118
+ readonly playground: {
119
+ readonly path: "/playground";
120
+ readonly label: "Playground";
121
+ readonly permissions: readonly ["playground.read"];
122
+ readonly nav: {
123
+ readonly group: "studio";
124
+ readonly icon: "canvas";
125
+ };
126
+ readonly tabs: {
127
+ readonly canvas: {
128
+ readonly label: "Canvas";
129
+ };
130
+ };
131
+ };
132
+ };
133
+ }>;
134
+ };
135
+ };
136
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,10 @@
1
+ import { bindReact } from '../../react/bind-react.js';
2
+ import { playgroundModule } from '../playground.module.js';
3
+ import { PlaygroundPortsContext } from './hooks/PlaygroundPorts.hooks.js';
4
+ export { usePlaygroundPorts } from './hooks/PlaygroundPorts.hooks.js';
5
+ export function playground(_required, _optional = {}) {
6
+ const module = { ...playgroundModule };
7
+ const react = bindReact({ module, views: { playground: { page: () => import('./pages/PlaygroundPage.js'), tabs: { canvas: () => import('./tabs/CanvasTab.js') } } } }, { context: PlaygroundPortsContext });
8
+ return Object.assign(module, { react });
9
+ }
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,4 @@
1
+ import type { ModulePageProps } from '../../../react/bind-react.js';
2
+ export declare function PlaygroundPage(props: ModulePageProps, _optional?: {}): import("react").JSX.Element;
3
+ export default PlaygroundPage;
4
+ //# sourceMappingURL=PlaygroundPage.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Suspense } from 'react';
3
+ import { Notice, Spinner } from '@jini-ai/ui-kit/react';
4
+ import { usePlaygroundPage } from '../hooks/PlaygroundPage.hooks.js';
5
+ import { playgroundMessagesEn as m } from '../../messages.en.js';
6
+ export function PlaygroundPage(props, _optional = {}) {
7
+ const vm = usePlaygroundPage(props);
8
+ return _jsxs("section", { "data-jini-part": "playground.page", children: [_jsx("p", { children: m.studio }), _jsx("h1", { children: props.description.label }), vm.denied ? _jsx(Notice, { tone: "danger", children: m.denied }) : _jsxs(_Fragment, { children: [_jsx("p", { children: m.description }), _jsx(Suspense, { fallback: _jsx(Spinner, { label: "Loading canvas\u2026" }), children: vm.ActiveTab && _jsx(vm.ActiveTab, { params: vm.params, permissions: vm.permissions }) })] })] });
9
+ }
10
+ export default PlaygroundPage;
11
+ //# sourceMappingURL=PlaygroundPage.js.map
@@ -0,0 +1,4 @@
1
+ import type { TabViewProps } from '../../../react/bind-react.js';
2
+ export declare function CanvasTab(props: TabViewProps, _optional?: {}): import("react").JSX.Element;
3
+ export default CanvasTab;
4
+ //# sourceMappingURL=CanvasTab.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Canvas } from '../components/Canvas.js';
3
+ export function CanvasTab(props, _optional = {}) { return _jsx(Canvas, { ...props }); }
4
+ export default CanvasTab;
5
+ //# sourceMappingURL=CanvasTab.js.map
@@ -0,0 +1,4 @@
1
+ export declare function canMountPlayground({ permissions }: {
2
+ permissions: readonly string[];
3
+ }, _optional?: {}): boolean;
4
+ //# sourceMappingURL=rules.d.ts.map
@@ -0,0 +1,2 @@
1
+ export function canMountPlayground({ permissions }, _optional = {}) { return permissions.includes('playground.read'); }
2
+ //# sourceMappingURL=rules.js.map
@@ -0,0 +1,3 @@
1
+ import type { OverlayHostProps } from './OverlayHost.hooks.js';
2
+ export declare function OverlayHost(props: OverlayHostProps, _optional?: Record<string, never>): import("react").JSX.Element;
3
+ //# sourceMappingURL=OverlayHost.d.ts.map
@@ -0,0 +1,9 @@
1
+ import type { createOverlayController } from './overlays.js';
2
+ export interface OverlayHostProps {
3
+ readonly controller: ReturnType<typeof createOverlayController>;
4
+ }
5
+ export declare function useOverlayHost({ controller }: OverlayHostProps, _optional?: Record<string, never>): {
6
+ id: number;
7
+ content: import("react").ReactNode;
8
+ }[];
9
+ //# sourceMappingURL=OverlayHost.hooks.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { useSyncExternalStore, useEffect, useCallback } from 'react';
2
+ export function useOverlayHost({ controller }, _optional = {}) {
3
+ const subscribe = useCallback((listener) => controller.subscribe({ listener }), [controller]);
4
+ const snapshot = useSyncExternalStore(subscribe, controller.getSnapshot, controller.getSnapshot);
5
+ // Host unmount cancels a waiting service call but keeps the controller replay-safe.
6
+ useEffect(() => () => controller.cancel(), [controller]);
7
+ return snapshot.entries.map((entry) => ({ id: entry.id, content: entry.render() }));
8
+ }
9
+ //# sourceMappingURL=OverlayHost.hooks.js.map
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useOverlayHost } from './OverlayHost.hooks.js';
3
+ export function OverlayHost(props, _optional = {}) {
4
+ const entries = useOverlayHost(props);
5
+ return (_jsx("div", { "data-jini-part": "admin.overlays", children: entries.map((entry) => (_jsx("div", { children: entry.content }, entry.id))) }));
6
+ }
7
+ //# sourceMappingURL=OverlayHost.js.map
@@ -0,0 +1,46 @@
1
+ import type { ComponentType, ReactNode, LazyExoticComponent, Context as ReactContext } from 'react';
2
+ import type { AdminInstance, AdminModule, ScopedPorts } from '../core/module/types.js';
3
+ export interface TabViewProps {
4
+ readonly params: Readonly<Record<string, unknown>>;
5
+ readonly permissions?: readonly string[];
6
+ }
7
+ export interface ModulePageProps {
8
+ readonly tabs: Readonly<Record<string, LazyExoticComponent<ComponentType<TabViewProps>>>>;
9
+ readonly description: ReturnType<AdminInstance['describe']>['pages'][number];
10
+ readonly requestedTab?: string;
11
+ readonly onTabChange?: (required: {
12
+ tab: string;
13
+ }, optional?: Record<string, never>) => void;
14
+ }
15
+ type Loader<P> = () => Promise<{
16
+ default: ComponentType<P>;
17
+ }>;
18
+ export type ReactViews<M extends AdminModule> = {
19
+ readonly [P in keyof M['pages']]: {
20
+ readonly page: Loader<ModulePageProps>;
21
+ readonly tabs: {
22
+ readonly [T in keyof M['pages'][P]['tabs']]: Loader<TabViewProps>;
23
+ };
24
+ };
25
+ };
26
+ /** Every page and tab is lazy. The only port context is private to this binding;
27
+ * a sibling module can never read another module's dependencies through a global locator. */
28
+ export declare function bindReact<const M extends AdminModule>({ module, views }: {
29
+ module: M;
30
+ views: ReactViews<M>;
31
+ }, { context }?: {
32
+ context?: ReactContext<ScopedPorts<M> | null>;
33
+ }): {
34
+ module: M;
35
+ pages: { [P in keyof M["pages"]]: {
36
+ Page: LazyExoticComponent<ComponentType<ModulePageProps>>;
37
+ tabs: { [T in keyof M["pages"][P]["tabs"]]: LazyExoticComponent<ComponentType<TabViewProps>>; };
38
+ }; };
39
+ Provider: ({ admin, children }: {
40
+ admin: AdminInstance;
41
+ children: ReactNode;
42
+ }, _optional?: Record<string, never>) => import("react").FunctionComponentElement<import("react").ProviderProps<ScopedPorts<M> | null>>;
43
+ usePorts: (_required?: Record<string, never>, _optional?: Record<string, never>) => ScopedPorts<M>;
44
+ };
45
+ export {};
46
+ //# sourceMappingURL=bind-react.d.ts.map
@@ -0,0 +1,28 @@
1
+ import { createContext, createElement, lazy, useContext } from 'react';
2
+ import { AdminConfigError } from '../core/module/create-admin.js';
3
+ /** Every page and tab is lazy. The only port context is private to this binding;
4
+ * a sibling module can never read another module's dependencies through a global locator. */
5
+ export function bindReact({ module, views }, { context } = {}) {
6
+ const Context = context ?? createContext(null);
7
+ const pages = Object.fromEntries(Object.entries(views).map(([id, raw]) => {
8
+ const view = raw;
9
+ return [
10
+ id,
11
+ {
12
+ Page: lazy(view.page),
13
+ tabs: Object.fromEntries(Object.entries(view.tabs).map(([tab, load]) => [tab, lazy(load)])),
14
+ },
15
+ ];
16
+ }));
17
+ function usePorts(_required = {}, _optional = {}) {
18
+ const ports = useContext(Context);
19
+ if (!ports)
20
+ throw new AdminConfigError({ issues: [`React scope unavailable: ${module.id}`] });
21
+ return ports;
22
+ }
23
+ function Provider({ admin, children }, _optional = {}) {
24
+ return createElement(Context.Provider, { value: admin.scope({ module }) }, children);
25
+ }
26
+ return { module, pages, Provider, usePorts };
27
+ }
28
+ //# sourceMappingURL=bind-react.js.map
@@ -13,7 +13,13 @@
13
13
  * @complexity O(1) per render/interaction. The two document-level listeners are attached only while
14
14
  * armed, not for the component's whole mounted lifetime.
15
15
  */
16
- export declare function useConfirmButton(pending: boolean | undefined, disabled: boolean | undefined, onConfirm: () => void): {
16
+ export declare function useConfirmButton({ onConfirm, document }: {
17
+ readonly onConfirm: () => void;
18
+ readonly document: Pick<Document, 'addEventListener' | 'removeEventListener'>;
19
+ }, { pending, disabled }?: {
20
+ readonly pending?: boolean | undefined;
21
+ readonly disabled?: boolean | undefined;
22
+ }): {
17
23
  confirming: boolean;
18
24
  buttonRef: import("react").RefObject<HTMLButtonElement | null>;
19
25
  handleClick: () => void;
@@ -14,7 +14,7 @@ import { useEffect, useRef, useState } from 'react';
14
14
  * @complexity O(1) per render/interaction. The two document-level listeners are attached only while
15
15
  * armed, not for the component's whole mounted lifetime.
16
16
  */
17
- export function useConfirmButton(pending, disabled, onConfirm) {
17
+ export function useConfirmButton({ onConfirm, document }, { pending, disabled } = {}) {
18
18
  const [confirming, setConfirming] = useState(false);
19
19
  const buttonRef = useRef(null);
20
20
  // Listeners are scoped to the armed window only — an idle (disarmed) ConfirmButton costs nothing
@@ -40,7 +40,7 @@ export function useConfirmButton(pending, disabled, onConfirm) {
40
40
  document.removeEventListener('mousedown', onDocMouseDown);
41
41
  document.removeEventListener('keydown', onKeyDown);
42
42
  };
43
- }, [confirming]);
43
+ }, [confirming, document]);
44
44
  function handleClick() {
45
45
  if (pending || disabled)
46
46
  return;
@@ -28,7 +28,7 @@ const DEFAULT_PENDING_LABEL = '…';
28
28
  * defaulted to the real implementation, so a test can supply a fake without mocking modules).
29
29
  */
30
30
  export function ConfirmButton({ useConfirmButton: useConfirmButtonState = useConfirmButton, ...props }) {
31
- const { confirming, buttonRef, handleClick, handleBlur } = useConfirmButtonState(props.pending, props.disabled, props.onConfirm);
31
+ const { confirming, buttonRef, handleClick, handleBlur } = useConfirmButtonState({ onConfirm: props.onConfirm, document }, { pending: props.pending, disabled: props.disabled });
32
32
  const label = props.pending
33
33
  ? (props.pendingLabel ?? DEFAULT_PENDING_LABEL)
34
34
  : confirming
@@ -32,7 +32,13 @@ export interface ConfirmDialogController {
32
32
  }
33
33
  /** The signature `ConfirmDialogProps.useDialog` accepts. Any hook matching this can drive the
34
34
  * component; it does not have to be {@link useConfirmDialog}, or even use React state at all. */
35
- export type UseConfirmDialog = (open: boolean, pending: boolean | undefined, onCancel: () => void) => ConfirmDialogController;
35
+ export type UseConfirmDialog = (requiredArgs: {
36
+ readonly open: boolean;
37
+ readonly onCancel: () => void;
38
+ readonly document: Pick<Document, 'activeElement'>;
39
+ }, optionalArgs?: {
40
+ readonly pending?: boolean | undefined;
41
+ }) => ConfirmDialogController;
36
42
  /**
37
43
  * Host-wide defaults every `ConfirmDialog` beneath a {@link ConfirmDialogDefaultsProvider} falls
38
44
  * back to when the matching prop is not passed explicitly. Today this is only `cancelLabel` — see
@@ -68,7 +74,9 @@ export declare function ConfirmDialogDefaultsProvider({ children, cancelLabel }:
68
74
  * @returns The label to render.
69
75
  * @complexity O(1).
70
76
  */
71
- export declare function useConfirmDialogCancelLabel(explicit: string | undefined): string;
77
+ export declare function useConfirmDialogCancelLabel(_requiredArgs: Record<string, never>, { explicit }?: {
78
+ readonly explicit?: string | undefined;
79
+ }): string;
72
80
  /**
73
81
  * Owns the `<dialog>` element's open/close lifecycle and focus management for `ConfirmDialog`.
74
82
  *
@@ -81,5 +89,11 @@ export declare function useConfirmDialogCancelLabel(explicit: string | undefined
81
89
  *
82
90
  * @complexity O(1) per open/close transition — one `showModal`/`close` call and one focus move.
83
91
  */
84
- export declare function useConfirmDialog(open: boolean, pending: boolean | undefined, onCancel: () => void): ConfirmDialogController;
92
+ export declare function useConfirmDialog({ open, onCancel, document }: {
93
+ readonly open: boolean;
94
+ readonly onCancel: () => void;
95
+ readonly document: Pick<Document, 'activeElement'>;
96
+ }, { pending }?: {
97
+ readonly pending?: boolean | undefined;
98
+ }): ConfirmDialogController;
85
99
  //# sourceMappingURL=ConfirmDialog.hooks.d.ts.map
@@ -36,7 +36,7 @@ export function ConfirmDialogDefaultsProvider({ children, cancelLabel }) {
36
36
  * @returns The label to render.
37
37
  * @complexity O(1).
38
38
  */
39
- export function useConfirmDialogCancelLabel(explicit) {
39
+ export function useConfirmDialogCancelLabel(_requiredArgs, { explicit } = {}) {
40
40
  const { cancelLabel } = useContext(ConfirmDialogDefaultsContext);
41
41
  return explicit ?? cancelLabel ?? DEFAULT_CANCEL_LABEL;
42
42
  }
@@ -52,7 +52,7 @@ export function useConfirmDialogCancelLabel(explicit) {
52
52
  *
53
53
  * @complexity O(1) per open/close transition — one `showModal`/`close` call and one focus move.
54
54
  */
55
- export function useConfirmDialog(open, pending, onCancel) {
55
+ export function useConfirmDialog({ open, onCancel, document }, { pending } = {}) {
56
56
  // `useId()`, not a string literal — a hardcoded id breaks the moment a screen mounts two
57
57
  // `ConfirmDialog`s at once (a delete-role and a delete-policy confirm on one page, both
58
58
  // stay-mounted/toggle-`open` per this hook's own doc comment above): two `<h2>`s share one
@@ -95,7 +95,7 @@ export function useConfirmDialog(open, pending, onCancel) {
95
95
  if (triggerRef.current instanceof HTMLElement)
96
96
  triggerRef.current.focus();
97
97
  }
98
- }, [open]);
98
+ }, [open, document]);
99
99
  function handleNativeCancel(e) {
100
100
  // Fires on Escape while a real `showModal()`-opened dialog has focus. Always prevented: the
101
101
  // effect above is the single source of truth for open/closed (driven by `open`), so
@@ -65,7 +65,7 @@ function confirmDialogCancelLabel(cancelLabel, title) {
65
65
  * @complexity O(1).
66
66
  */
67
67
  function confirmDialogAgentProps(base, action, options) {
68
- return base === undefined ? {} : agentHandle(`${base}-${action}`, options);
68
+ return base === undefined ? {} : agentHandle({ handle: `${base}-${action}` }, options);
69
69
  }
70
70
  /**
71
71
  * Controlled modal confirm — renders the `<dialog>` markup and delegates its open/close and focus
@@ -77,13 +77,13 @@ function confirmDialogAgentProps(base, action, options) {
77
77
  * from an explicit click or explicit Tab-then-Enter onto it.
78
78
  */
79
79
  export function ConfirmDialog({ useDialog = useConfirmDialog, agentHandle: baseHandle, agentMayConfirm = true, ...props }) {
80
- const { titleId, dialogRef, cancelRef, handleNativeCancel, handleBackdropClick } = useDialog(props.open, props.pending, props.onCancel);
81
- const tone = resolveTone(props);
82
- const cancelLabel = useConfirmDialogCancelLabel(props.cancelLabel);
80
+ const { titleId, dialogRef, cancelRef, handleNativeCancel, handleBackdropClick } = useDialog({ open: props.open, onCancel: props.onCancel, document }, { pending: props.pending });
81
+ const tone = resolveTone({}, props);
82
+ const cancelLabel = useConfirmDialogCancelLabel({}, { explicit: props.cancelLabel });
83
83
  return (_jsxs("dialog", { ref: dialogRef, className: "confirm-dialog", "aria-labelledby": titleId, onCancel: handleNativeCancel, onClick: handleBackdropClick, children: [_jsx("h2", { id: titleId, children: props.title }), _jsx("div", { className: "confirm-dialog-body", children: props.body }), _jsxs("div", { className: "confirm-dialog-actions", children: [_jsx("button", { ref: cancelRef, type: "button", className: "btn-secondary", disabled: props.pending, onClick: props.onCancel, ...confirmDialogAgentProps(baseHandle, CANCEL_HANDLE_ACTION, {
84
84
  role: 'button',
85
85
  label: confirmDialogCancelLabel(cancelLabel, props.title),
86
- }), children: cancelLabel }), _jsx("button", { type: "button", className: toneClassName(tone), disabled: props.pending, onClick: props.onConfirm, ...confirmDialogAgentProps(agentMayConfirm ? baseHandle : undefined, CONFIRM_HANDLE_ACTION, {
86
+ }), children: cancelLabel }), _jsx("button", { type: "button", className: toneClassName({ tone }), disabled: props.pending, onClick: () => props.onConfirm(), ...confirmDialogAgentProps(agentMayConfirm ? baseHandle : undefined, CONFIRM_HANDLE_ACTION, {
87
87
  role: 'button',
88
88
  label: confirmDialogConfirmLabel(props.confirmLabel, props.title, tone),
89
89
  }), children: props.confirmLabel })] })] }));
@@ -3,7 +3,9 @@ import { type CanvasEmbedPlaceholderDescriptor, type InteractiveHtmlEditorProps
3
3
  * direct unit-testability without mounting the editor. Uses `hasAttributeOnAnyNodeShape` because
4
4
  * the `isProtectedElement` predicate is invoked from inside GrapesJS's `isComponent` callback,
5
5
  * which is not always called with a real DOM `Element` — see that helper's own doc. */
6
- export declare function isProtectedEmbedElement(el: Element): boolean;
6
+ export declare function isProtectedEmbedElement({ el }: {
7
+ readonly el: Element;
8
+ }): boolean;
7
9
  /**
8
10
  * Recognizes a `data-embed-config` marker (the consuming product's own `src/core/embeds/marker.ts`'s single scanner
9
11
  * convention) on a live canvas element and describes it for `@jini-ai/ui/html-editor`'s
@@ -19,7 +21,9 @@ export declare function isProtectedEmbedElement(el: Element): boolean;
19
21
  *
20
22
  * @complexity O(1) — one attribute read, one `JSON.parse` of a small config object, one table lookup.
21
23
  */
22
- export declare function describeEmbedPlaceholder(el: Element): CanvasEmbedPlaceholderDescriptor | undefined;
24
+ export declare function describeEmbedPlaceholder({ el }: {
25
+ readonly el: Element;
26
+ }): CanvasEmbedPlaceholderDescriptor | undefined;
23
27
  export type InteractiveHtmlEditorProps = Omit<HtmlEditorProps, 'isProtectedElement' | 'describeEmbedPlaceholder'>;
24
28
  export declare function InteractiveHtmlEditor(props: InteractiveHtmlEditorProps): import("react").JSX.Element;
25
29
  //# sourceMappingURL=InteractiveHtmlEditor.d.ts.map
@@ -2,14 +2,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { InteractiveHtmlEditor as HtmlEditor, hasAttributeOnAnyNodeShape, } from '@jini-ai/ui/html-editor';
3
3
  /**
4
4
  * @file Consuming-product-specific composition of `@jini-ai/ui/html-editor`'s generic
5
- * `InteractiveHtmlEditor`: a Page's `body_html` (the first caller — see the consuming product's own
6
- * `apps/admin/src/features/pages/PageEditor.tsx`)
5
+ * `InteractiveHtmlEditor`: a page editor's `body_html`
7
6
  * can carry `<div data-embed-type="…" data-embed-id="…"></div>` placeholders (and the legacy
8
7
  * `data-widget-embed`/`data-form-embed` attributes on migration-era rows) that a separate scanner
9
- * (that product's own `src/widgets/html-embeds.ts`) resolves at render time — that scanner requires the div to
8
+ * in the host resolves at render time — that scanner requires the div to
10
9
  * stay exactly empty and self-closing, and degrades silently, with no error, the moment anything is
11
10
  * written inside one. The CURRENT convention has since moved to a single `data-embed-config`
12
- * attribute carrying a JSON payload (that product's own `src/core/embeds/marker.ts`); `isProtectedEmbedElement`
11
+ * attribute carrying a JSON payload in the host marker schema; `isProtectedEmbedElement`
13
12
  * below has not been updated to recognize it (tracked separately — see that function's own doc), but
14
13
  * `describeEmbedPlaceholder` below IS built against the current convention, since it only needs to
15
14
  * read the marker, not police edits to it.
@@ -35,7 +34,7 @@ const EMBED_MARKER_ATTRIBUTES = ['data-embed-type', 'data-widget-embed', 'data-f
35
34
  * direct unit-testability without mounting the editor. Uses `hasAttributeOnAnyNodeShape` because
36
35
  * the `isProtectedElement` predicate is invoked from inside GrapesJS's `isComponent` callback,
37
36
  * which is not always called with a real DOM `Element` — see that helper's own doc. */
38
- export function isProtectedEmbedElement(el) {
37
+ export function isProtectedEmbedElement({ el }) {
39
38
  return EMBED_MARKER_ATTRIBUTES.some((attr) => hasAttributeOnAnyNodeShape(el, attr));
40
39
  }
41
40
  /**
@@ -91,7 +90,7 @@ const ID_PREVIEW_LENGTH = 8;
91
90
  * otherwise a truncated `id`, otherwise an explicit "nothing was set" note rather than a blank line.
92
91
  *
93
92
  * **Deliberately does not fetch a human title for a `media` marker.** There is no cheap existing admin
94
- * route for a single media asset's title by id — `AdminAPI.listMedia()` (`apps/admin/src/lib/api.ts`)
93
+ * route for a single media asset's title by id — the host's media-list API
95
94
  * is the only read, and it returns the ENTIRE workspace's media library, active and trashed, with no
96
95
  * id filter or pagination, just to answer one id's `title`. Adding a `GET /media/:id` route is out of
97
96
  * this feature's scope (an editor-chrome label is not worth a new server endpoint), and reusing
@@ -124,7 +123,7 @@ function identityLabel(config) {
124
123
  *
125
124
  * @complexity O(1) — one attribute read, one `JSON.parse` of a small config object, one table lookup.
126
125
  */
127
- export function describeEmbedPlaceholder(el) {
126
+ export function describeEmbedPlaceholder({ el }) {
128
127
  const raw = el.getAttribute('data-embed-config');
129
128
  if (!raw)
130
129
  return undefined;
@@ -144,6 +143,6 @@ export function describeEmbedPlaceholder(el) {
144
143
  return { kindLabel: EMBED_KIND_LABELS[type] ?? titleCase(type), identityLabel: identityLabel(config) };
145
144
  }
146
145
  export function InteractiveHtmlEditor(props) {
147
- return (_jsx(HtmlEditor, { ...props, isProtectedElement: isProtectedEmbedElement, describeEmbedPlaceholder: describeEmbedPlaceholder }));
146
+ return (_jsx(HtmlEditor, { ...props, isProtectedElement: (el) => isProtectedEmbedElement({ el }), describeEmbedPlaceholder: (el) => describeEmbedPlaceholder({ el }) }));
148
147
  }
149
148
  //# sourceMappingURL=InteractiveHtmlEditor.js.map
@@ -5,7 +5,8 @@ import { useRowMenu } from './RowMenu.hooks.js';
5
5
  * so a row can grow more actions (Edit, Disable, Delete, …) without widening the table or producing
6
6
  * the wall of buttons that pattern turns into.
7
7
  *
8
- * Portaled to `document.body` and positioned with `getBoundingClientRect()` rather than rendered as
8
+ * Portaled to `document.body` by default (or the host's `portalContainer`) and positioned with
9
+ * `getBoundingClientRect()` rather than rendered as
9
10
  * an in-flow absolutely-positioned child of the trigger — an admin table normally sits inside a
10
11
  * horizontal scroller (`overflow-x: auto`), and per the CSS overflow spec, setting either axis to a
11
12
  * non-`visible` value forces the *other* axis to compute as `auto` as well, so a menu positioned to
@@ -72,6 +73,9 @@ export interface RowMenuProps {
72
73
  /** This row's own agent handle — see this file's "Agent handles" doc comment for the full
73
74
  * scheme. Omit and no `data-agent-*` markup is emitted at all. */
74
75
  agentHandle?: string;
76
+ /** Host-owned popup container, outside the row's clipping scroller. Use a container within
77
+ * the page driver's root when its agent must reach menu items. Defaults to `document.body`. */
78
+ portalContainer?: Element | DocumentFragment;
75
79
  }
76
80
  export declare function RowMenu({ useRowMenu: useRowMenuState, agentHandle: baseHandle, ...props }: RowMenuProps): import("react").JSX.Element;
77
81
  //# sourceMappingURL=RowMenu.d.ts.map
@@ -15,7 +15,11 @@ interface Position {
15
15
  * @param itemCount Length of the caller's item list — the only piece of `RowMenuProps` this state
16
16
  * needs, for `ArrowUp`-to-last-item and wraparound navigation.
17
17
  */
18
- export declare function useRowMenu(itemCount: number): {
18
+ export declare function useRowMenu({ itemCount, window, document }: {
19
+ readonly itemCount: number;
20
+ readonly window: Pick<Window, 'innerHeight' | 'innerWidth' | 'addEventListener' | 'removeEventListener'>;
21
+ readonly document: Pick<Document, 'addEventListener' | 'removeEventListener'>;
22
+ }): {
19
23
  open: boolean;
20
24
  position: Position | null;
21
25
  triggerRef: import("react").RefObject<HTMLButtonElement | null>;
@@ -24,7 +28,9 @@ export declare function useRowMenu(itemCount: number): {
24
28
  onTriggerClick: () => void;
25
29
  onTriggerKeyDown: (e: KeyboardEvent<HTMLButtonElement>) => void;
26
30
  onMenuKeyDown: (e: KeyboardEvent<HTMLDivElement>) => void;
27
- selectItem: (onSelect: () => void) => void;
31
+ selectItem: ({ onSelect }: {
32
+ readonly onSelect: () => void;
33
+ }) => void;
28
34
  };
29
35
  export {};
30
36
  //# sourceMappingURL=RowMenu.hooks.d.ts.map
@@ -7,7 +7,7 @@ const VIEWPORT_MARGIN = 8;
7
7
  * @param itemCount Length of the caller's item list — the only piece of `RowMenuProps` this state
8
8
  * needs, for `ArrowUp`-to-last-item and wraparound navigation.
9
9
  */
10
- export function useRowMenu(itemCount) {
10
+ export function useRowMenu({ itemCount, window, document }) {
11
11
  const [open, setOpen] = useState(false);
12
12
  const [position, setPosition] = useState(null);
13
13
  const [activeIndex, setActiveIndex] = useState(0);
@@ -59,7 +59,7 @@ export function useRowMenu(itemCount) {
59
59
  window.removeEventListener('scroll', reposition, true);
60
60
  window.removeEventListener('resize', reposition);
61
61
  };
62
- }, [open]);
62
+ }, [open, window, document]);
63
63
  // Click-outside closes. Scoped to the open window only, same lifecycle discipline as
64
64
  // `ConfirmButton`'s armed-only document listeners — a closed, idle `RowMenu` costs nothing beyond
65
65
  // its trigger button even with many mounted per table.
@@ -75,7 +75,7 @@ export function useRowMenu(itemCount) {
75
75
  document.addEventListener('mousedown', onDocMouseDown);
76
76
  return () => document.removeEventListener('mousedown', onDocMouseDown);
77
77
  // eslint-disable-next-line react-hooks/exhaustive-deps
78
- }, [open]);
78
+ }, [open, window, document]);
79
79
  // Keeps real DOM focus on the active item (roving focus via `tabIndex={-1}` on every item except
80
80
  // the active one) rather than only tracking `activeIndex` in state — arrow-key navigation needs
81
81
  // to move the browser's actual focus for a screen reader to announce it.
@@ -135,7 +135,7 @@ export function useRowMenu(itemCount) {
135
135
  /** Closes (returning focus to the trigger, same as Escape) and then fires the selected item's own
136
136
  * callback — takes the callback directly rather than a whole `RowMenuItem` so this hook stays
137
137
  * free of any dependency on that component-level type. */
138
- function selectItem(onSelect) {
138
+ function selectItem({ onSelect }) {
139
139
  close(true);
140
140
  onSelect();
141
141
  }