@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.
- package/LICENSE +21 -0
- package/README.md +22 -0
- package/dist/assets/connection-point.3b3c78ca.svg +1 -0
- package/dist/assets/webpack.98604d64.svg +1 -0
- package/dist/components/Alert/change.d.ts +8 -0
- package/dist/components/Alert/change.js +93 -0
- package/dist/components/Alert/file-relation.d.ts +3 -0
- package/dist/components/Alert/file-relation.js +9 -0
- package/dist/components/Alert/index.css +32 -0
- package/dist/components/Alert/index.d.ts +4 -0
- package/dist/components/Alert/index.js +37 -0
- package/dist/components/Alert/link.d.ts +3 -0
- package/dist/components/Alert/link.js +27 -0
- package/dist/components/Alert/package-relation.d.ts +17 -0
- package/dist/components/Alert/package-relation.js +281 -0
- package/dist/components/Alert/types.d.ts +31 -0
- package/dist/components/Alert/types.js +0 -0
- package/dist/components/Alert/view.d.ts +4 -0
- package/dist/components/Alert/view.js +58 -0
- package/dist/components/Alerts/bundle.d.ts +11 -0
- package/dist/components/Alerts/bundle.js +61 -0
- package/dist/components/Alerts/common.d.ts +15 -0
- package/dist/components/Alerts/common.js +112 -0
- package/dist/components/Alerts/compile.d.ts +10 -0
- package/dist/components/Alerts/compile.js +46 -0
- package/dist/components/Alerts/index.d.ts +3 -0
- package/dist/components/Alerts/index.js +3 -0
- package/dist/components/Alerts/overlay.d.ts +26 -0
- package/dist/components/Alerts/overlay.js +154 -0
- package/dist/components/Badge/index.d.ts +21 -0
- package/dist/components/Badge/index.js +87 -0
- package/dist/components/BundleDiff/DiffContainer/assets.d.ts +7 -0
- package/dist/components/BundleDiff/DiffContainer/assets.js +507 -0
- package/dist/components/BundleDiff/DiffContainer/cards.d.ts +3 -0
- package/dist/components/BundleDiff/DiffContainer/cards.js +156 -0
- package/dist/components/BundleDiff/DiffContainer/changes.d.ts +15 -0
- package/dist/components/BundleDiff/DiffContainer/changes.js +69 -0
- package/dist/components/BundleDiff/DiffContainer/constants.d.ts +11 -0
- package/dist/components/BundleDiff/DiffContainer/constants.js +17 -0
- package/dist/components/BundleDiff/DiffContainer/diff.d.ts +23 -0
- package/dist/components/BundleDiff/DiffContainer/diff.js +114 -0
- package/dist/components/BundleDiff/DiffContainer/index.d.ts +3 -0
- package/dist/components/BundleDiff/DiffContainer/index.js +180 -0
- package/dist/components/BundleDiff/DiffContainer/modules.d.ts +8 -0
- package/dist/components/BundleDiff/DiffContainer/modules.js +302 -0
- package/dist/components/BundleDiff/DiffContainer/overview.d.ts +5 -0
- package/dist/components/BundleDiff/DiffContainer/overview.js +178 -0
- package/dist/components/BundleDiff/DiffContainer/packages.d.ts +19 -0
- package/dist/components/BundleDiff/DiffContainer/packages.js +330 -0
- package/dist/components/BundleDiff/DiffContainer/row.d.ts +9 -0
- package/dist/components/BundleDiff/DiffContainer/row.js +369 -0
- package/dist/components/BundleDiff/DiffContainer/types.d.ts +45 -0
- package/dist/components/BundleDiff/DiffContainer/types.js +0 -0
- package/dist/components/BundleDiff/DiffContainer/utils.d.ts +2 -0
- package/dist/components/BundleDiff/DiffContainer/utils.js +24 -0
- package/dist/components/BundleDiff/DiffServerAPIProvider/index.d.ts +4 -0
- package/dist/components/BundleDiff/DiffServerAPIProvider/index.js +37 -0
- package/dist/components/BundleDiff/constants.d.ts +11 -0
- package/dist/components/BundleDiff/constants.js +19 -0
- package/dist/components/BundleDiff/index.d.ts +1 -0
- package/dist/components/BundleDiff/index.js +1 -0
- package/dist/components/Card/diff.d.ts +24 -0
- package/dist/components/Card/diff.js +116 -0
- package/dist/components/Card/index.d.ts +9 -0
- package/dist/components/Card/index.js +50 -0
- package/dist/components/Card/size.d.ts +21 -0
- package/dist/components/Card/size.js +79 -0
- package/dist/components/Card/statistic.css +17 -0
- package/dist/components/Card/statistic.d.ts +12 -0
- package/dist/components/Card/statistic.js +19 -0
- package/dist/components/Charts/TimelineCharts/index.d.ts +8 -0
- package/dist/components/Charts/TimelineCharts/index.js +212 -0
- package/dist/components/Charts/bootstrap.d.ts +5 -0
- package/dist/components/Charts/bootstrap.js +44 -0
- package/dist/components/Charts/common.d.ts +13 -0
- package/dist/components/Charts/common.js +56 -0
- package/dist/components/Charts/constants.d.ts +2 -0
- package/dist/components/Charts/constants.js +46 -0
- package/dist/components/Charts/done.d.ts +5 -0
- package/dist/components/Charts/done.js +45 -0
- package/dist/components/Charts/index.d.ts +10 -0
- package/dist/components/Charts/index.js +37 -0
- package/dist/components/Charts/loader.css +31 -0
- package/dist/components/Charts/loader.d.ts +4 -0
- package/dist/components/Charts/loader.js +88 -0
- package/dist/components/Charts/minify.d.ts +5 -0
- package/dist/components/Charts/minify.js +37 -0
- package/dist/components/Charts/tooltips.css +62 -0
- package/dist/components/Charts/types.d.ts +61 -0
- package/dist/components/Charts/types.js +11 -0
- package/dist/components/Charts/utils.d.ts +13 -0
- package/dist/components/Charts/utils.js +206 -0
- package/dist/components/CodeViewer/config.d.ts +2 -0
- package/dist/components/CodeViewer/config.js +18 -0
- package/dist/components/CodeViewer/diff.d.ts +11 -0
- package/dist/components/CodeViewer/diff.js +35 -0
- package/dist/components/CodeViewer/hightlight.d.ts +10 -0
- package/dist/components/CodeViewer/hightlight.js +76 -0
- package/dist/components/CodeViewer/index.d.ts +4 -0
- package/dist/components/CodeViewer/index.js +4 -0
- package/dist/components/CodeViewer/viewer.d.ts +13 -0
- package/dist/components/CodeViewer/viewer.js +60 -0
- package/dist/components/Configuration/builder.d.ts +13 -0
- package/dist/components/Configuration/builder.js +67 -0
- package/dist/components/Configuration/index.d.ts +1 -0
- package/dist/components/Configuration/index.js +1 -0
- package/dist/components/FileTree/index.css +58 -0
- package/dist/components/FileTree/index.d.ts +4 -0
- package/dist/components/FileTree/index.js +42 -0
- package/dist/components/Form/keyword.d.ts +14 -0
- package/dist/components/Form/keyword.js +60 -0
- package/dist/components/Keyword/index.d.ts +6 -0
- package/dist/components/Keyword/index.js +36 -0
- package/dist/components/Layout/builder-select.d.ts +2 -0
- package/dist/components/Layout/builder-select.js +50 -0
- package/dist/components/Layout/constants.d.ts +1 -0
- package/dist/components/Layout/constants.js +4 -0
- package/dist/components/Layout/header.css +12 -0
- package/dist/components/Layout/header.d.ts +3 -0
- package/dist/components/Layout/header.js +86 -0
- package/dist/components/Layout/index.d.ts +5 -0
- package/dist/components/Layout/index.js +34 -0
- package/dist/components/Layout/menus.d.ts +8 -0
- package/dist/components/Layout/menus.js +167 -0
- package/dist/components/Layout/progress.d.ts +8 -0
- package/dist/components/Layout/progress.js +44 -0
- package/dist/components/Loader/Analysis/files.d.ts +8 -0
- package/dist/components/Loader/Analysis/files.js +193 -0
- package/dist/components/Loader/Analysis/index.d.ts +11 -0
- package/dist/components/Loader/Analysis/index.js +23 -0
- package/dist/components/Loader/executions.d.ts +9 -0
- package/dist/components/Loader/executions.js +199 -0
- package/dist/components/Manifest/api.d.ts +34 -0
- package/dist/components/Manifest/api.js +127 -0
- package/dist/components/Manifest/data.d.ts +8 -0
- package/dist/components/Manifest/data.js +65 -0
- package/dist/components/Manifest/index.d.ts +2 -0
- package/dist/components/Manifest/index.js +2 -0
- package/dist/components/Opener/code.d.ts +20 -0
- package/dist/components/Opener/code.js +78 -0
- package/dist/components/Opener/index.d.ts +2 -0
- package/dist/components/Opener/index.js +2 -0
- package/dist/components/Opener/vscode.d.ts +11 -0
- package/dist/components/Opener/vscode.js +42 -0
- package/dist/components/Overall/NumberButton.d.ts +8 -0
- package/dist/components/Overall/NumberButton.js +29 -0
- package/dist/components/Overall/NumberButton.module.js +5 -0
- package/dist/components/Overall/NumberButton_module.css +70 -0
- package/dist/components/Overall/bundle.d.ts +6 -0
- package/dist/components/Overall/bundle.js +167 -0
- package/dist/components/Overall/bundle.module.css +0 -0
- package/dist/components/Overall/card.module.js +5 -0
- package/dist/components/Overall/card_module.css +6 -0
- package/dist/components/Overall/compile.d.ts +5 -0
- package/dist/components/Overall/compile.js +67 -0
- package/dist/components/Overall/compile.module.js +5 -0
- package/dist/components/Overall/compile_module.css +4 -0
- package/dist/components/Overall/index.d.ts +3 -0
- package/dist/components/Overall/index.js +3 -0
- package/dist/components/Overall/list.module.js +5 -0
- package/dist/components/Overall/list_module.css +7 -0
- package/dist/components/Overall/project.d.ts +8 -0
- package/dist/components/Overall/project.js +73 -0
- package/dist/components/Plugins/webpack.d.ts +18 -0
- package/dist/components/Plugins/webpack.js +76 -0
- package/dist/components/Resolver/analysis.d.ts +15 -0
- package/dist/components/Resolver/analysis.js +144 -0
- package/dist/components/Select/index.d.ts +15 -0
- package/dist/components/Select/index.js +68 -0
- package/dist/components/Status/failed.d.ts +9 -0
- package/dist/components/Status/failed.js +33 -0
- package/dist/components/Status/index.d.ts +1 -0
- package/dist/components/Status/index.js +1 -0
- package/dist/components/TextDrawer/duplicate.d.ts +17 -0
- package/dist/components/TextDrawer/duplicate.js +69 -0
- package/dist/components/TextDrawer/index.d.ts +11 -0
- package/dist/components/TextDrawer/index.js +36 -0
- package/dist/components/Title/index.d.ts +15 -0
- package/dist/components/Title/index.js +10 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/components/index.js +15 -0
- package/dist/components/worker/ecmaversion/client.d.ts +10 -0
- package/dist/components/worker/ecmaversion/client.js +60 -0
- package/dist/components/worker/ecmaversion/worker.d.ts +1 -0
- package/dist/components/worker/ecmaversion/worker.js +13 -0
- package/dist/components/worker/jsequal/client.d.ts +11 -0
- package/dist/components/worker/jsequal/client.js +38 -0
- package/dist/components/worker/jsequal/worker.d.ts +1 -0
- package/dist/components/worker/jsequal/worker.js +23 -0
- package/dist/config.d.ts +19 -0
- package/dist/config.js +25 -0
- package/dist/constants.d.ts +50 -0
- package/dist/constants.js +75 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6 -0
- package/dist/pages/BundleSize/components/asset.d.ts +26 -0
- package/dist/pages/BundleSize/components/asset.js +545 -0
- package/dist/pages/BundleSize/components/cards.d.ts +7 -0
- package/dist/pages/BundleSize/components/cards.js +143 -0
- package/dist/pages/BundleSize/components/editor.d.ts +5 -0
- package/dist/pages/BundleSize/components/editor.js +38 -0
- package/dist/pages/BundleSize/components/index.css +20 -0
- package/dist/pages/BundleSize/components/index.d.ts +16 -0
- package/dist/pages/BundleSize/components/index.js +366 -0
- package/dist/pages/BundleSize/config.d.ts +7 -0
- package/dist/pages/BundleSize/config.js +9 -0
- package/dist/pages/BundleSize/constants.d.ts +5 -0
- package/dist/pages/BundleSize/constants.js +9 -0
- package/dist/pages/BundleSize/index.d.ts +3 -0
- package/dist/pages/BundleSize/index.js +11 -0
- package/dist/pages/ModuleAnalyze/chunks.d.ts +6 -0
- package/dist/pages/ModuleAnalyze/chunks.js +48 -0
- package/dist/pages/ModuleAnalyze/components/fileTreeCom.css +97 -0
- package/dist/pages/ModuleAnalyze/components/fileTreeCom.d.ts +15 -0
- package/dist/pages/ModuleAnalyze/components/fileTreeCom.js +120 -0
- package/dist/pages/ModuleAnalyze/constants.d.ts +7 -0
- package/dist/pages/ModuleAnalyze/constants.js +14 -0
- package/dist/pages/ModuleAnalyze/dependncy.d.ts +9 -0
- package/dist/pages/ModuleAnalyze/dependncy.js +31 -0
- package/dist/pages/ModuleAnalyze/fileTree.d.ts +9 -0
- package/dist/pages/ModuleAnalyze/fileTree.js +125 -0
- package/dist/pages/ModuleAnalyze/index.css +10 -0
- package/dist/pages/ModuleAnalyze/index.d.ts +8 -0
- package/dist/pages/ModuleAnalyze/index.js +64 -0
- package/dist/pages/ModuleAnalyze/utils/hooks.d.ts +21 -0
- package/dist/pages/ModuleAnalyze/utils/hooks.js +62 -0
- package/dist/pages/ModuleAnalyze/utils/index.d.ts +3 -0
- package/dist/pages/ModuleAnalyze/utils/index.js +34 -0
- package/dist/pages/ModuleResolve/constants.d.ts +3 -0
- package/dist/pages/ModuleResolve/constants.js +7 -0
- package/dist/pages/ModuleResolve/index.d.ts +3 -0
- package/dist/pages/ModuleResolve/index.js +19 -0
- package/dist/pages/Overall/constants.d.ts +3 -0
- package/dist/pages/Overall/constants.js +7 -0
- package/dist/pages/Overall/index.d.ts +9 -0
- package/dist/pages/Overall/index.js +39 -0
- package/dist/pages/Overall/responsiveGridList.d.ts +6 -0
- package/dist/pages/Overall/responsiveGridList.js +28 -0
- package/dist/pages/Resources/RuleIndex/constants.d.ts +3 -0
- package/dist/pages/Resources/RuleIndex/constants.js +7 -0
- package/dist/pages/Resources/RuleIndex/index.d.ts +3 -0
- package/dist/pages/Resources/RuleIndex/index.js +53 -0
- package/dist/pages/TreeShaking/constants.d.ts +3 -0
- package/dist/pages/TreeShaking/constants.js +7 -0
- package/dist/pages/TreeShaking/editor.d.ts +12 -0
- package/dist/pages/TreeShaking/editor.js +110 -0
- package/dist/pages/TreeShaking/index.css +74 -0
- package/dist/pages/TreeShaking/index.d.ts +8 -0
- package/dist/pages/TreeShaking/index.js +177 -0
- package/dist/pages/TreeShaking/open-tag.d.ts +11 -0
- package/dist/pages/TreeShaking/open-tag.js +43 -0
- package/dist/pages/TreeShaking/space.d.ts +1 -0
- package/dist/pages/TreeShaking/space.js +16 -0
- package/dist/pages/TreeShaking/table.d.ts +13 -0
- package/dist/pages/TreeShaking/table.js +319 -0
- package/dist/pages/TreeShaking/types.d.ts +3 -0
- package/dist/pages/TreeShaking/types.js +0 -0
- package/dist/pages/TreeShaking/utils.d.ts +7 -0
- package/dist/pages/TreeShaking/utils.js +147 -0
- package/dist/pages/WebpackLoaders/Analysis/constants.d.ts +3 -0
- package/dist/pages/WebpackLoaders/Analysis/constants.js +7 -0
- package/dist/pages/WebpackLoaders/Analysis/index.d.ts +3 -0
- package/dist/pages/WebpackLoaders/Analysis/index.js +19 -0
- package/dist/pages/WebpackLoaders/Overall/constants.d.ts +3 -0
- package/dist/pages/WebpackLoaders/Overall/constants.js +7 -0
- package/dist/pages/WebpackLoaders/Overall/index.d.ts +3 -0
- package/dist/pages/WebpackLoaders/Overall/index.js +11 -0
- package/dist/pages/WebpackLoaders/constants.d.ts +2 -0
- package/dist/pages/WebpackLoaders/constants.js +6 -0
- package/dist/pages/WebpackPlugins/constants.d.ts +3 -0
- package/dist/pages/WebpackPlugins/constants.js +7 -0
- package/dist/pages/WebpackPlugins/index.d.ts +3 -0
- package/dist/pages/WebpackPlugins/index.js +79 -0
- package/dist/pages/index.d.ts +9 -0
- package/dist/pages/index.js +20 -0
- package/dist/utils/data/base.d.ts +24 -0
- package/dist/utils/data/base.js +48 -0
- package/dist/utils/data/index.d.ts +5 -0
- package/dist/utils/data/index.js +44 -0
- package/dist/utils/data/local.d.ts +14 -0
- package/dist/utils/data/local.js +86 -0
- package/dist/utils/data/remote.d.ts +10 -0
- package/dist/utils/data/remote.js +52 -0
- package/dist/utils/file.d.ts +33 -0
- package/dist/utils/file.js +154 -0
- package/dist/utils/hooks.d.ts +31 -0
- package/dist/utils/hooks.js +216 -0
- package/dist/utils/i18n/cn.d.ts +3 -0
- package/dist/utils/i18n/cn.js +33 -0
- package/dist/utils/i18n/en.d.ts +30 -0
- package/dist/utils/i18n/en.js +33 -0
- package/dist/utils/i18n/index.d.ts +2 -0
- package/dist/utils/i18n/index.js +34 -0
- package/dist/utils/index.d.ts +16 -0
- package/dist/utils/index.js +16 -0
- package/dist/utils/loader.d.ts +7 -0
- package/dist/utils/loader.js +34 -0
- package/dist/utils/locale.d.ts +2 -0
- package/dist/utils/locale.js +9 -0
- package/dist/utils/manifest.d.ts +27 -0
- package/dist/utils/manifest.js +54 -0
- package/dist/utils/monaco.d.ts +12 -0
- package/dist/utils/monaco.js +71 -0
- package/dist/utils/request.d.ts +27 -0
- package/dist/utils/request.js +130 -0
- package/dist/utils/routes.d.ts +3 -0
- package/dist/utils/routes.js +14 -0
- package/dist/utils/size.d.ts +2 -0
- package/dist/utils/size.js +24 -0
- package/dist/utils/socket.d.ts +2 -0
- package/dist/utils/socket.js +21 -0
- package/dist/utils/storage.d.ts +13 -0
- package/dist/utils/storage.js +70 -0
- package/dist/utils/string.d.ts +2 -0
- package/dist/utils/string.js +14 -0
- package/dist/utils/time.d.ts +3 -0
- package/dist/utils/time.js +7 -0
- package/dist/utils/url.d.ts +7 -0
- package/dist/utils/url.js +75 -0
- package/dist/utils/worker/index.d.ts +4 -0
- package/dist/utils/worker/index.js +4 -0
- package/dist/utils/worker/master.d.ts +8 -0
- package/dist/utils/worker/master.js +18 -0
- package/dist/utils/worker/types.d.ts +9 -0
- package/dist/utils/worker/types.js +0 -0
- package/dist/utils/worker/utils.d.ts +7 -0
- package/dist/utils/worker/utils.js +29 -0
- package/dist/utils/worker/worker.d.ts +13 -0
- package/dist/utils/worker/worker.js +38 -0
- package/package.json +92 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./builder";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
.rc-tree {
|
|
2
|
+
margin: 0;
|
|
3
|
+
border: 1px solid transparent;
|
|
4
|
+
}
|
|
5
|
+
.rc-tree .rc-tree-treenode {
|
|
6
|
+
margin: 0;
|
|
7
|
+
padding: 0;
|
|
8
|
+
line-height: 24px;
|
|
9
|
+
white-space: nowrap;
|
|
10
|
+
list-style: none;
|
|
11
|
+
outline: 0;
|
|
12
|
+
}
|
|
13
|
+
.rc-tree .rc-tree-treenode .rc-tree-node-content-wrapper {
|
|
14
|
+
position: relative;
|
|
15
|
+
display: inline-block;
|
|
16
|
+
height: 24px;
|
|
17
|
+
margin: 0;
|
|
18
|
+
padding: 0 4px;
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
text-decoration: none;
|
|
21
|
+
vertical-align: top;
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
}
|
|
24
|
+
.rc-tree .rc-tree-treenode-child-tree {
|
|
25
|
+
display: none;
|
|
26
|
+
}
|
|
27
|
+
.rc-tree .rc-tree-treenode-child-tree-open {
|
|
28
|
+
display: block;
|
|
29
|
+
}
|
|
30
|
+
.rc-tree .rc-tree-treenode-treenode-disabled > span:not(.rc-tree-switcher),
|
|
31
|
+
.rc-tree .rc-tree-treenode > a,
|
|
32
|
+
.rc-tree .rc-tree-treenode > a span {
|
|
33
|
+
color: #767676;
|
|
34
|
+
cursor: not-allowed;
|
|
35
|
+
}
|
|
36
|
+
.rc-tree .rc-tree-treenode-treenode-selected {
|
|
37
|
+
background: rgba(5, 145, 255, 0.3);
|
|
38
|
+
border-radius: 4px;
|
|
39
|
+
}
|
|
40
|
+
.rc-tree .rc-tree-treenode-title {
|
|
41
|
+
display: inline-block;
|
|
42
|
+
}
|
|
43
|
+
.rc-tree .rc-tree-treenode-indent {
|
|
44
|
+
display: inline-block;
|
|
45
|
+
height: 0;
|
|
46
|
+
vertical-align: bottom;
|
|
47
|
+
}
|
|
48
|
+
.rc-tree .rc-tree-treenode-indent-unit {
|
|
49
|
+
display: inline-block;
|
|
50
|
+
width: 14px;
|
|
51
|
+
}
|
|
52
|
+
.file-tree-switcher-arrow {
|
|
53
|
+
transform: rotate(0deg);
|
|
54
|
+
transition: transform 0.3s ease;
|
|
55
|
+
}
|
|
56
|
+
.file-tree-switcher-arrow-expand {
|
|
57
|
+
transform: rotate(90deg);
|
|
58
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Space, theme } from "antd";
|
|
3
|
+
import { FileOutlined, FolderOpenOutlined, FolderOutlined, RightOutlined } from "@ant-design/icons";
|
|
4
|
+
import Tree from "rc-tree";
|
|
5
|
+
import { Size } from "../../constants";
|
|
6
|
+
import "./index.css";
|
|
7
|
+
import { useTheme } from "../../utils";
|
|
8
|
+
const { useToken } = theme;
|
|
9
|
+
const FileTree = (props) => {
|
|
10
|
+
const { isDark } = useTheme();
|
|
11
|
+
const { token } = useToken();
|
|
12
|
+
const color = isDark ? token.colorWhite : token.colorText;
|
|
13
|
+
const style = { fontSize: token.fontSize };
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
Tree,
|
|
16
|
+
{
|
|
17
|
+
checkable: false,
|
|
18
|
+
selectable: true,
|
|
19
|
+
switcherIcon: ({ data, expanded }) => {
|
|
20
|
+
if (data?.children) {
|
|
21
|
+
return /* @__PURE__ */ jsxs(Space, { style: { color }, children: [
|
|
22
|
+
/* @__PURE__ */ jsx(
|
|
23
|
+
RightOutlined,
|
|
24
|
+
{
|
|
25
|
+
twoToneColor: color,
|
|
26
|
+
className: `file-tree-switcher-arrow ${expanded ? "file-tree-switcher-arrow-expand" : ""}`,
|
|
27
|
+
style
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
expanded ? /* @__PURE__ */ jsx(FolderOpenOutlined, { twoToneColor: color, style }) : /* @__PURE__ */ jsx(FolderOutlined, { twoToneColor: color, style })
|
|
31
|
+
] });
|
|
32
|
+
}
|
|
33
|
+
return /* @__PURE__ */ jsx(FileOutlined, { style: { marginLeft: Size.BasePadding - 6, color } });
|
|
34
|
+
},
|
|
35
|
+
expandAction: "click",
|
|
36
|
+
...props
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
FileTree
|
|
42
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface KeywordProps {
|
|
3
|
+
style?: React.CSSProperties;
|
|
4
|
+
labelStyle?: React.CSSProperties;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
label?: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
delay?: number;
|
|
9
|
+
className?: string;
|
|
10
|
+
width?: number;
|
|
11
|
+
onChange: (keyword: string) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const KeywordInput: React.FC<KeywordProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { Button, Input, Typography } from "antd";
|
|
4
|
+
const KeywordInput = ({
|
|
5
|
+
icon: Icon,
|
|
6
|
+
label,
|
|
7
|
+
labelStyle: ls = {},
|
|
8
|
+
placeholder,
|
|
9
|
+
onChange,
|
|
10
|
+
style,
|
|
11
|
+
className,
|
|
12
|
+
width,
|
|
13
|
+
delay = 300
|
|
14
|
+
}) => {
|
|
15
|
+
const labelWidth = 120;
|
|
16
|
+
const [filename, setFilename] = useState("");
|
|
17
|
+
const labelStyle = { width: labelWidth, ...ls };
|
|
18
|
+
const ref = useRef(null);
|
|
19
|
+
let timer;
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
onChange(filename);
|
|
22
|
+
}, [filename]);
|
|
23
|
+
return /* @__PURE__ */ jsxs(Input.Group, { compact: true, style, className, children: [
|
|
24
|
+
label || Icon ? /* @__PURE__ */ jsxs(
|
|
25
|
+
Button,
|
|
26
|
+
{
|
|
27
|
+
style: labelStyle,
|
|
28
|
+
onClick: () => {
|
|
29
|
+
if (ref && ref.current) {
|
|
30
|
+
ref.current.focus();
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
children: [
|
|
34
|
+
Icon || null,
|
|
35
|
+
/* @__PURE__ */ jsx(Typography.Text, { children: label })
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
) : null,
|
|
39
|
+
/* @__PURE__ */ jsx(
|
|
40
|
+
Input,
|
|
41
|
+
{
|
|
42
|
+
ref,
|
|
43
|
+
allowClear: true,
|
|
44
|
+
defaultValue: filename,
|
|
45
|
+
style: { width: width ? width - labelWidth : 250 },
|
|
46
|
+
placeholder,
|
|
47
|
+
onChange: (e) => {
|
|
48
|
+
clearTimeout(timer);
|
|
49
|
+
const v = e.target.value.trim();
|
|
50
|
+
setTimeout(() => {
|
|
51
|
+
setFilename(v);
|
|
52
|
+
}, delay);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
] });
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
KeywordInput
|
|
60
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Typography } from "antd";
|
|
3
|
+
const Keyword = ({ text, keyword, ...rest }) => {
|
|
4
|
+
if (!keyword) {
|
|
5
|
+
return /* @__PURE__ */ jsx(Typography.Text, { ...rest, children: text });
|
|
6
|
+
}
|
|
7
|
+
const idx = text.indexOf(keyword);
|
|
8
|
+
if (idx === -1) {
|
|
9
|
+
return /* @__PURE__ */ jsx(Typography.Text, { ...rest, children: text });
|
|
10
|
+
}
|
|
11
|
+
const els = [];
|
|
12
|
+
let str = text;
|
|
13
|
+
while (str.length > 0) {
|
|
14
|
+
const idx2 = str.indexOf(keyword);
|
|
15
|
+
if (idx2 > -1) {
|
|
16
|
+
if (idx2 !== 0) {
|
|
17
|
+
els.push(
|
|
18
|
+
/* @__PURE__ */ jsx(Typography.Text, { style: { fontSize: "inherit" }, children: str.slice(0, idx2) }, els.length)
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
els.push(
|
|
22
|
+
/* @__PURE__ */ jsx(Typography.Text, { mark: true, style: { fontSize: "inherit" }, children: keyword }, els.length)
|
|
23
|
+
);
|
|
24
|
+
str = str.slice(idx2 + keyword.length);
|
|
25
|
+
} else {
|
|
26
|
+
els.push(
|
|
27
|
+
/* @__PURE__ */ jsx(Typography.Text, { style: { fontSize: "inherit" }, children: str }, els.length)
|
|
28
|
+
);
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return /* @__PURE__ */ jsx(Typography.Text, { ...rest, children: els });
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
Keyword
|
|
36
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Select, Divider, Typography } from "antd";
|
|
3
|
+
import { useState, useEffect } from "react";
|
|
4
|
+
import Icon from "../../assets/connection-point.3b3c78ca.svg";
|
|
5
|
+
import { fetchManifest, changeOrigin } from "../../utils";
|
|
6
|
+
const BuilderSelect = () => {
|
|
7
|
+
const [buildName, setBuildName] = useState("");
|
|
8
|
+
const [series, setSeries] = useState([]);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
fetchManifest().then(({ name, series: series2 }) => {
|
|
11
|
+
if (name) {
|
|
12
|
+
setBuildName(name);
|
|
13
|
+
}
|
|
14
|
+
if (series2 && series2.length > 0) {
|
|
15
|
+
setSeries(series2);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}, []);
|
|
19
|
+
if (buildName.length <= 0 || series.length <= 0) {
|
|
20
|
+
return /* @__PURE__ */ jsx(Fragment, {});
|
|
21
|
+
}
|
|
22
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
23
|
+
/* @__PURE__ */ jsx(Divider, { type: "vertical", style: { margin: "0 24px" } }),
|
|
24
|
+
/* @__PURE__ */ jsx("img", { src: Icon, style: { marginRight: 6, height: 16 } }),
|
|
25
|
+
/* @__PURE__ */ jsx(Typography, { children: "Compiler" }),
|
|
26
|
+
/* @__PURE__ */ jsx(
|
|
27
|
+
Select,
|
|
28
|
+
{
|
|
29
|
+
className: "builder-selector",
|
|
30
|
+
defaultValue: buildName,
|
|
31
|
+
bordered: false,
|
|
32
|
+
style: { minWidth: 100 },
|
|
33
|
+
onChange: (val) => {
|
|
34
|
+
const item = series.find((item2) => item2.name === val);
|
|
35
|
+
if (item) {
|
|
36
|
+
if (item.origin) {
|
|
37
|
+
location.href = changeOrigin(item.origin);
|
|
38
|
+
} else {
|
|
39
|
+
console.error("No RsdoctorManifestSeriesData.origin");
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
children: series.map((item, i) => /* @__PURE__ */ jsx(Select.Option, { value: item.name, className: "builder-selector-option-item", children: item.name }, i))
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
] });
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
BuilderSelect
|
|
50
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CompileName = "Compile Analysis";
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { TranslationOutlined } from "@ant-design/icons";
|
|
3
|
+
import { Col, Dropdown, Layout, Row, Typography } from "antd";
|
|
4
|
+
import { Language, Size } from "../../constants";
|
|
5
|
+
import {
|
|
6
|
+
useI18n,
|
|
7
|
+
useTheme
|
|
8
|
+
} from "../../utils";
|
|
9
|
+
import { OverlayAlertsWithButton } from "../Alerts";
|
|
10
|
+
import { BuilderSelect } from "./builder-select";
|
|
11
|
+
import { Menus } from "./menus";
|
|
12
|
+
import "./header.css";
|
|
13
|
+
const Header = () => {
|
|
14
|
+
const { i18n } = useI18n();
|
|
15
|
+
const { isLight } = useTheme();
|
|
16
|
+
const iconStyle = {
|
|
17
|
+
display: "inline-block",
|
|
18
|
+
fontSize: 20,
|
|
19
|
+
textAlign: "center",
|
|
20
|
+
verticalAlign: "middle",
|
|
21
|
+
cursor: "pointer",
|
|
22
|
+
width: 30,
|
|
23
|
+
transition: "all 0.3s ease"
|
|
24
|
+
};
|
|
25
|
+
const languages = [
|
|
26
|
+
{ value: Language.Cn, label: "䏿–‡" },
|
|
27
|
+
{ value: Language.En, label: "English" }
|
|
28
|
+
];
|
|
29
|
+
return /* @__PURE__ */ jsx(
|
|
30
|
+
Layout.Header,
|
|
31
|
+
{
|
|
32
|
+
style: {
|
|
33
|
+
height: Size.NavBarHeight,
|
|
34
|
+
padding: 0,
|
|
35
|
+
paddingLeft: Size.BasePadding,
|
|
36
|
+
paddingRight: Size.BasePadding,
|
|
37
|
+
position: "fixed",
|
|
38
|
+
zIndex: 999,
|
|
39
|
+
width: "100%",
|
|
40
|
+
backgroundColor: isLight ? "#fff" : "#141414",
|
|
41
|
+
transition: "none"
|
|
42
|
+
},
|
|
43
|
+
children: /* @__PURE__ */ jsxs(Row, { justify: "space-between", align: "middle", style: { height: Size.NavBarHeight }, wrap: false, children: [
|
|
44
|
+
/* @__PURE__ */ jsx(Col, { style: { height: Size.NavBarHeight, lineHeight: `${Size.NavBarHeight + 2}px` }, children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", height: "100%" }, children: [
|
|
45
|
+
/* @__PURE__ */ jsx("img", { style: { height: 30 }, src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/lognuvj/rsdoctor/logo/rsdoctor.png", className: "web-doctor-logo", alt: "logo" }),
|
|
46
|
+
/* @__PURE__ */ jsx(Typography.Text, { style: { color: "inherit", fontSize: 18, marginLeft: 4, marginTop: 8 }, children: "Rsdoctor" }),
|
|
47
|
+
/* @__PURE__ */ jsx(BuilderSelect, {})
|
|
48
|
+
] }) }),
|
|
49
|
+
/* @__PURE__ */ jsx(Col, { flex: 1, children: /* @__PURE__ */ jsxs(
|
|
50
|
+
Row,
|
|
51
|
+
{
|
|
52
|
+
align: "middle",
|
|
53
|
+
justify: "end",
|
|
54
|
+
style: { height: Size.NavBarHeight },
|
|
55
|
+
wrap: false,
|
|
56
|
+
gutter: [Size.BasePadding / 3, 0],
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ jsx(Col, { children: /* @__PURE__ */ jsx(OverlayAlertsWithButton, {}) }),
|
|
59
|
+
/* @__PURE__ */ jsx(Menus, { style: { transition: "none" } }),
|
|
60
|
+
/* @__PURE__ */ jsx(Col, { children: /* @__PURE__ */ jsx(
|
|
61
|
+
Dropdown,
|
|
62
|
+
{
|
|
63
|
+
overlayStyle: { zIndex: 1e3 },
|
|
64
|
+
menu: {
|
|
65
|
+
items: languages.map((e) => ({
|
|
66
|
+
label: e.label,
|
|
67
|
+
key: e.value,
|
|
68
|
+
onClick() {
|
|
69
|
+
i18n.changeLanguage(e.value);
|
|
70
|
+
}
|
|
71
|
+
})),
|
|
72
|
+
selectedKeys: [i18n.language]
|
|
73
|
+
},
|
|
74
|
+
children: /* @__PURE__ */ jsx(TranslationOutlined, { className: "header-icon", style: iconStyle })
|
|
75
|
+
}
|
|
76
|
+
) })
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
) })
|
|
80
|
+
] })
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
export {
|
|
85
|
+
Header
|
|
86
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { FloatButton, Layout as L } from "antd";
|
|
4
|
+
import { MAIN_BG, Size } from "../../constants";
|
|
5
|
+
import { Header } from "./header";
|
|
6
|
+
import { useLocale, useI18n } from "../../utils";
|
|
7
|
+
import { Progress } from "./progress";
|
|
8
|
+
const Layout = (props) => {
|
|
9
|
+
const locale = useLocale();
|
|
10
|
+
const { i18n } = useI18n();
|
|
11
|
+
const { children } = props;
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (i18n.language !== locale) {
|
|
14
|
+
i18n.changeLanguage(locale);
|
|
15
|
+
}
|
|
16
|
+
}, [locale]);
|
|
17
|
+
return /* @__PURE__ */ jsxs(L, { children: [
|
|
18
|
+
/* @__PURE__ */ jsx(Header, {}),
|
|
19
|
+
/* @__PURE__ */ jsx(Progress, {}),
|
|
20
|
+
/* @__PURE__ */ jsxs(
|
|
21
|
+
L.Content,
|
|
22
|
+
{
|
|
23
|
+
style: { height: "100%", minHeight: "100vh", padding: Size.BasePadding, marginTop: Size.NavBarHeight, background: MAIN_BG },
|
|
24
|
+
children: [
|
|
25
|
+
children,
|
|
26
|
+
/* @__PURE__ */ jsx(FloatButton.BackTop, {})
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
] });
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
Layout
|
|
34
|
+
};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import {
|
|
3
|
+
ApiOutlined,
|
|
4
|
+
BarChartOutlined,
|
|
5
|
+
FolderViewOutlined,
|
|
6
|
+
MenuOutlined,
|
|
7
|
+
MonitorOutlined,
|
|
8
|
+
NodeIndexOutlined,
|
|
9
|
+
ToolOutlined
|
|
10
|
+
} from "@ant-design/icons";
|
|
11
|
+
import { Manifest, SDK } from "@rsdoctor/types";
|
|
12
|
+
import { Col, Menu, Typography } from "antd";
|
|
13
|
+
import { includes } from "lodash-es";
|
|
14
|
+
import { useLocation, useNavigate } from "react-router-dom";
|
|
15
|
+
import WebpackIcon from "../../assets/webpack.98604d64.svg";
|
|
16
|
+
import { Size } from "../../constants";
|
|
17
|
+
import * as OverallConstants from "../../pages/Overall/constants";
|
|
18
|
+
import { useI18n, hasBundle, hasCompile } from "../../utils";
|
|
19
|
+
import { withServerAPI } from "../Manifest";
|
|
20
|
+
import {
|
|
21
|
+
BundleSize,
|
|
22
|
+
LoaderFiles,
|
|
23
|
+
PluginsAnalyze,
|
|
24
|
+
ModuleResolve,
|
|
25
|
+
LoaderTimeline,
|
|
26
|
+
TreeShaking
|
|
27
|
+
} from "../../pages";
|
|
28
|
+
import { CompileName } from "./constants";
|
|
29
|
+
const BuilderSwitchName = "builder-switcher";
|
|
30
|
+
const MenusBase = (props) => {
|
|
31
|
+
const { t } = useI18n();
|
|
32
|
+
const { pathname } = useLocation();
|
|
33
|
+
const navigate = useNavigate();
|
|
34
|
+
const { routes: enableRoutes } = props;
|
|
35
|
+
const iconStyle = {
|
|
36
|
+
fontSize: 16
|
|
37
|
+
};
|
|
38
|
+
const customIconStyle = {
|
|
39
|
+
...iconStyle,
|
|
40
|
+
transform: "translateY(-2px)"
|
|
41
|
+
};
|
|
42
|
+
const items = [];
|
|
43
|
+
console.log("enableRoutes: ", enableRoutes);
|
|
44
|
+
if (includes(enableRoutes, Manifest.RsdoctorManifestClientRoutes.Overall)) {
|
|
45
|
+
items.push({
|
|
46
|
+
label: t(OverallConstants.name),
|
|
47
|
+
key: OverallConstants.route,
|
|
48
|
+
icon: /* @__PURE__ */ jsx(BarChartOutlined, { style: iconStyle }),
|
|
49
|
+
children: [],
|
|
50
|
+
onTitleClick(e) {
|
|
51
|
+
navigate(e.key);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
if (hasCompile(enableRoutes)) {
|
|
56
|
+
items.push({
|
|
57
|
+
label: t(CompileName),
|
|
58
|
+
key: CompileName,
|
|
59
|
+
icon: /* @__PURE__ */ jsx(ToolOutlined, { style: iconStyle }),
|
|
60
|
+
children: [
|
|
61
|
+
includes(
|
|
62
|
+
enableRoutes,
|
|
63
|
+
Manifest.RsdoctorManifestClientRoutes.WebpackLoaders
|
|
64
|
+
) && {
|
|
65
|
+
label: /* @__PURE__ */ jsx(Typography.Text, { style: { marginRight: 8 }, children: t(LoaderFiles.name) }),
|
|
66
|
+
key: LoaderFiles.route,
|
|
67
|
+
icon: /* @__PURE__ */ jsx("img", { src: WebpackIcon, alt: "", style: { ...iconStyle, width: 16 } }),
|
|
68
|
+
children: [
|
|
69
|
+
{
|
|
70
|
+
label: t(LoaderTimeline.name),
|
|
71
|
+
key: LoaderTimeline.route,
|
|
72
|
+
icon: /* @__PURE__ */ jsx(BarChartOutlined, { style: iconStyle })
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
label: t(LoaderFiles.name),
|
|
76
|
+
key: LoaderFiles.route,
|
|
77
|
+
icon: /* @__PURE__ */ jsx(MonitorOutlined, { style: iconStyle })
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
includes(
|
|
82
|
+
enableRoutes,
|
|
83
|
+
Manifest.RsdoctorManifestClientRoutes.ModuleResolve
|
|
84
|
+
) && {
|
|
85
|
+
label: t(ModuleResolve.name),
|
|
86
|
+
key: ModuleResolve.route,
|
|
87
|
+
icon: /* @__PURE__ */ jsx(NodeIndexOutlined, { style: iconStyle })
|
|
88
|
+
},
|
|
89
|
+
includes(
|
|
90
|
+
enableRoutes,
|
|
91
|
+
Manifest.RsdoctorManifestClientRoutes.WebpackPlugins
|
|
92
|
+
) && {
|
|
93
|
+
label: t(PluginsAnalyze.name),
|
|
94
|
+
key: PluginsAnalyze.route,
|
|
95
|
+
icon: /* @__PURE__ */ jsx(ApiOutlined, { style: iconStyle })
|
|
96
|
+
}
|
|
97
|
+
].filter((e) => Boolean(e))
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (hasBundle(enableRoutes)) {
|
|
101
|
+
items.push({
|
|
102
|
+
label: t(BundleSize.name),
|
|
103
|
+
key: BundleSize.name,
|
|
104
|
+
icon: /* @__PURE__ */ jsx("span", { style: customIconStyle, children: "📦" }),
|
|
105
|
+
children: [
|
|
106
|
+
includes(
|
|
107
|
+
enableRoutes,
|
|
108
|
+
Manifest.RsdoctorManifestClientRoutes.BundleSize
|
|
109
|
+
) && {
|
|
110
|
+
label: t(BundleSize.name),
|
|
111
|
+
key: BundleSize.route,
|
|
112
|
+
icon: /* @__PURE__ */ jsx(FolderViewOutlined, { style: iconStyle })
|
|
113
|
+
},
|
|
114
|
+
includes(
|
|
115
|
+
enableRoutes,
|
|
116
|
+
Manifest.RsdoctorManifestClientRoutes.TreeShaking
|
|
117
|
+
) && {
|
|
118
|
+
label: t(TreeShaking.name),
|
|
119
|
+
key: TreeShaking.route,
|
|
120
|
+
icon: /* @__PURE__ */ jsx(FolderViewOutlined, { style: iconStyle })
|
|
121
|
+
}
|
|
122
|
+
].filter((e) => Boolean(e))
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
const MenuComponent = /* @__PURE__ */ jsx(
|
|
126
|
+
Menu,
|
|
127
|
+
{
|
|
128
|
+
items,
|
|
129
|
+
mode: "horizontal",
|
|
130
|
+
onClick: (e) => {
|
|
131
|
+
if (!e.keyPath.includes(BuilderSwitchName)) {
|
|
132
|
+
navigate(e.key);
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
overflowedIndicator: /* @__PURE__ */ jsx(MenuOutlined, {}),
|
|
136
|
+
style: {
|
|
137
|
+
height: Size.NavBarHeight,
|
|
138
|
+
lineHeight: `${Size.NavBarHeight}px`,
|
|
139
|
+
minWidth: 0,
|
|
140
|
+
justifyContent: "flex-end",
|
|
141
|
+
...props.style
|
|
142
|
+
},
|
|
143
|
+
selectedKeys: [pathname === "/" ? OverallConstants.route : pathname]
|
|
144
|
+
},
|
|
145
|
+
enableRoutes.join("")
|
|
146
|
+
);
|
|
147
|
+
return /* @__PURE__ */ jsx(
|
|
148
|
+
Col,
|
|
149
|
+
{
|
|
150
|
+
xs: { span: 3 },
|
|
151
|
+
md: { span: 6 },
|
|
152
|
+
lg: { span: 10 },
|
|
153
|
+
xl: { span: 11 },
|
|
154
|
+
xxl: { span: 12 },
|
|
155
|
+
children: MenuComponent
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
};
|
|
159
|
+
const Menus = withServerAPI({
|
|
160
|
+
api: SDK.ServerAPI.API.GetClientRoutes,
|
|
161
|
+
responsePropName: "routes",
|
|
162
|
+
Component: MenusBase,
|
|
163
|
+
fallbackComponent: () => null
|
|
164
|
+
});
|
|
165
|
+
export {
|
|
166
|
+
Menus
|
|
167
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SDK } from '@rsdoctor/types';
|
|
3
|
+
export interface ProgressProps {
|
|
4
|
+
progress: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.APIExtends.GetCompileProgess>;
|
|
5
|
+
}
|
|
6
|
+
export declare const Progress: React.FC<Omit<ProgressProps, "progress"> & Partial<{
|
|
7
|
+
body?: any;
|
|
8
|
+
}>>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Col, Progress as P, Row, Typography } from "antd";
|
|
3
|
+
import { SDK } from "@rsdoctor/types";
|
|
4
|
+
import { Size } from "../../constants";
|
|
5
|
+
import { withServerAPI } from "../Manifest";
|
|
6
|
+
const ProgressBase = ({ progress }) => {
|
|
7
|
+
if (!progress)
|
|
8
|
+
return null;
|
|
9
|
+
const { percentage = 1, message } = progress;
|
|
10
|
+
if (percentage >= 1)
|
|
11
|
+
return null;
|
|
12
|
+
const per = +(percentage * 100).toFixed(1);
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
Row,
|
|
15
|
+
{
|
|
16
|
+
wrap: true,
|
|
17
|
+
style: {
|
|
18
|
+
width: "100%",
|
|
19
|
+
position: "fixed",
|
|
20
|
+
top: Size.NavBarHeight,
|
|
21
|
+
left: 1,
|
|
22
|
+
zIndex: 99
|
|
23
|
+
},
|
|
24
|
+
children: /* @__PURE__ */ jsx(Col, { span: Math.min(Math.floor(percentage * 24), 24), children: /* @__PURE__ */ jsx(
|
|
25
|
+
P,
|
|
26
|
+
{
|
|
27
|
+
percent: 100,
|
|
28
|
+
status: "active",
|
|
29
|
+
size: "small",
|
|
30
|
+
format: () => /* @__PURE__ */ jsx(Typography.Text, { style: { fontSize: 12 }, type: "secondary", children: `${per}% ${message}` })
|
|
31
|
+
}
|
|
32
|
+
) })
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
const Progress = withServerAPI({
|
|
37
|
+
api: SDK.ServerAPI.APIExtends.GetCompileProgess,
|
|
38
|
+
responsePropName: "progress",
|
|
39
|
+
Component: ProgressBase,
|
|
40
|
+
fallbackComponent: () => null
|
|
41
|
+
});
|
|
42
|
+
export {
|
|
43
|
+
Progress
|
|
44
|
+
};
|