vue-codemirror6 1.1.23 → 1.1.26
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 +6 -4
- package/dist/components/CodeMirror.d.ts +3 -0
- package/dist/index.es.js +6 -7
- package/dist/index.iife.js +6 -7
- package/dist/index.umd.js +6 -7
- package/package.json +25 -26
- package/src/components/CodeMirror.ts +13 -3
- package/dist/src/components/CodeMirror.d.ts +0 -483
- package/dist/src/helpers/h-demi.d.ts +0 -20
- package/dist/src/interfaces/MetaInterface.d.ts +0 -7
- package/dist/src-docs/main.d.ts +0 -0
- /package/dist/{src/Meta.d.ts → Meta.d.ts} +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,11 +4,13 @@ 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.24](https://github.com/logue/vue-codemirror6/compare/1.1.16...1.1.24)
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
- Fixed
|
|
9
|
+
- Reduce unnecessary updates [`#22`](https://github.com/logue/vue-codemirror6/pull/22)
|
|
10
|
+
- fix: coalescing-operator [`#20`](https://github.com/logue/vue-codemirror6/pull/20)
|
|
11
|
+
- Fixed merged code formatting. [`823bef0`](https://github.com/logue/vue-codemirror6/commit/823bef056c9137e0d959bb45d77378226a3df083)
|
|
12
|
+
- Update dependencies. [`f896b82`](https://github.com/logue/vue-codemirror6/commit/f896b82667a705b059540fef03c3db240d7be485)
|
|
13
|
+
- Update dependencies. [`e124cad`](https://github.com/logue/vue-codemirror6/commit/e124cad05d665c1149948e546fde17e0d28a3676)
|
|
12
14
|
|
|
13
15
|
#### [1.1.16](https://github.com/logue/vue-codemirror6/compare/1.1.13...1.1.16)
|
|
14
16
|
|
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.25
|
|
9
9
|
* @see {@link https://github.com/logue/vue-codemirror6}
|
|
10
10
|
*/
|
|
11
11
|
|
|
@@ -366,7 +366,9 @@ var CodeMirror = defineComponent({
|
|
|
366
366
|
watch(
|
|
367
367
|
() => props.modelValue,
|
|
368
368
|
async (value) => {
|
|
369
|
-
if (view.value.composing
|
|
369
|
+
if (view.value.composing || // IME fix
|
|
370
|
+
view.value.state.doc.toJSON().join(props.lineSeparator ?? "\n") === value) {
|
|
371
|
+
length.value = view.value.state.doc.length;
|
|
370
372
|
return;
|
|
371
373
|
}
|
|
372
374
|
view.value.dispatch({
|
|
@@ -523,14 +525,11 @@ var CodeMirror = defineComponent({
|
|
|
523
525
|
});
|
|
524
526
|
|
|
525
527
|
const meta = {
|
|
526
|
-
version: "1.1.
|
|
527
|
-
date: "2023-
|
|
528
|
+
version: "1.1.25",
|
|
529
|
+
date: "2023-08-16T11:00:18.396Z"
|
|
528
530
|
};
|
|
529
531
|
var meta$1 = meta;
|
|
530
532
|
|
|
531
533
|
const installCodeMirror = (app) => app.component("CodeMirror", CodeMirror);
|
|
532
|
-
if (typeof window !== "undefined" && window.Vue) {
|
|
533
|
-
window.Vue.use(CodeMirror);
|
|
534
|
-
}
|
|
535
534
|
|
|
536
535
|
export { meta$1 as Meta, CodeMirror as default, installCodeMirror as install };
|
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.25
|
|
9
9
|
* @see {@link https://github.com/logue/vue-codemirror6}
|
|
10
10
|
*/
|
|
11
11
|
|
|
@@ -362,7 +362,9 @@ var CodeMirror = (function (exports, vueDemi, codemirror, view, state, lint, com
|
|
|
362
362
|
vueDemi.watch(
|
|
363
363
|
() => props.modelValue,
|
|
364
364
|
async (value) => {
|
|
365
|
-
if (view$1.value.composing
|
|
365
|
+
if (view$1.value.composing || // IME fix
|
|
366
|
+
view$1.value.state.doc.toJSON().join(props.lineSeparator ?? "\n") === value) {
|
|
367
|
+
length.value = view$1.value.state.doc.length;
|
|
366
368
|
return;
|
|
367
369
|
}
|
|
368
370
|
view$1.value.dispatch({
|
|
@@ -519,15 +521,12 @@ var CodeMirror = (function (exports, vueDemi, codemirror, view, state, lint, com
|
|
|
519
521
|
});
|
|
520
522
|
|
|
521
523
|
const meta = {
|
|
522
|
-
version: "1.1.
|
|
523
|
-
date: "2023-
|
|
524
|
+
version: "1.1.25",
|
|
525
|
+
date: "2023-08-16T11:00:18.396Z"
|
|
524
526
|
};
|
|
525
527
|
var meta$1 = meta;
|
|
526
528
|
|
|
527
529
|
const installCodeMirror = (app) => app.component("CodeMirror", CodeMirror);
|
|
528
|
-
if (typeof window !== "undefined" && window.Vue) {
|
|
529
|
-
window.Vue.use(CodeMirror);
|
|
530
|
-
}
|
|
531
530
|
|
|
532
531
|
exports.Meta = meta$1;
|
|
533
532
|
exports["default"] = 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.25
|
|
9
9
|
* @see {@link https://github.com/logue/vue-codemirror6}
|
|
10
10
|
*/
|
|
11
11
|
|
|
@@ -365,7 +365,9 @@
|
|
|
365
365
|
vueDemi.watch(
|
|
366
366
|
() => props.modelValue,
|
|
367
367
|
async (value) => {
|
|
368
|
-
if (view$1.value.composing
|
|
368
|
+
if (view$1.value.composing || // IME fix
|
|
369
|
+
view$1.value.state.doc.toJSON().join(props.lineSeparator ?? "\n") === value) {
|
|
370
|
+
length.value = view$1.value.state.doc.length;
|
|
369
371
|
return;
|
|
370
372
|
}
|
|
371
373
|
view$1.value.dispatch({
|
|
@@ -522,15 +524,12 @@
|
|
|
522
524
|
});
|
|
523
525
|
|
|
524
526
|
const meta = {
|
|
525
|
-
version: "1.1.
|
|
526
|
-
date: "2023-
|
|
527
|
+
version: "1.1.25",
|
|
528
|
+
date: "2023-08-16T11:00:18.396Z"
|
|
527
529
|
};
|
|
528
530
|
var meta$1 = meta;
|
|
529
531
|
|
|
530
532
|
const installCodeMirror = (app) => app.component("CodeMirror", CodeMirror);
|
|
531
|
-
if (typeof window !== "undefined" && window.Vue) {
|
|
532
|
-
window.Vue.use(CodeMirror);
|
|
533
|
-
}
|
|
534
533
|
|
|
535
534
|
exports.Meta = meta$1;
|
|
536
535
|
exports["default"] = CodeMirror;
|
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.26",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "CodeMirror6 Component for vue2 and vue3.",
|
|
7
7
|
"keywords": [
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
},
|
|
37
37
|
"main": "dist/index.umd.js",
|
|
38
38
|
"module": "dist/index.es.js",
|
|
39
|
-
"types": "dist/
|
|
39
|
+
"types": "dist/index.d.ts",
|
|
40
40
|
"exports": {
|
|
41
41
|
".": {
|
|
42
42
|
"import": "./dist/index.es.js",
|
|
43
43
|
"require": "./dist/index.umd.js",
|
|
44
|
-
"types": "./dist/
|
|
44
|
+
"types": "./dist/index.d.ts"
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"files": [
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"engines": {
|
|
56
56
|
"yarn": ">=1.22.19"
|
|
57
57
|
},
|
|
58
|
-
"packageManager": "yarn@3.6.
|
|
58
|
+
"packageManager": "yarn@3.6.3",
|
|
59
59
|
"sideEffects": false,
|
|
60
60
|
"scripts": {
|
|
61
61
|
"dev": "vite",
|
|
@@ -79,48 +79,47 @@
|
|
|
79
79
|
"vue": "^2.7.14 || ^3.2"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@codemirror/lang-javascript": "^6.1
|
|
82
|
+
"@codemirror/lang-javascript": "^6.2.1",
|
|
83
83
|
"@codemirror/lang-json": "^6.0.1",
|
|
84
84
|
"@codemirror/lang-markdown": "^6.2.0",
|
|
85
85
|
"@codemirror/lang-vue": "^0.1.2",
|
|
86
|
-
"@tsconfig/node-lts": "^18.12.
|
|
87
|
-
"@types/node": "^20.
|
|
88
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
89
|
-
"@
|
|
90
|
-
"@vitejs/plugin-vue": "^4.2.3",
|
|
86
|
+
"@tsconfig/node-lts": "^18.12.5",
|
|
87
|
+
"@types/node": "^20.5.7",
|
|
88
|
+
"@typescript-eslint/eslint-plugin": "^6.5.0",
|
|
89
|
+
"@vitejs/plugin-vue": "^4.3.4",
|
|
91
90
|
"@vue/compiler-sfc": "^3.3.4",
|
|
92
91
|
"@vue/eslint-config-prettier": "^8.0.0",
|
|
93
92
|
"@vue/tsconfig": "^0.4.0",
|
|
94
|
-
"@vueuse/core": "^10.
|
|
93
|
+
"@vueuse/core": "^10.4.1",
|
|
95
94
|
"bootstrap": "^5.3.1",
|
|
96
|
-
"eslint": "^8.
|
|
97
|
-
"eslint-config-standard-with-typescript": "
|
|
95
|
+
"eslint": "^8.48.0",
|
|
96
|
+
"eslint-config-standard-with-typescript": "^39.0.0",
|
|
98
97
|
"eslint-import-resolver-alias": "^1.1.2",
|
|
99
|
-
"eslint-import-resolver-typescript": "^3.
|
|
100
|
-
"eslint-linter-browserify": "^8.
|
|
98
|
+
"eslint-import-resolver-typescript": "^3.6.0",
|
|
99
|
+
"eslint-linter-browserify": "^8.48.0",
|
|
101
100
|
"eslint-plugin-html": "^7.1.0",
|
|
102
|
-
"eslint-plugin-import": "^2.
|
|
103
|
-
"eslint-plugin-n": "^16.0.
|
|
101
|
+
"eslint-plugin-import": "^2.28.1",
|
|
102
|
+
"eslint-plugin-n": "^16.0.2",
|
|
104
103
|
"eslint-plugin-promise": "^6.1.1",
|
|
105
104
|
"eslint-plugin-tsdoc": "^0.2.17",
|
|
106
105
|
"eslint-plugin-vue": "latest",
|
|
107
|
-
"eslint-plugin-vuejs-accessibility": "^2.
|
|
106
|
+
"eslint-plugin-vuejs-accessibility": "^2.2.0",
|
|
108
107
|
"eslint-plugin-yaml": "^0.5.0",
|
|
109
108
|
"husky": "^8.0.3",
|
|
110
|
-
"lint-staged": "^
|
|
109
|
+
"lint-staged": "^14.0.1",
|
|
111
110
|
"npm-run-all": "^4.1.5",
|
|
112
|
-
"prettier": "^3.0.
|
|
111
|
+
"prettier": "^3.0.3",
|
|
113
112
|
"rimraf": "^5.0.1",
|
|
114
113
|
"rollup-plugin-visualizer": "^5.9.2",
|
|
115
|
-
"sass": "^1.
|
|
116
|
-
"typescript": "^5.
|
|
117
|
-
"vite": "^4.4.
|
|
114
|
+
"sass": "^1.66.1",
|
|
115
|
+
"typescript": "^5.2.2",
|
|
116
|
+
"vite": "^4.4.9",
|
|
118
117
|
"vite-plugin-banner": "^0.7.0",
|
|
119
|
-
"vite-plugin-checker": "^0.6.
|
|
120
|
-
"vite-plugin-dts": "^3.3
|
|
118
|
+
"vite-plugin-checker": "^0.6.2",
|
|
119
|
+
"vite-plugin-dts": "^3.5.3",
|
|
121
120
|
"vue": "^3.3.4",
|
|
122
121
|
"vue-eslint-parser": "^9.3.1",
|
|
123
|
-
"vue-markdown-wasm": "^0.3.
|
|
122
|
+
"vue-markdown-wasm": "^0.3.12",
|
|
124
123
|
"vue-tsc": "^1.8.8"
|
|
125
124
|
},
|
|
126
125
|
"husky": {
|
|
@@ -274,6 +274,8 @@ export default defineComponent({
|
|
|
274
274
|
}) => true,
|
|
275
275
|
/** CodeMirror onFocus */
|
|
276
276
|
focus: (value: boolean) => true,
|
|
277
|
+
/** blur */
|
|
278
|
+
// blur: (value: boolean) => true,
|
|
277
279
|
/** State Changed */
|
|
278
280
|
change: (value: EditorState) => true,
|
|
279
281
|
/** CodeMirror onDestroy */
|
|
@@ -378,8 +380,8 @@ export default defineComponent({
|
|
|
378
380
|
props.linter(view.value) as readonly Diagnostic[]
|
|
379
381
|
).length;
|
|
380
382
|
}
|
|
381
|
-
|
|
382
383
|
context.emit('update', update);
|
|
384
|
+
context.emit('focus', view.value.hasFocus);
|
|
383
385
|
}),
|
|
384
386
|
// Toggle light/dark mode.
|
|
385
387
|
EditorView.theme(props.theme, { dark: props.dark }),
|
|
@@ -433,8 +435,14 @@ export default defineComponent({
|
|
|
433
435
|
watch(
|
|
434
436
|
() => props.modelValue,
|
|
435
437
|
async value => {
|
|
436
|
-
if (
|
|
437
|
-
// IME fix
|
|
438
|
+
if (
|
|
439
|
+
view.value.composing || // IME fix
|
|
440
|
+
view.value.state.doc.toJSON().join(props.lineSeparator ?? '\n') ===
|
|
441
|
+
value // don't need to update
|
|
442
|
+
) {
|
|
443
|
+
// Update count
|
|
444
|
+
length.value = view.value.state.doc.length;
|
|
445
|
+
// Do not commit CodeMirror's store.
|
|
438
446
|
return;
|
|
439
447
|
}
|
|
440
448
|
|
|
@@ -477,6 +485,8 @@ export default defineComponent({
|
|
|
477
485
|
dispatch: (tr: Transaction) => {
|
|
478
486
|
view.value.update([tr]);
|
|
479
487
|
|
|
488
|
+
context.emit('focus', view.value.hasFocus);
|
|
489
|
+
|
|
480
490
|
if (tr.changes.empty || !tr.docChanged) {
|
|
481
491
|
// if not change value, no fire emit event
|
|
482
492
|
return;
|
|
@@ -1,483 +0,0 @@
|
|
|
1
|
-
import { type PropType, type Ref, type ShallowRef, type WritableComputedRef } from 'vue-demi';
|
|
2
|
-
import { EditorView, type ViewUpdate } from '@codemirror/view';
|
|
3
|
-
import { EditorSelection, EditorState, type Extension, type SelectionRange, type StateField, type Text } from '@codemirror/state';
|
|
4
|
-
import { type LintSource } from '@codemirror/lint';
|
|
5
|
-
import type { LanguageSupport } from '@codemirror/language';
|
|
6
|
-
import type { StyleSpec } from 'style-mod';
|
|
7
|
-
/** CodeMirror Component */
|
|
8
|
-
declare const _default: import("vue-demi").DefineComponent<{
|
|
9
|
-
/** Model value */
|
|
10
|
-
modelValue: {
|
|
11
|
-
type: PropType<string | Text>;
|
|
12
|
-
default: string;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Theme
|
|
16
|
-
*
|
|
17
|
-
* @see {@link https://codemirror.net/docs/ref/#view.EditorView^theme}
|
|
18
|
-
*/
|
|
19
|
-
theme: {
|
|
20
|
-
type: PropType<Record<string, StyleSpec>>;
|
|
21
|
-
default: () => void;
|
|
22
|
-
};
|
|
23
|
-
/** Dark Mode */
|
|
24
|
-
dark: {
|
|
25
|
-
type: BooleanConstructor;
|
|
26
|
-
default: boolean;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Use Basic Setup
|
|
30
|
-
*
|
|
31
|
-
* @see {@link https://codemirror.net/docs/ref/#codemirror.basicSetup}
|
|
32
|
-
*/
|
|
33
|
-
basic: {
|
|
34
|
-
type: BooleanConstructor;
|
|
35
|
-
default: boolean;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Use Minimal Setup (The basic setting has priority.)
|
|
39
|
-
*
|
|
40
|
-
* @see {@link https://codemirror.net/docs/ref/#codemirror.minimalSetup}
|
|
41
|
-
*/
|
|
42
|
-
minimal: {
|
|
43
|
-
type: BooleanConstructor;
|
|
44
|
-
default: boolean;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Placeholder
|
|
48
|
-
*
|
|
49
|
-
* @see {@link https://codemirror.net/docs/ref/#view.placeholder}
|
|
50
|
-
*/
|
|
51
|
-
placeholder: {
|
|
52
|
-
type: PropType<string | HTMLElement>;
|
|
53
|
-
default: undefined;
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* Line wrapping
|
|
57
|
-
*
|
|
58
|
-
* An extension that enables line wrapping in the editor (by setting CSS white-space to pre-wrap in the content).
|
|
59
|
-
*
|
|
60
|
-
* @see {@link https://codemirror.net/docs/ref/#view.EditorView%5ElineWrapping}
|
|
61
|
-
*/
|
|
62
|
-
wrap: {
|
|
63
|
-
type: BooleanConstructor;
|
|
64
|
-
default: boolean;
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Allow tab key indent.
|
|
68
|
-
*
|
|
69
|
-
* @see {@link https://codemirror.net/examples/tab/}
|
|
70
|
-
*/
|
|
71
|
-
tab: {
|
|
72
|
-
type: BooleanConstructor;
|
|
73
|
-
default: boolean;
|
|
74
|
-
};
|
|
75
|
-
/**
|
|
76
|
-
* Allow Multiple Selection.
|
|
77
|
-
*
|
|
78
|
-
* @see {@link https://codemirror.net/docs/ref/#state.EditorState^allowMultipleSelections}
|
|
79
|
-
*/
|
|
80
|
-
allowMultipleSelections: {
|
|
81
|
-
type: BooleanConstructor;
|
|
82
|
-
default: boolean;
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* Tab size
|
|
86
|
-
*
|
|
87
|
-
* @see {@link https://codemirror.net/docs/ref/#state.EditorState^tabSize}
|
|
88
|
-
*/
|
|
89
|
-
tabSize: {
|
|
90
|
-
type: NumberConstructor;
|
|
91
|
-
default: undefined;
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* Set line break (separetor) char.
|
|
95
|
-
*
|
|
96
|
-
* @see {@link https://codemirror.net/docs/ref/#state.EditorState^lineSeparator}
|
|
97
|
-
*/
|
|
98
|
-
lineSeparator: {
|
|
99
|
-
type: StringConstructor;
|
|
100
|
-
default: undefined;
|
|
101
|
-
};
|
|
102
|
-
/**
|
|
103
|
-
* Readonly
|
|
104
|
-
*
|
|
105
|
-
* @see {@link https://codemirror.net/docs/ref/#state.EditorState^readOnly}
|
|
106
|
-
*/
|
|
107
|
-
readonly: {
|
|
108
|
-
type: BooleanConstructor;
|
|
109
|
-
default: boolean;
|
|
110
|
-
};
|
|
111
|
-
/**
|
|
112
|
-
* Disable input.
|
|
113
|
-
*
|
|
114
|
-
* This is the reversed value of the CodeMirror editable.
|
|
115
|
-
* Similar to `readonly`, but setting this value to true disables dragging.
|
|
116
|
-
*
|
|
117
|
-
* @see {@link https://codemirror.net/docs/ref/#view.EditorView^editable}
|
|
118
|
-
*/
|
|
119
|
-
disabled: {
|
|
120
|
-
type: BooleanConstructor;
|
|
121
|
-
default: boolean;
|
|
122
|
-
};
|
|
123
|
-
/**
|
|
124
|
-
* Additional Extension
|
|
125
|
-
*
|
|
126
|
-
* @see {@link https://codemirror.net/docs/ref/#state.Extension}
|
|
127
|
-
*/
|
|
128
|
-
extensions: {
|
|
129
|
-
type: PropType<Extension[]>;
|
|
130
|
-
default: () => never[];
|
|
131
|
-
};
|
|
132
|
-
/**
|
|
133
|
-
* Language Phreses
|
|
134
|
-
*
|
|
135
|
-
* @see {@link https://codemirror.net/examples/translate/}
|
|
136
|
-
*/
|
|
137
|
-
phrases: {
|
|
138
|
-
type: PropType<Record<string, string>>;
|
|
139
|
-
default: () => undefined;
|
|
140
|
-
};
|
|
141
|
-
/**
|
|
142
|
-
* CodeMirror Language
|
|
143
|
-
*
|
|
144
|
-
* @see {@link https://codemirror.net/docs/ref/#language}
|
|
145
|
-
*/
|
|
146
|
-
lang: {
|
|
147
|
-
type: PropType<LanguageSupport>;
|
|
148
|
-
default: () => undefined;
|
|
149
|
-
};
|
|
150
|
-
/**
|
|
151
|
-
* CodeMirror Linter
|
|
152
|
-
*
|
|
153
|
-
* @see {@link https://codemirror.net/docs/ref/#lint.linter}
|
|
154
|
-
*/
|
|
155
|
-
linter: {
|
|
156
|
-
type: PropType<LintSource>;
|
|
157
|
-
default: undefined;
|
|
158
|
-
};
|
|
159
|
-
/**
|
|
160
|
-
* Linter Config
|
|
161
|
-
*
|
|
162
|
-
* @see {@link https://codemirror.net/docs/ref/#lint.linter^config}
|
|
163
|
-
*/
|
|
164
|
-
linterConfig: {
|
|
165
|
-
type: ObjectConstructor;
|
|
166
|
-
default: () => {
|
|
167
|
-
needsRefresh: boolean;
|
|
168
|
-
};
|
|
169
|
-
};
|
|
170
|
-
/**
|
|
171
|
-
* Forces any linters configured to run when the editor is idle to run right away.
|
|
172
|
-
*
|
|
173
|
-
* @see {@link https://codemirror.net/docs/ref/#lint.forceLinting}
|
|
174
|
-
*/
|
|
175
|
-
forceLinting: {
|
|
176
|
-
type: BooleanConstructor;
|
|
177
|
-
default: boolean;
|
|
178
|
-
};
|
|
179
|
-
/**
|
|
180
|
-
* Show Linter Gutter
|
|
181
|
-
*
|
|
182
|
-
* An area to 🔴 the lines with errors will be displayed.
|
|
183
|
-
* This feature is not enabled if `linter` is not specified.
|
|
184
|
-
*
|
|
185
|
-
* @see {@link https://codemirror.net/docs/ref/#lint.lintGutter}
|
|
186
|
-
*/
|
|
187
|
-
gutter: {
|
|
188
|
-
type: BooleanConstructor;
|
|
189
|
-
defalt: boolean;
|
|
190
|
-
};
|
|
191
|
-
/**
|
|
192
|
-
* Gutter Config
|
|
193
|
-
*
|
|
194
|
-
* @see {@link https://codemirror.net/docs/ref/#lint.lintGutter^config}
|
|
195
|
-
*/
|
|
196
|
-
gutterConfig: {
|
|
197
|
-
type: ObjectConstructor;
|
|
198
|
-
default: () => undefined;
|
|
199
|
-
};
|
|
200
|
-
/**
|
|
201
|
-
* Using tag
|
|
202
|
-
*/
|
|
203
|
-
tag: {
|
|
204
|
-
type: StringConstructor;
|
|
205
|
-
default: string;
|
|
206
|
-
};
|
|
207
|
-
}, {
|
|
208
|
-
editor: Ref<HTMLElement | undefined>;
|
|
209
|
-
view: ShallowRef<EditorView>;
|
|
210
|
-
cursor: WritableComputedRef<number>;
|
|
211
|
-
selection: WritableComputedRef<EditorSelection>;
|
|
212
|
-
focus: WritableComputedRef<boolean>;
|
|
213
|
-
length: Ref<number>;
|
|
214
|
-
json: WritableComputedRef<Record<string, StateField<any>>>;
|
|
215
|
-
diagnosticCount: Ref<number>;
|
|
216
|
-
lint: () => void;
|
|
217
|
-
forceReconfigure: () => void;
|
|
218
|
-
getRange: (from?: number, to?: number) => string | undefined;
|
|
219
|
-
getLine: (number: number) => string;
|
|
220
|
-
lineCount: () => number;
|
|
221
|
-
getCursor: () => number;
|
|
222
|
-
listSelections: () => readonly SelectionRange[];
|
|
223
|
-
getSelection: () => string;
|
|
224
|
-
getSelections: () => string[];
|
|
225
|
-
somethingSelected: () => boolean;
|
|
226
|
-
replaceRange: (replacement: string | Text, from: number, to: number) => void;
|
|
227
|
-
replaceSelection: (replacement: string | Text) => void;
|
|
228
|
-
setCursor: (position: number) => void;
|
|
229
|
-
setSelection: (anchor: number, head?: number) => void;
|
|
230
|
-
setSelections: (ranges: readonly SelectionRange[], primary?: number) => void;
|
|
231
|
-
extendSelectionsBy: (f: any) => void;
|
|
232
|
-
}, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, {
|
|
233
|
-
/** Model Update */
|
|
234
|
-
'update:modelValue': (value: string | Text) => boolean;
|
|
235
|
-
/** CodeMirror ViewUpdate */
|
|
236
|
-
update: (value: ViewUpdate) => boolean;
|
|
237
|
-
/** CodeMirror onReady */
|
|
238
|
-
ready: (value: {
|
|
239
|
-
view: EditorView;
|
|
240
|
-
state: EditorState;
|
|
241
|
-
container: HTMLElement;
|
|
242
|
-
}) => boolean;
|
|
243
|
-
/** CodeMirror onFocus */
|
|
244
|
-
focus: (value: boolean) => boolean;
|
|
245
|
-
/** State Changed */
|
|
246
|
-
change: (value: EditorState) => boolean;
|
|
247
|
-
/** CodeMirror onDestroy */
|
|
248
|
-
destroy: () => boolean;
|
|
249
|
-
}, string, import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
250
|
-
/** Model value */
|
|
251
|
-
modelValue: {
|
|
252
|
-
type: PropType<string | Text>;
|
|
253
|
-
default: string;
|
|
254
|
-
};
|
|
255
|
-
/**
|
|
256
|
-
* Theme
|
|
257
|
-
*
|
|
258
|
-
* @see {@link https://codemirror.net/docs/ref/#view.EditorView^theme}
|
|
259
|
-
*/
|
|
260
|
-
theme: {
|
|
261
|
-
type: PropType<Record<string, StyleSpec>>;
|
|
262
|
-
default: () => void;
|
|
263
|
-
};
|
|
264
|
-
/** Dark Mode */
|
|
265
|
-
dark: {
|
|
266
|
-
type: BooleanConstructor;
|
|
267
|
-
default: boolean;
|
|
268
|
-
};
|
|
269
|
-
/**
|
|
270
|
-
* Use Basic Setup
|
|
271
|
-
*
|
|
272
|
-
* @see {@link https://codemirror.net/docs/ref/#codemirror.basicSetup}
|
|
273
|
-
*/
|
|
274
|
-
basic: {
|
|
275
|
-
type: BooleanConstructor;
|
|
276
|
-
default: boolean;
|
|
277
|
-
};
|
|
278
|
-
/**
|
|
279
|
-
* Use Minimal Setup (The basic setting has priority.)
|
|
280
|
-
*
|
|
281
|
-
* @see {@link https://codemirror.net/docs/ref/#codemirror.minimalSetup}
|
|
282
|
-
*/
|
|
283
|
-
minimal: {
|
|
284
|
-
type: BooleanConstructor;
|
|
285
|
-
default: boolean;
|
|
286
|
-
};
|
|
287
|
-
/**
|
|
288
|
-
* Placeholder
|
|
289
|
-
*
|
|
290
|
-
* @see {@link https://codemirror.net/docs/ref/#view.placeholder}
|
|
291
|
-
*/
|
|
292
|
-
placeholder: {
|
|
293
|
-
type: PropType<string | HTMLElement>;
|
|
294
|
-
default: undefined;
|
|
295
|
-
};
|
|
296
|
-
/**
|
|
297
|
-
* Line wrapping
|
|
298
|
-
*
|
|
299
|
-
* An extension that enables line wrapping in the editor (by setting CSS white-space to pre-wrap in the content).
|
|
300
|
-
*
|
|
301
|
-
* @see {@link https://codemirror.net/docs/ref/#view.EditorView%5ElineWrapping}
|
|
302
|
-
*/
|
|
303
|
-
wrap: {
|
|
304
|
-
type: BooleanConstructor;
|
|
305
|
-
default: boolean;
|
|
306
|
-
};
|
|
307
|
-
/**
|
|
308
|
-
* Allow tab key indent.
|
|
309
|
-
*
|
|
310
|
-
* @see {@link https://codemirror.net/examples/tab/}
|
|
311
|
-
*/
|
|
312
|
-
tab: {
|
|
313
|
-
type: BooleanConstructor;
|
|
314
|
-
default: boolean;
|
|
315
|
-
};
|
|
316
|
-
/**
|
|
317
|
-
* Allow Multiple Selection.
|
|
318
|
-
*
|
|
319
|
-
* @see {@link https://codemirror.net/docs/ref/#state.EditorState^allowMultipleSelections}
|
|
320
|
-
*/
|
|
321
|
-
allowMultipleSelections: {
|
|
322
|
-
type: BooleanConstructor;
|
|
323
|
-
default: boolean;
|
|
324
|
-
};
|
|
325
|
-
/**
|
|
326
|
-
* Tab size
|
|
327
|
-
*
|
|
328
|
-
* @see {@link https://codemirror.net/docs/ref/#state.EditorState^tabSize}
|
|
329
|
-
*/
|
|
330
|
-
tabSize: {
|
|
331
|
-
type: NumberConstructor;
|
|
332
|
-
default: undefined;
|
|
333
|
-
};
|
|
334
|
-
/**
|
|
335
|
-
* Set line break (separetor) char.
|
|
336
|
-
*
|
|
337
|
-
* @see {@link https://codemirror.net/docs/ref/#state.EditorState^lineSeparator}
|
|
338
|
-
*/
|
|
339
|
-
lineSeparator: {
|
|
340
|
-
type: StringConstructor;
|
|
341
|
-
default: undefined;
|
|
342
|
-
};
|
|
343
|
-
/**
|
|
344
|
-
* Readonly
|
|
345
|
-
*
|
|
346
|
-
* @see {@link https://codemirror.net/docs/ref/#state.EditorState^readOnly}
|
|
347
|
-
*/
|
|
348
|
-
readonly: {
|
|
349
|
-
type: BooleanConstructor;
|
|
350
|
-
default: boolean;
|
|
351
|
-
};
|
|
352
|
-
/**
|
|
353
|
-
* Disable input.
|
|
354
|
-
*
|
|
355
|
-
* This is the reversed value of the CodeMirror editable.
|
|
356
|
-
* Similar to `readonly`, but setting this value to true disables dragging.
|
|
357
|
-
*
|
|
358
|
-
* @see {@link https://codemirror.net/docs/ref/#view.EditorView^editable}
|
|
359
|
-
*/
|
|
360
|
-
disabled: {
|
|
361
|
-
type: BooleanConstructor;
|
|
362
|
-
default: boolean;
|
|
363
|
-
};
|
|
364
|
-
/**
|
|
365
|
-
* Additional Extension
|
|
366
|
-
*
|
|
367
|
-
* @see {@link https://codemirror.net/docs/ref/#state.Extension}
|
|
368
|
-
*/
|
|
369
|
-
extensions: {
|
|
370
|
-
type: PropType<Extension[]>;
|
|
371
|
-
default: () => never[];
|
|
372
|
-
};
|
|
373
|
-
/**
|
|
374
|
-
* Language Phreses
|
|
375
|
-
*
|
|
376
|
-
* @see {@link https://codemirror.net/examples/translate/}
|
|
377
|
-
*/
|
|
378
|
-
phrases: {
|
|
379
|
-
type: PropType<Record<string, string>>;
|
|
380
|
-
default: () => undefined;
|
|
381
|
-
};
|
|
382
|
-
/**
|
|
383
|
-
* CodeMirror Language
|
|
384
|
-
*
|
|
385
|
-
* @see {@link https://codemirror.net/docs/ref/#language}
|
|
386
|
-
*/
|
|
387
|
-
lang: {
|
|
388
|
-
type: PropType<LanguageSupport>;
|
|
389
|
-
default: () => undefined;
|
|
390
|
-
};
|
|
391
|
-
/**
|
|
392
|
-
* CodeMirror Linter
|
|
393
|
-
*
|
|
394
|
-
* @see {@link https://codemirror.net/docs/ref/#lint.linter}
|
|
395
|
-
*/
|
|
396
|
-
linter: {
|
|
397
|
-
type: PropType<LintSource>;
|
|
398
|
-
default: undefined;
|
|
399
|
-
};
|
|
400
|
-
/**
|
|
401
|
-
* Linter Config
|
|
402
|
-
*
|
|
403
|
-
* @see {@link https://codemirror.net/docs/ref/#lint.linter^config}
|
|
404
|
-
*/
|
|
405
|
-
linterConfig: {
|
|
406
|
-
type: ObjectConstructor;
|
|
407
|
-
default: () => {
|
|
408
|
-
needsRefresh: boolean;
|
|
409
|
-
};
|
|
410
|
-
};
|
|
411
|
-
/**
|
|
412
|
-
* Forces any linters configured to run when the editor is idle to run right away.
|
|
413
|
-
*
|
|
414
|
-
* @see {@link https://codemirror.net/docs/ref/#lint.forceLinting}
|
|
415
|
-
*/
|
|
416
|
-
forceLinting: {
|
|
417
|
-
type: BooleanConstructor;
|
|
418
|
-
default: boolean;
|
|
419
|
-
};
|
|
420
|
-
/**
|
|
421
|
-
* Show Linter Gutter
|
|
422
|
-
*
|
|
423
|
-
* An area to 🔴 the lines with errors will be displayed.
|
|
424
|
-
* This feature is not enabled if `linter` is not specified.
|
|
425
|
-
*
|
|
426
|
-
* @see {@link https://codemirror.net/docs/ref/#lint.lintGutter}
|
|
427
|
-
*/
|
|
428
|
-
gutter: {
|
|
429
|
-
type: BooleanConstructor;
|
|
430
|
-
defalt: boolean;
|
|
431
|
-
};
|
|
432
|
-
/**
|
|
433
|
-
* Gutter Config
|
|
434
|
-
*
|
|
435
|
-
* @see {@link https://codemirror.net/docs/ref/#lint.lintGutter^config}
|
|
436
|
-
*/
|
|
437
|
-
gutterConfig: {
|
|
438
|
-
type: ObjectConstructor;
|
|
439
|
-
default: () => undefined;
|
|
440
|
-
};
|
|
441
|
-
/**
|
|
442
|
-
* Using tag
|
|
443
|
-
*/
|
|
444
|
-
tag: {
|
|
445
|
-
type: StringConstructor;
|
|
446
|
-
default: string;
|
|
447
|
-
};
|
|
448
|
-
}>> & {
|
|
449
|
-
onFocus?: ((value: boolean) => any) | undefined;
|
|
450
|
-
onChange?: ((value: EditorState) => any) | undefined;
|
|
451
|
-
"onUpdate:modelValue"?: ((value: string | Text) => any) | undefined;
|
|
452
|
-
onUpdate?: ((value: ViewUpdate) => any) | undefined;
|
|
453
|
-
onReady?: ((value: {
|
|
454
|
-
view: EditorView;
|
|
455
|
-
state: EditorState;
|
|
456
|
-
container: HTMLElement;
|
|
457
|
-
}) => any) | undefined;
|
|
458
|
-
onDestroy?: (() => any) | undefined;
|
|
459
|
-
}, {
|
|
460
|
-
dark: boolean;
|
|
461
|
-
lang: LanguageSupport;
|
|
462
|
-
placeholder: string | HTMLElement;
|
|
463
|
-
modelValue: string | Text;
|
|
464
|
-
theme: Record<string, StyleSpec>;
|
|
465
|
-
basic: boolean;
|
|
466
|
-
minimal: boolean;
|
|
467
|
-
wrap: boolean;
|
|
468
|
-
tab: boolean;
|
|
469
|
-
allowMultipleSelections: boolean;
|
|
470
|
-
tabSize: number;
|
|
471
|
-
lineSeparator: string;
|
|
472
|
-
readonly: boolean;
|
|
473
|
-
disabled: boolean;
|
|
474
|
-
extensions: Extension[];
|
|
475
|
-
phrases: Record<string, string>;
|
|
476
|
-
linter: LintSource;
|
|
477
|
-
linterConfig: Record<string, any>;
|
|
478
|
-
forceLinting: boolean;
|
|
479
|
-
gutter: boolean;
|
|
480
|
-
gutterConfig: Record<string, any>;
|
|
481
|
-
tag: string;
|
|
482
|
-
}, {}>;
|
|
483
|
-
export default _default;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* h-demi - h function for Vue 2 and 3
|
|
3
|
-
*
|
|
4
|
-
* @see {@link https://github.com/vueuse/vue-demi/issues/65}
|
|
5
|
-
*/
|
|
6
|
-
import { type Slots, type VNode, type VNodeProps } from 'vue-demi';
|
|
7
|
-
interface Options extends VNodeProps {
|
|
8
|
-
class?: string;
|
|
9
|
-
domProps?: VNodeProps;
|
|
10
|
-
on?: Record<string, () => void>;
|
|
11
|
-
props?: VNodeProps;
|
|
12
|
-
style?: string;
|
|
13
|
-
'aria-hidden'?: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* hDemi function.
|
|
17
|
-
*/
|
|
18
|
-
export default function h(type: string | Record<any, any>, options?: Options, chidren?: any): VNode;
|
|
19
|
-
export declare const slot: (defaultSlots: any) => Slots;
|
|
20
|
-
export {};
|
package/dist/src-docs/main.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|