@realsee/dnalogel 2.0.0-alpha.30-beta → 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 (183) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/ItemLabelPlugin/index.js +362 -143
  3. package/dist/ItemLabelPlugin/typings.d.ts +5 -0
  4. package/dist/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
  5. package/dist/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
  6. package/dist/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
  7. package/dist/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
  8. package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +5 -2
  9. package/dist/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
  10. package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -0
  11. package/dist/PanoMeasurePlugin/Controller/index.d.ts +17 -8
  12. package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +1 -1
  13. package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +1 -1
  14. package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +3 -0
  15. package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +49 -14
  16. package/dist/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
  17. package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +4 -0
  18. package/dist/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
  19. package/dist/PanoMeasurePlugin/Modules/UIController/style.d.ts +2 -0
  20. package/dist/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
  21. package/dist/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
  22. package/dist/PanoMeasurePlugin/index.d.ts +8 -5
  23. package/dist/PanoMeasurePlugin/index.js +1893 -3431
  24. package/dist/PanoMeasurePlugin/typings/data.d.ts +4 -0
  25. package/dist/PanoMeasurePlugin/typings/event.type.d.ts +10 -1
  26. package/dist/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
  27. package/dist/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -2
  28. package/dist/floorplan/ModelFloorplanPlugin/index.js +3 -3
  29. package/dist/floorplan/TopviewFloorplanPlugin/index.js +3 -3
  30. package/dist/index.es.js +1850 -3190
  31. package/dist/index.js +1784 -3122
  32. package/dist/index.umd.js +1787 -3126
  33. package/dist/shared-utils/index.d.ts +1 -0
  34. package/dist/shared-utils/math/Interval.d.ts +13 -0
  35. package/dist/shared-utils/math/Rectangle.d.ts +27 -0
  36. package/dist/shared-utils/math/index.d.ts +2 -0
  37. package/docs/assets/search.js +1 -1
  38. package/docs/classes/Magnifier.html +9 -0
  39. package/docs/classes/ModelRoomLabelController.html +5 -5
  40. package/docs/classes/PanoFloorplanRadarPluginController.html +2 -2
  41. package/docs/enums/CameraMovementEffect.html +2 -2
  42. package/docs/enums/DIRECTION.html +1 -1
  43. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
  44. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  45. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
  46. package/docs/enums/ModelFloorplanErrorType.html +1 -1
  47. package/docs/enums/Rotation.html +2 -2
  48. package/docs/index.html +2 -2
  49. package/docs/interfaces/CSS3DRenderPluginExportType.html +3 -3
  50. package/docs/interfaces/CameraMovementPluginExportType.html +3 -3
  51. package/docs/interfaces/FloorplanBounding.html +5 -5
  52. package/docs/interfaces/FloorplanData.html +2 -2
  53. package/docs/interfaces/FloorplanEntrance.html +8 -8
  54. package/docs/interfaces/FloorplanExtraObject.html +4 -4
  55. package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
  56. package/docs/interfaces/FloorplanFloorData.html +2 -2
  57. package/docs/interfaces/FloorplanImagePosition.html +2 -2
  58. package/docs/interfaces/FloorplanObserver.html +2 -2
  59. package/docs/interfaces/FloorplanOutlineItem.html +2 -2
  60. package/docs/interfaces/FloorplanPosition.html +2 -2
  61. package/docs/interfaces/FloorplanRoomItem.html +7 -7
  62. package/docs/interfaces/FloorplanRoomLabelItem.html +4 -4
  63. package/docs/interfaces/FloorplanServerBounding.html +5 -5
  64. package/docs/interfaces/FloorplanServerComputedData.html +1 -1
  65. package/docs/interfaces/FloorplanServerData.html +2 -2
  66. package/docs/interfaces/FloorplanServerEntrance.html +8 -8
  67. package/docs/interfaces/FloorplanServerFloorData.html +2 -2
  68. package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
  69. package/docs/interfaces/FloorplanServerObserver.html +2 -2
  70. package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
  71. package/docs/interfaces/FloorplanServerPosition.html +2 -2
  72. package/docs/interfaces/FloorplanServerRoomItem.html +8 -8
  73. package/docs/interfaces/FloorplanServerRoomLabelItem.html +4 -4
  74. package/docs/interfaces/ItemLabelPluginData.html +1 -1
  75. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
  76. package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
  77. package/docs/interfaces/LineJson.html +1 -1
  78. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  79. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  80. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  81. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  82. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  83. package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
  84. package/docs/interfaces/ModelFloorplanViewEvent.html +3 -3
  85. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  86. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  87. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  88. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  89. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  90. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  91. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  92. package/docs/interfaces/ModelViewPluginExportType.html +1 -1
  93. package/docs/interfaces/OpenParameter.html +3 -0
  94. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  95. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  96. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  97. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
  98. package/docs/interfaces/PanoFloorplanRadarPluginControllerParameter.html +1 -1
  99. package/docs/interfaces/PanoMeasureParameterType.html +1 -0
  100. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  101. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  102. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  103. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
  104. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
  105. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  106. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
  107. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  108. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
  109. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  110. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
  111. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
  112. package/docs/interfaces/Point.html +1 -1
  113. package/docs/interfaces/PointJson.html +1 -1
  114. package/docs/interfaces/Room.html +1 -1
  115. package/docs/interfaces/RoomInfo.html +1 -1
  116. package/docs/interfaces/RoomLabel.html +7 -7
  117. package/docs/interfaces/RoomRules.html +1 -1
  118. package/docs/interfaces/Rooms.html +1 -1
  119. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +10 -10
  120. package/docs/modules.html +20 -20
  121. package/libs/ItemLabelPlugin/ItemLabelComponent.js +211 -67
  122. package/libs/ItemLabelPlugin/ItemLabelItem.js +109 -54
  123. package/libs/ItemLabelPlugin/Plugin.js +7 -4
  124. package/libs/ItemLabelPlugin/typings.d.ts +5 -0
  125. package/libs/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
  126. package/libs/ItemLabelPlugin/utils/getLabelTransform.js +3 -0
  127. package/libs/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
  128. package/libs/ItemLabelPlugin/utils/getStrokeLength.js +16 -0
  129. package/libs/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
  130. package/libs/ItemLabelPlugin/utils/isImpacted.js +12 -0
  131. package/libs/ItemLabelPlugin/utils/parseData.js +1 -1
  132. package/libs/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
  133. package/libs/ItemLabelPlugin/utils/transform2RenderData.js +4 -0
  134. package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +5 -2
  135. package/libs/PanoMeasurePlugin/Controller/BaseController.js +9 -1
  136. package/libs/PanoMeasurePlugin/Controller/EditController.js +4 -4
  137. package/libs/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
  138. package/libs/PanoMeasurePlugin/Controller/MixedController.js +337 -0
  139. package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -0
  140. package/libs/PanoMeasurePlugin/Controller/WatchController.js +14 -3
  141. package/libs/PanoMeasurePlugin/Controller/index.d.ts +17 -8
  142. package/libs/PanoMeasurePlugin/Controller/index.js +57 -18
  143. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +1 -1
  144. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +11 -14
  145. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +1 -1
  146. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +1 -1
  147. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +3 -0
  148. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +48 -11
  149. package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +49 -14
  150. package/libs/PanoMeasurePlugin/Modules/Magnifier.js +185 -60
  151. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +1 -1
  152. package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
  153. package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.js +98 -0
  154. package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +4 -0
  155. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +24 -7
  156. package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
  157. package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +80 -0
  158. package/libs/PanoMeasurePlugin/Modules/UIController/style.d.ts +2 -0
  159. package/libs/PanoMeasurePlugin/Modules/UIController/style.js +10 -1
  160. package/libs/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
  161. package/libs/PanoMeasurePlugin/Modules/rangePiece/html.js +64 -0
  162. package/libs/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
  163. package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +265 -0
  164. package/libs/PanoMeasurePlugin/index.d.ts +8 -5
  165. package/libs/PanoMeasurePlugin/index.js +2 -0
  166. package/libs/PanoMeasurePlugin/typings/data.d.ts +4 -0
  167. package/libs/PanoMeasurePlugin/typings/event.type.d.ts +10 -1
  168. package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
  169. package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.js +15 -0
  170. package/libs/PanoMeasurePlugin/utils/constants.js +7 -7
  171. package/libs/PanoMeasurePlugin/utils/distanceDom.js +19 -14
  172. package/libs/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -2
  173. package/libs/PanoMeasurePlugin/utils/mouseGroup.js +5 -6
  174. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +3 -3
  175. package/libs/shared-utils/index.d.ts +1 -0
  176. package/libs/shared-utils/index.js +1 -0
  177. package/libs/shared-utils/math/Interval.d.ts +13 -0
  178. package/libs/shared-utils/math/Interval.js +40 -0
  179. package/libs/shared-utils/math/Rectangle.d.ts +27 -0
  180. package/libs/shared-utils/math/Rectangle.js +50 -0
  181. package/libs/shared-utils/math/index.d.ts +2 -0
  182. package/libs/shared-utils/math/index.js +2 -0
  183. package/package.json +2 -1
