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.0.16-beta to 0.0.17-beta

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 c from"codemirror";import{defineComponent as s,ref as u,onMounted as d,markRaw as p,watch as m,openBlock as g,createElementBlock as f,computed as h,getCurrentInstance as v,onBeforeUnmount as y,normalizeClass as b,createBlock as w,resolveDynamicComponent as x,mergeProps as O}from"vue";import"codemirror/addon/merge/merge.css";import"codemirror/addon/merge/merge.js";import S from"diff-match-patch";import"codemirror/addon/mode/simple.js";import*as k from"codemirror/lib/codemirror.js";const j=window.CodeMirror||c,$=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=p(j.fromTextArea(n.value,e.options)),t("update:cminstance",p(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 d((()=>{o()})),{initialize:o,textarea:n}}}),M=["name","placeholder"];$.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=S,window.DIFF_DELETE=-1,window.DIFF_INSERT=1,window.DIFF_EQUAL=0;const E=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),o=String(e.height).replace("px","")+"px",a=()=>{n.value=p(C.MergeView(r.value,e.options)),t("update:cminstance",p(n.value.edit)),document.querySelector(".CodeMirror-merge").style.height=o,document.querySelector(".CodeMirror-merge-right .CodeMirror").style.height=o,t("ready",n)};return d((()=>{a()})),{mergeView:r,initialize:a}}}),I={ref:"mergeView"};var N,A;function F(){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 T(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 V(e="",t="info"){return`#log<${t}>log#${e}#log<${t}>log#`}function D(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 _(e,t=""){return`[${F()}] <${t}> ${e}`}function P(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}`}E.render=function(e,t,n,r,o,a){return g(),f("div",I,null,512)},(A=N||(N={})).info="info",A.warning="warning",A.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"}]}),k.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(T(n)).concat(D(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=p(B.fromTextArea(n.value,e.options)),t("update:cminstance",p(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}),d((()=>{l()})),{initialize:l,textarea:n}}}),H=["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,H)},"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"],W=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:$,Merge:E,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(),d=u(null),p=(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);!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)}g()})(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:e=>{f(),g(),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:d}}});W.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}])},[(g(),w(x(e.presetModeName),O({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};W.install=(e,t)=>(t&&(t.options&&(W.props.globalOptions.default=()=>t.options),t.events&&(W.props.globalEvents.default=()=>t.events)),e.component("Codemirror",W),e);export{W as Codemirror,L as createLinkMark,_ as createLog,V as createLogMark,P as createTitle,W as default,T as getLinkMark,F as getLocalTime,D 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 d,markRaw as p,watch as m,openBlock as g,createElementBlock as f,computed as h,getCurrentInstance as v,onBeforeUnmount as y,normalizeClass as b,createBlock as w,resolveDynamicComponent as x,mergeProps as O}from"vue";import"codemirror/addon/merge/merge.css";import"codemirror/addon/merge/merge.js";import S from"diff-match-patch";import"codemirror/addon/mode/simple.js";import*as k from"codemirror/lib/codemirror.js";const j=window.CodeMirror||c,$=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=p(j.fromTextArea(n.value,e.options)),t("update:cminstance",p(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 d((()=>{o()})),{initialize:o,textarea:n}}}),M=["name","placeholder"];$.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=S,window.DIFF_DELETE=-1,window.DIFF_INSERT=1,window.DIFF_EQUAL=0;const E=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),o=String(e.height).replace("px","")+"px",a=()=>{n.value=p(C.MergeView(r.value,e.options)),t("update:cminstance",p(n.value.edit)),document.querySelector(".CodeMirror-merge").style.height=o,document.querySelector(".CodeMirror-merge-right .CodeMirror").style.height=o,t("ready",n)};return d((()=>{a()})),{mergeView:r,initialize:a}}}),I={ref:"mergeView"};var N,A;function F(){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 T(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 V(e="",t="info"){return`#log<${t}>log#${e}#log<${t}>log#`}function D(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 _(e,t=""){return`[${F()}] <${t}> ${e}`}function P(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}`}E.render=function(e,t,n,r,o,a){return g(),f("div",I,null,512)},(A=N||(N={})).info="info",A.warning="warning",A.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"}]}),k.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(T(n)).concat(D(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=p(B.fromTextArea(n.value,e.options)),t("update:cminstance",p(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}),d((()=>{l()})),{initialize:l,textarea:n}}}),H=["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,H)},"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"],W=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:$,Merge:E,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(),d=u(null),p=(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);!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)}g()})(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:e=>{f(),g(),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:d}}});W.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}])},[(g(),w(x(e.presetModeName),O({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};W.install=(e,t)=>(t&&(t.options&&(W.props.globalOptions.default=()=>t.options),t.events&&(W.props.globalEvents.default=()=>t.events)),e.component("Codemirror",W),e);export{W as Codemirror,L as createLinkMark,_ as createLog,V as createLogMark,P as createTitle,W as default,T as getLinkMark,F as getLocalTime,D 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,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=c(a),p=s(i);const m=window.CodeMirror||u.default,g=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(m.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}}}),f=["name","placeholder"];g.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,f)};const h=window.CodeMirror||u.default;window.diff_match_patch=d.default,window.DIFF_DELETE=-1,window.DIFF_INSERT=1,window.DIFF_EQUAL=0;const v=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(h.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}}}),y={ref:"mergeView"};var w,b;function _(){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 k(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 O(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}v.render=function(e,t,n,o,a,l){return r.openBlock(),r.createElementBlock("div",y,null,512)},(b=w||(w={})).info="info",b.warning="warning",b.error="error";const x=[{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"}];u.default.defineSimpleMode("fclog",{start:[...x,{regex:/.*/,token:"hr"}],error:[...x,{regex:/.*/,token:"error.strong"}],info:[...x,{regex:/.*/,token:"bracket"}],warning:[...x,{regex:/.*/,token:"comment"}]}),p.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,j=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(k(r)).concat(O(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}}}),M=["name","placeholder"];j.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,M)},"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 C={mode:"text",theme:"default",lineNumbers:!0,smartIndent:!0,indentUnit:2,foldGutter:!0,matchBrackets:!0,autoCloseBrackets:!0,styleActiveLine:!0},E=["update:value","change","ready"],P=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:[...E,"changes","scroll","beforeChange","cursorActivity","keyHandled","inputRead","electricInput","beforeSelectionChange","viewportChange","swapDoc","gutterClick","gutterContextMenu","focus","blur","refresh","optionChange","scrollCursorIntoView","update"],components:{Default:g,Merge:v,FcLog:j},setup(e,t){var n,o;const a=r.ref(null),l=r.ref(""),i=r.ref(),c=r.ref(Object.assign(__spreadValues({},C),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);!E.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}}});P.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)};P.install=(e,t)=>(t&&(t.options&&(P.props.globalOptions.default=()=>t.options),t.events&&(P.props.globalEvents.default=()=>t.events)),e.component("Codemirror",P),e),e.Codemirror=P,e.createLinkMark=function(e){return`#link#${JSON.stringify(e)}#link#`},e.createLog=function(e,t=""){return`[${_()}] <${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=P,e.getLinkMark=k,e.getLocalTime=_,e.getLogMark=O,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("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,r,n,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(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 d=s(t),p=s(l),m=u(c);const g=window.CodeMirror||d.default,f=n.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 r=n.ref(),o=n.ref(null),a=()=>{o.value=n.markRaw(g.fromTextArea(r.value,e.options)),t("update:cminstance",n.markRaw(o.value));let a=null;a=n.watch((()=>e.cminstance),((r,n)=>{r&&e.cminstance.setValue(e.code||e.value||e.content),t("ready",o),a()}),{deep:!0})};return n.onMounted((()=>{a()})),{initialize:a,textarea:r}}}),h=["name","placeholder"];f.render=function(e,t,r,o,a,l){return n.openBlock(),n.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=n.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 r=n.ref(null),o=n.ref(null),a=String(e.height).replace("px","")+"px",l=()=>{r.value=n.markRaw(v.MergeView(o.value,e.options)),t("update:cminstance",n.markRaw(r.value.edit)),document.querySelector(".CodeMirror-merge").style.height=a,document.querySelector(".CodeMirror-merge-right .CodeMirror").style.height=a,t("ready",r)};return n.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,r,o,a,l){return n.openBlock(),n.createElementBlock("div",b,null,512)},(_=w||(w={})).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=n.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 r=n.ref(),o=n.ref(null),a=n.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=n.markRaw(j.fromTextArea(r.value,e.options)),t("update:cminstance",n.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 n.watch((()=>e.cminstance),(r=>{r&&(l(e.cminstance),e.cminstance.setValue(e.code||e.value||e.content),t("ready",o))}),{deep:!0,immediate:!0}),n.onMounted((()=>{i()})),{initialize:i,textarea:r}}}),C=["name","placeholder"];M.render=function(e,t,r,o,a,l){return n.openBlock(),n.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"],$=n.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 r,o;const a=n.ref(null),l=n.ref(""),i=n.ref(),c=n.ref(Object.assign(__spreadValues({},E),e.globalOptions,e.options)),s=n.getCurrentInstance(),u=n.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});n.watch((()=>e.options),(t=>{for(const r in e.options)a.value.setOption(r,t[r])}),{deep:!0}),n.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 n.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}),n.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==(r=null==s?void 0:s.parent)?void 0:r.type)?void 0:o.name)+"-cm",presetRef:u}}});$.render=function(e,t,r,o,a,l){return n.openBlock(),n.createElementBlock("div",{class:n.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}])},[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.presetModeName),n.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"}));
{
"name": "codemirror-editor-vue3",
"description": "CodeMirror component for Vue3",
"version": "0.0.16-beta",
"version": "0.0.17-beta",
"license": "MIT",

@@ -6,0 +6,0 @@ "files": [

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