zs_library 0.3.21 → 0.3.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/md-editor/preview.d.ts +2 -0
- package/dist/index.es.js +318 -317
- package/dist/index.umd.js +45 -45
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(p,e){typeof exports=="object"&&typeof module<"u"?e(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("rc-image"),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","rc-image","clsx","tailwind-merge"],e):(p=typeof globalThis<"u"?globalThis:p||self,e(p.zs_library={},p.jsxRuntime,p.css,p.React,p.Slider,p.reactSortablejs,p.framerMotion,p.ahooks,p.uuid,p.RcTooltip,p.react$1,p.Dialog,p.ReactJson,p.MDXEditor,p.Markdown,p.remarkGfm,p.emoji,p.rehypeRaw,p.reactSyntaxHighlighter,p.Image,p.clsx,p.tailwindMerge))})(this,function(p,e,t,
|
|
1
|
+
(function(p,e){typeof exports=="object"&&typeof module<"u"?e(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("rc-image"),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","rc-image","clsx","tailwind-merge"],e):(p=typeof globalThis<"u"?globalThis:p||self,e(p.zs_library={},p.jsxRuntime,p.css,p.React,p.Slider,p.reactSortablejs,p.framerMotion,p.ahooks,p.uuid,p.RcTooltip,p.react$1,p.Dialog,p.ReactJson,p.MDXEditor,p.Markdown,p.remarkGfm,p.emoji,p.rehypeRaw,p.reactSyntaxHighlighter,p.Image,p.clsx,p.tailwindMerge))})(this,function(p,e,t,k,Me,oe,s,se,ce,Ne,G,de,Be,h,De,Le,Pe,ze,$e,Ae,qe,Ee){"use strict";var so=Object.defineProperty;var co=(p,e,t)=>e in p?so(p,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):p[e]=t;var ie=(p,e,t)=>co(p,typeof e!="symbol"?e+"":e,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=k.createContext({}),je=c=>{const{children:o,theme:n,...r}=c,l=k.useMemo(()=>n==="light"?ge:n==="dark"?ue:n,[n]);return e.jsx(he.Provider,{value:{theme:l,...r},children:o})},W=()=>k.useContext(he),pe={maxRow:2,maxCol:2},He={...pe},me={app:pe,group:He};class O{}ie(O,"uniqueArray",o=>o.reduce((n,r)=>n.find(a=>a.id===r.id)?n:n.concat([r]),[])),ie(O,"getTheme",o=>{const n=ge.token,r=ue.token,l={...n,...o==null?void 0:o.token},a={...r,...o==null?void 0:o.token};return{light:l,dark:a}});const fe=k.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:()=>{}}),Fe=c=>{const{children:o,list:n=[],onChange:r,storageKey:l="ZS_LIBRARY_DESKTOP_SORTABLE_CONFIG",enableCaching:a=!0}=c,[d,m]=k.useState(),[i,S]=k.useState(),[C,D]=k.useState(null),L=k.useRef(C),[j,q]=k.useState(null),[u,g]=k.useState([]),[I,x]=k.useState(null),[$,f]=k.useState(null),[M,T]=k.useState(!1),[b,y]=k.useState(null),[H,J]=k.useState(null),[F,le]=k.useState(!1),[K,R]=se.useLocalStorageState(l,{defaultValue:[],listenStorageChange:!0}),ee=()=>{q(null),clearTimeout(d),m(void 0),L.current=null},P=(v,Y)=>{q({...v,pageX:v.pageX,pageY:v.pageY,data:Y}),clearTimeout(d)},U=(v,Y=!0)=>{const{config:X={}}=v;return X.allowContextMenu===!1?{}:{onMouseDown:N=>{m(setTimeout(()=>{Y&&L.current===null&&P(N,v)},800)),T(!1),S(setTimeout(()=>{T(!0)},800))},onMouseUp:()=>{clearTimeout(i),S(void 0),clearTimeout(d),m(void 0)},onContextMenu:N=>{Y&&(N.preventDefault(),P(N,v))}}},Z=(v,Y)=>{const X=[...Y||[]];if(X.length>0)g(N=>{const A=[...N],z=w=>{var Ie,Te;const B=X.shift(),E=w.find(V=>V.id===B),_=w.findIndex(V=>V.id===B);if(X.length&&E){if(((Ie=E.children)==null?void 0:Ie.filter(V=>!v.some(io=>io.id===V.id)).length)===1&&v.length===1){const V={...v[0]};return w.splice(_,1,V),r==null||r(w),w}return E.children=z(E.children||[]),w.splice(_,1,E),r==null||r(w),w}if(E){if(!((Te=E.children)!=null&&Te.length)&&v.length){const V={...E};return E.data={name:"文件夹"},E.type="group",E.children=[V,...v],E.id=ce.v4(),w.splice(_,1,E),r==null||r(w),w}return E.children=O.uniqueArray(v),w.splice(_,1,E),r==null||r(w),w}return O.uniqueArray(v)};return O.uniqueArray(z(A))});else{const N=O.uniqueArray(v);r==null||r(N),g(N)}},ro=(v,Y)=>{g(X=>{const N=[...X],A=z=>{var w;for(let B=0;B<z.length;B++)if(z[B].id===v){z[B].config=Y;break}else((w=z[B].children)==null?void 0:w.length)!==void 0&&A(z[B].children)};return A(N),r==null||r(N),N})},no=(v,Y)=>{g(X=>{const N=[...X],A=z=>{var w;for(let B=0;B<z.length;B++)if(z[B].id===v){z[B].data=Y;break}else((w=z[B].children)==null?void 0:w.length)!==void 0&&A(z[B].children)};return A(N),r==null||r(N),N})},ao=v=>{g(Y=>{const X=[...Y],N=A=>{var z;for(let w=0;w<A.length;w++)if(A[w].id===v){A.splice(w,1);break}else((z=A[w].children)==null?void 0:z.length)!==void 0&&N(A[w].children)};return N(X),r==null||r(X),X})},lo=(v,Y)=>{const X=[...u],N=(A,z)=>{const w=z.shift(),B=A.find(_=>_.id===w),E=A.findIndex(_=>_.id===w);if(B){if(z.length)B.children=N(B.children||[],z);else{const _=(v==null?void 0:v.type)??"app";B.children=[...B.children??[],{...v,id:ce.v4(),config:(v==null?void 0:v.config)??me[_]}]}return A.splice(E,1,B),A}else return A};g(N(X,Y))};return k.useEffect(()=>{(n==null?void 0:n.length)>0&&u.length===0&&Z(n)},[n]),k.useEffect(()=>{L.current=C,C!==null&&ee()},[C]),k.useEffect(()=>{a&&K!=null&&K.length&&!F&&(Z(K),le(!0))},[K,F,a]),se.useDebounceEffect(()=>{a&&R(u)},[u,a],{wait:1e3}),e.jsx(fe.Provider,{value:{list:u,setList:Z,contextMenu:j,setContextMenu:q,listStatus:C,setListStatus:D,contextMenuFuns:U,hideContextMenu:ee,showInfoItemData:I,setShowInfoItemData:x,openGroupItemData:$,setOpenGroupItemData:f,longPressTriggered:M,updateItemConfig:ro,updateItem:no,removeItem:ao,addItem:lo,moveItemId:b,setMoveItemId:y,moveTargetId:H,setMoveTargetId:J},children:o})},Q=()=>k.useContext(fe),Xe={menuShow:{opacity:1,y:0,transition:{type:"spring",stiffness:300,damping:24}},menuHide:{opacity:0,y:20,transition:{duration:.2}}},te=c=>{const{icon:o,title:n,onClick:r}=c,{theme:l}=W(),{light:a,dark:d}=O.getTheme(l);return e.jsx(s.motion.div,{className:t.css`
|
|
2
2
|
&:hover {
|
|
3
|
-
background-color: ${
|
|
3
|
+
background-color: ${a.contextMenuActiveColor};
|
|
4
4
|
@media (prefers-color-scheme: dark) {
|
|
5
5
|
background-color: ${d.contextMenuActiveColor};
|
|
6
6
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
transition: all 0.3s;
|
|
15
15
|
user-select: none;
|
|
16
16
|
border-radius: 0.5rem;
|
|
17
|
-
`,onClick:
|
|
17
|
+
`,onClick:m=>{m.stopPropagation(),r==null||r()},variants:Xe,children:e.jsxs(s.motion.div,{className:t.cx("py-1.5 px-3 rounded-lg",t.css`
|
|
18
18
|
padding-top: 0.375rem;
|
|
19
19
|
padding-bottom: 0.375rem;
|
|
20
20
|
padding-left: 0.75rem;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
margin-bottom: 0.375rem;
|
|
25
25
|
display: flex;
|
|
26
26
|
justify-content: center;
|
|
27
|
-
`),children:o}),e.jsx(s.motion.div,{children:
|
|
27
|
+
`),children:o}),e.jsx(s.motion.div,{children:n})]})})},Ge=c=>{const{showInfoButton:o=!0,showRemoveButton:n=!0,showShareButton:r=!0,showSizeButton:l=!0,onInfoClick:a,onShareClick:d,onRemoveClick:m}=c,{contextMenu:i,setContextMenu:S,hideContextMenu:C,setShowInfoItemData:D,removeItem:L,updateItemConfig:j}=Q(),{theme:q}=W(),{light:u,dark:g}=O.getTheme(q),{data:I}=i??{},{config:x={}}=I??{},$=()=>{var T;const f=me[(T=i==null?void 0:i.data)==null?void 0:T.type],M=[];for(let b=1;b<=((f==null?void 0:f.maxRow)??2);b++)for(let y=1;y<=((f==null?void 0:f.maxCol)??2);y++)M.push(`${b}x${y}`);return M};return e.jsx(s.AnimatePresence,{children:i&&e.jsxs(s.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:f=>{f.stopPropagation(),f.preventDefault()},children:[e.jsx(s.motion.div,{className:t.cx(t.css`
|
|
28
28
|
border-radius: 0.5rem;
|
|
29
29
|
overflow: hidden;
|
|
30
30
|
background-color: ${u.contextMenuBackgroundColor};
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
background-color: white;
|
|
38
38
|
padding: 0.25rem;
|
|
39
39
|
margin: 0;
|
|
40
|
-
`,children:[{label:"修改大小",key:"size",icon:e.jsx(G.RiPencilRuler2Line,{size:14}),items
|
|
40
|
+
`,children:[{label:"修改大小",key:"size",icon:e.jsx(G.RiPencilRuler2Line,{size:14}),items:$().map(f=>({label:f,key:f,onClick:()=>{const[M,T]=f.split("x").map(Number);j(i.data.id,{row:M,col:T})}}))}].map(f=>e.jsxs(s.motion.li,{className:t.css`
|
|
41
41
|
padding-top: 0.5rem;
|
|
42
42
|
padding-bottom: 0.5rem;
|
|
43
43
|
padding-left: 0.75rem;
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
gap: 0.5rem;
|
|
51
51
|
padding-bottom: 0.5rem;
|
|
52
52
|
margin: 0;
|
|
53
|
-
`,children:[
|
|
53
|
+
`,children:[f.icon," ",f.label]}),e.jsx(s.motion.div,{className:t.css`
|
|
54
54
|
display: grid;
|
|
55
55
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
56
56
|
gap: 0.25rem;
|
|
57
|
-
`,children:
|
|
57
|
+
`,children:f.items.map(M=>e.jsx(s.motion.div,{className:t.cx("py-1 px-2 hover:bg-gray-100 rounded transition-all cursor-pointer text-center text-sm",t.css`
|
|
58
58
|
padding-top: 0.25rem;
|
|
59
59
|
padding-bottom: 0.25rem;
|
|
60
60
|
padding-left: 0.5rem;
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
@media (prefers-color-scheme: dark) {
|
|
81
81
|
background-color: ${g.contextMenuActiveColor};
|
|
82
82
|
}
|
|
83
|
-
`),onClick:M.onClick,children:M.label},M.key))})]},
|
|
83
|
+
`),onClick:M.onClick,children:M.label},M.key))})]},f.key))})}),e.jsxs(s.motion.div,{className:t.cx(t.css`
|
|
84
84
|
background-color: ${u.contextMenuBackgroundColor};
|
|
85
85
|
box-shadow: 0 0 0.5rem ${u.contextMenuShadowColor};
|
|
86
86
|
@media (prefers-color-scheme: dark) {
|
|
@@ -94,12 +94,12 @@
|
|
|
94
94
|
border-radius: 0.5rem;
|
|
95
95
|
overflow: hidden;
|
|
96
96
|
padding: 0.25rem;
|
|
97
|
-
`),children:[r&&e.jsx(te,{icon:e.jsx(G.RiShareLine,{size:20}),title:"分享",onClick:()=>{if(d){d(i.data);return}}}),o&&e.jsx(te,{icon:e.jsx(G.RiInformationLine,{size:20}),title:"信息",onClick:()=>{if(
|
|
97
|
+
`),children:[r&&e.jsx(te,{icon:e.jsx(G.RiShareLine,{size:20}),title:"分享",onClick:()=>{if(d){d(i.data);return}}}),o&&e.jsx(te,{icon:e.jsx(G.RiInformationLine,{size:20}),title:"信息",onClick:()=>{if(a){a(i.data);return}D({...i.data,pageX:i.pageX,pageY:i.pageY}),C()}}),n&&e.jsx(te,{icon:e.jsx(G.RiCloseCircleLine,{size:20}),title:"移除",onClick:()=>{if(m){m(i.data,L);return}S(null),L(i.data.id)}})]})]})})},Ye=c=>{const{data:o,noLetters:n=!1}=c,{contextMenuFuns:r}=Q(),{itemIconBuilder:l,theme:a,contextMenu:d}=W(),{light:m,dark:i}=O.getTheme(a),{data:S={}}=o,{name:C}=S;return e.jsxs(e.Fragment,{children:[e.jsx(s.motion.div,{className:t.css`
|
|
98
98
|
width: 4rem;
|
|
99
99
|
height: 4rem;
|
|
100
|
-
background-color: ${
|
|
100
|
+
background-color: ${m.itemIconBackgroundColor};
|
|
101
101
|
border-radius: 0.75rem;
|
|
102
|
-
box-shadow: 0 0 0.5rem ${
|
|
102
|
+
box-shadow: 0 0 0.5rem ${m.itemIconShadowColor};
|
|
103
103
|
cursor: pointer;
|
|
104
104
|
position: relative;
|
|
105
105
|
overflow: hidden;
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
top: 0;
|
|
114
114
|
width: 100%;
|
|
115
115
|
height: 100%;
|
|
116
|
-
color: ${
|
|
116
|
+
color: ${m.itemNameColor};
|
|
117
117
|
@media (prefers-color-scheme: dark) {
|
|
118
118
|
color: ${i.itemNameColor};
|
|
119
119
|
}
|
|
@@ -121,27 +121,27 @@
|
|
|
121
121
|
text-align: center;
|
|
122
122
|
margin-top: 0.25rem;
|
|
123
123
|
margin-bottom: 0;
|
|
124
|
-
color: ${
|
|
124
|
+
color: ${m.itemNameColor};
|
|
125
125
|
@media (prefers-color-scheme: dark) {
|
|
126
126
|
color: ${i.itemNameColor};
|
|
127
127
|
}
|
|
128
|
-
`,
|
|
128
|
+
`,n&&t.css`
|
|
129
129
|
color: transparent;
|
|
130
|
-
`),children:
|
|
130
|
+
`),children:C})]})},re=c=>{const{data:o,className:n,itemIndex:r,onClick:l,disabledDrag:a=!1,children:d,parentIds:m,childrenLength:i}=c,{contextMenu:S,setContextMenu:C}=Q(),{contextMenu:D}=W();return e.jsx(Ne,{placement:"bottom",overlayClassName:t.css`
|
|
131
131
|
background-color: transparent;
|
|
132
132
|
.rc-tooltip-inner {
|
|
133
133
|
background-color: transparent;
|
|
134
134
|
padding: 0;
|
|
135
135
|
border: none;
|
|
136
136
|
}
|
|
137
|
-
`,overlay:e.jsx(Ge,{...
|
|
137
|
+
`,overlay:e.jsx(Ge,{...D}),visible:(S==null?void 0:S.data.id)===o.id,onVisibleChange:L=>{L||C(null)},destroyTooltipOnHide:!0,children:e.jsx(s.motion.div,{"data-id":o.id,"data-index":r,"data-parent-ids":m==null?void 0:m.join(","),"data-children-length":i,onClick:()=>l==null?void 0:l(o),className:t.cx(a&&"drag-disabled",n),children:d??e.jsx(Ye,{...c})})})},Oe=c=>{const{data:o,className:n,parentIds:r,itemIndex:l,onClick:a,noLetters:d=!1}=c,{contextMenuFuns:m,setList:i,setOpenGroupItemData:S,longPressTriggered:C,moveItemId:D,moveTargetId:L,setMoveTargetId:j,listStatus:q}=Q(),{itemIconBuilder:u,theme:g,contextMenu:I}=W(),{light:x,dark:$}=O.getTheme(g),{children:f,data:M,config:T}=o,{row:b=1,col:y=1}=T??{},H={visible:{opacity:1,scale:1},hidden:{opacity:0,scale:.95}},J=((f==null?void 0:f.length)??0)===0,F=J?[o]:[...f??[]].slice(0,9),le=k.useMemo(()=>D===o.id.toString(),[o.id,D]),K=k.useMemo(()=>L===o.id,[o.id,L]),R=t.css`
|
|
138
138
|
overflow: hidden;
|
|
139
139
|
cursor: pointer;
|
|
140
140
|
background-color: ${x.itemIconBackgroundColor};
|
|
141
141
|
box-shadow: 0 0 0.5rem ${x.itemIconShadowColor};
|
|
142
142
|
@media (prefers-color-scheme: dark) {
|
|
143
|
-
background-color: ${
|
|
144
|
-
box-shadow: 0 0 0.5rem ${
|
|
143
|
+
background-color: ${$.itemIconBackgroundColor};
|
|
144
|
+
box-shadow: 0 0 0.5rem ${$.itemIconShadowColor};
|
|
145
145
|
}
|
|
146
146
|
`,ee=()=>{if(J)return e.jsx(s.motion.div,{className:t.cx("sortable-group-item",t.css`
|
|
147
147
|
overflow: hidden;
|
|
@@ -154,9 +154,9 @@
|
|
|
154
154
|
top: 0;
|
|
155
155
|
border-radius: 0.75rem;
|
|
156
156
|
@media (prefers-color-scheme: dark) {
|
|
157
|
-
background-color: ${
|
|
157
|
+
background-color: ${$.itemIconBackgroundColor};
|
|
158
158
|
}
|
|
159
|
-
`),onClick:
|
|
159
|
+
`),onClick:P=>{P.stopPropagation(),a==null||a(o)},children:u==null?void 0:u(o)});if(b===1&&y===1||b===2&&y===2)return e.jsx(s.motion.div,{className:t.css`
|
|
160
160
|
display: grid;
|
|
161
161
|
width: 100%;
|
|
162
162
|
height: 100%;
|
|
@@ -165,11 +165,11 @@
|
|
|
165
165
|
padding: ${y===1?"0.125rem":"0.25rem"};
|
|
166
166
|
gap: ${y===1?"0.125rem":"0.5rem"};
|
|
167
167
|
place-items: center;
|
|
168
|
-
`,children:F==null?void 0:F.slice(0,9).map(
|
|
168
|
+
`,children:F==null?void 0:F.slice(0,9).map(P=>e.jsx(s.motion.div,{className:t.cx(R,t.css`
|
|
169
169
|
border-radius: ${y===1?"0.25rem":"0.5rem"};
|
|
170
170
|
width: 100%;
|
|
171
171
|
height: 100%;
|
|
172
|
-
`),onClick:U=>{U.stopPropagation(),
|
|
172
|
+
`),onClick:U=>{U.stopPropagation(),a==null||a(P)},children:u==null?void 0:u(P)},P.id))});if(b===1&&y===2)return e.jsx(s.motion.div,{className:t.css`
|
|
173
173
|
display: grid;
|
|
174
174
|
grid-template-columns: repeat(10, minmax(0, 1fr));
|
|
175
175
|
grid-template-rows: repeat(4, minmax(0, 1fr));
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
width: 144px;
|
|
179
179
|
height: 52px;
|
|
180
180
|
place-items: center;
|
|
181
|
-
`,children:F==null?void 0:F.slice(0,4).map((
|
|
181
|
+
`,children:F==null?void 0:F.slice(0,4).map((P,U)=>e.jsx(s.motion.div,{className:t.cx(R,U<2?t.css`
|
|
182
182
|
width: 52px;
|
|
183
183
|
height: 52px;
|
|
184
184
|
border-radius: 0.5rem;
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
border-radius: 0.375rem;
|
|
191
191
|
grid-column: span 2 / span 2;
|
|
192
192
|
grid-row: span 2 / span 2;
|
|
193
|
-
`),onClick:Z=>{U>2||(Z.stopPropagation(),
|
|
193
|
+
`),onClick:Z=>{U>2||(Z.stopPropagation(),a==null||a(P))},children:u==null?void 0:u(P)},P.id))});if(b===2&&y===1)return e.jsx(s.motion.div,{className:t.css`
|
|
194
194
|
display: grid;
|
|
195
195
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
196
196
|
grid-template-rows: repeat(10, minmax(0, 1fr));
|
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
width: 52px;
|
|
200
200
|
height: 144px;
|
|
201
201
|
place-items: center;
|
|
202
|
-
`,children:F==null?void 0:F.slice(0,4).map((
|
|
202
|
+
`,children:F==null?void 0:F.slice(0,4).map((P,U)=>e.jsx(s.motion.div,{className:t.cx(R,U<2?t.css`
|
|
203
203
|
width: 52px;
|
|
204
204
|
height: 52px;
|
|
205
205
|
border-radius: 0.5rem;
|
|
@@ -210,25 +210,25 @@
|
|
|
210
210
|
height: 1.5rem;
|
|
211
211
|
grid-column: span 2 / span 2;
|
|
212
212
|
grid-row: span 2 / span 2;
|
|
213
|
-
`),onClick:Z=>{U>2||(Z.stopPropagation(),
|
|
214
|
-
grid-row: span ${
|
|
213
|
+
`),onClick:Z=>{U>2||(Z.stopPropagation(),a==null||a(P))},children:u==null?void 0:u(P)},P.id))})};return e.jsxs(re,{data:o,itemIndex:l,parentIds:r,childrenLength:f==null?void 0:f.length,className:t.cx(t.css`
|
|
214
|
+
grid-row: span ${b};
|
|
215
215
|
grid-column: span ${y};
|
|
216
|
-
`,
|
|
216
|
+
`,n),children:[e.jsx(s.motion.div,{whileTap:{scale:.9},className:t.cx(K?"!scale-110":"",t.css`
|
|
217
217
|
cursor: pointer;
|
|
218
218
|
position: relative;
|
|
219
219
|
border-radius: 0.75rem;
|
|
220
220
|
background-color: ${x.groupItemIconBackgroundColor};
|
|
221
221
|
box-shadow: 0 0 0.5rem ${x.groupItemIconShadowColor};
|
|
222
222
|
@media (prefers-color-scheme: dark) {
|
|
223
|
-
background-color: ${
|
|
224
|
-
box-shadow: 0 0 0.5rem ${
|
|
223
|
+
background-color: ${$.groupItemIconBackgroundColor};
|
|
224
|
+
box-shadow: 0 0 0.5rem ${$.groupItemIconShadowColor};
|
|
225
225
|
}
|
|
226
226
|
/* overflow: hidden; */
|
|
227
227
|
transition: all 0.3s;
|
|
228
228
|
margin: 0 auto;
|
|
229
229
|
width: ${y*64+32*(y-1)}px;
|
|
230
|
-
height: ${
|
|
231
|
-
`),onClick:
|
|
230
|
+
height: ${b*64+32*(b-1)}px;
|
|
231
|
+
`),onClick:P=>{!J&&!C&&(o.parentIds=r,o.pageX=P.pageX,o.pageY=P.pageY,S(o))},...m(o,I!==!1),children:e.jsxs(s.motion.div,{className:t.css`
|
|
232
232
|
position: relative;
|
|
233
233
|
width: 100%;
|
|
234
234
|
height: 100%;
|
|
@@ -247,13 +247,13 @@
|
|
|
247
247
|
> * {
|
|
248
248
|
opacity: 0;
|
|
249
249
|
}
|
|
250
|
-
`),group:{name:"nested",pull:!1,put:!0},animation:150,fallbackOnBody:!0,list:
|
|
250
|
+
`),group:{name:"nested",pull:!1,put:!0},animation:150,fallbackOnBody:!0,list:f??[],setList:P=>i(P,r),filter:()=>!0,"data-id":o.id,onChange:()=>{j(o.id)}})]})}),e.jsx(s.motion.p,{className:t.cx(t.css`
|
|
251
251
|
text-align: center;
|
|
252
252
|
margin-top: 0.25rem;
|
|
253
253
|
margin-bottom: 0;
|
|
254
254
|
color: ${x.itemNameColor};
|
|
255
255
|
@media (prefers-color-scheme: dark) {
|
|
256
|
-
color: ${
|
|
256
|
+
color: ${$.itemNameColor};
|
|
257
257
|
}
|
|
258
258
|
`,d&&t.css`
|
|
259
259
|
color: transparent;
|
|
@@ -269,7 +269,7 @@
|
|
|
269
269
|
transition: all 0.2s;
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
`,_e=c=>{const{data:o,onClose:
|
|
272
|
+
`,_e=c=>{const{data:o,onClose:n,onItemClick:r}=c,{list:l,setList:a,setListStatus:d,setMoveItemId:m,setMoveTargetId:i,updateItem:S}=Q(),{theme:C}=W(),{light:D,dark:L}=O.getTheme(C),[j,q]=k.useState("文件夹"),u=[...(o==null?void 0:o.children)??[]];return k.useEffect(()=>{var g;o&&q((g=o.data)==null?void 0:g.name)},[o]),e.jsx(de,{visible:!!o,onClose:()=>{n()},animation:"zoom",maskAnimation:"fade",mousePosition:o!=null&&o.pageX&&(o!=null&&o.pageY)?{x:o==null?void 0:o.pageX,y:o==null?void 0:o.pageY}:null,title:e.jsx("input",{className:t.css`
|
|
273
273
|
background-color: transparent;
|
|
274
274
|
border-style: none;
|
|
275
275
|
text-align: center;
|
|
@@ -282,7 +282,7 @@
|
|
|
282
282
|
&:focus {
|
|
283
283
|
outline: none;
|
|
284
284
|
}
|
|
285
|
-
`,value:j,onChange:g=>{q(g.target.value)},onBlur:()=>{o&&
|
|
285
|
+
`,value:j,onChange:g=>{q(g.target.value)},onBlur:()=>{o&&S(o.id,{...o.data,name:j})}}),footer:null,closable:!1,className:t.cx("group-item-modal",t.css`
|
|
286
286
|
.rc-dialog-content {
|
|
287
287
|
background-color: transparent;
|
|
288
288
|
box-shadow: none;
|
|
@@ -297,9 +297,9 @@
|
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
.rc-dialog-body {
|
|
300
|
-
background-color: ${
|
|
300
|
+
background-color: ${D.groupItemModalBackgroundColor};
|
|
301
301
|
@media (prefers-color-scheme: dark) {
|
|
302
|
-
background-color: ${
|
|
302
|
+
background-color: ${L.groupItemModalBackgroundColor};
|
|
303
303
|
}
|
|
304
304
|
border-radius: 0.5rem;
|
|
305
305
|
overflow: hidden;
|
|
@@ -309,14 +309,14 @@
|
|
|
309
309
|
overflow-y: auto;
|
|
310
310
|
max-height: 60vh;
|
|
311
311
|
padding: 1.25rem 0;
|
|
312
|
-
`,onDragLeave:g=>{const I=g.relatedTarget;I&&(g.currentTarget.contains(I)||setTimeout(()=>{
|
|
312
|
+
`,onDragLeave:g=>{const I=g.relatedTarget;I&&(g.currentTarget.contains(I)||setTimeout(()=>{n()},500))},children:e.jsx(oe.ReactSortable,{className:t.css`
|
|
313
313
|
display: grid;
|
|
314
314
|
gap: 1rem;
|
|
315
315
|
place-items: center;
|
|
316
316
|
grid-template-columns: repeat(auto-fill, 96px);
|
|
317
317
|
grid-auto-flow: dense;
|
|
318
318
|
grid-auto-rows: 96px;
|
|
319
|
-
`,group:{name:"nested",pull:!0,put:!1},animation:150,fallbackOnBody:!0,list:(o==null?void 0:o.children)??[],setList:g=>{var
|
|
319
|
+
`,group:{name:"nested",pull:!0,put:!1},animation:150,fallbackOnBody:!0,list:(o==null?void 0:o.children)??[],setList:g=>{var $,f;const I=g.map(M=>M.id),x=(f=($=l.find(M=>M.id===(o==null?void 0:o.id)))==null?void 0:$.children)==null?void 0:f.map(M=>M.id);I.length===(x==null?void 0:x.length)&&I.every((M,T)=>M===x[T])||I.length<((x==null?void 0:x.length)??0)||a(g,[...(o==null?void 0:o.parentIds)??[],o==null?void 0:o.id])},onMove:()=>(i(null),d("onMove"),!0),onStart:g=>{const I=g.item.dataset;I!=null&&I.id&&m(I.id),d("onMove")},onEnd:()=>{m(null),i(null),d(null)},ghostClass:be,children:u.map((g,I)=>e.jsx(re,{data:g,itemIndex:I,onClick:r},g.id))})})})},Ue=c=>{var r;const{data:o,onClose:n}=c;return e.jsx(de,{visible:!!o,onClose:()=>{n()},animation:"zoom",maskAnimation:"fade",mousePosition:o!=null&&o.pageX&&(o!=null&&o.pageY)?{x:o==null?void 0:o.pageX,y:o==null?void 0:o.pageY}:null,footer:null,title:((r=o==null?void 0:o.data)==null?void 0:r.name)??"信息",children:o&&e.jsxs("div",{children:[e.jsx("div",{className:"mb-2",children:"开发者信息"}),e.jsx("div",{className:"p-2 rounded-md bg-[#272822]",children:e.jsx(Be,{src:o,theme:"monokai"})})]})})},Ve=c=>{const{pagination:o={position:"bottom"},className:n,sliderProps:r,sliderRef:l,onItemClick:a}=c,d=k.useRef(null),m=k.useRef(null),{list:i,setList:S,setListStatus:C,showInfoItemData:D,setShowInfoItemData:L,openGroupItemData:j,setOpenGroupItemData:q,setMoveItemId:u,setMoveTargetId:g,addItem:I}=Q(),{pagingDotBuilder:x,pagingDotsBuilder:$,itemBuilder:f}=W(),M=k.useMemo(()=>o===!1?{}:{top:t.css`
|
|
320
320
|
display: flex;
|
|
321
321
|
flex-direction: column;
|
|
322
322
|
.slick-list {
|
|
@@ -374,7 +374,7 @@
|
|
|
374
374
|
width: 100%;
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
|
-
`,
|
|
377
|
+
`,n),customPaging:T=>{var b,y;return x?x(i[T],T):e.jsx("div",{onDragEnter:()=>{var H;(H=(l??d).current)==null||H.slickGoTo(T)},children:(y=(b=i[T])==null?void 0:b.data)==null?void 0:y.name})},appendDots:T=>$?$(T):o===!1?e.jsx("div",{}):e.jsx("div",{children:e.jsx("ul",{ref:m,className:t.cx("slick-dots-default",t.css`
|
|
378
378
|
padding: 0.5rem;
|
|
379
379
|
display: inline-flex;
|
|
380
380
|
justify-content: center;
|
|
@@ -393,7 +393,7 @@
|
|
|
393
393
|
width: auto;
|
|
394
394
|
height: auto;
|
|
395
395
|
}
|
|
396
|
-
`),children:T})}),...r,children:i.map(T=>e.jsx("div",{onDrop:
|
|
396
|
+
`),children:T})}),...r,children:i.map(T=>e.jsx("div",{onDrop:b=>{b.preventDefault();const y=b.dataTransfer.getData("text/plain");if(y!=="")try{I(JSON.parse(y),[T.id])}catch(H){console.log("drag error",H)}},onDragOver:b=>{b.preventDefault()},children:e.jsx(oe.ReactSortable,{className:t.cx(t.css`
|
|
397
397
|
display: grid;
|
|
398
398
|
transition: all 0.3s;
|
|
399
399
|
grid-template-columns: repeat(auto-fill, 96px);
|
|
@@ -402,7 +402,7 @@
|
|
|
402
402
|
place-items: center;
|
|
403
403
|
justify-content: center;
|
|
404
404
|
align-items: center;
|
|
405
|
-
`),animation:150,fallbackOnBody:!0,swapThreshold:.65,group:"nested",list:T.children??[],setList:
|
|
405
|
+
`),animation:150,fallbackOnBody:!0,swapThreshold:.65,group:"nested",list:T.children??[],setList:b=>S(b,[T.id]),filter:".drag-disabled",onMove:b=>{C("onMove");const{dragged:y,related:H}=b,J=y.dataset,F=H.dataset;return g(null),!((Object.keys(F).length===0||F.parentIds)&&Number(J.childrenLength)>0&&H.classList.contains("sortable-group-item"))},onStart:b=>{const y=b.item.dataset;y!=null&&y.id&&u(y.id),C("onMove")},onEnd:()=>{u(null),g(null),C(null)},ghostClass:be,children:(T.children??[]).map((b,y)=>{let H;if(f)return f(b);switch(b.type){case"group":case"app":H=e.jsx(Oe,{data:b,itemIndex:y,parentIds:[T.id,b.id],onClick:a},b.id);break;default:H=e.jsx(re,{data:b,itemIndex:y,onClick:a},b.id);break}return H})})},T.id))}),e.jsx(Ue,{data:D,onClose:()=>{L(null)}}),e.jsx(_e,{data:j,onClose:()=>{q(null)},onItemClick:a})]})},We=c=>{const{list:o,onChange:n,storageKey:r,enableCaching:l,theme:a,noLetters:d,contextMenu:m,contextMenuBuilder:i,itemBuilder:S,itemIconBuilder:C,pagingDotBuilder:D,pagingDotsBuilder:L,...j}=c,q={list:o,onChange:n,storageKey:r,enableCaching:l},u={theme:a,noLetters:d,contextMenu:m,pagingDotsBuilder:L,pagingDotBuilder:D,itemBuilder:S,itemIconBuilder:C,contextMenuBuilder:i};return e.jsx(Fe,{...q,children:e.jsx(je,{...u,children:e.jsx(Ve,{...j})})})},Je={frontmatterEditor:{title:"编辑前置元数据",key:"键",value:"值",addEntry:"添加项目"},dialogControls:{save:"保存",cancel:"取消"},uploadImage:{uploadInstructions:"从您的设备中上传图片:",addViaUrlInstructions:"或从网址新增图片:",autoCompletePlaceholder:"选择或粘贴图片",alt:"替代文本:",title:"标题:"},imageEditor:{editImage:"编辑图片"},createLink:{url:"网址",urlPlaceholder:"选择或粘贴网址",title:"标题",saveTooltip:"设置网址",cancelTooltip:"取消更改"},linkPreview:{open:"在新窗口中打开 {{url}}",edit:"编辑链接网址",copyToClipboard:"复制到剪贴板",copied:"已复制!",remove:"移除链接"},table:{deleteTable:"删除表格",columnMenu:"列菜单",textAlignment:"文字对齐",alignLeft:"左对齐",alignCenter:"居中对齐",alignRight:"右对齐",insertColumnLeft:"在当前列左侧插入一列",insertColumnRight:"在当前列右侧插入一列",deleteColumn:"删除此列",rowMenu:"行菜单",insertRowAbove:"在当前行上方插入一行",insertRowBelow:"在当前行下方插入一行",deleteRow:"删除此行"},toolbar:{blockTypes:{paragraph:"段落",quote:"引用",heading:"标题 {{level}}"},blockTypeSelect:{selectBlockTypeTooltip:"选择块类型",placeholder:"块类型"},toggleGroup:"切换组",removeBold:"移除粗体",bold:"粗体",removeItalic:"移除斜体",italic:"斜体",underline:"移除下划线",removeUnderline:"下划线",removeInlineCode:"移除内联代码样式",inlineCode:"内联代码样式",link:"创建链接",richText:"富文本",diffMode:"差异模式",source:"源码模式",admonition:"插入注释区块",codeBlock:"插入代码块",editFrontmatter:"编辑前置元数据",insertFrontmatter:"插入前置元数据",image:"插入图片",insertSandpack:"插入 Sandpack",table:"插入表格",thematicBreak:"插入主题换行",bulletedList:"无序列表",numberedList:"有序列表",checkList:"任务列表",deleteSandpack:"删除 Sandpack",undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",superscript:"上标",subscript:"下标",strikethrough:"删除线",removeSubscript:"移除下标",removeSuperscript:"移除上标",removeStrikethrough:"移除删除线"},admonitions:{note:"注意",tip:"提示",danger:"危险",info:"信息",caution:"警告",changeType:"选择注释区块类型",placeholder:"注释区块类型"},codeBlock:{language:"代码块语言",selectLanguage:"选择代码块语言",inlineLanguage:"代码块语言"},codeblock:{delete:"删除代码块"},contentArea:{editableMarkdown:"可编辑的 Markdown"},image:{delete:"删除图片"}},Ke=(c,o,n)=>{const l=c.split(".").reduce((a,d)=>typeof a=="string"?a:a[d],Je);return typeof l!="string"?o:n?l.replace(/{{(.*?)}}/g,(a,d)=>n[d]):l},Ze=t.css`
|
|
406
406
|
--accentBase: var(--tomato-1);
|
|
407
407
|
--accentBgSubtle: var(--tomato-2);
|
|
408
408
|
--accentBg: var(--tomato-3);
|
|
@@ -656,6 +656,6 @@
|
|
|
656
656
|
--color-prettylights-syntax-meta-diff-range: #d2a8ff;
|
|
657
657
|
--color-prettylights-syntax-sublimelinter-gutter-mark: #3d444d;
|
|
658
658
|
}
|
|
659
|
-
`,ne=c=>{var o,a;return c==="dark"?!0:c==="light"?!1:(o=document.documentElement.getAttribute("style"))!=null&&o.includes("color-scheme: dark;")?!0:(a=document.documentElement.getAttribute("style"))!=null&&a.includes("color-scheme: light;")?!1:window.matchMedia("(prefers-color-scheme: dark)").matches},Re=c=>{const{value:o,onChange:a,translation:r,pluginConfig:l,className:n,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;o!==void 0&&i.current&&((x=i.current)==null||x.setMarkdown(o),I(o))},[o,i]),e.jsx(h.MDXEditor,{ref:i,className:t.cx(Qe,ne(d)?Ze:"",ne(d)?ye:xe,n),contentEditableClassName:ke,markdown:g,onChange:x=>{!o&&!a&&I(x),a&&a(x)},translation:r??Ke,plugins:[h.toolbarPlugin({toolbarContents:()=>e.jsxs(h.DiffSourceToggleWrapper,{options:["rich-text","source"],children:[e.jsx(h.UndoRedo,{}),e.jsx(h.Separator,{}),e.jsx(h.BoldItalicUnderlineToggles,{}),e.jsx(h.CodeToggle,{}),e.jsx(h.Separator,{}),e.jsx(h.StrikeThroughSupSubToggles,{}),e.jsx(h.Separator,{}),e.jsx(h.ListsToggle,{}),e.jsx(h.Separator,{}),e.jsx(h.CreateLink,{}),e.jsx(h.InsertImage,{}),e.jsx(h.Separator,{}),e.jsx(h.InsertTable,{}),e.jsx(h.InsertThematicBreak,{}),e.jsx(h.Separator,{}),e.jsx(h.InsertCodeBlock,{}),e.jsx(h.Separator,{}),e.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})},eo={'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%)"}},oo=c=>{const{children:o="",className:a,theme:r="auto"}=c;return e.jsx("div",{className:ne(r)?ye:xe,children:e.jsx(De,{className:t.cx(ke,a),remarkPlugins:[Le,Pe],rehypePlugins:[ze],components:{code(l){const{children:n,className:d,node:k,ref:i,...C}=l,S=/language-(\w+)/.exec(d||"");return S?e.jsx($e.Prism,{...C,PreTag:"div",children:String(n).replace(/\n$/,""),language:S[1],style:eo}):e.jsx("code",{...C,className:d,children:n})},img(l){return console.log("🚀 ~ image ~ props:",l),e.jsx(Ae,{...l,preview:{icons:{rotateLeft:e.jsx(G.RiAnticlockwise2Line,{}),rotateRight:e.jsx(G.RiClockwise2Line,{}),zoomIn:e.jsx(G.RiZoomInLine,{}),zoomOut:e.jsx(G.RiZoomOutLine,{}),close:e.jsx(G.RiCloseLine,{}),left:e.jsx(G.RiArrowLeftLine,{}),right:e.jsx(G.RiArrowRightLine,{}),flipX:e.jsx(G.RiArrowLeftRightLine,{}),flipY:e.jsx(G.RiArrowUpDownLine,{})},onVisibleChange:n=>{console.log("visible",n)},zIndex:9999,mask:""},className:t.css`
|
|
659
|
+
`,ne=c=>{var o,n;return c==="dark"?!0:c==="light"?!1:(o=document.documentElement.getAttribute("style"))!=null&&o.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{value:o,onChange:n,translation:r,pluginConfig:l,className:a,theme:d="auto",...m}=c,i=k.useRef(null),{image:S,diffSource:C={viewMode:"rich-text"},headings:D,link:L,codeBlock:j,codeMirror:q={codeBlockLanguages:{js:"JavaScript",css:"CSS",txt:"Plain Text",tsx:"TypeScript","":"Unspecified"}},directives:u={directiveDescriptors:[h.AdmonitionDirectiveDescriptor]}}=l??{},[g,I]=k.useState("");return k.useEffect(()=>{var x;o!==void 0&&i.current&&((x=i.current)==null||x.setMarkdown(o),I(o))},[o,i]),e.jsx(h.MDXEditor,{ref:i,className:t.cx(Qe,ne(d)?Ze:"",ne(d)?ye:xe,a),contentEditableClassName:ke,markdown:g,onChange:x=>{!o&&!n&&I(x),n&&n(x)},translation:r??Ke,plugins:[h.toolbarPlugin({toolbarContents:()=>e.jsxs(h.DiffSourceToggleWrapper,{options:["rich-text","source"],children:[e.jsx(h.UndoRedo,{}),e.jsx(h.Separator,{}),e.jsx(h.BoldItalicUnderlineToggles,{}),e.jsx(h.CodeToggle,{}),e.jsx(h.Separator,{}),e.jsx(h.StrikeThroughSupSubToggles,{}),e.jsx(h.Separator,{}),e.jsx(h.ListsToggle,{}),e.jsx(h.Separator,{}),e.jsx(h.CreateLink,{}),e.jsx(h.InsertImage,{}),e.jsx(h.Separator,{}),e.jsx(h.InsertTable,{}),e.jsx(h.InsertThematicBreak,{}),e.jsx(h.Separator,{}),e.jsx(h.InsertCodeBlock,{}),e.jsx(h.Separator,{}),e.jsx(h.InsertFrontmatter,{})]})}),h.diffSourcePlugin(C),h.listsPlugin(),h.quotePlugin(),h.headingsPlugin(D),h.linkPlugin(L),h.linkDialogPlugin(),h.imagePlugin(S),h.tablePlugin(),h.thematicBreakPlugin(),h.frontmatterPlugin(),h.codeBlockPlugin(j),h.codeMirrorPlugin(q),h.markdownShortcutPlugin(),h.directivesPlugin(u)],...m})},eo={'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%)"}},oo=c=>{const{children:o="",className:n,theme:r="auto",imageProps:l}=c;return e.jsx("div",{className:ne(r)?ye:xe,children:e.jsx(De,{className:t.cx(ke,n),remarkPlugins:[Le,Pe],rehypePlugins:[ze],components:{code(a){const{children:d,className:m,node:i,ref:S,...C}=a,D=/language-(\w+)/.exec(m||"");return D?e.jsx($e.Prism,{...C,PreTag:"div",children:String(d).replace(/\n$/,""),language:D[1],style:eo}):e.jsx("code",{...C,className:m,children:d})},img(a){return e.jsx(Ae,{...a,preview:{icons:{rotateLeft:e.jsx(G.RiAnticlockwise2Line,{}),rotateRight:e.jsx(G.RiClockwise2Line,{}),zoomIn:e.jsx(G.RiZoomInLine,{}),zoomOut:e.jsx(G.RiZoomOutLine,{}),close:e.jsx(G.RiCloseLine,{}),left:e.jsx(G.RiArrowLeftLine,{}),right:e.jsx(G.RiArrowRightLine,{}),flipX:e.jsx(G.RiArrowLeftRightLine,{}),flipY:e.jsx(G.RiArrowUpDownLine,{})},onVisibleChange:d=>{console.log("visible",d)},zIndex:9999,mask:""},className:t.css`
|
|
660
660
|
cursor: zoom-in;
|
|
661
|
-
|
|
661
|
+
`,...l})}},children:o})})},ve=Re;ve.Preview=oo;function we(...c){return Ee.twMerge(qe.clsx(c))}const to=c=>{const{mouseX:o,title:n,icon:r,href:l}=c,a=k.useRef(null),d=s.useTransform(o,I=>{var $;const x=(($=a.current)==null?void 0:$.getBoundingClientRect())??{x:0,width:0};return I-x.x-x.width/2}),m=s.useTransform(d,[-150,0,150],[40,80,40]),i=s.useTransform(d,[-150,0,150],[40,80,40]),S=s.useTransform(d,[-150,0,150],[20,40,20]),C=s.useTransform(d,[-150,0,150],[20,40,20]),D=s.useSpring(m,{mass:.1,stiffness:150,damping:12}),L=s.useSpring(i,{mass:.1,stiffness:150,damping:12}),j=s.useSpring(S,{mass:.1,stiffness:150,damping:12}),q=s.useSpring(C,{mass:.1,stiffness:150,damping:12}),[u,g]=k.useState(!1);return e.jsx("a",{href:l,children:e.jsxs(s.motion.div,{ref:a,style:{width:D,height:L},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:[e.jsx(s.AnimatePresence,{children:u&&e.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})}),e.jsx(s.motion.div,{style:{width:j,height:q},className:"flex items-center justify-center",children:r})]})})},Ce=c=>{const{items:o,className:n}=c,r=s.useMotionValue(1/0);return e.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:o.map(l=>e.jsx(to,{mouseX:r,...l},l.title))})},Se=c=>{const{items:o,className:n,collapseIcon:r,autoHidden:l=!1}=c,[a,d]=k.useState(!1),m=()=>{d(!a)};return e.jsxs("div",{className:we("relative block",l?"md:hidden":"",n),children:[e.jsx(s.AnimatePresence,{children:a&&e.jsx(s.motion.div,{layoutId:"nav",className:"absolute bottom-full mb-2 inset-x-0 flex flex-col gap-2",children:o.map((i,S)=>e.jsx(s.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10,transition:{delay:S*.05}},transition:{delay:(o.length-1-S)*.05},children:e.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:e.jsx("div",{className:"h-4 w-4",children:i.icon})},i.title)},i.title))})}),e.jsx("button",{onClick:m,className:"h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-800 flex items-center justify-center",children:r||e.jsx(G.RiMoreLine,{className:"h-5 w-5 text-neutral-500 dark:text-neutral-400"})})]})},ae=c=>{const{items:o,desktopClassName:n,mobileClassName:r,...l}=c;return e.jsxs(e.Fragment,{children:[e.jsx(Ce,{items:o,className:n,...l}),e.jsx(Se,{items:o,className:r,autoHidden:!0,...l})]})};ae.Desktop=Ce,ae.Mobile=Se,p.Desktop=We,p.Dock=ae,p.MdEditor=ve,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
|