@flamingo-stack/openframe-frontend-core 0.0.457 → 0.0.458-snapshot.20260720215024

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 (290) hide show
  1. package/dist/chat-protocol/decode.d.ts +58 -0
  2. package/dist/chat-protocol/decode.d.ts.map +1 -0
  3. package/dist/chat-protocol/encode.d.ts +44 -0
  4. package/dist/chat-protocol/encode.d.ts.map +1 -0
  5. package/dist/chat-protocol/env-flag.d.ts +35 -0
  6. package/dist/chat-protocol/env-flag.d.ts.map +1 -0
  7. package/dist/chat-protocol/events.d.ts +192 -0
  8. package/dist/chat-protocol/events.d.ts.map +1 -0
  9. package/dist/chat-protocol/frames.d.ts +206 -0
  10. package/dist/chat-protocol/frames.d.ts.map +1 -0
  11. package/dist/chat-protocol/index.cjs +493 -0
  12. package/dist/chat-protocol/index.cjs.map +1 -0
  13. package/dist/chat-protocol/index.d.ts +18 -0
  14. package/dist/chat-protocol/index.d.ts.map +1 -0
  15. package/dist/chat-protocol/index.js +477 -0
  16. package/dist/chat-protocol/index.js.map +1 -0
  17. package/dist/chat-protocol/ip-normalize.d.ts +44 -0
  18. package/dist/chat-protocol/ip-normalize.d.ts.map +1 -0
  19. package/dist/chat-protocol/nats-decoder.d.ts +26 -0
  20. package/dist/chat-protocol/nats-decoder.d.ts.map +1 -0
  21. package/dist/{chunk-SQ3CP2IV.cjs → chunk-3N3TMZ62.cjs} +7 -7
  22. package/dist/{chunk-SQ3CP2IV.cjs.map → chunk-3N3TMZ62.cjs.map} +1 -1
  23. package/dist/{chunk-I7M6KCCS.js → chunk-4R6H2U77.js} +4 -4
  24. package/dist/{chunk-CCT5VCRP.cjs → chunk-4XDWNAZW.cjs} +9 -9
  25. package/dist/{chunk-CCT5VCRP.cjs.map → chunk-4XDWNAZW.cjs.map} +1 -1
  26. package/dist/{chunk-KQ36EHE4.cjs → chunk-7KSEINAE.cjs} +15 -15
  27. package/dist/{chunk-KQ36EHE4.cjs.map → chunk-7KSEINAE.cjs.map} +1 -1
  28. package/dist/{chunk-FM5DTJPA.cjs → chunk-ADD3FPDG.cjs} +6851 -4713
  29. package/dist/chunk-ADD3FPDG.cjs.map +1 -0
  30. package/dist/{chunk-RSW42GTZ.js → chunk-APF5QBAU.js} +2 -2
  31. package/dist/{chunk-YCIVMKRS.cjs → chunk-BLZZXZNM.cjs} +26 -26
  32. package/dist/{chunk-YCIVMKRS.cjs.map → chunk-BLZZXZNM.cjs.map} +1 -1
  33. package/dist/{chunk-YHB4MNUX.cjs → chunk-BQ7PMWLM.cjs} +28 -27
  34. package/dist/chunk-BQ7PMWLM.cjs.map +1 -0
  35. package/dist/{chunk-GJ7BN4MI.js → chunk-CGNDAJ7V.js} +4 -4
  36. package/dist/{chunk-R5IQJXA3.js → chunk-F2NMWV44.js} +2 -2
  37. package/dist/{chunk-EOVQVVDJ.cjs → chunk-F7F43U7Q.cjs} +11 -11
  38. package/dist/{chunk-EOVQVVDJ.cjs.map → chunk-F7F43U7Q.cjs.map} +1 -1
  39. package/dist/{chunk-2ZW2ZPDW.js → chunk-LAOO7XHO.js} +2 -2
  40. package/dist/{chunk-O7F7RZFN.js → chunk-LJKZIIK4.js} +6 -5
  41. package/dist/chunk-LJKZIIK4.js.map +1 -0
  42. package/dist/{chunk-AJGZ3YSR.js → chunk-OR5AMXYN.js} +2 -2
  43. package/dist/{chunk-5XFJG3TC.cjs → chunk-P5JQDFRM.cjs} +60 -60
  44. package/dist/chunk-P5JQDFRM.cjs.map +1 -0
  45. package/dist/{chunk-U4APSAAR.cjs → chunk-PXZ7YQ5V.cjs} +5 -5
  46. package/dist/{chunk-U4APSAAR.cjs.map → chunk-PXZ7YQ5V.cjs.map} +1 -1
  47. package/dist/{chunk-WXDEMTLD.js → chunk-QO2XD3FR.js} +2 -2
  48. package/dist/{chunk-C2TDHJBO.cjs → chunk-QSGZE6AZ.cjs} +37 -37
  49. package/dist/{chunk-C2TDHJBO.cjs.map → chunk-QSGZE6AZ.cjs.map} +1 -1
  50. package/dist/{chunk-NSL5MNS4.js → chunk-REWRUV3K.js} +11644 -9506
  51. package/dist/chunk-REWRUV3K.js.map +1 -0
  52. package/dist/{chunk-BDTQIIJR.cjs → chunk-TA7MFVUS.cjs} +31 -31
  53. package/dist/{chunk-BDTQIIJR.cjs.map → chunk-TA7MFVUS.cjs.map} +1 -1
  54. package/dist/{chunk-4423DHRX.js → chunk-UI7CIUAR.js} +2 -2
  55. package/dist/{chunk-5BKBG653.js → chunk-VXJH5TDN.js} +10 -10
  56. package/dist/chunk-VXJH5TDN.js.map +1 -0
  57. package/dist/{chunk-AB65PWU2.cjs → chunk-WCE66C2Z.cjs} +62 -62
  58. package/dist/{chunk-AB65PWU2.cjs.map → chunk-WCE66C2Z.cjs.map} +1 -1
  59. package/dist/{chunk-KXIIUE75.js → chunk-XF5ROTMQ.js} +2 -2
  60. package/dist/components/case-studies/index.cjs +8 -8
  61. package/dist/components/case-studies/index.js +2 -2
  62. package/dist/components/chart.d.ts +1 -1
  63. package/dist/components/chat/chat-message-enhanced.d.ts.map +1 -1
  64. package/dist/components/chat/chat-message-list.d.ts.map +1 -1
  65. package/dist/components/chat/hooks/index.d.ts +0 -1
  66. package/dist/components/chat/hooks/index.d.ts.map +1 -1
  67. package/dist/components/chat/hooks/use-chat.d.ts.map +1 -1
  68. package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts +15 -48
  69. package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts.map +1 -1
  70. package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts +3 -47
  71. package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts.map +1 -1
  72. package/dist/components/chat/index.cjs +10 -2
  73. package/dist/components/chat/index.cjs.map +1 -1
  74. package/dist/components/chat/index.d.ts +1 -0
  75. package/dist/components/chat/index.d.ts.map +1 -1
  76. package/dist/components/chat/index.js +21 -13
  77. package/dist/components/chat/stream/chat-dialog-store.d.ts +184 -0
  78. package/dist/components/chat/stream/chat-dialog-store.d.ts.map +1 -0
  79. package/dist/components/chat/stream/chat-stream-reducer.d.ts +367 -0
  80. package/dist/components/chat/stream/chat-stream-reducer.d.ts.map +1 -0
  81. package/dist/components/chat/stream/delta-batcher.d.ts +51 -0
  82. package/dist/components/chat/stream/delta-batcher.d.ts.map +1 -0
  83. package/dist/components/chat/stream/index.d.ts +17 -0
  84. package/dist/components/chat/stream/index.d.ts.map +1 -0
  85. package/dist/components/chat/stream/message-mutations.d.ts +77 -0
  86. package/dist/components/chat/stream/message-mutations.d.ts.map +1 -0
  87. package/dist/components/chat/stream/use-chat-stream-reducer.d.ts +22 -0
  88. package/dist/components/chat/stream/use-chat-stream-reducer.d.ts.map +1 -0
  89. package/dist/components/chat/types/api.types.d.ts +1 -81
  90. package/dist/components/chat/types/api.types.d.ts.map +1 -1
  91. package/dist/components/chat/types/processing.types.d.ts +2 -90
  92. package/dist/components/chat/types/processing.types.d.ts.map +1 -1
  93. package/dist/components/chat/utils/extract-incomplete-message-state.d.ts +34 -6
  94. package/dist/components/chat/utils/extract-incomplete-message-state.d.ts.map +1 -1
  95. package/dist/components/chat/utils/index.d.ts +2 -3
  96. package/dist/components/chat/utils/index.d.ts.map +1 -1
  97. package/dist/components/chat/utils/process-historical-messages.d.ts +59 -11
  98. package/dist/components/chat/utils/process-historical-messages.d.ts.map +1 -1
  99. package/dist/components/contact/index.cjs +3 -3
  100. package/dist/components/contact/index.js +2 -2
  101. package/dist/components/docs/index.cjs +5 -5
  102. package/dist/components/docs/index.js +4 -4
  103. package/dist/components/embeds/index.cjs +3 -3
  104. package/dist/components/embeds/index.js +2 -2
  105. package/dist/components/faq/index.cjs +3 -3
  106. package/dist/components/faq/index.js +2 -2
  107. package/dist/components/features/index.cjs +2 -2
  108. package/dist/components/features/index.js +1 -1
  109. package/dist/components/features/time-tracker/time-tracker-panel.d.ts.map +1 -1
  110. package/dist/components/help-center-pages/index.cjs +20 -20
  111. package/dist/components/help-center-pages/index.js +11 -11
  112. package/dist/components/index.cjs +171 -129
  113. package/dist/components/index.cjs.map +1 -1
  114. package/dist/components/index.js +63 -21
  115. package/dist/components/index.js.map +1 -1
  116. package/dist/components/layout/page-container.d.ts.map +1 -1
  117. package/dist/components/navigation/index.cjs +2 -2
  118. package/dist/components/navigation/index.js +1 -1
  119. package/dist/components/onboarding-guides/index.cjs +5 -5
  120. package/dist/components/onboarding-guides/index.js +4 -4
  121. package/dist/components/onboarding-guides/onboarding-guide-detail-view.d.ts.map +1 -1
  122. package/dist/components/related-content/index.cjs +3 -3
  123. package/dist/components/related-content/index.js +2 -2
  124. package/dist/components/shared/product-release/release-detail-page.d.ts.map +1 -1
  125. package/dist/components/tickets/index.cjs +5 -5
  126. package/dist/components/tickets/index.js +4 -4
  127. package/dist/components/ui/index.cjs +44 -2
  128. package/dist/components/ui/index.cjs.map +1 -1
  129. package/dist/components/ui/index.d.ts +1 -2
  130. package/dist/components/ui/index.d.ts.map +1 -1
  131. package/dist/components/ui/index.js +55 -13
  132. package/dist/components/ui/markdown/base-components.d.ts +56 -0
  133. package/dist/components/ui/markdown/base-components.d.ts.map +1 -0
  134. package/dist/components/ui/markdown/engine.d.ts +99 -0
  135. package/dist/components/ui/markdown/engine.d.ts.map +1 -0
  136. package/dist/components/ui/markdown/heading-ids.d.ts +65 -0
  137. package/dist/components/ui/markdown/heading-ids.d.ts.map +1 -0
  138. package/dist/components/ui/markdown/index.d.ts +18 -0
  139. package/dist/components/ui/markdown/index.d.ts.map +1 -0
  140. package/dist/components/ui/markdown/mermaid-diagram.d.ts +79 -0
  141. package/dist/components/ui/markdown/mermaid-diagram.d.ts.map +1 -0
  142. package/dist/components/ui/markdown/rich/embed-overrides.d.ts +14 -0
  143. package/dist/components/ui/markdown/rich/embed-overrides.d.ts.map +1 -0
  144. package/dist/components/ui/markdown/rich/rich-markdown-renderer.d.ts +40 -0
  145. package/dist/components/ui/markdown/rich/rich-markdown-renderer.d.ts.map +1 -0
  146. package/dist/components/ui/markdown/rich/shortcodes.d.ts +8 -0
  147. package/dist/components/ui/markdown/rich/shortcodes.d.ts.map +1 -0
  148. package/dist/components/ui/markdown/sanitize.d.ts +153 -0
  149. package/dist/components/ui/markdown/sanitize.d.ts.map +1 -0
  150. package/dist/components/ui/markdown/simple-markdown-renderer.d.ts +23 -0
  151. package/dist/components/ui/markdown/simple-markdown-renderer.d.ts.map +1 -0
  152. package/dist/components/ui/markdown/streaming.d.ts +78 -0
  153. package/dist/components/ui/markdown/streaming.d.ts.map +1 -0
  154. package/dist/components/ui/markdown/text-size.d.ts +34 -0
  155. package/dist/components/ui/markdown/text-size.d.ts.map +1 -0
  156. package/dist/components/ui/modal-v2.d.ts.map +1 -1
  157. package/dist/components/ui/modal.d.ts.map +1 -1
  158. package/dist/index.cjs +60 -2
  159. package/dist/index.cjs.map +1 -1
  160. package/dist/index.js +71 -13
  161. package/dist/utils/index.cjs +169 -40
  162. package/dist/utils/index.cjs.map +1 -1
  163. package/dist/utils/index.d.ts +1 -0
  164. package/dist/utils/index.d.ts.map +1 -1
  165. package/dist/utils/index.js +162 -41
  166. package/dist/utils/index.js.map +1 -1
  167. package/dist/utils/markdown-fences.d.ts +42 -0
  168. package/dist/utils/markdown-fences.d.ts.map +1 -0
  169. package/dist/utils/markdown-heading-id.d.ts +85 -0
  170. package/dist/utils/markdown-heading-id.d.ts.map +1 -0
  171. package/dist/utils/markdown-section-extractor.d.ts.map +1 -1
  172. package/package.json +7 -1
  173. package/src/chat-protocol/__tests__/__snapshots__/nats-decoder-golden.test.ts.snap +307 -0
  174. package/src/chat-protocol/__tests__/chat-protocol.test.ts +515 -0
  175. package/src/chat-protocol/__tests__/env-flag.test.ts +52 -0
  176. package/src/chat-protocol/__tests__/ip-normalize.test.ts +136 -0
  177. package/src/chat-protocol/__tests__/nats-decoder-golden.test.ts +228 -0
  178. package/src/chat-protocol/decode.ts +277 -0
  179. package/src/chat-protocol/encode.ts +71 -0
  180. package/src/chat-protocol/env-flag.ts +39 -0
  181. package/src/chat-protocol/events.ts +228 -0
  182. package/src/chat-protocol/frames.ts +238 -0
  183. package/src/chat-protocol/index.ts +21 -0
  184. package/src/chat-protocol/ip-normalize.ts +146 -0
  185. package/src/chat-protocol/nats-decoder.ts +252 -0
  186. package/src/components/chat/__tests__/chat-message-list.test.tsx +293 -5
  187. package/src/components/chat/__tests__/chat-message-streaming-memo.test.tsx +207 -0
  188. package/src/components/chat/__tests__/chat-pending-turn.test.tsx +209 -0
  189. package/src/components/chat/chat-message-enhanced.tsx +111 -17
  190. package/src/components/chat/chat-message-list.tsx +367 -113
  191. package/src/components/chat/embeddable-chat.tsx +6 -0
  192. package/src/components/chat/hooks/.index.md +1 -1
  193. package/src/components/chat/hooks/.use-nats-chat-adapter.md +1 -1
  194. package/src/components/chat/hooks/__tests__/__snapshots__/persisted-state-v1-golden.test.ts.snap +297 -0
  195. package/src/components/chat/hooks/__tests__/__snapshots__/sse-stream-golden.test.ts.snap +0 -0
  196. package/src/components/chat/hooks/__tests__/persisted-state-v1-golden.test.ts +272 -0
  197. package/src/components/chat/hooks/__tests__/sse-stream-golden.test.ts +318 -0
  198. package/src/components/chat/hooks/index.ts +0 -1
  199. package/src/components/chat/hooks/use-chat.ts +8 -0
  200. package/src/components/chat/hooks/use-nats-chat-adapter.ts +243 -822
  201. package/src/components/chat/hooks/use-sse-chat-adapter.ts +318 -666
  202. package/src/components/chat/index.ts +5 -0
  203. package/src/components/chat/stream/__tests__/__snapshots__/chat-stream-reducer-golden.test.ts.snap +937 -0
  204. package/src/components/chat/stream/__tests__/chat-dialog-store.test.ts +756 -0
  205. package/src/components/chat/stream/__tests__/chat-stream-reducer-golden.test.ts +460 -0
  206. package/src/components/chat/stream/__tests__/chat-stream-reducer.test.ts +894 -0
  207. package/src/components/chat/stream/__tests__/delta-batcher.test.ts +255 -0
  208. package/src/components/chat/stream/__tests__/use-chat-stream-reducer.test.ts +98 -0
  209. package/src/components/chat/stream/chat-dialog-store.ts +536 -0
  210. package/src/components/chat/stream/chat-stream-reducer.ts +1796 -0
  211. package/src/components/chat/stream/delta-batcher.ts +159 -0
  212. package/src/components/chat/stream/index.ts +55 -0
  213. package/src/components/chat/stream/message-mutations.ts +338 -0
  214. package/src/components/chat/stream/use-chat-stream-reducer.ts +126 -0
  215. package/src/components/chat/thinking-display.tsx +1 -1
  216. package/src/components/chat/types/.api.types.md +1 -3
  217. package/src/components/chat/types/.processing.types.md +6 -23
  218. package/src/components/chat/types/api.types.ts +6 -73
  219. package/src/components/chat/types/processing.types.ts +11 -52
  220. package/src/components/chat/utils/.index.md +0 -5
  221. package/src/components/chat/utils/__tests__/__snapshots__/process-historical-messages-golden.test.ts.snap +418 -0
  222. package/src/components/chat/utils/__tests__/__snapshots__/segment-accumulator-golden.test.ts.snap +599 -0
  223. package/src/components/chat/utils/__tests__/process-historical-messages-golden.test.ts +317 -0
  224. package/src/components/chat/utils/__tests__/segment-accumulator-golden.test.ts +270 -0
  225. package/src/components/chat/utils/extract-incomplete-message-state.ts +63 -5
  226. package/src/components/chat/utils/index.ts +5 -8
  227. package/src/components/chat/utils/process-historical-messages.ts +352 -383
  228. package/src/components/features/notifications/notification-drawer.tsx +4 -2
  229. package/src/components/features/time-tracker/time-tracker-panel.tsx +8 -2
  230. package/src/components/layout/page-container.tsx +5 -1
  231. package/src/components/onboarding-guides/onboarding-guide-detail-view.tsx +22 -4
  232. package/src/components/shared/legal-document/legal-document-page.tsx +1 -1
  233. package/src/components/shared/product-release/release-detail-page.tsx +19 -4
  234. package/src/components/ui/__tests__/__snapshots__/markdown-parity.test.tsx.snap +2420 -0
  235. package/src/components/ui/__tests__/markdown-parity.test.tsx +2528 -0
  236. package/src/components/ui/index.ts +1 -2
  237. package/src/components/ui/markdown/__tests__/mermaid-security.test.ts +115 -0
  238. package/src/components/ui/markdown/__tests__/mermaid-stale-render.test.tsx +95 -0
  239. package/src/components/ui/markdown/__tests__/sanitize-invariant.test.ts +309 -0
  240. package/src/components/ui/markdown/__tests__/streaming.test.tsx +388 -0
  241. package/src/components/ui/markdown/base-components.tsx +341 -0
  242. package/src/components/ui/markdown/engine.tsx +315 -0
  243. package/src/components/ui/markdown/heading-ids.ts +239 -0
  244. package/src/components/ui/markdown/index.ts +49 -0
  245. package/src/components/ui/markdown/mermaid-diagram.tsx +291 -0
  246. package/src/components/ui/markdown/rich/embed-overrides.tsx +199 -0
  247. package/src/components/ui/markdown/rich/rich-markdown-renderer.tsx +184 -0
  248. package/src/components/ui/markdown/rich/shortcodes.ts +170 -0
  249. package/src/components/ui/markdown/sanitize.ts +3499 -0
  250. package/src/components/ui/markdown/simple-markdown-renderer.tsx +28 -0
  251. package/src/components/ui/markdown/streaming.ts +362 -0
  252. package/src/components/ui/markdown/text-size.ts +106 -0
  253. package/src/components/ui/modal-v2.tsx +6 -0
  254. package/src/components/ui/modal.tsx +3 -0
  255. package/src/components/ui/release-changelog-section.tsx +1 -1
  256. package/src/components/ui/ticket-info-section.tsx +1 -1
  257. package/src/utils/index.ts +1 -0
  258. package/src/utils/markdown-fences.ts +127 -0
  259. package/src/utils/markdown-heading-id.ts +348 -0
  260. package/src/utils/markdown-section-extractor.ts +41 -56
  261. package/dist/chunk-5BKBG653.js.map +0 -1
  262. package/dist/chunk-5XFJG3TC.cjs.map +0 -1
  263. package/dist/chunk-FM5DTJPA.cjs.map +0 -1
  264. package/dist/chunk-NSL5MNS4.js.map +0 -1
  265. package/dist/chunk-O7F7RZFN.js.map +0 -1
  266. package/dist/chunk-YHB4MNUX.cjs.map +0 -1
  267. package/dist/components/chat/hooks/use-realtime-chunk-processor.d.ts +0 -6
  268. package/dist/components/chat/hooks/use-realtime-chunk-processor.d.ts.map +0 -1
  269. package/dist/components/chat/utils/chunk-parser.d.ts +0 -25
  270. package/dist/components/chat/utils/chunk-parser.d.ts.map +0 -1
  271. package/dist/components/ui/rich-markdown-renderer.d.ts +0 -34
  272. package/dist/components/ui/rich-markdown-renderer.d.ts.map +0 -1
  273. package/dist/components/ui/simple-markdown-renderer.d.ts +0 -73
  274. package/dist/components/ui/simple-markdown-renderer.d.ts.map +0 -1
  275. package/src/components/chat/hooks/.use-realtime-chunk-processor.md +0 -50
  276. package/src/components/chat/hooks/use-realtime-chunk-processor.ts +0 -479
  277. package/src/components/chat/utils/.chunk-parser.md +0 -51
  278. package/src/components/chat/utils/chunk-parser.ts +0 -255
  279. package/src/components/ui/.simple-markdown-renderer.md +0 -40
  280. package/src/components/ui/rich-markdown-renderer.tsx +0 -1223
  281. package/src/components/ui/simple-markdown-renderer.tsx +0 -965
  282. /package/dist/{chunk-I7M6KCCS.js.map → chunk-4R6H2U77.js.map} +0 -0
  283. /package/dist/{chunk-RSW42GTZ.js.map → chunk-APF5QBAU.js.map} +0 -0
  284. /package/dist/{chunk-GJ7BN4MI.js.map → chunk-CGNDAJ7V.js.map} +0 -0
  285. /package/dist/{chunk-R5IQJXA3.js.map → chunk-F2NMWV44.js.map} +0 -0
  286. /package/dist/{chunk-2ZW2ZPDW.js.map → chunk-LAOO7XHO.js.map} +0 -0
  287. /package/dist/{chunk-AJGZ3YSR.js.map → chunk-OR5AMXYN.js.map} +0 -0
  288. /package/dist/{chunk-WXDEMTLD.js.map → chunk-QO2XD3FR.js.map} +0 -0
  289. /package/dist/{chunk-4423DHRX.js.map → chunk-UI7CIUAR.js.map} +0 -0
  290. /package/dist/{chunk-KXIIUE75.js.map → chunk-XF5ROTMQ.js.map} +0 -0
