zs_library 0.3.19 → 0.3.20
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.
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { MDXEditorProps, ImageUploadHandler, ImagePreviewHandler, ViewMode, HEADING_LEVEL, CodeBlockEditorDescriptor, DirectiveDescriptor } from '@mdxeditor/editor';
|
|
2
|
+
import { FC, JSX } from 'react';
|
|
3
|
+
type Extension = {
|
|
4
|
+
extension: Extension;
|
|
5
|
+
} | readonly Extension[];
|
|
6
|
+
export interface ImagePluginConfig {
|
|
7
|
+
imageUploadHandler?: ImageUploadHandler;
|
|
8
|
+
imageAutocompleteSuggestions?: string[];
|
|
9
|
+
disableImageResize?: boolean;
|
|
10
|
+
disableImageSettingsButton?: boolean;
|
|
11
|
+
imagePreviewHandler?: ImagePreviewHandler;
|
|
12
|
+
ImageDialog?: FC<object> | (() => JSX.Element);
|
|
13
|
+
}
|
|
14
|
+
export interface DiffSourcePluginConfig {
|
|
15
|
+
viewMode?: ViewMode;
|
|
16
|
+
diffMarkdown?: string;
|
|
17
|
+
codeMirrorExtensions?: Extension[];
|
|
18
|
+
readOnlyDiff?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface HeadingPluginConfig {
|
|
21
|
+
allowedHeadingLevels?: readonly HEADING_LEVEL[];
|
|
22
|
+
}
|
|
23
|
+
export interface LinkPluginConfig {
|
|
24
|
+
validateUrl?: (url: string) => boolean;
|
|
25
|
+
disableAutoLink?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface CodeBlockPluginConfig {
|
|
28
|
+
codeBlockEditorDescriptors?: CodeBlockEditorDescriptor[];
|
|
29
|
+
defaultCodeBlockLanguage?: string | undefined;
|
|
30
|
+
}
|
|
31
|
+
export interface CodeMirrorPluginConfig {
|
|
32
|
+
codeBlockLanguages: Record<string, string>;
|
|
33
|
+
codeMirrorExtensions?: Extension[];
|
|
34
|
+
autoLoadLanguageSupport?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface DirectivePluginConfig {
|
|
37
|
+
directiveDescriptors: DirectiveDescriptor[];
|
|
38
|
+
}
|
|
39
|
+
export interface MdEditorPluginConfig {
|
|
40
|
+
image?: ImagePluginConfig;
|
|
41
|
+
diffSource?: DiffSourcePluginConfig;
|
|
42
|
+
headings?: HeadingPluginConfig;
|
|
43
|
+
link?: LinkPluginConfig;
|
|
44
|
+
codeBlock?: CodeBlockPluginConfig;
|
|
45
|
+
codeMirror?: CodeMirrorPluginConfig;
|
|
46
|
+
directives?: DirectivePluginConfig;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Markdown 编辑器
|
|
50
|
+
*/
|
|
51
|
+
export interface MdEditorProps extends Omit<MDXEditorProps, "markdown" | "onChange"> {
|
|
52
|
+
/**
|
|
53
|
+
* Markdown 内容
|
|
54
|
+
*/
|
|
55
|
+
value?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Markdown 内容变化时的回调
|
|
58
|
+
* @param value Markdown 内容
|
|
59
|
+
* @returns
|
|
60
|
+
*/
|
|
61
|
+
onChange?: (value: string) => void;
|
|
62
|
+
/**
|
|
63
|
+
* 编辑器插件配置
|
|
64
|
+
*/
|
|
65
|
+
pluginConfig?: MdEditorPluginConfig;
|
|
66
|
+
/**
|
|
67
|
+
* 自定义类名
|
|
68
|
+
*/
|
|
69
|
+
className?: string;
|
|
70
|
+
/**
|
|
71
|
+
* 主题,可选值为 `light`、`dark`、`auto`
|
|
72
|
+
*/
|
|
73
|
+
theme?: "light" | "dark" | "auto";
|
|
74
|
+
}
|
|
75
|
+
export declare const PrivMdEditor: FC<MdEditorProps>;
|
|
76
|
+
export {};
|
|
@@ -1,60 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FC, JSX } from 'react';
|
|
1
|
+
import { PrivMdEditor } from './editor';
|
|
3
2
|
import { default as MDXEditorPreview } from './preview';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export interface ImagePluginConfig {
|
|
8
|
-
imageUploadHandler?: ImageUploadHandler;
|
|
9
|
-
imageAutocompleteSuggestions?: string[];
|
|
10
|
-
disableImageResize?: boolean;
|
|
11
|
-
disableImageSettingsButton?: boolean;
|
|
12
|
-
imagePreviewHandler?: ImagePreviewHandler;
|
|
13
|
-
ImageDialog?: FC<object> | (() => JSX.Element);
|
|
14
|
-
}
|
|
15
|
-
export interface DiffSourcePluginConfig {
|
|
16
|
-
viewMode?: ViewMode;
|
|
17
|
-
diffMarkdown?: string;
|
|
18
|
-
codeMirrorExtensions?: Extension[];
|
|
19
|
-
readOnlyDiff?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface HeadingPluginConfig {
|
|
22
|
-
allowedHeadingLevels?: readonly HEADING_LEVEL[];
|
|
23
|
-
}
|
|
24
|
-
export interface LinkPluginConfig {
|
|
25
|
-
validateUrl?: (url: string) => boolean;
|
|
26
|
-
disableAutoLink?: boolean;
|
|
27
|
-
}
|
|
28
|
-
export interface CodeBlockPluginConfig {
|
|
29
|
-
codeBlockEditorDescriptors?: CodeBlockEditorDescriptor[];
|
|
30
|
-
defaultCodeBlockLanguage?: string | undefined;
|
|
31
|
-
}
|
|
32
|
-
export interface CodeMirrorPluginConfig {
|
|
33
|
-
codeBlockLanguages: Record<string, string>;
|
|
34
|
-
codeMirrorExtensions?: Extension[];
|
|
35
|
-
autoLoadLanguageSupport?: boolean;
|
|
36
|
-
}
|
|
37
|
-
export interface DirectivePluginConfig {
|
|
38
|
-
directiveDescriptors: DirectiveDescriptor[];
|
|
39
|
-
}
|
|
40
|
-
export interface MdEditorPluginConfig {
|
|
41
|
-
image?: ImagePluginConfig;
|
|
42
|
-
diffSource?: DiffSourcePluginConfig;
|
|
43
|
-
headings?: HeadingPluginConfig;
|
|
44
|
-
link?: LinkPluginConfig;
|
|
45
|
-
codeBlock?: CodeBlockPluginConfig;
|
|
46
|
-
codeMirror?: CodeMirrorPluginConfig;
|
|
47
|
-
directives?: DirectivePluginConfig;
|
|
48
|
-
}
|
|
49
|
-
export interface MdEditorProps extends Omit<MDXEditorProps, "markdown" | "onChange"> {
|
|
50
|
-
value?: string;
|
|
51
|
-
onChange?: (value: string) => void;
|
|
52
|
-
pluginConfig?: MdEditorPluginConfig;
|
|
53
|
-
className?: string;
|
|
54
|
-
theme?: "light" | "dark" | "auto";
|
|
55
|
-
}
|
|
56
|
-
declare const PrivMdEditor: FC<MdEditorProps>;
|
|
3
|
+
/**
|
|
4
|
+
* Markdown 编辑器
|
|
5
|
+
*/
|
|
57
6
|
export type MdEditorType = typeof PrivMdEditor & {
|
|
7
|
+
/**
|
|
8
|
+
* 预览组件
|
|
9
|
+
*/
|
|
58
10
|
Preview: typeof MDXEditorPreview;
|
|
59
11
|
};
|
|
60
12
|
declare const MdEditor: MdEditorType;
|
package/dist/index.es.js
CHANGED
|
@@ -1816,7 +1816,100 @@ const Me = be({
|
|
|
1816
1816
|
--color-prettylights-syntax-meta-diff-range: #d2a8ff;
|
|
1817
1817
|
--color-prettylights-syntax-sublimelinter-gutter-mark: #3d444d;
|
|
1818
1818
|
}
|
|
1819
|
-
`,
|
|
1819
|
+
`, ce = (a) => {
|
|
1820
|
+
var e, r;
|
|
1821
|
+
return a === "dark" ? !0 : a === "light" ? !1 : (e = document.documentElement.getAttribute("style")) != null && e.includes("color-scheme: dark;") ? !0 : (r = document.documentElement.getAttribute("style")) != null && r.includes("color-scheme: light;") ? !1 : window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
1822
|
+
}, Wo = (a) => {
|
|
1823
|
+
const {
|
|
1824
|
+
value: e,
|
|
1825
|
+
onChange: r,
|
|
1826
|
+
translation: t,
|
|
1827
|
+
pluginConfig: i,
|
|
1828
|
+
className: n,
|
|
1829
|
+
theme: c = "auto",
|
|
1830
|
+
...p
|
|
1831
|
+
} = a, s = te(null), {
|
|
1832
|
+
image: v,
|
|
1833
|
+
diffSource: x = {
|
|
1834
|
+
viewMode: "rich-text"
|
|
1835
|
+
},
|
|
1836
|
+
headings: R,
|
|
1837
|
+
link: B,
|
|
1838
|
+
codeBlock: A,
|
|
1839
|
+
codeMirror: L = {
|
|
1840
|
+
codeBlockLanguages: {
|
|
1841
|
+
js: "JavaScript",
|
|
1842
|
+
css: "CSS",
|
|
1843
|
+
txt: "Plain Text",
|
|
1844
|
+
tsx: "TypeScript",
|
|
1845
|
+
"": "Unspecified"
|
|
1846
|
+
}
|
|
1847
|
+
},
|
|
1848
|
+
directives: g = {
|
|
1849
|
+
directiveDescriptors: [To]
|
|
1850
|
+
}
|
|
1851
|
+
} = i ?? {}, [d, w] = F("");
|
|
1852
|
+
return oe(() => {
|
|
1853
|
+
var h;
|
|
1854
|
+
e !== void 0 && s.current && ((h = s.current) == null || h.setMarkdown(e), w(e));
|
|
1855
|
+
}, [e, s]), /* @__PURE__ */ o(
|
|
1856
|
+
Ze,
|
|
1857
|
+
{
|
|
1858
|
+
ref: s,
|
|
1859
|
+
className: T(
|
|
1860
|
+
_o,
|
|
1861
|
+
ce(c) ? Vo : "",
|
|
1862
|
+
ce(c) ? Ne : Be,
|
|
1863
|
+
n
|
|
1864
|
+
),
|
|
1865
|
+
contentEditableClassName: Te,
|
|
1866
|
+
markdown: d,
|
|
1867
|
+
onChange: (h) => {
|
|
1868
|
+
!e && !r && w(h), r && r(h);
|
|
1869
|
+
},
|
|
1870
|
+
translation: t ?? Uo,
|
|
1871
|
+
plugins: [
|
|
1872
|
+
Qe({
|
|
1873
|
+
toolbarContents: () => /* @__PURE__ */ G(eo, { options: ["rich-text", "source"], children: [
|
|
1874
|
+
/* @__PURE__ */ o(oo, {}),
|
|
1875
|
+
/* @__PURE__ */ o(J, {}),
|
|
1876
|
+
/* @__PURE__ */ o(to, {}),
|
|
1877
|
+
/* @__PURE__ */ o(ro, {}),
|
|
1878
|
+
/* @__PURE__ */ o(J, {}),
|
|
1879
|
+
/* @__PURE__ */ o(no, {}),
|
|
1880
|
+
/* @__PURE__ */ o(J, {}),
|
|
1881
|
+
/* @__PURE__ */ o(ao, {}),
|
|
1882
|
+
/* @__PURE__ */ o(J, {}),
|
|
1883
|
+
/* @__PURE__ */ o(lo, {}),
|
|
1884
|
+
/* @__PURE__ */ o(io, {}),
|
|
1885
|
+
/* @__PURE__ */ o(J, {}),
|
|
1886
|
+
/* @__PURE__ */ o(so, {}),
|
|
1887
|
+
/* @__PURE__ */ o(co, {}),
|
|
1888
|
+
/* @__PURE__ */ o(J, {}),
|
|
1889
|
+
/* @__PURE__ */ o(go, {}),
|
|
1890
|
+
/* @__PURE__ */ o(J, {}),
|
|
1891
|
+
/* @__PURE__ */ o(uo, {})
|
|
1892
|
+
] })
|
|
1893
|
+
}),
|
|
1894
|
+
mo(x),
|
|
1895
|
+
po(),
|
|
1896
|
+
ho(),
|
|
1897
|
+
fo(R),
|
|
1898
|
+
bo(B),
|
|
1899
|
+
ko(),
|
|
1900
|
+
yo(v),
|
|
1901
|
+
vo(),
|
|
1902
|
+
xo(),
|
|
1903
|
+
wo(),
|
|
1904
|
+
Co(A),
|
|
1905
|
+
Io(L),
|
|
1906
|
+
Mo(),
|
|
1907
|
+
So(g)
|
|
1908
|
+
],
|
|
1909
|
+
...p
|
|
1910
|
+
}
|
|
1911
|
+
);
|
|
1912
|
+
}, Jo = {
|
|
1820
1913
|
'code[class*="language-"]': {
|
|
1821
1914
|
background: "hsl(230, 1%, 98%)",
|
|
1822
1915
|
color: "hsl(230, 8%, 24%)",
|
|
@@ -2304,10 +2397,7 @@ const Me = be({
|
|
|
2304
2397
|
".prism-previewer-easing.prism-previewer-easing line": {
|
|
2305
2398
|
stroke: "hsl(230, 8%, 24%)"
|
|
2306
2399
|
}
|
|
2307
|
-
},
|
|
2308
|
-
var e, r;
|
|
2309
|
-
return a === "dark" ? !0 : a === "light" ? !1 : (e = document.documentElement.getAttribute("style")) != null && e.includes("color-scheme: dark;") ? !0 : (r = document.documentElement.getAttribute("style")) != null && r.includes("color-scheme: light;") ? !1 : window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
2310
|
-
}, Jo = (a) => {
|
|
2400
|
+
}, Ko = (a) => {
|
|
2311
2401
|
const { children: e = "", className: r, theme: t = "auto" } = a;
|
|
2312
2402
|
return /* @__PURE__ */ o(
|
|
2313
2403
|
"div",
|
|
@@ -2329,7 +2419,7 @@ const Me = be({
|
|
|
2329
2419
|
PreTag: "div",
|
|
2330
2420
|
children: String(n).replace(/\n$/, ""),
|
|
2331
2421
|
language: x[1],
|
|
2332
|
-
style:
|
|
2422
|
+
style: Jo
|
|
2333
2423
|
}
|
|
2334
2424
|
) : /* @__PURE__ */ o("code", { ...v, className: c, children: n });
|
|
2335
2425
|
}
|
|
@@ -2339,98 +2429,8 @@ const Me = be({
|
|
|
2339
2429
|
)
|
|
2340
2430
|
}
|
|
2341
2431
|
);
|
|
2342
|
-
},
|
|
2343
|
-
|
|
2344
|
-
value: e,
|
|
2345
|
-
onChange: r,
|
|
2346
|
-
translation: t,
|
|
2347
|
-
pluginConfig: i,
|
|
2348
|
-
className: n,
|
|
2349
|
-
theme: c = "auto",
|
|
2350
|
-
...p
|
|
2351
|
-
} = a, s = te(null), {
|
|
2352
|
-
image: v,
|
|
2353
|
-
diffSource: x = {
|
|
2354
|
-
viewMode: "rich-text"
|
|
2355
|
-
},
|
|
2356
|
-
headings: R,
|
|
2357
|
-
link: B,
|
|
2358
|
-
codeBlock: A,
|
|
2359
|
-
codeMirror: L = {
|
|
2360
|
-
codeBlockLanguages: {
|
|
2361
|
-
js: "JavaScript",
|
|
2362
|
-
css: "CSS",
|
|
2363
|
-
txt: "Plain Text",
|
|
2364
|
-
tsx: "TypeScript",
|
|
2365
|
-
"": "Unspecified"
|
|
2366
|
-
}
|
|
2367
|
-
},
|
|
2368
|
-
directives: g = {
|
|
2369
|
-
directiveDescriptors: [To]
|
|
2370
|
-
}
|
|
2371
|
-
} = i ?? {}, [d, w] = F("");
|
|
2372
|
-
return oe(() => {
|
|
2373
|
-
var h;
|
|
2374
|
-
e !== void 0 && s.current && ((h = s.current) == null || h.setMarkdown(e), w(e));
|
|
2375
|
-
}, [e, s]), /* @__PURE__ */ o(
|
|
2376
|
-
Ze,
|
|
2377
|
-
{
|
|
2378
|
-
ref: s,
|
|
2379
|
-
className: T(
|
|
2380
|
-
_o,
|
|
2381
|
-
ce(c) ? Vo : "",
|
|
2382
|
-
ce(c) ? Ne : Be,
|
|
2383
|
-
n
|
|
2384
|
-
),
|
|
2385
|
-
contentEditableClassName: Te,
|
|
2386
|
-
markdown: d,
|
|
2387
|
-
onChange: (h) => {
|
|
2388
|
-
!e && !r && w(h), r && r(h);
|
|
2389
|
-
},
|
|
2390
|
-
translation: t ?? Uo,
|
|
2391
|
-
plugins: [
|
|
2392
|
-
Qe({
|
|
2393
|
-
toolbarContents: () => /* @__PURE__ */ G(eo, { options: ["rich-text", "source"], children: [
|
|
2394
|
-
/* @__PURE__ */ o(oo, {}),
|
|
2395
|
-
/* @__PURE__ */ o(J, {}),
|
|
2396
|
-
/* @__PURE__ */ o(to, {}),
|
|
2397
|
-
/* @__PURE__ */ o(ro, {}),
|
|
2398
|
-
/* @__PURE__ */ o(J, {}),
|
|
2399
|
-
/* @__PURE__ */ o(no, {}),
|
|
2400
|
-
/* @__PURE__ */ o(J, {}),
|
|
2401
|
-
/* @__PURE__ */ o(ao, {}),
|
|
2402
|
-
/* @__PURE__ */ o(J, {}),
|
|
2403
|
-
/* @__PURE__ */ o(lo, {}),
|
|
2404
|
-
/* @__PURE__ */ o(io, {}),
|
|
2405
|
-
/* @__PURE__ */ o(J, {}),
|
|
2406
|
-
/* @__PURE__ */ o(so, {}),
|
|
2407
|
-
/* @__PURE__ */ o(co, {}),
|
|
2408
|
-
/* @__PURE__ */ o(J, {}),
|
|
2409
|
-
/* @__PURE__ */ o(go, {}),
|
|
2410
|
-
/* @__PURE__ */ o(J, {}),
|
|
2411
|
-
/* @__PURE__ */ o(uo, {})
|
|
2412
|
-
] })
|
|
2413
|
-
}),
|
|
2414
|
-
mo(x),
|
|
2415
|
-
po(),
|
|
2416
|
-
ho(),
|
|
2417
|
-
fo(R),
|
|
2418
|
-
bo(B),
|
|
2419
|
-
ko(),
|
|
2420
|
-
yo(v),
|
|
2421
|
-
vo(),
|
|
2422
|
-
xo(),
|
|
2423
|
-
wo(),
|
|
2424
|
-
Co(A),
|
|
2425
|
-
Io(L),
|
|
2426
|
-
Mo(),
|
|
2427
|
-
So(g)
|
|
2428
|
-
],
|
|
2429
|
-
...p
|
|
2430
|
-
}
|
|
2431
|
-
);
|
|
2432
|
-
}, Zo = Ko;
|
|
2433
|
-
Zo.Preview = Jo;
|
|
2432
|
+
}, Zo = Wo;
|
|
2433
|
+
Zo.Preview = Ko;
|
|
2434
2434
|
function De(...a) {
|
|
2435
2435
|
return Lo(Ro(a));
|
|
2436
2436
|
}
|
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(f,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime"),require("@emotion/css"),require("react"),require("react-slick"),require("react-sortablejs"),require("framer-motion"),require("ahooks"),require("uuid"),require("rc-tooltip"),require("@remixicon/react"),require("rc-dialog"),require("react-json-view"),require("@mdxeditor/editor"),require("react-markdown"),require("remark-gfm"),require("remark-emoji"),require("rehype-raw"),require("react-syntax-highlighter"),require("clsx"),require("tailwind-merge")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@emotion/css","react","react-slick","react-sortablejs","framer-motion","ahooks","uuid","rc-tooltip","@remixicon/react","rc-dialog","react-json-view","@mdxeditor/editor","react-markdown","remark-gfm","remark-emoji","rehype-raw","react-syntax-highlighter","clsx","tailwind-merge"],o):(f=typeof globalThis<"u"?globalThis:f||self,o(f.zs_library={},f.jsxRuntime,f.css,f.React,f.Slider,f.reactSortablejs,f.framerMotion,f.ahooks,f.uuid,f.RcTooltip,f.react$1,f.Dialog,f.ReactJson,f.MDXEditor,f.Markdown,f.remarkGfm,f.emoji,f.rehypeRaw,f.reactSyntaxHighlighter,f.clsx,f.tailwindMerge))})(this,function(f,o,t,b,Me,oe,s,se,ce,Be,Q,de,Ne,h,De,Pe,$e,Le,ze,Ae,qe){"use strict";var
|
|
1
|
+
(function(f,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime"),require("@emotion/css"),require("react"),require("react-slick"),require("react-sortablejs"),require("framer-motion"),require("ahooks"),require("uuid"),require("rc-tooltip"),require("@remixicon/react"),require("rc-dialog"),require("react-json-view"),require("@mdxeditor/editor"),require("react-markdown"),require("remark-gfm"),require("remark-emoji"),require("rehype-raw"),require("react-syntax-highlighter"),require("clsx"),require("tailwind-merge")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@emotion/css","react","react-slick","react-sortablejs","framer-motion","ahooks","uuid","rc-tooltip","@remixicon/react","rc-dialog","react-json-view","@mdxeditor/editor","react-markdown","remark-gfm","remark-emoji","rehype-raw","react-syntax-highlighter","clsx","tailwind-merge"],o):(f=typeof globalThis<"u"?globalThis:f||self,o(f.zs_library={},f.jsxRuntime,f.css,f.React,f.Slider,f.reactSortablejs,f.framerMotion,f.ahooks,f.uuid,f.RcTooltip,f.react$1,f.Dialog,f.ReactJson,f.MDXEditor,f.Markdown,f.remarkGfm,f.emoji,f.rehypeRaw,f.reactSyntaxHighlighter,f.clsx,f.tailwindMerge))})(this,function(f,o,t,b,Me,oe,s,se,ce,Be,Q,de,Ne,h,De,Pe,$e,Le,ze,Ae,qe){"use strict";var io=Object.defineProperty;var so=(f,o,t)=>o in f?io(f,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):f[o]=t;var ie=(f,o,t)=>so(f,typeof o!="symbol"?o+"":o,t);require("./zs_library.css");const ge={token:{itemNameColor:"#1a1a1a",itemIconBackgroundColor:"white",itemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemIconBackgroundColor:"rgba(255, 255, 255, 0.1)",groupItemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemModalBackgroundColor:"rgba(255, 255, 255, 0.8)",contextMenuTextColor:"black",contextMenuActiveColor:"#f3f4f6",contextMenuBackgroundColor:"white",contextMenuShadowColor:"rgba(0, 0, 0, 0.1)"}},ue={token:{itemNameColor:"white",itemIconBackgroundColor:"#1f2937",itemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemIconBackgroundColor:"rgba(0, 0, 0, 0.1)",groupItemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemModalBackgroundColor:"rgba(0, 0, 0, 0.1)",contextMenuTextColor:"white",contextMenuActiveColor:"#1a1a1a",contextMenuBackgroundColor:"#1a1a1a",contextMenuShadowColor:"rgba(255, 255, 255, 0.1)"}},he=b.createContext({}),Ee=c=>{const{children:e,theme:n,...r}=c,l=b.useMemo(()=>n==="light"?ge:n==="dark"?ue:n,[n]);return o.jsx(he.Provider,{value:{theme:l,...r},children:e})},V=()=>b.useContext(he),pe={maxRow:2,maxCol:2},je={...pe},me={app:pe,group:je};class Y{}ie(Y,"uniqueArray",e=>e.reduce((n,r)=>n.find(a=>a.id===r.id)?n:n.concat([r]),[])),ie(Y,"getTheme",e=>{const n=ge.token,r=ue.token,l={...n,...e==null?void 0:e.token},a={...r,...e==null?void 0:e.token};return{light:l,dark:a}});const fe=b.createContext({list:[],setList:()=>{},contextMenu:null,setContextMenu:()=>{},listStatus:null,setListStatus:()=>{},contextMenuFuns:()=>{},hideContextMenu:()=>{},showInfoItemData:null,setShowInfoItemData:()=>{},openGroupItemData:null,setOpenGroupItemData:()=>{},longPressTriggered:!1,updateItem:()=>{},updateItemConfig:()=>{},removeItem:()=>{},addItem:()=>{},moveItemId:null,setMoveItemId:()=>{},moveTargetId:null,setMoveTargetId:()=>{}}),He=c=>{const{children:e,list:n=[],onChange:r,storageKey:l="ZS_LIBRARY_DESKTOP_SORTABLE_CONFIG",enableCaching:a=!0}=c,[d,k]=b.useState(),[i,C]=b.useState(),[S,A]=b.useState(null),D=b.useRef(S),[j,q]=b.useState(null),[u,g]=b.useState([]),[I,x]=b.useState(null),[L,p]=b.useState(null),[M,T]=b.useState(!1),[m,y]=b.useState(null),[H,W]=b.useState(null),[F,le]=b.useState(!1),[J,R]=se.useLocalStorageState(l,{defaultValue:[],listenStorageChange:!0}),ee=()=>{q(null),clearTimeout(d),k(void 0),D.current=null},P=(v,G)=>{q({...v,pageX:v.pageX,pageY:v.pageY,data:G}),clearTimeout(d)},_=(v,G=!0)=>{const{config:X={}}=v;return X.allowContextMenu===!1?{}:{onMouseDown:B=>{k(setTimeout(()=>{G&&D.current===null&&P(B,v)},800)),T(!1),C(setTimeout(()=>{T(!0)},800))},onMouseUp:()=>{clearTimeout(i),C(void 0),clearTimeout(d),k(void 0)},onContextMenu:B=>{G&&(B.preventDefault(),P(B,v))}}},K=(v,G)=>{const X=[...G||[]];if(X.length>0)g(B=>{const z=[...B],$=w=>{var Ie,Te;const N=X.shift(),E=w.find(U=>U.id===N),O=w.findIndex(U=>U.id===N);if(X.length&&E){if(((Ie=E.children)==null?void 0:Ie.filter(U=>!v.some(lo=>lo.id===U.id)).length)===1&&v.length===1){const U={...v[0]};return w.splice(O,1,U),r==null||r(w),w}return E.children=$(E.children||[]),w.splice(O,1,E),r==null||r(w),w}if(E){if(!((Te=E.children)!=null&&Te.length)&&v.length){const U={...E};return E.data={name:"文件夹"},E.type="group",E.children=[U,...v],E.id=ce.v4(),w.splice(O,1,E),r==null||r(w),w}return E.children=Y.uniqueArray(v),w.splice(O,1,E),r==null||r(w),w}return Y.uniqueArray(v)};return Y.uniqueArray($(z))});else{const B=Y.uniqueArray(v);r==null||r(B),g(B)}},to=(v,G)=>{g(X=>{const B=[...X],z=$=>{var w;for(let N=0;N<$.length;N++)if($[N].id===v){$[N].config=G;break}else((w=$[N].children)==null?void 0:w.length)!==void 0&&z($[N].children)};return z(B),r==null||r(B),B})},ro=(v,G)=>{g(X=>{const B=[...X],z=$=>{var w;for(let N=0;N<$.length;N++)if($[N].id===v){$[N].data=G;break}else((w=$[N].children)==null?void 0:w.length)!==void 0&&z($[N].children)};return z(B),r==null||r(B),B})},no=v=>{g(G=>{const X=[...G],B=z=>{var $;for(let w=0;w<z.length;w++)if(z[w].id===v){z.splice(w,1);break}else(($=z[w].children)==null?void 0:$.length)!==void 0&&B(z[w].children)};return B(X),r==null||r(X),X})},ao=(v,G)=>{const X=[...u],B=(z,$)=>{const w=$.shift(),N=z.find(O=>O.id===w),E=z.findIndex(O=>O.id===w);if(N){if($.length)N.children=B(N.children||[],$);else{const O=(v==null?void 0:v.type)??"app";N.children=[...N.children??[],{...v,id:ce.v4(),config:(v==null?void 0:v.config)??me[O]}]}return z.splice(E,1,N),z}else return z};g(B(X,G))};return b.useEffect(()=>{(n==null?void 0:n.length)>0&&u.length===0&&K(n)},[n]),b.useEffect(()=>{D.current=S,S!==null&&ee()},[S]),b.useEffect(()=>{a&&J!=null&&J.length&&!F&&(K(J),le(!0))},[J,F,a]),se.useDebounceEffect(()=>{a&&R(u)},[u,a],{wait:1e3}),o.jsx(fe.Provider,{value:{list:u,setList:K,contextMenu:j,setContextMenu:q,listStatus:S,setListStatus:A,contextMenuFuns:_,hideContextMenu:ee,showInfoItemData:I,setShowInfoItemData:x,openGroupItemData:L,setOpenGroupItemData:p,longPressTriggered:M,updateItemConfig:to,updateItem:ro,removeItem:no,addItem:ao,moveItemId:m,setMoveItemId:y,moveTargetId:H,setMoveTargetId:W},children:e})},Z=()=>b.useContext(fe),Fe={menuShow:{opacity:1,y:0,transition:{type:"spring",stiffness:300,damping:24}},menuHide:{opacity:0,y:20,transition:{duration:.2}}},te=c=>{const{icon:e,title:n,onClick:r}=c,{theme:l}=V(),{light:a,dark:d}=Y.getTheme(l);return o.jsx(s.motion.div,{className:t.css`
|
|
2
2
|
&:hover {
|
|
3
3
|
background-color: ${a.contextMenuActiveColor};
|
|
4
4
|
@media (prefers-color-scheme: dark) {
|
|
@@ -656,4 +656,4 @@
|
|
|
656
656
|
--color-prettylights-syntax-meta-diff-range: #d2a8ff;
|
|
657
657
|
--color-prettylights-syntax-sublimelinter-gutter-mark: #3d444d;
|
|
658
658
|
}
|
|
659
|
-
`,Qe={'code[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"]::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},prolog:{color:"hsl(230, 4%, 64%)"},cdata:{color:"hsl(230, 4%, 64%)"},doctype:{color:"hsl(230, 8%, 24%)"},punctuation:{color:"hsl(230, 8%, 24%)"},entity:{color:"hsl(230, 8%, 24%)",cursor:"help"},"attr-name":{color:"hsl(35, 99%, 36%)"},"class-name":{color:"hsl(35, 99%, 36%)"},boolean:{color:"hsl(35, 99%, 36%)"},constant:{color:"hsl(35, 99%, 36%)"},number:{color:"hsl(35, 99%, 36%)"},atrule:{color:"hsl(35, 99%, 36%)"},keyword:{color:"hsl(301, 63%, 40%)"},property:{color:"hsl(5, 74%, 59%)"},tag:{color:"hsl(5, 74%, 59%)"},symbol:{color:"hsl(5, 74%, 59%)"},deleted:{color:"hsl(5, 74%, 59%)"},important:{color:"hsl(5, 74%, 59%)"},selector:{color:"hsl(119, 34%, 47%)"},string:{color:"hsl(119, 34%, 47%)"},char:{color:"hsl(119, 34%, 47%)"},builtin:{color:"hsl(119, 34%, 47%)"},inserted:{color:"hsl(119, 34%, 47%)"},regex:{color:"hsl(119, 34%, 47%)"},"attr-value":{color:"hsl(119, 34%, 47%)"},"attr-value > .token.punctuation":{color:"hsl(119, 34%, 47%)"},variable:{color:"hsl(221, 87%, 60%)"},operator:{color:"hsl(221, 87%, 60%)"},function:{color:"hsl(221, 87%, 60%)"},url:{color:"hsl(198, 99%, 37%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(230, 8%, 24%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(230, 8%, 24%)"},".language-css .token.selector":{color:"hsl(5, 74%, 59%)"},".language-css .token.property":{color:"hsl(230, 8%, 24%)"},".language-css .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.string.url":{color:"hsl(119, 34%, 47%)"},".language-css .token.important":{color:"hsl(301, 63%, 40%)"},".language-css .token.atrule .token.rule":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.operator":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(344, 84%, 43%)"},".language-json .token.operator":{color:"hsl(230, 8%, 24%)"},".language-json .token.null.keyword":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.url":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.operator":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.content":{color:"hsl(221, 87%, 60%)"},".language-markdown .token.url > .token.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.url-reference.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(119, 34%, 47%)"},".language-markdown .token.bold .token.content":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.italic .token.content":{color:"hsl(301, 63%, 40%)"},".language-markdown .token.strike .token.content":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.list.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(5, 74%, 59%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.cr:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.lf:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.space:before":{color:"hsla(230, 8%, 24%, 0.2)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},".line-highlight.line-highlight":{background:"hsla(230, 8%, 24%, 0.05)"},".line-highlight.line-highlight:before":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(230, 8%, 24%, 0.05)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".command-line .command-line-prompt":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(230, 1%, 62%)"},".command-line .command-line-prompt > span:before":{color:"hsl(230, 1%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(301, 63%, 40%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(0, 0, 95%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(0, 0, 95%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(0, 0, 95%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(0, 0, 95%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(0, 0%, 100%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(230, 8%, 24%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(230, 8%, 24%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(230, 8%, 24%)"}},ne=c=>{var e,n;return c==="dark"?!0:c==="light"?!1:(e=document.documentElement.getAttribute("style"))!=null&&e.includes("color-scheme: dark;")?!0:(n=document.documentElement.getAttribute("style"))!=null&&n.includes("color-scheme: light;")?!1:window.matchMedia("(prefers-color-scheme: dark)").matches},Re=c=>{const{children:e="",className:n,theme:r="auto"}=c;return o.jsx("div",{className:ne(r)?ye:xe,children:o.jsx(De,{className:t.cx(ke,n),remarkPlugins:[Pe,$e],rehypePlugins:[Le],components:{code(l){const{children:a,className:d,node:k,ref:i,...C}=l,S=/language-(\w+)/.exec(d||"");return S?o.jsx(ze.Prism,{...C,PreTag:"div",children:String(a).replace(/\n$/,""),language:S[1],style:Qe}):o.jsx("code",{...C,className:d,children:a})}},children:e})})},ve=c=>{const{value:e,onChange:n,translation:r,pluginConfig:l,className:a,theme:d="auto",...k}=c,i=b.useRef(null),{image:C,diffSource:S={viewMode:"rich-text"},headings:A,link:D,codeBlock:j,codeMirror:q={codeBlockLanguages:{js:"JavaScript",css:"CSS",txt:"Plain Text",tsx:"TypeScript","":"Unspecified"}},directives:u={directiveDescriptors:[h.AdmonitionDirectiveDescriptor]}}=l??{},[g,I]=b.useState("");return b.useEffect(()=>{var x;e!==void 0&&i.current&&((x=i.current)==null||x.setMarkdown(e),I(e))},[e,i]),o.jsx(h.MDXEditor,{ref:i,className:t.cx(Ze,ne(d)?Ke:"",ne(d)?ye:xe,a),contentEditableClassName:ke,markdown:g,onChange:x=>{!e&&!n&&I(x),n&&n(x)},translation:r??Je,plugins:[h.toolbarPlugin({toolbarContents:()=>o.jsxs(h.DiffSourceToggleWrapper,{options:["rich-text","source"],children:[o.jsx(h.UndoRedo,{}),o.jsx(h.Separator,{}),o.jsx(h.BoldItalicUnderlineToggles,{}),o.jsx(h.CodeToggle,{}),o.jsx(h.Separator,{}),o.jsx(h.StrikeThroughSupSubToggles,{}),o.jsx(h.Separator,{}),o.jsx(h.ListsToggle,{}),o.jsx(h.Separator,{}),o.jsx(h.CreateLink,{}),o.jsx(h.InsertImage,{}),o.jsx(h.Separator,{}),o.jsx(h.InsertTable,{}),o.jsx(h.InsertThematicBreak,{}),o.jsx(h.Separator,{}),o.jsx(h.InsertCodeBlock,{}),o.jsx(h.Separator,{}),o.jsx(h.InsertFrontmatter,{})]})}),h.diffSourcePlugin(S),h.listsPlugin(),h.quotePlugin(),h.headingsPlugin(A),h.linkPlugin(D),h.linkDialogPlugin(),h.imagePlugin(C),h.tablePlugin(),h.thematicBreakPlugin(),h.frontmatterPlugin(),h.codeBlockPlugin(j),h.codeMirrorPlugin(q),h.markdownShortcutPlugin(),h.directivesPlugin(u)],...k})};ve.Preview=Re;function we(...c){return qe.twMerge(Ae.clsx(c))}const eo=c=>{const{mouseX:e,title:n,icon:r,href:l}=c,a=b.useRef(null),d=s.useTransform(e,I=>{var L;const x=((L=a.current)==null?void 0:L.getBoundingClientRect())??{x:0,width:0};return I-x.x-x.width/2}),k=s.useTransform(d,[-150,0,150],[40,80,40]),i=s.useTransform(d,[-150,0,150],[40,80,40]),C=s.useTransform(d,[-150,0,150],[20,40,20]),S=s.useTransform(d,[-150,0,150],[20,40,20]),A=s.useSpring(k,{mass:.1,stiffness:150,damping:12}),D=s.useSpring(i,{mass:.1,stiffness:150,damping:12}),j=s.useSpring(C,{mass:.1,stiffness:150,damping:12}),q=s.useSpring(S,{mass:.1,stiffness:150,damping:12}),[u,g]=b.useState(!1);return o.jsx("a",{href:l,children:o.jsxs(s.motion.div,{ref:a,style:{width:A,height:D},onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),className:"aspect-square rounded-full bg-gray-200 dark:bg-neutral-800 flex items-center justify-center relative",children:[o.jsx(s.AnimatePresence,{children:u&&o.jsx(s.motion.div,{initial:{opacity:0,y:10,x:"-50%"},animate:{opacity:1,y:0,x:"-50%"},exit:{opacity:0,y:2,x:"-50%"},className:"px-2 py-0.5 whitespace-pre rounded-md bg-gray-100 border dark:bg-neutral-800 dark:border-neutral-900 dark:text-white border-gray-200 text-neutral-700 absolute left-1/2 -translate-x-1/2 -top-8 w-fit text-xs",children:n})}),o.jsx(s.motion.div,{style:{width:j,height:q},className:"flex items-center justify-center",children:r})]})})},Ce=c=>{const{items:e,className:n}=c,r=s.useMotionValue(1/0);return o.jsx(s.motion.div,{onMouseMove:l=>r.set(l.pageX),onMouseLeave:()=>r.set(1/0),className:we("mx-auto hidden md:flex h-16 gap-4 items-end rounded-2xl bg-gray-50 dark:bg-neutral-900 px-4 pb-3",n),children:e.map(l=>o.jsx(eo,{mouseX:r,...l},l.title))})},Se=c=>{const{items:e,className:n,collapseIcon:r,autoHidden:l=!1}=c,[a,d]=b.useState(!1),k=()=>{d(!a)};return o.jsxs("div",{className:we("relative block",l?"md:hidden":"",n),children:[o.jsx(s.AnimatePresence,{children:a&&o.jsx(s.motion.div,{layoutId:"nav",className:"absolute bottom-full mb-2 inset-x-0 flex flex-col gap-2",children:e.map((i,C)=>o.jsx(s.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10,transition:{delay:C*.05}},transition:{delay:(e.length-1-C)*.05},children:o.jsx("a",{href:i.href,className:"h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-900 flex items-center justify-center",children:o.jsx("div",{className:"h-4 w-4",children:i.icon})},i.title)},i.title))})}),o.jsx("button",{onClick:k,className:"h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-800 flex items-center justify-center",children:r||o.jsx(Q.RiMoreLine,{className:"h-5 w-5 text-neutral-500 dark:text-neutral-400"})})]})},ae=c=>{const{items:e,desktopClassName:n,mobileClassName:r,...l}=c;return o.jsxs(o.Fragment,{children:[o.jsx(Ce,{items:e,className:n,...l}),o.jsx(Se,{items:e,className:r,autoHidden:!0,...l})]})};ae.Desktop=Ce,ae.Mobile=Se,f.Desktop=Ve,f.Dock=ae,f.MdEditor=ve,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
|
659
|
+
`,ne=c=>{var e,n;return c==="dark"?!0:c==="light"?!1:(e=document.documentElement.getAttribute("style"))!=null&&e.includes("color-scheme: dark;")?!0:(n=document.documentElement.getAttribute("style"))!=null&&n.includes("color-scheme: light;")?!1:window.matchMedia("(prefers-color-scheme: dark)").matches},Qe=c=>{const{value:e,onChange:n,translation:r,pluginConfig:l,className:a,theme:d="auto",...k}=c,i=b.useRef(null),{image:C,diffSource:S={viewMode:"rich-text"},headings:A,link:D,codeBlock:j,codeMirror:q={codeBlockLanguages:{js:"JavaScript",css:"CSS",txt:"Plain Text",tsx:"TypeScript","":"Unspecified"}},directives:u={directiveDescriptors:[h.AdmonitionDirectiveDescriptor]}}=l??{},[g,I]=b.useState("");return b.useEffect(()=>{var x;e!==void 0&&i.current&&((x=i.current)==null||x.setMarkdown(e),I(e))},[e,i]),o.jsx(h.MDXEditor,{ref:i,className:t.cx(Ze,ne(d)?Ke:"",ne(d)?ye:xe,a),contentEditableClassName:ke,markdown:g,onChange:x=>{!e&&!n&&I(x),n&&n(x)},translation:r??Je,plugins:[h.toolbarPlugin({toolbarContents:()=>o.jsxs(h.DiffSourceToggleWrapper,{options:["rich-text","source"],children:[o.jsx(h.UndoRedo,{}),o.jsx(h.Separator,{}),o.jsx(h.BoldItalicUnderlineToggles,{}),o.jsx(h.CodeToggle,{}),o.jsx(h.Separator,{}),o.jsx(h.StrikeThroughSupSubToggles,{}),o.jsx(h.Separator,{}),o.jsx(h.ListsToggle,{}),o.jsx(h.Separator,{}),o.jsx(h.CreateLink,{}),o.jsx(h.InsertImage,{}),o.jsx(h.Separator,{}),o.jsx(h.InsertTable,{}),o.jsx(h.InsertThematicBreak,{}),o.jsx(h.Separator,{}),o.jsx(h.InsertCodeBlock,{}),o.jsx(h.Separator,{}),o.jsx(h.InsertFrontmatter,{})]})}),h.diffSourcePlugin(S),h.listsPlugin(),h.quotePlugin(),h.headingsPlugin(A),h.linkPlugin(D),h.linkDialogPlugin(),h.imagePlugin(C),h.tablePlugin(),h.thematicBreakPlugin(),h.frontmatterPlugin(),h.codeBlockPlugin(j),h.codeMirrorPlugin(q),h.markdownShortcutPlugin(),h.directivesPlugin(u)],...k})},Re={'code[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"]::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},prolog:{color:"hsl(230, 4%, 64%)"},cdata:{color:"hsl(230, 4%, 64%)"},doctype:{color:"hsl(230, 8%, 24%)"},punctuation:{color:"hsl(230, 8%, 24%)"},entity:{color:"hsl(230, 8%, 24%)",cursor:"help"},"attr-name":{color:"hsl(35, 99%, 36%)"},"class-name":{color:"hsl(35, 99%, 36%)"},boolean:{color:"hsl(35, 99%, 36%)"},constant:{color:"hsl(35, 99%, 36%)"},number:{color:"hsl(35, 99%, 36%)"},atrule:{color:"hsl(35, 99%, 36%)"},keyword:{color:"hsl(301, 63%, 40%)"},property:{color:"hsl(5, 74%, 59%)"},tag:{color:"hsl(5, 74%, 59%)"},symbol:{color:"hsl(5, 74%, 59%)"},deleted:{color:"hsl(5, 74%, 59%)"},important:{color:"hsl(5, 74%, 59%)"},selector:{color:"hsl(119, 34%, 47%)"},string:{color:"hsl(119, 34%, 47%)"},char:{color:"hsl(119, 34%, 47%)"},builtin:{color:"hsl(119, 34%, 47%)"},inserted:{color:"hsl(119, 34%, 47%)"},regex:{color:"hsl(119, 34%, 47%)"},"attr-value":{color:"hsl(119, 34%, 47%)"},"attr-value > .token.punctuation":{color:"hsl(119, 34%, 47%)"},variable:{color:"hsl(221, 87%, 60%)"},operator:{color:"hsl(221, 87%, 60%)"},function:{color:"hsl(221, 87%, 60%)"},url:{color:"hsl(198, 99%, 37%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(230, 8%, 24%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(230, 8%, 24%)"},".language-css .token.selector":{color:"hsl(5, 74%, 59%)"},".language-css .token.property":{color:"hsl(230, 8%, 24%)"},".language-css .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.string.url":{color:"hsl(119, 34%, 47%)"},".language-css .token.important":{color:"hsl(301, 63%, 40%)"},".language-css .token.atrule .token.rule":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.operator":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(344, 84%, 43%)"},".language-json .token.operator":{color:"hsl(230, 8%, 24%)"},".language-json .token.null.keyword":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.url":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.operator":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.content":{color:"hsl(221, 87%, 60%)"},".language-markdown .token.url > .token.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.url-reference.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(119, 34%, 47%)"},".language-markdown .token.bold .token.content":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.italic .token.content":{color:"hsl(301, 63%, 40%)"},".language-markdown .token.strike .token.content":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.list.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(5, 74%, 59%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.cr:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.lf:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.space:before":{color:"hsla(230, 8%, 24%, 0.2)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},".line-highlight.line-highlight":{background:"hsla(230, 8%, 24%, 0.05)"},".line-highlight.line-highlight:before":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(230, 8%, 24%, 0.05)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".command-line .command-line-prompt":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(230, 1%, 62%)"},".command-line .command-line-prompt > span:before":{color:"hsl(230, 1%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(301, 63%, 40%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(0, 0, 95%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(0, 0, 95%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(0, 0, 95%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(0, 0, 95%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(0, 0%, 100%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(230, 8%, 24%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(230, 8%, 24%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(230, 8%, 24%)"}},eo=c=>{const{children:e="",className:n,theme:r="auto"}=c;return o.jsx("div",{className:ne(r)?ye:xe,children:o.jsx(De,{className:t.cx(ke,n),remarkPlugins:[Pe,$e],rehypePlugins:[Le],components:{code(l){const{children:a,className:d,node:k,ref:i,...C}=l,S=/language-(\w+)/.exec(d||"");return S?o.jsx(ze.Prism,{...C,PreTag:"div",children:String(a).replace(/\n$/,""),language:S[1],style:Re}):o.jsx("code",{...C,className:d,children:a})}},children:e})})},ve=Qe;ve.Preview=eo;function we(...c){return qe.twMerge(Ae.clsx(c))}const oo=c=>{const{mouseX:e,title:n,icon:r,href:l}=c,a=b.useRef(null),d=s.useTransform(e,I=>{var L;const x=((L=a.current)==null?void 0:L.getBoundingClientRect())??{x:0,width:0};return I-x.x-x.width/2}),k=s.useTransform(d,[-150,0,150],[40,80,40]),i=s.useTransform(d,[-150,0,150],[40,80,40]),C=s.useTransform(d,[-150,0,150],[20,40,20]),S=s.useTransform(d,[-150,0,150],[20,40,20]),A=s.useSpring(k,{mass:.1,stiffness:150,damping:12}),D=s.useSpring(i,{mass:.1,stiffness:150,damping:12}),j=s.useSpring(C,{mass:.1,stiffness:150,damping:12}),q=s.useSpring(S,{mass:.1,stiffness:150,damping:12}),[u,g]=b.useState(!1);return o.jsx("a",{href:l,children:o.jsxs(s.motion.div,{ref:a,style:{width:A,height:D},onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),className:"aspect-square rounded-full bg-gray-200 dark:bg-neutral-800 flex items-center justify-center relative",children:[o.jsx(s.AnimatePresence,{children:u&&o.jsx(s.motion.div,{initial:{opacity:0,y:10,x:"-50%"},animate:{opacity:1,y:0,x:"-50%"},exit:{opacity:0,y:2,x:"-50%"},className:"px-2 py-0.5 whitespace-pre rounded-md bg-gray-100 border dark:bg-neutral-800 dark:border-neutral-900 dark:text-white border-gray-200 text-neutral-700 absolute left-1/2 -translate-x-1/2 -top-8 w-fit text-xs",children:n})}),o.jsx(s.motion.div,{style:{width:j,height:q},className:"flex items-center justify-center",children:r})]})})},Ce=c=>{const{items:e,className:n}=c,r=s.useMotionValue(1/0);return o.jsx(s.motion.div,{onMouseMove:l=>r.set(l.pageX),onMouseLeave:()=>r.set(1/0),className:we("mx-auto hidden md:flex h-16 gap-4 items-end rounded-2xl bg-gray-50 dark:bg-neutral-900 px-4 pb-3",n),children:e.map(l=>o.jsx(oo,{mouseX:r,...l},l.title))})},Se=c=>{const{items:e,className:n,collapseIcon:r,autoHidden:l=!1}=c,[a,d]=b.useState(!1),k=()=>{d(!a)};return o.jsxs("div",{className:we("relative block",l?"md:hidden":"",n),children:[o.jsx(s.AnimatePresence,{children:a&&o.jsx(s.motion.div,{layoutId:"nav",className:"absolute bottom-full mb-2 inset-x-0 flex flex-col gap-2",children:e.map((i,C)=>o.jsx(s.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10,transition:{delay:C*.05}},transition:{delay:(e.length-1-C)*.05},children:o.jsx("a",{href:i.href,className:"h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-900 flex items-center justify-center",children:o.jsx("div",{className:"h-4 w-4",children:i.icon})},i.title)},i.title))})}),o.jsx("button",{onClick:k,className:"h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-800 flex items-center justify-center",children:r||o.jsx(Q.RiMoreLine,{className:"h-5 w-5 text-neutral-500 dark:text-neutral-400"})})]})},ae=c=>{const{items:e,desktopClassName:n,mobileClassName:r,...l}=c;return o.jsxs(o.Fragment,{children:[o.jsx(Ce,{items:e,className:n,...l}),o.jsx(Se,{items:e,className:r,autoHidden:!0,...l})]})};ae.Desktop=Ce,ae.Mobile=Se,f.Desktop=Ve,f.Dock=ae,f.MdEditor=ve,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zs_library",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.20",
|
|
4
4
|
"homepage": "https://zs-library.vercel.app",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/virzs/zs_library/issues"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@emotion/css": "^11.13.5",
|
|
43
43
|
"@mantine/core": "^7.14.3",
|
|
44
|
-
"@mdxeditor/editor": "^3.
|
|
44
|
+
"@mdxeditor/editor": "^3.20.0",
|
|
45
45
|
"@remixicon/react": "^4.5.0",
|
|
46
46
|
"ahooks": "^3.8.4",
|
|
47
47
|
"clsx": "^2.1.1",
|
|
@@ -70,12 +70,13 @@
|
|
|
70
70
|
"@commitlint/cli": "^19.6.0",
|
|
71
71
|
"@commitlint/config-conventional": "^19.6.0",
|
|
72
72
|
"@eslint/js": "^9.16.0",
|
|
73
|
+
"@rspress/plugin-api-docgen": "^1.37.4",
|
|
73
74
|
"@rspress/plugin-playground": "^1.37.4",
|
|
74
75
|
"@rspress/plugin-preview": "^1.37.4",
|
|
75
76
|
"@rspress/plugin-typedoc": "^1.37.4",
|
|
76
77
|
"@types/node": "^22.10.1",
|
|
77
|
-
"@types/react": "^19.0.
|
|
78
|
-
"@types/react-dom": "^19.0.
|
|
78
|
+
"@types/react": "^19.0.1",
|
|
79
|
+
"@types/react-dom": "^19.0.1",
|
|
79
80
|
"@types/react-slick": "^0.23.13",
|
|
80
81
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
81
82
|
"@types/rollup-plugin-auto-external": "^2.0.5",
|
|
@@ -89,7 +90,7 @@
|
|
|
89
90
|
"globals": "^15.13.0",
|
|
90
91
|
"husky": "^9.1.7",
|
|
91
92
|
"postcss": "^8.4.49",
|
|
92
|
-
"rollup": "^4.28.
|
|
93
|
+
"rollup": "^4.28.1",
|
|
93
94
|
"rollup-plugin-auto-external": "^2.0.0",
|
|
94
95
|
"rollup-plugin-visualizer": "^5.12.0",
|
|
95
96
|
"rspress": "^1.37.4",
|