@antv/layout 2.0.0-beta.1 → 2.0.0-beta.2
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.js +26 -13
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/worker.js +2 -2
- package/dist/worker.js.map +1 -1
- package/lib/algorithm/antv-dagre/rank/index.js +1 -1
- package/lib/algorithm/concentric/index.js +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/runtime/supervisor.js +26 -12
- package/lib/runtime/supervisor.js.map +1 -1
- package/lib/util/format.js +1 -1
- package/lib/worker.js +26 -12
- package/lib/worker.js.map +1 -1
- package/package.json +1 -1
- package/src/runtime/supervisor.ts +26 -11
package/dist/index.js
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Layout = {}));
|
|
5
5
|
})(this, (function (exports) { 'use strict';
|
|
6
6
|
|
|
7
|
-
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
8
7
|
/******************************************************************************
|
|
9
8
|
Copyright (c) Microsoft Corporation.
|
|
10
9
|
|
|
@@ -1664,23 +1663,37 @@
|
|
|
1664
1663
|
* Resolve worker script path which works in both ESM and UMD environments
|
|
1665
1664
|
*/
|
|
1666
1665
|
resolveWorkerPath() {
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
const
|
|
1671
|
-
if (
|
|
1672
|
-
return
|
|
1673
|
-
// Fallback: keep legacy behavior (same directory)
|
|
1674
|
-
return currentUrl.href.replace(/\/[^/]+\.js$/, '/worker.js');
|
|
1675
|
-
}
|
|
1676
|
-
if (typeof document !== 'undefined') {
|
|
1666
|
+
const scriptUrl = (() => {
|
|
1667
|
+
if (typeof document === 'undefined')
|
|
1668
|
+
return null;
|
|
1669
|
+
const currentScript = document.currentScript;
|
|
1670
|
+
if (currentScript === null || currentScript === void 0 ? void 0 : currentScript.src)
|
|
1671
|
+
return currentScript.src;
|
|
1677
1672
|
const scripts = document.getElementsByTagName('script');
|
|
1678
1673
|
for (let i = scripts.length - 1; i >= 0; i--) {
|
|
1679
1674
|
const src = scripts[i].src;
|
|
1680
|
-
if (src
|
|
1681
|
-
|
|
1675
|
+
if (!src)
|
|
1676
|
+
continue;
|
|
1677
|
+
if (src.includes('index.js') || src.includes('index.min.js')) {
|
|
1678
|
+
return src;
|
|
1682
1679
|
}
|
|
1683
1680
|
}
|
|
1681
|
+
return null;
|
|
1682
|
+
})();
|
|
1683
|
+
if (scriptUrl) {
|
|
1684
|
+
if (scriptUrl.includes('index.js') || scriptUrl.includes('index.min.js')) {
|
|
1685
|
+
const asIndex = scriptUrl.replace(/index(\.min)?\.(m?js)(\?.*)?$/, 'worker.js');
|
|
1686
|
+
if (asIndex !== scriptUrl)
|
|
1687
|
+
return asIndex;
|
|
1688
|
+
}
|
|
1689
|
+
// e.g. `.../lib/runtime/supervisor.js` -> `.../lib/worker.js`
|
|
1690
|
+
const asRoot = scriptUrl.replace(/\/runtime\/[^/]+\.(m?js)(\?.*)?$/, '/worker.js');
|
|
1691
|
+
if (asRoot !== scriptUrl)
|
|
1692
|
+
return asRoot;
|
|
1693
|
+
// Fallback: keep legacy behavior (same directory)
|
|
1694
|
+
const asSibling = scriptUrl.replace(/\/[^/]+\.(m?js)(\?.*)?$/, '/worker.js');
|
|
1695
|
+
if (asSibling !== scriptUrl)
|
|
1696
|
+
return asSibling;
|
|
1684
1697
|
}
|
|
1685
1698
|
return './worker.js';
|
|
1686
1699
|
}
|