@omegagrid/code 0.4.46 → 0.5.0
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/loader.d.ts +7 -8
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +12 -7
- package/dist/loader.js.map +1 -1
- package/package.json +4 -4
package/dist/loader.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as monacoNS from 'monaco-editor';
|
|
2
2
|
export interface Require {
|
|
3
3
|
(paths: string[], callback?: () => void): void;
|
|
4
4
|
config: (options: {
|
|
@@ -7,17 +7,16 @@ export interface Require {
|
|
|
7
7
|
}
|
|
8
8
|
declare global {
|
|
9
9
|
interface Window {
|
|
10
|
-
monaco: typeof
|
|
11
|
-
require: Require;
|
|
10
|
+
monaco: typeof monacoNS;
|
|
12
11
|
}
|
|
13
12
|
}
|
|
14
13
|
export declare class MonacoLoader {
|
|
15
|
-
static
|
|
14
|
+
static monaco: typeof monacoNS;
|
|
16
15
|
static monacoStyle: string;
|
|
17
16
|
static monacoPath: string;
|
|
18
|
-
static
|
|
19
|
-
static
|
|
20
|
-
static
|
|
21
|
-
static load(): Promise<typeof
|
|
17
|
+
static init(path: string): void;
|
|
18
|
+
static get(): Promise<typeof monacoNS>;
|
|
19
|
+
static getSync(): typeof monacoNS;
|
|
20
|
+
static load(): Promise<typeof monacoNS>;
|
|
22
21
|
}
|
|
23
22
|
//# sourceMappingURL=loader.d.ts.map
|
package/dist/loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,QAAQ,MAAM,eAAe,CAAC;AAI/C,MAAM,WAAW,OAAO;IACvB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAC/C,MAAM,EAAE,CAAC,OAAO,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAC,KAAK,IAAI,CAAC;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QAClB,MAAM,EAAE,OAAO,QAAQ,CAAC;KACrB;CACJ;AAED,qBAAa,YAAY;IAExB,MAAM,CAAC,MAAM,EAAE,OAAO,QAAQ,CAAC;IAC/B,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC;IAC3B,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC;IAE1B,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM;WAYX,GAAG;IAKhB,MAAM,CAAC,OAAO;IAId,MAAM,CAAC,IAAI;CAiBX"}
|
package/dist/loader.js
CHANGED
|
@@ -4,8 +4,7 @@ exports.MonacoLoader = void 0;
|
|
|
4
4
|
const lit_1 = require("lit");
|
|
5
5
|
const core_1 = require("@omegagrid/core");
|
|
6
6
|
class MonacoLoader {
|
|
7
|
-
static init(
|
|
8
|
-
MonacoLoader.monacoLoader = loader;
|
|
7
|
+
static init(path) {
|
|
9
8
|
MonacoLoader.monacoPath = path;
|
|
10
9
|
MonacoLoader.monacoStyle = `@import "${(0, lit_1.unsafeCSS)(path)}/editor/editor.main.css"`;
|
|
11
10
|
core_1.dom.appendStyle(document.head, `
|
|
@@ -16,17 +15,23 @@ class MonacoLoader {
|
|
|
16
15
|
`);
|
|
17
16
|
}
|
|
18
17
|
static async get() {
|
|
19
|
-
if (!this.
|
|
20
|
-
this.
|
|
21
|
-
return this.
|
|
18
|
+
if (!this.monaco)
|
|
19
|
+
this.monaco = await this.load();
|
|
20
|
+
return this.monaco;
|
|
21
|
+
}
|
|
22
|
+
static getSync() {
|
|
23
|
+
return this.monaco;
|
|
22
24
|
}
|
|
23
25
|
static load() {
|
|
24
|
-
|
|
26
|
+
if (!core_1.AMD.require) {
|
|
27
|
+
throw new Error('AMDLoader is not initialized');
|
|
28
|
+
}
|
|
29
|
+
core_1.AMD.require.config({
|
|
25
30
|
paths: { 'vs': MonacoLoader.monacoPath },
|
|
26
31
|
'vs/css': { disabled: true }
|
|
27
32
|
});
|
|
28
33
|
return new Promise((resolve) => {
|
|
29
|
-
|
|
34
|
+
core_1.AMD.require(['vs/editor/editor.main'], () => {
|
|
30
35
|
resolve(self.monaco);
|
|
31
36
|
});
|
|
32
37
|
});
|
package/dist/loader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";;;AACA,6BAAgC;AAChC,
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";;;AACA,6BAAgC;AAChC,0CAA2C;AAa3C,MAAa,YAAY;IAMxB,MAAM,CAAC,IAAI,CAAC,IAAY;QACvB,YAAY,CAAC,UAAU,GAAG,IAAI,CAAC;QAC/B,YAAY,CAAC,WAAW,GAAG,YAAY,IAAA,eAAS,EAAC,IAAI,CAAC,0BAA0B,CAAC;QAEjF,UAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE;;;gBAGjB,IAAI;;GAEjB,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,GAAG;QACf,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAClD,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAED,MAAM,CAAC,OAAO;QACb,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAED,MAAM,CAAC,IAAI;QACV,IAAI,CAAC,UAAG,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;QACjD,CAAC;QAED,UAAG,CAAC,OAAO,CAAC,MAAM,CAAC;YAClB,KAAK,EAAE,EAAC,IAAI,EAAE,YAAY,CAAC,UAAU,EAAC;YACtC,QAAQ,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC;SAC1B,CAAC,CAAC;QAEH,OAAO,IAAI,OAAO,CAAkB,CAAC,OAAO,EAAE,EAAE;YAC/C,UAAG,CAAC,OAAO,CAAC,CAAC,uBAAuB,CAAC,EAAE,GAAG,EAAE;gBAC3C,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACtB,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC;CAED;AA5CD,oCA4CC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omegagrid/code",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "Monaco editor webcomponent",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@fortawesome/fontawesome-svg-core": "6.4.2",
|
|
31
|
-
"@omegagrid/core": "^0.
|
|
32
|
-
"@omegagrid/localize": "^0.
|
|
33
|
-
"@omegagrid/tree": "^0.
|
|
31
|
+
"@omegagrid/core": "^0.5.0",
|
|
32
|
+
"@omegagrid/localize": "^0.5.0",
|
|
33
|
+
"@omegagrid/tree": "^0.5.0",
|
|
34
34
|
"@riovir/wc-fontawesome": "^0.1.9",
|
|
35
35
|
"lit": "^3.1.1",
|
|
36
36
|
"monaco-editor": "0.47.0",
|