@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,38 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { LoadingOutlined } from "@ant-design/icons";
3
+ import Editor from "@monaco-editor/react";
4
+ import { Card } from "antd";
5
+ import { getOriginalLanguage, getShortPath } from "../../../utils";
6
+ function CodeEditor(props) {
7
+ const { content, path } = props;
8
+ if (!content) {
9
+ return /* @__PURE__ */ jsx("div", { children: "No Code~" });
10
+ }
11
+ return /* @__PURE__ */ jsx(Card, { title: getShortPath(path), className: "bundle-size-editor", style: { height: "90%" }, children: /* @__PURE__ */ jsx(
12
+ Editor,
13
+ {
14
+ theme: "vs-dark",
15
+ language: getOriginalLanguage(path),
16
+ value: content,
17
+ loading: /* @__PURE__ */ jsx(LoadingOutlined, { style: { fontSize: 30, height: "8em" } }),
18
+ options: {
19
+ readOnly: true,
20
+ domReadOnly: true,
21
+ fontSize: 12,
22
+ renderValidationDecorations: "off",
23
+ hideCursorInOverviewRuler: true,
24
+ smoothScrolling: true,
25
+ wordWrap: "bounded",
26
+ colorDecorators: true,
27
+ codeLens: false,
28
+ cursorWidth: 0,
29
+ minimap: {
30
+ enabled: false
31
+ }
32
+ }
33
+ }
34
+ ) });
35
+ }
36
+ export {
37
+ CodeEditor
38
+ };
@@ -0,0 +1,20 @@
1
+ .monaco-hover .markdown-hover.hover-row hr {
2
+ margin: 2px;
3
+ background-color: gray;
4
+ }
5
+ .bundle-size-editor {
6
+ margin-left: 40px;
7
+ flex-grow: 1;
8
+ height: 700px;
9
+ }
10
+ .bundle-size-editor .ant-card-body {
11
+ width: auto;
12
+ height: calc(100% - 48px);
13
+ padding: 0;
14
+ }
15
+ .bundle-size-module-bunton {
16
+ margin-left: 4em;
17
+ }
18
+ .ant-tabs-nav {
19
+ width: 100%;
20
+ }
@@ -0,0 +1,16 @@
1
+ import { Client, SDK } from '@rsdoctor/types';
2
+ import React from 'react';
3
+ import './index.sass';
4
+ interface WebpackModulesOverallProps {
5
+ cwd: string;
6
+ errors: SDK.ErrorsData;
7
+ summary: Client.RsdoctorClientAssetsSummary;
8
+ entryPoints: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetEntryPoints>;
9
+ }
10
+ export declare const WebpackModulesOverallBase: React.FC<WebpackModulesOverallProps>;
11
+ export declare const WebpackModulesOverall: React.FC<Omit<{
12
+ project: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>;
13
+ }, "project"> & Partial<{
14
+ body?: any;
15
+ }>>;
16
+ export {};
@@ -0,0 +1,366 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { CodepenCircleOutlined, ColumnHeightOutlined, DeploymentUnitOutlined, InfoCircleOutlined, VerticalAlignMiddleOutlined } from "@ant-design/icons";
3
+ import { SDK } from "@rsdoctor/types";
4
+ import {
5
+ Button,
6
+ Card,
7
+ Col,
8
+ Divider,
9
+ Empty,
10
+ InputNumber,
11
+ Radio,
12
+ Row,
13
+ Select,
14
+ Space,
15
+ Tag,
16
+ Tooltip,
17
+ Typography
18
+ } from "antd";
19
+ import { debounce, includes, sumBy } from "lodash-es";
20
+ import React, { useCallback, useMemo, useState } from "react";
21
+ import { ServerAPIProvider, withServerAPI } from "../../../components/Manifest";
22
+ import { Badge as Bdg } from "../../../components/Badge";
23
+ import { FileTree } from "../../../components/FileTree";
24
+ import { KeywordInput } from "../../../components/Form/keyword";
25
+ import { Keyword } from "../../../components/Keyword";
26
+ import { Title } from "../../../components/Title";
27
+ import { Size } from "../../../constants";
28
+ import { createFileStructures, formatSize, useI18n } from "../../../utils";
29
+ import { BundleCards } from "./cards";
30
+ import { CodeViewerWithDrawer } from "../../../components/CodeViewer";
31
+ import { AssetDetail } from "./asset";
32
+ import "./index.css";
33
+ const { Option } = Select;
34
+ const cardBodyHeight = 410;
35
+ const largeCardBodyHeight = 800;
36
+ const WebpackModulesOverallBase = ({
37
+ errors,
38
+ cwd,
39
+ summary,
40
+ entryPoints
41
+ }) => {
42
+ const [selectedEntryPoints, setEntryPoints] = useState([]);
43
+ const [inputModule, setModuleValue] = useState(0);
44
+ const [inputAssetName, setAssetName] = useState("");
45
+ const [inputAssetSize, setAssetSize] = useState(0);
46
+ const [defaultExpandAll, setDefaultExpandAll] = useState(false);
47
+ const [inputModuleUnit, setModuleUnit] = useState("");
48
+ const [inputChunkUnit, setChunkUnit] = useState("");
49
+ const [assetPath, setAssetPath] = useState(null);
50
+ const [fold, setFold] = useState(false);
51
+ const [graphType, setGraphType] = useState("tree");
52
+ const { t } = useI18n();
53
+ const assets = summary.all.total.files;
54
+ const handleChange = useCallback(
55
+ (type) => (value) => {
56
+ if (type === "module") {
57
+ setModuleUnit(value);
58
+ } else if (type === "chunk") {
59
+ setChunkUnit(value);
60
+ }
61
+ },
62
+ []
63
+ );
64
+ const selectAfter = (type) => /* @__PURE__ */ jsxs(Select, { defaultValue: "kb", onChange: handleChange(type), children: [
65
+ /* @__PURE__ */ jsx(Option, { value: "kb", children: "KB" }),
66
+ /* @__PURE__ */ jsx(Option, { value: "mb", children: "MB" })
67
+ ] });
68
+ const onChangeModule = useCallback(
69
+ debounce((newValue) => {
70
+ const count = inputModuleUnit === "mb" ? newValue * 1024 * 1024 : newValue * 1024;
71
+ setModuleValue(count);
72
+ }, 300),
73
+ []
74
+ );
75
+ const onChangeAsset = useCallback(
76
+ debounce((newValue) => {
77
+ const count = inputChunkUnit === "mb" ? newValue * 1024 * 1024 : newValue * 1024;
78
+ setAssetSize(count);
79
+ }, 300),
80
+ []
81
+ );
82
+ const filteredAssets = useMemo(() => {
83
+ let res = assets.slice();
84
+ if (inputAssetName) {
85
+ res = res.filter((e) => e.path.indexOf(inputAssetName) > -1);
86
+ }
87
+ if (inputAssetSize > 0) {
88
+ res = res.filter((e) => e.size >= inputAssetSize);
89
+ }
90
+ if (selectedEntryPoints.length) {
91
+ res = res.filter((e) => {
92
+ if (selectedEntryPoints.some((ep) => includes(ep.assets, e.path))) {
93
+ return true;
94
+ }
95
+ return false;
96
+ });
97
+ }
98
+ return res.sort((a, b) => {
99
+ const _a = a.path.indexOf("/") > -1 ? 1 : 0;
100
+ const _b = b.path.indexOf("/") > -1 ? 1 : 0;
101
+ return _b - _a;
102
+ });
103
+ }, [assets, selectedEntryPoints, inputAssetName, inputAssetSize]);
104
+ const assetsStructures = useMemo(() => {
105
+ const res = createFileStructures({
106
+ files: filteredAssets.map((e) => e.path).filter(Boolean),
107
+ fileTitle(file, basename) {
108
+ const target = filteredAssets.find((e) => e.path === file);
109
+ const { size, initial, path, content } = target;
110
+ return /* @__PURE__ */ jsxs(
111
+ Space,
112
+ {
113
+ onClick: () => {
114
+ setAssetPath(path);
115
+ },
116
+ children: [
117
+ /* @__PURE__ */ jsx(Keyword, { text: basename, keyword: inputAssetName }),
118
+ /* @__PURE__ */ jsx(Tag, { color: "success", style: { margin: 0 }, children: formatSize(size) }),
119
+ initial ? /* @__PURE__ */ jsx(Tag, { color: "cyan", style: { margin: 0 }, children: "initial" }) : null,
120
+ /* @__PURE__ */ jsx(
121
+ CodeViewerWithDrawer,
122
+ {
123
+ path,
124
+ content,
125
+ editorConfig: { readOnly: false, domReadOnly: false }
126
+ }
127
+ )
128
+ ]
129
+ }
130
+ );
131
+ }
132
+ });
133
+ return res;
134
+ }, [filteredAssets]);
135
+ const onSearch = (value) => {
136
+ setAssetName(value);
137
+ setDefaultExpandAll(false);
138
+ };
139
+ return /* @__PURE__ */ jsxs(React.Fragment, { children: [
140
+ /* @__PURE__ */ jsx(BundleCards, { cwd, errors, summary }),
141
+ /* @__PURE__ */ jsxs(
142
+ Radio.Group,
143
+ {
144
+ value: graphType,
145
+ onChange: (e) => setGraphType(e.target.value),
146
+ style: { marginBottom: Size.BasePadding },
147
+ buttonStyle: "solid",
148
+ optionType: "button",
149
+ children: [
150
+ /* @__PURE__ */ jsx(Radio.Button, { value: "tree", children: "Tree Graph" }),
151
+ /* @__PURE__ */ jsx(Radio.Button, { value: "tile", children: "Bundle Analyzer Graph" })
152
+ ]
153
+ }
154
+ ),
155
+ /* @__PURE__ */ jsx(
156
+ Card,
157
+ {
158
+ hidden: graphType === "tree",
159
+ title: /* @__PURE__ */ jsx(Space, { children: /* @__PURE__ */ jsx(Title, { text: "From: Webpack Bundle Analyzer" }) }),
160
+ children: /* @__PURE__ */ jsx(ServerAPIProvider, { api: SDK.ServerAPI.API.GetTileReportHtml, body: {}, children: (data) => {
161
+ if (data && graphType === "tile") {
162
+ return /* @__PURE__ */ jsx("iframe", { srcDoc: data, width: "100%", height: largeCardBodyHeight, style: { border: "none" } });
163
+ }
164
+ return /* @__PURE__ */ jsx(Empty, {});
165
+ } })
166
+ }
167
+ ),
168
+ /* @__PURE__ */ jsx(
169
+ Card,
170
+ {
171
+ hidden: graphType === "tile",
172
+ title: /* @__PURE__ */ jsxs(Space, { children: [
173
+ /* @__PURE__ */ jsx(Title, { text: "Bundle Analysis" }),
174
+ /* @__PURE__ */ jsx(
175
+ Tooltip,
176
+ {
177
+ color: "white",
178
+ title: /* @__PURE__ */ jsxs(Space, { direction: "vertical", color: "white", children: [
179
+ /* @__PURE__ */ jsx(Row, { children: /* @__PURE__ */ jsxs(Col, { children: [
180
+ /* @__PURE__ */ jsx(Tag, { color: "cyan", style: { margin: 0 }, children: "initial" }),
181
+ /* @__PURE__ */ jsx(Typography.Text, { children: ": Indignify whether the chunk is the initial chunk." })
182
+ ] }) }),
183
+ /* @__PURE__ */ jsx(Row, { children: /* @__PURE__ */ jsxs(Col, { children: [
184
+ /* @__PURE__ */ jsx(Tag, { color: "green", children: "concatenated" }),
185
+ /* @__PURE__ */ jsx(Typography.Text, { children: ": Indignify whether the module is the concatenated module. " }),
186
+ /* @__PURE__ */ jsx("br", {}),
187
+ /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: "Concatenated Module:" }),
188
+ /* @__PURE__ */ jsx(Typography.Text, { children: "A series module is to lift or series multiple modules into a closure when packaging. " })
189
+ ] }) }),
190
+ /* @__PURE__ */ jsx(Row, { children: /* @__PURE__ */ jsxs(Col, { children: [
191
+ /* @__PURE__ */ jsx(
192
+ Button,
193
+ {
194
+ size: "small",
195
+ icon: /* @__PURE__ */ jsx(CodepenCircleOutlined, {})
196
+ }
197
+ ),
198
+ /* @__PURE__ */ jsx(Typography.Text, { children: ": Open the code." })
199
+ ] }) }),
200
+ /* @__PURE__ */ jsx(Row, { children: /* @__PURE__ */ jsxs(Col, { children: [
201
+ /* @__PURE__ */ jsx(
202
+ Button,
203
+ {
204
+ size: "small",
205
+ icon: /* @__PURE__ */ jsx(DeploymentUnitOutlined, {})
206
+ }
207
+ ),
208
+ /* @__PURE__ */ jsx(Typography.Text, { children: ": View the module dependency, that is, module reasons in stats.json." })
209
+ ] }) }),
210
+ /* @__PURE__ */ jsx(Row, { children: /* @__PURE__ */ jsxs(Col, { children: [
211
+ /* @__PURE__ */ jsx(Tag, { color: "purple", children: "Bundled: 15.77 KB" }),
212
+ /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: "Bundled Size" }),
213
+ /* @__PURE__ */ jsx(Typography.Text, { children: "The size of the code which bundled. That is, after bundle and tree-shaking." })
214
+ ] }) }),
215
+ /* @__PURE__ */ jsx(Row, { children: /* @__PURE__ */ jsxs(Col, { children: [
216
+ /* @__PURE__ */ jsx(Tag, { color: "orange", children: "Source: 15.77 KB" }),
217
+ /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: "Source Size" }),
218
+ /* @__PURE__ */ jsx(Typography.Text, { children: "The size of the code which before bundle and transform." })
219
+ ] }) })
220
+ ] }),
221
+ style: { marginLeft: 3 },
222
+ children: /* @__PURE__ */ jsx(InfoCircleOutlined, { style: { color: "rgba(0,0,0,.45)" } })
223
+ }
224
+ )
225
+ ] }),
226
+ extra: fold ? /* @__PURE__ */ jsx(Button, { onClick: () => setFold(false), children: /* @__PURE__ */ jsxs(Typography.Text, { children: [
227
+ "Expand ",
228
+ /* @__PURE__ */ jsx(ColumnHeightOutlined, {})
229
+ ] }) }) : /* @__PURE__ */ jsx(Button, { onClick: () => setFold(true), children: /* @__PURE__ */ jsxs(Typography.Text, { children: [
230
+ "Fold",
231
+ /* @__PURE__ */ jsx(VerticalAlignMiddleOutlined, {})
232
+ ] }) }),
233
+ children: /* @__PURE__ */ jsxs(Row, { align: "middle", gutter: [Size.BasePadding, Size.BasePadding], children: [
234
+ entryPoints && entryPoints.length ? /* @__PURE__ */ jsx(Col, { children: /* @__PURE__ */ jsx(
235
+ Select,
236
+ {
237
+ mode: "multiple",
238
+ value: selectedEntryPoints.map((e) => e.name),
239
+ style: { minWidth: 230, width: "auto", maxWidth: 300 },
240
+ placeholder: "filter assets by entry point",
241
+ onChange: (name) => {
242
+ setEntryPoints(name.map((e) => entryPoints.find((ep) => ep.name === e)).filter(Boolean));
243
+ },
244
+ allowClear: true,
245
+ onClear: () => {
246
+ setEntryPoints([]);
247
+ },
248
+ children: entryPoints.map((e) => {
249
+ return /* @__PURE__ */ jsx(Select.Option, { value: e.name, children: /* @__PURE__ */ jsx(Space, { children: /* @__PURE__ */ jsx(Bdg, { label: e.name, value: formatSize(e.size), tooltip: e.name }) }) }, e.name);
250
+ })
251
+ }
252
+ ) }) : null,
253
+ /* @__PURE__ */ jsx(Col, { children: /* @__PURE__ */ jsx(KeywordInput, { placeholder: "search asset by keyword", onChange: onSearch }) }),
254
+ /* @__PURE__ */ jsx(Col, { span: 7, children: /* @__PURE__ */ jsx(
255
+ InputNumber,
256
+ {
257
+ min: 0,
258
+ style: { width: "95%" },
259
+ addonBefore: /* @__PURE__ */ jsxs(Space, { children: [
260
+ /* @__PURE__ */ jsx(Typography.Text, { style: { fontSize: 14, color: "inherit" }, children: "Asset Size" }),
261
+ /* @__PURE__ */ jsx(
262
+ Tooltip,
263
+ {
264
+ title: t("filter the output assets which size is greater than the input value"),
265
+ style: { marginLeft: 3 },
266
+ children: /* @__PURE__ */ jsx(InfoCircleOutlined, { style: { color: "rgba(0,0,0,.45)" } })
267
+ }
268
+ )
269
+ ] }),
270
+ onChange: (value) => onChangeAsset(Number(value)),
271
+ addonAfter: selectAfter("chunk")
272
+ }
273
+ ) }),
274
+ /* @__PURE__ */ jsx(Col, { span: 7, children: /* @__PURE__ */ jsx(
275
+ InputNumber,
276
+ {
277
+ min: 0,
278
+ style: { width: "95%" },
279
+ addonBefore: /* @__PURE__ */ jsxs(Space, { children: [
280
+ /* @__PURE__ */ jsx(Typography.Text, { style: { fontSize: 14, color: "inherit" }, children: "Module Size" }),
281
+ /* @__PURE__ */ jsx(
282
+ Tooltip,
283
+ {
284
+ title: t("filter the modules which size is greater than the input value"),
285
+ style: { marginLeft: 3 },
286
+ children: /* @__PURE__ */ jsx(InfoCircleOutlined, { style: { color: "rgba(0,0,0,.45)" } })
287
+ }
288
+ )
289
+ ] }),
290
+ onChange: (value) => {
291
+ onChangeModule(Number(value));
292
+ },
293
+ addonAfter: selectAfter("module")
294
+ }
295
+ ) }),
296
+ /* @__PURE__ */ jsx(Col, { span: 24, children: filteredAssets.length ? /* @__PURE__ */ jsxs(Row, { gutter: Size.BasePadding, children: [
297
+ /* @__PURE__ */ jsx(Col, { span: 8, children: /* @__PURE__ */ jsx(
298
+ Card,
299
+ {
300
+ title: /* @__PURE__ */ jsxs(Space, { children: [
301
+ /* @__PURE__ */ jsx(Typography.Text, { children: t("Output Assets List") }),
302
+ /* @__PURE__ */ jsx(Divider, { type: "vertical" }),
303
+ /* @__PURE__ */ jsx(
304
+ Tooltip,
305
+ {
306
+ title: `total assets count is ${assets.length}, the filtered assets count is ${filteredAssets.length}`,
307
+ children: /* @__PURE__ */ jsxs(Typography.Text, { type: "secondary", style: { fontSize: 12, fontWeight: 400 }, children: [
308
+ filteredAssets.length,
309
+ " / ",
310
+ assets.length
311
+ ] })
312
+ }
313
+ ),
314
+ /* @__PURE__ */ jsx(Divider, { type: "vertical" }),
315
+ /* @__PURE__ */ jsx(Typography.Text, { type: "secondary", style: { fontSize: 12, fontWeight: 400 }, children: formatSize(sumBy(filteredAssets, (e) => e.size)) })
316
+ ] }),
317
+ size: "small",
318
+ bodyStyle: { overflow: "scroll", height: fold ? cardBodyHeight : largeCardBodyHeight },
319
+ extra: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(ColumnHeightOutlined, {}), onClick: () => setDefaultExpandAll(true), children: "expand all" }),
320
+ children: /* @__PURE__ */ jsx(
321
+ FileTree,
322
+ {
323
+ treeData: assetsStructures,
324
+ autoExpandParent: true,
325
+ defaultExpandAll: defaultExpandAll || filteredAssets.length <= 20
326
+ },
327
+ `tree_${inputAssetName}_${defaultExpandAll}`
328
+ )
329
+ }
330
+ ) }),
331
+ /* @__PURE__ */ jsx(Col, { span: 16, children: assetPath ? /* @__PURE__ */ jsx(ServerAPIProvider, { api: SDK.ServerAPI.API.GetAssetDetails, body: { assetPath }, children: (details) => /* @__PURE__ */ jsx(
332
+ AssetDetail,
333
+ {
334
+ asset: details.asset,
335
+ chunks: details.chunks,
336
+ modules: details.modules,
337
+ height: fold ? cardBodyHeight : largeCardBodyHeight,
338
+ moduleSizeLimit: inputModule,
339
+ root: cwd
340
+ }
341
+ ) }) : /* @__PURE__ */ jsx(Card, { bodyStyle: { height: fold ? cardBodyHeight + 40 : largeCardBodyHeight }, children: /* @__PURE__ */ jsx(
342
+ Empty,
343
+ {
344
+ description: /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: "Click the file path on the left to show the modules of the asset" })
345
+ }
346
+ ) }) })
347
+ ] }) : /* @__PURE__ */ jsx(Empty, {}) })
348
+ ] })
349
+ }
350
+ )
351
+ ] });
352
+ };
353
+ const WebpackModulesOverall = withServerAPI({
354
+ api: SDK.ServerAPI.API.GetProjectInfo,
355
+ responsePropName: "project",
356
+ Component: (props) => {
357
+ const { root, errors } = props.project;
358
+ return /* @__PURE__ */ jsx(ServerAPIProvider, { api: SDK.ServerAPI.API.GetAssetsSummary, body: { withFileContent: true }, children: (summary) => {
359
+ return /* @__PURE__ */ jsx(ServerAPIProvider, { api: SDK.ServerAPI.API.GetEntryPoints, children: (entryPoints) => /* @__PURE__ */ jsx(WebpackModulesOverallBase, { cwd: root, errors, summary, entryPoints }) });
360
+ } });
361
+ }
362
+ });
363
+ export {
364
+ WebpackModulesOverall,
365
+ WebpackModulesOverallBase
366
+ };
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ interface config {
3
+ setModuleJumpList(ids: number[]): void;
4
+ moduleJumpList: number[];
5
+ }
6
+ export declare const ModuleGraphListContext: import("react").Context<config>;
7
+ export {};
@@ -0,0 +1,9 @@
1
+ import { createContext } from "react";
2
+ const ModuleGraphListContext = createContext({
3
+ setModuleJumpList(_ids) {
4
+ },
5
+ moduleJumpList: []
6
+ });
7
+ export {
8
+ ModuleGraphListContext
9
+ };
@@ -0,0 +1,5 @@
1
+ import { Client } from '@rsdoctor/types';
2
+ export declare const maxModuleSize = 5000;
3
+ export declare const name = "BundleSize";
4
+ export declare const route = Client.RsdoctorClientRoutes.BundleSize;
5
+ export type GraphType = 'tile' | 'tree';
@@ -0,0 +1,9 @@
1
+ import { Client } from "@rsdoctor/types";
2
+ const maxModuleSize = 5e3;
3
+ const name = "BundleSize";
4
+ const route = Client.RsdoctorClientRoutes.BundleSize;
5
+ export {
6
+ maxModuleSize,
7
+ name,
8
+ route
9
+ };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const Page: React.FC;
3
+ export * from './constants';
@@ -0,0 +1,11 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Col, Row } from "antd";
3
+ import { Size } from "../../constants";
4
+ import { WebpackModulesOverall } from "./components";
5
+ const Page = () => {
6
+ return /* @__PURE__ */ jsx(Row, { children: /* @__PURE__ */ jsx(Col, { span: 24, style: { marginBottom: Size.BasePadding }, children: /* @__PURE__ */ jsx(WebpackModulesOverall, {}) }) });
7
+ };
8
+ export * from "./constants";
9
+ export {
10
+ Page
11
+ };
@@ -0,0 +1,6 @@
1
+ import { SDK } from '@rsdoctor/types';
2
+ import React from 'react';
3
+ import './index.sass';
4
+ export declare const ChunksTable: React.FC<{
5
+ chunks: SDK.ChunkData[];
6
+ }>;
@@ -0,0 +1,48 @@
1
+ import { Fragment, jsx } from "react/jsx-runtime";
2
+ import { Empty, Table, Tag } from "antd";
3
+ import { compact, orderBy } from "lodash-es";
4
+ import { useMemo } from "react";
5
+ import { formatSize } from "../../utils";
6
+ import "./index.css";
7
+ const columns = [
8
+ {
9
+ title: "Chunk Name",
10
+ dataIndex: "name",
11
+ key: "name"
12
+ },
13
+ {
14
+ title: "size | 大小",
15
+ dataIndex: "size",
16
+ key: "size"
17
+ },
18
+ {
19
+ title: "assets | 资源",
20
+ dataIndex: "assets",
21
+ key: "assets"
22
+ },
23
+ {
24
+ title: "Entry or Not | 是否是入口",
25
+ dataIndex: "entry",
26
+ key: "entry"
27
+ }
28
+ ];
29
+ const ChunksTable = ({ chunks }) => {
30
+ const chunksData = useMemo(() => {
31
+ const _chunksData = chunks.map((chunk) => {
32
+ if (!chunk)
33
+ return void 0;
34
+ return {
35
+ key: chunk.id,
36
+ name: /* @__PURE__ */ jsx(Tag, { children: chunk.name }),
37
+ size: /* @__PURE__ */ jsx(Tag, { children: formatSize(chunk.parsedSize) }),
38
+ entry: /* @__PURE__ */ jsx(Tag, { children: chunk.entry ? "是 | Yes" : "否 | No" }),
39
+ assets: chunk.assets.map((asset) => /* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx(Tag, { children: asset }, asset) }, asset))
40
+ };
41
+ });
42
+ return orderBy(compact(_chunksData), ["size"], ["desc"]);
43
+ }, [chunks]);
44
+ return /* @__PURE__ */ jsx(Fragment, { children: chunksData?.length ? /* @__PURE__ */ jsx(Table, { bordered: true, pagination: false, dataSource: chunksData, columns }) : /* @__PURE__ */ jsx(Empty, {}) });
45
+ };
46
+ export {
47
+ ChunksTable
48
+ };
@@ -0,0 +1,97 @@
1
+ .file-tree-com {
2
+ margin: 0;
3
+ }
4
+ .file-tree-com .file-tree-com-treenode {
5
+ margin: 0;
6
+ padding: 0;
7
+ line-height: 24px;
8
+ white-space: nowrap;
9
+ list-style: none;
10
+ outline: 0;
11
+ }
12
+ .file-tree-com .file-tree-com-treenode .file-tree-com-node-content-wrapper {
13
+ position: relative;
14
+ display: inline-block;
15
+ height: 24px;
16
+ margin: 0;
17
+ padding: 0 4px;
18
+ box-sizing: border-box;
19
+ text-decoration: none;
20
+ vertical-align: top;
21
+ cursor: pointer;
22
+ }
23
+ .file-tree-com .file-tree-com-treenode .file-tree-com-arrow-icon {
24
+ transform: rotate(90deg);
25
+ }
26
+ .file-tree-com-child-tree {
27
+ display: none;
28
+ }
29
+ .file-tree-com-child-tree-open {
30
+ display: block;
31
+ }
32
+ .file-tree-com-treenode-disabled > span:not(.file-tree-com-switcher),
33
+ .file-tree-com > a,
34
+ .file-tree-com > a span {
35
+ color: #767676;
36
+ cursor: not-allowed;
37
+ }
38
+ .file-tree-com-treenode-selected {
39
+ background: rgba(5, 145, 255, 0.3);
40
+ border-radius: 4px;
41
+ }
42
+ .file-tree-com-title {
43
+ display: inline-block;
44
+ cursor: pointer;
45
+ }
46
+ .file-tree-com-indent {
47
+ display: inline-block;
48
+ height: 0;
49
+ vertical-align: bottom;
50
+ }
51
+ .file-tree-com-indent-unit {
52
+ display: inline-block;
53
+ width: 14px;
54
+ }
55
+ .file-tree-switcher-arrow {
56
+ transform: rotate(0deg);
57
+ transition: transform 0.3s ease;
58
+ }
59
+ .file-tree-switcher-arrow-expand {
60
+ transform: rotate(90deg);
61
+ }
62
+ .rc-tree.rc-tree-show-line .rc-tree-treenode:not(:last-child) {
63
+ border-left: 1px solid #eee;
64
+ }
65
+ .rc-tree.rc-tree-show-line .rc-tree-treenode:not(:last-child) .file-tree-com-titles {
66
+ display: flex;
67
+ flex-direction: column;
68
+ }
69
+ .rc-tree.rc-tree-show-line .rc-tree-treenode:not(:last-child) .file-tree-com-titles .file-tree-com-node-title {
70
+ display: flex;
71
+ cursor: pointer;
72
+ }
73
+ .rc-tree.rc-tree-show-line .rc-tree-treenode:not(:last-child) .file-tree-com-titles .file-tree-com-node-title img {
74
+ cursor: pointer;
75
+ }
76
+ .rc-tree.rc-tree-show-line .rc-tree-treenode:not(:last-child) .file-tree-com-titles .file-tree-com-node-title img-tag {
77
+ cursor: pointer;
78
+ }
79
+ .rc-tree.rc-tree-show-line .rc-tree-treenode:not(:last-child) .file-tree-com-node-title-selected {
80
+ background-color: yellow;
81
+ }
82
+ .rc-tree.rc-tree-show-line .rc-tree-treenode:not(:last-child) .file-tree-com-node-title-tag {
83
+ margin-inline-end: 0;
84
+ }
85
+ .rc-tree.rc-tree-show-line .rc-tree-treenode:not(:last-child) .file-tree-com-node-title-code-tag {
86
+ cursor: pointer;
87
+ padding: 0 2px;
88
+ }
89
+ .rc-tree-indent {
90
+ display: inline-block;
91
+ height: 0;
92
+ vertical-align: bottom;
93
+ }
94
+ .rc-tree-indent-unit {
95
+ display: inline-block;
96
+ width: 14px;
97
+ }
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { NewTreeNodeType } from '../utils/hooks';
3
+ import './fileTreeCom.sass';
4
+ type FileTreeProps = {
5
+ treeData: NewTreeNodeType[];
6
+ needCode?: boolean;
7
+ needShowAllTree?: boolean;
8
+ needJumpto?: boolean;
9
+ defaultOpened?: boolean;
10
+ defaultOpenFather?: number;
11
+ cwd: string;
12
+ selectedChunk?: string;
13
+ };
14
+ export declare const FileTree: React.FC<FileTreeProps>;
15
+ export {};