vue-codemirror6 1.2.0 → 1.2.2
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 +1 -1
- package/dist/index.es.js +3 -3
- package/dist/index.iife.js +2 -2
- package/dist/index.umd.js +2 -2
- package/package.json +24 -24
- package/src/components/CodeMirror.ts +2 -1
package/LICENSE
CHANGED
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.
|
|
8
|
+
* @version 1.2.0
|
|
9
9
|
* @see {@link https://github.com/logue/vue-codemirror6}
|
|
10
10
|
*/
|
|
11
11
|
|
|
@@ -436,8 +436,8 @@ var oe = I({
|
|
|
436
436
|
}
|
|
437
437
|
});
|
|
438
438
|
const ie = {
|
|
439
|
-
version: "1.
|
|
440
|
-
date: "
|
|
439
|
+
version: "1.2.0",
|
|
440
|
+
date: "2024-01-08T15:53:56.825Z"
|
|
441
441
|
};
|
|
442
442
|
var ve = ie;
|
|
443
443
|
const me = (e) => e.component("CodeMirror", oe);
|
package/dist/index.iife.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.
|
|
8
|
+
* @version 1.2.0
|
|
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.
|
|
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.2.0",date:"2024-01-08T15:53:56.825Z"};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.
|
|
8
|
+
* @version 1.2.0
|
|
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.
|
|
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.2.0",date:"2024-01-08T15:53:56.825Z"};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.
|
|
4
|
+
"version": "1.2.2",
|
|
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.
|
|
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.
|
|
85
|
-
"@codemirror/lang-vue": "
|
|
86
|
-
"@tsconfig/node-lts": "^20.1.
|
|
87
|
-
"@types/node": "^20.
|
|
88
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
89
|
-
"@vitejs/plugin-vue": "^
|
|
90
|
-
"@vue/compiler-sfc": "^3.
|
|
91
|
-
"@vue/eslint-config-prettier": "^
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
111
|
+
"prettier": "^3.2.4",
|
|
112
112
|
"rimraf": "^5.0.5",
|
|
113
|
-
"rollup-plugin-visualizer": "^5.
|
|
114
|
-
"sass": "^1.
|
|
113
|
+
"rollup-plugin-visualizer": "^5.12.0",
|
|
114
|
+
"sass": "^1.70.0",
|
|
115
115
|
"typescript": "^5.3.3",
|
|
116
|
-
"vite": "^5.0.
|
|
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.
|
|
120
|
-
"vue": "^3.
|
|
121
|
-
"vue-eslint-parser": "^9.
|
|
122
|
-
"vue-markdown-wasm": "^0.
|
|
123
|
-
"vue-tsc": "^1.8.
|
|
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',
|
|
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
|
});
|