@midscene/visualizer 0.30.9 → 0.30.11-beta-20251218071621.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.
Files changed (123) hide show
  1. package/dist/es/component/blackboard/index.css +8 -0
  2. package/dist/es/component/blackboard/index.mjs +137 -68
  3. package/dist/es/component/config-selector/index.mjs +102 -4
  4. package/dist/es/component/context-preview/index.mjs +1 -2
  5. package/dist/es/component/env-config/index.mjs +1 -2
  6. package/dist/es/component/env-config-reminder/index.css +8 -0
  7. package/dist/es/component/env-config-reminder/index.mjs +1 -2
  8. package/dist/es/component/form-field/index.mjs +5 -10
  9. package/dist/es/component/history-selector/index.css +38 -1
  10. package/dist/es/component/history-selector/index.mjs +1 -2
  11. package/dist/es/component/logo/index.mjs +7 -3
  12. package/dist/es/component/misc/index.mjs +1 -4
  13. package/dist/es/component/nav-actions/index.mjs +1 -2
  14. package/dist/es/component/nav-actions/style.css +1 -1
  15. package/dist/es/component/player/index.css +26 -0
  16. package/dist/es/component/player/index.mjs +376 -364
  17. package/dist/es/component/playground/index.css +291 -31
  18. package/dist/es/component/playground-result/index.css +10 -0
  19. package/dist/es/component/playground-result/index.mjs +129 -10
  20. package/dist/es/component/prompt-input/index.css +281 -31
  21. package/dist/es/component/prompt-input/index.mjs +83 -25
  22. package/dist/es/component/screenshot-viewer/index.css +214 -0
  23. package/dist/es/component/screenshot-viewer/index.mjs +282 -0
  24. package/dist/es/component/service-mode-control/index.mjs +1 -2
  25. package/dist/es/component/shiny-text/index.css +35 -3
  26. package/dist/es/component/shiny-text/index.mjs +3 -3
  27. package/dist/es/component/universal-playground/index.css +61 -1
  28. package/dist/es/component/universal-playground/index.mjs +106 -83
  29. package/dist/es/component/universal-playground/providers/context-provider.mjs +56 -18
  30. package/dist/es/component/universal-playground/providers/indexeddb-storage-provider.mjs +213 -139
  31. package/dist/es/component/universal-playground/providers/storage-provider.mjs +199 -121
  32. package/dist/es/hooks/usePlaygroundExecution.mjs +297 -146
  33. package/dist/es/hooks/usePlaygroundState.mjs +141 -75
  34. package/dist/es/hooks/useSafeOverrideAIConfig.mjs +2 -6
  35. package/dist/es/hooks/useServerValid.mjs +37 -12
  36. package/dist/es/hooks/useTheme.mjs +25 -0
  37. package/dist/es/icons/avatar.mjs +46 -4
  38. package/dist/es/icons/close.mjs +46 -4
  39. package/dist/es/icons/global-perspective.mjs +47 -5
  40. package/dist/es/icons/history.mjs +48 -6
  41. package/dist/es/icons/magnifying-glass.mjs +47 -5
  42. package/dist/es/icons/player-setting.mjs +48 -6
  43. package/dist/es/icons/setting.mjs +47 -5
  44. package/dist/es/icons/show-marker.mjs +47 -5
  45. package/dist/es/index.mjs +4 -4
  46. package/dist/es/store/history.mjs +46 -7
  47. package/dist/es/store/store.mjs +68 -2
  48. package/dist/es/types.mjs +1 -1
  49. package/dist/es/utils/constants.mjs +7 -3
  50. package/dist/es/utils/index.mjs +4 -1
  51. package/dist/es/utils/pixi-loader.mjs +37 -11
  52. package/dist/es/utils/replay-scripts.mjs +160 -111
  53. package/dist/lib/component/blackboard/index.css +8 -0
  54. package/dist/lib/component/blackboard/index.js +139 -70
  55. package/dist/lib/component/config-selector/index.js +103 -5
  56. package/dist/lib/component/context-preview/index.js +3 -4
  57. package/dist/lib/component/env-config/index.js +3 -4
  58. package/dist/lib/component/env-config-reminder/index.css +8 -0
  59. package/dist/lib/component/env-config-reminder/index.js +3 -4
  60. package/dist/lib/component/form-field/index.js +10 -15
  61. package/dist/lib/component/history-selector/index.css +38 -1
  62. package/dist/lib/component/history-selector/index.js +3 -4
  63. package/dist/lib/component/index.js +6 -8
  64. package/dist/lib/component/logo/index.js +9 -5
  65. package/dist/lib/component/misc/index.js +6 -9
  66. package/dist/lib/component/nav-actions/index.js +3 -4
  67. package/dist/lib/component/nav-actions/style.css +1 -1
  68. package/dist/lib/component/player/index.css +26 -0
  69. package/dist/lib/component/player/index.js +376 -365
  70. package/dist/lib/component/playground/index.css +291 -31
  71. package/dist/lib/component/playground/index.js +31 -33
  72. package/dist/lib/component/playground-result/index.css +10 -0
  73. package/dist/lib/component/playground-result/index.js +131 -12
  74. package/dist/lib/component/prompt-input/index.css +281 -31
  75. package/dist/lib/component/prompt-input/index.js +84 -26
  76. package/dist/lib/component/screenshot-viewer/index.css +214 -0
  77. package/dist/lib/component/screenshot-viewer/index.js +316 -0
  78. package/dist/lib/component/service-mode-control/index.js +3 -4
  79. package/dist/lib/component/shiny-text/index.css +35 -3
  80. package/dist/lib/component/shiny-text/index.js +5 -5
  81. package/dist/lib/component/universal-playground/index.css +61 -1
  82. package/dist/lib/component/universal-playground/index.js +108 -84
  83. package/dist/lib/component/universal-playground/providers/context-provider.js +58 -20
  84. package/dist/lib/component/universal-playground/providers/indexeddb-storage-provider.js +217 -143
  85. package/dist/lib/component/universal-playground/providers/storage-provider.js +207 -129
  86. package/dist/lib/hooks/usePlaygroundExecution.js +299 -148
  87. package/dist/lib/hooks/usePlaygroundState.js +143 -77
  88. package/dist/lib/hooks/useSafeOverrideAIConfig.js +4 -8
  89. package/dist/lib/hooks/useServerValid.js +39 -14
  90. package/dist/lib/hooks/useTheme.js +59 -0
  91. package/dist/lib/icons/avatar.js +48 -6
  92. package/dist/lib/icons/close.js +48 -6
  93. package/dist/lib/icons/global-perspective.js +49 -7
  94. package/dist/lib/icons/history.js +50 -8
  95. package/dist/lib/icons/magnifying-glass.js +49 -7
  96. package/dist/lib/icons/player-setting.js +50 -8
  97. package/dist/lib/icons/setting.js +49 -7
  98. package/dist/lib/icons/show-marker.js +49 -7
  99. package/dist/lib/index.js +44 -34
  100. package/dist/lib/store/history.js +48 -9
  101. package/dist/lib/store/store.js +74 -8
  102. package/dist/lib/types.js +3 -3
  103. package/dist/lib/utils/color.js +2 -2
  104. package/dist/lib/utils/constants.js +20 -4
  105. package/dist/lib/utils/index.js +10 -4
  106. package/dist/lib/utils/pixi-loader.js +41 -15
  107. package/dist/lib/utils/playground-utils.js +4 -4
  108. package/dist/lib/utils/replay-scripts.js +164 -115
  109. package/dist/types/component/config-selector/index.d.ts +2 -0
  110. package/dist/types/component/player/index.d.ts +0 -1
  111. package/dist/types/component/playground-result/index.d.ts +1 -0
  112. package/dist/types/component/prompt-input/index.d.ts +2 -1
  113. package/dist/types/component/screenshot-viewer/index.d.ts +15 -0
  114. package/dist/types/hooks/usePlaygroundExecution.d.ts +1 -1
  115. package/dist/types/hooks/usePlaygroundState.d.ts +3 -3
  116. package/dist/types/hooks/useTheme.d.ts +7 -0
  117. package/dist/types/index.d.ts +3 -3
  118. package/dist/types/store/store.d.ts +18 -1
  119. package/dist/types/types.d.ts +14 -4
  120. package/dist/types/utils/constants.d.ts +5 -1
  121. package/dist/types/utils/index.d.ts +1 -0
  122. package/dist/types/utils/replay-scripts.d.ts +1 -1
  123. package/package.json +12 -22
