@rsdoctor/components 0.1.1 → 0.1.3

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 (140) hide show
  1. package/dist/components/Alert/change.d.ts +2 -2
  2. package/dist/components/Alert/file-relation.d.ts +1 -1
  3. package/dist/components/Alert/index.d.ts +1 -1
  4. package/dist/components/Alert/link.d.ts +1 -1
  5. package/dist/components/Alert/package-relation.d.ts +9 -9
  6. package/dist/components/Alert/package-relation.js +188 -94
  7. package/dist/components/Alert/types.d.ts +15 -15
  8. package/dist/components/Alert/view.d.ts +1 -1
  9. package/dist/components/Alerts/bundle.d.ts +4 -4
  10. package/dist/components/Alerts/common.d.ts +8 -8
  11. package/dist/components/Alerts/common.js +46 -23
  12. package/dist/components/Alerts/compile.d.ts +4 -4
  13. package/dist/components/Alerts/index.d.ts +1 -1
  14. package/dist/components/Alerts/overlay.d.ts +12 -12
  15. package/dist/components/Badge/index.d.ts +13 -13
  16. package/dist/components/Card/diff.d.ts +11 -11
  17. package/dist/components/Card/index.d.ts +4 -4
  18. package/dist/components/Card/size.d.ts +16 -16
  19. package/dist/components/Card/statistic.d.ts +7 -7
  20. package/dist/components/Charts/TimelineCharts/index.d.ts +5 -5
  21. package/dist/components/Charts/TimelineCharts/index.js +31 -9
  22. package/dist/components/Charts/bootstrap.d.ts +1 -1
  23. package/dist/components/Charts/common.d.ts +4 -4
  24. package/dist/components/Charts/constants.d.ts +2 -0
  25. package/dist/components/Charts/constants.js +46 -0
  26. package/dist/components/Charts/done.d.ts +1 -1
  27. package/dist/components/Charts/index.d.ts +4 -4
  28. package/dist/components/Charts/loader.d.ts +1 -1
  29. package/dist/components/Charts/loader.js +55 -26
  30. package/dist/components/Charts/minify.d.ts +1 -1
  31. package/dist/components/Charts/types.d.ts +45 -45
  32. package/dist/components/Charts/utils.d.ts +5 -4
  33. package/dist/components/Charts/utils.js +32 -13
  34. package/dist/components/CodeViewer/config.d.ts +1 -1
  35. package/dist/components/CodeViewer/diff.d.ts +6 -6
  36. package/dist/components/CodeViewer/hightlight.d.ts +5 -5
  37. package/dist/components/CodeViewer/index.d.ts +1 -1
  38. package/dist/components/CodeViewer/viewer.d.ts +6 -6
  39. package/dist/components/Configuration/builder.d.ts +6 -6
  40. package/dist/components/Configuration/index.d.ts +1 -1
  41. package/dist/components/FileTree/index.d.ts +1 -1
  42. package/dist/components/Form/keyword.d.ts +10 -10
  43. package/dist/components/Keyword/index.d.ts +3 -3
  44. package/dist/components/Layout/builder-select.d.ts +1 -1
  45. package/dist/components/Layout/constants.d.ts +1 -1
  46. package/dist/components/Layout/header.d.ts +1 -1
  47. package/dist/components/Layout/index.d.ts +2 -2
  48. package/dist/components/Layout/menus.d.ts +4 -4
  49. package/dist/components/Layout/menus.js +42 -14
  50. package/dist/components/Layout/progress.d.ts +3 -3
  51. package/dist/components/Loader/Analysis/files.d.ts +5 -5
  52. package/dist/components/Loader/Analysis/index.d.ts +6 -6
  53. package/dist/components/Loader/executions.d.ts +5 -9
  54. package/dist/components/Manifest/api.d.ts +14 -21
  55. package/dist/components/Manifest/data.d.ts +1 -1
  56. package/dist/components/Manifest/index.d.ts +1 -1
  57. package/dist/components/Opener/code.d.ts +17 -25
  58. package/dist/components/Opener/index.d.ts +1 -1
  59. package/dist/components/Opener/vscode.d.ts +7 -12
  60. package/dist/components/Overall/NumberButton.d.ts +6 -12
  61. package/dist/components/Overall/bundle.d.ts +3 -3
  62. package/dist/components/Overall/compile.d.ts +2 -2
  63. package/dist/components/Overall/index.d.ts +1 -1
  64. package/dist/components/Overall/project.d.ts +5 -5
  65. package/dist/components/Plugins/webpack.d.ts +9 -9
  66. package/dist/components/Resolver/analysis.d.ts +7 -7
  67. package/dist/components/Select/index.d.ts +9 -9
  68. package/dist/components/Status/failed.d.ts +4 -4
  69. package/dist/components/Status/index.d.ts +1 -1
  70. package/dist/components/TextDrawer/duplicate.d.ts +7 -7
  71. package/dist/components/TextDrawer/index.d.ts +6 -6
  72. package/dist/components/Title/index.d.ts +11 -11
  73. package/dist/components/index.d.ts +1 -1
  74. package/dist/components/worker/ecmaversion/client.d.ts +4 -4
  75. package/dist/components/worker/ecmaversion/worker.d.ts +1 -1
  76. package/dist/components/worker/jsequal/client.d.ts +6 -6
  77. package/dist/components/worker/jsequal/worker.d.ts +1 -1
  78. package/dist/config.d.ts +13 -13
  79. package/dist/constants.d.ts +30 -30
  80. package/dist/index.d.ts +1 -1
  81. package/dist/pages/BundleSize/components/asset.d.ts +15 -15
  82. package/dist/pages/BundleSize/components/cards.d.ts +4 -4
  83. package/dist/pages/BundleSize/components/editor.d.ts +3 -3
  84. package/dist/pages/BundleSize/components/index.d.ts +7 -7
  85. package/dist/pages/BundleSize/config.d.ts +3 -3
  86. package/dist/pages/BundleSize/constants.d.ts +1 -1
  87. package/dist/pages/BundleSize/index.d.ts +1 -1
  88. package/dist/pages/ModuleAnalyze/chunks.d.ts +2 -2
  89. package/dist/pages/ModuleAnalyze/components/fileTreeCom.d.ts +9 -9
  90. package/dist/pages/ModuleAnalyze/constants.d.ts +2 -2
  91. package/dist/pages/ModuleAnalyze/dependncy.d.ts +4 -4
  92. package/dist/pages/ModuleAnalyze/fileTree.d.ts +6 -6
  93. package/dist/pages/ModuleAnalyze/index.d.ts +4 -4
  94. package/dist/pages/ModuleAnalyze/utils/hooks.d.ts +16 -16
  95. package/dist/pages/ModuleAnalyze/utils/index.d.ts +1 -1
  96. package/dist/pages/ModuleResolve/constants.d.ts +1 -1
  97. package/dist/pages/ModuleResolve/index.d.ts +1 -1
  98. package/dist/pages/Overall/constants.d.ts +1 -1
  99. package/dist/pages/Overall/index.d.ts +4 -4
  100. package/dist/pages/Overall/index.js +19 -8
  101. package/dist/pages/Overall/responsiveGridList.d.ts +6 -0
  102. package/dist/pages/Overall/responsiveGridList.js +28 -0
  103. package/dist/pages/Resources/RuleIndex/constants.d.ts +1 -1
  104. package/dist/pages/Resources/RuleIndex/index.d.ts +1 -1
  105. package/dist/pages/WebpackLoaders/Analysis/constants.d.ts +1 -1
  106. package/dist/pages/WebpackLoaders/Analysis/index.d.ts +1 -1
  107. package/dist/pages/WebpackLoaders/Overall/constants.d.ts +1 -1
  108. package/dist/pages/WebpackLoaders/Overall/index.d.ts +1 -1
  109. package/dist/pages/WebpackLoaders/constants.d.ts +1 -1
  110. package/dist/pages/WebpackPlugins/constants.d.ts +1 -1
  111. package/dist/pages/WebpackPlugins/index.d.ts +1 -1
  112. package/dist/pages/index.d.ts +1 -1
  113. package/dist/utils/data/base.d.ts +21 -21
  114. package/dist/utils/data/index.d.ts +2 -2
  115. package/dist/utils/data/local.d.ts +11 -11
  116. package/dist/utils/data/remote.d.ts +7 -7
  117. package/dist/utils/file.d.ts +15 -21
  118. package/dist/utils/hooks.d.ts +4 -4
  119. package/dist/utils/i18n/cn.d.ts +1 -1
  120. package/dist/utils/i18n/en.d.ts +28 -28
  121. package/dist/utils/i18n/index.d.ts +1 -1
  122. package/dist/utils/index.d.ts +1 -1
  123. package/dist/utils/loader.d.ts +1 -1
  124. package/dist/utils/locale.d.ts +1 -1
  125. package/dist/utils/manifest.d.ts +17 -17
  126. package/dist/utils/monaco.d.ts +4 -4
  127. package/dist/utils/request.d.ts +13 -13
  128. package/dist/utils/routes.d.ts +1 -1
  129. package/dist/utils/size.d.ts +1 -1
  130. package/dist/utils/socket.d.ts +1 -1
  131. package/dist/utils/storage.d.ts +1 -1
  132. package/dist/utils/string.d.ts +1 -1
  133. package/dist/utils/time.d.ts +1 -1
  134. package/dist/utils/url.d.ts +1 -1
  135. package/dist/utils/worker/index.d.ts +1 -1
  136. package/dist/utils/worker/master.d.ts +3 -3
  137. package/dist/utils/worker/types.d.ts +3 -3
  138. package/dist/utils/worker/utils.d.ts +4 -6
  139. package/dist/utils/worker/worker.d.ts +11 -11
  140. package/package.json +4 -6
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { CodeChangeAlertProps } from './types';
3
3
  interface FixedProps {
4
- setIsFixed(val: boolean): void;
4
+ setIsFixed(val: boolean): void;
5
5
  }
