@rsdoctor/components 0.3.1 → 0.3.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.
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
CodepenCircleOutlined,
|
|
4
|
+
ColumnHeightOutlined,
|
|
5
|
+
DeploymentUnitOutlined,
|
|
6
|
+
InfoCircleOutlined
|
|
7
|
+
} from "@ant-design/icons";
|
|
3
8
|
import Editor from "@monaco-editor/react";
|
|
4
9
|
import { SDK } from "@rsdoctor/types";
|
|
5
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
Button,
|
|
12
|
+
Card,
|
|
13
|
+
Col,
|
|
14
|
+
Divider,
|
|
15
|
+
Drawer,
|
|
16
|
+
Empty,
|
|
17
|
+
Popover,
|
|
18
|
+
Row,
|
|
19
|
+
Space,
|
|
20
|
+
Tag,
|
|
21
|
+
Tooltip,
|
|
22
|
+
Typography
|
|
23
|
+
} from "antd";
|
|
6
24
|
import { omitBy, sumBy } from "lodash-es";
|
|
7
25
|
import { dirname, relative } from "path";
|
|
8
26
|
import { useEffect, useMemo, useState } from "react";
|
|
@@ -14,7 +32,13 @@ import { KeywordInput } from "../../../components/Form/keyword";
|
|
|
14
32
|
import { Keyword } from "../../../components/Keyword";
|
|
15
33
|
import { TextDrawer } from "../../../components/TextDrawer";
|
|
16
34
|
import { Size, drawerWidth } from "../../../constants";
|
|
17
|
-
import {
|
|
35
|
+
import {
|
|
36
|
+
createFileStructures,
|
|
37
|
+
formatSize,
|
|
38
|
+
getOriginalLanguage,
|
|
39
|
+
isJsDataUrl,
|
|
40
|
+
useI18n
|
|
41
|
+
} from "../../../utils";
|
|
18
42
|
import { ModuleGraphListContext } from "../config";
|
|
19
43
|
let expanedModulesKeys = [];
|
|
20
44
|
const TAB_MAP = {
|
|
@@ -23,11 +47,13 @@ const TAB_MAP = {
|
|
|
23
47
|
parsedSource: "Bundled Code (After bundle and tree-shaking)"
|
|
24
48
|
};
|
|
25
49
|
const tagStyle = {
|
|
26
|
-
|
|
27
|
-
|
|
50
|
+
margin: "none",
|
|
51
|
+
marginInlineEnd: 0
|
|
28
52
|
};
|
|
29
|
-
const ModuleCodeViewer = ({
|
|
30
|
-
|
|
53
|
+
const ModuleCodeViewer = ({
|
|
54
|
+
data
|
|
55
|
+
}) => {
|
|
56
|
+
const [tab, setTab] = useState("parsedSource");
|
|
31
57
|
const { t } = useI18n();
|
|
32
58
|
const TAB_LAB_MAP = {
|
|
33
59
|
source: "Source Code",
|
|
@@ -51,74 +77,104 @@ const ModuleCodeViewer = ({ data }) => {
|
|
|
51
77
|
destroyOnClose: true,
|
|
52
78
|
title: `Code of "${path}"`
|
|
53
79
|
},
|
|
54
|
-
children: /* @__PURE__ */ jsx(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
...e,
|
|
63
|
-
tab: TAB_LAB_MAP[e.tab],
|
|
64
|
-
key: e.tab
|
|
65
|
-
})
|
|
66
|
-
),
|
|
67
|
-
onTabChange: (v) => setTab(v),
|
|
68
|
-
tabBarExtraContent: /* @__PURE__ */ jsx(
|
|
69
|
-
Popover,
|
|
70
|
-
{
|
|
71
|
-
placement: "bottom",
|
|
72
|
-
title: /* @__PURE__ */ jsx(Typography.Title, { level: 5, children: "Explain" }),
|
|
73
|
-
content: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", marginBottom: 30 }, children: [
|
|
74
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
75
|
-
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: "Source: " }),
|
|
76
|
-
/* @__PURE__ */ jsx(Typography.Text, { children: TAB_MAP.source })
|
|
77
|
-
] }),
|
|
78
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
79
|
-
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: "Transformed: " }),
|
|
80
|
-
/* @__PURE__ */ jsx(Typography.Text, { children: TAB_MAP.transformed })
|
|
81
|
-
] }),
|
|
82
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
83
|
-
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: "Bundled Source: " }),
|
|
84
|
-
/* @__PURE__ */ jsx(Typography.Text, { children: TAB_MAP.parsedSource })
|
|
85
|
-
] }),
|
|
86
|
-
/* @__PURE__ */ jsx("br", {}),
|
|
87
|
-
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: "More" }),
|
|
88
|
-
/* @__PURE__ */ jsx(Typography.Text, { children: t("CodeModeExplain") })
|
|
89
|
-
] }) }),
|
|
90
|
-
trigger: "hover",
|
|
91
|
-
children: /* @__PURE__ */ jsx("a", { href: "#", children: "Explain" })
|
|
92
|
-
}
|
|
93
|
-
),
|
|
94
|
-
children: /* @__PURE__ */ jsx(
|
|
95
|
-
Editor,
|
|
80
|
+
children: /* @__PURE__ */ jsx(
|
|
81
|
+
ServerAPIProvider,
|
|
82
|
+
{
|
|
83
|
+
api: SDK.ServerAPI.API.GetModuleCodeByModuleId,
|
|
84
|
+
body: { moduleId: data.id },
|
|
85
|
+
children: (source) => {
|
|
86
|
+
return /* @__PURE__ */ jsx(Fragment, { children: !source["source"] && !source["parsedSource"] && !source["transformed"] ? /* @__PURE__ */ jsx(Empty, { description: "No Code. Rspack builder not support code yet. And if you upload the stats.json to analysis, it's also no code to show." }) : /* @__PURE__ */ jsx(
|
|
87
|
+
Card,
|
|
96
88
|
{
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
89
|
+
className: "code-size-card",
|
|
90
|
+
style: { width: "100%" },
|
|
91
|
+
tabList: Object.keys(omitBy(source, (s) => !s)).map((k) => ({ tab: k })).map((e) => ({
|
|
92
|
+
...e,
|
|
93
|
+
tab: TAB_LAB_MAP[e.tab],
|
|
94
|
+
key: e.tab
|
|
95
|
+
})),
|
|
96
|
+
onTabChange: (v) => setTab(v),
|
|
97
|
+
tabBarExtraContent: /* @__PURE__ */ jsx(
|
|
98
|
+
Popover,
|
|
99
|
+
{
|
|
100
|
+
placement: "bottom",
|
|
101
|
+
title: /* @__PURE__ */ jsx(Typography.Title, { level: 5, children: "Explain" }),
|
|
102
|
+
content: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
103
|
+
"div",
|
|
104
|
+
{
|
|
105
|
+
style: {
|
|
106
|
+
display: "flex",
|
|
107
|
+
flexDirection: "column",
|
|
108
|
+
marginBottom: 30
|
|
109
|
+
},
|
|
110
|
+
children: [
|
|
111
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
112
|
+
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: "Source: " }),
|
|
113
|
+
/* @__PURE__ */ jsx(Typography.Text, { children: TAB_MAP.source })
|
|
114
|
+
] }),
|
|
115
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
116
|
+
/* @__PURE__ */ jsxs(Typography.Text, { strong: true, children: [
|
|
117
|
+
"Transformed:",
|
|
118
|
+
" "
|
|
119
|
+
] }),
|
|
120
|
+
/* @__PURE__ */ jsx(Typography.Text, { children: TAB_MAP.transformed })
|
|
121
|
+
] }),
|
|
122
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
123
|
+
/* @__PURE__ */ jsxs(Typography.Text, { strong: true, children: [
|
|
124
|
+
"Bundled Source:",
|
|
125
|
+
" "
|
|
126
|
+
] }),
|
|
127
|
+
/* @__PURE__ */ jsx(Typography.Text, { children: TAB_MAP.parsedSource })
|
|
128
|
+
] }),
|
|
129
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
130
|
+
/* @__PURE__ */ jsx(Typography.Text, { strong: true, children: "More" }),
|
|
131
|
+
/* @__PURE__ */ jsx(Typography.Text, { children: t("CodeModeExplain") })
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
) }),
|
|
135
|
+
trigger: "hover",
|
|
136
|
+
children: /* @__PURE__ */ jsx("a", { href: "#", children: "Explain" })
|
|
108
137
|
}
|
|
109
|
-
|
|
138
|
+
),
|
|
139
|
+
children: /* @__PURE__ */ jsx(
|
|
140
|
+
Editor,
|
|
141
|
+
{
|
|
142
|
+
theme: "vs-dark",
|
|
143
|
+
language: getOriginalLanguage(path),
|
|
144
|
+
height: window.innerHeight / 1.5,
|
|
145
|
+
value: source[tab],
|
|
146
|
+
options: {
|
|
147
|
+
readOnly: true,
|
|
148
|
+
domReadOnly: true,
|
|
149
|
+
fontSize: 14,
|
|
150
|
+
wordWrap: "bounded",
|
|
151
|
+
minimap: {
|
|
152
|
+
enabled: false
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
)
|
|
110
157
|
}
|
|
111
|
-
)
|
|
158
|
+
) });
|
|
112
159
|
}
|
|
113
|
-
|
|
114
|
-
|
|
160
|
+
}
|
|
161
|
+
)
|
|
115
162
|
}
|
|
116
163
|
);
|
|
117
164
|
};
|
|
118
165
|
const ModuleGraphViewer = ({ id, show, setShow, cwd }) => {
|
|
119
166
|
if (!id)
|
|
120
167
|
return null;
|
|
121
|
-
return /* @__PURE__ */ jsx(
|
|
168
|
+
return /* @__PURE__ */ jsx(
|
|
169
|
+
Drawer,
|
|
170
|
+
{
|
|
171
|
+
open: show,
|
|
172
|
+
maskClosable: true,
|
|
173
|
+
width: drawerWidth,
|
|
174
|
+
onClose: () => setShow(false),
|
|
175
|
+
children: /* @__PURE__ */ jsx(ServerAPIProvider, { api: SDK.ServerAPI.API.GetAllModuleGraph, body: {}, children: (modules) => /* @__PURE__ */ jsx(ModuleAnalyzeComponent, { cwd, moduleId: id, modules }) })
|
|
176
|
+
}
|
|
177
|
+
);
|
|
122
178
|
};
|
|
123
179
|
const inlinedResourcePathKey = "__RESOURCEPATH__";
|
|
124
180
|
function getChildrenModule(node) {
|
|
@@ -147,12 +203,19 @@ const ModulesStatistics = ({ modules, chunks, filteredModules }) => {
|
|
|
147
203
|
{
|
|
148
204
|
title: `total modules count is ${modules.length}, the filtered modules count is ${filteredModules.length}`,
|
|
149
205
|
children: /* @__PURE__ */ jsxs(Space, { children: [
|
|
150
|
-
/* @__PURE__ */ jsxs(
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
206
|
+
/* @__PURE__ */ jsxs(
|
|
207
|
+
Typography.Text,
|
|
208
|
+
{
|
|
209
|
+
type: "secondary",
|
|
210
|
+
style: { fontSize: 12, fontWeight: 400 },
|
|
211
|
+
children: [
|
|
212
|
+
"Modules: ",
|
|
213
|
+
filteredModules.length,
|
|
214
|
+
" / ",
|
|
215
|
+
modules.length
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
),
|
|
156
219
|
/* @__PURE__ */ jsx(InfoCircleOutlined, {})
|
|
157
220
|
] })
|
|
158
221
|
}
|
|
@@ -180,11 +243,18 @@ const ModulesStatistics = ({ modules, chunks, filteredModules }) => {
|
|
|
180
243
|
] })
|
|
181
244
|
] }),
|
|
182
245
|
children: /* @__PURE__ */ jsxs(Space, { children: [
|
|
183
|
-
/* @__PURE__ */ jsxs(
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
246
|
+
/* @__PURE__ */ jsxs(
|
|
247
|
+
Typography.Text,
|
|
248
|
+
{
|
|
249
|
+
type: "secondary",
|
|
250
|
+
style: { fontSize: 12, fontWeight: 400 },
|
|
251
|
+
children: [
|
|
252
|
+
"Modules Size:",
|
|
253
|
+
" ",
|
|
254
|
+
filteredParsedSize === parsedSize ? formatSize(parsedSize) : `${formatSize(filteredParsedSize)} / ${formatSize(parsedSize)}`
|
|
255
|
+
]
|
|
256
|
+
}
|
|
257
|
+
),
|
|
188
258
|
/* @__PURE__ */ jsx(InfoCircleOutlined, {})
|
|
189
259
|
] })
|
|
190
260
|
}
|
|
@@ -197,22 +267,37 @@ const ModulesStatistics = ({ modules, chunks, filteredModules }) => {
|
|
|
197
267
|
/* @__PURE__ */ jsxs(Typography.Text, { style: { color: "inherit" }, children: [
|
|
198
268
|
"this asset includes ",
|
|
199
269
|
chunks.length,
|
|
200
|
-
" chunks:
|
|
270
|
+
" chunks:",
|
|
271
|
+
" "
|
|
201
272
|
] }),
|
|
202
273
|
chunks.map((e) => /* @__PURE__ */ jsx(Bdg, { label: "chunk", value: e.name }, e.name))
|
|
203
274
|
] }),
|
|
204
275
|
children: /* @__PURE__ */ jsxs(Space, { children: [
|
|
205
|
-
/* @__PURE__ */ jsxs(
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
276
|
+
/* @__PURE__ */ jsxs(
|
|
277
|
+
Typography.Text,
|
|
278
|
+
{
|
|
279
|
+
type: "secondary",
|
|
280
|
+
style: { fontSize: 12, fontWeight: 400 },
|
|
281
|
+
children: [
|
|
282
|
+
"Chunks: ",
|
|
283
|
+
chunks.length
|
|
284
|
+
]
|
|
285
|
+
}
|
|
286
|
+
),
|
|
209
287
|
/* @__PURE__ */ jsx(InfoCircleOutlined, {})
|
|
210
288
|
] })
|
|
211
289
|
}
|
|
212
290
|
)
|
|
213
291
|
] });
|
|
214
292
|
};
|
|
215
|
-
const AssetDetail = ({
|
|
293
|
+
const AssetDetail = ({
|
|
294
|
+
asset,
|
|
295
|
+
chunks: includeChunks,
|
|
296
|
+
modules: includeModules,
|
|
297
|
+
moduleSizeLimit,
|
|
298
|
+
height,
|
|
299
|
+
root
|
|
300
|
+
}) => {
|
|
216
301
|
const [moduleKeyword, setModuleKeyword] = useState("");
|
|
217
302
|
const [defaultExpandAll, setDefaultExpandAll] = useState(false);
|
|
218
303
|
const [moduleJumpList, setModuleJumpList] = useState([]);
|
|
@@ -238,9 +323,19 @@ const AssetDetail = ({ asset, chunks: includeChunks, modules: includeModules, mo
|
|
|
238
323
|
return basename;
|
|
239
324
|
const { parsedSize = 0, sourceSize = 0 } = mod.size;
|
|
240
325
|
const isConcatenation = mod.kind === SDK.ModuleKind.Concatenation;
|
|
241
|
-
const containedOtherModules = !isConcatenation && parsedSize === 0 && includeModules.filter(
|
|
326
|
+
const containedOtherModules = !isConcatenation && parsedSize === 0 && includeModules.filter(
|
|
327
|
+
(e) => e !== mod && e.modules && e.modules.indexOf(mod.id) > -1
|
|
328
|
+
);
|
|
242
329
|
return /* @__PURE__ */ jsxs(Space, { children: [
|
|
243
|
-
/* @__PURE__ */ jsx(
|
|
330
|
+
/* @__PURE__ */ jsx(
|
|
331
|
+
Keyword,
|
|
332
|
+
{
|
|
333
|
+
ellipsis: true,
|
|
334
|
+
style: { maxWidth: 500 },
|
|
335
|
+
text: basename,
|
|
336
|
+
keyword: moduleKeyword
|
|
337
|
+
}
|
|
338
|
+
),
|
|
244
339
|
parsedSize !== 0 ? /* @__PURE__ */ jsx(
|
|
245
340
|
Tooltip,
|
|
246
341
|
{
|
|
@@ -259,7 +354,8 @@ const AssetDetail = ({ asset, chunks: includeChunks, modules: includeModules, mo
|
|
|
259
354
|
Tooltip,
|
|
260
355
|
{
|
|
261
356
|
title: /* @__PURE__ */ jsx(Space, { children: /* @__PURE__ */ jsxs(Typography.Text, { style: { color: "inherit" }, children: [
|
|
262
|
-
"this is a concatenated module, it contains
|
|
357
|
+
"this is a concatenated module, it contains",
|
|
358
|
+
" ",
|
|
263
359
|
mod.modules?.length,
|
|
264
360
|
" modules"
|
|
265
361
|
] }) }),
|
|
@@ -286,9 +382,25 @@ const AssetDetail = ({ asset, chunks: includeChunks, modules: includeModules, mo
|
|
|
286
382
|
}
|
|
287
383
|
const p = relative(dirname(mod.path), path);
|
|
288
384
|
if (p.startsWith("javascript;charset=utf-8;base64,")) {
|
|
289
|
-
return /* @__PURE__ */ jsx(
|
|
385
|
+
return /* @__PURE__ */ jsx(
|
|
386
|
+
Typography.Text,
|
|
387
|
+
{
|
|
388
|
+
style: { color: "inherit", maxWidth: "100%" },
|
|
389
|
+
code: true,
|
|
390
|
+
children: p[0] === "." ? p : `./${p}`
|
|
391
|
+
},
|
|
392
|
+
id
|
|
393
|
+
);
|
|
290
394
|
}
|
|
291
|
-
return /* @__PURE__ */ jsx(
|
|
395
|
+
return /* @__PURE__ */ jsx(
|
|
396
|
+
Typography.Text,
|
|
397
|
+
{
|
|
398
|
+
style: { color: "inherit" },
|
|
399
|
+
code: true,
|
|
400
|
+
children: p[0] === "." ? p : `./${p}`
|
|
401
|
+
},
|
|
402
|
+
id
|
|
403
|
+
);
|
|
292
404
|
})
|
|
293
405
|
] }),
|
|
294
406
|
children: /* @__PURE__ */ jsx(Tag, { color: "green", children: "concatenated" })
|
|
@@ -311,7 +423,9 @@ const AssetDetail = ({ asset, chunks: includeChunks, modules: includeModules, mo
|
|
|
311
423
|
dirTitle(dir, defaultTitle) {
|
|
312
424
|
const paths = getChildrenModule(dir);
|
|
313
425
|
if (paths.length) {
|
|
314
|
-
const mods = paths.map(
|
|
426
|
+
const mods = paths.map(
|
|
427
|
+
(e) => includeModules.find((m) => m.path === e)
|
|
428
|
+
);
|
|
315
429
|
const parsedSize = sumBy(mods, (e) => e.size?.parsedSize || 0);
|
|
316
430
|
return /* @__PURE__ */ jsxs(Space, { children: [
|
|
317
431
|
/* @__PURE__ */ jsx(Typography.Text, { children: defaultTitle }),
|
|
@@ -331,43 +445,96 @@ const AssetDetail = ({ asset, chunks: includeChunks, modules: includeModules, mo
|
|
|
331
445
|
useEffect(() => {
|
|
332
446
|
setDefaultExpandAll(false);
|
|
333
447
|
}, [moduleKeyword]);
|
|
334
|
-
return /* @__PURE__ */ jsx(
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
] }) }),
|
|
341
|
-
/* @__PURE__ */ jsx(Col, { span: 24, style: { marginTop: Size.BasePadding }, children: filteredModules.length ? /* @__PURE__ */ jsx(
|
|
342
|
-
FileTree,
|
|
343
|
-
{
|
|
344
|
-
onExpand: (expandedKeys) => {
|
|
345
|
-
expanedModulesKeys = expandedKeys;
|
|
346
|
-
},
|
|
347
|
-
treeData: fileStructures,
|
|
348
|
-
autoExpandParent: true,
|
|
349
|
-
defaultExpandParent: true,
|
|
350
|
-
defaultExpandedKeys: expanedModulesKeys?.length ? expanedModulesKeys : fileStructures.length === 1 ? [fileStructures[0].key] : [],
|
|
351
|
-
defaultExpandAll: defaultExpandAll || filteredModules.length <= 20
|
|
352
|
-
},
|
|
353
|
-
`tree_${moduleKeyword}_${defaultExpandAll}_${asset.path}`
|
|
354
|
-
) : /* @__PURE__ */ jsx(
|
|
355
|
-
Empty,
|
|
448
|
+
return /* @__PURE__ */ jsx(
|
|
449
|
+
ModuleGraphListContext.Provider,
|
|
450
|
+
{
|
|
451
|
+
value: { moduleJumpList, setModuleJumpList },
|
|
452
|
+
children: /* @__PURE__ */ jsxs(
|
|
453
|
+
Card,
|
|
356
454
|
{
|
|
357
|
-
|
|
455
|
+
title: `Modules of "${asset.path}"`,
|
|
456
|
+
bodyStyle: { overflow: "scroll", height },
|
|
457
|
+
size: "small",
|
|
458
|
+
children: [
|
|
459
|
+
includeModules.length ? /* @__PURE__ */ jsxs(Row, { children: [
|
|
460
|
+
/* @__PURE__ */ jsx(Col, { span: 24, children: /* @__PURE__ */ jsx(
|
|
461
|
+
ModulesStatistics,
|
|
462
|
+
{
|
|
463
|
+
modules: includeModules,
|
|
464
|
+
chunks: includeChunks,
|
|
465
|
+
filteredModules
|
|
466
|
+
}
|
|
467
|
+
) }),
|
|
468
|
+
/* @__PURE__ */ jsx(Col, { span: 24, children: /* @__PURE__ */ jsxs(Space, { children: [
|
|
469
|
+
/* @__PURE__ */ jsx(
|
|
470
|
+
KeywordInput,
|
|
471
|
+
{
|
|
472
|
+
placeholder: "search module by keyword",
|
|
473
|
+
onChange: onSearch
|
|
474
|
+
},
|
|
475
|
+
asset.path
|
|
476
|
+
),
|
|
477
|
+
/* @__PURE__ */ jsx(
|
|
478
|
+
Button,
|
|
479
|
+
{
|
|
480
|
+
onClick: () => setDefaultExpandAll(true),
|
|
481
|
+
size: "small",
|
|
482
|
+
icon: /* @__PURE__ */ jsx(ColumnHeightOutlined, {}),
|
|
483
|
+
children: "expand all"
|
|
484
|
+
}
|
|
485
|
+
)
|
|
486
|
+
] }) }),
|
|
487
|
+
/* @__PURE__ */ jsx(Col, { span: 24, style: { marginTop: Size.BasePadding }, children: filteredModules.length ? /* @__PURE__ */ jsx(
|
|
488
|
+
FileTree,
|
|
489
|
+
{
|
|
490
|
+
onExpand: (expandedKeys) => {
|
|
491
|
+
expanedModulesKeys = expandedKeys;
|
|
492
|
+
},
|
|
493
|
+
treeData: fileStructures,
|
|
494
|
+
autoExpandParent: true,
|
|
495
|
+
defaultExpandParent: true,
|
|
496
|
+
defaultExpandedKeys: expanedModulesKeys?.length ? expanedModulesKeys : fileStructures.length === 1 ? [fileStructures[0].key] : [],
|
|
497
|
+
defaultExpandAll: defaultExpandAll || filteredModules.length <= 20
|
|
498
|
+
},
|
|
499
|
+
`tree_${moduleKeyword}_${defaultExpandAll}_${asset.path}`
|
|
500
|
+
) : /* @__PURE__ */ jsx(
|
|
501
|
+
Empty,
|
|
502
|
+
{
|
|
503
|
+
description: /* @__PURE__ */ jsx(
|
|
504
|
+
Typography.Text,
|
|
505
|
+
{
|
|
506
|
+
strong: true,
|
|
507
|
+
children: `"${moduleKeyword}" can't match any modules`
|
|
508
|
+
}
|
|
509
|
+
)
|
|
510
|
+
}
|
|
511
|
+
) })
|
|
512
|
+
] }) : /* @__PURE__ */ jsx(
|
|
513
|
+
Empty,
|
|
514
|
+
{
|
|
515
|
+
description: /* @__PURE__ */ jsx(
|
|
516
|
+
Typography.Text,
|
|
517
|
+
{
|
|
518
|
+
strong: true,
|
|
519
|
+
children: `"${asset.path}" doesn't have any modules`
|
|
520
|
+
}
|
|
521
|
+
)
|
|
522
|
+
}
|
|
523
|
+
),
|
|
524
|
+
/* @__PURE__ */ jsx(
|
|
525
|
+
ModuleGraphViewer,
|
|
526
|
+
{
|
|
527
|
+
id: moduleJumpList?.length ? moduleJumpList[moduleJumpList.length - 1] : "",
|
|
528
|
+
show,
|
|
529
|
+
setShow,
|
|
530
|
+
cwd: root
|
|
531
|
+
}
|
|
532
|
+
)
|
|
533
|
+
]
|
|
358
534
|
}
|
|
359
|
-
)
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
ModuleGraphViewer,
|
|
363
|
-
{
|
|
364
|
-
id: moduleJumpList?.length ? moduleJumpList[moduleJumpList.length - 1] : "",
|
|
365
|
-
show,
|
|
366
|
-
setShow,
|
|
367
|
-
cwd: root
|
|
368
|
-
}
|
|
369
|
-
)
|
|
370
|
-
] }) });
|
|
535
|
+
)
|
|
536
|
+
}
|
|
537
|
+
);
|
|
371
538
|
};
|
|
372
539
|
export {
|
|
373
540
|
AssetDetail,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/components",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -75,9 +75,9 @@
|
|
|
75
75
|
"terser": "^5.26.0",
|
|
76
76
|
"typescript": "^5.2.2",
|
|
77
77
|
"url-parse": "1.5.10",
|
|
78
|
-
"@rsdoctor/graph": "0.3.
|
|
79
|
-
"@rsdoctor/types": "0.3.
|
|
80
|
-
"@rsdoctor/utils": "0.3.
|
|
78
|
+
"@rsdoctor/graph": "0.3.2",
|
|
79
|
+
"@rsdoctor/types": "0.3.2",
|
|
80
|
+
"@rsdoctor/utils": "0.3.2"
|
|
81
81
|
},
|
|
82
82
|
"publishConfig": {
|
|
83
83
|
"access": "public",
|