filecat 7.3.3 → 7.3.4
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/build/dist/{1142.2a57e7124b6e3720c759.js → 1142.ff1f4e075b061d70b2b6.js} +1 -1
- package/build/dist/{3328.9122f8c52f44f844bc20.js → 3328.5c4a535864d93c9f4ca7.js} +1 -1
- package/build/dist/8603.b4bc403e5d032e15b996.js +1 -0
- package/build/dist/9877.71cc8792bc3fe5abefcc.js +1 -0
- package/build/dist/index.html +1 -1
- package/build/dist/main.01456be775c50cf697fc.js +2 -0
- package/build/main.js +1 -1
- package/package.json +1 -1
- package/build/dist/8603.d7eea8d253cff5aef62c.js +0 -1
- package/build/dist/9877.5bed2ede178cba58843b.js +0 -1
- package/build/dist/main.62150e46f9d1c96fa5bf.js +0 -2
- /package/build/dist/{main.62150e46f9d1c96fa5bf.js.LICENSE.txt → main.01456be775c50cf697fc.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8603],{58603(e,t,i){i.r(t),i.d(t,{default:()=>N});var n=i(96540),s=i(75725),r=i(70447),a=i(34843),o=i(82893),l=i(60096),c=i(85997),d=i(34251),m=i(34289),h=i(87361),_=i(14284),u=i(53459),x=i(61443),f=i(86149),p=i(62042),j=(i(47022),i(4412)),k=i(99214),g=i(6960),w=i(88815),v=i(40505),z=i(23430),F=i(64694),b=i(86090),C=i(74848);function N(){const[e,t]=(0,n.useState)(null),i=(0,n.useRef)(""),N=(0,n.useRef)(""),[$,y]=(0,a.fp)(o.AG.prompt_card),[S,M]=(0,a.fp)(o.AG.share_sort_type),{t:A}=(0,f.B)(),[G,I]=(0,a.fp)(o.AG.selectedFileList),[U,V]=(0,a.fp)(o.AG.clickFileList),{click_file:W}=(0,k.kZ)(),[D]=(0,b.ok)(),L=(0,k.oT)(),R=(0,k.xp)(),Z=(0,k.Vs)(!0),B=(0,n.useMemo)(()=>{const t=[...e?.items??[]],i=e=>Number(e.mtime??0);return S===z.t8.time_minx_max?t.sort((e,t)=>i(e)-i(t)):S===z.t8.time_max_min&&t.sort((e,t)=>i(t)-i(e)),t},[e?.items,S]),H=async()=>{const e=await _.$M.post("share",{id:i.current,token:N.current});if(e.code===u.m.Success){const n={is_dir:e.data.is_dir};n.items=e.data.files??[];for(const e of n.items)e.origin_size=e.size,e.show_mtime=e.mtime?(0,g.s)(e.mtime):"",e.size=(0,w.v7)(e.size);if(!n.is_dir){const t=e.data.files[0];n.name=t.name,n.size=t.size,n.show_mtime=t.show_mtime}localStorage.setItem(`file_share_token_${i.current}`,N.current);const s=D.get("share_preview_file_name");if(s)try{const t=e.data.files.find(e=>e.name===s);W({file_path:t.path,file_url:_.$M.getDownloadUrlV2(t.path,"share_download",{share_id:i.current,share_token:N.current}),name:t.name,size:t.origin_size,opt_shell:!0,mtime:t.mtime,not_type_tip:A("未知类型,请下载查看"),close:()=>{L("share_preview_file_name",null)}})}catch(e){(0,p.zN)(e?.message||e)}else t(n)}else e.code===u.m.need_token_share&&(localStorage.removeItem(`file_share_token_${i.current}`),(0,p.zN)("需要正确的访问token"),y({open:!0,title:"share file",confirm:()=>{y({open:!1}),H()},context_div:(0,C.jsx)("div",{className:"card-content",children:(0,C.jsx)(x.Sm,{placeholderOut:A("请输入访问token"),value:"",handleInputChange:e=>{N.current=e}})})}))};if((0,n.useEffect)(()=>{const e=(0,m.oW)(`${(0,m.GG)(h.o.share,(0,m.vX)())}`);i.current=e,N.current=localStorage.getItem(`file_share_token_${e}`),H()},[D]),!e)return(0,C.jsx)(s.jW,{isFull:!0,children:(0,C.jsx)("div",{className:"common-box common-box-center",children:"Loading..."})});return(0,C.jsxs)(n.Fragment,{children:[(0,C.jsx)(j.aZ,{children:(0,C.jsx)(C.Fragment,{children:(0,C.jsxs)("h2",{children:["Share ",e.is_dir?"Folder":"File"]})})}),(0,C.jsxs)(j.aZ,{position:"right",children:[G.length>0&&(0,C.jsx)(c.rA,{icon:"download",title:A("下载"),onClick:function(){const e=[];for(let t=0;t<G.length;t++){const i=B[G[t]];e.push(encodeURIComponent(i.path))}const t=_.$M.getDownloadUrlV2(e,"share_download",{share_id:i.current,share_token:N.current});window.open(t)}}),e.is_dir&&(0,C.jsx)(c.rA,{icon:"grid_view",title:A("切换样式"),onClick:Z}),e.is_dir&&(0,C.jsx)(c.rA,{icon:"schedule",title:S===z.t8.time_minx_max?A("时间逆序"):A("时间顺序"),onClick:()=>{const e=(0,F.jH)([z.t8.time_max_min,z.t8.time_minx_max,z.t8.defualt],S);M(e),I([]),V([])}})]}),(0,C.jsx)(s.xh,{children:(0,C.jsx)(s.jW,{isFull:!0,children:(0,C.jsx)("div",{className:"common-box ",children:e.is_dir?(0,C.jsx)(l.QW,{share:{share_id:i.current,share_token:N.current},handleContextMenu:()=>{},file_list:B,clickBlank:e=>{e.target===e.currentTarget&&(I([]),V([]))}}):(0,C.jsx)(r.uF,{children:(0,C.jsxs)("div",{style:{height:"25rem"},className:"common-box common-box-center",children:[(0,C.jsx)("div",{className:"file-icons",children:(0,C.jsx)("div",{"data-type":(0,d.uL)(e.name),"data-dir":e.is_dir,"aria-label":e.name,children:(0,C.jsx)(c.In,{icon:"",style:{fontSize:"10rem",display:"inline-block",lineHeight:1},aria_label:e.name})})}),(0,C.jsx)("div",{className:"",children:e.name}),(0,C.jsx)("div",{className:"",children:e.size}),(0,C.jsx)("div",{className:"",children:e.show_mtime}),(0,C.jsx)(c.C3,{text:"download",clickFun:()=>{const e=B[0],t=_.$M.getDownloadUrlV2(e.path,"share_download",{share_id:i.current,share_token:N.current});window.open(t)}}),(0,C.jsx)(c.C3,{text:"copy url",clickFun:()=>{const e=B[0],t=_.$M.getDownloadUrlV2(e.path,"share_download",{share_id:i.current,share_token:N.current}),n=_.$M.get_full_url(t);(0,v.lW)(n),(0,p.SK)(n)}}),(0,C.jsx)(c.C3,{text:"preview",clickFun:()=>{const e=B[0];R(e.name)}})]})})})})})]})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[9877],{69918(t,e,n){n.d(e,{Ce:()=>l,FG:()=>r.FG,fy:()=>c,gC:()=>a});var r=n(18840),o=n(14284),s=n(53459);async function a(){try{const t=await o.XO.get("md_editor_setting/get");return{...r.FG,...t?.data??{}}}catch(t){return{...r.FG}}}async function c(t){const e=await o.XO.post("md_editor_setting/save",t);return e?.code!==s.m.Success?null:{...r.FG,...e.data??t}}function l(t,e){t&&(t.style.setProperty("--md-editor-max-width",e.content_max_width),t.style.setProperty("--md-editor-padding",e.content_padding),t.style.setProperty("--md-editor-font-size",e.font_size),t.style.setProperty("--md-editor-line-height",e.line_height))}},64877(t,e,n){n.d(e,{A:()=>a});var r=n(96540),o=n(86149),s=n(74848);function a(t){const{t:e}=(0,o.B)(),[n,a]=(0,r.useState)(new Set),c=(0,r.useMemo)(()=>function(t){const e=[],n=[];for(const r of t){const t={...r,children:[]};for(;n.length>0&&n[n.length-1].level>=t.level;)n.pop();0===n.length?e.push(t):n[n.length-1].children.push(t),n.push(t)}return e}(t.items),[t.items]),l=(r,o)=>r.map(r=>{const c=r.children.length>0,i=n.has(r.pos),d=r.pos===t.active_pos;return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:`md-outline-item md-outline-item--h${r.level}${d?" md-outline-item--active":""}`,style:{paddingLeft:.4+.75*o+"em"},title:r.text,onClick:()=>t.on_click(r),children:[(0,s.jsx)("i",{className:"material-icons md-outline-arrow"+(c?"":" md-outline-arrow--empty"),onClick:c?t=>{return e=r.pos,t.stopPropagation(),void a(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});var e}:void 0,children:c?i?"arrow_right":"arrow_drop_down":""}),(0,s.jsx)("span",{className:"md-outline-text",children:r.text||e("未命名标题")})]}),c&&!i&&l(r.children,o+1)]},r.pos)});return 0===t.items.length?(0,s.jsxs)("div",{className:"md-outline md-outline--empty",children:[(0,s.jsx)("div",{className:"md-outline-header",children:e("大纲")}),(0,s.jsx)("div",{className:"md-outline-tip",children:e("no_head")})]}):(0,s.jsxs)("div",{className:"md-outline",children:[(0,s.jsx)("div",{className:"md-outline-header",children:e("大纲")}),(0,s.jsx)("div",{className:"md-outline-list",children:l(c,0)})]})}},86504(t,e,n){n.d(e,{A:()=>T});var r=n(96540),o=n(42845),s=n(1575),a=n(89781),c=n(61396),l=n(46762),i=n(73337),d=n(89552),u=n(86059),h=n(5091),m=n(22091),p=n(58903);const f=new m.A({html:!0,linkify:!0,breaks:!1,typographer:!1});function g(t){const e=f.render(t??""),n=document.createElement("div");return n.innerHTML=e,p.S4.fromSchema(h.Y).parse(n)}function _(t){let e="";return t.forEach(t=>{if(t.isText){let n=t.marks.some(t=>"code"===t.type.name)?t.text??"":function(t){return t.replace(/([\\`*_[\]<>])/g,"\\$1")}(t.text??"");for(const e of t.marks)switch(e.type.name){case"code":n=`\`${t.text??""}\``;break;case"strong":n=`**${n}**`;break;case"em":n=`*${n}*`;break;case"strike":n=`~~${n}~~`;break;case"link":n=`[${n}](${e.attrs.href}${e.attrs.title?` "${e.attrs.title}"`:""})`}e+=n}else if("image"===t.type.name){const{src:n,alt:r,title:o}=t.attrs;e+=``}else"hard_break"===t.type.name&&(e+=" \n")}),e}function y(t){const e=[];if(t.forEach(t=>{const n=[],r=[];t.forEach(t=>{var e;n.push((e=t.textContent,e.replace(/\|/g,"\\|").replace(/\n/g," ")).trim()),r.push("table_header"===t.type.name)}),e.push({cells:n,header_flags:r})}),0===e.length)return"";const n=Math.max(...e.map(t=>t.cells.length)),r=e[0].header_flags.some(t=>t),o=Array.from({length:n},(t,n)=>Math.max(3,...e.map(t=>k(t.cells[n]??"")))),s=t=>`| ${Array.from({length:n},(e,n)=>{return r=t[n]??"",s=o[n],r+" ".repeat(Math.max(0,s-k(r)));var r,s}).join(" | ")} |`,a=[];if(r){a.push(s(e[0].cells)),a.push(`| ${o.map(t=>"-".repeat(t)).join(" | ")} |`);for(let t=1;t<e.length;t++)a.push(s(e[t].cells))}else{a.push(s(new Array(n).fill(""))),a.push(`| ${o.map(t=>"-".repeat(t)).join(" | ")} |`);for(const t of e)a.push(s(t.cells))}return a.join("\n")}function k(t){let e=0;for(const n of t){const t=n.codePointAt(0)??0;e+=t>=4352&&t<=4447||t>=11904&&t<=42191||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65072&&t<=65135||t>=65280&&t<=65376||t>=65504&&t<=65510?2:1}return e}function b(t,e=""){switch(t.type.name){case"paragraph":default:return e+_(t);case"heading":return`${e}${"#".repeat(t.attrs.level)} ${_(t)}`;case"blockquote":return w(t,"").split("\n").map(t=>`${e}> ${t}`).join("\n");case"code_block":{const n=t.attrs.language??"";return`${e}\`\`\`${n}\n${t.textContent}\n${e}\`\`\``}case"horizontal_rule":return`${e}---`;case"bullet_list":{const n=[];return t.forEach((t,r,o)=>{n.push(v(t,e,`${e}- `,`${e} `,o))}),n.join("\n")}case"ordered_list":{const n=[],r=t.attrs.order??1;return t.forEach((t,o,s)=>{n.push(v(t,e,`${e}${r+s}. `,`${e} `,s))}),n.join("\n")}case"table":return y(t).split("\n").map(t=>e+t).join("\n")}}function v(t,e,n,r,o){const s=t.attrs.checked,a=null===s?"":s?"[x] ":"[ ] ",c=[];t.forEach((t,e,n)=>{c.push(b(t,0===n?"":r))});const l=c.join("\n").split("\n");return n+a+l[0]+(l.length>1?"\n"+l.slice(1).join("\n"):"")}function w(t,e=""){const n=[];return t.forEach(t=>{n.push(b(t,e))}),n.join("\n\n")}function $(t){return w(t).trim()+"\n"}n(64877);var M=n(19878);const x=new o.hs("md_source_highlight");let O=!1;function S(t){O=t}function D(t,e,n){let r=e;for(const e of t){if("string"==typeof e){r+=e.length;continue}const t=r;Array.isArray(e.children)&&(r=D(e.children,r,n)),e.scope&&n.push({from:t,to:r,cls:`hljs-${e.scope}`})}return r}function A(t,e){const n=t.textContent;if(!n)return[];let r;try{r=M.A.highlight(n,{language:"markdown",ignoreIllegals:!0})}catch{return[]}const o=[],a=r._emitter?.rootNode;a?.children&&D(a.children,0,o);const c=e+1,l=[];for(const t of o){const e=Math.min(t.from,n.length),r=Math.min(t.to,n.length);e>=r||l.push(s.NZ.inline(c+e,c+r,{class:t.cls}))}return l}function C(t){const e=[];return t.descendants((t,n)=>"code_block"!==t.type.name||(e.push(...A(t,n)),!1)),s.zF.create(t,e)}var N=n(67951),j=(n(41631),n(50576),n(70432),n(74848));function z(t){return 0===t?(0,N.uf)("paragraph"):(0,N.uf)("heading",{level:t})}function E(t){return!(!t.ctrlKey&&!t.metaKey)}function F(t,e){return(0,u.D8)(1)(t,e)}const G=r.forwardRef(function(t,e){const n=(0,r.useRef)(null),m=(0,r.useRef)(null),p=(0,r.useRef)(t.on_change),f=(0,r.useRef)(t.on_save),_=(0,r.useRef)(t.on_selection_change),y=(0,r.useRef)(t.on_source_mode_change);return(0,r.useEffect)(()=>{p.current=t.on_change,f.current=t.on_save,_.current=t.on_selection_change,y.current=t.on_source_mode_change}),(0,r.useEffect)(()=>{if(!n.current)return;h.Y;const r=o.$t.create({doc:g(t.value??""),plugins:[(0,a.b6)(),new o.k_({key:x,state:{init:(t,e)=>s.zF.empty,apply:(t,e,n,r)=>O?t.docChanged?C(r.doc):x.getState(r)??s.zF.empty:s.zF.empty},props:{decorations(t){if(!O)return null;const e=x.getState(t);return e&&e.find().length?e:C(t.doc)}}}),(0,N.k5)(),(0,c.w)({"Mod-z":a.tN,"Mod-y":a.ZS,"Mod-Shift-z":a.ZS,"Mod-b":(0,N.NH)("strong"),"Mod-i":(0,N.NH)("em"),"Mod-Shift-x":(0,N.NH)("strike"),"Mod-`":(0,N.NH)("code"),"Mod-1":(t,e)=>z(1)(t,e),"Mod-2":(t,e)=>z(2)(t,e),"Mod-3":(t,e)=>z(3)(t,e),"Mod-0":(t,e)=>z(0)(t,e),"Mod-Shift-8":N.fK,"Mod-Shift-9":N.oB,"Mod-Shift-.":N.Vu,Tab:N.G8.sink,"Shift-Tab":N.G8.lift,"Mod-Enter":F,"Mod-s":()=>(f.current?.(),!0)}),(0,u.LF)({allowTableNodeSelection:!0}),(0,u.AL)(),(0,i.A)({color:"var(--primary, #1a73e8)",width:2}),(0,d.z)(),(0,c.w)({Enter:(0,l.st)(N.x0,l.pC,N.G8.split,l.Z1,l.iz,l.aw),"Shift-Enter":(t,e)=>{const{hard_break:n}=t.schema.nodes;return e&&e(t.tr.replaceSelectionWith(n.create()).scrollIntoView()),!0},"Mod-Enter":l.I$}),(0,c.w)(l.RV)]}),k=new s.Lz(n.current,{state:r,editable:()=>!1!==t.editable,handleClickOn(t,e,n,r,o){if(!E(o))return!1;const s=function(t){if(!(t instanceof Element))return null;const e=t.closest("a[href]"),n=e?.getAttribute("href");return n||null}(o.target)??function(t,e){const n=t.doc.content.size,r=Math.max(0,Math.min(e,n));let o;try{o=t.doc.resolve(r)}catch{return null}for(const e of[1,-1]){const o=1===e?r:r-1;if(!(o<0||o>=n))try{const e=t.doc.resolve(o).marks().find(t=>"link"===t.type.name);if(e?.attrs?.href)return e.attrs.href}catch{}}try{const t=o.parent.marks.find(t=>"link"===t.type.name);if(t?.attrs?.href)return t.attrs.href}catch{}return null}(t.state,e);return!!s&&(window.open(s,"_blank","noopener,noreferrer"),!0)},handleDOMEvents:{keydown:(t,e)=>{if(E(e)&&t.dom.classList.add("md-ctrl-down"),I(t.state.doc)&&"Enter"===e.key&&!e.ctrlKey&&!e.metaKey&&!e.altKey){e.preventDefault();const{from:n,to:r}=t.state.selection;return t.dispatch(t.state.tr.insertText("\n",n,r).scrollIntoView()),!0}return!1},keyup:(t,e)=>(E(e)||t.dom.classList.remove("md-ctrl-down"),!1),blur:t=>(t.dom.classList.remove("md-ctrl-down"),!1),beforeinput:(t,e)=>{if(!I(t.state.doc))return!1;const n=e;if("insertText"!==n.inputType)return!1;const r=n.data;if(null==r)return!1;n.preventDefault();const{from:o,to:s}=t.state.selection;return t.dispatch(t.state.tr.insertText(r.replace(/\r\n?/g,"\n"),o,s).scrollIntoView()),!0}},dispatchTransaction(t){const e=k.state.apply(t);k.updateState(e);const n=I(e.doc);S(n),n?k.dom.classList.add("md-source-mode"):k.dom.classList.remove("md-source-mode"),n!==I(t.before)&&y.current?.(n),t.docChanged&&p.current?.(n?e.doc.textContent:$(e.doc)),(t.selectionSet||t.docChanged)&&_.current?.()},attributes:{class:"md-filecat-content",spellcheck:"false"}});if(m.current=k,t.initial_source_mode&&!I(k.state.doc)){const t=$(k.state.doc),e=k.state.schema.nodes.code_block.create({language:"markdown"},t?k.state.schema.text(t):null),n=k.state.tr;n.replaceWith(0,k.state.doc.content.size,e),n.setMeta("addToHistory",!1),k.dispatch(n)}const b={get_markdown:()=>I(k.state.doc)?k.state.doc.textContent:$(k.state.doc),set_markdown:t=>{const e=g(t);k.dispatch(k.state.tr.replaceWith(0,k.state.doc.content.size,e.content))},focus:()=>k.focus(),get_view:()=>m.current,in_table:()=>function(t){const{$from:e}=t.selection;for(let t=e.depth;t>0;t--){if("table"===e.node(t).type.name)return!0}return!1}(k.state),active_marks:()=>(k.state.storedMarks??k.state.selection.$from.marks()).map(t=>t.type.name),active_block:()=>{const{$from:t}=k.state.selection;for(let e=t.depth;e>0;e--){const n=t.node(e);if("heading"===n.type.name)return{name:"heading",level:n.attrs.level};if("paragraph"===n.type.name)return{name:"paragraph"}}return{name:"paragraph"}},insert_table:(t=3,e=3)=>{const n=function(t,e,n){const r=(0,u.e)(t),o=r.table,s=r.row,a=r.cell,c=r.header_cell??r.cell;if(!o||!s||!a)return null;const l=t=>s.create(null,Array.from({length:e},()=>t.createAndFill())),i=l(c),d=Array.from({length:n},()=>l(a));return o.create(null,[i,...d])}(k.state.schema,t,e);if(!n)return;const{from:r}=k.state.selection,o=k.state.doc.resolve(r);let s=r;for(let t=o.depth;t>0;t--)if("table"===o.node(t).type.name){s=o.after(t);break}const a=k.state.tr;s===r?a.replaceSelectionWith(n):a.insert(s,n),k.dispatch(a.scrollIntoView());const c=k.state.doc.resolve(Math.min(s+3,k.state.doc.content.size));try{k.dispatch(k.state.tr.setSelection(k.state.selection.constructor.near(c)))}catch{}},get_headings:()=>function(t){const e=[];return t.doc.descendants((t,n)=>("heading"!==t.type.name||e.push({level:t.attrs.level,text:t.textContent,pos:n}),!0)),e}(k.state),scroll_to_pos:t=>{const e=k.state.doc.content.size,n=Math.max(0,Math.min(t,e)),r=k.state.doc.nodeAt(n);let s;try{s=r?o.U3.near(k.state.doc.resolve(n+1),1):o.U3.near(k.state.doc.resolve(n),1)}catch{s=o.U3.near(k.state.doc.resolve(0),1)}k.dispatch(k.state.tr.setSelection(s).scrollIntoView()),k.focus()},is_source_mode:()=>I(k.state.doc),enter_source_mode:()=>{if(I(k.state.doc))return;const t=$(k.state.doc),e=k.state.schema.nodes.code_block.create({language:"markdown"},t?k.state.schema.text(t):null),n=k.state.tr;n.replaceWith(0,k.state.doc.content.size,e),S(!0),k.dispatch(n),k.dom.classList.add("md-source-mode")},exit_source_mode:()=>{if(!I(k.state.doc))return;const t=g(k.state.doc.textContent),e=k.state.tr;e.replaceWith(0,k.state.doc.content.size,t.content),S(!1),k.dispatch(e),k.dom.classList.remove("md-source-mode")}};return"function"==typeof e?e(b):e&&(e.current=b),t.on_ready?.(b),()=>{k.destroy(),m.current=null}},[]),(0,j.jsx)("div",{className:"md-filecat",ref:n})});function I(t){if(1!==t.childCount)return!1;const e=t.firstChild;return!!e&&"code_block"===e.type.name&&"markdown"===e.attrs.language}const T=G},67951(t,e,n){n.d(e,{NH:()=>i,k5:()=>l,uf:()=>d});var r=n(38341),o=n(5091),s=n(46762),a=n(3772);function c(t,e){return new r.fV(t,(t,n,r,o)=>{const s=t.schema.marks[e],a=n[1];if(!s||!a)return null;const c=n[0].indexOf(a);if(c<0)return null;const l=r+c,i=l+a.length,d=t.tr;return d.delete(i,o),d.delete(r,l),d.addMark(r,r+a.length,s.create()),d.removeStoredMark(s),d})}function l(){const t=o.Y;return(0,r.sM)({rules:[(0,r.JJ)(/^(#{1,6})\s$/,t.nodes.heading,t=>({level:t[1].length})),(0,r.JJ)(/^#([1-6])\s$/,t.nodes.heading,t=>({level:Number(t[1])})),(0,r.JJ)(/^```([\w-]*)\s$/,t.nodes.code_block,t=>({language:t[1]??""})),(0,r.tG)(/^\s*>\s$/,t.nodes.blockquote),(0,r.tG)(/^\s*([-+*])\s$/,t.nodes.bullet_list),(0,r.tG)(/^(\d+)\.\s$/,t.nodes.ordered_list,t=>({order:Number(t[1])})),c(/(?:\*\*)([^*]+)(?:\*\*)$/,"strong"),c(/(?:__)([^_]+)(?:__)$/,"strong"),c(/(?<![*])\*([^*]+)\*$/,"em"),c(/(?<![_])_([^_]+)_$/,"em"),c(/(?:~~)([^~]+)(?:~~)$/,"strike"),c(/(?:`)([^`]+)(?:`)$/,"code"),...r.Fr,r.gO]})}function i(t){return(e,n)=>{const r=e.schema.marks[t];return!!r&&(0,s.wh)(r)(e,n)}}function d(t,e={}){return(n,r)=>{const o=n.schema.nodes[t];if(!o)return!1;const{$from:s,$to:a}=n.selection,c=s.blockRange(a);if(!c)return!1;const l=s.parent,i=l.type===o&&Object.entries(e).every(([t,e])=>l.attrs[t]===e),d=i?n.schema.nodes.paragraph:o,u=i?{}:e;return r&&r(n.tr.setBlockType(c.start,c.end,d,u)),!0}}const u=(t,e)=>(0,a.Sd)(t.schema.nodes.bullet_list)(t,e),h=(t,e)=>(0,a.Sd)(t.schema.nodes.ordered_list)(t,e),m={sink:(0,a.$B)(o.Y.nodes.list_item),lift:(0,a.T2)(o.Y.nodes.list_item),split:(0,a.wn)(o.Y.nodes.list_item),wrap_bullet:u,wrap_ordered:h};n.d(e,["G8",0,m,"Vu",0,(t,e)=>{const{blockquote:n}=t.schema.nodes,{$from:r,$to:o}=t.selection,s=r.blockRange(o);if(!s)return!1;if(s.parent.type===n&&s.depth>0){const n=r.before(s.depth),o=t.tr.doc.nodeAt(n);if(o&&1===o.childCount)return e&&e(t.tr.replaceWith(n,n+o.nodeSize,o.child(0)).scrollIntoView()),!0;if(e){const n=t.tr,o=r.parent,a=r.after(s.depth);n.delete(s.start,s.end),n.insert(a,o),e(n.scrollIntoView())}return!0}return e&&e(t.tr.wrap(s,[{type:n}]).scrollIntoView()),!0},"fK",0,u,"oB",0,h,"x0",0,(t,e)=>{const{$from:n,empty:r}=t.selection;if(!r||"paragraph"!==n.parent.type.name)return!1;const o=n.parent.textContent;if(!o.trim())return!1;const s=function(t){const e=t.trim(),n=/^#([1-6])$/.exec(e);if(n)return{type:"heading",attrs:{level:Number(n[1])}};const r=/^(#{1,6})$/.exec(e);if(r)return{type:"heading",attrs:{level:r[1].length}};const o=/^```([\w-]*)$/.exec(e);return o?{type:"code_block",attrs:{language:o[1]??""}}:/^(?:-{3,}|\*{3,}|_{3,})$/.test(e.replace(/\s+/g,""))?{type:"horizontal_rule"}:/^>\s*$/.test(e)?{type:"blockquote"}:/^[-+*]\s*$/.test(e)?{type:"bullet_list"}:/^\d+[.)]?$/.test(e)?{type:"ordered_list"}:null}(o);if(!s)return!1;if("blockquote"===s.type&&n.depth>1)return!1;const a=t.schema.nodes[s.type];if(!a)return!1;const c=n.before(n.depth),l=n.after(n.depth);if(e){const n=t.tr,r=a.createAndFill(s.attrs)??a.create(s.attrs);n.replaceWith(c,l,r),n.scrollIntoView(),e(n)}return!0}])},96763(t,e,n){n.d(e,{Kz:()=>a,P7:()=>i,_8:()=>h,_D:()=>u,bN:()=>s,sO:()=>d});var r=n(14284),o=n(53459);function s(t,e){const n="md-theme-style-"+t,r=document.getElementById(n);if(!e)return void r?.remove();let o=r;o||(o=document.createElement("style"),o.id=n,document.head.appendChild(o)),o.textContent=e}async function a(){try{const t=await r.XO.get("md_theme/list");return t?.code===o.m.Success?t.data??[]:[]}catch(t){return[]}}const c="md-theme-change";function l(){window.dispatchEvent(new Event(c))}async function i(t){try{const e=await r.XO.get(`md_theme/get?id=${encodeURIComponent(t)}`);return e?.code===o.m.Success?e.data??"":""}catch(t){return""}}async function d(){try{const t=await r.XO.get("md_theme/active");return t?.code===o.m.Success?t.data??"":""}catch(t){return""}}async function u(t){const e=await r.XO.post("md_theme/save",t);return e?.code!==o.m.Success?null:(l(),e.data)}async function h(t){const e=await r.XO.post("md_theme/del",{id:t});return e?.code===o.m.Success&&(l(),!0)}n.d(e,["o3",0,c])},5091(t,e,n){var r=n(58903);const o=(0,n(86059).of)({tableGroup:"block",cellContent:"block+",cellAttributes:{}}),s={align:{default:null}},a={doc:{content:"block+"},paragraph:{content:"inline*",group:"block",attrs:s,parseDOM:[{tag:"p"}],toDOM:t=>["p",t.attrs.align?{style:`text-align:${t.attrs.align}`}:{},0]},heading:{content:"inline*",group:"block",attrs:{level:{default:1},...s},defining:!0,parseDOM:[1,2,3,4,5,6].map(t=>({tag:`h${t}`,attrs:{level:t}})),toDOM(t){const e=t.attrs.align?{style:`text-align:${t.attrs.align}`}:{};return[`h${t.attrs.level}`,e,0]}},bullet_list:{group:"block",content:"list_item+",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]},ordered_list:{group:"block",content:"list_item+",attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:t=>({order:Number(t.getAttribute("start")??1)})}],toDOM:t=>1===t.attrs.order?["ol",0]:["ol",{start:t.attrs.order},0]},list_item:{content:"paragraph block*",defining:!0,attrs:{checked:{default:null}},parseDOM:[{tag:"li",getAttrs:t=>{const e=t,n=e.querySelector("input[type=checkbox]");if(n)return{checked:n.checked};const r=e.getAttribute("data-checked");return{checked:null===r?null:"true"===r}}}],toDOM:t=>null!==t.attrs.checked?["li",{"data-checked":String(t.attrs.checked)},0]:["li",0]},blockquote:{content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:()=>["blockquote",0]},code_block:{content:"text*",group:"block",marks:"",defining:!0,attrs:{language:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:t=>{const e=t.querySelector("code"),n=/language-([\w-]+)/.exec(e?.className??"");return{language:n?n[1]:""}}}],toDOM:t=>["pre",{"data-language":t.attrs.language},["code",0]]},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:()=>["br"]},image:{inline:!0,group:"inline",draggable:!0,attrs:{src:{},alt:{default:null},title:{default:null}},parseDOM:[{tag:"img[src]",getAttrs:t=>{const e=t;return{src:e.getAttribute("src"),alt:e.getAttribute("alt"),title:e.getAttribute("title")}}}],toDOM(t){const{src:e,alt:n,title:r}=t.attrs,o={src:e};return n&&(o.alt=n),r&&(o.title=r),["img",o]}},text:{group:"inline"},...o},c={strong:{parseDOM:[{tag:"strong"},{tag:"b"},{style:"font-weight=bold"}],toDOM:()=>["strong",0]},em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]},strike:{parseDOM:[{tag:"s"},{tag:"del"},{tag:"strike"}],toDOM:()=>["s",0]},code:{parseDOM:[{tag:"code",getAttrs:t=>"PRE"!==t.parentElement?.tagName&&null}],toDOM:()=>["code",0]},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:t=>{const e=t;return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM(t){const{href:e,title:n}=t.attrs;return["a",{href:e,title:n,rel:"noopener noreferrer",target:"_blank"},0]}}},l=new r.Sj({nodes:a,marks:c});n.d(e,["Y",0,l])}}]);
|