@djangocfg/ui-tools 2.1.407 → 2.1.409

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 (297) hide show
  1. package/README.md +9 -10
  2. package/dist/file-icon/index.cjs +449 -61
  3. package/dist/file-icon/index.cjs.map +1 -1
  4. package/dist/file-icon/index.d.cts +56 -18
  5. package/dist/file-icon/index.d.ts +56 -18
  6. package/dist/file-icon/index.mjs +448 -62
  7. package/dist/file-icon/index.mjs.map +1 -1
  8. package/dist/tree/index.cjs +49 -22
  9. package/dist/tree/index.cjs.map +1 -1
  10. package/dist/tree/index.d.cts +9 -3
  11. package/dist/tree/index.d.ts +9 -3
  12. package/dist/tree/index.mjs +49 -22
  13. package/dist/tree/index.mjs.map +1 -1
  14. package/dist/{types-B_zhyAqR.d.cts → types-eEu8SeiQ.d.cts} +4 -0
  15. package/dist/{types-B_zhyAqR.d.ts → types-eEu8SeiQ.d.ts} +4 -0
  16. package/package.json +8 -13
  17. package/src/components/FloatingToolbar/index.tsx +37 -3
  18. package/src/lib/page-snapshot/__tests__/capture-integration.test.ts +85 -0
  19. package/src/lib/page-snapshot/__tests__/engine.test.ts +36 -0
  20. package/src/lib/page-snapshot/__tests__/redaction-integration.test.ts +99 -0
  21. package/src/lib/page-snapshot/__tests__/tokens.test.ts +17 -0
  22. package/src/lib/page-snapshot/capture/__tests__/budget.test.ts +49 -0
  23. package/src/lib/page-snapshot/capture/__tests__/chrome-filter.test.ts +47 -0
  24. package/src/lib/page-snapshot/capture/__tests__/fold.test.ts +66 -0
  25. package/src/lib/page-snapshot/capture/__tests__/scope.test.ts +74 -0
  26. package/src/lib/page-snapshot/capture/__tests__/walk.test.ts +129 -0
  27. package/src/lib/page-snapshot/capture/accessible-name.ts +73 -0
  28. package/src/lib/page-snapshot/capture/budget.ts +95 -0
  29. package/src/lib/page-snapshot/capture/chrome-filter.ts +81 -0
  30. package/src/lib/page-snapshot/capture/classify.ts +111 -0
  31. package/src/lib/page-snapshot/capture/dom-utils.ts +111 -0
  32. package/src/lib/page-snapshot/capture/fold.ts +96 -0
  33. package/src/lib/page-snapshot/capture/scope.ts +169 -0
  34. package/src/lib/page-snapshot/capture/walk.ts +250 -0
  35. package/src/lib/page-snapshot/cst/__tests__/serialize.test.ts +50 -0
  36. package/src/lib/page-snapshot/cst/directives.ts +47 -0
  37. package/src/lib/page-snapshot/cst/payload.ts +50 -0
  38. package/src/lib/page-snapshot/cst/serialize.ts +84 -0
  39. package/src/lib/page-snapshot/cst/types.ts +115 -0
  40. package/src/lib/page-snapshot/engine.ts +176 -0
  41. package/src/lib/page-snapshot/index.ts +93 -0
  42. package/src/lib/page-snapshot/react/PageSnapshotChip.tsx +72 -0
  43. package/src/lib/page-snapshot/react/PageSnapshotPreview.tsx +78 -0
  44. package/src/lib/page-snapshot/react/__tests__/PageSnapshotChip.test.tsx +54 -0
  45. package/src/lib/page-snapshot/react/__tests__/provider.test.tsx +103 -0
  46. package/src/lib/page-snapshot/react/__tests__/use-page-snapshot-toggle.test.tsx +62 -0
  47. package/src/lib/page-snapshot/react/provider.tsx +162 -0
  48. package/src/lib/page-snapshot/react/use-page-snapshot-toggle.ts +47 -0
  49. package/src/lib/page-snapshot/react/use-page-snapshot.ts +67 -0
  50. package/src/lib/page-snapshot/redaction/__tests__/audit.test.ts +25 -0
  51. package/src/lib/page-snapshot/redaction/__tests__/heuristics.test.ts +73 -0
  52. package/src/lib/page-snapshot/redaction/__tests__/luhn.test.ts +26 -0
  53. package/src/lib/page-snapshot/redaction/__tests__/patterns.test.ts +60 -0
  54. package/src/lib/page-snapshot/redaction/audit.ts +58 -0
  55. package/src/lib/page-snapshot/redaction/heuristics.ts +75 -0
  56. package/src/lib/page-snapshot/redaction/index.ts +75 -0
  57. package/src/lib/page-snapshot/redaction/luhn.ts +25 -0
  58. package/src/lib/page-snapshot/redaction/patterns.ts +111 -0
  59. package/src/lib/page-snapshot/refs/__tests__/registry.test.ts +24 -0
  60. package/src/lib/page-snapshot/refs/registry.ts +46 -0
  61. package/src/lib/page-snapshot/staleness/__tests__/hash.test.ts +34 -0
  62. package/src/lib/page-snapshot/staleness/hash.ts +20 -0
  63. package/src/lib/page-snapshot/tokens.ts +15 -0
  64. package/src/tools/AudioPlayer/context/PlayerProvider.tsx +13 -14
  65. package/src/tools/AudioPlayer/hooks/useAudioElementEvents.ts +55 -6
  66. package/src/tools/AudioPlayer/parts/Meta/TimeDisplay.tsx +2 -5
  67. package/src/tools/Chat/README.md +277 -39
  68. package/src/tools/Chat/composer/Composer.tsx +471 -0
  69. package/src/tools/Chat/composer/ComposerActionBar.tsx +65 -0
  70. package/src/tools/Chat/composer/ComposerBanner.tsx +128 -0
  71. package/src/tools/Chat/composer/ComposerButton.tsx +64 -0
  72. package/src/tools/Chat/composer/ComposerFooter.tsx +90 -0
  73. package/src/tools/Chat/composer/ComposerMenuButton.tsx +62 -0
  74. package/src/tools/Chat/composer/ComposerModelPicker.tsx +104 -0
  75. package/src/tools/Chat/composer/ComposerRichTextarea.tsx +88 -0
  76. package/src/tools/Chat/composer/ComposerToolPill.tsx +95 -0
  77. package/src/tools/Chat/composer/index.ts +45 -0
  78. package/src/tools/Chat/composer/size-context.tsx +26 -0
  79. package/src/tools/Chat/composer/types.ts +143 -0
  80. package/src/tools/Chat/composer/useComposerActions.tsx +164 -0
  81. package/src/tools/Chat/context/ChatProvider.tsx +54 -3
  82. package/src/tools/Chat/core/__tests__/metadata.test.ts +69 -0
  83. package/src/tools/Chat/core/index.ts +23 -1
  84. package/src/tools/Chat/core/markdown.ts +1 -1
  85. package/src/tools/Chat/core/metadata.ts +47 -0
  86. package/src/tools/Chat/core/payload-dispatch.ts +1 -1
  87. package/src/tools/Chat/core/transport/http.ts +71 -32
  88. package/src/tools/Chat/core/transport/sse.ts +18 -10
  89. package/src/tools/Chat/highlight/HighlightOverlay.tsx +101 -0
  90. package/src/tools/Chat/highlight/README.md +103 -0
  91. package/src/tools/Chat/highlight/SpotlightCanvas.tsx +153 -0
  92. package/src/tools/Chat/highlight/__tests__/HighlightOverlay.test.tsx +112 -0
  93. package/src/tools/Chat/highlight/__tests__/resolveRef.test.ts +55 -0
  94. package/src/tools/Chat/highlight/index.ts +21 -0
  95. package/src/tools/Chat/highlight/resolveRef.ts +42 -0
  96. package/src/tools/Chat/highlight/types.ts +49 -0
  97. package/src/tools/Chat/highlight/useHighlightTargets.ts +128 -0
  98. package/src/tools/Chat/hooks/index.ts +0 -5
  99. package/src/tools/Chat/hooks/useAutoFocusOnStreamEnd.ts +28 -47
  100. package/src/tools/Chat/hooks/useChat.ts +47 -14
  101. package/src/tools/Chat/hooks/useChatComposer.ts +2 -2
  102. package/src/tools/Chat/hooks/useChatLayout.ts +1 -1
  103. package/src/tools/Chat/hooks/useStreamEndFocus.ts +54 -0
  104. package/src/tools/Chat/index.ts +25 -219
  105. package/src/tools/Chat/launcher/ChatDock.tsx +1 -1
  106. package/src/tools/Chat/launcher/ChatLauncher.tsx +1 -1
  107. package/src/tools/Chat/launcher/{ChatHeader.tsx → header/ChatHeader.tsx} +24 -11
  108. package/src/tools/Chat/launcher/{ChatHeaderActionButton.tsx → header/ChatHeaderActionButton.tsx} +34 -3
  109. package/src/tools/Chat/launcher/{ChatHeaderLanguageButton.tsx → header/ChatHeaderLanguageButton.tsx} +2 -2
  110. package/src/tools/Chat/launcher/{ChatHeaderModeToggle.tsx → header/ChatHeaderModeToggle.tsx} +1 -1
  111. package/src/tools/Chat/launcher/{ChatHeaderResetButton.tsx → header/ChatHeaderResetButton.tsx} +2 -1
  112. package/src/tools/Chat/launcher/{HeaderSlots.tsx → header/HeaderSlots.tsx} +3 -3
  113. package/src/tools/Chat/launcher/header/index.ts +26 -0
  114. package/src/tools/Chat/launcher/index.ts +3 -10
  115. package/src/tools/Chat/lazy.tsx +38 -284
  116. package/src/tools/Chat/{components → messages}/MessageBubble.tsx +58 -5
  117. package/src/tools/Chat/{components → messages}/MessageList.tsx +8 -25
  118. package/src/tools/Chat/messages/blocks/MessageBlocks.tsx +131 -0
  119. package/src/tools/Chat/messages/blocks/builtin.tsx +91 -0
  120. package/src/tools/Chat/messages/blocks/index.ts +12 -0
  121. package/src/tools/Chat/messages/blocks/registry.tsx +42 -0
  122. package/src/tools/Chat/messages/blocks/renderers/AudioBlock.tsx +20 -0
  123. package/src/tools/Chat/messages/blocks/renderers/CodeBlock.tsx +19 -0
  124. package/src/tools/Chat/messages/blocks/renderers/GalleryBlock.tsx +26 -0
  125. package/src/tools/Chat/messages/blocks/renderers/ImageBlock.tsx +27 -0
  126. package/src/tools/Chat/messages/blocks/renderers/JsonBlock.tsx +12 -0
  127. package/src/tools/Chat/messages/blocks/renderers/LottieBlock.tsx +11 -0
  128. package/src/tools/Chat/messages/blocks/renderers/MapBlock.tsx +36 -0
  129. package/src/tools/Chat/messages/blocks/renderers/MermaidBlock.tsx +11 -0
  130. package/src/tools/Chat/messages/blocks/renderers/VideoBlock.tsx +24 -0
  131. package/src/tools/Chat/messages/blocks/renderers/types.ts +8 -0
  132. package/src/tools/Chat/{components → messages}/index.ts +11 -5
  133. package/src/tools/Chat/public.ts +212 -0
  134. package/src/tools/Chat/shell/ChatRoot.tsx +345 -0
  135. package/src/tools/Chat/{components → shell}/EmptyState.tsx +4 -2
  136. package/src/tools/Chat/shell/index.ts +15 -0
  137. package/src/tools/Chat/types/block.ts +120 -0
  138. package/src/tools/Chat/types/config.ts +0 -5
  139. package/src/tools/Chat/types/index.ts +17 -0
  140. package/src/tools/Chat/types/message.ts +3 -0
  141. package/src/tools/Chat/utils/index.ts +4 -0
  142. package/src/tools/CodeEditor/README.md +4 -6
  143. package/src/tools/CodeEditor/components/DiffEditor.tsx +48 -13
  144. package/src/tools/CodeEditor/components/Editor.tsx +96 -44
  145. package/src/tools/CodeEditor/context/EditorProvider.tsx +34 -17
  146. package/src/tools/CodeEditor/hooks/useEditorTheme.ts +92 -99
  147. package/src/tools/CodeEditor/hooks/useMonaco.ts +37 -22
  148. package/src/tools/CodeEditor/lazy.tsx +6 -0
  149. package/src/tools/CodeEditor/lib/index.ts +1 -1
  150. package/src/tools/CodeEditor/lib/themes.ts +3 -39
  151. package/src/tools/CronScheduler/CronScheduler.client.tsx +230 -61
  152. package/src/tools/CronScheduler/components/CustomInput.tsx +21 -4
  153. package/src/tools/CronScheduler/components/DayChips.tsx +13 -11
  154. package/src/tools/CronScheduler/components/MonthDayGrid.tsx +4 -4
  155. package/src/tools/CronScheduler/components/SchedulePreview.tsx +7 -3
  156. package/src/tools/CronScheduler/components/TimeSelector.tsx +1 -1
  157. package/src/tools/CronScheduler/index.tsx +1 -1
  158. package/src/tools/CronScheduler/types/index.ts +8 -3
  159. package/src/tools/CronScheduler/utils/cron-humanize.ts +61 -16
  160. package/src/tools/CronScheduler/utils/cron-parser.ts +13 -4
  161. package/src/tools/FileIcon/FileIcon.tsx +24 -39
  162. package/src/tools/FileIcon/get-file-icon.ts +73 -0
  163. package/src/tools/FileIcon/icons/icon-data.ts +399 -0
  164. package/src/tools/FileIcon/index.ts +4 -0
  165. package/src/tools/FileIcon/loader.ts +17 -35
  166. package/src/tools/FileIcon/specialFolders.ts +18 -0
  167. package/src/tools/Gallery/components/lightbox/GalleryLightbox.tsx +112 -35
  168. package/src/tools/Gallery/components/media/GalleryVideo.tsx +21 -2
  169. package/src/tools/Gallery/components/preview/GalleryCarousel.tsx +11 -1
  170. package/src/tools/Gallery/hooks/usePreloadImages.ts +54 -7
  171. package/src/tools/ImageViewer/components/ImageInfo.tsx +12 -1
  172. package/src/tools/ImageViewer/components/ImageToolbar.tsx +51 -43
  173. package/src/tools/ImageViewer/components/ImageViewer.tsx +96 -24
  174. package/src/tools/ImageViewer/hooks/useImageLoading.ts +13 -0
  175. package/src/tools/ImageViewer/utils/constants.ts +3 -0
  176. package/src/tools/ImageViewer/utils/index.ts +1 -0
  177. package/src/tools/JsonForm/JsonSchemaForm.tsx +4 -1
  178. package/src/tools/JsonForm/templates/ArrayFieldTemplate.tsx +5 -3
  179. package/src/tools/JsonForm/templates/BaseInputTemplate.tsx +7 -4
  180. package/src/tools/JsonForm/templates/ErrorListTemplate.tsx +3 -1
  181. package/src/tools/JsonForm/templates/ObjectFieldTemplate.tsx +23 -3
  182. package/src/tools/JsonForm/widgets/ColorWidget.tsx +20 -12
  183. package/src/tools/JsonForm/widgets/NumberWidget.tsx +14 -9
  184. package/src/tools/JsonForm/widgets/RadioWidget.tsx +78 -0
  185. package/src/tools/JsonForm/widgets/SelectWidget.tsx +1 -0
  186. package/src/tools/JsonForm/widgets/SliderWidget.tsx +7 -4
  187. package/src/tools/JsonForm/widgets/TextWidget.tsx +41 -17
  188. package/src/tools/JsonForm/widgets/index.ts +1 -0
  189. package/src/tools/JsonTree/components/JsonContent.tsx +115 -40
  190. package/src/tools/LottiePlayer/LottiePlayer.client.tsx +177 -72
  191. package/src/tools/LottiePlayer/index.tsx +14 -4
  192. package/src/tools/LottiePlayer/lazy.tsx +11 -3
  193. package/src/tools/LottiePlayer/types.ts +31 -1
  194. package/src/tools/LottiePlayer/useLottie.ts +32 -9
  195. package/src/tools/LottiePlayer/usePrefersReducedMotion.ts +46 -0
  196. package/src/tools/Map/components/LayerSwitcher.tsx +54 -21
  197. package/src/tools/Map/components/MapCluster.tsx +28 -21
  198. package/src/tools/Map/components/MapContainer.tsx +11 -4
  199. package/src/tools/Map/components/MapLegend.tsx +46 -15
  200. package/src/tools/Map/components/MapMarker.tsx +31 -2
  201. package/src/tools/Map/hooks/useMapEvents.ts +64 -105
  202. package/src/tools/MarkdownEditor/MarkdownEditor.tsx +61 -6
  203. package/src/tools/MarkdownEditor/MentionList.tsx +37 -4
  204. package/src/tools/MarkdownEditor/createMentionSuggestion.ts +11 -0
  205. package/src/tools/MarkdownEditor/lazy.tsx +32 -7
  206. package/src/tools/MarkdownEditor/styles.css +13 -0
  207. package/src/tools/MarkdownMessage/CodeBlock.tsx +40 -17
  208. package/src/tools/MarkdownMessage/MarkdownMessage.tsx +26 -6
  209. package/src/tools/MarkdownMessage/components.tsx +22 -9
  210. package/src/tools/MarkdownMessage/types.ts +24 -1
  211. package/src/tools/Mermaid/Mermaid.client.tsx +27 -5
  212. package/src/tools/Mermaid/components/MermaidErrorPanel.tsx +31 -0
  213. package/src/tools/Mermaid/components/MermaidFullscreenModal.tsx +14 -17
  214. package/src/tools/Mermaid/hooks/useMermaidRenderer.ts +264 -168
  215. package/src/tools/Mermaid/hooks/useMermaidValidation.ts +76 -10
  216. package/src/tools/Mermaid/index.tsx +6 -0
  217. package/src/tools/Mermaid/utils/mermaid-helpers.ts +141 -18
  218. package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/SchemaFields/FieldRow.tsx +11 -1
  219. package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/SchemaFields/buildTree.ts +49 -20
  220. package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/index.tsx +7 -0
  221. package/src/tools/OpenapiViewer/components/DocsLayout/grouping.ts +7 -4
  222. package/src/tools/OpenapiViewer/constants.ts +3 -0
  223. package/src/tools/OpenapiViewer/hooks/useOpenApiSchema.ts +73 -11
  224. package/src/tools/OpenapiViewer/utils/schemaExport.ts +26 -6
  225. package/src/tools/PrettyCode/PrettyCode.client.tsx +23 -16
  226. package/src/tools/PrettyCode/lazy.tsx +1 -1
  227. package/src/tools/SpeechRecognition/README.md +1 -1
  228. package/src/tools/SpeechRecognition/__tests__/language.test.ts +9 -3
  229. package/src/tools/SpeechRecognition/components/RecordingPulse.tsx +59 -0
  230. package/src/tools/SpeechRecognition/components/index.ts +2 -0
  231. package/src/tools/SpeechRecognition/core/engine/external.ts +24 -7
  232. package/src/tools/SpeechRecognition/core/language.ts +23 -6
  233. package/src/tools/SpeechRecognition/hooks/usePushToTalk.ts +36 -5
  234. package/src/tools/SpeechRecognition/hooks/useSpeechRecognition.ts +18 -11
  235. package/src/tools/SpeechRecognition/widgets/VoiceComposerSlot.tsx +94 -26
  236. package/src/tools/SpeechRecognition/widgets/index.ts +1 -1
  237. package/src/tools/Tree/README.md +4 -8
  238. package/src/tools/Tree/TreeRoot.tsx +22 -10
  239. package/src/tools/Tree/components/TreeContent.tsx +24 -4
  240. package/src/tools/Tree/components/TreeLabel.tsx +8 -2
  241. package/src/tools/Tree/components/TreeRow.tsx +16 -6
  242. package/src/tools/Tree/data/flatten.ts +10 -4
  243. package/src/tools/Tree/types.ts +4 -0
  244. package/src/tools/Uploader/components/UploadAddButton.tsx +29 -6
  245. package/src/tools/Uploader/components/UploadDropzone.tsx +63 -7
  246. package/src/tools/Uploader/components/UploadPageDropOverlay.tsx +19 -5
  247. package/src/tools/Uploader/components/UploadPreviewItem.tsx +47 -17
  248. package/src/tools/Uploader/components/UploadPreviewList.tsx +24 -12
  249. package/src/tools/Uploader/utils/formatters.ts +8 -3
  250. package/src/tools/VideoPlayer/canvas/hls-canvas.tsx +1 -0
  251. package/src/tools/VideoPlayer/canvas/{jsx.d.ts → jsx-augmentation.ts} +12 -19
  252. package/src/tools/VideoPlayer/canvas/vimeo-canvas.tsx +1 -0
  253. package/src/tools/VideoPlayer/canvas/youtube-canvas.tsx +1 -0
  254. package/src/tools/VideoPlayer/parts/fullscreen.tsx +1 -1
  255. package/src/tools/VideoPlayer/parts/pip.tsx +1 -1
  256. package/src/tools/VideoPlayer/parts/playback-rate.tsx +1 -1
  257. package/src/tools/VideoPlayer/parts/seek-bar.tsx +2 -2
  258. package/src/tools/VideoPlayer/parts/volume.tsx +2 -2
  259. package/src/tools/index.ts +2 -1
  260. package/src/tools/Chat/components/AudioToggle.tsx +0 -78
  261. package/src/tools/Chat/components/ChatRoot.tsx +0 -305
  262. package/src/tools/Chat/components/Composer.tsx +0 -216
  263. package/src/tools/Chat/hooks/useChatScroll.ts +0 -145
  264. package/src/tools/Chat/types.ts +0 -9
  265. package/src/tools/JsonTree/components/JsonToolbar.tsx +0 -95
  266. package/src/tools/JsonTree/hooks/useElementCorner.ts +0 -84
  267. package/src/tools/JsonTree/hooks/useNavbarHeight.ts +0 -83
  268. package/src/tools/OpenapiViewer/components/DocsLayout/schemaFields.ts +0 -121
  269. package/src/tools/Tour/README.md +0 -373
  270. package/src/tools/Tour/components/Tour.tsx +0 -12
  271. package/src/tools/Tour/components/TourContent.tsx +0 -171
  272. package/src/tools/Tour/components/TourNavigation.tsx +0 -77
  273. package/src/tools/Tour/components/TourProgress.tsx +0 -88
  274. package/src/tools/Tour/components/TourSpotlight.tsx +0 -199
  275. package/src/tools/Tour/components/index.ts +0 -5
  276. package/src/tools/Tour/context/TourContext.ts +0 -19
  277. package/src/tools/Tour/context/TourProvider.tsx +0 -292
  278. package/src/tools/Tour/context/index.ts +0 -2
  279. package/src/tools/Tour/hooks/index.ts +0 -3
  280. package/src/tools/Tour/hooks/useKeyboardNavigation.ts +0 -59
  281. package/src/tools/Tour/hooks/useStepTarget.ts +0 -121
  282. package/src/tools/Tour/hooks/useTour.ts +0 -42
  283. package/src/tools/Tour/index.ts +0 -38
  284. package/src/tools/Tour/types/index.ts +0 -224
  285. package/src/tools/Tour/utils/dom.ts +0 -98
  286. package/src/tools/Tour/utils/index.ts +0 -3
  287. package/src/tools/Tour/utils/logger.ts +0 -3
  288. package/src/tools/Tour/utils/scrollIntoView.ts +0 -24
  289. /package/src/tools/Chat/{config.ts → constants.ts} +0 -0
  290. /package/src/tools/Chat/launcher/{ChatHeaderAudioToggle.tsx → header/ChatHeaderAudioToggle.tsx} +0 -0
  291. /package/src/tools/Chat/{components → messages}/Attachments.tsx +0 -0
  292. /package/src/tools/Chat/{components → messages}/JumpToLatest.tsx +0 -0
  293. /package/src/tools/Chat/{components → messages}/MessageActions.tsx +0 -0
  294. /package/src/tools/Chat/{components → messages}/Sources.tsx +0 -0
  295. /package/src/tools/Chat/{components → messages}/StreamingIndicator.tsx +0 -0
  296. /package/src/tools/Chat/{components → messages}/ToolCalls.tsx +0 -0
  297. /package/src/tools/Chat/{components → shell}/ErrorBanner.tsx +0 -0
