@realsee/dnalogel 3.79.2 → 3.79.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.
- package/CHANGELOG.md +4 -0
- package/dist/PanoTagPlugin/controller/Tag/PlaneTag.d.ts +7 -1
- package/dist/index.cjs.js +3 -3
- package/dist/index.js +118 -98
- package/dist/index.umd.js +18 -18
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.d.ts +7 -1
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +127 -107
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,6 @@ import { BaseTag } from './BaseTag';
|
|
|
4
4
|
import type { PartialObjectDeep } from '../../../typings/typings';
|
|
5
5
|
import type { Vector3 } from 'three';
|
|
6
6
|
import { Rectangle } from '../../../Sculpt/Objects/Rectangle';
|
|
7
|
-
export type PlaneTagInterface<C extends TagContentType = TagContentType> = TagInstance<C, 'Plane'>;
|
|
8
7
|
export declare class PlaneTag<C extends TagContentType = TagContentType> extends BaseTag<C, 'Plane'> {
|
|
9
8
|
rectanglePlane?: Rectangle;
|
|
10
9
|
private _floorIndex?;
|
|
@@ -28,8 +27,15 @@ export declare class PlaneTag<C extends TagContentType = TagContentType> extends
|
|
|
28
27
|
private initialSculpt;
|
|
29
28
|
editorEnable(): void;
|
|
30
29
|
editorDisable(position?: Vector3[]): void;
|
|
30
|
+
private getRectangleHelper;
|
|
31
|
+
/**
|
|
32
|
+
* 标签因为 visiblePanoIndex 等可见性规则被隐藏时,同时隐藏编辑辅助元素。
|
|
33
|
+
* 当标签重新可见且仍处于编辑态时,再恢复辅助元素显示。
|
|
34
|
+
*/
|
|
35
|
+
private syncEditorAuxiliaryVisibility;
|
|
31
36
|
private renderVideoPlane;
|
|
32
37
|
private renderImagePlane;
|
|
33
38
|
private renderEmptyPlane;
|
|
34
39
|
computeNormal(): Vector3;
|
|
35
40
|
}
|
|
41
|
+
export type PlaneTagInterface<C extends TagContentType = TagContentType> = TagInstance<C, 'Plane'>;
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var j = Object.defineProperty, V = Object.defineProperties;
|
|
2
|
+
var k = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var F = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var M = Object.prototype.hasOwnProperty, w = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var b = (c, d, t) => d in c ? j(c, d, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[d] = t, I = (c, d) => {
|
|
6
6
|
for (var t in d || (d = {}))
|
|
7
|
-
|
|
7
|
+
M.call(d, t) && b(c, t, d[t]);
|
|
8
8
|
if (F)
|
|
9
9
|
for (var t of F(d))
|
|
10
|
-
w.call(d, t) &&
|
|
10
|
+
w.call(d, t) && b(c, t, d[t]);
|
|
11
11
|
return c;
|
|
12
|
-
}, S = (c, d) =>
|
|
13
|
-
var
|
|
12
|
+
}, S = (c, d) => V(c, k(d));
|
|
13
|
+
var v = (c, d, t) => (b(c, typeof d != "symbol" ? d + "" : d, t), t);
|
|
14
14
|
var C = (c, d, t) => new Promise((e, i) => {
|
|
15
15
|
var o = (r) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
18
|
-
} catch (
|
|
19
|
-
i(
|
|
17
|
+
p(t.next(r));
|
|
18
|
+
} catch (a) {
|
|
19
|
+
i(a);
|
|
20
20
|
}
|
|
21
21
|
}, l = (r) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
} catch (
|
|
25
|
-
i(
|
|
23
|
+
p(t.throw(r));
|
|
24
|
+
} catch (a) {
|
|
25
|
+
i(a);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, p = (r) => r.done ? e(r.value) : Promise.resolve(r.value).then(o, l);
|
|
28
|
+
p((t = t.apply(c, d)).next());
|
|
29
29
|
});
|
|
30
|
-
import { CONST as
|
|
31
|
-
import { CSS3DObjectPlus as
|
|
32
|
-
import { anyPositionToVector3 as
|
|
33
|
-
import * as
|
|
34
|
-
import { planeNormal as
|
|
35
|
-
import { centerPoint as
|
|
36
|
-
import { VideoPlane as
|
|
37
|
-
import
|
|
38
|
-
import { BaseTag as
|
|
30
|
+
import { CONST as _ } from "../../../shared-utils/constants.js";
|
|
31
|
+
import { CSS3DObjectPlus as O } from "../../../shared-utils/CSS3DRender/CSS3DObject.js";
|
|
32
|
+
import { anyPositionToVector3 as E, arrayPositionToVector3 as P } from "../../../shared-utils/positionToVector3.js";
|
|
33
|
+
import * as x from "three";
|
|
34
|
+
import { planeNormal as A } from "../../utils/planeNormal.js";
|
|
35
|
+
import { centerPoint as H } from "../../../shared-utils/three/centerPoint.js";
|
|
36
|
+
import { VideoPlane as G, ImagePlane as L } from "../../utils/model/mediaPlane.js";
|
|
37
|
+
import B from "../../Components/Tag/index.js";
|
|
38
|
+
import { BaseTag as N } from "./BaseTag.js";
|
|
39
39
|
import "../../../shared-utils/tag.js";
|
|
40
40
|
import "../../../vendor/hammerjs/hammer.js";
|
|
41
41
|
import "../../../shared-utils/three/PointSelector/index.js";
|
|
42
42
|
import "../../../shared-utils/three/CSS3DRenderer/index.js";
|
|
43
|
-
import { initialCSS3DRender as
|
|
43
|
+
import { initialCSS3DRender as $ } from "../../../shared-utils/CSS3DRender/index.js";
|
|
44
44
|
import "@realsee/five/line";
|
|
45
45
|
import "../../../shared-utils/three/core/Five_LineMaterial2.js";
|
|
46
46
|
import "../../../shared-utils/three/core/Sphere.js";
|
|
@@ -48,11 +48,11 @@ import "../../../shared-utils/three/blink.js";
|
|
|
48
48
|
import "../../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
49
49
|
import "../../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
50
50
|
import "../../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
|
|
51
|
-
import { waitFiveModelLoaded as
|
|
51
|
+
import { waitFiveModelLoaded as T } from "../../../shared-utils/five/fiveModelLoad.js";
|
|
52
52
|
import "../../../vendor/earcut/src/earcut.js";
|
|
53
|
-
import { uuid as
|
|
53
|
+
import { uuid as U } from "../../../shared-utils/uuid.js";
|
|
54
54
|
import "../../../shared-utils/five/FivePuppet.js";
|
|
55
|
-
import { Sculpt as
|
|
55
|
+
import { Sculpt as R } from "../../../Sculpt/index.js";
|
|
56
56
|
import { Rectangle as W } from "../../../Sculpt/Objects/Rectangle/index.js";
|
|
57
57
|
import { getFloorMesh as q } from "../../../shared-utils/five/getFloorMesh.js";
|
|
58
58
|
import "../../../shared-utils/even.js";
|
|
@@ -301,12 +301,12 @@ import "../../../Sculpt/Objects/Line/index.js";
|
|
|
301
301
|
import "../../../Sculpt/Editors/RectangleMeshEditor.js";
|
|
302
302
|
import "../../../Sculpt/utils/sortPositionsByCameraPosition.js";
|
|
303
303
|
const Z = /* @__PURE__ */ new Map(), z = /* @__PURE__ */ new Map();
|
|
304
|
-
class Yr extends
|
|
304
|
+
class Yr extends N {
|
|
305
305
|
constructor(t, e) {
|
|
306
306
|
super(t, e);
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
307
|
+
v(this, "_floorIndex");
|
|
308
|
+
v(this, "_floorIndexDirty", !0);
|
|
309
|
+
v(this, "_opacity");
|
|
310
310
|
this.state.unfolded = !0, this.loadModel();
|
|
311
311
|
}
|
|
312
312
|
/** 获取透明度 */
|
|
@@ -327,73 +327,73 @@ class Yr extends B {
|
|
|
327
327
|
this._floorIndexDirty = !0;
|
|
328
328
|
}
|
|
329
329
|
applyVisible() {
|
|
330
|
-
var e, i, o, l,
|
|
331
|
-
this.computeRenderType() === "Mesh" ? (this.initialSculpt(), ((i = (e = this.data.mediaData) == null ? void 0 : e[0]) == null ? void 0 : i.type) === "Video" ? this.renderVideoPlane() : ((l = (o = this.data.mediaData) == null ? void 0 : o[0]) == null ? void 0 : l.type) === "Image" ? this.renderImagePlane() : this.renderEmptyPlane()) : ((
|
|
330
|
+
var e, i, o, l, p, r;
|
|
331
|
+
this.computeRenderType() === "Mesh" ? (this.initialSculpt(), ((i = (e = this.data.mediaData) == null ? void 0 : e[0]) == null ? void 0 : i.type) === "Video" ? this.renderVideoPlane() : ((l = (o = this.data.mediaData) == null ? void 0 : o[0]) == null ? void 0 : l.type) === "Image" ? this.renderImagePlane() : this.renderEmptyPlane()) : ((p = this.tag3DContentSvelte) == null || p.svelteApp.$set({ tag: this, state: this.plugin.state, temporaryState: this.plugin.temporaryState }), (r = this.tag3DContentSvelte) != null && r.css3DInstance && (this.tag3DContentSvelte.css3DInstance.visible = this.visible, this.five.needsRender = !0)), this.syncEditorAuxiliaryVisibility();
|
|
332
332
|
}
|
|
333
333
|
set(t, e = !0) {
|
|
334
|
-
super.set(t, e),
|
|
334
|
+
super.set(t, e), T(this.five).then(() => {
|
|
335
335
|
this.tag3DContentSvelte && (t.data ? this.tag3DContentSvelte.svelteApp.$set({ tag: this, state: this.plugin.state, temporaryState: this.plugin.temporaryState }) : t.position && this.loadModel());
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
338
|
setData(...t) {
|
|
339
|
-
var i, o, l,
|
|
340
|
-
super.setData(...t), this.computeRenderType() === "Mesh" ? (((o = (i = this.data.mediaData) == null ? void 0 : i[0]) == null ? void 0 : o.type) === "Video" ? this.renderVideoPlane() : ((
|
|
339
|
+
var i, o, l, p, r;
|
|
340
|
+
super.setData(...t), this.computeRenderType() === "Mesh" ? (((o = (i = this.data.mediaData) == null ? void 0 : i[0]) == null ? void 0 : o.type) === "Video" ? this.renderVideoPlane() : ((p = (l = this.data.mediaData) == null ? void 0 : l[0]) == null ? void 0 : p.type) === "Image" ? this.renderImagePlane() : this.renderEmptyPlane(), this.mediaPlane && (this.mediaPlane.opacity = this.opacity)) : (r = this.tag3DContentSvelte) == null || r.svelteApp.$set({ tag: this });
|
|
341
341
|
}
|
|
342
342
|
/** 计算楼层索引 */
|
|
343
343
|
computeFloorIndex() {
|
|
344
|
-
var
|
|
344
|
+
var p, r;
|
|
345
345
|
const t = /* @__PURE__ */ new Map();
|
|
346
|
-
((r = (
|
|
346
|
+
((r = (p = this.five.works.getWork(this.workUtil.workCode)) == null ? void 0 : p.observers) != null ? r : []).forEach((a) => {
|
|
347
347
|
var h;
|
|
348
|
-
const
|
|
349
|
-
if (!t.has(
|
|
350
|
-
const u = q(this.five,
|
|
351
|
-
u.isEmpty() || t.set(
|
|
348
|
+
const m = (h = a.floorIndex) != null ? h : 0;
|
|
349
|
+
if (!t.has(m)) {
|
|
350
|
+
const u = q(this.five, m);
|
|
351
|
+
u.isEmpty() || t.set(m, u);
|
|
352
352
|
}
|
|
353
353
|
});
|
|
354
|
-
const i =
|
|
355
|
-
if (t.forEach((
|
|
356
|
-
l.push({ floorIndex:
|
|
354
|
+
const i = H(...this.position.map(E)), o = [], l = [];
|
|
355
|
+
if (t.forEach((a, m) => {
|
|
356
|
+
l.push({ floorIndex: m, box: a }), a.containsPoint(i) && o.push({ floorIndex: m, box: a });
|
|
357
357
|
}), o.length === 1)
|
|
358
358
|
return o[0].floorIndex;
|
|
359
359
|
if (o.length > 1) {
|
|
360
|
-
let
|
|
360
|
+
let a = 1 / 0, m = o[0].floorIndex;
|
|
361
361
|
return o.forEach(({ floorIndex: h, box: u }) => {
|
|
362
|
-
const
|
|
363
|
-
u.getCenter(
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
}),
|
|
362
|
+
const s = new x.Vector3();
|
|
363
|
+
u.getCenter(s);
|
|
364
|
+
const n = i.distanceTo(s);
|
|
365
|
+
n < a && (a = n, m = h);
|
|
366
|
+
}), m;
|
|
367
367
|
}
|
|
368
368
|
if (l.length > 0) {
|
|
369
|
-
let
|
|
369
|
+
let a = 1 / 0, m = l[0].floorIndex;
|
|
370
370
|
return l.forEach(({ floorIndex: h, box: u }) => {
|
|
371
|
-
const
|
|
372
|
-
u.getCenter(
|
|
373
|
-
const
|
|
374
|
-
|
|
375
|
-
}),
|
|
371
|
+
const s = new x.Vector3();
|
|
372
|
+
u.getCenter(s);
|
|
373
|
+
const n = i.distanceTo(s);
|
|
374
|
+
n < a && (a = n, m = h);
|
|
375
|
+
}), m;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
loadModel() {
|
|
379
379
|
return C(this, null, function* () {
|
|
380
|
-
var e, i, o, l,
|
|
381
|
-
if (yield
|
|
380
|
+
var e, i, o, l, p, r;
|
|
381
|
+
if (yield T(this.five), this.computeRenderType() === "Mesh")
|
|
382
382
|
this.initialSculpt(), ((i = (e = this.data.mediaData) == null ? void 0 : e[0]) == null ? void 0 : i.type) === "Video" ? this.renderVideoPlane() : ((l = (o = this.data.mediaData) == null ? void 0 : o[0]) == null ? void 0 : l.type) === "Image" ? this.renderImagePlane() : this.renderEmptyPlane();
|
|
383
383
|
else {
|
|
384
|
-
|
|
385
|
-
const
|
|
386
|
-
(r = (
|
|
387
|
-
const
|
|
388
|
-
|
|
389
|
-
const h =
|
|
390
|
-
|
|
391
|
-
let
|
|
392
|
-
|
|
384
|
+
$(this.five);
|
|
385
|
+
const a = this.position.map(E);
|
|
386
|
+
(r = (p = this.tag3DContentSvelte) == null ? void 0 : p.dispose) == null || r.call(p);
|
|
387
|
+
const m = document.createElement("div");
|
|
388
|
+
m.classList.add("tag-media-container");
|
|
389
|
+
const h = I({ mode: "front", cornerPoints: a, container: m }, this.config.tag3DConfig), u = this.computeRenderType() === "BehindDom" || h.mode === "behind" ? "behind" : "front", s = new O(S(I({}, h), { mode: u })), n = this.computeNormal();
|
|
390
|
+
s.position.add(n.clone().setLength(_.Z_FIGHTING_OFFSET)), this.plugin.group.add(s);
|
|
391
|
+
let y;
|
|
392
|
+
s.mode === "behind" && this.config.clickable !== !1 && (y = this.addObjectClickHandler(this, s, (g) => {
|
|
393
393
|
this.plugin.hooks.emit("click", { event: g, target: "TagContent", tag: this });
|
|
394
394
|
}));
|
|
395
|
-
const f = new
|
|
396
|
-
target:
|
|
395
|
+
const f = new B({
|
|
396
|
+
target: m,
|
|
397
397
|
props: {
|
|
398
398
|
tag: this,
|
|
399
399
|
hooks: this.plugin.hooks,
|
|
@@ -406,13 +406,13 @@ class Yr extends B {
|
|
|
406
406
|
this.tag3DContentSvelte = {
|
|
407
407
|
svelteApp: f,
|
|
408
408
|
domContainer: {
|
|
409
|
-
css3DObject:
|
|
409
|
+
css3DObject: s
|
|
410
410
|
},
|
|
411
|
-
css3DInstance:
|
|
412
|
-
initialNormal:
|
|
413
|
-
currentNormal:
|
|
411
|
+
css3DInstance: s,
|
|
412
|
+
initialNormal: n,
|
|
413
|
+
currentNormal: n,
|
|
414
414
|
dispose: () => {
|
|
415
|
-
f.$destroy(),
|
|
415
|
+
f.$destroy(), s.dispose(), y == null || y();
|
|
416
416
|
}
|
|
417
417
|
}, this.five.needsRender = !0;
|
|
418
418
|
}
|
|
@@ -421,11 +421,11 @@ class Yr extends B {
|
|
|
421
421
|
initialSculpt() {
|
|
422
422
|
if (this.rectanglePlane)
|
|
423
423
|
return;
|
|
424
|
-
const t = new
|
|
424
|
+
const t = new R(this.five, void 0, {
|
|
425
425
|
magnifier: null
|
|
426
426
|
});
|
|
427
427
|
t.clear(), t.group.removeFromParent();
|
|
428
|
-
const e =
|
|
428
|
+
const e = U(), i = new W(
|
|
429
429
|
{
|
|
430
430
|
id: e,
|
|
431
431
|
type: "Rectangle",
|
|
@@ -446,7 +446,7 @@ class Yr extends B {
|
|
|
446
446
|
}), i.editor.disable();
|
|
447
447
|
}
|
|
448
448
|
editorEnable() {
|
|
449
|
-
this.rectanglePlane || this.initialSculpt(), this.rectanglePlane.visible = !0, this.rectanglePlane.editor.enable();
|
|
449
|
+
this.rectanglePlane || this.initialSculpt(), this.rectanglePlane.visible = !0, this.rectanglePlane.editor.enable(), this.syncEditorAuxiliaryVisibility();
|
|
450
450
|
}
|
|
451
451
|
editorDisable(t) {
|
|
452
452
|
var i;
|
|
@@ -456,21 +456,41 @@ class Yr extends B {
|
|
|
456
456
|
points: e
|
|
457
457
|
}), this.rectanglePlane.editor.disable();
|
|
458
458
|
}
|
|
459
|
+
getRectangleHelper() {
|
|
460
|
+
var e, i;
|
|
461
|
+
const t = (e = this.rectanglePlane) == null ? void 0 : e.rectangleMesh;
|
|
462
|
+
if (t)
|
|
463
|
+
return (i = R.modules.object3DHelper.getObject3DHelper(t)) == null ? void 0 : i.helper;
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* 标签因为 visiblePanoIndex 等可见性规则被隐藏时,同时隐藏编辑辅助元素。
|
|
467
|
+
* 当标签重新可见且仍处于编辑态时,再恢复辅助元素显示。
|
|
468
|
+
*/
|
|
469
|
+
syncEditorAuxiliaryVisibility() {
|
|
470
|
+
if (!this.rectanglePlane)
|
|
471
|
+
return;
|
|
472
|
+
const t = this.getRectangleHelper(), e = !!this.rectanglePlane.editor.parent;
|
|
473
|
+
if (!this.currentVisible || !e) {
|
|
474
|
+
this.rectanglePlane.visible = !1, t == null || t.hide(), this.five.needsRender = !0;
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
this.rectanglePlane.visible = !0, t == null || t.show(), this.five.needsRender = !0;
|
|
478
|
+
}
|
|
459
479
|
renderVideoPlane() {
|
|
460
|
-
var
|
|
480
|
+
var m, h, u;
|
|
461
481
|
const t = this.data.mediaData[0];
|
|
462
482
|
if (!t)
|
|
463
483
|
return;
|
|
464
484
|
const { url: e } = t;
|
|
465
485
|
if (!e)
|
|
466
486
|
return;
|
|
467
|
-
const i = (
|
|
487
|
+
const i = (m = this.data.objectFit) != null ? m : "contain", o = this.currentVisible, l = (() => !!(this.mediaPlane && !o))(), p = (() => !!(!this.mediaPlane && o))(), r = (() => !!(this.mediaPlane && (this.mediaPlane.src !== e || this.mediaPlane.objectFit !== i)))();
|
|
468
488
|
(l || r) && this.mediaPlane && (this.plugin.imagePlaneGroup.remove(this.mediaPlane), this.mediaPlane.dispose(), this.mediaPlane.removeFromParent(), this.mediaPlane = void 0);
|
|
469
|
-
const
|
|
470
|
-
if (
|
|
471
|
-
let
|
|
472
|
-
this.rectanglePlane && (
|
|
473
|
-
const
|
|
489
|
+
const a = (() => !!(this.mediaPlane && this.mediaPlane.objectFit && this.mediaPlane.objectFit !== i))();
|
|
490
|
+
if (p || r) {
|
|
491
|
+
let s = this.position.map(P);
|
|
492
|
+
this.rectanglePlane && (s = this.rectanglePlane.data.points.map(P));
|
|
493
|
+
const n = new G(e, s, {
|
|
474
494
|
videoCoverSrc: t.videoCoverUrl,
|
|
475
495
|
playButton: this.data.playIcon,
|
|
476
496
|
paused: !((h = this.data.autoplayConfig) != null && h.autoplayVideo),
|
|
@@ -480,29 +500,29 @@ class Yr extends B {
|
|
|
480
500
|
domEvents: this.plugin.domEvents,
|
|
481
501
|
opacity: this.opacity
|
|
482
502
|
});
|
|
483
|
-
this.plugin.domEvents.addAutoBindEventListener(
|
|
503
|
+
this.plugin.domEvents.addAutoBindEventListener(n, "click", (f) => {
|
|
484
504
|
var g, D;
|
|
485
|
-
!((g =
|
|
505
|
+
!((g = n.videoInstance) != null && g.paused) && ((D = n.videoInstance) == null ? void 0 : D.muted) === !1 && this.plugin.hooks.emit("playStateChange", {
|
|
486
506
|
event: f,
|
|
487
507
|
state: "playing",
|
|
488
508
|
tag: this,
|
|
489
|
-
mediaInstance:
|
|
509
|
+
mediaInstance: n.videoInstance
|
|
490
510
|
});
|
|
491
|
-
}),
|
|
511
|
+
}), n.onVideoReady = (f) => {
|
|
492
512
|
f.addEventListener("play", (g) => {
|
|
493
|
-
this.plugin.mediaStore.set({ currentMediaElement:
|
|
513
|
+
this.plugin.mediaStore.set({ currentMediaElement: n.videoInstance }), this.plugin.hooks.emit("playStateChange", { event: g, state: "playing", tag: this, mediaInstance: n.videoInstance });
|
|
494
514
|
}), f.addEventListener("pause", (g) => {
|
|
495
|
-
this.plugin.hooks.emit("playStateChange", { event: g, state: "paused", tag: this, mediaInstance:
|
|
515
|
+
this.plugin.hooks.emit("playStateChange", { event: g, state: "paused", tag: this, mediaInstance: n.videoInstance });
|
|
496
516
|
}), f.addEventListener("ended", (g) => {
|
|
497
|
-
this.plugin.hooks.emit("playStateChange", { event: g, state: "paused", tag: this, mediaInstance:
|
|
517
|
+
this.plugin.hooks.emit("playStateChange", { event: g, state: "paused", tag: this, mediaInstance: n.videoInstance });
|
|
498
518
|
});
|
|
499
519
|
};
|
|
500
|
-
const
|
|
501
|
-
|
|
520
|
+
const y = (f) => (this.five.on("renderFrame", f), () => this.five.off("renderFrame", f));
|
|
521
|
+
n.initialRenderHooks(y), this.mediaPlane = n, this.play = () => n.play(), this.pause = () => n.pause(), this.plugin.imagePlaneGroup.add(this.mediaPlane);
|
|
502
522
|
}
|
|
503
|
-
if (
|
|
504
|
-
const
|
|
505
|
-
(u = this.mediaPlane) == null || u.changePointsOrParams({ cornerPoints:
|
|
523
|
+
if (a) {
|
|
524
|
+
const s = this.rectanglePlane.data.points.map(P);
|
|
525
|
+
(u = this.mediaPlane) == null || u.changePointsOrParams({ cornerPoints: s, params: { objectFit: i } });
|
|
506
526
|
}
|
|
507
527
|
this.five.needsRender = !0;
|
|
508
528
|
}
|
|
@@ -515,17 +535,17 @@ class Yr extends B {
|
|
|
515
535
|
if (!i)
|
|
516
536
|
return;
|
|
517
537
|
let o = this.position.map(P);
|
|
518
|
-
const l = this.currentVisible,
|
|
519
|
-
if ((
|
|
538
|
+
const l = this.currentVisible, p = (() => !!(this.mediaPlane && !l))(), r = (() => !!(!this.mediaPlane && l))(), a = (() => !!(this.mediaPlane && this.mediaPlane.src !== i))(), m = (() => !!(this.mediaPlane && this.mediaPlane.objectFit && this.mediaPlane.objectFit !== e))();
|
|
539
|
+
if ((p || a) && this.mediaPlane && (this.plugin.imagePlaneGroup.remove(this.mediaPlane), this.mediaPlane.dispose(), this.mediaPlane.removeFromParent(), this.mediaPlane = void 0), (r || a) && (this.rectanglePlane && (o = this.rectanglePlane.data.points.map(P)), this.mediaPlane = new L(i, o, { objectFit: this.data.objectFit, opacity: this.opacity }), this.getConfig().clickable !== !1 && this.plugin.domEvents.addAutoBindEventListener(
|
|
520
540
|
this.mediaPlane,
|
|
521
541
|
"click",
|
|
522
|
-
(
|
|
523
|
-
this.plugin.hooks.emit("click", { tag: this, target: "TagContent", event:
|
|
542
|
+
(s) => {
|
|
543
|
+
this.plugin.hooks.emit("click", { tag: this, target: "TagContent", event: s.origDomEvent });
|
|
524
544
|
},
|
|
525
545
|
{ noEmitWhenHide: !0 }
|
|
526
|
-
), this.plugin.imagePlaneGroup.add(this.mediaPlane)),
|
|
527
|
-
const
|
|
528
|
-
(u = this.mediaPlane) == null || u.changePointsOrParams({ cornerPoints:
|
|
546
|
+
), this.plugin.imagePlaneGroup.add(this.mediaPlane)), m) {
|
|
547
|
+
const s = this.rectanglePlane.data.points.map(P);
|
|
548
|
+
(u = this.mediaPlane) == null || u.changePointsOrParams({ cornerPoints: s, params: { objectFit: e } });
|
|
529
549
|
}
|
|
530
550
|
this.five.needsRender = !0;
|
|
531
551
|
}
|
|
@@ -533,7 +553,7 @@ class Yr extends B {
|
|
|
533
553
|
this.mediaPlane && (this.plugin.imagePlaneGroup.remove(this.mediaPlane), this.mediaPlane.dispose(), this.mediaPlane.removeFromParent(), this.mediaPlane = void 0);
|
|
534
554
|
}
|
|
535
555
|
computeNormal() {
|
|
536
|
-
return
|
|
556
|
+
return A(this.position);
|
|
537
557
|
}
|
|
538
558
|
}
|
|
539
559
|
export {
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv3.79.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv3.79.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",
|