6
6
  export declare const CodeChangeDrawerContent: React.FC<CodeChangeAlertProps & FixedProps>;
7
7
  export declare const CodeChangeAlert: React.FC<CodeChangeAlertProps>;
8
- export {};
8
+ export {};
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { FileRelationAlertProps } from './types';
3
- export declare const FileRelationAlert: React.FC<FileRelationAlertProps>;
3
+ export declare const FileRelationAlert: React.FC<FileRelationAlertProps>;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { AlertProps } from './types';
3
3
  import './index.sass';
4
- export declare const Alert: React.FC<AlertProps>;
4
+ export declare const Alert: React.FC<AlertProps>;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { LinkAlertProps } from './types';
3
- export declare const LinkRuleAlert: React.FC<LinkAlertProps>;
3
+ export declare const LinkRuleAlert: React.FC<LinkAlertProps>;
@@ -2,16 +2,16 @@ import React from 'react';
2
2
  import { SDK } from '@rsdoctor/types';
3
3
  import { PackageRelationAlertProps } from './types';
4
4
  export declare const PackageRelationReasons: React.FC<{
5
- data: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetPackageRelationAlertDetails>;
6
- cwd: string;
5
+ data: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetPackageRelationAlertDetails>;
6
+ cwd: string;
7
7
  }>;
