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 2.0.3-beta to 2.0.3-beta1

6

dist/codemirror-editor-vue3.es.js

@@ -218,3 +218,3 @@ var __defProp = Object.defineProperty;

const arr = new Array(Math.max(symbolLength || 15, 5));
const wraptext = arr.join(symbol);
const wraptext = arr.join(symbol || "=");
return `${wraptext}${title}${wraptext}`;

@@ -627,4 +627,4 @@ }

emit("ready", cminstance.value);
watch([() => props.height, () => props.width], ([height, width]) => {
resize(height, width);
watch([() => props.width, () => props.height], ([width, height]) => {
resize(width, height);
}, { deep: true });

@@ -631,0 +631,0 @@ };

@@ -5,3 +5,3 @@ var ke=Object.defineProperty,we=Object.defineProperties;var $e=Object.getOwnPropertyDescriptors;var A=Object.getOwnPropertySymbols;var Me=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable;var B=(c,f,t)=>f in c?ke(c,f,{enumerable:!0,configurable:!0,writable:!0,value:t}):c[f]=t,M=(c,f)=>{for(var t in f||(f={}))Me.call(f,t)&&B(c,t,f[t]);if(A)for(var t of A(f))Ce.call(f,t)&&B(c,t,f[t]);return c},V=(c,f)=>we(c,$e(f));(function(c,f){typeof exports=="object"&&typeof module!="undefined"?f(exports,require("codemirror"),require("vue"),require("codemirror/lib/codemirror.css"),require("codemirror/addon/merge/merge.css"),require("codemirror/addon/merge/merge.js"),require("diff-match-patch"),require("codemirror/addon/mode/simple.js")):typeof define=="function"&&define.amd?define(["exports","codemirror","vue","codemirror/lib/codemirror.css","codemirror/addon/merge/merge.css","codemirror/addon/merge/merge.js","diff-match-patch","codemirror/addon/mode/simple.js"],f):(c=typeof globalThis!="undefined"?globalThis:c||self,f(c["codemirror-editor-vue3"]={},c.codemirror,c.Vue,null,null,null,c.DiffMatchPatch))})(this,function(c,f,t,be,_e,ve,F){"use strict";function j(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var C=j(f),R=j(F),_=(e,n)=>{const o=e.__vccOpts||e;for(const[a,r]of n)o[a]=r;return o};const H=window.CodeMirror||C.default,P=t.defineComponent({name:"DefaultMode",props:{name:{type:String,default:`cm-textarea-${+new Date}`},value:{type:String,default:""},content:{type:String,default:""},options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>null},placeholder:{type:String,default:""}},emits:{ready:e=>e,"update:cminstance":e=>e},setup(e,{emit:n}){const o=t.ref(),a=t.ref(null),r=()=>{a.value=t.markRaw(H.fromTextArea(o.value,e.options)),n("update:cminstance",a.value);const l=t.watch(()=>e.cminstance,i=>{var u;i&&((u=e.cminstance)==null||u.setValue(e.value||e.content)),n("ready",t.unref(a)),l==null||l()},{deep:!0})};return t.onMounted(()=>{r()}),{textarea:o,initialize:r}}}),z=["name","placeholder"];function q(e,n,o,a,r,l){return t.openBlock(),t.createElementBlock("textarea",{ref:"textarea",name:e.$props.name,placeholder:e.$props.placeholder},null,8,z)}var U=_(P,[["render",q]]);const W=(window==null?void 0:window.CodeMirror)||C.default;window.diff_match_patch=R.default,window.DIFF_DELETE=-1,window.DIFF_INSERT=1,window.DIFF_EQUAL=0;const G=t.defineComponent({name:"MergeMode",props:{options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})}},emits:["update:cminstance","ready"],setup(e,{emit:n}){const o=t.ref(),a=t.ref(),r=()=>{o.value=t.markRaw(W.MergeView(a.value,e.options)),n("update:cminstance",o.value),n("ready",o)};return t.onMounted(()=>{r()}),{initialize:r}}}),J={ref:"mergeView"};function Z(e,n,o,a,r,l){return t.openBlock(),t.createElementBlock("div",J,null,512)}var K=_(G,[["render",Z]]);c.logErrorType=void 0,function(e){e.info="info",e.warning="warning",e.error="error"}(c.logErrorType||(c.logErrorType={}));function x(){const e=new Date,n=e.getHours()<10?`0${e.getHours()}`:e.getHours(),o=e.getMinutes()<10?`0${e.getMinutes()}`:e.getMinutes(),a=e.getSeconds()<10?`0${e.getSeconds()}`:e.getSeconds();return`${n}:${o}:${a}`}function Q(e){return`#link#${JSON.stringify(e)}#link#`}function L(e){const n=/#link#(.+)#link#/g,o=[];let a;for(a=n.exec(e);a;){const r=document.createElement("a"),l=JSON.parse(a[1]),i=Object.entries(l);for(const[u,g]of i)r.setAttribute(u,g);r.className="editor_custom_link",r.innerHTML="logDownload",o.push({start:a.index,end:a.index+a[0].length,node:r}),a=n.exec(e)}return o}function X(e="",n="info"){return`#log<${n}>log#${e}#log<${n}>log#`}function T(e){const n=[];function o(){const a=/#log<(\w*)>log#((.|\r\n|\n)*?)#log<(\w*)>log#/g;let r;for(r=a.exec(e);r;){const i=r[0].replace(/\r\n/g,`

`).split(`
`),d=document.createElement("span"),p=r[1];d.className=`c-editor--log__${p}`;let s=0;for(let m=0;m<i.length;m++){const w=i[m],y=g[m],S=d.cloneNode(!1);S.innerText=y,n.push({start:r.index+s,end:r.index+s+w.length,node:S}),s=s+w.length+1}r=a.exec(e)}}return o(),n}function Y(e,n=""){return`[${x()}] <${n}> ${e}`}function ee(e,n,o){const r=new Array(Math.max(n||15,5)).join(o);return`${r}${e}${r}`}const v=[{regex:/(\[.*?\])([ \t]*)(<error>[ \t])(.+)/,token:["tag","","error.strong","error.strong"],sol:!0},{regex:/(\[.*?\])([ \t]*)(<info>)(.+)(.?)/,token:["tag","","bracket","bracket","hr"],sol:!0},{regex:/(\[.*?\])([ \t]*)(<warning>)(.+)(.?)/,token:["tag","","comment","comment","hr"],sol:!0}];C.default.defineSimpleMode("fclog",{start:[...v,{regex:/.*/,token:"hr"}],error:[...v,{regex:/.*/,token:"error.strong"}],info:[...v,{regex:/.*/,token:"bracket"}],warning:[...v,{regex:/.*\[/,token:"comment"}]}),C.default.defineSimpleMode("log",{start:[{regex:/^[=]+[^=]*[=]+/,token:"strong"},{regex:/([^\w])([A-Z][\w]*)/,token:["","string"]},{regex:/(^[A-Z][\w]*)/,token:"string"}]});const te=window.CodeMirror||C.default,ne=t.defineComponent({name:"CodemirrorFclog",props:{value:{type:String,default:""},name:{type:String,default:`cm-textarea-${+new Date}`},options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})},placeholder:{type:String,default:""}},emits:["update:cminstance","ready"],setup(e,{emit:n}){const o=t.ref(),a=t.ref(null),r=(i=e.cminstance)=>{i.getAllMarks().forEach(p=>p.clear());const g=i.getValue(),d=[].concat(L(g)).concat(T(g));for(let p=0;p<d.length;p++){const s=d[p];i.markText(i.posFromIndex(s.start),i.posFromIndex(s.end),{replacedWith:s.node})}},l=()=>{var i;a.value=t.markRaw(te.fromTextArea(o.value,e.options)),n("update:cminstance",t.unref(a)),(i=a.value)==null||i.on("change",r)};return t.watch(()=>e.cminstance,i=>{var u;i&&(r(e.cminstance),(u=e.cminstance)==null||u.setValue(e.value),n("ready",a))},{deep:!0,immediate:!0}),t.onMounted(()=>{l()}),{initialize:l,textarea:o}}}),re=["name","placeholder"];function oe(e,n,o,a,r,l){return t.openBlock(),t.createElementBlock("textarea",{ref:"textarea",name:e.$props.name,placeholder:e.$props.placeholder},null,8,re)}var ae=_(ne,[["render",oe]]);const D={"update:value":e=>e,change:(e,n)=>({value:e,cm:n}),input:e=>e,ready:e=>e},ce=["changes","scroll","beforeChange","cursorActivity","keyHandled","inputRead","electricInput","beforeSelectionChange","viewportChange","swapDoc","gutterClick","gutterContextMenu","focus","blur","refresh","optionChange","scrollCursorIntoView","update"],se=()=>{const e={};return ce.forEach(n=>{e[n]=(...o)=>o}),e},O={mode:"text",theme:"default",lineNumbers:!0,smartIndent:!0,indentUnit:2};function ie(e){Promise.resolve().then(()=>{const n=e.getScrollInfo();e.scrollTo(n.left,n.height)})}const le=({props:e,cminstance:n,emit:o,internalInstance:a,content:r})=>{const l=()=>{const u=[];return Object.keys(a==null?void 0:a.vnode.props).forEach(g=>{if(g.startsWith("on")){const d=g.replace(g[2],g[2].toLowerCase()).slice(2);!D[d]&&u.push(d)}}),u};return{listenerEvents:()=>{n.value.on("change",d=>{const p=d.getValue();p!==r.value&&(r.value=p,o("update:value",r.value),o("input",r.value),Promise.resolve().then(()=>{o("change",r.value,d)}),e.keepCursorInEnd&&ie(d))});const u={};l().filter(d=>!u[d]&&(u[d]=!0)).forEach(d=>{n.value.on(d,(...p)=>{o(d,...p)})})}}};function de({props:e,cminstance:n,presetRef:o}){const a=t.ref(null),r=t.ref(null),l=()=>{t.nextTick(()=>{var s;(s=n.value)==null||s.refresh()})},i=(s=e.width,m=e.height)=>{var y;a.value=String(s).replace("px",""),r.value=String(m).replace("px","");const w=r.value;(y=n.value)==null||y.setSize(a.value,w)},u=()=>{var m;const s=(m=n.value)==null?void 0:m.getWrapperElement();s==null||s.remove()},g=()=>{var m,w,y;const s=(m=n.value)==null?void 0:m.getDoc().getHistory();(w=o.value)==null||w.initialize(),u(),(y=n.value)==null||y.getDoc().setHistory(s)},d=()=>{const s=document.querySelector(".CodeMirror-gutters");return(s==null?void 0:s.style.left.replace("px",""))!=="0"};return{reload:g,refresh:l,resize:i,destroy:u,containerHeight:r,reviseStyle:()=>{if(l(),!d())return;const s=setInterval(()=>{d()?l():clearInterval(s)},60),m=setTimeout(()=>{clearInterval(s),clearTimeout(m)},400)}}}typeof Object.assign!="function"&&Object.defineProperty(Object,"assign",{value(e,n){if(e==null)throw new TypeError("Cannot convert undefined or null to object");const o=Object(e);for(let a=1;a<arguments.length;a++){const r=arguments[a];if(r!=null)for(const l in r)Object.prototype.hasOwnProperty.call(r,l)&&(o[l]=r[l])}return o},writable:!0,configurable:!0});const ue=t.defineComponent({name:"CodemirrorEditor",components:{Default:U,Merge:K,FcLog:ae},props:{value:{type:String,default:""},options:{type:Object,default:()=>O},globalOptions:{type:Object,default:()=>O},placeholder:{type:String,default:""},border:{type:Boolean,default:!1},width:{type:[String,Number],default:null},height:{type:[String,Number],default:null},keepCursorInEnd:{type:Boolean,default:!1},merge:{type:Boolean,default:!1},name:{type:String,default:""},marker:{type:Function,default:()=>null},unseenLines:{type:Array,default:()=>[]}},emits:M(M({},D),se()),setup(e,{emit:n}){var N,I;const o=t.ref(null),a=t.ref(""),r=t.ref("Default"),l=t.ref(M(M(M({},O),e.globalOptions),e.options)),i=t.getCurrentInstance(),u=t.ref(null),{refresh:g,resize:d,destroy:p,containerHeight:s,reviseStyle:m}=de({props:e,cminstance:o,presetRef:u}),{listenerEvents:w}=le({props:e,cminstance:o,emit:n,internalInstance:i,content:a}),y=()=>{e.unseenLines!==void 0&&e.marker!==void 0&&e.unseenLines.forEach(h=>{var $,b;const k=($=o.value)==null?void 0:$.lineInfo(h);(b=o.value)==null||b.setGutterMarker(h,"breakpoints",(k==null?void 0:k.gutterMarkers)?null:e.marker())})},S=h=>{var $,b;const k=($=o.value)==null?void 0:$.getValue();h!==k&&((b=o.value)==null||b.setValue(h),a.value=h,m()),y()},he=()=>{w(),y(),d(),n("ready",o.value),t.watch([()=>e.height,()=>e.width],([h,k])=>{d(h,k)},{deep:!0})},ye=()=>{if(e.options.mode==="fclog"||e.options.mode==="log"){r.value="FcLog";return}if(e.merge){r.value="Merge";return}r.value="Default"};return t.watch(()=>e.options,h=>{var k;for(const $ in e.options)(k=o.value)==null||k.setOption($,h[$])},{deep:!0}),t.watch(()=>e.value,h=>{S(h)}),t.watch(()=>e.merge,h=>{ye()},{immediate:!0}),t.onBeforeUnmount(()=>{p()}),{presetModeName:r,cmOptions:l,cminstance:o,content:a,ready:he,resize:d,refresh:g,containerHeight:s,instanceName:e.name||((I=(N=i==null?void 0:i.parent)==null?void 0:N.type)==null?void 0:I.name)||void 0,presetRef:u}}});function fe(e,n,o,a,r,l){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["codemirror-container",{merge:e.$props.merge,bordered:e.$props.border||e.$props.merge,"width-auto":!e.$props.width||e.$props.width=="100%","height-auto":!e.$props.height||e.$props.height=="100%"}]),style:t.normalizeStyle({height:e.containerHeight+"px"})},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.presetModeName),t.mergeProps({ref:"presetRef",cminstance:e.cminstance,"onUpdate:cminstance":n[0]||(n[0]=i=>e.cminstance=i),style:{height:"100%"}},V(M(M({},e.$props),e.$attrs),{options:e.cmOptions,name:e.instanceName,content:e.content}),{onReady:e.ready}),null,16,["cminstance","onReady"]))],6)}var E=_(ue,[["render",fe]]),Ee="";const me=(e,n)=>(n&&n.options&&(E.props.globalOptions.default=()=>n.options),e.component((n==null?void 0:n.componentName)||"Codemirror",E),e),ge=window.CodeMirror||C.default,pe=me;function styleInject(css,ref){if(ref===void 0){ref={}}var insertAt=ref.insertAt;if(!css||typeof document==="undefined"){return}var head=document.head||document.getElementsByTagName("head")[0];var style=document.createElement("style");style.type="text/css";if(insertAt==="top"){if(head.firstChild){head.insertBefore(style,head.firstChild)}else{head.appendChild(style)}}else{head.appendChild(style)}if(style.styleSheet){style.styleSheet.cssText=css}else{style.appendChild(document.createTextNode(css))}};styleInject(`.codemirror-container {
`),d=document.createElement("span"),p=r[1];d.className=`c-editor--log__${p}`;let s=0;for(let m=0;m<i.length;m++){const w=i[m],y=g[m],S=d.cloneNode(!1);S.innerText=y,n.push({start:r.index+s,end:r.index+s+w.length,node:S}),s=s+w.length+1}r=a.exec(e)}}return o(),n}function Y(e,n=""){return`[${x()}] <${n}> ${e}`}function ee(e,n,o){const r=new Array(Math.max(n||15,5)).join(o||"=");return`${r}${e}${r}`}const v=[{regex:/(\[.*?\])([ \t]*)(<error>[ \t])(.+)/,token:["tag","","error.strong","error.strong"],sol:!0},{regex:/(\[.*?\])([ \t]*)(<info>)(.+)(.?)/,token:["tag","","bracket","bracket","hr"],sol:!0},{regex:/(\[.*?\])([ \t]*)(<warning>)(.+)(.?)/,token:["tag","","comment","comment","hr"],sol:!0}];C.default.defineSimpleMode("fclog",{start:[...v,{regex:/.*/,token:"hr"}],error:[...v,{regex:/.*/,token:"error.strong"}],info:[...v,{regex:/.*/,token:"bracket"}],warning:[...v,{regex:/.*\[/,token:"comment"}]}),C.default.defineSimpleMode("log",{start:[{regex:/^[=]+[^=]*[=]+/,token:"strong"},{regex:/([^\w])([A-Z][\w]*)/,token:["","string"]},{regex:/(^[A-Z][\w]*)/,token:"string"}]});const te=window.CodeMirror||C.default,ne=t.defineComponent({name:"CodemirrorFclog",props:{value:{type:String,default:""},name:{type:String,default:`cm-textarea-${+new Date}`},options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})},placeholder:{type:String,default:""}},emits:["update:cminstance","ready"],setup(e,{emit:n}){const o=t.ref(),a=t.ref(null),r=(i=e.cminstance)=>{i.getAllMarks().forEach(p=>p.clear());const g=i.getValue(),d=[].concat(L(g)).concat(T(g));for(let p=0;p<d.length;p++){const s=d[p];i.markText(i.posFromIndex(s.start),i.posFromIndex(s.end),{replacedWith:s.node})}},l=()=>{var i;a.value=t.markRaw(te.fromTextArea(o.value,e.options)),n("update:cminstance",t.unref(a)),(i=a.value)==null||i.on("change",r)};return t.watch(()=>e.cminstance,i=>{var u;i&&(r(e.cminstance),(u=e.cminstance)==null||u.setValue(e.value),n("ready",a))},{deep:!0,immediate:!0}),t.onMounted(()=>{l()}),{initialize:l,textarea:o}}}),re=["name","placeholder"];function oe(e,n,o,a,r,l){return t.openBlock(),t.createElementBlock("textarea",{ref:"textarea",name:e.$props.name,placeholder:e.$props.placeholder},null,8,re)}var ae=_(ne,[["render",oe]]);const D={"update:value":e=>e,change:(e,n)=>({value:e,cm:n}),input:e=>e,ready:e=>e},ce=["changes","scroll","beforeChange","cursorActivity","keyHandled","inputRead","electricInput","beforeSelectionChange","viewportChange","swapDoc","gutterClick","gutterContextMenu","focus","blur","refresh","optionChange","scrollCursorIntoView","update"],se=()=>{const e={};return ce.forEach(n=>{e[n]=(...o)=>o}),e},O={mode:"text",theme:"default",lineNumbers:!0,smartIndent:!0,indentUnit:2};function ie(e){Promise.resolve().then(()=>{const n=e.getScrollInfo();e.scrollTo(n.left,n.height)})}const le=({props:e,cminstance:n,emit:o,internalInstance:a,content:r})=>{const l=()=>{const u=[];return Object.keys(a==null?void 0:a.vnode.props).forEach(g=>{if(g.startsWith("on")){const d=g.replace(g[2],g[2].toLowerCase()).slice(2);!D[d]&&u.push(d)}}),u};return{listenerEvents:()=>{n.value.on("change",d=>{const p=d.getValue();p!==r.value&&(r.value=p,o("update:value",r.value),o("input",r.value),Promise.resolve().then(()=>{o("change",r.value,d)}),e.keepCursorInEnd&&ie(d))});const u={};l().filter(d=>!u[d]&&(u[d]=!0)).forEach(d=>{n.value.on(d,(...p)=>{o(d,...p)})})}}};function de({props:e,cminstance:n,presetRef:o}){const a=t.ref(null),r=t.ref(null),l=()=>{t.nextTick(()=>{var s;(s=n.value)==null||s.refresh()})},i=(s=e.width,m=e.height)=>{var y;a.value=String(s).replace("px",""),r.value=String(m).replace("px","");const w=r.value;(y=n.value)==null||y.setSize(a.value,w)},u=()=>{var m;const s=(m=n.value)==null?void 0:m.getWrapperElement();s==null||s.remove()},g=()=>{var m,w,y;const s=(m=n.value)==null?void 0:m.getDoc().getHistory();(w=o.value)==null||w.initialize(),u(),(y=n.value)==null||y.getDoc().setHistory(s)},d=()=>{const s=document.querySelector(".CodeMirror-gutters");return(s==null?void 0:s.style.left.replace("px",""))!=="0"};return{reload:g,refresh:l,resize:i,destroy:u,containerHeight:r,reviseStyle:()=>{if(l(),!d())return;const s=setInterval(()=>{d()?l():clearInterval(s)},60),m=setTimeout(()=>{clearInterval(s),clearTimeout(m)},400)}}}typeof Object.assign!="function"&&Object.defineProperty(Object,"assign",{value(e,n){if(e==null)throw new TypeError("Cannot convert undefined or null to object");const o=Object(e);for(let a=1;a<arguments.length;a++){const r=arguments[a];if(r!=null)for(const l in r)Object.prototype.hasOwnProperty.call(r,l)&&(o[l]=r[l])}return o},writable:!0,configurable:!0});const ue=t.defineComponent({name:"CodemirrorEditor",components:{Default:U,Merge:K,FcLog:ae},props:{value:{type:String,default:""},options:{type:Object,default:()=>O},globalOptions:{type:Object,default:()=>O},placeholder:{type:String,default:""},border:{type:Boolean,default:!1},width:{type:[String,Number],default:null},height:{type:[String,Number],default:null},keepCursorInEnd:{type:Boolean,default:!1},merge:{type:Boolean,default:!1},name:{type:String,default:""},marker:{type:Function,default:()=>null},unseenLines:{type:Array,default:()=>[]}},emits:M(M({},D),se()),setup(e,{emit:n}){var N,I;const o=t.ref(null),a=t.ref(""),r=t.ref("Default"),l=t.ref(M(M(M({},O),e.globalOptions),e.options)),i=t.getCurrentInstance(),u=t.ref(null),{refresh:g,resize:d,destroy:p,containerHeight:s,reviseStyle:m}=de({props:e,cminstance:o,presetRef:u}),{listenerEvents:w}=le({props:e,cminstance:o,emit:n,internalInstance:i,content:a}),y=()=>{e.unseenLines!==void 0&&e.marker!==void 0&&e.unseenLines.forEach(h=>{var $,b;const k=($=o.value)==null?void 0:$.lineInfo(h);(b=o.value)==null||b.setGutterMarker(h,"breakpoints",(k==null?void 0:k.gutterMarkers)?null:e.marker())})},S=h=>{var $,b;const k=($=o.value)==null?void 0:$.getValue();h!==k&&((b=o.value)==null||b.setValue(h),a.value=h,m()),y()},he=()=>{w(),y(),d(),n("ready",o.value),t.watch([()=>e.width,()=>e.height],([h,k])=>{d(h,k)},{deep:!0})},ye=()=>{if(e.options.mode==="fclog"||e.options.mode==="log"){r.value="FcLog";return}if(e.merge){r.value="Merge";return}r.value="Default"};return t.watch(()=>e.options,h=>{var k;for(const $ in e.options)(k=o.value)==null||k.setOption($,h[$])},{deep:!0}),t.watch(()=>e.value,h=>{S(h)}),t.watch(()=>e.merge,h=>{ye()},{immediate:!0}),t.onBeforeUnmount(()=>{p()}),{presetModeName:r,cmOptions:l,cminstance:o,content:a,ready:he,resize:d,refresh:g,containerHeight:s,instanceName:e.name||((I=(N=i==null?void 0:i.parent)==null?void 0:N.type)==null?void 0:I.name)||void 0,presetRef:u}}});function fe(e,n,o,a,r,l){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["codemirror-container",{merge:e.$props.merge,bordered:e.$props.border||e.$props.merge,"width-auto":!e.$props.width||e.$props.width=="100%","height-auto":!e.$props.height||e.$props.height=="100%"}]),style:t.normalizeStyle({height:e.containerHeight+"px"})},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.presetModeName),t.mergeProps({ref:"presetRef",cminstance:e.cminstance,"onUpdate:cminstance":n[0]||(n[0]=i=>e.cminstance=i),style:{height:"100%"}},V(M(M({},e.$props),e.$attrs),{options:e.cmOptions,name:e.instanceName,content:e.content}),{onReady:e.ready}),null,16,["cminstance","onReady"]))],6)}var E=_(ue,[["render",fe]]),Ee="";const me=(e,n)=>(n&&n.options&&(E.props.globalOptions.default=()=>n.options),e.component((n==null?void 0:n.componentName)||"Codemirror",E),e),ge=window.CodeMirror||C.default,pe=me;function styleInject(css,ref){if(ref===void 0){ref={}}var insertAt=ref.insertAt;if(!css||typeof document==="undefined"){return}var head=document.head||document.getElementsByTagName("head")[0];var style=document.createElement("style");style.type="text/css";if(insertAt==="top"){if(head.firstChild){head.insertBefore(style,head.firstChild)}else{head.appendChild(style)}}else{head.appendChild(style)}if(style.styleSheet){style.styleSheet.cssText=css}else{style.appendChild(document.createTextNode(css))}};styleInject(`.codemirror-container {
position: relative;

@@ -8,0 +8,0 @@ display: inline-block;

@@ -15,3 +15,3 @@ import _CodeMirror from "codemirror";

* const app = createApp(App);
* app.use(VueCodemirror, { componentName: "customCodemirrorComponentName" });
* app.use(GlobalCmComponent, { componentName: "customCodemirrorComponentName" });
*/

@@ -18,0 +18,0 @@ declare const GlobalCmComponent: (app: App, config?: InstallConfig | undefined) => App<any>;

@@ -37,7 +37,7 @@ import type { Ref, PropType } from "vue";

width: {
type: PropType<string | number>;
type: PropType<string | number | null>;
default: null;
};
height: {
type: PropType<string | number>;
type: PropType<string | number | null>;
default: null;

@@ -308,3 +308,3 @@ };

ready: () => void;
resize: (width?: string | number, height?: string | number) => void;
resize: (width?: string | number | null, height?: string | number | null) => void;
refresh: () => void;

@@ -343,4 +343,4 @@ containerHeight: Ref<Nullable<string>>;

border: boolean;
width: string | number;
height: string | number;
width: string | number | null;
height: string | number | null;
keepCursorInEnd: boolean;

@@ -359,4 +359,4 @@ merge: boolean;

border: boolean;
width: string | number;
height: string | number;
width: string | number | null;
height: string | number | null;
keepCursorInEnd: boolean;

@@ -363,0 +363,0 @@ merge: boolean;

@@ -14,3 +14,3 @@ import type { Ref } from "vue";

refresh: () => void;
resize: (width?: string | number, height?: string | number) => void;
resize: (width?: string | number | null, height?: string | number | null) => void;
destroy: () => void;

@@ -17,0 +17,0 @@ containerHeight: Ref<Nullable<string>>;

@@ -9,4 +9,4 @@ import { EditorConfiguration } from "codemirror";

border?: boolean;
width: string | number;
height: string | number;
width: string | number | null;
height: string | number | null;
keepCursorInEnd: boolean;

@@ -13,0 +13,0 @@ merge?: boolean;

{
"name": "codemirror-editor-vue3",
"description": "CodeMirror component for Vue3",
"version": "2.0.3-beta",
"version": "2.0.3-beta1",
"license": "MIT",

@@ -56,2 +56,3 @@ "files": [

"publish": "git push && git push --tags && npm publish && npm run deploy-docs",
"publish-beta": "npm publish --tag=beta",
"docs-dev": "vitepress dev docs --open",

@@ -58,0 +59,0 @@ "docs-build": "vitepress build docs",

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