@midscene/visualizer 1.7.4 → 1.7.5-beta-20260420031652.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 (35) hide show
  1. package/dist/es/component/config-selector/index.mjs +2 -2
  2. package/dist/es/component/history-selector/index.css +83 -16
  3. package/dist/es/component/history-selector/index.mjs +2 -2
  4. package/dist/es/component/playground/index.css +193 -1
  5. package/dist/es/component/playground-result/index.css +28 -0
  6. package/dist/es/component/playground-result/index.mjs +39 -54
  7. package/dist/es/component/prompt-input/index.css +165 -1
  8. package/dist/es/component/prompt-input/index.mjs +305 -130
  9. package/dist/es/component/universal-playground/index.css +47 -15
  10. package/dist/es/component/universal-playground/index.mjs +162 -102
  11. package/dist/es/utils/action-label.mjs +14 -0
  12. package/dist/es/utils/playground-utils.mjs +1 -9
  13. package/dist/es/utils/prompt-input-utils.mjs +45 -0
  14. package/dist/lib/component/config-selector/index.js +2 -2
  15. package/dist/lib/component/history-selector/index.css +83 -16
  16. package/dist/lib/component/history-selector/index.js +2 -2
  17. package/dist/lib/component/playground/index.css +193 -1
  18. package/dist/lib/component/playground-result/index.css +28 -0
  19. package/dist/lib/component/playground-result/index.js +39 -54
  20. package/dist/lib/component/prompt-input/index.css +165 -1
  21. package/dist/lib/component/prompt-input/index.js +307 -130
  22. package/dist/lib/component/universal-playground/index.css +47 -15
  23. package/dist/lib/component/universal-playground/index.js +161 -101
  24. package/dist/lib/utils/action-label.js +51 -0
  25. package/dist/lib/utils/playground-utils.js +2 -10
  26. package/dist/lib/utils/prompt-input-utils.js +82 -0
  27. package/dist/types/component/config-selector/index.d.ts +2 -0
  28. package/dist/types/component/history-selector/index.d.ts +2 -0
  29. package/dist/types/component/prompt-input/index.d.ts +2 -1
  30. package/dist/types/index.d.ts +1 -1
  31. package/dist/types/types.d.ts +50 -0
  32. package/dist/types/utils/action-label.d.ts +11 -0
  33. package/dist/types/utils/playground-utils.d.ts +6 -1
  34. package/dist/types/utils/prompt-input-utils.d.ts +24 -0
  35. package/package.json +5 -5
@@ -1,5 +1,5 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import icons, { ArrowDownOutlined, ClearOutlined, LoadingOutlined } from "@ant-design/icons";
2
+ import icons, { ArrowDownOutlined, ClearOutlined, LoadingOutlined, UpOutlined } from "@ant-design/icons";
3
3
  import { Alert, Button, Form, List, Typography, message } from "antd";
4
4
  import { useCallback, useEffect, useMemo, useState } from "react";
5
5
  import { usePlaygroundExecution } from "../../hooks/usePlaygroundExecution.mjs";
@@ -137,7 +137,8 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
137
137
  ]);
138
138
  const configAlreadySet = Object.keys(config || {}).length >= 1;
139
139
  const runButtonEnabled = componentConfig.serverMode || !dryMode && !actionSpaceLoading && configAlreadySet;
