@realsee/dnalogel 2.0.0-alpha.16 → 2.0.0-alpha.19

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 (180) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/CSS3DRenderPlugin/index.d.ts +2 -2
  3. package/dist/CameraMovementPlugin/index.js +15 -40
  4. package/dist/CameraMovementPlugin/typing.d.ts +1 -1
  5. package/dist/ModelChassisCompassPlugin/index.js +3 -28
  6. package/dist/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
  7. package/dist/ModelEntryDoorGuidePlugin/index.js +8 -33
  8. package/dist/ModelItemLabelPlugin/events.type.d.ts +2 -2
  9. package/dist/ModelItemLabelPlugin/index.js +8 -8
  10. package/dist/ModelItemLabelPlugin/typings.d.ts +2 -2
  11. package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
  12. package/dist/ModelRoomLabelPlugin/index.js +6 -6
  13. package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  14. package/dist/ModelTVVideoPlugin/index.d.ts +1 -1
  15. package/dist/ModelTVVideoPlugin/index.js +3 -28
  16. package/dist/PanoCompassPlugin/index.js +53 -86
  17. package/dist/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  18. package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
  19. package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  20. package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  21. package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
  22. package/dist/PanoMeasurePlugin/Controller/index.d.ts +3 -3
  23. package/dist/PanoMeasurePlugin/Model/index.d.ts +2 -2
  24. package/dist/PanoMeasurePlugin/Model/line.d.ts +5 -5
  25. package/dist/PanoMeasurePlugin/Model/point.d.ts +2 -2
  26. package/dist/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  27. package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
  28. package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  29. package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  30. package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
  31. package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  32. package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  33. package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
  34. package/dist/PanoMeasurePlugin/index.d.ts +1 -1
  35. package/dist/PanoMeasurePlugin/index.js +1 -21
  36. package/dist/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
  37. package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  38. package/dist/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  39. package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  40. package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  41. package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  42. package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  43. package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  44. package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  45. package/dist/PanoMeasurePlugin/utils/line.d.ts +1 -1
  46. package/dist/PanoRulerPlugin/index.d.ts +1 -1
  47. package/dist/PanoRulerPlugin/index.js +3 -28
  48. package/dist/PanoSpatialTagPlugin/index.js +11 -11
  49. package/dist/PanoSpatialTagPlugin/typings.d.ts +1 -1
  50. package/dist/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  51. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
  52. package/dist/floorplan/ModelFloorplanPlugin/index.js +1266 -1298
  53. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +81 -204
  54. package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
  55. package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
  56. package/dist/floorplan/TopviewFloorplanPlugin/index.js +1257 -1250
  57. package/dist/floorplan/utils/formatPosition.d.ts +1 -1
  58. package/dist/index.es.js +1480 -1507
  59. package/dist/index.js +1477 -1504
  60. package/dist/index.umd.js +1477 -1504
  61. package/dist/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  62. package/dist/shared-utils/three/getNormal.d.ts +1 -1
  63. package/dist/shared-utils/three/getTextureLoader.d.ts +1 -1
  64. package/dist/shared-utils/three/loadFbxObj.d.ts +1 -1
  65. package/dist/shared-utils/vectorTocoordinates.d.ts +1 -1
  66. package/docs/assets/search.js +1 -1
  67. package/docs/classes/ModelRoomLabelController.html +6 -6
  68. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  69. package/docs/enums/ModelFloorplanErrorType.html +1 -1
  70. package/docs/interfaces/LineJson.html +1 -1
  71. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  72. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  73. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  74. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  75. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  76. package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
  77. package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
  78. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  79. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  80. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  81. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  82. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  83. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  84. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  85. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  86. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  87. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  88. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  89. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  90. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  91. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  92. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  93. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  94. package/docs/interfaces/PointJson.html +1 -1
  95. package/docs/interfaces/RoomLabel.html +7 -7
  96. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +19 -1
  97. package/docs/modules.html +12 -12
  98. package/libs/CSS3DRenderPlugin/index.d.ts +2 -2
  99. package/libs/CameraMovementPlugin/index.js +15 -24
  100. package/libs/CameraMovementPlugin/typing.d.ts +1 -1
  101. package/libs/ModelChassisCompassPlugin/index.js +3 -12
  102. package/libs/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
  103. package/libs/ModelEntryDoorGuidePlugin/index.js +8 -17
  104. package/libs/ModelItemLabelPlugin/events.type.d.ts +2 -2
  105. package/libs/ModelItemLabelPlugin/typings.d.ts +2 -2
  106. package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
  107. package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  108. package/libs/ModelTVVideoPlugin/index.d.ts +1 -1
  109. package/libs/ModelTVVideoPlugin/index.js +3 -12
  110. package/libs/ModelTVVideoPlugin/typings.js +1 -0
  111. package/libs/PanoCompassPlugin/index.js +49 -64
  112. package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  113. package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
  114. package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  115. package/libs/PanoMeasurePlugin/Controller/EditController.js +1 -1
  116. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  117. package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
  118. package/libs/PanoMeasurePlugin/Controller/index.d.ts +3 -3
  119. package/libs/PanoMeasurePlugin/Model/index.d.ts +2 -2
  120. package/libs/PanoMeasurePlugin/Model/line.d.ts +5 -5
  121. package/libs/PanoMeasurePlugin/Model/line.js +1 -1
  122. package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -2
  123. package/libs/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  124. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
  125. package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  126. package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  127. package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
  128. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  129. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  130. package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
  131. package/libs/PanoMeasurePlugin/index.d.ts +1 -1
  132. package/libs/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
  133. package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  134. package/libs/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  135. package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  136. package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  137. package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  138. package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  139. package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  140. package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  141. package/libs/PanoMeasurePlugin/utils/line.d.ts +1 -1
  142. package/libs/PanoMeasurePlugin/utils/mouseGroup.js +1 -0
  143. package/libs/PanoRulerPlugin/index.d.ts +1 -1
  144. package/libs/PanoRulerPlugin/index.js +3 -12
  145. package/libs/PanoSpatialTagPlugin/typings.d.ts +1 -1
  146. package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  147. package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.js +0 -0
  148. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Camera.js +2 -2
  149. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Compass.js +0 -0
  150. package/libs/floorplan/{ModelFloorplanPlugin/Components/CurrentFloor → Components}/CurrentFloor.js +73 -80
  151. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Main.js +186 -105
  152. package/libs/floorplan/Components/RoomHighlight/Room.js +5 -7
  153. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +24 -116
  154. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabel.js +0 -0
  155. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabels.js +2 -2
  156. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +26 -22
  157. package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
  158. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RuleLabels/RuleLabels.js +82 -32
  159. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
  160. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +34 -43
  161. package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +22 -33
  162. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +3 -12
  163. package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
  164. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +80 -54
  165. package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
  166. package/libs/floorplan/TopviewFloorplanPlugin/style.js +0 -1
  167. package/libs/floorplan/utils/formatData.js +28 -43
  168. package/libs/floorplan/utils/formatPosition.d.ts +1 -1
  169. package/libs/floorplan/utils/formatPosition.js +2 -2
  170. package/libs/shared-utils/five/changeMode.js +12 -23
  171. package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  172. package/libs/shared-utils/three/getNormal.d.ts +1 -1
  173. package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
  174. package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
  175. package/libs/shared-utils/three/loadFbxObj.js +9 -20
  176. package/libs/shared-utils/three/loadTexture.js +6 -17
  177. package/libs/shared-utils/to.js +10 -21
  178. package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
  179. package/package.json +3 -1
  180. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +0 -301
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2.0.0-alpha.19
4
+ - 1.fix: 修复在模型中切换全部楼层,切换回户型图,展示的是上一次展示时的楼层;
5
+ - 2.fix: 修复户型图界面切换楼层时,图片与SVG渲染有时间差导致闪烁的问题;
6
+ - 3.feat: TopviewFloorplanPlugin 插件支持放大缩小;
7
+ - 4.feat: ModelFloorplanPlugin 插件,autoShowEnable 和 hoverEnable 能同时支持;
8
+ - 5.chore: 设置 tsconfig.json importsNotUsedAsValues 为 error,在引用类型时,必须显示写为 import type。
9
+
10
+ ## 2.0.0-alpha.18
11
+ - 1.fix: 修复 PanoMeasurePlugin 使用时 hammerjs 报错问题。
12
+
13
+ ## 2.0.0-alpha.17
14
+ - 1.fix: 修复构建输出 px2rem 失效问题。
15
+
3
16
  ## 2.0.0-alpha.16
