@lobehub/ui 4.30.0 → 4.30.2

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 (164) hide show
  1. package/es/Accordion/Accordion.d.mts +2 -2
  2. package/es/Accordion/Accordion.mjs +2 -2
  3. package/es/Accordion/Accordion.mjs.map +1 -1
  4. package/es/Accordion/AccordionItem.d.mts +2 -2
  5. package/es/Accordion/AccordionItem.mjs +2 -2
  6. package/es/Accordion/AccordionItem.mjs.map +1 -1
  7. package/es/ActionIcon/ActionIcon.d.mts +2 -2
  8. package/es/Alert/Alert.d.mts +2 -2
  9. package/es/AutoComplete/Select.d.mts +2 -2
  10. package/es/Avatar/AvatarGroup/index.d.mts +2 -2
  11. package/es/Burger/Burger.d.mts +2 -2
  12. package/es/Checkbox/Checkbox.mjs +2 -2
  13. package/es/Checkbox/Checkbox.mjs.map +1 -1
  14. package/es/Checkbox/CheckboxGroup.mjs +2 -2
  15. package/es/Checkbox/CheckboxGroup.mjs.map +1 -1
  16. package/es/CodeDiff/CodeDiff.d.mts +2 -2
  17. package/es/CodeDiff/PatchDiff.d.mts +2 -2
  18. package/es/CodeEditor/CodeEditor.d.mts +2 -2
  19. package/es/CodeEditor/CodeEditor.mjs +2 -2
  20. package/es/CodeEditor/CodeEditor.mjs.map +1 -1
  21. package/es/Collapse/Collapse.d.mts +2 -2
  22. package/es/ColorSwatches/ColorSwatches.mjs +2 -2
  23. package/es/ColorSwatches/ColorSwatches.mjs.map +1 -1
  24. package/es/ConfigProvider/index.d.mts +2 -2
  25. package/es/ContextMenu/ContextMenuHost.d.mts +2 -2
  26. package/es/CopyButton/CopyButton.d.mts +2 -2
  27. package/es/DatePicker/DatePicker.d.mts +2 -2
  28. package/es/DraggablePanel/DraggablePanel.mjs +2 -2
  29. package/es/DraggablePanel/DraggablePanel.mjs.map +1 -1
  30. package/es/DraggablePanel/components/DraggablePanelBody.d.mts +2 -2
  31. package/es/DraggablePanel/components/DraggablePanelContainer.d.mts +2 -2
  32. package/es/DraggablePanel/components/DraggablePanelFooter.d.mts +2 -2
  33. package/es/DraggablePanel/components/DraggablePanelHeader.d.mts +2 -2
  34. package/es/DraggablePanel/components/DraggablePanelHeader.mjs +2 -2
  35. package/es/DraggablePanel/components/DraggablePanelHeader.mjs.map +1 -1
  36. package/es/DraggableSideNav/DraggableSideNav.d.mts +2 -2
  37. package/es/DraggableSideNav/DraggableSideNav.mjs +2 -2
  38. package/es/DraggableSideNav/DraggableSideNav.mjs.map +1 -1
  39. package/es/Drawer/Drawer.d.mts +2 -2
  40. package/es/Dropdown/Dropdown.d.mts +2 -2
  41. package/es/DropdownMenu/DropdownMenu.d.mts +2 -2
  42. package/es/EditableText/EditableText.d.mts +2 -2
  43. package/es/EditableText/EditableText.mjs +2 -2
  44. package/es/EditableText/EditableText.mjs.map +1 -1
  45. package/es/EditorSlashMenu/atoms.d.mts +12 -12
  46. package/es/EmojiPicker/EmojiPicker.d.mts +2 -2
  47. package/es/EmojiPicker/EmojiPicker.mjs +3 -3
  48. package/es/EmojiPicker/EmojiPicker.mjs.map +1 -1
  49. package/es/Flex/FlexBasic.d.mts +2 -2
  50. package/es/FontLoader/index.d.mts +2 -2
  51. package/es/Footer/Footer.d.mts +2 -2
  52. package/es/Form/components/FormGroup.d.mts +2 -2
  53. package/es/Form/components/FormItem.d.mts +2 -2
  54. package/es/Form/components/FormSubmitFooter.d.mts +2 -2
  55. package/es/FormModal/FormModal.d.mts +2 -2
  56. package/es/GuideCard/GuideCard.d.mts +2 -2
  57. package/es/Header/Header.d.mts +2 -2
  58. package/es/Highlighter/Highlighter.d.mts +2 -2
  59. package/es/Highlighter/SyntaxHighlighter/index.d.mts +2 -2
  60. package/es/Hotkey/Hotkey.d.mts +2 -2
  61. package/es/HotkeyInput/HotkeyInput.d.mts +2 -2
  62. package/es/HotkeyInput/HotkeyInput.mjs +2 -2
  63. package/es/HotkeyInput/HotkeyInput.mjs.map +1 -1
  64. package/es/Icon/Icon.d.mts +2 -2
  65. package/es/Icon/components/IconProvider.d.mts +3 -3
  66. package/es/Image/PreviewGroup.d.mts +2 -2
  67. package/es/ImageSelect/ImageSelect.d.mts +2 -2
  68. package/es/ImageSelect/ImageSelect.mjs +2 -2
  69. package/es/ImageSelect/ImageSelect.mjs.map +1 -1
  70. package/es/Input/Input.d.mts +2 -2
  71. package/es/Input/InputNumber.d.mts +2 -2
  72. package/es/Input/InputOPT.d.mts +2 -2
  73. package/es/Input/InputPassword.d.mts +2 -2
  74. package/es/Input/TextArea.d.mts +2 -2
  75. package/es/Layout/components/LayoutFooter.d.mts +2 -2
  76. package/es/Layout/components/LayoutHeader.d.mts +2 -2
  77. package/es/Layout/components/LayoutMain.d.mts +2 -2
  78. package/es/Layout/components/LayoutSidebar.d.mts +2 -2
  79. package/es/Layout/components/LayoutSidebarInner.d.mts +2 -2
  80. package/es/Layout/components/LayoutToc.d.mts +2 -2
  81. package/es/List/ListItem/index.d.mts +2 -2
  82. package/es/LobeSelect/LobeSelect.d.mts +2 -2
  83. package/es/LobeSelect/LobeSelect.mjs +7 -3
  84. package/es/LobeSelect/LobeSelect.mjs.map +1 -1
  85. package/es/LobeSelect/atoms.d.mts +19 -19
  86. package/es/LobeSelect/type.d.mts +5 -0
  87. package/es/LobeSwitch/LobeSwitch.d.mts +2 -2
  88. package/es/LobeSwitch/atoms.d.mts +4 -4
  89. package/es/LobeSwitch/atoms.mjs +2 -2
  90. package/es/LobeSwitch/atoms.mjs.map +1 -1
  91. package/es/Markdown/Markdown.d.mts +2 -2
  92. package/es/Markdown/Typography.d.mts +2 -2
  93. package/es/Markdown/components/SearchResultCards/index.d.mts +2 -2
  94. package/es/MaskShadow/MaskShadow.d.mts +2 -2
  95. package/es/Menu/Menu.d.mts +2 -2
  96. package/es/Mermaid/Mermaid.d.mts +2 -2
  97. package/es/Mermaid/SyntaxMermaid/index.d.mts +2 -2
  98. package/es/Modal/Modal.d.mts +2 -2
  99. package/es/Modal/ModalProvider.d.mts +2 -2
  100. package/es/Modal/imperative.d.mts +2 -2
  101. package/es/MotionProvider/index.d.mts +2 -2
  102. package/es/Popover/ArrowIcon.d.mts +2 -2
  103. package/es/Popover/atoms.d.mts +9 -9
  104. package/es/Popover/context.d.mts +2 -2
  105. package/es/SearchBar/SearchBar.d.mts +2 -2
  106. package/es/SearchBar/SearchBar.mjs +2 -2
  107. package/es/SearchBar/SearchBar.mjs.map +1 -1
  108. package/es/Segmented/Segmented.d.mts +2 -2
  109. package/es/Select/Select.d.mts +2 -2
  110. package/es/SideNav/SideNav.d.mts +2 -2
  111. package/es/SliderWithInput/SliderWithInput.d.mts +2 -2
  112. package/es/SortableList/components/DragHandle.d.mts +2 -2
  113. package/es/SortableList/components/SortableItem.d.mts +2 -2
  114. package/es/ThemeProvider/ThemeProvider.d.mts +2 -2
  115. package/es/Toast/imperative.d.mts +3 -3
  116. package/es/Toc/Toc.d.mts +2 -2
  117. package/es/Toc/TocMobile.mjs +2 -2
  118. package/es/Toc/TocMobile.mjs.map +1 -1
  119. package/es/Video/index.d.mts +2 -2
  120. package/es/awesome/AuroraBackground/AuroraBackground.d.mts +2 -2
  121. package/es/awesome/BottomGradientButton/BottomGradientButton.d.mts +2 -2
  122. package/es/awesome/Features/Features.d.mts +2 -2
  123. package/es/awesome/Giscus/Giscus.d.mts +2 -2
  124. package/es/awesome/GradientButton/GradientButton.d.mts +2 -2
  125. package/es/awesome/GridBackground/GridBackground.d.mts +2 -2
  126. package/es/awesome/GridBackground/GridShowcase.d.mts +2 -2
  127. package/es/awesome/Hero/Hero.d.mts +2 -2
  128. package/es/awesome/Spline/Spine.d.mts +2 -2
  129. package/es/awesome/Spotlight/Spotlight.d.mts +2 -2
  130. package/es/awesome/SpotlightCard/SpotlightCard.d.mts +2 -2
  131. package/es/awesome/TypewriterEffect/TypewriterEffect.d.mts +2 -2
  132. package/es/brand/LobeChat/index.d.mts +2 -2
  133. package/es/brand/LobeHub/index.d.mts +2 -2
  134. package/es/brand/LogoThree/LogoSpline.d.mts +2 -2
  135. package/es/brand/LogoThree/index.d.mts +2 -2
  136. package/es/chat/BackBottom/BackBottom.d.mts +2 -2
  137. package/es/chat/ChatInputArea/components/ChatInputAreaInner.d.mts +2 -2
  138. package/es/chat/ChatList/ChatList.d.mts +2 -2
  139. package/es/chat/EditableMessage/EditableMessage.d.mts +2 -2
  140. package/es/chat/EditableMessage/EditableMessage.mjs +3 -3
  141. package/es/chat/EditableMessage/EditableMessage.mjs.map +1 -1
  142. package/es/chat/EditableMessageList/EditableMessageList.d.mts +2 -2
  143. package/es/chat/MessageInput/MessageInput.d.mts +2 -2
  144. package/es/chat/MessageModal/MessageModal.d.mts +2 -2
  145. package/es/chat/MessageModal/MessageModal.mjs +3 -3
  146. package/es/chat/MessageModal/MessageModal.mjs.map +1 -1
  147. package/es/color/ColorScales/index.d.mts +2 -2
  148. package/es/color/CssVar/index.d.mts +2 -2
  149. package/es/i18n/context.d.mts +2 -2
  150. package/es/icons/lucideExtra/GroupBotSquareIcon.d.mts +3 -3
  151. package/es/icons/lucideExtra/LeftClickIcon.d.mts +3 -3
  152. package/es/icons/lucideExtra/LeftDoubleClickIcon.d.mts +3 -3
  153. package/es/icons/lucideExtra/McpIcon.d.mts +3 -3
  154. package/es/icons/lucideExtra/ProviderIcon.d.mts +3 -3
  155. package/es/icons/lucideExtra/RightClickIcon.d.mts +3 -3
  156. package/es/icons/lucideExtra/TreeUpDownRightIcon.d.mts +3 -3
  157. package/es/mdx/Mdx/index.d.mts +2 -2
  158. package/es/mobile/ChatHeader/ChatHeaderTitle.d.mts +2 -2
  159. package/es/mobile/ChatInputArea/components/ChatSendButton.d.mts +2 -2
  160. package/es/mobile/TabBar/TabBar.d.mts +2 -2
  161. package/es/mobile/TabBar/TabBar.mjs +2 -2
  162. package/es/mobile/TabBar/TabBar.mjs.map +1 -1
  163. package/es/storybook/StoryBook/index.d.mts +2 -2
  164. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"EditableMessage.mjs","names":["useControlledState","MessageInput","text","Markdown","MessageModal"],"sources":["../../../src/chat/EditableMessage/EditableMessage.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { memo } from 'react';\nimport useControlledState from 'use-merge-value';\n\nimport Markdown from '@/Markdown';\nimport MessageInput from '@/chat/MessageInput';\nimport MessageModal from '@/chat/MessageModal';\n\nimport type { EditableMessageProps } from './type';\n\nconst EditableMessage = memo<EditableMessageProps>(\n ({\n value,\n onChange,\n classNames = {},\n onEditingChange,\n editing,\n openModal,\n onOpenChange,\n placeholder,\n showEditWhenEmpty = false,\n styles: customStyles,\n className,\n style,\n height,\n variant,\n editButtonSize,\n text,\n fullFeaturedCodeBlock,\n model,\n fontSize,\n language = 'markdown',\n markdownProps,\n }) => {\n const [isEdit, setTyping] = useControlledState(false, {\n onChange: onEditingChange,\n value: editing,\n });\n\n const [expand, setExpand] = useControlledState<boolean>(false, {\n onChange: onOpenChange,\n value: openModal,\n });\n\n const isAutoSize = height === 'auto';\n\n const input = (\n <MessageInput\n className={cx(className, classNames?.input)}\n classNames={classNames}\n defaultValue={value}\n editButtonSize={editButtonSize}\n height={height}\n language={language}\n onCancel={() => setTyping(false)}\n onConfirm={(text) => {\n onChange?.(text);\n setTyping(false);\n }}\n placeholder={placeholder}\n shortcut\n style={{\n ...style,\n ...customStyles?.input,\n }}\n styles={customStyles}\n text={text}\n variant={variant}\n />\n );\n\n if (!value && showEditWhenEmpty) return input;\n\n return (\n <>\n {!expand && isEdit ? (\n input\n ) : (\n <Markdown\n className={cx(className, classNames?.markdown)}\n fontSize={fontSize}\n fullFeaturedCodeBlock={fullFeaturedCodeBlock}\n style={{\n height: isAutoSize ? 'unset' : height,\n ...style,\n ...customStyles?.markdown,\n }}\n variant={'chat'}\n {...markdownProps}\n >\n {value || placeholder || ''}\n </Markdown>\n )}\n {expand && (\n <MessageModal\n editing={isEdit}\n extra={model?.extra}\n footer={model?.footer}\n height={height}\n language={language}\n onChange={onChange}\n onEditingChange={setTyping}\n onOpenChange={(e) => {\n setExpand(e);\n setTyping(false);\n }}\n open={expand}\n placeholder={placeholder}\n text={text}\n value={value}\n />\n )}\n </>\n );\n },\n);\n\nEditableMessage.displayName = 'EditableMessage';\n\nexport default EditableMessage;\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,kBAAkB,MACrB,EACC,OACA,UACA,aAAa,EAAE,EACf,iBACA,SACA,WACA,cACA,aACA,oBAAoB,OACpB,QAAQ,cACR,WACA,OACA,QACA,SACA,gBACA,MACA,uBACA,OACA,UACA,WAAW,YACX,oBACI;CACJ,MAAM,CAAC,QAAQ,aAAaA,cAAmB,OAAO;EACpD,UAAU;EACV,OAAO;EACR,CAAC;CAEF,MAAM,CAAC,QAAQ,aAAaA,cAA4B,OAAO;EAC7D,UAAU;EACV,OAAO;EACR,CAAC;CAEF,MAAM,aAAa,WAAW;CAE9B,MAAM,QACJ,oBAACC;EACC,WAAW,GAAG,WAAW,YAAY,MAAM;EAC/B;EACZ,cAAc;EACE;EACR;EACE;EACV,gBAAgB,UAAU,MAAM;EAChC,YAAY,WAAS;AACnB,cAAWC,OAAK;AAChB,aAAU,MAAM;;EAEL;EACb;EACA,OAAO;GACL,GAAG;GACH,GAAG,cAAc;GAClB;EACD,QAAQ;EACF;EACG;GACT;AAGJ,KAAI,CAAC,SAAS,kBAAmB,QAAO;AAExC,QACE,8CACG,CAAC,UAAU,SACV,QAEA,oBAACC;EACC,WAAW,GAAG,WAAW,YAAY,SAAS;EACpC;EACa;EACvB,OAAO;GACL,QAAQ,aAAa,UAAU;GAC/B,GAAG;GACH,GAAG,cAAc;GAClB;EACD,SAAS;EACT,GAAI;YAEH,SAAS,eAAe;GAChB,EAEZ,UACC,oBAACC;EACC,SAAS;EACT,OAAO,OAAO;EACd,QAAQ,OAAO;EACP;EACE;EACA;EACV,iBAAiB;EACjB,eAAe,MAAM;AACnB,aAAU,EAAE;AACZ,aAAU,MAAM;;EAElB,MAAM;EACO;EACP;EACC;GACP,IAEH;EAGR;AAED,gBAAgB,cAAc;AAE9B,8BAAe"}