@@ -1,5 +1,5 @@
1
- 'use client';
2
1
  "use strict";
2
+ "use client";
3
3
  var __webpack_require__ = {};
4
4
  (()=>{
5
5
  __webpack_require__.d = (exports1, definition)=>{
@@ -25,21 +25,44 @@ var __webpack_require__ = {};
25
25
  var __webpack_exports__ = {};
26
26
  __webpack_require__.r(__webpack_exports__);
27
27
  __webpack_require__.d(__webpack_exports__, {
28
+ Blackboard: ()=>Blackboard,
28
29
  pointMarkForItem: ()=>pointMarkForItem,
29
30
  default: ()=>blackboard,
30
- Blackboard: ()=>Blackboard,
31
31
  rectMarkForItem: ()=>rectMarkForItem
32
32
  });
33
33
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
34
34
  require("pixi.js/unsafe-eval");
35
- const external_antd_namespaceObject = require("antd");
36
35
  const external_pixi_js_namespaceObject = require("pixi.js");
37
36
  const external_react_namespaceObject = require("react");
38
37
  const color_js_namespaceObject = require("../../utils/color.js");
39
38
  require("./index.css");
40
- const extractor_namespaceObject = require("@midscene/shared/extractor");
41
39
  const external_pixi_filters_namespaceObject = require("pixi-filters");
42
- const store_js_namespaceObject = require("../../store/store.js");
40
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
41
+ try {
42
+ var info = gen[key](arg);
43
+ var value = info.value;
44
+ } catch (error) {
45
+ reject(error);
46
+ return;
47
+ }
48
+ if (info.done) resolve(value);
49
+ else Promise.resolve(value).then(_next, _throw);
50
+ }
51
+ function _async_to_generator(fn) {
52
+ return function() {
53
+ var self = this, args = arguments;
54
+ return new Promise(function(resolve, reject) {
55
+ var gen = fn.apply(self, args);
56
+ function _next(value) {
57
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
58
+ }
59
+ function _throw(err) {
60
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
61
+ }
62
+ _next(void 0);
63
+ });
64
+ };
65
+ }
43
66
  const itemFillAlpha = 0.4;
44
67
  const highlightAlpha = 0.4;
45
68
  const pointRadius = 10;
@@ -92,7 +115,7 @@ const rectMarkForItem = (rect, name, type)=>{
92
115
  };
93
116
  const Blackboard = (props)=>{
94
117
  const highlightElements = props.highlightElements || [];
95
- const highlightIds = highlightElements.map((e)=>e.id);
118
+ highlightElements.map((e)=>e.id);
96
119
  const highlightRect = props.highlightRect;
97
120
  const highlightPoints = props.highlightPoints;
98
121
  const context = props.uiContext;
@@ -106,31 +129,39 @@ const Blackboard = (props)=>{
106
129
  const elementMarkContainer = (0, external_react_namespaceObject.useMemo)(()=>new external_pixi_js_namespaceObject.Container(), []);
107
130
  const [hoverElement, setHoverElement] = (0, external_react_namespaceObject.useState)(null);
108
131
  const pixiBgRef = (0, external_react_namespaceObject.useRef)(void 0);
109
- const { backgroundVisible, setBackgroundVisible, elementsVisible, setElementsVisible } = (0, store_js_namespaceObject.useBlackboardPreference)();
132
+ const animationFrameRef = (0, external_react_namespaceObject.useRef)(null);
133
+ const highlightGraphicsRef = (0, external_react_namespaceObject.useRef)([]);
134
+ const glowFiltersRef = (0, external_react_namespaceObject.useRef)([]);
135
+ const backgroundVisible = true;
136
+ const elementsVisible = true;
110
137
  (0, external_react_namespaceObject.useEffect)(()=>{
111
- Promise.resolve((async ()=>{
112
- if (!domRef.current || !screenWidth) return;
113
- await app.init({
114
- width: screenWidth,
115
- height: screenHeight,
116
- background: 0xffffff
117
- });
118
- const canvasEl = domRef.current;
119
- domRef.current.appendChild(app.canvas);
120
- const { clientWidth } = domRef.current.parentElement;
121
- const targetHeight = 0.6 * window.innerHeight;
122
- const viewportRatio = clientWidth / targetHeight;
123
- if (screenWidth / screenHeight <= viewportRatio) {
124
- const ratio = targetHeight / screenHeight;
125
- canvasEl.style.width = `${Math.floor(screenWidth * ratio)}px`;
126
- canvasEl.style.height = `${Math.floor(screenHeight * ratio)}px`;
127
- }
128
- app.stage.addChild(highlightContainer);
129
- app.stage.addChild(elementMarkContainer);
130
- setAppInitialed(true);
131
- })());
138
+ Promise.resolve((()=>_async_to_generator(function*() {
139
+ if (!domRef.current || !screenWidth) return;
140
+ yield app.init({
141
+ width: screenWidth,
142
+ height: screenHeight,
143
+ background: 0xffffff
144
+ });
145
+ const canvasEl = domRef.current;
146
+ domRef.current.appendChild(app.canvas);
147
+ const { clientWidth } = domRef.current.parentElement;
148
+ const targetHeight = 0.6 * window.innerHeight;
149
+ const viewportRatio = clientWidth / targetHeight;
150
+ if (screenWidth / screenHeight <= viewportRatio) {
151
+ const ratio = targetHeight / screenHeight;
152
+ canvasEl.style.width = `${Math.floor(screenWidth * ratio)}px`;
153
+ canvasEl.style.height = `${Math.floor(screenHeight * ratio)}px`;
154
+ }
155
+ app.stage.addChild(highlightContainer);
156
+ app.stage.addChild(elementMarkContainer);
157
+ setAppInitialed(true);
158
+ })())());
132
159
  return ()=>{
133
160
  console.log('will destroy');
161
+ if (null !== animationFrameRef.current) {
162
+ cancelAnimationFrame(animationFrameRef.current);
163
+ animationFrameRef.current = null;
164
+ }
134
165
  try {
135
166
  app.destroy(true, {
136
167
  children: true,
@@ -201,26 +232,54 @@ const Blackboard = (props)=>{
201
232
  elementMarkContainer.removeChildren();
202
233
  highlightContainer.eventMode = 'passive';
203
234
  elementMarkContainer.eventMode = 'passive';
235
+ highlightGraphicsRef.current = [];
236
+ glowFiltersRef.current = [];
204
237
  if (highlightRect) {
205
238
  const [graphics] = rectMarkForItem(highlightRect, 'Search Area', 'searchArea');
206
239
  highlightContainer.addChild(graphics);
207
240
  }
208
241
  if (highlightElements.length) highlightElements.forEach((element)=>{
209
242
  const { rect, content, id } = element;
210
- const [graphics] = rectMarkForItem(rect, content, 'highlight');
211
- highlightContainer.addChild(graphics);
243
+ const items = rectMarkForItem(rect, content, 'highlight');
244
+ const graphics = items[0];
245
+ const glowFilter = new external_pixi_filters_namespaceObject.GlowFilter({
246
+ distance: 30,
247
+ outerStrength: 3,
248
+ innerStrength: 0,
249
+ color: 0xfd5907,
250
+ quality: 0.5
251
+ });
252
+ const existingFilters = graphics.filters;
253
+ if (Array.isArray(existingFilters)) graphics.filters = [
254
+ ...existingFilters,
255
+ glowFilter
256
+ ];
257
+ else if (existingFilters) graphics.filters = [
258
+ existingFilters,
259
+ glowFilter
260
+ ];
261
+ else graphics.filters = [
262
+ glowFilter
263
+ ];
264
+ items.forEach((item)=>highlightContainer.addChild(item));
265
+ highlightGraphicsRef.current.push(graphics);
266
+ glowFiltersRef.current.push(glowFilter);
212
267
  });
213
268
  if (null == highlightPoints ? void 0 : highlightPoints.length) highlightPoints.forEach((point)=>{
214
269
  const graphics = pointMarkForItem(point, 'highlightPoint');
270
+ const glowFilter = new external_pixi_filters_namespaceObject.GlowFilter({
271
+ distance: 25,
272
+ outerStrength: 2.5,
273
+ innerStrength: 0,
274
+ color: 0xfd5907,
275
+ quality: 0.5
276
+ });
277
+ graphics.filters = [
278
+ glowFilter
279
+ ];
215
280
  highlightContainer.addChild(graphics);
216
- });
217
- const elements = (0, extractor_namespaceObject.treeToList)(context.tree);
218
- elements.forEach((element)=>{
219
- const { rect, content, id } = element;
220
- const ifHighlight = highlightIds.includes(id) || (null == hoverElement ? void 0 : hoverElement.id) === id;
221
- if (ifHighlight) return;
222
- const [graphics] = rectMarkForItem(rect, content, 'element');
223
- elementMarkContainer.addChild(graphics);
281
+ highlightGraphicsRef.current.push(graphics);
282
+ glowFiltersRef.current.push(glowFilter);
224
283
  });
225
284
  elementMarkContainer.visible = elementsVisible;
226
285
  return {
@@ -230,19 +289,50 @@ const Blackboard = (props)=>{
230
289
  app,
231
290
  appInitialed,
232
291
  highlightElements,
233
- context.tree,
234
292
  hoverElement,
235
293
  highlightRect,
236
294
  highlightPoints
237
295
  ]);
238
- const onSetBackgroundVisible = (e)=>{
239
- setBackgroundVisible(e.target.checked);
240
- if (pixiBgRef.current) pixiBgRef.current.visible = e.target.checked;
241
- };
242
- const onSetElementsVisible = (e)=>{
243
- setElementsVisible(e.target.checked);
244
- elementMarkContainer.visible = e.target.checked;
245
- };
296
+ (0, external_react_namespaceObject.useEffect)(()=>{
297
+ if (!appInitialed || 0 === highlightGraphicsRef.current.length) return void console.log('Animation skipped:', {
298
+ appInitialed,
299
+ graphicsCount: highlightGraphicsRef.current.length
300
+ });
301
+ console.log('Starting pulsing animation for', highlightGraphicsRef.current.length, 'graphics');
302
+ const graphicsToAnimate = highlightGraphicsRef.current;
303
+ const glowFilters = glowFiltersRef.current;
304
+ const pulseDuration = 1200;
305
+ const minAlpha = 0.4;
306
+ const maxAlpha = 1.0;
307
+ const minGlowStrength = 2.0;
308
+ const maxGlowStrength = 5.0;
309
+ const startTime = performance.now();
310
+ const animate = ()=>{
311
+ const elapsed = performance.now() - startTime;
312
+ const progress = elapsed % pulseDuration / pulseDuration;
313
+ const sineValue = Math.sin(progress * Math.PI * 2);
314
+ const normalizedSine = (sineValue + 1) / 2;
315
+ const alpha = minAlpha + normalizedSine * (maxAlpha - minAlpha);
316
+ const glowStrength = minGlowStrength + normalizedSine * (maxGlowStrength - minGlowStrength);
317
+ graphicsToAnimate.forEach((graphics, index)=>{
318
+ graphics.alpha = alpha;
319
+ if (glowFilters[index]) glowFilters[index].outerStrength = glowStrength;
320
+ });
321
+ animationFrameRef.current = requestAnimationFrame(animate);
322
+ };
323
+ animate();
324
+ return ()=>{
325
+ console.log('Stopping pulsing animation');
326
+ if (null !== animationFrameRef.current) {
327
+ cancelAnimationFrame(animationFrameRef.current);
328
+ animationFrameRef.current = null;
329
+ }
330
+ };
331
+ }, [
332
+ appInitialed,
333
+ highlightElements,
334
+ highlightPoints
335
+ ]);
246
336
  let bottomTipA = null;
247
337
  if (1 === highlightElementRects.length) bottomTipA = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
248
338
  className: "bottom-tip",
@@ -274,27 +364,6 @@ const Blackboard = (props)=>{
274
364
  },
275
365
  ref: domRef
276
366
  }),
277
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
278
- className: "blackboard-filter",
279
- style: {
280
- display: props.hideController ? 'none' : 'block'
281
- },
282
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
283
- className: "overlay-control",
284
- children: [
285
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Checkbox, {
286
- checked: backgroundVisible,
287
- onChange: onSetBackgroundVisible,
288
- children: "Background"
289
- }),
290
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Checkbox, {
291
- checked: elementsVisible,
292
- onChange: onSetElementsVisible,
293
- children: "Elements"
294
- })
295
- ]
296
- })
297
- }),
298
367
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
299
368
  className: "bottom-tip",
300
369
  style: {
@@ -310,12 +379,12 @@ exports.Blackboard = __webpack_exports__.Blackboard;
310
379
  exports["default"] = __webpack_exports__["default"];
311
380
  exports.pointMarkForItem = __webpack_exports__.pointMarkForItem;
312
381
  exports.rectMarkForItem = __webpack_exports__.rectMarkForItem;
313
- for(var __webpack_i__ in __webpack_exports__)if (-1 === [
382
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
314
383
  "Blackboard",
315
384
  "default",
316
385
  "pointMarkForItem",
317
386
  "rectMarkForItem"
318
- ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
387
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
319
388
  Object.defineProperty(exports, '__esModule', {
320
389
  value: true
321
390
  });
@@ -41,8 +41,7 @@ const setting_js_namespaceObject = require("../../icons/setting.js");
41
41
  var setting_js_default = /*#__PURE__*/ __webpack_require__.n(setting_js_namespaceObject);
42
42
  const store_js_namespaceObject = require("../../store/store.js");
43
43
  const constants_js_namespaceObject = require("../../utils/constants.js");
44
- const ConfigSelector = (param)=>{
45
- let { showDeepThinkOption = false, enableTracking = false, showDataExtractionOptions = false, hideDomAndScreenshotOptions = false } = param;
44
+ const ConfigSelector = ({ showDeepThinkOption = false, enableTracking = false, showDataExtractionOptions = false, hideDomAndScreenshotOptions = false, deviceType })=>{
46
45
  const forceSameTabNavigation = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.forceSameTabNavigation);
47
46
  const setForceSameTabNavigation = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.setForceSameTabNavigation);
48
47
  const deepThink = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.deepThink);
@@ -51,7 +50,16 @@ const ConfigSelector = (param)=>{
51
50
  const setScreenshotIncluded = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.setScreenshotIncluded);
52
51
  const domIncluded = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.domIncluded);
53
52
  const setDomIncluded = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.setDomIncluded);
54
- if (!enableTracking && !showDeepThinkOption && !showDataExtractionOptions) return null;
53
+ const imeStrategy = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.imeStrategy);
54
+ const setImeStrategy = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.setImeStrategy);
55
+ const autoDismissKeyboard = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.autoDismissKeyboard);
56
+ const setAutoDismissKeyboard = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.setAutoDismissKeyboard);
57
+ const keyboardDismissStrategy = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.keyboardDismissStrategy);
58
+ const setKeyboardDismissStrategy = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.setKeyboardDismissStrategy);
59
+ const alwaysRefreshScreenInfo = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.alwaysRefreshScreenInfo);
60
+ const setAlwaysRefreshScreenInfo = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.setAlwaysRefreshScreenInfo);
61
+ const hasDeviceOptions = 'android' === deviceType || 'ios' === deviceType;
62
+ if (!enableTracking && !showDeepThinkOption && !showDataExtractionOptions && !hasDeviceOptions) return null;
55
63
  const configItems = buildConfigItems();
