vue-codemirror6 1.2.0 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2022-2023 Masashi Yoshikawa
3
+ Copyright (c) 2022-2024 Masashi Yoshikawa
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/dist/index.es.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * @author Logue <logue@hotmail.co.jp>
6
6
  * @copyright 2022-2023 By Masashi Yoshikawa All rights reserved.
7
7
  * @license MIT
8
- * @version 1.1.32
8
+ * @version 1.2.3
9
9
  * @see {@link https://github.com/logue/vue-codemirror6}
10
10
  */
11
11
 
@@ -345,7 +345,7 @@ var oe = I({
345
345
  parent: n.value,
346
346
  state: s.create({ doc: a, extensions: h.value }),
347
347
  dispatch: (l) => {
348
- t.value.update([l]), !(l.changes.empty || !l.docChanged) && (o.emit("update:modelValue", l.state.doc.toString()), o.emit("change", l.state));
348
+ t.value.update([l]), !(l.changes.empty || !l.docChanged) && (o.emit("update:modelValue", l.state.doc), o.emit("change", l.state));
349
349
  }
350
350
  }), await k(), o.emit("ready", {
351
351
  view: t.value,
@@ -385,6 +385,7 @@ var oe = I({
385
385
  selection: O.create(a, l)
386
386
  }), _ = (a) => t.value.dispatch({
387
387
  selection: O.create(
388
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
388
389
  f.value.ranges.map((l) => l.extend(a(l)))
389
390
  )
390
391
  }), S = {
@@ -436,8 +437,8 @@ var oe = I({
436
437
  }
437
438
  });
438
439
  const ie = {
439
- version: "1.1.32",
440
- date: "2023-12-21T01:06:31.106Z"
440
+ version: "1.2.3",
441
+ date: "2024-01-19T23:49:21.953Z"
441
442
  };
442
443
  var ve = ie;
443
444
  const me = (e) => e.component("CodeMirror", oe);
@@ -5,9 +5,9 @@
5
5
  * @author Logue <logue@hotmail.co.jp>
6
6
  * @copyright 2022-2023 By Masashi Yoshikawa All rights reserved.
7
7
  * @license MIT
8
- * @version 1.1.32
8
+ * @version 1.2.3
9
9
  * @see {@link https://github.com/logue/vue-codemirror6}
10
10
  */
11
11
 
12
12
  var CodeMirror=function(u,n,y,r,i,f,E){"use strict";const V=e=>e?Object.entries(e).reduce((c,[o,d])=>(o=o.charAt(0).toUpperCase()+o.slice(1),o=`on${o}`,{...c,[o]:d}),{}):{};function p(e,c={},o){if(n.isVue2)return n.h(e,c,o);const{props:d,domProps:t,on:v,...g}=c,h=v?V(v):{};return n.h(e,{...g,...d,...t,...h},o)}const O=e=>typeof e=="function"?e():e;var b=n.defineComponent({name:"CodeMirror",model:{prop:"modelValue",event:"update:modelValue"},props:{modelValue:{type:String,default:""},theme:{type:Object,default:()=>{}},dark:{type:Boolean,default:!1},basic:{type:Boolean,default:!1},minimal:{type:Boolean,default:!1},placeholder:{type:String,default:void 0},wrap:{type:Boolean,default:!1},tab:{type:Boolean,default:!1},allowMultipleSelections:{type:Boolean,default:!1},tabSize:{type:Number,default:void 0},lineSeparator:{type:String,default:void 0},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},extensions:{type:Array,default:()=>[]},phrases:{type:Object,default:()=>{}},lang:{type:Object,default:()=>{}},linter:{type:Function,default:void 0},linterConfig:{type:Object,default:()=>({})},forceLinting:{type:Boolean,default:!1},gutter:{type:Boolean,defalt:!1},gutterConfig:{type:Object,default:()=>{}},tag:{type:String,default:"div"}},emits:{"update:modelValue":e=>!0,update:e=>!0,ready:e=>!0,focus:e=>!0,change:e=>!0,destroy:()=>!0},setup(e,c){const o=n.ref(),d=n.ref(e.modelValue),t=n.shallowRef(new r.EditorView),v=n.computed({get:()=>t.value.hasFocus,set:a=>{a&&t.value.focus()}}),g=n.computed({get:()=>t.value.state.selection,set:a=>t.value.dispatch({selection:a})}),h=n.computed({get:()=>t.value.state.selection.main.head,set:a=>t.value.dispatch({selection:{anchor:a}})}),B=n.computed({get:()=>t.value.state.toJSON(),set:a=>t.value.setState(i.EditorState.fromJSON(a))}),C=n.ref(0),m=n.ref(0),S=n.computed(()=>{const a=new i.Compartment,l=new i.Compartment;return[e.basic?y.basicSetup:void 0,e.minimal&&!e.basic?y.minimalSetup:void 0,r.EditorView.updateListener.of(s=>{c.emit("focus",t.value.hasFocus),C.value=t.value.state.doc.length,!(s.changes.empty||!s.docChanged)&&(e.linter&&(e.forceLinting&&f.forceLinting(t.value),m.value=e.linter(t.value).length),c.emit("update",s))}),r.EditorView.theme(e.theme,{dark:e.dark}),e.wrap?r.EditorView.lineWrapping:void 0,e.tab?r.keymap.of([E.indentWithTab]):void 0,i.EditorState.allowMultipleSelections.of(e.allowMultipleSelections),e.tabSize?l.of(i.EditorState.tabSize.of(e.tabSize)):void 0,e.phrases?i.EditorState.phrases.of(e.phrases):void 0,i.EditorState.readOnly.of(e.readonly),r.EditorView.editable.of(!e.disabled),e.lineSeparator?i.EditorState.lineSeparator.of(e.lineSeparator):void 0,e.lang?a.of(e.lang):void 0,e.linter?f.linter(e.linter,e.linterConfig):void 0,e.linter&&e.gutter?f.lintGutter(e.gutterConfig):void 0,e.placeholder?r.placeholder(e.placeholder):void 0,...e.extensions].filter(s=>!!s)});n.watch(S,a=>{t.value?.dispatch({effects:i.StateEffect.reconfigure.of(a)})},{immediate:!0}),n.watch(()=>e.modelValue,async a=>{t.value.composing||t.value.state.doc.toJSON().join(e.lineSeparator??`
13
- `)===a||t.value.dispatch({changes:{from:0,to:t.value.state.doc.length,insert:a},selection:t.value.state.selection,scrollIntoView:!0})},{immediate:!0}),n.onMounted(async()=>{let a=d.value;o.value&&(o.value.childNodes[0]&&(d.value!==""&&console.warn("[CodeMirror.vue] The <code-mirror> tag contains child elements that overwrite the `v-model` values."),a=o.value.childNodes[0].innerText.trim()),t.value=new r.EditorView({parent:o.value,state:i.EditorState.create({doc:a,extensions:S.value}),dispatch:l=>{t.value.update([l]),!(l.changes.empty||!l.docChanged)&&(c.emit("update:modelValue",l.state.doc.toString()),c.emit("change",l.state))}}),await n.nextTick(),c.emit("ready",{view:t.value,state:t.value.state,container:o.value}))}),n.onUnmounted(()=>{t.value.destroy(),c.emit("destroy")});const j=()=>{!e.linter||!t.value||(e.forceLinting&&f.forceLinting(t.value),m.value=f.diagnosticCount(t.value.state))},L=()=>{t.value?.dispatch({effects:i.StateEffect.reconfigure.of([])}),t.value?.dispatch({effects:i.StateEffect.appendConfig.of(S.value)})},N=(a,l)=>t.value.state.sliceDoc(a,l),z=a=>t.value.state.doc.line(a+1).text,T=()=>t.value.state.doc.lines,R=()=>t.value.state.selection.main.head,_=()=>{let a;return(a=t.value.state.selection.ranges)!==null&&a!==void 0?a:[]},F=()=>{let a;return(a=t.value.state.sliceDoc(t.value.state.selection.main.from,t.value.state.selection.main.to))!==null&&a!==void 0?a:""},J=()=>{const a=t.value.state;return a?a.selection.ranges.map(l=>a.sliceDoc(l.from,l.to)):[]},x=()=>t.value.state.selection.ranges.some(a=>!a.empty),A=(a,l,s)=>t.value.dispatch({changes:{from:l,to:s,insert:a}}),P=a=>t.value.dispatch(t.value.state.replaceSelection(a)),U=a=>t.value.dispatch({selection:{anchor:a}}),W=(a,l)=>t.value.dispatch({selection:{anchor:a,head:l}}),G=(a,l)=>t.value.dispatch({selection:i.EditorSelection.create(a,l)}),I=a=>t.value.dispatch({selection:i.EditorSelection.create(g.value.ranges.map(l=>l.extend(a(l))))}),w={editor:o,view:t,cursor:h,selection:g,focus:v,length:C,json:B,diagnosticCount:m,dom:t.value.contentDOM,lint:j,forceReconfigure:L,getRange:N,getLine:z,lineCount:T,getCursor:R,listSelections:_,getSelection:F,getSelections:J,somethingSelected:x,replaceRange:A,replaceSelection:P,setCursor:U,setSelection:W,setSelections:G,extendSelectionsBy:I};return c.expose(w),w},render(){return p(this.$props.tag,{ref:"editor",class:"vue-codemirror"},this.$slots.default?p("aside",{style:"display: none;","aria-hidden":"true"},O(this.$slots.default)):void 0)}}),M={version:"1.1.32",date:"2023-12-21T01:06:31.106Z"};const $=e=>e.component("CodeMirror",b);return u.Meta=M,u.default=b,u.install=$,Object.defineProperty(u,"__esModule",{value:!0}),u}({},VueDemi,codemirror,view,state,lint,commands);
13
+ `)===a||t.value.dispatch({changes:{from:0,to:t.value.state.doc.length,insert:a},selection:t.value.state.selection,scrollIntoView:!0})},{immediate:!0}),n.onMounted(async()=>{let a=d.value;o.value&&(o.value.childNodes[0]&&(d.value!==""&&console.warn("[CodeMirror.vue] The <code-mirror> tag contains child elements that overwrite the `v-model` values."),a=o.value.childNodes[0].innerText.trim()),t.value=new r.EditorView({parent:o.value,state:i.EditorState.create({doc:a,extensions:S.value}),dispatch:l=>{t.value.update([l]),!(l.changes.empty||!l.docChanged)&&(c.emit("update:modelValue",l.state.doc),c.emit("change",l.state))}}),await n.nextTick(),c.emit("ready",{view:t.value,state:t.value.state,container:o.value}))}),n.onUnmounted(()=>{t.value.destroy(),c.emit("destroy")});const j=()=>{!e.linter||!t.value||(e.forceLinting&&f.forceLinting(t.value),m.value=f.diagnosticCount(t.value.state))},L=()=>{t.value?.dispatch({effects:i.StateEffect.reconfigure.of([])}),t.value?.dispatch({effects:i.StateEffect.appendConfig.of(S.value)})},N=(a,l)=>t.value.state.sliceDoc(a,l),z=a=>t.value.state.doc.line(a+1).text,T=()=>t.value.state.doc.lines,R=()=>t.value.state.selection.main.head,_=()=>{let a;return(a=t.value.state.selection.ranges)!==null&&a!==void 0?a:[]},F=()=>{let a;return(a=t.value.state.sliceDoc(t.value.state.selection.main.from,t.value.state.selection.main.to))!==null&&a!==void 0?a:""},J=()=>{const a=t.value.state;return a?a.selection.ranges.map(l=>a.sliceDoc(l.from,l.to)):[]},x=()=>t.value.state.selection.ranges.some(a=>!a.empty),A=(a,l,s)=>t.value.dispatch({changes:{from:l,to:s,insert:a}}),P=a=>t.value.dispatch(t.value.state.replaceSelection(a)),U=a=>t.value.dispatch({selection:{anchor:a}}),W=(a,l)=>t.value.dispatch({selection:{anchor:a,head:l}}),G=(a,l)=>t.value.dispatch({selection:i.EditorSelection.create(a,l)}),I=a=>t.value.dispatch({selection:i.EditorSelection.create(g.value.ranges.map(l=>l.extend(a(l))))}),w={editor:o,view:t,cursor:h,selection:g,focus:v,length:C,json:B,diagnosticCount:m,dom:t.value.contentDOM,lint:j,forceReconfigure:L,getRange:N,getLine:z,lineCount:T,getCursor:R,listSelections:_,getSelection:F,getSelections:J,somethingSelected:x,replaceRange:A,replaceSelection:P,setCursor:U,setSelection:W,setSelections:G,extendSelectionsBy:I};return c.expose(w),w},render(){return p(this.$props.tag,{ref:"editor",class:"vue-codemirror"},this.$slots.default?p("aside",{style:"display: none;","aria-hidden":"true"},O(this.$slots.default)):void 0)}}),M={version:"1.2.3",date:"2024-01-19T23:49:21.953Z"};const $=e=>e.component("CodeMirror",b);return u.Meta=M,u.default=b,u.install=$,Object.defineProperty(u,"__esModule",{value:!0}),u}({},VueDemi,codemirror,view,state,lint,commands);
package/dist/index.umd.js CHANGED
@@ -5,9 +5,9 @@
5
5
  * @author Logue <logue@hotmail.co.jp>
6
6
  * @copyright 2022-2023 By Masashi Yoshikawa All rights reserved.
7
7
  * @license MIT
8
- * @version 1.1.32
8
+ * @version 1.2.3
9
9
  * @see {@link https://github.com/logue/vue-codemirror6}
10
10
  */
11
11
 
12
12
  (function(l,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue-demi"),require("codemirror"),require("@codemirror/view"),require("@codemirror/state"),require("@codemirror/lint"),require("@codemirror/commands")):typeof define=="function"&&define.amd?define(["exports","vue-demi","codemirror","@codemirror/view","@codemirror/state","@codemirror/lint","@codemirror/commands"],o):(l=typeof globalThis<"u"?globalThis:l||self,o(l.CodeMirror={},l.VueDemi,l.codemirror,l.view,l.state,l.lint,l.commands))})(this,function(l,o,y,c,r,f,E){"use strict";const V=e=>e?Object.entries(e).reduce((d,[i,u])=>(i=i.charAt(0).toUpperCase()+i.slice(1),i=`on${i}`,{...d,[i]:u}),{}):{};function p(e,d={},i){if(o.isVue2)return o.h(e,d,i);const{props:u,domProps:t,on:v,...m}=d,h=v?V(v):{};return o.h(e,{...m,...u,...t,...h},i)}const O=e=>typeof e=="function"?e():e;var w=o.defineComponent({name:"CodeMirror",model:{prop:"modelValue",event:"update:modelValue"},props:{modelValue:{type:String,default:""},theme:{type:Object,default:()=>{}},dark:{type:Boolean,default:!1},basic:{type:Boolean,default:!1},minimal:{type:Boolean,default:!1},placeholder:{type:String,default:void 0},wrap:{type:Boolean,default:!1},tab:{type:Boolean,default:!1},allowMultipleSelections:{type:Boolean,default:!1},tabSize:{type:Number,default:void 0},lineSeparator:{type:String,default:void 0},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},extensions:{type:Array,default:()=>[]},phrases:{type:Object,default:()=>{}},lang:{type:Object,default:()=>{}},linter:{type:Function,default:void 0},linterConfig:{type:Object,default:()=>({})},forceLinting:{type:Boolean,default:!1},gutter:{type:Boolean,defalt:!1},gutterConfig:{type:Object,default:()=>{}},tag:{type:String,default:"div"}},emits:{"update:modelValue":e=>!0,update:e=>!0,ready:e=>!0,focus:e=>!0,change:e=>!0,destroy:()=>!0},setup(e,d){const i=o.ref(),u=o.ref(e.modelValue),t=o.shallowRef(new c.EditorView),v=o.computed({get:()=>t.value.hasFocus,set:a=>{a&&t.value.focus()}}),m=o.computed({get:()=>t.value.state.selection,set:a=>t.value.dispatch({selection:a})}),h=o.computed({get:()=>t.value.state.selection.main.head,set:a=>t.value.dispatch({selection:{anchor:a}})}),B=o.computed({get:()=>t.value.state.toJSON(),set:a=>t.value.setState(r.EditorState.fromJSON(a))}),C=o.ref(0),g=o.ref(0),S=o.computed(()=>{const a=new r.Compartment,n=new r.Compartment;return[e.basic?y.basicSetup:void 0,e.minimal&&!e.basic?y.minimalSetup:void 0,c.EditorView.updateListener.of(s=>{d.emit("focus",t.value.hasFocus),C.value=t.value.state.doc.length,!(s.changes.empty||!s.docChanged)&&(e.linter&&(e.forceLinting&&f.forceLinting(t.value),g.value=e.linter(t.value).length),d.emit("update",s))}),c.EditorView.theme(e.theme,{dark:e.dark}),e.wrap?c.EditorView.lineWrapping:void 0,e.tab?c.keymap.of([E.indentWithTab]):void 0,r.EditorState.allowMultipleSelections.of(e.allowMultipleSelections),e.tabSize?n.of(r.EditorState.tabSize.of(e.tabSize)):void 0,e.phrases?r.EditorState.phrases.of(e.phrases):void 0,r.EditorState.readOnly.of(e.readonly),c.EditorView.editable.of(!e.disabled),e.lineSeparator?r.EditorState.lineSeparator.of(e.lineSeparator):void 0,e.lang?a.of(e.lang):void 0,e.linter?f.linter(e.linter,e.linterConfig):void 0,e.linter&&e.gutter?f.lintGutter(e.gutterConfig):void 0,e.placeholder?c.placeholder(e.placeholder):void 0,...e.extensions].filter(s=>!!s)});o.watch(S,a=>{t.value?.dispatch({effects:r.StateEffect.reconfigure.of(a)})},{immediate:!0}),o.watch(()=>e.modelValue,async a=>{t.value.composing||t.value.state.doc.toJSON().join(e.lineSeparator??`
13
- `)===a||t.value.dispatch({changes:{from:0,to:t.value.state.doc.length,insert:a},selection:t.value.state.selection,scrollIntoView:!0})},{immediate:!0}),o.onMounted(async()=>{let a=u.value;i.value&&(i.value.childNodes[0]&&(u.value!==""&&console.warn("[CodeMirror.vue] The <code-mirror> tag contains child elements that overwrite the `v-model` values."),a=i.value.childNodes[0].innerText.trim()),t.value=new c.EditorView({parent:i.value,state:r.EditorState.create({doc:a,extensions:S.value}),dispatch:n=>{t.value.update([n]),!(n.changes.empty||!n.docChanged)&&(d.emit("update:modelValue",n.state.doc.toString()),d.emit("change",n.state))}}),await o.nextTick(),d.emit("ready",{view:t.value,state:t.value.state,container:i.value}))}),o.onUnmounted(()=>{t.value.destroy(),d.emit("destroy")});const j=()=>{!e.linter||!t.value||(e.forceLinting&&f.forceLinting(t.value),g.value=f.diagnosticCount(t.value.state))},L=()=>{t.value?.dispatch({effects:r.StateEffect.reconfigure.of([])}),t.value?.dispatch({effects:r.StateEffect.appendConfig.of(S.value)})},T=(a,n)=>t.value.state.sliceDoc(a,n),q=a=>t.value.state.doc.line(a+1).text,x=()=>t.value.state.doc.lines,N=()=>t.value.state.selection.main.head,z=()=>{let a;return(a=t.value.state.selection.ranges)!==null&&a!==void 0?a:[]},R=()=>{let a;return(a=t.value.state.sliceDoc(t.value.state.selection.main.from,t.value.state.selection.main.to))!==null&&a!==void 0?a:""},_=()=>{const a=t.value.state;return a?a.selection.ranges.map(n=>a.sliceDoc(n.from,n.to)):[]},F=()=>t.value.state.selection.ranges.some(a=>!a.empty),J=(a,n,s)=>t.value.dispatch({changes:{from:n,to:s,insert:a}}),A=a=>t.value.dispatch(t.value.state.replaceSelection(a)),P=a=>t.value.dispatch({selection:{anchor:a}}),U=(a,n)=>t.value.dispatch({selection:{anchor:a,head:n}}),W=(a,n)=>t.value.dispatch({selection:r.EditorSelection.create(a,n)}),G=a=>t.value.dispatch({selection:r.EditorSelection.create(m.value.ranges.map(n=>n.extend(a(n))))}),b={editor:i,view:t,cursor:h,selection:m,focus:v,length:C,json:B,diagnosticCount:g,dom:t.value.contentDOM,lint:j,forceReconfigure:L,getRange:T,getLine:q,lineCount:x,getCursor:N,listSelections:z,getSelection:R,getSelections:_,somethingSelected:F,replaceRange:J,replaceSelection:A,setCursor:P,setSelection:U,setSelections:W,extendSelectionsBy:G};return d.expose(b),b},render(){return p(this.$props.tag,{ref:"editor",class:"vue-codemirror"},this.$slots.default?p("aside",{style:"display: none;","aria-hidden":"true"},O(this.$slots.default)):void 0)}}),M={version:"1.1.32",date:"2023-12-21T01:06:31.106Z"};const $=e=>e.component("CodeMirror",w);l.Meta=M,l.default=w,l.install=$,Object.defineProperty(l,"__esModule",{value:!0})});
13
+ `)===a||t.value.dispatch({changes:{from:0,to:t.value.state.doc.length,insert:a},selection:t.value.state.selection,scrollIntoView:!0})},{immediate:!0}),o.onMounted(async()=>{let a=u.value;i.value&&(i.value.childNodes[0]&&(u.value!==""&&console.warn("[CodeMirror.vue] The <code-mirror> tag contains child elements that overwrite the `v-model` values."),a=i.value.childNodes[0].innerText.trim()),t.value=new c.EditorView({parent:i.value,state:r.EditorState.create({doc:a,extensions:S.value}),dispatch:n=>{t.value.update([n]),!(n.changes.empty||!n.docChanged)&&(d.emit("update:modelValue",n.state.doc),d.emit("change",n.state))}}),await o.nextTick(),d.emit("ready",{view:t.value,state:t.value.state,container:i.value}))}),o.onUnmounted(()=>{t.value.destroy(),d.emit("destroy")});const j=()=>{!e.linter||!t.value||(e.forceLinting&&f.forceLinting(t.value),g.value=f.diagnosticCount(t.value.state))},L=()=>{t.value?.dispatch({effects:r.StateEffect.reconfigure.of([])}),t.value?.dispatch({effects:r.StateEffect.appendConfig.of(S.value)})},T=(a,n)=>t.value.state.sliceDoc(a,n),q=a=>t.value.state.doc.line(a+1).text,x=()=>t.value.state.doc.lines,N=()=>t.value.state.selection.main.head,z=()=>{let a;return(a=t.value.state.selection.ranges)!==null&&a!==void 0?a:[]},R=()=>{let a;return(a=t.value.state.sliceDoc(t.value.state.selection.main.from,t.value.state.selection.main.to))!==null&&a!==void 0?a:""},_=()=>{const a=t.value.state;return a?a.selection.ranges.map(n=>a.sliceDoc(n.from,n.to)):[]},F=()=>t.value.state.selection.ranges.some(a=>!a.empty),J=(a,n,s)=>t.value.dispatch({changes:{from:n,to:s,insert:a}}),A=a=>t.value.dispatch(t.value.state.replaceSelection(a)),P=a=>t.value.dispatch({selection:{anchor:a}}),U=(a,n)=>t.value.dispatch({selection:{anchor:a,head:n}}),W=(a,n)=>t.value.dispatch({selection:r.EditorSelection.create(a,n)}),G=a=>t.value.dispatch({selection:r.EditorSelection.create(m.value.ranges.map(n=>n.extend(a(n))))}),b={editor:i,view:t,cursor:h,selection:m,focus:v,length:C,json:B,diagnosticCount:g,dom:t.value.contentDOM,lint:j,forceReconfigure:L,getRange:T,getLine:q,lineCount:x,getCursor:N,listSelections:z,getSelection:R,getSelections:_,somethingSelected:F,replaceRange:J,replaceSelection:A,setCursor:P,setSelection:U,setSelections:W,extendSelectionsBy:G};return d.expose(b),b},render(){return p(this.$props.tag,{ref:"editor",class:"vue-codemirror"},this.$slots.default?p("aside",{style:"display: none;","aria-hidden":"true"},O(this.$slots.default)):void 0)}}),M={version:"1.2.3",date:"2024-01-19T23:49:21.953Z"};const $=e=>e.component("CodeMirror",w);l.Meta=M,l.default=w,l.install=$,Object.defineProperty(l,"__esModule",{value:!0})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "vue-codemirror6",
4
- "version": "1.2.0",
4
+ "version": "1.2.3",
5
5
  "license": "MIT",
