vue-codemirror6 1.3.2 → 1.3.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/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.3.2",
4
+ "version": "1.3.3",
5
5
  "license": "MIT",
6
6
  "description": "CodeMirror6 Component for vue2 and vue3.",
7
7
  "keywords": [
@@ -55,7 +55,7 @@
55
55
  "engines": {
56
56
  "yarn": ">=1.22.19"
57
57
  },
58
- "packageManager": "yarn@4.2.2",
58
+ "packageManager": "yarn@4.3.1",
59
59
  "sideEffects": false,
60
60
  "scripts": {
61
61
  "dev": "vite",
@@ -83,42 +83,42 @@
83
83
  "@codemirror/lang-json": "^6.0.1",
84
84
  "@codemirror/lang-markdown": "^6.2.5",
85
85
  "@codemirror/lang-vue": "0.1.2",
86
- "@eslint/js": "^9.4.0",
86
+ "@eslint/js": "^9.6.0",
87
87
  "@tsconfig/node-lts": "^20.1.3",
88
- "@types/node": "^20.14.2",
89
- "@typescript-eslint/eslint-plugin": "^7.12.0",
88
+ "@types/node": "^20.14.10",
89
+ "@typescript-eslint/eslint-plugin": "^7.16.0",
90
90
  "@vitejs/plugin-vue": "^5.0.5",
91
- "@vue/compiler-sfc": "^3.4.27",
91
+ "@vue/compiler-sfc": "^3.4.31",
92
92
  "@vue/eslint-config-prettier": "^9.0.0",
93
93
  "@vue/tsconfig": "^0.5.1",
94
- "@vueuse/core": "^10.10.0",
94
+ "@vueuse/core": "^10.11.0",
95
95
  "bootstrap": "^5.3.3",
96
- "eslint": "^9.4.0",
96
+ "eslint": "^9.6.0",
97
97
  "eslint-import-resolver-alias": "^1.1.2",
98
98
  "eslint-import-resolver-typescript": "^3.6.1",
99
- "eslint-linter-browserify": "^9.4.0",
99
+ "eslint-linter-browserify": "^9.6.0",
100
100
  "eslint-plugin-import": "^2.29.1",
101
101
  "eslint-plugin-tsdoc": "^0.3.0",
102
- "eslint-plugin-vue": "^9.26.0",
103
- "eslint-plugin-vuejs-accessibility": "^2.3.0",
104
- "eslint-plugin-yaml": "^0.5.0",
102
+ "eslint-plugin-vue": "^9.27.0",
103
+ "eslint-plugin-vuejs-accessibility": "^2.3.1",
104
+ "eslint-plugin-yaml": "^1.0.3",
105
105
  "husky": "^9.0.11",
106
- "lint-staged": "^15.2.5",
106
+ "lint-staged": "^15.2.7",
107
107
  "npm-run-all": "^4.1.5",
108
- "prettier": "^3.3.1",
109
- "rimraf": "^5.0.7",
108
+ "prettier": "^3.3.2",
109
+ "rimraf": "^6.0.1",
110
110
  "rollup-plugin-visualizer": "^5.12.0",
111
- "sass": "^1.77.4",
112
- "typescript": "^5.4.5",
113
- "typescript-eslint": "^7.12.0",
114
- "vite": "^5.2.13",
111
+ "sass": "^1.77.7",
112
+ "typescript": "^5.5.3",
113
+ "typescript-eslint": "^7.16.0",
114
+ "vite": "^5.3.3",
115
115
  "vite-plugin-banner": "^0.7.1",
116
- "vite-plugin-checker": "^0.6.4",
116
+ "vite-plugin-checker": "^0.7.1",
117
117
  "vite-plugin-dts": "^3.9.1",
118
- "vue": "^3.4.27",
118
+ "vue": "^3.4.31",
119
119
  "vue-eslint-parser": "^9.4.3",
120
120
  "vue-markdown-wasm": "^0.4.0",
121
- "vue-tsc": "^2.0.21"
121
+ "vue-tsc": "^2.0.26"
122
122
  },
123
123
  "husky": {
124
124
  "hooks": {
@@ -130,6 +130,7 @@
130
130
  "*": "prettier -w -u"
131
131
  },
132
132
  "resolutions": {
133
+ "braces": ">=3.0.3",
133
134
  "json5": ">=2.2.3",
134
135
  "ip": ">=2.0.1",
135
136
  "lodash": ">=4.17.21",
@@ -462,18 +462,14 @@ export default defineComponent({
462
462
 
463
463
  // Range Fix ?
464
464
  // https://github.com/logue/vue-codemirror6/issues/27
465
- if (
466
- !selection.value.ranges.every(
467
- range => range.anchor < value.length && range.head < value.length
468
- )
469
- ) {
470
- return;
471
- }
472
-
465
+ const isSelectionOutOfRange = !view.value.state.selection.ranges.every(
466
+ range => range.anchor < value.length && range.head < value.length
467
+ )
468
+
473
469
  // Update
474
470
  view.value.dispatch({
475
471
  changes: { from: 0, to: view.value.state.doc.length, insert: value },
476
- selection: view.value.state.selection,
472
+ selection: isSelectionOutOfRange ? { anchor: 0, head: 0 } : view.value.state.selection,
477
473
  scrollIntoView: true,
478
474
  });
479
475
  },