@gpustack/core-ui 1.0.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 (266) hide show
  1. package/README.md +1 -0
  2. package/dist/assets/invert-worker-CFNPVgCi.js +1 -0
  3. package/dist/assets/json-parser-worker-DtJw0BTZ.js +1 -0
  4. package/dist/assets/offscreen-worker-DL5yJmAw.js +1 -0
  5. package/dist/assets/parse-worker-Dzai8qsE.js +5 -0
  6. package/dist/favicon.ico +0 -0
  7. package/dist/index.cjs.js +2613 -0
  8. package/dist/index.css +1 -0
  9. package/dist/index.es.js +179547 -0
  10. package/dist/monaco-editor-CHfVLkob.js +103874 -0
  11. package/dist/monaco-editor-Df8eM8W1.js +802 -0
  12. package/dist/monaco-editor.css +1 -0
  13. package/dist/rolldown-runtime-BETGA6I9.js +23 -0
  14. package/dist/rolldown-runtime-D_0Db6FZ.js +1 -0
  15. package/dist/src/index.d.ts +1 -0
  16. package/dist/src/lib/components/alert-info/block.d.ts +16 -0
  17. package/dist/src/lib/components/alert-info/index.d.ts +11 -0
  18. package/dist/src/lib/components/audio-animation/index.d.ts +16 -0
  19. package/dist/src/lib/components/audio-player/audio-element.d.ts +3 -0
  20. package/dist/src/lib/components/audio-player/config/type.d.ts +25 -0
  21. package/dist/src/lib/components/audio-player/index.d.ts +14 -0
  22. package/dist/src/lib/components/audio-player/raw-audio-player.d.ts +4 -0
  23. package/dist/src/lib/components/audio-player/simple-audio.d.ts +16 -0
  24. package/dist/src/lib/components/auto-image/index.d.ts +10 -0
  25. package/dist/src/lib/components/auto-image/single-image.d.ts +26 -0
  26. package/dist/src/lib/components/auto-tooltip/index.d.ts +18 -0
  27. package/dist/src/lib/components/auto-tooltip/title-tip.d.ts +9 -0
  28. package/dist/src/lib/components/bibtex-viewer/index.d.ts +5 -0
  29. package/dist/src/lib/components/card-wrapper/index.d.ts +2 -0
  30. package/dist/src/lib/components/card-wrapper/simple-card.d.ts +20 -0
  31. package/dist/src/lib/components/check-buttons/index.d.ts +10 -0
  32. package/dist/src/lib/components/collapse-container/headless-collapse.d.ts +9 -0
  33. package/dist/src/lib/components/collapse-container/index.d.ts +24 -0
  34. package/dist/src/lib/components/collapse-panel/index.d.ts +11 -0
  35. package/dist/src/lib/components/column-settings/index.d.ts +21 -0
  36. package/dist/src/lib/components/column-wrapper/index.d.ts +13 -0
  37. package/dist/src/lib/components/column-wrapper/use-wrapper-context.d.ts +17 -0
  38. package/dist/src/lib/components/command-viewer/index.d.ts +14 -0
  39. package/dist/src/lib/components/content-wrapper/index.d.ts +8 -0
  40. package/dist/src/lib/components/copy-button/index.d.ts +15 -0
  41. package/dist/src/lib/components/delete-modal/index.d.ts +2 -0
  42. package/dist/src/lib/components/divider-line/index.d.ts +2 -0
  43. package/dist/src/lib/components/doc-link/index.d.ts +6 -0
  44. package/dist/src/lib/components/drop-down-actions/index.d.ts +4 -0
  45. package/dist/src/lib/components/drop-down-buttons/index.d.ts +18 -0
  46. package/dist/src/lib/components/dynamic-form/components/field-item.d.ts +9 -0
  47. package/dist/src/lib/components/dynamic-form/components/form-widget.d.ts +6 -0
  48. package/dist/src/lib/components/dynamic-form/components/list-map.d.ts +17 -0
  49. package/dist/src/lib/components/dynamic-form/config/types.d.ts +39 -0
  50. package/dist/src/lib/components/dynamic-form/hooks/use-parse-fields.d.ts +7 -0
  51. package/dist/src/lib/components/dynamic-form/hooks/use-validate-fields.d.ts +10 -0
  52. package/dist/src/lib/components/dynamic-form/index.d.ts +8 -0
  53. package/dist/src/lib/components/echarts/bar-chart.d.ts +4 -0
  54. package/dist/src/lib/components/echarts/chart-tooltip.d.ts +7 -0
  55. package/dist/src/lib/components/echarts/chart.d.ts +10 -0
  56. package/dist/src/lib/components/echarts/config.d.ts +178 -0
  57. package/dist/src/lib/components/echarts/gauge.d.ts +4 -0
  58. package/dist/src/lib/components/echarts/h-bar.d.ts +6 -0
  59. package/dist/src/lib/components/echarts/index.d.ts +7 -0
  60. package/dist/src/lib/components/echarts/line-chart.d.ts +4 -0
  61. package/dist/src/lib/components/echarts/mix-line-bar.d.ts +9 -0
  62. package/dist/src/lib/components/echarts/scatter.d.ts +7 -0
  63. package/dist/src/lib/components/echarts/types.d.ts +44 -0
  64. package/dist/src/lib/components/editor-wrap/index.d.ts +14 -0
  65. package/dist/src/lib/components/empty-data/index.d.ts +6 -0
  66. package/dist/src/lib/components/error-message-content/index.d.ts +4 -0
  67. package/dist/src/lib/components/filter-form/index.d.ts +17 -0
  68. package/dist/src/lib/components/footer/index.d.ts +6 -0
  69. package/dist/src/lib/components/form/auto-complete.d.ts +9 -0
  70. package/dist/src/lib/components/form/base/select.d.ts +7 -0
  71. package/dist/src/lib/components/form/cascader.d.ts +10 -0
  72. package/dist/src/lib/components/form/checkbox-field.d.ts +10 -0
  73. package/dist/src/lib/components/form/checkbox.d.ts +7 -0
  74. package/dist/src/lib/components/form/components/label-info.d.ts +9 -0
  75. package/dist/src/lib/components/form/components/not-found-content.d.ts +7 -0
  76. package/dist/src/lib/components/form/config/components.d.ts +17 -0
  77. package/dist/src/lib/components/form/config/index.d.ts +7 -0
  78. package/dist/src/lib/components/form/field-component.d.ts +4 -0
  79. package/dist/src/lib/components/form/hooks/use-select-render.d.ts +11 -0
  80. package/dist/src/lib/components/form/input-number.d.ts +5 -0
  81. package/dist/src/lib/components/form/input-search.d.ts +5 -0
  82. package/dist/src/lib/components/form/input.d.ts +7 -0
  83. package/dist/src/lib/components/form/multiple-select.d.ts +7 -0
  84. package/dist/src/lib/components/form/password.d.ts +6 -0
  85. package/dist/src/lib/components/form/row-textarea.d.ts +36 -0
  86. package/dist/src/lib/components/form/select.d.ts +8 -0
  87. package/dist/src/lib/components/form/simple-select.d.ts +7 -0
  88. package/dist/src/lib/components/form/slider.d.ts +13 -0
  89. package/dist/src/lib/components/form/switch-input.d.ts +15 -0
  90. package/dist/src/lib/components/form/switch.d.ts +12 -0
  91. package/dist/src/lib/components/form/textarea.d.ts +9 -0
  92. package/dist/src/lib/components/form/types.d.ts +14 -0
  93. package/dist/src/lib/components/form/wrapper/auto-complete-label.d.ts +2 -0
  94. package/dist/src/lib/components/form/wrapper/index.d.ts +32 -0
  95. package/dist/src/lib/components/form/wrapper/input.d.ts +2 -0
  96. package/dist/src/lib/components/form/wrapper/select.d.ts +2 -0
  97. package/dist/src/lib/components/form/wrapper/slider.d.ts +2 -0
  98. package/dist/src/lib/components/form-buttons/index.d.ts +11 -0
  99. package/dist/src/lib/components/form-drawer/index.d.ts +13 -0
  100. package/dist/src/lib/components/grafana-icon/index.d.ts +6 -0
  101. package/dist/src/lib/components/highlight-code/code-viewer-dark.d.ts +13 -0
  102. package/dist/src/lib/components/highlight-code/code-viewer-light.d.ts +13 -0
  103. package/dist/src/lib/components/highlight-code/code-viewer.d.ts +14 -0
  104. package/dist/src/lib/components/highlight-code/index.d.ts +13 -0
  105. package/dist/src/lib/components/highlight-code/utils.d.ts +1 -0
  106. package/dist/src/lib/components/icon-font/icons.d.ts +153 -0
  107. package/dist/src/lib/components/icon-font/index.d.ts +7 -0
  108. package/dist/src/lib/components/image-editor/extract-image-colors.d.ts +10 -0
  109. package/dist/src/lib/components/image-editor/hooks/use-drawing.d.ts +66 -0
  110. package/dist/src/lib/components/image-editor/hooks/use-zoom.d.ts +21 -0
  111. package/dist/src/lib/components/image-editor/index.d.ts +30 -0
  112. package/dist/src/lib/components/image-editor/invert-worker.d.ts +1 -0
  113. package/dist/src/lib/components/image-editor/offscreen-worker.d.ts +1 -0
  114. package/dist/src/lib/components/image-editor/tools-bar.d.ts +28 -0
  115. package/dist/src/lib/components/index.d.ts +127 -0
  116. package/dist/src/lib/components/infinite-scroller/index.d.ts +6 -0
  117. package/dist/src/lib/components/infinite-scroller/infinite-scroller-provider.d.ts +7 -0
  118. package/dist/src/lib/components/infinite-scroller/use-infinite-scroll.d.ts +12 -0
  119. package/dist/src/lib/components/infinite-scroller/use-scroller-context.d.ts +10 -0
  120. package/dist/src/lib/components/label-cell/index.d.ts +6 -0
  121. package/dist/src/lib/components/label-selector/autocomplete-item.d.ts +27 -0
  122. package/dist/src/lib/components/label-selector/context.d.ts +15 -0
  123. package/dist/src/lib/components/label-selector/index.d.ts +15 -0
  124. package/dist/src/lib/components/label-selector/inner.d.ts +23 -0
  125. package/dist/src/lib/components/label-selector/label-item.d.ts +26 -0
  126. package/dist/src/lib/components/label-selector/label-selector-provider.d.ts +6 -0
  127. package/dist/src/lib/components/label-selector/wrapper.d.ts +17 -0
  128. package/dist/src/lib/components/list-input/hint-input.d.ts +13 -0
  129. package/dist/src/lib/components/list-input/index.d.ts +25 -0
  130. package/dist/src/lib/components/list-input/list-item.d.ts +21 -0
  131. package/dist/src/lib/components/logs-viewer/config.d.ts +4 -0
  132. package/dist/src/lib/components/logs-viewer/index.d.ts +14 -0
  133. package/dist/src/lib/components/logs-viewer/logs-list.d.ts +14 -0
  134. package/dist/src/lib/components/logs-viewer/logs-pagination.d.ts +12 -0
  135. package/dist/src/lib/components/logs-viewer/parse-worker.d.ts +1 -0
  136. package/dist/src/lib/components/logs-viewer/use-logs-pagination.d.ts +11 -0
  137. package/dist/src/lib/components/logs-viewer/use-size.d.ts +5 -0
  138. package/dist/src/lib/components/logs-viewer/xterm-viewer.d.ts +9 -0
  139. package/dist/src/lib/components/markdown-viewer/full-markdown.d.ts +7 -0
  140. package/dist/src/lib/components/markdown-viewer/index.d.ts +9 -0
  141. package/dist/src/lib/components/markdown-viewer/utils.d.ts +4 -0
  142. package/dist/src/lib/components/metadata-list/index.d.ts +16 -0
  143. package/dist/src/lib/components/modal-footer/index.d.ts +22 -0
  144. package/dist/src/lib/components/more-button/index.d.ts +8 -0
  145. package/dist/src/lib/components/no-result/index.d.ts +14 -0
  146. package/dist/src/lib/components/overlay-scroller/index.d.ts +26 -0
  147. package/dist/src/lib/components/page-breadcrumb/index.d.ts +4 -0
  148. package/dist/src/lib/components/page-tools/index.d.ts +56 -0
  149. package/dist/src/lib/components/popover/index.d.ts +3 -0
  150. package/dist/src/lib/components/progress-bar/index.d.ts +11 -0
  151. package/dist/src/lib/components/radio-buttons/index.d.ts +12 -0
  152. package/dist/src/lib/components/resize-container/index.d.ts +8 -0
  153. package/dist/src/lib/components/scroll-spy-tabs/index.d.ts +36 -0
  154. package/dist/src/lib/components/scroll-spy-tabs/use-field-scroll.d.ts +27 -0
  155. package/dist/src/lib/components/scroll-spy-tabs/use-finish-failed.d.ts +14 -0
  156. package/dist/src/lib/components/scroll-spy-tabs/use-scroll-active-change.d.ts +12 -0
  157. package/dist/src/lib/components/scroller-modal/gs-drawer.d.ts +9 -0
  158. package/dist/src/lib/components/scroller-modal/index.d.ts +5 -0
  159. package/dist/src/lib/components/scroller-modal/use-scroller-context.d.ts +6 -0
  160. package/dist/src/lib/components/segment-line/index.d.ts +9 -0
  161. package/dist/src/lib/components/select-panel/index.d.ts +15 -0
  162. package/dist/src/lib/components/select-panel/list.d.ts +16 -0
  163. package/dist/src/lib/components/select-panel/selected-list.d.ts +14 -0
  164. package/dist/src/lib/components/shortcut/index.d.ts +17 -0
  165. package/dist/src/lib/components/shortcut/keymap.d.ts +6 -0
  166. package/dist/src/lib/components/simple-overlay/index.d.ts +10 -0
  167. package/dist/src/lib/components/simple-table/header.d.ts +9 -0
  168. package/dist/src/lib/components/simple-table/index.d.ts +39 -0
  169. package/dist/src/lib/components/simple-table/info-column.d.ts +13 -0
  170. package/dist/src/lib/components/simple-table/row.d.ts +8 -0
  171. package/dist/src/lib/components/small-close-button/index.d.ts +5 -0
  172. package/dist/src/lib/components/speech-content/audio-player.d.ts +19 -0
  173. package/dist/src/lib/components/speech-content/index.d.ts +16 -0
  174. package/dist/src/lib/components/speech-content/speech-item.d.ts +20 -0
  175. package/dist/src/lib/components/status-icon/error.d.ts +4 -0
  176. package/dist/src/lib/components/status-tag/index.d.ts +33 -0
  177. package/dist/src/lib/components/table/components/cell-content.d.ts +4 -0
  178. package/dist/src/lib/components/table/components/header-prefix.d.ts +14 -0
  179. package/dist/src/lib/components/table/components/header.d.ts +11 -0
  180. package/dist/src/lib/components/table/components/layout.d.ts +21 -0
  181. package/dist/src/lib/components/table/components/pagination.d.ts +3 -0
  182. package/dist/src/lib/components/table/components/row-children.d.ts +2 -0
  183. package/dist/src/lib/components/table/components/row-prefix.d.ts +12 -0
  184. package/dist/src/lib/components/table/components/table-body.d.ts +21 -0
  185. package/dist/src/lib/components/table/components/table-cell.d.ts +4 -0
  186. package/dist/src/lib/components/table/components/table-header.d.ts +4 -0
  187. package/dist/src/lib/components/table/components/table-row.d.ts +4 -0
  188. package/dist/src/lib/components/table/components/table-skeleton.d.ts +3 -0
  189. package/dist/src/lib/components/table/index.d.ts +7 -0
  190. package/dist/src/lib/components/table/row-context.d.ts +11 -0
  191. package/dist/src/lib/components/table/table-context.d.ts +3 -0
  192. package/dist/src/lib/components/table/table-provider.d.ts +9 -0
  193. package/dist/src/lib/components/table/table-row-provider.d.ts +6 -0
  194. package/dist/src/lib/components/table/types.d.ts +106 -0
  195. package/dist/src/lib/components/table/use-sorter.d.ts +11 -0
  196. package/dist/src/lib/components/tags-wrapper/index.d.ts +8 -0
  197. package/dist/src/lib/components/tags-wrapper/more-dropdown.d.ts +6 -0
  198. package/dist/src/lib/components/tags-wrapper/theme-tag.d.ts +6 -0
  199. package/dist/src/lib/components/templates/card-list.d.ts +12 -0
  200. package/dist/src/lib/components/templates/card-skeleton.d.ts +7 -0
  201. package/dist/src/lib/components/templates/card.d.ts +17 -0
  202. package/dist/src/lib/components/terminal-tabs/index.d.ts +11 -0
  203. package/dist/src/lib/components/terminal-tabs/resize-container.d.ts +15 -0
  204. package/dist/src/lib/components/terminal-tabs/tabs.d.ts +9 -0
  205. package/dist/src/lib/components/terminal-tabs/types.d.ts +4 -0
  206. package/dist/src/lib/components/thumb-image/index.d.ts +20 -0
  207. package/dist/src/lib/components/tooltip-list/index.d.ts +9 -0
  208. package/dist/src/lib/components/transfer/index.d.ts +14 -0
  209. package/dist/src/lib/components/transition/index.d.ts +10 -0
  210. package/dist/src/lib/components/upload-audio/index.d.ts +16 -0
  211. package/dist/src/lib/components/upload-image/index.d.ts +20 -0
  212. package/dist/src/lib/components/viewer-editor/index.d.ts +15 -0
  213. package/dist/src/lib/components/x-terminal/index.d.ts +8 -0
  214. package/dist/src/lib/components/yaml-editor/editor.d.ts +15 -0
  215. package/dist/src/lib/components/yaml-editor/index.d.ts +17 -0
  216. package/dist/src/lib/config/hotkeys.d.ts +40 -0
  217. package/dist/src/lib/config/index.d.ts +20 -0
  218. package/dist/src/lib/constants/index.d.ts +6 -0
  219. package/dist/src/lib/context/CoreUIContext.d.ts +83 -0
  220. package/dist/src/lib/context/CoreUIProvider.d.ts +4 -0
  221. package/dist/src/lib/hooks/index.d.ts +23 -0
  222. package/dist/src/lib/hooks/json-parser-worker.d.ts +1 -0
  223. package/dist/src/lib/hooks/use-actions.d.ts +11 -0
  224. package/dist/src/lib/hooks/use-add-image.d.ts +15 -0
  225. package/dist/src/lib/hooks/use-app-utils.d.ts +6 -0
  226. package/dist/src/lib/hooks/use-body-scroll.d.ts +5 -0
  227. package/dist/src/lib/hooks/use-chunk-fetch.d.ts +20 -0
  228. package/dist/src/lib/hooks/use-chunk-request.d.ts +20 -0
  229. package/dist/src/lib/hooks/use-container-scroll.d.ts +7 -0
  230. package/dist/src/lib/hooks/use-deferred-request.d.ts +1 -0
  231. package/dist/src/lib/hooks/use-download-logs.d.ts +8 -0
  232. package/dist/src/lib/hooks/use-download-stream.d.ts +12 -0
  233. package/dist/src/lib/hooks/use-esc-hint.d.ts +7 -0
  234. package/dist/src/lib/hooks/use-expanded-row-keys.d.ts +10 -0
  235. package/dist/src/lib/hooks/use-overlay-scroller.d.ts +45 -0
  236. package/dist/src/lib/hooks/use-query-data-list.d.ts +35 -0
  237. package/dist/src/lib/hooks/use-request-token.d.ts +13 -0
  238. package/dist/src/lib/hooks/use-responsive.d.ts +10 -0
  239. package/dist/src/lib/hooks/use-stream-core/buffer-queue.d.ts +8 -0
  240. package/dist/src/lib/hooks/use-stream-core/fetch-stream.d.ts +1 -0
  241. package/dist/src/lib/hooks/use-stream-core/speed-monitor.d.ts +8 -0
  242. package/dist/src/lib/hooks/use-stream-core/stream-processor.d.ts +18 -0
  243. package/dist/src/lib/hooks/use-stream-core/use-chunk-fetch.d.ts +7 -0
  244. package/dist/src/lib/hooks/use-table-row-selection.d.ts +12 -0
  245. package/dist/src/lib/hooks/use-table-sort.d.ts +17 -0
  246. package/dist/src/lib/hooks/use-update-chunk-list.d.ts +26 -0
  247. package/dist/src/lib/hooks/use-watch-list.d.ts +4 -0
  248. package/dist/src/lib/hooks/use-window-resize.d.ts +10 -0
  249. package/dist/src/lib/hooks/useCoreUIContext.d.ts +2 -0
  250. package/dist/src/lib/hooks/useIntl.d.ts +7 -0
  251. package/dist/src/lib/index.d.ts +6 -0
  252. package/dist/src/lib/types/index.d.ts +40 -0
  253. package/dist/src/lib/types/table-fetch.d.ts +71 -0
  254. package/dist/src/lib/utils/download-stream.d.ts +1 -0
  255. package/dist/src/lib/utils/epub-reader.d.ts +1 -0
  256. package/dist/src/lib/utils/excel-reader.d.ts +19 -0
  257. package/dist/src/lib/utils/fetch-chunk-data.d.ts +55 -0
  258. package/dist/src/lib/utils/index.d.ts +52 -0
  259. package/dist/src/lib/utils/load-audio-file.d.ts +14 -0
  260. package/dist/src/lib/utils/pcm-to-wav.d.ts +9 -0
  261. package/dist/src/lib/utils/pdf-reader.d.ts +2 -0
  262. package/dist/src/lib/utils/pptx-reader.d.ts +2 -0
  263. package/dist/src/lib/utils/read-html.d.ts +1 -0
  264. package/dist/src/lib/utils/watch-request.d.ts +18 -0
  265. package/dist/src/lib/utils/word-reader.d.ts +1 -0
  266. package/package.json +138 -0
