@lobehub/ui 5.3.0 → 5.5.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/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/EmojiPicker/EmojiPicker.d.mts +2 -2
- package/es/EmojiPicker/EmojiPicker.mjs +1 -1
- package/es/EmojiPicker/type.d.mts +1 -1
- package/es/Flex/FlexBasic.d.mts +2 -2
- package/es/FontLoader/index.d.mts +2 -2
- package/es/Footer/Footer.d.mts +2 -2
- package/es/Form/components/FormGroup.d.mts +2 -2
- package/es/Form/components/FormItem.d.mts +2 -2
- package/es/Form/components/FormSubmitFooter.d.mts +2 -2
- package/es/FormModal/FormModal.d.mts +2 -2
- package/es/Freeze/Freeze.d.mts +2 -2
- package/es/GuideCard/GuideCard.d.mts +2 -2
- package/es/Header/Header.d.mts +2 -2
- package/es/Highlighter/Highlighter.d.mts +2 -2
- package/es/Highlighter/SyntaxHighlighter/index.d.mts +2 -2
- package/es/Hotkey/Hotkey.d.mts +2 -2
- package/es/HotkeyInput/HotkeyInput.d.mts +2 -2
- package/es/HotkeyInput/HotkeyInput.mjs +30 -8
- package/es/HotkeyInput/HotkeyInput.mjs.map +1 -1
- package/es/HotkeyInput/type.d.mts +3 -0
- package/es/Icon/Icon.d.mts +2 -2
- package/es/Icon/components/IconProvider.d.mts +3 -3
- package/es/Image/PreviewGroup.d.mts +2 -2
- 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/Markdown.mjs +2 -1
- package/es/Markdown/Markdown.mjs.map +1 -1
- package/es/Markdown/SyntaxMarkdown/StreamdownRender.mjs +56 -30
- package/es/Markdown/SyntaxMarkdown/StreamdownRender.mjs.map +1 -1
- package/es/Markdown/SyntaxMarkdown/style.mjs +2 -2
- package/es/Markdown/SyntaxMarkdown/style.mjs.map +1 -1
- package/es/Markdown/SyntaxMarkdown/useSmoothStreamContent.mjs +229 -0
- package/es/Markdown/SyntaxMarkdown/useSmoothStreamContent.mjs.map +1 -0
- package/es/Markdown/SyntaxMarkdown/useStreamQueue.mjs +8 -6
- package/es/Markdown/SyntaxMarkdown/useStreamQueue.mjs.map +1 -1
- package/es/Markdown/Typography.d.mts +2 -2
- package/es/Markdown/components/SearchResultCards/index.d.mts +2 -2
- package/es/Markdown/index.d.mts +2 -2
- package/es/Markdown/plugins/rehypeStreamAnimated.d.mts +2 -0
- package/es/Markdown/plugins/rehypeStreamAnimated.mjs +17 -5
- package/es/Markdown/plugins/rehypeStreamAnimated.mjs.map +1 -1
- package/es/Markdown/type.d.mts +3 -1
- package/es/MaskShadow/MaskShadow.d.mts +2 -2
- package/es/Menu/Menu.d.mts +2 -2
- package/es/Mermaid/Mermaid.d.mts +2 -2
- package/es/Mermaid/SyntaxMermaid/index.d.mts +2 -2
- package/es/Modal/Modal.d.mts +2 -2
- package/es/Modal/ModalProvider.d.mts +2 -2
- package/es/Modal/ModalStackItem.mjs +2 -2
- package/es/Modal/ModalStackItem.mjs.map +1 -1
- package/es/Modal/imperative.d.mts +2 -2
- package/es/MotionProvider/index.d.mts +2 -2
- package/es/Popover/index.d.mts +9 -8
- package/es/Popover/index.mjs +6 -6
- 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/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.d.mts +2 -2
- package/es/base-ui/DropdownMenu/DropdownMenu.d.mts +2 -2
- package/es/base-ui/DropdownMenu/atoms.d.mts +18 -18
- package/es/base-ui/Modal/atoms.d.mts +12 -12
- package/es/base-ui/Modal/context.d.mts +2 -2
- package/es/base-ui/Modal/imperative.d.mts +2 -2
- package/es/base-ui/Popover/ArrowIcon.d.mts +7 -0
- package/es/{Popover → base-ui/Popover}/ArrowIcon.mjs +1 -1
- package/es/base-ui/Popover/ArrowIcon.mjs.map +1 -0
- package/es/{Popover → base-ui/Popover}/Popover.d.mts +2 -2
- package/es/{Popover → base-ui/Popover}/Popover.mjs +2 -2
- package/es/base-ui/Popover/Popover.mjs.map +1 -0
- package/es/{Popover → base-ui/Popover}/PopoverGroup.d.mts +1 -1
- package/es/{Popover → base-ui/Popover}/PopoverGroup.mjs +4 -4
- package/es/base-ui/Popover/PopoverGroup.mjs.map +1 -0
- package/es/{Popover → base-ui/Popover}/PopoverInGroup.mjs +3 -3
- package/es/base-ui/Popover/PopoverInGroup.mjs.map +1 -0
- package/es/{Popover → base-ui/Popover}/PopoverPortal.d.mts +1 -1
- package/es/{Popover → base-ui/Popover}/PopoverPortal.mjs +2 -2
- package/es/base-ui/Popover/PopoverPortal.mjs.map +1 -0
- package/es/{Popover → base-ui/Popover}/PopoverStandalone.mjs +5 -5
- package/es/base-ui/Popover/PopoverStandalone.mjs.map +1 -0
- package/es/{Popover → base-ui/Popover}/atoms.d.mts +10 -10
- package/es/{Popover → base-ui/Popover}/atoms.mjs +4 -4
- package/es/base-ui/Popover/atoms.mjs.map +1 -0
- package/es/{Popover → base-ui/Popover}/context.d.mts +3 -3
- package/es/{Popover → base-ui/Popover}/context.mjs +1 -1
- package/es/base-ui/Popover/context.mjs.map +1 -0
- package/es/{Popover → base-ui/Popover}/groupContext.d.mts +1 -1
- package/es/{Popover → base-ui/Popover}/groupContext.mjs +1 -1
- package/es/base-ui/Popover/groupContext.mjs.map +1 -0
- package/es/base-ui/Popover/index.d.mts +8 -0
- package/es/{Popover → base-ui/Popover}/style.mjs +2 -2
- package/es/base-ui/Popover/style.mjs.map +1 -0
- package/es/{Popover → base-ui/Popover}/type.d.mts +4 -4
- package/es/{Popover → base-ui/Popover}/useMergedPopoverProps.mjs +1 -1
- package/es/base-ui/Popover/useMergedPopoverProps.mjs.map +1 -0
- 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/Switch/Switch.d.mts +2 -2
- package/es/base-ui/Switch/atoms.d.mts +4 -4
- package/es/base-ui/Toast/imperative.d.mts +2 -2
- package/es/base-ui/index.d.mts +9 -1
- package/es/base-ui/index.mjs +7 -1
- package/es/brand/LobeChat/index.d.mts +2 -2
- package/es/brand/LobeHub/index.d.mts +2 -2
- package/es/brand/LogoThree/LogoSpline.d.mts +2 -2
- package/es/brand/LogoThree/index.d.mts +2 -2
- package/es/chat/BackBottom/BackBottom.d.mts +2 -2
- package/es/chat/ChatInputArea/components/ChatInputAreaInner.d.mts +2 -2
- package/es/chat/ChatItem/ChatItem.d.mts +2 -2
- package/es/chat/ChatList/ChatList.d.mts +2 -2
- package/es/chat/EditableMessage/EditableMessage.d.mts +2 -2
- package/es/chat/EditableMessageList/EditableMessageList.d.mts +2 -2
- package/es/chat/MessageInput/MessageInput.d.mts +2 -2
- package/es/chat/MessageModal/MessageModal.d.mts +2 -2
- package/es/color/ColorScales/index.d.mts +2 -2
- package/es/color/CssVar/index.d.mts +2 -2
- package/es/i18n/context.d.mts +2 -2
- package/es/i18n/resources/en/hotkey.d.mts +1 -0
- package/es/i18n/resources/en/hotkey.mjs +1 -0
- package/es/i18n/resources/en/hotkey.mjs.map +1 -1
- package/es/i18n/resources/zhCn/hotkey.d.mts +1 -0
- package/es/i18n/resources/zhCn/hotkey.mjs +1 -0
- package/es/i18n/resources/zhCn/hotkey.mjs.map +1 -1
- package/es/icons/Discord/components/Avatar.d.mts +9 -0
- package/es/icons/Discord/components/Avatar.mjs +22 -0
- package/es/icons/Discord/components/Avatar.mjs.map +1 -0
- package/es/icons/Discord/components/Color.d.mts +7 -0
- package/es/icons/Discord/components/Color.mjs +30 -0
- package/es/icons/Discord/components/Color.mjs.map +1 -0
- package/es/icons/Discord/components/Mono.d.mts +7 -0
- package/es/icons/Discord/components/Mono.mjs +29 -0
- package/es/icons/Discord/components/Mono.mjs.map +1 -0
- package/es/icons/Discord/index.d.mts +15 -0
- package/es/icons/Discord/index.mjs +18 -0
- package/es/icons/Discord/index.mjs.map +1 -0
- package/es/icons/Discord/style.mjs +7 -0
- package/es/icons/Discord/style.mjs.map +1 -0
- package/es/icons/GoogleChat/components/Avatar.d.mts +9 -0
- package/es/icons/GoogleChat/components/Avatar.mjs +23 -0
- package/es/icons/GoogleChat/components/Avatar.mjs.map +1 -0
- package/es/icons/GoogleChat/components/Color.d.mts +7 -0
- package/es/icons/GoogleChat/components/Color.mjs +93 -0
- package/es/icons/GoogleChat/components/Color.mjs.map +1 -0
- package/es/icons/GoogleChat/components/Mono.d.mts +7 -0
- package/es/icons/GoogleChat/components/Mono.mjs +29 -0
- package/es/icons/GoogleChat/components/Mono.mjs.map +1 -0
- package/es/icons/GoogleChat/index.d.mts +15 -0
- package/es/icons/GoogleChat/index.mjs +18 -0
- package/es/icons/GoogleChat/index.mjs.map +1 -0
- package/es/icons/GoogleChat/style.mjs +7 -0
- package/es/icons/GoogleChat/style.mjs.map +1 -0
- package/es/icons/IMessage/components/Avatar.d.mts +9 -0
- package/es/icons/IMessage/components/Avatar.mjs +23 -0
- package/es/icons/IMessage/components/Avatar.mjs.map +1 -0
- package/es/icons/IMessage/components/Color.d.mts +7 -0
- package/es/icons/IMessage/components/Color.mjs +30 -0
- package/es/icons/IMessage/components/Color.mjs.map +1 -0
- package/es/icons/IMessage/components/Inner.mjs +29 -0
- package/es/icons/IMessage/components/Inner.mjs.map +1 -0
- package/es/icons/IMessage/components/Mono.d.mts +7 -0
- package/es/icons/IMessage/components/Mono.mjs +29 -0
- package/es/icons/IMessage/components/Mono.mjs.map +1 -0
- package/es/icons/IMessage/index.d.mts +15 -0
- package/es/icons/IMessage/index.mjs +18 -0
- package/es/icons/IMessage/index.mjs.map +1 -0
- package/es/icons/IMessage/style.mjs +7 -0
- package/es/icons/IMessage/style.mjs.map +1 -0
- package/es/icons/Lark/components/Avatar.d.mts +9 -0
- package/es/icons/Lark/components/Avatar.mjs +22 -0
- package/es/icons/Lark/components/Avatar.mjs.map +1 -0
- package/es/icons/Lark/components/Color.d.mts +7 -0
- package/es/icons/Lark/components/Color.mjs +41 -0
- package/es/icons/Lark/components/Color.mjs.map +1 -0
- package/es/icons/Lark/components/Mono.d.mts +7 -0
- package/es/icons/Lark/components/Mono.mjs +32 -0
- package/es/icons/Lark/components/Mono.mjs.map +1 -0
- package/es/icons/Lark/index.d.mts +15 -0
- package/es/icons/Lark/index.mjs +18 -0
- package/es/icons/Lark/index.mjs.map +1 -0
- package/es/icons/Lark/style.mjs +7 -0
- package/es/icons/Lark/style.mjs.map +1 -0
- package/es/icons/MicrosoftTeams/components/Avatar.d.mts +9 -0
- package/es/icons/MicrosoftTeams/components/Avatar.mjs +22 -0
- package/es/icons/MicrosoftTeams/components/Avatar.mjs.map +1 -0
- package/es/icons/MicrosoftTeams/components/Color.d.mts +7 -0
- package/es/icons/MicrosoftTeams/components/Color.mjs +50 -0
- package/es/icons/MicrosoftTeams/components/Color.mjs.map +1 -0
- package/es/icons/MicrosoftTeams/components/Mono.d.mts +7 -0
- package/es/icons/MicrosoftTeams/components/Mono.mjs +37 -0
- package/es/icons/MicrosoftTeams/components/Mono.mjs.map +1 -0
- package/es/icons/MicrosoftTeams/index.d.mts +15 -0
- package/es/icons/MicrosoftTeams/index.mjs +18 -0
- package/es/icons/MicrosoftTeams/index.mjs.map +1 -0
- package/es/icons/MicrosoftTeams/style.mjs +7 -0
- package/es/icons/MicrosoftTeams/style.mjs.map +1 -0
- package/es/icons/QQ/components/Avatar.d.mts +9 -0
- package/es/icons/QQ/components/Avatar.mjs +22 -0
- package/es/icons/QQ/components/Avatar.mjs.map +1 -0
- package/es/icons/QQ/components/Color.d.mts +7 -0
- package/es/icons/QQ/components/Color.mjs +61 -0
- package/es/icons/QQ/components/Color.mjs.map +1 -0
- package/es/icons/QQ/components/Mono.d.mts +7 -0
- package/es/icons/QQ/components/Mono.mjs +29 -0
- package/es/icons/QQ/components/Mono.mjs.map +1 -0
- package/es/icons/QQ/index.d.mts +15 -0
- package/es/icons/QQ/index.mjs +18 -0
- package/es/icons/QQ/index.mjs.map +1 -0
- package/es/icons/QQ/style.mjs +7 -0
- package/es/icons/QQ/style.mjs.map +1 -0
- package/es/icons/Slack/components/Avatar.d.mts +9 -0
- package/es/icons/Slack/components/Avatar.mjs +22 -0
- package/es/icons/Slack/components/Avatar.mjs.map +1 -0
- package/es/icons/Slack/components/Color.d.mts +7 -0
- package/es/icons/Slack/components/Color.mjs +45 -0
- package/es/icons/Slack/components/Color.mjs.map +1 -0
- package/es/icons/Slack/components/Mono.d.mts +7 -0
- package/es/icons/Slack/components/Mono.mjs +35 -0
- package/es/icons/Slack/components/Mono.mjs.map +1 -0
- package/es/icons/Slack/index.d.mts +15 -0
- package/es/icons/Slack/index.mjs +18 -0
- package/es/icons/Slack/index.mjs.map +1 -0
- package/es/icons/Slack/style.mjs +7 -0
- package/es/icons/Slack/style.mjs.map +1 -0
- package/es/icons/Telegram/components/Avatar.d.mts +9 -0
- package/es/icons/Telegram/components/Avatar.mjs +23 -0
- package/es/icons/Telegram/components/Avatar.mjs.map +1 -0
- package/es/icons/Telegram/components/Color.d.mts +7 -0
- package/es/icons/Telegram/components/Color.mjs +30 -0
- package/es/icons/Telegram/components/Color.mjs.map +1 -0
- package/es/icons/Telegram/components/Inner.mjs +29 -0
- package/es/icons/Telegram/components/Inner.mjs.map +1 -0
- package/es/icons/Telegram/components/Mono.d.mts +7 -0
- package/es/icons/Telegram/components/Mono.mjs +29 -0
- package/es/icons/Telegram/components/Mono.mjs.map +1 -0
- package/es/icons/Telegram/index.d.mts +15 -0
- package/es/icons/Telegram/index.mjs +18 -0
- package/es/icons/Telegram/index.mjs.map +1 -0
- package/es/icons/Telegram/style.mjs +7 -0
- package/es/icons/Telegram/style.mjs.map +1 -0
- package/es/icons/WeChat/components/Avatar.d.mts +9 -0
- package/es/icons/WeChat/components/Avatar.mjs +22 -0
- package/es/icons/WeChat/components/Avatar.mjs.map +1 -0
- package/es/icons/WeChat/components/Color.d.mts +7 -0
- package/es/icons/WeChat/components/Color.mjs +30 -0
- package/es/icons/WeChat/components/Color.mjs.map +1 -0
- package/es/icons/WeChat/components/Mono.d.mts +7 -0
- package/es/icons/WeChat/components/Mono.mjs +29 -0
- package/es/icons/WeChat/components/Mono.mjs.map +1 -0
- package/es/icons/WeChat/index.d.mts +15 -0
- package/es/icons/WeChat/index.mjs +18 -0
- package/es/icons/WeChat/index.mjs.map +1 -0
- package/es/icons/WeChat/style.mjs +7 -0
- package/es/icons/WeChat/style.mjs.map +1 -0
- package/es/icons/WhatsApp/components/Avatar.d.mts +9 -0
- package/es/icons/WhatsApp/components/Avatar.mjs +23 -0
- package/es/icons/WhatsApp/components/Avatar.mjs.map +1 -0
- package/es/icons/WhatsApp/components/Color.d.mts +7 -0
- package/es/icons/WhatsApp/components/Color.mjs +30 -0
- package/es/icons/WhatsApp/components/Color.mjs.map +1 -0
- package/es/icons/WhatsApp/components/Mono.d.mts +7 -0
- package/es/icons/WhatsApp/components/Mono.mjs +29 -0
- package/es/icons/WhatsApp/components/Mono.mjs.map +1 -0
- package/es/icons/WhatsApp/index.d.mts +15 -0
- package/es/icons/WhatsApp/index.mjs +18 -0
- package/es/icons/WhatsApp/index.mjs.map +1 -0
- package/es/icons/WhatsApp/style.mjs +7 -0
- package/es/icons/WhatsApp/style.mjs.map +1 -0
- package/es/icons/index.d.mts +17 -5
- package/es/icons/index.mjs +13 -1
- package/es/icons/lucideExtra/BotPromptIcon.d.mts +2 -2
- package/es/icons/lucideExtra/BrainOffIcon.d.mts +8 -0
- package/es/icons/lucideExtra/BrainOffIcon.mjs +31 -0
- package/es/icons/lucideExtra/BrainOffIcon.mjs.map +1 -0
- package/es/icons/lucideExtra/CreateBotIcon.d.mts +3 -3
- package/es/icons/lucideExtra/DiscordIcon.d.mts +3 -3
- package/es/icons/lucideExtra/GlobeOffIcon.d.mts +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 +2 -2
- package/es/icons/lucideExtra/RightDoubleClickIcon.d.mts +3 -3
- package/es/icons/lucideExtra/ShapesUploadIcon.d.mts +2 -2
- package/es/icons/lucideExtra/SkillsIcon.d.mts +3 -3
- package/es/icons/lucideExtra/ThinkIcon.d.mts +8 -0
- package/es/icons/lucideExtra/ThinkIcon.mjs +16 -0
- package/es/icons/lucideExtra/ThinkIcon.mjs.map +1 -0
- package/es/icons/lucideExtra/TreeDownRightIcon.d.mts +3 -3
- package/es/icons/lucideExtra/TreeUpDownRightIcon.d.mts +3 -3
- package/es/icons/lucideExtra/index.d.mts +2 -0
- package/es/index.d.mts +7 -7
- package/es/index.mjs +6 -6
- package/es/mdx/Mdx/index.d.mts +2 -2
- package/es/mobile/ChatHeader/ChatHeaderTitle.d.mts +2 -2
- package/es/mobile/ChatInputArea/components/ChatSendButton.d.mts +2 -2
- package/es/mobile/TabBar/TabBar.d.mts +2 -2
- package/es/storybook/StoryBook/index.d.mts +2 -2
- package/package.json +1 -1
- package/es/Popover/ArrowIcon.d.mts +0 -7
- package/es/Popover/ArrowIcon.mjs.map +0 -1
- package/es/Popover/Popover.mjs.map +0 -1
- package/es/Popover/PopoverGroup.mjs.map +0 -1
- package/es/Popover/PopoverInGroup.mjs.map +0 -1
- package/es/Popover/PopoverPortal.mjs.map +0 -1
- package/es/Popover/PopoverStandalone.mjs.map +0 -1
- package/es/Popover/atoms.mjs.map +0 -1
- package/es/Popover/context.mjs.map +0 -1
- package/es/Popover/groupContext.mjs.map +0 -1
- package/es/Popover/style.mjs.map +0 -1
- package/es/Popover/useMergedPopoverProps.mjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AccordionProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react28 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Accordion/Accordion.d.ts
|
|
5
|
-
declare const Accordion:
|
|
5
|
+
declare const Accordion: react28.NamedExoticComponent<AccordionProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Accordion };
|
|
8
8
|
//# sourceMappingURL=Accordion.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AccordionItemProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react29 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Accordion/AccordionItem.d.ts
|
|
5
|
-
declare const AccordionItem:
|
|
5
|
+
declare const AccordionItem: react29.NamedExoticComponent<AccordionItemProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { AccordionItem };
|
|
8
8
|
//# sourceMappingURL=AccordionItem.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ActionIconProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react65 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/ActionIcon/ActionIcon.d.ts
|
|
5
|
-
declare const ActionIcon:
|
|
5
|
+
declare const ActionIcon: react65.NamedExoticComponent<ActionIconProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { ActionIcon };
|
|
8
8
|
//# sourceMappingURL=ActionIcon.d.mts.map
|
package/es/Alert/Alert.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AlertProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react3 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Alert/Alert.d.ts
|
|
5
|
-
declare const Alert:
|
|
5
|
+
declare const Alert: react3.NamedExoticComponent<AlertProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Alert };
|
|
8
8
|
//# sourceMappingURL=Alert.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AutoCompleteProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react27 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/AutoComplete/Select.d.ts
|
|
5
|
-
declare const AutoComplete:
|
|
5
|
+
declare const AutoComplete: react27.NamedExoticComponent<AutoCompleteProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { AutoComplete };
|
|
8
8
|
//# sourceMappingURL=Select.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AvatarGroupProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react25 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Avatar/AvatarGroup/index.d.ts
|
|
5
|
-
declare const AvatarGroup:
|
|
5
|
+
declare const AvatarGroup: react25.NamedExoticComponent<AvatarGroupProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { AvatarGroup };
|
|
8
8
|
//# sourceMappingURL=index.d.mts.map
|
package/es/Burger/Burger.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BurgerProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react26 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Burger/Burger.d.ts
|
|
5
|
-
declare const Burger:
|
|
5
|
+
declare const Burger: react26.NamedExoticComponent<BurgerProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Burger };
|
|
8
8
|
//# sourceMappingURL=Burger.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CodeEditorProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react22 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/CodeEditor/CodeEditor.d.ts
|
|
5
|
-
declare const CodeEditor:
|
|
5
|
+
declare const CodeEditor: react22.NamedExoticComponent<CodeEditorProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { CodeEditor };
|
|
8
8
|
//# sourceMappingURL=CodeEditor.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CollapseProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react21 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Collapse/Collapse.d.ts
|
|
5
|
-
declare const Collapse:
|
|
5
|
+
declare const Collapse: react21.NamedExoticComponent<CollapseProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Collapse };
|
|
8
8
|
//# sourceMappingURL=Collapse.d.mts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TranslationResourcesInput } from "../i18n/types.mjs";
|
|
2
2
|
import { MotionComponentType } from "../MotionProvider/index.mjs";
|
|
3
3
|
import { CDN, CdnApi } from "../utils/genCdnUrl.mjs";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react69 from "react";
|
|
5
5
|
import { ElementType, ReactNode } from "react";
|
|
6
6
|
|
|
7
7
|
//#region src/ConfigProvider/index.d.ts
|
|
@@ -19,7 +19,7 @@ interface ConfigProviderProps {
|
|
|
19
19
|
motion: MotionComponentType;
|
|
20
20
|
resources?: TranslationResourcesInput;
|
|
21
21
|
}
|
|
22
|
-
declare const ConfigProvider:
|
|
22
|
+
declare const ConfigProvider: react69.NamedExoticComponent<ConfigProviderProps>;
|
|
23
23
|
type CdnFn = ({
|
|
24
24
|
pkg,
|
|
25
25
|
version,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CopyButtonProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react20 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/CopyButton/CopyButton.d.ts
|
|
5
|
-
declare const CopyButton:
|
|
5
|
+
declare const CopyButton: react20.NamedExoticComponent<CopyButtonProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { CopyButton };
|
|
8
8
|
//# sourceMappingURL=CopyButton.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DatePickerProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react19 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/DatePicker/DatePicker.d.ts
|
|
5
|
-
declare const DatePicker:
|
|
5
|
+
declare const DatePicker: react19.NamedExoticComponent<DatePickerProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { DatePicker };
|
|
8
8
|
//# sourceMappingURL=DatePicker.d.mts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DivProps } from "../../types/index.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react16 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/DraggablePanel/components/DraggablePanelBody.d.ts
|
|
5
5
|
type DraggablePanelBodyProps = DivProps;
|
|
6
|
-
declare const DraggablePanelBody:
|
|
6
|
+
declare const DraggablePanelBody: react16.NamedExoticComponent<DivProps>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { DraggablePanelBody, DraggablePanelBodyProps };
|
|
9
9
|
//# sourceMappingURL=DraggablePanelBody.d.mts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DivProps } from "../../types/index.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react15 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/DraggablePanel/components/DraggablePanelContainer.d.ts
|
|
5
5
|
type DraggablePanelContainerProps = DivProps;
|
|
6
|
-
declare const DraggablePanelContainer:
|
|
6
|
+
declare const DraggablePanelContainer: react15.NamedExoticComponent<DivProps>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { DraggablePanelContainer, DraggablePanelContainerProps };
|
|
9
9
|
//# sourceMappingURL=DraggablePanelContainer.d.mts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DivProps } from "../../types/index.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react17 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/DraggablePanel/components/DraggablePanelFooter.d.ts
|
|
5
5
|
type DraggablePanelFooterProps = DivProps;
|
|
6
|
-
declare const DraggablePanelFooter:
|
|
6
|
+
declare const DraggablePanelFooter: react17.NamedExoticComponent<DivProps>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { DraggablePanelFooter, DraggablePanelFooterProps };
|
|
9
9
|
//# sourceMappingURL=DraggablePanelFooter.d.mts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DivProps } from "../../types/index.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react18 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/DraggablePanel/components/DraggablePanelHeader.d.ts
|
|
5
5
|
interface DraggablePanelHeaderProps extends Omit<DivProps, 'children'> {
|
|
@@ -9,7 +9,7 @@ interface DraggablePanelHeaderProps extends Omit<DivProps, 'children'> {
|
|
|
9
9
|
setPin?: (pin: boolean) => void;
|
|
10
10
|
title?: string;
|
|
11
11
|
}
|
|
12
|
-
declare const DraggablePanelHeader:
|
|
12
|
+
declare const DraggablePanelHeader: react18.NamedExoticComponent<DraggablePanelHeaderProps>;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { DraggablePanelHeader, DraggablePanelHeaderProps };
|
|
15
15
|
//# sourceMappingURL=DraggablePanelHeader.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DraggableSideNavProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react14 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/DraggableSideNav/DraggableSideNav.d.ts
|
|
5
|
-
declare const DraggableSideNav:
|
|
5
|
+
declare const DraggableSideNav: react14.NamedExoticComponent<DraggableSideNavProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { DraggableSideNav };
|
|
8
8
|
//# sourceMappingURL=DraggableSideNav.d.mts.map
|
package/es/Drawer/Drawer.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DrawerProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react12 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Drawer/Drawer.d.ts
|
|
5
|
-
declare const Drawer:
|
|
5
|
+
declare const Drawer: react12.NamedExoticComponent<DrawerProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Drawer };
|
|
8
8
|
//# sourceMappingURL=Drawer.d.mts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DropdownProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react13 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Dropdown/Dropdown.d.ts
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ import * as react2 from "react";
|
|
|
9
9
|
* @see https://ui.lobehub.com/components/context-menu
|
|
10
10
|
* @see https://ui.lobehub.com/components/dropdown-menu
|
|
11
11
|
*/
|
|
12
|
-
declare const Dropdown:
|
|
12
|
+
declare const Dropdown: react13.NamedExoticComponent<DropdownProps>;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { Dropdown };
|
|
15
15
|
//# sourceMappingURL=Dropdown.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EditableTextProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react11 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/EditableText/EditableText.d.ts
|
|
5
|
-
declare const EditableText:
|
|
5
|
+
declare const EditableText: react11.NamedExoticComponent<EditableTextProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { EditableText };
|
|
8
8
|
//# sourceMappingURL=EditableText.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EmojiPickerProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react10 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/EmojiPicker/EmojiPicker.d.ts
|
|
5
|
-
declare const EmojiPicker:
|
|
5
|
+
declare const EmojiPicker: react10.NamedExoticComponent<EmojiPickerProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { EmojiPicker };
|
|
8
8
|
//# sourceMappingURL=EmojiPicker.d.mts.map
|
|
@@ -7,7 +7,7 @@ import ActionIcon_default from "../ActionIcon/ActionIcon.mjs";
|
|
|
7
7
|
import Avatar_default from "../Avatar/index.mjs";
|
|
8
8
|
import { useTranslation } from "../i18n/useTranslation.mjs";
|
|
9
9
|
import emojiPicker_default from "../i18n/resources/en/emojiPicker.mjs";
|
|
10
|
-
import Popover_default from "../Popover/Popover.mjs";
|
|
10
|
+
import Popover_default from "../base-ui/Popover/Popover.mjs";
|
|
11
11
|
import Tabs_default from "../Tabs/Tabs.mjs";
|
|
12
12
|
import AvatarUploader_default from "./AvatarUploader.mjs";
|
|
13
13
|
import { styles } from "./style.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FlexboxProps } from "../Flex/type.mjs";
|
|
2
2
|
import { AvatarProps } from "../Avatar/type.mjs";
|
|
3
|
-
import { PopoverProps } from "../Popover/type.mjs";
|
|
3
|
+
import { PopoverProps } from "../base-ui/Popover/type.mjs";
|
|
4
4
|
import "../Popover/index.mjs";
|
|
5
5
|
import { CSSProperties, ReactNode } from "react";
|
|
6
6
|
|
package/es/Flex/FlexBasic.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FlexBasicProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react57 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Flex/FlexBasic.d.ts
|
|
5
|
-
declare const _default:
|
|
5
|
+
declare const _default: react57.NamedExoticComponent<FlexBasicProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default };
|
|
8
8
|
//# sourceMappingURL=FlexBasic.d.mts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react72 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/FontLoader/index.d.ts
|
|
4
4
|
interface FontLoaderProps {
|
|
5
5
|
url: string;
|
|
6
6
|
}
|
|
7
|
-
declare const FontLoader:
|
|
7
|
+
declare const FontLoader: react72.NamedExoticComponent<FontLoaderProps>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { FontLoader, FontLoaderProps };
|
|
10
10
|
//# sourceMappingURL=index.d.mts.map
|
package/es/Footer/Footer.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FooterProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react9 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Footer/Footer.d.ts
|
|
5
|
-
declare const Footer:
|
|
5
|
+
declare const Footer: react9.NamedExoticComponent<FooterProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Footer };
|
|
8
8
|
//# sourceMappingURL=Footer.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FormGroupProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react7 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Form/components/FormGroup.d.ts
|
|
5
|
-
declare const FormGroup:
|
|
5
|
+
declare const FormGroup: react7.NamedExoticComponent<FormGroupProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { FormGroup };
|
|
8
8
|
//# sourceMappingURL=FormGroup.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FormItemProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react5 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Form/components/FormItem.d.ts
|
|
5
|
-
declare const FormItem:
|
|
5
|
+
declare const FormItem: react5.NamedExoticComponent<FormItemProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { FormItem };
|
|
8
8
|
//# sourceMappingURL=FormItem.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FormSubmitFooterProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react6 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Form/components/FormSubmitFooter.d.ts
|
|
5
|
-
declare const FormSubmitFooter:
|
|
5
|
+
declare const FormSubmitFooter: react6.NamedExoticComponent<FormSubmitFooterProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { FormSubmitFooter };
|
|
8
8
|
//# sourceMappingURL=FormSubmitFooter.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FormModalProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react8 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/FormModal/FormModal.d.ts
|
|
5
|
-
declare const FormModal:
|
|
5
|
+
declare const FormModal: react8.NamedExoticComponent<FormModalProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { FormModal };
|
|
8
8
|
//# sourceMappingURL=FormModal.d.mts.map
|
package/es/Freeze/Freeze.d.mts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { FreezeProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/Freeze/Freeze.d.ts
|
|
5
5
|
declare const Freeze: {
|
|
6
6
|
({
|
|
7
7
|
frozen,
|
|
8
8
|
children
|
|
9
|
-
}: FreezeProps):
|
|
9
|
+
}: FreezeProps): react_jsx_runtime0.JSX.Element;
|
|
10
10
|
displayName: string;
|
|
11
11
|
};
|
|
12
12
|
//#endregion
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { GuideCardProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react154 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/GuideCard/GuideCard.d.ts
|
|
5
|
-
declare const GuideCard:
|
|
5
|
+
declare const GuideCard: react154.NamedExoticComponent<GuideCardProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { GuideCard };
|
|
8
8
|
//# sourceMappingURL=GuideCard.d.mts.map
|
package/es/Header/Header.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { HeaderProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react66 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Header/Header.d.ts
|
|
5
|
-
declare const Header:
|
|
5
|
+
declare const Header: react66.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
|
|
2
|
+
import * as react35 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Highlighter/Highlighter.d.ts
|
|
5
|
-
declare const Highlighter:
|
|
5
|
+
declare const Highlighter: react35.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
|
|
2
|
+
import * as react34 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Highlighter/SyntaxHighlighter/index.d.ts
|
|
5
|
-
declare const SyntaxHighlighter:
|
|
5
|
+
declare const SyntaxHighlighter: react34.NamedExoticComponent<SyntaxHighlighterProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { SyntaxHighlighter };
|
|
8
8
|
//# sourceMappingURL=index.d.mts.map
|
package/es/Hotkey/Hotkey.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { HotkeyProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react48 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Hotkey/Hotkey.d.ts
|
|
5
|
-
declare const Hotkey:
|
|
5
|
+
declare const Hotkey: react48.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
|
|
2
|
+
import * as react46 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/HotkeyInput/HotkeyInput.d.ts
|
|
5
|
-
declare const HotkeyInput:
|
|
5
|
+
declare const HotkeyInput: react46.NamedExoticComponent<HotkeyInputProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { HotkeyInput };
|
|
8
8
|
//# sourceMappingURL=HotkeyInput.d.mts.map
|
|
@@ -12,11 +12,11 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
12
12
|
import { cx, useThemeMode } from "antd-style";
|
|
13
13
|
import useMergeState from "use-merge-value";
|
|
14
14
|
import { isEqual } from "es-toolkit/compat";
|
|
15
|
-
import { Undo2Icon } from "lucide-react";
|
|
15
|
+
import { Undo2Icon, XIcon } from "lucide-react";
|
|
16
16
|
import { useHotkeys, useRecordHotkeys } from "react-hotkeys-hook";
|
|
17
17
|
|
|
18
18
|
//#region src/HotkeyInput/HotkeyInput.tsx
|
|
19
|
-
const HotkeyInput = memo(({ value = "", defaultValue = "", resetValue = "", onChange, onConflict, placeholder, disabled, shadow, allowReset = true, style, className, hotkeyConflicts = [], variant, texts, isApple, onBlur, onReset, onFocus }) => {
|
|
19
|
+
const HotkeyInput = memo(({ value = "", defaultValue = "", resetValue = "", onChange, onClear, onConflict, placeholder, disabled, shadow, allowClear, allowReset = true, style, className, hotkeyConflicts = [], variant, texts, isApple, onBlur, onReset, onFocus }) => {
|
|
20
20
|
const [isFocused, setIsFocused] = useState(false);
|
|
21
21
|
const [hasConflict, setHasConflict] = useState(false);
|
|
22
22
|
const [hasInvalidCombination, setHasInvalidCombination] = useState(false);
|
|
@@ -106,6 +106,17 @@ const HotkeyInput = memo(({ value = "", defaultValue = "", resetValue = "", onCh
|
|
|
106
106
|
stop();
|
|
107
107
|
onBlur?.(e);
|
|
108
108
|
};
|
|
109
|
+
const handleClear = (e) => {
|
|
110
|
+
e.preventDefault();
|
|
111
|
+
e.stopPropagation();
|
|
112
|
+
setHotkeyValue?.("");
|
|
113
|
+
resetKeys();
|
|
114
|
+
setHasConflict(false);
|
|
115
|
+
setHasInvalidCombination(false);
|
|
116
|
+
setIsFocused(false);
|
|
117
|
+
stop();
|
|
118
|
+
onClear?.(hotkeyValue);
|
|
119
|
+
};
|
|
109
120
|
const handleReset = (e) => {
|
|
110
121
|
e.preventDefault();
|
|
111
122
|
e.stopPropagation();
|
|
@@ -125,6 +136,7 @@ const HotkeyInput = memo(({ value = "", defaultValue = "", resetValue = "", onCh
|
|
|
125
136
|
};
|
|
126
137
|
const placeholderText = placeholder ?? t("hotkey.placeholder");
|
|
127
138
|
const resetTitle = texts?.reset ?? t("hotkey.reset");
|
|
139
|
+
const clearTitle = texts?.clear ?? t("hotkey.clear");
|
|
128
140
|
const conflictText = texts?.conflicts ?? t("hotkey.conflict");
|
|
129
141
|
const invalidText = texts?.invalidCombination ?? t("hotkey.invalidCombination");
|
|
130
142
|
return /* @__PURE__ */ jsxs(FlexBasic_default, {
|
|
@@ -167,12 +179,22 @@ const HotkeyInput = memo(({ value = "", defaultValue = "", resetValue = "", onCh
|
|
|
167
179
|
onBlur: handleBlur,
|
|
168
180
|
onFocus: handleFocus
|
|
169
181
|
}),
|
|
170
|
-
!isFocused &&
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
182
|
+
!isFocused && hotkeyValue && !disabled && (allowReset || allowClear) && /* @__PURE__ */ jsxs(FlexBasic_default, {
|
|
183
|
+
horizontal: true,
|
|
184
|
+
gap: 4,
|
|
185
|
+
children: [allowReset && hotkeyValue !== resetValue && /* @__PURE__ */ jsx(ActionIcon_default, {
|
|
186
|
+
icon: Undo2Icon,
|
|
187
|
+
size: "small",
|
|
188
|
+
title: resetTitle,
|
|
189
|
+
variant: "filled",
|
|
190
|
+
onClick: handleReset
|
|
191
|
+
}), allowClear && /* @__PURE__ */ jsx(ActionIcon_default, {
|
|
192
|
+
icon: XIcon,
|
|
193
|
+
size: "small",
|
|
194
|
+
title: clearTitle,
|
|
195
|
+
variant: "filled",
|
|
196
|
+
onClick: handleClear
|
|
197
|
+
})]
|
|
176
198
|
})
|
|
177
199
|
]
|
|
178
200
|
}),
|
|
@@ -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 { cx, useThemeMode } from 'antd-style';\nimport { isEqual } from 'es-toolkit/compat';\nimport { Undo2Icon } from 'lucide-react';\nimport {\n type FocusEvent,\n memo,\n type MouseEvent,\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 { checkIsAppleDevice, NORMATIVE_MODIFIER, splitKeysByPlus } from '@/Hotkey/utils';\nimport hotkeyMessages from '@/i18n/resources/en/hotkey';\nimport { useTranslation } from '@/i18n/useTranslation';\n\nimport { styles, variants } 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 { isDarkMode } = useThemeMode();\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 // 使用 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 horizontal\n align={'center'}\n justify={'space-between'}\n className={cx(\n variants({\n disabled,\n error: hasConflict || hasInvalidCombination,\n focused: isFocused,\n shadow,\n variant: variant || (isDarkMode ? 'filled' : 'outlined'),\n }),\n )}\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 readOnly\n className={styles.hiddenInput}\n disabled={disabled}\n ref={inputRef as any}\n style={{ pointerEvents: 'none' }}\n onBlur={handleBlur}\n onFocus={handleFocus}\n />\n\n {!isFocused && allowReset && hotkeyValue && hotkeyValue !== resetValue && !disabled && (\n <ActionIcon\n icon={Undo2Icon}\n size={'small'}\n title={resetTitle}\n variant={'filled'}\n onClick={handleReset}\n />\n )}\n </Flexbox>\n {hasConflict && <div className={styles.errorText}>{conflictText}</div>}\n {hasInvalidCombination && <div className={styles.errorText}>{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
|
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 { cx, useThemeMode } from 'antd-style';\nimport { isEqual } from 'es-toolkit/compat';\nimport { Undo2Icon, XIcon } from 'lucide-react';\nimport {\n type FocusEvent,\n memo,\n type MouseEvent,\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 { checkIsAppleDevice, NORMATIVE_MODIFIER, splitKeysByPlus } from '@/Hotkey/utils';\nimport hotkeyMessages from '@/i18n/resources/en/hotkey';\nimport { useTranslation } from '@/i18n/useTranslation';\n\nimport { styles, variants } from './style';\nimport { type HotkeyInputProps } from './type';\n\nconst HotkeyInput = memo<HotkeyInputProps>(\n ({\n value = '',\n defaultValue = '',\n resetValue = '',\n onChange,\n onClear,\n onConflict,\n placeholder,\n disabled,\n shadow,\n allowClear,\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 { isDarkMode } = useThemeMode();\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 // 使用 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 const handleClear = (e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setHotkeyValue?.('');\n resetKeys();\n setHasConflict(false);\n setHasInvalidCombination(false);\n setIsFocused(false);\n stop();\n onClear?.(hotkeyValue);\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 clearTitle = texts?.clear ?? t('hotkey.clear');\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 horizontal\n align={'center'}\n justify={'space-between'}\n className={cx(\n variants({\n disabled,\n error: hasConflict || hasInvalidCombination,\n focused: isFocused,\n shadow,\n variant: variant || (isDarkMode ? 'filled' : 'outlined'),\n }),\n )}\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 readOnly\n className={styles.hiddenInput}\n disabled={disabled}\n ref={inputRef as any}\n style={{ pointerEvents: 'none' }}\n onBlur={handleBlur}\n onFocus={handleFocus}\n />\n\n {!isFocused && hotkeyValue && !disabled && (allowReset || allowClear) && (\n <Flexbox horizontal gap={4}>\n {allowReset && hotkeyValue !== resetValue && (\n <ActionIcon\n icon={Undo2Icon}\n size={'small'}\n title={resetTitle}\n variant={'filled'}\n onClick={handleReset}\n />\n )}\n {allowClear && (\n <ActionIcon\n icon={XIcon}\n size={'small'}\n title={clearTitle}\n variant={'filled'}\n onClick={handleClear}\n />\n )}\n </Flexbox>\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,SACA,YACA,aACA,UACA,QACA,YACA,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,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otkeyInput/type.d.ts
|
|
5
5
|
interface HotkeyInputProps {
|
|
6
|
+
allowClear?: boolean;
|
|
6
7
|
allowReset?: boolean;
|
|
7
8
|
className?: string;
|
|
8
9
|
defaultValue?: string;
|
|
@@ -11,6 +12,7 @@ interface HotkeyInputProps {
|
|
|
11
12
|
isApple?: boolean;
|
|
12
13
|
onBlur?: InputProps['onBlur'];
|
|
13
14
|
onChange?: (value: string) => void;
|
|
15
|
+
onClear?: (currentValue: string) => void;
|
|
14
16
|
onConflict?: (conflictKey: string) => void;
|
|
15
17
|
onFocus?: InputProps['onFocus'];
|
|
16
18
|
onReset?: (currentValue: string, resetValue: string) => void;
|
|
@@ -19,6 +21,7 @@ interface HotkeyInputProps {
|
|
|
19
21
|
shadow?: boolean;
|
|
20
22
|
style?: CSSProperties;
|
|
21
23
|
texts?: {
|
|
24
|
+
clear?: string;
|
|
22
25
|
conflicts?: string;
|
|
23
26
|
invalidCombination?: string;
|
|
24
27
|
reset?: string;
|