@lobehub/ui 4.35.2 → 4.35.3

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 (151) 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/Alert/type.d.mts +1 -1
  6. package/es/AutoComplete/Select.d.mts +2 -2
  7. package/es/Avatar/Avatar.mjs +1 -1
  8. package/es/Avatar/AvatarGroup/index.d.mts +2 -2
  9. package/es/Burger/Burger.d.mts +2 -2
  10. package/es/CodeDiff/CodeDiff.d.mts +2 -2
  11. package/es/CodeDiff/PatchDiff.d.mts +2 -2
  12. package/es/CodeEditor/CodeEditor.d.mts +2 -2
  13. package/es/Collapse/Collapse.d.mts +2 -2
  14. package/es/ColorSwatches/ColorSwatches.mjs +1 -1
  15. package/es/ConfigProvider/index.d.mts +2 -2
  16. package/es/ContextMenu/ContextMenuHost.d.mts +3 -3
  17. package/es/ContextMenu/ContextMenuHost.mjs +10 -20
  18. package/es/ContextMenu/ContextMenuHost.mjs.map +1 -1
  19. package/es/CopyButton/CopyButton.d.mts +2 -2
  20. package/es/DatePicker/DatePicker.d.mts +2 -2
  21. package/es/DraggablePanel/components/DraggablePanelBody.d.mts +2 -2
  22. package/es/DraggablePanel/components/DraggablePanelContainer.d.mts +2 -2
  23. package/es/DraggablePanel/components/DraggablePanelFooter.d.mts +2 -2
  24. package/es/DraggablePanel/components/DraggablePanelHeader.d.mts +2 -2
  25. package/es/DraggableSideNav/DraggableSideNav.d.mts +2 -2
  26. package/es/Drawer/Drawer.d.mts +2 -2
  27. package/es/Dropdown/Dropdown.d.mts +2 -2
  28. package/es/DropdownMenu/DropdownMenu.d.mts +2 -2
  29. package/es/DropdownMenu/atoms.d.mts +18 -18
  30. package/es/DropdownMenu/atoms.mjs +2 -4
  31. package/es/DropdownMenu/atoms.mjs.map +1 -1
  32. package/es/EditableText/EditableText.d.mts +2 -2
  33. package/es/EditorSlashMenu/atoms.d.mts +14 -20
  34. package/es/EditorSlashMenu/atoms.mjs +1 -8
  35. package/es/EditorSlashMenu/atoms.mjs.map +1 -1
  36. package/es/EmojiPicker/EmojiPicker.d.mts +2 -2
  37. package/es/Flex/FlexBasic.d.mts +2 -2
  38. package/es/FontLoader/index.d.mts +2 -2
  39. package/es/Footer/Footer.d.mts +2 -2
  40. package/es/Form/components/FormGroup.d.mts +2 -2
  41. package/es/Form/components/FormItem.d.mts +2 -2
  42. package/es/Form/components/FormSubmitFooter.d.mts +2 -2
  43. package/es/FormModal/FormModal.d.mts +2 -2
  44. package/es/Freeze/Freeze.d.mts +2 -2
  45. package/es/GuideCard/GuideCard.d.mts +2 -2
  46. package/es/Header/Header.d.mts +2 -2
  47. package/es/Highlighter/Highlighter.d.mts +2 -2
  48. package/es/Highlighter/SyntaxHighlighter/index.d.mts +2 -2
  49. package/es/Hotkey/Hotkey.d.mts +2 -2
  50. package/es/HotkeyInput/HotkeyInput.d.mts +2 -2
  51. package/es/Icon/Icon.d.mts +2 -2
  52. package/es/Icon/components/IconProvider.d.mts +3 -3
  53. package/es/Image/PreviewGroup.d.mts +2 -2
  54. package/es/Input/Input.d.mts +2 -2
  55. package/es/Input/InputNumber.d.mts +2 -2
  56. package/es/Input/InputOPT.d.mts +2 -2
  57. package/es/Input/InputPassword.d.mts +2 -2
  58. package/es/Input/TextArea.d.mts +2 -2
  59. package/es/Layout/components/LayoutFooter.d.mts +2 -2
  60. package/es/Layout/components/LayoutHeader.d.mts +2 -2
  61. package/es/Layout/components/LayoutMain.d.mts +2 -2
  62. package/es/Layout/components/LayoutSidebar.d.mts +2 -2
  63. package/es/Layout/components/LayoutSidebarInner.d.mts +2 -2
  64. package/es/Layout/components/LayoutToc.d.mts +2 -2
  65. package/es/List/ListItem/index.d.mts +2 -2
  66. package/es/LobeSelect/LobeSelect.d.mts +2 -2
  67. package/es/LobeSelect/LobeSelect.mjs +45 -51
  68. package/es/LobeSelect/LobeSelect.mjs.map +1 -1
  69. package/es/LobeSelect/atoms.d.mts +19 -19
  70. package/es/LobeSelect/atoms.mjs +2 -4
  71. package/es/LobeSelect/atoms.mjs.map +1 -1
  72. package/es/LobeSwitch/LobeSwitch.d.mts +2 -2
  73. package/es/LobeSwitch/atoms.d.mts +4 -4
  74. package/es/Markdown/Markdown.d.mts +2 -2
  75. package/es/Markdown/Typography.d.mts +2 -2
  76. package/es/Markdown/components/SearchResultCards/index.d.mts +2 -2
  77. package/es/MaskShadow/MaskShadow.d.mts +2 -2
  78. package/es/Menu/Menu.d.mts +2 -2
  79. package/es/Mermaid/Mermaid.d.mts +2 -2
  80. package/es/Mermaid/SyntaxMermaid/index.d.mts +2 -2
  81. package/es/Modal/Modal.d.mts +2 -2
  82. package/es/Modal/ModalProvider.d.mts +2 -2
  83. package/es/Modal/imperative.d.mts +2 -2
  84. package/es/MotionProvider/index.d.mts +2 -2
  85. package/es/Popover/ArrowIcon.d.mts +2 -2
  86. package/es/Popover/PopoverPortal.mjs +0 -6
  87. package/es/Popover/PopoverPortal.mjs.map +1 -1
  88. package/es/Popover/atoms.d.mts +9 -9
  89. package/es/Popover/context.d.mts +2 -2
  90. package/es/ScrollArea/atoms.d.mts +7 -7
  91. package/es/SearchBar/SearchBar.d.mts +2 -2
  92. package/es/Segmented/Segmented.d.mts +2 -2
  93. package/es/Select/Select.d.mts +2 -2
  94. package/es/SideNav/SideNav.d.mts +2 -2
  95. package/es/SliderWithInput/SliderWithInput.d.mts +2 -2
  96. package/es/ThemeProvider/GlobalStyle/global.mjs +10 -17
  97. package/es/ThemeProvider/GlobalStyle/global.mjs.map +1 -1
  98. package/es/ThemeProvider/ThemeProvider.d.mts +2 -2
  99. package/es/ThemeProvider/ThemeProvider.mjs +34 -2
  100. package/es/ThemeProvider/ThemeProvider.mjs.map +1 -1
  101. package/es/Toast/imperative.d.mts +3 -3
  102. package/es/Toast/imperative.mjs +7 -44
  103. package/es/Toast/imperative.mjs.map +1 -1
  104. package/es/Toc/Toc.d.mts +2 -2
  105. package/es/Tooltip/TooltipPortal.mjs +0 -7
  106. package/es/Tooltip/TooltipPortal.mjs.map +1 -1
  107. package/es/Video/index.d.mts +2 -2
  108. package/es/awesome/AuroraBackground/AuroraBackground.d.mts +2 -2
  109. package/es/awesome/BottomGradientButton/BottomGradientButton.d.mts +2 -2
  110. package/es/awesome/Features/Features.d.mts +2 -2
  111. package/es/awesome/Giscus/Giscus.d.mts +2 -2
  112. package/es/awesome/GradientButton/GradientButton.d.mts +2 -2
  113. package/es/awesome/GridBackground/GridBackground.d.mts +2 -2
  114. package/es/awesome/GridBackground/GridShowcase.d.mts +2 -2
  115. package/es/awesome/Hero/Hero.d.mts +2 -2
  116. package/es/awesome/Spline/Spine.d.mts +2 -2
  117. package/es/awesome/Spotlight/Spotlight.d.mts +2 -2
  118. package/es/awesome/SpotlightCard/SpotlightCard.d.mts +2 -2
  119. package/es/awesome/TypewriterEffect/TypewriterEffect.d.mts +2 -2
  120. package/es/brand/LobeChat/index.d.mts +2 -2
  121. package/es/brand/LobeHub/index.d.mts +2 -2
  122. package/es/brand/LogoThree/LogoSpline.d.mts +2 -2
  123. package/es/brand/LogoThree/index.d.mts +2 -2
  124. package/es/chat/BackBottom/BackBottom.d.mts +2 -2
  125. package/es/chat/ChatInputArea/components/ChatInputAreaInner.d.mts +2 -2
  126. package/es/chat/ChatItem/ChatItem.d.mts +2 -2
  127. package/es/chat/ChatList/ChatList.d.mts +2 -2
  128. package/es/chat/EditableMessage/EditableMessage.d.mts +2 -2
  129. package/es/chat/EditableMessageList/EditableMessageList.d.mts +2 -2
  130. package/es/chat/MessageInput/MessageInput.d.mts +2 -2
  131. package/es/chat/MessageModal/MessageModal.d.mts +2 -2
  132. package/es/color/ColorScales/index.d.mts +2 -2
  133. package/es/color/CssVar/index.d.mts +2 -2
  134. package/es/i18n/context.d.mts +2 -2
  135. package/es/icons/lucideExtra/GroupBotSquareIcon.d.mts +3 -3
  136. package/es/icons/lucideExtra/LeftClickIcon.d.mts +3 -3
  137. package/es/icons/lucideExtra/LeftDoubleClickIcon.d.mts +3 -3
  138. package/es/icons/lucideExtra/McpIcon.d.mts +3 -3
  139. package/es/icons/lucideExtra/ProviderIcon.d.mts +3 -3
  140. package/es/icons/lucideExtra/RightDoubleClickIcon.d.mts +3 -3
  141. package/es/icons/lucideExtra/ShapesUploadIcon.d.mts +3 -3
  142. package/es/icons/lucideExtra/TreeUpDownRightIcon.d.mts +3 -3
  143. package/es/index.mjs +5 -5
  144. package/es/mdx/Mdx/index.d.mts +2 -2
  145. package/es/mobile/ChatHeader/ChatHeaderTitle.d.mts +2 -2
  146. package/es/mobile/ChatInputArea/components/ChatSendButton.d.mts +2 -2
  147. package/es/mobile/TabBar/TabBar.d.mts +2 -2
  148. package/es/storybook/StoryBook/index.d.mts +2 -2
  149. package/package.json +1 -1
  150. package/es/hooks/usePortalContainer.mjs +0 -24
  151. package/es/hooks/usePortalContainer.mjs.map +0 -1
