@realsee/dnalogel 2.1.0-alpha.27 → 2.1.0-alpha.29

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.
Files changed (139) hide show
  1. package/dist/index.cjs.js +556 -0
  2. package/dist/index.es.js +8387 -8231
  3. package/dist/index.js +8387 -8231
  4. package/dist/index.umd.js +556 -0
  5. package/docs/classes/CruisePluginController.html +14 -14
  6. package/docs/classes/Magnifier.html +4 -4
  7. package/docs/classes/ModelRoomLabelController.html +4 -4
  8. package/docs/classes/Object3DHelperController.html +9 -9
  9. package/docs/classes/PaintBrush.html +3 -3
  10. package/docs/classes/PanoTagPluginController.html +23 -23
  11. package/docs/enums/CameraMovementEffect.html +2 -2
  12. package/docs/enums/ContentType.html +7 -7
  13. package/docs/enums/DIRECTION.html +1 -1
  14. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
  15. package/docs/enums/DimensionType.html +1 -1
  16. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  17. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
  18. package/docs/enums/LinkType.html +1 -1
  19. package/docs/enums/PaintBrushTypeEnum.html +1 -1
  20. package/docs/enums/PointType.html +1 -1
  21. package/docs/enums/Rotation.html +2 -2
  22. package/docs/index.html +1 -1
  23. package/docs/interfaces/CSS3DRenderPluginEventMap.html +2 -2
  24. package/docs/interfaces/CSS3DRenderPluginState.html +2 -2
  25. package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
  26. package/docs/interfaces/ContentTypeMap.html +3 -3
  27. package/docs/interfaces/FloorplanBounding.html +4 -4
  28. package/docs/interfaces/FloorplanData.html +2 -2
  29. package/docs/interfaces/FloorplanEntrance.html +7 -7
  30. package/docs/interfaces/FloorplanExtraObject.html +3 -3
  31. package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
  32. package/docs/interfaces/FloorplanFloorData.html +2 -2
  33. package/docs/interfaces/FloorplanImagePosition.html +2 -2
  34. package/docs/interfaces/FloorplanObserver.html +2 -2
  35. package/docs/interfaces/FloorplanOutlineItem.html +2 -2
  36. package/docs/interfaces/FloorplanPosition.html +2 -2
  37. package/docs/interfaces/FloorplanRoomItem.html +6 -6
  38. package/docs/interfaces/FloorplanRoomLabelItem.html +3 -3
  39. package/docs/interfaces/FloorplanServerBounding.html +4 -4
  40. package/docs/interfaces/FloorplanServerComputedData.html +1 -1
  41. package/docs/interfaces/FloorplanServerData.html +2 -2
  42. package/docs/interfaces/FloorplanServerDoorItem.html +1 -1
  43. package/docs/interfaces/FloorplanServerDoorPosition.html +1 -1
  44. package/docs/interfaces/FloorplanServerEntrance.html +7 -7
  45. package/docs/interfaces/FloorplanServerFloorData.html +2 -2
  46. package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
  47. package/docs/interfaces/FloorplanServerObserver.html +2 -2
  48. package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
  49. package/docs/interfaces/FloorplanServerPosition.html +2 -2
  50. package/docs/interfaces/FloorplanServerRoomItem.html +7 -7
  51. package/docs/interfaces/FloorplanServerRoomLabelItem.html +3 -3
  52. package/docs/interfaces/ItemLabelPluginData.html +1 -1
  53. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
  54. package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
  55. package/docs/interfaces/LineJson.html +1 -1
  56. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  57. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  58. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  59. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  60. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  61. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  62. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  63. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  64. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  65. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  66. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  67. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  68. package/docs/interfaces/ModelViewPluginExportType.html +1 -1
  69. package/docs/interfaces/Object3DHelperState.html +1 -1
  70. package/docs/interfaces/OpenParameter.html +2 -2
  71. package/docs/interfaces/PaintBrushAction.html +7 -7
  72. package/docs/interfaces/PaintBrushConfigs.html +1 -1
  73. package/docs/interfaces/PaintBrushState.html +1 -1
  74. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  75. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
  76. package/docs/interfaces/PanoMeasureParameterType.html +2 -2
  77. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  78. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  79. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  80. package/docs/interfaces/PanoRulerProPluginExportType.html +1 -1
  81. package/docs/interfaces/PanoRulerProPluginOptions.html +1 -1
  82. package/docs/interfaces/PanoRulerProPluginParameterType.html +1 -1
  83. package/docs/interfaces/PanoRulerProPluginState.html +1 -1
  84. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
  85. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
  86. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  87. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
  88. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  89. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
  90. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  91. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
  92. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
  93. package/docs/interfaces/Point.html +1 -1
  94. package/docs/interfaces/PointJson.html +1 -1
  95. package/docs/interfaces/Room.html +1 -1
  96. package/docs/interfaces/RoomInfo.html +1 -1
  97. package/docs/interfaces/RoomLabel.html +7 -7
  98. package/docs/interfaces/RoomRules.html +1 -1
  99. package/docs/interfaces/Rooms.html +1 -1
  100. package/docs/interfaces/Scissor.html +5 -5
  101. package/docs/interfaces/TagConfig.html +3 -3
  102. package/docs/interfaces/Tags.html +3 -3
  103. package/docs/modules.html +21 -21
  104. package/libs/CSS3DRenderPlugin/CSS3DRender.d.ts +15 -4
  105. package/libs/CSS3DRenderPlugin/CSS3DRender.js +197 -143
  106. package/libs/CSS3DRenderPlugin/Controller.d.ts +2 -0
  107. package/libs/CSS3DRenderPlugin/Controller.js +47 -26
  108. package/libs/CSS3DRenderPlugin/utils/CSS3DObjectPlus.d.ts +22 -4
  109. package/libs/CSS3DRenderPlugin/utils/CSS3DObjectPlus.js +56 -37
  110. package/libs/Object3DHelperPlugin/Controller.js +24 -23
  111. package/libs/PanoTagPlugin/Components/Common/Audio.js +39 -41
  112. package/libs/PanoTagPlugin/Components/Common/Media.js +1060 -1031
  113. package/libs/PanoTagPlugin/Components/Common/MediaItem.js +49 -57
  114. package/libs/PanoTagPlugin/Components/Common/Point/CustomPoint.js +27 -27
  115. package/libs/PanoTagPlugin/Components/Common/Point/DefaultPoint.js +22 -22
  116. package/libs/PanoTagPlugin/Components/Common/Point/PointSwitch.js +7 -7
  117. package/libs/PanoTagPlugin/Components/Tag/AudioTag.js +64 -66
  118. package/libs/PanoTagPlugin/Components/Tag/ImageTextTag.js +100 -99
  119. package/libs/PanoTagPlugin/Components/Tag/MediaPlane.js +35 -33
  120. package/libs/PanoTagPlugin/Components/Tag/index.js +60 -63
  121. package/libs/PanoTagPlugin/Components/TagContainer.js +187 -0
  122. package/libs/PanoTagPlugin/Components/TagWrapper.js +61 -62
  123. package/libs/PanoTagPlugin/controller/TagComputer.js +1 -1
  124. package/libs/PanoTagPlugin/controller/index.d.ts +2 -1
  125. package/libs/PanoTagPlugin/controller/index.js +52 -42
  126. package/libs/PanoTagPlugin/index.js +2 -2
  127. package/libs/PanoTagPlugin/tag.config.js +1 -0
  128. package/libs/{TagComputer.0920083a.js → TagComputer.92e6d9a9.js} +0 -0
  129. package/libs/index.js +2 -2
  130. package/libs/shared-utils/Object3DHelper/Base/BaseController.js +63 -53
  131. package/libs/shared-utils/Object3DHelper/Controller/MoveController.js +12 -13
  132. package/libs/shared-utils/Object3DHelper/Controller/RectangleScaleController.js +43 -45
  133. package/libs/shared-utils/Object3DHelper/Helper/Objects/ArrowGroup.js +16 -10
  134. package/libs/shared-utils/Object3DHelper/Helper/RectangleScaleHelper.d.ts +1 -1
  135. package/libs/shared-utils/Object3DHelper/Helper/RectangleScaleHelper.js +43 -43
  136. package/libs/shared-utils/Object3DHelper/Helper/RotateHelper.js +2 -2
  137. package/libs/shared-utils/Object3DHelper/index.js +12 -12
  138. package/package.json +2 -2
  139. package/libs/PanoTagPlugin/Components/PointTag.js +0 -162
