@midscene/visualizer 0.28.1-beta-20250909063633.0 → 0.28.2-beta-20250909133629.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 (133) hide show
  1. package/dist/es/browser.mjs +18 -0
  2. package/dist/es/component/{blackboard.mjs → blackboard/index.mjs} +3 -3
  3. package/dist/es/component/{playground/ConfigSelector.mjs → config-selector/index.mjs} +2 -3
  4. package/dist/es/component/{playground/ContextPreview.mjs → context-preview/index.mjs} +3 -4
  5. package/dist/es/component/{env-config.mjs → env-config/index.mjs} +1 -1
  6. package/dist/es/component/{github-star.mjs → github-star/index.mjs} +1 -1
  7. package/dist/es/component/history-selector/index.css +132 -0
  8. package/dist/es/component/{playground/HistorySelector.mjs → history-selector/index.mjs} +1 -1
  9. package/dist/es/component/index.mjs +1 -0
  10. package/dist/es/component/{logo.mjs → logo/index.mjs} +1 -1
  11. package/dist/es/component/{misc.mjs → misc/index.mjs} +42 -2
  12. package/dist/es/component/{player.mjs → player/index.mjs} +8 -8
  13. package/dist/es/component/playground/index.css +29 -161
  14. package/dist/es/component/playground/index.mjs +8 -0
  15. package/dist/es/component/playground-result/index.css +29 -0
  16. package/dist/es/component/{playground/PlaygroundResult.mjs → playground-result/index.mjs} +3 -4
  17. package/dist/es/component/prompt-input/index.css +330 -0
  18. package/dist/es/component/{playground/PromptInput.mjs → prompt-input/index.mjs} +9 -9
  19. package/dist/es/component/{playground/ServiceModeControl.mjs → service-mode-control/index.mjs} +4 -5
  20. package/dist/es/component/{shiny-text.mjs → shiny-text/index.mjs} +1 -1
  21. package/dist/es/component/universal-playground/index.css +341 -0
  22. package/dist/es/component/universal-playground/index.mjs +273 -0
  23. package/dist/es/component/universal-playground/providers/context-provider.mjs +52 -0
  24. package/dist/es/component/universal-playground/providers/storage-provider.mjs +107 -0
  25. package/dist/es/hooks/usePlaygroundExecution.mjs +170 -0
  26. package/dist/es/hooks/usePlaygroundState.mjs +173 -0
  27. package/dist/es/icons/avatar.mjs +14 -0
  28. package/dist/es/index.mjs +22 -18
  29. package/dist/es/{component/playground/types.mjs → types.mjs} +23 -1
  30. package/dist/es/{component/playground/playground-constants.mjs → utils/constants.mjs} +1 -2
  31. package/dist/es/{component/playground → utils}/playground-utils.mjs +1 -1
  32. package/dist/es/{component → utils}/replay-scripts.mjs +1 -2
  33. package/dist/lib/browser.js +132 -0
  34. package/dist/lib/component/{blackboard.js → blackboard/index.js} +5 -5
  35. package/dist/lib/component/{playground/ConfigSelector.js → config-selector/index.js} +6 -7
  36. package/dist/lib/component/{playground/ContextPreview.js → context-preview/index.js} +8 -9
  37. package/dist/lib/component/{env-config.js → env-config/index.js} +1 -1
  38. package/dist/lib/component/{github-star.js → github-star/index.js} +1 -1
  39. package/dist/lib/component/history-selector/index.css +132 -0
  40. package/dist/lib/component/{playground/HistorySelector.js → history-selector/index.js} +1 -1
  41. package/dist/lib/component/index.js +60 -0
  42. package/dist/lib/component/{logo.js → logo/index.js} +1 -1
  43. package/dist/lib/component/{misc.js → misc/index.js} +60 -1
  44. package/dist/lib/component/{player.js → player/index.js} +23 -23
  45. package/dist/lib/component/playground/index.css +29 -161
  46. package/dist/lib/component/playground/index.js +113 -0
  47. package/dist/lib/component/playground-result/index.css +29 -0
  48. package/dist/lib/component/{playground/PlaygroundResult.js → playground-result/index.js} +8 -9
  49. package/dist/lib/component/prompt-input/index.css +330 -0
  50. package/dist/lib/component/{playground/PromptInput.js → prompt-input/index.js} +37 -37
  51. package/dist/lib/component/{playground/ServiceModeControl.js → service-mode-control/index.js} +8 -9
  52. package/dist/lib/component/{shiny-text.js → shiny-text/index.js} +1 -1
  53. package/dist/lib/component/universal-playground/index.css +341 -0
  54. package/dist/lib/component/universal-playground/index.js +321 -0
  55. package/dist/lib/component/universal-playground/providers/context-provider.js +95 -0
  56. package/dist/lib/component/universal-playground/providers/storage-provider.js +147 -0
  57. package/dist/lib/hooks/usePlaygroundExecution.js +204 -0
  58. package/dist/lib/hooks/usePlaygroundState.js +207 -0
  59. package/dist/lib/{init.js → icons/avatar.js} +16 -12
  60. package/dist/lib/index.js +66 -34
  61. package/dist/lib/{component/playground/types.js → types.js} +28 -0
  62. package/dist/lib/{component/playground/playground-constants.js → utils/constants.js} +3 -4
  63. package/dist/lib/{component/playground → utils}/playground-utils.js +1 -1
  64. package/dist/lib/{component → utils}/replay-scripts.js +3 -4
  65. package/dist/types/browser.d.ts +19 -0
  66. package/dist/types/component/{blackboard.d.ts → blackboard/index.d.ts} +2 -2
  67. package/dist/types/component/{playground/ConfigSelector.d.ts → config-selector/index.d.ts} +0 -1
  68. package/dist/types/component/{playground/ContextPreview.d.ts → context-preview/index.d.ts} +0 -1
  69. package/dist/types/component/{github-star.d.ts → github-star/index.d.ts} +1 -1
  70. package/dist/types/component/{playground/HistorySelector.d.ts → history-selector/index.d.ts} +1 -1
  71. package/dist/types/component/index.d.ts +1 -0
  72. package/dist/types/component/{logo.d.ts → logo/index.d.ts} +1 -1
  73. package/dist/types/component/misc/index.d.ts +6 -0
  74. package/dist/types/component/{player.d.ts → player/index.d.ts} +2 -2
  75. package/dist/types/component/playground/index.d.ts +7 -0
  76. package/dist/types/component/{playground/PlaygroundResult.d.ts → playground-result/index.d.ts} +3 -4
  77. package/dist/types/component/{playground/PromptInput.d.ts → prompt-input/index.d.ts} +3 -2
  78. package/dist/types/component/{playground/ServiceModeControl.d.ts → service-mode-control/index.d.ts} +0 -1
  79. package/dist/types/component/{shiny-text.d.ts → shiny-text/index.d.ts} +1 -1
  80. package/dist/types/component/universal-playground/index.d.ts +4 -0
  81. package/dist/types/component/universal-playground/providers/context-provider.d.ts +37 -0
  82. package/dist/types/component/universal-playground/providers/storage-provider.d.ts +33 -0
  83. package/dist/types/hooks/usePlaygroundExecution.d.ts +10 -0
  84. package/dist/types/hooks/usePlaygroundState.d.ts +26 -0
  85. package/dist/types/index.d.ts +15 -10
  86. package/dist/types/types.d.ts +166 -0
  87. package/dist/types/{component/playground/playground-constants.d.ts → utils/constants.d.ts} +0 -1
  88. package/dist/types/{component → utils}/replay-scripts.d.ts +0 -1
  89. package/package.json +10 -5
  90. package/dist/es/component/describer.css +0 -25
  91. package/dist/es/component/playground/playground-types.mjs +0 -0
  92. package/dist/es/init.mjs +0 -10
  93. package/dist/lib/component/describer.css +0 -25
  94. package/dist/lib/component/playground/playground-types.js +0 -18
  95. package/dist/types/component/misc.d.ts +0 -2
  96. package/dist/types/component/playground/playground-types.d.ts +0 -19
  97. package/dist/types/component/playground/types.d.ts +0 -72
  98. package/dist/types/init.d.ts +0 -1
  99. /package/dist/es/component/{blackboard.css → blackboard/index.css} +0 -0
  100. /package/dist/es/component/{playground/FormField.mjs → form-field/index.mjs} +0 -0
  101. /package/dist/es/component/{github-star.css → github-star/index.css} +0 -0
  102. /package/dist/es/component/{logo.css → logo/index.css} +0 -0
  103. /package/dist/es/component/{player.css → player/index.css} +0 -0
  104. /package/dist/es/component/{playground-demo-ui-context.json → playground/playground-demo-ui-context.json} +0 -0
  105. /package/dist/es/component/{shiny-text.css → shiny-text/index.css} +0 -0
  106. /package/dist/es/{component/playground → hooks}/useServerValid.mjs +0 -0
  107. /package/dist/es/{component/store → store}/history.mjs +0 -0
  108. /package/dist/es/{component/store → store}/store.mjs +0 -0
  109. /package/dist/es/{component → utils}/color.mjs +0 -0
  110. /package/dist/es/{utils.mjs → utils/index.mjs} +0 -0
  111. /package/dist/es/{component → utils}/pixi-loader.mjs +0 -0
  112. /package/dist/lib/component/{blackboard.css → blackboard/index.css} +0 -0
  113. /package/dist/lib/component/{playground/FormField.js → form-field/index.js} +0 -0
  114. /package/dist/lib/component/{github-star.css → github-star/index.css} +0 -0
  115. /package/dist/lib/component/{logo.css → logo/index.css} +0 -0
  116. /package/dist/lib/component/{player.css → player/index.css} +0 -0
  117. /package/dist/lib/component/{playground-demo-ui-context.json → playground/playground-demo-ui-context.json} +0 -0
  118. /package/dist/lib/component/{shiny-text.css → shiny-text/index.css} +0 -0
  119. /package/dist/lib/{component/playground → hooks}/useServerValid.js +0 -0
  120. /package/dist/lib/{component/store → store}/history.js +0 -0
  121. /package/dist/lib/{component/store → store}/store.js +0 -0
  122. /package/dist/lib/{component → utils}/color.js +0 -0
  123. /package/dist/lib/{utils.js → utils/index.js} +0 -0
  124. /package/dist/lib/{component → utils}/pixi-loader.js +0 -0
  125. /package/dist/types/component/{env-config.d.ts → env-config/index.d.ts} +0 -0
  126. /package/dist/types/component/{playground/FormField.d.ts → form-field/index.d.ts} +0 -0
  127. /package/dist/types/{component/playground → hooks}/useServerValid.d.ts +0 -0
  128. /package/dist/types/{component/store → store}/history.d.ts +0 -0
  129. /package/dist/types/{component/store → store}/store.d.ts +0 -0
  130. /package/dist/types/{component → utils}/color.d.ts +0 -0
  131. /package/dist/types/{utils.d.ts → utils/index.d.ts} +0 -0
  132. /package/dist/types/{component → utils}/pixi-loader.d.ts +0 -0
  133. /package/dist/types/{component/playground → utils}/playground-utils.d.ts +0 -0