@@ -1,8 +1,8 @@
1
- import * as react100 from "react";
2
- import * as lucide_react5 from "lucide-react";
1
+ import * as react94 from "react";
2
+ import * as lucide_react2 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/LeftDoubleClickIcon.d.ts
5
- declare const LeftDoubleClickIcon: react100.ForwardRefExoticComponent<Omit<lucide_react5.LucideProps, "ref"> & react100.RefAttributes<SVGSVGElement>>;
5
+ declare const LeftDoubleClickIcon: react94.ForwardRefExoticComponent<Omit<lucide_react2.LucideProps, "ref"> & react94.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { LeftDoubleClickIcon };
8
8
  //# sourceMappingURL=LeftDoubleClickIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react104 from "react";
2
- import * as lucide_react7 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/McpIcon.d.ts
5
- declare const McpIcon: react104.ForwardRefExoticComponent<Omit<lucide_react7.LucideProps, "ref"> & react104.RefAttributes<SVGSVGElement>>;
5
+ declare const McpIcon: react110.ForwardRefExoticComponent<Omit<lucide_react10.LucideProps, "ref"> & react110.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { McpIcon };
8
8
  //# sourceMappingURL=McpIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react102 from "react";
2
- import * as lucide_react6 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/ProviderIcon.d.ts
5
- declare const ProviderIcon: react102.ForwardRefExoticComponent<Omit<lucide_react6.LucideProps, "ref"> & react102.RefAttributes<SVGSVGElement>>;
5
+ declare const ProviderIcon: react112.ForwardRefExoticComponent<Omit<lucide_react11.LucideProps, "ref"> & react112.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { ProviderIcon };
8
8
  //# sourceMappingURL=ProviderIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react108 from "react";
