@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.
@@ -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 F = Object.defineProperty, T = Object.defineProperties;
2
- var j = Object.getOwnPropertyDescriptors;
3
- var b = Object.getOwnPropertySymbols;
4
- var R = Object.prototype.hasOwnProperty, k = Object.prototype.propertyIsEnumerable;
5
- var S = (l, i, t) => i in l ? F(l, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[i] = t, v = (l, i) => {
6
- for (var t in i || (i = {}))
7
- R.call(i, t) && S(l, t, i[t]);
8
- if (b)
9
- for (var t of b(i))
10
- k.call(i, t) && S(l, t, i[t]);
11
- return l;
12
- }, D = (l, i) => T(l, j(i));
13
- var C = (l, i, t) => new Promise((e, o) => {
14
- var n = (s) => {
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
- r(t.next(s));
17
- } catch (d) {
18
- o(d);
17
+ m(t.next(r));
18
+ } catch (n) {
19
+ i(n);
19
20
  }
20
- }, m = (s) => {
21
+ }, l = (r) => {
21
22
  try {
22
- r(t.throw(s));
23
- } catch (d) {
24
- o(d);
23
+ m(t.throw(r));
24
+ } catch (n) {
25
+ i(n);
25
26
  }
26
- }, r = (s) => s.done ? e(s.value) : Promise.resolve(s.value).then(n, m);
27
- r((t = t.apply(l, i)).next());
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 E } from "../../../shared-utils/constants.js";
30
- import { CSS3DObjectPlus as V } from "../../../shared-utils/CSS3DRender/CSS3DObject.js";
31
- import { anyPositionToVector3 as M, arrayPositionToVector3 as u } from "../../../shared-utils/positionToVector3.js";
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 { VideoPlane as w, ImagePlane as G } from "../../utils/model/mediaPlane.js";
35
- import L from "../../Components/Tag/index.js";
36
- import { BaseTag as A } from "./BaseTag.js";
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 N } from "../../../shared-utils/CSS3DRender/index.js";
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 I } from "../../../shared-utils/five/fiveModelLoad.js";
51
+ import { waitFiveModelLoaded as x } from "../../../shared-utils/five/fiveModelLoad.js";
50
52
  import "../../../vendor/earcut/src/earcut.js";
51
- import { uuid as B } from "../../../shared-utils/uuid.js";
53
+ import { uuid as $ } from "../../../shared-utils/uuid.js";
52
54
  import "../../../shared-utils/five/FivePuppet.js";
