x4js 2.2.31 → 2.2.32

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/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "x4js",
3
- "version": "2.2.31",
3
+ "version": "2.2.32",
4
4
  "type": "module",
5
5
  "main": "src/x4.ts",
6
6
  "module": "src/x4.ts",
7
7
  "types": "src/x4.ts",
8
8
  "exports": {
9
- ".": "./src/x4.ts"
9
+ ".": "./src/x4.ts",
10
+ "./monaco": "./src/components/monaco/monaco.ts"
10
11
  },
11
12
  "scripts": {
12
13
  "build-publish": "deno run --allow-all ./publish.ts",
@@ -15,7 +15,7 @@ interface MonacoEditorProps extends ComponentProps {
15
15
  export class MonacoEditor extends Component<MonacoEditorProps> {
16
16
 
17
17
  static initCount = 0;
18
- static basePath: string = "./monaco";
18
+ static basePath: string = "monaco/";
19
19
  static monaco: typeof Monaco;
20
20
  static initCbs: Function[] = [];
21
21
 
@@ -26,7 +26,11 @@ export class MonacoEditor extends Component<MonacoEditorProps> {
26
26
  return;
27
27
  }
28
28
 
29
- this.monaco = (await import( this.basePath+"/monaco.js" )).default;
29
+ // path must be hard coded for esbuild to work
30
+ const dynamicImport = new Function("path", "return import('./'+path)");
31
+ this.monaco = (await dynamicImport(this.basePath + "monaco.js")).default;
32
+ //this.monaco = (await import(`${this.basePath}monaco.js`)).default;
33
+ //this.monaco = (await import( "./bin/monaco.js" )).default;
30
34
  this.initCount++;
31
35
 
32
36
  globalThis.MonacoEnvironment = {
@@ -49,7 +53,7 @@ export class MonacoEditor extends Component<MonacoEditorProps> {
49
53
  workerPath = "editor.worker.js";
50
54
  }
51
55
 
52
- const fullpath = MonacoEditor.basePath+'/workers/'+workerPath;
56
+ const fullpath = MonacoEditor.basePath+'workers/'+workerPath;
53
57
  console.log( `getting "${label} path: ${fullpath}` );
54
58
  return fullpath;
55
59
  }
@@ -58,7 +62,7 @@ export class MonacoEditor extends Component<MonacoEditorProps> {
58
62
  // custom append css
59
63
  const link = document.createElement('link');
60
64
  link.rel = 'stylesheet';
61
- link.href = MonacoEditor.basePath+'/monaco.css';
65
+ link.href = MonacoEditor.basePath+'monaco.css';
62
66
  link.type = 'text/css';
63
67
  document.head.appendChild(link);
64
68
  }