@rsdoctor/components 0.0.0-next-20240620044732

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 (330) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +22 -0
  3. package/dist/assets/connection-point.3b3c78ca.svg +1 -0
  4. package/dist/assets/webpack.98604d64.svg +1 -0
  5. package/dist/components/Alert/change.d.ts +8 -0
  6. package/dist/components/Alert/change.js +93 -0
  7. package/dist/components/Alert/file-relation.d.ts +3 -0
  8. package/dist/components/Alert/file-relation.js +9 -0
  9. package/dist/components/Alert/index.css +32 -0
  10. package/dist/components/Alert/index.d.ts +4 -0
  11. package/dist/components/Alert/index.js +37 -0
  12. package/dist/components/Alert/link.d.ts +3 -0
  13. package/dist/components/Alert/link.js +27 -0
  14. package/dist/components/Alert/package-relation.d.ts +17 -0
  15. package/dist/components/Alert/package-relation.js +281 -0
  16. package/dist/components/Alert/types.d.ts +31 -0
  17. package/dist/components/Alert/types.js +0 -0
  18. package/dist/components/Alert/view.d.ts +4 -0
  19. package/dist/components/Alert/view.js +58 -0
  20. package/dist/components/Alerts/bundle.d.ts +11 -0
  21. package/dist/components/Alerts/bundle.js +61 -0
  22. package/dist/components/Alerts/common.d.ts +15 -0
  23. package/dist/components/Alerts/common.js +112 -0
  24. package/dist/components/Alerts/compile.d.ts +10 -0
  25. package/dist/components/Alerts/compile.js +46 -0
  26. package/dist/components/Alerts/index.d.ts +3 -0
  27. package/dist/components/Alerts/index.js +3 -0
  28. package/dist/components/Alerts/overlay.d.ts +26 -0
  29. package/dist/components/Alerts/overlay.js +154 -0
  30. package/dist/components/Badge/index.d.ts +21 -0
  31. package/dist/components/Badge/index.js +87 -0
  32. package/dist/components/BundleDiff/DiffContainer/assets.d.ts +7 -0
  33. package/dist/components/BundleDiff/DiffContainer/assets.js +507 -0
  34. package/dist/components/BundleDiff/DiffContainer/cards.d.ts +3 -0
  35. package/dist/components/BundleDiff/DiffContainer/cards.js +156 -0
  36. package/dist/components/BundleDiff/DiffContainer/changes.d.ts +15 -0
  37. package/dist/components/BundleDiff/DiffContainer/changes.js +69 -0
  38. package/dist/components/BundleDiff/DiffContainer/constants.d.ts +11 -0
  39. package/dist/components/BundleDiff/DiffContainer/constants.js +17 -0
  40. package/dist/components/BundleDiff/DiffContainer/diff.d.ts +23 -0
  41. package/dist/components/BundleDiff/DiffContainer/diff.js +114 -0
  42. package/dist/components/BundleDiff/DiffContainer/index.d.ts +3 -0
  43. package/dist/components/BundleDiff/DiffContainer/index.js +180 -0
  44. package/dist/components/BundleDiff/DiffContainer/modules.d.ts +8 -0
  45. package/dist/components/BundleDiff/DiffContainer/modules.js +302 -0
  46. package/dist/components/BundleDiff/DiffContainer/overview.d.ts +5 -0
  47. package/dist/components/BundleDiff/DiffContainer/overview.js +178 -0
  48. package/dist/components/BundleDiff/DiffContainer/packages.d.ts +19 -0
  49. package/dist/components/BundleDiff/DiffContainer/packages.js +330 -0
  50. package/dist/components/BundleDiff/DiffContainer/row.d.ts +9 -0
  51. package/dist/components/BundleDiff/DiffContainer/row.js +369 -0
  52. package/dist/components/BundleDiff/DiffContainer/types.d.ts +45 -0
  53. package/dist/components/BundleDiff/DiffContainer/types.js +0 -0
  54. package/dist/components/BundleDiff/DiffContainer/utils.d.ts +2 -0
  55. package/dist/components/BundleDiff/DiffContainer/utils.js +24 -0
  56. package/dist/components/BundleDiff/DiffServerAPIProvider/index.d.ts +4 -0
  57. package/dist/components/BundleDiff/DiffServerAPIProvider/index.js +37 -0
  58. package/dist/components/BundleDiff/constants.d.ts +11 -0
  59. package/dist/components/BundleDiff/constants.js +19 -0
  60. package/dist/components/BundleDiff/index.d.ts +1 -0
  61. package/dist/components/BundleDiff/index.js +1 -0
  62. package/dist/components/Card/diff.d.ts +24 -0
  63. package/dist/components/Card/diff.js +116 -0
  64. package/dist/components/Card/index.d.ts +9 -0
  65. package/dist/components/Card/index.js +50 -0
  66. package/dist/components/Card/size.d.ts +21 -0
  67. package/dist/components/Card/size.js +79 -0
  68. package/dist/components/Card/statistic.css +17 -0
  69. package/dist/components/Card/statistic.d.ts +12 -0
  70. package/dist/components/Card/statistic.js +19 -0
  71. package/dist/components/Charts/TimelineCharts/index.d.ts +8 -0
  72. package/dist/components/Charts/TimelineCharts/index.js +212 -0
  73. package/dist/components/Charts/bootstrap.d.ts +5 -0
  74. package/dist/components/Charts/bootstrap.js +44 -0
  75. package/dist/components/Charts/common.d.ts +13 -0
  76. package/dist/components/Charts/common.js +56 -0
  77. package/dist/components/Charts/constants.d.ts +2 -0
  78. package/dist/components/Charts/constants.js +46 -0
  79. package/dist/components/Charts/done.d.ts +5 -0
  80. package/dist/components/Charts/done.js +45 -0
  81. package/dist/components/Charts/index.d.ts +10 -0
  82. package/dist/components/Charts/index.js +37 -0
  83. package/dist/components/Charts/loader.css +31 -0
  84. package/dist/components/Charts/loader.d.ts +4 -0
  85. package/dist/components/Charts/loader.js +88 -0
  86. package/dist/components/Charts/minify.d.ts +5 -0
  87. package/dist/components/Charts/minify.js +37 -0
  88. package/dist/components/Charts/tooltips.css +62 -0
  89. package/dist/components/Charts/types.d.ts +61 -0
  90. package/dist/components/Charts/types.js +11 -0
  91. package/dist/components/Charts/utils.d.ts +13 -0
  92. package/dist/components/Charts/utils.js +206 -0
  93. package/dist/components/CodeViewer/config.d.ts +2 -0
  94. package/dist/components/CodeViewer/config.js +18 -0
  95. package/dist/components/CodeViewer/diff.d.ts +11 -0
  96. package/dist/components/CodeViewer/diff.js +35 -0
  97. package/dist/components/CodeViewer/hightlight.d.ts +10 -0
  98. package/dist/components/CodeViewer/hightlight.js +76 -0
  99. package/dist/components/CodeViewer/index.d.ts +4 -0
  100. package/dist/components/CodeViewer/index.js +4 -0
  101. package/dist/components/CodeViewer/viewer.d.ts +13 -0
  102. package/dist/components/CodeViewer/viewer.js +60 -0
  103. package/dist/components/Configuration/builder.d.ts +13 -0
  104. package/dist/components/Configuration/builder.js +67 -0
  105. package/dist/components/Configuration/index.d.ts +1 -0
  106. package/dist/components/Configuration/index.js +1 -0
  107. package/dist/components/FileTree/index.css +58 -0
  108. package/dist/components/FileTree/index.d.ts +4 -0
  109. package/dist/components/FileTree/index.js +42 -0
  110. package/dist/components/Form/keyword.d.ts +14 -0
  111. package/dist/components/Form/keyword.js +60 -0
  112. package/dist/components/Keyword/index.d.ts +6 -0
  113. package/dist/components/Keyword/index.js +36 -0
  114. package/dist/components/Layout/builder-select.d.ts +2 -0
  115. package/dist/components/Layout/builder-select.js +50 -0
  116. package/dist/components/Layout/constants.d.ts +1 -0
  117. package/dist/components/Layout/constants.js +4 -0
  118. package/dist/components/Layout/header.css +12 -0
  119. package/dist/components/Layout/header.d.ts +3 -0
  120. package/dist/components/Layout/header.js +86 -0
  121. package/dist/components/Layout/index.d.ts +5 -0
  122. package/dist/components/Layout/index.js +34 -0
  123. package/dist/components/Layout/menus.d.ts +8 -0
  124. package/dist/components/Layout/menus.js +167 -0
  125. package/dist/components/Layout/progress.d.ts +8 -0
  126. package/dist/components/Layout/progress.js +44 -0
  127. package/dist/components/Loader/Analysis/files.d.ts +8 -0
  128. package/dist/components/Loader/Analysis/files.js +193 -0
  129. package/dist/components/Loader/Analysis/index.d.ts +11 -0
  130. package/dist/components/Loader/Analysis/index.js +23 -0
  131. package/dist/components/Loader/executions.d.ts +9 -0
  132. package/dist/components/Loader/executions.js +199 -0
  133. package/dist/components/Manifest/api.d.ts +34 -0
  134. package/dist/components/Manifest/api.js +127 -0
  135. package/dist/components/Manifest/data.d.ts +8 -0
  136. package/dist/components/Manifest/data.js +65 -0
  137. package/dist/components/Manifest/index.d.ts +2 -0
  138. package/dist/components/Manifest/index.js +2 -0
  139. package/dist/components/Opener/code.d.ts +20 -0
  140. package/dist/components/Opener/code.js +78 -0
  141. package/dist/components/Opener/index.d.ts +2 -0
  142. package/dist/components/Opener/index.js +2 -0
  143. package/dist/components/Opener/vscode.d.ts +11 -0
  144. package/dist/components/Opener/vscode.js +42 -0
  145. package/dist/components/Overall/NumberButton.d.ts +8 -0
  146. package/dist/components/Overall/NumberButton.js +29 -0
  147. package/dist/components/Overall/NumberButton.module.js +5 -0
  148. package/dist/components/Overall/NumberButton_module.css +70 -0
  149. package/dist/components/Overall/bundle.d.ts +6 -0
  150. package/dist/components/Overall/bundle.js +167 -0
  151. package/dist/components/Overall/bundle.module.css +0 -0
  152. package/dist/components/Overall/card.module.js +5 -0
  153. package/dist/components/Overall/card_module.css +6 -0
  154. package/dist/components/Overall/compile.d.ts +5 -0
  155. package/dist/components/Overall/compile.js +67 -0
  156. package/dist/components/Overall/compile.module.js +5 -0
  157. package/dist/components/Overall/compile_module.css +4 -0
  158. package/dist/components/Overall/index.d.ts +3 -0
  159. package/dist/components/Overall/index.js +3 -0
  160. package/dist/components/Overall/list.module.js +5 -0
  161. package/dist/components/Overall/list_module.css +7 -0
  162. package/dist/components/Overall/project.d.ts +8 -0
  163. package/dist/components/Overall/project.js +73 -0
  164. package/dist/components/Plugins/webpack.d.ts +18 -0
  165. package/dist/components/Plugins/webpack.js +76 -0
  166. package/dist/components/Resolver/analysis.d.ts +15 -0
  167. package/dist/components/Resolver/analysis.js +144 -0
  168. package/dist/components/Select/index.d.ts +15 -0
  169. package/dist/components/Select/index.js +68 -0
  170. package/dist/components/Status/failed.d.ts +9 -0
  171. package/dist/components/Status/failed.js +33 -0
  172. package/dist/components/Status/index.d.ts +1 -0
  173. package/dist/components/Status/index.js +1 -0
  174. package/dist/components/TextDrawer/duplicate.d.ts +17 -0
  175. package/dist/components/TextDrawer/duplicate.js +69 -0
  176. package/dist/components/TextDrawer/index.d.ts +11 -0
  177. package/dist/components/TextDrawer/index.js +36 -0
  178. package/dist/components/Title/index.d.ts +15 -0
  179. package/dist/components/Title/index.js +10 -0
  180. package/dist/components/index.d.ts +12 -0
  181. package/dist/components/index.js +15 -0
  182. package/dist/components/worker/ecmaversion/client.d.ts +10 -0
  183. package/dist/components/worker/ecmaversion/client.js +60 -0
  184. package/dist/components/worker/ecmaversion/worker.d.ts +1 -0
  185. package/dist/components/worker/ecmaversion/worker.js +13 -0
  186. package/dist/components/worker/jsequal/client.d.ts +11 -0
  187. package/dist/components/worker/jsequal/client.js +38 -0
  188. package/dist/components/worker/jsequal/worker.d.ts +1 -0
  189. package/dist/components/worker/jsequal/worker.js +23 -0
  190. package/dist/config.d.ts +19 -0
  191. package/dist/config.js +25 -0
  192. package/dist/constants.d.ts +50 -0
  193. package/dist/constants.js +75 -0
  194. package/dist/index.d.ts +3 -0
  195. package/dist/index.js +6 -0
  196. package/dist/pages/BundleSize/components/asset.d.ts +26 -0
  197. package/dist/pages/BundleSize/components/asset.js +545 -0
  198. package/dist/pages/BundleSize/components/cards.d.ts +7 -0
  199. package/dist/pages/BundleSize/components/cards.js +143 -0
  200. package/dist/pages/BundleSize/components/editor.d.ts +5 -0
  201. package/dist/pages/BundleSize/components/editor.js +38 -0
  202. package/dist/pages/BundleSize/components/index.css +20 -0
  203. package/dist/pages/BundleSize/components/index.d.ts +16 -0
  204. package/dist/pages/BundleSize/components/index.js +366 -0
  205. package/dist/pages/BundleSize/config.d.ts +7 -0
  206. package/dist/pages/BundleSize/config.js +9 -0
  207. package/dist/pages/BundleSize/constants.d.ts +5 -0
  208. package/dist/pages/BundleSize/constants.js +9 -0
  209. package/dist/pages/BundleSize/index.d.ts +3 -0
  210. package/dist/pages/BundleSize/index.js +11 -0
  211. package/dist/pages/ModuleAnalyze/chunks.d.ts +6 -0
  212. package/dist/pages/ModuleAnalyze/chunks.js +48 -0
  213. package/dist/pages/ModuleAnalyze/components/fileTreeCom.css +97 -0
  214. package/dist/pages/ModuleAnalyze/components/fileTreeCom.d.ts +15 -0
  215. package/dist/pages/ModuleAnalyze/components/fileTreeCom.js +120 -0
  216. package/dist/pages/ModuleAnalyze/constants.d.ts +7 -0
  217. package/dist/pages/ModuleAnalyze/constants.js +14 -0
  218. package/dist/pages/ModuleAnalyze/dependncy.d.ts +9 -0
  219. package/dist/pages/ModuleAnalyze/dependncy.js +31 -0
  220. package/dist/pages/ModuleAnalyze/fileTree.d.ts +9 -0
  221. package/dist/pages/ModuleAnalyze/fileTree.js +125 -0
  222. package/dist/pages/ModuleAnalyze/index.css +10 -0
  223. package/dist/pages/ModuleAnalyze/index.d.ts +8 -0
  224. package/dist/pages/ModuleAnalyze/index.js +64 -0
  225. package/dist/pages/ModuleAnalyze/utils/hooks.d.ts +21 -0
  226. package/dist/pages/ModuleAnalyze/utils/hooks.js +62 -0
  227. package/dist/pages/ModuleAnalyze/utils/index.d.ts +3 -0
  228. package/dist/pages/ModuleAnalyze/utils/index.js +34 -0
  229. package/dist/pages/ModuleResolve/constants.d.ts +3 -0
  230. package/dist/pages/ModuleResolve/constants.js +7 -0
  231. package/dist/pages/ModuleResolve/index.d.ts +3 -0
  232. package/dist/pages/ModuleResolve/index.js +19 -0
  233. package/dist/pages/Overall/constants.d.ts +3 -0
  234. package/dist/pages/Overall/constants.js +7 -0
  235. package/dist/pages/Overall/index.d.ts +9 -0
  236. package/dist/pages/Overall/index.js +39 -0
  237. package/dist/pages/Overall/responsiveGridList.d.ts +6 -0
  238. package/dist/pages/Overall/responsiveGridList.js +28 -0
  239. package/dist/pages/Resources/RuleIndex/constants.d.ts +3 -0
  240. package/dist/pages/Resources/RuleIndex/constants.js +7 -0
  241. package/dist/pages/Resources/RuleIndex/index.d.ts +3 -0
  242. package/dist/pages/Resources/RuleIndex/index.js +53 -0
  243. package/dist/pages/TreeShaking/constants.d.ts +3 -0
  244. package/dist/pages/TreeShaking/constants.js +7 -0
  245. package/dist/pages/TreeShaking/editor.d.ts +12 -0
  246. package/dist/pages/TreeShaking/editor.js +110 -0
  247. package/dist/pages/TreeShaking/index.css +74 -0
  248. package/dist/pages/TreeShaking/index.d.ts +8 -0
  249. package/dist/pages/TreeShaking/index.js +177 -0
  250. package/dist/pages/TreeShaking/open-tag.d.ts +11 -0
  251. package/dist/pages/TreeShaking/open-tag.js +43 -0
  252. package/dist/pages/TreeShaking/space.d.ts +1 -0
  253. package/dist/pages/TreeShaking/space.js +16 -0
  254. package/dist/pages/TreeShaking/table.d.ts +13 -0
  255. package/dist/pages/TreeShaking/table.js +319 -0
  256. package/dist/pages/TreeShaking/types.d.ts +3 -0
  257. package/dist/pages/TreeShaking/types.js +0 -0
  258. package/dist/pages/TreeShaking/utils.d.ts +7 -0
  259. package/dist/pages/TreeShaking/utils.js +147 -0
  260. package/dist/pages/WebpackLoaders/Analysis/constants.d.ts +3 -0
  261. package/dist/pages/WebpackLoaders/Analysis/constants.js +7 -0
  262. package/dist/pages/WebpackLoaders/Analysis/index.d.ts +3 -0
  263. package/dist/pages/WebpackLoaders/Analysis/index.js +19 -0
  264. package/dist/pages/WebpackLoaders/Overall/constants.d.ts +3 -0
  265. package/dist/pages/WebpackLoaders/Overall/constants.js +7 -0
  266. package/dist/pages/WebpackLoaders/Overall/index.d.ts +3 -0
  267. package/dist/pages/WebpackLoaders/Overall/index.js +11 -0
  268. package/dist/pages/WebpackLoaders/constants.d.ts +2 -0
  269. package/dist/pages/WebpackLoaders/constants.js +6 -0
  270. package/dist/pages/WebpackPlugins/constants.d.ts +3 -0
  271. package/dist/pages/WebpackPlugins/constants.js +7 -0
  272. package/dist/pages/WebpackPlugins/index.d.ts +3 -0
  273. package/dist/pages/WebpackPlugins/index.js +79 -0
  274. package/dist/pages/index.d.ts +9 -0
  275. package/dist/pages/index.js +20 -0
  276. package/dist/utils/data/base.d.ts +24 -0
  277. package/dist/utils/data/base.js +48 -0
  278. package/dist/utils/data/index.d.ts +5 -0
  279. package/dist/utils/data/index.js +44 -0
  280. package/dist/utils/data/local.d.ts +14 -0
  281. package/dist/utils/data/local.js +86 -0
  282. package/dist/utils/data/remote.d.ts +10 -0
  283. package/dist/utils/data/remote.js +52 -0
  284. package/dist/utils/file.d.ts +33 -0
  285. package/dist/utils/file.js +154 -0
  286. package/dist/utils/hooks.d.ts +31 -0
  287. package/dist/utils/hooks.js +216 -0
  288. package/dist/utils/i18n/cn.d.ts +3 -0
  289. package/dist/utils/i18n/cn.js +33 -0
  290. package/dist/utils/i18n/en.d.ts +30 -0
  291. package/dist/utils/i18n/en.js +33 -0
  292. package/dist/utils/i18n/index.d.ts +2 -0
  293. package/dist/utils/i18n/index.js +34 -0
  294. package/dist/utils/index.d.ts +16 -0
  295. package/dist/utils/index.js +16 -0
  296. package/dist/utils/loader.d.ts +7 -0
  297. package/dist/utils/loader.js +34 -0
  298. package/dist/utils/locale.d.ts +2 -0
  299. package/dist/utils/locale.js +9 -0
  300. package/dist/utils/manifest.d.ts +27 -0
  301. package/dist/utils/manifest.js +54 -0
  302. package/dist/utils/monaco.d.ts +12 -0
  303. package/dist/utils/monaco.js +71 -0
  304. package/dist/utils/request.d.ts +27 -0
  305. package/dist/utils/request.js +130 -0
  306. package/dist/utils/routes.d.ts +3 -0
  307. package/dist/utils/routes.js +14 -0
  308. package/dist/utils/size.d.ts +2 -0
  309. package/dist/utils/size.js +24 -0
  310. package/dist/utils/socket.d.ts +2 -0
  311. package/dist/utils/socket.js +21 -0
  312. package/dist/utils/storage.d.ts +13 -0
  313. package/dist/utils/storage.js +70 -0
  314. package/dist/utils/string.d.ts +2 -0
  315. package/dist/utils/string.js +14 -0
  316. package/dist/utils/time.d.ts +3 -0
  317. package/dist/utils/time.js +7 -0
  318. package/dist/utils/url.d.ts +7 -0
  319. package/dist/utils/url.js +75 -0
  320. package/dist/utils/worker/index.d.ts +4 -0
  321. package/dist/utils/worker/index.js +4 -0
  322. package/dist/utils/worker/master.d.ts +8 -0
  323. package/dist/utils/worker/master.js +18 -0
  324. package/dist/utils/worker/types.d.ts +9 -0
  325. package/dist/utils/worker/types.js +0 -0
  326. package/dist/utils/worker/utils.d.ts +7 -0
  327. package/dist/utils/worker/utils.js +29 -0
  328. package/dist/utils/worker/worker.d.ts +13 -0
  329. package/dist/utils/worker/worker.js +38 -0
  330. package/package.json +92 -0