8
8
  export declare const PackageRelationReasonsWithServer: React.FC<Omit<{
9
- data: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetPackageRelationAlertDetails>;
10
- cwd: string;
9
+ data: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetPackageRelationAlertDetails>;
10
+ cwd: string;
11
11
  }, "data"> & Partial<{
12
- body: {
13
- id: string | number;
14
- target: SDK.PackageBasicData;
15
- };
12
+ body: {
13
+ id: string | number;
14
+ target: SDK.PackageBasicData;
15
+ };
16
16
  }>>;
17
- export declare const PackageRelationAlert: React.FC<PackageRelationAlertProps>;
17
+ export declare const PackageRelationAlert: React.FC<PackageRelationAlertProps>;
@@ -1,11 +1,26 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { createElement } from "react";
3
3
  import React, { useState } from "react";
4
- import { Space, Alert, Button, Typography, Divider, Tabs, Row, Col, Timeline, Card, Tag, Empty, Popover } from "antd";
4
+ import {
5
+ Space,
6
+ Alert,
7
+ Button,
8
+ Typography,
9
+ Divider,
10
+ Tabs,
11
+ Row,
12
+ Col,
13
+ Timeline,
14
+ Card,
15
+ Tag,
16
+ Empty,
17
+ Popover,
18
+ Grid
19
+ } from "antd";
5
20
  import { sumBy } from "lodash-es";
6
21
  import { Rule, SDK } from "@rsdoctor/types";
7
22
  import { ExpandAltOutlined, InfoCircleOutlined } from "@ant-design/icons";
8
- import { useRuleIndexNavigate, formatSize, useI18n, useWindowWidth } from "../../utils";
23
+ import { useRuleIndexNavigate, formatSize, useI18n } from "../../utils";
9
24
  import { TextDrawer } from "../TextDrawer";
10
25
  import { Title } from "../Title";
11
26
  import { Size, Color } from "../../constants";
