@rsdoctor/components 1.5.12 → 1.5.13

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/Alerts/collapse-cjs-require.d.ts +1 -1
  2. package/dist/components/Alerts/collapse-cross-chunks.d.ts +1 -1
  3. package/dist/components/Alerts/collapse-esm-cjs.d.ts +1 -1
  4. package/dist/components/Alerts/collapse-module-mixed-chunks.d.ts +1 -1
  5. package/dist/components/Alerts/collapse-shared.d.ts +2 -2
  6. package/dist/components/Alerts/collapse-side-effects-only-imports.d.ts +1 -1
  7. package/dist/components/Alerts/collapse.d.ts +1 -1
  8. package/dist/components/Alerts/list.d.ts +1 -1
  9. package/dist/components/FileTree/index.d.ts +1 -1
  10. package/dist/components/Overall/DataSummary.d.ts +1 -1
  11. package/dist/components/Overall/help-center.d.ts +1 -1
  12. package/dist/components/Overall/overview.d.ts +1 -1
  13. package/dist/components/base/CodeViewer/index.d.ts +1 -1
  14. package/dist/components/base/CodeViewer/useCodeDrawer.d.ts +1 -1
  15. package/dist/components/base/DiffViewer/index.d.ts +1 -1
  16. package/dist/components/base/DiffViewer/useDiffDrawer.d.ts +1 -1
  17. package/dist/pages/BundleSize/components/asset.mjs +390 -323
  18. package/dist/pages/BundleSize/components/asset.mjs.map +1 -1
  19. package/dist/pages/BundleSize/components/asset.module.mjs +16 -0
  20. package/dist/pages/BundleSize/components/asset.module.mjs.map +1 -0
  21. package/dist/pages/BundleSize/components/asset_module.css +103 -0
  22. package/dist/pages/BundleSize/components/asset_module.css.map +1 -0
  23. package/dist/pages/BundleSize/components/index.mjs +3 -0
  24. package/dist/pages/BundleSize/components/index.mjs.map +1 -1
  25. package/dist/pages/BundleSize/components/index.module.mjs +0 -7
  26. package/dist/pages/BundleSize/components/index.module.mjs.map +1 -1
  27. package/dist/pages/BundleSize/components/index_module.css +0 -61
  28. package/dist/pages/BundleSize/components/index_module.css.map +1 -1
  29. package/dist/pages/Overall/responsiveLayout.d.ts +1 -1
  30. package/dist/pages/Resources/BundleDiff/DiffContainer/utils.d.ts +1 -1
  31. package/dist/pages/TreeShaking/editor.d.ts +1 -1
  32. package/dist/pages/TreeShaking/space.d.ts +1 -1
  33. package/dist/utils/file.d.ts +1 -1
  34. package/dist/utils/hooks.d.ts +4 -0
  35. package/dist/utils/hooks.mjs +42 -3
  36. package/dist/utils/hooks.mjs.map +1 -1
  37. package/package.json +13 -12
@@ -29,39 +29,6 @@
29
29
  margin-right: 4px;
30
30
  }
31
31
 
32
- .bundle-tree-IbtEQg {
33
- display: flex;
34
- }
35
-
36
- .bundle-tree-IbtEQg span.ant-tag {
37
- margin: none;
38
- margin-inline-end: 0;
39
- }
40
-
41
- .box-On1BLb {
42
- width: 100%;
43
- height: 30px;
44
- display: flex;
45
- }
46
-
47
- .box-On1BLb .keyword-PqQzB1 {
48
- flex: none;
49
- padding-right: 5px;
50
- }
51
-
52
- .divider-asnppW {
53
- border-color: #0000001f;
54
- position: relative;
55
- bottom: 20%;
56
- }
57
-
58
- .dividerDiv-s50mAr {
59
- flex-grow: 1;
60
- margin: 0 10px;
61
- position: relative;
62
- bottom: 10%;
63
- }
64
-
65
32
  .assetsTag-eAVvyj {
66
33
  height: 30px;
67
34
  }
@@ -70,34 +37,6 @@
70
37
  margin-inline: 0;
71
38
  }
72
39
 