@@ -22,17 +22,52 @@ import "./events.type";
22
22
  import classNames from 'classnames';
23
23
 
24
24
  function add_css(target) {
25
- append_styles(target, "svelte-1u8wokx", ".item-label-item.svelte-1u8wokx{position:absolute;z-index:0;transform:none;cursor:pointer;pointer-events:none;user-select:none;opacity:0}.item-label-item.visible.svelte-1u8wokx{opacity:1;animation:svelte-1u8wokx-fadeIn .3s ease-in}.item-label-item__text-wrap.svelte-1u8wokx{height:fit-content;padding:12px 20px 12px 12px;position:absolute;width:max-content;max-width:473px;min-height:92px;pointer-events:none;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}.item-label-item__text-wrap.visible.svelte-1u8wokx{pointer-events:all}.icon-wrap.svelte-1u8wokx{width:68px;height:100%;display:flex;justify-content:center;align-content:center}.icon.svelte-1u8wokx{width:68px;height:68px;background-repeat:no-repeat;background-size:contain;background-position:center}.item-label-text.svelte-1u8wokx{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-1u8wokx{white-space:nowrap;font-size:22px;font-weight:bold;line-height:30px}.item-name.svelte-1u8wokx{height:auto;word-wrap:break-word;word-break:break-all;font-size:20px;line-height:28px}.item-label-item__bar.svelte-1u8wokx{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-1u8wokx: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-1u8wokx-fadeIn{from{opacity:0\n }to{opacity:1\n }}");
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
26
  }
