@realsee/vreo 2.6.1-alpha.1 → 2.6.1-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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import
|
|
3
|
+
import { createRoot } from 'react-dom/client';
|
|
4
4
|
import { Raycaster, Vector3 } from 'three';
|
|
5
5
|
import { tweenProgress } from "../../../shared-utils/animationFrame/BetterTween.js";
|
|
6
6
|
import { CSS3DRenderPlugin } from "../../../fivePlugins/CSS3DRenderPlugin/index.js";
|
|
@@ -94,12 +94,13 @@ export function SpatialScenePanel(props) {
|
|
|
94
94
|
$css3DObject: css3DObject
|
|
95
95
|
});
|
|
96
96
|
if (!container) return;
|
|
97
|
-
|
|
97
|
+
var root = createRoot(container);
|
|
98
|
+
root.render( /*#__PURE__*/React.createElement(Panel, {
|
|
98
99
|
ref: function ref(_ref3) {
|
|
99
100
|
return panelRef.current = _ref3;
|
|
100
101
|
},
|
|
101
102
|
data: data
|
|
102
|
-
})
|
|
103
|
+
}));
|
|
103
104
|
var startRotateY = -(Math.PI * 2) / 9;
|
|
104
105
|
var lastRotateY = 0;
|
|
105
106
|
tweenProgress(1000).onUpdate(function (_ref4) {
|
package/lib/Player/index.js
CHANGED
|
@@ -11,6 +11,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
11
11
|
// 下面这一行不能删
|
|
12
12
|
import * as React from 'react';
|
|
13
13
|
import * as ReactDOM from 'react-dom';
|
|
14
|
+
import { createRoot } from 'react-dom/client';
|
|
14
15
|
import { Subscribe } from '@realsee/five';
|
|
15
16
|
import { App } from "./App.js";
|
|
16
17
|
import { Controller, ControllerContext } from "./Controller.js";
|
|
@@ -75,7 +76,6 @@ export var Player = /*#__PURE__*/function (_Subscribe) {
|
|
|
75
76
|
var _five$getElement;
|
|
76
77
|
var oldElement = document.getElementById(id);
|
|
77
78
|
if (oldElement) {
|
|
78
|
-
ReactDOM.unmountComponentAtNode(oldElement);
|
|
79
79
|
oldElement.remove();
|
|
80
80
|
}
|
|
81
81
|
var container = document.createElement('div');
|
|
@@ -97,7 +97,8 @@ export var Player = /*#__PURE__*/function (_Subscribe) {
|
|
|
97
97
|
container: configs.container,
|
|
98
98
|
configs: _this.configs
|
|
99
99
|
});
|
|
100
|
-
|
|
100
|
+
var root = createRoot(configs.container);
|
|
101
|
+
root.render( /*#__PURE__*/React.createElement(ControllerContext.Provider, {
|
|
101
102
|
value: _this.controller
|
|
102
103
|
}, /*#__PURE__*/React.createElement(App, null), /*#__PURE__*/React.createElement(Drawer, null), /*#__PURE__*/React.createElement(PopUp, null), _this.configs.customKeyframes && _this.configs.customKeyframes.map(function (CustomCmpt, key) {
|
|
103
104
|
return /*#__PURE__*/React.createElement(CustomCmpt, {
|
|
@@ -115,7 +116,7 @@ export var Player = /*#__PURE__*/function (_Subscribe) {
|
|
|
115
116
|
},
|
|
116
117
|
five: five
|
|
117
118
|
});
|
|
118
|
-
}))
|
|
119
|
+
})));
|
|
119
120
|
|
|
120
121
|
// 监听播放情况:抛出触发时机
|
|
121
122
|
reaction(function () {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
|
-
import
|
|
4
|
+
import { createRoot } from 'react-dom/client';
|
|
5
5
|
import { Vector3, Quaternion } from 'three';
|
|
6
6
|
import { useController, useFiveInstance } from "../../../hooks.js";
|
|
7
7
|
import { CSS3DRenderPlugin } from "../../../../fivePlugins/CSS3DRenderPlugin/index.js";
|
|
@@ -92,16 +92,19 @@ export function PanoTextLabel() {
|
|
|
92
92
|
var quaternion = new Quaternion(data.quaternion.x, data.quaternion.y, data.quaternion.z, data.quaternion.w);
|
|
93
93
|
css3DObject === null || css3DObject === void 0 ? void 0 : css3DObject.quaternion.copy(quaternion);
|
|
94
94
|
}
|
|
95
|
-
if (container !== null && container !== void 0 && container.container)
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
95
|
+
if (container !== null && container !== void 0 && container.container) {
|
|
96
|
+
var root = createRoot(container.container);
|
|
97
|
+
root.render( /*#__PURE__*/React.createElement("div", {
|
|
98
|
+
className: "PanoTextLabel PanoTextLabel--notHidden"
|
|
99
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
100
|
+
className: "PanoTextLabel-wrapper"
|
|
101
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
102
|
+
style: {
|
|
103
|
+
fontSize: "".concat(data.fontSize || 16, "px")
|
|
104
|
+
},
|
|
105
|
+
className: "PanoText-innerText"
|
|
106
|
+
}, data.text || ''))));
|
|
107
|
+
}
|
|
105
108
|
timeoutRef.current = setTimeout(function () {
|
|
106
109
|
var _ref$current;
|
|
107
110
|
(_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.disposeAll();
|