@jini-ai/admin 0.4.1 → 0.4.3

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 (374) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +7 -0
  3. package/dist/agent-plugins/react/components/AgentPluginFileTree.js +1 -1
  4. package/dist/agent-plugins/react/components/AgentPluginListPanel.d.ts +1 -1
  5. package/dist/agent-plugins/react/hooks/AgentPluginInspector.hooks.d.ts +0 -1
  6. package/dist/agent-plugins/react/hooks/AgentPluginInspector.hooks.js +7 -6
  7. package/dist/agent-plugins/react/hooks/AgentPluginPanel.hooks.d.ts +1 -1
  8. package/dist/agent-plugins/react/hooks/AgentPluginPanel.hooks.js +3 -2
  9. package/dist/agent-plugins/react/hooks/AgentPluginsPage.hooks.d.ts +1 -1
  10. package/dist/agent-plugins/react/hooks/AgentPluginsPage.hooks.js +1 -1
  11. package/dist/agent-plugins/react/hooks/MarketplaceTab.hooks.d.ts +1 -1
  12. package/dist/agent-plugins/react/index.js +1 -1
  13. package/dist/agent-plugins/react/pages/AgentPluginsPage.d.ts +1 -1
  14. package/dist/agent-plugins/react/tabs/DownloadedTab.d.ts +1 -1
  15. package/dist/agent-plugins/react/tabs/InstalledTab.d.ts +1 -1
  16. package/dist/agent-plugins/react/tabs/MarketplaceTab.d.ts +1 -1
  17. package/dist/comments/adapters/http.d.ts +29 -0
  18. package/dist/comments/adapters/http.js +50 -0
  19. package/dist/comments/adapters/memory.d.ts +17 -0
  20. package/dist/comments/adapters/memory.js +61 -0
  21. package/dist/comments/comments.module.d.ts +73 -0
  22. package/dist/comments/comments.module.js +16 -0
  23. package/dist/comments/conformance/comments-api.conformance.d.ts +9 -0
  24. package/dist/comments/conformance/comments-api.conformance.js +63 -0
  25. package/dist/comments/controllers/comment-queue.controller.d.ts +48 -0
  26. package/dist/comments/controllers/comment-queue.controller.js +164 -0
  27. package/dist/comments/controllers/comment-settings.controller.d.ts +32 -0
  28. package/dist/comments/controllers/comment-settings.controller.js +77 -0
  29. package/dist/comments/controllers/comments.controller.d.ts +16 -0
  30. package/dist/comments/controllers/comments.controller.js +16 -0
  31. package/dist/comments/index.d.ts +13 -0
  32. package/dist/comments/index.js +8 -0
  33. package/dist/comments/messages.en.d.ts +54 -0
  34. package/dist/comments/messages.en.js +56 -0
  35. package/dist/comments/models.d.ts +22 -0
  36. package/dist/comments/models.js +2 -0
  37. package/dist/comments/ports.d.ts +14 -0
  38. package/dist/comments/ports.js +5 -0
  39. package/dist/comments/react/components/QueueSection.d.ts +30 -0
  40. package/dist/comments/react/components/QueueSection.js +57 -0
  41. package/dist/comments/react/components/SettingsSection.d.ts +14 -0
  42. package/dist/comments/react/components/SettingsSection.js +23 -0
  43. package/dist/comments/react/hooks/CommentsPage.hooks.d.ts +9 -0
  44. package/dist/comments/react/hooks/CommentsPage.hooks.js +10 -0
  45. package/dist/comments/react/hooks/CommentsPorts.hooks.d.ts +13 -0
  46. package/dist/comments/react/hooks/CommentsPorts.hooks.js +15 -0
  47. package/dist/comments/react/hooks/QueueSection.hooks.d.ts +62 -0
  48. package/dist/comments/react/hooks/QueueSection.hooks.js +57 -0
  49. package/dist/comments/react/hooks/SettingsSection.hooks.d.ts +12 -0
  50. package/dist/comments/react/hooks/SettingsSection.hooks.js +21 -0
  51. package/dist/comments/react/hooks/use-comment-queue.hooks.d.ts +34 -0
  52. package/dist/comments/react/hooks/use-comment-queue.hooks.js +47 -0
  53. package/dist/comments/react/hooks/use-comment-settings.hooks.d.ts +22 -0
  54. package/dist/comments/react/hooks/use-comment-settings.hooks.js +30 -0
  55. package/dist/comments/react/hooks/use-comments.hooks.d.ts +15 -0
  56. package/dist/comments/react/hooks/use-comments.hooks.js +20 -0
  57. package/dist/comments/react/index.d.ts +316 -0
  58. package/dist/comments/react/index.js +35 -0
  59. package/dist/comments/react/pages/CommentsPage.d.ts +12 -0
  60. package/dist/comments/react/pages/CommentsPage.js +15 -0
  61. package/dist/comments/rules.d.ts +140 -0
  62. package/dist/comments/rules.js +199 -0
  63. package/dist/core/index.d.ts +3 -1
  64. package/dist/core/index.js +1 -0
  65. package/dist/core/ledger-slice.d.ts +90 -0
  66. package/dist/core/ledger-slice.js +81 -0
  67. package/dist/core/ports/comments.d.ts +2 -0
  68. package/dist/core/ports/forms.d.ts +19 -7
  69. package/dist/core/ports/forms.js +4 -4
  70. package/dist/core/ports/index.d.ts +1 -1
  71. package/dist/core/ports/seo.d.ts +33 -6
  72. package/dist/core/react/bind-react.d.ts +46 -0
  73. package/dist/core/react/bind-react.js +28 -0
  74. package/dist/core/react/index.d.ts +3 -0
  75. package/dist/core/react/index.js +3 -0
  76. package/dist/core/react/use-controller.d.ts +16 -0
  77. package/dist/core/react/use-controller.js +18 -0
  78. package/dist/forms/adapters/http.d.ts +26 -0
  79. package/dist/forms/adapters/http.js +43 -0
  80. package/dist/forms/adapters/memory.d.ts +14 -0
  81. package/dist/forms/adapters/memory.js +77 -0
  82. package/dist/forms/conformance/forms-api.conformance.d.ts +17 -0
  83. package/dist/forms/conformance/forms-api.conformance.js +71 -0
  84. package/dist/forms/controllers/draft-store.d.ts +18 -0
  85. package/dist/forms/controllers/draft-store.js +17 -0
  86. package/dist/forms/controllers/field-attributes-dialog.controller.d.ts +37 -0
  87. package/dist/forms/controllers/field-attributes-dialog.controller.js +27 -0
  88. package/dist/forms/controllers/form-editor.controller.d.ts +36 -0
  89. package/dist/forms/controllers/form-editor.controller.js +22 -0
  90. package/dist/forms/controllers/form-fields-editor.controller.d.ts +20 -0
  91. package/dist/forms/controllers/form-fields-editor.controller.js +10 -0
  92. package/dist/forms/controllers/form-submission-detail.controller.d.ts +20 -0
  93. package/dist/forms/controllers/form-submission-detail.controller.js +10 -0
  94. package/dist/forms/controllers/form-submissions.controller.d.ts +25 -0
  95. package/dist/forms/controllers/form-submissions.controller.js +10 -0
  96. package/dist/forms/controllers/forms-list.controller.d.ts +22 -0
  97. package/dist/forms/controllers/forms-list.controller.js +10 -0
  98. package/dist/forms/forms.module.d.ts +137 -0
  99. package/dist/forms/forms.module.js +17 -0
  100. package/dist/forms/html-rules.d.ts +20 -0
  101. package/dist/forms/html-rules.js +24 -0
  102. package/dist/forms/index.d.ts +14 -0
  103. package/dist/forms/index.js +12 -0
  104. package/dist/forms/messages.en.d.ts +100 -0
  105. package/dist/forms/messages.en.js +104 -0
  106. package/dist/forms/models.d.ts +29 -0
  107. package/dist/forms/models.js +8 -0
  108. package/dist/forms/ports.d.ts +26 -0
  109. package/dist/forms/ports.js +6 -0
  110. package/dist/forms/react/components/FieldAttributesDialog.d.ts +14 -0
  111. package/dist/forms/react/components/FieldAttributesDialog.js +47 -0
  112. package/dist/forms/react/components/FormEditorFieldsBody.d.ts +28 -0
  113. package/dist/forms/react/components/FormEditorFieldsBody.js +24 -0
  114. package/dist/forms/react/components/FormEditorHeaderText.d.ts +7 -0
  115. package/dist/forms/react/components/FormEditorHeaderText.js +8 -0
  116. package/dist/forms/react/components/FormEditorMainPanel.d.ts +12 -0
  117. package/dist/forms/react/components/FormEditorMainPanel.js +13 -0
  118. package/dist/forms/react/components/FormEditorTabStrip.d.ts +13 -0
  119. package/dist/forms/react/components/FormEditorTabStrip.js +14 -0
  120. package/dist/forms/react/components/FormFieldsEditor.d.ts +13 -0
  121. package/dist/forms/react/components/FormFieldsEditor.js +39 -0
  122. package/dist/forms/react/components/FormSubmissionDate.d.ts +8 -0
  123. package/dist/forms/react/components/FormSubmissionDate.js +5 -0
  124. package/dist/forms/react/components/FormSubmissionDetail.d.ts +13 -0
  125. package/dist/forms/react/components/FormSubmissionDetail.js +29 -0
  126. package/dist/forms/react/components/FormSubmissions.d.ts +12 -0
  127. package/dist/forms/react/components/FormSubmissions.js +46 -0
  128. package/dist/forms/react/hooks/FormsPorts.hooks.d.ts +41 -0
  129. package/dist/forms/react/hooks/FormsPorts.hooks.js +16 -0
  130. package/dist/forms/react/hooks/forms-view.hooks.d.ts +122 -0
  131. package/dist/forms/react/hooks/forms-view.hooks.js +79 -0
  132. package/dist/forms/react/hooks/use-field-attributes-dialog.hooks.d.ts +31 -0
  133. package/dist/forms/react/hooks/use-field-attributes-dialog.hooks.js +22 -0
  134. package/dist/forms/react/hooks/use-form-editor.hooks.d.ts +118 -0
  135. package/dist/forms/react/hooks/use-form-editor.hooks.js +208 -0
  136. package/dist/forms/react/hooks/use-form-fields-editor.hooks.d.ts +34 -0
  137. package/dist/forms/react/hooks/use-form-fields-editor.hooks.js +36 -0
  138. package/dist/forms/react/hooks/use-form-submission-date.hooks.d.ts +12 -0
  139. package/dist/forms/react/hooks/use-form-submission-date.hooks.js +9 -0
  140. package/dist/forms/react/hooks/use-form-submission-detail.hooks.d.ts +68 -0
  141. package/dist/forms/react/hooks/use-form-submission-detail.hooks.js +81 -0
  142. package/dist/forms/react/hooks/use-form-submissions.hooks.d.ts +67 -0
  143. package/dist/forms/react/hooks/use-form-submissions.hooks.js +110 -0
  144. package/dist/forms/react/hooks/use-forms-list.hooks.d.ts +78 -0
  145. package/dist/forms/react/hooks/use-forms-list.hooks.js +103 -0
  146. package/dist/forms/react/index.d.ts +449 -0
  147. package/dist/forms/react/index.js +35 -0
  148. package/dist/forms/react/pages/FormEditor.d.ts +19 -0
  149. package/dist/forms/react/pages/FormEditor.js +40 -0
  150. package/dist/forms/react/pages/FormsList.d.ts +39 -0
  151. package/dist/forms/react/pages/FormsList.js +55 -0
  152. package/dist/forms/rules.d.ts +291 -0
  153. package/dist/forms/rules.js +338 -0
  154. package/dist/media/react/hooks/EditMediaPanel.hooks.js +1 -1
  155. package/dist/media/react/hooks/LibraryTab.hooks.d.ts +1 -3
  156. package/dist/media/react/hooks/LibraryTab.hooks.js +8 -17
  157. package/dist/media/react/hooks/MediaCard.hooks.js +6 -20
  158. package/dist/media/react/hooks/MediaGrid.hooks.d.ts +2 -2
  159. package/dist/media/react/hooks/MediaPage.hooks.d.ts +1 -1
  160. package/dist/media/react/hooks/MediaPage.hooks.js +1 -1
  161. package/dist/media/react/hooks/MediaPicker.hooks.js +1 -1
  162. package/dist/media/react/hooks/ProvidersTab.hooks.js +5 -1
  163. package/dist/media/react/hooks/UploadButton.hooks.d.ts +9 -2
  164. package/dist/media/react/hooks/UploadButton.hooks.js +12 -10
  165. package/dist/media/react/index.js +1 -1
  166. package/dist/media/react/tabs/LibraryTab.d.ts +1 -1
  167. package/dist/media/react/tabs/ProvidersTab.d.ts +1 -1
  168. package/dist/playground/react/components/Canvas.d.ts +1 -1
  169. package/dist/playground/react/hooks/Canvas.hooks.d.ts +1 -1
  170. package/dist/playground/react/hooks/Canvas.hooks.js +1 -1
  171. package/dist/playground/react/hooks/PlaygroundPage.hooks.d.ts +1 -1
  172. package/dist/playground/react/index.js +1 -1
  173. package/dist/playground/react/pages/PlaygroundPage.d.ts +1 -1
  174. package/dist/playground/react/tabs/CanvasTab.d.ts +1 -1
  175. package/dist/react/bind-react.d.ts +1 -45
  176. package/dist/react/bind-react.js +2 -27
  177. package/dist/react/components/ConfirmDialog/ConfirmDialog.d.ts +22 -5
  178. package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.d.ts +2 -2
  179. package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.js +17 -55
  180. package/dist/react/components/ConfirmDialog/ConfirmDialog.js +33 -70
  181. package/dist/react/components/RowMenu/RowMenu.hooks.d.ts +23 -16
  182. package/dist/react/components/RowMenu/RowMenu.hooks.js +74 -54
  183. package/dist/react/entities/EntityField.d.ts +1 -1
  184. package/dist/react/entities/EntityField.js +4 -2
  185. package/dist/react/entities/types.d.ts +9 -0
  186. package/dist/react/entities/types.js +9 -0
  187. package/dist/react/use-controller.d.ts +1 -15
  188. package/dist/react/use-controller.js +2 -17
  189. package/dist/redirects/adapters/http.d.ts +20 -0
  190. package/dist/redirects/adapters/http.js +31 -0
  191. package/dist/redirects/adapters/memory.d.ts +13 -0
  192. package/dist/redirects/adapters/memory.js +83 -0
  193. package/dist/redirects/conformance/redirects-api.conformance.d.ts +12 -0
  194. package/dist/redirects/conformance/redirects-api.conformance.js +66 -0
  195. package/dist/redirects/controllers/hit-count.controller.d.ts +14 -0
  196. package/dist/redirects/controllers/hit-count.controller.js +10 -0
  197. package/dist/redirects/controllers/import-redirects.controller.d.ts +28 -0
  198. package/dist/redirects/controllers/import-redirects.controller.js +29 -0
  199. package/dist/redirects/controllers/redirects.controller.d.ts +37 -0
  200. package/dist/redirects/controllers/redirects.controller.js +38 -0
  201. package/dist/redirects/index.d.ts +11 -0
  202. package/dist/redirects/index.js +10 -0
  203. package/dist/redirects/messages.en.d.ts +56 -0
  204. package/dist/redirects/messages.en.js +55 -0
  205. package/dist/redirects/models.d.ts +14 -0
  206. package/dist/redirects/models.js +2 -0
  207. package/dist/redirects/ports.d.ts +9 -0
  208. package/dist/redirects/ports.js +4 -0
  209. package/dist/redirects/react/components/HitCountCell.d.ts +19 -0
  210. package/dist/redirects/react/components/HitCountCell.js +19 -0
  211. package/dist/redirects/react/components/ImportRedirectsForm.d.ts +17 -0
  212. package/dist/redirects/react/components/ImportRedirectsForm.js +12 -0
  213. package/dist/redirects/react/hooks/RedirectsOptions.hooks.d.ts +27 -0
  214. package/dist/redirects/react/hooks/RedirectsOptions.hooks.js +15 -0
  215. package/dist/redirects/react/hooks/RedirectsPage.hooks.d.ts +50 -0
  216. package/dist/redirects/react/hooks/RedirectsPage.hooks.js +30 -0
  217. package/dist/redirects/react/hooks/RedirectsPorts.hooks.d.ts +10 -0
  218. package/dist/redirects/react/hooks/RedirectsPorts.hooks.js +11 -0
  219. package/dist/redirects/react/hooks/use-hit-count-cell.hooks.d.ts +19 -0
  220. package/dist/redirects/react/hooks/use-hit-count-cell.hooks.js +15 -0
  221. package/dist/redirects/react/hooks/use-import-redirects-form.hooks.d.ts +21 -0
  222. package/dist/redirects/react/hooks/use-import-redirects-form.hooks.js +25 -0
  223. package/dist/redirects/react/hooks/use-redirects.hooks.d.ts +34 -0
  224. package/dist/redirects/react/hooks/use-redirects.hooks.js +63 -0
  225. package/dist/redirects/react/hooks/wired.hooks.d.ts +55 -0
  226. package/dist/redirects/react/hooks/wired.hooks.js +31 -0
  227. package/dist/redirects/react/index.d.ts +316 -0
  228. package/dist/redirects/react/index.js +28 -0
  229. package/dist/redirects/react/pages/RedirectsPage.d.ts +15 -0
  230. package/dist/redirects/react/pages/RedirectsPage.js +20 -0
  231. package/dist/redirects/redirects.module.d.ts +75 -0
  232. package/dist/redirects/redirects.module.js +13 -0
  233. package/dist/redirects/rules.d.ts +131 -0
  234. package/dist/redirects/rules.js +134 -0
  235. package/dist/security/react/hooks/AccessTokensTab.hooks.d.ts +1 -1
  236. package/dist/security/react/hooks/AccessTokensTab.hooks.js +3 -3
  237. package/dist/security/react/hooks/RootKeyTab.hooks.d.ts +1 -1
  238. package/dist/security/react/hooks/RootKeyTab.hooks.js +3 -4
  239. package/dist/security/react/hooks/SecurityPage.hooks.d.ts +1 -1
  240. package/dist/security/react/hooks/SecurityPorts.hooks.d.ts +4 -0
  241. package/dist/security/react/hooks/SecurityPorts.hooks.js +5 -0
  242. package/dist/security/react/index.js +1 -1
  243. package/dist/security/react/pages/SecurityPage.d.ts +1 -1
  244. package/dist/security/react/tabs/AccessTokensTab.d.ts +1 -1
  245. package/dist/security/react/tabs/RootKeyTab.d.ts +1 -1
  246. package/dist/seo/adapters/http.d.ts +31 -0
  247. package/dist/seo/adapters/http.js +37 -0
  248. package/dist/seo/adapters/memory.d.ts +28 -0
  249. package/dist/seo/adapters/memory.js +129 -0
  250. package/dist/seo/conformance/seo-api.conformance.d.ts +8 -0
  251. package/dist/seo/conformance/seo-api.conformance.js +44 -0
  252. package/dist/seo/controllers/entry-picker.controller.d.ts +21 -0
  253. package/dist/seo/controllers/entry-picker.controller.js +17 -0
  254. package/dist/seo/controllers/entry-section.controller.d.ts +20 -0
  255. package/dist/seo/controllers/entry-section.controller.js +7 -0
  256. package/dist/seo/controllers/media-ref.controller.d.ts +26 -0
  257. package/dist/seo/controllers/media-ref.controller.js +14 -0
  258. package/dist/seo/controllers/seo-entry.controller.d.ts +31 -0
  259. package/dist/seo/controllers/seo-entry.controller.js +52 -0
  260. package/dist/seo/controllers/seo.controller.d.ts +29 -0
  261. package/dist/seo/controllers/seo.controller.js +50 -0
  262. package/dist/seo/controllers/sitemap.controller.d.ts +25 -0
  263. package/dist/seo/controllers/sitemap.controller.js +27 -0
  264. package/dist/seo/index.d.ts +14 -0
  265. package/dist/seo/index.js +12 -0
  266. package/dist/seo/messages.en.d.ts +78 -0
  267. package/dist/seo/messages.en.js +78 -0
  268. package/dist/seo/models.d.ts +179 -0
  269. package/dist/seo/models.js +8 -0
  270. package/dist/seo/ports.d.ts +11 -0
  271. package/dist/seo/ports.js +4 -0
  272. package/dist/seo/react/components/MediaPickerBridge.d.ts +4 -0
  273. package/dist/seo/react/components/MediaPickerBridge.js +8 -0
  274. package/dist/seo/react/components/MediaRefField.d.ts +36 -0
  275. package/dist/seo/react/components/MediaRefField.js +12 -0
  276. package/dist/seo/react/components/SeoIcons.d.ts +13 -0
  277. package/dist/seo/react/components/SeoIcons.js +32 -0
  278. package/dist/seo/react/components/SitemapModal.d.ts +48 -0
  279. package/dist/seo/react/components/SitemapModal.js +70 -0
  280. package/dist/seo/react/hooks/MediaPickerBridge.hooks.d.ts +6 -0
  281. package/dist/seo/react/hooks/MediaPickerBridge.hooks.js +27 -0
  282. package/dist/seo/react/hooks/MediaRefField.hooks.d.ts +22 -0
  283. package/dist/seo/react/hooks/MediaRefField.hooks.js +30 -0
  284. package/dist/seo/react/hooks/SeoModuleTabs.d.ts +14 -0
  285. package/dist/seo/react/hooks/SeoModuleTabs.js +18 -0
  286. package/dist/seo/react/hooks/SeoPage.hooks.d.ts +69 -0
  287. package/dist/seo/react/hooks/SeoPage.hooks.js +37 -0
  288. package/dist/seo/react/hooks/SeoPorts.hooks.d.ts +19 -0
  289. package/dist/seo/react/hooks/SeoPorts.hooks.js +22 -0
  290. package/dist/seo/react/hooks/SitemapModal.hooks.d.ts +26 -0
  291. package/dist/seo/react/hooks/SitemapModal.hooks.js +20 -0
  292. package/dist/seo/react/hooks/use-entry-picker.hooks.d.ts +11 -0
  293. package/dist/seo/react/hooks/use-entry-picker.hooks.js +20 -0
  294. package/dist/seo/react/hooks/use-seo-entry-panel.hooks.d.ts +14 -0
  295. package/dist/seo/react/hooks/use-seo-entry-panel.hooks.js +26 -0
  296. package/dist/seo/react/hooks/use-seo-entry-section.hooks.d.ts +4 -0
  297. package/dist/seo/react/hooks/use-seo-entry-section.hooks.js +7 -0
  298. package/dist/seo/react/hooks/use-seo.hooks.d.ts +11 -0
  299. package/dist/seo/react/hooks/use-seo.hooks.js +29 -0
  300. package/dist/seo/react/hooks/use-sitemap-modal.hooks.d.ts +10 -0
  301. package/dist/seo/react/hooks/use-sitemap-modal.hooks.js +18 -0
  302. package/dist/seo/react/index.d.ts +366 -0
  303. package/dist/seo/react/index.js +30 -0
  304. package/dist/seo/react/options.d.ts +19 -0
  305. package/dist/seo/react/options.js +2 -0
  306. package/dist/seo/react/pages/SeoPage.d.ts +161 -0
  307. package/dist/seo/react/pages/SeoPage.js +215 -0
  308. package/dist/seo/rules.d.ts +136 -0
  309. package/dist/seo/rules.js +212 -0
  310. package/dist/seo/seo.module.d.ts +114 -0
  311. package/dist/seo/seo.module.js +14 -0
  312. package/dist/source-control/react/hooks/ProvidersTab.hooks.d.ts +1 -1
  313. package/dist/source-control/react/hooks/ProvidersTab.hooks.js +4 -4
  314. package/dist/source-control/react/hooks/SourceControlPage.hooks.d.ts +1 -1
  315. package/dist/source-control/react/index.js +1 -1
  316. package/dist/source-control/react/pages/SourceControlPage.d.ts +1 -1
  317. package/dist/source-control/react/tabs/ProvidersTab.d.ts +1 -1
  318. package/dist/widgets/adapters/http.d.ts +19 -0
  319. package/dist/widgets/adapters/http.js +33 -0
  320. package/dist/widgets/adapters/memory.d.ts +22 -0
  321. package/dist/widgets/adapters/memory.js +93 -0
  322. package/dist/widgets/conformance/widgets-api.conformance.d.ts +6 -0
  323. package/dist/widgets/conformance/widgets-api.conformance.js +55 -0
  324. package/dist/widgets/controllers/instance-editor.controller.d.ts +49 -0
  325. package/dist/widgets/controllers/instance-editor.controller.js +87 -0
  326. package/dist/widgets/controllers/library.controller.d.ts +33 -0
  327. package/dist/widgets/controllers/library.controller.js +53 -0
  328. package/dist/widgets/controllers/region-editor.controller.d.ts +42 -0
  329. package/dist/widgets/controllers/region-editor.controller.js +69 -0
  330. package/dist/widgets/controllers/regions.controller.d.ts +27 -0
  331. package/dist/widgets/controllers/regions.controller.js +44 -0
  332. package/dist/widgets/index.d.ts +11 -0
  333. package/dist/widgets/index.js +9 -0
  334. package/dist/widgets/messages.en.d.ts +78 -0
  335. package/dist/widgets/messages.en.js +83 -0
  336. package/dist/widgets/models.d.ts +62 -0
  337. package/dist/widgets/models.js +2 -0
  338. package/dist/widgets/ports.d.ts +79 -0
  339. package/dist/widgets/ports.js +5 -0
  340. package/dist/widgets/react/components/WidgetInstanceNotices.d.ts +14 -0
  341. package/dist/widgets/react/components/WidgetInstanceNotices.js +25 -0
  342. package/dist/widgets/react/components/WidgetRegionEditorHeaderActions.d.ts +22 -0
  343. package/dist/widgets/react/components/WidgetRegionEditorHeaderActions.js +18 -0
  344. package/dist/widgets/react/components/WidgetsLibraryNotices.d.ts +13 -0
  345. package/dist/widgets/react/components/WidgetsLibraryNotices.js +10 -0
  346. package/dist/widgets/react/hooks/WidgetsPorts.hooks.d.ts +270 -0
  347. package/dist/widgets/react/hooks/WidgetsPorts.hooks.js +17 -0
  348. package/dist/widgets/react/hooks/navigation.hooks.d.ts +9 -0
  349. package/dist/widgets/react/hooks/navigation.hooks.js +6 -0
  350. package/dist/widgets/react/hooks/page-views.hooks.d.ts +87 -0
  351. package/dist/widgets/react/hooks/page-views.hooks.js +30 -0
  352. package/dist/widgets/react/hooks/use-widget-instance-editor.hooks.d.ts +56 -0
  353. package/dist/widgets/react/hooks/use-widget-instance-editor.hooks.js +38 -0
  354. package/dist/widgets/react/hooks/use-widget-region-editor.hooks.d.ts +32 -0
  355. package/dist/widgets/react/hooks/use-widget-region-editor.hooks.js +22 -0
  356. package/dist/widgets/react/hooks/use-widget-regions.hooks.d.ts +23 -0
  357. package/dist/widgets/react/hooks/use-widget-regions.hooks.js +22 -0
  358. package/dist/widgets/react/hooks/use-widgets-library.hooks.d.ts +37 -0
  359. package/dist/widgets/react/hooks/use-widgets-library.hooks.js +23 -0
  360. package/dist/widgets/react/index.d.ts +391 -0
  361. package/dist/widgets/react/index.js +31 -0
  362. package/dist/widgets/react/pages/WidgetInstanceEditor.d.ts +23 -0
  363. package/dist/widgets/react/pages/WidgetInstanceEditor.js +37 -0
  364. package/dist/widgets/react/pages/WidgetRegionEditor.d.ts +22 -0
  365. package/dist/widgets/react/pages/WidgetRegionEditor.js +25 -0
  366. package/dist/widgets/react/pages/WidgetRegions.d.ts +21 -0
  367. package/dist/widgets/react/pages/WidgetRegions.js +31 -0
  368. package/dist/widgets/react/pages/WidgetsLibrary.d.ts +24 -0
  369. package/dist/widgets/react/pages/WidgetsLibrary.js +61 -0
  370. package/dist/widgets/rules.d.ts +94 -0
  371. package/dist/widgets/rules.js +83 -0
  372. package/dist/widgets/widgets.module.d.ts +122 -0
  373. package/dist/widgets/widgets.module.js +21 -0
  374. package/package.json +206 -9
