@lobehub/ui 6.8.0 → 6.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Accordion/style.d.mts +2 -2
- package/es/AutoComplete/style.d.mts +1 -1
- package/es/Button/style.mjs +14 -14
- package/es/CodeDiff/theme.mjs +4 -1
- package/es/CodeDiff/theme.mjs.map +1 -1
- package/es/ColorPicker/style.mjs +2 -2
- package/es/ColorSwatches/style.mjs +2 -2
- package/es/DraggablePanel/style.mjs +1 -1
- package/es/DraggableSideNav/style.mjs +1 -1
- package/es/FloatingPanel/style.mjs +1 -1
- package/es/Highlighter/theme/lobe-highlights-theme.d.mts +4 -0
- package/es/Image/style.mjs +1 -1
- package/es/Input/style.mjs +3 -3
- package/es/Markdown/plugins/rehypeCustomFootnotes.mjs +1 -1
- package/es/Markdown/plugins/rehypeKatexDir.mjs +1 -1
- package/es/Markdown/plugins/remarkBr.mjs +1 -1
- package/es/Markdown/plugins/remarkCjkAutolink.mjs +1 -1
- package/es/Markdown/plugins/remarkColor.mjs +1 -1
- package/es/Markdown/plugins/remarkCustomFootnotes.mjs +1 -1
- package/es/Markdown/plugins/remarkGfmPlus.mjs +1 -1
- package/es/Markdown/plugins/remarkVideo.mjs +1 -1
- package/es/Select/style.mjs +1 -1
- package/es/Slider/style.mjs +1 -1
- package/es/Text/style.d.mts +2 -2
- package/es/awesome/GradientButton/style.mjs +1 -1
- package/es/index.d.mts +2 -1
- package/es/index.mjs +2 -1
- package/es/node_modules/.pnpm/unist-util-visit@5.2.0/node_modules/unist-util-visit/lib/index.mjs +289 -0
- package/es/node_modules/.pnpm/unist-util-visit@5.2.0/node_modules/unist-util-visit/lib/index.mjs.map +1 -0
- package/es/styles/createGlobalStyle.mjs +19 -5
- package/es/styles/createGlobalStyle.mjs.map +1 -1
- package/es/styles/css.mjs +18 -1
- package/es/styles/css.mjs.map +1 -1
- package/package.json +2 -2
- package/es/node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.mjs +0 -288
- package/es/node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.mjs.map +0 -1
package/es/Accordion/style.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import "@stylexjs/stylex";
|
|
2
2
|
export declare const accordionStyles: {
|
|
3
3
|
panel: string;
|
|
4
|
-
header: string;
|
|
5
4
|
action: string;
|
|
6
5
|
content: string;
|
|
7
6
|
trigger: string;
|
|
7
|
+
header: string;
|
|
8
8
|
root: string;
|
|
9
|
-
item: string;
|
|
10
9
|
indicator: string;
|
|
10
|
+
item: string;
|
|
11
11
|
itemOutlined: string;
|
|
12
12
|
rootOutlined: string;
|
|
13
13
|
actionAlwaysVisible: string;
|
|
@@ -41,7 +41,7 @@ declare const styleArrays: {
|
|
|
41
41
|
}> | Readonly<{
|
|
42
42
|
readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "transparent">;
|
|
43
43
|
readonly cursor: stylex.StyleXClassNameFor<"cursor", "default">;
|
|
44
|
-
readonly display: stylex.StyleXClassNameFor<"display", "
|
|
44
|
+
readonly display: stylex.StyleXClassNameFor<"display", "flex" | "none">;
|
|
45
45
|
}>)[];
|
|
46
46
|
item: Readonly<{
|
|
47
47
|
readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
|
package/es/Button/style.mjs
CHANGED
|
@@ -6,20 +6,20 @@ const buttonPaddingInline = {
|
|
|
6
6
|
middle: 14,
|
|
7
7
|
small: 8
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
23
|
const styles = {
|
|
24
24
|
base: {
|
|
25
25
|
kVAM5u: "lbqnr5ac",
|
package/es/CodeDiff/theme.mjs
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { cssVar } from "../styles/stylex/cssVar.stylex.mjs";
|
|
2
|
+
import lobeHighlightsTheme from "../Highlighter/theme/lobe-highlights-theme.mjs";
|
|
2
3
|
import lobe_theme_default from "../Highlighter/theme/lobe-theme.mjs";
|
|
3
4
|
import { registerCustomTheme, resolveTheme } from "@pierre/diffs";
|
|
4
5
|
// src/CodeDiff/theme.ts
|
|
5
6
|
let isLobeDiffThemeRegistered = false;
|
|
6
7
|
const registerLobeDiffThemes = () => {
|
|
7
8
|
if (isLobeDiffThemeRegistered) return;
|
|
9
|
+
registerCustomTheme("lobe-theme", () => Promise.resolve(lobeHighlightsTheme), "zed");
|
|
8
10
|
registerCustomTheme("lobe-theme", () => Promise.resolve(lobe_theme_default));
|
|
9
|
-
resolveTheme("lobe-theme");
|
|
11
|
+
resolveTheme("lobe-theme", "highlights");
|
|
10
12
|
isLobeDiffThemeRegistered = true;
|
|
11
13
|
};
|
|
12
14
|
const customSeparatorCSS = `
|
|
@@ -43,6 +45,7 @@ const getLobeDiffOptions = ({ diffOptions, isDarkMode, viewMode }) => ({
|
|
|
43
45
|
themeType: isDarkMode ? "dark" : "light",
|
|
44
46
|
diffStyle: viewMode,
|
|
45
47
|
disableFileHeader: true,
|
|
48
|
+
preferredHighlighter: "highlights",
|
|
46
49
|
unsafeCSS: customSeparatorCSS,
|
|
47
50
|
...diffOptions
|
|
48
51
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.mjs","names":["lobeTheme"],"sources":["../../src/CodeDiff/theme.ts"],"sourcesContent":["import type { FileDiffOptions } from '@pierre/diffs';\nimport { registerCustomTheme, resolveTheme } from '@pierre/diffs';\n\nimport lobeTheme from '@/Highlighter/theme/lobe-theme';\nimport { cssVar } from '@/styles/stylex/cssVar.stylex';\n\nimport type { DiffViewMode } from './type';\n\nlet isLobeDiffThemeRegistered = false;\n\nexport const registerLobeDiffThemes = () => {\n if (isLobeDiffThemeRegistered) return;\n\n registerCustomTheme('lobe-theme', () => Promise.resolve(lobeTheme as any));\n void resolveTheme('lobe-theme');\n\n isLobeDiffThemeRegistered = true;\n};\n\nconst customSeparatorCSS = `\n :host {\n --diffs-dark-bg: transparent !important;\n --diffs-light-bg: transparent !important;\n --diffs-gap-fallback: 8px;\n --diffs-added-light: ${cssVar.colorSuccessHover};\n --diffs-added-dark: ${cssVar.colorSuccessBorderHover};\n --diffs-modified-light: ${cssVar.colorInfoHover};\n --diffs-modified-dark: ${cssVar.colorInfoBorderHover};\n --diffs-deleted-light: ${cssVar.colorErrorHover};\n --diffs-deleted-dark: ${cssVar.colorErrorBorderHover};\n }\n\n [data-gutter-buffer] {\n opacity: 0.2 !important;\n }\n\n [data-code] {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n }\n\n [data-gutter] {\n backdrop-filter: blur(16px) !important;\n }\n`;\n\nexport const getLobeDiffOptions = ({\n diffOptions,\n isDarkMode,\n viewMode,\n}: {\n diffOptions?: FileDiffOptions<string, undefined>;\n isDarkMode: boolean;\n viewMode: DiffViewMode;\n}): FileDiffOptions<string, undefined> => ({\n theme: {\n dark: 'lobe-theme',\n light: 'lobe-theme',\n },\n themeType: isDarkMode ? 'dark' : 'light',\n diffStyle: viewMode,\n disableFileHeader: true,\n unsafeCSS: customSeparatorCSS,\n ...diffOptions,\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"theme.mjs","names":["lobeTheme"],"sources":["../../src/CodeDiff/theme.ts"],"sourcesContent":["import type { FileDiffOptions } from '@pierre/diffs';\nimport { registerCustomTheme, resolveTheme } from '@pierre/diffs';\n\nimport lobeHighlightsTheme from '@/Highlighter/theme/lobe-highlights-theme';\nimport lobeTheme from '@/Highlighter/theme/lobe-theme';\nimport { cssVar } from '@/styles/stylex/cssVar.stylex';\n\nimport type { DiffViewMode } from './type';\n\nlet isLobeDiffThemeRegistered = false;\n\nexport const registerLobeDiffThemes = () => {\n if (isLobeDiffThemeRegistered) return;\n\n registerCustomTheme('lobe-theme', () => Promise.resolve(lobeHighlightsTheme), 'zed');\n registerCustomTheme('lobe-theme', () => Promise.resolve(lobeTheme as any));\n // Without an explicit backend, resolveTheme falls back to shiki and pulls shiki/core in eagerly.\n void resolveTheme('lobe-theme', 'highlights');\n\n isLobeDiffThemeRegistered = true;\n};\n\nconst customSeparatorCSS = `\n :host {\n --diffs-dark-bg: transparent !important;\n --diffs-light-bg: transparent !important;\n --diffs-gap-fallback: 8px;\n --diffs-added-light: ${cssVar.colorSuccessHover};\n --diffs-added-dark: ${cssVar.colorSuccessBorderHover};\n --diffs-modified-light: ${cssVar.colorInfoHover};\n --diffs-modified-dark: ${cssVar.colorInfoBorderHover};\n --diffs-deleted-light: ${cssVar.colorErrorHover};\n --diffs-deleted-dark: ${cssVar.colorErrorBorderHover};\n }\n\n [data-gutter-buffer] {\n opacity: 0.2 !important;\n }\n\n [data-code] {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n }\n\n [data-gutter] {\n backdrop-filter: blur(16px) !important;\n }\n`;\n\nexport const getLobeDiffOptions = ({\n diffOptions,\n isDarkMode,\n viewMode,\n}: {\n diffOptions?: FileDiffOptions<string, undefined>;\n isDarkMode: boolean;\n viewMode: DiffViewMode;\n}): FileDiffOptions<string, undefined> => ({\n theme: {\n dark: 'lobe-theme',\n light: 'lobe-theme',\n },\n themeType: isDarkMode ? 'dark' : 'light',\n diffStyle: viewMode,\n disableFileHeader: true,\n preferredHighlighter: 'highlights',\n unsafeCSS: customSeparatorCSS,\n ...diffOptions,\n});\n"],"mappings":";;;;;AASA,IAAI,4BAA4B;AAEhC,MAAa,+BAA+B;CAC1C,IAAI,2BAA2B;CAE/B,oBAAoB,oBAAoB,QAAQ,QAAQ,mBAAmB,GAAG,KAAK;CACnF,oBAAoB,oBAAoB,QAAQ,QAAQA,kBAAgB,CAAC;CAEzE,aAAkB,cAAc,YAAY;CAE5C,4BAA4B;AAC9B;AAEA,MAAM,qBAAqB;;;;;2BAKA,OAAO,kBAAkB;0BAC1B,OAAO,wBAAwB;8BAC3B,OAAO,eAAe;6BACvB,OAAO,qBAAqB;6BAC5B,OAAO,gBAAgB;4BACxB,OAAO,sBAAsB;;;;;;;;;;;;;;;;AAiBzD,MAAa,sBAAsB,EACjC,aACA,YACA,gBAKyC;CACzC,OAAO;EACL,MAAM;EACN,OAAO;CACT;CACA,WAAW,aAAa,SAAS;CACjC,WAAW;CACX,mBAAmB;CACnB,sBAAsB;CACtB,WAAW;CACX,GAAG;AACL"}
|
package/es/ColorPicker/style.mjs
CHANGED
package/es/Image/style.mjs
CHANGED
package/es/Input/style.mjs
CHANGED
|
@@ -3,9 +3,9 @@ import { cssVar } from "../styles/stylex/cssVar.stylex.mjs";
|
|
|
3
3
|
import { inputMarker } from "./marker.stylex.mjs";
|
|
4
4
|
import * as stylex from "@stylexjs/stylex";
|
|
5
5
|
// src/Input/style.ts
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
9
|
const styles = {
|
|
10
10
|
borderless: {
|
|
11
11
|
kVAM5u: "lb9r1u3d lb11xq1n2",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { visit } from "../../node_modules/.pnpm/unist-util-visit@5.
|
|
1
|
+
import { visit } from "../../node_modules/.pnpm/unist-util-visit@5.2.0/node_modules/unist-util-visit/lib/index.mjs";
|
|
2
2
|
// src/Markdown/plugins/rehypeCustomFootnotes.ts
|
|
3
3
|
const rehypeCustomFootnotes = () => (tree, file) => {
|
|
4
4
|
const linksData = file.data.footnoteLinks || {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { visit } from "../../node_modules/.pnpm/unist-util-visit@5.
|
|
1
|
+
import { visit } from "../../node_modules/.pnpm/unist-util-visit@5.2.0/node_modules/unist-util-visit/lib/index.mjs";
|
|
2
2
|
// src/Markdown/plugins/rehypeKatexDir.ts
|
|
3
3
|
const rehypeKatexDir = () => (tree) => {
|
|
4
4
|
visit(tree, "element", (node) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { visit } from "../../node_modules/.pnpm/unist-util-visit@5.
|
|
1
|
+
import { visit } from "../../node_modules/.pnpm/unist-util-visit@5.2.0/node_modules/unist-util-visit/lib/index.mjs";
|
|
2
2
|
// src/Markdown/plugins/remarkBr.ts
|
|
3
3
|
/**
|
|
4
4
|
* Remark plugin to handle <br> and <br/> tags in markdown text
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { visit } from "../../node_modules/.pnpm/unist-util-visit@5.
|
|
1
|
+
import { visit } from "../../node_modules/.pnpm/unist-util-visit@5.2.0/node_modules/unist-util-visit/lib/index.mjs";
|
|
2
2
|
import { gfmAutolinkLiteralFromMarkdown } from "mdast-util-gfm-autolink-literal";
|
|
3
3
|
// src/Markdown/plugins/remarkCjkAutolink.ts
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { visit } from "../../node_modules/.pnpm/unist-util-visit@5.
|
|
1
|
+
import { visit } from "../../node_modules/.pnpm/unist-util-visit@5.2.0/node_modules/unist-util-visit/lib/index.mjs";
|
|
2
2
|
// src/Markdown/plugins/remarkColor.ts
|
|
3
3
|
/**
|
|
4
4
|
* Remark plugin to handle color syntax in markdown code spans
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SKIP, visit } from "../../node_modules/.pnpm/unist-util-visit@5.
|
|
1
|
+
import { SKIP, visit } from "../../node_modules/.pnpm/unist-util-visit@5.2.0/node_modules/unist-util-visit/lib/index.mjs";
|
|
2
2
|
// src/Markdown/plugins/remarkCustomFootnotes.ts
|
|
3
3
|
const remarkCustomFootnotes = () => (tree, file) => {
|
|
4
4
|
const footnoteLinks = /* @__PURE__ */ new Map();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { visit } from "../../node_modules/.pnpm/unist-util-visit@5.
|
|
1
|
+
import { visit } from "../../node_modules/.pnpm/unist-util-visit@5.2.0/node_modules/unist-util-visit/lib/index.mjs";
|
|
2
2
|
// src/Markdown/plugins/remarkGfmPlus.ts
|
|
3
3
|
const DEFAULT_ALLOW_HTML_TAGS = [
|
|
4
4
|
"sub",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { visit } from "../../node_modules/.pnpm/unist-util-visit@5.
|
|
1
|
+
import { visit } from "../../node_modules/.pnpm/unist-util-visit@5.2.0/node_modules/unist-util-visit/lib/index.mjs";
|
|
2
2
|
// src/Markdown/plugins/remarkVideo.ts
|
|
3
3
|
/**
|
|
4
4
|
* Remark plugin to handle <video> tags in markdown text
|
package/es/Select/style.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { cssVar } from "../styles/stylex/cssVar.stylex.mjs";
|
|
|
2
2
|
import { focusRing } from "../styles/stylex/focusRing.mjs";
|
|
3
3
|
import { selectMarker } from "./marker.stylex.mjs";
|
|
4
4
|
// src/Select/style.ts
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
const styles = {
|
|
7
7
|
arrow: {
|
|
8
8
|
k1xSpc: "lb78zum5",
|
package/es/Slider/style.mjs
CHANGED
package/es/Text/style.d.mts
CHANGED
|
@@ -14,12 +14,12 @@ export declare const textStyles: {
|
|
|
14
14
|
disabled: string;
|
|
15
15
|
danger: string;
|
|
16
16
|
success: string;
|
|
17
|
+
info: string;
|
|
18
|
+
warning: string;
|
|
17
19
|
delete: string;
|
|
18
20
|
ellipsis: string;
|
|
19
21
|
italic: string;
|
|
20
22
|
underline: string;
|
|
21
|
-
info: string;
|
|
22
|
-
warning: string;
|
|
23
23
|
ellipsisMulti: string;
|
|
24
24
|
secondary: string;
|
|
25
25
|
};
|
package/es/index.d.mts
CHANGED
|
@@ -413,6 +413,7 @@ import UploadDragger from "./Upload/UploadDragger.mjs";
|
|
|
413
413
|
import "./Upload/index.mjs";
|
|
414
414
|
import { copyToClipboard } from "./utils/copyToClipboard.mjs";
|
|
415
415
|
import { preventDefault, preventDefaultAndStopPropagation, stopPropagation } from "./utils/dom.mjs";
|
|
416
|
+
import lobeHighlightsTheme from "./Highlighter/theme/lobe-highlights-theme.mjs";
|
|
416
417
|
import _default$5 from "./Highlighter/theme/lobe-theme.mjs";
|
|
417
418
|
import FormDivider from "./Form/components/FormDivider.mjs";
|
|
418
419
|
import FormField from "./Form/components/FormField.mjs";
|
|
@@ -425,4 +426,4 @@ import { useFormContext } from "./Form/context.mjs";
|
|
|
425
426
|
import { Form } from "./Form/index.mjs";
|
|
426
427
|
import { rehypeStreamAnimated } from "@lobehub/streamdown";
|
|
427
428
|
import { ErrorBoundary, ErrorBoundaryProps } from "react-error-boundary";
|
|
428
|
-
export { A, AGENT_AVATAR_COLORS, AGENT_AVATAR_SHAPES, AGENT_AVATAR_STATES, type AProps, Accordion, type AccordionClassNames, AccordionHeader, type AccordionHeaderProps, type AccordionIndicatorPlacement, AccordionItem, type AccordionItemProps, type AccordionItemType, AccordionPanel, type AccordionPanelProps, type AccordionProps, AccordionRoot, type AccordionRootProps, type AccordionStyles, AccordionTrigger, type AccordionTriggerProps, type AccordionVariant, ActionIcon, type ActionIconClassNames, ActionIconGroup, type ActionIconGroupEvent, type MenuItemType as ActionIconGroupItemType, type ActionIconGroupProps, type ActionIconOutdent, type ActionIconProps, type ActionIconSize, type ActionIconStyles, type ActionIconVariant, AgentAvatar, type AgentAvatarClassNames, type AgentAvatarColor, type AgentAvatarProps, type AgentAvatarShape, type AgentAvatarState, type AgentAvatarStyles, Alert, type AlertClassNames, type AlertCloseConfig, type AlertProps, type AlertRef, type AlertStyles, type AlertType, type AlertVariant, Anchor, type AnchorItem, type AnchorProps, AutoComplete, type AutoCompleteOption, type AutoCompleteProps, Avatar, type AvatarClassNames, type AvatarFallbackVariant, type AvatarGeneratedFallbackVariant, AvatarGroup, type AvatarGroupItemType, type AvatarGroupProps, type AvatarProps, type AvatarStyles, Badge, type BadgeProps, type BadgeSize, type BadgeStatus, type BaseMenuItemGroupType, type BaseMenuItemType, type BaseModalProps, type BaseSubMenuType, Block, type BlockProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Burger, type BurgerProps, Button, type ButtonIconPosition, type ButtonOutdent, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonType, type CDN, CLASSNAMES, type CalendarMode, Carousel, type CarouselProps, type CarouselRef, type CellRender, type CellRenderInfo, Center, type CenterProps, _default as Checkbox, CheckboxGroup, type CheckboxGroupOption, type CheckboxGroupProps, type CheckboxProps, type CheckboxShape, CodeDiff, type CodeDiffProps, CodeEditor, type CodeEditorProps, Collapsible, type CollapsibleProps, type ColorPalettes, type ColorPalettesAlpha, ColorPicker, type ColorPickerProps, ColorSwatches, type ColorSwatchesProps, type ColorToken, type Config, ConfigProvider, type ConfigProviderProps, type ContextMenuCheckboxItem, ContextMenuHost, type ContextMenuInterceptor, type ContextMenuItem, ContextMenuTrigger, type ControlSize, CopyButton, type CopyButtonProps, type CreateLobeTokenParams, type CustomNeutralColor, type CustomPrimaryColor, DatePicker, type DatePickerBaseProps, type DatePickerProps, type DatePickerSemanticType, type DatePickerType, DateRangePicker, type DateRangePickerProps, type DateRangeValue, DayjsDatePicker, type DayjsDatePickerProps, type DayjsDatePickerType, DayjsDateRangePicker, type DayjsDateRangePickerProps, type DayjsDateRangeValue, Descriptions, type DescriptionsItem, type DescriptionsProps, type DiffViewMode, type Direction, type DistributiveOmit, type DivProps, Divider, type DividerOrientation, type DividerProps, DownloadButton, type DownloadButtonProps, DraggablePanel, DraggablePanelBody, type DraggablePanelBodyProps, DraggablePanelContainer, type DraggablePanelContainerProps, DraggablePanelContent, type DraggablePanelContentProps, DraggablePanelFooter, type DraggablePanelFooterProps, DraggablePanelHandle, type DraggablePanelHandleProps, DraggablePanelHeader, type DraggablePanelHeaderProps, type DraggablePanelPlacement, type DraggablePanelProps, DraggablePanelRoot, type DraggablePanelRootProps, type DraggablePanelSize, DraggablePanelToggle, type DraggablePanelToggleProps, DraggableSideNav, type DraggableSideNavProps, Drawer, DrawerBackdrop, type DrawerBackdropProps, DrawerClose, type DrawerCloseProps, DrawerContent, type DrawerContentProps, DrawerDescription, type DrawerDescriptionProps, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, type DrawerPlacement, DrawerPopup, type DrawerPopupProps, DrawerPortal, type DrawerPortalProps, type DrawerProps, type DrawerPush, DrawerRoot, type DrawerRootProps, type DrawerSemanticNames, type DrawerSemanticStyles, DrawerTitle, type DrawerTitleProps, DrawerTrigger, type DrawerTriggerProps, type DropdownItem, DropdownMenu, type DropdownMenuCheckboxItem, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, type DropdownMenuCheckboxItemProps, DropdownMenuFooter, type DropdownMenuFooterProps, DropdownMenuGroup, DropdownMenuGroupLabel, type DropdownMenuGroupLabelProps, DropdownMenuHeader, type DropdownMenuHeaderProps, DropdownMenuItem, DropdownMenuItemContent, type DropdownMenuItemContentProps, DropdownMenuItemDesc, type DropdownMenuItemDescProps, DropdownMenuItemExtra, type DropdownMenuItemExtraProps, DropdownMenuItemIcon, type DropdownMenuItemIconProps, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, type DropdownMenuItemLabelGroupProps, type DropdownMenuItemLabelProps, type DropdownMenuItemProps, type DropdownMenuPlacement, DropdownMenuPopup, type DropdownMenuPopupProps, DropdownMenuPortal, type DropdownMenuPortalProps, DropdownMenuPositioner, type DropdownMenuPositionerProps, type DropdownMenuProps, DropdownMenuRoot, DropdownMenuScrollViewport, type DropdownMenuScrollViewportProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuSubmenuArrow, type DropdownMenuSubmenuArrowProps, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, type DropdownMenuSubmenuTriggerProps, DropdownMenuSwitchItem, type DropdownMenuSwitchItemProps, type DropdownMenuSwitchItem$1 as DropdownMenuSwitchItemType, DropdownMenuTrigger, type DropdownMenuTriggerProps, EditableText, type EditableTextProps, EditorSlashMenu, type EditorSlashMenuGroup, type EditorSlashMenuItems, type EditorSlashMenuOption, EmojiPicker, type EmojiPickerProps, Empty, type EmptyProps, ErrorBoundary, type ErrorBoundaryProps, FileTypeIcon, type FileTypeIconProps, type FilterValue, _default$1 as FlexBasic, type FlexBasicProps, _default$1 as Flexbox, type FlexboxProps, type FloatingCollisionPadding, FloatingPanel, type FloatingPanelOffset, type FloatingPanelPlacement, type FloatingPanelProps, FloatingSheet, type FloatingSheetProps, FluentEmoji, type FluentEmojiProps, FocusScope, type FocusScopeProps, FontLoader, type FontLoaderProps, Form, type FormContextValue, FormDivider, type FormDividerProps, FormField, type FormFieldProps, FormFlatGroup, type FormFlatGroupProps, FormFooter, type FormFooterProps, FormGroup, type FormGroupItemType, type FormGroupProps, type FormLayout, type FormProps, FormSubmitFooter, type FormSubmitFooterProps, FormTitle, type FormTitleProps, type FormValues, type FormVariant, Freeze, type FreezeProps, type GenerateConfig, type GeneratedDatePicker, type GenericItemType, type GenericTimePickerProps, Grid, type GridProps, GroupAvatar, type GroupAvatarProps, GuideCard, type GuideCardProps, DEFAULT_HEIGHT as HTML_PREVIEW_DEFAULT_HEIGHT, DEFAULT_SANDBOX as HTML_PREVIEW_DEFAULT_SANDBOX, AUTO_HEIGHT_MESSAGE_TYPE as HTML_PREVIEW_RESIZE_MESSAGE, Header, type HeaderProps, Highlighter, type HighlighterProps, Hotkey, HotkeyInput, type HotkeyInputProps, type HotkeyProps, HtmlPreview, HtmlPreviewIframe, type HtmlPreviewIframeProps, type HtmlPreviewMode, type HtmlPreviewProps, type HtmlPreviewStreamingMode, I18nProvider, type I18nProviderProps, Icon, type IconAlign, type IconProps, IconProvider, type IconSize, type IconSpaceMode, Image, type ImagePreviewOptions, type ImageProps, ImageSelect, type ImageSelectItem, type ImageSelectProps, type ImgProps, type ImperativeModalProps, _default$2 as Input, type InputClassNames, _default$3 as InputNumber, type InputNumberProps, InputOTP, type InputOTPProps, _default$4 as InputPassword, type InputPasswordProps, type InputPasswordVisibilityToggleLabels, type InputProps, type InputSize, type InputStyles, type InputVariant, type ItemType, type ItemsType, KeyMapEnum, LOBE_THEME_APP_ID, Layout, LayoutFooter, type LayoutFooterProps, LayoutHeader, type LayoutHeaderProps, LayoutMain, type LayoutMainProps, type LayoutProps, LayoutSidebar, LayoutSidebarInner, type LayoutSidebarInnerProps, type LayoutSidebarProps, LayoutToc, type LayoutTocProps, type LegacyDateInput, List, type ListClickInfo, type ListDividerType, type ListItem, type ListItemType, type ListProps, type ListSemanticName, type LobeAppearance, type LobeCssVar, type LobeCustomStylish, type LobeCustomToken, type LobeNeutralColor, type LobeNeutralScale, type LobePrimaryColor, type LobeStatusPalette, type LobeTheme, LobeThemeScript, type LobeThemeScriptProps, type LobeThemeState, type LobeToken, I18nProvider as LobeUIProvider, Markdown, type MarkdownProps, MaskShadow, type MaskShadowProps, MaterialFileTypeIcon, type MaterialFileTypeIconProps, type MenuCheckboxItemType, type MenuDividerType, type MenuInfo, type MenuItemGroupType, type MenuItemType, type MenuSwitchItemType, Mermaid, type MermaidProps, Modal, ModalBackdrop, type ModalBackdropProps, ModalClose, type ModalCloseProps, type ModalComponentProps, type ModalConfirmConfig, ModalContent, type ModalContentProps, ModalContext, type ModalContextValue, ModalDescription, type ModalDescriptionProps, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, ModalHost, type ModalHostProps, type ModalInstance, ModalPopup, type ModalPopupProps, ModalPortal, type ModalPortalProps, ModalRoot, type ModalRootProps, type ModalSystem, ModalTitle, type ModalTitleProps, ModalTrigger, type ModalTriggerProps, ModalViewport, type ModalViewportProps, type MonthPickerProps, MotionComponent, type MotionComponentType, MotionProvider, NeutralColors, NeutralColorsObj, Pagination, type PaginationAlign, type PaginationItemType, type PaginationProps, type PaginationSemanticName, type PaginationSize, type PaginationSizeChangerProps, type PanelMode, PatchDiff, type PatchDiffProps, type PickerClassNames, type PickerComponents, type PickerDateInput, type PickerDateStrings, type PickerLocale, type PickerLocaleInput, type PickerLocaleLang, type PickerMode, type PickerPanelProps, type PickerPlacement, type PickerPopupSemanticName, type PickerProps, type PickerPropsWithMultiple, type PickerRef, type PickerSemanticClassNames, type PickerSemanticName, type PickerSemanticStyles, type PickerSize, type PickerStatus, type PickerStyles, type PickerTagProps, type PickerValueInput, type PickerVariant, type Placement, type PlacementConfig, Popover, PopoverArrow, type PopoverArrowAtomProps, PopoverArrowIcon, PopoverBackdrop, type PopoverBackdropProps, type PopoverContextValue, PopoverGroup, type PopoverGroupHandle, type PopoverGroupItem, type PopoverPlacement, PopoverPopup, type PopoverPopupAtomProps, type PopoverPopupProps, PopoverPortal, type PopoverPortalAtomProps, type PopoverPortalProps, PopoverPositioner, type PopoverPositionerAtomProps, type PopoverPositionerProps, type PopoverProps, PopoverProvider, PopoverRoot, type PopoverTrigger, type PopoverTriggerComponentProps, PopoverTriggerElement, type PopoverTriggerElementProps, PopoverViewport, type PopoverViewportAtomProps, type PresetColorKey, type PresetColorType, type PresetDate, type PresetPickerProps, type PresetSystemColorKey, type PresetSystemColorType, PreviewGroup, type PreviewGroupProps, PrimaryColors, PrimaryColorsObj, Progress, type ProgressProps, type ProgressSize, type ProgressStatus, type ProgressType, type ProgressVariant, ProgressiveBlur, type ProgressiveBlurClassNames, type ProgressiveBlurMode, type ProgressiveBlurPosition, type ProgressiveBlurProps, type ProgressiveBlurStyles, QRCode, type QRCodeErrorLevel, type QRCodeProps, type QRCodeStatus, type QuarterPickerProps, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, type RangeChangeDates, type RangeChangeStrings, type RangeDisabledDate, type RangeInfo, type RangePickerComponent, type RangePickerProps, type RangePickerRef, Rate, type RateProps, type RenderItemContentOptions, type RenderOptions, type ResponsiveState, Result, type ResultProps, type ResultStatus, ScrollArea, ScrollAreaContent, type ScrollAreaContentProps, ScrollAreaCorner, type ScrollAreaCornerProps, type ScrollAreaProps, ScrollAreaRoot, type ScrollAreaRootProps, ScrollAreaScrollbar, type ScrollAreaScrollbarProps, ScrollAreaThumb, type ScrollAreaThumbProps, ScrollAreaViewport, type ScrollAreaViewportProps, ScrollShadow, type ScrollShadowProps, SearchBar, type SearchBarProps, SearchResultCards, type SearchResultCardsProps, Segmented, type SegmentedClassNames, SegmentedIndicator, type SegmentedIndicatorProps, SegmentedItem, SegmentedItemIcon, SegmentedItemLabel, type SegmentedItemProps, type SegmentedOption, type SegmentedOptions, type SegmentedOrientation, type SegmentedProps, SegmentedRoot, type SegmentedRootProps, type SegmentedSize, type SegmentedStyles, type SegmentedVariant, Select, SelectArrow, type SelectArrowProps, SelectBackdrop, type SelectBehaviorVariant, type SelectClassNames, SelectGroup, SelectGroupLabel, type SelectGroupLabelProps, type SelectGroupProps, SelectIcon, type SelectIconProps, type SelectIndicatorVariant, SelectItem, SelectItemIndicator, type SelectItemIndicatorProps, type SelectItemProps, SelectItemText, type SelectItemTextProps, SelectList, type SelectListProps, type SelectOption, type SelectOptionGroup, type SelectOptions, SelectPopup, type SelectPopupProps, SelectPortal, type SelectPortalProps, SelectPositioner, type SelectPositionerProps, type SelectProps, SelectRoot, type SelectRootChangeEventDetails, SelectScrollDownArrow, type SelectScrollDownArrowProps, SelectScrollUpArrow, type SelectScrollUpArrowProps, SelectSeparator, type SelectSize, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, type SelectVariant, _default$5 as ShikiLobeTheme, SideNav, type SideNavProps, type SinglePickerComponent, Skeleton, type SkeletonAnimation, SkeletonAvatar, type SkeletonAvatarProps, type SkeletonProps, SkeletonText, type SkeletonTextProps, Slider, type SliderProps, SliderWithInput, type SliderWithInputProps, Snippet, type SnippetProps, type SortOrder, SortableList, type SortableListProps, type SpanProps, Spin, type SpinProps, type SpinSize, type SpinVariant, _default$6 as SplitButton, type SplitButtonMenuProps, type SplitButtonProps, type StaticStyleExtract, type StaticStyleUtils, Statistic, type StatisticProps, type StepItem, type StepStatus, Steps, type StepsProps, type SubMenuType, type SvgProps, Switch, type SwitchChangeEventHandler, type SwitchClassNames, type SwitchClickEventHandler, type SwitchContextType, SwitchIcon, type SwitchIconPosition, type SwitchIconProps, type SwitchProps, SwitchRoot, type SwitchRootProps, type SwitchSize, type SwitchStyles, SwitchThumb, type SwitchThumbProps, SyntaxHighlighter, type SyntaxHighlighterProps, SyntaxMermaid, type SyntaxMermaidProps, type SystemColorToken, Table, TableBody, type TableBreakpoint, TableCell, type TableCellAttributes, type TableCellProps, type TableClassNames, TableColGroup, type TableColGroupColumn, type TableColGroupProps, type TableColumn, type TableColumnAlign, type TableColumnEllipsis, type TableColumnFilterItem, type TableColumnFixed, type TableColumnGroupProps, type TableColumnGroupType, type TableColumnProps, type TableColumnSorter, type TableColumnTitle, type TableColumnTitleProps, type TableColumnType, type TableColumnsType, type TableCompareFn, type TableComponents, type TableComponentsSemanticName, TableContainer, type TableCurrentDataSource, type TableCustomizeComponent, type TableDataIndex, TableElement, type TableElementProps, type TableExpandIconProps, type TableExpandableConfig, TableExpandedRow, type TableExpandedRowProps, type TableExpandedRowRender, type TableFilterDropdownPopupProps, type TableFilterDropdownProps, type TableFilters, TableFooter, TableHeader, TableHeaderCell, type TableHeaderCellAttributes, type TableLoadingConfig, type TableLocale, type TableMultipleSorterResult, type TablePaginationConfig, type TablePaginationPlacement, type TablePartProps, type TableProps, type TableRef, type TableRenderedCell, TableRoot, type TableRootProps, TableRow, type TableRowClassName, type TableRowProps, type TableRowSelectMethod, type TableRowSelection, type TableRowSelectionCheckboxProps, type TableRowSelectionType, TableScroll, type TableScrollProps, type TableScrollToConfig, type TableSectionProps, type TableSelectionItem, type TableSelectionPreset, type TableSemanticInfo, type TableSemanticName, type TableSize, type TableSorterResult, type TableSorterTooltipProps, type TableSticky, type TableStyles, type TableSummaryCellProps, TableSummaryFoot, type TableSummaryProps, type TableSummaryRowProps, TableTitle, type TableVariant, Tabs, type TabsClassNames, TabsIndicator, type TabsIndicatorProps, type TabsItem, TabsList, type TabsListProps, type TabsOrientation, TabsPanel, type TabsPanelProps, type TabsProps, TabsRoot, type TabsRootProps, type TabsSize, type TabsStyles, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagClassNames, type TagProps, type TagShape, type TagSize, type TagStyles, type TagVariant, Text, _default$7 as TextArea, type TextAreaAutoSize, type TextAreaProps, type TextClassNames, type TextProps, type TextStyles, ThemeScope, type ThemeScopeProps, type TimePickerLocale, type TimePickerProps, type ToastAPI, ToastHost, type ToastHostProps, type ToastInstance, type ToastOptions, type ToastPosition, type ToastPromiseOptions, type ToastProps, type ToastType, ToggleGroup, type ToggleGroupClassNames, ToggleGroupItem, ToggleGroupItemIcon, ToggleGroupItemLabel, type ToggleGroupItemProps, type ToggleGroupOption, type ToggleGroupProps, ToggleGroupRoot, type ToggleGroupRootProps, type ToggleGroupSize, type ToggleGroupStyles, type ToggleGroupVariant, Tooltip, TooltipGroup, type TooltipGroupProps, type TooltipPlacement, type TooltipPopupComponentProps, type TooltipPortalProps, type TooltipPositionerProps, type TooltipProps, type TooltipTriggerComponentProps, Tree, type TreeClassNames, type TreeDataNode, type TreeFlatRow, type TreeProps, type TreeStyles, type Trigger, Typography, type TypographyProps, Upload, type UploadChangeInfo, UploadDragger, type UploadProps, type UseImagePreviewResult, type UseScopeArrowNavOptions, type UseScopeSwitcherOptions, Video, type VideoMarker, type VideoPlayer, type VideoProps, type VideoSection, type VideoState, type VirtualListProps, type WeekPickerProps, type YearPickerProps, accordionStyles, actionIconStyles, alertStyles, styles as autoCompleteStyles, backdropTransition, buttonPaddingInline, buttonStyles, checkboxStyles, closeContextMenu, colorsPreset, colorsPresetSystem, combineKeys, conductCheck, confirmModal, controlHeight, copyToClipboard, createGlobalStyle, createLobeToken, createModal, createModalSystem, createPickerLocale, createStaticStyles, css, cssVar, cx, datePickerLocaleEnUS, datePickerLocaleZhCN, drawerBackdropTransition, extractStaticStyle, findCustomThemeName, flattenVisible, focusScopeItem, styles$1 as focusScopeStyles, formatStatisticValue, genCdnUrl, generateColorNeutralPalette, generateColorPalette, generateNeutralScale, generatePicker, getActiveScopeId, getAgentAvatarTraits, getAllKeys, getCustomNeutralCss, getCustomPaletteCss, getCustomPrimaryCss, getDrawerMotionConfig, getFloatingCollisionPadding, getGlobalCss, getItemKey, getItemLabel, getLastFocusedItem, getThemeCss, hasAnyIcon, hasCheckboxAndIcon, highlighterThemes, containsScript as htmlPreviewContainsScript, injectGlobal, inputClassNames as inputStyles, rootVariants as inputVariants, installGlobalFocusRing, isCustomNeutralColor, isCustomPrimaryColor, isFullHtmlDocument, isHtmlContentClosed, keyframes, staticStylish as lobeStaticStylish, styles$2 as menuSharedStyles, mermaidThemes, modalMotionConfig, neutralColors, neutralColorsSwatches, notifyScopeItemFocus, parseTrigger, placementMap, preprocessMarkdownContent, presetColors, presetSystemColors, preventDefault, preventDefaultAndStopPropagation, primaryColors, primaryColorsSwatches, radioStyles, registerLobeNeutral, registerLobePalette, registerScope, rehypeCustomFootnotes, rehypeKatexDir, rehypeStreamAnimated, remarkBr, remarkColor, remarkCustomFootnotes, remarkGfmPlus, remarkVideo, renderDropdownMenuItems, renderIcon, responsive, setActiveScope, setContextMenuInterceptor, setFloatingCollisionPadding, setLastFocusedItem, setLobeTheme, showContextMenu, sliderStyles, stopPropagation, switchStyles, tabsStyles, groupStyles as textGroupStyles, textStyles, variants as textVariants, toFloatingUIPlacement, toast, toggleGroupStyles, styles$3 as treeStyles, updateContextMenuItems, useAccordionContext, useActiveScopeId, useAppElement, useCdnFn, useDirection, useDraggablePanelContext, useDrawerActions, useDrawerOpen, useFocusScopeActive, useFocusScopeId, useFormContext, useImagePreview, useModalActions, useModalContext, useModalOpen, useMotionComponent, usePopoverContext, usePopoverGroupHandle, usePopoverPortalContainer, useResponsive, useScopeArrowNav, useScopeSwitcher, useSwitchContext, useTabsContext, useTheme, useThemeMode, useToast, useTranslation, useVideo, useVideoPlayer, useVideoState };
|
|
429
|
+
export { A, AGENT_AVATAR_COLORS, AGENT_AVATAR_SHAPES, AGENT_AVATAR_STATES, type AProps, Accordion, type AccordionClassNames, AccordionHeader, type AccordionHeaderProps, type AccordionIndicatorPlacement, AccordionItem, type AccordionItemProps, type AccordionItemType, AccordionPanel, type AccordionPanelProps, type AccordionProps, AccordionRoot, type AccordionRootProps, type AccordionStyles, AccordionTrigger, type AccordionTriggerProps, type AccordionVariant, ActionIcon, type ActionIconClassNames, ActionIconGroup, type ActionIconGroupEvent, type MenuItemType as ActionIconGroupItemType, type ActionIconGroupProps, type ActionIconOutdent, type ActionIconProps, type ActionIconSize, type ActionIconStyles, type ActionIconVariant, AgentAvatar, type AgentAvatarClassNames, type AgentAvatarColor, type AgentAvatarProps, type AgentAvatarShape, type AgentAvatarState, type AgentAvatarStyles, Alert, type AlertClassNames, type AlertCloseConfig, type AlertProps, type AlertRef, type AlertStyles, type AlertType, type AlertVariant, Anchor, type AnchorItem, type AnchorProps, AutoComplete, type AutoCompleteOption, type AutoCompleteProps, Avatar, type AvatarClassNames, type AvatarFallbackVariant, type AvatarGeneratedFallbackVariant, AvatarGroup, type AvatarGroupItemType, type AvatarGroupProps, type AvatarProps, type AvatarStyles, Badge, type BadgeProps, type BadgeSize, type BadgeStatus, type BaseMenuItemGroupType, type BaseMenuItemType, type BaseModalProps, type BaseSubMenuType, Block, type BlockProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Burger, type BurgerProps, Button, type ButtonIconPosition, type ButtonOutdent, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonType, type CDN, CLASSNAMES, type CalendarMode, Carousel, type CarouselProps, type CarouselRef, type CellRender, type CellRenderInfo, Center, type CenterProps, _default as Checkbox, CheckboxGroup, type CheckboxGroupOption, type CheckboxGroupProps, type CheckboxProps, type CheckboxShape, CodeDiff, type CodeDiffProps, CodeEditor, type CodeEditorProps, Collapsible, type CollapsibleProps, type ColorPalettes, type ColorPalettesAlpha, ColorPicker, type ColorPickerProps, ColorSwatches, type ColorSwatchesProps, type ColorToken, type Config, ConfigProvider, type ConfigProviderProps, type ContextMenuCheckboxItem, ContextMenuHost, type ContextMenuInterceptor, type ContextMenuItem, ContextMenuTrigger, type ControlSize, CopyButton, type CopyButtonProps, type CreateLobeTokenParams, type CustomNeutralColor, type CustomPrimaryColor, DatePicker, type DatePickerBaseProps, type DatePickerProps, type DatePickerSemanticType, type DatePickerType, DateRangePicker, type DateRangePickerProps, type DateRangeValue, DayjsDatePicker, type DayjsDatePickerProps, type DayjsDatePickerType, DayjsDateRangePicker, type DayjsDateRangePickerProps, type DayjsDateRangeValue, Descriptions, type DescriptionsItem, type DescriptionsProps, type DiffViewMode, type Direction, type DistributiveOmit, type DivProps, Divider, type DividerOrientation, type DividerProps, DownloadButton, type DownloadButtonProps, DraggablePanel, DraggablePanelBody, type DraggablePanelBodyProps, DraggablePanelContainer, type DraggablePanelContainerProps, DraggablePanelContent, type DraggablePanelContentProps, DraggablePanelFooter, type DraggablePanelFooterProps, DraggablePanelHandle, type DraggablePanelHandleProps, DraggablePanelHeader, type DraggablePanelHeaderProps, type DraggablePanelPlacement, type DraggablePanelProps, DraggablePanelRoot, type DraggablePanelRootProps, type DraggablePanelSize, DraggablePanelToggle, type DraggablePanelToggleProps, DraggableSideNav, type DraggableSideNavProps, Drawer, DrawerBackdrop, type DrawerBackdropProps, DrawerClose, type DrawerCloseProps, DrawerContent, type DrawerContentProps, DrawerDescription, type DrawerDescriptionProps, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, type DrawerPlacement, DrawerPopup, type DrawerPopupProps, DrawerPortal, type DrawerPortalProps, type DrawerProps, type DrawerPush, DrawerRoot, type DrawerRootProps, type DrawerSemanticNames, type DrawerSemanticStyles, DrawerTitle, type DrawerTitleProps, DrawerTrigger, type DrawerTriggerProps, type DropdownItem, DropdownMenu, type DropdownMenuCheckboxItem, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, type DropdownMenuCheckboxItemProps, DropdownMenuFooter, type DropdownMenuFooterProps, DropdownMenuGroup, DropdownMenuGroupLabel, type DropdownMenuGroupLabelProps, DropdownMenuHeader, type DropdownMenuHeaderProps, DropdownMenuItem, DropdownMenuItemContent, type DropdownMenuItemContentProps, DropdownMenuItemDesc, type DropdownMenuItemDescProps, DropdownMenuItemExtra, type DropdownMenuItemExtraProps, DropdownMenuItemIcon, type DropdownMenuItemIconProps, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, type DropdownMenuItemLabelGroupProps, type DropdownMenuItemLabelProps, type DropdownMenuItemProps, type DropdownMenuPlacement, DropdownMenuPopup, type DropdownMenuPopupProps, DropdownMenuPortal, type DropdownMenuPortalProps, DropdownMenuPositioner, type DropdownMenuPositionerProps, type DropdownMenuProps, DropdownMenuRoot, DropdownMenuScrollViewport, type DropdownMenuScrollViewportProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuSubmenuArrow, type DropdownMenuSubmenuArrowProps, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, type DropdownMenuSubmenuTriggerProps, DropdownMenuSwitchItem, type DropdownMenuSwitchItemProps, type DropdownMenuSwitchItem$1 as DropdownMenuSwitchItemType, DropdownMenuTrigger, type DropdownMenuTriggerProps, EditableText, type EditableTextProps, EditorSlashMenu, type EditorSlashMenuGroup, type EditorSlashMenuItems, type EditorSlashMenuOption, EmojiPicker, type EmojiPickerProps, Empty, type EmptyProps, ErrorBoundary, type ErrorBoundaryProps, FileTypeIcon, type FileTypeIconProps, type FilterValue, _default$1 as FlexBasic, type FlexBasicProps, _default$1 as Flexbox, type FlexboxProps, type FloatingCollisionPadding, FloatingPanel, type FloatingPanelOffset, type FloatingPanelPlacement, type FloatingPanelProps, FloatingSheet, type FloatingSheetProps, FluentEmoji, type FluentEmojiProps, FocusScope, type FocusScopeProps, FontLoader, type FontLoaderProps, Form, type FormContextValue, FormDivider, type FormDividerProps, FormField, type FormFieldProps, FormFlatGroup, type FormFlatGroupProps, FormFooter, type FormFooterProps, FormGroup, type FormGroupItemType, type FormGroupProps, type FormLayout, type FormProps, FormSubmitFooter, type FormSubmitFooterProps, FormTitle, type FormTitleProps, type FormValues, type FormVariant, Freeze, type FreezeProps, type GenerateConfig, type GeneratedDatePicker, type GenericItemType, type GenericTimePickerProps, Grid, type GridProps, GroupAvatar, type GroupAvatarProps, GuideCard, type GuideCardProps, DEFAULT_HEIGHT as HTML_PREVIEW_DEFAULT_HEIGHT, DEFAULT_SANDBOX as HTML_PREVIEW_DEFAULT_SANDBOX, AUTO_HEIGHT_MESSAGE_TYPE as HTML_PREVIEW_RESIZE_MESSAGE, Header, type HeaderProps, Highlighter, type HighlighterProps, Hotkey, HotkeyInput, type HotkeyInputProps, type HotkeyProps, HtmlPreview, HtmlPreviewIframe, type HtmlPreviewIframeProps, type HtmlPreviewMode, type HtmlPreviewProps, type HtmlPreviewStreamingMode, I18nProvider, type I18nProviderProps, Icon, type IconAlign, type IconProps, IconProvider, type IconSize, type IconSpaceMode, Image, type ImagePreviewOptions, type ImageProps, ImageSelect, type ImageSelectItem, type ImageSelectProps, type ImgProps, type ImperativeModalProps, _default$2 as Input, type InputClassNames, _default$3 as InputNumber, type InputNumberProps, InputOTP, type InputOTPProps, _default$4 as InputPassword, type InputPasswordProps, type InputPasswordVisibilityToggleLabels, type InputProps, type InputSize, type InputStyles, type InputVariant, type ItemType, type ItemsType, KeyMapEnum, LOBE_THEME_APP_ID, Layout, LayoutFooter, type LayoutFooterProps, LayoutHeader, type LayoutHeaderProps, LayoutMain, type LayoutMainProps, type LayoutProps, LayoutSidebar, LayoutSidebarInner, type LayoutSidebarInnerProps, type LayoutSidebarProps, LayoutToc, type LayoutTocProps, type LegacyDateInput, List, type ListClickInfo, type ListDividerType, type ListItem, type ListItemType, type ListProps, type ListSemanticName, type LobeAppearance, type LobeCssVar, type LobeCustomStylish, type LobeCustomToken, lobeHighlightsTheme as LobeHighlightsTheme, type LobeNeutralColor, type LobeNeutralScale, type LobePrimaryColor, type LobeStatusPalette, type LobeTheme, LobeThemeScript, type LobeThemeScriptProps, type LobeThemeState, type LobeToken, I18nProvider as LobeUIProvider, Markdown, type MarkdownProps, MaskShadow, type MaskShadowProps, MaterialFileTypeIcon, type MaterialFileTypeIconProps, type MenuCheckboxItemType, type MenuDividerType, type MenuInfo, type MenuItemGroupType, type MenuItemType, type MenuSwitchItemType, Mermaid, type MermaidProps, Modal, ModalBackdrop, type ModalBackdropProps, ModalClose, type ModalCloseProps, type ModalComponentProps, type ModalConfirmConfig, ModalContent, type ModalContentProps, ModalContext, type ModalContextValue, ModalDescription, type ModalDescriptionProps, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, ModalHost, type ModalHostProps, type ModalInstance, ModalPopup, type ModalPopupProps, ModalPortal, type ModalPortalProps, ModalRoot, type ModalRootProps, type ModalSystem, ModalTitle, type ModalTitleProps, ModalTrigger, type ModalTriggerProps, ModalViewport, type ModalViewportProps, type MonthPickerProps, MotionComponent, type MotionComponentType, MotionProvider, NeutralColors, NeutralColorsObj, Pagination, type PaginationAlign, type PaginationItemType, type PaginationProps, type PaginationSemanticName, type PaginationSize, type PaginationSizeChangerProps, type PanelMode, PatchDiff, type PatchDiffProps, type PickerClassNames, type PickerComponents, type PickerDateInput, type PickerDateStrings, type PickerLocale, type PickerLocaleInput, type PickerLocaleLang, type PickerMode, type PickerPanelProps, type PickerPlacement, type PickerPopupSemanticName, type PickerProps, type PickerPropsWithMultiple, type PickerRef, type PickerSemanticClassNames, type PickerSemanticName, type PickerSemanticStyles, type PickerSize, type PickerStatus, type PickerStyles, type PickerTagProps, type PickerValueInput, type PickerVariant, type Placement, type PlacementConfig, Popover, PopoverArrow, type PopoverArrowAtomProps, PopoverArrowIcon, PopoverBackdrop, type PopoverBackdropProps, type PopoverContextValue, PopoverGroup, type PopoverGroupHandle, type PopoverGroupItem, type PopoverPlacement, PopoverPopup, type PopoverPopupAtomProps, type PopoverPopupProps, PopoverPortal, type PopoverPortalAtomProps, type PopoverPortalProps, PopoverPositioner, type PopoverPositionerAtomProps, type PopoverPositionerProps, type PopoverProps, PopoverProvider, PopoverRoot, type PopoverTrigger, type PopoverTriggerComponentProps, PopoverTriggerElement, type PopoverTriggerElementProps, PopoverViewport, type PopoverViewportAtomProps, type PresetColorKey, type PresetColorType, type PresetDate, type PresetPickerProps, type PresetSystemColorKey, type PresetSystemColorType, PreviewGroup, type PreviewGroupProps, PrimaryColors, PrimaryColorsObj, Progress, type ProgressProps, type ProgressSize, type ProgressStatus, type ProgressType, type ProgressVariant, ProgressiveBlur, type ProgressiveBlurClassNames, type ProgressiveBlurMode, type ProgressiveBlurPosition, type ProgressiveBlurProps, type ProgressiveBlurStyles, QRCode, type QRCodeErrorLevel, type QRCodeProps, type QRCodeStatus, type QuarterPickerProps, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, type RangeChangeDates, type RangeChangeStrings, type RangeDisabledDate, type RangeInfo, type RangePickerComponent, type RangePickerProps, type RangePickerRef, Rate, type RateProps, type RenderItemContentOptions, type RenderOptions, type ResponsiveState, Result, type ResultProps, type ResultStatus, ScrollArea, ScrollAreaContent, type ScrollAreaContentProps, ScrollAreaCorner, type ScrollAreaCornerProps, type ScrollAreaProps, ScrollAreaRoot, type ScrollAreaRootProps, ScrollAreaScrollbar, type ScrollAreaScrollbarProps, ScrollAreaThumb, type ScrollAreaThumbProps, ScrollAreaViewport, type ScrollAreaViewportProps, ScrollShadow, type ScrollShadowProps, SearchBar, type SearchBarProps, SearchResultCards, type SearchResultCardsProps, Segmented, type SegmentedClassNames, SegmentedIndicator, type SegmentedIndicatorProps, SegmentedItem, SegmentedItemIcon, SegmentedItemLabel, type SegmentedItemProps, type SegmentedOption, type SegmentedOptions, type SegmentedOrientation, type SegmentedProps, SegmentedRoot, type SegmentedRootProps, type SegmentedSize, type SegmentedStyles, type SegmentedVariant, Select, SelectArrow, type SelectArrowProps, SelectBackdrop, type SelectBehaviorVariant, type SelectClassNames, SelectGroup, SelectGroupLabel, type SelectGroupLabelProps, type SelectGroupProps, SelectIcon, type SelectIconProps, type SelectIndicatorVariant, SelectItem, SelectItemIndicator, type SelectItemIndicatorProps, type SelectItemProps, SelectItemText, type SelectItemTextProps, SelectList, type SelectListProps, type SelectOption, type SelectOptionGroup, type SelectOptions, SelectPopup, type SelectPopupProps, SelectPortal, type SelectPortalProps, SelectPositioner, type SelectPositionerProps, type SelectProps, SelectRoot, type SelectRootChangeEventDetails, SelectScrollDownArrow, type SelectScrollDownArrowProps, SelectScrollUpArrow, type SelectScrollUpArrowProps, SelectSeparator, type SelectSize, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, type SelectVariant, _default$5 as ShikiLobeTheme, SideNav, type SideNavProps, type SinglePickerComponent, Skeleton, type SkeletonAnimation, SkeletonAvatar, type SkeletonAvatarProps, type SkeletonProps, SkeletonText, type SkeletonTextProps, Slider, type SliderProps, SliderWithInput, type SliderWithInputProps, Snippet, type SnippetProps, type SortOrder, SortableList, type SortableListProps, type SpanProps, Spin, type SpinProps, type SpinSize, type SpinVariant, _default$6 as SplitButton, type SplitButtonMenuProps, type SplitButtonProps, type StaticStyleExtract, type StaticStyleUtils, Statistic, type StatisticProps, type StepItem, type StepStatus, Steps, type StepsProps, type SubMenuType, type SvgProps, Switch, type SwitchChangeEventHandler, type SwitchClassNames, type SwitchClickEventHandler, type SwitchContextType, SwitchIcon, type SwitchIconPosition, type SwitchIconProps, type SwitchProps, SwitchRoot, type SwitchRootProps, type SwitchSize, type SwitchStyles, SwitchThumb, type SwitchThumbProps, SyntaxHighlighter, type SyntaxHighlighterProps, SyntaxMermaid, type SyntaxMermaidProps, type SystemColorToken, Table, TableBody, type TableBreakpoint, TableCell, type TableCellAttributes, type TableCellProps, type TableClassNames, TableColGroup, type TableColGroupColumn, type TableColGroupProps, type TableColumn, type TableColumnAlign, type TableColumnEllipsis, type TableColumnFilterItem, type TableColumnFixed, type TableColumnGroupProps, type TableColumnGroupType, type TableColumnProps, type TableColumnSorter, type TableColumnTitle, type TableColumnTitleProps, type TableColumnType, type TableColumnsType, type TableCompareFn, type TableComponents, type TableComponentsSemanticName, TableContainer, type TableCurrentDataSource, type TableCustomizeComponent, type TableDataIndex, TableElement, type TableElementProps, type TableExpandIconProps, type TableExpandableConfig, TableExpandedRow, type TableExpandedRowProps, type TableExpandedRowRender, type TableFilterDropdownPopupProps, type TableFilterDropdownProps, type TableFilters, TableFooter, TableHeader, TableHeaderCell, type TableHeaderCellAttributes, type TableLoadingConfig, type TableLocale, type TableMultipleSorterResult, type TablePaginationConfig, type TablePaginationPlacement, type TablePartProps, type TableProps, type TableRef, type TableRenderedCell, TableRoot, type TableRootProps, TableRow, type TableRowClassName, type TableRowProps, type TableRowSelectMethod, type TableRowSelection, type TableRowSelectionCheckboxProps, type TableRowSelectionType, TableScroll, type TableScrollProps, type TableScrollToConfig, type TableSectionProps, type TableSelectionItem, type TableSelectionPreset, type TableSemanticInfo, type TableSemanticName, type TableSize, type TableSorterResult, type TableSorterTooltipProps, type TableSticky, type TableStyles, type TableSummaryCellProps, TableSummaryFoot, type TableSummaryProps, type TableSummaryRowProps, TableTitle, type TableVariant, Tabs, type TabsClassNames, TabsIndicator, type TabsIndicatorProps, type TabsItem, TabsList, type TabsListProps, type TabsOrientation, TabsPanel, type TabsPanelProps, type TabsProps, TabsRoot, type TabsRootProps, type TabsSize, type TabsStyles, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagClassNames, type TagProps, type TagShape, type TagSize, type TagStyles, type TagVariant, Text, _default$7 as TextArea, type TextAreaAutoSize, type TextAreaProps, type TextClassNames, type TextProps, type TextStyles, ThemeScope, type ThemeScopeProps, type TimePickerLocale, type TimePickerProps, type ToastAPI, ToastHost, type ToastHostProps, type ToastInstance, type ToastOptions, type ToastPosition, type ToastPromiseOptions, type ToastProps, type ToastType, ToggleGroup, type ToggleGroupClassNames, ToggleGroupItem, ToggleGroupItemIcon, ToggleGroupItemLabel, type ToggleGroupItemProps, type ToggleGroupOption, type ToggleGroupProps, ToggleGroupRoot, type ToggleGroupRootProps, type ToggleGroupSize, type ToggleGroupStyles, type ToggleGroupVariant, Tooltip, TooltipGroup, type TooltipGroupProps, type TooltipPlacement, type TooltipPopupComponentProps, type TooltipPortalProps, type TooltipPositionerProps, type TooltipProps, type TooltipTriggerComponentProps, Tree, type TreeClassNames, type TreeDataNode, type TreeFlatRow, type TreeProps, type TreeStyles, type Trigger, Typography, type TypographyProps, Upload, type UploadChangeInfo, UploadDragger, type UploadProps, type UseImagePreviewResult, type UseScopeArrowNavOptions, type UseScopeSwitcherOptions, Video, type VideoMarker, type VideoPlayer, type VideoProps, type VideoSection, type VideoState, type VirtualListProps, type WeekPickerProps, type YearPickerProps, accordionStyles, actionIconStyles, alertStyles, styles as autoCompleteStyles, backdropTransition, buttonPaddingInline, buttonStyles, checkboxStyles, closeContextMenu, colorsPreset, colorsPresetSystem, combineKeys, conductCheck, confirmModal, controlHeight, copyToClipboard, createGlobalStyle, createLobeToken, createModal, createModalSystem, createPickerLocale, createStaticStyles, css, cssVar, cx, datePickerLocaleEnUS, datePickerLocaleZhCN, drawerBackdropTransition, extractStaticStyle, findCustomThemeName, flattenVisible, focusScopeItem, styles$1 as focusScopeStyles, formatStatisticValue, genCdnUrl, generateColorNeutralPalette, generateColorPalette, generateNeutralScale, generatePicker, getActiveScopeId, getAgentAvatarTraits, getAllKeys, getCustomNeutralCss, getCustomPaletteCss, getCustomPrimaryCss, getDrawerMotionConfig, getFloatingCollisionPadding, getGlobalCss, getItemKey, getItemLabel, getLastFocusedItem, getThemeCss, hasAnyIcon, hasCheckboxAndIcon, highlighterThemes, containsScript as htmlPreviewContainsScript, injectGlobal, inputClassNames as inputStyles, rootVariants as inputVariants, installGlobalFocusRing, isCustomNeutralColor, isCustomPrimaryColor, isFullHtmlDocument, isHtmlContentClosed, keyframes, staticStylish as lobeStaticStylish, styles$2 as menuSharedStyles, mermaidThemes, modalMotionConfig, neutralColors, neutralColorsSwatches, notifyScopeItemFocus, parseTrigger, placementMap, preprocessMarkdownContent, presetColors, presetSystemColors, preventDefault, preventDefaultAndStopPropagation, primaryColors, primaryColorsSwatches, radioStyles, registerLobeNeutral, registerLobePalette, registerScope, rehypeCustomFootnotes, rehypeKatexDir, rehypeStreamAnimated, remarkBr, remarkColor, remarkCustomFootnotes, remarkGfmPlus, remarkVideo, renderDropdownMenuItems, renderIcon, responsive, setActiveScope, setContextMenuInterceptor, setFloatingCollisionPadding, setLastFocusedItem, setLobeTheme, showContextMenu, sliderStyles, stopPropagation, switchStyles, tabsStyles, groupStyles as textGroupStyles, textStyles, variants as textVariants, toFloatingUIPlacement, toast, toggleGroupStyles, styles$3 as treeStyles, updateContextMenuItems, useAccordionContext, useActiveScopeId, useAppElement, useCdnFn, useDirection, useDraggablePanelContext, useDrawerActions, useDrawerOpen, useFocusScopeActive, useFocusScopeId, useFormContext, useImagePreview, useModalActions, useModalContext, useModalOpen, useMotionComponent, usePopoverContext, usePopoverGroupHandle, usePopoverPortalContainer, useResponsive, useScopeArrowNav, useScopeSwitcher, useSwitchContext, useTabsContext, useTheme, useThemeMode, useToast, useTranslation, useVideo, useVideoPlayer, useVideoState };
|
package/es/index.mjs
CHANGED
|
@@ -81,6 +81,7 @@ import MaterialFileTypeIcon from "./MaterialFileTypeIcon/MaterialFileTypeIcon.mj
|
|
|
81
81
|
import { colorsPreset, colorsPresetSystem, presetColors, presetSystemColors } from "./Tag/utils.mjs";
|
|
82
82
|
import Tag from "./Tag/Tag.mjs";
|
|
83
83
|
import { preventDefault, preventDefaultAndStopPropagation, stopPropagation } from "./utils/dom.mjs";
|
|
84
|
+
import lobeHighlightsTheme from "./Highlighter/theme/lobe-highlights-theme.mjs";
|
|
84
85
|
import lobe_theme_default from "./Highlighter/theme/lobe-theme.mjs";
|
|
85
86
|
import { CodeDiff } from "./CodeDiff/CodeDiff.mjs";
|
|
86
87
|
import { PatchDiff } from "./CodeDiff/PatchDiff.mjs";
|
|
@@ -227,4 +228,4 @@ import { ToggleGroupItem, ToggleGroupItemIcon, ToggleGroupItemLabel, ToggleGroup
|
|
|
227
228
|
import ToggleGroup from "./ToggleGroup/ToggleGroup.mjs";
|
|
228
229
|
import { rehypeStreamAnimated } from "@lobehub/streamdown";
|
|
229
230
|
import { ErrorBoundary } from "react-error-boundary";
|
|
230
|
-
export { A, AGENT_AVATAR_COLORS, AGENT_AVATAR_SHAPES, AGENT_AVATAR_STATES, Accordion, AccordionHeader, AccordionItem, AccordionPanel, AccordionRoot, AccordionTrigger, ActionIcon, ActionIconGroup, AgentAvatar, Alert, Anchor, AutoComplete, Avatar, AvatarGroup, Badge, Block, Breadcrumb, Burger, Button, CLASSNAMES, Carousel, Center, Checkbox_default as Checkbox, CheckboxGroup, CodeDiff, CodeEditor, Collapsible, ColorPicker, ColorSwatches, ConfigProvider, ContextMenuHost, ContextMenuTrigger, CopyButton, DatePicker, DateRangePicker, DayjsDatePicker, DayjsDateRangePicker, Descriptions, Divider, DownloadButton, DraggablePanel, DraggablePanelBody, DraggablePanelContainer, DraggablePanelContent, DraggablePanelFooter, DraggablePanelHandle, DraggablePanelHeader, DraggablePanelRoot, DraggablePanelToggle, DraggableSideNav, Drawer, DrawerBackdrop, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerPopup, DrawerPortal, DrawerRoot, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuFooter, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuHeader, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemDesc, DropdownMenuItemExtra, DropdownMenuItemIcon, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuRoot, DropdownMenuScrollViewport, DropdownMenuSeparator, DropdownMenuSubmenuArrow, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSwitchItem, DropdownMenuTrigger, EditableText, EditorSlashMenu, EmojiPicker, Empty, ErrorBoundary, FileTypeIcon, FlexBasic_default as FlexBasic, FlexBasic_default as Flexbox, FloatingPanel, FloatingSheet, FluentEmoji, FocusScope, FontLoader, Form, FormDivider, FormField, FormFlatGroup, FormFooter, FormGroup, FormSubmitFooter, FormTitle, Freeze, Grid, GroupAvatar, GuideCard, DEFAULT_HEIGHT as HTML_PREVIEW_DEFAULT_HEIGHT, DEFAULT_SANDBOX as HTML_PREVIEW_DEFAULT_SANDBOX, AUTO_HEIGHT_MESSAGE_TYPE as HTML_PREVIEW_RESIZE_MESSAGE, Header, Highlighter, Hotkey, HotkeyInput, HtmlPreview, HtmlPreviewIframe, I18nProvider, Icon, IconProvider, Image, ImageSelect, Input_default as Input, InputNumber_default as InputNumber, InputOTP, InputPassword_default as InputPassword, KeyMapEnum, LOBE_THEME_APP_ID, Layout, LayoutFooter, LayoutHeader, LayoutMain, LayoutSidebar, LayoutSidebarInner, LayoutToc, List, LobeThemeScript, I18nProvider as LobeUIProvider, Markdown, MaskShadow, MaterialFileTypeIcon, Mermaid, Modal, ModalBackdrop, ModalClose, ModalContent, ModalContext, ModalDescription, ModalFooter, ModalHeader, ModalHost, ModalPopup, ModalPortal, ModalRoot, ModalTitle, ModalTrigger, ModalViewport, MotionComponent, MotionProvider, Pagination, PatchDiff, Popover, PopoverArrow, PopoverArrowIcon, PopoverBackdrop, PopoverGroup, PopoverPopup, PopoverPortal, PopoverPositioner, PopoverProvider, PopoverRoot, PopoverTriggerElement, PopoverViewport, PreviewGroup, Progress, ProgressiveBlur, QRCode, Radio, RadioGroup, Rate, Result, ScrollArea, ScrollAreaContent, ScrollAreaCorner, ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, ScrollShadow, SearchBar, SearchResultCards, Segmented, SegmentedIndicator, SegmentedItem, SegmentedItemIcon, SegmentedItemLabel, SegmentedRoot, Select, SelectArrow, SelectBackdrop, SelectGroup, SelectGroupLabel, SelectIcon, SelectItem, SelectItemIndicator, SelectItemText, SelectList, SelectPopup, SelectPortal, SelectPositioner, SelectRoot, SelectScrollDownArrow, SelectScrollUpArrow, SelectSeparator, SelectTrigger, SelectValue, lobe_theme_default as ShikiLobeTheme, SideNav, Skeleton, SkeletonAvatar, SkeletonText, Slider, SliderWithInput, Snippet, SortableList, Spin, SplitButton, Statistic, Steps, Switch, SwitchIcon, SwitchRoot, SwitchThumb, SyntaxHighlighter, SyntaxMermaid, Table, TableBody, TableCell, TableColGroup, TableContainer, TableElement, TableExpandedRow, TableFooter, TableHeader, TableHeaderCell, TableRoot, TableRow, TableScroll, TableSummaryFoot, TableTitle, Tabs, TabsIndicator, TabsList, TabsPanel, TabsRoot, TabsTab, Tag, Text, TextArea_default as TextArea, ThemeScope, ToastHost, ToggleGroup, ToggleGroupItem, ToggleGroupItemIcon, ToggleGroupItemLabel, ToggleGroupRoot, Tooltip, TooltipGroup, Tree, Typography, Upload, UploadDragger, Video, accordionStyles, actionIconStyles, alertStyles, styles as autoCompleteStyles, backdropTransition, buttonPaddingInline, buttonStyles, checkboxStyles, closeContextMenu, colorsPreset, colorsPresetSystem, combineKeys, conductCheck, confirmModal, controlHeight, copyToClipboard, createGlobalStyle, createLobeToken, createModal, createModalSystem, createPickerLocale, createStaticStyles, css, cssVar, cx, datePickerLocaleEnUS, datePickerLocaleZhCN, drawerBackdropTransition, extractStaticStyle, findCustomThemeName, flattenVisible, focusScopeItem, styles$1 as focusScopeStyles, formatStatisticValue, genCdnUrl, generateColorNeutralPalette, generateColorPalette, generateNeutralScale, generatePicker, getActiveScopeId, getAgentAvatarTraits, getAllKeys, getCustomNeutralCss, getCustomPaletteCss, getCustomPrimaryCss, getDrawerMotionConfig, getFloatingCollisionPadding, getGlobalCss, getItemKey, getItemLabel, getLastFocusedItem, getThemeCss, hasAnyIcon, hasCheckboxAndIcon, highlighterThemes, containsScript as htmlPreviewContainsScript, injectGlobal, inputClassNames as inputStyles, rootVariants as inputVariants, installGlobalFocusRing, isCustomNeutralColor, isCustomPrimaryColor, isFullHtmlDocument, isHtmlContentClosed, keyframes, staticStylish as lobeStaticStylish, styles$2 as menuSharedStyles, mermaidThemes, modalMotionConfig, neutralColors, neutralColorsSwatches, notifyScopeItemFocus, parseTrigger, placementMap, preprocessMarkdownContent, presetColors, presetSystemColors, preventDefault, preventDefaultAndStopPropagation, primaryColors, primaryColorsSwatches, radioStyles, registerLobeNeutral, registerLobePalette, registerScope, rehypeCustomFootnotes, rehypeKatexDir, rehypeStreamAnimated, remarkBr, remarkColor, remarkCustomFootnotes, remarkGfmPlus, remarkVideo, renderDropdownMenuItems, renderIcon, responsive, setActiveScope, setContextMenuInterceptor, setFloatingCollisionPadding, setLastFocusedItem, setLobeTheme, showContextMenu, sliderStyles, stopPropagation, switchStyles, tabsStyles, groupStyles as textGroupStyles, textStyles, variants as textVariants, toFloatingUIPlacement, toast, toggleGroupStyles, styles$3 as treeStyles, updateContextMenuItems, useAccordionContext, useActiveScopeId, useAppElement, useCdnFn, useDirection, useDraggablePanelContext, useDrawerActions, useDrawerOpen, useFocusScopeActive, useFocusScopeId, useFormContext, useImagePreview, useModalActions, useModalContext, useModalOpen, useMotionComponent, usePopoverContext, usePopoverGroupHandle, usePopoverPortalContainer, useResponsive, useScopeArrowNav, useScopeSwitcher, useSwitchContext, useTabsContext, useTheme, useThemeMode, useToast, useTranslation, useVideo, useVideoPlayer, useVideoState };
|
|
231
|
+
export { A, AGENT_AVATAR_COLORS, AGENT_AVATAR_SHAPES, AGENT_AVATAR_STATES, Accordion, AccordionHeader, AccordionItem, AccordionPanel, AccordionRoot, AccordionTrigger, ActionIcon, ActionIconGroup, AgentAvatar, Alert, Anchor, AutoComplete, Avatar, AvatarGroup, Badge, Block, Breadcrumb, Burger, Button, CLASSNAMES, Carousel, Center, Checkbox_default as Checkbox, CheckboxGroup, CodeDiff, CodeEditor, Collapsible, ColorPicker, ColorSwatches, ConfigProvider, ContextMenuHost, ContextMenuTrigger, CopyButton, DatePicker, DateRangePicker, DayjsDatePicker, DayjsDateRangePicker, Descriptions, Divider, DownloadButton, DraggablePanel, DraggablePanelBody, DraggablePanelContainer, DraggablePanelContent, DraggablePanelFooter, DraggablePanelHandle, DraggablePanelHeader, DraggablePanelRoot, DraggablePanelToggle, DraggableSideNav, Drawer, DrawerBackdrop, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerPopup, DrawerPortal, DrawerRoot, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuFooter, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuHeader, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemDesc, DropdownMenuItemExtra, DropdownMenuItemIcon, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuRoot, DropdownMenuScrollViewport, DropdownMenuSeparator, DropdownMenuSubmenuArrow, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSwitchItem, DropdownMenuTrigger, EditableText, EditorSlashMenu, EmojiPicker, Empty, ErrorBoundary, FileTypeIcon, FlexBasic_default as FlexBasic, FlexBasic_default as Flexbox, FloatingPanel, FloatingSheet, FluentEmoji, FocusScope, FontLoader, Form, FormDivider, FormField, FormFlatGroup, FormFooter, FormGroup, FormSubmitFooter, FormTitle, Freeze, Grid, GroupAvatar, GuideCard, DEFAULT_HEIGHT as HTML_PREVIEW_DEFAULT_HEIGHT, DEFAULT_SANDBOX as HTML_PREVIEW_DEFAULT_SANDBOX, AUTO_HEIGHT_MESSAGE_TYPE as HTML_PREVIEW_RESIZE_MESSAGE, Header, Highlighter, Hotkey, HotkeyInput, HtmlPreview, HtmlPreviewIframe, I18nProvider, Icon, IconProvider, Image, ImageSelect, Input_default as Input, InputNumber_default as InputNumber, InputOTP, InputPassword_default as InputPassword, KeyMapEnum, LOBE_THEME_APP_ID, Layout, LayoutFooter, LayoutHeader, LayoutMain, LayoutSidebar, LayoutSidebarInner, LayoutToc, List, lobeHighlightsTheme as LobeHighlightsTheme, LobeThemeScript, I18nProvider as LobeUIProvider, Markdown, MaskShadow, MaterialFileTypeIcon, Mermaid, Modal, ModalBackdrop, ModalClose, ModalContent, ModalContext, ModalDescription, ModalFooter, ModalHeader, ModalHost, ModalPopup, ModalPortal, ModalRoot, ModalTitle, ModalTrigger, ModalViewport, MotionComponent, MotionProvider, Pagination, PatchDiff, Popover, PopoverArrow, PopoverArrowIcon, PopoverBackdrop, PopoverGroup, PopoverPopup, PopoverPortal, PopoverPositioner, PopoverProvider, PopoverRoot, PopoverTriggerElement, PopoverViewport, PreviewGroup, Progress, ProgressiveBlur, QRCode, Radio, RadioGroup, Rate, Result, ScrollArea, ScrollAreaContent, ScrollAreaCorner, ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, ScrollShadow, SearchBar, SearchResultCards, Segmented, SegmentedIndicator, SegmentedItem, SegmentedItemIcon, SegmentedItemLabel, SegmentedRoot, Select, SelectArrow, SelectBackdrop, SelectGroup, SelectGroupLabel, SelectIcon, SelectItem, SelectItemIndicator, SelectItemText, SelectList, SelectPopup, SelectPortal, SelectPositioner, SelectRoot, SelectScrollDownArrow, SelectScrollUpArrow, SelectSeparator, SelectTrigger, SelectValue, lobe_theme_default as ShikiLobeTheme, SideNav, Skeleton, SkeletonAvatar, SkeletonText, Slider, SliderWithInput, Snippet, SortableList, Spin, SplitButton, Statistic, Steps, Switch, SwitchIcon, SwitchRoot, SwitchThumb, SyntaxHighlighter, SyntaxMermaid, Table, TableBody, TableCell, TableColGroup, TableContainer, TableElement, TableExpandedRow, TableFooter, TableHeader, TableHeaderCell, TableRoot, TableRow, TableScroll, TableSummaryFoot, TableTitle, Tabs, TabsIndicator, TabsList, TabsPanel, TabsRoot, TabsTab, Tag, Text, TextArea_default as TextArea, ThemeScope, ToastHost, ToggleGroup, ToggleGroupItem, ToggleGroupItemIcon, ToggleGroupItemLabel, ToggleGroupRoot, Tooltip, TooltipGroup, Tree, Typography, Upload, UploadDragger, Video, accordionStyles, actionIconStyles, alertStyles, styles as autoCompleteStyles, backdropTransition, buttonPaddingInline, buttonStyles, checkboxStyles, closeContextMenu, colorsPreset, colorsPresetSystem, combineKeys, conductCheck, confirmModal, controlHeight, copyToClipboard, createGlobalStyle, createLobeToken, createModal, createModalSystem, createPickerLocale, createStaticStyles, css, cssVar, cx, datePickerLocaleEnUS, datePickerLocaleZhCN, drawerBackdropTransition, extractStaticStyle, findCustomThemeName, flattenVisible, focusScopeItem, styles$1 as focusScopeStyles, formatStatisticValue, genCdnUrl, generateColorNeutralPalette, generateColorPalette, generateNeutralScale, generatePicker, getActiveScopeId, getAgentAvatarTraits, getAllKeys, getCustomNeutralCss, getCustomPaletteCss, getCustomPrimaryCss, getDrawerMotionConfig, getFloatingCollisionPadding, getGlobalCss, getItemKey, getItemLabel, getLastFocusedItem, getThemeCss, hasAnyIcon, hasCheckboxAndIcon, highlighterThemes, containsScript as htmlPreviewContainsScript, injectGlobal, inputClassNames as inputStyles, rootVariants as inputVariants, installGlobalFocusRing, isCustomNeutralColor, isCustomPrimaryColor, isFullHtmlDocument, isHtmlContentClosed, keyframes, staticStylish as lobeStaticStylish, styles$2 as menuSharedStyles, mermaidThemes, modalMotionConfig, neutralColors, neutralColorsSwatches, notifyScopeItemFocus, parseTrigger, placementMap, preprocessMarkdownContent, presetColors, presetSystemColors, preventDefault, preventDefaultAndStopPropagation, primaryColors, primaryColorsSwatches, radioStyles, registerLobeNeutral, registerLobePalette, registerScope, rehypeCustomFootnotes, rehypeKatexDir, rehypeStreamAnimated, remarkBr, remarkColor, remarkCustomFootnotes, remarkGfmPlus, remarkVideo, renderDropdownMenuItems, renderIcon, responsive, setActiveScope, setContextMenuInterceptor, setFloatingCollisionPadding, setLastFocusedItem, setLobeTheme, showContextMenu, sliderStyles, stopPropagation, switchStyles, tabsStyles, groupStyles as textGroupStyles, textStyles, variants as textVariants, toFloatingUIPlacement, toast, toggleGroupStyles, styles$3 as treeStyles, updateContextMenuItems, useAccordionContext, useActiveScopeId, useAppElement, useCdnFn, useDirection, useDraggablePanelContext, useDrawerActions, useDrawerOpen, useFocusScopeActive, useFocusScopeId, useFormContext, useImagePreview, useModalActions, useModalContext, useModalOpen, useMotionComponent, usePopoverContext, usePopoverGroupHandle, usePopoverPortalContainer, useResponsive, useScopeArrowNav, useScopeSwitcher, useSwitchContext, useTabsContext, useTheme, useThemeMode, useToast, useTranslation, useVideo, useVideoPlayer, useVideoState };
|
package/es/node_modules/.pnpm/unist-util-visit@5.2.0/node_modules/unist-util-visit/lib/index.mjs
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { SKIP as SKIP$1, visitParents } from "unist-util-visit-parents";
|
|
2
|
+
// node_modules/.pnpm/unist-util-visit@5.2.0/node_modules/unist-util-visit/lib/index.js
|
|
3
|
+
/**
|
|
4
|
+
* @import {Node as UnistNode, Parent as UnistParent} from 'unist'
|
|
5
|
+
* @import {
|
|
6
|
+
* InclusiveDescendant,
|
|
7
|
+
* Matches,
|
|
8
|
+
* Visitors as ParentsVisitors,
|
|
9
|
+
* VisitorResult,
|
|
10
|
+
* VisitorResultExit
|
|
11
|
+
* } from 'unist-util-visit-parents'
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* @typedef {Exclude<import('unist-util-is').Test, undefined> | undefined} Test
|
|
15
|
+
* Test from `unist-util-is`.
|
|
16
|
+
*
|
|
17
|
+
* Note: we have remove and add `undefined`, because otherwise when generating
|
|
18
|
+
* automatic `.d.ts` files, TS tries to flatten paths from a local perspective,
|
|
19
|
+
* which doesn’t work when publishing on npm.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* @typedef {(
|
|
23
|
+
* Node extends UnistParent
|
|
24
|
+
* ? Node extends {children: Array<infer Children>}
|
|
25
|
+
* ? Child extends Children ? Node : never
|
|
26
|
+
* : never
|
|
27
|
+
* : never
|
|
28
|
+
* )} InternalParent
|
|
29
|
+
* Collect nodes that can be parents of `Child`.
|
|
30
|
+
* @template {UnistNode} Node
|
|
31
|
+
* All node types in a tree.
|
|
32
|
+
* @template {UnistNode} Child
|
|
33
|
+
* Node to search for.
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* @typedef {InternalParent<InclusiveDescendant<Tree>, Child>} Parent
|
|
37
|
+
* Collect nodes in `Tree` that can be parents of `Child`.
|
|
38
|
+
* @template {UnistNode} Tree
|
|
39
|
+
* All node types in a tree.
|
|
40
|
+
* @template {UnistNode} Child
|
|
41
|
+
* Node to search for.
|
|
42
|
+
*/
|
|
43
|
+
/**
|
|
44
|
+
* @callback Visitor
|
|
45
|
+
* Handle a node (matching `test`, if given) before its children.
|
|
46
|
+
*
|
|
47
|
+
* Like `Visitor` in `unist-util-visit-parents`,
|
|
48
|
+
* but with `index` and `parent` instead of `parents`.
|
|
49
|
+
* @param {Visited} node
|
|
50
|
+
* Found node.
|
|
51
|
+
* @param {Visited extends UnistNode ? number | undefined : never} index
|
|
52
|
+
* Index of `node` in `parent`,
|
|
53
|
+
* or `undefined` for the tree itself.
|
|
54
|
+
* @param {Ancestor extends UnistParent ? Ancestor | undefined : never} parent
|
|
55
|
+
* Parent of `node`,
|
|
56
|
+
* or `undefined` for the tree itself.
|
|
57
|
+
* @returns {VisitorResult}
|
|
58
|
+
* What to do next.
|
|
59
|
+
* @template {UnistNode} [Visited=UnistNode]
|
|
60
|
+
* Visited node type.
|
|
61
|
+
* @template {UnistParent} [Ancestor=UnistParent]
|
|
62
|
+
* Ancestor type.
|
|
63
|
+
*/
|
|
64
|
+
/**
|
|
65
|
+
* @callback VisitorExit
|
|
66
|
+
* Handle a node (matching `test`, if given) after its children.
|
|
67
|
+
*
|
|
68
|
+
* Like `VisitorExit` in `unist-util-visit-parents`,
|
|
69
|
+
* but with `index` and `parent` instead of `parents`.
|
|
70
|
+
* @param {Visited} node
|
|
71
|
+
* Found node.
|
|
72
|
+
* @param {Visited extends UnistNode ? number | undefined : never} index
|
|
73
|
+
* Index of `node` in `parent`,
|
|
74
|
+
* or `undefined` for the tree itself.
|
|
75
|
+
* @param {Ancestor extends UnistParent ? Ancestor | undefined : never} parent
|
|
76
|
+
* Parent of `node`,
|
|
77
|
+
* or `undefined` for the tree itself.
|
|
78
|
+
* @returns {VisitorResultExit}
|
|
79
|
+
* What to do next.
|
|
80
|
+
* @template {UnistNode} [Visited=UnistNode]
|
|
81
|
+
* Visited node type.
|
|
82
|
+
* @template {UnistParent} [Ancestor=UnistParent]
|
|
83
|
+
* Ancestor type.
|
|
84
|
+
*/
|
|
85
|
+
/**
|
|
86
|
+
* @template {UnistNode} [Visited=UnistNode]
|
|
87
|
+
* Visited node type.
|
|
88
|
+
* @template {UnistParent} [Ancestor=UnistParent]
|
|
89
|
+
* Ancestor type.
|
|
90
|
+
* @typedef Visitors
|
|
91
|
+
* Handle nodes when entering and exiting them.
|
|
92
|
+
*
|
|
93
|
+
* Like `Visitors` in `unist-util-visit-parents`.
|
|
94
|
+
* @property {Visitor<Visited, Ancestor> | null | undefined} [enter]
|
|
95
|
+
* Handle a node before its children (optional).
|
|
96
|
+
* @property {VisitorExit<Visited, Ancestor>} exit
|
|
97
|
+
* Handle a node after its children.
|
|
98
|
+
*/
|
|
99
|
+
/**
|
|
100
|
+
* @typedef {Visitor<Visited, Parent<Ancestor, Visited>>} BuildVisitorFromMatch
|
|
101
|
+
* Build a typed `Visitor` function from a node and all possible parents.
|
|
102
|
+
*
|
|
103
|
+
* It will infer which values are passed as `node` and which as `parent`.
|
|
104
|
+
* @template {UnistNode} Visited
|
|
105
|
+
* Node type.
|
|
106
|
+
* @template {UnistParent} Ancestor
|
|
107
|
+
* Parent type.
|
|
108
|
+
*/
|
|
109
|
+
/**
|
|
110
|
+
* @typedef {(
|
|
111
|
+
* BuildVisitorFromMatch<
|
|
112
|
+
* Matches<Descendant, Check>,
|
|
113
|
+
* Extract<Descendant, UnistParent>
|
|
114
|
+
* >
|
|
115
|
+
* )} BuildVisitorFromDescendants
|
|
116
|
+
* Build a typed `Visitor` function from a list of descendants and a test.
|
|
117
|
+
*
|
|
118
|
+
* It will infer which values are passed as `node` and which as `parent`.
|
|
119
|
+
* @template {UnistNode} Descendant
|
|
120
|
+
* Node type.
|
|
121
|
+
* @template {Test} Check
|
|
122
|
+
* Test type.
|
|
123
|
+
*/
|
|
124
|
+
/**
|
|
125
|
+
* @typedef {(
|
|
126
|
+
* BuildVisitorFromDescendants<
|
|
127
|
+
* InclusiveDescendant<Tree>,
|
|
128
|
+
* Check
|
|
129
|
+
* >
|
|
130
|
+
* )} BuildVisitor
|
|
131
|
+
* Build a typed `Visitor` function from a tree and a test.
|
|
132
|
+
*
|
|
133
|
+
* It will infer which values are passed as `node` and which as `parent`.
|
|
134
|
+
* @template {UnistNode} [Tree=UnistNode]
|
|
135
|
+
* Node type.
|
|
136
|
+
* @template {Test} [Check=Test]
|
|
137
|
+
* Test type.
|
|
138
|
+
*/
|
|
139
|
+
/**
|
|
140
|
+
* @typedef {(
|
|
141
|
+
* Visitors<
|
|
142
|
+
* Matches<InclusiveDescendant<Tree>, Check>,
|
|
143
|
+
* Parent<
|
|
144
|
+
* Extract<InclusiveDescendant<Tree>, UnistParent>,
|
|
145
|
+
* Matches<InclusiveDescendant<Tree>, Check>
|
|
146
|
+
* >
|
|
147
|
+
* >
|
|
148
|
+
* )} BuildVisitors
|
|
149
|
+
* Build typed `Visitors` from a tree and a test.
|
|
150
|
+
*
|
|
151
|
+
* It will infer which values are passed as `node` and which as `parent`.
|
|
152
|
+
* @template {UnistNode} [Tree=UnistNode]
|
|
153
|
+
* Node type.
|
|
154
|
+
* @template {Test} [Check=Test]
|
|
155
|
+
* Test type.
|
|
156
|
+
*/
|
|
157
|
+
/**
|
|
158
|
+
* Visit nodes.
|
|
159
|
+
*
|
|
160
|
+
* This algorithm performs *depth-first* *tree traversal* in *preorder*
|
|
161
|
+
* (**NLR**) or if `reverse` is given,
|
|
162
|
+
* in *reverse preorder* (**NRL**).
|
|
163
|
+
* An `exit` visitor is called in *postorder* (**LRN**)
|
|
164
|
+
* or if `reverse` is given, in *reverse postorder* (**RLN**).
|
|
165
|
+
*
|
|
166
|
+
* You can choose which nodes are visited by passing a `test`.
|
|
167
|
+
* For complex tests, you should test yourself in a visitor, as it will be
|
|
168
|
+
* faster and will have improved type information.
|
|
169
|
+
*
|
|
170
|
+
* Walking the tree is an intensive task.
|
|
171
|
+
* Make use of the return values of the visitor when possible.
|
|
172
|
+
* Instead of walking a tree multiple times, walk it once, use `unist-util-is`
|
|
173
|
+
* to check if a node matches, and then perform different operations.
|
|
174
|
+
*
|
|
175
|
+
* You can change the tree.
|
|
176
|
+
* Changes inside a node made when entering it are walked,
|
|
177
|
+
* changes made when exiting it are not.
|
|
178
|
+
* See `Visitor` and `VisitorExit` for more info.
|
|
179
|
+
*
|
|
180
|
+
* @overload
|
|
181
|
+
* @param {Tree} tree
|
|
182
|
+
* Tree to traverse.
|
|
183
|
+
* @param {Check} check
|
|
184
|
+
* `unist-util-is`-compatible test.
|
|
185
|
+
* @param {BuildVisitor<Tree, Check> | BuildVisitors<Tree, Check>} visitors
|
|
186
|
+
* Handle each node when entering it,
|
|
187
|
+
* or `{enter, exit}` to also handle it when exiting it.
|
|
188
|
+
* @param {boolean | null | undefined} [reverse]
|
|
189
|
+
* Walk children from last to first;
|
|
190
|
+
* for `enter`, reverse preorder (NRL) instead of preorder (NLR);
|
|
191
|
+
* for `exit`, reverse postorder (RLN) instead of postorder (LRN).
|
|
192
|
+
* @returns {undefined}
|
|
193
|
+
* Nothing.
|
|
194
|
+
*
|
|
195
|
+
* @overload
|
|
196
|
+
* @param {Tree} tree
|
|
197
|
+
* Tree to traverse.
|
|
198
|
+
* @param {BuildVisitor<Tree> | BuildVisitors<Tree>} visitors
|
|
199
|
+
* Handle each node when entering it,
|
|
200
|
+
* or `{enter, exit}` to also handle it when exiting it.
|
|
201
|
+
* @param {boolean | null | undefined} [reverse]
|
|
202
|
+
* Walk children from last to first;
|
|
203
|
+
* for `enter`, reverse preorder (NRL) instead of preorder (NLR);
|
|
204
|
+
* for `exit`, reverse postorder (RLN) instead of postorder (LRN).
|
|
205
|
+
* @returns {undefined}
|
|
206
|
+
* Nothing.
|
|
207
|
+
*
|
|
208
|
+
* @param {UnistNode} tree
|
|
209
|
+
* Tree to traverse.
|
|
210
|
+
* @param {Visitor | Visitors | Test} testOrEnterOrVisitors
|
|
211
|
+
* `unist-util-is`-compatible test, `enter`, or `visitors`.
|
|
212
|
+
* @param {Visitor | Visitors | boolean | null | undefined} [enterOrVisitorsOrReverse]
|
|
213
|
+
* `enter`, `visitors`, or `reverse` after a test.
|
|
214
|
+
* @param {boolean | null | undefined} [maybeReverse]
|
|
215
|
+
* Walk children from last to first;
|
|
216
|
+
* for `enter`, reverse preorder (NRL) instead of preorder (NLR);
|
|
217
|
+
* for `exit`, reverse postorder (RLN) instead of postorder (LRN).
|
|
218
|
+
* @returns {undefined}
|
|
219
|
+
* Nothing.
|
|
220
|
+
*
|
|
221
|
+
* @template {UnistNode} Tree
|
|
222
|
+
* Node type.
|
|
223
|
+
* @template {Test} Check
|
|
224
|
+
* `unist-util-is`-compatible test.
|
|
225
|
+
*/
|
|
226
|
+
function visit(tree, testOrEnterOrVisitors, enterOrVisitorsOrReverse, maybeReverse) {
|
|
227
|
+
/** @type {Test} */
|
|
228
|
+
let check;
|
|
229
|
+
/** @type {Visitor | Visitors} */
|
|
230
|
+
let visitors;
|
|
231
|
+
/** @type {boolean | null | undefined} */
|
|
232
|
+
let reverse;
|
|
233
|
+
if (typeof enterOrVisitorsOrReverse === "function" || enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === "object") {
|
|
234
|
+
check = testOrEnterOrVisitors;
|
|
235
|
+
visitors = enterOrVisitorsOrReverse;
|
|
236
|
+
reverse = maybeReverse;
|
|
237
|
+
} else {
|
|
238
|
+
visitors = testOrEnterOrVisitors;
|
|
239
|
+
reverse = enterOrVisitorsOrReverse;
|
|
240
|
+
}
|
|
241
|
+
if (typeof visitors === "function") visitParents(tree, check, wrap(visitors), reverse);
|
|
242
|
+
else visitParents(tree, check, wrapVisitors(visitors), reverse);
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Turn `visit` visitors into `visitParents` visitors.
|
|
246
|
+
*
|
|
247
|
+
* @param {Visitors} visitors
|
|
248
|
+
* Visitors for `visit`.
|
|
249
|
+
* @returns {ParentsVisitors}
|
|
250
|
+
* Visitors for `visitParents`.
|
|
251
|
+
*/
|
|
252
|
+
function wrapVisitors(visitors) {
|
|
253
|
+
if (!visitors || typeof visitors !== "object") return visitors;
|
|
254
|
+
return {
|
|
255
|
+
enter: typeof visitors.enter === "function" ? wrap(visitors.enter) : visitors.enter,
|
|
256
|
+
exit: typeof visitors.exit === "function" ? wrap(visitors.exit) : visitors.exit
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Turn a `visit` visitor into a `visitParents` one.
|
|
261
|
+
*
|
|
262
|
+
* @template {VisitorResult} Result
|
|
263
|
+
* Result type.
|
|
264
|
+
* @param {(node: UnistNode, index: number | undefined, parent: UnistParent | undefined) => Result} visitor
|
|
265
|
+
* Visitor for `visit`.
|
|
266
|
+
* @returns {(node: UnistNode, parents: Array<UnistParent>, index: number | undefined) => Result}
|
|
267
|
+
* Visitor for `visitParents`.
|
|
268
|
+
*/
|
|
269
|
+
function wrap(visitor) {
|
|
270
|
+
return overload;
|
|
271
|
+
/**
|
|
272
|
+
* Call `visitor` with `index` and `parent` instead of `parents`.
|
|
273
|
+
*
|
|
274
|
+
* @param {UnistNode} node
|
|
275
|
+
* Visited node.
|
|
276
|
+
* @param {Array<UnistParent>} parents
|
|
277
|
+
* Ancestors of `node`.
|
|
278
|
+
* @param {number | undefined} index
|
|
279
|
+
* Index of `node` in its parent.
|
|
280
|
+
* @returns {Result}
|
|
281
|
+
* What to do next.
|
|
282
|
+
*/
|
|
283
|
+
function overload(node, parents, index) {
|
|
284
|
+
return visitor(node, index, parents[parents.length - 1]);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
export { SKIP$1 as SKIP, visit };
|
|
288
|
+
|
|
289
|
+
//# sourceMappingURL=index.mjs.map
|
package/es/node_modules/.pnpm/unist-util-visit@5.2.0/node_modules/unist-util-visit/lib/index.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../node_modules/.pnpm/unist-util-visit@5.2.0/node_modules/unist-util-visit/lib/index.js"],"sourcesContent":["/**\n * @import {Node as UnistNode, Parent as UnistParent} from 'unist'\n * @import {\n * InclusiveDescendant,\n * Matches,\n * Visitors as ParentsVisitors,\n * VisitorResult,\n * VisitorResultExit\n * } from 'unist-util-visit-parents'\n */\n\n/**\n * @typedef {Exclude<import('unist-util-is').Test, undefined> | undefined} Test\n * Test from `unist-util-is`.\n *\n * Note: we have remove and add `undefined`, because otherwise when generating\n * automatic `.d.ts` files, TS tries to flatten paths from a local perspective,\n * which doesn’t work when publishing on npm.\n */\n\n/**\n * @typedef {(\n * Node extends UnistParent\n * ? Node extends {children: Array<infer Children>}\n * ? Child extends Children ? Node : never\n * : never\n * : never\n * )} InternalParent\n * Collect nodes that can be parents of `Child`.\n * @template {UnistNode} Node\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n */\n\n/**\n * @typedef {InternalParent<InclusiveDescendant<Tree>, Child>} Parent\n * Collect nodes in `Tree` that can be parents of `Child`.\n * @template {UnistNode} Tree\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n */\n\n/**\n * @callback Visitor\n * Handle a node (matching `test`, if given) before its children.\n *\n * Like `Visitor` in `unist-util-visit-parents`,\n * but with `index` and `parent` instead of `parents`.\n * @param {Visited} node\n * Found node.\n * @param {Visited extends UnistNode ? number | undefined : never} index\n * Index of `node` in `parent`,\n * or `undefined` for the tree itself.\n * @param {Ancestor extends UnistParent ? Ancestor | undefined : never} parent\n * Parent of `node`,\n * or `undefined` for the tree itself.\n * @returns {VisitorResult}\n * What to do next.\n * @template {UnistNode} [Visited=UnistNode]\n * Visited node type.\n * @template {UnistParent} [Ancestor=UnistParent]\n * Ancestor type.\n */\n\n/**\n * @callback VisitorExit\n * Handle a node (matching `test`, if given) after its children.\n *\n * Like `VisitorExit` in `unist-util-visit-parents`,\n * but with `index` and `parent` instead of `parents`.\n * @param {Visited} node\n * Found node.\n * @param {Visited extends UnistNode ? number | undefined : never} index\n * Index of `node` in `parent`,\n * or `undefined` for the tree itself.\n * @param {Ancestor extends UnistParent ? Ancestor | undefined : never} parent\n * Parent of `node`,\n * or `undefined` for the tree itself.\n * @returns {VisitorResultExit}\n * What to do next.\n * @template {UnistNode} [Visited=UnistNode]\n * Visited node type.\n * @template {UnistParent} [Ancestor=UnistParent]\n * Ancestor type.\n */\n\n/**\n * @template {UnistNode} [Visited=UnistNode]\n * Visited node type.\n * @template {UnistParent} [Ancestor=UnistParent]\n * Ancestor type.\n * @typedef Visitors\n * Handle nodes when entering and exiting them.\n *\n * Like `Visitors` in `unist-util-visit-parents`.\n * @property {Visitor<Visited, Ancestor> | null | undefined} [enter]\n * Handle a node before its children (optional).\n * @property {VisitorExit<Visited, Ancestor>} exit\n * Handle a node after its children.\n */\n\n/**\n * @typedef {Visitor<Visited, Parent<Ancestor, Visited>>} BuildVisitorFromMatch\n * Build a typed `Visitor` function from a node and all possible parents.\n *\n * It will infer which values are passed as `node` and which as `parent`.\n * @template {UnistNode} Visited\n * Node type.\n * @template {UnistParent} Ancestor\n * Parent type.\n */\n\n/**\n * @typedef {(\n * BuildVisitorFromMatch<\n * Matches<Descendant, Check>,\n * Extract<Descendant, UnistParent>\n * >\n * )} BuildVisitorFromDescendants\n * Build a typed `Visitor` function from a list of descendants and a test.\n *\n * It will infer which values are passed as `node` and which as `parent`.\n * @template {UnistNode} Descendant\n * Node type.\n * @template {Test} Check\n * Test type.\n */\n\n/**\n * @typedef {(\n * BuildVisitorFromDescendants<\n * InclusiveDescendant<Tree>,\n * Check\n * >\n * )} BuildVisitor\n * Build a typed `Visitor` function from a tree and a test.\n *\n * It will infer which values are passed as `node` and which as `parent`.\n * @template {UnistNode} [Tree=UnistNode]\n * Node type.\n * @template {Test} [Check=Test]\n * Test type.\n */\n\n/**\n * @typedef {(\n * Visitors<\n * Matches<InclusiveDescendant<Tree>, Check>,\n * Parent<\n * Extract<InclusiveDescendant<Tree>, UnistParent>,\n * Matches<InclusiveDescendant<Tree>, Check>\n * >\n * >\n * )} BuildVisitors\n * Build typed `Visitors` from a tree and a test.\n *\n * It will infer which values are passed as `node` and which as `parent`.\n * @template {UnistNode} [Tree=UnistNode]\n * Node type.\n * @template {Test} [Check=Test]\n * Test type.\n */\n\nimport {visitParents} from 'unist-util-visit-parents'\n\nexport {CONTINUE, EXIT, SKIP} from 'unist-util-visit-parents'\n\n/**\n * Visit nodes.\n *\n * This algorithm performs *depth-first* *tree traversal* in *preorder*\n * (**NLR**) or if `reverse` is given,\n * in *reverse preorder* (**NRL**).\n * An `exit` visitor is called in *postorder* (**LRN**)\n * or if `reverse` is given, in *reverse postorder* (**RLN**).\n *\n * You can choose which nodes are visited by passing a `test`.\n * For complex tests, you should test yourself in a visitor, as it will be\n * faster and will have improved type information.\n *\n * Walking the tree is an intensive task.\n * Make use of the return values of the visitor when possible.\n * Instead of walking a tree multiple times, walk it once, use `unist-util-is`\n * to check if a node matches, and then perform different operations.\n *\n * You can change the tree.\n * Changes inside a node made when entering it are walked,\n * changes made when exiting it are not.\n * See `Visitor` and `VisitorExit` for more info.\n *\n * @overload\n * @param {Tree} tree\n * Tree to traverse.\n * @param {Check} check\n * `unist-util-is`-compatible test.\n * @param {BuildVisitor<Tree, Check> | BuildVisitors<Tree, Check>} visitors\n * Handle each node when entering it,\n * or `{enter, exit}` to also handle it when exiting it.\n * @param {boolean | null | undefined} [reverse]\n * Walk children from last to first;\n * for `enter`, reverse preorder (NRL) instead of preorder (NLR);\n * for `exit`, reverse postorder (RLN) instead of postorder (LRN).\n * @returns {undefined}\n * Nothing.\n *\n * @overload\n * @param {Tree} tree\n * Tree to traverse.\n * @param {BuildVisitor<Tree> | BuildVisitors<Tree>} visitors\n * Handle each node when entering it,\n * or `{enter, exit}` to also handle it when exiting it.\n * @param {boolean | null | undefined} [reverse]\n * Walk children from last to first;\n * for `enter`, reverse preorder (NRL) instead of preorder (NLR);\n * for `exit`, reverse postorder (RLN) instead of postorder (LRN).\n * @returns {undefined}\n * Nothing.\n *\n * @param {UnistNode} tree\n * Tree to traverse.\n * @param {Visitor | Visitors | Test} testOrEnterOrVisitors\n * `unist-util-is`-compatible test, `enter`, or `visitors`.\n * @param {Visitor | Visitors | boolean | null | undefined} [enterOrVisitorsOrReverse]\n * `enter`, `visitors`, or `reverse` after a test.\n * @param {boolean | null | undefined} [maybeReverse]\n * Walk children from last to first;\n * for `enter`, reverse preorder (NRL) instead of preorder (NLR);\n * for `exit`, reverse postorder (RLN) instead of postorder (LRN).\n * @returns {undefined}\n * Nothing.\n *\n * @template {UnistNode} Tree\n * Node type.\n * @template {Test} Check\n * `unist-util-is`-compatible test.\n */\nexport function visit(\n tree,\n testOrEnterOrVisitors,\n enterOrVisitorsOrReverse,\n maybeReverse\n) {\n /** @type {Test} */\n let check\n /** @type {Visitor | Visitors} */\n let visitors\n /** @type {boolean | null | undefined} */\n let reverse\n\n // Third parameter is an enter visitor or a visitors object, so expect a `test` too.\n if (\n typeof enterOrVisitorsOrReverse === 'function' ||\n (enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === 'object')\n ) {\n check = /** @type {Test} */ (testOrEnterOrVisitors)\n visitors = enterOrVisitorsOrReverse\n reverse = maybeReverse\n }\n // Assume no test.\n else {\n visitors = /** @type {Visitor | Visitors} */ (testOrEnterOrVisitors)\n reverse = enterOrVisitorsOrReverse\n }\n\n if (typeof visitors === 'function') {\n visitParents(tree, check, wrap(visitors), reverse)\n } else {\n visitParents(tree, check, wrapVisitors(visitors), reverse)\n }\n}\n\n/**\n * Turn `visit` visitors into `visitParents` visitors.\n *\n * @param {Visitors} visitors\n * Visitors for `visit`.\n * @returns {ParentsVisitors}\n * Visitors for `visitParents`.\n */\nfunction wrapVisitors(visitors) {\n // Pass anything else straight to `visitParents` to get its errors.\n if (!visitors || typeof visitors !== 'object') return visitors\n\n return {\n enter:\n typeof visitors.enter === 'function'\n ? wrap(visitors.enter)\n : visitors.enter,\n exit:\n typeof visitors.exit === 'function' ? wrap(visitors.exit) : visitors.exit\n }\n}\n\n/**\n * Turn a `visit` visitor into a `visitParents` one.\n *\n * @template {VisitorResult} Result\n * Result type.\n * @param {(node: UnistNode, index: number | undefined, parent: UnistParent | undefined) => Result} visitor\n * Visitor for `visit`.\n * @returns {(node: UnistNode, parents: Array<UnistParent>, index: number | undefined) => Result}\n * Visitor for `visitParents`.\n */\nfunction wrap(visitor) {\n return overload\n\n /**\n * Call `visitor` with `index` and `parent` instead of `parents`.\n *\n * @param {UnistNode} node\n * Visited node.\n * @param {Array<UnistParent>} parents\n * Ancestors of `node`.\n * @param {number | undefined} index\n * Index of `node` in its parent.\n * @returns {Result}\n * What to do next.\n */\n function overload(node, parents, index) {\n return visitor(node, index, parents[parents.length - 1])\n }\n}\n"],"ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8OA,SAAgB,MACd,MACA,uBACA,0BACA,cACA;;CAEA,IAAI;;CAEJ,IAAI;;CAEJ,IAAI;CAGJ,IACE,OAAO,6BAA6B,cACnC,4BAA4B,OAAO,6BAA6B,UACjE;EACA,QAA6B;EAC7B,WAAW;EACX,UAAU;CACZ,OAEK;EACH,WAA8C;EAC9C,UAAU;CACZ;CAEA,IAAI,OAAO,aAAa,YACtB,aAAa,MAAM,OAAO,KAAK,QAAQ,GAAG,OAAO;MAEjD,aAAa,MAAM,OAAO,aAAa,QAAQ,GAAG,OAAO;AAE7D;;;;;;;;;AAUA,SAAS,aAAa,UAAU;CAE9B,IAAI,CAAC,YAAY,OAAO,aAAa,UAAU,OAAO;CAEtD,OAAO;EACL,OACE,OAAO,SAAS,UAAU,aACtB,KAAK,SAAS,KAAK,IACnB,SAAS;EACf,MACE,OAAO,SAAS,SAAS,aAAa,KAAK,SAAS,IAAI,IAAI,SAAS;CACzE;AACF;;;;;;;;;;;AAYA,SAAS,KAAK,SAAS;CACrB,OAAO;;;;;;;;;;;;;CAcP,SAAS,SAAS,MAAM,SAAS,OAAO;EACtC,OAAO,QAAQ,MAAM,OAAO,QAAQ,QAAQ,SAAS,EAAE;CACzD;AACF"}
|
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { css, injectGlobal } from "./css.mjs";
|
|
2
|
+
import { createGlobalSheet, css, injectGlobal } from "./css.mjs";
|
|
3
3
|
import { useTheme } from "./theme/scope.mjs";
|
|
4
|
-
import { useMemo } from "react";
|
|
4
|
+
import { useInsertionEffect, useMemo, useRef } from "react";
|
|
5
5
|
// src/styles/createGlobalStyle.ts
|
|
6
|
+
const isServer = typeof document === "undefined";
|
|
6
7
|
const createGlobalStyle = (template, ...args) => {
|
|
7
8
|
const GlobalStyle = () => {
|
|
8
9
|
const theme = useTheme();
|
|
9
|
-
|
|
10
|
+
const sheetRef = useRef(null);
|
|
11
|
+
const styles = useMemo(() => {
|
|
10
12
|
const props = { theme };
|
|
11
|
-
const
|
|
12
|
-
injectGlobal(
|
|
13
|
+
const resolved = typeof template === "function" ? template(props) : css(template, ...args.map((arg) => typeof arg === "function" ? arg(props) : arg));
|
|
14
|
+
if (isServer) injectGlobal(resolved);
|
|
15
|
+
return resolved;
|
|
13
16
|
}, [theme]);
|
|
17
|
+
useInsertionEffect(() => {
|
|
18
|
+
const sheet = createGlobalSheet();
|
|
19
|
+
sheetRef.current = sheet;
|
|
20
|
+
return () => {
|
|
21
|
+
sheet.remove();
|
|
22
|
+
sheetRef.current = null;
|
|
23
|
+
};
|
|
24
|
+
}, []);
|
|
25
|
+
useInsertionEffect(() => {
|
|
26
|
+
sheetRef.current?.update(styles);
|
|
27
|
+
}, [styles]);
|
|
14
28
|
return null;
|
|
15
29
|
};
|
|
16
30
|
return GlobalStyle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createGlobalStyle.mjs","names":[],"sources":["../../src/styles/createGlobalStyle.ts"],"sourcesContent":["'use client';\n\nimport type { CSSInterpolation } from '@emotion/serialize';\nimport { useMemo } from 'react';\n\nimport { css, injectGlobal } from './css';\nimport { type LobeTheme, useTheme } from './theme/scope';\n\ntype GlobalStyleProps = { theme: LobeTheme };\ntype GlobalInterpolation = CSSInterpolation | ((props: GlobalStyleProps) => CSSInterpolation);\n\nexport const createGlobalStyle = (\n template: TemplateStringsArray | ((props: GlobalStyleProps) => CSSInterpolation),\n ...args: GlobalInterpolation[]\n) => {\n const GlobalStyle = () => {\n const theme = useTheme();\n\n useMemo(() => {\n const props = { theme };\n const
|
|
1
|
+
{"version":3,"file":"createGlobalStyle.mjs","names":[],"sources":["../../src/styles/createGlobalStyle.ts"],"sourcesContent":["'use client';\n\nimport type { CSSInterpolation } from '@emotion/serialize';\nimport { useInsertionEffect, useMemo, useRef } from 'react';\n\nimport { createGlobalSheet, css, injectGlobal } from './css';\nimport { type LobeTheme, useTheme } from './theme/scope';\n\ntype GlobalStyleProps = { theme: LobeTheme };\ntype GlobalInterpolation = CSSInterpolation | ((props: GlobalStyleProps) => CSSInterpolation);\n\nconst isServer = typeof document === 'undefined';\n\nexport const createGlobalStyle = (\n template: TemplateStringsArray | ((props: GlobalStyleProps) => CSSInterpolation),\n ...args: GlobalInterpolation[]\n) => {\n const GlobalStyle = () => {\n const theme = useTheme();\n const sheetRef = useRef<ReturnType<typeof createGlobalSheet>>(null);\n\n const styles = useMemo(() => {\n const props = { theme };\n const resolved =\n typeof template === 'function'\n ? template(props)\n : css(template, ...args.map((arg) => (typeof arg === 'function' ? arg(props) : arg)));\n // Server renders keep feeding the shared cache so extractStaticStyle ships them.\n if (isServer) injectGlobal(resolved as TemplateStringsArray);\n return resolved;\n }, [theme]);\n\n useInsertionEffect(() => {\n const sheet = createGlobalSheet();\n sheetRef.current = sheet;\n return () => {\n sheet.remove();\n sheetRef.current = null;\n };\n }, []);\n\n useInsertionEffect(() => {\n sheetRef.current?.update(styles);\n }, [styles]);\n\n return null;\n };\n\n return GlobalStyle;\n};\n"],"mappings":";;;;;AAWA,MAAM,WAAW,OAAO,aAAa;AAErC,MAAa,qBACX,UACA,GAAG,SACA;CACH,MAAM,oBAAoB;EACxB,MAAM,QAAQ,SAAS;EACvB,MAAM,WAAW,OAA6C,IAAI;EAElE,MAAM,SAAS,cAAc;GAC3B,MAAM,QAAQ,EAAE,MAAM;GACtB,MAAM,WACJ,OAAO,aAAa,aAChB,SAAS,KAAK,IACd,IAAI,UAAU,GAAG,KAAK,KAAK,QAAS,OAAO,QAAQ,aAAa,IAAI,KAAK,IAAI,GAAI,CAAC;GAExF,IAAI,UAAU,aAAa,QAAgC;GAC3D,OAAO;EACT,GAAG,CAAC,KAAK,CAAC;EAEV,yBAAyB;GACvB,MAAM,QAAQ,kBAAkB;GAChC,SAAS,UAAU;GACnB,aAAa;IACX,MAAM,OAAO;IACb,SAAS,UAAU;GACrB;EACF,GAAG,CAAC,CAAC;EAEL,yBAAyB;GACvB,SAAS,SAAS,OAAO,MAAM;EACjC,GAAG,CAAC,MAAM,CAAC;EAEX,OAAO;CACT;CAEA,OAAO;AACT"}
|
package/es/styles/css.mjs
CHANGED
|
@@ -45,6 +45,23 @@ const isSerialized = (value) => typeof value === "object" && value !== null && "
|
|
|
45
45
|
const css = (template, ...args) => serializeStyles([template, ...args], emotion.cache.registered);
|
|
46
46
|
const cx = (...classNames) => emotion.cx(...classNames.map((value) => isSerialized(value) ? emotion.css(value) : value));
|
|
47
47
|
const { injectGlobal, keyframes } = emotion;
|
|
48
|
+
const compileGlobal = (styles) => {
|
|
49
|
+
let rules = "";
|
|
50
|
+
emotion.cache.insert("", serializeStyles([styles], emotion.cache.registered), { insert: (rule) => rules += rule }, false);
|
|
51
|
+
return rules;
|
|
52
|
+
};
|
|
53
|
+
const createGlobalSheet = () => {
|
|
54
|
+
const element = document.createElement("style");
|
|
55
|
+
element.dataset.emotion = `${emotion.cache.key}-global`;
|
|
56
|
+
const { container, tags } = emotion.sheet;
|
|
57
|
+
container.insertBefore(element, tags[0] ?? null);
|
|
58
|
+
return {
|
|
59
|
+
remove: () => element.remove(),
|
|
60
|
+
update: (styles) => {
|
|
61
|
+
element.textContent = compileGlobal(styles);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
};
|
|
48
65
|
const staticCss = (template, ...args) => emotion.css(template, ...args);
|
|
49
66
|
const createStaticStyles = (stylesFn) => stylesFn({
|
|
50
67
|
css: staticCss,
|
|
@@ -65,6 +82,6 @@ const extractStaticStyle = Object.assign((html, _options) => {
|
|
|
65
82
|
tag: `<style data-emotion="${key} ${ids.join(" ")}">${styles}</style>`
|
|
66
83
|
}];
|
|
67
84
|
}, { cache: emotion.cache });
|
|
68
|
-
export { createStaticStyles, css, cssVar, cx, extractStaticStyle, injectGlobal, keyframes, responsive, toCssVarName, toCssVariables, toKebabCase };
|
|
85
|
+
export { createGlobalSheet, createStaticStyles, css, cssVar, cx, extractStaticStyle, injectGlobal, keyframes, responsive, toCssVarName, toCssVariables, toKebabCase };
|
|
69
86
|
|
|
70
87
|
//# sourceMappingURL=css.mjs.map
|
package/es/styles/css.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.mjs","names":[],"sources":["../../src/styles/css.ts"],"sourcesContent":["import createEmotion from '@emotion/css/create-instance';\nimport { type CSSInterpolation, type SerializedStyles, serializeStyles } from '@emotion/serialize';\n\nimport { createLobeToken, type LobeToken } from './theme/createLobeToken';\n\nconst UNITLESS = new Set([\n 'fontWeightStrong',\n 'lineHeight',\n 'lineHeightHeading1',\n 'lineHeightHeading2',\n 'lineHeightHeading3',\n 'lineHeightHeading4',\n 'lineHeightHeading5',\n 'lineHeightLG',\n 'lineHeightSM',\n 'opacityImage',\n 'opacityLoading',\n 'zIndexBase',\n 'zIndexPopupBase',\n]);\n\nconst IGNORED = new Set(['motionBase', 'motionUnit']);\n\nexport const toKebabCase = (str: string) =>\n str\n .replaceAll(/([a-z])([A-Z])/g, '$1-$2')\n .replaceAll(/([a-z])(\\d)/g, '$1-$2')\n .replaceAll(/(\\d)([A-Z])/g, '$1-$2')\n .replaceAll(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')\n .toLowerCase();\n\nexport const toCssVarName = (key: string) => `--lobe-${toKebabCase(key)}`;\n\nexport const toCssVariables = (token: Record<string, number | string>) =>\n Object.fromEntries(\n Object.entries(token)\n .filter(([key]) => !IGNORED.has(key))\n .map(([key, value]) => [\n toCssVarName(key),\n typeof value === 'number' && !UNITLESS.has(key)\n ? `${value}px`\n : String(value).replaceAll(/\\s+/g, ' ').trim(),\n ]),\n );\n\nexport type LobeCssVar = Record<Exclude<keyof LobeToken, 'motionBase' | 'motionUnit'>, string>;\n\nexport const cssVar = Object.fromEntries(\n Object.keys(createLobeToken({ appearance: 'light' }))\n .filter((key) => !IGNORED.has(key))\n .map((key) => [key, `var(${toCssVarName(key)})`]),\n) as LobeCssVar;\n\nconst breakpoints = {\n xs: '@media (max-width: 479.98px)',\n sm: '@media (max-width: 575.98px)',\n md: '@media (max-width: 767.98px)',\n lg: '@media (max-width: 991.98px)',\n xl: '@media (max-width: 1199.98px)',\n xxl: '@media (min-width: 1200px)',\n};\n\nexport const responsive = {\n ...breakpoints,\n desktop: breakpoints.xxl,\n laptop: breakpoints.lg,\n mobile: breakpoints.xs,\n tablet: breakpoints.md,\n};\n\nexport interface StaticStyleUtils {\n css: (template: TemplateStringsArray, ...args: any[]) => string;\n cssVar: LobeCssVar;\n cx: (...classNames: any[]) => string;\n responsive: typeof responsive;\n}\n\nconst emotion = createEmotion({ key: 'acss', speedy: true });\n\nconst isSerialized = (value: unknown): value is SerializedStyles =>\n typeof value === 'object' && value !== null && 'name' in value && 'styles' in value;\n\nexport const css = (\n template: TemplateStringsArray | CSSInterpolation,\n ...args: CSSInterpolation[]\n): SerializedStyles =>\n serializeStyles([template as CSSInterpolation, ...args], emotion.cache.registered);\n\nexport const cx = (...classNames: unknown[]): string =>\n emotion.cx(\n ...(classNames.map((value) => (isSerialized(value) ? emotion.css(value) : value)) as Parameters<\n typeof emotion.cx\n >),\n );\n\nexport const { injectGlobal, keyframes } = emotion;\n\nconst staticCss: StaticStyleUtils['css'] = (template, ...args) => emotion.css(template, ...args);\n\nexport const createStaticStyles = <T>(stylesFn: (utils: StaticStyleUtils) => T): T =>\n stylesFn({ css: staticCss, cssVar, cx, responsive });\n\nexport interface StaticStyleExtract {\n css: string;\n ids: string[];\n key: string;\n tag: string;\n}\n\n// emotion rehydrates `<style data-emotion=\"acss id…\">` from SSR into its cache on the client\nexport const extractStaticStyle = Object.assign(\n (html?: string, _options?: Record<string, unknown>): StaticStyleExtract[] => {\n const { inserted, key, registered } = emotion.cache;\n const used = html\n ? new Set([...html.matchAll(new RegExp(`${key}-([\\\\w-]+)`, 'g'))].map((match) => match[1]))\n : undefined;\n // Same rule as @emotion/server extractCritical: unregistered ids are globals/keyframes and always ship\n const ids = Object.keys(inserted).filter(\n (id) =>\n typeof inserted[id] === 'string' &&\n (!used || used.has(id) || registered[`${key}-${id}`] === undefined),\n );\n const styles = ids.map((id) => inserted[id]).join('');\n if (!styles) return [];\n return [\n {\n css: styles,\n ids,\n key,\n tag: `<style data-emotion=\"${key} ${ids.join(' ')}\">${styles}</style>`,\n },\n ];\n },\n { cache: emotion.cache },\n);\n"],"mappings":";;;;AAKA,MAAM,2BAAW,IAAI,IAAI;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,0BAAU,IAAI,IAAI,CAAC,cAAc,YAAY,CAAC;AAEpD,MAAa,eAAe,QAC1B,IACG,WAAW,mBAAmB,OAAO,CAAC,CACtC,WAAW,gBAAgB,OAAO,CAAC,CACnC,WAAW,gBAAgB,OAAO,CAAC,CACnC,WAAW,yBAAyB,OAAO,CAAC,CAC5C,YAAY;AAEjB,MAAa,gBAAgB,QAAgB,UAAU,YAAY,GAAG;AAEtE,MAAa,kBAAkB,UAC7B,OAAO,YACL,OAAO,QAAQ,KAAK,CAAC,CAClB,QAAQ,CAAC,SAAS,CAAC,QAAQ,IAAI,GAAG,CAAC,CAAC,CACpC,KAAK,CAAC,KAAK,WAAW,CACrB,aAAa,GAAG,GAChB,OAAO,UAAU,YAAY,CAAC,SAAS,IAAI,GAAG,IAC1C,GAAG,MAAM,MACT,OAAO,KAAK,CAAC,CAAC,WAAW,QAAQ,GAAG,CAAC,CAAC,KAAK,CACjD,CAAC,CACL;AAIF,MAAa,SAAS,OAAO,YAC3B,OAAO,KAAK,gBAAgB,EAAE,YAAY,QAAQ,CAAC,CAAC,CAAC,CAClD,QAAQ,QAAQ,CAAC,QAAQ,IAAI,GAAG,CAAC,CAAC,CAClC,KAAK,QAAQ,CAAC,KAAK,OAAO,aAAa,GAAG,EAAE,EAAE,CAAC,CACpD;AAEA,MAAM,cAAc;CAClB,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,KAAK;AACP;AAEA,MAAa,aAAa;CACxB,GAAG;CACH,SAAS,YAAY;CACrB,QAAQ,YAAY;CACpB,QAAQ,YAAY;CACpB,QAAQ,YAAY;AACtB;AASA,MAAM,UAAU,cAAc;CAAE,KAAK;CAAQ,QAAQ;AAAK,CAAC;AAE3D,MAAM,gBAAgB,UACpB,OAAO,UAAU,YAAY,UAAU,QAAQ,UAAU,SAAS,YAAY;AAEhF,MAAa,OACX,UACA,GAAG,SAEH,gBAAgB,CAAC,UAA8B,GAAG,IAAI,GAAG,QAAQ,MAAM,UAAU;AAEnF,MAAa,MAAM,GAAG,eACpB,QAAQ,GACN,GAAI,WAAW,KAAK,UAAW,aAAa,KAAK,IAAI,QAAQ,IAAI,KAAK,IAAI,KAAM,CAGlF;AAEF,MAAa,EAAE,cAAc,cAAc;
|
|
1
|
+
{"version":3,"file":"css.mjs","names":[],"sources":["../../src/styles/css.ts"],"sourcesContent":["import createEmotion from '@emotion/css/create-instance';\nimport { type CSSInterpolation, type SerializedStyles, serializeStyles } from '@emotion/serialize';\n\nimport { createLobeToken, type LobeToken } from './theme/createLobeToken';\n\nconst UNITLESS = new Set([\n 'fontWeightStrong',\n 'lineHeight',\n 'lineHeightHeading1',\n 'lineHeightHeading2',\n 'lineHeightHeading3',\n 'lineHeightHeading4',\n 'lineHeightHeading5',\n 'lineHeightLG',\n 'lineHeightSM',\n 'opacityImage',\n 'opacityLoading',\n 'zIndexBase',\n 'zIndexPopupBase',\n]);\n\nconst IGNORED = new Set(['motionBase', 'motionUnit']);\n\nexport const toKebabCase = (str: string) =>\n str\n .replaceAll(/([a-z])([A-Z])/g, '$1-$2')\n .replaceAll(/([a-z])(\\d)/g, '$1-$2')\n .replaceAll(/(\\d)([A-Z])/g, '$1-$2')\n .replaceAll(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')\n .toLowerCase();\n\nexport const toCssVarName = (key: string) => `--lobe-${toKebabCase(key)}`;\n\nexport const toCssVariables = (token: Record<string, number | string>) =>\n Object.fromEntries(\n Object.entries(token)\n .filter(([key]) => !IGNORED.has(key))\n .map(([key, value]) => [\n toCssVarName(key),\n typeof value === 'number' && !UNITLESS.has(key)\n ? `${value}px`\n : String(value).replaceAll(/\\s+/g, ' ').trim(),\n ]),\n );\n\nexport type LobeCssVar = Record<Exclude<keyof LobeToken, 'motionBase' | 'motionUnit'>, string>;\n\nexport const cssVar = Object.fromEntries(\n Object.keys(createLobeToken({ appearance: 'light' }))\n .filter((key) => !IGNORED.has(key))\n .map((key) => [key, `var(${toCssVarName(key)})`]),\n) as LobeCssVar;\n\nconst breakpoints = {\n xs: '@media (max-width: 479.98px)',\n sm: '@media (max-width: 575.98px)',\n md: '@media (max-width: 767.98px)',\n lg: '@media (max-width: 991.98px)',\n xl: '@media (max-width: 1199.98px)',\n xxl: '@media (min-width: 1200px)',\n};\n\nexport const responsive = {\n ...breakpoints,\n desktop: breakpoints.xxl,\n laptop: breakpoints.lg,\n mobile: breakpoints.xs,\n tablet: breakpoints.md,\n};\n\nexport interface StaticStyleUtils {\n css: (template: TemplateStringsArray, ...args: any[]) => string;\n cssVar: LobeCssVar;\n cx: (...classNames: any[]) => string;\n responsive: typeof responsive;\n}\n\nconst emotion = createEmotion({ key: 'acss', speedy: true });\n\nconst isSerialized = (value: unknown): value is SerializedStyles =>\n typeof value === 'object' && value !== null && 'name' in value && 'styles' in value;\n\nexport const css = (\n template: TemplateStringsArray | CSSInterpolation,\n ...args: CSSInterpolation[]\n): SerializedStyles =>\n serializeStyles([template as CSSInterpolation, ...args], emotion.cache.registered);\n\nexport const cx = (...classNames: unknown[]): string =>\n emotion.cx(\n ...(classNames.map((value) => (isSerialized(value) ? emotion.css(value) : value)) as Parameters<\n typeof emotion.cx\n >),\n );\n\nexport const { injectGlobal, keyframes } = emotion;\n\ntype EmotionSheet = Parameters<typeof emotion.cache.insert>[2];\n\nconst compileGlobal = (styles: CSSInterpolation): string => {\n let rules = '';\n const collector = { insert: (rule: string) => (rules += rule) } as unknown as EmotionSheet;\n emotion.cache.insert('', serializeStyles([styles], emotion.cache.registered), collector, false);\n return rules;\n};\n\n// Owns its rules instead of going through `injectGlobal`, whose per-hash dedupe never\n// re-inserts a style it has seen: switching A → B → A would leave B's rules last and winning.\nexport const createGlobalSheet = () => {\n const element = document.createElement('style');\n element.dataset.emotion = `${emotion.cache.key}-global`;\n const { container, tags } = emotion.sheet as unknown as { container: Node; tags: Node[] };\n container.insertBefore(element, tags[0] ?? null);\n\n return {\n remove: () => element.remove(),\n update: (styles: CSSInterpolation) => {\n element.textContent = compileGlobal(styles);\n },\n };\n};\n\nconst staticCss: StaticStyleUtils['css'] = (template, ...args) => emotion.css(template, ...args);\n\nexport const createStaticStyles = <T>(stylesFn: (utils: StaticStyleUtils) => T): T =>\n stylesFn({ css: staticCss, cssVar, cx, responsive });\n\nexport interface StaticStyleExtract {\n css: string;\n ids: string[];\n key: string;\n tag: string;\n}\n\n// emotion rehydrates `<style data-emotion=\"acss id…\">` from SSR into its cache on the client\nexport const extractStaticStyle = Object.assign(\n (html?: string, _options?: Record<string, unknown>): StaticStyleExtract[] => {\n const { inserted, key, registered } = emotion.cache;\n const used = html\n ? new Set([...html.matchAll(new RegExp(`${key}-([\\\\w-]+)`, 'g'))].map((match) => match[1]))\n : undefined;\n // Same rule as @emotion/server extractCritical: unregistered ids are globals/keyframes and always ship\n const ids = Object.keys(inserted).filter(\n (id) =>\n typeof inserted[id] === 'string' &&\n (!used || used.has(id) || registered[`${key}-${id}`] === undefined),\n );\n const styles = ids.map((id) => inserted[id]).join('');\n if (!styles) return [];\n return [\n {\n css: styles,\n ids,\n key,\n tag: `<style data-emotion=\"${key} ${ids.join(' ')}\">${styles}</style>`,\n },\n ];\n },\n { cache: emotion.cache },\n);\n"],"mappings":";;;;AAKA,MAAM,2BAAW,IAAI,IAAI;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,0BAAU,IAAI,IAAI,CAAC,cAAc,YAAY,CAAC;AAEpD,MAAa,eAAe,QAC1B,IACG,WAAW,mBAAmB,OAAO,CAAC,CACtC,WAAW,gBAAgB,OAAO,CAAC,CACnC,WAAW,gBAAgB,OAAO,CAAC,CACnC,WAAW,yBAAyB,OAAO,CAAC,CAC5C,YAAY;AAEjB,MAAa,gBAAgB,QAAgB,UAAU,YAAY,GAAG;AAEtE,MAAa,kBAAkB,UAC7B,OAAO,YACL,OAAO,QAAQ,KAAK,CAAC,CAClB,QAAQ,CAAC,SAAS,CAAC,QAAQ,IAAI,GAAG,CAAC,CAAC,CACpC,KAAK,CAAC,KAAK,WAAW,CACrB,aAAa,GAAG,GAChB,OAAO,UAAU,YAAY,CAAC,SAAS,IAAI,GAAG,IAC1C,GAAG,MAAM,MACT,OAAO,KAAK,CAAC,CAAC,WAAW,QAAQ,GAAG,CAAC,CAAC,KAAK,CACjD,CAAC,CACL;AAIF,MAAa,SAAS,OAAO,YAC3B,OAAO,KAAK,gBAAgB,EAAE,YAAY,QAAQ,CAAC,CAAC,CAAC,CAClD,QAAQ,QAAQ,CAAC,QAAQ,IAAI,GAAG,CAAC,CAAC,CAClC,KAAK,QAAQ,CAAC,KAAK,OAAO,aAAa,GAAG,EAAE,EAAE,CAAC,CACpD;AAEA,MAAM,cAAc;CAClB,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,KAAK;AACP;AAEA,MAAa,aAAa;CACxB,GAAG;CACH,SAAS,YAAY;CACrB,QAAQ,YAAY;CACpB,QAAQ,YAAY;CACpB,QAAQ,YAAY;AACtB;AASA,MAAM,UAAU,cAAc;CAAE,KAAK;CAAQ,QAAQ;AAAK,CAAC;AAE3D,MAAM,gBAAgB,UACpB,OAAO,UAAU,YAAY,UAAU,QAAQ,UAAU,SAAS,YAAY;AAEhF,MAAa,OACX,UACA,GAAG,SAEH,gBAAgB,CAAC,UAA8B,GAAG,IAAI,GAAG,QAAQ,MAAM,UAAU;AAEnF,MAAa,MAAM,GAAG,eACpB,QAAQ,GACN,GAAI,WAAW,KAAK,UAAW,aAAa,KAAK,IAAI,QAAQ,IAAI,KAAK,IAAI,KAAM,CAGlF;AAEF,MAAa,EAAE,cAAc,cAAc;AAI3C,MAAM,iBAAiB,WAAqC;CAC1D,IAAI,QAAQ;CAEZ,QAAQ,MAAM,OAAO,IAAI,gBAAgB,CAAC,MAAM,GAAG,QAAQ,MAAM,UAAU,GAAG,EAD1D,SAAS,SAAkB,SAAS,KAC8B,GAAG,KAAK;CAC9F,OAAO;AACT;AAIA,MAAa,0BAA0B;CACrC,MAAM,UAAU,SAAS,cAAc,OAAO;CAC9C,QAAQ,QAAQ,UAAU,GAAG,QAAQ,MAAM,IAAI;CAC/C,MAAM,EAAE,WAAW,SAAS,QAAQ;CACpC,UAAU,aAAa,SAAS,KAAK,MAAM,IAAI;CAE/C,OAAO;EACL,cAAc,QAAQ,OAAO;EAC7B,SAAS,WAA6B;GACpC,QAAQ,cAAc,cAAc,MAAM;EAC5C;CACF;AACF;AAEA,MAAM,aAAsC,UAAU,GAAG,SAAS,QAAQ,IAAI,UAAU,GAAG,IAAI;AAE/F,MAAa,sBAAyB,aACpC,SAAS;CAAE,KAAK;CAAW;CAAQ;CAAI;AAAW,CAAC;AAUrD,MAAa,qBAAqB,OAAO,QACtC,MAAe,aAA6D;CAC3E,MAAM,EAAE,UAAU,KAAK,eAAe,QAAQ;CAC9C,MAAM,OAAO,OACT,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS,IAAI,OAAO,GAAG,IAAI,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,UAAU,MAAM,EAAE,CAAC,IACxF,KAAA;CAEJ,MAAM,MAAM,OAAO,KAAK,QAAQ,CAAC,CAAC,QAC/B,OACC,OAAO,SAAS,QAAQ,aACvB,CAAC,QAAQ,KAAK,IAAI,EAAE,KAAK,WAAW,GAAG,IAAI,GAAG,UAAU,KAAA,EAC7D;CACA,MAAM,SAAS,IAAI,KAAK,OAAO,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE;CACpD,IAAI,CAAC,QAAQ,OAAO,CAAC;CACrB,OAAO,CACL;EACE,KAAK;EACL;EACA;EACA,KAAK,wBAAwB,IAAI,GAAG,IAAI,KAAK,GAAG,EAAE,IAAI,OAAO;CAC/D,CACF;AACF,GACA,EAAE,OAAO,QAAQ,MAAM,CACzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/ui",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.9.1",
|
|
4
4
|
"description": "Lobe UI is an open-source UI component library for building AIGC web apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lobehub",
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
"@giscus/react": "^3.1.0",
|
|
160
160
|
"@lobehub/streamdown": "^1.4.0",
|
|
161
161
|
"@mdx-js/mdx": "^3.1.1",
|
|
162
|
-
"@pierre/diffs": "1.
|
|
162
|
+
"@pierre/diffs": "1.6.1",
|
|
163
163
|
"@pierre/highlights": "^0.2.0",
|
|
164
164
|
"@stylexjs/stylex": "0.19.1",
|
|
165
165
|
"@tanstack/form-core": "^1.33.5",
|
package/es/node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.mjs
DELETED
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
import { SKIP as SKIP$1, visitParents } from "unist-util-visit-parents";
|
|
2
|
-
// node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.js
|
|
3
|
-
/**
|
|
4
|
-
* @import {Node as UnistNode, Parent as UnistParent} from 'unist'
|
|
5
|
-
* @import {VisitorResult} from 'unist-util-visit-parents'
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* @typedef {Exclude<import('unist-util-is').Test, undefined> | undefined} Test
|
|
9
|
-
* Test from `unist-util-is`.
|
|
10
|
-
*
|
|
11
|
-
* Note: we have remove and add `undefined`, because otherwise when generating
|
|
12
|
-
* automatic `.d.ts` files, TS tries to flatten paths from a local perspective,
|
|
13
|
-
* which doesn’t work when publishing on npm.
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* @typedef {(
|
|
17
|
-
* Fn extends (value: any) => value is infer Thing
|
|
18
|
-
* ? Thing
|
|
19
|
-
* : Fallback
|
|
20
|
-
* )} Predicate
|
|
21
|
-
* Get the value of a type guard `Fn`.
|
|
22
|
-
* @template Fn
|
|
23
|
-
* Value; typically function that is a type guard (such as `(x): x is Y`).
|
|
24
|
-
* @template Fallback
|
|
25
|
-
* Value to yield if `Fn` is not a type guard.
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
28
|
-
* @typedef {(
|
|
29
|
-
* Check extends null | undefined // No test.
|
|
30
|
-
* ? Value
|
|
31
|
-
* : Value extends {type: Check} // String (type) test.
|
|
32
|
-
* ? Value
|
|
33
|
-
* : Value extends Check // Partial test.
|
|
34
|
-
* ? Value
|
|
35
|
-
* : Check extends Function // Function test.
|
|
36
|
-
* ? Predicate<Check, Value> extends Value
|
|
37
|
-
* ? Predicate<Check, Value>
|
|
38
|
-
* : never
|
|
39
|
-
* : never // Some other test?
|
|
40
|
-
* )} MatchesOne
|
|
41
|
-
* Check whether a node matches a primitive check in the type system.
|
|
42
|
-
* @template Value
|
|
43
|
-
* Value; typically unist `Node`.
|
|
44
|
-
* @template Check
|
|
45
|
-
* Value; typically `unist-util-is`-compatible test, but not arrays.
|
|
46
|
-
*/
|
|
47
|
-
/**
|
|
48
|
-
* @typedef {(
|
|
49
|
-
* Check extends ReadonlyArray<any>
|
|
50
|
-
* ? MatchesOne<Value, Check[number]>
|
|
51
|
-
* : MatchesOne<Value, Check>
|
|
52
|
-
* )} Matches
|
|
53
|
-
* Check whether a node matches a check in the type system.
|
|
54
|
-
* @template Value
|
|
55
|
-
* Value; typically unist `Node`.
|
|
56
|
-
* @template Check
|
|
57
|
-
* Value; typically `unist-util-is`-compatible test.
|
|
58
|
-
*/
|
|
59
|
-
/**
|
|
60
|
-
* @typedef {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10} Uint
|
|
61
|
-
* Number; capped reasonably.
|
|
62
|
-
*/
|
|
63
|
-
/**
|
|
64
|
-
* @typedef {I extends 0 ? 1 : I extends 1 ? 2 : I extends 2 ? 3 : I extends 3 ? 4 : I extends 4 ? 5 : I extends 5 ? 6 : I extends 6 ? 7 : I extends 7 ? 8 : I extends 8 ? 9 : 10} Increment
|
|
65
|
-
* Increment a number in the type system.
|
|
66
|
-
* @template {Uint} [I=0]
|
|
67
|
-
* Index.
|
|
68
|
-
*/
|
|
69
|
-
/**
|
|
70
|
-
* @typedef {(
|
|
71
|
-
* Node extends UnistParent
|
|
72
|
-
* ? Node extends {children: Array<infer Children>}
|
|
73
|
-
* ? Child extends Children ? Node : never
|
|
74
|
-
* : never
|
|
75
|
-
* : never
|
|
76
|
-
* )} InternalParent
|
|
77
|
-
* Collect nodes that can be parents of `Child`.
|
|
78
|
-
* @template {UnistNode} Node
|
|
79
|
-
* All node types in a tree.
|
|
80
|
-
* @template {UnistNode} Child
|
|
81
|
-
* Node to search for.
|
|
82
|
-
*/
|
|
83
|
-
/**
|
|
84
|
-
* @typedef {InternalParent<InclusiveDescendant<Tree>, Child>} Parent
|
|
85
|
-
* Collect nodes in `Tree` that can be parents of `Child`.
|
|
86
|
-
* @template {UnistNode} Tree
|
|
87
|
-
* All node types in a tree.
|
|
88
|
-
* @template {UnistNode} Child
|
|
89
|
-
* Node to search for.
|
|
90
|
-
*/
|
|
91
|
-
/**
|
|
92
|
-
* @typedef {(
|
|
93
|
-
* Depth extends Max
|
|
94
|
-
* ? never
|
|
95
|
-
* :
|
|
96
|
-
* | InternalParent<Node, Child>
|
|
97
|
-
* | InternalAncestor<Node, InternalParent<Node, Child>, Max, Increment<Depth>>
|
|
98
|
-
* )} InternalAncestor
|
|
99
|
-
* Collect nodes in `Tree` that can be ancestors of `Child`.
|
|
100
|
-
* @template {UnistNode} Node
|
|
101
|
-
* All node types in a tree.
|
|
102
|
-
* @template {UnistNode} Child
|
|
103
|
-
* Node to search for.
|
|
104
|
-
* @template {Uint} [Max=10]
|
|
105
|
-
* Max; searches up to this depth.
|
|
106
|
-
* @template {Uint} [Depth=0]
|
|
107
|
-
* Current depth.
|
|
108
|
-
*/
|
|
109
|
-
/**
|
|
110
|
-
* @typedef {(
|
|
111
|
-
* Tree extends UnistParent
|
|
112
|
-
* ? Depth extends Max
|
|
113
|
-
* ? Tree
|
|
114
|
-
* : Tree | InclusiveDescendant<Tree['children'][number], Max, Increment<Depth>>
|
|
115
|
-
* : Tree
|
|
116
|
-
* )} InclusiveDescendant
|
|
117
|
-
* Collect all (inclusive) descendants of `Tree`.
|
|
118
|
-
*
|
|
119
|
-
* > 👉 **Note**: for performance reasons, this seems to be the fastest way to
|
|
120
|
-
* > recurse without actually running into an infinite loop, which the
|
|
121
|
-
* > previous version did.
|
|
122
|
-
* >
|
|
123
|
-
* > Practically, a max of `2` is typically enough assuming a `Root` is
|
|
124
|
-
* > passed, but it doesn’t improve performance.
|
|
125
|
-
* > It gets higher with `List > ListItem > Table > TableRow > TableCell`.
|
|
126
|
-
* > Using up to `10` doesn’t hurt or help either.
|
|
127
|
-
* @template {UnistNode} Tree
|
|
128
|
-
* Tree type.
|
|
129
|
-
* @template {Uint} [Max=10]
|
|
130
|
-
* Max; searches up to this depth.
|
|
131
|
-
* @template {Uint} [Depth=0]
|
|
132
|
-
* Current depth.
|
|
133
|
-
*/
|
|
134
|
-
/**
|
|
135
|
-
* @callback Visitor
|
|
136
|
-
* Handle a node (matching `test`, if given).
|
|
137
|
-
*
|
|
138
|
-
* Visitors are free to transform `node`.
|
|
139
|
-
* They can also transform `parent`.
|
|
140
|
-
*
|
|
141
|
-
* Replacing `node` itself, if `SKIP` is not returned, still causes its
|
|
142
|
-
* descendants to be walked (which is a bug).
|
|
143
|
-
*
|
|
144
|
-
* When adding or removing previous siblings of `node` (or next siblings, in
|
|
145
|
-
* case of reverse), the `Visitor` should return a new `Index` to specify the
|
|
146
|
-
* sibling to traverse after `node` is traversed.
|
|
147
|
-
* Adding or removing next siblings of `node` (or previous siblings, in case
|
|
148
|
-
* of reverse) is handled as expected without needing to return a new `Index`.
|
|
149
|
-
*
|
|
150
|
-
* Removing the children property of `parent` still results in them being
|
|
151
|
-
* traversed.
|
|
152
|
-
* @param {Visited} node
|
|
153
|
-
* Found node.
|
|
154
|
-
* @param {Visited extends UnistNode ? number | undefined : never} index
|
|
155
|
-
* Index of `node` in `parent`.
|
|
156
|
-
* @param {Ancestor extends UnistParent ? Ancestor | undefined : never} parent
|
|
157
|
-
* Parent of `node`.
|
|
158
|
-
* @returns {VisitorResult}
|
|
159
|
-
* What to do next.
|
|
160
|
-
*
|
|
161
|
-
* An `Index` is treated as a tuple of `[CONTINUE, Index]`.
|
|
162
|
-
* An `Action` is treated as a tuple of `[Action]`.
|
|
163
|
-
*
|
|
164
|
-
* Passing a tuple back only makes sense if the `Action` is `SKIP`.
|
|
165
|
-
* When the `Action` is `EXIT`, that action can be returned.
|
|
166
|
-
* When the `Action` is `CONTINUE`, `Index` can be returned.
|
|
167
|
-
* @template {UnistNode} [Visited=UnistNode]
|
|
168
|
-
* Visited node type.
|
|
169
|
-
* @template {UnistParent} [Ancestor=UnistParent]
|
|
170
|
-
* Ancestor type.
|
|
171
|
-
*/
|
|
172
|
-
/**
|
|
173
|
-
* @typedef {Visitor<Visited, Parent<Ancestor, Visited>>} BuildVisitorFromMatch
|
|
174
|
-
* Build a typed `Visitor` function from a node and all possible parents.
|
|
175
|
-
*
|
|
176
|
-
* It will infer which values are passed as `node` and which as `parent`.
|
|
177
|
-
* @template {UnistNode} Visited
|
|
178
|
-
* Node type.
|
|
179
|
-
* @template {UnistParent} Ancestor
|
|
180
|
-
* Parent type.
|
|
181
|
-
*/
|
|
182
|
-
/**
|
|
183
|
-
* @typedef {(
|
|
184
|
-
* BuildVisitorFromMatch<
|
|
185
|
-
* Matches<Descendant, Check>,
|
|
186
|
-
* Extract<Descendant, UnistParent>
|
|
187
|
-
* >
|
|
188
|
-
* )} BuildVisitorFromDescendants
|
|
189
|
-
* Build a typed `Visitor` function from a list of descendants and a test.
|
|
190
|
-
*
|
|
191
|
-
* It will infer which values are passed as `node` and which as `parent`.
|
|
192
|
-
* @template {UnistNode} Descendant
|
|
193
|
-
* Node type.
|
|
194
|
-
* @template {Test} Check
|
|
195
|
-
* Test type.
|
|
196
|
-
*/
|
|
197
|
-
/**
|
|
198
|
-
* @typedef {(
|
|
199
|
-
* BuildVisitorFromDescendants<
|
|
200
|
-
* InclusiveDescendant<Tree>,
|
|
201
|
-
* Check
|
|
202
|
-
* >
|
|
203
|
-
* )} BuildVisitor
|
|
204
|
-
* Build a typed `Visitor` function from a tree and a test.
|
|
205
|
-
*
|
|
206
|
-
* It will infer which values are passed as `node` and which as `parent`.
|
|
207
|
-
* @template {UnistNode} [Tree=UnistNode]
|
|
208
|
-
* Node type.
|
|
209
|
-
* @template {Test} [Check=Test]
|
|
210
|
-
* Test type.
|
|
211
|
-
*/
|
|
212
|
-
/**
|
|
213
|
-
* Visit nodes.
|
|
214
|
-
*
|
|
215
|
-
* This algorithm performs *depth-first* *tree traversal* in *preorder*
|
|
216
|
-
* (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).
|
|
217
|
-
*
|
|
218
|
-
* You can choose for which nodes `visitor` is called by passing a `test`.
|
|
219
|
-
* For complex tests, you should test yourself in `visitor`, as it will be
|
|
220
|
-
* faster and will have improved type information.
|
|
221
|
-
*
|
|
222
|
-
* Walking the tree is an intensive task.
|
|
223
|
-
* Make use of the return values of the visitor when possible.
|
|
224
|
-
* Instead of walking a tree multiple times, walk it once, use `unist-util-is`
|
|
225
|
-
* to check if a node matches, and then perform different operations.
|
|
226
|
-
*
|
|
227
|
-
* You can change the tree.
|
|
228
|
-
* See `Visitor` for more info.
|
|
229
|
-
*
|
|
230
|
-
* @overload
|
|
231
|
-
* @param {Tree} tree
|
|
232
|
-
* @param {Check} check
|
|
233
|
-
* @param {BuildVisitor<Tree, Check>} visitor
|
|
234
|
-
* @param {boolean | null | undefined} [reverse]
|
|
235
|
-
* @returns {undefined}
|
|
236
|
-
*
|
|
237
|
-
* @overload
|
|
238
|
-
* @param {Tree} tree
|
|
239
|
-
* @param {BuildVisitor<Tree>} visitor
|
|
240
|
-
* @param {boolean | null | undefined} [reverse]
|
|
241
|
-
* @returns {undefined}
|
|
242
|
-
*
|
|
243
|
-
* @param {UnistNode} tree
|
|
244
|
-
* Tree to traverse.
|
|
245
|
-
* @param {Visitor | Test} testOrVisitor
|
|
246
|
-
* `unist-util-is`-compatible test (optional, omit to pass a visitor).
|
|
247
|
-
* @param {Visitor | boolean | null | undefined} [visitorOrReverse]
|
|
248
|
-
* Handle each node (when test is omitted, pass `reverse`).
|
|
249
|
-
* @param {boolean | null | undefined} [maybeReverse=false]
|
|
250
|
-
* Traverse in reverse preorder (NRL) instead of the default preorder (NLR).
|
|
251
|
-
* @returns {undefined}
|
|
252
|
-
* Nothing.
|
|
253
|
-
*
|
|
254
|
-
* @template {UnistNode} Tree
|
|
255
|
-
* Node type.
|
|
256
|
-
* @template {Test} Check
|
|
257
|
-
* `unist-util-is`-compatible test.
|
|
258
|
-
*/
|
|
259
|
-
function visit(tree, testOrVisitor, visitorOrReverse, maybeReverse) {
|
|
260
|
-
/** @type {boolean | null | undefined} */
|
|
261
|
-
let reverse;
|
|
262
|
-
/** @type {Test} */
|
|
263
|
-
let test;
|
|
264
|
-
/** @type {Visitor} */
|
|
265
|
-
let visitor;
|
|
266
|
-
if (typeof testOrVisitor === "function" && typeof visitorOrReverse !== "function") {
|
|
267
|
-
test = void 0;
|
|
268
|
-
visitor = testOrVisitor;
|
|
269
|
-
reverse = visitorOrReverse;
|
|
270
|
-
} else {
|
|
271
|
-
test = testOrVisitor;
|
|
272
|
-
visitor = visitorOrReverse;
|
|
273
|
-
reverse = maybeReverse;
|
|
274
|
-
}
|
|
275
|
-
visitParents(tree, test, overload, reverse);
|
|
276
|
-
/**
|
|
277
|
-
* @param {UnistNode} node
|
|
278
|
-
* @param {Array<UnistParent>} parents
|
|
279
|
-
*/
|
|
280
|
-
function overload(node, parents) {
|
|
281
|
-
const parent = parents[parents.length - 1];
|
|
282
|
-
const index = parent ? parent.children.indexOf(node) : void 0;
|
|
283
|
-
return visitor(node, index, parent);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
export { SKIP$1 as SKIP, visit };
|
|
287
|
-
|
|
288
|
-
//# sourceMappingURL=index.mjs.map
|
package/es/node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.js"],"sourcesContent":["/**\n * @import {Node as UnistNode, Parent as UnistParent} from 'unist'\n * @import {VisitorResult} from 'unist-util-visit-parents'\n */\n\n/**\n * @typedef {Exclude<import('unist-util-is').Test, undefined> | undefined} Test\n * Test from `unist-util-is`.\n *\n * Note: we have remove and add `undefined`, because otherwise when generating\n * automatic `.d.ts` files, TS tries to flatten paths from a local perspective,\n * which doesn’t work when publishing on npm.\n */\n\n// To do: use types from `unist-util-visit-parents` when it’s released.\n\n/**\n * @typedef {(\n * Fn extends (value: any) => value is infer Thing\n * ? Thing\n * : Fallback\n * )} Predicate\n * Get the value of a type guard `Fn`.\n * @template Fn\n * Value; typically function that is a type guard (such as `(x): x is Y`).\n * @template Fallback\n * Value to yield if `Fn` is not a type guard.\n */\n\n/**\n * @typedef {(\n * Check extends null | undefined // No test.\n * ? Value\n * : Value extends {type: Check} // String (type) test.\n * ? Value\n * : Value extends Check // Partial test.\n * ? Value\n * : Check extends Function // Function test.\n * ? Predicate<Check, Value> extends Value\n * ? Predicate<Check, Value>\n * : never\n * : never // Some other test?\n * )} MatchesOne\n * Check whether a node matches a primitive check in the type system.\n * @template Value\n * Value; typically unist `Node`.\n * @template Check\n * Value; typically `unist-util-is`-compatible test, but not arrays.\n */\n\n/**\n * @typedef {(\n * Check extends ReadonlyArray<any>\n * ? MatchesOne<Value, Check[number]>\n * : MatchesOne<Value, Check>\n * )} Matches\n * Check whether a node matches a check in the type system.\n * @template Value\n * Value; typically unist `Node`.\n * @template Check\n * Value; typically `unist-util-is`-compatible test.\n */\n\n/**\n * @typedef {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10} Uint\n * Number; capped reasonably.\n */\n\n/**\n * @typedef {I extends 0 ? 1 : I extends 1 ? 2 : I extends 2 ? 3 : I extends 3 ? 4 : I extends 4 ? 5 : I extends 5 ? 6 : I extends 6 ? 7 : I extends 7 ? 8 : I extends 8 ? 9 : 10} Increment\n * Increment a number in the type system.\n * @template {Uint} [I=0]\n * Index.\n */\n\n/**\n * @typedef {(\n * Node extends UnistParent\n * ? Node extends {children: Array<infer Children>}\n * ? Child extends Children ? Node : never\n * : never\n * : never\n * )} InternalParent\n * Collect nodes that can be parents of `Child`.\n * @template {UnistNode} Node\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n */\n\n/**\n * @typedef {InternalParent<InclusiveDescendant<Tree>, Child>} Parent\n * Collect nodes in `Tree` that can be parents of `Child`.\n * @template {UnistNode} Tree\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n */\n\n/**\n * @typedef {(\n * Depth extends Max\n * ? never\n * :\n * | InternalParent<Node, Child>\n * | InternalAncestor<Node, InternalParent<Node, Child>, Max, Increment<Depth>>\n * )} InternalAncestor\n * Collect nodes in `Tree` that can be ancestors of `Child`.\n * @template {UnistNode} Node\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n * @template {Uint} [Max=10]\n * Max; searches up to this depth.\n * @template {Uint} [Depth=0]\n * Current depth.\n */\n\n/**\n * @typedef {(\n * Tree extends UnistParent\n * ? Depth extends Max\n * ? Tree\n * : Tree | InclusiveDescendant<Tree['children'][number], Max, Increment<Depth>>\n * : Tree\n * )} InclusiveDescendant\n * Collect all (inclusive) descendants of `Tree`.\n *\n * > 👉 **Note**: for performance reasons, this seems to be the fastest way to\n * > recurse without actually running into an infinite loop, which the\n * > previous version did.\n * >\n * > Practically, a max of `2` is typically enough assuming a `Root` is\n * > passed, but it doesn’t improve performance.\n * > It gets higher with `List > ListItem > Table > TableRow > TableCell`.\n * > Using up to `10` doesn’t hurt or help either.\n * @template {UnistNode} Tree\n * Tree type.\n * @template {Uint} [Max=10]\n * Max; searches up to this depth.\n * @template {Uint} [Depth=0]\n * Current depth.\n */\n\n/**\n * @callback Visitor\n * Handle a node (matching `test`, if given).\n *\n * Visitors are free to transform `node`.\n * They can also transform `parent`.\n *\n * Replacing `node` itself, if `SKIP` is not returned, still causes its\n * descendants to be walked (which is a bug).\n *\n * When adding or removing previous siblings of `node` (or next siblings, in\n * case of reverse), the `Visitor` should return a new `Index` to specify the\n * sibling to traverse after `node` is traversed.\n * Adding or removing next siblings of `node` (or previous siblings, in case\n * of reverse) is handled as expected without needing to return a new `Index`.\n *\n * Removing the children property of `parent` still results in them being\n * traversed.\n * @param {Visited} node\n * Found node.\n * @param {Visited extends UnistNode ? number | undefined : never} index\n * Index of `node` in `parent`.\n * @param {Ancestor extends UnistParent ? Ancestor | undefined : never} parent\n * Parent of `node`.\n * @returns {VisitorResult}\n * What to do next.\n *\n * An `Index` is treated as a tuple of `[CONTINUE, Index]`.\n * An `Action` is treated as a tuple of `[Action]`.\n *\n * Passing a tuple back only makes sense if the `Action` is `SKIP`.\n * When the `Action` is `EXIT`, that action can be returned.\n * When the `Action` is `CONTINUE`, `Index` can be returned.\n * @template {UnistNode} [Visited=UnistNode]\n * Visited node type.\n * @template {UnistParent} [Ancestor=UnistParent]\n * Ancestor type.\n */\n\n/**\n * @typedef {Visitor<Visited, Parent<Ancestor, Visited>>} BuildVisitorFromMatch\n * Build a typed `Visitor` function from a node and all possible parents.\n *\n * It will infer which values are passed as `node` and which as `parent`.\n * @template {UnistNode} Visited\n * Node type.\n * @template {UnistParent} Ancestor\n * Parent type.\n */\n\n/**\n * @typedef {(\n * BuildVisitorFromMatch<\n * Matches<Descendant, Check>,\n * Extract<Descendant, UnistParent>\n * >\n * )} BuildVisitorFromDescendants\n * Build a typed `Visitor` function from a list of descendants and a test.\n *\n * It will infer which values are passed as `node` and which as `parent`.\n * @template {UnistNode} Descendant\n * Node type.\n * @template {Test} Check\n * Test type.\n */\n\n/**\n * @typedef {(\n * BuildVisitorFromDescendants<\n * InclusiveDescendant<Tree>,\n * Check\n * >\n * )} BuildVisitor\n * Build a typed `Visitor` function from a tree and a test.\n *\n * It will infer which values are passed as `node` and which as `parent`.\n * @template {UnistNode} [Tree=UnistNode]\n * Node type.\n * @template {Test} [Check=Test]\n * Test type.\n */\n\nimport {visitParents} from 'unist-util-visit-parents'\n\nexport {CONTINUE, EXIT, SKIP} from 'unist-util-visit-parents'\n\n/**\n * Visit nodes.\n *\n * This algorithm performs *depth-first* *tree traversal* in *preorder*\n * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).\n *\n * You can choose for which nodes `visitor` is called by passing a `test`.\n * For complex tests, you should test yourself in `visitor`, as it will be\n * faster and will have improved type information.\n *\n * Walking the tree is an intensive task.\n * Make use of the return values of the visitor when possible.\n * Instead of walking a tree multiple times, walk it once, use `unist-util-is`\n * to check if a node matches, and then perform different operations.\n *\n * You can change the tree.\n * See `Visitor` for more info.\n *\n * @overload\n * @param {Tree} tree\n * @param {Check} check\n * @param {BuildVisitor<Tree, Check>} visitor\n * @param {boolean | null | undefined} [reverse]\n * @returns {undefined}\n *\n * @overload\n * @param {Tree} tree\n * @param {BuildVisitor<Tree>} visitor\n * @param {boolean | null | undefined} [reverse]\n * @returns {undefined}\n *\n * @param {UnistNode} tree\n * Tree to traverse.\n * @param {Visitor | Test} testOrVisitor\n * `unist-util-is`-compatible test (optional, omit to pass a visitor).\n * @param {Visitor | boolean | null | undefined} [visitorOrReverse]\n * Handle each node (when test is omitted, pass `reverse`).\n * @param {boolean | null | undefined} [maybeReverse=false]\n * Traverse in reverse preorder (NRL) instead of the default preorder (NLR).\n * @returns {undefined}\n * Nothing.\n *\n * @template {UnistNode} Tree\n * Node type.\n * @template {Test} Check\n * `unist-util-is`-compatible test.\n */\nexport function visit(tree, testOrVisitor, visitorOrReverse, maybeReverse) {\n /** @type {boolean | null | undefined} */\n let reverse\n /** @type {Test} */\n let test\n /** @type {Visitor} */\n let visitor\n\n if (\n typeof testOrVisitor === 'function' &&\n typeof visitorOrReverse !== 'function'\n ) {\n test = undefined\n visitor = testOrVisitor\n reverse = visitorOrReverse\n } else {\n // @ts-expect-error: assume the overload with test was given.\n test = testOrVisitor\n // @ts-expect-error: assume the overload with test was given.\n visitor = visitorOrReverse\n reverse = maybeReverse\n }\n\n visitParents(tree, test, overload, reverse)\n\n /**\n * @param {UnistNode} node\n * @param {Array<UnistParent>} parents\n */\n function overload(node, parents) {\n const parent = parents[parents.length - 1]\n const index = parent ? parent.children.indexOf(node) : undefined\n return visitor(node, index, parent)\n }\n}\n"],"ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqRA,SAAgB,MAAM,MAAM,eAAe,kBAAkB,cAAc;;CAEzE,IAAI;;CAEJ,IAAI;;CAEJ,IAAI;CAEJ,IACE,OAAO,kBAAkB,cACzB,OAAO,qBAAqB,YAC5B;EACA,OAAO,KAAA;EACP,UAAU;EACV,UAAU;CACZ,OAAO;EAEL,OAAO;EAEP,UAAU;EACV,UAAU;CACZ;CAEA,aAAa,MAAM,MAAM,UAAU,OAAO;;;;;CAM1C,SAAS,SAAS,MAAM,SAAS;EAC/B,MAAM,SAAS,QAAQ,QAAQ,SAAS;EACxC,MAAM,QAAQ,SAAS,OAAO,SAAS,QAAQ,IAAI,IAAI,KAAA;EACvD,OAAO,QAAQ,MAAM,OAAO,MAAM;CACpC;AACF"}
|