@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
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023-present Bytedance, Inc. and its affiliates.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # Rsdoctor Components
2
+
3
+ This package is the Rsdoctor reporting platform’s components.
4
+
5
+ ## features
6
+
7
+ - Rsdoctor is a one-stop tool for diagnosing and analyzing the build process and build artifacts.
8
+ - Rsdoctor is a tool that supports Webpack and Rspack build analysis.
9
+ - Rsdoctor is an analysis tool that can display the time-consuming and behavioral details of the compilation.
10
+ - Rsdoctor is a tool that provides bundle Diff and other anti-degradation capabilities simultaneously.
11
+
12
+ ## Documentation
13
+
14
+ https://rsdoctor.dev/
15
+
16
+ ## Contributing
17
+
18
+ Please read the [Contributing Guide](https://github.com/web-infra-dev/rsdoctor/blob/main/CONTRIBUTING.md).
19
+
20
+ ## License
21
+
22
+ Rsdoctor is [MIT licensed](https://github.com/web-infra-dev/rsdoctor/blob/main/LICENSE).
@@ -0,0 +1 @@
1
+ <?xml version="1.0" encoding="UTF-8"?><svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 24L43 24" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M28 4H20C18.8954 4 18 4.89543 18 6V14C18 15.1046 18.8954 16 20 16H28C29.1046 16 30 15.1046 30 14V6C30 4.89543 29.1046 4 28 4Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/><path d="M16 32H8C6.89543 32 6 32.8954 6 34V42C6 43.1046 6.89543 44 8 44H16C17.1046 44 18 43.1046 18 42V34C18 32.8954 17.1046 32 16 32Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/><path d="M40 32H32C30.8954 32 30 32.8954 30 34V42C30 43.1046 30.8954 44 32 44H40C41.1046 44 42 43.1046 42 42V34C42 32.8954 41.1046 32 40 32Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/><path d="M24 24V16" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M36 32V24" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M12 32V24" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>
@@ -0,0 +1 @@
1
+ <svg viewBox="0 0 1200 1200" xmlns="http://www.w3.org/2000/svg"><path d="m600 0 530.3 300v600l-530.3 300-530.3-300v-600z" fill="#fff"/><path d="m1035.6 879.3-418.1 236.5v-184.2l260.5-143.3zm28.6-25.9v-494.6l-153 88.3v317.9zm-901.5 25.9 418.1 236.5v-184.2l-260.5-143.3zm-28.6-25.9v-494.6l153 88.3v317.9zm17.9-526.6 428.8-242.6v178.1l-274.7 151.1-2.1 1.2zm894.3 0-428.8-242.6v178.1l274.7 151.1 2.1 1.2z" fill="#8ed6fb"/><path d="m580.8 889.7-257-141.3v-280l257 148.4zm36.7 0 257-141.3v-280l-257 148.4zm-276.3-453.7 258-141.9 258 141.9-258 149z" fill="#1c78c0"/></svg>
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { CodeChangeAlertProps } from './types';
3
+ interface FixedProps {
4
+ setIsFixed(val: boolean): void;
5
+ }
6
+ export declare const CodeChangeDrawerContent: React.FC<CodeChangeAlertProps & FixedProps>;
7
+ export declare const CodeChangeAlert: React.FC<CodeChangeAlertProps>;
8
+ export {};
@@ -0,0 +1,93 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import axios from "axios";
4
+ import { Space, Alert, Button, Typography, Divider, Popconfirm, Row, Col } from "antd";
5
+ import { InfoCircleOutlined, CheckOutlined } from "@ant-design/icons";
6
+ import { SDK } from "@rsdoctor/types";
7
+ import { useRuleIndexNavigate } from "../../utils";
8
+ import { TextDrawer } from "../TextDrawer";
9
+ import { Title } from "../Title";
10
+ import { CodeOpener } from "../Opener";
11
+ import { DiffViewer } from "../CodeViewer";
12
+ const CodeChangeDrawerContent = ({ data, setIsFixed, cwd }) => {
13
+ const { file, id } = data;
14
+ const { path, line, isFixed, actual, expected } = file;
15
+ const applyFix = () => {
16
+ axios.post(SDK.ServerAPI.API.ApplyErrorFix, { id }).then(() => {
17
+ setIsFixed(true);
18
+ });
19
+ };
20
+ const FixButton = () => {
21
+ return /* @__PURE__ */ jsx(
22
+ Popconfirm,
23
+ {
24
+ title: `Did you confirm to apply the change i the area below ?`,
25
+ onConfirm: applyFix,
26
+ okText: "Yes",
27
+ cancelText: "Cancel",
28
+ zIndex: 99999,
29
+ disabled: isFixed,
30
+ placement: "bottom",
31
+ children: /* @__PURE__ */ jsx(Button, { type: "primary", size: "small", icon: isFixed ? /* @__PURE__ */ jsx(CheckOutlined, {}) : void 0, disabled: isFixed, children: isFixed ? "Fix Applied" : "Apply Fix" })
32
+ }
33
+ );
34
+ };
35
+ return /* @__PURE__ */ jsxs(Space, { direction: "vertical", className: "alert-space", children: [
36
+ /* @__PURE__ */ jsxs("div", { children: [
37
+ /* @__PURE__ */ jsx(Title, { text: isFixed ? "Fix History" : "Suggest Fix" }),
38
+ /* @__PURE__ */ jsx("span", { className: "code-change-tag-list", children: /* @__PURE__ */ jsx(FixButton, {}) })
39
+ ] }),
40
+ /* @__PURE__ */ jsx(CodeOpener, { cwd, url: path, loc: String(line), code: true, disabled: true }),
41
+ /* @__PURE__ */ jsxs(Row, { children: [
42
+ /* @__PURE__ */ jsx(Col, { span: 12, children: /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: "Before" }) }),
43
+ /* @__PURE__ */ jsx(Col, { span: 12, children: /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: "After" }) })
44
+ ] }),
45
+ /* @__PURE__ */ jsx(DiffViewer, { className: "full-space", filepath: path, before: actual, after: expected })
46
+ ] });
47
+ };
48
+ const CodeChangeAlert = ({ data, cwd }) => {
49
+ const { title, description = "", level, code, file } = data;
50
+ const [isFixed, setIsFixed] = useState(file.isFixed ?? false);
51
+ const navigate = useRuleIndexNavigate(code, data.link);
52
+ const fixFile = (val) => {
53
+ setIsFixed(val);
54
+ file.isFixed = val;
55
+ };
56
+ const Description = /* @__PURE__ */ jsxs(Space, { direction: "vertical", children: [
57
+ /* @__PURE__ */ jsx(Typography.Text, { children: description }),
58
+ /* @__PURE__ */ jsxs(Space, { children: [
59
+ /* @__PURE__ */ jsx(Typography.Text, { children: "File:" }),
60
+ /* @__PURE__ */ jsx(Typography.Text, { strong: true, code: true, children: file.path }),
61
+ /* @__PURE__ */ jsx(Typography.Text, { children: "in line" }),
62
+ /* @__PURE__ */ jsx(Typography.Text, { strong: true, code: true, children: file.line })
63
+ ] })
64
+ ] });
65
+ return /* @__PURE__ */ jsx(
66
+ Alert,
67
+ {
68
+ showIcon: true,
69
+ message: /* @__PURE__ */ jsxs(Space, { children: [
70
+ /* @__PURE__ */ jsx(Typography.Text, { code: true, strong: true, onClick: navigate, style: { cursor: "pointer" }, children: /* @__PURE__ */ jsx("a", { children: code }) }),
71
+ /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: title })
72
+ ] }),
73
+ description: Description,
74
+ type: isFixed ? "success" : level === "warn" ? "info" : level,
75
+ action: /* @__PURE__ */ jsxs(Space, { children: [
76
+ /* @__PURE__ */ jsx(
77
+ TextDrawer,
78
+ {
79
+ text: isFixed ? "Fixed | Show Fix History" : "Show Fix Suggestion",
80
+ buttonProps: { size: "small" },
81
+ children: /* @__PURE__ */ jsx(CodeChangeDrawerContent, { data, setIsFixed: fixFile, cwd })
82
+ }
83
+ ),
84
+ /* @__PURE__ */ jsx(Divider, { type: "vertical" }),
85
+ /* @__PURE__ */ jsx(Button, { type: "link", onClick: navigate, size: "small", children: /* @__PURE__ */ jsx(InfoCircleOutlined, {}) })
86
+ ] })
87
+ }
88
+ );
89
+ };
90
+ export {
91
+ CodeChangeAlert,
92
+ CodeChangeDrawerContent
93
+ };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { FileRelationAlertProps } from './types';
3
+ export declare const FileRelationAlert: React.FC<FileRelationAlertProps>;
@@ -0,0 +1,9 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Alert } from "antd";
3
+ const FileRelationAlert = ({ data }) => {
4
+ const { description = "", level } = data;
5
+ return /* @__PURE__ */ jsx(Alert, { type: level === "warn" ? "info" : level, description });
6
+ };
7
+ export {
8
+ FileRelationAlert
9
+ };
@@ -0,0 +1,32 @@
1
+ .file-inline-decoration {
2
+ cursor: pointer;
3
+ text-decoration: underline;
4
+ background: rgb(77, 112, 151);
5
+ }
6
+ .alert-space,
7
+ .full-space {
8
+ width: 100%;
9
+ height: 100%;
10
+ }
11
+ .alert-space > *:last-child,
12
+ .full-space > *:last-child {
13
+ flex-grow: 1;
14
+ }
15
+ .full-space {
16
+ flex-grow: 1;
17
+ }
18
+ .code-change-tag-list {
19
+ margin-left: 10px;
20
+ }
21
+ .tabs-space {
22
+ width: 100%;
23
+ height: 100%;
24
+ }
25
+ .tabs-space .ant-tabs-content,
26
+ .tabs-space .ant-tabs-tabpane {
27
+ width: 100%;
28
+ height: 100%;
29
+ }
30
+ .ant-alert-warning {
31
+ border: none;
32
+ }
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { AlertProps } from './types';
3
+ import './index.sass';
4
+ export declare const Alert: React.FC<AlertProps>;
@@ -0,0 +1,37 @@
1
+ import { Fragment, jsx } from "react/jsx-runtime";
2
+ import { LinkRuleAlert } from "./link";
3
+ import { FileRelationAlert } from "./file-relation";
4
+ import { PackageRelationAlert } from "./package-relation";
5
+ import { CodeChangeAlert } from "./change";
6
+ import { CodeViewAlert } from "./view";
7
+ import "./index.css";
8
+ const Alert = (props) => {
9
+ const { data, cwd = "" } = props;
10
+ if (data.type === "file-relation") {
11
+ return /* @__PURE__ */ jsx(FileRelationAlert, { data });
12
+ }
13
+ if (data.type === "code-view") {
14
+ return /* @__PURE__ */ jsx(CodeViewAlert, { data, cwd });
15
+ }
16
+ if (data.type === "code-change") {
17
+ return /* @__PURE__ */ jsx(CodeChangeAlert, { data, cwd });
18
+ }
19
+ if (data.type === "emo") {
20
+ return /* @__PURE__ */ jsx(Fragment, {});
21
+ }
22
+ if (data.type === "package-relation") {
23
+ const { getPackageRelationContentComponent } = props;
24
+ return /* @__PURE__ */ jsx(
25
+ PackageRelationAlert,
26
+ {
27
+ data,
28
+ cwd,
29
+ getPackageRelationContentComponent
30
+ }
31
+ );
32
+ }
33
+ return /* @__PURE__ */ jsx(LinkRuleAlert, { data });
34
+ };
35
+ export {
36
+ Alert
37
+ };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { LinkAlertProps } from './types';
3
+ export declare const LinkRuleAlert: React.FC<LinkAlertProps>;
@@ -0,0 +1,27 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Alert, Button, Space, Typography } from "antd";
3
+ import { InfoCircleOutlined } from "@ant-design/icons";
4
+ import { useRuleIndexNavigate } from "../../utils";
5
+ const LinkRuleAlert = ({ data }) => {
6
+ const { title, description = "", level, code } = data;
7
+ const navigate = useRuleIndexNavigate(code, data.link);
8
+ return /* @__PURE__ */ jsx(
9
+ Alert,
10
+ {
11
+ showIcon: true,
12
+ message: /* @__PURE__ */ jsxs(Space, { children: [
13
+ /* @__PURE__ */ jsx(Typography.Text, { code: true, strong: true, onClick: navigate, style: { cursor: "pointer" }, children: /* @__PURE__ */ jsx("a", { children: code }) }),
14
+ /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: title })
15
+ ] }),
16
+ description: /* @__PURE__ */ jsx("div", { dangerouslySetInnerHTML: { __html: description } }),
17
+ type: level === "warn" ? "info" : level,
18
+ action: /* @__PURE__ */ jsxs(Button, { type: "link", onClick: navigate, size: "small", children: [
19
+ "More",
20
+ /* @__PURE__ */ jsx(InfoCircleOutlined, {})
21
+ ] })
22
+ }
23
+ );
24
+ };
25
+ export {
26
+ LinkRuleAlert
27
+ };
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { SDK } from '@rsdoctor/types';
3
+ import { PackageRelationAlertProps } from './types';
4
+ export declare const PackageRelationReasons: React.FC<{
5
+ data: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetPackageRelationAlertDetails>;
6
+ cwd: string;
7
+ }>;
8
+ export declare const PackageRelationReasonsWithServer: React.FC<Omit<{
9
+ data: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetPackageRelationAlertDetails>;
10
+ cwd: string;
11
+ }, "data"> & Partial<{
12
+ body: {
13
+ id: string | number;
14
+ target: SDK.PackageBasicData;
15
+ };
16
+ }>>;
17
+ export declare const PackageRelationAlert: React.FC<PackageRelationAlertProps>;
@@ -0,0 +1,281 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { createElement } from "react";
3
+ import React, { useState } from "react";
4
+ import {
5
+ Space,
6
+ Alert,
7
+ Button,
8
+ Typography,
9
+ Divider,
10
+ Tabs,
11
+ Row,
12
+ Col,
13
+ Timeline,
14
+ Card,
15
+ Tag,
16
+ Empty,
17
+ Popover,
18
+ Grid
19
+ } from "antd";
20
+ import { sumBy } from "lodash-es";
21
+ import { Rule, SDK } from "@rsdoctor/types";
22
+ import { ExpandAltOutlined, InfoCircleOutlined } from "@ant-design/icons";
23
+ import { useRuleIndexNavigate, formatSize, useI18n } from "../../utils";
24
+ import { TextDrawer } from "../TextDrawer";
25
+ import { Title } from "../Title";
26
+ import { Size, Color } from "../../constants";
27
+ import { Badge as Bdg } from "../Badge";
28
+ import { FileHightLightViewer } from "../CodeViewer";
29
+ import { withServerAPI } from "../Manifest";
30
+ const PackageRelationReasons = ({ data, cwd }) => {
31
+ const [index, setIndex] = useState(0);
32
+ const { t } = useI18n();
33
+ return /* @__PURE__ */ jsxs(Row, { gutter: Size.BasePadding, wrap: false, align: "top", children: [
34
+ /* @__PURE__ */ jsx(Col, { span: 12, style: { height: "100%" }, children: /* @__PURE__ */ jsx(
35
+ Card,
36
+ {
37
+ title: `The reasons for importing this version`,
38
+ style: { height: "100%" },
39
+ extra: /* @__PURE__ */ jsx(
40
+ Popover,
41
+ {
42
+ content: /* @__PURE__ */ jsx(Typography.Text, { children: t("DuplicatePakCodeExplain") }),
43
+ children: /* @__PURE__ */ jsx("a", { href: "#", children: "Explain" })
44
+ }
45
+ ),
46
+ bodyStyle: { overflow: "scroll" },
47
+ children: data.length ? /* @__PURE__ */ jsxs(React.Fragment, { children: [
48
+ /* @__PURE__ */ jsx("div", { style: { marginBottom: Size.BasePadding }, children: /* @__PURE__ */ jsx(Typography.Text, { type: "secondary", strong: true, children: "Click the file path below to show the reason in code viewer." }) }),
49
+ /* @__PURE__ */ jsx(Timeline, { children: data.map((e, i) => {
50
+ const { dependency, module, relativePath } = e;
51
+ const { statements } = dependency;
52
+ const { start } = statements?.[0]?.position ? module.isPreferSource ? statements[0].position.source : statements[0].position.transformed : { start: { line: 0, column: 0 } };
53
+ const text = `${relativePath}:${start.line}:${start.column || 1}`;
54
+ return /* @__PURE__ */ jsx(
55
+ Timeline.Item,
56
+ {
57
+ style: { cursor: "pointer" },
58
+ dot: i === data.length - 1 ? void 0 : "⬇️",
59
+ children: /* @__PURE__ */ jsx(
60
+ Typography.Text,
61
+ {
62
+ copyable: { text: relativePath },
63
+ onClick: (e2) => {
64
+ e2.preventDefault();
65
+ e2.stopPropagation();
66
+ setIndex(i);
67
+ },
68
+ strong: i === index,
69
+ style: {
70
+ color: i === index ? Color.Blue : "inherit",
71
+ display: "block"
72
+ },
73
+ children: text
74
+ }
75
+ )
76
+ },
77
+ text
78
+ );
79
+ }) })
80
+ ] }) : /* @__PURE__ */ jsx(Empty, { description: "This package no dependencies" })
81
+ }
82
+ ) }),
83
+ /* @__PURE__ */ jsx(Col, { span: 12, style: { height: "100%" }, children: /* @__PURE__ */ createElement(FileHightLightViewer, { ...data[index], key: index, cwd }) })
84
+ ] });
85
+ };
86
+ const PackageRelationReasonsWithServer = withServerAPI({
87
+ Component: PackageRelationReasons,
88
+ api: SDK.ServerAPI.API.GetPackageRelationAlertDetails,
89
+ responsePropName: "data"
90
+ });
91
+ const PackageRelationAlert = ({
92
+ data,
93
+ getPackageRelationContentComponent
94
+ }) => {
95
+ const { level, code, packages } = data;
96
+ const navigate = useRuleIndexNavigate(code, data.link);
97
+ const totalSize = sumBy(packages, (e) => e.targetSize.sourceSize);
98
+ const totalSizeStr = formatSize(totalSize);
99
+ const { xs, lg, xxl } = Grid.useBreakpoint();
100
+ const { name } = packages.find((e) => !!e.target.name).target;
101
+ const versions = packages.map((item) => item.target.version);
102
+ return /* @__PURE__ */ jsx(
103
+ Alert,
104
+ {
105
+ showIcon: !xs,
106
+ message: /* @__PURE__ */ jsxs(
107
+ Space,
108
+ {
109
+ wrap: true,
110
+ split: xs ? null : /* @__PURE__ */ jsx(Divider, { type: "vertical" }),
111
+ align: "center",
112
+ children: [
113
+ /* @__PURE__ */ jsxs(Space, { wrap: false, children: [
114
+ /* @__PURE__ */ jsx(
115
+ Typography.Text,
116
+ {
117
+ code: true,
118
+ strong: true,
119
+ onClick: navigate,
120
+ style: { cursor: "pointer" },
121
+ children: /* @__PURE__ */ jsx("a", { children: code })
122
+ }
123
+ ),
124
+ /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: Rule.RuleErrorMap[code]?.title || data.title })
125
+ ] }),
126
+ /* @__PURE__ */ jsxs(
127
+ Typography.Paragraph,
128
+ {
129
+ ellipsis: { rows: 1 },
130
+ style: { marginBottom: 0 },
131
+ children: [
132
+ /* @__PURE__ */ jsx(Typography.Text, { strong: true, code: true, children: name }),
133
+ /* @__PURE__ */ jsxs(Typography.Text, { strong: true, children: [
134
+ " ",
135
+ data.packages.length
136
+ ] }),
137
+ /* @__PURE__ */ jsx(Typography.Text, { children: " versions was found" })
138
+ ]
139
+ }
140
+ ),
141
+ /* @__PURE__ */ jsx(
142
+ Bdg,
143
+ {
144
+ label: "total size",
145
+ value: totalSizeStr,
146
+ type: "error",
147
+ tooltip: `total size of ${data.packages.length} versions is ${totalSizeStr}`
148
+ }
149
+ )
150
+ ]
151
+ }
152
+ ),
153
+ description: /* @__PURE__ */ jsx(Space, { direction: "vertical", wrap: false, children: data.packages.map(({ target: el, targetSize: size }) => {
154
+ const sizeStr = formatSize(size.sourceSize);
155
+ const parsedSizeStr = size.parsedSize ? formatSize(size.parsedSize) : null;
156
+ const name2 = `${el.name}@${el.version}`;
157
+ return /* @__PURE__ */ jsxs(
158
+ Space,
159
+ {
160
+ style: { wordBreak: "break-all" },
161
+ align: "center",
162
+ split: xs ? null : /* @__PURE__ */ jsx(Divider, { type: "vertical" }),
163
+ wrap: true,
164
+ children: [
165
+ /* @__PURE__ */ jsxs(Space, { wrap: false, children: [
166
+ /* @__PURE__ */ jsx(Typography.Text, { style: { marginLeft: 4 }, children: "└" }),
167
+ /* @__PURE__ */ jsx(
168
+ Bdg,
169
+ {
170
+ label: el.name,
171
+ value: `v${el.version}`,
172
+ tooltip: name2
173
+ }
174
+ )
175
+ ] }),
176
+ /* @__PURE__ */ jsxs(Space, { children: [
177
+ /* @__PURE__ */ jsx(
178
+ Bdg,
179
+ {
180
+ label: /* @__PURE__ */ jsxs("div", { color: "rgb(255, 255, 255)", children: [
181
+ "Source Size ",
182
+ /* @__PURE__ */ jsx(InfoCircleOutlined, {})
183
+ ] }),
184
+ value: sizeStr,
185
+ tooltip: `The bundle size of "${name2}" is ${sizeStr}, this is source size.`,
186
+ type: "error"
187
+ }
188
+ ),
189
+ /* @__PURE__ */ jsx(
190
+ Bdg,
191
+ {
192
+ label: "Bundled size",
193
+ value: parsedSizeStr || "CONCATENATED",
194
+ tooltip: `The bundle size of "${name2}" is ${sizeStr}, this is after bundled, concatenated module cannot get bundled size. `,
195
+ type: "error"
196
+ }
197
+ )
198
+ ] }),
199
+ /* @__PURE__ */ jsx(
200
+ Typography.Paragraph,
201
+ {
202
+ style: {
203
+ marginBottom: 0,
204
+ width: xxl ? "40rem" : lg ? "30rem" : "20rem"
205
+ },
206
+ copyable: { text: el.root },
207
+ ellipsis: {
208
+ rows: 1,
209
+ expandable: true,
210
+ symbol: /* @__PURE__ */ jsx(ExpandAltOutlined, {}),
211
+ tooltip: el.root
212
+ },
213
+ code: true,
214
+ children: el.root
215
+ }
216
+ )
217
+ ]
218
+ },
219
+ el.version
220
+ );
221
+ }) }),
222
+ type: level === "warn" ? "info" : level,
223
+ action: /* @__PURE__ */ jsxs(React.Fragment, { children: [
224
+ packages && packages.length > 0 ? /* @__PURE__ */ jsx(
225
+ TextDrawer,
226
+ {
227
+ text: "Show Relations",
228
+ buttonProps: { size: "small" },
229
+ drawerProps: { title: data.title },
230
+ children: /* @__PURE__ */ jsxs(Space, { direction: "vertical", className: "alert-space", children: [
231
+ /* @__PURE__ */ jsxs(Space, { style: { marginBottom: Size.BasePadding / 2 }, children: [
232
+ /* @__PURE__ */ jsx(Title, { text: name, upperFisrt: false }),
233
+ /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: versions.length }),
234
+ /* @__PURE__ */ jsx(Typography.Text, { children: " versions was found: " }),
235
+ versions.map((e) => /* @__PURE__ */ jsx(Typography.Text, { strong: true, code: true, children: e }, e))
236
+ ] }),
237
+ /* @__PURE__ */ jsx(
238
+ Tabs,
239
+ {
240
+ type: "card",
241
+ size: "middle",
242
+ className: "tabs-space",
243
+ defaultActiveKey: versions[0],
244
+ items: packages.map((pkg) => {
245
+ const { target, targetSize } = pkg;
246
+ return {
247
+ label: /* @__PURE__ */ jsxs(Space, { children: [
248
+ /* @__PURE__ */ jsx(Typography.Text, { children: `${name}@${target.version}` }),
249
+ /* @__PURE__ */ jsx(Tag, { color: Color.Red, children: formatSize(targetSize.sourceSize) })
250
+ ] }),
251
+ key: `${target.root}${target.name}${target.version}`,
252
+ children: getPackageRelationContentComponent({
253
+ data,
254
+ package: pkg
255
+ })
256
+ };
257
+ })
258
+ }
259
+ )
260
+ ] })
261
+ }
262
+ ) : null,
263
+ /* @__PURE__ */ jsx(Divider, { type: "vertical" }),
264
+ /* @__PURE__ */ jsx(
265
+ Button,
266
+ {
267
+ type: "link",
268
+ onClick: navigate,
269
+ size: "small",
270
+ icon: /* @__PURE__ */ jsx(InfoCircleOutlined, {})
271
+ }
272
+ )
273
+ ] })
274
+ }
275
+ );
276
+ };
277
+ export {
278
+ PackageRelationAlert,
279
+ PackageRelationReasons,
280
+ PackageRelationReasonsWithServer
281
+ };
@@ -0,0 +1,31 @@
1
+ import { Rule } from '@rsdoctor/types';
2
+ import React from 'react';
3
+ export interface AlertProps extends Omit<PackageRelationAlertProps, 'data'> {
4
+ data: Rule.RuleStoreDataItem;
5
+ cwd: string;
6
+ }
7
+ export interface PackageRelationAlertProps {
8
+ data: Rule.PackageRelationDiffRuleStoreData;
9
+ getPackageRelationContentComponent: React.FC<{
10
+ data: Rule.PackageRelationDiffRuleStoreData;
11
+ package: Rule.PackageRelationData;
12
+ }>;
13
+ cwd: string;
14
+ }
15
+ export interface FileRelationAlertProps {
16
+ data: Rule.FileRelationRuleStoreData;
17
+ }
18
+ export interface CodeChangeAlertProps {
19
+ data: Rule.CodeChangeRuleStoreData;
20
+ cwd: string;
21
+ }
22
+ export interface CodeViewAlertProps {
23
+ data: Rule.CodeViewRuleStoreData;
24
+ cwd: string;
25
+ }
26
+ export interface LinkAlertProps {
27
+ data: Rule.LinkRuleStoreData;
28
+ }
29
+ export interface EMOAlertProps {
30
+ data: Rule.EMORuleStoreData;
31
+ }
File without changes
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { CodeViewAlertProps } from './types';
3
+ export declare const CodeViewDrawerContent: React.FC<CodeViewAlertProps>;
4
+ export declare const CodeViewAlert: React.FC<CodeViewAlertProps>;