2
- import * as lucide_react9 from "lucide-react";
1
+ import * as react106 from "react";
2
+ import * as lucide_react8 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/RightDoubleClickIcon.d.ts
5
- declare const RightDoubleClickIcon: react108.ForwardRefExoticComponent<Omit<lucide_react9.LucideProps, "ref"> & react108.RefAttributes<SVGSVGElement>>;
5
+ declare const RightDoubleClickIcon: react106.ForwardRefExoticComponent<Omit<lucide_react8.LucideProps, "ref"> & react106.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { RightDoubleClickIcon };
8
8
  //# sourceMappingURL=RightDoubleClickIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react112 from "react";
2
- import * as lucide_react11 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/ShapesUploadIcon.d.ts
5
- declare const ShapesUploadIcon: react112.ForwardRefExoticComponent<Omit<lucide_react11.LucideProps, "ref"> & react112.RefAttributes<SVGSVGElement>>;
5
+ declare const ShapesUploadIcon: react108.ForwardRefExoticComponent<Omit<lucide_react9.LucideProps, "ref"> & react108.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_react8 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/TreeUpDownRightIcon.d.ts
5
- declare const TreeUpDownRightIcon: react106.ForwardRefExoticComponent<Omit<lucide_react8.LucideProps, "ref"> & react106.RefAttributes<SVGSVGElement>>;
5
+ declare const TreeUpDownRightIcon: react102.ForwardRefExoticComponent<Omit<lucide_react6.LucideProps, "ref"> & react102.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { TreeUpDownRightIcon };
8
8
  //# sourceMappingURL=TreeUpDownRightIcon.d.mts.map
