vue-codemirror6 0.5.3 → 0.6.0
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/README.md +28 -2
- package/dist/components/CodeMirror.d.ts +29 -10
- package/dist/components/CodeMirror.d.ts.map +1 -1
- package/dist/index.es.js +25 -21
- package/dist/index.umd.js +2 -2
- package/package.json +17 -21
package/README.md
CHANGED
|
@@ -26,7 +26,8 @@ yarn add vue-codemirror6 @vue/composition-api
|
|
|
26
26
|
|
|
27
27
|
| Props | Type | Information |
|
|
28
28
|
| ---------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
29
|
-
| basic | boolean | Use [
|
|
29
|
+
| basic | boolean | Use [basicSetup](https://codemirror.net/docs/ref/#codemirror.basicSetup). |
|
|
30
|
+
| minimal | boolean | Use [miniSetup](https://codemirror.net/docs/ref/#codemirror.minimalSetup). If a `basic` prop is also specified, that setting will take precedence. |
|
|
30
31
|
| dark | boolean | Toggle Darkmode. It can be changed in real time, but the input value will return to the initial value. |
|
|
31
32
|
| wrap | boolean | Line text wrapping. see [lineWrapping](https://codemirror.net/6/docs/ref/#view.EditorView.lineWrapping). |
|
|
32
33
|
| tab | boolean | Enables tab indentation. |
|
|
@@ -228,6 +229,28 @@ export default defineComponent({
|
|
|
228
229
|
</script>
|
|
229
230
|
```
|
|
230
231
|
|
|
232
|
+
## Methods
|
|
233
|
+
|
|
234
|
+
| Methods | Description |
|
|
235
|
+
| ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
|
|
236
|
+
| selection() | Get the [EditorSelection](https://codemirror.net/docs/ref/#state.EditorSelection) instance. |
|
|
237
|
+
| getRange(from?: number, to?: number) | Get the text between the given points in the editor. |
|
|
238
|
+
| getLine(number: number) | Get the content of line. |
|
|
239
|
+
| lineCount() | Get the number of lines in the editor. |
|
|
240
|
+
| getCursor() | Retrieve one end of the primary selection. |
|
|
241
|
+
| listSelections() | Retrieves a list of all current selections. |
|
|
242
|
+
| getSelection() | Get the currently selected code. |
|
|
243
|
+
| getSelections() | The length of the given array should be the same as the number of active selections. |
|
|
244
|
+
| somethingSelected() | Return true if any text is selected. |
|
|
245
|
+
| replaceRange(replacement: string \| Text, from: number, to: number) | Replace the part of the document between from and to with the given string. |
|
|
246
|
+
| replaceSelection(replacement: string \| Text) | Replace the selection(s) with the given string. |
|
|
247
|
+
| setCursor(position: number) | Set the cursor position. |
|
|
248
|
+
| setSelection(anchor: number, head?: number) | Set a single selection range. |
|
|
249
|
+
| setSelections(ranges: readonly SelectionRange[], primary?: number) | Sets a new set of selections. |
|
|
250
|
+
| extendSelectionsBy(f: Function) | Applies the given function to all existing selections, and calls extendSelections on the result. |
|
|
251
|
+
| focus() | Set focus |
|
|
252
|
+
| hasFocus() | is Focused |
|
|
253
|
+
|
|
231
254
|
## Recommendations
|
|
232
255
|
|
|
233
256
|
Since CodeMirror has a relatively large capacity, when using vite, it is recommended to set it to output as a separate file using the [`manualChunks`](https://vitejs.dev/guide/build.html#chunking-strategy) option at build time as shown below.
|
|
@@ -242,10 +265,13 @@ const config: UserConfig = {
|
|
|
242
265
|
// ...
|
|
243
266
|
codemirror: [
|
|
244
267
|
// Split CodeMirror code.
|
|
245
|
-
'
|
|
268
|
+
'vue-codemirror6'
|
|
269
|
+
'codemirror',
|
|
270
|
+
'@codemirror/autocomplete',
|
|
246
271
|
'@codemirror/commands',
|
|
247
272
|
'@codemirror/language',
|
|
248
273
|
'@codemirror/lint',
|
|
274
|
+
'@codemirror/search',
|
|
249
275
|
'@codemirror/state',
|
|
250
276
|
'@codemirror/view',
|
|
251
277
|
// Add the following as needed.
|
|
@@ -38,12 +38,21 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
38
38
|
/**
|
|
39
39
|
* Use Basic Setup
|
|
40
40
|
*
|
|
41
|
-
* @see {@link https://codemirror.net/
|
|
41
|
+
* @see {@link https://codemirror.net/docs/ref/#codemirror.basicSetup | basicSetup}
|
|
42
42
|
*/
|
|
43
43
|
basic: {
|
|
44
44
|
type: BooleanConstructor;
|
|
45
45
|
default: boolean;
|
|
46
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* Use Minimal Setup (The basic setting has priority.)
|
|
49
|
+
*
|
|
50
|
+
* @see {@link https://codemirror.net/docs/ref/#codemirror.minimalSetup | minimalSetup}
|
|
51
|
+
*/
|
|
52
|
+
minimal: {
|
|
53
|
+
type: BooleanConstructor;
|
|
54
|
+
default: boolean;
|
|
55
|
+
};
|
|
47
56
|
/**
|
|
48
57
|
* Line wrapping
|
|
49
58
|
*
|
|
@@ -125,20 +134,20 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
125
134
|
context: SetupContext<import("vue-demi").EmitsOptions>;
|
|
126
135
|
editor: Ref<Element | undefined>;
|
|
127
136
|
selection: () => EditorSelection;
|
|
128
|
-
getRange: (
|
|
129
|
-
getLine: (
|
|
137
|
+
getRange: (from?: number, to?: number) => string;
|
|
138
|
+
getLine: (number: number) => string;
|
|
130
139
|
lineCount: () => number;
|
|
131
140
|
getCursor: () => number;
|
|
132
141
|
listSelections: () => readonly SelectionRange[];
|
|
133
142
|
getSelection: () => string;
|
|
134
143
|
getSelections: () => string[];
|
|
135
144
|
somethingSelected: () => boolean;
|
|
136
|
-
replaceRange: (
|
|
137
|
-
replaceSelection: (
|
|
138
|
-
setCursor: (
|
|
139
|
-
setSelection: (anchor: number, head
|
|
140
|
-
setSelections: (ranges: readonly SelectionRange[],
|
|
141
|
-
extendSelectionsBy: (f:
|
|
145
|
+
replaceRange: (replacement: string | Text, from: number, to: number) => void;
|
|
146
|
+
replaceSelection: (replacement: string | Text) => void;
|
|
147
|
+
setCursor: (position: number) => void;
|
|
148
|
+
setSelection: (anchor: number, head?: number) => void;
|
|
149
|
+
setSelections: (ranges: readonly SelectionRange[], primary?: number) => void;
|
|
150
|
+
extendSelectionsBy: (f: Function) => void;
|
|
142
151
|
focus: () => void;
|
|
143
152
|
hasFocus: () => boolean;
|
|
144
153
|
}, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, import("vue-demi").EmitsOptions, "update:modelValue" | "update", import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
@@ -166,12 +175,21 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
166
175
|
/**
|
|
167
176
|
* Use Basic Setup
|
|
168
177
|
*
|
|
169
|
-
* @see {@link https://codemirror.net/
|
|
178
|
+
* @see {@link https://codemirror.net/docs/ref/#codemirror.basicSetup | basicSetup}
|
|
170
179
|
*/
|
|
171
180
|
basic: {
|
|
172
181
|
type: BooleanConstructor;
|
|
173
182
|
default: boolean;
|
|
174
183
|
};
|
|
184
|
+
/**
|
|
185
|
+
* Use Minimal Setup (The basic setting has priority.)
|
|
186
|
+
*
|
|
187
|
+
* @see {@link https://codemirror.net/docs/ref/#codemirror.minimalSetup | minimalSetup}
|
|
188
|
+
*/
|
|
189
|
+
minimal: {
|
|
190
|
+
type: BooleanConstructor;
|
|
191
|
+
default: boolean;
|
|
192
|
+
};
|
|
175
193
|
/**
|
|
176
194
|
* Line wrapping
|
|
177
195
|
*
|
|
@@ -256,6 +274,7 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
256
274
|
};
|
|
257
275
|
dark: boolean;
|
|
258
276
|
basic: boolean;
|
|
277
|
+
minimal: boolean;
|
|
259
278
|
wrap: boolean;
|
|
260
279
|
tab: boolean;
|
|
261
280
|
readonly: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeMirror.d.ts","sourceRoot":"","sources":["../../src/components/CodeMirror.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,QAAQ,EACb,KAAK,GAAG,EACR,KAAK,YAAY,EAClB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"CodeMirror.d.ts","sourceRoot":"","sources":["../../src/components/CodeMirror.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,QAAQ,EACb,KAAK,GAAG,EACR,KAAK,YAAY,EAClB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,eAAe,EAA4B,MAAM,mBAAmB,CAAC;AAU9E,OAAO,KAAK,EACV,SAAS,EACT,cAAc,EACd,IAAI,EAEL,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,qBAAqB;AACrB,MAAM,WAAW,wBAAwB;IACvC,mBAAmB;IACnB,CAAC,CAAC,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACrD,4BAA4B;IAC5B,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;CACxC;AAED,2BAA2B;;IAWvB,kBAAkB;;;;;IAKlB;;;;OAIG;;;;;;;IAOH,gBAAgB;;;;;IAKhB;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAOH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH,kBAAkB;;;;;;;;qBAkJI,eAAe;sBAUZ,MAAM,OAAO,MAAM,KAAG,MAAM;sBAO5B,MAAM,KAAG,MAAM;qBAGlB,MAAM;qBAEN,MAAM;0BAED,SAAS,cAAc,EAAE;wBAE3B,MAAM;yBAML,MAAM,EAAE;6BAGJ,OAAO;gCAWtB,MAAM,GAAG,IAAI,QACpB,MAAM,MACR,MAAM;oCAW2B,MAAM,GAAG,IAAI;0BAOvB,MAAM;2BAQL,MAAM,SAAS,MAAM;4BASzC,SAAS,cAAc,EAAE,YACvB,MAAM;4BAUa,QAAQ;;oBAUlB,OAAO;;IA3W5B,kBAAkB;;;;;IAKlB;;;;OAIG;;;;;;;IAOH,gBAAgB;;;;;IAKhB;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAOH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;AA3HtB,wBA+ZG"}
|
package/dist/index.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isVue2, h as h$1, defineComponent, ref, toRefs, watch, onMounted, nextTick, onUnmounted, toRaw } from "vue-demi";
|
|
2
|
-
import { EditorState, EditorSelection } from "@codemirror/state";
|
|
2
|
+
import { EditorState, StateEffect, EditorSelection } from "@codemirror/state";
|
|
3
3
|
import { EditorView, keymap } from "@codemirror/view";
|
|
4
4
|
import { linter, lintGutter } from "@codemirror/lint";
|
|
5
|
-
import { basicSetup } from "
|
|
5
|
+
import { basicSetup, minimalSetup } from "codemirror";
|
|
6
6
|
import { indentWithTab } from "@codemirror/commands";
|
|
7
7
|
import { trim, compact } from "lodash";
|
|
8
8
|
const adaptOnsV3 = (ons) => {
|
|
@@ -47,6 +47,10 @@ var CodeMirror = defineComponent({
|
|
|
47
47
|
type: Boolean,
|
|
48
48
|
default: false
|
|
49
49
|
},
|
|
50
|
+
minimal: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false
|
|
53
|
+
},
|
|
50
54
|
wrap: {
|
|
51
55
|
type: Boolean,
|
|
52
56
|
default: false
|
|
@@ -104,25 +108,25 @@ var CodeMirror = defineComponent({
|
|
|
104
108
|
selection: previous
|
|
105
109
|
}));
|
|
106
110
|
});
|
|
107
|
-
watch(() => props.modelValue, (
|
|
111
|
+
watch(() => props.modelValue, (text) => view.dispatch({
|
|
112
|
+
changes: { from: 0, to: view.state.doc.length, insert: text }
|
|
113
|
+
}));
|
|
108
114
|
watch(dark, () => {
|
|
109
|
-
view.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}));
|
|
115
|
+
view.dispatch({
|
|
116
|
+
effects: StateEffect.appendConfig.of(EditorView.theme(props.theme, { dark: dark.value }))
|
|
117
|
+
});
|
|
113
118
|
});
|
|
114
119
|
onMounted(async () => {
|
|
120
|
+
let value = doc.value;
|
|
115
121
|
if (editor.value && editor.value.childNodes[0]) {
|
|
116
122
|
if (doc.value !== "") {
|
|
117
123
|
console.warn("[CodeMirror.vue] The <code-mirror> tag contains child elements that overwrite the `v-model` values.");
|
|
118
124
|
}
|
|
119
|
-
|
|
125
|
+
value = trim(editor.value.childNodes[0].innerText);
|
|
120
126
|
}
|
|
121
127
|
view = new EditorView({
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
extensions: getExtensions()
|
|
125
|
-
}),
|
|
128
|
+
doc: value,
|
|
129
|
+
extensions: getExtensions(),
|
|
126
130
|
parent: editor.value,
|
|
127
131
|
dispatch: (tr) => {
|
|
128
132
|
view.update([tr]);
|
|
@@ -138,6 +142,7 @@ var CodeMirror = defineComponent({
|
|
|
138
142
|
const getExtensions = () => {
|
|
139
143
|
const extensions = compact([
|
|
140
144
|
props.basic ? basicSetup : void 0,
|
|
145
|
+
props.minimal && !props.basic ? minimalSetup : void 0,
|
|
141
146
|
EditorView.updateListener.of((update) => emit("update", update)),
|
|
142
147
|
EditorView.theme(props.theme, { dark: dark.value }),
|
|
143
148
|
props.wrap ? EditorView.lineWrapping : void 0,
|
|
@@ -150,26 +155,25 @@ var CodeMirror = defineComponent({
|
|
|
150
155
|
props.linter && props.lintGutter ? lintGutter() : void 0,
|
|
151
156
|
...props.extensions
|
|
152
157
|
]);
|
|
153
|
-
console.debug("[CodeMirror.vue] Loaded extensions: ", extensions);
|
|
154
158
|
return extensions;
|
|
155
159
|
};
|
|
156
160
|
const selection = () => view.state.selection;
|
|
157
|
-
const getRange = (
|
|
158
|
-
const getLine = (
|
|
161
|
+
const getRange = (from, to) => view.state.sliceDoc(from, to);
|
|
162
|
+
const getLine = (number) => view.state.doc.line(number + 1).text;
|
|
159
163
|
const lineCount = () => view.state.doc.lines;
|
|
160
164
|
const getCursor = () => selection().main.head;
|
|
161
165
|
const listSelections = () => selection().ranges;
|
|
162
166
|
const getSelection = () => view.state.sliceDoc(selection().main.from, selection().main.to);
|
|
163
167
|
const getSelections = () => selection().ranges.map((r) => view.state.sliceDoc(r.from, r.to));
|
|
164
168
|
const somethingSelected = () => selection().ranges.some((r) => !r.empty);
|
|
165
|
-
const replaceRange = (
|
|
166
|
-
changes: { from, to, insert:
|
|
169
|
+
const replaceRange = (replacement, from, to) => view.dispatch({
|
|
170
|
+
changes: { from, to, insert: replacement }
|
|
167
171
|
});
|
|
168
|
-
const replaceSelection = (
|
|
169
|
-
const setCursor = (
|
|
172
|
+
const replaceSelection = (replacement) => view.dispatch(view.state.replaceSelection(replacement));
|
|
173
|
+
const setCursor = (position) => view.dispatch({ selection: { anchor: position } });
|
|
170
174
|
const setSelection = (anchor, head) => view.dispatch({ selection: { anchor, head } });
|
|
171
|
-
const setSelections = (ranges,
|
|
172
|
-
selection: EditorSelection.create(ranges,
|
|
175
|
+
const setSelections = (ranges, primary) => view.dispatch({
|
|
176
|
+
selection: EditorSelection.create(ranges, primary)
|
|
173
177
|
});
|
|
174
178
|
const extendSelectionsBy = (f) => view.dispatch({
|
|
175
179
|
selection: EditorSelection.create(selection().ranges.map((r) => r.extend(f(r))))
|
package/dist/index.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(r,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue-demi"),require("@codemirror/state"),require("@codemirror/view"),require("@codemirror/lint"),require("
|
|
1
|
+
(function(r,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue-demi"),require("@codemirror/state"),require("@codemirror/view"),require("@codemirror/lint"),require("codemirror"),require("@codemirror/commands"),require("lodash")):typeof define=="function"&&define.amd?define(["exports","vue-demi","@codemirror/state","@codemirror/view","@codemirror/lint","codemirror","@codemirror/commands","lodash"],n):(r=typeof globalThis<"u"?globalThis:r||self,n(r.CodeMirror={},r.VueDemi,r.state,r.view,r.lint,r.codemirror,r.commands,r.lodash))})(this,function(r,n,f,d,p,g,V,S){"use strict";const C=e=>e?Object.entries(e).reduce((c,[a,l])=>(a=a.charAt(0).toUpperCase()+a.slice(1),a=`on${a}`,{...c,[a]:l}),{}):null,y=(e,c={},a)=>{if(n.isVue2)return n.h(e,c,a);const{props:l,domProps:u,on:m,...o}=c,h=m?C(m):{};return n.h(e,{...o,...l,...u,...h},a)},w=e=>typeof e=="function"?e():e;var v=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},wrap:{type:Boolean,default:!1},tab:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},extensions:{type:Array,default:()=>[]},phrases:{type:Object,default:()=>{}},lang:{type:Object,default:()=>{}},linter:{type:Function,default:void 0},lintGutter:{type:Boolean,defalt:!1}},emits:["update:modelValue","update"],setup(e,c){const a=n.ref(),{dark:l}=n.toRefs(e),u=n.ref(e.modelValue),m=c.emit;let o;n.watch(u,t=>{if(o.composing)return;const i=o.state.selection;o.setState(f.EditorState.create({doc:t,extensions:h(),selection:i}))}),n.watch(()=>e.modelValue,t=>o.dispatch({changes:{from:0,to:o.state.doc.length,insert:t}})),n.watch(l,()=>{o.dispatch({effects:f.StateEffect.appendConfig.of(d.EditorView.theme(e.theme,{dark:l.value}))})}),n.onMounted(async()=>{let t=u.value;a.value&&a.value.childNodes[0]&&(u.value!==""&&console.warn("[CodeMirror.vue] The <code-mirror> tag contains child elements that overwrite the `v-model` values."),t=S.trim(a.value.childNodes[0].innerText)),o=new d.EditorView({doc:t,extensions:h(),parent:a.value,dispatch:i=>{o.update([i]),!i.changes.empty&&(u.value=o.state.doc.toString(),m("update:modelValue",u.value))}}),await n.nextTick()}),n.onUnmounted(()=>o.destroy());const h=()=>S.compact([e.basic?g.basicSetup:void 0,e.minimal&&!e.basic?g.minimalSetup:void 0,d.EditorView.updateListener.of(i=>m("update",i)),d.EditorView.theme(e.theme,{dark:l.value}),e.wrap?d.EditorView.lineWrapping:void 0,e.tab?d.keymap.of([V.indentWithTab]):void 0,e.phrases?f.EditorState.phrases.of(e.phrases):void 0,e.readonly?f.EditorState.readOnly.of(e.readonly):void 0,e.editable?d.EditorView.editable.of(e.editable):void 0,e.lang?n.toRaw(e.lang):void 0,e.linter?p.linter(e.linter):void 0,e.linter&&e.lintGutter?p.lintGutter():void 0,...e.extensions]),s=()=>o.state.selection;return{context:c,editor:a,selection:s,getRange:(t,i)=>o.state.sliceDoc(t,i),getLine:t=>o.state.doc.line(t+1).text,lineCount:()=>o.state.doc.lines,getCursor:()=>s().main.head,listSelections:()=>s().ranges,getSelection:()=>o.state.sliceDoc(s().main.from,s().main.to),getSelections:()=>s().ranges.map(t=>o.state.sliceDoc(t.from,t.to)),somethingSelected:()=>s().ranges.some(t=>!t.empty),replaceRange:(t,i,E)=>o.dispatch({changes:{from:i,to:E,insert:t}}),replaceSelection:t=>o.dispatch(o.state.replaceSelection(t)),setCursor:t=>o.dispatch({selection:{anchor:t}}),setSelection:(t,i)=>o.dispatch({selection:{anchor:t,head:i}}),setSelections:(t,i)=>o.dispatch({selection:f.EditorSelection.create(t,i)}),extendSelectionsBy:t=>o.dispatch({selection:f.EditorSelection.create(s().ranges.map(i=>i.extend(t(i))))}),focus:()=>o.focus(),hasFocus:()=>o.hasFocus}},render(){return y("div",{ref:"editor",class:"vue-codemirror"},this.$slots.default?y("aside",{style:"display: none;"},w(this.$slots.default)):void 0)}});/**
|
|
2
2
|
* Vue CodeMirror6 Component
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @author Logue {@link logue@hotmail.co.jp}
|
|
6
6
|
* @copyright 2022 Masashi Yoshikawa {@link https://logue.dev/} All rights reserved.
|
|
7
7
|
* @see {@link https://github.com/logue/vue-codemirror6}
|
|
8
|
-
*/const
|
|
8
|
+
*/const x=e=>e.component("CodeMirror",v);r.default=v,r.install=x,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
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": "0.
|
|
4
|
+
"version": "0.6.0",
|
|
5
5
|
"description": "CodeMirror6 Component for vue2 and vue3",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"vuejs",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"url": "https://github.com/logue/vue-codemirror6/issues"
|
|
34
34
|
},
|
|
35
35
|
"engines": {
|
|
36
|
-
"node": ">=16.15.
|
|
36
|
+
"node": ">=16.15.1",
|
|
37
37
|
"yarn": ">=1.22.4"
|
|
38
38
|
},
|
|
39
39
|
"packageManager": "yarn@3.2.1",
|
|
@@ -64,16 +64,12 @@
|
|
|
64
64
|
"prepare": "husky install"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"
|
|
68
|
-
"@codemirror/commands": "latest",
|
|
69
|
-
"@codemirror/lint": "latest",
|
|
70
|
-
"@codemirror/state": "latest",
|
|
71
|
-
"@codemirror/view": "latest",
|
|
67
|
+
"codemirror": "^6.0.0",
|
|
72
68
|
"vue-demi": "latest"
|
|
73
69
|
},
|
|
74
70
|
"peerDependencies": {
|
|
75
71
|
"@vue/composition-api": "^1.6.2",
|
|
76
|
-
"vue": "^2.6.14 || ^3.2.
|
|
72
|
+
"vue": "^2.6.14 || ^3.2.37"
|
|
77
73
|
},
|
|
78
74
|
"peerDependenciesMeta": {
|
|
79
75
|
"@vue/composition-api": {
|
|
@@ -81,15 +77,15 @@
|
|
|
81
77
|
}
|
|
82
78
|
},
|
|
83
79
|
"devDependencies": {
|
|
84
|
-
"@codemirror/lang-javascript": "^0.
|
|
85
|
-
"@codemirror/lang-markdown": "^0.
|
|
80
|
+
"@codemirror/lang-javascript": "^6.0.0",
|
|
81
|
+
"@codemirror/lang-markdown": "^6.0.0",
|
|
86
82
|
"@types/lodash": "^4.14.182",
|
|
87
|
-
"@types/node": "^17.0.
|
|
88
|
-
"@typescript-eslint/eslint-plugin": "^5.27.
|
|
89
|
-
"@typescript-eslint/parser": "^5.27.
|
|
83
|
+
"@types/node": "^17.0.41",
|
|
84
|
+
"@typescript-eslint/eslint-plugin": "^5.27.1",
|
|
85
|
+
"@typescript-eslint/parser": "^5.27.1",
|
|
90
86
|
"@vitejs/plugin-vue": "^2.3.3",
|
|
91
87
|
"@vue/eslint-config-prettier": "^7.0.0",
|
|
92
|
-
"eslint": "^8.
|
|
88
|
+
"eslint": "^8.17.0",
|
|
93
89
|
"eslint-config-google": "^0.14.0",
|
|
94
90
|
"eslint-config-prettier": "^8.5.0",
|
|
95
91
|
"eslint-import-resolver-alias": "^1.1.2",
|
|
@@ -98,22 +94,22 @@
|
|
|
98
94
|
"eslint-plugin-import": "^2.26.0",
|
|
99
95
|
"eslint-plugin-jsdoc": "^39.3.2",
|
|
100
96
|
"eslint-plugin-tsdoc": "^0.2.16",
|
|
101
|
-
"eslint-plugin-vue": "^9.0
|
|
102
|
-
"eslint-plugin-vuejs-accessibility": "^1.
|
|
97
|
+
"eslint-plugin-vue": "^9.1.0",
|
|
98
|
+
"eslint-plugin-vuejs-accessibility": "^1.2.0",
|
|
103
99
|
"eslint-plugin-yaml": "^0.5.0",
|
|
104
100
|
"eslint4b-prebuilt": "^6.7.2",
|
|
105
101
|
"husky": "^8.0.1",
|
|
106
|
-
"lint-staged": "^
|
|
102
|
+
"lint-staged": "^13.0.1",
|
|
107
103
|
"lodash": "^4.17.21",
|
|
108
104
|
"prettier": "^2.6.2",
|
|
109
105
|
"rimraf": "^3.0.2",
|
|
110
106
|
"rollup-plugin-visualizer": "^5.6.0",
|
|
111
|
-
"typescript": "^4.7.
|
|
112
|
-
"vite": "^2.9.
|
|
107
|
+
"typescript": "^4.7.3",
|
|
108
|
+
"vite": "^2.9.10",
|
|
113
109
|
"vite-plugin-checker": "^0.4.6",
|
|
114
|
-
"vue": "^3.2.
|
|
110
|
+
"vue": "^3.2.37",
|
|
115
111
|
"vue-eslint-parser": "^9.0.2",
|
|
116
|
-
"vue-tsc": "^0.
|
|
112
|
+
"vue-tsc": "^0.37.3"
|
|
117
113
|
},
|
|
118
114
|
"husky": {
|
|
119
115
|
"hooks": {
|