@realsee/dnalogel 2.2.7 → 2.3.0

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 (275) hide show
  1. package/dist/CSS3DRenderPlugin/CSS3DRender.d.ts +48 -34
  2. package/dist/CSS3DRenderPlugin/Controller.d.ts +5 -5
  3. package/dist/CSS3DRenderPlugin/index.d.ts +2 -1
  4. package/dist/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +4 -0
  5. package/dist/CSS3DRenderPlugin/utils/even.d.ts +9 -0
  6. package/dist/CSS3DRenderPlugin/utils/generateBehindFiveElement.d.ts +2 -0
  7. package/dist/CSS3DRenderPlugin/utils/getAllCSS3DObject.d.ts +3 -0
  8. package/dist/CSS3DRenderPlugin/utils/index.d.ts +1 -1
  9. package/dist/CSS3DRenderPlugin/utils/three/CSS3DGroup.d.ts +25 -0
  10. package/dist/CSS3DRenderPlugin/utils/{CSS3DObjectPlus.d.ts → three/CSS3DObject.d.ts} +31 -11
  11. package/dist/CSS3DRenderPlugin/utils/three/CSS3DRenderer.d.ts +14 -0
  12. package/dist/CSS3DRenderPlugin/utils/three/CSS3DScene.d.ts +12 -0
  13. package/dist/CSS3DRenderPlugin/utils/three/OpacityMesh.d.ts +6 -0
  14. package/dist/CSS3DRenderPlugin/utils/waitFiveModelLoaded.d.ts +2 -0
  15. package/dist/Object3DHelperPlugin/Controller.d.ts +2 -0
  16. package/dist/index.cjs.js +46 -46
  17. package/dist/index.js +4987 -4817
  18. package/dist/index.umd.js +39 -39
  19. package/dist/shared-utils/Object3DHelper/Helper/RectangleScaleHelper.d.ts +2 -2
  20. package/docs/assets/highlight.css +7 -0
  21. package/docs/assets/search.js +1 -1
  22. package/docs/classes/CSS3DRender.html +533 -0
  23. package/docs/classes/CruisePluginController.html +24 -24
  24. package/docs/classes/Magnifier.html +16 -16
  25. package/docs/classes/ModelRoomLabelController.html +11 -11
  26. package/docs/classes/Object3DHelperController.html +24 -24
  27. package/docs/classes/PaintBrush.html +15 -15
  28. package/docs/classes/PanoTagPluginController.html +39 -39
  29. package/docs/classes/Util.BetterTween.html +8 -8
  30. package/docs/classes/Util.FivePointSelector.html +12 -12
  31. package/docs/classes/Util.Interval.html +12 -12
  32. package/docs/classes/Util.Magnifier.html +17 -17
  33. package/docs/classes/Util.PointDomHelper.html +11 -11
  34. package/docs/classes/Util.PointHelper.html +11 -11
  35. package/docs/classes/Util.Rectangle.html +13 -13
  36. package/docs/enums/CameraMovementEffect.html +7 -7
  37. package/docs/enums/ContentType.html +12 -12
  38. package/docs/enums/DIRECTION.html +9 -9
  39. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +9 -9
  40. package/docs/enums/DimensionType.html +7 -7
  41. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +8 -8
  42. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +9 -9
  43. package/docs/enums/LinkType.html +7 -7
  44. package/docs/enums/PaintBrushTypeEnum.html +8 -8
  45. package/docs/enums/PointType.html +7 -7
  46. package/docs/enums/Rotation.html +8 -8
  47. package/docs/functions/CSS3DRenderPlugin.html +6 -5
  48. package/docs/functions/CameraMovementPlugin.html +6 -5
  49. package/docs/functions/CruisePlugin.html +6 -5
  50. package/docs/functions/GuideLinePlugin.html +7 -6
  51. package/docs/functions/ItemLabelPlugin.html +6 -5
  52. package/docs/functions/MapviewFloorplanPlugin.html +6 -5
  53. package/docs/functions/ModelChassisCompassPlugin.html +6 -5
  54. package/docs/functions/ModelEntryDoorGuidePlugin.html +6 -5
  55. package/docs/functions/ModelFloorplanPlugin.html +6 -5
  56. package/docs/functions/ModelItemLabelPlugin.html +6 -5
  57. package/docs/functions/ModelRoomLabelPlugin.html +6 -5
  58. package/docs/functions/ModelTVVideoPlugin.html +6 -5
  59. package/docs/functions/ModelViewPlugin.html +6 -5
  60. package/docs/functions/Object3DHelperPlugin.html +6 -5
  61. package/docs/functions/PanoCompassPlugin.html +6 -5
  62. package/docs/functions/PanoCursorRaycasterPlugin.html +6 -5
  63. package/docs/functions/PanoDoorLabelPlugin.html +6 -5
  64. package/docs/functions/PanoFloorplanRadarPlugin.html +6 -5
  65. package/docs/functions/PanoMeasurePlugin.html +6 -5
  66. package/docs/functions/PanoRulerPlugin.html +6 -5
  67. package/docs/functions/PanoRulerProPlugin.html +6 -5
  68. package/docs/functions/PanoSpatialTagPlugin.html +6 -5
  69. package/docs/functions/PanoTagPlugin.html +6 -5
  70. package/docs/functions/TopviewFloorplanPlugin.html +6 -5
  71. package/docs/functions/Util.getCoordsFromClient.html +5 -5
  72. package/docs/functions/Util.getCoordsFromElement.html +5 -5
  73. package/docs/functions/Util.getFrameTime.html +5 -5
  74. package/docs/functions/Util.getIntersectFromRelativePosition.html +5 -5
  75. package/docs/functions/Util.getRaycasterFromFivePointer.html +5 -5
  76. package/docs/functions/Util.isNil.html +5 -5
  77. package/docs/functions/Util.nextFrame.html +5 -5
  78. package/docs/functions/Util.notNil.html +5 -5
  79. package/docs/functions/Util.requestAnimationFrameInterval.html +5 -5
  80. package/docs/functions/Util.tweenProgress.html +5 -5
  81. package/docs/functions/pluginFlag.html +7 -6
  82. package/docs/index.html +6 -5
  83. package/docs/interfaces/CSS3DRenderPluginEventMap.html +11 -11
  84. package/docs/interfaces/CSS3DRenderPluginState.html +8 -8
  85. package/docs/interfaces/CameraMovementPluginExportType.html +7 -7
  86. package/docs/interfaces/ContentTypeMap.html +12 -12
  87. package/docs/interfaces/FloorplanBounding.html +8 -8
  88. package/docs/interfaces/FloorplanData.html +10 -10
  89. package/docs/interfaces/FloorplanEntrance.html +11 -11
  90. package/docs/interfaces/FloorplanExtraObject.html +10 -10
  91. package/docs/interfaces/FloorplanExtraObject3D.html +8 -8
  92. package/docs/interfaces/FloorplanFloorData.html +9 -9
  93. package/docs/interfaces/FloorplanImagePosition.html +7 -7
  94. package/docs/interfaces/FloorplanObserver.html +9 -9
  95. package/docs/interfaces/FloorplanOutlineItem.html +9 -9
  96. package/docs/interfaces/FloorplanPosition.html +7 -7
  97. package/docs/interfaces/FloorplanRoomItem.html +13 -13
  98. package/docs/interfaces/FloorplanRoomLabelItem.html +7 -7
  99. package/docs/interfaces/FloorplanServerBounding.html +8 -8
  100. package/docs/interfaces/FloorplanServerComputedData.html +10 -10
  101. package/docs/interfaces/FloorplanServerData.html +7 -7
  102. package/docs/interfaces/FloorplanServerDoorItem.html +10 -10
  103. package/docs/interfaces/FloorplanServerDoorPosition.html +8 -8
  104. package/docs/interfaces/FloorplanServerEntrance.html +11 -11
  105. package/docs/interfaces/FloorplanServerFloorData.html +9 -9
  106. package/docs/interfaces/FloorplanServerImagePosition.html +7 -7
  107. package/docs/interfaces/FloorplanServerObserver.html +9 -9
  108. package/docs/interfaces/FloorplanServerOutlineItem.html +9 -9
  109. package/docs/interfaces/FloorplanServerPosition.html +7 -7
  110. package/docs/interfaces/FloorplanServerRoomItem.html +14 -14
  111. package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -7
  112. package/docs/interfaces/ItemLabelPluginData.html +6 -6
  113. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +11 -11
  114. package/docs/interfaces/ItemLabelPluginParametersType.html +9 -9
  115. package/docs/interfaces/LineJson.html +7 -7
  116. package/docs/interfaces/ModelChassisCompassPluginData.html +7 -7
  117. package/docs/interfaces/ModelChassisCompassPluginExportType.html +8 -8
  118. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +7 -7
  119. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +8 -8
  120. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +8 -8
  121. package/docs/interfaces/ModelItemLabelPluginData.html +6 -6
  122. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +11 -11
  123. package/docs/interfaces/ModelItemLabelPluginParametersType.html +7 -7
  124. package/docs/interfaces/ModelRoomLabelPluginData.html +6 -6
  125. package/docs/interfaces/ModelTVVideoPluginData.html +9 -9
  126. package/docs/interfaces/ModelTVVideoPluginExportType.html +8 -8
  127. package/docs/interfaces/ModelTVVideoPluginParameterType.html +6 -6
  128. package/docs/interfaces/ModelViewPluginExportType.html +8 -8
  129. package/docs/interfaces/Object3DHelperState.html +8 -8
  130. package/docs/interfaces/OpenParameter.html +7 -7
  131. package/docs/interfaces/PaintBrushAction.html +12 -12
  132. package/docs/interfaces/PaintBrushConfigs.html +12 -12
  133. package/docs/interfaces/PaintBrushState.html +10 -10
  134. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +10 -10
  135. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +7 -6
  136. package/docs/interfaces/PanoMeasureParameterType.html +11 -11
  137. package/docs/interfaces/PanoRulerPluginExportType.html +10 -10
  138. package/docs/interfaces/PanoRulerPluginOptions.html +7 -7
  139. package/docs/interfaces/PanoRulerPluginParameterType.html +8 -8
  140. package/docs/interfaces/PanoRulerProPluginExportType.html +9 -9
  141. package/docs/interfaces/PanoRulerProPluginOptions.html +7 -7
  142. package/docs/interfaces/PanoRulerProPluginParameterType.html +7 -7
  143. package/docs/interfaces/PanoRulerProPluginState.html +8 -8
  144. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +7 -6
  145. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +7 -6
  146. package/docs/interfaces/PanoSpatialTagPluginData.html +11 -11
  147. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +10 -10
  148. package/docs/interfaces/PanoSpatialTagPluginExportType.html +13 -13
  149. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +10 -10
  150. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +13 -13
  151. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +11 -11
  152. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +10 -10
  153. package/docs/interfaces/Point.html +8 -8
  154. package/docs/interfaces/PointJson.html +8 -8
  155. package/docs/interfaces/Room.html +9 -9
  156. package/docs/interfaces/RoomInfo.html +7 -7
  157. package/docs/interfaces/RoomLabel.html +14 -14
  158. package/docs/interfaces/RoomRules.html +7 -6
  159. package/docs/interfaces/Rooms.html +7 -6
  160. package/docs/interfaces/Scissor.html +9 -9
  161. package/docs/interfaces/TagConfig.html +10 -10
  162. package/docs/interfaces/Tags.html +9 -9
  163. package/docs/interfaces/Util.MagnifierParameter.html +11 -11
  164. package/docs/interfaces/Util.MouseGroupParameter.html +8 -8
  165. package/docs/modules/Util.html +5 -5
  166. package/docs/modules.html +7 -5
  167. package/docs/types/ArrayPosition.html +7 -6
  168. package/docs/types/CSS3DRenderExportType.html +8 -7
  169. package/docs/types/CSS3DRenderPluginExportType.html +7 -6
  170. package/docs/types/CSS3DRenderPluginParameterType.html +7 -6
  171. package/docs/types/Color.html +7 -6
  172. package/docs/types/ContentTypeConfigKey.html +7 -6
  173. package/docs/types/ContentTypeConfigKeyArray.html +7 -6
  174. package/docs/types/Create3DDomContainerReturnType.html +7 -6
  175. package/docs/types/Create3DElementReturnType.html +8 -7
  176. package/docs/types/CruisePluginExportType.html +7 -6
  177. package/docs/types/Direction-1.html +7 -6
  178. package/docs/types/Direction4.html +7 -6
  179. package/docs/types/FloorplanRuleLabels.html +7 -6
  180. package/docs/types/FloorplanServerRuleLabels.html +7 -6
  181. package/docs/types/GuideLinePluginExportType.html +7 -6
  182. package/docs/types/HelperEventMap.html +7 -6
  183. package/docs/types/MapviewFloorplanPluginParameterType.html +7 -6
  184. package/docs/types/MapviewFloorplanPluginReturnType.html +7 -6
  185. package/docs/types/MediaData.html +7 -6
  186. package/docs/types/ModelEntryDoorGuidePluginParameterType.html +7 -6
  187. package/docs/types/ModelFloorplanPluginParameterType.html +7 -6
  188. package/docs/types/ModelFloorplanPluginReturnType.html +7 -6
  189. package/docs/types/ModelRoomLabelPluginParameters.html +7 -6
  190. package/docs/types/ModelRoomLabelPluginReturnType.html +7 -6
  191. package/docs/types/MoveArgs.html +7 -6
  192. package/docs/types/MoveOpts.html +7 -6
  193. package/docs/types/Object3DHelperEventMap.html +7 -6
  194. package/docs/types/ObjectFit.html +7 -6
  195. package/docs/types/PaintBrushEventMap.html +7 -6
  196. package/docs/types/PanoCompassPluginData.html +7 -6
  197. package/docs/types/PanoCompassPluginExportType.html +7 -6
  198. package/docs/types/PanoCompassPluginParameterType.html +7 -6
  199. package/docs/types/PanoFloorplanRadarPluginParameterType.html +7 -6
  200. package/docs/types/PanoFloorplanRadarPluginReturnType.html +7 -6
  201. package/docs/types/PanoMeasurePluginEvent.html +7 -6
  202. package/docs/types/PanoMeasureReturnType.html +7 -6
  203. package/docs/types/PanoSpatialTagPluginId.html +7 -6
  204. package/docs/types/PanoTagPluginExportInterface.html +7 -6
  205. package/docs/types/PanoTagPluginParamsInterface.html +7 -6
  206. package/docs/types/PlaneTag.html +7 -6
  207. package/docs/types/PointTag.html +7 -6
  208. package/docs/types/Position.html +7 -6
  209. package/docs/types/RotateArgs.html +7 -6
  210. package/docs/types/RotateOpts.html +7 -6
  211. package/docs/types/RuleLabelsKey.html +7 -6
  212. package/docs/types/RuleLabelsValue.html +7 -6
  213. package/docs/types/Tag.html +7 -6
  214. package/docs/types/Tag2D.html +7 -6
  215. package/docs/types/Tag3D.html +7 -6
  216. package/docs/types/TagId.html +7 -6
  217. package/docs/types/TopviewFloorplanPluginParameterType.html +7 -6
  218. package/docs/types/TopviewFloorplanPluginReturnType.html +7 -6
  219. package/docs/variables/FLOOR_TYPE_MAP.html +7 -6
  220. package/docs/variables/PLUGIN.html +7 -6
  221. package/docs/variables/ROOM_FETILE_TYPE_MAP.html +7 -6
  222. package/docs/variables/ROOM_TYPE_MAP.html +7 -6
  223. package/docs/variables/VERSION.html +7 -6
  224. package/docs/variables/itemLabelPluginServerParams.html +7 -6
  225. package/docs/variables/modelItemLabelPluginServerParams.html +7 -6
  226. package/docs/variables/modelRoomLabelPluginServerParams.html +7 -6
  227. package/libs/CSS3DRenderPlugin/CSS3DRender.d.ts +48 -34
  228. package/libs/CSS3DRenderPlugin/CSS3DRender.js +197 -256
  229. package/libs/CSS3DRenderPlugin/Controller.d.ts +5 -5
  230. package/libs/CSS3DRenderPlugin/Controller.js +59 -62
  231. package/libs/CSS3DRenderPlugin/index.d.ts +2 -1
  232. package/libs/CSS3DRenderPlugin/index.js +17 -8
  233. package/libs/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +4 -0
  234. package/libs/CSS3DRenderPlugin/utils/createResizeObserver.js +22 -0
  235. package/libs/CSS3DRenderPlugin/utils/even.d.ts +9 -0
  236. package/libs/CSS3DRenderPlugin/utils/even.js +7 -0
  237. package/libs/CSS3DRenderPlugin/utils/generateBehindFiveElement.d.ts +2 -0
  238. package/libs/CSS3DRenderPlugin/utils/generateBehindFiveElement.js +29 -0
  239. package/libs/CSS3DRenderPlugin/utils/getAllCSS3DObject.d.ts +3 -0
  240. package/libs/CSS3DRenderPlugin/utils/getAllCSS3DObject.js +9 -0
  241. package/libs/CSS3DRenderPlugin/utils/index.d.ts +1 -1
  242. package/libs/CSS3DRenderPlugin/utils/three/CSS3DGroup.d.ts +25 -0
  243. package/libs/CSS3DRenderPlugin/utils/three/CSS3DGroup.js +53 -0
  244. package/libs/CSS3DRenderPlugin/utils/{CSS3DObjectPlus.d.ts → three/CSS3DObject.d.ts} +31 -11
  245. package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +115 -0
  246. package/libs/CSS3DRenderPlugin/utils/three/CSS3DRenderer.d.ts +14 -0
  247. package/libs/CSS3DRenderPlugin/utils/three/CSS3DRenderer.js +46 -0
  248. package/libs/CSS3DRenderPlugin/utils/three/CSS3DScene.d.ts +12 -0
  249. package/libs/CSS3DRenderPlugin/utils/three/CSS3DScene.js +39 -0
  250. package/libs/CSS3DRenderPlugin/utils/three/OpacityMesh.d.ts +6 -0
  251. package/libs/CSS3DRenderPlugin/utils/three/OpacityMesh.js +18 -0
  252. package/libs/CSS3DRenderPlugin/utils/waitFiveModelLoaded.d.ts +2 -0
  253. package/libs/CSS3DRenderPlugin/utils/waitFiveModelLoaded.js +31 -0
  254. package/libs/CruisePlugin/Controller.js +16 -16
  255. package/libs/ModelTVVideoPlugin/Plugin.js +60 -52
  256. package/libs/ModelTVVideoPlugin/index.js +15 -7
  257. package/libs/Object3DHelperPlugin/Controller.d.ts +2 -0
  258. package/libs/Object3DHelperPlugin/Controller.js +103 -83
  259. package/libs/Object3DHelperPlugin/index.js +20 -12
  260. package/libs/PanoCompassPlugin/Controller.js +49 -41
  261. package/libs/PanoCompassPlugin/index.js +13 -5
  262. package/libs/PanoSpatialTagPlugin/Plugin.js +46 -38
  263. package/libs/PanoSpatialTagPlugin/index.js +13 -5
  264. package/libs/PanoTagPlugin/index.js +21 -13
  265. package/libs/index.js +102 -93
  266. package/libs/shared-utils/Object3DHelper/Base/BaseController.js +1 -1
  267. package/libs/shared-utils/Object3DHelper/Helper/MoveHelper.js +8 -7
  268. package/libs/shared-utils/Object3DHelper/Helper/RectangleScaleHelper.d.ts +2 -2
  269. package/libs/shared-utils/Object3DHelper/Helper/index.js +1 -0
  270. package/libs/shared-utils/three/index.js +2 -1
  271. package/package.json +15 -14
  272. package/dist/CSS3DRenderPlugin/utils/evenNumber.d.ts +0 -3
  273. package/libs/CSS3DRenderPlugin/utils/CSS3DObjectPlus.js +0 -66
  274. package/libs/CSS3DRenderPlugin/utils/evenNumber.d.ts +0 -3
  275. package/libs/CSS3DRenderPlugin/utils/evenNumber.js +0 -7
