@rsdoctor/components 0.4.13 → 1.0.0-alpha.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 (191) hide show
  1. package/dist/common/imgs/connection-point.js +11 -0
  2. package/dist/common/imgs/webpack.js +11 -0
  3. package/dist/common/svg/bundle-size.js +11 -0
  4. package/dist/common/svg/error.js +10 -0
  5. package/dist/common/svg/file-css.js +11 -0
  6. package/dist/common/svg/file-html.js +11 -0
  7. package/dist/common/svg/file-image.js +11 -0
  8. package/dist/common/svg/file-js.js +11 -0
  9. package/dist/common/svg/file-unknown.js +11 -0
  10. package/dist/common/svg/file.js +10 -0
  11. package/dist/common/svg/files/css.js +11 -0
  12. package/dist/common/svg/files/html.js +11 -0
  13. package/dist/common/svg/files/image.js +11 -0
  14. package/dist/common/svg/files/js.js +11 -0
  15. package/dist/common/svg/files/unkown-file.js +11 -0
  16. package/dist/common/svg/loader/input.js +11 -0
  17. package/dist/common/svg/loader/output.js +12 -0
  18. package/dist/common/svg/loader/step.js +7 -0
  19. package/dist/common/svg/navbar/bundle-size-active.js +10 -0
  20. package/dist/common/svg/navbar/bundle-size-inactive.js +10 -0
  21. package/dist/common/svg/navbar/compile-analysis-active.js +11 -0
  22. package/dist/common/svg/navbar/compile-analysis-inactive.js +11 -0
  23. package/dist/common/svg/navbar/overall-active.js +11 -0
  24. package/dist/common/svg/navbar/overall-inactive.js +11 -0
  25. package/dist/common/svg/output.js +12 -0
  26. package/dist/common/svg/source-size.js +12 -0
  27. package/dist/common/svg/source.js +10 -0
  28. package/dist/common/svg/total-size.js +11 -0
  29. package/dist/common/svg/version.js +11 -0
  30. package/dist/components/Alert/ecma-version-check.d.ts +2 -0
  31. package/dist/components/Alert/ecma-version-check.js +69 -0
  32. package/dist/components/Alert/ecma-version-check.module.js +5 -0
  33. package/dist/components/Alert/ecma-version-check_module.css +23 -0
  34. package/dist/components/Alert/package-relation.d.ts +1 -2
  35. package/dist/components/Alert/package-relation.js +29 -59
  36. package/dist/components/Alert/package-relation.module.js +5 -0
  37. package/dist/components/Alert/package-relation_module.css +23 -0
  38. package/dist/components/Alert/types.d.ts +6 -1
  39. package/dist/components/Alerts/{common.d.ts → bundle-alert.d.ts} +3 -4
  40. package/dist/components/Alerts/bundle-alert.js +156 -0
  41. package/dist/components/Alerts/bundle-alert.module.js +5 -0
  42. package/dist/components/Alerts/bundle-alert_module.css +46 -0
  43. package/dist/components/Alerts/bundle.js +25 -6
  44. package/dist/components/Alerts/collapse.d.ts +6 -0
  45. package/dist/components/Alerts/collapse.js +209 -0
  46. package/dist/components/Alerts/collapse.module.js +5 -0
  47. package/dist/components/Alerts/collapse_module.css +71 -0
  48. package/dist/components/Alerts/compile.js +18 -5
  49. package/dist/components/Alerts/list.d.ts +4 -0
  50. package/dist/components/Alerts/list.js +25 -0
  51. package/dist/components/Alerts/list.module.js +5 -0
  52. package/dist/components/Alerts/list_module.css +5 -0
  53. package/dist/components/Alerts/overlay.js +67 -28
  54. package/dist/components/Alerts/overlay.module.js +5 -0
  55. package/dist/components/Alerts/overlay_module.css +11 -0
  56. package/dist/components/Card/index.d.ts +1 -1
  57. package/dist/components/Card/index.js +8 -18
  58. package/dist/components/Card/size.d.ts +1 -0
  59. package/dist/components/Card/size.js +99 -65
  60. package/dist/components/Card/size.module.js +5 -0
  61. package/dist/components/Card/size_module.css +34 -0
  62. package/dist/components/Card/statistic.d.ts +0 -2
  63. package/dist/components/Card/statistic.js +7 -5
  64. package/dist/components/Charts/TimelineCharts/index.d.ts +6 -1
  65. package/dist/components/Charts/TimelineCharts/index.js +208 -192
  66. package/dist/components/Charts/bootstrap.js +15 -10
  67. package/dist/components/Charts/common.d.ts +2 -0
  68. package/dist/components/Charts/common.js +18 -5
  69. package/dist/components/Charts/constants.d.ts +8 -1
  70. package/dist/components/Charts/constants.js +37 -41
  71. package/dist/components/Charts/done.js +14 -9
  72. package/dist/components/Charts/index.js +1 -1
  73. package/dist/components/Charts/loader.js +12 -2
  74. package/dist/components/Charts/minify.js +14 -9
  75. package/dist/components/Charts/utils.js +2 -2
  76. package/dist/components/CodeViewer/diff.js +8 -2
  77. package/dist/components/CodeViewer/viewer.js +0 -7
  78. package/dist/components/Configuration/builder.js +50 -36
  79. package/dist/components/Configuration/builder.module.js +5 -0
  80. package/dist/components/Configuration/builder_module.css +6 -0
  81. package/dist/components/FileTree/css.js +11 -0
  82. package/dist/components/FileTree/html.js +11 -0
  83. package/dist/components/FileTree/image.js +11 -0
  84. package/dist/components/FileTree/index.css +8 -0
  85. package/dist/components/FileTree/index.d.ts +1 -0
  86. package/dist/components/FileTree/index.js +65 -5
  87. package/dist/components/FileTree/js.js +11 -0
  88. package/dist/components/FileTree/unkown-file.js +11 -0
  89. package/dist/components/Form/keyword.js +3 -2
  90. package/dist/components/Keyword/index.js +38 -14
  91. package/dist/components/Keyword/style.module.js +5 -0
  92. package/dist/components/Keyword/style_module.css +5 -0
  93. package/dist/components/Layout/builder-select.js +37 -24
  94. package/dist/components/Layout/bundle-size-icon.js +10 -0
  95. package/dist/components/Layout/compile-icon.js +11 -0
  96. package/dist/components/Layout/header.js +3 -15
  97. package/dist/components/Layout/menus.js +59 -64
  98. package/dist/components/Layout/overall-icon.js +10 -0
  99. package/dist/components/Layout/progress.js +2 -1
  100. package/dist/components/Loader/Analysis/files.js +187 -101
  101. package/dist/components/Loader/Analysis/index.js +34 -17
  102. package/dist/components/Loader/Analysis/input.js +11 -0
  103. package/dist/components/Loader/Analysis/output.js +12 -0
  104. package/dist/components/Loader/Analysis/style.module.js +5 -0
  105. package/dist/components/Loader/Analysis/style_module.css +73 -0
  106. package/dist/components/Loader/executions.js +95 -114
  107. package/dist/components/Loader/step.js +7 -0
  108. package/dist/components/Opener/code.js +2 -1
  109. package/dist/components/Overall/DataSummary.d.ts +8 -0
  110. package/dist/components/Overall/DataSummary.js +25 -0
  111. package/dist/components/Overall/DataSummary.module.js +5 -0
  112. package/dist/components/Overall/DataSummary_module.css +95 -0
  113. package/dist/components/Overall/bundle.d.ts +6 -1
  114. package/dist/components/Overall/bundle.js +208 -112
  115. package/dist/components/Overall/bundle.module.js +5 -0
  116. package/dist/components/Overall/bundle_module.css +62 -0
  117. package/dist/components/Overall/card_module.css +1 -4
  118. package/dist/components/Overall/compile.js +47 -41
  119. package/dist/components/Overall/compile.module.js +1 -1
  120. package/dist/components/Overall/compile_module.css +6 -0
  121. package/dist/components/Overall/help-center.d.ts +1 -0
  122. package/dist/components/Overall/help-center.js +86 -0
  123. package/dist/components/Overall/help-center.module.js +5 -0
  124. package/dist/components/Overall/help-center_module.css +35 -0
  125. package/dist/components/Overall/list.module.js +1 -1
  126. package/dist/components/Overall/list_module.css +14 -4
  127. package/dist/components/Overall/overview.d.ts +8 -0
  128. package/dist/components/Overall/overview.js +17 -0
  129. package/dist/components/Overall/overview.module.js +5 -0
  130. package/dist/components/Overall/overview_module.css +25 -0
  131. package/dist/components/Overall/project.d.ts +0 -1
  132. package/dist/components/Overall/project.js +101 -36
  133. package/dist/components/Overall/project.module.js +5 -0
  134. package/dist/components/Overall/project_module.css +19 -0
  135. package/dist/components/Select/index.css +6 -0
  136. package/dist/components/Select/index.d.ts +1 -0
  137. package/dist/components/Select/index.js +7 -4
  138. package/dist/components/TextDrawer/index.d.ts +2 -1
  139. package/dist/components/TextDrawer/index.js +38 -27
  140. package/dist/components/index.d.ts +0 -1
  141. package/dist/components/index.js +0 -1
  142. package/dist/constants.d.ts +1 -1
  143. package/dist/constants.js +1 -1
  144. package/dist/pages/BundleSize/components/asset.js +106 -124
  145. package/dist/pages/BundleSize/components/card.module.js +5 -0
  146. package/dist/pages/BundleSize/components/card_module.css +54 -0
  147. package/dist/pages/BundleSize/components/cards.js +157 -47
  148. package/dist/pages/BundleSize/components/index.js +129 -121
  149. package/dist/pages/BundleSize/components/index.module.js +5 -0
  150. package/dist/pages/BundleSize/components/index_module.css +82 -0
  151. package/dist/pages/ModuleAnalyze/components/fileTreeCom.css +13 -0
  152. package/dist/pages/ModuleAnalyze/components/fileTreeCom.d.ts +1 -1
  153. package/dist/pages/ModuleAnalyze/components/fileTreeCom.js +40 -63
  154. package/dist/pages/ModuleAnalyze/fileTree.d.ts +1 -0
  155. package/dist/pages/ModuleAnalyze/fileTree.js +36 -164
  156. package/dist/pages/ModuleAnalyze/index.css +7 -3
  157. package/dist/pages/ModuleAnalyze/index.d.ts +7 -1
  158. package/dist/pages/ModuleAnalyze/index.js +122 -45
  159. package/dist/pages/Overall/index.js +14 -9
  160. package/dist/pages/Overall/index.module.js +5 -0
  161. package/dist/pages/Overall/index_module.css +26 -0
  162. package/dist/pages/Overall/responsiveLayout.d.ts +6 -0
  163. package/dist/pages/Overall/responsiveLayout.js +9 -0
  164. package/dist/pages/TreeShaking/utils.d.ts +1 -1
  165. package/dist/pages/WebpackLoaders/Analysis/index.js +4 -1
  166. package/dist/pages/WebpackLoaders/Overall/index.js +8 -1
  167. package/dist/pages/WebpackPlugins/index.css +3 -0
  168. package/dist/pages/WebpackPlugins/index.d.ts +1 -0
  169. package/dist/pages/WebpackPlugins/index.js +61 -51
  170. package/dist/utils/data/brief.js +0 -2
  171. package/dist/utils/file.d.ts +4 -2
  172. package/dist/utils/file.js +40 -5
  173. package/dist/utils/i18n/cn.js +5 -0
  174. package/dist/utils/i18n/en.d.ts +5 -0
  175. package/dist/utils/i18n/en.js +5 -0
  176. package/package.json +7 -6
  177. package/dist/assets/connection-point.3b3c78ca.svg +0 -1
  178. package/dist/assets/webpack.98604d64.svg +0 -1
  179. package/dist/components/Alert/index.d.ts +0 -4
  180. package/dist/components/Alert/index.js +0 -34
  181. package/dist/components/Alert/link.d.ts +0 -3
  182. package/dist/components/Alert/link.js +0 -27
  183. package/dist/components/Alerts/common.js +0 -123
  184. package/dist/components/Card/statistic.css +0 -17
  185. package/dist/components/Overall/NumberButton.d.ts +0 -8
  186. package/dist/components/Overall/NumberButton.js +0 -29
  187. package/dist/components/Overall/NumberButton.module.js +0 -5
  188. package/dist/components/Overall/NumberButton_module.css +0 -70
  189. package/dist/components/Overall/bundle.module.css +0 -0
  190. package/dist/pages/Overall/responsiveGridList.d.ts +0 -6
  191. package/dist/pages/Overall/responsiveGridList.js +0 -28