package/es/index.mjs CHANGED
@@ -17,11 +17,6 @@ import { IconProvider } from "./Icon/components/IconProvider.mjs";
17
17
  import Icon_default from "./Icon/Icon.mjs";
18
18
  import { combineKeys } from "./Hotkey/utils.mjs";
19
19
  import Hotkey_default from "./Hotkey/Hotkey.mjs";
20
- import { LOBE_THEME_APP_ID } from "./ThemeProvider/constants.mjs";
21
- import Meta_default from "./ThemeProvider/Meta.mjs";
22
- import FontLoader_default from "./FontLoader/index.mjs";
23
- import { CLASSNAMES } from "./styles/classNames.mjs";
24
- import ThemeProvider_default from "./ThemeProvider/ThemeProvider.mjs";
25
20
  import Tooltip_default from "./Tooltip/Tooltip.mjs";
26
21
  import TooltipGroup_default from "./Tooltip/TooltipGroup.mjs";
27
22
  import Text_default from "./Text/Text.mjs";
@@ -29,6 +24,7 @@ import { preventDefault, preventDefaultAndStopPropagation, stopPropagation } fro
29
24
  import AccordionItem_default from "./Accordion/AccordionItem.mjs";
30
25
  import ActionIcon_default from "./ActionIcon/ActionIcon.mjs";
31
26
  import { styles as styles$1 } from "./Menu/sharedStyle.mjs";
27
+ import { CLASSNAMES } from "./styles/classNames.mjs";
32
28
  import { DROPDOWN_MENU_CONTAINER_ATTR, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemExtra, DropdownMenuItemIcon, DropdownMenuItemLabel, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSubmenuArrow, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuTrigger } from "./DropdownMenu/atoms.mjs";
33
29
  import Menu_default from "./Menu/Menu.mjs";
34
30
  import { renderDropdownMenuItems } from "./DropdownMenu/renderItems.mjs";
@@ -87,6 +83,7 @@ import Tabs_default from "./Tabs/Tabs.mjs";
87
83
  import Tag_default from "./Tag/Tag.mjs";
88
84
  import EmojiPicker_default from "./EmojiPicker/EmojiPicker.mjs";
89
85
  import Empty_default from "./Empty/Empty.mjs";
86
+ import FontLoader_default from "./FontLoader/index.mjs";
90
87
  import Footer_default from "./Footer/Footer.mjs";
91
88
  import FormGroup_default from "./Form/components/FormGroup.mjs";
92
89
  import FormTitle_default from "./Form/components/FormTitle.mjs";
@@ -156,6 +153,9 @@ import SkeletonTags_default from "./Skeleton/SkeletonTags.mjs";
156
153
  import Skeleton_default from "./Skeleton/index.mjs";
157
154
  import SliderWithInput_default from "./SliderWithInput/SliderWithInput.mjs";
158
155
  import SortableList_default from "./SortableList/SortableList.mjs";
156
+ import { LOBE_THEME_APP_ID } from "./ThemeProvider/constants.mjs";
157
+ import Meta_default from "./ThemeProvider/Meta.mjs";
158
+ import ThemeProvider_default from "./ThemeProvider/ThemeProvider.mjs";
159
159
  import ThemeSwitch_default from "./ThemeSwitch/ThemeSwitch.mjs";
160
160
  import { ToastHost, toast, useToast } from "./Toast/imperative.mjs";
