@lobehub/ui 4.17.0 → 4.18.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 (175) 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/CodeDiff/CodeDiff.d.mts +8 -0
  9. package/es/CodeDiff/CodeDiff.mjs +122 -0
  10. package/es/CodeDiff/CodeDiff.mjs.map +1 -0
  11. package/es/CodeDiff/PatchDiff.d.mts +8 -0
  12. package/es/CodeDiff/PatchDiff.mjs +101 -0
  13. package/es/CodeDiff/PatchDiff.mjs.map +1 -0
  14. package/es/CodeDiff/index.d.mts +4 -0
  15. package/es/CodeDiff/index.d.ts +1 -0
  16. package/es/CodeDiff/index.js +1 -0
  17. package/es/CodeDiff/index.mjs +4 -0
  18. package/es/CodeDiff/style.mjs +122 -0
  19. package/es/CodeDiff/style.mjs.map +1 -0
  20. package/es/CodeDiff/type.d.mts +123 -0
  21. package/es/CodeEditor/CodeEditor.d.mts +2 -2
  22. package/es/Collapse/Collapse.d.mts +2 -2
  23. package/es/ConfigProvider/index.d.mts +2 -2
  24. package/es/ContextMenu/ContextMenuHost.d.mts +3 -3
  25. package/es/CopyButton/CopyButton.d.mts +2 -2
  26. package/es/DatePicker/DatePicker.d.mts +2 -2
  27. package/es/DraggablePanel/components/DraggablePanelBody.d.mts +2 -2
  28. package/es/DraggablePanel/components/DraggablePanelContainer.d.mts +2 -2
  29. package/es/DraggablePanel/components/DraggablePanelFooter.d.mts +2 -2
  30. package/es/DraggablePanel/components/DraggablePanelHeader.d.mts +2 -2
  31. package/es/DraggableSideNav/DraggableSideNav.d.mts +2 -2
  32. package/es/Drawer/Drawer.d.mts +2 -2
  33. package/es/Dropdown/Dropdown.d.mts +2 -2
  34. package/es/DropdownMenu/DropdownMenu.d.mts +2 -2
  35. package/es/DropdownMenu/DropdownMenu.mjs +13 -42
  36. package/es/DropdownMenu/DropdownMenu.mjs.map +1 -1
  37. package/es/DropdownMenu/atoms.d.mts +145 -0
  38. package/es/DropdownMenu/atoms.mjs +163 -0
  39. package/es/DropdownMenu/atoms.mjs.map +1 -0
  40. package/es/DropdownMenu/index.d.mts +3 -1
  41. package/es/DropdownMenu/index.mjs +3 -1
  42. package/es/DropdownMenu/renderItems.d.mts +10 -0
  43. package/es/DropdownMenu/renderItems.mjs +22 -47
  44. package/es/DropdownMenu/renderItems.mjs.map +1 -1
  45. package/es/EditableText/EditableText.d.mts +2 -2
  46. package/es/EmojiPicker/EmojiPicker.d.mts +2 -2
  47. package/es/Flex/FlexBasic.d.mts +2 -2
  48. package/es/FontLoader/index.d.mts +2 -2
  49. package/es/Footer/Footer.d.mts +2 -2
  50. package/es/Form/components/FormGroup.d.mts +2 -2
  51. package/es/Form/components/FormItem.d.mts +2 -2
  52. package/es/Form/components/FormSubmitFooter.d.mts +2 -2
  53. package/es/FormModal/FormModal.d.mts +2 -2
  54. package/es/GuideCard/GuideCard.d.mts +2 -2
  55. package/es/Header/Header.d.mts +2 -2
  56. package/es/Highlighter/FullFeatured.mjs +1 -1
  57. package/es/Highlighter/Highlighter.d.mts +2 -2
  58. package/es/Highlighter/SyntaxHighlighter/index.d.mts +2 -2
  59. package/es/Hotkey/Hotkey.d.mts +2 -2
  60. package/es/HotkeyInput/HotkeyInput.d.mts +2 -2
  61. package/es/Icon/Icon.d.mts +2 -2
  62. package/es/Icon/components/IconProvider.d.mts +3 -3
  63. package/es/Image/PreviewGroup.d.mts +2 -2
  64. package/es/ImageSelect/ImageSelect.d.mts +2 -2
  65. package/es/Input/Input.d.mts +2 -2
  66. package/es/Input/InputNumber.d.mts +2 -2
  67. package/es/Input/InputOPT.d.mts +2 -2
  68. package/es/Input/InputPassword.d.mts +2 -2
  69. package/es/Input/TextArea.d.mts +2 -2
  70. package/es/Layout/components/LayoutFooter.d.mts +2 -2
  71. package/es/Layout/components/LayoutHeader.d.mts +2 -2
  72. package/es/Layout/components/LayoutMain.d.mts +2 -2
  73. package/es/Layout/components/LayoutSidebar.d.mts +2 -2
  74. package/es/Layout/components/LayoutSidebarInner.d.mts +2 -2
  75. package/es/Layout/components/LayoutToc.d.mts +2 -2
  76. package/es/List/ListItem/index.d.mts +2 -2
  77. package/es/Markdown/Markdown.d.mts +2 -2
  78. package/es/Markdown/Typography.d.mts +2 -2
  79. package/es/Markdown/components/SearchResultCards/index.d.mts +2 -2
  80. package/es/Markdown/markdown.style.mjs +0 -16
  81. package/es/Markdown/markdown.style.mjs.map +1 -1
  82. package/es/Markdown/type.d.mts +1 -2
  83. package/es/MaskShadow/MaskShadow.d.mts +2 -2
  84. package/es/Menu/Menu.d.mts +2 -2
  85. package/es/Menu/sharedStyle.mjs +1 -1
  86. package/es/Menu/sharedStyle.mjs.map +1 -1
  87. package/es/Mermaid/FullFeatured.mjs +1 -1
  88. package/es/Mermaid/Mermaid.d.mts +2 -2
  89. package/es/Mermaid/SyntaxMermaid/index.d.mts +2 -2
  90. package/es/Mermaid/type.d.mts +1 -1
  91. package/es/Modal/Modal.d.mts +2 -2
  92. package/es/Modal/ModalProvider.d.mts +2 -2
  93. package/es/Modal/imperative.d.mts +2 -2
  94. package/es/MotionProvider/index.d.mts +2 -2
  95. package/es/Popover/ArrowIcon.d.mts +7 -0
  96. package/es/Popover/PopoverGroup.mjs +14 -15
  97. package/es/Popover/PopoverGroup.mjs.map +1 -1
  98. package/es/Popover/PopoverPortal.d.mts +6 -0
  99. package/es/Popover/PopoverPortal.mjs +1 -1
  100. package/es/Popover/PopoverStandalone.mjs +20 -49
  101. package/es/Popover/PopoverStandalone.mjs.map +1 -1
  102. package/es/Popover/atoms.d.mts +77 -0
  103. package/es/Popover/atoms.mjs +104 -0
  104. package/es/Popover/atoms.mjs.map +1 -0
  105. package/es/Popover/context.d.mts +2 -2
  106. package/es/Popover/groupContext.d.mts +1 -0
  107. package/es/Popover/groupContext.mjs.map +1 -1
  108. package/es/Popover/index.d.mts +5 -2
  109. package/es/Popover/index.mjs +4 -1
  110. package/es/SearchBar/SearchBar.d.mts +2 -2
  111. package/es/Segmented/Segmented.d.mts +2 -2
  112. package/es/Select/Select.d.mts +2 -2
  113. package/es/SideNav/SideNav.d.mts +2 -2
  114. package/es/SliderWithInput/SliderWithInput.d.mts +2 -2
  115. package/es/SortableList/components/DragHandle.d.mts +2 -2
  116. package/es/SortableList/components/SortableItem.d.mts +2 -2
  117. package/es/ThemeProvider/ThemeProvider.d.mts +2 -2
  118. package/es/Toc/Toc.d.mts +2 -2
  119. package/es/Tooltip/groupContext.mjs.map +1 -1
  120. package/es/Video/index.d.mts +2 -2
  121. package/es/awesome/AuroraBackground/AuroraBackground.d.mts +2 -2
  122. package/es/awesome/BottomGradientButton/BottomGradientButton.d.mts +2 -2
  123. package/es/awesome/Features/Features.d.mts +2 -2
  124. package/es/awesome/Giscus/Giscus.d.mts +2 -2
  125. package/es/awesome/Giscus/type.d.mts +4 -4
  126. package/es/awesome/GradientButton/GradientButton.d.mts +2 -2
  127. package/es/awesome/GridBackground/GridBackground.d.mts +2 -2
  128. package/es/awesome/GridBackground/GridShowcase.d.mts +2 -2
  129. package/es/awesome/Hero/Hero.d.mts +2 -2
  130. package/es/awesome/Spline/Spine.d.mts +2 -2
  131. package/es/awesome/Spotlight/Spotlight.d.mts +2 -2
  132. package/es/awesome/SpotlightCard/SpotlightCard.d.mts +2 -2
  133. package/es/awesome/TypewriterEffect/TypewriterEffect.d.mts +2 -2
  134. package/es/brand/LobeChat/index.d.mts +2 -2
  135. package/es/brand/LobeHub/index.d.mts +2 -2
  136. package/es/brand/LogoThree/LogoSpline.d.mts +2 -2
  137. package/es/brand/LogoThree/index.d.mts +2 -2
  138. package/es/chat/BackBottom/BackBottom.d.mts +2 -2
  139. package/es/chat/ChatInputArea/components/ChatInputAreaInner.d.mts +2 -2
  140. package/es/chat/ChatItem/ChatItem.d.mts +2 -2
  141. package/es/chat/ChatList/ChatList.d.mts +2 -2
  142. package/es/chat/EditableMessage/EditableMessage.d.mts +2 -2
  143. package/es/chat/EditableMessageList/EditableMessageList.d.mts +2 -2
  144. package/es/chat/MessageInput/MessageInput.d.mts +2 -2
  145. package/es/chat/MessageModal/MessageModal.d.mts +2 -2
  146. package/es/color/ColorScales/index.d.mts +2 -2
  147. package/es/color/CssVar/index.d.mts +2 -2
  148. package/es/hooks/useMermaid.mjs.map +1 -1
  149. package/es/hooks/useStreamMermaid.mjs.map +1 -1
  150. package/es/i18n/context.d.mts +2 -2
  151. package/es/icons/lucideExtra/BotPromptIcon.d.mts +2 -2
  152. package/es/icons/lucideExtra/CreateBotIcon.d.mts +3 -3
  153. package/es/icons/lucideExtra/DiscordIcon.d.mts +2 -2
  154. package/es/icons/lucideExtra/GlobeOffIcon.d.mts +3 -3
  155. package/es/icons/lucideExtra/GroupBotIcon.d.mts +3 -3
  156. package/es/icons/lucideExtra/GroupBotSquareIcon.d.mts +3 -3
  157. package/es/icons/lucideExtra/LeftClickIcon.d.mts +3 -3
  158. package/es/icons/lucideExtra/LeftDoubleClickIcon.d.mts +3 -3
  159. package/es/icons/lucideExtra/McpIcon.d.mts +2 -2
  160. package/es/icons/lucideExtra/ProviderIcon.d.mts +3 -3
  161. package/es/icons/lucideExtra/RightClickIcon.d.mts +3 -3
  162. package/es/icons/lucideExtra/RightDoubleClickIcon.d.mts +3 -3
  163. package/es/icons/lucideExtra/ShapesUploadIcon.d.mts +3 -3
  164. package/es/icons/lucideExtra/TreeDownRightIcon.d.mts +3 -3
  165. package/es/icons/lucideExtra/TreeUpDownRightIcon.d.mts +3 -3
  166. package/es/index.d.mts +11 -2
  167. package/es/index.mjs +10 -3
  168. package/es/mdx/Mdx/index.d.mts +2 -2
  169. package/es/mobile/ChatHeader/ChatHeaderTitle.d.mts +2 -2
  170. package/es/mobile/ChatInputArea/components/ChatSendButton.d.mts +2 -2
  171. package/es/mobile/TabBar/TabBar.d.mts +2 -2
  172. package/es/storybook/StoryBook/index.d.mts +2 -2
  173. package/es/utils/placement.d.mts +7 -1
  174. package/es/utils/placement.mjs.map +1 -1
  175. package/package.json +2 -1
