@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,45 @@
1
+ /// <reference types="react" />
2
+ import { Client, Manifest, SDK } from '@rsdoctor/types';
3
+ import { UpdateType } from './constants';
4
+ import { InferServerAPIBody } from '../../Manifest';
5
+ export type BundleDiffServerAPIProviderComponentCommonProps<T extends SDK.ServerAPI.API | SDK.ServerAPI.APIExtends> = {
6
+ manifests?: Manifest.RsdoctorManifest[];
7
+ api: T;
8
+ children: (baseline: SDK.ServerAPI.InferResponseType<T>, current: SDK.ServerAPI.InferResponseType<T>) => JSX.Element;
9
+ } & InferServerAPIBody<T>;
10
+ export interface BundleDiffContainerProps {
11
+ manifests: Manifest.RsdoctorManifest[];
12
+ }
13
+ export interface BundleDiffComponentCommonProps {
14
+ baseline: Manifest.RsdoctorManifest;
15
+ current: Manifest.RsdoctorManifest;
16
+ onlyBaseline: boolean;
17
+ assetsDiffResult: Client.RsdoctorClientAssetsDiffResult;
18
+ }
19
+ export interface BundleDiffComponentCardProps {
20
+ baseline: SDK.ServerAPI.ResponseTypes[SDK.ServerAPI.API.GetBundleDiffSummary];
21
+ current: SDK.ServerAPI.ResponseTypes[SDK.ServerAPI.API.GetBundleDiffSummary];
22
+ onlyBaseline: boolean;
23
+ assetsDiffResult: Client.RsdoctorClientAssetsDiffResult;
24
+ }
25
+ export interface BundleDiffTableOverviewData {
26
+ total: Client.RsdoctorClientAssetsDiffItem;
27
+ initial?: Client.RsdoctorClientAssetsDiffItem;
28
+ }
29
+ export interface BundleDiffTableAssetsData {
30
+ alias: string;
31
+ baseline?: SDK.AssetData;
32
+ current?: SDK.AssetData;
33
+ }
34
+ export interface BundleDiffTableModulesData {
35
+ [key: string]: unknown;
36
+ path: string;
37
+ baseline?: SDK.ModuleData;
38
+ current?: SDK.ModuleData;
39
+ }
40
+ export interface BundleDiffTablePackagesData {
41
+ name: string;
42
+ updateType: UpdateType;
43
+ baseline?: SDK.PackageData[];
44
+ current?: SDK.PackageData[];
45
+ }
@@ -0,0 +1,2 @@
1
+ import { Client } from '@rsdoctor/types';
2
+ export declare const formatDiffSize: (bSize: number, cSize: number, state: Client.RsdoctorClientDiffState, propsStyle?: Record<string, string | number>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { formatSize } from "@rsdoctor/components/utils";
3
+ import { Client } from "@rsdoctor/types";
4
+ import { Typography } from "antd";
5
+ import { Color } from "../../../constants";
6
+ const formatDiffSize = (bSize, cSize, state, propsStyle) => {
7
+ return /* @__PURE__ */ jsx(Fragment, { children: cSize - bSize === 0 ? /* @__PURE__ */ jsx(Fragment, {}) : /* @__PURE__ */ jsxs(
8
+ Typography.Text,
9
+ {
10
+ strong: true,
11
+ style: {
12
+ color: state === Client.RsdoctorClientDiffState.Up ? Color.Red : Color.Green,
13
+ ...propsStyle
14
+ },
15
+ children: [
16
+ state === Client.RsdoctorClientDiffState.Up ? "+" : "-",
17
+ formatSize(Math.abs(cSize - bSize))
18
+ ]
19
+ }
20
+ ) });
21
+ };
22
+ export {
23
+ formatDiffSize
24
+ };
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { SDK } from '@rsdoctor/types';
3
+ import { BundleDiffServerAPIProviderComponentCommonProps } from '../DiffContainer/types';
4
+ export declare const DiffServerAPIProvider: <T extends SDK.ServerAPI.API | SDK.ServerAPI.APIExtends>(props: BundleDiffServerAPIProviderComponentCommonProps<T>) => JSX.Element;
@@ -0,0 +1,37 @@
1
+ import { Fragment, jsx } from "react/jsx-runtime";
2
+ import { Client } from "@rsdoctor/types";
3
+ import { Empty } from "antd";
4
+ import { ServerAPIProvider } from "../../Manifest";
5
+ import { useUrlQuery, fetchManifest } from "../../../utils";
6
+ const DiffServerAPIProvider = (props) => {
7
+ const { api, body, children, manifests } = props;
8
+ const query = useUrlQuery();
9
+ const [baselineFile, currentFile] = query[Client.RsdoctorClientUrlQuery.BundleDiffFiles]?.split(",") || [];
10
+ if (manifests?.length) {
11
+ return /* @__PURE__ */ jsx(Fragment, { children: children(manifests[0].data, manifests[1].data) });
12
+ }
13
+ return /* @__PURE__ */ jsx(
14
+ ServerAPIProvider,
15
+ {
16
+ api,
17
+ body,
18
+ manifestLoader: baselineFile ? () => fetchManifest(baselineFile) : void 0,
19
+ children: (baseline) => {
20
+ return baseline ? /* @__PURE__ */ jsx(
21
+ ServerAPIProvider,
22
+ {
23
+ api,
24
+ body,
25
+ manifestLoader: currentFile ? () => fetchManifest(currentFile) : void 0,
26
+ children: (current) => {
27
+ return current ? children(baseline, current) : /* @__PURE__ */ jsx(Empty, {});
28
+ }
29
+ }
30
+ ) : /* @__PURE__ */ jsx(Empty, {});
31
+ }
32
+ }
33
+ );
34
+ };
35
+ export {
36
+ DiffServerAPIProvider
37
+ };
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { Client, Manifest } from '@rsdoctor/types';
3
+ export declare const name = "Bundle Diff";
4
+ export declare const route = Client.RsdoctorClientRoutes.BundleDiff;
5
+ export declare const BundleDiffContext: React.Context<{
6
+ manifests: Manifest.RsdoctorManifest[];
7
+ setManifests(_manifests: Manifest.RsdoctorManifest[]): void;
8
+ loading: boolean;
9
+ setLoading(_loading: boolean): void;
10
+ withLoading(_func: (...args: unknown[]) => Promise<unknown> | unknown): Promise<void>;
11
+ }>;
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import { Client } from "@rsdoctor/types";
3
+ const name = "Bundle Diff";
4
+ const route = Client.RsdoctorClientRoutes.BundleDiff;
5
+ const BundleDiffContext = React.createContext({
6
+ manifests: [],
7
+ setManifests(_manifests) {
8
+ },
9
+ loading: false,
10
+ setLoading(_loading) {
11
+ },
12
+ async withLoading(_func) {
13
+ }
14
+ });
15
+ export {
16
+ BundleDiffContext,
17
+ name,
18
+ route
19
+ };
@@ -0,0 +1 @@
1
+ export * from './DiffContainer';
@@ -0,0 +1 @@
1
+ export * from "./DiffContainer";
@@ -0,0 +1,24 @@
1
+ import { Client } from '@rsdoctor/types';
2
+ import React from 'react';
3
+ export { StatisticCard } from './statistic';
4
+ export interface DiffCardProps extends Pick<DiffCardContentProps, 'formatter'> {
5
+ titles: Array<string> | [string | React.ReactNode];
6
+ datas: Array<DiffCardContentProps['data']>;
7
+ showPercentInTitle?: boolean;
8
+ }
9
+ export interface DiffCardContentProps {
10
+ data: Client.RsdoctorClientAssetsDiffItem;
11
+ formatter?(v: number, target: 'baseline' | 'current'): number | string | React.ReactNode;
12
+ }
13
+ export interface PercentProps {
14
+ percent: number;
15
+ state: Client.RsdoctorClientDiffState;
16
+ fontSize?: React.CSSProperties['fontSize'];
17
+ }
18
+ export declare const SizePercent: React.FC<{
19
+ baseline: number;
20
+ current: number;
21
+ } & Omit<PercentProps, 'percent' | 'state'>>;
22
+ export declare const Percent: React.FC<PercentProps>;
23
+ export declare const DiffCardContent: React.FC<DiffCardContentProps>;
24
+ export declare const DiffCard: React.FC<DiffCardProps>;
@@ -0,0 +1,116 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Client } from "@rsdoctor/types";
3
+ import { Segmented, Space, Tooltip, Typography } from "antd";
4
+ import { Graph } from "@rsdoctor/utils/common";
5
+ import { useState } from "react";
6
+ import { formatSize } from "../../utils";
7
+ import { Color } from "../../constants";
8
+ import { StatisticCard } from "./statistic";
9
+ import { StatisticCard as StatisticCard2 } from "./statistic";
10
+ const SizePercent = ({ baseline, current, ...rest }) => {
11
+ const diff = Graph.diffSize(baseline, current);
12
+ return /* @__PURE__ */ jsx(Percent, { ...rest, ...diff });
13
+ };
14
+ const Percent = ({
15
+ percent,
16
+ state,
17
+ fontSize = 14
18
+ }) => {
19
+ const _percent = +percent.toFixed(2);
20
+ if (_percent > 0) {
21
+ const percentText = `${_percent}`;
22
+ if (state === Client.RsdoctorClientDiffState.Up) {
23
+ return /* @__PURE__ */ jsxs(Typography.Text, { strong: true, style: { fontSize, color: Color.Red }, children: [
24
+ "+",
25
+ percentText,
26
+ "%"
27
+ ] });
28
+ }
29
+ if (state === Client.RsdoctorClientDiffState.Down) {
30
+ return /* @__PURE__ */ jsxs(Typography.Text, { strong: true, style: { fontSize, color: Color.Green }, children: [
31
+ "-",
32
+ percentText,
33
+ "%"
34
+ ] });
35
+ }
36
+ }
37
+ return null;
38
+ };
39
+ const DiffCardContent = ({
40
+ data,
41
+ formatter
42
+ }) => {
43
+ const { percent, state, size } = data;
44
+ const { baseline, current } = size;
45
+ const bSize = formatter ? formatter(baseline, "baseline") : formatSize(baseline);
46
+ const cSize = formatter ? formatter(current, "current") : formatSize(current);
47
+ return /* @__PURE__ */ jsx(Space, { align: "start", children: /* @__PURE__ */ jsxs(Space, { direction: "vertical", style: { textAlign: "left" }, children: [
48
+ /* @__PURE__ */ jsxs(Space, { children: [
49
+ /* @__PURE__ */ jsx(Typography.Text, { style: { fontSize: 10, color: "inherit" }, keyboard: true, children: "Current" }),
50
+ /* @__PURE__ */ jsx(
51
+ Tooltip,
52
+ {
53
+ title: typeof cSize === "number" || typeof cSize === "string" ? `Value of Current is ${cSize}` : void 0,
54
+ children: /* @__PURE__ */ jsx(Typography.Text, { style: { fontSize: 16, color: "inherit" }, strong: true, children: cSize })
55
+ }
56
+ ),
57
+ /* @__PURE__ */ jsx(Percent, { percent, state })
58
+ ] }),
59
+ /* @__PURE__ */ jsxs(Space, { children: [
60
+ /* @__PURE__ */ jsx(Typography.Text, { style: { fontSize: 10, color: "inherit" }, keyboard: true, children: "Baseline" }),
61
+ /* @__PURE__ */ jsx(
62
+ Tooltip,
63
+ {
64
+ title: typeof bSize === "number" || typeof bSize === "string" ? `Value of Baseline is ${bSize}` : void 0,
65
+ children: /* @__PURE__ */ jsx(Typography.Text, { style: { fontSize: 14 }, type: "secondary", children: bSize })
66
+ }
67
+ )
68
+ ] })
69
+ ] }) });
70
+ };
71
+ const DiffCard = ({
72
+ titles,
73
+ datas,
74
+ formatter,
75
+ showPercentInTitle
76
+ }) => {
77
+ const [idx, setIdx] = useState(0);
78
+ return /* @__PURE__ */ jsx(
79
+ StatisticCard,
80
+ {
81
+ title: titles.length > 1 ? /* @__PURE__ */ jsx(
82
+ Segmented,
83
+ {
84
+ defaultValue: titles[idx],
85
+ options: showPercentInTitle ? titles.map((e, i) => {
86
+ const data = datas[i];
87
+ return {
88
+ label: /* @__PURE__ */ jsxs(Space, { children: [
89
+ /* @__PURE__ */ jsx(Typography.Text, { children: e }),
90
+ /* @__PURE__ */ jsx(Percent, { percent: data.percent, state: data.state })
91
+ ] }),
92
+ value: e
93
+ };
94
+ }) : titles,
95
+ onChange: (e) => {
96
+ setIdx(titles.indexOf(e));
97
+ },
98
+ size: "small",
99
+ style: { transition: "transform 0.3s ease" },
100
+ value: titles[idx] || titles[0]
101
+ }
102
+ ) : titles[idx],
103
+ value: /* @__PURE__ */ jsx(DiffCardContent, { data: datas[idx], formatter }),
104
+ statisticProps: {
105
+ style: { textAlign: "left" }
106
+ }
107
+ }
108
+ );
109
+ };
110
+ export {
111
+ DiffCard,
112
+ DiffCardContent,
113
+ Percent,
114
+ SizePercent,
115
+ StatisticCard2 as StatisticCard
116
+ };
@@ -0,0 +1,9 @@
1
+ import { CardProps as CProps } from 'antd';
2
+ import React, { CSSProperties } from 'react';
3
+ export * from './diff';
4
+ export interface CardProps extends CProps {
5
+ collapsable?: boolean;
6
+ dividerStyle?: CSSProperties;
7
+ defaultCollapsed?: boolean;
8
+ }
9
+ export declare const Card: React.FC<CardProps>;
@@ -0,0 +1,50 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import {
3
+ ColumnHeightOutlined,
4
+ VerticalAlignMiddleOutlined
5
+ } from "@ant-design/icons";
6
+ import { Card as C, Space, Button, Divider } from "antd";
7
+ import { useState } from "react";
8
+ export * from "./diff";
9
+ const Card = ({
10
+ collapsable = false,
11
+ children,
12
+ title,
13
+ dividerStyle,
14
+ defaultCollapsed = false,
15
+ ...rest
16
+ }) => {
17
+ const [collapsed, setCollapsed] = useState(defaultCollapsed);
18
+ if (title && collapsable) {
19
+ return /* @__PURE__ */ jsx(
20
+ C,
21
+ {
22
+ ...rest,
23
+ title: /* @__PURE__ */ jsxs(Space, { style: { fontSize: "inherit" }, children: [
24
+ /* @__PURE__ */ jsx(
25
+ Button,
26
+ {
27
+ icon: collapsed ? /* @__PURE__ */ jsx(ColumnHeightOutlined, {}) : /* @__PURE__ */ jsx(VerticalAlignMiddleOutlined, {}),
28
+ onClick: () => setCollapsed(!collapsed),
29
+ size: "small"
30
+ }
31
+ ),
32
+ title
33
+ ] }),
34
+ children: collapsed ? /* @__PURE__ */ jsx(Divider, { orientation: "center", style: dividerStyle, plain: true, children: /* @__PURE__ */ jsx(
35
+ Button,
36
+ {
37
+ icon: /* @__PURE__ */ jsx(ColumnHeightOutlined, {}),
38
+ type: "text",
39
+ onClick: () => setCollapsed(!collapsed),
40
+ children: "show more"
41
+ }
42
+ ) }) : children
43
+ }
44
+ );
45
+ }
46
+ return /* @__PURE__ */ jsx(C, { title, ...rest, children });
47
+ };
48
+ export {
49
+ Card
50
+ };
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ export interface SizeCardProps {
3
+ files: {
4
+ path: string;
5
+ size: number;
6
+ }[];
7
+ /**
8
+ * total size for origin files
9
+ */
10
+ total: number;
11
+ /**
12
+ * @default false
13
+ */
14
+ showProgress?: boolean;
15
+ tagBgColor: string;
16
+ }
17
+ export interface bgColorType {
18
+ bgColor: string;
19
+ tagBgColor: string;
20
+ }
21
+ export declare const SizeCard: React.FC<SizeCardProps>;
@@ -0,0 +1,79 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { ExceptionOutlined } from "@ant-design/icons";
3
+ import { Empty, Progress, Space, Tag, Tooltip, Typography, theme } from "antd";
4
+ import { sumBy } from "lodash-es";
5
+ import { useMemo } from "react";
6
+ import { createFileStructures, formatSize } from "../../utils";
7
+ import { FileTree } from "../FileTree";
8
+ import { TextDrawer } from "../TextDrawer";
9
+ const height = 100;
10
+ const { useToken } = theme;
11
+ const SizeCard = ({ files, total, showProgress = false, tagBgColor }) => {
12
+ const { token } = useToken();
13
+ const sum = useMemo(() => {
14
+ return sumBy(files, (e) => e.size);
15
+ }, [files]);
16
+ const fileStructures = useMemo(() => {
17
+ return createFileStructures({
18
+ files: files.map((e) => e.path),
19
+ fileTitle(file, basename) {
20
+ const { size } = files.find((e) => e.path === file);
21
+ return /* @__PURE__ */ jsxs(Space, { children: [
22
+ /* @__PURE__ */ jsx(Typography.Text, { children: basename }),
23
+ /* @__PURE__ */ jsx(Tag, { color: "success", children: formatSize(size) })
24
+ ] });
25
+ }
26
+ });
27
+ }, [files]);
28
+ if (fileStructures.length === 0) {
29
+ return /* @__PURE__ */ jsx(Space, { style: { height, fontSize: 24 }, align: "center", children: /* @__PURE__ */ jsx(Tag, { bordered: false, color: tagBgColor, children: /* @__PURE__ */ jsxs(Typography.Text, { style: { fontSize: 14, color: token.colorWhite }, children: [
30
+ /* @__PURE__ */ jsxs(Typography.Text, { style: { color: token.colorWhite }, children: [
31
+ " ",
32
+ 0
33
+ ] }),
34
+ ` Files`
35
+ ] }) }) });
36
+ }
37
+ return /* @__PURE__ */ jsxs(Space, { style: { height }, align: "center", children: [
38
+ showProgress ? sum === 0 ? /* @__PURE__ */ jsx(Empty, {}) : /* @__PURE__ */ jsx(
39
+ Progress,
40
+ {
41
+ type: "dashboard",
42
+ percent: +(sum / total * 100).toFixed(2),
43
+ strokeColor: { "0%": "#108ee9", "100%": "#87d068" },
44
+ width: 80
45
+ }
46
+ ) : null,
47
+ /* @__PURE__ */ jsx(
48
+ TextDrawer,
49
+ {
50
+ text: /* @__PURE__ */ jsx(Tooltip, { title: "Click to show the total files", children: /* @__PURE__ */ jsxs(Space, { style: { textAlign: showProgress ? "left" : "center" }, align: "end", children: [
51
+ /* @__PURE__ */ jsxs(Space, { direction: "vertical", children: [
52
+ /* @__PURE__ */ jsx(Tag, { bordered: false, color: tagBgColor, children: /* @__PURE__ */ jsxs(Typography.Text, { style: { fontSize: 14, color: token.colorWhite }, children: [
53
+ /* @__PURE__ */ jsxs(Typography.Text, { style: { color: token.colorWhite }, children: [
54
+ " ",
55
+ files.length
56
+ ] }),
57
+ ` Files`
58
+ ] }) }),
59
+ /* @__PURE__ */ jsx(Typography.Text, { style: { fontSize: 20 }, children: formatSize(sum) })
60
+ ] }),
61
+ /* @__PURE__ */ jsx(ExceptionOutlined, { style: { transform: "translateY(-3.5px)" } })
62
+ ] }) }),
63
+ buttonStyle: { height: "100%" },
64
+ buttonProps: { type: "text" },
65
+ children: /* @__PURE__ */ jsx(
66
+ FileTree,
67
+ {
68
+ treeData: fileStructures,
69
+ defaultExpandAll: true,
70
+ titleRender: (v) => /* @__PURE__ */ jsx(Typography.Text, { children: v.title })
71
+ }
72
+ )
73
+ }
74
+ )
75
+ ] });
76
+ };
77
+ export {
78
+ SizeCard
79
+ };
@@ -0,0 +1,17 @@
1
+ .statistic-card {
2
+ border-radius: 8px;
3
+ text-align: center;
4
+ padding: 24px;
5
+ }
6
+ .statistic-card-title {
7
+ font-size: 14px;
8
+ font-weight: 500;
9
+ }
10
+ .statistic-card-light {
11
+ background: white;
12
+ border: 1px solid #eee;
13
+ box-shadow: 0px 0px 50px 0px #dcf2f4;
14
+ }
15
+ .statistic-card-dark {
16
+ background: rgb(20, 20, 20);
17
+ }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { StatisticProps } from 'antd';
3
+ import './statistic.sass';
4
+ export interface StatisticCardProps {
5
+ title: string | React.ReactNode;
6
+ value: string | React.ReactNode;
7
+ statisticProps?: StatisticProps;
8
+ boxProps?: {
9
+ style?: React.CSSProperties;
10
+ };
11
+ }
12
+ export declare const StatisticCard: React.FC<StatisticCardProps>;
@@ -0,0 +1,19 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Statistic } from "antd";
3
+ import "./statistic.css";
4
+ import { useTheme } from "../../utils";
5
+ const StatisticCard = ({ title, value, statisticProps, boxProps }) => {
6
+ const { theme } = useTheme();
7
+ return /* @__PURE__ */ jsx("div", { className: ["statistic-card", `statistic-card-${theme}`].join(" "), ...boxProps, children: /* @__PURE__ */ jsx(
8
+ Statistic,
9
+ {
10
+ title: /* @__PURE__ */ jsx("div", { className: "statistic-card-title", children: title }),
11
+ valueRender: () => value,
12
+ valueStyle: { fontSize: 24 },
13
+ ...statisticProps
14
+ }
15
+ ) });
16
+ };
17
+ export {
18
+ StatisticCard
19
+ };
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { DurationMetric, ITraceEventData } from '../types';
3
+ export declare const TimelineCom: React.FC<{
4
+ loaderData?: DurationMetric[];
5
+ pluginsData?: ITraceEventData[];
6
+ formatterFn: Function;
7
+ chartType?: string;
8
+ }>;