zs_library 0.3.11 → 0.3.13
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/MdEditor/index.d.ts +6 -1
- package/dist/components/MdEditor/preview.d.ts +7 -0
- package/dist/components/MdEditor/style.d.ts +2 -0
- package/dist/index.es.js +1420 -863
- package/dist/index.umd.js +177 -122
- package/dist/style.css +1 -1
- package/package.json +9 -2
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(I,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react"),require("@emotion/css"),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")):typeof define=="function"&&define.amd?define(["exports","react","@emotion/css","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"],d):(I=typeof globalThis<"u"?globalThis:I||self,d(I.zs_library={},I.React,I.css,I.Slider,I.reactSortablejs,I.framerMotion,I.ahooks,I.uuid,I.RcTooltip,I.react,I.Dialog,I.ReactJson,I.MDXEditor,I.Markdown,I.remarkGfm,I.emoji,I.rehypeRaw,I.reactSyntaxHighlighter))})(this,function(I,d,n,mo,Ee,L,ze,Ye,fo,we,We,ho,w,bo,ko,vo,xo,wo){"use strict";var sr=Object.defineProperty;var cr=(I,d,n)=>d in I?sr(I,d,{enumerable:!0,configurable:!0,writable:!0,value:n}):I[d]=n;var Fe=(I,d,n)=>cr(I,typeof d!="symbol"?d+"":d,n);require("./style.css");var _e={exports:{}},ke={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Ve;function yo(){if(Ve)return ke;Ve=1;var C=d,o=Symbol.for("react.element"),c=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,p=C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function f(b,l,E){var k,F={},N=null,X=null;E!==void 0&&(N=""+E),l.key!==void 0&&(N=""+l.key),l.ref!==void 0&&(X=l.ref);for(k in l)i.call(l,k)&&!s.hasOwnProperty(k)&&(F[k]=l[k]);if(b&&b.defaultProps)for(k in l=b.defaultProps,l)F[k]===void 0&&(F[k]=l[k]);return{$$typeof:o,type:b,key:N,ref:X,props:F,_owner:p.current}}return ke.Fragment=c,ke.jsx=f,ke.jsxs=f,ke}var ve={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,24 +14,24 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+
|
|
17
|
+
*/var Ue;function Co(){return Ue||(Ue=1,process.env.NODE_ENV!=="production"&&function(){var C=d,o=Symbol.for("react.element"),c=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),b=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),X=Symbol.for("react.offscreen"),G=Symbol.iterator,h="@@iterator";function g(e){if(e===null||typeof e!="object")return null;var r=G&&e[G]||e[h];return typeof r=="function"?r:null}var P=C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function m(e){{for(var r=arguments.length,a=new Array(r>1?r-1:0),u=1;u<r;u++)a[u-1]=arguments[u];$("error",e,a)}}function $(e,r,a){{var u=P.ReactDebugCurrentFrame,_=u.getStackAddendum();_!==""&&(r+="%s",a=a.concat([_]));var B=a.map(function(R){return String(R)});B.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,B)}}var v=!1,O=!1,M=!1,x=!1,S=!1,J;J=Symbol.for("react.module.reference");function ue(e){return!!(typeof e=="string"||typeof e=="function"||e===i||e===s||S||e===p||e===E||e===k||x||e===X||v||O||M||typeof e=="object"&&e!==null&&(e.$$typeof===N||e.$$typeof===F||e.$$typeof===f||e.$$typeof===b||e.$$typeof===l||e.$$typeof===J||e.getModuleId!==void 0))}function q(e,r,a){var u=e.displayName;if(u)return u;var _=r.displayName||r.name||"";return _!==""?a+"("+_+")":a}function fe(e){return e.displayName||"Context"}function K(e){if(e==null)return null;if(typeof e.tag=="number"&&m("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case i:return"Fragment";case c:return"Portal";case s:return"Profiler";case p:return"StrictMode";case E:return"Suspense";case k:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case b:var r=e;return fe(r)+".Consumer";case f:var a=e;return fe(a._context)+".Provider";case l:return q(e,e.render,"ForwardRef");case F:var u=e.displayName||null;return u!==null?u:K(e.type)||"Memo";case N:{var _=e,B=_._payload,R=_._init;try{return K(R(B))}catch{return null}}}return null}var te=Object.assign,se=0,Y,ae,ce,ye,Ce,Se,je;function T(){}T.__reactDisabledLog=!0;function Q(){{if(se===0){Y=console.log,ae=console.info,ce=console.warn,ye=console.error,Ce=console.group,Se=console.groupCollapsed,je=console.groupEnd;var e={configurable:!0,enumerable:!0,value:T,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}se++}}function Z(){{if(se--,se===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:te({},e,{value:Y}),info:te({},e,{value:ae}),warn:te({},e,{value:ce}),error:te({},e,{value:ye}),group:te({},e,{value:Ce}),groupCollapsed:te({},e,{value:Se}),groupEnd:te({},e,{value:je})})}se<0&&m("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var A=P.ReactCurrentDispatcher,W;function z(e,r,a){{if(W===void 0)try{throw Error()}catch(_){var u=_.stack.trim().match(/\n( *(at )?)/);W=u&&u[1]||""}return`
|
|
18
|
+
`+W+e}}var j=!1,D;{var H=typeof WeakMap=="function"?WeakMap:Map;D=new H}function ne(e,r){if(!e||j)return"";{var a=D.get(e);if(a!==void 0)return a}var u;j=!0;var _=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var B;B=A.current,A.current=null,Q();try{if(r){var R=function(){throw Error()};if(Object.defineProperty(R.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(R,[])}catch(re){u=re}Reflect.construct(e,[],R)}else{try{R.call()}catch(re){u=re}e.call(R.prototype)}}else{try{throw Error()}catch(re){u=re}e()}}catch(re){if(re&&u&&typeof re.stack=="string"){for(var y=re.stack.split(`
|
|
19
19
|
`),ee=u.stack.split(`
|
|
20
|
-
`),
|
|
21
|
-
`+
|
|
20
|
+
`),V=y.length-1,U=ee.length-1;V>=1&&U>=0&&y[V]!==ee[U];)U--;for(;V>=1&&U>=0;V--,U--)if(y[V]!==ee[U]){if(V!==1||U!==1)do if(V--,U--,U<0||y[V]!==ee[U]){var ie=`
|
|
21
|
+
`+y[V].replace(" at new "," at ");return e.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",e.displayName)),typeof e=="function"&&D.set(e,ie),ie}while(V>=1&&U>=0);break}}}finally{j=!1,A.current=B,Z(),Error.prepareStackTrace=_}var be=e?e.displayName||e.name:"",pe=be?z(be):"";return typeof e=="function"&&D.set(e,pe),pe}function Re(e,r,a){return ne(e,!1)}function Te(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function oe(e,r,a){if(e==null)return"";if(typeof e=="function")return ne(e,Te(e));if(typeof e=="string")return z(e);switch(e){case E:return z("Suspense");case k:return z("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return Re(e.render);case F:return oe(e.type,r,a);case N:{var u=e,_=u._payload,B=u._init;try{return oe(B(_),r,a)}catch{}}}return""}var ge=Object.prototype.hasOwnProperty,eo={},oo=P.ReactDebugCurrentFrame;function Ie(e){if(e){var r=e._owner,a=oe(e.type,e._source,r?r.type:null);oo.setExtraStackFrame(a)}else oo.setExtraStackFrame(null)}function zo(e,r,a,u,_){{var B=Function.call.bind(ge);for(var R in e)if(B(e,R)){var y=void 0;try{if(typeof e[R]!="function"){var ee=Error((u||"React class")+": "+a+" type `"+R+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[R]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ee.name="Invariant Violation",ee}y=e[R](r,R,u,a,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(V){y=V}y&&!(y instanceof Error)&&(Ie(_),m("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",u||"React class",a,R,typeof y),Ie(null)),y instanceof Error&&!(y.message in eo)&&(eo[y.message]=!0,Ie(_),m("Failed %s type: %s",a,y.message),Ie(null))}}}var Yo=Array.isArray;function De(e){return Yo(e)}function Wo(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,a=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return a}}function Vo(e){try{return ro(e),!1}catch{return!0}}function ro(e){return""+e}function to(e){if(Vo(e))return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Wo(e)),ro(e)}var xe=P.ReactCurrentOwner,Uo={key:!0,ref:!0,__self:!0,__source:!0},no,ao,Ne;Ne={};function Xo(e){if(ge.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Go(e){if(ge.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Ho(e,r){if(typeof e.ref=="string"&&xe.current&&r&&xe.current.stateNode!==r){var a=K(xe.current.type);Ne[a]||(m('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',K(xe.current.type),e.ref),Ne[a]=!0)}}function $o(e,r){{var a=function(){no||(no=!0,m("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}}function Jo(e,r){{var a=function(){ao||(ao=!0,m("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};a.isReactWarning=!0,Object.defineProperty(e,"ref",{get:a,configurable:!0})}}var Ko=function(e,r,a,u,_,B,R){var y={$$typeof:o,type:e,key:r,ref:a,props:R,_owner:B};return y._store={},Object.defineProperty(y._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(y,"_self",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.defineProperty(y,"_source",{configurable:!1,enumerable:!1,writable:!1,value:_}),Object.freeze&&(Object.freeze(y.props),Object.freeze(y)),y};function qo(e,r,a,u,_){{var B,R={},y=null,ee=null;a!==void 0&&(to(a),y=""+a),Go(r)&&(to(r.key),y=""+r.key),Xo(r)&&(ee=r.ref,Ho(r,_));for(B in r)ge.call(r,B)&&!Uo.hasOwnProperty(B)&&(R[B]=r[B]);if(e&&e.defaultProps){var V=e.defaultProps;for(B in V)R[B]===void 0&&(R[B]=V[B])}if(y||ee){var U=typeof e=="function"?e.displayName||e.name||"Unknown":e;y&&$o(R,U),ee&&Jo(R,U)}return Ko(e,y,ee,_,u,xe.current,R)}}var Oe=P.ReactCurrentOwner,io=P.ReactDebugCurrentFrame;function he(e){if(e){var r=e._owner,a=oe(e.type,e._source,r?r.type:null);io.setExtraStackFrame(a)}else io.setExtraStackFrame(null)}var Ae;Ae=!1;function Be(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function lo(){{if(Oe.current){var e=K(Oe.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function Zo(e){return""}var so={};function Qo(e){{var r=lo();if(!r){var a=typeof e=="string"?e:e.displayName||e.name;a&&(r=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+
|
|
25
|
+
Check the top-level render call using <`+a+">.")}return r}}function co(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var a=Qo(r);if(so[a])return;so[a]=!0;var u="";e&&e._owner&&e._owner!==Oe.current&&(u=" It was passed a child from "+K(e._owner.type)+"."),he(e),m('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',a,u),he(null)}}function uo(e,r){{if(typeof e!="object")return;if(De(e))for(var a=0;a<e.length;a++){var u=e[a];Be(u)&&co(u,r)}else if(Be(e))e._store&&(e._store.validated=!0);else if(e){var _=g(e);if(typeof _=="function"&&_!==e.entries)for(var B=_.call(e),R;!(R=B.next()).done;)Be(R.value)&&co(R.value,r)}}}function er(e){{var r=e.type;if(r==null||typeof r=="string")return;var a;if(typeof r=="function")a=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===l||r.$$typeof===F))a=r.propTypes;else return;if(a){var u=K(r);zo(a,e.props,"prop",u,e)}else if(r.PropTypes!==void 0&&!Ae){Ae=!0;var _=K(r);m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",_||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function or(e){{for(var r=Object.keys(e.props),a=0;a<r.length;a++){var u=r[a];if(u!=="children"&&u!=="key"){he(e),m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",u),he(null);break}}e.ref!==null&&(he(e),m("Invalid attribute `ref` supplied to `React.Fragment`."),he(null))}}var go={};function po(e,r,a,u,_,B){{var R=ue(e);if(!R){var y="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(y+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ee=Zo();ee?y+=ee:y+=lo();var V;e===null?V="null":De(e)?V="array":e!==void 0&&e.$$typeof===o?(V="<"+(K(e.type)||"Unknown")+" />",y=" Did you accidentally export a JSX literal instead of a component?"):V=typeof e,m("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",V,y)}var U=qo(e,r,a,_,B);if(U==null)return U;if(R){var ie=r.children;if(ie!==void 0)if(u)if(De(ie)){for(var be=0;be<ie.length;be++)uo(ie[be],e);Object.freeze&&Object.freeze(ie)}else m("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else uo(ie,e)}if(ge.call(r,"key")){var pe=K(e),re=Object.keys(r).filter(function(lr){return lr!=="key"}),Le=re.length>0?"{key: someKey, "+re.join(": ..., ")+": ...}":"{key: someKey}";if(!go[pe+Le]){var ir=re.length>0?"{"+re.join(": ..., ")+": ...}":"{}";m(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,Le,
|
|
30
|
+
<%s key={someKey} {...props} />`,Le,pe,ir,pe),go[pe+Le]=!0}}return e===i?or(U):er(U),U}}function rr(e,r,a){return po(e,r,a,!0)}function tr(e,r,a){return po(e,r,a,!1)}var nr=tr,ar=rr;ve.Fragment=i,ve.jsx=nr,ve.jsxs=ar}()),ve}process.env.NODE_ENV==="production"?_e.exports=yo():_e.exports=Co();var t=_e.exports;const Xe={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)"}},Ge={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=d.createContext({}),So=C=>{const{children:o,theme:c,...i}=C,p=d.useMemo(()=>c==="light"?Xe:c==="dark"?Ge:c,[c]);return t.jsx(He.Provider,{value:{theme:p,...i},children:o})},de=()=>d.useContext(He),$e={maxRow:2,maxCol:2},jo={...$e},Je={app:$e,group:jo};class le{}Fe(le,"uniqueArray",o=>o.reduce((c,i)=>c.find(s=>s.id===i.id)?c:c.concat([i]),[])),Fe(le,"getTheme",o=>{const c=Xe.token,i=Ge.token,p={...c,...o==null?void 0:o.token},s={...i,...o==null?void 0:o.token};return{light:p,dark:s}});const Ke=d.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:()=>{}}),Ro=C=>{const{children:o,list:c=[],onChange:i,storageKey:p="ZS_LIBRARY_DESKTOP_SORTABLE_CONFIG",enableCaching:s=!0}=C,[f,b]=d.useState(),[l,E]=d.useState(),[k,F]=d.useState(null),N=d.useRef(k),[X,G]=d.useState(null),[h,g]=d.useState([]),[P,m]=d.useState(null),[$,v]=d.useState(null),[O,M]=d.useState(!1),[x,S]=d.useState(null),[J,ue]=d.useState(null),[q,fe]=d.useState(!1),[K,te]=ze.useLocalStorageState(p,{defaultValue:[],listenStorageChange:!0}),se=()=>{G(null),clearTimeout(f),b(void 0),N.current=null},Y=(T,Q)=>{G({...T,pageX:T.pageX,pageY:T.pageY,data:Q}),clearTimeout(f)},ae=(T,Q=!0)=>{const{config:Z={}}=T;return Z.allowContextMenu===!1?{}:{onMouseDown:A=>{b(setTimeout(()=>{Q&&N.current===null&&Y(A,T)},800)),M(!1),E(setTimeout(()=>{M(!0)},800))},onMouseUp:()=>{clearTimeout(l),E(void 0),clearTimeout(f),b(void 0)},onContextMenu:A=>{Q&&(A.preventDefault(),Y(A,T))}}},ce=(T,Q)=>{const Z=[...Q||[]];if(Z.length>0)g(A=>{const W=[...A],z=j=>{var Re,Te;const D=Z.shift(),H=j.find(oe=>oe.id===D),ne=j.findIndex(oe=>oe.id===D);if(Z.length&&H){if(((Re=H.children)==null?void 0:Re.filter(oe=>!T.some(ge=>ge.id===oe.id)).length)===1&&T.length===1){const oe={...T[0]};return j.splice(ne,1,oe),i==null||i(j),j}return H.children=z(H.children||[]),j.splice(ne,1,H),i==null||i(j),j}if(H){if(!((Te=H.children)!=null&&Te.length)&&T.length){const oe={...H};return H.data={name:"文件夹"},H.type="group",H.children=[oe,...T],H.id=Ye.v4(),j.splice(ne,1,H),i==null||i(j),j}return H.children=le.uniqueArray(T),j.splice(ne,1,H),i==null||i(j),j}return le.uniqueArray(T)};return le.uniqueArray(z(W))});else{const A=le.uniqueArray(T);i==null||i(A),g(A)}},ye=(T,Q)=>{g(Z=>{const A=[...Z],W=z=>{var j;for(let D=0;D<z.length;D++)if(z[D].id===T){z[D].config=Q;break}else((j=z[D].children)==null?void 0:j.length)!==void 0&&W(z[D].children)};return W(A),i==null||i(A),A})},Ce=(T,Q)=>{g(Z=>{const A=[...Z],W=z=>{var j;for(let D=0;D<z.length;D++)if(z[D].id===T){z[D].data=Q;break}else((j=z[D].children)==null?void 0:j.length)!==void 0&&W(z[D].children)};return W(A),i==null||i(A),A})},Se=T=>{g(Q=>{const Z=[...Q],A=W=>{var z;for(let j=0;j<W.length;j++)if(W[j].id===T){W.splice(j,1);break}else((z=W[j].children)==null?void 0:z.length)!==void 0&&A(W[j].children)};return A(Z),i==null||i(Z),Z})},je=(T,Q)=>{const Z=[...h],A=(W,z)=>{const j=z.shift(),D=W.find(ne=>ne.id===j),H=W.findIndex(ne=>ne.id===j);if(D){if(z.length)D.children=A(D.children||[],z);else{const ne=(T==null?void 0:T.type)??"app";D.children=[...D.children??[],{...T,id:Ye.v4(),config:(T==null?void 0:T.config)??Je[ne]}]}return W.splice(H,1,D),W}else return W};g(A(Z,Q))};return d.useEffect(()=>{(c==null?void 0:c.length)>0&&h.length===0&&ce(c)},[c]),d.useEffect(()=>{N.current=k,k!==null&&se()},[k]),d.useEffect(()=>{s&&K!=null&&K.length&&!q&&(ce(K),fe(!0))},[K,q,s]),ze.useDebounceEffect(()=>{s&&te(h)},[h,s],{wait:1e3}),t.jsx(Ke.Provider,{value:{list:h,setList:ce,contextMenu:X,setContextMenu:G,listStatus:k,setListStatus:F,contextMenuFuns:ae,hideContextMenu:se,showInfoItemData:P,setShowInfoItemData:m,openGroupItemData:$,setOpenGroupItemData:v,longPressTriggered:O,updateItemConfig:ye,updateItem:Ce,removeItem:Se,addItem:je,moveItemId:x,setMoveItemId:S,moveTargetId:J,setMoveTargetId:ue},children:o})},me=()=>d.useContext(Ke),To={menuShow:{opacity:1,y:0,transition:{type:"spring",stiffness:300,damping:24}},menuHide:{opacity:0,y:20,transition:{duration:.2}}},Pe=C=>{const{icon:o,title:c,onClick:i}=C,{theme:p}=de(),{light:s,dark:f}=le.getTheme(p);return t.jsx(L.motion.div,{className:n.css`
|
|
31
31
|
&:hover {
|
|
32
|
-
background-color: ${
|
|
32
|
+
background-color: ${s.contextMenuActiveColor};
|
|
33
33
|
@media (prefers-color-scheme: dark) {
|
|
34
|
-
background-color: ${
|
|
34
|
+
background-color: ${f.contextMenuActiveColor};
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
@media (prefers-color-scheme: dark) {
|
|
@@ -43,35 +43,35 @@ React keys must be passed directly to JSX without using spread:
|
|
|
43
43
|
transition: all 0.3s;
|
|
44
44
|
user-select: none;
|
|
45
45
|
border-radius: 0.5rem;
|
|
46
|
-
`,onClick:
|
|
46
|
+
`,onClick:b=>{b.stopPropagation(),i==null||i()},variants:To,children:t.jsxs(L.motion.div,{className:n.cx("py-1.5 px-3 rounded-lg",n.css`
|
|
47
47
|
padding-top: 0.375rem;
|
|
48
48
|
padding-bottom: 0.375rem;
|
|
49
49
|
padding-left: 0.75rem;
|
|
50
50
|
padding-right: 0.75rem;
|
|
51
51
|
border-radius: 0.5rem;
|
|
52
|
-
`),whileTap:{scale:.9},children:[
|
|
52
|
+
`),whileTap:{scale:.9},children:[t.jsx(L.motion.div,{className:n.cx(n.css`
|
|
53
53
|
margin-bottom: 0.375rem;
|
|
54
54
|
display: flex;
|
|
55
55
|
justify-content: center;
|
|
56
|
-
`),children:
|
|
56
|
+
`),children:o}),t.jsx(L.motion.div,{children:c})]})})},Io=C=>{const{showInfoButton:o=!0,showRemoveButton:c=!0,showShareButton:i=!0,showSizeButton:p=!0,onInfoClick:s,onShareClick:f,onRemoveClick:b}=C,{contextMenu:l,setContextMenu:E,hideContextMenu:k,setShowInfoItemData:F,removeItem:N,updateItemConfig:X}=me(),{theme:G}=de(),{light:h,dark:g}=le.getTheme(G),{data:P}=l??{},{config:m={}}=P??{},$=()=>{var M;const v=Je[(M=l==null?void 0:l.data)==null?void 0:M.type],O=[];for(let x=1;x<=((v==null?void 0:v.maxRow)??2);x++)for(let S=1;S<=((v==null?void 0:v.maxCol)??2);S++)O.push(`${x}x${S}`);return O};return t.jsx(L.AnimatePresence,{children:l&&t.jsxs(L.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:v=>{v.stopPropagation(),v.preventDefault()},children:[t.jsx(L.motion.div,{className:n.cx(n.css`
|
|
57
57
|
border-radius: 0.5rem;
|
|
58
58
|
overflow: hidden;
|
|
59
|
-
background-color: ${
|
|
60
|
-
box-shadow: 0 0 0.5rem ${
|
|
59
|
+
background-color: ${h.contextMenuBackgroundColor};
|
|
60
|
+
box-shadow: 0 0 0.5rem ${h.contextMenuShadowColor};
|
|
61
61
|
@media (prefers-color-scheme: dark) {
|
|
62
|
-
background-color: ${
|
|
63
|
-
box-shadow: 0 0 0.5rem ${
|
|
62
|
+
background-color: ${g.contextMenuBackgroundColor};
|
|
63
|
+
box-shadow: 0 0 0.5rem ${g.contextMenuShadowColor};
|
|
64
64
|
}
|
|
65
|
-
`),children:p&&m.allowResize!==!1&&
|
|
65
|
+
`),children:p&&m.allowResize!==!1&&t.jsx(L.motion.ul,{className:n.css`
|
|
66
66
|
background-color: white;
|
|
67
67
|
padding: 0.25rem;
|
|
68
68
|
margin: 0;
|
|
69
|
-
`,children:[{label:"修改大小",key:"size",icon:
|
|
69
|
+
`,children:[{label:"修改大小",key:"size",icon:t.jsx(we.RiPencilRuler2Line,{size:14}),items:$().map(v=>({label:v,key:v,onClick:()=>{const[O,M]=v.split("x").map(Number);X(l.data.id,{row:O,col:M})}}))}].map(v=>t.jsxs(L.motion.li,{className:n.css`
|
|
70
70
|
padding-top: 0.5rem;
|
|
71
71
|
padding-bottom: 0.5rem;
|
|
72
72
|
padding-left: 0.75rem;
|
|
73
73
|
padding-right: 0.75rem;
|
|
74
|
-
`,children:[
|
|
74
|
+
`,children:[t.jsxs(L.motion.p,{className:n.css`
|
|
75
75
|
display: flex;
|
|
76
76
|
align-items: center;
|
|
77
77
|
font-size: 0.875rem;
|
|
@@ -79,11 +79,11 @@ React keys must be passed directly to JSX without using spread:
|
|
|
79
79
|
gap: 0.5rem;
|
|
80
80
|
padding-bottom: 0.5rem;
|
|
81
81
|
margin: 0;
|
|
82
|
-
`,children:[
|
|
82
|
+
`,children:[v.icon," ",v.label]}),t.jsx(L.motion.div,{className:n.css`
|
|
83
83
|
display: grid;
|
|
84
84
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
85
85
|
gap: 0.25rem;
|
|
86
|
-
`,children:
|
|
86
|
+
`,children:v.items.map(O=>t.jsx(L.motion.div,{className:n.cx("py-1 px-2 hover:bg-gray-100 rounded transition-all cursor-pointer text-center text-sm",n.css`
|
|
87
87
|
padding-top: 0.25rem;
|
|
88
88
|
padding-bottom: 0.25rem;
|
|
89
89
|
padding-left: 0.5rem;
|
|
@@ -94,27 +94,27 @@ React keys must be passed directly to JSX without using spread:
|
|
|
94
94
|
line-height: 1.25rem;
|
|
95
95
|
cursor: pointer;
|
|
96
96
|
text-align: center;
|
|
97
|
-
color: ${
|
|
97
|
+
color: ${h.contextMenuTextColor};
|
|
98
98
|
@media (prefers-color-scheme: dark) {
|
|
99
|
-
color: ${
|
|
99
|
+
color: ${g.contextMenuTextColor};
|
|
100
100
|
}
|
|
101
101
|
&:hover {
|
|
102
|
-
background-color: ${
|
|
102
|
+
background-color: ${h.contextMenuActiveColor};
|
|
103
103
|
@media (prefers-color-scheme: dark) {
|
|
104
|
-
background-color: ${
|
|
104
|
+
background-color: ${g.contextMenuActiveColor};
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
`,`${m.row}x${m.col}`===
|
|
108
|
-
background-color: ${
|
|
107
|
+
`,`${m.row}x${m.col}`===O.key&&n.css`
|
|
108
|
+
background-color: ${h.contextMenuActiveColor};
|
|
109
109
|
@media (prefers-color-scheme: dark) {
|
|
110
|
-
background-color: ${
|
|
110
|
+
background-color: ${g.contextMenuActiveColor};
|
|
111
111
|
}
|
|
112
|
-
`),onClick:
|
|
113
|
-
background-color: ${
|
|
114
|
-
box-shadow: 0 0 0.5rem ${
|
|
112
|
+
`),onClick:O.onClick,children:O.label},O.key))})]},v.key))})}),t.jsxs(L.motion.div,{className:n.cx(n.css`
|
|
113
|
+
background-color: ${h.contextMenuBackgroundColor};
|
|
114
|
+
box-shadow: 0 0 0.5rem ${h.contextMenuShadowColor};
|
|
115
115
|
@media (prefers-color-scheme: dark) {
|
|
116
|
-
background-color: ${
|
|
117
|
-
box-shadow: 0 0 0.5rem ${
|
|
116
|
+
background-color: ${g.contextMenuBackgroundColor};
|
|
117
|
+
box-shadow: 0 0 0.5rem ${g.contextMenuShadowColor};
|
|
118
118
|
}
|
|
119
119
|
display: flex;
|
|
120
120
|
justify-content: space-around;
|
|
@@ -123,56 +123,56 @@ React keys must be passed directly to JSX without using spread:
|
|
|
123
123
|
border-radius: 0.5rem;
|
|
124
124
|
overflow: hidden;
|
|
125
125
|
padding: 0.25rem;
|
|
126
|
-
`),children:[i&&
|
|
126
|
+
`),children:[i&&t.jsx(Pe,{icon:t.jsx(we.RiShareLine,{size:20}),title:"分享",onClick:()=>{if(f){f(l.data);return}}}),o&&t.jsx(Pe,{icon:t.jsx(we.RiInformationLine,{size:20}),title:"信息",onClick:()=>{if(s){s(l.data);return}F({...l.data,pageX:l.pageX,pageY:l.pageY}),k()}}),c&&t.jsx(Pe,{icon:t.jsx(we.RiCloseCircleLine,{size:20}),title:"移除",onClick:()=>{if(b){b(l.data,N);return}E(null),N(l.data.id)}})]})]})})},Eo=C=>{const{data:o,noLetters:c=!1}=C,{contextMenuFuns:i}=me(),{itemIconBuilder:p,theme:s,contextMenu:f}=de(),{light:b,dark:l}=le.getTheme(s),{data:E={}}=o,{name:k}=E;return t.jsxs(t.Fragment,{children:[t.jsx(L.motion.div,{className:n.css`
|
|
127
127
|
width: 4rem;
|
|
128
128
|
height: 4rem;
|
|
129
|
-
background-color: ${
|
|
129
|
+
background-color: ${b.itemIconBackgroundColor};
|
|
130
130
|
border-radius: 0.75rem;
|
|
131
|
-
box-shadow: 0 0 0.5rem ${
|
|
131
|
+
box-shadow: 0 0 0.5rem ${b.itemIconShadowColor};
|
|
132
132
|
cursor: pointer;
|
|
133
133
|
position: relative;
|
|
134
134
|
overflow: hidden;
|
|
135
135
|
@media (prefers-color-scheme: dark) {
|
|
136
|
-
background-color: ${
|
|
137
|
-
box-shadow: 0 0 0.5rem ${
|
|
136
|
+
background-color: ${l.itemIconBackgroundColor};
|
|
137
|
+
box-shadow: 0 0 0.5rem ${l.itemIconShadowColor};
|
|
138
138
|
}
|
|
139
|
-
`,whileTap:{scale:.9},children:
|
|
139
|
+
`,whileTap:{scale:.9},children:t.jsx("div",{className:n.css`
|
|
140
140
|
position: absolute;
|
|
141
141
|
left: 0;
|
|
142
142
|
top: 0;
|
|
143
143
|
width: 100%;
|
|
144
144
|
height: 100%;
|
|
145
|
-
color: ${
|
|
145
|
+
color: ${b.itemNameColor};
|
|
146
146
|
@media (prefers-color-scheme: dark) {
|
|
147
|
-
color: ${
|
|
147
|
+
color: ${l.itemNameColor};
|
|
148
148
|
}
|
|
149
|
-
`,...i(
|
|
149
|
+
`,...i(o,f!==!1),children:p==null?void 0:p(o)})}),t.jsx(L.motion.p,{className:n.cx(n.css`
|
|
150
150
|
text-align: center;
|
|
151
151
|
margin-top: 0.25rem;
|
|
152
152
|
margin-bottom: 0;
|
|
153
|
-
color: ${
|
|
153
|
+
color: ${b.itemNameColor};
|
|
154
154
|
@media (prefers-color-scheme: dark) {
|
|
155
|
-
color: ${
|
|
155
|
+
color: ${l.itemNameColor};
|
|
156
156
|
}
|
|
157
|
-
`,c&&
|
|
157
|
+
`,c&&n.css`
|
|
158
158
|
color: transparent;
|
|
159
|
-
`),children:
|
|
159
|
+
`),children:k})]})},Me=C=>{const{data:o,className:c,itemIndex:i,onClick:p,disabledDrag:s=!1,children:f,parentIds:b,childrenLength:l}=C,{contextMenu:E,setContextMenu:k}=me(),{contextMenu:F}=de();return t.jsx(fo,{placement:"bottom",overlayClassName:n.css`
|
|
160
160
|
background-color: transparent;
|
|
161
161
|
.rc-tooltip-inner {
|
|
162
162
|
background-color: transparent;
|
|
163
163
|
padding: 0;
|
|
164
164
|
border: none;
|
|
165
165
|
}
|
|
166
|
-
`,overlay:
|
|
166
|
+
`,overlay:t.jsx(Io,{...F}),visible:(E==null?void 0:E.data.id)===o.id,onVisibleChange:N=>{N||k(null)},destroyTooltipOnHide:!0,children:t.jsx(L.motion.div,{"data-id":o.id,"data-index":i,"data-parent-ids":b==null?void 0:b.join(","),"data-children-length":l,onClick:()=>p==null?void 0:p(o),className:n.cx(s&&"drag-disabled",c),children:f??t.jsx(Eo,{...C})})})},_o=C=>{const{data:o,className:c,parentIds:i,itemIndex:p,onClick:s,noLetters:f=!1}=C,{contextMenuFuns:b,setList:l,setOpenGroupItemData:E,longPressTriggered:k,moveItemId:F,moveTargetId:N,setMoveTargetId:X,listStatus:G}=me(),{itemIconBuilder:h,theme:g,contextMenu:P}=de(),{light:m,dark:$}=le.getTheme(g),{children:v,data:O,config:M}=o,{row:x=1,col:S=1}=M??{},J={visible:{opacity:1,scale:1},hidden:{opacity:0,scale:.95}},ue=((v==null?void 0:v.length)??0)===0,q=ue?[o]:[...v??[]].slice(0,9),fe=d.useMemo(()=>F===o.id.toString(),[o.id,F]),K=d.useMemo(()=>N===o.id,[o.id,N]),te=n.css`
|
|
167
167
|
overflow: hidden;
|
|
168
168
|
cursor: pointer;
|
|
169
169
|
background-color: ${m.itemIconBackgroundColor};
|
|
170
170
|
box-shadow: 0 0 0.5rem ${m.itemIconShadowColor};
|
|
171
171
|
@media (prefers-color-scheme: dark) {
|
|
172
|
-
background-color: ${
|
|
173
|
-
box-shadow: 0 0 0.5rem ${
|
|
172
|
+
background-color: ${$.itemIconBackgroundColor};
|
|
173
|
+
box-shadow: 0 0 0.5rem ${$.itemIconShadowColor};
|
|
174
174
|
}
|
|
175
|
-
`,
|
|
175
|
+
`,se=()=>{if(ue)return t.jsx(L.motion.div,{className:n.cx("sortable-group-item",n.css`
|
|
176
176
|
overflow: hidden;
|
|
177
177
|
cursor: pointer;
|
|
178
178
|
width: 100%;
|
|
@@ -183,9 +183,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
183
183
|
top: 0;
|
|
184
184
|
border-radius: 0.75rem;
|
|
185
185
|
@media (prefers-color-scheme: dark) {
|
|
186
|
-
background-color: ${
|
|
186
|
+
background-color: ${$.itemIconBackgroundColor};
|
|
187
187
|
}
|
|
188
|
-
`),onClick:
|
|
188
|
+
`),onClick:Y=>{Y.stopPropagation(),s==null||s(o)},children:h==null?void 0:h(o)});if(x===1&&S===1||x===2&&S===2)return t.jsx(L.motion.div,{className:n.css`
|
|
189
189
|
display: grid;
|
|
190
190
|
width: 100%;
|
|
191
191
|
height: 100%;
|
|
@@ -194,11 +194,11 @@ React keys must be passed directly to JSX without using spread:
|
|
|
194
194
|
padding: ${S===1?"0.125rem":"0.25rem"};
|
|
195
195
|
gap: ${S===1?"0.125rem":"0.5rem"};
|
|
196
196
|
place-items: center;
|
|
197
|
-
`,children:
|
|
197
|
+
`,children:q==null?void 0:q.slice(0,9).map(Y=>t.jsx(L.motion.div,{className:n.cx(te,n.css`
|
|
198
198
|
border-radius: ${S===1?"0.25rem":"0.5rem"};
|
|
199
199
|
width: 100%;
|
|
200
200
|
height: 100%;
|
|
201
|
-
`),onClick:ae=>{ae.stopPropagation(),
|
|
201
|
+
`),onClick:ae=>{ae.stopPropagation(),s==null||s(Y)},children:h==null?void 0:h(Y)},Y.id))});if(x===1&&S===2)return t.jsx(L.motion.div,{className:n.css`
|
|
202
202
|
display: grid;
|
|
203
203
|
grid-template-columns: repeat(10, minmax(0, 1fr));
|
|
204
204
|
grid-template-rows: repeat(4, minmax(0, 1fr));
|
|
@@ -207,19 +207,19 @@ React keys must be passed directly to JSX without using spread:
|
|
|
207
207
|
width: 144px;
|
|
208
208
|
height: 52px;
|
|
209
209
|
place-items: center;
|
|
210
|
-
`,children:
|
|
210
|
+
`,children:q==null?void 0:q.slice(0,4).map((Y,ae)=>t.jsx(L.motion.div,{className:n.cx(te,ae<2?n.css`
|
|
211
211
|
width: 52px;
|
|
212
212
|
height: 52px;
|
|
213
213
|
border-radius: 0.5rem;
|
|
214
214
|
grid-column: span 4 / span 4;
|
|
215
215
|
grid-row: span 4 / span 4;
|
|
216
|
-
`:
|
|
216
|
+
`:n.css`
|
|
217
217
|
width: 1.5rem;
|
|
218
218
|
height: 1.5rem;
|
|
219
219
|
border-radius: 0.375rem;
|
|
220
220
|
grid-column: span 2 / span 2;
|
|
221
221
|
grid-row: span 2 / span 2;
|
|
222
|
-
`),onClick:ce=>{ae>2||(ce.stopPropagation(),
|
|
222
|
+
`),onClick:ce=>{ae>2||(ce.stopPropagation(),s==null||s(Y))},children:h==null?void 0:h(Y)},Y.id))});if(x===2&&S===1)return t.jsx(L.motion.div,{className:n.css`
|
|
223
223
|
display: grid;
|
|
224
224
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
225
225
|
grid-template-rows: repeat(10, minmax(0, 1fr));
|
|
@@ -228,36 +228,36 @@ React keys must be passed directly to JSX without using spread:
|
|
|
228
228
|
width: 52px;
|
|
229
229
|
height: 144px;
|
|
230
230
|
place-items: center;
|
|
231
|
-
`,children:
|
|
231
|
+
`,children:q==null?void 0:q.slice(0,4).map((Y,ae)=>t.jsx(L.motion.div,{className:n.cx(te,ae<2?n.css`
|
|
232
232
|
width: 52px;
|
|
233
233
|
height: 52px;
|
|
234
234
|
border-radius: 0.5rem;
|
|
235
235
|
grid-column: span 4 / span 4;
|
|
236
236
|
grid-row: span 4 / span 4;
|
|
237
|
-
`:
|
|
237
|
+
`:n.css`
|
|
238
238
|
width: 1.5rem;
|
|
239
239
|
height: 1.5rem;
|
|
240
240
|
grid-column: span 2 / span 2;
|
|
241
241
|
grid-row: span 2 / span 2;
|
|
242
|
-
`),onClick:ce=>{ae>2||(ce.stopPropagation(),
|
|
243
|
-
grid-row: span ${
|
|
242
|
+
`),onClick:ce=>{ae>2||(ce.stopPropagation(),s==null||s(Y))},children:h==null?void 0:h(Y)},Y.id))})};return t.jsxs(Me,{data:o,itemIndex:p,parentIds:i,childrenLength:v==null?void 0:v.length,className:n.cx(n.css`
|
|
243
|
+
grid-row: span ${x};
|
|
244
244
|
grid-column: span ${S};
|
|
245
|
-
`,c),children:[
|
|
245
|
+
`,c),children:[t.jsx(L.motion.div,{whileTap:{scale:.9},className:n.cx(K?"!scale-110":"",n.css`
|
|
246
246
|
cursor: pointer;
|
|
247
247
|
position: relative;
|
|
248
248
|
border-radius: 0.75rem;
|
|
249
249
|
background-color: ${m.groupItemIconBackgroundColor};
|
|
250
250
|
box-shadow: 0 0 0.5rem ${m.groupItemIconShadowColor};
|
|
251
251
|
@media (prefers-color-scheme: dark) {
|
|
252
|
-
background-color: ${
|
|
253
|
-
box-shadow: 0 0 0.5rem ${
|
|
252
|
+
background-color: ${$.groupItemIconBackgroundColor};
|
|
253
|
+
box-shadow: 0 0 0.5rem ${$.groupItemIconShadowColor};
|
|
254
254
|
}
|
|
255
255
|
/* overflow: hidden; */
|
|
256
256
|
transition: all 0.3s;
|
|
257
257
|
margin: 0 auto;
|
|
258
258
|
width: ${S*64+32*(S-1)}px;
|
|
259
|
-
height: ${
|
|
260
|
-
`),onClick:
|
|
259
|
+
height: ${x*64+32*(x-1)}px;
|
|
260
|
+
`),onClick:Y=>{!ue&&!k&&(o.parentIds=i,o.pageX=Y.pageX,o.pageY=Y.pageY,E(o))},...b(o,P!==!1),children:t.jsxs(L.motion.div,{className:n.css`
|
|
261
261
|
position: relative;
|
|
262
262
|
width: 100%;
|
|
263
263
|
height: 100%;
|
|
@@ -265,28 +265,28 @@ React keys must be passed directly to JSX without using spread:
|
|
|
265
265
|
justify-content: center;
|
|
266
266
|
align-items: center;
|
|
267
267
|
padding: 0.375rem;
|
|
268
|
-
`,children:[
|
|
268
|
+
`,children:[se(),t.jsx(Ee.ReactSortable,{className:n.cx("sortable-group-item",n.css`
|
|
269
269
|
position: absolute;
|
|
270
270
|
cursor: pointer;
|
|
271
271
|
left: 0.375rem;
|
|
272
272
|
top: 0.375rem;
|
|
273
273
|
width: calc(100% - 0.75rem);
|
|
274
274
|
height: calc(100% - 0.75rem);
|
|
275
|
-
pointer-events: ${
|
|
275
|
+
pointer-events: ${G===null?"none":"auto"};
|
|
276
276
|
> * {
|
|
277
277
|
opacity: 0;
|
|
278
278
|
}
|
|
279
|
-
`),group:{name:"nested",pull:!1,put:!0},animation:150,fallbackOnBody:!0,list:
|
|
279
|
+
`),group:{name:"nested",pull:!1,put:!0},animation:150,fallbackOnBody:!0,list:v??[],setList:Y=>l(Y,i),filter:()=>!0,"data-id":o.id,onChange:()=>{X(o.id)}})]})}),t.jsx(L.motion.p,{className:n.cx(n.css`
|
|
280
280
|
text-align: center;
|
|
281
281
|
margin-top: 0.25rem;
|
|
282
282
|
margin-bottom: 0;
|
|
283
283
|
color: ${m.itemNameColor};
|
|
284
284
|
@media (prefers-color-scheme: dark) {
|
|
285
|
-
color: ${
|
|
285
|
+
color: ${$.itemNameColor};
|
|
286
286
|
}
|
|
287
|
-
`,
|
|
287
|
+
`,f&&n.css`
|
|
288
288
|
color: transparent;
|
|
289
|
-
`),variants:
|
|
289
|
+
`),variants:J,animate:fe?"hidden":"visible",children:(O==null?void 0:O.name)??"文件夹"})]})},qe=n.css`
|
|
290
290
|
padding: 8px;
|
|
291
291
|
transition: all 0.2s;
|
|
292
292
|
> div {
|
|
@@ -298,7 +298,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
298
298
|
transition: all 0.2s;
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
|
-
`,
|
|
301
|
+
`,Po=C=>{const{data:o,onClose:c,onItemClick:i}=C,{list:p,setList:s,setListStatus:f,setMoveItemId:b,setMoveTargetId:l,updateItem:E}=me(),{theme:k}=de(),{light:F,dark:N}=le.getTheme(k),[X,G]=d.useState("文件夹"),h=[...(o==null?void 0:o.children)??[]];return d.useEffect(()=>{var g;o&&G((g=o.data)==null?void 0:g.name)},[o]),t.jsx(We,{visible:!!o,onClose:()=>{c()},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:t.jsx("input",{className:n.css`
|
|
302
302
|
background-color: transparent;
|
|
303
303
|
border-style: none;
|
|
304
304
|
text-align: center;
|
|
@@ -311,7 +311,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
311
311
|
&:focus {
|
|
312
312
|
outline: none;
|
|
313
313
|
}
|
|
314
|
-
`,value:X,onChange:
|
|
314
|
+
`,value:X,onChange:g=>{G(g.target.value)},onBlur:()=>{o&&E(o.id,{...o.data,name:X})}}),footer:null,closable:!1,className:n.cx("group-item-modal",n.css`
|
|
315
315
|
.rc-dialog-content {
|
|
316
316
|
background-color: transparent;
|
|
317
317
|
box-shadow: none;
|
|
@@ -326,26 +326,26 @@ React keys must be passed directly to JSX without using spread:
|
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
.rc-dialog-body {
|
|
329
|
-
background-color: ${
|
|
329
|
+
background-color: ${F.groupItemModalBackgroundColor};
|
|
330
330
|
@media (prefers-color-scheme: dark) {
|
|
331
|
-
background-color: ${
|
|
331
|
+
background-color: ${N.groupItemModalBackgroundColor};
|
|
332
332
|
}
|
|
333
333
|
border-radius: 0.5rem;
|
|
334
334
|
overflow: hidden;
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
|
-
`),width:600,destroyOnClose:!0,children:
|
|
337
|
+
`),width:600,destroyOnClose:!0,children:t.jsx("div",{className:n.css`
|
|
338
338
|
overflow-y: auto;
|
|
339
339
|
max-height: 60vh;
|
|
340
340
|
padding: 1.25rem 0;
|
|
341
|
-
`,onDragLeave:
|
|
341
|
+
`,onDragLeave:g=>{const P=g.relatedTarget;P&&(g.currentTarget.contains(P)||setTimeout(()=>{c()},500))},children:t.jsx(Ee.ReactSortable,{className:n.css`
|
|
342
342
|
display: grid;
|
|
343
343
|
gap: 1rem;
|
|
344
344
|
place-items: center;
|
|
345
345
|
grid-template-columns: repeat(auto-fill, 96px);
|
|
346
346
|
grid-auto-flow: dense;
|
|
347
347
|
grid-auto-rows: 96px;
|
|
348
|
-
`,group:{name:"nested",pull:!0,put:!1},animation:150,fallbackOnBody:!0,list:(
|
|
348
|
+
`,group:{name:"nested",pull:!0,put:!1},animation:150,fallbackOnBody:!0,list:(o==null?void 0:o.children)??[],setList:g=>{var $,v;const P=g.map(O=>O.id),m=(v=($=p.find(O=>O.id===(o==null?void 0:o.id)))==null?void 0:$.children)==null?void 0:v.map(O=>O.id);P.length===(m==null?void 0:m.length)&&P.every((O,M)=>O===m[M])||P.length<((m==null?void 0:m.length)??0)||s(g,[...(o==null?void 0:o.parentIds)??[],o==null?void 0:o.id])},onMove:()=>(l(null),f("onMove"),!0),onStart:g=>{const P=g.item.dataset;P!=null&&P.id&&b(P.id),f("onMove")},onEnd:()=>{b(null),l(null),f(null)},ghostClass:qe,children:h.map((g,P)=>t.jsx(Me,{data:g,itemIndex:P,onClick:i},g.id))})})})},Mo=C=>{var i;const{data:o,onClose:c}=C;return t.jsx(We,{visible:!!o,onClose:()=>{c()},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:((i=o==null?void 0:o.data)==null?void 0:i.name)??"信息",children:o&&t.jsxs("div",{children:[t.jsx("div",{className:"mb-2",children:"开发者信息"}),t.jsx("div",{className:"p-2 rounded-md bg-[#272822]",children:t.jsx(ho,{src:o,theme:"monokai"})})]})})},Do=C=>{const{pagination:o={position:"bottom"},className:c,sliderProps:i,sliderRef:p,onItemClick:s}=C,f=d.useRef(null),b=d.useRef(null),{list:l,setList:E,setListStatus:k,showInfoItemData:F,setShowInfoItemData:N,openGroupItemData:X,setOpenGroupItemData:G,setMoveItemId:h,setMoveTargetId:g,addItem:P}=me(),{pagingDotBuilder:m,pagingDotsBuilder:$,itemBuilder:v}=de(),O=d.useMemo(()=>o===!1?{}:{top:n.css`
|
|
349
349
|
display: flex;
|
|
350
350
|
flex-direction: column;
|
|
351
351
|
.slick-list {
|
|
@@ -354,11 +354,11 @@ React keys must be passed directly to JSX without using spread:
|
|
|
354
354
|
.slick-dots {
|
|
355
355
|
position: static;
|
|
356
356
|
}
|
|
357
|
-
`,bottom:
|
|
357
|
+
`,bottom:n.css`
|
|
358
358
|
.slick-dots {
|
|
359
359
|
position: static;
|
|
360
360
|
}
|
|
361
|
-
`,left:
|
|
361
|
+
`,left:n.css`
|
|
362
362
|
.slick-dots {
|
|
363
363
|
position: absolute;
|
|
364
364
|
width: auto;
|
|
@@ -373,7 +373,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
373
373
|
flex-direction: column;
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
|
-
`,right:
|
|
376
|
+
`,right:n.css`
|
|
377
377
|
.slick-dots {
|
|
378
378
|
position: absolute;
|
|
379
379
|
width: auto;
|
|
@@ -388,7 +388,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
388
388
|
flex-direction: column;
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
|
-
`}[
|
|
391
|
+
`}[o.position??"bottom"],[o]);return t.jsxs(t.Fragment,{children:[t.jsx(mo,{useCSS:!0,useTransform:!0,arrows:!1,ref:p??f,infinite:!1,dots:!0,touchMove:!1,lazyLoad:"anticipated",className:n.cx(O,n.css`
|
|
392
392
|
.slick-track {
|
|
393
393
|
display: flex;
|
|
394
394
|
align-items: stretch;
|
|
@@ -403,7 +403,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
403
403
|
width: 100%;
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
-
`,c),customPaging:
|
|
406
|
+
`,c),customPaging:M=>{var x,S;return m?m(l[M],M):t.jsx("div",{onDragEnter:()=>{var J;(J=(p??f).current)==null||J.slickGoTo(M)},children:(S=(x=l[M])==null?void 0:x.data)==null?void 0:S.name})},appendDots:M=>$?$(M):o===!1?t.jsx("div",{}):t.jsx("div",{children:t.jsx("ul",{ref:b,className:n.cx("slick-dots-default",n.css`
|
|
407
407
|
padding: 0.5rem;
|
|
408
408
|
display: inline-flex;
|
|
409
409
|
justify-content: center;
|
|
@@ -422,7 +422,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
422
422
|
width: auto;
|
|
423
423
|
height: auto;
|
|
424
424
|
}
|
|
425
|
-
`),children:
|
|
425
|
+
`),children:M})}),...i,children:l.map(M=>t.jsx("div",{onDrop:x=>{x.preventDefault();const S=x.dataTransfer.getData("text/plain");if(S!=="")try{P(JSON.parse(S),[M.id])}catch(J){console.log("drag error",J)}},onDragOver:x=>{x.preventDefault()},children:t.jsx(Ee.ReactSortable,{className:n.cx(n.css`
|
|
426
426
|
display: grid;
|
|
427
427
|
transition: all 0.3s;
|
|
428
428
|
grid-template-columns: repeat(auto-fill, 96px);
|
|
@@ -431,38 +431,93 @@ React keys must be passed directly to JSX without using spread:
|
|
|
431
431
|
place-items: center;
|
|
432
432
|
justify-content: center;
|
|
433
433
|
align-items: center;
|
|
434
|
-
`),animation:150,fallbackOnBody:!0,swapThreshold:.65,group:"nested",list:
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
434
|
+
`),animation:150,fallbackOnBody:!0,swapThreshold:.65,group:"nested",list:M.children??[],setList:x=>E(x,[M.id]),filter:".drag-disabled",onMove:x=>{k("onMove");const{dragged:S,related:J}=x,ue=S.dataset,q=J.dataset;return g(null),!((Object.keys(q).length===0||q.parentIds)&&Number(ue.childrenLength)>0&&J.classList.contains("sortable-group-item"))},onStart:x=>{const S=x.item.dataset;S!=null&&S.id&&h(S.id),k("onMove")},onEnd:()=>{h(null),g(null),k(null)},ghostClass:qe,children:(M.children??[]).map((x,S)=>{let J;if(v)return v(x);switch(x.type){case"group":case"app":J=t.jsx(_o,{data:x,itemIndex:S,parentIds:[M.id,x.id],onClick:s},x.id);break;default:J=t.jsx(Me,{data:x,itemIndex:S,onClick:s},x.id);break}return J})})},M.id))}),t.jsx(Mo,{data:F,onClose:()=>{N(null)}}),t.jsx(Po,{data:X,onClose:()=>{G(null)},onItemClick:s})]})},No=C=>{const{list:o,onChange:c,storageKey:i,enableCaching:p,theme:s,noLetters:f,contextMenu:b,contextMenuBuilder:l,itemBuilder:E,itemIconBuilder:k,pagingDotBuilder:F,pagingDotsBuilder:N,...X}=C,G={list:o,onChange:c,storageKey:i,enableCaching:p},h={theme:s,noLetters:f,contextMenu:b,pagingDotsBuilder:N,pagingDotBuilder:F,itemBuilder:E,itemIconBuilder:k,contextMenuBuilder:l};return t.jsx(Ro,{...G,children:t.jsx(So,{...h,children:t.jsx(Do,{...X})})})},Oo={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:"删除图片"}},Ao=(C,o,c)=>{const p=C.split(".").reduce((s,f)=>typeof s=="string"?s:s[f],Oo);return typeof p!="string"?o:c?p.replace(/{{(.*?)}}/g,(s,f)=>c[f]):p},Bo=n.css`
|
|
435
|
+
[class*="_toolbarRoot"] {
|
|
436
|
+
flex-wrap: wrap;
|
|
437
|
+
}
|
|
438
|
+
[class*="_codeMirrorWrapper"] {
|
|
439
|
+
padding: 0;
|
|
440
|
+
[class*="_codeMirrorToolbar"] {
|
|
441
|
+
position: static;
|
|
442
|
+
background-color: var(--bgColor-muted);
|
|
443
|
+
justify-content: flex-end;
|
|
444
|
+
[class*="_iconButton"] {
|
|
445
|
+
cursor: pointer;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
[class*="_tableEditor"] {
|
|
450
|
+
border-spacing: 0;
|
|
451
|
+
border-collapse: collapse;
|
|
452
|
+
width: 100%;
|
|
453
|
+
display: table;
|
|
454
|
+
th[data-tool-cell],
|
|
455
|
+
td[data-tool-cell] {
|
|
456
|
+
padding: 0;
|
|
457
|
+
border: none;
|
|
458
|
+
}
|
|
459
|
+
tr {
|
|
460
|
+
border-top: 0;
|
|
461
|
+
}
|
|
462
|
+
thead {
|
|
463
|
+
th {
|
|
464
|
+
padding: 0;
|
|
465
|
+
border: none;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
tfoot {
|
|
469
|
+
th {
|
|
470
|
+
padding: 0;
|
|
471
|
+
border: none;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
[class*="_addRowButton"],
|
|
475
|
+
[class*="_addColumnButton"],
|
|
476
|
+
[class*="_tableColumnEditorTrigger"],
|
|
477
|
+
[class*="_iconButton"] {
|
|
478
|
+
cursor: pointer;
|
|
479
|
+
transition: all 0.3s;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
ul {
|
|
483
|
+
[role="checkbox"] {
|
|
484
|
+
padding: 0 20px;
|
|
485
|
+
&::before {
|
|
486
|
+
width: 13px;
|
|
487
|
+
height: 13px;
|
|
488
|
+
top: 6px;
|
|
489
|
+
}
|
|
490
|
+
&::after {
|
|
491
|
+
top: 7px;
|
|
492
|
+
left: 4px;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
ul,
|
|
497
|
+
ol {
|
|
498
|
+
li {
|
|
499
|
+
margin-top: 4px;
|
|
500
|
+
margin-bottom: 0;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
`,Ze=n.cx("markdown-body",n.css`
|
|
504
|
+
p {
|
|
505
|
+
margin-bottom: 8px;
|
|
506
|
+
}
|
|
507
|
+
ul {
|
|
508
|
+
list-style: disc;
|
|
509
|
+
}
|
|
510
|
+
ol {
|
|
511
|
+
list-style: decimal;
|
|
512
|
+
}
|
|
513
|
+
table {
|
|
514
|
+
width: 100%;
|
|
515
|
+
display: table;
|
|
516
|
+
}
|
|
517
|
+
pre {
|
|
518
|
+
padding: 0;
|
|
519
|
+
> div {
|
|
520
|
+
margin: 0 !important;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
`),Lo={'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%)"}},Fo=C=>{const{children:o="",className:c}=C;return t.jsx(bo,{className:n.cx(Ze,c),remarkPlugins:[ko,vo],rehypePlugins:[xo],components:{code(i){const{children:p,className:s,node:f,ref:b,...l}=i,E=/language-(\w+)/.exec(s||"");return E?t.jsx(wo.Prism,{...l,PreTag:"div",children:String(p).replace(/\n$/,""),language:E[1],style:Lo}):t.jsx("code",{...l,className:s,children:p})}},children:o})},Qe=C=>{const{value:o,onChange:c,translation:i,pluginConfig:p,...s}=C,f=d.useRef(null),{image:b,diffSource:l={viewMode:"rich-text"},headings:E,link:k,codeBlock:F,codeMirror:N={codeBlockLanguages:{js:"JavaScript",css:"CSS",txt:"Plain Text",tsx:"TypeScript","":"Unspecified"}},directives:X={directiveDescriptors:[w.AdmonitionDirectiveDescriptor]}}=p??{},[G,h]=d.useState("");return d.useEffect(()=>{var g;o!==void 0&&f.current&&((g=f.current)==null||g.setMarkdown(o),h(o))},[o,f]),t.jsx(w.MDXEditor,{ref:f,className:Bo,contentEditableClassName:Ze,markdown:G,onChange:g=>{!o&&!c&&h(g),c&&c(g)},translation:i??Ao,plugins:[w.toolbarPlugin({toolbarContents:()=>t.jsxs(w.DiffSourceToggleWrapper,{options:["rich-text","source"],children:[t.jsx(w.UndoRedo,{}),t.jsx(w.Separator,{}),t.jsx(w.BoldItalicUnderlineToggles,{}),t.jsx(w.CodeToggle,{}),t.jsx(w.Separator,{}),t.jsx(w.StrikeThroughSupSubToggles,{}),t.jsx(w.Separator,{}),t.jsx(w.ListsToggle,{}),t.jsx(w.Separator,{}),t.jsx(w.CreateLink,{}),t.jsx(w.InsertImage,{}),t.jsx(w.Separator,{}),t.jsx(w.InsertTable,{}),t.jsx(w.InsertThematicBreak,{}),t.jsx(w.Separator,{}),t.jsx(w.InsertCodeBlock,{}),t.jsx(w.Separator,{}),t.jsx(w.InsertFrontmatter,{})]})}),w.diffSourcePlugin(l),w.listsPlugin(),w.quotePlugin(),w.headingsPlugin(E),w.linkPlugin(k),w.linkDialogPlugin(),w.imagePlugin(b),w.tablePlugin(),w.thematicBreakPlugin(),w.frontmatterPlugin(),w.codeBlockPlugin(F),w.codeMirrorPlugin(N),w.markdownShortcutPlugin(),w.directivesPlugin(X)],...s})};Qe.Preview=Fo,I.Desktop=No,I.MdEditor=Qe,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})});
|