6
6
  "description": "CodeMirror6 Component for vue2 and vue3.",
7
7
  "keywords": [
@@ -60,14 +60,14 @@
60
60
  "scripts": {
61
61
  "dev": "vite",
62
62
  "clean": "rimraf node_modules/.vite",
63
- "type-check": "tsc --noEmit --composite false",
64
63
  "build": "run-p type-check \"build-only {@}\" --",
65
64
  "build:analyze": "vite build --mode=analyze",
66
65
  "build:clean": "rimraf dist docs",
67
66
  "build:docs": "vite build --mode=docs",
68
- "build-only": "vite build",
69
67
  "lint": "eslint . --fix --cache --cache-location ./node_modules/.vite/vite-plugin-eslint && prettier . --write",
70
68
  "preview": "vite preview --mode=docs",
69
+ "build-only": "vite build",
70
+ "type-check": "vue-tsc --build --force",
71
71
  "prepare": "husky install",
72
72
  "version": "auto-changelog -p && git add CHANGELOG.md"
73
73
  },
@@ -76,21 +76,21 @@
76
76
  "vue-demi": "latest"
77
77
  },
78
78
  "peerDependencies": {
79
- "vue": "^2.7.14 || ^3.2"
79
+ "vue": "^2.7.14 || ^3.4"
80
80
  },
