@realsee/dnalogel 2.0.0-alpha.12 → 2.0.0-alpha.13

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 (101) hide show
  1. package/dist/CSS3DRenderPlugin/index.js +17 -14
  2. package/dist/CameraMovementPlugin/index.js +40 -15
  3. package/dist/ModelChassisCompassPlugin/index.js +32 -6
  4. package/dist/ModelEntryDoorGuidePlugin/index.js +48 -18
  5. package/dist/ModelItemLabelPlugin/index.js +18 -17
  6. package/dist/ModelRoomLabelPlugin/index.js +67 -26
  7. package/dist/PanoCompassPlugin/index.js +311 -164
  8. package/dist/PanoCursorRaycasterPlugin/index.js +5 -3
  9. package/dist/PanoMeasurePlugin/index.js +1337 -583
  10. package/dist/PanoRulerPlugin/index.js +32 -5
  11. package/dist/PanoSpatialTagPlugin/index.js +64 -29
  12. package/dist/floorplan/ModelFloorplanPlugin/index.js +586 -362
  13. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +164 -72
  14. package/dist/floorplan/TopviewFloorplanPlugin/index.js +311 -153
  15. package/dist/index.es.js +2663 -1341
  16. package/dist/index.js +2667 -1345
  17. package/dist/index.umd.js +2667 -1345
  18. package/docs/assets/main.js +1 -1
  19. package/docs/classes/ModelRoomLabelController.html +6 -6
  20. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  21. package/docs/enums/ModelFloorplanErrorType.html +1 -1
  22. package/docs/interfaces/LineJson.html +1 -1
  23. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  24. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  25. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  26. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  27. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  28. package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
  29. package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
  30. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  31. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  32. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  33. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  34. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  35. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  36. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  37. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  38. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  39. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  40. package/docs/interfaces/PointJson.html +1 -1
  41. package/docs/interfaces/RoomLabel.html +7 -7
  42. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +1 -1
  43. package/docs/modules.html +12 -12
  44. package/libs/CSS3DRenderPlugin/index.js +16 -13
  45. package/libs/CameraMovementPlugin/index.js +24 -15
  46. package/libs/ModelChassisCompassPlugin/index.js +14 -5
  47. package/libs/ModelEntryDoorGuidePlugin/index.js +24 -12
  48. package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +12 -10
  49. package/libs/ModelItemLabelPlugin/index.js +5 -3
  50. package/libs/ModelItemLabelPlugin/utils/parseData.js +1 -4
  51. package/libs/ModelRoomLabelPlugin/Controller.js +64 -23
  52. package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +3 -3
  53. package/libs/PanoCompassPlugin/index.js +225 -128
  54. package/libs/PanoCursorRaycasterPlugin/index.js +5 -3
  55. package/libs/PanoMeasurePlugin/Controller/BaseController.js +68 -13
  56. package/libs/PanoMeasurePlugin/Controller/EditController.js +267 -154
  57. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +40 -20
  58. package/libs/PanoMeasurePlugin/Controller/WatchController.js +234 -152
  59. package/libs/PanoMeasurePlugin/Controller/index.js +131 -47
  60. package/libs/PanoMeasurePlugin/Model/index.js +30 -5
  61. package/libs/PanoMeasurePlugin/Model/line.js +60 -10
  62. package/libs/PanoMeasurePlugin/Model/point.js +24 -4
  63. package/libs/PanoMeasurePlugin/Model/polyline.js +20 -3
  64. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +59 -14
  65. package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +23 -8
  66. package/libs/PanoMeasurePlugin/Modules/GuideController.js +61 -26
  67. package/libs/PanoMeasurePlugin/Modules/Magnifier.js +60 -10
  68. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +83 -37
  69. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +52 -17
  70. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +61 -30
  71. package/libs/PanoMeasurePlugin/utils/distanceDom.js +3 -2
  72. package/libs/PanoMeasurePlugin/utils/line.js +8 -7
  73. package/libs/PanoRulerPlugin/index.js +16 -5
  74. package/libs/PanoSpatialTagPlugin/index.js +11 -9
  75. package/libs/floorplan/Components/BaseImage.js +10 -5
  76. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +3 -1
  77. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +5 -6
  78. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +7 -2
  79. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +3 -1
  80. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +456 -273
  81. package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +33 -22
  82. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +3 -1
  83. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +97 -36
  84. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +231 -108
  85. package/libs/floorplan/utils/formatData.js +43 -28
  86. package/libs/floorplan/utils/formatPosition.js +1 -1
  87. package/libs/shared-utils/Subscribe.js +8 -1
  88. package/libs/shared-utils/animationFrame/BetterTween.js +47 -18
  89. package/libs/shared-utils/createCanvasTextTexture.js +6 -5
  90. package/libs/shared-utils/five/changeMode.js +23 -12
  91. package/libs/shared-utils/getPxmm.js +1 -1
  92. package/libs/shared-utils/math/evenNumber.js +1 -1
  93. package/libs/shared-utils/three/loadFbxObj.js +20 -9
  94. package/libs/shared-utils/three/loadTexture.js +17 -6
  95. package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +2 -1
  96. package/libs/shared-utils/tinyEJSrender.js +36 -6
  97. package/libs/shared-utils/to.js +21 -10
  98. package/libs/shared-utils/useDebounce.js +1 -1
  99. package/libs/shared-utils/useThrottle.js +2 -1
  100. package/package.json +1 -1
  101. package/CHANGELOG.md +0 -41
