@lobehub/ui 4.1.0 → 4.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/README.md +1 -1
  2. package/es/Accordion/Accordion.d.mts +2 -2
  3. package/es/Accordion/AccordionItem.d.mts +2 -2
  4. package/es/Accordion/AccordionItem.mjs +4 -4
  5. package/es/Accordion/AccordionItem.mjs.map +1 -1
  6. package/es/ActionIcon/ActionIcon.d.mts +2 -2
  7. package/es/ActionIcon/components/utils.mjs +1 -1
  8. package/es/ActionIcon/components/utils.mjs.map +1 -1
  9. package/es/Alert/Alert.d.mts +2 -2
  10. package/es/Alert/Alert.mjs +1 -1
  11. package/es/Alert/Alert.mjs.map +1 -1
  12. package/es/AutoComplete/Select.d.mts +2 -2
  13. package/es/Avatar/AvatarGroup/index.d.mts +2 -2
  14. package/es/Burger/Burger.d.mts +2 -2
  15. package/es/CodeEditor/CodeEditor.d.mts +2 -2
  16. package/es/Collapse/Collapse.d.mts +2 -2
  17. package/es/ConfigProvider/index.d.mts +2 -2
  18. package/es/CopyButton/CopyButton.d.mts +2 -2
  19. package/es/DatePicker/DatePicker.d.mts +2 -2
  20. package/es/DraggablePanel/components/DraggablePanelBody.d.mts +2 -2
  21. package/es/DraggablePanel/components/DraggablePanelContainer.d.mts +2 -2
  22. package/es/DraggablePanel/components/DraggablePanelFooter.d.mts +2 -2
  23. package/es/DraggablePanel/components/DraggablePanelHeader.d.mts +2 -2
  24. package/es/DraggableSideNav/DraggableSideNav.d.mts +2 -2
  25. package/es/Drawer/Drawer.d.mts +2 -2
  26. package/es/Dropdown/Dropdown.d.mts +2 -2
  27. package/es/EditableText/EditableText.d.mts +2 -2
  28. package/es/EmojiPicker/EmojiPicker.d.mts +2 -2
  29. package/es/Flex/FlexBasic.d.mts +2 -2
  30. package/es/FontLoader/index.d.mts +2 -2
  31. package/es/Footer/Footer.d.mts +2 -2
  32. package/es/Form/Form.mjs +1 -1
  33. package/es/Form/Form.mjs.map +1 -1
  34. package/es/Form/components/FormGroup.d.mts +2 -2
  35. package/es/Form/components/FormGroup.mjs +1 -1
  36. package/es/Form/components/FormGroup.mjs.map +1 -1
  37. package/es/Form/components/FormItem.d.mts +2 -2
  38. package/es/Form/components/FormSubmitFooter.d.mts +2 -2
  39. package/es/Form/components/FormSubmitFooter.mjs +3 -3
  40. package/es/Form/components/FormSubmitFooter.mjs.map +1 -1
  41. package/es/Form/components/merge.mjs +1 -1
  42. package/es/Form/components/merge.mjs.map +1 -1
  43. package/es/Form/style.mjs +6 -6
  44. package/es/Form/style.mjs.map +1 -1
  45. package/es/FormModal/FormModal.d.mts +2 -2
  46. package/es/Grid/style.mjs +1 -1
  47. package/es/Grid/style.mjs.map +1 -1
  48. package/es/GuideCard/GuideCard.d.mts +2 -2
  49. package/es/Header/Header.d.mts +2 -2
  50. package/es/Highlighter/Highlighter.d.mts +2 -2
  51. package/es/Highlighter/SyntaxHighlighter/index.d.mts +2 -2
  52. package/es/Hotkey/Hotkey.d.mts +2 -2
  53. package/es/HotkeyInput/HotkeyInput.d.mts +2 -2
  54. package/es/HotkeyInput/HotkeyInput.mjs +1 -1
  55. package/es/HotkeyInput/HotkeyInput.mjs.map +1 -1
  56. package/es/Icon/Icon.d.mts +2 -2
  57. package/es/Icon/components/IconProvider.d.mts +3 -3
  58. package/es/Icon/components/utils.mjs +1 -1
  59. package/es/Icon/components/utils.mjs.map +1 -1
  60. package/es/Image/PreviewGroup.d.mts +2 -2
  61. package/es/ImageSelect/ImageSelect.d.mts +2 -2
  62. package/es/Input/Input.d.mts +2 -2
  63. package/es/Input/InputOPT.d.mts +2 -2
  64. package/es/Input/InputPassword.d.mts +2 -2
  65. package/es/Layout/components/LayoutFooter.d.mts +2 -2
  66. package/es/Layout/components/LayoutHeader.d.mts +2 -2
  67. package/es/Layout/components/LayoutMain.d.mts +2 -2
  68. package/es/Layout/components/LayoutSidebar.d.mts +2 -2
  69. package/es/Layout/components/LayoutSidebarInner.d.mts +2 -2
  70. package/es/Layout/components/LayoutToc.d.mts +2 -2
  71. package/es/List/ListItem/index.d.mts +2 -2
  72. package/es/Markdown/Markdown.d.mts +2 -2
  73. package/es/Markdown/Typography.d.mts +2 -2
  74. package/es/Markdown/components/SearchResultCards/index.d.mts +2 -2
  75. package/es/MaskShadow/MaskShadow.d.mts +2 -2
  76. package/es/Menu/Menu.d.mts +2 -2
  77. package/es/Mermaid/Mermaid.d.mts +2 -2
  78. package/es/Mermaid/SyntaxMermaid/index.d.mts +2 -2
  79. package/es/Mermaid/SyntaxMermaid/index.mjs +1 -1
  80. package/es/Mermaid/SyntaxMermaid/index.mjs.map +1 -1
  81. package/es/Modal/Modal.d.mts +2 -2
  82. package/es/MotionProvider/index.d.mts +4 -3
  83. package/es/MotionProvider/index.mjs +2 -2
  84. package/es/MotionProvider/index.mjs.map +1 -1
  85. package/es/SearchBar/SearchBar.d.mts +2 -2
  86. package/es/Segmented/Segmented.d.mts +2 -2
  87. package/es/Select/Select.d.mts +2 -2
  88. package/es/SideNav/SideNav.d.mts +2 -2
  89. package/es/SliderWithInput/SliderWithInput.d.mts +2 -2
  90. package/es/SliderWithInput/SliderWithInput.mjs +1 -1
  91. package/es/SliderWithInput/SliderWithInput.mjs.map +1 -1
  92. package/es/SortableList/components/DragHandle.d.mts +2 -2
  93. package/es/SortableList/components/SortableItem.d.mts +2 -2
  94. package/es/Tag/utils.mjs +1 -1
  95. package/es/Tag/utils.mjs.map +1 -1
  96. package/es/ThemeProvider/ThemeProvider.d.mts +2 -2
  97. package/es/ThemeProvider/ThemeProvider.mjs +5 -12
  98. package/es/ThemeProvider/ThemeProvider.mjs.map +1 -1
  99. package/es/ThemeProvider/type.d.mts +0 -4
  100. package/es/Toc/Toc.d.mts +2 -2
  101. package/es/Tooltip/TooltipFloating.mjs +6 -5
  102. package/es/Tooltip/TooltipFloating.mjs.map +1 -1
  103. package/es/Video/index.d.mts +2 -2
  104. package/es/awesome/AuroraBackground/AuroraBackground.d.mts +2 -2
  105. package/es/awesome/Features/Features.d.mts +2 -2
  106. package/es/awesome/Giscus/Giscus.d.mts +2 -2
  107. package/es/awesome/GradientButton/GradientButton.d.mts +2 -2
  108. package/es/awesome/GridBackground/GridBackground.d.mts +2 -2
  109. package/es/awesome/GridBackground/GridBackground.mjs +1 -1
  110. package/es/awesome/GridBackground/GridBackground.mjs.map +1 -1
  111. package/es/awesome/GridBackground/GridShowcase.d.mts +2 -2
  112. package/es/awesome/GridBackground/components/Grid.mjs +1 -1
  113. package/es/awesome/GridBackground/components/Grid.mjs.map +1 -1
  114. package/es/awesome/Hero/Hero.d.mts +2 -2
  115. package/es/awesome/Spline/ParentSize.mjs +1 -1
  116. package/es/awesome/Spline/ParentSize.mjs.map +1 -1
  117. package/es/awesome/Spotlight/Spotlight.d.mts +2 -2
  118. package/es/awesome/TypewriterEffect/TypewriterEffect.d.mts +2 -2
  119. package/es/awesome/TypewriterEffect/TypewriterEffect.mjs +3 -3
  120. package/es/awesome/TypewriterEffect/TypewriterEffect.mjs.map +1 -1
  121. package/es/brand/BrandLoading/{style-Cof4dJBw.css → style-BpgFy1wc.css} +1 -1
  122. package/es/brand/BrandLoading/{style-Cof4dJBw.css.map → style-BpgFy1wc.css.map} +1 -1
  123. package/es/brand/LobeChat/index.d.mts +2 -2
  124. package/es/brand/LobeHub/index.d.mts +2 -2
  125. package/es/brand/LogoThree/LogoSpline.d.mts +2 -2
  126. package/es/brand/LogoThree/index.d.mts +2 -2
  127. package/es/chat/BackBottom/BackBottom.d.mts +2 -2
  128. package/es/chat/ChatInputArea/components/ChatInputAreaInner.d.mts +2 -2
  129. package/es/chat/ChatItem/ChatItem.d.mts +2 -2
  130. package/es/chat/ChatList/ChatList.d.mts +2 -2
  131. package/es/chat/EditableMessageList/EditableMessageList.d.mts +2 -2
  132. package/es/chat/MessageInput/MessageInput.d.mts +2 -2
  133. package/es/chat/MessageModal/MessageModal.d.mts +2 -2
  134. package/es/color/ColorScales/index.d.mts +2 -2
  135. package/es/i18n/context.d.mts +2 -2
  136. package/es/icons/lucideExtra/BotPromptIcon.d.mts +2 -2
  137. package/es/icons/lucideExtra/CreateBotIcon.d.mts +2 -2
  138. package/es/icons/lucideExtra/DiscordIcon.d.mts +2 -2
  139. package/es/icons/lucideExtra/GlobeOffIcon.d.mts +2 -2
  140. package/es/icons/lucideExtra/GroupBotIcon.d.mts +2 -2
  141. package/es/icons/lucideExtra/GroupBotSquareIcon.d.mts +3 -3
  142. package/es/icons/lucideExtra/LeftClickIcon.d.mts +3 -3
  143. package/es/icons/lucideExtra/LeftDoubleClickIcon.d.mts +3 -3
  144. package/es/icons/lucideExtra/McpIcon.d.mts +3 -3
  145. package/es/icons/lucideExtra/ProviderIcon.d.mts +3 -3
  146. package/es/icons/lucideExtra/RightClickIcon.d.mts +3 -3
  147. package/es/icons/lucideExtra/RightDoubleClickIcon.d.mts +2 -2
  148. package/es/icons/lucideExtra/ShapesUploadIcon.d.mts +2 -2
  149. package/es/icons/lucideExtra/TreeDownRightIcon.d.mts +3 -3
  150. package/es/icons/lucideExtra/TreeUpDownRightIcon.d.mts +3 -3
  151. package/es/mdx/Mdx/index.d.mts +2 -2
  152. package/es/mdx/mdxComponents/Citation/index.mjs +1 -1
  153. package/es/mdx/mdxComponents/Citation/index.mjs.map +1 -1
  154. package/es/mobile/ChatInputArea/components/ChatSendButton.d.mts +2 -2
  155. package/es/mobile/TabBar/TabBar.d.mts +2 -2
  156. package/es/storybook/StoryBook/index.d.mts +2 -2
  157. package/es/styles/theme/customToken.mjs +1 -1
  158. package/es/styles/theme/customToken.mjs.map +1 -1
  159. package/es/styles/theme/generateColorPalette.mjs +1 -1
  160. package/es/styles/theme/generateColorPalette.mjs.map +1 -1
  161. package/package.json +2 -2
  162. package/es/motion/LazyMotion.d.mts +0 -20
  163. package/es/motion/LazyMotion.mjs +0 -20
  164. package/es/motion/LazyMotion.mjs.map +0 -1
  165. package/es/motion/index.d.mts +0 -4
  166. package/es/motion/index.d.ts +0 -1
  167. package/es/motion/index.js +0 -1
  168. package/es/motion/index.mjs +0 -5
  169. package/es/motion/loadFeatures.d.mts +0 -14
  170. package/es/motion/loadFeatures.mjs +0 -6
  171. package/es/motion/loadFeatures.mjs.map +0 -1