81
81
  "devDependencies": {
82
82
  "@codemirror/lang-javascript": "^6.2.1",
83
83
  "@codemirror/lang-json": "^6.0.1",
84
- "@codemirror/lang-markdown": "^6.2.3",
85
- "@codemirror/lang-vue": "^0.1.2",
86
- "@tsconfig/node-lts": "^20.1.0",
87
- "@types/node": "^20.10.5",
88
- "@typescript-eslint/eslint-plugin": "^6.15.0",
89
- "@vitejs/plugin-vue": "^4.5.2",
90
- "@vue/compiler-sfc": "^3.3.13",
91
- "@vue/eslint-config-prettier": "^8.0.0",
84
+ "@codemirror/lang-markdown": "^6.2.4",
85
+ "@codemirror/lang-vue": "0.1.2",
86
+ "@tsconfig/node-lts": "^20.1.1",
87
+ "@types/node": "^20.11.5",
88
+ "@typescript-eslint/eslint-plugin": "^6.19.0",
89
+ "@vitejs/plugin-vue": "^5.0.3",
90
+ "@vue/compiler-sfc": "^3.4.15",
91
+ "@vue/eslint-config-prettier": "^9.0.0",
92
92
  "@vue/tsconfig": "^0.5.1",
93
- "@vueuse/core": "^10.7.0",
93
+ "@vueuse/core": "^10.7.2",
94
94
  "bootstrap": "^5.3.2",
95
95
  "eslint": "^8.56.0",
96
96
  "eslint-config-standard-with-typescript": "^43.0.0",
@@ -99,28 +99,28 @@
99
99
  "eslint-linter-browserify": "^8.56.0",
100
100
  "eslint-plugin-html": "^7.1.0",
101
101
  "eslint-plugin-import": "^2.29.1",
102
- "eslint-plugin-n": "^16.5.0",
102
+ "eslint-plugin-n": "^16.6.2",
103
103
  "eslint-plugin-promise": "^6.1.1",
104
104
  "eslint-plugin-tsdoc": "^0.2.17",
105
105
  "eslint-plugin-vue": "latest",
106
- "eslint-plugin-vuejs-accessibility": "^2.2.0",
106
+ "eslint-plugin-vuejs-accessibility": "^2.2.1",
107
107
  "eslint-plugin-yaml": "^0.5.0",
108
108
  "husky": "^8.0.3",
109
109
  "lint-staged": "^15.2.0",
110
110
  "npm-run-all": "^4.1.5",
111
- "prettier": "^3.1.1",
111
+ "prettier": "^3.2.4",
112
112
  "rimraf": "^5.0.5",
113
- "rollup-plugin-visualizer": "^5.11.0",
114
- "sass": "^1.69.5",
113
+ "rollup-plugin-visualizer": "^5.12.0",
114
+ "sass": "^1.70.0",
115
115
  "typescript": "^5.3.3",
116
- "vite": "^5.0.10",
116
+ "vite": "^5.0.12",
117
117
  "vite-plugin-banner": "^0.7.1",
118
118
  "vite-plugin-checker": "^0.6.2",
119
- "vite-plugin-dts": "^3.6.4",
120
- "vue": "^3.3.13",
121
- "vue-eslint-parser": "^9.3.2",
122
- "vue-markdown-wasm": "^0.3.14",
123
- "vue-tsc": "^1.8.25"
119
+ "vite-plugin-dts": "^3.7.1",
120
+ "vue": "^3.4.15",
121
+ "vue-eslint-parser": "^9.4.0",
122
+ "vue-markdown-wasm": "^0.4.0",
123
+ "vue-tsc": "^1.8.27"
124
124
  },
125
125
  "husky": {
126
126
  "hooks": {
@@ -486,7 +486,7 @@ export default defineComponent({
486
486
 
487
487
  // console.log(view.state.doc.toString(), tr);
488
488
  // state.toString() is not defined, so use toJSON and toText function to convert string.
489
- context.emit('update:modelValue', (tr.state.doc as any).toString());
489
+ context.emit('update:modelValue', tr.state.doc);
490
490
  // Emit EditorState
491
491
  context.emit('change', tr.state);
492
492
  },
@@ -656,6 +656,7 @@ export default defineComponent({
656
656
  const extendSelectionsBy = (f: any): void =>
657
657
  view.value.dispatch({
658
658
  selection: EditorSelection.create(
659
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
659
660
  selection.value.ranges.map((r: SelectionRange) => r.extend(f(r)))
660
661
  ),
661
662
  });