vue-codemirror6 1.1.32 → 1.2.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/dist/index.umd.js CHANGED
@@ -9,529 +9,5 @@
9
9
  * @see {@link https://github.com/logue/vue-codemirror6}
10
10
  */
11
11
 
12
- (function (global, factory) {
13
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue-demi'), require('codemirror'), require('@codemirror/view'), require('@codemirror/state'), require('@codemirror/lint'), require('@codemirror/commands')) :
14
- typeof define === 'function' && define.amd ? define(['exports', 'vue-demi', 'codemirror', '@codemirror/view', '@codemirror/state', '@codemirror/lint', '@codemirror/commands'], factory) :
15
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.CodeMirror = {}, global.VueDemi, global.codemirror, global.view, global.state, global.lint, global.commands));
16
- })(this, (function (exports, vueDemi, codemirror, view, state, lint, commands) { 'use strict';
17
-
18
- const adaptOnsV3 = (ons) => {
19
- if (!ons)
20
- return {};
21
- return Object.entries(ons).reduce((ret, [key, handler]) => {
22
- key = key.charAt(0).toUpperCase() + key.slice(1);
23
- key = `on${key}`;
24
- return { ...ret, [key]: handler };
25
- }, {});
26
- };
27
- function h(type, options = {}, chidren) {
28
- if (vueDemi.isVue2) {
29
- return vueDemi.h(type, options, chidren);
30
- }
31
- const { props, domProps, on, ...extraOptions } = options;
32
- const ons = on ? adaptOnsV3(on) : {};
33
- return vueDemi.h(
34
- type,
35
- { ...extraOptions, ...props, ...domProps, ...ons },
36
- chidren
37
- );
38
- }
39
- const slot = (defaultSlots) => typeof defaultSlots === "function" ? defaultSlots() : defaultSlots;
40
-
41
- var CodeMirror = vueDemi.defineComponent({
42
- /** Component Name */
43
- name: "CodeMirror",
44
- /** Model Definition */
45
- model: {
46
- prop: "modelValue",
47
- event: "update:modelValue"
48
- },
49
- /** Props Definition */
50
- props: {
51
- /** Model value */
52
- modelValue: {
53
- type: String,
54
- default: ""
55
- },
56
- /**
57
- * Theme
58
- *
59
- * @see {@link https://codemirror.net/docs/ref/#view.EditorView^theme}
60
- */
61
- theme: {
62
- type: Object,
63
- default: () => {
64
- }
65
- },
66
- /** Dark Mode */
67
- dark: {
68
- type: Boolean,
69
- default: false
70
- },
71
- /**
72
- * Use Basic Setup
73
- *
74
- * @see {@link https://codemirror.net/docs/ref/#codemirror.basicSetup}
75
- */
76
- basic: {
77
- type: Boolean,
78
- default: false
79
- },
80
- /**
81
- * Use Minimal Setup (The basic setting has priority.)
82
- *
83
- * @see {@link https://codemirror.net/docs/ref/#codemirror.minimalSetup}
84
- */
85
- minimal: {
86
- type: Boolean,
87
- default: false
88
- },
89
- /**
90
- * Placeholder
91
- *
92
- * @see {@link https://codemirror.net/docs/ref/#view.placeholder}
93
- */
94
- placeholder: {
95
- type: String,
96
- default: void 0
97
- },
98
- /**
99
- * Line wrapping
100
- *
101
- * An extension that enables line wrapping in the editor (by setting CSS white-space to pre-wrap in the content).
102
- *
103
- * @see {@link https://codemirror.net/docs/ref/#view.EditorView%5ElineWrapping}
104
- */
105
- wrap: {
106
- type: Boolean,
107
- default: false
108
- },
109
- /**
110
- * Allow tab key indent.
111
- *
112
- * @see {@link https://codemirror.net/examples/tab/}
113
- */
114
- tab: {
115
- type: Boolean,
116
- default: false
117
- },
118
- /**
119
- * Allow Multiple Selection.
120
- *
121
- * @see {@link https://codemirror.net/docs/ref/#state.EditorState^allowMultipleSelections}
122
- */
123
- allowMultipleSelections: {
124
- type: Boolean,
125
- default: false
126
- },
127
- /**
128
- * Tab size
129
- *
130
- * @see {@link https://codemirror.net/docs/ref/#state.EditorState^tabSize}
131
- */
132
- tabSize: {
133
- type: Number,
134
- default: void 0
135
- },
136
- /**
137
- * Set line break (separetor) char.
138
- *
139
- * @see {@link https://codemirror.net/docs/ref/#state.EditorState^lineSeparator}
140
- */
141
- lineSeparator: {
142
- type: String,
143
- default: void 0
144
- },
145
- /**
146
- * Readonly
147
- *
148
- * @see {@link https://codemirror.net/docs/ref/#state.EditorState^readOnly}
149
- */
150
- readonly: {
151
- type: Boolean,
152
- default: false
153
- },
154
- /**
155
- * Disable input.
156
- *
157
- * This is the reversed value of the CodeMirror editable.
158
- * Similar to `readonly`, but setting this value to true disables dragging.
159
- *
160
- * @see {@link https://codemirror.net/docs/ref/#view.EditorView^editable}
161
- */
162
- disabled: {
163
- type: Boolean,
164
- default: false
165
- },
166
- /**
167
- * Additional Extension
168
- *
169
- * @see {@link https://codemirror.net/docs/ref/#state.Extension}
170
- */
171
- extensions: {
172
- type: Array,
173
- default: () => {
174
- return [];
175
- }
176
- },
177
- /**
178
- * Language Phreses
179
- *
180
- * @see {@link https://codemirror.net/examples/translate/}
181
- */
182
- phrases: {
183
- type: Object,
184
- default: () => void 0
185
- },
186
- /**
187
- * CodeMirror Language
188
- *
189
- * @see {@link https://codemirror.net/docs/ref/#language}
190
- */
191
- lang: {
192
- type: Object,
193
- default: () => void 0
194
- },
195
- /**
196
- * CodeMirror Linter
197
- *
198
- * @see {@link https://codemirror.net/docs/ref/#lint.linter}
199
- */
200
- linter: {
201
- type: Function,
202
- default: void 0
203
- },
204
- /**
205
- * Linter Config
206
- *
207
- * @see {@link https://codemirror.net/docs/ref/#lint.linter^config}
208
- */
209
- linterConfig: {
210
- type: Object,
211
- default: () => {
212
- return {};
213
- }
214
- },
215
- /**
216
- * Forces any linters configured to run when the editor is idle to run right away.
217
- *
218
- * @see {@link https://codemirror.net/docs/ref/#lint.forceLinting}
219
- */
220
- forceLinting: {
221
- type: Boolean,
222
- default: false
223
- },
224
- /**
225
- * Show Linter Gutter
226
- *
227
- * An area to 🔴 the lines with errors will be displayed.
228
- * This feature is not enabled if `linter` is not specified.
229
- *
230
- * @see {@link https://codemirror.net/docs/ref/#lint.lintGutter}
231
- */
232
- gutter: {
233
- type: Boolean,
234
- defalt: false
235
- },
236
- /**
237
- * Gutter Config
238
- *
239
- * @see {@link https://codemirror.net/docs/ref/#lint.lintGutter^config}
240
- */
241
- gutterConfig: {
242
- type: Object,
243
- default: () => void 0
244
- },
245
- /**
246
- * Using tag
247
- */
248
- tag: {
249
- type: String,
250
- default: "div"
251
- }
252
- },
253
- /** Emits */
254
- emits: {
255
- /** Model Update */
256
- "update:modelValue": (value) => true,
257
- /** CodeMirror ViewUpdate */
258
- update: (value) => true,
259
- /** CodeMirror onReady */
260
- ready: (value) => true,
261
- /** CodeMirror onFocus */
262
- focus: (value) => true,
263
- /** State Changed */
264
- change: (value) => true,
265
- /** CodeMirror onDestroy */
266
- destroy: () => true
267
- },
268
- /**
269
- * Setup
270
- *
271
- * @param props - Props
272
- * @param context - Context
273
- */
274
- setup(props, context) {
275
- const editor = vueDemi.ref();
276
- const doc = vueDemi.ref(props.modelValue);
277
- const view$1 = vueDemi.shallowRef(new view.EditorView());
278
- const focus = vueDemi.computed({
279
- get: () => view$1.value.hasFocus,
280
- set: (f) => {
281
- if (f) {
282
- view$1.value.focus();
283
- }
284
- }
285
- });
286
- const selection = vueDemi.computed({
287
- get: () => view$1.value.state.selection,
288
- set: (s) => view$1.value.dispatch({ selection: s })
289
- });
290
- const cursor = vueDemi.computed({
291
- get: () => view$1.value.state.selection.main.head,
292
- set: (a) => view$1.value.dispatch({ selection: { anchor: a } })
293
- });
294
- const json = vueDemi.computed(
295
- {
296
- get: () => view$1.value.state.toJSON(),
297
- set: (j) => view$1.value.setState(state.EditorState.fromJSON(j))
298
- }
299
- );
300
- const length = vueDemi.ref(0);
301
- const diagnosticCount = vueDemi.ref(0);
302
- const extensions = vueDemi.computed(() => {
303
- const language = new state.Compartment();
304
- const tabSize = new state.Compartment();
305
- return [
306
- // Toggle basic setup
307
- props.basic ? codemirror.basicSetup : void 0,
308
- // Toggle minimal setup
309
- props.minimal && !props.basic ? codemirror.minimalSetup : void 0,
310
- // ViewUpdate event listener
311
- view.EditorView.updateListener.of((update) => {
312
- context.emit("focus", view$1.value.hasFocus);
313
- length.value = view$1.value.state.doc.length;
314
- if (update.changes.empty || !update.docChanged) {
315
- return;
316
- }
317
- if (props.linter) {
318
- if (props.forceLinting) {
319
- lint.forceLinting(view$1.value);
320
- }
321
- diagnosticCount.value = props.linter(view$1.value).length;
322
- }
323
- context.emit("update", update);
324
- }),
325
- // Toggle light/dark mode.
326
- view.EditorView.theme(props.theme, { dark: props.dark }),
327
- // Toggle line wrapping
328
- props.wrap ? view.EditorView.lineWrapping : void 0,
329
- // Indent with tab
330
- props.tab ? view.keymap.of([commands.indentWithTab]) : void 0,
331
- // Allow Multiple Selections
332
- state.EditorState.allowMultipleSelections.of(props.allowMultipleSelections),
333
- // Indent tab size
334
- props.tabSize ? tabSize.of(state.EditorState.tabSize.of(props.tabSize)) : void 0,
335
- // locale settings
336
- props.phrases ? state.EditorState.phrases.of(props.phrases) : void 0,
337
- // Readonly option
338
- state.EditorState.readOnly.of(props.readonly),
339
- // Editable option
340
- view.EditorView.editable.of(!props.disabled),
341
- // Set Line break char
342
- props.lineSeparator ? state.EditorState.lineSeparator.of(props.lineSeparator) : void 0,
343
- // Lang
344
- props.lang ? language.of(props.lang) : void 0,
345
- // Append Linter settings
346
- props.linter ? lint.linter(props.linter, props.linterConfig) : void 0,
347
- // Show 🔴 to error line when linter enabled.
348
- props.linter && props.gutter ? lint.lintGutter(props.gutterConfig) : void 0,
349
- // Placeholder
350
- props.placeholder ? view.placeholder(props.placeholder) : void 0,
351
- // Append Extensions
352
- ...props.extensions
353
- ].filter((extension) => !!extension);
354
- });
355
- vueDemi.watch(
356
- extensions,
357
- (exts) => {
358
- view$1.value?.dispatch({
359
- effects: state.StateEffect.reconfigure.of(exts)
360
- });
361
- },
362
- { immediate: true }
363
- );
364
- vueDemi.watch(
365
- () => props.modelValue,
366
- async (value) => {
367
- if (view$1.value.composing || // IME fix
368
- view$1.value.state.doc.toJSON().join(props.lineSeparator ?? "\n") === value) {
369
- return;
370
- }
371
- view$1.value.dispatch({
372
- changes: { from: 0, to: view$1.value.state.doc.length, insert: value },
373
- selection: view$1.value.state.selection,
374
- scrollIntoView: true
375
- });
376
- },
377
- { immediate: true }
378
- );
379
- vueDemi.onMounted(async () => {
380
- let value = doc.value;
381
- if (!editor.value) {
382
- return;
383
- }
384
- if (editor.value.childNodes[0]) {
385
- if (doc.value !== "") {
386
- console.warn(
387
- "[CodeMirror.vue] The <code-mirror> tag contains child elements that overwrite the `v-model` values."
388
- );
389
- }
390
- value = editor.value.childNodes[0].innerText.trim();
391
- }
392
- view$1.value = new view.EditorView({
393
- parent: editor.value,
394
- state: state.EditorState.create({ doc: value, extensions: extensions.value }),
395
- dispatch: (tr) => {
396
- view$1.value.update([tr]);
397
- if (tr.changes.empty || !tr.docChanged) {
398
- return;
399
- }
400
- context.emit("update:modelValue", tr.state.doc.toString());
401
- context.emit("change", tr.state);
402
- }
403
- });
404
- await vueDemi.nextTick();
405
- context.emit("ready", {
406
- view: view$1.value,
407
- state: view$1.value.state,
408
- container: editor.value
409
- });
410
- });
411
- vueDemi.onUnmounted(() => {
412
- view$1.value.destroy();
413
- context.emit("destroy");
414
- });
415
- const lint$1 = () => {
416
- if (!props.linter || !view$1.value) {
417
- return;
418
- }
419
- if (props.forceLinting) {
420
- lint.forceLinting(view$1.value);
421
- }
422
- diagnosticCount.value = lint.diagnosticCount(view$1.value.state);
423
- };
424
- const forceReconfigure = () => {
425
- view$1.value?.dispatch({
426
- effects: state.StateEffect.reconfigure.of([])
427
- });
428
- view$1.value?.dispatch({
429
- effects: state.StateEffect.appendConfig.of(extensions.value)
430
- });
431
- };
432
- const getRange = (from, to) => view$1.value.state.sliceDoc(from, to);
433
- const getLine = (number) => view$1.value.state.doc.line(number + 1).text;
434
- const lineCount = () => view$1.value.state.doc.lines;
435
- const getCursor = () => view$1.value.state.selection.main.head;
436
- const listSelections = () => {
437
- let _view$value$state$sel;
438
- return (_view$value$state$sel = view$1.value.state.selection.ranges) !== null && _view$value$state$sel !== void 0 ? _view$value$state$sel : [];
439
- };
440
- const getSelection = () => {
441
- let _view$value$state$sli;
442
- return (_view$value$state$sli = view$1.value.state.sliceDoc(
443
- view$1.value.state.selection.main.from,
444
- view$1.value.state.selection.main.to
445
- )) !== null && _view$value$state$sli !== void 0 ? _view$value$state$sli : "";
446
- };
447
- const getSelections = () => {
448
- const s = view$1.value.state;
449
- if (!s) {
450
- return [];
451
- }
452
- return s.selection.ranges.map(
453
- (r) => s.sliceDoc(r.from, r.to)
454
- );
455
- };
456
- const somethingSelected = () => view$1.value.state.selection.ranges.some(
457
- (r) => !r.empty
458
- );
459
- const replaceRange = (replacement, from, to) => view$1.value.dispatch({
460
- changes: { from, to, insert: replacement }
461
- });
462
- const replaceSelection = (replacement) => view$1.value.dispatch(view$1.value.state.replaceSelection(replacement));
463
- const setCursor = (position) => view$1.value.dispatch({ selection: { anchor: position } });
464
- const setSelection = (anchor, head) => view$1.value.dispatch({ selection: { anchor, head } });
465
- const setSelections = (ranges, primary) => view$1.value.dispatch({
466
- selection: state.EditorSelection.create(ranges, primary)
467
- });
468
- const extendSelectionsBy = (f) => view$1.value.dispatch({
469
- selection: state.EditorSelection.create(
470
- selection.value.ranges.map((r) => r.extend(f(r)))
471
- )
472
- });
473
- const exposed = {
474
- editor,
475
- view: view$1,
476
- cursor,
477
- selection,
478
- focus,
479
- length,
480
- json,
481
- diagnosticCount,
482
- dom: view$1.value.contentDOM,
483
- lint: lint$1,
484
- forceReconfigure,
485
- // Bellow is CodeMirror5's function
486
- getRange,
487
- getLine,
488
- lineCount,
489
- getCursor,
490
- listSelections,
491
- getSelection,
492
- getSelections,
493
- somethingSelected,
494
- replaceRange,
495
- replaceSelection,
496
- setCursor,
497
- setSelection,
498
- setSelections,
499
- extendSelectionsBy
500
- };
501
- context.expose(exposed);
502
- return exposed;
503
- },
504
- render() {
505
- return h(
506
- this.$props.tag,
507
- {
508
- ref: "editor",
509
- class: "vue-codemirror"
510
- },
511
- this.$slots.default ? (
512
- // Hide original content
513
- h(
514
- "aside",
515
- { style: "display: none;", "aria-hidden": "true" },
516
- slot(this.$slots.default)
517
- )
518
- ) : void 0
519
- );
520
- }
521
- });
522
-
523
- const meta = {
524
- version: "1.1.32",
525
- date: "2023-12-12T00:31:01.513Z"
526
- };
527
- var meta$1 = meta;
528
-
529
- const installCodeMirror = (app) => app.component("CodeMirror", CodeMirror);
530
-
531
- exports.Meta = meta$1;
532
- exports["default"] = CodeMirror;
533
- exports.install = installCodeMirror;
534
-
535
- Object.defineProperty(exports, '__esModule', { value: true });
536
-
537
- }));
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})});
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.1.32",
4
+ "version": "1.2.0",
5
5
  "license": "MIT",