161
161
  import Toc_default from "./Toc/Toc.mjs";
@@ -1,6 +1,6 @@
1
1
  import { TypographyProps } from "../../Markdown/type.mjs";
2
2
  import "../../Markdown/index.mjs";
3
- import * as react0 from "react";
3
+ import * as react14 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: react0.NamedExoticComponent<MdxProps>;
21
+ declare const Mdx: react14.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 react126 from "react";
2
+ import * as react129 from "react";
3
3
 
4
4
  //#region src/mobile/ChatHeader/ChatHeaderTitle.d.ts
5
- declare const ChatHeaderTitle: react126.NamedExoticComponent<ChatHeaderTitleProps>;
5
+ declare const ChatHeaderTitle: react129.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 react128 from "react";
2
+ import * as react130 from "react";
3
3
 
4
4
  //#region src/mobile/ChatInputArea/components/ChatSendButton.d.ts
5
- declare const ChatSendButton: react128.NamedExoticComponent<ChatSendButtonProps>;
5
+ declare const ChatSendButton: react130.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 react127 from "react";
2
+ import * as react154 from "react";
3
3
 
4
4
  //#region src/mobile/TabBar/TabBar.d.ts
5
- declare const TabBar: react127.NamedExoticComponent<TabBarProps>;
5
+ declare const TabBar: react154.NamedExoticComponent<TabBarProps>;
6
6
  //#endregion
7
7
  export { TabBar };
8
8
  //# sourceMappingURL=TabBar.d.mts.map
@@ -1,6 +1,6 @@
1
1
  import { FlexboxProps } from "../../Flex/type.mjs";
2
2
  import "../../Flex/index.mjs";
3
- import * as react0 from "react";
3
+ import * as react19 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: react0.NamedExoticComponent<StoryBookProps>;
13
+ declare const StoryBook: react19.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.35.2",
3
+ "version": "4.35.3",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",
@@ -1,24 +0,0 @@
1
- 'use client';
2
-
3
- import { useIsClient } from "./useIsClient.mjs";
4
- import { LOBE_THEME_APP_ID } from "../ThemeProvider/constants.mjs";
5
- import { useMemo } from "react";
6
-
7
- //#region src/hooks/usePortalContainer.ts
8
- const usePortalContainer = (containerAttr) => {
9
- const isClient = useIsClient();
10
- return useMemo(() => {
11
- if (!isClient) return null;
12
- const themeApp = document.querySelector(`#${LOBE_THEME_APP_ID}`);
13
- if (themeApp) return themeApp;
14
- if (containerAttr) {
15
- const container = document.querySelector(`[${containerAttr}="true"]`);
16
- if (container) return container;
17
- }
18
- return document.body;
19
- }, [isClient, containerAttr]);
20
- };
21
-
22
- //#endregion
23
- export { usePortalContainer };
24
- //# sourceMappingURL=usePortalContainer.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePortalContainer.mjs","names":[],"sources":["../../src/hooks/usePortalContainer.ts"],"sourcesContent":["'use client';\n\nimport { useMemo } from 'react';\n\nimport { LOBE_THEME_APP_ID } from '@/ThemeProvider';\n\nimport { useIsClient } from './useIsClient';\n\nexport const usePortalContainer = (containerAttr?: string): HTMLElement | null => {\n const isClient = useIsClient();\n\n return useMemo(() => {\n if (!isClient) return null;\n\n const themeApp = document.querySelector<HTMLElement>(`#${LOBE_THEME_APP_ID}`);\n if (themeApp) return themeApp;\n\n if (containerAttr) {\n const container = document.querySelector<HTMLElement>(`[${containerAttr}=\"true\"]`);\n if (container) return container;\n }\n\n return document.body;\n }, [isClient, containerAttr]);\n};\n"],"mappings":";;;;;;;AAQA,MAAa,sBAAsB,kBAA+C;CAChF,MAAM,WAAW,aAAa;AAE9B,QAAO,cAAc;AACnB,MAAI,CAAC,SAAU,QAAO;EAEtB,MAAM,WAAW,SAAS,cAA2B,IAAI,oBAAoB;AAC7E,MAAI,SAAU,QAAO;AAErB,MAAI,eAAe;GACjB,MAAM,YAAY,SAAS,cAA2B,IAAI,cAAc,UAAU;AAClF,OAAI,UAAW,QAAO;;AAGxB,SAAO,SAAS;IACf,CAAC,UAAU,cAAc,CAAC"}