@realsee/dnalogel 0.1.5 → 0.1.7-alpha.11

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 (187) hide show
  1. package/components/ARVideoFigure/ImgBgTransparentMesh.js +2 -2
  2. package/components/GLTFView/index.d.ts +123 -0
  3. package/components/GLTFView/index.js +204 -0
  4. package/components/GlassFilters/index.js +2 -2
  5. package/components/ModelView/ModelViewController.js +6 -5
  6. package/data/81zxMaeVKLQU93OZMG.d.ts +49 -0
  7. package/data/81zxMaeVKLQU93OZMG.js +633 -0
  8. package/data/PrXel3aqGbp34JQn.js +139 -1
  9. package/data/_vLykj3NWrllMrG06.d.ts +95 -0
  10. package/data/_vLykj3NWrllMrG06.js +1 -0
  11. package/data/vLykj3NWrllMrG06.js +335 -71
  12. package/libs/gltf-viewer/Subscribe.d.ts +76 -0
  13. package/libs/gltf-viewer/Subscribe.js +233 -0
  14. package/libs/gltf-viewer/coordsMoveByOffset.d.ts +13 -0
  15. package/libs/gltf-viewer/coordsMoveByOffset.js +22 -0
  16. package/libs/gltf-viewer/coordsToDirection.d.ts +5 -0
  17. package/{components/PBRView/index.js → libs/gltf-viewer/coordsToDirection.js} +14 -18
  18. package/libs/gltf-viewer/formatRad.d.ts +1 -0
  19. package/libs/gltf-viewer/formatRad.js +13 -0
  20. package/libs/gltf-viewer/getFrameTime.d.ts +1 -0
  21. package/libs/gltf-viewer/getFrameTime.js +28 -0
  22. package/libs/gltf-viewer/index.d.ts +79 -0
  23. package/libs/gltf-viewer/index.js +765 -0
  24. package/libs/gltf-viewer/mouseWheel.d.ts +2 -0
  25. package/libs/gltf-viewer/mouseWheel.js +59 -0
  26. package/libs/gltf-viewer/requestAnimationFrame.d.ts +1 -0
  27. package/libs/gltf-viewer/requestAnimationFrame.js +18 -0
  28. package/libs/gltf-viewer/requestAnimationFrameInterval.d.ts +1 -0
  29. package/libs/gltf-viewer/requestAnimationFrameInterval.js +31 -0
  30. package/libs/gltf-viewer/uuid.d.ts +4 -0
  31. package/libs/gltf-viewer/uuid.js +28 -0
  32. package/package.json +5 -4
  33. package/plugins/CSS3DRenderPlugin/components/Marker/index.js +2 -0
  34. package/plugins/CSS3DRenderPlugin/index.js +17 -12
  35. package/plugins/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +7 -0
  36. package/plugins/CSS3DRenderPlugin/utils/createResizeObserver.js +34 -0
  37. package/plugins/ModelChassisCompassPlugin/index.d.ts +1 -1
  38. package/plugins/ModelChassisCompassPlugin/index.js +2 -1
  39. package/plugins/ModelEntryDoorGuidePlugin/index.d.ts +6 -2
  40. package/plugins/ModelEntryDoorGuidePlugin/index.js +28 -19
  41. package/plugins/ModelExtrudeWallsPlugin/index.js +2 -2
  42. package/plugins/ModelRoomLabelPlugin/Controller.js +1 -0
  43. package/plugins/ModelRoomLabelPlugin/RoomLabelItem.js +5 -5
  44. package/plugins/ModelRoomLabelPlugin/RoomLabelItems.js +2 -2
  45. package/plugins/ModelRoomLabelPlugin/index.d.ts +4 -0
  46. package/plugins/ModelRoomLabelPlugin/index.js +7 -2
  47. package/plugins/ModelTVVideoPlugin/index.js +4 -2
  48. package/plugins/ModelViewPlugin/index.js +2 -2
  49. package/plugins/PanoCursorRaycasterPlugin/index.js +2 -0
  50. package/plugins/PanoMaskSelectorPlugin/createBox.js +3 -0
  51. package/plugins/PanoMaskSelectorPlugin/index.js +3 -1
  52. package/plugins/PanoMeasurePlugin/Controller/BaseController.d.ts +36 -0
  53. package/plugins/PanoMeasurePlugin/Controller/BaseController.js +105 -0
  54. package/plugins/PanoMeasurePlugin/Controller/EditController.d.ts +52 -0
  55. package/plugins/PanoMeasurePlugin/Controller/EditController.js +343 -0
  56. package/plugins/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +12 -0
  57. package/plugins/PanoMeasurePlugin/Controller/ShortcutKeyController.js +69 -0
  58. package/plugins/PanoMeasurePlugin/Controller/WatchController.d.ts +25 -0
  59. package/plugins/PanoMeasurePlugin/Controller/WatchController.js +373 -0
  60. package/plugins/PanoMeasurePlugin/Controller/index.d.ts +61 -0
  61. package/plugins/PanoMeasurePlugin/Controller/index.js +230 -0
  62. package/plugins/PanoMeasurePlugin/Model/index.d.ts +38 -0
  63. package/plugins/PanoMeasurePlugin/Model/index.js +237 -0
  64. package/plugins/PanoMeasurePlugin/Model/line.d.ts +30 -0
  65. package/plugins/PanoMeasurePlugin/Model/line.js +123 -0
  66. package/plugins/PanoMeasurePlugin/Model/point.d.ts +16 -0
  67. package/plugins/PanoMeasurePlugin/Model/point.js +72 -0
  68. package/plugins/PanoMeasurePlugin/Model/polyline.d.ts +16 -0
  69. package/plugins/PanoMeasurePlugin/Model/polyline.js +111 -0
  70. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +2 -0
  71. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +11 -0
  72. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +2 -0
  73. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +11 -0
  74. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +2 -0
  75. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.js +11 -0
  76. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +22 -0
  77. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/index.js +184 -0
  78. package/plugins/PanoMeasurePlugin/Modules/FiveHelper.d.ts +11 -0
  79. package/plugins/PanoMeasurePlugin/Modules/FiveHelper.js +68 -0
  80. package/plugins/PanoMeasurePlugin/Modules/GuideController.d.ts +18 -0
  81. package/plugins/PanoMeasurePlugin/Modules/GuideController.js +107 -0
  82. package/plugins/PanoMeasurePlugin/Modules/Magnifier.d.ts +24 -0
  83. package/plugins/PanoMeasurePlugin/Modules/Magnifier.js +139 -0
  84. package/plugins/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +6 -0
  85. package/plugins/PanoMeasurePlugin/Modules/UIController/HTML.js +26 -0
  86. package/plugins/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +18 -0
  87. package/plugins/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +169 -0
  88. package/plugins/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +12 -0
  89. package/plugins/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +59 -0
  90. package/plugins/PanoMeasurePlugin/Modules/UIController/index.d.ts +16 -0
  91. package/plugins/PanoMeasurePlugin/Modules/UIController/index.js +125 -0
  92. package/plugins/PanoMeasurePlugin/Modules/UIController/style.d.ts +17 -0
  93. package/plugins/PanoMeasurePlugin/Modules/UIController/style.js +103 -0
  94. package/plugins/PanoMeasurePlugin/index.d.ts +7 -0
  95. package/plugins/PanoMeasurePlugin/index.js +20 -0
  96. package/plugins/PanoMeasurePlugin/typings/data.d.ts +28 -0
  97. package/plugins/PanoMeasurePlugin/typings/data.js +7 -0
  98. package/plugins/PanoMeasurePlugin/typings/event.type.d.ts +28 -0
  99. package/plugins/PanoMeasurePlugin/typings/event.type.js +7 -0
  100. package/plugins/PanoMeasurePlugin/typings/utils.type.d.ts +1 -0
  101. package/plugins/PanoMeasurePlugin/typings/utils.type.js +7 -0
  102. package/plugins/PanoMeasurePlugin/utils/clearGroup.d.ts +2 -0
  103. package/plugins/PanoMeasurePlugin/utils/clearGroup.js +16 -0
  104. package/plugins/PanoMeasurePlugin/utils/constants.d.ts +4 -0
  105. package/plugins/PanoMeasurePlugin/utils/constants.js +47 -0
  106. package/plugins/PanoMeasurePlugin/utils/distanceDom.d.ts +28 -0
  107. package/plugins/PanoMeasurePlugin/utils/distanceDom.js +147 -0
  108. package/plugins/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +2 -0
  109. package/plugins/PanoMeasurePlugin/utils/findAssociatedLines.js +39 -0
  110. package/plugins/PanoMeasurePlugin/utils/findClosestPoint.d.ts +10 -0
  111. package/plugins/PanoMeasurePlugin/utils/findClosestPoint.js +49 -0
  112. package/plugins/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +4 -0
  113. package/plugins/PanoMeasurePlugin/utils/getIntersectionFromEvent.js +20 -0
  114. package/plugins/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +10 -0
  115. package/plugins/PanoMeasurePlugin/utils/getPointFromHammerEvent.js +33 -0
  116. package/plugins/PanoMeasurePlugin/utils/ironbox.d.ts +1 -0
  117. package/plugins/PanoMeasurePlugin/utils/ironbox.js +14 -0
  118. package/plugins/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +2 -0
  119. package/plugins/PanoMeasurePlugin/utils/isNDCPointInScreen.js +16 -0
  120. package/plugins/PanoMeasurePlugin/utils/line.d.ts +17 -0
  121. package/plugins/PanoMeasurePlugin/utils/line.js +61 -0
  122. package/plugins/PanoMeasurePlugin/utils/math.d.ts +17 -0
  123. package/plugins/PanoMeasurePlugin/utils/math.js +57 -0
  124. package/plugins/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -0
  125. package/plugins/PanoMeasurePlugin/utils/mouseGroup.js +42 -0
  126. package/plugins/PanoMeasurePlugin/utils/ndc2Screen.d.ts +5 -0
  127. package/plugins/PanoMeasurePlugin/utils/ndc2Screen.js +16 -0
  128. package/plugins/PanoRulerPlugin/index.d.ts +4 -0
  129. package/plugins/PanoRulerPlugin/index.js +8 -3
  130. package/plugins/PanoTVVideoPlugin/index.d.ts +2 -0
  131. package/plugins/PanoTVVideoPlugin/index.js +20 -14
  132. package/plugins/TreasurePlugin/Controller.js +2 -2
  133. package/plugins/TreasurePlugin/TreasureOpenAnime.js +2 -2
  134. package/plugins/floorplan/Assets/floorplanExtraObject.d.ts +1 -1
  135. package/plugins/floorplan/Assets/floorplanExtraObject.js +3 -3
  136. package/plugins/floorplan/ModelFloorplanPlugin/Controller.d.ts +5 -2
  137. package/plugins/floorplan/ModelFloorplanPlugin/Controller.js +22 -11
  138. package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.js +4 -4
  139. package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.js +5 -5
  140. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.js +2 -2
  141. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.js +2 -2
  142. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomMaterial.d.ts +11 -0
  143. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomMaterial.js +174 -0
  144. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RuleLabels.d.ts +8 -0
  145. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RuleLabels.js +182 -0
  146. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.d.ts +2 -0
  147. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.js +14 -2
  148. package/plugins/floorplan/ModelFloorplanPlugin/components/index.d.ts +3 -0
  149. package/plugins/floorplan/ModelFloorplanPlugin/components/index.js +1 -1
  150. package/plugins/floorplan/ModelFloorplanPlugin/typings/utility.d.ts +2 -0
  151. package/plugins/floorplan/ModelFloorplanPlugin/typings/utility.js +7 -0
  152. package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.d.ts +1 -1
  153. package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.js +1 -1
  154. package/plugins/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +1 -1
  155. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.js +3 -2
  156. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.js +4 -4
  157. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.js +2 -2
  158. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.js +2 -2
  159. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.js +2 -2
  160. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.js +2 -2
  161. package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +1 -1
  162. package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.js +3 -3
  163. package/plugins/floorplan/TopviewFloorplanPlugin/Controller.d.ts +3 -0
  164. package/plugins/floorplan/TopviewFloorplanPlugin/Controller.js +16 -6
  165. package/plugins/floorplan/index.d.ts +4 -0
  166. package/plugins/floorplan/index.js +13 -0
  167. package/plugins/floorplan/typings/floorplanData.d.ts +2 -0
  168. package/plugins/floorplan/typings/floorplanServerData.d.ts +3 -1
  169. package/plugins/floorplan/typings/floorplanServerData.js +3 -3
  170. package/plugins/floorplan/utils/formatData.js +3 -2
  171. package/plugins/floorplan/utils/formatPosition.js +2 -0
  172. package/shared-utils/Subscribe.js +4 -2
  173. package/shared-utils/animationFrame/BetterTween.js +5 -1
  174. package/shared-utils/changeModelCanvasOpacity.d.ts +2 -0
  175. package/shared-utils/{changeModelCanvansOpacity.js → changeModelCanvasOpacity.js} +2 -2
  176. package/shared-utils/filter.js +4 -2
  177. package/shared-utils/math/evenNumber.d.ts +3 -1
  178. package/shared-utils/math/evenNumber.js +4 -2
  179. package/shared-utils/math/planimetry.js +2 -0
  180. package/shared-utils/removeArrayItem.d.ts +7 -0
  181. package/shared-utils/removeArrayItem.js +22 -0
  182. package/shared-utils/three/loadTexture.d.ts +2 -2
  183. package/shared-utils/three/loadTexture.js +21 -2
  184. package/typedoc/libs.d.ts +1 -0
  185. package/typedoc/libs.js +7 -0
  186. package/components/PBRView/index.d.ts +0 -14
  187. package/shared-utils/changeModelCanvansOpacity.d.ts +0 -2
