nuxt-monaco-editor 1.2.3 → 1.2.5
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 +15 -0
- package/README.md +0 -1
- package/dist/module.json +1 -1
- package/dist/runtime/MonacoDiffEditor.client.vue +12 -4
- package/dist/runtime/MonacoEditor.client.vue +6 -1
- package/dist/runtime/composables.mjs +1 -1
- package/dist/runtime/plugin-dev.client.mjs +1 -1
- package/dist/runtime/plugin-prod.client.mjs +1 -1
- package/package.json +17 -16
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
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.5](https://github.com/e-chan1007/nuxt-monaco-editor/compare/v1.2.4...v1.2.5) (2023-12-05)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* onUnmounted is not defined ([c3a1af3](https://github.com/e-chan1007/nuxt-monaco-editor/commit/c3a1af3f1706bba06539676088f70f8c7e6369f2))
|
|
11
|
+
|
|
12
|
+
### [1.2.4](https://github.com/e-chan1007/nuxt-monaco-editor/compare/v1.2.3...v1.2.4) (2023-12-03)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* diffeditor loss value when change lang ([b996f28](https://github.com/e-chan1007/nuxt-monaco-editor/commit/b996f28ad22bd62094161576390c55b4e268928f))
|
|
18
|
+
* import nuxt composables from #imports ([343e227](https://github.com/e-chan1007/nuxt-monaco-editor/commit/343e227a58c32e95515ab57b52400b9351371d32))
|
|
19
|
+
|
|
5
20
|
### [1.2.3](https://github.com/e-chan1007/nuxt-monaco-editor/compare/v1.2.3-beta.0...v1.2.3) (2023-08-14)
|
|
6
21
|
|
|
7
22
|
### [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
package/dist/module.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<script lang="ts" setup>
|
|
8
8
|
import type * as Monaco from 'monaco-editor'
|
|
9
|
-
import { onMounted, ref, watch } from 'vue'
|
|
9
|
+
import { onMounted, onUnmounted, ref, watch } from 'vue'
|
|
10
10
|
import { useMonaco } from './composables'
|
|
11
11
|
|
|
12
12
|
interface Props {
|
|
@@ -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) {
|
|
58
|
-
originalModel = monaco.editor.createModel(
|
|
59
|
-
modifiedModel = monaco.editor.createModel(
|
|
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>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<script lang="ts" setup>
|
|
8
8
|
import type * as Monaco from 'monaco-editor'
|
|
9
|
-
import { computed, onMounted, ref, watch } from 'vue'
|
|
9
|
+
import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
|
|
10
10
|
import { useMonaco } from './composables'
|
|
11
11
|
|
|
12
12
|
interface Props {
|
|
@@ -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,5 +1,5 @@
|
|
|
1
1
|
import { _useMonacoState } from "./composables.mjs";
|
|
2
|
-
import { defineNuxtPlugin } from "#
|
|
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 "#
|
|
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.
|
|
14
|
+
"version": "1.2.5",
|
|
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.
|
|
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": "^
|
|
54
|
-
"@commitlint/config-conventional": "^
|
|
55
|
-
"@nuxt-themes/docus": "^1.
|
|
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.
|
|
58
|
-
"@nuxtjs/eslint-config-typescript": "^12.
|
|
59
|
-
"eslint": "^8.
|
|
60
|
-
"execa": "^
|
|
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.
|
|
63
|
-
"nuxt": "^3.
|
|
62
|
+
"monaco-editor": "^0.44.0",
|
|
63
|
+
"nuxt": "^3.8.1",
|
|
64
64
|
"pinst": "^3.0.0",
|
|
65
|
-
"playwright": "^1.
|
|
66
|
-
"remark-cli": "^
|
|
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
|
-
"
|
|
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@
|
|
88
|
+
"packageManager": "yarn@4.0.1"
|
|
88
89
|
}
|