@realsee/dnalogel 2.0.0-alpha.29 → 2.0.0-alpha.30

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 (197) hide show
  1. package/CHANGELOG.md +8 -1
  2. package/dist/ItemLabelPlugin/Plugin.d.ts +4 -0
  3. package/dist/ItemLabelPlugin/events.type.d.ts +9 -0
  4. package/dist/ItemLabelPlugin/index.d.ts +9 -0
  5. package/dist/ItemLabelPlugin/index.js +922 -0
  6. package/dist/ItemLabelPlugin/typings.d.ts +59 -0
  7. package/dist/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
  8. package/dist/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
  9. package/dist/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
  10. package/dist/ItemLabelPlugin/utils/parseData.d.ts +3 -0
  11. package/dist/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
  12. package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +5 -2
  13. package/dist/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
  14. package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -0
  15. package/dist/PanoMeasurePlugin/Controller/index.d.ts +17 -8
  16. package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +1 -1
  17. package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +1 -1
  18. package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +3 -0
  19. package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +49 -14
  20. package/dist/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
  21. package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +4 -0
  22. package/dist/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
  23. package/dist/PanoMeasurePlugin/Modules/UIController/style.d.ts +2 -0
  24. package/dist/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
  25. package/dist/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
  26. package/dist/PanoMeasurePlugin/index.d.ts +8 -5
  27. package/dist/PanoMeasurePlugin/index.js +1893 -3431
  28. package/dist/PanoMeasurePlugin/typings/data.d.ts +4 -0
  29. package/dist/PanoMeasurePlugin/typings/event.type.d.ts +10 -1
  30. package/dist/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
  31. package/dist/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -2
  32. package/dist/floorplan/ModelFloorplanPlugin/index.js +3 -3
  33. package/dist/floorplan/TopviewFloorplanPlugin/index.js +3 -3
  34. package/dist/index.d.ts +1 -0
  35. package/dist/index.es.js +4939 -5627
  36. package/dist/index.js +5607 -6291
  37. package/dist/index.umd.js +5610 -6295
  38. package/dist/shared-utils/index.d.ts +1 -0
  39. package/dist/shared-utils/math/Interval.d.ts +13 -0
  40. package/dist/shared-utils/math/Rectangle.d.ts +27 -0
  41. package/dist/shared-utils/math/index.d.ts +2 -0
  42. package/docs/assets/search.js +1 -1
  43. package/docs/classes/Magnifier.html +9 -0
  44. package/docs/classes/ModelRoomLabelController.html +5 -5
  45. package/docs/classes/PanoFloorplanRadarPluginController.html +2 -2
  46. package/docs/enums/CameraMovementEffect.html +2 -2
  47. package/docs/enums/DIRECTION.html +1 -1
  48. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
  49. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  50. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -0
  51. package/docs/enums/ModelFloorplanErrorType.html +1 -1
  52. package/docs/enums/Rotation.html +2 -2
  53. package/docs/index.html +2 -2
  54. package/docs/interfaces/CSS3DRenderPluginExportType.html +3 -3
  55. package/docs/interfaces/CameraMovementPluginExportType.html +3 -3
  56. package/docs/interfaces/FloorplanBounding.html +5 -5
  57. package/docs/interfaces/FloorplanData.html +2 -2
  58. package/docs/interfaces/FloorplanEntrance.html +8 -8
  59. package/docs/interfaces/FloorplanExtraObject.html +4 -4
  60. package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
  61. package/docs/interfaces/FloorplanFloorData.html +2 -2
  62. package/docs/interfaces/FloorplanImagePosition.html +2 -2
  63. package/docs/interfaces/FloorplanObserver.html +2 -2
  64. package/docs/interfaces/FloorplanOutlineItem.html +2 -2
  65. package/docs/interfaces/FloorplanPosition.html +2 -2
  66. package/docs/interfaces/FloorplanRoomItem.html +7 -7
  67. package/docs/interfaces/FloorplanRoomLabelItem.html +4 -4
  68. package/docs/interfaces/FloorplanServerBounding.html +5 -5
  69. package/docs/interfaces/FloorplanServerComputedData.html +1 -1
  70. package/docs/interfaces/FloorplanServerData.html +2 -2
  71. package/docs/interfaces/FloorplanServerEntrance.html +8 -8
  72. package/docs/interfaces/FloorplanServerFloorData.html +2 -2
  73. package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
  74. package/docs/interfaces/FloorplanServerObserver.html +2 -2
  75. package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
  76. package/docs/interfaces/FloorplanServerPosition.html +2 -2
  77. package/docs/interfaces/FloorplanServerRoomItem.html +8 -8
  78. package/docs/interfaces/FloorplanServerRoomLabelItem.html +4 -4
  79. package/docs/interfaces/ItemLabelPluginData.html +1 -0
  80. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -0
  81. package/docs/interfaces/ItemLabelPluginParametersType.html +1 -0
  82. package/docs/interfaces/LineJson.html +1 -1
  83. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  84. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  85. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  86. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  87. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  88. package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
  89. package/docs/interfaces/ModelFloorplanViewEvent.html +3 -3
  90. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  91. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  92. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  93. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  94. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  95. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  96. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  97. package/docs/interfaces/ModelViewPluginExportType.html +1 -1
  98. package/docs/interfaces/OpenParameter.html +3 -0
  99. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  100. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  101. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  102. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
  103. package/docs/interfaces/PanoFloorplanRadarPluginControllerParameter.html +1 -1
  104. package/docs/interfaces/PanoMeasureParameterType.html +1 -0
  105. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  106. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  107. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  108. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
  109. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
  110. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  111. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
  112. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  113. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
  114. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  115. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
  116. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
  117. package/docs/interfaces/Point.html +1 -1
  118. package/docs/interfaces/PointJson.html +1 -1
  119. package/docs/interfaces/Room.html +1 -1
  120. package/docs/interfaces/RoomInfo.html +1 -1
  121. package/docs/interfaces/RoomLabel.html +7 -7
  122. package/docs/interfaces/RoomRules.html +1 -1
  123. package/docs/interfaces/Rooms.html +1 -1
  124. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +10 -10
  125. package/docs/modules.html +20 -20
  126. package/libs/ItemLabelPlugin/ItemLabelComponent.js +558 -0
  127. package/libs/ItemLabelPlugin/ItemLabelItem.js +228 -0
  128. package/libs/ItemLabelPlugin/Plugin.d.ts +4 -0
  129. package/libs/ItemLabelPlugin/Plugin.js +120 -0
  130. package/libs/ItemLabelPlugin/events.type.d.ts +9 -0
  131. package/libs/ItemLabelPlugin/events.type.js +1 -0
  132. package/libs/ItemLabelPlugin/index.d.ts +9 -0
  133. package/libs/ItemLabelPlugin/index.js +8 -0
  134. package/libs/ItemLabelPlugin/typings.d.ts +59 -0
  135. package/libs/ItemLabelPlugin/typings.js +7 -0
  136. package/libs/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
  137. package/libs/ItemLabelPlugin/utils/getLabelTransform.js +3 -0
  138. package/libs/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
  139. package/libs/ItemLabelPlugin/utils/getStrokeLength.js +16 -0
  140. package/libs/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
  141. package/libs/ItemLabelPlugin/utils/isImpacted.js +12 -0
  142. package/libs/ItemLabelPlugin/utils/parseData.d.ts +3 -0
  143. package/libs/ItemLabelPlugin/utils/parseData.js +4 -0
  144. package/libs/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
  145. package/libs/ItemLabelPlugin/utils/transform2RenderData.js +4 -0
  146. package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +5 -2
  147. package/libs/PanoMeasurePlugin/Controller/BaseController.js +9 -1
  148. package/libs/PanoMeasurePlugin/Controller/EditController.js +4 -4
  149. package/libs/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
  150. package/libs/PanoMeasurePlugin/Controller/MixedController.js +337 -0
  151. package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -0
  152. package/libs/PanoMeasurePlugin/Controller/WatchController.js +14 -3
  153. package/libs/PanoMeasurePlugin/Controller/index.d.ts +17 -8
  154. package/libs/PanoMeasurePlugin/Controller/index.js +57 -18
  155. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +1 -1
  156. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +11 -14
  157. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +1 -1
  158. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +1 -1
  159. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +3 -0
  160. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +48 -11
  161. package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +49 -14
  162. package/libs/PanoMeasurePlugin/Modules/Magnifier.js +185 -60
  163. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +1 -1
  164. package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
  165. package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.js +98 -0
  166. package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +4 -0
  167. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +24 -7
  168. package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
  169. package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +80 -0
  170. package/libs/PanoMeasurePlugin/Modules/UIController/style.d.ts +2 -0
  171. package/libs/PanoMeasurePlugin/Modules/UIController/style.js +10 -1
  172. package/libs/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
  173. package/libs/PanoMeasurePlugin/Modules/rangePiece/html.js +64 -0
  174. package/libs/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
  175. package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +265 -0
  176. package/libs/PanoMeasurePlugin/index.d.ts +8 -5
  177. package/libs/PanoMeasurePlugin/index.js +2 -0
  178. package/libs/PanoMeasurePlugin/typings/data.d.ts +4 -0
  179. package/libs/PanoMeasurePlugin/typings/event.type.d.ts +10 -1
  180. package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
  181. package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.js +15 -0
  182. package/libs/PanoMeasurePlugin/utils/constants.js +7 -7
  183. package/libs/PanoMeasurePlugin/utils/distanceDom.js +19 -14
  184. package/libs/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -2
  185. package/libs/PanoMeasurePlugin/utils/mouseGroup.js +5 -6
  186. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +3 -3
  187. package/libs/index.d.ts +1 -0
  188. package/libs/index.js +2 -1
  189. package/libs/shared-utils/index.d.ts +1 -0
  190. package/libs/shared-utils/index.js +1 -0
  191. package/libs/shared-utils/math/Interval.d.ts +13 -0
  192. package/libs/shared-utils/math/Interval.js +40 -0
  193. package/libs/shared-utils/math/Rectangle.d.ts +27 -0
  194. package/libs/shared-utils/math/Rectangle.js +50 -0
  195. package/libs/shared-utils/math/index.d.ts +2 -0
  196. package/libs/shared-utils/math/index.js +2 -0
  197. package/package.json +3 -1
