iflow-engine-base 3.9.16 → 3.9.18

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.
@@ -0,0 +1,84 @@
1
+ const c = "__BIM_ENGINE_SDK_ASSET_BASE__", d = "https://unpkg.com/iflow-engine-base@3.9.16/dist/";
2
+ function l() {
3
+ return typeof globalThis < "u" ? globalThis : null;
4
+ }
5
+ function u(t) {
6
+ return t.endsWith("/") ? t : `${t}/`;
7
+ }
8
+ function f(t) {
9
+ return /^(?:[a-z][a-z\d+\-.]*:)?\/\//i.test(t) || /^(?:data|blob):/i.test(t);
10
+ }
11
+ function g(t) {
12
+ return t.startsWith("./") || t.startsWith("../");
13
+ }
14
+ function o(t, e) {
15
+ try {
16
+ return e ? new URL(t, e).toString() : new URL(t).toString();
17
+ } catch {
18
+ return null;
19
+ }
20
+ }
21
+ function a() {
22
+ return typeof document < "u" && document.baseURI ? document.baseURI : typeof location < "u" && location.href ? location.href : null;
23
+ }
24
+ function S(t, e) {
25
+ const n = u(t);
26
+ if (f(n))
27
+ return n;
28
+ const r = s(e) || m() || a();
29
+ return o(n, r || void 0) || n;
30
+ }
31
+ function s(t) {
32
+ if (!t)
33
+ return null;
34
+ try {
35
+ const e = a(), n = o(t, e || void 0) || t, r = new URL(".", n), i = r.pathname.replace(/\\/g, "/");
36
+ return i.endsWith("/chunks/") ? new URL("../", r).toString() : e && /\/src\//.test(i) ? u(e) : r.toString();
37
+ } catch {
38
+ return null;
39
+ }
40
+ }
41
+ function m() {
42
+ if (typeof document > "u")
43
+ return null;
44
+ const t = document.currentScript;
45
+ if (t?.src)
46
+ return s(t.src);
47
+ const e = document.getElementsByTagName("script");
48
+ for (let n = e.length - 1; n >= 0; n -= 1) {
49
+ const r = e[n]?.src;
50
+ if (r && /(?:bim-engine-sdk|iflow-engine-base|dwg-preview|gaussian)\.(?:es|umd)\.js(?:[?#].*)?$/.test(r))
51
+ return s(r);
52
+ }
53
+ return null;
54
+ }
55
+ function _(t) {
56
+ const e = l();
57
+ if (e) {
58
+ if (!t) {
59
+ delete e[c];
60
+ return;
61
+ }
62
+ e[c] = u(t);
63
+ }
64
+ }
65
+ function B(t) {
66
+ const n = l()?.[c];
67
+ return typeof n == "string" && n.length > 0 ? S(n, t) : u(d);
68
+ }
69
+ function U(t, e) {
70
+ if (f(t))
71
+ return t;
72
+ if (g(t)) {
73
+ const i = o(t, s(e) || void 0);
74
+ if (i)
75
+ return i;
76
+ }
77
+ const n = t.replace(/^\/+/, ""), r = B(e);
78
+ return o(n, r) || n;
79
+ }
80
+ export {
81
+ B as g,
82
+ U as r,
83
+ _ as s
84
+ };
@@ -1,6 +1,6 @@
1
1
  import { R as qn, b as Ke, V as rt, s as Yn, aZ as Zn } from "./three-vendor-Dbcwwhki.js";
2
- import { J as qt } from "./engine-2d-Dgrlg-TS.js";
3
- import { a as Yt } from "./engine-3d-84WBL9lD.js";
2
+ import { J as qt } from "./engine-2d-Di06Ry30.js";
3
+ import { a as Yt } from "./engine-3d-Dp-2o5Fl.js";
4
4
  class Hu {
5
5
  /**
6
6
  * 构造函数
package/dist/index.d.ts CHANGED
@@ -1425,6 +1425,8 @@ declare interface Engine2dOptions {
1425
1425
  showStats?: boolean;
1426
1426
  /** 自定义字体 TTF 文件 URL,支持中文等完整 Unicode 字符 */
1427
1427
  fontUrl?: string;
1428
+ /** 覆盖 SDK 内置资源根路径,默认使用固定 CDN。 */
1429
+ assetBaseUrl?: string;
1428
1430
  /** 鼠标样式:full-crosshair 为全屏十字架,short-crosshair 为短十字架。 */
1429
1431
  cursorStyle?: CadCursorStyle2d;
1430
1432
  /** 加载进度条样式:1 为居中卡片,2 为底部进度条。 */
@@ -1443,6 +1445,8 @@ declare interface Engine2dOptions {
1443
1445
  declare interface Engine720Options {
1444
1446
  /** 容器 ID */
1445
1447
  containerId: string;
1448
+ /** 覆盖 SDK 内置资源根路径,默认使用固定 CDN。 */
1449
+ assetBaseUrl?: string;
1446
1450
  /** 初始视野角度(默认 75) */
1447
1451
  fov?: number;
1448
1452
  /** 是否启用缩放(默认 true) */
@@ -1471,6 +1475,8 @@ declare interface Engine720Options {
1471
1475
  */
1472
1476
  declare interface EngineGaussianOptions {
1473
1477
  containerId: string;
1478
+ /** 覆盖 SDK 内置资源根路径,默认使用固定 CDN。 */
1479
+ assetBaseUrl?: string;
1474
1480
  cameraUp?: GaussianVector3;
1475
1481
  initialCameraPosition?: GaussianVector3;
1476
1482
  initialCameraLookAt?: GaussianVector3;
@@ -1489,6 +1495,8 @@ declare interface EngineGaussianOptions {
1489
1495
  * 默认 provider 为 cesium,后续可在不破坏公开 API 的前提下扩展其他地图内核。
1490
1496
  */
1491
1497
  export declare interface EngineGISOptions extends GISContainerOptions {
1498
+ /** 覆盖 SDK 内置资源根路径,默认使用固定 CDN。 */
1499
+ assetBaseUrl?: string;
1492
1500
  provider?: 'cesium';
1493
1501
  accessToken?: string;
1494
1502
  cesiumBaseUrl?: string;
@@ -2866,7 +2874,7 @@ declare class GeoJsonModelLoaderGIS {
2866
2874
  }
2867
2875
 
2868
2876
  /**
2869
- * 获取 SDK 内置 public 资源根路径,默认从当前 SDK 脚本或 chunk URL 自动推导。
2877
+ * 获取 SDK 内置 public 资源根路径,默认使用版本固定的 CDN。
2870
2878
  */
2871
2879
  export declare function getSdkAssetBaseUrl(moduleUrl?: string): string;
2872
2880