@realsee/dnalogel 0.1.0
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.
- package/README.md +94 -0
- package/TERMS.txt +56 -0
- package/components/ARVideoFigure/ARVideoFigureMesh.d.ts +44 -0
- package/components/ARVideoFigure/ARVideoFigureMesh.js +347 -0
- package/components/ARVideoFigure/ARVideoFigureScene.d.ts +11 -0
- package/components/ARVideoFigure/ARVideoFigureScene.js +74 -0
- package/components/ARVideoFigure/ImgBgTransparent.d.ts +16 -0
- package/components/ARVideoFigure/ImgBgTransparent.js +49 -0
- package/components/ARVideoFigure/ImgBgTransparentMesh.d.ts +30 -0
- package/components/ARVideoFigure/ImgBgTransparentMesh.js +173 -0
- package/components/ARVideoFigure/fragmentShader.d.ts +5 -0
- package/components/ARVideoFigure/fragmentShader.js +16 -0
- package/components/ARVideoFigure/index.d.ts +15 -0
- package/components/ARVideoFigure/index.js +64 -0
- package/components/ARVideoFigure/vertexShader.d.ts +1 -0
- package/components/ARVideoFigure/vertexShader.js +8 -0
- package/components/GlassFilters/index.d.ts +32 -0
- package/components/GlassFilters/index.js +54 -0
- package/components/ModelView/ModelViewController.d.ts +18 -0
- package/components/ModelView/ModelViewController.js +147 -0
- package/components/ModelView/index.d.ts +10 -0
- package/components/ModelView/index.js +22 -0
- package/components/PBRView/index.d.ts +14 -0
- package/components/PBRView/index.js +31 -0
- package/components/PaintBrush/index.d.ts +16 -0
- package/components/PaintBrush/index.js +33 -0
- package/components/PanoTag/index.d.ts +4 -0
- package/components/PanoTag/index.js +11 -0
- package/custom.d.js +3 -0
- package/data/1aGKl9JmrlXMXx8d.d.ts +104 -0
- package/data/1aGKl9JmrlXMXx8d.js +535 -0
- package/data/6gyq3v1verxD7JO1.d.ts +104 -0
- package/data/6gyq3v1verxD7JO1.js +460 -0
- package/data/KpokNd82rwjhackhQTBEoYKHg8zGbPXe.d.ts +84 -0
- package/data/KpokNd82rwjhackhQTBEoYKHg8zGbPXe.js +598 -0
- package/data/PrXel3aqGbp34JQn.d.ts +389 -0
- package/data/PrXel3aqGbp34JQn.js +4639 -0
- package/data/YdoNP9K4rwQDwjJr.d.ts +83 -0
- package/data/YdoNP9K4rwQDwjJr.js +1451 -0
- package/data/auto3d-njL5J99VwCmnjtQElOmXQr.d.ts +86 -0
- package/data/auto3d-njL5J99VwCmnjtQElOmXQr.js +709 -0
- package/data/oPzy3ApbjjpD8YdR.d.ts +83 -0
- package/data/oPzy3ApbjjpD8YdR.js +281 -0
- package/data/qjAxMG4XbPn96wKG.d.ts +104 -0
- package/data/qjAxMG4XbPn96wKG.js +635 -0
- package/data/rXel3aPQRRBD4JQn.d.ts +86 -0
- package/data/rXel3aPQRRBD4JQn.js +620 -0
- package/data/vLykj3NWrllMrG06.d.ts +89 -0
- package/data/vLykj3NWrllMrG06.js +2532 -0
- package/data/wYnRjQ4KZoV1yPoG.d.ts +114 -0
- package/data/wYnRjQ4KZoV1yPoG.js +512 -0
- package/data/wz0QV9KA4ugyo9ME.d.ts +39 -0
- package/data/wz0QV9KA4ugyo9ME.js +134 -0
- package/examples/FiveStateController/index.js +140 -0
- package/examples/VRHouse/Mobile.js +22 -0
- package/examples/VRHouse/PC.js +22 -0
- package/examples/VRHouse/index.js +22 -0
- package/index.d.ts +15 -0
- package/index.js +43 -0
- package/package.json +19 -0
- package/plugins/CSS3DRenderPlugin/components/Marker/index.d.ts +12 -0
- package/plugins/CSS3DRenderPlugin/components/Marker/index.js +113 -0
- package/plugins/CSS3DRenderPlugin/index.d.ts +49 -0
- package/plugins/CSS3DRenderPlugin/index.js +220 -0
- package/plugins/CameraMovementPlugin/index.d.ts +7 -0
- package/plugins/CameraMovementPlugin/index.js +338 -0
- package/plugins/CameraMovementPlugin/typing.d.ts +68 -0
- package/plugins/CameraMovementPlugin/typing.js +35 -0
- package/plugins/ModelChassisCompassPlugin/index.d.ts +15 -0
- package/plugins/ModelChassisCompassPlugin/index.js +156 -0
- package/plugins/ModelEntryDoorGuidePlugin/index.d.ts +10 -0
- package/plugins/ModelEntryDoorGuidePlugin/index.js +16 -0
- package/plugins/ModelTVVideoPlugin/index.d.ts +21 -0
- package/plugins/ModelTVVideoPlugin/index.js +313 -0
- package/plugins/ModelViewPlugin/index.d.ts +17 -0
- package/plugins/ModelViewPlugin/index.js +199 -0
- package/plugins/PanoCursorRaycasterPlugin/PanoCursorRaycasterPluginUsage.d.ts +48 -0
- package/plugins/PanoCursorRaycasterPlugin/components/MovePointTowardsCamera.d.ts +9 -0
- package/plugins/PanoCursorRaycasterPlugin/components/MovePointTowardsCamera.js +113 -0
- package/plugins/PanoCursorRaycasterPlugin/components/PointAxesHelper.d.ts +11 -0
- package/plugins/PanoCursorRaycasterPlugin/components/PointAxesHelper.js +25 -0
- package/plugins/PanoCursorRaycasterPlugin/index.d.ts +49 -0
- package/plugins/PanoCursorRaycasterPlugin/index.js +119 -0
- package/plugins/PanoCursorRaycasterPlugin/utils/addLineToFive.d.ts +5 -0
- package/plugins/PanoCursorRaycasterPlugin/utils/addLineToFive.js +25 -0
- package/plugins/PanoCursorRaycasterPlugin/utils/createLine.d.ts +3 -0
- package/plugins/PanoCursorRaycasterPlugin/utils/createLine.js +34 -0
- package/plugins/PanoCursorRaycasterPlugin/utils/vecror3.d.ts +7 -0
- package/plugins/PanoCursorRaycasterPlugin/utils/vecror3.js +18 -0
- package/plugins/PanoDoorLabelPlugin/index.d.ts +4 -0
- package/plugins/PanoDoorLabelPlugin/index.js +12 -0
- package/plugins/PanoIRobotPlugin/index.d.ts +10 -0
- package/plugins/PanoIRobotPlugin/index.js +16 -0
- package/plugins/PanoRulerPlugin/data/roomInfo.d.ts +3 -0
- package/plugins/PanoRulerPlugin/data/roomInfo.js +49 -0
- package/plugins/PanoRulerPlugin/data/roomRules.d.ts +3 -0
- package/plugins/PanoRulerPlugin/data/roomRules.js +233 -0
- package/plugins/PanoRulerPlugin/index.d.ts +27 -0
- package/plugins/PanoRulerPlugin/index.js +589 -0
- package/plugins/PanoRulerPlugin/typings.d.ts +21 -0
- package/plugins/PanoRulerPlugin/typings.js +5 -0
- package/plugins/PanoTVVideoPlugin/index.d.ts +24 -0
- package/plugins/PanoTVVideoPlugin/index.js +351 -0
- package/plugins/TreasurePlugin/Controller.d.ts +32 -0
- package/plugins/TreasurePlugin/Controller.js +175 -0
- package/plugins/TreasurePlugin/TreasureFaceAnime.d.ts +23 -0
- package/plugins/TreasurePlugin/TreasureFaceAnime.js +128 -0
- package/plugins/TreasurePlugin/TreasureObject.d.ts +35 -0
- package/plugins/TreasurePlugin/TreasureObject.js +186 -0
- package/plugins/TreasurePlugin/TreasureOpenAnime.d.ts +23 -0
- package/plugins/TreasurePlugin/TreasureOpenAnime.js +103 -0
- package/plugins/TreasurePlugin/constants.d.ts +12 -0
- package/plugins/TreasurePlugin/constants.js +30 -0
- package/plugins/TreasurePlugin/index.d.ts +11 -0
- package/plugins/TreasurePlugin/index.js +16 -0
- package/plugins/TreasurePlugin/treasureDataMap.d.ts +7 -0
- package/plugins/TreasurePlugin/treasureDataMap.js +20 -0
- package/plugins/TreasurePlugin/typings.d.ts +2 -0
- package/plugins/TreasurePlugin/typings.js +5 -0
- package/plugins/TreasurePlugin/utils/loadTreasureTextures.d.ts +7 -0
- package/plugins/TreasurePlugin/utils/loadTreasureTextures.js +115 -0
- package/plugins/floorplan/Assets/floorplanExtraObject.d.ts +1 -0
- package/plugins/floorplan/Assets/floorplanExtraObject.js +8 -0
- package/plugins/floorplan/ModelFloorplanPlugin/Controller.d.ts +100 -0
- package/plugins/floorplan/ModelFloorplanPlugin/Controller.js +643 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.d.ts +13 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.js +58 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.d.ts +5 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.js +69 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.d.ts +10 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.js +105 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.d.ts +13 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.js +95 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.d.ts +13 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.js +48 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/index.d.ts +20 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/index.js +66 -0
- package/plugins/floorplan/ModelFloorplanPlugin/controller.style.d.ts +1 -0
- package/plugins/floorplan/ModelFloorplanPlugin/controller.style.js +14 -0
- package/plugins/floorplan/ModelFloorplanPlugin/index.d.ts +9 -0
- package/plugins/floorplan/ModelFloorplanPlugin/index.js +18 -0
- package/plugins/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +23 -0
- package/plugins/floorplan/ModelFloorplanPlugin/typings/events.type.js +5 -0
- package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.d.ts +15 -0
- package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.js +31 -0
- package/plugins/floorplan/ModelFloorplanPlugin/utils/correctFiveState.d.ts +14 -0
- package/plugins/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +162 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.d.ts +13 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.js +91 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.d.ts +3 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.js +35 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.d.ts +5 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.js +50 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.d.ts +9 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.js +102 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.d.ts +11 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.js +42 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.d.ts +17 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.js +75 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.style.d.ts +2 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.style.js +13 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +33 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.js +214 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/index.d.ts +8 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/index.js +18 -0
- package/plugins/floorplan/TopviewFloorplanPlugin/Controller.d.ts +55 -0
- package/plugins/floorplan/TopviewFloorplanPlugin/Controller.js +267 -0
- package/plugins/floorplan/TopviewFloorplanPlugin/index.d.ts +5 -0
- package/plugins/floorplan/TopviewFloorplanPlugin/index.js +16 -0
- package/plugins/floorplan/TopviewFloorplanPlugin/style.d.ts +1 -0
- package/plugins/floorplan/TopviewFloorplanPlugin/style.js +14 -0
- package/plugins/floorplan/components/FloorplanImage.d.ts +7 -0
- package/plugins/floorplan/components/FloorplanImage.js +76 -0
- package/plugins/floorplan/typings/floorplanData.d.ts +127 -0
- package/plugins/floorplan/typings/floorplanData.js +5 -0
- package/plugins/floorplan/typings/floorplanServerData.d.ts +125 -0
- package/plugins/floorplan/typings/floorplanServerData.js +380 -0
- package/plugins/floorplan/utils/formatData.d.ts +5 -0
- package/plugins/floorplan/utils/formatData.js +220 -0
- package/plugins/floorplan/utils/formatPosition.d.ts +37 -0
- package/plugins/floorplan/utils/formatPosition.js +87 -0
- package/shared-utils/Preloader.d.ts +6 -0
- package/shared-utils/Preloader.js +51 -0
- package/shared-utils/Subscribe.d.ts +45 -0
- package/shared-utils/Subscribe.js +210 -0
- package/shared-utils/animationFrame/BetterTween.d.ts +11 -0
- package/shared-utils/animationFrame/BetterTween.js +102 -0
- package/shared-utils/animationFrame/calculateProgress.d.ts +8 -0
- package/shared-utils/animationFrame/calculateProgress.js +38 -0
- package/shared-utils/animationFrame/formatRad.d.ts +15 -0
- package/shared-utils/animationFrame/formatRad.js +34 -0
- package/shared-utils/animationFrame/index.d.ts +15 -0
- package/shared-utils/animationFrame/index.js +69 -0
- package/shared-utils/animationFrame/tween.d.ts +75 -0
- package/shared-utils/animationFrame/tween.js +76 -0
- package/shared-utils/changeModelCanvansOpacity.d.ts +2 -0
- package/shared-utils/changeModelCanvansOpacity.js +24 -0
- package/shared-utils/createFiveContainer.d.ts +10 -0
- package/shared-utils/createFiveContainer.js +165 -0
- package/shared-utils/createLine/index.d.ts +3 -0
- package/shared-utils/createLine/index.js +29 -0
- package/shared-utils/debounce.d.ts +6 -0
- package/shared-utils/debounce.js +26 -0
- package/shared-utils/equal.d.ts +11 -0
- package/shared-utils/equal.js +96 -0
- package/shared-utils/filter.d.ts +27 -0
- package/shared-utils/filter.js +93 -0
- package/shared-utils/five/changeMode.d.ts +2 -0
- package/shared-utils/five/changeMode.js +86 -0
- package/shared-utils/five/useFivePlugin.d.ts +1 -0
- package/shared-utils/five/useFivePlugin.js +15 -0
- package/shared-utils/formatRad.d.ts +7 -0
- package/shared-utils/formatRad.js +16 -0
- package/shared-utils/getPxmm.d.ts +6 -0
- package/shared-utils/getPxmm.js +37 -0
- package/shared-utils/getRandomColor.d.ts +1 -0
- package/shared-utils/getRandomColor.js +13 -0
- package/shared-utils/isTruelyObject.d.ts +18 -0
- package/shared-utils/isTruelyObject.js +27 -0
- package/shared-utils/math/evenNumber.d.ts +1 -0
- package/shared-utils/math/evenNumber.js +11 -0
- package/shared-utils/math/planimetry.d.ts +116 -0
- package/shared-utils/math/planimetry.js +342 -0
- package/shared-utils/math/rad2Deg.d.ts +1 -0
- package/shared-utils/math/rad2Deg.js +10 -0
- package/shared-utils/nearlyEqual.d.ts +7 -0
- package/shared-utils/nearlyEqual.js +17 -0
- package/shared-utils/nextFrame.d.ts +1 -0
- package/shared-utils/nextFrame.js +13 -0
- package/shared-utils/noop.d.ts +5 -0
- package/shared-utils/noop.js +17 -0
- package/shared-utils/object3d2LocalMatrix.d.ts +12 -0
- package/shared-utils/object3d2LocalMatrix.js +73 -0
- package/shared-utils/px2rem.d.ts +1 -0
- package/shared-utils/px2rem.js +12 -0
- package/shared-utils/tap.d.ts +8 -0
- package/shared-utils/tap.js +19 -0
- package/shared-utils/three/centerPoint.d.ts +2 -0
- package/shared-utils/three/centerPoint.js +12 -0
- package/shared-utils/three/getNormal.d.ts +2 -0
- package/shared-utils/three/getNormal.js +13 -0
- package/shared-utils/three/loadFbxObj.d.ts +3 -0
- package/shared-utils/three/loadFbxObj.js +42 -0
- package/shared-utils/three/loadTexture.d.ts +2 -0
- package/shared-utils/three/loadTexture.js +38 -0
- package/shared-utils/three/vecror3.d.ts +7 -0
- package/shared-utils/three/vecror3.js +18 -0
- package/shared-utils/throttle.d.ts +7 -0
- package/shared-utils/throttle.js +25 -0
- package/shared-utils/to.d.ts +9 -0
- package/shared-utils/to.js +25 -0
- package/shared-utils/useDebounce.d.ts +8 -0
- package/shared-utils/useDebounce.js +43 -0
- package/shared-utils/useThrottle.d.ts +8 -0
- package/shared-utils/useThrottle.js +41 -0
- package/shared-utils/uuid.d.ts +4 -0
- package/shared-utils/uuid.js +20 -0
- package/shared-utils/vectorTocoordinates.d.ts +7 -0
- package/shared-utils/vectorTocoordinates.js +16 -0
- package/typedoc/components.d.ts +6 -0
- package/typedoc/components.js +5 -0
- package/typedoc/plugins.d.ts +17 -0
- package/typedoc/plugins.js +113 -0
- package/typedoc/shared-utils.d.ts +3 -0
- package/typedoc/shared-utils.js +5 -0
- package/typedoc/typings.d.ts +3 -0
- package/typedoc/typings.js +5 -0
- package/typings/math.type.d.ts +44 -0
- package/typings/math.type.js +5 -0
- package/typings/utils.type.d.ts +2 -0
- package/typings/utils.type.js +5 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = Camera;
|
|
9
|
+
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _px2rem = _interopRequireDefault(require("../../../../shared-utils/px2rem"));
|
|
13
|
+
|
|
14
|
+
var _rad2Deg = _interopRequireDefault(require("../../../../shared-utils/math/rad2Deg"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
+
|
|
18
|
+
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); }
|
|
19
|
+
|
|
20
|
+
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; }
|
|
21
|
+
|
|
22
|
+
function Camera(props) {
|
|
23
|
+
var observers = props.floorplanData.observers;
|
|
24
|
+
var observer = observers[props.panoIndex];
|
|
25
|
+
var leftRatio = observer.positionInImage.x;
|
|
26
|
+
var topRatio = observer.positionInImage.y;
|
|
27
|
+
var positionStyl = {
|
|
28
|
+
width: 0,
|
|
29
|
+
height: 0,
|
|
30
|
+
position: 'absolute',
|
|
31
|
+
left: leftRatio * 100 + '%',
|
|
32
|
+
top: topRatio * 100 + '%'
|
|
33
|
+
};
|
|
34
|
+
var lng = props.lastPanoramaLongitude;
|
|
35
|
+
var rotate = -(0, _rad2Deg["default"])(lng) + 45;
|
|
36
|
+
var bodyWidth = document.body.clientWidth;
|
|
37
|
+
var size = bodyWidth < 500 ? 24 : 37;
|
|
38
|
+
var rotateBaseStyle = {
|
|
39
|
+
position: 'absolute',
|
|
40
|
+
left: "".concat((0, _px2rem["default"])(-15)),
|
|
41
|
+
top: "".concat((0, _px2rem["default"])(-15)),
|
|
42
|
+
width: "".concat((0, _px2rem["default"])(size)),
|
|
43
|
+
height: "".concat((0, _px2rem["default"])(size)),
|
|
44
|
+
transformOrigin: "".concat((0, _px2rem["default"])(15), " ").concat((0, _px2rem["default"])(15)),
|
|
45
|
+
transform: "rotate(".concat(rotate, "deg)"),
|
|
46
|
+
backgroundImage: "url('//vrlab-image4.ljcdn.com/release/web/default-sidemap-camera.c9772225.png')",
|
|
47
|
+
backgroundRepeat: "no-repeat",
|
|
48
|
+
backgroundSize: "100%"
|
|
49
|
+
};
|
|
50
|
+
var rotateStyle = props.cameraImage ? Object.assign(rotateBaseStyle, props.cameraImage.style) : rotateBaseStyle;
|
|
51
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
className: "floor-plan__camera-position",
|
|
53
|
+
style: positionStyl
|
|
54
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
className: "floor-plan__camera-rotate",
|
|
56
|
+
style: rotateStyle
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = Compass;
|
|
9
|
+
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _px2rem = _interopRequireDefault(require("../../../../shared-utils/px2rem"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
16
|
+
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); }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
function Compass(props) {
|
|
21
|
+
var _props$floorplanData$;
|
|
22
|
+
|
|
23
|
+
var northRad = (_props$floorplanData$ = props.floorplanData.entrance) === null || _props$floorplanData$ === void 0 ? void 0 : _props$floorplanData$.northRad;
|
|
24
|
+
if (!northRad) return null;
|
|
25
|
+
var rotate = rad2Deg(northRad);
|
|
26
|
+
var compassStyle = {
|
|
27
|
+
width: "".concat((0, _px2rem["default"])(231)),
|
|
28
|
+
height: "".concat((0, _px2rem["default"])(41)),
|
|
29
|
+
position: 'absolute',
|
|
30
|
+
left: '50%',
|
|
31
|
+
top: "".concat((0, _px2rem["default"])(-46)),
|
|
32
|
+
transformOrigin: "center ".concat((0, _px2rem["default"])(184)),
|
|
33
|
+
transform: "translateX(-50%) rotate(".concat(-rotate + 90, "deg)")
|
|
34
|
+
};
|
|
35
|
+
var imageStyle = {
|
|
36
|
+
width: '100%',
|
|
37
|
+
height: '100%',
|
|
38
|
+
position: 'absolute',
|
|
39
|
+
left: '0',
|
|
40
|
+
top: '0',
|
|
41
|
+
opacity: '.1',
|
|
42
|
+
background: "url('//vrlab-static.ljcdn.com/release/web/v3/floor-plan-map-compass.b8100c2d.png') no-repeat",
|
|
43
|
+
backgroundSize: '100% 100%'
|
|
44
|
+
};
|
|
45
|
+
var textStyle = {
|
|
46
|
+
position: 'absolute',
|
|
47
|
+
left: '50%',
|
|
48
|
+
top: "".concat((0, _px2rem["default"])(15)),
|
|
49
|
+
transform: 'translateX(-50%)',
|
|
50
|
+
opacity: '.2',
|
|
51
|
+
fontWeight: 'bold',
|
|
52
|
+
fontSize: "".concat((0, _px2rem["default"])(10)),
|
|
53
|
+
color: '#fff'
|
|
54
|
+
};
|
|
55
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
className: "floorplan-plugin__compass",
|
|
57
|
+
style: compassStyle
|
|
58
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
className: "floorplan-plugin__compass-image",
|
|
60
|
+
style: imageStyle
|
|
61
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
62
|
+
className: "floorplan-plugin__compass-text",
|
|
63
|
+
style: textStyle
|
|
64
|
+
}, "\u5317"));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function rad2Deg(rad) {
|
|
68
|
+
return rad / Math.PI * 180;
|
|
69
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Five } from '@realsee/five';
|
|
3
|
+
import { FloorplanData } from '../../../typings/floorplanData';
|
|
4
|
+
export default function RoomHighlight(props: {
|
|
5
|
+
five: Five;
|
|
6
|
+
pxmm: number;
|
|
7
|
+
floorIndex: number;
|
|
8
|
+
floorplanData: FloorplanData;
|
|
9
|
+
onClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => boolean | void;
|
|
10
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = RoomHighlight;
|
|
9
|
+
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _three = require("three");
|
|
13
|
+
|
|
14
|
+
var _formatPosition = _interopRequireWildcard(require("../../../utils/formatPosition"));
|
|
15
|
+
|
|
16
|
+
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); }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
+
|
|
22
|
+
function RoomHighlight(props) {
|
|
23
|
+
if (!props.five.work || !props.five.model) return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
24
|
+
var nowFloorData = props.floorplanData.floorDatas[props.floorIndex];
|
|
25
|
+
var floorplan_observers = props.floorplanData.observers;
|
|
26
|
+
var contentDomRef = React.useRef(null);
|
|
27
|
+
|
|
28
|
+
var handleClick = function handleClick(e) {
|
|
29
|
+
var _props$onClick;
|
|
30
|
+
|
|
31
|
+
if (!contentDomRef.current) return;
|
|
32
|
+
if (((_props$onClick = props.onClick) === null || _props$onClick === void 0 ? void 0 : _props$onClick.call(props, e)) === false) return;
|
|
33
|
+
var boundingClient = contentDomRef.current.getBoundingClientRect(); // 注意 React 对事件做了代理,clientX 和 clientY 不再相对于原 DOM,而是 document
|
|
34
|
+
|
|
35
|
+
var mouseVector = new _three.Vector2(e.clientX, e.clientY);
|
|
36
|
+
var contentOffset = new _three.Vector2(boundingClient.left, boundingClient.top); // 相当于原生 mouseEvent 的 clientX clientY
|
|
37
|
+
|
|
38
|
+
var mouseOriginVector = mouseVector.clone().sub(contentOffset);
|
|
39
|
+
var mouseOffsetVector = new _three.Vector2(mouseOriginVector.x / contentDomRef.current.clientWidth, mouseOriginVector.y / contentDomRef.current.clientHeight);
|
|
40
|
+
var closestPoint = floorplan_observers.filter(function (observer) {
|
|
41
|
+
return observer.floorIndex === props.floorIndex;
|
|
42
|
+
}).sort(function (ob1, ob2) {
|
|
43
|
+
var position1 = new _three.Vector2(ob1.positionInImage.x, ob1.positionInImage.y);
|
|
44
|
+
var position2 = new _three.Vector2(ob2.positionInImage.x, ob2.positionInImage.y);
|
|
45
|
+
return position1.distanceTo(mouseOffsetVector) - position2.distanceTo(mouseOffsetVector);
|
|
46
|
+
})[0];
|
|
47
|
+
props.five.moveToPano(closestPoint.index);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
var highlightStyle = {
|
|
51
|
+
position: 'absolute',
|
|
52
|
+
width: '100%',
|
|
53
|
+
height: '100%',
|
|
54
|
+
pointerEvents: 'all'
|
|
55
|
+
};
|
|
56
|
+
var svgStyle = {
|
|
57
|
+
width: '100%',
|
|
58
|
+
height: '100%',
|
|
59
|
+
overflow: 'visible'
|
|
60
|
+
};
|
|
61
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
62
|
+
ref: contentDomRef,
|
|
63
|
+
className: "floorplan-plugin__room-highlight",
|
|
64
|
+
style: highlightStyle,
|
|
65
|
+
onClick: handleClick
|
|
66
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
67
|
+
style: svgStyle
|
|
68
|
+
}, nowFloorData.rooms.map(function (room) {
|
|
69
|
+
return /*#__PURE__*/React.createElement(Room, _extends({
|
|
70
|
+
key: room.id
|
|
71
|
+
}, props, {
|
|
72
|
+
data: room
|
|
73
|
+
}));
|
|
74
|
+
})));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function Room(props) {
|
|
78
|
+
var bounding = props.floorplanData.bounding;
|
|
79
|
+
|
|
80
|
+
var _pathD = (0, _formatPosition.pathD)(props.data.path, {
|
|
81
|
+
needZ: true,
|
|
82
|
+
format: function format(vector) {
|
|
83
|
+
return (0, _formatPosition["default"])(vector, props.pxmm, bounding);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
var pathElement = React.useRef(null);
|
|
88
|
+
|
|
89
|
+
var handleMouseOver = function handleMouseOver() {
|
|
90
|
+
pathElement.current && (pathElement.current.style.opacity = '0.1');
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
var handleMouseOut = function handleMouseOut() {
|
|
94
|
+
pathElement.current && (pathElement.current.style.opacity = '0');
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
return /*#__PURE__*/React.createElement("path", {
|
|
98
|
+
ref: pathElement,
|
|
99
|
+
d: _pathD,
|
|
100
|
+
fill: "#fff",
|
|
101
|
+
opacity: 0,
|
|
102
|
+
onMouseOver: handleMouseOver,
|
|
103
|
+
onMouseOut: handleMouseOut
|
|
104
|
+
});
|
|
105
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FloorplanData, FloorplanRoomItem } from '../../../typings/floorplanData';
|
|
3
|
+
/** 展示户型图上对应的房间名称和房间面积 */
|
|
4
|
+
export default function RoomLabels(props: {
|
|
5
|
+
floorIndex: number;
|
|
6
|
+
floorplanData: FloorplanData;
|
|
7
|
+
getLabelElement?: (room: FloorplanRoomItem) => Element | null;
|
|
8
|
+
}): JSX.Element | null;
|
|
9
|
+
export declare function RoomLabel(props: {
|
|
10
|
+
room: FloorplanRoomItem;
|
|
11
|
+
floorplanData: FloorplanData;
|
|
12
|
+
getLabelElement?: (room: FloorplanRoomItem) => Element | null;
|
|
13
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.RoomLabel = RoomLabel;
|
|
9
|
+
exports["default"] = RoomLabels;
|
|
10
|
+
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
|
|
13
|
+
var _px2rem = _interopRequireDefault(require("../../../../../shared-utils/px2rem"));
|
|
14
|
+
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
16
|
+
|
|
17
|
+
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); }
|
|
18
|
+
|
|
19
|
+
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; }
|
|
20
|
+
|
|
21
|
+
/** 展示户型图上对应的房间名称和房间面积 */
|
|
22
|
+
function RoomLabels(props) {
|
|
23
|
+
var floorplanData = props.floorplanData,
|
|
24
|
+
floorIndex = props.floorIndex;
|
|
25
|
+
var rooms = floorplanData.floorDatas[floorIndex].rooms;
|
|
26
|
+
if (!rooms) return null;
|
|
27
|
+
var roomLabelsStyle = {
|
|
28
|
+
width: '100%',
|
|
29
|
+
height: '100%',
|
|
30
|
+
position: 'absolute',
|
|
31
|
+
left: '0',
|
|
32
|
+
top: '0',
|
|
33
|
+
zIndex: 20
|
|
34
|
+
};
|
|
35
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: "floorplan-plugin__room-labels",
|
|
37
|
+
style: roomLabelsStyle
|
|
38
|
+
}, rooms.map(function (room) {
|
|
39
|
+
return /*#__PURE__*/React.createElement(RoomLabel, {
|
|
40
|
+
key: room.id,
|
|
41
|
+
room: room,
|
|
42
|
+
floorplanData: props.floorplanData,
|
|
43
|
+
getLabelElement: props.getLabelElement
|
|
44
|
+
});
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function RoomLabel(props) {
|
|
49
|
+
var _props$getLabelElemen, _props$room$size;
|
|
50
|
+
|
|
51
|
+
var label = props.room.roomLabel;
|
|
52
|
+
var left = label.positionInImage.x * 100 + '%';
|
|
53
|
+
var top = label.positionInImage.y * 100 + '%';
|
|
54
|
+
var userConfigElement = (_props$getLabelElemen = props.getLabelElement) === null || _props$getLabelElemen === void 0 ? void 0 : _props$getLabelElemen.call(props, props.room);
|
|
55
|
+
var areaNum = (((_props$room$size = props.room.size) !== null && _props$room$size !== void 0 ? _props$room$size : 0) / 1000000).toFixed(1);
|
|
56
|
+
var itemStyle = {
|
|
57
|
+
left: left,
|
|
58
|
+
top: top,
|
|
59
|
+
position: 'absolute',
|
|
60
|
+
display: 'flex',
|
|
61
|
+
flexFlow: 'column',
|
|
62
|
+
alignItems: 'center',
|
|
63
|
+
fontSize: "".concat((0, _px2rem["default"])(10)),
|
|
64
|
+
color: '#fff',
|
|
65
|
+
transform: 'translate(-50%, -50%)',
|
|
66
|
+
whiteSpace: 'nowrap'
|
|
67
|
+
};
|
|
68
|
+
var bodyWidth = document.body.clientWidth;
|
|
69
|
+
var fontSize = bodyWidth < 500 ? 10 : 14;
|
|
70
|
+
var roomNameStyle = {
|
|
71
|
+
fontSize: "".concat((0, _px2rem["default"])(fontSize))
|
|
72
|
+
};
|
|
73
|
+
var roomSizeStyle = {
|
|
74
|
+
fontSize: "".concat((0, _px2rem["default"])(fontSize)),
|
|
75
|
+
opacity: '0.45'
|
|
76
|
+
};
|
|
77
|
+
if (userConfigElement === null) return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
78
|
+
if (!!userConfigElement) return /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
className: "floorplan-plugin__room-label-item",
|
|
80
|
+
style: itemStyle,
|
|
81
|
+
dangerouslySetInnerHTML: {
|
|
82
|
+
__html: userConfigElement.outerHTML
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
86
|
+
className: "floorplan-plugin__room-label-item",
|
|
87
|
+
style: itemStyle
|
|
88
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
89
|
+
className: "floorplan-plugin__room-name",
|
|
90
|
+
style: roomNameStyle
|
|
91
|
+
}, props.room.name), areaNum && /*#__PURE__*/React.createElement("span", {
|
|
92
|
+
className: "floorplan-plugin__room-size",
|
|
93
|
+
style: roomSizeStyle
|
|
94
|
+
}, "".concat(areaNum, "\u33A1")));
|
|
95
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Five } from '@realsee/five';
|
|
3
|
+
import { FloorplanData, FloorplanRoomItem } from '../../../typings/floorplanData';
|
|
4
|
+
export default function NowFloor(props: {
|
|
5
|
+
five: Five;
|
|
6
|
+
pxmm: number;
|
|
7
|
+
visible: boolean;
|
|
8
|
+
floorIndex: number;
|
|
9
|
+
hoverEnable?: boolean;
|
|
10
|
+
floorplanData: FloorplanData;
|
|
11
|
+
getLabelElement?: (room: FloorplanRoomItem) => Element | null;
|
|
12
|
+
onRoomHeightClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => boolean | void;
|
|
13
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = NowFloor;
|
|
9
|
+
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _RoomLabels = _interopRequireDefault(require("./RoomLabels"));
|
|
13
|
+
|
|
14
|
+
var _RoomHighlight = _interopRequireDefault(require("./RoomHighlight"));
|
|
15
|
+
|
|
16
|
+
var _FloorplanImage = _interopRequireDefault(require("../../../components/FloorplanImage"));
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
25
|
+
|
|
26
|
+
function NowFloor(props) {
|
|
27
|
+
var floorplanData = props.floorplanData,
|
|
28
|
+
floorIndex = props.floorIndex,
|
|
29
|
+
getLabelElement = props.getLabelElement;
|
|
30
|
+
var floorStyle = {
|
|
31
|
+
position: "relative",
|
|
32
|
+
width: "100%",
|
|
33
|
+
height: "100%"
|
|
34
|
+
};
|
|
35
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: "now-floor",
|
|
37
|
+
style: floorStyle
|
|
38
|
+
}, !!props.hoverEnable && props.visible && /*#__PURE__*/React.createElement(_RoomHighlight["default"], _extends({}, props, {
|
|
39
|
+
onClick: props.onRoomHeightClick
|
|
40
|
+
})), /*#__PURE__*/React.createElement(_FloorplanImage["default"], {
|
|
41
|
+
floorplanData: floorplanData,
|
|
42
|
+
floorIndex: floorIndex
|
|
43
|
+
}), /*#__PURE__*/React.createElement(_RoomLabels["default"], {
|
|
44
|
+
floorplanData: floorplanData,
|
|
45
|
+
floorIndex: floorIndex,
|
|
46
|
+
getLabelElement: getLabelElement
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Five } from '@realsee/five';
|
|
3
|
+
import { FloorplanData, FloorplanRoomItem } from '../../typings/floorplanData';
|
|
4
|
+
declare const _default: React.NamedExoticComponent<{
|
|
5
|
+
five: Five;
|
|
6
|
+
pxmm: number;
|
|
7
|
+
visible: boolean;
|
|
8
|
+
duration: number;
|
|
9
|
+
panoIndex: number;
|
|
10
|
+
floorIndex: number;
|
|
11
|
+
hoverEnable?: boolean | undefined;
|
|
12
|
+
lastPanoramaLongitude: number;
|
|
13
|
+
floorplanData?: FloorplanData | undefined;
|
|
14
|
+
cameraImage?: {
|
|
15
|
+
style: React.CSSProperties;
|
|
16
|
+
} | undefined;
|
|
17
|
+
getLabelElement?: ((room: FloorplanRoomItem) => Element | null) | undefined;
|
|
18
|
+
onRoomHeightClick?: ((e: React.MouseEvent<HTMLDivElement, MouseEvent>) => boolean | void) | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _Camera = _interopRequireDefault(require("./Camera"));
|
|
13
|
+
|
|
14
|
+
var _Compass = _interopRequireDefault(require("./Compass"));
|
|
15
|
+
|
|
16
|
+
var _NowFloor = _interopRequireDefault(require("./NowFloor"));
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
25
|
+
|
|
26
|
+
var _default = /*#__PURE__*/React.memo(function Main(props) {
|
|
27
|
+
if (!props.floorplanData) return null;
|
|
28
|
+
var mainRef = React.useRef(null);
|
|
29
|
+
var mainStyle = {
|
|
30
|
+
opacity: 0,
|
|
31
|
+
width: "100%",
|
|
32
|
+
height: "100%"
|
|
33
|
+
};
|
|
34
|
+
React.useEffect(function handleOpacity() {
|
|
35
|
+
if (!mainRef.current) return;
|
|
36
|
+
var oldOpacity = mainRef.current.style.opacity;
|
|
37
|
+
var opacity = props.visible ? 1 : 0;
|
|
38
|
+
if (opacity.toString() === oldOpacity) return;
|
|
39
|
+
|
|
40
|
+
if (props.duration === 0) {
|
|
41
|
+
mainRef.current.style.transition = 'null';
|
|
42
|
+
mainRef.current.style.opacity = opacity.toString();
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
mainRef.current.style.transition = "opacity linear ".concat(props.duration, "ms");
|
|
47
|
+
mainRef.current.style.opacity = opacity.toString();
|
|
48
|
+
});
|
|
49
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
className: "floorplan-main",
|
|
51
|
+
ref: mainRef,
|
|
52
|
+
style: mainStyle
|
|
53
|
+
}, /*#__PURE__*/React.createElement(_NowFloor["default"], _extends({}, props, {
|
|
54
|
+
floorplanData: props.floorplanData
|
|
55
|
+
})), /*#__PURE__*/React.createElement(_Camera["default"], _extends({}, props, {
|
|
56
|
+
floorplanData: props.floorplanData
|
|
57
|
+
})), /*#__PURE__*/React.createElement(_Compass["default"], {
|
|
58
|
+
floorplanData: props.floorplanData
|
|
59
|
+
}));
|
|
60
|
+
}, function (prev, next) {
|
|
61
|
+
return Object.keys(prev).every(function (key) {
|
|
62
|
+
return next[key] === prev[key];
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pluginStyle: Partial<CSSStyleDeclaration>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.pluginStyle = void 0;
|
|
7
|
+
var pluginStyle = {
|
|
8
|
+
position: 'absolute',
|
|
9
|
+
left: '50%',
|
|
10
|
+
top: '50%',
|
|
11
|
+
transform: 'translate(-50%, -50%)',
|
|
12
|
+
pointerEvents: 'none'
|
|
13
|
+
};
|
|
14
|
+
exports.pluginStyle = pluginStyle;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FivePlugin } from '@realsee/five';
|
|
2
|
+
import FloorplanPluginController, { ModelFloorplanParameterType } from './Controller';
|
|
3
|
+
export declare const ModelFloorplanPlugin: FivePlugin<ModelFloorplanParameterType, ModelFloorplanPluginReturnType>;
|
|
4
|
+
export default ModelFloorplanPlugin;
|
|
5
|
+
export declare type ModelFloorplanPluginReturnType = FloorplanPluginController;
|
|
6
|
+
export type { ModelFloorplanViewEvent } from './typings/events.type';
|
|
7
|
+
export type { FloorplanErrorType as ModelFloorplanErrorType } from './utils/constant';
|
|
8
|
+
export type { ModelFloorplanPluginsConfigs, ModelFloorplanParameterType } from './Controller';
|
|
9
|
+
export type { FloorplanEventHandlers as ModelFloorplanEventHandlers } from './typings/events.type';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.ModelFloorplanPlugin = void 0;
|
|
7
|
+
|
|
8
|
+
var _Controller = _interopRequireDefault(require("./Controller"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
|
|
12
|
+
var ModelFloorplanPlugin = function ModelFloorplanPlugin(five, params) {
|
|
13
|
+
return new _Controller["default"](five, params);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.ModelFloorplanPlugin = ModelFloorplanPlugin;
|
|
17
|
+
var _default = ModelFloorplanPlugin;
|
|
18
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface ModelFloorplanViewEvent {
|
|
2
|
+
/** 是否是用户滑动模型导致的户型图自动展示/消失 */
|
|
3
|
+
auto: boolean;
|
|
4
|
+
/** 是否是用户操作 */
|
|
5
|
+
userAction: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare type FloorplanEventHandlers = {
|
|
8
|
+
/**
|
|
9
|
+
* 展示结束的回调
|
|
10
|
+
* * @param event.auto 是否是自动展示
|
|
11
|
+
*/
|
|
12
|
+
showAnimationEnded: (event: ModelFloorplanViewEvent) => void;
|
|
13
|
+
/**
|
|
14
|
+
* 隐藏的回调
|
|
15
|
+
* @param event.auto 是否是自动隐藏
|
|
16
|
+
*/
|
|
17
|
+
hide: (event: ModelFloorplanViewEvent) => void;
|
|
18
|
+
/**
|
|
19
|
+
* 点击户型图的回调
|
|
20
|
+
* @return 当返回 false 时,会阻止默认行为
|
|
21
|
+
*/
|
|
22
|
+
click: () => boolean | void;
|
|
23
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const enum FloorplanErrorType {
|
|
2
|
+
UnknowError = "UnknowError",
|
|
3
|
+
DataNotLoaded = "DataNotLoaded",
|
|
4
|
+
BreakOffByHide = "BreakOffByHide",
|
|
5
|
+
ModelNotLoaded = "ModelNotLoaded",
|
|
6
|
+
ChangeModeError = "ChangeModeError",
|
|
7
|
+
UpdateCameraError = "UpdateCameraError",
|
|
8
|
+
DifferentShowParams = "DifferentShowParams"
|
|
9
|
+
}
|
|
10
|
+
/** 户型图展示 & 模型消失的默认时间 */
|
|
11
|
+
export declare const SHOW_ANIME_DURATION = 500;
|
|
12
|
+
/** Five camera 默认 fov */
|
|
13
|
+
export declare const FIVE_CAMERA_DEFAULT_FOV = 80;
|
|
14
|
+
/** 展示户型图时,默认模型的透明度 */
|
|
15
|
+
export declare const DEFAULT_SHOW_MODEL_OPACITY = 0.01;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SHOW_ANIME_DURATION = exports.FloorplanErrorType = exports.FIVE_CAMERA_DEFAULT_FOV = exports.DEFAULT_SHOW_MODEL_OPACITY = void 0;
|
|
7
|
+
var FloorplanErrorType;
|
|
8
|
+
/** 户型图展示 & 模型消失的默认时间 */
|
|
9
|
+
|
|
10
|
+
exports.FloorplanErrorType = FloorplanErrorType;
|
|
11
|
+
|
|
12
|
+
(function (FloorplanErrorType) {
|
|
13
|
+
FloorplanErrorType["UnknowError"] = "UnknowError";
|
|
14
|
+
FloorplanErrorType["DataNotLoaded"] = "DataNotLoaded";
|
|
15
|
+
FloorplanErrorType["BreakOffByHide"] = "BreakOffByHide";
|
|
16
|
+
FloorplanErrorType["ModelNotLoaded"] = "ModelNotLoaded";
|
|
17
|
+
FloorplanErrorType["ChangeModeError"] = "ChangeModeError";
|
|
18
|
+
FloorplanErrorType["UpdateCameraError"] = "UpdateCameraError";
|
|
19
|
+
FloorplanErrorType["DifferentShowParams"] = "DifferentShowParams";
|
|
20
|
+
})(FloorplanErrorType || (exports.FloorplanErrorType = FloorplanErrorType = {}));
|
|
21
|
+
|
|
22
|
+
var SHOW_ANIME_DURATION = 500;
|
|
23
|
+
/** Five camera 默认 fov */
|
|
24
|
+
|
|
25
|
+
exports.SHOW_ANIME_DURATION = SHOW_ANIME_DURATION;
|
|
26
|
+
var FIVE_CAMERA_DEFAULT_FOV = 80;
|
|
27
|
+
/** 展示户型图时,默认模型的透明度 */
|
|
28
|
+
|
|
29
|
+
exports.FIVE_CAMERA_DEFAULT_FOV = FIVE_CAMERA_DEFAULT_FOV;
|
|
30
|
+
var DEFAULT_SHOW_MODEL_OPACITY = 0.01;
|
|
31
|
+
exports.DEFAULT_SHOW_MODEL_OPACITY = DEFAULT_SHOW_MODEL_OPACITY;
|