@@ -1,8 +1,8 @@
1
1
  import { FormSubmitFooterProps } from "../type.mjs";
2
- import * as react12 from "react";
2
+ import * as react35 from "react";
3
3
 
4
4
  //#region src/Form/components/FormSubmitFooter.d.ts
5
- declare const FormSubmitFooter: react12.NamedExoticComponent<FormSubmitFooterProps>;
5
+ declare const FormSubmitFooter: react35.NamedExoticComponent<FormSubmitFooterProps>;
6
6
  //#endregion
7
7
  export { FormSubmitFooter };
8
8
  //# sourceMappingURL=FormSubmitFooter.d.mts.map
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { MotionComponent } from "../../MotionProvider/index.mjs";
3
+ import { useMotionComponent } from "../../MotionProvider/index.mjs";
4
4
  import FlexBasic_default from "../../Flex/FlexBasic.mjs";
5
5
  import Icon_default from "../../Icon/Icon.mjs";
6
6
  import Button_default from "../../Button/Button.mjs";
@@ -9,7 +9,7 @@ import { useSubmitFooterStyles } from "../style.mjs";
9
9
  import { useFormContext } from "./FormProvider.mjs";
10
10
  import form_default from "../../i18n/resources/en/form.mjs";
11
11
  import { merge, removeUndefined } from "./merge.mjs";
12
- import { memo, use, useEffect, useMemo, useState } from "react";
12
+ import { memo, useEffect, useMemo, useState } from "react";
13
13
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
14
14
  import { Form } from "antd";
15
15
  import { InfoIcon } from "lucide-react";
@@ -17,7 +17,7 @@ import isEqual from "fast-deep-equal";
17
17
 
18
18
  //#region src/Form/components/FormSubmitFooter.tsx