56
64
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
57
65
  className: "selector-trigger",
@@ -136,13 +144,103 @@ const ConfigSelector = (param)=>{
136
144
  key: 'dom-included-config'
137
145
  });
138
146
  }
147
+ if ('android' === deviceType) {
148
+ items.push({
149
+ label: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
150
+ style: {
151
+ padding: '4px 0'
152
+ },
153
+ children: [
154
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
155
+ style: {
156
+ marginBottom: '4px',
157
+ fontSize: '14px'
158
+ },
159
+ children: constants_js_namespaceObject.imeStrategyTip
160
+ }),
161
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_antd_namespaceObject.Radio.Group, {
162
+ size: "small",
163
+ value: imeStrategy,
164
+ onChange: (e)=>setImeStrategy(e.target.value),
165
+ children: [
166
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Radio, {
167
+ value: "always-yadb",
168
+ children: "Always YADB"
169
+ }),
170
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Radio, {
171
+ value: "yadb-for-non-ascii",
172
+ children: "YADB for non-ASCII"
173
+ })
174
+ ]
175
+ })
176
+ ]
177
+ }),
178
+ key: 'ime-strategy-config'
179
+ });
180
+ items.push({
181
+ label: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Checkbox, {
182
+ onChange: (e)=>setAutoDismissKeyboard(e.target.checked),
183
+ checked: autoDismissKeyboard,
184
+ children: constants_js_namespaceObject.autoDismissKeyboardTip
185
+ }),
186
+ key: 'auto-dismiss-keyboard-config'
187
+ });
188
+ items.push({
189
+ label: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
190
+ style: {
191
+ padding: '4px 0'
192
+ },
193
+ children: [
194
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
195
+ style: {
196
+ marginBottom: '4px',
197
+ fontSize: '14px'
198
+ },
199
+ children: constants_js_namespaceObject.keyboardDismissStrategyTip
200
+ }),
201
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_antd_namespaceObject.Radio.Group, {
202
+ size: "small",
203
+ value: keyboardDismissStrategy,
204
+ onChange: (e)=>setKeyboardDismissStrategy(e.target.value),
205
+ children: [
206
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Radio, {
207
+ value: "esc-first",
208
+ children: "ESC first"
209
+ }),
210
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Radio, {
211
+ value: "back-first",
212
+ children: "Back first"
213
+ })
214
+ ]
215
+ })
216
+ ]
217
+ }),
218
+ key: 'keyboard-dismiss-strategy-config'
219
+ });
220
+ items.push({
221
+ label: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Checkbox, {
222
+ onChange: (e)=>setAlwaysRefreshScreenInfo(e.target.checked),
223
+ checked: alwaysRefreshScreenInfo,
224
+ children: constants_js_namespaceObject.alwaysRefreshScreenInfoTip
225
+ }),
226
+ key: 'always-refresh-screen-info-config'
227
+ });
228
+ }
229
+ if ('ios' === deviceType) items.push({
230
+ label: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Checkbox, {
231
+ onChange: (e)=>setAutoDismissKeyboard(e.target.checked),
232
+ checked: autoDismissKeyboard,
233
+ children: constants_js_namespaceObject.autoDismissKeyboardTip
234
+ }),
235
+ key: 'auto-dismiss-keyboard-config'
236
+ });
139
237
  return items;
