@realsee/dnalogel 3.2.2 → 3.2.4
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.
- package/dist/index.cjs.js +23 -23
- package/dist/index.js +521 -520
- package/dist/index.umd.js +4 -4
- package/libs/CurrentPanoImagePlugin/Controller.js +27 -27
- package/libs/GuideLinePlugin/GuideLineModeItem/index.js +2 -1
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var m = Object.defineProperty;
|
|
2
2
|
var g = Object.getOwnPropertySymbols;
|
|
3
3
|
var v = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var p = (r, o, e) => o in r ? m(r, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[o] = e,
|
|
4
|
+
var p = (r, o, e) => o in r ? m(r, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[o] = e, l = (r, o) => {
|
|
5
5
|
for (var e in o || (o = {}))
|
|
6
6
|
v.call(o, e) && p(r, e, o[e]);
|
|
7
7
|
if (g)
|
|
@@ -11,22 +11,22 @@ var p = (r, o, e) => o in r ? m(r, o, { enumerable: !0, configurable: !0, writab
|
|
|
11
11
|
};
|
|
12
12
|
var n = (r, o, e) => (p(r, typeof o != "symbol" ? o + "" : o, e), e);
|
|
13
13
|
var f = (r, o, e) => new Promise((i, t) => {
|
|
14
|
-
var s = (
|
|
14
|
+
var s = (d) => {
|
|
15
15
|
try {
|
|
16
|
-
u(e.next(
|
|
16
|
+
u(e.next(d));
|
|
17
17
|
} catch (c) {
|
|
18
18
|
t(c);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, a = (d) => {
|
|
21
21
|
try {
|
|
22
|
-
u(e.throw(
|
|
22
|
+
u(e.throw(d));
|
|
23
23
|
} catch (c) {
|
|
24
24
|
t(c);
|
|
25
25
|
}
|
|
26
|
-
}, u = (
|
|
26
|
+
}, u = (d) => d.done ? i(d.value) : Promise.resolve(d.value).then(s, a);
|
|
27
27
|
u((e = e.apply(r, o)).next());
|
|
28
28
|
});
|
|
29
|
-
import * as
|
|
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";
|
|
@@ -69,7 +69,7 @@ class K extends M {
|
|
|
69
69
|
pluginHidden: ""
|
|
70
70
|
});
|
|
71
71
|
// ==================== private properties ====================
|
|
72
|
-
n(this, "group", new
|
|
72
|
+
n(this, "group", new h.Group());
|
|
73
73
|
n(this, "mesh");
|
|
74
74
|
n(this, "textureLoadingPromise");
|
|
75
75
|
n(this, "opacityAnimeTween");
|
|
@@ -127,20 +127,20 @@ class K extends M {
|
|
|
127
127
|
visible: !0
|
|
128
128
|
};
|
|
129
129
|
this.state = Object.assign(t, i == null ? void 0 : i.initialState);
|
|
130
|
-
const s =
|
|
130
|
+
const s = l({
|
|
131
131
|
width: 1.4,
|
|
132
132
|
yOffset: 0.01,
|
|
133
133
|
yRotate: 0,
|
|
134
134
|
imageURL: this.absoluteUrl("/release/web/logo.7febb17f.png")
|
|
135
135
|
}, i == null ? void 0 : i.config);
|
|
136
|
-
this._config = s, this.group.name = "current-pano-image-plugin-group", this.mesh = new
|
|
137
|
-
new
|
|
138
|
-
new
|
|
136
|
+
this._config = s, this.group.name = "current-pano-image-plugin-group", this.mesh = new h.Mesh(
|
|
137
|
+
new h.PlaneBufferGeometry(this.config.width, this.config.width),
|
|
138
|
+
new h.MeshBasicMaterial({ transparent: !0, opacity: 0, depthTest: !1 })
|
|
139
139
|
), 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);
|
|
140
140
|
}
|
|
141
141
|
/** 插件配置项 */
|
|
142
142
|
get config() {
|
|
143
|
-
return
|
|
143
|
+
return l({}, this._config);
|
|
144
144
|
}
|
|
145
145
|
/** 是否已经被销毁 */
|
|
146
146
|
get disposed() {
|
|
@@ -178,7 +178,7 @@ class K extends M {
|
|
|
178
178
|
return Promise.resolve();
|
|
179
179
|
if (this.disposed)
|
|
180
180
|
return Promise.reject(new Error("不能在已销毁的插件上调用 show"));
|
|
181
|
-
const i =
|
|
181
|
+
const i = l({ userAction: !0 }, e);
|
|
182
182
|
this.updateState({ visible: !0 }, i.userAction), this.checkMsg.pluginHidden = "", this._show(i);
|
|
183
183
|
});
|
|
184
184
|
}
|
|
@@ -190,7 +190,7 @@ class K extends M {
|
|
|
190
190
|
return f(this, null, function* () {
|
|
191
191
|
if (this.state.visible === !1)
|
|
192
192
|
return;
|
|
193
|
-
const i =
|
|
193
|
+
const i = l({ userAction: !0 }, e);
|
|
194
194
|
this.updateState({ visible: !1 }, i.userAction), this.checkMsg.pluginDisabled = "调用 hide 隐藏", this._hide(i);
|
|
195
195
|
});
|
|
196
196
|
}
|
|
@@ -205,8 +205,8 @@ class K extends M {
|
|
|
205
205
|
return;
|
|
206
206
|
const s = i.userAction !== void 0 ? i.userAction : !0;
|
|
207
207
|
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) {
|
|
208
|
-
const
|
|
209
|
-
e.visible ? this.checkMsg.pluginHidden = "" : this.checkMsg.pluginHidden = "调用 setState 隐藏", e.visible ? this._show(
|
|
208
|
+
const a = { userAction: s, anime: { duration: 500 } };
|
|
209
|
+
e.visible ? this.checkMsg.pluginHidden = "" : this.checkMsg.pluginHidden = "调用 setState 隐藏", e.visible ? this._show(a) : this._hide(a);
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
/** 更改插件 Config
|
|
@@ -214,9 +214,9 @@ class K extends M {
|
|
|
214
214
|
* @param `options` `<Option> | <undefined>`
|
|
215
215
|
*/
|
|
216
216
|
updateConfig(e, i = {}) {
|
|
217
|
-
var
|
|
218
|
-
const t = this.config, s =
|
|
219
|
-
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
|
|
217
|
+
var a;
|
|
218
|
+
const t = this.config, s = l(l({}, t), e);
|
|
219
|
+
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: (a = i.userAction) != null ? a : !0 });
|
|
220
220
|
}
|
|
221
221
|
/** 问什么看不到模型 */
|
|
222
222
|
__whyCantSeeMesh() {
|
|
@@ -231,7 +231,7 @@ class K extends M {
|
|
|
231
231
|
}
|
|
232
232
|
updateState(e, i) {
|
|
233
233
|
const t = this.state;
|
|
234
|
-
this.state =
|
|
234
|
+
this.state = l(l({}, this.state), e), this.hooks.emit("stateChange", { state: this.state, prevState: t, userAction: i });
|
|
235
235
|
}
|
|
236
236
|
/** 根据各种条件更新 Mesh 的可见性 */
|
|
237
237
|
updateMeshVisible() {
|
|
@@ -240,8 +240,8 @@ class K extends M {
|
|
|
240
240
|
}
|
|
241
241
|
/** 根据点位更新 Mesh 坐标 */
|
|
242
242
|
updateMeshPosition(e) {
|
|
243
|
-
var s,
|
|
244
|
-
const i = (u = (
|
|
243
|
+
var s, a, u;
|
|
244
|
+
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);
|
|
245
245
|
t && this.mesh.position.copy(t);
|
|
246
246
|
}
|
|
247
247
|
/** 重新加载贴图,调用时会先清除已有的贴图 */
|
|
@@ -251,19 +251,19 @@ class K extends M {
|
|
|
251
251
|
const i = P(e);
|
|
252
252
|
this.textureLoadingPromise = i;
|
|
253
253
|
const t = yield i;
|
|
254
|
-
this.textureLoadingPromise === i && (this.onTextureLoaded(t), this.textureLoadingPromise = null);
|
|
254
|
+
t.minFilter = h.LinearFilter, this.textureLoadingPromise === i && (this.onTextureLoaded(t), this.textureLoadingPromise = null);
|
|
255
255
|
}
|
|
256
256
|
this.updateMeshVisible();
|
|
257
257
|
});
|
|
258
258
|
}
|
|
259
259
|
/** north_rad 变化时,需要更新模型的旋转角度 */
|
|
260
260
|
updateMeshQuaternion(e) {
|
|
261
|
-
const i = new
|
|
261
|
+
const i = new h.Quaternion();
|
|
262
262
|
i.multiplyQuaternions(
|
|
263
263
|
// 沿着自身 X 轴旋转 -90 度
|
|
264
|
-
new
|
|
264
|
+
new h.Quaternion().setFromAxisAngle(new h.Vector3(1, 0, 0), -Math.PI / 2),
|
|
265
265
|
// 沿着自身 Z 轴旋转 rad 弧度
|
|
266
|
-
new
|
|
266
|
+
new h.Quaternion().setFromAxisAngle(new h.Vector3(0, 0, 1), e)
|
|
267
267
|
), this.mesh.quaternion.copy(i);
|
|
268
268
|
}
|
|
269
269
|
_enable(e) {
|
|
@@ -417,7 +417,8 @@ class N {
|
|
|
417
417
|
}
|
|
418
418
|
setTag(e, t) {
|
|
419
419
|
const r = this.curvePath, s = e === "start" ? this.startTagContainer : this.endTagContainer;
|
|
420
|
-
t != null && t.data
|
|
420
|
+
if (!(t != null && t.data))
|
|
421
|
+
return s.plugin.clearTags();
|
|
421
422
|
const o = I({}, {
|
|
422
423
|
contentType: "Custom",
|
|
423
424
|
stickType: "2DPoint",
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv3.2.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv3.2.4",
|
|
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.2.
|
|
10
|
+
"version": "3.2.4",
|
|
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*",
|