@realsee/dnalogel 2.0.0-alpha.34 → 2.0.0-alpha.35

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 (115) hide show
  1. package/dist/PanoSpatialTagPlugin/Plugin.d.ts +2 -0
  2. package/dist/PanoSpatialTagPlugin/index.js +57 -48
  3. package/dist/index.es.js +57 -48
  4. package/dist/index.js +57 -48
  5. package/dist/index.umd.js +57 -48
  6. package/docs/assets/search.js +1 -1
  7. package/docs/classes/Magnifier.html +4 -4
  8. package/docs/classes/ModelRoomLabelController.html +4 -4
  9. package/docs/classes/PanoFloorplanRadarPluginController.html +2 -2
  10. package/docs/enums/CameraMovementEffect.html +2 -2
  11. package/docs/enums/DIRECTION.html +1 -1
  12. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
  13. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  14. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
  15. package/docs/enums/ModelFloorplanErrorType.html +1 -1
  16. package/docs/enums/Rotation.html +2 -2
  17. package/docs/index.html +1 -1
  18. package/docs/interfaces/CSS3DRenderPluginExportType.html +2 -2
  19. package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
  20. package/docs/interfaces/FloorplanBounding.html +4 -4
  21. package/docs/interfaces/FloorplanData.html +2 -2
  22. package/docs/interfaces/FloorplanEntrance.html +7 -7
  23. package/docs/interfaces/FloorplanExtraObject.html +3 -3
  24. package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
  25. package/docs/interfaces/FloorplanFloorData.html +2 -2
  26. package/docs/interfaces/FloorplanImagePosition.html +2 -2
  27. package/docs/interfaces/FloorplanObserver.html +2 -2
  28. package/docs/interfaces/FloorplanOutlineItem.html +2 -2
  29. package/docs/interfaces/FloorplanPosition.html +2 -2
  30. package/docs/interfaces/FloorplanRoomItem.html +6 -6
  31. package/docs/interfaces/FloorplanRoomLabelItem.html +3 -3
  32. package/docs/interfaces/FloorplanServerBounding.html +4 -4
  33. package/docs/interfaces/FloorplanServerComputedData.html +1 -1
  34. package/docs/interfaces/FloorplanServerData.html +2 -2
  35. package/docs/interfaces/FloorplanServerEntrance.html +7 -7
  36. package/docs/interfaces/FloorplanServerFloorData.html +2 -2
  37. package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
  38. package/docs/interfaces/FloorplanServerObserver.html +2 -2
  39. package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
  40. package/docs/interfaces/FloorplanServerPosition.html +2 -2
  41. package/docs/interfaces/FloorplanServerRoomItem.html +7 -7
  42. package/docs/interfaces/FloorplanServerRoomLabelItem.html +3 -3
  43. package/docs/interfaces/ItemLabelPluginData.html +1 -1
  44. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
  45. package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
  46. package/docs/interfaces/LineJson.html +1 -1
  47. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  48. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  49. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  50. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  51. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  52. package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
  53. package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
  54. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  55. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  56. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  57. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  58. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  59. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  60. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  61. package/docs/interfaces/ModelViewPluginExportType.html +1 -1
  62. package/docs/interfaces/OpenParameter.html +2 -2
  63. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  64. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  65. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  66. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
  67. package/docs/interfaces/PanoFloorplanRadarPluginControllerParameter.html +1 -1
  68. package/docs/interfaces/PanoMeasureParameterType.html +1 -1
  69. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  70. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  71. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  72. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
  73. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
  74. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  75. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
  76. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  77. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
  78. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  79. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
  80. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
  81. package/docs/interfaces/Point.html +1 -1
  82. package/docs/interfaces/PointJson.html +1 -1
  83. package/docs/interfaces/Room.html +1 -1
  84. package/docs/interfaces/RoomInfo.html +1 -1
  85. package/docs/interfaces/RoomLabel.html +7 -7
  86. package/docs/interfaces/RoomRules.html +1 -1
  87. package/docs/interfaces/Rooms.html +1 -1
  88. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +9 -9
  89. package/docs/modules.html +20 -20
  90. package/libs/ModelSimulationPlugin/index.d.ts +33 -0
  91. package/libs/ModelSimulationPlugin/index.js +166 -0
  92. package/libs/ModelSimulationPlugin/shaders/fragment.d.ts +2 -0
  93. package/libs/ModelSimulationPlugin/shaders/fragment.js +96 -0
  94. package/libs/ModelSimulationPlugin/shaders/vertex.d.ts +2 -0
  95. package/libs/ModelSimulationPlugin/shaders/vertex.js +23 -0
  96. package/libs/PanoSpatialTagPlugin/Components/tag.js +2 -2
  97. package/libs/PanoSpatialTagPlugin/Plugin.d.ts +2 -0
  98. package/libs/PanoSpatialTagPlugin/Plugin.js +55 -46
  99. package/libs/floorplan/ModelFloorplanPlugin/Assets/compass.d.ts +1 -0
  100. package/libs/floorplan/ModelFloorplanPlugin/Assets/compass.js +1 -0
  101. package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.js +120 -0
  102. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +106 -0
  103. package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.js +463 -0
  104. package/libs/floorplan/ModelFloorplanPlugin/Components/Main.js +375 -0
  105. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +171 -0
  106. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.js +265 -0
  107. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +301 -0
  108. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.js +219 -0
  109. package/libs/shared-utils/five/useFivePlugin.d.ts +1 -0
  110. package/libs/shared-utils/five/useFivePlugin.js +8 -0
  111. package/libs/shared-utils/useDebounce.d.ts +8 -0
  112. package/libs/shared-utils/useDebounce.js +22 -0
  113. package/libs/shared-utils/useThrottle.d.ts +8 -0
  114. package/libs/shared-utils/useThrottle.js +25 -0
  115. package/package.json +1 -1