@@ -1,21 +1,34 @@
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
+ };
1
10
  import { FLOORPLAN_EXTRA_OBJECT_IMAGE } from '../Assets/floorplanExtraObject';
2
11
  import { floorplanPosition2ImagePosition, getFloorIndexFromModelPosition, modelPosition2FloorplanPosition, } from './formatPosition';
3
- async function formatOutlines(outlines) {
4
- const headers = new Headers({ 'Content-Type': 'text/plain' });
5
- const getOutlineItem = async function (item) {
6
- const outlineItem = {
7
- index: item.index,
8
- url: item.url,
9
- svgUrl: item.svg_url,
12
+ function formatOutlines(outlines) {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ const headers = new Headers({ 'Content-Type': 'text/plain' });
15
+ const getOutlineItem = function (item) {
16
+ return __awaiter(this, void 0, void 0, function* () {
17
+ const outlineItem = {
18
+ index: item.index,
19
+ url: item.url,
20
+ svgUrl: item.svg_url,
21
+ };
22
+ if (item.svg_url) {
23
+ const svgContent = yield fetch(item.svg_url, { headers }).then((res) => res.text());
24
+ outlineItem.svgContent = svgContent;
25
+ }
26
+ return outlineItem;
27
+ });
10
28
  };
11
- if (item.svg_url) {
12
- const svgContent = await fetch(item.svg_url, { headers }).then((res) => res.text());
13
- outlineItem.svgContent = svgContent;
14
- }
15
- return outlineItem;
16
- };
17
- const svgOutlineItems = await Promise.all(outlines.map(getOutlineItem));
18
- return svgOutlineItems;
29
+ const svgOutlineItems = yield Promise.all(outlines.map(getOutlineItem));
30
+ return svgOutlineItems;
31
+ });
19
32
  }
