nuxt-monaco-editor 1.2.1-beta.2 → 1.2.1-beta.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/CHANGELOG.md +2 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +9 -1
- package/dist/runtime/nls.d.mts +1 -1
- package/dist/runtime/nls.mjs +9 -5
- package/dist/runtime/plugin-dev.client.mjs +33 -0
- package/dist/runtime/plugin-prod.client.d.ts +2 -0
- package/package.json +5 -4
- /package/dist/runtime/{plugin.client.d.ts → plugin-dev.client.d.ts} +0 -0
- /package/dist/runtime/{plugin.client.mjs → plugin-prod.client.mjs} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
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.1-beta.3](https://github.com/e-chan1007/nuxt-monaco-editor/compare/v1.2.1-beta.2...v1.2.1-beta.3) (2023-03-25)
|
|
6
|
+
|
|
5
7
|
### [1.2.1-beta.2](https://github.com/e-chan1007/nuxt-monaco-editor/compare/v1.2.1-beta.1...v1.2.1-beta.2) (2023-03-25)
|
|
6
8
|
|
|
7
9
|
### [1.2.1-beta.1](https://github.com/e-chan1007/nuxt-monaco-editor/compare/v1.2.1-beta.0...v1.2.1-beta.1) (2023-03-25)
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -67,6 +67,7 @@ const module = defineNuxtModule({
|
|
|
67
67
|
},
|
|
68
68
|
defaults: DEFAULTS,
|
|
69
69
|
setup(options, nuxt) {
|
|
70
|
+
const isDev = nuxt.options.dev;
|
|
70
71
|
const runtimeDir = fileURLToPath(new URL("./runtime", import.meta.url));
|
|
71
72
|
const { resolve } = createResolver(runtimeDir);
|
|
72
73
|
nuxt.options.build.transpile.push(runtimeDir);
|
|
@@ -78,7 +79,14 @@ const module = defineNuxtModule({
|
|
|
78
79
|
dest: "_nuxt/nuxt-monaco-editor"
|
|
79
80
|
}]
|
|
80
81
|
}));
|
|
81
|
-
|
|
82
|
+
nuxt.hook("build:manifest", (manifest) => {
|
|
83
|
+
Object.entries(manifest).forEach(([key, entry]) => {
|
|
84
|
+
if (key.includes("node_modules/monaco-editor/esm/vs")) {
|
|
85
|
+
entry.isEntry = false;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
addPlugin(isDev ? resolve("plugin-dev.client") : resolve("plugin-prod.client"));
|
|
82
90
|
addComponent({ name: options.componentName.codeEditor, filePath: resolve("MonacoEditor.client.vue") });
|
|
83
91
|
addComponent({ name: options.componentName.diffEditor, filePath: resolve("MonacoDiffEditor.client.vue") });
|
|
84
92
|
addImports({ name: "useMonaco", as: "useMonaco", from: resolve("composables") });
|
package/dist/runtime/nls.d.mts
CHANGED
|
@@ -2,4 +2,4 @@ export function _format(message: any, args: any): any;
|
|
|
2
2
|
export function localize(path: any, _data: any, defaultMessage: any, ...args: any[]): any;
|
|
3
3
|
export function loadMessageBundle(file: any): typeof localize;
|
|
4
4
|
export function config(opt: any): typeof loadMessageBundle;
|
|
5
|
-
export function getConfiguredDefaultLocale():
|
|
5
|
+
export function getConfiguredDefaultLocale(): undefined;
|
package/dist/runtime/nls.mjs
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import localeData from '__LOCALE_DATA_PATH__'
|
|
2
2
|
|
|
3
3
|
export function _format (message, args) {
|
|
4
|
+
let result
|
|
4
5
|
if (args.length === 0) {
|
|
5
|
-
|
|
6
|
+
result = message
|
|
6
7
|
} else {
|
|
7
|
-
|
|
8
|
+
result = String(message).replace(/\{(\d+)\}/g, function (match, rest) {
|
|
8
9
|
const index = rest[0]
|
|
9
|
-
return args[index]
|
|
10
|
+
return typeof args[index] !== 'undefined' ? args[index] : match
|
|
10
11
|
})
|
|
11
12
|
}
|
|
13
|
+
return result
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
export function localize (path, _data, defaultMessage) {
|
|
15
17
|
const key = typeof _data === 'object' ? _data.key : _data
|
|
16
18
|
const data = localeData || {}
|
|
17
|
-
let message = data
|
|
19
|
+
let message = (data[path] || {})[key]
|
|
18
20
|
if (!message) {
|
|
19
21
|
message = defaultMessage
|
|
20
22
|
}
|
|
@@ -33,4 +35,6 @@ export function config (opt) {
|
|
|
33
35
|
return loadMessageBundle
|
|
34
36
|
}
|
|
35
37
|
|
|
36
|
-
export function getConfiguredDefaultLocale () {
|
|
38
|
+
export function getConfiguredDefaultLocale () {
|
|
39
|
+
return undefined
|
|
40
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineNuxtPlugin } from "#app";
|
|
2
|
+
import { _useMonacoState } from "./composables.mjs";
|
|
3
|
+
export default defineNuxtPlugin(async (nuxtApp) => {
|
|
4
|
+
const getWorkerModule = (moduleUrl, label) => {
|
|
5
|
+
return new Worker(new URL("/node_modules/monaco-editor/esm/vs/" + moduleUrl + ".js?worker", import.meta.url), {
|
|
6
|
+
name: label,
|
|
7
|
+
type: "module"
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
self.MonacoEnvironment = {
|
|
11
|
+
getWorker(workerId, label) {
|
|
12
|
+
switch (label) {
|
|
13
|
+
case "json":
|
|
14
|
+
return getWorkerModule("language/json/json.worker", label);
|
|
15
|
+
case "css":
|
|
16
|
+
case "scss":
|
|
17
|
+
case "less":
|
|
18
|
+
return getWorkerModule("language/css/css.worker", label);
|
|
19
|
+
case "html":
|
|
20
|
+
case "handlebars":
|
|
21
|
+
case "razor":
|
|
22
|
+
return getWorkerModule("language/html/html.worker", label);
|
|
23
|
+
case "typescript":
|
|
24
|
+
case "javascript":
|
|
25
|
+
return getWorkerModule("language/typescript/ts.worker", label);
|
|
26
|
+
default:
|
|
27
|
+
return getWorkerModule("editor/editor.worker", label);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const monacoState = _useMonacoState();
|
|
32
|
+
monacoState.value = await import("monaco-editor");
|
|
33
|
+
});
|
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.1-beta.
|
|
14
|
+
"version": "1.2.1-beta.3",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"exports": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"docs:preview": "nuxt preview docs"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@nuxt/kit": "3.3.1",
|
|
48
|
+
"@nuxt/kit": "^3.3.1",
|
|
49
49
|
"monaco-editor-nls": "^3.0.0",
|
|
50
50
|
"vite-plugin-static-copy": "^0.13.1"
|
|
51
51
|
},
|
|
@@ -54,12 +54,13 @@
|
|
|
54
54
|
"@commitlint/config-conventional": "^17.4.4",
|
|
55
55
|
"@nuxt-themes/docus": "^1.9.10",
|
|
56
56
|
"@nuxt/module-builder": "latest",
|
|
57
|
-
"@nuxt/test-utils": "3.3.1",
|
|
57
|
+
"@nuxt/test-utils": "^3.3.1",
|
|
58
58
|
"@nuxtjs/eslint-config-typescript": "^12.0.0",
|
|
59
59
|
"eslint": "^8.36.0",
|
|
60
|
+
"execa": "^7.1.1",
|
|
60
61
|
"husky": "^8.0.3",
|
|
61
62
|
"monaco-editor": "^0.36.1",
|
|
62
|
-
"nuxt": "3.3.1",
|
|
63
|
+
"nuxt": "^3.3.1",
|
|
63
64
|
"pinst": "^3.0.0",
|
|
64
65
|
"playwright": "^1.32.0",
|
|
65
66
|
"remark-cli": "^11.0.0",
|
|
File without changes
|
|
File without changes
|