@lobehub/ui 6.9.0 → 6.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/es/Accordion/style.d.mts +1 -1
  2. package/es/Button/style.mjs +14 -14
  3. package/es/ColorPicker/style.mjs +2 -2
  4. package/es/ColorSwatches/style.mjs +2 -2
  5. package/es/ConfigProvider/cdnAssets.mjs +28 -1
  6. package/es/ConfigProvider/cdnAssets.mjs.map +1 -1
  7. package/es/ConfigProvider/index.mjs +2 -23
  8. package/es/ConfigProvider/index.mjs.map +1 -1
  9. package/es/DraggablePanel/style.mjs +1 -1
  10. package/es/DraggableSideNav/style.mjs +1 -1
  11. package/es/FloatingPanel/style.mjs +1 -1
  12. package/es/Image/style.mjs +1 -1
  13. package/es/Input/style.mjs +3 -3
  14. package/es/Markdown/plugins/rehypeCustomFootnotes.mjs +1 -1
  15. package/es/Markdown/plugins/rehypeKatexDir.mjs +1 -1
  16. package/es/Markdown/plugins/remarkBr.mjs +1 -1
  17. package/es/Markdown/plugins/remarkCjkAutolink.mjs +1 -1
  18. package/es/Markdown/plugins/remarkColor.mjs +1 -1
  19. package/es/Markdown/plugins/remarkCustomFootnotes.mjs +1 -1
  20. package/es/Markdown/plugins/remarkGfmPlus.mjs +1 -1
  21. package/es/Markdown/plugins/remarkVideo.mjs +1 -1
  22. package/es/Select/style.mjs +1 -1
  23. package/es/Slider/style.mjs +1 -1
  24. package/es/Tabs/style.d.mts +1 -1
  25. package/es/Text/style.d.mts +1 -1
  26. package/es/awesome/GradientButton/style.mjs +1 -1
  27. package/es/index.d.mts +2 -1
  28. package/es/index.mjs +2 -1
  29. package/es/node_modules/.pnpm/unist-util-visit@5.2.0/node_modules/unist-util-visit/lib/index.mjs +289 -0
  30. package/es/node_modules/.pnpm/unist-util-visit@5.2.0/node_modules/unist-util-visit/lib/index.mjs.map +1 -0
  31. package/es/styles/createGlobalStyle.mjs +19 -5
  32. package/es/styles/createGlobalStyle.mjs.map +1 -1
  33. package/es/styles/css.mjs +18 -1
  34. package/es/styles/css.mjs.map +1 -1
  35. package/es/styles/index.d.mts +2 -1
  36. package/es/styles/index.mjs +2 -1
  37. package/es/styles/theme/themeCss.mjs +6 -0
  38. package/es/styles/theme/themeCss.mjs.map +1 -1
  39. package/es/styles/theme/token/base.mjs +3 -54
  40. package/es/styles/theme/token/base.mjs.map +1 -1
  41. package/es/styles/theme/token/font.d.mts +7 -0
  42. package/es/styles/theme/token/font.mjs +187 -0
  43. package/es/styles/theme/token/font.mjs.map +1 -0
  44. package/es/theme.css +52 -2
  45. package/package.json +1 -1
  46. package/es/node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.mjs +0 -288
  47. package/es/node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.mjs.map +0 -1
