vue-codemirror6 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -55
- package/dist/Meta.d.ts +4 -0
- package/dist/Meta.d.ts.map +1 -0
- package/dist/components/CodeMirror.d.ts +12 -1
- package/dist/components/CodeMirror.d.ts.map +1 -1
- package/dist/helpers/h-demi.d.ts +5 -0
- package/dist/helpers/h-demi.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +200 -134
- package/dist/index.iife.js +279 -2
- package/dist/index.umd.js +280 -2
- package/dist/interfaces/MetaInterface.d.ts +8 -0
- package/dist/interfaces/MetaInterface.d.ts.map +1 -0
- package/dist/stats.html +4034 -0
- package/package.json +21 -21
- package/src/components/CodeMirror.ts +12 -5
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.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "CodeMirror6 Component for vue2 and vue3.",
|
|
7
7
|
"keywords": [
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"./sfc": "./src/components/CodeMirror.ts"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
|
-
"node": ">=16.17.
|
|
54
|
+
"node": ">=16.17.1",
|
|
55
55
|
"yarn": ">=1.22.10"
|
|
56
56
|
},
|
|
57
|
-
"packageManager": "yarn@3.2.
|
|
57
|
+
"packageManager": "yarn@3.2.4",
|
|
58
58
|
"sideEffects": false,
|
|
59
59
|
"scripts": {
|
|
60
60
|
"dev": "vite",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"vue-demi": "latest"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"@vue/composition-api": "^1.7.
|
|
75
|
+
"@vue/composition-api": "^1.7.1",
|
|
76
76
|
"codemirror": "^6.0.1",
|
|
77
77
|
"vue": "^2.6.14 || ^3.2.39"
|
|
78
78
|
},
|
|
@@ -82,42 +82,42 @@
|
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@codemirror/lang-javascript": "^6.0
|
|
86
|
-
"@codemirror/lang-markdown": "^6.0.
|
|
87
|
-
"@types/lodash": "^4.14.
|
|
88
|
-
"@types/node": "^18.
|
|
89
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
90
|
-
"@typescript-eslint/parser": "^5.
|
|
91
|
-
"@vitejs/plugin-vue": "^3.1.
|
|
85
|
+
"@codemirror/lang-javascript": "^6.1.0",
|
|
86
|
+
"@codemirror/lang-markdown": "^6.0.2",
|
|
87
|
+
"@types/lodash": "^4.14.186",
|
|
88
|
+
"@types/node": "^18.8.4",
|
|
89
|
+
"@typescript-eslint/eslint-plugin": "^5.40.0",
|
|
90
|
+
"@typescript-eslint/parser": "^5.40.0",
|
|
91
|
+
"@vitejs/plugin-vue": "^3.1.2",
|
|
92
92
|
"@vue/eslint-config-prettier": "^7.0.0",
|
|
93
93
|
"@vue/tsconfig": "^0.1.3",
|
|
94
94
|
"codemirror": "^6.0.1",
|
|
95
|
-
"eslint": "^8.
|
|
95
|
+
"eslint": "^8.25.0",
|
|
96
96
|
"eslint-config-google": "^0.14.0",
|
|
97
97
|
"eslint-config-prettier": "^8.5.0",
|
|
98
98
|
"eslint-import-resolver-alias": "^1.1.2",
|
|
99
99
|
"eslint-import-resolver-typescript": "^3.5.1",
|
|
100
|
+
"eslint-linter-browserify": "^8.25.0",
|
|
100
101
|
"eslint-plugin-html": "^7.1.0",
|
|
101
102
|
"eslint-plugin-import": "^2.26.0",
|
|
102
103
|
"eslint-plugin-jsdoc": "^39.3.6",
|
|
103
|
-
"eslint-plugin-tsdoc": "^0.2.
|
|
104
|
-
"eslint-plugin-vue": "^9.
|
|
104
|
+
"eslint-plugin-tsdoc": "^0.2.17",
|
|
105
|
+
"eslint-plugin-vue": "^9.6.0",
|
|
105
106
|
"eslint-plugin-vuejs-accessibility": "^1.2.0",
|
|
106
107
|
"eslint-plugin-yaml": "^0.5.0",
|
|
107
|
-
"eslint4b-prebuilt": "^6.7.2",
|
|
108
108
|
"husky": "^8.0.1",
|
|
109
109
|
"lint-staged": "^13.0.3",
|
|
110
110
|
"lodash": "^4.17.21",
|
|
111
111
|
"prettier": "^2.7.1",
|
|
112
112
|
"rimraf": "^3.0.2",
|
|
113
|
-
"rollup-plugin-visualizer": "^5.8.
|
|
114
|
-
"typescript": "^4.8.
|
|
115
|
-
"vite": "^3.1.
|
|
113
|
+
"rollup-plugin-visualizer": "^5.8.2",
|
|
114
|
+
"typescript": "^4.8.4",
|
|
115
|
+
"vite": "^3.1.7",
|
|
116
116
|
"vite-plugin-banner": "^0.5.0",
|
|
117
117
|
"vite-plugin-checker": "^0.5.1",
|
|
118
|
-
"vue": "^3.2.
|
|
119
|
-
"vue-eslint-parser": "^9.0
|
|
120
|
-
"vue-tsc": "^0.
|
|
118
|
+
"vue": "^3.2.40",
|
|
119
|
+
"vue-eslint-parser": "^9.1.0",
|
|
120
|
+
"vue-tsc": "^1.0.5"
|
|
121
121
|
},
|
|
122
122
|
"husky": {
|
|
123
123
|
"hooks": {
|
|
@@ -188,6 +188,11 @@ export default defineComponent({
|
|
|
188
188
|
type: Boolean,
|
|
189
189
|
defalt: false,
|
|
190
190
|
},
|
|
191
|
+
/** Using tag */
|
|
192
|
+
tag: {
|
|
193
|
+
type: String,
|
|
194
|
+
default: 'div',
|
|
195
|
+
},
|
|
191
196
|
},
|
|
192
197
|
/** Emits */
|
|
193
198
|
emits: ['update:modelValue', 'update', 'ready', 'focus', 'changed'],
|
|
@@ -199,7 +204,7 @@ export default defineComponent({
|
|
|
199
204
|
*/
|
|
200
205
|
setup(props, context: SetupContext<CodeMirrorEmitsOptions>) {
|
|
201
206
|
/** Editor DOM */
|
|
202
|
-
const editor: Ref<
|
|
207
|
+
const editor: Ref<HTMLElement | undefined> = ref();
|
|
203
208
|
|
|
204
209
|
/** Internal value */
|
|
205
210
|
const doc: Ref<string | Text> = ref(props.modelValue);
|
|
@@ -273,16 +278,18 @@ export default defineComponent({
|
|
|
273
278
|
// for parent-to-child binding.
|
|
274
279
|
watch(
|
|
275
280
|
() => props.modelValue,
|
|
276
|
-
|
|
281
|
+
value => {
|
|
277
282
|
if (!view.value || view.value.composing) {
|
|
278
283
|
// IME fix
|
|
279
284
|
return;
|
|
280
285
|
}
|
|
286
|
+
/** Previous cursor location */
|
|
287
|
+
const previous = view.value.state.selection;
|
|
281
288
|
|
|
282
289
|
// Update
|
|
283
290
|
view.value.dispatch({
|
|
284
|
-
changes: { from: 0, to: view.value.state.doc.length, insert:
|
|
285
|
-
selection:
|
|
291
|
+
changes: { from: 0, to: view.value.state.doc.length, insert: value },
|
|
292
|
+
selection: previous,
|
|
286
293
|
});
|
|
287
294
|
},
|
|
288
295
|
{ immediate: true }
|
|
@@ -479,7 +486,7 @@ export default defineComponent({
|
|
|
479
486
|
// </div>
|
|
480
487
|
// </template>
|
|
481
488
|
return h(
|
|
482
|
-
|
|
489
|
+
this.$props.tag,
|
|
483
490
|
{
|
|
484
491
|
ref: 'editor',
|
|
485
492
|
class: 'vue-codemirror',
|