4
17
  - 1.fix: 修复 z-index 问题;
5
18
  - 2.fix: 修复 ModelItemLabelPlugin 事件监听问题。
@@ -1,7 +1,7 @@
1
- import { FivePlugin } from '@realsee/five';
1
+ import type { FivePlugin } from '@realsee/five';
2
+ import type { Vector3Position } from '../typings/math.type';
2
3
  import { Vector3 } from 'three';
3
4
  import { CSS3DObject } from 'three/examples/jsm/renderers/CSS3DRenderer';
4
- import { Vector3Position } from '../typings/math.type';
5
5
  export declare type CSS3DRenderPluginParameterType = undefined;
6
6
  export interface CSS3DRenderPluginExportType {
7
7
  /**
@@ -25,31 +25,6 @@ function _interopNamespace(e) {
25
25
 
26
26
  var TWEEN__namespace = /*#__PURE__*/_interopNamespace(TWEEN);
27
27
 
28
- /*! *****************************************************************************
29
- Copyright (c) Microsoft Corporation.
30
-
31
- Permission to use, copy, modify, and/or distribute this software for any
32
- purpose with or without fee is hereby granted.
33
-
34
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
35
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
36
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
37
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
38
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
39
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
40
- PERFORMANCE OF THIS SOFTWARE.
41
- ***************************************************************************** */
42
-
43
- function __awaiter(thisArg, _arguments, P, generator) {
44
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
45
- return new (P || (P = Promise))(function (resolve, reject) {
46
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
47
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
48
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
49
- step((generator = generator.apply(thisArg, _arguments || [])).next());
50
- });
51
- }
52
-
53
28
  const _requestAnimationFrame = window.requestAnimationFrame || ((fn) => setTimeout(fn, 16));
54
29
  const _cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;
55
30
  function nextFrame(fn, delay = 0) {
@@ -195,21 +170,21 @@ const getLongitudeParams = (from, to, rotation) => {
195
170
  */
196
171
  const CameraMovementPlugin = (five$1) => {
197
172
  const state = {};
198
- const move = (args, duration, opts = { preload: true }) => __awaiter(void 0, void 0, void 0, function* () {
173
+ const move = async (args, duration, opts = { preload: true }) => {
199
174
  if (state.interruptCallback) {
200
175
  state.interruptCallback(false);
201
176
  }
202
177
  if (opts.asyncStartCallback) {
203
- yield opts.asyncStartCallback();
178
+ await opts.asyncStartCallback();
204
179
  }
205
180
  if (args.mode && args.mode !== five$1.currentMode) {
206
- yield five$1.changeMode(args.mode);
181
+ await five$1.changeMode(args.mode);
207
182
  }
208
183
  if (opts.preload && args.panoIndex !== undefined && args.panoIndex !== five$1.panoIndex) {
209
- yield five$1.preloadPano(args.panoIndex);
184
+ await five$1.preloadPano(args.panoIndex);
210
185
  }
211
186
  if (opts.asyncEndCallback) {
212
- yield opts.asyncEndCallback();
187
+ await opts.asyncEndCallback();
213
188
  }
214
189
  if (args.panoIndex === undefined &&
215
190
  args.fov === undefined &&
@@ -217,7 +192,7 @@ const CameraMovementPlugin = (five$1) => {
217
192
  args.longitude === undefined) {
218
193
  return true;
219
194
  }
220
- return yield new Promise((resolve, reject) => {
195
+ return await new Promise((resolve, reject) => {
221
196
  const panoIndex = args.panoIndex !== undefined ? args.panoIndex : five$1.panoIndex;
222
197
  if (panoIndex !== undefined) {
223
198
  five$1.moveToPano(panoIndex, Object.assign({
@@ -230,7 +205,7 @@ const CameraMovementPlugin = (five$1) => {
230
205
  reject(false);
231
206
  }
232
207
  });
233
- });
208
+ };
234
209
  const getAnimeParams = (args) => {
235
210
  const currentFiveState = five$1.state;
236
211
  // latitude
@@ -246,20 +221,20 @@ const CameraMovementPlugin = (five$1) => {
246
221
  to: { latitude: toLatitude, longitude: toLongitude, fov: toFov },
247
222
  };
248
223
  };
249
- const rotate = (args, duration, opts = {}) => __awaiter(void 0, void 0, void 0, function* () {
224
+ const rotate = async (args, duration, opts = {}) => {
250
225
  if (state.interruptCallback) {
251
226
  state.interruptCallback(false);
252
227
  }
253
228
  if (opts.asyncStartCallback) {
254
- yield opts.asyncStartCallback();
229
+ await opts.asyncStartCallback();
255
230
  }
256
231
  if (five$1.currentMode !== five.Five.Mode.Panorama) {
257
- yield five$1.changeMode(five.Five.Mode.Panorama);
232
+ await five$1.changeMode(five.Five.Mode.Panorama);
258
233
  }
259
234
  if (args.panoIndex !== undefined && args.panoIndex !== five$1.panoIndex) {
260
235
  if (opts.preload)
261
- yield five$1.preloadPano(args.panoIndex);
262
- yield new Promise((resolve, reject) => {
236
+ await five$1.preloadPano(args.panoIndex);
237
+ await new Promise((resolve, reject) => {
263
238
  if (!args.panoIndex) {
264
239
  resolve(true);
265
240
  return;
@@ -271,10 +246,10 @@ const CameraMovementPlugin = (five$1) => {
271
246
  });
272
247
  }
273
248
  if (opts.asyncEndCallback) {
274
- yield opts.asyncEndCallback();
249
+ await opts.asyncEndCallback();
275
250
  }
276
251
  const { from, to } = getAnimeParams(args);
277
- return yield new Promise((resolve) => {
252
+ return await new Promise((resolve) => {
278
253
  const onUpdate = ({ progress }) => {
279
254
  const state = {};
280
255
  state.longitude = progressNumber(from.longitude, to.longitude, progress);
@@ -316,7 +291,7 @@ const CameraMovementPlugin = (five$1) => {
316
291
  state.interruptCallback(true);
317
292
  }, duration);
318
293
  });
319
- });
294
+ };
320
295
  return {
321
296
  move,
322
297
  rotate,
@@ -1,4 +1,4 @@
1
- import { Mode, Pose } from '@realsee/five';
1
+ import type { Mode, Pose } from '@realsee/five';
2
2
  export interface CameraMovementPluginParameterType {
3
3
  }
4
4
  export interface CameraMovementPluginExportType {
@@ -25,31 +25,6 @@ function _interopNamespace(e) {
25
25
 
26
26
  var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
27
27
 
28
- /*! *****************************************************************************
29
- Copyright (c) Microsoft Corporation.
30
-
31
- Permission to use, copy, modify, and/or distribute this software for any
32
- purpose with or without fee is hereby granted.
33
-
34
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
35
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
36
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
37
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
38
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
39
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
40
- PERFORMANCE OF THIS SOFTWARE.
41
- ***************************************************************************** */
42
-
43
- function __awaiter(thisArg, _arguments, P, generator) {
44
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
45
- return new (P || (P = Promise))(function (resolve, reject) {
46
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
47
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
48
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
49
- step((generator = generator.apply(thisArg, _arguments || [])).next());
50
- });
51
- }
52
-
53
28
  const genRotationMatrix = (x, y, z) => {
54
29
  const matrix = new THREE__namespace.Matrix4();
55
30
  const euler = new THREE__namespace.Euler(x, y, z, 'YXZ');
@@ -101,7 +76,7 @@ const ModelChassisCompassPlugin = (five, params) => {
101
76
  const defaultNorthRad = params.north_rad || undefined;
102
77
  // 局部状态
103
78
  const state = {};
104
- const load = (data) => __awaiter(void 0, void 0, void 0, function* () {
79
+ const load = async (data) => {
105
80
  const fbxUrl = (data === null || data === void 0 ? void 0 : data.fbx_url) || defaultFbxUrl;
106
81
  const northRad = (data === null || data === void 0 ? void 0 : data.north_rad) || defaultNorthRad;
107
82
  if (!northRad) {
@@ -112,7 +87,7 @@ const ModelChassisCompassPlugin = (five, params) => {
112
87
  const zOffset = bounding.max.z - bounding.min.z;
113
88
  const maxOffset = Math.max(xOffset, zOffset);
114
89
  const fbxLoader = new FBXLoader.FBXLoader();
115
- const object = yield fbxLoader.loadAsync(fbxUrl);
90
+ const object = await fbxLoader.loadAsync(fbxUrl);
116
91
  transfromToMeshBasicMaterial(object, {
117
92
  transparent: true,
118
93
  side: THREE__namespace.DoubleSide,
@@ -126,7 +101,7 @@ const ModelChassisCompassPlugin = (five, params) => {
126
101
  bject3d2LocalMatrix(object, { position, rotation, scale });
127
102
  state.object = object;
128
103
  return true;
129
- });
104
+ };
130
105
  const onCameraUpdate = ({ latitude }) => {
131
106
  if (!state.object)
132
107
  return;
@@ -1,5 +1,5 @@
1
1
  import type { FivePlugin } from '@realsee/five';
2
- import { Vector3Position } from '../typings/math.type';
2
+ import type { Vector3Position } from '../typings/math.type';
3
3
  export interface ModelEntryDoorGuidePluginData {
4
4
  position?: Vector3Position;
5
5
  rad?: number;
@@ -25,31 +25,6 @@ function _interopNamespace(e) {
25
25
 
26
26
  var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
27
27
 
28
- /*! *****************************************************************************
29
- Copyright (c) Microsoft Corporation.
30
-
31
- Permission to use, copy, modify, and/or distribute this software for any
32
- purpose with or without fee is hereby granted.
33
-
34
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
35
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
36
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
37
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
38
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
39
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
40
- PERFORMANCE OF THIS SOFTWARE.
41
- ***************************************************************************** */
42
-
43
- function __awaiter(thisArg, _arguments, P, generator) {
44
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
45
- return new (P || (P = Promise))(function (resolve, reject) {
46
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
47
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
48
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
49
- step((generator = generator.apply(thisArg, _arguments || [])).next());
50
- });
51
- }
52
-
53
28
  function createCanvasTextTexture(text, config) {
54
29
  var _a, _b, _c, _d, _e;
55
30
  const size = (_a = config === null || config === void 0 ? void 0 : config.size) !== null && _a !== void 0 ? _a : 512;
@@ -99,25 +74,25 @@ const ModelEntryDoorGuidePlugin = (five, params) => {
99
74
  const defaultRad = (_c = params.rad) !== null && _c !== void 0 ? _c : undefined;
100
75
  const defaultFbxUrl = params.fbx_url || '//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx';
101
76
  const mixers = [];
102
- const load = (data) => __awaiter(void 0, void 0, void 0, function* () {
103
- var _d, _e, _f, _g, _h, _j, _k;
104
- const position = (_d = data === null || data === void 0 ? void 0 : data.position) !== null && _d !== void 0 ? _d : defaultModelPosition;
77
+ const load = async (data) => {
78
+ var _a, _b, _c, _d, _e, _f, _g;
79
+ const position = (_a = data === null || data === void 0 ? void 0 : data.position) !== null && _a !== void 0 ? _a : defaultModelPosition;
105
80
  if (!position)
106
81
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): position is undefined`);
107
82
  const modelPosition = transformPositionToVector3(position);
108
- const rad = (_e = data === null || data === void 0 ? void 0 : data.rad) !== null && _e !== void 0 ? _e : defaultRad;
109
- const fbxUrl = (_f = data === null || data === void 0 ? void 0 : data.fbx_url) !== null && _f !== void 0 ? _f : defaultFbxUrl;
83
+ const rad = (_b = data === null || data === void 0 ? void 0 : data.rad) !== null && _b !== void 0 ? _b : defaultRad;
84
+ const fbxUrl = (_c = data === null || data === void 0 ? void 0 : data.fbx_url) !== null && _c !== void 0 ? _c : defaultFbxUrl;
110
85
  state.rad = rad;
111
86
  if (rad === undefined)
112
87
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): rad is ${rad}`);
113
88
  // 加载模型
114
- const object = yield new FBXLoader.FBXLoader().loadAsync(fbxUrl);
89
+ const object = await new FBXLoader.FBXLoader().loadAsync(fbxUrl);
115
90
  // 设置位置
116
91
  object.position.copy(modelPosition);
117
92
  object.rotation.z = rad;
118
93
  object.scale.set(0.8, 0.8, 0.8);
119
94
  transfromToMeshBasicMaterial(object, { transparent: true, side: THREE__namespace.DoubleSide });
120
- const textMesh = (_k = (_j = (_h = (_g = object.children) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.children) === null || _j === void 0 ? void 0 : _j[3]) === null || _k === void 0 ? void 0 : _k.clone();
95
+ const textMesh = (_g = (_f = (_e = (_d = object.children) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.children) === null || _f === void 0 ? void 0 : _f[3]) === null || _g === void 0 ? void 0 : _g.clone();
121
96
  if (!textMesh)
122
97
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): textMesh is ${textMesh}`);
123
98
  textMesh.material = new THREE.MeshBasicMaterial({ transparent: true, map: createCanvasTextTexture('入户门') });
@@ -125,7 +100,7 @@ const ModelEntryDoorGuidePlugin = (five, params) => {
125
100
  object.children[0].add(textMesh);
126
101
  state.object = object;
127
102
  return true;
128
- });
103
+ };
129
104
  const initAnimation = () => {
130
105
  if (state.animation)
131
106
  return;
@@ -1,5 +1,5 @@
1
- import { SubscribeEventMap } from '@realsee/five';
2
- import { ItemLabel } from "./typings";
1
+ import type { SubscribeEventMap } from '@realsee/five';
2
+ import type { ItemLabel } from "./typings";
3
3
  export interface ItemLabelEvent extends SubscribeEventMap {
4
4
  /**
5
5
  * 点击标签
@@ -42,7 +42,7 @@ var DISPLAY_STRATEGY_TYPE;
42
42
  /* src/ModelItemLabelPlugin/ItemLabelItem.svelte generated by Svelte v3.47.0 */
43
43
 
44
44
  function add_css$1(target) {
45
- internal.append_styles(target, "svelte-1mttyji", ".item-label-item.svelte-1mttyji{position:absolute;z-index:0;transform:none;cursor:pointer;pointer-events:none;user-select:none;opacity:0}.item-label-item.visible.svelte-1mttyji{opacity:1;animation:svelte-1mttyji-fadeIn .3s ease-in}.item-label-item__text-wrap.svelte-1mttyji::before{content:'';position:absolute;width:100%;height:100%;background-color:rgba(0, 0, 0, .3);filter:blur(16px);z-index:-1}.item-label-item__text-wrap.svelte-1mttyji{padding:6px 6px 0;position:absolute;height:20px;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap;line-height:10px;font-size:11px;font-weight:bold;color:#FFEAC0;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center}.item-label-item__text.svelte-1mttyji{padding-bottom:4px;border-top:0 solid;border-left:0 solid;border-right:0 solid;border-bottom:1px solid;border-image:linear-gradient(to right, rgba(234, 208, 154, 0), rgba(234, 208, 154, 100), rgba(234, 208, 154, 0)) 4.5 1 4.5}.item-label-item__bar.svelte-1mttyji{position:absolute;bottom:0;width:1px;background-image:linear-gradient(to bottom, rgba(234, 208, 154, 0), rgba(234, 208, 154, 1))}@keyframes svelte-1mttyji-fadeIn{from{opacity:0\n }to{opacity:1\n }}");
45
+ internal.append_styles(target, "svelte-1hzvil1", ".item-label-item.svelte-1hzvil1{position:absolute;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;opacity:0}.item-label-item.visible.svelte-1hzvil1{opacity:1;-webkit-animation:svelte-1hzvil1-fadeIn .3s ease-in;animation:svelte-1hzvil1-fadeIn .3s ease-in}.item-label-item__text-wrap.svelte-1hzvil1::before{content:'';position:absolute;width:100%;height:100%;background-color:rgba(0, 0, 0, .3);filter:blur(0.83333rem);z-index:-1}.item-label-item__text-wrap.svelte-1hzvil1{padding:0.3125rem 0.3125rem 0;position:absolute;height:1.04167rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap;line-height:0.52083rem;font-size:0.57292rem;font-weight:bold;color:#FFEAC0;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center}.item-label-item__text.svelte-1hzvil1{padding-bottom:0.20833rem;border-top:0 solid;border-left:0 solid;border-right:0 solid;border-bottom:1px solid;-o-border-image:linear-gradient(to right, rgba(234, 208, 154, 0), rgba(234, 208, 154, 100), rgba(234, 208, 154, 0)) 4.5 1 4.5;border-image:linear-gradient(to right, rgba(234, 208, 154, 0), rgba(234, 208, 154, 100), rgba(234, 208, 154, 0)) 4.5 1 4.5}.item-label-item__bar.svelte-1hzvil1{position:absolute;bottom:0;width:1px;background-image:linear-gradient(to bottom, rgba(234, 208, 154, 0), rgba(234, 208, 154, 1))}@-webkit-keyframes svelte-1hzvil1-fadeIn{from{opacity:0\n }to{opacity:1\n }}@keyframes svelte-1hzvil1-fadeIn{from{opacity:0\n }to{opacity:1\n }}");
46
46
  }
47
47
 
48
48
  function create_fragment$1(ctx) {
@@ -69,12 +69,12 @@ function create_fragment$1(ctx) {
69
69
  t0 = internal.text(t0_value);
70
70
  t1 = internal.space();
71
71
  div1 = internal.element("div");
72
- internal.attr(span, "class", "item-label-item__text svelte-1mttyji");
73
- internal.attr(div0, "class", "item-label-item__text-wrap svelte-1mttyji");
72
+ internal.attr(span, "class", "item-label-item__text svelte-1hzvil1");
73
+ internal.attr(div0, "class", "item-label-item__text-wrap svelte-1hzvil1");
74
74
  internal.set_style(div0, "top", `-${/*itemLabel*/ ctx[0].strokeLength + 26}px`);
75
- internal.attr(div1, "class", "item-label-item__bar svelte-1mttyji");
75
+ internal.attr(div1, "class", "item-label-item__bar svelte-1hzvil1");
76
76
  internal.set_style(div1, "height", `${/*itemLabel*/ ctx[0].strokeLength}px`);
77
- internal.attr(div2, "class", div2_class_value = "" + (internal.null_to_empty(classNames__default["default"]("item-label-item", { visible: /*itemLabel*/ ctx[0].visible })) + " svelte-1mttyji"));
77
+ internal.attr(div2, "class", div2_class_value = "" + (internal.null_to_empty(classNames__default["default"]("item-label-item", { visible: /*itemLabel*/ ctx[0].visible })) + " svelte-1hzvil1"));
78
78
  internal.set_style(div2, "z-index", /*itemLabel*/ ctx[0].zIndex, false);
79
79
  internal.set_style(div2, "transform", /*itemLabel*/ ctx[0].transform, false);
80
80
  },
@@ -104,7 +104,7 @@ function create_fragment$1(ctx) {
104
104
  internal.set_style(div1, "height", `${/*itemLabel*/ ctx[0].strokeLength}px`);
105
105
  }
106
106
 
107
- if (dirty & /*itemLabel*/ 1 && div2_class_value !== (div2_class_value = "" + (internal.null_to_empty(classNames__default["default"]("item-label-item", { visible: /*itemLabel*/ ctx[0].visible })) + " svelte-1mttyji"))) {
107
+ if (dirty & /*itemLabel*/ 1 && div2_class_value !== (div2_class_value = "" + (internal.null_to_empty(classNames__default["default"]("item-label-item", { visible: /*itemLabel*/ ctx[0].visible })) + " svelte-1hzvil1"))) {
108
108
  internal.attr(div2, "class", div2_class_value);
109
109
  }
110
110
 
@@ -168,7 +168,7 @@ function debounce(func, wait = 200) {
168
168
  /* src/ModelItemLabelPlugin/ItemLabelComponent.svelte generated by Svelte v3.47.0 */
169
169
 
170
170
  function add_css(target) {
171
- internal.append_styles(target, "svelte-rmdeb", ".item-labels-container.svelte-rmdeb{width:100%;height:100%;position:relative}");
171
+ internal.append_styles(target, "svelte-gk8s47", ".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}");
172
172
  }
173
173
 
174
174
  function get_each_context(ctx, list, i) {
@@ -249,7 +249,7 @@ function create_fragment(ctx) {
249
249
  each_blocks[i].c();
250
250
  }
251
251
 
252
- internal.attr(div, "class", "item-labels-container svelte-rmdeb");
252
+ internal.attr(div, "class", "item-labels-container svelte-gk8s47");
253
253
  internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[10].call(div));
254
254
  internal.set_style(div, "opacity", /*itemsVisible*/ ctx[4] ? 1 : 0, false);
255
255
  },
@@ -1,6 +1,6 @@
1
- import ItemLabelComponent from './ItemLabelComponent.svelte';
2
1
  import type { Subscribe } from "@realsee/five";
3
- import { PluginEvent } from "./events.type";
2
+ import type { PluginEvent } from "./events.type";
3
+ import type ItemLabelComponent from './ItemLabelComponent.svelte';
4
4
  export declare enum DISPLAY_STRATEGY_TYPE {
5
5
  SMALL = "small",
6
6
  MIDLLE = "middle",
@@ -1,3 +1,3 @@
1
- import { ModelItemLabelPluginData, ItemLabel } from '../typings';
1
+ import type { ModelItemLabelPluginData, ItemLabel } from '../typings';
2
2
  /** @description 转成内部所需数据 */
3
3
  export declare function parseModelItemLabelPluginData(data: ModelItemLabelPluginData): ItemLabel[];
@@ -11,7 +11,7 @@ const ROOM_LABEL_BG = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAA8CAY
11
11
  /* src/ModelRoomLabelPlugin/RoomLabelItem.svelte generated by Svelte v3.47.0 */
12
12
 
13
13
  function add_css$1(target) {
14
- internal.append_styles(target, "svelte-17nkflf", ".room-label-item.svelte-17nkflf{position:absolute;font-size:8px;z-index:0;transform:none;cursor:pointer;pointer-events:none;user-select:none}.room-label-item__text.svelte-17nkflf{position:absolute;left:0;top:-64px;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:20px;min-width:32px;padding:0 6px;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-17nkflf{position:absolute;top:-44px;height:48px;width:1px;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}.wide.svelte-17nkflf{font-size:10px}");
14
+ internal.append_styles(target, "svelte-1ak9fbs", ".room-label-item.svelte-1ak9fbs{position:absolute;font-size:0.41667rem;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.room-label-item__text.svelte-1ak9fbs{position:absolute;left:0;top:-3.33333rem;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:1.04167rem;min-width:1.66667rem;padding:0 0.3125rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-1ak9fbs{position:absolute;top:-2.29167rem;height:2.5rem;width:1px;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}.wide.svelte-1ak9fbs{font-size:0.52083rem}");
15
15
  }
16
16
 
17
17
  function create_fragment$1(ctx) {
@@ -31,11 +31,11 @@ function create_fragment$1(ctx) {
31
31
  t0 = internal.text(t0_value);
32
32
  t1 = internal.space();
33
33
  div0 = internal.element("div");
34
- internal.attr(span, "class", "room-label-item__text svelte-17nkflf");
34
+ internal.attr(span, "class", "room-label-item__text svelte-1ak9fbs");
35
35
  internal.set_style(span, "background-image", "url(" + ROOM_LABEL_BG + ")");
36
36
  internal.toggle_class(span, "wide", /*roomLabel*/ ctx[0].name.length > 3);
37
- internal.attr(div0, "class", "room-label-item__bar svelte-17nkflf");
38
- internal.attr(div1, "class", "room-label-item svelte-17nkflf");
37
+ internal.attr(div0, "class", "room-label-item__bar svelte-1ak9fbs");
38
+ internal.attr(div1, "class", "room-label-item svelte-1ak9fbs");
39
39
  internal.set_style(div1, "z-index", /*roomLabel*/ ctx[0].zIndex, false);
40
40
  internal.set_style(div1, "transform", /*roomLabel*/ ctx[0].transform, false);
41
41
  internal.set_style(div1, "opacity", /*roomLabel*/ ctx[0].visible ? 1 : 0, false);
@@ -111,7 +111,7 @@ class RoomLabelItem extends internal.SvelteComponent {
111
111
  /* src/ModelRoomLabelPlugin/RoomLabelItems.svelte generated by Svelte v3.47.0 */
112
112
 
113
113
  function add_css(target) {
114
- internal.append_styles(target, "svelte-185yvaa", ".room-labels-container.svelte-185yvaa{width:100%;height:100%;position:relative;color:#fff}");
114
+ internal.append_styles(target, "svelte-9eg4zi", ".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}");
115
115
  }
116
116
 
117
117
  function get_each_context(ctx, list, i) {
@@ -192,7 +192,7 @@ function create_fragment(ctx) {
192
192
  each_blocks[i].c();
193
193
  }
194
194
 
195
- internal.attr(div, "class", "room-labels-container svelte-185yvaa");
195
+ internal.attr(div, "class", "room-labels-container svelte-9eg4zi");
196
196
  internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[4].call(div));
197
197
  },
198
198
  m(target, anchor) {
@@ -1,3 +1,3 @@
1
- import { ModelRoomLabelPluginData, RoomLabel } from '../typings';
1
+ import type { ModelRoomLabelPluginData, RoomLabel } from '../typings';
2
2
  /** @description 下划线转驼峰 */
3
3
  export declare function parseModelRoomLabelPluginData(data: ModelRoomLabelPluginData): RoomLabel[];
@@ -1,4 +1,4 @@
1
1
  import type { FivePlugin } from '@realsee/five';
2
- import { ModelTVVideoPluginExportType, ModelTVVideoPluginParameterType } from "./typings";
2
+ import type { ModelTVVideoPluginExportType, ModelTVVideoPluginParameterType } from "./typings";
3
3
  export declare const ModelTVVideoPlugin: FivePlugin<ModelTVVideoPluginParameterType, ModelTVVideoPluginExportType>;
4
4
  export default ModelTVVideoPlugin;
@@ -24,31 +24,6 @@ function _interopNamespace(e) {
24
24
 
25
25
  var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
26
26
 
27
- /*! *****************************************************************************
28
- Copyright (c) Microsoft Corporation.
29
-
30
- Permission to use, copy, modify, and/or distribute this software for any
31
- purpose with or without fee is hereby granted.
32
-
33
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
34
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
35
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
36
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
37
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
38
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39
- PERFORMANCE OF THIS SOFTWARE.
40
- ***************************************************************************** */
41
-
42
- function __awaiter(thisArg, _arguments, P, generator) {
43
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
44
- return new (P || (P = Promise))(function (resolve, reject) {
45
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
46
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
47
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
48
- step((generator = generator.apply(thisArg, _arguments || [])).next());
49
- });
50
- }
51
-
52
27
  var DIRECTION;
53
28
  (function (DIRECTION) {
54
29
  DIRECTION["TOP_LEFT"] = "topLeft";
@@ -222,7 +197,7 @@ const ModelTVVideoPlugin = (five, { videoElement }) => {
222
197
  xhr.send();
223
198
  });
224
199
  };
225
- const load = (data, videoElement) => __awaiter(void 0, void 0, void 0, function* () {
200
+ const load = async (data, videoElement) => {
226
201
  const { video_src, video_poster_src, points } = data;
227
202
  state.videoSource = video_src;
228
203
  // TODO 存疑,先处理多一次遍历 o(2n)
@@ -232,11 +207,11 @@ const ModelTVVideoPlugin = (five, { videoElement }) => {
232
207
  if (videoElement) {
233
208
  state.videoElement = videoElement;
234
209
  }
235
- state.videoTexture = yield getVideoTexture(state.videoSource, state.videoElement);
210
+ state.videoTexture = await getVideoTexture(state.videoSource, state.videoElement);
236
211
  state.enabled = !!data.enable;
237
212
  if (state.enabled)
238
213
  enable();
239
- });
214
+ };
240
215
  const dispose = () => {
241
216
  disable();
242
217
  state.videoTexture = undefined;