@@ -40,20 +40,20 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
40
40
  require("pixi.js/unsafe-eval");
41
41
  const external_pixi_js_namespaceObject = require("pixi.js");
42
42
  const external_react_namespaceObject = require("react");
43
- require("./player.css");
44
- const external_utils_js_namespaceObject = require("../utils.js");
43
+ require("./index.css");
44
+ const index_js_namespaceObject = require("../../utils/index.js");
45
45
  const icons_namespaceObject = require("@ant-design/icons");
46
46
  const extractor_namespaceObject = require("@midscene/shared/extractor");
47
47
  const external_antd_namespaceObject = require("antd");
48
- const global_perspective_js_namespaceObject = require("../icons/global-perspective.js");
48
+ const global_perspective_js_namespaceObject = require("../../icons/global-perspective.js");
49
49
  var global_perspective_js_default = /*#__PURE__*/ __webpack_require__.n(global_perspective_js_namespaceObject);
50
- const player_setting_js_namespaceObject = require("../icons/player-setting.js");
50
+ const player_setting_js_namespaceObject = require("../../icons/player-setting.js");
51
51
  var player_setting_js_default = /*#__PURE__*/ __webpack_require__.n(player_setting_js_namespaceObject);
52
- const show_marker_js_namespaceObject = require("../icons/show-marker.js");
52
+ const show_marker_js_namespaceObject = require("../../icons/show-marker.js");
53
53
  var show_marker_js_default = /*#__PURE__*/ __webpack_require__.n(show_marker_js_namespaceObject);
