iflow-engine 2.1.0 → 2.2.1

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.
@@ -118,10 +118,4 @@ export declare class Engine2d implements IBimComponent {
118
118
  * 清理资源、取消订阅、销毁引擎实例
119
119
  */
120
120
  destroy(): void;
121
- /**
122
- * 判断颜色字符串是否为深色
123
- * @param color CSS 颜色字符串
124
- * @returns 是否为深色
125
- */
126
- private isColorDark;
127
121
  }
@@ -49287,7 +49287,7 @@ class CT {
49287
49287
  */
49288
49288
  async loadModel(e, t = {}) {
49289
49289
  if (!e.includes(".json"))
49290
- Mu(e + "/info", (n) => {
49290
+ Mu(e, (n) => {
49291
49291
  const i = JSON.parse(n);
49292
49292
  this.engine.dwgData = i, this.data = i, this.buildScene(i), this.engine.fitToView(), this.engine.layerManager._loadLayers();
49293
49293
  });
@@ -57700,7 +57700,7 @@ class I4 {
57700
57700
  init() {
57701
57701
  this.container.innerHTML = "", this.wrapper = document.createElement("div"), this.wrapper.className = "bim-engine-wrapper", this.container.appendChild(this.wrapper);
57702
57702
  const e = document.createElement("div");
57703
- e.className = "bim-engine-version", e.textContent = "v2.1.0", this.wrapper.appendChild(e), this.sizeEl = document.createElement("div"), this.sizeEl.className = "bim-engine-size", this.wrapper.appendChild(this.sizeEl), this.updateClientSizeDisplay(), this.bindSizeObserver(), this.registry.container = this.container, this.registry.wrapper = this.wrapper, this.engine = new iA(this.wrapper, this.registry), this.dialog = new O0(this.wrapper, this.registry), this.toolbar = new N0(this.wrapper, this.registry), this.buttonGroup = new B0(this.wrapper, this.registry), this.rightKey = new b0(this.wrapper, this.registry), this.constructTreeBtn = new cA(this.wrapper, this.registry), this.measure = new dA(this.registry), this.sectionPlane = new pA(this.registry), this.sectionAxis = new mA(this.registry), this.sectionBox = new xA(this.registry), this.walkControl = new _A(this.registry), this.walkControl.init(), this.engineInfo = new MA(this.registry), this.engineInfo.init(), this.registry.engine3d = this.engine, this.registry.dialog = this.dialog, this.registry.toolbar = this.toolbar, this.registry.buttonGroup = this.buttonGroup, this.registry.rightKey = this.rightKey, this.registry.constructTree = this.constructTreeBtn, this.registry.measure = this.measure, this.registry.sectionPlane = this.sectionPlane, this.registry.sectionAxis = this.sectionAxis, this.registry.sectionBox = this.sectionBox, this.registry.walkControl = this.walkControl, this.registry.engineInfo = this.engineInfo, this.componentDetail = new PA(this.registry), this.registry.componentDetail = this.componentDetail, this.componentDetail.init(), this.aiChat = new LA(this.registry), this.registry.aiChat = this.aiChat, this.aiChat.init(), this.setting = new TA(this.registry), this.registry.setting = this.setting, this.setting.init(), this.updateTheme(tt.getTheme()), tt.subscribe((t) => {
57703
+ e.className = "bim-engine-version", e.textContent = "v2.2.1", this.wrapper.appendChild(e), this.sizeEl = document.createElement("div"), this.sizeEl.className = "bim-engine-size", this.wrapper.appendChild(this.sizeEl), this.updateClientSizeDisplay(), this.bindSizeObserver(), this.registry.container = this.container, this.registry.wrapper = this.wrapper, this.engine = new iA(this.wrapper, this.registry), this.dialog = new O0(this.wrapper, this.registry), this.toolbar = new N0(this.wrapper, this.registry), this.buttonGroup = new B0(this.wrapper, this.registry), this.rightKey = new b0(this.wrapper, this.registry), this.constructTreeBtn = new cA(this.wrapper, this.registry), this.measure = new dA(this.registry), this.sectionPlane = new pA(this.registry), this.sectionAxis = new mA(this.registry), this.sectionBox = new xA(this.registry), this.walkControl = new _A(this.registry), this.walkControl.init(), this.engineInfo = new MA(this.registry), this.engineInfo.init(), this.registry.engine3d = this.engine, this.registry.dialog = this.dialog, this.registry.toolbar = this.toolbar, this.registry.buttonGroup = this.buttonGroup, this.registry.rightKey = this.rightKey, this.registry.constructTree = this.constructTreeBtn, this.registry.measure = this.measure, this.registry.sectionPlane = this.sectionPlane, this.registry.sectionAxis = this.sectionAxis, this.registry.sectionBox = this.sectionBox, this.registry.walkControl = this.walkControl, this.registry.engineInfo = this.engineInfo, this.componentDetail = new PA(this.registry), this.registry.componentDetail = this.componentDetail, this.componentDetail.init(), this.aiChat = new LA(this.registry), this.registry.aiChat = this.aiChat, this.aiChat.init(), this.setting = new TA(this.registry), this.registry.setting = this.setting, this.setting.init(), this.updateTheme(tt.getTheme()), tt.subscribe((t) => {
57704
57704
  this.updateTheme(t);
57705
57705
  });
57706
57706
  }
@@ -57758,12 +57758,12 @@ class IA {
57758
57758
  */
57759
57759
  constructor(e, t) {
57760
57760
  this.registry = t, this.container = e.container, this.container.id ? this.containerId = this.container.id : (this.containerId = `engine2d-container-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, this.container.id = this.containerId), this.options = {
57761
- backgroundColor: e.backgroundColor ?? 16777215,
57761
+ backgroundColor: e.backgroundColor ?? 1710618,
57762
57762
  gridEnabled: e.gridEnabled ?? !0,
57763
- axesEnabled: e.axesEnabled ?? !1,
57763
+ axesEnabled: e.axesEnabled ?? !0,
57764
57764
  selectionColor: e.selectionColor,
57765
57765
  highlightColor: e.highlightColor,
57766
- enablePerformanceMonitoring: e.enablePerformanceMonitoring ?? !1
57766
+ enablePerformanceMonitoring: e.enablePerformanceMonitoring ?? !0
57767
57767
  };
57768
57768
  }
57769
57769
  /**
@@ -57804,15 +57804,6 @@ class IA {
57804
57804
  * @param _theme 全局主题配置
57805
57805
  */
57806
57806
  setTheme(e) {
57807
- if (!(!this._isInitialized || !this.engine))
57808
- try {
57809
- if (typeof this.engine.setTheme == "function") {
57810
- const t = e.bgBase ? this.isColorDark(e.bgBase) : !1;
57811
- this.engine.setTheme(t ? "dark" : "light");
57812
- }
57813
- } catch (t) {
57814
- console.warn("[Engine2d] Failed to set theme:", t);
57815
- }
57816
57807
  }
57817
57808
  /**
57818
57809
  * 设置语言 (接口实现)
@@ -57967,13 +57958,18 @@ class IA {
57967
57958
  * @param color CSS 颜色字符串
57968
57959
  * @returns 是否为深色
57969
57960
  */
57970
- isColorDark(e) {
57971
- if (e.includes("#")) {
57972
- const t = e.replace("#", ""), n = parseInt(t.substring(0, 2), 16) || 0, i = parseInt(t.substring(2, 4), 16) || 0, r = parseInt(t.substring(4, 6), 16) || 0;
57973
- return (0.299 * n + 0.587 * i + 0.114 * r) / 255 < 0.5;
57974
- }
57975
- return !1;
57976
- }
57961
+ // private isColorDark(color: string): boolean {
57962
+ // // 简单判断:如果包含常见深色关键字或数值较低则为深色
57963
+ // if (color.includes('#')) {
57964
+ // const hex = color.replace('#', '');
57965
+ // const r = parseInt(hex.substring(0, 2), 16) || 0;
57966
+ // const g = parseInt(hex.substring(2, 4), 16) || 0;
57967
+ // const b = parseInt(hex.substring(4, 6), 16) || 0;
57968
+ // const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
57969
+ // return luminance < 0.5;
57970
+ // }
57971
+ // return false;
57972
+ // }
57977
57973
  }
57978
57974
  class k4 {
57979
57975
  container;
@@ -57982,7 +57978,7 @@ class k4 {
57982
57978
  constructor(e, t) {
57983
57979
  const n = typeof e == "string" ? document.getElementById(e) : e;
57984
57980
  if (!n) throw new Error("Container not found");
57985
- this.container = n, this.registry = new Ru(), t?.locale && Zt.setLocale(t.locale), t?.theme && t.theme !== "custom" && tt.setTheme(t.theme), this.engineComponent = new IA({
57981
+ this.container = n, this.registry = new Ru(), t?.locale && Zt.setLocale(t.locale), t?.theme && t.theme !== "custom" && tt.setTheme(t.theme), console.log(123123123), console.log(t), this.engineComponent = new IA({
57986
57982
  container: this.container,
57987
57983
  backgroundColor: t?.backgroundColor,
57988
57984
  gridEnabled: t?.gridEnabled,