@realsee/dnalogel 3.9.0 → 3.10.0

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.
@@ -115,6 +115,11 @@ export interface ServerAreaMakerItem {
115
115
  floor_index: number;
116
116
  /** 标注物体 */
117
117
  object_data: {
118
+ /**
119
+ * @description: 是否加载标注模型
120
+ * @default true
121
+ */
122
+ visible?: boolean;
118
123
  /** 标注底面形状,THREE.Shape().toJSON() 的结果 */
119
124
  shape: Record<string, any>;
120
125
  /** 标注底面 y 坐标 */
@@ -133,6 +138,11 @@ export interface ServerAreaMakerItemV1 {
133
138
  id: number;
134
139
  name: string;
135
140
  object_data: {
141
+ /**
142
+ * @description: 是否加载标注模型
143
+ * @default true
144
+ */
145
+ visible?: boolean;
136
146
  /** 绘制平面的三维世界坐标点集合 */
137
147
  points: number[][];
138
148
  /** 楼层索引 */
@@ -1,18 +1,18 @@
1
- var d = Object.defineProperty;
2
- var f = (a, e, t) => e in a ? d(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
- var i = (a, e, t) => (f(a, typeof e != "symbol" ? e + "" : e, t), t);
1
+ var f = Object.defineProperty;
2
+ var b = (a, e, t) => e in a ? f(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
+ var i = (a, e, t) => (b(a, typeof e != "symbol" ? e + "" : e, t), t);
4
4
  import * as n from "three";
5
5
  import "hammerjs";
6
6
  import "@realsee/five";
7
7
  import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
8
8
  import "../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
9
9
  import "../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
10
- import { Object3D as b } from "../../shared-utils/three/core/Object3D.js";
11
- import { LineSegments as k } from "../../shared-utils/three/objects/LineSegments.js";
12
- import { BetterTween as y } from "../../shared-utils/animationFrame/BetterTween.js";
13
- import { LabelItem as T } from "../../components/AreaLabel/LabelItem.js";
14
- import { getCenterPointOfPoints as C } from "../../shared-utils/math/planimetry.js";
15
- import { Subscribe as O } from "../../shared-utils/Subscribe.js";
10
+ import { Object3D as k } from "../../shared-utils/three/core/Object3D.js";
11
+ import { LineSegments as y } from "../../shared-utils/three/objects/LineSegments.js";
12
+ import { BetterTween as T } from "../../shared-utils/animationFrame/BetterTween.js";
13
+ import { LabelItem as C } from "../../components/AreaLabel/LabelItem.js";
14
+ import { getCenterPointOfPoints as O } from "../../shared-utils/math/planimetry.js";
15
+ import { Subscribe as v } from "../../shared-utils/Subscribe.js";
16
16
  import "../../shared-utils/positionToVector3.js";
17
17
  import "../../CSS3DRenderPlugin/utils/three/CSS3DRenderer.js";
18
18
  import "three/examples/jsm/renderers/CSS3DRenderer";
@@ -29,7 +29,7 @@ import "../../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
29
29
  import "../../shared-utils/animationFrame/index.js";
30
30
  import "../../vendor/svelte/internal/index.js";
31
31
  import "../../components/AreaLabel/Assets/roomLabelBg.js";
32
- class v extends b {
32
+ class M extends k {
33
33
  constructor(t) {
34
34
  super();
35
35
  i(this, "areaMakerItem");
@@ -39,7 +39,7 @@ class v extends b {
39
39
  this.areaMakerItem.makerObject.raycast(t, s);
40
40
  }
41
41
  }
42
- class Q {
42
+ class tt {
43
43
  constructor(e, t) {
44
44
  i(this, "id");
45
45
  /** 标注名称 */
@@ -85,7 +85,7 @@ class Q {
85
85
  /** 标注标签的显示层级 */
86
86
  i(this, "tagZIndex", 0);
87
87
  /** 标注实例的事件处理器 */
88
- i(this, "hooks", new O());
88
+ i(this, "hooks", new v());
89
89
  /** 自定义 Dom */
90
90
  i(this, "itemRenderer");
91
91
  /** 数据 */
@@ -126,7 +126,7 @@ class Q {
126
126
  return;
127
127
  }
128
128
  return new Promise((p) => {
129
- this.opacityAnime = new y({ makerObjectOpacity: s, outlineOpacity: r }).to({
129
+ this.opacityAnime = new T({ makerObjectOpacity: s, outlineOpacity: r }).to({
130
130
  makerObjectOpacity: o,
131
131
  outlineOpacity: l
132
132
  }).onUpdate(({ makerObjectOpacity: m, outlineOpacity: c }) => {
@@ -146,8 +146,13 @@ class Q {
146
146
  });
147
147
  /** 更新标注可见性 */
148
148
  i(this, "updateVisible", () => {
149
+ var o;
149
150
  const { result: e, msg: t } = this.checkVisible();
150
- this.checkMsg.checkVisibleMsg = t, this.visible !== e && (this.visible = e, this.modelGroup.visible = e, this.plugin.five.needsRender = !0);
151
+ if (this.checkMsg.checkVisibleMsg = t, this.visible === e)
152
+ return;
153
+ this.visible = e;
154
+ const s = (o = this.data.object_data.visible) != null ? o : !0;
155
+ this.modelGroup.visible = e && s, this.plugin.five.needsRender = !0;
151
156
  });
152
157
  /** 检测标注是否可见 */
153
158
  i(this, "checkVisible", () => {
@@ -203,12 +208,12 @@ class Q {
203
208
  };
204
209
  this.containerResizeTimeoutID && clearTimeout(this.containerResizeTimeoutID), this.containerResizeTimeoutID = setTimeout(t, 100);
205
210
  });
206
- var p, m, c;
211
+ var p, m, c, g;
207
212
  const s = t.object_data, o = s.bottom_y, r = s.height, l = new n.Color((p = s.color) != null ? p : "#FFFFFF"), h = (m = s.opacity) != null ? m : 0.4;
208
- this.data = t, this.id = t.id, this.name = (c = t.name) != null ? c : "", this.plugin = e, this.height = r, this.bottomY = o, this.opacity = h, this.shape = new n.Shape().fromJSON(s.shape), this.floorIndex = t.floor_index, this.makerObject = new n.Mesh(g(this.shape, r), M(l, h)), u(this.makerObject, o), this.makerObject.material.depthTest = this.plugin.config.modelDepthTest, this.outline = new k(
213
+ this.data = t, this.id = t.id, this.name = (c = t.name) != null ? c : "", this.plugin = e, this.height = r, this.bottomY = o, this.opacity = h, this.shape = new n.Shape().fromJSON(s.shape), this.floorIndex = t.floor_index, this.makerObject = new n.Mesh(d(this.shape, r), P(l, h)), u(this.makerObject, o), this.makerObject.material.depthTest = this.plugin.config.modelDepthTest, this.outline = new y(
209
214
  new n.EdgesGeometry(this.makerObject.geometry),
210
215
  new n.LineBasicMaterial({ color: l, transparent: !0 })
211
- ), u(this.outline, o), this.outline.material.depthTest = this.plugin.config.modelDepthTest, this.setHeight(r), this.modelGroup = new v(this);
216
+ ), u(this.outline, o), this.outline.material.depthTest = this.plugin.config.modelDepthTest, this.setHeight(r), this.modelGroup = new M(this), this.modelGroup.visible = (g = s.visible) != null ? g : !0;
212
217
  }
213
218
  /** 挂载标注 */
214
219
  mount() {
@@ -222,7 +227,7 @@ class Q {
222
227
  transform: `translate(${this.tagTransform.left}px, ${this.tagTransform.top}px)`,
223
228
  onClick: (r) => this.hooks.emit("tagClick", { target: this, nativeEvent: r })
224
229
  };
225
- this.tagApp = new T({ target: s, props: o }), this.updateTag();
230
+ this.tagApp = new C({ target: s, props: o }), this.updateTag();
226
231
  }
227
232
  this.plugin.five.needsRender = !0, this.plugin.hooks.on("stateChange", this.onPluginStateChange), this.plugin.hooks.on("configChange", this.onPluginConfigChange), this.plugin.five.on("modeChange", this.updateVisible), this.plugin.five.on("modelShownFloorChange", this.updateVisible), this.plugin.five.on("cameraUpdate", this.onFiveCameraUpdate), (t = this.plugin.resizeIframe.contentWindow) == null || t.addEventListener("resize", this.onContainerResize);
228
233
  }
@@ -252,8 +257,8 @@ class Q {
252
257
  setHeight(e) {
253
258
  if (e <= 0)
254
259
  throw new Error("高度必须大于 0");
255
- this.height = e, this.makerObject.geometry = g(this.shape, e), this.outline.geometry = new n.EdgesGeometry(this.makerObject.geometry);
256
- const t = this.shape.extractPoints(10).shape.slice(0, -1), s = C(t), o = new n.Vector3(s.x, s.y, e);
260
+ this.height = e, this.makerObject.geometry = d(this.shape, e), this.outline.geometry = new n.EdgesGeometry(this.makerObject.geometry);
261
+ const t = this.shape.extractPoints(10).shape.slice(0, -1), s = O(t), o = new n.Vector3(s.x, s.y, e);
257
262
  u(o, this.bottomY), this.tagPosition.copy(o), this.updateTag(), this.plugin.five.needsRender = !0;
258
263
  }
259
264
  /** 更改标注标签的显示层级
@@ -269,13 +274,13 @@ class Q {
269
274
  this.tagZIndex !== e && ((t = this.tagApp) == null || t.$set({ zIndex: e }));
270
275
  }
271
276
  }
272
- function g(a, e) {
277
+ function d(a, e) {
273
278
  return new n.ExtrudeBufferGeometry(a, {
274
279
  depth: e,
275
280
  bevelEnabled: !1
276
281
  });
277
282
  }
278
- function M(a, e) {
283
+ function P(a, e) {
279
284
  return new n.MeshBasicMaterial({
280
285
  color: a,
281
286
  opacity: e,
@@ -287,5 +292,5 @@ function u(a, e) {
287
292
  t.multiply(s), t.multiply(o), t.multiply(r), a.applyMatrix4(t);
288
293
  }
289
294
  export {
290
- Q as AreaMakerItem
295
+ tt as AreaMakerItem
291
296
  };
@@ -14,7 +14,7 @@ let b = class {
14
14
  /**
15
15
  * @realsee/dnalogel 版本号
16
16
  */
17
- i(this, "VERSION", "3.9.0");
17
+ i(this, "VERSION", "3.10.0");
18
18
  i(this, "five");
19
19
  /**
20
20
  * 插件事件钩子
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.9.0",
3
+ "%c %c@realsee/dnalogel %cv3.10.0",
4
4
  [
5
5
  "background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAMAAACHgmeRAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUAAAAapPoap/oaqvkbrfkbr/gZnfwZoPsaqfnD4v/E4/8Ylv0clPm93/+/4P/B4f8Yj/683/8Wif+33P8Uhv+x2f8ShP+s1v8Pgf+n0/8Nf/+h0f8Lff8Lff8Nf/9dl/+czv8KfP8KfP+Lxf+Uyv+Xy/+Hwv+Jw/+Mxf+Oxv+RyP8aovsapfoap/oZmfwZm/wZnvsYnPsYkf4YlP0NePsDYfgYcfi43f+63v8Xiv8Xjf4EWfwCV/sWZ/qz2v+02/8Vh/8WiP8EUf8CTf4WXv2u1/+v2P8Thf8Thv8ETf8CR/8VV/+o1f+q1f8Qgv8Rg/8DSv8BRf8UVP+j0v+k0v8OgP8Pgf8DR/8DQv9Nhf+dzv+fz/+Kv/+Vyv+Xy/+azf+Oxv+Qx/+SyP////8MUhLdAAAAK3RSTlMACEWQ2bd98uQECPXxqO7c+Pb49vj2+Pb49vj23Oul8fMHA+TwerXXjEIG2P+bHgAAAAFiS0dEY1y+LaoAAAB+SURBVAjXY2BgZGJmYWVgYGBgY9fW0eVg4ORi4NbTNzDk4eXjZxAwMjYxNTO3EGQQsrSytrG1sxdmEHFwdHJ2cXUTZRBz9/D08vbxFWeQ8PMPCAwKDpFkkAoNC4+IjIqWZpCRlZOPiY2LV2BQVGJQTkhMUlEFWaOmrqGpxQAAyg0S9Dq+VPYAAAAASUVORK5CYII=')",
6
6
  "background-repeat: no-repeat",
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "repository": "https://github.com/realsee-developer/dnalogel.git",
8
8
  "description": "如视 VR 看房插件合集",
9
9
  "private": false,
10
- "version": "3.9.0",
10
+ "version": "3.10.0",
11
11
  "license": "SEE LICENSE IN TERMS.txt",
12
12
  "scripts": {
13
13
  "clean": "rm -rf components dist docs libs types ./vite.config.js.timestamp*",