@@ -0,0 +1,7 @@
1
+ export interface GenFontFamilyOptions {
2
+ locale?: string;
3
+ prepend?: (string | undefined)[];
4
+ }
5
+ export declare const genFontFamily: ({ locale, prepend }?: GenFontFamilyOptions) => string;
6
+ export declare const genFontFamilyCode: ({ locale, prepend }?: GenFontFamilyOptions) => string;
7
+ //# sourceMappingURL=font.d.mts.map
@@ -0,0 +1,187 @@
1
+ // src/styles/theme/token/font.ts
2
+ const SYSTEM_SANS = [
3
+ "-apple-system",
4
+ "BlinkMacSystemFont",
5
+ "Segoe UI Variable Display",
6
+ "Segoe UI",
7
+ "Roboto",
8
+ "Helvetica Neue",
9
+ "Arial"
10
+ ];
11
+ const LATIN = ["Geist", ...SYSTEM_SANS];
12
+ const LATIN_ZH_HANS = ["HarmonyOS Sans", ...SYSTEM_SANS];
13
+ const CODE = [
14
+ "Geist Mono",
15
+ "ui-monospace",
16
+ "SFMono-Regular",
17
+ "SF Mono",
18
+ "Menlo",
19
+ "Cascadia Code",
20
+ "Consolas",
21
+ "Liberation Mono"
22
+ ];
23
+ const SC_SYSTEM = [
24
+ "PingFang SC",
25
+ "Hiragino Sans GB",
26
+ "Microsoft YaHei UI",
27
+ "Microsoft YaHei",
28
+ "Source Han Sans SC",
29
+ "Noto Sans CJK SC"
30
+ ];
31
+ const SC = ["HarmonyOS Sans SC", ...SC_SYSTEM];
32
+ const TC = [
33
+ "PingFang TC",
34
+ "Hiragino Sans CNS",
35
+ "Microsoft JhengHei UI",
36
+ "Microsoft JhengHei",
37
+ "Source Han Sans TC",
38
+ "Noto Sans CJK TC"
39
+ ];
40
+ const HK = [
41
+ "PingFang HK",
42
+ "Source Han Sans HC",
43
+ "Noto Sans CJK HK",
44
+ ...TC
45
+ ];
46
+ const MO = ["PingFang MO", ...HK];
47
+ const JP = [
48
+ "Hiragino Sans",
49
+ "Hiragino Kaku Gothic ProN",
50
+ "Yu Gothic UI",
51
+ "Yu Gothic",
52
+ "Meiryo",
53
+ "Source Han Sans JP",
54
+ "Noto Sans CJK JP"
55
+ ];
56
+ const KR = [
57
+ "Apple SD Gothic Neo",
58
+ "Malgun Gothic",
59
+ "Source Han Sans KR",
60
+ "Noto Sans CJK KR"
61
+ ];
62
+ const ARABIC = [
63
+ "SF Arabic",
64
+ "Geeza Pro",
65
+ "Noto Sans Arabic",
66
+ "Tahoma"
67
+ ];
68
+ const HEBREW = [
69
+ "SF Hebrew",
70
+ "Arial Hebrew",
71
+ "Noto Sans Hebrew"
72
+ ];
73
+ const THAI = [
74
+ "Thonburi",
75
+ "Leelawadee UI",
76
+ "Noto Sans Thai"
77
+ ];
78
+ const DEVANAGARI = [
79
+ "Kohinoor Devanagari",
80
+ "Nirmala UI",
81
+ "Noto Sans Devanagari"
82
+ ];
83
+ const FALLBACK = [
84
+ "ui-sans-serif",
85
+ "system-ui",
86
+ "sans-serif"
87
+ ];
88
+ const FALLBACK_CODE = ["monospace"];
89
+ const EMOJI = [
90
+ "Apple Color Emoji",
91
+ "Segoe UI Emoji",
92
+ "Segoe UI Symbol",
93
+ "Noto Color Emoji"
94
+ ];
95
+ const LOCALE_FONTS = [
96
+ {
97
+ langs: ["zh"],
98
+ latin: LATIN_ZH_HANS
99
+ },
100
+ {
101
+ langs: ["zh-TW", "zh-Hant"],
102
+ latin: SYSTEM_SANS,
103
+ local: TC,
104
+ sc: SC_SYSTEM
105
+ },
106
+ {
107
+ langs: ["zh-HK"],
108
+ latin: SYSTEM_SANS,
109
+ local: HK,
110
+ sc: SC_SYSTEM
111
+ },
112
+ {
113
+ langs: ["zh-MO"],
114
+ latin: SYSTEM_SANS,
115
+ local: MO,
116
+ sc: SC_SYSTEM
117
+ },
118
+ {
119
+ langs: ["ja"],
120
+ local: JP
121
+ },
122
+ {
123
+ langs: ["ko"],
124
+ local: KR
125
+ },
126
+ {
127
+ langs: ["ar", "fa"],
128
+ local: ARABIC
129
+ },
130
+ {
131
+ langs: ["he"],
132
+ local: HEBREW
133
+ },
134
+ {
135
+ langs: ["th"],
136
+ local: THAI
137
+ },
138
+ {
139
+ langs: [
140
+ "hi",
141
+ "mr",
142
+ "ne"
143
+ ],
144
+ local: DEVANAGARI
145
+ }
146
+ ];
147
+ const matchLocaleFonts = (locale) => {
148
+ if (!locale) return;
149
+ const tag = locale.toLowerCase();
150
+ let best;
151
+ for (const fonts of LOCALE_FONTS) for (const lang of fonts.langs) {
152
+ const prefix = lang.toLowerCase();
153
+ if (tag !== prefix && !tag.startsWith(`${prefix}-`)) continue;
154
+ if (!best || prefix.length > best.length) best = {
155
+ fonts,
156
+ length: prefix.length
157
+ };
158
+ }
159
+ return best?.fonts;
160
+ };
161
+ const quote = (font) => font.includes(",") || font.includes("\"") || !font.includes(" ") ? font : `"${font}"`;
162
+ const join = (fonts) => fonts.map((font) => font?.trim()).filter((font) => !!font).map(quote).join(",");
163
+ const genFontFamily = ({ locale, prepend = [] } = {}) => {
164
+ const fonts = matchLocaleFonts(locale);
165
+ return join([
166
+ ...prepend,
167
+ ...fonts?.latin ?? LATIN,
168
+ ...fonts?.local ?? [],
169
+ ...fonts?.sc ?? SC,
170
+ ...FALLBACK,
171
+ ...EMOJI
172
+ ]);
173
+ };
174
+ const genFontFamilyCode = ({ locale, prepend = [] } = {}) => {
175
+ const fonts = matchLocaleFonts(locale);
176
+ return join([
177
+ ...prepend,
178
+ ...CODE,
179
+ ...fonts?.local ?? [],
180
+ ...fonts?.sc ?? SC,
181
+ ...FALLBACK_CODE,
182
+ ...EMOJI
183
+ ]);
184
+ };
185
+ export { LOCALE_FONTS, genFontFamily, genFontFamilyCode };
186
+
187
+ //# sourceMappingURL=font.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"font.mjs","names":[],"sources":["../../../../src/styles/theme/token/font.ts"],"sourcesContent":["const SYSTEM_SANS = [\n '-apple-system',\n 'BlinkMacSystemFont',\n 'Segoe UI Variable Display',\n 'Segoe UI',\n 'Roboto',\n 'Helvetica Neue',\n 'Arial',\n];\n\nconst LATIN = ['Geist', ...SYSTEM_SANS];\n\nconst LATIN_ZH_HANS = ['HarmonyOS Sans', ...SYSTEM_SANS];\n\nconst CODE = [\n 'Geist Mono',\n 'ui-monospace',\n 'SFMono-Regular',\n 'SF Mono',\n 'Menlo',\n 'Cascadia Code',\n 'Consolas',\n 'Liberation Mono',\n];\n\nconst SC_SYSTEM = [\n 'PingFang SC',\n 'Hiragino Sans GB',\n 'Microsoft YaHei UI',\n 'Microsoft YaHei',\n 'Source Han Sans SC',\n 'Noto Sans CJK SC',\n];\n\nconst SC = ['HarmonyOS Sans SC', ...SC_SYSTEM];\n\nconst TC = [\n 'PingFang TC',\n 'Hiragino Sans CNS',\n 'Microsoft JhengHei UI',\n 'Microsoft JhengHei',\n 'Source Han Sans TC',\n 'Noto Sans CJK TC',\n];\n\nconst HK = ['PingFang HK', 'Source Han Sans HC', 'Noto Sans CJK HK', ...TC];\n\nconst MO = ['PingFang MO', ...HK];\n\nconst JP = [\n 'Hiragino Sans',\n 'Hiragino Kaku Gothic ProN',\n 'Yu Gothic UI',\n 'Yu Gothic',\n 'Meiryo',\n 'Source Han Sans JP',\n 'Noto Sans CJK JP',\n];\n\nconst KR = ['Apple SD Gothic Neo', 'Malgun Gothic', 'Source Han Sans KR', 'Noto Sans CJK KR'];\n\nconst ARABIC = ['SF Arabic', 'Geeza Pro', 'Noto Sans Arabic', 'Tahoma'];\n\nconst HEBREW = ['SF Hebrew', 'Arial Hebrew', 'Noto Sans Hebrew'];\n\nconst THAI = ['Thonburi', 'Leelawadee UI', 'Noto Sans Thai'];\n\nconst DEVANAGARI = ['Kohinoor Devanagari', 'Nirmala UI', 'Noto Sans Devanagari'];\n\nconst FALLBACK = ['ui-sans-serif', 'system-ui', 'sans-serif'];\n\nconst FALLBACK_CODE = ['monospace'];\n\nconst EMOJI = ['Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'];\n\ninterface LocaleFonts {\n langs: string[];\n latin?: string[];\n local?: string[];\n sc?: string[];\n}\n\n// Han glyphs differ per region and the first CJK family in the stack wins, so a locale's own\n// families go ahead of the SC fallback. Traditional chinese stays on system fonts because\n// HarmonyOS Sans SC draws traditional characters with mainland glyph shapes.\n// Later entries are more specific: the generated :lang() rules rely on this source order.\nexport const LOCALE_FONTS: LocaleFonts[] = [\n { langs: ['zh'], latin: LATIN_ZH_HANS },\n { langs: ['zh-TW', 'zh-Hant'], latin: SYSTEM_SANS, local: TC, sc: SC_SYSTEM },\n { langs: ['zh-HK'], latin: SYSTEM_SANS, local: HK, sc: SC_SYSTEM },\n { langs: ['zh-MO'], latin: SYSTEM_SANS, local: MO, sc: SC_SYSTEM },\n { langs: ['ja'], local: JP },\n { langs: ['ko'], local: KR },\n { langs: ['ar', 'fa'], local: ARABIC },\n { langs: ['he'], local: HEBREW },\n { langs: ['th'], local: THAI },\n { langs: ['hi', 'mr', 'ne'], local: DEVANAGARI },\n];\n\nconst matchLocaleFonts = (locale?: string): LocaleFonts | undefined => {\n if (!locale) return;\n const tag = locale.toLowerCase();\n let best: { fonts: LocaleFonts; length: number } | undefined;\n\n for (const fonts of LOCALE_FONTS) {\n for (const lang of fonts.langs) {\n const prefix = lang.toLowerCase();\n if (tag !== prefix && !tag.startsWith(`${prefix}-`)) continue;\n if (!best || prefix.length > best.length) best = { fonts, length: prefix.length };\n }\n }\n\n return best?.fonts;\n};\n\nconst quote = (font: string) =>\n font.includes(',') || font.includes('\"') || !font.includes(' ') ? font : `\"${font}\"`;\n\nconst join = (fonts: (string | undefined)[]) =>\n fonts\n .map((font) => font?.trim())\n .filter((font): font is string => !!font)\n .map(quote)\n .join(',');\n\nexport interface GenFontFamilyOptions {\n locale?: string;\n prepend?: (string | undefined)[];\n}\n\nexport const genFontFamily = ({ locale, prepend = [] }: GenFontFamilyOptions = {}) => {\n const fonts = matchLocaleFonts(locale);\n\n return join([\n ...prepend,\n ...(fonts?.latin ?? LATIN),\n ...(fonts?.local ?? []),\n ...(fonts?.sc ?? SC),\n ...FALLBACK,\n ...EMOJI,\n ]);\n};\n\nexport const genFontFamilyCode = ({ locale, prepend = [] }: GenFontFamilyOptions = {}) => {\n const fonts = matchLocaleFonts(locale);\n\n return join([\n ...prepend,\n ...CODE,\n ...(fonts?.local ?? []),\n ...(fonts?.sc ?? SC),\n ...FALLBACK_CODE,\n ...EMOJI,\n ]);\n};\n"],"mappings":"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"}
package/es/theme.css CHANGED
@@ -117,8 +117,8 @@
117
117
  --lobe-border-radius-sm: 6px;