27
27
 
28
- function create_fragment(ctx) {
29
- let div5;
30
- let div3;
28
+ // (21:2) {#if itemLabel.icon}
29
+ function create_if_block(ctx) {
31
30
  let div1;
32
31
  let div0;
33
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;
34
69
  let t0;
35
- let div2;
70
+ let div0;
36
71
  let span0;
37
72
  let t1_value = (/*itemLabel*/ ctx[0].code ?? /*itemLabel*/ ctx[0].id) + "";
38
73
  let t1;
@@ -40,103 +75,105 @@ function create_fragment(ctx) {
40
75
  let span1;
41
76
  let t3_value = /*itemLabel*/ ctx[0].name + "";
42
77
  let t3;
43
- let div3_class_value;
78
+ let div1_class_value;
44
79
  let t4;
45
- let div4;
46
- let div4_class_value;
47
- let div5_class_value;
80
+ let div2;
81
+ let div2_class_value;
82
+ let div3_class_value;
48
83
  let mounted;
49
84
  let dispose;
85
+ let if_block = /*itemLabel*/ ctx[0].icon && create_if_block(ctx);
50
86
 
51
87
  return {
52
88
  c() {
53
- div5 = element("div");
54
89
  div3 = element("div");
55
90
  div1 = element("div");
56
- div0 = element("div");
91
+ if (if_block) if_block.c();
57
92
  t0 = space();
58
- div2 = element("div");
93
+ div0 = element("div");
59
94
  span0 = element("span");
60
95
  t1 = text(t1_value);
61
96
  t2 = space();
62
97
  span1 = element("span");
63
98
  t3 = text(t3_value);
64
99
  t4 = space();
65
- div4 = element("div");
66
- attr(div0, "class", "icon svelte-1u8wokx");
67
- attr(div0, "style", div0_style_value = `background-image: url(${/*itemLabel*/ ctx[0].icon ?? defaultIcon})`);
68
- attr(div1, "class", "icon-wrap svelte-1u8wokx");
69
- attr(span0, "class", "item-model svelte-1u8wokx");
70
- attr(span1, "class", "item-name svelte-1u8wokx");
71
- attr(div2, "class", "item-label-text svelte-1u8wokx");
72
- attr(div3, "class", div3_class_value = "" + (null_to_empty(classNames("item-label-item__text-wrap", { visible: /*itemLabel*/ ctx[0].visible })) + " svelte-1u8wokx"));
73
- set_style(div3, "bottom", `${/*itemLabel*/ ctx[0].strokeLength}px`);
74
- attr(div4, "class", div4_class_value = "" + (null_to_empty(classNames("item-label-item__bar", { anchor: /*anchorEnabled*/ ctx[1] })) + " svelte-1u8wokx"));
75
- set_style(div4, "height", `${/*itemLabel*/ ctx[0].strokeLength}px`);
76
- attr(div5, "class", div5_class_value = "" + (null_to_empty(classNames("item-label-item", { visible: /*itemLabel*/ ctx[0].visible })) + " svelte-1u8wokx"));
77
- set_style(div5, "z-index", /*itemLabel*/ ctx[0].zIndex, false);
78
- set_style(div5, "transform", /*itemLabel*/ ctx[0].transform, false);
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);
79
111
  },
80
112
  m(target, anchor) {
81
- insert(target, div5, anchor);
82
- append(div5, div3);
113
+ insert(target, div3, anchor);
83
114
  append(div3, div1);
115
+ if (if_block) if_block.m(div1, null);
116
+ append(div1, t0);
84
117
  append(div1, div0);
85
- append(div3, t0);
86
- append(div3, div2);
87
- append(div2, span0);
118
+ append(div0, span0);
88
119
  append(span0, t1);
89
- append(div2, t2);
90
- append(div2, span1);
120
+ append(div0, t2);
121
+ append(div0, span1);
91
122
  append(span1, t3);
92
- append(div5, t4);
93
- append(div5, div4);
123
+ append(div3, t4);
124
+ append(div3, div2);
94
125
 
95
126
  if (!mounted) {
96
- dispose = listen(div3, "click", /*onClick*/ ctx[2]);
127
+ dispose = listen(div1, "click", /*onClick*/ ctx[3]);
97
128
  mounted = true;
98
129
  }
99
130
  },
100
131
  p(ctx, [dirty]) {
101
- if (dirty & /*itemLabel*/ 1 && div0_style_value !== (div0_style_value = `background-image: url(${/*itemLabel*/ ctx[0].icon ?? defaultIcon})`)) {
102
- attr(div0, "style", div0_style_value);
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;
103
143
  }
104
144
 
105
145
  if (dirty & /*itemLabel*/ 1 && t1_value !== (t1_value = (/*itemLabel*/ ctx[0].code ?? /*itemLabel*/ ctx[0].id) + "")) set_data(t1, t1_value);
106
146
  if (dirty & /*itemLabel*/ 1 && t3_value !== (t3_value = /*itemLabel*/ ctx[0].name + "")) set_data(t3, t3_value);
107
147
 
108
- if (dirty & /*itemLabel*/ 1 && div3_class_value !== (div3_class_value = "" + (null_to_empty(classNames("item-label-item__text-wrap", { visible: /*itemLabel*/ ctx[0].visible })) + " svelte-1u8wokx"))) {
109
- attr(div3, "class", div3_class_value);
110
- }
111
-
112
148
  if (dirty & /*itemLabel*/ 1) {
113
- set_style(div3, "bottom", `${/*itemLabel*/ ctx[0].strokeLength}px`);
149
+ set_style(div1, "bottom", `${/*itemLabel*/ ctx[0].strokeLength}px`);
114
150
  }
115
151
 
116
- if (dirty & /*anchorEnabled*/ 2 && div4_class_value !== (div4_class_value = "" + (null_to_empty(classNames("item-label-item__bar", { anchor: /*anchorEnabled*/ ctx[1] })) + " svelte-1u8wokx"))) {
117
- attr(div4, "class", div4_class_value);
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);
118
154
  }
119
155
 
120
156
  if (dirty & /*itemLabel*/ 1) {
121
- set_style(div4, "height", `${/*itemLabel*/ ctx[0].strokeLength}px`);
157
+ set_style(div2, "height", `${/*itemLabel*/ ctx[0].strokeLength}px`);
122
158
  }
123
159
 
124
- if (dirty & /*itemLabel*/ 1 && div5_class_value !== (div5_class_value = "" + (null_to_empty(classNames("item-label-item", { visible: /*itemLabel*/ ctx[0].visible })) + " svelte-1u8wokx"))) {
125
- attr(div5, "class", div5_class_value);
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);
126
162
  }
127
163
 
128
164
  if (dirty & /*itemLabel*/ 1) {
129
- set_style(div5, "z-index", /*itemLabel*/ ctx[0].zIndex, false);
165
+ set_style(div3, "z-index", /*itemLabel*/ ctx[0].zIndex, false);
130
166
  }
131
167
 
132
168
  if (dirty & /*itemLabel*/ 1) {
133
- set_style(div5, "transform", /*itemLabel*/ ctx[0].transform, false);
169
+ set_style(div3, "transform", /*itemLabel*/ ctx[0].transform, false);
134
170
  }
135
171
  },
136
172
  i: noop,
137
173
  o: noop,
138
174
  d(detaching) {
139
- if (detaching) detach(div5);
175
+ if (detaching) detach(div3);
176
+ if (if_block) if_block.d();
140
177
  mounted = false;
141
178
  dispose();
142
179
  }
@@ -149,24 +186,42 @@ function instance($$self, $$props, $$invalidate) {
149
186
  let { itemLabel } = $$props;
150
187
  let { hooks } = $$props;
151
188
  let { anchorEnabled } = $$props;
189
+ let { onIconClick } = $$props;
152
190
 
153
191
  function onClick() {
154
192
  hooks.emit('onLabelClick', itemLabel);
155
193
  }
156
194
 
195
+ const click_handler = e => onIconClick(itemLabel);
196
+
157
197
  $$self.$$set = $$props => {
158
198
  if ('itemLabel' in $$props) $$invalidate(0, itemLabel = $$props.itemLabel);
159
- if ('hooks' in $$props) $$invalidate(3, hooks = $$props.hooks);
199
+ if ('hooks' in $$props) $$invalidate(4, hooks = $$props.hooks);
160
200
  if ('anchorEnabled' in $$props) $$invalidate(1, anchorEnabled = $$props.anchorEnabled);
201
+ if ('onIconClick' in $$props) $$invalidate(2, onIconClick = $$props.onIconClick);
161
202
  };
162
203
 
163
- return [itemLabel, anchorEnabled, onClick, hooks];
204
+ return [itemLabel, anchorEnabled, onIconClick, onClick, hooks, click_handler];
164
205
  }
165
206
 
166
207
  class Component extends SvelteComponent {
167
208
  constructor(options) {
168
209
  super();
169
- init(this, options, instance, create_fragment, safe_not_equal, { itemLabel: 0, hooks: 3, anchorEnabled: 1 }, add_css);
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
+ );
170
225
  }
171
226
  }