@@ -1,5 +1,5 @@
1
1
  import { DivProps } from "../../types/index.mjs";
2
- import * as react16 from "react";
2
+ import * as react67 from "react";
3
3
  import { ReactNode } from "react";
4
4
 
5
5
  //#region src/brand/LobeChat/index.d.ts
@@ -8,7 +8,7 @@ interface LobeChatProps extends DivProps {
8
8
  size?: number;
9
9
  type?: '3d' | 'flat' | 'mono' | 'text' | 'combine';
10
10
  }
11
- declare const LobeChat: react16.NamedExoticComponent<LobeChatProps>;
11
+ declare const LobeChat: react67.NamedExoticComponent<LobeChatProps>;
12
12
  //#endregion
13
13
  export { LobeChat, LobeChatProps };
14
14
  //# sourceMappingURL=index.d.mts.map
@@ -1,5 +1,5 @@
1
1
  import { DivProps } from "../../types/index.mjs";
2
- import * as react17 from "react";
2
+ import * as react68 from "react";
3
3
  import { ReactNode } from "react";
4
4
 
5
5
  //#region src/brand/LobeHub/index.d.ts
@@ -8,7 +8,7 @@ interface LobeHubProps extends DivProps {
8
8
  size?: number;
9
9
  type?: '3d' | 'flat' | 'mono' | 'text' | 'combine';
10
10
  }
11
- declare const LobeHub: react17.NamedExoticComponent<LobeHubProps>;
11
+ declare const LobeHub: react68.NamedExoticComponent<LobeHubProps>;
12
12
  //#endregion
13
13
  export { LobeHub, LobeHubProps };
14
14
  //# sourceMappingURL=index.d.mts.map
@@ -1,6 +1,6 @@
1
1
  import { SplineProps } from "../../awesome/Spline/type.mjs";
2
2
  import "../../awesome/Spline/index.mjs";
3
- import * as react19 from "react";
3
+ import * as react70 from "react";
4
4
  import { CSSProperties } from "react";
5
5
 
6
6
  //#region src/brand/LogoThree/LogoSpline.d.ts
@@ -10,7 +10,7 @@ interface LogoSplineProps extends Partial<SplineProps> {
10
10
  style?: CSSProperties;
11
11
  width?: number | string;
12
12
  }
13
- declare const LogoSpline: react19.NamedExoticComponent<LogoSplineProps>;
13
+ declare const LogoSpline: react70.NamedExoticComponent<LogoSplineProps>;
14
14
  //#endregion
15
15
  export { LogoSpline, LogoSplineProps };
16
16
  //# sourceMappingURL=LogoSpline.d.mts.map
@@ -1,6 +1,6 @@
1
1
  import { SplineProps } from "../../awesome/Spline/type.mjs";
2
2
  import "../../awesome/Spline/index.mjs";
3
- import * as react18 from "react";
3
+ import * as react69 from "react";
4
4
  import { CSSProperties } from "react";
5
5
 
6
6
  //#region src/brand/LogoThree/index.d.ts
@@ -9,7 +9,7 @@ interface LogoThreeProps extends Partial<SplineProps> {
9
9
  size?: number;
10
10
  style?: CSSProperties;
11
11
  }
12
- declare const LogoThree: react18.NamedExoticComponent<LogoThreeProps>;
12
+ declare const LogoThree: react69.NamedExoticComponent<LogoThreeProps>;
13
13
  //#endregion
14
14
  export { LogoThree, LogoThreeProps };
15
15
  //# sourceMappingURL=index.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { BackBottomProps } from "./type.mjs";
2
- import * as react132 from "react";
2
+ import * as react123 from "react";
3
3
 
4
4
  //#region src/chat/BackBottom/BackBottom.d.ts
5
- declare const BackBottom: react132.NamedExoticComponent<BackBottomProps>;
5
+ declare const BackBottom: react123.NamedExoticComponent<BackBottomProps>;
6
6
  //#endregion
7
7
  export { BackBottom };
8
8
  //# sourceMappingURL=BackBottom.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { ChatInputAreaInnerProps } from "../type.mjs";
2
- import * as react137 from "react";
2
+ import * as react124 from "react";
3
3
 
4
4
  //#region src/chat/ChatInputArea/components/ChatInputAreaInner.d.ts
5
- declare const ChatInputAreaInner: react137.NamedExoticComponent<ChatInputAreaInnerProps>;
5
+ declare const ChatInputAreaInner: react124.NamedExoticComponent<ChatInputAreaInnerProps>;
6
6
  //#endregion
7
7
  export { ChatInputAreaInner };
8
8
  //# sourceMappingURL=ChatInputAreaInner.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { ChatItemProps } from "./type.mjs";
2
- import * as react133 from "react";
2
+ import * as react129 from "react";
3
3
 
4
4
  //#region src/chat/ChatItem/ChatItem.d.ts
5
- declare const ChatItem: react133.NamedExoticComponent<ChatItemProps>;
5
+ declare const ChatItem: react129.NamedExoticComponent<ChatItemProps>;
6
6
  //#endregion
7
7
  export { ChatItem };
8
8
  //# sourceMappingURL=ChatItem.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { ChatListProps } from "./type.mjs";
2
- import * as react135 from "react";
2
+ import * as react125 from "react";
3
3
 
4
4
  //#region src/chat/ChatList/ChatList.d.ts
5
- declare const ChatList: react135.NamedExoticComponent<ChatListProps>;
5
+ declare const ChatList: react125.NamedExoticComponent<ChatListProps>;
6
6
  //#endregion
7
7
  export { ChatList };
8
8
  //# sourceMappingURL=ChatList.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { EditableMessageProps } from "./type.mjs";
2
- import * as react134 from "react";
2
+ import * as react126 from "react";
3
3
 
4
4
  //#region src/chat/EditableMessage/EditableMessage.d.ts
5
- declare const EditableMessage: react134.NamedExoticComponent<EditableMessageProps>;
5
+ declare const EditableMessage: react126.NamedExoticComponent<EditableMessageProps>;
6
6
  //#endregion
7
7
  export { EditableMessage };
8
8
  //# sourceMappingURL=EditableMessage.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { EditableMessageListProps } from "./type.mjs";
2
- import * as react136 from "react";
2
+ import * as react127 from "react";
3
3
 
4
4
  //#region src/chat/EditableMessageList/EditableMessageList.d.ts
5
- declare const EditableMessageList: react136.NamedExoticComponent<EditableMessageListProps>;
5
+ declare const EditableMessageList: react127.NamedExoticComponent<EditableMessageListProps>;
6
6
  //#endregion
