@realsee/vreo 0.2.0-alpha.9 → 1.0.0-alpha.2
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/CHANGELOG.md +30 -0
- package/README.md +16 -5
- package/docs/assets/highlight.css +1 -1
- package/docs/assets/main.js +2 -2
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +28 -2
- package/docs/classes/Player.AudioLike.html +52 -0
- package/docs/classes/Player.Controller.html +13 -13
- package/docs/classes/Player.Player-1.html +11 -11
- package/docs/classes/Player.VideoAgentMesh.html +53 -53
- package/docs/classes/Player.VideoAgentScene.html +1 -1
- package/docs/demo/assets/AppReact.d0ee843a.js +1 -0
- package/docs/demo/assets/default.63925584.js +3984 -0
- package/docs/demo/assets/default.f3f3ca8c.css +1 -0
- package/docs/demo/assets/dynamic.76506c2c.js +1 -0
- package/docs/demo/assets/examples.3d8323db.js +25 -0
- package/docs/demo/assets/examples.dac4a6fe.css +1 -0
- package/docs/demo/assets/index.7e31122c.js +1 -0
- package/docs/demo/assets/index.9331038f.css +1 -0
- package/docs/demo/assets/main.79b11b9d.js +1 -0
- package/docs/demo/assets/react.2ee8565f.css +1 -0
- package/docs/demo/assets/react.c1c07c14.js +25 -0
- package/docs/demo/assets/znRoyv06SZQeqA7m.0057e8ae.js +1 -0
- package/docs/demo/examples.html +17 -0
- package/docs/demo/index-react-dynamic.html +20 -0
- package/docs/demo/index-react.html +20 -0
- package/docs/demo/index.html +19 -0
- package/docs/enums/Player.InfoPanelStyleEnum.html +1 -1
- package/docs/enums/Player.InfoPanelTypeEnum.html +2 -2
- package/docs/enums/Player.PanoEffectEnum.html +2 -2
- package/docs/enums/Player.PanoTagEnum.html +2 -2
- package/docs/enums/Player.PanoTagStyleEnum.html +7 -0
- package/docs/enums/Player.VreoKeyframeEnum.html +12 -12
- package/docs/enums/fivePlugins.CameraMovementEffect.html +1 -1
- package/docs/enums/fivePlugins.Rotation.html +1 -1
- package/docs/index.html +13 -6
- package/docs/interfaces/Player.CustomVreoKeyframeProps.html +1 -1
- package/docs/interfaces/Player.PlayerConfigs.html +4 -3
- package/docs/interfaces/Player.Vertex.html +2 -2
- package/docs/interfaces/Player.VideoAgentMeshOptions.html +8 -1
- package/docs/interfaces/Player.VreoKeyframe.html +2 -2
- package/docs/interfaces/Player.VreoUnit.html +2 -2
- package/docs/interfaces/Player.VreoVideo.html +2 -2
- package/docs/interfaces/fivePlugins.CSS3DRenderPluginExportType.html +4 -0
- package/docs/interfaces/fivePlugins.CameraMovementOptsCallback.html +1 -1
- package/docs/interfaces/fivePlugins.CameraMovementPluginExportType.html +2 -2
- package/docs/interfaces/fivePlugins.CameraMovementPluginParameterType.html +1 -1
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginData.html +1 -1
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginExportType.html +1 -1
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginParameterType.html +1 -1
- package/docs/interfaces/fivePlugins.Vector3Position.html +3 -0
- package/docs/interfaces/react.VreoActionCallbacks.html +15 -7
- package/docs/interfaces/react.VreoProviderProps.html +1 -1
- package/docs/modules/Player.html +21 -15
- package/docs/modules/custom.html +1 -1
- package/docs/modules/fivePlugins.html +5 -2
- package/docs/modules/react.html +1 -1
- package/docs/modules.html +1 -1
- package/lib/PlayController/index.js +4 -5
- package/lib/Player/App.js +9 -7
- package/lib/Player/Controller.d.ts +29 -8
- package/lib/Player/Controller.js +193 -27
- package/lib/Player/custom/SpatialScenePanel/index.js +5 -4
- package/lib/Player/hooks.js +2 -2
- package/lib/Player/index.d.ts +5 -3
- package/lib/Player/index.js +97 -53
- package/lib/Player/modules/Drawer/index.js +1 -1
- package/lib/Player/modules/PopUp/index.js +1 -1
- package/lib/Player/modules/ResizeObserver/index.d.ts +2 -0
- package/lib/Player/modules/ResizeObserver/index.js +37 -0
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +16 -2
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +132 -59
- package/lib/Player/modules/VideoAgent/VideoAgentScene.d.ts +3 -6
- package/lib/Player/modules/VideoAgent/VideoAgentScene.js +31 -36
- package/lib/Player/modules/VideoAgent/index.js +53 -12
- package/lib/Player/modules/Wave/index.d.ts +5 -0
- package/lib/Player/modules/Wave/index.js +51 -0
- package/lib/Player/modules/keyframes/BgMusic/index.js +1 -1
- package/lib/Player/modules/keyframes/CameraMovement/index.js +1 -1
- package/lib/Player/modules/keyframes/InfoPanel/index.js +22 -10
- package/lib/Player/modules/keyframes/ModelVideo/index.js +46 -9
- package/lib/Player/modules/keyframes/PanoEffect/index.js +1 -1
- package/lib/Player/modules/keyframes/PanoEffect/lineAnime.js +1 -1
- package/lib/Player/modules/keyframes/PanoTag/index.d.ts +1 -2
- package/lib/Player/modules/keyframes/PanoTag/index.js +79 -119
- package/lib/Player/modules/keyframes/PanoTextLabel/index.d.ts +3 -0
- package/lib/Player/modules/keyframes/PanoTextLabel/index.js +96 -44
- package/lib/Player/modules/keyframes/Prompter/index.js +10 -23
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +10 -6
- package/lib/Player/modules/keyframes/VideoEffect/index.js +1 -1
- package/lib/Player/typings.d.ts +12 -1
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.d.ts +2 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.js +12 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.d.ts +7 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.js +32 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.d.ts +3 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.js +11 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/index.d.ts +56 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/index.js +275 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.d.ts +7 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.js +18 -0
- package/lib/fivePlugins/CameraMovementPlugin/index.js +13 -12
- package/lib/fivePlugins/ModelTVVideoPlugin/index.js +1 -1
- package/lib/react/index.d.ts +8 -4
- package/lib/react/index.js +3 -3
- package/lib/shared-utils/AduioLike.d.ts +37 -0
- package/lib/shared-utils/AduioLike.js +166 -0
- package/lib/shared-utils/addResizeListener.d.ts +4 -0
- package/lib/shared-utils/addResizeListener.js +51 -0
- package/lib/shared-utils/animationFrame/BetterTween.js +7 -3
- package/lib/shared-utils/animationFrame/tween.js +1 -1
- package/lib/shared-utils/createTransMatrix.d.ts +1 -0
- package/lib/shared-utils/createTransMatrix.js +43 -0
- package/lib/shared-utils/getFileExpandedName.d.ts +1 -0
- package/lib/shared-utils/getFileExpandedName.js +13 -0
- package/lib/shared-utils/getMediaInfo.d.ts +9 -0
- package/lib/shared-utils/getMediaInfo.js +75 -0
- package/lib/shared-utils/setElementDataset.d.ts +1 -0
- package/lib/shared-utils/setElementDataset.js +24 -0
- package/lib/typings/VreoUnit.d.ts +37 -2
- package/lib/typings/VreoUnit.js +13 -1
- package/package.json +10 -10
- package/resources/PlayController/index.ts +0 -13
- package/resources/Player/App.tsx +5 -4
- package/resources/Player/Controller.ts +277 -146
- package/resources/Player/custom/SpatialScenePanel/index.tsx +5 -5
- package/resources/Player/hooks.ts +3 -5
- package/resources/Player/index.tsx +189 -141
- package/resources/Player/modules/ResizeObserver/index.tsx +23 -0
- package/resources/Player/modules/VideoAgent/VideoAgentMesh.ts +87 -31
- package/resources/Player/modules/VideoAgent/VideoAgentScene.ts +27 -24
- package/resources/Player/modules/VideoAgent/index.tsx +28 -12
- package/resources/Player/modules/Wave/index.tsx +18 -0
- package/resources/Player/modules/keyframes/InfoPanel/index.tsx +26 -11
- package/resources/Player/modules/keyframes/ModelVideo/index.tsx +36 -3
- package/resources/Player/modules/keyframes/PanoTag/index.tsx +53 -97
- package/resources/Player/modules/keyframes/PanoTextLabel/index.tsx +86 -34
- package/resources/Player/modules/keyframes/Prompter/index.tsx +6 -16
- package/resources/Player/modules/keyframes/UpdateVRPanorama/index.tsx +6 -2
- package/resources/Player/typings.ts +15 -1
- package/resources/fivePlugins/CSS3DRenderPlugin/centerPoint.ts +5 -0
- package/resources/fivePlugins/CSS3DRenderPlugin/createResizeObserver.ts +17 -0
- package/resources/fivePlugins/CSS3DRenderPlugin/evenNumber.ts +4 -0
- package/resources/fivePlugins/CSS3DRenderPlugin/index.ts +254 -0
- package/resources/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.ts +5 -0
- package/resources/fivePlugins/CameraMovementPlugin/index.ts +19 -12
- package/resources/react/index.tsx +7 -3
- package/resources/shared-utils/AduioLike.ts +109 -0
- package/resources/shared-utils/addResizeListener.ts +46 -0
- package/resources/shared-utils/createTransMatrix.ts +12 -0
- package/resources/shared-utils/getFileExpandedName.ts +6 -0
- package/resources/shared-utils/getMediaInfo.ts +52 -0
- package/resources/shared-utils/setElementDataset.ts +18 -0
- package/resources/typings/VreoUnit.ts +41 -3
- package/stylesheets/custom/SpatialScenePanel.css +2 -1
- package/stylesheets/default.css +348 -84
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -21,28 +21,38 @@ function InfoPanelImg(_ref) {
|
|
|
21
21
|
var url = _ref.url,
|
|
22
22
|
children = _ref.children;
|
|
23
23
|
return /*#__PURE__*/React.createElement("div", {
|
|
24
|
+
className: "vreo-infoPanel-container"
|
|
25
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
24
26
|
className: "vreo-infoPanel vreo-infoPanel--img"
|
|
25
|
-
},
|
|
27
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
28
|
+
className: "ratio-4-5 vreo-infoPanel-wrapper"
|
|
29
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
className: "vreo-infoPanel-inner"
|
|
31
|
+
}, children, /*#__PURE__*/React.createElement("img", {
|
|
26
32
|
className: "vreo-infoPanelImg",
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
}));
|
|
33
|
+
src: url
|
|
34
|
+
})))));
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
function InfoPanelVideo(_ref2) {
|
|
34
38
|
var url = _ref2.url,
|
|
35
39
|
children = _ref2.children;
|
|
36
40
|
return /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
className: "vreo-infoPanel-container"
|
|
42
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
37
43
|
className: "vreo-infoPanel vreo-infoPanel--video"
|
|
44
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
className: "ratio-4-5 vreo-infoPanel-wrapper"
|
|
46
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
47
|
+
className: "vreo-infoPanel-inner"
|
|
38
48
|
}, children, /*#__PURE__*/React.createElement("div", {
|
|
39
|
-
className: "vreo-
|
|
49
|
+
className: "vreo-infoPanelVideo"
|
|
40
50
|
}, /*#__PURE__*/React.createElement("video", {
|
|
41
51
|
playsInline: true,
|
|
42
52
|
autoPlay: true,
|
|
43
53
|
className: "vreo-infoPanelVideo",
|
|
44
54
|
src: url
|
|
45
|
-
})));
|
|
55
|
+
}))))));
|
|
46
56
|
}
|
|
47
57
|
|
|
48
58
|
var Title = function Title(props) {
|
|
@@ -50,13 +60,15 @@ var Title = function Title(props) {
|
|
|
50
60
|
return null;
|
|
51
61
|
}
|
|
52
62
|
|
|
53
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
64
|
+
className: "vreo-infoPanel-title-shadow"
|
|
65
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
54
66
|
className: "vreo-infoPanel-title"
|
|
55
67
|
}, /*#__PURE__*/React.createElement("div", {
|
|
56
68
|
className: "vreo-infoPanel-t1"
|
|
57
69
|
}, props.title), /*#__PURE__*/React.createElement("div", {
|
|
58
70
|
className: "vreo-infoPanel-t2"
|
|
59
|
-
}, props.subTitle));
|
|
71
|
+
}, props.subTitle)));
|
|
60
72
|
};
|
|
61
73
|
|
|
62
74
|
function InfoPanel() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -9,11 +9,15 @@ exports.ModelVideo = ModelVideo;
|
|
|
9
9
|
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
+
var THREE = _interopRequireWildcard(require("three"));
|
|
13
|
+
|
|
14
|
+
var _hooks = require("../../../hooks");
|
|
15
|
+
|
|
12
16
|
var _ModelTVVideoPlugin = require("../../../../fivePlugins/ModelTVVideoPlugin");
|
|
13
17
|
|
|
14
|
-
var
|
|
18
|
+
var _createTransMatrix = require("../../../../shared-utils/createTransMatrix");
|
|
15
19
|
|
|
16
|
-
var
|
|
20
|
+
var _VreoUnit = require("../../../../typings/VreoUnit");
|
|
17
21
|
|
|
18
22
|
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
23
|
|
|
@@ -33,7 +37,7 @@ function ModelVideo() {
|
|
|
33
37
|
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(keyframe) {
|
|
34
38
|
var _controller$configs, _controller$configs$v;
|
|
35
39
|
|
|
36
|
-
var start, end, _ref2, videoSrc, videoPosterSrc, vertexs;
|
|
40
|
+
var start, end, _ref2, videoSrc, videoPosterSrc, vertexs, matrixWorld, position, points;
|
|
37
41
|
|
|
38
42
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
39
43
|
while (1) {
|
|
@@ -44,16 +48,49 @@ function ModelVideo() {
|
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
start = keyframe.start, end = keyframe.end;
|
|
47
|
-
_ref2 = keyframe.data, videoSrc = _ref2.videoSrc, videoPosterSrc = _ref2.videoPosterSrc, vertexs = _ref2.vertexs;
|
|
51
|
+
_ref2 = keyframe.data, videoSrc = _ref2.videoSrc, videoPosterSrc = _ref2.videoPosterSrc, vertexs = _ref2.vertexs, matrixWorld = _ref2.matrixWorld;
|
|
52
|
+
|
|
53
|
+
position = function () {
|
|
54
|
+
if (vertexs.length < 4) {
|
|
55
|
+
throw new Error('ModelVideo: 顶点数据集合不够,无法组成矩形 ....');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (vertexs.length === 4) {
|
|
59
|
+
return vertexs;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
var box = new THREE.Box3();
|
|
63
|
+
vertexs.forEach(function (v) {
|
|
64
|
+
return box.expandByPoint(new THREE.Vector3(v.x, v.y, v.z));
|
|
65
|
+
});
|
|
66
|
+
return [new THREE.Vector3(box.min.x, box.max.y, box.max.z), new THREE.Vector3(box.min.x, box.min.y, box.max.z), new THREE.Vector3(box.max.x, box.min.y, box.max.z), new THREE.Vector3(box.max.x, box.max.y, box.max.z)];
|
|
67
|
+
}();
|
|
68
|
+
|
|
69
|
+
points = function () {
|
|
70
|
+
if (matrixWorld) {
|
|
71
|
+
var transMatrix = (0, _createTransMatrix.createTransMatrix)(matrixWorld);
|
|
72
|
+
return [position.map(function (p) {
|
|
73
|
+
var res = transMatrix([p.x, p.y, p.z]);
|
|
74
|
+
return {
|
|
75
|
+
x: res[0],
|
|
76
|
+
y: res[1],
|
|
77
|
+
z: res[2]
|
|
78
|
+
};
|
|
79
|
+
})];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return [position];
|
|
83
|
+
}();
|
|
84
|
+
|
|
48
85
|
ref.current.disable();
|
|
49
|
-
_context.next =
|
|
86
|
+
_context.next = 8;
|
|
50
87
|
return ref.current.load({
|
|
51
88
|
video_src: videoSrc,
|
|
52
89
|
video_poster_src: videoPosterSrc,
|
|
53
|
-
points:
|
|
90
|
+
points: points
|
|
54
91
|
}, (_controller$configs = controller.configs) === null || _controller$configs === void 0 ? void 0 : (_controller$configs$v = _controller$configs.videos) === null || _controller$configs$v === void 0 ? void 0 : _controller$configs$v.modelTVVideo);
|
|
55
92
|
|
|
56
|
-
case
|
|
93
|
+
case 8:
|
|
57
94
|
ref.current.enable();
|
|
58
95
|
timeoutRef.current = setTimeout(function () {
|
|
59
96
|
var _ref$current;
|
|
@@ -61,7 +98,7 @@ function ModelVideo() {
|
|
|
61
98
|
return (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.disable();
|
|
62
99
|
}, end - start);
|
|
63
100
|
|
|
64
|
-
case
|
|
101
|
+
case 10:
|
|
65
102
|
case "end":
|
|
66
103
|
return _context.stop();
|
|
67
104
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function PanoTag(): JSX.Element;
|
|
1
|
+
export declare function PanoTag(): null;
|
|
@@ -1,55 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.PanoTag = PanoTag;
|
|
9
9
|
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
|
|
12
10
|
var React = _interopRequireWildcard(require("react"));
|
|
13
11
|
|
|
14
|
-
var _three = require("three");
|
|
15
|
-
|
|
16
12
|
var _hooks = require("../../../hooks");
|
|
17
13
|
|
|
18
14
|
var _VreoUnit = require("../../../../typings/VreoUnit");
|
|
19
15
|
|
|
16
|
+
var _dnalogel = require("@realsee/dnalogel");
|
|
17
|
+
|
|
20
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); }
|
|
21
19
|
|
|
22
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; }
|
|
23
21
|
|
|
24
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
-
|
|
26
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
-
|
|
28
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
-
|
|
30
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
31
|
-
|
|
32
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
33
|
-
|
|
34
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
35
|
-
|
|
36
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
-
|
|
38
22
|
function PanoTag() {
|
|
39
|
-
var _React$useState = React.useState(null),
|
|
40
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
41
|
-
state = _React$useState2[0],
|
|
42
|
-
setState = _React$useState2[1];
|
|
43
|
-
|
|
44
|
-
var _React$useState3 = React.useState(null),
|
|
45
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
46
|
-
pos = _React$useState4[0],
|
|
47
|
-
setPos = _React$useState4[1];
|
|
48
|
-
|
|
49
23
|
var timeoutRef = React.useRef();
|
|
50
24
|
var controller = (0, _hooks.useController)();
|
|
51
25
|
var five = (0, _hooks.useFiveInstance)();
|
|
52
|
-
var
|
|
26
|
+
var panoTagPlugin = React.useRef((0, _dnalogel.PanoTagPlugin)(five, {
|
|
27
|
+
config: {
|
|
28
|
+
globalConfig: {
|
|
29
|
+
visibleConfig: {
|
|
30
|
+
keep: 'visible'
|
|
31
|
+
},
|
|
32
|
+
unfoldedConfig: {
|
|
33
|
+
autoUnfold: {
|
|
34
|
+
strategy: 'MinimumDistance'
|
|
35
|
+
},
|
|
36
|
+
unfoldDistance: {
|
|
37
|
+
max: 100
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
53
43
|
React.useEffect(function () {
|
|
54
44
|
var _controller$configs;
|
|
55
45
|
|
|
@@ -58,32 +48,70 @@ function PanoTag() {
|
|
|
58
48
|
}
|
|
59
49
|
|
|
60
50
|
var callback = function callback(keyframe) {
|
|
51
|
+
if (!panoTagPlugin.current) return;
|
|
61
52
|
var start = keyframe.start,
|
|
62
53
|
end = keyframe.end,
|
|
63
54
|
data = keyframe.data;
|
|
64
55
|
var panoTagData = data;
|
|
65
|
-
var
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
var
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
56
|
+
var id = 'any-id';
|
|
57
|
+
var pointType = _dnalogel.PointType.PointTag;
|
|
58
|
+
var dimensionType = _dnalogel.DimensionType.Two;
|
|
59
|
+
var position = [panoTagData.vertex.x, panoTagData.vertex.y, panoTagData.vertex.z];
|
|
60
|
+
|
|
61
|
+
var tag = function () {
|
|
62
|
+
if (panoTagData.imgUrl) {
|
|
63
|
+
return {
|
|
64
|
+
id: id,
|
|
65
|
+
pointType: pointType,
|
|
66
|
+
position: position,
|
|
67
|
+
dimensionType: dimensionType,
|
|
68
|
+
contentType: _dnalogel.ContentType.ImageText,
|
|
69
|
+
data: {
|
|
70
|
+
text: panoTagData.text,
|
|
71
|
+
mediaData: [{
|
|
72
|
+
type: 'Image',
|
|
73
|
+
url: panoTagData.imgUrl
|
|
74
|
+
}]
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
} else {
|
|
78
|
+
return {
|
|
79
|
+
id: id,
|
|
80
|
+
pointType: pointType,
|
|
81
|
+
position: position,
|
|
82
|
+
dimensionType: dimensionType,
|
|
83
|
+
contentType: _dnalogel.ContentType.Text,
|
|
84
|
+
data: {
|
|
85
|
+
text: panoTagData.text
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}(); // show
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
panoTagPlugin.current.load({
|
|
93
|
+
tagList: [tag]
|
|
83
94
|
});
|
|
84
95
|
timeoutRef.current = setTimeout(function () {
|
|
85
|
-
|
|
86
|
-
|
|
96
|
+
var _tag$hooks;
|
|
97
|
+
|
|
98
|
+
var id = Date.now(); // clear
|
|
99
|
+
|
|
100
|
+
var tag = panoTagPlugin.current.getTagById(id);
|
|
101
|
+
|
|
102
|
+
if (tag.state) {
|
|
103
|
+
tag.state.unfolded = false;
|
|
104
|
+
panoTagPlugin.current.updateRenderAllTags();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
(_tag$hooks = tag.hooks) === null || _tag$hooks === void 0 ? void 0 : _tag$hooks.on('folded', function () {
|
|
108
|
+
setTimeout(function () {
|
|
109
|
+
if (tag.state) {
|
|
110
|
+
tag.state.visible = false;
|
|
111
|
+
panoTagPlugin.current.destroyTagById(id);
|
|
112
|
+
}
|
|
113
|
+
}, 1500);
|
|
114
|
+
});
|
|
87
115
|
}, end - start);
|
|
88
116
|
};
|
|
89
117
|
|
|
@@ -96,73 +124,5 @@ function PanoTag() {
|
|
|
96
124
|
}
|
|
97
125
|
};
|
|
98
126
|
}, [controller]);
|
|
99
|
-
|
|
100
|
-
var callback = function callback() {
|
|
101
|
-
if (!(state !== null && state !== void 0 && state.vertex)) return;
|
|
102
|
-
var _state$vertex = state.vertex,
|
|
103
|
-
x = _state$vertex.x,
|
|
104
|
-
y = _state$vertex.y,
|
|
105
|
-
z = _state$vertex.z;
|
|
106
|
-
var res = project2d(new _three.Vector3(x, y, z));
|
|
107
|
-
if (!res) return;
|
|
108
|
-
var left = res.x,
|
|
109
|
-
top = res.y;
|
|
110
|
-
setPos({
|
|
111
|
-
left: left,
|
|
112
|
-
top: top
|
|
113
|
-
});
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
five.on('currentStateChange', callback);
|
|
117
|
-
return function () {
|
|
118
|
-
five.off('currentStateChange', callback);
|
|
119
|
-
};
|
|
120
|
-
}, [state === null || state === void 0 ? void 0 : state.vertex]);
|
|
121
|
-
|
|
122
|
-
var boxContent = function () {
|
|
123
|
-
if (!state) return undefined;
|
|
124
|
-
|
|
125
|
-
if (state.type === _VreoUnit.PanoTagEnum.Text) {
|
|
126
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, state.text));
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (state.type === _VreoUnit.PanoTagEnum.Image) {
|
|
130
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("img", {
|
|
131
|
-
className: "PanoTag-img",
|
|
132
|
-
src: state.imgUrl,
|
|
133
|
-
alt: state.text || ''
|
|
134
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
135
|
-
className: "PanoTag-txt"
|
|
136
|
-
}, state.text));
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
return undefined;
|
|
140
|
-
}();
|
|
141
|
-
|
|
142
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
143
|
-
className: (0, _classnames["default"])('PanoTag', {
|
|
144
|
-
'PanoTag--notHidden': state
|
|
145
|
-
}),
|
|
146
|
-
style: {
|
|
147
|
-
left: ((pos === null || pos === void 0 ? void 0 : pos.left) || 0) + 'px',
|
|
148
|
-
top: ((pos === null || pos === void 0 ? void 0 : pos.top) || 0) + 'px'
|
|
149
|
-
}
|
|
150
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
151
|
-
className: "PanoTag-point"
|
|
152
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
153
|
-
className: "PanoTag-content"
|
|
154
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
155
|
-
className: "PanoTag-linewrap"
|
|
156
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
157
|
-
className: "PanoTag-slashline"
|
|
158
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
159
|
-
className: "PanoTag-straightline"
|
|
160
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
161
|
-
onClick: function onClick() {
|
|
162
|
-
if (state !== null && state !== void 0 && state.imgUrl) {// @TODO
|
|
163
|
-
// setDrawerVisible(true)
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
|
-
className: 'PanoTag-box PanoTag-box--' + ((state === null || state === void 0 ? void 0 : state.type) || '')
|
|
167
|
-
}, boxContent))));
|
|
127
|
+
return null;
|
|
168
128
|
}
|
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.PanoTextLabel = PanoTextLabel;
|
|
9
9
|
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
|
|
12
10
|
var React = _interopRequireWildcard(require("react"));
|
|
13
11
|
|
|
14
|
-
var
|
|
12
|
+
var THREE = _interopRequireWildcard(require("three"));
|
|
15
13
|
|
|
16
|
-
var
|
|
14
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
17
15
|
|
|
18
16
|
var _hooks = require("../../../hooks");
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
var _CSS3DRenderPlugin = require("../../../../fivePlugins/CSS3DRenderPlugin");
|
|
21
19
|
|
|
22
|
-
|
|
20
|
+
var _VreoUnit = require("../../../../typings/VreoUnit");
|
|
23
21
|
|
|
24
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
23
|
|
|
24
|
+
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); }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
26
28
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
29
|
|
|
28
30
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -35,15 +37,61 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
35
37
|
|
|
36
38
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
39
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
/**
|
|
41
|
+
* 通过传入中心点确定矩形框架容器的四个点:
|
|
42
|
+
* 1. 已知矩形长宽和中心点
|
|
43
|
+
* 2. 借助planeGeometry生成垂直相机视角的平面上的四个点
|
|
44
|
+
* 3. 通过向量相加,平行四边形法则获取到移动position后的面上四个点
|
|
45
|
+
*/
|
|
46
|
+
var calcPoints = function calcPoints(centerPoint, normal, wrapperLength, wrapperWidth) {
|
|
47
|
+
// 375px 对应 1m
|
|
48
|
+
var length = wrapperLength / 375;
|
|
49
|
+
var width = wrapperWidth / 375;
|
|
50
|
+
var geometry = new THREE.PlaneGeometry(length, width);
|
|
51
|
+
|
|
52
|
+
if (normal) {
|
|
53
|
+
var lookPoint = new THREE.Vector3(normal.x + centerPoint.x, normal.y + centerPoint.y, normal.z + centerPoint.z);
|
|
54
|
+
geometry.lookAt(lookPoint);
|
|
55
|
+
} // const pointgeometry = new THREE.Geometry()
|
|
56
|
+
// pointgeometry.vertices.push(cameraPosition)
|
|
57
|
+
// const pointmaterial = new THREE.PointsMaterial({
|
|
58
|
+
// color: 0xffffff,
|
|
59
|
+
// size: 0.4,
|
|
60
|
+
// })
|
|
61
|
+
// _point = new THREE.Points(pointgeometry, pointmaterial)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
var material = new THREE.MeshBasicMaterial({
|
|
65
|
+
color: 0xffff00,
|
|
66
|
+
side: THREE.DoubleSide
|
|
67
|
+
});
|
|
68
|
+
var plane = new THREE.Mesh(geometry, material);
|
|
69
|
+
var v0 = centerPoint.clone();
|
|
70
|
+
plane.position.copy(v0); // 计算传入的四个点的坐标
|
|
71
|
+
|
|
72
|
+
var _plane$geometry$verti = _slicedToArray(plane.geometry.vertices, 4),
|
|
73
|
+
v1 = _plane$geometry$verti[0],
|
|
74
|
+
v2 = _plane$geometry$verti[1],
|
|
75
|
+
v3 = _plane$geometry$verti[2],
|
|
76
|
+
v4 = _plane$geometry$verti[3];
|
|
77
|
+
|
|
78
|
+
var downLeft = v0.clone().add(v4);
|
|
79
|
+
var downRight = v0.clone().add(v3);
|
|
80
|
+
var upLeft = v0.clone().add(v2);
|
|
81
|
+
var upRight = v0.clone().add(v1); // 插件使用要求:矩形四个点位数据,顺序为**必须**为左下、右下、右上、左上
|
|
82
|
+
|
|
83
|
+
return [downLeft, downRight, upRight, upLeft];
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* 空间文本标签。
|
|
87
|
+
*/
|
|
43
88
|
|
|
89
|
+
|
|
90
|
+
function PanoTextLabel() {
|
|
44
91
|
var timeoutRef = React.useRef();
|
|
45
92
|
var controller = (0, _hooks.useController)();
|
|
46
|
-
var
|
|
93
|
+
var five = (0, _hooks.useFiveInstance)();
|
|
94
|
+
var ref = React.useRef();
|
|
47
95
|
React.useEffect(function () {
|
|
48
96
|
var _controller$configs;
|
|
49
97
|
|
|
@@ -52,32 +100,51 @@ function PanoTextLabel() {
|
|
|
52
100
|
}
|
|
53
101
|
|
|
54
102
|
var callback = function callback(keyframe) {
|
|
103
|
+
var _panoTextLabelData$no, _panoTextLabelData$no2, _panoTextLabelData$no3;
|
|
104
|
+
|
|
55
105
|
var start = keyframe.start,
|
|
56
106
|
end = keyframe.end,
|
|
57
107
|
data = keyframe.data;
|
|
58
|
-
var panoTextLabelData = data;
|
|
108
|
+
var panoTextLabelData = data; // 增加无文本情况的判断
|
|
109
|
+
|
|
110
|
+
if (data.text === '') return;
|
|
59
111
|
var _panoTextLabelData$ve = panoTextLabelData.vertex,
|
|
60
112
|
x = _panoTextLabelData$ve.x,
|
|
61
113
|
y = _panoTextLabelData$ve.y,
|
|
62
114
|
z = _panoTextLabelData$ve.z;
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
115
|
+
var centerPoint = new THREE.Vector3(x, y, z);
|
|
116
|
+
var normal = new THREE.Vector3((_panoTextLabelData$no = panoTextLabelData.normal) === null || _panoTextLabelData$no === void 0 ? void 0 : _panoTextLabelData$no.x, (_panoTextLabelData$no2 = panoTextLabelData.normal) === null || _panoTextLabelData$no2 === void 0 ? void 0 : _panoTextLabelData$no2.y, (_panoTextLabelData$no3 = panoTextLabelData.normal) === null || _panoTextLabelData$no3 === void 0 ? void 0 : _panoTextLabelData$no3.z); // 生成传入的四个点,将文本框最大宽度定在200px,最高高度在30px
|
|
117
|
+
|
|
118
|
+
var wrapperLength = 200;
|
|
119
|
+
var wrapperWidth = 30;
|
|
120
|
+
var points = calcPoints(centerPoint, panoTextLabelData.normal && normal, wrapperLength, wrapperWidth);
|
|
121
|
+
if (!ref.current) ref.current = (0, _CSS3DRenderPlugin.CSS3DRenderPlugin)(five);
|
|
122
|
+
var container = ref.current.create3DDomContainer(points);
|
|
123
|
+
var css3DObject = container === null || container === void 0 ? void 0 : container.css3DObject; // 将获取的mesh进行旋转操作,根据欧拉角去进行mesh的变换
|
|
124
|
+
|
|
125
|
+
if (data.quaternion) {
|
|
126
|
+
var quaternion = new THREE.Quaternion(data.quaternion.x, data.quaternion.y, data.quaternion.z, data.quaternion.w);
|
|
127
|
+
css3DObject === null || css3DObject === void 0 ? void 0 : css3DObject.quaternion.copy(quaternion);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (container !== null && container !== void 0 && container.container) _reactDom["default"].render( /*#__PURE__*/React.createElement("div", {
|
|
131
|
+
className: "PanoTextLabel PanoTextLabel--notHidden"
|
|
132
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
133
|
+
className: "PanoTextLabel-wrapper"
|
|
134
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
135
|
+
style: {
|
|
136
|
+
fontSize: "".concat(data.fontSize || 16, "px")
|
|
137
|
+
},
|
|
138
|
+
className: "PanoText-innerText"
|
|
139
|
+
}, data.text || ''))), container === null || container === void 0 ? void 0 : container.container);
|
|
74
140
|
timeoutRef.current = setTimeout(function () {
|
|
75
|
-
|
|
141
|
+
var _ref$current;
|
|
142
|
+
|
|
143
|
+
(_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.disposeAll();
|
|
76
144
|
}, end - start);
|
|
77
145
|
};
|
|
78
146
|
|
|
79
|
-
controller.on(_VreoUnit.VreoKeyframeEnum.PanoTextLabel, callback);
|
|
80
|
-
|
|
147
|
+
controller.on(_VreoUnit.VreoKeyframeEnum.PanoTextLabel, callback);
|
|
81
148
|
return function () {
|
|
82
149
|
controller.off(_VreoUnit.VreoKeyframeEnum.PanoTextLabel, callback);
|
|
83
150
|
|
|
@@ -86,20 +153,5 @@ function PanoTextLabel() {
|
|
|
86
153
|
}
|
|
87
154
|
};
|
|
88
155
|
}, [controller]);
|
|
89
|
-
return /*#__PURE__*/React.createElement(
|
|
90
|
-
className: (0, _classnames["default"])('PanoTextLabel', {
|
|
91
|
-
'PanoTextLabel--notHidden': state
|
|
92
|
-
}),
|
|
93
|
-
style: {
|
|
94
|
-
left: ((state === null || state === void 0 ? void 0 : state.left) || 0) + 'px',
|
|
95
|
-
top: ((state === null || state === void 0 ? void 0 : state.top) || 0) + 'px'
|
|
96
|
-
}
|
|
97
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
98
|
-
className: "PanoTextLabel-wrapper"
|
|
99
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
100
|
-
style: {
|
|
101
|
-
fontSize: "".concat((state === null || state === void 0 ? void 0 : state.fontSize) || 16, "px")
|
|
102
|
-
},
|
|
103
|
-
className: "PanoText-innerText"
|
|
104
|
-
}, (state === null || state === void 0 ? void 0 : state.text) || '')));
|
|
156
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
105
157
|
}
|