@@ -0,0 +1,219 @@
1
+ /* generated by Svelte v3.47.0 */
2
+ import {
3
+ SvelteComponent,
4
+ assign,
5
+ attr,
6
+ check_outros,
7
+ create_component,
8
+ destroy_component,
9
+ detach,
10
+ element,
11
+ empty,
12
+ get_spread_update,
13
+ group_outros,
14
+ init,
15
+ insert,
16
+ mount_component,
17
+ outro_and_destroy_block,
18
+ safe_not_equal,
19
+ transition_in,
20
+ transition_out,
21
+ update_keyed_each
22
+ } from "svelte/internal";
23
+
24
+ import RuleItem from './RuleItem';
25
+
26
+ function get_each_context(ctx, list, i) {
27
+ const child_ctx = ctx.slice();
28
+ child_ctx[7] = list[i][0];
29
+ child_ctx[8] = list[i][1];
30
+ return child_ctx;
31
+ }
32
+
33
+ // (12:2) {#each ruleLabelArray as [type, data] (type)}
34
+ function create_each_block(key_1, ctx) {
35
+ let first;
36
+ let ruleitem;
37
+ let current;
38
+
39
+ const ruleitem_spread_levels = [
40
+ {
41
+ type: /*type*/ ctx[7],
42
+ data: /*data*/ ctx[8],
43
+ pxmm: /*pxmm*/ ctx[0],
44
+ bounding: /*bounding*/ ctx[2]
45
+ }
46
+ ];
47
+
48
+ let ruleitem_props = {};
49
+
50
+ for (let i = 0; i < ruleitem_spread_levels.length; i += 1) {
51
+ ruleitem_props = assign(ruleitem_props, ruleitem_spread_levels[i]);
52
+ }
53
+
54
+ ruleitem = new RuleItem({ props: ruleitem_props });
55
+
56
+ return {
57
+ key: key_1,
58
+ first: null,
59
+ c() {
60
+ first = empty();
61
+ create_component(ruleitem.$$.fragment);
62
+ this.first = first;
63
+ },
64
+ m(target, anchor) {
65
+ insert(target, first, anchor);
66
+ mount_component(ruleitem, target, anchor);
67
+ current = true;
68
+ },
69
+ p(new_ctx, dirty) {
70
+ ctx = new_ctx;
71
+
72
+ const ruleitem_changes = (dirty & /*ruleLabelArray, pxmm, bounding*/ 7)
73
+ ? get_spread_update(ruleitem_spread_levels, [
74
+ {
75
+ type: /*type*/ ctx[7],
76
+ data: /*data*/ ctx[8],
77
+ pxmm: /*pxmm*/ ctx[0],
78
+ bounding: /*bounding*/ ctx[2]
79
+ }
80
+ ])
81
+ : {};
82
+
83
+ ruleitem.$set(ruleitem_changes);
84
+ },
85
+ i(local) {
86
+ if (current) return;
87
+ transition_in(ruleitem.$$.fragment, local);
88
+ current = true;
89
+ },
90
+ o(local) {
91
+ transition_out(ruleitem.$$.fragment, local);
92
+ current = false;
93
+ },
94
+ d(detaching) {
95
+ if (detaching) detach(first);
96
+ destroy_component(ruleitem, detaching);
97
+ }
98
+ };
99
+ }
100
+
101
+ function create_fragment(ctx) {
102
+ let div;
103
+ let each_blocks = [];
104
+ let each_1_lookup = new Map();
105
+ let current;
106
+ let each_value = /*ruleLabelArray*/ ctx[1];
107
+ const get_key = ctx => /*type*/ ctx[7];
108
+
109
+ for (let i = 0; i < each_value.length; i += 1) {
110
+ let child_ctx = get_each_context(ctx, each_value, i);
111
+ let key = get_key(child_ctx);
112
+ each_1_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
113
+ }
114
+
115
+ return {
116
+ c() {
117
+ div = element("div");
118
+
119
+ for (let i = 0; i < each_blocks.length; i += 1) {
120
+ each_blocks[i].c();
121
+ }
122
+
123
+ attr(div, "class", "floorplan-plugin__rulelabels");
124
+ },
125
+ m(target, anchor) {
126
+ insert(target, div, anchor);
127
+
128
+ for (let i = 0; i < each_blocks.length; i += 1) {
129
+ each_blocks[i].m(div, null);
130
+ }
131
+
132
+ current = true;
133
+ },
134
+ p(ctx, [dirty]) {
135
+ if (dirty & /*ruleLabelArray, pxmm, bounding*/ 7) {
136
+ each_value = /*ruleLabelArray*/ ctx[1];
137
+ group_outros();
138
+ each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, outro_and_destroy_block, create_each_block, null, get_each_context);
139
+ check_outros();
140
+ }
141
+ },
142
+ i(local) {
143
+ if (current) return;
144
+
145
+ for (let i = 0; i < each_value.length; i += 1) {
146
+ transition_in(each_blocks[i]);
147
+ }
148
+
149
+ current = true;
150
+ },
151
+ o(local) {
152
+ for (let i = 0; i < each_blocks.length; i += 1) {
153
+ transition_out(each_blocks[i]);
154
+ }
155
+
156
+ current = false;
157
+ },
158
+ d(detaching) {
159
+ if (detaching) detach(div);
160
+
161
+ for (let i = 0; i < each_blocks.length; i += 1) {
162
+ each_blocks[i].d();
163
+ }
164
+ }
165
+ };
166
+ }
167
+
168
+ function instance($$self, $$props, $$invalidate) {
169
+ let bounding;
170
+ let ruleLabelData;
171
+ let ruleLabelDataKeys;
172
+ let ruleLabelArray;
173
+ let { pxmm } = $$props;
174
+ let { floorIndex } = $$props;
175
+ let { floorplanData } = $$props;
176
+
177
+ $$self.$$set = $$props => {
178
+ if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
179
+ if ('floorIndex' in $$props) $$invalidate(3, floorIndex = $$props.floorIndex);
180
+ if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
181
+ };
182
+
183
+ $$self.$$.update = () => {
184
+ if ($$self.$$.dirty & /*floorplanData*/ 16) {
185
+ $: $$invalidate(2, bounding = floorplanData.bounding);
186
+ }
187
+
188
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 24) {
189
+ $: $$invalidate(5, ruleLabelData = floorplanData.floorDatas[floorIndex].rules);
190
+ }
191
+
192
+ if ($$self.$$.dirty & /*ruleLabelData*/ 32) {
193
+ $: $$invalidate(6, ruleLabelDataKeys = Object.keys(ruleLabelData));
194
+ }
195
+
196
+ if ($$self.$$.dirty & /*ruleLabelDataKeys, ruleLabelData*/ 96) {
197
+ $: $$invalidate(1, ruleLabelArray = ruleLabelDataKeys.map(key => [key, ruleLabelData[key]]));
198
+ }
199
+ };
200
+
201
+ return [
202
+ pxmm,
203
+ ruleLabelArray,
204
+ bounding,
205
+ floorIndex,
206
+ floorplanData,
207
+ ruleLabelData,
208
+ ruleLabelDataKeys
209
+ ];
210
+ }
211
+
212
+ class Component extends SvelteComponent {
213
+ constructor(options) {
214
+ super();
215
+ init(this, options, instance, create_fragment, safe_not_equal, { pxmm: 0, floorIndex: 3, floorplanData: 4 });
216
+ }
217
+ }
218
+
219
+ export default Component;
@@ -0,0 +1 @@
1
+ export declare function useFivePlugin<T extends (...args: any) => any>(name: string): ReturnType<T>;
@@ -0,0 +1,8 @@
1
+ import { unsafe__useFiveInstance } from '@realsee/five/react';
2
+ export function useFivePlugin(name) {
3
+ const five = unsafe__useFiveInstance();
4
+ const plugin = five.plugins[name];
5
+ if (!plugin)
6
+ throw new Error(`can not find plugin "${name}"`);
7
+ return plugin;
8
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 函数防抖:指触发事件后,在 `n` 秒内函数只能执行一次,如果触发事件后在 `n` 秒内又触发了事件,则会重新计算函数延执行时间。
3
+ * @param callback 回调函数
4
+ * @param waitFor 等待时间
5
+ * @returns
6
+ */
7
+ export declare const useDebounce: <F extends (...args: any) => any>(callback: F, waitFor?: number) => (...args: Parameters<F>) => ReturnType<F>;
8
+ export default useDebounce;
@@ -0,0 +1,22 @@
1
+ import { useRef, useEffect, useCallback } from 'react';
2
+ /**
3
+ * 函数防抖:指触发事件后,在 `n` 秒内函数只能执行一次,如果触发事件后在 `n` 秒内又触发了事件,则会重新计算函数延执行时间。
4
+ * @param callback 回调函数
5
+ * @param waitFor 等待时间
6
+ * @returns
7
+ */
8
+ export const useDebounce = (callback, waitFor = 200) => {
9
+ const timer = useRef();
10
+ const savedFunc = useRef(callback);
11
+ useEffect(() => {
12
+ savedFunc.current = callback;
13
+ }, [waitFor]);
14
+ return useCallback((...args) => {
15
+ if (timer.current) {
16
+ clearTimeout(timer.current);
17
+ timer.current = null;
18
+ }
19
+ timer.current = setTimeout(() => savedFunc.current?.(...args), waitFor);
20
+ }, []);
21
+ };
22
+ export default useDebounce;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 函数节流:控制频率,限制在 `n` 秒时间。
3
+ * @param callback 回调函数
4
+ * @param waitFor 等待时间
5
+ * @returns
6
+ */
7
+ export declare const useThrottle: <F extends (...args: any) => any>(callback: F, waitFor: number) => (...args: Parameters<F>) => ReturnType<F>;
8
+ export default useThrottle;
@@ -0,0 +1,25 @@
1
+ import { useRef, useEffect, useCallback } from 'react';
2
+ /**
3
+ * 函数节流:控制频率,限制在 `n` 秒时间。
4
+ * @param callback 回调函数
5
+ * @param waitFor 等待时间
6
+ * @returns
7
+ */
8
+ export const useThrottle = (callback, waitFor) => {
9
+ const timer = useRef();
10
+ const savedFunc = useRef(callback);
11
+ useEffect(() => {
12
+ savedFunc.current = callback;
13
+ }, [waitFor]);
14
+ return useCallback((...args) => {
15
+ if (timer.current)
16
+ return;
17
+ savedFunc.current?.(...args);
18
+ timer.current = setTimeout(() => {
19
+ if (timer.current)
20
+ clearTimeout(timer.current);
21
+ timer.current = null;
22
+ }, waitFor);
23
+ }, []);
24
+ };
25
+ export default useThrottle;
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "repository": "https://github.com/realsee-developer/dnalogel.git",
9
9
  "description": "如视 VR 看房插件合集",
10
10
  "private": false,
11
- "version": "2.0.0-alpha.34",
11
+ "version": "2.0.0-alpha.35",
12
12
  "license": "SEE LICENSE IN TERMS.txt",
13
13
  "scripts": {
14
14
  "build": "yarn run tsb && yarn run build:rollup && yarn run build:components && yarn build:docs",