140
- const selectedType = Form.useWatch('type', form);
140
+ const watchedType = Form.useWatch('type', form);
141
+ const selectedType = watchedType || form.getFieldValue('type');
141
142
  const serviceMode = useMemo(()=>{
142
143
  if (!playgroundSDK || 'function' != typeof playgroundSDK.getServiceMode) return 'Server';
143
144
  return playgroundSDK.getServiceMode();
@@ -148,6 +149,49 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
148
149
  const layout = componentConfig.layout || 'vertical';
149
150
  const showVersionInfo = false !== componentConfig.showVersionInfo;
150
151
  const deviceType = componentConfig.deviceType;
152
+ const collapsibleProgressGroup = true === componentConfig.collapsibleProgressGroup;
153
+ var _componentConfig_progressGroupLabel;
154
+ const progressGroupLabel = null != (_componentConfig_progressGroupLabel = componentConfig.progressGroupLabel) ? _componentConfig_progressGroupLabel : 'Execution Flow';
155
+ const [collapsedProgressGroups, setCollapsedProgressGroups] = useState(()=>new Set());
156
+ const toggleProgressGroup = useCallback((groupId)=>{
157
+ setCollapsedProgressGroups((prev)=>{
158
+ const next = new Set(prev);
159
+ if (next.has(groupId)) next.delete(groupId);
160
+ else next.add(groupId);
161
+ return next;
162
+ });
163
+ }, []);
164
+ const { firstInProgressGroup, visibleInfoList } = useMemo(()=>{
165
+ const firstIds = new Set();
166
+ const visible = [];
167
+ let currentGroupFirstId = null;
168
+ for (const item of infoList)if ('progress' === item.type) {
169
+ if (null === currentGroupFirstId) {
170
+ currentGroupFirstId = item.id;
171
+ firstIds.add(item.id);
172
+ visible.push(item);
173
+ continue;
174
+ }
175
+ if (!collapsibleProgressGroup || !collapsedProgressGroups.has(currentGroupFirstId)) visible.push(item);
176
+ } else {
177
+ currentGroupFirstId = null;
178
+ visible.push(item);
179
+ }
180
+ return {
181
+ firstInProgressGroup: firstIds,
182
+ visibleInfoList: visible
183
+ };
184
+ }, [
185
+ collapsedProgressGroups,
186
+ collapsibleProgressGroup,
187
+ infoList
188
+ ]);
189
+ const latestProgressId = useMemo(()=>{
190
+ for(let i = infoList.length - 1; i >= 0; i--)if ('progress' === infoList[i].type) return infoList[i].id;
191
+ return null;
192
+ }, [
193
+ infoList
194
+ ]);
151
195
  return /*#__PURE__*/ jsx("div", {
152
196
  className: `playground-container ${layout}-mode ${className}`.trim(),
153
197
  children: /*#__PURE__*/ jsxs(Form, {
@@ -166,7 +210,7 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
166
210
  /*#__PURE__*/ jsxs("div", {
167
211
  className: "middle-dialog-area",
168
212
  children: [
169
- infoList.length > 1 && /*#__PURE__*/ jsx("div", {
213
+ false !== componentConfig.showClearButton && infoList.length > 1 && /*#__PURE__*/ jsx("div", {
170
214
  className: "clear-button-container",
171
215
  children: /*#__PURE__*/ jsx(Button, {
172
216
  size: "small",
@@ -181,115 +225,130 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
181
225
  className: "info-list-container",
182
226
  children: /*#__PURE__*/ jsx(List, {
183
227
  itemLayout: "vertical",
184
- dataSource: infoList,
185
- renderItem: (item)=>/*#__PURE__*/ jsx(List.Item, {
228
+ dataSource: visibleInfoList,
229
+ renderItem: (item)=>/*#__PURE__*/ jsxs(List.Item, {
186
230
  className: "list-item",
187
- children: 'user' === item.type ? /*#__PURE__*/ jsx("div", {
188
- className: "user-message-container",
189
- children: /*#__PURE__*/ jsx("div", {
190
- className: "user-message-bubble",
191
- children: item.content
192
- })
193
- }) : 'progress' === item.type ? /*#__PURE__*/ jsx("div", {
194
- children: (()=>{
195
- var _parts_, _item_result, _item_result1, _item_result2;
196
- const parts = item.content.split(' - ');
197
- const action = null == (_parts_ = parts[0]) ? void 0 : _parts_.trim();
198
- const description = parts.slice(1).join(' - ').trim();
199
- const currentIndex = infoList.findIndex((listItem)=>listItem.id === item.id);
200
- const laterProgressExists = infoList.slice(currentIndex + 1).some((listItem)=>'progress' === listItem.type);
201
- const isLatestProgress = !laterProgressExists;
202
- const shouldShowLoading = loading && isLatestProgress;
203
- return /*#__PURE__*/ jsxs(Fragment, {
204
- children: [
205
- action && /*#__PURE__*/ jsxs("span", {
206
- className: "progress-action-item",
207
- children: [
208
- action,
209
- /*#__PURE__*/ jsx("span", {
210
- className: `progress-status-icon ${shouldShowLoading ? 'loading' : (null == (_item_result = item.result) ? void 0 : _item_result.error) ? 'error' : 'completed'}`,
211
- children: shouldShowLoading ? /*#__PURE__*/ jsx(LoadingOutlined, {
212
- spin: true
213
- }) : (null == (_item_result1 = item.result) ? void 0 : _item_result1.error) ? '✗' : '✓'
231
+ children: [
232
+ collapsibleProgressGroup && firstInProgressGroup.has(item.id) ? /*#__PURE__*/ jsxs("button", {
233
+ type: "button",
234
+ className: `progress-group-toggle ${collapsedProgressGroups.has(item.id) ? 'is-collapsed' : 'is-expanded'}`,
235
+ "aria-expanded": !collapsedProgressGroups.has(item.id),
236
+ onClick: ()=>toggleProgressGroup(item.id),
237
+ children: [
238
+ /*#__PURE__*/ jsx("span", {
239
+ className: "progress-group-toggle-label",
240
+ children: progressGroupLabel
241
+ }),
242
+ /*#__PURE__*/ jsx(UpOutlined, {
243
+ className: "progress-group-toggle-chevron"
244
+ })
245
+ ]
246
+ }) : null,
247
+ 'user' === item.type ? /*#__PURE__*/ jsx("div", {
248
+ className: "user-message-container",
249
+ children: /*#__PURE__*/ jsx("div", {
250
+ className: "user-message-bubble",
251
+ children: item.content
252
+ })
253
+ }) : 'progress' === item.type ? /*#__PURE__*/ jsx("div", {
254
+ children: (()=>{
255
+ var _parts_, _item_result, _item_result1, _item_result2;
256
+ const parts = item.content.split(' - ');
257
+ const action = null == (_parts_ = parts[0]) ? void 0 : _parts_.trim();
258
+ const description = parts.slice(1).join(' - ').trim();
259
+ const isLatestProgress = item.id === latestProgressId;
260
+ const shouldShowLoading = loading && isLatestProgress;
261
+ return /*#__PURE__*/ jsxs(Fragment, {
262
+ children: [
263
+ action && /*#__PURE__*/ jsxs("span", {
264
+ className: "progress-action-item",
265
+ children: [
266
+ action,
267
+ /*#__PURE__*/ jsx("span", {
268
+ className: `progress-status-icon ${shouldShowLoading ? 'loading' : (null == (_item_result = item.result) ? void 0 : _item_result.error) ? 'error' : 'completed'}`,
269
+ children: shouldShowLoading ? /*#__PURE__*/ jsx(LoadingOutlined, {
270
+ spin: true
271
+ }) : (null == (_item_result1 = item.result) ? void 0 : _item_result1.error) ? '✗' : '✓'
272
+ })
273
+ ]
274
+ }),
275
+ description && /*#__PURE__*/ jsx("div", {
276
+ children: /*#__PURE__*/ jsx(shiny_text, {
277
+ text: description,
278
+ className: "progress-description",
279
+ disabled: !shouldShowLoading
214
280
  })
215
- ]
216
- }),
217
- description && /*#__PURE__*/ jsx("div", {
218
- children: /*#__PURE__*/ jsx(shiny_text, {
219
- text: description,
220
- className: "progress-description",
221
- disabled: !shouldShowLoading
281
+ }),
282
+ (null == (_item_result2 = item.result) ? void 0 : _item_result2.error) && /*#__PURE__*/ jsx(ErrorMessage, {
283
+ error: item.result.error
222
284
  })
223
- }),
224
- (null == (_item_result2 = item.result) ? void 0 : _item_result2.error) && /*#__PURE__*/ jsx(ErrorMessage, {
225
- error: item.result.error
285
+ ]
286
+ });
287
+ })()
288
+ }) : 'separator' === item.type ? /*#__PURE__*/ jsxs("div", {
289
+ className: "new-conversation-separator",
290
+ children: [
291
+ /*#__PURE__*/ jsx("div", {
292
+ className: "separator-line"
293
+ }),
294
+ /*#__PURE__*/ jsx("div", {
295
+ className: "separator-text-container",
296
+ children: /*#__PURE__*/ jsx(Text, {
297
+ type: "secondary",
298
+ className: "separator-text",
299
+ children: item.content
226
300
  })
227
- ]
228
- });
229
- })()
230
- }) : 'separator' === item.type ? /*#__PURE__*/ jsxs("div", {
231
- className: "new-conversation-separator",
232
- children: [
233
- /*#__PURE__*/ jsx("div", {
234
- className: "separator-line"
235
- }),
236
- /*#__PURE__*/ jsx("div", {
237
- className: "separator-text-container",
238
- children: /*#__PURE__*/ jsx(Text, {
239
- type: "secondary",
240
- className: "separator-text",
241
- children: item.content
242
301
  })
243
- })
244
- ]
245
- }) : /*#__PURE__*/ jsxs("div", {
246
- className: "system-message-container",
247
- children: [
248
- /*#__PURE__*/ jsxs("div", {
249
- className: "system-message-header",
250
- children: [
251
- /*#__PURE__*/ jsx(icons, {
252
- component: branding.icon || avatar,
253
- style: {
254
- fontSize: 20
255
- }
256
- }),
257
- /*#__PURE__*/ jsx("span", {
258
- className: "system-message-title",
259
- children: branding.title || 'Playground'
260
- })
261
- ]
262
- }),
263
- (item.content || item.result) && /*#__PURE__*/ jsx("div", {
264
- className: "system-message-content",
265
- children: 'result' === item.type ? /*#__PURE__*/ jsx(PlaygroundResultView, {
266
- result: item.result || null,
267
- loading: item.loading || false,
268
- serverValid: true,
269
- serviceMode: serviceMode,
270
- replayScriptsInfo: item.replayScriptsInfo || null,
271
- replayCounter: item.replayCounter || 0,
272
- loadingProgressText: item.loadingProgressText || '',
273
- verticalMode: item.verticalMode || false,
274
- fitMode: "width",
275
- actionType: item.actionType
276
- }) : /*#__PURE__*/ jsxs(Fragment, {
302
+ ]
303
+ }) : /*#__PURE__*/ jsxs("div", {
304
+ className: "system-message-container",
305
+ children: [
306
+ false !== componentConfig.showSystemMessageHeader && /*#__PURE__*/ jsxs("div", {
307
+ className: "system-message-header",
277
308
  children: [
278
- /*#__PURE__*/ jsx("div", {
279
- className: "system-message-text",
280
- children: item.content
309
+ /*#__PURE__*/ jsx(icons, {
310
+ component: branding.icon || avatar,
311
+ style: {
312
+ fontSize: 20
313
+ }
281
314
  }),
282
- item.loading && item.loadingProgressText && /*#__PURE__*/ jsx("div", {
283
- className: "loading-progress-text",
284
- children: /*#__PURE__*/ jsx("span", {
285
- children: item.loadingProgressText
286
- })
315
+ /*#__PURE__*/ jsx("span", {
316
+ className: "system-message-title",
317
+ children: branding.title || 'Playground'
287
318
  })
288
319
  ]
320
+ }),
321
+ (item.content || item.result) && /*#__PURE__*/ jsx("div", {
322
+ className: "system-message-content",
323
+ children: 'result' === item.type ? /*#__PURE__*/ jsx(PlaygroundResultView, {
324
+ result: item.result || null,
325
+ loading: item.loading || false,
326
+ serverValid: true,
327
+ serviceMode: serviceMode,
328
+ replayScriptsInfo: item.replayScriptsInfo || null,
329
+ replayCounter: item.replayCounter || 0,
330
+ loadingProgressText: item.loadingProgressText || '',
331
+ verticalMode: item.verticalMode || false,
332
+ fitMode: "width",
333
+ actionType: item.actionType
334
+ }) : /*#__PURE__*/ jsxs(Fragment, {
335
+ children: [
336
+ /*#__PURE__*/ jsx("div", {
337
+ className: "system-message-text",
338
+ children: item.content
339
+ }),
340
+ item.loading && item.loadingProgressText && /*#__PURE__*/ jsx("div", {
341
+ className: "loading-progress-text",
342
+ children: /*#__PURE__*/ jsx("span", {
343
+ children: item.loadingProgressText
344
+ })
345
+ })
346
+ ]
347
+ })
289
348
  })
290
- })
291
- ]
292
- })
349
+ ]
350
+ })
351
+ ]
293
352
  }, item.id)
294
353
  })
295
354
  }),
@@ -318,6 +377,7 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
318
377
  onRun: handleFormRun,
319
378
  onStop: handleStop,
320
379
  actionSpace: actionSpace,
380
+ chrome: componentConfig.promptInputChrome,
321
381
  deviceType: deviceType
322
382
  })
323
383
  ]
@@ -0,0 +1,14 @@
1
+ const actionNameForType = (type)=>{
2
+ if (!type) return '';
3
+ const typeWithoutAi = type.startsWith('ai') ? type.slice(2) : type;
4
+ if (typeWithoutAi.startsWith('IOS')) return typeWithoutAi.substring(3).replace(/([A-Z])/g, ' $1').replace(/^/, 'IOS').trim();
5
+ const fullName = typeWithoutAi.replace(/([A-Z])/g, ' $1').trim();
6
+ const words = fullName.split(' ');
7
+ const result = words.length > 3 ? words.slice(-3).join(' ') : fullName;
8
+ return result.replace(/\b\w/g, (c)=>c.toUpperCase());
9
+ };
10
+ const getPromptInputActionLabel = (type, overrideLabel)=>{
11
+ if (overrideLabel) return overrideLabel;
12
+ return actionNameForType(type) || 'Action';
13
+ };
14
+ export { actionNameForType, getPromptInputActionLabel };
@@ -1,14 +1,6 @@
1
1
  import { StaticPage, StaticPageAgent } from "@midscene/web/static";
2
2
  import { isZodObjectSchema, unwrapZodType } from "../types.mjs";
3
- const actionNameForType = (type)=>{
4
- if (!type) return '';
5
- const typeWithoutAi = type.startsWith('ai') ? type.slice(2) : type;
6
- if (typeWithoutAi.startsWith('IOS')) return typeWithoutAi.substring(3).replace(/([A-Z])/g, ' $1').replace(/^/, 'IOS').trim();
7
- const fullName = typeWithoutAi.replace(/([A-Z])/g, ' $1').trim();
8
- const words = fullName.split(' ');
9
- const result = words.length > 3 ? words.slice(-3).join(' ') : fullName;
10
- return result.replace(/\b\w/g, (c)=>c.toUpperCase());
11
- };
3
+ import { actionNameForType } from "./action-label.mjs";
12
4
  const staticAgentFromContext = (context)=>{
13
5
  const page = new StaticPage(context);
14
6
  return new StaticPageAgent(page);
@@ -0,0 +1,45 @@
1
+ import { isLocateField, isZodObjectSchema, unwrapZodType } from "../types.mjs";
2
+ import { apiMetadata } from "./constants.mjs";
3
+ const getAvailablePromptActionTypes = (actionSpace)=>{
4
+ const metadataMethods = Object.keys(apiMetadata);
5
+ if (!(null == actionSpace ? void 0 : actionSpace.length)) return metadataMethods;
6
+ const availableMethods = actionSpace.map((action)=>action.interfaceAlias || action.name);
7
+ const supportsAiAct = availableMethods.includes('aiAct');
8
+ const finalMethods = new Set();
9
+ metadataMethods.forEach((method)=>{
10
+ const methodInfo = apiMetadata[method];
11
+ if ('aiAct' === method) {
12
+ if (supportsAiAct) finalMethods.add(method);
13
+ return;
14
+ }
15
+ if ((null == methodInfo ? void 0 : methodInfo.group) === 'extraction' || (null == methodInfo ? void 0 : methodInfo.group) === 'validation') return void finalMethods.add(method);
16
+ if (availableMethods.includes(method)) finalMethods.add(method);
17
+ });
18
+ availableMethods.forEach((method)=>{
19
+ finalMethods.add(method);
20
+ });
21
+ return Array.from(finalMethods);
22
+ };
23
+ const getInlineStructuredFieldConfig = (actionSpace, selectedType)=>{
24
+ var _actualField__def, _actualField__def1;
25
+ if (!(null == actionSpace ? void 0 : actionSpace.length) || !selectedType) return null;
26
+ const action = actionSpace.find((item)=>item.interfaceAlias === selectedType || item.name === selectedType);
27
+ if (!(null == action ? void 0 : action.paramSchema) || !isZodObjectSchema(action.paramSchema)) return null;
28
+ const schema = action.paramSchema;
29
+ const shape = schema.shape || {};
30
+ const keys = Object.keys(shape);
31
+ if (1 !== keys.length) return null;
32
+ const [name] = keys;
33
+ const field = shape[name];
34
+ const { actualField } = unwrapZodType(field);
35
+ const isLocate = isLocateField(actualField);
36
+ const fieldType = null == (_actualField__def = actualField._def) ? void 0 : _actualField__def.typeName;
37
+ const isInlineField = 'ZodString' === fieldType || isLocate;
38
+ if (!isInlineField) return null;
39
+ const placeholder = (null == (_actualField__def1 = actualField._def) ? void 0 : _actualField__def1.description) || actualField.description || (isLocate ? 'Describe the element you want to interact with' : `Enter ${name}`);
40
+ return {
41
+ name,
42
+ placeholder
43
+ };
44
+ };
45
+ export { getAvailablePromptActionTypes, getInlineStructuredFieldConfig };
@@ -42,7 +42,7 @@ var setting_js_default = /*#__PURE__*/ __webpack_require__.n(setting_js_namespac
42
42
  const store_js_namespaceObject = require("../../store/store.js");
43
43
  const constants_js_namespaceObject = require("../../utils/constants.js");
44
44
  const device_capabilities_js_namespaceObject = require("../../utils/device-capabilities.js");
45
- const ConfigSelector = ({ showDeepLocateOption = false, showDeepThinkOption = false, enableTracking = false, showDataExtractionOptions = false, hideDomAndScreenshotOptions = false, deviceType })=>{
45
+ const ConfigSelector = ({ showDeepLocateOption = false, showDeepThinkOption = false, enableTracking = false, showDataExtractionOptions = false, hideDomAndScreenshotOptions = false, deviceType, trigger })=>{
46
46
  const forceSameTabNavigation = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.forceSameTabNavigation);
47
47
  const setForceSameTabNavigation = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.setForceSameTabNavigation);
48
48
  const deepLocate = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.deepLocate);
@@ -74,7 +74,7 @@ const ConfigSelector = ({ showDeepLocateOption = false, showDeepThinkOption = fa
74
74
  trigger: [
75
75
  'click'
76
76
  ],
77
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(setting_js_default(), {
77
+ children: null != trigger ? trigger : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(setting_js_default(), {
78
78
  width: 24,
79
79
  height: 24
80
80
  })
@@ -138,35 +138,102 @@
138
138
  padding: 40px 20px;
139
139
  }
140
140
 
141
- [data-theme="dark"] .history-selector .history-timestamp, [data-theme="dark"] .history-selector .history-path {
142
- color: rgba(255, 255, 255, .45);
141
+ [data-theme="dark"] .history-modal-overlay {
142
+ background: #16181d !important;
143
+ border-color: rgba(255, 255, 255, .12) !important;
144
+ box-shadow: 0 16px 40px rgba(0, 0, 0, .45) !important;
143
145
  }
144
146
 
145
- [data-theme="dark"] .history-selector .history-description {
146
- color: #f8fafd;
147
+ [data-theme="dark"] .history-modal-container {
148
+ background: #16181d !important;
147
149
  }
148
150
 
149
- [data-theme="dark"] .history-selector .history-no-items {
150
- color: rgba(255, 255, 255, .45);
151
+ [data-theme="dark"] .history-modal-container .history-modal-header .ant-typography {
152
+ color: rgba(255, 255, 255, .92) !important;
151
153
  }
152
154
 
153
- [data-theme="dark"] .history-selector .history-item:hover {
154
- background: rgba(255, 255, 255, .08);
155
+ [data-theme="dark"] .history-modal-container .history-modal-header .close-button .anticon {
156
+ color: rgba(255, 255, 255, .48);
155
157
  }
156
158
 
157
- [data-theme="dark"] .history-selector .history-item .history-clear-icon {
158
- border-color: rgba(255, 255, 255, .12);
159
+ [data-theme="dark"] .history-modal-container .history-modal-header .close-button:hover .anticon {
160
+ color: rgba(255, 255, 255, .78);
159
161
  }
160
162
 
161
- [data-theme="dark"] .history-selector .history-item .history-clear-icon:hover {
162
- border-color: #40a9ff;
163
+ [data-theme="dark"] .history-modal-container .history-search-section {
164
+ background: #16181d !important;
163
165
  }
164
166
 
165
- [data-theme="dark"] .history-selector .history-load-more {
166
- color: #1890ff;
167
+ [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper {
168
+ color: rgba(255, 255, 255, .38);
167
169
  }
168
170
 
169
- [data-theme="dark"] .history-selector .history-load-more:hover {
170
- color: #40a9ff;
171
+ [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input, [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input.ant-input-affix-wrapper {
172
+ box-shadow: none !important;
173
+ background: rgba(255, 255, 255, .08) !important;
174
+ border-color: rgba(255, 255, 255, .12) !important;
175
+ }
176
+
177
+ [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input .ant-input, [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input.ant-input-affix-wrapper .ant-input, [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input .ant-input-prefix, [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input.ant-input-affix-wrapper .ant-input-prefix, [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input .ant-input-clear-icon, [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input.ant-input-affix-wrapper .ant-input-clear-icon {
178
+ color: rgba(255, 255, 255, .72) !important;
179
+ }
180
+
181
+ [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input .ant-input, [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input.ant-input-affix-wrapper .ant-input {
182
+ background: none !important;
183
+ }
184
+
185
+ [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input .ant-input::-webkit-input-placeholder {
186
+ color: rgba(255, 255, 255, .38) !important;
187
+ }
188
+
189
+ [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input .ant-input::placeholder {
190
+ color: rgba(255, 255, 255, .38) !important;
191
+ }
192
+
193
+ [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input.ant-input-affix-wrapper .ant-input::-webkit-input-placeholder {
194
+ color: rgba(255, 255, 255, .38) !important;
195
+ }
196
+
197
+ [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input.ant-input-affix-wrapper .ant-input::placeholder {
198
+ color: rgba(255, 255, 255, .38) !important;
199
+ }
200
+
201
+ [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input:hover, [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input.ant-input-affix-wrapper:hover {
202
+ background: rgba(255, 255, 255, .12) !important;
203
+ border-color: rgba(255, 255, 255, .16) !important;
204
+ }
205
+
206
+ [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input:focus-within {
207
+ background: rgba(255, 255, 255, .12) !important;
208
+ border-color: rgba(255, 255, 255, .16) !important;
209
+ }
210
+
211
+ [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input.ant-input-affix-wrapper:focus-within {
212
+ background: rgba(255, 255, 255, .12) !important;
213
+ border-color: rgba(255, 255, 255, .16) !important;
214
+ }
215
+
216
+ [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .clear-button {
217
+ color: #77b7ff !important;
218
+ }
219
+
220
+ [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .clear-button:hover {
221
+ color: #9cccff !important;
222
+ }
223
+
224
+ [data-theme="dark"] .history-modal-container .history-content .history-group .history-group-title {
225
+ color: rgba(255, 255, 255, .45) !important;
226
+ }
227
+
228
+ [data-theme="dark"] .history-modal-container .history-content .history-group .history-item {
229
+ color: rgba(255, 255, 255, .88) !important;
230
+ }
231
+
232
+ [data-theme="dark"] .history-modal-container .history-content .history-group .history-item:hover {
233
+ background: rgba(255, 255, 255, .08) !important;
234
+ }
235
+
236
+ [data-theme="dark"] .history-modal-container .history-content .no-results, [data-theme="dark"] .history-modal-container .history-content .ant-typography.ant-typography-secondary {
237
+ color: rgba(255, 255, 255, .45) !important;
171
238
  }
172
239
 
@@ -47,7 +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 = ({ onSelect, history, currentType })=>{
50
+ const HistorySelector = ({ onSelect, history, currentType, trigger })=>{
51
51
  const [isModalOpen, setIsModalOpen] = (0, external_react_namespaceObject.useState)(false);
52
52
  const [searchText, setSearchText] = (0, external_react_namespaceObject.useState)('');
53
53
  const clearHistory = (0, external_store_history_js_namespaceObject.useHistoryStore)((state)=>state.clearHistory);
@@ -114,7 +114,7 @@ const HistorySelector = ({ onSelect, history, currentType })=>{
114
114
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
115
115
  className: "selector-trigger",
116
116
  onClick: ()=>setIsModalOpen(true),
117
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(history_js_default(), {
117
+ children: null != trigger ? trigger : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(history_js_default(), {
118
118
  width: 24,
119
119
  height: 24
120
120
  })