md-editor-v3 4.19.0-0 → 4.19.0-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.
@@ -2088,7 +2088,7 @@ const createAutocompletion = (completions) => {
2088
2088
  options: [
2089
2089
  // 标题
2090
2090
  ...["h2", "h3", "h4", "h5", "h6"].map((key, index2) => {
2091
- const label = new Array(index2 + 1).fill("#").join("");
2091
+ const label = new Array(index2 + 2).fill("#").join("");
2092
2092
  return {
2093
2093
  label,
2094
2094
  type: "text",
@@ -2087,7 +2087,7 @@ const createAutocompletion = (completions) => {
2087
2087
  options: [
2088
2088
  // 标题
2089
2089
  ...["h2", "h3", "h4", "h5", "h6"].map((key, index) => {
2090
- const label = new Array(index + 1).fill("#").join("");
2090
+ const label = new Array(index + 2).fill("#").join("");
2091
2091
  return {
2092
2092
  label,
2093
2093
  type: "text",
package/lib/umd/index.js CHANGED
@@ -86,7 +86,7 @@ ${(s==null?void 0:s.journey)||`journey
86
86
  `,r=3,o=10-i.length;break}case"katexInline":{i="$$",r=1,o=-1;break}case"katexBlock":{i=`$$
87
87
 
88
88
  $$
89
- `,r=3,o=-4;break}case"universal":{const{generate:c}=n,f=c(l);i=f.targetValue,a=f.select??!0,r=f.deviationStart||0,o=f.deviationEnd||0}}return{text:i,options:{select:a,deviationStart:r,deviationEnd:o,replaceAll:O}}},jV="#e5c07b",Vk="var(--md-color)",AV="#56b6c2",GV="#ffffff",Vl="var(--md-color)",Ck="#e5c07b",IV="#e5c07b",DV="var(--md-color)",jk="#d19a66",NV="#c678dd",LV="#21252b",FV="#2c313a",Ak="var(--md-bk-color)",Zm="var(--md-bk-color)",MV="#ceedfa33",Gk="#528bff",BV=te.theme({"&":{color:Vl,backgroundColor:Ak},".cm-content":{caretColor:Gk},".cm-cursor, .cm-dropCursor":{borderLeftColor:Gk},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:MV},".cm-panels":{backgroundColor:LV,color:Vl},".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:Ak,color:Vl,borderRight:"1px solid",borderColor:"var(--md-border-color)"},".cm-activeLineGutter":{backgroundColor:FV},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"1px solid var(--md-border-color)",backgroundColor:Zm},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Zm,borderBottomColor:Zm},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{color:Vl}}},{dark:!0}),HV=Ca.define([{tag:d.keyword,color:NV},{tag:[d.name,d.deleted,d.character,d.propertyName,d.macroName],color:Vk},{tag:[d.function(d.variableName),d.labelName],color:IV},{tag:[d.color,d.constant(d.name),d.standard(d.name)],color:jk},{tag:[d.definition(d.name),d.separator],color:Vl},{tag:[d.typeName,d.className,d.number,d.changed,d.annotation,d.modifier,d.self,d.namespace],color:jV},{tag:[d.operator,d.operatorKeyword,d.url,d.escape,d.regexp,d.link,d.special(d.string)],color:AV},{tag:[d.meta,d.comment],color:Ck},{tag:d.strong,fontWeight:"bold"},{tag:d.emphasis,fontStyle:"italic"},{tag:d.strikethrough,textDecoration:"line-through"},{tag:d.link,color:Ck,textDecoration:"underline"},{tag:d.heading,fontWeight:"bold",color:Vk},{tag:[d.atom,d.bool,d.special(d.variableName)],color:jk},{tag:[d.processingInstruction,d.string,d.inserted],color:DV},{tag:d.invalid,color:GV}]),Ik=[BV,cS(HV)],KV="#e5c07b",Dk="#3f4a54",JV="#56b6c2",e3="#fff",Cl="#3f4a54",Nk="#2d8cf0",t3="#2d8cf0",n3="#3f4a54",Lk="#d19a66",i3="#c678dd",r3="#f6f6f6",o3="#ceedfa33",Fk="var(--md-bk-color)",Um="var(--md-bk-color)",a3="#bad5fa",Mk="#3f4a54",O3=te.theme({"&":{color:Cl,backgroundColor:Fk},".cm-content":{caretColor:Mk},".cm-cursor, .cm-dropCursor":{borderLeftColor:Mk},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:a3},".cm-panels":{backgroundColor:r3,color:Cl},".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:Fk,color:Cl,borderRight:"1px solid",borderColor:"var(--md-border-color)"},".cm-activeLineGutter":{backgroundColor:o3},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"1px solid var(--md-border-color)",backgroundColor:Um},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Um,borderBottomColor:Um},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{color:Cl}}}),l3=Ca.define([{tag:d.keyword,color:i3},{tag:[d.name,d.deleted,d.character,d.propertyName,d.macroName],color:Dk},{tag:[d.function(d.variableName),d.labelName],color:t3},{tag:[d.color,d.constant(d.name),d.standard(d.name)],color:Lk},{tag:[d.definition(d.name),d.separator],color:Cl},{tag:[d.typeName,d.className,d.number,d.changed,d.annotation,d.modifier,d.self,d.namespace],color:KV},{tag:[d.operator,d.operatorKeyword,d.url,d.escape,d.regexp,d.link,d.special(d.string)],color:JV},{tag:[d.meta,d.comment],color:Nk},{tag:d.strong,fontWeight:"bold"},{tag:d.emphasis,fontStyle:"italic"},{tag:d.strikethrough,textDecoration:"line-through"},{tag:d.link,color:Nk,textDecoration:"underline"},{tag:d.heading,fontWeight:"bold",color:Dk},{tag:[d.atom,d.bool,d.special(d.variableName)],color:Lk},{tag:[d.processingInstruction,d.string,d.inserted],color:n3},{tag:d.invalid,color:e3}]),Bk=[O3,cS(l3)],_c=(e,t,n,i,r)=>(o,a,O,l)=>{const s=`${e}${t}`.slice(l-O);o.dispatch(o.state.replaceSelection(`${s}${n}${i}`));const u=O+a.label.length+(r==="title"?n.length:0);o.dispatch({selection:j.create([j.range(O+a.label.length+(r==="title"?1:-t.length),u),j.cursor(u)],1)}),o.focus()},Hk=e=>(t,n,i,r)=>{const o=e.slice(r-i);t.dispatch(t.state.replaceSelection(`${o} `))},Kk=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+1).fill("#").join("");return{label:a,type:"text",apply:Hk(a)}}),...["unchecked","checked"].map(r=>{const o=r==="checked"?"- [x]":"- [ ]";return{label:o,type:"text",apply:Hk(o)}}),...[["`",""],["```","language"],["```mermaid\n",""]].map(r=>({label:`${r[0]}${r[1]}`,type:"text",apply:_c(r[0],r[1],"",r[0]==="`"?"`":"\n```","type")})),{label:"[]()",type:"text"},{label:"![]()",type:"text"},{label:"| |",type:"text",detail:"table",apply:`| col | col | col |
89
+ `,r=3,o=-4;break}case"universal":{const{generate:c}=n,f=c(l);i=f.targetValue,a=f.select??!0,r=f.deviationStart||0,o=f.deviationEnd||0}}return{text:i,options:{select:a,deviationStart:r,deviationEnd:o,replaceAll:O}}},jV="#e5c07b",Vk="var(--md-color)",AV="#56b6c2",GV="#ffffff",Vl="var(--md-color)",Ck="#e5c07b",IV="#e5c07b",DV="var(--md-color)",jk="#d19a66",NV="#c678dd",LV="#21252b",FV="#2c313a",Ak="var(--md-bk-color)",Zm="var(--md-bk-color)",MV="#ceedfa33",Gk="#528bff",BV=te.theme({"&":{color:Vl,backgroundColor:Ak},".cm-content":{caretColor:Gk},".cm-cursor, .cm-dropCursor":{borderLeftColor:Gk},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:MV},".cm-panels":{backgroundColor:LV,color:Vl},".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:Ak,color:Vl,borderRight:"1px solid",borderColor:"var(--md-border-color)"},".cm-activeLineGutter":{backgroundColor:FV},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"1px solid var(--md-border-color)",backgroundColor:Zm},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Zm,borderBottomColor:Zm},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{color:Vl}}},{dark:!0}),HV=Ca.define([{tag:d.keyword,color:NV},{tag:[d.name,d.deleted,d.character,d.propertyName,d.macroName],color:Vk},{tag:[d.function(d.variableName),d.labelName],color:IV},{tag:[d.color,d.constant(d.name),d.standard(d.name)],color:jk},{tag:[d.definition(d.name),d.separator],color:Vl},{tag:[d.typeName,d.className,d.number,d.changed,d.annotation,d.modifier,d.self,d.namespace],color:jV},{tag:[d.operator,d.operatorKeyword,d.url,d.escape,d.regexp,d.link,d.special(d.string)],color:AV},{tag:[d.meta,d.comment],color:Ck},{tag:d.strong,fontWeight:"bold"},{tag:d.emphasis,fontStyle:"italic"},{tag:d.strikethrough,textDecoration:"line-through"},{tag:d.link,color:Ck,textDecoration:"underline"},{tag:d.heading,fontWeight:"bold",color:Vk},{tag:[d.atom,d.bool,d.special(d.variableName)],color:jk},{tag:[d.processingInstruction,d.string,d.inserted],color:DV},{tag:d.invalid,color:GV}]),Ik=[BV,cS(HV)],KV="#e5c07b",Dk="#3f4a54",JV="#56b6c2",e3="#fff",Cl="#3f4a54",Nk="#2d8cf0",t3="#2d8cf0",n3="#3f4a54",Lk="#d19a66",i3="#c678dd",r3="#f6f6f6",o3="#ceedfa33",Fk="var(--md-bk-color)",Um="var(--md-bk-color)",a3="#bad5fa",Mk="#3f4a54",O3=te.theme({"&":{color:Cl,backgroundColor:Fk},".cm-content":{caretColor:Mk},".cm-cursor, .cm-dropCursor":{borderLeftColor:Mk},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:a3},".cm-panels":{backgroundColor:r3,color:Cl},".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:Fk,color:Cl,borderRight:"1px solid",borderColor:"var(--md-border-color)"},".cm-activeLineGutter":{backgroundColor:o3},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"1px solid var(--md-border-color)",backgroundColor:Um},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Um,borderBottomColor:Um},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{color:Cl}}}),l3=Ca.define([{tag:d.keyword,color:i3},{tag:[d.name,d.deleted,d.character,d.propertyName,d.macroName],color:Dk},{tag:[d.function(d.variableName),d.labelName],color:t3},{tag:[d.color,d.constant(d.name),d.standard(d.name)],color:Lk},{tag:[d.definition(d.name),d.separator],color:Cl},{tag:[d.typeName,d.className,d.number,d.changed,d.annotation,d.modifier,d.self,d.namespace],color:KV},{tag:[d.operator,d.operatorKeyword,d.url,d.escape,d.regexp,d.link,d.special(d.string)],color:JV},{tag:[d.meta,d.comment],color:Nk},{tag:d.strong,fontWeight:"bold"},{tag:d.emphasis,fontStyle:"italic"},{tag:d.strikethrough,textDecoration:"line-through"},{tag:d.link,color:Nk,textDecoration:"underline"},{tag:d.heading,fontWeight:"bold",color:Dk},{tag:[d.atom,d.bool,d.special(d.variableName)],color:Lk},{tag:[d.processingInstruction,d.string,d.inserted],color:n3},{tag:d.invalid,color:e3}]),Bk=[O3,cS(l3)],_c=(e,t,n,i,r)=>(o,a,O,l)=>{const s=`${e}${t}`.slice(l-O);o.dispatch(o.state.replaceSelection(`${s}${n}${i}`));const u=O+a.label.length+(r==="title"?n.length:0);o.dispatch({selection:j.create([j.range(O+a.label.length+(r==="title"?1:-t.length),u),j.cursor(u)],1)}),o.focus()},Hk=e=>(t,n,i,r)=>{const o=e.slice(r-i);t.dispatch(t.state.replaceSelection(`${o} `))},Kk=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:Hk(a)}}),...["unchecked","checked"].map(r=>{const o=r==="checked"?"- [x]":"- [ ]";return{label:o,type:"text",apply:Hk(o)}}),...[["`",""],["```","language"],["```mermaid\n",""]].map(r=>({label:`${r[0]}${r[1]}`,type:"text",apply:_c(r[0],r[1],"",r[0]==="`"?"`":"\n```","type")})),{label:"[]()",type:"text"},{label:"![]()",type:"text"},{label:"| |",type:"text",detail:"table",apply:`| col | col | col |
90
90
  | - | - | - |
91
91
  | content | content | content |
92
92
  | content | content | content |`},{label:"$",type:"text",apply:_c("$","","","$","type")},{label:"$$",type:"text",apply:_c("$$","",`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "md-editor-v3",
3
- "version": "4.19.0-0",
3
+ "version": "4.19.0-1",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "vue",