73
- .bundle-cPw2Kc {
74
- font-size: 14px;
75
- }
76
-
77
- .bundle-cPw2Kc .rc-tree-node-content-wrapper {
78
- font-size: 14px;
79
- }
80
-
81
- .bundle-cPw2Kc .file-icon {
82
- margin-left: 0;
83
- }
84
-
85
- .bundle-cPw2Kc .ant-tree-indent-unit {
86
- width: 10px;
87
- }
88
-
89
- .bundle-cPw2Kc .ant-tree-iconEle {
90
- margin-right: 2px;
91
- }
92
-
93
- .bundle-cPw2Kc .ant-tree-node-content-wrapper-open {
94
- display: flex;
95
- }
96
-
97
- .bundle-cPw2Kc .ant-tree-node-content-wrapper-close {
98
- display: flex;
99
- }
100
-
101
40
  .modal-afyzYa .ant-input-affix-wrapper {
102
41
  width: 490px;
103
42
  padding: 4px 5px;
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://./src/pages/BundleSize/components/index.module.scss"],"names":[],"mappings":"AAAA;EACE,WAAW;AACb;;AAFgD;EAK9C,4BAA4B;AAC9B;;AAN8G;EAS5G,kBAAkB;EAClB,WAAW;AACb;;AAX0Q;EAcxQ,eAAe;AACjB;;AAfoa;EAkBla,cAAc;EACd,iBAAiB;AACnB;;AApB6jB;EAuB3jB,mBAAmB;EACnB,aAAa;AACf;;AAzB+mB;EA4B7mB,iBAAiB;AACnB;;AA7B4pB;EAgC1pB,aAAa;AACf;;AAjCsrB;EAoCprB,YAAY;EACZ,oBAAoB;AACtB;;AAtC0vB;EAyCxvB,WAAW;EACX,YAAY;EACZ,aAAa;AACf;;AA5CmyB;EA+CjyB,UAAU;EACV,kBAAkB;AACpB;;AAjD+0B;EAoD70B,uBAAuB;EACvB,kBAAkB;EAClB,WAAW;AACb;;AAvDk5B;EA0Dh5B,YAAY;EACZ,cAAc;EACd,kBAAkB;EAClB,WAAW;AACb;;AA9Dq9B;EAiEn9B,YAAY;AACd;;AAlE4+B;EAqE1+B,gBAAgB;AAClB;;AAtEqiC;EAyEniC,eAAe;AACjB;;AA1EokC;EA6ElkC,eAAe;AACjB;;AA9EioC;EAiF/nC,cAAc;AAChB;;AAlF0qC;EAqFxqC,WAAW;AACb;;AAtF2tC;EAyFztC,iBAAiB;AACnB;;AA1F8wC;EA6F5wC,aAAa;AACf;;AA9F+0C;EAiG70C,aAAa;AACf;;AAlGi5C;EAqG/4C,YAAY;EACZ,gBAAgB;AAClB;;AAvGq9C;EA0Gn9C,WAAW;AACb;;AA3G4+C;EA8G1+C,kBAAkB;AACpB;;AA/G+gD;EAkH7gD,WAAW;EACX,UAAU;EACV,sBAAsB;EACtB,qDAAqD;EACrD,mBAAmB;EACnB,kBAAkB;EAClB,WAAW;AACb;;AAzHmrD;EA4HjrD,UAAU;AACZ;;AA7HutD;EAgIrtD,iBAAiB;EACjB,cAAc;AAChB;;AAlIqyD;EAqInyD,eAAe;EACf,sBAAsB;AACxB","sourcesContent":[".assets :global .rc-tree-indent-unit{width:22px}.assets :global .rc-tree-treenode{line-height:30px !important}.assets :global .rc-tree-treenode:not(.rc-tree-treenode-switcher-open):not(.rc-tree-treenode-switcher-close) .rc-tree-switcher{position:relative;bottom:4px}.assets :global .rc-tree-treenode:not(.rc-tree-treenode-switcher-open):not(.rc-tree-treenode-switcher-close) .rc-tree-node-content-wrapper{font-size:14px}.assets :global .rc-tree-treenode:not(.rc-tree-treenode-switcher-open):not(.rc-tree-treenode-switcher-close) .file-icon{padding:10px 0 0 0;margin-left:0}.assets .assetBox{display:flex;align-items:center}.assets .assetBox .fileText{margin-right:4px}.bundle-tree{display:flex}.bundle-tree :global span.ant-tag{margin:none;margin-inline-end:0px}.box{display:flex;height:30px;width:100%}.box .keyword{flex:0 0 auto;padding-right:5}.divider{border-color:rgba(0,0,0,.12);position:relative;bottom:20%}.dividerDiv{flex-grow:1;margin:0 10px;bottom:10%;position:relative}.assetsTag{height:30px}.assetsTag :global .ant-divider-vertical{margin-inline:0}.bundle :global{font-size:14px}.bundle :global .rc-tree-node-content-wrapper{font-size:14px}.bundle :global .file-icon{margin-left:0}.bundle :global .ant-tree-indent-unit{width:10px}.bundle :global .ant-tree-iconEle{margin-right:2px}.bundle :global .ant-tree-node-content-wrapper-open{display:flex}.bundle :global .ant-tree-node-content-wrapper-close{display:flex}.modal :global .ant-input-affix-wrapper{padding:4px 5px;width:490px}.search-btn{color:#fff}.search-btn>span{position:relative}.search-btn::before{content:\"\";background:linear-gradient(135deg, #6253e1, #04befe);position:absolute;inset:-1px;opacity:1;transition:all .3s;border-radius:inherit}.search-btn:hover::before{opacity:0}.search-modal-list :global .ant-spin-container{overflow:auto;max-height:30rem}.search-modal-list :global .search-list-item.clickable:hover{background-color:#eee;cursor:pointer}"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack://./src/pages/BundleSize/components/index.module.scss"],"names":[],"mappings":"AAAA;EACE,WAAW;AACb;;AAFgD;EAK9C,4BAA4B;AAC9B;;AAN8G;EAS5G,kBAAkB;EAClB,WAAW;AACb;;AAX0Q;EAcxQ,eAAe;AACjB;;AAfoa;EAkBla,cAAc;EACd,iBAAiB;AACnB;;AApB6jB;EAuB3jB,mBAAmB;EACnB,aAAa;AACf;;AAzB+mB;EA4B7mB,iBAAiB;AACnB;;AA7B4pB;EAgC1pB,YAAY;AACd;;AAjCmrB;EAoCjrB,gBAAgB;AAClB;;AArC4uB;EAwC1uB,YAAY;EACZ,gBAAgB;AAClB;;AA1CgzB;EA6C9yB,WAAW;AACb;;AA9Cu0B;EAiDr0B,kBAAkB;AACpB;;AAlD02B;EAqDx2B,WAAW;EACX,UAAU;EACV,sBAAsB;EACtB,qDAAqD;EACrD,mBAAmB;EACnB,kBAAkB;EAClB,WAAW;AACb;;AA5D8gC;EA+D5gC,UAAU;AACZ;;AAhEkjC;EAmEhjC,iBAAiB;EACjB,cAAc;AAChB;;AArEgoC;EAwE9nC,eAAe;EACf,sBAAsB;AACxB","sourcesContent":[".assets :global .rc-tree-indent-unit{width:22px}.assets :global .rc-tree-treenode{line-height:30px !important}.assets :global .rc-tree-treenode:not(.rc-tree-treenode-switcher-open):not(.rc-tree-treenode-switcher-close) .rc-tree-switcher{position:relative;bottom:4px}.assets :global .rc-tree-treenode:not(.rc-tree-treenode-switcher-open):not(.rc-tree-treenode-switcher-close) .rc-tree-node-content-wrapper{font-size:14px}.assets :global .rc-tree-treenode:not(.rc-tree-treenode-switcher-open):not(.rc-tree-treenode-switcher-close) .file-icon{padding:10px 0 0 0;margin-left:0}.assets .assetBox{display:flex;align-items:center}.assets .assetBox .fileText{margin-right:4px}.assetsTag{height:30px}.assetsTag :global .ant-divider-vertical{margin-inline:0}.modal :global .ant-input-affix-wrapper{padding:4px 5px;width:490px}.search-btn{color:#fff}.search-btn>span{position:relative}.search-btn::before{content:\"\";background:linear-gradient(135deg, #6253e1, #04befe);position:absolute;inset:-1px;opacity:1;transition:all .3s;border-radius:inherit}.search-btn:hover::before{opacity:0}.search-modal-list :global .ant-spin-container{overflow:auto;max-height:30rem}.search-modal-list :global .search-list-item.clickable:hover{background-color:#eee;cursor:pointer}"],"sourceRoot":""}
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  interface Props {
3
3
  children: React.ReactNode[];
4
4
  }
5
- export declare const ResponsiveLayout: ({ children }: Props) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const ResponsiveLayout: ({ children }: Props) => React.JSX.Element;
6
6
  export {};
@@ -1,2 +1,2 @@
1
1
  import { Client } from '@rsdoctor/types';
2
- export declare const formatDiffSize: (bSize: number, cSize: number, state: Client.RsdoctorClientDiffState, propsStyle?: Record<string, string | number>) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const formatDiffSize: (bSize: number, cSize: number, state: Client.RsdoctorClientDiffState, propsStyle?: Record<string, string | number>) => import("react").JSX.Element;
@@ -8,4 +8,4 @@ export interface CodeEditorProps {
8
8
  source: SDK.ModuleSource;
9
9
  toLine?: number;
10
10
  }
11
- export declare function CodeEditor(props: CodeEditorProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function CodeEditor(props: CodeEditorProps): import("react").JSX.Element;
@@ -1 +1 @@
1
- export declare function Space(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function Space(): import("react").JSX.Element;
@@ -30,7 +30,7 @@ export declare function beautifyModulePath(modulePath: string, cwd: string): {
30
30
  alias: string;
31
31
  inNodeModules: boolean;
32
32
  };
33
- export declare function getFileIcon(props: TreeNodeProps, addRowIcon?: boolean): import("react/jsx-runtime").JSX.Element;
33
+ export declare function getFileIcon(props: TreeNodeProps, addRowIcon?: boolean): import("react").JSX.Element;
34
34
  type TreeNode = {
35
35
  name: string;
36
36
  value?: number;
@@ -28,3 +28,7 @@ export declare function useDuplicatePackagesByErrors(errors: Manifest.RsdoctorMa
28
28
  export declare function useWebpackConfigurationByConfigs(configs?: SDK.ConfigData): SDK.WebpackConfigData | null | undefined;
29
29
  export declare function useDetectIfCloudIdeEnv(): boolean;
30
30
  export declare function useWindowWidth(): number;
31
+ export declare function useElementSize<T extends HTMLElement = HTMLDivElement>(): readonly [import("react").RefObject<T | null>, {
32
+ readonly width: number;
33
+ readonly height: number;
34
+ }];
@@ -1,7 +1,7 @@
1
1
  import { Algorithm } from "@rsdoctor/utils/common";
2
2
  import { Client, Rule } from "@rsdoctor/types";
3
- import { defaults, uniqBy } from "es-toolkit/compat";
4
- import { useEffect, useMemo, useState } from "react";
3
+ import { defaults, throttle, uniqBy } from "es-toolkit/compat";
4
+ import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
5
5
  import { useTranslation } from "react-i18next";
6
6
  import { useLocation, useNavigate } from "react-router-dom";
7
7
  import url_parse from "url-parse";
@@ -161,6 +161,45 @@ function useWindowWidth() {
161
161
  }, []);
162
162
  return windowWidth;
163
163
  }
164
- export { useBundleAlertsByErrors, useBundleAlertsByManifest, useChunkGraphByManifest, useCloudManifestUrlByManifest, useCompileAlertsByErrors, useConfigOutputFileNameByManifest, useDetectIfCloudIdeEnv, useDuplicatePackagesByErrors, useDuplicatePackagesByManifest, useErrorsByManifest, useHashByManifest, useI18n, useLoading, useModuleGraph, useModuleGraphByManifest, usePackageGraphByManifest, useProjectRootByManifest, useRuleIndexNavigate, useUniqModules, useUniqModulesByManifest, useUrlQuery, useWebpackConfigurationByConfigs, useWindowWidth };
164
+ function useElementSize() {
165
+ const ref = useRef(null);
166
+ const [width, setWidth_] = useState(0);
167
+ const [height, setHeight_] = useState(0);
168
+ useLayoutEffect(()=>{
169
+ const $el = ref.current;
170
+ if (!$el) return;
171
+ const setWidth = (n)=>setWidth_(Math.ceil(n));
172
+ const setHeight = (n)=>setHeight_(Math.ceil(n));
173
+ const initialRect = $el.getBoundingClientRect();
174
+ setWidth(initialRect.width);
175
+ setHeight(initialRect.height);
176
+ const onResize = throttle((entries)=>{
177
+ const entry = entries[0];
178
+ if (!entry) return;
179
+ const borderBox = entry.borderBoxSize?.[0];
180
+ if (borderBox) {
181
+ setWidth(borderBox.inlineSize);
182
+ setHeight(borderBox.blockSize);
183
+ } else {
184
+ setWidth(entry.contentRect.width);
185
+ setHeight(entry.contentRect.height);
186
+ }
187
+ }, 100);
188
+ const observer = new ResizeObserver(onResize);
189
+ observer.observe($el);
190
+ return ()=>{
191
+ observer.disconnect();
192
+ onResize.cancel();
193
+ };
194
+ }, []);
195
+ return [
196
+ ref,
197
+ {
198
+ width,
199
+ height
200
+ }
201
+ ];
202
+ }
203
+ export { useBundleAlertsByErrors, useBundleAlertsByManifest, useChunkGraphByManifest, useCloudManifestUrlByManifest, useCompileAlertsByErrors, useConfigOutputFileNameByManifest, useDetectIfCloudIdeEnv, useDuplicatePackagesByErrors, useDuplicatePackagesByManifest, useElementSize, useErrorsByManifest, useHashByManifest, useI18n, useLoading, useModuleGraph, useModuleGraphByManifest, usePackageGraphByManifest, useProjectRootByManifest, useRuleIndexNavigate, useUniqModules, useUniqModulesByManifest, useUrlQuery, useWebpackConfigurationByConfigs, useWindowWidth };
165
204
 
166
205
  //# sourceMappingURL=hooks.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils/hooks.mjs","sources":["../../src/utils/hooks.ts"],"sourcesContent":["import { Algorithm } from '@rsdoctor/utils/common';\nimport { Client, Manifest, Rule, SDK } from '@rsdoctor/types';\nimport { uniqBy, defaults } from 'es-toolkit/compat';\nimport { useEffect, useMemo, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useNavigate, useLocation } from 'react-router-dom';\nimport parse from 'url-parse';\n\nimport './i18n';\nimport { Language } from '../constants';\nimport { setLocaleToStorage } from './storage';\n\nconst route = Client.RsdoctorClientRoutes.RuleIndex;\n\nexport const useI18n: typeof useTranslation = () => {\n const { i18n, ...rest } = useTranslation();\n\n return {\n ...rest,\n i18n: {\n ...i18n,\n changeLanguage(lng, callback) {\n return i18n.changeLanguage(lng, (error, t) => {\n if (!error) {\n setLocaleToStorage(lng as Language);\n }\n if (callback) {\n callback(error, t);\n }\n });\n },\n },\n };\n};\n\nexport function useRuleIndexNavigate(code: string, link?: string | undefined) {\n const navigate = useNavigate();\n\n if (link) {\n return () => window.open(link, '__blank');\n }\n\n return () => {\n navigate(\n `${route}?${Rule.RsdoctorRuleClientConstant.UrlQueryForErrorCode}=${code}`,\n );\n };\n}\n\nexport function useUrlQuery() {\n const search = useLocation().search || location.search;\n\n return useMemo(() => parse(search, true).query, [search]);\n}\n\nexport function useLoading(defaultLoading = false) {\n const [loading, setLoading] = useState<boolean>(defaultLoading);\n\n return {\n loading,\n setLoading,\n async withLoading(\n func: (...args: unknown[]) => Promise<unknown> | unknown,\n ) {\n try {\n setLoading(true);\n await func();\n } finally {\n setLoading(false);\n }\n },\n };\n}\n\nexport function useProjectRootByManifest(manifest: Manifest.RsdoctorManifest) {\n return manifest.data.root;\n}\n\nexport function useHashByManifest(manifest: Manifest.RsdoctorManifest) {\n return manifest.data.hash;\n}\n\nexport function useCloudManifestUrlByManifest(\n manifest:\n | Manifest.RsdoctorManifest\n | Manifest.RsdoctorManifestWithShardingFiles\n | void,\n) {\n if (!manifest) return;\n}\n\nfunction ensurePlainObject<T extends object>(value: T, dfts: T): T {\n if (value && typeof value === 'object') {\n if (Array.isArray(value)) {\n return dfts;\n }\n return defaults(value, dfts);\n }\n\n return dfts;\n}\n\nexport function useChunkGraphByManifest(manifest: Manifest.RsdoctorManifest) {\n const prev = manifest.data.chunkGraph;\n if (typeof prev === 'string') {\n manifest.data.chunkGraph = JSON.parse(\n Algorithm.decompressText(prev as string),\n );\n }\n\n return ensurePlainObject(manifest.data.chunkGraph, {\n assets: [],\n chunks: [],\n entrypoints: [],\n });\n}\n\nexport function useConfigOutputFileNameByManifest(\n manifest: Manifest.RsdoctorManifest,\n) {\n if (\n typeof manifest.data.configs?.[0]?.config?.output?.filename === 'string'\n ) {\n return manifest.data.configs?.[0]?.config?.output?.filename;\n }\n return '';\n}\n\nexport function useModuleGraphByManifest(manifest: Manifest.RsdoctorManifest) {\n const prev = manifest.data.moduleGraph;\n if (typeof prev === 'string') {\n manifest.data.moduleGraph = JSON.parse(\n Algorithm.decompressText(prev as string),\n );\n }\n\n return ensurePlainObject(manifest.data.moduleGraph, {\n dependencies: [],\n modules: [],\n moduleGraphModules: [],\n exports: [],\n sideEffects: [],\n variables: [],\n });\n}\n\nexport function useModuleGraph(moduleGraph: SDK.ModuleGraphData) {\n const prev = moduleGraph;\n if (typeof prev === 'string') {\n moduleGraph = JSON.parse(Algorithm.decompressText(prev as string));\n }\n\n return ensurePlainObject(moduleGraph, {\n dependencies: [],\n modules: [],\n moduleGraphModules: [],\n exports: [],\n sideEffects: [],\n variables: [],\n });\n}\n\nexport function usePackageGraphByManifest(manifest: Manifest.RsdoctorManifest) {\n const prev = manifest.data.packageGraph;\n if (typeof prev === 'string') {\n manifest.data.packageGraph = JSON.parse(\n Algorithm.decompressText(prev as string),\n );\n }\n return ensurePlainObject(manifest.data.packageGraph, {\n packages: [],\n dependencies: [],\n });\n}\n\nexport function useUniqModulesByManifest(manifest: Manifest.RsdoctorManifest) {\n return uniqBy(useModuleGraphByManifest(manifest).modules, (e) => e.path);\n}\n\nexport function useUniqModules(modules: SDK.ModuleData[]) {\n return uniqBy(modules, (e) => e.path);\n}\n\nexport function useErrorsByManifest(manifest: Manifest.RsdoctorManifest) {\n const prev = manifest.data.errors;\n if (typeof prev === 'string') {\n manifest.data.errors = JSON.parse(Algorithm.decompressText(prev as string));\n }\n return manifest.data.errors || [];\n}\n\nexport function useBundleAlertsByManifest(manifest: Manifest.RsdoctorManifest) {\n const errors = useErrorsByManifest(manifest);\n return useBundleAlertsByErrors(errors);\n}\n\nexport function useDuplicatePackagesByManifest(\n manifest: Manifest.RsdoctorManifest,\n): Rule.PackageRelationDiffRuleStoreData[] {\n const alerts = useBundleAlertsByManifest(manifest);\n return useDuplicatePackagesByErrors(alerts);\n}\n\nexport function useCompileAlertsByErrors(\n errors: Manifest.RsdoctorManifestData['errors'],\n) {\n if (Array.isArray(errors)) {\n return errors.filter(\n (e) =>\n e.category === Rule.RuleMessageCategory.Compile &&\n e.code !== Rule.RuleMessageCodeEnumerated.Overlay,\n );\n }\n return [];\n}\n\nexport function useBundleAlertsByErrors(\n errors: Manifest.RsdoctorManifestData['errors'],\n) {\n if (Array.isArray(errors)) {\n return errors.filter(\n (e) =>\n e.category === Rule.RuleMessageCategory.Bundle &&\n e.code !== Rule.RuleMessageCodeEnumerated.Overlay,\n );\n }\n return [];\n}\n\nexport function useDuplicatePackagesByErrors(\n errors: Manifest.RsdoctorManifestData['errors'],\n) {\n return useBundleAlertsByErrors(errors).filter(\n (e) => e.code === Rule.RuleErrorMap.E1001.code,\n ) as Rule.PackageRelationDiffRuleStoreData[];\n}\n\nexport function useWebpackConfigurationByConfigs(configs: SDK.ConfigData = []) {\n if (Array.isArray(configs)) {\n return configs.find((e) => e.name === 'webpack' || e.name === 'rspack');\n }\n return null;\n}\n\nexport function useDetectIfCloudIdeEnv() {\n if (\n window.location.protocol === 'https:' &&\n window.location.href.indexOf('ide-proxy') > 0\n ) {\n return true;\n }\n return false;\n}\n\nexport function useWindowWidth() {\n const [windowWidth, setWindowWidth] = useState(window.innerWidth);\n\n useEffect(() => {\n const handleResize = () => setWindowWidth(window.innerWidth);\n window.addEventListener('resize', handleResize);\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, []);\n\n return windowWidth;\n}\n"],"names":["route","Client","useI18n","i18n","rest","useTranslation","lng","callback","error","t","setLocaleToStorage","useRuleIndexNavigate","code","link","navigate","useNavigate","window","Rule","useUrlQuery","search","useLocation","location","useMemo","parse","useLoading","defaultLoading","loading","setLoading","useState","func","useProjectRootByManifest","manifest","useHashByManifest","useCloudManifestUrlByManifest","ensurePlainObject","value","dfts","Array","defaults","useChunkGraphByManifest","prev","JSON","Algorithm","useConfigOutputFileNameByManifest","useModuleGraphByManifest","useModuleGraph","moduleGraph","usePackageGraphByManifest","useUniqModulesByManifest","uniqBy","e","useUniqModules","modules","useErrorsByManifest","useBundleAlertsByManifest","errors","useBundleAlertsByErrors","useDuplicatePackagesByManifest","alerts","useDuplicatePackagesByErrors","useCompileAlertsByErrors","useWebpackConfigurationByConfigs","configs","useDetectIfCloudIdeEnv","useWindowWidth","windowWidth","setWindowWidth","useEffect","handleResize"],"mappings":";;;;;;;;;AAYA,MAAMA,QAAQC,OAAO,oBAAoB,CAAC,SAAS;AAE5C,MAAMC,UAAiC;IAC5C,MAAM,EAAEC,IAAI,EAAE,GAAGC,MAAM,GAAGC;IAE1B,OAAO;QACL,GAAGD,IAAI;QACP,MAAM;YACJ,GAAGD,IAAI;YACP,gBAAeG,GAAG,EAAEC,QAAQ;gBAC1B,OAAOJ,KAAK,cAAc,CAACG,KAAK,CAACE,OAAOC;oBACtC,IAAI,CAACD,OACHE,mBAAmBJ;oBAErB,IAAIC,UACFA,SAASC,OAAOC;gBAEpB;YACF;QACF;IACF;AACF;AAEO,SAASE,qBAAqBC,IAAY,EAAEC,IAAyB;IAC1E,MAAMC,WAAWC;IAEjB,IAAIF,MACF,OAAO,IAAMG,OAAO,IAAI,CAACH,MAAM;IAGjC,OAAO;QACLC,SACE,GAAGd,MAAM,CAAC,EAAEiB,KAAK,0BAA0B,CAAC,oBAAoB,CAAC,CAAC,EAAEL,MAAM;IAE9E;AACF;AAEO,SAASM;IACd,MAAMC,SAASC,cAAc,MAAM,IAAIC,SAAS,MAAM;IAEtD,OAAOC,QAAQ,IAAMC,UAAMJ,QAAQ,MAAM,KAAK,EAAE;QAACA;KAAO;AAC1D;AAEO,SAASK,WAAWC,iBAAiB,KAAK;IAC/C,MAAM,CAACC,SAASC,WAAW,GAAGC,SAAkBH;IAEhD,OAAO;QACLC;QACAC;QACA,MAAM,aACJE,IAAwD;YAExD,IAAI;gBACFF,WAAW;gBACX,MAAME;YACR,SAAU;gBACRF,WAAW;YACb;QACF;IACF;AACF;AAEO,SA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ils/hooks.ts"],"sourcesContent":["import { Algorithm } from '@rsdoctor/utils/common';\nimport { Client, Manifest, Rule, SDK } from '@rsdoctor/types';\nimport { uniqBy, defaults, throttle } from 'es-toolkit/compat';\nimport { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useNavigate, useLocation } from 'react-router-dom';\nimport parse from 'url-parse';\n\nimport './i18n';\nimport { Language } from '../constants';\nimport { setLocaleToStorage } from './storage';\n\nconst route = Client.RsdoctorClientRoutes.RuleIndex;\n\nexport const useI18n: typeof useTranslation = () => {\n const { i18n, ...rest } = useTranslation();\n\n return {\n ...rest,\n i18n: {\n ...i18n,\n changeLanguage(lng, callback) {\n return i18n.changeLanguage(lng, (error, t) => {\n if (!error) {\n setLocaleToStorage(lng as Language);\n }\n if (callback) {\n callback(error, t);\n }\n });\n },\n },\n };\n};\n\nexport function useRuleIndexNavigate(code: string, link?: string | undefined) {\n const navigate = useNavigate();\n\n if (link) {\n return () => window.open(link, '__blank');\n }\n\n return () => {\n navigate(\n `${route}?${Rule.RsdoctorRuleClientConstant.UrlQueryForErrorCode}=${code}`,\n );\n };\n}\n\nexport function useUrlQuery() {\n const search = useLocation().search || location.search;\n\n return useMemo(() => parse(search, true).query, [search]);\n}\n\nexport function useLoading(defaultLoading = false) {\n const [loading, setLoading] = useState<boolean>(defaultLoading);\n\n return {\n loading,\n setLoading,\n async withLoading(\n func: (...args: unknown[]) => Promise<unknown> | unknown,\n ) {\n try {\n setLoading(true);\n await func();\n } finally {\n setLoading(false);\n }\n },\n };\n}\n\nexport function useProjectRootByManifest(manifest: Manifest.RsdoctorManifest) {\n return manifest.data.root;\n}\n\nexport function useHashByManifest(manifest: Manifest.RsdoctorManifest) {\n return manifest.data.hash;\n}\n\nexport function useCloudManifestUrlByManifest(\n manifest:\n | Manifest.RsdoctorManifest\n | Manifest.RsdoctorManifestWithShardingFiles\n | void,\n) {\n if (!manifest) return;\n}\n\nfunction ensurePlainObject<T extends object>(value: T, dfts: T): T {\n if (value && typeof value === 'object') {\n if (Array.isArray(value)) {\n return dfts;\n }\n return defaults(value, dfts);\n }\n\n return dfts;\n}\n\nexport function useChunkGraphByManifest(manifest: Manifest.RsdoctorManifest) {\n const prev = manifest.data.chunkGraph;\n if (typeof prev === 'string') {\n manifest.data.chunkGraph = JSON.parse(\n Algorithm.decompressText(prev as string),\n );\n }\n\n return ensurePlainObject(manifest.data.chunkGraph, {\n assets: [],\n chunks: [],\n entrypoints: [],\n });\n}\n\nexport function useConfigOutputFileNameByManifest(\n manifest: Manifest.RsdoctorManifest,\n) {\n if (\n typeof manifest.data.configs?.[0]?.config?.output?.filename === 'string'\n ) {\n return manifest.data.configs?.[0]?.config?.output?.filename;\n }\n return '';\n}\n\nexport function useModuleGraphByManifest(manifest: Manifest.RsdoctorManifest) {\n const prev = manifest.data.moduleGraph;\n if (typeof prev === 'string') {\n manifest.data.moduleGraph = JSON.parse(\n Algorithm.decompressText(prev as string),\n );\n }\n\n return ensurePlainObject(manifest.data.moduleGraph, {\n dependencies: [],\n modules: [],\n moduleGraphModules: [],\n exports: [],\n sideEffects: [],\n variables: [],\n });\n}\n\nexport function useModuleGraph(moduleGraph: SDK.ModuleGraphData) {\n const prev = moduleGraph;\n if (typeof prev === 'string') {\n moduleGraph = JSON.parse(Algorithm.decompressText(prev as string));\n }\n\n return ensurePlainObject(moduleGraph, {\n dependencies: [],\n modules: [],\n moduleGraphModules: [],\n exports: [],\n sideEffects: [],\n variables: [],\n });\n}\n\nexport function usePackageGraphByManifest(manifest: Manifest.RsdoctorManifest) {\n const prev = manifest.data.packageGraph;\n if (typeof prev === 'string') {\n manifest.data.packageGraph = JSON.parse(\n Algorithm.decompressText(prev as string),\n );\n }\n return ensurePlainObject(manifest.data.packageGraph, {\n packages: [],\n dependencies: [],\n });\n}\n\nexport function useUniqModulesByManifest(manifest: Manifest.RsdoctorManifest) {\n return uniqBy(useModuleGraphByManifest(manifest).modules, (e) => e.path);\n}\n\nexport function useUniqModules(modules: SDK.ModuleData[]) {\n return uniqBy(modules, (e) => e.path);\n}\n\nexport function useErrorsByManifest(manifest: Manifest.RsdoctorManifest) {\n const prev = manifest.data.errors;\n if (typeof prev === 'string') {\n manifest.data.errors = JSON.parse(Algorithm.decompressText(prev as string));\n }\n return manifest.data.errors || [];\n}\n\nexport function useBundleAlertsByManifest(manifest: Manifest.RsdoctorManifest) {\n const errors = useErrorsByManifest(manifest);\n return useBundleAlertsByErrors(errors);\n}\n\nexport function useDuplicatePackagesByManifest(\n manifest: Manifest.RsdoctorManifest,\n): Rule.PackageRelationDiffRuleStoreData[] {\n const alerts = useBundleAlertsByManifest(manifest);\n return useDuplicatePackagesByErrors(alerts);\n}\n\nexport function useCompileAlertsByErrors(\n errors: Manifest.RsdoctorManifestData['errors'],\n) {\n if (Array.isArray(errors)) {\n return errors.filter(\n (e) =>\n e.category === Rule.RuleMessageCategory.Compile &&\n e.code !== Rule.RuleMessageCodeEnumerated.Overlay,\n );\n }\n return [];\n}\n\nexport function useBundleAlertsByErrors(\n errors: Manifest.RsdoctorManifestData['errors'],\n) {\n if (Array.isArray(errors)) {\n return errors.filter(\n (e) =>\n e.category === Rule.RuleMessageCategory.Bundle &&\n e.code !== Rule.RuleMessageCodeEnumerated.Overlay,\n );\n }\n return [];\n}\n\nexport function useDuplicatePackagesByErrors(\n errors: Manifest.RsdoctorManifestData['errors'],\n) {\n return useBundleAlertsByErrors(errors).filter(\n (e) => e.code === Rule.RuleErrorMap.E1001.code,\n ) as Rule.PackageRelationDiffRuleStoreData[];\n}\n\nexport function useWebpackConfigurationByConfigs(configs: SDK.ConfigData = []) {\n if (Array.isArray(configs)) {\n return configs.find((e) => e.name === 'webpack' || e.name === 'rspack');\n }\n return null;\n}\n\nexport function useDetectIfCloudIdeEnv() {\n if (\n window.location.protocol === 'https:' &&\n window.location.href.indexOf('ide-proxy') > 0\n ) {\n return true;\n }\n return false;\n}\n\nexport function useWindowWidth() {\n const [windowWidth, setWindowWidth] = useState(window.innerWidth);\n\n useEffect(() => {\n const handleResize = () => setWindowWidth(window.innerWidth);\n window.addEventListener('resize', handleResize);\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, []);\n\n return windowWidth;\n}\n\nexport function useElementSize<T extends HTMLElement = HTMLDivElement>() {\n const ref = useRef<T>(null);\n const [width, setWidth_] = useState(0);\n const [height, setHeight_] = useState(0);\n\n useLayoutEffect(() => {\n const $el = ref.current;\n if (!$el) return;\n const setWidth = (n: number) => setWidth_(Math.ceil(n));\n const setHeight = (n: number) => setHeight_(Math.ceil(n));\n\n const initialRect = $el.getBoundingClientRect();\n setWidth(initialRect.width);\n setHeight(initialRect.height);\n\n const onResize = throttle((entries: ResizeObserverEntry[]) => {\n const entry = entries[0];\n if (!entry) return;\n\n const borderBox = entry.borderBoxSize?.[0];\n\n if (borderBox) {\n setWidth(borderBox.inlineSize);\n setHeight(borderBox.blockSize);\n } else {\n // fallback for dead browsers\n setWidth(entry.contentRect.width);\n setHeight(entry.contentRect.height);\n }\n }, 100);\n const observer = new ResizeObserver(onResize);\n\n observer.observe($el);\n\n return () => {\n observer.disconnect();\n onResize.cancel();\n };\n }, []);\n\n return [ref, { width, height }] as const;\n}\n"],"names":["route","Client","useI18n","i18n","rest","useTranslation","lng","callback","error","t","setLocaleToStorage","useRuleIndexNavigate","code","link","navigate","useNavigate","window","Rule","useUrlQuery","search","useLocation","location","useMemo","parse","useLoading","defaultLoading","loading","setLoading","useState","func","useProjectRootByManifest","manifest","useHashByManifest","useCloudManifestUrlByManifest","ensurePlainObject","value","dfts","Array","defaults","useChunkGraphByManifest","prev","JSON","Algorithm","useConfigOutputFileNameByManifest","useModuleGraphByManifest","useModuleGraph","moduleGraph","usePackageGraphByManifest","useUniqModulesByManifest","uniqBy","e","useUniqModules","modules","useErrorsByManifest","useBundleAlertsByManifest","errors","useBundleAlertsByErrors","useDuplicatePackagesByManifest","alerts","useDuplicatePackagesByErrors","useCompileAlertsByErrors","useWebpackConfigurationByConfigs","configs","useDetectIfCloudIdeEnv","useWindowWidth","windowWidth","setWindowWidth","useEffect","handleResize","useElementSize","ref","useRef","width","setWidth_","height","setHeight_","useLayoutEffect","$el","setWidth","n","Math","setHeight","initialRect","onResize","throttle","entries","entry","borderBox","observer","ResizeObserver"],"mappings":";;;;;;;;;AAYA,MAAMA,QAAQC,OAAO,oBAAoB,CAAC,SAAS;AAE5C,MAAMC,UAAiC;IAC5C,MAAM,EAAEC,IAAI,EAAE,GAAGC,MAAM,GAAGC;IAE1B,OAAO;QACL,GAAGD,IAAI;QACP,MAAM;YACJ,GAAGD,IAAI;YACP,gBAAeG,GAAG,EAAEC,QAAQ;gBAC1B,OAAOJ,KAAK,cAAc,CAACG,KAAK,CAACE,OAAOC;oBACtC,IAAI,CAACD,OACHE,mBAAmBJ;oBAErB,IAAIC,UACFA,SAASC,OAAOC;gBAEpB;YACF;QACF;IACF;AACF;AAEO,SAASE,qBAAqBC,IAAY,EAAEC,IAAyB;IAC1E,MAAMC,WAAWC;IAEjB,IAAIF,MACF,OAAO,IAAMG,OAAO,IAAI,CAACH,MAAM;IAGjC,OAAO;QACLC,SACE,GAAGd,MAAM,CAAC,EAAEiB,KAAK,0BAA0B,CAAC,oBAAoB,CAAC,CAAC,EAAEL,MAAM;IAE9E;AACF;AAEO,SAASM;IACd,MAAMC,SAASC,cAAc,MAAM,IAAIC,SAAS,MAAM;IAEtD,OAAOC,QAAQ,IAAMC,UAAMJ,QAAQ,MAAM,KAAK,EAAE;QAACA;KAAO;AAC1D;AAEO,SAASK,WAAWC,iBAAiB,KAAK;IAC/C,MAAM,CAACC,SAASC,WAAW,GAAGC,SAAkBH;IAEhD,OAAO;QACLC;QACAC;QACA,MAAM,aACJE,IAAwD;YAExD,IAAI;gBACFF,WAAW;gBACX,MAAME;YACR,SAAU;gBACRF,WAAW;YACb;QACF;IACF;AACF;AAEO,SAASG,yBAAyBC,QAAmC;IAC1E,OAAOA,SAAS,IAAI,CAAC,IAAI;AAC3B;AAE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AW,GAAG/C,SAAS;IAEtCgD,gBAAgB;QACd,MAAMC,MAAMP,IAAI,OAAO;QACvB,IAAI,CAACO,KAAK;QACV,MAAMC,WAAW,CAACC,IAAcN,UAAUO,KAAK,IAAI,CAACD;QACpD,MAAME,YAAY,CAACF,IAAcJ,WAAWK,KAAK,IAAI,CAACD;QAEtD,MAAMG,cAAcL,IAAI,qBAAqB;QAC7CC,SAASI,YAAY,KAAK;QAC1BD,UAAUC,YAAY,MAAM;QAE5B,MAAMC,WAAWC,SAAS,CAACC;YACzB,MAAMC,QAAQD,OAAO,CAAC,EAAE;YACxB,IAAI,CAACC,OAAO;YAEZ,MAAMC,YAAYD,MAAM,aAAa,EAAE,CAAC,EAAE;YAE1C,IAAIC,WAAW;gBACbT,SAASS,UAAU,UAAU;gBAC7BN,UAAUM,UAAU,SAAS;YAC/B,OAAO;gBAELT,SAASQ,MAAM,WAAW,CAAC,KAAK;gBAChCL,UAAUK,MAAM,WAAW,CAAC,MAAM;YACpC;QACF,GAAG;QACH,MAAME,WAAW,IAAIC,eAAeN;QAEpCK,SAAS,OAAO,CAACX;QAEjB,OAAO;YACLW,SAAS,UAAU;YACnBL,SAAS,MAAM;QACjB;IACF,GAAG,EAAE;IAEL,OAAO;QAACb;QAAK;YAAEE;YAAOE;QAAO;KAAE;AACjC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsdoctor/components",
3
- "version": "1.5.12",
3
+ "version": "1.5.13",
4
4
  "license": "MIT",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": {
@@ -38,13 +38,13 @@
38
38
  }
39
39
  },
40
40
  "devDependencies": {
41
- "@rsbuild/plugin-check-syntax": "1.6.1",
42
- "@rsbuild/plugin-react": "2.0.0",
43
- "@rsbuild/plugin-sass": "^1.5.2",
44
- "@rsbuild/plugin-svgr": "2.0.2",
41
+ "@rsbuild/plugin-check-syntax": "^1.6.1",
42
+ "@rsbuild/plugin-react": "^2.0.1",
43
+ "@rsbuild/plugin-sass": "^1.5.3",
44
+ "@rsbuild/plugin-svgr": "^2.0.3",
45
45
  "@types/node": "^24.12.3",
46
46
  "@types/path-browserify": "1.0.3",
47
- "@types/react": "^19.2.14",
47
+ "@types/react": "^19.2.15",
48
48
  "@types/react-highlight-words": "^0.20.1",
49
49
  "@types/url-parse": "1.4.11",
50
50
  "react": "19.2.6",
@@ -52,20 +52,21 @@
52
52
  "typescript": "^6.0.3"
53
53
  },
54
54
  "dependencies": {
55
- "@ant-design/icons": "6.2.3",
55
+ "@ant-design/icons": "6.2.5",
56
56
  "@monaco-editor/react": "4.7.0",
57
57
  "ansi-to-react": "6.2.6",
58
58
  "antd": "5.19.1",
59
59
  "clsx": "^2.1.1",
60
- "dayjs": "1.11.20",
60
+ "dayjs": "1.11.21",
61
61
  "echarts": "^5.6.0",
62
62
  "echarts-for-react": "^3.0.6",
63
- "es-toolkit": "^1.45.1",
63
+ "es-toolkit": "^1.47.0",
64
64
  "i18next": "22.0.4",
65
65
  "monaco-editor": "0.49.0",
66
66
  "path-browserify": "1.0.1",
67
67
  "rc-dialog": "9.1.0",
68
68
  "rc-tree": "5.7.2",
69
+ "react-error-boundary": "^4.1.2",
69
70
  "react-highlight-words": "^0.21.0",
70
71
  "react-hyper-tree": "0.3.12",
71
72
  "react-i18next": "12.0.0",
@@ -73,9 +74,9 @@
73
74
  "react-markdown": "^9.1.0",
74
75
  "socket.io-client": "4.8.1",
75
76
  "url-parse": "1.5.10",
76
- "@rsdoctor/graph": "1.5.12",
77
- "@rsdoctor/types": "1.5.12",
78
- "@rsdoctor/utils": "1.5.12"
77
+ "@rsdoctor/types": "1.5.13",
78
+ "@rsdoctor/graph": "1.5.13",
79
+ "@rsdoctor/utils": "1.5.13"
79
80
  },
80
81
  "peerDependencies": {
81
82
  "react": ">=19",