@@ -3,77 +3,37 @@
3
3
  /**
4
4
  * @djangocfg/ui-tools — Chat
5
5
  *
6
+ * Root barrel: the shared light surface (`./public`) + the heavy,
7
+ * synchronously-loaded UI surface (components + launcher).
8
+ *
6
9
  * Decomposed, transport-agnostic chat. See @dev/@refactoring7-chat/ for design.
7
10
  */
8
11
 
9
- // Types
10
- export type {
11
- ChatRole,
12
- ChatMessage,
13
- ChatPersona,
14
- ChatToolCall,
15
- ChatAttachment,
16
- ChatSource,
17
- ChatDisplayMode,
18
- ChatUserContext,
19
- ChatAssistantContext,
20
- ChatPrefs,
21
- ChatConfig,
22
- ChatLabels,
23
- ChatTransport,
24
- ChatStreamEvent,
25
- CreateSessionOptions,
26
- SessionInfo,
27
- HistoryPage,
28
- StreamOptions,
29
- SendOptions,
30
- } from './types';
31
- export { DEFAULT_LABELS } from './types';
32
-
33
- // Config
34
- export {
35
- STORAGE_KEYS,
36
- CSS_VARS,
37
- DEFAULT_Z_INDEX,
38
- LIMITS,
39
- DEFAULT_SIDEBAR,
40
- HOTKEYS,
41
- CHAT_EVENT_NAME,
42
- type ChatEventDetail,
43
- } from './config';
12
+ // Light surface — types, constants, core, transport, hooks, notifier,
13
+ // payload-dispatch, logger, utils, styles, context.
14
+ export * from './public';
44
15
 