@@ -151,7 +151,9 @@ import {
151
151
  CustomerInterviewCard,
152
152
  CustomerInterviewCardSkeleton,
153
153
  DEFAULT_CUSTOM_STATUS_COLOR,
154
+ DEFAULT_DIALOG_SIDE,
154
155
  DEFAULT_DOCUMENT_TYPE_TO_TABLE_ID,
156
+ DEFAULT_MAX_REDUCERS,
155
157
  DashboardInfoCard,
156
158
  DataRoomDocCard,
157
159
  DataRoomDocCardSkeleton,
@@ -253,9 +255,11 @@ import {
253
255
  ListPageContainer,
254
256
  ListPageLayout,
255
257
  LoadError,
258
+ MAX_PENDING_RETAIN_KEYS,
256
259
  MESSAGE_ROLE,
257
260
  MESSAGE_TYPE,
258
261
  MarkdownEditor,
262
+ MarkdownEngine,
259
263
  MarqueeWall,
260
264
  MarqueeWallFades,
261
265
  MediaTypeSelector,
@@ -276,6 +280,7 @@ import {
276
280
  MenubarSubContent,
277
281
  MenubarSubTrigger,
278
282
  MenubarTrigger,
283
+ MermaidDiagram,
279
284
  MessageSegmentAccumulator,
280
285
  MingoChatHistory,
281
286
  MingoChatHistorySkeleton,
@@ -359,11 +364,13 @@ import {
359
364
  RoadmapCard,
360
365
  RoadmapCardSkeleton,
361
366
  RoadmapVoteButton,
367
+ SAFE_HTML_TAGS,
362
368
  SCROLL_ANCHOR,
363
369
  SCROLL_ANCHOR_WIRE_KEY,
364
370
  SECTION_HEADING_CLASS,
365
371
  SOURCE_ICON_NAMES,
366
372
  SOURCE_LABELS_BY_TABLE,
373
+ SVG_TAGS,
367
374
  SYNTHETIC_REALTIME_ID_PREFIXES,
368
375
  ScrollFadeOverlay,
369
376
  SearchInput,
@@ -401,6 +408,7 @@ import {
401
408
  StatusBadge,
402
409
  StatusIndicator,
403
410
  Switch,
411
+ TEXT_SIZE_PRESETS,
404
412
  TICKET_STATUS_COLOR_PRESETS,
405
413
  TITLE_BLOCK_MIN_HEIGHT,
406
414
  TabContent,
@@ -461,27 +469,39 @@ import {
461
469
  buildChatAttachmentViewUrl,
462
470
  buildChatRefKey,
463
471
  buildDiscussAddendum,
472
+ buildEffectiveTagSet,
473
+ buildHeadingIdMap,
464
474
  buildNatsWsUrl,
465
475
  buildProductReleaseCardProps,
476
+ buildSanitizeSchema,
466
477
  buildStreamFrames,
478
+ cardAwareUrlTransform,
467
479
  chatChipClass,
468
480
  clickupTaskUrl,
481
+ completeStreamingTail,
469
482
  computeHistoryPrepend,
470
483
  computeIsNewTab,
484
+ createChatDialogStore,
485
+ createChatStreamReducer,
471
486
  createColumnHelper,
487
+ createDeltaBatcher,
488
+ createEmptyTurnMeta,
472
489
  createMessageSegmentAccumulator,
473
490
  decideNewTab,
491
+ decodeHistoricalMessageData,
474
492
  defaultBuildProductReleaseCardProps,
475
493
  defaultTableIdForDocumentType,
476
494
  deriveColumns,
477
495
  escapeMarkdownInline,
496
+ escapeUnknownHtmlTags,
478
497
  executeNavigation,
479
498
  executeNavigationImperative,
480
499
  exportToCSV,
481
500
  extractEntityIdFilter,
482
501
  extractErrorMessages,
483
502
  extractIncompleteMessageState,
484
- extractTextFromChunk,
503
+ extractIncompleteTailState,
504
+ extractText,
485
505
  fetchEmptyStateConfig,
486
506
  fetchSlashCommands,
487
507
  flattenAssistantContent,
@@ -520,11 +540,8 @@ import {
520
540
  hideOnError,
521
541
  historicalToUnified,
522
542
  interleave,
523
- isControlChunk,
524
543
  isCrossOriginUrl,
525
- isErrorChunk,
526
544
  isHistoricalUserTurn,
527
- isMetadataChunk,
528
545
  isModifierClick,
529
546
  isQuickActionIconSpec,
530
547
  isStructuredContent,
@@ -540,12 +557,13 @@ import {
540
557
  normalizeContent,
541
558
  normalizeHistoricalMessageData,
542
559
  normalizeIconKey,
543
- parseChunkToAction,
544
560
  parseScrollAnchor,
545
561
  parseWireCommandOverride,
546
562
  processHistoricalMessages,
547
563
  processHistoricalMessagesWithErrors,
564
+ processShortcodes,
548
565
  programItemToStripProfile,
566
+ rehypeStripUnsafe,
549
567
  remarkCardLinks,
550
568
  remarkMentionChips,
551
569
  renderChatInlineEntityCard,
@@ -555,9 +573,11 @@ import {
555
573
  resolveSourceIcon,
556
574
  resolveSourceRowCTA,
557
575
  resolveStatusTagProps,
576
+ resolveTextSizeConfig,
558
577
  resolveTicketStatus,
559
578
  safeHref,
560
579
  sanitizeTitleForChat,
580
+ splitStreamingBlocks,
561
581
  statusBadgeVariants,
562
582
  stripChatAttachmentMarkdown,
563
583
  stripSameOriginToPath,
@@ -572,6 +592,7 @@ import {
572
592
  useChatAttachments,
573
593
  useChatCardItem,
574
594
  useChatIdentity,
595
+ useChatStreamReducer,
575
596
  useChunkCatchup,
576
597
  useCloseOnNavigation,
577
598
  useCollapsible,
@@ -580,13 +601,13 @@ import {
580
601
  useDataTableContext,
581
602
  useEmptyStateConfig,
582
603
  useFinePointer,
604
+ useHeadingIdMap,
583
605
  useJetStreamDialogSubscription,
584
606
  useMarqueeSync,
585
607
  useNatsChatAdapter,
586
608
  useNatsDialogSubscription,
587
609
  usePageActionsBottomPadding,
588
610
  useProxiedImageUrl,
589
- useRealtimeChunkProcessor,
590
611
  useSSE,
591
612
  useScriptedStream,
592
613
  useScrollFade,
@@ -595,7 +616,7 @@ import {
595
616
  useSseChatAdapter,
596
617
  useUnifiedChat,
597
618
  usesCanonicalStatusStyle
598
- } from "../../chunk-NSL5MNS4.js";
619
+ } from "../../chunk-REWRUV3K.js";
599
620
  import {
600
621
  CommandApprovalToast,
601
622
  ToastCard,
@@ -809,7 +830,9 @@ export {
809
830
  CustomerInterviewCard,
810
831
  CustomerInterviewCardSkeleton,
811
832
  DEFAULT_CUSTOM_STATUS_COLOR,
833
+ DEFAULT_DIALOG_SIDE,
812
834
  DEFAULT_DOCUMENT_TYPE_TO_TABLE_ID,
835
+ DEFAULT_MAX_REDUCERS,
813
836
  DashboardInfoCard,
814
837
  DataRoomDocCard,
815
838
  DataRoomDocCardSkeleton,
@@ -930,9 +953,11 @@ export {
930
953
  LoadError,
931
954
  CheckCircleIcon as LucideCheckCircleIcon,
932
955
  XIcon as LucideXIcon,
956
+ MAX_PENDING_RETAIN_KEYS,
933
957
  MESSAGE_ROLE,
934
958
  MESSAGE_TYPE,
935
959
  MarkdownEditor,
960
+ MarkdownEngine,
936
961
  MarqueeWall,
937
962
  MarqueeWallFades,
938
963
  MediaTypeSelector,
@@ -952,6 +977,7 @@ export {
952
977
  MenubarSubContent,
953
978
  MenubarSubTrigger,
954
979
  MenubarTrigger,
980
+ MermaidDiagram,
955
981
  MessageSegmentAccumulator,
956
982
  MingoChatHistory,
957
983
  MingoChatHistorySkeleton,
@@ -1035,11 +1061,13 @@ export {
1035
1061
  RoadmapCard,
1036
1062
  RoadmapCardSkeleton,
1037
1063
  RoadmapVoteButton,
1064
+ SAFE_HTML_TAGS,
1038
1065
  SCROLL_ANCHOR,
1039
1066
  SCROLL_ANCHOR_WIRE_KEY,
1040
1067
  SECTION_HEADING_CLASS,
1041
1068
  SOURCE_ICON_NAMES,
1042
1069
  SOURCE_LABELS_BY_TABLE,
1070
+ SVG_TAGS,
1043
1071
  SYNTHETIC_REALTIME_ID_PREFIXES,
1044
1072
  ScrollFadeOverlay,
1045
1073
  SearchInput,
@@ -1086,6 +1114,7 @@ export {
1086
1114
  StatusBadge,
1087
1115
  StatusIndicator,
1088
1116
  Switch,
1117
+ TEXT_SIZE_PRESETS,
1089
1118
  TICKET_STATUS_COLOR_PRESETS,
1090
1119
  TITLE_BLOCK_MIN_HEIGHT,
1091
1120
  TabContent,
@@ -1148,31 +1177,43 @@ export {
1148
1177
  buildChatAttachmentViewUrl,
1149
1178
  buildChatRefKey,
1150
1179
  buildDiscussAddendum,
1180
+ buildEffectiveTagSet,
1181
+ buildHeadingIdMap,
1151
1182
  buildNatsWsUrl,
1152
1183
  buildProductReleaseCardProps,
1184
+ buildSanitizeSchema,
1153
1185
  buildStreamFrames,
1154
1186
  buttonVariants,
1187
+ cardAwareUrlTransform,
1155
1188
  embedAuthedFetch as chatAuthedFetch,
1156
1189
  chatChipClass,
1157
1190
  clearEmbedProxyAuth as clearChatProxyAuth,
1158
1191
  clickupTaskUrl,
1192
+ completeStreamingTail,
1159
1193
  computeHistoryPrepend,
1160
1194
  computeIsNewTab,
1195
+ createChatDialogStore,
1196
+ createChatStreamReducer,
1161
1197
  createColumnHelper,
1198
+ createDeltaBatcher,
1199
+ createEmptyTurnMeta,
1162
1200
  createMessageSegmentAccumulator,
1163
1201
  decideNewTab,
1202
+ decodeHistoricalMessageData,
1164
1203
  defaultBuildProductReleaseCardProps,
1165
1204
  defaultTableIdForDocumentType,
1166
1205
  deriveColumns,
1167
1206
  dotColorByVariant,
1168
1207
  escapeMarkdownInline,
1208
+ escapeUnknownHtmlTags,
1169
1209
  executeNavigation,
1170
1210
  executeNavigationImperative,
1171
1211
  exportToCSV,
1172
1212
  extractEntityIdFilter,
1173
1213
  extractErrorMessages,
1174
1214
  extractIncompleteMessageState,
1175
- extractTextFromChunk,
1215
+ extractIncompleteTailState,
1216
+ extractText,
1176
1217
  fetchEmptyStateConfig,
1177
1218
  fetchSlashCommands,
1178
1219
  flattenAssistantContent,
@@ -1213,11 +1254,8 @@ export {
1213
1254
  hideOnError,
1214
1255
  historicalToUnified,
1215
1256
  interleave,
1216
- isControlChunk,
1217
1257
  isCrossOriginUrl,
1218
- isErrorChunk,
1219
1258
  isHistoricalUserTurn,
1220
- isMetadataChunk,
1221
1259
  isModifierClick,
1222
1260
  isQuickActionIconSpec,
1223
1261
  isStructuredContent,
@@ -1233,13 +1271,14 @@ export {
1233
1271
  normalizeContent,
1234
1272
  normalizeHistoricalMessageData,
1235
1273
  normalizeIconKey,
1236
- parseChunkToAction,
1237
1274
  parseScrollAnchor,
1238
1275
  parseWireCommandOverride,
1239
1276
  processHistoricalMessages,
1240
1277
  processHistoricalMessagesWithErrors,
1278
+ processShortcodes,
1241
1279
  programItemToStripProfile,
1242
1280
  progressColorByVariant,
1281
+ rehypeStripUnsafe,
1243
1282
  remarkCardLinks,
1244
1283
  remarkMentionChips,
1245
1284
  renderChatInlineEntityCard,
@@ -1249,12 +1288,14 @@ export {
1249
1288
  resolveSourceIcon,
1250
1289
  resolveSourceRowCTA,
1251
1290
  resolveStatusTagProps,
1291
+ resolveTextSizeConfig,
1252
1292
  resolveTicketStatus,
1253
1293
  safeHref,
1254
1294
  sanitizeTitleForChat,
1255
1295
  setEmbedProxyAuth as setChatProxyAuth,
1256
1296
  showCommandApprovalToast,
1257
1297
  showToast,
1298
+ splitStreamingBlocks,
1258
1299
  statusBadgeVariants,
1259
1300
  stripChatAttachmentMarkdown,
1260
1301
  stripSameOriginToPath,
@@ -1269,6 +1310,7 @@ export {
1269
1310
  useChatAttachments,
1270
1311
  useChatCardItem,
1271
1312
  useChatIdentity,
1313
+ useChatStreamReducer,
1272
1314
  useChunkCatchup,
1273
1315
  useCloseOnNavigation,
1274
1316
  useCollapsible,
@@ -1278,13 +1320,13 @@ export {
1278
1320
  useSseChatAdapter as useEmbeddedChat,
1279
1321
  useEmptyStateConfig,
1280
1322
  useFinePointer,
1323
+ useHeadingIdMap,
1281
1324
  useJetStreamDialogSubscription,
1282
1325
  useMarqueeSync,
1283
1326
  useNatsChatAdapter,
1284
1327
  useNatsDialogSubscription,
1285
1328
  usePageActionsBottomPadding,
1286
1329
  useProxiedImageUrl,
1287
- useRealtimeChunkProcessor,
1288
1330
  useSSE,
1289
1331
  useScriptedStream,
1290
1332
  useScrollFade,
@@ -0,0 +1,56 @@
1
+ import type { Components } from 'react-markdown';
2
+ import type { ResolveLinkResult } from '../../../types/doc-source';
3
+ import type { TextSizeElement } from './text-size';
4
+ /**
5
+ * True when an image `src` is worth rendering. Shared by the base `img` and
6
+ * the rich composition's `img` / `video` overrides so the empty-`![]()`
7
+ * guard has exactly one definition.
8
+ */
9
+ export declare function hasRenderableSrc(src: unknown): src is string;
10
+ export interface BuildBaseComponentsOptions {
11
+ textSizes: Record<TextSizeElement, string>;
12
+ demoteMarkdownH1ToH2: boolean;
13
+ brokenLinks: readonly string[];
14
+ currentPath?: string;
15
+ onInternalLinkClick?: (path: string, options?: {
16
+ expandFolder?: boolean;
17
+ fromInternalLink?: boolean;
18
+ }) => void;
19
+ onResolveLink?: (href: string, currentPath: string) => Promise<ResolveLinkResult>;
20
+ }
21
+ /**
22
+ * The standard leaf renderers (`code` block + inline, `blockquote`, `div`
23
+ * pass-through) as standalone functions.
24
+ *
25
+ * SSOT for compositions that must OVERRIDE these renderers for a narrow
26
+ * special case and then fall through: the rich composition intercepts embed
27
+ * fence languages, shortcode-expanded `div`s and Reddit's `reddit-embed-bq`
28
+ * blockquote, and delegates everything else here. Previously it reproduced
29
+ * these renderers byte-for-byte, so any class change here silently drifted
30
+ * on content surfaces.
31
+ *
32
+ * THESE MUST STAY HOOK-FREE: the rich composition calls them as plain
33
+ * functions from inside its own renderers (`standard.code(props)`), which is
34
+ * not a React render of a component and would break the rules of hooks.
35
+ * Hook-using renderers (the headings, which read the heading-line offset
36
+ * from context) live in `buildBaseComponents` below and are never delegated
37
+ * to this way.
38
+ *
39
+ * ODS-TOKENS FLAG (ODS_TOKEN_RULES §Typography / §General): inline code keeps
40
+ * an inline `text-[0.9em]`, carried over verbatim from the pre-unification
41
+ * renderers — ODS has no relative-to-parent code size, so mapping it onto an
42
+ * existing token would visibly change every inline code span. Same shape as
43
+ * the flag in ./text-size.ts — flagged for addition to ODS, not copied
44
+ * anywhere else.
45
+ *
46
+ * The code BLOCK's font is NOT flagged: the raw "JetBrains Mono", "SF Mono",
47
+ * Consolas stack the old renderer inlined is gone, replaced by Tailwind's
48
+ * `font-mono` (→ `var(--font-family-heading)`, the Azeret Mono ODS stack) —
49
+ * the same class the inline-code branch below already used, so the two code
50
+ * surfaces no longer disagree about their family.
51
+ */
52
+ export declare function buildStandardLeafRenderers({ textSizes, }: {
53
+ textSizes: Record<TextSizeElement, string>;
54
+ }): Pick<Components, 'code' | 'blockquote' | 'div'>;
55
+ export declare function buildBaseComponents({ textSizes, demoteMarkdownH1ToH2, brokenLinks, currentPath: propCurrentPath, onInternalLinkClick, onResolveLink, }: BuildBaseComponentsOptions): Components;
56
+ //# sourceMappingURL=base-components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-components.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/markdown/base-components.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAUnD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM,CAE5D;AAED,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IAC3C,oBAAoB,EAAE,OAAO,CAAC;IAC9B,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAC;QAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAC/G,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACnF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,SAAS,GACV,EAAE;IACD,SAAS,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;CAC5C,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,YAAY,GAAG,KAAK,CAAC,CA4DlD;AAED,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,oBAAoB,EACpB,WAAW,EACX,WAAW,EAAE,eAAe,EAC5B,mBAAmB,EACnB,aAAa,GACd,EAAE,0BAA0B,GAAG,UAAU,CAmMzC"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * MarkdownEngine — THE one react-markdown pipeline for every surface
3
+ * (chat messages, blog, docs, KB articles, legal, releases, admin previews).
4
+ *
5
+ * `SimpleMarkdownRenderer` and `RichMarkdownRenderer` are thin compositions
6
+ * over this engine (see ./simple-markdown-renderer.tsx and ./rich/) — there
7
+ * is exactly ONE parse path, ONE sanitizer stack, ONE mermaid, ONE
8
+ * heading-id algorithm, ONE link-click model. Do not fork this pipeline;
9
+ * extend via `componentOverrides` / `additionalRemarkPlugins` /
10
+ * `preprocessContent` / `extraAllowedHtmlTags`.
11
+ *
12
+ * Pipeline order (each stage documented in ./sanitize.ts):
13
+ * preprocessContent (composition hook, e.g. shortcodes)
14
+ * → completeStreamingTail (streaming only — MUST precede the escape pass)
15
+ * → escapeUnknownHtmlTags (text pre-pass, React 19 crash guard)
16
+ * → remark: remarkGfm, remarkBreaks, ...additionalRemarkPlugins
17
+ * → rehype: rehypeRaw → rehypeSanitize(schema) → rehypeStripUnsafe
18
+ * → rehypeHighlight
19
+ * → urlTransform: cardAwareUrlTransform
20
+ * → components: buildBaseComponents(...) spread-last componentOverrides
21
+ */
22
+ import React from 'react';
23
+ import { type Components } from 'react-markdown';
24
+ import type { PluggableList } from 'unified';
25
+ import type { ResolveLinkResult } from '../../../types/doc-source';
26
+ import { type TextSizeConfig } from './text-size';
27
+ import { type HeadingSection } from './heading-ids';
28
+ export type { ResolveLinkResult };
29
+ /**
30
+ * Module-scope empty default for `brokenLinks`.
31
+ *
32
+ * A `brokenLinks = []` DEFAULT PARAMETER allocates a fresh array on every
33
+ * render, so the `components` useMemo (which lists it as a dep) recomputed
34
+ * every render, which changed `StreamingBlockRenderer`'s `components` prop
35
+ * identity, which made its `memo` bail EVERY time — every completed block
36
+ * re-parsed on every streamed token, defeating the entire atomic-block
37
+ * optimization. Any new default that is an object/array/function MUST be
38
+ * hoisted here for the same reason.
39
+ *
40
+ * Exported so the compositions that apply the SAME default before handing
41
+ * props down (rich) share this ONE identity instead of declaring a second
42
+ * module-scope empty array with a copy of this rationale. Deliberately NOT
43
+ * re-exported from ./index — it is an internal identity contract between the
44
+ * engine and its compositions, not public API.
45
+ */
46
+ export declare const NO_BROKEN_LINKS: readonly string[];
47
+ export interface MarkdownEngineProps {
48
+ content: string;
49
+ className?: string;
50
+ /** Backend-provided heading IDs for deep-link anchors */
51
+ sectionIds?: HeadingSection[];
52
+ /** When the page already has an H1, render markdown `#` as `<h2>` */
53
+ demoteMarkdownH1ToH2?: boolean;
54
+ /** List of broken link hrefs detected server-side (shown with [BROKEN] badge) */
55
+ brokenLinks?: readonly string[];
56
+ /** Callback for internal (non-http, non-anchor) link clicks */
57
+ onInternalLinkClick?: (path: string, options?: {
58
+ expandFolder?: boolean;
59
+ fromInternalLink?: boolean;
60
+ }) => void;
61
+ /** Current documentation path — enables internal-link mode when set */
62
+ currentPath?: string;
63
+ /** Resolve an internal link href to a navigation path. */
64
+ onResolveLink?: (href: string, currentPath: string) => Promise<ResolveLinkResult>;
65
+ /** Pre-process the raw markdown string before rendering (e.g. shortcode expansion) */
66
+ preprocessContent?: (content: string) => string;
67
+ /** Merge additional or override react-markdown component renderers (spread LAST — caller wins) */
68
+ componentOverrides?: Partial<Components>;
69
+ /** Extra remark plugins appended after the built-in remarkGfm + remarkBreaks */
70
+ additionalRemarkPlugins?: PluggableList;
71
+ /** Text sizing preset / per-element overrides */
72
+ textSize?: TextSizeConfig;
73
+ /**
74
+ * Extra raw-HTML tags this composition admits. Unioned into BOTH the
75
+ * text pre-pass allowlist AND the sanitize schema together (the
76
+ * coupled-allowlist invariant — see ./sanitize.ts).
77
+ */
78
+ extraAllowedHtmlTags?: string[];
79
+ /**
80
+ * Set true for the actively streaming message ONLY. Enables atomic-block
81
+ * memoization + fence tail-completion + an aria-live wrapper. The caller
82
+ * MUST flip back to false on completion — that final render is one
83
+ * authoritative whole-document parse (block cache discarded), so
84
+ * streaming can never permanently diverge from the settled output.
85
+ */
86
+ streaming?: boolean;
87
+ }
88
+ /**
89
+ * Memoized so a parent re-render with UNCHANGED props (same `content`
90
+ * string, same memoized `componentOverrides`/plugins) does NOT re-parse the
91
+ * markdown. Re-parsing rebuilds the entire react-markdown subtree, which
92
+ * RE-MOUNTS any embedded inline entity cards — closing their open menus and
93
+ * re-triggering their fetch on every chat re-render (streaming chunk AND
94
+ * scroll). With stable props the renderer bails, so completed messages'
95
+ * cards stay mounted. The streaming path additionally memoizes completed
96
+ * atomic blocks so the in-flight message re-parses only its live tail.
97
+ */
98
+ export declare const MarkdownEngine: React.NamedExoticComponent<MarkdownEngineProps>;
99
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/markdown/engine.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAsB,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAM7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAQnE,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AAIvB,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAElC;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAAO,CAAC;AAErD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;IAC9B,qEAAqE;IACrE,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,iFAAiF;IACjF,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,+DAA+D;IAC/D,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAC;QAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAC/G,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAClF,sFAAsF;IACtF,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IAChD,kGAAkG;IAClG,kBAAkB,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACzC,gFAAgF;IAChF,uBAAuB,CAAC,EAAE,aAAa,CAAC;IACxC,iDAAiD;IACjD,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAqMD;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,iDAA2B,CAAC"}
@@ -0,0 +1,65 @@
1
+ export interface HeadingSection {
2
+ id: string;
3
+ title: string;
4
+ level: number;
5
+ }
6
+ /** `line (1-based, document-wide) → heading id`. */
7
+ export type HeadingIdMap = ReadonlyMap<number, string>;
8
+ /**
9
+ * Line offset added to unit-relative hast positions. Non-zero only on the
10
+ * streaming path, where each atomic unit is parsed by its own
11
+ * `ReactMarkdown` (see `StreamingBlock.startLine`).
12
+ */
13
+ export declare const HeadingLineOffsetContext: import("react").Context<number>;
14
+ /**
15
+ * The document's heading-id map, delivered by CONTEXT rather than baked into
16
+ * the react-markdown `components` map on purpose: the map is rebuilt on every
17
+ * streamed token (its input is the growing `processedContent`), so listing it
18
+ * as a `components` memo dep would change that map's identity each token and
19
+ * make every completed streaming block's `memo` bail — the exact regression
20
+ * `NO_BROKEN_LINKS` was introduced to fix. Through context only the heading
21
+ * renderers re-render.
22
+ */
23
+ export declare const HeadingIdMapContext: import("react").Context<HeadingIdMap>;
24
+ /** Look up the pre-computed id for a heading hast node. Pure. */
25
+ export declare function useHeadingId(node: any): string | undefined;
26
+ /**
27
+ * Build the document's `line → id` map. Pure: same content + same
28
+ * `sectionIds` always yields the same map.
29
+ */
30
+ export declare function buildHeadingIdMap(content: string, sectionIds?: HeadingSection[]): HeadingIdMap;
31
+ /**
32
+ * Memoized `buildHeadingIdMap` for the engine, with the map's IDENTITY held
33
+ * stable across content changes that don't touch any heading.
34
+ *
35
+ * `content` changes on every streamed token, so the `useMemo` alone rebuilt
36
+ * a fresh `Map` per token; that map is the context value, so EVERY heading
37
+ * consumer in every already-completed block re-rendered on every token —
38
+ * the same identity-churn class `NO_BROKEN_LINKS` exists to prevent, just
39
+ * one layer down. Rebuilding is cheap; re-rendering the consumers is not, so
40
+ * the newly built map is compared to the previous one and the previous
41
+ * object is returned when the entries match.
42
+ */
43
+ export declare function useHeadingIdMap(content: string, sectionIds?: HeadingSection[]): HeadingIdMap;
44
+ /**
45
+ * Fallback id for a heading the source scan could NOT see — in practice only
46
+ * a heading synthesized by a caller remark/rehype plugin, which carries no
47
+ * source position. (Setext, blockquote/list-nested ATX and multiple raw
48
+ * `<hN>`s on one line are all scanned now, so they no longer land here.)
49
+ *
50
+ * Routed through the SAME dedupe shape as the map so a fallback id can never
51
+ * collide with an assigned one. It stays PURE — `taken` is derived from the
52
+ * map, not from render order — which is why two position-less headings with
53
+ * IDENTICAL text still collide with each other: disambiguating those would
54
+ * require the shared mutable counter this module deleted.
55
+ */
56
+ export declare function resolveFallbackHeadingId(base: string, taken: ReadonlySet<string>): string;
57
+ /**
58
+ * The ids already assigned by the document's heading-id map. Cached per map
59
+ * IDENTITY, which `useHeadingIdMap` now keeps stable across heading-free
60
+ * token growth — so this is O(headings) once, not per heading per token.
61
+ */
62
+ export declare function useAssignedHeadingIds(): ReadonlySet<string>;
63
+ /** Extract plain text from React children (headings receive mixed nodes). */
64
+ export declare function extractText(node: any): string;
65
+ //# sourceMappingURL=heading-ids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"heading-ids.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/markdown/heading-ids.ts"],"names":[],"mappings":"AAoCA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd;AAED,oDAAoD;AACpD,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAUtD;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,iCAAmB,CAAA;AAIxD;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,uCAAiD,CAAA;AAEjF,iEAAiE;AAEjE,wBAAgB,YAAY,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAK1D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,cAAc,EAAE,GAC5B,YAAY,CAoEd;AAYD;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,cAAc,EAAE,GAC5B,YAAY,CAQd;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,CAMzF;AAKD;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,WAAW,CAAC,MAAM,CAAC,CAO3D;AAED,6EAA6E;AAE7E,wBAAgB,WAAW,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM,CAK7C"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Unified markdown module — public surface.
3
+ *
4
+ * ONE engine (`MarkdownEngine`), two named compositions:
5
+ * - `SimpleMarkdownRenderer` — chat/doc surfaces (embed-free bundle)
6
+ * - `RichMarkdownRenderer` — authored-content surfaces (shortcodes,
7
+ * social embeds, Video SSOT, OG previews)
8
+ */
9
+ export { MarkdownEngine, type MarkdownEngineProps } from './engine';
10
+ export { SimpleMarkdownRenderer, type SimpleMarkdownRendererProps, type ResolveLinkResult, } from './simple-markdown-renderer';
11
+ export { RichMarkdownRenderer, type RichMarkdownRendererProps, } from './rich/rich-markdown-renderer';
12
+ export { processShortcodes } from './rich/shortcodes';
13
+ export { SAFE_HTML_TAGS, SVG_TAGS, buildEffectiveTagSet, buildSanitizeSchema, cardAwareUrlTransform, escapeUnknownHtmlTags, rehypeStripUnsafe, } from './sanitize';
14
+ export { TEXT_SIZE_PRESETS, resolveTextSizeConfig, type TextSizeConfig, type TextSizeClassMap, type TextSizeElement, type TextSizePreset, } from './text-size';
15
+ export { MermaidDiagram } from './mermaid-diagram';
16
+ export { buildHeadingIdMap, useHeadingIdMap, extractText, type HeadingSection, type HeadingIdMap, } from './heading-ids';
17
+ export { splitStreamingBlocks, completeStreamingTail, type StreamingBlock } from './streaming';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/markdown/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,EACL,sBAAsB,EACtB,KAAK,2BAA2B,EAChC,KAAK,iBAAiB,GACvB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,KAAK,yBAAyB,GAC/B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EACL,cAAc,EACd,QAAQ,EACR,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,KAAK,cAAc,EACnB,KAAK,YAAY,GAClB,MAAM,eAAe,CAAC;AAKvB,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Single MermaidDiagram for the unified markdown engine (dark theme only —
3
+ * the old RichMarkdownRenderer's light-theme branch was dead code behind a
4
+ * hardcoded `isDarkMode = true` and is deleted, not carried over).
5
+ *
6
+ * `mermaid` stays a dynamic import so neither chat nor content bundles pay
7
+ * for it unless a diagram is actually rendered.
8
+ */
9
+ import React from 'react';
10
+ /**
11
+ * SECURITY SSOT for the mermaid renderer — the ONLY place these knobs are
12
+ * written. `./__tests__/mermaid-security.test.ts` imports THIS constant and
13
+ * spreads it into its own `mermaid.initialize`, so the fixture and the
14
+ * component can no longer drift: flipping `securityLevel` to `'loose'` here
15
+ * fails the suite (verified by doing exactly that).
16
+ *
17
+ * This renderer sits on the CHAT path, so the diagram source is MODEL output
18
+ * — untrusted by construction — and the rendered SVG goes through
19
+ * `dangerouslySetInnerHTML`. The pre-unification renderer used `'loose'`,
20
+ * which permits raw HTML inside labels and enables mermaid's `click`
21
+ * interaction directive: a node label like `A["<img src=x onerror=...>"]`
22
+ * would have produced LIVE HTML.
23
+ *
24
+ * - `securityLevel: 'strict'` encodes HTML tags in text and disables click
25
+ * handlers.
26
+ * - `htmlLabels: false` renders labels as SVG `<text>` instead of a
27
+ * foreignObject HTML subtree, so there is no HTML surface at all. Verified:
28
+ * no authored diagram in this repo or in the consuming hub's markdown uses
29
+ * HTML labels (not even `<br/>`), so 'antiscript' (which still allows tags)
30
+ * is not needed. (`htmlLabels` is set at the ROOT — `flowchart.htmlLabels`
31
+ * is deprecated in mermaid 11 and the root value takes precedence.)
32
+ * - `secure` is the allowlist of config keys a `%%{init}%%` directive in the
33
+ * diagram SOURCE may NOT override. mermaid's default list covers
34
+ * `securityLevel` but NOT `htmlLabels`, so model-authored source could
35
+ * otherwise re-enable HTML labels while `securityLevel` stayed locked.
36
+ * Adding `htmlLabels` (plus `secure` itself and the resource limits) closes
37
+ * that hole.
38
+ *
39
+ * jsdom NOTE: with `htmlLabels` unlocked, a `%%{init: {"htmlLabels": true}}%%`
40
+ * directive was observed to make `mermaid.render` never settle under jsdom
41
+ * (>60s, against a passing two-render control). This was NOT reproduced in a
42
+ * real browser and may well be an artifact of jsdom having no layout — do not
43
+ * read it as a confirmed browser DoS. Either way the render below is wrapped
44
+ * in a timeout so a non-settling render surfaces the error state instead of
45
+ * sitting on "Rendering diagram…" forever.
46
+ */
47
+ export declare const MERMAID_SECURITY_OPTIONS: {
48
+ htmlLabels: false;
49
+ securityLevel: "strict";
50
+ secure: string[];
51
+ };
52
+ /** Upper bound on a single `mermaid.render`. Generous enough that no honest
53
+ * diagram hits it; short enough that a wedged render becomes a visible error
54
+ * instead of a permanent skeleton. */
55
+ export declare const MERMAID_RENDER_TIMEOUT_MS = 15000;
56
+ /**
57
+ * ODS-TOKENS FLAG (ODS_TOKEN_RULES §Colors / §Typography / §General):
58
+ * `mermaidStyles` below and the `themeVariables` / `fontFamily` / `fontSize`
59
+ * block in `MermaidDiagram` carry RAW hex colors, a literal font-family and
60
+ * literal px font sizes.
61
+ *
62
+ * Reason: mermaid's configuration is not CSS — `themeVariables` is a
63
+ * JavaScript API whose values are baked into the generated SVG as literal
64
+ * attribute strings, so a `var(--color-…)` reference resolves to nothing
65
+ * there. On top of that, ODS has NO 10-step categorical color ramp, and
66
+ * mermaid's `cScale0…cScale9` requires exactly one. The palette is carried
67
+ * over VERBATIM from the pre-unification RichMarkdownRenderer, so this is
68
+ * parity, not new divergence; the missing categorical-ramp tokens are
69
+ * flagged here for addition to ODS.
70
+ *
71
+ * Scope: this exemption covers THIS file only, and only the mermaid config
72
+ * surface. Do NOT copy this pattern — every other style in the markdown
73
+ * module uses ODS semantic classes.
74
+ */
75
+ export declare const mermaidStyles = "\n .mermaid-svg-container svg {\n max-width: 100% !important;\n height: auto !important;\n min-height: 200px;\n font-family: 'DM Sans', sans-serif !important;\n font-size: 14px !important;\n }\n @media (min-width: 1520px) {\n .mermaid-svg-container svg {\n max-width: 900px !important;\n max-height: 700px !important;\n min-height: 300px;\n font-size: 16px !important;\n }\n }\n @media (min-width: 768px) and (max-width: 1519px) {\n .mermaid-svg-container svg {\n max-width: 700px !important;\n max-height: 600px !important;\n min-height: 250px;\n font-size: 15px !important;\n }\n }\n @media (max-width: 767px) {\n .mermaid-svg-container svg {\n max-width: 90vw !important;\n max-height: 400px !important;\n min-height: 200px;\n font-size: 13px !important;\n }\n }\n .mermaid-svg-container svg[width] { width: 100% !important; }\n .mermaid-svg-container .node rect,\n .mermaid-svg-container .node circle,\n .mermaid-svg-container .node ellipse,\n .mermaid-svg-container .node polygon { stroke-width: 2px !important; }\n .mermaid-svg-container .edgePath path { stroke-width: 2px !important; }\n @media (min-width: 768px) {\n .mermaid-svg-container .node text,\n .mermaid-svg-container .edgeLabel text { font-size: 14px !important; }\n }\n @media (min-width: 1520px) {\n .mermaid-svg-container .node text,\n .mermaid-svg-container .edgeLabel text { font-size: 16px !important; }\n }\n";
76
+ export declare const MermaidDiagram: React.FC<{
77
+ chart: string;
78
+ }>;
79
+ //# sourceMappingURL=mermaid-diagram.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mermaid-diagram.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/markdown/mermaid-diagram.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,wBAAwB;;;;CAIqC,CAAC;AAE3E;;uCAEuC;AACvC,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAkBhD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,aAAa,u+CA8CzB,CAAC;AAQF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CA2ItD,CAAC"}