@jini-ai/admin 0.4.2 → 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 (360) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +7 -0
  3. package/dist/agent-plugins/react/components/AgentPluginListPanel.d.ts +1 -1
  4. package/dist/agent-plugins/react/hooks/AgentPluginInspector.hooks.js +1 -1
  5. package/dist/agent-plugins/react/hooks/AgentPluginPanel.hooks.d.ts +1 -1
  6. package/dist/agent-plugins/react/hooks/AgentPluginsPage.hooks.d.ts +1 -1
  7. package/dist/agent-plugins/react/hooks/AgentPluginsPage.hooks.js +1 -1
  8. package/dist/agent-plugins/react/hooks/MarketplaceTab.hooks.d.ts +1 -1
  9. package/dist/agent-plugins/react/index.js +1 -1
  10. package/dist/agent-plugins/react/pages/AgentPluginsPage.d.ts +1 -1
  11. package/dist/agent-plugins/react/tabs/DownloadedTab.d.ts +1 -1
  12. package/dist/agent-plugins/react/tabs/InstalledTab.d.ts +1 -1
  13. package/dist/agent-plugins/react/tabs/MarketplaceTab.d.ts +1 -1
  14. package/dist/comments/adapters/http.d.ts +29 -0
  15. package/dist/comments/adapters/http.js +50 -0
  16. package/dist/comments/adapters/memory.d.ts +17 -0
  17. package/dist/comments/adapters/memory.js +61 -0
  18. package/dist/comments/comments.module.d.ts +73 -0
  19. package/dist/comments/comments.module.js +16 -0
  20. package/dist/comments/conformance/comments-api.conformance.d.ts +9 -0
  21. package/dist/comments/conformance/comments-api.conformance.js +63 -0
  22. package/dist/comments/controllers/comment-queue.controller.d.ts +48 -0
  23. package/dist/comments/controllers/comment-queue.controller.js +164 -0
  24. package/dist/comments/controllers/comment-settings.controller.d.ts +32 -0
  25. package/dist/comments/controllers/comment-settings.controller.js +77 -0
  26. package/dist/comments/controllers/comments.controller.d.ts +16 -0
  27. package/dist/comments/controllers/comments.controller.js +16 -0
  28. package/dist/comments/index.d.ts +13 -0
  29. package/dist/comments/index.js +8 -0
  30. package/dist/comments/messages.en.d.ts +54 -0
  31. package/dist/comments/messages.en.js +56 -0
  32. package/dist/comments/models.d.ts +22 -0
  33. package/dist/comments/models.js +2 -0
  34. package/dist/comments/ports.d.ts +14 -0
  35. package/dist/comments/ports.js +5 -0
  36. package/dist/comments/react/components/QueueSection.d.ts +30 -0
  37. package/dist/comments/react/components/QueueSection.js +57 -0
  38. package/dist/comments/react/components/SettingsSection.d.ts +14 -0
  39. package/dist/comments/react/components/SettingsSection.js +23 -0
  40. package/dist/comments/react/hooks/CommentsPage.hooks.d.ts +9 -0
  41. package/dist/comments/react/hooks/CommentsPage.hooks.js +10 -0
  42. package/dist/comments/react/hooks/CommentsPorts.hooks.d.ts +13 -0
  43. package/dist/comments/react/hooks/CommentsPorts.hooks.js +15 -0
  44. package/dist/comments/react/hooks/QueueSection.hooks.d.ts +62 -0
  45. package/dist/comments/react/hooks/QueueSection.hooks.js +57 -0
  46. package/dist/comments/react/hooks/SettingsSection.hooks.d.ts +12 -0
  47. package/dist/comments/react/hooks/SettingsSection.hooks.js +21 -0
  48. package/dist/comments/react/hooks/use-comment-queue.hooks.d.ts +34 -0
  49. package/dist/comments/react/hooks/use-comment-queue.hooks.js +47 -0
  50. package/dist/comments/react/hooks/use-comment-settings.hooks.d.ts +22 -0
  51. package/dist/comments/react/hooks/use-comment-settings.hooks.js +30 -0
  52. package/dist/comments/react/hooks/use-comments.hooks.d.ts +15 -0
  53. package/dist/comments/react/hooks/use-comments.hooks.js +20 -0
  54. package/dist/comments/react/index.d.ts +316 -0
  55. package/dist/comments/react/index.js +35 -0
  56. package/dist/comments/react/pages/CommentsPage.d.ts +12 -0
  57. package/dist/comments/react/pages/CommentsPage.js +15 -0
  58. package/dist/comments/rules.d.ts +140 -0
  59. package/dist/comments/rules.js +199 -0
  60. package/dist/core/index.d.ts +3 -1
  61. package/dist/core/index.js +1 -0
  62. package/dist/core/ledger-slice.d.ts +90 -0
  63. package/dist/core/ledger-slice.js +81 -0
  64. package/dist/core/ports/comments.d.ts +2 -0
  65. package/dist/core/ports/forms.d.ts +19 -7
  66. package/dist/core/ports/forms.js +4 -4
  67. package/dist/core/ports/index.d.ts +1 -1
  68. package/dist/core/ports/seo.d.ts +33 -6
  69. package/dist/core/react/bind-react.d.ts +46 -0
  70. package/dist/core/react/bind-react.js +28 -0
  71. package/dist/core/react/index.d.ts +3 -0
  72. package/dist/core/react/index.js +3 -0
  73. package/dist/core/react/use-controller.d.ts +16 -0
  74. package/dist/core/react/use-controller.js +18 -0
  75. package/dist/forms/adapters/http.d.ts +26 -0
  76. package/dist/forms/adapters/http.js +43 -0
  77. package/dist/forms/adapters/memory.d.ts +14 -0
  78. package/dist/forms/adapters/memory.js +77 -0
  79. package/dist/forms/conformance/forms-api.conformance.d.ts +17 -0
  80. package/dist/forms/conformance/forms-api.conformance.js +71 -0
  81. package/dist/forms/controllers/draft-store.d.ts +18 -0
  82. package/dist/forms/controllers/draft-store.js +17 -0
  83. package/dist/forms/controllers/field-attributes-dialog.controller.d.ts +37 -0
  84. package/dist/forms/controllers/field-attributes-dialog.controller.js +27 -0
  85. package/dist/forms/controllers/form-editor.controller.d.ts +36 -0
  86. package/dist/forms/controllers/form-editor.controller.js +22 -0
  87. package/dist/forms/controllers/form-fields-editor.controller.d.ts +20 -0
  88. package/dist/forms/controllers/form-fields-editor.controller.js +10 -0
  89. package/dist/forms/controllers/form-submission-detail.controller.d.ts +20 -0
  90. package/dist/forms/controllers/form-submission-detail.controller.js +10 -0
  91. package/dist/forms/controllers/form-submissions.controller.d.ts +25 -0
  92. package/dist/forms/controllers/form-submissions.controller.js +10 -0
  93. package/dist/forms/controllers/forms-list.controller.d.ts +22 -0
  94. package/dist/forms/controllers/forms-list.controller.js +10 -0
  95. package/dist/forms/forms.module.d.ts +137 -0
  96. package/dist/forms/forms.module.js +17 -0
  97. package/dist/forms/html-rules.d.ts +20 -0
  98. package/dist/forms/html-rules.js +24 -0
  99. package/dist/forms/index.d.ts +14 -0
  100. package/dist/forms/index.js +12 -0
  101. package/dist/forms/messages.en.d.ts +100 -0
  102. package/dist/forms/messages.en.js +104 -0
  103. package/dist/forms/models.d.ts +29 -0
  104. package/dist/forms/models.js +8 -0
  105. package/dist/forms/ports.d.ts +26 -0
  106. package/dist/forms/ports.js +6 -0
  107. package/dist/forms/react/components/FieldAttributesDialog.d.ts +14 -0
  108. package/dist/forms/react/components/FieldAttributesDialog.js +47 -0
  109. package/dist/forms/react/components/FormEditorFieldsBody.d.ts +28 -0
  110. package/dist/forms/react/components/FormEditorFieldsBody.js +24 -0
  111. package/dist/forms/react/components/FormEditorHeaderText.d.ts +7 -0
  112. package/dist/forms/react/components/FormEditorHeaderText.js +8 -0
  113. package/dist/forms/react/components/FormEditorMainPanel.d.ts +12 -0
  114. package/dist/forms/react/components/FormEditorMainPanel.js +13 -0
  115. package/dist/forms/react/components/FormEditorTabStrip.d.ts +13 -0
  116. package/dist/forms/react/components/FormEditorTabStrip.js +14 -0
  117. package/dist/forms/react/components/FormFieldsEditor.d.ts +13 -0
  118. package/dist/forms/react/components/FormFieldsEditor.js +39 -0
  119. package/dist/forms/react/components/FormSubmissionDate.d.ts +8 -0
  120. package/dist/forms/react/components/FormSubmissionDate.js +5 -0
  121. package/dist/forms/react/components/FormSubmissionDetail.d.ts +13 -0
  122. package/dist/forms/react/components/FormSubmissionDetail.js +29 -0
  123. package/dist/forms/react/components/FormSubmissions.d.ts +12 -0
  124. package/dist/forms/react/components/FormSubmissions.js +46 -0
  125. package/dist/forms/react/hooks/FormsPorts.hooks.d.ts +41 -0
  126. package/dist/forms/react/hooks/FormsPorts.hooks.js +16 -0
  127. package/dist/forms/react/hooks/forms-view.hooks.d.ts +122 -0
  128. package/dist/forms/react/hooks/forms-view.hooks.js +79 -0
  129. package/dist/forms/react/hooks/use-field-attributes-dialog.hooks.d.ts +31 -0
  130. package/dist/forms/react/hooks/use-field-attributes-dialog.hooks.js +22 -0
  131. package/dist/forms/react/hooks/use-form-editor.hooks.d.ts +118 -0
  132. package/dist/forms/react/hooks/use-form-editor.hooks.js +208 -0
  133. package/dist/forms/react/hooks/use-form-fields-editor.hooks.d.ts +34 -0
  134. package/dist/forms/react/hooks/use-form-fields-editor.hooks.js +36 -0
  135. package/dist/forms/react/hooks/use-form-submission-date.hooks.d.ts +12 -0
  136. package/dist/forms/react/hooks/use-form-submission-date.hooks.js +9 -0
  137. package/dist/forms/react/hooks/use-form-submission-detail.hooks.d.ts +68 -0
  138. package/dist/forms/react/hooks/use-form-submission-detail.hooks.js +81 -0
  139. package/dist/forms/react/hooks/use-form-submissions.hooks.d.ts +67 -0
  140. package/dist/forms/react/hooks/use-form-submissions.hooks.js +110 -0
  141. package/dist/forms/react/hooks/use-forms-list.hooks.d.ts +78 -0
  142. package/dist/forms/react/hooks/use-forms-list.hooks.js +103 -0
  143. package/dist/forms/react/index.d.ts +449 -0
  144. package/dist/forms/react/index.js +35 -0
  145. package/dist/forms/react/pages/FormEditor.d.ts +19 -0
  146. package/dist/forms/react/pages/FormEditor.js +40 -0
  147. package/dist/forms/react/pages/FormsList.d.ts +39 -0
  148. package/dist/forms/react/pages/FormsList.js +55 -0
  149. package/dist/forms/rules.d.ts +291 -0
  150. package/dist/forms/rules.js +338 -0
  151. package/dist/media/react/hooks/EditMediaPanel.hooks.js +1 -1
  152. package/dist/media/react/hooks/LibraryTab.hooks.d.ts +1 -1
  153. package/dist/media/react/hooks/LibraryTab.hooks.js +1 -1
  154. package/dist/media/react/hooks/MediaCard.hooks.js +6 -20
  155. package/dist/media/react/hooks/MediaGrid.hooks.d.ts +2 -2
  156. package/dist/media/react/hooks/MediaPage.hooks.d.ts +1 -1
  157. package/dist/media/react/hooks/MediaPage.hooks.js +1 -1
  158. package/dist/media/react/hooks/MediaPicker.hooks.js +1 -1
  159. package/dist/media/react/index.js +1 -1
  160. package/dist/media/react/tabs/LibraryTab.d.ts +1 -1
  161. package/dist/media/react/tabs/ProvidersTab.d.ts +1 -1
  162. package/dist/playground/react/components/Canvas.d.ts +1 -1
  163. package/dist/playground/react/hooks/Canvas.hooks.d.ts +1 -1
  164. package/dist/playground/react/hooks/Canvas.hooks.js +1 -1
  165. package/dist/playground/react/hooks/PlaygroundPage.hooks.d.ts +1 -1
  166. package/dist/playground/react/index.js +1 -1
  167. package/dist/playground/react/pages/PlaygroundPage.d.ts +1 -1
  168. package/dist/playground/react/tabs/CanvasTab.d.ts +1 -1
  169. package/dist/react/bind-react.d.ts +1 -45
  170. package/dist/react/bind-react.js +2 -27
  171. package/dist/react/components/ConfirmDialog/ConfirmDialog.d.ts +22 -5
  172. package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.d.ts +2 -2
  173. package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.js +17 -55
  174. package/dist/react/components/ConfirmDialog/ConfirmDialog.js +33 -70
  175. package/dist/react/use-controller.d.ts +1 -15
  176. package/dist/react/use-controller.js +2 -17
  177. package/dist/redirects/adapters/http.d.ts +20 -0
  178. package/dist/redirects/adapters/http.js +31 -0
  179. package/dist/redirects/adapters/memory.d.ts +13 -0
  180. package/dist/redirects/adapters/memory.js +83 -0
  181. package/dist/redirects/conformance/redirects-api.conformance.d.ts +12 -0
  182. package/dist/redirects/conformance/redirects-api.conformance.js +66 -0
  183. package/dist/redirects/controllers/hit-count.controller.d.ts +14 -0
  184. package/dist/redirects/controllers/hit-count.controller.js +10 -0
  185. package/dist/redirects/controllers/import-redirects.controller.d.ts +28 -0
  186. package/dist/redirects/controllers/import-redirects.controller.js +29 -0
  187. package/dist/redirects/controllers/redirects.controller.d.ts +37 -0
  188. package/dist/redirects/controllers/redirects.controller.js +38 -0
  189. package/dist/redirects/index.d.ts +11 -0
  190. package/dist/redirects/index.js +10 -0
  191. package/dist/redirects/messages.en.d.ts +56 -0
  192. package/dist/redirects/messages.en.js +55 -0
  193. package/dist/redirects/models.d.ts +14 -0
  194. package/dist/redirects/models.js +2 -0
  195. package/dist/redirects/ports.d.ts +9 -0
  196. package/dist/redirects/ports.js +4 -0
  197. package/dist/redirects/react/components/HitCountCell.d.ts +19 -0
  198. package/dist/redirects/react/components/HitCountCell.js +19 -0
  199. package/dist/redirects/react/components/ImportRedirectsForm.d.ts +17 -0
  200. package/dist/redirects/react/components/ImportRedirectsForm.js +12 -0
  201. package/dist/redirects/react/hooks/RedirectsOptions.hooks.d.ts +27 -0
  202. package/dist/redirects/react/hooks/RedirectsOptions.hooks.js +15 -0
  203. package/dist/redirects/react/hooks/RedirectsPage.hooks.d.ts +50 -0
  204. package/dist/redirects/react/hooks/RedirectsPage.hooks.js +30 -0
  205. package/dist/redirects/react/hooks/RedirectsPorts.hooks.d.ts +10 -0
  206. package/dist/redirects/react/hooks/RedirectsPorts.hooks.js +11 -0
  207. package/dist/redirects/react/hooks/use-hit-count-cell.hooks.d.ts +19 -0
  208. package/dist/redirects/react/hooks/use-hit-count-cell.hooks.js +15 -0
  209. package/dist/redirects/react/hooks/use-import-redirects-form.hooks.d.ts +21 -0
  210. package/dist/redirects/react/hooks/use-import-redirects-form.hooks.js +25 -0
  211. package/dist/redirects/react/hooks/use-redirects.hooks.d.ts +34 -0
  212. package/dist/redirects/react/hooks/use-redirects.hooks.js +63 -0
  213. package/dist/redirects/react/hooks/wired.hooks.d.ts +55 -0
  214. package/dist/redirects/react/hooks/wired.hooks.js +31 -0
  215. package/dist/redirects/react/index.d.ts +316 -0
  216. package/dist/redirects/react/index.js +28 -0
  217. package/dist/redirects/react/pages/RedirectsPage.d.ts +15 -0
  218. package/dist/redirects/react/pages/RedirectsPage.js +20 -0
  219. package/dist/redirects/redirects.module.d.ts +75 -0
  220. package/dist/redirects/redirects.module.js +13 -0
  221. package/dist/redirects/rules.d.ts +131 -0
  222. package/dist/redirects/rules.js +134 -0
  223. package/dist/security/react/hooks/AccessTokensTab.hooks.d.ts +1 -1
  224. package/dist/security/react/hooks/AccessTokensTab.hooks.js +1 -1
  225. package/dist/security/react/hooks/RootKeyTab.hooks.d.ts +1 -1
  226. package/dist/security/react/hooks/RootKeyTab.hooks.js +1 -1
  227. package/dist/security/react/hooks/SecurityPage.hooks.d.ts +1 -1
  228. package/dist/security/react/index.js +1 -1
  229. package/dist/security/react/pages/SecurityPage.d.ts +1 -1
  230. package/dist/security/react/tabs/AccessTokensTab.d.ts +1 -1
  231. package/dist/security/react/tabs/RootKeyTab.d.ts +1 -1
  232. package/dist/seo/adapters/http.d.ts +31 -0
  233. package/dist/seo/adapters/http.js +37 -0
  234. package/dist/seo/adapters/memory.d.ts +28 -0
  235. package/dist/seo/adapters/memory.js +129 -0
  236. package/dist/seo/conformance/seo-api.conformance.d.ts +8 -0
  237. package/dist/seo/conformance/seo-api.conformance.js +44 -0
  238. package/dist/seo/controllers/entry-picker.controller.d.ts +21 -0
  239. package/dist/seo/controllers/entry-picker.controller.js +17 -0
  240. package/dist/seo/controllers/entry-section.controller.d.ts +20 -0
  241. package/dist/seo/controllers/entry-section.controller.js +7 -0
  242. package/dist/seo/controllers/media-ref.controller.d.ts +26 -0
  243. package/dist/seo/controllers/media-ref.controller.js +14 -0
  244. package/dist/seo/controllers/seo-entry.controller.d.ts +31 -0
  245. package/dist/seo/controllers/seo-entry.controller.js +52 -0
  246. package/dist/seo/controllers/seo.controller.d.ts +29 -0
  247. package/dist/seo/controllers/seo.controller.js +50 -0
  248. package/dist/seo/controllers/sitemap.controller.d.ts +25 -0
  249. package/dist/seo/controllers/sitemap.controller.js +27 -0
  250. package/dist/seo/index.d.ts +14 -0
  251. package/dist/seo/index.js +12 -0
  252. package/dist/seo/messages.en.d.ts +78 -0
  253. package/dist/seo/messages.en.js +78 -0
  254. package/dist/seo/models.d.ts +179 -0
  255. package/dist/seo/models.js +8 -0
  256. package/dist/seo/ports.d.ts +11 -0
  257. package/dist/seo/ports.js +4 -0
  258. package/dist/seo/react/components/MediaPickerBridge.d.ts +4 -0
  259. package/dist/seo/react/components/MediaPickerBridge.js +8 -0
  260. package/dist/seo/react/components/MediaRefField.d.ts +36 -0
  261. package/dist/seo/react/components/MediaRefField.js +12 -0
  262. package/dist/seo/react/components/SeoIcons.d.ts +13 -0
  263. package/dist/seo/react/components/SeoIcons.js +32 -0
  264. package/dist/seo/react/components/SitemapModal.d.ts +48 -0
  265. package/dist/seo/react/components/SitemapModal.js +70 -0
  266. package/dist/seo/react/hooks/MediaPickerBridge.hooks.d.ts +6 -0
  267. package/dist/seo/react/hooks/MediaPickerBridge.hooks.js +27 -0
  268. package/dist/seo/react/hooks/MediaRefField.hooks.d.ts +22 -0
  269. package/dist/seo/react/hooks/MediaRefField.hooks.js +30 -0
  270. package/dist/seo/react/hooks/SeoModuleTabs.d.ts +14 -0
  271. package/dist/seo/react/hooks/SeoModuleTabs.js +18 -0
  272. package/dist/seo/react/hooks/SeoPage.hooks.d.ts +69 -0
  273. package/dist/seo/react/hooks/SeoPage.hooks.js +37 -0
  274. package/dist/seo/react/hooks/SeoPorts.hooks.d.ts +19 -0
  275. package/dist/seo/react/hooks/SeoPorts.hooks.js +22 -0
  276. package/dist/seo/react/hooks/SitemapModal.hooks.d.ts +26 -0
  277. package/dist/seo/react/hooks/SitemapModal.hooks.js +20 -0
  278. package/dist/seo/react/hooks/use-entry-picker.hooks.d.ts +11 -0
  279. package/dist/seo/react/hooks/use-entry-picker.hooks.js +20 -0
  280. package/dist/seo/react/hooks/use-seo-entry-panel.hooks.d.ts +14 -0
  281. package/dist/seo/react/hooks/use-seo-entry-panel.hooks.js +26 -0
  282. package/dist/seo/react/hooks/use-seo-entry-section.hooks.d.ts +4 -0
  283. package/dist/seo/react/hooks/use-seo-entry-section.hooks.js +7 -0
  284. package/dist/seo/react/hooks/use-seo.hooks.d.ts +11 -0
  285. package/dist/seo/react/hooks/use-seo.hooks.js +29 -0
  286. package/dist/seo/react/hooks/use-sitemap-modal.hooks.d.ts +10 -0
  287. package/dist/seo/react/hooks/use-sitemap-modal.hooks.js +18 -0
  288. package/dist/seo/react/index.d.ts +366 -0
  289. package/dist/seo/react/index.js +30 -0
  290. package/dist/seo/react/options.d.ts +19 -0
  291. package/dist/seo/react/options.js +2 -0
  292. package/dist/seo/react/pages/SeoPage.d.ts +161 -0
  293. package/dist/seo/react/pages/SeoPage.js +215 -0
  294. package/dist/seo/rules.d.ts +136 -0
  295. package/dist/seo/rules.js +212 -0
  296. package/dist/seo/seo.module.d.ts +114 -0
  297. package/dist/seo/seo.module.js +14 -0
  298. package/dist/source-control/react/hooks/ProvidersTab.hooks.d.ts +1 -1
  299. package/dist/source-control/react/hooks/ProvidersTab.hooks.js +1 -1
  300. package/dist/source-control/react/hooks/SourceControlPage.hooks.d.ts +1 -1
  301. package/dist/source-control/react/index.js +1 -1
  302. package/dist/source-control/react/pages/SourceControlPage.d.ts +1 -1
  303. package/dist/source-control/react/tabs/ProvidersTab.d.ts +1 -1
  304. package/dist/widgets/adapters/http.d.ts +19 -0
  305. package/dist/widgets/adapters/http.js +33 -0
  306. package/dist/widgets/adapters/memory.d.ts +22 -0
  307. package/dist/widgets/adapters/memory.js +93 -0
  308. package/dist/widgets/conformance/widgets-api.conformance.d.ts +6 -0
  309. package/dist/widgets/conformance/widgets-api.conformance.js +55 -0
  310. package/dist/widgets/controllers/instance-editor.controller.d.ts +49 -0
  311. package/dist/widgets/controllers/instance-editor.controller.js +87 -0
  312. package/dist/widgets/controllers/library.controller.d.ts +33 -0
  313. package/dist/widgets/controllers/library.controller.js +53 -0
  314. package/dist/widgets/controllers/region-editor.controller.d.ts +42 -0
  315. package/dist/widgets/controllers/region-editor.controller.js +69 -0
  316. package/dist/widgets/controllers/regions.controller.d.ts +27 -0
  317. package/dist/widgets/controllers/regions.controller.js +44 -0
  318. package/dist/widgets/index.d.ts +11 -0
  319. package/dist/widgets/index.js +9 -0
  320. package/dist/widgets/messages.en.d.ts +78 -0
  321. package/dist/widgets/messages.en.js +83 -0
  322. package/dist/widgets/models.d.ts +62 -0
  323. package/dist/widgets/models.js +2 -0
  324. package/dist/widgets/ports.d.ts +79 -0
  325. package/dist/widgets/ports.js +5 -0
  326. package/dist/widgets/react/components/WidgetInstanceNotices.d.ts +14 -0
  327. package/dist/widgets/react/components/WidgetInstanceNotices.js +25 -0
  328. package/dist/widgets/react/components/WidgetRegionEditorHeaderActions.d.ts +22 -0
  329. package/dist/widgets/react/components/WidgetRegionEditorHeaderActions.js +18 -0
  330. package/dist/widgets/react/components/WidgetsLibraryNotices.d.ts +13 -0
  331. package/dist/widgets/react/components/WidgetsLibraryNotices.js +10 -0
  332. package/dist/widgets/react/hooks/WidgetsPorts.hooks.d.ts +270 -0
  333. package/dist/widgets/react/hooks/WidgetsPorts.hooks.js +17 -0
  334. package/dist/widgets/react/hooks/navigation.hooks.d.ts +9 -0
  335. package/dist/widgets/react/hooks/navigation.hooks.js +6 -0
  336. package/dist/widgets/react/hooks/page-views.hooks.d.ts +87 -0
  337. package/dist/widgets/react/hooks/page-views.hooks.js +30 -0
  338. package/dist/widgets/react/hooks/use-widget-instance-editor.hooks.d.ts +56 -0
  339. package/dist/widgets/react/hooks/use-widget-instance-editor.hooks.js +38 -0
  340. package/dist/widgets/react/hooks/use-widget-region-editor.hooks.d.ts +32 -0
  341. package/dist/widgets/react/hooks/use-widget-region-editor.hooks.js +22 -0
  342. package/dist/widgets/react/hooks/use-widget-regions.hooks.d.ts +23 -0
  343. package/dist/widgets/react/hooks/use-widget-regions.hooks.js +22 -0
  344. package/dist/widgets/react/hooks/use-widgets-library.hooks.d.ts +37 -0
  345. package/dist/widgets/react/hooks/use-widgets-library.hooks.js +23 -0
  346. package/dist/widgets/react/index.d.ts +391 -0
  347. package/dist/widgets/react/index.js +31 -0
  348. package/dist/widgets/react/pages/WidgetInstanceEditor.d.ts +23 -0
  349. package/dist/widgets/react/pages/WidgetInstanceEditor.js +37 -0
  350. package/dist/widgets/react/pages/WidgetRegionEditor.d.ts +22 -0
  351. package/dist/widgets/react/pages/WidgetRegionEditor.js +25 -0
  352. package/dist/widgets/react/pages/WidgetRegions.d.ts +21 -0
  353. package/dist/widgets/react/pages/WidgetRegions.js +31 -0
  354. package/dist/widgets/react/pages/WidgetsLibrary.d.ts +24 -0
  355. package/dist/widgets/react/pages/WidgetsLibrary.js +61 -0
  356. package/dist/widgets/rules.d.ts +94 -0
  357. package/dist/widgets/rules.js +83 -0
  358. package/dist/widgets/widgets.module.d.ts +122 -0
  359. package/dist/widgets/widgets.module.js +21 -0
  360. package/package.json +206 -9
