vue-codemirror6 1.4.3 → 1.5.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/CHANGELOG.md +9 -0
- package/README.ja.md +1 -0
- package/README.md +1 -0
- package/dist/index.cjs.js +3 -3
- package/dist/index.es.js +296 -532
- package/dist/index.iife.js +3 -3
- package/dist/index.umd.js +3 -3
- package/dist/src/Meta.d.ts +3 -0
- package/dist/{index.d.ts → src/index.d.ts} +26 -1
- package/package.json +28 -30
- package/dist/Meta.d.ts +0 -3
- /package/dist/{helpers → src/helpers}/h-demi.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/MetaInterface.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,10 +4,19 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
#### [1.5.0](https://github.com/logue/vue-codemirror6/compare/1.4.3...1.5.0)
|
|
8
|
+
|
|
9
|
+
- Add AI instructions. [`75fecba`](https://github.com/logue/vue-codemirror6/commit/75fecba1d79bbd308864dbbfb5884026c1c20be6)
|
|
10
|
+
- Fixed warnings output during the build process. [`4721a8d`](https://github.com/logue/vue-codemirror6/commit/4721a8d94faf0a32c5a7b2459f989e361acb0a27)
|
|
11
|
+
- Update Dependencies. [`c8c3d2a`](https://github.com/logue/vue-codemirror6/commit/c8c3d2a23ef8eecc6ab28d42d53bdc7f457ceac5)
|
|
12
|
+
|
|
7
13
|
#### [1.4.3](https://github.com/logue/vue-codemirror6/compare/1.4.2...1.4.3)
|
|
8
14
|
|
|
15
|
+
> 5 March 2026
|
|
16
|
+
|
|
9
17
|
- Replace eslint-plugin-import to eslint-plugin-x. [`e46491a`](https://github.com/logue/vue-codemirror6/commit/e46491a24270f8ea392a3354bbecbaf7092f8ef9)
|
|
10
18
|
- Add Japanese Readme. [`e279cc0`](https://github.com/logue/vue-codemirror6/commit/e279cc0e1b23bba6c1dd690fb6a963b82e8508f6)
|
|
19
|
+
- Update ChangeLog/ [`8648633`](https://github.com/logue/vue-codemirror6/commit/86486330c50af4c4c13eeabcc3b6a498ab8a65d1)
|
|
11
20
|
|
|
12
21
|
#### [1.4.2](https://github.com/logue/vue-codemirror6/compare/1.4.0...1.4.2)
|
|
13
22
|
|
package/README.ja.md
CHANGED
|
@@ -58,6 +58,7 @@ yarn add vue-codemirror6 @vue/composition-api
|
|
|
58
58
|
| gutterConfig | Object | <https://codemirror.net/docs/ref/#lint.lintGutter^config>を参照してください。 |
|
|
59
59
|
| tag | string | コンポーネントで使用されるHTMLタグ。(デフォルトは`div`タグです。) |
|
|
60
60
|
| scrollIntoView | boolean | 外部更新でフォームをスクロールできるようにします。(デフォルトは`true`です。) |
|
|
61
|
+
| preserveScrollPosition | boolean | `modelValue` が外部から更新されたときにエディタのスクロール位置を保持します。追記更新時に先頭へ戻る挙動の抑止に使えます。(デフォルトは`false`です。) |
|
|
61
62
|
| keymap | KeyBinding[] | キーバインディングは、キー名をコマンドスタイルの関数に関連付けます。<https://codemirror.net/docs/ref/#view.KeyBinding>を参照してください。 |
|
|
62
63
|
|
|
63
64
|
⚠ 注意: `lang`と`linter`は、`extensions`にまとめて設定することもできます。これらは、以前のバージョンのCodeMirror設定との互換性とpropsの型付けのために分離されています。
|
package/README.md
CHANGED
|
@@ -58,6 +58,7 @@ This component can handle bidirectional binding by `v-model` like a general Vue
|
|
|
58
58
|
| gutterConfig | Object | see <https://codemirror.net/docs/ref/#lint.lintGutter^config> |
|
|
59
59
|
| tag | string | HTML tags used in the component. (Default is `div` tag.) |
|
|
60
60
|
| scrollIntoView | boolean | Allows an external update to scroll the form. (Default is `true`) |
|
|
61
|
+
| preserveScrollPosition | boolean | Preserves the editor scroll position when `modelValue` is updated externally. Useful to prevent jumping to the top during appended updates. (Default is `false`) |
|
|
61
62
|
| keymap | KeyBinding[] | Key bindings associate key names with command-style functions. See <https://codemirror.net/docs/ref/#view.KeyBinding> |
|
|
62
63
|
|
|
63
64
|
⚠ Notice: `lang` and `linter` can also be set together in `extensions`. These are separated for compatibility with previous versions of CodeMirror settings and for typing props.
|
package/dist/index.cjs.js
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* @author Logue <logue@hotmail.co.jp>
|
|
6
6
|
* @copyright 2022-2026 By Masashi Yoshikawa All rights reserved.
|
|
7
7
|
* @license MIT
|
|
8
|
-
* @version 1.
|
|
8
|
+
* @version 1.5.0
|
|
9
9
|
* @see {@link https://github.com/logue/vue-codemirror6}
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
`)===
|
|
12
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});let e=require(`@codemirror/commands`),t=require(`@codemirror/language`),n=require(`@codemirror/lint`),r=require(`@codemirror/state`),i=require(`@codemirror/view`),a=require(`codemirror`),o=require(`vue-demi`);var s={version:`1.5.0`,date:`2026-03-30T11:56:36.326Z`},c=e=>e?Object.entries(e).reduce((e,[t,n])=>(t=t.charAt(0).toUpperCase()+t.slice(1),t=`on${t}`,{...e,[t]:n}),{}):{};function l(e,t={},n){if(o.isVue2)return(0,o.h)(e,t,n);let{props:r,domProps:i,on:a,...s}=t,l=a?c(a):{};return(0,o.h)(e,{...s,...r,...i,...l},n)}var u=e=>typeof e==`function`?e():e,d=(0,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},indentUnit:{type:String,default:void 0},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:void 0},lang:{type:Object,default:void 0},linter:{type:Function,default:void 0},linterConfig:{type:Object,default:()=>({})},forceLinting:{type:Boolean,default:!1},gutter:{type:Boolean,default:!1},gutterConfig:{type:Object,default:void 0},tag:{type:String,default:`div`},scrollIntoView:{type:Boolean,default:!0},preserveScrollPosition:{type:Boolean,default:!1},keymap:{type:Array,default:()=>[]}},emits:{"update:modelValue":(e=``)=>!0,update:e=>!0,ready:e=>!0,focus:e=>!0,change:e=>!0,destroy:()=>!0},setup(s,c){let l=(0,o.ref)(),u=(0,o.ref)(s.modelValue),d=(0,o.shallowRef)(void 0),f=(0,o.computed)({get:()=>d.value?.hasFocus??!1,set:e=>{e&&d.value&&d.value.focus()}}),p=(0,o.computed)({get:()=>d.value?.state.selection,set:e=>{d.value&&e&&d.value.dispatch({selection:e})}}),m=(0,o.computed)({get:()=>d.value?.state.selection.main.head??0,set:e=>{d.value&&d.value.dispatch({selection:{anchor:e}})}}),h=(0,o.computed)({get:()=>d.value?.state.toJSON(),set:e=>{d.value&&e&&d.value.setState(r.EditorState.fromJSON(e))}}),g=(0,o.ref)(0),_=(0,o.ref)(0),v=(0,o.computed)(()=>{let o=new r.Compartment,l=new r.Compartment;if(s.basic&&s.minimal)throw Error(`[Vue CodeMirror] Both basic and minimal cannot be specified.`);let u=[];return s.keymap&&s.keymap.length>0&&(u=s.keymap),s.tab&&u.push(e.indentWithTab),[s.basic&&!s.minimal?a.basicSetup:void 0,s.minimal&&!s.basic?a.minimalSetup:void 0,i.EditorView.updateListener.of(e=>{d.value&&(c.emit(`focus`,d.value.hasFocus),g.value=d.value.state.doc?.length,!(e.changes.empty||!e.docChanged)&&(s.linter&&(s.forceLinting&&(0,n.forceLinting)(d.value),_.value=s.linter(d.value).length),c.emit(`update`,e)))}),i.EditorView.theme(s.theme,{dark:s.dark}),s.wrap?i.EditorView.lineWrapping:void 0,s.indentUnit?t.indentUnit.of(s.indentUnit):void 0,r.EditorState.allowMultipleSelections.of(s.allowMultipleSelections),s.tabSize?l.of(r.EditorState.tabSize.of(s.tabSize)):void 0,s.phrases?r.EditorState.phrases.of(s.phrases):void 0,r.EditorState.readOnly.of(s.readonly),i.EditorView.editable.of(!s.disabled),s.lineSeparator?r.EditorState.lineSeparator.of(s.lineSeparator):void 0,s.lang?o.of(s.lang):void 0,s.linter?(0,n.linter)(s.linter,s.linterConfig):void 0,s.linter&&s.gutter?(0,n.lintGutter)(s.gutterConfig):void 0,s.placeholder?(0,i.placeholder)(s.placeholder):void 0,u.length>0?i.keymap.of(u):void 0,...s.extensions].filter(e=>!!e)});(0,o.watch)(v,e=>d.value?.dispatch({effects:r.StateEffect.reconfigure.of(e)}),{immediate:!0}),(0,o.watch)(()=>s.modelValue,async e=>{if(!d.value||d.value.composing||d.value.state.doc.toJSON().join(s.lineSeparator??`
|
|
13
|
+
`)===e)return;let t=!d.value.state.selection.ranges.every(t=>t.anchor<e.length&&t.head<e.length),n={from:0,to:d.value.state.doc.length,insert:e},r=s.preserveScrollPosition?d.value.scrollSnapshot().map(d.value.state.changes(n)):void 0;d.value.dispatch({changes:n,selection:t?{anchor:0,head:0}:d.value.state.selection,scrollIntoView:s.scrollIntoView,effects:r?[r]:void 0})},{immediate:!0}),(0,o.onMounted)(async()=>{if(globalThis.window===void 0||!l.value)return;let e=u.value;l.value.childNodes[0]&&(u.value!==``&&console.warn("[CodeMirror.vue] The <code-mirror> tag contains child elements that overwrite the `v-model` values."),e=l.value.childNodes[0].innerText.trim()),d.value=new i.EditorView({parent:l.value,state:r.EditorState.create({doc:e,extensions:v.value}),dispatch:e=>{d.value&&(d.value.update([e]),!(e.changes.empty||!e.docChanged)&&(c.emit(`update:modelValue`,e.state.doc.toString()),c.emit(`change`,e.state)))}}),await(0,o.nextTick)(),c.emit(`ready`,{view:d.value,state:d.value.state,container:l.value})}),(0,o.onUnmounted)(()=>{d.value&&(d.value.destroy(),c.emit(`destroy`))});let y={editor:l,view:d,cursor:m,selection:p,focus:f,length:g,json:h,diagnosticCount:_,dom:d.value?.contentDOM,lint:()=>{!s.linter||!d.value||(s.forceLinting&&(0,n.forceLinting)(d.value),_.value=(0,n.diagnosticCount)(d.value.state))},forceReconfigure:()=>{d.value?.dispatch({effects:r.StateEffect.reconfigure.of([])}),d.value?.dispatch({effects:r.StateEffect.appendConfig.of(v.value)})},getRange:(e,t)=>d.value?.state.sliceDoc(e,t),getLine:e=>d.value?.state.doc.line(e+1).text,lineCount:()=>d.value?.state.doc.lines??0,getCursor:()=>d.value?.state.selection.main.head??0,listSelections:()=>d.value?.state.selection.ranges??[],getSelection:()=>d.value?d.value.state.sliceDoc(d.value.state.selection.main.from,d.value.state.selection.main.to):``,getSelections:()=>{let e=d.value?.state;return e?e.selection.ranges.map(t=>e.sliceDoc(t.from,t.to)):[]},somethingSelected:()=>d.value?.state.selection.ranges.some(e=>!e.empty)??!1,replaceRange:(e,t,n)=>{d.value&&d.value.dispatch({changes:{from:t,to:n,insert:e}})},replaceSelection:e=>{d.value&&d.value.dispatch(d.value.state.replaceSelection(e))},setCursor:e=>{d.value&&d.value.dispatch({selection:{anchor:e}})},setSelection:(e,t)=>{d.value&&d.value.dispatch({selection:{anchor:e,head:t}})},setSelections:(e,t)=>{d.value&&d.value.dispatch({selection:r.EditorSelection.create(e,t)})},extendSelectionsBy:e=>{d.value&&p.value&&d.value.dispatch({selection:r.EditorSelection.create(p.value.ranges.map(t=>t.extend(e(t))))})}};return c.expose(y),y},render(){return l(this.$props.tag,{ref:`editor`,class:`vue-codemirror`},this.$slots.default?l(`aside`,{style:`display: none;`,"aria-hidden":`true`},u(this.$slots.default)):void 0)}}),f=e=>e.component(`CodeMirror`,d);exports.Meta=s,exports.default=d,exports.install=f;
|
package/dist/index.es.js
CHANGED
|
@@ -5,539 +5,303 @@
|
|
|
5
5
|
* @author Logue <logue@hotmail.co.jp>
|
|
6
6
|
* @copyright 2022-2026 By Masashi Yoshikawa All rights reserved.
|
|
7
7
|
* @license MIT
|
|
8
|
-
* @version 1.
|
|
8
|
+
* @version 1.5.0
|
|
9
9
|
* @see {@link https://github.com/logue/vue-codemirror6}
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import { indentWithTab as
|
|
13
|
-
import { indentUnit as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { EditorView as
|
|
17
|
-
import { basicSetup as
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
12
|
+
import { indentWithTab as e } from "@codemirror/commands";
|
|
13
|
+
import { indentUnit as t } from "@codemirror/language";
|
|
14
|
+
import { diagnosticCount as n, forceLinting as r, lintGutter as i, linter as a } from "@codemirror/lint";
|
|
15
|
+
import { Compartment as o, EditorSelection as s, EditorState as c, StateEffect as l } from "@codemirror/state";
|
|
16
|
+
import { EditorView as u, keymap as d, placeholder as f } from "@codemirror/view";
|
|
17
|
+
import { basicSetup as p, minimalSetup as m } from "codemirror";
|
|
18
|
+
import { computed as h, defineComponent as g, h as _, isVue2 as v, nextTick as y, onMounted as b, onUnmounted as x, ref as S, shallowRef as C, watch as w } from "vue-demi";
|
|
19
|
+
//#region src/Meta.ts
|
|
20
|
+
var T = {
|
|
21
|
+
version: "1.5.0",
|
|
22
|
+
date: "2026-03-30T11:56:36.326Z"
|
|
23
|
+
}, E = (e) => e ? Object.entries(e).reduce((e, [t, n]) => (t = t.charAt(0).toUpperCase() + t.slice(1), t = `on${t}`, {
|
|
24
|
+
...e,
|
|
25
|
+
[t]: n
|
|
26
|
+
}), {}) : {};
|
|
27
|
+
function D(e, t = {}, n) {
|
|
28
|
+
if (v) return _(e, t, n);
|
|
29
|
+
let { props: r, domProps: i, on: a, ...o } = t, s = a ? E(a) : {};
|
|
30
|
+
return _(e, {
|
|
31
|
+
...o,
|
|
32
|
+
...r,
|
|
33
|
+
...i,
|
|
34
|
+
...s
|
|
35
|
+
}, n);
|
|
32
36
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
* @see {@link https://codemirror.net/docs/ref/#state.TransactionSpec.scrollIntoView}
|
|
305
|
-
*/
|
|
306
|
-
scrollIntoView: {
|
|
307
|
-
type: Boolean,
|
|
308
|
-
default: !0
|
|
309
|
-
},
|
|
310
|
-
/**
|
|
311
|
-
* Key map
|
|
312
|
-
* This is a CodeMirror Facet that allows you to define custom key bindings.
|
|
313
|
-
* It can be used to override default key bindings or add new ones.
|
|
314
|
-
*
|
|
315
|
-
* @see {@link https://codemirror.net/docs/ref/#view.keymap}
|
|
316
|
-
*/
|
|
317
|
-
keymap: {
|
|
318
|
-
type: Array,
|
|
319
|
-
default: () => []
|
|
320
|
-
}
|
|
321
|
-
},
|
|
322
|
-
/** Emits */
|
|
323
|
-
emits: {
|
|
324
|
-
/** Model Update */
|
|
325
|
-
"update:modelValue": (t = "") => !0,
|
|
326
|
-
/** CodeMirror ViewUpdate */
|
|
327
|
-
update: (t) => !0,
|
|
328
|
-
/** CodeMirror onReady */
|
|
329
|
-
ready: (t) => !0,
|
|
330
|
-
/** CodeMirror onFocus */
|
|
331
|
-
focus: (t) => !0,
|
|
332
|
-
/** State Changed */
|
|
333
|
-
change: (t) => !0,
|
|
334
|
-
/** CodeMirror onDestroy */
|
|
335
|
-
destroy: () => !0
|
|
336
|
-
},
|
|
337
|
-
/**
|
|
338
|
-
* Setup
|
|
339
|
-
*
|
|
340
|
-
* @param props - Props
|
|
341
|
-
* @param context - Context
|
|
342
|
-
*/
|
|
343
|
-
setup(t, l) {
|
|
344
|
-
const i = m(), s = m(t.modelValue), e = te(void 0), v = f({
|
|
345
|
-
get: () => e.value?.hasFocus ?? !1,
|
|
346
|
-
set: (a) => {
|
|
347
|
-
a && e.value && e.value.focus();
|
|
348
|
-
}
|
|
349
|
-
}), r = f({
|
|
350
|
-
get: () => e.value?.state.selection,
|
|
351
|
-
set: (a) => {
|
|
352
|
-
e.value && a && e.value.dispatch({ selection: a });
|
|
353
|
-
}
|
|
354
|
-
}), h = f({
|
|
355
|
-
get: () => e.value?.state.selection.main.head ?? 0,
|
|
356
|
-
set: (a) => {
|
|
357
|
-
e.value && e.value.dispatch({ selection: { anchor: a } });
|
|
358
|
-
}
|
|
359
|
-
}), j = f({
|
|
360
|
-
get: () => e.value?.state.toJSON(),
|
|
361
|
-
set: (a) => {
|
|
362
|
-
e.value && a && e.value.setState(u.fromJSON(a));
|
|
363
|
-
}
|
|
364
|
-
}), p = m(0), g = m(0), y = f(() => {
|
|
365
|
-
const a = new C(), n = new C();
|
|
366
|
-
if (t.basic && t.minimal)
|
|
367
|
-
throw new Error(
|
|
368
|
-
"[Vue CodeMirror] Both basic and minimal cannot be specified."
|
|
369
|
-
);
|
|
370
|
-
let o = [];
|
|
371
|
-
return t.keymap && t.keymap.length > 0 && (o = t.keymap), t.tab && o.push(W), [
|
|
372
|
-
// Toggle basic setup
|
|
373
|
-
t.basic && !t.minimal ? Q : void 0,
|
|
374
|
-
// Toggle minimal setup
|
|
375
|
-
t.minimal && !t.basic ? X : void 0,
|
|
376
|
-
// ViewUpdate event listener
|
|
377
|
-
d.updateListener.of((c) => {
|
|
378
|
-
e.value && (l.emit("focus", e.value.hasFocus), p.value = e.value.state.doc?.length, !(c.changes.empty || !c.docChanged) && (t.linter && (t.forceLinting && w(e.value), g.value = t.linter(e.value).length), l.emit("update", c)));
|
|
379
|
-
}),
|
|
380
|
-
// Toggle light/dark mode.
|
|
381
|
-
d.theme(t.theme, { dark: t.dark }),
|
|
382
|
-
// Toggle line wrapping
|
|
383
|
-
t.wrap ? d.lineWrapping : void 0,
|
|
384
|
-
// Tab character
|
|
385
|
-
t.indentUnit ? G.of(t.indentUnit) : void 0,
|
|
386
|
-
// Allow Multiple Selections
|
|
387
|
-
u.allowMultipleSelections.of(t.allowMultipleSelections),
|
|
388
|
-
// Indent tab size
|
|
389
|
-
t.tabSize ? n.of(u.tabSize.of(t.tabSize)) : void 0,
|
|
390
|
-
// locale settings
|
|
391
|
-
t.phrases ? u.phrases.of(t.phrases) : void 0,
|
|
392
|
-
// Readonly option
|
|
393
|
-
u.readOnly.of(t.readonly),
|
|
394
|
-
// Editable option
|
|
395
|
-
d.editable.of(!t.disabled),
|
|
396
|
-
// Set Line break char
|
|
397
|
-
t.lineSeparator ? u.lineSeparator.of(t.lineSeparator) : void 0,
|
|
398
|
-
// Lang
|
|
399
|
-
t.lang ? a.of(t.lang) : void 0,
|
|
400
|
-
// Append Linter settings
|
|
401
|
-
t.linter ? P(t.linter, t.linterConfig) : void 0,
|
|
402
|
-
// Show 🔴 to error line when linter enabled.
|
|
403
|
-
t.linter && t.gutter ? Z(t.gutterConfig) : void 0,
|
|
404
|
-
// Placeholder
|
|
405
|
-
t.placeholder ? H(t.placeholder) : void 0,
|
|
406
|
-
// Keymap and Indent with Tab
|
|
407
|
-
o.length > 0 ? K.of(o) : void 0,
|
|
408
|
-
// Append Extensions
|
|
409
|
-
...t.extensions
|
|
410
|
-
].filter((c) => !!c);
|
|
411
|
-
});
|
|
412
|
-
B(
|
|
413
|
-
y,
|
|
414
|
-
(a) => e.value?.dispatch({ effects: S.reconfigure.of(a) }),
|
|
415
|
-
{ immediate: !0 }
|
|
416
|
-
), B(
|
|
417
|
-
() => t.modelValue,
|
|
418
|
-
async (a) => {
|
|
419
|
-
if (!e.value || e.value.composing || // IME fix
|
|
420
|
-
e.value.state.doc.toJSON().join(t.lineSeparator ?? `
|
|
421
|
-
`) === a)
|
|
422
|
-
return;
|
|
423
|
-
const n = !e.value.state.selection.ranges.every(
|
|
424
|
-
(o) => o.anchor < a.length && o.head < a.length
|
|
425
|
-
);
|
|
426
|
-
e.value.dispatch({
|
|
427
|
-
changes: { from: 0, to: e.value.state.doc.length, insert: a },
|
|
428
|
-
selection: n ? { anchor: 0, head: 0 } : e.value.state.selection,
|
|
429
|
-
scrollIntoView: t.scrollIntoView
|
|
430
|
-
});
|
|
431
|
-
},
|
|
432
|
-
{ immediate: !0 }
|
|
433
|
-
), ae(async () => {
|
|
434
|
-
if (globalThis.window === void 0 || !i.value)
|
|
435
|
-
return;
|
|
436
|
-
let a = s.value;
|
|
437
|
-
i.value.childNodes[0] && (s.value !== "" && console.warn(
|
|
438
|
-
"[CodeMirror.vue] The <code-mirror> tag contains child elements that overwrite the `v-model` values."
|
|
439
|
-
), a = i.value.childNodes[0].innerText.trim()), e.value = new d({
|
|
440
|
-
parent: i.value,
|
|
441
|
-
state: u.create({ doc: a, extensions: y.value }),
|
|
442
|
-
dispatch: (n) => {
|
|
443
|
-
e.value && (e.value.update([n]), !(n.changes.empty || !n.docChanged) && (l.emit("update:modelValue", n.state.doc.toString()), l.emit("change", n.state)));
|
|
444
|
-
}
|
|
445
|
-
}), await ne(), l.emit("ready", {
|
|
446
|
-
view: e.value,
|
|
447
|
-
state: e.value.state,
|
|
448
|
-
container: i.value
|
|
449
|
-
});
|
|
450
|
-
}), ie(() => {
|
|
451
|
-
e.value && (e.value.destroy(), l.emit("destroy"));
|
|
452
|
-
});
|
|
453
|
-
const x = () => {
|
|
454
|
-
!t.linter || !e.value || (t.forceLinting && w(e.value), g.value = q(e.value.state));
|
|
455
|
-
}, L = () => {
|
|
456
|
-
e.value?.dispatch({
|
|
457
|
-
effects: S.reconfigure.of([])
|
|
458
|
-
}), e.value?.dispatch({
|
|
459
|
-
effects: S.appendConfig.of(y.value)
|
|
460
|
-
});
|
|
461
|
-
}, N = (a, n) => e.value?.state.sliceDoc(a, n), T = (a) => e.value?.state.doc.line(a + 1).text, U = () => e.value?.state.doc.lines ?? 0, $ = () => e.value?.state.selection.main.head ?? 0, k = () => e.value?.state.selection.ranges ?? [], z = () => e.value ? e.value.state.sliceDoc(
|
|
462
|
-
e.value.state.selection.main.from,
|
|
463
|
-
e.value.state.selection.main.to
|
|
464
|
-
) : "", E = () => {
|
|
465
|
-
const a = e.value?.state;
|
|
466
|
-
return a ? a.selection.ranges.map(
|
|
467
|
-
(n) => a.sliceDoc(n.from, n.to)
|
|
468
|
-
) : [];
|
|
469
|
-
}, R = () => e.value?.state.selection.ranges.some(
|
|
470
|
-
(a) => !a.empty
|
|
471
|
-
) ?? !1, _ = (a, n, o) => {
|
|
472
|
-
e.value && e.value.dispatch({
|
|
473
|
-
changes: { from: n, to: o, insert: a }
|
|
474
|
-
});
|
|
475
|
-
}, D = (a) => {
|
|
476
|
-
e.value && e.value.dispatch(e.value.state.replaceSelection(a));
|
|
477
|
-
}, A = (a) => {
|
|
478
|
-
e.value && e.value.dispatch({ selection: { anchor: a } });
|
|
479
|
-
}, F = (a, n) => {
|
|
480
|
-
e.value && e.value.dispatch({ selection: { anchor: a, head: n } });
|
|
481
|
-
}, I = (a, n) => {
|
|
482
|
-
e.value && e.value.dispatch({
|
|
483
|
-
selection: O.create(a, n)
|
|
484
|
-
});
|
|
485
|
-
}, J = (a) => {
|
|
486
|
-
e.value && r.value && e.value.dispatch({
|
|
487
|
-
selection: O.create(
|
|
488
|
-
r.value.ranges.map((n) => n.extend(a(n)))
|
|
489
|
-
)
|
|
490
|
-
});
|
|
491
|
-
}, b = {
|
|
492
|
-
editor: i,
|
|
493
|
-
view: e,
|
|
494
|
-
cursor: h,
|
|
495
|
-
selection: r,
|
|
496
|
-
focus: v,
|
|
497
|
-
length: p,
|
|
498
|
-
json: j,
|
|
499
|
-
diagnosticCount: g,
|
|
500
|
-
dom: e.value?.contentDOM,
|
|
501
|
-
lint: x,
|
|
502
|
-
forceReconfigure: L,
|
|
503
|
-
// Bellow is CodeMirror5's function
|
|
504
|
-
getRange: N,
|
|
505
|
-
getLine: T,
|
|
506
|
-
lineCount: U,
|
|
507
|
-
getCursor: $,
|
|
508
|
-
listSelections: k,
|
|
509
|
-
getSelection: z,
|
|
510
|
-
getSelections: E,
|
|
511
|
-
somethingSelected: R,
|
|
512
|
-
replaceRange: _,
|
|
513
|
-
replaceSelection: D,
|
|
514
|
-
setCursor: A,
|
|
515
|
-
setSelection: F,
|
|
516
|
-
setSelections: I,
|
|
517
|
-
extendSelectionsBy: J
|
|
518
|
-
};
|
|
519
|
-
return l.expose(b), b;
|
|
520
|
-
},
|
|
521
|
-
render() {
|
|
522
|
-
return M(
|
|
523
|
-
this.$props.tag,
|
|
524
|
-
{
|
|
525
|
-
ref: "editor",
|
|
526
|
-
class: "vue-codemirror"
|
|
527
|
-
},
|
|
528
|
-
this.$slots.default ? (
|
|
529
|
-
// Hide original content
|
|
530
|
-
M(
|
|
531
|
-
"aside",
|
|
532
|
-
{ style: "display: none;", "aria-hidden": "true" },
|
|
533
|
-
oe(this.$slots.default)
|
|
534
|
-
)
|
|
535
|
-
) : void 0
|
|
536
|
-
);
|
|
537
|
-
}
|
|
538
|
-
}), ge = (t) => t.component("CodeMirror", ue);
|
|
539
|
-
export {
|
|
540
|
-
he as Meta,
|
|
541
|
-
ue as default,
|
|
542
|
-
ge as install
|
|
543
|
-
};
|
|
37
|
+
var O = (e) => typeof e == "function" ? e() : e, k = g({
|
|
38
|
+
name: "CodeMirror",
|
|
39
|
+
model: {
|
|
40
|
+
prop: "modelValue",
|
|
41
|
+
event: "update:modelValue"
|
|
42
|
+
},
|
|
43
|
+
props: {
|
|
44
|
+
modelValue: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: ""
|
|
47
|
+
},
|
|
48
|
+
theme: {
|
|
49
|
+
type: Object,
|
|
50
|
+
default: () => ({})
|
|
51
|
+
},
|
|
52
|
+
dark: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: !1
|
|
55
|
+
},
|
|
56
|
+
basic: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: !1
|
|
59
|
+
},
|
|
60
|
+
minimal: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: !1
|
|
63
|
+
},
|
|
64
|
+
placeholder: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: void 0
|
|
67
|
+
},
|
|
68
|
+
wrap: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: !1
|
|
71
|
+
},
|
|
72
|
+
tab: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: !1
|
|
75
|
+
},
|
|
76
|
+
indentUnit: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: void 0
|
|
79
|
+
},
|
|
80
|
+
allowMultipleSelections: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: !1
|
|
83
|
+
},
|
|
84
|
+
tabSize: {
|
|
85
|
+
type: Number,
|
|
86
|
+
default: void 0
|
|
87
|
+
},
|
|
88
|
+
lineSeparator: {
|
|
89
|
+
type: String,
|
|
90
|
+
default: void 0
|
|
91
|
+
},
|
|
92
|
+
readonly: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
default: !1
|
|
95
|
+
},
|
|
96
|
+
disabled: {
|
|
97
|
+
type: Boolean,
|
|
98
|
+
default: !1
|
|
99
|
+
},
|
|
100
|
+
extensions: {
|
|
101
|
+
type: Array,
|
|
102
|
+
default: () => []
|
|
103
|
+
},
|
|
104
|
+
phrases: {
|
|
105
|
+
type: Object,
|
|
106
|
+
default: void 0
|
|
107
|
+
},
|
|
108
|
+
lang: {
|
|
109
|
+
type: Object,
|
|
110
|
+
default: void 0
|
|
111
|
+
},
|
|
112
|
+
linter: {
|
|
113
|
+
type: Function,
|
|
114
|
+
default: void 0
|
|
115
|
+
},
|
|
116
|
+
linterConfig: {
|
|
117
|
+
type: Object,
|
|
118
|
+
default: () => ({})
|
|
119
|
+
},
|
|
120
|
+
forceLinting: {
|
|
121
|
+
type: Boolean,
|
|
122
|
+
default: !1
|
|
123
|
+
},
|
|
124
|
+
gutter: {
|
|
125
|
+
type: Boolean,
|
|
126
|
+
default: !1
|
|
127
|
+
},
|
|
128
|
+
gutterConfig: {
|
|
129
|
+
type: Object,
|
|
130
|
+
default: void 0
|
|
131
|
+
},
|
|
132
|
+
tag: {
|
|
133
|
+
type: String,
|
|
134
|
+
default: "div"
|
|
135
|
+
},
|
|
136
|
+
scrollIntoView: {
|
|
137
|
+
type: Boolean,
|
|
138
|
+
default: !0
|
|
139
|
+
},
|
|
140
|
+
preserveScrollPosition: {
|
|
141
|
+
type: Boolean,
|
|
142
|
+
default: !1
|
|
143
|
+
},
|
|
144
|
+
keymap: {
|
|
145
|
+
type: Array,
|
|
146
|
+
default: () => []
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
emits: {
|
|
150
|
+
"update:modelValue": (e = "") => !0,
|
|
151
|
+
update: (e) => !0,
|
|
152
|
+
ready: (e) => !0,
|
|
153
|
+
focus: (e) => !0,
|
|
154
|
+
change: (e) => !0,
|
|
155
|
+
destroy: () => !0
|
|
156
|
+
},
|
|
157
|
+
setup(g, _) {
|
|
158
|
+
let v = S(), T = S(g.modelValue), E = C(void 0), D = h({
|
|
159
|
+
get: () => E.value?.hasFocus ?? !1,
|
|
160
|
+
set: (e) => {
|
|
161
|
+
e && E.value && E.value.focus();
|
|
162
|
+
}
|
|
163
|
+
}), O = h({
|
|
164
|
+
get: () => E.value?.state.selection,
|
|
165
|
+
set: (e) => {
|
|
166
|
+
E.value && e && E.value.dispatch({ selection: e });
|
|
167
|
+
}
|
|
168
|
+
}), k = h({
|
|
169
|
+
get: () => E.value?.state.selection.main.head ?? 0,
|
|
170
|
+
set: (e) => {
|
|
171
|
+
E.value && E.value.dispatch({ selection: { anchor: e } });
|
|
172
|
+
}
|
|
173
|
+
}), A = h({
|
|
174
|
+
get: () => E.value?.state.toJSON(),
|
|
175
|
+
set: (e) => {
|
|
176
|
+
E.value && e && E.value.setState(c.fromJSON(e));
|
|
177
|
+
}
|
|
178
|
+
}), j = S(0), M = S(0), N = h(() => {
|
|
179
|
+
let n = new o(), s = new o();
|
|
180
|
+
if (g.basic && g.minimal) throw Error("[Vue CodeMirror] Both basic and minimal cannot be specified.");
|
|
181
|
+
let l = [];
|
|
182
|
+
return g.keymap && g.keymap.length > 0 && (l = g.keymap), g.tab && l.push(e), [
|
|
183
|
+
g.basic && !g.minimal ? p : void 0,
|
|
184
|
+
g.minimal && !g.basic ? m : void 0,
|
|
185
|
+
u.updateListener.of((e) => {
|
|
186
|
+
E.value && (_.emit("focus", E.value.hasFocus), j.value = E.value.state.doc?.length, !(e.changes.empty || !e.docChanged) && (g.linter && (g.forceLinting && r(E.value), M.value = g.linter(E.value).length), _.emit("update", e)));
|
|
187
|
+
}),
|
|
188
|
+
u.theme(g.theme, { dark: g.dark }),
|
|
189
|
+
g.wrap ? u.lineWrapping : void 0,
|
|
190
|
+
g.indentUnit ? t.of(g.indentUnit) : void 0,
|
|
191
|
+
c.allowMultipleSelections.of(g.allowMultipleSelections),
|
|
192
|
+
g.tabSize ? s.of(c.tabSize.of(g.tabSize)) : void 0,
|
|
193
|
+
g.phrases ? c.phrases.of(g.phrases) : void 0,
|
|
194
|
+
c.readOnly.of(g.readonly),
|
|
195
|
+
u.editable.of(!g.disabled),
|
|
196
|
+
g.lineSeparator ? c.lineSeparator.of(g.lineSeparator) : void 0,
|
|
197
|
+
g.lang ? n.of(g.lang) : void 0,
|
|
198
|
+
g.linter ? a(g.linter, g.linterConfig) : void 0,
|
|
199
|
+
g.linter && g.gutter ? i(g.gutterConfig) : void 0,
|
|
200
|
+
g.placeholder ? f(g.placeholder) : void 0,
|
|
201
|
+
l.length > 0 ? d.of(l) : void 0,
|
|
202
|
+
...g.extensions
|
|
203
|
+
].filter((e) => !!e);
|
|
204
|
+
});
|
|
205
|
+
w(N, (e) => E.value?.dispatch({ effects: l.reconfigure.of(e) }), { immediate: !0 }), w(() => g.modelValue, async (e) => {
|
|
206
|
+
if (!E.value || E.value.composing || E.value.state.doc.toJSON().join(g.lineSeparator ?? "\n") === e) return;
|
|
207
|
+
let t = !E.value.state.selection.ranges.every((t) => t.anchor < e.length && t.head < e.length), n = {
|
|
208
|
+
from: 0,
|
|
209
|
+
to: E.value.state.doc.length,
|
|
210
|
+
insert: e
|
|
211
|
+
}, r = g.preserveScrollPosition ? E.value.scrollSnapshot().map(E.value.state.changes(n)) : void 0;
|
|
212
|
+
E.value.dispatch({
|
|
213
|
+
changes: n,
|
|
214
|
+
selection: t ? {
|
|
215
|
+
anchor: 0,
|
|
216
|
+
head: 0
|
|
217
|
+
} : E.value.state.selection,
|
|
218
|
+
scrollIntoView: g.scrollIntoView,
|
|
219
|
+
effects: r ? [r] : void 0
|
|
220
|
+
});
|
|
221
|
+
}, { immediate: !0 }), b(async () => {
|
|
222
|
+
if (globalThis.window === void 0 || !v.value) return;
|
|
223
|
+
let e = T.value;
|
|
224
|
+
v.value.childNodes[0] && (T.value !== "" && console.warn("[CodeMirror.vue] The <code-mirror> tag contains child elements that overwrite the `v-model` values."), e = v.value.childNodes[0].innerText.trim()), E.value = new u({
|
|
225
|
+
parent: v.value,
|
|
226
|
+
state: c.create({
|
|
227
|
+
doc: e,
|
|
228
|
+
extensions: N.value
|
|
229
|
+
}),
|
|
230
|
+
dispatch: (e) => {
|
|
231
|
+
E.value && (E.value.update([e]), !(e.changes.empty || !e.docChanged) && (_.emit("update:modelValue", e.state.doc.toString()), _.emit("change", e.state)));
|
|
232
|
+
}
|
|
233
|
+
}), await y(), _.emit("ready", {
|
|
234
|
+
view: E.value,
|
|
235
|
+
state: E.value.state,
|
|
236
|
+
container: v.value
|
|
237
|
+
});
|
|
238
|
+
}), x(() => {
|
|
239
|
+
E.value && (E.value.destroy(), _.emit("destroy"));
|
|
240
|
+
});
|
|
241
|
+
let P = {
|
|
242
|
+
editor: v,
|
|
243
|
+
view: E,
|
|
244
|
+
cursor: k,
|
|
245
|
+
selection: O,
|
|
246
|
+
focus: D,
|
|
247
|
+
length: j,
|
|
248
|
+
json: A,
|
|
249
|
+
diagnosticCount: M,
|
|
250
|
+
dom: E.value?.contentDOM,
|
|
251
|
+
lint: () => {
|
|
252
|
+
!g.linter || !E.value || (g.forceLinting && r(E.value), M.value = n(E.value.state));
|
|
253
|
+
},
|
|
254
|
+
forceReconfigure: () => {
|
|
255
|
+
E.value?.dispatch({ effects: l.reconfigure.of([]) }), E.value?.dispatch({ effects: l.appendConfig.of(N.value) });
|
|
256
|
+
},
|
|
257
|
+
getRange: (e, t) => E.value?.state.sliceDoc(e, t),
|
|
258
|
+
getLine: (e) => E.value?.state.doc.line(e + 1).text,
|
|
259
|
+
lineCount: () => E.value?.state.doc.lines ?? 0,
|
|
260
|
+
getCursor: () => E.value?.state.selection.main.head ?? 0,
|
|
261
|
+
listSelections: () => E.value?.state.selection.ranges ?? [],
|
|
262
|
+
getSelection: () => E.value ? E.value.state.sliceDoc(E.value.state.selection.main.from, E.value.state.selection.main.to) : "",
|
|
263
|
+
getSelections: () => {
|
|
264
|
+
let e = E.value?.state;
|
|
265
|
+
return e ? e.selection.ranges.map((t) => e.sliceDoc(t.from, t.to)) : [];
|
|
266
|
+
},
|
|
267
|
+
somethingSelected: () => E.value?.state.selection.ranges.some((e) => !e.empty) ?? !1,
|
|
268
|
+
replaceRange: (e, t, n) => {
|
|
269
|
+
E.value && E.value.dispatch({ changes: {
|
|
270
|
+
from: t,
|
|
271
|
+
to: n,
|
|
272
|
+
insert: e
|
|
273
|
+
} });
|
|
274
|
+
},
|
|
275
|
+
replaceSelection: (e) => {
|
|
276
|
+
E.value && E.value.dispatch(E.value.state.replaceSelection(e));
|
|
277
|
+
},
|
|
278
|
+
setCursor: (e) => {
|
|
279
|
+
E.value && E.value.dispatch({ selection: { anchor: e } });
|
|
280
|
+
},
|
|
281
|
+
setSelection: (e, t) => {
|
|
282
|
+
E.value && E.value.dispatch({ selection: {
|
|
283
|
+
anchor: e,
|
|
284
|
+
head: t
|
|
285
|
+
} });
|
|
286
|
+
},
|
|
287
|
+
setSelections: (e, t) => {
|
|
288
|
+
E.value && E.value.dispatch({ selection: s.create(e, t) });
|
|
289
|
+
},
|
|
290
|
+
extendSelectionsBy: (e) => {
|
|
291
|
+
E.value && O.value && E.value.dispatch({ selection: s.create(O.value.ranges.map((t) => t.extend(e(t)))) });
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
return _.expose(P), P;
|
|
295
|
+
},
|
|
296
|
+
render() {
|
|
297
|
+
return D(this.$props.tag, {
|
|
298
|
+
ref: "editor",
|
|
299
|
+
class: "vue-codemirror"
|
|
300
|
+
}, this.$slots.default ? D("aside", {
|
|
301
|
+
style: "display: none;",
|
|
302
|
+
"aria-hidden": "true"
|
|
303
|
+
}, O(this.$slots.default)) : void 0);
|
|
304
|
+
}
|
|
305
|
+
}), A = (e) => e.component("CodeMirror", k);
|
|
306
|
+
//#endregion
|
|
307
|
+
export { T as Meta, k as default, A as install };
|
package/dist/index.iife.js
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* @author Logue <logue@hotmail.co.jp>
|
|
6
6
|
* @copyright 2022-2026 By Masashi Yoshikawa All rights reserved.
|
|
7
7
|
* @license MIT
|
|
8
|
-
* @version 1.
|
|
8
|
+
* @version 1.5.0
|
|
9
9
|
* @see {@link https://github.com/logue/vue-codemirror6}
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
var CodeMirror=(function(
|
|
13
|
-
`)===
|
|
12
|
+
var CodeMirror=(function(e,t,n,r,i,a,o,s){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var c={version:`1.5.0`,date:`2026-03-30T11:56:36.326Z`},l=e=>e?Object.entries(e).reduce((e,[t,n])=>(t=t.charAt(0).toUpperCase()+t.slice(1),t=`on${t}`,{...e,[t]:n}),{}):{};function u(e,t={},n){if(s.isVue2)return(0,s.h)(e,t,n);let{props:r,domProps:i,on:a,...o}=t,c=a?l(a):{};return(0,s.h)(e,{...o,...r,...i,...c},n)}var d=e=>typeof e==`function`?e():e,f=(0,s.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},indentUnit:{type:String,default:void 0},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:void 0},lang:{type:Object,default:void 0},linter:{type:Function,default:void 0},linterConfig:{type:Object,default:()=>({})},forceLinting:{type:Boolean,default:!1},gutter:{type:Boolean,default:!1},gutterConfig:{type:Object,default:void 0},tag:{type:String,default:`div`},scrollIntoView:{type:Boolean,default:!0},preserveScrollPosition:{type:Boolean,default:!1},keymap:{type:Array,default:()=>[]}},emits:{"update:modelValue":(e=``)=>!0,update:e=>!0,ready:e=>!0,focus:e=>!0,change:e=>!0,destroy:()=>!0},setup(e,c){let l=(0,s.ref)(),u=(0,s.ref)(e.modelValue),d=(0,s.shallowRef)(void 0),f=(0,s.computed)({get:()=>d.value?.hasFocus??!1,set:e=>{e&&d.value&&d.value.focus()}}),p=(0,s.computed)({get:()=>d.value?.state.selection,set:e=>{d.value&&e&&d.value.dispatch({selection:e})}}),m=(0,s.computed)({get:()=>d.value?.state.selection.main.head??0,set:e=>{d.value&&d.value.dispatch({selection:{anchor:e}})}}),h=(0,s.computed)({get:()=>d.value?.state.toJSON(),set:e=>{d.value&&e&&d.value.setState(i.EditorState.fromJSON(e))}}),g=(0,s.ref)(0),_=(0,s.ref)(0),v=(0,s.computed)(()=>{let s=new i.Compartment,l=new i.Compartment;if(e.basic&&e.minimal)throw Error(`[Vue CodeMirror] Both basic and minimal cannot be specified.`);let u=[];return e.keymap&&e.keymap.length>0&&(u=e.keymap),e.tab&&u.push(t.indentWithTab),[e.basic&&!e.minimal?o.basicSetup:void 0,e.minimal&&!e.basic?o.minimalSetup:void 0,a.EditorView.updateListener.of(t=>{d.value&&(c.emit(`focus`,d.value.hasFocus),g.value=d.value.state.doc?.length,!(t.changes.empty||!t.docChanged)&&(e.linter&&(e.forceLinting&&(0,r.forceLinting)(d.value),_.value=e.linter(d.value).length),c.emit(`update`,t)))}),a.EditorView.theme(e.theme,{dark:e.dark}),e.wrap?a.EditorView.lineWrapping:void 0,e.indentUnit?n.indentUnit.of(e.indentUnit):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),a.EditorView.editable.of(!e.disabled),e.lineSeparator?i.EditorState.lineSeparator.of(e.lineSeparator):void 0,e.lang?s.of(e.lang):void 0,e.linter?(0,r.linter)(e.linter,e.linterConfig):void 0,e.linter&&e.gutter?(0,r.lintGutter)(e.gutterConfig):void 0,e.placeholder?(0,a.placeholder)(e.placeholder):void 0,u.length>0?a.keymap.of(u):void 0,...e.extensions].filter(e=>!!e)});(0,s.watch)(v,e=>d.value?.dispatch({effects:i.StateEffect.reconfigure.of(e)}),{immediate:!0}),(0,s.watch)(()=>e.modelValue,async t=>{if(!d.value||d.value.composing||d.value.state.doc.toJSON().join(e.lineSeparator??`
|
|
13
|
+
`)===t)return;let n=!d.value.state.selection.ranges.every(e=>e.anchor<t.length&&e.head<t.length),r={from:0,to:d.value.state.doc.length,insert:t},i=e.preserveScrollPosition?d.value.scrollSnapshot().map(d.value.state.changes(r)):void 0;d.value.dispatch({changes:r,selection:n?{anchor:0,head:0}:d.value.state.selection,scrollIntoView:e.scrollIntoView,effects:i?[i]:void 0})},{immediate:!0}),(0,s.onMounted)(async()=>{if(globalThis.window===void 0||!l.value)return;let e=u.value;l.value.childNodes[0]&&(u.value!==``&&console.warn("[CodeMirror.vue] The <code-mirror> tag contains child elements that overwrite the `v-model` values."),e=l.value.childNodes[0].innerText.trim()),d.value=new a.EditorView({parent:l.value,state:i.EditorState.create({doc:e,extensions:v.value}),dispatch:e=>{d.value&&(d.value.update([e]),!(e.changes.empty||!e.docChanged)&&(c.emit(`update:modelValue`,e.state.doc.toString()),c.emit(`change`,e.state)))}}),await(0,s.nextTick)(),c.emit(`ready`,{view:d.value,state:d.value.state,container:l.value})}),(0,s.onUnmounted)(()=>{d.value&&(d.value.destroy(),c.emit(`destroy`))});let y={editor:l,view:d,cursor:m,selection:p,focus:f,length:g,json:h,diagnosticCount:_,dom:d.value?.contentDOM,lint:()=>{!e.linter||!d.value||(e.forceLinting&&(0,r.forceLinting)(d.value),_.value=(0,r.diagnosticCount)(d.value.state))},forceReconfigure:()=>{d.value?.dispatch({effects:i.StateEffect.reconfigure.of([])}),d.value?.dispatch({effects:i.StateEffect.appendConfig.of(v.value)})},getRange:(e,t)=>d.value?.state.sliceDoc(e,t),getLine:e=>d.value?.state.doc.line(e+1).text,lineCount:()=>d.value?.state.doc.lines??0,getCursor:()=>d.value?.state.selection.main.head??0,listSelections:()=>d.value?.state.selection.ranges??[],getSelection:()=>d.value?d.value.state.sliceDoc(d.value.state.selection.main.from,d.value.state.selection.main.to):``,getSelections:()=>{let e=d.value?.state;return e?e.selection.ranges.map(t=>e.sliceDoc(t.from,t.to)):[]},somethingSelected:()=>d.value?.state.selection.ranges.some(e=>!e.empty)??!1,replaceRange:(e,t,n)=>{d.value&&d.value.dispatch({changes:{from:t,to:n,insert:e}})},replaceSelection:e=>{d.value&&d.value.dispatch(d.value.state.replaceSelection(e))},setCursor:e=>{d.value&&d.value.dispatch({selection:{anchor:e}})},setSelection:(e,t)=>{d.value&&d.value.dispatch({selection:{anchor:e,head:t}})},setSelections:(e,t)=>{d.value&&d.value.dispatch({selection:i.EditorSelection.create(e,t)})},extendSelectionsBy:e=>{d.value&&p.value&&d.value.dispatch({selection:i.EditorSelection.create(p.value.ranges.map(t=>t.extend(e(t))))})}};return c.expose(y),y},render(){return u(this.$props.tag,{ref:`editor`,class:`vue-codemirror`},this.$slots.default?u(`aside`,{style:`display: none;`,"aria-hidden":`true`},d(this.$slots.default)):void 0)}});return e.Meta=c,e.default=f,e.install=e=>e.component(`CodeMirror`,f),e})({},commands,language,lint,state,view,codemirror,VueDemi);
|
package/dist/index.umd.js
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* @author Logue <logue@hotmail.co.jp>
|
|
6
6
|
* @copyright 2022-2026 By Masashi Yoshikawa All rights reserved.
|
|
7
7
|
* @license MIT
|
|
8
|
-
* @version 1.
|
|
8
|
+
* @version 1.5.0
|
|
9
9
|
* @see {@link https://github.com/logue/vue-codemirror6}
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
(function(
|
|
13
|
-
`)===
|
|
12
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@codemirror/commands`),require(`@codemirror/language`),require(`@codemirror/lint`),require(`@codemirror/state`),require(`@codemirror/view`),require(`codemirror`),require(`vue-demi`)):typeof define==`function`&&define.amd?define([`exports`,`@codemirror/commands`,`@codemirror/language`,`@codemirror/lint`,`@codemirror/state`,`@codemirror/view`,`codemirror`,`vue-demi`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.CodeMirror={},e.commands,e.language,e.lint,e.state,e.view,e.codemirror,e.VueDemi))})(this,function(e,t,n,r,i,a,o,s){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var c={version:`1.5.0`,date:`2026-03-30T11:56:36.326Z`},l=e=>e?Object.entries(e).reduce((e,[t,n])=>(t=t.charAt(0).toUpperCase()+t.slice(1),t=`on${t}`,{...e,[t]:n}),{}):{};function u(e,t={},n){if(s.isVue2)return(0,s.h)(e,t,n);let{props:r,domProps:i,on:a,...o}=t,c=a?l(a):{};return(0,s.h)(e,{...o,...r,...i,...c},n)}var d=e=>typeof e==`function`?e():e,f=(0,s.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},indentUnit:{type:String,default:void 0},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:void 0},lang:{type:Object,default:void 0},linter:{type:Function,default:void 0},linterConfig:{type:Object,default:()=>({})},forceLinting:{type:Boolean,default:!1},gutter:{type:Boolean,default:!1},gutterConfig:{type:Object,default:void 0},tag:{type:String,default:`div`},scrollIntoView:{type:Boolean,default:!0},preserveScrollPosition:{type:Boolean,default:!1},keymap:{type:Array,default:()=>[]}},emits:{"update:modelValue":(e=``)=>!0,update:e=>!0,ready:e=>!0,focus:e=>!0,change:e=>!0,destroy:()=>!0},setup(e,c){let l=(0,s.ref)(),u=(0,s.ref)(e.modelValue),d=(0,s.shallowRef)(void 0),f=(0,s.computed)({get:()=>d.value?.hasFocus??!1,set:e=>{e&&d.value&&d.value.focus()}}),p=(0,s.computed)({get:()=>d.value?.state.selection,set:e=>{d.value&&e&&d.value.dispatch({selection:e})}}),m=(0,s.computed)({get:()=>d.value?.state.selection.main.head??0,set:e=>{d.value&&d.value.dispatch({selection:{anchor:e}})}}),h=(0,s.computed)({get:()=>d.value?.state.toJSON(),set:e=>{d.value&&e&&d.value.setState(i.EditorState.fromJSON(e))}}),g=(0,s.ref)(0),_=(0,s.ref)(0),v=(0,s.computed)(()=>{let s=new i.Compartment,l=new i.Compartment;if(e.basic&&e.minimal)throw Error(`[Vue CodeMirror] Both basic and minimal cannot be specified.`);let u=[];return e.keymap&&e.keymap.length>0&&(u=e.keymap),e.tab&&u.push(t.indentWithTab),[e.basic&&!e.minimal?o.basicSetup:void 0,e.minimal&&!e.basic?o.minimalSetup:void 0,a.EditorView.updateListener.of(t=>{d.value&&(c.emit(`focus`,d.value.hasFocus),g.value=d.value.state.doc?.length,!(t.changes.empty||!t.docChanged)&&(e.linter&&(e.forceLinting&&(0,r.forceLinting)(d.value),_.value=e.linter(d.value).length),c.emit(`update`,t)))}),a.EditorView.theme(e.theme,{dark:e.dark}),e.wrap?a.EditorView.lineWrapping:void 0,e.indentUnit?n.indentUnit.of(e.indentUnit):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),a.EditorView.editable.of(!e.disabled),e.lineSeparator?i.EditorState.lineSeparator.of(e.lineSeparator):void 0,e.lang?s.of(e.lang):void 0,e.linter?(0,r.linter)(e.linter,e.linterConfig):void 0,e.linter&&e.gutter?(0,r.lintGutter)(e.gutterConfig):void 0,e.placeholder?(0,a.placeholder)(e.placeholder):void 0,u.length>0?a.keymap.of(u):void 0,...e.extensions].filter(e=>!!e)});(0,s.watch)(v,e=>d.value?.dispatch({effects:i.StateEffect.reconfigure.of(e)}),{immediate:!0}),(0,s.watch)(()=>e.modelValue,async t=>{if(!d.value||d.value.composing||d.value.state.doc.toJSON().join(e.lineSeparator??`
|
|
13
|
+
`)===t)return;let n=!d.value.state.selection.ranges.every(e=>e.anchor<t.length&&e.head<t.length),r={from:0,to:d.value.state.doc.length,insert:t},i=e.preserveScrollPosition?d.value.scrollSnapshot().map(d.value.state.changes(r)):void 0;d.value.dispatch({changes:r,selection:n?{anchor:0,head:0}:d.value.state.selection,scrollIntoView:e.scrollIntoView,effects:i?[i]:void 0})},{immediate:!0}),(0,s.onMounted)(async()=>{if(globalThis.window===void 0||!l.value)return;let e=u.value;l.value.childNodes[0]&&(u.value!==``&&console.warn("[CodeMirror.vue] The <code-mirror> tag contains child elements that overwrite the `v-model` values."),e=l.value.childNodes[0].innerText.trim()),d.value=new a.EditorView({parent:l.value,state:i.EditorState.create({doc:e,extensions:v.value}),dispatch:e=>{d.value&&(d.value.update([e]),!(e.changes.empty||!e.docChanged)&&(c.emit(`update:modelValue`,e.state.doc.toString()),c.emit(`change`,e.state)))}}),await(0,s.nextTick)(),c.emit(`ready`,{view:d.value,state:d.value.state,container:l.value})}),(0,s.onUnmounted)(()=>{d.value&&(d.value.destroy(),c.emit(`destroy`))});let y={editor:l,view:d,cursor:m,selection:p,focus:f,length:g,json:h,diagnosticCount:_,dom:d.value?.contentDOM,lint:()=>{!e.linter||!d.value||(e.forceLinting&&(0,r.forceLinting)(d.value),_.value=(0,r.diagnosticCount)(d.value.state))},forceReconfigure:()=>{d.value?.dispatch({effects:i.StateEffect.reconfigure.of([])}),d.value?.dispatch({effects:i.StateEffect.appendConfig.of(v.value)})},getRange:(e,t)=>d.value?.state.sliceDoc(e,t),getLine:e=>d.value?.state.doc.line(e+1).text,lineCount:()=>d.value?.state.doc.lines??0,getCursor:()=>d.value?.state.selection.main.head??0,listSelections:()=>d.value?.state.selection.ranges??[],getSelection:()=>d.value?d.value.state.sliceDoc(d.value.state.selection.main.from,d.value.state.selection.main.to):``,getSelections:()=>{let e=d.value?.state;return e?e.selection.ranges.map(t=>e.sliceDoc(t.from,t.to)):[]},somethingSelected:()=>d.value?.state.selection.ranges.some(e=>!e.empty)??!1,replaceRange:(e,t,n)=>{d.value&&d.value.dispatch({changes:{from:t,to:n,insert:e}})},replaceSelection:e=>{d.value&&d.value.dispatch(d.value.state.replaceSelection(e))},setCursor:e=>{d.value&&d.value.dispatch({selection:{anchor:e}})},setSelection:(e,t)=>{d.value&&d.value.dispatch({selection:{anchor:e,head:t}})},setSelections:(e,t)=>{d.value&&d.value.dispatch({selection:i.EditorSelection.create(e,t)})},extendSelectionsBy:e=>{d.value&&p.value&&d.value.dispatch({selection:i.EditorSelection.create(p.value.ranges.map(t=>t.extend(e(t))))})}};return c.expose(y),y},render(){return u(this.$props.tag,{ref:`editor`,class:`vue-codemirror`},this.$slots.default?u(`aside`,{style:`display: none;`,"aria-hidden":`true`},d(this.$slots.default)):void 0)}});e.Meta=c,e.default=f,e.install=e=>e.component(`CodeMirror`,f)});
|
|
@@ -4,7 +4,7 @@ import { EditorSelection, EditorState, Extension, SelectionRange, StateField, Te
|
|
|
4
4
|
import { EditorView, KeyBinding, ViewUpdate } from '@codemirror/view';
|
|
5
5
|
import { PropType, Ref, ShallowRef, WritableComputedRef } from 'vue-demi';
|
|
6
6
|
import { StyleSpec } from 'style-mod';
|
|
7
|
-
import { default as Meta } from '
|
|
7
|
+
import { default as Meta } from '../Meta';
|
|
8
8
|
/** CodeMirror Component */
|
|
9
9
|
declare const CodeMirror: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
10
10
|
/** Model value */
|
|
@@ -274,6 +274,18 @@ declare const CodeMirror: import('vue').DefineComponent<import('vue').ExtractPro
|
|
|
274
274
|
type: BooleanConstructor;
|
|
275
275
|
default: boolean;
|
|
276
276
|
};
|
|
277
|
+
/**
|
|
278
|
+
* Preserve the current scroll position on external updates.
|
|
279
|
+
*
|
|
280
|
+
* This keeps the editor's own scroll container from jumping when
|
|
281
|
+
* `modelValue` is updated from outside the component.
|
|
282
|
+
*
|
|
283
|
+
* @see {@link https://codemirror.net/docs/ref/#view.EditorView.scrollSnapshot}
|
|
284
|
+
*/
|
|
285
|
+
preserveScrollPosition: {
|
|
286
|
+
type: BooleanConstructor;
|
|
287
|
+
default: boolean;
|
|
288
|
+
};
|
|
277
289
|
/**
|
|
278
290
|
* Key map
|
|
279
291
|
* This is a CodeMirror Facet that allows you to define custom key bindings.
|
|
@@ -596,6 +608,18 @@ declare const CodeMirror: import('vue').DefineComponent<import('vue').ExtractPro
|
|
|
596
608
|
type: BooleanConstructor;
|
|
597
609
|
default: boolean;
|
|
598
610
|
};
|
|
611
|
+
/**
|
|
612
|
+
* Preserve the current scroll position on external updates.
|
|
613
|
+
*
|
|
614
|
+
* This keeps the editor's own scroll container from jumping when
|
|
615
|
+
* `modelValue` is updated from outside the component.
|
|
616
|
+
*
|
|
617
|
+
* @see {@link https://codemirror.net/docs/ref/#view.EditorView.scrollSnapshot}
|
|
618
|
+
*/
|
|
619
|
+
preserveScrollPosition: {
|
|
620
|
+
type: BooleanConstructor;
|
|
621
|
+
default: boolean;
|
|
622
|
+
};
|
|
599
623
|
/**
|
|
600
624
|
* Key map
|
|
601
625
|
* This is a CodeMirror Facet that allows you to define custom key bindings.
|
|
@@ -643,6 +667,7 @@ declare const CodeMirror: import('vue').DefineComponent<import('vue').ExtractPro
|
|
|
643
667
|
gutterConfig: Record<string, any>;
|
|
644
668
|
tag: string;
|
|
645
669
|
scrollIntoView: boolean;
|
|
670
|
+
preserveScrollPosition: boolean;
|
|
646
671
|
keymap: KeyBinding[];
|
|
647
672
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
648
673
|
declare const installCodeMirror: (app: any) => void;
|
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.
|
|
4
|
+
"version": "1.5.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "CodeMirror6 Component for vue2 and vue3.",
|
|
7
7
|
"keywords": [
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"node": "^20.19.0 || >=22.12.0",
|
|
61
61
|
"pnpm": ">=10.3.0"
|
|
62
62
|
},
|
|
63
|
-
"packageManager": "pnpm@10.
|
|
63
|
+
"packageManager": "pnpm@10.33.0",
|
|
64
64
|
"scripts": {
|
|
65
65
|
"dev": "vite",
|
|
66
66
|
"clean": "rimraf node_modules/.vite",
|
|
@@ -99,61 +99,61 @@
|
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
101
|
"@codemirror/autocomplete": "^6.20.1",
|
|
102
|
-
"@codemirror/commands": "^6.10.
|
|
102
|
+
"@codemirror/commands": "^6.10.3",
|
|
103
103
|
"@codemirror/lang-javascript": "^6.2.5",
|
|
104
104
|
"@codemirror/lang-json": "^6.0.2",
|
|
105
105
|
"@codemirror/lang-markdown": "^6.5.0",
|
|
106
106
|
"@codemirror/lang-vue": "^0.1.3",
|
|
107
|
-
"@codemirror/language": "^6.12.
|
|
107
|
+
"@codemirror/language": "^6.12.3",
|
|
108
108
|
"@codemirror/lint": "^6.9.5",
|
|
109
109
|
"@codemirror/search": "^6.6.0",
|
|
110
|
-
"@codemirror/state": "^6.
|
|
111
|
-
"@codemirror/view": "^6.
|
|
110
|
+
"@codemirror/state": "^6.6.0",
|
|
111
|
+
"@codemirror/view": "^6.40.0",
|
|
112
112
|
"@tsconfig/node-lts": "^24.0.0",
|
|
113
|
-
"@types/node": "^25.
|
|
114
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
115
|
-
"@vitest/ui": "^4.
|
|
116
|
-
"@vue/compiler-sfc": "^3.5.
|
|
113
|
+
"@types/node": "^25.5.0",
|
|
114
|
+
"@vitejs/plugin-vue": "^6.0.5",
|
|
115
|
+
"@vitest/ui": "^4.1.2",
|
|
116
|
+
"@vue/compiler-sfc": "^3.5.31",
|
|
117
117
|
"@vue/eslint-config-prettier": "^10.2.0",
|
|
118
118
|
"@vue/eslint-config-typescript": "^14.7.0",
|
|
119
119
|
"@vue/test-utils": "^2.4.6",
|
|
120
|
-
"@vue/tsconfig": "^0.9.
|
|
120
|
+
"@vue/tsconfig": "^0.9.1",
|
|
121
121
|
"@vueuse/core": "^14.2.1",
|
|
122
122
|
"bootstrap": "^5.3.8",
|
|
123
123
|
"codemirror": "^6.0.2",
|
|
124
|
-
"eslint": "^10.0
|
|
124
|
+
"eslint": "^10.1.0",
|
|
125
125
|
"eslint-import-resolver-custom-alias": "^1.3.2",
|
|
126
126
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
127
|
-
"eslint-linter-browserify": "^10.0
|
|
128
|
-
"eslint-plugin-import-x": "^4.16.
|
|
129
|
-
"eslint-plugin-oxlint": "^1.
|
|
130
|
-
"eslint-plugin-playwright": "^2.
|
|
127
|
+
"eslint-linter-browserify": "^10.1.0",
|
|
128
|
+
"eslint-plugin-import-x": "^4.16.2",
|
|
129
|
+
"eslint-plugin-oxlint": "^1.57.0",
|
|
130
|
+
"eslint-plugin-playwright": "^2.10.1",
|
|
131
131
|
"eslint-plugin-security": "^4.0.0",
|
|
132
132
|
"eslint-plugin-vue": "^10.8.0",
|
|
133
133
|
"eslint-plugin-vuejs-accessibility": "^2.5.0",
|
|
134
|
-
"happy-dom": "^20.8.
|
|
134
|
+
"happy-dom": "^20.8.9",
|
|
135
135
|
"husky": "^9.1.7",
|
|
136
136
|
"jiti": "^2.6.1",
|
|
137
|
-
"lint-staged": "^16.
|
|
137
|
+
"lint-staged": "^16.4.0",
|
|
138
138
|
"npm-run-all2": "^8.0.4",
|
|
139
|
-
"oxlint": "^1.
|
|
139
|
+
"oxlint": "^1.57.0",
|
|
140
140
|
"prettier": "^3.8.1",
|
|
141
141
|
"rimraf": "^6.1.3",
|
|
142
142
|
"rollup-plugin-visualizer": "^7.0.1",
|
|
143
|
-
"sass-embedded": "^1.
|
|
143
|
+
"sass-embedded": "^1.98.0",
|
|
144
144
|
"style-mod": "^4.1.3",
|
|
145
145
|
"supports-color": "^10.2.2",
|
|
146
|
-
"typescript": "^
|
|
147
|
-
"typescript-eslint": "^8.
|
|
148
|
-
"vite": "^
|
|
146
|
+
"typescript": "^6.0.2",
|
|
147
|
+
"typescript-eslint": "^8.57.2",
|
|
148
|
+
"vite": "^8.0.3",
|
|
149
149
|
"vite-plugin-banner": "^0.8.1",
|
|
150
150
|
"vite-plugin-checker": "^0.12.0",
|
|
151
151
|
"vite-plugin-dts": "^4.5.4",
|
|
152
|
-
"vitest": "^4.
|
|
153
|
-
"vue": "^3.5.
|
|
152
|
+
"vitest": "^4.1.2",
|
|
153
|
+
"vue": "^3.5.31",
|
|
154
154
|
"vue-eslint-parser": "^10.4.0",
|
|
155
155
|
"vue-markdown-wasm": "^1.0.1",
|
|
156
|
-
"vue-tsc": "^3.2.
|
|
156
|
+
"vue-tsc": "^3.2.6"
|
|
157
157
|
},
|
|
158
158
|
"husky": {
|
|
159
159
|
"hooks": {
|
|
@@ -165,8 +165,6 @@
|
|
|
165
165
|
"*": "prettier -w -u"
|
|
166
166
|
},
|
|
167
167
|
"resolutions": {
|
|
168
|
-
"
|
|
169
|
-
"minimatch": ">=10.2.3",
|
|
170
|
-
"yaml": ">=2.6.0"
|
|
168
|
+
"js-yaml": ">=4.1.1"
|
|
171
169
|
}
|
|
172
|
-
}
|
|
170
|
+
}
|
package/dist/Meta.d.ts
DELETED
|
File without changes
|
|
File without changes
|