@@ -1,4 +1,4 @@
1
- import type { TabViewProps } from '../../../react/bind-react.js';
1
+ import type { TabViewProps } from '../../../core/react/bind-react.js';
2
2
  export declare function useCanvas({ permissions }: TabViewProps, _optional?: {}): {
3
3
  denied: boolean;
4
4
  registerCanvas: (node: HTMLDivElement | null) => void | undefined;
@@ -1,5 +1,5 @@
1
1
  import { useCallback } from 'react';
2
- import { useController } from '../../../react/use-controller.js';
2
+ import { useController } from '../../../core/react/use-controller.js';
3
3
  import { createPlaygroundController } from '../../controllers/playground.controller.js';
4
4
  import { canMountPlayground } from '../../rules.js';
5
5
  import { usePlaygroundPorts } from './PlaygroundPorts.hooks.js';
@@ -1,4 +1,4 @@
1
- import type { ModulePageProps } from '../../../react/bind-react.js';
1
+ import type { ModulePageProps } from '../../../core/react/bind-react.js';
2
2
  export declare function usePlaygroundPage(props: ModulePageProps, _optional?: {}): {
3
3
  denied: boolean;
4
4
  ActiveTab: import("react").LazyExoticComponent<import("react").ComponentType<import("../../../react/bind-react.js").TabViewProps>> | undefined;
@@ -1,4 +1,4 @@
1
- import { bindReact } from '../../react/bind-react.js';
1
+ import { bindReact } from '../../core/react/bind-react.js';
2
2
  import { playgroundModule } from '../playground.module.js';
3
3
  import { PlaygroundPortsContext } from './hooks/PlaygroundPorts.hooks.js';
4
4
  export { usePlaygroundPorts } from './hooks/PlaygroundPorts.hooks.js';
@@ -1,4 +1,4 @@
1
- import type { ModulePageProps } from '../../../react/bind-react.js';
1
+ import type { ModulePageProps } from '../../../core/react/bind-react.js';
2
2
  export declare function PlaygroundPage(props: ModulePageProps, _optional?: {}): import("react").JSX.Element;
3
3
  export default PlaygroundPage;
4
4
  //# sourceMappingURL=PlaygroundPage.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { TabViewProps } from '../../../react/bind-react.js';
1
+ import type { TabViewProps } from '../../../core/react/bind-react.js';
2
2
  export declare function CanvasTab(props: TabViewProps, _optional?: {}): import("react").JSX.Element;
3
3
  export default CanvasTab;
4
4
  //# sourceMappingURL=CanvasTab.d.ts.map
@@ -1,46 +1,2 @@
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 {};
1
+ export * from '../core/react/bind-react.js';
46
2
  //# sourceMappingURL=bind-react.d.ts.map
@@ -1,28 +1,3 @@
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
- }
1
+ // Compatibility path; the shared implementation lives in core.
2
+ export * from '../core/react/bind-react.js';
28
3
  //# sourceMappingURL=bind-react.js.map
@@ -1,4 +1,4 @@
1
- import { type ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
2
  import { type ConfirmTone } from '../../types.js';
3
3
  import { type UseConfirmDialog } from './ConfirmDialog.hooks.js';
4
4
  /**
@@ -10,8 +10,8 @@ import { type UseConfirmDialog } from './ConfirmDialog.hooks.js';
10
10
  * overlay + backdrop idiom: that shape hand-rolls focus trapping, Escape handling, and a backdrop
11
11
  * element, all of which the browser's own top layer gives a real `<dialog>` for free, including
12
12
  * correct stacking above everything else on the page without a chosen `z-index`. The `showModal`/
13
- * `close` calls themselves, and the jsdom fallback they need, live in `ConfirmDialog.hooks.tsx` —
14
- * see that file's doc comment.
13
+ * `close` calls themselves, and the jsdom fallback they need, are delegated by
14
+ * `ConfirmDialog.hooks.tsx` to UI-kit's native hook — see that adapter's doc comment.
15
15
  *
16
16
  * Unstyled, like everything in this layer: the `.confirm-dialog` / `.btn-secondary` /
17
17
  * `.btn-danger` / `.btn-warning` class names are emitted for the host stylesheet to define.
@@ -51,7 +51,7 @@ import { type UseConfirmDialog } from './ConfirmDialog.hooks.js';
51
51
  * Labels state both the action and its consequence tier, derived from this component's own
52
52
  * three-tier `ConfirmTone` vocabulary rather than reparsed from `title`/`body`: `body` is arbitrary
53
53
  * `ReactNode` (a caller can pass JSX), not guaranteed to be a string at all, so it cannot be safely
54
- * folded into agent-facing text — see {@link confirmDialogConsequencePhrase}.
54
+ * folded into agent-facing text — the shared UI-kit confirmation planner owns those phrases.
55
55
  */
56
56
  export interface ConfirmDialogProps {
57
57
  open: boolean;
@@ -90,6 +90,23 @@ export interface ConfirmDialogProps {
90
90
  * effect without `agentHandle`. @default true */
91
91
  agentMayConfirm?: boolean;
92
92
  }
93
+ /**
94
+ * UI-kit's confirmation planner owns the sub-handle segments appended to the caller's base:
95
+ * literals chosen by the mechanism, never host data. Neither needs sanitizing, unlike
96
+ * `RowMenu`'s per-item keys (see this file's "Agent handles" contract).
97
+ *
98
+ * Its plain-language consequence phrase is keyed off the dialog's three-tier `ConfirmTone`
99
+ * vocabulary (`"default"` / `"warning"` / `"danger"`, documented in `../../types.js`), rather
100
+ * than reparsed from `title` or `body`, which cannot safely supply agent-facing consequence text.
101
+ * The confirm label names the action (`confirmLabel`), target (`title`) and declared consequence;
102
+ * the planner does not parse `body` to decide whether an action is safe.
103
+ *
104
+ * The cancel label's consequence is a guarantee of the contract (cancelling never calls
105
+ * `onConfirm`), rather than something read off `tone`, so it needs no tone input at all.
106
+ * Agent attributes retain the shape used by `RowMenu`'s local `rowMenuAgentProps`; injecting
107
+ * admin's attribute port into the shared owner preserves that shape and handle validation
108
+ * without keeping a second local implementation. No base handle means no agent attributes.
109
+ */
93
110
  /**
94
111
  * Controlled modal confirm — renders the `<dialog>` markup and delegates its open/close and focus
95
112
  * lifecycle to {@link useConfirmDialog} (injectable via the `useDialog` prop, defaulted to the real
@@ -99,5 +116,5 @@ export interface ConfirmDialogProps {
99
116
  * is no browser-assigned "default button" for Enter to reach for at all; confirm can only ever fire
100
117
  * from an explicit click or explicit Tab-then-Enter onto it.
101
118
  */
102
- export declare function ConfirmDialog({ useDialog, agentHandle: baseHandle, agentMayConfirm, ...props }: ConfirmDialogProps): import("react").JSX.Element;
119
+ export declare function ConfirmDialog({ useDialog, agentHandle: baseHandle, agentMayConfirm, ...props }: ConfirmDialogProps, _optional?: Record<string, never>): import("react").JSX.Element;
103
120
  //# sourceMappingURL=ConfirmDialog.d.ts.map
@@ -78,10 +78,10 @@ export declare function useConfirmDialogCancelLabel(_requiredArgs: Record<string
78
78
  readonly explicit?: string | undefined;
79
79
  }): string;
80
80
  /**
81
- * Owns the `<dialog>` element's open/close lifecycle and focus management for `ConfirmDialog`.
81
+ * Adapts UI-kit's `<dialog>` element open/close lifecycle and focus management for `ConfirmDialog`.
82
82
  *
83
83
  * The caller keeps `ConfirmDialog` mounted and toggles `open` — it is never conditionally rendered
84
- * by its parent — so the effect below has a stable `<dialog>` element to call `showModal()`/
84
+ * by its parent — so the shared native hook has a stable `<dialog>` element to call `showModal()`/
85
85
  * `close()` on and to restore focus through when it closes.
86
86
  *
87
87
  * Focus moves to the *cancel* action on open, not confirm — an operator whose first keystroke after
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { createContext, useContext, useEffect, useId, useMemo, useRef, } from 'react';
2
+ import { createContext, useContext, useMemo, useRef, } from 'react';
3
+ import { useNativeDialog } from '@jini-ai/ui-kit/react/native';
3
4
  /** Empty object, not `undefined` — {@link useConfirmDialogCancelLabel} can always read `cancelLabel`
4
5
  * off it without an extra null check, whether or not a provider is mounted. */
5
6
  const ConfirmDialogDefaultsContext = createContext({});
@@ -41,10 +42,10 @@ export function useConfirmDialogCancelLabel(_requiredArgs, { explicit } = {}) {
41
42
  return explicit ?? cancelLabel ?? DEFAULT_CANCEL_LABEL;
42
43
  }
43
44
  /**
44
- * Owns the `<dialog>` element's open/close lifecycle and focus management for `ConfirmDialog`.
45
+ * Adapts UI-kit's `<dialog>` element open/close lifecycle and focus management for `ConfirmDialog`.
45
46
  *
46
47
  * The caller keeps `ConfirmDialog` mounted and toggles `open` — it is never conditionally rendered
47
- * by its parent — so the effect below has a stable `<dialog>` element to call `showModal()`/
48
+ * by its parent — so the shared native hook has a stable `<dialog>` element to call `showModal()`/
48
49
  * `close()` on and to restore focus through when it closes.
49
50
  *
50
51
  * Focus moves to the *cancel* action on open, not confirm — an operator whose first keystroke after
@@ -60,63 +61,24 @@ export function useConfirmDialog({ open, onCancel, document }, { pending } = {})
60
61
  // in document order regardless of which dialog is actually open — a screen reader announcing
61
62
  // "Delete role?" while the operator is about to confirm "Delete policy?", on a destructive
62
63
  // action. `useId()` gives every mounted instance its own id for free.
63
- const titleId = useId();
64
- const dialogRef = useRef(null);
65
- const cancelRef = useRef(null);
66
64
  // Captured at the moment `open` flips true, before focus moves into the dialog — the element that
67
65
  // had focus then is, by construction, whatever triggered this dialog (a `RowMenu` item's
68
66
  // "Delete", a plain trigger button, …). Restored on close rather than left wherever the browser's
69
67
  // own modal-focus algorithm happened to land (its default without this is `<body>`, which drops a
70
68
  // keyboard user back to the top of the page).
71
- const triggerRef = useRef(null);
72
- useEffect(() => {
73
- const dialog = dialogRef.current;
74
- if (!dialog)
75
- return;
76
- if (open) {
77
- triggerRef.current = document.activeElement;
78
- if (typeof dialog.showModal === 'function') {
79
- if (!dialog.open)
80
- dialog.showModal();
81
- }
82
- else {
83
- dialog.setAttribute('open', '');
84
- }
85
- cancelRef.current?.focus();
86
- }
87
- else {
88
- if (typeof dialog.close === 'function') {
89
- if (dialog.open)
90
- dialog.close();
91
- }
92
- else {
93
- dialog.removeAttribute('open');
94
- }
95
- if (triggerRef.current instanceof HTMLElement)
96
- triggerRef.current.focus();
97
- }
98
- }, [open, document]);
99
- function handleNativeCancel(e) {
100
- // Fires on Escape while a real `showModal()`-opened dialog has focus. Always prevented: the
101
- // effect above is the single source of truth for open/closed (driven by `open`), so
102
- // letting the browser close the element on its own would desync DOM state from React state.
103
- // Escape still closes the dialog — it just does so by routing through `onCancel`, same as a
104
- // Cancel-button click, so the caller's `open` state (and therefore this same effect) is what
105
- // actually calls `dialog.close()`.
106
- e.preventDefault();
107
- if (pending)
108
- return;
109
- onCancel();
110
- }
111
- function handleBackdropClick(e) {
112
- // A `<dialog>` element's own box is sized to its content, not the viewport — a click that lands
113
- // on the `<dialog>` element itself (as opposed to one of its children) is therefore a click on
114
- // the backdrop area outside that content box.
115
- if (pending)
116
- return;
117
- if (e.target === dialogRef.current)
118
- onCancel();
119
- }
69
+ // Fires on Escape while a real `showModal()`-opened dialog has focus. Always prevented: the
70
+ // shared native hook is the single source of truth for open/closed (driven by `open`), so
71
+ // letting the browser close the element on its own would desync DOM state from React state.
72
+ // Escape still closes the dialog — it just does so by routing through `onCancel`, same as a
73
+ // Cancel-button click, so the caller's `open` state (and therefore this same effect) is what
74
+ // actually calls `dialog.close()`.
75
+ // A `<dialog>` element's own box is sized to its content, not the viewport — a click that lands
76
+ // on the `<dialog>` element itself (as opposed to one of its children) is therefore a click on
77
+ // the backdrop area outside that content box.
78
+ const cancelRef = useRef(null);
79
+ const vm = useNativeDialog({ open, title: '', onClose: () => onCancel(), ...(pending === undefined ? {} : { pending }) }, { document, initialFocus: () => cancelRef.current?.focus() });
80
+ const titleId = vm.titleId, dialogRef = vm.props.ref;
81
+ const handleNativeCancel = vm.props.onCancel, handleBackdropClick = vm.props.onClick;
120
82
  return { titleId, dialogRef, cancelRef, handleNativeCancel, handleBackdropClick };
121
83
  }
122
84
  //# sourceMappingURL=ConfirmDialog.hooks.js.map
@@ -1,72 +1,25 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import {} from 'react';
3
2
  import { agentHandle } from '@jini-ai/agentic';
3
+ import { useConfirmController } from '@jini-ai/ui-kit/react';
4
4
  import { resolveTone, toneClassName } from '../../types.js';
5
5
  import { useConfirmDialog, useConfirmDialogCancelLabel } from './ConfirmDialog.hooks.js';
6
- /** Sub-handle segments appended to the caller's base — literals this component chooses itself,
7
- * never host data (see this file's "Agent handles" doc comment for why that means neither needs
8
- * sanitizing, unlike `RowMenu`'s per-item keys). */
9
- const CONFIRM_HANDLE_ACTION = 'confirm';
10
- const CANCEL_HANDLE_ACTION = 'cancel';
11
6
  /**
12
- * Plain-language phrase for what confirming actually changes, keyed off the dialog's own
13
- * three-tier `ConfirmTone` vocabulary (`"default"` / `"warning"` / `"danger"`, documented in
14
- * `../../types.js`) rather than reparsed from `title` or `body` — see this file's doc comment for
15
- * why those cannot be safely folded into agent-facing text.
7
+ * UI-kit's confirmation planner owns the sub-handle segments appended to the caller's base:
8
+ * literals chosen by the mechanism, never host data. Neither needs sanitizing, unlike
9
+ * `RowMenu`'s per-item keys (see this file's "Agent handles" contract).
16
10
  *
17
- * @param tone - The dialog's resolved tone (see `resolveTone`).
18
- * @returns The tier's consequence phrase, or `undefined` for `"default"`, which declares no tier.
19
- * @complexity O(1).
20
- */
21
- function confirmDialogConsequencePhrase(tone) {
22
- if (tone === 'danger')
23
- return 'cannot be undone';
24
- if (tone === 'warning')
25
- return 'changes access, but is reversible';
26
- return undefined;
27
- }
28
- /**
29
- * The confirm action's agent-facing label: what it does (`confirmLabel`), what it applies to
30
- * (`title`), and — when the tone declares one — its consequence tier.
31
- *
32
- * @param confirmLabel - The button's own visible text, e.g. `"Delete"`.
33
- * @param title - The dialog's title, e.g. `"Delete role?"`.
34
- * @param tone - The dialog's resolved tone.
35
- * @returns A label an agent can use to judge whether confirming is safe, without having read
36
- * `body` (which this function never receives — see this file's doc comment for why).
37
- * @complexity O(1).
38
- */
39
- function confirmDialogConfirmLabel(confirmLabel, title, tone) {
40
- const consequence = confirmDialogConsequencePhrase(tone);
41
- return consequence === undefined ? `${confirmLabel} — ${title}` : `${confirmLabel} — ${title}; ${consequence}`;
42
- }
43
- /**
44
- * The cancel action's agent-facing label. Unlike {@link confirmDialogConfirmLabel}, its consequence
45
- * is a guarantee of this component's own contract (cancelling never calls `onConfirm`) rather than
46
- * something read off `tone`, so it needs no tone input at all.
47
- *
48
- * @param cancelLabel - The button's own visible text, already defaulted by the caller.
49
- * @param title - The dialog's title, e.g. `"Delete role?"`.
50
- * @returns A label stating that this action leaves the titled action unconfirmed.
51
- * @complexity O(1).
52
- */
53
- function confirmDialogCancelLabel(cancelLabel, title) {
54
- return `${cancelLabel} — leaves "${title}" unconfirmed; no action taken`;
55
- }
56
- /**
57
- * Builds the `data-agent-*` attribute props for one of this dialog's two actions, or nothing at
58
- * all when the dialog published no base handle — same shape as `RowMenu.tsx`'s local
59
- * `rowMenuAgentProps`, kept local and unexported here since only this one component needs it.
11
+ * Its plain-language consequence phrase is keyed off the dialog's three-tier `ConfirmTone`
12
+ * vocabulary (`"default"` / `"warning"` / `"danger"`, documented in `../../types.js`), rather
13
+ * than reparsed from `title` or `body`, which cannot safely supply agent-facing consequence text.
14
+ * The confirm label names the action (`confirmLabel`), target (`title`) and declared consequence;
15
+ * the planner does not parse `body` to decide whether an action is safe.
60
16
  *
61
- * @param base - The dialog's own handle from the caller, or `undefined` when it published none.
62
- * @param action - Which action this is — see {@link CONFIRM_HANDLE_ACTION}/{@link CANCEL_HANDLE_ACTION}.
63
- * @param options - Role and this action's already-composed label.
64
- * @returns Spreadable attribute props, or `{}` when `base` is `undefined`.
65
- * @complexity O(1).
17
+ * The cancel label's consequence is a guarantee of the contract (cancelling never calls
18
+ * `onConfirm`), rather than something read off `tone`, so it needs no tone input at all.
19
+ * Agent attributes retain the shape used by `RowMenu`'s local `rowMenuAgentProps`; injecting
20
+ * admin's attribute port into the shared owner preserves that shape and handle validation
21
+ * without keeping a second local implementation. No base handle means no agent attributes.
66
22
  */
67
- function confirmDialogAgentProps(base, action, options) {
68
- return base === undefined ? {} : agentHandle({ handle: `${base}-${action}` }, options);
69
- }
70
23
  /**
71
24
  * Controlled modal confirm — renders the `<dialog>` markup and delegates its open/close and focus
72
25
  * lifecycle to {@link useConfirmDialog} (injectable via the `useDialog` prop, defaulted to the real
@@ -76,16 +29,26 @@ function confirmDialogAgentProps(base, action, options) {
76
29
  * is no browser-assigned "default button" for Enter to reach for at all; confirm can only ever fire
77
30
  * from an explicit click or explicit Tab-then-Enter onto it.
78
31
  */
79
- export function ConfirmDialog({ useDialog = useConfirmDialog, agentHandle: baseHandle, agentMayConfirm = true, ...props }) {
80
- const { titleId, dialogRef, cancelRef, handleNativeCancel, handleBackdropClick } = useDialog({ open: props.open, onCancel: props.onCancel, document }, { pending: props.pending });
32
+ export function ConfirmDialog({ useDialog = useConfirmDialog, agentHandle: baseHandle, agentMayConfirm = true, ...props }, _optional = {}) {
81
33
  const tone = resolveTone({}, props);
82
34
  const cancelLabel = useConfirmDialogCancelLabel({}, { explicit: props.cancelLabel });
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
- role: 'button',
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, {
87
- role: 'button',
88
- label: confirmDialogConfirmLabel(props.confirmLabel, props.title, tone),
89
- }), children: props.confirmLabel })] })] }));
35
+ const controller = useConfirmController({
36
+ open: props.open, title: props.title, body: props.body, confirmLabel: props.confirmLabel,
37
+ cancelLabel, tone, agentMayConfirm,
38
+ ...(baseHandle === undefined ? {} : { agentHandle: baseHandle }),
39
+ ...(props.pending === undefined ? {} : { pending: props.pending }),
40
+ onConfirm: () => props.onConfirm(), onCancel: () => props.onCancel(),
41
+ }, {
42
+ // UI-kit names selects separately; agentic publishes them as fields and still owns handle validation.
43
+ agent: ((required, optional = {}) => agentHandle(required, {
44
+ ...(optional.role === undefined ? {} : { role: optional.role === 'select' ? 'field' : optional.role }),
45
+ ...(optional.label === undefined ? {} : { label: optional.label }),
46
+ })),
47
+ });
48
+ const { titleId, dialogRef, cancelRef, handleNativeCancel, handleBackdropClick } = useDialog({ open: props.open, onCancel: () => { controller.requestDismiss({ reason: 'close' }); }, document }, { pending: controller.pending });
49
+ // Keep admin's concise accessible names; the shared planner still supplies consequence-aware agent labels.
50
+ const { 'aria-label': _cancelName, ...cancelAttrs } = controller.cancel.attrs ?? {};
51
+ const { 'aria-label': _confirmName, ...confirmAttrs } = controller.confirm.attrs ?? {};
52
+ return (_jsxs("dialog", { ref: dialogRef, className: "confirm-dialog", "aria-labelledby": titleId, onCancel: handleNativeCancel, onClick: handleBackdropClick, children: [_jsx("h2", { id: titleId, children: props.title }), _jsxs("div", { className: "confirm-dialog-body", children: [props.body, controller.error] }), _jsxs("div", { className: "confirm-dialog-actions", children: [_jsx("button", { ref: cancelRef, type: "button", className: "btn-secondary", disabled: controller.pending, onClick: () => controller.cancel.onPress?.({}), ...cancelAttrs, children: cancelLabel }), _jsx("button", { type: "button", className: toneClassName({ tone }), disabled: controller.pending, onClick: () => controller.confirm.onPress?.({}), ...confirmAttrs, children: props.confirmLabel })] })] }));
90
53
  }
