monaco-editor11 1.0.6 → 1.0.8

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/dist/index.d.ts CHANGED
@@ -3,7 +3,6 @@ export declare const createHtmlWorker: () => Worker;
3
3
  export declare const createCssWorker: () => Worker;
4
4
  export declare const createJsonWorker: () => Worker;
5
5
  export declare const createTsWorker: () => Worker;
6
- export * from 'monaco-editor';
7
6
  declare global {
8
7
  interface Window {
9
8
  MonacoEnvironment?: {
@@ -12,3 +11,4 @@ declare global {
12
11
  }
13
12
  }
14
13
  export declare const initMonacoWorker: () => void;
14
+ export * from 'monaco-editor';
@@ -1,20 +1,83 @@
1
1
  export * from "monaco-editor";
2
- const a = "data:text/javascript;base64,aW1wb3J0IHsgaXNXb3JrZXJJbml0aWFsaXplZCB9IGZyb20gJy4uL2NvbW1vbi9pbml0aWFsaXplLmpzJzsKZXhwb3J0IHsgaW5pdGlhbGl6ZSB9IGZyb20gJy4uL2NvbW1vbi9pbml0aWFsaXplLmpzJzsKaW1wb3J0IHsgc3RhcnQgfSBmcm9tICcuL2VkaXRvci53b3JrZXIuc3RhcnQuanMnOwoKc2VsZi5vbm1lc3NhZ2UgPSAoKSA9PiB7CiAgaWYgKCFpc1dvcmtlckluaXRpYWxpemVkKCkpIHsKICAgIHN0YXJ0KCgpID0+IHsKICAgICAgcmV0dXJuIHt9OwogICAgfSk7CiAgfQp9Owo=", p = "data:text/javascript;base64,aW1wb3J0IHsgaW5pdGlhbGl6ZSB9IGZyb20gJy4uLy4uL2NvbW1vbi9pbml0aWFsaXplLmpzJzsKaW1wb3J0IHsgSFRNTFdvcmtlciB9IGZyb20gJy4vaHRtbFdvcmtlci5qcyc7CgpzZWxmLm9ubWVzc2FnZSA9ICgpID0+IHsKICBpbml0aWFsaXplKChjdHgsIGNyZWF0ZURhdGEpID0+IHsKICAgIHJldHVybiBuZXcgSFRNTFdvcmtlcihjdHgsIGNyZWF0ZURhdGEpOwogIH0pOwp9Owo=", t = "data:text/javascript;base64,aW1wb3J0IHsgaW5pdGlhbGl6ZSB9IGZyb20gJy4uLy4uL2NvbW1vbi9pbml0aWFsaXplLmpzJzsKaW1wb3J0IHsgQ1NTV29ya2VyIH0gZnJvbSAnLi9jc3NXb3JrZXIuanMnOwoKc2VsZi5vbm1lc3NhZ2UgPSAoKSA9PiB7CiAgaW5pdGlhbGl6ZSgoY3R4LCBjcmVhdGVEYXRhKSA9PiB7CiAgICByZXR1cm4gbmV3IENTU1dvcmtlcihjdHgsIGNyZWF0ZURhdGEpOwogIH0pOwp9Owo=", g = "data:text/javascript;base64,aW1wb3J0IHsgaW5pdGlhbGl6ZSB9IGZyb20gJy4uLy4uL2NvbW1vbi9pbml0aWFsaXplLmpzJzsKaW1wb3J0IHsgSlNPTldvcmtlciB9IGZyb20gJy4vanNvbldvcmtlci5qcyc7CgpzZWxmLm9ubWVzc2FnZSA9ICgpID0+IHsKICBpbml0aWFsaXplKChjdHgsIGNyZWF0ZURhdGEpID0+IHsKICAgIHJldHVybiBuZXcgSlNPTldvcmtlcihjdHgsIGNyZWF0ZURhdGEpOwogIH0pOwp9Owo=", r = "data:text/javascript;base64,aW1wb3J0IHsgaW5pdGlhbGl6ZSB9IGZyb20gJy4uLy4uL2NvbW1vbi9pbml0aWFsaXplLmpzJzsKaW1wb3J0ICogYXMgdHlwZXNjcmlwdFNlcnZpY2VzIGZyb20gJy4vbGliL3R5cGVzY3JpcHRTZXJ2aWNlcy5qcyc7CmV4cG9ydCB7IHR5cGVzY3JpcHRTZXJ2aWNlcyBhcyB0cyB9OwppbXBvcnQgeyBjcmVhdGUgfSBmcm9tICcuL3RzV29ya2VyLmpzJzsKZXhwb3J0IHsgVHlwZVNjcmlwdFdvcmtlciB9IGZyb20gJy4vdHNXb3JrZXIuanMnOwpleHBvcnQgeyBsaWJGaWxlTWFwIH0gZnJvbSAnLi9saWIvbGliLmpzJzsKCnNlbGYub25tZXNzYWdlID0gKCkgPT4gewogIGluaXRpYWxpemUoKGN0eCwgY3JlYXRlRGF0YSkgPT4gewogICAgcmV0dXJuIGNyZWF0ZShjdHgsIGNyZWF0ZURhdGEpOwogIH0pOwp9OwoKZXhwb3J0IHsgY3JlYXRlLCBpbml0aWFsaXplIH07Cg==", I = () => new Worker(a, { type: "module" }), o = () => new Worker(p, { type: "module" }), W = () => new Worker(t, { type: "module" }), b = () => new Worker(g, { type: "module" }), e = () => new Worker(r, { type: "module" }), l = () => {
3
- try {
4
- self.MonacoEnvironment = {
5
- getWorker(s, c) {
6
- return c == "json" ? o() : c == "css" || c == "scss" || c == "less" ? W() : c == "html" || c == "handlebars" || c == "razor" ? b() : c == "typescript" || c == "javascript" ? e() : I();
7
- }
8
- };
9
- } catch (s) {
10
- console.log("initMonacoWorker资源加载失败", s);
2
+ const n = `import { isWorkerInitialized } from '../common/initialize.js';
3
+ export { initialize } from '../common/initialize.js';
4
+ import { start } from './editor.worker.start.js';
5
+
6
+ self.onmessage = () => {
7
+ if (!isWorkerInitialized()) {
8
+ start(() => {
9
+ return {};
10
+ });
11
11
  }
12
12
  };
13
+ `, o = `import { initialize } from '../../common/initialize.js';
14
+ import { HTMLWorker } from './htmlWorker.js';
15
+
16
+ self.onmessage = () => {
17
+ initialize((ctx, createData) => {
18
+ return new HTMLWorker(ctx, createData);
19
+ });
20
+ };
21
+ `, i = `import { initialize } from '../../common/initialize.js';
22
+ import { CSSWorker } from './cssWorker.js';
23
+
24
+ self.onmessage = () => {
25
+ initialize((ctx, createData) => {
26
+ return new CSSWorker(ctx, createData);
27
+ });
28
+ };
29
+ `, s = `import { initialize } from '../../common/initialize.js';
30
+ import { JSONWorker } from './jsonWorker.js';
31
+
32
+ self.onmessage = () => {
33
+ initialize((ctx, createData) => {
34
+ return new JSONWorker(ctx, createData);
35
+ });
36
+ };
37
+ `, a = `import { initialize } from '../../common/initialize.js';
38
+ import * as typescriptServices from './lib/typescriptServices.js';
39
+ export { typescriptServices as ts };
40
+ import { create } from './tsWorker.js';
41
+ export { TypeScriptWorker } from './tsWorker.js';
42
+ export { libFileMap } from './lib/lib.js';
43
+
44
+ self.onmessage = () => {
45
+ initialize((ctx, createData) => {
46
+ return create(ctx, createData);
47
+ });
48
+ };
49
+
50
+ export { create, initialize };
51
+ `, e = (t) => {
52
+ const r = new Blob([t], { type: "application/javascript" });
53
+ return new Worker(URL.createObjectURL(r), { type: "module" });
54
+ }, c = () => e(n), m = () => e(o), l = () => e(i), p = () => e(s), k = () => e(a), W = () => {
55
+ window.MonacoEnvironment = {
56
+ getWorker(t, r) {
57
+ switch (r) {
58
+ case "json":
59
+ return p();
60
+ case "css":
61
+ case "scss":
62
+ case "less":
63
+ return l();
64
+ case "html":
65
+ case "handlebars":
66
+ return m();
67
+ case "typescript":
68
+ case "javascript":
69
+ return k();
70
+ default:
71
+ return c();
72
+ }
73
+ }
74
+ };
75
+ };
13
76
  export {
14
- W as createCssWorker,
15
- I as createEditorWorker,
16
- o as createHtmlWorker,
17
- b as createJsonWorker,
18
- e as createTsWorker,
19
- l as initMonacoWorker
77
+ l as createCssWorker,
78
+ c as createEditorWorker,
79
+ m as createHtmlWorker,
80
+ p as createJsonWorker,
81
+ k as createTsWorker,
82
+ W as initMonacoWorker
20
83
  };
@@ -1 +1,50 @@
1
- (function(e,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("monaco-editor")):typeof define=="function"&&define.amd?define(["exports","monaco-editor"],r):(e=typeof globalThis<"u"?globalThis:e||self,r(e.monacoEditor11={},e.monacoEditor))})(this,(function(e,r){"use strict";const n="data:text/javascript;base64,aW1wb3J0IHsgaXNXb3JrZXJJbml0aWFsaXplZCB9IGZyb20gJy4uL2NvbW1vbi9pbml0aWFsaXplLmpzJzsKZXhwb3J0IHsgaW5pdGlhbGl6ZSB9IGZyb20gJy4uL2NvbW1vbi9pbml0aWFsaXplLmpzJzsKaW1wb3J0IHsgc3RhcnQgfSBmcm9tICcuL2VkaXRvci53b3JrZXIuc3RhcnQuanMnOwoKc2VsZi5vbm1lc3NhZ2UgPSAoKSA9PiB7CiAgaWYgKCFpc1dvcmtlckluaXRpYWxpemVkKCkpIHsKICAgIHN0YXJ0KCgpID0+IHsKICAgICAgcmV0dXJuIHt9OwogICAgfSk7CiAgfQp9Owo=",W="data:text/javascript;base64,aW1wb3J0IHsgaW5pdGlhbGl6ZSB9IGZyb20gJy4uLy4uL2NvbW1vbi9pbml0aWFsaXplLmpzJzsKaW1wb3J0IHsgSFRNTFdvcmtlciB9IGZyb20gJy4vaHRtbFdvcmtlci5qcyc7CgpzZWxmLm9ubWVzc2FnZSA9ICgpID0+IHsKICBpbml0aWFsaXplKChjdHgsIGNyZWF0ZURhdGEpID0+IHsKICAgIHJldHVybiBuZXcgSFRNTFdvcmtlcihjdHgsIGNyZWF0ZURhdGEpOwogIH0pOwp9Owo=",b="data:text/javascript;base64,aW1wb3J0IHsgaW5pdGlhbGl6ZSB9IGZyb20gJy4uLy4uL2NvbW1vbi9pbml0aWFsaXplLmpzJzsKaW1wb3J0IHsgQ1NTV29ya2VyIH0gZnJvbSAnLi9jc3NXb3JrZXIuanMnOwoKc2VsZi5vbm1lc3NhZ2UgPSAoKSA9PiB7CiAgaW5pdGlhbGl6ZSgoY3R4LCBjcmVhdGVEYXRhKSA9PiB7CiAgICByZXR1cm4gbmV3IENTU1dvcmtlcihjdHgsIGNyZWF0ZURhdGEpOwogIH0pOwp9Owo=",l="data:text/javascript;base64,aW1wb3J0IHsgaW5pdGlhbGl6ZSB9IGZyb20gJy4uLy4uL2NvbW1vbi9pbml0aWFsaXplLmpzJzsKaW1wb3J0IHsgSlNPTldvcmtlciB9IGZyb20gJy4vanNvbldvcmtlci5qcyc7CgpzZWxmLm9ubWVzc2FnZSA9ICgpID0+IHsKICBpbml0aWFsaXplKChjdHgsIGNyZWF0ZURhdGEpID0+IHsKICAgIHJldHVybiBuZXcgSlNPTldvcmtlcihjdHgsIGNyZWF0ZURhdGEpOwogIH0pOwp9Owo=",I="data:text/javascript;base64,aW1wb3J0IHsgaW5pdGlhbGl6ZSB9IGZyb20gJy4uLy4uL2NvbW1vbi9pbml0aWFsaXplLmpzJzsKaW1wb3J0ICogYXMgdHlwZXNjcmlwdFNlcnZpY2VzIGZyb20gJy4vbGliL3R5cGVzY3JpcHRTZXJ2aWNlcy5qcyc7CmV4cG9ydCB7IHR5cGVzY3JpcHRTZXJ2aWNlcyBhcyB0cyB9OwppbXBvcnQgeyBjcmVhdGUgfSBmcm9tICcuL3RzV29ya2VyLmpzJzsKZXhwb3J0IHsgVHlwZVNjcmlwdFdvcmtlciB9IGZyb20gJy4vdHNXb3JrZXIuanMnOwpleHBvcnQgeyBsaWJGaWxlTWFwIH0gZnJvbSAnLi9saWIvbGliLmpzJzsKCnNlbGYub25tZXNzYWdlID0gKCkgPT4gewogIGluaXRpYWxpemUoKGN0eCwgY3JlYXRlRGF0YSkgPT4gewogICAgcmV0dXJuIGNyZWF0ZShjdHgsIGNyZWF0ZURhdGEpOwogIH0pOwp9OwoKZXhwb3J0IHsgY3JlYXRlLCBpbml0aWFsaXplIH07Cg==",a=()=>new Worker(n,{type:"module"}),o=()=>new Worker(W,{type:"module"}),s=()=>new Worker(b,{type:"module"}),p=()=>new Worker(l,{type:"module"}),g=()=>new Worker(I,{type:"module"}),i=()=>{try{self.MonacoEnvironment={getWorker(t,c){return c=="json"?o():c=="css"||c=="scss"||c=="less"?s():c=="html"||c=="handlebars"||c=="razor"?p():c=="typescript"||c=="javascript"?g():a()}}}catch(t){console.log("initMonacoWorker资源加载失败",t)}};e.createCssWorker=s,e.createEditorWorker=a,e.createHtmlWorker=o,e.createJsonWorker=p,e.createTsWorker=g,e.initMonacoWorker=i,Object.keys(r).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:()=>r[t]})}),Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("monaco-editor")):typeof define=="function"&&define.amd?define(["exports","monaco-editor"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.monacoEditor11={},e.monacoEditor))})(this,(function(e,t){"use strict";const l=`import { isWorkerInitialized } from '../common/initialize.js';
2
+ export { initialize } from '../common/initialize.js';
3
+ import { start } from './editor.worker.start.js';
4
+
5
+ self.onmessage = () => {
6
+ if (!isWorkerInitialized()) {
7
+ start(() => {
8
+ return {};
9
+ });
10
+ }
11
+ };
12
+ `,f=`import { initialize } from '../../common/initialize.js';
13
+ import { HTMLWorker } from './htmlWorker.js';
14
+
15
+ self.onmessage = () => {
16
+ initialize((ctx, createData) => {
17
+ return new HTMLWorker(ctx, createData);
18
+ });
19
+ };
20
+ `,p=`import { initialize } from '../../common/initialize.js';
21
+ import { CSSWorker } from './cssWorker.js';
22
+
23
+ self.onmessage = () => {
24
+ initialize((ctx, createData) => {
25
+ return new CSSWorker(ctx, createData);
26
+ });
27
+ };
28
+ `,W=`import { initialize } from '../../common/initialize.js';
29
+ import { JSONWorker } from './jsonWorker.js';
30
+
31
+ self.onmessage = () => {
32
+ initialize((ctx, createData) => {
33
+ return new JSONWorker(ctx, createData);
34
+ });
35
+ };
36
+ `,k=`import { initialize } from '../../common/initialize.js';
37
+ import * as typescriptServices from './lib/typescriptServices.js';
38
+ export { typescriptServices as ts };
39
+ import { create } from './tsWorker.js';
40
+ export { TypeScriptWorker } from './tsWorker.js';
41
+ export { libFileMap } from './lib/lib.js';
42
+
43
+ self.onmessage = () => {
44
+ initialize((ctx, createData) => {
45
+ return create(ctx, createData);
46
+ });
47
+ };
48
+
49
+ export { create, initialize };
50
+ `,n=r=>{const o=new Blob([r],{type:"application/javascript"});return new Worker(URL.createObjectURL(o),{type:"module"})},i=()=>n(l),s=()=>n(f),a=()=>n(p),c=()=>n(W),m=()=>n(k),u=()=>{window.MonacoEnvironment={getWorker(r,o){switch(o){case"json":return c();case"css":case"scss":case"less":return a();case"html":case"handlebars":return s();case"typescript":case"javascript":return m();default:return i()}}}};e.createCssWorker=a,e.createEditorWorker=i,e.createHtmlWorker=s,e.createJsonWorker=c,e.createTsWorker=m,e.initMonacoWorker=u,Object.keys(t).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:()=>t[r]})}),Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
@@ -0,0 +1,8 @@
1
+ import { initialize } from '../../common/initialize.js';
2
+ import { CSSWorker } from './cssWorker.js';
3
+
4
+ self.onmessage = () => {
5
+ initialize((ctx, createData) => {
6
+ return new CSSWorker(ctx, createData);
7
+ });
8
+ };
@@ -0,0 +1,11 @@
1
+ import { isWorkerInitialized } from '../common/initialize.js';
2
+ export { initialize } from '../common/initialize.js';
3
+ import { start } from './editor.worker.start.js';
4
+
5
+ self.onmessage = () => {
6
+ if (!isWorkerInitialized()) {
7
+ start(() => {
8
+ return {};
9
+ });
10
+ }
11
+ };
@@ -0,0 +1,8 @@
1
+ import { initialize } from '../../common/initialize.js';
2
+ import { HTMLWorker } from './htmlWorker.js';
3
+
4
+ self.onmessage = () => {
5
+ initialize((ctx, createData) => {
6
+ return new HTMLWorker(ctx, createData);
7
+ });
8
+ };
@@ -0,0 +1,8 @@
1
+ import { initialize } from '../../common/initialize.js';
2
+ import { JSONWorker } from './jsonWorker.js';
3
+
4
+ self.onmessage = () => {
5
+ initialize((ctx, createData) => {
6
+ return new JSONWorker(ctx, createData);
7
+ });
8
+ };
@@ -0,0 +1,14 @@
1
+ import { initialize } from '../../common/initialize.js';
2
+ import * as typescriptServices from './lib/typescriptServices.js';
3
+ export { typescriptServices as ts };
4
+ import { create } from './tsWorker.js';
5
+ export { TypeScriptWorker } from './tsWorker.js';
6
+ export { libFileMap } from './lib/lib.js';
7
+
8
+ self.onmessage = () => {
9
+ initialize((ctx, createData) => {
10
+ return create(ctx, createData);
11
+ });
12
+ };
13
+
14
+ export { create, initialize };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monaco-editor11",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "private": false,
5
5
  "main": "dist/monaco-editor11.umd.js",
6
6
  "module": "dist/monaco-editor11.es.js",
@@ -16,7 +16,7 @@
16
16
  "dependencies": {
17
17
  "element-plus": "^2.10.7",
18
18
  "monaco-editor": "^0.55.1",
19
- "monaco-editor11": "^1.0.5",
19
+ "monaco-editor11": "^1.0.7",
20
20
  "pinia": "^2.1.36",
21
21
  "vue": "^3.5.13",
22
22
  "vue-virtual-scroller": "^2.0.0-beta.8",
@@ -27,6 +27,7 @@
27
27
  "@vitejs/plugin-vue": "^5.2.3",
28
28
  "@vue/tsconfig": "^0.7.0",
29
29
  "less": "^4.4.1",
30
+ "rollup-plugin-copy": "^3.5.0",
30
31
  "sass": "^1.93.2",
31
32
  "typescript": "~5.8.3",
32
33
  "vite": "^6.3.5",