@lobehub/ui 5.2.2 → 5.4.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/AutoComplete/Select.d.mts +2 -2
- 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/ConfigProvider/index.d.mts +2 -2
- 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/EditableText/EditableText.d.mts +2 -2
- package/es/EditorSlashMenu/atoms.d.mts +13 -13
- 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/HotkeyInput/HotkeyInput.mjs +30 -8
- package/es/HotkeyInput/HotkeyInput.mjs.map +1 -1
- package/es/HotkeyInput/type.d.mts +3 -0
- package/es/Icon/Icon.d.mts +2 -2
- package/es/Icon/components/IconProvider.d.mts +3 -3
- package/es/Image/Image.mjs +2 -2
- package/es/Image/Image.mjs.map +1 -1
- package/es/Image/PreviewGroup.d.mts +2 -2
- package/es/Image/components/Toolbar.mjs +116 -36
- package/es/Image/components/Toolbar.mjs.map +1 -1
- package/es/Input/Input.d.mts +2 -2
- package/es/Input/InputOPT.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/Markdown/Markdown.d.mts +2 -2
- package/es/Markdown/Markdown.mjs +2 -1
- package/es/Markdown/Markdown.mjs.map +1 -1
- package/es/Markdown/SyntaxMarkdown/StreamdownRender.mjs +56 -30
- package/es/Markdown/SyntaxMarkdown/StreamdownRender.mjs.map +1 -1
- package/es/Markdown/SyntaxMarkdown/style.mjs +2 -2
- package/es/Markdown/SyntaxMarkdown/style.mjs.map +1 -1
- package/es/Markdown/SyntaxMarkdown/useSmoothStreamContent.mjs +229 -0
- package/es/Markdown/SyntaxMarkdown/useSmoothStreamContent.mjs.map +1 -0
- package/es/Markdown/SyntaxMarkdown/useStreamQueue.mjs +8 -6
- package/es/Markdown/SyntaxMarkdown/useStreamQueue.mjs.map +1 -1
- package/es/Markdown/Typography.d.mts +2 -2
- package/es/Markdown/components/SearchResultCards/index.d.mts +2 -2
- package/es/Markdown/index.d.mts +2 -2
- package/es/Markdown/plugins/rehypeStreamAnimated.d.mts +2 -0
- package/es/Markdown/plugins/rehypeStreamAnimated.mjs +17 -5
- package/es/Markdown/plugins/rehypeStreamAnimated.mjs.map +1 -1
- package/es/Markdown/type.d.mts +3 -1
- package/es/MaskShadow/MaskShadow.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/Modal.d.mts +2 -2
- package/es/Modal/ModalProvider.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/atoms.d.mts +2 -2
- package/es/Popover/context.d.mts +2 -2
- 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/ThemeProvider.d.mts +2 -2
- package/es/Toc/Toc.d.mts +2 -2
- package/es/Tooltip/TooltipGroup.mjs +4 -3
- package/es/Tooltip/TooltipGroup.mjs.map +1 -1
- package/es/Tooltip/TooltipStandalone.mjs +18 -5
- package/es/Tooltip/TooltipStandalone.mjs.map +1 -1
- package/es/Tooltip/type.d.mts +7 -0
- package/es/Tooltip/useMergedTooltipProps.mjs +4 -1
- package/es/Tooltip/useMergedTooltipProps.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/base-ui/DropdownMenu/DropdownMenu.d.mts +2 -2
- package/es/base-ui/DropdownMenu/atoms.d.mts +18 -18
- package/es/base-ui/Modal/atoms.d.mts +12 -12
- package/es/base-ui/Modal/context.d.mts +2 -2
- package/es/base-ui/Modal/imperative.d.mts +2 -2
- package/es/base-ui/ScrollArea/atoms.d.mts +7 -7
- package/es/base-ui/Select/Select.d.mts +2 -2
- package/es/base-ui/Select/atoms.d.mts +3 -3
- package/es/base-ui/Switch/Switch.d.mts +2 -2
- package/es/base-ui/Switch/atoms.d.mts +4 -4
- package/es/base-ui/Toast/imperative.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/i18n/resources/en/hotkey.d.mts +1 -0
- package/es/i18n/resources/en/hotkey.mjs +1 -0
- package/es/i18n/resources/en/hotkey.mjs.map +1 -1
- package/es/i18n/resources/en/image.d.mts +18 -0
- package/es/i18n/resources/en/image.mjs +19 -0
- package/es/i18n/resources/en/image.mjs.map +1 -0
- package/es/i18n/resources/en/index.d.mts +4 -3
- package/es/i18n/resources/en/index.mjs +2 -0
- package/es/i18n/resources/en/index.mjs.map +1 -1
- package/es/i18n/resources/zhCn/hotkey.d.mts +1 -0
- package/es/i18n/resources/zhCn/hotkey.mjs +1 -0
- package/es/i18n/resources/zhCn/hotkey.mjs.map +1 -1
- package/es/i18n/resources/zhCn/image.d.mts +18 -0
- package/es/i18n/resources/zhCn/image.mjs +19 -0
- package/es/i18n/resources/zhCn/image.mjs.map +1 -0
- package/es/i18n/resources/zhCn/index.d.mts +4 -3
- package/es/i18n/resources/zhCn/index.mjs +2 -0
- package/es/i18n/resources/zhCn/index.mjs.map +1 -1
- package/es/i18n/types.d.mts +4 -3
- 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 +3 -3
- package/es/icons/lucideExtra/GroupBotSquareIcon.d.mts +2 -2
- package/es/icons/lucideExtra/LeftClickIcon.d.mts +3 -3
- package/es/icons/lucideExtra/LeftDoubleClickIcon.d.mts +2 -2
- 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/SkillsIcon.d.mts +2 -2
- package/es/icons/lucideExtra/TreeDownRightIcon.d.mts +3 -3
- package/es/icons/lucideExtra/TreeUpDownRightIcon.d.mts +3 -3
- 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/mobile/TabBar/TabBar.d.mts +2 -2
- package/es/storybook/StoryBook/index.d.mts +2 -2
- package/es/utils/blobToPng.mjs +41 -0
- package/es/utils/blobToPng.mjs.map +1 -0
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ChatHeaderTitleProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react121 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/mobile/ChatHeader/ChatHeaderTitle.d.ts
|
|
5
|
-
declare const ChatHeaderTitle:
|
|
5
|
+
declare const ChatHeaderTitle: react121.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
|
|
2
|
+
import * as react122 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/mobile/ChatInputArea/components/ChatSendButton.d.ts
|
|
5
|
-
declare const ChatSendButton:
|
|
5
|
+
declare const ChatSendButton: react122.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
|
|
2
|
+
import * as react120 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/mobile/TabBar/TabBar.d.ts
|
|
5
|
-
declare const TabBar:
|
|
5
|
+
declare const TabBar: react120.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
|
|
3
|
+
import * as react58 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:
|
|
13
|
+
declare const StoryBook: react58.NamedExoticComponent<StoryBookProps>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { StoryBook, StoryBookProps, useControls, useCreateStore };
|
|
16
16
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//#region src/utils/blobToPng.ts
|
|
2
|
+
/**
|
|
3
|
+
* Convert image blob to PNG format.
|
|
4
|
+
* Clipboard API only supports image/png and image/svg+xml.
|
|
5
|
+
* WebP, JPEG and other formats need to be converted for clipboard copy.
|
|
6
|
+
*/
|
|
7
|
+
const blobToPng = (blob) => new Promise((resolve, reject) => {
|
|
8
|
+
const img = new Image();
|
|
9
|
+
const url = URL.createObjectURL(blob);
|
|
10
|
+
img.onload = () => {
|
|
11
|
+
URL.revokeObjectURL(url);
|
|
12
|
+
const canvas = document.createElement("canvas");
|
|
13
|
+
canvas.width = img.naturalWidth;
|
|
14
|
+
canvas.height = img.naturalHeight;
|
|
15
|
+
const ctx = canvas.getContext("2d");
|
|
16
|
+
if (!ctx) {
|
|
17
|
+
reject(/* @__PURE__ */ new Error("Canvas context not available"));
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
ctx.drawImage(img, 0, 0);
|
|
21
|
+
canvas.toBlob((pngBlob) => {
|
|
22
|
+
if (pngBlob) resolve(pngBlob);
|
|
23
|
+
else reject(/* @__PURE__ */ new Error("Failed to convert to PNG"));
|
|
24
|
+
}, "image/png", 1);
|
|
25
|
+
};
|
|
26
|
+
img.onerror = () => {
|
|
27
|
+
URL.revokeObjectURL(url);
|
|
28
|
+
reject(/* @__PURE__ */ new Error("Failed to load image"));
|
|
29
|
+
};
|
|
30
|
+
img.src = url;
|
|
31
|
+
});
|
|
32
|
+
const getClipboardBlob = async (blob) => {
|
|
33
|
+
const type = (blob.type || "").toLowerCase();
|
|
34
|
+
if (type === "image/png" || type === "image/svg+xml") return { [type]: blob };
|
|
35
|
+
const pngBlob = await blobToPng(blob);
|
|
36
|
+
return { "image/png": pngBlob };
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
export { getClipboardBlob };
|
|
41
|
+
//# sourceMappingURL=blobToPng.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blobToPng.mjs","names":[],"sources":["../../src/utils/blobToPng.ts"],"sourcesContent":["/**\n * Convert image blob to PNG format.\n * Clipboard API only supports image/png and image/svg+xml.\n * WebP, JPEG and other formats need to be converted for clipboard copy.\n */\nexport const blobToPng = (blob: Blob): Promise<Blob> =>\n new Promise((resolve, reject) => {\n const img = new Image();\n const url = URL.createObjectURL(blob);\n\n img.onload = () => {\n URL.revokeObjectURL(url);\n const canvas = document.createElement('canvas');\n canvas.width = img.naturalWidth;\n canvas.height = img.naturalHeight;\n const ctx = canvas.getContext('2d');\n if (!ctx) {\n reject(new Error('Canvas context not available'));\n return;\n }\n ctx.drawImage(img, 0, 0);\n canvas.toBlob(\n (pngBlob) => {\n if (pngBlob) {\n resolve(pngBlob);\n } else {\n reject(new Error('Failed to convert to PNG'));\n }\n },\n 'image/png',\n 1,\n );\n };\n\n img.onerror = () => {\n URL.revokeObjectURL(url);\n reject(new Error('Failed to load image'));\n };\n\n img.src = url;\n });\n\nconst CLIPBOARD_SUPPORTED_TYPES = ['image/png', 'image/svg+xml'] as const;\n\nexport const getClipboardBlob = async (\n blob: Blob,\n): Promise<{ 'image/png': Blob } | { 'image/svg+xml': Blob }> => {\n const type = (blob.type || '').toLowerCase();\n\n if (type === 'image/png' || type === 'image/svg+xml') {\n return { [type]: blob } as { 'image/png': Blob } | { 'image/svg+xml': Blob };\n }\n\n const pngBlob = await blobToPng(blob);\n return { 'image/png': pngBlob };\n};\n"],"mappings":";;;;;;AAKA,MAAa,aAAa,SACxB,IAAI,SAAS,SAAS,WAAW;CAC/B,MAAM,MAAM,IAAI,OAAO;CACvB,MAAM,MAAM,IAAI,gBAAgB,KAAK;AAErC,KAAI,eAAe;AACjB,MAAI,gBAAgB,IAAI;EACxB,MAAM,SAAS,SAAS,cAAc,SAAS;AAC/C,SAAO,QAAQ,IAAI;AACnB,SAAO,SAAS,IAAI;EACpB,MAAM,MAAM,OAAO,WAAW,KAAK;AACnC,MAAI,CAAC,KAAK;AACR,0BAAO,IAAI,MAAM,+BAA+B,CAAC;AACjD;;AAEF,MAAI,UAAU,KAAK,GAAG,EAAE;AACxB,SAAO,QACJ,YAAY;AACX,OAAI,QACF,SAAQ,QAAQ;OAEhB,wBAAO,IAAI,MAAM,2BAA2B,CAAC;KAGjD,aACA,EACD;;AAGH,KAAI,gBAAgB;AAClB,MAAI,gBAAgB,IAAI;AACxB,yBAAO,IAAI,MAAM,uBAAuB,CAAC;;AAG3C,KAAI,MAAM;EACV;AAIJ,MAAa,mBAAmB,OAC9B,SAC+D;CAC/D,MAAM,QAAQ,KAAK,QAAQ,IAAI,aAAa;AAE5C,KAAI,SAAS,eAAe,SAAS,gBACnC,QAAO,GAAG,OAAO,MAAM;CAGzB,MAAM,UAAU,MAAM,UAAU,KAAK;AACrC,QAAO,EAAE,aAAa,SAAS"}
|