Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

codemirror-editor-vue3

Package Overview
Dependencies
Maintainers
1
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codemirror-editor-vue3 - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3-beta

dist/.DS_Store

2

dist/codemirror-editor-vue3.es.js

@@ -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*as c from"codemirror";import s from"codemirror";import{defineComponent as u,ref as d,onMounted as p,markRaw as m,watch as g,openBlock as f,createElementBlock as h,computed as v,getCurrentInstance as y,onBeforeUnmount as b,normalizeClass 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||s,M=u({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=d(),r=d(null),o=()=>{r.value=m($.fromTextArea(n.value,e.options)),t("update:cminstance",m(r.value));let o=null;o=g((()=>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}}}),C=["name","placeholder"];M.render=function(e,t,n,r,o,a){return f(),h("textarea",{ref:"textarea",name:e.$props.name,placeholder:e.$props.placeholder},null,8,C)};const E=window.CodeMirror||s;window.diff_match_patch=k,window.DIFF_DELETE=-1,window.DIFF_INSERT=1,window.DIFF_EQUAL=0;const I=u({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=d(null),r=d(null),o=String(e.height).replace("px","")+"px",a=()=>{n.value=m(E.MergeView(r.value,e.options)),t("update:cminstance",m(n.value.edit)),document.querySelector(".CodeMirror-merge").style.height=o,document.querySelector(".CodeMirror-merge-right .CodeMirror").style.height=o,t("ready",n)};return p((()=>{a()})),{mergeView:r,initialize:a}}}),N={ref:"mergeView"};var A,F;function T(){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 L(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`[${T()}] <${t}> ${e}`}function R(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 f(),h("div",N,null,512)},(F=A||(A={})).info="info",F.warning="warning",F.error="error";const z=[{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:[...z,{regex:/.*/,token:"hr"}],error:[...z,{regex:/.*/,token:"error.strong"}],info:[...z,{regex:/.*/,token:"bracket"}],warning:[...z,{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||s,H=u({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=d(),r=d(null),o=v((()=>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=m(B.fromTextArea(n.value,e.options)),t("update:cminstance",m(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 g((()=>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}}}),G=["name","placeholder"];H.render=function(e,t,n,r,o,a){return f(),h("textarea",{ref:"textarea",name:e.$props.name,placeholder:e.$props.placeholder},null,8,G)};"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 U={mode:"text",theme:"default",lineNumbers:!0,smartIndent:!0,indentUnit:2,gutters:["CodeMirror-linenumbers"],foldGutter:!0,matchBrackets:!0,autoCloseBrackets:!0,styleActiveLine:!0},W=["update:value","change","ready"],q=u({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:[...W,"changes","scroll","beforeChange","cursorActivity","keyHandled","inputRead","electricInput","beforeSelectionChange","viewportChange","swapDoc","gutterClick","gutterContextMenu","focus","blur","refresh","optionChange","scrollCursorIntoView","update"],components:{Default:M,Merge:I,FcLog:H},setup(e,t){var n,r;const o=d(null),a=d(""),l=d(),c=d(Object.assign(i({},U),e.globalOptions,e.options));console.log(c);const s=y(),u=d(null),p=(t=e.width,n=e.height)=>{o.value.setSize(t,n)},m=()=>{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())}))},f=()=>{const e=o.value.doc.cm.getWrapperElement();null==e||e.remove()},{listenerEvents:h}=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);!W.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:s,content:a});setTimeout((()=>{(()=>{const e=o.value.doc.history,t=o.value.doc.cleanGeneration;u.value.initialize(),f(),o.value.doc.history=e,o.value.doc.cleanGeneration=t})()}),3e3),g((()=>e.options),(t=>{console.log(t);for(const n in e.options)o.value.setOption(n,t[n])}),{deep:!0}),g((()=>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)}m()})(e)}));return g((()=>e.merge),(t=>{"fclog"!=e.options.mode&&"log"!=e.options.mode?e.merge?l.value="Merge":l.value="default":l.value="FcLog"}),{immediate:!0}),b((()=>{f()})),{presetModeName:l,cmOptions:c,cminstance:o,content:a,ready:e=>{h(),m(),p(),t.emit("ready",o.value)},resize:p,instanceName:null==(r=null==(n=null==s?void 0:s.parent)?void 0:n.type)?void 0:r.name,presetRef:u}}});q.render=function(e,r,o,a,l,c){return f(),h("div",{class:w(["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}])},[(f(),x(O(e.presetModeName),S({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 J={Codemirror:q,install:(e,t)=>(t&&(t.options&&(q.props.globalOptions.default=()=>t.options),t.events&&(q.props.globalEvents.default=()=>t.events)),e.component("Codemirror",q),e)};export{q as Codemirror,L as createLinkMark,P as createLog,D as createLogMark,R as createTitle,J as default,V as getLinkMark,T 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*as c from"codemirror";import s from"codemirror";import{defineComponent as u,ref as d,onMounted as p,markRaw as m,watch as g,openBlock as f,createElementBlock as h,computed as v,getCurrentInstance as y,onBeforeUnmount as b,normalizeClass 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||s,M=u({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=d(),r=d(null),o=()=>{r.value=m($.fromTextArea(n.value,e.options)),t("update:cminstance",m(r.value));let o=null;o=g((()=>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}}}),C=["name","placeholder"];M.render=function(e,t,n,r,o,a){return f(),h("textarea",{ref:"textarea",name:e.$props.name,placeholder:e.$props.placeholder},null,8,C)};const E=window.CodeMirror||s;window.diff_match_patch=k,window.DIFF_DELETE=-1,window.DIFF_INSERT=1,window.DIFF_EQUAL=0;const I=u({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=d(null),r=d(null),o=String(e.height).replace("px","")+"px",a=()=>{n.value=m(E.MergeView(r.value,e.options)),t("update:cminstance",m(n.value.edit)),document.querySelector(".CodeMirror-merge").style.height=o,document.querySelector(".CodeMirror-merge-right .CodeMirror").style.height=o,t("ready",n)};return p((()=>{a()})),{mergeView:r,initialize:a}}}),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 R(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 f(),h("div",N,null,512)},(F=A||(A={})).info="info",F.warning="warning",F.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"}];c.defineSimpleMode("fclog",{start:[...B,{regex:/.*/,token:"hr"}],error:[...B,{regex:/.*/,token:"error.strong"}],info:[...B,{regex:/.*/,token:"bracket"}],warning:[...B,{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 z=window.CodeMirror||s,H=u({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=d(),r=d(null),o=v((()=>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=m(z.fromTextArea(n.value,e.options)),t("update:cminstance",m(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 g((()=>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}}}),K=["name","placeholder"];H.render=function(e,t,n,r,o,a){return f(),h("textarea",{ref:"textarea",name:e.$props.name,placeholder:e.$props.placeholder},null,8,K)};"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 U={mode:"text",theme:"default",lineNumbers:!0,smartIndent:!0,indentUnit:2,foldGutter:!0,matchBrackets:!0,autoCloseBrackets:!0,styleActiveLine:!0},W=["update:value","change","ready"],q=u({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:[...W,"changes","scroll","beforeChange","cursorActivity","keyHandled","inputRead","electricInput","beforeSelectionChange","viewportChange","swapDoc","gutterClick","gutterContextMenu","focus","blur","refresh","optionChange","scrollCursorIntoView","update"],components:{Default:M,Merge:I,FcLog:H},setup(e,t){var n,r;const o=d(null),a=d(""),l=d(),c=d(Object.assign(i({},U),e.globalOptions,e.options)),s=y(),u=d(null),p=(t=e.width,n=e.height)=>{o.value.setSize(t,n)},m=()=>{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);!W.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});g((()=>e.options),(t=>{for(const n in e.options)o.value.setOption(n,t[n])}),{deep:!0}),g((()=>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)}m()})(e)}));return g((()=>e.merge),(t=>{"fclog"!=e.options.mode&&"log"!=e.options.mode?e.merge?l.value="Merge":l.value="default":l.value="FcLog"}),{immediate:!0}),b((()=>{(()=>{const e=o.value.doc.cm.getWrapperElement();null==e||e.remove()})()})),{presetModeName:l,cmOptions:c,cminstance:o,content:a,ready:e=>{f(),m(),p(),t.emit("ready",o.value)},resize:p,instanceName:e.name||(null==(r=null==(n=null==s?void 0:s.parent)?void 0:n.type)?void 0:r.name)+"-cm",presetRef:u}}});q.render=function(e,r,o,a,l,c){return f(),h("div",{class:w(["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}])},[(f(),x(O(e.presetModeName),S({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},q.install=(e,t)=>(t&&(t.options&&(q.props.globalOptions.default=()=>t.options),t.events&&(q.props.globalEvents.default=()=>t.events)),e.component("Codemirror",q),e);export{q as Codemirror,T as createLinkMark,P as createLog,D as createLogMark,R as createTitle,q 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("codemirror"),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","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/lib/codemirror"].js,e.Vue,null,null,e.DiffMatchPatch,null,e.codemirror)}(this,(function(e,t,r,n,o,a,l,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function s(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 u=c(t),d=s(t),p=c(a),m=s(i);const g=window.CodeMirror||u.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),((r,n)=>{r&&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||u.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),a=String(e.height).replace("px","")+"px",l=()=>{n.value=r.markRaw(v.MergeView(o.value,e.options)),t("update:cminstance",r.markRaw(n.value.edit)),document.querySelector(".CodeMirror-merge").style.height=a,document.querySelector(".CodeMirror-merge-right .CodeMirror").style.height=a,t("ready",n)};return r.onMounted((()=>{l()})),{mergeView:o,initialize:l}}}),b={ref:"mergeView"};var w,_;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 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 x(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}y.render=function(e,t,n,o,a,l){return r.openBlock(),r.createElementBlock("div",b,null,512)},(_=w||(w={})).info="info",_.warning="warning",_.error="error";const j=[{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.defineSimpleMode("fclog",{start:[...j,{regex:/.*/,token:"hr"}],error:[...j,{regex:/.*/,token:"error.strong"}],info:[...j,{regex:/.*/,token:"bracket"}],warning:[...j,{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 S=window.CodeMirror||u.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 r=t.getValue(),n=[].concat(O(r)).concat(x(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=r.markRaw(S.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),(r=>{r&&(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}}}),C=["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,C)};"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 P={mode:"text",theme:"default",lineNumbers:!0,smartIndent:!0,indentUnit:2,gutters:["CodeMirror-linenumbers"],foldGutter:!0,matchBrackets:!0,autoCloseBrackets:!0,styleActiveLine:!0},E=["update:value","change","ready"],$=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}},emits:[...E,"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));console.log(c);const s=r.getCurrentInstance(),u=r.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())}))},m=()=>{const e=a.value.doc.cm.getWrapperElement();null==e||e.remove()},{listenerEvents:g}=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);!E.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:t,internalInstance:s,content:l});setTimeout((()=>{(()=>{const e=a.value.doc.history,t=a.value.doc.cleanGeneration;u.value.initialize(),m(),a.value.doc.history=e,a.value.doc.cleanGeneration=t})()}),3e3),r.watch((()=>e.options),(t=>{console.log(t);for(const r in e.options)a.value.setOption(r,t[r])}),{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)}p()})(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((()=>{m()})),{presetModeName:i,cmOptions:c,cminstance:a,content:l,ready:e=>{g(),p(),d(),t.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}}});$.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.border,"width-auto":!e.$props.width||"100%"==e.$props.width,"height-auto":!e.$props.height||"100%"==e.$props.height}])},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(e.presetModeName),r.mergeProps({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"]))],2)};var I={Codemirror:$,install:(e,t)=>(t&&(t.options&&($.props.globalOptions.default=()=>t.options),t.events&&($.props.globalEvents.default=()=>t.events)),e.component("Codemirror",$),e)};e.Codemirror=$,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,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=I,e.getLinkMark=O,e.getLocalTime=k,e.getLogMark=x,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,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("codemirror"),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","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/lib/codemirror"].js,e.Vue,null,null,e.DiffMatchPatch,null,e.codemirror)}(this,(function(e,t,r,n,o,a,l,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function s(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 u=c(t),d=s(t),p=c(a),m=s(i);const g=window.CodeMirror||u.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),((r,n)=>{r&&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||u.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),a=String(e.height).replace("px","")+"px",l=()=>{n.value=r.markRaw(v.MergeView(o.value,e.options)),t("update:cminstance",r.markRaw(n.value.edit)),document.querySelector(".CodeMirror-merge").style.height=a,document.querySelector(".CodeMirror-merge-right .CodeMirror").style.height=a,t("ready",n)};return r.onMounted((()=>{l()})),{mergeView:o,initialize:l}}}),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 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 x(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}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 j=[{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.defineSimpleMode("fclog",{start:[...j,{regex:/.*/,token:"hr"}],error:[...j,{regex:/.*/,token:"error.strong"}],info:[...j,{regex:/.*/,token:"bracket"}],warning:[...j,{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 S=window.CodeMirror||u.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 r=t.getValue(),n=[].concat(O(r)).concat(x(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=r.markRaw(S.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),(r=>{r&&(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}}}),C=["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,C)};"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 E={mode:"text",theme:"default",lineNumbers:!0,smartIndent:!0,indentUnit:2,foldGutter:!0,matchBrackets:!0,autoCloseBrackets:!0,styleActiveLine:!0},P=["update:value","change","ready"],$=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:[...P,"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({},E),e.globalOptions,e.options)),s=r.getCurrentInstance(),u=r.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);!P.includes(r)&&e.push(r)}})),e};return{listenerEvents:()=>{e.value.on("change",(e=>{const r=e.getValue();r!=n.value&&(n.value=r,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:t,internalInstance:s,content:l});r.watch((()=>e.options),(t=>{for(const r in e.options)a.value.setOption(r,t[r])}),{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)}p()})(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:e=>{m(),p(),d(),t.emit("ready",a.value)},resize:d,instanceName:e.name||(null==(o=null==(n=null==s?void 0:s.parent)?void 0:n.type)?void 0:o.name)+"-cm",presetRef:u}}});$.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}])},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(e.presetModeName),r.mergeProps({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"]))],2)},$.install=(e,t)=>(t&&(t.options&&($.props.globalOptions.default=()=>t.options),t.events&&($.props.globalEvents.default=()=>t.events)),e.component("Codemirror",$),e),e.Codemirror=$,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,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=$,e.getLinkMark=O,e.getLocalTime=k,e.getLogMark=x,Object.defineProperty(e,"__esModule",{value:!0}),e[Symbol.toStringTag]="Module"}));

@@ -6,12 +6,12 @@ {

],
"main": "./dist/codemirror-editor-vue3.umd.js",
"module": "./dist/codemirror-editor-vue3.es.js",
"main": "./dist/main.umd.js",
"module": "./dist/main.es.js",
"exports": {
".": {
"import": "./dist/codemirror-editor-vue3.es.js",
"require": "./dist/codemirror-editor-vue3.umd.js"
"import": "./dist/main.es.js",
"require": "./dist/main.umd.js"
}
},
"description": "CodeMirror component for Vue3",
"version": "0.1.2",
"version": "0.1.3-beta",
"license": "MIT",

@@ -24,6 +24,6 @@ "private": false,

"homepage": "https://github.com/RennCheung/codemirror-editor-vue3",
"unpkg": "dist/codemirror-editor-vue3.js",
"jsnext:main": "dist/codemirror-editor-vue3.js",
"unpkg": "dist/main.js",
"jsnext:main": "dist/main.js",
"jspm": {
"main": "dist/codemirror-editor-vue3.js",
"main": "dist/main.js",
"registry": "npm",

@@ -30,0 +30,0 @@ "format": "esm"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc