vue-codemirror6 1.1.26 → 1.1.28

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.1.26",
4
+ "version": "1.1.28",
5
5
  "license": "MIT",
6
6
  "description": "CodeMirror6 Component for vue2 and vue3.",
7
7
  "keywords": [
@@ -55,13 +55,13 @@
55
55
  "engines": {
56
56
  "yarn": ">=1.22.19"
57
57
  },
58
- "packageManager": "yarn@3.6.3",
58
+ "packageManager": "yarn@4.0.1",
59
59
  "sideEffects": false,
60
60
  "scripts": {
61
61
  "dev": "vite",
62
62
  "clean": "rimraf node_modules/.vite",
63
63
  "type-check": "tsc --noEmit --composite false",
64
- "build": "run-p type-check build-only",
64
+ "build": "run-p type-check \"build-only {@}\" --",
65
65
  "build:analyze": "vite build --mode=analyze",
66
66
  "build:clean": "rimraf dist docs",
67
67
  "build:docs": "vite build --mode=docs",
@@ -81,46 +81,46 @@
81
81
  "devDependencies": {
82
82
  "@codemirror/lang-javascript": "^6.2.1",
83
83
  "@codemirror/lang-json": "^6.0.1",
84
- "@codemirror/lang-markdown": "^6.2.0",
84
+ "@codemirror/lang-markdown": "^6.2.2",
85
85
  "@codemirror/lang-vue": "^0.1.2",
86
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",
90
- "@vue/compiler-sfc": "^3.3.4",
87
+ "@types/node": "^20.9.0",
88
+ "@typescript-eslint/eslint-plugin": "^6.10.0",
89
+ "@vitejs/plugin-vue": "^4.4.0",
90
+ "@vue/compiler-sfc": "^3.3.8",
91
91
  "@vue/eslint-config-prettier": "^8.0.0",
92
92
  "@vue/tsconfig": "^0.4.0",
93
- "@vueuse/core": "^10.4.1",
94
- "bootstrap": "^5.3.1",
95
- "eslint": "^8.48.0",
96
- "eslint-config-standard-with-typescript": "^39.0.0",
93
+ "@vueuse/core": "^10.5.0",
94
+ "bootstrap": "^5.3.2",
95
+ "eslint": "^8.53.0",
96
+ "eslint-config-standard-with-typescript": "^39.1.1",
97
97
  "eslint-import-resolver-alias": "^1.1.2",
98
- "eslint-import-resolver-typescript": "^3.6.0",
99
- "eslint-linter-browserify": "^8.48.0",
98
+ "eslint-import-resolver-typescript": "^3.6.1",
99
+ "eslint-linter-browserify": "^8.53.0",
100
100
  "eslint-plugin-html": "^7.1.0",
101
- "eslint-plugin-import": "^2.28.1",
102
- "eslint-plugin-n": "^16.0.2",
101
+ "eslint-plugin-import": "^2.29.0",
102
+ "eslint-plugin-n": "^16.3.0",
103
103
  "eslint-plugin-promise": "^6.1.1",
104
104
  "eslint-plugin-tsdoc": "^0.2.17",
105
105
  "eslint-plugin-vue": "latest",
106
106
  "eslint-plugin-vuejs-accessibility": "^2.2.0",
107
107
  "eslint-plugin-yaml": "^0.5.0",
108
108
  "husky": "^8.0.3",
109
- "lint-staged": "^14.0.1",
109
+ "lint-staged": "^15.0.2",
110
110
  "npm-run-all": "^4.1.5",
111
111
  "prettier": "^3.0.3",
112
- "rimraf": "^5.0.1",
112
+ "rimraf": "^5.0.5",
113
113
  "rollup-plugin-visualizer": "^5.9.2",
114
- "sass": "^1.66.1",
114
+ "sass": "~1.69.5",
115
115
  "typescript": "^5.2.2",
116
- "vite": "^4.4.9",
117
- "vite-plugin-banner": "^0.7.0",
116
+ "vite": "^4.5.0",
117
+ "vite-plugin-banner": "^0.7.1",
118
118
  "vite-plugin-checker": "^0.6.2",
119
- "vite-plugin-dts": "^3.5.3",
120
- "vue": "^3.3.4",
121
- "vue-eslint-parser": "^9.3.1",
119
+ "vite-plugin-dts": "^3.6.3",
120
+ "vue": "^3.3.8",
121
+ "vue-eslint-parser": "^9.3.2",
122
122
  "vue-markdown-wasm": "^0.3.12",
123
- "vue-tsc": "^1.8.8"
123
+ "vue-tsc": "^1.8.22"
124
124
  },
125
125
  "husky": {
126
126
  "hooks": {
@@ -128,13 +128,17 @@
128
128
  }
129
129
  },
130
130
  "lint-staged": {
131
- "*.{js,ts,json,htm,html}": "eslint --fix --cache --cache-location ./node_modules/.vite/vite-plugin-eslint",
131
+ "*.{js,ts,json,htm,html,vue}": "eslint --fix --cache --cache-location ./node_modules/.vite/vite-plugin-eslint",
132
132
  "*": "prettier -w -u"
133
133
  },
134
134
  "resolutions": {
135
135
  "http-cache-semantics": "^4.1.1",
136
136
  "json5": "^2.2.3",
137
+ "postcss": "^8.4.31",
137
138
  "semver": "^7.5.2",
138
- "yaml": "^2.2.2"
139
+ "tough-cookie": "^4.1.3",
140
+ "vite": "^4.3.9",
141
+ "word-wrap": "^1.2.4",
142
+ "yaml": "^2.3.2"
139
143
  }
140
144
  }
@@ -274,8 +274,6 @@ export default defineComponent({
274
274
  }) => true,
275
275
  /** CodeMirror onFocus */
276
276
  focus: (value: boolean) => true,
277
- /** blur */
278
- // blur: (value: boolean) => true,
279
277
  /** State Changed */
280
278
  change: (value: EditorState) => true,
281
279
  /** CodeMirror onDestroy */
@@ -349,22 +347,26 @@ export default defineComponent({
349
347
  */
350
348
  const diagnosticCount: Ref<number> = ref(0);
351
349
 
352
- // Synamic Reconfiguration
353
- // @see https://codemirror.net/examples/config/
354
-
355
- const language = new Compartment();
356
- const tabSize = new Compartment();
357
-
358
350
  /** Get CodeMirror Extension */
359
- const extensions: ComputedRef<Extension[]> = computed(() =>
351
+ const extensions: ComputedRef<Extension[]> = computed(() => {
352
+ // Synamic Reconfiguration
353
+ // @see https://codemirror.net/examples/config/
354
+ const language = new Compartment();
355
+ const tabSize = new Compartment();
356
+
360
357
  // TODO: Ignore previous prop was not changed.
361
- [
358
+ return [
362
359
  // Toggle basic setup
363
360
  props.basic ? basicSetup : undefined,
364
361
  // Toggle minimal setup
365
362
  props.minimal && !props.basic ? minimalSetup : undefined,
366
363
  // ViewUpdate event listener
367
364
  EditorView.updateListener.of((update: ViewUpdate): void => {
365
+ // Emit focus status
366
+ context.emit('focus', view.value.hasFocus);
367
+ // Update count
368
+ length.value = view.value.state.doc.length;
369
+
368
370
  if (update.changes.empty || !update.docChanged) {
369
371
  // Suppress event firing if no change
370
372
  return;
@@ -381,7 +383,6 @@ export default defineComponent({
381
383
  ).length;
382
384
  }
383
385
  context.emit('update', update);
384
- context.emit('focus', view.value.hasFocus);
385
386
  }),
386
387
  // Toggle light/dark mode.
387
388
  EditorView.theme(props.theme, { dark: props.dark }),
@@ -417,8 +418,8 @@ export default defineComponent({
417
418
  props.placeholder ? placeholder(props.placeholder) : undefined,
418
419
  // Append Extensions
419
420
  ...props.extensions,
420
- ].filter((extension): extension is Extension => !!extension)
421
- );
421
+ ].filter((extension): extension is Extension => !!extension);
422
+ });
422
423
 
423
424
  // Extension (mostly props) Changed
424
425
  watch(
@@ -440,8 +441,6 @@ export default defineComponent({
440
441
  view.value.state.doc.toJSON().join(props.lineSeparator ?? '\n') ===
441
442
  value // don't need to update
442
443
  ) {
443
- // Update count
444
- length.value = view.value.state.doc.length;
445
444
  // Do not commit CodeMirror's store.
446
445
  return;
447
446
  }
@@ -452,15 +451,10 @@ export default defineComponent({
452
451
  selection: view.value.state.selection,
453
452
  scrollIntoView: true,
454
453
  });
455
- // Update count
456
- length.value = view.value.state.doc.length;
457
454
  },
458
455
  { immediate: true }
459
456
  );
460
457
 
461
- // focus changed
462
- watch(focus, isFocus => context.emit('focus', isFocus));
463
-
464
458
  /** When loaded */
465
459
  onMounted(async () => {
466
460
  /** Initial value */
@@ -485,8 +479,6 @@ export default defineComponent({
485
479
  dispatch: (tr: Transaction) => {
486
480
  view.value.update([tr]);
487
481
 
488
- context.emit('focus', view.value.hasFocus);
489
-
490
482
  if (tr.changes.empty || !tr.docChanged) {
491
483
  // if not change value, no fire emit event
492
484
  return;
@@ -677,6 +669,7 @@ export default defineComponent({
677
669
  length,
678
670
  json,
679
671
  diagnosticCount,
672
+ dom: view.value.contentDOM,
680
673
  lint,
681
674
  forceReconfigure,
682
675
  // Bellow is CodeMirror5's function
package/dist/Meta.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import type MetaInterface from './interfaces/MetaInterface';
2
- declare const meta: MetaInterface;
3
- export default meta;
@@ -1,3 +0,0 @@
1
- /** CodeMirror Component */
2
- declare const _default: any;
3
- export default _default;
package/dist/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import CodeMirror from './components/CodeMirror';
2
- import Meta from './Meta';
3
- declare const installCodeMirror: (app: any) => void;
4
- export { CodeMirror as default, installCodeMirror as install, Meta };