@@ -0,0 +1,40 @@
1
+ export type StatusType = 'error' | 'warning' | 'transitioning' | 'success' | 'inactive';
2
+ type SchemaType = 'Input' | 'InputNumber' | 'TextArea' | 'Select' | 'Slider' | 'Textarea' | 'Checkbox' | 'Switch' | 'AutoComplete';
3
+ export interface ParamsSchema {
4
+ type: SchemaType;
5
+ name: string;
6
+ label: {
7
+ text: string;
8
+ isLocalized?: boolean;
9
+ };
10
+ initAttrs?: (meta: any) => Record<string, any>;
11
+ dependencies?: string[];
12
+ style?: React.CSSProperties;
13
+ options?: Global.BaseOption<string | number | null>[];
14
+ value?: string | number | boolean | string[];
15
+ min?: number;
16
+ max?: number;
17
+ step?: number;
18
+ disabled?: boolean;
19
+ disabledConfig?: {
20
+ depends: string[];
21
+ when: (values: Record<string, any>) => boolean;
22
+ };
23
+ defaultValue?: string | number | boolean;
24
+ required?: boolean;
25
+ rules: {
26
+ required: boolean;
27
+ message?: string;
28
+ formatter?: (value: any) => any;
29
+ }[];
30
+ placeholder?: React.ReactNode;
31
+ attrs?: Record<string, any>;
32
+ formItemAttrs?: Record<string, any>;
33
+ description?: {
34
+ text: string;
35
+ html?: boolean;
36
+ isLocalized?: boolean;
37
+ isLink?: boolean;
38
+ };
39
+ }
40
+ export {};
@@ -0,0 +1,71 @@
1
+ type WatchConfig = {
2
+ watch?: false | undefined;
3
+ API?: string;
4
+ polling?: boolean;
5
+ } | {
6
+ watch: true;
7
+ API: string;
8
+ polling?: false | undefined;
9
+ } | {
10
+ polling: true;
11
+ watch: false | undefined;
12
+ API?: string;
13
+ };
14
+ type SortDirection = 'ascend' | 'descend' | null;
15
+ type EventsType = 'CREATE' | 'UPDATE' | 'DELETE' | 'INSERT';
16
+ export type UseTableFetchOptions<T> = {
17
+ key?: string;
18
+ fetchAPI: (params: any, options?: any) => Promise<Global.PageResponse<T>>;
19
+ deleteAPI?: (id: number, params?: any) => Promise<any>;
20
+ contentForDelete?: string;
21
+ defaultData?: any[];
22
+ events?: EventsType[];
23
+ defaultQueryParams?: Record<string, any>;
24
+ isInfiniteScroll?: boolean;
25
+ updateManually?: boolean;
26
+ } & WatchConfig;
27
+ export type UseTableFetchReturn<T> = {
28
+ dataSource: {
29
+ dataList: T[];
30
+ loading: boolean;
31
+ loadend: boolean;
32
+ total: number;
33
+ totalPage: number;
34
+ };
35
+ rowSelection: ReturnType<typeof import('../hooks/use-table-row-selection').default>;
36
+ sortOrder: ReturnType<typeof import('../hooks/use-table-sort').useTableMultiSort>['sortOrder'];
37
+ queryParams: {
38
+ page: number;
39
+ perPage: number;
40
+ search: string;
41
+ sort_by: string;
42
+ [key: string]: any;
43
+ };
44
+ modalRef: React.MutableRefObject<any>;
45
+ extraStatus: Record<string, any>;
46
+ TABLE_SORT_DIRECTIONS: SortDirection[];
47
+ debounceFetchData: () => void;
48
+ setDataSource: React.Dispatch<React.SetStateAction<UseTableFetchReturn<T>['dataSource']>>;
49
+ setQueryParams: React.Dispatch<React.SetStateAction<UseTableFetchReturn<T>['queryParams']>>;
50
+ handleDelete: (row: T & {
51
+ name: string;
52
+ id: number;
53
+ }, options?: any) => void;
54
+ handleDeleteBatch: (options?: any) => void;
55
+ fetchData: (externalParams?: {
56
+ query: Record<string, any>;
57
+ loadmore?: boolean;
58
+ }, polling?: boolean) => Promise<boolean>;
59
+ handlePageChange: (page: number, pageSize: number) => void;
60
+ handleTableChange: (pagination: any, filters: any, sorter: any, extra: any) => void;
61
+ handleSearch: () => void;
62
+ handleQueryChange: (params: any, options?: {
63
+ paginate?: boolean;
64
+ }) => Promise<void>;
65
+ loadMore: (nextPage: number) => void;
66
+ cancelChunkRequest: () => void;
67
+ createTableListChunkRequest: (params?: any) => Promise<void>;
68
+ handleNameChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
69
+ };
70
+ export type TableFetchType = <T>(options: UseTableFetchOptions<T>) => UseTableFetchReturn<T>;
71
+ export {};
@@ -0,0 +1 @@
1
+ export declare const downloadFile: (blob: Blob, filename: string) => void;
@@ -0,0 +1 @@
1
+ export default function readEpubContent(file: File): Promise<string>;
@@ -0,0 +1,19 @@
1
+ export default function readExcelContent(file: File): Promise<string>;
2
+ interface FormatMap {
3
+ [key: string]: (value: any, row?: any) => any;
4
+ }
5
+ /**
6
+ * @param jsonData raw JSON data to export
7
+ * @param fields export fields (keys in the JSON objects)
8
+ * @param fieldLabels custom the table header labels
9
+ * @param formatMap custom the cell format functions
10
+ * @param fileName file name for the exported Excel file
11
+ */
12
+ export declare function exportJsonToExcel(data: {
13
+ jsonData: any[];
14
+ fields: string[];
15
+ fieldLabels?: Record<string, string>;
16
+ formatMap?: FormatMap;
17
+ fileName: string;
18
+ }): void;
19
+ export {};
@@ -0,0 +1,55 @@
1
+ export declare const errorHandler: (res: Response) => Promise<{
2
+ error: boolean;
3
+ data: any;
4
+ message?: undefined;
5
+ } | {
6
+ error: boolean;
7
+ message: string;
8
+ data?: undefined;
9
+ }>;
10
+ /**
11
+ *
12
+ * @param params data: for post request, params: for get request
13
+ * @returns
14
+ */
15
+ export declare const fetchChunkedData: (params: {
16
+ data?: any;
17
+ url: string;
18
+ params?: any;
19
+ signal?: AbortSignal;
20
+ method?: string;
21
+ headers?: any;
22
+ }) => Promise<{
23
+ error: boolean;
24
+ data: any;
25
+ message?: undefined;
26
+ } | {
27
+ error: boolean;
28
+ message: string;
29
+ data?: undefined;
30
+ } | {
31
+ reader: ReadableStreamDefaultReader<Uint8Array<ArrayBuffer>> | undefined;
32
+ decoder: TextDecoder;
33
+ }>;
34
+ export declare const createFormData: (data: any) => FormData;
35
+ export declare const fetchChunkedDataPostFormData: (params: {
36
+ data?: any;
37
+ url: string;
38
+ params?: any;
39
+ signal?: AbortSignal;
40
+ method?: string;
41
+ headers?: any;
42
+ }) => Promise<{
43
+ error: boolean;
44
+ data: any;
45
+ message?: undefined;
46
+ } | {
47
+ error: boolean;
48
+ message: string;
49
+ data?: undefined;
50
+ } | {
51
+ reader: ReadableStreamDefaultReader<Uint8Array<ArrayBuffer>> | undefined;
52
+ decoder: TextDecoder;
53
+ }>;
54
+ export declare const readStreamData: (reader: ReadableStreamDefaultReader<Uint8Array>, decoder: TextDecoder, callback: (data: any[]) => void, throttleDelay?: number) => Promise<void>;
55
+ export declare const readLargeStreamData: (reader: any, decoder: TextDecoder, callback: (data: any, done?: boolean) => void, throttleDelay?: number) => Promise<void>;
@@ -0,0 +1,52 @@
1
+ export declare const isNotEmptyValue: (value: any) => boolean;
2
+ export declare const isNotEmptyValueAllowNull: (value: any) => boolean;
3
+ export declare const handleBatchRequest: (list: any[], fn: (args: any) => void) => Promise<PromiseSettledResult<void>[]>;
4
+ export declare const convertFileSize: (sizeInBytes: number, prec?: number, allowEmpty?: boolean) => string | number;
5
+ export declare const convertFileSizeByUnit: (params: {
6
+ sizeInBytes: number;
7
+ defaultUnit?: "B" | "KiB" | "MiB" | "GiB" | "TiB";
8
+ allowEmpty?: boolean;
9
+ }) => string | number;
10
+ export declare const platformCall: () => {
11
+ isMac: boolean;
12
+ isWin: boolean;
13
+ };
14
+ export declare const formatTime: (seconds: number) => string;
15
+ export declare const formatNumber: (num: number) => string;
16
+ export declare const formatLargeNumber: (value: number) => string | number;
17
+ export declare function loadLanguageConfig(language: string): Record<string, string>;
18
+ export declare function readBlob(blob: Blob): Promise<string>;
19
+ export declare const cosineSimilarity: (vec1: number[], vec2: number[]) => number;
20
+ export declare const isHTMLDocumentString: (str: string) => boolean;
21
+ export declare const generateRandomNumber: () => number;
22
+ export declare const base64ToFile: (base64String: string, fileName: string) => File | null;
23
+ export declare const isOnline: () => boolean;
24
+ export declare const genColors: ({ color, alpha1, alpha2 }: {
25
+ color: string;
26
+ alpha1?: number;
27
+ alpha2?: number;
28
+ }) => any[];
29
+ /**
30
+ * Parse a command-line parameter string into an array format.
31
+ * @param paramsString - The parameter string to parse (supports multiline).
32
+ * @returns An array of parameters, e.g. ['--param=value', '--flag']
33
+ *
34
+ * @example
35
+ * parseParamsString('--foo=bar --baz 123 --flag')
36
+ * // Returns: ['--foo=bar', '--baz=123', '--flag']
37
+ *
38
+ * parseParamsString(`--foo bar
39
+ * --baz=123`)
40
+ * // Returns: ['--foo=bar', '--baz=123']
41
+ */
42
+ export declare const parseParamsString: (paramsString: string) => string[];
43
+ export { downloadFile } from './download-stream';
44
+ export { default as readEpubContent } from './epub-reader';
45
+ export { exportJsonToExcel, default as readExcelContent } from './excel-reader';
46
+ export { createFormData, errorHandler, fetchChunkedData, fetchChunkedDataPostFormData, readLargeStreamData, readStreamData } from './fetch-chunk-data';
47
+ export { convertFileToBase64, loadAudioData, readAudioFile } from './load-audio-file';
48
+ export { pcmToWav } from './pcm-to-wav';
49
+ export { default as readPDFContent } from './pdf-reader';
50
+ export { default as readPptxContent } from './pptx-reader';
51
+ export { default as readHtmlContent } from './read-html';
52
+ export { default as readWordContent } from './word-reader';
@@ -0,0 +1,14 @@
1
+ export declare const audioTypeMap: Record<string, string>;
2
+ export declare const convertFileToBase64: (file: File) => Promise<string>;
3
+ export declare const loadAudioData: (data: any, type: string) => Promise<{
4
+ data: Blob;
5
+ size: number | string;
6
+ type: string;
7
+ duration: number;
8
+ url: string;
9
+ }>;
10
+ export declare const readAudioFile: (file: File) => Promise<{
11
+ url: string;
12
+ name: string;
13
+ duration: number;
14
+ }>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Convert PCM audio data to WAV format
3
+ * @param pcmData - Raw PCM audio data as ArrayBuffer
4
+ * @param sampleRate - Sample rate (default: 24000 Hz, common for TTS)
5
+ * @param numChannels - Number of channels (default: 1 for mono)
6
+ * @param bitsPerSample - Bits per sample (default: 16)
7
+ * @returns WAV format audio as Blob
8
+ */
9
+ export declare function pcmToWav(pcmData: ArrayBuffer, sampleRate?: number, numChannels?: number, bitsPerSample?: number): Blob;
@@ -0,0 +1,2 @@
1
+ declare const readPDFContent: (file: File) => Promise<string>;
2
+ export default readPDFContent;
@@ -0,0 +1,2 @@
1
+ declare const readPptxContent: (file: File) => Promise<string>;
2
+ export default readPptxContent;
@@ -0,0 +1 @@
1
+ export default function readHtmlContent(file: File): Promise<string>;
@@ -0,0 +1,18 @@
1
+ interface WatchRequest {
2
+ id: number;
3
+ token: any;
4
+ cancel: () => void;
5
+ }
6
+ declare global {
7
+ interface Window {
8
+ __GPUSTACK_WATCH_REQUEST_CLEAR__: {
9
+ watchIDValue: number;
10
+ requestList: WatchRequest[];
11
+ };
12
+ }
13
+ }
14
+ export declare const updateWatchIDValue: () => number;
15
+ export declare const updateWatchRequest: (watchToken: WatchRequest) => void;
16
+ export declare const cancelWatchRequest: (n: number) => void;
17
+ export declare const clearWatchRequestId: (id: number) => void;
18
+ export {};
@@ -0,0 +1 @@
1
+ export default function readWordContent(file: File): Promise<string>;
package/package.json ADDED
@@ -0,0 +1,138 @@
1
+ {
2
+ "name": "@gpustack/core-ui",
3
+ "version": "1.0.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/src/index.d.ts",
9
+ "import": "./dist/index.es.js",
10
+ "require": "./dist/index.cjs.js"
11
+ },
12
+ "./style.css": "./dist/index.css"
13
+ },
14
+ "main": "./dist/index.cjs.js",
15
+ "module": "./dist/index.es.js",
16
+ "types": "./dist/src/index.d.ts",
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "scripts": {
21
+ "build": "pnpm clean && vite build",
22
+ "build:watch": "vite build --watch",
23
+ "clean": "rimraf dist",
24
+ "dev": "vite",
25
+ "lint": "eslint .",
26
+ "prepare": "husky",
27
+ "prepublishOnly": "pnpm build",
28
+ "preview": "vite preview",
29
+ "typecheck": "tsc -p tsconfig.app.json --noEmit"
30
+ },
31
+ "lint-staged": {
32
+ "*.{ts,tsx,js,jsx}": [
33
+ "eslint --fix",
34
+ "prettier --write"
35
+ ],
36
+ "*.{css,less,json}": [
37
+ "prettier --write"
38
+ ]
39
+ },
40
+ "dependencies": {
41
+ "@braintree/sanitize-url": "^7.1.1",
42
+ "@monaco-editor/react": "^4.6.0",
43
+ "@orcid/bibtex-parse-js": "^0.0.25",
44
+ "@xterm/addon-fit": "^0.10.0",
45
+ "@xterm/xterm": "^5.5.0",
46
+ "classnames": "^2.5.1",
47
+ "dayjs": "^1.11.20",
48
+ "dompurify": "^3.2.6",
49
+ "echarts": "^5.5.1",
50
+ "epubjs": "^0.3.93",
51
+ "file-saver": "^2.0.5",
52
+ "highlight.js": "^11.10.0",
53
+ "jszip": "^3.10.1",
54
+ "katex": "^0.16.21",
55
+ "lamejs": "github:zhuker/lamejs",
56
+ "mammoth": "^1.8.0",
57
+ "marked": "^14.1.0",
58
+ "monaco-editor": "^0.30.1",
59
+ "monaco-yaml": "^4.0.0",
60
+ "overlayscrollbars-react": "^0.5.6",
61
+ "pdfjs-dist": "^4.7.76",
62
+ "query-string": "9",
63
+ "rc-resize-observer": "^1.4.3",
64
+ "re-resizable": "^6.10.1",
65
+ "react-hotkeys-hook": "^4.5.0",
66
+ "react-intersection-observer": "^9.16.0",
67
+ "react-markdown": "^9.0.3",
68
+ "rehype-katex": "^7.0.1",
69
+ "remark-breaks": "^4.0.0",
70
+ "remark-gfm": "^4.0.1",
71
+ "remark-math": "^6.0.0",
72
+ "simplebar-react": "^3.2.6",
73
+ "tinycolor2": "^1.6.0",
74
+ "wavesurfer.js": "^7.8.8",
75
+ "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
76
+ },
77
+ "devDependencies": {
78
+ "@ant-design/icons": ">=6.0.0",
79
+ "@eslint/js": "^9.39.4",
80
+ "@types/lodash": "^4.17.24",
81
+ "@types/node": "^25.0.3",
82
+ "@types/react": "^18.3.1",
83
+ "@types/react-dom": "^18.3.0",
84
+ "@typescript-eslint/eslint-plugin": "^8.58.1",
85
+ "@typescript-eslint/parser": "^8.58.1",
86
+ "@vitejs/plugin-react": "^6.0.1",
87
+ "ahooks": ">=3.0.0",
88
+ "antd": ">=6.0.0",
89
+ "antd-style": ">=3.0.0",
90
+ "axios": ">=1.8.0",
91
+ "echarts": ">=5.0.0",
92
+ "eslint": "^9.39.4",
93
+ "eslint-config-prettier": "^10.1.8",
94
+ "eslint-import-resolver-typescript": "^4.4.4",
95
+ "eslint-plugin-import": "^2.32.0",
96
+ "eslint-plugin-react": "^7.37.5",
97
+ "eslint-plugin-react-hooks": "^7.0.1",
98
+ "eslint-plugin-react-refresh": "^0.5.2",
99
+ "eslint-plugin-unused-imports": "^4.4.1",
100
+ "globals": "^17.4.0",
101
+ "husky": "^9.1.7",
102
+ "less": "^4.6.4",
103
+ "lint-staged": "^16.4.0",
104
+ "lodash": ">=4.0.0",
105
+ "postcss-less": "^6.0.0",
106
+ "prettier": "^3.8.2",
107
+ "prettier-plugin-organize-imports": "^3.2.4",
108
+ "prettier-plugin-packagejson": "^2.5.0",
109
+ "prettier-plugin-two-style-order": "^1.0.1",
110
+ "react": ">=18.0.0",
111
+ "react-dom": ">=18.0.0",
112
+ "rimraf": "^6.1.3",
113
+ "styled-components": ">=6.0.0",
114
+ "stylelint": "^17.6.0",
115
+ "stylelint-config-standard": "^40.0.0",
116
+ "stylelint-less": "^4.1.0",
117
+ "typescript": "~6.0.2",
118
+ "typescript-eslint": "^8.58.0",
119
+ "vite": "^8.0.8",
120
+ "vite-plugin-dts": "^4.5.4"
121
+ },
122
+ "peerDependencies": {
123
+ "@ant-design/icons": ">=6.0.0",
124
+ "ahooks": ">=3.0.0",
125
+ "antd": ">=6.0.0",
126
+ "antd-style": ">=3.0.0",
127
+ "axios": ">=1.8.0",
128
+ "echarts": ">=5.0.0",
129
+ "lodash": ">=4.0.0",
130
+ "react": ">=18.0.0",
131
+ "react-dom": ">=18.0.0",
132
+ "styled-components": ">=6.0.0"
133
+ },
134
+ "publishConfig": {
135
+ "access": "public",
136
+ "registry": "https://registry.npmjs.org/"
137
+ }
138
+ }