140
238
  }
141
239
  };
142
240
  exports.ConfigSelector = __webpack_exports__.ConfigSelector;
143
- for(var __webpack_i__ in __webpack_exports__)if (-1 === [
241
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
144
242
  "ConfigSelector"
145
- ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
243
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
146
244
  Object.defineProperty(exports, '__esModule', {
147
245
  value: true
148
246
  });
@@ -42,8 +42,7 @@ var index_js_default = /*#__PURE__*/ __webpack_require__.n(index_js_namespaceObj
42
42
  const external_misc_index_js_namespaceObject = require("../misc/index.js");
43
43
  const playground_demo_ui_context_json_namespaceObject = require("../playground/playground-demo-ui-context.json");
44
44
  var playground_demo_ui_context_json_default = /*#__PURE__*/ __webpack_require__.n(playground_demo_ui_context_json_namespaceObject);
45
- const ContextPreview = (param)=>{
46
- let { uiContextPreview, setUiContextPreview, showContextPreview } = param;
45
+ const ContextPreview = ({ uiContextPreview, setUiContextPreview, showContextPreview })=>{
47
46
  if (!showContextPreview) return null;
48
47
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
49
48
  className: "form-part context-panel",
@@ -75,9 +74,9 @@ const ContextPreview = (param)=>{
75
74
  });
76
75
  };
77
76
  exports.ContextPreview = __webpack_exports__.ContextPreview;
78
- for(var __webpack_i__ in __webpack_exports__)if (-1 === [
77
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
79
78
  "ContextPreview"
80
- ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
79
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
81
80
  Object.defineProperty(exports, '__esModule', {
82
81
  value: true
83
82
  });
@@ -31,8 +31,7 @@ const icons_namespaceObject = require("@ant-design/icons");
31
31
  const external_antd_namespaceObject = require("antd");
32
32
  const external_react_namespaceObject = require("react");
33
33
  const store_js_namespaceObject = require("../../store/store.js");
34
- function EnvConfig(param) {
35
- let { showTooltipWhenEmpty = true, showModelName = true, tooltipPlacement = 'bottom', mode = 'icon' } = param;
34
+ function EnvConfig({ showTooltipWhenEmpty = true, showModelName = true, tooltipPlacement = 'bottom', mode = 'icon' }) {
36
35
  const { config, configString, loadConfig, syncFromStorage } = (0, store_js_namespaceObject.useEnvConfig)();
37
36
  const [isModalOpen, setIsModalOpen] = (0, external_react_namespaceObject.useState)(false);
38
37
  const [tempConfigString, setTempConfigString] = (0, external_react_namespaceObject.useState)(configString);
@@ -138,9 +137,9 @@ function EnvConfig(param) {
138
137
  });
139
138
  }
140
139
  exports.EnvConfig = __webpack_exports__.EnvConfig;
141
- for(var __webpack_i__ in __webpack_exports__)if (-1 === [
140
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
142
141
  "EnvConfig"
143
- ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
142
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
144
143
  Object.defineProperty(exports, '__esModule', {
145
144
  value: true
146
145
  });
@@ -20,3 +20,11 @@
20
20
  font-size: 14px;
21
21
  }
22
22
 
23
+ [data-theme="dark"] .env-config-reminder {
24
+ background: rgba(82, 38, 7, .3);
25
+ }
26
+
27
+ [data-theme="dark"] .env-config-reminder .reminder-text {
28
+ color: #f8fafd;
29
+ }
30
+
@@ -31,8 +31,7 @@ const icons_namespaceObject = require("@ant-design/icons");
31
31
  const store_js_namespaceObject = require("../../store/store.js");
32
32
  const index_js_namespaceObject = require("../env-config/index.js");
33
33
  require("./index.css");
34
- const EnvConfigReminder = (param)=>{
35
- let { className = '' } = param;
34
+ const EnvConfigReminder = ({ className = '' })=>{
36
35
  const { config } = (0, store_js_namespaceObject.useEnvConfig)();
37
36
  const configAlreadySet = Object.keys(config || {}).length >= 1;
38
37
  if (configAlreadySet) return null;
@@ -54,9 +53,9 @@ const EnvConfigReminder = (param)=>{
54
53
  });
55
54
  };
56
55
  exports.EnvConfigReminder = __webpack_exports__.EnvConfigReminder;
57
- for(var __webpack_i__ in __webpack_exports__)if (-1 === [
56
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
58
57
  "EnvConfigReminder"
59
- ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
58
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
60
59
  Object.defineProperty(exports, '__esModule', {
61
60
  value: true
62
61
  });
@@ -24,18 +24,17 @@ var __webpack_require__ = {};
24
24
  var __webpack_exports__ = {};
25
25
  __webpack_require__.r(__webpack_exports__);
26
26
  __webpack_require__.d(__webpack_exports__, {
27
- BooleanField: ()=>BooleanField,
27
+ EnumField: ()=>EnumField,
28
28
  NumberField: ()=>NumberField,
29
- TextField: ()=>TextField,
30
29
  LocateField: ()=>LocateField,
31
- EnumField: ()=>EnumField
30
+ TextField: ()=>TextField,
31
+ BooleanField: ()=>BooleanField
32
32
  });
33
33
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
34
34
  const external_antd_namespaceObject = require("antd");
35
35
  const { TextArea } = external_antd_namespaceObject.Input;
36
36
  const renderLabel = (label, isOptional)=>`${label}${isOptional ? ' (Optional)' : ''}`;
37
- const TextField = (param)=>{
38
- let { name, label, isRequired, marginBottom, placeholder: customPlaceholder } = param;
37
+ const TextField = ({ name, label, isRequired, marginBottom, placeholder: customPlaceholder })=>{
39
38
  const placeholder = customPlaceholder || `Enter ${name}`;
40
39
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Form.Item, {
41
40
  name: [
@@ -58,8 +57,7 @@ const TextField = (param)=>{
58
57
  })
59
58
  }, name);
60
59
  };
61
- const LocateField = (param)=>{
62
- let { name, label, isRequired, marginBottom, placeholder: customPlaceholder } = param;
60
+ const LocateField = ({ name, label, isRequired, marginBottom, placeholder: customPlaceholder })=>{
63
61
  const placeholder = customPlaceholder || `Describe the ${name}, use natural language`;
64
62
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Form.Item, {
65
63
  name: [
@@ -83,8 +81,7 @@ const LocateField = (param)=>{
83
81
  })
84
82
  }, name);
85
83
  };
86
- const EnumField = (param)=>{
87
- let { name, label, fieldSchema, isRequired, marginBottom, placeholder: customPlaceholder } = param;
84
+ const EnumField = ({ name, label, fieldSchema, isRequired, marginBottom, placeholder: customPlaceholder })=>{
88
85
  var _fieldSchema__def;
89
86
  const enumValues = (null == (_fieldSchema__def = fieldSchema._def) ? void 0 : _fieldSchema__def.values) || [];
90
87
  const selectOptions = enumValues.map((value)=>({
@@ -113,8 +110,7 @@ const EnumField = (param)=>{
113
110
  })
114
111
  }, name);
115
112
  };
116
- const NumberField = (param)=>{
117
- let { name, label, isRequired, marginBottom, placeholder: customPlaceholder } = param;
113
+ const NumberField = ({ name, label, isRequired, marginBottom, placeholder: customPlaceholder })=>{
118
114
  const defaultPlaceholder = 'distance' === name ? 500 : 0;
119
115
  const placeholderValue = customPlaceholder ? Number(customPlaceholder) || defaultPlaceholder : defaultPlaceholder;
120
116
  const min = 0;
@@ -158,8 +154,7 @@ const NumberField = (param)=>{
158
154
  })
159
155
  }, name);
160
156
  };
161
- const BooleanField = (param)=>{
162
- let { name, label, isRequired, marginBottom, placeholder: customPlaceholder } = param;
157
+ const BooleanField = ({ name, label, isRequired, marginBottom, placeholder: customPlaceholder })=>{
163
158
  const selectOptions = [
164
159
  {
165
160
  value: true,
@@ -197,13 +192,13 @@ exports.EnumField = __webpack_exports__.EnumField;
197
192
  exports.LocateField = __webpack_exports__.LocateField;
198
193
  exports.NumberField = __webpack_exports__.NumberField;
199
194
  exports.TextField = __webpack_exports__.TextField;
200
- for(var __webpack_i__ in __webpack_exports__)if (-1 === [
195
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
201
196
  "BooleanField",
202
197
  "EnumField",
203
198
  "LocateField",
204
199
  "NumberField",
205
200
  "TextField"
206
- ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
201
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
207
202
  Object.defineProperty(exports, '__esModule', {
208
203
  value: true
209
204
  });
@@ -77,7 +77,12 @@
77
77
  border: none;
78
78
  }
79
79
 
80
- .history-modal-container .history-search-section .search-input-wrapper .search-input:hover, .history-modal-container .history-search-section .search-input-wrapper .search-input:focus-within {
80
+ .history-modal-container .history-search-section .search-input-wrapper .search-input:hover {
81
+ background: #fff;
82
+ border-color: #d9d9d9;
83
+ }
84
+
85
+ .history-modal-container .history-search-section .search-input-wrapper .search-input:focus-within {
81
86
  background: #fff;
82
87
  border-color: #d9d9d9;
83
88
  }
@@ -133,3 +138,35 @@
133
138
  padding: 40px 20px;
134
139
  }
135
140
 
141
+ [data-theme="dark"] .history-selector .history-timestamp, [data-theme="dark"] .history-selector .history-path {
142
+ color: rgba(255, 255, 255, .45);
143
+ }
144
+
145
+ [data-theme="dark"] .history-selector .history-description {
146
+ color: #f8fafd;
147
+ }
148
+
149
+ [data-theme="dark"] .history-selector .history-no-items {
150
+ color: rgba(255, 255, 255, .45);
151
+ }
152
+
153
+ [data-theme="dark"] .history-selector .history-item:hover {
154
+ background: rgba(255, 255, 255, .08);
155
+ }
156
+
157
+ [data-theme="dark"] .history-selector .history-item .history-clear-icon {
158
+ border-color: rgba(255, 255, 255, .12);
159
+ }
160
+
161
+ [data-theme="dark"] .history-selector .history-item .history-clear-icon:hover {
162
+ border-color: #40a9ff;
163
+ }
164
+
165
+ [data-theme="dark"] .history-selector .history-load-more {
166
+ color: #1890ff;
167
+ }
168
+
169
+ [data-theme="dark"] .history-selector .history-load-more:hover {
170
+ color: #40a9ff;
171
+ }
172
+
@@ -47,8 +47,7 @@ var magnifying_glass_js_default = /*#__PURE__*/ __webpack_require__.n(magnifying
47
47
  const external_store_history_js_namespaceObject = require("../../store/history.js");
48
48
  require("./index.css");
49
49
  const { Text } = external_antd_namespaceObject.Typography;
50
- const HistorySelector = (param)=>{
51
- let { onSelect, history, currentType } = param;
50
+ const HistorySelector = ({ onSelect, history, currentType })=>{
52
51
  const [isModalOpen, setIsModalOpen] = (0, external_react_namespaceObject.useState)(false);
53
52
  const [searchText, setSearchText] = (0, external_react_namespaceObject.useState)('');
54
53
  const clearHistory = (0, external_store_history_js_namespaceObject.useHistoryStore)((state)=>state.clearHistory);
@@ -208,9 +207,9 @@ const HistorySelector = (param)=>{
208
207
  });
209
208
  };
210
209
  exports.HistorySelector = __webpack_exports__.HistorySelector;
211
- for(var __webpack_i__ in __webpack_exports__)if (-1 === [
210
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
212
211
  "HistorySelector"
213
- ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
212
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
214
213
  Object.defineProperty(exports, '__esModule', {
215
214
  value: true
216
215
  });