@godscene/visualizer 1.7.11

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 (221) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +9 -0
  3. package/dist/es/component/blackboard/highlights.mjs +47 -0
  4. package/dist/es/component/blackboard/index.css +118 -0
  5. package/dist/es/component/blackboard/index.mjs +122 -0
  6. package/dist/es/component/config-selector/index.mjs +251 -0
  7. package/dist/es/component/context-preview/index.mjs +37 -0
  8. package/dist/es/component/env-config/index.mjs +237 -0
  9. package/dist/es/component/env-config-reminder/index.css +30 -0
  10. package/dist/es/component/env-config-reminder/index.mjs +27 -0
  11. package/dist/es/component/form-field/index.mjs +158 -0
  12. package/dist/es/component/history-selector/index.css +237 -0
  13. package/dist/es/component/history-selector/index.mjs +197 -0
  14. package/dist/es/component/index.mjs +1 -0
  15. package/dist/es/component/logo/index.css +19 -0
  16. package/dist/es/component/logo/index.mjs +20 -0
  17. package/dist/es/component/logo/logo.mjs +2 -0
  18. package/dist/es/component/misc/index.mjs +96 -0
  19. package/dist/es/component/nav-actions/index.mjs +14 -0
  20. package/dist/es/component/nav-actions/style.css +35 -0
  21. package/dist/es/component/player/index.css +296 -0
  22. package/dist/es/component/player/index.mjs +702 -0
  23. package/dist/es/component/player/playback-controls.mjs +4 -0
  24. package/dist/es/component/player/report-download.mjs +61 -0
  25. package/dist/es/component/player/scenes/StepScene.mjs +194 -0
  26. package/dist/es/component/player/scenes/derive-frame-state.mjs +229 -0
  27. package/dist/es/component/player/scenes/export-branded-video.mjs +360 -0
  28. package/dist/es/component/player/scenes/frame-calculator.mjs +149 -0
  29. package/dist/es/component/player/scenes/playback-frame.mjs +6 -0
  30. package/dist/es/component/player/scenes/playback-layout.mjs +12 -0
  31. package/dist/es/component/player/scenes/pointer-layout.mjs +36 -0
  32. package/dist/es/component/player/use-frame-player.mjs +87 -0
  33. package/dist/es/component/playground/index.css +930 -0
  34. package/dist/es/component/playground/playground-demo-ui-context.json +290 -0
  35. package/dist/es/component/playground-result/index.css +92 -0
  36. package/dist/es/component/playground-result/index.mjs +232 -0
  37. package/dist/es/component/prompt-input/index.css +832 -0
  38. package/dist/es/component/prompt-input/index.mjs +959 -0
  39. package/dist/es/component/screenshot-viewer/index.css +237 -0
  40. package/dist/es/component/screenshot-viewer/index.mjs +319 -0
  41. package/dist/es/component/service-mode-control/index.mjs +107 -0
  42. package/dist/es/component/shiny-text/index.css +107 -0
  43. package/dist/es/component/shiny-text/index.mjs +15 -0
  44. package/dist/es/component/universal-playground/empty-state.mjs +5 -0
  45. package/dist/es/component/universal-playground/index.css +619 -0
  46. package/dist/es/component/universal-playground/index.mjs +558 -0
  47. package/dist/es/component/universal-playground/providers/context-provider.mjs +90 -0
  48. package/dist/es/component/universal-playground/providers/indexeddb-storage-provider.mjs +280 -0
  49. package/dist/es/component/universal-playground/providers/storage-provider.mjs +279 -0
  50. package/dist/es/component/universal-playground/universal-playground-electron.mjs +668 -0
  51. package/dist/es/hooks/useMinimalTypeGate.mjs +47 -0
  52. package/dist/es/hooks/usePlaygroundExecution.mjs +435 -0
  53. package/dist/es/hooks/usePlaygroundState.mjs +278 -0
  54. package/dist/es/hooks/useSafeOverrideAIConfig.mjs +20 -0
  55. package/dist/es/hooks/useServerValid.mjs +55 -0
  56. package/dist/es/hooks/useTheme.mjs +25 -0
  57. package/dist/es/icons/action-chevron.mjs +61 -0
  58. package/dist/es/icons/avatar.mjs +70 -0
  59. package/dist/es/icons/close.mjs +61 -0
  60. package/dist/es/icons/global-perspective.mjs +58 -0
  61. package/dist/es/icons/history.mjs +72 -0
  62. package/dist/es/icons/magnifying-glass.mjs +81 -0
  63. package/dist/es/icons/player-setting.mjs +68 -0
  64. package/dist/es/icons/prompt-history.mjs +70 -0
  65. package/dist/es/icons/setting.mjs +62 -0
  66. package/dist/es/icons/show-marker.mjs +58 -0
  67. package/dist/es/index.mjs +26 -0
  68. package/dist/es/static/image/logo.png +0 -0
  69. package/dist/es/store/history.mjs +128 -0
  70. package/dist/es/store/store.mjs +277 -0
  71. package/dist/es/types.mjs +73 -0
  72. package/dist/es/utils/action-label.mjs +15 -0
  73. package/dist/es/utils/color.mjs +35 -0
  74. package/dist/es/utils/constants.mjs +99 -0
  75. package/dist/es/utils/device-capabilities.mjs +13 -0
  76. package/dist/es/utils/empty-state-scroll.mjs +8 -0
  77. package/dist/es/utils/highlight-element.mjs +62 -0
  78. package/dist/es/utils/index.mjs +13 -0
  79. package/dist/es/utils/playground-utils.mjs +43 -0
  80. package/dist/es/utils/progress-action-icon.mjs +30 -0
  81. package/dist/es/utils/prompt-input-utils.mjs +49 -0
  82. package/dist/es/utils/prompt-placeholder.mjs +19 -0
  83. package/dist/es/utils/replay-scripts.mjs +428 -0
  84. package/dist/lib/component/blackboard/highlights.js +84 -0
  85. package/dist/lib/component/blackboard/index.css +118 -0
  86. package/dist/lib/component/blackboard/index.js +169 -0
  87. package/dist/lib/component/config-selector/index.js +295 -0
  88. package/dist/lib/component/context-preview/index.js +82 -0
  89. package/dist/lib/component/env-config/index.js +271 -0
  90. package/dist/lib/component/env-config-reminder/index.css +30 -0
  91. package/dist/lib/component/env-config-reminder/index.js +61 -0
  92. package/dist/lib/component/form-field/index.js +204 -0
  93. package/dist/lib/component/history-selector/index.css +237 -0
  94. package/dist/lib/component/history-selector/index.js +243 -0
  95. package/dist/lib/component/index.js +58 -0
  96. package/dist/lib/component/logo/index.css +19 -0
  97. package/dist/lib/component/logo/index.js +67 -0
  98. package/dist/lib/component/logo/logo.js +24 -0
  99. package/dist/lib/component/misc/index.js +152 -0
  100. package/dist/lib/component/nav-actions/index.js +48 -0
  101. package/dist/lib/component/nav-actions/style.css +35 -0
  102. package/dist/lib/component/player/index.css +296 -0
  103. package/dist/lib/component/player/index.js +747 -0
  104. package/dist/lib/component/player/playback-controls.js +38 -0
  105. package/dist/lib/component/player/report-download.js +98 -0
  106. package/dist/lib/component/player/scenes/StepScene.js +228 -0
  107. package/dist/lib/component/player/scenes/derive-frame-state.js +266 -0
  108. package/dist/lib/component/player/scenes/export-branded-video.js +403 -0
  109. package/dist/lib/component/player/scenes/frame-calculator.js +186 -0
  110. package/dist/lib/component/player/scenes/playback-frame.js +40 -0
  111. package/dist/lib/component/player/scenes/playback-layout.js +46 -0
  112. package/dist/lib/component/player/scenes/pointer-layout.js +88 -0
  113. package/dist/lib/component/player/use-frame-player.js +121 -0
  114. package/dist/lib/component/playground/index.css +930 -0
  115. package/dist/lib/component/playground/playground-demo-ui-context.json +290 -0
  116. package/dist/lib/component/playground-result/index.css +92 -0
  117. package/dist/lib/component/playground-result/index.js +276 -0
  118. package/dist/lib/component/prompt-input/index.css +832 -0
  119. package/dist/lib/component/prompt-input/index.js +1005 -0
  120. package/dist/lib/component/screenshot-viewer/index.css +237 -0
  121. package/dist/lib/component/screenshot-viewer/index.js +353 -0
  122. package/dist/lib/component/service-mode-control/index.js +141 -0
  123. package/dist/lib/component/shiny-text/index.css +107 -0
  124. package/dist/lib/component/shiny-text/index.js +49 -0
  125. package/dist/lib/component/universal-playground/empty-state.js +39 -0
  126. package/dist/lib/component/universal-playground/index.css +619 -0
  127. package/dist/lib/component/universal-playground/index.js +607 -0
  128. package/dist/lib/component/universal-playground/providers/context-provider.js +133 -0
  129. package/dist/lib/component/universal-playground/providers/indexeddb-storage-provider.js +320 -0
  130. package/dist/lib/component/universal-playground/providers/storage-provider.js +337 -0
  131. package/dist/lib/component/universal-playground/universal-playground-electron.js +717 -0
  132. package/dist/lib/hooks/useMinimalTypeGate.js +81 -0
  133. package/dist/lib/hooks/usePlaygroundExecution.js +478 -0
  134. package/dist/lib/hooks/usePlaygroundState.js +312 -0
  135. package/dist/lib/hooks/useSafeOverrideAIConfig.js +57 -0
  136. package/dist/lib/hooks/useServerValid.js +89 -0
  137. package/dist/lib/hooks/useTheme.js +59 -0
  138. package/dist/lib/icons/action-chevron.js +95 -0
  139. package/dist/lib/icons/avatar.js +104 -0
  140. package/dist/lib/icons/close.js +95 -0
  141. package/dist/lib/icons/global-perspective.js +92 -0
  142. package/dist/lib/icons/history.js +106 -0
  143. package/dist/lib/icons/magnifying-glass.js +115 -0
  144. package/dist/lib/icons/player-setting.js +102 -0
  145. package/dist/lib/icons/prompt-history.js +104 -0
  146. package/dist/lib/icons/setting.js +96 -0
  147. package/dist/lib/icons/show-marker.js +92 -0
  148. package/dist/lib/index.js +204 -0
  149. package/dist/lib/static/image/logo.png +0 -0
  150. package/dist/lib/store/history.js +135 -0
  151. package/dist/lib/store/store.js +287 -0
  152. package/dist/lib/types.js +119 -0
  153. package/dist/lib/utils/action-label.js +52 -0
  154. package/dist/lib/utils/color.js +75 -0
  155. package/dist/lib/utils/constants.js +172 -0
  156. package/dist/lib/utils/device-capabilities.js +50 -0
  157. package/dist/lib/utils/empty-state-scroll.js +42 -0
  158. package/dist/lib/utils/highlight-element.js +99 -0
  159. package/dist/lib/utils/index.js +69 -0
  160. package/dist/lib/utils/playground-utils.js +86 -0
  161. package/dist/lib/utils/progress-action-icon.js +67 -0
  162. package/dist/lib/utils/prompt-input-utils.js +89 -0
  163. package/dist/lib/utils/prompt-placeholder.js +53 -0
  164. package/dist/lib/utils/replay-scripts.js +474 -0
  165. package/dist/types/component/blackboard/highlights.d.ts +11 -0
  166. package/dist/types/component/blackboard/index.d.ts +10 -0
  167. package/dist/types/component/config-selector/index.d.ts +15 -0
  168. package/dist/types/component/context-preview/index.d.ts +9 -0
  169. package/dist/types/component/env-config/index.d.ts +8 -0
  170. package/dist/types/component/env-config-reminder/index.d.ts +6 -0
  171. package/dist/types/component/form-field/index.d.ts +17 -0
  172. package/dist/types/component/history-selector/index.d.ts +13 -0
  173. package/dist/types/component/index.d.ts +1 -0
  174. package/dist/types/component/logo/index.d.ts +5 -0
  175. package/dist/types/component/misc/index.d.ts +6 -0
  176. package/dist/types/component/nav-actions/index.d.ts +12 -0
  177. package/dist/types/component/player/index.d.ts +15 -0
  178. package/dist/types/component/player/playback-controls.d.ts +1 -0
  179. package/dist/types/component/player/report-download.d.ts +32 -0
  180. package/dist/types/component/player/scenes/StepScene.d.ts +9 -0
  181. package/dist/types/component/player/scenes/derive-frame-state.d.ts +40 -0
  182. package/dist/types/component/player/scenes/export-branded-video.d.ts +33 -0
  183. package/dist/types/component/player/scenes/frame-calculator.d.ts +40 -0
  184. package/dist/types/component/player/scenes/playback-frame.d.ts +3 -0
  185. package/dist/types/component/player/scenes/playback-layout.d.ts +7 -0
  186. package/dist/types/component/player/scenes/pointer-layout.d.ts +20 -0
  187. package/dist/types/component/player/use-frame-player.d.ts +17 -0
  188. package/dist/types/component/playground-result/index.d.ts +22 -0
  189. package/dist/types/component/prompt-input/index.d.ts +23 -0
  190. package/dist/types/component/screenshot-viewer/index.d.ts +23 -0
  191. package/dist/types/component/service-mode-control/index.d.ts +6 -0
  192. package/dist/types/component/shiny-text/index.d.ts +12 -0
  193. package/dist/types/component/universal-playground/empty-state.d.ts +3 -0
  194. package/dist/types/component/universal-playground/index.d.ts +4 -0
  195. package/dist/types/component/universal-playground/providers/context-provider.d.ts +37 -0
  196. package/dist/types/component/universal-playground/providers/indexeddb-storage-provider.d.ts +71 -0
  197. package/dist/types/component/universal-playground/providers/storage-provider.d.ts +58 -0
  198. package/dist/types/component/universal-playground/universal-playground-electron.d.ts +4 -0
  199. package/dist/types/hooks/useMinimalTypeGate.d.ts +72 -0
  200. package/dist/types/hooks/usePlaygroundExecution.d.ts +40 -0
  201. package/dist/types/hooks/usePlaygroundState.d.ts +26 -0
  202. package/dist/types/hooks/useSafeOverrideAIConfig.d.ts +16 -0
  203. package/dist/types/hooks/useServerValid.d.ts +1 -0
  204. package/dist/types/hooks/useTheme.d.ts +7 -0
  205. package/dist/types/index.d.ts +29 -0
  206. package/dist/types/store/history.d.ts +16 -0
  207. package/dist/types/store/store.d.ts +57 -0
  208. package/dist/types/types.d.ts +278 -0
  209. package/dist/types/utils/action-label.d.ts +11 -0
  210. package/dist/types/utils/color.d.ts +4 -0
  211. package/dist/types/utils/constants.d.ts +80 -0
  212. package/dist/types/utils/device-capabilities.d.ts +9 -0
  213. package/dist/types/utils/empty-state-scroll.d.ts +11 -0
  214. package/dist/types/utils/highlight-element.d.ts +3 -0
  215. package/dist/types/utils/index.d.ts +5 -0
  216. package/dist/types/utils/playground-utils.d.ts +11 -0
  217. package/dist/types/utils/progress-action-icon.d.ts +12 -0
  218. package/dist/types/utils/prompt-input-utils.d.ts +24 -0
  219. package/dist/types/utils/prompt-placeholder.d.ts +1 -0
  220. package/dist/types/utils/replay-scripts.d.ts +50 -0
  221. package/package.json +82 -0