91
54
  //# sourceMappingURL=ConfirmDialog.js.map
@@ -1,4 +1,4 @@
1
- import { type KeyboardEvent } from 'react';
1
+ import { type KeyboardEvent, type RefObject } from 'react';
2
2
  /**
3
3
  * @file `RowMenu`'s open/close state, viewport-aware positioning, and keyboard/focus behavior,
4
4
  * split out of the component so it can be swapped for a fake via the `useRowMenu` prop on
@@ -9,6 +9,25 @@ interface Position {
9
9
  left: number;
10
10
  placement: 'below' | 'above';
11
11
  }
12
+ type RowMenuWindow = Pick<Window, 'innerHeight' | 'innerWidth' | 'addEventListener' | 'removeEventListener'>;
13
+ type RowMenuDocument = Pick<Document, 'addEventListener' | 'removeEventListener'>;
14
+ /** What `useRowMenu` hands `RowMenu` — and the shape an injected `useRowMenu` fake must return. */
15
+ export interface RowMenuState {
16
+ readonly open: boolean;
17
+ readonly position: Position | null;
18
+ readonly triggerRef: RefObject<HTMLButtonElement | null>;
19
+ /** A callback ref from the real hook (see {@link trackOpenMenu}; `null` while closed), or a host
20
+ * hook's ref object. Spelled out rather than React's `Ref`, whose callback form carries a brand
21
+ * that fails to match across two installed `@types/react` copies (Jini's vs a host app's). */
22
+ readonly menuRef: RefObject<HTMLDivElement | null> | ((menu: HTMLDivElement | null) => void) | null;
23
+ readonly itemRefs: RefObject<Array<HTMLButtonElement | null>>;
24
+ readonly onTriggerClick: () => void;
25
+ readonly onTriggerKeyDown: (event: KeyboardEvent<HTMLButtonElement>) => void;
26
+ readonly onMenuKeyDown: (event: KeyboardEvent<HTMLDivElement>) => void;
27
+ readonly selectItem: (item: {
28
+ readonly onSelect: () => void;
29
+ }) => void;
30
+ }
12
31
  /**
13
32
  * Owns `RowMenu`'s open/close state, positioning, and keyboard/focus behavior.
14
33
  *
@@ -17,20 +36,8 @@ interface Position {
17
36
  */
18
37
  export declare function useRowMenu({ itemCount, window, document }: {
19
38
  readonly itemCount: number;
20
- readonly window: Pick<Window, 'innerHeight' | 'innerWidth' | 'addEventListener' | 'removeEventListener'>;
21
- readonly document: Pick<Document, 'addEventListener' | 'removeEventListener'>;
22
- }): {
23
- open: boolean;
24
- position: Position | null;
25
- triggerRef: import("react").RefObject<HTMLButtonElement | null>;
26
- menuRef: import("react").RefObject<HTMLDivElement | null>;
27
- itemRefs: import("react").RefObject<(HTMLButtonElement | null)[]>;
28
- onTriggerClick: () => void;
29
- onTriggerKeyDown: (e: KeyboardEvent<HTMLButtonElement>) => void;
30
- onMenuKeyDown: (e: KeyboardEvent<HTMLDivElement>) => void;
31
- selectItem: ({ onSelect }: {
32
- readonly onSelect: () => void;
33
- }) => void;
34
- };
39
+ readonly window: RowMenuWindow;
40
+ readonly document: RowMenuDocument;
41
+ }): RowMenuState;
35
42
  export {};
36
43
  //# sourceMappingURL=RowMenu.hooks.d.ts.map