@realsee/dnalogel 3.50.12 → 3.50.13
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/CHANGELOG.md +3 -0
- package/dist/PanoTagPlugin/controller/Tag/BaseTag.d.ts +3 -3
- package/dist/PanoTagPlugin/controller/TagRender.d.ts +0 -3
- package/dist/PanoTagPlugin/controller/index.d.ts +4 -0
- package/dist/base/BasePlugin.d.ts +1 -1
- package/dist/index.cjs.js +3 -3
- package/dist/index.js +18 -20
- package/dist/index.umd.js +3 -3
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.d.ts +3 -3
- package/libs/PanoTagPlugin/controller/TagRender.d.ts +0 -3
- package/libs/PanoTagPlugin/controller/TagRender.js +80 -110
- package/libs/PanoTagPlugin/controller/index.d.ts +4 -0
- package/libs/PanoTagPlugin/controller/index.js +41 -29
- package/libs/base/BasePlugin.d.ts +1 -1
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
|
@@ -153,8 +153,8 @@ export declare abstract class BaseTag<C extends TagContentType = TagContentType,
|
|
|
153
153
|
}): TagConfig;
|
|
154
154
|
getDistance(fiveState?: Partial<FiveState>, accurate?: number): number;
|
|
155
155
|
getVisible(fiveState?: Partial<FiveState>): boolean;
|
|
156
|
-
getUnfoldedByPanoIndex(panoIndex?: number):
|
|
157
|
-
getUnfoldedByCamera():
|
|
156
|
+
getUnfoldedByPanoIndex(panoIndex?: number): boolean;
|
|
157
|
+
getUnfoldedByCamera(): boolean;
|
|
158
158
|
can(action: 'show' | 'hide' | 'fold' | 'unfold'): boolean;
|
|
159
159
|
onClick(params: Pick<TagClickParams, 'target'>): void;
|
|
160
160
|
abstract computeNormal(): THREE.Vector3 | undefined;
|
|
@@ -204,7 +204,7 @@ export declare abstract class BaseTag<C extends TagContentType = TagContentType,
|
|
|
204
204
|
* @description 获取是否展开
|
|
205
205
|
*/
|
|
206
206
|
protected computeUnfoldedByPanoIndex(panoIndex?: number): boolean;
|
|
207
|
-
protected computeUnfoldedByCamera():
|
|
207
|
+
protected computeUnfoldedByCamera(): boolean;
|
|
208
208
|
protected computeTagProject(): {
|
|
209
209
|
x: number;
|
|
210
210
|
y: number;
|
|
@@ -29,7 +29,6 @@ export declare abstract class TagRender extends TagUtil {
|
|
|
29
29
|
usePoint?: boolean;
|
|
30
30
|
}): void;
|
|
31
31
|
bindRenderer(contentType: string, builtInRenderer: TagContentType): void;
|
|
32
|
-
clearTags(): void;
|
|
33
32
|
/**
|
|
34
33
|
* @description 渲染3D贴片
|
|
35
34
|
*/
|
|
@@ -39,8 +38,6 @@ export declare abstract class TagRender extends TagUtil {
|
|
|
39
38
|
* @param model 模型
|
|
40
39
|
*/
|
|
41
40
|
updateTagCss3DObjectMatrix<S extends 'Model' | 'Plane' = 'Model'>(tag: TagInstance<TagContentType, S>, model: Object3D): void;
|
|
42
|
-
/** 添加模型标签 */
|
|
43
|
-
protected addMediaModelTag(tags: TagInstance[]): Promise<void>;
|
|
44
41
|
protected disposeAllCSS3DContainer(): void;
|
|
45
42
|
/**
|
|
46
43
|
* @description 检查并销毁不用的3D贴片
|
|
@@ -1,37 +1,21 @@
|
|
|
1
|
-
var
|
|
1
|
+
var k = Object.defineProperty;
|
|
2
2
|
var v = Object.getOwnPropertySymbols;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
for (var t in
|
|
6
|
-
|
|
3
|
+
var x = Object.prototype.hasOwnProperty, O = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var y = (m, i, t) => i in m ? k(m, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : m[i] = t, R = (m, i) => {
|
|
5
|
+
for (var t in i || (i = {}))
|
|
6
|
+
x.call(i, t) && y(m, t, i[t]);
|
|
7
7
|
if (v)
|
|
8
|
-
for (var t of v(
|
|
9
|
-
|
|
10
|
-
return
|
|
8
|
+
for (var t of v(i))
|
|
9
|
+
O.call(i, t) && y(m, t, i[t]);
|
|
10
|
+
return m;
|
|
11
11
|
};
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
}, p = (s) => {
|
|
21
|
-
try {
|
|
22
|
-
l(t.throw(s));
|
|
23
|
-
} catch (h) {
|
|
24
|
-
o(h);
|
|
25
|
-
}
|
|
26
|
-
}, l = (s) => s.done ? e(s.value) : Promise.resolve(s.value).then(i, p);
|
|
27
|
-
l((t = t.apply(a, r)).next());
|
|
28
|
-
});
|
|
29
|
-
import { Group as y, Quaternion as G, Vector3 as C, Matrix4 as M } from "three";
|
|
30
|
-
import E from "../Components/Tag/index.js";
|
|
31
|
-
import { isMediaModelTag as P } from "../utils/tag/tagCheck.js";
|
|
32
|
-
import { centerPoint as I } from "../../shared-utils/three/centerPoint.js";
|
|
33
|
-
import { toArray as N } from "../../shared-utils/util.js";
|
|
34
|
-
import { TagUtil as U } from "./TagUtil.js";
|
|
12
|
+
var c = (m, i, t) => (y(m, typeof i != "symbol" ? i + "" : i, t), t);
|
|
13
|
+
import { Group as T, Quaternion as G, Vector3 as P, Matrix4 as C } from "three";
|
|
14
|
+
import A from "../Components/Tag/index.js";
|
|
15
|
+
import { isMediaModelTag as M } from "../utils/tag/tagCheck.js";
|
|
16
|
+
import { centerPoint as E } from "../../shared-utils/three/centerPoint.js";
|
|
17
|
+
import { toArray as I } from "../../shared-utils/util.js";
|
|
18
|
+
import { TagUtil as N } from "./TagUtil.js";
|
|
35
19
|
import "../../vendor/svelte/internal/index.js";
|
|
36
20
|
import "../Components/Tag/TextTag/index.js";
|
|
37
21
|
import "../Components/Tag/TextTag/TextTag.js";
|
|
@@ -179,20 +163,20 @@ import "../../shared-utils/five/calculateThreeMouse.js";
|
|
|
179
163
|
import "../../shared-utils/three/core/Raycaster.js";
|
|
180
164
|
import "../../shared-utils/isTouchDevice.js";
|
|
181
165
|
import "../../base/BasePlugin.js";
|
|
182
|
-
class
|
|
166
|
+
class xr extends N {
|
|
183
167
|
constructor(t) {
|
|
184
168
|
super(t);
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
169
|
+
c(this, "rendererMap", /* @__PURE__ */ new Map());
|
|
170
|
+
c(this, "contentTypeMap", /* @__PURE__ */ new Map());
|
|
171
|
+
c(this, "group", new T());
|
|
172
|
+
c(this, "imagePlaneGroup", new T());
|
|
173
|
+
c(this, "gltfObjectGroup", new T());
|
|
190
174
|
/** 维护一个可用模型表,用于快速删除不应该在场景中的模型 */
|
|
191
|
-
|
|
175
|
+
c(this, "enabledModelTagSet", /* @__PURE__ */ new Set());
|
|
192
176
|
/** 临时状态 */
|
|
193
|
-
|
|
177
|
+
c(this, "temporaryState", { visible: !0 });
|
|
194
178
|
/** 点标签 */
|
|
195
|
-
|
|
179
|
+
c(this, "TagContainerSvelte");
|
|
196
180
|
this.group.name = "PanoTagPluginModelGroup", this.gltfObjectGroup.name = "PanoTagPluginGLTFObjectGroup", this.imagePlaneGroup.name = "ImagePlaneGroup", this.group.add(this.gltfObjectGroup), this.group.add(this.imagePlaneGroup);
|
|
197
181
|
}
|
|
198
182
|
/**
|
|
@@ -203,66 +187,59 @@ class Oe extends U {
|
|
|
203
187
|
* @param config.usePoint 是否需要标签点, 默认为 false
|
|
204
188
|
* @note 优先级低于 tag.element
|
|
205
189
|
*/
|
|
206
|
-
registerRenderer(t,
|
|
207
|
-
var
|
|
208
|
-
this.rendererMap.set(t, { renderer:
|
|
190
|
+
registerRenderer(t, r, o) {
|
|
191
|
+
var e;
|
|
192
|
+
this.rendererMap.set(t, { renderer: r, usePoint: (e = o == null ? void 0 : o.usePoint) != null ? e : !1 });
|
|
209
193
|
}
|
|
210
|
-
bindRenderer(t,
|
|
211
|
-
this.contentTypeMap.set(t,
|
|
212
|
-
}
|
|
213
|
-
clearTags() {
|
|
214
|
-
var t;
|
|
215
|
-
this.tags.length && (this.tags.forEach((e) => {
|
|
216
|
-
var o, i, p, l, s;
|
|
217
|
-
(i = (o = e.mediaPlane) == null ? void 0 : o.parent) == null || i.remove(e.mediaPlane), (s = (l = (p = e.model) == null ? void 0 : p.object) == null ? void 0 : l.parent) == null || s.remove(e.model.object);
|
|
218
|
-
}), this.tags = [], this.tagsLengthWillUpdate = !0, this.hooks.emit("tagsLengthChange"), (t = this.TagContainerSvelte) == null || t.$destroy(), this.TagContainerSvelte = void 0, this.disposeAllCSS3DContainer()), this.enabledModelTagSet.clear(), this.cache.clear();
|
|
194
|
+
bindRenderer(t, r) {
|
|
195
|
+
this.contentTypeMap.set(t, r);
|
|
219
196
|
}
|
|
220
197
|
/**
|
|
221
198
|
* @description 渲染3D贴片
|
|
222
199
|
*/
|
|
223
200
|
updateRender3DDomTag(t) {
|
|
224
|
-
(t ?
|
|
225
|
-
var
|
|
201
|
+
(t ? I(t) : this.filterCSS3DTag).forEach((o) => {
|
|
202
|
+
var e, a, f, D, g, b;
|
|
226
203
|
if (o.tag3DContentSvelte) {
|
|
227
|
-
const { svelteApp:
|
|
228
|
-
if ((
|
|
229
|
-
const
|
|
230
|
-
|
|
204
|
+
const { svelteApp: d, css3DInstance: n, initialNormal: l, currentNormal: p } = o.tag3DContentSvelte;
|
|
205
|
+
if ((a = n == null ? void 0 : n.css3DObject) == null || a.setVisible((this.state.visible && ((e = o.state) == null ? void 0 : e.visible)) !== !1), d.$set({ tag: o, hooks: this.hooks, state: this.state, temporaryState: this.temporaryState }), !l.equals(p)) {
|
|
206
|
+
const s = new G().setFromUnitVectors(l, p);
|
|
207
|
+
n.css3DObject.setRotationFromQuaternion(s);
|
|
231
208
|
}
|
|
232
209
|
return;
|
|
233
210
|
} else {
|
|
234
|
-
if (
|
|
211
|
+
if (M(o) && !((f = o.model) != null && f.object) || ((D = o.state) == null ? void 0 : D.visible) === !1 || !this.state.visible || !this.state.enabled || !this.css3DRenderPlugin)
|
|
235
212
|
return;
|
|
236
213
|
if (o.stickType === "3DPoint" && !o.normal)
|
|
237
214
|
return console.error("updateRenderPlaneTag: 三维点标签缺少法向量!");
|
|
238
|
-
const
|
|
239
|
-
if (!
|
|
215
|
+
const d = this.getPositions(o);
|
|
216
|
+
if (!d)
|
|
240
217
|
return;
|
|
241
|
-
const
|
|
242
|
-
if (!
|
|
218
|
+
const n = o.computeNormal();
|
|
219
|
+
if (!n)
|
|
243
220
|
return;
|
|
244
|
-
const
|
|
245
|
-
wrapperStyle: { zIndex: `${Math.round((1e4 - ((
|
|
246
|
-
},
|
|
247
|
-
if (o.computeRenderType() === "BehindDom" ||
|
|
248
|
-
|
|
249
|
-
const
|
|
250
|
-
|
|
221
|
+
const l = o.getConfig(), p = R({
|
|
222
|
+
wrapperStyle: { zIndex: `${Math.round((1e4 - ((g = o.getDistance()) != null ? g : 0)) * 100)}` }
|
|
223
|
+
}, l.tag3DConfig);
|
|
224
|
+
if (o.computeRenderType() === "BehindDom" || p.mode === "behind") {
|
|
225
|
+
p.mode = "behind", p.container = document.createElement("div");
|
|
226
|
+
const h = "black";
|
|
227
|
+
p.container.style.backgroundColor = h, p.container.style.border = `3px solid ${h}`, this.css3DRenderPlugin.hooks.on("render", () => {
|
|
251
228
|
var S;
|
|
252
|
-
if (
|
|
253
|
-
const
|
|
254
|
-
this.hooks.emit("click", { event:
|
|
229
|
+
if (s.css3DObject.opacityMesh && l.clickable !== !1) {
|
|
230
|
+
const j = this.addObjectClickHandler(o, s.css3DObject.opacityMesh, (w) => {
|
|
231
|
+
this.hooks.emit("click", { event: w, target: "TagContent", tag: o });
|
|
255
232
|
});
|
|
256
|
-
(S = this.store.css3DRenderDisposer.get(o.id)) == null || S.push(
|
|
233
|
+
(S = this.store.css3DRenderDisposer.get(o.id)) == null || S.push(j);
|
|
257
234
|
}
|
|
258
235
|
});
|
|
259
236
|
}
|
|
260
|
-
const
|
|
261
|
-
if (!
|
|
237
|
+
const s = this.css3DRenderPlugin.create3DDomContainer(d, p);
|
|
238
|
+
if (!s)
|
|
262
239
|
return;
|
|
263
|
-
this.store.css3DRenderDisposer.set(o.id, [
|
|
264
|
-
const
|
|
265
|
-
target:
|
|
240
|
+
this.store.css3DRenderDisposer.set(o.id, [s.dispose]);
|
|
241
|
+
const u = new A({
|
|
242
|
+
target: s.container,
|
|
266
243
|
props: {
|
|
267
244
|
tag: o,
|
|
268
245
|
hooks: this.hooks,
|
|
@@ -273,15 +250,15 @@ class Oe extends U {
|
|
|
273
250
|
}
|
|
274
251
|
});
|
|
275
252
|
o.tag3DContentSvelte = {
|
|
276
|
-
svelteApp:
|
|
277
|
-
domContainer:
|
|
278
|
-
css3DInstance:
|
|
279
|
-
initialNormal:
|
|
280
|
-
currentNormal:
|
|
253
|
+
svelteApp: u,
|
|
254
|
+
domContainer: s,
|
|
255
|
+
css3DInstance: s,
|
|
256
|
+
initialNormal: n,
|
|
257
|
+
currentNormal: n,
|
|
281
258
|
dispose: () => {
|
|
282
|
-
|
|
259
|
+
u.$destroy(), s.dispose();
|
|
283
260
|
}
|
|
284
|
-
},
|
|
261
|
+
}, M(o) && ((b = o.model) != null && b.object) && this.updateTagCss3DObjectMatrix(o, o.model.object);
|
|
285
262
|
}
|
|
286
263
|
}), this.clearUnusedPanelTag();
|
|
287
264
|
}
|
|
@@ -289,30 +266,23 @@ class Oe extends U {
|
|
|
289
266
|
* @param tag 标签
|
|
290
267
|
* @param model 模型
|
|
291
268
|
*/
|
|
292
|
-
updateTagCss3DObjectMatrix(t,
|
|
293
|
-
var
|
|
294
|
-
const o = (
|
|
295
|
-
if (!
|
|
269
|
+
updateTagCss3DObjectMatrix(t, r) {
|
|
270
|
+
var s, u, h;
|
|
271
|
+
const o = (u = (s = t.getConfig().tag3DConfig) == null ? void 0 : s.ratio) != null ? u : 216e-5, e = (h = t.tag3DContentSvelte) == null ? void 0 : h.css3DInstance.css3DObject;
|
|
272
|
+
if (!e)
|
|
296
273
|
return;
|
|
297
|
-
const
|
|
298
|
-
if (!
|
|
274
|
+
const a = M(t) ? t.data.mediaPosition : t.position;
|
|
275
|
+
if (!a || a.length !== 4 || !Array.isArray(a[0]) || !Array.isArray(a[2]))
|
|
299
276
|
return;
|
|
300
|
-
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
}
|
|
306
|
-
/** 添加模型标签 */
|
|
307
|
-
addMediaModelTag(t) {
|
|
308
|
-
return w(this, null, function* () {
|
|
309
|
-
const e = t.filter((o) => o.stickType === "Model").map((o) => o.loadModel());
|
|
310
|
-
yield Promise.all(e), t.forEach((o) => o.updateVisible());
|
|
311
|
-
});
|
|
277
|
+
r.updateWorldMatrix(!1, !1);
|
|
278
|
+
const f = r.matrixWorld, D = new P().fromArray(a[0]), g = new P().fromArray(a[2]), b = E(D, g).add(new P(0, 0, 5e-4)), d = new C().setPosition(b), n = new C().makeScale(o, o, o), l = new C().multiply(f).multiply(d).multiply(n);
|
|
279
|
+
l.decompose(e.position, e.quaternion, e.scale);
|
|
280
|
+
const p = e.opacityMesh;
|
|
281
|
+
p && l.decompose(p.position, p.quaternion, p.scale);
|
|
312
282
|
}
|
|
313
283
|
disposeAllCSS3DContainer() {
|
|
314
284
|
for (const [, t] of this.store.css3DRenderDisposer)
|
|
315
|
-
t == null || t.forEach((
|
|
285
|
+
t == null || t.forEach((r) => r == null ? void 0 : r());
|
|
316
286
|
this.store.css3DRenderDisposer = /* @__PURE__ */ new Map();
|
|
317
287
|
}
|
|
318
288
|
/**
|
|
@@ -320,15 +290,15 @@ class Oe extends U {
|
|
|
320
290
|
*/
|
|
321
291
|
clearUnusedPanelTag() {
|
|
322
292
|
this.filter2DPointTag.forEach((t) => {
|
|
323
|
-
var
|
|
324
|
-
(
|
|
293
|
+
var r;
|
|
294
|
+
(r = t.tag3DContentSvelte) == null || r.css3DInstance.dispose(), t.tag3DContentSvelte = void 0;
|
|
325
295
|
});
|
|
326
|
-
for (const [t,
|
|
296
|
+
for (const [t, r] of this.store.css3DRenderDisposer) {
|
|
327
297
|
const o = this.getTagById(t);
|
|
328
|
-
(!o || o.stickType === "2DPoint") && (
|
|
298
|
+
(!o || o.stickType === "2DPoint") && (r == null || r.forEach((e) => e == null ? void 0 : e()), this.store.css3DRenderDisposer.delete(t));
|
|
329
299
|
}
|
|
330
300
|
}
|
|
331
301
|
}
|
|
332
302
|
export {
|
|
333
|
-
|
|
303
|
+
xr as TagRender
|
|
334
304
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var D = Object.defineProperty, P = Object.defineProperties;
|
|
2
2
|
var U = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var b = Object.getOwnPropertySymbols;
|
|
4
|
+
var E = Object.prototype.hasOwnProperty, A = Object.prototype.propertyIsEnumerable;
|
|
5
5
|
var u = (d, a, e) => a in d ? D(d, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : d[a] = e, f = (d, a) => {
|
|
6
6
|
for (var e in a || (a = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
|
|
7
|
+
E.call(a, e) && u(d, e, a[e]);
|
|
8
|
+
if (b)
|
|
9
|
+
for (var e of b(a))
|
|
10
|
+
A.call(a, e) && u(d, e, a[e]);
|
|
11
11
|
return d;
|
|
12
12
|
}, c = (d, a) => P(d, U(a));
|
|
13
13
|
var p = (d, a, e) => (u(d, typeof a != "symbol" ? a + "" : a, e), e);
|
|
@@ -29,14 +29,14 @@ var l = (d, a, e) => new Promise((t, i) => {
|
|
|
29
29
|
});
|
|
30
30
|
import * as v from "three";
|
|
31
31
|
import { objectAssignDeepExports as m } from "../../vendor/object-assign-deep/objectAssignDeep.js";
|
|
32
|
-
import { arrayPositionToVector3 as
|
|
33
|
-
import { isModelTag as
|
|
32
|
+
import { arrayPositionToVector3 as F } from "../../shared-utils/positionToVector3.js";
|
|
33
|
+
import { isModelTag as k, isMediaModelTag as w } from "../utils/tag/tagCheck.js";
|
|
34
34
|
import { debounce as M } from "../utils/debounce.js";
|
|
35
|
-
import { throttle as
|
|
36
|
-
import _, { getTagStickType as
|
|
37
|
-
import { generateBlankAudio as
|
|
35
|
+
import { throttle as y } from "../utils/throttle.js";
|
|
36
|
+
import _, { getTagStickType as L } from "../utils/tag/format.js";
|
|
37
|
+
import { generateBlankAudio as I, AudioNamespace as B } from "../../shared-utils/audio.js";
|
|
38
38
|
import { resizeObserver as T } from "../../shared-utils/dom/resizeObserver.js";
|
|
39
|
-
import { TagRender as
|
|
39
|
+
import { TagRender as R } from "./TagRender.js";
|
|
40
40
|
import { isModelLike as O } from "../../shared-utils/five/mode.js";
|
|
41
41
|
import "hammerjs";
|
|
42
42
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
@@ -51,9 +51,9 @@ import { DebugUtil as V } from "../utils/DebugUtil.js";
|
|
|
51
51
|
import { safeObj as C } from "../../shared-utils/safeObj.js";
|
|
52
52
|
import { PointTag as z } from "./Tag/PointTag.js";
|
|
53
53
|
import { ModelTag as Q } from "./Tag/ModelTag.js";
|
|
54
|
-
import { PlaneTag as
|
|
55
|
-
import
|
|
56
|
-
import { tweenProgress as
|
|
54
|
+
import { PlaneTag as $ } from "./Tag/PlaneTag.js";
|
|
55
|
+
import x from "../Components/TagContainer.js";
|
|
56
|
+
import { tweenProgress as j } from "../../shared-utils/animationFrame/BetterTween.js";
|
|
57
57
|
import "../Components/Tag/index.js";
|
|
58
58
|
import "../../vendor/svelte/internal/index.js";
|
|
59
59
|
import "../Components/Tag/TextTag/index.js";
|
|
@@ -193,7 +193,7 @@ import "../utils/addDebugPoints.js";
|
|
|
193
193
|
import "../Components/TagItem.js";
|
|
194
194
|
import "../Components/Common/TagPoint.js";
|
|
195
195
|
const S = "Dnalogel-PanoTagPlugin", Ji = (d) => `${S}--${d}`;
|
|
196
|
-
class Zi extends
|
|
196
|
+
class Zi extends R {
|
|
197
197
|
constructor(e, t) {
|
|
198
198
|
super(e);
|
|
199
199
|
/** state */
|
|
@@ -241,7 +241,7 @@ class Zi extends B {
|
|
|
241
241
|
p(this, "handleFivePanoArrived", () => l(this, null, function* () {
|
|
242
242
|
this.tags.forEach((e) => {
|
|
243
243
|
e.state.visible = !1, e.temporaryState = c(f({}, e.temporaryState), { visible: !0 }), e.applyVisible(), e.updateVisible();
|
|
244
|
-
}), this.temporaryState.visible = !0, this.addRenderQueue({ type: "TagContainerSvelte", keys: ["temporaryState"] }), yield this.setUnfolded(), this.updateRender3DDomTag(), this.tags.filter(
|
|
244
|
+
}), this.temporaryState.visible = !0, this.addRenderQueue({ type: "TagContainerSvelte", keys: ["temporaryState"] }), yield this.setUnfolded(), this.updateRender3DDomTag(), this.tags.filter(k).filter((e) => {
|
|
245
245
|
var t;
|
|
246
246
|
return (t = e.getConfig().modelConfig) == null ? void 0 : t.autoLookAtEnabled;
|
|
247
247
|
}).forEach((e) => {
|
|
@@ -252,7 +252,7 @@ class Zi extends B {
|
|
|
252
252
|
t.position.copy(i.position), t.quaternion.copy(i.quaternion);
|
|
253
253
|
const o = this.five.camera.position;
|
|
254
254
|
t.lookAt(o.clone().setY(t.position.y));
|
|
255
|
-
const s = i.quaternion.clone(), n = t.quaternion.clone(), r =
|
|
255
|
+
const s = i.quaternion.clone(), n = t.quaternion.clone(), r = j();
|
|
256
256
|
r.onUpdate(({ progress: g }) => {
|
|
257
257
|
i.quaternion.copy(s.clone().slerp(n, g));
|
|
258
258
|
}), r.play();
|
|
@@ -290,7 +290,7 @@ class Zi extends B {
|
|
|
290
290
|
} else {
|
|
291
291
|
if (!this.container)
|
|
292
292
|
return console.error("updateRenderPlaneTag: tag2DContainer not found");
|
|
293
|
-
this.TagContainerSvelte = new
|
|
293
|
+
this.TagContainerSvelte = new x({
|
|
294
294
|
target: this.container,
|
|
295
295
|
props: c(f({}, n), { state: c(f({}, this.state), { enabled: !1 }) })
|
|
296
296
|
}), G(() => {
|
|
@@ -301,9 +301,9 @@ class Zi extends B {
|
|
|
301
301
|
}
|
|
302
302
|
}), this.renderQueue.clear();
|
|
303
303
|
});
|
|
304
|
-
this.params = m({}, { debug: !1, config: this.config }, f({}, t)), this.debug = this.params.debug, this.config = this.params.config, this.debug && this.debugUtil.bindLog(),
|
|
304
|
+
this.params = m({}, { debug: !1, config: this.config }, f({}, t)), this.debug = this.params.debug, this.config = this.params.config, this.debug && this.debugUtil.bindLog(), I(1, { namespace: B.PlayAudio });
|
|
305
305
|
try {
|
|
306
|
-
Array.isArray(window.__PANOTAGPLUGIN_DEBUG_LIST__) || (window.__PANOTAGPLUGIN_DEBUG_LIST__ = []), window.__PANOTAGPLUGIN_DEBUG_LIST__.push(this), window.__PANOTAGPLUGIN_DEBUG__ || Object.defineProperty(window, "__PANOTAGPLUGIN_DEBUG__", {
|
|
306
|
+
Array.isArray(window.__PANOTAGPLUGIN_DEBUG_LIST__) || (window.__PANOTAGPLUGIN_DEBUG_LIST__ = []), this.NAME = S + "-" + window.__PANOTAGPLUGIN_DEBUG_LIST__.length, window.__PANOTAGPLUGIN_DEBUG_LIST__.push(this), window.__PANOTAGPLUGIN_DEBUG__ || Object.defineProperty(window, "__PANOTAGPLUGIN_DEBUG__", {
|
|
307
307
|
get: function() {
|
|
308
308
|
return window.__PANOTAGPLUGIN_DEBUG_LIST__.sort((i, o) => o.tags.length - i.tags.length)[0];
|
|
309
309
|
}
|
|
@@ -325,7 +325,7 @@ class Zi extends B {
|
|
|
325
325
|
var i, o;
|
|
326
326
|
this.clearTags();
|
|
327
327
|
try {
|
|
328
|
-
console.debug(
|
|
328
|
+
console.debug(this.NAME, " load:", { data: JSON.parse(JSON.stringify(e)) });
|
|
329
329
|
} catch (s) {
|
|
330
330
|
}
|
|
331
331
|
this.config = m({}, this.config, {
|
|
@@ -342,18 +342,20 @@ class Zi extends B {
|
|
|
342
342
|
addTag(e) {
|
|
343
343
|
return l(this, null, function* () {
|
|
344
344
|
const i = (Array.isArray(e) ? e : [e]).filter((o) => o.position).map((o) => {
|
|
345
|
-
const s =
|
|
345
|
+
const s = L(o);
|
|
346
346
|
if (s === "2DPoint" || s === "3DPoint")
|
|
347
347
|
return new z(this, o);
|
|
348
348
|
if (s === "Model")
|
|
349
349
|
return new Q(this, o);
|
|
350
350
|
if (s === "Plane")
|
|
351
|
-
return new
|
|
351
|
+
return new $(this, o);
|
|
352
352
|
});
|
|
353
353
|
return i.forEach(_), this.tags.push(...i), this.tagsLengthWillUpdate = !0, N(this.five).then(() => l(this, null, function* () {
|
|
354
354
|
var o, s;
|
|
355
|
-
this.store.eventListenerDisposer && ((s = (o = this.store).eventListenerDisposer) == null || s.call(o)), this.state.enabled && this.handleEnable(), this.addResizeListener(), this.clearUnusedPanelTag(),
|
|
356
|
-
|
|
355
|
+
this.store.eventListenerDisposer && ((s = (o = this.store).eventListenerDisposer) == null || s.call(o)), this.state.enabled && this.handleEnable(), this.addResizeListener(), this.clearUnusedPanelTag(), i.forEach((n) => {
|
|
356
|
+
this.tags.includes(n) && (n.stickType === "Model" && n.loadModel().then(() => {
|
|
357
|
+
this.tags.includes(n) && n.updateVisible();
|
|
358
|
+
}), n.updateVisible(), n.updateZIndex());
|
|
357
359
|
}), this.setUnfolded(), this.addRenderQueue({ type: "TagContainerSvelte" }), this.hooks.emit("tagsLengthChange");
|
|
358
360
|
}));
|
|
359
361
|
});
|
|
@@ -463,7 +465,7 @@ class Zi extends B {
|
|
|
463
465
|
*/
|
|
464
466
|
changeTagNormalById(e, t) {
|
|
465
467
|
const i = this.getTagById(e);
|
|
466
|
-
i && i.tag3DContentSvelte && (i.tag3DContentSvelte.currentNormal =
|
|
468
|
+
i && i.tag3DContentSvelte && (i.tag3DContentSvelte.currentNormal = F(t));
|
|
467
469
|
}
|
|
468
470
|
/**
|
|
469
471
|
* @description 改变data
|
|
@@ -507,6 +509,16 @@ class Zi extends B {
|
|
|
507
509
|
updateRenderAllTags() {
|
|
508
510
|
this.tags.forEach((e) => e.updateVisible()), this.five.needsRender = !0;
|
|
509
511
|
}
|
|
512
|
+
/**
|
|
513
|
+
* @description 清除所有标签
|
|
514
|
+
*/
|
|
515
|
+
clearTags() {
|
|
516
|
+
var e;
|
|
517
|
+
this.tags.length && (this.tags.forEach((t) => {
|
|
518
|
+
var i, o, s, n, r;
|
|
519
|
+
(o = (i = t.mediaPlane) == null ? void 0 : i.parent) == null || o.remove(t.mediaPlane), (r = (n = (s = t.model) == null ? void 0 : s.object) == null ? void 0 : n.parent) == null || r.remove(t.model.object);
|
|
520
|
+
}), this.tags = [], this.tagsLengthWillUpdate = !0, this.hooks.emit("tagsLengthChange"), (e = this.TagContainerSvelte) == null || e.$destroy(), this.TagContainerSvelte = void 0, this.disposeAllCSS3DContainer()), this.enabledModelTagSet.clear(), this.cache.clear();
|
|
521
|
+
}
|
|
510
522
|
/**
|
|
511
523
|
* @description 设置 unfolded
|
|
512
524
|
*/
|
|
@@ -554,7 +566,7 @@ class Zi extends B {
|
|
|
554
566
|
}, i = () => {
|
|
555
567
|
this.state.enabled && (this.temporaryState.visible = !1, this.addRenderQueue({ type: "TagContainerSvelte", keys: ["temporaryState"] }));
|
|
556
568
|
}, { observe: o, unobserve: s } = T(
|
|
557
|
-
|
|
569
|
+
y(() => {
|
|
558
570
|
this.store.resizeObserverDisposer && i();
|
|
559
571
|
}, 500),
|
|
560
572
|
e
|
|
@@ -592,7 +604,7 @@ class Zi extends B {
|
|
|
592
604
|
addEventListener() {
|
|
593
605
|
const { five: e, hooks: t } = this;
|
|
594
606
|
let i = !1;
|
|
595
|
-
const o =
|
|
607
|
+
const o = y(() => {
|
|
596
608
|
i || (i = !0, e.ready().then(() => {
|
|
597
609
|
this.onFiveEveryReady(), i = !1;
|
|
598
610
|
}));
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv3.50.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv3.50.13",
|
|
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",
|