@lobehub/ui 5.2.1 → 5.3.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/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/ImageSelect/ImageSelect.d.mts +2 -2
- package/es/Input/Input.d.mts +2 -2
- package/es/Input/InputNumber.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/Typography.d.mts +2 -2
- package/es/Markdown/components/SearchResultCards/index.d.mts +2 -2
- package/es/MaskShadow/MaskShadow.d.mts +2 -2
- package/es/Menu/Menu.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 +9 -9
- 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/ContextMenu/ContextMenuHost.mjs +2 -0
- package/es/base-ui/ContextMenu/ContextMenuHost.mjs.map +1 -1
- package/es/base-ui/ContextMenu/renderItems.mjs.map +1 -1
- 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 +19 -19
- 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/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/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 +2 -2
- package/es/icons/lucideExtra/DiscordIcon.d.mts +3 -3
- package/es/icons/lucideExtra/GlobeOffIcon.d.mts +3 -3
- package/es/icons/lucideExtra/GroupBotIcon.d.mts +3 -3
- 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/SkillsIcon.d.mts +3 -3
- 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
package/es/Image/Image.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.mjs","names":["Image","usePreview","Flexbox","AntImage"],"sources":["../../src/Image/Image.tsx"],"sourcesContent":["'use client';\n\nimport { Image as AntImage, Skeleton } from 'antd';\nimport { cssVar, cx, useThemeMode } from 'antd-style';\nimport { memo } from 'react';\n\nimport { Flexbox } from '@/Flex';\n\nimport usePreview from './components/usePreview';\nimport { FALLBACK_DARK, FALLBACK_LIGHT, styles, variants } from './style';\nimport type { ImageProps } from './type';\n\nconst Image = memo<ImageProps>(\n ({\n ref,\n style,\n preview,\n isLoading,\n maxHeight = '100%',\n maxWidth = '100%',\n minHeight,\n minWidth,\n actions,\n className,\n alwaysShowActions,\n variant = 'filled',\n objectFit = 'cover',\n classNames,\n styles: customStyles,\n onClick,\n width,\n height,\n ...rest\n }) => {\n const { isDarkMode } = useThemeMode();\n const actionsClassName = alwaysShowActions ? styles.actionsVisible : styles.actionsHidden;\n const
|
|
1
|
+
{"version":3,"file":"Image.mjs","names":["Image","usePreview","Flexbox","AntImage"],"sources":["../../src/Image/Image.tsx"],"sourcesContent":["'use client';\n\nimport { Image as AntImage, Skeleton } from 'antd';\nimport { cssVar, cx, useThemeMode } from 'antd-style';\nimport { memo } from 'react';\n\nimport { Flexbox } from '@/Flex';\n\nimport usePreview from './components/usePreview';\nimport { FALLBACK_DARK, FALLBACK_LIGHT, styles, variants } from './style';\nimport type { ImageProps } from './type';\n\nconst Image = memo<ImageProps>(\n ({\n ref,\n style,\n preview,\n isLoading,\n maxHeight = '100%',\n maxWidth = '100%',\n minHeight,\n minWidth,\n actions,\n className,\n alwaysShowActions,\n variant = 'filled',\n objectFit = 'cover',\n classNames,\n styles: customStyles,\n onClick,\n width,\n height,\n ...rest\n }) => {\n const { isDarkMode } = useThemeMode();\n const actionsClassName = alwaysShowActions ? styles.actionsVisible : styles.actionsHidden;\n const mergePreview = usePreview(preview);\n\n if (isLoading)\n return (\n <div onClick={onClick}>\n <Skeleton.Avatar\n active\n style={{\n borderRadius: cssVar.borderRadius,\n height,\n maxHeight,\n maxWidth,\n minHeight,\n minWidth,\n width,\n }}\n />\n </div>\n );\n\n return (\n <Flexbox className={cx(variants({ variant }), className)} ref={ref} style={style}>\n {actions && (\n <div className={cx(actionsClassName, alwaysShowActions ? '' : 'actions-hidden')}>\n {actions}\n </div>\n )}\n <AntImage\n className={cx(styles.image, classNames?.image)}\n fallback={isDarkMode ? FALLBACK_DARK : FALLBACK_LIGHT}\n height={height}\n loading={'lazy'}\n preview={preview === false ? false : (mergePreview as any)}\n width={width}\n classNames={{\n root: cx(styles.wrapper, classNames?.wrapper),\n }}\n style={{\n maxHeight,\n maxWidth,\n minHeight,\n minWidth,\n objectFit: objectFit || 'cover',\n ...customStyles?.image,\n }}\n styles={{\n root: customStyles?.wrapper,\n }}\n onClick={onClick}\n {...rest}\n />\n </Flexbox>\n );\n },\n);\n\nImage.displayName = 'Image';\n\nexport default Image;\n"],"mappings":";;;;;;;;;;;AAYA,MAAMA,UAAQ,MACX,EACC,KACA,OACA,SACA,WACA,YAAY,QACZ,WAAW,QACX,WACA,UACA,SACA,WACA,mBACA,UAAU,UACV,YAAY,SACZ,YACA,QAAQ,cACR,SACA,OACA,QACA,GAAG,WACC;CACJ,MAAM,EAAE,eAAe,cAAc;CACrC,MAAM,mBAAmB,oBAAoB,OAAO,iBAAiB,OAAO;CAC5E,MAAM,eAAeC,mBAAW,QAAQ;AAExC,KAAI,UACF,QACE,oBAAC;EAAa;YACZ,oBAAC,SAAS;GACR;GACA,OAAO;IACL,cAAc,OAAO;IACrB;IACA;IACA;IACA;IACA;IACA;IACD;IACD;GACE;AAGV,QACE,qBAACC;EAAQ,WAAW,GAAG,SAAS,EAAE,SAAS,CAAC,EAAE,UAAU;EAAO;EAAY;aACxE,WACC,oBAAC;GAAI,WAAW,GAAG,kBAAkB,oBAAoB,KAAK,iBAAiB;aAC5E;IACG,EAER,oBAACC;GACC,WAAW,GAAG,OAAO,OAAO,YAAY,MAAM;GAC9C,UAAU,aAAa,gBAAgB;GAC/B;GACR,SAAS;GACT,SAAS,YAAY,QAAQ,QAAS;GAC/B;GACP,YAAY,EACV,MAAM,GAAG,OAAO,SAAS,YAAY,QAAQ,EAC9C;GACD,OAAO;IACL;IACA;IACA;IACA;IACA,WAAW,aAAa;IACxB,GAAG,cAAc;IAClB;GACD,QAAQ,EACN,MAAM,cAAc,SACrB;GACQ;GACT,GAAI;IACJ;GACM;EAGf;AAED,QAAM,cAAc;AAEpB,oBAAeH"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PreviewGroupProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react69 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Image/PreviewGroup.d.ts
|
|
5
|
-
declare const PreviewGroup:
|
|
5
|
+
declare const PreviewGroup: react69.NamedExoticComponent<PreviewGroupProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { PreviewGroup };
|
|
8
8
|
//# sourceMappingURL=PreviewGroup.d.mts.map
|
|
@@ -1,46 +1,126 @@
|
|
|
1
1
|
import FlexBasic_default from "../../Flex/FlexBasic.mjs";
|
|
2
|
+
import TooltipGroup_default from "../../Tooltip/TooltipGroup.mjs";
|
|
2
3
|
import ActionIcon_default from "../../ActionIcon/ActionIcon.mjs";
|
|
4
|
+
import { useTranslation } from "../../i18n/useTranslation.mjs";
|
|
5
|
+
import { downloadBlob } from "../../utils/downloadBlob.mjs";
|
|
3
6
|
import { styles } from "../style.mjs";
|
|
4
|
-
import
|
|
7
|
+
import image_default from "../../i18n/resources/en/image.mjs";
|
|
8
|
+
import { getClipboardBlob } from "../../utils/blobToPng.mjs";
|
|
9
|
+
import { memo, useCallback, useState } from "react";
|
|
5
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import {
|
|
11
|
+
import { message } from "antd";
|
|
12
|
+
import { Copy, Download, FlipHorizontal, FlipVertical, RotateCcw, RotateCw, ZoomIn, ZoomOut } from "lucide-react";
|
|
7
13
|
|
|
8
14
|
//#region src/Image/components/Toolbar.tsx
|
|
15
|
+
const getFileNameFromUrl = (url) => {
|
|
16
|
+
try {
|
|
17
|
+
const match = new URL(url).pathname.match(/\/([^/]+)$/);
|
|
18
|
+
return match ? decodeURIComponent(match[1]) : "image";
|
|
19
|
+
} catch {
|
|
20
|
+
return "image";
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const getExtensionFromMimeType = (mimeType) => {
|
|
24
|
+
return {
|
|
25
|
+
"image/svg+xml": "svg",
|
|
26
|
+
"image/png": "png",
|
|
27
|
+
"image/jpeg": "jpg",
|
|
28
|
+
"image/jpg": "jpg",
|
|
29
|
+
"image/webp": "webp",
|
|
30
|
+
"image/gif": "gif"
|
|
31
|
+
}[mimeType?.toLowerCase()] || mimeType?.split("/")[1]?.split("+")[0] || "png";
|
|
32
|
+
};
|
|
9
33
|
const Toolbar = memo(({ children, info, minScale, maxScale }) => {
|
|
10
|
-
const {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
const { t } = useTranslation(image_default);
|
|
35
|
+
const [containerEl, setContainerEl] = useState(null);
|
|
36
|
+
const [copyLoading, setCopyLoading] = useState(false);
|
|
37
|
+
const [downloadLoading, setDownloadLoading] = useState(false);
|
|
38
|
+
const { transform: { scale }, actions: { onFlipY, onFlipX, onRotateLeft, onRotateRight, onZoomOut, onZoomIn }, image: { url } } = info;
|
|
39
|
+
const handleDownload = useCallback(async () => {
|
|
40
|
+
setDownloadLoading(true);
|
|
41
|
+
try {
|
|
42
|
+
const blob = await (await fetch(url, { mode: "cors" })).blob();
|
|
43
|
+
const blobUrl = URL.createObjectURL(blob);
|
|
44
|
+
let fileName = getFileNameFromUrl(url);
|
|
45
|
+
const ext = getExtensionFromMimeType(blob.type);
|
|
46
|
+
if (!fileName.includes(".")) fileName = `${fileName}.${ext}`;
|
|
47
|
+
else if (fileName.endsWith(".svg+xml")) fileName = fileName.replace(/\.svg\+xml$/i, ".svg");
|
|
48
|
+
await downloadBlob(blobUrl, fileName);
|
|
49
|
+
URL.revokeObjectURL(blobUrl);
|
|
50
|
+
message.success(t("image.downloadSuccess"));
|
|
51
|
+
} catch {
|
|
52
|
+
message.error(t("image.downloadFailed"));
|
|
53
|
+
} finally {
|
|
54
|
+
setDownloadLoading(false);
|
|
55
|
+
}
|
|
56
|
+
}, [url, t]);
|
|
57
|
+
const handleCopy = useCallback(async () => {
|
|
58
|
+
setCopyLoading(true);
|
|
59
|
+
try {
|
|
60
|
+
const clipboardBlob = await getClipboardBlob(await (await fetch(url, { mode: "cors" })).blob());
|
|
61
|
+
await navigator.clipboard.write([new ClipboardItem(clipboardBlob)]);
|
|
62
|
+
message.success(t("image.copySuccess"));
|
|
63
|
+
} catch {
|
|
64
|
+
message.error(t("image.copyFailed"));
|
|
65
|
+
} finally {
|
|
66
|
+
setCopyLoading(false);
|
|
67
|
+
}
|
|
68
|
+
}, [url, t]);
|
|
69
|
+
return /* @__PURE__ */ jsx(TooltipGroup_default, {
|
|
70
|
+
popupContainer: containerEl ?? void 0,
|
|
71
|
+
children: /* @__PURE__ */ jsxs(FlexBasic_default, {
|
|
72
|
+
horizontal: true,
|
|
73
|
+
className: styles.toolbar,
|
|
74
|
+
gap: 4,
|
|
75
|
+
ref: setContainerEl,
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ jsx(ActionIcon_default, {
|
|
78
|
+
icon: FlipHorizontal,
|
|
79
|
+
title: t("image.flipHorizontal"),
|
|
80
|
+
onClick: onFlipX
|
|
81
|
+
}),
|
|
82
|
+
/* @__PURE__ */ jsx(ActionIcon_default, {
|
|
83
|
+
icon: FlipVertical,
|
|
84
|
+
title: t("image.flipVertical"),
|
|
85
|
+
onClick: onFlipY
|
|
86
|
+
}),
|
|
87
|
+
/* @__PURE__ */ jsx(ActionIcon_default, {
|
|
88
|
+
icon: RotateCcw,
|
|
89
|
+
title: t("image.rotateLeft"),
|
|
90
|
+
onClick: onRotateLeft
|
|
91
|
+
}),
|
|
92
|
+
/* @__PURE__ */ jsx(ActionIcon_default, {
|
|
93
|
+
icon: RotateCw,
|
|
94
|
+
title: t("image.rotateRight"),
|
|
95
|
+
onClick: onRotateRight
|
|
96
|
+
}),
|
|
97
|
+
/* @__PURE__ */ jsx(ActionIcon_default, {
|
|
98
|
+
disabled: scale === minScale,
|
|
99
|
+
icon: ZoomOut,
|
|
100
|
+
title: t("image.zoomOut"),
|
|
101
|
+
onClick: onZoomOut
|
|
102
|
+
}),
|
|
103
|
+
/* @__PURE__ */ jsx(ActionIcon_default, {
|
|
104
|
+
disabled: scale === maxScale,
|
|
105
|
+
icon: ZoomIn,
|
|
106
|
+
title: t("image.zoomIn"),
|
|
107
|
+
onClick: onZoomIn
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ jsx(ActionIcon_default, {
|
|
110
|
+
icon: Copy,
|
|
111
|
+
loading: copyLoading,
|
|
112
|
+
title: t("image.copy"),
|
|
113
|
+
onClick: handleCopy
|
|
114
|
+
}),
|
|
115
|
+
/* @__PURE__ */ jsx(ActionIcon_default, {
|
|
116
|
+
icon: Download,
|
|
117
|
+
loading: downloadLoading,
|
|
118
|
+
title: t("image.download"),
|
|
119
|
+
onClick: handleDownload
|
|
120
|
+
}),
|
|
121
|
+
children
|
|
122
|
+
]
|
|
123
|
+
})
|
|
44
124
|
});
|
|
45
125
|
});
|
|
46
126
|
var Toolbar_default = Toolbar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.mjs","names":["Flexbox","ActionIcon"],"sources":["../../../src/Image/components/Toolbar.tsx"],"sourcesContent":["import { FlipHorizontal
|
|
1
|
+
{"version":3,"file":"Toolbar.mjs","names":["imageMessages","TooltipGroup","Flexbox","ActionIcon"],"sources":["../../../src/Image/components/Toolbar.tsx"],"sourcesContent":["import { message } from 'antd';\nimport {\n Copy,\n Download,\n FlipHorizontal,\n FlipVertical,\n RotateCcw,\n RotateCw,\n ZoomIn,\n ZoomOut,\n} from 'lucide-react';\nimport { type ToolbarRenderInfoType } from 'rc-image/lib/Preview';\nimport { memo, type ReactNode, useCallback, useState } from 'react';\n\nimport ActionIcon from '@/ActionIcon';\nimport { Flexbox } from '@/Flex';\nimport imageMessages from '@/i18n/resources/en/image';\nimport { useTranslation } from '@/i18n/useTranslation';\nimport { TooltipGroup } from '@/Tooltip';\nimport { getClipboardBlob } from '@/utils/blobToPng';\nimport { downloadBlob } from '@/utils/downloadBlob';\n\nimport { styles } from '../style';\n\nconst getFileNameFromUrl = (url: string): string => {\n try {\n const pathname = new URL(url).pathname;\n const match = pathname.match(/\\/([^/]+)$/);\n return match ? decodeURIComponent(match[1]) : 'image';\n } catch {\n return 'image';\n }\n};\n\nconst getExtensionFromMimeType = (mimeType: string): string => {\n const map: Record<string, string> = {\n 'image/svg+xml': 'svg',\n 'image/png': 'png',\n 'image/jpeg': 'jpg',\n 'image/jpg': 'jpg',\n 'image/webp': 'webp',\n 'image/gif': 'gif',\n };\n return map[mimeType?.toLowerCase()] || mimeType?.split('/')[1]?.split('+')[0] || 'png';\n};\n\nexport interface ToolbarProps {\n children?: ReactNode;\n info: Omit<ToolbarRenderInfoType, 'current' | 'total'>;\n maxScale: number;\n minScale: number;\n}\n\nconst Toolbar = memo<ToolbarProps>(({ children, info, minScale, maxScale }) => {\n const { t } = useTranslation(imageMessages);\n const [containerEl, setContainerEl] = useState<HTMLElement | null>(null);\n const [copyLoading, setCopyLoading] = useState(false);\n const [downloadLoading, setDownloadLoading] = useState(false);\n const {\n transform: { scale },\n actions: { onFlipY, onFlipX, onRotateLeft, onRotateRight, onZoomOut, onZoomIn },\n image: { url },\n } = info;\n\n const handleDownload = useCallback(async () => {\n setDownloadLoading(true);\n try {\n const response = await fetch(url, { mode: 'cors' });\n const blob = await response.blob();\n const blobUrl = URL.createObjectURL(blob);\n let fileName = getFileNameFromUrl(url);\n const ext = getExtensionFromMimeType(blob.type);\n if (!fileName.includes('.')) {\n fileName = `${fileName}.${ext}`;\n } else if (fileName.endsWith('.svg+xml')) {\n fileName = fileName.replace(/\\.svg\\+xml$/i, '.svg');\n }\n await downloadBlob(blobUrl, fileName);\n URL.revokeObjectURL(blobUrl);\n message.success(t('image.downloadSuccess'));\n } catch {\n message.error(t('image.downloadFailed'));\n } finally {\n setDownloadLoading(false);\n }\n }, [url, t]);\n\n const handleCopy = useCallback(async () => {\n setCopyLoading(true);\n try {\n const response = await fetch(url, { mode: 'cors' });\n const blob = await response.blob();\n const clipboardBlob = await getClipboardBlob(blob);\n await navigator.clipboard.write([new ClipboardItem(clipboardBlob)]);\n message.success(t('image.copySuccess'));\n } catch {\n message.error(t('image.copyFailed'));\n } finally {\n setCopyLoading(false);\n }\n }, [url, t]);\n\n return (\n <TooltipGroup popupContainer={containerEl ?? undefined}>\n <Flexbox horizontal className={styles.toolbar} gap={4} ref={setContainerEl}>\n <ActionIcon icon={FlipHorizontal} title={t('image.flipHorizontal')} onClick={onFlipX} />\n <ActionIcon icon={FlipVertical} title={t('image.flipVertical')} onClick={onFlipY} />\n <ActionIcon icon={RotateCcw} title={t('image.rotateLeft')} onClick={onRotateLeft} />\n <ActionIcon icon={RotateCw} title={t('image.rotateRight')} onClick={onRotateRight} />\n <ActionIcon\n disabled={scale === minScale}\n icon={ZoomOut}\n title={t('image.zoomOut')}\n onClick={onZoomOut}\n />\n <ActionIcon\n disabled={scale === maxScale}\n icon={ZoomIn}\n title={t('image.zoomIn')}\n onClick={onZoomIn}\n />\n <ActionIcon\n icon={Copy}\n loading={copyLoading}\n title={t('image.copy')}\n onClick={handleCopy}\n />\n <ActionIcon\n icon={Download}\n loading={downloadLoading}\n title={t('image.download')}\n onClick={handleDownload}\n />\n {children}\n </Flexbox>\n </TooltipGroup>\n );\n});\n\nexport default Toolbar;\n"],"mappings":"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"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ImageSelectProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react81 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/ImageSelect/ImageSelect.d.ts
|
|
5
|
-
declare const ImageSelect:
|
|
5
|
+
declare const ImageSelect: react81.NamedExoticComponent<ImageSelectProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { ImageSelect };
|
|
8
8
|
//# sourceMappingURL=ImageSelect.d.mts.map
|
package/es/Input/Input.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { InputProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react121 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Input/Input.d.ts
|
|
5
|
-
declare const Input:
|
|
5
|
+
declare const Input: react121.NamedExoticComponent<InputProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Input };
|
|
8
8
|
//# sourceMappingURL=Input.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { InputNumberProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react123 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Input/InputNumber.d.ts
|
|
5
|
-
declare const InputNumber:
|
|
5
|
+
declare const InputNumber: react123.NamedExoticComponent<InputNumberProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { InputNumber };
|
|
8
8
|
//# sourceMappingURL=InputNumber.d.mts.map
|
package/es/Input/InputOPT.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { InputOPTProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react124 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Input/InputOPT.d.ts
|
|
5
|
-
declare const InputOPT:
|
|
5
|
+
declare const InputOPT: react124.NamedExoticComponent<InputOPTProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { InputOPT };
|
|
8
8
|
//# sourceMappingURL=InputOPT.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { InputPasswordProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react125 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Input/InputPassword.d.ts
|
|
5
|
-
declare const InputPassword:
|
|
5
|
+
declare const InputPassword: react125.NamedExoticComponent<InputPasswordProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { InputPassword };
|
|
8
8
|
//# sourceMappingURL=InputPassword.d.mts.map
|
package/es/Input/TextArea.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TextAreaProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react126 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Input/TextArea.d.ts
|
|
5
|
-
declare const TextArea:
|
|
5
|
+
declare const TextArea: react126.NamedExoticComponent<TextAreaProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { TextArea };
|
|
8
8
|
//# sourceMappingURL=TextArea.d.mts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DivProps } from "../../types/index.mjs";
|
|
2
2
|
import "../../index.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react62 from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/Layout/components/LayoutFooter.d.ts
|
|
6
|
-
declare const LayoutFooter:
|
|
6
|
+
declare const LayoutFooter: react62.NamedExoticComponent<DivProps>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { LayoutFooter };
|
|
9
9
|
//# sourceMappingURL=LayoutFooter.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LayoutHeaderProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react64 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Layout/components/LayoutHeader.d.ts
|
|
5
|
-
declare const LayoutHeader:
|
|
5
|
+
declare const LayoutHeader: react64.NamedExoticComponent<LayoutHeaderProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { LayoutHeader };
|
|
8
8
|
//# sourceMappingURL=LayoutHeader.d.mts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DivProps } from "../../types/index.mjs";
|
|
2
2
|
import "../../index.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react63 from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/Layout/components/LayoutMain.d.ts
|
|
6
|
-
declare const LayoutMain:
|
|
6
|
+
declare const LayoutMain: react63.NamedExoticComponent<DivProps>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { LayoutMain };
|
|
9
9
|
//# sourceMappingURL=LayoutMain.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LayoutSidebarProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react66 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Layout/components/LayoutSidebar.d.ts
|
|
5
|
-
declare const LayoutSidebar:
|
|
5
|
+
declare const LayoutSidebar: react66.NamedExoticComponent<LayoutSidebarProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { LayoutSidebar };
|
|
8
8
|
//# sourceMappingURL=LayoutSidebar.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LayoutSidebarInnerProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react65 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Layout/components/LayoutSidebarInner.d.ts
|
|
5
|
-
declare const LayoutSidebarInner:
|
|
5
|
+
declare const LayoutSidebarInner: react65.NamedExoticComponent<LayoutSidebarInnerProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { LayoutSidebarInner };
|
|
8
8
|
//# sourceMappingURL=LayoutSidebarInner.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LayoutTocProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react67 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Layout/components/LayoutToc.d.ts
|
|
5
|
-
declare const LayoutToc:
|
|
5
|
+
declare const LayoutToc: react67.NamedExoticComponent<LayoutTocProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { LayoutToc };
|
|
8
8
|
//# sourceMappingURL=LayoutToc.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ListItemProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react68 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/List/ListItem/index.d.ts
|
|
5
|
-
declare const ListItem:
|
|
5
|
+
declare const ListItem: react68.NamedExoticComponent<ListItemProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { ListItem };
|
|
8
8
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MarkdownProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react58 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Markdown/Markdown.d.ts
|
|
5
|
-
declare const Markdown:
|
|
5
|
+
declare const Markdown: react58.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 react57 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Markdown/Typography.d.ts
|
|
5
|
-
declare const Typography:
|
|
5
|
+
declare const Typography: react57.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 react30 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: react30.NamedExoticComponent<SearchResultCardsProps>;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { SearchResultCards, SearchResultCardsProps };
|
|
20
20
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MaskShadowProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react56 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/MaskShadow/MaskShadow.d.ts
|
|
5
|
-
declare const MaskShadow:
|
|
5
|
+
declare const MaskShadow: react56.NamedExoticComponent<MaskShadowProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { MaskShadow };
|
|
8
8
|
//# sourceMappingURL=MaskShadow.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 react61 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Menu/Menu.d.ts
|
|
5
|
-
declare const Menu:
|
|
5
|
+
declare const Menu: react61.NamedExoticComponent<MenuProps<unknown>>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Menu };
|
|
8
8
|
//# sourceMappingURL=Menu.d.mts.map
|
package/es/Modal/Modal.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ModalProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react49 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Modal/Modal.d.ts
|
|
5
|
-
declare const Modal:
|
|
5
|
+
declare const Modal: react49.NamedExoticComponent<ModalProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Modal };
|
|
8
8
|
//# sourceMappingURL=Modal.d.mts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ModalContextValue } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react50 from "react";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/Modal/ModalProvider.d.ts
|
|
6
|
-
declare const ModalProvider:
|
|
6
|
+
declare const ModalProvider: react50.NamedExoticComponent<{
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
value: ModalContextValue;
|
|
9
9
|
}>;
|
|
@@ -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_runtime11 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_runtime11.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 react31 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: react31.NamedExoticComponent<{
|
|
10
10
|
children: ReactNode;
|
|
11
11
|
motion: MotionComponentType;
|
|
12
12
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime12 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/Popover/ArrowIcon.d.ts
|
|
4
|
-
declare const PopoverArrowIcon:
|
|
4
|
+
declare const PopoverArrowIcon: react_jsx_runtime12.JSX.Element;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { PopoverArrowIcon };
|
|
7
7
|
//# sourceMappingURL=ArrowIcon.d.mts.map
|
package/es/Popover/atoms.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { PopoverPlacement } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react54 from "react";
|
|
3
3
|
import { ComponentProps, ComponentPropsWithRef } from "react";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime13 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: react54.ForwardRefExoticComponent<_base_ui_react_popover0.PopoverBackdropProps & react54.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_runtime13.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_runtime13.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_runtime13.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_runtime13.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_runtime13.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_runtime13.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 react52 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: react52.NamedExoticComponent<{
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
value: PopoverContextValue;
|
|
11
11
|
}>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SearchBarProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react47 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/SearchBar/SearchBar.d.ts
|
|
5
|
-
declare const SearchBar:
|
|
5
|
+
declare const SearchBar: react47.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 react46 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Segmented/Segmented.d.ts
|
|
5
|
-
declare const Segmented:
|
|
5
|
+
declare const Segmented: react46.NamedExoticComponent<SegmentedProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Segmented };
|
|
8
8
|
//# sourceMappingURL=Segmented.d.mts.map
|