7
7
  export { EditableMessageList };
8
8
  //# sourceMappingURL=EditableMessageList.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { MessageInputProps } from "./type.mjs";
2
- import * as react139 from "react";
2
+ import * as react128 from "react";
3
3
 
4
4
  //#region src/chat/MessageInput/MessageInput.d.ts
5
- declare const MessageInput: react139.NamedExoticComponent<MessageInputProps>;
5
+ declare const MessageInput: react128.NamedExoticComponent<MessageInputProps>;
6
6
  //#endregion
7
7
  export { MessageInput };
8
8
  //# sourceMappingURL=MessageInput.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { MessageModalProps } from "./type.mjs";
2
- import * as react138 from "react";
2
+ import * as react130 from "react";
3
3
 
4
4
  //#region src/chat/MessageModal/MessageModal.d.ts
5
- declare const MessageModal: react138.NamedExoticComponent<MessageModalProps>;
5
+ declare const MessageModal: react130.NamedExoticComponent<MessageModalProps>;
6
6
  //#endregion
7
7
  export { MessageModal };
8
8
  //# sourceMappingURL=MessageModal.d.mts.map
@@ -1,5 +1,5 @@
1
1
  import { ColorScaleItem } from "../types.mjs";
2
- import * as react13 from "react";
2
+ import * as react61 from "react";
3
3
 
4
4
  //#region src/color/ColorScales/index.d.ts
