@realsee/dnalogel 3.73.3 → 3.73.5
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 +12 -3
- package/dist/PanoTagPlugin/controller/Tag/PlaneTag.d.ts +14 -1
- package/dist/PanoTagPlugin/utils/model/mediaPlane.d.ts +7 -0
- package/dist/index.cjs.js +51 -51
- package/dist/index.js +3684 -3569
- package/dist/index.umd.js +73 -73
- package/dist/shared-utils/five/getFloorMesh.d.ts +3 -0
- package/libs/CruisePlugin/Move.js +3 -2
- package/libs/CruisePlugin/Work.js +3 -2
- package/libs/CruisePlugin/index.js +7 -6
- package/libs/GuideLinePlugin/Controller.js +5 -4
- package/libs/GuideLinePlugin/GuideLineItem.js +3 -2
- package/libs/GuideLinePlugin/GuideLineModeItem.js +3 -2
- package/libs/GuideLinePlugin/index.js +7 -6
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +232 -232
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.d.ts +14 -1
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +181 -121
- package/libs/PanoTagPlugin/controller/index.js +6 -5
- package/libs/PanoTagPlugin/index.js +12 -11
- package/libs/PanoTagPlugin/utils/model/mediaPlane.d.ts +7 -0
- package/libs/PanoTagPlugin/utils/model/mediaPlane.js +167 -136
- package/libs/base/BasePlugin.js +1 -1
- package/libs/index.js +151 -150
- package/libs/shared-utils/Object3DHelper/Controller/ScaleController.js +41 -33
- package/libs/shared-utils/five/getFloorMesh.d.ts +3 -0
- package/libs/shared-utils/five/getFloorMesh.js +11 -0
- package/libs/shared-utils/logger.js +1 -1
- package/libs/vendor/hotkeys-js/dist/hotkeys.esm.js +151 -139
- package/package.json +2 -2
|
@@ -6,11 +6,24 @@ import type { Vector3 } from 'three';
|
|
|
6
6
|
import { Rectangle } from '../../../Sculpt/Objects/Rectangle';
|
|
7
7
|
export type PlaneTagInterface<C extends TagContentType = TagContentType> = TagInstance<C, 'Plane'>;
|
|
8
8
|
export declare class PlaneTag<C extends TagContentType = TagContentType> extends BaseTag<C, 'Plane'> {
|
|
9
|
-
constructor(plugin: PanoTagPluginController, tagData: TagData);
|
|
10
9
|
rectanglePlane?: Rectangle;
|
|
10
|
+
private _floorIndex?;
|
|
11
|
+
private _floorIndexDirty;
|
|
12
|
+
private _opacity?;
|
|
13
|
+
constructor(plugin: PanoTagPluginController, tagData: TagData);
|
|
14
|
+
/** 获取透明度 */
|
|
15
|
+
get opacity(): number;
|
|
16
|
+
/** 设置透明度 (0-1) */
|
|
17
|
+
set opacity(value: number);
|
|
18
|
+
/** 获取楼层索引(惰性计算 + 缓存) */
|
|
19
|
+
get floorIndex(): number | undefined;
|
|
20
|
+
/** 标记 floorIndex 需要重新计算(在位置等相关数据变化时调用) */
|
|
21
|
+
invalidateFloorIndex(): void;
|
|
11
22
|
applyVisible(): void;
|
|
12
23
|
set(tag: PartialObjectDeep<Tag<C, 'Plane'>>, deepMerge?: boolean): void;
|
|
13
24
|
setData(...data: Parameters<InstanceType<typeof BaseTag<C, 'Plane'>>['setData']>): void;
|
|
25
|
+
/** 计算楼层索引 */
|
|
26
|
+
private computeFloorIndex;
|
|
14
27
|
private loadModel;
|
|
15
28
|
private initialSculpt;
|
|
16
29
|
editorEnable(): void;
|
|
@@ -1,44 +1,46 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var t in
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var t of
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
|
|
1
|
+
var k = Object.defineProperty, j = Object.defineProperties;
|
|
2
|
+
var R = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var F = Object.getOwnPropertySymbols;
|
|
4
|
+
var V = Object.prototype.hasOwnProperty, w = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var I = (c, d, t) => d in c ? k(c, d, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[d] = t, b = (c, d) => {
|
|
6
|
+
for (var t in d || (d = {}))
|
|
7
|
+
V.call(d, t) && I(c, t, d[t]);
|
|
8
|
+
if (F)
|
|
9
|
+
for (var t of F(d))
|
|
10
|
+
w.call(d, t) && I(c, t, d[t]);
|
|
11
|
+
return c;
|
|
12
|
+
}, S = (c, d) => j(c, R(d));
|
|
13
|
+
var y = (c, d, t) => (I(c, typeof d != "symbol" ? d + "" : d, t), t);
|
|
14
|
+
var C = (c, d, t) => new Promise((e, i) => {
|
|
15
|
+
var o = (r) => {
|
|
15
16
|
try {
|
|
16
|
-
|
|
17
|
-
} catch (
|
|
18
|
-
|
|
17
|
+
m(t.next(r));
|
|
18
|
+
} catch (n) {
|
|
19
|
+
i(n);
|
|
19
20
|
}
|
|
20
|
-
},
|
|
21
|
+
}, l = (r) => {
|
|
21
22
|
try {
|
|
22
|
-
|
|
23
|
-
} catch (
|
|
24
|
-
|
|
23
|
+
m(t.throw(r));
|
|
24
|
+
} catch (n) {
|
|
25
|
+
i(n);
|
|
25
26
|
}
|
|
26
|
-
},
|
|
27
|
-
|
|
27
|
+
}, m = (r) => r.done ? e(r.value) : Promise.resolve(r.value).then(o, l);
|
|
28
|
+
m((t = t.apply(c, d)).next());
|
|
28
29
|
});
|
|
29
|
-
import { CONST as
|
|
30
|
-
import { CSS3DObjectPlus as
|
|
31
|
-
import { anyPositionToVector3 as
|
|
32
|
-
import "three";
|
|
30
|
+
import { CONST as M } from "../../../shared-utils/constants.js";
|
|
31
|
+
import { CSS3DObjectPlus as _ } from "../../../shared-utils/CSS3DRender/CSS3DObject.js";
|
|
32
|
+
import { anyPositionToVector3 as T, arrayPositionToVector3 as P } from "../../../shared-utils/positionToVector3.js";
|
|
33
|
+
import * as E from "three";
|
|
33
34
|
import { planeNormal as O } from "../../utils/planeNormal.js";
|
|
34
|
-
import {
|
|
35
|
-
import L from "../../
|
|
36
|
-
import
|
|
35
|
+
import { centerPoint as G } from "../../../shared-utils/three/centerPoint.js";
|
|
36
|
+
import { VideoPlane as L, ImagePlane as A } from "../../utils/model/mediaPlane.js";
|
|
37
|
+
import N from "../../Components/Tag/index.js";
|
|
38
|
+
import { BaseTag as B } from "./BaseTag.js";
|
|
37
39
|
import "../../../shared-utils/tag.js";
|
|
38
40
|
import "../../../vendor/hammerjs/hammer.js";
|
|
39
41
|
import "../../../shared-utils/three/PointSelector/index.js";
|
|
40
42
|
import "../../../shared-utils/three/CSS3DRenderer/index.js";
|
|
41
|
-
import { initialCSS3DRender as
|
|
43
|
+
import { initialCSS3DRender as H } from "../../../shared-utils/CSS3DRender/index.js";
|
|
42
44
|
import "@realsee/five/line";
|
|
43
45
|
import "../../../shared-utils/three/core/Five_LineMaterial2.js";
|
|
44
46
|
import "../../../shared-utils/three/core/Sphere.js";
|
|
@@ -46,15 +48,15 @@ import "../../../shared-utils/three/blink.js";
|
|
|
46
48
|
import "../../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
47
49
|
import "../../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
48
50
|
import "../../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
|
|
49
|
-
import { waitFiveModelLoaded as
|
|
51
|
+
import { waitFiveModelLoaded as x } from "../../../shared-utils/five/fiveModelLoad.js";
|
|
50
52
|
import "../../../vendor/earcut/src/earcut.js";
|
|
51
|
-
import { uuid as
|
|
53
|
+
import { uuid as $ } from "../../../shared-utils/uuid.js";
|
|
52
54
|
import "../../../shared-utils/five/FivePuppet.js";
|
|
53
|
-
import { Sculpt as
|
|
54
|
-
import { Rectangle as
|
|
55
|
+
import { Sculpt as U } from "../../../Sculpt/index.js";
|
|
56
|
+
import { Rectangle as W } from "../../../Sculpt/Objects/Rectangle/index.js";
|
|
57
|
+
import { getFloorMesh as q } from "../../../shared-utils/five/getFloorMesh.js";
|
|
55
58
|
import "../../../shared-utils/even.js";
|
|
56
59
|
import "../../../shared-utils/CSS3DRender/OpacityMesh.js";
|
|
57
|
-
import "../../../shared-utils/three/centerPoint.js";
|
|
58
60
|
import "../../../shared-utils/isNil.js";
|
|
59
61
|
import "../../../shared-utils/three/loadTexture.js";
|
|
60
62
|
import "../../../shared-utils/three/Quadrangle.js";
|
|
@@ -297,43 +299,100 @@ import "../../../shared-utils/forReverseEach.js";
|
|
|
297
299
|
import "../../../Sculpt/Objects/Line/index.js";
|
|
298
300
|
import "../../../Sculpt/Editors/RectangleMeshEditor.js";
|
|
299
301
|
import "../../../Sculpt/utils/sortPositionsByCameraPosition.js";
|
|
300
|
-
const
|
|
301
|
-
class
|
|
302
|
-
constructor(
|
|
303
|
-
super(
|
|
302
|
+
const Z = /* @__PURE__ */ new Map(), z = /* @__PURE__ */ new Map();
|
|
303
|
+
class Xr extends B {
|
|
304
|
+
constructor(t, e) {
|
|
305
|
+
super(t, e);
|
|
306
|
+
y(this, "_floorIndex");
|
|
307
|
+
y(this, "_floorIndexDirty", !0);
|
|
308
|
+
y(this, "_opacity");
|
|
309
|
+
this.state.unfolded = !0, this.loadModel();
|
|
310
|
+
}
|
|
311
|
+
/** 获取透明度 */
|
|
312
|
+
get opacity() {
|
|
313
|
+
var t, e;
|
|
314
|
+
return this._opacity !== void 0 ? this._opacity : (e = (t = this.data) == null ? void 0 : t.opacity) != null ? e : 1;
|
|
315
|
+
}
|
|
316
|
+
/** 设置透明度 (0-1) */
|
|
317
|
+
set opacity(t) {
|
|
318
|
+
t !== this._opacity && (this._opacity = t, this.mediaPlane && (this.mediaPlane.opacity = t));
|
|
319
|
+
}
|
|
320
|
+
/** 获取楼层索引(惰性计算 + 缓存) */
|
|
321
|
+
get floorIndex() {
|
|
322
|
+
return (this._floorIndexDirty || this._floorIndex === void 0) && (this._floorIndex = this.computeFloorIndex(), this._floorIndexDirty = !1), this._floorIndex;
|
|
323
|
+
}
|
|
324
|
+
/** 标记 floorIndex 需要重新计算(在位置等相关数据变化时调用) */
|
|
325
|
+
invalidateFloorIndex() {
|
|
326
|
+
this._floorIndexDirty = !0;
|
|
304
327
|
}
|
|
305
328
|
applyVisible() {
|
|
306
|
-
var
|
|
307
|
-
this.computeRenderType() === "Mesh" ? (this.initialSculpt(), ((
|
|
329
|
+
var e, i, o, l, m, r;
|
|
330
|
+
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()) : ((m = this.tag3DContentSvelte) == null || m.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));
|
|
308
331
|
}
|
|
309
|
-
set(
|
|
310
|
-
super.set(
|
|
311
|
-
this.tag3DContentSvelte && (
|
|
332
|
+
set(t, e = !0) {
|
|
333
|
+
super.set(t, e), x(this.five).then(() => {
|
|
334
|
+
this.tag3DContentSvelte && (t.data ? this.tag3DContentSvelte.svelteApp.$set({ tag: this, state: this.plugin.state, temporaryState: this.plugin.temporaryState }) : t.position && this.loadModel());
|
|
312
335
|
});
|
|
313
336
|
}
|
|
314
|
-
setData(...
|
|
315
|
-
var
|
|
316
|
-
super.setData(...
|
|
337
|
+
setData(...t) {
|
|
338
|
+
var i, o, l, m, r;
|
|
339
|
+
super.setData(...t), this.computeRenderType() === "Mesh" ? (((o = (i = this.data.mediaData) == null ? void 0 : i[0]) == null ? void 0 : o.type) === "Video" ? this.renderVideoPlane() : ((m = (l = this.data.mediaData) == null ? void 0 : l[0]) == null ? void 0 : m.type) === "Image" ? this.renderImagePlane() : this.renderEmptyPlane(), this.mediaPlane && (this.mediaPlane.opacity = this.opacity)) : (r = this.tag3DContentSvelte) == null || r.svelteApp.$set({ tag: this });
|
|
340
|
+
}
|
|
341
|
+
/** 计算楼层索引 */
|
|
342
|
+
computeFloorIndex() {
|
|
343
|
+
var m, r;
|
|
344
|
+
const t = /* @__PURE__ */ new Map();
|
|
345
|
+
((r = (m = this.five.works.getWork(this.workUtil.workCode)) == null ? void 0 : m.observers) != null ? r : []).forEach((n) => {
|
|
346
|
+
var h;
|
|
347
|
+
const s = (h = n.floorIndex) != null ? h : 0;
|
|
348
|
+
if (!t.has(s)) {
|
|
349
|
+
const u = q(this.five, s);
|
|
350
|
+
u.isEmpty() || t.set(s, u);
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
const i = G(...this.position.map(T)), o = [], l = [];
|
|
354
|
+
if (t.forEach((n, s) => {
|
|
355
|
+
l.push({ floorIndex: s, box: n }), n.containsPoint(i) && o.push({ floorIndex: s, box: n });
|
|
356
|
+
}), o.length === 1)
|
|
357
|
+
return o[0].floorIndex;
|
|
358
|
+
if (o.length > 1) {
|
|
359
|
+
let n = 1 / 0, s = o[0].floorIndex;
|
|
360
|
+
return o.forEach(({ floorIndex: h, box: u }) => {
|
|
361
|
+
const p = new E.Vector3();
|
|
362
|
+
u.getCenter(p);
|
|
363
|
+
const a = i.distanceTo(p);
|
|
364
|
+
a < n && (n = a, s = h);
|
|
365
|
+
}), s;
|
|
366
|
+
}
|
|
367
|
+
if (l.length > 0) {
|
|
368
|
+
let n = 1 / 0, s = l[0].floorIndex;
|
|
369
|
+
return l.forEach(({ floorIndex: h, box: u }) => {
|
|
370
|
+
const p = new E.Vector3();
|
|
371
|
+
u.getCenter(p);
|
|
372
|
+
const a = i.distanceTo(p);
|
|
373
|
+
a < n && (n = a, s = h);
|
|
374
|
+
}), s;
|
|
375
|
+
}
|
|
317
376
|
}
|
|
318
377
|
loadModel() {
|
|
319
378
|
return C(this, null, function* () {
|
|
320
|
-
var
|
|
321
|
-
if (yield
|
|
322
|
-
this.initialSculpt(), ((
|
|
379
|
+
var e, i, o, l, m, r;
|
|
380
|
+
if (yield x(this.five), this.computeRenderType() === "Mesh")
|
|
381
|
+
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();
|
|
323
382
|
else {
|
|
324
|
-
|
|
325
|
-
const
|
|
383
|
+
H(this.five);
|
|
384
|
+
const n = this.position.map(T);
|
|
326
385
|
(r = (m = this.tag3DContentSvelte) == null ? void 0 : m.dispose) == null || r.call(m);
|
|
327
|
-
const
|
|
328
|
-
|
|
329
|
-
const
|
|
330
|
-
p.position.add(a.clone().setLength(
|
|
331
|
-
let
|
|
332
|
-
p.mode === "behind" && this.config.clickable !== !1 && (
|
|
333
|
-
this.plugin.hooks.emit("click", { event:
|
|
386
|
+
const s = document.createElement("div");
|
|
387
|
+
s.classList.add("tag-media-container");
|
|
388
|
+
const h = b({ mode: "front", cornerPoints: n, container: s }, this.config.tag3DConfig), u = this.computeRenderType() === "BehindDom" || h.mode === "behind" ? "behind" : "front", p = new _(S(b({}, h), { mode: u })), a = this.computeNormal();
|
|
389
|
+
p.position.add(a.clone().setLength(M.Z_FIGHTING_OFFSET)), this.plugin.group.add(p);
|
|
390
|
+
let v;
|
|
391
|
+
p.mode === "behind" && this.config.clickable !== !1 && (v = this.addObjectClickHandler(this, p, (g) => {
|
|
392
|
+
this.plugin.hooks.emit("click", { event: g, target: "TagContent", tag: this });
|
|
334
393
|
}));
|
|
335
|
-
const
|
|
336
|
-
target:
|
|
394
|
+
const f = new N({
|
|
395
|
+
target: s,
|
|
337
396
|
props: {
|
|
338
397
|
tag: this,
|
|
339
398
|
hooks: this.plugin.hooks,
|
|
@@ -344,7 +403,7 @@ class Zr extends A {
|
|
|
344
403
|
}
|
|
345
404
|
});
|
|
346
405
|
this.tag3DContentSvelte = {
|
|
347
|
-
svelteApp:
|
|
406
|
+
svelteApp: f,
|
|
348
407
|
domContainer: {
|
|
349
408
|
css3DObject: p
|
|
350
409
|
},
|
|
@@ -352,7 +411,7 @@ class Zr extends A {
|
|
|
352
411
|
initialNormal: a,
|
|
353
412
|
currentNormal: a,
|
|
354
413
|
dispose: () => {
|
|
355
|
-
|
|
414
|
+
f.$destroy(), p.dispose(), v == null || v();
|
|
356
415
|
}
|
|
357
416
|
}, this.five.needsRender = !0;
|
|
358
417
|
}
|
|
@@ -361,15 +420,15 @@ class Zr extends A {
|
|
|
361
420
|
initialSculpt() {
|
|
362
421
|
if (this.rectanglePlane)
|
|
363
422
|
return;
|
|
364
|
-
const
|
|
423
|
+
const t = new U(this.five, void 0, {
|
|
365
424
|
magnifier: null
|
|
366
425
|
});
|
|
367
|
-
|
|
368
|
-
const
|
|
426
|
+
t.clear(), t.group.removeFromParent();
|
|
427
|
+
const e = $(), i = new W(
|
|
369
428
|
{
|
|
370
|
-
id:
|
|
429
|
+
id: e,
|
|
371
430
|
type: "Rectangle",
|
|
372
|
-
points: this.position.map(
|
|
431
|
+
points: this.position.map(P),
|
|
373
432
|
style: {
|
|
374
433
|
color: 2203620,
|
|
375
434
|
opacity: 0.1,
|
|
@@ -380,91 +439,92 @@ class Zr extends A {
|
|
|
380
439
|
defaultAction: !1
|
|
381
440
|
}
|
|
382
441
|
);
|
|
383
|
-
|
|
442
|
+
i.visible = !1, this.plugin.imagePlaneGroup.add(i), this.rectanglePlane = i, i.editor.hooks.on("objectUpdate", () => {
|
|
384
443
|
var o;
|
|
385
|
-
(o = this.mediaPlane) == null || o.changePointsOrParams({ cornerPoints:
|
|
386
|
-
}),
|
|
444
|
+
(o = this.mediaPlane) == null || o.changePointsOrParams({ cornerPoints: i.data.points.map(P) });
|
|
445
|
+
}), i.editor.disable();
|
|
387
446
|
}
|
|
388
447
|
editorEnable() {
|
|
389
448
|
this.rectanglePlane || this.initialSculpt(), this.rectanglePlane.visible = !0, this.rectanglePlane.editor.enable();
|
|
390
449
|
}
|
|
391
|
-
editorDisable(
|
|
392
|
-
var
|
|
450
|
+
editorDisable(t) {
|
|
451
|
+
var i;
|
|
393
452
|
this.rectanglePlane.visible = !1;
|
|
394
|
-
const
|
|
395
|
-
(
|
|
396
|
-
points:
|
|
453
|
+
const e = t || this.position.map(P);
|
|
454
|
+
(i = this.mediaPlane) == null || i.changePointsOrParams({ cornerPoints: e }), this.rectanglePlane.setData({
|
|
455
|
+
points: e
|
|
397
456
|
}), this.rectanglePlane.editor.disable();
|
|
398
457
|
}
|
|
399
458
|
renderVideoPlane() {
|
|
400
|
-
var
|
|
401
|
-
const
|
|
402
|
-
if (!i)
|
|
403
|
-
return;
|
|
404
|
-
const { url: t } = i;
|
|
459
|
+
var s, h, u;
|
|
460
|
+
const t = this.data.mediaData[0];
|
|
405
461
|
if (!t)
|
|
406
462
|
return;
|
|
407
|
-
const
|
|
408
|
-
|
|
409
|
-
|
|
463
|
+
const { url: e } = t;
|
|
464
|
+
if (!e)
|
|
465
|
+
return;
|
|
466
|
+
const i = (s = this.data.objectFit) != null ? s : "contain", o = this.currentVisible, l = (() => !!(this.mediaPlane && !o))(), m = (() => !!(!this.mediaPlane && o))(), r = (() => !!(this.mediaPlane && (this.mediaPlane.src !== e || this.mediaPlane.objectFit !== i)))();
|
|
467
|
+
(l || r) && this.mediaPlane && (this.plugin.imagePlaneGroup.remove(this.mediaPlane), this.mediaPlane.dispose(), this.mediaPlane.removeFromParent(), this.mediaPlane = void 0);
|
|
468
|
+
const n = (() => !!(this.mediaPlane && this.mediaPlane.objectFit && this.mediaPlane.objectFit !== i))();
|
|
410
469
|
if (m || r) {
|
|
411
|
-
let p = this.position.map(
|
|
412
|
-
this.rectanglePlane && (p = this.rectanglePlane.data.points.map(
|
|
413
|
-
const a = new
|
|
414
|
-
videoCoverSrc:
|
|
470
|
+
let p = this.position.map(P);
|
|
471
|
+
this.rectanglePlane && (p = this.rectanglePlane.data.points.map(P));
|
|
472
|
+
const a = new L(e, p, {
|
|
473
|
+
videoCoverSrc: t.videoCoverUrl,
|
|
415
474
|
playButton: this.data.playIcon,
|
|
416
|
-
paused: !((
|
|
475
|
+
paused: !((h = this.data.autoplayConfig) != null && h.autoplayVideo),
|
|
417
476
|
objectFit: this.data.objectFit,
|
|
418
|
-
videoTextureMap:
|
|
419
|
-
ImageTextureMap:
|
|
420
|
-
domEvents: this.plugin.domEvents
|
|
477
|
+
videoTextureMap: Z,
|
|
478
|
+
ImageTextureMap: z,
|
|
479
|
+
domEvents: this.plugin.domEvents,
|
|
480
|
+
opacity: this.opacity
|
|
421
481
|
});
|
|
422
|
-
this.plugin.domEvents.addAutoBindEventListener(a, "click", (
|
|
423
|
-
var
|
|
424
|
-
!((
|
|
425
|
-
event:
|
|
482
|
+
this.plugin.domEvents.addAutoBindEventListener(a, "click", (f) => {
|
|
483
|
+
var g, D;
|
|
484
|
+
!((g = a.videoInstance) != null && g.paused) && ((D = a.videoInstance) == null ? void 0 : D.muted) === !1 && this.plugin.hooks.emit("playStateChange", {
|
|
485
|
+
event: f,
|
|
426
486
|
state: "playing",
|
|
427
487
|
tag: this,
|
|
428
488
|
mediaInstance: a.videoInstance
|
|
429
489
|
});
|
|
430
|
-
}), a.onVideoReady = (
|
|
431
|
-
|
|
432
|
-
this.plugin.mediaStore.set({ currentMediaElement: a.videoInstance }), this.plugin.hooks.emit("playStateChange", { event:
|
|
433
|
-
}),
|
|
434
|
-
this.plugin.hooks.emit("playStateChange", { event:
|
|
435
|
-
}),
|
|
436
|
-
this.plugin.hooks.emit("playStateChange", { event:
|
|
490
|
+
}), a.onVideoReady = (f) => {
|
|
491
|
+
f.addEventListener("play", (g) => {
|
|
492
|
+
this.plugin.mediaStore.set({ currentMediaElement: a.videoInstance }), this.plugin.hooks.emit("playStateChange", { event: g, state: "playing", tag: this, mediaInstance: a.videoInstance });
|
|
493
|
+
}), f.addEventListener("pause", (g) => {
|
|
494
|
+
this.plugin.hooks.emit("playStateChange", { event: g, state: "paused", tag: this, mediaInstance: a.videoInstance });
|
|
495
|
+
}), f.addEventListener("ended", (g) => {
|
|
496
|
+
this.plugin.hooks.emit("playStateChange", { event: g, state: "paused", tag: this, mediaInstance: a.videoInstance });
|
|
437
497
|
});
|
|
438
498
|
};
|
|
439
|
-
const
|
|
440
|
-
a.initialRenderHooks(
|
|
499
|
+
const v = (f) => (this.five.on("renderFrame", f), () => this.five.off("renderFrame", f));
|
|
500
|
+
a.initialRenderHooks(v), this.mediaPlane = a, this.play = () => a.play(), this.pause = () => a.pause(), this.plugin.imagePlaneGroup.add(this.mediaPlane);
|
|
441
501
|
}
|
|
442
|
-
if (
|
|
443
|
-
const p = this.rectanglePlane.data.points.map(
|
|
444
|
-
(
|
|
502
|
+
if (n) {
|
|
503
|
+
const p = this.rectanglePlane.data.points.map(P);
|
|
504
|
+
(u = this.mediaPlane) == null || u.changePointsOrParams({ cornerPoints: p, params: { objectFit: i } });
|
|
445
505
|
}
|
|
446
506
|
this.five.needsRender = !0;
|
|
447
507
|
}
|
|
448
508
|
renderImagePlane() {
|
|
449
|
-
var
|
|
450
|
-
const
|
|
451
|
-
if (!
|
|
509
|
+
var h, u;
|
|
510
|
+
const t = this.data.mediaData[0], e = (h = this.data.objectFit) != null ? h : "contain";
|
|
511
|
+
if (!t)
|
|
452
512
|
return;
|
|
453
|
-
const { url:
|
|
454
|
-
if (!
|
|
513
|
+
const { url: i } = t;
|
|
514
|
+
if (!i)
|
|
455
515
|
return;
|
|
456
|
-
let o = this.position.map(
|
|
457
|
-
const
|
|
458
|
-
if ((m ||
|
|
516
|
+
let o = this.position.map(P);
|
|
517
|
+
const l = this.currentVisible, m = (() => !!(this.mediaPlane && !l))(), r = (() => !!(!this.mediaPlane && l))(), n = (() => !!(this.mediaPlane && this.mediaPlane.src !== i))(), s = (() => !!(this.mediaPlane && this.mediaPlane.objectFit && this.mediaPlane.objectFit !== e))();
|
|
518
|
+
if ((m || n) && this.mediaPlane && (this.plugin.imagePlaneGroup.remove(this.mediaPlane), this.mediaPlane.dispose(), this.mediaPlane.removeFromParent(), this.mediaPlane = void 0), (r || n) && (this.rectanglePlane && (o = this.rectanglePlane.data.points.map(P)), this.mediaPlane = new A(i, o, { objectFit: this.data.objectFit, opacity: this.opacity }), this.getConfig().clickable !== !1 && this.plugin.domEvents.addAutoBindEventListener(
|
|
459
519
|
this.mediaPlane,
|
|
460
520
|
"click",
|
|
461
521
|
(p) => {
|
|
462
522
|
this.plugin.hooks.emit("click", { tag: this, target: "TagContent", event: p.origDomEvent });
|
|
463
523
|
},
|
|
464
524
|
{ noEmitWhenHide: !0 }
|
|
465
|
-
), this.plugin.imagePlaneGroup.add(this.mediaPlane)),
|
|
466
|
-
const p = this.rectanglePlane.data.points.map(
|
|
467
|
-
(
|
|
525
|
+
), this.plugin.imagePlaneGroup.add(this.mediaPlane)), s) {
|
|
526
|
+
const p = this.rectanglePlane.data.points.map(P);
|
|
527
|
+
(u = this.mediaPlane) == null || u.changePointsOrParams({ cornerPoints: p, params: { objectFit: e } });
|
|
468
528
|
}
|
|
469
529
|
this.five.needsRender = !0;
|
|
470
530
|
}
|
|
@@ -476,5 +536,5 @@ class Zr extends A {
|
|
|
476
536
|
}
|
|
477
537
|
}
|
|
478
538
|
export {
|
|
479
|
-
|
|
539
|
+
Xr as PlaneTag
|
|
480
540
|
};
|
|
@@ -312,6 +312,7 @@ import "../../Sculpt/Editors/BoxMeshEditor.js";
|
|
|
312
312
|
import "../../Sculpt/Meshes/Box.js";
|
|
313
313
|
import "../../shared-utils/forReverseEach.js";
|
|
314
314
|
import "../../Sculpt/Objects/Line/index.js";
|
|
315
|
+
import "../../shared-utils/five/getFloorMesh.js";
|
|
315
316
|
import "../Components/TagItem.js";
|
|
316
317
|
import "../Components/Common/TagPoint.js";
|
|
317
318
|
import "../Components/Tag/AudioTag/AudioPoint.js";
|
|
@@ -328,8 +329,8 @@ import "../Components/Common/TagPopover/TagPopoverToolBar.js";
|
|
|
328
329
|
import "../Components/Common/TagPopover/ArrowRightIcon.js";
|
|
329
330
|
import "../Components/Common/TagPopover/ShareIcon.js";
|
|
330
331
|
import "../utils/popoverContainer.js";
|
|
331
|
-
const D = "Dnalogel-PanoTagPlugin",
|
|
332
|
-
class
|
|
332
|
+
const D = "Dnalogel-PanoTagPlugin", _s = (h) => `${D}--${h}`;
|
|
333
|
+
class Fs extends R {
|
|
333
334
|
constructor(e, t) {
|
|
334
335
|
super(e);
|
|
335
336
|
/** state */
|
|
@@ -802,7 +803,7 @@ class _s extends R {
|
|
|
802
803
|
}
|
|
803
804
|
}
|
|
804
805
|
export {
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
806
|
+
Fs as PanoTagPluginController,
|
|
807
|
+
Fs as default,
|
|
808
|
+
_s as pluginFlag
|
|
808
809
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import r from "./controller/index.js";
|
|
2
|
-
import { pluginFlag as
|
|
3
|
-
import { defaultGlobalConfig as
|
|
4
|
-
import { ContentType as
|
|
2
|
+
import { pluginFlag as Li } from "./controller/index.js";
|
|
3
|
+
import { defaultGlobalConfig as Ni } from "./typings/tag/TagConfig.js";
|
|
4
|
+
import { ContentType as Qi, DimensionType as Ri, PointType as Si } from "./Archive/deprecated.js";
|
|
5
5
|
import "three";
|
|
6
6
|
import "../vendor/object-assign-deep/objectAssignDeep.js";
|
|
7
7
|
import "../shared-utils/positionToVector3.js";
|
|
@@ -284,6 +284,7 @@ import "../Sculpt/Editors/BoxMeshEditor.js";
|
|
|
284
284
|
import "../Sculpt/Meshes/Box.js";
|
|
285
285
|
import "../shared-utils/forReverseEach.js";
|
|
286
286
|
import "../Sculpt/Objects/Line/index.js";
|
|
287
|
+
import "../shared-utils/five/getFloorMesh.js";
|
|
287
288
|
import "./Components/TagContainer.js";
|
|
288
289
|
import "./Components/TagItem.js";
|
|
289
290
|
import "./Components/Common/TagPoint.js";
|
|
@@ -302,14 +303,14 @@ import "./Components/Common/TagPopover/ArrowRightIcon.js";
|
|
|
302
303
|
import "./Components/Common/TagPopover/ShareIcon.js";
|
|
303
304
|
import "./utils/popoverContainer.js";
|
|
304
305
|
import "../shared-utils/animationFrame/BetterTween.js";
|
|
305
|
-
const
|
|
306
|
+
const Ii = (o, t) => new r(o, t);
|
|
306
307
|
export {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
308
|
+
Qi as ContentType,
|
|
309
|
+
Ri as DimensionType,
|
|
310
|
+
Ii as PanoTagPlugin,
|
|
310
311
|
r as PanoTagPluginController,
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
312
|
+
Si as PointType,
|
|
313
|
+
Ii as default,
|
|
314
|
+
Ni as defaultGlobalConfig,
|
|
315
|
+
Li as pluginFlag
|
|
315
316
|
};
|
|
@@ -15,6 +15,10 @@ declare abstract class MediaPlane extends THREE.Mesh<THREE.BufferGeometry | THRE
|
|
|
15
15
|
name: string;
|
|
16
16
|
src?: string;
|
|
17
17
|
objectFit: ObjectFit;
|
|
18
|
+
/** 获取透明度 */
|
|
19
|
+
get opacity(): number;
|
|
20
|
+
/** 设置透明度 (0-1) */
|
|
21
|
+
set opacity(value: number);
|
|
18
22
|
removeFromParent(): this;
|
|
19
23
|
dispose(): void;
|
|
20
24
|
}
|
|
@@ -24,6 +28,7 @@ declare class ImagePlane extends MediaPlane {
|
|
|
24
28
|
constructor(imageSrc: string, cornerPoints: Vector3[], params?: {
|
|
25
29
|
objectFit?: ObjectFit;
|
|
26
30
|
resolveZFighting?: boolean;
|
|
31
|
+
opacity?: number;
|
|
27
32
|
});
|
|
28
33
|
changePointsOrParams(props: {
|
|
29
34
|
cornerPoints: Vector3[];
|
|
@@ -48,6 +53,7 @@ declare class VideoPlane extends MediaPlane {
|
|
|
48
53
|
private buttonMesh?;
|
|
49
54
|
private videoTextureMap;
|
|
50
55
|
private ImageTextureMap;
|
|
56
|
+
private initialOpacity;
|
|
51
57
|
constructor(videoSrc: string, cornerPoints: Vector3[], params?: {
|
|
52
58
|
paused?: boolean;
|
|
53
59
|
playButton?: 'withText' | 'withoutText' | string;
|
|
@@ -59,6 +65,7 @@ declare class VideoPlane extends MediaPlane {
|
|
|
59
65
|
transparent: boolean;
|
|
60
66
|
}>;
|
|
61
67
|
domEvents?: FiveDomEvents;
|
|
68
|
+
opacity?: number;
|
|
62
69
|
});
|
|
63
70
|
play(muted?: boolean): Promise<void>;
|
|
64
71
|
pause(): void;
|