@jini-ai/admin 0.7.1 → 0.7.3-next.1

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 (583) hide show
  1. package/CHANGELOG.md +4 -4
  2. package/dist/agent-plugins/agent-plugins.module.d.ts +1 -1
  3. package/dist/agent-plugins/agent-plugins.module.js +1 -1
  4. package/dist/agent-plugins/controllers/agent-plugin-files.controller.d.ts +3 -3
  5. package/dist/agent-plugins/controllers/agent-plugin-files.controller.js +1 -1
  6. package/dist/agent-plugins/controllers/agent-plugins.controller.d.ts +3 -3
  7. package/dist/agent-plugins/controllers/agent-plugins.controller.js +30 -27
  8. package/dist/agent-plugins/index.d.ts +11 -8
  9. package/dist/agent-plugins/index.js +7 -8
  10. package/dist/agent-plugins/models.d.ts +19 -11
  11. package/dist/agent-plugins/ports.d.ts +1 -1
  12. package/dist/agent-plugins/ports.js +1 -1
  13. package/dist/agent-plugins/react/components/AgentPluginFileContent.d.ts +4 -2
  14. package/dist/agent-plugins/react/components/AgentPluginFileContent.js +3 -3
  15. package/dist/agent-plugins/react/components/AgentPluginFileTree.d.ts +4 -2
  16. package/dist/agent-plugins/react/components/AgentPluginFileTree.js +2 -2
  17. package/dist/agent-plugins/react/components/AgentPluginInspector.d.ts +4 -2
  18. package/dist/agent-plugins/react/components/AgentPluginInspector.js +3 -3
  19. package/dist/agent-plugins/react/components/AgentPluginListPanel.d.ts +5 -3
  20. package/dist/agent-plugins/react/components/AgentPluginListPanel.js +3 -3
  21. package/dist/agent-plugins/react/components/AgentPluginRow.d.ts +3 -1
  22. package/dist/agent-plugins/react/components/AgentPluginRow.js +3 -3
  23. package/dist/agent-plugins/react/hooks/AgentPluginInspector.hooks.js +2 -2
  24. package/dist/agent-plugins/react/hooks/AgentPluginPanel.hooks.d.ts +6 -5
  25. package/dist/agent-plugins/react/hooks/AgentPluginRow.hooks.d.ts +5 -4
  26. package/dist/agent-plugins/react/hooks/AgentPluginsPage.hooks.d.ts +11 -7
  27. package/dist/agent-plugins/react/hooks/AgentPluginsPage.hooks.js +3 -3
  28. package/dist/agent-plugins/react/hooks/AgentPluginsPorts.hooks.d.ts +5 -0
  29. package/dist/agent-plugins/react/hooks/AgentPluginsPorts.hooks.js +11 -1
  30. package/dist/agent-plugins/react/hooks/MarketplaceTab.hooks.d.ts +1 -1
  31. package/dist/agent-plugins/react/index.d.ts +25 -71
  32. package/dist/agent-plugins/react/index.js +9 -6
  33. package/dist/agent-plugins/react/pages/AgentPluginsPage.d.ts +8 -2
  34. package/dist/agent-plugins/react/pages/AgentPluginsPage.js +3 -3
  35. package/dist/agent-plugins/react/tabs/DownloadedTab.d.ts +2 -2
  36. package/dist/agent-plugins/react/tabs/DownloadedTab.js +1 -1
  37. package/dist/agent-plugins/react/tabs/InstalledTab.d.ts +2 -2
  38. package/dist/agent-plugins/react/tabs/InstalledTab.js +1 -1
  39. package/dist/agent-plugins/react/tabs/MarketplaceTab.d.ts +5 -2
  40. package/dist/agent-plugins/react/tabs/MarketplaceTab.js +3 -3
  41. package/dist/browser/index.d.ts +2 -0
  42. package/dist/browser/index.js +2 -0
  43. package/dist/browser/react-root-errors.d.ts +19 -0
  44. package/dist/browser/react-root-errors.js +16 -0
  45. package/dist/comments/adapters/http.js +2 -3
  46. package/dist/comments/adapters/memory.d.ts +5 -3
  47. package/dist/comments/adapters/memory.js +5 -6
  48. package/dist/comments/comments.module.d.ts +3 -3
  49. package/dist/comments/comments.module.js +1 -1
  50. package/dist/comments/controllers/comment-queue.controller.d.ts +14 -12
  51. package/dist/comments/controllers/comment-queue.controller.js +154 -155
  52. package/dist/comments/controllers/comment-settings.controller.d.ts +4 -4
  53. package/dist/comments/controllers/comment-settings.controller.js +40 -39
  54. package/dist/comments/controllers/comments.controller.d.ts +4 -4
  55. package/dist/comments/controllers/comments.controller.js +1 -2
  56. package/dist/comments/ports.d.ts +3 -3
  57. package/dist/comments/ports.js +1 -1
  58. package/dist/comments/react/components/QueueActionsCell.d.ts +20 -0
  59. package/dist/comments/react/components/QueueActionsCell.js +15 -0
  60. package/dist/comments/react/components/QueueSection.d.ts +20 -9
  61. package/dist/comments/react/components/QueueSection.js +9 -20
  62. package/dist/comments/react/components/SettingsFields.d.ts +13 -0
  63. package/dist/comments/react/components/SettingsFields.js +17 -0
  64. package/dist/comments/react/components/SettingsSection.d.ts +4 -1
  65. package/dist/comments/react/components/SettingsSection.js +5 -10
  66. package/dist/comments/react/hooks/CommentsPage.hooks.js +1 -1
  67. package/dist/comments/react/hooks/CommentsPorts.hooks.d.ts +5 -0
  68. package/dist/comments/react/hooks/CommentsPorts.hooks.js +11 -1
  69. package/dist/comments/react/hooks/QueueActionsCell.hooks.d.ts +13 -0
  70. package/dist/comments/react/hooks/QueueActionsCell.hooks.js +7 -0
  71. package/dist/comments/react/hooks/QueueSection.hooks.d.ts +3 -11
  72. package/dist/comments/react/hooks/QueueSection.hooks.js +8 -11
  73. package/dist/comments/react/hooks/use-comment-queue.hooks.js +4 -4
  74. package/dist/comments/react/hooks/use-comment-settings.hooks.js +3 -3
  75. package/dist/comments/react/hooks/use-comments.hooks.js +3 -3
  76. package/dist/comments/react/index.d.ts +27 -89
  77. package/dist/comments/react/index.js +5 -6
  78. package/dist/comments/react/pages/CommentsPage.d.ts +4 -1
  79. package/dist/comments/react/pages/CommentsPage.js +2 -2
  80. package/dist/comments/rules.d.ts +1 -1
  81. package/dist/comments/rules.js +2 -3
  82. package/dist/contracts/credential-management.d.ts +1 -1
  83. package/dist/contracts/credential-management.js +1 -1
  84. package/dist/contracts/media-picker.d.ts +1 -1
  85. package/dist/contracts/media-picker.js +1 -1
  86. package/dist/contracts/playground-render-target.d.ts +1 -1
  87. package/dist/contracts/playground-render-target.js +1 -1
  88. package/dist/core/entities/rules.d.ts +8 -2
  89. package/dist/core/entities/rules.js +3 -3
  90. package/dist/core/index.d.ts +1 -2
  91. package/dist/core/index.js +1 -3
  92. package/dist/core/ledger-slice.d.ts +3 -3
  93. package/dist/core/ledger-slice.js +3 -3
  94. package/dist/core/manifest/rules.js +1 -1
  95. package/dist/core/manifest/types.d.ts +11 -0
  96. package/dist/core/module/create-admin.d.ts +1 -8
  97. package/dist/core/module/create-admin.js +4 -9
  98. package/dist/core/module/index.d.ts +1 -5
  99. package/dist/core/module/index.js +1 -3
  100. package/dist/core/ports/auth.d.ts +2 -2
  101. package/dist/core/ports/auth.js +1 -1
  102. package/dist/core/ports/comment-repo.d.ts +53 -0
  103. package/dist/core/ports/comment-repo.js +2 -0
  104. package/dist/core/ports/comments.d.ts +1 -1
  105. package/dist/core/ports/comments.js +1 -1
  106. package/dist/core/ports/database.d.ts +1 -1
  107. package/dist/core/ports/embed-policy.d.ts +19 -0
  108. package/dist/core/ports/embed-policy.js +2 -0
  109. package/dist/core/ports/entities.d.ts +14 -0
  110. package/dist/core/ports/forms-catalog.d.ts +27 -0
  111. package/dist/core/ports/forms-catalog.js +2 -0
  112. package/dist/core/ports/forms.d.ts +3 -3
  113. package/dist/core/ports/identity.d.ts +1 -1
  114. package/dist/core/ports/identity.js +1 -1
  115. package/dist/core/ports/index.d.ts +3 -0
  116. package/dist/core/ports/media.d.ts +1 -1
  117. package/dist/core/ports/plugins.d.ts +1 -1
  118. package/dist/core/react/bind-react.d.ts +6 -16
  119. package/dist/core/react/bind-react.js +1 -1
  120. package/dist/core/react/index.d.ts +3 -2
  121. package/dist/core/react/index.js +3 -2
  122. package/dist/core/react/module-ui.d.ts +10 -0
  123. package/dist/core/react/module-ui.js +6 -0
  124. package/dist/core/react/use-controller.d.ts +1 -1
  125. package/dist/core/react/use-controller.js +2 -1
  126. package/dist/core/routing/route-template.d.ts +11 -0
  127. package/dist/core/routing/route-template.js +23 -0
  128. package/dist/core/transport/http.js +7 -5
  129. package/dist/core/transport/index.d.ts +0 -1
  130. package/dist/core/transport/index.js +0 -1
  131. package/dist/forms/adapters/http.js +2 -2
  132. package/dist/forms/adapters/memory.d.ts +1 -1
  133. package/dist/forms/adapters/memory.js +35 -26
  134. package/dist/forms/controllers/draft-store.d.ts +4 -4
  135. package/dist/forms/controllers/draft-store.js +1 -1
  136. package/dist/forms/controllers/field-attributes-dialog.controller.d.ts +7 -8
  137. package/dist/forms/controllers/field-attributes-dialog.controller.js +8 -6
  138. package/dist/forms/controllers/form-editor.controller.d.ts +8 -5
  139. package/dist/forms/controllers/form-editor.controller.js +2 -2
  140. package/dist/forms/controllers/form-fields-editor.controller.d.ts +4 -4
  141. package/dist/forms/controllers/form-submission-detail.controller.d.ts +4 -4
  142. package/dist/forms/controllers/form-submissions.controller.d.ts +4 -4
  143. package/dist/forms/controllers/forms-list.controller.d.ts +4 -4
  144. package/dist/forms/field-settings.d.ts +32 -16
  145. package/dist/forms/field-settings.js +52 -41
  146. package/dist/forms/forms.module.d.ts +5 -4
  147. package/dist/forms/forms.module.js +3 -3
  148. package/dist/forms/html-rules.d.ts +4 -2
  149. package/dist/forms/html-rules.js +19 -19
  150. package/dist/forms/index.d.ts +6 -4
  151. package/dist/forms/index.js +3 -3
  152. package/dist/forms/messages.en.js +1 -1
  153. package/dist/forms/models.d.ts +1 -1
  154. package/dist/forms/ports.d.ts +8 -4
  155. package/dist/forms/ports.js +3 -1
  156. package/dist/forms/react/components/FieldAttributesDialog.d.ts +4 -1
  157. package/dist/forms/react/components/FieldAttributesDialog.js +6 -28
  158. package/dist/forms/react/components/FieldAttributesStyling.d.ts +26 -0
  159. package/dist/forms/react/components/FieldAttributesStyling.js +42 -0
  160. package/dist/forms/react/components/FieldSettingsRows.js +3 -4
  161. package/dist/forms/react/components/FieldSettingsSection.d.ts +4 -1
  162. package/dist/forms/react/components/FieldSettingsSection.js +3 -3
  163. package/dist/forms/react/components/FormEditorFieldsBody.d.ts +5 -2
  164. package/dist/forms/react/components/FormEditorFieldsBody.js +3 -3
  165. package/dist/forms/react/components/FormEditorFieldsBodyParts.js +1 -1
  166. package/dist/forms/react/components/FormEditorFieldsSlot.d.ts +6 -0
  167. package/dist/forms/react/components/FormEditorFieldsSlot.js +10 -0
  168. package/dist/forms/react/components/FormEditorHeader.d.ts +9 -0
  169. package/dist/forms/react/components/FormEditorHeader.js +16 -0
  170. package/dist/forms/react/components/FormEditorHeaderText.d.ts +1 -1
  171. package/dist/forms/react/components/FormEditorHeaderText.js +1 -1
  172. package/dist/forms/react/components/FormEditorMainPanel.d.ts +1 -1
  173. package/dist/forms/react/components/FormEditorMainPanel.js +4 -4
  174. package/dist/forms/react/components/FormEditorTabStrip.d.ts +5 -2
  175. package/dist/forms/react/components/FormEditorTabStrip.js +3 -4
  176. package/dist/forms/react/components/FormFieldRow.d.ts +10 -0
  177. package/dist/forms/react/components/FormFieldRow.js +53 -0
  178. package/dist/forms/react/components/FormFieldsEditor.d.ts +4 -1
  179. package/dist/forms/react/components/FormFieldsEditor.js +6 -22
  180. package/dist/forms/react/components/FormFieldsTableParts.d.ts +10 -0
  181. package/dist/forms/react/components/FormFieldsTableParts.js +11 -0
  182. package/dist/forms/react/components/FormSubmissionDate.d.ts +1 -1
  183. package/dist/forms/react/components/FormSubmissionDate.js +1 -1
  184. package/dist/forms/react/components/FormSubmissionDetail.d.ts +4 -1
  185. package/dist/forms/react/components/FormSubmissionDetail.js +3 -3
  186. package/dist/forms/react/components/FormSubmissions.d.ts +6 -1
  187. package/dist/forms/react/components/FormSubmissions.js +3 -3
  188. package/dist/forms/react/components/FormSubmissionsTable.js +1 -1
  189. package/dist/forms/react/components/FormsListParts.d.ts +36 -0
  190. package/dist/forms/react/components/FormsListParts.js +41 -0
  191. package/dist/forms/react/hooks/FormsPorts.hooks.d.ts +7 -1
  192. package/dist/forms/react/hooks/FormsPorts.hooks.js +11 -1
  193. package/dist/forms/react/hooks/forms-view.hooks.d.ts +17 -11
  194. package/dist/forms/react/hooks/forms-view.hooks.js +13 -11
  195. package/dist/forms/react/hooks/use-field-attributes-dialog.hooks.d.ts +4 -1
  196. package/dist/forms/react/hooks/use-field-attributes-dialog.hooks.js +6 -4
  197. package/dist/forms/react/hooks/use-form-editor-parts.hooks.d.ts +127 -0
  198. package/dist/forms/react/hooks/use-form-editor-parts.hooks.js +223 -0
  199. package/dist/forms/react/hooks/use-form-editor.hooks.d.ts +13 -3
  200. package/dist/forms/react/hooks/use-form-editor.hooks.js +34 -210
  201. package/dist/forms/react/hooks/use-form-fields-editor.hooks.js +2 -2
  202. package/dist/forms/react/hooks/use-form-submission-detail.hooks.d.ts +2 -2
  203. package/dist/forms/react/hooks/use-form-submission-detail.hooks.js +4 -4
  204. package/dist/forms/react/hooks/use-form-submissions.hooks.d.ts +2 -2
  205. package/dist/forms/react/hooks/use-form-submissions.hooks.js +4 -5
  206. package/dist/forms/react/hooks/use-forms-list.hooks.js +3 -3
  207. package/dist/forms/react/index.d.ts +35 -26
  208. package/dist/forms/react/index.js +5 -6
  209. package/dist/forms/react/pages/FormEditor.d.ts +2 -2
  210. package/dist/forms/react/pages/FormEditor.js +7 -12
  211. package/dist/forms/react/pages/FormsList.d.ts +5 -2
  212. package/dist/forms/react/pages/FormsList.js +4 -30
  213. package/dist/forms/rules.d.ts +5 -5
  214. package/dist/forms/rules.js +8 -20
  215. package/dist/media/adapters/http.d.ts +24 -2
  216. package/dist/media/adapters/http.js +133 -10
  217. package/dist/media/adapters/memory.js +41 -46
  218. package/dist/media/conformance/media-api.conformance.js +60 -42
  219. package/dist/media/controllers/edit-media.controller.d.ts +5 -5
  220. package/dist/media/controllers/edit-media.controller.js +20 -17
  221. package/dist/media/controllers/library.controller.d.ts +14 -14
  222. package/dist/media/controllers/library.controller.js +180 -167
  223. package/dist/media/controllers/providers.controller.d.ts +4 -4
  224. package/dist/media/controllers/providers.controller.js +46 -40
  225. package/dist/media/html-attributes.d.ts +23 -13
  226. package/dist/media/html-attributes.js +15 -23
  227. package/dist/media/index.d.ts +5 -4
  228. package/dist/media/index.js +3 -3
  229. package/dist/media/media.module.d.ts +6 -5
  230. package/dist/media/media.module.js +3 -3
  231. package/dist/media/ports.d.ts +8 -3
  232. package/dist/media/ports.js +4 -1
  233. package/dist/media/react/components/EditMediaPanel.d.ts +4 -1
  234. package/dist/media/react/components/EditMediaPanel.js +3 -3
  235. package/dist/media/react/components/MediaCard.d.ts +7 -2
  236. package/dist/media/react/components/MediaCard.js +6 -6
  237. package/dist/media/react/components/MediaDialog.d.ts +4 -1
  238. package/dist/media/react/components/MediaDialog.js +3 -3
  239. package/dist/media/react/components/MediaGrid.d.ts +4 -1
  240. package/dist/media/react/components/MediaGrid.js +2 -2
  241. package/dist/media/react/components/MediaIcons.d.ts +9 -9
  242. package/dist/media/react/components/MediaIcons.js +9 -9
  243. package/dist/media/react/components/MediaLightbox.d.ts +4 -1
  244. package/dist/media/react/components/MediaLightbox.js +3 -3
  245. package/dist/media/react/components/MediaPicker.d.ts +4 -1
  246. package/dist/media/react/components/MediaPicker.js +3 -3
  247. package/dist/media/react/components/MediaPurgeDialog.d.ts +4 -1
  248. package/dist/media/react/components/MediaPurgeDialog.js +3 -3
  249. package/dist/media/react/components/UploadButton.d.ts +4 -1
  250. package/dist/media/react/components/UploadButton.js +3 -3
  251. package/dist/media/react/hooks/EditMediaPanel.hooks.d.ts +6 -3
  252. package/dist/media/react/hooks/EditMediaPanel.hooks.js +62 -50
  253. package/dist/media/react/hooks/LibraryTab.hooks.d.ts +23 -23
  254. package/dist/media/react/hooks/LibraryTab.hooks.js +52 -36
  255. package/dist/media/react/hooks/MediaCard.hooks.d.ts +1 -1
  256. package/dist/media/react/hooks/MediaCard.hooks.js +2 -1
  257. package/dist/media/react/hooks/MediaDialog.hooks.d.ts +1 -1
  258. package/dist/media/react/hooks/MediaPage.hooks.d.ts +22 -18
  259. package/dist/media/react/hooks/MediaPage.hooks.js +3 -3
  260. package/dist/media/react/hooks/MediaPicker.hooks.d.ts +1 -1
  261. package/dist/media/react/hooks/MediaPicker.hooks.js +2 -2
  262. package/dist/media/react/hooks/MediaPorts.hooks.d.ts +7 -0
  263. package/dist/media/react/hooks/MediaPorts.hooks.js +11 -1
  264. package/dist/media/react/hooks/MediaQuery.hooks.d.ts +3 -3
  265. package/dist/media/react/hooks/MediaQuery.hooks.js +1 -1
  266. package/dist/media/react/hooks/ProvidersTab.hooks.d.ts +7 -1
  267. package/dist/media/react/hooks/ProvidersTab.hooks.js +49 -46
  268. package/dist/media/react/index.d.ts +39 -114
  269. package/dist/media/react/index.js +55 -48
  270. package/dist/media/react/pages/MediaPage.d.ts +4 -1
  271. package/dist/media/react/pages/MediaPage.js +2 -2
  272. package/dist/media/react/tabs/LibraryTab.d.ts +5 -2
  273. package/dist/media/react/tabs/LibraryTab.js +3 -3
  274. package/dist/media/react/tabs/ProvidersTab.d.ts +5 -2
  275. package/dist/media/react/tabs/ProvidersTab.js +2 -2
  276. package/dist/media/rules.d.ts +0 -7
  277. package/dist/media/rules.js +0 -12
  278. package/dist/playground/controllers/playground.controller.d.ts +3 -3
  279. package/dist/playground/controllers/playground.controller.js +1 -1
  280. package/dist/playground/playground.module.d.ts +1 -1
  281. package/dist/playground/playground.module.js +1 -1
  282. package/dist/playground/react/components/Canvas.d.ts +5 -2
  283. package/dist/playground/react/components/Canvas.js +3 -3
  284. package/dist/playground/react/hooks/Canvas.hooks.d.ts +1 -1
  285. package/dist/playground/react/hooks/PlaygroundPage.hooks.d.ts +7 -3
  286. package/dist/playground/react/hooks/PlaygroundPorts.hooks.js +1 -1
  287. package/dist/playground/react/index.d.ts +9 -9
  288. package/dist/playground/react/pages/PlaygroundPage.d.ts +8 -2
  289. package/dist/playground/react/pages/PlaygroundPage.js +3 -3
  290. package/dist/playground/react/tabs/CanvasTab.d.ts +2 -2
  291. package/dist/playground/react/tabs/CanvasTab.js +1 -1
  292. package/dist/react/OverlayHost.d.ts +4 -1
  293. package/dist/react/OverlayHost.js +2 -2
  294. package/dist/react/components/ConfirmDialog/ConfirmDialog.d.ts +12 -2
  295. package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.js +1 -2
  296. package/dist/react/components/ConfirmDialog/ConfirmDialog.js +6 -4
  297. package/dist/react/components/ConfirmDialog/confirm-dialog-attrs.d.ts +1 -1
  298. package/dist/react/components/ConfirmDialog/confirm-dialog-attrs.js +1 -1
  299. package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.d.ts +2 -2
  300. package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.js +9 -8
  301. package/dist/react/components/RowMenu/RowMenu.hooks.js +66 -63
  302. package/dist/react/components/RowMenu/RowMenu.js +1 -1
  303. package/dist/react/components/Sidebar.d.ts +11 -4
  304. package/dist/react/components/Sidebar.js +11 -101
  305. package/dist/react/components/SidebarIcon.d.ts +4 -0
  306. package/dist/react/components/SidebarIcon.js +91 -0
  307. package/dist/react/components/ThemePreviewReloadControl.d.ts +7 -0
  308. package/dist/react/components/ThemePreviewReloadControl.js +5 -0
  309. package/dist/react/entities/EntityDetail.d.ts +4 -1
  310. package/dist/react/entities/EntityDetail.hooks.d.ts +14 -0
  311. package/dist/react/entities/EntityDetail.hooks.js +10 -0
  312. package/dist/react/entities/EntityDetail.js +3 -6
  313. package/dist/react/entities/EntityEdit.d.ts +6 -1
  314. package/dist/react/entities/EntityEdit.js +23 -6
  315. package/dist/react/entities/EntityField.d.ts +3 -1
  316. package/dist/react/entities/EntityField.js +9 -6
  317. package/dist/react/entities/EntityList.d.ts +4 -1
  318. package/dist/react/entities/EntityList.hooks.d.ts +33 -0
  319. package/dist/react/entities/EntityList.hooks.js +28 -0
  320. package/dist/react/entities/EntityList.js +3 -23
  321. package/dist/react/entities/FailureNotice.d.ts +29 -0
  322. package/dist/react/entities/FailureNotice.js +33 -0
  323. package/dist/react/entities/contribution.d.ts +2 -0
  324. package/dist/react/entities/contribution.js +2 -2
  325. package/dist/react/entities/rules.d.ts +6 -1
  326. package/dist/react/entities/rules.js +7 -4
  327. package/dist/react/entities/types.d.ts +19 -0
  328. package/dist/react/entities/use-entity-edit.d.ts +11 -2
  329. package/dist/react/entities/use-entity-edit.js +18 -12
  330. package/dist/react/entities/use-entity-read.d.ts +7 -2
  331. package/dist/react/entities/use-entity-read.js +9 -4
  332. package/dist/react/hooks/use-browser-telemetry-feed.d.ts +13 -0
  333. package/dist/react/hooks/use-browser-telemetry-feed.js +14 -0
  334. package/dist/react/hooks/use-overflow-title.d.ts +17 -0
  335. package/dist/react/hooks/use-overflow-title.js +29 -0
  336. package/dist/react/hooks/use-process-restart.d.ts +46 -0
  337. package/dist/react/hooks/use-process-restart.js +59 -0
  338. package/dist/react/hooks/use-rail-label-titles.d.ts +18 -0
  339. package/dist/react/hooks/use-rail-label-titles.js +44 -0
  340. package/dist/react/index.d.ts +6 -0
  341. package/dist/react/index.js +5 -0
  342. package/dist/react/kit-media-providers.d.ts +187 -0
  343. package/dist/react/kit-media-providers.js +2 -0
  344. package/dist/react/kit.d.ts +478 -0
  345. package/dist/react/kit.js +75 -0
  346. package/dist/react/overlays.d.ts +4 -4
  347. package/dist/react/overlays.js +1 -1
  348. package/dist/react/shell/AdminShell.d.ts +2 -2
  349. package/dist/react/shell/AdminShell.js +56 -24
  350. package/dist/react/shell/index.d.ts +1 -1
  351. package/dist/react/shell/model.d.ts +9 -1
  352. package/dist/react/shell/model.js +31 -15
  353. package/dist/react/shell/shell-hooks.d.ts +34 -0
  354. package/dist/react/shell/shell-hooks.js +31 -0
  355. package/dist/react/shell/theme-ports.d.ts +1 -1
  356. package/dist/react/shell/types.d.ts +97 -3
  357. package/dist/react/shell/use-admin-theme.d.ts +4 -2
  358. package/dist/react/shell/use-admin-theme.js +4 -3
  359. package/dist/react/testing-kit-media-providers.d.ts +3 -0
  360. package/dist/react/testing-kit-media-providers.js +96 -0
  361. package/dist/react/testing-kit.d.ts +11 -0
  362. package/dist/react/testing-kit.js +114 -0
  363. package/dist/redirects/adapters/memory.js +42 -33
  364. package/dist/redirects/conformance/redirects-api.conformance.js +1 -1
  365. package/dist/redirects/controllers/hit-count.controller.d.ts +5 -5
  366. package/dist/redirects/controllers/hit-count.controller.js +1 -1
  367. package/dist/redirects/controllers/import-redirects.controller.d.ts +5 -5
  368. package/dist/redirects/controllers/import-redirects.controller.js +1 -1
  369. package/dist/redirects/controllers/redirects.controller.d.ts +5 -5
  370. package/dist/redirects/controllers/redirects.controller.js +1 -1
  371. package/dist/redirects/index.d.ts +11 -7
  372. package/dist/redirects/index.js +6 -7
  373. package/dist/redirects/ports.d.ts +2 -2
  374. package/dist/redirects/ports.js +1 -1
  375. package/dist/redirects/react/components/CreateRedirectForm.d.ts +17 -0
  376. package/dist/redirects/react/components/CreateRedirectForm.js +19 -0
  377. package/dist/redirects/react/components/HitCountCell.js +2 -2
  378. package/dist/redirects/react/components/ImportRedirectsForm.js +1 -1
  379. package/dist/redirects/react/hooks/RedirectsPage.hooks.d.ts +1 -1
  380. package/dist/redirects/react/hooks/RedirectsPorts.hooks.d.ts +5 -0
  381. package/dist/redirects/react/hooks/RedirectsPorts.hooks.js +11 -1
  382. package/dist/redirects/react/hooks/use-hit-count-cell.hooks.js +3 -3
  383. package/dist/redirects/react/hooks/use-import-redirects-form.hooks.js +4 -4
  384. package/dist/redirects/react/hooks/use-redirects.hooks.d.ts +1 -1
  385. package/dist/redirects/react/hooks/use-redirects.hooks.js +4 -4
  386. package/dist/redirects/react/hooks/wired.hooks.d.ts +1 -1
  387. package/dist/redirects/react/index.d.ts +25 -90
  388. package/dist/redirects/react/index.js +6 -7
  389. package/dist/redirects/react/pages/RedirectsPage.d.ts +3 -1
  390. package/dist/redirects/react/pages/RedirectsPage.js +5 -5
  391. package/dist/redirects/redirects.module.d.ts +2 -2
  392. package/dist/redirects/redirects.module.js +1 -1
  393. package/dist/security/controllers/access-tokens.controller.d.ts +4 -4
  394. package/dist/security/controllers/access-tokens.controller.js +20 -15
  395. package/dist/security/controllers/other-credentials.controller.d.ts +4 -4
  396. package/dist/security/controllers/other-credentials.controller.js +1 -1
  397. package/dist/security/controllers/root-key.controller.d.ts +4 -4
  398. package/dist/security/controllers/root-key.controller.js +1 -1
  399. package/dist/security/ports.d.ts +3 -3
  400. package/dist/security/ports.js +1 -1
  401. package/dist/security/react/components/CredentialEditor.d.ts +4 -2
  402. package/dist/security/react/components/CredentialEditor.js +3 -3
  403. package/dist/security/react/hooks/AccessTokensTab.hooks.d.ts +5 -5
  404. package/dist/security/react/hooks/RootKeyTab.hooks.d.ts +1 -1
  405. package/dist/security/react/hooks/SecurityPage.hooks.d.ts +7 -3
  406. package/dist/security/react/hooks/SecurityPorts.hooks.js +1 -1
  407. package/dist/security/react/index.d.ts +22 -22
  408. package/dist/security/react/pages/SecurityPage.d.ts +8 -2
  409. package/dist/security/react/pages/SecurityPage.js +3 -3
  410. package/dist/security/react/tabs/AccessTokensTab.d.ts +5 -2
  411. package/dist/security/react/tabs/AccessTokensTab.js +3 -3
  412. package/dist/security/react/tabs/RootKeyTab.d.ts +5 -2
  413. package/dist/security/react/tabs/RootKeyTab.js +3 -3
  414. package/dist/security/rules.d.ts +1 -1
  415. package/dist/security/security.module.d.ts +4 -4
  416. package/dist/security/security.module.js +1 -1
  417. package/dist/seo/controllers/entry-picker.controller.d.ts +7 -7
  418. package/dist/seo/controllers/entry-picker.controller.js +1 -1
  419. package/dist/seo/controllers/entry-section.controller.d.ts +9 -9
  420. package/dist/seo/controllers/entry-section.controller.js +1 -1
  421. package/dist/seo/controllers/media-ref.controller.d.ts +9 -9
  422. package/dist/seo/controllers/media-ref.controller.js +1 -1
  423. package/dist/seo/controllers/seo-entry.controller.d.ts +7 -7
  424. package/dist/seo/controllers/seo-entry.controller.js +1 -1
  425. package/dist/seo/controllers/seo.controller.d.ts +7 -7
  426. package/dist/seo/controllers/seo.controller.js +1 -1
  427. package/dist/seo/controllers/sitemap.controller.d.ts +7 -7
  428. package/dist/seo/controllers/sitemap.controller.js +2 -2
  429. package/dist/seo/index.d.ts +4 -2
  430. package/dist/seo/index.js +2 -2
  431. package/dist/seo/ports.d.ts +2 -2
  432. package/dist/seo/ports.js +1 -1
  433. package/dist/seo/react/components/AnalyzePanel.d.ts +13 -0
  434. package/dist/seo/react/components/AnalyzePanel.js +21 -0
  435. package/dist/seo/react/components/EntryPicker.d.ts +19 -0
  436. package/dist/seo/react/components/EntryPicker.js +25 -0
  437. package/dist/seo/react/components/MediaPickerBridge.d.ts +4 -1
  438. package/dist/seo/react/components/MediaPickerBridge.js +2 -2
  439. package/dist/seo/react/components/MediaRefField.d.ts +5 -2
  440. package/dist/seo/react/components/MediaRefField.js +5 -5
  441. package/dist/seo/react/components/SeoEntryFields.d.ts +19 -0
  442. package/dist/seo/react/components/SeoEntryFields.js +19 -0
  443. package/dist/seo/react/components/SeoEntryPanel.d.ts +31 -0
  444. package/dist/seo/react/components/SeoEntryPanel.js +64 -0
  445. package/dist/seo/react/components/SeoIcons.d.ts +3 -3
  446. package/dist/seo/react/components/SeoIcons.js +3 -3
  447. package/dist/seo/react/components/SeoSection.d.ts +27 -0
  448. package/dist/seo/react/components/SeoSection.js +24 -0
  449. package/dist/seo/react/components/SitemapModal.d.ts +42 -2
  450. package/dist/seo/react/components/SitemapModal.js +17 -17
  451. package/dist/seo/react/hooks/MediaRefField.hooks.js +6 -6
  452. package/dist/seo/react/hooks/SeoModuleTabs.d.ts +2 -2
  453. package/dist/seo/react/hooks/SeoModuleTabs.js +3 -1
  454. package/dist/seo/react/hooks/SeoPage.hooks.d.ts +2 -2
  455. package/dist/seo/react/hooks/SeoPorts.hooks.d.ts +5 -0
  456. package/dist/seo/react/hooks/SeoPorts.hooks.js +11 -1
  457. package/dist/seo/react/hooks/SeoQuery.hooks.d.ts +3 -3
  458. package/dist/seo/react/hooks/SeoQuery.hooks.js +1 -1
  459. package/dist/seo/react/hooks/SitemapModal.hooks.js +1 -1
  460. package/dist/seo/react/hooks/use-entry-picker.hooks.js +1 -1
  461. package/dist/seo/react/hooks/use-seo-entry-panel.hooks.js +3 -3
  462. package/dist/seo/react/hooks/use-seo-entry-section.hooks.js +2 -2
  463. package/dist/seo/react/hooks/use-seo.hooks.js +3 -3
  464. package/dist/seo/react/hooks/use-share-image-warning.hooks.js +1 -1
  465. package/dist/seo/react/hooks/use-sitemap-modal.hooks.d.ts +4 -1
  466. package/dist/seo/react/hooks/use-sitemap-modal.hooks.js +6 -5
  467. package/dist/seo/react/index.d.ts +28 -21
  468. package/dist/seo/react/index.js +5 -6
  469. package/dist/seo/react/pages/SeoPage.d.ts +16 -82
  470. package/dist/seo/react/pages/SeoPage.js +29 -216
  471. package/dist/seo/react/tabs/SeoDefaultsSections.d.ts +19 -0
  472. package/dist/seo/react/tabs/SeoDefaultsSections.js +48 -0
  473. package/dist/seo/react/tabs/SeoDefaultsTab.d.ts +24 -0
  474. package/dist/seo/react/tabs/SeoDefaultsTab.js +30 -0
  475. package/dist/seo/react/tabs/SeoSitemapTab.d.ts +24 -0
  476. package/dist/seo/react/tabs/SeoSitemapTab.js +38 -0
  477. package/dist/seo/rules.d.ts +3 -3
  478. package/dist/seo/rules.js +6 -6
  479. package/dist/seo/seo.module.d.ts +3 -3
  480. package/dist/seo/seo.module.js +1 -1
  481. package/dist/source-control/controllers/source-control.controller.d.ts +3 -3
  482. package/dist/source-control/controllers/source-control.controller.js +1 -1
  483. package/dist/source-control/ports.d.ts +1 -1
  484. package/dist/source-control/ports.js +1 -1
  485. package/dist/source-control/react/components/SourceControlCredentialFields.d.ts +4 -2
  486. package/dist/source-control/react/components/SourceControlCredentialFields.js +3 -3
  487. package/dist/source-control/react/components/SourceControlProviderRow.d.ts +1 -1
  488. package/dist/source-control/react/components/SourceControlProviderRow.js +2 -2
  489. package/dist/source-control/react/hooks/ProvidersTab.hooks.d.ts +1 -1
  490. package/dist/source-control/react/hooks/ProvidersTab.hooks.js +2 -2
  491. package/dist/source-control/react/hooks/SourceControlPage.hooks.d.ts +7 -3
  492. package/dist/source-control/react/hooks/SourceControlPorts.hooks.d.ts +5 -0
  493. package/dist/source-control/react/hooks/SourceControlPorts.hooks.js +11 -1
  494. package/dist/source-control/react/index.d.ts +25 -50
  495. package/dist/source-control/react/index.js +9 -6
  496. package/dist/source-control/react/pages/SourceControlPage.d.ts +8 -2
  497. package/dist/source-control/react/pages/SourceControlPage.js +3 -3
  498. package/dist/source-control/react/tabs/ProvidersTab.d.ts +5 -2
  499. package/dist/source-control/react/tabs/ProvidersTab.js +3 -3
  500. package/dist/source-control/source-control.module.d.ts +2 -2
  501. package/dist/source-control/source-control.module.js +1 -1
  502. package/dist/widgets/adapters/http.js +2 -2
  503. package/dist/widgets/adapters/memory.js +26 -20
  504. package/dist/widgets/controllers/instance-editor.controller.d.ts +3 -3
  505. package/dist/widgets/controllers/instance-editor.controller.js +48 -38
  506. package/dist/widgets/controllers/library.controller.d.ts +3 -3
  507. package/dist/widgets/controllers/library.controller.js +1 -2
  508. package/dist/widgets/controllers/region-editor.controller.d.ts +3 -3
  509. package/dist/widgets/controllers/region-editor.controller.js +5 -5
  510. package/dist/widgets/controllers/regions.controller.d.ts +3 -3
  511. package/dist/widgets/controllers/regions.controller.js +1 -2
  512. package/dist/widgets/index.d.ts +2 -1
  513. package/dist/widgets/index.js +1 -1
  514. package/dist/widgets/messages.en.js +1 -1
  515. package/dist/widgets/ports.d.ts +3 -3
  516. package/dist/widgets/ports.js +1 -1
  517. package/dist/widgets/react/components/RegionPlacementRow.d.ts +14 -0
  518. package/dist/widgets/react/components/RegionPlacementRow.js +8 -0
  519. package/dist/widgets/react/components/TrashWidgetDialog.d.ts +11 -0
  520. package/dist/widgets/react/components/TrashWidgetDialog.js +8 -0
  521. package/dist/widgets/react/components/WidgetInstanceNotices.js +1 -1
  522. package/dist/widgets/react/components/WidgetPageHeaders.d.ts +42 -0
  523. package/dist/widgets/react/components/WidgetPageHeaders.js +54 -0
  524. package/dist/widgets/react/components/WidgetRegionEditorHeaderActions.js +1 -1
  525. package/dist/widgets/react/components/WidgetTableColumns.d.ts +12 -0
  526. package/dist/widgets/react/components/WidgetTableColumns.js +47 -0
  527. package/dist/widgets/react/hooks/WidgetsPorts.hooks.d.ts +12 -7
  528. package/dist/widgets/react/hooks/WidgetsPorts.hooks.js +11 -0
  529. package/dist/widgets/react/hooks/WidgetsQuery.hooks.d.ts +2 -2
  530. package/dist/widgets/react/hooks/WidgetsQuery.hooks.js +1 -1
  531. package/dist/widgets/react/hooks/page-views.hooks.d.ts +1 -1
  532. package/dist/widgets/react/hooks/page-views.hooks.js +1 -1
  533. package/dist/widgets/react/hooks/use-widget-instance-editor.hooks.d.ts +2 -2
  534. package/dist/widgets/react/hooks/use-widget-instance-editor.hooks.js +3 -3
  535. package/dist/widgets/react/hooks/use-widget-region-editor.hooks.d.ts +1 -1
  536. package/dist/widgets/react/hooks/use-widget-region-editor.hooks.js +2 -2
  537. package/dist/widgets/react/hooks/use-widget-regions.hooks.d.ts +3 -1
  538. package/dist/widgets/react/hooks/use-widget-regions.hooks.js +7 -6
  539. package/dist/widgets/react/hooks/use-widgets-library.hooks.d.ts +4 -2
  540. package/dist/widgets/react/hooks/use-widgets-library.hooks.js +7 -6
  541. package/dist/widgets/react/index.d.ts +41 -34
  542. package/dist/widgets/react/index.js +5 -6
  543. package/dist/widgets/react/pages/WidgetInstanceEditor.d.ts +5 -1
  544. package/dist/widgets/react/pages/WidgetInstanceEditor.js +7 -9
  545. package/dist/widgets/react/pages/WidgetRegionEditor.d.ts +5 -1
  546. package/dist/widgets/react/pages/WidgetRegionEditor.js +8 -10
  547. package/dist/widgets/react/pages/WidgetRegions.d.ts +5 -1
  548. package/dist/widgets/react/pages/WidgetRegions.js +6 -8
  549. package/dist/widgets/react/pages/WidgetsLibrary.d.ts +5 -1
  550. package/dist/widgets/react/pages/WidgetsLibrary.js +8 -45
  551. package/dist/widgets/rules.d.ts +5 -3
  552. package/dist/widgets/rules.js +4 -9
  553. package/dist/widgets/widgets.module.d.ts +3 -3
  554. package/dist/widgets/widgets.module.js +1 -1
  555. package/package.json +23 -57
  556. package/dist/consent/react/ConsentFields.d.ts +0 -39
  557. package/dist/consent/react/ConsentFields.js +0 -87
  558. package/dist/consent/react/ConsentPreviewFrame.d.ts +0 -14
  559. package/dist/consent/react/ConsentPreviewFrame.js +0 -14
  560. package/dist/consent/react/ConsentSettingsPanel.d.ts +0 -54
  561. package/dist/consent/react/ConsentSettingsPanel.js +0 -13
  562. package/dist/consent/react/index.d.ts +0 -8
  563. package/dist/consent/react/index.js +0 -4
  564. package/dist/consent/react/settings-panel.hooks.d.ts +0 -49
  565. package/dist/consent/react/settings-panel.hooks.js +0 -57
  566. package/dist/core/module/controller-store.d.ts +0 -22
  567. package/dist/core/module/controller-store.js +0 -32
  568. package/dist/core/module/define-admin-module.d.ts +0 -4
  569. package/dist/core/module/define-admin-module.js +0 -5
  570. package/dist/core/module/token.d.ts +0 -19
  571. package/dist/core/module/token.js +0 -4
  572. package/dist/core/module/types.d.ts +0 -79
  573. package/dist/core/module/types.js +0 -2
  574. package/dist/core/permissions/rules.d.ts +0 -35
  575. package/dist/core/permissions/rules.js +0 -34
  576. package/dist/core/transport/errors.d.ts +0 -62
  577. package/dist/core/transport/errors.js +0 -63
  578. package/dist/core/transport/query-suffix.d.ts +0 -3
  579. package/dist/core/transport/query-suffix.js +0 -5
  580. package/dist/react/bind-react.d.ts +0 -2
  581. package/dist/react/bind-react.js +0 -3
  582. package/dist/react/use-controller.d.ts +0 -2
  583. package/dist/react/use-controller.js +0 -3