@@ -0,0 +1,212 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useState, useEffect, memo } from "react";
3
+ import ReactECharts from "echarts-for-react";
4
+ import * as echarts from "echarts/core";
5
+ import dayjs from "dayjs";
6
+ import { groupBy } from "lodash-es";
7
+ import { LITTLE_PALETTE_COLORS, PALETTE_COLORS } from "../constants";
8
+ const LINE_HEIGHT = 60;
9
+ const TimelineCom = memo(({ loaderData, pluginsData, formatterFn, chartType = "normal" }) => {
10
+ const data = [];
11
+ let categories = [];
12
+ const [optionsData, setOptinsData] = useState({});
13
+ useEffect(() => {
14
+ if (!loaderData)
15
+ return;
16
+ const _categories = [];
17
+ loaderData.forEach((_l) => {
18
+ _categories.unshift(_l.n + " total");
19
+ _categories.unshift(_l.n);
20
+ });
21
+ loaderData.forEach(function(_loaderData, _i) {
22
+ data.push({
23
+ name: _loaderData.n + " total",
24
+ value: [
25
+ _categories.indexOf(_loaderData.n + " total"),
26
+ _loaderData.s,
27
+ _loaderData.e,
28
+ _loaderData.e - _loaderData.s
29
+ ],
30
+ itemStyle: {
31
+ normal: {
32
+ color: LITTLE_PALETTE_COLORS[_i % 8]
33
+ }
34
+ }
35
+ });
36
+ if (!_loaderData?.c)
37
+ return;
38
+ for (let l = 0; l < _loaderData?.c?.length; l++) {
39
+ data.push({
40
+ name: _loaderData.n,
41
+ value: [
42
+ _categories.indexOf(_loaderData.n),
43
+ _loaderData.c[l].s,
44
+ _loaderData.c[l].e,
45
+ _loaderData.c[l].e - _loaderData.c[l].s
46
+ ],
47
+ itemStyle: {
48
+ normal: {
49
+ color: PALETTE_COLORS[(l + _i) % 30]
50
+ }
51
+ },
52
+ ext: _loaderData.c[l].ext
53
+ });
54
+ }
55
+ });
56
+ categories = _categories.map((val, i) => {
57
+ if (i % 2 !== 0) {
58
+ return val.replace(" total", "");
59
+ } else {
60
+ return "";
61
+ }
62
+ });
63
+ }, [loaderData]);
64
+ useEffect(() => {
65
+ if (!pluginsData)
66
+ return;
67
+ const _pluginsData = groupBy(pluginsData, (e) => e.pid);
68
+ Object.keys(_pluginsData).reverse().forEach(function(key, i) {
69
+ _pluginsData[key].forEach((_plugin, _i) => {
70
+ data.push({
71
+ name: String(_plugin.pid),
72
+ value: [
73
+ i,
74
+ _plugin.args.s,
75
+ _plugin.args.e,
76
+ _plugin.args.e - _plugin.args.s
77
+ ],
78
+ itemStyle: {
79
+ normal: {
80
+ color: PALETTE_COLORS[(_i + i) % 30]
81
+ }
82
+ },
83
+ ext: _plugin
84
+ });
85
+ });
86
+ categories.push(String(key.charAt(0).toUpperCase() + key.slice(1)));
87
+ });
88
+ }, [pluginsData]);
89
+ useEffect(() => {
90
+ function renderItem(params, api) {
91
+ const categoryIndex = api.value(0);
92
+ const start = api.coord([api.value(1), categoryIndex]);
93
+ const end = api.coord([api.value(2), categoryIndex]);
94
+ const height = api.size([0, 1])[1] * 0.3;
95
+ const rectShape = echarts.graphic.clipRectByRect(
96
+ {
97
+ x: start[0],
98
+ y: chartType === "loader" ? start[1] - (categoryIndex % 2 !== 0 ? 0 : height * 2) : start[1],
99
+ width: end[0] - start[0] || 5,
100
+ height
101
+ },
102
+ {
103
+ x: params.coordSys.x,
104
+ y: params.coordSys.y,
105
+ width: params.coordSys.width,
106
+ height: params.coordSys.height
107
+ }
108
+ );
109
+ return rectShape && {
110
+ type: "rect",
111
+ transition: ["shape"],
112
+ shape: rectShape,
113
+ style: api.style(),
114
+ enterFrom: {
115
+ style: { opacity: 0 },
116
+ x: 0
117
+ }
118
+ };
119
+ }
120
+ const option = {
121
+ tooltip: {
122
+ formatter: (raw) => {
123
+ return formatterFn(raw);
124
+ }
125
+ },
126
+ dataZoom: [
127
+ {
128
+ type: "slider",
129
+ filterMode: "weakFilter",
130
+ showDataShadow: false,
131
+ top: -10,
132
+ labelFormatter: ""
133
+ },
134
+ {
135
+ type: "inside",
136
+ filterMode: "weakFilter"
137
+ }
138
+ ],
139
+ grid: {
140
+ top: 10,
141
+ left: 0,
142
+ bottom: 10,
143
+ right: 0,
144
+ height: categories.length > (chartType === "loader" ? 6 : 3) ? "auto" : categories.length * LINE_HEIGHT,
145
+ containLabel: true
146
+ },
147
+ xAxis: {
148
+ position: "top",
149
+ splitLine: {
150
+ show: false
151
+ },
152
+ scale: true,
153
+ axisLine: {
154
+ show: false
155
+ },
156
+ axisLabel: {
157
+ formatter(val) {
158
+ return dayjs(val).format("HH:mm:ss");
159
+ }
160
+ }
161
+ },
162
+ yAxis: {
163
+ type: "category",
164
+ splitLine: {
165
+ interval: chartType === "loader" ? 1 : 0,
166
+ show: true
167
+ },
168
+ axisLabel: {
169
+ inside: true,
170
+ lineHeight: 20,
171
+ width: 100,
172
+ fontSize: 12,
173
+ color: "#000",
174
+ verticalAlign: "bottom"
175
+ },
176
+ axisLine: {
177
+ show: true
178
+ },
179
+ axisTick: {
180
+ show: false
181
+ },
182
+ data: categories
183
+ },
184
+ series: [
185
+ {
186
+ type: "custom",
187
+ renderItem,
188
+ itemStyle: {
189
+ opacity: 0.8
190
+ },
191
+ encode: {
192
+ x: [1, 2],
193
+ y: 0
194
+ },
195
+ data
196
+ }
197
+ ]
198
+ };
199
+ setOptinsData(option);
200
+ }, [loaderData, pluginsData]);
201
+ return /* @__PURE__ */ jsx(
202
+ ReactECharts,
203
+ {
204
+ option: optionsData,
205
+ echarts,
206
+ style: { width: "100%", minHeight: "400px" }
207
+ }
208
+ );
209
+ });
210
+ export {
211
+ TimelineCom
212
+ };
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import './loader.scss';
3
+ import './tooltips.scss';
4
+ import { CommonChartProps } from './common';
5
+ export declare const BootstrapChartContainer: React.FC<CommonChartProps>;
@@ -0,0 +1,44 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Space } from "antd";
3
+ import { BarChartOutlined } from "@ant-design/icons";
4
+ import { SDK } from "@rsdoctor/types";
5
+ import { TextDrawer } from "../TextDrawer";
6
+ import "./loader.css";
7
+ import "./tooltips.css";
8
+ import { CommonExecutionEmptyTips, CommonExecutionsChart } from "./common";
9
+ import { ServerAPIProvider } from "../Manifest";
10
+ import { Summary } from "@rsdoctor/utils/common";
11
+ const BootstrapChartContainer = ({ summary }) => {
12
+ const { costs = [] } = summary || {};
13
+ const target = costs.find((e) => e.name === Summary.SummaryCostsDataName.Bootstrap);
14
+ const hooks = [
15
+ "environment",
16
+ "afterEnvironment",
17
+ "entryOption",
18
+ "afterPlugins",
19
+ "afterResolvers",
20
+ "initialize",
21
+ "beforeRun",
22
+ "run",
23
+ "watchRun",
24
+ "normalModuleFactory",
25
+ "contextModuleFactory",
26
+ "beforeCompile"
27
+ ];
28
+ if (!target)
29
+ return null;
30
+ return /* @__PURE__ */ jsx(
31
+ TextDrawer,
32
+ {
33
+ drawerProps: { title: 'Chart of the "Bootstrap -> BeforeCompile" stage' },
34
+ text: /* @__PURE__ */ jsxs(Space, { children: [
35
+ "detail",
36
+ /* @__PURE__ */ jsx(BarChartOutlined, {})
37
+ ] }),
38
+ children: /* @__PURE__ */ jsx(ServerAPIProvider, { api: SDK.ServerAPI.API.GetPluginData, body: { hooks }, children: (res) => res && res.length ? /* @__PURE__ */ jsx(CommonExecutionsChart, { plugins: res }) : /* @__PURE__ */ jsx(CommonExecutionEmptyTips, {}) })
39
+ }
40
+ );
41
+ };
42
+ export {
43
+ BootstrapChartContainer
44
+ };
@@ -0,0 +1,13 @@
1
+ import { SDK } from '@rsdoctor/types';
2
+ import React from 'react';
3
+ import './loader.scss';
4
+ import './tooltips.scss';
5
+ import { Metric } from './types';
6
+ export interface CommonChartProps {
7
+ summary: SDK.SummaryData;
8
+ }
9
+ export declare const CommonExecutionsChart: React.FC<{
10
+ plugins: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetPluginData>;
11
+ defaultDatas?: Metric[];
12
+ }>;
13
+ export declare const CommonExecutionEmptyTips: React.FC;
@@ -0,0 +1,56 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Alert, Typography } from "antd";
3
+ import { useEffect, useRef, useState } from "react";
4
+ import { useTheme } from "../../utils";
5
+ import { TimelineCom } from "./TimelineCharts";
6
+ import "./loader.css";
7
+ import "./tooltips.css";
8
+ import { formatterForPlugins, processTrans } from "./utils";
9
+ const CommonExecutionsChart = ({ plugins, defaultDatas = [] }) => {
10
+ const { isDark } = useTheme();
11
+ const ref = useRef(null);
12
+ const [data, setData] = useState([]);
13
+ useEffect(() => {
14
+ const arr = [];
15
+ plugins.forEach((item) => {
16
+ item.data.forEach((el) => {
17
+ arr.push({
18
+ p: item.hook,
19
+ n: `${item.tapName}`,
20
+ s: el.startAt,
21
+ e: el.endAt
22
+ });
23
+ });
24
+ });
25
+ setData([
26
+ ...processTrans(defaultDatas),
27
+ ...processTrans(arr)
28
+ ]);
29
+ }, []);
30
+ return /* @__PURE__ */ jsx(
31
+ "div",
32
+ {
33
+ className: ["loader-chart-container", isDark ? "loader-chart-container_dark" : ""].join(" ").trim(),
34
+ ref,
35
+ style: { width: "100%", height: "600px" },
36
+ children: /* @__PURE__ */ jsx(TimelineCom, { pluginsData: data, formatterFn: formatterForPlugins })
37
+ }
38
+ );
39
+ };
40
+ const CommonExecutionEmptyTips = () => {
41
+ return /* @__PURE__ */ jsx(
42
+ Alert,
43
+ {
44
+ message: /* @__PURE__ */ jsxs(Typography.Text, { children: [
45
+ /* @__PURE__ */ jsx(Typography.Text, { children: "make sure that you have turn on " }),
46
+ /* @__PURE__ */ jsx(Typography.Text, { children: " in configuration for the Rsdoctor plugin." })
47
+ ] }),
48
+ type: "info",
49
+ showIcon: true
50
+ }
51
+ );
52
+ };
53
+ export {
54
+ CommonExecutionEmptyTips,
55
+ CommonExecutionsChart
56
+ };
@@ -0,0 +1,2 @@
1
+ export declare const LITTLE_PALETTE_COLORS: string[];
2
+ export declare const PALETTE_COLORS: string[];
@@ -0,0 +1,46 @@
1
+ const LITTLE_PALETTE_COLORS = [
2
+ "#a8071a",
3
+ "#ad6800",
4
+ "#237804",
5
+ "#006d75",
6
+ "#ad8b00",
7
+ "#ad4e00",
8
+ "#5b8c00",
9
+ "#003eb3"
10
+ ];
11
+ const PALETTE_COLORS = [
12
+ "#4096ff",
13
+ "#69b1ff",
14
+ "#9e1068",
15
+ "#722ed1",
16
+ "#bae0ff",
17
+ "#d3adf7",
18
+ "#597ef7",
19
+ "#ffadd2",
20
+ "#c41d7f",
21
+ "#391085",
22
+ "#ffa940",
23
+ "#5c060b",
24
+ "#a81414",
25
+ "#ff7875",
26
+ "#ffd591",
27
+ "#ffe58f",
28
+ "#d3f261",
29
+ "#d4b106",
30
+ "#7cb305",
31
+ "#f4ffb8",
32
+ "#fa8c16",
33
+ "#0958d9",
34
+ "#fff3f0",
35
+ "#82090d",
36
+ "#ffbfb3",
37
+ "#f44336",
38
+ "#ff998a",
39
+ "#ff7161",
40
+ "#ffe2db",
41
+ "#cf2923"
42
+ ];
43
+ export {
44
+ LITTLE_PALETTE_COLORS,
45
+ PALETTE_COLORS
46
+ };
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { CommonChartProps } from './common';
3
+ import './loader.scss';
4
+ import './tooltips.scss';
5
+ export declare const DoneChartContainer: React.FC<CommonChartProps>;
@@ -0,0 +1,45 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Divider, Space } from "antd";
3
+ import { BarChartOutlined } from "@ant-design/icons";
4
+ import { SDK } from "@rsdoctor/types";
5
+ import { Summary } from "@rsdoctor/utils/common";
6
+ import { TextDrawer } from "../TextDrawer";
7
+ import { Card } from "../Card";
8
+ import { CommonExecutionsChart, CommonExecutionEmptyTips } from "./common";
9
+ import { WebpackPluginsDataTable } from "../Plugins/webpack";
10
+ import { ServerAPIProvider } from "../Manifest";
11
+ import "./loader.css";
12
+ import "./tooltips.css";
13
+ const DoneChartContainer = ({ summary }) => {
14
+ const { costs = [] } = summary || {};
15
+ const target = costs.find((e) => e.name === Summary.SummaryCostsDataName.Done);
16
+ const hooks = [
17
+ "afterCompile",
18
+ "shouldEmit",
19
+ "emit",
20
+ "afterEmit",
21
+ "assetEmitted",
22
+ "done"
23
+ ];
24
+ const suffix = 'of the "AfterCompile -> Done" stage';
25
+ if (!target)
26
+ return null;
27
+ return /* @__PURE__ */ jsx(
28
+ TextDrawer,
29
+ {
30
+ drawerProps: { title: `Details ${suffix}` },
31
+ text: /* @__PURE__ */ jsxs(Space, { children: [
32
+ "detail",
33
+ /* @__PURE__ */ jsx(BarChartOutlined, {})
34
+ ] }),
35
+ children: /* @__PURE__ */ jsx(ServerAPIProvider, { api: SDK.ServerAPI.API.GetPluginData, body: { hooks }, children: (res) => res && res.length ? /* @__PURE__ */ jsxs(Space, { direction: "vertical", style: { width: "100%" }, children: [
36
+ /* @__PURE__ */ jsx(Card, { title: `Plugin DataSource of ${suffix}`, collapsable: true, children: /* @__PURE__ */ jsx(WebpackPluginsDataTable, { dataSource: res }) }),
37
+ /* @__PURE__ */ jsx(Divider, {}),
38
+ /* @__PURE__ */ jsx(Card, { title: `Chart ${suffix}`, children: /* @__PURE__ */ jsx(CommonExecutionsChart, { plugins: res }) })
39
+ ] }) : /* @__PURE__ */ jsx(CommonExecutionEmptyTips, {}) })
40
+ }
41
+ );
42
+ };
43
+ export {
44
+ DoneChartContainer
45
+ };
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { SDK } from '@rsdoctor/types';
3
+ export declare const LoaderChartBase: React.FC<{
4
+ project: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>;
5
+ }>;
6
+ export declare const LoaderChart: React.FC<Omit<{
7
+ project: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>;
8
+ }, "project"> & Partial<{
9
+ body?: any;
10
+ }>>;
@@ -0,0 +1,37 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { Space } from "antd";
4
+ import { SDK } from "@rsdoctor/types";
5
+ import { LoaderCommonSelect } from "../Select";
6
+ import { ServerAPIProvider, withServerAPI } from "../Manifest";
7
+ import { LoaderExecutionsChart } from "./loader";
8
+ import { filterLoader } from "../../utils/loader";
9
+ var ChartDimension = /* @__PURE__ */ ((ChartDimension2) => {
10
+ ChartDimension2[ChartDimension2["Loader"] = 0] = "Loader";
11
+ ChartDimension2[ChartDimension2["Process"] = 1] = "Process";
12
+ return ChartDimension2;
13
+ })(ChartDimension || {});
14
+ const LoaderChartBase = ({ project }) => {
15
+ const { root: cwd } = project;
16
+ const [store, setStore] = useState({ filename: "", loaders: [] });
17
+ const [dimension, setDimension] = useState(0 /* Loader */);
18
+ return /* @__PURE__ */ jsxs(Space, { direction: "vertical", style: { width: "100%" }, children: [
19
+ /* @__PURE__ */ jsx(ServerAPIProvider, { api: SDK.ServerAPI.API.GetLoaderNames, children: (loaderNames) => /* @__PURE__ */ jsx(LoaderCommonSelect, { onChange: setStore, loaderNames }) }),
20
+ /* @__PURE__ */ jsx(ServerAPIProvider, { api: SDK.ServerAPI.API.GetLoaderChartData, children: (res) => {
21
+ const loaders = res.filter((el) => filterLoader(el.resource, el.loader, store.filename, store.loaders));
22
+ return dimension === 0 /* Loader */ ? /* @__PURE__ */ jsx(LoaderExecutionsChart, { loaders, cwd }) : (
23
+ // <ProcessExecutionsChart loaders={loaders} cwd={cwd} pid={pid} />
24
+ /* @__PURE__ */ jsx(Fragment, {})
25
+ );
26
+ } })
27
+ ] });
28
+ };
29
+ const LoaderChart = withServerAPI({
30
+ api: SDK.ServerAPI.API.GetProjectInfo,
31
+ responsePropName: "project",
32
+ Component: LoaderChartBase
33
+ });
34
+ export {
35
+ LoaderChart,
36
+ LoaderChartBase
37
+ };
@@ -0,0 +1,31 @@
1
+ .loader-chart-container .x-axis .tick text {
2
+ transform: translate(28px, 10px) rotate(0) !important;
3
+ font-size: 12px;
4
+ font-weight: 500;
5
+ }
6
+ .loader-chart-container:nth-child(2) text {
7
+ transform: translate(52px, 10px) rotate(0) !important;
8
+ }
9
+ .loader-chart-container:last-child text {
10
+ transform: translate(5px, 10px) rotate(0) !important;
11
+ }
12
+ .loader-chart-container .area .civ {
13
+ transform: translateY(5px);
14
+ }
15
+ .loader-chart-container .area .civ .label-text {
16
+ font-weight: 500;
17
+ font-size: 12px !important;
18
+ transform: translate(8px, 0px);
19
+ }
20
+ .loader-chart-container .area .civ path[fill="#000000"] {
21
+ display: none;
22
+ }
23
+ .loader-chart-container .pia-metrics-y-label {
24
+ display: none;
25
+ }
26
+ .loader-chart-container .pia-metrics-y-label .triangle {
27
+ display: none;
28
+ }
29
+ .loader-chart-container_dark .area .civ .label-text {
30
+ fill: #fff !important;
31
+ }
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './loader.scss';
3
+ import { ChartProps } from './types';
4
+ export declare const LoaderExecutionsChart: React.FC<ChartProps>;
@@ -0,0 +1,88 @@
1
+ import { Fragment, jsx } from "react/jsx-runtime";
2
+ import {
3
+ useCallback,
4
+ useMemo,
5
+ useRef,
6
+ useEffect,
7
+ useState
8
+ } from "react";
9
+ import { groupBy } from "lodash-es";
10
+ import { Empty } from "antd";
11
+ import "./loader.css";
12
+ import { useTheme } from "../../utils/manifest";
13
+ import { findLoaderTotalTiming } from "../../utils/loader";
14
+ import { beautifyPath } from "../../utils/file";
15
+ import { TimelineCom } from "./TimelineCharts";
16
+ import {
17
+ renderTotalLoadersTooltip,
18
+ getTooltipHtmlForLoader,
19
+ useDebounceHook
20
+ } from "./utils";
21
+ const LoaderExecutionsChart = ({
22
+ loaders,
23
+ cwd
24
+ }) => {
25
+ const { isDark } = useTheme();
26
+ const ref = useRef(null);
27
+ const [data, setData] = useState([]);
28
+ const durationMetricData = useDebounceHook(data, 200);
29
+ const groupByLoader = useMemo(
30
+ () => groupBy(loaders, (e) => e.loader),
31
+ [loaders]
32
+ );
33
+ const formatterForLoader = useCallback((raw) => {
34
+ const { name, data: data2 } = raw;
35
+ const loaderName = name.replace(" total", "");
36
+ if (data2?.ext) {
37
+ return getTooltipHtmlForLoader(data2.ext);
38
+ }
39
+ return renderTotalLoadersTooltip(loaderName, loaders, cwd);
40
+ }, []);
41
+ useEffect(() => {
42
+ const _data = Object.keys(groupByLoader).map(
43
+ (loaderName) => {
44
+ const list = groupByLoader[loaderName] || [];
45
+ const { start, end } = findLoaderTotalTiming(list);
46
+ return {
47
+ p: loaderName,
48
+ n: loaderName,
49
+ s: start,
50
+ e: end,
51
+ c: list.map((e) => {
52
+ return {
53
+ p: loaderName,
54
+ // n: loaderName,
55
+ n: beautifyPath(e.resource, cwd),
56
+ s: e.startAt,
57
+ e: e.endAt,
58
+ ext: e
59
+ };
60
+ })
61
+ };
62
+ }
63
+ );
64
+ setData(_data);
65
+ }, [groupByLoader]);
66
+ return /* @__PURE__ */ jsx(Fragment, { children: data?.length ? /* @__PURE__ */ jsx(
67
+ "div",
68
+ {
69
+ className: [
70
+ "loader-chart-container",
71
+ isDark ? "loader-chart-container_dark" : ""
72
+ ].join(" ").trim(),
73
+ ref,
74
+ style: { width: "100%", height: "600px" },
75
+ children: /* @__PURE__ */ jsx(
76
+ TimelineCom,
77
+ {
78
+ loaderData: durationMetricData,
79
+ formatterFn: formatterForLoader,
80
+ chartType: "loader"
81
+ }
82
+ )
83
+ }
84
+ ) : /* @__PURE__ */ jsx(Empty, {}) });
85
+ };
86
+ export {
87
+ LoaderExecutionsChart
88
+ };
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { CommonChartProps } from './common';
3
+ import './loader.scss';
4
+ import './tooltips.scss';
5
+ export declare const MinifyChartContainer: React.FC<CommonChartProps>;
@@ -0,0 +1,37 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { BarChartOutlined } from "@ant-design/icons";
3
+ import { SDK } from "@rsdoctor/types";
4
+ import { Divider, Space } from "antd";
5
+ import { TextDrawer } from "../TextDrawer";
6
+ import { Summary } from "@rsdoctor/utils/common";
7
+ import { Card } from "../Card";
8
+ import { ServerAPIProvider } from "../Manifest";
9
+ import { WebpackPluginsDataTable } from "../Plugins/webpack";
10
+ import { CommonExecutionEmptyTips, CommonExecutionsChart } from "./common";
11
+ import "./loader.css";
12
+ import "./tooltips.css";
13
+ const MinifyChartContainer = ({ summary }) => {
14
+ const hooks = ["processAssets", "optimizeChunkAssets"];
15
+ const { costs = [] } = summary || {};
16
+ const target = costs.find((e) => e.name === Summary.SummaryCostsDataName.Minify);
17
+ if (!target)
18
+ return null;
19
+ return /* @__PURE__ */ jsx(
20
+ TextDrawer,
21
+ {
22
+ drawerProps: { title: 'Details of the "Minify" stage' },
23
+ text: /* @__PURE__ */ jsxs(Space, { children: [
24
+ "detail",
25
+ /* @__PURE__ */ jsx(BarChartOutlined, {})
26
+ ] }),
27
+ children: /* @__PURE__ */ jsx(ServerAPIProvider, { api: SDK.ServerAPI.API.GetPluginData, body: { hooks }, children: (res) => res && res.length ? /* @__PURE__ */ jsxs(Space, { direction: "vertical", style: { width: "100%" }, children: [
28
+ /* @__PURE__ */ jsx(Card, { title: 'Plugin DataSource of the "Minify"', collapsable: true, children: /* @__PURE__ */ jsx(WebpackPluginsDataTable, { dataSource: res }) }),
29
+ /* @__PURE__ */ jsx(Divider, {}),
30
+ /* @__PURE__ */ jsx(Card, { title: 'Chart of the "Minify"', children: /* @__PURE__ */ jsx(CommonExecutionsChart, { plugins: res }) })
31
+ ] }) : /* @__PURE__ */ jsx(CommonExecutionEmptyTips, {}) })
32
+ }
33
+ );
34
+ };
35
+ export {
36
+ MinifyChartContainer
37
+ };