@@ -21,7 +36,13 @@ const PackageRelationReasons = ({ data, cwd }) => {
21
36
  {
22
37
  title: `The reasons for importing this version`,
23
38
  style: { height: "100%" },
24
- extra: /* @__PURE__ */ jsx(Popover, { content: /* @__PURE__ */ jsx(Typography.Text, { children: t("DuplicatePakCodeExplain") }), children: /* @__PURE__ */ jsx("a", { href: "#", children: "Explain" }) }),
39
+ extra: /* @__PURE__ */ jsx(
40
+ Popover,
41
+ {
42
+ content: /* @__PURE__ */ jsx(Typography.Text, { children: t("DuplicatePakCodeExplain") }),
43
+ children: /* @__PURE__ */ jsx("a", { href: "#", children: "Explain" })
44
+ }
45
+ ),
25
46
  bodyStyle: { overflow: "scroll" },
26
47
  children: data.length ? /* @__PURE__ */ jsxs(React.Fragment, { children: [
27
48
  /* @__PURE__ */ jsx("div", { style: { marginBottom: Size.BasePadding }, children: /* @__PURE__ */ jsx(Typography.Text, { type: "secondary", strong: true, children: "Click the file path below to show the reason in code viewer." }) }),
@@ -45,7 +66,10 @@ const PackageRelationReasons = ({ data, cwd }) => {
45
66
  setIndex(i);
46
67
  },
47
68
  strong: i === index,
48
- style: { color: i === index ? Color.Blue : "inherit", display: "block" },
69
+ style: {
70
+ color: i === index ? Color.Blue : "inherit",
71
+ display: "block"
72
+ },
49
73
  children: text
50
74
  }
51
75
  )
@@ -72,110 +96,180 @@ const PackageRelationAlert = ({
72
96
  const navigate = useRuleIndexNavigate(code, data.link);
73
97
  const totalSize = sumBy(packages, (e) => e.targetSize.sourceSize);
74
98
  const totalSizeStr = formatSize(totalSize);
75
- const windowWith = useWindowWidth();
99
+ const { xs, lg, xxl } = Grid.useBreakpoint();
76
100
  const { name } = packages.find((e) => !!e.target.name).target;
77
101
  const versions = packages.map((item) => item.target.version);
78
102
  return /* @__PURE__ */ jsx(
79
103
  Alert,
80
104
  {
81
- showIcon: true,
82
- message: /* @__PURE__ */ jsxs(Space, { children: [
83
- /* @__PURE__ */ jsx(Typography.Text, { code: true, strong: true, onClick: navigate, style: { cursor: "pointer" }, children: /* @__PURE__ */ jsx("a", { children: code }) }),
84
- /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: Rule.RuleErrorMap[code]?.title || data.title }),
85
- /* @__PURE__ */ jsx(Divider, { type: "vertical" }),
86
- /* @__PURE__ */ jsxs(Typography.Text, { children: [
87
- /* @__PURE__ */ jsx(Typography.Text, { strong: true, code: true, children: name }),
88
- /* @__PURE__ */ jsxs(Typography.Text, { strong: true, children: [
89
- " ",
90
- data.packages.length
91
- ] }),
92
- /* @__PURE__ */ jsx(Typography.Text, { children: " versions was found" })
93
- ] }),
94
- /* @__PURE__ */ jsx(Divider, { type: "vertical" }),
95
- /* @__PURE__ */ jsx(
96
- Bdg,
97
- {
98
- label: "total size",
99
- value: totalSizeStr,
100
- type: "error",
101
- tooltip: `total size of ${data.packages.length} versions is ${totalSizeStr}`
102
- }
103
- )
104
- ] }),
105
+ showIcon: !xs,
106
+ message: /* @__PURE__ */ jsxs(
107
+ Space,
108
+ {
109
+ wrap: true,
110
+ split: xs ? null : /* @__PURE__ */ jsx(Divider, { type: "vertical" }),
111
+ align: "center",
112
+ children: [
113
+ /* @__PURE__ */ jsxs(Space, { wrap: false, children: [
114
+ /* @__PURE__ */ jsx(
115
+ Typography.Text,
116
+ {
117
+ code: true,
118
+ strong: true,
119
+ onClick: navigate,
120
+ style: { cursor: "pointer" },
121
+ children: /* @__PURE__ */ jsx("a", { children: code })
122
+ }
123
+ ),
124
+ /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: Rule.RuleErrorMap[code]?.title || data.title })
125
+ ] }),
126
+ /* @__PURE__ */ jsxs(
127
+ Typography.Paragraph,
128
+ {
129
+ ellipsis: { rows: 1 },
130
+ style: { marginBottom: 0 },
131
+ children: [
132
+ /* @__PURE__ */ jsx(Typography.Text, { strong: true, code: true, children: name }),
133
+ /* @__PURE__ */ jsxs(Typography.Text, { strong: true, children: [
134
+ " ",
135
+ data.packages.length
136
+ ] }),
137
+ /* @__PURE__ */ jsx(Typography.Text, { children: " versions was found" })
138
+ ]
139
+ }
140
+ ),
141
+ /* @__PURE__ */ jsx(
142
+ Bdg,
143
+ {
144
+ label: "total size",
145
+ value: totalSizeStr,
146
+ type: "error",
147
+ tooltip: `total size of ${data.packages.length} versions is ${totalSizeStr}`
148
+ }
149
+ )
150
+ ]
151
+ }
152
+ ),
105
153
  description: /* @__PURE__ */ jsx(Space, { direction: "vertical", wrap: false, children: data.packages.map(({ target: el, targetSize: size }) => {
106
154
  const sizeStr = formatSize(size.sourceSize);
107
155
  const parsedSizeStr = size.parsedSize ? formatSize(size.parsedSize) : null;
108
156
  const name2 = `${el.name}@${el.version}`;
109
- return /* @__PURE__ */ jsxs(Space, { style: { wordBreak: "break-all" }, align: "center", children: [
110
- /* @__PURE__ */ jsx(Typography.Text, { style: { marginLeft: 4 }, children: "└" }),
111
- /* @__PURE__ */ jsx(Bdg, { label: el.name, value: `v${el.version}`, tooltip: name2 }),
112
- /* @__PURE__ */ jsx(Divider, { type: "vertical" }),
113
- /* @__PURE__ */ jsx(
114
- Bdg,
115
- {
116
- label: /* @__PURE__ */ jsxs("div", { color: "rgb(255, 255, 255)", children: [
117
- "Source Size ",
118
- /* @__PURE__ */ jsx(InfoCircleOutlined, {})
157
+ return /* @__PURE__ */ jsxs(
158
+ Space,
159
+ {
160
+ style: { wordBreak: "break-all" },
161
+ align: "center",
162
+ split: xs ? null : /* @__PURE__ */ jsx(Divider, { type: "vertical" }),
163
+ wrap: true,
164
+ children: [
165
+ /* @__PURE__ */ jsxs(Space, { wrap: false, children: [
166
+ /* @__PURE__ */ jsx(Typography.Text, { style: { marginLeft: 4 }, children: "└" }),
167
+ /* @__PURE__ */ jsx(
168
+ Bdg,
169
+ {
170
+ label: el.name,
171
+ value: `v${el.version}`,
172
+ tooltip: name2
173
+ }
174
+ )
175
+ ] }),
176
+ /* @__PURE__ */ jsxs(Space, { children: [
177
+ /* @__PURE__ */ jsx(
178
+ Bdg,
179
+ {
180
+ label: /* @__PURE__ */ jsxs("div", { color: "rgb(255, 255, 255)", children: [
181
+ "Source Size ",
182
+ /* @__PURE__ */ jsx(InfoCircleOutlined, {})
183
+ ] }),
184
+ value: sizeStr,
185
+ tooltip: `The bundle size of "${name2}" is ${sizeStr}, this is source size.`,
186
+ type: "error"
187
+ }
188
+ ),
189
+ /* @__PURE__ */ jsx(
190
+ Bdg,
191
+ {
192
+ label: "Bundled size",
193
+ value: parsedSizeStr || "CONCATENATED",
194
+ tooltip: `The bundle size of "${name2}" is ${sizeStr}, this is after bundled, concatenated module cannot get bundled size. `,
195
+ type: "error"
196
+ }
197
+ )
119
198
  ] }),
120
- value: sizeStr,
121
- tooltip: `The bundle size of "${name2}" is ${sizeStr}, this is source size.`,
122
- type: "error"
123
- }
124
- ),
125
- /* @__PURE__ */ jsx(
126
- Bdg,
127
- {
128
- label: "Bundled size",
129
- value: parsedSizeStr || "CONCATENATED",
130
- tooltip: `The bundle size of "${name2}" is ${sizeStr}, this is after bundled, concatenated module cannot get bundled size. `,
131
- type: "error"
132
- }
133
- ),
134
- /* @__PURE__ */ jsx(Divider, { type: "vertical" }),
135
- /* @__PURE__ */ jsx(
136
- Typography.Paragraph,
137
- {
138
- style: { marginBottom: 0, width: windowWith > 1500 ? "40rem" : windowWith > 1200 ? "30rem" : "20rem" },
139
- copyable: { text: el.root },
140
- ellipsis: { rows: 1, expandable: true, symbol: /* @__PURE__ */ jsx(ExpandAltOutlined, {}), tooltip: el.root },
141
- code: true,
142
- children: el.root
143
- }
144
- )
145
- ] }, el.version);
199
+ /* @__PURE__ */ jsx(
200
+ Typography.Paragraph,
201
+ {
202
+ style: {
203
+ marginBottom: 0,
204
+ width: xxl ? "40rem" : lg ? "30rem" : "20rem"
205
+ },
206
+ copyable: { text: el.root },
207
+ ellipsis: {
208
+ rows: 1,
209
+ expandable: true,
210
+ symbol: /* @__PURE__ */ jsx(ExpandAltOutlined, {}),
211
+ tooltip: el.root
212
+ },
213
+ code: true,
214
+ children: el.root
215
+ }
216
+ )
217
+ ]
218
+ },
219
+ el.version
220
+ );
146
221
  }) }),
147
222
  type: level === "warn" ? "info" : level,
148
223
  action: /* @__PURE__ */ jsxs(React.Fragment, { children: [
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: [
150
- /* @__PURE__ */ jsxs(Space, { style: { marginBottom: Size.BasePadding / 2 }, children: [
151
- /* @__PURE__ */ jsx(Title, { text: name, upperFisrt: false }),
152
- /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: versions.length }),
153
- /* @__PURE__ */ jsx(Typography.Text, { children: " versions was found: " }),
154
- versions.map((e) => /* @__PURE__ */ jsx(Typography.Text, { strong: true, code: true, children: e }, e))
155
- ] }),
156
- /* @__PURE__ */ jsx(
157
- Tabs,
158
- {
159
- type: "card",
160
- size: "middle",
161
- className: "tabs-space",
162
- defaultActiveKey: versions[0],
163
- items: packages.map((pkg) => {
164
- const { target, targetSize } = pkg;
165
- return {
166
- label: /* @__PURE__ */ jsxs(Space, { children: [
167
- /* @__PURE__ */ jsx(Typography.Text, { children: `${name}@${target.version}` }),
168
- /* @__PURE__ */ jsx(Tag, { color: Color.Red, children: formatSize(targetSize.sourceSize) })
169
- ] }),
170
- key: `${target.root}${target.name}${target.version}`,
171
- children: getPackageRelationContentComponent({ data, package: pkg })
172
- };
173
- })
174
- }
175
- )
176
- ] }) }) : null,
224
+ packages && packages.length > 0 ? /* @__PURE__ */ jsx(
225
+ TextDrawer,
226
+ {
227
+ text: "Show Relations",
228
+ buttonProps: { size: "small" },
229
+ drawerProps: { title: data.title },
230
+ children: /* @__PURE__ */ jsxs(Space, { direction: "vertical", className: "alert-space", children: [
231
+ /* @__PURE__ */ jsxs(Space, { style: { marginBottom: Size.BasePadding / 2 }, children: [
232
+ /* @__PURE__ */ jsx(Title, { text: name, upperFisrt: false }),
233
+ /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: versions.length }),
234
+ /* @__PURE__ */ jsx(Typography.Text, { children: " versions was found: " }),
235
+ versions.map((e) => /* @__PURE__ */ jsx(Typography.Text, { strong: true, code: true, children: e }, e))
236
+ ] }),
237
+ /* @__PURE__ */ jsx(
238
+ Tabs,
239
+ {
240
+ type: "card",
241
+ size: "middle",
242
+ className: "tabs-space",
243
+ defaultActiveKey: versions[0],
244
+ items: packages.map((pkg) => {
245
+ const { target, targetSize } = pkg;
246
+ return {
247
+ label: /* @__PURE__ */ jsxs(Space, { children: [
248
+ /* @__PURE__ */ jsx(Typography.Text, { children: `${name}@${target.version}` }),
249
+ /* @__PURE__ */ jsx(Tag, { color: Color.Red, children: formatSize(targetSize.sourceSize) })
250
+ ] }),
251
+ key: `${target.root}${target.name}${target.version}`,
252
+ children: getPackageRelationContentComponent({
253
+ data,
254
+ package: pkg
255
+ })
256
+ };
257
+ })
258
+ }
259
+ )
260
+ ] })
261
+ }
262
+ ) : null,
177
263
  /* @__PURE__ */ jsx(Divider, { type: "vertical" }),
178
- /* @__PURE__ */ jsx(Button, { type: "link", onClick: navigate, size: "small", icon: /* @__PURE__ */ jsx(InfoCircleOutlined, {}) })
264
+ /* @__PURE__ */ jsx(
265
+ Button,
266
+ {
267
+ type: "link",
268
+ onClick: navigate,
269
+ size: "small",
270
+ icon: /* @__PURE__ */ jsx(InfoCircleOutlined, {})
271
+ }
272
+ )
179
273
  ] })