@@ -12,10 +12,13 @@ import {
12
12
  Space,
13
13
  Table,
14
14
  Tooltip,
15
- Typography
15
+ Typography,
16
+ List,
17
+ Popover
16
18
  } from "antd";
17
19
  import { CloseCircleOutlined } from "@ant-design/icons";
18
20
  import { SDK } from "@rsdoctor/types";
21
+ import styles from "./style.module";
19
22
  import { ServerAPIProvider } from "../../Manifest";
20
23
  import { drawerWidth, Size } from "../../../constants";
21
24
  import {
@@ -28,6 +31,8 @@ import {
28
31
  import { LoaderExecutions } from "../executions";
29
32
  import { FileTree } from "../../FileTree";
30
33
  import { Keyword } from "../../Keyword";
34
+ const ADDITION_LOADER_NUMBER = 3;
35
+ const { innerWidth } = window;
31
36
  const LoaderFiles = (props) => {
32
37
  const { cwd, filetree } = props;
33
38
  const [drawerVisible, setDrawerVisible] = useState(false);
@@ -62,53 +67,105 @@ const LoaderFiles = (props) => {
62
67
  cwd,
63
68
  fileTitle(file, basename) {
64
69
  const { loaders, layer } = filetree.find((e) => e.path === file);
70
+ const additionalLoaders = [];
71
+ loaders.forEach(
72
+ (l, i) => i > ADDITION_LOADER_NUMBER && additionalLoaders.push(l)
73
+ );
65
74
  return /* @__PURE__ */ jsxs(
66
75
  Space,
67
76
  {
68
- style: { wordBreak: "break-all" },
77
+ style: { wordBreak: "break-all", height: 40 },
69
78
  onClick: () => {
70
79
  setLoaderIndex(0);
71
80
  setResourcePath(file);
72
81
  setDrawerVisible(true);
73
82
  },
74
83
  children: [
75
- /* @__PURE__ */ jsx(
76
- Keyword,
84
+ /* @__PURE__ */ jsxs(
85
+ "div",
77
86
  {
78
- text: basename.replace(/\[.*?\]/g, ""),
79
- keyword: props.filename
87
+ className: styles.box,
88
+ style: {
89
+ width: innerWidth < 1500 ? innerWidth * 0.3 : innerWidth * 0.5
90
+ },
91
+ children: [
92
+ /* @__PURE__ */ jsx("div", { className: styles.keywords, children: /* @__PURE__ */ jsx(
93
+ Keyword,
94
+ {
95
+ text: basename.replace(/\[.*?\]/g, ""),
96
+ keyword: props.filename
97
+ }
98
+ ) }),
99
+ /* @__PURE__ */ jsx("div", { className: styles.dividerDiv, children: /* @__PURE__ */ jsx(Divider, { className: styles.divider, dashed: true }) })
100
+ ]
80
101
  }
81
102
  ),
82
103
  layer ? /* @__PURE__ */ jsx(Tag, { color: "cyan", bordered: false, children: layer }) : /* @__PURE__ */ jsx(Fragment, {}),
83
- loaders.map((e, i) => {
104
+ loaders.slice(0, ADDITION_LOADER_NUMBER).map((e, i) => {
84
105
  const isError = e.errors && e.errors.length;
85
106
  const key = `${file}_${e.loader}_${i}`;
86
- return /* @__PURE__ */ jsx(Tooltip, { title: e.path, children: /* @__PURE__ */ jsxs(
87
- Typography.Text,
88
- {
89
- code: true,
90
- style: { color: isError ? "#f50" : "inherit" },
91
- onClick: (ev) => {
92
- ev.stopPropagation();
93
- setResourcePath(file);
94
- setLoaderIndex(i);
95
- setDrawerVisible(true);
96
- },
97
- children: [
98
- /* @__PURE__ */ jsx(
99
- Typography.Text,
100
- {
101
- style: { maxWidth: 135, color: "inherit" },
102
- ellipsis: true,
103
- children: e.loader
104
- }
105
- ),
106
- /* @__PURE__ */ jsx(Divider, { type: "vertical" }),
107
- isError ? /* @__PURE__ */ jsx(CloseCircleOutlined, {}) : /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: formatCosts(e.costs) })
108
- ]
109
- }
110
- ) }, key);
111
- })
107
+ if (i <= ADDITION_LOADER_NUMBER) {
108
+ return /* @__PURE__ */ jsx(Tooltip, { title: e.path, children: /* @__PURE__ */ jsx("div", { style: { paddingBottom: 5 }, children: /* @__PURE__ */ jsxs(
109
+ Typography.Text,
110
+ {
111
+ className: styles.textBox,
112
+ style: { color: isError ? "#f50" : "inherit" },
113
+ onClick: (ev) => {
114
+ ev.stopPropagation();
115
+ setResourcePath(file);
116
+ setLoaderIndex(i);
117
+ setDrawerVisible(true);
118
+ },
119
+ children: [
120
+ /* @__PURE__ */ jsx(Typography.Text, { className: styles.text, ellipsis: true, children: e.loader.match(/([^/]+-loader)/g)?.[0] || e.loader }),
121
+ /* @__PURE__ */ jsx(Divider, { type: "vertical" }),
122
+ isError ? /* @__PURE__ */ jsx(CloseCircleOutlined, {}) : /* @__PURE__ */ jsx(Typography.Text, { className: styles.text, children: formatCosts(e.costs) })
123
+ ]
124
+ }
125
+ ) }) }, key);
126
+ }
127
+ }),
128
+ additionalLoaders?.length ? /* @__PURE__ */ jsx(
129
+ Popover,
130
+ {
131
+ content: /* @__PURE__ */ jsx(
132
+ List,
133
+ {
134
+ dataSource: additionalLoaders,
135
+ renderItem: (e, i) => {
136
+ const isError = e.errors && e.errors.length;
137
+ const key = `${file}_${e.loader}_${i + ADDITION_LOADER_NUMBER}`;
138
+ return /* @__PURE__ */ jsx(List.Item, { children: /* @__PURE__ */ jsx(Tooltip, { title: e.path, children: /* @__PURE__ */ jsx("div", { style: { paddingBottom: 5 }, children: /* @__PURE__ */ jsxs(
139
+ Typography.Text,
140
+ {
141
+ className: styles.textBox,
142
+ style: { color: isError ? "#f50" : "inherit" },
143
+ onClick: (ev) => {
144
+ ev.stopPropagation();
145
+ setResourcePath(file);
146
+ setLoaderIndex(i);
147
+ setDrawerVisible(true);
148
+ },
149
+ children: [
150
+ /* @__PURE__ */ jsx(
151
+ Typography.Text,
152
+ {
153
+ className: styles.text,
154
+ ellipsis: true,
155
+ children: e.loader.match(/([^/]+-loader)/g)?.[0] || e.loader
156
+ }
157
+ ),
158
+ /* @__PURE__ */ jsx(Divider, { type: "vertical" }),
159
+ /* @__PURE__ */ jsx(Typography.Text, { className: styles.text, children: formatCosts(e.costs) })
160
+ ]
161
+ }
162
+ ) }) }, key) });
163
+ }
164
+ }
165
+ ),
166
+ children: /* @__PURE__ */ jsx("div", { className: styles.textBox, children: /* @__PURE__ */ jsx(Typography.Text, { children: "···" }) })
167
+ }
168
+ ) : /* @__PURE__ */ jsx(Fragment, {})
112
169
  ]
113
170
  }
114
171
  );
@@ -118,15 +175,34 @@ const LoaderFiles = (props) => {
118
175
  }
119
176
  });
120
177
  }, [filteredFiles]);