53
- import { Sculpt as x } from "../../../Sculpt/index.js";
54
- import { Rectangle as H } from "../../../Sculpt/Objects/Rectangle/index.js";
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 $ = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Map();
301
- class Zr extends A {
302
- constructor(i, t) {
303
- super(i, t), this.state.unfolded = !0, this.loadModel();
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 t, e, o, n, m, r;
307
- this.computeRenderType() === "Mesh" ? (this.initialSculpt(), ((e = (t = this.data.mediaData) == null ? void 0 : t[0]) == null ? void 0 : e.type) === "Video" ? this.renderVideoPlane() : ((n = (o = this.data.mediaData) == null ? void 0 : o[0]) == null ? void 0 : n.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));
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(i, t = !0) {
310
- super.set(i, t), I(this.five).then(() => {
311
- this.tag3DContentSvelte && (i.data ? this.tag3DContentSvelte.svelteApp.$set({ tag: this, state: this.plugin.state, temporaryState: this.plugin.temporaryState }) : i.position && this.loadModel());
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(...i) {
315
- var e, o, n, m, r;
316
- super.setData(...i), this.computeRenderType() === "Mesh" ? ((o = (e = this.data.mediaData) == null ? void 0 : e[0]) == null ? void 0 : o.type) === "Video" ? this.renderVideoPlane() : ((m = (n = this.data.mediaData) == null ? void 0 : n[0]) == null ? void 0 : m.type) === "Image" ? this.renderImagePlane() : this.renderEmptyPlane() : (r = this.tag3DContentSvelte) == null || r.svelteApp.$set({ tag: this });
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 t, e, o, n, m, r;
321
- if (yield I(this.five), this.computeRenderType() === "Mesh")
322
- this.initialSculpt(), ((e = (t = this.data.mediaData) == null ? void 0 : t[0]) == null ? void 0 : e.type) === "Video" ? this.renderVideoPlane() : ((n = (o = this.data.mediaData) == null ? void 0 : o[0]) == null ? void 0 : n.type) === "Image" ? this.renderImagePlane() : this.renderEmptyPlane();
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
- N(this.five);
325
- const s = this.position.map(M);
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 d = document.createElement("div");
328
- d.classList.add("tag-media-container");
329
- const g = v({ mode: "front", cornerPoints: s, container: d }, this.config.tag3DConfig), P = this.computeRenderType() === "BehindDom" || g.mode === "behind" ? "behind" : "front", p = new V(D(v({}, g), { mode: P })), a = this.computeNormal();
330
- p.position.add(a.clone().setLength(E.Z_FIGHTING_OFFSET)), this.plugin.group.add(p);
331
- let f;
332
- p.mode === "behind" && this.config.clickable !== !1 && (f = this.addObjectClickHandler(this, p, (c) => {
333
- this.plugin.hooks.emit("click", { event: c, target: "TagContent", tag: this });
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 h = new L({
336
- target: d,
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: h,
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
- h.$destroy(), p.dispose(), f == null || f();
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 i = new x(this.five, void 0, {
423
+ const t = new U(this.five, void 0, {
365
424
  magnifier: null
366
425
  });
367
- i.clear(), i.group.removeFromParent();
368
- const t = B(), e = new H(
426
+ t.clear(), t.group.removeFromParent();
427
+ const e = $(), i = new W(
369
428
  {
370
- id: t,
429
+ id: e,
371
430
  type: "Rectangle",
372
- points: this.position.map(u),
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
- e.visible = !1, this.plugin.imagePlaneGroup.add(e), this.rectanglePlane = e, e.editor.hooks.on("objectUpdate", () => {
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: e.data.points.map(u) });
386
- }), e.editor.disable();
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(i) {
392
- var e;
450
+ editorDisable(t) {
451
+ var i;
393
452
  this.rectanglePlane.visible = !1;
394
- const t = i || this.position.map(u);
395
- (e = this.mediaPlane) == null || e.changePointsOrParams({ cornerPoints: t }), this.rectanglePlane.setData({
396
- points: t
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 d, g, P;
401
- const i = this.data.mediaData[0];
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 e = (d = this.data.objectFit) != null ? d : "contain", o = this.currentVisible, n = (() => !!(this.mediaPlane && !o))(), m = (() => !!(!this.mediaPlane && o))(), r = (() => !!(this.mediaPlane && (this.mediaPlane.src !== t || this.mediaPlane.objectFit !== e)))();
408
- (n || r) && this.mediaPlane && (this.plugin.imagePlaneGroup.remove(this.mediaPlane), this.mediaPlane.dispose(), this.mediaPlane.removeFromParent(), this.mediaPlane = void 0);
409
- const s = (() => !!(this.mediaPlane && this.mediaPlane.objectFit && this.mediaPlane.objectFit !== e))();
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(u);
412
- this.rectanglePlane && (p = this.rectanglePlane.data.points.map(u));
413
- const a = new w(t, p, {
414
- videoCoverSrc: i.videoCoverUrl,
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: !((g = this.data.autoplayConfig) != null && g.autoplayVideo),
475
+ paused: !((h = this.data.autoplayConfig) != null && h.autoplayVideo),
417
476
  objectFit: this.data.objectFit,
418
- videoTextureMap: $,
419
- ImageTextureMap: U,
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", (h) => {
423
- var c, y;
424
- !((c = a.videoInstance) != null && c.paused) && ((y = a.videoInstance) == null ? void 0 : y.muted) === !1 && this.plugin.hooks.emit("playStateChange", {
425
- event: h,
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 = (h) => {
431
- h.addEventListener("play", (c) => {
432
- this.plugin.mediaStore.set({ currentMediaElement: a.videoInstance }), this.plugin.hooks.emit("playStateChange", { event: c, state: "playing", tag: this, mediaInstance: a.videoInstance });
433
- }), h.addEventListener("pause", (c) => {
434
- this.plugin.hooks.emit("playStateChange", { event: c, state: "paused", tag: this, mediaInstance: a.videoInstance });
435
- }), h.addEventListener("ended", (c) => {
436
- this.plugin.hooks.emit("playStateChange", { event: c, state: "paused", tag: this, mediaInstance: a.videoInstance });
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 f = (h) => (this.five.on("renderFrame", h), () => this.five.off("renderFrame", h));
440
- a.initialRenderHooks(f), this.mediaPlane = a, this.play = () => a.play(), this.pause = () => a.pause(), this.plugin.imagePlaneGroup.add(this.mediaPlane);
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 (s) {
443
- const p = this.rectanglePlane.data.points.map(u);
444
- (P = this.mediaPlane) == null || P.changePointsOrParams({ cornerPoints: p, params: { objectFit: e } });
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 g, P;
450
- const i = this.data.mediaData[0], t = (g = this.data.objectFit) != null ? g : "contain";
451
- if (!i)
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: e } = i;
454
- if (!e)
513
+ const { url: i } = t;
514
+ if (!i)
455
515
  return;
456
- let o = this.position.map(u);
457
- const n = this.currentVisible, m = (() => !!(this.mediaPlane && !n))(), r = (() => !!(!this.mediaPlane && n))(), s = (() => !!(this.mediaPlane && this.mediaPlane.src !== e))(), d = (() => !!(this.mediaPlane && this.mediaPlane.objectFit && this.mediaPlane.objectFit !== t))();
458
- if ((m || s) && this.mediaPlane && (this.plugin.imagePlaneGroup.remove(this.mediaPlane), this.mediaPlane.dispose(), this.mediaPlane.removeFromParent(), this.mediaPlane = void 0), (r || s) && (this.rectanglePlane && (o = this.rectanglePlane.data.points.map(u)), this.mediaPlane = new G(e, o, { objectFit: this.data.objectFit }), this.getConfig().clickable !== !1 && this.plugin.domEvents.addAutoBindEventListener(
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)), d) {
466
- const p = this.rectanglePlane.data.points.map(u);
467
- (P = this.mediaPlane) == null || P.changePointsOrParams({ cornerPoints: p, params: { objectFit: t } });
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
- Zr as PlaneTag
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", Us = (h) => `${D}--${h}`;
332
- class _s extends R {
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
- _s as PanoTagPluginController,
806
- _s as default,
807
- Us as pluginFlag
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 Ki } from "./controller/index.js";
3
- import { defaultGlobalConfig as Mi } from "./typings/tag/TagConfig.js";
4
- import { ContentType as Oi, DimensionType as Qi, PointType as Ri } from "./Archive/deprecated.js";
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 Hi = (o, t) => new r(o, t);
306
+ const Ii = (o, t) => new r(o, t);
306
307
  export {
307
- Oi as ContentType,
308
- Qi as DimensionType,
309
- Hi as PanoTagPlugin,
308
+ Qi as ContentType,
309
+ Ri as DimensionType,
310
+ Ii as PanoTagPlugin,
310
311
  r as PanoTagPluginController,
311
- Ri as PointType,
312
- Hi as default,
313
- Mi as defaultGlobalConfig,
314
- Ki as pluginFlag
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;