@@ -0,0 +1,37 @@
1
+ import type { AdminWidget, AdminWidgetType, WidgetsTranslate as Translate } from '../../models.js';
2
+ export interface WidgetsLibraryController {
3
+ /** `null` until the initial load settles — the caller renders a loading state. */
4
+ widgets: AdminWidget[] | null;
5
+ error: string | null;
6
+ /** Count of widget-instance records the server could not read (unparseable `fields_json`).
7
+ * `0` and `undefined` both mean "nothing to say". */
8
+ skippedCount: number;
9
+ /** IDs of the malformed widget records counted in {@link skippedCount}. */
10
+ skippedIds: string[];
11
+ createType: AdminWidgetType;
12
+ setCreateType: (type: AdminWidgetType) => void;
13
+ /** The widget a "Trash" click is asking to confirm — `null` when the dialog is closed. Set by
14
+ * `requestTrash`; no network call happens until {@link confirmTrash}. */
15
+ pendingTrash: AdminWidget | null;
16
+ /** True only while the CONFIRMED trash for {@link pendingTrash} is in flight — same
17
+ * `pendingX !== null && xId === pendingX.id` shape `use-media.hooks.ts` uses. */
18
+ trashing: boolean;
19
+ requestTrash: (widget: AdminWidget) => void;
20
+ confirmTrash: () => Promise<void>;
21
+ cancelTrash: () => void;
22
+ /** Bound translator — `WidgetsLibrary.tsx`'s only source of UI copy; see this file's own header. */
23
+ t: Translate;
24
+ /** The raw resolved locale — exposed only because `widgetTypeLabel` (`../rules.ts`) genuinely
25
+ * needs it, not `t`. */
26
+ locale: string;
27
+ }
28
+ import type { AdminWidgetsPort, WidgetsEventsPort } from '../../ports.js';
29
+ export declare function useWidgetsLibrary({ api }: {
30
+ api: AdminWidgetsPort;
31
+ }, { t, locale, events }?: {
32
+ t?: Translate | undefined;
33
+ locale?: string | undefined;
34
+ events?: WidgetsEventsPort | undefined;
35
+ }): WidgetsLibraryController;
36
+ export declare function useWiredWidgetsLibrary(): WidgetsLibraryController;
37
+ //# sourceMappingURL=use-widgets-library.hooks.d.ts.map
@@ -0,0 +1,23 @@
1
+ import { useEffect, useRef } from 'react';
2
+ import { useController } from '../../../core/react/use-controller.js';
3
+ import { createWidgetsLibraryController } from '../../controllers/library.controller.js';
4
+ import { widgetsEnglish } from '../../messages.en.js';
5
+ import { WIDGETS_LIBRARY_RESOURCE } from '../../rules.js';
6
+ import { useWidgetsPorts, useWidgetsOptions } from './WidgetsPorts.hooks.js';
7
+ export function useWidgetsLibrary({ api }, { t = widgetsEnglish, locale = 'en', events } = {}) {
8
+ const latestT = useRef(t);
9
+ latestT.current = t;
10
+ const { controller, snapshot } = useController({ create: () => createWidgetsLibraryController({ api }, { t: key => latestT.current(key) }), dependencies: [api] }, { start: ({ controller }) => { void controller.load(); } });
11
+ useEffect(() => { if (!controller)
12
+ return; return events?.subscribe({ resource: WIDGETS_LIBRARY_RESOURCE, onRefresh: () => { void controller.load(); } }); }, [controller, events]);
13
+ const state = snapshot ?? { widgets: null, error: null, skippedCount: 0, skippedIds: [], createType: 'text', pendingTrash: null, trashingId: null };
14
+ return { ...state, trashing: state.pendingTrash !== null && state.trashingId === state.pendingTrash.id,
15
+ setCreateType: type => controller?.setCreateType({ type }), requestTrash: widget => controller?.requestTrash({ widget }),
16
+ confirmTrash: async () => { await controller?.confirmTrash(); }, cancelTrash: () => controller?.cancelTrash(), t, locale };
17
+ }
18
+ export function useWiredWidgetsLibrary() {
19
+ const { widgetsApi: api, widgetsEvents: events } = useWidgetsPorts();
20
+ const { t, locale } = useWidgetsOptions();
21
+ return useWidgetsLibrary({ api }, { t, locale, events });
22
+ }
23
+ //# sourceMappingURL=use-widgets-library.hooks.js.map
@@ -0,0 +1,391 @@
1
+ import type { ComponentType, ReactNode } from 'react';
2
+ import type { AdminInstance } from '../../core/module/types.js';
3
+ import type { ModulePageProps } from '../../core/react/bind-react.js';
4
+ import type { WidgetsReactOptions } from './hooks/WidgetsPorts.hooks.js';
5
+ export type { WidgetsReactOptions, WidgetsSlots } from './hooks/WidgetsPorts.hooks.js';
6
+ export { useWidgetsPorts, useWidgetsOptions } from './hooks/WidgetsPorts.hooks.js';
7
+ export type { WidgetsLibraryProps } from './pages/WidgetsLibrary.js';
8
+ export type { WidgetInstanceEditorProps } from './pages/WidgetInstanceEditor.js';
9
+ export type { WidgetRegionsProps } from './pages/WidgetRegions.js';
10
+ export type { WidgetRegionEditorProps } from './pages/WidgetRegionEditor.js';
11
+ /** Optional page params are the Part B host bridge; core ModulePageProps remains untouched. */
12
+ export type WidgetsModulePageProps = ModulePageProps & {
13
+ params?: {
14
+ widgetId?: string | null;
15
+ widgetType?: string | null;
16
+ regionKey?: string;
17
+ } | undefined;
18
+ widgetId?: string | null | undefined;
19
+ widgetType?: string | null | undefined;
20
+ regionKey?: string | undefined;
21
+ };
22
+ /** Lazy pages share injected options while bindReact owns the API scope. */
23
+ export declare function widgets({ slots, widgetTypes, defaultConfig }: Pick<WidgetsReactOptions, 'slots' | 'widgetTypes' | 'defaultConfig'>, optional?: Omit<WidgetsReactOptions, 'slots' | 'widgetTypes' | 'defaultConfig'>): {
24
+ id: "widgets";
25
+ requires: {
26
+ readonly widgetsApi: import("../../core/module/token.js").AdminPortToken<import("../ports.js").AdminWidgetsPort, "admin.widgets.api">;
27
+ };
28
+ optional: {
29
+ readonly widgetsEvents: import("../../core/module/token.js").AdminPortToken<import("../ports.js").WidgetsEventsPort, "admin.widgets.events">;
30
+ readonly widgetsNavigation: import("../../core/module/token.js").AdminPortToken<import("../ports.js").WidgetsNavigationPort, "admin.widgets.navigation">;
31
+ };
32
+ messages: {
33
+ readonly Back: "Back";
34
+ readonly "Widget type to create": "Widget type to create";
35
+ readonly Content: "Content";
36
+ readonly Text: "Text";
37
+ readonly "Social Links": "Social Links";
38
+ readonly "Collection list": "Collection list";
39
+ readonly Menu: "Menu";
40
+ readonly "Contact Form": "Contact Form";
41
+ readonly Widgets: "Widgets";
42
+ readonly "Widget Regions": "Widget Regions";
43
+ readonly "A region is a theme-declared placement area (e.g. \"header\", \"footer\", \"sidebar\"). Bind a region by its key to start placing widgets in it.": "A region is a theme-declared placement area (e.g. \"header\", \"footer\", \"sidebar\"). Bind a region by its key to start placing widgets in it.";
44
+ readonly "Binding\u2026": "Binding…";
45
+ readonly "Bind region": "Bind region";
46
+ readonly "No regions bound yet.": "No regions bound yet.";
47
+ readonly "Region key": "Region key";
48
+ readonly Placements: "Placements";
49
+ readonly Manage: "Manage";
50
+ readonly "Create reusable content blocks and place them into your theme's widget regions.": "Create reusable content blocks and place them into your theme's widget regions.";
51
+ readonly "Regions \u2192": "Regions →";
52
+ readonly "Add New": "Add New";
53
+ readonly "1 widget record in this workspace could not be read.": "1 widget record in this workspace could not be read.";
54
+ readonly "{n} widget records in this workspace could not be read.": "{n} widget records in this workspace could not be read.";
55
+ readonly "Show ids": "Show ids";
56
+ readonly "No widgets yet.": "No widgets yet.";
57
+ readonly "Create one above to get started.": "Create one above to get started.";
58
+ readonly Title: "Title";
59
+ readonly Type: "Type";
60
+ readonly Slug: "Slug";
61
+ readonly Status: "Status";
62
+ readonly Actions: "Actions";
63
+ readonly Trash: "Trash";
64
+ readonly "Move to trash?": "Move to trash?";
65
+ readonly "Move to trash": "Move to trash";
66
+ readonly "Move \"{title}\" to trash?": "Move \"{title}\" to trash?";
67
+ readonly Regions: "Regions";
68
+ readonly "Saving\u2026": "Saving…";
69
+ readonly Save: "Save";
70
+ readonly "Region:": "Region:";
71
+ readonly "Manage which widgets appear in this region and their order.": "Manage which widgets appear in this region and their order.";
72
+ readonly "No widgets placed in this region yet.": "No widgets placed in this region yet.";
73
+ readonly Enabled: "Enabled";
74
+ readonly "\u26A0 Broken reference": "⚠ Broken reference";
75
+ readonly "+ Add widget": "+ Add widget";
76
+ readonly "New widget": "New widget";
77
+ readonly "Edit widget": "Edit widget";
78
+ readonly "Configure this widget's title and settings.": "Configure this widget's title and settings.";
79
+ readonly "Widget title": "Widget title";
80
+ readonly "Type:": "Type:";
81
+ readonly "Region area": "Region area";
82
+ readonly "Inline embed": "Inline embed";
83
+ readonly "Used in 1 place:": "Used in 1 place:";
84
+ readonly "Used in {count} places:": "Used in {count} places:";
85
+ readonly "failed to load widget": "failed to load widget";
86
+ readonly "save failed": "save failed";
87
+ readonly "This widget changed since you loaded it, refresh and try again.": "This widget changed since you loaded it, refresh and try again.";
88
+ readonly "This region changed since you loaded it, refresh and try again.": "This region changed since you loaded it, refresh and try again.";
89
+ readonly "failed to load region": "failed to load region";
90
+ readonly "failed to load widgets": "failed to load widgets";
91
+ readonly "delete failed": "delete failed";
92
+ readonly "This item changed since you loaded it. Reload and try again.": "This item changed since you loaded it. Reload and try again.";
93
+ readonly "failed to load regions": "failed to load regions";
94
+ readonly "bind failed": "bind failed";
95
+ readonly "Loading widget\u2026": "Loading widget…";
96
+ readonly "No widget type specified.": "No widget type specified.";
97
+ readonly "Unknown widget type \"": "Unknown widget type \"";
98
+ readonly "Loading region\u2026": "Loading region…";
99
+ readonly "Move up": "Move up";
100
+ readonly "Move down": "Move down";
101
+ readonly Remove: "Remove";
102
+ readonly "Loading regions\u2026": "Loading regions…";
103
+ readonly "Loading widgets\u2026": "Loading widgets…";
104
+ readonly "Saved \u00B7 version {version}": "Saved · version {version}";
105
+ };
106
+ pages: {
107
+ readonly library: {
108
+ readonly path: "/widgets";
109
+ readonly label: "Widgets";
110
+ readonly agentReachable: true;
111
+ readonly nav: {
112
+ readonly group: "Content";
113
+ };
114
+ readonly tabs: {};
115
+ };
116
+ readonly editor: {
117
+ readonly path: "/widgets/:widgetId";
118
+ readonly label: "Edit widget";
119
+ readonly agentReachable: true;
120
+ readonly tabs: {};
121
+ };
122
+ readonly regions: {
123
+ readonly path: "/widgets/regions";
124
+ readonly label: "Widget Regions";
125
+ readonly agentReachable: true;
126
+ readonly tabs: {};
127
+ };
128
+ readonly region: {
129
+ readonly path: "/widgets/regions/:regionKey";
130
+ readonly label: "Region:";
131
+ readonly agentReachable: true;
132
+ readonly tabs: {};
133
+ };
134
+ };
135
+ } & {
136
+ react: {
137
+ Provider: ({ admin, children, options }: {
138
+ admin: AdminInstance;
139
+ children: ReactNode;
140
+ options?: WidgetsReactOptions;
141
+ }, _optional?: Record<string, never>) => import("react").FunctionComponentElement<{
142
+ admin: AdminInstance;
143
+ children: ReactNode;
144
+ }>;
145
+ module: {
146
+ readonly id: "widgets";
147
+ readonly requires: {
148
+ readonly widgetsApi: import("../../core/module/token.js").AdminPortToken<import("../ports.js").AdminWidgetsPort, "admin.widgets.api">;
149
+ };
150
+ readonly optional: {
151
+ readonly widgetsEvents: import("../../core/module/token.js").AdminPortToken<import("../ports.js").WidgetsEventsPort, "admin.widgets.events">;
152
+ readonly widgetsNavigation: import("../../core/module/token.js").AdminPortToken<import("../ports.js").WidgetsNavigationPort, "admin.widgets.navigation">;
153
+ };
154
+ readonly messages: {
155
+ readonly Back: "Back";
156
+ readonly "Widget type to create": "Widget type to create";
157
+ readonly Content: "Content";
158
+ readonly Text: "Text";
159
+ readonly "Social Links": "Social Links";
160
+ readonly "Collection list": "Collection list";
161
+ readonly Menu: "Menu";
162
+ readonly "Contact Form": "Contact Form";
163
+ readonly Widgets: "Widgets";
164
+ readonly "Widget Regions": "Widget Regions";
165
+ readonly "A region is a theme-declared placement area (e.g. \"header\", \"footer\", \"sidebar\"). Bind a region by its key to start placing widgets in it.": "A region is a theme-declared placement area (e.g. \"header\", \"footer\", \"sidebar\"). Bind a region by its key to start placing widgets in it.";
166
+ readonly "Binding\u2026": "Binding…";
167
+ readonly "Bind region": "Bind region";
168
+ readonly "No regions bound yet.": "No regions bound yet.";
169
+ readonly "Region key": "Region key";
170
+ readonly Placements: "Placements";
171
+ readonly Manage: "Manage";
172
+ readonly "Create reusable content blocks and place them into your theme's widget regions.": "Create reusable content blocks and place them into your theme's widget regions.";
173
+ readonly "Regions \u2192": "Regions →";
174
+ readonly "Add New": "Add New";
175
+ readonly "1 widget record in this workspace could not be read.": "1 widget record in this workspace could not be read.";
176
+ readonly "{n} widget records in this workspace could not be read.": "{n} widget records in this workspace could not be read.";
177
+ readonly "Show ids": "Show ids";
178
+ readonly "No widgets yet.": "No widgets yet.";
179
+ readonly "Create one above to get started.": "Create one above to get started.";
180
+ readonly Title: "Title";
181
+ readonly Type: "Type";
182
+ readonly Slug: "Slug";
183
+ readonly Status: "Status";
184
+ readonly Actions: "Actions";
185
+ readonly Trash: "Trash";
186
+ readonly "Move to trash?": "Move to trash?";
187
+ readonly "Move to trash": "Move to trash";
188
+ readonly "Move \"{title}\" to trash?": "Move \"{title}\" to trash?";
189
+ readonly Regions: "Regions";
190
+ readonly "Saving\u2026": "Saving…";
191
+ readonly Save: "Save";
192
+ readonly "Region:": "Region:";
193
+ readonly "Manage which widgets appear in this region and their order.": "Manage which widgets appear in this region and their order.";
194
+ readonly "No widgets placed in this region yet.": "No widgets placed in this region yet.";
195
+ readonly Enabled: "Enabled";
196
+ readonly "\u26A0 Broken reference": "⚠ Broken reference";
197
+ readonly "+ Add widget": "+ Add widget";
198
+ readonly "New widget": "New widget";
199
+ readonly "Edit widget": "Edit widget";
200
+ readonly "Configure this widget's title and settings.": "Configure this widget's title and settings.";
201
+ readonly "Widget title": "Widget title";
202
+ readonly "Type:": "Type:";
203
+ readonly "Region area": "Region area";
204
+ readonly "Inline embed": "Inline embed";
205
+ readonly "Used in 1 place:": "Used in 1 place:";
206
+ readonly "Used in {count} places:": "Used in {count} places:";
207
+ readonly "failed to load widget": "failed to load widget";
208
+ readonly "save failed": "save failed";
209
+ readonly "This widget changed since you loaded it, refresh and try again.": "This widget changed since you loaded it, refresh and try again.";
210
+ readonly "This region changed since you loaded it, refresh and try again.": "This region changed since you loaded it, refresh and try again.";
211
+ readonly "failed to load region": "failed to load region";
212
+ readonly "failed to load widgets": "failed to load widgets";
213
+ readonly "delete failed": "delete failed";
214
+ readonly "This item changed since you loaded it. Reload and try again.": "This item changed since you loaded it. Reload and try again.";
215
+ readonly "failed to load regions": "failed to load regions";
216
+ readonly "bind failed": "bind failed";
217
+ readonly "Loading widget\u2026": "Loading widget…";
218
+ readonly "No widget type specified.": "No widget type specified.";
219
+ readonly "Unknown widget type \"": "Unknown widget type \"";
220
+ readonly "Loading region\u2026": "Loading region…";
221
+ readonly "Move up": "Move up";
222
+ readonly "Move down": "Move down";
223
+ readonly Remove: "Remove";
224
+ readonly "Loading regions\u2026": "Loading regions…";
225
+ readonly "Loading widgets\u2026": "Loading widgets…";
226
+ readonly "Saved \u00B7 version {version}": "Saved · version {version}";
227
+ };
228
+ readonly pages: {
229
+ readonly library: {
230
+ readonly path: "/widgets";
231
+ readonly label: "Widgets";
232
+ readonly agentReachable: true;
233
+ readonly nav: {
234
+ readonly group: "Content";
235
+ };
236
+ readonly tabs: {};
237
+ };
238
+ readonly editor: {
239
+ readonly path: "/widgets/:widgetId";
240
+ readonly label: "Edit widget";
241
+ readonly agentReachable: true;
242
+ readonly tabs: {};
243
+ };
244
+ readonly regions: {
245
+ readonly path: "/widgets/regions";
246
+ readonly label: "Widget Regions";
247
+ readonly agentReachable: true;
248
+ readonly tabs: {};
249
+ };
250
+ readonly region: {
251
+ readonly path: "/widgets/regions/:regionKey";
252
+ readonly label: "Region:";
253
+ readonly agentReachable: true;
254
+ readonly tabs: {};
255
+ };
256
+ };
257
+ };
258
+ pages: {
259
+ readonly library: {
260
+ Page: import("react").LazyExoticComponent<ComponentType<ModulePageProps>>;
261
+ tabs: {};
262
+ };
263
+ readonly editor: {
264
+ Page: import("react").LazyExoticComponent<ComponentType<ModulePageProps>>;
265
+ tabs: {};
266
+ };
267
+ readonly regions: {
268
+ Page: import("react").LazyExoticComponent<ComponentType<ModulePageProps>>;
269
+ tabs: {};
270
+ };
271
+ readonly region: {
272
+ Page: import("react").LazyExoticComponent<ComponentType<ModulePageProps>>;
273
+ tabs: {};
274
+ };
275
+ };
276
+ usePorts: (_required?: Record<string, never>, _optional?: Record<string, never>) => import("../../core/module/types.js").ScopedPorts<{
277
+ readonly id: "widgets";
278
+ readonly requires: {
279
+ readonly widgetsApi: import("../../core/module/token.js").AdminPortToken<import("../ports.js").AdminWidgetsPort, "admin.widgets.api">;
280
+ };
281
+ readonly optional: {
282
+ readonly widgetsEvents: import("../../core/module/token.js").AdminPortToken<import("../ports.js").WidgetsEventsPort, "admin.widgets.events">;
283
+ readonly widgetsNavigation: import("../../core/module/token.js").AdminPortToken<import("../ports.js").WidgetsNavigationPort, "admin.widgets.navigation">;
284
+ };
285
+ readonly messages: {
286
+ readonly Back: "Back";
287
+ readonly "Widget type to create": "Widget type to create";
288
+ readonly Content: "Content";
289
+ readonly Text: "Text";
290
+ readonly "Social Links": "Social Links";
291
+ readonly "Collection list": "Collection list";
292
+ readonly Menu: "Menu";
293
+ readonly "Contact Form": "Contact Form";
294
+ readonly Widgets: "Widgets";
295
+ readonly "Widget Regions": "Widget Regions";
296
+ readonly "A region is a theme-declared placement area (e.g. \"header\", \"footer\", \"sidebar\"). Bind a region by its key to start placing widgets in it.": "A region is a theme-declared placement area (e.g. \"header\", \"footer\", \"sidebar\"). Bind a region by its key to start placing widgets in it.";
297
+ readonly "Binding\u2026": "Binding…";
298
+ readonly "Bind region": "Bind region";
299
+ readonly "No regions bound yet.": "No regions bound yet.";
300
+ readonly "Region key": "Region key";
301
+ readonly Placements: "Placements";
302
+ readonly Manage: "Manage";
303
+ readonly "Create reusable content blocks and place them into your theme's widget regions.": "Create reusable content blocks and place them into your theme's widget regions.";
304
+ readonly "Regions \u2192": "Regions →";
305
+ readonly "Add New": "Add New";
306
+ readonly "1 widget record in this workspace could not be read.": "1 widget record in this workspace could not be read.";
307
+ readonly "{n} widget records in this workspace could not be read.": "{n} widget records in this workspace could not be read.";
308
+ readonly "Show ids": "Show ids";
309
+ readonly "No widgets yet.": "No widgets yet.";
310
+ readonly "Create one above to get started.": "Create one above to get started.";
311
+ readonly Title: "Title";
312
+ readonly Type: "Type";
313
+ readonly Slug: "Slug";
314
+ readonly Status: "Status";
315
+ readonly Actions: "Actions";
316
+ readonly Trash: "Trash";
317
+ readonly "Move to trash?": "Move to trash?";
318
+ readonly "Move to trash": "Move to trash";
319
+ readonly "Move \"{title}\" to trash?": "Move \"{title}\" to trash?";
320
+ readonly Regions: "Regions";
321
+ readonly "Saving\u2026": "Saving…";
322
+ readonly Save: "Save";
323
+ readonly "Region:": "Region:";
324
+ readonly "Manage which widgets appear in this region and their order.": "Manage which widgets appear in this region and their order.";
325
+ readonly "No widgets placed in this region yet.": "No widgets placed in this region yet.";
326
+ readonly Enabled: "Enabled";
327
+ readonly "\u26A0 Broken reference": "⚠ Broken reference";
328
+ readonly "+ Add widget": "+ Add widget";
329
+ readonly "New widget": "New widget";
330
+ readonly "Edit widget": "Edit widget";
331
+ readonly "Configure this widget's title and settings.": "Configure this widget's title and settings.";
332
+ readonly "Widget title": "Widget title";
333
+ readonly "Type:": "Type:";
334
+ readonly "Region area": "Region area";
335
+ readonly "Inline embed": "Inline embed";
336
+ readonly "Used in 1 place:": "Used in 1 place:";
337
+ readonly "Used in {count} places:": "Used in {count} places:";
338
+ readonly "failed to load widget": "failed to load widget";
339
+ readonly "save failed": "save failed";
340
+ readonly "This widget changed since you loaded it, refresh and try again.": "This widget changed since you loaded it, refresh and try again.";
341
+ readonly "This region changed since you loaded it, refresh and try again.": "This region changed since you loaded it, refresh and try again.";
342
+ readonly "failed to load region": "failed to load region";
343
+ readonly "failed to load widgets": "failed to load widgets";
344
+ readonly "delete failed": "delete failed";
345
+ readonly "This item changed since you loaded it. Reload and try again.": "This item changed since you loaded it. Reload and try again.";
346
+ readonly "failed to load regions": "failed to load regions";
347
+ readonly "bind failed": "bind failed";
348
+ readonly "Loading widget\u2026": "Loading widget…";
349
+ readonly "No widget type specified.": "No widget type specified.";
350
+ readonly "Unknown widget type \"": "Unknown widget type \"";
351
+ readonly "Loading region\u2026": "Loading region…";
352
+ readonly "Move up": "Move up";
353
+ readonly "Move down": "Move down";
354
+ readonly Remove: "Remove";
355
+ readonly "Loading regions\u2026": "Loading regions…";
356
+ readonly "Loading widgets\u2026": "Loading widgets…";
357
+ readonly "Saved \u00B7 version {version}": "Saved · version {version}";
358
+ };
359
+ readonly pages: {
360
+ readonly library: {
361
+ readonly path: "/widgets";
362
+ readonly label: "Widgets";
363
+ readonly agentReachable: true;
364
+ readonly nav: {
365
+ readonly group: "Content";
366
+ };
367
+ readonly tabs: {};
368
+ };
369
+ readonly editor: {
370
+ readonly path: "/widgets/:widgetId";
371
+ readonly label: "Edit widget";
372
+ readonly agentReachable: true;
373
+ readonly tabs: {};
374
+ };
375
+ readonly regions: {
376
+ readonly path: "/widgets/regions";
377
+ readonly label: "Widget Regions";
378
+ readonly agentReachable: true;
379
+ readonly tabs: {};
380
+ };
381
+ readonly region: {
382
+ readonly path: "/widgets/regions/:regionKey";
383
+ readonly label: "Region:";
384
+ readonly agentReachable: true;
385
+ readonly tabs: {};
386
+ };
387
+ };
388
+ }>;
389
+ };
390
+ };
391
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,31 @@
1
+ import { createElement } from 'react';
2
+ import { bindReact } from '../../core/react/bind-react.js';
3
+ import { widgetsModule } from '../widgets.module.js';
4
+ import { WidgetsPortsContext, WidgetsOptionsContext } from './hooks/WidgetsPorts.hooks.js';
5
+ export { useWidgetsPorts, useWidgetsOptions } from './hooks/WidgetsPorts.hooks.js';
6
+ /** Lazy pages share injected options while bindReact owns the API scope. */
7
+ export function widgets({ slots, widgetTypes, defaultConfig }, optional = {}) {
8
+ // Scope membership uses object identity, so bind and return this same per-admin module.
9
+ const module = { ...widgetsModule };
10
+ const defaults = { slots, widgetTypes, defaultConfig, ...optional };
11
+ function page(load, params) {
12
+ return async () => {
13
+ const loaded = await load();
14
+ return { default: (props) => createElement(loaded.default, params(props)) };
15
+ };
16
+ }
17
+ const react = bindReact({ module, views: {
18
+ library: { page: page(() => import('./pages/WidgetsLibrary.js'), () => ({})), tabs: {} },
19
+ editor: { page: page(() => import('./pages/WidgetInstanceEditor.js'), props => ({ widgetId: props.params?.widgetId ?? props.widgetId ?? null, widgetType: props.params?.widgetType ?? props.widgetType ?? null })), tabs: {} },
20
+ regions: { page: page(() => import('./pages/WidgetRegions.js'), () => ({})), tabs: {} },
21
+ region: { page: page(() => import('./pages/WidgetRegionEditor.js'), props => ({ regionKey: props.params?.regionKey ?? props.regionKey ?? '' })), tabs: {} },
22
+ } }, { context: WidgetsPortsContext });
23
+ /** Refresh host options without replacing lazy views or discarding controller drafts.
24
+ * Factory defaults support existing hosts; the port scope remains owned by bindReact.
25
+ */
26
+ function Provider({ admin, children, options = defaults }, _optional = {}) {
27
+ return createElement(react.Provider, { admin, children: createElement(WidgetsOptionsContext.Provider, { value: options }, children) });
28
+ }
29
+ return Object.assign(module, { react: { ...react, Provider } });
30
+ }
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,23 @@
1
+ import { useWiredWidgetInstanceEditor } from "../hooks/use-widget-instance-editor.hooks.js";
2
+ /**
3
+ * @file `WidgetInstanceEditorScreen` (`ui.spec.md` §2.2/§3.3/§4.3) — create/edit one widget
4
+ * instance, `/admin/widgets/new?type=X` and `/admin/widgets/{id}` — markup only. Mirrors
5
+ * `MenuEditor.tsx`'s editor-shell shape; config editing delegates to the shared
6
+ * `WidgetConfigFields` (§3.4).
7
+ *
8
+ * State, the fetch, and save live in `../hooks/use-widget-instance-editor.hooks.ts`; the field-error
9
+ * extraction, the known-type check, and the type label live in `../../rules.ts`.
10
+ */
11
+ export { widgetInstanceGuard } from '../../rules.js';
12
+ export interface WidgetInstanceEditorProps {
13
+ widgetId: string | null;
14
+ widgetType: string | null;
15
+ /**
16
+ * Dependency injection seam for tests — the same convention `Posts.tsx`'s `usePostsHook` uses.
17
+ * Defaulted to the real hook, so production callers pass nothing and behave exactly as before.
18
+ */
19
+ useWidgetInstanceEditorHook?: typeof useWiredWidgetInstanceEditor | undefined;
20
+ }
21
+ export declare function WidgetInstanceEditor(props: WidgetInstanceEditorProps): import("react").JSX.Element | null;
22
+ export default WidgetInstanceEditor;
23
+ //# sourceMappingURL=WidgetInstanceEditor.d.ts.map
@@ -0,0 +1,37 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useWidgetInstanceEditorView } from '../hooks/page-views.hooks.js';
3
+ import { useWidgetsOptions } from '../hooks/WidgetsPorts.hooks.js';
4
+ import { agentHandle } from "@jini-ai/agentic";
5
+ import { widgetTypeLabel } from "../../rules.js";
6
+ import { useWiredWidgetInstanceEditor } from "../hooks/use-widget-instance-editor.hooks.js";
7
+ /**
8
+ * @file `WidgetInstanceEditorScreen` (`ui.spec.md` §2.2/§3.3/§4.3) — create/edit one widget
9
+ * instance, `/admin/widgets/new?type=X` and `/admin/widgets/{id}` — markup only. Mirrors
10
+ * `MenuEditor.tsx`'s editor-shell shape; config editing delegates to the shared
11
+ * `WidgetConfigFields` (§3.4).
12
+ *
13
+ * State, the fetch, and save live in `../hooks/use-widget-instance-editor.hooks.ts`; the field-error
14
+ * extraction, the known-type check, and the type label live in `../../rules.ts`.
15
+ */
16
+ export { widgetInstanceGuard } from '../../rules.js';
17
+ import { WhereUsedBanner, WidgetInstanceGuardNotice } from '../components/WidgetInstanceNotices.js';
18
+ export function WidgetInstanceEditor(props) {
19
+ const { slots: { ConfigFields: WidgetConfigFields }, widgetTypes } = useWidgetsOptions();
20
+ const { widgetId, widgetType: queryWidgetType, useWidgetInstanceEditorHook = useWiredWidgetInstanceEditor } = props;
21
+ const { isNew, widget, whereUsed, title, setTitle, config, setConfig, message, error, fieldErrors, loading, saving, widgetType, save, confirmLeave, t, locale, guard, onBackClick, } = useWidgetInstanceEditorView({ widgetId, widgetType: queryWidgetType, useWidgetInstanceEditorHook, widgetTypes });
22
+ if (guard)
23
+ return _jsx(WidgetInstanceGuardNotice, { guard: guard, t: t });
24
+ // Unreachable in practice — `widgetInstanceGuard`'s "no-type" case already covers a null
25
+ // `widgetType` above — but TS can't see through that opaque function call, so this narrows the
26
+ // type for the JSX below rather than asserting it with `!`.
27
+ if (!widgetType)
28
+ return null;
29
+ // The host slot binds shared-component translations; screen copy uses the module t.
30
+ const sharedT = t;
31
+ return (_jsxs("div", { className: "page", children: [_jsxs("div", { className: "page-header page-header-split", ...agentHandle({ handle: "widget-instance-header" }, {
32
+ role: "region",
33
+ label: "Widget editor header — the back link, the widget's title, and the Save button",
34
+ }), children: [_jsx("div", { className: "page-header-lead", children: _jsxs("a", { className: "btn-secondary", href: "/admin/widgets", onClick: onBackClick, "aria-label": `${t("Back")}: ${t("Widgets")}`, ...agentHandle({ handle: "widget-instance-back" }, { role: "link", label: "Back to Widgets" }), children: ["\u2190 ", t("Back")] }) }), _jsxs("div", { className: "page-header-text", children: [_jsx("p", { className: "page-kicker", children: t("Content") }), _jsx("h1", { className: "page-title", children: t(isNew ? "New widget" : "Edit widget") }), _jsx("p", { className: "page-description", children: t("Configure this widget's title and settings.") })] }), _jsxs("div", { className: "page-header-actions page-actions", children: [message ? _jsx("span", { className: "save-ok", children: message }) : null, error ? (_jsx("span", { className: "save-error", role: "alert", children: error })) : null, _jsx("button", { onClick: save, disabled: saving, ...agentHandle({ handle: "widget-instance-save" }, { role: "button", label: "Save this widget" }), children: saving ? t("Saving…") : t("Save") })] })] }), widget ? _jsx(WhereUsedBanner, { whereUsed: whereUsed, t: t }) : null, _jsxs("label", { className: "a11y-label-wrap", children: [_jsx("span", { className: "visually-hidden", children: t("Widget title") }), _jsx("input", { className: "editor-title", value: title, onChange: (e) => setTitle(e.target.value), placeholder: t("Widget title"), ...agentHandle({ handle: "widget-instance-title" }, { role: "field", label: "This widget's title" }) })] }), _jsxs("p", { className: "muted-cell", children: [t("Type:"), " ", widgetTypeLabel({ widgetType, types: widgetTypes }, { t })] }), _jsxs("div", { className: "widget-config-form", children: [_jsx(WidgetConfigFields, { widgetType: widgetType, config: config, onChange: setConfig, agentHandle: "widget-instance-config", t: sharedT }), fieldErrors.map((fe, i) => (_jsxs("p", { className: "save-error", role: "alert", children: [fe.field, ": ", fe.reason] }, i)))] })] }));
35
+ }
36
+ export default WidgetInstanceEditor;
37
+ //# sourceMappingURL=WidgetInstanceEditor.js.map
@@ -0,0 +1,22 @@
1
+ import { useWiredWidgetRegionEditor } from "../hooks/use-widget-region-editor.hooks.js";
2
+ /**
3
+ * @file `RegionPlacementEditorScreen` + `RegionPlacementList` (`ui.spec.md` §2.5/§2.6/§3.7/§3.8/
4
+ * §4.6/§4.7) — `/admin/widgets/regions/{regionKey}` — markup only. Flat ordered list, ↑/↓ move
5
+ * controls, mirrors `MenuEditor.tsx`'s `ItemRow`/`moveAtPath` reorder UX exactly, without the
6
+ * nesting a menu tree has (a region's placement list has no parent/child structure, REQ-15).
7
+ *
8
+ * State, the fetch, and save live in `../hooks/use-widget-region-editor.hooks.ts`; the reorder swap
9
+ * and the draft-placement builder live in `../../rules.ts`.
10
+ */
11
+ export interface WidgetRegionEditorProps {
12
+ regionKey: string;
13
+ /**
14
+ * Dependency injection seam for tests — the same convention `Posts.tsx`'s `usePostsHook` uses.
15
+ * Defaulted to the real hook, so production callers pass nothing and behave exactly as before.
16
+ */
17
+ useWidgetRegionEditorHook?: typeof useWiredWidgetRegionEditor | undefined;
18
+ }
19
+ export { WidgetRegionEditorHeaderActions } from '../components/WidgetRegionEditorHeaderActions.js';
20
+ export declare function WidgetRegionEditor(props: WidgetRegionEditorProps): import("react").JSX.Element | null;
21
+ export default WidgetRegionEditor;
22
+ //# sourceMappingURL=WidgetRegionEditor.d.ts.map
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useWidgetRegionEditorView } from '../hooks/page-views.hooks.js';
3
+ import { useWidgetsOptions } from '../hooks/WidgetsPorts.hooks.js';
4
+ import { agentHandle } from "@jini-ai/agentic";
5
+ import { useWiredWidgetRegionEditor } from "../hooks/use-widget-region-editor.hooks.js";
6
+ import { widgetTypeLabel } from "../../rules.js";
7
+ export { WidgetRegionEditorHeaderActions } from '../components/WidgetRegionEditorHeaderActions.js';
8
+ import { WidgetRegionEditorHeaderActions } from '../components/WidgetRegionEditorHeaderActions.js';
9
+ export function WidgetRegionEditor(props) {
10
+ const { slots: { AddControl: WidgetAddControl }, widgetTypes } = useWidgetsOptions();
11
+ const { regionKey, useWidgetRegionEditorHook = useWiredWidgetRegionEditor } = props;
12
+ const { area, placements, message, error, loading, saving, removeAt, moveAt, toggleEnabled, addPlacement, save, t, locale, placementHandles } = useWidgetRegionEditorView({ regionKey, useWidgetRegionEditorHook });
13
+ if (error && !area)
14
+ return _jsx("div", { className: "notice error", children: error });
15
+ if (loading)
16
+ return _jsx("div", { className: "notice", children: t("Loading region…") });
17
+ if (!area)
18
+ return null;
19
+ return (_jsxs("div", { className: "page", children: [_jsxs("div", { className: "page-header page-header-split", ...agentHandle({ handle: "widget-region-editor-header" }, {
20
+ role: "region",
21
+ label: "Widget region editor header — the back link, the region's title, and the Save button",
22
+ }), children: [_jsx("div", { className: "page-header-lead", children: _jsxs("a", { className: "btn-secondary", href: "/admin/widgets/regions", "aria-label": `${t("Back")}: ${t("Regions")}`, ...agentHandle({ handle: "widget-region-editor-back" }, { role: "link", label: "Back to Widget Regions" }), children: ["\u2190 ", t("Back")] }) }), _jsxs("div", { className: "page-header-text", children: [_jsx("p", { className: "page-kicker", children: t("Content") }), _jsxs("h1", { className: "page-title", children: [t("Region:"), " ", regionKey] }), _jsx("p", { className: "page-description", children: t("Manage which widgets appear in this region and their order.") })] }), _jsx(WidgetRegionEditorHeaderActions, { message: message, error: error, saving: saving, onSave: save, t: t })] }), _jsxs("div", { className: "widget-region-placements", children: [placements.length === 0 ? (_jsx("div", { className: "card", children: _jsx("div", { className: "empty-state", children: _jsx("p", { children: t("No widgets placed in this region yet.") }) }) })) : (placements.map((placement, i) => (_jsx("div", { className: "menu-item-row", children: _jsxs("div", { className: "menu-item-fields", children: [placement.broken ? (_jsx("span", { className: "widget-embed-node--broken", children: t("⚠ Broken reference") })) : (_jsxs("span", { children: [_jsx("strong", { children: placement.widgetTitle }), placement.widgetType ? (_jsxs(_Fragment, { children: [" ", _jsxs("span", { className: "muted-cell", children: ["(", widgetTypeLabel({ widgetType: placement.widgetType, types: widgetTypes }, { t }), ")"] })] })) : null] })), _jsxs("label", { children: [_jsx("input", { type: "checkbox", checked: placement.enabled, onChange: () => toggleEnabled(placement.placementId), ...agentHandle({ handle: `${placementHandles[i]}-enabled` }, { role: "field", label: `Whether "${placement.widgetTitle}" is enabled` }) }), t("Enabled")] }), _jsx("button", { className: "tb-btn", onClick: () => moveAt(i, -1), title: t("Move up"), "aria-label": t("Move up"), ...agentHandle({ handle: `${placementHandles[i]}-move-up` }, { role: "button", label: `Move "${placement.widgetTitle}" up` }), children: "\u2191" }), _jsx("button", { className: "tb-btn", onClick: () => moveAt(i, 1), title: t("Move down"), "aria-label": t("Move down"), ...agentHandle({ handle: `${placementHandles[i]}-move-down` }, { role: "button", label: `Move "${placement.widgetTitle}" down` }), children: "\u2193" }), _jsx("button", { className: "tb-btn", onClick: () => removeAt(placement.placementId), title: t("Remove"), "aria-label": t("Remove"), ...agentHandle({ handle: `${placementHandles[i]}-remove` }, { role: "button", label: `Remove "${placement.widgetTitle}" from this region` }), children: "\u2715" })] }) }, placement.placementId)))), _jsx(WidgetAddControl, { triggerLabel: t("+ Add widget"), onResolved: (widgetInstanceId) => addPlacement(widgetInstanceId), agentHandle: "widget-region-add" })] })] }));
23
+ }
24
+ export default WidgetRegionEditor;
25
+ //# sourceMappingURL=WidgetRegionEditor.js.map
@@ -0,0 +1,21 @@
1
+ import { useWiredWidgetRegions } from "../hooks/use-widget-regions.hooks.js";
2
+ /**
3
+ * @file `WidgetRegionsScreen` (`ui.spec.md` §2.4/§3.6/§4.5/§9) — `/admin/widgets/regions` — markup
4
+ * only. Lists currently-bound regions; the bind-new-region control is a free-text `regionKey`
5
+ * input, mirroring `Menus.tsx`'s location-assign control exactly (no "theme declares regions" list
6
+ * API exists to source a dropdown from — `ThemeManifest.regions` is read server-side at render
7
+ * time, not exposed as an admin-listable registry; see `ui.spec.md` §9's disclosed dependency-gap
8
+ * note).
9
+ *
10
+ * State, the fetch, and bind live in `../hooks/use-widget-regions.hooks.ts`.
11
+ */
12
+ export interface WidgetRegionsProps {
13
+ /**
14
+ * Dependency injection seam for tests — the same convention `Posts.tsx`'s `usePostsHook` uses.
15
+ * Defaulted to the real hook, so production callers pass nothing and behave exactly as before.
16
+ */
17
+ useWidgetRegionsHook?: typeof useWiredWidgetRegions | undefined;
18
+ }
19
+ export declare function WidgetRegions({ useWidgetRegionsHook }?: WidgetRegionsProps): import("react").JSX.Element;
20
+ export default WidgetRegions;
21
+ //# sourceMappingURL=WidgetRegions.d.ts.map