@@ -0,0 +1,237 @@
1
+ .history-selector-wrapper {
2
+ position: relative;
3
+ }
4
+
5
+ .history-modal-overlay {
6
+ z-index: 9999;
7
+ background: #fff;
8
+ border: 1px solid rgba(0, 0, 0, .08);
9
+ border-radius: 12px;
10
+ width: 320px;
11
+ max-width: min(320px, 100vw - 32px);
12
+ height: 400px;
13
+ position: fixed;
14
+ box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
15
+ }
16
+
17
+ .history-modal-container {
18
+ border-radius: 12px;
19
+ flex-direction: column;
20
+ width: 100%;
21
+ height: 100%;
22
+ display: flex;
23
+ overflow: hidden;
24
+ }
25
+
26
+ .history-modal-container .history-modal-header {
27
+ justify-content: space-between;
28
+ align-items: center;
29
+ height: 48px;
30
+ padding: 0 25px;
31
+ line-height: 48px;
32
+ display: flex;
33
+ }
34
+
35
+ .history-modal-container .history-modal-header .close-button {
36
+ justify-content: center;
37
+ align-items: center;
38
+ margin-right: -4px;
39
+ padding: 4px;
40
+ display: flex;
41
+ }
42
+
43
+ .history-modal-container .history-modal-header .close-button .anticon {
44
+ color: #999;
45
+ font-size: 18px;
46
+ }
47
+
48
+ .history-modal-container .history-modal-header .close-button:hover .anticon {
49
+ color: #666;
50
+ }
51
+
52
+ .history-modal-container .history-search-section {
53
+ background: #fff;
54
+ padding: 16px 20px;
55
+ }
56
+
57
+ .history-modal-container .history-search-section .search-input-wrapper {
58
+ color: rgba(0, 0, 0, .25);
59
+ align-items: center;
60
+ gap: 12px;
61
+ display: flex;
62
+ }
63
+
64
+ .history-modal-container .history-search-section .search-input-wrapper .search-input {
65
+ background: #f1f2f3;
66
+ border: none;
67
+ border-radius: 16px;
68
+ flex: 1;
69
+ height: 36px;
70
+ }
71
+
72
+ .history-modal-container .history-search-section .search-input-wrapper .search-input .ant-input {
73
+ box-shadow: none;
74
+ background: none;
75
+ border: none;
76
+ }
77
+
78
+ .history-modal-container .history-search-section .search-input-wrapper .search-input:hover {
79
+ background: #fff;
80
+ border-color: #d9d9d9;
81
+ }
82
+
83
+ .history-modal-container .history-search-section .search-input-wrapper .search-input:focus-within {
84
+ background: #fff;
85
+ border-color: #d9d9d9;
86
+ }
87
+
88
+ .history-modal-container .history-search-section .search-input-wrapper .clear-button {
89
+ color: #1890ff;
90
+ height: auto;
91
+ padding: 0;
92
+ }
93
+
94
+ .history-modal-container .history-search-section .search-input-wrapper .clear-button:hover {
95
+ color: #40a9ff;
96
+ }
97
+
98
+ .history-modal-container .history-content {
99
+ flex: 1;
100
+ padding: 0 25px 25px;
101
+ overflow-y: auto;
102
+ }
103
+
104
+ .history-modal-container .history-content .history-group {
105
+ margin-bottom: 10px;
106
+ }
107
+
108
+ .history-modal-container .history-content .history-group .history-group-title {
109
+ color: rgba(0, 0, 0, .45);
110
+ height: 40px;
111
+ font-size: 12px;
112
+ font-weight: 400;
113
+ line-height: 40px;
114
+ }
115
+
116
+ .history-modal-container .history-content .history-group .history-item {
117
+ cursor: pointer;
118
+ color: rgba(0, 0, 0, .85);
119
+ white-space: nowrap;
120
+ text-overflow: ellipsis;
121
+ height: 40px;
122
+ font-size: 14px;
123
+ line-height: 40px;
124
+ overflow: hidden;
125
+ }
126
+
127
+ .history-modal-container .history-content .history-group .history-item:hover {
128
+ background: #f2f4f7;
129
+ margin: 0 -8px;
130
+ padding: 0 8px;
131
+ }
132
+
133
+ .history-modal-container .history-content .no-results {
134
+ text-align: center;
135
+ color: #999;
136
+ padding: 40px 20px;
137
+ }
138
+
139
+ [data-theme="dark"] .history-modal-overlay {
140
+ background: #16181d !important;
141
+ border-color: rgba(255, 255, 255, .12) !important;
142
+ box-shadow: 0 16px 40px rgba(0, 0, 0, .45) !important;
143
+ }
144
+
145
+ [data-theme="dark"] .history-modal-container {
146
+ background: #16181d !important;
147
+ }
148
+
149
+ [data-theme="dark"] .history-modal-container .history-modal-header .ant-typography {
150
+ color: rgba(255, 255, 255, .92) !important;
151
+ }
152
+
153
+ [data-theme="dark"] .history-modal-container .history-modal-header .close-button .anticon {
154
+ color: rgba(255, 255, 255, .48);
155
+ }
156
+
157
+ [data-theme="dark"] .history-modal-container .history-modal-header .close-button:hover .anticon {
158
+ color: rgba(255, 255, 255, .78);
159
+ }
160
+
161
+ [data-theme="dark"] .history-modal-container .history-search-section {
162
+ background: #16181d !important;
163
+ }
164
+
165
+ [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper {
166
+ color: rgba(255, 255, 255, .38);
167
+ }
168
+
169
+ [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 {
170
+ box-shadow: none !important;
171
+ background: rgba(255, 255, 255, .08) !important;
172
+ border-color: rgba(255, 255, 255, .12) !important;
173
+ }
174
+
175
+ [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 {
176
+ color: rgba(255, 255, 255, .72) !important;
177
+ }
178
+
179
+ [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 {
180
+ background: none !important;
181
+ }
182
+
183
+ [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input .ant-input::-webkit-input-placeholder {
184
+ color: rgba(255, 255, 255, .38) !important;
185
+ }
186
+
187
+ [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input .ant-input::placeholder {
188
+ color: rgba(255, 255, 255, .38) !important;
189
+ }
190
+
191
+ [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input.ant-input-affix-wrapper .ant-input::-webkit-input-placeholder {
192
+ color: rgba(255, 255, 255, .38) !important;
193
+ }
194
+
195
+ [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input.ant-input-affix-wrapper .ant-input::placeholder {
196
+ color: rgba(255, 255, 255, .38) !important;
197
+ }
198
+
199
+ [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 {
200
+ background: rgba(255, 255, 255, .12) !important;
201
+ border-color: rgba(255, 255, 255, .16) !important;
202
+ }
203
+
204
+ [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input:focus-within {
205
+ background: rgba(255, 255, 255, .12) !important;
206
+ border-color: rgba(255, 255, 255, .16) !important;
207
+ }
208
+
209
+ [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .search-input.ant-input-affix-wrapper:focus-within {
210
+ background: rgba(255, 255, 255, .12) !important;
211
+ border-color: rgba(255, 255, 255, .16) !important;
212
+ }
213
+
214
+ [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .clear-button {
215
+ color: #77b7ff !important;
216
+ }
217
+
218
+ [data-theme="dark"] .history-modal-container .history-search-section .search-input-wrapper .clear-button:hover {
219
+ color: #9cccff !important;
220
+ }
221
+
222
+ [data-theme="dark"] .history-modal-container .history-content .history-group .history-group-title {
223
+ color: rgba(255, 255, 255, .45) !important;
224
+ }
225
+
226
+ [data-theme="dark"] .history-modal-container .history-content .history-group .history-item {
227
+ color: rgba(255, 255, 255, .88) !important;
228
+ }
229
+
230
+ [data-theme="dark"] .history-modal-container .history-content .history-group .history-item:hover {
231
+ background: rgba(255, 255, 255, .08) !important;
232
+ }
233
+
234
+ [data-theme="dark"] .history-modal-container .history-content .no-results, [data-theme="dark"] .history-modal-container .history-content .ant-typography.ant-typography-secondary {
235
+ color: rgba(255, 255, 255, .45) !important;
236
+ }
237
+
@@ -0,0 +1,243 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.n = (module)=>{
5
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
+ __webpack_require__.d(getter, {
7
+ a: getter
8
+ });
9
+ return getter;
10
+ };
11
+ })();
12
+ (()=>{
13
+ __webpack_require__.d = (exports1, definition)=>{
14
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
15
+ enumerable: true,
16
+ get: definition[key]
17
+ });
18
+ };
19
+ })();
20
+ (()=>{
21
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
22
+ })();
23
+ (()=>{
24
+ __webpack_require__.r = (exports1)=>{
25
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
26
+ value: 'Module'
27
+ });
28
+ Object.defineProperty(exports1, '__esModule', {
29
+ value: true
30
+ });
31
+ };
32
+ })();
33
+ var __webpack_exports__ = {};
34
+ __webpack_require__.r(__webpack_exports__);
35
+ __webpack_require__.d(__webpack_exports__, {
36
+ HistorySelector: ()=>HistorySelector
37
+ });
38
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
39
+ const external_antd_namespaceObject = require("antd");
40
+ const external_react_namespaceObject = require("react");
41
+ const external_react_dom_namespaceObject = require("react-dom");
42
+ const close_js_namespaceObject = require("../../icons/close.js");
43
+ var close_js_default = /*#__PURE__*/ __webpack_require__.n(close_js_namespaceObject);
44
+ const history_js_namespaceObject = require("../../icons/history.js");
45
+ var history_js_default = /*#__PURE__*/ __webpack_require__.n(history_js_namespaceObject);
46
+ const magnifying_glass_js_namespaceObject = require("../../icons/magnifying-glass.js");
47
+ var magnifying_glass_js_default = /*#__PURE__*/ __webpack_require__.n(magnifying_glass_js_namespaceObject);
48
+ const external_store_history_js_namespaceObject = require("../../store/history.js");
49
+ require("./index.css");
50
+ const { Text } = external_antd_namespaceObject.Typography;
51
+ const HISTORY_MODAL_WIDTH = 320;
52
+ const HISTORY_MODAL_HEIGHT = 400;
53
+ const HISTORY_MODAL_GUTTER = 16;
54
+ const HISTORY_MODAL_OFFSET = 8;
55
+ const HistorySelector = ({ onSelect, history, currentType, trigger, popupPlacement = 'bottom' })=>{
56
+ const [isModalOpen, setIsModalOpen] = (0, external_react_namespaceObject.useState)(false);
57
+ const [searchText, setSearchText] = (0, external_react_namespaceObject.useState)('');
58
+ const clearHistory = (0, external_store_history_js_namespaceObject.useHistoryStore)((state)=>state.clearHistory);
59
+ const modalRef = (0, external_react_namespaceObject.useRef)(null);
60
+ const triggerRef = (0, external_react_namespaceObject.useRef)(null);
61
+ const [overlayPosition, setOverlayPosition] = (0, external_react_namespaceObject.useState)(null);
62
+ const groupedHistory = (0, external_react_namespaceObject.useMemo)(()=>{
63
+ const now = Date.now();
64
+ const sevenDaysAgo = now - 604800000;
65
+ const oneYearAgo = now - 31536000000;
66
+ const filteredHistory = history.filter((item)=>item.prompt.toLowerCase().includes(searchText.toLowerCase()));
67
+ const groups = {
68
+ recent7Days: filteredHistory.filter((item)=>item.timestamp >= sevenDaysAgo),
69
+ recent1Year: filteredHistory.filter((item)=>item.timestamp < sevenDaysAgo && item.timestamp >= oneYearAgo),
70
+ older: filteredHistory.filter((item)=>item.timestamp < oneYearAgo)
71
+ };
72
+ return groups;
73
+ }, [
74
+ history,
75
+ searchText
76
+ ]);
77
+ const handleHistoryClick = (item)=>{
78
+ onSelect(item);
79
+ setIsModalOpen(false);
80
+ };
81
+ const handleClearHistory = ()=>{
82
+ clearHistory(currentType);
83
+ setSearchText('');
84
+ setIsModalOpen(false);
85
+ };
86
+ (0, external_react_namespaceObject.useEffect)(()=>{
87
+ if (!isModalOpen) return;
88
+ const updateOverlayPosition = ()=>{
89
+ if (!triggerRef.current) return;
90
+ const triggerRect = triggerRef.current.getBoundingClientRect();
91
+ const maxLeft = Math.max(HISTORY_MODAL_GUTTER, window.innerWidth - HISTORY_MODAL_WIDTH - HISTORY_MODAL_GUTTER);
92
+ const maxTop = Math.max(HISTORY_MODAL_GUTTER, window.innerHeight - HISTORY_MODAL_HEIGHT - HISTORY_MODAL_GUTTER);
93
+ const left = Math.min(Math.max(HISTORY_MODAL_GUTTER, triggerRect.right - HISTORY_MODAL_WIDTH), maxLeft);
94
+ const preferredTop = 'top' === popupPlacement ? triggerRect.top - HISTORY_MODAL_HEIGHT - HISTORY_MODAL_OFFSET : triggerRect.bottom + HISTORY_MODAL_OFFSET;
95
+ const top = Math.min(Math.max(HISTORY_MODAL_GUTTER, preferredTop), maxTop);
96
+ setOverlayPosition({
97
+ left,
98
+ top
99
+ });
100
+ };
101
+ const handleClickOutside = (event)=>{
102
+ if (modalRef.current && !modalRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) setIsModalOpen(false);
103
+ };
104
+ updateOverlayPosition();
105
+ const timer = setTimeout(()=>{
106
+ document.addEventListener('click', handleClickOutside);
107
+ }, 100);
108
+ window.addEventListener('resize', updateOverlayPosition);
109
+ window.addEventListener('scroll', updateOverlayPosition, true);
110
+ return ()=>{
111
+ clearTimeout(timer);
112
+ document.removeEventListener('click', handleClickOutside);
113
+ window.removeEventListener('resize', updateOverlayPosition);
114
+ window.removeEventListener('scroll', updateOverlayPosition, true);
115
+ };
116
+ }, [
117
+ isModalOpen,
118
+ popupPlacement
119
+ ]);
120
+ const renderHistoryGroup = (title, items)=>{
121
+ if (0 === items.length) return null;
122
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
123
+ className: "history-group",
124
+ children: [
125
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
126
+ className: "history-group-title",
127
+ children: title
128
+ }),
129
+ items.map((item, index)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
130
+ className: "history-item",
131
+ onClick: ()=>handleHistoryClick(item),
132
+ children: item.prompt
133
+ }, `${item.timestamp}-${index}`))
134
+ ]
135
+ }, title);
136
+ };
137
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
138
+ className: "history-selector-wrapper",
139
+ children: [
140
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
141
+ className: "selector-trigger",
142
+ onClick: ()=>setIsModalOpen(true),
143
+ ref: triggerRef,
144
+ children: null != trigger ? trigger : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(history_js_default(), {
145
+ width: 24,
146
+ height: 24
147
+ })
148
+ }),
149
+ isModalOpen && overlayPosition && /*#__PURE__*/ (0, external_react_dom_namespaceObject.createPortal)(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
150
+ className: "history-modal-overlay",
151
+ ref: modalRef,
152
+ style: overlayPosition,
153
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
154
+ className: "history-modal-container",
155
+ children: [
156
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
157
+ className: "history-modal-header",
158
+ children: [
159
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(Text, {
160
+ strong: true,
161
+ style: {
162
+ fontSize: '16px'
163
+ },
164
+ children: [
165
+ "History (",
166
+ history.length,
167
+ ")"
168
+ ]
169
+ }),
170
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
171
+ size: "small",
172
+ type: "text",
173
+ icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(close_js_default(), {
174
+ width: 16,
175
+ height: 16
176
+ }),
177
+ onClick: ()=>setIsModalOpen(false),
178
+ className: "close-button"
179
+ })
180
+ ]
181
+ }),
182
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
183
+ className: "history-search-section",
184
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
185
+ className: "search-input-wrapper",
186
+ children: [
187
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Input, {
188
+ placeholder: "Search",
189
+ value: searchText,
190
+ onChange: (e)=>setSearchText(e.target.value),
191
+ prefix: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(magnifying_glass_js_default(), {
192
+ width: 18,
193
+ height: 18
194
+ }),
195
+ className: "search-input",
196
+ allowClear: true
197
+ }),
198
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
199
+ type: "link",
200
+ onClick: handleClearHistory,
201
+ className: "clear-button",
202
+ disabled: 0 === history.length,
203
+ children: "Clear"
204
+ })
205
+ ]
206
+ })
207
+ }),
208
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
209
+ className: "history-content",
210
+ children: 0 === history.length ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
211
+ className: "no-results",
212
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Text, {
213
+ type: "secondary",
214
+ children: "No history record"
215
+ })
216
+ }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
217
+ children: [
218
+ renderHistoryGroup('Last 7 days', groupedHistory.recent7Days),
219
+ renderHistoryGroup('Last 1 year', groupedHistory.recent1Year),
220
+ renderHistoryGroup('Earlier', groupedHistory.older),
221
+ searchText && 0 === groupedHistory.recent7Days.length && 0 === groupedHistory.recent1Year.length && 0 === groupedHistory.older.length && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
222
+ className: "no-results",
223
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Text, {
224
+ type: "secondary",
225
+ children: "No matching history record"
226
+ })
227
+ })
228
+ ]
229
+ })
230
+ })
231
+ ]
232
+ })
233
+ }), document.body)
234
+ ]
235
+ });
236
+ };
237
+ exports.HistorySelector = __webpack_exports__.HistorySelector;
238
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
239
+ "HistorySelector"
240
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
241
+ Object.defineProperty(exports, '__esModule', {
242
+ value: true
243
+ });
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __webpack_modules__ = {
3
+ "../types" (module) {
4
+ module.exports = require("../types.js");
5
+ }
6
+ };
7
+ var __webpack_module_cache__ = {};
8
+ function __webpack_require__(moduleId) {
9
+ var cachedModule = __webpack_module_cache__[moduleId];
10
+ if (void 0 !== cachedModule) return cachedModule.exports;
11
+ var module = __webpack_module_cache__[moduleId] = {
12
+ exports: {}
13
+ };
14
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
15
+ return module.exports;
16
+ }
17
+ (()=>{
18
+ __webpack_require__.n = (module)=>{
19
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
20
+ __webpack_require__.d(getter, {
21
+ a: getter
22
+ });
23
+ return getter;
24
+ };
25
+ })();
26
+ (()=>{
27
+ __webpack_require__.d = (exports1, definition)=>{
28
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
29
+ enumerable: true,
30
+ get: definition[key]
31
+ });
32
+ };
33
+ })();
34
+ (()=>{
35
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
36
+ })();
37
+ (()=>{
38
+ __webpack_require__.r = (exports1)=>{
39
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
40
+ value: 'Module'
41
+ });
42
+ Object.defineProperty(exports1, '__esModule', {
43
+ value: true
44
+ });
45
+ };
46
+ })();
47
+ var __webpack_exports__ = {};
48
+ (()=>{
49
+ __webpack_require__.r(__webpack_exports__);
50
+ var _types__rspack_import_0 = __webpack_require__("../types");
51
+ var __rspack_reexport = {};
52
+ for(const __rspack_import_key in _types__rspack_import_0)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_types__rspack_import_0[__rspack_import_key];
53
+ __webpack_require__.d(__webpack_exports__, __rspack_reexport);
54
+ })();
55
+ for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
56
+ Object.defineProperty(exports, '__esModule', {
57
+ value: true
58
+ });
@@ -0,0 +1,19 @@
1
+ .logo img {
2
+ vertical-align: baseline;
3
+ height: 30px;
4
+ vertical-align: -webkit-baseline-middle;
5
+ line-height: 30px;
6
+ }
7
+
8
+ .logo {
9
+ align-items: center;
10
+ gap: 8px;
11
+ display: flex;
12
+ }
13
+
14
+ .logo-with-star-wrapper {
15
+ flex-direction: row;
16
+ justify-content: space-between;
17
+ display: flex;
18
+ }
19
+
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.n = (module)=>{
5
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
+ __webpack_require__.d(getter, {
7
+ a: getter
8
+ });
9
+ return getter;
10
+ };
11
+ })();
12
+ (()=>{
13
+ __webpack_require__.d = (exports1, definition)=>{
14
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
15
+ enumerable: true,
16
+ get: definition[key]
17
+ });
18
+ };
19
+ })();
20
+ (()=>{
21
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
22
+ })();
23
+ (()=>{
24
+ __webpack_require__.r = (exports1)=>{
25
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
26
+ value: 'Module'
27
+ });
28
+ Object.defineProperty(exports1, '__esModule', {
29
+ value: true
30
+ });
31
+ };
32
+ })();
33
+ var __webpack_exports__ = {};
34
+ __webpack_require__.r(__webpack_exports__);
35
+ __webpack_require__.d(__webpack_exports__, {
36
+ Logo: ()=>Logo,
37
+ LogoUrl: ()=>LogoUrl
38
+ });
39
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
40
+ require("./index.css");
41
+ const external_logo_js_namespaceObject = require("./logo.js");
42
+ var external_logo_js_default = /*#__PURE__*/ __webpack_require__.n(external_logo_js_namespaceObject);
43
+ const LogoUrl = external_logo_js_default();
44
+ const Logo = ({ hideLogo = false })=>{
45
+ if (hideLogo) return null;
46
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
47
+ className: "logo",
48
+ children: [
49
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
50
+ alt: "Midscene_logo",
51
+ src: LogoUrl
52
+ }),
53
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
54
+ children: "RPA智能助手"
55
+ })
56
+ ]
57
+ });
58
+ };
59
+ exports.Logo = __webpack_exports__.Logo;
60
+ exports.LogoUrl = __webpack_exports__.LogoUrl;
61
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
62
+ "Logo",
63
+ "LogoUrl"
64
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
65
+ Object.defineProperty(exports, '__esModule', {
66
+ value: true
67
+ });
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __webpack_modules__ = {
3
+ "./src/component/logo/logo.png" (module) {
4
+ module.exports = require("../../static/image/logo.png");
5
+ }
6
+ };
7
+ var __webpack_module_cache__ = {};
8
+ function __webpack_require__(moduleId) {
9
+ var cachedModule = __webpack_module_cache__[moduleId];
10
+ if (void 0 !== cachedModule) return cachedModule.exports;
11
+ var module = __webpack_module_cache__[moduleId] = {
12
+ exports: {}
13
+ };
14
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
15
+ return module.exports;
16
+ }
17
+ var __webpack_exports__ = __webpack_require__("./src/component/logo/logo.png");
18
+ exports["default"] = __webpack_exports__["default"];
19
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
20
+ "default"
21
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
22
+ Object.defineProperty(exports, '__esModule', {
23
+ value: true
24
+ });