@realsee/dnalogel 2.0.0-alpha.42 → 2.0.0-alpha.43

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 (130) hide show
  1. package/dist/CSS3DRenderPlugin/PanoCompassPlugin/index.d.ts +1 -1
  2. package/dist/CameraMovementPlugin/PanoCompassPlugin/index.d.ts +1 -1
  3. package/dist/CameraMovementPlugin/index.js +15 -40
  4. package/dist/ItemLabelPlugin/PanoCompassPlugin/index.d.ts +1 -1
  5. package/dist/ModelChassisCompassPlugin/PanoCompassPlugin/index.d.ts +1 -1
  6. package/dist/ModelChassisCompassPlugin/index.js +5 -30
  7. package/dist/ModelEntryDoorGuidePlugin/PanoCompassPlugin/index.d.ts +1 -1
  8. package/dist/ModelEntryDoorGuidePlugin/index.js +8 -33
  9. package/dist/ModelItemLabelPlugin/PanoCompassPlugin/index.d.ts +1 -1
  10. package/dist/ModelRoomLabelPlugin/PanoCompassPlugin/index.d.ts +1 -1
  11. package/dist/ModelTVVideoPlugin/PanoCompassPlugin/index.d.ts +1 -1
  12. package/dist/ModelTVVideoPlugin/index.js +3 -28
  13. package/dist/ModelViewPlugin/PanoCompassPlugin/index.d.ts +1 -1
  14. package/dist/PanoCompassPlugin/PanoCompassPlugin/index.d.ts +1 -1
  15. package/dist/PanoCompassPlugin/index.d.ts +1 -1
  16. package/dist/PanoCompassPlugin/index.js +64 -99
  17. package/dist/PanoCursorRaycasterPlugin/PanoCompassPlugin/index.d.ts +1 -1
  18. package/dist/PanoMeasurePlugin/PanoCompassPlugin/index.d.ts +1 -1
  19. package/dist/PanoRulerPlugin/PanoCompassPlugin/index.d.ts +1 -1
  20. package/dist/PanoRulerPlugin/index.js +3 -28
  21. package/dist/PanoRulerProPlugin/PanoCompassPlugin/index.d.ts +1 -1
  22. package/dist/PanoRulerProPlugin/index.js +29 -58
  23. package/dist/PanoSpatialTagPlugin/PanoCompassPlugin/index.d.ts +1 -1
  24. package/dist/floorplan/ModelFloorplanPlugin/PanoCompassPlugin/index.d.ts +1 -1
  25. package/dist/floorplan/ModelFloorplanPlugin/index.js +115 -156
  26. package/dist/floorplan/PanoFloorplanRadarPlugin/PanoCompassPlugin/index.d.ts +1 -1
  27. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +71 -110
  28. package/dist/floorplan/TopviewFloorplanPlugin/PanoCompassPlugin/index.d.ts +1 -1
  29. package/dist/floorplan/TopviewFloorplanPlugin/index.js +114 -159
  30. package/dist/index.es.js +341 -416
  31. package/dist/index.js +341 -416
  32. package/dist/index.umd.js +341 -416
  33. package/docs/assets/search.js +1 -1
  34. package/docs/classes/Magnifier.html +4 -4
  35. package/docs/classes/ModelRoomLabelController.html +4 -4
  36. package/docs/enums/CameraMovementEffect.html +2 -2
  37. package/docs/enums/DIRECTION.html +1 -1
  38. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
  39. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  40. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
  41. package/docs/enums/Rotation.html +2 -2
  42. package/docs/index.html +2 -2
  43. package/docs/interfaces/CSS3DRenderPluginExportType.html +2 -2
  44. package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
  45. package/docs/interfaces/FloorplanBounding.html +4 -4
  46. package/docs/interfaces/FloorplanData.html +2 -2
  47. package/docs/interfaces/FloorplanEntrance.html +7 -7
  48. package/docs/interfaces/FloorplanExtraObject.html +3 -3
  49. package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
  50. package/docs/interfaces/FloorplanFloorData.html +2 -2
  51. package/docs/interfaces/FloorplanImagePosition.html +2 -2
  52. package/docs/interfaces/FloorplanObserver.html +2 -2
  53. package/docs/interfaces/FloorplanOutlineItem.html +2 -2
  54. package/docs/interfaces/FloorplanPosition.html +2 -2
  55. package/docs/interfaces/FloorplanRoomItem.html +6 -6
  56. package/docs/interfaces/FloorplanRoomLabelItem.html +3 -3
  57. package/docs/interfaces/FloorplanServerBounding.html +4 -4
  58. package/docs/interfaces/FloorplanServerComputedData.html +1 -1
  59. package/docs/interfaces/FloorplanServerData.html +2 -2
  60. package/docs/interfaces/FloorplanServerEntrance.html +7 -7
  61. package/docs/interfaces/FloorplanServerFloorData.html +2 -2
  62. package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
  63. package/docs/interfaces/FloorplanServerObserver.html +2 -2
  64. package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
  65. package/docs/interfaces/FloorplanServerPosition.html +2 -2
  66. package/docs/interfaces/FloorplanServerRoomItem.html +7 -7
  67. package/docs/interfaces/FloorplanServerRoomLabelItem.html +3 -3
  68. package/docs/interfaces/ItemLabelPluginData.html +1 -1
  69. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
  70. package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
  71. package/docs/interfaces/LineJson.html +1 -1
  72. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  73. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  74. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  75. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  76. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  77. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  78. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  79. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  80. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  81. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  82. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  83. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  84. package/docs/interfaces/ModelViewPluginExportType.html +1 -1
  85. package/docs/interfaces/OpenParameter.html +2 -2
  86. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  87. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
  88. package/docs/interfaces/PanoMeasureParameterType.html +1 -1
  89. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  90. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  91. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  92. package/docs/interfaces/PanoRulerProPluginExportType.html +1 -1
  93. package/docs/interfaces/PanoRulerProPluginOptions.html +1 -1
  94. package/docs/interfaces/PanoRulerProPluginParameterType.html +1 -1
  95. package/docs/interfaces/PanoRulerProPluginState.html +1 -1
  96. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
  97. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
  98. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  99. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
  100. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  101. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
  102. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  103. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
  104. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
  105. package/docs/interfaces/Point.html +1 -1
  106. package/docs/interfaces/PointJson.html +1 -1
  107. package/docs/interfaces/Room.html +1 -1
  108. package/docs/interfaces/RoomInfo.html +1 -1
  109. package/docs/interfaces/RoomLabel.html +7 -7
  110. package/docs/interfaces/RoomRules.html +1 -1
  111. package/docs/interfaces/Rooms.html +1 -1
  112. package/docs/modules.html +18 -18
  113. package/libs/CameraMovementPlugin/CameraMovementPlugin.js +15 -24
  114. package/libs/ModelChassisCompassPlugin/Plugin.js +5 -14
  115. package/libs/ModelEntryDoorGuidePlugin/Plugin.js +8 -17
  116. package/libs/ModelTVVideoPlugin/Plugin.js +3 -12
  117. package/libs/PanoCompassPlugin/controller.js +56 -73
  118. package/libs/PanoCompassPlugin/index.d.ts +1 -1
  119. package/libs/PanoRulerPlugin/Plugin.js +3 -12
  120. package/libs/PanoRulerProPlugin/Controller.js +29 -42
  121. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +29 -42
  122. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +43 -60
  123. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +58 -79
  124. package/libs/floorplan/utils/correctFiveState.js +20 -31
  125. package/libs/floorplan/utils/formatData.js +28 -43
  126. package/libs/shared-utils/five/changeMode.js +28 -39
  127. package/libs/shared-utils/three/loadFbxObj.js +9 -20
  128. package/libs/shared-utils/three/loadTexture.js +6 -17
  129. package/libs/shared-utils/to.js +10 -21
  130. package/package.json +14 -14
