@realsee/dnalogel 3.44.2 → 3.44.3

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.
@@ -1,32 +1,32 @@
1
1
  var m = Object.defineProperty;
2
2
  var p = Object.getOwnPropertySymbols;
3
3
  var v = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
4
- var g = (h, o, e) => o in h ? m(h, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[o] = e, l = (h, o) => {
4
+ var g = (r, o, e) => o in r ? m(r, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[o] = e, a = (r, o) => {
5
5
  for (var e in o || (o = {}))
6
- v.call(o, e) && g(h, e, o[e]);
6
+ v.call(o, e) && g(r, e, o[e]);
7
7
  if (p)
8
8
  for (var e of p(o))
9
- b.call(o, e) && g(h, e, o[e]);
10
- return h;
9
+ b.call(o, e) && g(r, e, o[e]);
10
+ return r;
11
11
  };
12
- var n = (h, o, e) => (g(h, typeof o != "symbol" ? o + "" : o, e), e);
13
- var f = (h, o, e) => new Promise((i, t) => {
12
+ var n = (r, o, e) => (g(r, typeof o != "symbol" ? o + "" : o, e), e);
13
+ var u = (r, o, e) => new Promise((i, t) => {
14
14
  var s = (d) => {
15
15
  try {
16
- u(e.next(d));
16
+ f(e.next(d));
17
17
  } catch (c) {
18
18
  t(c);
19
19
  }
20
- }, a = (d) => {
20
+ }, l = (d) => {
21
21
  try {
22
- u(e.throw(d));
22
+ f(e.throw(d));
23
23
  } catch (c) {
24
24
  t(c);
25
25
  }
26
- }, u = (d) => d.done ? i(d.value) : Promise.resolve(d.value).then(s, a);
27
- u((e = e.apply(h, o)).next());
26
+ }, f = (d) => d.done ? i(d.value) : Promise.resolve(d.value).then(s, l);
27
+ f((e = e.apply(r, o)).next());
28
28
  });
29
- import * as r from "three";
29
+ import * as h from "three";
30
30
  import { Controller as M } from "../base/BasePlugin.js";
31
31
  import { tweenProgress as A } from "../shared-utils/animationFrame/BetterTween.js";
32
32
  import "hammerjs";
@@ -34,8 +34,8 @@ import "three/examples/jsm/renderers/CSS3DRenderer";
34
34
  import "@realsee/five/line";
35
35
  import "../shared-utils/three/THREESphere.js";
36
36
  import "animejs";
37
- import { equal as w } from "../shared-utils/equal.js";
38
- import { loadTexture as P } from "../shared-utils/three/loadTexture.js";
37
+ import { equal as P } from "../shared-utils/equal.js";
38
+ import { loadTexture as w } from "../shared-utils/three/loadTexture.js";
39
39
  import "../shared-utils/Subscribe.js";
40
40
  import "../shared-utils/Utils/FiveUtil.js";
41
41
  import "../shared-utils/Utils/BaseUtil.js";
@@ -62,7 +62,7 @@ class E extends M {
62
62
  pluginHidden: ""
63
63
  });
64
64
  // ==================== private properties ====================
65
- n(this, "group", new r.Group());
65
+ n(this, "group", new h.Group());
66
66
  n(this, "mesh");
67
67
  n(this, "textureLoadingPromise");
68
68
  n(this, "opacityAnimeTween");
@@ -120,20 +120,20 @@ class E extends M {
120
120
  visible: !0
121
121
  };
122
122
  this.state = Object.assign(t, i == null ? void 0 : i.initialState);
123
- const s = l({
123
+ const s = a({
124
124
  width: 1.4,
125
125
  yOffset: 0.01,
126
126
  yRotate: 0,
127
127
  imageURL: this.absoluteUrl("/release/web/logo.7febb17f.png")
128
128
  }, i == null ? void 0 : i.config);
129
- this._config = s, this.group.name = "current-pano-image-plugin-group", this.mesh = new r.Mesh(
130
- new r.PlaneBufferGeometry(this.config.width, this.config.width),
131
- new r.MeshBasicMaterial({ transparent: !0, opacity: 0, depthTest: !1 })
129
+ this._config = s, this.group.name = "current-pano-image-plugin-group", this.mesh = new h.Mesh(
130
+ new h.PlaneBufferGeometry(this.config.width, this.config.width),
131
+ new h.MeshBasicMaterial({ transparent: !0, opacity: 0, depthTest: !1 })
132
132
  ), this.mesh.visible = !1, this.group.add(this.mesh), this.updateMeshQuaternion(this.config.yRotate), this.state.visible || (this.checkMsg.pluginHidden = "初始值设置为隐藏"), this.state.enabled || (this.checkMsg.pluginDisabled = "初始值设置为禁用"), this.state.enabled && this._enable({ userAction: !1 }), this.five.once("dispose", this.dispose);
133
133
  }
134
134
  /** 插件配置项 */
135
135
  get config() {
136
- return l({}, this._config);
136
+ return a({}, this._config);
137
137
  }
138
138
  /** 是否已经被销毁 */
139
139
  get disposed() {
@@ -166,12 +166,12 @@ class E extends M {
166
166
  * @param `options.userAction` `<boolean> | <undefined>` 是否是用户操作。默认是 true。
167
167
  */
168
168
  show(e) {
169
- return f(this, null, function* () {
169
+ return u(this, null, function* () {
170
170
  if (this.state.visible)
171
171
  return Promise.resolve();
172
172
  if (this.disposed)
173
173
  return Promise.reject(new Error("不能在已销毁的插件上调用 show"));
174
- const i = l({ userAction: !0 }, e);
174
+ const i = a({ userAction: !0 }, e);
175
175
  this.updateState({ visible: !0 }, i.userAction), this.checkMsg.pluginHidden = "", this._show(i);
176
176
  });
177
177
  }
@@ -180,10 +180,10 @@ class E extends M {
180
180
  * @param `options.userAction` `<boolean> | <undefined>` 是否是用户操作。默认是 true。
181
181
  */
182
182
  hide(e) {
183
- return f(this, null, function* () {
183
+ return u(this, null, function* () {
184
184
  if (this.state.visible === !1)
185
185
  return;
186
- const i = l({ userAction: !0 }, e);
186
+ const i = a({ userAction: !0 }, e);
187
187
  this.updateState({ visible: !1 }, i.userAction), this.checkMsg.pluginDisabled = "调用 hide 隐藏", this._hide(i);
188
188
  });
189
189
  }
@@ -194,12 +194,12 @@ class E extends M {
194
194
  */
195
195
  setState(e, i = {}) {
196
196
  const t = this.state;
197
- if (w(e, t, { deep: !0 }))
197
+ if (P(e, t, { deep: !0 }))
198
198
  return;
199
199
  const s = i.userAction !== void 0 ? i.userAction : !0;
200
200
  if (this.updateState(e, s), e.enabled !== void 0 && t.enabled !== e.enabled && (e.enabled ? this.checkMsg.pluginDisabled = "" : this.checkMsg.pluginDisabled = "调用 setState 禁用", e.enabled ? this._enable({ userAction: s }) : this._disable({ userAction: s })), e.visible !== void 0 && t.visible !== e.visible) {
201
- const a = { userAction: s, anime: { duration: 500 } };
202
- e.visible ? this.checkMsg.pluginHidden = "" : this.checkMsg.pluginHidden = "调用 setState 隐藏", e.visible ? this._show(a) : this._hide(a);
201
+ const l = { userAction: s, anime: { duration: 500 } };
202
+ e.visible ? this.checkMsg.pluginHidden = "" : this.checkMsg.pluginHidden = "调用 setState 隐藏", e.visible ? this._show(l) : this._hide(l);
203
203
  }
204
204
  }
205
205
  /** 更改插件 Config
@@ -207,9 +207,9 @@ class E extends M {
207
207
  * @param `options` `<Option> | <undefined>`
208
208
  */
209
209
  updateConfig(e, i = {}) {
210
- var a;
211
- const t = this.config, s = l(l({}, t), e);
212
- this._config = s, t.imageURL !== s.imageURL && this.reloadTexture(s.imageURL), t.yOffset !== s.yOffset && this.updateMeshPosition(this.five.getCurrentState().panoIndex), t.yRotate !== s.yRotate && this.updateMeshQuaternion(s.yRotate), t.width !== s.width && (this.mesh.geometry = new r.PlaneBufferGeometry(s.width, s.width)), this.hooks.emit("configChange", { prevConfig: t, config: s, userAction: (a = i.userAction) != null ? a : !0 });
210
+ var l;
211
+ const t = this.config, s = a(a({}, t), e);
212
+ this._config = s, t.imageURL !== s.imageURL && this.reloadTexture(s.imageURL), t.yOffset !== s.yOffset && this.updateMeshPosition(this.five.getCurrentState().panoIndex), t.yRotate !== s.yRotate && this.updateMeshQuaternion(s.yRotate), t.width !== s.width && (this.mesh.geometry = new h.PlaneBufferGeometry(s.width, s.width)), this.hooks.emit("configChange", { prevConfig: t, config: s, userAction: (l = i.userAction) != null ? l : !0 });
213
213
  }
214
214
  /** 问什么看不到模型 */
215
215
  __whyCantSeeMesh() {
@@ -224,7 +224,7 @@ class E extends M {
224
224
  }
225
225
  updateState(e, i) {
226
226
  const t = this.state;
227
- this.state = l(l({}, this.state), e), this.hooks.emit("stateChange", { state: this.state, prevState: t, userAction: i });
227
+ this.state = a(a({}, this.state), e), this.hooks.emit("stateChange", { state: this.state, prevState: t, userAction: i });
228
228
  }
229
229
  /** 根据各种条件更新 Mesh 的可见性 */
230
230
  updateMeshVisible() {
@@ -233,30 +233,34 @@ class E extends M {
233
233
  }
234
234
  /** 根据点位更新 Mesh 坐标 */
235
235
  updateMeshPosition(e) {
236
- var s, a, u;
237
- const i = (u = (a = (s = this.five.work) == null ? void 0 : s.observers) == null ? void 0 : a[e]) == null ? void 0 : u.standingPosition, t = i == null ? void 0 : i.clone().setY(i.y + this.config.yOffset);
236
+ const i = this.workUtil.getObserverStandingPosition(e);
237
+ if (!i) {
238
+ console.warn("CurrentPanoImagePlugin: 无法获取到当前点位的 standingPosition");
239
+ return;
240
+ }
241
+ const t = i.clone().setY(i.y + this.config.yOffset);
238
242
  t && this.mesh.position.copy(t);
239
243
  }
240
244
  /** 重新加载贴图,调用时会先清除已有的贴图 */
241
245
  reloadTexture(e) {
242
- return f(this, null, function* () {
246
+ return u(this, null, function* () {
243
247
  if (this.mesh.material.map = null, e !== "") {
244
- const i = P(e);
248
+ const i = w(e);
245
249
  this.textureLoadingPromise = i;
246
250
  const t = yield i;
247
- t.minFilter = r.LinearFilter, this.textureLoadingPromise === i && (this.onTextureLoaded(t), this.textureLoadingPromise = null);
251
+ t.minFilter = h.LinearFilter, this.textureLoadingPromise === i && (this.onTextureLoaded(t), this.textureLoadingPromise = null);
248
252
  }
249
253
  this.updateMeshVisible();
250
254
  });
251
255
  }
252
256
  /** north_rad 变化时,需要更新模型的旋转角度 */
253
257
  updateMeshQuaternion(e) {
254
- const i = new r.Quaternion();
258
+ const i = new h.Quaternion();
255
259
  i.multiplyQuaternions(
256
260
  // 沿着自身 X 轴旋转 -90 度
257
- new r.Quaternion().setFromAxisAngle(new r.Vector3(1, 0, 0), -Math.PI / 2),
261
+ new h.Quaternion().setFromAxisAngle(new h.Vector3(1, 0, 0), -Math.PI / 2),
258
262
  // 沿着自身 Z 轴旋转 rad 弧度
259
- new r.Quaternion().setFromAxisAngle(new r.Vector3(0, 0, 1), e)
263
+ new h.Quaternion().setFromAxisAngle(new h.Vector3(0, 0, 1), e)
260
264
  ), this.mesh.quaternion.copy(i);
261
265
  }
262
266
  _enable(e) {
@@ -16,7 +16,7 @@ let c = class {
16
16
  /**
17
17
  * @realsee/dnalogel 版本号
18
18
  */
19
- e(this, "VERSION", "3.44.2");
19
+ e(this, "VERSION", "3.44.3");
20
20
  e(this, "NAME");
21
21
  e(this, "five");
22
22
  e(this, "workUtil");
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.44.2",
3
+ "%c %c@realsee/dnalogel %cv3.44.3",
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realsee/dnalogel",
3
- "version": "3.44.2",
3
+ "version": "3.44.3",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./libs/index.js",
6
6
  "types": "./libs/index.d.ts",