nuxt-monaco-editor 1.2.3 → 1.2.4

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 CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.2.4](https://github.com/e-chan1007/nuxt-monaco-editor/compare/v1.2.3...v1.2.4) (2023-12-03)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * diffeditor loss value when change lang ([b996f28](https://github.com/e-chan1007/nuxt-monaco-editor/commit/b996f28ad22bd62094161576390c55b4e268928f))
11
+ * import nuxt composables from #imports ([343e227](https://github.com/e-chan1007/nuxt-monaco-editor/commit/343e227a58c32e95515ab57b52400b9351371d32))
12
+
5
13
  ### [1.2.3](https://github.com/e-chan1007/nuxt-monaco-editor/compare/v1.2.3-beta.0...v1.2.3) (2023-08-14)
6
14
 
7
15
  ### [1.2.3-beta.0](https://github.com/e-chan1007/nuxt-monaco-editor/compare/v1.2.2...v1.2.3-beta.0) (2023-08-14)
package/README.md CHANGED
@@ -36,7 +36,6 @@ export default defineNuxtConfig({
36
36
  export default defineNuxtConfig({
37
37
  monacoEditor: {
38
38
  // These are default values:
39
- dest: '_monaco',
40
39
  locale: 'en',
41
40
  componentName: {
42
41
  codeEditor: 'MonacoEditor',
package/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.1.0"
6
6
  },
7
- "version": "1.2.3"
7
+ "version": "1.2.4"
8
8
  }
@@ -53,10 +53,12 @@ watch(() => [props.original, props.modelValue], () => {
53
53
  })
54
54
 
55
55
  watch(() => props.lang, () => {
56
+ const originalValue = originalModel?.getValue() || props.original
57
+ const modifiedValue = modifiedModel?.getValue() || props.modelValue
56
58
  if (originalModel) { originalModel.dispose() }
57
- if (modifiedModel) { originalModel.dispose() }
58
- originalModel = monaco.editor.createModel(props.original, props.lang)
59
- modifiedModel = monaco.editor.createModel(props.modelValue, props.lang)
59
+ if (modifiedModel) { modifiedModel.dispose() }
60
+ originalModel = monaco.editor.createModel(originalValue, props.lang)
61
+ modifiedModel = monaco.editor.createModel(modifiedValue, props.lang)
60
62
  editor.setModel({
61
63
  original: originalModel,
62
64
  modified: modifiedModel
@@ -91,4 +93,10 @@ onMounted(() => {
91
93
  isLoading.value = false
92
94
  emit('load', editor)
93
95
  })
96
+
97
+ onUnmounted(() => {
98
+ editor?.dispose()
99
+ originalModel?.dispose()
100
+ modifiedModel?.dispose()
101
+ })
94
102
  </script>
@@ -76,4 +76,9 @@ onMounted(() => {
76
76
  isLoading.value = false
77
77
  emit('load', editor)
78
78
  })
79
+
80
+ onUnmounted(() => {
81
+ editor?.dispose()
82
+ model?.dispose()
83
+ })
79
84
  </script>
@@ -1,3 +1,3 @@
1
- import { useState } from "#app";
1
+ import { useState } from "#imports";
2
2
  export const _useMonacoState = () => useState("MonacoEditorNamespace", () => null);
3
3
  export const useMonaco = () => _useMonacoState().value;
@@ -1,5 +1,5 @@
1
1
  import { _useMonacoState } from "./composables.mjs";
2
- import { defineNuxtPlugin } from "#app";
2
+ import { defineNuxtPlugin } from "#imports";
3
3
  export default defineNuxtPlugin(async (nuxtApp) => {
4
4
  const getWorkerModule = (moduleUrl, label) => {
5
5
  return new Worker(new URL("/node_modules/monaco-editor/esm/vs/" + moduleUrl + ".js?worker", import.meta.url), {
@@ -1,5 +1,5 @@
1
1
  import { _useMonacoState } from "./composables.mjs";
2
- import { defineNuxtPlugin } from "#app";
2
+ import { defineNuxtPlugin } from "#imports";
3
3
  export default defineNuxtPlugin(async (nuxtApp) => {
4
4
  const getWorkerModule = (moduleUrl, label) => {
5
5
  return new Worker(new URL(`${nuxtApp.$config.app.baseURL}/_nuxt/nuxt-monaco-editor/vs/${moduleUrl}.js`.replace(/\/\//g, "/"), import.meta.url), {
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "type": "git",
12
12
  "url": "https://github.com/e-chan1007/nuxt-monaco-editor.git"
13
13
  },
14
- "version": "1.2.3",
14
+ "version": "1.2.4",
15
15
  "type": "module",
16
16
  "license": "MIT",
17
17
  "exports": {
@@ -30,7 +30,7 @@
30
30
  ],
31
31
  "scripts": {
32
32
  "postpack": "pinst --enable",
33
- "_postinstall": "husky install",
33
+ "_postinstall": "husky install && playwright install",
34
34
  "build": "nuxt-module-build",
35
35
  "lint": "eslint --ext .js,.cjs,.mjs,.ts,.cts,.mts,.vue . && remark . -q",
36
36
  "test": "nuxt test",
@@ -45,29 +45,30 @@
45
45
  "docs:preview": "nuxt preview docs"
46
46
  },
47
47
  "dependencies": {
48
- "@nuxt/kit": "^3.6.5",
48
+ "@nuxt/kit": "^3.8.1",
49
49
  "monaco-editor-nls": "^3.1.0",
50
50
  "vite-plugin-static-copy": "^0.17.0"
51
51
  },
52
52
  "devDependencies": {
53
- "@commitlint/cli": "^17.7.1",
54
- "@commitlint/config-conventional": "^17.4.4",
55
- "@nuxt-themes/docus": "^1.14.6",
53
+ "@commitlint/cli": "^18.4.1",
54
+ "@commitlint/config-conventional": "^18.4.0",
55
+ "@nuxt-themes/docus": "^1.15.0",
56
56
  "@nuxt/module-builder": "latest",
57
- "@nuxt/test-utils": "^3.6.5",
58
- "@nuxtjs/eslint-config-typescript": "^12.0.0",
59
- "eslint": "^8.47.0",
60
- "execa": "^7.2.0",
57
+ "@nuxt/test-utils": "^3.8.1",
58
+ "@nuxtjs/eslint-config-typescript": "^12.1.0",
59
+ "eslint": "^8.53.0",
60
+ "execa": "^8.0.1",
61
61
  "husky": "^8.0.3",
62
- "monaco-editor": "^0.41.0",
63
- "nuxt": "^3.6.5",
62
+ "monaco-editor": "^0.44.0",
63
+ "nuxt": "^3.8.1",
64
64
  "pinst": "^3.0.0",
65
- "playwright": "^1.37.0",
66
- "remark-cli": "^11.0.0",
65
+ "playwright": "^1.39.0",
66
+ "remark-cli": "^12.0.0",
67
67
  "remark-lint": "^9.1.2",
68
68
  "remark-preset-lint-recommended": "^6.1.3",
69
69
  "standard-version": "^9.5.0",
70
- "vitest": "^0.34.1"
70
+ "typescript": "^5.2.2",
71
+ "vitest": "^0.33.0"
71
72
  },
72
73
  "peerDependencies": {
73
74
  "monaco-editor": "*"
@@ -84,5 +85,5 @@
84
85
  "workspaces": [
85
86
  "playground"
86
87
  ],
87
- "packageManager": "yarn@3.2.4"
88
+ "packageManager": "yarn@4.0.1"
88
89
  }