@itwin/core-frontend 3.3.0-dev.3 → 3.3.0-dev.4

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.
@@ -1,9 +1,11 @@
1
1
  /**
2
- * Executes an extension's bundled javascript module.
3
- * First attempts an ES6 dynamic import,
4
- * second attempts a dynamic import via a script element as a fallback.
2
+ * Imports and executes a bundled javascript (esm) module.
5
3
  * Used by remote and service Extensions.
6
- * Throws an error if the module does not have a default or main function to execute.
4
+ * Throws an error if no function is found to execute.
5
+ * Looks for a function in the following order:
6
+ * - the module itself.
7
+ * - the module's main export.
8
+ * - the module's default export.
7
9
  * @internal
8
10
  */
9
11
  export declare function loadScript(jsUrl: string): Promise<any>;
@@ -1 +1 @@
1
- {"version":3,"file":"ExtensionLoadScript.d.ts","sourceRoot":"","sources":["../../../../src/extension/providers/ExtensionLoadScript.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAiC5D"}
1
+ {"version":3,"file":"ExtensionLoadScript.d.ts","sourceRoot":"","sources":["../../../../src/extension/providers/ExtensionLoadScript.ts"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAQ5D"}
@@ -1,48 +1,31 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.loadScript = void 0;
4
2
  /*---------------------------------------------------------------------------------------------
5
3
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
4
  * See LICENSE.md in the project root for license terms and full copyright notice.
7
5
  *--------------------------------------------------------------------------------------------*/
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.loadScript = void 0;
8
8
  /**
9
- * Executes an extension's bundled javascript module.
10
- * First attempts an ES6 dynamic import,
11
- * second attempts a dynamic import via a script element as a fallback.
9
+ * Imports and executes a bundled javascript (esm) module.
12
10
  * Used by remote and service Extensions.
13
- * Throws an error if the module does not have a default or main function to execute.
11
+ * Throws an error if no function is found to execute.
12
+ * Looks for a function in the following order:
13
+ * - the module itself.
14
+ * - the module's main export.
15
+ * - the module's default export.
14
16
  * @internal
15
17
  */
16
18
  async function loadScript(jsUrl) {
17
- // Warning "Critical dependency: the request of a dependency is an expression"
18
- // until that is resolved, leave code commented:
19
19
  // const module = await import(/* webpackIgnore: true */jsUrl);
20
- // return execute(module);
21
- return new Promise((resolve, reject) => {
22
- const head = document.getElementsByTagName("head")[0];
23
- if (!head)
24
- reject(new Error("No head element found"));
25
- const scriptElement = document.createElement("script");
26
- const tempGlobal = `__tempModuleLoadingVariable${Math.random().toString(32).substring(2)}`;
27
- function cleanup() {
28
- delete window[tempGlobal];
29
- scriptElement.remove();
30
- }
31
- window[tempGlobal] = async function (module) {
32
- await execute(module);
33
- cleanup();
34
- resolve(module);
35
- };
36
- scriptElement.type = "module";
37
- scriptElement.textContent = `import * as m from "${jsUrl}";window.${tempGlobal}(m);`;
38
- scriptElement.onerror = () => {
39
- reject(new Error(`Failed to load extension with URL ${jsUrl}`));
40
- cleanup();
41
- };
42
- head.insertBefore(scriptElement, head.lastChild);
43
- });
20
+ // Webpack gives a warning:
21
+ // "Critical dependency: the request of a dependency is an expression"
22
+ // Because tsc transpiles "await import" to "require" (when compiled to is CommonJS).
23
+ // So use FunctionConstructor to avoid tsc.
24
+ const module = await Function("x", "return import(x)")(jsUrl);
25
+ return execute(module);
44
26
  }
45
27
  exports.loadScript = loadScript;
28
+ /** attempts to execute an extension module */
46
29
  function execute(m) {
47
30
  if (typeof m === "function")
48
31
  return m();
@@ -50,6 +33,6 @@ function execute(m) {
50
33
  return m.main();
51
34
  if (m.default && typeof m.default === "function")
52
35
  return m.default();
53
- throw new Error(`Failed to load extension. No default function was found to execute.`);
36
+ throw new Error(`Failed to execute extension. No default function was found to execute.`);
54
37
  }
55
38
  //# sourceMappingURL=ExtensionLoadScript.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExtensionLoadScript.js","sourceRoot":"","sources":["../../../../src/extension/providers/ExtensionLoadScript.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;;;;;;GAOG;AACI,KAAK,UAAU,UAAU,CAAC,KAAa;IAC5C,8EAA8E;IAC9E,gDAAgD;IAChD,+DAA+D;IAC/D,0BAA0B;IAC1B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,IAAI,GAAG,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI;YACP,MAAM,CAAC,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC;QAE7C,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QACvD,MAAM,UAAU,GAAW,8BAA8B,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;QAEnG,SAAS,OAAO;YACd,OAAQ,MAAc,CAAC,UAAU,CAAC,CAAC;YACnC,aAAa,CAAC,MAAM,EAAE,CAAC;QACzB,CAAC;QAEA,MAAc,CAAC,UAAU,CAAC,GAAG,KAAK,WAAW,MAAW;YACvD,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;YACtB,OAAO,EAAE,CAAC;YACV,OAAO,CAAC,MAAM,CAAC,CAAC;QAClB,CAAC,CAAC;QACF,aAAa,CAAC,IAAI,GAAG,QAAQ,CAAC;QAC9B,aAAa,CAAC,WAAW,GAAG,uBAAuB,KAAK,YAAY,UAAU,MAAM,CAAC;QAErF,aAAa,CAAC,OAAO,GAAG,GAAG,EAAE;YAC3B,MAAM,CAAC,IAAI,KAAK,CAAC,qCAAqC,KAAK,EAAE,CAAC,CAAC,CAAC;YAChE,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC;QAEF,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC;AAjCD,gCAiCC;AAED,SAAS,OAAO,CAAC,CAAM;IACrB,IAAI,OAAO,CAAC,KAAK,UAAU;QACzB,OAAO,CAAC,EAAE,CAAC;IACb,IAAI,CAAC,CAAC,IAAI,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU;QACxC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;IAClB,IAAI,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,UAAU;QAC9C,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC;IACrB,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;AACzF,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/**\r\n * Executes an extension's bundled javascript module.\r\n * First attempts an ES6 dynamic import,\r\n * second attempts a dynamic import via a script element as a fallback.\r\n * Used by remote and service Extensions.\r\n * Throws an error if the module does not have a default or main function to execute.\r\n * @internal\r\n */\r\nexport async function loadScript(jsUrl: string): Promise<any> {\r\n // Warning \"Critical dependency: the request of a dependency is an expression\"\r\n // until that is resolved, leave code commented:\r\n // const module = await import(/* webpackIgnore: true */jsUrl);\r\n // return execute(module);\r\n return new Promise((resolve, reject) => {\r\n const head = document.getElementsByTagName(\"head\")[0];\r\n if (!head)\r\n reject(new Error(\"No head element found\"));\r\n\r\n const scriptElement = document.createElement(\"script\");\r\n const tempGlobal: string = `__tempModuleLoadingVariable${Math.random().toString(32).substring(2)}`;\r\n\r\n function cleanup() {\r\n delete (window as any)[tempGlobal];\r\n scriptElement.remove();\r\n }\r\n\r\n (window as any)[tempGlobal] = async function (module: any) {\r\n await execute(module);\r\n cleanup();\r\n resolve(module);\r\n };\r\n scriptElement.type = \"module\";\r\n scriptElement.textContent = `import * as m from \"${jsUrl}\";window.${tempGlobal}(m);`;\r\n\r\n scriptElement.onerror = () => {\r\n reject(new Error(`Failed to load extension with URL ${jsUrl}`));\r\n cleanup();\r\n };\r\n\r\n head.insertBefore(scriptElement, head.lastChild);\r\n });\r\n}\r\n\r\nfunction execute(m: any) {\r\n if (typeof m === \"function\")\r\n return m();\r\n if (m.main && typeof m.main === \"function\")\r\n return m.main();\r\n if (m.default && typeof m.default === \"function\")\r\n return m.default();\r\n throw new Error(`Failed to load extension. No default function was found to execute.`);\r\n}\r\n"]}
1
+ {"version":3,"file":"ExtensionLoadScript.js","sourceRoot":"","sources":["../../../../src/extension/providers/ExtensionLoadScript.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;;;;;;;;GASG;AACI,KAAK,UAAU,UAAU,CAAC,KAAa;IAC5C,+DAA+D;IAC/D,2BAA2B;IAC3B,sEAAsE;IACtE,qFAAqF;IACrF,2CAA2C;IAC3C,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,GAAG,EAAC,kBAAkB,CAAC,CAAC,KAAK,CAAC,CAAC;IAC7D,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;AACzB,CAAC;AARD,gCAQC;AAED,8CAA8C;AAC9C,SAAS,OAAO,CAAC,CAAM;IACrB,IAAI,OAAO,CAAC,KAAK,UAAU;QACzB,OAAO,CAAC,EAAE,CAAC;IACb,IAAI,CAAC,CAAC,IAAI,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU;QACxC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;IAClB,IAAI,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,UAAU;QAC9C,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC;IACrB,MAAM,IAAI,KAAK,CACb,wEAAwE,CACzE,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/**\r\n * Imports and executes a bundled javascript (esm) module.\r\n * Used by remote and service Extensions.\r\n * Throws an error if no function is found to execute.\r\n * Looks for a function in the following order:\r\n * - the module itself.\r\n * - the module's main export.\r\n * - the module's default export.\r\n * @internal\r\n */\r\nexport async function loadScript(jsUrl: string): Promise<any> {\r\n // const module = await import(/* webpackIgnore: true */jsUrl);\r\n // Webpack gives a warning:\r\n // \"Critical dependency: the request of a dependency is an expression\"\r\n // Because tsc transpiles \"await import\" to \"require\" (when compiled to is CommonJS).\r\n // So use FunctionConstructor to avoid tsc.\r\n const module = await Function(\"x\",\"return import(x)\")(jsUrl);\r\n return execute(module);\r\n}\r\n\r\n/** attempts to execute an extension module */\r\nfunction execute(m: any) {\r\n if (typeof m === \"function\")\r\n return m();\r\n if (m.main && typeof m.main === \"function\")\r\n return m.main();\r\n if (m.default && typeof m.default === \"function\")\r\n return m.default();\r\n throw new Error(\r\n `Failed to execute extension. No default function was found to execute.`\r\n );\r\n}\r\n"]}
@@ -1,9 +1,11 @@
1
1
  /**
2
- * Executes an extension's bundled javascript module.
3
- * First attempts an ES6 dynamic import,
4
- * second attempts a dynamic import via a script element as a fallback.
2
+ * Imports and executes a bundled javascript (esm) module.
5
3
  * Used by remote and service Extensions.
6
- * Throws an error if the module does not have a default or main function to execute.
4
+ * Throws an error if no function is found to execute.
5
+ * Looks for a function in the following order:
6
+ * - the module itself.
7
+ * - the module's main export.
8
+ * - the module's default export.
7
9
  * @internal
8
10
  */
9
11
  export declare function loadScript(jsUrl: string): Promise<any>;
@@ -1 +1 @@
1
- {"version":3,"file":"ExtensionLoadScript.d.ts","sourceRoot":"","sources":["../../../../src/extension/providers/ExtensionLoadScript.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAiC5D"}
1
+ {"version":3,"file":"ExtensionLoadScript.d.ts","sourceRoot":"","sources":["../../../../src/extension/providers/ExtensionLoadScript.ts"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAQ5D"}
@@ -3,42 +3,25 @@
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  /**
6
- * Executes an extension's bundled javascript module.
7
- * First attempts an ES6 dynamic import,
8
- * second attempts a dynamic import via a script element as a fallback.
6
+ * Imports and executes a bundled javascript (esm) module.
9
7
  * Used by remote and service Extensions.
10
- * Throws an error if the module does not have a default or main function to execute.
8
+ * Throws an error if no function is found to execute.
9
+ * Looks for a function in the following order:
10
+ * - the module itself.
11
+ * - the module's main export.
12
+ * - the module's default export.
11
13
  * @internal
12
14
  */
13
15
  export async function loadScript(jsUrl) {
14
- // Warning "Critical dependency: the request of a dependency is an expression"
15
- // until that is resolved, leave code commented:
16
16
  // const module = await import(/* webpackIgnore: true */jsUrl);
17
- // return execute(module);
18
- return new Promise((resolve, reject) => {
19
- const head = document.getElementsByTagName("head")[0];
20
- if (!head)
21
- reject(new Error("No head element found"));
22
- const scriptElement = document.createElement("script");
23
- const tempGlobal = `__tempModuleLoadingVariable${Math.random().toString(32).substring(2)}`;
24
- function cleanup() {
25
- delete window[tempGlobal];
26
- scriptElement.remove();
27
- }
28
- window[tempGlobal] = async function (module) {
29
- await execute(module);
30
- cleanup();
31
- resolve(module);
32
- };
33
- scriptElement.type = "module";
34
- scriptElement.textContent = `import * as m from "${jsUrl}";window.${tempGlobal}(m);`;
35
- scriptElement.onerror = () => {
36
- reject(new Error(`Failed to load extension with URL ${jsUrl}`));
37
- cleanup();
38
- };
39
- head.insertBefore(scriptElement, head.lastChild);
40
- });
17
+ // Webpack gives a warning:
18
+ // "Critical dependency: the request of a dependency is an expression"
19
+ // Because tsc transpiles "await import" to "require" (when compiled to is CommonJS).
20
+ // So use FunctionConstructor to avoid tsc.
21
+ const module = await Function("x", "return import(x)")(jsUrl);
22
+ return execute(module);
41
23
  }
24
+ /** attempts to execute an extension module */
42
25
  function execute(m) {
43
26
  if (typeof m === "function")
44
27
  return m();
@@ -46,6 +29,6 @@ function execute(m) {
46
29
  return m.main();
47
30
  if (m.default && typeof m.default === "function")
48
31
  return m.default();
49
- throw new Error(`Failed to load extension. No default function was found to execute.`);
32
+ throw new Error(`Failed to execute extension. No default function was found to execute.`);
50
33
  }
51
34
  //# sourceMappingURL=ExtensionLoadScript.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExtensionLoadScript.js","sourceRoot":"","sources":["../../../../src/extension/providers/ExtensionLoadScript.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,KAAa;IAC5C,8EAA8E;IAC9E,gDAAgD;IAChD,+DAA+D;IAC/D,0BAA0B;IAC1B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,IAAI,GAAG,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI;YACP,MAAM,CAAC,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC;QAE7C,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QACvD,MAAM,UAAU,GAAW,8BAA8B,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;QAEnG,SAAS,OAAO;YACd,OAAQ,MAAc,CAAC,UAAU,CAAC,CAAC;YACnC,aAAa,CAAC,MAAM,EAAE,CAAC;QACzB,CAAC;QAEA,MAAc,CAAC,UAAU,CAAC,GAAG,KAAK,WAAW,MAAW;YACvD,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;YACtB,OAAO,EAAE,CAAC;YACV,OAAO,CAAC,MAAM,CAAC,CAAC;QAClB,CAAC,CAAC;QACF,aAAa,CAAC,IAAI,GAAG,QAAQ,CAAC;QAC9B,aAAa,CAAC,WAAW,GAAG,uBAAuB,KAAK,YAAY,UAAU,MAAM,CAAC;QAErF,aAAa,CAAC,OAAO,GAAG,GAAG,EAAE;YAC3B,MAAM,CAAC,IAAI,KAAK,CAAC,qCAAqC,KAAK,EAAE,CAAC,CAAC,CAAC;YAChE,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC;QAEF,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,OAAO,CAAC,CAAM;IACrB,IAAI,OAAO,CAAC,KAAK,UAAU;QACzB,OAAO,CAAC,EAAE,CAAC;IACb,IAAI,CAAC,CAAC,IAAI,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU;QACxC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;IAClB,IAAI,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,UAAU;QAC9C,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC;IACrB,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;AACzF,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/**\r\n * Executes an extension's bundled javascript module.\r\n * First attempts an ES6 dynamic import,\r\n * second attempts a dynamic import via a script element as a fallback.\r\n * Used by remote and service Extensions.\r\n * Throws an error if the module does not have a default or main function to execute.\r\n * @internal\r\n */\r\nexport async function loadScript(jsUrl: string): Promise<any> {\r\n // Warning \"Critical dependency: the request of a dependency is an expression\"\r\n // until that is resolved, leave code commented:\r\n // const module = await import(/* webpackIgnore: true */jsUrl);\r\n // return execute(module);\r\n return new Promise((resolve, reject) => {\r\n const head = document.getElementsByTagName(\"head\")[0];\r\n if (!head)\r\n reject(new Error(\"No head element found\"));\r\n\r\n const scriptElement = document.createElement(\"script\");\r\n const tempGlobal: string = `__tempModuleLoadingVariable${Math.random().toString(32).substring(2)}`;\r\n\r\n function cleanup() {\r\n delete (window as any)[tempGlobal];\r\n scriptElement.remove();\r\n }\r\n\r\n (window as any)[tempGlobal] = async function (module: any) {\r\n await execute(module);\r\n cleanup();\r\n resolve(module);\r\n };\r\n scriptElement.type = \"module\";\r\n scriptElement.textContent = `import * as m from \"${jsUrl}\";window.${tempGlobal}(m);`;\r\n\r\n scriptElement.onerror = () => {\r\n reject(new Error(`Failed to load extension with URL ${jsUrl}`));\r\n cleanup();\r\n };\r\n\r\n head.insertBefore(scriptElement, head.lastChild);\r\n });\r\n}\r\n\r\nfunction execute(m: any) {\r\n if (typeof m === \"function\")\r\n return m();\r\n if (m.main && typeof m.main === \"function\")\r\n return m.main();\r\n if (m.default && typeof m.default === \"function\")\r\n return m.default();\r\n throw new Error(`Failed to load extension. No default function was found to execute.`);\r\n}\r\n"]}
1
+ {"version":3,"file":"ExtensionLoadScript.js","sourceRoot":"","sources":["../../../../src/extension/providers/ExtensionLoadScript.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,KAAa;IAC5C,+DAA+D;IAC/D,2BAA2B;IAC3B,sEAAsE;IACtE,qFAAqF;IACrF,2CAA2C;IAC3C,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,GAAG,EAAC,kBAAkB,CAAC,CAAC,KAAK,CAAC,CAAC;IAC7D,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;AACzB,CAAC;AAED,8CAA8C;AAC9C,SAAS,OAAO,CAAC,CAAM;IACrB,IAAI,OAAO,CAAC,KAAK,UAAU;QACzB,OAAO,CAAC,EAAE,CAAC;IACb,IAAI,CAAC,CAAC,IAAI,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU;QACxC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;IAClB,IAAI,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,UAAU;QAC9C,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC;IACrB,MAAM,IAAI,KAAK,CACb,wEAAwE,CACzE,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/**\r\n * Imports and executes a bundled javascript (esm) module.\r\n * Used by remote and service Extensions.\r\n * Throws an error if no function is found to execute.\r\n * Looks for a function in the following order:\r\n * - the module itself.\r\n * - the module's main export.\r\n * - the module's default export.\r\n * @internal\r\n */\r\nexport async function loadScript(jsUrl: string): Promise<any> {\r\n // const module = await import(/* webpackIgnore: true */jsUrl);\r\n // Webpack gives a warning:\r\n // \"Critical dependency: the request of a dependency is an expression\"\r\n // Because tsc transpiles \"await import\" to \"require\" (when compiled to is CommonJS).\r\n // So use FunctionConstructor to avoid tsc.\r\n const module = await Function(\"x\",\"return import(x)\")(jsUrl);\r\n return execute(module);\r\n}\r\n\r\n/** attempts to execute an extension module */\r\nfunction execute(m: any) {\r\n if (typeof m === \"function\")\r\n return m();\r\n if (m.main && typeof m.main === \"function\")\r\n return m.main();\r\n if (m.default && typeof m.default === \"function\")\r\n return m.default();\r\n throw new Error(\r\n `Failed to execute extension. No default function was found to execute.`\r\n );\r\n}\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/core-frontend",
3
- "version": "3.3.0-dev.3",
3
+ "version": "3.3.0-dev.4",
4
4
  "description": "iTwin.js frontend components",
5
5
  "main": "lib/cjs/core-frontend.js",
6
6
  "module": "lib/esm/core-frontend.js",
@@ -22,29 +22,29 @@
22
22
  "url": "http://www.bentley.com"
23
23
  },
24
24
  "peerDependencies": {
25
- "@itwin/appui-abstract": "^3.3.0-dev.3",
26
- "@itwin/core-bentley": "^3.3.0-dev.3",
27
- "@itwin/core-common": "^3.3.0-dev.3",
28
- "@itwin/core-geometry": "^3.3.0-dev.3",
29
- "@itwin/core-orbitgt": "^3.3.0-dev.3",
30
- "@itwin/core-quantity": "^3.3.0-dev.3",
31
- "@itwin/webgl-compatibility": "^3.3.0-dev.3"
25
+ "@itwin/appui-abstract": "^3.3.0-dev.4",
26
+ "@itwin/core-bentley": "^3.3.0-dev.4",
27
+ "@itwin/core-common": "^3.3.0-dev.4",
28
+ "@itwin/core-geometry": "^3.3.0-dev.4",
29
+ "@itwin/core-orbitgt": "^3.3.0-dev.4",
30
+ "@itwin/core-quantity": "^3.3.0-dev.4",
31
+ "@itwin/webgl-compatibility": "^3.3.0-dev.4"
32
32
  },
33
33
  "//devDependencies": [
34
34
  "NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install",
35
35
  "NOTE: All tools used by scripts in this package must be listed as devDependencies"
36
36
  ],
37
37
  "devDependencies": {
38
- "@itwin/appui-abstract": "3.3.0-dev.3",
39
- "@itwin/build-tools": "3.3.0-dev.3",
40
- "@itwin/core-bentley": "3.3.0-dev.3",
41
- "@itwin/core-common": "3.3.0-dev.3",
42
- "@itwin/core-geometry": "3.3.0-dev.3",
43
- "@itwin/core-orbitgt": "3.3.0-dev.3",
44
- "@itwin/core-quantity": "3.3.0-dev.3",
45
- "@itwin/certa": "3.3.0-dev.3",
46
- "@itwin/eslint-plugin": "3.3.0-dev.3",
47
- "@itwin/webgl-compatibility": "3.3.0-dev.3",
38
+ "@itwin/appui-abstract": "3.3.0-dev.4",
39
+ "@itwin/build-tools": "3.3.0-dev.4",
40
+ "@itwin/core-bentley": "3.3.0-dev.4",
41
+ "@itwin/core-common": "3.3.0-dev.4",
42
+ "@itwin/core-geometry": "3.3.0-dev.4",
43
+ "@itwin/core-orbitgt": "3.3.0-dev.4",
44
+ "@itwin/core-quantity": "3.3.0-dev.4",
45
+ "@itwin/certa": "3.3.0-dev.4",
46
+ "@itwin/eslint-plugin": "3.3.0-dev.4",
47
+ "@itwin/webgl-compatibility": "3.3.0-dev.4",
48
48
  "@types/chai": "^4.1.4",
49
49
  "@types/chai-as-promised": "^7",
50
50
  "@types/deep-assign": "^0.1.0",
@@ -73,8 +73,8 @@
73
73
  "NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"
74
74
  ],
75
75
  "dependencies": {
76
- "@itwin/core-i18n": "3.3.0-dev.3",
77
- "@itwin/core-telemetry": "3.3.0-dev.3",
76
+ "@itwin/core-i18n": "3.3.0-dev.4",
77
+ "@itwin/core-telemetry": "3.3.0-dev.4",
78
78
  "@loaders.gl/core": "^3.1.6",
79
79
  "@loaders.gl/draco": "^3.1.6",
80
80
  "deep-assign": "^2.0.0",