codemirror-editor-vue3
Advanced tools
Comparing version 0.1.0-beat to 0.1.0-beta
@@ -1,1 +0,1 @@ | ||
var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,l=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,i=(e,t)=>{for(var n in t||(t={}))o.call(t,n)&&l(e,n,t[n]);if(r)for(var n of r(t))a.call(t,n)&&l(e,n,t[n]);return e};import{defineComponent as c,ref as s,onMounted as u,markRaw as d,watch as p,openBlock as m,createElementBlock as g,computed as f,getCurrentInstance as h,onBeforeUnmount as v,normalizeClass as b,createBlock as y,resolveDynamicComponent as w,mergeProps as x,nextTick as O}from"vue";import"codemirror/lib/codemirror.css";import"codemirror/mode/css/css.js";import*as j from"codemirror";import S from"codemirror";import"codemirror/addon/merge/merge.css";import"codemirror/addon/merge/merge.js";import k from"diff-match-patch";import"codemirror/addon/mode/simple.js";import*as $ from"codemirror/lib/codemirror.js";const C=window.CodeMirror||S;"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");const n=Object(e);for(let r=1;r<arguments.length;r++){const e=arguments[r];if(null!=e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}return n},writable:!0,configurable:!0});const M=c({name:"codemirror",props:{code:String,value:String,content:String,options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})},placeholder:{type:String,default:""}},emits:["update:cminstance","ready"],setup(e,{emit:t}){const n=s(),r=s(null),o=()=>{r.value=d(C.fromTextArea(n.value,e.options)),t("update:cminstance",d(r.value));let o=null;o=p((()=>e.cminstance),((n,a)=>{n&&e.cminstance.setValue(e.code||e.value||e.content),t("ready",r),o()}),{deep:!0})};return u((()=>{o()})),{initialize:o,textarea:n}}}),E=["name","placeholder"];M.render=function(e,t,n,r,o,a){return m(),g("textarea",{ref:"textarea",name:e.$props.name,placeholder:e.$props.placeholder},null,8,E)};const I=window.CodeMirror||S;window.diff_match_patch=k,window.DIFF_DELETE=-1,window.DIFF_INSERT=1,window.DIFF_EQUAL=0;const N=c({name:"mergemode",props:{options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})},height:{type:[String,Number],default:null}},emits:["update:cminstance","ready"],setup(e,{emit:t}){const n=s(null),r=s(null),o=String(e.height).replace("px","")+"px",a=()=>{n.value=d(I.MergeView(r.value,e.options)),t("update:cminstance",d(n.value.edit)),document.querySelector(".CodeMirror-merge").style.height=o,document.querySelector(".CodeMirror-merge-right .CodeMirror").style.height=o,t("ready",n)};return u((()=>{a()})),{mergeView:r,initialize:a}}}),F={ref:"mergeView"};var T,A;function P(){const e=new Date;return`${e.getHours()<10?"0"+e.getHours():e.getHours()}:${e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes()}:${e.getSeconds()<10?"0"+e.getSeconds():e.getSeconds()}`}function V(e){return`#link#${JSON.stringify(e)}#link#`}function D(e){const t=/#link#(.+)#link#/g;let n,r=[];for(n=t.exec(e);n;){const o=document.createElement("a"),a=JSON.parse(n[1]),l=Object.entries(a);for(let[e,t]of l)o.setAttribute(e,t);o.className="editor_custom_link",o.innerHTML="logDownload",r.push({start:n.index,end:n.index+n[0].length,node:o}),n=t.exec(e)}return r}function L(e="",t="info"){return`#log<${t}>log#${e}#log<${t}>log#`}function _(e){let t=[];return function(){const n=new RegExp("#log<(\\w*)>log#((.|\r\n|\n)*?)#log<(\\w*)>log#","g");let r;for(r=n.exec(e),console.log(r);r;){let o=r[0].replace(/\r\n/g,"\n").split("\n"),a=r[2].replace(/\r\n/g,"\n").split("\n");const l=document.createElement("span");let i=r[1];console.log(i),l.className=`c-editor--log__${i}`;let c=0;for(let e=0;e<o.length;e++){let n=o[e],i=a[e],s=l.cloneNode(!1);s.innerText=i,t.push({start:r.index+c,end:r.index+c+n.length,node:s}),c=c+n.length+1}r=n.exec(e)}}(),t}function R(e,t=""){return`[${P()}] <${t}> ${e}`}function z(e="",t=20,n="="){const r=Math.floor(1.5*e.length/2);const o=new Array(Math.max(t-r,5)).join(n);return`${o}${e}${o}`}N.render=function(e,t,n,r,o,a){return m(),g("div",F,null,512)},(A=T||(T={})).info="info",A.warning="warning",A.error="error";const B=[{regex:/(\[.*?\])([ \t]*)(<error>)/,token:["tag",null,"error.strong"],sol:!0,next:"error"},{regex:/(\[.*?\])([ \t]*)(<info>)/,token:["tag",null,"bracket"],sol:!0,next:"info"},{regex:/(\[.*?\])([ \t]*)(<warning>)/,token:["tag",null,"comment"],sol:!0,next:"warning"}];j.defineSimpleMode("fclog",{start:[...B,{regex:/.*/,token:"hr"}],error:[...B,{regex:/.*/,token:"error.strong"}],info:[...B,{regex:/.*/,token:"bracket"}],warning:[...B,{regex:/.*/,token:"comment"}]}),$.defineSimpleMode("log",{start:[{regex:/^[=]+[^=]*[=]+/,token:"strong"},{regex:/([^\w])([A-Z][\w]*)/,token:[null,"string"]},{regex:/(^[A-Z][\w]*)/,token:"string"}]});const H=window.CodeMirror||S,U=c({name:"codemirror-fclog",props:{code:String,value:String,content:String,options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})},placeholder:{type:String,default:""},KeepCursorInEnd:{type:Boolean,default:!0}},emits:["update:cminstance","ready"],setup(e,{emit:t}){const n=s(),r=s(null),o=f((()=>e.KeepCursorInEnd)),a=(t=e.cminstance)=>{t.getAllMarks().forEach((e=>e.clear()));const n=t.getValue(),r=[].concat(D(n)).concat(_(n));for(let e=0;e<r.length;e++){const n=r[e];t.markText(t.posFromIndex(n.start),t.posFromIndex(n.end),{replacedWith:n.node})}},l=()=>{r.value=d(H.fromTextArea(n.value,e.options)),t("update:cminstance",d(r.value)),r.value.on("change",(t=>{a(),o&&Promise.resolve().then((()=>{let t=e.cminstance.getScrollInfo();e.cminstance.scrollTo(t.left,t.height)}))}))};return p((()=>e.cminstance),(n=>{n&&(a(e.cminstance),e.cminstance.setValue(e.code||e.value||e.content),t("ready",r))}),{deep:!0,immediate:!0}),u((()=>{l()})),{initialize:l,textarea:n}}}),W=["name","placeholder"];U.render=function(e,t,n,r,o,a){return m(),g("textarea",{ref:"textarea",name:e.$props.name,placeholder:e.$props.placeholder},null,8,W)};"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");const n=Object(e);for(let r=1;r<arguments.length;r++){const e=arguments[r];if(null!=e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}return n},writable:!0,configurable:!0});const q={mode:"text",theme:"default",lineNumbers:!0,smartIndent:!0,indentUnit:2,gutters:["CodeMirror-linenumbers"],foldGutter:!0,matchBrackets:!0,autoCloseBrackets:!0},G=["update:value","change","ready"],J=c({name:"CodemirrorEditor",props:{code:String,value:String,marker:Function,unseenLines:Array,name:{type:String,default:""},placeholder:{type:String,default:""},merge:{type:Boolean,default:!1},options:{type:Object,default:()=>({})},globalOptions:{type:Object,default:()=>({})},border:{type:Boolean,default:!1},width:{type:[String,Number],default:null},height:{type:[String,Number],default:null}},emits:[...G,"changes","scroll","beforeChange","cursorActivity","keyHandled","inputRead","electricInput","beforeSelectionChange","viewportChange","swapDoc","gutterClick","gutterContextMenu","focus","blur","refresh","optionChange","scrollCursorIntoView","update"],components:{Default:M,Merge:N,FcLog:U},setup(e,t){var n,r;const o=s(null),a=s(""),l=s(),c=s(Object.assign(i({},q),e.globalOptions,e.options)),u=h(),d=s(null),m=(t=e.width,n=e.height)=>{o.value.setSize(t,n)},g=()=>{void 0!==e.unseenLines&&void 0!==marker&&e.unseenLines.forEach((e=>{const t=o.value.lineInfo(e);o.value.setGutterMarker(e,"breakpoints",t.gutterMarkers?null:marker())}))},{listenerEvents:f}=function({cminstance:e,ctx:t,internalInstance:n,content:r}){const o=()=>{let e=[];return Object.keys(n.vnode.props).forEach((t=>{if(t.startsWith("on")){let n=t.replace(t[2],t[2].toLowerCase()).slice(2);!G.includes(n)&&e.push(n)}})),e};return{listenerEvents:()=>{e.value.on("change",(e=>{r.value=e.getValue(),t.emit("update:value",r.value),t.emit("change",r.value,e)}));const n={};return o().filter((e=>!n[e]&&(n[e]=!0))).forEach((n=>{e.value.on(n,((...e)=>{t.emit(n,...e)}))}))}}}({cminstance:o,ctx:t,internalInstance:u,content:a});p((()=>e.options),(t=>{for(const n in e.options)o.value.setOption(n,t[n])}),{deep:!0}),p((()=>e.value),(e=>{(e=>{if(e!==o.value.getValue()){const t=o.value.getScrollInfo();o.value.setValue(e),a.value=e,o.value.scrollTo(t.left,t.top)}g()})(e)}));return p((()=>e.merge),(t=>{"fclog"!=e.options.mode&&"log"!=e.options.mode?e.merge?l.value="Merge":l.value="default":l.value="FcLg"}),{immediate:!0}),v((()=>{(()=>{const e=o.value.doc.cm.getWrapperElement();null==e||e.remove()})()})),{presetModeName:l,cmOptions:c,cminstance:o,content:a,ready:e=>{f(),g(),m(),O((()=>{o.value.refresh()})),t.emit("ready",o.value)},resize:m,instanceName:null==(r=null==(n=null==u?void 0:u.parent)?void 0:n.type)?void 0:r.name,presetRef:d}}});J.render=function(e,r,o,a,l,c){return m(),g("div",{class:b(["codemirror-container",{merge:e.$props.merge,bordered:e.$props.border,"width-auto":!e.$props.width||"100%"==e.$props.width,"height-auto":!e.$props.height||"100%"==e.$props.height}])},[(m(),y(w(e.presetModeName),x({ref:"presetRef",cminstance:e.cminstance,"onUpdate:cminstance":r[0]||(r[0]=t=>e.cminstance=t)},(s=i(i({},e.$props),e.$attrs),u={options:e.cmOptions,name:e.instanceName,content:e.content},t(s,n(u))),{onReady:e.ready}),null,16,["cminstance","onReady"]))],2);var s,u};var K={Codemirror:J,install:(e,t)=>(t&&(t.options&&(J.props.globalOptions.default=()=>t.options),t.events&&(J.props.globalEvents.default=()=>t.events)),e.component("Codemirror",J),e)};export{J as Codemirror,V as createLinkMark,R as createLog,L as createLogMark,z as createTitle,K as default,D as getLinkMark,P as getLocalTime,_ as getLogMark}; | ||
var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,l=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,i=(e,t)=>{for(var n in t||(t={}))o.call(t,n)&&l(e,n,t[n]);if(r)for(var n of r(t))a.call(t,n)&&l(e,n,t[n]);return e};import c from"codemirror";import"codemirror/lib/codemirror.css";import{defineComponent as s,ref as u,onMounted as p,markRaw as d,watch as m,openBlock as g,createElementBlock as f,computed as h,getCurrentInstance as v,onBeforeUnmount as y,normalizeClass as b,normalizeStyle as w,createBlock as x,resolveDynamicComponent as O,mergeProps as S}from"vue";import"codemirror/addon/merge/merge.css";import"codemirror/addon/merge/merge.js";import k from"diff-match-patch";import"codemirror/addon/mode/simple.js";import*as j from"codemirror/lib/codemirror.js";const $=window.CodeMirror||c,E=s({name:"codemirror",props:{code:String,value:String,content:String,options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})},placeholder:{type:String,default:""}},emits:["update:cminstance","ready"],setup(e,{emit:t}){const n=u(),r=u(null),o=()=>{r.value=d($.fromTextArea(n.value,e.options)),t("update:cminstance",d(r.value));let o=null;o=m((()=>e.cminstance),((n,a)=>{n&&e.cminstance.setValue(e.code||e.value||e.content),t("ready",r),o()}),{deep:!0})};return p((()=>{o()})),{initialize:o,textarea:n}}}),M=["name","placeholder"];E.render=function(e,t,n,r,o,a){return g(),f("textarea",{ref:"textarea",name:e.$props.name,placeholder:e.$props.placeholder},null,8,M)};const C=window.CodeMirror||c;window.diff_match_patch=k,window.DIFF_DELETE=-1,window.DIFF_INSERT=1,window.DIFF_EQUAL=0;const I=s({name:"mergemode",props:{options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})},height:{type:[String,Number],default:null}},emits:["update:cminstance","ready"],setup(e,{emit:t}){const n=u(null),r=u(null);String(e.height).replace("px","");const o=()=>{n.value=d(C.MergeView(r.value,e.options)),t("update:cminstance",d(n.value.edit)),t("ready",n)};return p((()=>{o()})),{mergeView:r,initialize:o}}}),N={ref:"mergeView"};var A,F;function L(){const e=new Date;return`${e.getHours()<10?"0"+e.getHours():e.getHours()}:${e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes()}:${e.getSeconds()<10?"0"+e.getSeconds():e.getSeconds()}`}function T(e){return`#link#${JSON.stringify(e)}#link#`}function V(e){const t=/#link#(.+)#link#/g;let n,r=[];for(n=t.exec(e);n;){const o=document.createElement("a"),a=JSON.parse(n[1]),l=Object.entries(a);for(let[e,t]of l)o.setAttribute(e,t);o.className="editor_custom_link",o.innerHTML="logDownload",r.push({start:n.index,end:n.index+n[0].length,node:o}),n=t.exec(e)}return r}function D(e="",t="info"){return`#log<${t}>log#${e}#log<${t}>log#`}function _(e){let t=[];return function(){const n=new RegExp("#log<(\\w*)>log#((.|\r\n|\n)*?)#log<(\\w*)>log#","g");let r;for(r=n.exec(e),console.log(r);r;){let o=r[0].replace(/\r\n/g,"\n").split("\n"),a=r[2].replace(/\r\n/g,"\n").split("\n");const l=document.createElement("span");let i=r[1];console.log(i),l.className=`c-editor--log__${i}`;let c=0;for(let e=0;e<o.length;e++){let n=o[e],i=a[e],s=l.cloneNode(!1);s.innerText=i,t.push({start:r.index+c,end:r.index+c+n.length,node:s}),c=c+n.length+1}r=n.exec(e)}}(),t}function P(e,t=""){return`[${L()}] <${t}> ${e}`}function H(e="",t=20,n="="){const r=Math.floor(1.5*e.length/2);const o=new Array(Math.max(t-r,5)).join(n);return`${o}${e}${o}`}I.render=function(e,t,n,r,o,a){return g(),f("div",N,null,512)},(F=A||(A={})).info="info",F.warning="warning",F.error="error";const R=[{regex:/(\[.*?\])([ \t]*)(<error>)/,token:["tag",null,"error.strong"],sol:!0,next:"error"},{regex:/(\[.*?\])([ \t]*)(<info>)/,token:["tag",null,"bracket"],sol:!0,next:"info"},{regex:/(\[.*?\])([ \t]*)(<warning>)/,token:["tag",null,"comment"],sol:!0,next:"warning"}];c.defineSimpleMode("fclog",{start:[...R,{regex:/.*/,token:"hr"}],error:[...R,{regex:/.*/,token:"error.strong"}],info:[...R,{regex:/.*/,token:"bracket"}],warning:[...R,{regex:/.*/,token:"comment"}]}),j.defineSimpleMode("log",{start:[{regex:/^[=]+[^=]*[=]+/,token:"strong"},{regex:/([^\w])([A-Z][\w]*)/,token:[null,"string"]},{regex:/(^[A-Z][\w]*)/,token:"string"}]});const B=window.CodeMirror||c,z=s({name:"codemirror-fclog",props:{code:String,value:String,content:String,options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})},placeholder:{type:String,default:""},KeepCursorInEnd:{type:Boolean,default:!0}},emits:["update:cminstance","ready"],setup(e,{emit:t}){const n=u(),r=u(null),o=h((()=>e.KeepCursorInEnd)),a=(t=e.cminstance)=>{t.getAllMarks().forEach((e=>e.clear()));const n=t.getValue(),r=[].concat(V(n)).concat(_(n));for(let e=0;e<r.length;e++){const n=r[e];t.markText(t.posFromIndex(n.start),t.posFromIndex(n.end),{replacedWith:n.node})}},l=()=>{r.value=d(B.fromTextArea(n.value,e.options)),t("update:cminstance",d(r.value)),r.value.on("change",(t=>{a(),o&&Promise.resolve().then((()=>{let t=e.cminstance.getScrollInfo();e.cminstance.scrollTo(t.left,t.height)}))}))};return m((()=>e.cminstance),(n=>{n&&(a(e.cminstance),e.cminstance.setValue(e.code||e.value||e.content),t("ready",r))}),{deep:!0,immediate:!0}),p((()=>{l()})),{initialize:l,textarea:n}}}),W=["name","placeholder"];z.render=function(e,t,n,r,o,a){return g(),f("textarea",{ref:"textarea",name:e.$props.name,placeholder:e.$props.placeholder},null,8,W)},"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");const n=Object(e);for(let r=1;r<arguments.length;r++){const e=arguments[r];if(null!=e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}return n},writable:!0,configurable:!0});const K={mode:"text",theme:"default",lineNumbers:!0,smartIndent:!0,indentUnit:2,foldGutter:!0,matchBrackets:!0,autoCloseBrackets:!0,styleActiveLine:!0},U=["update:value","change","ready"],G=s({name:"CodemirrorEditor",props:{code:String,value:String,marker:Function,unseenLines:Array,name:{type:String,default:""},placeholder:{type:String,default:""},merge:{type:Boolean,default:!1},options:{type:Object,default:()=>({})},globalOptions:{type:Object,default:()=>({})},border:{type:Boolean,default:!1},width:{type:[String,Number],default:null},height:{type:[String,Number],default:null},KeepCursorInEnd:{type:Boolean,default:!1}},emits:[...U,"changes","scroll","beforeChange","cursorActivity","keyHandled","inputRead","electricInput","beforeSelectionChange","viewportChange","swapDoc","gutterClick","gutterContextMenu","focus","blur","refresh","optionChange","scrollCursorIntoView","update"],components:{Default:E,Merge:I,FcLog:z},setup(e,t){var n,r;const o=u(null),a=u(""),l=u(),c=u(Object.assign(i({},K),e.globalOptions,e.options)),s=v(),p=u(null),d=u(null),g=u(null),f=(t=e.width,n=e.height)=>{d.value=String(t).replace("px",""),g.value=String(n).replace("px","");let r=g.value;e.merge&&(r-=2),o.value.setSize(d.value,r)},h=()=>{void 0!==e.unseenLines&&void 0!==marker&&e.unseenLines.forEach((e=>{const t=o.value.lineInfo(e);o.value.setGutterMarker(e,"breakpoints",t.gutterMarkers?null:marker())}))},{listenerEvents:b}=function({cminstance:e,ctx:t,internalInstance:n,content:r}){const o=()=>{let e=[];return Object.keys(n.vnode.props).forEach((t=>{if(t.startsWith("on")){let n=t.replace(t[2],t[2].toLowerCase()).slice(2);!U.includes(n)&&e.push(n)}})),e};return{listenerEvents:()=>{e.value.on("change",(e=>{const n=e.getValue();n!=r.value&&(r.value=n,t.emit("update:value",r.value),t.emit("change",r.value,e))}));const n={};return o().filter((e=>!n[e]&&(n[e]=!0))).forEach((n=>{e.value.on(n,((...e)=>{t.emit(n,...e)}))}))}}}({cminstance:o,ctx:t,internalInstance:s,content:a});m((()=>e.options),(t=>{for(const n in e.options)o.value.setOption(n,t[n])}),{deep:!0}),m((()=>e.value),(e=>{(e=>{if(e!==o.value.getValue()){const t=o.value.getScrollInfo();o.value.setValue(e),a.value=e,o.value.scrollTo(t.left,t.top)}h()})(e)}));return m((()=>e.merge),(t=>{"fclog"!=e.options.mode&&"log"!=e.options.mode?e.merge?l.value="Merge":l.value="default":l.value="FcLog"}),{immediate:!0}),y((()=>{(()=>{const e=o.value.doc.cm.getWrapperElement();null==e||e.remove()})()})),{presetModeName:l,cmOptions:c,cminstance:o,content:a,ready:n=>{b(),h(),f(),t.emit("ready",o.value),m([()=>e.height,()=>e.width],(([e,t])=>{f(e,t)}),{deep:!0})},resize:f,containerWidth:d,containerHeight:g,instanceName:e.name||(null==(r=null==(n=null==s?void 0:s.parent)?void 0:n.type)?void 0:r.name)+"-cm",presetRef:p}}});G.render=function(e,r,o,a,l,c){return g(),f("div",{class:b(["codemirror-container",{merge:e.$props.merge,bordered:!e.$props.merge&&e.$props.border,"width-auto":!e.$props.width||"100%"==e.$props.width,"height-auto":!e.$props.height||"100%"==e.$props.height}]),style:w({height:e.containerHeight+"px"})},[(g(),x(O(e.presetModeName),S({style:{height:"100%"},ref:"presetRef",cminstance:e.cminstance,"onUpdate:cminstance":r[0]||(r[0]=t=>e.cminstance=t)},(s=i(i({},e.$props),e.$attrs),u={options:e.cmOptions,name:e.instanceName,content:e.content},t(s,n(u))),{onReady:e.ready}),null,16,["cminstance","onReady"]))],6);var s,u};G.install=(e,t)=>(t&&(t.options&&(G.props.globalOptions.default=()=>t.options),t.events&&(G.props.globalEvents.default=()=>t.events)),e.component("Codemirror",G),e);export{G as Codemirror,T as createLinkMark,P as createLog,D as createLogMark,H as createTitle,G as default,V as getLinkMark,L as getLocalTime,_ as getLogMark}; |
@@ -1,1 +0,1 @@ | ||
var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,r)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues=(e,t)=>{for(var r in t||(t={}))__hasOwnProp.call(t,r)&&__defNormalProp(e,r,t[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))__propIsEnum.call(t,r)&&__defNormalProp(e,r,t[r]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("codemirror/lib/codemirror.css"),require("codemirror/mode/css/css.js"),require("codemirror"),require("codemirror/addon/merge/merge.css"),require("codemirror/addon/merge/merge.js"),require("diff-match-patch"),require("codemirror/addon/mode/simple.js"),require("codemirror/lib/codemirror.js")):"function"==typeof define&&define.amd?define(["exports","vue","codemirror/lib/codemirror.css","codemirror/mode/css/css.js","codemirror","codemirror/addon/merge/merge.css","codemirror/addon/merge/merge.js","diff-match-patch","codemirror/addon/mode/simple.js","codemirror/lib/codemirror.js"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["codemirror-editor-vue3"]={},e.vue,null,null,e._CodeMirror,null,null,e.DiffMatchPatch,null,e.codemirror)}(this,(function(e,t,r,n,o,a,l,i,c,s){"use strict";function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(e){if(e&&e.__esModule)return e;var t={__proto__:null,[Symbol.toStringTag]:"Module"};return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var p=u(o),m=d(o),f=u(i),g=d(s);const h=window.CodeMirror||p.default;"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");const r=Object(e);for(let n=1;n<arguments.length;n++){const e=arguments[n];if(null!=e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}return r},writable:!0,configurable:!0});const b=t.defineComponent({name:"codemirror",props:{code:String,value:String,content:String,options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})},placeholder:{type:String,default:""}},emits:["update:cminstance","ready"],setup(e,{emit:r}){const n=t.ref(),o=t.ref(null),a=()=>{o.value=t.markRaw(h.fromTextArea(n.value,e.options)),r("update:cminstance",t.markRaw(o.value));let a=null;a=t.watch((()=>e.cminstance),((t,n)=>{t&&e.cminstance.setValue(e.code||e.value||e.content),r("ready",o),a()}),{deep:!0})};return t.onMounted((()=>{a()})),{initialize:a,textarea:n}}}),v=["name","placeholder"];b.render=function(e,r,n,o,a,l){return t.openBlock(),t.createElementBlock("textarea",{ref:"textarea",name:e.$props.name,placeholder:e.$props.placeholder},null,8,v)};const y=window.CodeMirror||p.default;window.diff_match_patch=f.default,window.DIFF_DELETE=-1,window.DIFF_INSERT=1,window.DIFF_EQUAL=0;const w=t.defineComponent({name:"mergemode",props:{options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})},height:{type:[String,Number],default:null}},emits:["update:cminstance","ready"],setup(e,{emit:r}){const n=t.ref(null),o=t.ref(null),a=String(e.height).replace("px","")+"px",l=()=>{n.value=t.markRaw(y.MergeView(o.value,e.options)),r("update:cminstance",t.markRaw(n.value.edit)),document.querySelector(".CodeMirror-merge").style.height=a,document.querySelector(".CodeMirror-merge-right .CodeMirror").style.height=a,r("ready",n)};return t.onMounted((()=>{l()})),{mergeView:o,initialize:l}}}),_={ref:"mergeView"};var k,O;function j(){const e=new Date;return`${e.getHours()<10?"0"+e.getHours():e.getHours()}:${e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes()}:${e.getSeconds()<10?"0"+e.getSeconds():e.getSeconds()}`}function x(e){const t=/#link#(.+)#link#/g;let r,n=[];for(r=t.exec(e);r;){const o=document.createElement("a"),a=JSON.parse(r[1]),l=Object.entries(a);for(let[e,t]of l)o.setAttribute(e,t);o.className="editor_custom_link",o.innerHTML="logDownload",n.push({start:r.index,end:r.index+r[0].length,node:o}),r=t.exec(e)}return n}function S(e){let t=[];return function(){const r=new RegExp("#log<(\\w*)>log#((.|\r\n|\n)*?)#log<(\\w*)>log#","g");let n;for(n=r.exec(e),console.log(n);n;){let o=n[0].replace(/\r\n/g,"\n").split("\n"),a=n[2].replace(/\r\n/g,"\n").split("\n");const l=document.createElement("span");let i=n[1];console.log(i),l.className=`c-editor--log__${i}`;let c=0;for(let e=0;e<o.length;e++){let r=o[e],i=a[e],s=l.cloneNode(!1);s.innerText=i,t.push({start:n.index+c,end:n.index+c+r.length,node:s}),c=c+r.length+1}n=r.exec(e)}}(),t}w.render=function(e,r,n,o,a,l){return t.openBlock(),t.createElementBlock("div",_,null,512)},(O=k||(k={})).info="info",O.warning="warning",O.error="error";const M=[{regex:/(\[.*?\])([ \t]*)(<error>)/,token:["tag",null,"error.strong"],sol:!0,next:"error"},{regex:/(\[.*?\])([ \t]*)(<info>)/,token:["tag",null,"bracket"],sol:!0,next:"info"},{regex:/(\[.*?\])([ \t]*)(<warning>)/,token:["tag",null,"comment"],sol:!0,next:"warning"}];m.defineSimpleMode("fclog",{start:[...M,{regex:/.*/,token:"hr"}],error:[...M,{regex:/.*/,token:"error.strong"}],info:[...M,{regex:/.*/,token:"bracket"}],warning:[...M,{regex:/.*/,token:"comment"}]}),g.defineSimpleMode("log",{start:[{regex:/^[=]+[^=]*[=]+/,token:"strong"},{regex:/([^\w])([A-Z][\w]*)/,token:[null,"string"]},{regex:/(^[A-Z][\w]*)/,token:"string"}]});const C=window.CodeMirror||p.default,P=t.defineComponent({name:"codemirror-fclog",props:{code:String,value:String,content:String,options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})},placeholder:{type:String,default:""},KeepCursorInEnd:{type:Boolean,default:!0}},emits:["update:cminstance","ready"],setup(e,{emit:r}){const n=t.ref(),o=t.ref(null),a=t.computed((()=>e.KeepCursorInEnd)),l=(t=e.cminstance)=>{t.getAllMarks().forEach((e=>e.clear()));const r=t.getValue(),n=[].concat(x(r)).concat(S(r));for(let e=0;e<n.length;e++){const r=n[e];t.markText(t.posFromIndex(r.start),t.posFromIndex(r.end),{replacedWith:r.node})}},i=()=>{o.value=t.markRaw(C.fromTextArea(n.value,e.options)),r("update:cminstance",t.markRaw(o.value)),o.value.on("change",(t=>{l(),a&&Promise.resolve().then((()=>{let t=e.cminstance.getScrollInfo();e.cminstance.scrollTo(t.left,t.height)}))}))};return t.watch((()=>e.cminstance),(t=>{t&&(l(e.cminstance),e.cminstance.setValue(e.code||e.value||e.content),r("ready",o))}),{deep:!0,immediate:!0}),t.onMounted((()=>{i()})),{initialize:i,textarea:n}}}),E=["name","placeholder"];P.render=function(e,r,n,o,a,l){return t.openBlock(),t.createElementBlock("textarea",{ref:"textarea",name:e.$props.name,placeholder:e.$props.placeholder},null,8,E)};"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");const r=Object(e);for(let n=1;n<arguments.length;n++){const e=arguments[n];if(null!=e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}return r},writable:!0,configurable:!0});const $={mode:"text",theme:"default",lineNumbers:!0,smartIndent:!0,indentUnit:2,gutters:["CodeMirror-linenumbers"],foldGutter:!0,matchBrackets:!0,autoCloseBrackets:!0},I=["update:value","change","ready"],T=t.defineComponent({name:"CodemirrorEditor",props:{code:String,value:String,marker:Function,unseenLines:Array,name:{type:String,default:""},placeholder:{type:String,default:""},merge:{type:Boolean,default:!1},options:{type:Object,default:()=>({})},globalOptions:{type:Object,default:()=>({})},border:{type:Boolean,default:!1},width:{type:[String,Number],default:null},height:{type:[String,Number],default:null}},emits:[...I,"changes","scroll","beforeChange","cursorActivity","keyHandled","inputRead","electricInput","beforeSelectionChange","viewportChange","swapDoc","gutterClick","gutterContextMenu","focus","blur","refresh","optionChange","scrollCursorIntoView","update"],components:{Default:b,Merge:w,FcLog:P},setup(e,r){var n,o;const a=t.ref(null),l=t.ref(""),i=t.ref(),c=t.ref(Object.assign(__spreadValues({},$),e.globalOptions,e.options)),s=t.getCurrentInstance(),u=t.ref(null),d=(t=e.width,r=e.height)=>{a.value.setSize(t,r)},p=()=>{void 0!==e.unseenLines&&void 0!==marker&&e.unseenLines.forEach((e=>{const t=a.value.lineInfo(e);a.value.setGutterMarker(e,"breakpoints",t.gutterMarkers?null:marker())}))},{listenerEvents:m}=function({cminstance:e,ctx:t,internalInstance:r,content:n}){const o=()=>{let e=[];return Object.keys(r.vnode.props).forEach((t=>{if(t.startsWith("on")){let r=t.replace(t[2],t[2].toLowerCase()).slice(2);!I.includes(r)&&e.push(r)}})),e};return{listenerEvents:()=>{e.value.on("change",(e=>{n.value=e.getValue(),t.emit("update:value",n.value),t.emit("change",n.value,e)}));const r={};return o().filter((e=>!r[e]&&(r[e]=!0))).forEach((r=>{e.value.on(r,((...e)=>{t.emit(r,...e)}))}))}}}({cminstance:a,ctx:r,internalInstance:s,content:l});t.watch((()=>e.options),(t=>{for(const r in e.options)a.value.setOption(r,t[r])}),{deep:!0}),t.watch((()=>e.value),(e=>{(e=>{if(e!==a.value.getValue()){const t=a.value.getScrollInfo();a.value.setValue(e),l.value=e,a.value.scrollTo(t.left,t.top)}p()})(e)}));return t.watch((()=>e.merge),(t=>{"fclog"!=e.options.mode&&"log"!=e.options.mode?e.merge?i.value="Merge":i.value="default":i.value="FcLg"}),{immediate:!0}),t.onBeforeUnmount((()=>{(()=>{const e=a.value.doc.cm.getWrapperElement();null==e||e.remove()})()})),{presetModeName:i,cmOptions:c,cminstance:a,content:l,ready:e=>{m(),p(),d(),t.nextTick((()=>{a.value.refresh()})),r.emit("ready",a.value)},resize:d,instanceName:null==(o=null==(n=null==s?void 0:s.parent)?void 0:n.type)?void 0:o.name,presetRef:u}}});T.render=function(e,r,n,o,a,l){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["codemirror-container",{merge:e.$props.merge,bordered:e.$props.border,"width-auto":!e.$props.width||"100%"==e.$props.width,"height-auto":!e.$props.height||"100%"==e.$props.height}])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.presetModeName),t.mergeProps({ref:"presetRef",cminstance:e.cminstance,"onUpdate:cminstance":r[0]||(r[0]=t=>e.cminstance=t)},__spreadProps(__spreadValues(__spreadValues({},e.$props),e.$attrs),{options:e.cmOptions,name:e.instanceName,content:e.content}),{onReady:e.ready}),null,16,["cminstance","onReady"]))],2)};var N={Codemirror:T,install:(e,t)=>(t&&(t.options&&(T.props.globalOptions.default=()=>t.options),t.events&&(T.props.globalEvents.default=()=>t.events)),e.component("Codemirror",T),e)};e.Codemirror=T,e.createLinkMark=function(e){return`#link#${JSON.stringify(e)}#link#`},e.createLog=function(e,t=""){return`[${j()}] <${t}> ${e}`},e.createLogMark=function(e="",t="info"){return`#log<${t}>log#${e}#log<${t}>log#`},e.createTitle=function(e="",t=20,r="="){const n=Math.floor(1.5*e.length/2),o=new Array(Math.max(t-n,5)).join(r);return`${o}${e}${o}`},e.default=N,e.getLinkMark=x,e.getLocalTime=j,e.getLogMark=S,Object.defineProperty(e,"__esModule",{value:!0}),e[Symbol.toStringTag]="Module"})); | ||
var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("codemirror"),require("codemirror/lib/codemirror.css"),require("vue"),require("codemirror/addon/merge/merge.css"),require("codemirror/addon/merge/merge.js"),require("diff-match-patch"),require("codemirror/addon/mode/simple.js"),require("codemirror/lib/codemirror.js")):"function"==typeof define&&define.amd?define(["exports","codemirror","codemirror/lib/codemirror.css","vue","codemirror/addon/merge/merge.css","codemirror/addon/merge/merge.js","diff-match-patch","codemirror/addon/mode/simple.js","codemirror/lib/codemirror.js"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["codemirror-editor-vue3"]={},e.codemirror,null,e.Vue,null,null,e.DiffMatchPatch,null,e.codemirror)}(this,(function(e,t,n,r,o,a,l,i,c){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var t={__proto__:null,[Symbol.toStringTag]:"Module"};return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var d=s(t),p=s(l),m=u(c);const g=window.CodeMirror||d.default,f=r.defineComponent({name:"codemirror",props:{code:String,value:String,content:String,options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})},placeholder:{type:String,default:""}},emits:["update:cminstance","ready"],setup(e,{emit:t}){const n=r.ref(),o=r.ref(null),a=()=>{o.value=r.markRaw(g.fromTextArea(n.value,e.options)),t("update:cminstance",r.markRaw(o.value));let a=null;a=r.watch((()=>e.cminstance),((n,r)=>{n&&e.cminstance.setValue(e.code||e.value||e.content),t("ready",o),a()}),{deep:!0})};return r.onMounted((()=>{a()})),{initialize:a,textarea:n}}}),h=["name","placeholder"];f.render=function(e,t,n,o,a,l){return r.openBlock(),r.createElementBlock("textarea",{ref:"textarea",name:e.$props.name,placeholder:e.$props.placeholder},null,8,h)};const v=window.CodeMirror||d.default;window.diff_match_patch=p.default,window.DIFF_DELETE=-1,window.DIFF_INSERT=1,window.DIFF_EQUAL=0;const y=r.defineComponent({name:"mergemode",props:{options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})},height:{type:[String,Number],default:null}},emits:["update:cminstance","ready"],setup(e,{emit:t}){const n=r.ref(null),o=r.ref(null);String(e.height).replace("px","");const a=()=>{n.value=r.markRaw(v.MergeView(o.value,e.options)),t("update:cminstance",r.markRaw(n.value.edit)),t("ready",n)};return r.onMounted((()=>{a()})),{mergeView:o,initialize:a}}}),w={ref:"mergeView"};var b,_;function k(){const e=new Date;return`${e.getHours()<10?"0"+e.getHours():e.getHours()}:${e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes()}:${e.getSeconds()<10?"0"+e.getSeconds():e.getSeconds()}`}function O(e){const t=/#link#(.+)#link#/g;let n,r=[];for(n=t.exec(e);n;){const o=document.createElement("a"),a=JSON.parse(n[1]),l=Object.entries(a);for(let[e,t]of l)o.setAttribute(e,t);o.className="editor_custom_link",o.innerHTML="logDownload",r.push({start:n.index,end:n.index+n[0].length,node:o}),n=t.exec(e)}return r}function x(e){let t=[];return function(){const n=new RegExp("#log<(\\w*)>log#((.|\r\n|\n)*?)#log<(\\w*)>log#","g");let r;for(r=n.exec(e),console.log(r);r;){let o=r[0].replace(/\r\n/g,"\n").split("\n"),a=r[2].replace(/\r\n/g,"\n").split("\n");const l=document.createElement("span");let i=r[1];console.log(i),l.className=`c-editor--log__${i}`;let c=0;for(let e=0;e<o.length;e++){let n=o[e],i=a[e],s=l.cloneNode(!1);s.innerText=i,t.push({start:r.index+c,end:r.index+c+n.length,node:s}),c=c+n.length+1}r=n.exec(e)}}(),t}y.render=function(e,t,n,o,a,l){return r.openBlock(),r.createElementBlock("div",w,null,512)},(_=b||(b={})).info="info",_.warning="warning",_.error="error";const S=[{regex:/(\[.*?\])([ \t]*)(<error>)/,token:["tag",null,"error.strong"],sol:!0,next:"error"},{regex:/(\[.*?\])([ \t]*)(<info>)/,token:["tag",null,"bracket"],sol:!0,next:"info"},{regex:/(\[.*?\])([ \t]*)(<warning>)/,token:["tag",null,"comment"],sol:!0,next:"warning"}];d.default.defineSimpleMode("fclog",{start:[...S,{regex:/.*/,token:"hr"}],error:[...S,{regex:/.*/,token:"error.strong"}],info:[...S,{regex:/.*/,token:"bracket"}],warning:[...S,{regex:/.*/,token:"comment"}]}),m.defineSimpleMode("log",{start:[{regex:/^[=]+[^=]*[=]+/,token:"strong"},{regex:/([^\w])([A-Z][\w]*)/,token:[null,"string"]},{regex:/(^[A-Z][\w]*)/,token:"string"}]});const j=window.CodeMirror||d.default,M=r.defineComponent({name:"codemirror-fclog",props:{code:String,value:String,content:String,options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})},placeholder:{type:String,default:""},KeepCursorInEnd:{type:Boolean,default:!0}},emits:["update:cminstance","ready"],setup(e,{emit:t}){const n=r.ref(),o=r.ref(null),a=r.computed((()=>e.KeepCursorInEnd)),l=(t=e.cminstance)=>{t.getAllMarks().forEach((e=>e.clear()));const n=t.getValue(),r=[].concat(O(n)).concat(x(n));for(let e=0;e<r.length;e++){const n=r[e];t.markText(t.posFromIndex(n.start),t.posFromIndex(n.end),{replacedWith:n.node})}},i=()=>{o.value=r.markRaw(j.fromTextArea(n.value,e.options)),t("update:cminstance",r.markRaw(o.value)),o.value.on("change",(t=>{l(),a&&Promise.resolve().then((()=>{let t=e.cminstance.getScrollInfo();e.cminstance.scrollTo(t.left,t.height)}))}))};return r.watch((()=>e.cminstance),(n=>{n&&(l(e.cminstance),e.cminstance.setValue(e.code||e.value||e.content),t("ready",o))}),{deep:!0,immediate:!0}),r.onMounted((()=>{i()})),{initialize:i,textarea:n}}}),E=["name","placeholder"];M.render=function(e,t,n,o,a,l){return r.openBlock(),r.createElementBlock("textarea",{ref:"textarea",name:e.$props.name,placeholder:e.$props.placeholder},null,8,E)},"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");const n=Object(e);for(let r=1;r<arguments.length;r++){const e=arguments[r];if(null!=e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}return n},writable:!0,configurable:!0});const P={mode:"text",theme:"default",lineNumbers:!0,smartIndent:!0,indentUnit:2,foldGutter:!0,matchBrackets:!0,autoCloseBrackets:!0,styleActiveLine:!0},$=["update:value","change","ready"],C=r.defineComponent({name:"CodemirrorEditor",props:{code:String,value:String,marker:Function,unseenLines:Array,name:{type:String,default:""},placeholder:{type:String,default:""},merge:{type:Boolean,default:!1},options:{type:Object,default:()=>({})},globalOptions:{type:Object,default:()=>({})},border:{type:Boolean,default:!1},width:{type:[String,Number],default:null},height:{type:[String,Number],default:null},KeepCursorInEnd:{type:Boolean,default:!1}},emits:[...$,"changes","scroll","beforeChange","cursorActivity","keyHandled","inputRead","electricInput","beforeSelectionChange","viewportChange","swapDoc","gutterClick","gutterContextMenu","focus","blur","refresh","optionChange","scrollCursorIntoView","update"],components:{Default:f,Merge:y,FcLog:M},setup(e,t){var n,o;const a=r.ref(null),l=r.ref(""),i=r.ref(),c=r.ref(Object.assign(__spreadValues({},P),e.globalOptions,e.options)),s=r.getCurrentInstance(),u=r.ref(null),d=r.ref(null),p=r.ref(null),m=(t=e.width,n=e.height)=>{d.value=String(t).replace("px",""),p.value=String(n).replace("px","");let r=p.value;e.merge&&(r-=2),a.value.setSize(d.value,r)},g=()=>{void 0!==e.unseenLines&&void 0!==marker&&e.unseenLines.forEach((e=>{const t=a.value.lineInfo(e);a.value.setGutterMarker(e,"breakpoints",t.gutterMarkers?null:marker())}))},{listenerEvents:f}=function({cminstance:e,ctx:t,internalInstance:n,content:r}){const o=()=>{let e=[];return Object.keys(n.vnode.props).forEach((t=>{if(t.startsWith("on")){let n=t.replace(t[2],t[2].toLowerCase()).slice(2);!$.includes(n)&&e.push(n)}})),e};return{listenerEvents:()=>{e.value.on("change",(e=>{const n=e.getValue();n!=r.value&&(r.value=n,t.emit("update:value",r.value),t.emit("change",r.value,e))}));const n={};return o().filter((e=>!n[e]&&(n[e]=!0))).forEach((n=>{e.value.on(n,((...e)=>{t.emit(n,...e)}))}))}}}({cminstance:a,ctx:t,internalInstance:s,content:l});r.watch((()=>e.options),(t=>{for(const n in e.options)a.value.setOption(n,t[n])}),{deep:!0}),r.watch((()=>e.value),(e=>{(e=>{if(e!==a.value.getValue()){const t=a.value.getScrollInfo();a.value.setValue(e),l.value=e,a.value.scrollTo(t.left,t.top)}g()})(e)}));return r.watch((()=>e.merge),(t=>{"fclog"!=e.options.mode&&"log"!=e.options.mode?e.merge?i.value="Merge":i.value="default":i.value="FcLog"}),{immediate:!0}),r.onBeforeUnmount((()=>{(()=>{const e=a.value.doc.cm.getWrapperElement();null==e||e.remove()})()})),{presetModeName:i,cmOptions:c,cminstance:a,content:l,ready:n=>{f(),g(),m(),t.emit("ready",a.value),r.watch([()=>e.height,()=>e.width],(([e,t])=>{m(e,t)}),{deep:!0})},resize:m,containerWidth:d,containerHeight:p,instanceName:e.name||(null==(o=null==(n=null==s?void 0:s.parent)?void 0:n.type)?void 0:o.name)+"-cm",presetRef:u}}});C.render=function(e,t,n,o,a,l){return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["codemirror-container",{merge:e.$props.merge,bordered:!e.$props.merge&&e.$props.border,"width-auto":!e.$props.width||"100%"==e.$props.width,"height-auto":!e.$props.height||"100%"==e.$props.height}]),style:r.normalizeStyle({height:e.containerHeight+"px"})},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(e.presetModeName),r.mergeProps({style:{height:"100%"},ref:"presetRef",cminstance:e.cminstance,"onUpdate:cminstance":t[0]||(t[0]=t=>e.cminstance=t)},__spreadProps(__spreadValues(__spreadValues({},e.$props),e.$attrs),{options:e.cmOptions,name:e.instanceName,content:e.content}),{onReady:e.ready}),null,16,["cminstance","onReady"]))],6)};C.install=(e,t)=>(t&&(t.options&&(C.props.globalOptions.default=()=>t.options),t.events&&(C.props.globalEvents.default=()=>t.events)),e.component("Codemirror",C),e),e.Codemirror=C,e.createLinkMark=function(e){return`#link#${JSON.stringify(e)}#link#`},e.createLog=function(e,t=""){return`[${k()}] <${t}> ${e}`},e.createLogMark=function(e="",t="info"){return`#log<${t}>log#${e}#log<${t}>log#`},e.createTitle=function(e="",t=20,n="="){const r=Math.floor(1.5*e.length/2),o=new Array(Math.max(t-r,5)).join(n);return`${o}${e}${o}`},e.default=C,e.getLinkMark=O,e.getLocalTime=k,e.getLogMark=x,Object.defineProperty(e,"__esModule",{value:!0}),e[Symbol.toStringTag]="Module"})); |
{ | ||
"name": "codemirror-editor-vue3", | ||
"description": "CodeMirror component for Vue3", | ||
"version": "0.1.0-beta", | ||
"license": "MIT", | ||
"files": [ | ||
"dist" | ||
"dist", | ||
"./dist/style.css" | ||
], | ||
"main": "./dist/codemirror-editor-vue3.umd.js", | ||
"module": "./dist/codemirror-editor-vue3.es.js", | ||
"style": "./dist/style.css", | ||
"exports": { | ||
@@ -12,7 +17,8 @@ ".": { | ||
"require": "./dist/codemirror-editor-vue3.umd.js" | ||
}, | ||
"./dist/style.css": { | ||
"import": "./dist/style.css", | ||
"require": "./dist/style.css" | ||
} | ||
}, | ||
"description": "CodeMirror component for Vue3", | ||
"version": "0.1.0-beat", | ||
"license": "MIT", | ||
"private": false, | ||
@@ -23,6 +29,3 @@ "author": { | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/surmon-china/vue-codemirror/issues" | ||
}, | ||
"homepage": "https://github.com/surmon-china/vue-codemirror#readme", | ||
"homepage": "https://github.com/RennCheung/codemirror-editor-vue3", | ||
"unpkg": "dist/codemirror-editor-vue3.js", | ||
@@ -37,3 +40,3 @@ "jsnext:main": "dist/codemirror-editor-vue3.js", | ||
"type": "git", | ||
"url": "https://github.com/surmon-china/vue-codemirror.git" | ||
"url": "https://github.com/RennCheung/codemirror-editor-vue3" | ||
}, | ||
@@ -49,23 +52,19 @@ "keywords": [ | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"rollup": "rollup -c rollup.config.js", | ||
"unit": "cross-env BABEL_ENV=test NODE_ENV=testing karma start test/unit/karma.conf.js --watch", | ||
"test": "cross-env BABEL_ENV=test NODE_ENV=testing karma start test/unit/karma.conf.js --single-run", | ||
"lint": "eslint --ext .js,.vue src test/unit/specs", | ||
"finish": "npm run lint && npm test && npm run build", | ||
"publish": "git push && git push --tags && npm publish" | ||
"publish": "git push && git push --tags && npm publish", | ||
"docs-dev": "vitepress dev docs --open", | ||
"docs-build": "vitepress build docs", | ||
"docs-serve": "vitepress serve docs" | ||
}, | ||
"dependencies": { | ||
"codemirror": "^5.62.2", | ||
"diff-match-patch": "^1.0.5", | ||
"rollup-plugin-esbuild": "^4.5.0", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"rollup-plugin-vue": "^6.0.0" | ||
"codemirror": "^5.62.2" | ||
}, | ||
"devDependencies": { | ||
"vue": "^3.1.5", | ||
"less": "^4.1.1", | ||
"@vitejs/plugin-vue": "^1.4.0", | ||
"@vue/compiler-sfc": "^3.1.5", | ||
"@vue/compiler-sfc": "^3.2.2", | ||
"@vue/runtime-dom": "^3.2.2", | ||
"babel-plugin-import": "^1.13.3", | ||
"dedent": "^0.7.0", | ||
"eslint": "^7.23.0", | ||
@@ -77,4 +76,13 @@ "eslint-config-airbnb-base": "^14.2.1", | ||
"eslint-plugin-vue": "^7.14.0", | ||
"vite": "^2.4.4" | ||
"less": "^4.1.1", | ||
"rollup-plugin-esbuild": "^4.5.0", | ||
"rollup-plugin-postcss": "^4.0.1", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"rollup-plugin-vue": "^6.0.0", | ||
"vite": "^2.5.0-beta.2", | ||
"vite-plugin-vuedoc": "^3.1.3", | ||
"vitepress": "^0.16.1", | ||
"vue": "^3.2.2", | ||
"vue-tsc": "^0.2.2" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
2
85
23941
21
1
1
- Removedrollup-plugin-esbuild@^4.5.0
- Removedrollup-plugin-terser@^7.0.2
- Removedrollup-plugin-vue@^6.0.0
- Removed@babel/code-frame@7.26.2(transitive)
- Removed@babel/helper-string-parser@7.25.9(transitive)
- Removed@babel/helper-validator-identifier@7.25.9(transitive)
- Removed@babel/parser@7.26.5(transitive)
- Removed@babel/types@7.26.5(transitive)
- Removed@esbuild/aix-ppc64@0.24.2(transitive)
- Removed@esbuild/android-arm@0.24.2(transitive)
- Removed@esbuild/android-arm64@0.24.2(transitive)
- Removed@esbuild/android-x64@0.24.2(transitive)
- Removed@esbuild/darwin-arm64@0.24.2(transitive)
- Removed@esbuild/darwin-x64@0.24.2(transitive)
- Removed@esbuild/freebsd-arm64@0.24.2(transitive)
- Removed@esbuild/freebsd-x64@0.24.2(transitive)
- Removed@esbuild/linux-arm@0.24.2(transitive)
- Removed@esbuild/linux-arm64@0.24.2(transitive)
- Removed@esbuild/linux-ia32@0.24.2(transitive)
- Removed@esbuild/linux-loong64@0.24.2(transitive)
- Removed@esbuild/linux-mips64el@0.24.2(transitive)
- Removed@esbuild/linux-ppc64@0.24.2(transitive)
- Removed@esbuild/linux-riscv64@0.24.2(transitive)
- Removed@esbuild/linux-s390x@0.24.2(transitive)
- Removed@esbuild/linux-x64@0.24.2(transitive)
- Removed@esbuild/netbsd-arm64@0.24.2(transitive)
- Removed@esbuild/netbsd-x64@0.24.2(transitive)
- Removed@esbuild/openbsd-arm64@0.24.2(transitive)
- Removed@esbuild/openbsd-x64@0.24.2(transitive)
- Removed@esbuild/sunos-x64@0.24.2(transitive)
- Removed@esbuild/win32-arm64@0.24.2(transitive)
- Removed@esbuild/win32-ia32@0.24.2(transitive)
- Removed@esbuild/win32-x64@0.24.2(transitive)
- Removed@jridgewell/gen-mapping@0.3.8(transitive)
- Removed@jridgewell/resolve-uri@3.1.2(transitive)
- Removed@jridgewell/set-array@1.2.1(transitive)
- Removed@jridgewell/source-map@0.3.6(transitive)
- Removed@jridgewell/sourcemap-codec@1.5.0(transitive)
- Removed@jridgewell/trace-mapping@0.3.25(transitive)
- Removed@rollup/pluginutils@4.2.1(transitive)
- Removed@types/node@22.10.7(transitive)
- Removed@vue/compiler-core@3.5.13(transitive)
- Removed@vue/compiler-dom@3.5.13(transitive)
- Removed@vue/compiler-sfc@3.5.13(transitive)
- Removed@vue/compiler-ssr@3.5.13(transitive)
- Removed@vue/shared@3.5.13(transitive)
- Removedacorn@8.14.0(transitive)
- Removedbuffer-from@1.1.2(transitive)
- Removedcommander@2.20.3(transitive)
- Removeddebug@4.4.0(transitive)
- Removedentities@4.5.0(transitive)
- Removedes-module-lexer@0.9.3(transitive)
- Removedesbuild@0.24.2(transitive)
- Removedestree-walker@0.6.12.0.2(transitive)
- Removedfsevents@2.3.3(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedhash-sum@2.0.0(transitive)
- Removedjest-worker@26.6.2(transitive)
- Removedjoycon@3.1.1(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedjsonc-parser@3.3.1(transitive)
- Removedmagic-string@0.30.17(transitive)
- Removedmerge-stream@2.0.0(transitive)
- Removedms@2.1.3(transitive)
- Removednanoid@3.3.8(transitive)
- Removedpicocolors@1.1.1(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedpostcss@8.5.1(transitive)
- Removedrandombytes@2.1.0(transitive)
- Removedrollup@2.79.2(transitive)
- Removedrollup-plugin-esbuild@4.10.3(transitive)
- Removedrollup-plugin-terser@7.0.2(transitive)
- Removedrollup-plugin-vue@6.0.0(transitive)
- Removedrollup-pluginutils@2.8.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedserialize-javascript@4.0.0(transitive)
- Removedsource-map@0.6.1(transitive)
- Removedsource-map-js@1.2.1(transitive)
- Removedsource-map-support@0.5.21(transitive)
- Removedsupports-color@7.2.0(transitive)
- Removedterser@5.37.0(transitive)
- Removedundici-types@6.20.0(transitive)