@rsdoctor/components 0.3.11 → 0.4.0

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 (37) hide show
  1. package/dist/components/Alert/package-relation.d.ts +2 -2
  2. package/dist/components/Alert/package-relation.js +52 -56
  3. package/dist/components/Alerts/overlay.d.ts +1 -1
  4. package/dist/components/BundleDiff/DiffContainer/packages.d.ts +2 -2
  5. package/dist/components/BundleDiff/DiffContainer/row.d.ts +2 -2
  6. package/dist/components/BundleDiff/DiffContainer/types.d.ts +0 -1
  7. package/dist/components/BundleDiff/DiffServerAPIProvider/index.d.ts +0 -1
  8. package/dist/components/Charts/TimelineCharts/index.js +16 -2
  9. package/dist/components/CodeViewer/hightlight.js +24 -8
  10. package/dist/components/CodeViewer/viewer.d.ts +1 -0
  11. package/dist/components/CodeViewer/viewer.js +11 -3
  12. package/dist/components/Layout/menus.d.ts +1 -1
  13. package/dist/components/Loader/Analysis/files.js +76 -19
  14. package/dist/components/Loader/Analysis/index.js +16 -2
  15. package/dist/components/Loader/executions.d.ts +1 -1
  16. package/dist/components/Loader/executions.js +261 -116
  17. package/dist/components/Manifest/api.js +25 -11
  18. package/dist/config.d.ts +0 -1
  19. package/dist/pages/BundleSize/components/asset.js +11 -3
  20. package/dist/pages/BundleSize/components/index.js +2 -1
  21. package/dist/pages/BundleSize/config.d.ts +0 -1
  22. package/dist/pages/TreeShaking/editor.js +8 -5
  23. package/dist/pages/TreeShaking/index.js +1 -0
  24. package/dist/pages/TreeShaking/range.d.ts +282 -0
  25. package/dist/pages/TreeShaking/range.js +542 -0
  26. package/dist/pages/TreeShaking/utils.d.ts +1 -1
  27. package/dist/pages/TreeShaking/utils.js +1 -1
  28. package/dist/pages/WebpackLoaders/Analysis/index.js +1 -1
  29. package/dist/utils/data/brief.d.ts +11 -0
  30. package/dist/utils/data/brief.js +42 -0
  31. package/dist/utils/data/index.js +11 -0
  32. package/dist/utils/file.d.ts +0 -1
  33. package/dist/utils/hooks.d.ts +0 -1
  34. package/dist/utils/manifest.d.ts +2 -5
  35. package/dist/utils/monaco.js +6 -1
  36. package/dist/utils/request.d.ts +6 -6
  37. package/package.json +5 -5
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { SDK } from '@rsdoctor/types';
2
+ import { Rule, SDK } from '@rsdoctor/types';
3
3
  import { PackageRelationAlertProps } from './types';
