@realsee/vreo 2.6.4 → 3.0.0-webgpu.9
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 +6 -6
- package/lib/PlayController/createHTMLAudioElement.d.ts +1 -0
- package/lib/PlayController/createHTMLAudioElement.d.ts.map +1 -0
- package/lib/PlayController/index.d.ts +14 -24
- package/lib/PlayController/index.d.ts.map +1 -0
- package/lib/PlayController/index.js +74 -220
- package/lib/PlayController/index.js.map +1 -0
- package/lib/Player/App.d.ts +2 -2
- package/lib/Player/App.d.ts.map +1 -0
- package/lib/Player/Controller.d.ts +11 -6
- package/lib/Player/Controller.d.ts.map +1 -0
- package/lib/Player/PlaybackLifecycle.d.ts +1 -0
- package/lib/Player/PlaybackLifecycle.d.ts.map +1 -0
- package/lib/Player/custom/SpatialScenePanel/index.d.ts +2 -2
- package/lib/Player/custom/SpatialScenePanel/index.d.ts.map +1 -0
- package/lib/Player/hooks.d.ts +3 -2
- package/lib/Player/hooks.d.ts.map +1 -0
- package/lib/Player/index.d.ts +3 -2
- package/lib/Player/index.d.ts.map +1 -0
- package/lib/Player/index.js +1770 -437
- package/lib/Player/index.js.map +1 -0
- package/lib/Player/modules/Drawer/index.d.ts +2 -2
- package/lib/Player/modules/Drawer/index.d.ts.map +1 -0
- package/lib/Player/modules/PopUp/index.d.ts +2 -2
- package/lib/Player/modules/PopUp/index.d.ts.map +1 -0
- package/lib/Player/modules/ResizeObserver/index.d.ts +2 -2
- package/lib/Player/modules/ResizeObserver/index.d.ts.map +1 -0
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +5 -2
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts.map +1 -0
- package/lib/Player/modules/VideoAgent/VideoAgentScene.d.ts +8 -5
- package/lib/Player/modules/VideoAgent/VideoAgentScene.d.ts.map +1 -0
- package/lib/Player/modules/VideoAgent/index.d.ts +11 -2
- package/lib/Player/modules/VideoAgent/index.d.ts.map +1 -0
- package/lib/Player/modules/Wave/index.d.ts +2 -2
- package/lib/Player/modules/Wave/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/BgMusic/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/BgMusic/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/CameraMovement/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/CameraMovement/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/InfoPanel/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/InfoPanel/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/ModelVideo/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/ModelVideo/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/PanoEffect/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/PanoEffect/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/PanoEffect/lineAnime.d.ts +3 -2
- package/lib/Player/modules/keyframes/PanoEffect/lineAnime.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/PanoTag/index.d.ts +1 -0
- package/lib/Player/modules/keyframes/PanoTag/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/PanoTextLabel/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/PanoTextLabel/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/Prompter/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/Prompter/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/VideoEffect/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/VideoEffect/index.d.ts.map +1 -0
- package/lib/Player/playback-types.d.ts +1 -0
- package/lib/Player/playback-types.d.ts.map +1 -0
- package/lib/Player/typings.d.ts +2 -1
- package/lib/Player/typings.d.ts.map +1 -0
- package/lib/chunks/index-BgPSzRSs.js +93 -0
- package/lib/chunks/index-BgPSzRSs.js.map +1 -0
- package/lib/chunks/index-CunyJn6H.js +51 -0
- package/lib/chunks/index-CunyJn6H.js.map +1 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.d.ts +2 -1
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.d.ts.map +1 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.d.ts +5 -6
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.d.ts.map +1 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.d.ts +1 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.d.ts.map +1 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/index.d.ts +5 -22
- package/lib/fivePlugins/CSS3DRenderPlugin/index.d.ts.map +1 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.d.ts +2 -1
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.d.ts.map +1 -0
- package/lib/fivePlugins/CameraMovementPlugin/index.d.ts +2 -1
- package/lib/fivePlugins/CameraMovementPlugin/index.d.ts.map +1 -0
- package/lib/fivePlugins/CameraMovementPlugin/typings.d.ts +2 -1
- package/lib/fivePlugins/CameraMovementPlugin/typings.d.ts.map +1 -0
- package/lib/fivePlugins/ModelTVVideoPlugin/index.d.ts +2 -1
- package/lib/fivePlugins/ModelTVVideoPlugin/index.d.ts.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +12 -1
- package/lib/index.js.map +1 -0
- package/lib/plugins/CSS3DRenderPlugin.js +115 -0
- package/lib/plugins/CSS3DRenderPlugin.js.map +1 -0
- package/lib/plugins/CameraMovementPlugin.js +6 -0
- package/lib/plugins/CameraMovementPlugin.js.map +1 -0
- package/lib/plugins/ModelTVVideoPlugin.js +162 -0
- package/lib/plugins/ModelTVVideoPlugin.js.map +1 -0
- package/lib/react/index.d.ts +5 -4
- package/lib/react/index.d.ts.map +1 -0
- package/lib/react/index.js +39 -226
- package/lib/react/index.js.map +1 -0
- package/lib/shared-utils/Audio.d.ts +3 -1
- package/lib/shared-utils/Audio.d.ts.map +1 -0
- package/lib/shared-utils/AudioLike.d.ts +2 -1
- package/lib/shared-utils/AudioLike.d.ts.map +1 -0
- package/lib/shared-utils/Preloader.d.ts +1 -0
- package/lib/shared-utils/Preloader.d.ts.map +1 -0
- package/lib/shared-utils/addResizeListener.d.ts +2 -1
- package/lib/shared-utils/addResizeListener.d.ts.map +1 -0
- package/lib/shared-utils/animationFrame/BetterTween.d.ts +1 -0
- package/lib/shared-utils/animationFrame/BetterTween.d.ts.map +1 -0
- package/lib/shared-utils/animationFrame/index.d.ts +5 -14
- package/lib/shared-utils/animationFrame/index.d.ts.map +1 -0
- package/lib/shared-utils/animationFrame/tween.d.ts +1 -0
- package/lib/shared-utils/animationFrame/tween.d.ts.map +1 -0
- package/lib/shared-utils/createTransMatrix.d.ts +3 -1
- package/lib/shared-utils/createTransMatrix.d.ts.map +1 -0
- package/lib/shared-utils/getFileExpandedName.d.ts +1 -0
- package/lib/shared-utils/getFileExpandedName.d.ts.map +1 -0
- package/lib/shared-utils/getMediaInfo.d.ts +1 -0
- package/lib/shared-utils/getMediaInfo.d.ts.map +1 -0
- package/lib/shared-utils/setElementDataset.d.ts +1 -0
- package/lib/shared-utils/setElementDataset.d.ts.map +1 -0
- package/lib/timeline/index.d.ts +18 -0
- package/lib/timeline/index.d.ts.map +1 -0
- package/lib/types/index.js +10 -0
- package/lib/types/index.js.map +1 -0
- package/lib/typings/VreoUnit.d.ts +2 -1
- package/lib/typings/VreoUnit.d.ts.map +1 -0
- package/lib/typings/index.d.ts +1 -0
- package/lib/typings/index.d.ts.map +1 -0
- package/package.json +51 -71
- package/lib/PlayController/createHTMLAudioElement.js +0 -34
- package/lib/Player/App.js +0 -52
- package/lib/Player/Controller.js +0 -536
- package/lib/Player/PlaybackLifecycle.js +0 -118
- package/lib/Player/custom/SpatialScenePanel/index.js +0 -240
- package/lib/Player/hooks.js +0 -22
- package/lib/Player/modules/Drawer/index.js +0 -40
- package/lib/Player/modules/PopUp/index.js +0 -23
- package/lib/Player/modules/ResizeObserver/index.js +0 -22
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +0 -456
- package/lib/Player/modules/VideoAgent/VideoAgentScene.js +0 -53
- package/lib/Player/modules/VideoAgent/index.js +0 -72
- package/lib/Player/modules/Wave/index.js +0 -171
- package/lib/Player/modules/keyframes/BgMusic/index.js +0 -65
- package/lib/Player/modules/keyframes/CameraMovement/index.js +0 -75
- package/lib/Player/modules/keyframes/InfoPanel/index.js +0 -170
- package/lib/Player/modules/keyframes/ModelVideo/index.js +0 -128
- package/lib/Player/modules/keyframes/PanoEffect/index.js +0 -99
- package/lib/Player/modules/keyframes/PanoEffect/lineAnime.js +0 -30
- package/lib/Player/modules/keyframes/PanoTag/index.js +0 -110
- package/lib/Player/modules/keyframes/PanoTextLabel/index.js +0 -122
- package/lib/Player/modules/keyframes/Prompter/index.js +0 -56
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +0 -98
- package/lib/Player/modules/keyframes/VideoEffect/index.js +0 -154
- package/lib/Player/playback-types.js +0 -1
- package/lib/Player/typings.js +0 -1
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.js +0 -4
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.js +0 -25
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.js +0 -4
- package/lib/fivePlugins/CSS3DRenderPlugin/index.js +0 -226
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.js +0 -8
- package/lib/fivePlugins/CameraMovementPlugin/index.js +0 -245
- package/lib/fivePlugins/CameraMovementPlugin/typings.js +0 -15
- package/lib/fivePlugins/ModelTVVideoPlugin/index.js +0 -349
- package/lib/shared-utils/Audio.js +0 -151
- package/lib/shared-utils/AudioLike.js +0 -123
- package/lib/shared-utils/Preloader.js +0 -37
- package/lib/shared-utils/addResizeListener.js +0 -39
- package/lib/shared-utils/animationFrame/BetterTween.js +0 -58
- package/lib/shared-utils/animationFrame/index.js +0 -52
- package/lib/shared-utils/animationFrame/tween.js +0 -58
- package/lib/shared-utils/createTransMatrix.js +0 -12
- package/lib/shared-utils/getFileExpandedName.js +0 -6
- package/lib/shared-utils/getMediaInfo.js +0 -55
- package/lib/shared-utils/setElementDataset.js +0 -16
- package/lib/typings/VreoUnit.js +0 -64
- package/lib/typings/index.js +0 -1
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { createRoot } from 'react-dom/client';
|
|
4
|
-
import { Raycaster, Vector3 } from 'three';
|
|
5
|
-
import { tweenProgress } from "../../../shared-utils/animationFrame/BetterTween.js";
|
|
6
|
-
import { CSS3DRenderPlugin } from "../../../fivePlugins/CSS3DRenderPlugin/index.js";
|
|
7
|
-
import { VreoKeyframeEnum } from "../../../typings/VreoUnit.js";
|
|
8
|
-
// const getSphere = (position: Vector3, color = 0xffff00) => {
|
|
9
|
-
// const geometry = new SphereGeometry(0.05, 32, 16)
|
|
10
|
-
// const material = new MeshBasicMaterial({ color })
|
|
11
|
-
// const sphere = new Mesh(geometry, material)
|
|
12
|
-
// sphere.position.copy(position)
|
|
13
|
-
// return sphere
|
|
14
|
-
// }
|
|
15
|
-
|
|
16
|
-
var searchV1 = function searchV1(_ref) {
|
|
17
|
-
var five = _ref.five,
|
|
18
|
-
dom = _ref.dom;
|
|
19
|
-
var cameraDirection = new Vector3();
|
|
20
|
-
five.camera.getWorldDirection(cameraDirection);
|
|
21
|
-
var cameraPosition = five.camera.position;
|
|
22
|
-
var _five$model$intersect = five.model.intersectRaycaster(new Raycaster(cameraPosition, cameraDirection)),
|
|
23
|
-
_five$model$intersect2 = _slicedToArray(_five$model$intersect, 1),
|
|
24
|
-
intersect = _five$model$intersect2[0];
|
|
25
|
-
var point = five.project2d(intersect.point);
|
|
26
|
-
var widescreen = window.innerWidth > 560 ? true : false;
|
|
27
|
-
// const width = dom!.clientWidth
|
|
28
|
-
var height = dom.clientHeight;
|
|
29
|
-
dom.style.left = point.x + 'px';
|
|
30
|
-
dom.style.top = point.y - height / 2 + 'px';
|
|
31
|
-
var rect = dom.getBoundingClientRect();
|
|
32
|
-
var left = rect.left,
|
|
33
|
-
top = rect.top,
|
|
34
|
-
bottom = rect.bottom,
|
|
35
|
-
right = rect.right;
|
|
36
|
-
var leftBottom = new Vector3(left, bottom);
|
|
37
|
-
var leftTop = new Vector3(left, top);
|
|
38
|
-
var rightTop = new Vector3(right, top);
|
|
39
|
-
var rightBottom = new Vector3(right, bottom);
|
|
40
|
-
var points = [leftBottom, rightBottom, rightTop, leftTop].map(function (point) {
|
|
41
|
-
point.setX(point.x / window.innerWidth * 2 - (widescreen ? 1.25 : 1.75));
|
|
42
|
-
point.setY(-(point.y / window.innerHeight) * 2 + (widescreen ? 1.35 : 1.125));
|
|
43
|
-
point.setZ(0.5);
|
|
44
|
-
return point.unproject(five.camera).addScaledVector(cameraDirection, 0.2);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
// __debug__
|
|
48
|
-
// const colors = [0xdc143c, 0xffff00, 0x0000ff, 0x008000]
|
|
49
|
-
// points.forEach((p, index) => five.scene.add(getSphere(p, colors[index])))
|
|
50
|
-
|
|
51
|
-
// 判断是手机 150
|
|
52
|
-
var ratio = leftBottom.distanceTo(rightBottom) / (widescreen ? 150 : 120);
|
|
53
|
-
return {
|
|
54
|
-
points: points,
|
|
55
|
-
ratio: ratio
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* 空间场景面板
|
|
61
|
-
* @returns
|
|
62
|
-
*/
|
|
63
|
-
export function SpatialScenePanel(props) {
|
|
64
|
-
var timeoutRef = React.useRef(null);
|
|
65
|
-
var ref = React.useRef(null);
|
|
66
|
-
var panelRef = React.useRef(null);
|
|
67
|
-
var rendererRef = React.useRef(CSS3DRenderPlugin(props.five));
|
|
68
|
-
React.useEffect(function () {
|
|
69
|
-
if (!ref.current) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
var callback = function callback(keyframe) {
|
|
73
|
-
if (keyframe.data.customType !== 'SpatialScenePanel') {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
var data = keyframe.data;
|
|
77
|
-
|
|
78
|
-
// const data = mockData
|
|
79
|
-
var _searchV = searchV1({
|
|
80
|
-
five: props.five,
|
|
81
|
-
dom: ref.current
|
|
82
|
-
}),
|
|
83
|
-
points = _searchV.points,
|
|
84
|
-
ratio = _searchV.ratio;
|
|
85
|
-
var _ref2 = rendererRef.current.create3DDomContainer(points, {
|
|
86
|
-
ratio: ratio,
|
|
87
|
-
autoRender: false
|
|
88
|
-
}) || {},
|
|
89
|
-
container = _ref2.container,
|
|
90
|
-
dispose = _ref2.dispose,
|
|
91
|
-
css3DObject = _ref2.css3DObject,
|
|
92
|
-
render = _ref2.render;
|
|
93
|
-
Object.assign(window, {
|
|
94
|
-
$css3DObject: css3DObject
|
|
95
|
-
});
|
|
96
|
-
if (!container) return;
|
|
97
|
-
var root = createRoot(container);
|
|
98
|
-
root.render( /*#__PURE__*/React.createElement(Panel, {
|
|
99
|
-
ref: function ref(_ref3) {
|
|
100
|
-
return panelRef.current = _ref3;
|
|
101
|
-
},
|
|
102
|
-
data: data
|
|
103
|
-
}));
|
|
104
|
-
var startRotateY = -(Math.PI * 2) / 9;
|
|
105
|
-
var lastRotateY = 0;
|
|
106
|
-
tweenProgress(1000).onUpdate(function (_ref4) {
|
|
107
|
-
var progress = _ref4.progress;
|
|
108
|
-
var needRotateY = Math.PI / 90 * 11 * progress;
|
|
109
|
-
var rotateY = needRotateY - lastRotateY;
|
|
110
|
-
css3DObject === null || css3DObject === void 0 ? void 0 : css3DObject.rotateY(rotateY);
|
|
111
|
-
// css3DObject?.rotateZ
|
|
112
|
-
lastRotateY = needRotateY;
|
|
113
|
-
}).onStart(function () {
|
|
114
|
-
css3DObject === null || css3DObject === void 0 ? void 0 : css3DObject.rotateY(startRotateY);
|
|
115
|
-
render();
|
|
116
|
-
}).onDispose(function () {
|
|
117
|
-
var _panelRef$current;
|
|
118
|
-
(_panelRef$current = panelRef.current) === null || _panelRef$current === void 0 ? void 0 : _panelRef$current.classList.add('show');
|
|
119
|
-
}).play();
|
|
120
|
-
|
|
121
|
-
// Object.assign(window, { $dispose: () => {
|
|
122
|
-
// panelRef.current?.classList.add('hide')
|
|
123
|
-
// setTimeout(() => dispose?.(), 1500)
|
|
124
|
-
// } })
|
|
125
|
-
|
|
126
|
-
var start = keyframe.start,
|
|
127
|
-
end = keyframe.end;
|
|
128
|
-
timeoutRef.current = setTimeout(function () {
|
|
129
|
-
var _panelRef$current2;
|
|
130
|
-
(_panelRef$current2 = panelRef.current) === null || _panelRef$current2 === void 0 ? void 0 : _panelRef$current2.classList.add('hide');
|
|
131
|
-
timeoutRef.current = setTimeout(function () {
|
|
132
|
-
dispose === null || dispose === void 0 ? void 0 : dispose();
|
|
133
|
-
timeoutRef.current = null;
|
|
134
|
-
}, 1500);
|
|
135
|
-
}, end - start);
|
|
136
|
-
};
|
|
137
|
-
Object.assign(window, {
|
|
138
|
-
$callback: callback
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
// setTimeout(() => {callback()}, 8000)
|
|
142
|
-
props.subscribe.on(VreoKeyframeEnum.Custom, callback);
|
|
143
|
-
return function () {
|
|
144
|
-
props.subscribe.off(VreoKeyframeEnum.Custom, callback);
|
|
145
|
-
if (timeoutRef.current) {
|
|
146
|
-
clearTimeout(timeoutRef.current);
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
}, []);
|
|
150
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
151
|
-
className: "vreo-SpatialScenePanel",
|
|
152
|
-
ref: ref
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/** 背景动画:控制延迟 */
|
|
157
|
-
function SpatialScenePanelBg() {
|
|
158
|
-
var ref = React.useRef(null);
|
|
159
|
-
var timeoutRef = React.useRef(null);
|
|
160
|
-
React.useEffect(function () {
|
|
161
|
-
if (!ref.current) return;
|
|
162
|
-
var listener = function listener() {
|
|
163
|
-
var _ref$current;
|
|
164
|
-
(_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.setAttribute('class', 'SpatialScenePanel-bg');
|
|
165
|
-
timeoutRef.current = setTimeout(function () {
|
|
166
|
-
var _ref$current2;
|
|
167
|
-
(_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.setAttribute('class', 'SpatialScenePanel-bg SpatialScenePanel-bg--animation');
|
|
168
|
-
timeoutRef.current = null;
|
|
169
|
-
}, 3000);
|
|
170
|
-
};
|
|
171
|
-
ref.current.addEventListener('animationend', listener);
|
|
172
|
-
return function () {
|
|
173
|
-
if (ref.current) ref.current.removeEventListener('animationend', listener);
|
|
174
|
-
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
175
|
-
};
|
|
176
|
-
}, []);
|
|
177
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
178
|
-
ref: ref,
|
|
179
|
-
className: "SpatialScenePanel-bg SpatialScenePanel-bg--animation"
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
var Panel = /*#__PURE__*/React.forwardRef(function (props, myRef) {
|
|
183
|
-
var _props$data, _props$data2, _props$data3, _props$data3$stateLis;
|
|
184
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
185
|
-
className: "SpatialScenePanel",
|
|
186
|
-
ref: myRef
|
|
187
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
188
|
-
className: "SpatialScenePanel-show-area"
|
|
189
|
-
}, /*#__PURE__*/React.createElement(SpatialScenePanelBg, null), /*#__PURE__*/React.createElement("div", {
|
|
190
|
-
className: "SpatialScenePanel-header"
|
|
191
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
192
|
-
className: "SpatialScenePanel-title"
|
|
193
|
-
}, (_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.title), /*#__PURE__*/React.createElement("div", {
|
|
194
|
-
className: "SpatialScenePanel-temperature"
|
|
195
|
-
}, (_props$data2 = props.data) === null || _props$data2 === void 0 ? void 0 : _props$data2.temperature, "\u2103")), /*#__PURE__*/React.createElement("div", {
|
|
196
|
-
className: "SpatialScenePanel-body"
|
|
197
|
-
}, (_props$data3 = props.data) === null || _props$data3 === void 0 ? void 0 : (_props$data3$stateLis = _props$data3.stateList) === null || _props$data3$stateLis === void 0 ? void 0 : _props$data3$stateLis.map(function (state, index) {
|
|
198
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
199
|
-
key: "scene-".concat(state.text),
|
|
200
|
-
className: "SpatialScenePanel-item index_".concat(index)
|
|
201
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
202
|
-
className: "SpatialScenePanel-icon",
|
|
203
|
-
src: state.icon,
|
|
204
|
-
alt: "".concat(state.text)
|
|
205
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
206
|
-
className: "SpatialScenePanel-text"
|
|
207
|
-
}, state.text), /*#__PURE__*/React.createElement("div", {
|
|
208
|
-
className: "SpatialScenePanel-dot"
|
|
209
|
-
}));
|
|
210
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
211
|
-
className: "SpatialScenePanel-disappear-area"
|
|
212
|
-
}));
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
// export function SpatialScenePanel() {
|
|
216
|
-
// // const data = mockData
|
|
217
|
-
|
|
218
|
-
// return (
|
|
219
|
-
// <div className="SpatialScenePanel" >
|
|
220
|
-
// <div className="SpatialScenePanel-show-area">
|
|
221
|
-
// <SpatialScenePanelBg />
|
|
222
|
-
// <div className="SpatialScenePanel-header">
|
|
223
|
-
// <div className="SpatialScenePanel-title">{data?.title}</div>
|
|
224
|
-
// <div className="SpatialScenePanel-temperature">{data?.temperature}℃</div>
|
|
225
|
-
// </div>
|
|
226
|
-
// <div className="SpatialScenePanel-body">
|
|
227
|
-
// {data?.stateList?.map((state, index) => (
|
|
228
|
-
// <div key={`scene-${state.text}`} className={`SpatialScenePanel-item index_${index}`}>
|
|
229
|
-
// <img className="SpatialScenePanel-icon" src={state.icon}></img>
|
|
230
|
-
// <div className="SpatialScenePanel-text">{state.text}</div>
|
|
231
|
-
// <div className="SpatialScenePanel-dot"></div>
|
|
232
|
-
// </div>
|
|
233
|
-
// ))}
|
|
234
|
-
// </div>
|
|
235
|
-
// </div>
|
|
236
|
-
|
|
237
|
-
// <div className="SpatialScenePanel-disappear-area"></div>
|
|
238
|
-
// </div>
|
|
239
|
-
// )
|
|
240
|
-
// }
|
package/lib/Player/hooks.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ControllerContext } from "./Controller.js";
|
|
3
|
-
export function useController() {
|
|
4
|
-
var controller = React.useContext(ControllerContext);
|
|
5
|
-
if (!controller) {
|
|
6
|
-
throw new Error('没有找到 "ControllerContext"');
|
|
7
|
-
}
|
|
8
|
-
return controller;
|
|
9
|
-
}
|
|
10
|
-
export function useFiveInstance() {
|
|
11
|
-
var controller = useController();
|
|
12
|
-
if (!controller.five) {
|
|
13
|
-
throw new Error('没有找到 "five" 实例');
|
|
14
|
-
}
|
|
15
|
-
return controller.five;
|
|
16
|
-
}
|
|
17
|
-
export function useFiveProject2d() {
|
|
18
|
-
var five = useFiveInstance();
|
|
19
|
-
return function (vector) {
|
|
20
|
-
return five.project2d(vector, false);
|
|
21
|
-
};
|
|
22
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import { observer } from 'mobx-react';
|
|
4
|
-
import { useController } from "../../hooks.js";
|
|
5
|
-
var DrawerView = observer(function (_ref) {
|
|
6
|
-
var _controller$drawerCon2;
|
|
7
|
-
var controller = _ref.controller;
|
|
8
|
-
var maxHeight = '400px';
|
|
9
|
-
var height = function () {
|
|
10
|
-
var _controller$drawerCon;
|
|
11
|
-
var height = (_controller$drawerCon = controller.drawerConfig) === null || _controller$drawerCon === void 0 ? void 0 : _controller$drawerCon.height;
|
|
12
|
-
if (!height) {
|
|
13
|
-
return 'max-content';
|
|
14
|
-
}
|
|
15
|
-
if (typeof height === 'number') {
|
|
16
|
-
return height + 'px';
|
|
17
|
-
}
|
|
18
|
-
return height;
|
|
19
|
-
}();
|
|
20
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
21
|
-
className: classNames('vreo-drawer', {
|
|
22
|
-
'vreo-drawer-visible': controller.drawerConfig && controller.drawerConfig.content
|
|
23
|
-
}),
|
|
24
|
-
onClick: function onClick() {
|
|
25
|
-
return controller.openDrawer(false);
|
|
26
|
-
}
|
|
27
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
28
|
-
className: "vreo-drawer-inner",
|
|
29
|
-
style: {
|
|
30
|
-
height: height,
|
|
31
|
-
maxHeight: maxHeight
|
|
32
|
-
}
|
|
33
|
-
}, ((_controller$drawerCon2 = controller.drawerConfig) === null || _controller$drawerCon2 === void 0 ? void 0 : _controller$drawerCon2.content) || ''));
|
|
34
|
-
});
|
|
35
|
-
export function Drawer() {
|
|
36
|
-
var controller = useController();
|
|
37
|
-
return /*#__PURE__*/React.createElement(DrawerView, {
|
|
38
|
-
controller: controller
|
|
39
|
-
});
|
|
40
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import { observer } from 'mobx-react';
|
|
4
|
-
import { useController } from "../../hooks.js";
|
|
5
|
-
var PopUpView = observer(function (_ref) {
|
|
6
|
-
var controller = _ref.controller;
|
|
7
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
8
|
-
className: classNames('vreo-PopUp', {
|
|
9
|
-
'vreo-PopUp-visible': controller.popUp
|
|
10
|
-
}),
|
|
11
|
-
onClick: function onClick() {
|
|
12
|
-
return controller.openPopUp(false);
|
|
13
|
-
}
|
|
14
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
15
|
-
className: "vreo-PopUp-inner"
|
|
16
|
-
}, controller.popUp || ''));
|
|
17
|
-
});
|
|
18
|
-
export function PopUp() {
|
|
19
|
-
var controller = useController();
|
|
20
|
-
return /*#__PURE__*/React.createElement(PopUpView, {
|
|
21
|
-
controller: controller
|
|
22
|
-
});
|
|
23
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { addResizeListener, hasResizeListener } from "../../../shared-utils/addResizeListener.js";
|
|
3
|
-
import { useController } from "../../hooks.js";
|
|
4
|
-
export function ResizeObserver() {
|
|
5
|
-
var ref = React.useRef(null);
|
|
6
|
-
var controller = useController();
|
|
7
|
-
React.useEffect(function () {
|
|
8
|
-
if (!ref.current) return;
|
|
9
|
-
var resizeElement = controller.container.parentElement;
|
|
10
|
-
if (hasResizeListener(resizeElement)) return;
|
|
11
|
-
var dispose = addResizeListener(resizeElement, function (width, height) {
|
|
12
|
-
controller.setContainerSize(width, height);
|
|
13
|
-
});
|
|
14
|
-
return function () {
|
|
15
|
-
dispose();
|
|
16
|
-
};
|
|
17
|
-
}, []);
|
|
18
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
19
|
-
className: "resizeObserver-element",
|
|
20
|
-
ref: ref
|
|
21
|
-
});
|
|
22
|
-
}
|