@midscene/playground-app 1.7.7 → 1.7.10-beta-20260507030203.0
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/dist/es/SessionSetupPanel.mjs +2 -2
- package/dist/es/controller/selectors.mjs +0 -1
- package/dist/es/session-state.mjs +16 -6
- package/dist/lib/SessionSetupPanel.js +6 -3
- package/dist/lib/controller/selectors.js +0 -1
- package/dist/lib/session-state.js +16 -6
- package/dist/types/SessionSetupPanel.d.ts +2 -1
- package/package.json +4 -4
|
@@ -9,7 +9,7 @@ function getPlatformSelectorFieldKey(setup) {
|
|
|
9
9
|
}
|
|
10
10
|
function getPlatformSelectorOptions(field, setup) {
|
|
11
11
|
var _setup_platformRegistry;
|
|
12
|
-
if (!(null == setup ? void 0 : null == (_setup_platformRegistry = setup.platformRegistry) ? void 0 : _setup_platformRegistry.length)) return field.options;
|
|
12
|
+
if (getPlatformSelectorFieldKey(setup) !== field.key || !(null == setup ? void 0 : null == (_setup_platformRegistry = setup.platformRegistry) ? void 0 : _setup_platformRegistry.length)) return field.options;
|
|
13
13
|
const registryOptions = setup.platformRegistry.map((platform)=>({
|
|
14
14
|
label: platform.label,
|
|
15
15
|
value: platform.id,
|
|
@@ -169,4 +169,4 @@ function SessionSetupPanel({ form, sessionSetup, sessionSetupError, sessionViewS
|
|
|
169
169
|
})
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
|
-
export { SessionSetupPanel };
|
|
172
|
+
export { SessionSetupPanel, getPlatformSelectorOptions };
|
|
@@ -11,12 +11,22 @@ function resolveSessionViewState(runtimeInfo) {
|
|
|
11
11
|
}
|
|
12
12
|
function buildSessionInitialValues(setup, existingValues = {}) {
|
|
13
13
|
if (!setup) return {};
|
|
14
|
-
return Object.fromEntries(setup.fields.map((field)=>
|
|
15
|
-
var _existingValues_field_key, _ref;
|
|
16
|
-
return [
|
|
14
|
+
return Object.fromEntries(setup.fields.map((field)=>[
|
|
17
15
|
field.key,
|
|
18
|
-
|
|
19
|
-
];
|
|
20
|
-
|
|
16
|
+
resolveSessionFieldValue(field, existingValues[field.key])
|
|
17
|
+
]));
|
|
18
|
+
}
|
|
19
|
+
function hasSessionFieldValue(value) {
|
|
20
|
+
return null != value && '' !== value;
|
|
21
|
+
}
|
|
22
|
+
function resolveSessionFieldValue(field, existingValue) {
|
|
23
|
+
if (hasSessionFieldValue(existingValue)) return existingValue;
|
|
24
|
+
if ('select' === field.type) {
|
|
25
|
+
var _field_options_, _field_options;
|
|
26
|
+
var _field_defaultValue, _ref;
|
|
27
|
+
return null != (_ref = null != (_field_defaultValue = field.defaultValue) ? _field_defaultValue : null == (_field_options = field.options) ? void 0 : null == (_field_options_ = _field_options[0]) ? void 0 : _field_options_.value) ? _ref : '';
|
|
28
|
+
}
|
|
29
|
+
var _ref1;
|
|
30
|
+
return null != (_ref1 = null != existingValue ? existingValue : field.defaultValue) ? _ref1 : '';
|
|
21
31
|
}
|
|
22
32
|
export { buildSessionInitialValues, resolveSessionViewState };
|
|
@@ -33,7 +33,8 @@ var __webpack_require__ = {};
|
|
|
33
33
|
var __webpack_exports__ = {};
|
|
34
34
|
__webpack_require__.r(__webpack_exports__);
|
|
35
35
|
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
-
SessionSetupPanel: ()=>SessionSetupPanel
|
|
36
|
+
SessionSetupPanel: ()=>SessionSetupPanel,
|
|
37
|
+
getPlatformSelectorOptions: ()=>getPlatformSelectorOptions
|
|
37
38
|
});
|
|
38
39
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
39
40
|
const external_antd_namespaceObject = require("antd");
|
|
@@ -48,7 +49,7 @@ function getPlatformSelectorFieldKey(setup) {
|
|
|
48
49
|
}
|
|
49
50
|
function getPlatformSelectorOptions(field, setup) {
|
|
50
51
|
var _setup_platformRegistry;
|
|
51
|
-
if (!(null == setup ? void 0 : null == (_setup_platformRegistry = setup.platformRegistry) ? void 0 : _setup_platformRegistry.length)) return field.options;
|
|
52
|
+
if (getPlatformSelectorFieldKey(setup) !== field.key || !(null == setup ? void 0 : null == (_setup_platformRegistry = setup.platformRegistry) ? void 0 : _setup_platformRegistry.length)) return field.options;
|
|
52
53
|
const registryOptions = setup.platformRegistry.map((platform)=>({
|
|
53
54
|
label: platform.label,
|
|
54
55
|
value: platform.id,
|
|
@@ -209,8 +210,10 @@ function SessionSetupPanel({ form, sessionSetup, sessionSetupError, sessionViewS
|
|
|
209
210
|
});
|
|
210
211
|
}
|
|
211
212
|
exports.SessionSetupPanel = __webpack_exports__.SessionSetupPanel;
|
|
213
|
+
exports.getPlatformSelectorOptions = __webpack_exports__.getPlatformSelectorOptions;
|
|
212
214
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
213
|
-
"SessionSetupPanel"
|
|
215
|
+
"SessionSetupPanel",
|
|
216
|
+
"getPlatformSelectorOptions"
|
|
214
217
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
215
218
|
Object.defineProperty(exports, '__esModule', {
|
|
216
219
|
value: true
|
|
@@ -40,13 +40,23 @@ function resolveSessionViewState(runtimeInfo) {
|
|
|
40
40
|
}
|
|
41
41
|
function buildSessionInitialValues(setup, existingValues = {}) {
|
|
42
42
|
if (!setup) return {};
|
|
43
|
-
return Object.fromEntries(setup.fields.map((field)=>
|
|
44
|
-
var _existingValues_field_key, _ref;
|
|
45
|
-
return [
|
|
43
|
+
return Object.fromEntries(setup.fields.map((field)=>[
|
|
46
44
|
field.key,
|
|
47
|
-
|
|
48
|
-
];
|
|
49
|
-
|
|
45
|
+
resolveSessionFieldValue(field, existingValues[field.key])
|
|
46
|
+
]));
|
|
47
|
+
}
|
|
48
|
+
function hasSessionFieldValue(value) {
|
|
49
|
+
return null != value && '' !== value;
|
|
50
|
+
}
|
|
51
|
+
function resolveSessionFieldValue(field, existingValue) {
|
|
52
|
+
if (hasSessionFieldValue(existingValue)) return existingValue;
|
|
53
|
+
if ('select' === field.type) {
|
|
54
|
+
var _field_options_, _field_options;
|
|
55
|
+
var _field_defaultValue, _ref;
|
|
56
|
+
return null != (_ref = null != (_field_defaultValue = field.defaultValue) ? _field_defaultValue : null == (_field_options = field.options) ? void 0 : null == (_field_options_ = _field_options[0]) ? void 0 : _field_options_.value) ? _ref : '';
|
|
57
|
+
}
|
|
58
|
+
var _ref1;
|
|
59
|
+
return null != (_ref1 = null != existingValue ? existingValue : field.defaultValue) ? _ref1 : '';
|
|
50
60
|
}
|
|
51
61
|
exports.buildSessionInitialValues = __webpack_exports__.buildSessionInitialValues;
|
|
52
62
|
exports.resolveSessionViewState = __webpack_exports__.resolveSessionViewState;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { PlaygroundSessionSetup } from '@midscene/playground';
|
|
1
|
+
import type { PlaygroundSessionField, PlaygroundSessionSetup } from '@midscene/playground';
|
|
2
2
|
import type { FormInstance } from 'antd';
|
|
3
3
|
import type { PlaygroundFormValues } from './controller/types';
|
|
4
4
|
import type { PlaygroundSessionViewState } from './session-state';
|
|
5
5
|
import './SessionSetupPanel.less';
|
|
6
|
+
export declare function getPlatformSelectorOptions(field: PlaygroundSessionField, setup: PlaygroundSessionSetup | null): PlaygroundSessionField['options'];
|
|
6
7
|
export interface SessionSetupPanelProps {
|
|
7
8
|
form: FormInstance<PlaygroundFormValues>;
|
|
8
9
|
sessionSetup: PlaygroundSessionSetup | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/playground-app",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.10-beta-20260507030203.0",
|
|
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/",
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"antd": "^5.21.6",
|
|
29
29
|
"react-resizable-panels": "2.0.22",
|
|
30
30
|
"socket.io-client": "4.8.1",
|
|
31
|
-
"@midscene/playground": "1.7.
|
|
32
|
-
"@midscene/shared": "1.7.
|
|
33
|
-
"@midscene/visualizer": "1.7.
|
|
31
|
+
"@midscene/playground": "1.7.10-beta-20260507030203.0",
|
|
32
|
+
"@midscene/shared": "1.7.10-beta-20260507030203.0",
|
|
33
|
+
"@midscene/visualizer": "1.7.10-beta-20260507030203.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@rsbuild/plugin-less": "^1.5.0",
|