118
118
  --lobe-border-radius-xs: 4px;
119
119
  --lobe-control-height: 36px;
120
- --lobe-font-family: "HarmonyOS Sans",-apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Roboto,"Helvetica Neue",Arial,"/* SC */","HarmonyOS Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC","/* FALLBACK */",ui-sans-serif,system-ui,sans-serif,"/* EMOJI */","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
121
- --lobe-font-family-code: Hack,ui-monospace,SFMono-Regular,"SF Mono",Menlo,"Cascadia Code",Consolas,"Liberation Mono","/* SC */","HarmonyOS Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC","/* FALLBACK */",monospace,"/* EMOJI */","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
120
+ --lobe-font-family: Geist,-apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Roboto,"Helvetica Neue",Arial,"HarmonyOS Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
121
+ --lobe-font-family-code: "Geist Mono",ui-monospace,SFMono-Regular,"SF Mono",Menlo,"Cascadia Code",Consolas,"Liberation Mono","HarmonyOS Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",monospace,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
122
122
  --lobe-box-shadow-card: 0 1px 2px -2px rgba(0,0,0,0.16), 0 3px 6px 0 rgba(0,0,0,0.12), 0 5px 12px 4px rgba(0,0,0,0.09);
123
123
  --lobe-box-shadow-drawer-down: 0 -6px 16px 0 rgba(0,0,0,0.08), 0 -3px 6px -4px rgba(0,0,0,0.12), 0 -9px 28px 8px rgba(0,0,0,0.05);
