md-editor-v3 5.6.0 → 5.6.1
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/lib/cjs/MdEditor.cjs
CHANGED
|
@@ -1899,10 +1899,10 @@ const oneLight = [
|
|
|
1899
1899
|
];
|
|
1900
1900
|
const getPairApply = (flag, type, title, suffix, selectType) => {
|
|
1901
1901
|
return (view2, _completion, from, to) => {
|
|
1902
|
-
const
|
|
1903
|
-
view2.dispatch(view2.state.replaceSelection(`${label}${title}${suffix}`));
|
|
1902
|
+
const insert = `${flag}${type}${title}${suffix}`;
|
|
1904
1903
|
const newTo = from + _completion.label.length + (selectType === "title" ? title.length : 0);
|
|
1905
1904
|
view2.dispatch({
|
|
1905
|
+
changes: { from, to, insert },
|
|
1906
1906
|
selection: state.EditorSelection.create(
|
|
1907
1907
|
[
|
|
1908
1908
|
state.EditorSelection.range(
|
package/lib/cjs/chunks/index.cjs
CHANGED
|
@@ -666,7 +666,7 @@ const codetabs = (md, _opts) => {
|
|
|
666
666
|
<div class="${config.prefix}-code-action">
|
|
667
667
|
<span class="${config.prefix}-code-lang">${tokens[idx].info.trim()}</span>
|
|
668
668
|
<span class="${config.prefix}-copy-button" data-tips="${codeCodeText}"${isIcon ? " data-is-icon=true" : ""}>${copyBtnHtml}</span>
|
|
669
|
-
${_opts.extraTools || ""}
|
|
669
|
+
${_opts.extraTools instanceof Function ? _opts.extraTools({ lang: tokens[idx].info.trim() }) : _opts.extraTools || ""}
|
|
670
670
|
${tagContainer2 === "details" ? collapseTips : ""}
|
|
671
671
|
</div>
|
|
672
672
|
</${tagHeader2}>
|
|
@@ -735,7 +735,7 @@ const codetabs = (md, _opts) => {
|
|
|
735
735
|
<div class="${config.prefix}-code-action">
|
|
736
736
|
<span class="${config.prefix}-codetab-lang">${langs}</span>
|
|
737
737
|
<span class="${config.prefix}-copy-button" data-tips="${codeCodeText}"${isIcon ? " data-is-icon=true" : ""}>${copyBtnHtml}</span>
|
|
738
|
-
${_opts.extraTools || ""}
|
|
738
|
+
${_opts.extraTools instanceof Function ? _opts.extraTools({ lang: tokens[idx].info.trim() }) : _opts.extraTools || ""}
|
|
739
739
|
${tagContainer === "details" ? collapseTips : ""}
|
|
740
740
|
</div>
|
|
741
741
|
</${tagHeader}>
|
package/lib/es/MdEditor.mjs
CHANGED
|
@@ -1898,10 +1898,10 @@ const oneLight = [
|
|
|
1898
1898
|
];
|
|
1899
1899
|
const getPairApply = (flag, type, title, suffix, selectType) => {
|
|
1900
1900
|
return (view, _completion, from, to) => {
|
|
1901
|
-
const
|
|
1902
|
-
view.dispatch(view.state.replaceSelection(`${label}${title}${suffix}`));
|
|
1901
|
+
const insert = `${flag}${type}${title}${suffix}`;
|
|
1903
1902
|
const newTo = from + _completion.label.length + (selectType === "title" ? title.length : 0);
|
|
1904
1903
|
view.dispatch({
|
|
1904
|
+
changes: { from, to, insert },
|
|
1905
1905
|
selection: EditorSelection.create(
|
|
1906
1906
|
[
|
|
1907
1907
|
EditorSelection.range(
|
package/lib/es/chunks/index.mjs
CHANGED
|
@@ -665,7 +665,7 @@ const codetabs = (md, _opts) => {
|
|
|
665
665
|
<div class="${prefix}-code-action">
|
|
666
666
|
<span class="${prefix}-code-lang">${tokens[idx].info.trim()}</span>
|
|
667
667
|
<span class="${prefix}-copy-button" data-tips="${codeCodeText}"${isIcon ? " data-is-icon=true" : ""}>${copyBtnHtml}</span>
|
|
668
|
-
${_opts.extraTools || ""}
|
|
668
|
+
${_opts.extraTools instanceof Function ? _opts.extraTools({ lang: tokens[idx].info.trim() }) : _opts.extraTools || ""}
|
|
669
669
|
${tagContainer2 === "details" ? collapseTips : ""}
|
|
670
670
|
</div>
|
|
671
671
|
</${tagHeader2}>
|
|
@@ -734,7 +734,7 @@ const codetabs = (md, _opts) => {
|
|
|
734
734
|
<div class="${prefix}-code-action">
|
|
735
735
|
<span class="${prefix}-codetab-lang">${langs}</span>
|
|
736
736
|
<span class="${prefix}-copy-button" data-tips="${codeCodeText}"${isIcon ? " data-is-icon=true" : ""}>${copyBtnHtml}</span>
|
|
737
|
-
${_opts.extraTools || ""}
|
|
737
|
+
${_opts.extraTools instanceof Function ? _opts.extraTools({ lang: tokens[idx].info.trim() }) : _opts.extraTools || ""}
|
|
738
738
|
${tagContainer === "details" ? collapseTips : ""}
|
|
739
739
|
</div>
|
|
740
740
|
</${tagHeader}>
|
|
@@ -15,7 +15,9 @@ export interface CodeTabsPluginOps extends markdownit.Options {
|
|
|
15
15
|
codeFoldable: boolean;
|
|
16
16
|
autoFoldThreshold: number;
|
|
17
17
|
customIconRef: ComputedRef<CustomIcon>;
|
|
18
|
-
extraTools?: string
|
|
18
|
+
extraTools?: string | (({ lang }: {
|
|
19
|
+
lang: string;
|
|
20
|
+
}) => string);
|
|
19
21
|
}
|
|
20
22
|
declare const codetabs: (md: markdownit, _opts: CodeTabsPluginOps) => void;
|
|
21
23
|
export default codetabs;
|
package/lib/umd/index.js
CHANGED
|
@@ -240,7 +240,7 @@ dateFormat YYYY-MM-DD`,class:`classDiagram
|
|
|
240
240
|
| Column`;for(let o=0;o<=i;o++)r+=" |";r+=`
|
|
241
241
|
|`;for(let o=0;o<=i;o++)r+=" - |";for(let o=0;o<=n;o++){r+=`
|
|
242
242
|
|`;for(let a=0;a<=i;a++)r+=" |"}return r+=`
|
|
243
|
-
`,{text:r,options:{deviationStart:3,deviationEnd:10-r.length}}},MZ=(e,t)=>{const{generate:n}=t,i=n(e);return{text:i.targetValue,options:{select:i.select??!0,deviationStart:i.deviationStart||0,deviationEnd:i.deviationEnd||0}}},Km=(e,t={wholeLine:!1})=>{const n=e.view.state,i=n.selection.main;if(i.empty){const r=n.doc.lineAt(i.from);return[n.doc.lineAt(i.from).text,r.from,r.to]}else if(t.wholeLine){const r=n.doc.lineAt(i.from),o=n.doc.lineAt(i.to);return[n.doc.sliceString(r.from,o.to),r.from,o.to]}return[n.doc.sliceString(i.from,i.to),i.from,i.to]},FZ="#e5c07b",nx="var(--md-color)",BZ="#56b6c2",HZ="#ffffff",Hl="var(--md-color)",ix="#e5c07b",KZ="#e5c07b",JZ="var(--md-color)",rx="#d19a66",e6="#c678dd",t6="#21252b",n6="#2c313a",ox="var(--md-bk-color)",Jm="var(--md-bk-color)",i6="#ceedfa33",ax="#528bff",r6=te.theme({"&":{color:Hl,backgroundColor:ox},".cm-content":{caretColor:ax},".cm-cursor, .cm-dropCursor":{borderLeftColor:ax},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:i6},".cm-panels":{backgroundColor:t6,color:Hl},".cm-panels.cm-panels-top":{borderBottom:"1px solid var(--md-border-color)"},".cm-panels.cm-panels-bottom":{borderTop:"1px solid var(--md-border-color)"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#ceedfa33"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:ox,color:Hl,borderRight:"1px solid",borderColor:"var(--md-border-color)"},".cm-activeLineGutter":{backgroundColor:n6},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"1px solid var(--md-border-color)",backgroundColor:Jm},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Jm,borderBottomColor:Jm},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{color:Hl}}},{dark:!0}),o6=wl.define([{tag:h.keyword,color:e6},{tag:[h.name,h.deleted,h.character,h.propertyName,h.macroName],color:nx},{tag:[h.function(h.variableName),h.labelName],color:KZ},{tag:[h.color,h.constant(h.name),h.standard(h.name)],color:rx},{tag:[h.definition(h.name),h.separator],color:Hl},{tag:[h.typeName,h.className,h.number,h.changed,h.annotation,h.modifier,h.self,h.namespace],color:FZ},{tag:[h.operator,h.operatorKeyword,h.url,h.escape,h.regexp,h.link,h.special(h.string)],color:BZ},{tag:[h.meta,h.comment],color:ix},{tag:h.strong,fontWeight:"bold"},{tag:h.emphasis,fontStyle:"italic"},{tag:h.strikethrough,textDecoration:"line-through"},{tag:h.link,color:ix,textDecoration:"underline"},{tag:h.heading,fontWeight:"bold",color:nx},{tag:[h.atom,h.bool,h.special(h.variableName)],color:rx},{tag:[h.processingInstruction,h.string,h.inserted],color:JZ},{tag:h.invalid,color:HZ}]),Ox=[r6,vS(o6)],a6="#e5c07b",lx="var(--md-color)",O6="#56b6c2",l6="#fff",Kl="#3f4a54",sx="#2d8cf0",s6="#2d8cf0",u6="#3f4a54",ux="#d19a66",c6="#c678dd",f6="#f6f6f6",d6="#ceedfa33",cx="var(--md-bk-color)",eg="var(--md-bk-color)",h6="#bad5fa",fx="#3f4a54",p6=te.theme({"&":{color:Kl,backgroundColor:cx},".cm-content":{caretColor:fx},".cm-cursor, .cm-dropCursor":{borderLeftColor:fx},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:h6},".cm-panels":{backgroundColor:f6,color:Kl},".cm-panels.cm-panels-top":{borderBottom:"1px solid var(--md-border-color)"},".cm-panels.cm-panels-bottom":{borderTop:"1px solid var(--md-border-color)"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#ceedfa33"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:cx,color:Kl,borderRight:"1px solid",borderColor:"var(--md-border-color)"},".cm-activeLineGutter":{backgroundColor:d6},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"1px solid var(--md-border-color)",backgroundColor:eg},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:eg,borderBottomColor:eg},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{color:Kl}}}),m6=wl.define([{tag:h.keyword,color:c6},{tag:[h.name,h.deleted,h.character,h.propertyName,h.macroName],color:lx},{tag:[h.function(h.variableName),h.labelName],color:s6},{tag:[h.color,h.constant(h.name),h.standard(h.name)],color:ux},{tag:[h.definition(h.name),h.separator],color:Kl},{tag:[h.typeName,h.className,h.number,h.changed,h.annotation,h.modifier,h.self,h.namespace],color:a6},{tag:[h.operator,h.operatorKeyword,h.url,h.escape,h.regexp,h.link,h.special(h.string)],color:O6},{tag:[h.meta,h.comment],color:sx},{tag:h.strong,fontWeight:"bold"},{tag:h.emphasis,fontStyle:"italic"},{tag:h.strikethrough,textDecoration:"line-through"},{tag:h.link,color:sx,textDecoration:"underline"},{tag:h.heading,fontWeight:"bold",color:lx},{tag:[h.atom,h.bool,h.special(h.variableName)],color:ux},{tag:[h.processingInstruction,h.string,h.inserted],color:u6},{tag:h.invalid,color:l6}]),dx=[p6,vS(m6)],Cc=(e,t,n,i,r)=>(o,a,O,l)=>{const s=`${e}${t}
|
|
243
|
+
`,{text:r,options:{deviationStart:3,deviationEnd:10-r.length}}},MZ=(e,t)=>{const{generate:n}=t,i=n(e);return{text:i.targetValue,options:{select:i.select??!0,deviationStart:i.deviationStart||0,deviationEnd:i.deviationEnd||0}}},Km=(e,t={wholeLine:!1})=>{const n=e.view.state,i=n.selection.main;if(i.empty){const r=n.doc.lineAt(i.from);return[n.doc.lineAt(i.from).text,r.from,r.to]}else if(t.wholeLine){const r=n.doc.lineAt(i.from),o=n.doc.lineAt(i.to);return[n.doc.sliceString(r.from,o.to),r.from,o.to]}return[n.doc.sliceString(i.from,i.to),i.from,i.to]},FZ="#e5c07b",nx="var(--md-color)",BZ="#56b6c2",HZ="#ffffff",Hl="var(--md-color)",ix="#e5c07b",KZ="#e5c07b",JZ="var(--md-color)",rx="#d19a66",e6="#c678dd",t6="#21252b",n6="#2c313a",ox="var(--md-bk-color)",Jm="var(--md-bk-color)",i6="#ceedfa33",ax="#528bff",r6=te.theme({"&":{color:Hl,backgroundColor:ox},".cm-content":{caretColor:ax},".cm-cursor, .cm-dropCursor":{borderLeftColor:ax},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:i6},".cm-panels":{backgroundColor:t6,color:Hl},".cm-panels.cm-panels-top":{borderBottom:"1px solid var(--md-border-color)"},".cm-panels.cm-panels-bottom":{borderTop:"1px solid var(--md-border-color)"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#ceedfa33"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:ox,color:Hl,borderRight:"1px solid",borderColor:"var(--md-border-color)"},".cm-activeLineGutter":{backgroundColor:n6},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"1px solid var(--md-border-color)",backgroundColor:Jm},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Jm,borderBottomColor:Jm},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{color:Hl}}},{dark:!0}),o6=wl.define([{tag:h.keyword,color:e6},{tag:[h.name,h.deleted,h.character,h.propertyName,h.macroName],color:nx},{tag:[h.function(h.variableName),h.labelName],color:KZ},{tag:[h.color,h.constant(h.name),h.standard(h.name)],color:rx},{tag:[h.definition(h.name),h.separator],color:Hl},{tag:[h.typeName,h.className,h.number,h.changed,h.annotation,h.modifier,h.self,h.namespace],color:FZ},{tag:[h.operator,h.operatorKeyword,h.url,h.escape,h.regexp,h.link,h.special(h.string)],color:BZ},{tag:[h.meta,h.comment],color:ix},{tag:h.strong,fontWeight:"bold"},{tag:h.emphasis,fontStyle:"italic"},{tag:h.strikethrough,textDecoration:"line-through"},{tag:h.link,color:ix,textDecoration:"underline"},{tag:h.heading,fontWeight:"bold",color:nx},{tag:[h.atom,h.bool,h.special(h.variableName)],color:rx},{tag:[h.processingInstruction,h.string,h.inserted],color:JZ},{tag:h.invalid,color:HZ}]),Ox=[r6,vS(o6)],a6="#e5c07b",lx="var(--md-color)",O6="#56b6c2",l6="#fff",Kl="#3f4a54",sx="#2d8cf0",s6="#2d8cf0",u6="#3f4a54",ux="#d19a66",c6="#c678dd",f6="#f6f6f6",d6="#ceedfa33",cx="var(--md-bk-color)",eg="var(--md-bk-color)",h6="#bad5fa",fx="#3f4a54",p6=te.theme({"&":{color:Kl,backgroundColor:cx},".cm-content":{caretColor:fx},".cm-cursor, .cm-dropCursor":{borderLeftColor:fx},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:h6},".cm-panels":{backgroundColor:f6,color:Kl},".cm-panels.cm-panels-top":{borderBottom:"1px solid var(--md-border-color)"},".cm-panels.cm-panels-bottom":{borderTop:"1px solid var(--md-border-color)"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#ceedfa33"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:cx,color:Kl,borderRight:"1px solid",borderColor:"var(--md-border-color)"},".cm-activeLineGutter":{backgroundColor:d6},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"1px solid var(--md-border-color)",backgroundColor:eg},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:eg,borderBottomColor:eg},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{color:Kl}}}),m6=wl.define([{tag:h.keyword,color:c6},{tag:[h.name,h.deleted,h.character,h.propertyName,h.macroName],color:lx},{tag:[h.function(h.variableName),h.labelName],color:s6},{tag:[h.color,h.constant(h.name),h.standard(h.name)],color:ux},{tag:[h.definition(h.name),h.separator],color:Kl},{tag:[h.typeName,h.className,h.number,h.changed,h.annotation,h.modifier,h.self,h.namespace],color:a6},{tag:[h.operator,h.operatorKeyword,h.url,h.escape,h.regexp,h.link,h.special(h.string)],color:O6},{tag:[h.meta,h.comment],color:sx},{tag:h.strong,fontWeight:"bold"},{tag:h.emphasis,fontStyle:"italic"},{tag:h.strikethrough,textDecoration:"line-through"},{tag:h.link,color:sx,textDecoration:"underline"},{tag:h.heading,fontWeight:"bold",color:lx},{tag:[h.atom,h.bool,h.special(h.variableName)],color:ux},{tag:[h.processingInstruction,h.string,h.inserted],color:u6},{tag:h.invalid,color:l6}]),dx=[p6,vS(m6)],Cc=(e,t,n,i,r)=>(o,a,O,l)=>{const s=`${e}${t}${n}${i}`,u=O+a.label.length+(r==="title"?n.length:0);o.dispatch({changes:{from:O,to:l,insert:s},selection:A.create([A.range(O+a.label.length+(r==="title"?1:-t.length),u),A.cursor(u)],1)}),o.focus()},hx=e=>(t,n,i,r)=>{const o=e.slice(r-i);t.dispatch(t.state.replaceSelection(`${o} `))},px=e=>{const t=n=>{const i=n.matchBefore(/^#+|^-\s*\[*\s*\]*|`+|\[|!\[*|^\|\s?\|?|\$\$?|!+\s*\w*/);return i===null||i.from==i.to&&n.explicit?null:{from:i.from,options:[...["h2","h3","h4","h5","h6"].map((r,o)=>{const a=new Array(o+2).fill("#").join("");return{label:a,type:"text",apply:hx(a)}}),...["unchecked","checked"].map(r=>{const o=r==="checked"?"- [x]":"- [ ]";return{label:o,type:"text",apply:hx(o)}}),...[["`",""],["```","language"],["```mermaid\n",""]].map(r=>({label:`${r[0]}${r[1]}`,type:"text",apply:Cc(r[0],r[1],"",r[0]==="`"?"`":"\n```","type")})),{label:"[]()",type:"text"},{label:"![]()",type:"text"},{label:"| |",type:"text",detail:"table",apply:`| col | col | col |
|
|
244
244
|
| - | - | - |
|
|
245
245
|
| content | content | content |
|
|
246
246
|
| content | content | content |`},{label:"$",type:"text",apply:Cc("$","","","$","type")},{label:"$$",type:"text",apply:Cc("$$","",`
|
|
@@ -273,7 +273,7 @@ See: https://github.com/francoischalifour/medium-zoom`)}},S6=function(t){var n=d
|
|
|
273
273
|
<div class="${X}-code-action">
|
|
274
274
|
<span class="${X}-code-lang">${c[f].info.trim()}</span>
|
|
275
275
|
<span class="${X}-copy-button" data-tips="${b}"${Q?" data-is-icon=true":""}>${g}</span>
|
|
276
|
-
${t.extraTools||""}
|
|
276
|
+
${t.extraTools instanceof Function?t.extraTools({lang:c[f].info.trim()}):t.extraTools||""}
|
|
277
277
|
${D==="details"?S:""}
|
|
278
278
|
</div>
|
|
279
279
|
</${I}>
|
|
@@ -319,7 +319,7 @@ See: https://github.com/francoischalifour/medium-zoom`)}},S6=function(t){var n=d
|
|
|
319
319
|
<div class="${X}-code-action">
|
|
320
320
|
<span class="${X}-codetab-lang">${V}</span>
|
|
321
321
|
<span class="${X}-copy-button" data-tips="${b}"${Q?" data-is-icon=true":""}>${g}</span>
|
|
322
|
-
${t.extraTools||""}
|
|
322
|
+
${t.extraTools instanceof Function?t.extraTools({lang:c[f].info.trim()}):t.extraTools||""}
|
|
323
323
|
${Y==="details"?S:""}
|
|
324
324
|
</div>
|
|
325
325
|
</${_}>
|