vue-codemirror6 1.1.12 → 1.1.14
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 +20 -1
- package/README.md +28 -25
- package/dist/index.es.js +21 -8
- package/dist/index.iife.js +21 -8
- package/dist/index.umd.js +21 -8
- package/dist/src/components/CodeMirror.d.ts +0 -2
- package/package.json +9 -15
- package/src/components/CodeMirror.ts +18 -7
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,26 @@ 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.1.
|
|
7
|
+
#### [1.1.14](https://github.com/logue/vue-codemirror6/compare/1.1.13...1.1.14)
|
|
8
|
+
|
|
9
|
+
- Fixed Maximum call stack size exceeded error. [`f10eaae`](https://github.com/logue/vue-codemirror6/commit/f10eaaea9145bc1d7a6605ab3cb8a82c0ca12df6)
|
|
10
|
+
|
|
11
|
+
#### [1.1.13](https://github.com/logue/vue-codemirror6/compare/1.1.12...1.1.13)
|
|
12
|
+
|
|
13
|
+
> 13 March 2023
|
|
14
|
+
|
|
15
|
+
- Changed minimum Vue version requirement to 2.7.14. [`5b8b255`](https://github.com/logue/vue-codemirror6/commit/5b8b2558967f9fb6f6d9e83a0181afa50f182b98)
|
|
16
|
+
- Add allow-multiple-selections prop. [`ced91ed`](https://github.com/logue/vue-codemirror6/commit/ced91edab8fc25f8f1299341489f6bbbdace9ce8)
|
|
17
|
+
- Update CHANGELOG.md [`51d30e2`](https://github.com/logue/vue-codemirror6/commit/51d30e2f6370847ef888ab2b39ff6e1c8e3ec851)
|
|
18
|
+
|
|
19
|
+
#### [1.1.12](https://github.com/logue/vue-codemirror6/compare/1.1.11...1.1.12)
|
|
20
|
+
|
|
21
|
+
> 10 March 2023
|
|
22
|
+
|
|
23
|
+
- chore(CODEOWNERS): CODEOWNERS.com Bot, at your service! [`#14`](https://github.com/logue/vue-codemirror6/pull/14)
|
|
24
|
+
- Update demo code. (Replaced @codemirror/html to @codemirror/vue.) [`8da1a8a`](https://github.com/logue/vue-codemirror6/commit/8da1a8a4e37d713cc78281ce9c304c42a06940dc)
|
|
25
|
+
- Changed implementation to generate *.d.ts with vite-plugin-dts. [`1caaa20`](https://github.com/logue/vue-codemirror6/commit/1caaa20b1423a3d252a6c770a630fb60e2e3440d)
|
|
26
|
+
- Update README.md. [`f8dd493`](https://github.com/logue/vue-codemirror6/commit/f8dd4934a7b9cc089cd830473db5250d28b3389b)
|
|
8
27
|
|
|
9
28
|
#### [1.1.11](https://github.com/logue/vue-codemirror6/compare/1.1.3...1.1.11)
|
|
10
29
|
|
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# vue-codemirror6
|
|
2
2
|
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img src="https://user-images.githubusercontent.com/480173/224358008-6ffad05d-1d97-4c18-8554-7d41b03f88ab.png" alt="logo" width="300" height="300" />
|
|
5
|
+
</p>
|
|
6
|
+
|
|
3
7
|
[](https://www.jsdelivr.com/package/npm/vue-codemirror6)
|
|
4
8
|
[](https://www.npmjs.com/package/vue-codemirror6)
|
|
5
9
|
[](https://uiwjs.github.io/npm-unpkg/#/pkg/vue-codemirror6/file/README.md)
|
|
@@ -27,28 +31,29 @@ This component can handle bidirectional binding by `v-model` like a general Vue
|
|
|
27
31
|
|
|
28
32
|
## Props
|
|
29
33
|
|
|
30
|
-
| Props
|
|
31
|
-
|
|
|
32
|
-
| model-value
|
|
33
|
-
| basic
|
|
34
|
-
| minimal
|
|
35
|
-
| dark
|
|
36
|
-
| placeholder
|
|
37
|
-
| wrap
|
|
38
|
-
| tab
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
|
|
|
34
|
+
| Props | Type | Information |
|
|
35
|
+
| ------------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
36
|
+
| model-value | string \| Text | Text value. (Not `value`) |
|
|
37
|
+
| basic | boolean | Use [basicSetup](https://codemirror.net/docs/ref/#codemirror.basicSetup). |
|
|
38
|
+
| minimal | boolean | Use [miniSetup](https://codemirror.net/docs/ref/#codemirror.minimalSetup). If a `basic` prop is also specified, that setting will take precedence. |
|
|
39
|
+
| dark | boolean | Toggle Darkmode. |
|
|
40
|
+
| placeholder | string | Add placeholder text (or HTML DOM) when blank |
|
|
41
|
+
| wrap | boolean | Line text wrapping. see [lineWrapping](https://codemirror.net/6/docs/ref/#view.EditorView.lineWrapping). |
|
|
42
|
+
| tab | boolean | Enables tab indentation. |
|
|
43
|
+
| allow-multiple-selections | boolean | Allow Multiple Selection. See [allowMultipleSelections](https://codemirror.net/docs/ref/#state.EditorState^allowMultipleSelections) |
|
|
44
|
+
| tab-size | number | Configures the tab size to use in this state. |
|
|
45
|
+
| line-separator | string | Set line break (separetor) char. (Default is `\n`.) |
|
|
46
|
+
| theme | { [selector: string]: StyleSpec } | Specify the theme. For example, if you use [@codemirror/theme-one-dark](https://github.com/codemirror/theme-one-dark), import `oneDark` and put it in this prop. |
|
|
47
|
+
| readonly | boolean | Makes the cursor visible or you can drag the text but not edit the value. |
|
|
48
|
+
| disabled | boolean | This is the reversed value of the CodeMirror editable. Similar to `readonly`, but setting this value to true disables dragging. |
|
|
49
|
+
| lang | LanguageSupport | The language you want to have syntax highlighting. see <https://codemirror.net/6/#languages> |
|
|
50
|
+
| phrases | Record<string, string> | Specify here if you want to make the displayed character string multilingual. see <https://codemirror.net/6/examples/translate/> |
|
|
51
|
+
| extensions | Extension[] | Includes enhancements to extend CodeMirror. |
|
|
52
|
+
| linter | LintSource | Set Linter. Enter a linter (eg `esLint([arbitrary rule])` function for `@codemirror/lang-javascript`, `jsonParseLinter()`function for`@codemirror/json`). See the sources for various language libraries for more information. |
|
|
53
|
+
| linterConfig | Object | see <https://codemirror.net/docs/ref/#lint.linter^config> |
|
|
54
|
+
| gutter | boolean | Display 🔴 on the line where there was an error when `linter` was specified. It will not work if `linter` is not specified. |
|
|
55
|
+
| gutterConfig | Object | see <https://codemirror.net/docs/ref/#lint.lintGutter^config> |
|
|
56
|
+
| tag | string | HTML tags used in the component. (Default is `div` tag.) |
|
|
52
57
|
|
|
53
58
|
⚠ 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.
|
|
54
59
|
|
|
@@ -387,6 +392,4 @@ const config: UserConfig = {
|
|
|
387
392
|
|
|
388
393
|
## LICENSE
|
|
389
394
|
|
|
390
|
-
[MIT](LICENSE)
|
|
391
|
-
|
|
392
|
-
© 2022 by Logue.
|
|
395
|
+
©2022-2023 by Logue. Licensed under the [MIT License](LICENSE).
|
package/dist/index.es.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @author Logue <logue@hotmail.co.jp>
|
|
6
6
|
* @copyright 2022-2023 By Masashi Yoshikawa All rights reserved.
|
|
7
7
|
* @license MIT
|
|
8
|
-
* @version 1.1.
|
|
8
|
+
* @version 1.1.13
|
|
9
9
|
* @see {@link https://github.com/logue/vue-codemirror6}
|
|
10
10
|
*/
|
|
11
11
|
|
|
@@ -117,6 +117,15 @@ var CodeMirror = defineComponent({
|
|
|
117
117
|
type: Boolean,
|
|
118
118
|
default: false
|
|
119
119
|
},
|
|
120
|
+
/**
|
|
121
|
+
* Allow Multiple Selection.
|
|
122
|
+
*
|
|
123
|
+
* @see {@link https://codemirror.net/docs/ref/#state.EditorState^allowMultipleSelections}
|
|
124
|
+
*/
|
|
125
|
+
allowMultipleSelections: {
|
|
126
|
+
type: Boolean,
|
|
127
|
+
default: false
|
|
128
|
+
},
|
|
120
129
|
/**
|
|
121
130
|
* Tab size
|
|
122
131
|
*
|
|
@@ -295,6 +304,8 @@ var CodeMirror = defineComponent({
|
|
|
295
304
|
props.wrap ? EditorView.lineWrapping : void 0,
|
|
296
305
|
// Indent with tab
|
|
297
306
|
props.tab ? keymap.of([indentWithTab]) : void 0,
|
|
307
|
+
// Allow Multiple Selections
|
|
308
|
+
EditorState.allowMultipleSelections.of(props.allowMultipleSelections),
|
|
298
309
|
// Indent tab size
|
|
299
310
|
props.tabSize ? EditorState.tabSize.of(props.tabSize) : void 0,
|
|
300
311
|
// locale settings
|
|
@@ -306,14 +317,14 @@ var CodeMirror = defineComponent({
|
|
|
306
317
|
// Set Line break char
|
|
307
318
|
props.lineSeparator ? EditorState.lineSeparator.of(props.lineSeparator) : void 0,
|
|
308
319
|
// Lang
|
|
309
|
-
props.lang ? props.lang : void 0,
|
|
320
|
+
props.lang ? props.lang.extension : void 0,
|
|
310
321
|
// Append Linter settings
|
|
311
322
|
props.linter ? linter(props.linter, props.linterConfig) : void 0,
|
|
312
323
|
// Show 🔴 to error line when linter enabled.
|
|
313
324
|
props.linter && props.gutter ? lintGutter(props.gutterConfig) : void 0,
|
|
314
325
|
// Placeholder
|
|
315
326
|
props.placeholder ? placeholder(props.placeholder) : void 0,
|
|
316
|
-
// Append Extensions
|
|
327
|
+
// Append Extensions
|
|
317
328
|
...props.extensions
|
|
318
329
|
])
|
|
319
330
|
)
|
|
@@ -338,9 +349,11 @@ var CodeMirror = defineComponent({
|
|
|
338
349
|
watch(
|
|
339
350
|
() => extensions.value,
|
|
340
351
|
(exts) => {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
352
|
+
exts.forEach(
|
|
353
|
+
(ext) => view.value.dispatch({
|
|
354
|
+
effects: StateEffect.reconfigure.of(ext)
|
|
355
|
+
})
|
|
356
|
+
);
|
|
344
357
|
}
|
|
345
358
|
);
|
|
346
359
|
watch(focus, (isFocus) => context.emit("focus", isFocus));
|
|
@@ -474,8 +487,8 @@ var CodeMirror = defineComponent({
|
|
|
474
487
|
});
|
|
475
488
|
|
|
476
489
|
const meta = {
|
|
477
|
-
version: "1.1.
|
|
478
|
-
date: "2023-03-
|
|
490
|
+
version: "1.1.13",
|
|
491
|
+
date: "2023-03-14T01:57:05.152Z"
|
|
479
492
|
};
|
|
480
493
|
|
|
481
494
|
const installCodeMirror = (app) => app.component("CodeMirror", CodeMirror);
|
package/dist/index.iife.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @author Logue <logue@hotmail.co.jp>
|
|
6
6
|
* @copyright 2022-2023 By Masashi Yoshikawa All rights reserved.
|
|
7
7
|
* @license MIT
|
|
8
|
-
* @version 1.1.
|
|
8
|
+
* @version 1.1.13
|
|
9
9
|
* @see {@link https://github.com/logue/vue-codemirror6}
|
|
10
10
|
*/
|
|
11
11
|
|
|
@@ -112,6 +112,15 @@ var CodeMirror = (function (exports, vueDemi, lodash, codemirror, state, view, c
|
|
|
112
112
|
type: Boolean,
|
|
113
113
|
default: false
|
|
114
114
|
},
|
|
115
|
+
/**
|
|
116
|
+
* Allow Multiple Selection.
|
|
117
|
+
*
|
|
118
|
+
* @see {@link https://codemirror.net/docs/ref/#state.EditorState^allowMultipleSelections}
|
|
119
|
+
*/
|
|
120
|
+
allowMultipleSelections: {
|
|
121
|
+
type: Boolean,
|
|
122
|
+
default: false
|
|
123
|
+
},
|
|
115
124
|
/**
|
|
116
125
|
* Tab size
|
|
117
126
|
*
|
|
@@ -290,6 +299,8 @@ var CodeMirror = (function (exports, vueDemi, lodash, codemirror, state, view, c
|
|
|
290
299
|
props.wrap ? view.EditorView.lineWrapping : void 0,
|
|
291
300
|
// Indent with tab
|
|
292
301
|
props.tab ? view.keymap.of([commands.indentWithTab]) : void 0,
|
|
302
|
+
// Allow Multiple Selections
|
|
303
|
+
state.EditorState.allowMultipleSelections.of(props.allowMultipleSelections),
|
|
293
304
|
// Indent tab size
|
|
294
305
|
props.tabSize ? state.EditorState.tabSize.of(props.tabSize) : void 0,
|
|
295
306
|
// locale settings
|
|
@@ -301,14 +312,14 @@ var CodeMirror = (function (exports, vueDemi, lodash, codemirror, state, view, c
|
|
|
301
312
|
// Set Line break char
|
|
302
313
|
props.lineSeparator ? state.EditorState.lineSeparator.of(props.lineSeparator) : void 0,
|
|
303
314
|
// Lang
|
|
304
|
-
props.lang ? props.lang : void 0,
|
|
315
|
+
props.lang ? props.lang.extension : void 0,
|
|
305
316
|
// Append Linter settings
|
|
306
317
|
props.linter ? lint.linter(props.linter, props.linterConfig) : void 0,
|
|
307
318
|
// Show 🔴 to error line when linter enabled.
|
|
308
319
|
props.linter && props.gutter ? lint.lintGutter(props.gutterConfig) : void 0,
|
|
309
320
|
// Placeholder
|
|
310
321
|
props.placeholder ? view.placeholder(props.placeholder) : void 0,
|
|
311
|
-
// Append Extensions
|
|
322
|
+
// Append Extensions
|
|
312
323
|
...props.extensions
|
|
313
324
|
])
|
|
314
325
|
)
|
|
@@ -333,9 +344,11 @@ var CodeMirror = (function (exports, vueDemi, lodash, codemirror, state, view, c
|
|
|
333
344
|
vueDemi.watch(
|
|
334
345
|
() => extensions.value,
|
|
335
346
|
(exts) => {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
347
|
+
exts.forEach(
|
|
348
|
+
(ext) => view$1.value.dispatch({
|
|
349
|
+
effects: state.StateEffect.reconfigure.of(ext)
|
|
350
|
+
})
|
|
351
|
+
);
|
|
339
352
|
}
|
|
340
353
|
);
|
|
341
354
|
vueDemi.watch(focus, (isFocus) => context.emit("focus", isFocus));
|
|
@@ -469,8 +482,8 @@ var CodeMirror = (function (exports, vueDemi, lodash, codemirror, state, view, c
|
|
|
469
482
|
});
|
|
470
483
|
|
|
471
484
|
const meta = {
|
|
472
|
-
version: "1.1.
|
|
473
|
-
date: "2023-03-
|
|
485
|
+
version: "1.1.13",
|
|
486
|
+
date: "2023-03-14T01:57:05.152Z"
|
|
474
487
|
};
|
|
475
488
|
|
|
476
489
|
const installCodeMirror = (app) => app.component("CodeMirror", CodeMirror);
|
package/dist/index.umd.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @author Logue <logue@hotmail.co.jp>
|
|
6
6
|
* @copyright 2022-2023 By Masashi Yoshikawa All rights reserved.
|
|
7
7
|
* @license MIT
|
|
8
|
-
* @version 1.1.
|
|
8
|
+
* @version 1.1.13
|
|
9
9
|
* @see {@link https://github.com/logue/vue-codemirror6}
|
|
10
10
|
*/
|
|
11
11
|
|
|
@@ -115,6 +115,15 @@
|
|
|
115
115
|
type: Boolean,
|
|
116
116
|
default: false
|
|
117
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
|
+
},
|
|
118
127
|
/**
|
|
119
128
|
* Tab size
|
|
120
129
|
*
|
|
@@ -293,6 +302,8 @@
|
|
|
293
302
|
props.wrap ? view.EditorView.lineWrapping : void 0,
|
|
294
303
|
// Indent with tab
|
|
295
304
|
props.tab ? view.keymap.of([commands.indentWithTab]) : void 0,
|
|
305
|
+
// Allow Multiple Selections
|
|
306
|
+
state.EditorState.allowMultipleSelections.of(props.allowMultipleSelections),
|
|
296
307
|
// Indent tab size
|
|
297
308
|
props.tabSize ? state.EditorState.tabSize.of(props.tabSize) : void 0,
|
|
298
309
|
// locale settings
|
|
@@ -304,14 +315,14 @@
|
|
|
304
315
|
// Set Line break char
|
|
305
316
|
props.lineSeparator ? state.EditorState.lineSeparator.of(props.lineSeparator) : void 0,
|
|
306
317
|
// Lang
|
|
307
|
-
props.lang ? props.lang : void 0,
|
|
318
|
+
props.lang ? props.lang.extension : void 0,
|
|
308
319
|
// Append Linter settings
|
|
309
320
|
props.linter ? lint.linter(props.linter, props.linterConfig) : void 0,
|
|
310
321
|
// Show 🔴 to error line when linter enabled.
|
|
311
322
|
props.linter && props.gutter ? lint.lintGutter(props.gutterConfig) : void 0,
|
|
312
323
|
// Placeholder
|
|
313
324
|
props.placeholder ? view.placeholder(props.placeholder) : void 0,
|
|
314
|
-
// Append Extensions
|
|
325
|
+
// Append Extensions
|
|
315
326
|
...props.extensions
|
|
316
327
|
])
|
|
317
328
|
)
|
|
@@ -336,9 +347,11 @@
|
|
|
336
347
|
vueDemi.watch(
|
|
337
348
|
() => extensions.value,
|
|
338
349
|
(exts) => {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
350
|
+
exts.forEach(
|
|
351
|
+
(ext) => view$1.value.dispatch({
|
|
352
|
+
effects: state.StateEffect.reconfigure.of(ext)
|
|
353
|
+
})
|
|
354
|
+
);
|
|
342
355
|
}
|
|
343
356
|
);
|
|
344
357
|
vueDemi.watch(focus, (isFocus) => context.emit("focus", isFocus));
|
|
@@ -472,8 +485,8 @@
|
|
|
472
485
|
});
|
|
473
486
|
|
|
474
487
|
const meta = {
|
|
475
|
-
version: "1.1.
|
|
476
|
-
date: "2023-03-
|
|
488
|
+
version: "1.1.13",
|
|
489
|
+
date: "2023-03-14T01:57:05.152Z"
|
|
477
490
|
};
|
|
478
491
|
|
|
479
492
|
const installCodeMirror = (app) => app.component("CodeMirror", CodeMirror);
|
|
@@ -19,8 +19,6 @@ export interface CodeMirrorEmitsOptions extends ObjectEmitsOptions {
|
|
|
19
19
|
(e: 'destroy'): void;
|
|
20
20
|
/** State Changed */
|
|
21
21
|
(e: 'change', value: EditorState): void;
|
|
22
|
-
/** Diagnostic Count */
|
|
23
|
-
(e: 'diagnosticCount'): number;
|
|
24
22
|
}
|
|
25
23
|
/** CodeMirror Component */
|
|
26
24
|
declare const _default: import("vue-demi").DefineComponent<unknown, object, {}, import("vue-demi").ComputedOptions, import("vue-demi").MethodOptions, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, {}, string, import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<unknown>, {}>;
|
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.
|
|
4
|
+
"version": "1.1.14",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "CodeMirror6 Component for vue2 and vue3.",
|
|
7
7
|
"keywords": [
|
|
@@ -78,13 +78,7 @@
|
|
|
78
78
|
"vue-demi": "latest"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
|
-
"
|
|
82
|
-
"vue": "^2.6.14 || ^3.2.47"
|
|
83
|
-
},
|
|
84
|
-
"peerDependenciesMeta": {
|
|
85
|
-
"@vue/composition-api": {
|
|
86
|
-
"optional": true
|
|
87
|
-
}
|
|
81
|
+
"vue": "^2.7.14 || ^3.2.47"
|
|
88
82
|
},
|
|
89
83
|
"devDependencies": {
|
|
90
84
|
"@codemirror/lang-javascript": "^6.1.4",
|
|
@@ -92,19 +86,19 @@
|
|
|
92
86
|
"@codemirror/lang-markdown": "^6.1.0",
|
|
93
87
|
"@codemirror/lang-vue": "^0.1.1",
|
|
94
88
|
"@types/lodash": "^4.14.191",
|
|
95
|
-
"@types/node": "^18.15.
|
|
96
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
97
|
-
"@typescript-eslint/parser": "^5.
|
|
89
|
+
"@types/node": "^18.15.2",
|
|
90
|
+
"@typescript-eslint/eslint-plugin": "^5.55.0",
|
|
91
|
+
"@typescript-eslint/parser": "^5.55.0",
|
|
98
92
|
"@vitejs/plugin-vue": "^4.0.0",
|
|
99
93
|
"@vue/eslint-config-prettier": "^7.1.0",
|
|
100
94
|
"@vue/tsconfig": "^0.1.3",
|
|
101
95
|
"@vueuse/core": "^9.13.0",
|
|
102
|
-
"eslint": "^8.
|
|
96
|
+
"eslint": "^8.36.0",
|
|
103
97
|
"eslint-config-google": "^0.14.0",
|
|
104
98
|
"eslint-config-prettier": "^8.7.0",
|
|
105
99
|
"eslint-import-resolver-alias": "^1.1.2",
|
|
106
100
|
"eslint-import-resolver-typescript": "^3.5.3",
|
|
107
|
-
"eslint-linter-browserify": "^8.
|
|
101
|
+
"eslint-linter-browserify": "^8.36.0",
|
|
108
102
|
"eslint-plugin-html": "^7.1.0",
|
|
109
103
|
"eslint-plugin-import": "^2.27.5",
|
|
110
104
|
"eslint-plugin-jsdoc": "^40.0.1",
|
|
@@ -114,12 +108,12 @@
|
|
|
114
108
|
"eslint-plugin-vuejs-accessibility": "^2.1.0",
|
|
115
109
|
"eslint-plugin-yaml": "^0.5.0",
|
|
116
110
|
"husky": "^8.0.3",
|
|
117
|
-
"lint-staged": "^13.
|
|
111
|
+
"lint-staged": "^13.2.0",
|
|
118
112
|
"npm-run-all": "^4.1.5",
|
|
119
113
|
"prettier": "^2.8.4",
|
|
120
114
|
"rimraf": "^4.4.0",
|
|
121
115
|
"rollup-plugin-visualizer": "^5.9.0",
|
|
122
|
-
"sass": "^1.
|
|
116
|
+
"sass": "^1.59.2",
|
|
123
117
|
"typescript": "^4.9.5",
|
|
124
118
|
"vite": "^4.1.4",
|
|
125
119
|
"vite-plugin-banner": "^0.7.0",
|
|
@@ -67,8 +67,6 @@ export interface CodeMirrorEmitsOptions extends ObjectEmitsOptions {
|
|
|
67
67
|
(e: 'destroy'): void;
|
|
68
68
|
/** State Changed */
|
|
69
69
|
(e: 'change', value: EditorState): void;
|
|
70
|
-
/** Diagnostic Count */
|
|
71
|
-
(e: 'diagnosticCount'): number;
|
|
72
70
|
}
|
|
73
71
|
|
|
74
72
|
/** CodeMirror Component */
|
|
@@ -148,6 +146,15 @@ export default defineComponent({
|
|
|
148
146
|
type: Boolean,
|
|
149
147
|
default: false,
|
|
150
148
|
},
|
|
149
|
+
/**
|
|
150
|
+
* Allow Multiple Selection.
|
|
151
|
+
*
|
|
152
|
+
* @see {@link https://codemirror.net/docs/ref/#state.EditorState^allowMultipleSelections}
|
|
153
|
+
*/
|
|
154
|
+
allowMultipleSelections: {
|
|
155
|
+
type: Boolean,
|
|
156
|
+
default: false,
|
|
157
|
+
},
|
|
151
158
|
/**
|
|
152
159
|
* Tab size
|
|
153
160
|
*
|
|
@@ -358,6 +365,8 @@ export default defineComponent({
|
|
|
358
365
|
props.wrap ? EditorView.lineWrapping : undefined,
|
|
359
366
|
// Indent with tab
|
|
360
367
|
props.tab ? keymap.of([indentWithTab]) : undefined,
|
|
368
|
+
// Allow Multiple Selections
|
|
369
|
+
EditorState.allowMultipleSelections.of(props.allowMultipleSelections),
|
|
361
370
|
// Indent tab size
|
|
362
371
|
props.tabSize ? EditorState.tabSize.of(props.tabSize) : undefined,
|
|
363
372
|
// locale settings
|
|
@@ -371,7 +380,7 @@ export default defineComponent({
|
|
|
371
380
|
? EditorState.lineSeparator.of(props.lineSeparator)
|
|
372
381
|
: undefined,
|
|
373
382
|
// Lang
|
|
374
|
-
props.lang ? props.lang : undefined,
|
|
383
|
+
props.lang ? props.lang.extension : undefined,
|
|
375
384
|
// Append Linter settings
|
|
376
385
|
props.linter ? linter(props.linter, props.linterConfig) : undefined,
|
|
377
386
|
// Show 🔴 to error line when linter enabled.
|
|
@@ -380,7 +389,7 @@ export default defineComponent({
|
|
|
380
389
|
: undefined,
|
|
381
390
|
// Placeholder
|
|
382
391
|
props.placeholder ? placeholder(props.placeholder) : undefined,
|
|
383
|
-
// Append Extensions
|
|
392
|
+
// Append Extensions
|
|
384
393
|
...props.extensions,
|
|
385
394
|
])
|
|
386
395
|
);
|
|
@@ -413,9 +422,11 @@ export default defineComponent({
|
|
|
413
422
|
watch(
|
|
414
423
|
() => extensions.value,
|
|
415
424
|
exts => {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
425
|
+
exts.forEach(ext =>
|
|
426
|
+
view.value.dispatch({
|
|
427
|
+
effects: StateEffect.reconfigure.of(ext),
|
|
428
|
+
})
|
|
429
|
+
);
|
|
419
430
|
}
|
|
420
431
|
);
|
|
421
432
|
|