121
- return /* @__PURE__ */ jsxs(Row, { style: { width: "100%" }, gutter: Size.BasePadding, children: [
122
- /* @__PURE__ */ jsx(Col, { span: 14, children: /* @__PURE__ */ jsxs(
178
+ return /* @__PURE__ */ jsxs(Row, { style: { width: "100%", marginLeft: 0 }, gutter: Size.BasePadding, children: [
179
+ /* @__PURE__ */ jsx(Col, { span: 24, children: /* @__PURE__ */ jsxs(
123
180
  Card,
124
181
  {
125
- title: /* @__PURE__ */ jsxs(Typography.Text, { strong: true, children: [
126
- "Total Files: ",
127
- filteredFiles.length
182
+ title: /* @__PURE__ */ jsxs(Space, { children: [
183
+ /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: "Files" }),
184
+ /* @__PURE__ */ jsxs(
185
+ Typography.Text,
186
+ {
187
+ style: {
188
+ fontSize: 12,
189
+ fontWeight: 400,
190
+ color: "#1C1F2399",
191
+ opacity: 0.6
192
+ },
193
+ children: [
194
+ "Total Files: ",
195
+ filteredFiles.length
196
+ ]
197
+ }
198
+ )
128
199
  ] }),
129
- bodyStyle: { overflow: "scroll", maxHeight, height: "40rem" },
200
+ bodyStyle: {
201
+ overflow: "scroll",
202
+ maxHeight,
203
+ height: "40rem",
204
+ padding: 14
205
+ },
130
206
  children: [
131
207
  /* @__PURE__ */ jsx(
132
208
  FileTree,
@@ -174,80 +250,90 @@ const LoaderFiles = (props) => {
174
250
  ]
175
251
  }
176
252
  ) }),
177
- selectedNode ? /* @__PURE__ */ jsx(Col, { span: 10, children: /* @__PURE__ */ jsx(
178
- Card,
253
+ /* @__PURE__ */ jsx(
254
+ Drawer,
179
255
  {
180
- title: /* @__PURE__ */ jsx(
181
- Tooltip,
256
+ open: !!selectedNode,
257
+ onClose: () => setSelectedNode(null),
258
+ maskClosable: true,
259
+ width: drawerWidth,
260
+ zIndex: 999,
261
+ bodyStyle: { padding: 0 },
262
+ children: selectedNode && /* @__PURE__ */ jsx(Row, { children: /* @__PURE__ */ jsx(Col, { span: 24, children: /* @__PURE__ */ jsx(
263
+ Card,
182
264
  {
183
- title: React.cloneElement(
184
- selectedNode.title,
185
- { style: { color: "#fff" } }
265
+ title: /* @__PURE__ */ jsx(
266
+ Tooltip,
267
+ {
268
+ title: React.cloneElement(
269
+ selectedNode.title,
270
+ { style: { color: "#fff" } }
271
+ ),
272
+ children: /* @__PURE__ */ jsxs(Typography.Text, { children: [
273
+ `Statistics of`,
274
+ selectedNode.title
275
+ ] })
276
+ }
186
277
  ),
187
- children: /* @__PURE__ */ jsxs(Typography.Text, { children: [
188
- 'Statistics of "',
189
- selectedNode.title,
190
- '"'
191
- ] })
192
- }
193
- ),
194
- children: /* @__PURE__ */ jsx(
195
- ServerAPIProvider,
196
- {
197
- api: SDK.ServerAPI.API.GetLoaderFolderStatistics,
198
- body: { folder: selectedNode[inlinedResourcePathKey] },
199
- children: (tableData) => /* @__PURE__ */ jsx(
200
- Table,
278
+ children: /* @__PURE__ */ jsx(
279
+ ServerAPIProvider,
201
280
  {
202
- style: {
203
- width: "100%",
204
- maxHeight,
205
- height: "40rem",
206
- overflowY: "scroll",
207
- wordBreak: "break-all"
208
- },
209
- pagination: false,
210
- bordered: true,
211
- rowKey: (e) => e.loader,
212
- columns: [
213
- {
214
- title: "Loader Name",
215
- dataIndex: "loader"
216
- },
281
+ api: SDK.ServerAPI.API.GetLoaderFolderStatistics,
282
+ body: { folder: selectedNode[inlinedResourcePathKey] },
283
+ children: (tableData) => /* @__PURE__ */ jsx(
284
+ Table,
217
285
  {
218
- title: "Files",
219
- dataIndex: "files"
220
- },
221
- {
222
- title: "Total Duration",
223
- dataIndex: "costs",
224
- render: (v) => /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: formatCosts(v) }),
225
- sorter: (a, b) => a.costs - b.costs,
226
- defaultSortOrder: "descend",
227
- sortDirections: ["descend", "ascend"]
228
- }
229
- ],
230
- dataSource: tableData,
231
- footer: () => /* @__PURE__ */ jsxs(
232
- Descriptions,
233
- {
234
- title: "Total",
286
+ style: {
287
+ width: "100%",
288
+ maxHeight,
289
+ height: "40rem",
290
+ overflowY: "scroll",
291
+ wordBreak: "break-all"
292
+ },
293
+ pagination: false,
235
294
  bordered: true,
236
- layout: "vertical",
237
- size: "small",
238
- children: [
239
- /* @__PURE__ */ jsx(Descriptions.Item, { label: "loaders", children: tableData.length }),
240
- /* @__PURE__ */ jsx(Descriptions.Item, { label: "files", children: sumBy(tableData, (e) => e.files) }),
241
- /* @__PURE__ */ jsx(Descriptions.Item, { label: "duration", children: /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: formatCosts(sumBy(tableData, (e) => e.costs)) }) })
242
- ]
295
+ rowKey: (e) => e.loader,
296
+ columns: [
297
+ {
298
+ title: "Loader Name",
299
+ dataIndex: "loader"
300
+ },
301
+ {
302
+ title: "Files",
303
+ dataIndex: "files"
304
+ },
305
+ {
306
+ title: "Total Duration",
307
+ dataIndex: "costs",
308
+ render: (v) => /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: formatCosts(v) }),
309
+ sorter: (a, b) => a.costs - b.costs,
310
+ defaultSortOrder: "descend",
311
+ sortDirections: ["descend", "ascend"]
312
+ }
313
+ ],
314
+ dataSource: tableData,
315
+ footer: () => /* @__PURE__ */ jsxs(
316
+ Descriptions,
317
+ {
318
+ title: "Total",
319
+ bordered: true,
320
+ layout: "vertical",
321
+ size: "small",
322
+ children: [
323
+ /* @__PURE__ */ jsx(Descriptions.Item, { label: "loaders", children: tableData.length }),
324
+ /* @__PURE__ */ jsx(Descriptions.Item, { label: "files", children: sumBy(tableData, (e) => e.files) }),
325
+ /* @__PURE__ */ jsx(Descriptions.Item, { label: "duration", children: /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: formatCosts(sumBy(tableData, (e) => e.costs)) }) })
326
+ ]
327
+ }
328
+ )
243
329
  }
244
330
  )
245
331
  }
246
332
  )
247
333
  }
248
- )
334
+ ) }) })
249
335
  }
250
- ) }) : null
336
+ )
251
337
  ] });
252
338
  };
253
339
  export {
@@ -4,31 +4,48 @@ import { SDK } from "@rsdoctor/types";
4
4
  import { ServerAPIProvider, withServerAPI } from "../../Manifest";
5
5
  import { LoaderFiles } from "./files";
6
6
  import { LoaderCommonSelect } from "../../Select";
7
+ import { ConfigContext } from "../../../config";
8
+ import { ConfigProvider } from "antd";
9
+ import { getLocale } from "../../../utils";
7
10
  const LoaderAnalysisBase = ({ cwd }) => {
8
11
  const [store, setStore] = useState({
9
12
  filename: "",
10
13
  loaders: [],
11
14
  layer: ""
12
15
  });
13
- return /* @__PURE__ */ jsxs("div", { children: [
14
- /* @__PURE__ */ jsx(ServerAPIProvider, { api: SDK.ServerAPI.API.GetLoaderNames, children: (loaderNames) => /* @__PURE__ */ jsx(
15
- LoaderCommonSelect,
16
+ return /* @__PURE__ */ jsx(ConfigContext.Consumer, { children: (v) => {
17
+ return /* @__PURE__ */ jsx(
18
+ ConfigProvider,
16
19
  {
17
- onChange: (e) => setStore(e),
18
- loaderNames
20
+ locale: getLocale(v.locale),
21
+ theme: {
22
+ token: {
23
+ padding: 16,
24
+ fontSize: 14
25
+ }
26
+ },
27
+ children: /* @__PURE__ */ jsxs("div", { children: [
28
+ /* @__PURE__ */ jsx(ServerAPIProvider, { api: SDK.ServerAPI.API.GetLoaderNames, children: (loaderNames) => /* @__PURE__ */ jsx(
29
+ LoaderCommonSelect,
30
+ {
31
+ onChange: (e) => setStore(e),
32
+ loaderNames
33
+ }
34
+ ) }),
35
+ /* @__PURE__ */ jsx(ServerAPIProvider, { api: SDK.ServerAPI.API.GetLoaderFileTree, children: (filetree) => /* @__PURE__ */ jsx(
36
+ LoaderFiles,
37
+ {
38
+ filename: store.filename,
39
+ filetree,
40
+ loaders: store.loaders,
41
+ layer: store.layer,
42
+ cwd
43
+ }
44
+ ) })
45
+ ] })
19
46
  }
20
- ) }),
21
- /* @__PURE__ */ jsx(ServerAPIProvider, { api: SDK.ServerAPI.API.GetLoaderFileTree, children: (filetree) => /* @__PURE__ */ jsx(
22
- LoaderFiles,
23
- {
24
- filename: store.filename,
25
- filetree,
26
- loaders: store.loaders,
27
- layer: store.layer,
28
- cwd
29
- }
30
- ) })
31
- ] });
47
+ );
48
+ } });
32
49
  };
33
50
  const LoaderAnalysis = withServerAPI({
34
51
  api: SDK.ServerAPI.API.LoadDataByKey,
@@ -0,0 +1,11 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ const SvgInput = (props) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: 10, height: 12, fill: "none", viewBox: "0 0 10 12", ...props, children: [
4
+ /* @__PURE__ */ jsx("path", { fill: "#FAAD14", fillRule: "evenodd", d: "M3.151 7.98h-1.85a.925.925 0 0 1-.924-.925V1.508c0-.511.414-.925.925-.925h7.396c.511 0 .925.414.925.925v5.547c0 .51-.414.924-.925.924H6.85V6.13a1.85 1.85 0 0 0-3.698 0v1.85Z", clipRule: "evenodd" }),
5
+ /* @__PURE__ */ jsx("path", { fill: "#FAAD14", d: "M4.076 9.829a.925.925 0 0 0 1.849 0V6.13a.925.925 0 0 0-1.85 0V9.83Z" }),
6
+ /* @__PURE__ */ jsx("path", { fill: "#FAAD14", d: "M5 11.416 7.402 8.92H2.598L5 11.416Z" })
7
+ ] });
8
+ var input_default = SvgInput;
9
+ export {
10
+ input_default as default
11
+ };
@@ -0,0 +1,12 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ const SvgOutput = (props) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, fill: "none", viewBox: "0 0 16 16", ...props, children: [
4
+ /* @__PURE__ */ jsx("rect", { width: 16, height: 16, fill: "#F6FFED", rx: 2 }),
5
+ /* @__PURE__ */ jsx("path", { fill: "#52C41A", fillRule: "evenodd", d: "M4.302 6.02a.925.925 0 0 0-.925.925v5.547c0 .51.414.925.925.925h7.396c.511 0 .925-.414.925-.925V6.945a.925.925 0 0 0-.925-.925H4.302Zm5.547 0H6.151v1.85a1.85 1.85 0 0 0 3.698 0V6.02Z", clipRule: "evenodd" }),
6
+ /* @__PURE__ */ jsx("path", { fill: "#52C41A", d: "M7.076 4.171a.925.925 0 0 1 1.849 0V7.87a.925.925 0 0 1-1.85 0V4.171Z" }),
7
+ /* @__PURE__ */ jsx("path", { fill: "#52C41A", d: "m8 2.583 2.402 2.497H5.598L8 2.583Z" })
8
+ ] });
9
+ var output_default = SvgOutput;
10
+ export {
11
+ output_default as default
12
+ };
@@ -0,0 +1,5 @@
1
+ import "./style_module.css";
2
+ var style_module_default = { "loaderAnalysis": "loaderAnalysis_85b73", "divider": "divider_85b73", "dividerDiv": "dividerDiv_85b73", "box": "box_85b73", "keyword": "keyword_85b73", "textBox": "textBox_85b73", "text": "text_85b73", "space": "space_85b73", "executions": "executions_85b73", "timeline": "timeline_85b73", "loader": "loader_85b73", "selected": "selected_85b73" };
3
+ export {
4
+ style_module_default as default
5
+ };
@@ -0,0 +1,73 @@
1
+ .loaderAnalysis_85b73 .rc-tree-treenode {
2
+ line-height: 30px;
3
+ }
4
+
5
+ .divider_85b73 {
6
+ border-color: rgba(0, 0, 0, 0.12);
7
+ position: relative;
8
+ bottom: 20%;
9
+ }
10
+
11
+ .dividerDiv_85b73 {
12
+ flex-grow: 1;
13
+ margin-left: 10px;
14
+ }
15
+
16
+ .box_85b73 {
17
+ display: flex;
18
+ height: 40px;
19
+ }
20
+ .box_85b73 .keyword_85b73 {
21
+ flex: 0 0 auto;
22
+ padding-right: 5;
23
+ }
24
+
25
+ .textBox_85b73 {
26
+ max-width: 220px;
27
+ color: rgba(0, 0, 0, 0.85);
28
+ height: 22px;
29
+ border: 1px #d9d9d9 solid;
30
+ justify-content: center;
31
+ display: flex;
32
+ padding: 1px 8px 1px 8px;
33
+ align-items: center;
34
+ border-radius: 2px;
35
+ background-color: #fafafa;
36
+ }
37
+ .textBox_85b73 .text_85b73 {
38
+ font-size: 12px;
39
+ font-weight: 400;
40
+ font-family: "Roboto";
41
+ }
42
+
43
+ .space_85b73 .ant-space-item {
44
+ display: flex;
45
+ }
46
+
47
+ .executions_85b73 .timeline_85b73 .box_85b73 {
48
+ border: 1px solid #eaedf1;
49
+ border-radius: 8px;
50
+ width: 80%;
51
+ height: 74px;
52
+ display: flex;
53
+ flex-direction: column;
54
+ padding: 16px;
55
+ }
56
+ .executions_85b73 .timeline_85b73 .box_85b73:active {
57
+ background-color: #f2f8ff;
58
+ border: 1px solid #0079ff;
59
+ }
60
+ .executions_85b73 .timeline_85b73 .box_85b73 .ant-typography {
61
+ color: rgba(0, 0, 0, 0.65);
62
+ font-size: 14px;
63
+ }
64
+ .executions_85b73 .timeline_85b73 .box_85b73 .loader_85b73 {
65
+ color: inherit;
66
+ font-size: 14px;
67
+ height: 72px;
68
+ align-content: center;
69
+ }
70
+ .executions_85b73 .timeline_85b73 .selected_85b73 {
71
+ background-color: #f2f8ff;
72
+ border: 1px solid #0079ff;
73
+ }