@jini-ai/ui 0.3.13 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (334) hide show
  1. package/CHANGELOG.md +139 -0
  2. package/README.md +120 -26
  3. package/dist/browser/index.js +1 -1
  4. package/dist/browser/useDismissOnOutsideOrEscape.d.ts +10 -1
  5. package/dist/browser/useDismissOnOutsideOrEscape.js +7 -4
  6. package/dist/browser/useGlobalKeydown.d.ts +14 -2
  7. package/dist/browser/useGlobalKeydown.js +8 -17
  8. package/dist/features/a2ui/catalog-from-registry.d.ts +6 -3
  9. package/dist/features/a2ui/catalog-from-registry.js +1 -1
  10. package/dist/features/a2ui/index.d.ts +1 -1
  11. package/dist/features/a2ui/protocol.d.ts +1 -1
  12. package/dist/features/a2ui/renderer.js +23 -10
  13. package/dist/features/a2ui/use-a2ui-surface.d.ts +11 -6
  14. package/dist/features/a2ui/use-a2ui-surface.js +40 -10
  15. package/dist/features/admin-widgets/components/ComingSoonNotice.d.ts +11 -0
  16. package/dist/features/admin-widgets/components/ComingSoonNotice.js +7 -0
  17. package/dist/features/admin-widgets/components/ComingSoonPanel.d.ts +10 -0
  18. package/dist/features/admin-widgets/components/ComingSoonPanel.js +10 -0
  19. package/dist/features/admin-widgets/components/ImagePreviewModal.d.ts +16 -0
  20. package/dist/features/admin-widgets/components/ImagePreviewModal.hooks.d.ts +13 -0
  21. package/dist/features/admin-widgets/components/ImagePreviewModal.hooks.js +46 -0
  22. package/dist/features/admin-widgets/components/ImagePreviewModal.js +13 -0
  23. package/dist/features/admin-widgets/components/InfoTip.d.ts +18 -0
  24. package/dist/features/admin-widgets/components/InfoTip.hooks.d.ts +16 -0
  25. package/dist/features/admin-widgets/components/InfoTip.hooks.js +45 -0
  26. package/dist/features/admin-widgets/components/InfoTip.js +12 -0
  27. package/dist/features/admin-widgets/components/SeeMore/SeeMore.d.ts +41 -0
  28. package/dist/features/admin-widgets/components/SeeMore/SeeMore.hooks.d.ts +14 -0
  29. package/dist/features/admin-widgets/components/SeeMore/SeeMore.hooks.js +57 -0
  30. package/dist/features/admin-widgets/components/SeeMore/SeeMore.js +24 -0
  31. package/dist/features/admin-widgets/components/Select/Select.d.ts +39 -0
  32. package/dist/features/admin-widgets/components/Select/Select.hooks.d.ts +105 -0
  33. package/dist/features/admin-widgets/components/Select/Select.hooks.js +359 -0
  34. package/dist/features/admin-widgets/components/Select/Select.js +46 -0
  35. package/dist/features/admin-widgets/index.d.ts +20 -0
  36. package/dist/features/admin-widgets/index.js +11 -0
  37. package/dist/features/admin-widgets/styles/admin-widgets.css +2 -0
  38. package/dist/features/appearance/constants.d.ts +2 -2
  39. package/dist/features/appearance/constants.js +2 -1
  40. package/dist/features/appearance/react/components/AppearanceTab.js +5 -5
  41. package/dist/features/appearance/rules.d.ts +10 -4
  42. package/dist/features/appearance/rules.js +5 -5
  43. package/dist/features/appearance/types.d.ts +1 -1
  44. package/dist/features/appearance/types.js +1 -1
  45. package/dist/features/asset-grid/react/components/AssetGrid.js +1 -1
  46. package/dist/features/asset-grid/react/components/DeleteConfirmDialog.js +1 -1
  47. package/dist/features/asset-grid/react/hooks/useAssetGridKeyboardShortcuts.js +23 -21
  48. package/dist/features/asset-grid/react/hooks/useAssetGridLiveUpdates.d.ts +1 -1
  49. package/dist/features/asset-grid/react/hooks/useAssetGridLiveUpdates.js +1 -1
  50. package/dist/features/asset-tree-browser/ports.d.ts +3 -1
  51. package/dist/features/asset-tree-browser/react/hooks/useAssetTreeCopyLocalPath.js +1 -1
  52. package/dist/features/browser-chrome/react/components/BrowserViewportControls.js +1 -1
  53. package/dist/features/browser-chrome/types.js +1 -1
  54. package/dist/features/command-palette/ports.js +1 -1
  55. package/dist/features/connectors/ConnectorsBrowser.js +2 -2
  56. package/dist/features/connectors/components/ConnectorCard.js +3 -3
  57. package/dist/features/connectors/components/ConnectorDetailDrawer.js +1 -1
  58. package/dist/features/connectors/components/ConnectorGrid.js +2 -2
  59. package/dist/features/connectors/components/ConnectorSearchBar.js +2 -2
  60. package/dist/features/connectors/components/ProviderTabBar.js +2 -2
  61. package/dist/features/connectors/constants.d.ts +1 -1
  62. package/dist/features/connectors/constants.js +1 -1
  63. package/dist/features/connectors/hooks/useConnectorAuthorization.js +1 -1
  64. package/dist/features/connectors/rules.d.ts +2 -2
  65. package/dist/features/connectors/rules.js +1 -1
  66. package/dist/features/connectors/types.d.ts +2 -2
  67. package/dist/features/connectors/types.js +1 -1
  68. package/dist/features/execution/react/components/ByokProviderForm.js +3 -3
  69. package/dist/features/execution/react/components/ExecutionTab.js +2 -2
  70. package/dist/features/execution/react/components/LocalCliAgentCard.js +3 -3
  71. package/dist/features/execution/react/components/LocalCliAgentList.js +2 -2
  72. package/dist/features/execution/react/components/ProviderChipGroup.js +2 -2
  73. package/dist/features/execution/react/components/SearchableModelSelect.js +1 -1
  74. package/dist/features/execution/rules.js +1 -1
  75. package/dist/features/file-dropzone/react/components/FileDropzone.js +5 -3
  76. package/dist/features/file-dropzone/react/hooks/useFileDropzone.d.ts +1 -1
  77. package/dist/features/file-dropzone/react/hooks/useFileDropzone.js +1 -1
  78. package/dist/features/file-dropzone/types.d.ts +1 -1
  79. package/dist/features/file-dropzone/types.js +1 -1
  80. package/dist/features/folder-path-drop/react/hooks/useFolderPathDropCapture.js +6 -4
  81. package/dist/features/html-editor/canvas-content-wrapper.js +1 -1
  82. package/dist/features/html-editor/canvas-embed-placeholders.js +7 -7
  83. package/dist/features/html-editor/canvas-style.d.ts +4 -0
  84. package/dist/features/html-editor/canvas-style.js +6 -21
  85. package/dist/features/html-viewer/constants.d.ts +1 -1
  86. package/dist/features/html-viewer/constants.js +1 -1
  87. package/dist/features/html-viewer/react/components/PresentMenu.js +1 -1
  88. package/dist/features/html-viewer/react/components/ZoomMenu.js +1 -1
  89. package/dist/features/html-viewer/types.d.ts +1 -1
  90. package/dist/features/html-viewer/types.js +1 -1
  91. package/dist/features/i18n/dictionaries/index.d.ts +2 -3
  92. package/dist/features/i18n/dictionaries/settings-dialog.en.d.ts +1 -1
  93. package/dist/features/i18n/dictionary-translator.d.ts +16 -0
  94. package/dist/features/i18n/dictionary-translator.js +14 -0
  95. package/dist/features/i18n/index.d.ts +3 -0
  96. package/dist/features/i18n/index.js +2 -0
  97. package/dist/features/i18n/locale.d.ts +1 -1
  98. package/dist/features/i18n/template-i18n.d.ts +26 -0
  99. package/dist/features/i18n/template-i18n.js +36 -0
  100. package/dist/features/iframe-pool/react/components/IframeKeepAliveProvider.d.ts +1 -1
  101. package/dist/features/iframe-pool/react/components/IframeKeepAliveProvider.js +1 -1
  102. package/dist/features/instructions/react/components/InstructionsTab.js +1 -1
  103. package/dist/features/integrations/react/components/ClientPicker.js +4 -4
  104. package/dist/features/integrations/react/components/CodexInstallToggleButton.js +1 -1
  105. package/dist/features/integrations/react/components/IntegrationsTab.js +2 -2
  106. package/dist/features/integrations/react/components/SnippetBlock.js +1 -1
  107. package/dist/features/integrations/types.d.ts +1 -1
  108. package/dist/features/integrations/types.js +1 -1
  109. package/dist/features/interactive-ui/index.js +13 -13
  110. package/dist/features/interactive-ui/interactive-ui.css +1 -1
  111. package/dist/features/interactive-ui/providers/recharts/bar-chart.js +1 -1
  112. package/dist/features/interactive-ui/providers/recharts/line-chart.js +1 -1
  113. package/dist/features/interactive-ui/providers/recharts/pie-chart.js +2 -2
  114. package/dist/features/interactive-ui/providers/shadcn/lib/utils.d.ts +1 -1
  115. package/dist/features/interactive-ui/providers/shadcn/lib/utils.js +1 -1
  116. package/dist/features/interactive-ui/registry.d.ts +15 -4
  117. package/dist/features/interactive-ui/registry.js +5 -5
  118. package/dist/features/language/react/components/LanguageTab.js +2 -2
  119. package/dist/features/list-detail-panel/types.d.ts +1 -1
  120. package/dist/features/list-detail-panel/types.js +1 -1
  121. package/dist/features/mcp-ui/confirmation-store.js +2 -1
  122. package/dist/features/mcp-ui/surfaces/bridge.d.ts +2 -1
  123. package/dist/features/mcp-ui/surfaces/bridge.js +17 -7
  124. package/dist/features/mcp-ui/surfaces/confirmation.d.ts +20 -0
  125. package/dist/features/mcp-ui/surfaces/confirmation.js +38 -6
  126. package/dist/features/mcp-ui/surfaces/document.d.ts +7 -1
  127. package/dist/features/mcp-ui/surfaces/document.js +19 -1
  128. package/dist/features/mcp-ui/surfaces/text-input.js +4 -4
  129. package/dist/features/mcp-ui/surfaces/tokens.d.ts +17 -20
  130. package/dist/features/mcp-ui/surfaces/tokens.js +33 -35
  131. package/dist/features/media-providers/index.d.ts +1 -1
  132. package/dist/features/media-providers/index.js +1 -1
  133. package/dist/features/media-providers/react/components/MediaProvidersTab.js +4 -4
  134. package/dist/features/media-providers/rules.js +1 -1
  135. package/dist/features/memory/async-commit-guard.d.ts +1 -1
  136. package/dist/features/memory/constants.d.ts +1 -1
  137. package/dist/features/memory/constants.js +1 -1
  138. package/dist/features/memory/dependencies.d.ts +11 -23
  139. package/dist/features/memory/dependencies.js +116 -106
  140. package/dist/features/memory/index.d.ts +1 -1
  141. package/dist/features/memory/index.js +1 -1
  142. package/dist/features/memory/react/components/MemoryAdvancedModal.js +2 -2
  143. package/dist/features/memory/react/components/MemoryEntryCard.js +1 -1
  144. package/dist/features/memory/react/components/MemoryExtractionCard.js +1 -1
  145. package/dist/features/memory/react/components/MemoryHooksPanel.js +1 -1
  146. package/dist/features/memory/react/components/MemoryList.js +5 -5
  147. package/dist/features/memory/react/components/MemoryManualEditor.js +5 -5
  148. package/dist/features/memory/react/components/MemorySettingsPanel.js +1 -1
  149. package/dist/features/memory/react/hooks/useMemoryEntries.hooks.js +1 -1
  150. package/dist/features/memory/react/hooks/useMemoryNavigation.hooks.js +1 -1
  151. package/dist/features/memory/react/styles.js +1 -1
  152. package/dist/features/memory/rules.js +1 -1
  153. package/dist/features/memory/types.d.ts +1 -1
  154. package/dist/features/mention-autocomplete/react/hooks/useMentionAutocomplete.js +1 -1
  155. package/dist/features/notifications/react/components/NotificationsTab.js +7 -7
  156. package/dist/features/notifications/types.d.ts +1 -1
  157. package/dist/features/observability/boot-timing.js +2 -2
  158. package/dist/features/observability/stuck-run.js +1 -1
  159. package/dist/features/observability/white-screen.js +4 -4
  160. package/dist/features/panel-kit/fetch-query/adapter.react.d.ts +35 -0
  161. package/dist/features/panel-kit/fetch-query/adapter.react.js +122 -0
  162. package/dist/features/panel-kit/fetch-query/cache.d.ts +123 -0
  163. package/dist/features/panel-kit/fetch-query/cache.js +231 -0
  164. package/dist/features/panel-kit/fetch-query/environment.browser.d.ts +4 -0
  165. package/dist/features/panel-kit/fetch-query/environment.browser.js +25 -0
  166. package/dist/features/panel-kit/fetch-query/index.d.ts +4 -0
  167. package/dist/features/panel-kit/fetch-query/index.js +2 -0
  168. package/dist/features/panel-kit/fetch-query/types.d.ts +91 -0
  169. package/dist/features/panel-kit/fetch-query/types.js +2 -0
  170. package/dist/features/panel-kit/helpers/format-timestamp.d.ts +18 -0
  171. package/dist/features/panel-kit/helpers/format-timestamp.js +20 -0
  172. package/dist/features/panel-kit/helpers/permissions.d.ts +11 -0
  173. package/dist/features/panel-kit/helpers/permissions.js +10 -0
  174. package/dist/features/panel-kit/helpers/resolve-active-tab-id.d.ts +13 -0
  175. package/dist/features/panel-kit/helpers/resolve-active-tab-id.js +13 -0
  176. package/dist/features/panel-kit/helpers/retry-unreachable.d.ts +20 -0
  177. package/dist/features/panel-kit/helpers/retry-unreachable.js +39 -0
  178. package/dist/features/panel-kit/hooks/use-async-action.hooks.d.ts +13 -0
  179. package/dist/features/panel-kit/hooks/use-async-action.hooks.js +27 -0
  180. package/dist/features/panel-kit/hooks/use-dirty-guard.hooks.d.ts +18 -0
  181. package/dist/features/panel-kit/hooks/use-dirty-guard.hooks.js +33 -0
  182. package/dist/features/panel-kit/hooks/use-focus-trap.hooks.d.ts +8 -0
  183. package/dist/features/panel-kit/hooks/use-focus-trap.hooks.js +66 -0
  184. package/dist/features/panel-kit/hooks/use-serial-writes.hooks.d.ts +26 -0
  185. package/dist/features/panel-kit/hooks/use-serial-writes.hooks.js +41 -0
  186. package/dist/features/panel-kit/hooks/use-settlement-generation.hooks.d.ts +9 -0
  187. package/dist/features/panel-kit/hooks/use-settlement-generation.hooks.js +25 -0
  188. package/dist/features/panel-kit/index.d.ts +19 -0
  189. package/dist/features/panel-kit/index.js +13 -0
  190. package/dist/features/privacy/react/components/PrivacyTab.js +2 -2
  191. package/dist/features/privacy/types.d.ts +1 -1
  192. package/dist/features/privacy/types.js +1 -1
  193. package/dist/features/progress-card/reference-adapters.d.ts +1 -1
  194. package/dist/features/progress-card/rules.d.ts +1 -1
  195. package/dist/features/progress-card/rules.js +1 -1
  196. package/dist/features/progress-card/types.d.ts +1 -1
  197. package/dist/features/progress-card/types.js +1 -1
  198. package/dist/features/resource-dashboard/dependencies.d.ts +1 -1
  199. package/dist/features/resource-dashboard/ports.d.ts +1 -1
  200. package/dist/features/resource-dashboard/react/hooks/useResourceBoard.d.ts +1 -1
  201. package/dist/features/resource-dashboard/react/hooks/useResourceBoard.js +1 -1
  202. package/dist/features/resource-dashboard/rules.d.ts +1 -1
  203. package/dist/features/resource-dashboard/rules.js +2 -2
  204. package/dist/features/resource-dashboard/types.d.ts +4 -4
  205. package/dist/features/resource-dashboard/types.js +1 -1
  206. package/dist/features/schedule-picker/react/hooks/useRecurringSchedulePicker.js +1 -1
  207. package/dist/features/settings/dialog/styles/settings-dialog.css +62 -60
  208. package/dist/features/sketch-editor/constants.d.ts +1 -1
  209. package/dist/features/sketch-editor/constants.js +1 -1
  210. package/dist/features/sketch-editor/dom.d.ts +1 -1
  211. package/dist/features/sketch-editor/dom.js +1 -1
  212. package/dist/features/sketch-editor/react/hooks/useSketchDomEnhancements.d.ts +1 -1
  213. package/dist/features/sketch-editor/react/hooks/useSketchDomEnhancements.js +11 -9
  214. package/dist/features/sketch-editor/types.d.ts +1 -1
  215. package/dist/features/sketch-editor/types.js +1 -1
  216. package/dist/features/skills/react/components/SkillDraftForm.js +1 -1
  217. package/dist/features/skills/react/components/SkillRow.js +1 -1
  218. package/dist/features/skills/react/components/SkillsTab.js +2 -2
  219. package/dist/features/source-config-list/agent-handles.js +2 -2
  220. package/dist/features/source-config-list/react/hooks/useSourceConfigAddForm.d.ts +1 -1
  221. package/dist/features/source-config-list/react/hooks/useSourceConfigAddForm.js +1 -1
  222. package/dist/features/source-config-list/rules.d.ts +1 -1
  223. package/dist/features/source-config-list/rules.js +3 -3
  224. package/dist/features/source-config-list/types.d.ts +1 -1
  225. package/dist/features/source-config-list/types.js +1 -1
  226. package/dist/features/tab-launcher-menu/react/hooks/useTabLauncherMenu.js +1 -1
  227. package/dist/features/tab-strip/index.d.ts +4 -0
  228. package/dist/features/tab-strip/index.js +2 -0
  229. package/dist/features/tab-strip/react/components/TabBar.d.ts +23 -0
  230. package/dist/features/tab-strip/react/components/TabBar.hooks.d.ts +25 -0
  231. package/dist/features/tab-strip/react/components/TabBar.hooks.js +57 -0
  232. package/dist/features/tab-strip/react/components/TabBar.js +18 -0
  233. package/dist/features/tab-strip/react/components/TabStrip.js +2 -1
  234. package/dist/features/tab-strip/react/components/TabStripFrame.d.ts +3 -0
  235. package/dist/features/tab-strip/react/components/TabStripFrame.js +7 -0
  236. package/dist/features/tabbed-dialog/react/hooks/useTabbedDialog.js +1 -1
  237. package/dist/features/tabbed-dialog/styles/tabbed-dialog.css +8 -141
  238. package/dist/features/tabbed-dialog/types.d.ts +1 -1
  239. package/dist/features/tabbed-dialog/types.js +1 -1
  240. package/dist/features/version-manager/ports.d.ts +1 -1
  241. package/dist/features/version-manager/react/components/VersionPromptPopover.js +5 -3
  242. package/dist/features/version-manager/react/components/VersionRestoreControl.js +1 -1
  243. package/dist/features/version-manager/types.d.ts +1 -1
  244. package/dist/features/version-manager/types.js +1 -1
  245. package/dist/features/viewer-shell/dependencies.js +1 -1
  246. package/dist/features/viewer-shell/ports.d.ts +1 -1
  247. package/dist/features/viewer-shell/react/components/ViewportSwitcher.js +1 -1
  248. package/dist/features/viewer-shell/react/hooks/useMarkdownScrollSync.d.ts +1 -1
  249. package/dist/features/viewer-shell/react/hooks/useMarkdownScrollSync.js +1 -1
  250. package/dist/features/viewer-shell/types.d.ts +1 -1
  251. package/dist/features/viewer-shell/types.js +1 -1
  252. package/dist/index.d.ts +420 -0
  253. package/dist/index.js +421 -1
  254. package/dist/react/components/ComponentKitPreview.js +1 -1
  255. package/dist/react/components/EditorIcon.d.ts +1 -1
  256. package/dist/react/components/EditorIcon.js +22 -22
  257. package/dist/react/components/ExportDiagnosticsButton.d.ts +8 -1
  258. package/dist/react/components/ExportDiagnosticsButton.js +6 -6
  259. package/dist/react/components/PaletteTweaks.js +5 -5
  260. package/dist/react/hooks/useBrandFonts.d.ts +19 -4
  261. package/dist/react/hooks/useBrandFonts.js +11 -7
  262. package/dist/react/hooks/useDebouncedValue.d.ts +12 -1
  263. package/dist/react/hooks/useDebouncedValue.js +9 -4
  264. package/dist/react/hooks/useStableHandler.d.ts +3 -1
  265. package/dist/react/hooks/useStableHandler.js +1 -1
  266. package/dist/renderers/annotation-canvas/drawing.d.ts +4 -4
  267. package/dist/renderers/annotation-canvas/drawing.js +28 -15
  268. package/dist/renderers/annotation-canvas/react/components/AnnotationCanvas.js +2 -2
  269. package/dist/renderers/annotation-canvas/react/hooks/useAnnotationCanvas.js +4 -3
  270. package/dist/renderers/annotation-canvas/rules.d.ts +1 -1
  271. package/dist/renderers/annotation-canvas/theme.d.ts +13 -0
  272. package/dist/renderers/annotation-canvas/theme.js +16 -0
  273. package/dist/renderers/annotation-canvas/types.d.ts +1 -1
  274. package/dist/renderers/index.d.ts +1 -1
  275. package/dist/renderers/new-tab-preview.d.ts +3 -0
  276. package/dist/renderers/new-tab-preview.js +3 -1
  277. package/dist/renderers/preview-modal-shell/react/hooks/usePreviewModalShell.d.ts +1 -1
  278. package/dist/renderers/preview-modal-shell/react/hooks/usePreviewModalShell.js +1 -1
  279. package/dist/renderers/preview-modal-shell/rules.d.ts +1 -1
  280. package/dist/renderers/preview-modal-shell/types.d.ts +3 -3
  281. package/dist/renderers/preview-modal-shell/types.js +2 -2
  282. package/dist/renderers/react/components/ArtifactView.d.ts +1 -1
  283. package/dist/renderers/react/components/ArtifactView.js +1 -1
  284. package/dist/renderers/registry.d.ts +12 -6
  285. package/dist/renderers/registry.js +7 -9
  286. package/dist/renderers/renderers/html.js +2 -2
  287. package/dist/renderers/renderers/index.js +1 -1
  288. package/dist/renderers/renderers/markdown.js +2 -2
  289. package/dist/renderers/renderers/react-component.js +1 -1
  290. package/dist/renderers/renderers/svg.js +1 -1
  291. package/dist/renderers/shiki.js +1 -1
  292. package/dist/renderers/srcdoc/build.d.ts +1 -1
  293. package/dist/renderers/srcdoc/build.js +1 -1
  294. package/dist/renderers/url-load-decision.d.ts +1 -1
  295. package/dist/renderers/url-load-decision.js +1 -1
  296. package/dist/styles/admin.css +273 -0
  297. package/dist/styles/variables.css +117 -0
  298. package/dist/theme/apply.d.ts +9 -0
  299. package/dist/theme/apply.js +77 -0
  300. package/dist/theme/color-scheme.d.ts +8 -0
  301. package/dist/theme/color-scheme.js +9 -0
  302. package/dist/theme/default.d.ts +4 -0
  303. package/dist/theme/default.js +11 -0
  304. package/dist/theme/index.d.ts +6 -0
  305. package/dist/theme/index.js +5 -0
  306. package/dist/theme/stylesheet.d.ts +8 -0
  307. package/dist/theme/stylesheet.js +14 -0
  308. package/dist/theme/types.d.ts +39 -0
  309. package/dist/theme/types.js +2 -0
  310. package/dist/theme/validation.d.ts +15 -0
  311. package/dist/theme/validation.js +55 -0
  312. package/dist/utils/appearance.js +1 -1
  313. package/dist/utils/browser-request.d.ts +12 -0
  314. package/dist/utils/browser-request.js +10 -0
  315. package/dist/utils/color-math.d.ts +20 -6
  316. package/dist/utils/color-math.js +12 -12
  317. package/dist/utils/copy-to-clipboard.d.ts +19 -8
  318. package/dist/utils/copy-to-clipboard.js +15 -11
  319. package/dist/utils/dom-subscriptions.js +1 -1
  320. package/dist/utils/endpoint-policy.d.ts +9 -3
  321. package/dist/utils/endpoint-policy.js +5 -5
  322. package/dist/utils/markdown-scroll-sync.js +3 -3
  323. package/dist/utils/notifications.d.ts +1 -1
  324. package/dist/utils/notifications.js +1 -1
  325. package/dist/utils/polygon-selection.d.ts +1 -1
  326. package/dist/utils/polygon-selection.js +1 -1
  327. package/dist/utils/scroll-tabs-with-wheel.d.ts +4 -1
  328. package/dist/utils/scroll-tabs-with-wheel.js +1 -1
  329. package/dist/utils/smooth-scroll-to-top.js +1 -1
  330. package/dist/utils/sse.d.ts +3 -1
  331. package/dist/utils/sse.js +1 -1
  332. package/package.json +105 -16
  333. package/dist/features/lexical-rich-text-editor/react/test-support/lexical-harness.d.ts +0 -11
  334. package/dist/features/lexical-rich-text-editor/react/test-support/lexical-harness.js +0 -35
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Keep the contract independent of any query library so an adapter swap does not require
3
+ * rewriting callers. Add narrow required capabilities here rather than exporting library
4
+ * result/client types that would bypass this boundary.
5
+ */
6
+ /**
7
+ * Keys contain primitive array parts so parameterised resources compose without fragile
8
+ * string formatting or object-identity mismatches. Invalidation matches by PREFIX: a list
9
+ * key also refreshes its derived child keys. Exact-key equality would compile while quietly
10
+ * breaking that guarantee; avoid a shared prefix for resources that merely sound related,
11
+ * or writes will fan out unnecessary refetches.
12
+ */
13
+ export type QueryKey = readonly (string | number)[];
14
+ export type QueryStatus = "loading" | "success" | "error";
15
+ export interface QueryResult<T> {
16
+ data: T | undefined;
17
+ error: Error | null;
18
+ status: QueryStatus;
19
+ isFetching: boolean;
20
+ refetch: () => void;
21
+ }
22
+ export interface FetchQueryOptions<T> {
23
+ key: QueryKey;
24
+ fetch: () => Promise<T>;
25
+ /**
26
+ * Gate on user intent or prerequisites to avoid fetching an undefined id. Disabling does
27
+ * not erase cached failures: without any successful data, report loading/error:null so
28
+ * a gesture-gated read cannot show an old failure before the user asks for it. With
29
+ * earlier data, report success but retain a later background error so known-stale data
30
+ * need not be presented as an unqualified success.
31
+ */
32
+ enabled?: boolean;
33
+ staleTime?: number;
34
+ refetchOnWindowFocus?: boolean;
35
+ }
36
+ export type MutationStatus = "idle" | "pending" | "success" | "error";
37
+ export interface MutationResult<TInput, TOutput> {
38
+ /**
39
+ * Awaiting the write receives its result or rejection; discarding the same promise and
40
+ * reading state is safe because it already has a rejection handler. Returning a bare
41
+ * rejecting promise would make only the awaiting form safe. Node unhandledRejection
42
+ * can verify this contract even where a DOM unhandledrejection event does not fire.
43
+ */
44
+ mutate: (required: {
45
+ input: TInput;
46
+ }) => Promise<TOutput>;
47
+ status: MutationStatus;
48
+ error: Error | null;
49
+ reset: () => void;
50
+ }
51
+ export interface FetchMutationOptions<TInput, TOutput> {
52
+ run: (required: {
53
+ input: TInput;
54
+ }) => Promise<TOutput>;
55
+ invalidates?: readonly QueryKey[];
56
+ }
57
+ /**
58
+ * Keep key and fetch references stable: they are memo dependencies of the loader handle.
59
+ * Failed fetches reject and are not cached, so the next load retries instead of replaying
60
+ * a failure as data. Retain an idle value at least as long as its declared freshness: an
61
+ * imperative loader has no persistent observer to keep it alive.
62
+ */
63
+ export interface CachedLoaderOptions<T> {
64
+ key: QueryKey;
65
+ fetch: () => Promise<T>;
66
+ staleTime?: number;
67
+ }
68
+ /**
69
+ * A plain promise loader serves components that own their loading UI rather than consuming
70
+ * a hook result. It shares the provider cache, including one in-flight request per key.
71
+ */
72
+ export interface CachedLoader<T> {
73
+ peek: () => T | undefined;
74
+ load: () => Promise<T>;
75
+ replace: (required: {
76
+ value: T;
77
+ }) => void;
78
+ }
79
+ /**
80
+ * Keep the provider-facing hooks, loader and invalidator behind one binding so replacing
81
+ * the cache implementation does not leave different consumers on different adapters.
82
+ */
83
+ export interface FetchQueryAdapter {
84
+ useFetchQuery: <T>(required: Pick<FetchQueryOptions<T>, "key" | "fetch">, optional?: Omit<FetchQueryOptions<T>, "key" | "fetch">) => QueryResult<T>;
85
+ useFetchMutation: <TInput, TOutput>(required: Pick<FetchMutationOptions<TInput, TOutput>, "run">, optional?: Omit<FetchMutationOptions<TInput, TOutput>, "run">) => MutationResult<TInput, TOutput>;
86
+ useInvalidate: () => (required: {
87
+ key: QueryKey;
88
+ }) => void;
89
+ useCachedLoader: <T>(required: Pick<CachedLoaderOptions<T>, "key" | "fetch">, optional?: Omit<CachedLoaderOptions<T>, "key" | "fetch">) => CachedLoader<T>;
90
+ }
91
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Centralize the historical fixed-width display so formatting changes have one owner. Preserve
3
+ * the stored timestamp's prefix byte for byte: no parsing, locale formatting or timezone conversion.
4
+ * Trailing seconds, milliseconds and zone suffix are intentionally dropped; callers supply ISO text.
5
+ */
6
+ /** Render the ISO prefix as YYYY-MM-DD HH:MM without timezone conversion. */
7
+ export declare function formatTimestamp({ iso }: {
8
+ iso: string;
9
+ }): string;
10
+ /** Inject 'now' to keep relative-time display deterministic. The fallback wording uses simple
11
+ * English singular/plural templates; hosts can translate them, but this is not full locale pluralization. */
12
+ export declare function formatRelativeMinutesAgo({ iso, nowMs }: {
13
+ iso: string;
14
+ nowMs: number;
15
+ }, { translate }?: {
16
+ translate?: ((key: string) => string) | undefined;
17
+ }): string;
18
+ //# sourceMappingURL=format-timestamp.d.ts.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Centralize the historical fixed-width display so formatting changes have one owner. Preserve
3
+ * the stored timestamp's prefix byte for byte: no parsing, locale formatting or timezone conversion.
4
+ * Trailing seconds, milliseconds and zone suffix are intentionally dropped; callers supply ISO text.
5
+ */
6
+ /** Render the ISO prefix as YYYY-MM-DD HH:MM without timezone conversion. */
7
+ export function formatTimestamp({ iso }) {
8
+ return iso.slice(0, 16).replace("T", " ");
9
+ }
10
+ /** Inject 'now' to keep relative-time display deterministic. The fallback wording uses simple
11
+ * English singular/plural templates; hosts can translate them, but this is not full locale pluralization. */
12
+ export function formatRelativeMinutesAgo({ iso, nowMs }, { translate = (key) => key } = {}) {
13
+ const minutes = Math.max(0, Math.round((nowMs - new Date(iso).getTime()) / 60000));
14
+ if (minutes < 1)
15
+ return translate("less than a minute ago");
16
+ if (minutes === 1)
17
+ return translate("1 minute ago");
18
+ return translate("{minutes} minutes ago").replace(/\{minutes\}/g, String(minutes));
19
+ }
20
+ //# sourceMappingURL=format-timestamp.js.map
@@ -0,0 +1,11 @@
1
+ /** UI affordance check for exact grants or the literal * wildcard; server authorization remains host-owned. */
2
+ /**
3
+ * A flattened permission list has lost resource scopes and constraints. Treating '*' as an ordinary
4
+ * name would hide every gated control from wildcard holders, but matching it here only controls UI.
5
+ * Never use this helper to authorize an operation: the server must evaluate the full grants again.
6
+ */
7
+ export declare function hasPermission({ permissions, permission }: {
8
+ permissions: readonly string[];
9
+ permission: string;
10
+ }): boolean;
11
+ //# sourceMappingURL=permissions.d.ts.map
@@ -0,0 +1,10 @@
1
+ /** UI affordance check for exact grants or the literal * wildcard; server authorization remains host-owned. */
2
+ /**
3
+ * A flattened permission list has lost resource scopes and constraints. Treating '*' as an ordinary
4
+ * name would hide every gated control from wildcard holders, but matching it here only controls UI.
5
+ * Never use this helper to authorize an operation: the server must evaluate the full grants again.
6
+ */
7
+ export function hasPermission({ permissions, permission }) {
8
+ return permissions.includes("*") || permissions.includes(permission);
9
+ }
10
+ //# sourceMappingURL=permissions.js.map
@@ -0,0 +1,13 @@
1
+ /** Keep an allowed selection or choose the allowed default/first id; an empty list keeps defaultId. */
2
+ /**
3
+ * URL query values can come from stale bookmarks or typos; validating against allowed ids prevents
4
+ * a blank panel. The default is supplied by the caller because some screens compute it from settings.
5
+ * Validate that default too: a computed default can widen the type to string, letting drift from
6
+ * the allowed list type-check successfully. For a nonempty list, the first id keeps the fallback valid.
7
+ */
8
+ export declare function resolveActiveTabId<T extends string>({ tabId, validIds, defaultId }: {
9
+ tabId: string | null | undefined;
10
+ validIds: readonly T[];
11
+ defaultId: T;
12
+ }): T;
13
+ //# sourceMappingURL=resolve-active-tab-id.d.ts.map
@@ -0,0 +1,13 @@
1
+ /** Keep an allowed selection or choose the allowed default/first id; an empty list keeps defaultId. */
2
+ /**
3
+ * URL query values can come from stale bookmarks or typos; validating against allowed ids prevents
4
+ * a blank panel. The default is supplied by the caller because some screens compute it from settings.
5
+ * Validate that default too: a computed default can widen the type to string, letting drift from
6
+ * the allowed list type-check successfully. For a nonempty list, the first id keeps the fallback valid.
7
+ */
8
+ export function resolveActiveTabId({ tabId, validIds, defaultId }) {
9
+ const ids = validIds;
10
+ const safeDefault = ids.includes(defaultId) ? defaultId : (validIds[0] ?? defaultId);
11
+ return tabId && ids.includes(tabId) ? tabId : safeDefault;
12
+ }
13
+ //# sourceMappingURL=resolve-active-tab-id.js.map
@@ -0,0 +1,20 @@
1
+ /** About 60 seconds of waits spans a short restart/redeploy while still bounding downtime reporting. */
2
+ export declare const UNREACHABLE_RETRY_DELAYS_MS: readonly number[];
3
+ /** Duck-type the name: DOMException's instanceof Error result depends on its browser realm. */
4
+ export declare function isAbortError({ error }: {
5
+ error: unknown;
6
+ }): boolean;
7
+ /** Retry only errors classified by the injected predicate, within a bounded delay schedule.
8
+ * Abort cancels a pending wait, but the host remains responsible for cancelling its own request. */
9
+ export declare function retryWhileUnreachable<T>({ load, signal, isUnreachable }: {
10
+ load: () => Promise<T>;
11
+ signal: AbortSignal;
12
+ isUnreachable: (error: unknown) => boolean;
13
+ }, { delaysMs, wait }?: {
14
+ delaysMs?: readonly number[];
15
+ wait?: (required: {
16
+ ms: number;
17
+ signal: AbortSignal;
18
+ }) => Promise<void>;
19
+ }): Promise<T>;
20
+ //# sourceMappingURL=retry-unreachable.d.ts.map
@@ -0,0 +1,39 @@
1
+ /** About 60 seconds of waits spans a short restart/redeploy while still bounding downtime reporting. */
2
+ export const UNREACHABLE_RETRY_DELAYS_MS = [1_000, 2_000, 4_000, 8_000, 15_000, 30_000];
3
+ /** Duck-type the name: DOMException's instanceof Error result depends on its browser realm. */
4
+ export function isAbortError({ error }) {
5
+ return typeof error === "object" && error !== null && error.name === "AbortError";
6
+ }
7
+ /** Clear the timer on abort and detach the listener on completion so unmounts leave no scheduled wait. */
8
+ function waitUnlessAborted(ms, signal) {
9
+ return new Promise((resolve, reject) => {
10
+ const abort = () => {
11
+ clearTimeout(timer);
12
+ reject(new DOMException("retry cancelled", "AbortError"));
13
+ };
14
+ const timer = setTimeout(() => {
15
+ signal.removeEventListener("abort", abort);
16
+ resolve();
17
+ }, ms);
18
+ if (signal.aborted)
19
+ abort();
20
+ else
21
+ signal.addEventListener("abort", abort, { once: true });
22
+ });
23
+ }
24
+ /** Retry only errors classified by the injected predicate, within a bounded delay schedule.
25
+ * Abort cancels a pending wait, but the host remains responsible for cancelling its own request. */
26
+ export async function retryWhileUnreachable({ load, signal, isUnreachable }, { delaysMs = UNREACHABLE_RETRY_DELAYS_MS, wait = ({ ms, signal }) => waitUnlessAborted(ms, signal) } = {}) {
27
+ for (const delayMs of delaysMs) {
28
+ try {
29
+ return await load();
30
+ }
31
+ catch (error) {
32
+ if (!isUnreachable(error))
33
+ throw error;
34
+ }
35
+ await wait({ ms: delayMs, signal });
36
+ }
37
+ return load();
38
+ }
39
+ //# sourceMappingURL=retry-unreachable.js.map
@@ -0,0 +1,13 @@
1
+ import { type Dispatch, type SetStateAction } from "react";
2
+ export interface AsyncActionState {
3
+ saving: boolean;
4
+ error: string | null;
5
+ setError: Dispatch<SetStateAction<string | null>>;
6
+ run: (required: {
7
+ action: () => Promise<void>;
8
+ describeError: (e: unknown) => string;
9
+ }) => Promise<void>;
10
+ }
11
+ /** Expose saving/error state for an action; cancellations stay silent and other failures use caller copy. */
12
+ export declare function useAsyncAction(): AsyncActionState;
13
+ //# sourceMappingURL=use-async-action.hooks.d.ts.map
@@ -0,0 +1,27 @@
1
+ import { useState } from "react";
2
+ import { isAbortError } from "../helpers/retry-unreachable.js";
3
+ /** Expose saving/error state for an action; cancellations stay silent and other failures use caller copy. */
4
+ export function useAsyncAction() {
5
+ const [saving, setSaving] = useState(false);
6
+ const [error, setError] = useState(null);
7
+ async function run({ action, describeError }) {
8
+ // Each screen interprets server codes differently; inject the describer instead of importing
9
+ // one feature's wording. action includes success effects, all completed before saving turns off.
10
+ setSaving(true);
11
+ setError(null);
12
+ try {
13
+ await action();
14
+ }
15
+ catch (e) {
16
+ // An aborted action must not leave a stale failure banner after browser history restoration.
17
+ if (isAbortError({ error: e }))
18
+ return;
19
+ setError(describeError(e));
20
+ }
21
+ finally {
22
+ setSaving(false);
23
+ }
24
+ }
25
+ return { saving, error, setError, run };
26
+ }
27
+ //# sourceMappingURL=use-async-action.hooks.js.map
@@ -0,0 +1,18 @@
1
+ import type { Translate } from "../../i18n/dictionary-translator.js";
2
+ export type DirtyGuardHostPort = Pick<Window, "addEventListener" | "removeEventListener" | "confirm">;
3
+ export interface DirtyGuard {
4
+ isDirty: boolean;
5
+ confirmLeave: (required?: Record<string, never>, optional?: {
6
+ unsavedBeyondTracked?: boolean;
7
+ }) => boolean;
8
+ }
9
+ /** Compare small JSON-serializable form states (including key order). Null original is clean.
10
+ * Warn on unload and offer a translated native confirmation for caller-owned navigation. */
11
+ export declare function useDirtyGuard<T>({ current, original }: {
12
+ current: T;
13
+ original: T | null;
14
+ }, { translate, host }?: {
15
+ translate?: Translate | undefined;
16
+ host?: DirtyGuardHostPort | undefined;
17
+ }): DirtyGuard;
18
+ //# sourceMappingURL=use-dirty-guard.hooks.d.ts.map
@@ -0,0 +1,33 @@
1
+ import { useEffect } from "react";
2
+ // JSON equality is intentionally limited to small form states built with consistent key order.
3
+ // This avoids a general deep-equality dependency; large documents or arbitrary values need another seam.
4
+ function shallowJsonEqual(a, b) {
5
+ return JSON.stringify(a) === JSON.stringify(b);
6
+ }
7
+ /** Compare small JSON-serializable form states (including key order). Null original is clean.
8
+ * Warn on unload and offer a translated native confirmation for caller-owned navigation. */
9
+ export function useDirtyGuard({ current, original }, { translate = (key) => key, host = window } = {}) {
10
+ // beforeunload covers close/reload/browser navigation, but does not fire for in-app routing.
11
+ // Callers must wire confirmLeave to their own navigation actions or edits can be lost silently.
12
+ const isDirty = original !== null && !shallowJsonEqual(current, original);
13
+ useEffect(() => {
14
+ if (!isDirty)
15
+ return;
16
+ function onBeforeUnload(e) {
17
+ e.preventDefault();
18
+ // Both assignments are the standard cross-browser incantation (the returned string is
19
+ // ignored by every modern browser in favor of their own fixed prompt copy, but the property
20
+ // still has to be set for the prompt to appear at all in some engines).
21
+ e.returnValue = "";
22
+ }
23
+ host.addEventListener("beforeunload", onBeforeUnload);
24
+ return () => host.removeEventListener("beforeunload", onBeforeUnload);
25
+ }, [isDirty, host]);
26
+ function confirmLeave(_required = {}, { unsavedBeyondTracked = false } = {}) {
27
+ if (!isDirty && !unsavedBeyondTracked)
28
+ return true;
29
+ return host.confirm(translate("You have unsaved changes. Leave without saving?"));
30
+ }
31
+ return { isDirty, confirmLeave };
32
+ }
33
+ //# sourceMappingURL=use-dirty-guard.hooks.js.map
@@ -0,0 +1,8 @@
1
+ import { type RefObject } from "react";
2
+ /** Trap Tab/Shift+Tab in the most recently activated container; outer traps resume on cleanup. */
3
+ export declare function useFocusTrap({ containerRef }: {
4
+ containerRef: RefObject<HTMLElement | null>;
5
+ }, { active }?: {
6
+ active?: boolean | undefined;
7
+ }): void;
8
+ //# sourceMappingURL=use-focus-trap.hooks.d.ts.map
@@ -0,0 +1,66 @@
1
+ import { useEffect } from "react";
2
+ const FOCUSABLE = [
3
+ "a[href]",
4
+ "button:not([disabled])",
5
+ "input:not([disabled]):not([type='hidden'])",
6
+ "select:not([disabled])",
7
+ "textarea:not([disabled])",
8
+ "[tabindex]:not([tabindex='-1'])",
9
+ ].join(",");
10
+ // aria-modal tells assistive technology that the background is unavailable; without a trap,
11
+ // Tab can still escape to those controls. Share this stack across unrelated components so only
12
+ // the innermost active dialog traps focus, and the outer dialog resumes when it closes.
13
+ const activeTraps = [];
14
+ function isAvailableForFocus(element) {
15
+ if (element.matches(":disabled") || element.closest("[hidden], [inert]"))
16
+ return false;
17
+ const visibility = getComputedStyle(element).visibility;
18
+ if (visibility === "hidden" || visibility === "collapse")
19
+ return false;
20
+ for (let ancestor = element; ancestor; ancestor = ancestor.parentElement) {
21
+ if (getComputedStyle(ancestor).display === "none")
22
+ return false;
23
+ }
24
+ return true;
25
+ }
26
+ function redirectTarget(container, shiftKey) {
27
+ const focusable = Array.from(container.querySelectorAll(FOCUSABLE)).filter(isAvailableForFocus);
28
+ if (focusable.length === 0)
29
+ return null;
30
+ const first = focusable[0];
31
+ const last = focusable[focusable.length - 1];
32
+ const active = document.activeElement;
33
+ if (!(active instanceof Node) || !container.contains(active))
34
+ return shiftKey ? last : first;
35
+ if (shiftKey && active === first)
36
+ return last;
37
+ if (!shiftKey && active === last)
38
+ return first;
39
+ return null;
40
+ }
41
+ /** Trap Tab/Shift+Tab in the most recently activated container; outer traps resume on cleanup. */
42
+ export function useFocusTrap({ containerRef }, { active = true } = {}) {
43
+ useEffect(() => {
44
+ if (!active)
45
+ return;
46
+ activeTraps.push(containerRef);
47
+ function onKeyDown(event) {
48
+ if (event.key !== "Tab" || activeTraps[activeTraps.length - 1] !== containerRef)
49
+ return;
50
+ const container = containerRef.current;
51
+ if (!container)
52
+ return;
53
+ const target = redirectTarget(container, event.shiftKey);
54
+ if (!target)
55
+ return;
56
+ event.preventDefault();
57
+ target.focus();
58
+ }
59
+ document.addEventListener("keydown", onKeyDown);
60
+ return () => {
61
+ document.removeEventListener("keydown", onKeyDown);
62
+ activeTraps.splice(activeTraps.lastIndexOf(containerRef), 1);
63
+ };
64
+ }, [containerRef, active]);
65
+ }
66
+ //# sourceMappingURL=use-focus-trap.hooks.js.map
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Writes on one lane must reach persistence in call order: a later write must not race an
3
+ * earlier one, and rejecting a write must neither poison the lane nor drop queued work.
4
+ * Independent row writes can use separate keys. Cancellation, deduplication and newest-result
5
+ * UI ownership belong to the caller; queued final writes may still be needed after unmount.
6
+ * When composing with useSettlementGeneration, mint the generation BEFORE run({ task }),
7
+ * not inside task: otherwise each delayed task can claim to be current when it finally starts.
8
+ *
9
+ * Even an idle lane starts its task one microtask later, leaving synchronous busy/error and
10
+ * generation bookkeeping ahead of execution. run returns the task's own outcome; internal
11
+ * lane cleanup does not swallow a discarded rejecting promise's unhandled rejection.
12
+ * Re-entrant run calls queue normally, but awaiting an inner call from a task on the same
13
+ * lane deadlocks: the inner task is waiting for the outer task to release that lane.
14
+ */
15
+ export interface SerialWrites {
16
+ /** Each caller observes its own task result or rejection, never the internal lane tail. */
17
+ run<T>({ task }: {
18
+ task: () => Promise<T>;
19
+ }, options?: {
20
+ key?: string;
21
+ }): Promise<T>;
22
+ }
23
+ /** Stable promise lane: queue writes in call order without poisoning later work after rejection.
24
+ * Already queued persistence continues after unmount; callers guard their own state updates. */
25
+ export declare function useSerialWrites(): SerialWrites;
26
+ //# sourceMappingURL=use-serial-writes.hooks.d.ts.map
@@ -0,0 +1,41 @@
1
+ import { useRef } from "react";
2
+ const DEFAULT_LANE = Symbol("useSerialWrites default lane");
3
+ const IDLE = Promise.resolve();
4
+ function createSerialWrites() {
5
+ // Each lane's tail is the promise the NEXT queued task waits on; a lane is dropped from the
6
+ // map once its own tail settles and nothing newer has replaced it, so a keyed caller (only
7
+ // `use-external-mcp.hooks.ts` today) cannot grow this map without bound.
8
+ const tails = new Map();
9
+ return {
10
+ run({ task }, options) {
11
+ const lane = options?.key ?? DEFAULT_LANE;
12
+ const prior = tails.get(lane) ?? IDLE;
13
+ let release;
14
+ const tail = new Promise((resolve) => {
15
+ release = resolve;
16
+ });
17
+ tails.set(lane, tail);
18
+ return prior.then(async () => {
19
+ try {
20
+ return await task();
21
+ }
22
+ finally {
23
+ if (tails.get(lane) === tail)
24
+ tails.delete(lane);
25
+ release();
26
+ }
27
+ });
28
+ },
29
+ };
30
+ }
31
+ /** Stable promise lane: queue writes in call order without poisoning later work after rejection.
32
+ * Already queued persistence continues after unmount; callers guard their own state updates. */
33
+ export function useSerialWrites() {
34
+ // Stable identity over a mutable ref, same reason as `useSettlementGeneration`: several
35
+ // adopting call sites put this in a `useCallback`/`useMemo` dependency list.
36
+ const ref = useRef(undefined);
37
+ if (!ref.current)
38
+ ref.current = createSerialWrites();
39
+ return ref.current;
40
+ }
41
+ //# sourceMappingURL=use-serial-writes.hooks.js.map
@@ -0,0 +1,9 @@
1
+ export interface SettlementGeneration {
2
+ next: () => number;
3
+ isCurrent: (required: {
4
+ generation: number;
5
+ }) => boolean;
6
+ }
7
+ /** Stable monotonic generation handle for rejecting stale asynchronous settlements. */
8
+ export declare function useSettlementGeneration(): SettlementGeneration;
9
+ //# sourceMappingURL=use-settlement-generation.hooks.d.ts.map
@@ -0,0 +1,25 @@
1
+ import { useRef } from "react";
2
+ /** Stable monotonic generation handle for rejecting stale asynchronous settlements. */
3
+ export function useSettlementGeneration() {
4
+ const ref = useRef(0);
5
+ // Same-tick calls must observe each other's increment. A state counter would let both read the
6
+ // pre-commit value. This API models self-minted settlements, not field-edit versions or a counter
7
+ // another operation only peeks at; those ambient guards need their own accurately scoped refs.
8
+ // The returned object's IDENTITY must be stable across renders, not just the counter it closes
9
+ // over: several adopting call sites (`use-access-tokens.hooks.ts`'s `reloadAllStores`, `use-sites
10
+ // .hooks.ts`'s `activate`) are themselves wrapped in a `useCallback` that other code relies on
11
+ // keeping a stable identity (e.g. `triggerReload`, so `useContentRefreshSubscription` doesn't
12
+ // resubscribe on every render) — an object literal rebuilt every render would force either an
13
+ // ESLint exhaustive-deps addition that defeats that memoization, or an intentional lint
14
+ // suppression to omit it. Built once via a lazily-initialized ref, the same "stable handle over a
15
+ // mutable ref" shape `useState`'s own setter uses.
16
+ const apiRef = useRef(undefined);
17
+ if (!apiRef.current) {
18
+ apiRef.current = {
19
+ next: () => (ref.current += 1),
20
+ isCurrent: ({ generation }) => ref.current === generation,
21
+ };
22
+ }
23
+ return apiRef.current;
24
+ }
25
+ //# sourceMappingURL=use-settlement-generation.hooks.js.map
@@ -0,0 +1,19 @@
1
+ export * from './fetch-query/index.js';
2
+ export { useFocusTrap } from './hooks/use-focus-trap.hooks.js';
3
+ export { useDirtyGuard } from './hooks/use-dirty-guard.hooks.js';
4
+ export type { DirtyGuard } from './hooks/use-dirty-guard.hooks.js';
5
+ export { useAsyncAction } from './hooks/use-async-action.hooks.js';
6
+ export type { AsyncActionState } from './hooks/use-async-action.hooks.js';
7
+ export { useSerialWrites } from './hooks/use-serial-writes.hooks.js';
8
+ export type { SerialWrites } from './hooks/use-serial-writes.hooks.js';
9
+ export { useSettlementGeneration } from './hooks/use-settlement-generation.hooks.js';
10
+ export type { SettlementGeneration } from './hooks/use-settlement-generation.hooks.js';
11
+ export { formatTimestamp, formatRelativeMinutesAgo } from './helpers/format-timestamp.js';
12
+ export { resolveActiveTabId } from './helpers/resolve-active-tab-id.js';
13
+ export { hasPermission } from './helpers/permissions.js';
14
+ export { isAbortError, retryWhileUnreachable, UNREACHABLE_RETRY_DELAYS_MS } from './helpers/retry-unreachable.js';
15
+ export { buildAgentListHandles } from '@jini-ai/agentic';
16
+ export { createDictionaryTranslator, interpolate, splitOnPlaceholders, pickPlural } from '../i18n/index.js';
17
+ export type { Translate, DictionaryTranslator, LocaleDictionary } from '../i18n/index.js';
18
+ export type { DirtyGuardHostPort } from './hooks/use-dirty-guard.hooks.js';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,13 @@
1
+ export * from './fetch-query/index.js';
2
+ export { useFocusTrap } from './hooks/use-focus-trap.hooks.js';
3
+ export { useDirtyGuard } from './hooks/use-dirty-guard.hooks.js';
4
+ export { useAsyncAction } from './hooks/use-async-action.hooks.js';
5
+ export { useSerialWrites } from './hooks/use-serial-writes.hooks.js';
6
+ export { useSettlementGeneration } from './hooks/use-settlement-generation.hooks.js';
7
+ export { formatTimestamp, formatRelativeMinutesAgo } from './helpers/format-timestamp.js';
8
+ export { resolveActiveTabId } from './helpers/resolve-active-tab-id.js';
9
+ export { hasPermission } from './helpers/permissions.js';
10
+ export { isAbortError, retryWhileUnreachable, UNREACHABLE_RETRY_DELAYS_MS } from './helpers/retry-unreachable.js';
11
+ export { buildAgentListHandles } from '@jini-ai/agentic';
12
+ export { createDictionaryTranslator, interpolate, splitOnPlaceholders, pickPlural } from '../i18n/index.js';
13
+ //# sourceMappingURL=index.js.map
@@ -4,7 +4,7 @@ import { useT } from '../../../i18n/index.js';
4
4
  import { Icon } from '../../../../react/components/Icon.js';