180
274
  }
181
275
  );
@@ -1,31 +1,31 @@
1
1
  import { Rule } from '@rsdoctor/types';
2
2
  import React from 'react';
3
3
  export interface AlertProps extends Omit<PackageRelationAlertProps, 'data'> {
4
- data: Rule.RuleStoreDataItem;
5
- cwd: string;
4
+ data: Rule.RuleStoreDataItem;
5
+ cwd: string;
6
6
  }
7
7
  export interface PackageRelationAlertProps {
8
- data: Rule.PackageRelationDiffRuleStoreData;
9
- getPackageRelationContentComponent: React.FC<{
10
8
  data: Rule.PackageRelationDiffRuleStoreData;
11
- package: Rule.PackageRelationData;
12
- }>;
13
- cwd: string;
9
+ getPackageRelationContentComponent: React.FC<{
10
+ data: Rule.PackageRelationDiffRuleStoreData;
11
+ package: Rule.PackageRelationData;
12
+ }>;
13
+ cwd: string;
14
14
  }
15
15
  export interface FileRelationAlertProps {
16
- data: Rule.FileRelationRuleStoreData;
16
+ data: Rule.FileRelationRuleStoreData;
17
17
  }
18
18
  export interface CodeChangeAlertProps {
19
- data: Rule.CodeChangeRuleStoreData;
20
- cwd: string;
19
+ data: Rule.CodeChangeRuleStoreData;
20
+ cwd: string;
21
21
  }