19
19
  const FormSubmitFooter = memo(({ enableReset = true, buttonProps, float, onReset, saveButtonProps, resetButtonProps, enableUnsavedWarning, children, texts, className, ...rest }) => {
20
- const Motion = use(MotionComponent);
20
+ const Motion = useMotionComponent();
21
21
  const { form, initialValues, submitLoading } = useFormContext();
22
22
  const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false);
23
23
  const values = Form.useWatch([], form) || {};
@@ -1 +1 @@
1
- {"version":3,"file":"FormSubmitFooter.mjs","names":["formMessages","useStyles","Icon","Button","Flexbox"],"sources":["../../../src/Form/components/FormSubmitFooter.tsx"],"sourcesContent":["'use client';\n\nimport { Form } from 'antd';\nimport isEqual from 'fast-deep-equal';\nimport { InfoIcon } from 'lucide-react';\nimport { memo, use, useEffect, useMemo, useState } from 'react';\n\nimport Button from '@/Button';\nimport { Flexbox } from '@/Flex';\nimport Icon from '@/Icon';\nimport { MotionComponent } from '@/MotionProvider';\nimport formMessages from '@/i18n/resources/en/form';\nimport { useTranslation } from '@/i18n/useTranslation';\n\nimport { useSubmitFooterStyles as useStyles } from '../style';\nimport type { FormSubmitFooterProps } from '../type';\nimport { useFormContext } from './FormProvider';\nimport { merge, removeUndefined } from './merge';\n\nconst FormSubmitFooter = memo<FormSubmitFooterProps>(\n ({\n enableReset = true,\n buttonProps,\n float,\n onReset,\n saveButtonProps,\n resetButtonProps,\n enableUnsavedWarning,\n children,\n texts,\n className,\n ...rest\n }) => {\n const Motion = use(MotionComponent);\n const { form, initialValues, submitLoading } = useFormContext();\n const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false);\n const values = Form.useWatch([], form) || {};\n const { t } = useTranslation(formMessages);\n\n const { cx, styles, theme } = useStyles();\n\n const v = useMemo(() => removeUndefined(values), [values]);\n\n const initialV = useMemo(() => removeUndefined(initialValues), [initialValues]);\n\n const mergedV = useMemo(() => merge(initialV, v), [v, initialV]);\n\n useEffect(() => {\n setHasUnsavedChanges(!isEqual(mergedV, initialV));\n }, [mergedV, initialV, submitLoading]);\n\n const unsavedWarningText = texts?.unSavedWarning ?? t('form.unsavedWarning');\n const unsavedText = texts?.unSaved ?? t('form.unsavedChanges');\n const resetText = texts?.reset ?? t('form.reset');\n const submitText = texts?.submit ?? t('form.submit');\n\n const fn = (e: BeforeUnloadEvent) => {\n if (hasUnsavedChanges) {\n e.returnValue = unsavedWarningText;\n } else {\n delete e.returnValue;\n }\n };\n\n useEffect(() => {\n if (!enableUnsavedWarning) return;\n if (typeof window === 'undefined' || !hasUnsavedChanges) return;\n // 添加离开页面的提示\n window.addEventListener('beforeunload', fn);\n return () => window.removeEventListener('beforeunload', fn);\n }, [enableUnsavedWarning, hasUnsavedChanges, unsavedWarningText]);\n\n const content = (\n <>\n {(float || hasUnsavedChanges) && (\n <>\n <Icon\n color={theme.colorTextDescription}\n icon={InfoIcon}\n size={12}\n style={{ marginLeft: 8 }}\n />\n <span\n style={{\n color: theme.colorTextDescription,\n flex: 'none',\n fontSize: 12,\n marginRight: float ? 16 : 4,\n }}\n >\n {unsavedText}\n </span>\n </>\n )}\n {children}\n {enableReset && (float || hasUnsavedChanges) && (\n <Button\n htmlType=\"button\"\n onClick={() => {\n onReset?.(v, initialV);\n form?.resetFields();\n }}\n shape={float ? 'round' : undefined}\n variant={'filled'}\n {...buttonProps}\n {...resetButtonProps}\n >\n {resetText}\n </Button>\n )}\n <Button\n htmlType=\"submit\"\n loading={submitLoading}\n shape={float ? 'round' : undefined}\n type=\"primary\"\n {...buttonProps}\n {...saveButtonProps}\n >\n {submitText}\n </Button>\n </>\n );\n\n if (!float)\n return (\n <Flexbox\n align={'center'}\n className={cx(styles.footer, className)}\n gap={8}\n horizontal\n justify={'flex-end'}\n {...rest}\n >\n {content}\n </Flexbox>\n );\n\n return (\n <Motion.div\n animate={hasUnsavedChanges ? 'visible' : 'hidden'}\n className={styles.floatFooter}\n initial={'hidden'}\n transition={{ duration: 0.1, ease: 'easeOut' }}\n variants={{\n hidden: {\n opacity: 0,\n x: '-50%',\n y: 20,\n },\n visible: {\n opacity: 1,\n x: '-50%',\n y: 0,\n },\n }}\n >\n <Flexbox\n align={'center'}\n className={className}\n gap={8}\n horizontal\n justify={'center'}\n {...rest}\n >\n {content}\n </Flexbox>\n </Motion.div>\n );\n },\n);\n\nFormSubm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GACI,SAAS,sBACT,8CACE,oBAACC;GACC,OAAO,MAAM;GACb,MAAM;GACN,MAAM;GACN,OAAO,EAAE,YAAY,GAAG;IACxB,EACF,oBAAC;GACC,OAAO;IACL,OAAO,MAAM;IACb,MAAM;IACN,UAAU;IACV,aAAa,QAAQ,KAAK;IAC3B;aAEA;IACI,IACN;EAEJ;EACA,gBAAgB,SAAS,sBACxB,oBAACC;GACC,UAAS;GACT,eAAe;AACb,cAAU,GAAG,SAAS;AACtB,UAAM,aAAa;;GAErB,OAAO,QAAQ,UAAU;GACzB,SAAS;GACT,GAAI;GACJ,GAAI;aAEH;IACM;EAEX,oBAACA;GACC,UAAS;GACT,SAAS;GACT,OAAO,QAAQ,UAAU;GACzB,MAAK;GACL,GAAI;GACJ,GAAI;aAEH;IACM;KACR;AAGL,KAAI,CAAC,MACH,QACE,oBAACC;EACC,OAAO;EACP,WAAW,GAAG,OAAO,QAAQ,UAAU;EACvC,KAAK;EACL;EACA,SAAS;EACT,GAAI;YAEH;GACO;AAGd,QACE,oBAAC,OAAO;EACN,SAAS,oBAAoB,YAAY;EACzC,WAAW,OAAO;EAClB,SAAS;EACT,YAAY;GAAE,UAAU;GAAK,MAAM;GAAW;EAC9C,UAAU;GACR,QAAQ;IACN,SAAS;IACT,GAAG;IACH,GAAG;IACJ;GACD,SAAS;IACP,SAAS;IACT,GAAG;IACH,GAAG;IACJ;GACF;YAED,oBAACA;GACC,OAAO;GACI;GACX,KAAK;GACL;GACA,SAAS;GACT,GAAI;aAEH;IACO;GACC;EAGlB;AAED,iBAAiB,cAAc;AAE/B,+BAAe"}
1
+ {"version":3,"file":"FormSubmitFooter.mjs","names":["formMessages","useStyles","Icon","Button","Flexbox"],"sources":["../../../src/Form/components/FormSubmitFooter.tsx"],"sourcesContent":["'use client';\n\nimport { Form } from 'antd';\nimport isEqual from 'fast-deep-equal';\nimport { InfoIcon } from 'lucide-react';\nimport { memo, useEffect, useMemo, useState } from 'react';\n\nimport Button from '@/Button';\nimport { Flexbox } from '@/Flex';\nimport Icon from '@/Icon';\nimport { useMotionComponent } from '@/MotionProvider';\nimport formMessages from '@/i18n/resources/en/form';\nimport { useTranslation } from '@/i18n/useTranslation';\n\nimport { useSubmitFooterStyles as useStyles } from '../style';\nimport type { FormSubmitFooterProps } from '../type';\nimport { useFormContext } from './FormProvider';\nimport { merge, removeUndefined } from './merge';\n\nconst FormSubmitFooter = memo<FormSubmitFooterProps>(\n ({\n enableReset = true,\n buttonProps,\n float,\n onReset,\n saveButtonProps,\n resetButtonProps,\n enableUnsavedWarning,\n children,\n texts,\n className,\n ...rest\n }) => {\n const Motion = useMotionComponent();\n const { form, initialValues, submitLoading } = useFormContext();\n const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false);\n const values = Form.useWatch([], form) || {};\n const { t } = useTranslation(formMessages);\n\n const { cx, styles, theme } = useStyles();\n\n const v = useMemo(() => removeUndefined(values), [values]);\n\n const initialV = useMemo(() => removeUndefined(initialValues), [initialValues]);\n\n const mergedV = useMemo(() => merge(initialV, v), [v, initialV]);\n\n useEffect(() => {\n setHasUnsavedChanges(!isEqual(mergedV, initialV));\n }, [mergedV, initialV, submitLoading]);\n\n const unsavedWarningText = texts?.unSavedWarning ?? t('form.unsavedWarning');\n const unsavedText = texts?.unSaved ?? t('form.unsavedChanges');\n const resetText = texts?.reset ?? t('form.reset');\n const submitText = texts?.submit ?? t('form.submit');\n\n const fn = (e: BeforeUnloadEvent) => {\n if (hasUnsavedChanges) {\n e.returnValue = unsavedWarningText;\n } else {\n delete e.returnValue;\n }\n };\n\n useEffect(() => {\n if (!enableUnsavedWarning) return;\n if (typeof window === 'undefined' || !hasUnsavedChanges) return;\n // 添加离开页面的提示\n window.addEventListener('beforeunload', fn);\n return () => window.removeEventListener('beforeunload', fn);\n }, [enableUnsavedWarning, hasUnsavedChanges, unsavedWarningText]);\n\n const content = (\n <>\n {(float || hasUnsavedChanges) && (\n <>\n <Icon\n color={theme.colorTextDescription}\n icon={InfoIcon}\n size={12}\n style={{ marginLeft: 8 }}\n />\n <span\n style={{\n color: theme.colorTextDescription,\n flex: 'none',\n fontSize: 12,\n marginRight: float ? 16 : 4,\n }}\n >\n {unsavedText}\n </span>\n </>\n )}\n {children}\n {enableReset && (float || hasUnsavedChanges) && (\n <Button\n htmlType=\"button\"\n onClick={() => {\n onReset?.(v, initialV);\n form?.resetFields();\n }}\n shape={float ? 'round' : undefined}\n variant={'filled'}\n {...buttonProps}\n {...resetButtonProps}\n >\n {resetText}\n </Button>\n )}\n <Button\n htmlType=\"submit\"\n loading={submitLoading}\n shape={float ? 'round' : undefined}\n type=\"primary\"\n {...buttonProps}\n {...saveButtonProps}\n >\n {submitText}\n </Button>\n </>\n );\n\n if (!float)\n return (\n <Flexbox\n align={'center'}\n className={cx(styles.footer, className)}\n gap={8}\n horizontal\n justify={'flex-end'}\n {...rest}\n >\n {content}\n </Flexbox>\n );\n\n return (\n <Motion.div\n animate={hasUnsavedChanges ? 'visible' : 'hidden'}\n className={styles.floatFooter}\n initial={'hidden'}\n transition={{ duration: 0.1, ease: 'easeOut' }}\n variants={{\n hidden: {\n opacity: 0,\n x: '-50%',\n y: 20,\n },\n visible: {\n opacity: 1,\n x: '-50%',\n y: 0,\n },\n }}\n >\n <Flexbox\n align={'center'}\n className={className}\n gap={8}\n horizontal\n justify={'center'}\n {...rest}\n >\n {content}\n </Flexbox>\n </Motion.div>\n );\n },\n);\n\nFormSubmitFooter.displayName = 'FormSubmitFooter';\n\nexport default FormSubmitFooter;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,MAAM,mBAAmB,MACtB,EACC,cAAc,MACd,aACA,OACA,SACA,iBACA,kBACA,sBACA,UACA,OACA,WACA,GAAG,WACC;CACJ,MAAM,SAAS,oBAAoB;CACnC,MAAM,EAAE,MAAM,eAAe,kBAAkB,gBAAgB;CAC/D,MAAM,CAAC,mBAAmB,wBAAwB,SAAS,MAAM;CACjE,MAAM,SAAS,KAAK,SAAS,EAAE,EAAE,KAAK,I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T,GAAI;GACJ,GAAI;aAEH;IACM;EAEX,oBAACA;GACC,UAAS;GACT,SAAS;GACT,OAAO,QAAQ,UAAU;GACzB,MAAK;GACL,GAAI;GACJ,GAAI;aAEH;IACM;KACR;AAGL,KAAI,CAAC,MACH,QACE,oBAACC;EACC,OAAO;EACP,WAAW,GAAG,OAAO,QAAQ,UAAU;EACvC,KAAK;EACL;EACA,SAAS;EACT,GAAI;YAEH;GACO;AAGd,QACE,oBAAC,OAAO;EACN,SAAS,oBAAoB,YAAY;EACzC,WAAW,OAAO;EAClB,SAAS;EACT,YAAY;GAAE,UAAU;GAAK,MAAM;GAAW;EAC9C,UAAU;GACR,QAAQ;IACN,SAAS;IACT,GAAG;IACH,GAAG;IACJ;GACD,SAAS;IACP,SAAS;IACT,GAAG;IACH,GAAG;IACJ;GACF;YAED,oBAACA;GACC,OAAO;GACI;GACX,KAAK;GACL;GACA,SAAS;GACT,GAAI;aAEH;IACO;GACC;EAGlB;AAED,iBAAiB,cAAc;AAE/B,+BAAe"}
@@ -1,4 +1,4 @@
1
- import { isEmpty, isObject, mergeWith, pickBy } from "lodash-es";
1
+ import { isEmpty, isObject, mergeWith, pickBy } from "es-toolkit/compat";
2
2
 
3
3
  //#region src/Form/components/merge.ts
4
4
  const removeUndefined = (obj) => {
@@ -1 +1 @@
1
- {"version":3,"file":"merge.mjs","names":["merge: typeof _merge"],"sources":["../../../src/Form/components/merge.ts"],"sourcesContent":["import { merge as _merge, isEmpty, isObject, mergeWith, pickBy } from 'lodash-es';\n\nexport const removeUndefined = (obj: any): any => {\n if (!isObject(obj)) return obj;\n\n if (Array.isArray(obj)) {\n return obj.map((item) => removeUndefined(item)).filter((item) => item !== undefined);\n }\n\n return pickBy(\n Object.entries(obj).reduce((acc: any, [key, value]) => {\n acc[key] = removeUndefined(value);\n return acc;\n }, {}),\n (value) => value !== undefined,\n );\n};\n\n/**\n * 用于合并对象,如果是数组则直接替换\n * @param target\n * @param source\n */\nexport const merge: typeof _merge = <T = object>(target: T, source: T) =>\n mergeWith({}, target, source, (obj, src) => {\n if (Array.isArray(obj)) return src;\n });\n\ntype MergeableItem = {\n [key: string]: any;\n id: string;\n};\n\n/**\n * Merge two arrays based on id, preserving metadata from default items\n * @param defaultItems Items with default configuration and metadata\n * @param userItems User-defined items with higher priority\n */\nexport const mergeArrayById = <T extends MergeableItem>(defaultItems: T[], userItems: T[]): T[] => {\n // Create a map of default items for faster lookup\n const defaultItemsMap = new Map(defaultItems.map((item) => [item.id, item]));\n\n // 使用 Map 存储合并结果,这样重复 ID 的后项会自然覆盖前项\n const mergedItemsMap = new Map<string, T>();\n\n // Process user items with default metadata\n for (const userItem of userItems) {\n const defaultItem = defaultItemsMap.get(userItem.id);\n if (!defaultItem) {\n mergedItemsMap.set(userItem.id, userItem);\n continue;\n }\n\n const mergedItem: T = { ...defaultItem };\n for (const [key, value] of Object.entries(userItem)) {\n if (value !== null && value !== undefined && !(typeof value === 'object' && isEmpty(value))) {\n // @ts-expect-error\n mergedItem[key] = value;\n }\n\n if (typeof value === 'object' && !isEmpty(value)) {\n // @ts-expect-error\n mergedItem[key] = merge(defaultItem[key], value);\n }\n }\n\n mergedItemsMap.set(userItem.id, mergedItem);\n }\n\n // 添加只在默认配置中存在的项\n for (const item of defaultItems) {\n if (!mergedItemsMap.has(item.id)) {\n mergedItemsMap.set(item.id, item);\n }\n }\n\n return [...mergedItemsMap.values()];\n};\n"],"mappings":";;;AAEA,MAAa,mBAAmB,QAAkB;AAChD,KAAI,CAAC,SAAS,IAAI,CAAE,QAAO;AAE3B,KAAI,MAAM,QAAQ,IAAI,CACpB,QAAO,IAAI,KAAK,SAAS,gBAAgB,KAAK,CAAC,CAAC,QAAQ,SAAS,SAAS,OAAU;AAGtF,QAAO,OACL,OAAO,QAAQ,IAAI,CAAC,QAAQ,KAAU,CAAC,KAAK,WAAW;AACrD,MAAI,OAAO,gBAAgB,MAAM;AACjC,SAAO;IACN,EAAE,CAAC,GACL,UAAU,UAAU,OACtB;;;;;;;AAQH,MAAaA,WAAoC,QAAW,WAC1D,UAAU,EAAE,EAAE,QAAQ,SAAS,KAAK,QAAQ;AAC1C,KAAI,MAAM,QAAQ,IAAI,CAAE,QAAO;EAC/B"}
1
+ {"version":3,"file":"merge.mjs","names":["merge: typeof _merge"],"sources":["../../../src/Form/components/merge.ts"],"sourcesContent":["import { merge as _merge, isEmpty, isObject, mergeWith, pickBy } from 'es-toolkit/compat';\n\nexport const removeUndefined = (obj: any): any => {\n if (!isObject(obj)) return obj;\n\n if (Array.isArray(obj)) {\n return obj.map((item) => removeUndefined(item)).filter((item) => item !== undefined);\n }\n\n return pickBy(\n Object.entries(obj).reduce((acc: any, [key, value]) => {\n acc[key] = removeUndefined(value);\n return acc;\n }, {}),\n (value) => value !== undefined,\n );\n};\n\n/**\n * 用于合并对象,如果是数组则直接替换\n * @param target\n * @param source\n */\nexport const merge: typeof _merge = <T = object>(target: T, source: T) =>\n mergeWith({}, target, source, (obj, src) => {\n if (Array.isArray(obj)) return src;\n });\n\ntype MergeableItem = {\n [key: string]: any;\n id: string;\n};\n\n/**\n * Merge two arrays based on id, preserving metadata from default items\n * @param defaultItems Items with default configuration and metadata\n * @param userItems User-defined items with higher priority\n */\nexport const mergeArrayById = <T extends MergeableItem>(defaultItems: T[], userItems: T[]): T[] => {\n // Create a map of default items for faster lookup\n const defaultItemsMap = new Map(defaultItems.map((item) => [item.id, item]));\n\n // 使用 Map 存储合并结果,这样重复 ID 的后项会自然覆盖前项\n const mergedItemsMap = new Map<string, T>();\n\n // Process user items with default metadata\n for (const userItem of userItems) {\n const defaultItem = defaultItemsMap.get(userItem.id);\n if (!defaultItem) {\n mergedItemsMap.set(userItem.id, userItem);\n continue;\n }\n\n const mergedItem: T = { ...defaultItem };\n for (const [key, value] of Object.entries(userItem)) {\n if (value !== null && value !== undefined && !(typeof value === 'object' && isEmpty(value))) {\n // @ts-expect-error\n mergedItem[key] = value;\n }\n\n if (typeof value === 'object' && !isEmpty(value)) {\n // @ts-expect-error\n mergedItem[key] = merge(defaultItem[key], value);\n }\n }\n\n mergedItemsMap.set(userItem.id, mergedItem);\n }\n\n // 添加只在默认配置中存在的项\n for (const item of defaultItems) {\n if (!mergedItemsMap.has(item.id)) {\n mergedItemsMap.set(item.id, item);\n }\n }\n\n return [...mergedItemsMap.values()];\n};\n"],"mappings":";;;AAEA,MAAa,mBAAmB,QAAkB;AAChD,KAAI,CAAC,SAAS,IAAI,CAAE,QAAO;AAE3B,KAAI,MAAM,QAAQ,IAAI,CACpB,QAAO,IAAI,KAAK,SAAS,gBAAgB,KAAK,CAAC,CAAC,QAAQ,SAAS,SAAS,OAAU;AAGtF,QAAO,OACL,OAAO,QAAQ,IAAI,CAAC,QAAQ,KAAU,CAAC,KAAK,WAAW;AACrD,MAAI,OAAO,gBAAgB,MAAM;AACjC,SAAO;IACN,EAAE,CAAC,GACL,UAAU,UAAU,OACtB;;;;;;;AAQH,MAAaA,WAAoC,QAAW,WAC1D,UAAU,EAAE,EAAE,QAAQ,SAAS,KAAK,QAAQ;AAC1C,KAAI,MAAM,QAAQ,IAAI,CAAE,QAAO;EAC/B"}
package/es/Form/style.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createStyles } from "antd-style";
2
- import { isNumber } from "lodash-es";
2
+ import { isNumber } from "es-toolkit/compat";
3
3
 
4
4
  //#region src/Form/style.ts
5
5
  const useStyles = createStyles(({ css: css$1, token, prefixCls, responsive }) => ({
@@ -66,8 +66,8 @@ const useFlatGroupStyles = createStyles(({ cx: cx$1, css: css$1, token, stylish
66
66
  mobile: css$1`
67
67
  padding-block: 0;
68
68
  padding-inline: 16px;
69
- background: ${token.colorBgContainer};
70
69
  border-radius: 0;
70
+ background: ${token.colorBgContainer};
71
71
  `,
72
72
  outlined: stylish.variantOutlinedWithoutHover,
73
73
  root: css$1`
@@ -80,8 +80,8 @@ const useFooterStyles = createStyles(({ css: css$1, token, responsive }) => {
80
80
  return { root: css$1`
81
81
  ${responsive.mobile} {
82
82
  padding: 16px;
83
- background: ${token.colorBgContainer};
84
83
  border-block-start: 1px solid ${token.colorBorderSecondary};
84
+ background: ${token.colorBgContainer};
85
85
  }
86
86
  ` };
87
87
  });
@@ -178,18 +178,18 @@ const useSubmitFooterStyles = createStyles(({ responsive, css: css$1, token }) =
178
178
 
179
179
  width: max-content;
180
180
  padding: 8px;
181
-
182
- background: ${token.colorBgContainer};
183
181
  border: 1px solid ${token.colorBorderSecondary};
184
182
  border-radius: 48px;
183
+
184
+ background: ${token.colorBgContainer};
185
185
  box-shadow: ${token.boxShadowSecondary};
186
186
  `,
187
187
  footer: css$1`
188
188
  ${responsive.mobile} {
189
189
  margin-block-start: -${token.borderRadius}px;
190
190
  padding: 16px;
191
- background: ${token.colorBgContainer};
192
191
  border-block-start: 1px solid ${token.colorBorderSecondary};
192
+ background: ${token.colorBgContainer};
193
193
  }
194
194
  `
195
195
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"style.mjs","names":["cx"],"sources":["../../src/Form/style.ts"],"sourcesContent":["import { createStyles } from 'antd-style';\nimport { isNumber } from 'lodash-es';\n\nexport const useStyles = createStyles(({ css, token, prefixCls, responsive }) => ({\n borderless: css`\n gap: 48px;\n .${prefixCls}-collapse .${prefixCls}-collapse-header {\n padding-block-end: 16px;\n border-block-end: 1px solid ${token.colorBorderSecondary};\n }\n `,\n root: css`\n position: relative;\n\n display: flex;\n flex-direction: column;\n gap: 16px;\n\n width: 100%;\n\n .${prefixCls}-form-item {\n margin: 0 !important;\n }\n\n .${prefixCls}-form-item .${prefixCls}-form-item-label > label {\n height: unset;\n }\n\n .${prefixCls}-row {\n position: relative;\n flex-wrap: nowrap;\n }\n\n .${prefixCls}-form-item-label {\n position: relative;\n flex: 1;\n max-width: 100%;\n }\n\n .${prefixCls}-form-item-row {\n align-items: center;\n }\n\n .${prefixCls}-form-item-control {\n position: relative;\n flex: 0;\n min-width: unset !important;\n }\n\n .${prefixCls}-collapse-item {\n border-radius: ${token.borderRadius}px !important;\n }\n\n ${responsive.mobile} {\n gap: 0 !important;\n }\n `,\n}));\n\nexport const useFlatGroupStyles = createStyles(({ cx, css, token, stylish }) => {\n return {\n borderless: cx(\n stylish.variantBorderlessWithoutHover,\n css`\n padding-inline: 0;\n `,\n ),\n filled: stylish.variantFilledWithoutHover,\n mobile: css`\n padding-block: 0;\n padding-inline: 16px;\n background: ${token.colorBgContainer};\n border-radius: 0;\n `,\n outlined: stylish.variantOutlinedWithoutHover,\n root: css`\n padding-inline: 16px;\n border-radius: ${token.borderRadiusLG}px;\n `,\n };\n});\n\nexport const useFooterStyles = createStyles(({ css, token, responsive }) => {\n return {\n root: css`\n ${responsive.mobile} {\n padding: 16px;\n background: ${token.colorBgContainer};\n border-block-start: 1px solid ${token.colorBorderSecondary};\n }\n `,\n };\n});\n\nexport const useGroupStyles = createStyles(({ css, token, responsive }) => {\n return {\n mobileGroupBody: css`\n padding-block: 0;\n padding-inline: 16px;\n background: ${token.colorBgContainer};\n `,\n mobileGroupHeader: css`\n padding: 16px;\n background: ${token.colorBgLayout};\n `,\n title: css`\n align-items: center;\n font-size: 16px;\n font-weight: bold;\n `,\n titleBorderless: css`\n font-size: 18px;\n font-weight: bold;\n `,\n titleMobile: css`\n ${responsive.mobile} {\n font-size: 14px;\n font-weight: 400;\n opacity: 0.5;\n }\n `,\n };\n});\n\nexport const useItemStyles = createStyles(\n ({ css, responsive, prefixCls }, { minWidth }: { minWidth?: string | number }) => ({\n itemMinWidth: css`\n .${prefixCls}-form-item-control {\n width: ${isNumber(minWidth) ? `${minWidth}px` : minWidth};\n }\n `,\n itemNoDivider: css`\n &:not(:first-child) {\n padding-block-start: 0;\n }\n `,\n root: css`\n &.${prefixCls}-form-item {\n padding-block: 16px;\n padding-inline: 0;\n\n .${prefixCls}-form-item-label {\n text-align: start;\n }\n\n .${prefixCls}-row {\n gap: 12px;\n justify-content: space-between;\n\n > div {\n flex: unset;\n flex-grow: unset;\n }\n }\n\n .${prefixCls}-form-item-required::before {\n align-self: flex-start;\n }\n\n ${responsive.mobile} {\n &.${prefixCls}-form-item-horizontal {\n .${prefixCls}-form-item-label {\n flex: 1 !important;\n }\n .${prefixCls}-form-item-control {\n flex: none !important;\n }\n }\n }\n }\n `,\n verticalLayout: css`\n &.${prefixCls}-form-item {\n .${prefixCls}-row {\n align-items: stretch;\n }\n }\n `,\n }),\n);\n\nexport const useSubmitFooterStyles = createStyles(({ responsive, css, token }) => ({\n floatFooter: css`\n position: fixed;\n z-index: 1000;\n inset-block-end: 24px;\n inset-inline-start: 50%;\n transform: translateX(-50%);\n\n width: max-content;\n padding: 8px;\n\n background: ${token.colorBgContainer};\n border: 1px solid ${token.colorBorderSecondary};\n border-radius: 48px;\n box-shadow: ${token.boxShadowSecondary};\n `,\n footer: css`\n ${responsive.mobile} {\n margin-block-start: -${token.borderRadius}px;\n padding: 16px;\n background: ${token.colorBgContainer};\n border-block-start: 1px solid ${token.colorBorderSecondary};\n }\n `,\n}));\n\nexport const useTitleStyles = createStyles(({ css, token }) => ({\n content: css`\n position: relative;\n text-align: start;\n `,\n\n desc: css`\n display: block;\n\n line-height: 1.44;\n color: ${token.colorTextDescription};\n word-wrap: break-word;\n white-space: pre-wrap;\n `,\n title: css`\n font-weight: 500;\n line-height: 1;\n `,\n}));\n"],"mappings":";;;;AAGA,MAAa,YAAY,cAAc,EAAE,YAAK,OAAO,WAAW,kBAAkB;CAChF,YAAY,KAAG;;OAEV,UAAU,aAAa,UAAU;;oCAEJ,MAAM,qBAAqB;;;CAG7D,MAAM,KAAG;;;;;;;;;OASJ,UAAU;;;;OAIV,UAAU,cAAc,UAAU;;;;OAIlC,UAAU;;;;;OAKV,UAAU;;;;;;OAMV,UAAU;;;;OAIV,UAAU;;;;;;OAMV,UAAU;uBACM,MAAM,aAAa;;;MAGpC,WAAW,OAAO;;;;CAIvB,EAAE;AAEH,MAAa,qBAAqB,cAAc,EAAE,UAAI,YAAK,OAAO,cAAc;AAC9E,QAAO;EACL,YAAYA,KACV,QAAQ,+BACR,KAA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EAAE,YAAK,aAAa;CAC9D,SAAS,KAAG;;;;CAKZ,MAAM,KAAG;;;;aAIE,MAAM,qBAAqB;;;;CAItC,OAAO,KAAG;;;;CAIX,EAAE"}
1
+ {"version":3,"file":"style.mjs","names":["cx"],"sources":["../../src/Form/style.ts"],"sourcesContent":["import { createStyles } from 'antd-style';\nimport { isNumber } from 'es-toolkit/compat';\n\nexport const useStyles = createStyles(({ css, token, prefixCls, responsive }) => ({\n borderless: css`\n gap: 48px;\n .${prefixCls}-collapse .${prefixCls}-collapse-header {\n padding-block-end: 16px;\n border-block-end: 1px solid ${token.colorBorderSecondary};\n }\n `,\n root: css`\n position: relative;\n\n display: flex;\n flex-direction: column;\n gap: 16px;\n\n width: 100%;\n\n .${prefixCls}-form-item {\n margin: 0 !important;\n }\n\n .${prefixCls}-form-item .${prefixCls}-form-item-label > label {\n height: unset;\n }\n\n .${prefixCls}-row {\n position: relative;\n flex-wrap: nowrap;\n }\n\n .${prefixCls}-form-item-label {\n position: relative;\n flex: 1;\n max-width: 100%;\n }\n\n .${prefixCls}-form-item-row {\n align-items: center;\n }\n\n .${prefixCls}-form-item-control {\n position: relative;\n flex: 0;\n min-width: unset !important;\n }\n\n .${prefixCls}-collapse-item {\n border-radius: ${token.borderRadius}px !important;\n }\n\n ${responsive.mobile} {\n gap: 0 !important;\n }\n `,\n}));\n\nexport const useFlatGroupStyles = createStyles(({ cx, css, token, stylish }) => {\n return {\n borderless: cx(\n stylish.variantBorderlessWithoutHover,\n css`\n padding-inline: 0;\n `,\n ),\n filled: stylish.variantFilledWithoutHover,\n mobile: css`\n padding-block: 0;\n padding-inline: 16px;\n border-radius: 0;\n background: ${token.colorBgContainer};\n `,\n outlined: stylish.variantOutlinedWithoutHover,\n root: css`\n padding-inline: 16px;\n border-radius: ${token.borderRadiusLG}px;\n `,\n };\n});\n\nexport const useFooterStyles = createStyles(({ css, token, responsive }) => {\n return {\n root: css`\n ${responsive.mobile} {\n padding: 16px;\n border-block-start: 1px solid ${token.colorBorderSecondary};\n background: ${token.colorBgContainer};\n }\n `,\n };\n});\n\nexport const useGroupStyles = createStyles(({ css, token, responsive }) => {\n return {\n mobileGroupBody: css`\n padding-block: 0;\n padding-inline: 16px;\n background: ${token.colorBgContainer};\n `,\n mobileGroupHeader: css`\n padding: 16px;\n background: ${token.colorBgLayout};\n `,\n title: css`\n align-items: center;\n font-size: 16px;\n font-weight: bold;\n `,\n titleBorderless: css`\n font-size: 18px;\n font-weight: bold;\n `,\n titleMobile: css`\n ${responsive.mobile} {\n font-size: 14px;\n font-weight: 400;\n opacity: 0.5;\n }\n `,\n };\n});\n\nexport const useItemStyles = createStyles(\n ({ css, responsive, prefixCls }, { minWidth }: { minWidth?: string | number }) => ({\n itemMinWidth: css`\n .${prefixCls}-form-item-control {\n width: ${isNumber(minWidth) ? `${minWidth}px` : minWidth};\n }\n `,\n itemNoDivider: css`\n &:not(:first-child) {\n padding-block-start: 0;\n }\n `,\n root: css`\n &.${prefixCls}-form-item {\n padding-block: 16px;\n padding-inline: 0;\n\n .${prefixCls}-form-item-label {\n text-align: start;\n }\n\n .${prefixCls}-row {\n gap: 12px;\n justify-content: space-between;\n\n > div {\n flex: unset;\n flex-grow: unset;\n }\n }\n\n .${prefixCls}-form-item-required::before {\n align-self: flex-start;\n }\n\n ${responsive.mobile} {\n &.${prefixCls}-form-item-horizontal {\n .${prefixCls}-form-item-label {\n flex: 1 !important;\n }\n .${prefixCls}-form-item-control {\n flex: none !important;\n }\n }\n }\n }\n `,\n verticalLayout: css`\n &.${prefixCls}-form-item {\n .${prefixCls}-row {\n align-items: stretch;\n }\n }\n `,\n }),\n);\n\nexport const useSubmitFooterStyles = createStyles(({ responsive, css, token }) => ({\n floatFooter: css`\n position: fixed;\n z-index: 1000;\n inset-block-end: 24px;\n inset-inline-start: 50%;\n transform: translateX(-50%);\n\n width: max-content;\n padding: 8px;\n border: 1px solid ${token.colorBorderSecondary};\n border-radius: 48px;\n\n background: ${token.colorBgContainer};\n box-shadow: ${token.boxShadowSecondary};\n `,\n footer: css`\n ${responsive.mobile} {\n margin-block-start: -${token.borderRadius}px;\n padding: 16px;\n border-block-start: 1px solid ${token.colorBorderSecondary};\n background: ${token.colorBgContainer};\n }\n `,\n}));\n\nexport const useTitleStyles = createStyles(({ css, token }) => ({\n content: css`\n position: relative;\n text-align: start;\n `,\n\n desc: css`\n display: block;\n\n line-height: 1.44;\n color: ${token.colorTextDescription};\n word-wrap: break-word;\n white-space: pre-wrap;\n `,\n title: css`\n font-weight: 500;\n line-height: 1;\n `,\n}));\n"],"mappings":";;;;AAGA,MAAa,YAAY,cAAc,EAAE,YAAK,OAAO,WAAW,kBAAkB;CAChF,YAAY,KAAG;;OAEV,UAAU,aAAa,UAAU;;oCAEJ,MAAM,qBAAqB;;;CAG7D,MAAM,KAAG;;;;;;;;;OASJ,UAAU;;;;OAIV,UAAU,cAAc,UAAU;;;;OAIlC,UAAU;;;;;OAKV,UAAU;;;;;;OAMV,UAAU;;;;OAIV,UAAU;;;;;;OAMV,UAAU;uBACM,MAAM,aAAa;;;MAGpC,WAAW,OAAO;;;;CAIvB,EAAE;AAEH,MAAa,qBAAqB,cAAc,EAAE,UAAI,YAAK,OAAO,cAAc;AAC9E,QAAO;EACL,YAAYA,KACV,QAAQ,+BACR,KAAG;;QAGJ;EACD,QAAQ,QAAQ;EAChB,QAAQ,KAAG;;;;oBAIK,MAAM,iBAAiB;;EAEvC,UAAU,QAAQ;EAClB,MAAM,KAAG;;uBAEU,MAAM,eAAe;;EAEzC;EACD;AAEF,MAAa,kBAAkB,cAAc,EAAE,YAAK,OAAO,iBAAiB;AAC1E,QAAO,EACL,MAAM,KAAG;QACL,WAAW,OAAO;;wCAEc,MAAM,qBAAqB;sBAC7C,MAAM,iBAAiB;;OAG1C;EACD;AAEF,MAAa,iBAAiB,cAAc,EAAE,YAAK,OAAO,iBAAiB;AACzE,QAAO;EACL,iBAAiB,KAAG;;;oBAGJ,MAAM,iBAAiB;;EAEvC,mBAAmB,KAAG;;oBAEN,MAAM,cAAc;;EAEpC,OAAO,KAAG;;;;;EAKV,iBAAiB,KAAG;;;;EAIpB,aAAa,KAAG;QACZ,WAAW,OAAO;;;;;;EAMvB;EACD;AAEF,MAAa,gBAAgB,cAC1B,EAAE,YAAK,YAAY,aAAa,EAAE,gBAAgD;CACjF,cAAc,KAAG;SACZ,UAAU;iBACF,SAAS,SAAS,GAAG,GAAG,SAAS,MAAM,SAAS;;;CAG7D,eAAe,KAAG;;;;;CAKlB,MAAM,KAAG;UACH,UAAU;;;;WAIT,UAAU;;;;WAIV,UAAU;;;;;;;;;;WAUV,UAAU;;;;UAIX,WAAW,OAAO;cACd,UAAU;eACT,UAAU;;;eAGV,UAAU;;;;;;;CAOrB,gBAAgB,KAAG;UACb,UAAU;WACT,UAAU;;;;;CAKlB,EACF;AAED,MAAa,wBAAwB,cAAc,EAAE,YAAY,YAAK,aAAa;CACjF,aAAa,KAAG;;;;;;;;;wBASM,MAAM,qBAAqB;;;kBAGjC,MAAM,iBAAiB;kBACvB,MAAM,mBAAmB;;CAEzC,QAAQ,KAAG;MACP,WAAW,OAAO;6BACK,MAAM,aAAa;;sCAEV,MAAM,qBAAqB;oBAC7C,MAAM,iBAAiB;;;CAG1C,EAAE;AAEH,MAAa,iBAAiB,cAAc,EAAE,YAAK,aAAa;CAC9D,SAAS,KAAG;;;;CAKZ,MAAM,KAAG;;;;aAIE,MAAM,qBAAqB;;;;CAItC,OAAO,KAAG;;;;CAIX,EAAE"}
@@ -1,8 +1,8 @@
1
1
  import { FormModalProps } from "./type.mjs";
2
- import * as react9 from "react";
2
+ import * as react33 from "react";
3
3
 
4
4
  //#region src/FormModal/FormModal.d.ts
5
- declare const FormModal: react9.NamedExoticComponent<FormModalProps>;
5
+ declare const FormModal: react33.NamedExoticComponent<FormModalProps>;
6
6
  //#endregion
7
7
  export { FormModal };
8
8
  //# sourceMappingURL=FormModal.d.mts.map
package/es/Grid/style.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createStyles } from "antd-style";
2
- import { isString } from "lodash-es";
2
+ import { isString } from "es-toolkit/compat";
3
3
 
4
4
  //#region src/Grid/style.ts
5
5
  const useStyles = createStyles(({ css: css$1 }, { rows, maxItemWidth, gap }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"style.mjs","names":[],"sources":["../../src/Grid/style.ts"],"sourcesContent":["import { createStyles } from 'antd-style';\nimport { isString } from 'lodash-es';\n\nexport const useStyles = createStyles(\n (\n { css },\n {\n rows,\n maxItemWidth,\n gap,\n }: { gap: string | number; maxItemWidth: string | number; rows: number },\n ) => {\n return css`\n --rows: ${rows};\n --max-item-width: ${isString(maxItemWidth) ? maxItemWidth : `${maxItemWidth}px`};\n --gap: ${isString(gap) ? gap : `${gap}px`};\n\n display: grid !important;\n grid-template-columns: repeat(\n auto-fill,\n minmax(\n max(var(--max-item-width), calc((100% - var(--gap) * (var(--rows) - 1)) / var(--rows))),\n 1fr\n )\n );\n `;\n },\n);\n"],"mappings":";;;;AAGA,MAAa,YAAY,cAErB,EAAE,cACF,EACE,MACA,cACA,UAEC;AACH,QAAO,KAAG;gBACE,KAAK;0BACK,SAAS,aAAa,GAAG,eAAe,GAAG,aAAa,IAAI;eACvE,SAAS,IAAI,GAAG,MAAM,GAAG,IAAI,IAAI;;;;;;;;;;;EAY/C"}
1
+ {"version":3,"file":"style.mjs","names":[],"sources":["../../src/Grid/style.ts"],"sourcesContent":["import { createStyles } from 'antd-style';\nimport { isString } from 'es-toolkit/compat';\n\nexport const useStyles = createStyles(\n (\n { css },\n {\n rows,\n maxItemWidth,\n gap,\n }: { gap: string | number; maxItemWidth: string | number; rows: number },\n ) => {\n return css`\n --rows: ${rows};\n --max-item-width: ${isString(maxItemWidth) ? maxItemWidth : `${maxItemWidth}px`};\n --gap: ${isString(gap) ? gap : `${gap}px`};\n\n display: grid !important;\n grid-template-columns: repeat(\n auto-fill,\n minmax(\n max(var(--max-item-width), calc((100% - var(--gap) * (var(--rows) - 1)) / var(--rows))),\n 1fr\n )\n );\n `;\n },\n);\n"],"mappings":";;;;AAGA,MAAa,YAAY,cAErB,EAAE,cACF,EACE,MACA,cACA,UAEC;AACH,QAAO,KAAG;gBACE,KAAK;0BACK,SAAS,aAAa,GAAG,eAAe,GAAG,aAAa,IAAI;eACvE,SAAS,IAAI,GAAG,MAAM,GAAG,IAAI,IAAI;;;;;;;;;;;EAY/C"}
@@ -1,8 +1,8 @@
1
1
  import { GuideCardProps } from "./type.mjs";
2
- import * as react129 from "react";
2
+ import * as react128 from "react";
3
3
 
4
4
  //#region src/GuideCard/GuideCard.d.ts
5
- declare const GuideCard: react129.NamedExoticComponent<GuideCardProps>;
5
+ declare const GuideCard: react128.NamedExoticComponent<GuideCardProps>;
6
6
  //#endregion
7
7
  export { GuideCard };
8
8
  //# sourceMappingURL=GuideCard.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { HeaderProps } from "./type.mjs";
2
- import * as react38 from "react";
2
+ import * as react30 from "react";
3
3
 
4
4
  //#region src/Header/Header.d.ts
5
- declare const Header: react38.NamedExoticComponent<HeaderProps>;
5
+ declare const Header: react30.NamedExoticComponent<HeaderProps>;
6
6
  //#endregion
7
7
  export { Header };
8
8
  //# sourceMappingURL=Header.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { HighlighterProps } from "./type.mjs";
2
- import * as react33 from "react";
2
+ import * as react31 from "react";
3
3
 
4
4
  //#region src/Highlighter/Highlighter.d.ts
5
- declare const Highlighter: react33.NamedExoticComponent<HighlighterProps>;
5
+ declare const Highlighter: react31.NamedExoticComponent<HighlighterProps>;
6
6
  //#endregion
7
7
  export { Highlighter };
8
8
  //# sourceMappingURL=Highlighter.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { SyntaxHighlighterProps } from "../type.mjs";
2
- import * as react34 from "react";
2
+ import * as react32 from "react";
3
3
 
4
4
  //#region src/Highlighter/SyntaxHighlighter/index.d.ts
5
- declare const SyntaxHighlighter: react34.NamedExoticComponent<SyntaxHighlighterProps>;
5
+ declare const SyntaxHighlighter: react32.NamedExoticComponent<SyntaxHighlighterProps>;
6
6
  //#endregion
7
7
  export { SyntaxHighlighter };
8
8
  //# sourceMappingURL=index.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { HotkeyProps } from "./type.mjs";
2
- import * as react40 from "react";
2
+ import * as react29 from "react";
3
3
 
4
4
  //#region src/Hotkey/Hotkey.d.ts
5
- declare const Hotkey: react40.NamedExoticComponent<HotkeyProps>;
5
+ declare const Hotkey: react29.NamedExoticComponent<HotkeyProps>;
6
6
  //#endregion
7
7
  export { Hotkey };
8
8
  //# sourceMappingURL=Hotkey.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { HotkeyInputProps } from "./type.mjs";
2
- import * as react39 from "react";
2
+ import * as react54 from "react";
3
3
 
4
4
  //#region src/HotkeyInput/HotkeyInput.d.ts
5
- declare const HotkeyInput: react39.NamedExoticComponent<HotkeyInputProps>;
5
+ declare const HotkeyInput: react54.NamedExoticComponent<HotkeyInputProps>;
6
6
  //#endregion
7
7
  export { HotkeyInput };
8
8
  //# sourceMappingURL=HotkeyInput.d.mts.map
@@ -12,7 +12,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
12
12
  import useMergeState from "use-merge-value";
13
13
  import { cva } from "class-variance-authority";
14
14
  import { Undo2Icon } from "lucide-react";
15
- import { isEqual } from "lodash-es";
15
+ import { isEqual } from "es-toolkit/compat";
16
16
  import { useHotkeys, useRecordHotkeys } from "react-hotkeys-hook";
17
17
 
18
18
  //#region src/HotkeyInput/HotkeyInput.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"HotkeyInput.mjs","names":["hotkeyMessages","useControlledState","modifiers: string[]","normalKeys: string[]","normalizedKey: any","Flexbox","Hotkey","ActionIcon"],"sources":["../../src/HotkeyInput/HotkeyInput.tsx"],"sourcesContent":["'use client';\n\nimport type { InputRef } from 'antd';\nimport { cva } from 'class-variance-authority';\nimport { isEqual } from 'lodash-es';\nimport { Undo2Icon } from 'lucide-react';\nimport {\n type FocusEvent,\n type MouseEvent,\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useHotkeys, useRecordHotkeys } from 'react-hotkeys-hook';\nimport useControlledState from 'use-merge-value';\n\nimport ActionIcon from '@/ActionIcon';\nimport { Flexbox } from '@/Flex';\nimport Hotkey from '@/Hotkey';\nimport { NORMATIVE_MODIFIER, checkIsAppleDevice, splitKeysByPlus } from '@/Hotkey/utils';\nimport hotkeyMessages from '@/i18n/resources/en/hotkey';\nimport { useTranslation } from '@/i18n/useTranslation';\n\nimport { useStyles } from './style';\nimport type { HotkeyInputProps } from './type';\n\nconst HotkeyInput = memo<HotkeyInputProps>(\n ({\n value = '',\n defaultValue = '',\n resetValue = '',\n onChange,\n onConflict,\n placeholder,\n disabled,\n shadow,\n allowReset = true,\n style,\n className,\n hotkeyConflicts = [],\n variant,\n texts,\n isApple,\n onBlur,\n onReset,\n onFocus,\n }) => {\n const [isFocused, setIsFocused] = useState(false);\n const [hasConflict, setHasConflict] = useState(false);\n const [hasInvalidCombination, setHasInvalidCombination] = useState(false);\n const inputRef = useRef<InputRef>(null);\n const { cx, styles, theme } = useStyles();\n const { t } = useTranslation(hotkeyMessages);\n const isAppleDevice = useMemo(() => checkIsAppleDevice(isApple), [isApple]);\n const [hotkeyValue, setHotkeyValue] = useControlledState(defaultValue, {\n defaultValue,\n onChange,\n value,\n });\n\n const variants = useMemo(\n () =>\n cva(styles.root, {\n defaultVariants: {\n disabled: false,\n error: false,\n shadow: false,\n variant: 'outlined',\n },\n /* eslint-disable sort-keys-fix/sort-keys-fix */\n variants: {\n variant: {\n filled: styles.filled,\n outlined: styles.outlined,\n borderless: styles.borderless,\n },\n shadow: {\n false: null,\n true: styles.shadow,\n },\n focused: {\n false: null,\n true: styles.focused,\n },\n error: {\n fales: null,\n true: styles.error,\n },\n disabled: {\n false: null,\n true: styles.disabled,\n },\n },\n /* eslint-enable sort-keys-fix/sort-keys-fix */\n }),\n [styles],\n );\n\n // 使用 useRecordHotkeys 处理快捷键录入\n const [recordedKeys, { start, stop, isRecording, resetKeys }] = useRecordHotkeys();\n\n useHotkeys(\n '*',\n () => {\n inputRef.current?.blur();\n },\n {\n enableOnContentEditable: true,\n enableOnFormTags: true,\n enabled: isRecording && !disabled,\n keydown: false,\n keyup: true,\n preventDefault: true,\n },\n );\n\n // 处理按键,保证格式正确:修饰键在前,最多一个非修饰键在后\n const formatKeys = useCallback((keysSet: Set<string>) => {\n const modifiers: string[] = [];\n const normalKeys: string[] = [];\n\n for (const key of keysSet) {\n // 处理不同表示的修饰键\n const normalizedKey: any = key.toLowerCase();\n if (NORMATIVE_MODIFIER.includes(normalizedKey)) {\n // 统一修饰键表示\n if (\n (!isAppleDevice && normalizedKey === 'ctrl') ||\n (isAppleDevice && normalizedKey === 'meta')\n ) {\n if (!modifiers.includes('mod')) modifiers.push('mod');\n } else if (!modifiers.includes(normalizedKey)) {\n modifiers.push(normalizedKey);\n }\n } else {\n normalKeys.push(key);\n }\n }\n\n // 至少需要一个修饰键\n if (modifiers.length === 0 && normalKeys.length > 0) {\n return { isValid: false, keys: [] };\n }\n\n // 只允许一个非修饰键,如果有多个,只保留最后一个\n const finalKey = normalKeys.length > 0 ? [normalKeys.at(-1)] : [];\n const shortcuts = [modifiers, finalKey];\n\n return {\n // 组合必须包含至少一个按键\n isValid: shortcuts.every((k) => k.length > 0),\n keys: shortcuts.flat(),\n };\n }, []);\n\n // 获取格式化后的按键字符串\n const { isValid, keys } = formatKeys(recordedKeys);\n const keysString = keys.join('+');\n\n // 检查快捷键冲突\n const checkHotkeyConflict = useCallback(\n (newHotkey: string): boolean => {\n return hotkeyConflicts\n .filter((conflictKey) => conflictKey !== resetValue)\n .some((conflictKey) => {\n const newKeys = splitKeysByPlus(newHotkey);\n const conflictKeys = splitKeysByPlus(conflictKey);\n return isEqual(newKeys, conflictKeys);\n });\n },\n [hotkeyConflicts],\n );\n\n // 当按键组合完成时处理结果\n useEffect(() => {\n if (recordedKeys.size > 0 && !isRecording) {\n if (!isValid) {\n setHasInvalidCombination(true);\n setHasConflict(false);\n return;\n }\n\n setHasInvalidCombination(false);\n const newKeysString = keysString;\n\n // 检查冲突\n const conflict = checkHotkeyConflict(newKeysString);\n if (conflict) {\n setHasConflict(true);\n onConflict?.(newKeysString);\n } else {\n setHasConflict(false);\n setHotkeyValue?.(newKeysString);\n }\n }\n }, [\n recordedKeys,\n isRecording,\n isValid,\n keysString,\n checkHotkeyConflict,\n setHotkeyValue,\n onConflict,\n ]);\n\n // 处理输入框焦点\n const handleFocus = (e: FocusEvent<HTMLInputElement>) => {\n if (disabled) return;\n setIsFocused(true);\n setHasConflict(false);\n setHasInvalidCombination(false);\n start(); // 开始记录\n onFocus?.(e);\n };\n\n const handleBlur = (e: FocusEvent<HTMLInputElement>) => {\n setIsFocused(false);\n stop(); // 停止记录\n onBlur?.(e);\n };\n\n // 重置功能\n const handleReset = (e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setHotkeyValue?.(resetValue);\n resetKeys();\n setHasConflict(false);\n setHasInvalidCombination(false);\n setIsFocused(false);\n stop(); // 停止记录\n onReset?.(hotkeyValue, resetValue);\n };\n\n const handleClick = (e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n if (disabled || isFocused) return;\n inputRef.current?.focus();\n };\n\n const placeholderText = placeholder ?? t('hotkey.placeholder');\n const resetTitle = texts?.reset ?? t('hotkey.reset');\n const conflictText = texts?.conflicts ?? t('hotkey.conflict');\n const invalidText = texts?.invalidCombination ?? t('hotkey.invalidCombination');\n\n return (\n <Flexbox\n className={className}\n gap={8}\n style={{\n position: 'relative',\n ...style,\n }}\n >\n <Flexbox\n align={'center'}\n className={cx(\n variants({\n disabled,\n error: hasConflict || hasInvalidCombination,\n focused: isFocused,\n shadow,\n variant: variant || (theme.isDarkMode ? 'filled' : 'outlined'),\n }),\n )}\n horizontal\n justify={'space-between'}\n onClick={handleClick}\n >\n <div style={{ pointerEvents: 'none' }}>\n {isRecording ? (\n <span className={styles.placeholder}>\n {keys.length > 0 ? <Hotkey keys={keysString} /> : placeholderText}\n </span>\n ) : hotkeyValue ? (\n <Hotkey keys={hotkeyValue} />\n ) : (\n <span className={styles.placeholder}>{placeholderText}</span>\n )}\n </div>\n\n {/* 隐藏的输入框,用于接收焦点 */}\n <input\n className={styles.hiddenInput}\n disabled={disabled}\n onBlur={handleBlur}\n onFocus={handleFocus}\n readOnly\n ref={inputRef as any}\n style={{ pointerEvents: 'none' }}\n />\n\n {!isFocused && allowReset && hotkeyValue && hotkeyValue !== resetValue && !disabled && (\n <ActionIcon\n icon={Undo2Icon}\n onClick={handleReset}\n size={'small'}\n title={resetTitle}\n variant={'filled'}\n />\n )}\n </Flexbox>\n {hasConflict && <div className={styles.errorText}>{conflictText}</div>}\n {hasInvalidCombination && <div className={styles.errorText}>{invalidText}</div>}\n </Flexbox>\n );\n },\n);\n\nHotkeyInput.displayName = 'HotkeyInput';\n\nexport default HotkeyInput;\n"],"mappings":";;;;;;;;;;;;;;;;;;AA6BA,MAAM,cAAc,MACjB,EACC,QAAQ,IACR,eAAe,IACf,aAAa,IACb,UACA,YACA,aACA,UACA,QACA,aAAa,MACb,OACA,WACA,kBAAkB,EAAE,EACpB,SACA,OACA,SACA,QACA,SACA,cACI;CACJ,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;CACjD,MAAM,CAAC,aAAa,kBAAkB,SAAS,MAAM;CACrD,MAAM,CAAC,uBAAuB,4BAA4B,SAAS,MAAM;CACzE,MAAM,WAAW,OAAiB,KAAK;CACvC,MAAM,EAAE,IAAI,QAAQ,UAAU,WAAW;CACzC,MAAM,EAAE,MAAM,eAAeA,eAAe;CAC5C,MAAM,gBAAgB,cAAc,mBAAmB,QAAQ,EAAE,CAAC,QAAQ,CAAC;CAC3E,MAAM,CAAC,aAAa,kBAAkBC,cAAmB,cAAc;EACrE;EACA;EACA;EACD,CAAC;CAEF,MAAM,WAAW,cAEb,IAAI,OAAO,MAA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AAM,eAAe,OAAO,aAAa,EAAE,kBAAkB;CAC7D,MAAM,cAAc,OAAO,sBAAsB,EAAE,4BAA4B;AAE/E,QACE,qBAACC;EACY;EACX,KAAK;EACL,OAAO;GACL,UAAU;GACV,GAAG;GACJ;;GAED,qBAACA;IACC,OAAO;IACP,WAAW,GACT,SAAS;KACP;KACA,OAAO,eAAe;KACtB,SAAS;KACT;KACA,SAAS,YAAY,MAAM,aAAa,WAAW;KACpD,CAAC,CACH;IACD;IACA,SAAS;IACT,SAAS;;KAET,oBAAC;MAAI,OAAO,EAAE,eAAe,QAAQ;gBAClC,cACC,oBAAC;OAAK,WAAW,OAAO;iBACrB,KAAK,SAAS,IAAI,oBAACC,kBAAO,MAAM,aAAc,GAAG;QAC7C,GACL,cACF,oBAACA,kBAAO,MAAM,cAAe,GAE7B,oBAAC;OAAK,WAAW,OAAO;iBAAc;QAAuB;OAE3D;KAGN,oBAAC;MACC,WAAW,OAAO;MACR;MACV,QAAQ;MACR,SAAS;MACT;MACA,KAAK;MACL,OAAO,EAAE,eAAe,QAAQ;OAChC;KAED,CAAC,aAAa,cAAc,eAAe,gBAAgB,cAAc,CAAC,YACzE,oBAACC;MACC,MAAM;MACN,SAAS;MACT,MAAM;MACN,OAAO;MACP,SAAS;OACT;;KAEI;GACT,eAAe,oBAAC;IAAI,WAAW,OAAO;cAAY;KAAmB;GACrE,yBAAyB,oBAAC;IAAI,WAAW,OAAO;cAAY;KAAkB;;GACvE;EAGf;AAED,YAAY,cAAc;AAE1B,0BAAe"}
1
+ {"version":3,"file":"HotkeyInput.mjs","names":["hotkeyMessages","useControlledState","modifiers: string[]","normalKeys: string[]","normalizedKey: any","Flexbox","Hotkey","ActionIcon"],"sources":["../../src/HotkeyInput/HotkeyInput.tsx"],"sourcesContent":["'use client';\n\nimport type { InputRef } from 'antd';\nimport { cva } from 'class-variance-authority';\nimport { isEqual } from 'es-toolkit/compat';\nimport { Undo2Icon } from 'lucide-react';\nimport {\n type FocusEvent,\n type MouseEvent,\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useHotkeys, useRecordHotkeys } from 'react-hotkeys-hook';\nimport useControlledState from 'use-merge-value';\n\nimport ActionIcon from '@/ActionIcon';\nimport { Flexbox } from '@/Flex';\nimport Hotkey from '@/Hotkey';\nimport { NORMATIVE_MODIFIER, checkIsAppleDevice, splitKeysByPlus } from '@/Hotkey/utils';\nimport hotkeyMessages from '@/i18n/resources/en/hotkey';\nimport { useTranslation } from '@/i18n/useTranslation';\n\nimport { useStyles } from './style';\nimport type { HotkeyInputProps } from './type';\n\nconst HotkeyInput = memo<HotkeyInputProps>(\n ({\n value = '',\n defaultValue = '',\n resetValue = '',\n onChange,\n onConflict,\n placeholder,\n disabled,\n shadow,\n allowReset = true,\n style,\n className,\n hotkeyConflicts = [],\n variant,\n texts,\n isApple,\n onBlur,\n onReset,\n onFocus,\n }) => {\n const [isFocused, setIsFocused] = useState(false);\n const [hasConflict, setHasConflict] = useState(false);\n const [hasInvalidCombination, setHasInvalidCombination] = useState(false);\n const inputRef = useRef<InputRef>(null);\n const { cx, styles, theme } = useStyles();\n const { t } = useTranslation(hotkeyMessages);\n const isAppleDevice = useMemo(() => checkIsAppleDevice(isApple), [isApple]);\n const [hotkeyValue, setHotkeyValue] = useControlledState(defaultValue, {\n defaultValue,\n onChange,\n value,\n });\n\n const variants = useMemo(\n () =>\n cva(styles.root, {\n defaultVariants: {\n disabled: false,\n error: false,\n shadow: false,\n variant: 'outlined',\n },\n /* eslint-disable sort-keys-fix/sort-keys-fix */\n variants: {\n variant: {\n filled: styles.filled,\n outlined: styles.outlined,\n borderless: styles.borderless,\n },\n shadow: {\n false: null,\n true: styles.shadow,\n },\n focused: {\n false: null,\n true: styles.focused,\n },\n error: {\n fales: null,\n true: styles.error,\n },\n disabled: {\n false: null,\n true: styles.disabled,\n },\n },\n /* eslint-enable sort-keys-fix/sort-keys-fix */\n }),\n [styles],\n );\n\n // 使用 useRecordHotkeys 处理快捷键录入\n const [recordedKeys, { start, stop, isRecording, resetKeys }] = useRecordHotkeys();\n\n useHotkeys(\n '*',\n () => {\n inputRef.current?.blur();\n },\n {\n enableOnContentEditable: true,\n enableOnFormTags: true,\n enabled: isRecording && !disabled,\n keydown: false,\n keyup: true,\n preventDefault: true,\n },\n );\n\n // 处理按键,保证格式正确:修饰键在前,最多一个非修饰键在后\n const formatKeys = useCallback((keysSet: Set<string>) => {\n const modifiers: string[] = [];\n const normalKeys: string[] = [];\n\n for (const key of keysSet) {\n // 处理不同表示的修饰键\n const normalizedKey: any = key.toLowerCase();\n if (NORMATIVE_MODIFIER.includes(normalizedKey)) {\n // 统一修饰键表示\n if (\n (!isAppleDevice && normalizedKey === 'ctrl') ||\n (isAppleDevice && normalizedKey === 'meta')\n ) {\n if (!modifiers.includes('mod')) modifiers.push('mod');\n } else if (!modifiers.includes(normalizedKey)) {\n modifiers.push(normalizedKey);\n }\n } else {\n normalKeys.push(key);\n }\n }\n\n // 至少需要一个修饰键\n if (modifiers.length === 0 && normalKeys.length > 0) {\n return { isValid: false, keys: [] };\n }\n\n // 只允许一个非修饰键,如果有多个,只保留最后一个\n const finalKey = normalKeys.length > 0 ? [normalKeys.at(-1)] : [];\n const shortcuts = [modifiers, finalKey];\n\n return {\n // 组合必须包含至少一个按键\n isValid: shortcuts.every((k) => k.length > 0),\n keys: shortcuts.flat(),\n };\n }, []);\n\n // 获取格式化后的按键字符串\n const { isValid, keys } = formatKeys(recordedKeys);\n const keysString = keys.join('+');\n\n // 检查快捷键冲突\n const checkHotkeyConflict = useCallback(\n (newHotkey: string): boolean => {\n return hotkeyConflicts\n .filter((conflictKey) => conflictKey !== resetValue)\n .some((conflictKey) => {\n const newKeys = splitKeysByPlus(newHotkey);\n const conflictKeys = splitKeysByPlus(conflictKey);\n return isEqual(newKeys, conflictKeys);\n });\n },\n [hotkeyConflicts],\n );\n\n // 当按键组合完成时处理结果\n useEffect(() => {\n if (recordedKeys.size > 0 && !isRecording) {\n if (!isValid) {\n setHasInvalidCombination(true);\n setHasConflict(false);\n return;\n }\n\n setHasInvalidCombination(false);\n const newKeysString = keysString;\n\n // 检查冲突\n const conflict = checkHotkeyConflict(newKeysString);\n if (conflict) {\n setHasConflict(true);\n onConflict?.(newKeysString);\n } else {\n setHasConflict(false);\n setHotkeyValue?.(newKeysString);\n }\n }\n }, [\n recordedKeys,\n isRecording,\n isValid,\n keysString,\n checkHotkeyConflict,\n setHotkeyValue,\n onConflict,\n ]);\n\n // 处理输入框焦点\n const handleFocus = (e: FocusEvent<HTMLInputElement>) => {\n if (disabled) return;\n setIsFocused(true);\n setHasConflict(false);\n setHasInvalidCombination(false);\n start(); // 开始记录\n onFocus?.(e);\n };\n\n const handleBlur = (e: FocusEvent<HTMLInputElement>) => {\n setIsFocused(false);\n stop(); // 停止记录\n onBlur?.(e);\n };\n\n // 重置功能\n const handleReset = (e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setHotkeyValue?.(resetValue);\n resetKeys();\n setHasConflict(false);\n setHasInvalidCombination(false);\n setIsFocused(false);\n stop(); // 停止记录\n onReset?.(hotkeyValue, resetValue);\n };\n\n const handleClick = (e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n if (disabled || isFocused) return;\n inputRef.current?.focus();\n };\n\n const placeholderText = placeholder ?? t('hotkey.placeholder');\n const resetTitle = texts?.reset ?? t('hotkey.reset');\n const conflictText = texts?.conflicts ?? t('hotkey.conflict');\n const invalidText = texts?.invalidCombination ?? t('hotkey.invalidCombination');\n\n return (\n <Flexbox\n className={className}\n gap={8}\n style={{\n position: 'relative',\n ...style,\n }}\n >\n <Flexbox\n align={'center'}\n className={cx(\n variants({\n disabled,\n error: hasConflict || hasInvalidCombination,\n focused: isFocused,\n shadow,\n variant: variant || (theme.isDarkMode ? 'filled' : 'outlined'),\n }),\n )}\n horizontal\n justify={'space-between'}\n onClick={handleClick}\n >\n <div style={{ pointerEvents: 'none' }}>\n {isRecording ? (\n <span className={styles.placeholder}>\n {keys.length > 0 ? <Hotkey keys={keysString} /> : placeholderText}\n </span>\n ) : hotkeyValue ? (\n <Hotkey keys={hotkeyValue} />\n ) : (\n <span className={styles.placeholder}>{placeholderText}</span>\n )}\n </div>\n\n {/* 隐藏的输入框,用于接收焦点 */}\n <input\n className={styles.hiddenInput}\n disabled={disabled}\n onBlur={handleBlur}\n onFocus={handleFocus}\n readOnly\n ref={inputRef as any}\n style={{ pointerEvents: 'none' }}\n />\n\n {!isFocused && allowReset && hotkeyValue && hotkeyValue !== resetValue && !disabled && (\n <ActionIcon\n icon={Undo2Icon}\n onClick={handleReset}\n size={'small'}\n title={resetTitle}\n variant={'filled'}\n />\n )}\n </Flexbox>\n {hasConflict && <div className={styles.errorText}>{conflictText}</div>}\n {hasInvalidCombination && <div className={styles.errorText}>{invalidText}</div>}\n </Flexbox>\n );\n },\n);\n\nHotkeyInput.displayName = 'HotkeyInput';\n\nexport default HotkeyInput;\n"],"mappings":";;;;;;;;;;;;;;;;;;AA6BA,MAAM,cAAc,MACjB,EACC,QAAQ,IACR,eAAe,IACf,aAAa,IACb,UACA,YACA,aACA,UACA,QACA,aAAa,MACb,OACA,WACA,kBAAkB,EAAE,EACpB,SACA,OACA,SACA,QACA,SACA,cACI;CACJ,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;CACjD,MAAM,CAAC,aAAa,kBAAkB,SAAS,MAAM;CACrD,MAAM,CAAC,uBAAuB,4BAA4B,SAAS,MAAM;CACzE,MAAM,WAAW,OAAiB,KAAK;CACvC,MAAM,EAAE,IAAI,QAAQ,UAAU,WAAW;CACzC,MAAM,EAAE,MAAM,eAAeA,eAAe;CAC5C,MAAM,gBAAgB,cAAc,mBAAmB,QAAQ,EAAE,CAAC,QAAQ,CAAC;CAC3E,MAAM,CAAC,aAAa,kBAAkBC,cAAmB,cAAc;EACrE;EACA;EACA;EACD,CAAC;CAEF,MAAM,WAAW,cAEb,IAAI,OAAO,MAAM;EACf,iBAAiB;GACf,UAA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AAE,kBAAkB;CAC7D,MAAM,cAAc,OAAO,sBAAsB,EAAE,4BAA4B;AAE/E,QACE,qBAACC;EACY;EACX,KAAK;EACL,OAAO;GACL,UAAU;GACV,GAAG;GACJ;;GAED,qBAACA;IACC,OAAO;IACP,WAAW,GACT,SAAS;KACP;KACA,OAAO,eAAe;KACtB,SAAS;KACT;KACA,SAAS,YAAY,MAAM,aAAa,WAAW;KACpD,CAAC,CACH;IACD;IACA,SAAS;IACT,SAAS;;KAET,oBAAC;MAAI,OAAO,EAAE,eAAe,QAAQ;gBAClC,cACC,oBAAC;OAAK,WAAW,OAAO;iBACrB,KAAK,SAAS,IAAI,oBAACC,kBAAO,MAAM,aAAc,GAAG;QAC7C,GACL,cACF,oBAACA,kBAAO,MAAM,cAAe,GAE7B,oBAAC;OAAK,WAAW,OAAO;iBAAc;QAAuB;OAE3D;KAGN,oBAAC;MACC,WAAW,OAAO;MACR;MACV,QAAQ;MACR,SAAS;MACT;MACA,KAAK;MACL,OAAO,EAAE,eAAe,QAAQ;OAChC;KAED,CAAC,aAAa,cAAc,eAAe,gBAAgB,cAAc,CAAC,YACzE,oBAACC;MACC,MAAM;MACN,SAAS;MACT,MAAM;MACN,OAAO;MACP,SAAS;OACT;;KAEI;GACT,eAAe,oBAAC;IAAI,WAAW,OAAO;cAAY;KAAmB;GACrE,yBAAyB,oBAAC;IAAI,WAAW,OAAO;cAAY;KAAkB;;GACvE;EAGf;AAED,YAAY,cAAc;AAE1B,0BAAe"}
@@ -1,8 +1,8 @@
1
1
  import { IconProps } from "./type.mjs";
2
- import * as react37 from "react";
2
+ import * as react68 from "react";
3
3
 
4
4
  //#region src/Icon/Icon.d.ts
5
- declare const Icon: react37.NamedExoticComponent<IconProps>;
5
+ declare const Icon: react68.NamedExoticComponent<IconProps>;
6
6
  //#endregion
7
7
  export { Icon };
8
8
  //# sourceMappingURL=Icon.d.mts.map
@@ -1,11 +1,11 @@
1
1
  import { IconProps } from "../type.mjs";
2
- import * as react35 from "react";
2
+ import * as react66 from "react";
3
3
  import { ReactNode } from "react";
4
4
 
5
5
  //#region src/Icon/components/IconProvider.d.ts
6
6
  type IconContentConfig = Omit<IconProps, 'icon' | 'ref'>;
7
- declare const IconContext: react35.Context<IconContentConfig>;
8
- declare const IconProvider: react35.NamedExoticComponent<{
7
+ declare const IconContext: react66.Context<IconContentConfig>;
8
+ declare const IconProvider: react66.NamedExoticComponent<{
9
9
  children: ReactNode;
10
10
  config?: IconContentConfig;
11
11
  }>;
@@ -1,4 +1,4 @@
1
- import { isNumber } from "lodash-es";
1
+ import { isNumber } from "es-toolkit/compat";
2
2
 
3
3
  //#region src/Icon/components/utils.ts
4
4
  const calcSize = (iconSize) => {
@@ -1 +1 @@
1
- {"version":3,"file":"utils.mjs","names":["size: number | string","strokeWidth: number | string"],"sources":["../../../src/Icon/components/utils.ts"],"sourcesContent":["import { isNumber } from 'lodash-es';\n\nimport type { IconSize } from '../type';\n\nexport const calcSize = (iconSize?: IconSize) => {\n if (isNumber(iconSize)) {\n return { size: iconSize };\n }\n\n let size: number | string;\n let strokeWidth: number | string;\n\n switch (iconSize) {\n case 'large': {\n size = 24;\n strokeWidth = 2;\n break;\n }\n case 'middle': {\n size = 20;\n strokeWidth = 2;\n break;\n }\n case 'small': {\n size = 14;\n strokeWidth = 2;\n break;\n }\n default: {\n if (iconSize) {\n size = iconSize?.size || 24;\n strokeWidth = iconSize?.strokeWidth || 2;\n } else {\n size = '1em';\n strokeWidth = 2;\n }\n break;\n }\n }\n return { size, strokeWidth };\n};\n"],"mappings":";;;AAIA,MAAa,YAAY,aAAwB;AAC/C,KAAI,SAAS,SAAS,CACpB,QAAO,EAAE,MAAM,UAAU;CAG3B,IAAIA;CACJ,IAAIC;AAEJ,SAAQ,UAAR;EACE,KAAK;AACH,UAAO;AACP,iBAAc;AACd;EAEF,KAAK;AACH,UAAO;AACP,iBAAc;AACd;EAEF,KAAK;AACH,UAAO;AACP,iBAAc;AACd;EAEF;AACE,OAAI,UAAU;AACZ,WAAO,UAAU,QAAQ;AACzB,kBAAc,UAAU,eAAe;UAClC;AACL,WAAO;AACP,kBAAc;;AAEhB;;AAGJ,QAAO;EAAE;EAAM;EAAa"}
1
+ {"version":3,"file":"utils.mjs","names":["size: number | string","strokeWidth: number | string"],"sources":["../../../src/Icon/components/utils.ts"],"sourcesContent":["import { isNumber } from 'es-toolkit/compat';\n\nimport type { IconSize } from '../type';\n\nexport const calcSize = (iconSize?: IconSize) => {\n if (isNumber(iconSize)) {\n return { size: iconSize };\n }\n\n let size: number | string;\n let strokeWidth: number | string;\n\n switch (iconSize) {\n case 'large': {\n size = 24;\n strokeWidth = 2;\n break;\n }\n case 'middle': {\n size = 20;\n strokeWidth = 2;\n break;\n }\n case 'small': {\n size = 14;\n strokeWidth = 2;\n break;\n }\n default: {\n if (iconSize) {\n size = iconSize?.size || 24;\n strokeWidth = iconSize?.strokeWidth || 2;\n } else {\n size = '1em';\n strokeWidth = 2;\n }\n break;\n }\n }\n return { size, strokeWidth };\n};\n"],"mappings":";;;AAIA,MAAa,YAAY,aAAwB;AAC/C,KAAI,SAAS,SAAS,CACpB,QAAO,EAAE,MAAM,UAAU;CAG3B,IAAIA;CACJ,IAAIC;AAEJ,SAAQ,UAAR;EACE,KAAK;AACH,UAAO;AACP,iBAAc;AACd;EAEF,KAAK;AACH,UAAO;AACP,iBAAc;AACd;EAEF,KAAK;AACH,UAAO;AACP,iBAAc;AACd;EAEF;AACE,OAAI,UAAU;AACZ,WAAO,UAAU,QAAQ;AACzB,kBAAc,UAAU,eAAe;UAClC;AACL,WAAO;AACP,kBAAc;;AAEhB;;AAGJ,QAAO;EAAE;EAAM;EAAa"}
@@ -1,8 +1,8 @@
1
1
  import { PreviewGroupProps } from "./type.mjs";
2
- import * as react26 from "react";
2
+ import * as react28 from "react";
3
3
 
4
4
  //#region src/Image/PreviewGroup.d.ts
5
- declare const PreviewGroup: react26.NamedExoticComponent<PreviewGroupProps>;
5
+ declare const PreviewGroup: react28.NamedExoticComponent<PreviewGroupProps>;
6
6
  //#endregion
7
7
  export { PreviewGroup };
8
8
  //# sourceMappingURL=PreviewGroup.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { ImageSelectProps } from "./type.mjs";
2
- import * as react106 from "react";
2
+ import * as react105 from "react";
3
3
 
4
4
  //#region src/ImageSelect/ImageSelect.d.ts
5
- declare const ImageSelect: react106.NamedExoticComponent<ImageSelectProps>;
5
+ declare const ImageSelect: react105.NamedExoticComponent<ImageSelectProps>;
6
6
  //#endregion
7
7
  export { ImageSelect };
8
8
  //# sourceMappingURL=ImageSelect.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { InputProps } from "./type.mjs";
2
- import * as react131 from "react";
2
+ import * as react129 from "react";
3
3
 
4
4
  //#region src/Input/Input.d.ts
5
- declare const Input: react131.NamedExoticComponent<InputProps>;
5
+ declare const Input: react129.NamedExoticComponent<InputProps>;
6
6
  //#endregion
7
7
  export { Input };
8
8
  //# sourceMappingURL=Input.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { InputOPTProps } from "./type.mjs";
2
- import * as react132 from "react";
2
+ import * as react131 from "react";
3
3
 
4
4
  //#region src/Input/InputOPT.d.ts
5
- declare const InputOPT: react132.NamedExoticComponent<InputOPTProps>;
5
+ declare const InputOPT: react131.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 react134 from "react";
2
+ import * as react132 from "react";
3
3
 
4
4
  //#region src/Input/InputPassword.d.ts
5
- declare const InputPassword: react134.NamedExoticComponent<InputPasswordProps>;
5
+ declare const InputPassword: react132.NamedExoticComponent<InputPasswordProps>;
6
6
  //#endregion
7
7
  export { InputPassword };
8
8
  //# sourceMappingURL=InputPassword.d.mts.map
@@ -1,9 +1,9 @@
1
1
  import { DivProps } from "../../types/index.mjs";
2
2
  import "../../index.mjs";
3
- import * as react27 from "react";
3
+ import * as react22 from "react";
4
4
 
5
5
  //#region src/Layout/components/LayoutFooter.d.ts
6
- declare const LayoutFooter: react27.NamedExoticComponent<DivProps>;
6
+ declare const LayoutFooter: react22.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 react29 from "react";
2
+ import * as react23 from "react";
3
3
 
4
4
  //#region src/Layout/components/LayoutHeader.d.ts
5
- declare const LayoutHeader: react29.NamedExoticComponent<LayoutHeaderProps>;
5
+ declare const LayoutHeader: react23.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 react30 from "react";
3
+ import * as react24 from "react";
4
4
 
5
5
  //#region src/Layout/components/LayoutMain.d.ts
6
- declare const LayoutMain: react30.NamedExoticComponent<DivProps>;
6
+ declare const LayoutMain: react24.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 react28 from "react";
2
+ import * as react25 from "react";
3
3
 
4
4
  //#region src/Layout/components/LayoutSidebar.d.ts
5
- declare const LayoutSidebar: react28.NamedExoticComponent<LayoutSidebarProps>;
5
+ declare const LayoutSidebar: react25.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 react32 from "react";
2
+ import * as react26 from "react";
3
3
 
4
4
  //#region src/Layout/components/LayoutSidebarInner.d.ts
5
- declare const LayoutSidebarInner: react32.NamedExoticComponent<LayoutSidebarInnerProps>;
5
+ declare const LayoutSidebarInner: react26.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 react31 from "react";
2
+ import * as react27 from "react";
3
3
 
4
4
  //#region src/Layout/components/LayoutToc.d.ts
5
- declare const LayoutToc: react31.NamedExoticComponent<LayoutTocProps>;
5
+ declare const LayoutToc: react27.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 react25 from "react";
2
+ import * as react21 from "react";
3
3
 
4
4
  //#region src/List/ListItem/index.d.ts
5
- declare const ListItem: react25.NamedExoticComponent<ListItemProps>;
5
+ declare const ListItem: react21.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 react24 from "react";
2
+ import * as react19 from "react";
3
3
 
4
4
  //#region src/Markdown/Markdown.d.ts
5
- declare const Markdown: react24.NamedExoticComponent<MarkdownProps>;
5
+ declare const Markdown: react19.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 react23 from "react";
2
+ import * as react18 from "react";
3
3
 
4
4
  //#region src/Markdown/Typography.d.ts
5
- declare const Typography: react23.NamedExoticComponent<TypographyProps>;
5
+ declare const Typography: react18.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 react69 from "react";
3
+ import * as react60 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: react69.NamedExoticComponent<SearchResultCardsProps>;
17
+ declare const SearchResultCards: react60.NamedExoticComponent<SearchResultCardsProps>;
18
18
  //#endregion
19
19
  export { SearchResultCards, SearchResultCardsProps };
20
20
  //# sourceMappingURL=index.d.mts.map