5
5
  import { hasMadeConsentDecision, isSharingEnabled, nextStateForDeclineAll, nextStateForDeleteMyData, nextStateForShareAll, nextStateForTelemetryPatch, } from '../../rules.js';
6
6
  function ToggleRow({ label, hint, checked, onChange, agentHandle }) {
7
- return (_jsxs("button", { type: "button", className: `jini-toggle-row${checked ? ' on' : ''}`, onClick: () => onChange(!checked), "aria-pressed": checked, ...agentHandleProps(agentHandle, { role: 'checkbox', label }), children: [_jsxs("div", { className: "jini-toggle-row-text", children: [_jsx("span", { className: "jini-toggle-row-label", children: label }), _jsx("span", { className: "jini-toggle-row-hint", children: hint })] }), _jsx("span", { className: "jini-toggle-row-switch", "aria-hidden": true })] }));
7
+ return (_jsxs("button", { type: "button", className: `jini-toggle-row${checked ? ' on' : ''}`, onClick: () => onChange(!checked), "aria-pressed": checked, ...agentHandleProps({}, { base: agentHandle, ...({ role: 'checkbox', label }) }), children: [_jsxs("div", { className: "jini-toggle-row-text", children: [_jsx("span", { className: "jini-toggle-row-label", children: label }), _jsx("span", { className: "jini-toggle-row-hint", children: hint })] }), _jsx("span", { className: "jini-toggle-row-switch", "aria-hidden": true })] }));
8
8
  }