6
6
  "description": "CodeMirror6 Component for vue2 and vue3.",
7
7
  "keywords": [
@@ -83,23 +83,23 @@
83
83
  "@codemirror/lang-json": "^6.0.1",
84
84
  "@codemirror/lang-markdown": "^6.2.3",
85
85
  "@codemirror/lang-vue": "^0.1.2",
86
- "@tsconfig/node-lts": "^18.12.5",
87
- "@types/node": "^20.10.4",
88
- "@typescript-eslint/eslint-plugin": "^6.14.0",
86
+ "@tsconfig/node-lts": "^20.1.0",
87
+ "@types/node": "^20.10.5",
88
+ "@typescript-eslint/eslint-plugin": "^6.15.0",
89
89
  "@vitejs/plugin-vue": "^4.5.2",
90
- "@vue/compiler-sfc": "^3.3.11",
90
+ "@vue/compiler-sfc": "^3.3.13",
91
91
  "@vue/eslint-config-prettier": "^8.0.0",
92
- "@vue/tsconfig": "^0.4.0",
92
+ "@vue/tsconfig": "^0.5.1",
93
93
  "@vueuse/core": "^10.7.0",
94
94
  "bootstrap": "^5.3.2",
95
- "eslint": "^8.55.0",
96
- "eslint-config-standard-with-typescript": "^42.0.0",
95
+ "eslint": "^8.56.0",
96
+ "eslint-config-standard-with-typescript": "^43.0.0",
97
97
  "eslint-import-resolver-alias": "^1.1.2",
98
98
  "eslint-import-resolver-typescript": "^3.6.1",
99
- "eslint-linter-browserify": "^8.55.0",
99
+ "eslint-linter-browserify": "^8.56.0",
100
100
  "eslint-plugin-html": "^7.1.0",
101
- "eslint-plugin-import": "^2.29.0",
102
- "eslint-plugin-n": "^16.4.0",
101
+ "eslint-plugin-import": "^2.29.1",
102
+ "eslint-plugin-n": "^16.5.0",
103
103
  "eslint-plugin-promise": "^6.1.1",
104
104
  "eslint-plugin-tsdoc": "^0.2.17",
105
105
  "eslint-plugin-vue": "latest",
@@ -111,13 +111,13 @@
111
111
  "prettier": "^3.1.1",
112
112
  "rimraf": "^5.0.5",
113
113
  "rollup-plugin-visualizer": "^5.11.0",
114
- "sass": "~1.69.5",
114
+ "sass": "^1.69.5",
115
115
  "typescript": "^5.3.3",
116
- "vite": "^5.0.7",
116
+ "vite": "^5.0.10",
117
117
  "vite-plugin-banner": "^0.7.1",
118
118
  "vite-plugin-checker": "^0.6.2",
119
119
  "vite-plugin-dts": "^3.6.4",
120
- "vue": "^3.3.11",
120
+ "vue": "^3.3.13",
121
121
  "vue-eslint-parser": "^9.3.2",
122
122
  "vue-markdown-wasm": "^0.3.14",
123
123
  "vue-tsc": "^1.8.25"
@@ -135,6 +135,7 @@
135
135
  "json5": "^2.2.3",
136
136
  "postcss": "^8.4.31",
137
137
  "semver": "^7.5.3",
138
- "yaml": "^2.3.2"
138
+ "yaml": "^2.3.2",
139
+ "vite": ">5.0.5"
139
140
  }
140
141
  }