20
33
  function formatRoom(data) {
21
34
  const floorplanRoomItem = {
@@ -61,19 +74,21 @@ function formatFloorplanEntrance(data) {
61
74
  };
62
75
  return floorplanEntrance;
63
76
  }
64
- export default async function formatData(data) {
65
- const outlines = await formatOutlines(data.outlines);
66
- const bounding = data.computed_data.bounding;
67
- const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
68
- const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
69
- const floorplanData = {
70
- outlines,
71
- entrance,
72
- bounding,
73
- floorDatas,
74
- observers: data.computed_data.observers.map(formateFloorplanObserver),
75
- };
76
- return floorplanData;
77
+ export default function formatData(data) {
78
+ return __awaiter(this, void 0, void 0, function* () {
79
+ const outlines = yield formatOutlines(data.outlines);
80
+ const bounding = data.computed_data.bounding;
81
+ const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
82
+ const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
83
+ const floorplanData = {
84
+ outlines,
85
+ entrance,
86
+ bounding,
87
+ floorDatas,
88
+ observers: data.computed_data.observers.map(formateFloorplanObserver),
89
+ };
90
+ return floorplanData;
91
+ });
77
92
  }
78
93
  export function formatExtraObjects(data, five, floorplanData) {
79
94
  const extraObjects = data.map((object) => {
@@ -9,7 +9,7 @@ export function pathD(points, options = {}) {
9
9
  d += 'M' + point;
10
10
  return d;
11
11
  }
12
- if (needA?.[index]) {
12
+ if (needA === null || needA === void 0 ? void 0 : needA[index]) {
13
13
  d += 'A' + needA[index] + ',' + point;
14
14
  return d;
15
15
  }
@@ -1,3 +1,4 @@
1
+ var _a;
1
2
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
3
  const __EVENT__ = '__events__';
3
4
  /**
@@ -5,8 +6,13 @@ const __EVENT__ = '__events__';
5
6
  * 观察者模式(供前端使用),Node端推荐<a href="https://nodejs.org/api/events.html#events_class_eventemitter">EventEmitter</a>。
6
7
  */
7
8
  export default class Subscribe {
8
- [__EVENT__];
9
9
  constructor() {
10
+ Object.defineProperty(this, _a, {
11
+ enumerable: true,
12
+ configurable: true,
13
+ writable: true,
14
+ value: void 0
15
+ });
10
16
  this[__EVENT__] = {};
11
17
  }
12
18
  /**
@@ -99,3 +105,4 @@ export default class Subscribe {
99
105
  return canceled;
100
106
  }
101
107
  }
108
+ _a = __EVENT__;
@@ -1,24 +1,53 @@
1
1
  import TWEEN from '@tweenjs/tween.js';
2
2
  import { requestAnimationFrameInterval } from './index';
3
3
  export class BetterTween extends TWEEN.Tween {
4
- disposeMethods = [];
5
- animationFrameDisposer;
6
- onDispose = (callback) => {
7
- this.disposeMethods.push(callback);
8
- return this;
9
- };
10
- play = () => {
11
- this.start(0);
12
- this.animationFrameDisposer = requestAnimationFrameInterval((time) => this.update(time));
13
- return this;
14
- };
15
- dispose = () => {
16
- this.stop();
17
- this.animationFrameDisposer?.();
18
- this.disposeMethods.forEach((fn) => fn());
19
- this.disposeMethods = [];
20
- TWEEN.remove(this);
21
- };
4
+ constructor() {
5
+ super(...arguments);
6
+ Object.defineProperty(this, "disposeMethods", {
7
+ enumerable: true,
8
+ configurable: true,
9
+ writable: true,
10
+ value: []
11
+ });
12
+ Object.defineProperty(this, "animationFrameDisposer", {
13
+ enumerable: true,
14
+ configurable: true,
15
+ writable: true,
16
+ value: void 0
17
+ });
18
+ Object.defineProperty(this, "onDispose", {
19
+ enumerable: true,
20
+ configurable: true,
21
+ writable: true,
22
+ value: (callback) => {
23
+ this.disposeMethods.push(callback);
24
+ return this;
25
+ }
26
+ });
27
+ Object.defineProperty(this, "play", {
28
+ enumerable: true,
29
+ configurable: true,
30
+ writable: true,
31
+ value: () => {
32
+ this.start(0);
33
+ this.animationFrameDisposer = requestAnimationFrameInterval((time) => this.update(time));
34
+ return this;
35
+ }
36
+ });
37
+ Object.defineProperty(this, "dispose", {
38
+ enumerable: true,
39
+ configurable: true,
40
+ writable: true,
41
+ value: () => {
42
+ var _a;
43
+ this.stop();
44
+ (_a = this.animationFrameDisposer) === null || _a === void 0 ? void 0 : _a.call(this);
45
+ this.disposeMethods.forEach((fn) => fn());
46
+ this.disposeMethods = [];
47
+ TWEEN.remove(this);
48
+ }
49
+ });
50
+ }
22
51
  }
23
52
  export function tweenProgress(duration, easing = TWEEN.Easing.Linear.None) {
24
53
  const tween = new BetterTween({ progress: 0 }).to({ progress: 1 });
@@ -1,10 +1,11 @@
1
1
  import { CanvasTexture } from 'three';
2
2
  export default function createCanvasTextTexture(text, config) {
3
- const size = config?.size ?? 512;
4
- const fontSize = config?.fontSize ?? size * (35 / 256) * 1.2;
5
- const backgroundColor = config?.backgroundColor ?? 'rgba(0,0,0,0)';
6
- const fontColor = config?.fontColor ?? '#fff';
7
- const textAlign = config?.textAlign ?? 'center';
3
+ var _a, _b, _c, _d, _e;
4
+ const size = (_a = config === null || config === void 0 ? void 0 : config.size) !== null && _a !== void 0 ? _a : 512;
5
+ const fontSize = (_b = config === null || config === void 0 ? void 0 : config.fontSize) !== null && _b !== void 0 ? _b : size * (35 / 256) * 1.2;
6
+ const backgroundColor = (_c = config === null || config === void 0 ? void 0 : config.backgroundColor) !== null && _c !== void 0 ? _c : 'rgba(0,0,0,0)';
7
+ const fontColor = (_d = config === null || config === void 0 ? void 0 : config.fontColor) !== null && _d !== void 0 ? _d : '#fff';
8
+ const textAlign = (_e = config === null || config === void 0 ? void 0 : config.textAlign) !== null && _e !== void 0 ? _e : 'center';
8
9
  const canvas = document.createElement('canvas');
9
10
  canvas.setAttribute('width', size + '');
10
11
  canvas.setAttribute('height', size + '');
@@ -1,15 +1,26 @@
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
+ };
1
10
  import to from '../to';
2
- export default async function changeMode(five, ...changeModeParams) {
3
- const [changeModeError] = await to(five.changeMode(...changeModeParams));
4
- if (changeModeError)
5
- throw changeModeError;
6
- await new Promise((reslove, reject) => {
7
- five.once('initAnimationEnded', reslove);
8
- const handleModeChange = (mode) => {
9
- if (mode !== changeModeParams[0])
10
- reject('changeMode 被中断');
11
- five.off('modeChange', handleModeChange);
12
- };
13
- five.on('modeChange', handleModeChange);
11
+ export default function changeMode(five, ...changeModeParams) {
12
+ return __awaiter(this, void 0, void 0, function* () {
13
+ const [changeModeError] = yield to(five.changeMode(...changeModeParams));
14
+ if (changeModeError)
15
+ throw changeModeError;
16
+ yield new Promise((reslove, reject) => {
17
+ five.once('initAnimationEnded', reslove);
18
+ const handleModeChange = (mode) => {
19
+ if (mode !== changeModeParams[0])
20
+ reject('changeMode 被中断');
21
+ five.off('modeChange', handleModeChange);
22
+ };
23
+ five.on('modeChange', handleModeChange);
24
+ });
14
25
  });
15
26
  }
@@ -16,7 +16,7 @@ export default function getPxmm(five, container, floorIndex, options) {
16
16
  function getY() {
17
17
  const currentFloorY = getFloorY(floorIndex);
18
18
  const nextFloorY = getFloorY(floorIndex + 1);
19
- const attachedTo = options?.attachedTo || FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER;
19
+ const attachedTo = (options === null || options === void 0 ? void 0 : options.attachedTo) || FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER;
20
20
  if (attachedTo === FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER)
21
21
  return (five.model.bounding.max.y + five.model.bounding.min.y) / 2;
22
22
  else if (attachedTo === FLOOR_PLAN_ATTACHED_TO.CEILING)
@@ -1,4 +1,4 @@
1
1
  export default function evenNumber(num, config) {
2
2
  const roundNum = Math.round(num);
3
- return roundNum % 2 === 0 ? roundNum : roundNum + Number(config?.smaller ? -1 : 1);
3
+ return roundNum % 2 === 0 ? roundNum : roundNum + Number((config === null || config === void 0 ? void 0 : config.smaller) ? -1 : 1);
4
4
  }
@@ -1,13 +1,24 @@
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
+ };
1
10
  import { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader';
2
11
  const loader = new FBXLoader();
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);
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
+ });
12
23
  });
13
24
  }
@@ -1,10 +1,21 @@
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
+ };
1
10
  import * as THREE from 'three';
2
11
  const textureLoader = new THREE.TextureLoader();
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;
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
+ });
9
20
  });
10
21
  }
@@ -1,12 +1,13 @@
1
1
  import { MeshBasicMaterial } from 'three';
2
2
  export default function transfromToMeshBasicMaterial(object, options) {
3
3
  object.traverse((ele) => {
4
+ var _a;
4
5
  if (ele.type === 'Mesh') {
5
6
  const mesh = ele;
6
7
  const materialConf = Object.assign({ map: mesh.material.map || {} }, options);
7
8
  mesh.material = new MeshBasicMaterial(materialConf);
8
9
  mesh.renderOrder = 1;
9
- if (ele.parent?.type === 'Mesh') {
10
+ if (((_a = ele.parent) === null || _a === void 0 ? void 0 : _a.type) === 'Mesh') {
10
11
  ele.renderOrder = ele.parent.renderOrder + 1;
11
12
  }
12
13
  }
@@ -25,13 +25,43 @@ export default function render(template, data) {
25
25
  return templ.compileFunction()(data);
26
26
  }
27
27
  class Template {
28
- templateText;
29
- mode = null;
30
- truncate = false;
31
- currentLine = 1;
32
- source = '';
33
- regex = new RegExp(REGEX_STRING);
34
28
  constructor(text) {
29
+ Object.defineProperty(this, "templateText", {
30
+ enumerable: true,
31
+ configurable: true,
32
+ writable: true,
33
+ value: void 0
34
+ });
35
+ Object.defineProperty(this, "mode", {
36
+ enumerable: true,
37
+ configurable: true,
38
+ writable: true,
39
+ value: null
40
+ });
41
+ Object.defineProperty(this, "truncate", {
42
+ enumerable: true,
43
+ configurable: true,
44
+ writable: true,
45
+ value: false
46
+ });
47
+ Object.defineProperty(this, "currentLine", {
48
+ enumerable: true,
49
+ configurable: true,
50
+ writable: true,
51
+ value: 1
52
+ });
53
+ Object.defineProperty(this, "source", {
54
+ enumerable: true,
55
+ configurable: true,
56
+ writable: true,
57
+ value: ''
58
+ });
59
+ Object.defineProperty(this, "regex", {
60
+ enumerable: true,
61
+ configurable: true,
62
+ writable: true,
63
+ value: new RegExp(REGEX_STRING)
64
+ });
35
65
  this.templateText = text;
36
66
  }
37
67
  compileFunction() {
@@ -1,18 +1,29 @@
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
+ };
1
10
  /**
2
11
  * 传入一个 Promise
3
12
  * 无异常,返回 [null, data]
4
13
  * 有异常,则返回 [Error, undefined]
5
14
  * 用于替代 try&catch 处理 await 异常的方案
6
15
  */
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
- }
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
+ });
17
28
  }
18
29
  export default to;
@@ -16,7 +16,7 @@ export const useDebounce = (callback, waitFor = 200) => {
16
16
  clearTimeout(timer.current);
17
17
  timer.current = null;
18
18
  }
19
- timer.current = setTimeout(() => savedFunc.current?.(...args), waitFor);
19
+ timer.current = setTimeout(() => { var _a; return (_a = savedFunc.current) === null || _a === void 0 ? void 0 : _a.call(savedFunc, ...args); }, waitFor);
20
20
  }, []);
21
21
  };