22
22
  export interface CodeViewAlertProps {
23
- data: Rule.CodeViewRuleStoreData;
24
- cwd: string;
23
+ data: Rule.CodeViewRuleStoreData;
24
+ cwd: string;
25
25
  }
26
26
  export interface LinkAlertProps {
27
- data: Rule.LinkRuleStoreData;
27
+ data: Rule.LinkRuleStoreData;
28
28
  }
29
29
  export interface EMOAlertProps {
30
- data: Rule.EMORuleStoreData;
31
- }
30
+ data: Rule.EMORuleStoreData;
31
+ }
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { CodeViewAlertProps } from './types';
3
3
  export declare const CodeViewDrawerContent: React.FC<CodeViewAlertProps>;
4
- export declare const CodeViewAlert: React.FC<CodeViewAlertProps>;
4
+ export declare const CodeViewAlert: React.FC<CodeViewAlertProps>;
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import { Rule, SDK } from '@rsdoctor/types';
3
3
  interface BundleAlertsProps {
4
- filter?(alert: Rule.RuleStoreDataItem): boolean;
5
- project: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>;
4
+ filter?(alert: Rule.RuleStoreDataItem): boolean;
5
+ project: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>;
6
6
  }
7
7
  export declare const BundleAlertsBase: React.FC<BundleAlertsProps>;