45
- // Core (pure)
46
- export {
47
- reducer,
48
- initialState,
49
- createId,
50
- createTokenBuffer,
51
- resolvePersona,
52
- deriveInitials,
53
- type ChatState,
54
- type ChatAction,
55
- type TokenBuffer,
56
- } from './core';
16
+ // Heavy sync surface — message rendering + composer + shell (presentation).
17
+ export * from './messages';
18
+ export * from './composer';
19
+ export * from './shell';
57
20
 
58
- // Transport
21
+ // Highlight — AI-driven `point` directives (spotlight + focus overlay).
59
22
  export {
60
- createHttpTransport,
61
- createMockTransport,
62
- parseSSE,
63
- TransportError,
64
- createPydanticAIChatTransport,
65
- createToolIdQueue,
66
- mapPydanticAIEvent,
67
- createPydanticAISSEMap,
68
- type HttpTransportConfig,
69
- type MockTransportOptions,
70
- type ParseSSEOptions,
71
- type PydanticAIChatTransportOpts,
72
- type PydanticAIEvent,
73
- type ToolIdQueue,
74
- } from './core/transport';
75
-
76
- // Launcher (FAB + Dock + Header + Greeting composition)
23
+ HighlightOverlay,
24
+ SpotlightCanvas,
25
+ useHighlightTargets,
26
+ resolveRefs,
27
+ type HighlightOverlayProps,
28
+ type SpotlightCanvasProps,
29
+ type RefResolver,
30
+ type PointDirective,
31
+ type HighlightTarget,
32
+ type SpotlightRect,
33
+ type CSTRefId,
34
+ } from './highlight';
35
+
36
+ // Launcher — FAB + Dock + Header + Greeting composition (heavy, sync).
77
37
  export {
78
38
  ChatFAB,
79
39
  ChatDock,
@@ -112,160 +72,6 @@ export {
112
72
  type ChatPresencePhase,
113
73
  } from './launcher';
114
74
 
115
- // Hooks
116
- export {
117
- useChat,
118
- useChatComposer,
119
- useChatScroll,
120
- useChatHistory,
121
- useChatLayout,
122
- useChatAudio,
123
- useAutoFocusOnStreamEnd,
124
- useRegisterComposer,
125
- useChatReset,
126
- useVisitorFingerprint,
127
- useChatDockPrefs,
128
- DEFAULT_DOCK_PREFS,
129
- useFocusOnEmptyClick,
130
- useChatUnread,
131
- useChatUnreadNotifier,
132
- type UseChatUnreadOptions,
133
- type UseChatUnreadReturn,
134
- type UseChatUnreadNotifierOptions,
135
- type UseChatConfig,
136
- type UseChatReturn,
137
- type UseChatComposerOptions,
138
- type UseChatComposerReturn,
139
- type UseChatScrollOptions,
140
- type UseChatScrollReturn,
141
- type UseChatHistoryOptions,
142
- type UseChatLayoutConfig,
143
- type UseChatLayoutReturn,
144
- type UseAutoFocusOnStreamEndOptions,
145
- type Focusable,
146
- type UseChatResetOptions,
147
- type UseChatResetReturn,
148
- type UseVisitorFingerprintOptions,
149
- type ChatDockPrefs,
150
- type UseChatDockPrefsOptions,
151
- type UseChatDockPrefsReturn,
152
- type UseFocusOnEmptyClickOptions,
153
- } from './hooks';
154
-
155
- // Notifier — title rotation + favicon badge + page-visibility + cross-tab
156
- export {
157
- createBrowserNotifier,
158
- createNoopNotifier,
159
- createTitleRotator,
160
- createFaviconBadge,
161
- createCrossTabNotifier,
162
- isPageHidden,
163
- onVisibilityChange,
164
- type ChatNotifier,
165
- type BrowserNotifierOptions,
166
- type TitleRotatorOptions,
167
- type TitleMode,
168
- type FaviconBadgeOptions,
169
- type CrossTabNotifierOptions,
170
- } from './notifier';
171
-
172
- // Audio
173
- export type {
174
- ChatAudioEvent,
175
- ChatAudioSounds,
176
- ChatAudioConfig,
177
- UseChatAudioReturn,
178
- } from './core/audio';
179
- export { useChatAudioPrefs, DEFAULT_CHAT_SOUNDS } from './core/audio';
180
-
181
- // Tool-call payload dispatcher
182
- export {
183
- dispatchToolPayload,
184
- isPlainObject,
185
- isLatLng,
186
- isGeoJSONFeatureCollection,
187
- isStringValue,
188
- type ToolPayloadMatcher,
189
- type ToolPayloadFallback,
190
- } from './core/payload-dispatch';
191
-
192
- // Lightbox helpers
193
- export { useChatLightbox, type UseChatLightboxReturn, type ChatLightboxState } from './hooks';
194
-
195
- // Styles — role-aware className tokens + hooks
196
- export {
197
- BUBBLE_SURFACE,
198
- ANCHOR,
199
- TOGGLE,
200
- DESTRUCTIVE_SURFACE,
201
- TOOL_CALL,
202
- useChatBubbleStyles,
203
- useChatRoleStyles,
204
- useChatDestructiveStyles,
205
- type ChatBubbleSurface,
206
- type ChatBubbleStyles,
207
- type ChatRoleStyles,
208
- type ChatDestructiveStyles,
209
- } from './styles';
210
- export { collectImageAttachments } from './utils/collectImageAttachments';
211
-
212
- // Draft sanitation — trim, collapse runs, strip zero-width chars.
213
- // Wire into your composer's submit handler / Send-button gate so
214
- // empty-after-cleanup drafts don't fire bogus messages.
215
- export { sanitizeDraft, isSubmittableDraft } from './utils/sanitizeDraft';
216
-
217
- // Dev logger (consola-based, namespace "chat:*")
218
- export { getChatLogger, type ChatLogger, type ChatLogScope } from './core/logger';
219
-
220
- // Context
221
- export {
222
- ChatProvider,
223
- useChatContext,
224
- useChatContextOptional,
225
- type ChatContextValue,
226
- type ChatProviderProps,
227
- } from './context';
228
-
229
- // Components
230
- export {
231
- ChatRoot,
232
- MessageList,
233
- MessageBubble,
234
- MessageActions,
235
- Composer,
236
- Sources,
237
- ToolCalls,
238
- Attachments,
239
- AttachmentsGrid,
240
- AttachmentsList,
241
- EmptyState,
242
- ErrorBanner,
243
- JumpToLatest,
244
- StreamingIndicator,
245
- AudioToggle,
246
- type ChatRootProps,
247
- type MessageListProps,
248
- type MessageListHandle,
249
- type MessageBubbleProps,
250
- type MessageActionsProps,
251
- type ComposerProps,
252
- type ComposerSize,
253
- type SourcesProps,
254
- type ToolCallsProps,
255
- type ToolPayloadKind,
256
- type AttachmentsProps,
257
- type AttachmentsGridProps,
258
- type AttachmentsListProps,
259
- type AttachmentRenderer,
260
- type AttachmentRendererArgs,
261
- type AttachmentRendererMap,
262
- type EmptyStateProps,
263
- type ErrorBannerProps,
264
- type JumpToLatestProps,
265
- type StreamingIndicatorProps,
266
- type AudioToggleProps,
267
- } from './components';
268
-
269
75
  // Lazy preset
270
76
  export { LazyChat } from './lazy';
271
77
 
@@ -7,7 +7,7 @@ import { Portal } from '@djangocfg/ui-core/components';
7
7
  import { useIsMobile, useIsTabletOrBelow } from '@djangocfg/ui-core/hooks';
8
8
  import { cn } from '@djangocfg/ui-core/lib';
9
9
 
10
- import { ChatHeader } from './ChatHeader';
10
+ import { ChatHeader } from './header';
11
11
  import { useChatPresence } from './useChatPresence';
12
12
  import type { ChatFABPosition } from './ChatFAB';
13
13
 
@@ -17,7 +17,7 @@ import { ChatFAB, type ChatFABPosition, type ChatFABProps } from './ChatFAB';
17
17
  import { ChatDock, type ChatDockProps } from './ChatDock';
18
18
  import { ChatGreeting, type ChatGreetingProps } from './ChatGreeting';
19
19
  import { ChatUnreadPreview, type ChatUnreadPreviewProps } from './ChatUnreadPreview';
20
- import { HeaderSlotsRenderer } from './HeaderSlots';
20
+ import { HeaderSlotsRenderer } from './header';
21
21
  import { resolveHeaderSlots, type ChatHeaderSlots } from './types';
22
22
 
23
23
  export interface ChatLauncherHotkey {
@@ -3,7 +3,13 @@
3
3
  import { Bot, X } from 'lucide-react';
4
4
  import type { ReactNode } from 'react';
5
5
 
6
- import { Button } from '@djangocfg/ui-core/components';
6
+ import {
7
+ Button,
8
+ Tooltip,
9
+ TooltipContent,
10
+ TooltipProvider,
11
+ TooltipTrigger,
12
+ } from '@djangocfg/ui-core/components';
7
13
  import { cn } from '@djangocfg/ui-core/lib';
8
14
 
9
15
  export interface ChatHeaderProps {
@@ -20,7 +26,7 @@ export interface ChatHeaderProps {
20
26
  showClose?: boolean;
21
27
  /** Close click handler. */
22
28
  onClose?: () => void;
23
- /** ARIA label for the close button. @default 'Close' */
29
+ /** ARIA label + tooltip for the close button. @default 'Close' */
24
30
  closeLabel?: string;
25
31
  /** Replace the close button entirely (rare — most hosts want the default). */
26
32
  closeSlot?: ReactNode;
@@ -60,15 +66,22 @@ export function ChatHeader({
60
66
  {actions}
61
67
  {closeSlot ??
62
68
  (showClose && onClose && (
63
- <Button
64
- variant="ghost"
65
- size="sm"
66
- onClick={onClose}
67
- aria-label={closeLabel}
68
- className="-mr-1 h-7 w-7 p-0"
69
- >
70
- <X className="h-4 w-4" />
71
- </Button>
69
+ <TooltipProvider delayDuration={300}>
70
+ <Tooltip>
71
+ <TooltipTrigger asChild>
72
+ <Button
73
+ variant="ghost"
74
+ size="sm"
75
+ onClick={onClose}
76
+ aria-label={closeLabel}
77
+ className="-mr-1 h-7 w-7 p-0"
78
+ >
79
+ <X className="h-4 w-4" />
80
+ </Button>
81
+ </TooltipTrigger>
82
+ <TooltipContent side="bottom">{closeLabel}</TooltipContent>
83
+ </Tooltip>
84
+ </TooltipProvider>
72
85
  ))}
73
86
  </div>
74
87
  </header>
@@ -3,14 +3,26 @@
3
3
  import { forwardRef } from 'react';
4
4
  import type { ButtonHTMLAttributes, ReactNode } from 'react';
5
5
 
6
+ import {
7
+ Tooltip,
8
+ TooltipContent,
9
+ TooltipProvider,
10
+ TooltipTrigger,
11
+ } from '@djangocfg/ui-core/components';
6
12
  import { cn } from '@djangocfg/ui-core/lib';
7
13
 
8
14
  export interface ChatHeaderActionButtonProps
9
15
  extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
10
16
  /** Icon (required). */
11
17
  icon: ReactNode;
12
- /** Accessible label + native tooltip. */
18
+ /** Accessible label also drives the hover/focus tooltip. */
13
19
  ariaLabel: string;
20
+ /**
21
+ * Tooltip copy. Defaults to `ariaLabel`. Pass to show a friendlier
22
+ * label than the (sometimes terse) aria string. Set `false` to opt
23
+ * out of the floating tooltip entirely (native `title` still applies).
24
+ */
25
+ tooltip?: ReactNode | false;
14
26
  /** Optional unread / status badge — small number on top-right. */
15
27
  badge?: number;
16
28
  /** Mark as destructive — uses destructive hover tokens. */
@@ -25,6 +37,9 @@ export interface ChatHeaderActionButtonProps
25
37
  * Standard chrome: 28×28 ghost button, hover bg-accent, focus ring, optional
26
38
  * destructive variant, optional numeric badge for unread / pending.
27
39
  *
40
+ * Shows a floating tooltip (ui-core `<Tooltip>`) on hover *and* keyboard
41
+ * focus; falls back to the native `title` attribute as well.
42
+ *
28
43
  * @example
29
44
  * ```tsx
30
45
  * <ChatHeader
@@ -50,10 +65,10 @@ export interface ChatHeaderActionButtonProps
50
65
  */
51
66
  export const ChatHeaderActionButton = forwardRef<HTMLButtonElement, ChatHeaderActionButtonProps>(
52
67
  function ChatHeaderActionButton(
53
- { icon, ariaLabel, badge, destructive, loading, disabled, className, ...rest },
68
+ { icon, ariaLabel, tooltip, badge, destructive, loading, disabled, className, ...rest },
54
69
  ref,
55
70
  ) {
56
- return (
71
+ const button = (
57
72
  <button
58
73
  ref={ref}
59
74
  type="button"
@@ -83,5 +98,21 @@ export const ChatHeaderActionButton = forwardRef<HTMLButtonElement, ChatHeaderAc
83
98
  )}
84
99
  </button>
85
100
  );
101
+
102
+ // Opted out — keep the native `title` only.
103
+ if (tooltip === false) return button;
104
+
105
+ // Floating tooltip on hover *and* keyboard focus. Self-contained
106
+ // `<TooltipProvider>` so the button works standalone without the
107
+ // host wiring an ambient provider; Radix dedupes nested providers.
108
+ const tooltipLabel = tooltip ?? ariaLabel;
109
+ return (
110
+ <TooltipProvider delayDuration={300}>
111
+ <Tooltip>
112
+ <TooltipTrigger asChild>{button}</TooltipTrigger>
113
+ <TooltipContent side="bottom">{tooltipLabel}</TooltipContent>
114
+ </Tooltip>
115
+ </TooltipProvider>
116
+ );
86
117
  },
87
118
  );
@@ -11,14 +11,14 @@ import {
11
11
  } from '@djangocfg/ui-core/components';
12
12
  import { cn } from '@djangocfg/ui-core/lib';
13
13
 
14
- import { findSpeechLanguage } from '../../SpeechRecognition';
14
+ import { findSpeechLanguage } from '../../../SpeechRecognition';
15
15
 
16
16
  import {
17
17
  WEB_SPEECH_LANGUAGES,
18
18
  countryFromTag,
19
19
  useResolvedLanguage,
20
20
  useSpeechPrefs,
21
- } from '../../SpeechRecognition';
21
+ } from '../../../SpeechRecognition';
22
22
 
23
23
  export interface ChatHeaderLanguageButtonProps {
24
24
  /** Override aria-label. Default "Speech language". */
@@ -5,7 +5,7 @@ import { PanelRightOpen, PanelRightClose } from 'lucide-react';
5
5
  import { useIsTabletOrBelow } from '@djangocfg/ui-core/hooks';
6
6
 
7
7
  import { ChatHeaderActionButton } from './ChatHeaderActionButton';
8
- import type { ChatDockMode } from './ChatDock';
8
+ import type { ChatDockMode } from '../ChatDock';
9
9
 
10
10
  export interface ChatHeaderModeToggleProps {
11
11
  /** Current dock mode. */
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { RotateCcw } from 'lucide-react';
4
4
 
5
- import { useChatReset } from '../hooks/useChatReset';
5
+ import { useChatReset } from '../../hooks/useChatReset';
6
6
  import { ChatHeaderActionButton } from './ChatHeaderActionButton';
7
7
 
8
8
  export interface ChatHeaderResetButtonProps {
@@ -85,6 +85,7 @@ export function ChatHeaderResetButton({
85
85
  <ChatHeaderActionButton
86
86
  icon={<RotateCcw className="h-3.5 w-3.5" />}
87
87
  ariaLabel={ariaLabel}
88
+ tooltip="Reset conversation"
88
89
  onClick={handleClick}
89
90
  loading={isResetting}
90
91
  destructive
@@ -2,14 +2,14 @@
2
2
 
3
3
  import { Fragment } from 'react';
4
4
 
5
- import { useChatContext } from '../context';
6
- import { useChatDockPrefs } from '../hooks/useChatDockPrefs';
5
+ import { useChatContext } from '../../context';
6
+ import { useChatDockPrefs } from '../../hooks/useChatDockPrefs';
7
7
 
8
8
  import { ChatHeaderAudioToggle } from './ChatHeaderAudioToggle';
9
9
  import { ChatHeaderLanguageButton } from './ChatHeaderLanguageButton';
10
10
  import { ChatHeaderModeToggle } from './ChatHeaderModeToggle';
11
11
  import { ChatHeaderResetButton } from './ChatHeaderResetButton';
12
- import type { ResolvedChatHeaderSlots } from './types';
12
+ import type { ResolvedChatHeaderSlots } from '../types';
13
13
 
14
14
  export interface HeaderSlotsRendererProps {
15
15
  slots: ResolvedChatHeaderSlots;
@@ -0,0 +1,26 @@
1
+ 'use client';
2
+
3
+ /** Launcher header — the docked chat header and its slot buttons. */
4
+
5
+ export { ChatHeader, type ChatHeaderProps } from './ChatHeader';
6
+ export {
7
+ ChatHeaderActionButton,
8
+ type ChatHeaderActionButtonProps,
9
+ } from './ChatHeaderActionButton';
10
+ export {
11
+ ChatHeaderModeToggle,
12
+ type ChatHeaderModeToggleProps,
13
+ } from './ChatHeaderModeToggle';
14
+ export {
15
+ ChatHeaderAudioToggle,
16
+ type ChatHeaderAudioToggleProps,
17
+ } from './ChatHeaderAudioToggle';
18
+ export {
19
+ ChatHeaderResetButton,
20
+ type ChatHeaderResetButtonProps,
21
+ } from './ChatHeaderResetButton';
22
+ export {
23
+ ChatHeaderLanguageButton,
24
+ type ChatHeaderLanguageButtonProps,
25
+ } from './ChatHeaderLanguageButton';
26
+ export { HeaderSlotsRenderer } from './HeaderSlots';
@@ -11,27 +11,20 @@ export {
11
11
  type ChatDockMode,
12
12
  type ChatDockSide,
13
13
  } from './ChatDock';
14
- export { ChatHeader, type ChatHeaderProps } from './ChatHeader';
15
14
  export {
15
+ ChatHeader,
16
+ type ChatHeaderProps,
16
17
  ChatHeaderActionButton,
17
18
  type ChatHeaderActionButtonProps,
18
- } from './ChatHeaderActionButton';
19
- export {
20
19
  ChatHeaderModeToggle,
21
20
  type ChatHeaderModeToggleProps,
22
- } from './ChatHeaderModeToggle';
23
- export {
24
21
  ChatHeaderAudioToggle,
25
22
  type ChatHeaderAudioToggleProps,
26
- } from './ChatHeaderAudioToggle';
27
- export {
28
23
  ChatHeaderResetButton,
29
24
  type ChatHeaderResetButtonProps,
30
- } from './ChatHeaderResetButton';
31
- export {
32
25
  ChatHeaderLanguageButton,
33
26
  type ChatHeaderLanguageButtonProps,
34
- } from './ChatHeaderLanguageButton';
27
+ } from './header';
35
28
  export {
36
29
  ChatLauncher,
37
30
  type ChatLauncherProps,