@@ -1,33 +1,33 @@
1
- var O = Object.defineProperty;
2
- var y = (h, e, t) => e in h ? O(h, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[e] = t;
3
- var r = (h, e, t) => (y(h, typeof e != "symbol" ? e + "" : e, t), t);
1
+ var m = Object.defineProperty;
2
+ var O = (p, e, t) => e in p ? m(p, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : p[e] = t;
3
+ var s = (p, e, t) => (O(p, typeof e != "symbol" ? e + "" : e, t), t);
4
4
  import * as l from "three";
5
- import { Subscribe as j } from "../../Subscribe.js";
6
- import g from "../utils/threex/domevents/index.js";
7
- import { notNil as v } from "../../isNil.js";
8
- import { CSS3DObjectPlus as u } from "../../../CSS3DRenderPlugin/utils/CSS3DObjectPlus.js";
5
+ import { Subscribe as y } from "../../Subscribe.js";
6
+ import j from "../utils/threex/domevents/index.js";
7
+ import { notNil as g } from "../../isNil.js";
8
+ import { CSS3DObjectPlus as D } from "../../../CSS3DRenderPlugin/utils/CSS3DObjectPlus.js";
9
9
  import "three/examples/jsm/renderers/CSS3DRenderer";
10
10
  import "../../../CSS3DRenderPlugin/utils/evenNumber.js";
11
11
  import "../../../CSS3DRenderPlugin/utils/centerPoint.js";
12
- let p = null;
13
- class S {
14
- constructor(e, t, s, n, a, o, c) {
15
- r(this, "hooks", new j());
16
- r(this, "helperObject3D");
17
- r(this, "originObject3D");
18
- r(this, "camera");
19
- r(this, "model");
20
- r(this, "scene");
21
- r(this, "container");
22
- r(this, "domEvents");
23
- r(this, "isDragging", !1);
24
- r(this, "onRender");
25
- r(this, "enabled", !1);
26
- r(this, "onWantsTapGesture", (e) => {
12
+ let h = null;
13
+ class k {
14
+ constructor(e, t, o, n, a, r, c) {
15
+ s(this, "hooks", new y());
16
+ s(this, "helperObject3D");
17
+ s(this, "originObject3D");
18
+ s(this, "camera");
19
+ s(this, "model");
20
+ s(this, "scene");
21
+ s(this, "container");
22
+ s(this, "domEvents");
23
+ s(this, "isDragging", !1);
24
+ s(this, "onRender");
25
+ s(this, "enabled", !1);
26
+ s(this, "onWantsTapGesture", (e) => {
27
27
  if (this.getIntersectObject(e))
28
28
  return !1;
29
29
  });
30
- this.camera = e, this.model = t, this.originObject3D = s, this.helperObject3D = n, this.container = a, this.scene = o, this.domEvents = new g(e, a), this.onRender = c != null ? c : () => {
30
+ this.camera = e, this.model = t, this.originObject3D = o, this.helperObject3D = n, this.container = a, this.scene = r, this.domEvents = new j(e, a), this.onRender = c != null ? c : () => {
31
31
  }, this.initialHelperPosition(), this.initialHelperQuaternion(), this.enable();
32
32
  }
33
33
  initialHelperPosition() {
@@ -54,22 +54,32 @@ class S {
54
54
  setOpacity(e) {
55
55
  this.setOriginOpacityProperty();
56
56
  const t = this.originObject3D;
57
- t instanceof l.Mesh && (t.material.opacity = e), t instanceof u && (t.container.style.opacity = e), this.render();
57
+ if (t instanceof l.Mesh && (t.material.opacity = e), t.isCSS3DObjectPlus) {
58
+ const o = t;
59
+ o.container.style.opacity = e.toString();
60
+ }
61
+ this.render();
58
62
  }
59
63
  restoreOpacity() {
60
- if (p === null)
64
+ if (h === null)
61
65
  return;
62
66
  const e = this.originObject3D;
63
- e instanceof l.Mesh && (e.material.opacity = p.opacity), e instanceof u && (e.container.style.opacity = p.opacity), this.render();
67
+ if (e instanceof l.Mesh && (e.material.opacity = h.opacity), e.isCSS3DObjectPlus) {
68
+ const t = e;
69
+ t.container.style.opacity = h.opacity.toString();
70
+ }
71
+ this.render();
64
72
  }
65
73
  setOriginOpacityProperty() {
66
- var e;
67
- if (p === null) {
68
- const t = this.originObject3D;
69
- t instanceof l.Mesh && (p = {
70
- opacity: t.material.opacity
71
- }), t instanceof u && (p = {
72
- opacity: (e = t.container.style.opacity) != null ? e : 1
74
+ var e, t;
75
+ if (h === null) {
76
+ const o = this.originObject3D;
77
+ o instanceof l.Mesh && (h = {
78
+ opacity: o.material.opacity
79
+ }), o instanceof D && (h = {
80
+ opacity: (e = o.container.style.opacity) != null ? e : 1
81
+ }), o.isCSS3DObjectPlus && (h = {
82
+ opacity: Number((t = o.container.style.opacity) != null ? t : 1)
73
83
  });
74
84
  }
75
85
  }
@@ -88,51 +98,51 @@ class S {
88
98
  applyHelperScaleMatrix4(e, t) {
89
99
  this.helperObject3D.applyHelperScaleMatrix4(e, t);
90
100
  }
91
- onWantsGesture(e, t, s) {
101
+ onWantsGesture(e, t, o) {
92
102
  if (this.isDragging)
93
103
  return !1;
94
104
  }
95
105
  render() {
96
106
  this.onRender();
97
107
  }
98
- hoverListener(e, t = 16777215, s = 1) {
99
- const n = (Array.isArray(e) ? e : [e]).filter(v), a = [];
100
- for (const o of n)
101
- if (o instanceof l.Mesh || o instanceof l.Group) {
102
- const c = o instanceof l.Group ? o.children.filter((i) => i instanceof l.Mesh) : [o];
108
+ hoverListener(e, t = 16777215, o = 1) {
109
+ const n = (Array.isArray(e) ? e : [e]).filter(g), a = [];
110
+ for (const r of n)
111
+ if (r instanceof l.Mesh || r instanceof l.Group) {
112
+ const c = r instanceof l.Group ? r.children.filter((i) => i instanceof l.Mesh) : [r];
103
113
  c.forEach((i) => {
104
114
  i.__originalColor__ = i.material.color.clone(), i.__originalOpacity__ = i.material.opacity;
105
115
  });
106
116
  const d = () => {
107
117
  c.forEach((i) => {
108
- i.material.color.set(t), i.material.opacity = s;
118
+ i.material.color.set(t), i.material.opacity = o;
109
119
  }), this.render();
110
120
  }, f = () => {
111
121
  c.forEach((i) => {
112
122
  i.material.color.copy(i.__originalColor__), i.material.opacity = i.__originalOpacity__;
113
123
  }), this.render();
114
- }, b = () => {
124
+ }, u = () => {
115
125
  this.isDragging || d();
116
- }, m = () => {
126
+ }, b = () => {
117
127
  this.isDragging || f();
118
128
  };
119
129
  for (const i of c)
120
- this.domEvents.addEventListener(i, "mouseover", b), this.domEvents.addEventListener(i, "mouseout", m), this.hooks.on("moveStart", d), this.hooks.on("moveEnd", f), this.hooks.on("rotateEnd", f), a.push(() => {
121
- this.domEvents.removeEventListener(i, "mouseover", b), this.domEvents.removeEventListener(i, "mouseout", m), this.hooks.off("moveStart", d), this.hooks.off("moveEnd", f), this.hooks.off("rotateEnd", f);
130
+ this.domEvents.addEventListener(i, "mouseover", u), this.domEvents.addEventListener(i, "mouseout", b), this.hooks.on("moveStart", d), this.hooks.on("moveEnd", f), this.hooks.on("rotateEnd", f), a.push(() => {
131
+ this.domEvents.removeEventListener(i, "mouseover", u), this.domEvents.removeEventListener(i, "mouseout", b), this.hooks.off("moveStart", d), this.hooks.off("moveEnd", f), this.hooks.off("rotateEnd", f);
122
132
  });
123
133
  }
124
- return () => a.forEach((o) => o == null ? void 0 : o());
134
+ return () => a.forEach((r) => r == null ? void 0 : r());
125
135
  }
126
136
  getIntersectObject(e) {
127
- const t = this.camera.position, s = this.helperObject3D;
128
- if (!s)
137
+ const t = this.camera.position, o = this.helperObject3D;
138
+ if (!o)
129
139
  return;
130
140
  let n;
131
- const a = e.intersectObject(s, !0)[0];
132
- if (!!a && (n = a, n.object = s, !!n)) {
141
+ const a = e.intersectObject(o, !0)[0];
142
+ if (!!a && (n = a, n.object = o, !!n)) {
133
143
  if (this.model.intersectRaycaster) {
134
- const o = this.model.intersectRaycaster(e)[0];
135
- if (o && o.point.distanceTo(t) < n.point.distanceTo(t))
144
+ const r = this.model.intersectRaycaster(e)[0];
145
+ if (r && r.point.distanceTo(t) < n.point.distanceTo(t))
136
146
  return;
137
147
  }
138
148
  return n.object;
@@ -140,6 +150,6 @@ class S {
140
150
  }
141
151
  }
142
152
  export {
143
- S as BaseController,
144
- p as originOpacity
153
+ k as BaseController,
154
+ h as originOpacity
145
155
  };
@@ -2,7 +2,7 @@ var u = Object.defineProperty;
2
2
  var m = (s, e, t) => e in s ? u(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
3
  var p = (s, e, t) => (m(s, typeof e != "symbol" ? e + "" : e, t), t);
4
4
  import { BaseController as f } from "../Base/BaseController.js";
5
- import * as a from "three";
5
+ import * as c from "three";
6
6
  import { getMouseRaycaster as b } from "../utils/getMouseRaycaster.js";
7
7
  import "../../Subscribe.js";
8
8
  import "../utils/threex/domevents/index.js";
@@ -18,8 +18,8 @@ class P extends f {
18
18
  p(this, "startInfo");
19
19
  const r = this.helperObject3D;
20
20
  this.hoverListener([r.xArrow, r.yArrow, r.zArrow]);
21
- const o = this.dragStart.bind(this), n = this.dragging.bind(this), h = this.dragEnd.bind(this);
22
- this.domEvents.addEventListener(this.helperObject3D, "mousedown", o), document.addEventListener("mousemove", n), document.addEventListener("mouseup", h);
21
+ const o = this.dragStart.bind(this), n = this.dragging.bind(this), a = this.dragEnd.bind(this);
22
+ this.domEvents.addEventListener(this.helperObject3D, "mousedown", o), document.addEventListener("mousemove", n), document.addEventListener("mouseup", a);
23
23
  }
24
24
  dragStart(t) {
25
25
  if (this.isDragging)
@@ -30,25 +30,24 @@ class P extends f {
30
30
  const o = (r == null ? void 0 : r.object).direction;
31
31
  if (!o)
32
32
  return this.dragEnd();
33
- const n = new a.Vector3(1, 0, 0).applyQuaternion(this.helperObject3D.quaternion), h = new a.Vector3(0, 1, 0).applyQuaternion(this.helperObject3D.quaternion), c = new a.Vector3(0, 0, 1).applyQuaternion(this.helperObject3D.quaternion), d = (() => {
33
+ const n = new c.Vector3(1, 0, 0).applyQuaternion(this.helperObject3D.quaternion), a = new c.Vector3(0, 1, 0).applyQuaternion(this.helperObject3D.quaternion), h = new c.Vector3(0, 0, 1).applyQuaternion(this.helperObject3D.quaternion), d = (() => {
34
34
  switch (o) {
35
35
  case "x":
36
36
  return n;
37
37
  case "y":
38
- return h;
38
+ return a;
39
39
  case "z":
40
- return c;
40
+ return h;
41
41
  }
42
42
  })(), g = (() => {
43
43
  switch (o) {
44
44
  case "x":
45
- return c;
46
45
  case "y":
47
- return c;
46
+ return h;
48
47
  case "z":
49
48
  return n;
50
49
  }
51
- })(), i = r.point.clone(), l = new a.Plane();
50
+ })(), i = r.point.clone(), l = new c.Plane();
52
51
  l.setFromNormalAndCoplanarPoint(g, i), this.startInfo = { startVectorProject: i.clone().projectOnVector(d), directionVector: d, plane: l }, this.helperObject3D.showDraggingHelper([o]), this.hooks.emit("moveStart"), this.isDragging = !0, console.log("%c MoveController dragStart", "color: #e5af2e");
53
52
  }
54
53
  dragging(t) {
@@ -60,11 +59,11 @@ class P extends f {
60
59
  move(t) {
61
60
  if (!this.startInfo)
62
61
  return this.dragEnd();
63
- const { plane: r, directionVector: o, startVectorProject: n } = this.startInfo, h = this.originObject3D, c = t.ray.intersectPlane(r, new a.Vector3());
64
- if (!c)
62
+ const { plane: r, directionVector: o, startVectorProject: n } = this.startInfo, a = this.originObject3D, h = t.ray.intersectPlane(r, new c.Vector3());
63
+ if (!h)
65
64
  return;
66
- const d = c.clone().projectOnVector(o), g = d.clone().sub(n), i = new a.Matrix4();
67
- i.setPosition(g), h.applyMatrix4(i), this.helperObject3D.applyMatrix4(i), n.copy(d), this.hooks.emit("positionUpdate", { matrix4: i });
65
+ const d = h.clone().projectOnVector(o), g = d.clone().sub(n), i = new c.Matrix4();
66
+ i.setPosition(g), a.applyMatrix4(i), this.helperObject3D.applyMatrix4(i), n.copy(d), this.hooks.emit("positionUpdate", { matrix4: i });
68
67
  }
69
68
  dragEnd() {
70
69
  !this.isDragging || (console.log("%c MoveController dragEnd", "color: #e94e4e"), this.startInfo = void 0, this.isDragging = !1, this.helperObject3D.show(), this.hooks.emit("moveEnd"));
@@ -1,8 +1,8 @@
1
1
  var X = Object.defineProperty;
2
- var Y = (h, a, e) => a in h ? X(h, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[a] = e;
3
- var k = (h, a, e) => (Y(h, typeof a != "symbol" ? a + "" : a, e), e);
2
+ var Y = (h, a, s) => a in h ? X(h, a, { enumerable: !0, configurable: !0, writable: !0, value: s }) : h[a] = s;
3
+ var N = (h, a, s) => (Y(h, typeof a != "symbol" ? a + "" : a, s), s);
4
4
  import { BaseController as A } from "../Base/BaseController.js";
5
- import * as I from "three";
5
+ import * as D from "three";
6
6
  import { Vector3 as n } from "three";
7
7
  import { getMouseRaycaster as H } from "../utils/getMouseRaycaster.js";
8
8
  import { vectorIsEqual as T } from "../utils/vectorIsEqual.js";
@@ -15,9 +15,9 @@ import "../../../CSS3DRenderPlugin/utils/evenNumber.js";
15
15
  import "../../../CSS3DRenderPlugin/utils/centerPoint.js";
16
16
  import "../utils/calculateThreeMouse.js";
17
17
  class it extends A {
18
- constructor(...e) {
19
- super(...e);
20
- k(this, "startInfo");
18
+ constructor(...s) {
19
+ super(...s);
20
+ N(this, "startInfo");
21
21
  }
22
22
  enable() {
23
23
  this.helperObject3D.enable(), super.enable();
@@ -32,83 +32,81 @@ class it extends A {
32
32
  this.helperObject3D.hide(), super.hide();
33
33
  }
34
34
  getDragPlane() {
35
- const e = new I.Plane(), o = this.helperObject3D.cornerPositions;
36
- if (o.length !== 0)
37
- return o.length < 3 ? e.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new n()), o[0]) : e.setFromCoplanarPoints(o[0], o[1], o[2]), e;
35
+ const s = new D.Plane(), e = this.helperObject3D.cornerPositions;
36
+ if (e.length !== 0)
37
+ return e.length < 3 ? s.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new n()), e[0]) : s.setFromCoplanarPoints(e[0], e[1], e[2]), s;
38
38
  }
39
- dragStart(e, o) {
40
- var p, s;
41
- (s = (p = this.helperObject3D).updatePoints) == null || s.call(p);
39
+ dragStart(s, e) {
40
+ var p, o;
41
+ (o = (p = this.helperObject3D).updatePoints) == null || o.call(p);
42
42
  const f = this.getDragPlane();
43
43
  if (!f)
44
44
  return this.dragEnd();
45
- this.startInfo = { startPoint: { position: o.position.clone(), direction: o.direction }, plane: f }, this.hooks.emit("scaleStart"), this.render(), this.isDragging = !0, console.log("%c RectangleScaleController dragStart", "color: #e5af2e");
45
+ this.startInfo = { startPoint: { position: e.position.clone(), direction: e.direction }, plane: f }, this.hooks.emit("scaleStart"), this.render(), this.isDragging = !0, console.log("%c RectangleScaleController dragStart", "color: #e5af2e");
46
46
  }
47
- dragging(e) {
47
+ dragging(s) {
48
48
  if (!this.isDragging)
49
49
  return;
50
- const o = H(this.camera, e, this.container);
51
- if (!o)
50
+ const e = H(this.camera, s, this.container);
51
+ if (!e)
52
52
  return this.dragEnd();
53
- this.scale(o);
53
+ this.scale(e), console.log("%c RectangleScaleController dragging", "color: #49de1b");
54
54
  }
55
- scale(e) {
56
- var E, S;
55
+ scale(s) {
56
+ var S, x;
57
57
  if (!this.startInfo)
58
58
  return;
59
- const o = this.originObject3D, { startPoint: f, plane: p } = this.startInfo, s = this.helperObject3D.cornerPositions;
60
- if (s.length < 4)
59
+ const e = this.originObject3D, { startPoint: f, plane: p } = this.startInfo, o = this.helperObject3D.cornerPositions;
60
+ if (o.length < 4)
61
61
  return this.dragEnd();
62
- const g = e.ray.intersectPlane(p, new n());
62
+ const g = s.ray.intersectPlane(p, new n());
63
63
  if (!g || T(g, this.camera.position))
64
64
  return;
65
- const b = new n().addVectors(s[0], s[2]).divideScalar(2), { position: z, direction: R } = f, D = new n().subVectors(s[1], s[0]), j = new n().subVectors(s[3], s[0]), O = (r) => {
65
+ const u = new n().addVectors(o[0], o[2]).divideScalar(2), { position: k, direction: z } = f, j = new n().subVectors(o[1], o[0]), O = new n().subVectors(o[3], o[0]), V = (r) => {
66
66
  const i = new n(0, 0, 0);
67
67
  if (!this.startInfo)
68
68
  return i;
69
- const t = (r === "ew" ? D : j).clone(), c = z.clone().projectOnVector(t), u = g.clone().projectOnVector(t), v = b.clone().projectOnVector(t);
70
- if (u.equals(c))
69
+ const t = (r === "ew" ? j : O).clone(), c = k.clone().projectOnVector(t), b = g.clone().projectOnVector(t), E = u.clone().projectOnVector(t);
70
+ if (b.equals(c))
71
71
  return i;
72
72
  if (r === "ns" && typeof this.startInfo.dragPointInCenterBottom != "boolean") {
73
- const l = new n().subVectors(u, v), m = l.x < 0 && t.x >= 0, w = l.y < 0 && t.y >= 0, P = l.z < 0 && t.z >= 0;
74
- this.startInfo.dragPointInCenterBottom = m || w || P;
73
+ const l = new n().subVectors(b, E), w = l.x < 0 && t.x >= 0, P = l.y < 0 && t.y >= 0, I = l.z < 0 && t.z >= 0;
74
+ this.startInfo.dragPointInCenterBottom = w || P || I;
75
75
  }
76
76
  if (r === "ew" && typeof this.startInfo.dragPointInCenterLeft != "boolean") {
77
- const l = new n().subVectors(u, v), m = l.x < 0 && t.x >= 0, w = l.y < 0 && t.y >= 0, P = l.z < 0 && t.z >= 0;
78
- this.startInfo.dragPointInCenterLeft = m || w || P;
77
+ const l = new n().subVectors(b, E), w = l.x < 0 && t.x >= 0, P = l.y < 0 && t.y >= 0, I = l.z < 0 && t.z >= 0;
78
+ this.startInfo.dragPointInCenterLeft = w || P || I;
79
79
  }
80
- const M = new n().subVectors(u, c), N = M.length();
81
- return N > 0.2 ? (console.warn("offset.length() > 0.2, skipped", N), i) : M;
82
- }, B = O("ew"), L = O("ns"), V = () => {
83
- const r = B;
80
+ const v = new n().subVectors(b, c), M = v.length();
81
+ return M > 0.3 ? (console.warn("offset.length() > 0.3, skipped", M), i) : v;
82
+ }, R = V("ew"), B = V("ns"), y = () => {
83
+ const r = R;
84
84
  this.helperObject3D.cornerPositions.forEach((i, t) => {
85
85
  var c;
86
86
  (c = this.startInfo) != null && c.dragPointInCenterLeft ? (t === 0 || t === 3) && i.add(r) : (t === 1 || t === 2) && i.add(r);
87
87
  });
88
- }, y = () => {
89
- const r = L;
88
+ }, C = () => {
89
+ const r = B;
90
90
  this.helperObject3D.cornerPositions.forEach((i, t) => {
91
91
  var c;
92
92
  (c = this.startInfo) != null && c.dragPointInCenterBottom ? (t === 0 || t === 1) && i.add(r) : (t === 2 || t === 3) && i.add(r);
93
93
  });
94
94
  };
95
- switch (R) {
95
+ switch (z) {
96
96
  case "ew":
97
- V();
97
+ y();
98
98
  break;
99
99
  case "ns":
100
- y();
100
+ C();
101
101
  break;
102
102
  case "nesw":
103
103
  case "nwse":
104
- V(), y();
104
+ y(), C();
105
105
  }
106
- const q = new n().subVectors(s[1], s[0]).length() / D.length(), F = new n().subVectors(s[3], s[0]).length() / j.length(), C = new n(q, F, 1);
107
- console.log(C);
108
- const x = new I.Matrix4().scale(C);
109
- o.scale.applyMatrix4(x), f.position.copy(g);
110
- const U = new n().addVectors(s[0], s[2]).divideScalar(2), W = new n().subVectors(U, b), d = new I.Matrix4().setPosition(W);
111
- o.applyMatrix4(d), (E = this.helperObject3D.css3DInstance) == null || E.css3DObject.applyMatrix4(d), (S = this.helperObject3D.plane) == null || S.applyMatrix4(d), this.hooks.emit("scaleUpdate", { matrix4: x, helperOrigin: b }), this.hooks.emit("positionUpdate", { matrix4: d }), this.render();
106
+ const L = new n().subVectors(o[1], o[0]).length() / j.length(), q = new n().subVectors(o[3], o[0]).length() / O.length(), F = new n(L, q, 1), m = new D.Matrix4().scale(F);
107
+ e.isCSS3DObjectPlus ? e.applyScaleMatrix4(m) : e.scale.applyMatrix4(m), f.position.copy(g);
108
+ const U = new n().addVectors(o[0], o[2]).divideScalar(2), W = new n().subVectors(U, u), d = new D.Matrix4().setPosition(W);
109
+ e.applyMatrix4(d), (S = this.helperObject3D.css3DInstance) == null || S.css3DObject.applyMatrix4(d), (x = this.helperObject3D.plane) == null || x.applyMatrix4(d), this.hooks.emit("scaleUpdate", { matrix4: m, helperOrigin: u }), this.hooks.emit("positionUpdate", { matrix4: d }), this.render();
112
110
  }
113
111
  dragEnd() {
114
112
  !this.isDragging || (this.startInfo = void 0, this.isDragging = !1, this.hooks.emit("scaleEnd"), this.render(), console.log("%c RectangleScaleController dragEnd", "color: #e94e4e"));
@@ -1,21 +1,27 @@
1
1
  var y = Object.defineProperty;
2
- var g = (r, e, t) => e in r ? y(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var i = (r, e, t) => (g(r, typeof e != "symbol" ? e + "" : e, t), t);
2
+ var g = (r, t, e) => t in r ? y(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var i = (r, t, e) => (g(r, typeof t != "symbol" ? t + "" : t, e), e);
4
4
  import * as o from "three";
5
5
  import { DirectionGroup as f, DirectionMesh as l } from "../../utils/direction.js";
6
- class u extends f {
7
- constructor(t) {
6
+ class G extends f {
7
+ constructor(e) {
8
8
  var c;
9
- super(t.direction);
9
+ super(e.direction);
10
10
  i(this, "line");
11
11
  i(this, "arrow");
12
12
  i(this, "lineHeight", 0.4);
13
13
  i(this, "arrowHeight", 0.1);
14
14
  this.name = "ArrowGroup";
15
- const w = new o.Color((c = t.color) != null ? c : 16214315), n = new o.MeshBasicMaterial({ color: w, depthTest: !1 }), m = new o.ConeGeometry(0.04, 0.1, 32), s = new l(m, n.clone(), t.direction);
16
- s.name = `arrow-${t.direction}`, this.arrow = s;
17
- const h = 4e-3, d = new o.CylinderGeometry(h, h, 0.4, 32), a = new l(d, n.clone(), t.direction);
18
- a.name = `line-${t.direction}`, this.line = a, this.formatArrow(), this.formatLine(), this.add(this.arrow, this.line);
15
+ const w = new o.Color((c = e.color) != null ? c : 16214315), n = new o.MeshBasicMaterial({
16
+ color: w,
17
+ depthTest: !1,
18
+ opacity: 1,
19
+ transparent: !0,
20
+ side: o.DoubleSide
21
+ }), d = new o.ConeGeometry(0.04, 0.1, 32), s = new l(d, n.clone(), e.direction);
22
+ s.name = `arrow-${e.direction}`, this.arrow = s;
23
+ const a = 4e-3, m = new o.CylinderGeometry(a, a, 0.4, 32), h = new l(m, n.clone(), e.direction);
24
+ h.name = `line-${e.direction}`, this.line = h, this.formatArrow(), this.formatLine(), this.add(this.arrow, this.line);
19
25
  }
20
26
  formatArrow() {
21
27
  this.arrow.geometry.translate(0, this.lineHeight + this.arrowHeight / 2, 0), this.direction === "x" ? (this.arrow.geometry.rotateX(Math.PI / 2), this.arrow.geometry.rotateY(Math.PI / 2)) : this.direction === "z" && this.arrow.geometry.rotateX(Math.PI / 2);
@@ -25,5 +31,5 @@ class u extends f {
25
31
  }
26
32
  }
27
33
  export {
28
- u as ArrowGroup
34
+ G as ArrowGroup
29
35
  };
@@ -3,7 +3,7 @@ import { RectangleScaleHelperAbstract } from '.';
3
3
  import type { Create3DElementReturnType } from '../../../CSS3DRenderPlugin';
4
4
  import type { Vector3 } from 'three';
5
5
  import { CSS3DObject } from 'three/examples/jsm/renderers/CSS3DRenderer';
6
- import { CSS3DObjectPlus } from '../../../CSS3DRenderPlugin/utils/CSS3DObjectPlus';
6
+ import type { CSS3DObjectPlus } from '../../../CSS3DRenderPlugin/utils/CSS3DObjectPlus';
7
7
  declare type NonVoid<T> = T extends void ? never : T;
8
8
  declare type OriginObjectType = CSS3DObject | THREE.Object3D;
9
9
  export declare class RectangleScaleHelper<T extends OriginObjectType = OriginObjectType> extends RectangleScaleHelperAbstract<T, HTMLElement> {
@@ -1,31 +1,31 @@
1
1
  var b = Object.defineProperty;
2
- var m = (l, a, e) => a in l ? b(l, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[a] = e;
3
- var n = (l, a, e) => (m(l, typeof a != "symbol" ? a + "" : a, e), e);
2
+ var m = (o, n, e) => n in o ? b(o, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[n] = e;
3
+ var i = (o, n, e) => (m(o, typeof n != "symbol" ? n + "" : n, e), e);
4
4
  import { CSS3DRender as f } from "../../../CSS3DRenderPlugin/CSS3DRender.js";
5
- import * as o from "three";
5
+ import * as c from "three";
6
6
  import { RectangleScaleHelperAbstract as y } from "../Base/BaseHelper.js";
7
7
  import "./OutlineHelper.js";
8
8
  import { CSS3DObject as S } from "three/examples/jsm/renderers/CSS3DRenderer";
9
9
  import { rectangleScaleDom as j } from "./HTML/rectangleScaleDom.js";
10
- import { CSS3DObjectPlus as O } from "../../../CSS3DRenderPlugin/utils/CSS3DObjectPlus.js";
11
10
  import "../../Subscribe.js";
12
11
  import "../../../CSS3DRenderPlugin/utils/evenNumber.js";
13
12
  import "../../../CSS3DRenderPlugin/utils/positionToVector3.js";
13
+ import "../../../CSS3DRenderPlugin/utils/CSS3DObjectPlus.js";
14
14
  import "../../../CSS3DRenderPlugin/utils/centerPoint.js";
15
15
  import "./HTML/utils/createElement.js";
16
- class C extends y {
17
- constructor(e, t, s, i) {
16
+ class x extends y {
17
+ constructor(e, t, s, l) {
18
18
  super(e);
19
- n(this, "points", []);
20
- n(this, "cornerPositions", []);
21
- n(this, "css3DInstance");
22
- n(this, "plane");
23
- n(this, "css3DRenderer", new f());
24
- n(this, "camera");
25
- n(this, "scene");
26
- n(this, "container");
27
- n(this, "enabled", !1);
28
- this.camera = s, this.scene = i, this.container = t, this.initRectangleScaleHelper();
19
+ i(this, "points", []);
20
+ i(this, "cornerPositions", []);
21
+ i(this, "css3DInstance");
22
+ i(this, "plane");
23
+ i(this, "css3DRenderer", new f());
24
+ i(this, "camera");
25
+ i(this, "scene");
26
+ i(this, "container");
27
+ i(this, "enabled", !1);
28
+ this.camera = s, this.scene = l, this.container = t, this.initRectangleScaleHelper();
29
29
  }
30
30
  get helperObject() {
31
31
  var e;
@@ -34,22 +34,22 @@ class C extends y {
34
34
  return this.css3DInstance.css3DObject;
35
35
  }
36
36
  updatePosition() {
37
- var e, t;
38
- (e = this.css3DInstance) == null || e.css3DObject.position.copy(this.originObject3D.position), (t = this.plane) == null || t.position.copy(this.originObject3D.position);
37
+ var e;
38
+ this.helperObject.position.copy(this.originObject3D.position), (e = this.plane) == null || e.position.copy(this.originObject3D.position);
39
39
  }
40
40
  updateQuaternion() {
41
41
  var e;
42
42
  (e = this.plane) == null || e.quaternion.copy(this.originObject3D.quaternion);
43
43
  }
44
44
  applyMatrix4(e) {
45
- var t, s;
46
- (t = this.css3DInstance) == null || t.css3DObject.applyMatrix4(e), (s = this.plane) == null || s.applyMatrix4(e), this.cornerPositions.forEach((i) => i.applyMatrix4(e));
45
+ var t;
46
+ super.applyMatrix4(e), this.helperObject.applyMatrix4(e), (t = this.plane) == null || t.applyMatrix4(e), this.cornerPositions.forEach((s) => s.applyMatrix4(e));
47
47
  }
48
48
  showDraggingHelper() {
49
49
  }
50
50
  applyHelperScaleMatrix4(e, t) {
51
- var s, i;
52
- (s = this.css3DInstance) == null || s.css3DObject.scale.applyMatrix4(e), (i = this.plane) == null || i.scale.applyMatrix4(e);
51
+ var s;
52
+ (s = this.plane) == null || s.scale.applyMatrix4(e), this.helperObject.applyScaleMatrix4(e);
53
53
  }
54
54
  updatePoints() {
55
55
  const e = this.calculatePointPosition(this.cornerPositions);
@@ -58,19 +58,19 @@ class C extends y {
58
58
  });
59
59
  }
60
60
  applyHelperQuaternion(e, t) {
61
- var i;
62
- const s = (i = this.css3DInstance) == null ? void 0 : i.css3DObject;
61
+ var l;
62
+ const s = (l = this.css3DInstance) == null ? void 0 : l.css3DObject;
63
63
  if (s) {
64
- const c = new o.Vector3().subVectors(s.position, t).applyQuaternion(e).add(t);
65
- s.position.copy(c), s.applyQuaternion(e);
64
+ const a = new c.Vector3().subVectors(s.position, t).applyQuaternion(e).add(t);
65
+ s.position.copy(a), s.applyQuaternion(e);
66
66
  }
67
67
  if (this.plane) {
68
- const c = new o.Vector3().subVectors(this.plane.position, t).applyQuaternion(e).add(t);
69
- this.plane.position.copy(c), this.plane.applyQuaternion(e);
68
+ const a = new c.Vector3().subVectors(this.plane.position, t).applyQuaternion(e).add(t);
69
+ this.plane.position.copy(a), this.plane.applyQuaternion(e);
70
70
  }
71
- this.cornerPositions.forEach((c) => {
72
- const r = new o.Vector3().subVectors(c, t).applyQuaternion(e).add(t);
73
- c.copy(r);
71
+ this.cornerPositions.forEach((a) => {
72
+ const r = new c.Vector3().subVectors(a, t).applyQuaternion(e).add(t);
73
+ a.copy(r);
74
74
  });
75
75
  }
76
76
  enable() {
@@ -93,7 +93,7 @@ class C extends y {
93
93
  this.disable(), this.css3DRenderer.dispose();
94
94
  }
95
95
  initRectangleScaleHelper() {
96
- var h;
96
+ var p;
97
97
  const e = this.getCornerPositions();
98
98
  if (!e)
99
99
  return;
@@ -102,24 +102,24 @@ class C extends y {
102
102
  if (!t)
103
103
  return;
104
104
  this.css3DInstance = t, t.appendToElement(this.container);
105
- const s = t.css3DObject.container, { container: i, squares: c } = j();
106
- this.points = c.map((d, D) => ({
107
- direction: d.direction,
108
- point: d.element,
105
+ const s = t.css3DObject.container, { container: l, squares: a } = j();
106
+ this.points = a.map((h, D) => ({
107
+ direction: h.direction,
108
+ point: h.element,
109
109
  position: this.calculatePointPosition(e)[D]
110
- })), s.insertBefore(i, (h = s.children[0]) != null ? h : null);
111
- const r = new o.PlaneGeometry(t.css3DObject.width, t.css3DObject.height), u = new o.MeshBasicMaterial({
110
+ })), s.insertBefore(l, (p = s.children[0]) != null ? p : null);
111
+ const r = new c.PlaneGeometry(t.css3DObject.width, t.css3DObject.height), d = new c.MeshBasicMaterial({
112
112
  color: 0,
113
113
  opacity: 0.15,
114
114
  transparent: !0,
115
- side: o.DoubleSide
116
- }), p = new o.Mesh(r, u);
117
- this.scene.add(p), this.plane = p, this.updatePosition();
115
+ side: c.DoubleSide
116
+ }), u = new c.Mesh(r, d);
117
+ this.scene.add(u), this.updatePosition();
118
118
  }
119
119
  getCornerPositions() {
120
120
  const { originObject3D: e } = this;
121
121
  if (e instanceof S) {
122
- if (e instanceof O)
122
+ if (e.isCSS3DObjectPlus)
123
123
  return e.cornerPoints;
124
124
  console.error("\u6682\u65F6\u53EA\u652F\u6301 CSS3DRenderPlugin \u751F\u6210\u7684\u7269\u4F53");
125
125
  } else
@@ -139,5 +139,5 @@ class C extends y {
139
139
  }
140
140
  }
141
141
  export {
142
- C as RectangleScaleHelper
142
+ x as RectangleScaleHelper
143
143
  };
@@ -81,9 +81,9 @@ class h extends r.Mesh {
81
81
  this.material = new r.MeshBasicMaterial({
82
82
  opacity: 0.6,
83
83
  color: (i = e.color) != null ? i : 16777215,
84
- depthTest: !1,
85
84
  transparent: !0,
86
- side: r.DoubleSide
85
+ side: r.DoubleSide,
86
+ depthTest: !1
87
87
  }), this.direction = e.direction, this.geometry.name = `RotateHelperCircleGeometry-${this.direction}`, this.direction === "y" ? this.rotateX(Math.PI / 2) : this.direction === "x" && this.rotateY(-Math.PI / 2);
88
88
  }
89
89
  }