9
9
  /**
10
10
  * Telemetry consent card (share/decline + two per-category toggles) over a
@@ -32,6 +32,6 @@ export function PrivacyTab({ state, onChange, labels, now = Date.now, agentHandl
32
32
  const installationIdHint = labels?.installationIdHint ?? t('An anonymous id used to group your shared data.');
33
33
  const optedOutLabel = labels?.optedOutLabel ?? t('Not sharing');
34
34
  const deleteMyDataLabel = labels?.deleteMyDataLabel ?? t('Delete my data');
35
- return (_jsxs("section", { className: "jini-settings-section jini-settings-privacy", children: [_jsxs("div", { className: "jini-settings-subsection", children: [_jsx("div", { className: "jini-section-head", children: _jsxs("div", { children: [_jsx("h4", { children: consentKicker }), _jsx("p", { className: "jini-hint", children: consentLead })] }) }), _jsxs("dl", { className: "jini-settings-privacy-disclosure", children: [_jsxs("div", { children: [_jsx("dt", { children: metricsLabel }), _jsx("dd", { children: metricsHint })] }), _jsxs("div", { children: [_jsx("dt", { children: contentLabel }), _jsx("dd", { children: contentHint })] })] }), _jsx("p", { className: "jini-hint", children: consentFooter }), _jsxs("div", { className: "jini-privacy-consent-actions", role: "group", "aria-label": consentKicker, children: [_jsx("button", { type: "button", className: `jini-privacy-consent-action${sharing === false ? ' is-active' : ''}`, "aria-pressed": sharing === false, onClick: () => onChange(nextStateForDeclineAll(state, now())), ...agentHandleProps(agentHandle, { action: 'decline', role: 'button', label: declineLabel }), children: declineLabel }), _jsx("button", { type: "button", className: `jini-privacy-consent-action jini-privacy-consent-action--primary${sharing === true ? ' is-active' : ''}`, "aria-pressed": sharing === true, onClick: () => onChange(nextStateForShareAll(state, now())), ...agentHandleProps(agentHandle, { action: 'share', role: 'button', label: shareLabel }), children: shareLabel })] })] }), decided ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "jini-settings-privacy-toggles", children: [_jsx(ToggleRow, { label: metricsLabel, hint: metricsHint, checked: state.telemetry.metrics === true, onChange: (v) => onChange(nextStateForTelemetryPatch(state, { metrics: v }, now())), ...(agentHandle ? { agentHandle: agentSubHandle(agentHandle, 'metrics-toggle') } : {}) }), _jsx(ToggleRow, { label: contentLabel, hint: contentHint, checked: state.telemetry.content === true, onChange: (v) => onChange(nextStateForTelemetryPatch(state, { content: v }, now())), ...(agentHandle ? { agentHandle: agentSubHandle(agentHandle, 'content-toggle') } : {}) })] }), _jsxs("div", { className: "jini-settings-subsection", children: [_jsx("div", { className: "jini-section-head", children: _jsxs("div", { children: [_jsx("h4", { children: installationIdLabel }), _jsx("p", { className: "jini-hint", children: installationIdHint })] }) }), _jsx("div", { className: "jini-settings-field", children: _jsx("input", { type: "text", readOnly: true, value: state.installationId ?? optedOutLabel, "aria-label": installationIdLabel, ...agentHandleProps(agentHandle, { action: 'installation-id', role: 'field', label: installationIdLabel }) }) }), _jsxs("button", { type: "button", className: "jini-button jini-button-ghost", onClick: () => onChange(nextStateForDeleteMyData(state, now())), ...agentHandleProps(agentHandle, { action: 'delete-my-data', role: 'button', label: deleteMyDataLabel }), children: [_jsx(Icon, { name: "trash", size: 13 }), _jsx("span", { children: deleteMyDataLabel })] })] })] })) : null] }));
35
+ return (_jsxs("section", { className: "jini-settings-section jini-settings-privacy", children: [_jsxs("div", { className: "jini-settings-subsection", children: [_jsx("div", { className: "jini-section-head", children: _jsxs("div", { children: [_jsx("h4", { children: consentKicker }), _jsx("p", { className: "jini-hint", children: consentLead })] }) }), _jsxs("dl", { className: "jini-settings-privacy-disclosure", children: [_jsxs("div", { children: [_jsx("dt", { children: metricsLabel }), _jsx("dd", { children: metricsHint })] }), _jsxs("div", { children: [_jsx("dt", { children: contentLabel }), _jsx("dd", { children: contentHint })] })] }), _jsx("p", { className: "jini-hint", children: consentFooter }), _jsxs("div", { className: "jini-privacy-consent-actions", role: "group", "aria-label": consentKicker, children: [_jsx("button", { type: "button", className: `jini-privacy-consent-action${sharing === false ? ' is-active' : ''}`, "aria-pressed": sharing === false, onClick: () => onChange(nextStateForDeclineAll(state, now())), ...agentHandleProps({}, { base: agentHandle, ...({ action: 'decline', role: 'button', label: declineLabel }) }), children: declineLabel }), _jsx("button", { type: "button", className: `jini-privacy-consent-action jini-privacy-consent-action--primary${sharing === true ? ' is-active' : ''}`, "aria-pressed": sharing === true, onClick: () => onChange(nextStateForShareAll(state, now())), ...agentHandleProps({}, { base: agentHandle, ...({ action: 'share', role: 'button', label: shareLabel }) }), children: shareLabel })] })] }), decided ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "jini-settings-privacy-toggles", children: [_jsx(ToggleRow, { label: metricsLabel, hint: metricsHint, checked: state.telemetry.metrics === true, onChange: (v) => onChange(nextStateForTelemetryPatch(state, { metrics: v }, now())), ...(agentHandle ? { agentHandle: agentSubHandle({ base: agentHandle, action: 'metrics-toggle' }) } : {}) }), _jsx(ToggleRow, { label: contentLabel, hint: contentHint, checked: state.telemetry.content === true, onChange: (v) => onChange(nextStateForTelemetryPatch(state, { content: v }, now())), ...(agentHandle ? { agentHandle: agentSubHandle({ base: agentHandle, action: 'content-toggle' }) } : {}) })] }), _jsxs("div", { className: "jini-settings-subsection", children: [_jsx("div", { className: "jini-section-head", children: _jsxs("div", { children: [_jsx("h4", { children: installationIdLabel }), _jsx("p", { className: "jini-hint", children: installationIdHint })] }) }), _jsx("div", { className: "jini-settings-field", children: _jsx("input", { type: "text", readOnly: true, value: state.installationId ?? optedOutLabel, "aria-label": installationIdLabel, ...agentHandleProps({}, { base: agentHandle, ...({ action: 'installation-id', role: 'field', label: installationIdLabel }) }) }) }), _jsxs("button", { type: "button", className: "jini-button jini-button-ghost", onClick: () => onChange(nextStateForDeleteMyData(state, now())), ...agentHandleProps({}, { base: agentHandle, ...({ action: 'delete-my-data', role: 'button', label: deleteMyDataLabel }) }), children: [_jsx(Icon, { name: "trash", size: 13 }), _jsx("span", { children: deleteMyDataLabel })] })] })] })) : null] }));
36
36
  }
37
37
  //# sourceMappingURL=PrivacyTab.js.map
@@ -4,7 +4,7 @@
4
4
  * telemetry-consent card (share/decline + two per-category toggles) over a
5
5
  * generic `{ metrics, content }` shape, plus an installation-id
6
6
  * generate/rotate flow. Verified generic for this task (see
7
- * `packages/ui/source-map.md` for the full note): the only OD coupling was
7
+ * `packages/ui/archived provenance ledger` for the full note): the only OD coupling was
8
8
  * the `AppConfig`/`TelemetryConfig` type import (replaced by the local
9
9
  * types below) and the analytics tracking calls (dropped, same as every
10
10
  * other tab in this feature).
@@ -4,7 +4,7 @@
4
4
  * telemetry-consent card (share/decline + two per-category toggles) over a
5
5
  * generic `{ metrics, content }` shape, plus an installation-id
6
6
  * generate/rotate flow. Verified generic for this task (see
7
- * `packages/ui/source-map.md` for the full note): the only OD coupling was
7
+ * `packages/ui/archived provenance ledger` for the full note): the only OD coupling was
8
8
  * the `AppConfig`/`TelemetryConfig` type import (replaced by the local
9
9
  * types below) and the analytics tracking calls (dropped, same as every
10
10
  * other tab in this feature).
@@ -6,7 +6,7 @@
6
6
  * on that package, and any host whose real types are a structural superset
7
7
  * can pass them in directly. Field-level provenance and what was
8
8
  * deliberately dropped (a Bash `rm`-command heuristic from the file-ops
9
- * derivation) are documented in `packages/ui/source-map.md`.
9
+ * derivation) are documented in `packages/ui/archived provenance ledger`.
10
10
  *
11
11
  * These adapters are shipped as documented reference material, not as the
12
12
  * package's primary port surface — a host with its own run/job shape maps