5
5
  interface ColorScalesProps {
@@ -16,7 +16,7 @@ interface ColorScalesProps {
16
16
  */
17
17
  scale: ColorScaleItem;
18
18
  }
19
- declare const ColorScales: react13.NamedExoticComponent<ColorScalesProps>;
19
+ declare const ColorScales: react61.NamedExoticComponent<ColorScalesProps>;
20
20
  //#endregion
21
21
  export { ColorScales, ColorScalesProps };
22
22
  //# sourceMappingURL=index.d.mts.map
@@ -1,5 +1,5 @@
1
1
  import { ColorScaleItem } from "../types.mjs";
2
- import * as react14 from "react";
2
+ import * as react62 from "react";
3
3
 
4
4
  //#region src/color/CssVar/index.d.ts
5
5
  interface ColorScalesProps {
@@ -16,7 +16,7 @@ interface ColorScalesProps {
16
16
  */
17
17
  scale: ColorScaleItem;
18
18
  }
19
- declare const ColorScales: react14.NamedExoticComponent<ColorScalesProps>;
19
+ declare const ColorScales: react62.NamedExoticComponent<ColorScalesProps>;
20
20
  //#endregion
21
21
  export { ColorScales };
22
22
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMermaid.mjs","names":["mermaidPromise: Promise<typeof import('mermaid').default | null> | null"],"sources":["../../src/hooks/useMermaid.ts"],"sourcesContent":["'use client';\n\nimport { useTheme } from 'antd-style';\nimport type { MermaidConfig } from 'mermaid/dist/config.type';\nimport { useEffect, useMemo, useState } from 'react';\nimport { Md5 } from 'ts-md5';\n\n// 缓存已验证的图表内容\nexport const MD5_LENGTH_THRESHOLD = 10_000;\n\n// Application-level cache for rendered Mermaid SVG\n// Key: cacheKey string, Value: Promise<string>\nconst mermaidCache = new Map<string, Promise<string>>();\n\n// Maximum cache size to prevent memory leaks\nconst MAX_CACHE_SIZE = 500;\n\n// Clean up old cache entries when limit is reached\nconst cleanupCache = () => {\n if (mermaidCache.size > MAX_CACHE_SIZE) {\n // Remove oldest 20% of entries\n const entriesToRemove = Math.floor(MAX_CACHE_SIZE * 0.2);\n const keysToRemove = Array.from(mermaidCache.keys()).slice(0, entriesToRemove);\n for (const key of keysToRemove) {\n mermaidCache.delete(key);\n }\n }\n};\n\n// 懒加载 mermaid 实例\nlet mermaidPromise: Promise<typeof import('mermaid').default | null> | null = null;\n\nexport const loadMermaid = (): Promise<typeof import('mermaid').default | null> => {\n if (typeof window === 'undefined') return Promise.resolve(null);\n\n if (!mermaidPromise) {\n mermaidPromise = import('mermaid').then((mod) => mod.default);\n }\n\n return mermaidPromise;\n};\n\n// Helper to create mermaid config\nexport const createMermaidConfig = (\n theme: ReturnType<typeof useTheme>,\n customTheme?: MermaidConfig['theme'],\n): MermaidConfig => ({\n fontFamily: theme.fontFamilyCode,\n gantt: {\n useWidth: 1920,\n },\n securityLevel: 'loose',\n startOnLoad: false,\n theme: customTheme || (theme.isDarkMode ? 'dark' : 'neutral'),\n themeVariables: customTheme\n ? undefined\n : {\n errorBkgColor: theme.colorTextDescription,\n errorTextColor: theme.colorTextDescription,\n fontFamily: theme.fontFamily,\n lineColor: theme.colorTextSecondary,\n mainBkg: theme.colorBgContainer,\n noteBkgColor: theme.colorInfoBg,\n noteTextColor: theme.colorInfoText,\n pie1: theme.geekblue,\n pie2: theme.colorWarning,\n pie3: theme.colorSuccess,\n pie4: theme.colorError,\n primaryBorderColor: theme.colorBorder,\n primaryColor: theme.colorBgContainer,\n primaryTextColor: theme.colorText,\n secondaryBorderColor: theme.colorInfoBorder,\n secondaryColor: theme.colorInfoBg,\n secondaryTextColor: theme.colorInfoText,\n tertiaryBorderColor: theme.colorSuccessBorder,\n tertiaryColor: theme.colorSuccessBg,\n tertiaryTextColor: theme.colorSuccessText,\n textColor: theme.colorText,\n },\n});\n\n/**\n * 验证并处理 Mermaid 图表内容 - 优化版本(移除 SWR)\n */\nexport const useMermaid = (\n content: string,\n {\n id,\n theme: customTheme,\n }: {\n id: string;\n theme?: MermaidConfig['theme'];\n },\n): string => {\n const theme = useTheme();\n const [data, setData] = useState<string>('');\n\n // 提取主题相关配置到 useMemo 中 - 只依赖实际使用的 theme 属性\n const mermaidConfig = useMemo(\n () => createMermaidConfig(theme, customTheme),\n [\n theme.fontFamilyCode,\n theme.isDarkMode,\n theme.colorTextDescription,\n theme.fontFamily,\n theme.colorTextSecondary,\n theme.colorBgContainer,\n theme.colorInfoBg,\n theme.colorInfoText,\n theme.geekblue,\n theme.colorWarning,\n theme.colorSuccess,\n theme.colorError,\n theme.colorBorder,\n theme.colorInfoBorder,\n theme.colorSuccessBorder,\n theme.colorSuccessBg,\n theme.colorSuccessText,\n theme.colorText,\n customTheme,\n ],\n );\n\n // 为长内容生成哈希键\n const cacheKey = useMemo((): string => {\n const hash = content.length < MD5_LENGTH_THRESHOLD ? content : Md5.hashStr(content);\n return [id, customTheme || (theme.isDarkMode ? 'd' : 'l'), hash].filter(Boolean).join('-');\n }, [content, id, theme.isDarkMode, customTheme]);\n\n useEffect(() => {\n // Check cache first\n const cachedPromise = mermaidCache.get(cacheKey);\n if (cachedPromise) {\n cachedPromise\n .then((svg) => {\n setData(svg);\n })\n .catch(() => {\n // Silently handle errors, fallback will be handled in the promise\n });\n return;\n }\n\n // Create new promise for rendering\n const renderPromise = (async (): Promise<string> => {\n try {\n const mermaidInstance = await loadMermaid();\n if (!mermaidInstance) return '';\n\n // 验证语法\n const isValid = await mermaidInstance.parse(content);\n\n if (isValid) {\n // 初始化并渲染\n mermaidInstance.initialize(mermaidConfig);\n const { svg } = await mermaidInstance.render(id, content);\n return svg;\n } else {\n throw new Error('Mermaid 语法无效');\n }\n } catch (error_) {\n console.error('Mermaid 解析错误:', error_);\n return '';\n }\n })();\n\n // Cache the promise\n mermaidCache.set(cacheKey, renderPromise);\n cleanupCache();\n\n // Handle promise result\n renderPromise\n .then((svg) => {\n // Only update if this is still the current cache key\n if (mermaidCache.get(cacheKey) === renderPromise) {\n setData(svg);\n }\n })\n .catch(() => {\n // Remove failed promise from cache\n if (mermaidCache.get(cacheKey) === renderPromise) {\n mermaidCache.delete(cacheKey);\n }\n });\n }, [cacheKey, content, id, mermaidConfig]);\n\n return data;\n};\n"],"mappings":"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"}
1
+ {"version":3,"file":"useMermaid.mjs","names":["mermaidPromise: Promise<typeof import('mermaid').default | null> | null"],"sources":["../../src/hooks/useMermaid.ts"],"sourcesContent":["'use client';\n\nimport { useTheme } from 'antd-style';\nimport type { MermaidConfig } from 'mermaid';\nimport { useEffect, useMemo, useState } from 'react';\nimport { Md5 } from 'ts-md5';\n\n// 缓存已验证的图表内容\nexport const MD5_LENGTH_THRESHOLD = 10_000;\n\n// Application-level cache for rendered Mermaid SVG\n// Key: cacheKey string, Value: Promise<string>\nconst mermaidCache = new Map<string, Promise<string>>();\n\n// Maximum cache size to prevent memory leaks\nconst MAX_CACHE_SIZE = 500;\n\n// Clean up old cache entries when limit is reached\nconst cleanupCache = () => {\n if (mermaidCache.size > MAX_CACHE_SIZE) {\n // Remove oldest 20% of entries\n const entriesToRemove = Math.floor(MAX_CACHE_SIZE * 0.2);\n const keysToRemove = Array.from(mermaidCache.keys()).slice(0, entriesToRemove);\n for (const key of keysToRemove) {\n mermaidCache.delete(key);\n }\n }\n};\n\n// 懒加载 mermaid 实例\nlet mermaidPromise: Promise<typeof import('mermaid').default | null> | null = null;\n\nexport const loadMermaid = (): Promise<typeof import('mermaid').default | null> => {\n if (typeof window === 'undefined') return Promise.resolve(null);\n\n if (!mermaidPromise) {\n mermaidPromise = import('mermaid').then((mod) => mod.default);\n }\n\n return mermaidPromise;\n};\n\n// Helper to create mermaid config\nexport const createMermaidConfig = (\n theme: ReturnType<typeof useTheme>,\n customTheme?: MermaidConfig['theme'],\n): MermaidConfig => ({\n fontFamily: theme.fontFamilyCode,\n gantt: {\n useWidth: 1920,\n },\n securityLevel: 'loose',\n startOnLoad: false,\n theme: customTheme || (theme.isDarkMode ? 'dark' : 'neutral'),\n themeVariables: customTheme\n ? undefined\n : {\n errorBkgColor: theme.colorTextDescription,\n errorTextColor: theme.colorTextDescription,\n fontFamily: theme.fontFamily,\n lineColor: theme.colorTextSecondary,\n mainBkg: theme.colorBgContainer,\n noteBkgColor: theme.colorInfoBg,\n noteTextColor: theme.colorInfoText,\n pie1: theme.geekblue,\n pie2: theme.colorWarning,\n pie3: theme.colorSuccess,\n pie4: theme.colorError,\n primaryBorderColor: theme.colorBorder,\n primaryColor: theme.colorBgContainer,\n primaryTextColor: theme.colorText,\n secondaryBorderColor: theme.colorInfoBorder,\n secondaryColor: theme.colorInfoBg,\n secondaryTextColor: theme.colorInfoText,\n tertiaryBorderColor: theme.colorSuccessBorder,\n tertiaryColor: theme.colorSuccessBg,\n tertiaryTextColor: theme.colorSuccessText,\n textColor: theme.colorText,\n },\n});\n\n/**\n * 验证并处理 Mermaid 图表内容 - 优化版本(移除 SWR)\n */\nexport const useMermaid = (\n content: string,\n {\n id,\n theme: customTheme,\n }: {\n id: string;\n theme?: MermaidConfig['theme'];\n },\n): string => {\n const theme = useTheme();\n const [data, setData] = useState<string>('');\n\n // 提取主题相关配置到 useMemo 中 - 只依赖实际使用的 theme 属性\n const mermaidConfig = useMemo(\n () => createMermaidConfig(theme, customTheme),\n [\n theme.fontFamilyCode,\n theme.isDarkMode,\n theme.colorTextDescription,\n theme.fontFamily,\n theme.colorTextSecondary,\n theme.colorBgContainer,\n theme.colorInfoBg,\n theme.colorInfoText,\n theme.geekblue,\n theme.colorWarning,\n theme.colorSuccess,\n theme.colorError,\n theme.colorBorder,\n theme.colorInfoBorder,\n theme.colorSuccessBorder,\n theme.colorSuccessBg,\n theme.colorSuccessText,\n theme.colorText,\n customTheme,\n ],\n );\n\n // 为长内容生成哈希键\n const cacheKey = useMemo((): string => {\n const hash = content.length < MD5_LENGTH_THRESHOLD ? content : Md5.hashStr(content);\n return [id, customTheme || (theme.isDarkMode ? 'd' : 'l'), hash].filter(Boolean).join('-');\n }, [content, id, theme.isDarkMode, customTheme]);\n\n useEffect(() => {\n // Check cache first\n const cachedPromise = mermaidCache.get(cacheKey);\n if (cachedPromise) {\n cachedPromise\n .then((svg) => {\n setData(svg);\n })\n .catch(() => {\n // Silently handle errors, fallback will be handled in the promise\n });\n return;\n }\n\n // Create new promise for rendering\n const renderPromise = (async (): Promise<string> => {\n try {\n const mermaidInstance = await loadMermaid();\n if (!mermaidInstance) return '';\n\n // 验证语法\n const isValid = await mermaidInstance.parse(content);\n\n if (isValid) {\n // 初始化并渲染\n mermaidInstance.initialize(mermaidConfig);\n const { svg } = await mermaidInstance.render(id, content);\n return svg;\n } else {\n throw new Error('Mermaid 语法无效');\n }\n } catch (error_) {\n console.error('Mermaid 解析错误:', error_);\n return '';\n }\n })();\n\n // Cache the promise\n mermaidCache.set(cacheKey, renderPromise);\n cleanupCache();\n\n // Handle promise result\n renderPromise\n .then((svg) => {\n // Only update if this is still the current cache key\n if (mermaidCache.get(cacheKey) === renderPromise) {\n setData(svg);\n }\n })\n .catch(() => {\n // Remove failed promise from cache\n if (mermaidCache.get(cacheKey) === renderPromise) {\n mermaidCache.delete(cacheKey);\n }\n });\n }, [cacheKey, content, id, mermaidConfig]);\n\n return data;\n};\n"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"useStreamMermaid.mjs","names":["timeoutId"],"sources":["../../src/hooks/useStreamMermaid.ts"],"sourcesContent":["'use client';\n\nimport { useTheme } from 'antd-style';\nimport type { MermaidConfig } from 'mermaid/dist/config.type';\nimport { useEffect, useMemo, useRef, useState } from 'react';\n\nimport { createMermaidConfig, loadMermaid } from './useMermaid';\n\n/**\n * 流式 Mermaid 渲染 - 支持内容逐步更新\n */\nexport const useStreamMermaid = (\n content: string,\n {\n enabled = true,\n id,\n theme: customTheme,\n }: {\n enabled?: boolean;\n id: string;\n theme?: MermaidConfig['theme'];\n },\n): string => {\n const theme = useTheme();\n const [data, setData] = useState<string>('');\n const previousContentRef = useRef<string>('');\n const latestContentRef = useRef(content);\n const renderTimeoutRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n\n // 提取主题相关配置到 useMemo 中\n const mermaidConfig = useMemo(\n () => createMermaidConfig(theme, customTheme),\n [\n theme.fontFamilyCode,\n theme.isDarkMode,\n theme.colorTextDescription,\n theme.fontFamily,\n theme.colorTextSecondary,\n theme.colorBgContainer,\n theme.colorInfoBg,\n theme.colorInfoText,\n theme.geekblue,\n theme.colorWarning,\n theme.colorSuccess,\n theme.colorError,\n theme.colorBorder,\n theme.colorInfoBorder,\n theme.colorSuccessBorder,\n theme.colorSuccessBg,\n theme.colorSuccessText,\n theme.colorText,\n customTheme,\n ],\n );\n\n // Update latest content ref\n useEffect(() => {\n latestContentRef.current = content;\n }, [content]);\n\n // Debounced rendering for streaming content\n useEffect(() => {\n if (!enabled) {\n setData('');\n previousContentRef.current = '';\n const timeoutId = renderTimeoutRef.current;\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n return;\n }\n\n const currentContent = latestContentRef.current;\n\n // Skip if content hasn't changed\n if (currentContent === previousContentRef.current && data) {\n return;\n }\n\n // Clear previous timeout\n const timeoutId = renderTimeoutRef.current;\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n\n // Debounce rendering for streaming content (wait 300ms after last change)\n renderTimeoutRef.current = setTimeout(async () => {\n const contentToRender = latestContentRef.current;\n\n // Skip if content changed during debounce\n if (contentToRender !== currentContent) {\n return;\n }\n\n try {\n const mermaidInstance = await loadMermaid();\n if (!mermaidInstance) return;\n\n // 验证语法\n const isValid = await mermaidInstance.parse(contentToRender);\n\n if (isValid) {\n // 初始化并渲染\n mermaidInstance.initialize(mermaidConfig);\n const { svg } = await mermaidInstance.render(id, contentToRender);\n\n // Only update if content hasn't changed during rendering\n if (latestContentRef.current === contentToRender) {\n setData(svg);\n previousContentRef.current = contentToRender;\n }\n }\n } catch (error_) {\n // Silently handle errors during streaming\n // Only log if this is the final content\n if (contentToRender === latestContentRef.current) {\n console.error('Mermaid 解析错误:', error_);\n }\n }\n }, 300);\n\n return () => {\n const timeoutId = renderTimeoutRef.current;\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n };\n }, [enabled, content, id, mermaidConfig, data]);\n\n return data;\n};\n"],"mappings":";;;;;;;;;;AAWA,MAAa,oBACX,SACA,EACE,UAAU,MACV,IACA,OAAO,kBAME;CACX,MAAM,QAAQ,UAAU;CACxB,MAAM,CAAC,MAAM,WAAW,SAAiB,GAAG;CAC5C,MAAM,qBAAqB,OAAe,GAAG;CAC7C,MAAM,mBAAmB,OAAO,QAAQ;CACxC,MAAM,mBAAmB,OAAkD,OAAU;CAGrF,MAAM,gBAAgB,cACd,oBAAoB,OAAO,YAAY,EAC7C;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN;EACD,CACF;AAGD,iBAAgB;AACd,mBAAiB,UAAU;IAC1B,CAAC,QAAQ,CAAC;AAGb,iBAAgB;AACd,MAAI,CAAC,SAAS;AACZ,WAAQ,GAAG;AACX,sBAAmB,UAAU;GAC7B,MAAMA,cAAY,iBAAiB;AACnC,OAAIA,YACF,cAAaA,YAAU;AAEzB;;EAGF,MAAM,iBAAiB,iBAAiB;AAGxC,MAAI,mBAAmB,mBAAmB,WAAW,KACnD;EAIF,MAAM,YAAY,iBAAiB;AACnC,MAAI,UACF,cAAa,UAAU;AAIzB,mBAAiB,UAAU,WAAW,YAAY;GAChD,MAAM,kBAAkB,iBAAiB;AAGzC,OAAI,oBAAoB,eACtB;AAGF,OAAI;IACF,MAAM,kBAAkB,MAAM,aAAa;AAC3C,QAAI,CAAC,gBAAiB;AAKtB,QAFgB,MAAM,gBAAgB,MAAM,gBAAgB,EAE/C;AAEX,qBAAgB,WAAW,cAAc;KACzC,MAAM,EAAE,QAAQ,MAAM,gBAAgB,OAAO,IAAI,gBAAgB;AAGjE,SAAI,iBAAiB,YAAY,iBAAiB;AAChD,cAAQ,IAAI;AACZ,yBAAmB,UAAU;;;YAG1B,QAAQ;AAGf,QAAI,oBAAoB,iBAAiB,QACvC,SAAQ,MAAM,iBAAiB,OAAO;;KAGzC,IAAI;AAEP,eAAa;GACX,MAAMA,cAAY,iBAAiB;AACnC,OAAIA,YACF,cAAaA,YAAU;;IAG1B;EAAC;EAAS;EAAS;EAAI;EAAe;EAAK,CAAC;AAE/C,QAAO"}
1
+ {"version":3,"file":"useStreamMermaid.mjs","names":["timeoutId"],"sources":["../../src/hooks/useStreamMermaid.ts"],"sourcesContent":["'use client';\n\nimport { useTheme } from 'antd-style';\nimport type { MermaidConfig } from 'mermaid';\nimport { useEffect, useMemo, useRef, useState } from 'react';\n\nimport { createMermaidConfig, loadMermaid } from './useMermaid';\n\n/**\n * 流式 Mermaid 渲染 - 支持内容逐步更新\n */\nexport const useStreamMermaid = (\n content: string,\n {\n enabled = true,\n id,\n theme: customTheme,\n }: {\n enabled?: boolean;\n id: string;\n theme?: MermaidConfig['theme'];\n },\n): string => {\n const theme = useTheme();\n const [data, setData] = useState<string>('');\n const previousContentRef = useRef<string>('');\n const latestContentRef = useRef(content);\n const renderTimeoutRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n\n // 提取主题相关配置到 useMemo 中\n const mermaidConfig = useMemo(\n () => createMermaidConfig(theme, customTheme),\n [\n theme.fontFamilyCode,\n theme.isDarkMode,\n theme.colorTextDescription,\n theme.fontFamily,\n theme.colorTextSecondary,\n theme.colorBgContainer,\n theme.colorInfoBg,\n theme.colorInfoText,\n theme.geekblue,\n theme.colorWarning,\n theme.colorSuccess,\n theme.colorError,\n theme.colorBorder,\n theme.colorInfoBorder,\n theme.colorSuccessBorder,\n theme.colorSuccessBg,\n theme.colorSuccessText,\n theme.colorText,\n customTheme,\n ],\n );\n\n // Update latest content ref\n useEffect(() => {\n latestContentRef.current = content;\n }, [content]);\n\n // Debounced rendering for streaming content\n useEffect(() => {\n if (!enabled) {\n setData('');\n previousContentRef.current = '';\n const timeoutId = renderTimeoutRef.current;\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n return;\n }\n\n const currentContent = latestContentRef.current;\n\n // Skip if content hasn't changed\n if (currentContent === previousContentRef.current && data) {\n return;\n }\n\n // Clear previous timeout\n const timeoutId = renderTimeoutRef.current;\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n\n // Debounce rendering for streaming content (wait 300ms after last change)\n renderTimeoutRef.current = setTimeout(async () => {\n const contentToRender = latestContentRef.current;\n\n // Skip if content changed during debounce\n if (contentToRender !== currentContent) {\n return;\n }\n\n try {\n const mermaidInstance = await loadMermaid();\n if (!mermaidInstance) return;\n\n // 验证语法\n const isValid = await mermaidInstance.parse(contentToRender);\n\n if (isValid) {\n // 初始化并渲染\n mermaidInstance.initialize(mermaidConfig);\n const { svg } = await mermaidInstance.render(id, contentToRender);\n\n // Only update if content hasn't changed during rendering\n if (latestContentRef.current === contentToRender) {\n setData(svg);\n previousContentRef.current = contentToRender;\n }\n }\n } catch (error_) {\n // Silently handle errors during streaming\n // Only log if this is the final content\n if (contentToRender === latestContentRef.current) {\n console.error('Mermaid 解析错误:', error_);\n }\n }\n }, 300);\n\n return () => {\n const timeoutId = renderTimeoutRef.current;\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n };\n }, [enabled, content, id, mermaidConfig, data]);\n\n return data;\n};\n"],"mappings":";;;;;;;;;;AAWA,MAAa,oBACX,SACA,EACE,UAAU,MACV,IACA,OAAO,kBAME;CACX,MAAM,QAAQ,UAAU;CACxB,MAAM,CAAC,MAAM,WAAW,SAAiB,GAAG;CAC5C,MAAM,qBAAqB,OAAe,GAAG;CAC7C,MAAM,mBAAmB,OAAO,QAAQ;CACxC,MAAM,mBAAmB,OAAkD,OAAU;CAGrF,MAAM,gBAAgB,cACd,oBAAoB,OAAO,YAAY,EAC7C;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN;EACD,CACF;AAGD,iBAAgB;AACd,mBAAiB,UAAU;IAC1B,CAAC,QAAQ,CAAC;AAGb,iBAAgB;AACd,MAAI,CAAC,SAAS;AACZ,WAAQ,GAAG;AACX,sBAAmB,UAAU;GAC7B,MAAMA,cAAY,iBAAiB;AACnC,OAAIA,YACF,cAAaA,YAAU;AAEzB;;EAGF,MAAM,iBAAiB,iBAAiB;AAGxC,MAAI,mBAAmB,mBAAmB,WAAW,KACnD;EAIF,MAAM,YAAY,iBAAiB;AACnC,MAAI,UACF,cAAa,UAAU;AAIzB,mBAAiB,UAAU,WAAW,YAAY;GAChD,MAAM,kBAAkB,iBAAiB;AAGzC,OAAI,oBAAoB,eACtB;AAGF,OAAI;IACF,MAAM,kBAAkB,MAAM,aAAa;AAC3C,QAAI,CAAC,gBAAiB;AAKtB,QAFgB,MAAM,gBAAgB,MAAM,gBAAgB,EAE/C;AAEX,qBAAgB,WAAW,cAAc;KACzC,MAAM,EAAE,QAAQ,MAAM,gBAAgB,OAAO,IAAI,gBAAgB;AAGjE,SAAI,iBAAiB,YAAY,iBAAiB;AAChD,cAAQ,IAAI;AACZ,yBAAmB,UAAU;;;YAG1B,QAAQ;AAGf,QAAI,oBAAoB,iBAAiB,QACvC,SAAQ,MAAM,iBAAiB,OAAO;;KAGzC,IAAI;AAEP,eAAa;GACX,MAAMA,cAAY,iBAAiB;AACnC,OAAIA,YACF,cAAaA,YAAU;;IAG1B;EAAC;EAAS;EAAS;EAAI;EAAe;EAAK,CAAC;AAE/C,QAAO"}
@@ -1,7 +1,7 @@
1
1
  import { MotionComponentType } from "../MotionProvider/index.mjs";
2
2
  import { I18nContextValue, TranslationKey, TranslationResources, TranslationResourcesInput } from "./types.mjs";
3
3
  import "../ConfigProvider/index.mjs";
4
- import * as react61 from "react";
4
+ import * as react71 from "react";
5
5
  import { ReactNode } from "react";
6
6
 
7
7
  //#region src/i18n/context.d.ts
@@ -11,7 +11,7 @@ interface I18nProviderProps {
11
11
  motion: MotionComponentType;
12
12
  resources?: TranslationResourcesInput;
13
13
  }
14
- declare const I18nProvider: react61.NamedExoticComponent<I18nProviderProps>;
14
+ declare const I18nProvider: react71.NamedExoticComponent<I18nProviderProps>;
15
15
  //#endregion
16
16
  export { I18nProvider, I18nProviderProps };
17
17
  //# sourceMappingURL=context.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react82 from "react";
1
+ import * as react90 from "react";
2
2
  import * as lucide_react0 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/BotPromptIcon.d.ts
5
- declare const BotPromptIcon: react82.ForwardRefExoticComponent<Omit<lucide_react0.LucideProps, "ref"> & react82.RefAttributes<SVGSVGElement>>;
5
+ declare const BotPromptIcon: react90.ForwardRefExoticComponent<Omit<lucide_react0.LucideProps, "ref"> & react90.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { BotPromptIcon };
8
8
  //# sourceMappingURL=BotPromptIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react80 from "react";
2
- import * as lucide_react0 from "lucide-react";
1
+ import * as react92 from "react";
2
+ import * as lucide_react1 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/CreateBotIcon.d.ts
5
- declare const CreateBotIcon: react80.ForwardRefExoticComponent<Omit<lucide_react0.LucideProps, "ref"> & react80.RefAttributes<SVGSVGElement>>;
5
+ declare const CreateBotIcon: react92.ForwardRefExoticComponent<Omit<lucide_react1.LucideProps, "ref"> & react92.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { CreateBotIcon };
8
8
  //# sourceMappingURL=CreateBotIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react86 from "react";
1
+ import * as react94 from "react";
2
2
  import * as lucide_react2 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/DiscordIcon.d.ts
5
- declare const DiscordIcon: react86.ForwardRefExoticComponent<Omit<lucide_react2.LucideProps, "ref"> & react86.RefAttributes<SVGSVGElement>>;
5
+ declare const DiscordIcon: react94.ForwardRefExoticComponent<Omit<lucide_react2.LucideProps, "ref"> & react94.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { DiscordIcon };
8
8
  //# sourceMappingURL=DiscordIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react84 from "react";
2
- import * as lucide_react1 from "lucide-react";
1
+ import * as react96 from "react";
2
+ import * as lucide_react3 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/GlobeOffIcon.d.ts
5
- declare const GlobeOffIcon: react84.ForwardRefExoticComponent<Omit<lucide_react1.LucideProps, "ref"> & react84.RefAttributes<SVGSVGElement>>;
5
+ declare const GlobeOffIcon: react96.ForwardRefExoticComponent<Omit<lucide_react3.LucideProps, "ref"> & react96.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { GlobeOffIcon };
8
8
  //# sourceMappingURL=GlobeOffIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react88 from "react";
2
- import * as lucide_react3 from "lucide-react";
1
+ import * as react98 from "react";
2
+ import * as lucide_react4 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/GroupBotIcon.d.ts
5
- declare const GroupBotIcon: react88.ForwardRefExoticComponent<Omit<lucide_react3.LucideProps, "ref"> & react88.RefAttributes<SVGSVGElement>>;
5
+ declare const GroupBotIcon: react98.ForwardRefExoticComponent<Omit<lucide_react4.LucideProps, "ref"> & react98.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { GroupBotIcon };
8
8
  //# sourceMappingURL=GroupBotIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react90 from "react";
2
- import * as lucide_react4 from "lucide-react";
1
+ import * as react100 from "react";
2
+ import * as lucide_react5 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/GroupBotSquareIcon.d.ts
5
- declare const GroupBotSquareIcon: react90.ForwardRefExoticComponent<Omit<lucide_react4.LucideProps, "ref"> & react90.RefAttributes<SVGSVGElement>>;
5
+ declare const GroupBotSquareIcon: react100.ForwardRefExoticComponent<Omit<lucide_react5.LucideProps, "ref"> & react100.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { GroupBotSquareIcon };
8
8
  //# sourceMappingURL=GroupBotSquareIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react92 from "react";
2
- import * as lucide_react5 from "lucide-react";
1
+ import * as react102 from "react";
2
+ import * as lucide_react6 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/LeftClickIcon.d.ts
5
- declare const LeftClickIcon: react92.ForwardRefExoticComponent<Omit<lucide_react5.LucideProps, "ref"> & react92.RefAttributes<SVGSVGElement>>;
5
+ declare const LeftClickIcon: react102.ForwardRefExoticComponent<Omit<lucide_react6.LucideProps, "ref"> & react102.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { LeftClickIcon };
8
8
  //# sourceMappingURL=LeftClickIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react94 from "react";
2
- import * as lucide_react6 from "lucide-react";
1
+ import * as react104 from "react";
2
+ import * as lucide_react7 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/LeftDoubleClickIcon.d.ts
5
- declare const LeftDoubleClickIcon: react94.ForwardRefExoticComponent<Omit<lucide_react6.LucideProps, "ref"> & react94.RefAttributes<SVGSVGElement>>;
5
+ declare const LeftDoubleClickIcon: react104.ForwardRefExoticComponent<Omit<lucide_react7.LucideProps, "ref"> & react104.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { LeftDoubleClickIcon };
8
8
  //# sourceMappingURL=LeftDoubleClickIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react98 from "react";
1
+ import * as react106 from "react";
2
2
  import * as lucide_react8 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/McpIcon.d.ts
5
- declare const McpIcon: react98.ForwardRefExoticComponent<Omit<lucide_react8.LucideProps, "ref"> & react98.RefAttributes<SVGSVGElement>>;
5
+ declare const McpIcon: react106.ForwardRefExoticComponent<Omit<lucide_react8.LucideProps, "ref"> & react106.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { McpIcon };
8
8
  //# sourceMappingURL=McpIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react96 from "react";
2
- import * as lucide_react7 from "lucide-react";
1
+ import * as react108 from "react";
2
+ import * as lucide_react9 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/ProviderIcon.d.ts
5
- declare const ProviderIcon: react96.ForwardRefExoticComponent<Omit<lucide_react7.LucideProps, "ref"> & react96.RefAttributes<SVGSVGElement>>;
5
+ declare const ProviderIcon: react108.ForwardRefExoticComponent<Omit<lucide_react9.LucideProps, "ref"> & react108.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { ProviderIcon };
8
8
  //# sourceMappingURL=ProviderIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react100 from "react";
2
- import * as lucide_react9 from "lucide-react";
1
+ import * as react110 from "react";
2
+ import * as lucide_react10 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/RightClickIcon.d.ts
5
- declare const RightClickIcon: react100.ForwardRefExoticComponent<Omit<lucide_react9.LucideProps, "ref"> & react100.RefAttributes<SVGSVGElement>>;
5
+ declare const RightClickIcon: react110.ForwardRefExoticComponent<Omit<lucide_react10.LucideProps, "ref"> & react110.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { RightClickIcon };
8
8
  //# sourceMappingURL=RightClickIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react102 from "react";
2
- import * as lucide_react10 from "lucide-react";
1
+ import * as react112 from "react";
2
+ import * as lucide_react11 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/RightDoubleClickIcon.d.ts
5
- declare const RightDoubleClickIcon: react102.ForwardRefExoticComponent<Omit<lucide_react10.LucideProps, "ref"> & react102.RefAttributes<SVGSVGElement>>;
5
+ declare const RightDoubleClickIcon: react112.ForwardRefExoticComponent<Omit<lucide_react11.LucideProps, "ref"> & react112.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { RightDoubleClickIcon };
8
8
  //# sourceMappingURL=RightDoubleClickIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react104 from "react";
2
- import * as lucide_react11 from "lucide-react";
1
+ import * as react114 from "react";
2
+ import * as lucide_react12 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/ShapesUploadIcon.d.ts
5
- declare const ShapesUploadIcon: react104.ForwardRefExoticComponent<Omit<lucide_react11.LucideProps, "ref"> & react104.RefAttributes<SVGSVGElement>>;
5
+ declare const ShapesUploadIcon: react114.ForwardRefExoticComponent<Omit<lucide_react12.LucideProps, "ref"> & react114.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { ShapesUploadIcon };
8
8
  //# sourceMappingURL=ShapesUploadIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react106 from "react";
2
- import * as lucide_react12 from "lucide-react";
1
+ import * as react116 from "react";
2
+ import * as lucide_react13 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/TreeDownRightIcon.d.ts
5
- declare const TreeDownRightIcon: react106.ForwardRefExoticComponent<Omit<lucide_react12.LucideProps, "ref"> & react106.RefAttributes<SVGSVGElement>>;
5
+ declare const TreeDownRightIcon: react116.ForwardRefExoticComponent<Omit<lucide_react13.LucideProps, "ref"> & react116.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { TreeDownRightIcon };
8
8
  //# sourceMappingURL=TreeDownRightIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react108 from "react";
2
- import * as lucide_react13 from "lucide-react";
1
+ import * as react88 from "react";
2
+ import * as lucide_react0 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/TreeUpDownRightIcon.d.ts
5
- declare const TreeUpDownRightIcon: react108.ForwardRefExoticComponent<Omit<lucide_react13.LucideProps, "ref"> & react108.RefAttributes<SVGSVGElement>>;
5
+ declare const TreeUpDownRightIcon: react88.ForwardRefExoticComponent<Omit<lucide_react0.LucideProps, "ref"> & react88.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { TreeUpDownRightIcon };
8
8
  //# sourceMappingURL=TreeUpDownRightIcon.d.mts.map
package/es/index.d.mts CHANGED
@@ -35,7 +35,9 @@ import { BaseMenuItemType } from "./Menu/baseItem.mjs";
35
35
  import { Menu } from "./Menu/Menu.mjs";
36
36
  import "./Menu/index.mjs";
37
37
  import { DropdownItem, DropdownMenuCheckboxItem, DropdownMenuPlacement, DropdownMenuProps } from "./DropdownMenu/type.mjs";
38
+ import { DROPDOWN_MENU_CONTAINER_ATTR, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuGroupLabelProps, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemContentProps, DropdownMenuItemExtra, DropdownMenuItemExtraProps, DropdownMenuItemIcon, DropdownMenuItemIconProps, DropdownMenuItemLabel, DropdownMenuItemLabelProps, DropdownMenuItemProps, DropdownMenuPopup, DropdownMenuPopupProps, DropdownMenuPortal, DropdownMenuPortalProps, DropdownMenuPositioner, DropdownMenuPositionerProps, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSeparatorProps, DropdownMenuSubmenuArrow, DropdownMenuSubmenuArrowProps, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSubmenuTriggerProps, DropdownMenuTrigger, DropdownMenuTriggerProps } from "./DropdownMenu/atoms.mjs";
38
39
  import { DropdownMenu } from "./DropdownMenu/DropdownMenu.mjs";
40
+ import { renderDropdownMenuItems } from "./DropdownMenu/renderItems.mjs";
39
41
  import "./DropdownMenu/index.mjs";
40
42
  import { ActionIconGroupEvent, ActionIconGroupProps } from "./ActionIconGroup/type.mjs";
41
43
  import { ActionIconGroup } from "./ActionIconGroup/ActionIconGroup.mjs";
@@ -61,6 +63,10 @@ import "./Text/index.mjs";
61
63
  import { CheckboxGroupOption, CheckboxGroupProps, CheckboxProps } from "./Checkbox/type.mjs";
62
64
  import { CheckboxGroup } from "./Checkbox/CheckboxGroup.mjs";
63
65
  import Checkbox from "./Checkbox/index.mjs";
66
+ import { CodeDiffProps, DiffViewMode, PatchDiffProps } from "./CodeDiff/type.mjs";
67
+ import { CodeDiff } from "./CodeDiff/CodeDiff.mjs";
68
+ import { PatchDiff } from "./CodeDiff/PatchDiff.mjs";
69
+ import "./CodeDiff/index.mjs";
64
70
  import { CodeEditorProps } from "./CodeEditor/type.mjs";
65
71
  import { CodeEditor } from "./CodeEditor/CodeEditor.mjs";
66
72
  import "./CodeEditor/index.mjs";
@@ -109,10 +115,13 @@ import "./Input/index.mjs";
109
115
  import { EditableTextProps } from "./EditableText/type.mjs";
110
116
  import { EditableText } from "./EditableText/EditableText.mjs";
111
117
  import "./EditableText/index.mjs";
112
- import { PopoverContextValue, PopoverProvider, usePopoverContext } from "./Popover/context.mjs";
118
+ import { PopoverArrowIcon } from "./Popover/ArrowIcon.mjs";
113
119
  import { PopoverPlacement, PopoverProps, PopoverTrigger } from "./Popover/type.mjs";
120
+ import { PopoverArrow, PopoverArrowAtomProps, PopoverBackdrop, PopoverPopup, PopoverPopupAtomProps, PopoverPortal, PopoverPortalAtomProps, PopoverPositioner, PopoverPositionerAtomProps, PopoverRoot, PopoverTriggerElement, PopoverTriggerElementProps, PopoverViewport, PopoverViewportAtomProps } from "./Popover/atoms.mjs";
121
+ import { PopoverContextValue, PopoverProvider, usePopoverContext } from "./Popover/context.mjs";
114
122
  import { Popover } from "./Popover/Popover.mjs";
115
123
  import { PopoverGroup } from "./Popover/PopoverGroup.mjs";
124
+ import { POPOVER_CONTAINER_ATTR, usePopoverPortalContainer } from "./Popover/PopoverPortal.mjs";
116
125
  import "./Popover/index.mjs";
117
126
  import { EmojiPickerProps } from "./EmojiPicker/type.mjs";
118
127
  import { EmojiPicker } from "./EmojiPicker/EmojiPicker.mjs";
@@ -274,4 +283,4 @@ import { LayoutSidebarInner } from "./Layout/components/LayoutSidebarInner.mjs";
274
283
  import { LayoutToc } from "./Layout/components/LayoutToc.mjs";
275
284
  import Layout from "./Layout/index.mjs";
276
285
  import { ErrorBoundary, ErrorBoundaryProps } from "react-error-boundary";
277
- export { A, AProps, Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, ActionIcon, ActionIconGroup, type ActionIconGroupEvent, type MenuItemType as ActionIconGroupItemType, type ActionIconGroupProps, type ActionIconProps, type ActionIconSize, Alert, type AlertProps, AutoComplete, type AutoCompleteProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type BaseMenuItemType, Block, type BlockProps, Burger, type BurgerProps, Button, type ButtonProps, type CDN, CLASSNAMES, Center, type CenterProps, Checkbox, CheckboxGroup, type CheckboxGroupOption, type CheckboxGroupProps, type CheckboxProps, CodeEditor, type CodeEditorProps, Collapse, type CollapseItemType, type CollapseProps, ColorPalettes, ColorPalettesAlpha, ColorSwatches, type ColorSwatchesProps, ColorToken, type Config, ConfigProvider, type ContextMenuCheckboxItem, ContextMenuHost, type ContextMenuItem, ContextMenuTrigger, CopyButton, type CopyButtonProps, DatePicker, type DatePickerProps, DivProps, DownloadButton, type DownloadButtonProps, DraggablePanel, DraggablePanelBody, type DraggablePanelBodyProps, DraggablePanelContainer, type DraggablePanelContainerProps, DraggablePanelFooter, type DraggablePanelFooterProps, DraggablePanelHeader, type DraggablePanelHeaderProps, type DraggablePanelProps, DraggableSideNav, type DraggableSideNavProps, Drawer, type DrawerProps, Dropdown, type DropdownItem, DropdownMenu, type DropdownMenuCheckboxItem, type MenuItemType as DropdownMenuItemType, type DropdownMenuPlacement, type DropdownMenuProps, type DropdownProps, EditableText, type EditableTextProps, EmojiPicker, type EmojiPickerProps, Empty, type EmptyProps, ErrorBoundary, type ErrorBoundaryProps, FileTypeIcon, type FileTypeIconProps, _default as FlexBasic, type FlexBasicProps, _default as Flexbox, type FlexboxProps, FluentEmoji, type FluentEmojiProps, FontLoader, type FontLoaderProps, Footer, type FooterProps, Form, FormGroup, type FormGroupItemType, type FormGroupProps, type FormInstance, FormItem, type FormItemProps, FormModal, type FormModalProps, type FormProps, FormSubmitFooter, type FormSubmitFooterProps, FormTitle, type FormTitleProps, type GenericItemType, Grid, type GridProps, GroupAvatar, type GroupAvatarProps, GuideCard, type GuideCardProps, Header, type HeaderProps, Highlighter, type HighlighterProps, Hotkey, HotkeyInput, type HotkeyInputProps, type HotkeyProps, I18nProvider, type I18nProviderProps, Icon, type IconProps, IconProvider, type IconSize, Image, type ImageProps, ImageSelect, type ImageSelectItem, type ImageSelectProps, ImgProps, type ImperativeModalProps, Input, InputNumber, type InputNumberProps, InputOPT, type InputOPTProps, InputPassword, type InputPasswordProps, type InputProps, type ItemType, KeyMapEnum, LOBE_THEME_APP_ID, Layout, LayoutFooter, type LayoutFooterProps, LayoutHeader, type LayoutHeaderProps, LayoutMain, type LayoutMainProps, type LayoutProps, LayoutSidebar, LayoutSidebarInner, type LayoutSidebarInnerProps, type LayoutSidebarProps, LayoutToc, type LayoutTocProps, List, ListItem, type ListItemProps, type ListProps, LobeCustomStylish, LobeCustomToken, I18nProvider as LobeUIProvider, Markdown, type MarkdownProps, MaskShadow, type MaskShadowProps, MaterialFileTypeIcon, type MaterialFileTypeIconProps, Menu, type MenuCheckboxItemType, type MenuInfo, type MenuItemType, type MenuProps, Mermaid, type MermaidProps, Meta, type MetaProps, Modal, ModalHost, type ModalHostProps, type ModalInstance, type ModalProps, ModalProvider, MotionComponent, type MotionComponentType, MotionProvider, NeutralColors, NeutralColorsObj, type Placement, type PlacementConfig, Popover, type PopoverContextValue, PopoverGroup, type PopoverPlacement, type PopoverProps, PopoverProvider, type PopoverTrigger, PresetColorKey, PresetColorType, PresetSystemColorKey, PresetSystemColorType, PreviewGroup, type PreviewGroupProps, PrimaryColors, PrimaryColorsObj, type RawModalComponent, type RawModalComponentProps, type RawModalInstance, type RawModalKeyOptions, type RawModalOptions, ScrollShadow, type ScrollShadowProps, SearchBar, type SearchBarProps, SearchResultCards, type SearchResultCardsProps, Segmented, type SegmentedProps, Input$1 as Select, type SelectProps, _default$1 as ShikiLobeTheme, SideNav, type SideNavProps, Skeleton, SkeletonAvatar, type SkeletonAvatarProps, SkeletonBlock, type SkeletonBlockProps, SkeletonButton, type SkeletonButtonProps, SkeletonParagraph, type SkeletonParagraphProps, type SkeletonProps, SkeletonTags, type SkeletonTagsProps, SkeletonTitle, type SkeletonTitleProps, SliderWithInput, type SliderWithInputProps, Snippet, type SnippetProps, SortableList, type SortableListProps, SpanProps, SvgProps, SyntaxHighlighter, type SyntaxHighlighterProps, SyntaxMermaid, type SyntaxMermaidProps, SystemColorToken, Tabs, type TabsProps, Tag, type TagProps, Text, TextArea, type TextAreaProps, type TextProps, ThemeProvider, type ThemeProviderProps, ThemeSwitch, type ThemeSwitchProps, Toc, type TocProps, Tooltip, TooltipGroup, type TooltipProps, Typography, type TypographyProps, Video, type VideoProps, combineKeys, copyToClipboard, createModal, createRawModal, findCustomThemeName, genCdnUrl, generateColorNeutralPalette, generateColorPalette, highlighterThemes, generateCustomStylish as lobeCustomStylish, generateCustomToken as lobeCustomToken, staticStylish as lobeStaticStylish, mermaidThemes, neutralColors, neutralColorsSwatches, placementMap, preprocessMarkdownContent, preventDefault, preventDefaultAndStopPropagation, primaryColors, primaryColorsSwatches, rehypeCustomFootnotes, rehypeKatexDir, rehypeStreamAnimated, remarkBr, remarkColor, remarkCustomFootnotes, remarkGfmPlus, remarkVideo, showContextMenu, stopPropagation, toFloatingUIPlacement, updateContextMenuItems, useCdnFn, useModalContext, useMotionComponent, usePopoverContext, useTranslation };
286
+ export { A, AProps, Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, ActionIcon, ActionIconGroup, type ActionIconGroupEvent, type MenuItemType as ActionIconGroupItemType, type ActionIconGroupProps, type ActionIconProps, type ActionIconSize, Alert, type AlertProps, AutoComplete, type AutoCompleteProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type BaseMenuItemType, Block, type BlockProps, Burger, type BurgerProps, Button, type ButtonProps, type CDN, CLASSNAMES, Center, type CenterProps, Checkbox, CheckboxGroup, type CheckboxGroupOption, type CheckboxGroupProps, type CheckboxProps, CodeDiff, type CodeDiffProps, CodeEditor, type CodeEditorProps, Collapse, type CollapseItemType, type CollapseProps, ColorPalettes, ColorPalettesAlpha, ColorSwatches, type ColorSwatchesProps, ColorToken, type Config, ConfigProvider, type ContextMenuCheckboxItem, ContextMenuHost, type ContextMenuItem, ContextMenuTrigger, CopyButton, type CopyButtonProps, DROPDOWN_MENU_CONTAINER_ATTR, DatePicker, type DatePickerProps, type DiffViewMode, DivProps, DownloadButton, type DownloadButtonProps, DraggablePanel, DraggablePanelBody, type DraggablePanelBodyProps, DraggablePanelContainer, type DraggablePanelContainerProps, DraggablePanelFooter, type DraggablePanelFooterProps, DraggablePanelHeader, type DraggablePanelHeaderProps, type DraggablePanelProps, DraggableSideNav, type DraggableSideNavProps, Drawer, type DrawerProps, Dropdown, type DropdownItem, DropdownMenu, type DropdownMenuCheckboxItem, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuGroup, DropdownMenuGroupLabel, type DropdownMenuGroupLabelProps, DropdownMenuItem, DropdownMenuItemContent, type DropdownMenuItemContentProps, DropdownMenuItemExtra, type DropdownMenuItemExtraProps, DropdownMenuItemIcon, type DropdownMenuItemIconProps, DropdownMenuItemLabel, type DropdownMenuItemLabelProps, type DropdownMenuItemProps, type MenuItemType as DropdownMenuItemType, type DropdownMenuPlacement, DropdownMenuPopup, type DropdownMenuPopupProps, DropdownMenuPortal, type DropdownMenuPortalProps, DropdownMenuPositioner, type DropdownMenuPositionerProps, type DropdownMenuProps, DropdownMenuRoot, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuSubmenuArrow, type DropdownMenuSubmenuArrowProps, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, type DropdownMenuSubmenuTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps, type DropdownProps, EditableText, type EditableTextProps, EmojiPicker, type EmojiPickerProps, Empty, type EmptyProps, ErrorBoundary, type ErrorBoundaryProps, FileTypeIcon, type FileTypeIconProps, _default as FlexBasic, type FlexBasicProps, _default as Flexbox, type FlexboxProps, FluentEmoji, type FluentEmojiProps, FontLoader, type FontLoaderProps, Footer, type FooterProps, Form, FormGroup, type FormGroupItemType, type FormGroupProps, type FormInstance, FormItem, type FormItemProps, FormModal, type FormModalProps, type FormProps, FormSubmitFooter, type FormSubmitFooterProps, FormTitle, type FormTitleProps, type GenericItemType, Grid, type GridProps, GroupAvatar, type GroupAvatarProps, GuideCard, type GuideCardProps, Header, type HeaderProps, Highlighter, type HighlighterProps, Hotkey, HotkeyInput, type HotkeyInputProps, type HotkeyProps, I18nProvider, type I18nProviderProps, Icon, type IconProps, IconProvider, type IconSize, Image, type ImageProps, ImageSelect, type ImageSelectItem, type ImageSelectProps, ImgProps, type ImperativeModalProps, Input, InputNumber, type InputNumberProps, InputOPT, type InputOPTProps, InputPassword, type InputPasswordProps, type InputProps, type ItemType, KeyMapEnum, LOBE_THEME_APP_ID, Layout, LayoutFooter, type LayoutFooterProps, LayoutHeader, type LayoutHeaderProps, LayoutMain, type LayoutMainProps, type LayoutProps, LayoutSidebar, LayoutSidebarInner, type LayoutSidebarInnerProps, type LayoutSidebarProps, LayoutToc, type LayoutTocProps, List, ListItem, type ListItemProps, type ListProps, LobeCustomStylish, LobeCustomToken, I18nProvider as LobeUIProvider, Markdown, type MarkdownProps, MaskShadow, type MaskShadowProps, MaterialFileTypeIcon, type MaterialFileTypeIconProps, Menu, type MenuCheckboxItemType, type MenuInfo, type MenuItemType, type MenuProps, Mermaid, type MermaidProps, Meta, type MetaProps, Modal, ModalHost, type ModalHostProps, type ModalInstance, type ModalProps, ModalProvider, MotionComponent, type MotionComponentType, MotionProvider, NeutralColors, NeutralColorsObj, POPOVER_CONTAINER_ATTR, PatchDiff, type PatchDiffProps, type Placement, type PlacementConfig, Popover, PopoverArrow, type PopoverArrowAtomProps, PopoverArrowIcon, PopoverBackdrop, type PopoverContextValue, PopoverGroup, type PopoverPlacement, PopoverPopup, type PopoverPopupAtomProps, PopoverPortal, type PopoverPortalAtomProps, PopoverPositioner, type PopoverPositionerAtomProps, type PopoverProps, PopoverProvider, PopoverRoot, type PopoverTrigger, PopoverTriggerElement, type PopoverTriggerElementProps, PopoverViewport, type PopoverViewportAtomProps, PresetColorKey, PresetColorType, PresetSystemColorKey, PresetSystemColorType, PreviewGroup, type PreviewGroupProps, PrimaryColors, PrimaryColorsObj, type RawModalComponent, type RawModalComponentProps, type RawModalInstance, type RawModalKeyOptions, type RawModalOptions, ScrollShadow, type ScrollShadowProps, SearchBar, type SearchBarProps, SearchResultCards, type SearchResultCardsProps, Segmented, type SegmentedProps, Input$1 as Select, type SelectProps, _default$1 as ShikiLobeTheme, SideNav, type SideNavProps, Skeleton, SkeletonAvatar, type SkeletonAvatarProps, SkeletonBlock, type SkeletonBlockProps, SkeletonButton, type SkeletonButtonProps, SkeletonParagraph, type SkeletonParagraphProps, type SkeletonProps, SkeletonTags, type SkeletonTagsProps, SkeletonTitle, type SkeletonTitleProps, SliderWithInput, type SliderWithInputProps, Snippet, type SnippetProps, SortableList, type SortableListProps, SpanProps, SvgProps, SyntaxHighlighter, type SyntaxHighlighterProps, SyntaxMermaid, type SyntaxMermaidProps, SystemColorToken, Tabs, type TabsProps, Tag, type TagProps, Text, TextArea, type TextAreaProps, type TextProps, ThemeProvider, type ThemeProviderProps, ThemeSwitch, type ThemeSwitchProps, Toc, type TocProps, Tooltip, TooltipGroup, type TooltipProps, Typography, type TypographyProps, Video, type VideoProps, combineKeys, copyToClipboard, createModal, createRawModal, findCustomThemeName, genCdnUrl, generateColorNeutralPalette, generateColorPalette, highlighterThemes, generateCustomStylish as lobeCustomStylish, generateCustomToken as lobeCustomToken, staticStylish as lobeStaticStylish, mermaidThemes, neutralColors, neutralColorsSwatches, placementMap, preprocessMarkdownContent, preventDefault, preventDefaultAndStopPropagation, primaryColors, primaryColorsSwatches, rehypeCustomFootnotes, rehypeKatexDir, rehypeStreamAnimated, remarkBr, remarkColor, remarkCustomFootnotes, remarkGfmPlus, remarkVideo, renderDropdownMenuItems, showContextMenu, stopPropagation, toFloatingUIPlacement, updateContextMenuItems, useCdnFn, useModalContext, useMotionComponent, usePopoverContext, usePopoverPortalContainer, useTranslation };