@@ -91,18 +91,6 @@ function isRetryableHttpStatus({ status }, _optional = {}) {
91
91
  export function parseOptionalPixelSize({ value }, _optional = {}) {
92
92
  return value.trim() === '' ? null : Number(value);
93
93
  }
94
- /** 1024-based to agree with upload limits. Whole B/KB, one decimal MB/GB distinguishes
95
- * similarly sized clips; locale controls the decimal separator, never a hardcoded dot. */
96
- export function formatByteSize({ bytes }, { locale = 'en-US' } = {}) {
97
- if (bytes < 1024)
98
- return `${Math.round(bytes)} B`;
99
- const kb = bytes / 1024;
100
- if (kb < 1024)
101
- return `${Math.round(kb)} KB`;
102
- const decimal = new Intl.NumberFormat(locale, { minimumFractionDigits: 1, maximumFractionDigits: 1 });
103
- const mb = kb / 1024;
104
- return mb < 1024 ? `${decimal.format(mb)} MB` : `${decimal.format(mb / 1024)} GB`;
105
- }
106
94
  /** The extension each sniffed media type is stored as; JPEG shows as the common ".jpg". */
107
95
  const MEDIA_EXTENSION_BY_CONTENT_TYPE = {
108
96
  'image/png': 'png', 'image/jpeg': 'jpg', 'image/gif': 'gif', 'image/webp': 'webp', 'image/avif': 'avif',
@@ -4,10 +4,10 @@ export declare function createPlaygroundController({ targets, permissions }: {
4
4
  targets: PlaygroundRenderTargetPort;
5
5
  permissions?: readonly string[];
6
6
  }, _optional?: {}): {
7
- getSnapshot: () => Readonly<PlaygroundState>;
8
- subscribe: ({ listener }: {
7
+ getSnapshot: (required?: Record<string, never>, optional?: Record<string, never>) => PlaygroundState;
8
+ subscribe: (required: {
9
9
  listener: () => void;
10
- }) => () => void;
10
+ }, optional?: Record<string, never>) => () => void;
11
11
  attach({ target }: {
12
12
  target: object | null;
13
13
  }, _optional?: {}): void;
@@ -1,4 +1,4 @@
1
- import { createControllerStore } from '../../core/module/controller-store.js';
1
+ import { createControllerStore } from '@jini-ai/core/admin-runtime';
2
2
  import { canMountPlayground } from '../rules.js';
3
3
  export function createPlaygroundController({ targets, permissions = [] }, _optional = {}) {
4
4
  const store = createControllerStore({ initial: { attached: false } });
@@ -1,7 +1,7 @@
1
1
  export declare const playgroundModule: {
2
2
  readonly id: "playground";
3
3
  readonly requires: {
4
- readonly playgroundTargets: import("../core/module/token.js").AdminPortToken<import("../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
4
+ readonly playgroundTargets: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
5
5
  };
6
6
  readonly messages: Readonly<{
7
7
  title: "Playground";
@@ -1,4 +1,4 @@
1
- import { defineAdminModule } from '../core/module/index.js';
1
+ import { defineAdminModule } from '@jini-ai/core/contracts/admin-module';
2
2
  import { playgroundRenderTargetToken } from '../contracts/playground-render-target.js';
3
3
  import { playgroundMessagesEn } from './messages.en.js';
4
4
  export const playgroundModule = defineAdminModule({ id: 'playground', requires: { playgroundTargets: playgroundRenderTargetToken }, messages: playgroundMessagesEn, pages: { playground: { path: '/playground', label: playgroundMessagesEn.title, permissions: ['playground.read'], nav: { group: 'studio', icon: 'canvas' }, tabs: { canvas: { label: playgroundMessagesEn.canvas } } } } });
@@ -1,3 +1,6 @@
1
- import type { TabViewProps } from '../../../core/react/bind-react.js';
2
- export declare function Canvas(props: TabViewProps, _optional?: {}): import("react").JSX.Element;
1
+ import type { TabViewProps } from '@jini-ai/core/contracts/admin-module';
2
+ import { useCanvas } from '../hooks/Canvas.hooks.js';
3
+ export declare function Canvas({ useCanvasHook, ...props }: TabViewProps & {
4
+ useCanvasHook?: typeof useCanvas;
5
+ }): import("react").JSX.Element;
3
6
  //# sourceMappingURL=Canvas.d.ts.map
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Notice } from '@jini-ai/ui-kit/react';
2
+ import { Notice } from '../../../react/kit.js';
3
3
  import { useCanvas } from '../hooks/Canvas.hooks.js';
4
4
  import { playgroundMessagesEn as m } from '../../messages.en.js';
5
- export function Canvas(props, _optional = {}) {
6
- const vm = useCanvas(props);
5
+ export function Canvas({ useCanvasHook = useCanvas, ...props }) {
6
+ const vm = useCanvasHook(props);
7
7
  return vm.denied ? _jsx(Notice, { tone: "danger", children: m.denied }) : _jsxs("section", { children: [_jsx("h2", { children: m.canvas }), _jsx("style", { children: vm.styles }), _jsx("div", { "data-jini-part": "playground.canvas", className: "jini-playground-canvas", ref: vm.registerCanvas }), _jsx("p", { "data-jini-part": "playground.empty", className: "jini-playground-empty", children: m.empty })] });
8
8
  }
9
9
  //# sourceMappingURL=Canvas.js.map
@@ -1,4 +1,4 @@
1
- import type { TabViewProps } from '../../../core/react/bind-react.js';
1
+ import type { TabViewProps } from '@jini-ai/core/contracts/admin-module';
2
2
  export declare function useCanvas({ permissions }: TabViewProps, _optional?: {}): {
3
3
  denied: boolean;
4
4
  registerCanvas: (node: HTMLDivElement | null) => void | undefined;
@@ -1,8 +1,12 @@
1
- import type { ModulePageProps } from '../../../core/react/bind-react.js';
2
- export declare function usePlaygroundPage(props: ModulePageProps, _optional?: {}): {
1
+ import type { ComponentType } from 'react';
2
+ import type { ModulePageProps, TabViewProps } from '@jini-ai/core/contracts/admin-module';
3
+ /** The shell passes this page its tabs as renderable components. */
4
+ type TabbedPageProps = ModulePageProps<ComponentType<TabViewProps>>;
5
+ export declare function usePlaygroundPage(props: TabbedPageProps, _optional?: {}): {
3
6
  denied: boolean;
4
- ActiveTab: import("react").LazyExoticComponent<import("react").ComponentType<import("../../../react/bind-react.js").TabViewProps>> | undefined;
7
+ ActiveTab: ComponentType<TabViewProps> | undefined;
5
8
  params: Readonly<Record<string, unknown>>;
6
9
  permissions: readonly string[];
7
10
  };
11
+ export {};
8
12
  //# sourceMappingURL=PlaygroundPage.hooks.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { createContext, useContext } from 'react';
2
- import { AdminConfigError } from '../../../core/module/index.js';
2
+ import { AdminConfigError } from '@jini-ai/core/admin-runtime';
3
3
  export const PlaygroundPortsContext = createContext(null);
4
4
  export function usePlaygroundPorts(_required = {}, _optional = {}) {
5
5
  const ports = useContext(PlaygroundPortsContext);
@@ -2,7 +2,7 @@ export { usePlaygroundPorts } from './hooks/PlaygroundPorts.hooks.js';
2
2
  export declare function playground(_required: Record<string, never>, _optional?: {}): {
3
3
  id: "playground";
4
4
  requires: {
5
- readonly playgroundTargets: import("../../core/module/token.js").AdminPortToken<import("../../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
5
+ readonly playgroundTargets: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
6
6
  };
7
7
  messages: Readonly<{
8
8
  title: "Playground";
@@ -33,7 +33,7 @@ export declare function playground(_required: Record<string, never>, _optional?:
33
33
  module: {
34
34
  id: "playground";
35
35
  requires: {
36
- readonly playgroundTargets: import("../../core/module/token.js").AdminPortToken<import("../../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
36
+ readonly playgroundTargets: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
37
37
  };
38
38
  messages: Readonly<{
39
39
  title: "Playground";
@@ -62,19 +62,19 @@ export declare function playground(_required: Record<string, never>, _optional?:
62
62
  };
63
63
  pages: {
64
64
  readonly playground: {
65
- Page: import("react").LazyExoticComponent<import("react").ComponentType<import("../../react/bind-react.js").ModulePageProps>>;
65
+ Page: import("react").LazyExoticComponent<import("react").ComponentType<import("@jini-ai/core/contracts/admin-module").ModulePageProps<import("../../core/react/bind-react.js").LazyTabView>>>;
66
66
  tabs: {
67
- readonly canvas: import("react").LazyExoticComponent<import("react").ComponentType<import("../../react/bind-react.js").TabViewProps>>;
67
+ readonly canvas: import("../../core/react/bind-react.js").LazyTabView;
68
68
  };
69
69
  };
70
70
  };
71
71
  Provider: ({ admin, children }: {
72
- admin: import("../../core/module/types.js").AdminInstance;
72
+ admin: import("@jini-ai/core/contracts/admin-module").AdminInstance;
73
73
  children: import("react").ReactNode;
74
- }, _optional?: Record<string, never>) => import("react").FunctionComponentElement<import("react").ProviderProps<import("../../core/module/types.js").ScopedPorts<{
74
+ }, _optional?: Record<string, never>) => import("react").FunctionComponentElement<import("react").ProviderProps<import("@jini-ai/core/contracts/admin-module").ScopedPorts<{
75
75
  id: "playground";
76
76
  requires: {
77
- readonly playgroundTargets: import("../../core/module/token.js").AdminPortToken<import("../../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
77
+ readonly playgroundTargets: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
78
78
  };
79
79
  messages: Readonly<{
80
80
  title: "Playground";
@@ -101,10 +101,10 @@ export declare function playground(_required: Record<string, never>, _optional?:
101
101
  };
102
102
  };
103
103
  }> | null>>;
104
- usePorts: (_required?: Record<string, never>, _optional?: Record<string, never>) => import("../../core/module/types.js").ScopedPorts<{
104
+ usePorts: (_required?: Record<string, never>, _optional?: Record<string, never>) => import("@jini-ai/core/contracts/admin-module").ScopedPorts<{
105
105
  id: "playground";
106
106
  requires: {
107
- readonly playgroundTargets: import("../../core/module/token.js").AdminPortToken<import("../../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
107
+ readonly playgroundTargets: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
108
108
  };
109
109
  messages: Readonly<{
110
110
  title: "Playground";
@@ -1,4 +1,10 @@
1
- import type { ModulePageProps } from '../../../core/react/bind-react.js';
2
- export declare function PlaygroundPage(props: ModulePageProps, _optional?: {}): import("react").JSX.Element;
1
+ import type { ComponentType } from 'react';
2
+ import type { ModulePageProps, TabViewProps } from '@jini-ai/core/contracts/admin-module';
3
+ import { usePlaygroundPage } from '../hooks/PlaygroundPage.hooks.js';
4
+ /** The shell passes this page its tabs as renderable components. */
5
+ type TabbedPageProps = ModulePageProps<ComponentType<TabViewProps>>;
6
+ export declare function PlaygroundPage({ usePlaygroundPageHook, ...props }: TabbedPageProps & {
7
+ usePlaygroundPageHook?: typeof usePlaygroundPage;
8
+ }): import("react").JSX.Element;
3
9
  export default PlaygroundPage;
4
10
  //# sourceMappingURL=PlaygroundPage.d.ts.map
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Suspense } from 'react';
3
- import { Notice, Spinner } from '@jini-ai/ui-kit/react';
3
+ import { Notice, Spinner } from '../../../react/kit.js';
4
4
  import { usePlaygroundPage } from '../hooks/PlaygroundPage.hooks.js';
5
5
  import { playgroundMessagesEn as m } from '../../messages.en.js';
6
- export function PlaygroundPage(props, _optional = {}) {
7
- const vm = usePlaygroundPage(props);
6
+ export function PlaygroundPage({ usePlaygroundPageHook = usePlaygroundPage, ...props }) {
7
+ const vm = usePlaygroundPageHook(props);
8
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
9
  }
10
10
  export default PlaygroundPage;
@@ -1,4 +1,4 @@
1
- import type { TabViewProps } from '../../../core/react/bind-react.js';
2
- export declare function CanvasTab(props: TabViewProps, _optional?: {}): import("react").JSX.Element;
1
+ import type { TabViewProps } from '@jini-ai/core/contracts/admin-module';
2
+ export declare function CanvasTab(props: TabViewProps): import("react").JSX.Element;
3
3
  export default CanvasTab;
4
4
  //# sourceMappingURL=CanvasTab.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Canvas } from '../components/Canvas.js';
3
- export function CanvasTab(props, _optional = {}) { return _jsx(Canvas, { ...props }); }
3
+ export function CanvasTab(props) { return _jsx(Canvas, { ...props }); }
4
4
  export default CanvasTab;
5
5
  //# sourceMappingURL=CanvasTab.js.map
@@ -1,3 +1,6 @@
1
+ import { useOverlayHost } from './OverlayHost.hooks.js';
1
2
  import type { OverlayHostProps } from './OverlayHost.hooks.js';
2
- export declare function OverlayHost(props: OverlayHostProps, _optional?: Record<string, never>): import("react").JSX.Element;
3
+ export declare function OverlayHost({ useOverlayHostHook, ...props }: OverlayHostProps & {
4
+ useOverlayHostHook?: typeof useOverlayHost;
5
+ }): import("react").JSX.Element;
3
6
  //# sourceMappingURL=OverlayHost.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useOverlayHost } from './OverlayHost.hooks.js';
3
- export function OverlayHost(props, _optional = {}) {
4
- const entries = useOverlayHost(props);
3
+ export function OverlayHost({ useOverlayHostHook = useOverlayHost, ...props }) {
4
+ const entries = useOverlayHostHook(props);
5
5
  return (_jsx("div", { "data-jini-part": "admin.overlays", children: entries.map((entry) => (_jsx("div", { children: entry.content }, entry.id))) }));
6
6
  }
7
7
  //# sourceMappingURL=OverlayHost.js.map
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import { type ConfirmTone } from '../../types.js';
3
- import { type UseConfirmDialog } from './ConfirmDialog.hooks.js';
3
+ import { useConfirmDialogCancelLabel, type UseConfirmDialog } from './ConfirmDialog.hooks.js';
4
4
  /**
5
5
  * @file Shared modal confirmation primitive — the replacement for `window.confirm`, which blocks
6
6
  * the whole tab, cannot carry destructive-vs-neutral styling, and reads as a browser artifact
@@ -90,6 +90,14 @@ export interface ConfirmDialogProps {
90
90
  * effect without `agentHandle`. @default true */
91
91
  agentMayConfirm?: boolean;
92
92
  }
93
+ /** Hooks ConfirmDialog calls; defaults to the real ones, a test hands in fakes. */
94
+ export declare const defaultConfirmDialogHooks: {
95
+ useConfirmDialogCancelLabel: typeof useConfirmDialogCancelLabel;
96
+ useConfirmController: (required: import("../../kit.js").KitConfirmDialogProps, optional?: {
97
+ agent?: import("../../kit.js").AgentAttrsPort;
98
+ }) => import("../../kit.js").ConfirmControllerView;
99
+ };
100
+ export type ConfirmDialogHooks = typeof defaultConfirmDialogHooks;
93
101
  /**
94
102
  * UI-kit's confirmation planner owns the sub-handle segments appended to the caller's base:
95
103
  * literals chosen by the mechanism, never host data. Neither needs sanitizing, unlike
@@ -116,5 +124,7 @@ export interface ConfirmDialogProps {
116
124
  * is no browser-assigned "default button" for Enter to reach for at all; confirm can only ever fire
117
125
  * from an explicit click or explicit Tab-then-Enter onto it.
118
126
  */
119
- export declare function ConfirmDialog({ useDialog, agentHandle: baseHandle, agentMayConfirm, ...props }: ConfirmDialogProps, _optional?: Record<string, never>): import("react").JSX.Element;
127
+ export declare function ConfirmDialog({ useDialog, agentHandle: baseHandle, agentMayConfirm, hooks, ...props }: ConfirmDialogProps & {
128
+ hooks?: ConfirmDialogHooks | undefined;
129
+ }, _optional?: Record<string, never>): import("react").JSX.Element;
120
130
  //# sourceMappingURL=ConfirmDialog.d.ts.map
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { createContext, useContext, useMemo, useRef, } from 'react';
3
- import { useNativeDialog } from '@jini-ai/ui-kit/react/native';
4
- import { useFocusTrap } from '@jini-ai/ui/panel-kit';
3
+ import { useNativeDialog, useFocusTrap } from '../../kit.js';
5
4
  /** Empty object, not `undefined` — {@link useConfirmDialogCancelLabel} can always read `cancelLabel`
6
5
  * off it without an extra null check, whether or not a provider is mounted. */
7
6
  const ConfirmDialogDefaultsContext = createContext({});
@@ -1,8 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useConfirmController } from '@jini-ai/ui-kit/react';
2
+ import { useConfirmController } from '../../kit.js';
3
3
  import { resolveTone, toneClassName } from '../../types.js';
4
4
  import { useConfirmDialog, useConfirmDialogCancelLabel } from './ConfirmDialog.hooks.js';
5
5
  import { confirmDialogAgentAttrs, withoutAccessibleName } from './confirm-dialog-attrs.js';
6
+ /** Hooks ConfirmDialog calls; defaults to the real ones, a test hands in fakes. */
7
+ export const defaultConfirmDialogHooks = { useConfirmDialogCancelLabel, useConfirmController };
6
8
  /**
7
9
  * UI-kit's confirmation planner owns the sub-handle segments appended to the caller's base:
8
10
  * literals chosen by the mechanism, never host data. Neither needs sanitizing, unlike
@@ -29,10 +31,10 @@ import { confirmDialogAgentAttrs, withoutAccessibleName } from './confirm-dialog
29
31
  * is no browser-assigned "default button" for Enter to reach for at all; confirm can only ever fire
30
32
  * from an explicit click or explicit Tab-then-Enter onto it.
31
33
  */
32
- export function ConfirmDialog({ useDialog = useConfirmDialog, agentHandle: baseHandle, agentMayConfirm = true, ...props }, _optional = {}) {
34
+ export function ConfirmDialog({ useDialog = useConfirmDialog, agentHandle: baseHandle, agentMayConfirm = true, hooks = defaultConfirmDialogHooks, ...props }, _optional = {}) {
33
35
  const tone = resolveTone({}, props);
34
- const cancelLabel = useConfirmDialogCancelLabel({}, { explicit: props.cancelLabel });
35
- const controller = useConfirmController({
36
+ const cancelLabel = hooks.useConfirmDialogCancelLabel({}, { explicit: props.cancelLabel });
37
+ const controller = hooks.useConfirmController({
36
38
  open: props.open, title: props.title, body: props.body, confirmLabel: props.confirmLabel,
37
39
  cancelLabel, tone, agentMayConfirm,
38
40
  ...(baseHandle === undefined ? {} : { agentHandle: baseHandle }),
@@ -1,4 +1,4 @@
1
- import type { AgentAttrsPort, KitAttrs } from '@jini-ai/ui-kit';
1
+ import type { AgentAttrsPort, KitAttrs } from '../../kit.js';
2
2
  /**
3
3
  * The agent-attribute port `ConfirmDialog` hands UI-kit's confirm controller. UI-kit names selects
4
4
  * separately; agentic publishes them as fields and still owns handle validation. Absent role/label
@@ -1,4 +1,4 @@
1
- import { agentHandle } from '@jini-ai/agentic';
1
+ import { agentHandle } from '@jini-ai/core/agent-handles';
2
2
  import { omitKeys } from '../../../core/omit-keys.js';
3
3
  /**
4
4
  * The agent-attribute port `ConfirmDialog` hands UI-kit's confirm controller. UI-kit names selects
@@ -1,4 +1,4 @@
1
- import { type CanvasEmbedPlaceholderDescriptor, type InteractiveHtmlEditorProps as HtmlEditorProps } from '@jini-ai/ui/html-editor';
1
+ import { type CanvasEmbedPlaceholderDescriptor, type HtmlEditorProps } from '../../kit.js';
2
2
  /** True when `el` carries any embed marker attribute this convention recognizes — exported for
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,
@@ -7,7 +7,7 @@ export declare function isProtectedEmbedElement({ el }: {
7
7
  readonly el: Element;
8
8
  }): boolean;
9
9
  /**
10
- * Recognizes a `data-embed-config` marker (the consuming product's own `src/core/embeds/marker.ts`'s single scanner
10
+ * Recognizes a `data-embed-config` marker (the consuming product's own `packages/cms/src/widgets/markers/marker.ts`'s single scanner
11
11
  * convention) on a live canvas element and describes it for `@jini-ai/ui/html-editor`'s
12
12
  * `applyCanvasEmbedPlaceholders` — see that function's own file header for what it does with the
13
13
  * result. Exported for direct unit-testability without mounting the editor, same convention
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { InteractiveHtmlEditor as HtmlEditor, hasAttributeOnAnyNodeShape, } from '@jini-ai/ui/html-editor';
2
+ import { HtmlEditor, } from '../../kit.js';
3
+ import { hasAttributeOnAnyNodeShape } from '@jini-ai/core/primitives';
3
4
  /**
4
5
  * @file Consuming-product-specific composition of `@jini-ai/ui/html-editor`'s generic
5
6
  * `InteractiveHtmlEditor`: a page editor's `body_html`
@@ -20,10 +21,10 @@ import { InteractiveHtmlEditor as HtmlEditor, hasAttributeOnAnyNodeShape, } from
20
21
  */
21
22
  /** The attribute either the current (`data-embed-type`) or legacy (`data-widget-embed`,
22
23
  * `data-form-embed`) convention uses to mark a Page HTML embed placeholder div — see the
23
- * consuming product's own `src/widgets/html-embeds.ts`'s file header for the convention this protects.
24
+ * legacy embed marker convention this protects.
24
25
  *
25
26
  * **Does NOT include `data-embed-config`, the CURRENT marker attribute** (the consuming product's own
26
- * `src/core/embeds/marker.ts`) — a known, separately-tracked gap: an embed marker written the current way is still
27
+ * `packages/cms/src/widgets/markers/marker.ts`) — a known, separately-tracked gap: an embed marker written the current way is still
27
28
  * editable/draggable/removable in this editor today. Left alone here deliberately (out of scope for
28
29
  * the placeholder-card feature this file's `describeEmbedPlaceholder` was added for); widening this
29
30
  * list to close that gap is a one-line fix (`'data-embed-config'` added below) but changes real
@@ -35,11 +36,11 @@ const EMBED_MARKER_ATTRIBUTES = ['data-embed-type', 'data-widget-embed', 'data-f
35
36
  * the `isProtectedElement` predicate is invoked from inside GrapesJS's `isComponent` callback,
36
37
  * which is not always called with a real DOM `Element` — see that helper's own doc. */
37
38
  export function isProtectedEmbedElement({ el }) {
38
- return EMBED_MARKER_ATTRIBUTES.some((attr) => hasAttributeOnAnyNodeShape(el, attr));
39
+ return EMBED_MARKER_ATTRIBUTES.some((attr) => hasAttributeOnAnyNodeShape({ node: el, attribute: attr }));
39
40
  }
40
41
  /**
41
42
  * Friendly card headings for every embed `type` value this codebase names anywhere, split into two
42
- * groups (traced against the consuming product's own `src/server/http/site/render.ts`'s `renderHtmlPageBody`/`isPageEmbedType`
43
+ * groups (traced against the host app's `src/server/inbound/public-http/http/site/render.ts`'s `renderHtmlPageBody`/`isPageEmbedType`
43
44
  * at the owner's own request, 2026-08-25 — authoritative, not re-derived):
44
45
  *
45
46
  * - **`media`, `widget`, `post`, `content`** — the ONLY four types `isPageEmbedType` (gating
@@ -61,10 +62,10 @@ export function isProtectedEmbedElement({ el }) {
61
62
  * or guessing from the id string, which is not a real signal and would be actively misleading if wrong.
62
63
  * "Media" stays correct for both until a cheap, real signal exists.
63
64
  *
64
- * Matched lower-cased — see `identityLabel`'s doc and `core/embeds/marker.ts`'s own `toEmbedRef` for
65
+ * Matched lower-cased — see `identityLabel`'s doc and `packages/cms/src/widgets/html/html-embeds.ts`'s own `toEmbedRef` for
65
66
  * why the server-side scanner lower-cases `type` the same way. An unregistered type is not an error
66
67
  * here (unlike a rejected/unparseable marker) — `type` is deliberately a free string end-to-end (see
67
- * the consuming product's own `src/widgets/html-embeds.ts`'s file header) precisely so a new one (a marketplace theme
68
+ * the consuming product's own `packages/cms/src/widgets/html/html-embeds.ts`'s file header) precisely so a new one (a marketplace theme
68
69
  * introducing its own, say) never requires a matching change on this list AND never renders nothing —
69
70
  * `titleCase` below covers it with a still-legible generic card instead of a blank/thrown result.
70
71
  */
@@ -110,7 +111,7 @@ function identityLabel(config) {
110
111
  return id.length > ID_PREVIEW_LENGTH ? `id ${id.slice(0, ID_PREVIEW_LENGTH)}…` : `id ${id}`;
111
112
  }
112
113
  /**
113
- * Recognizes a `data-embed-config` marker (the consuming product's own `src/core/embeds/marker.ts`'s single scanner
114
+ * Recognizes a `data-embed-config` marker (the consuming product's own `packages/cms/src/widgets/markers/marker.ts`'s single scanner
114
115
  * convention) on a live canvas element and describes it for `@jini-ai/ui/html-editor`'s
115
116
  * `applyCanvasEmbedPlaceholders` — see that function's own file header for what it does with the
116
117
  * result. Exported for direct unit-testability without mounting the editor, same convention
@@ -1,4 +1,4 @@
1
- import { useEffect, useMemo, useRef, useState } from 'react';
1
+ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
2
2
  /** 8px clearance kept between the menu and the viewport edge on every side it's tested against. */
3
3
  const VIEWPORT_MARGIN = 8;
4
4
  /**
@@ -61,6 +61,66 @@ function trackOpenMenu({ trigger, menu }, { window, document, onPosition, onDism
61
61
  document.removeEventListener('keydown', onDocKeyDown);
62
62
  };
63
63
  }
64
+ /** Index updater for the arrow/Home/End keys, or null for any other key. */
65
+ function navigationUpdater({ key, itemCount }) {
66
+ switch (key) {
67
+ case 'ArrowDown': return (i) => (i + 1) % itemCount;
68
+ case 'ArrowUp': return (i) => (i - 1 + itemCount) % itemCount;
69
+ case 'Home': return () => 0;
70
+ case 'End': return () => itemCount - 1;
71
+ default: return null;
72
+ }
73
+ }
74
+ function handleMenuKey({ e, itemCount, setActiveIndex, close }) {
75
+ const next = navigationUpdater({ key: e.key, itemCount });
76
+ if (next) {
77
+ e.preventDefault();
78
+ setActiveIndex(next);
79
+ }
80
+ else if (e.key === 'Escape') {
81
+ e.preventDefault();
82
+ e.stopPropagation();
83
+ close(true);
84
+ }
85
+ else if (e.key === 'Tab') {
86
+ // Leaving via Tab closes the menu but does not steal focus back to the trigger — the
87
+ // browser's own tab order continues from wherever it lands, matching native menu behavior
88
+ // (and unlike Escape, which is an explicit "back out" gesture).
89
+ close(false);
90
+ }
91
+ else {
92
+ // Any other key is left to the browser.
93
+ }
94
+ }
95
+ function useMenuRef({ anchor, window, document, setPosition, close }) {
96
+ // Only the open menu renders this ref, so it only exists once there is an anchor. React calls it
97
+ // with the menu element on attach and `null` on detach (React 18 and 19 alike; attach always comes
98
+ // first, so `stop` is set by then). A new anchor or new `window`/`document` ports make a new ref,
99
+ // which React detaches and re-attaches — the same re-subscribe an effect's deps would give.
100
+ return useMemo(() => {
101
+ if (!anchor)
102
+ return null;
103
+ let stop;
104
+ return (menu) => {
105
+ if (menu)
106
+ stop = trackOpenMenu({ trigger: anchor, menu }, { window, document, onPosition: setPosition, onDismiss: () => close(false), onEscape: () => close(true) });
107
+ else
108
+ stop();
109
+ };
110
+ // `close` only touches state setters and `triggerRef`, all stable across renders.
111
+ }, [anchor, window, document, close]);
112
+ }
113
+ function useFocusActiveItem({ visible, activeIndex, itemRefs }) {
114
+ // Keeps real DOM focus on the active item (roving focus via `tabIndex={-1}` on every item except
115
+ // the active one) rather than only tracking `activeIndex` in state — arrow-key navigation needs
116
+ // to move the browser's actual focus for a screen reader to announce it. Waits for the first
117
+ // position: until then the menu is `visibility: hidden`, and a browser ignores focus on that.
118
+ useEffect(() => {
119
+ if (!visible)
120
+ return;
121
+ itemRefs.current[activeIndex]?.focus();
122
+ }, [visible, activeIndex]);
123
+ }
64
124
  /**
65
125
  * Owns `RowMenu`'s open/close state, positioning, and keyboard/focus behavior.
66
126
  *
@@ -79,43 +139,18 @@ export function useRowMenu({ itemCount, window, document }) {
79
139
  const triggerRef = useRef(null);
80
140
  const itemRefs = useRef([]);
81
141
  itemRefs.current = itemRefs.current.slice(0, itemCount);
82
- function close(returnFocus) {
142
+ const close = useCallback((returnFocus) => {
83
143
  setAnchor(null);
84
144
  setPosition(null);
85
145
  if (returnFocus)
86
146
  triggerRef.current?.focus();
87
- }
147
+ }, []);
88
148
  function openAt(index) {
89
149
  setActiveIndex(index);
90
150
  setAnchor(triggerRef.current);
91
151
  }
92
- // Only the open menu renders this ref, so it only exists once there is an anchor. React calls it
93
- // with the menu element on attach and `null` on detach (React 18 and 19 alike; attach always comes
94
- // first, so `stop` is set by then). A new anchor or new `window`/`document` ports make a new ref,
95
- // which React detaches and re-attaches — the same re-subscribe an effect's deps would give.
96
- const menuRef = useMemo(() => {
97
- if (!anchor)
98
- return null;
99
- let stop;
100
- return (menu) => {
101
- if (menu)
102
- stop = trackOpenMenu({ trigger: anchor, menu }, { window, document, onPosition: setPosition, onDismiss: () => close(false), onEscape: () => close(true) });
103
- else
104
- stop();
105
- };
106
- // `close` only touches state setters and `triggerRef`, all stable across renders.
107
- // eslint-disable-next-line react-hooks/exhaustive-deps
108
- }, [anchor, window, document]);
109
- // Keeps real DOM focus on the active item (roving focus via `tabIndex={-1}` on every item except
110
- // the active one) rather than only tracking `activeIndex` in state — arrow-key navigation needs
111
- // to move the browser's actual focus for a screen reader to announce it. Waits for the first
112
- // position: until then the menu is `visibility: hidden`, and a browser ignores focus on that.
113
- const visible = open && position !== null;
114
- useEffect(() => {
115
- if (!visible)
116
- return;
117
- itemRefs.current[activeIndex]?.focus();
118
- }, [visible, activeIndex]);
152
+ const menuRef = useMenuRef({ anchor, window, document, setPosition, close });
153
+ useFocusActiveItem({ visible: open && position !== null, activeIndex, itemRefs });
119
154
  function onTriggerClick() {
120
155
  if (open)
121
156
  close(false);
@@ -128,39 +163,7 @@ export function useRowMenu({ itemCount, window, document }) {
128
163
  e.preventDefault();
129
164
  openAt(e.key === 'ArrowDown' ? 0 : itemCount - 1);
130
165
  }
131
- function onMenuKeyDown(e) {
132
- switch (e.key) {
133
- case 'ArrowDown':
134
- e.preventDefault();
135
- setActiveIndex((i) => (i + 1) % itemCount);
136
- break;
137
- case 'ArrowUp':
138
- e.preventDefault();
139
- setActiveIndex((i) => (i - 1 + itemCount) % itemCount);
140
- break;
141
- case 'Home':
142
- e.preventDefault();
143
- setActiveIndex(0);
144
- break;
145
- case 'End':
146
- e.preventDefault();
147
- setActiveIndex(itemCount - 1);
148
- break;
149
- case 'Escape':
150
- e.preventDefault();
151
- e.stopPropagation();
152
- close(true);
153
- break;
154
- case 'Tab':
155
- // Leaving via Tab closes the menu but does not steal focus back to the trigger — the
156
- // browser's own tab order continues from wherever it lands, matching native menu behavior
157
- // (and unlike Escape, which is an explicit "back out" gesture).
158
- close(false);
159
- break;
160
- default:
161
- break;
162
- }
163
- }
166
+ const onMenuKeyDown = (e) => handleMenuKey({ e, itemCount, setActiveIndex, close });
164
167
  /** Closes (returning focus to the trigger, same as Escape) and then fires the selected item's own
165
168
  * callback — takes the callback directly rather than a whole `RowMenuItem` so this hook stays
166
169
  * free of any dependency on that component-level type. */
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { createPortal } from 'react-dom';
3
- import { agentHandle, buildAgentListHandles } from '@jini-ai/agentic';
3
+ import { agentHandle, buildAgentListHandles } from '@jini-ai/core/agent-handles';
4
4
  import { resolveTone, toneClassName } from '../../types.js';
5
5
  import { useRowMenu } from './RowMenu.hooks.js';
6
6
  /**