@rsdoctor/components 0.0.2-beta.0 → 0.0.2-beta.2
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/dist/components/Alert/change.js +2 -3
- package/dist/components/Alert/file-relation.js +1 -1
- package/dist/components/Alert/index.css +3 -0
- package/dist/components/Alert/link.js +1 -1
- package/dist/components/Alert/package-relation.js +8 -27
- package/dist/components/Alert/view.js +3 -4
- package/dist/components/Alerts/bundle.js +23 -9
- package/dist/components/Alerts/common.js +3 -20
- package/dist/components/Badge/index.js +11 -29
- package/dist/components/Card/diff.d.ts +2 -2
- package/dist/components/Card/diff.js +4 -33
- package/dist/components/Card/index.d.ts +1 -0
- package/dist/components/Card/index.js +6 -37
- package/dist/components/Card/size.d.ts +5 -0
- package/dist/components/Card/size.js +17 -9
- package/dist/components/Card/statistic.css +2 -1
- package/dist/components/Card/statistic.d.ts +3 -0
- package/dist/components/Card/statistic.js +6 -21
- package/dist/components/Charts/TimelineCharts/index.js +120 -127
- package/dist/components/Charts/common.js +1 -1
- package/dist/components/Charts/loader.js +9 -18
- package/dist/components/CodeViewer/diff.js +8 -26
- package/dist/components/CodeViewer/hightlight.js +3 -3
- package/dist/components/CodeViewer/viewer.js +4 -20
- package/dist/components/Configuration/{webpack.d.ts → builder.d.ts} +1 -1
- package/dist/components/Configuration/{webpack.js → builder.js} +6 -6
- package/dist/components/Configuration/index.d.ts +1 -1
- package/dist/components/Configuration/index.js +1 -1
- package/dist/components/FileTree/index.js +13 -24
- package/dist/components/Form/keyword.js +1 -17
- package/dist/components/Keyword/index.js +4 -36
- package/dist/components/Layout/builder-select.js +1 -1
- package/dist/components/Layout/header.js +2 -3
- package/dist/components/Layout/index.js +2 -2
- package/dist/components/Layout/menus.d.ts +1 -1
- package/dist/components/Layout/menus.js +11 -35
- package/dist/components/Loader/Analysis/files.js +8 -2
- package/dist/components/Loader/Analysis/index.d.ts +1 -1
- package/dist/components/Loader/executions.d.ts +1 -1
- package/dist/components/Loader/executions.js +62 -84
- package/dist/components/Manifest/api.d.ts +1 -1
- package/dist/components/Manifest/api.js +5 -35
- package/dist/components/Manifest/data.d.ts +1 -1
- package/dist/components/Manifest/data.js +1 -17
- package/dist/components/Opener/vscode.js +4 -19
- package/dist/components/Overall/bundle.js +2 -2
- package/dist/components/Overall/compile.js +1 -2
- package/dist/components/Resolver/analysis.js +1 -17
- package/dist/components/TextDrawer/duplicate.js +18 -56
- package/dist/components/TextDrawer/index.js +9 -28
- package/dist/components/worker/ecmaversion/client.js +1 -2
- package/dist/components/worker/ecmaversion/worker.js +3 -3
- package/dist/components/worker/jsequal/client.js +1 -2
- package/dist/components/worker/jsequal/worker.js +21 -50
- package/dist/config.d.ts +2 -2
- package/dist/config.js +3 -17
- package/dist/constants.d.ts +4 -2
- package/dist/constants.js +5 -1
- package/dist/pages/BundleSize/components/asset.js +74 -101
- package/dist/pages/BundleSize/components/cards.js +16 -27
- package/dist/pages/BundleSize/components/index.d.ts +1 -1
- package/dist/pages/BundleSize/components/index.js +57 -5
- package/dist/pages/BundleSize/constants.d.ts +1 -1
- package/dist/pages/BundleSize/constants.js +1 -1
- package/dist/pages/ModuleAnalyze/chunks.js +1 -1
- package/dist/pages/ModuleAnalyze/components/fileTreeCom.css +16 -7
- package/dist/pages/ModuleAnalyze/components/fileTreeCom.js +6 -24
- package/dist/pages/ModuleAnalyze/constants.d.ts +1 -1
- package/dist/pages/ModuleAnalyze/constants.js +1 -1
- package/dist/pages/ModuleAnalyze/utils/hooks.js +5 -8
- package/dist/pages/ModuleAnalyze/utils/index.js +2 -4
- package/dist/pages/ModuleResolve/constants.d.ts +1 -1
- package/dist/pages/ModuleResolve/constants.js +1 -1
- package/dist/pages/Overall/constants.d.ts +1 -1
- package/dist/pages/Overall/constants.js +1 -1
- 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/WebpackLoaders/Analysis/constants.d.ts +1 -1
- package/dist/pages/WebpackLoaders/Analysis/constants.js +1 -1
- package/dist/pages/WebpackLoaders/Overall/constants.d.ts +2 -2
- package/dist/pages/WebpackLoaders/Overall/constants.js +2 -2
- package/dist/pages/WebpackLoaders/Overall/index.js +1 -1
- package/dist/pages/WebpackPlugins/constants.d.ts +2 -2
- package/dist/pages/WebpackPlugins/constants.js +2 -2
- package/dist/pages/index.d.ts +2 -1
- package/dist/pages/index.js +3 -1
- package/dist/utils/data/base.d.ts +7 -7
- package/dist/utils/data/base.js +2 -24
- package/dist/utils/data/index.d.ts +1 -1
- package/dist/utils/data/index.js +14 -36
- package/dist/utils/data/local.d.ts +1 -1
- package/dist/utils/data/local.js +32 -56
- package/dist/utils/data/remote.d.ts +1 -1
- package/dist/utils/data/remote.js +22 -46
- package/dist/utils/file.js +4 -4
- package/dist/utils/hooks.d.ts +16 -15
- package/dist/utils/hooks.js +33 -73
- package/dist/utils/i18n/cn.js +1 -1
- package/dist/utils/i18n/en.d.ts +1 -1
- package/dist/utils/i18n/en.js +1 -1
- package/dist/utils/manifest.d.ts +2 -2
- package/dist/utils/monaco.d.ts +4 -1
- package/dist/utils/monaco.js +26 -3
- package/dist/utils/request.d.ts +10 -10
- package/dist/utils/request.js +52 -101
- package/dist/utils/routes.d.ts +2 -2
- package/dist/utils/routes.js +2 -2
- package/dist/utils/storage.js +3 -3
- package/dist/utils/url.js +10 -28
- package/package.json +7 -4
- package/dist/assets/icon.7509d763.svg +0 -21
|
@@ -46,9 +46,8 @@ const CodeChangeDrawerContent = ({ data, setIsFixed, cwd }) => {
|
|
|
46
46
|
] });
|
|
47
47
|
};
|
|
48
48
|
const CodeChangeAlert = ({ data, cwd }) => {
|
|
49
|
-
var _a;
|
|
50
49
|
const { title, description = "", level, code, file } = data;
|
|
51
|
-
const [isFixed, setIsFixed] = useState(
|
|
50
|
+
const [isFixed, setIsFixed] = useState(file.isFixed ?? false);
|
|
52
51
|
const navigate = useRuleIndexNavigate(code, data.link);
|
|
53
52
|
const fixFile = (val) => {
|
|
54
53
|
setIsFixed(val);
|
|
@@ -72,7 +71,7 @@ const CodeChangeAlert = ({ data, cwd }) => {
|
|
|
72
71
|
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: title })
|
|
73
72
|
] }),
|
|
74
73
|
description: Description,
|
|
75
|
-
type: isFixed ? "success" : level === "warn" ? "
|
|
74
|
+
type: isFixed ? "success" : level === "warn" ? "info" : level,
|
|
76
75
|
action: /* @__PURE__ */ jsxs(Space, { children: [
|
|
77
76
|
/* @__PURE__ */ jsx(
|
|
78
77
|
TextDrawer,
|
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Alert } from "antd";
|
|
3
3
|
const FileRelationAlert = ({ data }) => {
|
|
4
4
|
const { description = "", level } = data;
|
|
5
|
-
return /* @__PURE__ */ jsx(Alert, { type: level === "warn" ? "
|
|
5
|
+
return /* @__PURE__ */ jsx(Alert, { type: level === "warn" ? "info" : level, description });
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
8
8
|
FileRelationAlert
|
|
@@ -14,7 +14,7 @@ const LinkRuleAlert = ({ data }) => {
|
|
|
14
14
|
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: title })
|
|
15
15
|
] }),
|
|
16
16
|
description: /* @__PURE__ */ jsx("div", { dangerouslySetInnerHTML: { __html: description } }),
|
|
17
|
-
type: level === "warn" ? "
|
|
17
|
+
type: level === "warn" ? "info" : level,
|
|
18
18
|
action: /* @__PURE__ */ jsxs(Button, { type: "link", onClick: navigate, size: "small", children: [
|
|
19
19
|
"More",
|
|
20
20
|
/* @__PURE__ */ jsx(InfoCircleOutlined, {})
|
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
2
|
import { createElement } from "react";
|
|
22
3
|
import React, { useState } from "react";
|
|
@@ -24,7 +5,7 @@ import { Space, Alert, Button, Typography, Divider, Tabs, Row, Col, Timeline, Ca
|
|
|
24
5
|
import { sumBy } from "lodash-es";
|
|
25
6
|
import { Rule, SDK } from "@rsdoctor/types";
|
|
26
7
|
import { ExpandAltOutlined, InfoCircleOutlined } from "@ant-design/icons";
|
|
27
|
-
import { useRuleIndexNavigate, formatSize, useI18n } from "../../utils";
|
|
8
|
+
import { useRuleIndexNavigate, formatSize, useI18n, useWindowWidth } from "../../utils";
|
|
28
9
|
import { TextDrawer } from "../TextDrawer";
|
|
29
10
|
import { Title } from "../Title";
|
|
30
11
|
import { Size, Color } from "../../constants";
|
|
@@ -47,7 +28,7 @@ const PackageRelationReasons = ({ data, cwd }) => {
|
|
|
47
28
|
/* @__PURE__ */ jsx(Timeline, { children: data.map((e, i) => {
|
|
48
29
|
const { dependency, module, relativePath } = e;
|
|
49
30
|
const { statements } = dependency;
|
|
50
|
-
const { start } = module.isPreferSource ? statements[0].position.source : statements[0].position.transformed;
|
|
31
|
+
const { start } = statements?.[0]?.position ? module.isPreferSource ? statements[0].position.source : statements[0].position.transformed : { start: { line: 0, column: 0 } };
|
|
51
32
|
const text = `${relativePath}:${start.line}:${start.column || 1}`;
|
|
52
33
|
return /* @__PURE__ */ jsx(
|
|
53
34
|
Timeline.Item,
|
|
@@ -75,7 +56,7 @@ const PackageRelationReasons = ({ data, cwd }) => {
|
|
|
75
56
|
] }) : /* @__PURE__ */ jsx(Empty, { description: "This package no dependencies" })
|
|
76
57
|
}
|
|
77
58
|
) }),
|
|
78
|
-
/* @__PURE__ */ jsx(Col, { span: 12, style: { height: "100%" }, children: /* @__PURE__ */ createElement(FileHightLightViewer,
|
|
59
|
+
/* @__PURE__ */ jsx(Col, { span: 12, style: { height: "100%" }, children: /* @__PURE__ */ createElement(FileHightLightViewer, { ...data[index], key: index, cwd }) })
|
|
79
60
|
] });
|
|
80
61
|
};
|
|
81
62
|
const PackageRelationReasonsWithServer = withServerAPI({
|
|
@@ -87,11 +68,11 @@ const PackageRelationAlert = ({
|
|
|
87
68
|
data,
|
|
88
69
|
getPackageRelationContentComponent
|
|
89
70
|
}) => {
|
|
90
|
-
var _a;
|
|
91
71
|
const { level, code, packages } = data;
|
|
92
72
|
const navigate = useRuleIndexNavigate(code, data.link);
|
|
93
73
|
const totalSize = sumBy(packages, (e) => e.targetSize.sourceSize);
|
|
94
74
|
const totalSizeStr = formatSize(totalSize);
|
|
75
|
+
const windowWith = useWindowWidth();
|
|
95
76
|
const { name } = packages.find((e) => !!e.target.name).target;
|
|
96
77
|
const versions = packages.map((item) => item.target.version);
|
|
97
78
|
return /* @__PURE__ */ jsx(
|
|
@@ -100,7 +81,7 @@ const PackageRelationAlert = ({
|
|
|
100
81
|
showIcon: true,
|
|
101
82
|
message: /* @__PURE__ */ jsxs(Space, { children: [
|
|
102
83
|
/* @__PURE__ */ jsx(Typography.Text, { code: true, strong: true, onClick: navigate, style: { cursor: "pointer" }, children: /* @__PURE__ */ jsx("a", { children: code }) }),
|
|
103
|
-
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children:
|
|
84
|
+
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: Rule.RuleErrorMap[code]?.title || data.title }),
|
|
104
85
|
/* @__PURE__ */ jsx(Divider, { type: "vertical" }),
|
|
105
86
|
/* @__PURE__ */ jsxs(Typography.Text, { children: [
|
|
106
87
|
/* @__PURE__ */ jsx(Typography.Text, { strong: true, code: true, children: name }),
|
|
@@ -154,16 +135,16 @@ const PackageRelationAlert = ({
|
|
|
154
135
|
/* @__PURE__ */ jsx(
|
|
155
136
|
Typography.Paragraph,
|
|
156
137
|
{
|
|
157
|
-
style: { marginBottom: 0 },
|
|
138
|
+
style: { marginBottom: 0, width: windowWith > 1500 ? "50vw" : windowWith > 1200 ? "40vw" : "30vw" },
|
|
158
139
|
copyable: { text: el.root },
|
|
159
|
-
ellipsis: { rows:
|
|
140
|
+
ellipsis: { rows: 1, expandable: true, symbol: /* @__PURE__ */ jsx(ExpandAltOutlined, {}), tooltip: el.root },
|
|
160
141
|
code: true,
|
|
161
142
|
children: el.root
|
|
162
143
|
}
|
|
163
144
|
)
|
|
164
145
|
] }, el.version);
|
|
165
146
|
}) }),
|
|
166
|
-
type: level === "warn" ? "
|
|
147
|
+
type: level === "warn" ? "info" : level,
|
|
167
148
|
action: /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
168
149
|
packages && packages.length > 0 ? /* @__PURE__ */ jsx(TextDrawer, { text: "Show Relations", buttonProps: { size: "small" }, drawerProps: { title: data.title }, children: /* @__PURE__ */ jsxs(Space, { direction: "vertical", className: "alert-space", children: [
|
|
169
150
|
/* @__PURE__ */ jsxs(Space, { style: { marginBottom: Size.BasePadding / 2 }, children: [
|
|
@@ -10,7 +10,7 @@ import { CodeViewer } from "../CodeViewer";
|
|
|
10
10
|
const CodeViewDrawerContent = ({ data, cwd }) => {
|
|
11
11
|
const { file } = data;
|
|
12
12
|
const { path, ranges } = file;
|
|
13
|
-
const line = ranges
|
|
13
|
+
const line = ranges?.[0].start.line;
|
|
14
14
|
return /* @__PURE__ */ jsxs(Space, { direction: "vertical", className: "alert-space", children: [
|
|
15
15
|
/* @__PURE__ */ jsx(Title, { text: "Code Viewer" }),
|
|
16
16
|
/* @__PURE__ */ jsx(CodeOpener, { cwd, url: path, loc: isNumber(line) ? String(line) : void 0, code: true, disabled: true }),
|
|
@@ -18,10 +18,9 @@ const CodeViewDrawerContent = ({ data, cwd }) => {
|
|
|
18
18
|
] });
|
|
19
19
|
};
|
|
20
20
|
const CodeViewAlert = ({ data, cwd }) => {
|
|
21
|
-
var _a;
|
|
22
21
|
const { title, description = "", level, code, file } = data;
|
|
23
22
|
const navigate = useRuleIndexNavigate(code, data.link);
|
|
24
|
-
const startLine =
|
|
23
|
+
const startLine = file.ranges?.[0].start.line;
|
|
25
24
|
const Description = /* @__PURE__ */ jsxs(Space, { direction: "vertical", children: [
|
|
26
25
|
/* @__PURE__ */ jsx(Typography.Text, { children: description }),
|
|
27
26
|
/* @__PURE__ */ jsxs(Space, { children: [
|
|
@@ -42,7 +41,7 @@ const CodeViewAlert = ({ data, cwd }) => {
|
|
|
42
41
|
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: title })
|
|
43
42
|
] }),
|
|
44
43
|
description: Description,
|
|
45
|
-
type: level === "warn" ? "
|
|
44
|
+
type: level === "warn" ? "info" : level,
|
|
46
45
|
action: /* @__PURE__ */ jsxs(Space, { children: [
|
|
47
46
|
/* @__PURE__ */ jsx(TextDrawer, { text: "Show Source Code", buttonProps: { size: "small" }, children: /* @__PURE__ */ jsx(CodeViewDrawerContent, { data, cwd }) }),
|
|
48
47
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -6,6 +6,7 @@ import { CommonAlertsContainer } from "./common";
|
|
|
6
6
|
import { withServerAPI } from "../Manifest";
|
|
7
7
|
import { ViewMode } from "../../constants";
|
|
8
8
|
import { PackageRelationReasonsWithServer } from "../Alert/package-relation";
|
|
9
|
+
import { ConfigProvider } from "antd";
|
|
9
10
|
const BundleAlertsBase = ({ filter, project }) => {
|
|
10
11
|
const { errors, root: cwd } = project;
|
|
11
12
|
const bundleAlerts = useBundleAlertsByErrors(errors);
|
|
@@ -22,17 +23,30 @@ const BundleAlertsBase = ({ filter, project }) => {
|
|
|
22
23
|
}
|
|
23
24
|
}, []);
|
|
24
25
|
return /* @__PURE__ */ jsx(
|
|
25
|
-
|
|
26
|
+
ConfigProvider,
|
|
26
27
|
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
theme: {
|
|
29
|
+
components: {
|
|
30
|
+
Alert: {
|
|
31
|
+
colorInfoBg: "#e6f4ff57",
|
|
32
|
+
colorInfoBorder: "none"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
32
35
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
children: /* @__PURE__ */ jsx(
|
|
37
|
+
CommonAlertsContainer,
|
|
38
|
+
{
|
|
39
|
+
title: "Bundle Alerts",
|
|
40
|
+
dataSource,
|
|
41
|
+
extraData: {
|
|
42
|
+
cwd,
|
|
43
|
+
getPackageRelationContentComponent: (res) => /* @__PURE__ */ jsx(PackageRelationReasonsWithServer, { body: { id: res.data.id, target: res.package.target }, cwd })
|
|
44
|
+
},
|
|
45
|
+
viewMode: viewMode.bundleAlerts,
|
|
46
|
+
setViewMode: setBundleAlertsViewMode,
|
|
47
|
+
cwd
|
|
48
|
+
}
|
|
49
|
+
)
|
|
36
50
|
}
|
|
37
51
|
);
|
|
38
52
|
};
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
2
|
import { Collapse, Space, Radio, Typography, Tooltip } from "antd";
|
|
19
3
|
import { useMemo } from "react";
|
|
@@ -36,24 +20,23 @@ const CommonAlertsList = ({ dataSource, extraData }) => {
|
|
|
36
20
|
[dataSource]
|
|
37
21
|
);
|
|
38
22
|
return /* @__PURE__ */ jsx(Space, { direction: "vertical", style: { wordBreak: "break-all", width: "100%" }, children: _dataSource.map((err, i) => {
|
|
39
|
-
return /* @__PURE__ */ jsx(Alert,
|
|
23
|
+
return /* @__PURE__ */ jsx(Alert, { data: err, ...extraData }, i);
|
|
40
24
|
}) });
|
|
41
25
|
};
|
|
42
26
|
const CommonAlertsGroup = ({ dataSource, extraData }) => {
|
|
43
27
|
const _dataSource = useMemo(() => values(groupBy(dataSource, (e) => e.code)), [dataSource]);
|
|
44
28
|
return /* @__PURE__ */ jsx(Space, { direction: "vertical", style: { wordBreak: "break-all", width: "100%" }, children: /* @__PURE__ */ jsx(Collapse, { children: _dataSource.map((el) => {
|
|
45
|
-
var _a;
|
|
46
29
|
const [first] = el;
|
|
47
30
|
return /* @__PURE__ */ jsx(
|
|
48
31
|
Collapse.Panel,
|
|
49
32
|
{
|
|
50
33
|
header: /* @__PURE__ */ jsxs(Space, { children: [
|
|
51
34
|
/* @__PURE__ */ jsx(Typography.Text, { code: true, strong: true, style: { cursor: "pointer" }, children: first.code }),
|
|
52
|
-
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children:
|
|
35
|
+
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: Rule.RuleErrorMap[first.code]?.title || first.title }),
|
|
53
36
|
/* @__PURE__ */ jsx(Bdg, { label: "count", value: el.length, type: "error" })
|
|
54
37
|
] }),
|
|
55
38
|
children: /* @__PURE__ */ jsx(Space, { direction: "vertical", size: 16, children: el.map((err, i) => {
|
|
56
|
-
return /* @__PURE__ */ jsx(Alert,
|
|
39
|
+
return /* @__PURE__ */ jsx(Alert, { data: err, ...extraData }, i);
|
|
57
40
|
}) })
|
|
58
41
|
},
|
|
59
42
|
first.code
|
|
@@ -1,25 +1,5 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
2
|
import { Tooltip } from "antd";
|
|
22
|
-
import { Color } from "../../constants";
|
|
23
3
|
var BadgeType = /* @__PURE__ */ ((BadgeType2) => {
|
|
24
4
|
BadgeType2["Default"] = "default";
|
|
25
5
|
BadgeType2["Success"] = "success";
|
|
@@ -28,10 +8,10 @@ var BadgeType = /* @__PURE__ */ ((BadgeType2) => {
|
|
|
28
8
|
return BadgeType2;
|
|
29
9
|
})(BadgeType || {});
|
|
30
10
|
const BadgeColorMap = {
|
|
31
|
-
["default" /* Default */]: "linear-gradient(to bottom, #
|
|
32
|
-
["success" /* Success */]: "linear-gradient(to bottom, #
|
|
33
|
-
["warn" /* Warn */]: "linear-gradient(to bottom, #
|
|
34
|
-
["error" /* Error */]: `linear-gradient(to bottom,
|
|
11
|
+
["default" /* Default */]: "linear-gradient(to bottom, #3ea2ff 0%, #0072db 100%)",
|
|
12
|
+
["success" /* Success */]: "linear-gradient(to bottom, #6cf42a 0%, #52C41A 100%)",
|
|
13
|
+
["warn" /* Warn */]: "linear-gradient(to bottom, #ffc100 0%, #f59025 100%)",
|
|
14
|
+
["error" /* Error */]: `linear-gradient(to bottom, rgb(250 127 22), #FF4D4F 100%)`
|
|
35
15
|
};
|
|
36
16
|
const Badge = ({ label, value, type = "default", tooltip }) => {
|
|
37
17
|
const height = 22;
|
|
@@ -69,24 +49,26 @@ const Badge = ({ label, value, type = "default", tooltip }) => {
|
|
|
69
49
|
/* @__PURE__ */ jsx(
|
|
70
50
|
"div",
|
|
71
51
|
{
|
|
72
|
-
style:
|
|
52
|
+
style: {
|
|
53
|
+
...commonStyle,
|
|
73
54
|
borderTopLeftRadius: borderRadius,
|
|
74
55
|
borderBottomLeftRadius: borderRadius,
|
|
75
|
-
background: "linear-gradient(to bottom, #
|
|
76
|
-
}
|
|
56
|
+
background: "linear-gradient(to bottom, #525252a3 0%, #1F1F1F 100%)"
|
|
57
|
+
},
|
|
77
58
|
children: label
|
|
78
59
|
}
|
|
79
60
|
),
|
|
80
61
|
/* @__PURE__ */ jsx(
|
|
81
62
|
"div",
|
|
82
63
|
{
|
|
83
|
-
style:
|
|
64
|
+
style: {
|
|
65
|
+
...commonStyle,
|
|
84
66
|
borderTopRightRadius: borderRadius,
|
|
85
67
|
borderBottomRightRadius: borderRadius,
|
|
86
68
|
overflow: "hidden",
|
|
87
69
|
textOverflow: "ellipsis",
|
|
88
70
|
background: BadgeColorMap[type] || BadgeColorMap["default" /* Default */]
|
|
89
|
-
}
|
|
71
|
+
},
|
|
90
72
|
children: value
|
|
91
73
|
}
|
|
92
74
|
)
|
|
@@ -6,12 +6,12 @@ export interface DiffCardProps extends Pick<DiffCardContentProps, 'formatter'> {
|
|
|
6
6
|
showPercentInTitle?: boolean;
|
|
7
7
|
}
|
|
8
8
|
export interface DiffCardContentProps {
|
|
9
|
-
data: Client.
|
|
9
|
+
data: Client.RsdoctorClientAssetsDiffItem;
|
|
10
10
|
formatter?(v: number, target: 'baseline' | 'current'): number | string | React.ReactNode;
|
|
11
11
|
}
|
|
12
12
|
export interface PercentProps {
|
|
13
13
|
percent: number;
|
|
14
|
-
state: Client.
|
|
14
|
+
state: Client.RsdoctorClientDiffState;
|
|
15
15
|
fontSize?: React.CSSProperties['fontSize'];
|
|
16
16
|
}
|
|
17
17
|
export declare const SizePercent: React.FC<{
|
|
@@ -1,31 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
|
-
var __objRest = (source, exclude) => {
|
|
18
|
-
var target = {};
|
|
19
|
-
for (var prop in source)
|
|
20
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
21
|
-
target[prop] = source[prop];
|
|
22
|
-
if (source != null && __getOwnPropSymbols)
|
|
23
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
24
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
25
|
-
target[prop] = source[prop];
|
|
26
|
-
}
|
|
27
|
-
return target;
|
|
28
|
-
};
|
|
29
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
30
2
|
import { Client } from "@rsdoctor/types";
|
|
31
3
|
import { Segmented, Space, Tooltip, Typography } from "antd";
|
|
@@ -34,23 +6,22 @@ import { useState } from "react";
|
|
|
34
6
|
import { formatSize } from "../../utils";
|
|
35
7
|
import { Color } from "../../constants";
|
|
36
8
|
import { StatisticCard } from "./statistic";
|
|
37
|
-
const SizePercent = (
|
|
38
|
-
var _b = _a, { baseline, current } = _b, rest = __objRest(_b, ["baseline", "current"]);
|
|
9
|
+
const SizePercent = ({ baseline, current, ...rest }) => {
|
|
39
10
|
const diff = Graph.diffSize(baseline, current);
|
|
40
|
-
return /* @__PURE__ */ jsx(Percent,
|
|
11
|
+
return /* @__PURE__ */ jsx(Percent, { ...rest, ...diff });
|
|
41
12
|
};
|
|
42
13
|
const Percent = ({ percent, state, fontSize = 14 }) => {
|
|
43
14
|
const _percent = +percent.toFixed(2);
|
|
44
15
|
if (_percent > 0) {
|
|
45
16
|
const percentText = `${_percent}`;
|
|
46
|
-
if (state === Client.
|
|
17
|
+
if (state === Client.RsdoctorClientDiffState.Up) {
|
|
47
18
|
return /* @__PURE__ */ jsxs(Typography.Text, { strong: true, style: { fontSize, color: Color.Red }, children: [
|
|
48
19
|
"+",
|
|
49
20
|
percentText,
|
|
50
21
|
"%"
|
|
51
22
|
] });
|
|
52
23
|
}
|
|
53
|
-
if (state === Client.
|
|
24
|
+
if (state === Client.RsdoctorClientDiffState.Down) {
|
|
54
25
|
return /* @__PURE__ */ jsxs(Typography.Text, { strong: true, style: { fontSize, color: Color.Green }, children: [
|
|
55
26
|
"-",
|
|
56
27
|
percentText,
|
|
@@ -1,45 +1,14 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
33
2
|
import { ColumnHeightOutlined, VerticalAlignMiddleOutlined } from "@ant-design/icons";
|
|
34
3
|
import { Card as C, Space, Button, Divider } from "antd";
|
|
35
4
|
import { useState } from "react";
|
|
36
|
-
const Card = (
|
|
37
|
-
|
|
38
|
-
const [collapsed, setCollapsed] = useState(false);
|
|
5
|
+
const Card = ({ collapsable = false, children, title, dividerStyle, defaultCollapsed = false, ...rest }) => {
|
|
6
|
+
const [collapsed, setCollapsed] = useState(defaultCollapsed);
|
|
39
7
|
if (title && collapsable) {
|
|
40
8
|
return /* @__PURE__ */ jsx(
|
|
41
9
|
C,
|
|
42
|
-
|
|
10
|
+
{
|
|
11
|
+
...rest,
|
|
43
12
|
title: /* @__PURE__ */ jsxs(Space, { style: { fontSize: "inherit" }, children: [
|
|
44
13
|
/* @__PURE__ */ jsx(
|
|
45
14
|
Button,
|
|
@@ -52,10 +21,10 @@ const Card = (_a) => {
|
|
|
52
21
|
title
|
|
53
22
|
] }),
|
|
54
23
|
children: collapsed ? /* @__PURE__ */ jsx(Divider, { orientation: "center", style: dividerStyle, plain: true, children: /* @__PURE__ */ jsx(Button, { icon: /* @__PURE__ */ jsx(ColumnHeightOutlined, {}), type: "text", onClick: () => setCollapsed(!collapsed), children: "show more" }) }) : children
|
|
55
|
-
}
|
|
24
|
+
}
|
|
56
25
|
);
|
|
57
26
|
}
|
|
58
|
-
return /* @__PURE__ */ jsx(C,
|
|
27
|
+
return /* @__PURE__ */ jsx(C, { title, ...rest, children });
|
|
59
28
|
};
|
|
60
29
|
export {
|
|
61
30
|
Card
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ExceptionOutlined } from "@ant-design/icons";
|
|
3
|
-
import { Progress, Space, Tag, Tooltip, Typography } from "antd";
|
|
3
|
+
import { Empty, Progress, Space, Tag, Tooltip, Typography, theme } from "antd";
|
|
4
4
|
import { sumBy } from "lodash-es";
|
|
5
5
|
import { useMemo } from "react";
|
|
6
6
|
import { createFileStructures, formatSize } from "../../utils";
|
|
7
7
|
import { FileTree } from "../FileTree";
|
|
8
8
|
import { TextDrawer } from "../TextDrawer";
|
|
9
9
|
const height = 100;
|
|
10
|
-
const
|
|
10
|
+
const { useToken } = theme;
|
|
11
|
+
const SizeCard = ({ files, total, showProgress = false, tagBgColor }) => {
|
|
12
|
+
const { token } = useToken();
|
|
11
13
|
const sum = useMemo(() => {
|
|
12
14
|
return sumBy(files, (e) => e.size);
|
|
13
15
|
}, [files]);
|
|
@@ -24,10 +26,16 @@ const SizeCard = ({ files, total, showProgress = false }) => {
|
|
|
24
26
|
});
|
|
25
27
|
}, [files]);
|
|
26
28
|
if (fileStructures.length === 0) {
|
|
27
|
-
return /* @__PURE__ */ jsx(Space, { style: { height, fontSize: 24 }, align: "center", children:
|
|
29
|
+
return /* @__PURE__ */ jsx(Space, { style: { height, fontSize: 24 }, align: "center", children: /* @__PURE__ */ jsx(Tag, { bordered: false, color: tagBgColor, children: /* @__PURE__ */ jsxs(Typography.Text, { style: { fontSize: 14, color: token.colorWhite }, children: [
|
|
30
|
+
/* @__PURE__ */ jsxs(Typography.Text, { style: { color: token.colorWhite }, children: [
|
|
31
|
+
" ",
|
|
32
|
+
0
|
|
33
|
+
] }),
|
|
34
|
+
` Files`
|
|
35
|
+
] }) }) });
|
|
28
36
|
}
|
|
29
37
|
return /* @__PURE__ */ jsxs(Space, { style: { height }, align: "center", children: [
|
|
30
|
-
showProgress ? /* @__PURE__ */ jsx(
|
|
38
|
+
showProgress ? sum === 0 ? /* @__PURE__ */ jsx(Empty, {}) : /* @__PURE__ */ jsx(
|
|
31
39
|
Progress,
|
|
32
40
|
{
|
|
33
41
|
type: "dashboard",
|
|
@@ -41,13 +49,13 @@ const SizeCard = ({ files, total, showProgress = false }) => {
|
|
|
41
49
|
{
|
|
42
50
|
text: /* @__PURE__ */ jsx(Tooltip, { title: "Click to show the total files", children: /* @__PURE__ */ jsxs(Space, { style: { textAlign: showProgress ? "left" : "center" }, align: "end", children: [
|
|
43
51
|
/* @__PURE__ */ jsxs(Space, { direction: "vertical", children: [
|
|
44
|
-
/* @__PURE__ */ jsxs(Typography.Text, { style: { fontSize: 14 }, children: [
|
|
45
|
-
|
|
46
|
-
/* @__PURE__ */ jsxs(Typography.Text, { strong: true, children: [
|
|
52
|
+
/* @__PURE__ */ jsx(Tag, { bordered: false, color: tagBgColor, children: /* @__PURE__ */ jsxs(Typography.Text, { style: { fontSize: 14, color: token.colorWhite }, children: [
|
|
53
|
+
/* @__PURE__ */ jsxs(Typography.Text, { style: { color: token.colorWhite }, children: [
|
|
47
54
|
" ",
|
|
48
55
|
files.length
|
|
49
|
-
] })
|
|
50
|
-
|
|
56
|
+
] }),
|
|
57
|
+
` Files`
|
|
58
|
+
] }) }),
|
|
51
59
|
/* @__PURE__ */ jsx(Typography.Text, { style: { fontSize: 20 }, children: formatSize(sum) })
|
|
52
60
|
] }),
|
|
53
61
|
/* @__PURE__ */ jsx(ExceptionOutlined, { style: { transform: "translateY(-3.5px)" } })
|
|
@@ -5,5 +5,8 @@ export interface StatisticCardProps {
|
|
|
5
5
|
title: string | React.ReactNode;
|
|
6
6
|
value: string | React.ReactNode;
|
|
7
7
|
statisticProps?: StatisticProps;
|
|
8
|
+
boxProps?: {
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
};
|
|
8
11
|
}
|
|
9
12
|
export declare const StatisticCard: React.FC<StatisticCardProps>;
|
|
@@ -1,32 +1,17 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
1
|
import { jsx } from "react/jsx-runtime";
|
|
18
2
|
import { Statistic } from "antd";
|
|
19
3
|
import "./statistic.css";
|
|
20
4
|
import { useTheme } from "../../utils";
|
|
21
|
-
const StatisticCard = ({ title, value, statisticProps }) => {
|
|
5
|
+
const StatisticCard = ({ title, value, statisticProps, boxProps }) => {
|
|
22
6
|
const { theme } = useTheme();
|
|
23
|
-
return /* @__PURE__ */ jsx("div", { className: ["statistic-card", `statistic-card-${theme}`].join(" "), children: /* @__PURE__ */ jsx(
|
|
7
|
+
return /* @__PURE__ */ jsx("div", { className: ["statistic-card", `statistic-card-${theme}`].join(" "), ...boxProps, children: /* @__PURE__ */ jsx(
|
|
24
8
|
Statistic,
|
|
25
|
-
|
|
9
|
+
{
|
|
26
10
|
title: /* @__PURE__ */ jsx("div", { className: "statistic-card-title", children: title }),
|
|
27
11
|
valueRender: () => value,
|
|
28
|
-
valueStyle: { fontSize: 24 }
|
|
29
|
-
|
|
12
|
+
valueStyle: { fontSize: 24 },
|
|
13
|
+
...statisticProps
|
|
14
|
+
}
|
|
30
15
|
) });
|
|
31
16
|
};
|
|
32
17
|
export {
|