@lobehub/ui 5.3.0 → 5.5.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 (363) hide show
  1. package/es/Accordion/Accordion.d.mts +2 -2
  2. package/es/Accordion/AccordionItem.d.mts +2 -2
  3. package/es/ActionIcon/ActionIcon.d.mts +2 -2
  4. package/es/Alert/Alert.d.mts +2 -2
  5. package/es/AutoComplete/Select.d.mts +2 -2
  6. package/es/Avatar/AvatarGroup/index.d.mts +2 -2
  7. package/es/Burger/Burger.d.mts +2 -2
  8. package/es/CodeEditor/CodeEditor.d.mts +2 -2
  9. package/es/Collapse/Collapse.d.mts +2 -2
  10. package/es/ConfigProvider/index.d.mts +2 -2
  11. package/es/CopyButton/CopyButton.d.mts +2 -2
  12. package/es/DatePicker/DatePicker.d.mts +2 -2
  13. package/es/DraggablePanel/components/DraggablePanelBody.d.mts +2 -2
  14. package/es/DraggablePanel/components/DraggablePanelContainer.d.mts +2 -2
  15. package/es/DraggablePanel/components/DraggablePanelFooter.d.mts +2 -2
  16. package/es/DraggablePanel/components/DraggablePanelHeader.d.mts +2 -2
  17. package/es/DraggableSideNav/DraggableSideNav.d.mts +2 -2
  18. package/es/Drawer/Drawer.d.mts +2 -2
  19. package/es/Dropdown/Dropdown.d.mts +2 -2
  20. package/es/EditableText/EditableText.d.mts +2 -2
  21. package/es/EmojiPicker/EmojiPicker.d.mts +2 -2
  22. package/es/EmojiPicker/EmojiPicker.mjs +1 -1
  23. package/es/EmojiPicker/type.d.mts +1 -1
  24. package/es/Flex/FlexBasic.d.mts +2 -2
  25. package/es/FontLoader/index.d.mts +2 -2
  26. package/es/Footer/Footer.d.mts +2 -2
  27. package/es/Form/components/FormGroup.d.mts +2 -2
  28. package/es/Form/components/FormItem.d.mts +2 -2
  29. package/es/Form/components/FormSubmitFooter.d.mts +2 -2
  30. package/es/FormModal/FormModal.d.mts +2 -2
  31. package/es/Freeze/Freeze.d.mts +2 -2
  32. package/es/GuideCard/GuideCard.d.mts +2 -2
  33. package/es/Header/Header.d.mts +2 -2
  34. package/es/Highlighter/Highlighter.d.mts +2 -2
  35. package/es/Highlighter/SyntaxHighlighter/index.d.mts +2 -2
  36. package/es/Hotkey/Hotkey.d.mts +2 -2
  37. package/es/HotkeyInput/HotkeyInput.d.mts +2 -2
  38. package/es/HotkeyInput/HotkeyInput.mjs +30 -8
  39. package/es/HotkeyInput/HotkeyInput.mjs.map +1 -1
  40. package/es/HotkeyInput/type.d.mts +3 -0
  41. package/es/Icon/Icon.d.mts +2 -2
  42. package/es/Icon/components/IconProvider.d.mts +3 -3
  43. package/es/Image/PreviewGroup.d.mts +2 -2
  44. package/es/ImageSelect/ImageSelect.d.mts +2 -2
  45. package/es/Input/Input.d.mts +2 -2
  46. package/es/Input/InputNumber.d.mts +2 -2
  47. package/es/Input/InputOPT.d.mts +2 -2
  48. package/es/Input/InputPassword.d.mts +2 -2
  49. package/es/Input/TextArea.d.mts +2 -2
  50. package/es/Layout/components/LayoutFooter.d.mts +2 -2
  51. package/es/Layout/components/LayoutHeader.d.mts +2 -2
  52. package/es/Layout/components/LayoutMain.d.mts +2 -2
  53. package/es/Layout/components/LayoutSidebar.d.mts +2 -2
  54. package/es/Layout/components/LayoutSidebarInner.d.mts +2 -2
  55. package/es/Layout/components/LayoutToc.d.mts +2 -2
  56. package/es/List/ListItem/index.d.mts +2 -2
  57. package/es/Markdown/Markdown.d.mts +2 -2
  58. package/es/Markdown/Markdown.mjs +2 -1
  59. package/es/Markdown/Markdown.mjs.map +1 -1
  60. package/es/Markdown/SyntaxMarkdown/StreamdownRender.mjs +56 -30
  61. package/es/Markdown/SyntaxMarkdown/StreamdownRender.mjs.map +1 -1
  62. package/es/Markdown/SyntaxMarkdown/style.mjs +2 -2
  63. package/es/Markdown/SyntaxMarkdown/style.mjs.map +1 -1
  64. package/es/Markdown/SyntaxMarkdown/useSmoothStreamContent.mjs +229 -0
  65. package/es/Markdown/SyntaxMarkdown/useSmoothStreamContent.mjs.map +1 -0
  66. package/es/Markdown/SyntaxMarkdown/useStreamQueue.mjs +8 -6
  67. package/es/Markdown/SyntaxMarkdown/useStreamQueue.mjs.map +1 -1
  68. package/es/Markdown/Typography.d.mts +2 -2
  69. package/es/Markdown/components/SearchResultCards/index.d.mts +2 -2
  70. package/es/Markdown/index.d.mts +2 -2
  71. package/es/Markdown/plugins/rehypeStreamAnimated.d.mts +2 -0
  72. package/es/Markdown/plugins/rehypeStreamAnimated.mjs +17 -5
  73. package/es/Markdown/plugins/rehypeStreamAnimated.mjs.map +1 -1
  74. package/es/Markdown/type.d.mts +3 -1
  75. package/es/MaskShadow/MaskShadow.d.mts +2 -2
  76. package/es/Menu/Menu.d.mts +2 -2
  77. package/es/Mermaid/Mermaid.d.mts +2 -2
  78. package/es/Mermaid/SyntaxMermaid/index.d.mts +2 -2
  79. package/es/Modal/Modal.d.mts +2 -2
  80. package/es/Modal/ModalProvider.d.mts +2 -2
  81. package/es/Modal/ModalStackItem.mjs +2 -2
  82. package/es/Modal/ModalStackItem.mjs.map +1 -1
  83. package/es/Modal/imperative.d.mts +2 -2
  84. package/es/MotionProvider/index.d.mts +2 -2
  85. package/es/Popover/index.d.mts +9 -8
  86. package/es/Popover/index.mjs +6 -6
  87. package/es/SearchBar/SearchBar.d.mts +2 -2
  88. package/es/Segmented/Segmented.d.mts +2 -2
  89. package/es/Select/Select.d.mts +2 -2
  90. package/es/SideNav/SideNav.d.mts +2 -2
  91. package/es/SliderWithInput/SliderWithInput.d.mts +2 -2
  92. package/es/SortableList/components/DragHandle.d.mts +2 -2
  93. package/es/SortableList/components/SortableItem.d.mts +2 -2
  94. package/es/ThemeProvider/ThemeProvider.d.mts +2 -2
  95. package/es/Toc/Toc.d.mts +2 -2
  96. package/es/Video/index.d.mts +2 -2
  97. package/es/awesome/AuroraBackground/AuroraBackground.d.mts +2 -2
  98. package/es/awesome/BottomGradientButton/BottomGradientButton.d.mts +2 -2
  99. package/es/awesome/Features/Features.d.mts +2 -2
  100. package/es/awesome/Giscus/Giscus.d.mts +2 -2
  101. package/es/awesome/GradientButton/GradientButton.d.mts +2 -2
  102. package/es/awesome/GridBackground/GridBackground.d.mts +2 -2
  103. package/es/awesome/GridBackground/GridShowcase.d.mts +2 -2
  104. package/es/awesome/Hero/Hero.d.mts +2 -2
  105. package/es/awesome/Spline/Spine.d.mts +2 -2
  106. package/es/awesome/Spotlight/Spotlight.d.mts +2 -2
  107. package/es/awesome/SpotlightCard/SpotlightCard.d.mts +2 -2
  108. package/es/awesome/TypewriterEffect/TypewriterEffect.d.mts +2 -2
  109. package/es/base-ui/ContextMenu/ContextMenuHost.d.mts +2 -2
  110. package/es/base-ui/DropdownMenu/DropdownMenu.d.mts +2 -2
  111. package/es/base-ui/DropdownMenu/atoms.d.mts +18 -18
  112. package/es/base-ui/Modal/atoms.d.mts +12 -12
  113. package/es/base-ui/Modal/context.d.mts +2 -2
  114. package/es/base-ui/Modal/imperative.d.mts +2 -2
  115. package/es/base-ui/Popover/ArrowIcon.d.mts +7 -0
  116. package/es/{Popover → base-ui/Popover}/ArrowIcon.mjs +1 -1
  117. package/es/base-ui/Popover/ArrowIcon.mjs.map +1 -0
  118. package/es/{Popover → base-ui/Popover}/Popover.d.mts +2 -2
  119. package/es/{Popover → base-ui/Popover}/Popover.mjs +2 -2
  120. package/es/base-ui/Popover/Popover.mjs.map +1 -0
  121. package/es/{Popover → base-ui/Popover}/PopoverGroup.d.mts +1 -1
  122. package/es/{Popover → base-ui/Popover}/PopoverGroup.mjs +4 -4
  123. package/es/base-ui/Popover/PopoverGroup.mjs.map +1 -0
  124. package/es/{Popover → base-ui/Popover}/PopoverInGroup.mjs +3 -3
  125. package/es/base-ui/Popover/PopoverInGroup.mjs.map +1 -0
  126. package/es/{Popover → base-ui/Popover}/PopoverPortal.d.mts +1 -1
  127. package/es/{Popover → base-ui/Popover}/PopoverPortal.mjs +2 -2
  128. package/es/base-ui/Popover/PopoverPortal.mjs.map +1 -0
  129. package/es/{Popover → base-ui/Popover}/PopoverStandalone.mjs +5 -5
  130. package/es/base-ui/Popover/PopoverStandalone.mjs.map +1 -0
  131. package/es/{Popover → base-ui/Popover}/atoms.d.mts +10 -10
  132. package/es/{Popover → base-ui/Popover}/atoms.mjs +4 -4
  133. package/es/base-ui/Popover/atoms.mjs.map +1 -0
  134. package/es/{Popover → base-ui/Popover}/context.d.mts +3 -3
  135. package/es/{Popover → base-ui/Popover}/context.mjs +1 -1
  136. package/es/base-ui/Popover/context.mjs.map +1 -0
  137. package/es/{Popover → base-ui/Popover}/groupContext.d.mts +1 -1
  138. package/es/{Popover → base-ui/Popover}/groupContext.mjs +1 -1
  139. package/es/base-ui/Popover/groupContext.mjs.map +1 -0
  140. package/es/base-ui/Popover/index.d.mts +8 -0
  141. package/es/{Popover → base-ui/Popover}/style.mjs +2 -2
  142. package/es/base-ui/Popover/style.mjs.map +1 -0
  143. package/es/{Popover → base-ui/Popover}/type.d.mts +4 -4
  144. package/es/{Popover → base-ui/Popover}/useMergedPopoverProps.mjs +1 -1
  145. package/es/base-ui/Popover/useMergedPopoverProps.mjs.map +1 -0
  146. package/es/base-ui/ScrollArea/atoms.d.mts +7 -7
  147. package/es/base-ui/Select/Select.d.mts +2 -2
  148. package/es/base-ui/Select/atoms.d.mts +19 -19
  149. package/es/base-ui/Switch/Switch.d.mts +2 -2
  150. package/es/base-ui/Switch/atoms.d.mts +4 -4
  151. package/es/base-ui/Toast/imperative.d.mts +2 -2
  152. package/es/base-ui/index.d.mts +9 -1
  153. package/es/base-ui/index.mjs +7 -1
  154. package/es/brand/LobeChat/index.d.mts +2 -2
  155. package/es/brand/LobeHub/index.d.mts +2 -2
  156. package/es/brand/LogoThree/LogoSpline.d.mts +2 -2
  157. package/es/brand/LogoThree/index.d.mts +2 -2
  158. package/es/chat/BackBottom/BackBottom.d.mts +2 -2
  159. package/es/chat/ChatInputArea/components/ChatInputAreaInner.d.mts +2 -2
  160. package/es/chat/ChatItem/ChatItem.d.mts +2 -2
  161. package/es/chat/ChatList/ChatList.d.mts +2 -2
  162. package/es/chat/EditableMessage/EditableMessage.d.mts +2 -2
  163. package/es/chat/EditableMessageList/EditableMessageList.d.mts +2 -2
  164. package/es/chat/MessageInput/MessageInput.d.mts +2 -2
  165. package/es/chat/MessageModal/MessageModal.d.mts +2 -2
  166. package/es/color/ColorScales/index.d.mts +2 -2
  167. package/es/color/CssVar/index.d.mts +2 -2
  168. package/es/i18n/context.d.mts +2 -2
  169. package/es/i18n/resources/en/hotkey.d.mts +1 -0
  170. package/es/i18n/resources/en/hotkey.mjs +1 -0
  171. package/es/i18n/resources/en/hotkey.mjs.map +1 -1
  172. package/es/i18n/resources/zhCn/hotkey.d.mts +1 -0
  173. package/es/i18n/resources/zhCn/hotkey.mjs +1 -0
  174. package/es/i18n/resources/zhCn/hotkey.mjs.map +1 -1
  175. package/es/icons/Discord/components/Avatar.d.mts +9 -0
  176. package/es/icons/Discord/components/Avatar.mjs +22 -0
  177. package/es/icons/Discord/components/Avatar.mjs.map +1 -0
  178. package/es/icons/Discord/components/Color.d.mts +7 -0
  179. package/es/icons/Discord/components/Color.mjs +30 -0
  180. package/es/icons/Discord/components/Color.mjs.map +1 -0
  181. package/es/icons/Discord/components/Mono.d.mts +7 -0
  182. package/es/icons/Discord/components/Mono.mjs +29 -0
  183. package/es/icons/Discord/components/Mono.mjs.map +1 -0
  184. package/es/icons/Discord/index.d.mts +15 -0
  185. package/es/icons/Discord/index.mjs +18 -0
  186. package/es/icons/Discord/index.mjs.map +1 -0
  187. package/es/icons/Discord/style.mjs +7 -0
  188. package/es/icons/Discord/style.mjs.map +1 -0
  189. package/es/icons/GoogleChat/components/Avatar.d.mts +9 -0
  190. package/es/icons/GoogleChat/components/Avatar.mjs +23 -0
  191. package/es/icons/GoogleChat/components/Avatar.mjs.map +1 -0
  192. package/es/icons/GoogleChat/components/Color.d.mts +7 -0
  193. package/es/icons/GoogleChat/components/Color.mjs +93 -0
  194. package/es/icons/GoogleChat/components/Color.mjs.map +1 -0
  195. package/es/icons/GoogleChat/components/Mono.d.mts +7 -0
  196. package/es/icons/GoogleChat/components/Mono.mjs +29 -0
  197. package/es/icons/GoogleChat/components/Mono.mjs.map +1 -0
  198. package/es/icons/GoogleChat/index.d.mts +15 -0
  199. package/es/icons/GoogleChat/index.mjs +18 -0
  200. package/es/icons/GoogleChat/index.mjs.map +1 -0
  201. package/es/icons/GoogleChat/style.mjs +7 -0
  202. package/es/icons/GoogleChat/style.mjs.map +1 -0
  203. package/es/icons/IMessage/components/Avatar.d.mts +9 -0
  204. package/es/icons/IMessage/components/Avatar.mjs +23 -0
  205. package/es/icons/IMessage/components/Avatar.mjs.map +1 -0
  206. package/es/icons/IMessage/components/Color.d.mts +7 -0
  207. package/es/icons/IMessage/components/Color.mjs +30 -0
  208. package/es/icons/IMessage/components/Color.mjs.map +1 -0
  209. package/es/icons/IMessage/components/Inner.mjs +29 -0
  210. package/es/icons/IMessage/components/Inner.mjs.map +1 -0
  211. package/es/icons/IMessage/components/Mono.d.mts +7 -0
  212. package/es/icons/IMessage/components/Mono.mjs +29 -0
  213. package/es/icons/IMessage/components/Mono.mjs.map +1 -0
  214. package/es/icons/IMessage/index.d.mts +15 -0
  215. package/es/icons/IMessage/index.mjs +18 -0
  216. package/es/icons/IMessage/index.mjs.map +1 -0
  217. package/es/icons/IMessage/style.mjs +7 -0
  218. package/es/icons/IMessage/style.mjs.map +1 -0
  219. package/es/icons/Lark/components/Avatar.d.mts +9 -0
  220. package/es/icons/Lark/components/Avatar.mjs +22 -0
  221. package/es/icons/Lark/components/Avatar.mjs.map +1 -0
  222. package/es/icons/Lark/components/Color.d.mts +7 -0
  223. package/es/icons/Lark/components/Color.mjs +41 -0
  224. package/es/icons/Lark/components/Color.mjs.map +1 -0
  225. package/es/icons/Lark/components/Mono.d.mts +7 -0
  226. package/es/icons/Lark/components/Mono.mjs +32 -0
  227. package/es/icons/Lark/components/Mono.mjs.map +1 -0
  228. package/es/icons/Lark/index.d.mts +15 -0
  229. package/es/icons/Lark/index.mjs +18 -0
  230. package/es/icons/Lark/index.mjs.map +1 -0
  231. package/es/icons/Lark/style.mjs +7 -0
  232. package/es/icons/Lark/style.mjs.map +1 -0
  233. package/es/icons/MicrosoftTeams/components/Avatar.d.mts +9 -0
  234. package/es/icons/MicrosoftTeams/components/Avatar.mjs +22 -0
  235. package/es/icons/MicrosoftTeams/components/Avatar.mjs.map +1 -0
  236. package/es/icons/MicrosoftTeams/components/Color.d.mts +7 -0
  237. package/es/icons/MicrosoftTeams/components/Color.mjs +50 -0
  238. package/es/icons/MicrosoftTeams/components/Color.mjs.map +1 -0
  239. package/es/icons/MicrosoftTeams/components/Mono.d.mts +7 -0
  240. package/es/icons/MicrosoftTeams/components/Mono.mjs +37 -0
  241. package/es/icons/MicrosoftTeams/components/Mono.mjs.map +1 -0
  242. package/es/icons/MicrosoftTeams/index.d.mts +15 -0
  243. package/es/icons/MicrosoftTeams/index.mjs +18 -0
  244. package/es/icons/MicrosoftTeams/index.mjs.map +1 -0
  245. package/es/icons/MicrosoftTeams/style.mjs +7 -0
  246. package/es/icons/MicrosoftTeams/style.mjs.map +1 -0
  247. package/es/icons/QQ/components/Avatar.d.mts +9 -0
  248. package/es/icons/QQ/components/Avatar.mjs +22 -0
  249. package/es/icons/QQ/components/Avatar.mjs.map +1 -0
  250. package/es/icons/QQ/components/Color.d.mts +7 -0
  251. package/es/icons/QQ/components/Color.mjs +61 -0
  252. package/es/icons/QQ/components/Color.mjs.map +1 -0
  253. package/es/icons/QQ/components/Mono.d.mts +7 -0
  254. package/es/icons/QQ/components/Mono.mjs +29 -0
  255. package/es/icons/QQ/components/Mono.mjs.map +1 -0
  256. package/es/icons/QQ/index.d.mts +15 -0
  257. package/es/icons/QQ/index.mjs +18 -0
  258. package/es/icons/QQ/index.mjs.map +1 -0
  259. package/es/icons/QQ/style.mjs +7 -0
  260. package/es/icons/QQ/style.mjs.map +1 -0
  261. package/es/icons/Slack/components/Avatar.d.mts +9 -0
  262. package/es/icons/Slack/components/Avatar.mjs +22 -0
  263. package/es/icons/Slack/components/Avatar.mjs.map +1 -0
  264. package/es/icons/Slack/components/Color.d.mts +7 -0
  265. package/es/icons/Slack/components/Color.mjs +45 -0
  266. package/es/icons/Slack/components/Color.mjs.map +1 -0
  267. package/es/icons/Slack/components/Mono.d.mts +7 -0
  268. package/es/icons/Slack/components/Mono.mjs +35 -0
  269. package/es/icons/Slack/components/Mono.mjs.map +1 -0
  270. package/es/icons/Slack/index.d.mts +15 -0
  271. package/es/icons/Slack/index.mjs +18 -0
  272. package/es/icons/Slack/index.mjs.map +1 -0
  273. package/es/icons/Slack/style.mjs +7 -0
  274. package/es/icons/Slack/style.mjs.map +1 -0
  275. package/es/icons/Telegram/components/Avatar.d.mts +9 -0
  276. package/es/icons/Telegram/components/Avatar.mjs +23 -0
  277. package/es/icons/Telegram/components/Avatar.mjs.map +1 -0
  278. package/es/icons/Telegram/components/Color.d.mts +7 -0
  279. package/es/icons/Telegram/components/Color.mjs +30 -0
  280. package/es/icons/Telegram/components/Color.mjs.map +1 -0
  281. package/es/icons/Telegram/components/Inner.mjs +29 -0
  282. package/es/icons/Telegram/components/Inner.mjs.map +1 -0
  283. package/es/icons/Telegram/components/Mono.d.mts +7 -0
  284. package/es/icons/Telegram/components/Mono.mjs +29 -0
  285. package/es/icons/Telegram/components/Mono.mjs.map +1 -0
  286. package/es/icons/Telegram/index.d.mts +15 -0
  287. package/es/icons/Telegram/index.mjs +18 -0
  288. package/es/icons/Telegram/index.mjs.map +1 -0
  289. package/es/icons/Telegram/style.mjs +7 -0
  290. package/es/icons/Telegram/style.mjs.map +1 -0
  291. package/es/icons/WeChat/components/Avatar.d.mts +9 -0
  292. package/es/icons/WeChat/components/Avatar.mjs +22 -0
  293. package/es/icons/WeChat/components/Avatar.mjs.map +1 -0
  294. package/es/icons/WeChat/components/Color.d.mts +7 -0
  295. package/es/icons/WeChat/components/Color.mjs +30 -0
  296. package/es/icons/WeChat/components/Color.mjs.map +1 -0
  297. package/es/icons/WeChat/components/Mono.d.mts +7 -0
  298. package/es/icons/WeChat/components/Mono.mjs +29 -0
  299. package/es/icons/WeChat/components/Mono.mjs.map +1 -0
  300. package/es/icons/WeChat/index.d.mts +15 -0
  301. package/es/icons/WeChat/index.mjs +18 -0
  302. package/es/icons/WeChat/index.mjs.map +1 -0
  303. package/es/icons/WeChat/style.mjs +7 -0
  304. package/es/icons/WeChat/style.mjs.map +1 -0
  305. package/es/icons/WhatsApp/components/Avatar.d.mts +9 -0
  306. package/es/icons/WhatsApp/components/Avatar.mjs +23 -0
  307. package/es/icons/WhatsApp/components/Avatar.mjs.map +1 -0
  308. package/es/icons/WhatsApp/components/Color.d.mts +7 -0
  309. package/es/icons/WhatsApp/components/Color.mjs +30 -0
  310. package/es/icons/WhatsApp/components/Color.mjs.map +1 -0
  311. package/es/icons/WhatsApp/components/Mono.d.mts +7 -0
  312. package/es/icons/WhatsApp/components/Mono.mjs +29 -0
  313. package/es/icons/WhatsApp/components/Mono.mjs.map +1 -0
  314. package/es/icons/WhatsApp/index.d.mts +15 -0
  315. package/es/icons/WhatsApp/index.mjs +18 -0
  316. package/es/icons/WhatsApp/index.mjs.map +1 -0
  317. package/es/icons/WhatsApp/style.mjs +7 -0
  318. package/es/icons/WhatsApp/style.mjs.map +1 -0
  319. package/es/icons/index.d.mts +17 -5
  320. package/es/icons/index.mjs +13 -1
  321. package/es/icons/lucideExtra/BotPromptIcon.d.mts +2 -2
  322. package/es/icons/lucideExtra/BrainOffIcon.d.mts +8 -0
  323. package/es/icons/lucideExtra/BrainOffIcon.mjs +31 -0
  324. package/es/icons/lucideExtra/BrainOffIcon.mjs.map +1 -0
  325. package/es/icons/lucideExtra/CreateBotIcon.d.mts +3 -3
  326. package/es/icons/lucideExtra/DiscordIcon.d.mts +3 -3
  327. package/es/icons/lucideExtra/GlobeOffIcon.d.mts +3 -3
  328. package/es/icons/lucideExtra/GroupBotIcon.d.mts +3 -3
  329. package/es/icons/lucideExtra/GroupBotSquareIcon.d.mts +3 -3
  330. package/es/icons/lucideExtra/LeftClickIcon.d.mts +3 -3
  331. package/es/icons/lucideExtra/LeftDoubleClickIcon.d.mts +3 -3
  332. package/es/icons/lucideExtra/McpIcon.d.mts +3 -3
  333. package/es/icons/lucideExtra/ProviderIcon.d.mts +3 -3
  334. package/es/icons/lucideExtra/RightClickIcon.d.mts +2 -2
  335. package/es/icons/lucideExtra/RightDoubleClickIcon.d.mts +3 -3
  336. package/es/icons/lucideExtra/ShapesUploadIcon.d.mts +2 -2
  337. package/es/icons/lucideExtra/SkillsIcon.d.mts +3 -3
  338. package/es/icons/lucideExtra/ThinkIcon.d.mts +8 -0
  339. package/es/icons/lucideExtra/ThinkIcon.mjs +16 -0
  340. package/es/icons/lucideExtra/ThinkIcon.mjs.map +1 -0
  341. package/es/icons/lucideExtra/TreeDownRightIcon.d.mts +3 -3
  342. package/es/icons/lucideExtra/TreeUpDownRightIcon.d.mts +3 -3
  343. package/es/icons/lucideExtra/index.d.mts +2 -0
  344. package/es/index.d.mts +7 -7
  345. package/es/index.mjs +6 -6
  346. package/es/mdx/Mdx/index.d.mts +2 -2
  347. package/es/mobile/ChatHeader/ChatHeaderTitle.d.mts +2 -2
  348. package/es/mobile/ChatInputArea/components/ChatSendButton.d.mts +2 -2
  349. package/es/mobile/TabBar/TabBar.d.mts +2 -2
  350. package/es/storybook/StoryBook/index.d.mts +2 -2
  351. package/package.json +1 -1
  352. package/es/Popover/ArrowIcon.d.mts +0 -7
  353. package/es/Popover/ArrowIcon.mjs.map +0 -1
  354. package/es/Popover/Popover.mjs.map +0 -1
  355. package/es/Popover/PopoverGroup.mjs.map +0 -1
  356. package/es/Popover/PopoverInGroup.mjs.map +0 -1
  357. package/es/Popover/PopoverPortal.mjs.map +0 -1
  358. package/es/Popover/PopoverStandalone.mjs.map +0 -1
  359. package/es/Popover/atoms.mjs.map +0 -1
  360. package/es/Popover/context.mjs.map +0 -1
  361. package/es/Popover/groupContext.mjs.map +0 -1
  362. package/es/Popover/style.mjs.map +0 -1
  363. package/es/Popover/useMergedPopoverProps.mjs.map +0 -1