@@ -1,47 +1,36 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
1
  import nearlyEqual from '../nearlyEqual';
11
2
  /** 等待 five changeMode 结束
12
3
  * @description Promise 的状态只代表 mode 与预期是否一致,不保证参数的一致性
13
4
  */
14
- export default function changeMode(five, changeModeParams) {
15
- return __awaiter(this, void 0, void 0, function* () {
16
- yield new Promise((resolve, reject) => {
17
- // 虽然 changeMode 是异步函数,但不代表异步流程结束代表切换 Mode 动画结束
18
- five.changeMode(...changeModeParams).catch((error) => reject(error));
19
- five.once('initAnimationEnded', () => {
20
- const fiveCurrentState = five.getCurrentState();
21
- const correctMode = changeModeParams[0];
22
- if (fiveCurrentState.mode !== correctMode)
23
- reject(new Error('mode 与预期不符'));
24
- /** 检测当前的 current pose 和传入的 pose 是否一致 */
25
- const checkPose = () => {
26
- const correctPose = changeModeParams[1];
27
- if (!correctPose)
5
+ export default async function changeMode(five, changeModeParams) {
6
+ await new Promise((resolve, reject) => {
7
+ // 虽然 changeMode 是异步函数,但不代表异步流程结束代表切换 Mode 动画结束
8
+ five.changeMode(...changeModeParams).catch((error) => reject(error));
9
+ five.once('initAnimationEnded', () => {
10
+ const fiveCurrentState = five.getCurrentState();
11
+ const correctMode = changeModeParams[0];
12
+ if (fiveCurrentState.mode !== correctMode)
13
+ reject(new Error('mode 与预期不符'));
14
+ /** 检测当前的 current pose 和传入的 pose 是否一致 */
15
+ const checkPose = () => {
16
+ const correctPose = changeModeParams[1];
17
+ if (!correctPose)
18
+ return true;
19
+ return Object.keys(correctPose).every((key) => {
20
+ const fivePoseItem = fiveCurrentState[key];
21
+ if (fivePoseItem === undefined)
28
22
  return true;
29
- return Object.keys(correctPose).every((key) => {
30
- const fivePoseItem = fiveCurrentState[key];
31
- if (fivePoseItem === undefined)
32
- return true;
33
- const correctPoseItem = correctPose[key];
34
- if (typeof fivePoseItem === 'number' && typeof correctPoseItem === 'number') {
35
- return nearlyEqual(fivePoseItem, correctPoseItem, 2);
36
- }
37
- return fivePoseItem === correctPoseItem;
38
- });
39
- };
40
- const checkPoseResult = checkPose();
41
- if (!checkPoseResult)
42
- reject(new Error('five pose 与预期不符'));
43
- resolve();
44
- });
23
+ const correctPoseItem = correctPose[key];
24
+ if (typeof fivePoseItem === 'number' && typeof correctPoseItem === 'number') {
25
+ return nearlyEqual(fivePoseItem, correctPoseItem, 2);
26
+ }
27
+ return fivePoseItem === correctPoseItem;
28
+ });
29
+ };
30
+ const checkPoseResult = checkPose();
31
+ if (!checkPoseResult)
32
+ reject(new Error('five pose 与预期不符'));
33
+ resolve();
45
34
  });
46
35
  });
47
36
  }
@@ -1,24 +1,13 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
1
  import { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader';
11
2
  const loader = new FBXLoader();
12
- export function loadFbxObj(url) {
13
- return __awaiter(this, void 0, void 0, function* () {
14
- return new Promise((resolve, reject) => {
15
- function onLoad(object) {
16
- resolve(object);
17
- }
18
- function onError(error) {
19
- reject(error);
20
- }
21
- loader.load(url, onLoad, undefined, onError);
22
- });
3
+ export async function loadFbxObj(url) {
4
+ return new Promise((resolve, reject) => {
5
+ function onLoad(object) {
6
+ resolve(object);
7
+ }
8
+ function onError(error) {
9
+ reject(error);
10
+ }
11
+ loader.load(url, onLoad, undefined, onError);
23
12
  });
24
13
  }
@@ -1,21 +1,10 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
1
  import * as THREE from 'three';
11
2
  const textureLoader = new THREE.TextureLoader();
12
- export function loadTexture(url) {
13
- return __awaiter(this, void 0, void 0, function* () {
14
- return new Promise((resolve, reject) => {
15
- textureLoader.load(url, resolve, undefined, reject);
16
- }).then((texture) => {
17
- texture.encoding = THREE.sRGBEncoding;
18
- return texture;
19
- });
3
+ export async function loadTexture(url) {
4
+ return new Promise((resolve, reject) => {
5
+ textureLoader.load(url, resolve, undefined, reject);
6
+ }).then((texture) => {
7
+ texture.encoding = THREE.sRGBEncoding;
8
+ return texture;
20
9
  });
21
10
  }
@@ -1,29 +1,18 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
1
  /**
11
2
  * 传入一个 Promise
12
3
  * 无异常,返回 [null, data]
13
4
  * 有异常,则返回 [Error, undefined]
14
5
  * 用于替代 try&catch 处理 await 异常的方案
15
6
  */
16
- export function to(promise) {
17
- return __awaiter(this, void 0, void 0, function* () {
18
- try {
19
- const data = yield promise;
20
- return [null, data];
21
- }
22
- catch (error) {
23
- if (error instanceof Error)
24
- return [error, null];
25
- return [new Error(''), null];
26
- }
27
- });
7
+ export async function to(promise) {
8
+ try {
9
+ const data = await promise;
10
+ return [null, data];
11
+ }
12
+ catch (error) {
13
+ if (error instanceof Error)
14
+ return [error, null];
15
+ return [new Error(''), null];
16
+ }
28
17
  }
29
18
  export default to;
package/package.json CHANGED
@@ -8,20 +8,8 @@
8
8
  "repository": "https://github.com/realsee-developer/dnalogel.git",
9
9
  "description": "如视 VR 看房插件合集",
10
10
  "private": false,
11
- "version": "2.0.0-alpha.42",
11
+ "version": "2.0.0-alpha.43",
12
12
  "license": "SEE LICENSE IN TERMS.txt",
13
- "scripts": {
14
- "build": "yarn run tsb && yarn run build:rollup && yarn run build:components && yarn build:docs",
15
- "build:dev": "yarn build:svelte && tsc --watch",
16
- "build:rollup": " rollup --config rollup.config.js",
17
- "build:rollup:dev": " rollup --config rollup.config.js --watch",
18
- "build:components": "vite build",
19
- "tsb": "tsc && yarn build:svelte && ./bin/svelte-compile.js",
20
- "build:svelte": "svelte-strip strip src/ libs -m=false",
21
- "build:docs": "typedoc --options ./typedoc.json",
22
- "preview": "vite preview",
23
- "check": "svelte-check --tsconfig ./tsconfig.json"
24
- },
25
13
  "files": [
26
14
  "libs",
27
15
  "dist",
@@ -65,5 +53,17 @@
65
53
  "@tweenjs/tween.js": "^18.6.4",
66
54
  "hammerjs": "^2.0.8",
67
55
  "svelte": "^3.47.0"
56
+ },
57
+ "scripts": {
58
+ "build": "yarn run tsb && yarn run build:rollup && yarn run build:components && yarn build:docs",
59
+ "build:dev": "yarn build:svelte && tsc --watch",
60
+ "build:rollup": " rollup --config rollup.config.js",
61
+ "build:rollup:dev": " rollup --config rollup.config.js --watch",
62
+ "build:components": "vite build",
63
+ "tsb": "tsc && yarn build:svelte && ./bin/svelte-compile.js",
64
+ "build:svelte": "svelte-strip strip src/ libs -m=false",
65
+ "build:docs": "typedoc --options ./typedoc.json",
66
+ "preview": "vite preview",
67
+ "check": "svelte-check --tsconfig ./tsconfig.json"
68
68
  }
69
- }
69
+ }