172
227
 
@@ -2,8 +2,9 @@ import { Subscribe } from "@realsee/five";
2
2
  import ItemLabelComponent from './ItemLabelComponent';
3
3
  import { ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE } from "./typings";
4
4
  import { parseItemLabelPluginData } from "./utils/parseData";
5
+ const defaultMaxVisibleDistance = undefined;
5
6
  export const Plugin = (five, params) => {
6
- var _a, _b;
7
+ var _a, _b, _c;
7
8
  const pluginState = {
8
9
  container: document.createElement('div'),
9
10
  data: null,
@@ -15,6 +16,7 @@ export const Plugin = (five, params) => {
15
16
  hooks: new Subscribe(),
16
17
  modelOcclusionEnable: (_a = params === null || params === void 0 ? void 0 : params.modelOcclusionEnable) !== null && _a !== void 0 ? _a : true,
17
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,
18
20
  };
19
21
  pluginState.container.setAttribute('class', 'item-label-plugin-container');
20
22
  pluginState.container.style.cssText = `
@@ -74,7 +76,8 @@ export const Plugin = (five, params) => {
74
76
  itemLabels: pluginState.itemLabels,
75
77
  wrapper: pluginState.wrapper,
76
78
  hooks: pluginState.hooks,
77
- displayStrategyType: pluginState.displayStrategyType
79
+ displayStrategyType: pluginState.displayStrategyType,
80
+ maxVisibleDistance: pluginState.maxVisibleDistance
78
81
  }
79
82
  });
80
83
  }
@@ -87,12 +90,12 @@ export const Plugin = (five, params) => {
87
90
  };
88
91
  // 添加 five 监听
89
92
  const addListener4Five = () => {
90
- five.on('modeChange', onFiveModeChange);
93
+ // five.on('modeChange', onFiveModeChange)
91
94
  five.once('dispose', dispose);
92
95
  };
93
96
  // 取消 five 监听
94
97
  const removeListener4Five = () => {
95
- five.off('modeChange', onFiveModeChange);
98
+ // five.off('modeChange', onFiveModeChange)
96
99
  };
97
100
  const onFiveModeChange = (mode) => {
98
101
  if (!pluginState.enabled)
@@ -8,6 +8,7 @@ export declare enum ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE {
8
8
  EXTRA_LARGE = "x-large"
9
9
  }
10
10
  export interface ItemLabelPluginParametersType {
11
+ maxVisibleDistance?: number;
11
12
  modelOcclusionEnable?: boolean;
12
13
  displayStrategyType?: Partial<ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE>;
13
14
  }
@@ -30,6 +31,9 @@ export interface ItemLabel {
30
31
  modelPosition: [number, number, number];
31
32
  type?: string[];
32
33
  icon?: string;
34
+ observerIndex?: number | undefined;
35
+ visible?: boolean;
36
+ isFold?: boolean;
33
37
  [key: string]: any;
34
38
  }
35
39
  export interface ItemLabelPluginExportReturnsType {
@@ -51,4 +55,5 @@ export interface ItemLabelPluginState {
51
55
  hooks: Subscribe<PluginEvent>;
52
56
  modelOcclusionEnable: boolean;
53
57
  displayStrategyType: Partial<ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE>;
58
+ maxVisibleDistance: number | undefined;
54
59
  }
@@ -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
+ };
@@ -1,4 +1,4 @@
1
1
  /** @description 转成内部所需数据 */
2
2
  export function parseItemLabelPluginData(data) {
3
- return data.item_labels.map(label => (Object.assign({ modelPosition: [label.position[0], label.position[1], label.position[2]] }, label)));
3
+ return data.item_labels.map(label => (Object.assign({ modelPosition: [label.position[0], label.position[1], label.position[2]], observerIndex: undefined }, label)));
4
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;
@@ -0,0 +1,44 @@
1
+ import type { LineJson } from '../typings/data';
2
+ import { Model } from '../Model';
3
+ import Line from '../Model/line';
4
+ import BaseController, { IControllerParams } from './BaseController';
5
+ export declare type State = 'watching' | 'editing';
6
+ export interface EditEvent {
7
+ editedLineChange: (lines: LineJson[]) => void;
8
+ }
9
+ export default class MixedController extends BaseController {
10
+ state: State;
11
+ model: Model;
12
+ private hasAppendDashed;
13
+ private fiveElement?;
14
+ private mobileStartPoint;
15
+ private mobileNowPoint;
16
+ private highlightedLines;
17
+ private deleteDom;
18
+ /** 圆环点到上一个端点连接的虚线 */
19
+ private dashed;
20
+ constructor(params: IControllerParams);
21
+ dispose(): void;
22
+ highlightLine(line: Line): void;
23
+ clearHighlightLines(): void;
24
+ getEditingLines(): Line[];
25
+ /** 编辑线条发生改变时通知外部 */
26
+ private onLineChanged;
27
+ private onWantsTapGesture;
28
+ /** 编辑时取消走点,watch时可以走 */
29
+ private onWantsToMoveToPano;
30
+ /** 移动全景时更新 distanceItem 在屏幕上的位置 */
31
+ private onCameraUpdate;
32
+ /** mobile态时更新虚线 */
33
+ private updateMobileDashed;
34
+ /** mobile态时更新放大镜 */
35
+ private updateMagnifier;
36
+ private onGetStartPoint;
37
+ private onGetEndPoint;
38
+ private onNowPointChange;
39
+ private onWillChangeState;
40
+ private chooseLine;
41
+ private highlightLines;
42
+ private deleteDomClickCallback;
43
+ private cancelDeleteClickCallback;
44
+ }