@realsee/vreo 0.2.0-alpha.2 → 0.2.0-alpha.21-beta
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 +8 -0
- package/README.md +80 -5
- package/docs/assets/custom.css +2 -2
- 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.043b1cd2.js +1 -0
- package/docs/demo/assets/default.55c3f308.css +1 -0
- package/docs/demo/assets/default.9a6a32fc.js +3952 -0
- package/docs/demo/assets/dynamic.bdbbbafa.js +1 -0
- package/docs/demo/assets/examples.2aaa85e1.js +25 -0
- package/docs/demo/assets/examples.dac4a6fe.css +1 -0
- package/docs/demo/assets/index.9b5c1a3f.js +1 -0
- package/docs/demo/assets/index.a7bafdff.css +1 -0
- package/docs/demo/assets/main.0895bebe.js +1 -0
- package/docs/demo/assets/react.855b3d23.css +1 -0
- package/docs/demo/assets/react.959cff42.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 -0
- 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 +37 -6
- package/docs/interfaces/Player.CustomVreoKeyframeProps.html +1 -1
- package/docs/interfaces/Player.PlayerConfigs.html +3 -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/createHTMLAudioElement.d.ts +1 -0
- package/lib/PlayController/createHTMLAudioElement.js +47 -0
- package/lib/PlayController/index.d.ts +38 -0
- package/lib/PlayController/index.js +300 -0
- package/lib/Player/App.js +5 -4
- package/lib/Player/Controller.d.ts +5 -1
- package/lib/Player/Controller.js +38 -5
- package/lib/Player/custom/SpatialScenePanel/index.d.ts +2 -2
- package/lib/Player/custom/SpatialScenePanel/index.js +98 -26
- package/lib/Player/index.d.ts +3 -2
- package/lib/Player/index.js +116 -24
- package/lib/Player/modules/Drawer/index.js +1 -1
- package/lib/Player/modules/PopUp/index.d.ts +2 -0
- package/lib/Player/modules/PopUp/index.js +43 -0
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +17 -2
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +113 -37
- package/lib/Player/modules/VideoAgent/VideoAgentScene.d.ts +5 -1
- package/lib/Player/modules/VideoAgent/VideoAgentScene.js +9 -4
- package/lib/Player/modules/VideoAgent/index.d.ts +2 -0
- package/lib/Player/modules/VideoAgent/index.js +2 -2
- package/lib/Player/modules/keyframes/BgMusic/index.js +1 -1
- package/lib/Player/modules/keyframes/CameraMovement/index.js +42 -6
- package/lib/Player/modules/keyframes/InfoPanel/index.js +74 -36
- 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.js +20 -7
- package/lib/Player/modules/keyframes/PanoTextLabel/index.d.ts +3 -0
- package/lib/Player/modules/keyframes/PanoTextLabel/index.js +96 -51
- package/lib/Player/modules/keyframes/Prompter/index.js +5 -19
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +31 -19
- package/lib/Player/modules/keyframes/VideoEffect/index.js +1 -1
- package/lib/Player/typings.d.ts +6 -0
- 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 +109 -94
- package/lib/fivePlugins/CameraMovementPlugin/typings.d.ts +1 -0
- package/lib/fivePlugins/ModelTVVideoPlugin/index.js +1 -1
- package/lib/react/index.d.ts +7 -3
- package/lib/react/index.js +3 -3
- package/lib/shared-utils/AduioLike.d.ts +37 -0
- package/lib/shared-utils/AduioLike.js +165 -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/typings/VreoUnit.d.ts +42 -5
- package/lib/typings/VreoUnit.js +26 -6
- package/package.json +8 -8
- package/resources/PlayController/createHTMLAudioElement.ts +53 -0
- package/resources/PlayController/index.ts +167 -0
- package/resources/Player/App.tsx +2 -0
- package/resources/Player/Controller.ts +155 -121
- package/resources/Player/custom/SpatialScenePanel/index.tsx +148 -45
- package/resources/Player/index.tsx +186 -110
- package/resources/Player/modules/PopUp/index.tsx +26 -0
- package/resources/Player/modules/VideoAgent/VideoAgentMesh.ts +67 -14
- package/resources/Player/modules/VideoAgent/VideoAgentScene.ts +3 -3
- package/resources/Player/modules/VideoAgent/index.tsx +3 -2
- package/resources/Player/modules/keyframes/CameraMovement/index.tsx +7 -3
- package/resources/Player/modules/keyframes/InfoPanel/index.tsx +79 -34
- package/resources/Player/modules/keyframes/ModelVideo/index.tsx +36 -3
- package/resources/Player/modules/keyframes/PanoTag/index.tsx +31 -12
- package/resources/Player/modules/keyframes/PanoTextLabel/index.tsx +87 -34
- package/resources/Player/modules/keyframes/Prompter/index.tsx +5 -15
- package/resources/Player/modules/keyframes/UpdateVRPanorama/index.tsx +25 -16
- package/resources/Player/typings.ts +5 -0
- 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 +66 -52
- package/resources/fivePlugins/CameraMovementPlugin/typings.ts +2 -1
- package/resources/react/index.tsx +7 -3
- package/resources/shared-utils/AduioLike.ts +108 -0
- package/resources/shared-utils/createTransMatrix.ts +12 -0
- package/resources/typings/VreoUnit.ts +46 -5
- package/stylesheets/custom/SpatialScenePanel.css +14 -8
- package/stylesheets/default.css +116 -12
|
@@ -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,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
|
|
@@ -75,7 +75,8 @@ function PanoTag() {
|
|
|
75
75
|
vertex: vertex,
|
|
76
76
|
text: panoTagData.text || _VreoUnit.PanoTagEnum.Text,
|
|
77
77
|
type: panoTagData.type,
|
|
78
|
-
imgUrl: panoTagData.imgUrl
|
|
78
|
+
imgUrl: panoTagData.imgUrl,
|
|
79
|
+
style: panoTagData.style || _VreoUnit.PanoTagStyleEnum.Growth
|
|
79
80
|
});
|
|
80
81
|
setPos({
|
|
81
82
|
left: left,
|
|
@@ -139,6 +140,23 @@ function PanoTag() {
|
|
|
139
140
|
return undefined;
|
|
140
141
|
}();
|
|
141
142
|
|
|
143
|
+
if ((state === null || state === void 0 ? void 0 : state.style) === _VreoUnit.PanoTagStyleEnum.Expand) {
|
|
144
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
145
|
+
className: (0, _classnames["default"])('PanoTag', {
|
|
146
|
+
'PanoTag--expand': true,
|
|
147
|
+
'PanoTag--notHidden': state
|
|
148
|
+
}),
|
|
149
|
+
style: {
|
|
150
|
+
left: ((pos === null || pos === void 0 ? void 0 : pos.left) || 0) + 'px',
|
|
151
|
+
top: ((pos === null || pos === void 0 ? void 0 : pos.top) || 0) + 'px'
|
|
152
|
+
}
|
|
153
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
154
|
+
className: 'PanoTag-box PanoTag-box--' + ((state === null || state === void 0 ? void 0 : state.type) || '')
|
|
155
|
+
}, boxContent), /*#__PURE__*/React.createElement("div", {
|
|
156
|
+
className: "PanoTag-guideline"
|
|
157
|
+
})));
|
|
158
|
+
}
|
|
159
|
+
|
|
142
160
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
143
161
|
className: (0, _classnames["default"])('PanoTag', {
|
|
144
162
|
'PanoTag--notHidden': state
|
|
@@ -158,11 +176,6 @@ function PanoTag() {
|
|
|
158
176
|
}), /*#__PURE__*/React.createElement("span", {
|
|
159
177
|
className: "PanoTag-straightline"
|
|
160
178
|
})), /*#__PURE__*/React.createElement("div", {
|
|
161
|
-
onClick: function onClick() {
|
|
162
|
-
if (state !== null && state !== void 0 && state.imgUrl) {// @TODO
|
|
163
|
-
// setDrawerVisible(true)
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
179
|
className: 'PanoTag-box PanoTag-box--' + ((state === null || state === void 0 ? void 0 : state.type) || '')
|
|
167
180
|
}, boxContent))));
|
|
168
181
|
}
|
|
@@ -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,62 @@ 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
|
+
// console.log(cameraPosition)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
var material = new THREE.MeshBasicMaterial({
|
|
66
|
+
color: 0xffff00,
|
|
67
|
+
side: THREE.DoubleSide
|
|
68
|
+
});
|
|
69
|
+
var plane = new THREE.Mesh(geometry, material);
|
|
70
|
+
var v0 = centerPoint.clone();
|
|
71
|
+
plane.position.copy(v0); // 计算传入的四个点的坐标
|
|
72
|
+
|
|
73
|
+
var _plane$geometry$verti = _slicedToArray(plane.geometry.vertices, 4),
|
|
74
|
+
v1 = _plane$geometry$verti[0],
|
|
75
|
+
v2 = _plane$geometry$verti[1],
|
|
76
|
+
v3 = _plane$geometry$verti[2],
|
|
77
|
+
v4 = _plane$geometry$verti[3];
|
|
78
|
+
|
|
79
|
+
var downLeft = v0.clone().add(v4);
|
|
80
|
+
var downRight = v0.clone().add(v3);
|
|
81
|
+
var upLeft = v0.clone().add(v2);
|
|
82
|
+
var upRight = v0.clone().add(v1); // 插件使用要求:矩形四个点位数据,顺序为**必须**为左下、右下、右上、左上
|
|
83
|
+
|
|
84
|
+
return [downLeft, downRight, upRight, upLeft];
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* 空间文本标签。
|
|
88
|
+
*/
|
|
43
89
|
|
|
90
|
+
|
|
91
|
+
function PanoTextLabel() {
|
|
44
92
|
var timeoutRef = React.useRef();
|
|
45
93
|
var controller = (0, _hooks.useController)();
|
|
46
|
-
var
|
|
94
|
+
var five = (0, _hooks.useFiveInstance)();
|
|
95
|
+
var ref = React.useRef();
|
|
47
96
|
React.useEffect(function () {
|
|
48
97
|
var _controller$configs;
|
|
49
98
|
|
|
@@ -52,40 +101,51 @@ function PanoTextLabel() {
|
|
|
52
101
|
}
|
|
53
102
|
|
|
54
103
|
var callback = function callback(keyframe) {
|
|
104
|
+
var _panoTextLabelData$no, _panoTextLabelData$no2, _panoTextLabelData$no3;
|
|
105
|
+
|
|
55
106
|
var start = keyframe.start,
|
|
56
107
|
end = keyframe.end,
|
|
57
108
|
data = keyframe.data;
|
|
58
|
-
var panoTextLabelData = data;
|
|
109
|
+
var panoTextLabelData = data; // 增加无文本情况的判断
|
|
110
|
+
|
|
111
|
+
if (data.text === '') return;
|
|
59
112
|
var _panoTextLabelData$ve = panoTextLabelData.vertex,
|
|
60
113
|
x = _panoTextLabelData$ve.x,
|
|
61
114
|
y = _panoTextLabelData$ve.y,
|
|
62
115
|
z = _panoTextLabelData$ve.z;
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
116
|
+
var centerPoint = new THREE.Vector3(x, y, z);
|
|
117
|
+
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
|
|
118
|
+
|
|
119
|
+
var wrapperLength = 200;
|
|
120
|
+
var wrapperWidth = 30;
|
|
121
|
+
var points = calcPoints(centerPoint, panoTextLabelData.normal && normal, wrapperLength, wrapperWidth);
|
|
122
|
+
if (!ref.current) ref.current = (0, _CSS3DRenderPlugin.CSS3DRenderPlugin)(five);
|
|
123
|
+
var container = ref.current.create3DDomContainer(points);
|
|
124
|
+
var css3DObject = container === null || container === void 0 ? void 0 : container.css3DObject; // 将获取的mesh进行旋转操作,根据欧拉角去进行mesh的变换
|
|
125
|
+
|
|
126
|
+
if (data.quaternion) {
|
|
127
|
+
var quaternion = new THREE.Quaternion(data.quaternion.x, data.quaternion.y, data.quaternion.z, data.quaternion.w);
|
|
128
|
+
css3DObject === null || css3DObject === void 0 ? void 0 : css3DObject.quaternion.copy(quaternion);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (container !== null && container !== void 0 && container.container) _reactDom["default"].render( /*#__PURE__*/React.createElement("div", {
|
|
132
|
+
className: "PanoTextLabel PanoTextLabel--notHidden"
|
|
133
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
134
|
+
className: "PanoTextLabel-wrapper"
|
|
135
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
136
|
+
style: {
|
|
137
|
+
fontSize: "".concat(data.fontSize || 16, "px")
|
|
138
|
+
},
|
|
139
|
+
className: "PanoText-innerText"
|
|
140
|
+
}, data.text || ''))), container === null || container === void 0 ? void 0 : container.container);
|
|
78
141
|
timeoutRef.current = setTimeout(function () {
|
|
79
|
-
|
|
142
|
+
var _ref$current;
|
|
143
|
+
|
|
144
|
+
(_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.disposeAll();
|
|
80
145
|
}, end - start);
|
|
81
146
|
};
|
|
82
147
|
|
|
83
148
|
controller.on(_VreoUnit.VreoKeyframeEnum.PanoTextLabel, callback);
|
|
84
|
-
Object.assign(window, {
|
|
85
|
-
$panoTextLabel: {
|
|
86
|
-
setState: setState
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
149
|
return function () {
|
|
90
150
|
controller.off(_VreoUnit.VreoKeyframeEnum.PanoTextLabel, callback);
|
|
91
151
|
|
|
@@ -94,20 +154,5 @@ function PanoTextLabel() {
|
|
|
94
154
|
}
|
|
95
155
|
};
|
|
96
156
|
}, [controller]);
|
|
97
|
-
return /*#__PURE__*/React.createElement(
|
|
98
|
-
className: (0, _classnames["default"])('PanoTextLabel', {
|
|
99
|
-
'PanoTextLabel--notHidden': state
|
|
100
|
-
}),
|
|
101
|
-
style: {
|
|
102
|
-
left: ((state === null || state === void 0 ? void 0 : state.left) || 0) + 'px',
|
|
103
|
-
top: ((state === null || state === void 0 ? void 0 : state.top) || 0) + 'px'
|
|
104
|
-
}
|
|
105
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
106
|
-
className: "PanoTextLabel-wrapper"
|
|
107
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
108
|
-
style: {
|
|
109
|
-
fontSize: "".concat((state === null || state === void 0 ? void 0 : state.fontSize) || 16, "px")
|
|
110
|
-
},
|
|
111
|
-
className: "PanoText-innerText"
|
|
112
|
-
}, (state === null || state === void 0 ? void 0 : state.text) || '')));
|
|
157
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
113
158
|
}
|
|
@@ -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
|
|
@@ -13,8 +13,6 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
13
13
|
|
|
14
14
|
var _hooks = require("../../../hooks");
|
|
15
15
|
|
|
16
|
-
var _reactTransitionGroup = require("react-transition-group");
|
|
17
|
-
|
|
18
16
|
var _VreoUnit = require("../../../../typings/VreoUnit");
|
|
19
17
|
|
|
20
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -69,9 +67,8 @@ function Prompter() {
|
|
|
69
67
|
|
|
70
68
|
ref.current = setTimeout(function () {
|
|
71
69
|
setHidden(true);
|
|
72
|
-
setTimeout(
|
|
73
|
-
|
|
74
|
-
}, 500);
|
|
70
|
+
setText(''); // setTimeout(() => setText(''), 500)
|
|
71
|
+
|
|
75
72
|
if (ref.current) clearTimeout(ref.current);
|
|
76
73
|
ref.current = null;
|
|
77
74
|
}, end - start);
|
|
@@ -87,20 +84,9 @@ function Prompter() {
|
|
|
87
84
|
'vreo-prompter--hidden': hidden,
|
|
88
85
|
'vreo-prompter--audio': controller.isAudio
|
|
89
86
|
})
|
|
90
|
-
},
|
|
91
|
-
/*#__PURE__*/
|
|
92
|
-
|
|
93
|
-
/* @warning "index.js:1 Warning: findDOMNode is deprecated in StrictMode." */
|
|
94
|
-
React.createElement(_reactTransitionGroup.TransitionGroup, {
|
|
87
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
95
88
|
className: "vreo-prompter-text"
|
|
96
|
-
}, /*#__PURE__*/React.createElement(_reactTransitionGroup.CSSTransition, {
|
|
97
|
-
key: text,
|
|
98
|
-
classNames: "vreo-prompter-text-transition",
|
|
99
|
-
timeout: 500,
|
|
100
|
-
addEndListener: function addEndListener(node, done) {
|
|
101
|
-
return node.addEventListener('transitionend', done, false);
|
|
102
|
-
}
|
|
103
89
|
}, /*#__PURE__*/React.createElement("div", {
|
|
104
90
|
className: "vreo-prompter-innerText"
|
|
105
|
-
}, text)))
|
|
91
|
+
}, text)));
|
|
106
92
|
}
|
|
@@ -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
|
|
@@ -22,42 +22,49 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
22
22
|
function UpdateVRPanorama() {
|
|
23
23
|
var controller = (0, _hooks.useController)();
|
|
24
24
|
var five = (0, _hooks.useFiveInstance)();
|
|
25
|
-
var
|
|
26
|
-
var
|
|
25
|
+
var deafultWorkRef = React.useRef(null);
|
|
26
|
+
var updateWorkRef = React.useRef(null); // 恢复默认 VR
|
|
27
|
+
|
|
27
28
|
var restoreCallback = React.useCallback(function () {
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
// 先清理掉 之前的 VR 数据备份
|
|
30
|
+
updateWorkRef.current = null;
|
|
31
|
+
|
|
32
|
+
if (deafultWorkRef.current) {
|
|
33
|
+
var work = (0, _five.parseWork)(deafultWorkRef.current);
|
|
30
34
|
five.load(work);
|
|
31
35
|
}
|
|
36
|
+
}, []); // 暂停时: 恢复默认 VR
|
|
32
37
|
|
|
33
|
-
workRef.current = null;
|
|
34
|
-
}, []);
|
|
35
38
|
var pausedCallback = React.useCallback(function () {
|
|
36
|
-
if (
|
|
37
|
-
var work = (0, _five.parseWork)(
|
|
39
|
+
if (deafultWorkRef.current) {
|
|
40
|
+
var work = (0, _five.parseWork)(deafultWorkRef.current);
|
|
41
|
+
Object.assign(window, {
|
|
42
|
+
$rawWork: work
|
|
43
|
+
});
|
|
38
44
|
five.load(work);
|
|
39
45
|
}
|
|
40
|
-
}, []);
|
|
46
|
+
}, []); // 播放时:如果暂停前有更新 VR 需要还原
|
|
47
|
+
|
|
41
48
|
var playingCallback = React.useCallback(function () {
|
|
42
|
-
if (!
|
|
49
|
+
if (!updateWorkRef.current) {
|
|
43
50
|
return;
|
|
44
51
|
}
|
|
45
52
|
|
|
46
|
-
five.load(
|
|
53
|
+
five.load(updateWorkRef.current);
|
|
47
54
|
}, []);
|
|
48
55
|
React.useEffect(function () {
|
|
49
56
|
var callback = function callback(keyframe) {
|
|
50
57
|
var _five$work;
|
|
51
58
|
|
|
52
|
-
if (!
|
|
53
|
-
|
|
59
|
+
if (!deafultWorkRef.current) {
|
|
60
|
+
deafultWorkRef.current = five.work.raw.works;
|
|
54
61
|
}
|
|
55
62
|
|
|
56
63
|
var data = keyframe.data; // 如果数据中有新 work 数据,则直接载入
|
|
57
64
|
|
|
58
65
|
if (data.work) {
|
|
59
|
-
|
|
60
|
-
five.load(
|
|
66
|
+
updateWorkRef.current = (0, _five.parseWork)(data.work);
|
|
67
|
+
five.load(updateWorkRef.current);
|
|
61
68
|
return;
|
|
62
69
|
}
|
|
63
70
|
|
|
@@ -72,8 +79,13 @@ function UpdateVRPanorama() {
|
|
|
72
79
|
delete data.dynamic_scene;
|
|
73
80
|
}
|
|
74
81
|
|
|
75
|
-
|
|
76
|
-
|
|
82
|
+
Object.assign(window, {
|
|
83
|
+
$work1: JSON.parse(lastRawWork),
|
|
84
|
+
$work2: data,
|
|
85
|
+
parseWork: _five.parseWork
|
|
86
|
+
});
|
|
87
|
+
updateWorkRef.current = (0, _five.parseWork)([lastRawWork, data]);
|
|
88
|
+
five.load(updateWorkRef.current);
|
|
77
89
|
};
|
|
78
90
|
|
|
79
91
|
controller.on(_VreoUnit.VreoKeyframeEnum.UpdateVRPanorama, callback); // 离开 将之前的内容清空
|
|
@@ -93,6 +105,6 @@ function UpdateVRPanorama() {
|
|
|
93
105
|
controller.off('paused', pausedCallback);
|
|
94
106
|
controller.off('playing', playingCallback);
|
|
95
107
|
};
|
|
96
|
-
}, [
|
|
108
|
+
}, []);
|
|
97
109
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
98
110
|
}
|
|
@@ -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
|
package/lib/Player/typings.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { Subscribe, Five } from '@realsee/five';
|
|
3
3
|
import { VreoKeyframeConfigMap, VreoKeyframeEvent } from '../typings/VreoUnit';
|
|
4
|
+
import { VideoAgentMeshOptions } from './modules/VideoAgent/VideoAgentMesh';
|
|
4
5
|
export interface PlayerConfigs {
|
|
5
6
|
containter?: ReactDOM.Container;
|
|
6
7
|
keyframeMap: VreoKeyframeConfigMap;
|
|
@@ -13,11 +14,16 @@ export interface PlayerConfigs {
|
|
|
13
14
|
videoEffect?: HTMLVideoElement;
|
|
14
15
|
modelTVVideo?: HTMLVideoElement;
|
|
15
16
|
};
|
|
17
|
+
videoAgentMeshOptions?: VideoAgentMeshOptions;
|
|
16
18
|
/**
|
|
17
19
|
* 如果需要在 底部面板添加自定义内容,可以传递个 React 组件。
|
|
18
20
|
*/
|
|
19
21
|
customPanelChildren?: ReactNode;
|
|
20
22
|
customKeyframes?: React.FC<CustomVreoKeyframeProps>[];
|
|
23
|
+
imageOptions?: {
|
|
24
|
+
size: number;
|
|
25
|
+
};
|
|
26
|
+
autoPreload?: boolean;
|
|
21
27
|
}
|
|
22
28
|
export declare type VreoSubscribe = Pick<Subscribe<VreoKeyframeEvent>, 'on' | 'once' | 'off'>;
|
|
23
29
|
export interface CustomVreoKeyframeProps {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = centerPoint;
|
|
7
|
+
|
|
8
|
+
var _three = require("three");
|
|
9
|
+
|
|
10
|
+
function centerPoint(point1, point2) {
|
|
11
|
+
return new _three.Vector3((point1.x + point2.x) / 2, (point1.y + point2.y) / 2, (point1.z + point2.z) / 2);
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = createResizeObserver;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @description: 简陋的 ResizeObserver polyfill
|
|
10
|
+
*/
|
|
11
|
+
function createResizeObserver(func, element) {
|
|
12
|
+
if (!element || typeof ResizeObserver === 'undefined') {
|
|
13
|
+
return {
|
|
14
|
+
observe: function observe() {
|
|
15
|
+
return window.addEventListener('resize', func);
|
|
16
|
+
},
|
|
17
|
+
unobserve: function unobserve() {
|
|
18
|
+
return window.removeEventListener('resize', func);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
} else {
|
|
22
|
+
var observer = new ResizeObserver(func);
|
|
23
|
+
return {
|
|
24
|
+
observe: function observe() {
|
|
25
|
+
return observer.observe(element);
|
|
26
|
+
},
|
|
27
|
+
unobserve: function unobserve() {
|
|
28
|
+
return observer.unobserve(element);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = evenNumber;
|
|
7
|
+
|
|
8
|
+
function evenNumber(num, config) {
|
|
9
|
+
var roundNum = Math.round(num);
|
|
10
|
+
return roundNum % 2 === 0 ? roundNum : roundNum + Number(config !== null && config !== void 0 && config.smaller ? -1 : 1);
|
|
11
|
+
}
|