@lobehub/ui 4.35.2 → 4.36.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.
- package/es/Accordion/Accordion.d.mts +2 -2
- package/es/Accordion/AccordionItem.d.mts +2 -2
- package/es/ActionIcon/ActionIcon.d.mts +2 -2
- package/es/Alert/Alert.d.mts +2 -2
- package/es/Alert/type.d.mts +1 -1
- package/es/AutoComplete/Select.d.mts +2 -2
- package/es/Avatar/Avatar.mjs +1 -1
- package/es/Avatar/AvatarGroup/index.d.mts +2 -2
- package/es/Burger/Burger.d.mts +2 -2
- package/es/CodeDiff/CodeDiff.d.mts +2 -2
- package/es/CodeDiff/PatchDiff.d.mts +2 -2
- package/es/CodeEditor/CodeEditor.d.mts +2 -2
- package/es/Collapse/Collapse.d.mts +2 -2
- package/es/ColorSwatches/ColorSwatches.mjs +1 -1
- package/es/ConfigProvider/index.d.mts +2 -2
- package/es/ContextMenu/ContextMenuHost.d.mts +2 -2
- package/es/ContextMenu/ContextMenuHost.mjs +4 -9
- package/es/ContextMenu/ContextMenuHost.mjs.map +1 -1
- package/es/CopyButton/CopyButton.d.mts +2 -2
- package/es/DatePicker/DatePicker.d.mts +2 -2
- package/es/DraggablePanel/components/DraggablePanelBody.d.mts +2 -2
- package/es/DraggablePanel/components/DraggablePanelContainer.d.mts +2 -2
- package/es/DraggablePanel/components/DraggablePanelFooter.d.mts +2 -2
- package/es/DraggablePanel/components/DraggablePanelHeader.d.mts +2 -2
- package/es/DraggableSideNav/DraggableSideNav.d.mts +2 -2
- package/es/Drawer/Drawer.d.mts +2 -2
- package/es/Dropdown/Dropdown.d.mts +2 -2
- package/es/DropdownMenu/DropdownMenu.d.mts +2 -2
- package/es/DropdownMenu/atoms.d.mts +18 -18
- package/es/DropdownMenu/atoms.mjs +4 -4
- package/es/DropdownMenu/atoms.mjs.map +1 -1
- package/es/EditableText/EditableText.d.mts +2 -2
- package/es/EditorSlashMenu/atoms.d.mts +13 -13
- package/es/EditorSlashMenu/atoms.mjs +3 -3
- package/es/EditorSlashMenu/atoms.mjs.map +1 -1
- package/es/EmojiPicker/EmojiPicker.d.mts +2 -2
- package/es/Flex/FlexBasic.d.mts +2 -2
- package/es/FontLoader/index.d.mts +2 -2
- package/es/Footer/Footer.d.mts +2 -2
- package/es/Form/components/FormGroup.d.mts +2 -2
- package/es/Form/components/FormItem.d.mts +2 -2
- package/es/Form/components/FormSubmitFooter.d.mts +2 -2
- package/es/FormModal/FormModal.d.mts +2 -2
- package/es/Freeze/Freeze.d.mts +2 -2
- package/es/GuideCard/GuideCard.d.mts +2 -2
- package/es/Header/Header.d.mts +2 -2
- package/es/Highlighter/Highlighter.d.mts +2 -2
- package/es/Highlighter/SyntaxHighlighter/index.d.mts +2 -2
- package/es/Hotkey/Hotkey.d.mts +2 -2
- package/es/HotkeyInput/HotkeyInput.d.mts +2 -2
- package/es/Icon/Icon.d.mts +2 -2
- package/es/Icon/components/IconProvider.d.mts +3 -3
- package/es/Image/PreviewGroup.d.mts +2 -2
- package/es/ImageSelect/ImageSelect.d.mts +2 -2
- package/es/Input/Input.d.mts +2 -2
- package/es/Input/InputPassword.d.mts +2 -2
- package/es/Input/TextArea.d.mts +2 -2
- package/es/Layout/components/LayoutFooter.d.mts +2 -2
- package/es/Layout/components/LayoutHeader.d.mts +2 -2
- package/es/Layout/components/LayoutMain.d.mts +2 -2
- package/es/Layout/components/LayoutSidebar.d.mts +2 -2
- package/es/Layout/components/LayoutSidebarInner.d.mts +2 -2
- package/es/Layout/components/LayoutToc.d.mts +2 -2
- package/es/List/ListItem/index.d.mts +2 -2
- package/es/LobeSelect/LobeSelect.d.mts +2 -2
- package/es/LobeSelect/LobeSelect.mjs +45 -51
- package/es/LobeSelect/LobeSelect.mjs.map +1 -1
- package/es/LobeSelect/atoms.d.mts +19 -19
- package/es/LobeSelect/atoms.mjs +4 -4
- package/es/LobeSelect/atoms.mjs.map +1 -1
- package/es/LobeSwitch/LobeSwitch.d.mts +2 -2
- package/es/LobeSwitch/atoms.d.mts +4 -4
- package/es/Markdown/Markdown.d.mts +2 -2
- package/es/Markdown/Typography.d.mts +2 -2
- package/es/Markdown/components/SearchResultCards/index.d.mts +2 -2
- package/es/Menu/Menu.d.mts +2 -2
- package/es/Mermaid/Mermaid.d.mts +2 -2
- package/es/Mermaid/SyntaxMermaid/index.d.mts +2 -2
- package/es/Modal/imperative.d.mts +2 -2
- package/es/MotionProvider/index.d.mts +2 -2
- package/es/Popover/ArrowIcon.d.mts +2 -2
- package/es/Popover/PopoverPortal.mjs +8 -12
- package/es/Popover/PopoverPortal.mjs.map +1 -1
- package/es/Popover/atoms.d.mts +9 -9
- package/es/Popover/context.d.mts +2 -2
- package/es/ScrollArea/atoms.d.mts +7 -7
- package/es/SearchBar/SearchBar.d.mts +2 -2
- package/es/Segmented/Segmented.d.mts +2 -2
- package/es/Select/Select.d.mts +2 -2
- package/es/SideNav/SideNav.d.mts +2 -2
- package/es/SliderWithInput/SliderWithInput.d.mts +2 -2
- package/es/SortableList/components/DragHandle.d.mts +2 -2
- package/es/SortableList/components/SortableItem.d.mts +2 -2
- package/es/ThemeProvider/AppElementContext.d.mts +7 -0
- package/es/ThemeProvider/AppElementContext.mjs +14 -0
- package/es/ThemeProvider/AppElementContext.mjs.map +1 -0
- package/es/ThemeProvider/GlobalStyle/global.mjs +10 -17
- package/es/ThemeProvider/GlobalStyle/global.mjs.map +1 -1
- package/es/ThemeProvider/ThemeProvider.d.mts +2 -2
- package/es/ThemeProvider/ThemeProvider.mjs +9 -2
- package/es/ThemeProvider/ThemeProvider.mjs.map +1 -1
- package/es/ThemeProvider/index.d.mts +2 -1
- package/es/ThemeProvider/index.mjs +2 -1
- package/es/Toast/imperative.d.mts +3 -3
- package/es/Toast/imperative.mjs +7 -44
- package/es/Toast/imperative.mjs.map +1 -1
- package/es/Toc/Toc.d.mts +2 -2
- package/es/Tooltip/TooltipGroup.mjs +3 -3
- package/es/Tooltip/TooltipGroup.mjs.map +1 -1
- package/es/Tooltip/TooltipStandalone.mjs +3 -3
- package/es/Tooltip/TooltipStandalone.mjs.map +1 -1
- package/es/Video/index.d.mts +2 -2
- package/es/awesome/AuroraBackground/AuroraBackground.d.mts +2 -2
- package/es/awesome/BottomGradientButton/BottomGradientButton.d.mts +2 -2
- package/es/awesome/Features/Features.d.mts +2 -2
- package/es/awesome/Giscus/Giscus.d.mts +2 -2
- package/es/awesome/GradientButton/GradientButton.d.mts +2 -2
- package/es/awesome/GridBackground/GridBackground.d.mts +2 -2
- package/es/awesome/GridBackground/GridShowcase.d.mts +2 -2
- package/es/awesome/Hero/Hero.d.mts +2 -2
- package/es/awesome/Spline/Spine.d.mts +2 -2
- package/es/awesome/Spotlight/Spotlight.d.mts +2 -2
- package/es/awesome/SpotlightCard/SpotlightCard.d.mts +2 -2
- package/es/awesome/TypewriterEffect/TypewriterEffect.d.mts +2 -2
- package/es/brand/LobeChat/index.d.mts +2 -2
- package/es/brand/LobeHub/index.d.mts +2 -2
- package/es/brand/LogoThree/LogoSpline.d.mts +2 -2
- package/es/brand/LogoThree/index.d.mts +2 -2
- package/es/chat/BackBottom/BackBottom.d.mts +2 -2
- package/es/chat/ChatInputArea/components/ChatInputAreaInner.d.mts +2 -2
- package/es/chat/ChatItem/ChatItem.d.mts +2 -2
- package/es/chat/ChatList/ChatList.d.mts +2 -2
- package/es/chat/EditableMessage/EditableMessage.d.mts +2 -2
- package/es/chat/EditableMessageList/EditableMessageList.d.mts +2 -2
- package/es/chat/MessageInput/MessageInput.d.mts +2 -2
- package/es/chat/MessageModal/MessageModal.d.mts +2 -2
- package/es/color/ColorScales/index.d.mts +2 -2
- package/es/color/CssVar/index.d.mts +2 -2
- package/es/i18n/context.d.mts +2 -2
- package/es/icons/lucideExtra/BotPromptIcon.d.mts +2 -2
- package/es/icons/lucideExtra/CreateBotIcon.d.mts +3 -3
- package/es/icons/lucideExtra/DiscordIcon.d.mts +3 -3
- package/es/icons/lucideExtra/GlobeOffIcon.d.mts +2 -2
- package/es/icons/lucideExtra/GroupBotIcon.d.mts +2 -2
- package/es/icons/lucideExtra/GroupBotSquareIcon.d.mts +3 -3
- package/es/icons/lucideExtra/LeftClickIcon.d.mts +3 -3
- package/es/icons/lucideExtra/LeftDoubleClickIcon.d.mts +3 -3
- package/es/icons/lucideExtra/McpIcon.d.mts +3 -3
- package/es/icons/lucideExtra/ProviderIcon.d.mts +3 -3
- package/es/icons/lucideExtra/RightClickIcon.d.mts +3 -3
- package/es/icons/lucideExtra/RightDoubleClickIcon.d.mts +3 -3
- package/es/icons/lucideExtra/ShapesUploadIcon.d.mts +3 -3
- package/es/icons/lucideExtra/TreeDownRightIcon.d.mts +3 -3
- package/es/icons/lucideExtra/TreeUpDownRightIcon.d.mts +2 -2
- package/es/index.d.mts +2 -1
- package/es/index.mjs +7 -6
- package/es/mdx/Mdx/index.d.mts +2 -2
- package/es/mobile/ChatHeader/ChatHeaderTitle.d.mts +2 -2
- package/es/mobile/ChatInputArea/components/ChatSendButton.d.mts +2 -2
- package/es/storybook/StoryBook/index.d.mts +2 -2
- package/package.json +1 -1
- package/es/Tooltip/TooltipPortal.mjs +0 -45
- package/es/Tooltip/TooltipPortal.mjs.map +0 -1
- package/es/hooks/usePortalContainer.mjs +0 -24
- package/es/hooks/usePortalContainer.mjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MarkdownProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react43 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Markdown/Markdown.d.ts
|
|
5
|
-
declare const Markdown:
|
|
5
|
+
declare const Markdown: react43.NamedExoticComponent<MarkdownProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Markdown };
|
|
8
8
|
//# sourceMappingURL=Markdown.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TypographyProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react42 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Markdown/Typography.d.ts
|
|
5
|
-
declare const Typography:
|
|
5
|
+
declare const Typography: react42.NamedExoticComponent<TypographyProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Typography };
|
|
8
8
|
//# sourceMappingURL=Typography.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FlexboxProps } from "../../../Flex/type.mjs";
|
|
2
2
|
import "../../../Flex/index.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react86 from "react";
|
|
4
4
|
import { Ref } from "react";
|
|
5
5
|
|
|
6
6
|
//#region src/Markdown/components/SearchResultCards/index.d.ts
|
|
@@ -14,7 +14,7 @@ interface SearchResultCardsProps extends FlexboxProps {
|
|
|
14
14
|
dataSource: string[] | SearchResultItem[];
|
|
15
15
|
ref?: Ref<HTMLDivElement>;
|
|
16
16
|
}
|
|
17
|
-
declare const SearchResultCards:
|
|
17
|
+
declare const SearchResultCards: react86.NamedExoticComponent<SearchResultCardsProps>;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { SearchResultCards, SearchResultCardsProps };
|
|
20
20
|
//# sourceMappingURL=index.d.mts.map
|
package/es/Menu/Menu.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MenuProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react77 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Menu/Menu.d.ts
|
|
5
|
-
declare const Menu:
|
|
5
|
+
declare const Menu: react77.NamedExoticComponent<MenuProps<unknown>>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Menu };
|
|
8
8
|
//# sourceMappingURL=Menu.d.mts.map
|
package/es/Mermaid/Mermaid.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MermaidProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react31 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Mermaid/Mermaid.d.ts
|
|
5
|
-
declare const Mermaid:
|
|
5
|
+
declare const Mermaid: react31.NamedExoticComponent<MermaidProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Mermaid };
|
|
8
8
|
//# sourceMappingURL=Mermaid.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SyntaxMermaidProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react30 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Mermaid/SyntaxMermaid/index.d.ts
|
|
5
|
-
declare const SyntaxMermaid:
|
|
5
|
+
declare const SyntaxMermaid: react30.NamedExoticComponent<SyntaxMermaidProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { SyntaxMermaid };
|
|
8
8
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ImperativeModalProps, ModalInstance, RawModalComponent, RawModalComponentProps, RawModalInstance, RawModalKeyOptions, RawModalOptions } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime29 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/Modal/imperative.d.ts
|
|
5
5
|
type ModalHostProps = {
|
|
@@ -7,7 +7,7 @@ type ModalHostProps = {
|
|
|
7
7
|
};
|
|
8
8
|
declare const ModalHost: ({
|
|
9
9
|
root
|
|
10
|
-
}: ModalHostProps) =>
|
|
10
|
+
}: ModalHostProps) => react_jsx_runtime29.JSX.Element | null;
|
|
11
11
|
declare const createModal: (props: ImperativeModalProps) => ModalInstance;
|
|
12
12
|
declare function createRawModal<P extends RawModalComponentProps>(component: RawModalComponent<P>, props: Omit<P, 'open' | 'onClose'>, options?: RawModalOptions): RawModalInstance<P>;
|
|
13
13
|
declare function createRawModal<P, OpenKey extends keyof P, CloseKey extends keyof P>(component: RawModalComponent<P>, props: Omit<P, OpenKey | CloseKey>, options: RawModalKeyOptions<OpenKey, CloseKey>): RawModalInstance<P, OpenKey, CloseKey>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react87 from "react";
|
|
2
2
|
import { Context, ReactNode } from "react";
|
|
3
3
|
import * as motion_react0 from "motion/react";
|
|
4
4
|
import * as m from "motion/react-m";
|
|
@@ -6,7 +6,7 @@ import * as m from "motion/react-m";
|
|
|
6
6
|
//#region src/MotionProvider/index.d.ts
|
|
7
7
|
type MotionComponentType = typeof motion_react0.motion | typeof m;
|
|
8
8
|
declare const MotionComponent: Context<MotionComponentType>;
|
|
9
|
-
declare const MotionProvider:
|
|
9
|
+
declare const MotionProvider: react87.NamedExoticComponent<{
|
|
10
10
|
children: ReactNode;
|
|
11
11
|
motion: MotionComponentType;
|
|
12
12
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime22 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/Popover/ArrowIcon.d.ts
|
|
4
|
-
declare const PopoverArrowIcon:
|
|
4
|
+
declare const PopoverArrowIcon: react_jsx_runtime22.JSX.Element;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { PopoverArrowIcon };
|
|
7
7
|
//# sourceMappingURL=ArrowIcon.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { useAppElement } from "../ThemeProvider/AppElementContext.mjs";
|
|
4
4
|
import { useEffect, useState } from "react";
|
|
5
5
|
|
|
6
6
|
//#region src/Popover/PopoverPortal.tsx
|
|
@@ -11,11 +11,6 @@ const getOrCreateContainer = (root) => {
|
|
|
11
11
|
const resolvedRoot = (() => {
|
|
12
12
|
if (typeof document === "undefined") return root;
|
|
13
13
|
if (typeof ShadowRoot !== "undefined" && root instanceof ShadowRoot) return root;
|
|
14
|
-
if (!(root === document.body)) return root;
|
|
15
|
-
const themeApp = document.querySelector(`#${LOBE_THEME_APP_ID}`);
|
|
16
|
-
if (themeApp) return themeApp;
|
|
17
|
-
const popoverContainer = document.querySelector(`[${POPOVER_CONTAINER_ATTR}="true"]`);
|
|
18
|
-
if (popoverContainer) return popoverContainer;
|
|
19
14
|
return root;
|
|
20
15
|
})();
|
|
21
16
|
const cached = containerMap.get(resolvedRoot);
|
|
@@ -26,17 +21,18 @@ const getOrCreateContainer = (root) => {
|
|
|
26
21
|
containerMap.set(resolvedRoot, el);
|
|
27
22
|
return el;
|
|
28
23
|
};
|
|
29
|
-
const resolveRoot = (root) => {
|
|
30
|
-
if (root) return root;
|
|
31
|
-
return document.body;
|
|
32
|
-
};
|
|
33
24
|
const usePopoverPortalContainer = (root) => {
|
|
25
|
+
const appElement = useAppElement();
|
|
34
26
|
const [container, setContainer] = useState(null);
|
|
35
27
|
useEffect(() => {
|
|
36
|
-
const resolved =
|
|
28
|
+
const resolved = root ?? appElement ?? document.body;
|
|
37
29
|
if (!resolved) return;
|
|
38
30
|
setContainer(getOrCreateContainer(resolved));
|
|
39
|
-
}, [
|
|
31
|
+
}, [
|
|
32
|
+
root,
|
|
33
|
+
appElement,
|
|
34
|
+
container?.isConnected
|
|
35
|
+
]);
|
|
40
36
|
return container;
|
|
41
37
|
};
|
|
42
38
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopoverPortal.mjs","names":[],"sources":["../../src/Popover/PopoverPortal.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useState } from 'react';\n\nimport {
|
|
1
|
+
{"version":3,"file":"PopoverPortal.mjs","names":[],"sources":["../../src/Popover/PopoverPortal.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useState } from 'react';\n\nimport { useAppElement } from '@/ThemeProvider';\n\nconst PORTAL_ATTR = 'data-lobe-ui-popover-portal';\nexport const POPOVER_CONTAINER_ATTR = 'data-lobe-ui-popover-container';\n\n// Reuse one portal container per root (document.body by default).\nconst containerMap = new WeakMap<object, HTMLElement>();\n\nconst getOrCreateContainer = (root: HTMLElement | ShadowRoot): HTMLElement => {\n const resolvedRoot = (() => {\n if (typeof document === 'undefined') return root;\n if (typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot) return root;\n\n return root;\n })();\n\n const cached = containerMap.get(resolvedRoot);\n if (cached && cached.isConnected) return cached;\n\n const el = document.createElement('div');\n el.setAttribute(PORTAL_ATTR, 'true');\n resolvedRoot.append(el);\n containerMap.set(resolvedRoot, el);\n return el;\n};\n\nexport const usePopoverPortalContainer = (\n root?: HTMLElement | ShadowRoot | null,\n): HTMLElement | null => {\n const appElement = useAppElement();\n const [container, setContainer] = useState<HTMLElement | null>(null);\n\n // Never mutate DOM / create portal container during render.\n // Create it after mount to avoid SSR/hydration side effects.\n useEffect(() => {\n const resolved = root ?? appElement ?? document.body;\n if (!resolved) return;\n setContainer(getOrCreateContainer(resolved));\n }, [root, appElement, container?.isConnected]);\n\n return container;\n};\n"],"mappings":";;;;;;AAMA,MAAM,cAAc;AACpB,MAAa,yBAAyB;AAGtC,MAAM,+BAAe,IAAI,SAA8B;AAEvD,MAAM,wBAAwB,SAAgD;CAC5E,MAAM,sBAAsB;AAC1B,MAAI,OAAO,aAAa,YAAa,QAAO;AAC5C,MAAI,OAAO,eAAe,eAAe,gBAAgB,WAAY,QAAO;AAE5E,SAAO;KACL;CAEJ,MAAM,SAAS,aAAa,IAAI,aAAa;AAC7C,KAAI,UAAU,OAAO,YAAa,QAAO;CAEzC,MAAM,KAAK,SAAS,cAAc,MAAM;AACxC,IAAG,aAAa,aAAa,OAAO;AACpC,cAAa,OAAO,GAAG;AACvB,cAAa,IAAI,cAAc,GAAG;AAClC,QAAO;;AAGT,MAAa,6BACX,SACuB;CACvB,MAAM,aAAa,eAAe;CAClC,MAAM,CAAC,WAAW,gBAAgB,SAA6B,KAAK;AAIpE,iBAAgB;EACd,MAAM,WAAW,QAAQ,cAAc,SAAS;AAChD,MAAI,CAAC,SAAU;AACf,eAAa,qBAAqB,SAAS,CAAC;IAC3C;EAAC;EAAM;EAAY,WAAW;EAAY,CAAC;AAE9C,QAAO"}
|
package/es/Popover/atoms.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { PopoverPlacement } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react34 from "react";
|
|
3
3
|
import { ComponentProps, ComponentPropsWithRef } from "react";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime23 from "react/jsx-runtime";
|
|
5
5
|
import * as _base_ui_react_popover0 from "@base-ui/react/popover";
|
|
6
6
|
import { Popover } from "@base-ui/react/popover";
|
|
7
7
|
|
|
8
8
|
//#region src/Popover/atoms.d.ts
|
|
9
9
|
declare const PopoverRoot: typeof Popover.Root;
|
|
10
|
-
declare const PopoverBackdrop:
|
|
10
|
+
declare const PopoverBackdrop: react34.ForwardRefExoticComponent<_base_ui_react_popover0.PopoverBackdropProps & react34.RefAttributes<HTMLDivElement>>;
|
|
11
11
|
type PopoverTriggerElementProps = Omit<ComponentPropsWithRef<typeof Popover.Trigger>, 'children' | 'render'> & {
|
|
12
12
|
children: ComponentProps<typeof Popover.Trigger>['children'];
|
|
13
13
|
};
|
|
@@ -18,7 +18,7 @@ declare const PopoverTriggerElement: {
|
|
|
18
18
|
nativeButton,
|
|
19
19
|
ref: refProp,
|
|
20
20
|
...rest
|
|
21
|
-
}: PopoverTriggerElementProps):
|
|
21
|
+
}: PopoverTriggerElementProps): react_jsx_runtime23.JSX.Element;
|
|
22
22
|
displayName: string;
|
|
23
23
|
};
|
|
24
24
|
type PopoverPortalAtomProps = Omit<ComponentProps<typeof Popover.Portal>, 'container'> & {
|
|
@@ -37,7 +37,7 @@ declare const PopoverPortal: {
|
|
|
37
37
|
root,
|
|
38
38
|
children,
|
|
39
39
|
...rest
|
|
40
|
-
}: PopoverPortalAtomProps):
|
|
40
|
+
}: PopoverPortalAtomProps): react_jsx_runtime23.JSX.Element | null;
|
|
41
41
|
displayName: string;
|
|
42
42
|
};
|
|
43
43
|
type PopoverPositionerAtomProps = ComponentProps<typeof Popover.Positioner> & {
|
|
@@ -54,7 +54,7 @@ declare const PopoverPositioner: {
|
|
|
54
54
|
side,
|
|
55
55
|
sideOffset,
|
|
56
56
|
...rest
|
|
57
|
-
}: PopoverPositionerAtomProps):
|
|
57
|
+
}: PopoverPositionerAtomProps): react_jsx_runtime23.JSX.Element;
|
|
58
58
|
displayName: string;
|
|
59
59
|
};
|
|
60
60
|
type PopoverPopupAtomProps = ComponentProps<typeof Popover.Popup>;
|
|
@@ -62,7 +62,7 @@ declare const PopoverPopup: {
|
|
|
62
62
|
({
|
|
63
63
|
className,
|
|
64
64
|
...rest
|
|
65
|
-
}: PopoverPopupAtomProps):
|
|
65
|
+
}: PopoverPopupAtomProps): react_jsx_runtime23.JSX.Element;
|
|
66
66
|
displayName: string;
|
|
67
67
|
};
|
|
68
68
|
type PopoverArrowAtomProps = ComponentProps<typeof Popover.Arrow>;
|
|
@@ -71,7 +71,7 @@ declare const PopoverArrow: {
|
|
|
71
71
|
className,
|
|
72
72
|
children,
|
|
73
73
|
...rest
|
|
74
|
-
}: PopoverArrowAtomProps):
|
|
74
|
+
}: PopoverArrowAtomProps): react_jsx_runtime23.JSX.Element;
|
|
75
75
|
displayName: string;
|
|
76
76
|
};
|
|
77
77
|
type PopoverViewportAtomProps = ComponentProps<typeof Popover.Viewport>;
|
|
@@ -79,7 +79,7 @@ declare const PopoverViewport: {
|
|
|
79
79
|
({
|
|
80
80
|
className,
|
|
81
81
|
...rest
|
|
82
|
-
}: PopoverViewportAtomProps):
|
|
82
|
+
}: PopoverViewportAtomProps): react_jsx_runtime23.JSX.Element;
|
|
83
83
|
displayName: string;
|
|
84
84
|
};
|
|
85
85
|
//#endregion
|
package/es/Popover/context.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react32 from "react";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Popover/context.d.ts
|
|
5
5
|
type PopoverContextValue = {
|
|
6
6
|
close: () => void;
|
|
7
7
|
};
|
|
8
|
-
declare const PopoverProvider:
|
|
8
|
+
declare const PopoverProvider: react32.NamedExoticComponent<{
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
value: PopoverContextValue;
|
|
11
11
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime16 from "react/jsx-runtime";
|
|
3
3
|
import { ScrollArea } from "@base-ui/react/scroll-area";
|
|
4
4
|
|
|
5
5
|
//#region src/ScrollArea/atoms.d.ts
|
|
@@ -19,7 +19,7 @@ declare const ScrollAreaRoot: {
|
|
|
19
19
|
({
|
|
20
20
|
className,
|
|
21
21
|
...rest
|
|
22
|
-
}: ScrollAreaRootProps):
|
|
22
|
+
}: ScrollAreaRootProps): react_jsx_runtime16.JSX.Element;
|
|
23
23
|
displayName: string;
|
|
24
24
|
};
|
|
25
25
|
declare const ScrollAreaViewport: {
|
|
@@ -27,35 +27,35 @@ declare const ScrollAreaViewport: {
|
|
|
27
27
|
className,
|
|
28
28
|
scrollFade,
|
|
29
29
|
...rest
|
|
30
|
-
}: ScrollAreaViewportProps):
|
|
30
|
+
}: ScrollAreaViewportProps): react_jsx_runtime16.JSX.Element;
|
|
31
31
|
displayName: string;
|
|
32
32
|
};
|
|
33
33
|
declare const ScrollAreaContent: {
|
|
34
34
|
({
|
|
35
35
|
className,
|
|
36
36
|
...rest
|
|
37
|
-
}: ScrollAreaContentProps):
|
|
37
|
+
}: ScrollAreaContentProps): react_jsx_runtime16.JSX.Element;
|
|
38
38
|
displayName: string;
|
|
39
39
|
};
|
|
40
40
|
declare const ScrollAreaScrollbar: {
|
|
41
41
|
({
|
|
42
42
|
className,
|
|
43
43
|
...rest
|
|
44
|
-
}: ScrollAreaScrollbarProps):
|
|
44
|
+
}: ScrollAreaScrollbarProps): react_jsx_runtime16.JSX.Element;
|
|
45
45
|
displayName: string;
|
|
46
46
|
};
|
|
47
47
|
declare const ScrollAreaThumb: {
|
|
48
48
|
({
|
|
49
49
|
className,
|
|
50
50
|
...rest
|
|
51
|
-
}: ScrollAreaThumbProps):
|
|
51
|
+
}: ScrollAreaThumbProps): react_jsx_runtime16.JSX.Element;
|
|
52
52
|
displayName: string;
|
|
53
53
|
};
|
|
54
54
|
declare const ScrollAreaCorner: {
|
|
55
55
|
({
|
|
56
56
|
className,
|
|
57
57
|
...rest
|
|
58
|
-
}: ScrollAreaCornerProps):
|
|
58
|
+
}: ScrollAreaCornerProps): react_jsx_runtime16.JSX.Element;
|
|
59
59
|
displayName: string;
|
|
60
60
|
};
|
|
61
61
|
//#endregion
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SearchBarProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react26 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/SearchBar/SearchBar.d.ts
|
|
5
|
-
declare const SearchBar:
|
|
5
|
+
declare const SearchBar: react26.NamedExoticComponent<SearchBarProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { SearchBar };
|
|
8
8
|
//# sourceMappingURL=SearchBar.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SegmentedProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react29 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Segmented/Segmented.d.ts
|
|
5
|
-
declare const Segmented:
|
|
5
|
+
declare const Segmented: react29.NamedExoticComponent<SegmentedProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Segmented };
|
|
8
8
|
//# sourceMappingURL=Segmented.d.mts.map
|
package/es/Select/Select.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SelectProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react27 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Select/Select.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* @deprecated Use `LobeSelect` instead.
|
|
7
7
|
*/
|
|
8
|
-
declare const Select:
|
|
8
|
+
declare const Select: react27.NamedExoticComponent<SelectProps>;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { Select };
|
|
11
11
|
//# sourceMappingURL=Select.d.mts.map
|
package/es/SideNav/SideNav.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SideNavProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react28 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/SideNav/SideNav.d.ts
|
|
5
|
-
declare const SideNav:
|
|
5
|
+
declare const SideNav: react28.NamedExoticComponent<SideNavProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { SideNav };
|
|
8
8
|
//# sourceMappingURL=SideNav.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SliderWithInputProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react25 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/SliderWithInput/SliderWithInput.d.ts
|
|
5
|
-
declare const SliderWithInput:
|
|
5
|
+
declare const SliderWithInput: react25.NamedExoticComponent<SliderWithInputProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { SliderWithInput };
|
|
8
8
|
//# sourceMappingURL=SliderWithInput.d.mts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ActionIconProps } from "../../ActionIcon/type.mjs";
|
|
2
2
|
import "../../ActionIcon/index.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react121 from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/SortableList/components/DragHandle.d.ts
|
|
6
|
-
declare const DragHandle:
|
|
6
|
+
declare const DragHandle: react121.NamedExoticComponent<ActionIconProps>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { DragHandle };
|
|
9
9
|
//# sourceMappingURL=DragHandle.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FlexboxProps } from "../../Flex/type.mjs";
|
|
2
2
|
import "../../Flex/index.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react119 from "react";
|
|
4
4
|
import "@dnd-kit/core";
|
|
5
5
|
|
|
6
6
|
//#region src/SortableList/components/SortableItem.d.ts
|
|
@@ -9,7 +9,7 @@ interface SortableItemProps extends Omit<FlexboxProps, 'id'> {
|
|
|
9
9
|
id: string | number;
|
|
10
10
|
variant?: 'borderless' | 'filled' | 'outlined';
|
|
11
11
|
}
|
|
12
|
-
declare const SortableItem:
|
|
12
|
+
declare const SortableItem: react119.NamedExoticComponent<SortableItemProps>;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { SortableItem };
|
|
15
15
|
//# sourceMappingURL=SortableItem.d.mts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { createContext, use } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/ThemeProvider/AppElementContext.tsx
|
|
6
|
+
const AppElementContext = createContext(null);
|
|
7
|
+
const useAppElement = () => {
|
|
8
|
+
return use(AppElementContext);
|
|
9
|
+
};
|
|
10
|
+
var AppElementContext_default = AppElementContext;
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { AppElementContext_default as default, useAppElement };
|
|
14
|
+
//# sourceMappingURL=AppElementContext.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppElementContext.mjs","names":[],"sources":["../../src/ThemeProvider/AppElementContext.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, use } from 'react';\n\nconst AppElementContext = createContext<HTMLDivElement | null>(null);\n\nexport const useAppElement = (): HTMLDivElement | null => {\n return use(AppElementContext);\n};\n\nexport default AppElementContext;\n"],"mappings":";;;;;AAIA,MAAM,oBAAoB,cAAqC,KAAK;AAEpE,MAAa,sBAA6C;AACxD,QAAO,IAAI,kBAAkB;;AAG/B,gCAAe"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { LOBE_THEME_APP_ID } from "../constants.mjs";
|
|
2
1
|
import { CLASSNAMES } from "../../styles/classNames.mjs";
|
|
3
2
|
import { css } from "antd-style";
|
|
4
3
|
|
|
@@ -63,10 +62,7 @@ var global_default = (token) => css`
|
|
|
63
62
|
box-sizing: border-box;
|
|
64
63
|
vertical-align: baseline;
|
|
65
64
|
}
|
|
66
|
-
|
|
67
|
-
/* https://base-ui.com/react/overview/quick-start#set-up-portals */
|
|
68
|
-
isolation: isolate;
|
|
69
|
-
}
|
|
65
|
+
|
|
70
66
|
@layer lobe-popup {
|
|
71
67
|
.${CLASSNAMES.ContextTrigger}[data-popup-open],
|
|
72
68
|
.${CLASSNAMES.DropdownMenuTrigger}[data-popup-open] {
|
|
@@ -85,30 +81,27 @@ var global_default = (token) => css`
|
|
|
85
81
|
--lobe-flex-width: auto;
|
|
86
82
|
--lobe-flex-height: auto;
|
|
87
83
|
--lobe-flex-padding: 0;
|
|
84
|
+
|
|
88
85
|
/* Keep padding-inline/block aligned with padding by default, and prevent inheriting from parent */
|
|
89
86
|
--lobe-flex-padding-inline: var(--lobe-flex-padding);
|
|
90
87
|
--lobe-flex-padding-block: var(--lobe-flex-padding);
|
|
91
88
|
--lobe-flex-gap: 0;
|
|
92
89
|
|
|
93
90
|
display: flex;
|
|
94
|
-
|
|
95
91
|
flex: var(--lobe-flex);
|
|
96
|
-
flex-
|
|
97
|
-
|
|
98
|
-
justify-content: var(--lobe-flex-justify);
|
|
92
|
+
flex-flow: var(--lobe-flex-direction) var(--lobe-flex-wrap);
|
|
93
|
+
gap: var(--lobe-flex-gap);
|
|
99
94
|
align-items: var(--lobe-flex-align);
|
|
95
|
+
justify-content: var(--lobe-flex-justify);
|
|
100
96
|
|
|
101
97
|
width: var(--lobe-flex-width);
|
|
102
98
|
height: var(--lobe-flex-height);
|
|
103
|
-
|
|
104
99
|
padding: var(--lobe-flex-padding);
|
|
105
|
-
padding-inline: var(--lobe-flex-padding-inline);
|
|
106
100
|
padding-block: var(--lobe-flex-padding-block);
|
|
107
|
-
|
|
108
|
-
gap: var(--lobe-flex-gap);
|
|
101
|
+
padding-inline: var(--lobe-flex-padding-inline);
|
|
109
102
|
}
|
|
110
103
|
|
|
111
|
-
.lobe-flex
|
|
104
|
+
.lobe-flex-hidden {
|
|
112
105
|
display: none;
|
|
113
106
|
}
|
|
114
107
|
}
|
|
@@ -126,17 +119,17 @@ var global_default = (token) => css`
|
|
|
126
119
|
|
|
127
120
|
@keyframes fill {
|
|
128
121
|
30% {
|
|
129
|
-
fill-opacity:
|
|
122
|
+
fill-opacity: 0.05;
|
|
130
123
|
}
|
|
131
124
|
|
|
132
125
|
100% {
|
|
133
|
-
fill-opacity:
|
|
126
|
+
fill-opacity: 1;
|
|
134
127
|
}
|
|
135
128
|
}
|
|
136
129
|
|
|
137
130
|
.lobe-brand-loading path {
|
|
138
131
|
fill: currentcolor;
|
|
139
|
-
fill-opacity: 0
|
|
132
|
+
fill-opacity: 0;
|
|
140
133
|
stroke: currentcolor;
|
|
141
134
|
stroke-dasharray: 1000;
|
|
142
135
|
stroke-dashoffset: 1000;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global.mjs","names":[],"sources":["../../../src/ThemeProvider/GlobalStyle/global.ts"],"sourcesContent":["import { css, type Theme } from 'antd-style';\n\nimport { CLASSNAMES } from '@/styles/classNames';\n\
|
|
1
|
+
{"version":3,"file":"global.mjs","names":[],"sources":["../../../src/ThemeProvider/GlobalStyle/global.ts"],"sourcesContent":["import { css, type Theme } from 'antd-style';\n\nimport { CLASSNAMES } from '@/styles/classNames';\n\nexport default (token: Theme) => css`\n :root {\n --font-settings: 'cv01', 'tnum', 'kern';\n --font-variations: 'opsz' auto, tabular-nums;\n\n text-autospace: normal;\n }\n\n html {\n overscroll-behavior: none;\n color-scheme: ${token.isDarkMode ? 'dark' : 'light'};\n }\n\n body {\n overflow: hidden auto;\n\n min-height: 100vh;\n margin: 0;\n padding: 0;\n\n font-family: ${token.fontFamily};\n font-size: ${token.fontSize}px;\n font-feature-settings: var(--font-settings);\n font-variation-settings: var(--font-variations);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n line-height: 1;\n color: ${token.colorTextBase};\n text-size-adjust: none;\n text-rendering: optimizelegibility;\n word-wrap: break-word;\n vertical-align: baseline;\n\n background-color: ${token.colorBgLayout};\n\n -webkit-overflow-scrolling: touch;\n -webkit-tap-highlight-color: transparent;\n }\n\n code {\n font-family: ${token.fontFamilyCode} !important;\n\n span {\n font-family: ${token.fontFamilyCode} !important;\n }\n }\n\n ::selection {\n color: #000;\n background: ${token.yellow9};\n\n -webkit-text-fill-color: unset !important;\n }\n\n * {\n scrollbar-color: ${token.colorFill} transparent;\n scrollbar-width: thin;\n box-sizing: border-box;\n vertical-align: baseline;\n }\n\n @layer lobe-popup {\n .${CLASSNAMES.ContextTrigger}[data-popup-open],\n .${CLASSNAMES.DropdownMenuTrigger}[data-popup-open] {\n background: ${token.colorFillTertiary};\n }\n }\n\n @layer lobe-base {\n :where(.lobe-flex) {\n /* Define defaults on the element itself to avoid CSS variable inheritance leaking to nested Flex */\n --lobe-flex: 0 1 auto;\n --lobe-flex-direction: column;\n --lobe-flex-wrap: nowrap;\n --lobe-flex-justify: flex-start;\n --lobe-flex-align: stretch;\n --lobe-flex-width: auto;\n --lobe-flex-height: auto;\n --lobe-flex-padding: 0;\n\n /* Keep padding-inline/block aligned with padding by default, and prevent inheriting from parent */\n --lobe-flex-padding-inline: var(--lobe-flex-padding);\n --lobe-flex-padding-block: var(--lobe-flex-padding);\n --lobe-flex-gap: 0;\n\n display: flex;\n flex: var(--lobe-flex);\n flex-flow: var(--lobe-flex-direction) var(--lobe-flex-wrap);\n gap: var(--lobe-flex-gap);\n align-items: var(--lobe-flex-align);\n justify-content: var(--lobe-flex-justify);\n\n width: var(--lobe-flex-width);\n height: var(--lobe-flex-height);\n padding: var(--lobe-flex-padding);\n padding-block: var(--lobe-flex-padding-block);\n padding-inline: var(--lobe-flex-padding-inline);\n }\n\n .lobe-flex-hidden {\n display: none;\n }\n }\n\n /* Brand Loading */\n @keyframes draw {\n 0% {\n stroke-dashoffset: 1000;\n }\n\n 100% {\n stroke-dashoffset: 0;\n }\n }\n\n @keyframes fill {\n 30% {\n fill-opacity: 0.05;\n }\n\n 100% {\n fill-opacity: 1;\n }\n }\n\n .lobe-brand-loading path {\n fill: currentcolor;\n fill-opacity: 0;\n stroke: currentcolor;\n stroke-dasharray: 1000;\n stroke-dashoffset: 1000;\n stroke-width: 0.25em;\n\n animation:\n draw 2s cubic-bezier(0.4, 0, 0.2, 1) infinite,\n fill 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n }\n`;\n"],"mappings":";;;;AAIA,sBAAgB,UAAiB,GAAG;;;;;;;;;;oBAUhB,MAAM,aAAa,SAAS,QAAQ;;;;;;;;;;mBAUrC,MAAM,WAAW;iBACnB,MAAM,SAAS;;;;;;aAMnB,MAAM,cAAc;;;;;;wBAMT,MAAM,cAAc;;;;;;;mBAOzB,MAAM,eAAe;;;qBAGnB,MAAM,eAAe;;;;;;kBAMxB,MAAM,QAAQ;;;;;;uBAMT,MAAM,UAAU;;;;;;;OAOhC,WAAW,eAAe;SACxB,WAAW,oBAAoB;oBACpB,MAAM,kBAAkB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ThemeProviderProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react36 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/ThemeProvider/ThemeProvider.d.ts
|
|
5
|
-
declare const ThemeProvider:
|
|
5
|
+
declare const ThemeProvider: react36.NamedExoticComponent<ThemeProviderProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { ThemeProvider };
|
|
8
8
|
//# sourceMappingURL=ThemeProvider.d.mts.map
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
import { useCdnFn } from "../ConfigProvider/index.mjs";
|
|
4
4
|
import { generateCustomStylish } from "../styles/theme/customStylish.mjs";
|
|
5
5
|
import { generateCustomToken } from "../styles/theme/customToken.mjs";
|
|
6
|
+
import AppElementContext_default from "./AppElementContext.mjs";
|
|
6
7
|
import { LOBE_THEME_APP_ID } from "./constants.mjs";
|
|
7
8
|
import FontLoader_default from "../FontLoader/index.mjs";
|
|
8
9
|
import { createLobeAntdTheme } from "../styles/theme/antdTheme.mjs";
|
|
9
10
|
import ConfigProvider_default from "./ConfigProvider.mjs";
|
|
10
11
|
import GlobalStyle_default from "./GlobalStyle/index.mjs";
|
|
11
|
-
import { memo, useCallback, useMemo } from "react";
|
|
12
|
+
import { memo, useCallback, useMemo, useState } from "react";
|
|
12
13
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
14
|
import { App } from "antd";
|
|
14
15
|
import { ThemeProvider } from "antd-style";
|
|
@@ -17,6 +18,7 @@ import { merge } from "es-toolkit/compat";
|
|
|
17
18
|
//#region src/ThemeProvider/ThemeProvider.tsx
|
|
18
19
|
const ThemeProvider$1 = memo(({ children, customStylish, customToken, enableCustomFonts = true, enableGlobalStyle = true, customFonts, customTheme = {}, className, style, theme: antdTheme, ...rest }) => {
|
|
19
20
|
const genCdnUrl = useCdnFn();
|
|
21
|
+
const [appRef, setAppRef] = useState(null);
|
|
20
22
|
const webfontUrls = useMemo(() => customFonts || [
|
|
21
23
|
genCdnUrl({
|
|
22
24
|
path: "css/index.css",
|
|
@@ -62,14 +64,19 @@ const ThemeProvider$1 = memo(({ children, customStylish, customToken, enableCust
|
|
|
62
64
|
children: /* @__PURE__ */ jsxs(ConfigProvider_default, { children: [enableGlobalStyle && /* @__PURE__ */ jsx(GlobalStyle_default, {}), /* @__PURE__ */ jsx(App, {
|
|
63
65
|
className,
|
|
64
66
|
style: {
|
|
67
|
+
isolation: "isolate",
|
|
65
68
|
minHeight: "inherit",
|
|
66
69
|
width: "inherit",
|
|
67
70
|
...style
|
|
68
71
|
},
|
|
69
72
|
children: /* @__PURE__ */ jsx("div", {
|
|
70
73
|
id: LOBE_THEME_APP_ID,
|
|
74
|
+
ref: setAppRef,
|
|
71
75
|
style: { display: "contents" },
|
|
72
|
-
children
|
|
76
|
+
children: /* @__PURE__ */ jsx(AppElementContext_default, {
|
|
77
|
+
value: appRef,
|
|
78
|
+
children
|
|
79
|
+
})
|
|
73
80
|
})
|
|
74
81
|
})] })
|
|
75
82
|
})] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.mjs","names":["ThemeProvider","lobeCustomStylish","theme","lobeCustomToken","FontLoader","AntdThemeProvider","AntdConfigProvider","GlobalStyle"],"sources":["../../src/ThemeProvider/ThemeProvider.tsx"],"sourcesContent":["'use client';\n\nimport { App } from 'antd';\nimport {\n type CustomStylishParams,\n type CustomTokenParams,\n type GetAntdTheme,\n ThemeProvider as AntdThemeProvider,\n} from 'antd-style';\nimport { merge } from 'es-toolkit/compat';\nimport { memo, useCallback, useMemo } from 'react';\n\nimport { useCdnFn } from '@/ConfigProvider';\nimport FontLoader from '@/FontLoader';\nimport { lobeCustomStylish, lobeCustomToken } from '@/styles';\nimport { createLobeAntdTheme } from '@/styles/theme/antdTheme';\nimport { type LobeCustomToken } from '@/types/customToken';\n\nimport AntdConfigProvider from './ConfigProvider';\nimport { LOBE_THEME_APP_ID } from './constants';\nimport GlobalStyle from './GlobalStyle';\nimport { type ThemeProviderProps } from './type';\n\nconst ThemeProvider = memo<ThemeProviderProps>(\n ({\n children,\n customStylish,\n customToken,\n enableCustomFonts = true,\n enableGlobalStyle = true,\n customFonts,\n customTheme = {},\n className,\n style,\n theme: antdTheme,\n ...rest\n }) => {\n const genCdnUrl = useCdnFn();\n\n const webfontUrls = useMemo(\n () =>\n customFonts || [\n genCdnUrl({ path: 'css/index.css', pkg: '@lobehub/webfont-mono' }),\n genCdnUrl({\n path: 'css/index.css',\n pkg: '@lobehub/webfont-harmony-sans',\n }),\n genCdnUrl({\n path: 'css/index.css',\n pkg: '@lobehub/webfont-harmony-sans-sc',\n }),\n genCdnUrl({ path: 'dist/katex.min.css', pkg: 'katex' }),\n ],\n [customFonts, genCdnUrl],\n );\n\n const stylish = useCallback(\n (theme: CustomStylishParams) => ({ ...lobeCustomStylish(theme), ...customStylish?.(theme) }),\n [customStylish],\n );\n\n const token = useCallback(\n (theme: CustomTokenParams) => ({ ...lobeCustomToken(theme), ...customToken?.(theme) }),\n [customToken],\n );\n\n const theme = useCallback<GetAntdTheme>(\n (appearance) => {\n const lobeTheme = createLobeAntdTheme({\n appearance,\n neutralColor: customTheme.neutralColor,\n primaryColor: customTheme.primaryColor,\n });\n return merge(lobeTheme, antdTheme);\n },\n [customTheme.primaryColor, customTheme.neutralColor, antdTheme],\n );\n\n return (\n <>\n {enableCustomFonts &&\n webfontUrls?.length > 0 &&\n webfontUrls.map((webfont) => <FontLoader key={webfont} url={webfont} />)}\n <AntdThemeProvider<LobeCustomToken>\n customStylish={stylish}\n customToken={token}\n theme={theme}\n {...rest}\n >\n <AntdConfigProvider>\n {enableGlobalStyle && <GlobalStyle />}\n\n <App
|
|
1
|
+
{"version":3,"file":"ThemeProvider.mjs","names":["ThemeProvider","lobeCustomStylish","theme","lobeCustomToken","FontLoader","AntdThemeProvider","AntdConfigProvider","GlobalStyle","AppElementContext"],"sources":["../../src/ThemeProvider/ThemeProvider.tsx"],"sourcesContent":["'use client';\n\nimport { App } from 'antd';\nimport {\n type CustomStylishParams,\n type CustomTokenParams,\n type GetAntdTheme,\n ThemeProvider as AntdThemeProvider,\n} from 'antd-style';\nimport { merge } from 'es-toolkit/compat';\nimport { memo, useCallback, useMemo, useState } from 'react';\n\nimport { useCdnFn } from '@/ConfigProvider';\nimport FontLoader from '@/FontLoader';\nimport { lobeCustomStylish, lobeCustomToken } from '@/styles';\nimport { createLobeAntdTheme } from '@/styles/theme/antdTheme';\nimport { type LobeCustomToken } from '@/types/customToken';\n\nimport AppElementContext from './AppElementContext';\nimport AntdConfigProvider from './ConfigProvider';\nimport { LOBE_THEME_APP_ID } from './constants';\nimport GlobalStyle from './GlobalStyle';\nimport { type ThemeProviderProps } from './type';\n\nconst ThemeProvider = memo<ThemeProviderProps>(\n ({\n children,\n customStylish,\n customToken,\n enableCustomFonts = true,\n enableGlobalStyle = true,\n customFonts,\n customTheme = {},\n className,\n style,\n theme: antdTheme,\n ...rest\n }) => {\n const genCdnUrl = useCdnFn();\n const [appRef, setAppRef] = useState<HTMLDivElement | null>(null);\n\n const webfontUrls = useMemo(\n () =>\n customFonts || [\n genCdnUrl({ path: 'css/index.css', pkg: '@lobehub/webfont-mono' }),\n genCdnUrl({\n path: 'css/index.css',\n pkg: '@lobehub/webfont-harmony-sans',\n }),\n genCdnUrl({\n path: 'css/index.css',\n pkg: '@lobehub/webfont-harmony-sans-sc',\n }),\n genCdnUrl({ path: 'dist/katex.min.css', pkg: 'katex' }),\n ],\n [customFonts, genCdnUrl],\n );\n\n const stylish = useCallback(\n (theme: CustomStylishParams) => ({ ...lobeCustomStylish(theme), ...customStylish?.(theme) }),\n [customStylish],\n );\n\n const token = useCallback(\n (theme: CustomTokenParams) => ({ ...lobeCustomToken(theme), ...customToken?.(theme) }),\n [customToken],\n );\n\n const theme = useCallback<GetAntdTheme>(\n (appearance) => {\n const lobeTheme = createLobeAntdTheme({\n appearance,\n neutralColor: customTheme.neutralColor,\n primaryColor: customTheme.primaryColor,\n });\n return merge(lobeTheme, antdTheme);\n },\n [customTheme.primaryColor, customTheme.neutralColor, antdTheme],\n );\n\n return (\n <>\n {enableCustomFonts &&\n webfontUrls?.length > 0 &&\n webfontUrls.map((webfont) => <FontLoader key={webfont} url={webfont} />)}\n <AntdThemeProvider<LobeCustomToken>\n customStylish={stylish}\n customToken={token}\n theme={theme}\n {...rest}\n >\n <AntdConfigProvider>\n {enableGlobalStyle && <GlobalStyle />}\n\n <App\n className={className}\n style={{ isolation: 'isolate', minHeight: 'inherit', width: 'inherit', ...style }}\n >\n <div id={LOBE_THEME_APP_ID} ref={setAppRef} style={{ display: 'contents' }}>\n <AppElementContext value={appRef}>{children}</AppElementContext>\n </div>\n </App>\n </AntdConfigProvider>\n </AntdThemeProvider>\n </>\n );\n },\n);\n\nThemeProvider.displayName = 'LobeThemeProvider';\n\nexport default ThemeProvider;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAwBA,MAAMA,kBAAgB,MACnB,EACC,UACA,eACA,aACA,oBAAoB,MACpB,oBAAoB,MACpB,aACA,cAAc,EAAE,EAChB,WACA,OACA,OAAO,WACP,GAAG,WACC;CACJ,MAAM,YAAY,UAAU;CAC5B,MAAM,CAAC,QAAQ,aAAa,SAAgC,KAAK;CAEjE,MAAM,cAAc,cAEhB,eAAe;EACb,UAAU;GAAE,MAAM;GAAiB,KAAK;GAAyB,CAAC;EAClE,UAAU;GACR,MAAM;GACN,KAAK;GACN,CAAC;EACF,UAAU;GACR,MAAM;GACN,KAAK;GACN,CAAC;EACF,UAAU;GAAE,MAAM;GAAsB,KAAK;GAAS,CAAC;EACxD,EACH,CAAC,aAAa,UAAU,CACzB;CAED,MAAM,UAAU,aACb,aAAgC;EAAE,GAAGC,sBAAkBC,QAAM;EAAE,GAAG,gBAAgBA,QAAM;EAAE,GAC3F,CAAC,cAAc,CAChB;CAED,MAAM,QAAQ,aACX,aAA8B;EAAE,GAAGC,oBAAgBD,QAAM;EAAE,GAAG,cAAcA,QAAM;EAAE,GACrF,CAAC,YAAY,CACd;CAED,MAAM,QAAQ,aACX,eAAe;AAMd,SAAO,MALW,oBAAoB;GACpC;GACA,cAAc,YAAY;GAC1B,cAAc,YAAY;GAC3B,CAAC,EACsB,UAAU;IAEpC;EAAC,YAAY;EAAc,YAAY;EAAc;EAAU,CAChE;AAED,QACE,8CACG,qBACC,aAAa,SAAS,KACtB,YAAY,KAAK,YAAY,oBAACE,sBAAyB,KAAK,WAAd,QAAyB,CAAC,EAC1E,oBAACC;EACC,eAAe;EACf,aAAa;EACN;EACP,GAAI;YAEJ,qBAACC,qCACE,qBAAqB,oBAACC,wBAAc,EAErC,oBAAC;GACY;GACX,OAAO;IAAE,WAAW;IAAW,WAAW;IAAW,OAAO;IAAW,GAAG;IAAO;aAEjF,oBAAC;IAAI,IAAI;IAAmB,KAAK;IAAW,OAAO,EAAE,SAAS,YAAY;cACxE,oBAACC;KAAkB,OAAO;KAAS;MAA6B;KAC5D;IACF,IACa;GACH,IACnB;EAGR;AAED,gBAAc,cAAc;AAE5B,4BAAeR"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { useAppElement } from "./AppElementContext.mjs";
|
|
1
2
|
import { LOBE_THEME_APP_ID } from "./constants.mjs";
|
|
2
3
|
import { MetaProps, ThemeProviderProps } from "./type.mjs";
|
|
3
4
|
import { Meta } from "./Meta.mjs";
|
|
4
5
|
import { ThemeProvider } from "./ThemeProvider.mjs";
|
|
5
|
-
export { LOBE_THEME_APP_ID, Meta, MetaProps, ThemeProviderProps, ThemeProvider as default };
|
|
6
|
+
export { LOBE_THEME_APP_ID, Meta, MetaProps, ThemeProviderProps, ThemeProvider as default, useAppElement };
|