124
124
  --lobe-box-shadow-drawer-left: 6px 0 16px 0 rgba(0,0,0,0.08), 3px 0 6px -4px rgba(0,0,0,0.12), 9px 0 28px 8px rgba(0,0,0,0.05);
@@ -2318,6 +2318,56 @@
2318
2318
  --lobe-control-tmp-outline: rgba(255, 255, 255, 0.02);
2319
2319
  }
2320
2320
 
2321
+ :is(:root, [data-theme]):lang(zh) {
2322
+ --lobe-font-family: "HarmonyOS Sans",-apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Roboto,"Helvetica Neue",Arial,"HarmonyOS Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
2323
+ --lobe-font-family-code: "Geist Mono",ui-monospace,SFMono-Regular,"SF Mono",Menlo,"Cascadia Code",Consolas,"Liberation Mono","HarmonyOS Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",monospace,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
2324
+ }
2325
+
2326
+ :is(:root, [data-theme]):lang(zh-TW), :is(:root, [data-theme]):lang(zh-Hant) {
2327
+ --lobe-font-family: -apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Roboto,"Helvetica Neue",Arial,"PingFang TC","Hiragino Sans CNS","Microsoft JhengHei UI","Microsoft JhengHei","Source Han Sans TC","Noto Sans CJK TC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
2328
+ --lobe-font-family-code: "Geist Mono",ui-monospace,SFMono-Regular,"SF Mono",Menlo,"Cascadia Code",Consolas,"Liberation Mono","PingFang TC","Hiragino Sans CNS","Microsoft JhengHei UI","Microsoft JhengHei","Source Han Sans TC","Noto Sans CJK TC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",monospace,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
2329
+ }
2330
+
2331
+ :is(:root, [data-theme]):lang(zh-HK) {
2332
+ --lobe-font-family: -apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Roboto,"Helvetica Neue",Arial,"PingFang HK","Source Han Sans HC","Noto Sans CJK HK","PingFang TC","Hiragino Sans CNS","Microsoft JhengHei UI","Microsoft JhengHei","Source Han Sans TC","Noto Sans CJK TC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
2333
+ --lobe-font-family-code: "Geist Mono",ui-monospace,SFMono-Regular,"SF Mono",Menlo,"Cascadia Code",Consolas,"Liberation Mono","PingFang HK","Source Han Sans HC","Noto Sans CJK HK","PingFang TC","Hiragino Sans CNS","Microsoft JhengHei UI","Microsoft JhengHei","Source Han Sans TC","Noto Sans CJK TC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",monospace,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
2334
+ }
2335
+
2336
+ :is(:root, [data-theme]):lang(zh-MO) {
2337
+ --lobe-font-family: -apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Roboto,"Helvetica Neue",Arial,"PingFang MO","PingFang HK","Source Han Sans HC","Noto Sans CJK HK","PingFang TC","Hiragino Sans CNS","Microsoft JhengHei UI","Microsoft JhengHei","Source Han Sans TC","Noto Sans CJK TC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
2338
+ --lobe-font-family-code: "Geist Mono",ui-monospace,SFMono-Regular,"SF Mono",Menlo,"Cascadia Code",Consolas,"Liberation Mono","PingFang MO","PingFang HK","Source Han Sans HC","Noto Sans CJK HK","PingFang TC","Hiragino Sans CNS","Microsoft JhengHei UI","Microsoft JhengHei","Source Han Sans TC","Noto Sans CJK TC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",monospace,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
2339
+ }
2340
+
2341
+ :is(:root, [data-theme]):lang(ja) {
2342
+ --lobe-font-family: Geist,-apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Roboto,"Helvetica Neue",Arial,"Hiragino Sans","Hiragino Kaku Gothic ProN","Yu Gothic UI","Yu Gothic",Meiryo,"Source Han Sans JP","Noto Sans CJK JP","HarmonyOS Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
2343
+ --lobe-font-family-code: "Geist Mono",ui-monospace,SFMono-Regular,"SF Mono",Menlo,"Cascadia Code",Consolas,"Liberation Mono","Hiragino Sans","Hiragino Kaku Gothic ProN","Yu Gothic UI","Yu Gothic",Meiryo,"Source Han Sans JP","Noto Sans CJK JP","HarmonyOS Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",monospace,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
2344
+ }
2345
+
2346
+ :is(:root, [data-theme]):lang(ko) {
2347
+ --lobe-font-family: Geist,-apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Roboto,"Helvetica Neue",Arial,"Apple SD Gothic Neo","Malgun Gothic","Source Han Sans KR","Noto Sans CJK KR","HarmonyOS Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
2348
+ --lobe-font-family-code: "Geist Mono",ui-monospace,SFMono-Regular,"SF Mono",Menlo,"Cascadia Code",Consolas,"Liberation Mono","Apple SD Gothic Neo","Malgun Gothic","Source Han Sans KR","Noto Sans CJK KR","HarmonyOS Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",monospace,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
2349
+ }
2350
+
2351
+ :is(:root, [data-theme]):lang(ar), :is(:root, [data-theme]):lang(fa) {
2352
+ --lobe-font-family: Geist,-apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Roboto,"Helvetica Neue",Arial,"SF Arabic","Geeza Pro","Noto Sans Arabic",Tahoma,"HarmonyOS Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
2353
+ --lobe-font-family-code: "Geist Mono",ui-monospace,SFMono-Regular,"SF Mono",Menlo,"Cascadia Code",Consolas,"Liberation Mono","SF Arabic","Geeza Pro","Noto Sans Arabic",Tahoma,"HarmonyOS Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",monospace,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
2354
+ }
2355
+
2356
+ :is(:root, [data-theme]):lang(he) {
2357
+ --lobe-font-family: Geist,-apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Roboto,"Helvetica Neue",Arial,"SF Hebrew","Arial Hebrew","Noto Sans Hebrew","HarmonyOS Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
2358
+ --lobe-font-family-code: "Geist Mono",ui-monospace,SFMono-Regular,"SF Mono",Menlo,"Cascadia Code",Consolas,"Liberation Mono","SF Hebrew","Arial Hebrew","Noto Sans Hebrew","HarmonyOS Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",monospace,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
2359
+ }
2360
+
2361
+ :is(:root, [data-theme]):lang(th) {
2362
+ --lobe-font-family: Geist,-apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Roboto,"Helvetica Neue",Arial,Thonburi,"Leelawadee UI","Noto Sans Thai","HarmonyOS Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
2363
+ --lobe-font-family-code: "Geist Mono",ui-monospace,SFMono-Regular,"SF Mono",Menlo,"Cascadia Code",Consolas,"Liberation Mono",Thonburi,"Leelawadee UI","Noto Sans Thai","HarmonyOS Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",monospace,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
2364
+ }
2365
+
2366
+ :is(:root, [data-theme]):lang(hi), :is(:root, [data-theme]):lang(mr), :is(:root, [data-theme]):lang(ne) {
2367
+ --lobe-font-family: Geist,-apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Roboto,"Helvetica Neue",Arial,"Kohinoor Devanagari","Nirmala UI","Noto Sans Devanagari","HarmonyOS Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
2368
+ --lobe-font-family-code: "Geist Mono",ui-monospace,SFMono-Regular,"SF Mono",Menlo,"Cascadia Code",Consolas,"Liberation Mono","Kohinoor Devanagari","Nirmala UI","Noto Sans Devanagari","HarmonyOS Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",monospace,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
2369
+ }
2370
+
2321
2371
  @layer lobe-ui {
2322
2372
  .lobe-brand-loading path {
2323
2373
  fill: currentcolor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "6.9.0",
3
+ "version": "6.10.0",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",
@@ -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
@@ -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"}