@@ -0,0 +1,228 @@
1
+ /* generated by Svelte v3.47.0 */
2
+ import {
3
+ SvelteComponent,
4
+ append,
5
+ append_styles,
6
+ attr,
7
+ detach,
8
+ element,
9
+ init,
10
+ insert,
11
+ listen,
12
+ noop,
13
+ null_to_empty,
14
+ safe_not_equal,
15
+ set_data,
16
+ set_style,
17
+ space,
18
+ text
19
+ } from "svelte/internal";
20
+
21
+ import "./events.type";
22
+ import classNames from 'classnames';
23
+
24
+ function add_css(target) {
25
+ append_styles(target, "svelte-1gam1w3", ".item-label-item.svelte-1gam1w3.svelte-1gam1w3{position:absolute;z-index:0;transform:none;cursor:pointer;pointer-events:none;user-select:none;animation:svelte-1gam1w3-fadeIn .3s ease-in}.item-label-item.fold.svelte-1gam1w3>.item-label-item__text-wrap.svelte-1gam1w3{visibility:hidden}.item-label-item.fold.svelte-1gam1w3>.item-label-item__bar.anchor.svelte-1gam1w3{visibility:hidden}.item-label-item.fold.svelte-1gam1w3>.item-label-item__bar.anchor.svelte-1gam1w3:after{visibility:visible}.item-label-item__text-wrap.svelte-1gam1w3.svelte-1gam1w3{height:fit-content;padding:12px 20px 12px 12px;position:absolute;width:max-content;max-width:473px;min-height:92px;background-image:linear-gradient(269deg, rgba(0, 0, 0, 0.50) 0%, rgba(0, 0, 0, 0.60) 49%, rgba(31, 38, 46, 0.70) 100%);border:1.5px solid rgba(255, 255, 255, .65);border-radius:3px;color:white;transform:translate(-50%, 0);display:flex;justify-content:flex-start;align-items:center;box-sizing:border-box;overflow:hidden;pointer-events:all}.icon-wrap.svelte-1gam1w3.svelte-1gam1w3{width:68px;height:100%;display:flex;justify-content:center;align-content:center}.icon.svelte-1gam1w3.svelte-1gam1w3{width:68px;height:68px;background-repeat:no-repeat;background-size:contain;background-position:center}.item-label-text.svelte-1gam1w3.svelte-1gam1w3{margin-left:12px;padding-left:12px;min-height:68px;height:auto;display:flex;flex-flow:column;justify-content:space-around;align-content:flex-start;border-left:solid rgba(255, 255, 255, .2) 1px;border-top:solid rgba(255, 255, 255, .2) 0;border-right:solid rgba(255, 255, 255, .2) 0;border-bottom:solid rgba(255, 255, 255, .2) 0;pointer-events:auto}.item-model.svelte-1gam1w3.svelte-1gam1w3{white-space:nowrap;font-size:22px;font-weight:bold;line-height:30px}.item-name.svelte-1gam1w3.svelte-1gam1w3{height:auto;word-wrap:break-word;word-break:break-all;font-size:20px;line-height:28px}.item-label-item__bar.svelte-1gam1w3.svelte-1gam1w3{position:absolute;bottom:0;width:3px;background-image:linear-gradient(to bottom, white, rgba(255, 255, 255, 0));box-shadow:0 2px 8px 0 rgba(0, 0, 0, 0.20);pointer-events:none}.item-label-item__bar.anchor.svelte-1gam1w3.svelte-1gam1w3:after{content:'';position:absolute;bottom:0;width:24px;height:24px;background-image:url(\"//vrlab-public.ljcdn.com/common/file/web/67e7a198-28c9-47dc-879b-507bd3ae600c.png \");background-position:center;background-size:contain;transform:translate(-10.5px, 50%)}@keyframes svelte-1gam1w3-fadeIn{from{opacity:0\n }to{opacity:1\n }}");
26
+ }
27
+
28
+ // (21:2) {#if itemLabel.icon}
29
+ function create_if_block(ctx) {
30
+ let div1;
31
+ let div0;
32
+ let div0_style_value;
33
+ let mounted;
34
+ let dispose;
35
+
36
+ return {
37
+ c() {
38
+ div1 = element("div");
39
+ div0 = element("div");
40
+ attr(div0, "class", "icon svelte-1gam1w3");
41
+ attr(div0, "style", div0_style_value = `background-image: url(${/*itemLabel*/ ctx[0].icon ?? defaultIcon})`);
42
+ attr(div1, "class", "icon-wrap svelte-1gam1w3");
43
+ },
44
+ m(target, anchor) {
45
+ insert(target, div1, anchor);
46
+ append(div1, div0);
47
+
48
+ if (!mounted) {
49
+ dispose = listen(div1, "click", /*click_handler*/ ctx[5]);
50
+ mounted = true;
51
+ }
52
+ },
53
+ p(ctx, dirty) {
54
+ if (dirty & /*itemLabel*/ 1 && div0_style_value !== (div0_style_value = `background-image: url(${/*itemLabel*/ ctx[0].icon ?? defaultIcon})`)) {
55
+ attr(div0, "style", div0_style_value);
56
+ }
57
+ },
58
+ d(detaching) {
59
+ if (detaching) detach(div1);
60
+ mounted = false;
61
+ dispose();
62
+ }
63
+ };
64
+ }
65
+
66
+ function create_fragment(ctx) {
67
+ let div3;
68
+ let div1;
69
+ let t0;
70
+ let div0;
71
+ let span0;
72
+ let t1_value = (/*itemLabel*/ ctx[0].code ?? /*itemLabel*/ ctx[0].id) + "";
73
+ let t1;
74
+ let t2;
75
+ let span1;
76
+ let t3_value = /*itemLabel*/ ctx[0].name + "";
77
+ let t3;
78
+ let div1_class_value;
79
+ let t4;
80
+ let div2;
81
+ let div2_class_value;
82
+ let div3_class_value;
83
+ let mounted;
84
+ let dispose;
85
+ let if_block = /*itemLabel*/ ctx[0].icon && create_if_block(ctx);
86
+
87
+ return {
88
+ c() {
89
+ div3 = element("div");
90
+ div1 = element("div");
91
+ if (if_block) if_block.c();
92
+ t0 = space();
93
+ div0 = element("div");
94
+ span0 = element("span");
95
+ t1 = text(t1_value);
96
+ t2 = space();
97
+ span1 = element("span");
98
+ t3 = text(t3_value);
99
+ t4 = space();
100
+ div2 = element("div");
101
+ attr(span0, "class", "item-model svelte-1gam1w3");
102
+ attr(span1, "class", "item-name svelte-1gam1w3");
103
+ attr(div0, "class", "item-label-text svelte-1gam1w3");
104
+ attr(div1, "class", div1_class_value = "" + (null_to_empty(classNames("item-label-item__text-wrap")) + " svelte-1gam1w3"));
105
+ set_style(div1, "bottom", `${/*itemLabel*/ ctx[0].strokeLength}px`);
106
+ attr(div2, "class", div2_class_value = "" + (null_to_empty(classNames("item-label-item__bar", { anchor: /*anchorEnabled*/ ctx[1] })) + " svelte-1gam1w3"));
107
+ set_style(div2, "height", `${/*itemLabel*/ ctx[0].strokeLength}px`);
108
+ attr(div3, "class", div3_class_value = "" + (null_to_empty(classNames("item-label-item", { fold: /*itemLabel*/ ctx[0].isFold })) + " svelte-1gam1w3"));
109
+ set_style(div3, "z-index", /*itemLabel*/ ctx[0].zIndex, false);
110
+ set_style(div3, "transform", /*itemLabel*/ ctx[0].transform, false);
111
+ },
112
+ m(target, anchor) {
113
+ insert(target, div3, anchor);
114
+ append(div3, div1);
115
+ if (if_block) if_block.m(div1, null);
116
+ append(div1, t0);
117
+ append(div1, div0);
118
+ append(div0, span0);
119
+ append(span0, t1);
120
+ append(div0, t2);
121
+ append(div0, span1);
122
+ append(span1, t3);
123
+ append(div3, t4);
124
+ append(div3, div2);
125
+
126
+ if (!mounted) {
127
+ dispose = listen(div1, "click", /*onClick*/ ctx[3]);
128
+ mounted = true;
129
+ }
130
+ },
131
+ p(ctx, [dirty]) {
132
+ if (/*itemLabel*/ ctx[0].icon) {
133
+ if (if_block) {
134
+ if_block.p(ctx, dirty);
135
+ } else {
136
+ if_block = create_if_block(ctx);
137
+ if_block.c();
138
+ if_block.m(div1, t0);
139
+ }
140
+ } else if (if_block) {
141
+ if_block.d(1);
142
+ if_block = null;
143
+ }
144
+
145
+ if (dirty & /*itemLabel*/ 1 && t1_value !== (t1_value = (/*itemLabel*/ ctx[0].code ?? /*itemLabel*/ ctx[0].id) + "")) set_data(t1, t1_value);
146
+ if (dirty & /*itemLabel*/ 1 && t3_value !== (t3_value = /*itemLabel*/ ctx[0].name + "")) set_data(t3, t3_value);
147
+
148
+ if (dirty & /*itemLabel*/ 1) {
149
+ set_style(div1, "bottom", `${/*itemLabel*/ ctx[0].strokeLength}px`);
150
+ }
151
+
152
+ if (dirty & /*anchorEnabled*/ 2 && div2_class_value !== (div2_class_value = "" + (null_to_empty(classNames("item-label-item__bar", { anchor: /*anchorEnabled*/ ctx[1] })) + " svelte-1gam1w3"))) {
153
+ attr(div2, "class", div2_class_value);
154
+ }
155
+
156
+ if (dirty & /*itemLabel*/ 1) {
157
+ set_style(div2, "height", `${/*itemLabel*/ ctx[0].strokeLength}px`);
158
+ }
159
+
160
+ if (dirty & /*itemLabel*/ 1 && div3_class_value !== (div3_class_value = "" + (null_to_empty(classNames("item-label-item", { fold: /*itemLabel*/ ctx[0].isFold })) + " svelte-1gam1w3"))) {
161
+ attr(div3, "class", div3_class_value);
162
+ }
163
+
164
+ if (dirty & /*itemLabel*/ 1) {
165
+ set_style(div3, "z-index", /*itemLabel*/ ctx[0].zIndex, false);
166
+ }
167
+
168
+ if (dirty & /*itemLabel*/ 1) {
169
+ set_style(div3, "transform", /*itemLabel*/ ctx[0].transform, false);
170
+ }
171
+ },
172
+ i: noop,
173
+ o: noop,
174
+ d(detaching) {
175
+ if (detaching) detach(div3);
176
+ if (if_block) if_block.d();
177
+ mounted = false;
178
+ dispose();
179
+ }
180
+ };
181
+ }
182
+
183
+ const defaultIcon = '//vrlab-public.ljcdn.com/common/file/web/c8591aaa-e62b-4e31-8fed-671483ace37f.svg\n';
184
+
185
+ function instance($$self, $$props, $$invalidate) {
186
+ let { itemLabel } = $$props;
187
+ let { hooks } = $$props;
188
+ let { anchorEnabled } = $$props;
189
+ let { onIconClick } = $$props;
190
+
191
+ function onClick() {
192
+ hooks.emit('onLabelClick', itemLabel);
193
+ }
194
+
195
+ const click_handler = e => onIconClick(itemLabel);
196
+
197
+ $$self.$$set = $$props => {
198
+ if ('itemLabel' in $$props) $$invalidate(0, itemLabel = $$props.itemLabel);
199
+ if ('hooks' in $$props) $$invalidate(4, hooks = $$props.hooks);
200
+ if ('anchorEnabled' in $$props) $$invalidate(1, anchorEnabled = $$props.anchorEnabled);
201
+ if ('onIconClick' in $$props) $$invalidate(2, onIconClick = $$props.onIconClick);
202
+ };
203
+
204
+ return [itemLabel, anchorEnabled, onIconClick, onClick, hooks, click_handler];
205
+ }
206
+
207
+ class Component extends SvelteComponent {
208
+ constructor(options) {
209
+ super();
210
+
211
+ init(
212
+ this,
213
+ options,
214
+ instance,
215
+ create_fragment,
216
+ safe_not_equal,
217
+ {
218
+ itemLabel: 0,
219
+ hooks: 4,
220
+ anchorEnabled: 1,
221
+ onIconClick: 2
222
+ },
223
+ add_css
224
+ );
225
+ }
226
+ }
227
+
228
+ export default Component;
@@ -0,0 +1,4 @@
1
+ import type { FivePlugin } from "@realsee/five";
2
+ import { ItemLabelPluginExportReturnsType, ItemLabelPluginParametersType } from "./typings";
3
+ export declare const Plugin: FivePlugin<ItemLabelPluginParametersType, ItemLabelPluginExportReturnsType>;
4
+ export default Plugin;
@@ -0,0 +1,120 @@
1
+ import { Subscribe } from "@realsee/five";
2
+ import ItemLabelComponent from './ItemLabelComponent';
3
+ import { ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE } from "./typings";
4
+ import { parseItemLabelPluginData } from "./utils/parseData";
5
+ const defaultMaxVisibleDistance = undefined;
6
+ export const Plugin = (five, params) => {
7
+ var _a, _b, _c;
8
+ const pluginState = {
9
+ container: document.createElement('div'),
10
+ data: null,
11
+ enabled: true,
12
+ fiveModeEnabled: true,
13
+ itemLabels: [],
14
+ wrapper: null,
15
+ app: undefined,
16
+ hooks: new Subscribe(),
17
+ modelOcclusionEnable: (_a = params === null || params === void 0 ? void 0 : params.modelOcclusionEnable) !== null && _a !== void 0 ? _a : true,
18
+ displayStrategyType: (_b = params === null || params === void 0 ? void 0 : params.displayStrategyType) !== null && _b !== void 0 ? _b : ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.SMALL,
19
+ maxVisibleDistance: (_c = params === null || params === void 0 ? void 0 : params.maxVisibleDistance) !== null && _c !== void 0 ? _c : defaultMaxVisibleDistance,
20
+ };
21
+ pluginState.container.setAttribute('class', 'item-label-plugin-container');
22
+ pluginState.container.style.cssText = `
23
+ position: absolute;
24
+ left: 0;
25
+ top: 0;
26
+ width: 100%;
27
+ height: 100%;
28
+ z-index: 5;
29
+ `;
30
+ pluginState.container.style.pointerEvents = 'none'; // 写到 cssText 里不生效
31
+ const appendTo = (wrapper) => {
32
+ pluginState.wrapper = wrapper;
33
+ wrapper.appendChild(pluginState.container);
34
+ render();
35
+ return true;
36
+ };
37
+ const load = (data) => {
38
+ pluginState.itemLabels = parseItemLabelPluginData(data);
39
+ render();
40
+ };
41
+ const enable = () => {
42
+ if (pluginState.enabled)
43
+ return true;
44
+ pluginState.enabled = true;
45
+ render();
46
+ return true;
47
+ };
48
+ const disable = () => {
49
+ if (!pluginState.enabled)
50
+ return true;
51
+ pluginState.enabled = false;
52
+ render();
53
+ return true;
54
+ };
55
+ const dispose = () => {
56
+ removeListener4Five();
57
+ pluginState.container.remove();
58
+ };
59
+ const render = () => {
60
+ var _a;
61
+ if (!pluginState.wrapper)
62
+ return;
63
+ // 只要不可展示,销毁容器
64
+ if (!pluginState.enabled || !pluginState.fiveModeEnabled) {
65
+ (_a = pluginState.app) === null || _a === void 0 ? void 0 : _a.$destroy();
66
+ pluginState.app = undefined;
67
+ return;
68
+ }
69
+ // 正常显示时,分为 app 存在和不存在两种情况,如果存在,传值,不存在则初始化并传值
70
+ if (!pluginState.app) {
71
+ pluginState.app = new ItemLabelComponent({
72
+ target: pluginState.container,
73
+ props: {
74
+ five: five,
75
+ modelOcclusionEnable: pluginState.modelOcclusionEnable,
76
+ itemLabels: pluginState.itemLabels,
77
+ wrapper: pluginState.wrapper,
78
+ hooks: pluginState.hooks,
79
+ displayStrategyType: pluginState.displayStrategyType,
80
+ maxVisibleDistance: pluginState.maxVisibleDistance
81
+ }
82
+ });
83
+ }
84
+ else {
85
+ pluginState.app.$set({
86
+ five: five,
87
+ itemLabels: pluginState.itemLabels
88
+ });
89
+ }
90
+ };
91
+ // 添加 five 监听
92
+ const addListener4Five = () => {
93
+ // five.on('modeChange', onFiveModeChange)
94
+ five.once('dispose', dispose);
95
+ };
96
+ // 取消 five 监听
97
+ const removeListener4Five = () => {
98
+ // five.off('modeChange', onFiveModeChange)
99
+ };
100
+ const onFiveModeChange = (mode) => {
101
+ if (!pluginState.enabled)
102
+ return;
103
+ pluginState.fiveModeEnabled = false;
104
+ render();
105
+ five.once('initAnimationEnded', () => {
106
+ pluginState.fiveModeEnabled = true;
107
+ render();
108
+ });
109
+ };
110
+ addListener4Five();
111
+ return {
112
+ appendTo,
113
+ load,
114
+ enable,
115
+ disable,
116
+ dispose,
117
+ hooks: pluginState.hooks
118
+ };
119
+ };
120
+ export default Plugin;
@@ -0,0 +1,9 @@
1
+ import type { SubscribeEventMap } from '@realsee/five';
2
+ import type { ItemLabel } from "./typings";
3
+ export interface ItemLabelEvent extends SubscribeEventMap {
4
+ /**
5
+ * 点击标签
6
+ */
7
+ onLabelClick: (itemLabel: ItemLabel) => void;
8
+ }
9
+ export declare type PluginEvent = ItemLabelEvent;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import ItemLabelPlugin from './Plugin';
2
+ export { ItemLabelPlugin };
3
+ export default ItemLabelPlugin;
4
+ export declare const itemLabelPluginServerParams: {
5
+ name: string;
6
+ version: number;
7
+ };
8
+ export type { ItemLabelPluginParametersType, ItemLabelPluginData, ItemLabelPluginExportReturnsType } from './typings';
9
+ export { ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE } from './typings';
@@ -0,0 +1,8 @@
1
+ import ItemLabelPlugin from './Plugin';
2
+ export { ItemLabelPlugin };
3
+ export default ItemLabelPlugin;
4
+ export const itemLabelPluginServerParams = {
5
+ name: 'ItemLabelPlugin',
6
+ version: 0,
7
+ };
8
+ export { ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE } from './typings';
@@ -0,0 +1,59 @@
1
+ import type { Subscribe } from "@realsee/five";
2
+ import type { PluginEvent } from "./events.type";
3
+ import type ItemLabelComponent from './ItemLabelComponent';
4
+ export declare enum ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE {
5
+ SMALL = "small",
6
+ MIDLLE = "middle",
7
+ LARGE = "large",
8
+ EXTRA_LARGE = "x-large"
9
+ }
10
+ export interface ItemLabelPluginParametersType {
11
+ maxVisibleDistance?: number;
12
+ modelOcclusionEnable?: boolean;
13
+ displayStrategyType?: Partial<ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE>;
14
+ }
15
+ export interface ItemLabelPluginData {
16
+ item_labels: Readonly<{
17
+ id: string;
18
+ code: string;
19
+ name: string;
20
+ position: [number, number, number];
21
+ type?: string[];
22
+ icon?: string;
23
+ [key: string]: any;
24
+ }>[];
25
+ }
26
+ export interface ItemLabel {
27
+ id: string;
28
+ code: string;
29
+ name: string;
30
+ position: [number, number, number];
31
+ modelPosition: [number, number, number];
32
+ type?: string[];
33
+ icon?: string;
34
+ observerIndex?: number | undefined;
35
+ visible?: boolean;
36
+ isFold?: boolean;
37
+ [key: string]: any;
38
+ }
39
+ export interface ItemLabelPluginExportReturnsType {
40
+ appendTo: (wrapper: Element) => void;
41
+ load: (data: ItemLabelPluginData) => void;
42
+ disable: () => void;
43
+ enable: () => void;
44
+ dispose: () => void;
45
+ hooks: Subscribe<PluginEvent>;
46
+ }
47
+ export interface ItemLabelPluginState {
48
+ container: HTMLDivElement;
49
+ data: ItemLabelPluginData | null;
50
+ enabled: boolean;
51
+ itemLabels: ItemLabel[];
52
+ wrapper: HTMLElement | null;
53
+ fiveModeEnabled: boolean;
54
+ app?: ItemLabelComponent | undefined;
55
+ hooks: Subscribe<PluginEvent>;
56
+ modelOcclusionEnable: boolean;
57
+ displayStrategyType: Partial<ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE>;
58
+ maxVisibleDistance: number | undefined;
59
+ }
@@ -0,0 +1,7 @@
1
+ export var ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE;
2
+ (function (ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE) {
3
+ ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE["SMALL"] = "small";
4
+ ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE["MIDLLE"] = "middle";
5
+ ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE["LARGE"] = "large";
6
+ ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE["EXTRA_LARGE"] = "x-large";
7
+ })(ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE || (ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE = {}));
@@ -0,0 +1 @@
1
+ export declare const getLabelTransform: (cssOffset: [number, number]) => string;
@@ -0,0 +1,3 @@
1
+ export const getLabelTransform = (cssOffset) => {
2
+ return `translate(${cssOffset[0]}px, ${cssOffset[1]}px)`;
3
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 展示策略
3
+ * */
4
+ import { ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE } from "../typings";
5
+ export declare const getStrokeLength: (itemSpaceHeight: number, type: ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE) => number;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * 展示策略
3
+ * */
4
+ import { ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE } from "../typings";
5
+ export const getStrokeLength = (itemSpaceHeight, type) => {
6
+ switch (type) {
7
+ case ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.SMALL:
8
+ return Math.ceil(-27.78 * itemSpaceHeight + 85);
9
+ case ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.MIDLLE:
10
+ return Math.ceil(-38.9 * itemSpaceHeight + 130);
11
+ case ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.LARGE:
12
+ return Math.ceil(-44.44 * itemSpaceHeight + 140);
13
+ case ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.EXTRA_LARGE:
14
+ return Math.ceil(-92.59 * itemSpaceHeight + 300);
15
+ }
16
+ };
@@ -0,0 +1,6 @@
1
+ import * as THREE from 'three';
2
+ import type { Five } from "@realsee/five";
3
+ /**
4
+ * 碰撞检测可见性
5
+ * */
6
+ export declare const isImpacted: (five: Five, sourceVector: THREE.Vector3, targetVector: THREE.Vector3, distance: number) => boolean;
@@ -0,0 +1,12 @@
1
+ import * as THREE from 'three';
2
+ const { Raycaster, Vector3 } = THREE;
3
+ /**
4
+ * 碰撞检测可见性
5
+ * */
6
+ export const isImpacted = (five, sourceVector, targetVector, distance) => {
7
+ const direction = sourceVector.clone().sub(targetVector).normalize();
8
+ const raycaster = new Raycaster();
9
+ raycaster.set(targetVector, direction);
10
+ const [intersection] = five.model.intersectRaycaster(raycaster);
11
+ return intersection && distance <= intersection.distance + 0.1;
12
+ };
@@ -0,0 +1,3 @@
1
+ import type { ItemLabelPluginData, ItemLabel } from '../typings';
2
+ /** @description 转成内部所需数据 */
3
+ export declare function parseItemLabelPluginData(data: ItemLabelPluginData): ItemLabel[];
@@ -0,0 +1,4 @@
1
+ /** @description 转成内部所需数据 */
2
+ export function parseItemLabelPluginData(data) {
3
+ return data.item_labels.map(label => (Object.assign({ modelPosition: [label.position[0], label.position[1], label.position[2]], observerIndex: undefined }, label)));
4
+ }
@@ -0,0 +1,3 @@
1
+ import type { ItemLabel } from '../typings';
2
+ /** @description 转成内部所需数据 */
3
+ export declare function transform2RenderData(data: any): ItemLabel[];
@@ -0,0 +1,4 @@
1
+ /** @description 转成内部所需数据 */
2
+ export function transform2RenderData(data) {
3
+ return data.map(label => (Object.assign({ observerIndex: undefined, visible: false, isFold: false }, label)));
4
+ }
@@ -3,9 +3,10 @@ import type Magnifier from '../Modules/Magnifier';
3
3
  import type FiveHelper from '../Modules/FiveHelper';
4
4
  import type { Group } from 'three';
5
5
  import type { Model } from '../Model';
6
- import type { PluginEvent } from '../typings/event.type';
6
+ import type { PanoMeasurePluginEvent } from '../typings/event.type';
7
7
  import type { UserDistanceItem } from '../utils/distanceDom';
8
8
  import type { Five, Intersection, IntersectMeshInterface, Subscribe } from '@realsee/five';
9
+ import type { OpenParameter } from '../typings/data';
9
10
  export interface IControllerParams {
10
11
  five: Five;
11
12
  group: Group;
@@ -14,7 +15,8 @@ export interface IControllerParams {
14
15
  container: Element;
15
16
  magnifier: Magnifier;
16
17
  fiveHelper: FiveHelper;
17
- hook: Subscribe<PluginEvent>;
18
+ openParams: OpenParameter;
19
+ hook: Subscribe<PanoMeasurePluginEvent>;
18
20
  userDistanceItemCreator?: () => UserDistanceItem;
19
21
  }
20
22
  export default abstract class BaseController {
@@ -22,6 +24,7 @@ export default abstract class BaseController {
22
24
  protected group: Group;
23
25
  protected model: Model;
24
26
  protected disposed: boolean;
27
+ protected isMobile: boolean;
25
28
  protected mouseGroup: Group;
26
29
  protected container: Element;
27
30
  protected fiveHelper: FiveHelper;
@@ -1,6 +1,7 @@
1
1
  import { preventDefault } from '../utils/ironbox';
2
2
  export default class BaseController {
3
3
  constructor(params) {
4
+ var _a, _b;
4
5
  Object.defineProperty(this, "five", {
5
6
  enumerable: true,
6
7
  configurable: true,
@@ -25,6 +26,12 @@ export default class BaseController {
25
26
  writable: true,
26
27
  value: false
27
28
  });
29
+ Object.defineProperty(this, "isMobile", {
30
+ enumerable: true,
31
+ configurable: true,
32
+ writable: true,
33
+ value: void 0
34
+ });
28
35
  Object.defineProperty(this, "mouseGroup", {
29
36
  enumerable: true,
30
37
  configurable: true,
@@ -76,6 +83,7 @@ export default class BaseController {
76
83
  this.magnifier = params.magnifier;
77
84
  this.container = params.container;
78
85
  this.fiveHelper = params.fiveHelper;
86
+ this.isMobile = (_b = (_a = params.openParams) === null || _a === void 0 ? void 0 : _a.isMobile) !== null && _b !== void 0 ? _b : false;
79
87
  this.userDistanceItemCreator = params.userDistanceItemCreator;
80
88
  // ==================== Groups ====================
81
89
  this.group = params.group;
@@ -113,7 +121,7 @@ export default class BaseController {
113
121
  }
114
122
  dispose() {
115
123
  this.disposed = true;
116
- this.magnifier.dispose();
124
+ this.magnifier.remove();
117
125
  this.model.lines.forEach((line) => this.removeLine(line));
118
126
  const fiveElement = this.five.getElement();
119
127
  if (fiveElement) {
@@ -80,7 +80,7 @@ export default class EditController extends BaseController {
80
80
  const position = this.updateMouseGroup(intersection, mesh).position;
81
81
  (_a = this.pressPoint) === null || _a === void 0 ? void 0 : _a.position.copy(position);
82
82
  this.updateDashed();
83
- requestAnimationFrame(() => this.magnifier.updateWithPoint(this.mouseGroup.position));
83
+ requestAnimationFrame(() => this.magnifier.renderWithPoint(this.mouseGroup.position));
84
84
  this.five.needsRender = true;
85
85
  }, 20)
86
86
  });
@@ -123,7 +123,7 @@ export default class EditController extends BaseController {
123
123
  // ============ revoke dashed ============
124
124
  this.updateDashed();
125
125
  // ============ revoke magnifier ============
126
- this.magnifier.dispose();
126
+ this.magnifier.remove();
127
127
  this.five.needsRender = true;
128
128
  }
129
129
  });
@@ -132,7 +132,7 @@ export default class EditController extends BaseController {
132
132
  configurable: true,
133
133
  writable: true,
134
134
  value: () => {
135
- this.magnifier.dispose();
135
+ this.magnifier.remove();
136
136
  this.group.remove(this.mouseGroup);
137
137
  this.hasAppendMouseGroup = false;
138
138
  if (this.lastPoint) {
@@ -220,7 +220,7 @@ export default class EditController extends BaseController {
220
220
  }
221
221
  this.pressPoint = undefined;
222
222
  this.hasAppendMouseGroup = false;
223
- this.magnifier.dispose();
223
+ this.magnifier.remove();
224
224
  this.group.remove(this.mouseGroup);
225
225
  this.updateDashed();
226
226
  this.five.needsRender = true;