8
8
  export declare const BundleAlerts: React.FC<Omit<BundleAlertsProps, "project"> & Partial<{
9
- body?: any;
9
+ body?: any;
10
10
  }>>;
11
- export {};
11
+ export {};
@@ -3,13 +3,13 @@ import { Rule } from '@rsdoctor/types';
3
3
  import { ViewMode } from '../../constants';
4
4
  import { AlertProps } from '../Alert/types';
5
5
  interface CommonAlertsContainerProps {
6
- title: string;
7
- cwd: string;
8
- dataSource: Rule.RuleStoreDataItem[];
9
- extraData: Omit<AlertProps, 'data'>;
10
- viewMode: ViewMode;
11
- setViewMode(mode: ViewMode): void;
12
- extraCom?: JSX.Element | undefined;
6
+ title: string;
7
+ cwd: string;
8
+ dataSource: Rule.RuleStoreDataItem[];
9
+ extraData: Omit<AlertProps, 'data'>;
10
+ viewMode: ViewMode;
11
+ setViewMode(mode: ViewMode): void;
12
+ extraCom?: JSX.Element | undefined;
13
13
  }
14
14
  export declare const CommonAlertsContainer: React.FC<CommonAlertsContainerProps>;
15
- export {};
15
+ export {};
@@ -12,36 +12,59 @@ const LevelMap = {
12
12
  warn: 1,
13
13
  error: 2
14
14
  };
