archgine 1.0.55 → 1.0.56

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.
@@ -4008,7 +4008,7 @@ Fu.__DOMHandler = Eu;
4008
4008
  Fu.normalizeLineEndings = Le;
4009
4009
  Fu.DOMParser = Ie;
4010
4010
  var gr = Fu.DOMParser;
4011
- const Er = "1.0.55";
4011
+ const Er = "1.0.56";
4012
4012
  function vr() {
4013
4013
  return typeof window < "u" && ({}.toString.call(window) === "[object Window]" || {}.toString.call(window) === "[object global]");
4014
4014
  }
@@ -17,7 +17,7 @@ export interface IApp {
17
17
  selectByIds(ids: string | string[]): void;
18
18
  clearSelectedByIds(ids: string | string[]): void;
19
19
  getSelectedIds(): string[] | undefined;
20
- targetByIds(id: string | string[]): void;
20
+ targetByIds(id: string | string[], padding?: number): void;
21
21
  linkAssetsByTree(o: ITree): void;
22
22
  setFillByIds(ids: string[], c: string): void;
23
23
  clearFill(): void;
@@ -53,7 +53,7 @@ export declare class SvgApp<Config extends ISvgAppConfig> extends EventDispatche
53
53
  clearSelectedByIds(ids: string | string[]): void;
54
54
  clearSelected(): void;
55
55
  getSelectedIds(): string[] | undefined;
56
- targetByIds(ids: string | string[]): Promise<void>;
56
+ targetByIds(ids: string | string[], padding?: number): Promise<void>;
57
57
  linkAssetsByTree(o?: ITree): void;
58
58
  setViewAreaLimit(v: number): void;
59
59
  setAssetType(assetType: string, showLayers?: string[]): void;
@@ -7,6 +7,7 @@ export declare class SvgHelper extends EventDispatcher {
7
7
  resources: IObject2[];
8
8
  resourcesMap: Record<string, IObject2>;
9
9
  boundingBox: Box2;
10
+ private _styles?;
10
11
  private _traverseMap;
11
12
  private _elementsMap;
12
13
  private _tic?;
@@ -14,7 +15,7 @@ export declare class SvgHelper extends EventDispatcher {
14
15
  private static _instance;
15
16
  static get instance(): SvgHelper;
16
17
  static parse(str: string): SvgHelper;
17
- static init(svg: Element): SvgHelper;
18
+ static init(svg?: Element): SvgHelper;
18
19
  initResources(): SvgHelper;
19
20
  initResource(el: Element): IObject2 | undefined;
20
21
  initResourcesSlice(): Promise<void>;
@@ -40,4 +41,6 @@ export declare class SvgHelper extends EventDispatcher {
40
41
  * 3、use 'assetId' + SPLITTER + LABEL_TAG save to elementsMap;
41
42
  */
42
43
  transText(el?: Element, flipY?: boolean): IObject2 | undefined;
44
+ getElementFontSize(el?: Element): number;
45
+ getStyleFontSize(cls: string): number;
43
46
  }
package/lib/index.mjs CHANGED
@@ -4008,7 +4008,7 @@ iu.__DOMHandler = Ra;
4008
4008
  iu.normalizeLineEndings = vd;
4009
4009
  iu.DOMParser = xd;
4010
4010
  var Hx = iu.DOMParser;
4011
- const qx = "1.0.55";
4011
+ const qx = "1.0.56";
4012
4012
  function Wx() {
4013
4013
  return typeof window < "u" && ({}.toString.call(window) === "[object Window]" || {}.toString.call(window) === "[object global]");
4014
4014
  }
@@ -16995,7 +16995,7 @@ class yb {
16995
16995
  i && (vs.copy(JSON.parse(i)), this.resetCameraByBoundingBox(vs, !0));
16996
16996
  }
16997
16997
  fullscreen(t = 10, e = !1) {
16998
- this.scene && (this.scene.boundingBox.isEmpty() && this.scene.computeBoundingBox(), vs.copy(this.scene.boundingBox).expandByVector(Ho.set(t, t)), console.log("View.fullscreen: ", this.scene.name, this.scene.boundingBox.isEmpty(), this.scene.boundingBox.round().toString()), this.resetCameraByBoundingBox(vs, e));
16998
+ this.scene && (this.scene.boundingBox.isEmpty() && this.scene.computeBoundingBox(), vs.copy(this.scene.boundingBox).expandByVector(Ho.set(t, t)), this.resetCameraByBoundingBox(vs, e));
16999
16999
  }
17000
17000
  // initController(camera?: ICamera2, dom?: HTMLElement) {
17001
17001
  // console.log('!!!')
@@ -17366,9 +17366,9 @@ class Pb extends pr {
17366
17366
  var t;
17367
17367
  return (t = this.scene) == null ? void 0 : t.getSelectedIds();
17368
17368
  }
17369
- async targetByIds(t) {
17370
- var e;
17371
- this.scene && ((e = this.scene) == null || e.selectByIds(t, !1), Vl.copy(this.scene.getSelectedBoundingBox()).expandByVector(new U(1, 1).multiplyScalar(100)), await jf(100), Vl.isEmpty() || await this.view.setByBox(Vl));
17369
+ async targetByIds(t, e = 100) {
17370
+ var i;
17371
+ this.scene && ((i = this.scene) == null || i.selectByIds(t, !1), Vl.copy(this.scene.getSelectedBoundingBox()).expandByVector(new U(1, 1).multiplyScalar(e)), await jf(100), Vl.isEmpty() || await this.view.setByBox(Vl));
17372
17372
  }
17373
17373
  linkAssetsByTree(t) {
17374
17374
  var e;
@@ -17984,7 +17984,7 @@ class Fb extends pr {
17984
17984
  break;
17985
17985
  case hr.CAMERA_CHANGED:
17986
17986
  const { t: d, r: g, s: E } = t.data.data;
17987
- console.log("CAMERA_CHANGED: ", this.view.camera.width, d, g, E), (l = (o = this.view) == null ? void 0 : o.camera) == null || l.setTRS(d, g, E);
17987
+ (l = (o = this.view) == null ? void 0 : o.camera) == null || l.setTRS(d, g, E);
17988
17988
  break;
17989
17989
  case hr.SCENES_CHANGED:
17990
17990
  const { box: T } = t.data.data;
@@ -18005,8 +18005,8 @@ class Fb extends pr {
18005
18005
  promiseWorkerResponse(t, e) {
18006
18006
  return new Promise((i, a) => {
18007
18007
  const o = (c) => {
18008
- var f, d, g;
18009
- ((f = c == null ? void 0 : c.data) == null ? void 0 : f.task) === t && (this.worker.removeEventListener("message", o), this.worker.removeEventListener("error", l), console.log("AppOffscreen::response: ", (d = c == null ? void 0 : c.data) == null ? void 0 : d.task, (g = c == null ? void 0 : c.data) == null ? void 0 : g.data), i(c.data.data));
18008
+ var f;
18009
+ ((f = c == null ? void 0 : c.data) == null ? void 0 : f.task) === t && (this.worker.removeEventListener("message", o), this.worker.removeEventListener("error", l), i(c.data.data));
18010
18010
  }, l = (c) => {
18011
18011
  this.worker.removeEventListener("message", o), this.worker.removeEventListener("error", l), a(c.error);
18012
18012
  };