@godscene/playground-electron 1.7.13 → 1.7.15
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.
|
@@ -81,7 +81,7 @@ function _object_spread_props(target, source) {
|
|
|
81
81
|
return target;
|
|
82
82
|
}
|
|
83
83
|
const { Content } = Layout;
|
|
84
|
-
function PlaygroundApp({ serverUrl, appVersion, title = 'Playground', defaultDeviceType = 'web', branding, playgroundConfig, offlineTitle = '
|
|
84
|
+
function PlaygroundApp({ serverUrl, appVersion, title = 'Playground', defaultDeviceType = 'web', branding, playgroundConfig, offlineTitle = '', offlineStatusText = 'Server offline...', pollIntervalMs = 5000 }) {
|
|
85
85
|
var _playgroundConfig_executionUx;
|
|
86
86
|
const [isNarrowScreen, setIsNarrowScreen] = useState(false);
|
|
87
87
|
const controller = usePlaygroundController({
|
|
@@ -153,17 +153,14 @@ function PlaygroundApp({ serverUrl, appVersion, title = 'Playground', defaultDev
|
|
|
153
153
|
};
|
|
154
154
|
}, []);
|
|
155
155
|
useEffect(()=>{
|
|
156
|
-
console.log(!!viewRef.current, 'viewRef.current');
|
|
157
156
|
const resizeObserver = new ResizeObserver((entries)=>{
|
|
158
157
|
for (let entry of entries){
|
|
159
158
|
var _window_electron;
|
|
160
|
-
console.log(entry.contentRect.width, entry.contentRect.height, 'entry.contentRect.width, entry.contentRect.height');
|
|
161
159
|
null == (_window_electron = window.electron) || _window_electron.ipcRenderer.send('playgroundViewer:resize', entry.contentRect.width, entry.contentRect.height);
|
|
162
160
|
}
|
|
163
161
|
});
|
|
164
162
|
if (viewRef.current) {
|
|
165
163
|
var _window_electron;
|
|
166
|
-
console.log(viewRef.current.clientWidth, viewRef.current.clientHeight, 'viewRef.current.clientWidth, viewRef.current.clientHeight');
|
|
167
164
|
null == (_window_electron = window.electron) || _window_electron.ipcRenderer.send('playgroundViewer:resize', viewRef.current.clientWidth, viewRef.current.clientHeight);
|
|
168
165
|
resizeObserver.observe(viewRef.current);
|
|
169
166
|
}
|
|
@@ -120,7 +120,7 @@ function _object_spread_props(target, source) {
|
|
|
120
120
|
return target;
|
|
121
121
|
}
|
|
122
122
|
const { Content } = external_antd_namespaceObject.Layout;
|
|
123
|
-
function PlaygroundApp({ serverUrl, appVersion, title = 'Playground', defaultDeviceType = 'web', branding, playgroundConfig, offlineTitle = '
|
|
123
|
+
function PlaygroundApp({ serverUrl, appVersion, title = 'Playground', defaultDeviceType = 'web', branding, playgroundConfig, offlineTitle = '', offlineStatusText = 'Server offline...', pollIntervalMs = 5000 }) {
|
|
124
124
|
var _playgroundConfig_executionUx;
|
|
125
125
|
const [isNarrowScreen, setIsNarrowScreen] = (0, external_react_namespaceObject.useState)(false);
|
|
126
126
|
const controller = (0, usePlaygroundController_js_namespaceObject.usePlaygroundController)({
|
|
@@ -192,17 +192,14 @@ function PlaygroundApp({ serverUrl, appVersion, title = 'Playground', defaultDev
|
|
|
192
192
|
};
|
|
193
193
|
}, []);
|
|
194
194
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
195
|
-
console.log(!!viewRef.current, 'viewRef.current');
|
|
196
195
|
const resizeObserver = new ResizeObserver((entries)=>{
|
|
197
196
|
for (let entry of entries){
|
|
198
197
|
var _window_electron;
|
|
199
|
-
console.log(entry.contentRect.width, entry.contentRect.height, 'entry.contentRect.width, entry.contentRect.height');
|
|
200
198
|
null == (_window_electron = window.electron) || _window_electron.ipcRenderer.send('playgroundViewer:resize', entry.contentRect.width, entry.contentRect.height);
|
|
201
199
|
}
|
|
202
200
|
});
|
|
203
201
|
if (viewRef.current) {
|
|
204
202
|
var _window_electron;
|
|
205
|
-
console.log(viewRef.current.clientWidth, viewRef.current.clientHeight, 'viewRef.current.clientWidth, viewRef.current.clientHeight');
|
|
206
203
|
null == (_window_electron = window.electron) || _window_electron.ipcRenderer.send('playgroundViewer:resize', viewRef.current.clientWidth, viewRef.current.clientHeight);
|
|
207
204
|
resizeObserver.observe(viewRef.current);
|
|
208
205
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@godscene/playground-electron",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.15",
|
|
4
4
|
"description": "Reusable React shell for Midscene playground applications",
|
|
5
5
|
"repository": "https://github.com/web-infra-dev/midscene",
|
|
6
6
|
"homepage": "https://midscenejs.com/",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"antd": "^5.21.6",
|
|
30
30
|
"react-resizable-panels": "2.0.22",
|
|
31
31
|
"socket.io-client": "4.8.1",
|
|
32
|
-
"@godscene/
|
|
33
|
-
"@godscene/
|
|
34
|
-
"@godscene/visualizer": "1.7.
|
|
32
|
+
"@godscene/playground": "1.7.15",
|
|
33
|
+
"@godscene/shared": "1.7.15",
|
|
34
|
+
"@godscene/visualizer": "1.7.15"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@rsbuild/plugin-less": "^1.5.0",
|