1
+ {"version":3,"file":"EditableMessage.mjs","names":["MessageInput","text","Markdown","MessageModal"],"sources":["../../../src/chat/EditableMessage/EditableMessage.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { memo } from 'react';\nimport useControlledState from 'use-merge-value';\n\nimport Markdown from '@/Markdown';\nimport MessageInput from '@/chat/MessageInput';\nimport MessageModal from '@/chat/MessageModal';\n\nimport type { EditableMessageProps } from './type';\n\nconst EditableMessage = memo<EditableMessageProps>(\n ({\n value,\n onChange,\n classNames = {},\n onEditingChange,\n editing,\n openModal,\n onOpenChange,\n placeholder,\n showEditWhenEmpty = false,\n styles: customStyles,\n className,\n style,\n height,\n variant,\n editButtonSize,\n text,\n fullFeaturedCodeBlock,\n model,\n fontSize,\n language = 'markdown',\n markdownProps,\n }) => {\n const [isEdit, setTyping] = useControlledState(false, {\n onChange: onEditingChange,\n value: editing,\n });\n\n const [expand, setExpand] = useControlledState<boolean>(false, {\n onChange: onOpenChange,\n value: openModal,\n });\n\n const isAutoSize = height === 'auto';\n\n const input = (\n <MessageInput\n className={cx(className, classNames?.input)}\n classNames={classNames}\n defaultValue={value}\n editButtonSize={editButtonSize}\n height={height}\n language={language}\n onCancel={() => setTyping(false)}\n onConfirm={(text) => {\n onChange?.(text);\n setTyping(false);\n }}\n placeholder={placeholder}\n shortcut\n style={{\n ...style,\n ...customStyles?.input,\n }}\n styles={customStyles}\n text={text}\n variant={variant}\n />\n );\n\n if (!value && showEditWhenEmpty) return input;\n\n return (\n <>\n {!expand && isEdit ? (\n input\n ) : (\n <Markdown\n className={cx(className, classNames?.markdown)}\n fontSize={fontSize}\n fullFeaturedCodeBlock={fullFeaturedCodeBlock}\n style={{\n height: isAutoSize ? 'unset' : height,\n ...style,\n ...customStyles?.markdown,\n }}\n variant={'chat'}\n {...markdownProps}\n >\n {value || placeholder || ''}\n </Markdown>\n )}\n {expand && (\n <MessageModal\n editing={isEdit}\n extra={model?.extra}\n footer={model?.footer}\n height={height}\n language={language}\n onChange={onChange}\n onEditingChange={setTyping}\n onOpenChange={(e) => {\n setExpand(e);\n setTyping(false);\n }}\n open={expand}\n placeholder={placeholder}\n text={text}\n value={value}\n />\n )}\n </>\n );\n },\n);\n\nEditableMessage.displayName = 'EditableMessage';\n\nexport default EditableMessage;\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,kBAAkB,MACrB,EACC,OACA,UACA,aAAa,EAAE,EACf,iBACA,SACA,WACA,cACA,aACA,oBAAoB,OACpB,QAAQ,cACR,WACA,OACA,QACA,SACA,gBACA,MACA,uBACA,OACA,UACA,WAAW,YACX,oBACI;CACJ,MAAM,CAAC,QAAQ,aAAa,mBAAmB,OAAO;EACpD,UAAU;EACV,OAAO;EACR,CAAC;CAEF,MAAM,CAAC,QAAQ,aAAa,mBAA4B,OAAO;EAC7D,UAAU;EACV,OAAO;EACR,CAAC;CAEF,MAAM,aAAa,WAAW;CAE9B,MAAM,QACJ,oBAACA;EACC,WAAW,GAAG,WAAW,YAAY,MAAM;EAC/B;EACZ,cAAc;EACE;EACR;EACE;EACV,gBAAgB,UAAU,MAAM;EAChC,YAAY,WAAS;AACnB,cAAWC,OAAK;AAChB,aAAU,MAAM;;EAEL;EACb;EACA,OAAO;GACL,GAAG;GACH,GAAG,cAAc;GAClB;EACD,QAAQ;EACF;EACG;GACT;AAGJ,KAAI,CAAC,SAAS,kBAAmB,QAAO;AAExC,QACE,8CACG,CAAC,UAAU,SACV,QAEA,oBAACC;EACC,WAAW,GAAG,WAAW,YAAY,SAAS;EACpC;EACa;EACvB,OAAO;GACL,QAAQ,aAAa,UAAU;GAC/B,GAAG;GACH,GAAG,cAAc;GAClB;EACD,SAAS;EACT,GAAI;YAEH,SAAS,eAAe;GAChB,EAEZ,UACC,oBAACC;EACC,SAAS;EACT,OAAO,OAAO;EACd,QAAQ,OAAO;EACP;EACE;EACA;EACV,iBAAiB;EACjB,eAAe,MAAM;AACnB,aAAU,EAAE;AACZ,aAAU,MAAM;;EAElB,MAAM;EACO;EACP;EACC;GACP,IAEH;EAGR;AAED,gBAAgB,cAAc;AAE9B,8BAAe"}
@@ -1,8 +1,8 @@
1
1
  import { EditableMessageListProps } from "./type.mjs";
2
- import * as react138 from "react";
2
+ import * as react132 from "react";
3
3
 
4
4
  //#region src/chat/EditableMessageList/EditableMessageList.d.ts
5
- declare const EditableMessageList: react138.NamedExoticComponent<EditableMessageListProps>;
5
+ declare const EditableMessageList: react132.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 react141 from "react";
2
+ import * as react133 from "react";
3
3
 
4
4
  //#region src/chat/MessageInput/MessageInput.d.ts
5
- declare const MessageInput: react141.NamedExoticComponent<MessageInputProps>;
5
+ declare const MessageInput: react133.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 react142 from "react";
2
+ import * as react134 from "react";
3
3
 
4
4
  //#region src/chat/MessageModal/MessageModal.d.ts
5
- declare const MessageModal: react142.NamedExoticComponent<MessageModalProps>;
5
+ declare const MessageModal: react134.NamedExoticComponent<MessageModalProps>;
6
6
  //#endregion
7
7
  export { MessageModal };
8
8
  //# sourceMappingURL=MessageModal.d.mts.map
@@ -12,17 +12,17 @@ import messageModal_default from "../../i18n/resources/en/messageModal.mjs";
12
12
  import { memo, useState } from "react";
13
13
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
14
14
  import { useResponsive } from "antd-style";
15
- import useMergeState from "use-merge-value";
15
+ import useControlledState from "use-merge-value";
16
16
 
17
17
  //#region src/chat/MessageModal/MessageModal.tsx
18
18
  const MessageModal = memo(({ panelRef, editing, open, height = "75vh", onOpenChange, onEditingChange, placeholder, value, language = "markdown", onChange, text, footer, extra }) => {
19
19
  const { mobile } = useResponsive();
20
20
  const { t } = useTranslation(messageModal_default);
21
- const [isEdit, setTyping] = useMergeState(false, {
21
+ const [isEdit, setTyping] = useControlledState(false, {
22
22
  onChange: onEditingChange,
23
23
  value: editing
24
24
  });
25
- const [showModal, setShowModal] = useMergeState(false, {
25
+ const [showModal, setShowModal] = useControlledState(false, {
26
26
  onChange: onOpenChange,
27
27
  value: open
28
28
  });
@@ -1 +1 @@
1
- {"version":3,"file":"MessageModal.mjs","names":["messageModalMessages","useControlledState","Modal","Flexbox","Button","TextArea","textStyles","value","CodeEditor","Markdown"],"sources":["../../../src/chat/MessageModal/MessageModal.tsx"],"sourcesContent":["'use client';\n\nimport { useResponsive } from 'antd-style';\nimport { memo, useState } from 'react';\nimport useControlledState from 'use-merge-value';\n\nimport Button from '@/Button';\nimport CodeEditor from '@/CodeEditor';\nimport { Flexbox } from '@/Flex';\nimport TextArea from '@/Input/TextArea';\nimport Markdown from '@/Markdown';\nimport Modal from '@/Modal';\nimport { styles as textStyles } from '@/chat/MessageInput/style';\nimport messageModalMessages from '@/i18n/resources/en/messageModal';\nimport { useTranslation } from '@/i18n/useTranslation';\n\nimport type { MessageModalProps } from './type';\n\nconst MessageModal = memo<MessageModalProps>(\n ({\n panelRef,\n editing,\n open,\n height = '75vh',\n onOpenChange,\n onEditingChange,\n placeholder,\n value,\n language = 'markdown',\n onChange,\n text,\n footer,\n extra,\n }) => {\n const { mobile } = useResponsive();\n const { t } = useTranslation(messageModalMessages);\n const [isEdit, setTyping] = useControlledState(false, {\n onChange: onEditingChange,\n value: editing,\n });\n\n const [showModal, setShowModal] = useControlledState(false, {\n onChange: onOpenChange,\n value: open,\n });\n\n const [temporaryValue, setMessage] = useState(value);\n\n const confirmText = text?.confirm ?? t('messageModal.confirm');\n const cancelText = text?.cancel ?? t('messageModal.cancel');\n const editText = text?.edit ?? t('messageModal.edit');\n\n const modalFooter = isEdit ? (\n <Flexbox direction={'horizontal-reverse'} gap={8}>\n <Button\n onClick={() => {\n setTyping(false);\n onChange?.(temporaryValue);\n setMessage(value);\n }}\n type=\"primary\"\n >\n {confirmText}\n </Button>\n <Button\n onClick={() => {\n setTyping(false);\n setMessage(value);\n }}\n >\n {cancelText}\n </Button>\n </Flexbox>\n ) : (\n footer\n );\n\n return (\n <Modal\n allowFullscreen\n cancelText={cancelText}\n destroyOnHidden\n footer={modalFooter}\n height={height}\n okText={editText}\n onCancel={() => {\n setShowModal(false);\n setTyping(false);\n setMessage(value);\n }}\n onOk={() => setTyping(true)}\n open={showModal}\n panelRef={panelRef}\n title={text?.title}\n >\n {isEdit ? (\n mobile ? (\n <TextArea\n autoSize\n className={textStyles}\n defaultValue={temporaryValue}\n onBlur={(e) => setMessage(e.target.value)}\n onChange={(value) => setMessage(value.target.value)}\n placeholder={placeholder}\n value={temporaryValue}\n variant={'borderless'}\n />\n ) : (\n <CodeEditor\n className={textStyles}\n defaultValue={temporaryValue}\n language={language}\n onBlur={(e) => setMessage(e.target.value)}\n onValueChange={(value) => setMessage(value)}\n placeholder={placeholder}\n value={temporaryValue}\n variant={'borderless'}\n />\n )\n ) : (\n <>\n {extra}\n <Markdown variant={'chat'}>{String(value || placeholder)}</Markdown>\n </>\n )}\n </Modal>\n );\n },\n);\n\nMessageModal.displayName = 'MessageModal';\n\nexport default MessageModal;\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,MAAM,eAAe,MAClB,EACC,UACA,SACA,MACA,SAAS,QACT,cACA,iBACA,aACA,OACA,WAAW,YACX,UACA,MACA,QACA,YACI;CACJ,MAAM,EAAE,WAAW,eAAe;CAClC,MAAM,EAAE,MAAM,eAAeA,qBAAqB;CAClD,MAAM,CAAC,QAAQ,aAAaC,cAAmB,OAAO;EACpD,UAAU;EACV,OAAO;EACR,CAAC;CAEF,MAAM,CAAC,WAAW,gBAAgBA,cAAmB,OAAO;EAC1D,UAAU;EACV,OAAO;EACR,CAAC;CAEF,MAAM,CAAC,gBAAgB,cAAc,SAAS,MAAM;CAEpD,MAAM,cAAc,MAAM,WAAW,EAAE,uBAAuB;CAC9D,MAAM,aAAa,MAAM,UAAU,EAAE,sBAAsB;CAC3D,MAAM,WAAW,MAAM,QAAQ,EAAE,oBAAoB;AA2BrD,QACE,oBAACC;EACC;EACY;EACZ;EACA,QA9BgB,SAClB,qBAACC;GAAQ,WAAW;GAAsB,KAAK;cAC7C,oBAACC;IACC,eAAe;AACb,eAAU,MAAM;AAChB,gBAAW,eAAe;AAC1B,gBAAW,MAAM;;IAEnB,MAAK;cAEJ;KACM,EACT,oBAACA;IACC,eAAe;AACb,eAAU,MAAM;AAChB,gBAAW,MAAM;;cAGlB;KACM;IACD,GAEV;EASU;EACR,QAAQ;EACR,gBAAgB;AACd,gBAAa,MAAM;AACnB,aAAU,MAAM;AAChB,cAAW,MAAM;;EAEnB,YAAY,UAAU,KAAK;EAC3B,MAAM;EACI;EACV,OAAO,MAAM;YAEZ,SACC,SACE,oBAACC;GACC;GACA,WAAWC;GACX,cAAc;GACd,SAAS,MAAM,WAAW,EAAE,OAAO,MAAM;GACzC,WAAW,YAAU,WAAWC,QAAM,OAAO,MAAM;GACtC;GACb,OAAO;GACP,SAAS;IACT,GAEF,oBAACC;GACC,WAAWF;GACX,cAAc;GACJ;GACV,SAAS,MAAM,WAAW,EAAE,OAAO,MAAM;GACzC,gBAAgB,YAAU,WAAWC,QAAM;GAC9B;GACb,OAAO;GACP,SAAS;IACT,GAGJ,8CACG,OACD,oBAACE;GAAS,SAAS;aAAS,OAAO,SAAS,YAAY;IAAY,IACnE;GAEC;EAGb;AAED,aAAa,cAAc;AAE3B,2BAAe"}
1
+ {"version":3,"file":"MessageModal.mjs","names":["messageModalMessages","Modal","Flexbox","Button","TextArea","textStyles","value","CodeEditor","Markdown"],"sources":["../../../src/chat/MessageModal/MessageModal.tsx"],"sourcesContent":["'use client';\n\nimport { useResponsive } from 'antd-style';\nimport { memo, useState } from 'react';\nimport useControlledState from 'use-merge-value';\n\nimport Button from '@/Button';\nimport CodeEditor from '@/CodeEditor';\nimport { Flexbox } from '@/Flex';\nimport TextArea from '@/Input/TextArea';\nimport Markdown from '@/Markdown';\nimport Modal from '@/Modal';\nimport { styles as textStyles } from '@/chat/MessageInput/style';\nimport messageModalMessages from '@/i18n/resources/en/messageModal';\nimport { useTranslation } from '@/i18n/useTranslation';\n\nimport type { MessageModalProps } from './type';\n\nconst MessageModal = memo<MessageModalProps>(\n ({\n panelRef,\n editing,\n open,\n height = '75vh',\n onOpenChange,\n onEditingChange,\n placeholder,\n value,\n language = 'markdown',\n onChange,\n text,\n footer,\n extra,\n }) => {\n const { mobile } = useResponsive();\n const { t } = useTranslation(messageModalMessages);\n const [isEdit, setTyping] = useControlledState(false, {\n onChange: onEditingChange,\n value: editing,\n });\n\n const [showModal, setShowModal] = useControlledState(false, {\n onChange: onOpenChange,\n value: open,\n });\n\n const [temporaryValue, setMessage] = useState(value);\n\n const confirmText = text?.confirm ?? t('messageModal.confirm');\n const cancelText = text?.cancel ?? t('messageModal.cancel');\n const editText = text?.edit ?? t('messageModal.edit');\n\n const modalFooter = isEdit ? (\n <Flexbox direction={'horizontal-reverse'} gap={8}>\n <Button\n onClick={() => {\n setTyping(false);\n onChange?.(temporaryValue);\n setMessage(value);\n }}\n type=\"primary\"\n >\n {confirmText}\n </Button>\n <Button\n onClick={() => {\n setTyping(false);\n setMessage(value);\n }}\n >\n {cancelText}\n </Button>\n </Flexbox>\n ) : (\n footer\n );\n\n return (\n <Modal\n allowFullscreen\n cancelText={cancelText}\n destroyOnHidden\n footer={modalFooter}\n height={height}\n okText={editText}\n onCancel={() => {\n setShowModal(false);\n setTyping(false);\n setMessage(value);\n }}\n onOk={() => setTyping(true)}\n open={showModal}\n panelRef={panelRef}\n title={text?.title}\n >\n {isEdit ? (\n mobile ? (\n <TextArea\n autoSize\n className={textStyles}\n defaultValue={temporaryValue}\n onBlur={(e) => setMessage(e.target.value)}\n onChange={(value) => setMessage(value.target.value)}\n placeholder={placeholder}\n value={temporaryValue}\n variant={'borderless'}\n />\n ) : (\n <CodeEditor\n className={textStyles}\n defaultValue={temporaryValue}\n language={language}\n onBlur={(e) => setMessage(e.target.value)}\n onValueChange={(value) => setMessage(value)}\n placeholder={placeholder}\n value={temporaryValue}\n variant={'borderless'}\n />\n )\n ) : (\n <>\n {extra}\n <Markdown variant={'chat'}>{String(value || placeholder)}</Markdown>\n </>\n )}\n </Modal>\n );\n },\n);\n\nMessageModal.displayName = 'MessageModal';\n\nexport default MessageModal;\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,MAAM,eAAe,MAClB,EACC,UACA,SACA,MACA,SAAS,QACT,cACA,iBACA,aACA,OACA,WAAW,YACX,UACA,MACA,QACA,YACI;CACJ,MAAM,EAAE,WAAW,eAAe;CAClC,MAAM,EAAE,MAAM,eAAeA,qBAAqB;CAClD,MAAM,CAAC,QAAQ,aAAa,mBAAmB,OAAO;EACpD,UAAU;EACV,OAAO;EACR,CAAC;CAEF,MAAM,CAAC,WAAW,gBAAgB,mBAAmB,OAAO;EAC1D,UAAU;EACV,OAAO;EACR,CAAC;CAEF,MAAM,CAAC,gBAAgB,cAAc,SAAS,MAAM;CAEpD,MAAM,cAAc,MAAM,WAAW,EAAE,uBAAuB;CAC9D,MAAM,aAAa,MAAM,UAAU,EAAE,sBAAsB;CAC3D,MAAM,WAAW,MAAM,QAAQ,EAAE,oBAAoB;AA2BrD,QACE,oBAACC;EACC;EACY;EACZ;EACA,QA9BgB,SAClB,qBAACC;GAAQ,WAAW;GAAsB,KAAK;cAC7C,oBAACC;IACC,eAAe;AACb,eAAU,MAAM;AAChB,gBAAW,eAAe;AAC1B,gBAAW,MAAM;;IAEnB,MAAK;cAEJ;KACM,EACT,oBAACA;IACC,eAAe;AACb,eAAU,MAAM;AAChB,gBAAW,MAAM;;cAGlB;KACM;IACD,GAEV;EASU;EACR,QAAQ;EACR,gBAAgB;AACd,gBAAa,MAAM;AACnB,aAAU,MAAM;AAChB,cAAW,MAAM;;EAEnB,YAAY,UAAU,KAAK;EAC3B,MAAM;EACI;EACV,OAAO,MAAM;YAEZ,SACC,SACE,oBAACC;GACC;GACA,WAAWC;GACX,cAAc;GACd,SAAS,MAAM,WAAW,EAAE,OAAO,MAAM;GACzC,WAAW,YAAU,WAAWC,QAAM,OAAO,MAAM;GACtC;GACb,OAAO;GACP,SAAS;IACT,GAEF,oBAACC;GACC,WAAWF;GACX,cAAc;GACJ;GACV,SAAS,MAAM,WAAW,EAAE,OAAO,MAAM;GACzC,gBAAgB,YAAU,WAAWC,QAAM;GAC9B;GACb,OAAO;GACP,SAAS;IACT,GAGJ,8CACG,OACD,oBAACE;GAAS,SAAS;aAAS,OAAO,SAAS,YAAY;IAAY,IACnE;GAEC;EAGb;AAED,aAAa,cAAc;AAE3B,2BAAe"}
@@ -1,5 +1,5 @@
1
1
  import { ColorScaleItem } from "../types.mjs";
2
- import * as react11 from "react";
2
+ import * as react29 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: react11.NamedExoticComponent<ColorScalesProps>;
19
+ declare const ColorScales: react29.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 react12 from "react";
2
+ import * as react30 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: react12.NamedExoticComponent<ColorScalesProps>;
19
+ declare const ColorScales: react30.NamedExoticComponent<ColorScalesProps>;
20
20
  //#endregion
21
21
  export { ColorScales };
22
22
  //# sourceMappingURL=index.d.mts.map
@@ -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 react79 from "react";
4
+ import * as react26 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: react79.NamedExoticComponent<I18nProviderProps>;
14
+ declare const I18nProvider: react26.NamedExoticComponent<I18nProviderProps>;
15
15
  //#endregion
16
16
  export { I18nProvider, I18nProviderProps };
17
17
  //# sourceMappingURL=context.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react101 from "react";
2
- import * as lucide_react5 from "lucide-react";
1
+ import * as react95 from "react";
2
+ import * as lucide_react2 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/GroupBotSquareIcon.d.ts
5
- declare const GroupBotSquareIcon: react101.ForwardRefExoticComponent<Omit<lucide_react5.LucideProps, "ref"> & react101.RefAttributes<SVGSVGElement>>;
5
+ declare const GroupBotSquareIcon: react95.ForwardRefExoticComponent<Omit<lucide_react2.LucideProps, "ref"> & react95.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { GroupBotSquareIcon };
8
8
  //# sourceMappingURL=GroupBotSquareIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react105 from "react";
2
- import * as lucide_react7 from "lucide-react";
1
+ import * as react103 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: react105.ForwardRefExoticComponent<Omit<lucide_react7.LucideProps, "ref"> & react105.RefAttributes<SVGSVGElement>>;
5
+ declare const LeftClickIcon: react103.ForwardRefExoticComponent<Omit<lucide_react6.LucideProps, "ref"> & react103.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { LeftClickIcon };
8
8
  //# sourceMappingURL=LeftClickIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react95 from "react";
2
- import * as lucide_react2 from "lucide-react";
1
+ import * as react105 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: react95.ForwardRefExoticComponent<Omit<lucide_react2.LucideProps, "ref"> & react95.RefAttributes<SVGSVGElement>>;
5
+ declare const LeftDoubleClickIcon: react105.ForwardRefExoticComponent<Omit<lucide_react7.LucideProps, "ref"> & react105.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { LeftDoubleClickIcon };
8
8
  //# sourceMappingURL=LeftDoubleClickIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react107 from "react";
2
- import * as lucide_react8 from "lucide-react";
1
+ import * as react101 from "react";
2
+ import * as lucide_react5 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/McpIcon.d.ts
5
- declare const McpIcon: react107.ForwardRefExoticComponent<Omit<lucide_react8.LucideProps, "ref"> & react107.RefAttributes<SVGSVGElement>>;
5
+ declare const McpIcon: react101.ForwardRefExoticComponent<Omit<lucide_react5.LucideProps, "ref"> & react101.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { McpIcon };
8
8
  //# sourceMappingURL=McpIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react117 from "react";
2
- import * as lucide_react13 from "lucide-react";
1
+ import * as react113 from "react";
2
+ import * as lucide_react11 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/ProviderIcon.d.ts
5
- declare const ProviderIcon: react117.ForwardRefExoticComponent<Omit<lucide_react13.LucideProps, "ref"> & react117.RefAttributes<SVGSVGElement>>;
5
+ declare const ProviderIcon: react113.ForwardRefExoticComponent<Omit<lucide_react11.LucideProps, "ref"> & react113.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { ProviderIcon };
8
8
  //# sourceMappingURL=ProviderIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react113 from "react";
2
- import * as lucide_react11 from "lucide-react";
1
+ import * as react117 from "react";
2
+ import * as lucide_react13 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/RightClickIcon.d.ts
5
- declare const RightClickIcon: react113.ForwardRefExoticComponent<Omit<lucide_react11.LucideProps, "ref"> & react113.RefAttributes<SVGSVGElement>>;
5
+ declare const RightClickIcon: react117.ForwardRefExoticComponent<Omit<lucide_react13.LucideProps, "ref"> & react117.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { RightClickIcon };
8
8
  //# sourceMappingURL=RightClickIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react103 from "react";
2
- import * as lucide_react6 from "lucide-react";
1
+ import * as react107 from "react";
2
+ import * as lucide_react8 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/TreeUpDownRightIcon.d.ts
5
- declare const TreeUpDownRightIcon: react103.ForwardRefExoticComponent<Omit<lucide_react6.LucideProps, "ref"> & react103.RefAttributes<SVGSVGElement>>;
5
+ declare const TreeUpDownRightIcon: react107.ForwardRefExoticComponent<Omit<lucide_react8.LucideProps, "ref"> & react107.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { TreeUpDownRightIcon };
8
8
  //# sourceMappingURL=TreeUpDownRightIcon.d.mts.map
@@ -1,6 +1,6 @@
1
1
  import { TypographyProps } from "../../Markdown/type.mjs";
2
2
  import "../../Markdown/index.mjs";
3
- import * as react78 from "react";
3
+ import * as react28 from "react";
4
4
  import { ReactNode } from "react";
5
5
  import { Pluggable } from "unified";
6
6
 
@@ -18,7 +18,7 @@ interface MdxProps extends Omit<TypographyProps, 'children'> {
18
18
  remarkPlugins?: Pluggable[];
19
19
  variant?: 'normal' | 'chat';
20
20
  }
21
- declare const Mdx: react78.NamedExoticComponent<MdxProps>;
21
+ declare const Mdx: react28.NamedExoticComponent<MdxProps>;
22
22
  //#endregion
23
23
  export { Mdx, MdxProps };
24
24
  //# sourceMappingURL=index.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { ChatHeaderTitleProps } from "./type.mjs";
2
- import * as react132 from "react";
2
+ import * as react127 from "react";
3
3
 
4
4
  //#region src/mobile/ChatHeader/ChatHeaderTitle.d.ts
5
- declare const ChatHeaderTitle: react132.NamedExoticComponent<ChatHeaderTitleProps>;
5
+ declare const ChatHeaderTitle: react127.NamedExoticComponent<ChatHeaderTitleProps>;
6
6
  //#endregion
7
7
  export { ChatHeaderTitle };
8
8
  //# sourceMappingURL=ChatHeaderTitle.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { ChatSendButtonProps } from "../type.mjs";
2
- import * as react133 from "react";
2
+ import * as react128 from "react";
3
3
 
4
4
  //#region src/mobile/ChatInputArea/components/ChatSendButton.d.ts
5
- declare const ChatSendButton: react133.NamedExoticComponent<ChatSendButtonProps>;
5
+ declare const ChatSendButton: react128.NamedExoticComponent<ChatSendButtonProps>;
6
6
  //#endregion
7
7
  export { ChatSendButton };
8
8
  //# sourceMappingURL=ChatSendButton.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { TabBarProps } from "./type.mjs";
2
- import * as react134 from "react";
2
+ import * as react126 from "react";
3
3
 
4
4
  //#region src/mobile/TabBar/TabBar.d.ts
5
- declare const TabBar: react134.NamedExoticComponent<TabBarProps>;
5
+ declare const TabBar: react126.NamedExoticComponent<TabBarProps>;
6
6
  //#endregion
7
7
  export { TabBar };
8
8
  //# sourceMappingURL=TabBar.d.mts.map
@@ -6,11 +6,11 @@ import { styles } from "./style.mjs";
6
6
  import { memo } from "react";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  import { cx } from "antd-style";
9
- import useMergeState from "use-merge-value";
9
+ import useControlledState from "use-merge-value";
10
10
 
11
11
  //#region src/mobile/TabBar/TabBar.tsx
12
12
  const TabBar = memo(({ ref, className, safeArea, items, activeKey, defaultActiveKey, onChange, ...rest }) => {
13
- const [currentActive, setCurrentActive] = useMergeState(defaultActiveKey || items[0].key, {
13
+ const [currentActive, setCurrentActive] = useControlledState(defaultActiveKey || items[0].key, {
14
14
  defaultValue: defaultActiveKey,
15
15
  onChange,
16
16
  value: activeKey
@@ -1 +1 @@
1
- {"version":3,"file":"TabBar.mjs","names":["Flexbox","SafeArea"],"sources":["../../../src/mobile/TabBar/TabBar.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { memo } from 'react';\nimport useMergeState from 'use-merge-value';\n\nimport { Flexbox } from '@/Flex';\nimport SafeArea from '@/mobile/SafeArea';\n\nimport { styles } from './style';\nimport type { TabBarProps } from './type';\n\nconst TabBar = memo<TabBarProps>(\n ({ ref, className, safeArea, items, activeKey, defaultActiveKey, onChange, ...rest }) => {\n const [currentActive, setCurrentActive] = useMergeState<string>(\n defaultActiveKey || items[0].key,\n {\n defaultValue: defaultActiveKey,\n onChange,\n value: activeKey,\n },\n );\n\n return (\n <Flexbox as={'footer'} className={cx(styles.container, className)} ref={ref} {...rest}>\n <Flexbox\n align={'center'}\n className={cx(styles.inner, className)}\n horizontal\n justify={'space-around'}\n >\n {items.map((item) => {\n const active = item.key === currentActive;\n return (\n <Flexbox\n align={'center'}\n className={cx(styles.tab, active && styles.active)}\n gap={4}\n justify={'center'}\n key={item.key}\n onClick={() => {\n setCurrentActive(item.key);\n item?.onClick?.();\n }}\n >\n <Flexbox align={'center'} className={styles.icon} justify={'center'}>\n {typeof item.icon === 'function' ? item.icon(active) : item.icon}\n </Flexbox>\n <div className={styles.title}>\n {typeof item.title === 'function' ? item.title(active) : item.title}\n </div>\n </Flexbox>\n );\n })}\n </Flexbox>\n {safeArea && <SafeArea position={'bottom'} />}\n </Flexbox>\n );\n },\n);\n\nTabBar.displayName = 'MobileTabBar';\n\nexport default TabBar;\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,SAAS,MACZ,EAAE,KAAK,WAAW,UAAU,OAAO,WAAW,kBAAkB,UAAU,GAAG,WAAW;CACvF,MAAM,CAAC,eAAe,oBAAoB,cACxC,oBAAoB,MAAM,GAAG,KAC7B;EACE,cAAc;EACd;EACA,OAAO;EACR,CACF;AAED,QACE,qBAACA;EAAQ,IAAI;EAAU,WAAW,GAAG,OAAO,WAAW,UAAU;EAAO;EAAK,GAAI;aAC/E,oBAACA;GACC,OAAO;GACP,WAAW,GAAG,OAAO,OAAO,UAAU;GACtC;GACA,SAAS;aAER,MAAM,KAAK,SAAS;IACnB,MAAM,SAAS,KAAK,QAAQ;AAC5B,WACE,qBAACA;KACC,OAAO;KACP,WAAW,GAAG,OAAO,KAAK,UAAU,OAAO,OAAO;KAClD,KAAK;KACL,SAAS;KAET,eAAe;AACb,uBAAiB,KAAK,IAAI;AAC1B,YAAM,WAAW;;gBAGnB,oBAACA;MAAQ,OAAO;MAAU,WAAW,OAAO;MAAM,SAAS;gBACxD,OAAO,KAAK,SAAS,aAAa,KAAK,KAAK,OAAO,GAAG,KAAK;OACpD,EACV,oBAAC;MAAI,WAAW,OAAO;gBACpB,OAAO,KAAK,UAAU,aAAa,KAAK,MAAM,OAAO,GAAG,KAAK;OAC1D;OAXD,KAAK,IAYF;KAEZ;IACM,EACT,YAAY,oBAACC,oBAAS,UAAU,WAAY;GACrC;EAGf;AAED,OAAO,cAAc;AAErB,qBAAe"}
1
+ {"version":3,"file":"TabBar.mjs","names":["useMergeState","Flexbox","SafeArea"],"sources":["../../../src/mobile/TabBar/TabBar.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { memo } from 'react';\nimport useMergeState from 'use-merge-value';\n\nimport { Flexbox } from '@/Flex';\nimport SafeArea from '@/mobile/SafeArea';\n\nimport { styles } from './style';\nimport type { TabBarProps } from './type';\n\nconst TabBar = memo<TabBarProps>(\n ({ ref, className, safeArea, items, activeKey, defaultActiveKey, onChange, ...rest }) => {\n const [currentActive, setCurrentActive] = useMergeState<string>(\n defaultActiveKey || items[0].key,\n {\n defaultValue: defaultActiveKey,\n onChange,\n value: activeKey,\n },\n );\n\n return (\n <Flexbox as={'footer'} className={cx(styles.container, className)} ref={ref} {...rest}>\n <Flexbox\n align={'center'}\n className={cx(styles.inner, className)}\n horizontal\n justify={'space-around'}\n >\n {items.map((item) => {\n const active = item.key === currentActive;\n return (\n <Flexbox\n align={'center'}\n className={cx(styles.tab, active && styles.active)}\n gap={4}\n justify={'center'}\n key={item.key}\n onClick={() => {\n setCurrentActive(item.key);\n item?.onClick?.();\n }}\n >\n <Flexbox align={'center'} className={styles.icon} justify={'center'}>\n {typeof item.icon === 'function' ? item.icon(active) : item.icon}\n </Flexbox>\n <div className={styles.title}>\n {typeof item.title === 'function' ? item.title(active) : item.title}\n </div>\n </Flexbox>\n );\n })}\n </Flexbox>\n {safeArea && <SafeArea position={'bottom'} />}\n </Flexbox>\n );\n },\n);\n\nTabBar.displayName = 'MobileTabBar';\n\nexport default TabBar;\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,SAAS,MACZ,EAAE,KAAK,WAAW,UAAU,OAAO,WAAW,kBAAkB,UAAU,GAAG,WAAW;CACvF,MAAM,CAAC,eAAe,oBAAoBA,mBACxC,oBAAoB,MAAM,GAAG,KAC7B;EACE,cAAc;EACd;EACA,OAAO;EACR,CACF;AAED,QACE,qBAACC;EAAQ,IAAI;EAAU,WAAW,GAAG,OAAO,WAAW,UAAU;EAAO;EAAK,GAAI;aAC/E,oBAACA;GACC,OAAO;GACP,WAAW,GAAG,OAAO,OAAO,UAAU;GACtC;GACA,SAAS;aAER,MAAM,KAAK,SAAS;IACnB,MAAM,SAAS,KAAK,QAAQ;AAC5B,WACE,qBAACA;KACC,OAAO;KACP,WAAW,GAAG,OAAO,KAAK,UAAU,OAAO,OAAO;KAClD,KAAK;KACL,SAAS;KAET,eAAe;AACb,uBAAiB,KAAK,IAAI;AAC1B,YAAM,WAAW;;gBAGnB,oBAACA;MAAQ,OAAO;MAAU,WAAW,OAAO;MAAM,SAAS;gBACxD,OAAO,KAAK,SAAS,aAAa,KAAK,KAAK,OAAO,GAAG,KAAK;OACpD,EACV,oBAAC;MAAI,WAAW,OAAO;gBACpB,OAAO,KAAK,UAAU,aAAa,KAAK,MAAM,OAAO,GAAG,KAAK;OAC1D;OAXD,KAAK,IAYF;KAEZ;IACM,EACT,YAAY,oBAACC,oBAAS,UAAU,WAAY;GACrC;EAGf;AAED,OAAO,cAAc;AAErB,qBAAe"}
@@ -1,6 +1,6 @@
1
1
  import { FlexboxProps } from "../../Flex/type.mjs";
2
2
  import "../../Flex/index.mjs";
3
- import * as react10 from "react";
3
+ import * as react27 from "react";
4
4
  import { Ref } from "react";
5
5
  import { useControls, useCreateStore } from "leva";
6
6
 
@@ -10,7 +10,7 @@ interface StoryBookProps extends FlexboxProps {
10
10
  noPadding?: boolean;
11
11
  ref?: Ref<HTMLDivElement>;
12
12
  }
13
- declare const StoryBook: react10.NamedExoticComponent<StoryBookProps>;
13
+ declare const StoryBook: react27.NamedExoticComponent<StoryBookProps>;
14
14
  //#endregion
15
15
  export { StoryBook, StoryBookProps, useControls, useCreateStore };
16
16
  //# sourceMappingURL=index.d.mts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "4.30.0",
3
+ "version": "4.30.2",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",