22
22
  export default useDebounce;
@@ -12,9 +12,10 @@ export const useThrottle = (callback, waitFor) => {
12
12
  savedFunc.current = callback;
13
13
  }, [waitFor]);
14
14
  return useCallback((...args) => {
15
+ var _a;
15
16
  if (timer.current)
16
17
  return;
17
- savedFunc.current?.(...args);
18
+ (_a = savedFunc.current) === null || _a === void 0 ? void 0 : _a.call(savedFunc, ...args);
18
19
  timer.current = setTimeout(() => {
19
20
  if (timer.current)
20
21
  clearTimeout(timer.current);
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "author": "REALSEE-DEVELOPER",
7
7
  "repository": "https://github.com/realsee-developer/dnalogel.git",
8
8
  "private": false,
9
- "version": "2.0.0-alpha.12",
9
+ "version": "2.0.0-alpha.13",
10
10
  "license": "SEE LICENSE IN TERMS.txt",
11
11
  "scripts": {
12
12
  "build": "yarn run tsb && yarn run build:rollup && yarn build:docs",
package/CHANGELOG.md DELETED
@@ -1,41 +0,0 @@
1
- # CHANGELOG
2
-
3
- ## 2.0.0-alpha.12
4
- - 1.feat: 新增 ModelItemLabelPlugin
5
-
6
- ## 2.0.0-alpha.11
7
- - 1.fix: 修复 ModelRoomLabelPlugin 未监听多楼层切换 rerender 问题。
8
- - 2.feat: ModelFloorplanPlugin & TopviewFloorplanPlugin 新增 `northDesc?: string` 配置项,支持用户修改指北针名称。
9
-
10
- ## 2.0.0-alpha.10
11
- - 1.feat: 新增空间三维标签插件 PanoSpatialTagPlugin
12
- - 2.feat: 新增轻量 ejs 渲染模板函数 shared-utils/tinyEJSrender.js
13
-
14
- ## 2.0.0-alpha.9
15
- - 1.refactor: 增加插件独立 js 输出及对 svelte 的编译。
16
-
17
- ## 2.0.0-alpha.8
18
- - 1.fix: 修复 ModelViewPlugin 实景 VR 模型不居中问题;
19
- - 2.fix: 修复 ModelRoomLabelPlugin fov 更新未 rerender 问题;
20
- - 2.fix: 修复 ModelRoomLabelPlugin enable 判断问题;
21
- - 4.fix: 修改 ModelFloorplanPlugin 在全景态满足户型图的俯仰角时会自动切换户型图问题。
22
-
23
- ## 2.0.0-alpha.7
24
- - 1.fix: PanoCompassPlugin 向下兼容;
25
- - 2.feat: 新增 PC 全景测量插件:PanoMeasurePlugin;
26
- - 3.docs: 修改 README.md;
27
-
28
- ## 2.0.0-alpha.6
29
- - 1.fix: 标尺插件 PanoRulerPlugin 所有标尺仅展示一次问题;
30
- - 2.fix: TopviewFloorplanPlugin && ModelFloorplanPlugin 插件小雷达位置显示不正确问题;
31
- - 3.feat: 为 TopviewFloorplanPlugin && ModelFloorplanPlugin 插件新增线框图吸附位置配置选项。
32
- - 可选地板、天花板、模型中心,默认吸附选项为模型中心。
33
-
34
- ## 2.0.0-alpha.5
35
- 1.修复全景指南针插件 PanoCompassPlugin 默认导出 name
36
-
37
- ## 2.0.0-alpha.4
38
- 1.新增全景标尺插件 PanoRulerPlugin
39
-
40
- ## 2.0.0-alpha.3
41
- 1.新增全景指南针插件 PanoCompassPlugin