@@ -0,0 +1,174 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.array.iterator.js");
4
+
5
+ require("core-js/modules/es.object.to-string.js");
6
+
7
+ require("core-js/modules/es.string.iterator.js");
8
+
9
+ require("core-js/modules/es.weak-map.js");
10
+
11
+ require("core-js/modules/web.dom-collections.iterator.js");
12
+
13
+ require("core-js/modules/es.object.define-property.js");
14
+
15
+ require("core-js/modules/es.object.get-own-property-descriptor.js");
16
+
17
+ var _typeof = require("@babel/runtime/helpers/typeof");
18
+
19
+ Object.defineProperty(exports, "__esModule", {
20
+ value: true
21
+ });
22
+ exports.RoomMaterialSwitch = RoomMaterialSwitch;
23
+ exports["default"] = RoomMaterial;
24
+
25
+ require("core-js/modules/es.array.map.js");
26
+
27
+ require("core-js/modules/es.object.assign.js");
28
+
29
+ require("core-js/modules/es.array.concat.js");
30
+
31
+ var React = _interopRequireWildcard(require("react"));
32
+
33
+ var _formatPosition = _interopRequireWildcard(require("../../../utils/formatPosition"));
34
+
35
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
36
+
37
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
38
+
39
+ /** 为不同的房间添加不同的样式 */
40
+ function RoomMaterial(props) {
41
+ var bounding = props.floorplanData.bounding;
42
+ var rooms = props.floorplanData.floorDatas[props.floorIndex].rooms;
43
+ return /*#__PURE__*/React.createElement("div", {
44
+ className: "floorplan-plugin__room-material"
45
+ }, rooms // 户型图坐标转 Svg 坐标
46
+ .map(function (room) {
47
+ return Object.assign({}, room, {
48
+ path: room.path.map(function (p) {
49
+ return (0, _formatPosition["default"])(p, props.pxmm, bounding);
50
+ })
51
+ });
52
+ }).map(function (room) {
53
+ return /*#__PURE__*/React.createElement(RoomMaterialSvgWrapper, {
54
+ key: room.id
55
+ }, /*#__PURE__*/React.createElement(RoomMaterialSwitch, {
56
+ room: room
57
+ }));
58
+ }));
59
+ }
60
+
61
+ function RoomMaterialSwitch(props) {
62
+ var floorType = props.room.floorType;
63
+ if (floorType === 1) return /*#__PURE__*/React.createElement(RoomMaterial_0, {
64
+ path: props.room.path
65
+ });
66
+ if (floorType === 0) return /*#__PURE__*/React.createElement(RoomMaterial_2, {
67
+ path: props.room.path
68
+ });
69
+ return /*#__PURE__*/React.createElement(RoomMaterial_1, {
70
+ path: props.room.path
71
+ });
72
+ }
73
+
74
+ function RoomMaterialSvgWrapper(props) {
75
+ return /*#__PURE__*/React.createElement("svg", {
76
+ style: {
77
+ position: 'absolute',
78
+ width: '100%',
79
+ height: '100%',
80
+ overflow: 'visible'
81
+ }
82
+ }, props.children);
83
+ }
84
+ /** 纯色背景 */
85
+
86
+
87
+ function RoomMaterial_0(props) {
88
+ var d = (0, _formatPosition.pathD)(props.path, {
89
+ needZ: true
90
+ });
91
+ return /*#__PURE__*/React.createElement("path", {
92
+ d: d,
93
+ fill: "#2F313A"
94
+ });
95
+ }
96
+ /** 瓷砖地板,偏蓝的格格 */
97
+
98
+
99
+ function RoomMaterial_1(props) {
100
+ var d = (0, _formatPosition.pathD)(props.path, {
101
+ needZ: true
102
+ });
103
+ var halfWidth = 6;
104
+ var width = halfWidth * 2;
105
+ var patternPathD = "M0 ".concat(halfWidth, " h ").concat(width, " M").concat(halfWidth, " 0 v ").concat(width);
106
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("pattern", {
107
+ id: "fpm-room-pattern-0",
108
+ x: "0",
109
+ y: "0",
110
+ width: width,
111
+ height: width,
112
+ patternUnits: "userSpaceOnUse"
113
+ }, /*#__PURE__*/React.createElement("rect", {
114
+ x: "0",
115
+ y: "0",
116
+ width: width,
117
+ height: width,
118
+ fill: "#323747"
119
+ }), /*#__PURE__*/React.createElement("path", {
120
+ d: patternPathD,
121
+ stroke: "#ffffff",
122
+ strokeOpacity: "0.06",
123
+ strokeWidth: "0.5",
124
+ fill: "none"
125
+ }))), /*#__PURE__*/React.createElement("path", {
126
+ d: d,
127
+ fill: "url(#fpm-room-pattern-0)"
128
+ }));
129
+ }
130
+ /** 木地板,偏灰的格格 */
131
+
132
+
133
+ function RoomMaterial_2(props) {
134
+ var d = (0, _formatPosition.pathD)(props.path, {
135
+ needZ: true
136
+ });
137
+
138
+ var PatternRect = function PatternRect() {
139
+ return /*#__PURE__*/React.createElement("rect", {
140
+ x: "0.5",
141
+ y: "0.5",
142
+ width: "6",
143
+ height: "50",
144
+ fill: "none",
145
+ stroke: "#4B4B57",
146
+ strokeWidth: "0.5"
147
+ });
148
+ };
149
+
150
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("pattern", {
151
+ id: "room-material-pattern-1",
152
+ x: "0",
153
+ y: "0",
154
+ width: "13",
155
+ height: "51",
156
+ patternUnits: "userSpaceOnUse"
157
+ }, /*#__PURE__*/React.createElement(PatternRect, null)), /*#__PURE__*/React.createElement("pattern", {
158
+ id: "room-material-pattern-2",
159
+ x: "7",
160
+ y: "25",
161
+ width: "13",
162
+ height: "51",
163
+ patternUnits: "userSpaceOnUse"
164
+ }, /*#__PURE__*/React.createElement(PatternRect, null))), /*#__PURE__*/React.createElement("path", {
165
+ d: d,
166
+ fill: "#43434D"
167
+ }), /*#__PURE__*/React.createElement("path", {
168
+ d: d,
169
+ fill: "url(#room-material-pattern-1)"
170
+ }), /*#__PURE__*/React.createElement("path", {
171
+ d: d,
172
+ fill: "url(#room-material-pattern-2)"
173
+ }));
174
+ }
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { FloorplanData } from '../../../typings/floorplanData';
3
+ /** 展示当前楼层的户型图对应上下左右的标尺 */
4
+ export default function RuleLabels(props: {
5
+ floorIndex: number;
6
+ floorplanData: FloorplanData;
7
+ pxmm: number;
8
+ }): JSX.Element | null;
@@ -0,0 +1,182 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.define-property.js");
4
+
5
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports["default"] = RuleLabels;
11
+
12
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
+
14
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
15
+
16
+ require("core-js/modules/es.array.map.js");
17
+
18
+ require("core-js/modules/es.object.keys.js");
19
+
20
+ require("core-js/modules/es.array.filter.js");
21
+
22
+ require("core-js/modules/es.object.to-string.js");
23
+
24
+ require("core-js/modules/es.array.sort.js");
25
+
26
+ require("core-js/modules/es.array.flat.js");
27
+
28
+ require("core-js/modules/es.array.unscopables.flat.js");
29
+
30
+ require("core-js/modules/es.array.slice.js");
31
+
32
+ require("core-js/modules/es.array.concat.js");
33
+
34
+ require("core-js/modules/es.object.assign.js");
35
+
36
+ var _react = _interopRequireDefault(require("react"));
37
+
38
+ var _px2rem = _interopRequireDefault(require("../../../../../shared-utils/px2rem"));
39
+
40
+ var _isNil = require("../../../../../shared-utils/isNil");
41
+
42
+ var padding = 1000;
43
+
44
+ /** 展示当前楼层的户型图对应上下左右的标尺 */
45
+ function RuleLabels(props) {
46
+ var currentFloorDatas = props.floorplanData.floorDatas[props.floorIndex];
47
+ var bounding = props.floorplanData.bounding;
48
+ var ruleLabels = currentFloorDatas.rules;
49
+ if (!ruleLabels) return null;
50
+ return /*#__PURE__*/_react["default"].createElement("div", {
51
+ className: "floorplan-plugin__rulelabels"
52
+ }, Object.keys(ruleLabels).map(function (direction) {
53
+ return /*#__PURE__*/_react["default"].createElement(RulesItem, {
54
+ key: direction,
55
+ data: ruleLabels[direction],
56
+ type: direction,
57
+ bounding: bounding,
58
+ pxmm: props.pxmm
59
+ });
60
+ }));
61
+ }
62
+
63
+ function RulesItem(props) {
64
+ var _rulesStyle;
65
+
66
+ var pxmm = props.pxmm,
67
+ bounding = props.bounding,
68
+ type = props.type,
69
+ data = props.data;
70
+ var isTop = type === 'top';
71
+ var isBottom = type === 'bottom';
72
+ var isLeft = type === 'left';
73
+ var isRight = type === 'right';
74
+ var isRow = isTop || isBottom; // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
75
+
76
+ var positionArray = data.map(function (_ref) {
77
+ var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
78
+ start = _ref2[0],
79
+ end = _ref2[1];
80
+
81
+ return isRow ? [start.x, end.x] : [start.y, end.y];
82
+ }).flat().sort().filter(function (x, index, arr) {
83
+ if (index === 0) return true;
84
+ return x !== arr[index - 1];
85
+ });
86
+ var minPosition = positionArray[0];
87
+ var maxPosition = positionArray.slice(-1)[0];
88
+ var length = maxPosition - minPosition;
89
+ var minBounding = isRow ? bounding.min.x : bounding.min.y;
90
+ var lengthPx = length * pxmm;
91
+ var positionPxArray = positionArray.map(function (x) {
92
+ return (x - minPosition) / length * lengthPx;
93
+ }); // 在主要方向上的偏移量,上下的标尺是距离图片左侧的长度,左右的标尺是距离图片底部的距离
94
+
95
+ var translateMain = (minPosition - minBounding) * pxmm; // 在次要方向的偏移量,希望达到的效果是标尺轴距离户型图边界 27px,但是图片自身是带有 1000mm 的边界,所以在计算时需要减去这个边界
96
+
97
+ var translateSecond = 27 - padding * pxmm;
98
+
99
+ var transform = function () {
100
+ if (isTop) return "translate(".concat(translateMain, "px, ").concat(-translateSecond, "px)");
101
+ if (isBottom) return "translate(".concat(translateMain, "px, ").concat(translateSecond, "px)");
102
+ if (isLeft) return "translate(".concat(-translateSecond, "px, ").concat(-translateMain, "px)");
103
+ if (isRight) return "translate(".concat(translateSecond, "px, ").concat(-translateMain - lengthPx, "px)");
104
+ }(); // 把点位的户型图坐标转成距离起始位置的像素值
105
+
106
+
107
+ var textArray = positionArray.map(function (position, index, array) {
108
+ if (index === 0) return;
109
+ var distance = position - array[index - 1];
110
+ var positionPx = (array[index - 1] + distance / 2 - minPosition) / length * lengthPx;
111
+ return {
112
+ distance: distance,
113
+ positionPx: positionPx
114
+ };
115
+ }).filter(_isNil.notNil).filter(function (item) {
116
+ return item.distance / length > 0.12;
117
+ });
118
+ var rulesStyle = (_rulesStyle = {
119
+ position: 'absolute',
120
+ transform: "".concat(transform, " ").concat(isRow ? '' : 'rotate(-90deg)'),
121
+ transformOrigin: "".concat(isRight ? 'right top' : '').concat(isLeft ? 'left bottom' : ''),
122
+ left: isRow ? 0 : undefined,
123
+ bottom: !isRow ? 0 : undefined
124
+ }, (0, _defineProperty2["default"])(_rulesStyle, type, 0), (0, _defineProperty2["default"])(_rulesStyle, "width", lengthPx + 'px'), (0, _defineProperty2["default"])(_rulesStyle, "height", (0, _px2rem["default"])(5)), (0, _defineProperty2["default"])(_rulesStyle, "display", 'flex'), (0, _defineProperty2["default"])(_rulesStyle, "alignItems", 'center'), _rulesStyle);
125
+ var ruleLineStyle = {
126
+ background: '#fff',
127
+ opacity: 0.05,
128
+ width: '100%',
129
+ height: (0, _px2rem["default"])(1)
130
+ };
131
+ var ruleScaleStyle = {
132
+ position: 'absolute',
133
+ background: '#fff',
134
+ opacity: 0.05,
135
+ transformOrigin: 'center',
136
+ width: (0, _px2rem["default"])(1),
137
+ height: (0, _px2rem["default"])(5)
138
+ };
139
+ var isRightOrBottom = isRight || isBottom;
140
+ var textWrapperStyle = {
141
+ width: 0,
142
+ height: 0,
143
+ position: 'absolute',
144
+ bottom: isRightOrBottom ? (0, _px2rem["default"])(10) : undefined,
145
+ top: isRightOrBottom ? undefined : (0, _px2rem["default"])(10)
146
+ };
147
+ var textStyle = {
148
+ position: 'absolute',
149
+ width: 'max-content',
150
+ display: 'block',
151
+ transform: "translate(-50%, -50%) ".concat(isRow ? '' : 'rotate(180deg)'),
152
+ fontSize: (0, _px2rem["default"])(10),
153
+ color: '#fff',
154
+ opacity: 0.2
155
+ };
156
+ return /*#__PURE__*/_react["default"].createElement("div", {
157
+ className: "rule-labels-".concat(type),
158
+ style: rulesStyle
159
+ }, /*#__PURE__*/_react["default"].createElement("div", {
160
+ className: "rule-line",
161
+ style: ruleLineStyle
162
+ }), positionPxArray.map(function (position, index) {
163
+ return /*#__PURE__*/_react["default"].createElement("div", {
164
+ key: index,
165
+ className: "rule-scale",
166
+ style: Object.assign({
167
+ left: "".concat(position, "px")
168
+ }, ruleScaleStyle)
169
+ });
170
+ }), textArray.map(function (textItem, index) {
171
+ return /*#__PURE__*/_react["default"].createElement("div", {
172
+ key: index,
173
+ className: "text-wrapper",
174
+ style: Object.assign({
175
+ left: "".concat(textItem.positionPx, "px")
176
+ }, textWrapperStyle)
177
+ }, /*#__PURE__*/_react["default"].createElement("span", {
178
+ className: "text",
179
+ style: textStyle
180
+ }, textItem.distance));
181
+ }));
182
+ }
@@ -7,6 +7,8 @@ export default function NowFloor(props: {
7
7
  visible: boolean;
8
8
  floorIndex: number;
9
9
  hoverEnable?: boolean;
10
+ ruleLabelsEnable?: boolean;
11
+ roomLabelsEnable?: boolean;
10
12
  floorplanData: FloorplanData;
11
13
  getLabelElement?: (room: FloorplanRoomItem) => Element | null;
12
14
  onRoomHeightClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => boolean | void;
@@ -33,6 +33,10 @@ var _RoomHighlight = _interopRequireDefault(require("./RoomHighlight"));
33
33
 
34
34
  var _FloorplanImage = _interopRequireDefault(require("../../../components/FloorplanImage"));
35
35
 
36
+ var _RuleLabels = _interopRequireDefault(require("./RuleLabels"));
37
+
38
+ var _RoomMaterial = _interopRequireDefault(require("./RoomMaterial"));
39
+
36
40
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
37
41
 
38
42
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -49,14 +53,22 @@ function NowFloor(props) {
49
53
  return /*#__PURE__*/React.createElement("div", {
50
54
  className: "now-floor",
51
55
  style: floorStyle
52
- }, !!props.hoverEnable && props.visible && /*#__PURE__*/React.createElement(_RoomHighlight["default"], (0, _extends2["default"])({}, props, {
56
+ }, /*#__PURE__*/React.createElement(_RoomMaterial["default"], {
57
+ floorplanData: floorplanData,
58
+ floorIndex: floorIndex,
59
+ pxmm: props.pxmm
60
+ }), !!props.hoverEnable && props.visible && /*#__PURE__*/React.createElement(_RoomHighlight["default"], (0, _extends2["default"])({}, props, {
53
61
  onClick: props.onRoomHeightClick
54
62
  })), /*#__PURE__*/React.createElement(_FloorplanImage["default"], {
55
63
  floorplanData: floorplanData,
56
64
  floorIndex: floorIndex
57
- }), /*#__PURE__*/React.createElement(_RoomLabels["default"], {
65
+ }), !!props.roomLabelsEnable && /*#__PURE__*/React.createElement(_RoomLabels["default"], {
58
66
  floorplanData: floorplanData,
59
67
  floorIndex: floorIndex,
60
68
  getLabelElement: getLabelElement
69
+ }), !!props.ruleLabelsEnable && /*#__PURE__*/React.createElement(_RuleLabels["default"], {
70
+ floorplanData: floorplanData,
71
+ floorIndex: floorIndex,
72
+ pxmm: props.pxmm
61
73
  }));
62
74
  }
@@ -9,6 +9,9 @@ declare const _default: React.NamedExoticComponent<{
9
9
  panoIndex: number;
10
10
  floorIndex: number;
11
11
  hoverEnable?: boolean | undefined;
12
+ compassEnable?: boolean | undefined;
13
+ ruleLabelsEnable?: boolean | undefined;
14
+ roomLabelsEnable?: boolean | undefined;
12
15
  lastPanoramaLongitude: number;
13
16
  floorplanData?: FloorplanData | undefined;
14
17
  cameraImage?: {
@@ -76,7 +76,7 @@ var _default = /*#__PURE__*/React.memo(function Main(props) {
76
76
  floorplanData: props.floorplanData
77
77
  })), /*#__PURE__*/React.createElement(_Camera["default"], (0, _extends2["default"])({}, props, {
78
78
  floorplanData: props.floorplanData
79
- })), /*#__PURE__*/React.createElement(_Compass["default"], {
79
+ })), !!props.compassEnable && /*#__PURE__*/React.createElement(_Compass["default"], {
80
80
  floorplanData: props.floorplanData
81
81
  }));
82
82
  }, function (prev, next) {
@@ -0,0 +1,2 @@
1
+ export declare type RecordKeys<T> = T extends Record<infer P, any> ? P : any;
2
+ export declare type RecordValue<T> = T extends Record<any, infer P> ? P : any;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.define-property.js");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
@@ -1,5 +1,5 @@
1
1
  export declare const enum FloorplanErrorType {
2
- UnknowError = "UnknowError",
2
+ UnknownError = "UnknowError",
3
3
  DataNotLoaded = "DataNotLoaded",
4
4
  BreakOffByHide = "BreakOffByHide",
5
5
  ModelNotLoaded = "ModelNotLoaded",
@@ -12,7 +12,7 @@ var FloorplanErrorType;
12
12
  exports.FloorplanErrorType = FloorplanErrorType;
13
13
 
14
14
  (function (FloorplanErrorType) {
15
- FloorplanErrorType["UnknowError"] = "UnknowError";
15
+ FloorplanErrorType["UnknownError"] = "UnknowError";
16
16
  FloorplanErrorType["DataNotLoaded"] = "DataNotLoaded";
17
17
  FloorplanErrorType["BreakOffByHide"] = "BreakOffByHide";
18
18
  FloorplanErrorType["ModelNotLoaded"] = "ModelNotLoaded";
@@ -138,7 +138,7 @@ function _correctFiveState() {
138
138
  break;
139
139
  }
140
140
 
141
- throw new Error(_constant.FloorplanErrorType.UpdateCameraError);
141
+ throw new Error(_constant.FloorplanErrorType.UpdateCameraError + ' __ ' + updateCameraError.message);
142
142
 
143
143
  case 25:
144
144
  return _context.abrupt("return");
@@ -2,8 +2,6 @@
2
2
 
3
3
  require("core-js/modules/es.array.iterator.js");
4
4
 
5
- require("core-js/modules/es.object.to-string.js");
6
-
7
5
  require("core-js/modules/es.string.iterator.js");
8
6
 
9
7
  require("core-js/modules/es.weak-map.js");
@@ -29,6 +27,8 @@ require("core-js/modules/es.object.assign.js");
29
27
 
30
28
  require("core-js/modules/es.array.every.js");
31
29
 
30
+ require("core-js/modules/es.object.to-string.js");
31
+
32
32
  require("core-js/modules/es.object.keys.js");
33
33
 
34
34
  var React = _interopRequireWildcard(require("react"));
@@ -47,6 +47,7 @@ var _default = /*#__PURE__*/React.memo(function Camera(props) {
47
47
  var getCameraPositionTransform = function getCameraPositionTransform(panoIndex) {
48
48
  var observers = props.floorplanData.observers;
49
49
  var observer = observers[panoIndex];
50
+ if (!observer) return '';
50
51
  var left = Math.floor(observer.positionInImage.x * props.width);
51
52
  var top = Math.floor(observer.positionInImage.y * props.height);
52
53
  return "translate(".concat(left, "px, ").concat(top, "px)");
@@ -26,10 +26,10 @@ var positionStyle = {
26
26
  exports.positionStyle = positionStyle;
27
27
  var rotateStyle = {
28
28
  position: 'absolute',
29
- left: "".concat((0, _px2rem["default"])(-15)),
30
- top: "".concat((0, _px2rem["default"])(-15)),
31
- width: "".concat((0, _px2rem["default"])(17)),
32
- height: "".concat((0, _px2rem["default"])(17)),
29
+ left: (0, _px2rem["default"])(-15),
30
+ top: (0, _px2rem["default"])(-15),
31
+ width: (0, _px2rem["default"])(17),
32
+ height: (0, _px2rem["default"])(17),
33
33
  backgroundSize: '100%',
34
34
  backgroundRepeat: 'no-repeat',
35
35
  transformOrigin: "".concat((0, _px2rem["default"])(15), " ").concat((0, _px2rem["default"])(15)),
@@ -56,8 +56,8 @@ function ExtraObjects(props) {
56
56
  }
57
57
  }, /*#__PURE__*/React.createElement("div", {
58
58
  style: {
59
- width: "".concat((0, _px2rem["default"])(extraObject.icon.width)),
60
- height: "".concat((0, _px2rem["default"])(extraObject.icon.height)),
59
+ width: (0, _px2rem["default"])(extraObject.icon.width),
60
+ height: (0, _px2rem["default"])(extraObject.icon.height),
61
61
  backgroundImage: "url(".concat(extraObject.icon.url, ")"),
62
62
  transform: 'translate(-50%, -50%)'
63
63
  }
@@ -2,8 +2,6 @@
2
2
 
3
3
  require("core-js/modules/es.array.iterator.js");
4
4
 
5
- require("core-js/modules/es.object.to-string.js");
6
-
7
5
  require("core-js/modules/es.string.iterator.js");
8
6
 
9
7
  require("core-js/modules/es.weak-map.js");
@@ -31,6 +29,8 @@ require("core-js/modules/es.array.sort.js");
31
29
 
32
30
  require("core-js/modules/es.array.filter.js");
33
31
 
32
+ require("core-js/modules/es.object.to-string.js");
33
+
34
34
  require("core-js/modules/es.array.map.js");
35
35
 
36
36
  var React = _interopRequireWildcard(require("react"));
@@ -2,8 +2,6 @@
2
2
 
3
3
  require("core-js/modules/es.array.iterator.js");
4
4
 
5
- require("core-js/modules/es.object.to-string.js");
6
-
7
5
  require("core-js/modules/es.string.iterator.js");
8
6
 
9
7
  require("core-js/modules/es.weak-map.js");
@@ -27,6 +25,8 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
27
25
 
28
26
  require("core-js/modules/es.array.filter.js");
29
27
 
28
+ require("core-js/modules/es.object.to-string.js");
29
+
30
30
  var React = _interopRequireWildcard(require("react"));
31
31
 
32
32
  var _RoomHighlight = _interopRequireDefault(require("./RoomHighlight"));
@@ -2,8 +2,6 @@
2
2
 
3
3
  require("core-js/modules/es.array.iterator.js");
4
4
 
5
- require("core-js/modules/es.object.to-string.js");
6
-
7
5
  require("core-js/modules/es.string.iterator.js");
8
6
 
9
7
  require("core-js/modules/es.weak-map.js");
@@ -27,6 +25,8 @@ require("core-js/modules/es.object.assign.js");
27
25
 
28
26
  require("core-js/modules/es.array.every.js");
29
27
 
28
+ require("core-js/modules/es.object.to-string.js");
29
+
30
30
  require("core-js/modules/es.object.keys.js");
31
31
 
32
32
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
@@ -19,7 +19,7 @@ export default class PanoFloorplanRadarPluginController {
19
19
  private wrapper;
20
20
  private size;
21
21
  private extraObjects?;
22
- private orginExtraObjects?;
22
+ private originExtraObjects?;
23
23
  private configs;
24
24
  constructor(five: Five, params?: PanoFloorplanRadarPluginControllerParameter);
25
25
  dispose: () => void;
@@ -153,7 +153,7 @@ var PanoFloorplanRadarPluginController = /*#__PURE__*/function () {
153
153
  }, {
154
154
  key: "setExtraObjectsWith3DPositions",
155
155
  value: function setExtraObjectsWith3DPositions(data) {
156
- this.orginExtraObjects = data;
156
+ this.originExtraObjects = data;
157
157
  if (!this.data) return;
158
158
  this.extraObjects = (0, _formatData.formatExtraObjects)(data, this.five, this.data);
159
159
  this.render();
@@ -188,8 +188,8 @@ var PanoFloorplanRadarPluginController = /*#__PURE__*/function () {
188
188
  value: function render() {
189
189
  if (!this.data || !this.pxmm || !this.wrapper) return;
190
190
 
191
- if (!this.extraObjects && this.orginExtraObjects) {
192
- this.extraObjects = (0, _formatData.formatExtraObjects)(this.orginExtraObjects, this.five, this.data);
191
+ if (!this.extraObjects && this.originExtraObjects) {
192
+ this.extraObjects = (0, _formatData.formatExtraObjects)(this.originExtraObjects, this.five, this.data);
193
193
  }
194
194
 
195
195
  var props = {
@@ -7,6 +7,9 @@ export interface TopviewFloorplanPluginParameterType {
7
7
  scale?: number;
8
8
  hoverEnable?: boolean;
9
9
  autoShowEnable?: boolean;
10
+ compassEnable?: boolean;
11
+ ruleLabelsEnable?: boolean;
12
+ roomLabelsEnable?: boolean;
10
13
  cameraImage?: {
11
14
  style: React.CSSProperties;
12
15
  };