4
4
  export declare const PackageRelationReasons: React.FC<{
5
5
  data: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetPackageRelationAlertDetails>;
@@ -10,7 +10,7 @@ export declare const PackageRelationReasonsWithServer: React.FC<Omit<{
10
10
  cwd: string;
11
11
  }, "data"> & Partial<{
12
12
  body: {
13
- id: string | number;
13
+ id: Rule.RuleStoreDataItem["id"];
14
14
  target: SDK.PackageBasicData;
15
15
  };
16
16
  }>>;
@@ -1,5 +1,4 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { createElement } from "react";
3
2
  import React, { useState } from "react";
4
3
  import {
5
4
  Space,
@@ -25,63 +24,60 @@ import { TextDrawer } from "../TextDrawer";
25
24
  import { Title } from "../Title";
26
25
  import { Size, Color } from "../../constants";
27
26
  import { Badge as Bdg } from "../Badge";
28
- import { FileHightLightViewer } from "../CodeViewer";
29
27
  import { withServerAPI } from "../Manifest";
30
- const PackageRelationReasons = ({ data, cwd }) => {
28
+ const TextDrawerWidth = "60%";
29
+ const PackageRelationReasons = ({ data }) => {
31
30
  const [index, setIndex] = useState(0);
32
31
  const { t } = useI18n();
33
- return /* @__PURE__ */ jsxs(Row, { gutter: Size.BasePadding, wrap: false, align: "top", children: [
34
- /* @__PURE__ */ jsx(Col, { span: 12, style: { height: "100%" }, children: /* @__PURE__ */ jsx(
35
- Card,
36
- {
37
- title: `The reasons for importing this version`,
38
- style: { height: "100%" },
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
- ),
46
- bodyStyle: { overflow: "scroll" },
47
- children: data.length ? /* @__PURE__ */ jsxs(React.Fragment, { children: [
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." }) }),
49
- /* @__PURE__ */ jsx(Timeline, { children: data.map((e, i) => {
50
- const { dependency, module, relativePath } = e;
51
- const { statements } = dependency;
52
- const { start } = statements?.[0]?.position ? module.isPreferSource ? statements[0].position.source : statements[0].position.transformed : { start: { line: 0, column: 0 } };
53
- const text = `${relativePath}:${start.line}:${start.column || 1}`;
54
- return /* @__PURE__ */ jsx(
55
- Timeline.Item,
56
- {
57
- style: { cursor: "pointer" },
58
- dot: i === data.length - 1 ? void 0 : "⬇️",
59
- children: /* @__PURE__ */ jsx(
60
- Typography.Text,
61
- {
62
- copyable: { text: relativePath },
63
- onClick: (e2) => {
64
- e2.preventDefault();
65
- e2.stopPropagation();
66
- setIndex(i);
67
- },
68
- strong: i === index,
69
- style: {
70
- color: i === index ? Color.Blue : "inherit",
71
- display: "block"
72
- },
73
- children: text
74
- }
75
- )
76
- },
77
- text
78
- );
79
- }) })
80
- ] }) : /* @__PURE__ */ jsx(Empty, { description: "This package no dependencies" })
81
- }
82
- ) }),
83
- /* @__PURE__ */ jsx(Col, { span: 12, style: { height: "100%" }, children: /* @__PURE__ */ createElement(FileHightLightViewer, { ...data[index], key: index, cwd }) })
84
- ] });
32
+ return /* @__PURE__ */ jsx(Row, { gutter: Size.BasePadding, wrap: false, align: "top", children: /* @__PURE__ */ jsx(Col, { span: 20, style: { height: "100%" }, children: /* @__PURE__ */ jsx(
33
+ Card,
34
+ {
35
+ title: `The reasons for importing this version`,
36
+ style: { height: "100%" },
37
+ extra: /* @__PURE__ */ jsx(
38
+ Popover,
39
+ {
40
+ content: /* @__PURE__ */ jsx(Typography.Text, { children: t("DuplicatePakCodeExplain") }),
41
+ children: /* @__PURE__ */ jsx("a", { href: "#", children: "Explain" })
42
+ }
43
+ ),
44
+ bodyStyle: { overflow: "scroll" },
45
+ children: data.length ? /* @__PURE__ */ jsxs(React.Fragment, { children: [
46
+ /* @__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." }) }),
47
+ /* @__PURE__ */ jsx(Timeline, { children: data.map((e, i) => {
48
+ const { dependency, module, relativePath } = e;
49
+ const { statements } = dependency;
50
+ const { start } = statements?.[0]?.position ? module.isPreferSource ? statements[0].position.source : statements[0].position.transformed : { start: { line: 0, column: 0 } };
51
+ const text = `${relativePath}:${start.line}:${start.column || 1}`;
52
+ return /* @__PURE__ */ jsx(
53
+ Timeline.Item,
54
+ {
55
+ style: { cursor: "pointer" },
56
+ dot: i === data.length - 1 ? void 0 : "⬇️",
57
+ children: /* @__PURE__ */ jsx(
58
+ Typography.Text,
59
+ {
60
+ copyable: { text: relativePath },
61
+ onClick: (e2) => {
62
+ e2.preventDefault();
63
+ e2.stopPropagation();
64
+ setIndex(i);
65
+ },
66
+ strong: i === index,
67
+ style: {
68
+ color: i === index ? Color.Blue : "inherit",
69
+ display: "block"
70
+ },
71
+ children: text
72
+ }
73
+ )
74
+ },
75
+ text
76
+ );
77
+ }) })
78
+ ] }) : /* @__PURE__ */ jsx(Empty, { description: "This package no dependencies" })
79
+ }
80
+ ) }) });
85
81
  };
86
82
  const PackageRelationReasonsWithServer = withServerAPI({
87
83
  Component: PackageRelationReasons,
@@ -226,7 +222,7 @@ const PackageRelationAlert = ({
226
222
  {
227
223
  text: "Show Relations",
228
224
  buttonProps: { size: "small" },
229
- drawerProps: { title: data.title },
225
+ drawerProps: { title: data.title, width: TextDrawerWidth },
230
226
  children: /* @__PURE__ */ jsxs(Space, { direction: "vertical", className: "alert-space", children: [
231
227
  /* @__PURE__ */ jsxs(Space, { style: { marginBottom: Size.BasePadding / 2 }, children: [
232
228
  /* @__PURE__ */ jsx(Title, { text: name, upperFisrt: false }),
@@ -20,7 +20,7 @@ export declare const OverlayAlertsWithButton: React.FC<Omit<{
20
20
  }>>;
21
21
  export declare const OverlayAlertsWithTips: React.FC<Omit<{
22
22
  alerts: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetOverlayAlerts>;
23
- defaultOpen?: boolean | undefined;
23
+ defaultOpen?: boolean;
24
24
  }, "alerts"> & Partial<{
25
25
  body?: any;
26
26
  }>>;
@@ -10,8 +10,8 @@ export declare const getPackagesTableDataSource: ({ baseline, current, }: {
10
10
  }) => {
11
11
  updateType: UpdateType;
12
12
  name: string;
13
- baseline?: SDK.PackageData[] | undefined;
14
- current?: SDK.PackageData[] | undefined;
13
+ baseline?: SDK.PackageData[];
14
+ current?: SDK.PackageData[];
15
15
  }[];
16
16
  export declare const Packages: React.FC<{
17
17
  baseline: SDK.PackageGraphData;
@@ -2,8 +2,8 @@ import { ColumnGroupType, ColumnType } from 'antd/es/table/interface';
2
2
  import React from 'react';
3
3
  import { BundleDiffComponentCardProps, BundleDiffTableAssetsData, BundleDiffTableModulesData } from './types';
4
4
  export declare const ModuleHashPattern: RegExp;
5
- export declare const getSizeColumnPropsForModuleRow: (key: 'baseline' | 'current', sizeKey: 'parsedSize' | 'sourceSize') => ColumnType<BundleDiffTableModulesData>;
6
- export declare const getTargetColumnPropsForModuleRow: (key: 'baseline' | 'current', bMoudlesCount: number, cMoudlesCount: number) => ColumnGroupType<BundleDiffTableModulesData>;
5
+ export declare const getSizeColumnPropsForModuleRow: (key: "baseline" | "current", sizeKey: "parsedSize" | "sourceSize") => ColumnType<BundleDiffTableModulesData>;
6
+ export declare const getTargetColumnPropsForModuleRow: (key: "baseline" | "current", bMoudlesCount: number, cMoudlesCount: number) => ColumnGroupType<BundleDiffTableModulesData>;
7
7
  export declare const ModuleRowForAsset: React.FC<{
8
8
  data: BundleDiffTableAssetsData;
9
9
  } & Pick<BundleDiffComponentCardProps, 'baseline' | 'current'>>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Client, Manifest, SDK } from '@rsdoctor/types';
3
2
  import { UpdateType } from './constants';
4
3
  import { InferServerAPIBody } from '../../Manifest';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SDK } from '@rsdoctor/types';
3
2
  import { BundleDiffServerAPIProviderComponentCommonProps } from '../DiffContainer/types';
4
3
  export declare const DiffServerAPIProvider: <T extends SDK.ServerAPI.API | SDK.ServerAPI.APIExtends>(props: BundleDiffServerAPIProviderComponentCommonProps<T>) => JSX.Element;
@@ -1,7 +1,14 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { useState, useEffect, memo } from "react";
3
- import ReactECharts from "echarts-for-react";
3
+ import ReactEChartsCore from "echarts-for-react/lib/core";
4
4
  import * as echarts from "echarts/core";
5
+ import { CustomChart } from "echarts/charts";
6
+ import {
7
+ TooltipComponent,
8
+ GridComponent,
9
+ DataZoomComponent
10
+ } from "echarts/components";
11
+ import { CanvasRenderer } from "echarts/renderers";
5
12
  import dayjs from "dayjs";
6
13
  import { groupBy } from "lodash-es";
7
14
  import { LITTLE_PALETTE_COLORS, PALETTE_COLORS } from "../constants";
@@ -10,6 +17,13 @@ const TimelineCom = memo(({ loaderData, pluginsData, formatterFn, chartType = "n
10
17
  const data = [];
11
18
  let categories = [];
12
19
  const [optionsData, setOptinsData] = useState({});
20
+ echarts.use([
21
+ CustomChart,
22
+ TooltipComponent,
23
+ GridComponent,
24
+ DataZoomComponent,
25
+ CanvasRenderer
26
+ ]);
13
27
  useEffect(() => {
14
28
  if (!loaderData)
15
29
  return;
@@ -199,7 +213,7 @@ const TimelineCom = memo(({ loaderData, pluginsData, formatterFn, chartType = "n
199
213
  setOptinsData(option);
200
214
  }, [loaderData, pluginsData]);
201
215
  return /* @__PURE__ */ jsx(
202
- ReactECharts,
216
+ ReactEChartsCore,
203
217
  {
204
218
  option: optionsData,
205
219
  echarts,
@@ -3,9 +3,19 @@ import { useRef } from "react";
3
3
  import { Space, Card, Tooltip } from "antd";
4
4
  import { InfoCircleOutlined } from "@ant-design/icons";
5
5
  import Editor from "@monaco-editor/react";
6
- import { getOriginalLanguage, beautifyModulePath, getSelectionRange, getRevealPositionForViewer } from "../../utils";
6
+ import {
7
+ getOriginalLanguage,
8
+ beautifyModulePath,
9
+ getSelectionRange,
10
+ getRevealPositionForViewer
11
+ } from "../../utils";
7
12
  import { CodeOpener } from "../Opener";
8
- const FileHightLightViewer = ({ dependency, module, cwd, moduleCode }) => {
13
+ const FileHightLightViewer = ({
14
+ dependency,
15
+ module,
16
+ cwd,
17
+ moduleCode
18
+ }) => {
9
19
  const editorRef = useRef(null);
10
20
  if (!dependency)
11
21
  return null;
@@ -14,12 +24,18 @@ const FileHightLightViewer = ({ dependency, module, cwd, moduleCode }) => {
14
24
  const { start, end } = statements?.[0]?.position ? hasSourceRange ? statements[0].position.source : statements[0].position.transformed : { start: { line: 0, column: 0 }, end: { line: 0, column: 0 } };
15
25
  const content = hasSourceRange ? moduleCode?.source : moduleCode?.transformed || moduleCode?.source;
16
26
  const modulePath = module.path;
17
- const handleEditorDidMount = (editor2, monaco) => {
18
- editorRef.current = editor2;
19
- const range = getSelectionRange({ start, end }, monaco.Range);
20
- const position = getRevealPositionForViewer(range.startLineNumber, range.startColumn);
21
- editor2.revealPositionInCenter(position);
22
- editor2.deltaDecorations(
27
+ const handleEditorDidMount = (editor, monaco) => {
28
+ editorRef.current = editor;
29
+ const range = getSelectionRange(
30
+ { start, end },
31
+ monaco.Range
32
+ );
33
+ const position = getRevealPositionForViewer(
34
+ range.startLineNumber,
35
+ range.startColumn
36
+ );
37
+ editor.revealPositionInCenter(position);
38
+ editor.deltaDecorations(
23
39
  [],
24
40
  [
25
41
  {
@@ -7,6 +7,7 @@ interface CodeViewerProps {
7
7
  defaultLine?: number;
8
8
  ranges?: SDK.SourceRange[];
9
9
  editorConfig?: editor.IStandaloneEditorConstructionOptions;
10
+ emptyReason?: string;
10
11
  }
11
12
  export declare const CodeViewer: React.FC<CodeViewerProps>;
12
13
  export declare const CodeViewerWithDrawer: React.FC<CodeViewerProps>;
@@ -5,7 +5,15 @@ import { CodepenCircleOutlined } from "@ant-design/icons";
5
5
  import { getOriginalLanguage, getSelectionRange } from "../../utils";
6
6
  import { DefaultEditorConfig } from "./config";
7
7
  import { TextDrawer } from "../TextDrawer";
8
- const CodeViewer = ({ content, ranges, path, defaultLine, editorConfig = {} }) => {
8
+ import { Empty } from "antd";
9
+ const CodeViewer = ({
10
+ content,
11
+ ranges,
12
+ path,
13
+ defaultLine,
14
+ editorConfig = {},
15
+ emptyReason
16
+ }) => {
9
17
  const handleEditorDidMount = (editor, monaco) => {
10
18
  if (isNumber(defaultLine)) {
11
19
  editor.revealLine(defaultLine);
@@ -22,7 +30,7 @@ const CodeViewer = ({ content, ranges, path, defaultLine, editorConfig = {} }) =
22
30
  );
23
31
  }
24
32
  };
25
- return /* @__PURE__ */ jsx(
33
+ return content ? /* @__PURE__ */ jsx(
26
34
  Editor,
27
35
  {
28
36
  theme: "vs-dark",
@@ -33,7 +41,7 @@ const CodeViewer = ({ content, ranges, path, defaultLine, editorConfig = {} }) =
33
41
  options: { ...DefaultEditorConfig, ...editorConfig },
34
42
  onMount: handleEditorDidMount
35
43
  }
36
- );
44
+ ) : /* @__PURE__ */ jsx(Empty, { description: emptyReason });
37
45
  };
38
46
  const CodeViewerWithDrawer = (props) => {
39
47
  return /* @__PURE__ */ jsx(
@@ -1,7 +1,7 @@
1
1
  import { Manifest } from '@rsdoctor/types';
2
2
  import React from 'react';
3
3
  export declare const Menus: React.FC<Omit<{
4
- style?: React.CSSProperties | undefined;
4
+ style?: React.CSSProperties;
5
5
  routes: Manifest.RsdoctorManifestClientRoutes[];
6
6
  }, "routes"> & Partial<{
7
7
  body?: any;
@@ -1,12 +1,29 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import React, { useCallback, useMemo, useRef, useState } from "react";
3
3
  import { endsWith, get, sumBy } from "lodash-es";
4
- import { Card, Col, Descriptions, Divider, Drawer, Row, Space, Table, Tooltip, Typography } from "antd";
4
+ import {
5
+ Card,
6
+ Col,
7
+ Descriptions,
8
+ Divider,
9
+ Drawer,
10
+ Row,
11
+ Space,
12
+ Table,
13
+ Tooltip,
14
+ Typography
15
+ } from "antd";
5
16
  import { CloseCircleOutlined } from "@ant-design/icons";
6
17
  import { Constants, SDK } from "@rsdoctor/types";
7
18
  import { ServerAPIProvider } from "../../Manifest";
8
19
  import { drawerWidth, Size } from "../../../constants";
9
- import { createFileStructures, formatCosts, mapFileKey, filterLoader, useMonacoEditor } from "../../../utils";
20
+ import {
21
+ createFileStructures,
22
+ formatCosts,
23
+ mapFileKey,
24
+ filterLoader,
25
+ useMonacoEditor
26
+ } from "../../../utils";
10
27
  import { LoaderExecutions } from "../executions";
11
28
  import { FileTree } from "../../FileTree";
12
29
  import { Keyword } from "../../Keyword";
@@ -22,9 +39,13 @@ const LoaderFiles = (props) => {
22
39
  const init = useCallback(async () => {
23
40
  await initMonaco(monacoRef);
24
41
  }, []);
25
- const maxHeight = 700;
42
+ const maxHeight = 800;
26
43
  const filteredFiles = useMemo(
27
- () => filetree.filter((e) => e.loaders.some((l) => filterLoader(e.path, l.loader, props.filename, props.loaders))),
44
+ () => filetree.filter(
45
+ (e) => e.loaders.some(
46
+ (l) => filterLoader(e.path, l.loader, props.filename, props.loaders)
47
+ )
48
+ ),
28
49
  [props.filename, props.loaders]
29
50
  );
30
51
  const inlinedResourcePathKey = "__RESOURCEPATH__";
@@ -69,7 +90,14 @@ const LoaderFiles = (props) => {
69
90
  setDrawerVisible(true);
70
91
  },
71
92
  children: [
72
- /* @__PURE__ */ jsx(Typography.Text, { style: { maxWidth: 135, color: "inherit" }, ellipsis: true, children: e.loader }),
93
+ /* @__PURE__ */ jsx(
94
+ Typography.Text,
95
+ {
96
+ style: { maxWidth: 135, color: "inherit" },
97
+ ellipsis: true,
98
+ children: e.loader
99
+ }
100
+ ),
73
101
  /* @__PURE__ */ jsx(Divider, { type: "vertical" }),
74
102
  isError ? /* @__PURE__ */ jsx(CloseCircleOutlined, {}) : /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: formatCosts(e.costs) })
75
103
  ]
@@ -93,16 +121,20 @@ const LoaderFiles = (props) => {
93
121
  "Total Files: ",
94
122
  filteredFiles.length
95
123
  ] }),
96
- bodyStyle: { overflow: "scroll", maxHeight },
124
+ bodyStyle: { overflow: "scroll", maxHeight, height: "40rem" },
97
125
  children: [
98
126
  /* @__PURE__ */ jsx(
99
127
  FileTree,
100
128
  {
101
- defaultExpandedKeys: mapFileKey(files, filteredFiles.length >= 100 ? 3 : 4, (node) => {
102
- const resourcePath2 = get(node, inlinedResourcePathKey);
103
- const isNodeModules = resourcePath2.indexOf("/node_modules/") > -1;
104
- return !isNodeModules;
105
- }),
129
+ defaultExpandedKeys: mapFileKey(
130
+ files,
131
+ filteredFiles.length >= 100 ? 3 : 4,
132
+ (node) => {
133
+ const resourcePath2 = get(node, inlinedResourcePathKey);
134
+ const isNodeModules = resourcePath2.indexOf("/node_modules/") > -1;
135
+ return !isNodeModules;
136
+ }
137
+ ),
106
138
  treeData: files,
107
139
  onSelect: (_e, info) => {
108
140
  init();
@@ -124,7 +156,14 @@ const LoaderFiles = (props) => {
124
156
  width: drawerWidth,
125
157
  zIndex: 999,
126
158
  bodyStyle: { padding: 0 },
127
- children: drawerVisible ? /* @__PURE__ */ jsx(ServerAPIProvider, { api: SDK.ServerAPI.API.GetLoaderFileDetails, body: { path: resourcePath }, children: (data) => /* @__PURE__ */ jsx(LoaderExecutions, { data, cwd, index: loaderIndex }) }) : null
159
+ children: drawerVisible ? /* @__PURE__ */ jsx(
160
+ ServerAPIProvider,
161
+ {
162
+ api: SDK.ServerAPI.API.GetLoaderFileDetails,
163
+ body: { path: resourcePath },
164
+ children: (data) => /* @__PURE__ */ jsx(LoaderExecutions, { data, cwd, index: loaderIndex })
165
+ }
166
+ ) : null
128
167
  }
129
168
  )
130
169
  ]
@@ -136,7 +175,10 @@ const LoaderFiles = (props) => {
136
175
  title: /* @__PURE__ */ jsx(
137
176
  Tooltip,
138
177
  {
139
- title: React.cloneElement(selectedNode.title, { style: { color: "#fff" } }),
178
+ title: React.cloneElement(
179
+ selectedNode.title,
180
+ { style: { color: "#fff" } }
181
+ ),
140
182
  children: /* @__PURE__ */ jsxs(Typography.Text, { children: [
141
183
  'Statistics of "',
142
184
  selectedNode.title,
@@ -152,7 +194,13 @@ const LoaderFiles = (props) => {
152
194
  children: (tableData) => /* @__PURE__ */ jsx(
153
195
  Table,
154
196
  {
155
- style: { width: "100%", maxHeight, overflowY: "scroll", wordBreak: "break-all" },
197
+ style: {
198
+ width: "100%",
199
+ maxHeight,
200
+ height: "40rem",
201
+ overflowY: "scroll",
202
+ wordBreak: "break-all"
203
+ },
156
204
  pagination: false,
157
205
  bordered: true,
158
206
  rowKey: (e) => e.loader,
@@ -175,11 +223,20 @@ const LoaderFiles = (props) => {
175
223
  }
176
224
  ],
177
225
  dataSource: tableData,
178
- footer: () => /* @__PURE__ */ jsxs(Descriptions, { title: "Total", bordered: true, layout: "vertical", size: "small", children: [
179
- /* @__PURE__ */ jsx(Descriptions.Item, { label: "loaders", children: tableData.length }),
180
- /* @__PURE__ */ jsx(Descriptions.Item, { label: "files", children: sumBy(tableData, (e) => e.files) }),
181
- /* @__PURE__ */ jsx(Descriptions.Item, { label: "duration", children: /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: formatCosts(sumBy(tableData, (e) => e.costs)) }) })
182
- ] })
226
+ footer: () => /* @__PURE__ */ jsxs(
227
+ Descriptions,
228
+ {
229
+ title: "Total",
230
+ bordered: true,
231
+ layout: "vertical",
232
+ size: "small",
233
+ children: [
234
+ /* @__PURE__ */ jsx(Descriptions.Item, { label: "loaders", children: tableData.length }),
235
+ /* @__PURE__ */ jsx(Descriptions.Item, { label: "files", children: sumBy(tableData, (e) => e.files) }),
236
+ /* @__PURE__ */ jsx(Descriptions.Item, { label: "duration", children: /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: formatCosts(sumBy(tableData, (e) => e.costs)) }) })
237
+ ]
238
+ }
239
+ )
183
240
  }
184
241
  )
185
242
  }
@@ -7,8 +7,22 @@ import { LoaderCommonSelect } from "../../Select";
7
7
  const LoaderAnalysisBase = ({ cwd }) => {
8
8
  const [store, setStore] = useState({ filename: "", loaders: [] });
9
9
  return /* @__PURE__ */ jsxs("div", { children: [
10
- /* @__PURE__ */ jsx(ServerAPIProvider, { api: SDK.ServerAPI.API.GetLoaderNames, children: (loaderNames) => /* @__PURE__ */ jsx(LoaderCommonSelect, { onChange: (e) => setStore(e), loaderNames }) }),
11
- /* @__PURE__ */ jsx(ServerAPIProvider, { api: SDK.ServerAPI.API.GetLoaderFileTree, children: (filetree) => /* @__PURE__ */ jsx(LoaderFiles, { filename: store.filename, filetree, loaders: store.loaders, cwd }) })
10
+ /* @__PURE__ */ jsx(ServerAPIProvider, { api: SDK.ServerAPI.API.GetLoaderNames, children: (loaderNames) => /* @__PURE__ */ jsx(
11
+ LoaderCommonSelect,
12
+ {
13
+ onChange: (e) => setStore(e),
14
+ loaderNames
15
+ }
16
+ ) }),
17
+ /* @__PURE__ */ jsx(ServerAPIProvider, { api: SDK.ServerAPI.API.GetLoaderFileTree, children: (filetree) => /* @__PURE__ */ jsx(
18
+ LoaderFiles,
19
+ {
20
+ filename: store.filename,
21
+ filetree,
22
+ loaders: store.loaders,
23
+ cwd
24
+ }
25
+ ) })
12
26
  ] });
13
27
  };
14
28
  const LoaderAnalysis = withServerAPI({
@@ -5,5 +5,5 @@ interface LoaderExecutionsProps {
5
5
  data: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderFileDetails>;
6
6
  index?: number;
7
7
  }
8
- export declare const LoaderExecutions: ({ data, cwd, index }: PropsWithChildren<LoaderExecutionsProps>) => JSX.Element;
8
+ export declare const LoaderExecutions: ({ data, cwd, index, }: PropsWithChildren<LoaderExecutionsProps>) => JSX.Element;
9
9
  export {};