54
- const external_blackboard_js_namespaceObject = require("./blackboard.js");
55
- const external_pixi_loader_js_namespaceObject = require("./pixi-loader.js");
56
- const store_js_namespaceObject = require("./store/store.js");
54
+ const store_js_namespaceObject = require("../../store/store.js");
55
+ const pixi_loader_js_namespaceObject = require("../../utils/pixi-loader.js");
56
+ const external_blackboard_index_js_namespaceObject = require("../blackboard/index.js");
57
57
  function _define_property(obj, key, value) {
58
58
  if (key in obj) Object.defineProperty(obj, key, {
59
59
  value: value,
@@ -215,11 +215,11 @@ function Player(props) {
215
215
  const repaintImage = async ()=>{
216
216
  const imgToUpdate = currentImg.current;
217
217
  if (!imgToUpdate) return void console.warn('no image to update');
218
- if (!(0, external_pixi_loader_js_namespaceObject.getTextureFromCache)(imgToUpdate)) {
218
+ if (!(0, pixi_loader_js_namespaceObject.getTextureFromCache)(imgToUpdate)) {
219
219
  console.warn('image not loaded', imgToUpdate);
220
- await (0, external_pixi_loader_js_namespaceObject.loadTexture)(imgToUpdate);
220
+ await (0, pixi_loader_js_namespaceObject.loadTexture)(imgToUpdate);
221
221
  }
222
- const texture = (0, external_pixi_loader_js_namespaceObject.getTextureFromCache)(imgToUpdate);
222
+ const texture = (0, pixi_loader_js_namespaceObject.getTextureFromCache)(imgToUpdate);
223
223
  if (!texture) throw new Error('texture not found');
224
224
  const sprite = external_pixi_js_namespaceObject.Sprite.from(texture);
225
225
  if (!sprite) throw new Error('sprite not found');
@@ -235,7 +235,7 @@ function Player(props) {
235
235
  const spinningPointer = (frame)=>{
236
236
  var _pointerSprite_current, _pointerSprite_current1;
237
237
  if (!spinningPointerSprite.current) {
238
- spinningPointerSprite.current = external_pixi_js_namespaceObject.Sprite.from(external_utils_js_namespaceObject.mouseLoading);
238
+ spinningPointerSprite.current = external_pixi_js_namespaceObject.Sprite.from(index_js_namespaceObject.mouseLoading);
239
239
  spinningPointerSprite.current.zIndex = LAYER_ORDER_SPINNING_POINTER;
240
240
  spinningPointerSprite.current.anchor.set(0.5, 0.5);
241
241
  spinningPointerSprite.current.scale.set(0.5);
@@ -264,11 +264,11 @@ function Player(props) {
264
264
  };
265
265
  const updatePointer = async (img, x, y)=>{
266
266
  var _pointerSprite_current, _pointerSprite_current1;
267
- if (!(0, external_pixi_loader_js_namespaceObject.getTextureFromCache)(img)) {
267
+ if (!(0, pixi_loader_js_namespaceObject.getTextureFromCache)(img)) {
268
268
  console.warn('image not loaded', img);
269
- await (0, external_pixi_loader_js_namespaceObject.loadTexture)(img);
269
+ await (0, pixi_loader_js_namespaceObject.loadTexture)(img);
270
270
  }
271
- const texture = (0, external_pixi_loader_js_namespaceObject.getTextureFromCache)(img);
271
+ const texture = (0, pixi_loader_js_namespaceObject.getTextureFromCache)(img);
272
272
  if (!texture) throw new Error('texture not found');
273
273
  const sprite = external_pixi_js_namespaceObject.Sprite.from(texture);
274
274
  let targetX = null == (_pointerSprite_current = pointerSprite.current) ? void 0 : _pointerSprite_current.x;
@@ -413,7 +413,7 @@ function Player(props) {
413
413
  const randomIndex = Math.floor(Math.random() * elementsToAdd.length);
414
414
  const element = elementsToAdd.splice(randomIndex, 1)[0];
415
415
  if (element) {
416
- const [insightMarkGraphic] = (0, external_blackboard_js_namespaceObject.rectMarkForItem)(element.rect, element.content, 'element');
416
+ const [insightMarkGraphic] = (0, external_blackboard_index_js_namespaceObject.rectMarkForItem)(element.rect, element.content, 'element');
417
417
  insightMarkGraphic.alpha = 0;
418
418
  insightMarkContainer.addChild(insightMarkGraphic);
419
419
  childrenCount++;
@@ -425,17 +425,17 @@ function Player(props) {
425
425
  while(elementsToAdd.length > 0){
426
426
  const randomIndex = Math.floor(Math.random() * elementsToAdd.length);
427
427
  const element = elementsToAdd.splice(randomIndex, 1)[0];
428
- const [insightMarkGraphic] = (0, external_blackboard_js_namespaceObject.rectMarkForItem)(element.rect, element.content, 'element');
428
+ const [insightMarkGraphic] = (0, external_blackboard_index_js_namespaceObject.rectMarkForItem)(element.rect, element.content, 'element');
429
429
  insightMarkGraphic.alpha = 1;
430
430
  insightMarkContainer.addChild(insightMarkGraphic);
431
431
  }
432
432
  if (searchArea) {
433
- const [searchAreaGraphic] = (0, external_blackboard_js_namespaceObject.rectMarkForItem)(searchArea, 'Search Area', 'searchArea');
433
+ const [searchAreaGraphic] = (0, external_blackboard_index_js_namespaceObject.rectMarkForItem)(searchArea, 'Search Area', 'searchArea');
434
434
  searchAreaGraphic.alpha = 1;
435
435
  insightMarkContainer.addChild(searchAreaGraphic);
436
436
  }
437
437
  highlightElements.map((element)=>{
438
- const [insightMarkGraphic] = (0, external_blackboard_js_namespaceObject.rectMarkForItem)(element.rect, element.content || '', 'highlight');
438
+ const [insightMarkGraphic] = (0, external_blackboard_index_js_namespaceObject.rectMarkForItem)(element.rect, element.content || '', 'highlight');
439
439
  insightMarkGraphic.alpha = 1;
440
440
  insightMarkContainer.addChild(insightMarkGraphic);
441
441
  });
@@ -482,11 +482,11 @@ function Player(props) {
482
482
  const allImages = scripts.filter((item)=>!!item.img).map((item)=>item.img);
483
483
  await Promise.all([
484
484
  ...allImages,
485
- external_utils_js_namespaceObject.mouseLoading,
486
- external_utils_js_namespaceObject.mousePointer
487
- ].map(external_pixi_loader_js_namespaceObject.loadTexture));
485
+ index_js_namespaceObject.mouseLoading,
486
+ index_js_namespaceObject.mousePointer
487
+ ].map(pixi_loader_js_namespaceObject.loadTexture));
488
488
  insightMarkContainer.removeChildren();
489
- await updatePointer(external_utils_js_namespaceObject.mousePointer, imageWidth / 2, imageHeight / 2);
489
+ await updatePointer(index_js_namespaceObject.mousePointer, imageWidth / 2, imageHeight / 2);
490
490
  await repaintImage();
491
491
  await updateCamera({
492
492
  ...basicCameraState
@@ -1,7 +1,30 @@
1
- body {
1
+ .result-wrapper {
2
+ justify-content: center;
3
+ height: 100%;
4
+ margin: 4px 0;
5
+ display: flex;
6
+ }
7
+
8
+ .result-wrapper .loading-container {
9
+ text-align: center;
10
+ }
11
+
12
+ .result-wrapper .loading-container .loading-progress-text {
13
+ color: #888;
14
+ margin-top: 8px;
15
+ font-size: 12px;
16
+ }
17
+
18
+ .result-wrapper pre {
19
+ white-space: pre-wrap;
20
+ text-wrap: unset;
21
+ word-wrap: break-word;
22
+ overflow-wrap: break-word;
23
+ background: #f2f4f7;
24
+ border-radius: 8px;
2
25
  margin: 0;
3
- font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;
4
- font-size: 14px;
26
+ padding: 14px;
27
+ overflow: scroll;
5
28
  }
6
29
 
7
30
  .prompt-input-wrapper {
@@ -334,164 +357,9 @@ body {
334
357
  color: #2b83ff;
335
358
  }
336
359
 
337
- .history-modal-container {
338
- border-radius: 12px 12px 0 0;
339
- flex-direction: column;
340
- height: 70vh;
341
- display: flex;
342
- overflow: hidden;
343
- }
344
-
345
- .history-modal-container .history-modal-header {
346
- justify-content: space-between;
347
- align-items: center;
348
- height: 48px;
349
- padding: 0 25px;
350
- line-height: 48px;
351
- display: flex;
352
- }
353
-
354
- .history-modal-container .history-modal-header .close-button {
355
- justify-content: center;
356
- align-items: center;
357
- margin-right: -4px;
358
- padding: 4px;
359
- display: flex;
360
- }
361
-
362
- .history-modal-container .history-modal-header .close-button .anticon {
363
- color: #999;
364
- font-size: 18px;
365
- }
366
-
367
- .history-modal-container .history-modal-header .close-button:hover .anticon {
368
- color: #666;
369
- }
370
-
371
- .history-modal-container .history-search-section {
372
- background: #fff;
373
- padding: 16px 20px;
374
- }
375
-
376
- .history-modal-container .history-search-section .search-input-wrapper {
377
- color: rgba(0, 0, 0, .25);
378
- align-items: center;
379
- gap: 12px;
380
- display: flex;
381
- }
382
-
383
- .history-modal-container .history-search-section .search-input-wrapper .search-input {
384
- background: #f1f2f3;
385
- border: none;
386
- border-radius: 16px;
387
- flex: 1;
388
- height: 36px;
389
- }
390
-
391
- .history-modal-container .history-search-section .search-input-wrapper .search-input .ant-input {
392
- box-shadow: none;
393
- background: none;
394
- border: none;
395
- }
396
-
397
- .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 {
398
- background: #fff;
399
- border-color: #d9d9d9;
400
- }
401
-
402
- .history-modal-container .history-search-section .search-input-wrapper .clear-button {
403
- color: #1890ff;
404
- height: auto;
405
- padding: 0;
406
- }
407
-
408
- .history-modal-container .history-search-section .search-input-wrapper .clear-button:hover {
409
- color: #40a9ff;
410
- }
411
-
412
- .history-modal-container .history-content {
413
- flex: 1;
414
- padding: 0 25px 25px;
415
- overflow-y: auto;
416
- }
417
-
418
- .history-modal-container .history-content .history-group {
419
- margin-bottom: 10px;
420
- }
421
-
422
- .history-modal-container .history-content .history-group .history-group-title {
423
- color: rgba(0, 0, 0, .45);
424
- height: 40px;
425
- font-size: 12px;
426
- font-weight: 400;
427
- line-height: 40px;
428
- }
429
-
430
- .history-modal-container .history-content .history-group .history-item {
431
- cursor: pointer;
432
- color: rgba(0, 0, 0, .85);
433
- white-space: nowrap;
434
- text-overflow: ellipsis;
435
- height: 40px;
436
- font-size: 14px;
437
- line-height: 40px;
438
- overflow: hidden;
439
- }
440
-
441
- .history-modal-container .history-content .history-group .history-item:hover {
442
- background: #f2f4f7;
443
- margin: 0 -8px;
444
- padding: 0 8px;
445
- }
446
-
447
- .history-modal-container .history-content .no-results {
448
- text-align: center;
449
- color: #999;
450
- padding: 40px 20px;
451
- }
452
-
453
- .ant-modal-wrap .ant-modal-content {
454
- animation: .3s cubic-bezier(.4, 0, .2, 1) forwards slideUpFromBottom !important;
455
- }
456
-
457
- @keyframes slideUpFromBottom {
458
- 0% {
459
- opacity: 0;
460
- transform: translateY(100%);
461
- }
462
-
463
- 100% {
464
- opacity: 1;
465
- transform: translateY(0);
466
- }
467
- }
468
-
469
- .result-wrapper {
470
- justify-content: center;
471
- height: 100%;
472
- margin: 4px 0;
473
- display: flex;
474
- }
475
-
476
- .result-wrapper .loading-container {
477
- text-align: center;
478
- }
479
-
480
- .result-wrapper .loading-container .loading-progress-text {
481
- color: #888;
482
- margin-top: 8px;
483
- font-size: 12px;
484
- }
485
-
486
- .result-wrapper pre {
487
- white-space: pre-wrap;
488
- text-wrap: unset;
489
- word-wrap: break-word;
490
- overflow-wrap: break-word;
491
- background: #f2f4f7;
492
- border-radius: 8px;
360
+ body {
493
361
  margin: 0;
494
- padding: 14px;
495
- overflow: scroll;
362
+ font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;
363
+ font-size: 14px;
496
364
  }
497
365
 
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ var __webpack_modules__ = {
3
+ "../../hooks/useServerValid": function(module) {
4
+ module.exports = require("../../hooks/useServerValid.js");
5
+ },
6
+ "../../store/store": function(module) {
7
+ module.exports = require("../../store/store.js");
8
+ },
9
+ "../../types": function(module) {
10
+ module.exports = require("../../types.js");
11
+ },
12
+ "../context-preview": function(module) {
13
+ module.exports = require("../context-preview/index.js");
14
+ },
15
+ "../playground-result": function(module) {
16
+ module.exports = require("../playground-result/index.js");
17
+ },
18
+ "../prompt-input": function(module) {
19
+ module.exports = require("../prompt-input/index.js");
20
+ },
21
+ "../service-mode-control": function(module) {
22
+ module.exports = require("../service-mode-control/index.js");
23
+ }
24
+ };
25
+ var __webpack_module_cache__ = {};
26
+ function __webpack_require__(moduleId) {
27
+ var cachedModule = __webpack_module_cache__[moduleId];
28
+ if (void 0 !== cachedModule) return cachedModule.exports;
29
+ var module = __webpack_module_cache__[moduleId] = {
30
+ exports: {}
31
+ };
32
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
33
+ return module.exports;
34
+ }
35
+ (()=>{
36
+ __webpack_require__.n = (module)=>{
37
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
38
+ __webpack_require__.d(getter, {
39
+ a: getter
40
+ });
41
+ return getter;
42
+ };
43
+ })();
44
+ (()=>{
45
+ __webpack_require__.d = (exports1, definition)=>{
46
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
47
+ enumerable: true,
48
+ get: definition[key]
49
+ });
50
+ };
51
+ })();
52
+ (()=>{
53
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
54
+ })();
55
+ (()=>{
56
+ __webpack_require__.r = (exports1)=>{
57
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
58
+ value: 'Module'
59
+ });
60
+ Object.defineProperty(exports1, '__esModule', {
61
+ value: true
62
+ });
63
+ };
64
+ })();
65
+ var __webpack_exports__ = {};
66
+ (()=>{
67
+ __webpack_require__.r(__webpack_exports__);
68
+ __webpack_require__.d(__webpack_exports__, {
69
+ ContextPreview: ()=>_context_preview__WEBPACK_IMPORTED_MODULE_0__.ContextPreview,
70
+ PlaygroundResultView: ()=>_playground_result__WEBPACK_IMPORTED_MODULE_1__.PlaygroundResultView,
71
+ PromptInput: ()=>_prompt_input__WEBPACK_IMPORTED_MODULE_2__.PromptInput,
72
+ ServiceModeControl: ()=>_service_mode_control__WEBPACK_IMPORTED_MODULE_4__.ServiceModeControl,
73
+ useEnvConfig: ()=>_store_store__WEBPACK_IMPORTED_MODULE_6__.useEnvConfig,
74
+ useServerValid: ()=>_hooks_useServerValid__WEBPACK_IMPORTED_MODULE_3__.useServerValid
75
+ });
76
+ var _context_preview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../context-preview");
77
+ var _playground_result__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("../playground-result");
78
+ var _prompt_input__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("../prompt-input");
79
+ var _hooks_useServerValid__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("../../hooks/useServerValid");
80
+ var _service_mode_control__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("../service-mode-control");
81
+ var _types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("../../types");
82
+ var __WEBPACK_REEXPORT_OBJECT__ = {};
83
+ for(var __WEBPACK_IMPORT_KEY__ in _types__WEBPACK_IMPORTED_MODULE_5__)if ([
84
+ "PromptInput",
85
+ "ContextPreview",
86
+ "ServiceModeControl",
87
+ "default",
88
+ "PlaygroundResultView",
89
+ "useEnvConfig",
90
+ "useServerValid"
91
+ ].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
92
+ return _types__WEBPACK_IMPORTED_MODULE_5__[key];
93
+ }).bind(0, __WEBPACK_IMPORT_KEY__);
94
+ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
95
+ var _store_store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("../../store/store");
96
+ })();
97
+ exports.ContextPreview = __webpack_exports__.ContextPreview;
98
+ exports.PlaygroundResultView = __webpack_exports__.PlaygroundResultView;
99
+ exports.PromptInput = __webpack_exports__.PromptInput;
100
+ exports.ServiceModeControl = __webpack_exports__.ServiceModeControl;
101
+ exports.useEnvConfig = __webpack_exports__.useEnvConfig;
102
+ exports.useServerValid = __webpack_exports__.useServerValid;
103
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
104
+ "ContextPreview",
105
+ "PlaygroundResultView",
106
+ "PromptInput",
107
+ "ServiceModeControl",
108
+ "useEnvConfig",
109
+ "useServerValid"
110
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
111
+ Object.defineProperty(exports, '__esModule', {
112
+ value: true
113
+ });
@@ -0,0 +1,29 @@
1
+ .result-wrapper {
2
+ justify-content: center;
3
+ height: 100%;
4
+ margin: 4px 0;
5
+ display: flex;
6
+ }
7
+
8
+ .result-wrapper .loading-container {
9
+ text-align: center;
10
+ }
11
+
12
+ .result-wrapper .loading-container .loading-progress-text {
13
+ color: #888;
14
+ margin-top: 8px;
15
+ font-size: 12px;
16
+ }
17
+
18
+ .result-wrapper pre {
19
+ white-space: pre-wrap;
20
+ text-wrap: unset;
21
+ word-wrap: break-word;
22
+ overflow-wrap: break-word;
23
+ background: #f2f4f7;
24
+ border-radius: 8px;
25
+ margin: 0;
26
+ padding: 14px;
27
+ overflow: scroll;
28
+ }
29
+
@@ -38,17 +38,16 @@ __webpack_require__.d(__webpack_exports__, {
38
38
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
39
39
  const icons_namespaceObject = require("@ant-design/icons");
40
40
  const external_antd_namespaceObject = require("antd");
41
- const external_player_js_namespaceObject = require("../player.js");
42
- const external_shiny_text_js_namespaceObject = require("../shiny-text.js");
43
- var external_shiny_text_js_default = /*#__PURE__*/ __webpack_require__.n(external_shiny_text_js_namespaceObject);
44
- const external_playground_constants_js_namespaceObject = require("./playground-constants.js");
45
- require("./index.css");
41
+ const constants_js_namespaceObject = require("../../utils/constants.js");
42
+ const index_js_namespaceObject = require("../player/index.js");
43
+ const external_shiny_text_index_js_namespaceObject = require("../shiny-text/index.js");
44
+ var external_shiny_text_index_js_default = /*#__PURE__*/ __webpack_require__.n(external_shiny_text_index_js_namespaceObject);
46
45
  const PlaygroundResultView = (param)=>{
47
46
  let { result, loading, serverValid, serviceMode, replayScriptsInfo, replayCounter, loadingProgressText, verticalMode = false, notReadyMessage, fitMode, autoZoom } = param;
48
47
  let resultWrapperClassName = 'result-wrapper';
49
48
  if (verticalMode) resultWrapperClassName += ' vertical-mode-result';
50
49
  if (replayScriptsInfo && verticalMode) resultWrapperClassName += ' result-wrapper-compact';
51
- let resultDataToShow = external_playground_constants_js_namespaceObject.emptyResultTip;
50
+ let resultDataToShow = constants_js_namespaceObject.emptyResultTip;
52
51
  if (serverValid || 'Server' !== serviceMode) {
53
52
  if (loading) resultDataToShow = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
54
53
  className: "loading-container",
@@ -61,14 +60,14 @@ const PlaygroundResultView = (param)=>{
61
60
  }),
62
61
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
63
62
  className: "loading-progress-text loading-progress-text-progress",
64
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_shiny_text_js_default(), {
63
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_shiny_text_index_js_default(), {
65
64
  text: loadingProgressText,
66
65
  speed: 3
67
66
  })
68
67
  })
69
68
  ]
70
69
  });
71
- else if (replayScriptsInfo) resultDataToShow = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_player_js_namespaceObject.Player, {
70
+ else if (replayScriptsInfo) resultDataToShow = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.Player, {
72
71
  replayScripts: replayScriptsInfo.scripts,
73
72
  imageWidth: replayScriptsInfo.width,
74
73
  imageHeight: replayScriptsInfo.height,
@@ -84,7 +83,7 @@ const PlaygroundResultView = (param)=>{
84
83
  }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("pre", {
85
84
  children: JSON.stringify(null == result ? void 0 : result.result, null, 2)
86
85
  });
87
- } else resultDataToShow = (0, external_playground_constants_js_namespaceObject.serverLaunchTip)(notReadyMessage);
86
+ } else resultDataToShow = (0, constants_js_namespaceObject.serverLaunchTip)(notReadyMessage);
88
87
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
89
88
  className: resultWrapperClassName,
90
89
  style: {