15
- const CommonAlertsList = ({ dataSource, extraData }) => {
15
+ const CommonAlertsList = ({
16
+ dataSource,
17
+ extraData
18
+ }) => {
16
19
  const _dataSource = useMemo(
17
20
  () => dataSource.slice().sort((a, b) => {
18
21
  return LevelMap[b.level] - LevelMap[a.level];
19
22
  }),
20
23
  [dataSource]
21
24
  );
22
- return /* @__PURE__ */ jsx(Space, { direction: "vertical", style: { wordBreak: "break-all", width: "100%" }, children: _dataSource.map((err, i) => {
23
- return /* @__PURE__ */ jsx(Alert, { data: err, ...extraData }, i);
24
- }) });
25
+ return /* @__PURE__ */ jsx(
26
+ Space,
27
+ {
28
+ direction: "vertical",
29
+ style: { wordBreak: "break-all", width: "100%" },
30
+ children: _dataSource.map((err, i) => {
31
+ return /* @__PURE__ */ jsx(Alert, { data: err, ...extraData }, i);
32
+ })
33
+ }
34
+ );
25
35
  };
26
- const CommonAlertsGroup = ({ dataSource, extraData }) => {
27
- const _dataSource = useMemo(() => values(groupBy(dataSource, (e) => e.code)), [dataSource]);
28
- return /* @__PURE__ */ jsx(Space, { direction: "vertical", style: { wordBreak: "break-all", width: "100%" }, children: /* @__PURE__ */ jsx(Collapse, { children: _dataSource.map((el) => {
29
- const [first] = el;
30
- return /* @__PURE__ */ jsx(
31
- Collapse.Panel,
32
- {
33
- header: /* @__PURE__ */ jsxs(Space, { children: [
34
- /* @__PURE__ */ jsx(Typography.Text, { code: true, strong: true, style: { cursor: "pointer" }, children: first.code }),
35
- /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: Rule.RuleErrorMap[first.code]?.title || first.title }),
36
- /* @__PURE__ */ jsx(Bdg, { label: "count", value: el.length, type: "error" })
37
- ] }),
38
- children: /* @__PURE__ */ jsx(Space, { direction: "vertical", size: 16, children: el.map((err, i) => {
39
- return /* @__PURE__ */ jsx(Alert, { data: err, ...extraData }, i);
40
- }) })
41
- },
42
- first.code
43
- );
44
- }) }) });
36
+ const CommonAlertsGroup = ({
37
+ dataSource,
38
+ extraData
39
+ }) => {
40
+ const _dataSource = useMemo(
41
+ () => values(groupBy(dataSource, (e) => e.code)),
42
+ [dataSource]
43
+ );
44
+ return /* @__PURE__ */ jsx(
45
+ Space,
46
+ {
47
+ direction: "vertical",
48
+ style: { wordBreak: "break-all", width: "100%" },
49
+ children: /* @__PURE__ */ jsx(Collapse, { children: _dataSource.map((el) => {
50
+ const [first] = el;
51
+ return /* @__PURE__ */ jsx(
52
+ Collapse.Panel,
53
+ {
54
+ header: /* @__PURE__ */ jsxs(Space, { children: [
55
+ /* @__PURE__ */ jsx(Typography.Text, { code: true, strong: true, style: { cursor: "pointer" }, children: first.code }),
56
+ /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: Rule.RuleErrorMap[first.code]?.title || first.title }),
57
+ /* @__PURE__ */ jsx(Bdg, { label: "count", value: el.length, type: "error" })
58
+ ] }),
59
+ children: /* @__PURE__ */ jsx(Space, { direction: "vertical", size: 16, style: { width: "100%" }, children: el.map((err, i) => {
60
+ return /* @__PURE__ */ jsx(Alert, { data: err, ...extraData }, i);
61
+ }) })
62
+ },
63
+ first.code
64
+ );
65
+ }) })
66
+ }
67
+ );
45
68
  };
46
69
  const CommonAlertsContainer = ({
47
70
  title,
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import { Rule, SDK } from '@rsdoctor/types';
3
3
  interface CompileAlertsProps {
4
- filter?(alert: Rule.RuleStoreDataItem): boolean;
5
- project: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>;
4
+ filter?(alert: Rule.RuleStoreDataItem): boolean;
5
+ project: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>;
6
6
  }
7
7
  export declare const CompileAlerts: React.FC<Omit<CompileAlertsProps, "project"> & Partial<{
8
- body?: any;
8
+ body?: any;
9
9
  }>>;
10
- export {};
10
+ export {};
@@ -1,3 +1,3 @@
1
1
  export * from './bundle';
2
2
  export * from './compile';
3
- export * from './overlay';
3
+ export * from './overlay';
@@ -2,25 +2,25 @@ import React from 'react';
2
2
  import { SDK } from '@rsdoctor/types';
3
3
  import 'rc-dialog/assets/index.css';
4
4
  export declare const OverlayAlertsModal: React.FC<{
5
- alerts: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetOverlayAlerts>;
6
- open: boolean;
7
- onClose(): void;
5
+ alerts: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetOverlayAlerts>;
6
+ open: boolean;
7
+ onClose(): void;
8
8
  }>;
9
9
  export declare const OverlayAlertsTips: React.FC<{
10
- alerts: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetOverlayAlerts>;
11
- defaultOpen?: boolean;
10
+ alerts: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetOverlayAlerts>;
11
+ defaultOpen?: boolean;
12
12
  }>;
13
13
  export declare const OverlayAlertsButton: React.FC<{
14
- alerts: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetOverlayAlerts>;
14
+ alerts: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetOverlayAlerts>;
15
15
  }>;
16
16
  export declare const OverlayAlertsWithButton: React.FC<Omit<{
17
- alerts: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetOverlayAlerts>;
17
+ alerts: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetOverlayAlerts>;
18
18
  }, "alerts"> & Partial<{
19
- body?: any;
19
+ body?: any;
20
20
  }>>;
21
21
  export declare const OverlayAlertsWithTips: React.FC<Omit<{
22
- alerts: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetOverlayAlerts>;
23
- defaultOpen?: boolean | undefined;
22
+ alerts: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetOverlayAlerts>;
23
+ defaultOpen?: boolean | undefined;
24
24
  }, "alerts"> & Partial<{
25
- body?: any;
26
- }>>;
25
+ body?: any;
26
+ }>>;