@realsee/dnalogel 3.47.7 → 3.47.8
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/PointTag.d.ts +0 -1
- package/dist/index.cjs.js +3 -3
- package/dist/index.js +4 -7
- package/dist/index.umd.js +3 -3
- package/libs/PanoTagPlugin/controller/Tag/PointTag.d.ts +0 -1
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +0 -3
- package/libs/PanoTagPlugin/controller/TagRender.js +54 -54
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
var x = Object.defineProperty;
|
|
2
2
|
var v = Object.getOwnPropertySymbols;
|
|
3
3
|
var O = Object.prototype.hasOwnProperty, A = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var T = (
|
|
4
|
+
var T = (a, e, t) => e in a ? x(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t, j = (a, e) => {
|
|
5
5
|
for (var t in e || (e = {}))
|
|
6
|
-
O.call(e, t) && T(
|
|
6
|
+
O.call(e, t) && T(a, t, e[t]);
|
|
7
7
|
if (v)
|
|
8
8
|
for (var t of v(e))
|
|
9
|
-
A.call(e, t) && T(
|
|
10
|
-
return
|
|
9
|
+
A.call(e, t) && T(a, t, e[t]);
|
|
10
|
+
return a;
|
|
11
11
|
};
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var r = (
|
|
12
|
+
var d = (a, e, t) => (T(a, typeof e != "symbol" ? e + "" : e, t), t);
|
|
13
|
+
var w = (a, e, t) => new Promise((i, o) => {
|
|
14
|
+
var r = (p) => {
|
|
15
15
|
try {
|
|
16
|
-
|
|
16
|
+
l(t.next(p));
|
|
17
17
|
} catch (h) {
|
|
18
18
|
o(h);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, m = (p) => {
|
|
21
21
|
try {
|
|
22
|
-
|
|
22
|
+
l(t.throw(p));
|
|
23
23
|
} catch (h) {
|
|
24
24
|
o(h);
|
|
25
25
|
}
|
|
26
|
-
},
|
|
27
|
-
|
|
26
|
+
}, l = (p) => p.done ? i(p.value) : Promise.resolve(p.value).then(r, m);
|
|
27
|
+
l((t = t.apply(a, e)).next());
|
|
28
28
|
});
|
|
29
29
|
import { Group as y, Quaternion as G, Vector3 as C, Matrix4 as M } from "three";
|
|
30
30
|
import E from "../Components/Tag/index.js";
|
|
@@ -230,17 +230,17 @@ import "../../CSS3DRenderPlugin/Controller.js";
|
|
|
230
230
|
class vr extends U {
|
|
231
231
|
constructor(t) {
|
|
232
232
|
super(t);
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
233
|
+
d(this, "rendererMap", /* @__PURE__ */ new Map());
|
|
234
|
+
d(this, "contentTypeMap", /* @__PURE__ */ new Map());
|
|
235
|
+
d(this, "group", new y());
|
|
236
|
+
d(this, "imagePlaneGroup", new y());
|
|
237
|
+
d(this, "gltfObjectGroup", new y());
|
|
238
238
|
/** 维护一个可用模型表,用于快速删除不应该在场景中的模型 */
|
|
239
|
-
|
|
239
|
+
d(this, "enabledModelTagSet", /* @__PURE__ */ new Set());
|
|
240
240
|
/** 临时状态 */
|
|
241
|
-
|
|
241
|
+
d(this, "temporaryState", { visible: !0 });
|
|
242
242
|
/** 点标签 */
|
|
243
|
-
|
|
243
|
+
d(this, "TagContainerSvelte");
|
|
244
244
|
this.group.name = "PanoTagPluginModelGroup", this.gltfObjectGroup.name = "PanoTagPluginGLTFObjectGroup", this.imagePlaneGroup.name = "ImagePlaneGroup", this.group.add(this.gltfObjectGroup), this.group.add(this.imagePlaneGroup);
|
|
245
245
|
}
|
|
246
246
|
/**
|
|
@@ -261,8 +261,8 @@ class vr extends U {
|
|
|
261
261
|
clearTags() {
|
|
262
262
|
var t;
|
|
263
263
|
this.tags.length && (this.tags.forEach((i) => {
|
|
264
|
-
var o, r;
|
|
265
|
-
(r = (o = i.mediaPlane) == null ? void 0 : o.parent) == null || r.remove(i.mediaPlane);
|
|
264
|
+
var o, r, m, l, p;
|
|
265
|
+
(r = (o = i.mediaPlane) == null ? void 0 : o.parent) == null || r.remove(i.mediaPlane), (p = (l = (m = i.model) == null ? void 0 : m.object) == null ? void 0 : l.parent) == null || p.remove(i.model.object);
|
|
266
266
|
}), 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();
|
|
267
267
|
}
|
|
268
268
|
/**
|
|
@@ -270,47 +270,47 @@ class vr extends U {
|
|
|
270
270
|
*/
|
|
271
271
|
updateRender3DDomTag(t) {
|
|
272
272
|
(t ? N(t) : this.filterCSS3DTag).forEach((o) => {
|
|
273
|
-
var r,
|
|
273
|
+
var r, m, l, p, h, b;
|
|
274
274
|
if (o.tag3DContentSvelte) {
|
|
275
|
-
const { svelteApp: f, css3DInstance:
|
|
276
|
-
if ((
|
|
277
|
-
const
|
|
278
|
-
|
|
275
|
+
const { svelteApp: f, css3DInstance: c, initialNormal: u, currentNormal: s } = o.tag3DContentSvelte;
|
|
276
|
+
if ((m = c == null ? void 0 : c.css3DObject) == null || m.setVisible((this.state.visible && ((r = o.state) == null ? void 0 : r.visible)) !== !1), f.$set({ tag: o, hooks: this.hooks, state: this.state, temporaryState: this.temporaryState }), !u.equals(s)) {
|
|
277
|
+
const n = new G().setFromUnitVectors(u, s);
|
|
278
|
+
c.css3DObject.setRotationFromQuaternion(n);
|
|
279
279
|
}
|
|
280
280
|
return;
|
|
281
281
|
} else {
|
|
282
|
-
if (P(o) && !((
|
|
282
|
+
if (P(o) && !((l = o.model) != null && l.object) || ((p = o.state) == null ? void 0 : p.visible) === !1 || !this.state.visible || !this.state.enabled || !this.css3DRenderPlugin)
|
|
283
283
|
return;
|
|
284
284
|
if (o.stickType === "3DPoint" && !o.normal)
|
|
285
285
|
return console.error("updateRenderPlaneTag: 三维点标签缺少法向量!");
|
|
286
286
|
const f = this.getPositions(o);
|
|
287
287
|
if (!f)
|
|
288
288
|
return;
|
|
289
|
-
const
|
|
290
|
-
if (!
|
|
289
|
+
const c = o.computeNormal();
|
|
290
|
+
if (!c)
|
|
291
291
|
return;
|
|
292
|
-
const u = o.getConfig(),
|
|
292
|
+
const u = o.getConfig(), s = j({
|
|
293
293
|
wrapperStyle: { zIndex: `${Math.round((1e4 - ((h = o.getDistance()) != null ? h : 0)) * 100)}` }
|
|
294
294
|
}, u.tag3DConfig);
|
|
295
|
-
if (o.computeRenderType() === "BehindDom" ||
|
|
296
|
-
|
|
295
|
+
if (o.computeRenderType() === "BehindDom" || s.mode === "behind") {
|
|
296
|
+
s.mode = "behind", s.container = document.createElement("div");
|
|
297
297
|
const D = "black";
|
|
298
|
-
|
|
298
|
+
s.container.style.backgroundColor = D, s.container.style.border = `3px solid ${D}`, this.css3DRenderPlugin.hooks.on("render", () => {
|
|
299
299
|
var S;
|
|
300
|
-
if (
|
|
301
|
-
const
|
|
300
|
+
if (n.css3DObject.opacityMesh && u.clickable !== !1) {
|
|
301
|
+
const R = this.addObjectClickHandler(o, n.css3DObject.opacityMesh, (k) => {
|
|
302
302
|
this.hooks.emit("click", { event: k, target: "TagContent", tag: o });
|
|
303
303
|
});
|
|
304
|
-
(S = this.store.css3DRenderDisposer.get(o.id)) == null || S.push(
|
|
304
|
+
(S = this.store.css3DRenderDisposer.get(o.id)) == null || S.push(R);
|
|
305
305
|
}
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
|
-
const
|
|
309
|
-
if (!
|
|
308
|
+
const n = this.css3DRenderPlugin.create3DDomContainer(f, s);
|
|
309
|
+
if (!n)
|
|
310
310
|
return;
|
|
311
|
-
this.store.css3DRenderDisposer.set(o.id, [
|
|
311
|
+
this.store.css3DRenderDisposer.set(o.id, [n.dispose]);
|
|
312
312
|
const g = new E({
|
|
313
|
-
target:
|
|
313
|
+
target: n.container,
|
|
314
314
|
props: {
|
|
315
315
|
tag: o,
|
|
316
316
|
hooks: this.hooks,
|
|
@@ -322,12 +322,12 @@ class vr extends U {
|
|
|
322
322
|
});
|
|
323
323
|
o.tag3DContentSvelte = {
|
|
324
324
|
svelteApp: g,
|
|
325
|
-
domContainer:
|
|
326
|
-
css3DInstance:
|
|
327
|
-
initialNormal:
|
|
328
|
-
currentNormal:
|
|
325
|
+
domContainer: n,
|
|
326
|
+
css3DInstance: n,
|
|
327
|
+
initialNormal: c,
|
|
328
|
+
currentNormal: c,
|
|
329
329
|
dispose: () => {
|
|
330
|
-
g.$destroy(),
|
|
330
|
+
g.$destroy(), n.dispose();
|
|
331
331
|
}
|
|
332
332
|
}, P(o) && ((b = o.model) != null && b.object) && this.updateTagCss3DObjectMatrix(o, o.model.object);
|
|
333
333
|
}
|
|
@@ -338,22 +338,22 @@ class vr extends U {
|
|
|
338
338
|
* @param model 模型
|
|
339
339
|
*/
|
|
340
340
|
updateTagCss3DObjectMatrix(t, i) {
|
|
341
|
-
var
|
|
342
|
-
const o = (g = (
|
|
341
|
+
var n, g, D;
|
|
342
|
+
const o = (g = (n = t.getConfig().tag3DConfig) == null ? void 0 : n.ratio) != null ? g : 216e-5, r = (D = t.tag3DContentSvelte) == null ? void 0 : D.css3DInstance.css3DObject;
|
|
343
343
|
if (!r)
|
|
344
344
|
return;
|
|
345
|
-
const
|
|
346
|
-
if (!
|
|
345
|
+
const m = P(t) ? t.data.mediaPosition : t.position;
|
|
346
|
+
if (!m || m.length !== 4 || !Array.isArray(m[0]) || !Array.isArray(m[2]))
|
|
347
347
|
return;
|
|
348
348
|
i.updateWorldMatrix(!1, !1);
|
|
349
|
-
const
|
|
349
|
+
const l = i.matrixWorld, p = new C().fromArray(m[0]), h = new C().fromArray(m[2]), b = I(p, h).add(new C(0, 0, 5e-4)), f = new M().setPosition(b), c = new M().makeScale(o, o, o), u = new M().multiply(l).multiply(f).multiply(c);
|
|
350
350
|
u.decompose(r.position, r.quaternion, r.scale);
|
|
351
|
-
const
|
|
352
|
-
|
|
351
|
+
const s = r.opacityMesh;
|
|
352
|
+
s && u.decompose(s.position, s.quaternion, s.scale);
|
|
353
353
|
}
|
|
354
354
|
/** 添加模型标签 */
|
|
355
355
|
addMediaModelTag(t) {
|
|
356
|
-
return
|
|
356
|
+
return w(this, null, function* () {
|
|
357
357
|
const i = t.filter((o) => o.stickType === "Model").map((o) => o.loadModel());
|
|
358
358
|
yield Promise.all(i), t.forEach((o) => o.updateVisible());
|
|
359
359
|
});
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv3.47.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv3.47.8",
|
|
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",
|