@@ -1,61 +1,73 @@
1
- var y = Object.defineProperty, F = Object.defineProperties;
2
- var P = Object.getOwnPropertyDescriptors;
3
- var R = Object.getOwnPropertySymbols;
4
- var S = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable;
5
- var c = (s, i, e) => i in s ? y(s, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[i] = e, p = (s, i) => {
6
- for (var e in i || (i = {}))
7
- S.call(i, e) && c(s, e, i[e]);
8
- if (R)
9
- for (var e of R(i))
10
- D.call(i, e) && c(s, e, i[e]);
11
- return s;
12
- }, h = (s, i) => F(s, P(i));
13
- var l = (s, i, e) => (c(s, typeof i != "symbol" ? i + "" : i, e), e);
14
- import { CSS3DRender as w } from "./CSS3DRender.js";
15
- import "three";
1
+ var C = Object.defineProperty, E = Object.defineProperties;
2
+ var F = Object.getOwnPropertyDescriptors;
3
+ var b = Object.getOwnPropertySymbols;
4
+ var R = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable;
5
+ var m = (r, t, e) => t in r ? C(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e, p = (r, t) => {
6
+ for (var e in t || (t = {}))
7
+ R.call(t, e) && m(r, e, t[e]);
8
+ if (b)
9
+ for (var e of b(t))
10
+ D.call(t, e) && m(r, e, t[e]);
11
+ return r;
12
+ }, l = (r, t) => E(r, F(t));
13
+ var d = (r, t, e) => (m(r, typeof t != "symbol" ? t + "" : t, e), e);
14
+ import { CSS3DRender as S } from "./CSS3DRender.js";
15
+ import { fiveModelLoaded as $ } from "./utils/waitFiveModelLoaded.js";
16
+ import { generateBehindFiveElement as j } from "./utils/generateBehindFiveElement.js";
17
+ import "./utils/three/CSS3DRenderer.js";
16
18
  import "three/examples/jsm/renderers/CSS3DRenderer";
19
+ import "./utils/getAllCSS3DObject.js";
20
+ import "./utils/createResizeObserver.js";
21
+ import "./utils/even.js";
17
22
  import "../shared-utils/Subscribe.js";
18
- import "./utils/evenNumber.js";
23
+ import "three";
19
24
  import "./utils/positionToVector3.js";
20
- import "./utils/CSS3DObjectPlus.js";
25
+ import "./utils/three/CSS3DObject.js";
21
26
  import "./utils/centerPoint.js";
22
- const x = "v2.0.1", C = `CSS3DRenderPlugin@${x}`;
23
- class M extends w {
27
+ import "./utils/three/OpacityMesh.js";
28
+ import "./utils/three/CSS3DScene.js";
29
+ import "./utils/three/CSS3DGroup.js";
30
+ const x = "v2.0.1", v = `CSS3DRenderPlugin@${x}`;
31
+ class z extends S {
24
32
  constructor(e) {
25
33
  super();
26
- l(this, "five");
27
- l(this, "behindFiveContainer");
28
- l(this, "staticPrefix", "//vrlab-static.ljcdn.com");
29
- l(this, "create3DDomContainer", (e, t) => {
34
+ d(this, "five");
35
+ d(this, "behindFiveContainer");
36
+ d(this, "staticPrefix", "//vrlab-static.ljcdn.com");
37
+ d(this, "create3DDomContainer", (e, i) => {
30
38
  if (this.state.disposed)
31
39
  return;
32
- const n = (() => {
33
- var E;
34
- (t == null ? void 0 : t.dpr) !== void 0 && console.warn(`${C}: please use "config.devicePixelRatio" replace "config.dpr"`);
35
- const a = {
40
+ const o = (() => {
41
+ var f;
42
+ (i == null ? void 0 : i.dpr) !== void 0 && console.warn(`${v}: please use "config.devicePixelRatio" replace "config.dpr"`);
43
+ const s = {
36
44
  ratio: 216e-5,
37
- devicePixelRatio: (E = t == null ? void 0 : t.dpr) != null ? E : 1,
45
+ devicePixelRatio: (f = i == null ? void 0 : i.dpr) != null ? f : 1,
38
46
  mode: "front",
39
47
  autoRender: !0
40
48
  };
41
- return Object.assign(a, t, (t == null ? void 0 : t.mode) === "behind" ? { scene: this.five.scene } : void 0);
42
- })(), o = this.five.getElement();
43
- if (!o) {
44
- console.error(`${C}: five.getElement() is ${o}`);
49
+ return Object.assign(s, i, (i == null ? void 0 : i.mode) === "behind" ? { scene: this.five.scene } : void 0);
50
+ })(), a = this.five.getElement();
51
+ if (!a) {
52
+ console.error(`${v}: five.getElement() is ${a}`);
45
53
  return;
46
54
  }
47
- const { autoRender: d, mode: r } = n, v = r === "front" ? o.parentElement : n.behindFiveContainer;
48
- this.setContainer(v || document.body, "front");
49
- const f = this.getBehindFiveElement();
50
- f && this.setContainer(f, "behind"), this.appendToElement(v || document.body, r);
51
- const m = this.create3DElement(this.five.camera, e, h(p({}, n), { autoRender: !1 }));
52
- if (!m)
55
+ const { autoRender: h } = o;
56
+ o.mode === "behind" && o.behindFiveContainer && (this.behindFiveContainer = o.behindFiveContainer);
57
+ const n = this.create3DElement(this.five.camera, e, l(p({}, o), { autoRender: !1 }));
58
+ if (!n)
53
59
  return;
54
- const u = m.render, b = () => {
55
- var a;
56
- r === "front" && u(), r === "behind" && ((a = this.five.model) != null && a.loaded ? u() : this.five.once("modelLoaded", () => u()));
60
+ const c = () => {
61
+ const s = n.css3DObject.mode === "front" ? a.parentElement : this.getBehindFiveElement();
62
+ if (!s)
63
+ return console.error(`${v}: wrapper is ${s}`);
64
+ n.appendToElement(s), n.render();
65
+ }, u = () => {
66
+ n.css3DObject.mode === "front" && c(), n.css3DObject.mode === "behind" && $(this.five).then(() => {
67
+ c();
68
+ });
57
69
  };
58
- return d && b(), h(p({}, m), { render: d ? void 0 : b });
70
+ return h && u(), l(p({}, n), { render: h ? void 0 : u });
59
71
  });
60
72
  this.five = e;
61
73
  }
@@ -63,29 +75,14 @@ class M extends w {
63
75
  return this.dispose();
64
76
  }
65
77
  setState(...e) {
66
- const t = super.setState(...e);
67
- return this.five.needsRender = !0, t;
78
+ const i = super.setState(...e);
79
+ return this.five.needsRender = !0, i;
68
80
  }
69
81
  getBehindFiveElement() {
70
- var r;
71
- const { behindFiveContainer: e } = this;
72
- if (e)
73
- return e;
74
- const t = document.createElement("div");
75
- t.style.position = "absolute", t.style.pointerEvents = "none", t.style.top = "0", t.style.left = "0", t.style.width = "100%", t.style.height = "100%", this.behindFiveContainer = t;
76
- const n = this.five.getElement();
77
- if (!n)
78
- return;
79
- const o = (r = n == null ? void 0 : n.style.position) != null ? r : getComputedStyle(n);
80
- (!o || o === "static") && console.warn(
81
- "if you want to use css3DRenderPlugin behind mode, five element position is static, please set position to relative or absolute"
82
- );
83
- const d = n == null ? void 0 : n.parentElement;
84
- if (d)
85
- return d.insertBefore(t, n), t;
82
+ return this.behindFiveContainer ? this.behindFiveContainer : (this.behindFiveContainer = j(this.five), this.behindFiveContainer);
86
83
  }
87
84
  }
88
85
  export {
89
- C as PLUGIN_NAME,
90
- M as default
86
+ v as PLUGIN_NAME,
87
+ z as default
91
88
  };
@@ -1,5 +1,6 @@
1
1
  import type { FivePlugin } from '@realsee/five';
2
2
  import Controller from './Controller';
3
- export * from './typing';
4
3
  export declare const CSS3DRenderPlugin: FivePlugin<void, InstanceType<typeof Controller>>;
4
+ export { CSS3DRender } from './CSS3DRender';
5
+ export * from './typing';
5
6
  export default CSS3DRenderPlugin;
@@ -1,14 +1,23 @@
1
- import r from "./Controller.js";
2
- import "./CSS3DRender.js";
3
- import "three";
1
+ import o from "./Controller.js";
2
+ import { CSS3DRender as w } from "./CSS3DRender.js";
3
+ import "./utils/waitFiveModelLoaded.js";
4
+ import "./utils/generateBehindFiveElement.js";
5
+ import "./utils/three/CSS3DRenderer.js";
4
6
  import "three/examples/jsm/renderers/CSS3DRenderer";
7
+ import "./utils/getAllCSS3DObject.js";
8
+ import "./utils/createResizeObserver.js";
9
+ import "./utils/even.js";
5
10
  import "../shared-utils/Subscribe.js";
6
- import "./utils/evenNumber.js";
11
+ import "three";
7
12
  import "./utils/positionToVector3.js";
8
- import "./utils/CSS3DObjectPlus.js";
13
+ import "./utils/three/CSS3DObject.js";
9
14
  import "./utils/centerPoint.js";
10
- const f = (o) => new r(o);
15
+ import "./utils/three/OpacityMesh.js";
16
+ import "./utils/three/CSS3DScene.js";
17
+ import "./utils/three/CSS3DGroup.js";
18
+ const R = (r) => new o(r);
11
19
  export {
12
- f as CSS3DRenderPlugin,
13
- f as default
20
+ w as CSS3DRender,
21
+ R as CSS3DRenderPlugin,
22
+ R as default
14
23
  };
@@ -0,0 +1,4 @@
1
+ export default function createResizeObserver(element: Element, resizeHandler: (width: number, height: number) => any, fireImmediately?: boolean): {
2
+ observe: () => void;
3
+ unobserve: () => void;
4
+ };
@@ -0,0 +1,22 @@
1
+ import { even as o } from "./even.js";
2
+ function u(e, i, n = !0) {
3
+ if (!e)
4
+ return console.error("createResizeObserver: element is undefined"), { observe: () => {
5
+ }, unobserve: () => {
6
+ } };
7
+ const r = () => {
8
+ const t = o(e.clientWidth, { floor: !0 }), v = o(e.clientHeight, { floor: !0 });
9
+ i(t, v);
10
+ };
11
+ if (typeof ResizeObserver == "undefined" || !ResizeObserver)
12
+ return console.warn("createResizeObserver: ResizeObserver is undefined"), { observe: () => r(), unobserve: () => {
13
+ } };
14
+ const s = new ResizeObserver(r);
15
+ return n && r(), {
16
+ observe: () => s.observe(e),
17
+ unobserve: () => s.unobserve(e)
18
+ };
19
+ }
20
+ export {
21
+ u as createResizeObserver
22
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @description: 获取一个数字的最近的偶数
3
+ * @param { number } num
4
+ * @param { boolean } config.floor 是否取较小的偶数,默认为false,即取较大的偶数
5
+ * @return { number } 返回一个偶数
6
+ */
7
+ export declare function even(num: number, config?: {
8
+ floor?: boolean;
9
+ }): number;
@@ -0,0 +1,7 @@
1
+ function t(e, r) {
2
+ const u = Math.round(e);
3
+ return u % 2 === 0 ? u : u + Number(r != null && r.floor ? -1 : 1);
4
+ }
5
+ export {
6
+ t as even
7
+ };
@@ -0,0 +1,2 @@
1
+ import type { Five } from '@realsee/five';
2
+ export default function generateBehindFiveElement(five: Five): HTMLDivElement;
@@ -0,0 +1,29 @@
1
+ const n = document.createElement("div");
2
+ n.style.position = "absolute";
3
+ n.style.top = "0";
4
+ n.style.left = "0";
5
+ n.style.width = "100%";
6
+ n.style.height = "100%";
7
+ function s(t) {
8
+ var o, r;
9
+ const e = (r = l(t.getElement())) != null ? r : l((o = t.getElement()) == null ? void 0 : o.parentElement);
10
+ if (e != null && e.parentElement)
11
+ return e.parentElement.insertBefore(n, e), n;
12
+ console.error(
13
+ "Can not find a valid element to insert behindFiveElement. How to fix it: https://github.com/realsee-developer/dnalogel/blob/main/plugins/src/PanoTagPlugin/README.md"
14
+ );
15
+ }
16
+ function l(t) {
17
+ var i;
18
+ if (!t)
19
+ return;
20
+ const e = (i = t.style.position) != null ? i : getComputedStyle(t).position;
21
+ if (e !== "fixed" && e !== "absolute" && e !== "relative")
22
+ return;
23
+ const o = getComputedStyle(t).backgroundColor;
24
+ if (!(o !== "transparent" && o !== "rgba(0, 0, 0, 0)"))
25
+ return t;
26
+ }
27
+ export {
28
+ s as generateBehindFiveElement
29
+ };
@@ -0,0 +1,3 @@
1
+ import type { Object3D } from 'three';
2
+ import type { CSS3DObjectPlus } from './three/CSS3DObject';
3
+ export default function getAllCSS3DObject(...object: Object3D[]): CSS3DObjectPlus<HTMLElement>[];
@@ -0,0 +1,9 @@
1
+ function l(...c) {
2
+ const s = [];
3
+ return c.forEach((e) => {
4
+ e.isCSS3DObjectPlus ? s.push(e) : s.push(...l(...e.children));
5
+ }), s;
6
+ }
7
+ export {
8
+ l as getAllCSS3DObject
9
+ };
@@ -1,4 +1,4 @@
1
1
  export * from './centerPoint';
2
- export * from './evenNumber';
2
+ export * from './even';
3
3
  export * from './random';
4
4
  export * from './positionToVector3';
@@ -0,0 +1,25 @@
1
+ import * as THREE from 'three';
2
+ import { Subscribe } from '../../../shared-utils/Subscribe';
3
+ import type { Object3D } from 'three';
4
+ import type { Mode } from './CSS3DObject';
5
+ export declare class CSS3DGroup extends THREE.Group {
6
+ readonly isCSS3DGroup = true;
7
+ mode: Mode;
8
+ CSS3DObjectLength: number;
9
+ hooks: Subscribe<{
10
+ visibleChange: (visible: boolean) => void;
11
+ }>;
12
+ constructor(mode: Mode);
13
+ add(...objects: Object3D[]): this;
14
+ setVisible(visible: boolean): void;
15
+ remove(...objects: Object3D[]): this;
16
+ private updateLength;
17
+ }
18
+ export declare class CSS3DFrontGroup extends CSS3DGroup {
19
+ constructor();
20
+ }
21
+ export declare class CSS3DBehindGroup extends CSS3DGroup {
22
+ private scene;
23
+ constructor(scene: THREE.Scene);
24
+ add(...objects: Object3D[]): this;
25
+ }
@@ -0,0 +1,53 @@
1
+ var n = Object.defineProperty;
2
+ var d = (r, t, e) => t in r ? n(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var s = (r, t, e) => (d(r, typeof t != "symbol" ? t + "" : t, e), e);
4
+ import * as u from "three";
5
+ import { Subscribe as p } from "../../../shared-utils/Subscribe.js";
6
+ import { getAllCSS3DObject as i } from "../getAllCSS3DObject.js";
7
+ class h extends u.Group {
8
+ constructor(e) {
9
+ super();
10
+ s(this, "isCSS3DGroup", !0);
11
+ s(this, "mode");
12
+ s(this, "CSS3DObjectLength", 0);
13
+ s(this, "hooks", new p());
14
+ this.mode = e;
15
+ }
16
+ add(...e) {
17
+ return i(...e).forEach((o) => {
18
+ o.mode = this.mode;
19
+ }), super.add(...e), this.updateLength(), this;
20
+ }
21
+ setVisible(e) {
22
+ this.visible = e, this.hooks.emit("visibleChange", e);
23
+ }
24
+ remove(...e) {
25
+ return super.remove(...e), this.updateLength(), this;
26
+ }
27
+ updateLength() {
28
+ this.CSS3DObjectLength = i(this).length;
29
+ }
30
+ }
31
+ class m extends h {
32
+ constructor() {
33
+ super("front");
34
+ }
35
+ }
36
+ class g extends h {
37
+ constructor(e) {
38
+ super("behind");
39
+ s(this, "scene");
40
+ if (!e)
41
+ throw new Error("CSS3DBehindScene: scene is required");
42
+ this.scene = e;
43
+ }
44
+ add(...e) {
45
+ return i(...e).forEach((o) => {
46
+ this.scene.add(o.getOpacityMesh());
47
+ }), super.add(...e), this;
48
+ }
49
+ }
50
+ export {
51
+ g as CSS3DBehindGroup,
52
+ m as CSS3DFrontGroup
53
+ };
@@ -1,7 +1,7 @@
1
1
  import { CSS3DObject } from 'three/examples/jsm/renderers/CSS3DRenderer';
2
2
  import { Matrix4, Quaternion, Vector3 } from 'three';
3
- import { Subscribe } from '../../shared-utils/Subscribe';
4
- import type * as THREE from 'three';
3
+ import { Subscribe } from '../../../shared-utils/Subscribe';
4
+ import OpacityMesh from './OpacityMesh';
5
5
  export declare const MinRatio = 0.00216;
6
6
  export declare const DefaultRatio = 0.003;
7
7
  export declare type Mode = 'front' | 'behind';
@@ -10,25 +10,45 @@ export declare type CSS3DRenderEventMap = {
10
10
  applyMatrix4: (matrix: Matrix4) => void;
11
11
  applyQuaternion: (quaternion: Quaternion) => void;
12
12
  applyScaleMatrix4: (matrix: Matrix4) => void;
13
- changeMode: <T extends Mode = Mode>(mode: T, prevMode: Mode, scene: T extends 'behind' ? THREE.Scene : undefined) => void;
14
13
  };
15
14
  export declare class CSS3DObjectPlus<T extends HTMLElement = HTMLElement> extends CSS3DObject {
16
- version: string;
15
+ version: number;
16
+ readonly isCSS3DObjectPlus: true;
17
+ container: T;
17
18
  width: number;
18
19
  height: number;
19
20
  domWidthPx: number;
20
21
  domHeightPx: number;
21
22
  cornerPoints: CornerPoints;
22
- ratio: number;
23
- container: T;
24
23
  centerPosition: Vector3;
24
+ ratio: number;
25
25
  mode: 'front' | 'behind';
26
26
  readonly hooks: Subscribe<CSS3DRenderEventMap>;
27
- readonly isCSS3DObjectPlus: true;
28
- constructor(container: T, cornerPoints: CornerPoints, ratio?: number, dpr?: number, mode?: Mode);
29
- changeMode(mode: 'front'): void;
30
- changeMode(mode: 'behind', scene: THREE.Scene): void;
31
- applyScaleMatrix4(matrix: Matrix4): void;
27
+ opacityMesh?: OpacityMesh;
28
+ private selfVisible;
29
+ private parentVisibleListenerDisposer?;
30
+ constructor(params: {
31
+ container: T;
32
+ mode?: 'front' | 'behind';
33
+ cornerPoints: CornerPoints;
34
+ ratio?: number;
35
+ dpr?: number;
36
+ pointerEvents?: 'none' | 'auto';
37
+ });
38
+ setVisible(visible: boolean, params?: {
39
+ setSelfVisible: boolean;
40
+ }): void;
41
+ removeFromParent(): this;
42
+ removeOpacityMesh(): this;
43
+ dispose(): void;
44
+ getOpacityMesh(): OpacityMesh;
32
45
  applyMatrix4(matrix: Matrix4): void;
33
46
  applyQuaternion(quaternion: Quaternion): this;
47
+ applyScaleMatrix4(matrix: Matrix4): void;
48
+ /**
49
+ * @description: 生成透明Mesh
50
+ */
51
+ private createOpacityMesh;
52
+ private addParentVisibleListener;
53
+ private removeParentVisibleListener;
34
54
  }
@@ -0,0 +1,115 @@
1
+ var $ = Object.defineProperty;
2
+ var D = (a, r, t) => r in a ? $(a, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[r] = t;
3
+ var i = (a, r, t) => (D(a, typeof r != "symbol" ? r + "" : r, t), t);
4
+ import { CSS3DObject as F } from "three/examples/jsm/renderers/CSS3DRenderer";
5
+ import { Vector3 as l } from "three";
6
+ import { even as S } from "../even.js";
7
+ import { centerPoint as W } from "../centerPoint.js";
8
+ import { Subscribe as H } from "../../../shared-utils/Subscribe.js";
9
+ import { OpecityMesh as k } from "./OpacityMesh.js";
10
+ const w = 1, A = `CSS3DObjectPlus@${w}`, Q = 216e-5, R = 3e-3;
11
+ class U extends F {
12
+ constructor(t) {
13
+ var v, x, V;
14
+ const e = t.container, s = t.cornerPoints, n = (v = t.ratio) != null ? v : R, P = (x = t.dpr) != null ? x : 1, E = (V = t.pointerEvents) != null ? V : "auto", h = Math.max(Q, n), d = s[0].distanceTo(s[1]), m = s[1].distanceTo(s[2]), c = S(d / n * P), p = S(m / n * P), y = W(...s);
15
+ let u;
16
+ if (h === n)
17
+ e.style.width = `${c}px`, e.style.height = `${p}px`, u = e;
18
+ else {
19
+ const o = document.createElement("div");
20
+ o.style.width = `${c}px`, o.style.height = `${p}px`, o.style.pointerEvents = "none";
21
+ const g = n / h;
22
+ e.style.position = "absolute", e.style.left = "0", e.style.top = "0", e.style.width = `${g * c}px`, e.style.height = `${g * p}px`, o.appendChild(e), u = o;
23
+ }
24
+ super(u);
25
+ i(this, "version", w);
26
+ i(this, "isCSS3DObjectPlus", !0);
27
+ i(this, "container");
28
+ i(this, "width");
29
+ i(this, "height");
30
+ i(this, "domWidthPx");
31
+ i(this, "domHeightPx");
32
+ i(this, "cornerPoints");
33
+ i(this, "centerPosition");
34
+ i(this, "ratio");
35
+ i(this, "mode", "front");
36
+ i(this, "hooks", new H());
37
+ i(this, "opacityMesh");
38
+ i(this, "selfVisible", !0);
39
+ i(this, "parentVisibleListenerDisposer");
40
+ i(this, "createOpacityMesh", (t) => {
41
+ const { domWidthPx: e, domHeightPx: s } = t, n = new k(e, s);
42
+ return n.position.copy(t.position), n.rotation.copy(t.rotation), n.scale.copy(t.scale), n;
43
+ });
44
+ i(this, "addParentVisibleListener", () => {
45
+ var t;
46
+ if ((t = this.parent) != null && t.isCSS3DGroup) {
47
+ const e = this.parent, s = (n) => {
48
+ this.setVisible(n && this.selfVisible, { setSelfVisible: !1 });
49
+ };
50
+ e.hooks.on("visibleChange", s), this.parentVisibleListenerDisposer = () => e.hooks.off("visibleChange", s);
51
+ }
52
+ });
53
+ i(this, "removeParentVisibleListener", () => {
54
+ var t;
55
+ (t = this.parentVisibleListenerDisposer) == null || t.call(this);
56
+ });
57
+ if (e.style.pointerEvents = E, this.scale.set(h, h, h), this.cornerPoints = s, this.ratio = n, this.container = e, t.mode && (this.mode = t.mode), h === n)
58
+ this.width = d, this.height = m, this.domWidthPx = c, this.domHeightPx = p, this.centerPosition = y;
59
+ else {
60
+ const o = n / h;
61
+ this.width = o * d, this.height = o * m, this.domWidthPx = o * c, this.domHeightPx = o * p, this.centerPosition = new l().subVectors(y, s[0]).multiplyScalar(o).add(s[0]);
62
+ }
63
+ e.classList.add(`${A}__container`);
64
+ const L = new l().subVectors(s[1], s[0]), M = new l().subVectors(s[3], s[0]), O = new l().crossVectors(L, M).normalize();
65
+ this.lookAt(O);
66
+ const f = this.up.clone().applyQuaternion(this.quaternion), b = M.clone(), C = new l().crossVectors(f, b).normalize();
67
+ this.rotateOnWorldAxis(C, f.angleTo(b)), this.position.copy(y), this.addEventListener("added", () => {
68
+ var o;
69
+ this.mode === "front" && ((o = this.opacityMesh) == null || o.removeFromParent()), this.addParentVisibleListener();
70
+ }), this.addEventListener("removed", () => {
71
+ var o;
72
+ (o = this.opacityMesh) == null || o.removeFromParent(), this.removeParentVisibleListener();
73
+ });
74
+ }
75
+ setVisible(t, e = { setSelfVisible: !0 }) {
76
+ e.setSelfVisible && (this.selfVisible = t), this.visible = t, this.opacityMesh && (this.opacityMesh.visible = t);
77
+ }
78
+ removeFromParent() {
79
+ var e;
80
+ const t = this.parent;
81
+ return t !== null && t.remove(this), (e = this.opacityMesh) == null || e.removeFromParent(), this;
82
+ }
83
+ removeOpacityMesh() {
84
+ var t;
85
+ return (t = this.opacityMesh) == null || t.removeFromParent(), this.opacityMesh = void 0, this;
86
+ }
87
+ dispose() {
88
+ var t;
89
+ this.container.remove(), this.removeFromParent(), (t = this.opacityMesh) == null || t.removeFromParent();
90
+ }
91
+ getOpacityMesh() {
92
+ if (this.opacityMesh)
93
+ return this.opacityMesh;
94
+ {
95
+ const t = this.createOpacityMesh(this);
96
+ return this.opacityMesh = t, t;
97
+ }
98
+ }
99
+ applyMatrix4(t) {
100
+ var e;
101
+ super.applyMatrix4(t), (e = this.opacityMesh) == null || e.applyMatrix4(t);
102
+ }
103
+ applyQuaternion(t) {
104
+ var e;
105
+ return super.applyQuaternion(t), (e = this.opacityMesh) == null || e.applyQuaternion(t), this;
106
+ }
107
+ applyScaleMatrix4(t) {
108
+ var e;
109
+ this.scale.applyMatrix4(t), (e = this.opacityMesh) == null || e.scale.applyMatrix4(t);
110
+ }
111
+ }
112
+ export {
113
+ U as CSS3DObjectPlus,
114
+ Q as MinRatio
115
+ };
@@ -0,0 +1,14 @@
1
+ import { CSS3DRenderer } from 'three/examples/jsm/renderers/CSS3DRenderer';
2
+ import type * as THREE from 'three';
3
+ export default class ICSS3DRenderer extends CSS3DRenderer {
4
+ wrapper?: HTMLElement;
5
+ private requestAnimationFrameId?;
6
+ private resizeDisoper?;
7
+ constructor();
8
+ setWrapper(wrapper: HTMLElement): this;
9
+ appendToElement(wrapper: HTMLElement): void;
10
+ renderEveryFrame(scene: THREE.Scene, camera: THREE.Camera): void;
11
+ stopRender(): void;
12
+ dispose(): void;
13
+ }
14
+ export { ICSS3DRenderer };
@@ -0,0 +1,46 @@
1
+ var d = Object.defineProperty;
2
+ var l = (r, t, e) => t in r ? d(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var s = (r, t, e) => (l(r, typeof t != "symbol" ? t + "" : t, e), e);
4
+ import { CSS3DRenderer as p } from "three/examples/jsm/renderers/CSS3DRenderer";
5
+ import { getAllCSS3DObject as h } from "../getAllCSS3DObject.js";
6
+ import { createResizeObserver as u } from "../createResizeObserver.js";
7
+ class v extends p {
8
+ constructor() {
9
+ super();
10
+ s(this, "wrapper");
11
+ s(this, "requestAnimationFrameId");
12
+ s(this, "resizeDisoper");
13
+ this.domElement.style.position = "absolute", this.domElement.style.top = "0", this.domElement.style.left = "0", this.domElement.style.userSelect = "none", this.domElement.style.pointerEvents = "none";
14
+ }
15
+ setWrapper(e) {
16
+ if (!e)
17
+ throw new Error("CSS3DRenderer: wrapper is required");
18
+ if (e.contains(this.domElement))
19
+ return;
20
+ const i = this.wrapper;
21
+ return i && i.contains(this.domElement) && this.domElement.remove(), this.appendToElement(e), this.wrapper = e, this;
22
+ }
23
+ appendToElement(e) {
24
+ e.appendChild(this.domElement);
25
+ const i = (m, a) => this.setSize(m, a), { observe: n, unobserve: o } = u(e, i, !0);
26
+ n(), this.resizeDisoper = o, this.wrapper = e;
27
+ }
28
+ renderEveryFrame(e, i) {
29
+ if (this.wrapper || console.warn("wrapper is not find, creating a html element and call setWrapper(wrapper)", this, e), this.requestAnimationFrameId)
30
+ return console.warn("CSS3DRenderer: render is running");
31
+ const n = () => {
32
+ this.requestAnimationFrameId = requestAnimationFrame(n), !!e.visible && h(e).length !== 0 && this.render(e, i);
33
+ };
34
+ n();
35
+ }
36
+ stopRender() {
37
+ this.requestAnimationFrameId && cancelAnimationFrame(this.requestAnimationFrameId);
38
+ }
39
+ dispose() {
40
+ var e;
41
+ this.stopRender(), (e = this.resizeDisoper) == null || e.call(this), this.domElement.remove();
42
+ }
43
+ }
44
+ export {
45
+ v as ICSS3DRenderer
46
+ };
@@ -0,0 +1,12 @@
1
+ import type { Object3D } from 'three';
2
+ import * as THREE from 'three';
3
+ export declare class CSS3DFrontScene extends THREE.Scene {
4
+ constructor();
5
+ add(...objects: Object3D[]): this;
6
+ }
7
+ export declare class CSS3DBehindScene extends THREE.Scene {
8
+ private scene;
9
+ constructor(scene: THREE.Scene);
10
+ add(...objects: Object3D[]): this;
11
+ remove(...objects: Object3D[]): this;
12
+ }