@@ -1,8 +1,8 @@
1
1
  import { IconProps } from "./type.mjs";
2
- import * as react21 from "react";
2
+ import * as react33 from "react";
3
3
 
4
4
  //#region src/Icon/Icon.d.ts
5
- declare const Icon: react21.NamedExoticComponent<IconProps>;
5
+ declare const Icon: react33.NamedExoticComponent<IconProps>;
6
6
  //#endregion
7
7
  export { Icon };
8
8
  //# sourceMappingURL=Icon.d.mts.map
@@ -1,11 +1,11 @@
1
1
  import { IconProps } from "../type.mjs";
2
- import * as react19 from "react";
2
+ import * as react31 from "react";
3
3
  import { ReactNode } from "react";
4
4
 
5
5
  //#region src/Icon/components/IconProvider.d.ts
6
6
  type IconContentConfig = Omit<IconProps, 'icon' | 'ref'>;
7
- declare const IconContext: react19.Context<IconContentConfig>;
8
- declare const IconProvider: react19.NamedExoticComponent<{
7
+ declare const IconContext: react31.Context<IconContentConfig>;
8
+ declare const IconProvider: react31.NamedExoticComponent<{
9
9
  children: ReactNode;
10
10
  config?: IconContentConfig;
11
11
  }>;
@@ -1,8 +1,8 @@
1
1
  import { PreviewGroupProps } from "./type.mjs";
2
- import * as react69 from "react";
2
+ import * as react47 from "react";
3
3
 
4
4
  //#region src/Image/PreviewGroup.d.ts
5
- declare const PreviewGroup: react69.NamedExoticComponent<PreviewGroupProps>;
5
+ declare const PreviewGroup: react47.NamedExoticComponent<PreviewGroupProps>;
6
6
  //#endregion
7
7
  export { PreviewGroup };
8
8
  //# sourceMappingURL=PreviewGroup.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { ImageSelectProps } from "./type.mjs";
2
- import * as react81 from "react";
2
+ import * as react116 from "react";
3
3
 
4
4
  //#region src/ImageSelect/ImageSelect.d.ts
5
- declare const ImageSelect: react81.NamedExoticComponent<ImageSelectProps>;
5
+ declare const ImageSelect: react116.NamedExoticComponent<ImageSelectProps>;
6
6
  //#endregion
7
7
  export { ImageSelect };
8
8
  //# sourceMappingURL=ImageSelect.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { InputProps } from "./type.mjs";
2
- import * as react121 from "react";
2
+ import * as react155 from "react";
3
3
 
4
4
  //#region src/Input/Input.d.ts
5
- declare const Input: react121.NamedExoticComponent<InputProps>;
5
+ declare const Input: react155.NamedExoticComponent<InputProps>;
6
6
  //#endregion
7
7
  export { Input };
8
8
  //# sourceMappingURL=Input.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { InputNumberProps } from "./type.mjs";
2
- import * as react123 from "react";
2
+ import * as react156 from "react";
3
3
 
4
4
  //#region src/Input/InputNumber.d.ts
5
- declare const InputNumber: react123.NamedExoticComponent<InputNumberProps>;
5
+ declare const InputNumber: react156.NamedExoticComponent<InputNumberProps>;
6
6
  //#endregion
7
7
  export { InputNumber };
8
8
  //# sourceMappingURL=InputNumber.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { InputOPTProps } from "./type.mjs";
2
- import * as react124 from "react";
2
+ import * as react157 from "react";
3
3
 
4
4
  //#region src/Input/InputOPT.d.ts
5
- declare const InputOPT: react124.NamedExoticComponent<InputOPTProps>;
5
+ declare const InputOPT: react157.NamedExoticComponent<InputOPTProps>;
6
6
  //#endregion
7
7
  export { InputOPT };
8
8
  //# sourceMappingURL=InputOPT.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { InputPasswordProps } from "./type.mjs";
2
- import * as react125 from "react";
2
+ import * as react158 from "react";
3
3
 
4
4
  //#region src/Input/InputPassword.d.ts
5
- declare const InputPassword: react125.NamedExoticComponent<InputPasswordProps>;
5
+ declare const InputPassword: react158.NamedExoticComponent<InputPasswordProps>;
6
6
  //#endregion
7
7
  export { InputPassword };
8
8
  //# sourceMappingURL=InputPassword.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { TextAreaProps } from "./type.mjs";
2
- import * as react126 from "react";
2
+ import * as react159 from "react";
3
3
 
4
4
  //#region src/Input/TextArea.d.ts
5
- declare const TextArea: react126.NamedExoticComponent<TextAreaProps>;
5
+ declare const TextArea: react159.NamedExoticComponent<TextAreaProps>;
6
6
  //#endregion
7
7
  export { TextArea };
8
8
  //# sourceMappingURL=TextArea.d.mts.map
@@ -1,9 +1,9 @@
1
1
  import { DivProps } from "../../types/index.mjs";
2
2
  import "../../index.mjs";
3
- import * as react62 from "react";
3
+ import * as react36 from "react";
4
4
 
5
5
  //#region src/Layout/components/LayoutFooter.d.ts
6
- declare const LayoutFooter: react62.NamedExoticComponent<DivProps>;
6
+ declare const LayoutFooter: react36.NamedExoticComponent<DivProps>;
7
7
  //#endregion
8
8
  export { LayoutFooter };
9
9
  //# sourceMappingURL=LayoutFooter.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { LayoutHeaderProps } from "../type.mjs";
2
- import * as react64 from "react";
2
+ import * as react39 from "react";
3
3
 
4
4
  //#region src/Layout/components/LayoutHeader.d.ts
5
- declare const LayoutHeader: react64.NamedExoticComponent<LayoutHeaderProps>;
5
+ declare const LayoutHeader: react39.NamedExoticComponent<LayoutHeaderProps>;
6
6
  //#endregion
7
7
  export { LayoutHeader };
8
8
  //# sourceMappingURL=LayoutHeader.d.mts.map
@@ -1,9 +1,9 @@
1
1
  import { DivProps } from "../../types/index.mjs";
2
2
  import "../../index.mjs";
3
- import * as react63 from "react";
3
+ import * as react41 from "react";
4
4
 
5
5
  //#region src/Layout/components/LayoutMain.d.ts
6
- declare const LayoutMain: react63.NamedExoticComponent<DivProps>;
6
+ declare const LayoutMain: react41.NamedExoticComponent<DivProps>;
7
7
  //#endregion
8
8
  export { LayoutMain };
9
9
  //# sourceMappingURL=LayoutMain.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { LayoutSidebarProps } from "../type.mjs";
2
- import * as react66 from "react";
2
+ import * as react37 from "react";
3
3
 
4
4
  //#region src/Layout/components/LayoutSidebar.d.ts
5
- declare const LayoutSidebar: react66.NamedExoticComponent<LayoutSidebarProps>;
5
+ declare const LayoutSidebar: react37.NamedExoticComponent<LayoutSidebarProps>;
6
6
  //#endregion
7
7
  export { LayoutSidebar };
8
8
  //# sourceMappingURL=LayoutSidebar.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { LayoutSidebarInnerProps } from "../type.mjs";
2
- import * as react65 from "react";
2
+ import * as react38 from "react";
3
3
 
4
4
  //#region src/Layout/components/LayoutSidebarInner.d.ts
5
- declare const LayoutSidebarInner: react65.NamedExoticComponent<LayoutSidebarInnerProps>;
5
+ declare const LayoutSidebarInner: react38.NamedExoticComponent<LayoutSidebarInnerProps>;
6
6
  //#endregion
7
7
  export { LayoutSidebarInner };
8
8
  //# sourceMappingURL=LayoutSidebarInner.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { LayoutTocProps } from "../type.mjs";
2
- import * as react67 from "react";
2
+ import * as react40 from "react";
3
3
 
4
4
  //#region src/Layout/components/LayoutToc.d.ts
5
- declare const LayoutToc: react67.NamedExoticComponent<LayoutTocProps>;
5
+ declare const LayoutToc: react40.NamedExoticComponent<LayoutTocProps>;
6
6
  //#endregion
7
7
  export { LayoutToc };
8
8
  //# sourceMappingURL=LayoutToc.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { ListItemProps } from "../type.mjs";
2
- import * as react68 from "react";
2
+ import * as react44 from "react";
3
3
 
4
4
  //#region src/List/ListItem/index.d.ts
5
- declare const ListItem: react68.NamedExoticComponent<ListItemProps>;
5
+ declare const ListItem: react44.NamedExoticComponent<ListItemProps>;
6
6
  //#endregion
7
7
  export { ListItem };
8
8
  //# sourceMappingURL=index.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { MarkdownProps } from "./type.mjs";
2
- import * as react58 from "react";
2
+ import * as react43 from "react";
3
3
 
4
4
  //#region src/Markdown/Markdown.d.ts
5
- declare const Markdown: react58.NamedExoticComponent<MarkdownProps>;
5
+ declare const Markdown: react43.NamedExoticComponent<MarkdownProps>;
6
6
  //#endregion
7
7
  export { Markdown };
8
8
  //# sourceMappingURL=Markdown.d.mts.map
@@ -13,7 +13,7 @@ import { cx } from "antd-style";
13
13
 
14
14
  //#region src/Markdown/Markdown.tsx
15
15
  const Markdown = memo((props) => {
16
- const { ref, children = "", className, style, fullFeaturedCodeBlock, onDoubleClick, animated, enableLatex = true, enableMermaid = true, enableImageGallery, enableCustomFootnotes, enableGithubAlert, enableStream = true, componentProps, rehypePluginsAhead, allowHtml, borderRadius, fontSize = props.variant === "chat" ? 14 : void 0, headerMultiple = props.variant === "chat" ? .25 : void 0, marginMultiple = props.variant === "chat" ? 1 : void 0, variant = "default", reactMarkdownProps, lineHeight = props.variant === "chat" ? 1.6 : void 0, rehypePlugins, remarkPlugins, remarkPluginsAhead, components = {}, customRender, showFootnotes = true, citations, ...rest } = props;
16
+ const { ref, children = "", className, style, fullFeaturedCodeBlock, onDoubleClick, animated, enableLatex = true, enableMermaid = true, enableImageGallery, enableCustomFootnotes, enableGithubAlert, enableStream = true, componentProps, rehypePluginsAhead, allowHtml, borderRadius, fontSize = props.variant === "chat" ? 14 : void 0, headerMultiple = props.variant === "chat" ? .25 : void 0, marginMultiple = props.variant === "chat" ? 1 : void 0, variant = "default", reactMarkdownProps, lineHeight = props.variant === "chat" ? 1.6 : void 0, rehypePlugins, remarkPlugins, remarkPluginsAhead, components = {}, customRender, showFootnotes = true, streamSmoothingPreset, citations, ...rest } = props;
17
17
  const delayedAnimated = useDelayedAnimated(animated);
18
18
  const Render = useCallback(({ enableStream: enableStream$1, children: children$1, reactMarkdownProps: reactMarkdownProps$1 }) => {
19
19
  const defaultDOM = /* @__PURE__ */ jsx(enableStream$1 ? StreamdownRender_default : MarkdownRender_default, {
@@ -55,6 +55,7 @@ const Markdown = memo((props) => {
55
55
  remarkPlugins,
56
56
  remarkPluginsAhead,
57
57
  showFootnotes,
58
+ streamSmoothingPreset,
58
59
  variant,
59
60
  children: /* @__PURE__ */ jsx(Render, {
60
61
  enableStream: enableStream && delayedAnimated,
@@ -1 +1 @@
1
- {"version":3,"file":"Markdown.mjs","names":["enableStream","StreamdownRender","MarkdownRender","reactMarkdownProps","children","PreviewGroup","Typography"],"sources":["../../src/Markdown/Markdown.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { memo, useCallback } from 'react';\n\nimport { PreviewGroup } from '@/Image';\n\nimport { MarkdownProvider } from './components/MarkdownProvider';\nimport { useDelayedAnimated } from './components/useDelayedAnimated';\nimport { variants } from './style';\nimport { MarkdownRender, StreamdownRender } from './SyntaxMarkdown';\nimport { type MarkdownProps } from './type';\nimport Typography from './Typography';\n\nconst Markdown = memo<MarkdownProps>((props) => {\n const {\n ref,\n children = '',\n className,\n style,\n fullFeaturedCodeBlock,\n onDoubleClick,\n animated,\n enableLatex = true,\n enableMermaid = true,\n enableImageGallery,\n enableCustomFootnotes,\n enableGithubAlert,\n enableStream = true,\n componentProps,\n rehypePluginsAhead,\n allowHtml,\n borderRadius,\n fontSize = props.variant === 'chat' ? 14 : undefined,\n headerMultiple = props.variant === 'chat' ? 0.25 : undefined,\n marginMultiple = props.variant === 'chat' ? 1 : undefined,\n variant = 'default',\n reactMarkdownProps,\n lineHeight = props.variant === 'chat' ? 1.6 : undefined,\n rehypePlugins,\n remarkPlugins,\n remarkPluginsAhead,\n components = {},\n customRender,\n showFootnotes = true,\n citations,\n ...rest\n } = props;\n\n const delayedAnimated = useDelayedAnimated(animated);\n\n const Render = useCallback(\n ({\n enableStream,\n children,\n reactMarkdownProps,\n }: Pick<MarkdownProps, 'children' | 'enableStream' | 'reactMarkdownProps'>) => {\n const DefaultRender = enableStream ? StreamdownRender : MarkdownRender;\n const defaultDOM = <DefaultRender {...reactMarkdownProps}>{children}</DefaultRender>;\n return customRender ? customRender(defaultDOM, { text: children }) : defaultDOM;\n },\n [customRender],\n );\n\n return (\n <PreviewGroup enable={enableImageGallery}>\n <Typography\n borderRadius={borderRadius}\n className={cx(variants({ enableLatex, variant }), className)}\n data-code-type=\"markdown\"\n fontSize={fontSize}\n headerMultiple={headerMultiple}\n lineHeight={lineHeight}\n marginMultiple={marginMultiple}\n ref={ref}\n style={style}\n onDoubleClick={onDoubleClick}\n {...rest}\n >\n <MarkdownProvider\n allowHtml={allowHtml}\n animated={delayedAnimated}\n citations={citations}\n componentProps={componentProps}\n components={components}\n enableCustomFootnotes={enableCustomFootnotes}\n enableGithubAlert={enableGithubAlert}\n enableLatex={enableLatex}\n enableMermaid={enableMermaid}\n fullFeaturedCodeBlock={fullFeaturedCodeBlock}\n rehypePlugins={rehypePlugins}\n rehypePluginsAhead={rehypePluginsAhead}\n remarkPlugins={remarkPlugins}\n remarkPluginsAhead={remarkPluginsAhead}\n showFootnotes={showFootnotes}\n variant={variant}\n >\n <Render\n enableStream={enableStream && delayedAnimated}\n reactMarkdownProps={reactMarkdownProps}\n >\n {children}\n </Render>\n </MarkdownProvider>\n </Typography>\n </PreviewGroup>\n );\n});\n\nMarkdown.displayName = 'Markdown';\n\nexport default Markdown;\n"],"mappings":";;;;;;;;;;;;;;AAcA,MAAM,WAAW,MAAqB,UAAU;CAC9C,MAAM,EACJ,KACA,WAAW,IACX,WACA,OACA,uBACA,eACA,UACA,cAAc,MACd,gBAAgB,MAChB,oBACA,uBACA,mBACA,eAAe,MACf,gBACA,oBACA,WACA,cACA,WAAW,MAAM,YAAY,SAAS,KAAK,QAC3C,iBAAiB,MAAM,YAAY,SAAS,MAAO,QACnD,iBAAiB,MAAM,YAAY,SAAS,IAAI,QAChD,UAAU,WACV,oBACA,aAAa,MAAM,YAAY,SAAS,MAAM,QAC9C,eACA,eACA,oBACA,aAAa,EAAE,EACf,cACA,gBAAgB,MAChB,WACA,GAAG,SACD;CAEJ,MAAM,kBAAkB,mBAAmB,SAAS;CAEpD,MAAM,SAAS,aACZ,EACC,8BACA,sBACA,+CAC6E;EAE7E,MAAM,aAAa,oBADGA,iBAAeC,2BAAmBC;GACtB,GAAIC;aAAqBC;IAAyB;AACpF,SAAO,eAAe,aAAa,YAAY,EAAE,MAAMA,YAAU,CAAC,GAAG;IAEvE,CAAC,aAAa,CACf;AAED,QACE,oBAACC;EAAa,QAAQ;YACpB,oBAACC;GACe;GACd,WAAW,GAAG,SAAS;IAAE;IAAa;IAAS,CAAC,EAAE,UAAU;GAC5D,kBAAe;GACL;GACM;GACJ;GACI;GACX;GACE;GACQ;GACf,GAAI;aAEJ,oBAAC;IACY;IACX,UAAU;IACC;IACK;IACJ;IACW;IACJ;IACN;IACE;IACQ;IACR;IACK;IACL;IACK;IACL;IACN;cAET,oBAAC;KACC,cAAc,gBAAgB;KACV;KAEnB;MACM;KACQ;IACR;GACA;EAEjB;AAEF,SAAS,cAAc;AAEvB,uBAAe"}
1
+ {"version":3,"file":"Markdown.mjs","names":["enableStream","StreamdownRender","MarkdownRender","reactMarkdownProps","children","PreviewGroup","Typography"],"sources":["../../src/Markdown/Markdown.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { memo, useCallback } from 'react';\n\nimport { PreviewGroup } from '@/Image';\n\nimport { MarkdownProvider } from './components/MarkdownProvider';\nimport { useDelayedAnimated } from './components/useDelayedAnimated';\nimport { variants } from './style';\nimport { MarkdownRender, StreamdownRender } from './SyntaxMarkdown';\nimport { type MarkdownProps } from './type';\nimport Typography from './Typography';\n\nconst Markdown = memo<MarkdownProps>((props) => {\n const {\n ref,\n children = '',\n className,\n style,\n fullFeaturedCodeBlock,\n onDoubleClick,\n animated,\n enableLatex = true,\n enableMermaid = true,\n enableImageGallery,\n enableCustomFootnotes,\n enableGithubAlert,\n enableStream = true,\n componentProps,\n rehypePluginsAhead,\n allowHtml,\n borderRadius,\n fontSize = props.variant === 'chat' ? 14 : undefined,\n headerMultiple = props.variant === 'chat' ? 0.25 : undefined,\n marginMultiple = props.variant === 'chat' ? 1 : undefined,\n variant = 'default',\n reactMarkdownProps,\n lineHeight = props.variant === 'chat' ? 1.6 : undefined,\n rehypePlugins,\n remarkPlugins,\n remarkPluginsAhead,\n components = {},\n customRender,\n showFootnotes = true,\n streamSmoothingPreset,\n citations,\n ...rest\n } = props;\n\n const delayedAnimated = useDelayedAnimated(animated);\n\n const Render = useCallback(\n ({\n enableStream,\n children,\n reactMarkdownProps,\n }: Pick<MarkdownProps, 'children' | 'enableStream' | 'reactMarkdownProps'>) => {\n const DefaultRender = enableStream ? StreamdownRender : MarkdownRender;\n const defaultDOM = <DefaultRender {...reactMarkdownProps}>{children}</DefaultRender>;\n return customRender ? customRender(defaultDOM, { text: children }) : defaultDOM;\n },\n [customRender],\n );\n\n return (\n <PreviewGroup enable={enableImageGallery}>\n <Typography\n borderRadius={borderRadius}\n className={cx(variants({ enableLatex, variant }), className)}\n data-code-type=\"markdown\"\n fontSize={fontSize}\n headerMultiple={headerMultiple}\n lineHeight={lineHeight}\n marginMultiple={marginMultiple}\n ref={ref}\n style={style}\n onDoubleClick={onDoubleClick}\n {...rest}\n >\n <MarkdownProvider\n allowHtml={allowHtml}\n animated={delayedAnimated}\n citations={citations}\n componentProps={componentProps}\n components={components}\n enableCustomFootnotes={enableCustomFootnotes}\n enableGithubAlert={enableGithubAlert}\n enableLatex={enableLatex}\n enableMermaid={enableMermaid}\n fullFeaturedCodeBlock={fullFeaturedCodeBlock}\n rehypePlugins={rehypePlugins}\n rehypePluginsAhead={rehypePluginsAhead}\n remarkPlugins={remarkPlugins}\n remarkPluginsAhead={remarkPluginsAhead}\n showFootnotes={showFootnotes}\n streamSmoothingPreset={streamSmoothingPreset}\n variant={variant}\n >\n <Render\n enableStream={enableStream && delayedAnimated}\n reactMarkdownProps={reactMarkdownProps}\n >\n {children}\n </Render>\n </MarkdownProvider>\n </Typography>\n </PreviewGroup>\n );\n});\n\nMarkdown.displayName = 'Markdown';\n\nexport default Markdown;\n"],"mappings":";;;;;;;;;;;;;;AAcA,MAAM,WAAW,MAAqB,UAAU;CAC9C,MAAM,EACJ,KACA,WAAW,IACX,WACA,OACA,uBACA,eACA,UACA,cAAc,MACd,gBAAgB,MAChB,oBACA,uBACA,mBACA,eAAe,MACf,gBACA,oBACA,WACA,cACA,WAAW,MAAM,YAAY,SAAS,KAAK,QAC3C,iBAAiB,MAAM,YAAY,SAAS,MAAO,QACnD,iBAAiB,MAAM,YAAY,SAAS,IAAI,QAChD,UAAU,WACV,oBACA,aAAa,MAAM,YAAY,SAAS,MAAM,QAC9C,eACA,eACA,oBACA,aAAa,EAAE,EACf,cACA,gBAAgB,MAChB,uBACA,WACA,GAAG,SACD;CAEJ,MAAM,kBAAkB,mBAAmB,SAAS;CAEpD,MAAM,SAAS,aACZ,EACC,8BACA,sBACA,+CAC6E;EAE7E,MAAM,aAAa,oBADGA,iBAAeC,2BAAmBC;GACtB,GAAIC;aAAqBC;IAAyB;AACpF,SAAO,eAAe,aAAa,YAAY,EAAE,MAAMA,YAAU,CAAC,GAAG;IAEvE,CAAC,aAAa,CACf;AAED,QACE,oBAACC;EAAa,QAAQ;YACpB,oBAACC;GACe;GACd,WAAW,GAAG,SAAS;IAAE;IAAa;IAAS,CAAC,EAAE,UAAU;GAC5D,kBAAe;GACL;GACM;GACJ;GACI;GACX;GACE;GACQ;GACf,GAAI;aAEJ,oBAAC;IACY;IACX,UAAU;IACC;IACK;IACJ;IACW;IACJ;IACN;IACE;IACQ;IACR;IACK;IACL;IACK;IACL;IACQ;IACd;cAET,oBAAC;KACC,cAAc,gBAAgB;KACV;KAEnB;MACM;KACQ;IACR;GACA;EAEjB;AAEF,SAAS,cAAc;AAEvB,uBAAe"}
@@ -1,11 +1,13 @@
1
1
  'use client';
2
2
 
3
+ import { useMarkdownContext } from "../components/MarkdownProvider.mjs";
3
4
  import { useMarkdownComponents } from "../../hooks/useMarkdown/useMarkdownComponents.mjs";
4
5
  import { useMarkdownContent } from "../../hooks/useMarkdown/useMarkdownContent.mjs";
5
6
  import { useMarkdownRehypePlugins } from "../../hooks/useMarkdown/useMarkdownRehypePlugins.mjs";
6
7
  import { useMarkdownRemarkPlugins } from "../../hooks/useMarkdown/useMarkdownRemarkPlugins.mjs";
7
8
  import { rehypeStreamAnimated } from "../plugins/rehypeStreamAnimated.mjs";
8
9
  import { styles } from "./style.mjs";
10
+ import { useSmoothStreamContent } from "./useSmoothStreamContent.mjs";
9
11
  import { useStreamQueue } from "./useStreamQueue.mjs";
10
12
  import { createElement, memo, useEffect, useId, useMemo, useRef } from "react";
11
13
  import { jsx } from "react/jsx-runtime";
@@ -14,7 +16,7 @@ import { marked } from "marked";
14
16
  import remend from "remend";
15
17
 
16
18
  //#region src/Markdown/SyntaxMarkdown/StreamdownRender.tsx
17
- const STREAM_CHAR_DELAY = 15;
19
+ const STREAM_FADE_DURATION = 280;
18
20
  function countChars(text) {
19
21
  return [...text].length;
20
22
  }
@@ -61,14 +63,16 @@ const StreamdownBlock = memo(({ children, ...rest }) => {
61
63
  }, (prevProps, nextProps) => prevProps.children === nextProps.children && prevProps.components === nextProps.components && isSamePlugins(prevProps.rehypePlugins, nextProps.rehypePlugins) && isSamePlugins(prevProps.remarkPlugins, nextProps.remarkPlugins));
62
64
  StreamdownBlock.displayName = "StreamdownBlock";
63
65
  const StreamdownRender = memo(({ children, ...rest }) => {
66
+ const { streamSmoothingPreset = "balanced" } = useMarkdownContext();
64
67
  const escapedContent = useMarkdownContent(children || "");
65
68
  const components = useMarkdownComponents();
66
69
  const baseRehypePlugins = useStablePlugins(useMarkdownRehypePlugins());
67
70
  const remarkPlugins = useStablePlugins(useMarkdownRemarkPlugins());
68
71
  const generatedId = useId();
72
+ const smoothedContent = useSmoothStreamContent(typeof escapedContent === "string" ? escapedContent : "", { preset: streamSmoothingPreset });
69
73
  const processedContent = useMemo(() => {
70
- return remend(typeof escapedContent === "string" ? escapedContent : "");
71
- }, [escapedContent]);
74
+ return remend(smoothedContent);
75
+ }, [smoothedContent]);
72
76
  const blocks = useMemo(() => {
73
77
  const tokens = marked.lexer(processedContent);
74
78
  let offset = 0;
@@ -82,41 +86,63 @@ const StreamdownRender = memo(({ children, ...rest }) => {
82
86
  });
83
87
  }, [processedContent]);
84
88
  const { getBlockState, charDelay } = useStreamQueue(blocks);
85
- const staggerPlugins = useMemo(() => [...baseRehypePlugins, [rehypeStreamAnimated, {
86
- baseCharCount: 0,
87
- charDelay
88
- }]], [baseRehypePlugins, charDelay]);
89
- const revealedPlugins = useMemo(() => [...baseRehypePlugins, [rehypeStreamAnimated, { revealed: true }]], [baseRehypePlugins]);
90
- const prevCharCountRef = useRef(0);
91
- const prevStreamOffsetRef = useRef(-1);
92
- useEffect(() => {
93
- const tailIdx = blocks.length - 1;
94
- if (tailIdx >= 0) {
95
- const tail = blocks[tailIdx];
96
- if (tail.startOffset !== prevStreamOffsetRef.current) {
97
- prevStreamOffsetRef.current = tail.startOffset;
98
- prevCharCountRef.current = 0;
89
+ const prevBlockCharCountRef = useRef(/* @__PURE__ */ new Map());
90
+ const blockTimelineRef = useRef(/* @__PURE__ */ new Map());
91
+ const lastRenderTsRef = useRef(null);
92
+ const renderTs = typeof performance === "undefined" ? Date.now() : performance.now();
93
+ const frameDt = lastRenderTsRef.current === null ? 0 : Math.max(0, Math.min(renderTs - lastRenderTsRef.current, 120));
94
+ const timelineForRender = useMemo(() => {
95
+ const next = /* @__PURE__ */ new Map();
96
+ const prevTimeline = blockTimelineRef.current;
97
+ const prevCharCounts = prevBlockCharCountRef.current;
98
+ for (const block of blocks) {
99
+ const blockCharCount = countChars(block.content);
100
+ const prevCharCount = prevCharCounts.get(block.startOffset) ?? 0;
101
+ const prevElapsed = prevTimeline.get(block.startOffset);
102
+ const latestCharStart = Math.max(0, (blockCharCount - 1) * charDelay);
103
+ if (prevElapsed === void 0 || blockCharCount < prevCharCount) {
104
+ next.set(block.startOffset, latestCharStart);
105
+ continue;
99
106
  }
100
- prevCharCountRef.current = countChars(tail.content);
101
- } else {
102
- prevCharCountRef.current = 0;
103
- prevStreamOffsetRef.current = -1;
107
+ const elapsedByTime = prevElapsed + frameDt;
108
+ const minElapsed = Math.max(0, latestCharStart - charDelay * 2);
109
+ next.set(block.startOffset, Math.max(elapsedByTime, minElapsed));
104
110
  }
105
- }, [blocks]);
111
+ return next;
112
+ }, [
113
+ blocks,
114
+ charDelay,
115
+ frameDt
116
+ ]);
117
+ useEffect(() => {
118
+ const nextCharCount = /* @__PURE__ */ new Map();
119
+ for (const block of blocks) nextCharCount.set(block.startOffset, countChars(block.content));
120
+ prevBlockCharCountRef.current = nextCharCount;
121
+ blockTimelineRef.current = timelineForRender;
122
+ lastRenderTsRef.current = typeof performance === "undefined" ? Date.now() : performance.now();
123
+ }, [blocks, timelineForRender]);
106
124
  return /* @__PURE__ */ jsx("div", {
107
125
  className: styles.animated,
108
126
  children: blocks.map((block, index) => {
109
127
  const state = getBlockState(index);
110
128
  if (state === "queued") return null;
129
+ const timelineElapsedMs = timelineForRender.get(block.startOffset) ?? 0;
111
130
  let plugins;
112
- if (state === "streaming") {
113
- const baseCharCount = block.startOffset === prevStreamOffsetRef.current ? prevCharCountRef.current : 0;
114
- plugins = [...baseRehypePlugins, [rehypeStreamAnimated, {
115
- baseCharCount,
116
- charDelay: STREAM_CHAR_DELAY
117
- }]];
118
- } else if (state === "animating") plugins = staggerPlugins;
119
- else plugins = revealedPlugins;
131
+ if (state === "streaming") plugins = [...baseRehypePlugins, [rehypeStreamAnimated, {
132
+ charDelay,
133
+ fadeDuration: STREAM_FADE_DURATION,
134
+ timelineElapsedMs
135
+ }]];
136
+ else if (state === "animating") plugins = [...baseRehypePlugins, [rehypeStreamAnimated, {
137
+ charDelay,
138
+ fadeDuration: STREAM_FADE_DURATION,
139
+ timelineElapsedMs
140
+ }]];
141
+ else plugins = [...baseRehypePlugins, [rehypeStreamAnimated, {
142
+ charDelay,
143
+ fadeDuration: STREAM_FADE_DURATION,
144
+ timelineElapsedMs
145
+ }]];
120
146
  return /* @__PURE__ */ createElement(StreamdownBlock, {
121
147
  ...rest,
122
148
  components,
@@ -1 +1 @@
1
- {"version":3,"file":"StreamdownRender.mjs","names":["blocks: BlockInfo[]","staggerPlugins: Pluggable[]","revealedPlugins: Pluggable[]","plugins: Pluggable[]"],"sources":["../../../src/Markdown/SyntaxMarkdown/StreamdownRender.tsx"],"sourcesContent":["'use client';\n\nimport { marked } from 'marked';\nimport { memo, useEffect, useId, useMemo, useRef } from 'react';\nimport Markdown, { type Options } from 'react-markdown';\nimport remend from 'remend';\nimport type { Pluggable, PluggableList } from 'unified';\n\nimport {\n useMarkdownComponents,\n useMarkdownContent,\n useMarkdownRehypePlugins,\n useMarkdownRemarkPlugins,\n} from '@/hooks/useMarkdown';\nimport { rehypeStreamAnimated } from '@/Markdown/plugins/rehypeStreamAnimated';\n\nimport { styles } from './style';\nimport { type BlockInfo, useStreamQueue } from './useStreamQueue';\n\nconst STREAM_CHAR_DELAY = 15;\n\nfunction countChars(text: string): number {\n return [...text].length;\n}\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null;\n\nconst isDeepEqualValue = (a: unknown, b: unknown): boolean => {\n if (a === b) return true;\n\n if (Array.isArray(a) || Array.isArray(b)) {\n if (!Array.isArray(a) || !Array.isArray(b)) return false;\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (!isDeepEqualValue(a[i], b[i])) return false;\n }\n return true;\n }\n\n if (!isRecord(a) || !isRecord(b)) return false;\n\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n if (keysA.length !== keysB.length) return false;\n\n for (const key of keysA) {\n if (!isDeepEqualValue(a[key], b[key])) return false;\n }\n\n return true;\n};\n\nconst isSamePlugin = (prevPlugin: Pluggable, nextPlugin: Pluggable): boolean => {\n const prevTuple = Array.isArray(prevPlugin) ? prevPlugin : [prevPlugin];\n const nextTuple = Array.isArray(nextPlugin) ? nextPlugin : [nextPlugin];\n\n if (prevTuple.length !== nextTuple.length) return false;\n if (prevTuple[0] !== nextTuple[0]) return false;\n\n return isDeepEqualValue(prevTuple.slice(1), nextTuple.slice(1));\n};\n\nconst isSamePlugins = (\n prevPlugins?: PluggableList | null,\n nextPlugins?: PluggableList | null,\n): boolean => {\n if (prevPlugins === nextPlugins) return true;\n if (!prevPlugins || !nextPlugins) return !prevPlugins && !nextPlugins;\n if (prevPlugins.length !== nextPlugins.length) return false;\n\n for (let i = 0; i < prevPlugins.length; i++) {\n if (!isSamePlugin(prevPlugins[i], nextPlugins[i])) return false;\n }\n\n return true;\n};\n\nconst useStablePlugins = (plugins: PluggableList): PluggableList => {\n const stableRef = useRef<PluggableList>(plugins);\n\n if (!isSamePlugins(stableRef.current, plugins)) {\n stableRef.current = plugins;\n }\n\n return stableRef.current;\n};\n\nconst StreamdownBlock = memo<Options>(\n ({ children, ...rest }) => {\n return <Markdown {...rest}>{children}</Markdown>;\n },\n (prevProps, nextProps) =>\n prevProps.children === nextProps.children &&\n prevProps.components === nextProps.components &&\n isSamePlugins(prevProps.rehypePlugins, nextProps.rehypePlugins) &&\n isSamePlugins(prevProps.remarkPlugins, nextProps.remarkPlugins),\n);\n\nStreamdownBlock.displayName = 'StreamdownBlock';\n\nexport const StreamdownRender = memo<Options>(({ children, ...rest }) => {\n const escapedContent = useMarkdownContent(children || '');\n const components = useMarkdownComponents();\n const baseRehypePlugins = useStablePlugins(useMarkdownRehypePlugins());\n const remarkPlugins = useStablePlugins(useMarkdownRemarkPlugins());\n const generatedId = useId();\n\n const processedContent = useMemo(() => {\n const content = typeof escapedContent === 'string' ? escapedContent : '';\n return remend(content);\n }, [escapedContent]);\n\n const blocks: BlockInfo[] = useMemo(() => {\n const tokens = marked.lexer(processedContent);\n let offset = 0;\n return tokens.map((token) => {\n const block = { content: token.raw, startOffset: offset };\n offset += token.raw.length;\n return block;\n });\n }, [processedContent]);\n\n const { getBlockState, charDelay } = useStreamQueue(blocks);\n\n const staggerPlugins: Pluggable[] = useMemo(\n () => [...baseRehypePlugins, [rehypeStreamAnimated, { baseCharCount: 0, charDelay }]],\n [baseRehypePlugins, charDelay],\n );\n\n const revealedPlugins: Pluggable[] = useMemo(\n () => [...baseRehypePlugins, [rehypeStreamAnimated, { revealed: true }]],\n [baseRehypePlugins],\n );\n\n // prevCharCount tracks the PREVIOUS render's streaming char count.\n // Updated in useEffect (after render) to avoid stale reads during\n // synchronous re-renders (e.g. useLayoutEffect auto-reveal).\n const prevCharCountRef = useRef(0);\n const prevStreamOffsetRef = useRef(-1);\n\n useEffect(() => {\n const tailIdx = blocks.length - 1;\n if (tailIdx >= 0) {\n const tail = blocks[tailIdx];\n if (tail.startOffset !== prevStreamOffsetRef.current) {\n prevStreamOffsetRef.current = tail.startOffset;\n prevCharCountRef.current = 0;\n }\n prevCharCountRef.current = countChars(tail.content);\n } else {\n prevCharCountRef.current = 0;\n prevStreamOffsetRef.current = -1;\n }\n }, [blocks]);\n\n return (\n <div className={styles.animated}>\n {blocks.map((block, index) => {\n const state = getBlockState(index);\n if (state === 'queued') return null;\n\n let plugins: Pluggable[];\n if (state === 'streaming') {\n const baseCharCount =\n block.startOffset === prevStreamOffsetRef.current ? prevCharCountRef.current : 0;\n plugins = [\n ...baseRehypePlugins,\n [rehypeStreamAnimated, { baseCharCount, charDelay: STREAM_CHAR_DELAY }],\n ];\n } else if (state === 'animating') {\n plugins = staggerPlugins;\n } else {\n plugins = revealedPlugins;\n }\n\n return (\n <StreamdownBlock\n {...rest}\n components={components}\n key={`${generatedId}-${block.startOffset}`}\n rehypePlugins={plugins}\n remarkPlugins={remarkPlugins}\n >\n {block.content}\n </StreamdownBlock>\n );\n })}\n </div>\n );\n});\n\nStreamdownRender.displayName = 'StreamdownRender';\n\nexport default StreamdownRender;\n"],"mappings":";;;;;;;;;;;;;;;;AAmBA,MAAM,oBAAoB;AAE1B,SAAS,WAAW,MAAsB;AACxC,QAAO,CAAC,GAAG,KAAK,CAAC;;AAGnB,MAAM,YAAY,UAChB,OAAO,UAAU,YAAY,UAAU;AAEzC,MAAM,oBAAoB,GAAY,MAAwB;AAC5D,KAAI,MAAM,EAAG,QAAO;AAEpB,KAAI,MAAM,QAAQ,EAAE,IAAI,MAAM,QAAQ,EAAE,EAAE;AACxC,MAAI,CAAC,MAAM,QAAQ,EAAE,IAAI,CAAC,MAAM,QAAQ,EAAE,CAAE,QAAO;AACnD,MAAI,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ChB,MAAM,OAAO,OAAO;AACpB,OAAI,KAAK,gBAAgB,oBAAoB,SAAS;AACpD,wBAAoB,UAAU,KAAK;AACnC,qBAAiB,UAAU;;AAE7B,oBAAiB,UAAU,WAAW,KAAK,QAAQ;SAC9C;AACL,oBAAiB,UAAU;AAC3B,uBAAoB,UAAU;;IAE/B,CAAC,OAAO,CAAC;AAEZ,QACE,oBAAC;EAAI,WAAW,OAAO;YACpB,OAAO,KAAK,OAAO,UAAU;GAC5B,MAAM,QAAQ,cAAc,MAAM;AAClC,OAAI,UAAU,SAAU,QAAO;GAE/B,IAAIC;AACJ,OAAI,UAAU,aAAa;IACzB,MAAM,gBACJ,MAAM,gBAAgB,oBAAoB,UAAU,iBAAiB,UAAU;AACjF,cAAU,CACR,GAAG,mBACH,CAAC,sBAAsB;KAAE;KAAe,WAAW;KAAmB,CAAC,CACxE;cACQ,UAAU,YACnB,WAAU;OAEV,WAAU;AAGZ,UACE,8BAAC;IACC,GAAI;IACQ;IACZ,KAAK,GAAG,YAAY,GAAG,MAAM;IAC7B,eAAe;IACA;MAEd,MAAM,QACS;IAEpB;GACE;EAER;AAEF,iBAAiB,cAAc;AAE/B,+BAAe"}
1
+ {"version":3,"file":"StreamdownRender.mjs","names":["blocks: BlockInfo[]","plugins: Pluggable[]"],"sources":["../../../src/Markdown/SyntaxMarkdown/StreamdownRender.tsx"],"sourcesContent":["'use client';\n\nimport { marked } from 'marked';\nimport { memo, useEffect, useId, useMemo, useRef } from 'react';\nimport Markdown, { type Options } from 'react-markdown';\nimport remend from 'remend';\nimport type { Pluggable, PluggableList } from 'unified';\n\nimport {\n useMarkdownComponents,\n useMarkdownContent,\n useMarkdownRehypePlugins,\n useMarkdownRemarkPlugins,\n} from '@/hooks/useMarkdown';\nimport { useMarkdownContext } from '@/Markdown/components/MarkdownProvider';\nimport { rehypeStreamAnimated } from '@/Markdown/plugins/rehypeStreamAnimated';\n\nimport { styles } from './style';\nimport { useSmoothStreamContent } from './useSmoothStreamContent';\nimport { type BlockInfo, useStreamQueue } from './useStreamQueue';\n\nconst STREAM_FADE_DURATION = 280;\n\nfunction countChars(text: string): number {\n return [...text].length;\n}\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null;\n\nconst isDeepEqualValue = (a: unknown, b: unknown): boolean => {\n if (a === b) return true;\n\n if (Array.isArray(a) || Array.isArray(b)) {\n if (!Array.isArray(a) || !Array.isArray(b)) return false;\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (!isDeepEqualValue(a[i], b[i])) return false;\n }\n return true;\n }\n\n if (!isRecord(a) || !isRecord(b)) return false;\n\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n if (keysA.length !== keysB.length) return false;\n\n for (const key of keysA) {\n if (!isDeepEqualValue(a[key], b[key])) return false;\n }\n\n return true;\n};\n\nconst isSamePlugin = (prevPlugin: Pluggable, nextPlugin: Pluggable): boolean => {\n const prevTuple = Array.isArray(prevPlugin) ? prevPlugin : [prevPlugin];\n const nextTuple = Array.isArray(nextPlugin) ? nextPlugin : [nextPlugin];\n\n if (prevTuple.length !== nextTuple.length) return false;\n if (prevTuple[0] !== nextTuple[0]) return false;\n\n return isDeepEqualValue(prevTuple.slice(1), nextTuple.slice(1));\n};\n\nconst isSamePlugins = (\n prevPlugins?: PluggableList | null,\n nextPlugins?: PluggableList | null,\n): boolean => {\n if (prevPlugins === nextPlugins) return true;\n if (!prevPlugins || !nextPlugins) return !prevPlugins && !nextPlugins;\n if (prevPlugins.length !== nextPlugins.length) return false;\n\n for (let i = 0; i < prevPlugins.length; i++) {\n if (!isSamePlugin(prevPlugins[i], nextPlugins[i])) return false;\n }\n\n return true;\n};\n\nconst useStablePlugins = (plugins: PluggableList): PluggableList => {\n const stableRef = useRef<PluggableList>(plugins);\n\n if (!isSamePlugins(stableRef.current, plugins)) {\n stableRef.current = plugins;\n }\n\n return stableRef.current;\n};\n\nconst StreamdownBlock = memo<Options>(\n ({ children, ...rest }) => {\n return <Markdown {...rest}>{children}</Markdown>;\n },\n (prevProps, nextProps) =>\n prevProps.children === nextProps.children &&\n prevProps.components === nextProps.components &&\n isSamePlugins(prevProps.rehypePlugins, nextProps.rehypePlugins) &&\n isSamePlugins(prevProps.remarkPlugins, nextProps.remarkPlugins),\n);\n\nStreamdownBlock.displayName = 'StreamdownBlock';\n\nexport const StreamdownRender = memo<Options>(({ children, ...rest }) => {\n const { streamSmoothingPreset = 'balanced' } = useMarkdownContext();\n const escapedContent = useMarkdownContent(children || '');\n const components = useMarkdownComponents();\n const baseRehypePlugins = useStablePlugins(useMarkdownRehypePlugins());\n const remarkPlugins = useStablePlugins(useMarkdownRemarkPlugins());\n const generatedId = useId();\n const smoothedContent = useSmoothStreamContent(\n typeof escapedContent === 'string' ? escapedContent : '',\n { preset: streamSmoothingPreset },\n );\n\n const processedContent = useMemo(() => {\n return remend(smoothedContent);\n }, [smoothedContent]);\n\n const blocks: BlockInfo[] = useMemo(() => {\n const tokens = marked.lexer(processedContent);\n let offset = 0;\n return tokens.map((token) => {\n const block = { content: token.raw, startOffset: offset };\n offset += token.raw.length;\n return block;\n });\n }, [processedContent]);\n\n const { getBlockState, charDelay } = useStreamQueue(blocks);\n const prevBlockCharCountRef = useRef<Map<number, number>>(new Map());\n const blockTimelineRef = useRef<Map<number, number>>(new Map());\n const lastRenderTsRef = useRef<number | null>(null);\n\n const renderTs = typeof performance === 'undefined' ? Date.now() : performance.now();\n const frameDt =\n lastRenderTsRef.current === null\n ? 0\n : Math.max(0, Math.min(renderTs - lastRenderTsRef.current, 120));\n\n const timelineForRender = useMemo(() => {\n const next = new Map<number, number>();\n const prevTimeline = blockTimelineRef.current;\n const prevCharCounts = prevBlockCharCountRef.current;\n\n for (const block of blocks) {\n const blockCharCount = countChars(block.content);\n const prevCharCount = prevCharCounts.get(block.startOffset) ?? 0;\n const prevElapsed = prevTimeline.get(block.startOffset);\n const latestCharStart = Math.max(0, (blockCharCount - 1) * charDelay);\n\n if (prevElapsed === undefined || blockCharCount < prevCharCount) {\n next.set(block.startOffset, latestCharStart);\n continue;\n }\n\n const elapsedByTime = prevElapsed + frameDt;\n // Avoid huge hidden backlog when stream updates in bursts.\n const minElapsed = Math.max(0, latestCharStart - charDelay * 2);\n next.set(block.startOffset, Math.max(elapsedByTime, minElapsed));\n }\n\n return next;\n }, [blocks, charDelay, frameDt]);\n\n useEffect(() => {\n const nextCharCount = new Map<number, number>();\n for (const block of blocks) {\n nextCharCount.set(block.startOffset, countChars(block.content));\n }\n prevBlockCharCountRef.current = nextCharCount;\n blockTimelineRef.current = timelineForRender;\n lastRenderTsRef.current = typeof performance === 'undefined' ? Date.now() : performance.now();\n }, [blocks, timelineForRender]);\n\n return (\n <div className={styles.animated}>\n {blocks.map((block, index) => {\n const state = getBlockState(index);\n if (state === 'queued') return null;\n const timelineElapsedMs = timelineForRender.get(block.startOffset) ?? 0;\n\n let plugins: Pluggable[];\n if (state === 'streaming') {\n plugins = [\n ...baseRehypePlugins,\n [\n rehypeStreamAnimated,\n { charDelay, fadeDuration: STREAM_FADE_DURATION, timelineElapsedMs },\n ],\n ];\n } else if (state === 'animating') {\n // Continue from previously rendered progress instead of restarting\n // or force-switching to fully revealed.\n plugins = [\n ...baseRehypePlugins,\n [\n rehypeStreamAnimated,\n { charDelay, fadeDuration: STREAM_FADE_DURATION, timelineElapsedMs },\n ],\n ];\n } else {\n // Keep fade continuity for just-finished chars; avoid instant class\n // switch to stream-char-revealed that would cancel in-flight fades.\n plugins = [\n ...baseRehypePlugins,\n [\n rehypeStreamAnimated,\n { charDelay, fadeDuration: STREAM_FADE_DURATION, timelineElapsedMs },\n ],\n ];\n }\n\n return (\n <StreamdownBlock\n {...rest}\n components={components}\n key={`${generatedId}-${block.startOffset}`}\n rehypePlugins={plugins}\n remarkPlugins={remarkPlugins}\n >\n {block.content}\n </StreamdownBlock>\n );\n })}\n </div>\n );\n});\n\nStreamdownRender.displayName = 'StreamdownRender';\n\nexport default StreamdownRender;\n"],"mappings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AAgB,cAAc,KAAK,KAAK,GAAG,YAAY,KAAK;IAC5F,CAAC,QAAQ,kBAAkB,CAAC;AAE/B,QACE,oBAAC;EAAI,WAAW,OAAO;YACpB,OAAO,KAAK,OAAO,UAAU;GAC5B,MAAM,QAAQ,cAAc,MAAM;AAClC,OAAI,UAAU,SAAU,QAAO;GAC/B,MAAM,oBAAoB,kBAAkB,IAAI,MAAM,YAAY,IAAI;GAEtE,IAAIC;AACJ,OAAI,UAAU,YACZ,WAAU,CACR,GAAG,mBACH,CACE,sBACA;IAAE;IAAW,cAAc;IAAsB;IAAmB,CACrE,CACF;YACQ,UAAU,YAGnB,WAAU,CACR,GAAG,mBACH,CACE,sBACA;IAAE;IAAW,cAAc;IAAsB;IAAmB,CACrE,CACF;OAID,WAAU,CACR,GAAG,mBACH,CACE,sBACA;IAAE;IAAW,cAAc;IAAsB;IAAmB,CACrE,CACF;AAGH,UACE,8BAAC;IACC,GAAI;IACQ;IACZ,KAAK,GAAG,YAAY,GAAG,MAAM;IAC7B,eAAe;IACA;MAEd,MAAM,QACS;IAEpB;GACE;EAER;AAEF,iBAAiB,cAAc;AAE/B,+BAAe"}
@@ -8,8 +8,8 @@ const styles = createStaticStyles(({ css: css$1 }) => {
8
8
  opacity: 0;
9
9
 
10
10
  animation-name: ${fadeIn};
11
- animation-duration: 150ms;
12
- animation-timing-function: ease-out;
11
+ animation-duration: 280ms;
12
+ animation-timing-function: cubic-bezier(0.33, 0, 0.67, 1);
13
13
  animation-fill-mode: forwards;
14
14
  }
15
15
 
@@ -1 +1 @@
1
- {"version":3,"file":"style.mjs","names":[],"sources":["../../../src/Markdown/SyntaxMarkdown/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\n\nimport { fadeIn } from '@/styles/animations';\n\nexport const styles = createStaticStyles(({ css }) => {\n return {\n animated: css`\n .stream-char {\n opacity: 0;\n\n animation-name: ${fadeIn};\n animation-duration: 150ms;\n animation-timing-function: ease-out;\n animation-fill-mode: forwards;\n }\n\n .stream-char-revealed {\n opacity: 1;\n animation: none;\n }\n\n .katex-display .katex-html span {\n mask: none !important;\n animation: none !important;\n }\n `,\n };\n});\n"],"mappings":";;;;AAIA,MAAa,SAAS,oBAAoB,EAAE,iBAAU;AACpD,QAAO,EACL,UAAU,KAAG;;;;0BAIS,OAAO;;;;;;;;;;;;;;;OAgB9B;EACD"}
1
+ {"version":3,"file":"style.mjs","names":[],"sources":["../../../src/Markdown/SyntaxMarkdown/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\n\nimport { fadeIn } from '@/styles/animations';\n\nexport const styles = createStaticStyles(({ css }) => {\n return {\n animated: css`\n .stream-char {\n opacity: 0;\n\n animation-name: ${fadeIn};\n animation-duration: 280ms;\n animation-timing-function: cubic-bezier(0.33, 0, 0.67, 1);\n animation-fill-mode: forwards;\n }\n\n .stream-char-revealed {\n opacity: 1;\n animation: none;\n }\n\n .katex-display .katex-html span {\n mask: none !important;\n animation: none !important;\n }\n `,\n };\n});\n"],"mappings":";;;;AAIA,MAAa,SAAS,oBAAoB,EAAE,iBAAU;AACpD,QAAO,EACL,UAAU,KAAG;;;;0BAIS,OAAO;;;;;;;;;;;;;;;OAgB9B;EACD"}