@lobehub/ui 4.33.4 → 4.34.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/README.md +3 -3
- package/es/A/index.mjs.map +1 -1
- package/es/Accordion/Accordion.d.mts +2 -2
- package/es/Accordion/Accordion.mjs +1 -1
- package/es/Accordion/Accordion.mjs.map +1 -1
- package/es/Accordion/AccordionItem.d.mts +2 -2
- package/es/Accordion/AccordionItem.mjs +13 -13
- package/es/Accordion/AccordionItem.mjs.map +1 -1
- package/es/Accordion/context.mjs +2 -2
- package/es/Accordion/context.mjs.map +1 -1
- package/es/ActionIcon/ActionIcon.d.mts +2 -2
- package/es/ActionIcon/ActionIcon.mjs +2 -2
- package/es/ActionIcon/ActionIcon.mjs.map +1 -1
- package/es/ActionIcon/style.mjs.map +1 -1
- package/es/ActionIconGroup/ActionIconGroup.mjs +3 -3
- package/es/ActionIconGroup/ActionIconGroup.mjs.map +1 -1
- package/es/ActionIconGroup/style.mjs.map +1 -1
- package/es/Alert/Alert.d.mts +2 -2
- package/es/Alert/Alert.mjs +6 -6
- package/es/Alert/Alert.mjs.map +1 -1
- package/es/Alert/style.mjs.map +1 -1
- package/es/AutoComplete/Select.d.mts +2 -2
- package/es/AutoComplete/Select.mjs +1 -1
- package/es/AutoComplete/Select.mjs.map +1 -1
- package/es/AutoComplete/style.mjs.map +1 -1
- package/es/Avatar/Avatar.mjs +4 -4
- package/es/Avatar/Avatar.mjs.map +1 -1
- package/es/Avatar/AvatarGroup/index.d.mts +2 -2
- package/es/Avatar/AvatarGroup/index.mjs +5 -5
- package/es/Avatar/AvatarGroup/index.mjs.map +1 -1
- package/es/Avatar/index.mjs.map +1 -1
- package/es/Avatar/style.mjs.map +1 -1
- package/es/Avatar/utils.mjs.map +1 -1
- package/es/Block/style.mjs.map +1 -1
- package/es/Burger/Burger.d.mts +2 -2
- package/es/Burger/Burger.mjs +2 -2
- package/es/Burger/Burger.mjs.map +1 -1
- package/es/Burger/type.d.mts +1 -1
- package/es/Button/Button.mjs +7 -7
- package/es/Button/Button.mjs.map +1 -1
- package/es/Button/style.mjs.map +1 -1
- package/es/Checkbox/Checkbox.mjs +6 -6
- package/es/Checkbox/Checkbox.mjs.map +1 -1
- package/es/Checkbox/CheckboxGroup.mjs +2 -2
- package/es/Checkbox/CheckboxGroup.mjs.map +1 -1
- package/es/Checkbox/index.mjs.map +1 -1
- package/es/CodeDiff/CodeDiff.d.mts +2 -2
- package/es/CodeDiff/CodeDiff.mjs +3 -3
- package/es/CodeDiff/CodeDiff.mjs.map +1 -1
- package/es/CodeDiff/PatchDiff.d.mts +2 -2
- package/es/CodeDiff/PatchDiff.mjs +3 -3
- package/es/CodeDiff/PatchDiff.mjs.map +1 -1
- package/es/CodeDiff/style.mjs.map +1 -1
- package/es/CodeEditor/CodeEditor.d.mts +2 -2
- package/es/CodeEditor/CodeEditor.mjs +3 -3
- package/es/CodeEditor/CodeEditor.mjs.map +1 -1
- package/es/CodeEditor/style.mjs.map +1 -1
- package/es/Collapse/Collapse.d.mts +2 -2
- package/es/Collapse/Collapse.mjs +5 -5
- package/es/Collapse/Collapse.mjs.map +1 -1
- package/es/Collapse/style.mjs.map +1 -1
- package/es/ColorSwatches/ColorSwatches.mjs +9 -9
- package/es/ColorSwatches/ColorSwatches.mjs.map +1 -1
- package/es/ConfigProvider/index.d.mts +3 -3
- package/es/ConfigProvider/index.mjs.map +1 -1
- package/es/ContextMenu/ContextMenuHost.d.mts +2 -2
- package/es/ContextMenu/ContextMenuHost.mjs +10 -3
- package/es/ContextMenu/ContextMenuHost.mjs.map +1 -1
- package/es/ContextMenu/ContextMenuTrigger.mjs.map +1 -1
- package/es/ContextMenu/renderItems.d.mts +1 -1
- package/es/ContextMenu/renderItems.mjs +39 -14
- package/es/ContextMenu/renderItems.mjs.map +1 -1
- package/es/ContextMenu/store.d.mts +3 -1
- package/es/ContextMenu/store.mjs +1 -0
- package/es/ContextMenu/store.mjs.map +1 -1
- package/es/CopyButton/CopyButton.d.mts +2 -2
- package/es/DatePicker/DatePicker.d.mts +2 -2
- package/es/DatePicker/DatePicker.mjs +1 -1
- package/es/DatePicker/DatePicker.mjs.map +1 -1
- package/es/DatePicker/style.mjs.map +1 -1
- package/es/DraggablePanel/DraggablePanel.mjs +7 -7
- package/es/DraggablePanel/DraggablePanel.mjs.map +1 -1
- 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/DraggablePanelFooter.mjs +1 -1
- package/es/DraggablePanel/components/DraggablePanelFooter.mjs.map +1 -1
- package/es/DraggablePanel/components/DraggablePanelHeader.d.mts +2 -2
- package/es/DraggablePanel/components/DraggablePanelHeader.mjs +5 -5
- package/es/DraggablePanel/components/DraggablePanelHeader.mjs.map +1 -1
- package/es/DraggablePanel/index.mjs +1 -1
- package/es/DraggablePanel/index.mjs.map +1 -1
- package/es/DraggablePanel/style.mjs.map +1 -1
- package/es/DraggableSideNav/DraggableSideNav.d.mts +2 -2
- package/es/DraggableSideNav/DraggableSideNav.mjs +3 -3
- package/es/DraggableSideNav/DraggableSideNav.mjs.map +1 -1
- package/es/Drawer/Drawer.d.mts +2 -2
- package/es/Drawer/Drawer.mjs +5 -5
- package/es/Drawer/Drawer.mjs.map +1 -1
- package/es/Dropdown/Dropdown.d.mts +2 -2
- package/es/DropdownMenu/DropdownMenu.d.mts +2 -2
- package/es/DropdownMenu/DropdownMenu.mjs +7 -3
- package/es/DropdownMenu/DropdownMenu.mjs.map +1 -1
- package/es/DropdownMenu/atoms.d.mts +33 -17
- package/es/DropdownMenu/atoms.mjs +20 -6
- package/es/DropdownMenu/atoms.mjs.map +1 -1
- package/es/DropdownMenu/index.d.mts +2 -2
- package/es/DropdownMenu/index.mjs +2 -2
- package/es/DropdownMenu/renderItems.d.mts +1 -1
- package/es/DropdownMenu/renderItems.mjs +36 -14
- package/es/DropdownMenu/renderItems.mjs.map +1 -1
- package/es/DropdownMenu/type.d.mts +8 -1
- package/es/EditableText/ControlInput.mjs +29 -29
- package/es/EditableText/ControlInput.mjs.map +1 -1
- package/es/EditableText/EditableText.d.mts +2 -2
- package/es/EditableText/EditableText.mjs +14 -14
- package/es/EditableText/EditableText.mjs.map +1 -1
- package/es/EditorSlashMenu/EditorSlashMenu.mjs +2 -2
- package/es/EditorSlashMenu/EditorSlashMenu.mjs.map +1 -1
- package/es/EditorSlashMenu/MenuItemRenderer.mjs +1 -1
- package/es/EditorSlashMenu/MenuItemRenderer.mjs.map +1 -1
- package/es/EditorSlashMenu/atoms.d.mts +22 -13
- package/es/EditorSlashMenu/atoms.mjs +3 -4
- package/es/EditorSlashMenu/atoms.mjs.map +1 -1
- package/es/EmojiPicker/AvatarUploader.mjs +5 -5
- package/es/EmojiPicker/AvatarUploader.mjs.map +1 -1
- package/es/EmojiPicker/EmojiPicker.d.mts +2 -2
- package/es/EmojiPicker/EmojiPicker.mjs +20 -20
- package/es/EmojiPicker/EmojiPicker.mjs.map +1 -1
- package/es/Empty/Empty.mjs +2 -2
- package/es/Empty/Empty.mjs.map +1 -1
- package/es/FileTypeIcon/components/FileIcon.mjs.map +1 -1
- package/es/FileTypeIcon/components/FolderIcon.mjs.map +1 -1
- package/es/Flex/FlexBasic.d.mts +2 -2
- package/es/FluentEmoji/FluentEmoji.mjs +1 -1
- package/es/FluentEmoji/FluentEmoji.mjs.map +1 -1
- package/es/FontLoader/index.d.mts +2 -2
- package/es/Footer/Footer.d.mts +2 -2
- package/es/Footer/Footer.mjs +1 -1
- package/es/Footer/Footer.mjs.map +1 -1
- package/es/Form/Form.mjs +12 -12
- package/es/Form/Form.mjs.map +1 -1
- package/es/Form/components/FormGroup.mjs +5 -5
- package/es/Form/components/FormGroup.mjs.map +1 -1
- package/es/Form/components/FormProvider.mjs.map +1 -1
- package/es/Form/components/FormSubmitFooter.mjs +5 -5
- package/es/Form/components/FormSubmitFooter.mjs.map +1 -1
- package/es/Form/components/FormTitle.mjs +1 -1
- package/es/Form/components/FormTitle.mjs.map +1 -1
- package/es/Form/components/merge.mjs.map +1 -1
- package/es/Form/index.mjs +1 -1
- package/es/Form/index.mjs.map +1 -1
- package/es/Form/style.mjs.map +1 -1
- package/es/Form/type.d.mts +1 -1
- package/es/FormModal/FormModal.d.mts +2 -2
- package/es/FormModal/FormModal.mjs +10 -10
- package/es/FormModal/FormModal.mjs.map +1 -1
- package/es/GroupAvatar/style.mjs.map +1 -1
- package/es/GroupAvatar/type.d.mts +1 -1
- package/es/GuideCard/style.mjs.map +1 -1
- package/es/Header/Header.d.mts +2 -2
- package/es/Header/Header.mjs +5 -5
- package/es/Header/Header.mjs.map +1 -1
- package/es/Highlighter/FullFeatured.mjs +9 -9
- package/es/Highlighter/FullFeatured.mjs.map +1 -1
- package/es/Highlighter/Highlighter.d.mts +2 -2
- package/es/Highlighter/Highlighter.mjs +4 -4
- package/es/Highlighter/Highlighter.mjs.map +1 -1
- package/es/Highlighter/LangSelect.mjs +6 -6
- package/es/Highlighter/LangSelect.mjs.map +1 -1
- package/es/Highlighter/SyntaxHighlighter/StaticRenderer.mjs +2 -2
- package/es/Highlighter/SyntaxHighlighter/StaticRenderer.mjs.map +1 -1
- package/es/Highlighter/SyntaxHighlighter/index.d.mts +2 -2
- package/es/Highlighter/SyntaxHighlighter/style.mjs.map +1 -1
- package/es/Highlighter/style.mjs.map +1 -1
- package/es/Hotkey/Hotkey.d.mts +2 -2
- package/es/Hotkey/Hotkey.mjs +5 -5
- package/es/Hotkey/Hotkey.mjs.map +1 -1
- package/es/Hotkey/style.mjs.map +1 -1
- package/es/HotkeyInput/HotkeyInput.d.mts +2 -2
- package/es/HotkeyInput/HotkeyInput.mjs +8 -8
- package/es/HotkeyInput/HotkeyInput.mjs.map +1 -1
- package/es/HotkeyInput/style.mjs.map +1 -1
- package/es/Icon/Icon.d.mts +2 -2
- package/es/Icon/Icon.mjs.map +1 -1
- package/es/Icon/components/IconProvider.d.mts +3 -3
- package/es/Icon/components/IconProvider.mjs.map +1 -1
- package/es/Icon/style.mjs.map +1 -1
- package/es/Image/Image.mjs +3 -3
- package/es/Image/Image.mjs.map +1 -1
- package/es/Image/PreviewGroup.d.mts +2 -2
- package/es/Image/PreviewGroup.mjs.map +1 -1
- package/es/Image/components/Preview.mjs.map +1 -1
- package/es/Image/components/Toolbar.mjs +1 -1
- package/es/Image/components/Toolbar.mjs.map +1 -1
- package/es/Image/components/usePreviewGroup.mjs.map +1 -1
- package/es/Image/style.mjs.map +1 -1
- package/es/ImageSelect/ImageSelect.mjs +5 -5
- package/es/ImageSelect/ImageSelect.mjs.map +1 -1
- package/es/Img/index.mjs.map +1 -1
- package/es/Input/Input.d.mts +2 -2
- package/es/Input/Input.mjs +2 -2
- package/es/Input/Input.mjs.map +1 -1
- package/es/Input/InputNumber.d.mts +2 -2
- package/es/Input/InputNumber.mjs +2 -2
- package/es/Input/InputNumber.mjs.map +1 -1
- package/es/Input/InputOPT.mjs +2 -2
- package/es/Input/InputOPT.mjs.map +1 -1
- package/es/Input/InputPassword.d.mts +2 -2
- package/es/Input/InputPassword.mjs +2 -2
- package/es/Input/InputPassword.mjs.map +1 -1
- package/es/Input/TextArea.d.mts +2 -2
- package/es/Input/TextArea.mjs +2 -2
- package/es/Input/TextArea.mjs.map +1 -1
- package/es/Input/style.mjs.map +1 -1
- package/es/Layout/Layout.mjs +1 -1
- package/es/Layout/Layout.mjs.map +1 -1
- 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/Layout/index.mjs.map +1 -1
- package/es/List/List.mjs +6 -6
- package/es/List/List.mjs.map +1 -1
- package/es/List/ListItem/index.d.mts +2 -2
- package/es/List/ListItem/index.mjs +11 -11
- package/es/List/ListItem/index.mjs.map +1 -1
- package/es/LobeSelect/LobeSelect.d.mts +2 -2
- package/es/LobeSelect/LobeSelect.mjs +16 -16
- package/es/LobeSelect/LobeSelect.mjs.map +1 -1
- package/es/LobeSelect/atoms.d.mts +19 -19
- package/es/LobeSelect/atoms.mjs +1 -1
- package/es/LobeSelect/atoms.mjs.map +1 -1
- package/es/LobeSwitch/LobeSwitch.d.mts +2 -2
- package/es/LobeSwitch/LobeSwitch.mjs +2 -2
- package/es/LobeSwitch/LobeSwitch.mjs.map +1 -1
- package/es/LobeSwitch/atoms.d.mts +4 -4
- package/es/LobeSwitch/atoms.mjs +8 -8
- package/es/LobeSwitch/atoms.mjs.map +1 -1
- package/es/Markdown/Markdown.d.mts +2 -2
- package/es/Markdown/Markdown.mjs +3 -3
- package/es/Markdown/Markdown.mjs.map +1 -1
- package/es/Markdown/SyntaxMarkdown/StreamdownRender.mjs.map +1 -1
- package/es/Markdown/Typography.d.mts +2 -2
- package/es/Markdown/components/CodeBlock.mjs.map +1 -1
- package/es/Markdown/components/Footnotes.mjs +3 -3
- package/es/Markdown/components/Footnotes.mjs.map +1 -1
- package/es/Markdown/components/MarkdownProvider.mjs.map +1 -1
- package/es/Markdown/components/SearchResultCards/SearchResultCard.mjs +3 -3
- package/es/Markdown/components/SearchResultCards/SearchResultCard.mjs.map +1 -1
- package/es/Markdown/components/SearchResultCards/index.d.mts +2 -2
- package/es/Markdown/components/SearchResultCards/index.mjs +1 -1
- package/es/Markdown/components/SearchResultCards/index.mjs.map +1 -1
- package/es/Markdown/plugins/rehypeCustomFootnotes.mjs.map +1 -1
- package/es/Markdown/plugins/rehypeKatexDir.mjs.map +1 -1
- package/es/Markdown/plugins/rehypeStreamAnimated.mjs.map +1 -1
- package/es/Markdown/plugins/remarkColor.mjs +1 -1
- package/es/Markdown/plugins/remarkColor.mjs.map +1 -1
- package/es/Markdown/plugins/remarkCustomFootnotes.mjs.map +1 -1
- package/es/Markdown/plugins/remarkVideo.mjs +3 -3
- package/es/Markdown/plugins/remarkVideo.mjs.map +1 -1
- package/es/Markdown/style.mjs.map +1 -1
- package/es/MaskShadow/MaskShadow.d.mts +2 -2
- package/es/MaskShadow/style.mjs.map +1 -1
- package/es/Menu/Menu.d.mts +2 -2
- package/es/Menu/Menu.mjs.map +1 -1
- package/es/Menu/checkboxItem.d.mts +1 -0
- package/es/Menu/index.d.mts +2 -2
- package/es/Menu/renderUtils.d.mts +4 -1
- package/es/Menu/renderUtils.mjs.map +1 -1
- package/es/Menu/sharedStyle.d.mts +4 -0
- package/es/Menu/sharedStyle.mjs +24 -0
- package/es/Menu/sharedStyle.mjs.map +1 -1
- package/es/Menu/style.mjs.map +1 -1
- package/es/Menu/switchItem.d.mts +1 -0
- package/es/Menu/type.d.mts +3 -1
- package/es/Mermaid/FullFeatured.mjs +7 -7
- package/es/Mermaid/FullFeatured.mjs.map +1 -1
- package/es/Mermaid/Mermaid.d.mts +2 -2
- package/es/Mermaid/Mermaid.mjs +1 -1
- package/es/Mermaid/Mermaid.mjs.map +1 -1
- package/es/Mermaid/SyntaxMermaid/StaticMermaid.mjs +3 -3
- package/es/Mermaid/SyntaxMermaid/StaticMermaid.mjs.map +1 -1
- package/es/Mermaid/SyntaxMermaid/StreamMermaid.mjs +3 -3
- package/es/Mermaid/SyntaxMermaid/StreamMermaid.mjs.map +1 -1
- package/es/Mermaid/SyntaxMermaid/index.d.mts +2 -2
- package/es/Mermaid/SyntaxMermaid/style.mjs.map +1 -1
- package/es/Modal/Modal.d.mts +2 -2
- package/es/Modal/Modal.mjs +25 -25
- package/es/Modal/Modal.mjs.map +1 -1
- package/es/Modal/ModalProvider.d.mts +2 -2
- package/es/Modal/ModalStackItem.mjs +1 -1
- package/es/Modal/ModalStackItem.mjs.map +1 -1
- package/es/Modal/imperative.d.mts +2 -2
- package/es/Modal/imperative.mjs +5 -5
- package/es/Modal/imperative.mjs.map +1 -1
- package/es/MotionProvider/index.d.mts +2 -2
- package/es/MotionProvider/index.mjs.map +1 -1
- package/es/Popover/ArrowIcon.d.mts +2 -2
- package/es/Popover/Popover.mjs +2 -2
- package/es/Popover/Popover.mjs.map +1 -1
- package/es/Popover/PopoverGroup.mjs +2 -2
- package/es/Popover/PopoverGroup.mjs.map +1 -1
- package/es/Popover/PopoverInGroup.mjs +2 -2
- package/es/Popover/PopoverInGroup.mjs.map +1 -1
- package/es/Popover/PopoverStandalone.mjs +1 -1
- package/es/Popover/PopoverStandalone.mjs.map +1 -1
- package/es/Popover/atoms.d.mts +2 -2
- package/es/Popover/atoms.mjs +1 -1
- package/es/Popover/atoms.mjs.map +1 -1
- package/es/Popover/context.d.mts +2 -2
- package/es/Popover/context.mjs.map +1 -1
- package/es/Popover/groupContext.mjs.map +1 -1
- package/es/ScrollArea/atoms.d.mts +7 -7
- package/es/ScrollArea/type.d.mts +1 -1
- package/es/ScrollShadow/style.mjs.map +1 -1
- package/es/ScrollShadow/useScrollOverflow.mjs.map +1 -1
- package/es/SearchBar/SearchBar.d.mts +2 -2
- package/es/SearchBar/SearchBar.mjs +12 -12
- package/es/SearchBar/SearchBar.mjs.map +1 -1
- package/es/Segmented/Segmented.d.mts +2 -2
- package/es/Segmented/style.mjs.map +1 -1
- package/es/Select/Select.d.mts +2 -2
- package/es/Select/Select.mjs +2 -2
- package/es/Select/Select.mjs.map +1 -1
- package/es/Select/style.mjs.map +1 -1
- package/es/SideNav/SideNav.d.mts +2 -2
- package/es/Skeleton/Skeleton.mjs +1 -1
- package/es/Skeleton/Skeleton.mjs.map +1 -1
- package/es/Skeleton/SkeletonBlock.mjs.map +1 -1
- package/es/Skeleton/SkeletonTags.mjs +3 -3
- package/es/Skeleton/SkeletonTags.mjs.map +1 -1
- package/es/Skeleton/SkeletonTitle.mjs +1 -1
- package/es/Skeleton/SkeletonTitle.mjs.map +1 -1
- package/es/SliderWithInput/SliderWithInput.d.mts +2 -2
- package/es/SliderWithInput/SliderWithInput.mjs +3 -3
- package/es/SliderWithInput/SliderWithInput.mjs.map +1 -1
- package/es/Snippet/Snippet.mjs +1 -1
- package/es/Snippet/Snippet.mjs.map +1 -1
- package/es/Snippet/style.mjs.map +1 -1
- package/es/SortableList/SortableList.mjs +1 -1
- package/es/SortableList/SortableList.mjs.map +1 -1
- package/es/SortableList/components/DragHandle.d.mts +2 -2
- package/es/SortableList/components/DragHandle.mjs +3 -3
- package/es/SortableList/components/DragHandle.mjs.map +1 -1
- package/es/SortableList/components/SortableItem.d.mts +2 -2
- package/es/SortableList/components/SortableItem.mjs +1 -1
- package/es/SortableList/components/SortableItem.mjs.map +1 -1
- package/es/SortableList/components/SortableOverlay.mjs.map +1 -1
- package/es/SortableList/style.mjs.map +1 -1
- package/es/SortableList/type.d.mts +2 -2
- package/es/Tabs/style.mjs.map +1 -1
- package/es/Tag/Tag.mjs +2 -2
- package/es/Tag/Tag.mjs.map +1 -1
- package/es/Tag/styles.mjs.map +1 -1
- package/es/Text/Text.mjs +23 -24
- package/es/Text/Text.mjs.map +1 -1
- package/es/ThemeProvider/ConfigProvider.mjs.map +1 -1
- package/es/ThemeProvider/GlobalStyle/antdOverride.mjs.map +1 -1
- package/es/ThemeProvider/GlobalStyle/global.mjs.map +1 -1
- package/es/ThemeProvider/ThemeProvider.d.mts +2 -2
- package/es/ThemeProvider/ThemeProvider.mjs.map +1 -1
- package/es/ThemeSwitch/ThemeSwitch.mjs +4 -4
- package/es/ThemeSwitch/ThemeSwitch.mjs.map +1 -1
- package/es/Toast/Toast.mjs +3 -3
- package/es/Toast/Toast.mjs.map +1 -1
- package/es/Toast/imperative.d.mts +3 -3
- package/es/Toast/imperative.mjs +1 -1
- package/es/Toast/imperative.mjs.map +1 -1
- package/es/Toc/Toc.d.mts +2 -2
- package/es/Toc/Toc.mjs.map +1 -1
- package/es/Toc/TocMobile.mjs +4 -4
- package/es/Toc/TocMobile.mjs.map +1 -1
- package/es/Toc/utils.mjs.map +1 -1
- package/es/Tooltip/Tooltip.mjs +2 -2
- package/es/Tooltip/Tooltip.mjs.map +1 -1
- package/es/Tooltip/TooltipContent.mjs.map +1 -1
- package/es/Tooltip/TooltipGroup.mjs +3 -3
- package/es/Tooltip/TooltipGroup.mjs.map +1 -1
- package/es/Tooltip/TooltipInGroup.mjs +3 -3
- package/es/Tooltip/TooltipInGroup.mjs.map +1 -1
- package/es/Tooltip/TooltipStandalone.mjs +2 -2
- package/es/Tooltip/TooltipStandalone.mjs.map +1 -1
- package/es/Tooltip/groupContext.mjs.map +1 -1
- package/es/Tooltip/type.d.mts +1 -1
- package/es/Video/index.d.mts +2 -2
- package/es/Video/index.mjs +8 -8
- package/es/Video/index.mjs.map +1 -1
- package/es/Video/style.mjs.map +1 -1
- package/es/awesome/BottomGradientButton/BottomGradientButton.d.mts +2 -2
- package/es/awesome/BottomGradientButton/BottomGradientButton.mjs +1 -1
- package/es/awesome/BottomGradientButton/BottomGradientButton.mjs.map +1 -1
- package/es/awesome/Features/FeatureItem.mjs +1 -1
- package/es/awesome/Features/FeatureItem.mjs.map +1 -1
- package/es/awesome/Features/Features.d.mts +2 -2
- package/es/awesome/Features/Features.mjs +4 -4
- package/es/awesome/Features/Features.mjs.map +1 -1
- package/es/awesome/Features/type.d.mts +1 -1
- package/es/awesome/Giscus/Giscus.d.mts +2 -2
- package/es/awesome/GradientButton/GradientButton.d.mts +2 -2
- package/es/awesome/GradientButton/GradientButton.mjs +2 -2
- package/es/awesome/GradientButton/GradientButton.mjs.map +1 -1
- package/es/awesome/GridBackground/GridBackground.d.mts +2 -2
- package/es/awesome/GridBackground/GridShowcase.d.mts +2 -2
- package/es/awesome/GridBackground/GridShowcase.mjs +5 -5
- package/es/awesome/GridBackground/GridShowcase.mjs.map +1 -1
- package/es/awesome/GridBackground/components/Grid.mjs.map +1 -1
- package/es/awesome/Hero/Hero.d.mts +2 -2
- package/es/awesome/Hero/Hero.mjs +3 -3
- package/es/awesome/Hero/Hero.mjs.map +1 -1
- package/es/awesome/Hero/type.d.mts +1 -1
- package/es/awesome/Spline/ParentSize.mjs.map +1 -1
- package/es/awesome/Spline/Spine.d.mts +2 -2
- package/es/awesome/Spline/Spine.mjs +2 -2
- package/es/awesome/Spline/Spine.mjs.map +1 -1
- package/es/awesome/Spotlight/Spotlight.d.mts +2 -2
- package/es/awesome/SpotlightCard/SpotlightCard.d.mts +2 -2
- package/es/brand/BrandLoading/index.mjs.map +1 -1
- package/es/brand/LobeChat/index.d.mts +2 -2
- package/es/brand/LobeChat/index.mjs +3 -3
- package/es/brand/LobeChat/index.mjs.map +1 -1
- package/es/brand/LobeChatText/index.mjs.map +1 -1
- package/es/brand/LobeHub/index.d.mts +2 -2
- package/es/brand/LobeHub/index.mjs +3 -3
- package/es/brand/LobeHub/index.mjs.map +1 -1
- package/es/brand/LobeHubText/index.mjs.map +1 -1
- package/es/brand/Logo3d/index.mjs.map +1 -1
- package/es/brand/LogoThree/Loading.mjs +2 -2
- package/es/brand/LogoThree/Loading.mjs.map +1 -1
- package/es/brand/LogoThree/LogoSpline.d.mts +2 -2
- package/es/brand/LogoThree/LogoSpline.mjs +1 -1
- package/es/brand/LogoThree/LogoSpline.mjs.map +1 -1
- package/es/brand/LogoThree/index.d.mts +2 -2
- package/es/brand/LogoThree/index.mjs +4 -4
- package/es/brand/LogoThree/index.mjs.map +1 -1
- package/es/brand/components/Divider.mjs.map +1 -1
- package/es/chat/BackBottom/BackBottom.d.mts +2 -2
- package/es/chat/BackBottom/BackBottom.mjs +2 -2
- package/es/chat/BackBottom/BackBottom.mjs.map +1 -1
- package/es/chat/ChatHeader/ChatHeader.mjs +6 -6
- package/es/chat/ChatHeader/ChatHeader.mjs.map +1 -1
- package/es/chat/ChatHeader/ChatHeaderTitle.mjs +4 -4
- package/es/chat/ChatHeader/ChatHeaderTitle.mjs.map +1 -1
- package/es/chat/ChatInputArea/ChatInputArea.mjs +3 -3
- package/es/chat/ChatInputArea/ChatInputArea.mjs.map +1 -1
- package/es/chat/ChatInputArea/components/ChatInputActionBar.mjs +3 -3
- package/es/chat/ChatInputArea/components/ChatInputActionBar.mjs.map +1 -1
- package/es/chat/ChatInputArea/components/ChatInputAreaInner.d.mts +2 -2
- package/es/chat/ChatInputArea/components/ChatInputAreaInner.mjs +3 -3
- package/es/chat/ChatInputArea/components/ChatInputAreaInner.mjs.map +1 -1
- package/es/chat/ChatInputArea/components/ChatSendButton.mjs +5 -5
- package/es/chat/ChatInputArea/components/ChatSendButton.mjs.map +1 -1
- package/es/chat/ChatItem/ChatItem.mjs +9 -9
- package/es/chat/ChatItem/ChatItem.mjs.map +1 -1
- package/es/chat/ChatItem/components/Actions.mjs.map +1 -1
- package/es/chat/ChatItem/components/Avatar.mjs +2 -2
- package/es/chat/ChatItem/components/Avatar.mjs.map +1 -1
- package/es/chat/ChatItem/components/ErrorContent.mjs +1 -1
- package/es/chat/ChatItem/components/ErrorContent.mjs.map +1 -1
- package/es/chat/ChatItem/components/Loading.mjs +2 -2
- package/es/chat/ChatItem/components/Loading.mjs.map +1 -1
- package/es/chat/ChatItem/components/MessageContent.mjs +4 -4
- package/es/chat/ChatItem/components/MessageContent.mjs.map +1 -1
- package/es/chat/ChatItem/components/Title.mjs.map +1 -1
- package/es/chat/ChatList/ChatList.d.mts +2 -2
- package/es/chat/ChatList/components/ChatListItem.mjs +14 -14
- package/es/chat/ChatList/components/ChatListItem.mjs.map +1 -1
- package/es/chat/ChatList/type.d.mts +1 -1
- package/es/chat/EditableMessage/EditableMessage.d.mts +2 -2
- package/es/chat/EditableMessage/EditableMessage.mjs +15 -15
- package/es/chat/EditableMessage/EditableMessage.mjs.map +1 -1
- package/es/chat/EditableMessageList/EditableMessageList.d.mts +2 -2
- package/es/chat/EditableMessageList/EditableMessageList.mjs +17 -17
- package/es/chat/EditableMessageList/EditableMessageList.mjs.map +1 -1
- package/es/chat/MessageInput/MessageInput.d.mts +2 -2
- package/es/chat/MessageInput/MessageInput.mjs +8 -8
- package/es/chat/MessageInput/MessageInput.mjs.map +1 -1
- package/es/chat/MessageModal/MessageModal.d.mts +2 -2
- package/es/chat/MessageModal/MessageModal.mjs +12 -12
- package/es/chat/MessageModal/MessageModal.mjs.map +1 -1
- package/es/chat/TokenTag/TokenTag.mjs +2 -2
- package/es/chat/TokenTag/TokenTag.mjs.map +1 -1
- package/es/chat/types/error.mjs.map +1 -1
- package/es/color/ColorScales/ScaleRow.mjs +3 -3
- package/es/color/ColorScales/ScaleRow.mjs.map +1 -1
- package/es/color/ColorScales/index.d.mts +2 -2
- package/es/color/ColorScales/index.mjs +4 -4
- package/es/color/ColorScales/index.mjs.map +1 -1
- package/es/color/CssVar/ScaleRow.mjs +4 -4
- package/es/color/CssVar/ScaleRow.mjs.map +1 -1
- package/es/color/CssVar/VarRow.mjs +2 -2
- package/es/color/CssVar/VarRow.mjs.map +1 -1
- package/es/color/CssVar/index.d.mts +2 -2
- package/es/color/CssVar/index.mjs +4 -4
- package/es/color/CssVar/index.mjs.map +1 -1
- package/es/color/colors/blue.mjs.map +1 -1
- package/es/color/colors/cyan.mjs.map +1 -1
- package/es/color/colors/geekblue.mjs.map +1 -1
- package/es/color/colors/gold.mjs.map +1 -1
- package/es/color/colors/gray.mjs.map +1 -1
- package/es/color/colors/green.mjs.map +1 -1
- package/es/color/colors/lime.mjs.map +1 -1
- package/es/color/colors/magenta.mjs.map +1 -1
- package/es/color/colors/orange.mjs.map +1 -1
- package/es/color/colors/primary.mjs.map +1 -1
- package/es/color/colors/purple.mjs.map +1 -1
- package/es/color/colors/red.mjs.map +1 -1
- package/es/color/colors/volcano.mjs.map +1 -1
- package/es/color/colors/yellow.mjs.map +1 -1
- package/es/color/neutrals/mauve.mjs.map +1 -1
- package/es/color/neutrals/olive.mjs.map +1 -1
- package/es/color/neutrals/sage.mjs.map +1 -1
- package/es/color/neutrals/sand.mjs.map +1 -1
- package/es/color/neutrals/slate.mjs.map +1 -1
- package/es/hooks/useFloatingLayer.mjs +2 -2
- package/es/hooks/useFloatingLayer.mjs.map +1 -1
- package/es/hooks/useHighlight.mjs.map +1 -1
- package/es/hooks/useMarkdown/latex.mjs +12 -12
- package/es/hooks/useMarkdown/latex.mjs.map +1 -1
- package/es/hooks/useMarkdown/useMarkdownComponents.mjs +1 -1
- package/es/hooks/useMarkdown/useMarkdownComponents.mjs.map +1 -1
- package/es/hooks/useMarkdown/utils.mjs +4 -4
- package/es/hooks/useMarkdown/utils.mjs.map +1 -1
- package/es/hooks/useNativeButton.mjs.map +1 -1
- package/es/hooks/useStreamHighlight.mjs.map +1 -1
- package/es/i18n/context.d.mts +3 -3
- package/es/i18n/context.mjs.map +1 -1
- package/es/icons/Authelia/components/Color.mjs.map +1 -1
- package/es/icons/lucideExtra/BotPromptIcon.d.mts +2 -2
- package/es/icons/lucideExtra/CreateBotIcon.d.mts +3 -3
- package/es/icons/lucideExtra/DiscordIcon.d.mts +2 -2
- package/es/icons/lucideExtra/GlobeOffIcon.d.mts +2 -2
- package/es/icons/lucideExtra/GroupBotIcon.d.mts +2 -2
- package/es/icons/lucideExtra/GroupBotSquareIcon.d.mts +3 -3
- package/es/icons/lucideExtra/LeftClickIcon.d.mts +3 -3
- package/es/icons/lucideExtra/LeftDoubleClickIcon.d.mts +3 -3
- package/es/icons/lucideExtra/McpIcon.d.mts +3 -3
- package/es/icons/lucideExtra/ProviderIcon.d.mts +3 -3
- package/es/icons/lucideExtra/RightClickIcon.d.mts +3 -3
- package/es/icons/lucideExtra/RightDoubleClickIcon.d.mts +3 -3
- package/es/icons/lucideExtra/ShapesUploadIcon.d.mts +3 -3
- package/es/icons/lucideExtra/TreeDownRightIcon.d.mts +2 -2
- package/es/icons/lucideExtra/TreeUpDownRightIcon.d.mts +3 -3
- package/es/mdx/Callout/index.mjs +1 -1
- package/es/mdx/Callout/index.mjs.map +1 -1
- package/es/mdx/Cards/Card.mjs +2 -2
- package/es/mdx/Cards/Card.mjs.map +1 -1
- package/es/mdx/FileTree/File.mjs +1 -1
- package/es/mdx/FileTree/File.mjs.map +1 -1
- package/es/mdx/FileTree/Folder.mjs +1 -1
- package/es/mdx/FileTree/Folder.mjs.map +1 -1
- package/es/mdx/FileTree/index.mjs.map +1 -1
- package/es/mdx/Mdx/index.d.mts +2 -2
- package/es/mdx/Mdx/index.mjs +3 -3
- package/es/mdx/Mdx/index.mjs.map +1 -1
- package/es/mdx/Steps/index.mjs.map +1 -1
- package/es/mdx/Tabs/Tab.mjs.map +1 -1
- package/es/mdx/Tabs/index.mjs +1 -1
- package/es/mdx/Tabs/index.mjs.map +1 -1
- package/es/mdx/mdxComponents/Citation/PopoverPanel.mjs +3 -3
- package/es/mdx/mdxComponents/Citation/PopoverPanel.mjs.map +1 -1
- package/es/mdx/mdxComponents/Citation/index.mjs.map +1 -1
- package/es/mdx/mdxComponents/Link.mjs +1 -1
- package/es/mdx/mdxComponents/Link.mjs.map +1 -1
- package/es/mobile/ChatHeader/ChatHeader.mjs +4 -4
- package/es/mobile/ChatHeader/ChatHeader.mjs.map +1 -1
- package/es/mobile/ChatHeader/ChatHeaderTitle.d.mts +2 -2
- package/es/mobile/ChatHeader/ChatHeaderTitle.mjs +5 -5
- package/es/mobile/ChatHeader/ChatHeaderTitle.mjs.map +1 -1
- package/es/mobile/ChatInputArea/ChatInputArea.mjs +9 -9
- package/es/mobile/ChatInputArea/ChatInputArea.mjs.map +1 -1
- package/es/mobile/ChatInputArea/components/ChatSendButton.d.mts +2 -2
- package/es/mobile/ChatInputArea/components/ChatSendButton.mjs +2 -2
- package/es/mobile/ChatInputArea/components/ChatSendButton.mjs.map +1 -1
- package/es/mobile/SafeArea/SafeArea.mjs.map +1 -1
- package/es/mobile/TabBar/TabBar.mjs +1 -1
- package/es/mobile/TabBar/TabBar.mjs.map +1 -1
- package/es/storybook/StoryBook/index.d.mts +2 -2
- package/es/storybook/StoryBook/index.mjs.map +1 -1
- package/es/styles/theme/algorithms/darkAlgorithm.mjs.map +1 -1
- package/es/styles/theme/algorithms/lightAlgorithm.mjs.map +1 -1
- package/es/styles/theme/antdTheme.mjs.map +1 -1
- package/es/styles/theme/customStylish.mjs.map +1 -1
- package/es/styles/theme/customToken.mjs.map +1 -1
- package/es/styles/theme/generateColorPalette.mjs.map +1 -1
- package/es/styles/theme/token/base.mjs.map +1 -1
- package/es/styles/theme/token/dark.mjs.map +1 -1
- package/es/styles/theme/token/light.mjs.map +1 -1
- package/package.json +79 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"magenta.mjs","names":["magenta: ColorScaleItem"],"sources":["../../../src/color/colors/magenta.ts"],"sourcesContent":["import { ColorScaleItem } from '../types';\n\nconst magenta: ColorScaleItem = {\n dark: [\n '#100002',\n '#350011',\n '#4b001e',\n '#63002d',\n '#79093f',\n '#8e1752',\n '#a32466',\n '#b8317b',\n '#ce3e91',\n '#e34ba9',\n '#f38bcb',\n '#fec5e8',\n '#ffffff',\n ],\n darkA: [\n 'rgba(229, 0, 29, 0.07)',\n 'rgba(252, 0, 81, 0.21)',\n 'rgba(250, 0, 100, 0.3)',\n 'rgba(254, 0, 115, 0.39)',\n 'rgba(252, 19, 131, 0.48)',\n 'rgba(254, 41, 146, 0.56)',\n 'rgba(255, 56, 159, 0.64)',\n 'rgba(252, 67, 168, 0.73)',\n 'rgba(254, 77, 179, 0.81)',\n 'rgba(255, 84, 190, 0.89)',\n 'rgba(253, 145, 211, 0.96)',\n '#fec5e8',\n '#ffffff',\n ],\n light: [\n '#ffffff',\n '#fff7f9',\n '#ffeaf4',\n '#ffdaee',\n '#ffc7e7',\n '#ffb2df',\n '#ff99d6',\n '#f980ca',\n '#ef67ba',\n '#e34ba9',\n '#a32466',\n '#63002d',\n '#100002',\n ],\n lightA: [\n 'rgba(255, 255, 255, 0.01)',\n 'rgba(255, 55, 105, 0.04)',\n 'rgba(255, 22, 133, 0.09)',\n 'rgba(255, 8, 142, 0.15)',\n 'rgba(255, 0, 146, 0.22)',\n 'rgba(255, 7, 152, 0.31)',\n 'rgba(255, 0, 153, 0.4)',\n 'rgba(243, 1, 149, 0.5)',\n 'rgba(228, 2, 140, 0.6)',\n 'rgba(216, 1, 134, 0.71)',\n 'rgba(148, 0, 77, 0.86)',\n '#63002d',\n '#100002',\n ],\n};\n\nexport default magenta;\n"],"mappings":";AAEA,MAAMA,UAA0B;CAC9B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,sBAAe"}
|
|
1
|
+
{"version":3,"file":"magenta.mjs","names":["magenta: ColorScaleItem"],"sources":["../../../src/color/colors/magenta.ts"],"sourcesContent":["import type { ColorScaleItem } from '../types';\n\nconst magenta: ColorScaleItem = {\n dark: [\n '#100002',\n '#350011',\n '#4b001e',\n '#63002d',\n '#79093f',\n '#8e1752',\n '#a32466',\n '#b8317b',\n '#ce3e91',\n '#e34ba9',\n '#f38bcb',\n '#fec5e8',\n '#ffffff',\n ],\n darkA: [\n 'rgba(229, 0, 29, 0.07)',\n 'rgba(252, 0, 81, 0.21)',\n 'rgba(250, 0, 100, 0.3)',\n 'rgba(254, 0, 115, 0.39)',\n 'rgba(252, 19, 131, 0.48)',\n 'rgba(254, 41, 146, 0.56)',\n 'rgba(255, 56, 159, 0.64)',\n 'rgba(252, 67, 168, 0.73)',\n 'rgba(254, 77, 179, 0.81)',\n 'rgba(255, 84, 190, 0.89)',\n 'rgba(253, 145, 211, 0.96)',\n '#fec5e8',\n '#ffffff',\n ],\n light: [\n '#ffffff',\n '#fff7f9',\n '#ffeaf4',\n '#ffdaee',\n '#ffc7e7',\n '#ffb2df',\n '#ff99d6',\n '#f980ca',\n '#ef67ba',\n '#e34ba9',\n '#a32466',\n '#63002d',\n '#100002',\n ],\n lightA: [\n 'rgba(255, 255, 255, 0.01)',\n 'rgba(255, 55, 105, 0.04)',\n 'rgba(255, 22, 133, 0.09)',\n 'rgba(255, 8, 142, 0.15)',\n 'rgba(255, 0, 146, 0.22)',\n 'rgba(255, 7, 152, 0.31)',\n 'rgba(255, 0, 153, 0.4)',\n 'rgba(243, 1, 149, 0.5)',\n 'rgba(228, 2, 140, 0.6)',\n 'rgba(216, 1, 134, 0.71)',\n 'rgba(148, 0, 77, 0.86)',\n '#63002d',\n '#100002',\n ],\n};\n\nexport default magenta;\n"],"mappings":";AAEA,MAAMA,UAA0B;CAC9B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,sBAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orange.mjs","names":["orange: ColorScaleItem"],"sources":["../../../src/color/colors/orange.ts"],"sourcesContent":["import { ColorScaleItem } from '../types';\n\nconst orange: ColorScaleItem = {\n dark: [\n '#070300',\n '#291900',\n '#462b00',\n '#684100',\n '#8e5900',\n '#b36f00',\n '#d18000',\n '#e88b00',\n '#f89200',\n '#ff9927',\n '#ffd1b1',\n '#fff1eb',\n '#ffffff',\n ],\n darkA: [\n 'rgba(233, 100, 0, 0.03)',\n 'rgba(241, 147, 0, 0.17)',\n 'rgba(250, 154, 0, 0.28)',\n 'rgba(254, 159, 0, 0.41)',\n 'rgba(254, 159, 0, 0.56)',\n 'rgba(252, 156, 0, 0.71)',\n 'rgba(255, 156, 0, 0.82)',\n 'rgba(255, 153, 0, 0.91)',\n 'rgba(253, 149, 0, 0.98)',\n '#ff9927',\n '#ffd1b1',\n '#fff1eb',\n '#ffffff',\n ],\n light: [\n '#ffffff',\n '#fffcff',\n '#fff8f6',\n '#fff1eb',\n '#ffe9dd',\n '#ffdeca',\n '#ffd1b1',\n '#ffc293',\n '#ffb06a',\n '#f88c13',\n '#d18000',\n '#684100',\n '#070300',\n ],\n lightA: [\n 'rgba(255, 255, 255, 0.02)',\n 'rgba(255, 105, 255, 0.03)',\n 'rgba(255, 80, 30, 0.08)',\n 'rgba(255, 80, 5, 0.12)',\n 'rgba(255, 98, 12, 0.16)',\n 'rgba(255, 98, 3, 0.21)',\n 'rgba(255, 107, 3, 0.31)',\n 'rgba(255, 113, 4, 0.43)',\n 'rgba(255, 121, 2, 0.59)',\n 'rgba(255, 135, 1, 0.85)',\n '#d18000',\n '#684100',\n '#070300',\n ],\n};\n\nexport default orange;\n"],"mappings":";AAEA,MAAMA,SAAyB;CAC7B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,qBAAe"}
|
|
1
|
+
{"version":3,"file":"orange.mjs","names":["orange: ColorScaleItem"],"sources":["../../../src/color/colors/orange.ts"],"sourcesContent":["import type { ColorScaleItem } from '../types';\n\nconst orange: ColorScaleItem = {\n dark: [\n '#070300',\n '#291900',\n '#462b00',\n '#684100',\n '#8e5900',\n '#b36f00',\n '#d18000',\n '#e88b00',\n '#f89200',\n '#ff9927',\n '#ffd1b1',\n '#fff1eb',\n '#ffffff',\n ],\n darkA: [\n 'rgba(233, 100, 0, 0.03)',\n 'rgba(241, 147, 0, 0.17)',\n 'rgba(250, 154, 0, 0.28)',\n 'rgba(254, 159, 0, 0.41)',\n 'rgba(254, 159, 0, 0.56)',\n 'rgba(252, 156, 0, 0.71)',\n 'rgba(255, 156, 0, 0.82)',\n 'rgba(255, 153, 0, 0.91)',\n 'rgba(253, 149, 0, 0.98)',\n '#ff9927',\n '#ffd1b1',\n '#fff1eb',\n '#ffffff',\n ],\n light: [\n '#ffffff',\n '#fffcff',\n '#fff8f6',\n '#fff1eb',\n '#ffe9dd',\n '#ffdeca',\n '#ffd1b1',\n '#ffc293',\n '#ffb06a',\n '#f88c13',\n '#d18000',\n '#684100',\n '#070300',\n ],\n lightA: [\n 'rgba(255, 255, 255, 0.02)',\n 'rgba(255, 105, 255, 0.03)',\n 'rgba(255, 80, 30, 0.08)',\n 'rgba(255, 80, 5, 0.12)',\n 'rgba(255, 98, 12, 0.16)',\n 'rgba(255, 98, 3, 0.21)',\n 'rgba(255, 107, 3, 0.31)',\n 'rgba(255, 113, 4, 0.43)',\n 'rgba(255, 121, 2, 0.59)',\n 'rgba(255, 135, 1, 0.85)',\n '#d18000',\n '#684100',\n '#070300',\n ],\n};\n\nexport default orange;\n"],"mappings":";AAEA,MAAMA,SAAyB;CAC7B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,qBAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primary.mjs","names":["primary: ColorScaleItem"],"sources":["../../../src/color/colors/primary.ts"],"sourcesContent":["import { ColorScaleItem } from '../types';\n\nconst primary: ColorScaleItem = {\n dark: [\n '#000000',\n '#111111',\n '#333333',\n '#555555',\n '#666666',\n '#888888',\n '#aaaaaa',\n '#cccccc',\n '#dddddd',\n '#eeeeee',\n '#ffffff',\n '#ffffff',\n '#ffffff',\n ],\n darkA: [\n 'rgba(255, 255, 255, 0.02)',\n 'rgba(255, 255, 255, 0.08)',\n 'rgba(255, 255, 255, 0.16)',\n 'rgba(255, 255, 255, 0.22)',\n 'rgba(255, 255, 255, 0.36)',\n 'rgba(255, 255, 255, 0.48)',\n 'rgba(255, 255, 255, 0.6)',\n 'rgba(255, 255, 255, 0.72)',\n 'rgba(255, 255, 255, 0.84)',\n 'rgba(255, 255, 255, 0.88)',\n 'rgba(255, 255, 255, 0.92)',\n 'rgba(255, 255, 255, 0.96)',\n 'rgba(255, 255, 255, 0.98)',\n ],\n light: [\n '#ffffff',\n '#f5f5f5',\n '#eeeeee',\n '#cccccc',\n '#aaaaaa',\n '#888888',\n '#666666',\n '#444444',\n '#333333',\n '#222222',\n '#111111',\n '#0b0b0b',\n '#000000',\n ],\n lightA: [\n 'rgba(0, 0, 0, 0.02)',\n 'rgba(0, 0, 0, 0.08)',\n 'rgba(0, 0, 0, 0.16)',\n 'rgba(0, 0, 0, 0.22)',\n 'rgba(0, 0, 0, 0.36)',\n 'rgba(0, 0, 0, 0.48)',\n 'rgba(0, 0, 0, 0.6)',\n 'rgba(0, 0, 0, 0.72)',\n 'rgba(0, 0, 0, 0.84)',\n 'rgba(0, 0, 0, 0.88)',\n 'rgba(0, 0, 0, 0.92)',\n 'rgba(0, 0, 0, 0.96)',\n 'rgba(0, 0, 0, 0.98)',\n ],\n};\n\nexport default primary;\n"],"mappings":";AAEA,MAAMA,UAA0B;CAC9B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,sBAAe"}
|
|
1
|
+
{"version":3,"file":"primary.mjs","names":["primary: ColorScaleItem"],"sources":["../../../src/color/colors/primary.ts"],"sourcesContent":["import type { ColorScaleItem } from '../types';\n\nconst primary: ColorScaleItem = {\n dark: [\n '#000000',\n '#111111',\n '#333333',\n '#555555',\n '#666666',\n '#888888',\n '#aaaaaa',\n '#cccccc',\n '#dddddd',\n '#eeeeee',\n '#ffffff',\n '#ffffff',\n '#ffffff',\n ],\n darkA: [\n 'rgba(255, 255, 255, 0.02)',\n 'rgba(255, 255, 255, 0.08)',\n 'rgba(255, 255, 255, 0.16)',\n 'rgba(255, 255, 255, 0.22)',\n 'rgba(255, 255, 255, 0.36)',\n 'rgba(255, 255, 255, 0.48)',\n 'rgba(255, 255, 255, 0.6)',\n 'rgba(255, 255, 255, 0.72)',\n 'rgba(255, 255, 255, 0.84)',\n 'rgba(255, 255, 255, 0.88)',\n 'rgba(255, 255, 255, 0.92)',\n 'rgba(255, 255, 255, 0.96)',\n 'rgba(255, 255, 255, 0.98)',\n ],\n light: [\n '#ffffff',\n '#f5f5f5',\n '#eeeeee',\n '#cccccc',\n '#aaaaaa',\n '#888888',\n '#666666',\n '#444444',\n '#333333',\n '#222222',\n '#111111',\n '#0b0b0b',\n '#000000',\n ],\n lightA: [\n 'rgba(0, 0, 0, 0.02)',\n 'rgba(0, 0, 0, 0.08)',\n 'rgba(0, 0, 0, 0.16)',\n 'rgba(0, 0, 0, 0.22)',\n 'rgba(0, 0, 0, 0.36)',\n 'rgba(0, 0, 0, 0.48)',\n 'rgba(0, 0, 0, 0.6)',\n 'rgba(0, 0, 0, 0.72)',\n 'rgba(0, 0, 0, 0.84)',\n 'rgba(0, 0, 0, 0.88)',\n 'rgba(0, 0, 0, 0.92)',\n 'rgba(0, 0, 0, 0.96)',\n 'rgba(0, 0, 0, 0.98)',\n ],\n};\n\nexport default primary;\n"],"mappings":";AAEA,MAAMA,UAA0B;CAC9B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,sBAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purple.mjs","names":["purple: ColorScaleItem"],"sources":["../../../src/color/colors/purple.ts"],"sourcesContent":["import { ColorScaleItem } from '../types';\n\nconst purple: ColorScaleItem = {\n dark: [\n '#0d000b',\n '#2e002a',\n '#42003e',\n '#560053',\n '#670e66',\n '#781e78',\n '#892b8a',\n '#9a399e',\n '#ab46b2',\n '#bd54c6',\n '#d590da',\n '#edc7ee',\n '#ffffff',\n ],\n darkA: [\n 'rgba(217, 0, 183, 0.06)',\n 'rgba(242, 0, 221, 0.19)',\n 'rgba(254, 0, 238, 0.26)',\n 'rgba(253, 0, 244, 0.34)',\n 'rgba(251, 34, 249, 0.41)',\n 'rgba(255, 64, 255, 0.47)',\n 'rgba(249, 78, 251, 0.55)',\n 'rgba(248, 92, 255, 0.62)',\n 'rgba(244, 100, 254, 0.7)',\n 'rgba(242, 108, 254, 0.78)',\n 'rgba(248, 167, 253, 0.86)',\n 'rgba(252, 212, 253, 0.94)',\n '#ffffff',\n ],\n light: [\n '#ffffff',\n '#fff6fb',\n '#ffe7fd',\n '#fdd6fe',\n '#f6c4f8',\n '#eeb1f1',\n '#e49ce8',\n '#d886de',\n '#cb6ed2',\n '#bd54c6',\n '#892b8a',\n '#560053',\n '#0d000b',\n ],\n lightA: [\n 'rgba(255, 255, 255, 0.01)',\n 'rgba(255, 30, 155, 0.04)',\n 'rgba(255, 15, 235, 0.08)',\n 'rgba(243, 14, 249, 0.16)',\n 'rgba(218, 9, 226, 0.24)',\n 'rgba(200, 3, 210, 0.31)',\n 'rgba(186, 1, 196, 0.39)',\n 'rgba(174, 3, 186, 0.48)',\n 'rgba(164, 1, 176, 0.57)',\n 'rgba(156, 0, 170, 0.67)',\n 'rgba(113, 0, 114, 0.83)',\n '#560053',\n '#0d000b',\n ],\n};\n\nexport default purple;\n"],"mappings":";AAEA,MAAMA,SAAyB;CAC7B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,qBAAe"}
|
|
1
|
+
{"version":3,"file":"purple.mjs","names":["purple: ColorScaleItem"],"sources":["../../../src/color/colors/purple.ts"],"sourcesContent":["import type { ColorScaleItem } from '../types';\n\nconst purple: ColorScaleItem = {\n dark: [\n '#0d000b',\n '#2e002a',\n '#42003e',\n '#560053',\n '#670e66',\n '#781e78',\n '#892b8a',\n '#9a399e',\n '#ab46b2',\n '#bd54c6',\n '#d590da',\n '#edc7ee',\n '#ffffff',\n ],\n darkA: [\n 'rgba(217, 0, 183, 0.06)',\n 'rgba(242, 0, 221, 0.19)',\n 'rgba(254, 0, 238, 0.26)',\n 'rgba(253, 0, 244, 0.34)',\n 'rgba(251, 34, 249, 0.41)',\n 'rgba(255, 64, 255, 0.47)',\n 'rgba(249, 78, 251, 0.55)',\n 'rgba(248, 92, 255, 0.62)',\n 'rgba(244, 100, 254, 0.7)',\n 'rgba(242, 108, 254, 0.78)',\n 'rgba(248, 167, 253, 0.86)',\n 'rgba(252, 212, 253, 0.94)',\n '#ffffff',\n ],\n light: [\n '#ffffff',\n '#fff6fb',\n '#ffe7fd',\n '#fdd6fe',\n '#f6c4f8',\n '#eeb1f1',\n '#e49ce8',\n '#d886de',\n '#cb6ed2',\n '#bd54c6',\n '#892b8a',\n '#560053',\n '#0d000b',\n ],\n lightA: [\n 'rgba(255, 255, 255, 0.01)',\n 'rgba(255, 30, 155, 0.04)',\n 'rgba(255, 15, 235, 0.08)',\n 'rgba(243, 14, 249, 0.16)',\n 'rgba(218, 9, 226, 0.24)',\n 'rgba(200, 3, 210, 0.31)',\n 'rgba(186, 1, 196, 0.39)',\n 'rgba(174, 3, 186, 0.48)',\n 'rgba(164, 1, 176, 0.57)',\n 'rgba(156, 0, 170, 0.67)',\n 'rgba(113, 0, 114, 0.83)',\n '#560053',\n '#0d000b',\n ],\n};\n\nexport default purple;\n"],"mappings":";AAEA,MAAMA,SAAyB;CAC7B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,qBAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"red.mjs","names":["red: ColorScaleItem"],"sources":["../../../src/color/colors/red.ts"],"sourcesContent":["import { ColorScaleItem } from '../types';\n\nconst red: ColorScaleItem = {\n dark: [\n '#0f0003',\n '#380015',\n '#560023',\n '#780032',\n '#9d0042',\n '#c10251',\n '#d6225d',\n '#e43165',\n '#ee3a6a',\n '#f4416c',\n '#ffb0b7',\n '#ffe8e8',\n '#ffffff',\n ],\n darkA: [\n 'rgba(250, 0, 50, 0.06)',\n 'rgba(255, 0, 95, 0.22)',\n 'rgba(253, 0, 103, 0.34)',\n 'rgba(255, 0, 106, 0.47)',\n 'rgba(253, 0, 106, 0.62)',\n 'rgba(254, 3, 107, 0.76)',\n 'rgba(255, 40, 111, 0.84)',\n 'rgba(253, 54, 112, 0.9)',\n 'rgba(253, 62, 113, 0.94)',\n 'rgba(254, 68, 112, 0.96)',\n '#ffb0b7',\n '#ffe8e8',\n '#ffffff',\n ],\n light: [\n '#ffffff',\n '#fffbff',\n '#fff3f3',\n '#ffe8e8',\n '#ffdadb',\n '#ffc7ca',\n '#ffb0b7',\n '#ff94a1',\n '#ff6f87',\n '#f4416c',\n '#d6225d',\n '#780032',\n '#0f0003',\n ],\n lightA: [\n 'rgba(255, 255, 255, 0.01)',\n 'rgba(255, 55, 255, 0.02)',\n 'rgba(255, 15, 15, 0.05)',\n 'rgba(255, 25, 25, 0.1)',\n 'rgba(255, 8, 15, 0.15)',\n 'rgba(255, 0, 14, 0.22)',\n 'rgba(255, 0, 23, 0.31)',\n 'rgba(255, 0, 31, 0.42)',\n 'rgba(255, 2, 44, 0.57)',\n 'rgba(240, 2, 59, 0.75)',\n 'rgba(208, 1, 69, 0.87)',\n '#780032',\n '#0f0003',\n ],\n};\n\nexport default red;\n"],"mappings":";AAEA,MAAMA,MAAsB;CAC1B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,kBAAe"}
|
|
1
|
+
{"version":3,"file":"red.mjs","names":["red: ColorScaleItem"],"sources":["../../../src/color/colors/red.ts"],"sourcesContent":["import type { ColorScaleItem } from '../types';\n\nconst red: ColorScaleItem = {\n dark: [\n '#0f0003',\n '#380015',\n '#560023',\n '#780032',\n '#9d0042',\n '#c10251',\n '#d6225d',\n '#e43165',\n '#ee3a6a',\n '#f4416c',\n '#ffb0b7',\n '#ffe8e8',\n '#ffffff',\n ],\n darkA: [\n 'rgba(250, 0, 50, 0.06)',\n 'rgba(255, 0, 95, 0.22)',\n 'rgba(253, 0, 103, 0.34)',\n 'rgba(255, 0, 106, 0.47)',\n 'rgba(253, 0, 106, 0.62)',\n 'rgba(254, 3, 107, 0.76)',\n 'rgba(255, 40, 111, 0.84)',\n 'rgba(253, 54, 112, 0.9)',\n 'rgba(253, 62, 113, 0.94)',\n 'rgba(254, 68, 112, 0.96)',\n '#ffb0b7',\n '#ffe8e8',\n '#ffffff',\n ],\n light: [\n '#ffffff',\n '#fffbff',\n '#fff3f3',\n '#ffe8e8',\n '#ffdadb',\n '#ffc7ca',\n '#ffb0b7',\n '#ff94a1',\n '#ff6f87',\n '#f4416c',\n '#d6225d',\n '#780032',\n '#0f0003',\n ],\n lightA: [\n 'rgba(255, 255, 255, 0.01)',\n 'rgba(255, 55, 255, 0.02)',\n 'rgba(255, 15, 15, 0.05)',\n 'rgba(255, 25, 25, 0.1)',\n 'rgba(255, 8, 15, 0.15)',\n 'rgba(255, 0, 14, 0.22)',\n 'rgba(255, 0, 23, 0.31)',\n 'rgba(255, 0, 31, 0.42)',\n 'rgba(255, 2, 44, 0.57)',\n 'rgba(240, 2, 59, 0.75)',\n 'rgba(208, 1, 69, 0.87)',\n '#780032',\n '#0f0003',\n ],\n};\n\nexport default red;\n"],"mappings":";AAEA,MAAMA,MAAsB;CAC1B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,kBAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"volcano.mjs","names":["volcano: ColorScaleItem"],"sources":["../../../src/color/colors/volcano.ts"],"sourcesContent":["import { ColorScaleItem } from '../types';\n\nconst volcano: ColorScaleItem = {\n dark: [\n '#0c0100',\n '#2f0a00',\n '#451200',\n '#5d1900',\n '#762000',\n '#8e2a07',\n '#a53716',\n '#bc4424',\n '#d45132',\n '#ec5e41',\n '#ff9480',\n '#ffcbc3',\n '#ffffff',\n ],\n darkA: [\n 'rgba(240, 20, 0, 0.05)',\n 'rgba(247, 53, 0, 0.19)',\n 'rgba(246, 64, 0, 0.28)',\n 'rgba(251, 68, 0, 0.37)',\n 'rgba(251, 68, 0, 0.47)',\n 'rgba(254, 75, 12, 0.56)',\n 'rgba(254, 85, 34, 0.65)',\n 'rgba(254, 92, 49, 0.74)',\n 'rgba(255, 98, 60, 0.83)',\n 'rgba(254, 101, 70, 0.93)',\n '#ff9480',\n '#ffcbc3',\n '#ffffff',\n ],\n light: [\n '#ffffff',\n '#fff7f6',\n '#ffece9',\n '#ffded9',\n '#ffcec5',\n '#ffbbaf',\n '#ffa695',\n '#ff8e78',\n '#fb745a',\n '#ec5e41',\n '#a53716',\n '#5d1900',\n '#0c0100',\n ],\n lightA: [\n 'rgba(255, 255, 255, 0.01)',\n 'rgba(255, 55, 30, 0.04)',\n 'rgba(255, 44, 11, 0.06)',\n 'rgba(255, 35, 2, 0.12)',\n 'rgba(255, 42, 3, 0.20)',\n 'rgba(255, 43, 5, 0.32)',\n 'rgba(255, 43, 3, 0.42)',\n 'rgba(255, 42, 0, 0.53)',\n 'rgba(249, 41, 1, 0.65)',\n 'rgba(230, 40, 2, 0.75)',\n 'rgba(157, 38, 2, 0.92)',\n '#5d1900',\n '#0c0100',\n ],\n};\n\nexport default volcano;\n"],"mappings":";AAEA,MAAMA,UAA0B;CAC9B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,sBAAe"}
|
|
1
|
+
{"version":3,"file":"volcano.mjs","names":["volcano: ColorScaleItem"],"sources":["../../../src/color/colors/volcano.ts"],"sourcesContent":["import type { ColorScaleItem } from '../types';\n\nconst volcano: ColorScaleItem = {\n dark: [\n '#0c0100',\n '#2f0a00',\n '#451200',\n '#5d1900',\n '#762000',\n '#8e2a07',\n '#a53716',\n '#bc4424',\n '#d45132',\n '#ec5e41',\n '#ff9480',\n '#ffcbc3',\n '#ffffff',\n ],\n darkA: [\n 'rgba(240, 20, 0, 0.05)',\n 'rgba(247, 53, 0, 0.19)',\n 'rgba(246, 64, 0, 0.28)',\n 'rgba(251, 68, 0, 0.37)',\n 'rgba(251, 68, 0, 0.47)',\n 'rgba(254, 75, 12, 0.56)',\n 'rgba(254, 85, 34, 0.65)',\n 'rgba(254, 92, 49, 0.74)',\n 'rgba(255, 98, 60, 0.83)',\n 'rgba(254, 101, 70, 0.93)',\n '#ff9480',\n '#ffcbc3',\n '#ffffff',\n ],\n light: [\n '#ffffff',\n '#fff7f6',\n '#ffece9',\n '#ffded9',\n '#ffcec5',\n '#ffbbaf',\n '#ffa695',\n '#ff8e78',\n '#fb745a',\n '#ec5e41',\n '#a53716',\n '#5d1900',\n '#0c0100',\n ],\n lightA: [\n 'rgba(255, 255, 255, 0.01)',\n 'rgba(255, 55, 30, 0.04)',\n 'rgba(255, 44, 11, 0.06)',\n 'rgba(255, 35, 2, 0.12)',\n 'rgba(255, 42, 3, 0.20)',\n 'rgba(255, 43, 5, 0.32)',\n 'rgba(255, 43, 3, 0.42)',\n 'rgba(255, 42, 0, 0.53)',\n 'rgba(249, 41, 1, 0.65)',\n 'rgba(230, 40, 2, 0.75)',\n 'rgba(157, 38, 2, 0.92)',\n '#5d1900',\n '#0c0100',\n ],\n};\n\nexport default volcano;\n"],"mappings":";AAEA,MAAMA,UAA0B;CAC9B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,sBAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yellow.mjs","names":["yellow: ColorScaleItem"],"sources":["../../../src/color/colors/yellow.ts"],"sourcesContent":["import { ColorScaleItem } from '../types';\n\nconst yellow: ColorScaleItem = {\n dark: [\n '#050400',\n '#251d00',\n '#3e3300',\n '#584a00',\n '#736300',\n '#8e7d00',\n '#ab9800',\n '#c7b426',\n '#e3d142',\n '#ffef5c',\n '#fff594',\n '#fffad3',\n '#ffffff',\n ],\n darkA: [\n 'rgba(250, 200, 0, 0.02)',\n 'rgba(247, 193, 0, 0.15)',\n 'rgba(248, 204, 0, 0.25)',\n 'rgba(251, 211, 0, 0.35)',\n 'rgba(250, 215, 0, 0.46)',\n 'rgba(254, 223, 0, 0.56)',\n 'rgba(255, 227, 0, 0.67)',\n 'rgba(255, 231, 49, 0.78)',\n 'rgba(255, 235, 74, 0.89)',\n '#ffef5c',\n '#fff594',\n '#fffad3',\n '#ffffff',\n ],\n light: [\n '#ffffff',\n '#fffeff',\n '#fffcff',\n '#fffbf1',\n '#fffada',\n '#fff9c2',\n '#fff7aa',\n '#fff592',\n '#fff279',\n '#ffef5c',\n '#ab9800',\n '#584a00',\n '#050400',\n ],\n lightA: [\n 'rgba(255, 255, 255, 0.01)',\n 'rgba(255, 155, 255, 0.01)',\n 'rgba(255, 105, 255, 0.02)',\n 'rgba(255, 188, 22, 0.06)',\n 'rgba(255, 222, 8, 0.15)',\n 'rgba(255, 230, 1, 0.24)',\n 'rgba(255, 231, 5, 0.34)',\n 'rgba(255, 232, 2, 0.43)',\n 'rgba(255, 230, 2, 0.53)',\n 'rgba(255, 230, 0, 0.64)',\n '#ab9800',\n '#584a00',\n '#050400',\n ],\n};\n\nexport default yellow;\n"],"mappings":";AAEA,MAAMA,SAAyB;CAC7B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,qBAAe"}
|
|
1
|
+
{"version":3,"file":"yellow.mjs","names":["yellow: ColorScaleItem"],"sources":["../../../src/color/colors/yellow.ts"],"sourcesContent":["import type { ColorScaleItem } from '../types';\n\nconst yellow: ColorScaleItem = {\n dark: [\n '#050400',\n '#251d00',\n '#3e3300',\n '#584a00',\n '#736300',\n '#8e7d00',\n '#ab9800',\n '#c7b426',\n '#e3d142',\n '#ffef5c',\n '#fff594',\n '#fffad3',\n '#ffffff',\n ],\n darkA: [\n 'rgba(250, 200, 0, 0.02)',\n 'rgba(247, 193, 0, 0.15)',\n 'rgba(248, 204, 0, 0.25)',\n 'rgba(251, 211, 0, 0.35)',\n 'rgba(250, 215, 0, 0.46)',\n 'rgba(254, 223, 0, 0.56)',\n 'rgba(255, 227, 0, 0.67)',\n 'rgba(255, 231, 49, 0.78)',\n 'rgba(255, 235, 74, 0.89)',\n '#ffef5c',\n '#fff594',\n '#fffad3',\n '#ffffff',\n ],\n light: [\n '#ffffff',\n '#fffeff',\n '#fffcff',\n '#fffbf1',\n '#fffada',\n '#fff9c2',\n '#fff7aa',\n '#fff592',\n '#fff279',\n '#ffef5c',\n '#ab9800',\n '#584a00',\n '#050400',\n ],\n lightA: [\n 'rgba(255, 255, 255, 0.01)',\n 'rgba(255, 155, 255, 0.01)',\n 'rgba(255, 105, 255, 0.02)',\n 'rgba(255, 188, 22, 0.06)',\n 'rgba(255, 222, 8, 0.15)',\n 'rgba(255, 230, 1, 0.24)',\n 'rgba(255, 231, 5, 0.34)',\n 'rgba(255, 232, 2, 0.43)',\n 'rgba(255, 230, 2, 0.53)',\n 'rgba(255, 230, 0, 0.64)',\n '#ab9800',\n '#584a00',\n '#050400',\n ],\n};\n\nexport default yellow;\n"],"mappings":";AAEA,MAAMA,SAAyB;CAC7B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,qBAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mauve.mjs","names":["mauve: ColorScaleItem"],"sources":["../../../src/color/neutrals/mauve.ts"],"sourcesContent":["import { ColorScaleItem } from '../types';\n\nconst mauve: ColorScaleItem = {\n dark: [\n '#000000',\n '#1c1b1e',\n '#252528',\n '#2f2f32',\n '#3a393d',\n '#454448',\n '#504f53',\n '#5b5a5f',\n '#67666a',\n '#737177',\n '#7f7d83',\n '#bbb9bd',\n '#ffffff',\n ],\n darkA: [\n 'rgba(255, 255, 255, 0.02)',\n 'rgba(233, 225, 250, 0.12)',\n 'rgba(231, 231, 250, 0.16)',\n 'rgba(235, 235, 250, 0.2)',\n 'rgba(242, 237, 254, 0.24)',\n 'rgba(238, 234, 248, 0.29)',\n 'rgba(242, 239, 252, 0.33)',\n 'rgba(239, 237, 250, 0.38)',\n 'rgba(245, 243, 252, 0.42)',\n 'rgba(245, 240, 253, 0.47)',\n 'rgba(244, 240, 252, 0.52)',\n 'rgba(253, 250, 255, 0.74)',\n '#ffffff',\n ],\n light: [\n '#ffffff',\n '#fcf8fb',\n '#edeaed',\n '#dfdcdf',\n '#d1ced2',\n '#c2c0c4',\n '#b4b2b7',\n '#a7a4a9',\n '#99979c',\n '#8c8a90',\n '#7f7d83',\n '#4a494d',\n '#111',\n ],\n lightA: [\n 'rgba(0, 0, 0, 0.015)',\n 'rgba(155, 22, 122, 0.03)',\n 'rgba(55, 22, 55, 0.09)',\n 'rgba(26, 5, 26, 0.14)',\n 'rgba(25, 10, 30, 0.2)',\n 'rgba(11, 3, 19, 0.25)',\n 'rgba(13, 7, 23, 0.31)',\n 'rgba(11, 2, 16, 0.36)',\n 'rgba(6, 1, 14, 0.41)',\n 'rgba(5, 1, 14, 0.46)',\n 'rgba(4, 0, 12, 0.51)',\n 'rgba(4, 2, 8, 0.72)',\n 'rgba(3, 2, 5, 0.9)',\n ],\n};\n\nexport default mauve;\n"],"mappings":";AAEA,MAAMA,QAAwB;CAC5B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,oBAAe"}
|
|
1
|
+
{"version":3,"file":"mauve.mjs","names":["mauve: ColorScaleItem"],"sources":["../../../src/color/neutrals/mauve.ts"],"sourcesContent":["import type { ColorScaleItem } from '../types';\n\nconst mauve: ColorScaleItem = {\n dark: [\n '#000000',\n '#1c1b1e',\n '#252528',\n '#2f2f32',\n '#3a393d',\n '#454448',\n '#504f53',\n '#5b5a5f',\n '#67666a',\n '#737177',\n '#7f7d83',\n '#bbb9bd',\n '#ffffff',\n ],\n darkA: [\n 'rgba(255, 255, 255, 0.02)',\n 'rgba(233, 225, 250, 0.12)',\n 'rgba(231, 231, 250, 0.16)',\n 'rgba(235, 235, 250, 0.2)',\n 'rgba(242, 237, 254, 0.24)',\n 'rgba(238, 234, 248, 0.29)',\n 'rgba(242, 239, 252, 0.33)',\n 'rgba(239, 237, 250, 0.38)',\n 'rgba(245, 243, 252, 0.42)',\n 'rgba(245, 240, 253, 0.47)',\n 'rgba(244, 240, 252, 0.52)',\n 'rgba(253, 250, 255, 0.74)',\n '#ffffff',\n ],\n light: [\n '#ffffff',\n '#fcf8fb',\n '#edeaed',\n '#dfdcdf',\n '#d1ced2',\n '#c2c0c4',\n '#b4b2b7',\n '#a7a4a9',\n '#99979c',\n '#8c8a90',\n '#7f7d83',\n '#4a494d',\n '#111',\n ],\n lightA: [\n 'rgba(0, 0, 0, 0.015)',\n 'rgba(155, 22, 122, 0.03)',\n 'rgba(55, 22, 55, 0.09)',\n 'rgba(26, 5, 26, 0.14)',\n 'rgba(25, 10, 30, 0.2)',\n 'rgba(11, 3, 19, 0.25)',\n 'rgba(13, 7, 23, 0.31)',\n 'rgba(11, 2, 16, 0.36)',\n 'rgba(6, 1, 14, 0.41)',\n 'rgba(5, 1, 14, 0.46)',\n 'rgba(4, 0, 12, 0.51)',\n 'rgba(4, 2, 8, 0.72)',\n 'rgba(3, 2, 5, 0.9)',\n ],\n};\n\nexport default mauve;\n"],"mappings":";AAEA,MAAMA,QAAwB;CAC5B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,oBAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"olive.mjs","names":["olive: ColorScaleItem"],"sources":["../../../src/color/neutrals/olive.ts"],"sourcesContent":["import { ColorScaleItem } from '../types';\n\nconst olive: ColorScaleItem = {\n dark: [\n '#000000',\n '#1a1c1b',\n '#232624',\n '#2d302e',\n '#383a38',\n '#424542',\n '#4d504d',\n '#585c58',\n '#646763',\n '#70736e',\n '#7c7f79',\n '#b9bab5',\n '#ffffff',\n ],\n darkA: [\n 'rgba(255, 255, 255, 0.02)',\n 'rgba(236, 255, 245, 0.11)',\n 'rgba(233, 253, 240, 0.15)',\n 'rgba(237, 253, 242, 0.19)',\n 'rgba(243, 252, 243, 0.23)',\n 'rgba(236, 246, 236, 0.28)',\n 'rgba(241, 250, 241, 0.32)',\n 'rgba(238, 249, 238, 0.37)',\n 'rgba(244, 251, 241, 0.41)',\n 'rgba(243, 250, 239, 0.46)',\n 'rgba(248, 254, 242, 0.5)',\n 'rgba(253, 255, 248, 0.73)',\n '#ffffff',\n ],\n light: [\n '#ffffff',\n '#faf9f4',\n '#ecebe6',\n '#ddddd7',\n '#cfcfc9',\n '#c0c1bb',\n '#b2b4ae',\n '#a4a6a0',\n '#969993',\n '#898c86',\n '#7c7f79',\n '#484b48',\n '#111',\n ],\n lightA: [\n 'rgba(0, 0, 0, 0.015)',\n 'rgba(155, 135, 35, 0.05)',\n 'rgba(65, 55, 5, 0.1)',\n 'rgba(43, 43, 5, 0.16)',\n 'rgba(37, 37, 10, 0.22)',\n 'rgba(22, 25, 3, 0.27)',\n 'rgba(14, 21, 2, 0.32)',\n 'rgba(16, 21, 5, 0.38)',\n 'rgba(11, 18, 4, 0.43)',\n 'rgba(9, 15, 3, 0.48)',\n 'rgba(8, 13, 2, 0.53)',\n 'rgba(1, 5, 1, 0.72)',\n 'rgba(1, 3, 2, 0.9)',\n ],\n};\n\nexport default olive;\n"],"mappings":";AAEA,MAAMA,QAAwB;CAC5B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,oBAAe"}
|
|
1
|
+
{"version":3,"file":"olive.mjs","names":["olive: ColorScaleItem"],"sources":["../../../src/color/neutrals/olive.ts"],"sourcesContent":["import type { ColorScaleItem } from '../types';\n\nconst olive: ColorScaleItem = {\n dark: [\n '#000000',\n '#1a1c1b',\n '#232624',\n '#2d302e',\n '#383a38',\n '#424542',\n '#4d504d',\n '#585c58',\n '#646763',\n '#70736e',\n '#7c7f79',\n '#b9bab5',\n '#ffffff',\n ],\n darkA: [\n 'rgba(255, 255, 255, 0.02)',\n 'rgba(236, 255, 245, 0.11)',\n 'rgba(233, 253, 240, 0.15)',\n 'rgba(237, 253, 242, 0.19)',\n 'rgba(243, 252, 243, 0.23)',\n 'rgba(236, 246, 236, 0.28)',\n 'rgba(241, 250, 241, 0.32)',\n 'rgba(238, 249, 238, 0.37)',\n 'rgba(244, 251, 241, 0.41)',\n 'rgba(243, 250, 239, 0.46)',\n 'rgba(248, 254, 242, 0.5)',\n 'rgba(253, 255, 248, 0.73)',\n '#ffffff',\n ],\n light: [\n '#ffffff',\n '#faf9f4',\n '#ecebe6',\n '#ddddd7',\n '#cfcfc9',\n '#c0c1bb',\n '#b2b4ae',\n '#a4a6a0',\n '#969993',\n '#898c86',\n '#7c7f79',\n '#484b48',\n '#111',\n ],\n lightA: [\n 'rgba(0, 0, 0, 0.015)',\n 'rgba(155, 135, 35, 0.05)',\n 'rgba(65, 55, 5, 0.1)',\n 'rgba(43, 43, 5, 0.16)',\n 'rgba(37, 37, 10, 0.22)',\n 'rgba(22, 25, 3, 0.27)',\n 'rgba(14, 21, 2, 0.32)',\n 'rgba(16, 21, 5, 0.38)',\n 'rgba(11, 18, 4, 0.43)',\n 'rgba(9, 15, 3, 0.48)',\n 'rgba(8, 13, 2, 0.53)',\n 'rgba(1, 5, 1, 0.72)',\n 'rgba(1, 3, 2, 0.9)',\n ],\n};\n\nexport default olive;\n"],"mappings":";AAEA,MAAMA,QAAwB;CAC5B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,oBAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sage.mjs","names":["sage: ColorScaleItem"],"sources":["../../../src/color/neutrals/sage.ts"],"sourcesContent":["import { ColorScaleItem } from '../types';\n\nconst sage: ColorScaleItem = {\n dark: [\n '#000000',\n '#1a1b1c',\n '#232526',\n '#2d2f30',\n '#383a3a',\n '#424545',\n '#4d5050',\n '#585c5c',\n '#636766',\n '#6e7371',\n '#797f7c',\n '#b5bab6',\n '#ffffff',\n ],\n darkA: [\n 'rgba(255, 255, 255, 0.02)',\n 'rgba(236, 246, 255, 0.11)',\n 'rgba(233, 246, 253, 0.15)',\n 'rgba(237, 248, 253, 0.19)',\n 'rgba(243, 252, 252, 0.23)',\n 'rgba(236, 246, 246, 0.28)',\n 'rgba(241, 250, 250, 0.32)',\n 'rgba(238, 249, 249, 0.37)',\n 'rgba(241, 251, 248, 0.41)',\n 'rgba(239, 250, 246, 0.46)',\n 'rgba(242, 254, 248, 0.5)',\n 'rgba(248, 255, 250, 0.73)',\n 'rgba(255, 255, 255, 1)',\n ],\n light: [\n '#ffffff',\n '#f5faf4',\n '#e7ece6',\n '#d7ddd7',\n '#c9cfc9',\n '#bbc1bc',\n '#aeb4b0',\n '#a0a6a2',\n '#939996',\n '#868c89',\n '#797f7c',\n '#484b4b',\n '#111111',\n ],\n lightA: [\n 'rgba(0, 0, 0, 0.015)',\n 'rgba(55, 155, 35, 0.05)',\n 'rgba(15, 65, 5, 0.1)',\n 'rgba(5, 43, 5, 0.16)',\n 'rgba(10, 37, 10, 0.22)',\n 'rgba(3, 25, 6, 0.27)',\n 'rgba(2, 21, 9, 0.32)',\n 'rgba(5, 21, 10, 0.38)',\n 'rgba(4, 18, 11, 0.43)',\n 'rgba(3, 15, 9, 0.48)',\n 'rgba(2, 13, 7, 0.53)',\n 'rgba(1, 5, 5, 0.72)',\n 'rgba(1, 2, 3, 0.9)',\n ],\n};\n\nexport default sage;\n"],"mappings":";AAEA,MAAMA,OAAuB;CAC3B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,mBAAe"}
|
|
1
|
+
{"version":3,"file":"sage.mjs","names":["sage: ColorScaleItem"],"sources":["../../../src/color/neutrals/sage.ts"],"sourcesContent":["import type { ColorScaleItem } from '../types';\n\nconst sage: ColorScaleItem = {\n dark: [\n '#000000',\n '#1a1b1c',\n '#232526',\n '#2d2f30',\n '#383a3a',\n '#424545',\n '#4d5050',\n '#585c5c',\n '#636766',\n '#6e7371',\n '#797f7c',\n '#b5bab6',\n '#ffffff',\n ],\n darkA: [\n 'rgba(255, 255, 255, 0.02)',\n 'rgba(236, 246, 255, 0.11)',\n 'rgba(233, 246, 253, 0.15)',\n 'rgba(237, 248, 253, 0.19)',\n 'rgba(243, 252, 252, 0.23)',\n 'rgba(236, 246, 246, 0.28)',\n 'rgba(241, 250, 250, 0.32)',\n 'rgba(238, 249, 249, 0.37)',\n 'rgba(241, 251, 248, 0.41)',\n 'rgba(239, 250, 246, 0.46)',\n 'rgba(242, 254, 248, 0.5)',\n 'rgba(248, 255, 250, 0.73)',\n 'rgba(255, 255, 255, 1)',\n ],\n light: [\n '#ffffff',\n '#f5faf4',\n '#e7ece6',\n '#d7ddd7',\n '#c9cfc9',\n '#bbc1bc',\n '#aeb4b0',\n '#a0a6a2',\n '#939996',\n '#868c89',\n '#797f7c',\n '#484b4b',\n '#111111',\n ],\n lightA: [\n 'rgba(0, 0, 0, 0.015)',\n 'rgba(55, 155, 35, 0.05)',\n 'rgba(15, 65, 5, 0.1)',\n 'rgba(5, 43, 5, 0.16)',\n 'rgba(10, 37, 10, 0.22)',\n 'rgba(3, 25, 6, 0.27)',\n 'rgba(2, 21, 9, 0.32)',\n 'rgba(5, 21, 10, 0.38)',\n 'rgba(4, 18, 11, 0.43)',\n 'rgba(3, 15, 9, 0.48)',\n 'rgba(2, 13, 7, 0.53)',\n 'rgba(1, 5, 5, 0.72)',\n 'rgba(1, 2, 3, 0.9)',\n ],\n};\n\nexport default sage;\n"],"mappings":";AAEA,MAAMA,OAAuB;CAC3B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,mBAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sand.mjs","names":["sand: ColorScaleItem"],"sources":["../../../src/color/neutrals/sand.ts"],"sourcesContent":["import { ColorScaleItem } from '../types';\n\nconst sand: ColorScaleItem = {\n dark: [\n '#000000',\n '#1c1c18',\n '#262521',\n '#30302b',\n '#3a3a35',\n '#45453f',\n '#505049',\n '#5c5b54',\n '#67675f',\n '#73726a',\n '#7f7e76',\n '#bcbab2',\n '#ffffff',\n ],\n darkA: [\n 'rgba(255, 255, 255, 0.02)',\n 'rgba(255, 255, 218, 0.11)',\n 'rgba(253, 247, 220, 0.15)',\n 'rgba(253, 253, 226, 0.19)',\n 'rgba(252, 252, 230, 0.23)',\n 'rgba(246, 246, 225, 0.28)',\n 'rgba(250, 250, 228, 0.32)',\n 'rgba(249, 246, 227, 0.37)',\n 'rgba(251, 251, 232, 0.41)',\n 'rgba(250, 248, 230, 0.46)',\n 'rgba(254, 252, 236, 0.5)',\n 'rgba(254, 251, 241, 0.74)',\n 'rgba(255, 252, 245, 0.99)',\n ],\n light: [\n '#ffffff',\n '#fcf9f3',\n '#edebe4',\n '#dfddd5',\n '#d1cfc7',\n '#c3c1b9',\n '#b5b3ab',\n '#a7a69d',\n '#999890',\n '#8c8b83',\n '#7f7e76',\n '#4b4a44',\n '#111',\n ],\n lightA: [\n 'rgba(0, 0, 0, 0.015)',\n 'rgba(195, 135, 15, 0.05)',\n 'rgba(91, 73, 10, 0.11)',\n 'rgba(67, 55, 8, 0.17)',\n 'rgba(46, 37, 0, 0.22)',\n 'rgba(41, 34, 5, 0.28)',\n 'rgba(31, 25, 0, 0.33)',\n 'rgba(29, 27, 4, 0.39)',\n 'rgba(23, 21, 3, 0.44)',\n 'rgba(20, 18, 2, 0.49)',\n 'rgba(18, 16, 1, 0.54)',\n 'rgba(12, 10, 2, 0.74)',\n 'rgba(6, 6, 1, 0.91)',\n ],\n};\n\nexport default sand;\n"],"mappings":";AAEA,MAAMA,OAAuB;CAC3B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,mBAAe"}
|
|
1
|
+
{"version":3,"file":"sand.mjs","names":["sand: ColorScaleItem"],"sources":["../../../src/color/neutrals/sand.ts"],"sourcesContent":["import type { ColorScaleItem } from '../types';\n\nconst sand: ColorScaleItem = {\n dark: [\n '#000000',\n '#1c1c18',\n '#262521',\n '#30302b',\n '#3a3a35',\n '#45453f',\n '#505049',\n '#5c5b54',\n '#67675f',\n '#73726a',\n '#7f7e76',\n '#bcbab2',\n '#ffffff',\n ],\n darkA: [\n 'rgba(255, 255, 255, 0.02)',\n 'rgba(255, 255, 218, 0.11)',\n 'rgba(253, 247, 220, 0.15)',\n 'rgba(253, 253, 226, 0.19)',\n 'rgba(252, 252, 230, 0.23)',\n 'rgba(246, 246, 225, 0.28)',\n 'rgba(250, 250, 228, 0.32)',\n 'rgba(249, 246, 227, 0.37)',\n 'rgba(251, 251, 232, 0.41)',\n 'rgba(250, 248, 230, 0.46)',\n 'rgba(254, 252, 236, 0.5)',\n 'rgba(254, 251, 241, 0.74)',\n 'rgba(255, 252, 245, 0.99)',\n ],\n light: [\n '#ffffff',\n '#fcf9f3',\n '#edebe4',\n '#dfddd5',\n '#d1cfc7',\n '#c3c1b9',\n '#b5b3ab',\n '#a7a69d',\n '#999890',\n '#8c8b83',\n '#7f7e76',\n '#4b4a44',\n '#111',\n ],\n lightA: [\n 'rgba(0, 0, 0, 0.015)',\n 'rgba(195, 135, 15, 0.05)',\n 'rgba(91, 73, 10, 0.11)',\n 'rgba(67, 55, 8, 0.17)',\n 'rgba(46, 37, 0, 0.22)',\n 'rgba(41, 34, 5, 0.28)',\n 'rgba(31, 25, 0, 0.33)',\n 'rgba(29, 27, 4, 0.39)',\n 'rgba(23, 21, 3, 0.44)',\n 'rgba(20, 18, 2, 0.49)',\n 'rgba(18, 16, 1, 0.54)',\n 'rgba(12, 10, 2, 0.74)',\n 'rgba(6, 6, 1, 0.91)',\n ],\n};\n\nexport default sand;\n"],"mappings":";AAEA,MAAMA,OAAuB;CAC3B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,mBAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slate.mjs","names":["slate: ColorScaleItem"],"sources":["../../../src/color/neutrals/slate.ts"],"sourcesContent":["import { ColorScaleItem } from '../types';\n\nconst slate: ColorScaleItem = {\n dark: [\n '#000000',\n '#1b1c1d',\n '#242527',\n '#2e2f32',\n '#383a3c',\n '#434547',\n '#4e5052',\n '#595b5e',\n '#64676a',\n '#707276',\n '#7b7e82',\n '#b8babc',\n '#ffffff',\n ],\n darkA: [\n 'rgba(255, 255, 255, 0.02)',\n 'rgba(225, 233, 242, 0.12)',\n 'rgba(225, 231, 244, 0.16)',\n 'rgba(230, 235, 250, 0.2)',\n 'rgba(233, 242, 250, 0.24)',\n 'rgba(239, 246, 254, 0.28)',\n 'rgba(236, 242, 248, 0.33)',\n 'rgba(241, 246, 254, 0.37)',\n 'rgba(238, 245, 252, 0.42)',\n 'rgba(238, 243, 251, 0.47)',\n 'rgba(241, 247, 255, 0.51)',\n 'rgba(249, 251, 254, 0.74)',\n '#ffffff',\n ],\n light: [\n '#ffffff',\n '#f9f9fa',\n '#ebebec',\n '#dcddde',\n '#cecfd0',\n '#bfc1c3',\n '#b1b3b5',\n '#a4a6a8',\n '#96989b',\n '#898b8e',\n '#7b7e82',\n '#484a4d',\n '#111',\n ],\n lightA: [\n 'rgba(0, 0, 0, 0.015)',\n 'rgba(55, 55, 88, 0.03)',\n 'rgba(5, 5, 17, 0.08)',\n 'rgba(5, 12, 19, 0.14)',\n 'rgba(10, 15, 20, 0.2)',\n 'rgba(9, 17, 24, 0.26)',\n 'rgba(3, 10, 16, 0.31)',\n 'rgba(2, 8, 13, 0.36)',\n 'rgba(5, 10, 17, 0.42)',\n 'rgba(4, 8, 15, 0.47)',\n 'rgba(1, 7, 15, 0.52)',\n 'rgba(1, 4, 8, 0.72)',\n 'rgba(2, 3, 4, 0.9)',\n ],\n};\n\nexport default slate;\n"],"mappings":";AAEA,MAAMA,QAAwB;CAC5B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,oBAAe"}
|
|
1
|
+
{"version":3,"file":"slate.mjs","names":["slate: ColorScaleItem"],"sources":["../../../src/color/neutrals/slate.ts"],"sourcesContent":["import type { ColorScaleItem } from '../types';\n\nconst slate: ColorScaleItem = {\n dark: [\n '#000000',\n '#1b1c1d',\n '#242527',\n '#2e2f32',\n '#383a3c',\n '#434547',\n '#4e5052',\n '#595b5e',\n '#64676a',\n '#707276',\n '#7b7e82',\n '#b8babc',\n '#ffffff',\n ],\n darkA: [\n 'rgba(255, 255, 255, 0.02)',\n 'rgba(225, 233, 242, 0.12)',\n 'rgba(225, 231, 244, 0.16)',\n 'rgba(230, 235, 250, 0.2)',\n 'rgba(233, 242, 250, 0.24)',\n 'rgba(239, 246, 254, 0.28)',\n 'rgba(236, 242, 248, 0.33)',\n 'rgba(241, 246, 254, 0.37)',\n 'rgba(238, 245, 252, 0.42)',\n 'rgba(238, 243, 251, 0.47)',\n 'rgba(241, 247, 255, 0.51)',\n 'rgba(249, 251, 254, 0.74)',\n '#ffffff',\n ],\n light: [\n '#ffffff',\n '#f9f9fa',\n '#ebebec',\n '#dcddde',\n '#cecfd0',\n '#bfc1c3',\n '#b1b3b5',\n '#a4a6a8',\n '#96989b',\n '#898b8e',\n '#7b7e82',\n '#484a4d',\n '#111',\n ],\n lightA: [\n 'rgba(0, 0, 0, 0.015)',\n 'rgba(55, 55, 88, 0.03)',\n 'rgba(5, 5, 17, 0.08)',\n 'rgba(5, 12, 19, 0.14)',\n 'rgba(10, 15, 20, 0.2)',\n 'rgba(9, 17, 24, 0.26)',\n 'rgba(3, 10, 16, 0.31)',\n 'rgba(2, 8, 13, 0.36)',\n 'rgba(5, 10, 17, 0.42)',\n 'rgba(4, 8, 15, 0.47)',\n 'rgba(1, 7, 15, 0.52)',\n 'rgba(1, 4, 8, 0.72)',\n 'rgba(2, 3, 4, 0.9)',\n ],\n};\n\nexport default slate;\n"],"mappings":";AAEA,MAAMA,QAAwB;CAC5B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF;AAED,oBAAe"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { createContext,
|
|
3
|
+
import { createContext, use } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/hooks/useFloatingLayer.tsx
|
|
6
6
|
/**
|
|
@@ -15,7 +15,7 @@ const FloatingLayerContext = createContext(null);
|
|
|
15
15
|
* Returns the nearest floating layer container from context, or null if none exists.
|
|
16
16
|
*/
|
|
17
17
|
const useFloatingLayer = () => {
|
|
18
|
-
return
|
|
18
|
+
return use(FloatingLayerContext);
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* Provider component for floating layer context.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFloatingLayer.mjs","names":[],"sources":["../../src/hooks/useFloatingLayer.tsx"],"sourcesContent":["'use client';\n\nimport { createContext,
|
|
1
|
+
{"version":3,"file":"useFloatingLayer.mjs","names":[],"sources":["../../src/hooks/useFloatingLayer.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, use } from 'react';\n\n/**\n * Context for managing floating layer stacking.\n * When a component like Popover opens, it can provide its container\n * so that nested floating elements (like Tooltip) can render into it,\n * avoiding z-index stacking context issues.\n */\nexport const FloatingLayerContext = createContext<HTMLElement | null>(null);\n\n/**\n * Hook to get the current floating layer container.\n * Returns the nearest floating layer container from context, or null if none exists.\n */\nexport const useFloatingLayer = (): HTMLElement | null => {\n return use(FloatingLayerContext);\n};\n\n/**\n * Provider component for floating layer context.\n */\nexport const FloatingLayerProvider = FloatingLayerContext.Provider;\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,uBAAuB,cAAkC,KAAK;;;;;AAM3E,MAAa,yBAA6C;AACxD,QAAO,IAAI,qBAAqB;;;;;AAMlC,MAAa,wBAAwB,qBAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHighlight.mjs","names":["codeToHtmlPromise: Promise<ICodeToHtml | null> | null","lobeTheme"],"sources":["../../src/hooks/useHighlight.ts"],"sourcesContent":["'use client';\n\nimport {\n transformerNotationDiff,\n transformerNotationErrorLevel,\n transformerNotationFocus,\n transformerNotationHighlight,\n transformerNotationWordHighlight,\n} from '@shikijs/transformers';\nimport { CSSProperties, useEffect, useMemo, useState } from 'react';\nimport type { BuiltinTheme, CodeToHastOptions, ThemedToken } from 'shiki';\nimport { Md5 } from 'ts-md5';\n\nimport { getCodeLanguageByInput } from '@/Highlighter/const';\nimport lobeTheme from '@/Highlighter/theme/lobe-theme';\n\n// Application-level cache to avoid repeated calculations\nexport const MD5_LENGTH_THRESHOLD = 10_000; // Use async MD5 for text exceeding this length\n\nexport type StreamingHighlightResult = {\n lines: ThemedToken[][];\n preStyle?: CSSProperties;\n};\n\n// Application-level cache for highlighted HTML\n// Key: cacheKey string, Value: Promise<string>\nconst highlightCache = new Map<string, Promise<string>>();\n\n// Maximum cache size to prevent memory leaks\nconst MAX_CACHE_SIZE = 1000;\n\n// Clean up old cache entries when limit is reached\nconst cleanupCache = () => {\n if (highlightCache.size > MAX_CACHE_SIZE) {\n // Remove oldest 20% of entries\n const entriesToRemove = Math.floor(MAX_CACHE_SIZE * 0.2);\n const keysToRemove = Array.from(highlightCache.keys()).slice(0, entriesToRemove);\n for (const key of keysToRemove) {\n highlightCache.delete(key);\n }\n }\n};\n\nexport type ICodeToHtml = (code: string, options: CodeToHastOptions) => Promise<string>;\nexport type ShikiModule = typeof import('shiki');\n\n// Use codeToHtml shorthand for better performance\n// It automatically manages highlighter instances and loads themes/languages on-demand\nlet codeToHtmlPromise: Promise<ICodeToHtml | null> | null = null;\n\nconst loadCodeToHtml = (): Promise<ICodeToHtml | null> => {\n if (typeof window === 'undefined') return Promise.resolve(null);\n\n if (!codeToHtmlPromise) {\n codeToHtmlPromise = import('shiki').then((mod) => mod.codeToHtml ?? null);\n }\n\n return codeToHtmlPromise;\n};\n\n// Export shikiModulePromise for useStreamHighlight compatibility\nconst loadShikiModule = (): Promise<ShikiModule | null> => {\n if (typeof window === 'undefined') return Promise.resolve(null);\n return import('shiki');\n};\nexport const shikiModulePromise = loadShikiModule();\n\n// Helper function: Safe HTML escaping\nexport const escapeHtml = (str: string): string => {\n return str\n .replaceAll('&', '&')\n .replaceAll('<', '<')\n .replaceAll('>', '>')\n .replaceAll('\"', '"')\n .replaceAll(\"'\", ''');\n};\n\n// Main highlight component - optimized version without SWR\nconst customThemes = {\n 'lobe-theme': lobeTheme,\n};\n\nexport const useHighlight = (\n text: string,\n {\n language,\n enableTransformer,\n theme: builtinTheme,\n streaming,\n }: { enableTransformer?: boolean; language: string; streaming?: boolean; theme?: BuiltinTheme },\n): string => {\n // Safely handle language and text with boundary checks\n const safeText = text ?? '';\n const lang = (language ?? 'plaintext').toLowerCase();\n\n // Match supported languages\n const matchedLanguage = useMemo(() => getCodeLanguageByInput(lang), [lang]);\n\n // Optimize transformer creation\n const transformers = useMemo(() => {\n if (!enableTransformer) return;\n return [\n transformerNotationDiff(),\n transformerNotationHighlight(),\n transformerNotationWordHighlight(),\n transformerNotationFocus(),\n transformerNotationErrorLevel(),\n ];\n }, [enableTransformer]);\n\n // Build cache key\n const cacheKey = useMemo((): string | null => {\n if (streaming) return null;\n // Use hash for long text\n const hash = safeText.length < MD5_LENGTH_THRESHOLD ? safeText : Md5.hashStr(safeText);\n return [matchedLanguage, builtinTheme, hash].filter(Boolean).join('-');\n }, [safeText, matchedLanguage, builtinTheme, streaming]);\n\n const [data, setData] = useState<string | undefined>();\n\n useEffect(() => {\n if (!cacheKey) {\n setData(undefined);\n return;\n }\n\n // Check cache first\n const cachedPromise = highlightCache.get(cacheKey);\n if (cachedPromise) {\n cachedPromise\n .then((html) => {\n setData(html);\n })\n .catch(() => {\n // Silently handle errors, fallback will be handled in the promise\n });\n return;\n }\n\n // Create new promise for highlighting\n // Using codeToHtml shorthand: automatically loads themes/languages on-demand\n const highlightPromise = (async (): Promise<string> => {\n try {\n // Try full rendering with transformers\n const shikiModule = await shikiModulePromise;\n if (!shikiModule) return safeText;\n\n const effectiveTheme = builtinTheme || 'lobe-theme';\n\n // Load custom theme if using slack-dark or slack-ochin\n if (!builtinTheme && effectiveTheme === 'lobe-theme') {\n const customTheme = customThemes[effectiveTheme];\n if (customTheme) {\n // Use getSingletonHighlighter to load custom theme\n const highlighter = await shikiModule.getSingletonHighlighter({\n langs: [matchedLanguage],\n themes: [customTheme as any],\n });\n\n const html = await highlighter.codeToHtml(safeText, {\n lang: matchedLanguage,\n theme: effectiveTheme,\n transformers,\n });\n\n return html;\n }\n }\n\n // Fallback to codeToHtml for builtin themes\n const codeToHtml = await loadCodeToHtml();\n if (!codeToHtml) return safeText;\n\n const html = await codeToHtml(safeText, {\n lang: matchedLanguage,\n theme: effectiveTheme,\n transformers,\n });\n\n return html;\n } catch (error_) {\n console.error('Advanced rendering failed:', error_);\n\n try {\n // Try simple rendering (without transformers)\n const codeToHtml = await loadCodeToHtml();\n if (!codeToHtml) return safeText;\n const html = await codeToHtml(safeText, {\n lang: matchedLanguage,\n theme: 'lobe-theme',\n });\n return html;\n } catch {\n // Fallback to plain text\n const fallbackHtml = `<pre class=\"fallback\"><code>${escapeHtml(safeText)}</code></pre>`;\n return fallbackHtml;\n }\n }\n })();\n\n // Cache the promise\n highlightCache.set(cacheKey, highlightPromise);\n cleanupCache();\n\n // Handle promise result\n highlightPromise\n .then((html) => {\n // Only update if this is still the current cache key\n if (highlightCache.get(cacheKey) === highlightPromise) {\n setData(html);\n }\n })\n .catch(() => {\n // Remove failed promise from cache\n if (highlightCache.get(cacheKey) === highlightPromise) {\n highlightCache.delete(cacheKey);\n }\n });\n }, [cacheKey, safeText, matchedLanguage, builtinTheme, transformers, customThemes]);\n\n return data || '';\n};\n"],"mappings":";;;;;;;;;AAiBA,MAAa,uBAAuB;AASpC,MAAM,iCAAiB,IAAI,KAA8B;AAGzD,MAAM,iBAAiB;AAGvB,MAAM,qBAAqB;AACzB,KAAI,eAAe,OAAO,gBAAgB;EAExC,MAAM,kBAAkB,KAAK,MAAM,iBAAiB,GAAI;EACxD,MAAM,eAAe,MAAM,KAAK,eAAe,MAAM,CAAC,CAAC,MAAM,GAAG,gBAAgB;AAChF,OAAK,MAAM,OAAO,aAChB,gBAAe,OAAO,IAAI;;;AAUhC,IAAIA,oBAAwD;AAE5D,MAAM,uBAAoD;AACxD,KAAI,OAAO,WAAW,YAAa,QAAO,QAAQ,QAAQ,KAAK;AAE/D,KAAI,CAAC,kBACH,qBAAoB,OAAO,SAAS,MAAM,QAAQ,IAAI,cAAc,KAAK;AAG3E,QAAO;;AAIT,MAAM,wBAAqD;AACzD,KAAI,OAAO,WAAW,YAAa,QAAO,QAAQ,QAAQ,KAAK;AAC/D,QAAO,OAAO;;AAEhB,MAAa,qBAAqB,iBAAiB;AAGnD,MAAa,cAAc,QAAwB;AACjD,QAAO,IACJ,WAAW,KAAK,QAAQ,CACxB,WAAW,KAAK,OAAO,CACvB,WAAW,KAAK,OAAO,CACvB,WAAW,MAAK,SAAS,CACzB,WAAW,KAAK,SAAS;;AAI9B,MAAM,eAAe,EACnB,cAAcC,o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QxB,WANa,MAAM,WAAW,UAAU;KACtC,MAAM;KACN,OAAO;KACP;KACD,CAAC;YAGK,QAAQ;AACf,YAAQ,MAAM,8BAA8B,OAAO;AAEnD,QAAI;KAEF,MAAM,aAAa,MAAM,gBAAgB;AACzC,SAAI,CAAC,WAAY,QAAO;AAKxB,YAJa,MAAM,WAAW,UAAU;MACtC,MAAM;MACN,OAAO;MACR,CAAC;YAEI;AAGN,YADqB,+BAA+B,WAAW,SAAS,CAAC;;;MAI3E;AAGJ,iBAAe,IAAI,UAAU,iBAAiB;AAC9C,gBAAc;AAGd,mBACG,MAAM,SAAS;AAEd,OAAI,eAAe,IAAI,SAAS,KAAK,iBACnC,SAAQ,KAAK;IAEf,CACD,YAAY;AAEX,OAAI,eAAe,IAAI,SAAS,KAAK,iBACnC,gBAAe,OAAO,SAAS;IAEjC;IACH;EAAC;EAAU;EAAU;EAAiB;EAAc;EAAc;EAAa,CAAC;AAEnF,QAAO,QAAQ"}
|
|
1
|
+
{"version":3,"file":"useHighlight.mjs","names":["codeToHtmlPromise: Promise<ICodeToHtml | null> | null","lobeTheme"],"sources":["../../src/hooks/useHighlight.ts"],"sourcesContent":["'use client';\n\nimport {\n transformerNotationDiff,\n transformerNotationErrorLevel,\n transformerNotationFocus,\n transformerNotationHighlight,\n transformerNotationWordHighlight,\n} from '@shikijs/transformers';\nimport { type CSSProperties, useEffect, useMemo, useState } from 'react';\nimport type { BuiltinTheme, CodeToHastOptions, ThemedToken } from 'shiki';\nimport { Md5 } from 'ts-md5';\n\nimport { getCodeLanguageByInput } from '@/Highlighter/const';\nimport lobeTheme from '@/Highlighter/theme/lobe-theme';\n\n// Application-level cache to avoid repeated calculations\nexport const MD5_LENGTH_THRESHOLD = 10_000; // Use async MD5 for text exceeding this length\n\nexport type StreamingHighlightResult = {\n lines: ThemedToken[][];\n preStyle?: CSSProperties;\n};\n\n// Application-level cache for highlighted HTML\n// Key: cacheKey string, Value: Promise<string>\nconst highlightCache = new Map<string, Promise<string>>();\n\n// Maximum cache size to prevent memory leaks\nconst MAX_CACHE_SIZE = 1000;\n\n// Clean up old cache entries when limit is reached\nconst cleanupCache = () => {\n if (highlightCache.size > MAX_CACHE_SIZE) {\n // Remove oldest 20% of entries\n const entriesToRemove = Math.floor(MAX_CACHE_SIZE * 0.2);\n const keysToRemove = Array.from(highlightCache.keys()).slice(0, entriesToRemove);\n for (const key of keysToRemove) {\n highlightCache.delete(key);\n }\n }\n};\n\nexport type ICodeToHtml = (code: string, options: CodeToHastOptions) => Promise<string>;\nexport type ShikiModule = typeof import('shiki');\n\n// Use codeToHtml shorthand for better performance\n// It automatically manages highlighter instances and loads themes/languages on-demand\nlet codeToHtmlPromise: Promise<ICodeToHtml | null> | null = null;\n\nconst loadCodeToHtml = (): Promise<ICodeToHtml | null> => {\n if (typeof window === 'undefined') return Promise.resolve(null);\n\n if (!codeToHtmlPromise) {\n codeToHtmlPromise = import('shiki').then((mod) => mod.codeToHtml ?? null);\n }\n\n return codeToHtmlPromise;\n};\n\n// Export shikiModulePromise for useStreamHighlight compatibility\nconst loadShikiModule = (): Promise<ShikiModule | null> => {\n if (typeof window === 'undefined') return Promise.resolve(null);\n return import('shiki');\n};\nexport const shikiModulePromise = loadShikiModule();\n\n// Helper function: Safe HTML escaping\nexport const escapeHtml = (str: string): string => {\n return str\n .replaceAll('&', '&')\n .replaceAll('<', '<')\n .replaceAll('>', '>')\n .replaceAll('\"', '"')\n .replaceAll(\"'\", ''');\n};\n\n// Main highlight component - optimized version without SWR\nconst customThemes = {\n 'lobe-theme': lobeTheme,\n};\n\nexport const useHighlight = (\n text: string,\n {\n language,\n enableTransformer,\n theme: builtinTheme,\n streaming,\n }: { enableTransformer?: boolean; language: string; streaming?: boolean; theme?: BuiltinTheme },\n): string => {\n // Safely handle language and text with boundary checks\n const safeText = text ?? '';\n const lang = (language ?? 'plaintext').toLowerCase();\n\n // Match supported languages\n const matchedLanguage = useMemo(() => getCodeLanguageByInput(lang), [lang]);\n\n // Optimize transformer creation\n const transformers = useMemo(() => {\n if (!enableTransformer) return;\n return [\n transformerNotationDiff(),\n transformerNotationHighlight(),\n transformerNotationWordHighlight(),\n transformerNotationFocus(),\n transformerNotationErrorLevel(),\n ];\n }, [enableTransformer]);\n\n // Build cache key\n const cacheKey = useMemo((): string | null => {\n if (streaming) return null;\n // Use hash for long text\n const hash = safeText.length < MD5_LENGTH_THRESHOLD ? safeText : Md5.hashStr(safeText);\n return [matchedLanguage, builtinTheme, hash].filter(Boolean).join('-');\n }, [safeText, matchedLanguage, builtinTheme, streaming]);\n\n const [data, setData] = useState<string | undefined>();\n\n useEffect(() => {\n if (!cacheKey) {\n setData(undefined);\n return;\n }\n\n // Check cache first\n const cachedPromise = highlightCache.get(cacheKey);\n if (cachedPromise) {\n cachedPromise\n .then((html) => {\n setData(html);\n })\n .catch(() => {\n // Silently handle errors, fallback will be handled in the promise\n });\n return;\n }\n\n // Create new promise for highlighting\n // Using codeToHtml shorthand: automatically loads themes/languages on-demand\n const highlightPromise = (async (): Promise<string> => {\n try {\n // Try full rendering with transformers\n const shikiModule = await shikiModulePromise;\n if (!shikiModule) return safeText;\n\n const effectiveTheme = builtinTheme || 'lobe-theme';\n\n // Load custom theme if using slack-dark or slack-ochin\n if (!builtinTheme && effectiveTheme === 'lobe-theme') {\n const customTheme = customThemes[effectiveTheme];\n if (customTheme) {\n // Use getSingletonHighlighter to load custom theme\n const highlighter = await shikiModule.getSingletonHighlighter({\n langs: [matchedLanguage],\n themes: [customTheme as any],\n });\n\n const html = await highlighter.codeToHtml(safeText, {\n lang: matchedLanguage,\n theme: effectiveTheme,\n transformers,\n });\n\n return html;\n }\n }\n\n // Fallback to codeToHtml for builtin themes\n const codeToHtml = await loadCodeToHtml();\n if (!codeToHtml) return safeText;\n\n const html = await codeToHtml(safeText, {\n lang: matchedLanguage,\n theme: effectiveTheme,\n transformers,\n });\n\n return html;\n } catch (error_) {\n console.error('Advanced rendering failed:', error_);\n\n try {\n // Try simple rendering (without transformers)\n const codeToHtml = await loadCodeToHtml();\n if (!codeToHtml) return safeText;\n const html = await codeToHtml(safeText, {\n lang: matchedLanguage,\n theme: 'lobe-theme',\n });\n return html;\n } catch {\n // Fallback to plain text\n const fallbackHtml = `<pre class=\"fallback\"><code>${escapeHtml(safeText)}</code></pre>`;\n return fallbackHtml;\n }\n }\n })();\n\n // Cache the promise\n highlightCache.set(cacheKey, highlightPromise);\n cleanupCache();\n\n // Handle promise result\n highlightPromise\n .then((html) => {\n // Only update if this is still the current cache key\n if (highlightCache.get(cacheKey) === highlightPromise) {\n setData(html);\n }\n })\n .catch(() => {\n // Remove failed promise from cache\n if (highlightCache.get(cacheKey) === highlightPromise) {\n highlightCache.delete(cacheKey);\n }\n });\n }, [cacheKey, safeText, matchedLanguage, builtinTheme, transformers, customThemes]);\n\n return data || '';\n};\n"],"mappings":";;;;;;;;;AAiBA,MAAa,uBAAuB;AASpC,MAAM,iCAAiB,IAAI,KAA8B;AAGzD,MAAM,iBAAiB;AAGvB,MAAM,qBAAqB;AACzB,KAAI,eAAe,OAAO,gBAAgB;EAExC,MAAM,kBAAkB,KAAK,MAAM,iBAAiB,GAAI;EACxD,MAAM,eAAe,MAAM,KAAK,eAAe,MAAM,CAAC,CAAC,MAAM,GAAG,gBAAgB;AAChF,OAAK,MAAM,OAAO,aAChB,gBAAe,OAAO,IAAI;;;AAUhC,IAAIA,oBAAwD;AAE5D,MAAM,uBAAoD;AACxD,KAAI,OAAO,WAAW,YAAa,QAAO,QAAQ,QAAQ,KAAK;AAE/D,KAAI,CAAC,kBACH,qBAAoB,OAAO,SAAS,MAAM,QAAQ,IAAI,cAAc,KAAK;AAG3E,QAAO;;AAIT,MAAM,wBAAqD;AACzD,KAAI,OAAO,WAAW,YAAa,QAAO,QAAQ,QAAQ,KAAK;AAC/D,QAAO,OAAO;;AAEhB,MAAa,qBAAqB,iBAAiB;AAGnD,MAAa,cAAc,QAAwB;AACjD,QAAO,IACJ,WAAW,KAAK,QAAQ,CACxB,WAAW,K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B,WAAW,UAAU;MAClD,MAAM;MACN,OAAO;MACP;MACD,CAAC;;IAON,MAAM,aAAa,MAAM,gBAAgB;AACzC,QAAI,CAAC,WAAY,QAAO;AAQxB,WANa,MAAM,WAAW,UAAU;KACtC,MAAM;KACN,OAAO;KACP;KACD,CAAC;YAGK,QAAQ;AACf,YAAQ,MAAM,8BAA8B,OAAO;AAEnD,QAAI;KAEF,MAAM,aAAa,MAAM,gBAAgB;AACzC,SAAI,CAAC,WAAY,QAAO;AAKxB,YAJa,MAAM,WAAW,UAAU;MACtC,MAAM;MACN,OAAO;MACR,CAAC;YAEI;AAGN,YADqB,+BAA+B,WAAW,SAAS,CAAC;;;MAI3E;AAGJ,iBAAe,IAAI,UAAU,iBAAiB;AAC9C,gBAAc;AAGd,mBACG,MAAM,SAAS;AAEd,OAAI,eAAe,IAAI,SAAS,KAAK,iBACnC,SAAQ,KAAK;IAEf,CACD,YAAY;AAEX,OAAI,eAAe,IAAI,SAAS,KAAK,iBACnC,gBAAe,OAAO,SAAS;IAEjC;IACH;EAAC;EAAU;EAAU;EAAiB;EAAc;EAAc;EAAa,CAAC;AAEnF,QAAO,QAAQ"}
|
|
@@ -34,7 +34,7 @@ const replaceUnescapedPipes = (formula) => formula.replaceAll(/(?<!\\)\|/g, "\\v
|
|
|
34
34
|
* @returns The string with LaTeX bracket delimiters converted to dollar sign delimiters
|
|
35
35
|
*/
|
|
36
36
|
function convertLatexDelimiters(text) {
|
|
37
|
-
return text.replaceAll(/(```[\S
|
|
37
|
+
return text.replaceAll(/(```[\s\S]*?```|`.*?`)|\\\[([\s\S]*?[^\\])\\\]|\\\((.*?)\\\)/g, (match, codeBlock, squareBracket, roundBracket) => {
|
|
38
38
|
if (codeBlock !== void 0) return codeBlock;
|
|
39
39
|
else if (squareBracket !== void 0) return `$$${squareBracket}$$`;
|
|
40
40
|
else if (roundBracket !== void 0) return `$${roundBracket}$`;
|
|
@@ -59,14 +59,14 @@ function escapeMhchemCommands(text) {
|
|
|
59
59
|
*/
|
|
60
60
|
function escapeLatexPipes(text) {
|
|
61
61
|
const codeBlocks = [];
|
|
62
|
-
let content = text.replaceAll(/(```[\S
|
|
62
|
+
let content = text.replaceAll(/(```[\s\S]*?```|`[^\n`]*`)/g, (match) => {
|
|
63
63
|
codeBlocks.push(match);
|
|
64
64
|
return `<<CODE_${codeBlocks.length - 1}>>`;
|
|
65
65
|
});
|
|
66
|
-
content = content.replaceAll(/\$\$([\S
|
|
66
|
+
content = content.replaceAll(/\$\$([\s\S]*?)\$\$/g, (match, display) => {
|
|
67
67
|
return `$$${replaceUnescapedPipes(display)}$$`;
|
|
68
68
|
});
|
|
69
|
-
content = content.replaceAll(/(?<!\\)\$(?!\$)([^\n$]
|
|
69
|
+
content = content.replaceAll(/(?<!\\)\$(?!\$)([^\n$]*)(?<!\\)\$(?!\$)/g, (match, inline) => {
|
|
70
70
|
return `$${replaceUnescapedPipes(inline)}$`;
|
|
71
71
|
});
|
|
72
72
|
content = content.replaceAll(/<<CODE_(\d+)>>/g, (_, index) => {
|
|
@@ -84,7 +84,7 @@ function escapeLatexPipes(text) {
|
|
|
84
84
|
* @returns The string with unescaped underscores escaped within \text{...} commands
|
|
85
85
|
*/
|
|
86
86
|
function escapeTextUnderscores(text) {
|
|
87
|
-
return text.replaceAll(/\\text{([^}]*)}/g, (match, textContent) => {
|
|
87
|
+
return text.replaceAll(/\\text\{([^}]*)\}/g, (match, textContent) => {
|
|
88
88
|
return `\\text{${textContent.replaceAll(/(?<!\\)_/g, "\\_")}}`;
|
|
89
89
|
});
|
|
90
90
|
}
|
|
@@ -102,7 +102,7 @@ function escapeTextUnderscores(text) {
|
|
|
102
102
|
*/
|
|
103
103
|
function escapeCurrencyDollars(text) {
|
|
104
104
|
const manager = new PlaceholderManager("PROTECTED");
|
|
105
|
-
let content = text.replaceAll(/(```[\S
|
|
105
|
+
let content = text.replaceAll(/(```[\s\S]*?```|`[^\n`]*`|\$\$[\s\S]*?\$\$|(?<!\\)\$(?!\$)(?=[\s\S]*?\\)[\s\S]*?(?<!\\)\$(?!\$)|\$\d+\$|\$-?\d+(?:,-?\d+)+\$|\\\[[\s\S]*?\\\]|\\\(.*?\\\))/g, (match) => manager.add(match));
|
|
106
106
|
content = content.replaceAll(/(?<!\$)\$(\d{1,3}(?:,\d{3})*(?:\.\d+)?(?:-\d{1,3}(?:,\d{3})*(?:\.\d+)?)?\+?)(?!\$)/g, "\\$$$1");
|
|
107
107
|
content = manager.restore(content);
|
|
108
108
|
return content;
|
|
@@ -115,7 +115,7 @@ function escapeCurrencyDollars(text) {
|
|
|
115
115
|
*/
|
|
116
116
|
const extractIncompleteFormula = (text) => {
|
|
117
117
|
if ((text.match(/\$\$/g) || []).length % 2 === 1) {
|
|
118
|
-
const match = text.match(/\$\$([
|
|
118
|
+
const match = text.match(/\$\$([\s\S]*)$/);
|
|
119
119
|
return match ? match[1] : "";
|
|
120
120
|
}
|
|
121
121
|
return "";
|
|
@@ -150,10 +150,10 @@ const isLastFormulaRenderable = (text) => {
|
|
|
150
150
|
* @returns The string with fixed LaTeX expressions
|
|
151
151
|
*/
|
|
152
152
|
function fixCommonLaTeXErrors(text) {
|
|
153
|
-
return text.replaceAll(/(\$\$[\S
|
|
153
|
+
return text.replaceAll(/(\$\$[\s\S]*?\$\$|\$[\s\S]*?\$)/g, (match) => {
|
|
154
154
|
let fixed = match;
|
|
155
|
-
const openBraces = (fixed.match(/(?<!\\){/g) || []).length;
|
|
156
|
-
const closeBraces = (fixed.match(/(?<!\\)}/g) || []).length;
|
|
155
|
+
const openBraces = (fixed.match(/(?<!\\)\{/g) || []).length;
|
|
156
|
+
const closeBraces = (fixed.match(/(?<!\\)\}/g) || []).length;
|
|
157
157
|
if (openBraces > closeBraces) {
|
|
158
158
|
const diff = openBraces - closeBraces;
|
|
159
159
|
const closingBraces = "}".repeat(diff);
|
|
@@ -183,7 +183,7 @@ function normalizeLatexSpacing(text) {
|
|
|
183
183
|
result = result.replaceAll(/\s+\$/g, "$");
|
|
184
184
|
result = result.replaceAll(/\$\$\s+/g, "$$");
|
|
185
185
|
result = result.replaceAll(/\s+\$\$/g, "$$");
|
|
186
|
-
result = result.replaceAll(/(\$\$[\S
|
|
186
|
+
result = result.replaceAll(/(\$\$[\s\S]*?\$\$|\$[\s\S]*?\$)/g, (match) => {
|
|
187
187
|
return match.replaceAll(/\s{2,}/g, " ");
|
|
188
188
|
});
|
|
189
189
|
return result;
|
|
@@ -198,7 +198,7 @@ function normalizeLatexSpacing(text) {
|
|
|
198
198
|
function validateLatexExpressions(text) {
|
|
199
199
|
const errors = [];
|
|
200
200
|
let totalExpressions = 0;
|
|
201
|
-
const pattern = /\$\$([\S
|
|
201
|
+
const pattern = /\$\$([\s\S]*?)\$\$|(?<!\\)\$(?!\$)([\s\S]*?)(?<!\\)\$(?!\$)/g;
|
|
202
202
|
let match;
|
|
203
203
|
while ((match = pattern.exec(text)) !== null) {
|
|
204
204
|
totalExpressions++;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"latex.mjs","names":["codeBlocks: string[]","errors: Array<{\n formula: string;\n message: string;\n position: number;\n type: 'display' | 'inline';\n }>"],"sources":["../../../src/hooks/useMarkdown/latex.ts"],"sourcesContent":["import { renderToString } from 'katex';\n\n// ============================================================================\n// Utility Classes\n// ============================================================================\n\n/**\n * PlaceholderManager - Manages temporary replacement and restoration of protected content\n * Used to protect code blocks and LaTeX expressions during preprocessing\n */\nclass PlaceholderManager {\n private placeholders: string[] = [];\n private prefix: string;\n\n constructor(prefix = 'PROTECTED') {\n this.prefix = prefix;\n }\n\n add(content: string): string {\n const index = this.placeholders.length;\n this.placeholders.push(content);\n return `<<${this.prefix}_${index}>>`;\n }\n\n restore(text: string): string {\n return text.replaceAll(new RegExp(`<<${this.prefix}_(\\\\d+)>>`, 'g'), (_, index) => {\n return this.placeholders[Number.parseInt(index)] || '';\n });\n }\n\n clear(): void {\n this.placeholders = [];\n }\n}\n\n// ============================================================================\n// Helper Functions\n// ============================================================================\n\n// Helper: replace unescaped pipes with \\vert within a LaTeX math fragment\nconst replaceUnescapedPipes = (formula: string): string =>\n // Use \\vert{} so the control sequence terminates before the next token\n formula.replaceAll(/(?<!\\\\)\\|/g, '\\\\vert{}');\n\n/**\n * Converts LaTeX bracket delimiters to dollar sign delimiters.\n * Converts \\[...\\] to $$...$$ and \\(...\\) to $...$\n * Preserves code blocks during the conversion.\n *\n * @param text The input string containing LaTeX expressions\n * @returns The string with LaTeX bracket delimiters converted to dollar sign delimiters\n */\nexport function convertLatexDelimiters(text: string): string {\n const pattern = /(```[\\S\\s]*?```|`.*?`)|\\\\\\[([\\S\\s]*?[^\\\\])\\\\]|\\\\\\((.*?)\\\\\\)/g;\n return text.replaceAll(\n pattern,\n (\n match: string,\n codeBlock: string | undefined,\n squareBracket: string | undefined,\n roundBracket: string | undefined,\n ): string => {\n if (codeBlock !== undefined) {\n return codeBlock;\n } else if (squareBracket !== undefined) {\n return `$$${squareBracket}$$`;\n } else if (roundBracket !== undefined) {\n return `$${roundBracket}$`;\n }\n return match;\n },\n );\n}\n\n/**\n * Escapes mhchem commands in LaTeX expressions to ensure proper rendering.\n *\n * @param text The input string containing LaTeX expressions with mhchem commands\n * @returns The string with escaped mhchem commands\n */\nexport function escapeMhchemCommands(text: string) {\n return text.replaceAll('$\\\\ce{', '$\\\\\\\\ce{').replaceAll('$\\\\pu{', '$\\\\\\\\pu{');\n}\n\n/**\n * Escapes pipe characters within LaTeX expressions to prevent them from being interpreted\n * as table column separators in markdown tables.\n *\n * @param text The input string containing LaTeX expressions\n * @returns The string with pipe characters escaped in LaTeX expressions\n */\nexport function escapeLatexPipes(text: string): string {\n // Replace unescaped '|' inside LaTeX math spans with '\\vert' so that\n // remark-gfm table parsing won't treat them as column separators.\n // Leave code blocks/inline code untouched.\n // Also ignore escaped dollars (\\$) which are currency symbols\n\n // Process code blocks first to protect them\n const codeBlocks: string[] = [];\n let content = text.replaceAll(/(```[\\S\\s]*?```|`[^\\n`]*`)/g, (match) => {\n codeBlocks.push(match);\n return `<<CODE_${codeBlocks.length - 1}>>`;\n });\n\n // For display math, allow multiline\n content = content.replaceAll(/\\$\\$([\\S\\s]*?)\\$\\$/g, (match, display) => {\n return `$$${replaceUnescapedPipes(display)}$$`;\n });\n\n // For inline math, use non-greedy match that DOES NOT cross newlines\n // This prevents issues in tables where $ might appear in different cells\n content = content.replaceAll(/(?<!\\\\)\\$(?!\\$)([^\\n$]*?)(?<!\\\\)\\$(?!\\$)/g, (match, inline) => {\n return `$${replaceUnescapedPipes(inline)}$`;\n });\n\n // Restore code blocks\n content = content.replaceAll(/<<CODE_(\\d+)>>/g, (_, index) => {\n return codeBlocks[Number.parseInt(index)];\n });\n\n return content;\n}\n\n/**\n * Escapes underscores within \\text{...} commands in LaTeX expressions\n * that are not already escaped.\n * For example, \\text{node_domain} becomes \\text{node\\_domain},\n * but \\text{node\\_domain} remains \\text{node\\_domain}.\n *\n * @param text The input string potentially containing LaTeX expressions\n * @returns The string with unescaped underscores escaped within \\text{...} commands\n */\nexport function escapeTextUnderscores(text: string): string {\n return text.replaceAll(/\\\\text{([^}]*)}/g, (match, textContent: string) => {\n // textContent is the content within the braces, e.g., \"node_domain\" or \"already\\_escaped\"\n // Replace underscores '_' with '\\_' only if they are NOT preceded by a backslash '\\'.\n // The (?<!\\\\) is a negative lookbehind assertion that ensures the character before '_' is not a '\\'.\n const escapedTextContent = textContent.replaceAll(/(?<!\\\\)_/g, '\\\\_');\n return `\\\\text{${escapedTextContent}}`;\n });\n}\n\n/**\n * Escapes dollar signs that appear to be currency symbols to prevent them from being\n * interpreted as LaTeX math delimiters.\n *\n * This function identifies currency patterns such as:\n * - $20, $100, $1,000\n * - $20-50, $100+\n * - Patterns within markdown tables\n *\n * @param text The input string containing potential currency symbols\n * @returns The string with currency dollar signs escaped\n */\nexport function escapeCurrencyDollars(text: string): string {\n // Protect code blocks and existing LaTeX expressions from processing\n const manager = new PlaceholderManager('PROTECTED');\n\n let content = text.replaceAll(\n // Match patterns to protect (in order):\n // 1. Code blocks: ```...```\n // 2. Inline code: `...`\n // 3. Display math: $$...$$\n // 4. Inline math with LaTeX commands: $...\\...$ (must contain backslash to distinguish from currency)\n // 5. Simple number formulas: $1$, $10$, $100$ (pure digits in math mode)\n // 6. Number lists in math mode: $1,-1,0$ or $1,2,3$ (comma-separated numbers, possibly negative)\n // 7. LaTeX bracket notation: \\[...\\]\n // 8. LaTeX parenthesis notation: \\(...\\)\n /(```[\\S\\s]*?```|`[^\\n`]*`|\\$\\$[\\S\\s]*?\\$\\$|(?<!\\\\)\\$(?!\\$)(?=[\\S\\s]*?\\\\)[\\S\\s]*?(?<!\\\\)\\$(?!\\$)|\\$\\d+\\$|\\$-?\\d+(?:,-?\\d+)+\\$|\\\\\\[[\\S\\s]*?\\\\]|\\\\\\(.*?\\\\\\))/g,\n (match) => manager.add(match),\n );\n\n // Escape dollar signs that are clearly currency:\n // - $ followed by a digit\n // - Not preceded by another $ (to avoid breaking $$)\n // - Not followed immediately by another $ (to avoid breaking $1$ LaTeX)\n // - Followed by number patterns with optional commas, decimals, ranges, or plus signs\n // Match patterns like: $20, $1,000, $19.99, $20-50, $300+, $1,000-2,000+\n // But NOT: $1$, $2$ (these are LaTeX formulas)\n // In the replacement: \\\\ = backslash, $$ = literal $, $1 = capture group 1\n content = content.replaceAll(\n /(?<!\\$)\\$(\\d{1,3}(?:,\\d{3})*(?:\\.\\d+)?(?:-\\d{1,3}(?:,\\d{3})*(?:\\.\\d+)?)?\\+?)(?!\\$)/g,\n '\\\\$$$1',\n );\n\n // Restore protected content\n content = manager.restore(content);\n\n return content;\n}\n\n// Old simple preprocessLaTeX has been replaced by the comprehensive version below\n// The new preprocessLaTeX provides the same default behavior with optional advanced featuresgit\n\n/**\n * Extracts the LaTeX formula after the last $$ delimiter if there's an odd number of $$ delimiters.\n *\n * @param text The input string containing LaTeX formulas\n * @returns The content after the last $$ if there's an odd number of $$, otherwise an empty string\n */\nconst extractIncompleteFormula = (text: string) => {\n // Count the number of $$ delimiters\n const dollarsCount = (text.match(/\\$\\$/g) || []).length;\n\n // If odd number of $$ delimiters, extract content after the last $$\n if (dollarsCount % 2 === 1) {\n const match = text.match(/\\$\\$([^]*)$/);\n return match ? match[1] : '';\n }\n\n // If even number of $$ delimiters, return empty string\n return '';\n};\n\n/**\n * Checks if the last LaTeX formula in the text is renderable.\n * Only validates the formula after the last $$ if there's an odd number of $$.\n *\n * @param text The input string containing LaTeX formulas\n * @returns True if the last formula is renderable or if there's no incomplete formula\n */\nexport const isLastFormulaRenderable = (text: string) => {\n const formula = extractIncompleteFormula(text);\n\n // If no incomplete formula, return true\n if (!formula) return true;\n\n // Try to render the last formula\n try {\n renderToString(formula, {\n displayMode: true,\n throwOnError: true,\n });\n return true;\n } catch (error) {\n console.error(`LaTeX formula rendering error: ${error}`);\n return false;\n }\n};\n\n// ============================================================================\n// Advanced Preprocessing Functions\n// ============================================================================\n\n/**\n * Fixes common LaTeX syntax errors automatically\n * - Balances unmatched braces\n * - Balances \\left and \\right delimiters\n *\n * @param text The input string containing LaTeX expressions\n * @returns The string with fixed LaTeX expressions\n */\nexport function fixCommonLaTeXErrors(text: string): string {\n return text.replaceAll(/(\\$\\$[\\S\\s]*?\\$\\$|\\$[\\S\\s]*?\\$)/g, (match) => {\n let fixed = match;\n\n // Fix unbalanced braces\n const openBraces = (fixed.match(/(?<!\\\\){/g) || []).length;\n const closeBraces = (fixed.match(/(?<!\\\\)}/g) || []).length;\n if (openBraces > closeBraces) {\n const diff = openBraces - closeBraces;\n const closingBraces = '}'.repeat(diff);\n // Insert before the closing delimiter\n fixed = fixed.replace(/(\\$\\$?)$/, closingBraces + '$1');\n }\n\n // Fix unbalanced \\left and \\right\n const leftDelims = (fixed.match(/\\\\left[(.<[{|]/g) || []).length;\n const rightDelims = (fixed.match(/\\\\right[).>\\]|}]/g) || []).length;\n if (leftDelims > rightDelims) {\n const diff = leftDelims - rightDelims;\n const rightDots = '\\\\right.'.repeat(diff);\n fixed = fixed.replace(/(\\$\\$?)$/, rightDots + '$1');\n }\n\n return fixed;\n });\n}\n\n/**\n * Normalizes whitespace in LaTeX expressions\n * - Removes extra spaces around $ delimiters\n * - Normalizes multiple spaces to single space inside formulas\n *\n * @param text The input string containing LaTeX expressions\n * @returns The string with normalized whitespace\n */\nexport function normalizeLatexSpacing(text: string): string {\n let result = text;\n\n // Remove spaces inside $ delimiters (at the edges)\n result = result.replaceAll(/\\$\\s+/g, '$');\n result = result.replaceAll(/\\s+\\$/g, '$');\n result = result.replaceAll(/\\$\\$\\s+/g, '$$');\n result = result.replaceAll(/\\s+\\$\\$/g, '$$');\n\n // Normalize multiple spaces inside formulas to single space\n result = result.replaceAll(/(\\$\\$[\\S\\s]*?\\$\\$|\\$[\\S\\s]*?\\$)/g, (match) => {\n return match.replaceAll(/\\s{2,}/g, ' ');\n });\n\n return result;\n}\n\n/**\n * Validates all LaTeX expressions in the text\n * Returns detailed information about validation results\n *\n * @param text The input string containing LaTeX expressions\n * @returns Validation results with errors if any\n */\nexport function validateLatexExpressions(text: string): {\n errors: Array<{\n formula: string;\n message: string;\n position: number;\n type: 'display' | 'inline';\n }>;\n totalExpressions: number;\n valid: boolean;\n} {\n const errors: Array<{\n formula: string;\n message: string;\n position: number;\n type: 'display' | 'inline';\n }> = [];\n\n let totalExpressions = 0;\n const pattern = /\\$\\$([\\S\\s]*?)\\$\\$|(?<!\\\\)\\$(?!\\$)([\\S\\s]*?)(?<!\\\\)\\$(?!\\$)/g;\n let match;\n\n while ((match = pattern.exec(text)) !== null) {\n totalExpressions++;\n const formula = match[1] || match[2];\n const isDisplay = match[0].startsWith('$$');\n\n try {\n renderToString(formula, {\n displayMode: isDisplay,\n strict: 'warn',\n throwOnError: true,\n trust: false,\n });\n } catch (error) {\n errors.push({\n formula: formula.slice(0, 50) + (formula.length > 50 ? '...' : ''),\n message: error instanceof Error ? error.message : String(error),\n position: match.index,\n type: isDisplay ? 'display' : 'inline',\n });\n }\n }\n\n return {\n errors,\n totalExpressions,\n valid: errors.length === 0,\n };\n}\n\n/**\n * Handles CJK (Chinese, Japanese, Korean) characters mixed with LaTeX\n * Optionally adds spaces between CJK characters and LaTeX expressions for better rendering\n *\n * @param text The input string\n * @param addSpaces Whether to add spaces between CJK and LaTeX (default: false)\n * @returns The processed string\n */\nexport function handleCJKWithLatex(text: string, addSpaces = false): string {\n if (!addSpaces) return text;\n\n let result = text;\n\n // Add space between CJK character and opening $\n result = result.replaceAll(/([\\u3040-\\u30FF\\u4E00-\\u9FA5])(\\$)/g, '$1 $2');\n\n // Add space between closing $ and CJK character\n result = result.replaceAll(/(\\$)([\\u3040-\\u30FF\\u4E00-\\u9FA5])/g, '$1 $2');\n\n return result;\n}\n\n// ============================================================================\n// Advanced Preprocessing Options\n// ============================================================================\n\nexport interface AdvancedPreprocessOptions {\n /** Add spaces between CJK and LaTeX (default: false, requires handleCJK: true) */\n addCJKSpaces?: boolean;\n /** Convert bracket notation \\[...\\] to $$...$$ (default: true) */\n convertBrackets?: boolean;\n /** Enable currency escaping (default: true) */\n escapeCurrency?: boolean;\n /** Escape mhchem commands (default: true) */\n escapeMhchem?: boolean;\n /** Escape pipe symbols in LaTeX (default: true) */\n escapePipes?: boolean;\n /** Escape underscores in \\text{} (default: true) */\n escapeUnderscores?: boolean;\n /** Automatically fix common LaTeX errors (default: false) */\n fixErrors?: boolean;\n /** Handle CJK characters (default: false) */\n handleCJK?: boolean;\n /** Normalize whitespace (default: false) */\n normalizeSpacing?: boolean;\n /** Throw error on validation failure (default: false, requires validate: true) */\n throwOnValidationError?: boolean;\n /** Validate LaTeX syntax (default: false) */\n validate?: boolean;\n}\n\n/**\n * Comprehensive LaTeX preprocessing with configurable options\n *\n * This is the main preprocessing function that handles:\n * - Currency symbol escaping (e.g., $20 → \\$20)\n * - LaTeX delimiter conversion (\\[...\\] → $$...$$)\n * - Special character escaping (pipes, underscores, mhchem)\n * - Optional error fixing and validation\n * - Optional CJK character handling\n *\n * @param text The input string containing LaTeX and Markdown\n * @param options Configuration options for fine-grained control\n * @returns The preprocessed string\n *\n * @example\n * ```ts\n * // Default behavior (same as old preprocessLaTeX)\n * preprocessLaTeX('向量$90^\\\\circ$,非 $0^\\\\circ$ 和 $180^\\\\circ$')\n *\n * // With custom options\n * preprocessLaTeX(text, {\n * fixErrors: true,\n * validate: true,\n * handleCJK: true\n * })\n * ```\n */\nexport function preprocessLaTeX(text: string, options: AdvancedPreprocessOptions = {}): string {\n const {\n addCJKSpaces = false,\n convertBrackets = true,\n escapeCurrency = true,\n escapeMhchem = true,\n escapePipes = true,\n escapeUnderscores = true,\n fixErrors = false,\n handleCJK = false,\n normalizeSpacing = false,\n throwOnValidationError = false,\n validate = false,\n } = options;\n\n let content = text;\n\n // Phase 1: Currency escaping (if enabled)\n if (escapeCurrency) {\n content = escapeCurrencyDollars(content);\n }\n\n // Phase 2: Bracket conversion (if enabled)\n if (convertBrackets) {\n content = convertLatexDelimiters(content);\n }\n\n // Phase 3: LaTeX-specific escaping\n if (escapeMhchem) {\n content = escapeMhchemCommands(content);\n }\n\n if (escapePipes) {\n content = escapeLatexPipes(content);\n }\n\n if (escapeUnderscores) {\n content = escapeTextUnderscores(content);\n }\n\n // Phase 4: Error fixing (if enabled)\n if (fixErrors) {\n content = fixCommonLaTeXErrors(content);\n }\n\n // Phase 5: Whitespace normalization (if enabled)\n if (normalizeSpacing) {\n content = normalizeLatexSpacing(content);\n }\n\n // Phase 6: CJK handling (if enabled)\n if (handleCJK) {\n content = handleCJKWithLatex(content, addCJKSpaces);\n }\n\n // Phase 7: Validation (if enabled)\n if (validate) {\n const validation = validateLatexExpressions(content);\n if (!validation.valid) {\n const errorMessage = `LaTeX validation failed (${validation.errors.length}/${validation.totalExpressions} expressions have errors):\\n${validation.errors.map((e) => ` - [${e.type}] at position ${e.position}: ${e.message}\\n Formula: ${e.formula}`).join('\\n')}`;\n\n if (throwOnValidationError) {\n throw new Error(errorMessage);\n } else {\n console.warn(errorMessage);\n }\n }\n }\n\n return content;\n}\n\n/**\n * Strict preprocessing mode - enables all safety features and validations\n * Use this when you want maximum correctness and are willing to accept the performance cost\n *\n * @param text The input string\n * @returns The preprocessed string with all features enabled\n *\n * @example\n * ```ts\n * const processed = preprocessLaTeXStrict(userInput)\n * // Enables: error fixing, validation, CJK handling, space normalization\n * ```\n */\nexport function preprocessLaTeXStrict(text: string): string {\n return preprocessLaTeX(text, {\n addCJKSpaces: false, // Usually don't want extra spaces\n convertBrackets: true,\n escapeCurrency: true,\n escapeMhchem: true,\n escapePipes: true,\n escapeUnderscores: true,\n fixErrors: true,\n handleCJK: true,\n normalizeSpacing: true,\n throwOnValidationError: false, // Warn but don't throw\n validate: true,\n });\n}\n\n/**\n * Minimal preprocessing mode - only essential operations\n * Use this for better performance when you control the input\n *\n * @param text The input string\n * @returns The preprocessed string with minimal processing\n *\n * @example\n * ```ts\n * const processed = preprocessLaTeXMinimal(trustedInput)\n * // Only escapes currency and converts brackets\n * ```\n */\nexport function preprocessLaTeXMinimal(text: string): string {\n return preprocessLaTeX(text, {\n convertBrackets: true,\n escapeCurrency: true,\n escapeMhchem: false,\n escapePipes: false,\n escapeUnderscores: false,\n fixErrors: false,\n handleCJK: false,\n normalizeSpacing: false,\n validate: false,\n });\n}\n"],"mappings":";;;;;;;AAUA,IAAM,qBAAN,MAAyB;CAIvB,YAAY,SAAS,aAAa;sBAHD,EAAE;AAIjC,OAAK,SAAS;;CAGhB,IAAI,SAAyB;EAC3B,MAAM,QAAQ,KAAK,aAAa;AAChC,OAAK,aAAa,KAAK,QAAQ;AAC/B,SAAO,KAAK,KAAK,OAAO,GAAG,MAAM;;CAGnC,QAAQ,MAAsB;AAC5B,SAAO,KAAK,WAAW,IAAI,OAAO,KAAK,KAAK,OAAO,YAAY,IAAI,GAAG,GAAG,UAAU;AACjF,UAAO,KAAK,aAAa,OAAO,SAAS,MAAM,KAAK;IACpD;;CAGJ,QAAc;AACZ,OAAK,eAAe,EAAE;;;AAS1B,MAAM,yBAAyB,YAE7B,QAAQ,WA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AI,YACF,WAAU,iBAAiB,QAAQ;AAGrC,KAAI,kBACF,WAAU,sBAAsB,QAAQ;AAI1C,KAAI,UACF,WAAU,qBAAqB,QAAQ;AAIzC,KAAI,iBACF,WAAU,sBAAsB,QAAQ;AAI1C,KAAI,UACF,WAAU,mBAAmB,SAAS,aAAa;AAIrD,KAAI,UAAU;EACZ,MAAM,aAAa,yBAAyB,QAAQ;AACpD,MAAI,CAAC,WAAW,OAAO;GACrB,MAAM,eAAe,4BAA4B,WAAW,OAAO,OAAO,GAAG,WAAW,iBAAiB,8BAA8B,WAAW,OAAO,KAAK,MAAM,QAAQ,EAAE,KAAK,gBAAgB,EAAE,SAAS,IAAI,EAAE,QAAQ,iBAAiB,EAAE,UAAU,CAAC,KAAK,KAAK;AAEpQ,OAAI,uBACF,OAAM,IAAI,MAAM,aAAa;OAE7B,SAAQ,KAAK,aAAa;;;AAKhC,QAAO"}
|
|
1
|
+
{"version":3,"file":"latex.mjs","names":["codeBlocks: string[]","errors: Array<{\n formula: string;\n message: string;\n position: number;\n type: 'display' | 'inline';\n }>"],"sources":["../../../src/hooks/useMarkdown/latex.ts"],"sourcesContent":["import { renderToString } from 'katex';\n\n// ============================================================================\n// Utility Classes\n// ============================================================================\n\n/**\n * PlaceholderManager - Manages temporary replacement and restoration of protected content\n * Used to protect code blocks and LaTeX expressions during preprocessing\n */\nclass PlaceholderManager {\n private placeholders: string[] = [];\n private prefix: string;\n\n constructor(prefix = 'PROTECTED') {\n this.prefix = prefix;\n }\n\n add(content: string): string {\n const index = this.placeholders.length;\n this.placeholders.push(content);\n return `<<${this.prefix}_${index}>>`;\n }\n\n restore(text: string): string {\n return text.replaceAll(new RegExp(`<<${this.prefix}_(\\\\d+)>>`, 'g'), (_, index) => {\n return this.placeholders[Number.parseInt(index)] || '';\n });\n }\n\n clear(): void {\n this.placeholders = [];\n }\n}\n\n// ============================================================================\n// Helper Functions\n// ============================================================================\n\n// Helper: replace unescaped pipes with \\vert within a LaTeX math fragment\nconst replaceUnescapedPipes = (formula: string): string =>\n // Use \\vert{} so the control sequence terminates before the next token\n formula.replaceAll(/(?<!\\\\)\\|/g, '\\\\vert{}');\n\n/**\n * Converts LaTeX bracket delimiters to dollar sign delimiters.\n * Converts \\[...\\] to $$...$$ and \\(...\\) to $...$\n * Preserves code blocks during the conversion.\n *\n * @param text The input string containing LaTeX expressions\n * @returns The string with LaTeX bracket delimiters converted to dollar sign delimiters\n */\nexport function convertLatexDelimiters(text: string): string {\n const pattern = /(```[\\s\\S]*?```|`.*?`)|\\\\\\[([\\s\\S]*?[^\\\\])\\\\\\]|\\\\\\((.*?)\\\\\\)/g;\n return text.replaceAll(\n pattern,\n (\n match: string,\n codeBlock: string | undefined,\n squareBracket: string | undefined,\n roundBracket: string | undefined,\n ): string => {\n if (codeBlock !== undefined) {\n return codeBlock;\n } else if (squareBracket !== undefined) {\n return `$$${squareBracket}$$`;\n } else if (roundBracket !== undefined) {\n return `$${roundBracket}$`;\n }\n return match;\n },\n );\n}\n\n/**\n * Escapes mhchem commands in LaTeX expressions to ensure proper rendering.\n *\n * @param text The input string containing LaTeX expressions with mhchem commands\n * @returns The string with escaped mhchem commands\n */\nexport function escapeMhchemCommands(text: string) {\n return text.replaceAll('$\\\\ce{', '$\\\\\\\\ce{').replaceAll('$\\\\pu{', '$\\\\\\\\pu{');\n}\n\n/**\n * Escapes pipe characters within LaTeX expressions to prevent them from being interpreted\n * as table column separators in markdown tables.\n *\n * @param text The input string containing LaTeX expressions\n * @returns The string with pipe characters escaped in LaTeX expressions\n */\nexport function escapeLatexPipes(text: string): string {\n // Replace unescaped '|' inside LaTeX math spans with '\\vert' so that\n // remark-gfm table parsing won't treat them as column separators.\n // Leave code blocks/inline code untouched.\n // Also ignore escaped dollars (\\$) which are currency symbols\n\n // Process code blocks first to protect them\n const codeBlocks: string[] = [];\n let content = text.replaceAll(/(```[\\s\\S]*?```|`[^\\n`]*`)/g, (match) => {\n codeBlocks.push(match);\n return `<<CODE_${codeBlocks.length - 1}>>`;\n });\n\n // For display math, allow multiline\n content = content.replaceAll(/\\$\\$([\\s\\S]*?)\\$\\$/g, (match, display) => {\n return `$$${replaceUnescapedPipes(display)}$$`;\n });\n\n // For inline math, use non-greedy match that DOES NOT cross newlines\n // This prevents issues in tables where $ might appear in different cells\n content = content.replaceAll(/(?<!\\\\)\\$(?!\\$)([^\\n$]*)(?<!\\\\)\\$(?!\\$)/g, (match, inline) => {\n return `$${replaceUnescapedPipes(inline)}$`;\n });\n\n // Restore code blocks\n content = content.replaceAll(/<<CODE_(\\d+)>>/g, (_, index) => {\n return codeBlocks[Number.parseInt(index)];\n });\n\n return content;\n}\n\n/**\n * Escapes underscores within \\text{...} commands in LaTeX expressions\n * that are not already escaped.\n * For example, \\text{node_domain} becomes \\text{node\\_domain},\n * but \\text{node\\_domain} remains \\text{node\\_domain}.\n *\n * @param text The input string potentially containing LaTeX expressions\n * @returns The string with unescaped underscores escaped within \\text{...} commands\n */\nexport function escapeTextUnderscores(text: string): string {\n return text.replaceAll(/\\\\text\\{([^}]*)\\}/g, (match, textContent: string) => {\n // textContent is the content within the braces, e.g., \"node_domain\" or \"already\\_escaped\"\n // Replace underscores '_' with '\\_' only if they are NOT preceded by a backslash '\\'.\n // The (?<!\\\\) is a negative lookbehind assertion that ensures the character before '_' is not a '\\'.\n const escapedTextContent = textContent.replaceAll(/(?<!\\\\)_/g, '\\\\_');\n return `\\\\text{${escapedTextContent}}`;\n });\n}\n\n/**\n * Escapes dollar signs that appear to be currency symbols to prevent them from being\n * interpreted as LaTeX math delimiters.\n *\n * This function identifies currency patterns such as:\n * - $20, $100, $1,000\n * - $20-50, $100+\n * - Patterns within markdown tables\n *\n * @param text The input string containing potential currency symbols\n * @returns The string with currency dollar signs escaped\n */\nexport function escapeCurrencyDollars(text: string): string {\n // Protect code blocks and existing LaTeX expressions from processing\n const manager = new PlaceholderManager('PROTECTED');\n\n let content = text.replaceAll(\n // Match patterns to protect (in order):\n // 1. Code blocks: ```...```\n // 2. Inline code: `...`\n // 3. Display math: $$...$$\n // 4. Inline math with LaTeX commands: $...\\...$ (must contain backslash to distinguish from currency)\n // 5. Simple number formulas: $1$, $10$, $100$ (pure digits in math mode)\n // 6. Number lists in math mode: $1,-1,0$ or $1,2,3$ (comma-separated numbers, possibly negative)\n // 7. LaTeX bracket notation: \\[...\\]\n // 8. LaTeX parenthesis notation: \\(...\\)\n /(```[\\s\\S]*?```|`[^\\n`]*`|\\$\\$[\\s\\S]*?\\$\\$|(?<!\\\\)\\$(?!\\$)(?=[\\s\\S]*?\\\\)[\\s\\S]*?(?<!\\\\)\\$(?!\\$)|\\$\\d+\\$|\\$-?\\d+(?:,-?\\d+)+\\$|\\\\\\[[\\s\\S]*?\\\\\\]|\\\\\\(.*?\\\\\\))/g,\n (match) => manager.add(match),\n );\n\n // Escape dollar signs that are clearly currency:\n // - $ followed by a digit\n // - Not preceded by another $ (to avoid breaking $$)\n // - Not followed immediately by another $ (to avoid breaking $1$ LaTeX)\n // - Followed by number patterns with optional commas, decimals, ranges, or plus signs\n // Match patterns like: $20, $1,000, $19.99, $20-50, $300+, $1,000-2,000+\n // But NOT: $1$, $2$ (these are LaTeX formulas)\n // In the replacement: \\\\ = backslash, $$ = literal $, $1 = capture group 1\n content = content.replaceAll(\n /(?<!\\$)\\$(\\d{1,3}(?:,\\d{3})*(?:\\.\\d+)?(?:-\\d{1,3}(?:,\\d{3})*(?:\\.\\d+)?)?\\+?)(?!\\$)/g,\n '\\\\$$$1',\n );\n\n // Restore protected content\n content = manager.restore(content);\n\n return content;\n}\n\n// Old simple preprocessLaTeX has been replaced by the comprehensive version below\n// The new preprocessLaTeX provides the same default behavior with optional advanced featuresgit\n\n/**\n * Extracts the LaTeX formula after the last $$ delimiter if there's an odd number of $$ delimiters.\n *\n * @param text The input string containing LaTeX formulas\n * @returns The content after the last $$ if there's an odd number of $$, otherwise an empty string\n */\nconst extractIncompleteFormula = (text: string) => {\n // Count the number of $$ delimiters\n const dollarsCount = (text.match(/\\$\\$/g) || []).length;\n\n // If odd number of $$ delimiters, extract content after the last $$\n if (dollarsCount % 2 === 1) {\n const match = text.match(/\\$\\$([\\s\\S]*)$/);\n return match ? match[1] : '';\n }\n\n // If even number of $$ delimiters, return empty string\n return '';\n};\n\n/**\n * Checks if the last LaTeX formula in the text is renderable.\n * Only validates the formula after the last $$ if there's an odd number of $$.\n *\n * @param text The input string containing LaTeX formulas\n * @returns True if the last formula is renderable or if there's no incomplete formula\n */\nexport const isLastFormulaRenderable = (text: string) => {\n const formula = extractIncompleteFormula(text);\n\n // If no incomplete formula, return true\n if (!formula) return true;\n\n // Try to render the last formula\n try {\n renderToString(formula, {\n displayMode: true,\n throwOnError: true,\n });\n return true;\n } catch (error) {\n console.error(`LaTeX formula rendering error: ${error}`);\n return false;\n }\n};\n\n// ============================================================================\n// Advanced Preprocessing Functions\n// ============================================================================\n\n/**\n * Fixes common LaTeX syntax errors automatically\n * - Balances unmatched braces\n * - Balances \\left and \\right delimiters\n *\n * @param text The input string containing LaTeX expressions\n * @returns The string with fixed LaTeX expressions\n */\nexport function fixCommonLaTeXErrors(text: string): string {\n return text.replaceAll(/(\\$\\$[\\s\\S]*?\\$\\$|\\$[\\s\\S]*?\\$)/g, (match) => {\n let fixed = match;\n\n // Fix unbalanced braces\n const openBraces = (fixed.match(/(?<!\\\\)\\{/g) || []).length;\n const closeBraces = (fixed.match(/(?<!\\\\)\\}/g) || []).length;\n if (openBraces > closeBraces) {\n const diff = openBraces - closeBraces;\n const closingBraces = '}'.repeat(diff);\n // Insert before the closing delimiter\n fixed = fixed.replace(/(\\$\\$?)$/, closingBraces + '$1');\n }\n\n // Fix unbalanced \\left and \\right\n const leftDelims = (fixed.match(/\\\\left[(.<[{|]/g) || []).length;\n const rightDelims = (fixed.match(/\\\\right[).>\\]|}]/g) || []).length;\n if (leftDelims > rightDelims) {\n const diff = leftDelims - rightDelims;\n const rightDots = '\\\\right.'.repeat(diff);\n fixed = fixed.replace(/(\\$\\$?)$/, rightDots + '$1');\n }\n\n return fixed;\n });\n}\n\n/**\n * Normalizes whitespace in LaTeX expressions\n * - Removes extra spaces around $ delimiters\n * - Normalizes multiple spaces to single space inside formulas\n *\n * @param text The input string containing LaTeX expressions\n * @returns The string with normalized whitespace\n */\nexport function normalizeLatexSpacing(text: string): string {\n let result = text;\n\n // Remove spaces inside $ delimiters (at the edges)\n result = result.replaceAll(/\\$\\s+/g, '$');\n result = result.replaceAll(/\\s+\\$/g, '$');\n result = result.replaceAll(/\\$\\$\\s+/g, '$$');\n result = result.replaceAll(/\\s+\\$\\$/g, '$$');\n\n // Normalize multiple spaces inside formulas to single space\n result = result.replaceAll(/(\\$\\$[\\s\\S]*?\\$\\$|\\$[\\s\\S]*?\\$)/g, (match) => {\n return match.replaceAll(/\\s{2,}/g, ' ');\n });\n\n return result;\n}\n\n/**\n * Validates all LaTeX expressions in the text\n * Returns detailed information about validation results\n *\n * @param text The input string containing LaTeX expressions\n * @returns Validation results with errors if any\n */\nexport function validateLatexExpressions(text: string): {\n errors: Array<{\n formula: string;\n message: string;\n position: number;\n type: 'display' | 'inline';\n }>;\n totalExpressions: number;\n valid: boolean;\n} {\n const errors: Array<{\n formula: string;\n message: string;\n position: number;\n type: 'display' | 'inline';\n }> = [];\n\n let totalExpressions = 0;\n const pattern = /\\$\\$([\\s\\S]*?)\\$\\$|(?<!\\\\)\\$(?!\\$)([\\s\\S]*?)(?<!\\\\)\\$(?!\\$)/g;\n let match;\n\n while ((match = pattern.exec(text)) !== null) {\n totalExpressions++;\n const formula = match[1] || match[2];\n const isDisplay = match[0].startsWith('$$');\n\n try {\n renderToString(formula, {\n displayMode: isDisplay,\n strict: 'warn',\n throwOnError: true,\n trust: false,\n });\n } catch (error) {\n errors.push({\n formula: formula.slice(0, 50) + (formula.length > 50 ? '...' : ''),\n message: error instanceof Error ? error.message : String(error),\n position: match.index,\n type: isDisplay ? 'display' : 'inline',\n });\n }\n }\n\n return {\n errors,\n totalExpressions,\n valid: errors.length === 0,\n };\n}\n\n/**\n * Handles CJK (Chinese, Japanese, Korean) characters mixed with LaTeX\n * Optionally adds spaces between CJK characters and LaTeX expressions for better rendering\n *\n * @param text The input string\n * @param addSpaces Whether to add spaces between CJK and LaTeX (default: false)\n * @returns The processed string\n */\nexport function handleCJKWithLatex(text: string, addSpaces = false): string {\n if (!addSpaces) return text;\n\n let result = text;\n\n // Add space between CJK character and opening $\n result = result.replaceAll(/([\\u3040-\\u30FF\\u4E00-\\u9FA5])(\\$)/g, '$1 $2');\n\n // Add space between closing $ and CJK character\n result = result.replaceAll(/(\\$)([\\u3040-\\u30FF\\u4E00-\\u9FA5])/g, '$1 $2');\n\n return result;\n}\n\n// ============================================================================\n// Advanced Preprocessing Options\n// ============================================================================\n\nexport interface AdvancedPreprocessOptions {\n /** Add spaces between CJK and LaTeX (default: false, requires handleCJK: true) */\n addCJKSpaces?: boolean;\n /** Convert bracket notation \\[...\\] to $$...$$ (default: true) */\n convertBrackets?: boolean;\n /** Enable currency escaping (default: true) */\n escapeCurrency?: boolean;\n /** Escape mhchem commands (default: true) */\n escapeMhchem?: boolean;\n /** Escape pipe symbols in LaTeX (default: true) */\n escapePipes?: boolean;\n /** Escape underscores in \\text{} (default: true) */\n escapeUnderscores?: boolean;\n /** Automatically fix common LaTeX errors (default: false) */\n fixErrors?: boolean;\n /** Handle CJK characters (default: false) */\n handleCJK?: boolean;\n /** Normalize whitespace (default: false) */\n normalizeSpacing?: boolean;\n /** Throw error on validation failure (default: false, requires validate: true) */\n throwOnValidationError?: boolean;\n /** Validate LaTeX syntax (default: false) */\n validate?: boolean;\n}\n\n/**\n * Comprehensive LaTeX preprocessing with configurable options\n *\n * This is the main preprocessing function that handles:\n * - Currency symbol escaping (e.g., $20 → \\$20)\n * - LaTeX delimiter conversion (\\[...\\] → $$...$$)\n * - Special character escaping (pipes, underscores, mhchem)\n * - Optional error fixing and validation\n * - Optional CJK character handling\n *\n * @param text The input string containing LaTeX and Markdown\n * @param options Configuration options for fine-grained control\n * @returns The preprocessed string\n *\n * @example\n * ```ts\n * // Default behavior (same as old preprocessLaTeX)\n * preprocessLaTeX('向量$90^\\\\circ$,非 $0^\\\\circ$ 和 $180^\\\\circ$')\n *\n * // With custom options\n * preprocessLaTeX(text, {\n * fixErrors: true,\n * validate: true,\n * handleCJK: true\n * })\n * ```\n */\nexport function preprocessLaTeX(text: string, options: AdvancedPreprocessOptions = {}): string {\n const {\n addCJKSpaces = false,\n convertBrackets = true,\n escapeCurrency = true,\n escapeMhchem = true,\n escapePipes = true,\n escapeUnderscores = true,\n fixErrors = false,\n handleCJK = false,\n normalizeSpacing = false,\n throwOnValidationError = false,\n validate = false,\n } = options;\n\n let content = text;\n\n // Phase 1: Currency escaping (if enabled)\n if (escapeCurrency) {\n content = escapeCurrencyDollars(content);\n }\n\n // Phase 2: Bracket conversion (if enabled)\n if (convertBrackets) {\n content = convertLatexDelimiters(content);\n }\n\n // Phase 3: LaTeX-specific escaping\n if (escapeMhchem) {\n content = escapeMhchemCommands(content);\n }\n\n if (escapePipes) {\n content = escapeLatexPipes(content);\n }\n\n if (escapeUnderscores) {\n content = escapeTextUnderscores(content);\n }\n\n // Phase 4: Error fixing (if enabled)\n if (fixErrors) {\n content = fixCommonLaTeXErrors(content);\n }\n\n // Phase 5: Whitespace normalization (if enabled)\n if (normalizeSpacing) {\n content = normalizeLatexSpacing(content);\n }\n\n // Phase 6: CJK handling (if enabled)\n if (handleCJK) {\n content = handleCJKWithLatex(content, addCJKSpaces);\n }\n\n // Phase 7: Validation (if enabled)\n if (validate) {\n const validation = validateLatexExpressions(content);\n if (!validation.valid) {\n const errorMessage = `LaTeX validation failed (${validation.errors.length}/${validation.totalExpressions} expressions have errors):\\n${validation.errors.map((e) => ` - [${e.type}] at position ${e.position}: ${e.message}\\n Formula: ${e.formula}`).join('\\n')}`;\n\n if (throwOnValidationError) {\n throw new Error(errorMessage);\n } else {\n console.warn(errorMessage);\n }\n }\n }\n\n return content;\n}\n\n/**\n * Strict preprocessing mode - enables all safety features and validations\n * Use this when you want maximum correctness and are willing to accept the performance cost\n *\n * @param text The input string\n * @returns The preprocessed string with all features enabled\n *\n * @example\n * ```ts\n * const processed = preprocessLaTeXStrict(userInput)\n * // Enables: error fixing, validation, CJK handling, space normalization\n * ```\n */\nexport function preprocessLaTeXStrict(text: string): string {\n return preprocessLaTeX(text, {\n addCJKSpaces: false, // Usually don't want extra spaces\n convertBrackets: true,\n escapeCurrency: true,\n escapeMhchem: true,\n escapePipes: true,\n escapeUnderscores: true,\n fixErrors: true,\n handleCJK: true,\n normalizeSpacing: true,\n throwOnValidationError: false, // Warn but don't throw\n validate: true,\n });\n}\n\n/**\n * Minimal preprocessing mode - only essential operations\n * Use this for better performance when you control the input\n *\n * @param text The input string\n * @returns The preprocessed string with minimal processing\n *\n * @example\n * ```ts\n * const processed = preprocessLaTeXMinimal(trustedInput)\n * // Only escapes currency and converts brackets\n * ```\n */\nexport function preprocessLaTeXMinimal(text: string): string {\n return preprocessLaTeX(text, {\n convertBrackets: true,\n escapeCurrency: true,\n escapeMhchem: false,\n escapePipes: false,\n escapeUnderscores: false,\n fixErrors: false,\n handleCJK: false,\n normalizeSpacing: false,\n validate: false,\n });\n}\n"],"mappings":";;;;;;;AAUA,IAAM,qBAAN,MAAyB;CAIvB,YAAY,SAAS,aAAa;sBAHD,EAAE;AAIjC,OAAK,SAAS;;CAGhB,IAAI,SAAyB;EAC3B,MAAM,QAAQ,KAAK,aAAa;AAChC,OAAK,aAAa,KAAK,QAAQ;AAC/B,SAAO,KAAK,KAAK,OAAO,GAAG,MAAM;;CAGnC,QAAQ,MAAsB;AAC5B,SAAO,KAAK,WAAW,IAAI,OAAO,KAAK,KAAK,OAAO,YAAY,IAAI,GAAG,GAAG,UAAU;AACjF,UAAO,KAAK,aAAa,OAAO,SAAS,MAAM,KAAK;IACpD;;CAGJ,QAAc;AACZ,OAAK,eAAe,EAAE;;;AAS1B,MAAM,yBAAyB,YAE7B,QAAQ,WAAW,cAAc,WAAW;;;;;;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AiB,QAAQ;AAGrC,KAAI,kBACF,WAAU,sBAAsB,QAAQ;AAI1C,KAAI,UACF,WAAU,qBAAqB,QAAQ;AAIzC,KAAI,iBACF,WAAU,sBAAsB,QAAQ;AAI1C,KAAI,UACF,WAAU,mBAAmB,SAAS,aAAa;AAIrD,KAAI,UAAU;EACZ,MAAM,aAAa,yBAAyB,QAAQ;AACpD,MAAI,CAAC,WAAW,OAAO;GACrB,MAAM,eAAe,4BAA4B,WAAW,OAAO,OAAO,GAAG,WAAW,iBAAiB,8BAA8B,WAAW,OAAO,KAAK,MAAM,QAAQ,EAAE,KAAK,gBAAgB,EAAE,SAAS,IAAI,EAAE,QAAQ,iBAAiB,EAAE,UAAU,CAAC,KAAK,KAAK;AAEpQ,OAAI,uBACF,OAAM,IAAI,MAAM,aAAa;OAE7B,SAAQ,KAAK,aAAa;;;AAKhC,QAAO"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import Hotkey_default from "../../Hotkey/Hotkey.mjs";
|
|
4
|
-
import { CodeBlock } from "../../Markdown/components/CodeBlock.mjs";
|
|
5
4
|
import { useMarkdownContext } from "../../Markdown/components/MarkdownProvider.mjs";
|
|
5
|
+
import { CodeBlock } from "../../Markdown/components/CodeBlock.mjs";
|
|
6
6
|
import Image_default from "../../mdx/mdxComponents/Image.mjs";
|
|
7
7
|
import Link_default from "../../mdx/mdxComponents/Link.mjs";
|
|
8
8
|
import Section_default from "../../mdx/mdxComponents/Section.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMarkdownComponents.mjs","names":["Link","Image","Video","Section","Hotkey"],"sources":["../../../src/hooks/useMarkdown/useMarkdownComponents.tsx"],"sourcesContent":["'use client';\n\nimport { useCallback, useMemo } from 'react';\nimport type { Components } from 'react-markdown';\n\nimport Hotkey from '@/Hotkey';\nimport { CodeBlock } from '@/Markdown/components/CodeBlock';\nimport { useMarkdownContext } from '@/Markdown/components/MarkdownProvider';\nimport Image from '@/mdx/mdxComponents/Image';\nimport Link from '@/mdx/mdxComponents/Link';\nimport Section from '@/mdx/mdxComponents/Section';\nimport Video from '@/mdx/mdxComponents/Video';\n\nexport const useMarkdownComponents = (): Components => {\n const {\n components,\n animated,\n citations,\n componentProps,\n enableMermaid,\n fullFeaturedCodeBlock,\n showFootnotes,\n } = useMarkdownContext();\n\n const memoA = useCallback(\n
|
|
1
|
+
{"version":3,"file":"useMarkdownComponents.mjs","names":["Link","Image","Video","Section","Hotkey"],"sources":["../../../src/hooks/useMarkdown/useMarkdownComponents.tsx"],"sourcesContent":["'use client';\n\nimport { useCallback, useMemo } from 'react';\nimport type { Components } from 'react-markdown';\n\nimport Hotkey from '@/Hotkey';\nimport { CodeBlock } from '@/Markdown/components/CodeBlock';\nimport { useMarkdownContext } from '@/Markdown/components/MarkdownProvider';\nimport Image from '@/mdx/mdxComponents/Image';\nimport Link from '@/mdx/mdxComponents/Link';\nimport Section from '@/mdx/mdxComponents/Section';\nimport Video from '@/mdx/mdxComponents/Video';\n\nexport const useMarkdownComponents = (): Components => {\n const {\n components,\n animated,\n citations,\n componentProps,\n enableMermaid,\n fullFeaturedCodeBlock,\n showFootnotes,\n } = useMarkdownContext();\n\n const memoA = useCallback(\n ({ node, ...props }: any) => <Link citations={citations} {...props} {...componentProps?.a} />,\n [citations, componentProps?.a],\n );\n\n const memoImg = useCallback(\n ({ node, ...props }: any) => <Image {...props} {...componentProps?.img} />,\n [componentProps?.img],\n );\n\n const memoVideo = useCallback(\n ({ node, ...props }: any) => <Video {...props} {...componentProps?.video} />,\n [componentProps?.video],\n );\n\n const memoSection = useCallback(\n ({ node, ...props }: any) => <Section showFootnotes={showFootnotes} {...props} />,\n [showFootnotes],\n );\n\n const memoKbd = useCallback(\n ({ children }: any) => <Hotkey keys={children} style={{ display: 'inline-flex' }} />,\n [],\n );\n\n const memoBr = useCallback(() => <br />, []);\n\n const memeP = useCallback(({ style, children, className }: any) => {\n const skipWrapperTags = ['img', 'video'];\n if (typeof children === 'object' && skipWrapperTags.includes(children?.props?.node?.tagName)) {\n return children;\n }\n return (\n <p className={className} style={style}>\n {children}\n </p>\n );\n }, []);\n\n // Stable references for theme objects to prevent unnecessary re-renders\n const highlightTheme = useMemo(\n () => componentProps?.highlight?.theme,\n [JSON.stringify(componentProps?.highlight?.theme)],\n );\n\n const mermaidTheme = useMemo(\n () => componentProps?.mermaid?.theme,\n [JSON.stringify(componentProps?.mermaid?.theme)],\n );\n\n // Create stable component props reference\n const stableComponentProps = useMemo(() => {\n if (!componentProps) return;\n\n return {\n highlight: componentProps.highlight\n ? { ...componentProps.highlight, theme: highlightTheme }\n : undefined,\n mermaid: componentProps.mermaid\n ? { ...componentProps.mermaid, theme: mermaidTheme }\n : undefined,\n };\n }, [highlightTheme, mermaidTheme]);\n\n const memoPre = useCallback(\n ({ node, ...props }: any) => (\n <CodeBlock\n animated={animated}\n enableMermaid={enableMermaid}\n fullFeatured={fullFeaturedCodeBlock}\n {...stableComponentProps}\n {...componentProps?.pre}\n {...props}\n />\n ),\n [animated, enableMermaid, fullFeaturedCodeBlock, stableComponentProps, componentProps?.pre],\n );\n\n const memoColorPreview = useCallback(({ node, ...props }: any) => <code {...props} />, []);\n\n const memoComponents = useMemo(\n () => ({\n a: memoA,\n br: memoBr,\n colorPreview: memoColorPreview,\n img: memoImg,\n kbd: memoKbd,\n p: memeP,\n pre: memoPre,\n section: memoSection,\n video: memoVideo,\n }),\n [memoA, memoBr, memoImg, memoVideo, memoPre, memoSection, memeP, memoColorPreview, memoKbd],\n );\n\n return useMemo(\n () => ({\n ...memoComponents,\n ...components,\n }),\n [memoComponents, components],\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,8BAA0C;CACrD,MAAM,EACJ,YACA,UACA,WACA,gBACA,eACA,uBACA,kBACE,oBAAoB;CAExB,MAAM,QAAQ,aACX,EAAE,MAAM,GAAG,YAAiB,oBAACA;EAAgB;EAAW,GAAI;EAAO,GAAI,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,EAAE,MAAM,GAAG,YACV,oBAAC;EACW;EACK;EACf,cAAc;EACd,GAAI;EACJ,GAAI,gBAAgB;EACpB,GAAI;GACJ,EAEJ;EAAC;EAAU;EAAe;EAAuB;EAAsB,gBAAgB;EAAI,CAC5F;CAED,MAAM,mBAAmB,aAAa,EAAE,MAAM,GAAG,YAAiB,oBAAC,UAAK,GAAI,QAAS,EAAE,EAAE,CAAC;CAE1F,MAAM,iBAAiB,eACd;EACL,GAAG;EACH,IAAI;EACJ,cAAc;EACd,KAAK;EACL,KAAK;EACL,GAAG;EACH,KAAK;EACL,SAAS;EACT,OAAO;EACR,GACD;EAAC;EAAO;EAAQ;EAAS;EAAW;EAAS;EAAa;EAAO;EAAkB;EAAQ,CAC5F;AAED,QAAO,eACE;EACL,GAAG;EACH,GAAG;EACJ,GACD,CAAC,gBAAgB,WAAW,CAC7B"}
|
|
@@ -39,22 +39,22 @@ const transformCitations = (rawContent, length = 0) => {
|
|
|
39
39
|
length: match[0].length
|
|
40
40
|
});
|
|
41
41
|
const excludedRanges = [];
|
|
42
|
-
|
|
42
|
+
const latexBlockRegex = /\$\$([\s\S]*?)\$\$/g;
|
|
43
43
|
while ((match = latexBlockRegex.exec(rawContent)) !== null) excludedRanges.push({
|
|
44
44
|
end: match.index + match[0].length - 1,
|
|
45
45
|
start: match.index
|
|
46
46
|
});
|
|
47
|
-
|
|
47
|
+
const inlineLatexRegex = /\$([^$]*)\$/g;
|
|
48
48
|
while ((match = inlineLatexRegex.exec(rawContent)) !== null) excludedRanges.push({
|
|
49
49
|
end: match.index + match[0].length - 1,
|
|
50
50
|
start: match.index
|
|
51
51
|
});
|
|
52
|
-
|
|
52
|
+
const codeBlockRegex = /```([\s\S]*?)```/g;
|
|
53
53
|
while ((match = codeBlockRegex.exec(rawContent)) !== null) excludedRanges.push({
|
|
54
54
|
end: match.index + match[0].length - 1,
|
|
55
55
|
start: match.index
|
|
56
56
|
});
|
|
57
|
-
|
|
57
|
+
const inlineCodeRegex = /`([^`]*)`/g;
|
|
58
58
|
while ((match = inlineCodeRegex.exec(rawContent)) !== null) excludedRanges.push({
|
|
59
59
|
end: match.index + match[0].length - 1,
|
|
60
60
|
start: match.index
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","names":["matches: { id: string; index: number; length: number }[]","excludedRanges: { end: number; start: number }[]"],"sources":["../../../src/hooks/useMarkdown/utils.ts"],"sourcesContent":["import { preprocessLaTeX } from './latex';\n\n// Cache configuration\nconst CACHE_SIZE = 50;\n\n/**\n * Cache for storing processed content to avoid redundant processing\n */\nexport const contentCache = new Map<string, string>();\n\n/**\n * Adds content to the cache with size limitation\n * Removes oldest entry if cache size limit is reached\n *\n * @param key The cache key\n * @param value The processed content to store\n */\nexport const addToCache = (key: string, value: string) => {\n if (contentCache.size >= CACHE_SIZE) {\n // Remove the oldest cache entry\n const firstKey = contentCache.keys().next().value;\n if (firstKey) contentCache.delete(firstKey);\n }\n contentCache.set(key, value);\n};\n\n/**\n * Transforms citation references in the format [n] to markdown links\n *\n * @param rawContent The markdown content with citation references\n * @param length The number of citations\n * @returns The content with citations transformed to markdown links\n */\nexport const transformCitations = (rawContent: string, length: number = 0) => {\n if (length === 0) return rawContent;\n\n // 生成引用索引\n const citationIndices = Array.from({ length })\n .fill('')\n .map((_, index) => index + 1);\n\n // 匹配所有潜在的引用\n const pattern = new RegExp(`\\\\[(${citationIndices.join('|')})\\\\]`, 'g');\n const matches: { id: string; index: number; length: number }[] = [];\n\n let match;\n while ((match = pattern.exec(rawContent)) !== null) {\n matches.push({\n id: match[1],\n index: match.index,\n length: match[0].length,\n });\n }\n\n // 识别所有需要排除的区域\n const excludedRanges: { end: number; start: number }[] = [];\n\n // 查找LaTeX块 $$...$$\n
|
|
1
|
+
{"version":3,"file":"utils.mjs","names":["matches: { id: string; index: number; length: number }[]","excludedRanges: { end: number; start: number }[]"],"sources":["../../../src/hooks/useMarkdown/utils.ts"],"sourcesContent":["import { preprocessLaTeX } from './latex';\n\n// Cache configuration\nconst CACHE_SIZE = 50;\n\n/**\n * Cache for storing processed content to avoid redundant processing\n */\nexport const contentCache = new Map<string, string>();\n\n/**\n * Adds content to the cache with size limitation\n * Removes oldest entry if cache size limit is reached\n *\n * @param key The cache key\n * @param value The processed content to store\n */\nexport const addToCache = (key: string, value: string) => {\n if (contentCache.size >= CACHE_SIZE) {\n // Remove the oldest cache entry\n const firstKey = contentCache.keys().next().value;\n if (firstKey) contentCache.delete(firstKey);\n }\n contentCache.set(key, value);\n};\n\n/**\n * Transforms citation references in the format [n] to markdown links\n *\n * @param rawContent The markdown content with citation references\n * @param length The number of citations\n * @returns The content with citations transformed to markdown links\n */\nexport const transformCitations = (rawContent: string, length: number = 0) => {\n if (length === 0) return rawContent;\n\n // 生成引用索引\n const citationIndices = Array.from({ length })\n .fill('')\n .map((_, index) => index + 1);\n\n // 匹配所有潜在的引用\n const pattern = new RegExp(`\\\\[(${citationIndices.join('|')})\\\\]`, 'g');\n const matches: { id: string; index: number; length: number }[] = [];\n\n let match;\n while ((match = pattern.exec(rawContent)) !== null) {\n matches.push({\n id: match[1],\n index: match.index,\n length: match[0].length,\n });\n }\n\n // 识别所有需要排除的区域\n const excludedRanges: { end: number; start: number }[] = [];\n\n // 查找LaTeX块 $$...$$\n const latexBlockRegex = /\\$\\$([\\s\\S]*?)\\$\\$/g;\n while ((match = latexBlockRegex.exec(rawContent)) !== null) {\n excludedRanges.push({\n end: match.index + match[0].length - 1,\n start: match.index,\n });\n }\n\n // 查找行内LaTeX $...$\n const inlineLatexRegex = /\\$([^$]*)\\$/g;\n while ((match = inlineLatexRegex.exec(rawContent)) !== null) {\n excludedRanges.push({\n end: match.index + match[0].length - 1,\n start: match.index,\n });\n }\n\n // 查找代码块 ```...```\n const codeBlockRegex = /```([\\s\\S]*?)```/g;\n while ((match = codeBlockRegex.exec(rawContent)) !== null) {\n excludedRanges.push({\n end: match.index + match[0].length - 1,\n start: match.index,\n });\n }\n\n // 查找行内代码 `...`\n const inlineCodeRegex = /`([^`]*)`/g;\n while ((match = inlineCodeRegex.exec(rawContent)) !== null) {\n excludedRanges.push({\n end: match.index + match[0].length - 1,\n start: match.index,\n });\n }\n\n // 过滤掉在排除区域内的引用\n const validMatches = matches.filter((citation) => {\n return !excludedRanges.some(\n (range) => citation.index >= range.start && citation.index <= range.end,\n );\n });\n\n // 从后向前替换,避免索引变化问题\n let result = rawContent;\n for (let i = validMatches.length - 1; i >= 0; i--) {\n const citation = validMatches[i];\n const before = result.slice(0, Math.max(0, citation.index));\n const after = result.slice(Math.max(0, citation.index + citation.length));\n result = before + `[#citation-${citation.id}](citation-${citation.id})` + after;\n }\n\n // 处理连续引用\n return result.replaceAll('][', '] [');\n};\n\n/**\n * Preprocessing options for markdown content\n */\ninterface PreprocessOptions {\n citationsLength?: number;\n enableCustomFootnotes?: boolean;\n enableLatex?: boolean;\n}\n\nexport const preprocessMarkdownContent = (\n str: string,\n { enableCustomFootnotes, enableLatex, citationsLength }: PreprocessOptions = {},\n) => {\n let content = str;\n\n // Process LaTeX expressions\n if (enableLatex) {\n content = preprocessLaTeX(content);\n }\n\n // Process custom footnotes/citations\n if (enableCustomFootnotes) {\n content = transformCitations(content, citationsLength);\n }\n\n return content;\n};\n"],"mappings":";;;AAGA,MAAM,aAAa;;;;AAKnB,MAAa,+BAAe,IAAI,KAAqB;;;;;;;;AASrD,MAAa,cAAc,KAAa,UAAkB;AACxD,KAAI,aAAa,QAAQ,YAAY;EAEnC,MAAM,WAAW,aAAa,MAAM,CAAC,MAAM,CAAC;AAC5C,MAAI,SAAU,cAAa,OAAO,SAAS;;AAE7C,cAAa,IAAI,KAAK,MAAM;;;;;;;;;AAU9B,MAAa,sBAAsB,YAAoB,SAAiB,MAAM;AAC5E,KAAI,WAAW,EAAG,QAAO;CAGzB,MAAM,kBAAkB,MAAM,KAAK,EAAE,QAAQ,CAAC,CAC3C,KAAK,GAAG,CACR,KAAK,GAAG,UAAU,QAAQ,EAAE;CAG/B,MAAM,UA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