@rsdoctor/components 1.2.0-beta.2 → 1.2.1

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 (163) hide show
  1. package/dist/components/Alert/change.d.ts +3 -0
  2. package/dist/components/Alert/ecma-version-check.d.ts +2 -0
  3. package/dist/components/Alert/file-relation.d.ts +3 -0
  4. package/dist/components/Alert/package-relation.d.ts +16 -0
  5. package/dist/components/Alert/types.d.ts +33 -0
  6. package/dist/components/Alert/view.d.ts +4 -0
  7. package/dist/components/Alerts/bundle-alert.d.ts +14 -0
  8. package/dist/components/Alerts/bundle.d.ts +11 -0
  9. package/dist/components/Alerts/collapse-cross-chunks.d.ts +6 -0
  10. package/dist/components/Alerts/collapse.d.ts +6 -0
  11. package/dist/components/Alerts/compile.d.ts +10 -0
  12. package/dist/components/Alerts/index.d.ts +3 -0
  13. package/dist/components/Alerts/list.d.ts +4 -0
  14. package/dist/components/Alerts/overlay.d.ts +26 -0
  15. package/dist/components/Badge/index.d.ts +21 -0
  16. package/dist/components/Card/diff.d.ts +24 -0
  17. package/dist/components/Card/index.d.ts +9 -0
  18. package/dist/components/Card/size.d.ts +22 -0
  19. package/dist/components/Card/statistic.d.ts +10 -0
  20. package/dist/components/Charts/TimelineCharts/index.d.ts +13 -0
  21. package/dist/components/Charts/TreeMap.d.ts +23 -0
  22. package/dist/components/Charts/TreeMap.mjs +1 -1
  23. package/dist/components/Charts/TreeMap.mjs.map +1 -1
  24. package/dist/components/Charts/bootstrap.d.ts +5 -0
  25. package/dist/components/Charts/common.d.ts +15 -0
  26. package/dist/components/Charts/constants.d.ts +19 -0
  27. package/dist/components/Charts/done.d.ts +5 -0
  28. package/dist/components/Charts/index.d.ts +10 -0
  29. package/dist/components/Charts/loader.d.ts +4 -0
  30. package/dist/components/Charts/minify.d.ts +5 -0
  31. package/dist/components/Charts/treemap_module.css +1 -1
  32. package/dist/components/Charts/treemap_module.css.map +1 -1
  33. package/dist/components/Charts/types.d.ts +61 -0
  34. package/dist/components/Charts/utils.d.ts +13 -0
  35. package/dist/components/Configuration/builder.d.ts +13 -0
  36. package/dist/components/Configuration/index.d.ts +1 -0
  37. package/dist/components/FileTree/index.d.ts +5 -0
  38. package/dist/components/Form/keyword.d.ts +14 -0
  39. package/dist/components/Keyword/index.d.ts +6 -0
  40. package/dist/components/Layout/builder-select.d.ts +2 -0
  41. package/dist/components/Layout/constants.d.ts +1 -0
  42. package/dist/components/Layout/header.d.ts +3 -0
  43. package/dist/components/Layout/index.d.ts +5 -0
  44. package/dist/components/Layout/menus.d.ts +8 -0
  45. package/dist/components/Layout/progress.d.ts +8 -0
  46. package/dist/components/Loader/Analysis/files.d.ts +9 -0
  47. package/dist/components/Loader/Analysis/index.d.ts +11 -0
  48. package/dist/components/Loader/executions.d.ts +9 -0
  49. package/dist/components/Manifest/api.d.ts +34 -0
  50. package/dist/components/Manifest/data.d.ts +8 -0
  51. package/dist/components/Manifest/index.d.ts +2 -0
  52. package/dist/components/Opener/code.d.ts +20 -0
  53. package/dist/components/Opener/index.d.ts +2 -0
  54. package/dist/components/Opener/vscode.d.ts +11 -0
  55. package/dist/components/Overall/DataSummary.d.ts +8 -0
  56. package/dist/components/Overall/bundle.d.ts +11 -0
  57. package/dist/components/Overall/compile.d.ts +5 -0
  58. package/dist/components/Overall/help-center.d.ts +1 -0
  59. package/dist/components/Overall/index.d.ts +3 -0
  60. package/dist/components/Overall/overview.d.ts +8 -0
  61. package/dist/components/Overall/project.d.ts +7 -0
  62. package/dist/components/Plugins/webpack.d.ts +18 -0
  63. package/dist/components/Resolver/analysis.d.ts +15 -0
  64. package/dist/components/Select/index.d.ts +18 -0
  65. package/dist/components/Status/failed.d.ts +9 -0
  66. package/dist/components/Status/index.d.ts +1 -0
  67. package/dist/components/TextDrawer/duplicate.d.ts +17 -0
  68. package/dist/components/TextDrawer/index.d.ts +12 -0
  69. package/dist/components/Title/index.d.ts +15 -0
  70. package/dist/components/base/CodeViewer/index.d.ts +5 -0
  71. package/dist/components/base/CodeViewer/interface.d.ts +45 -0
  72. package/dist/components/base/CodeViewer/useCodeDrawer.d.ts +9 -0
  73. package/dist/components/base/CodeViewer/utils.d.ts +18 -0
  74. package/dist/components/base/DiffViewer/index.d.ts +5 -0
  75. package/dist/components/base/DiffViewer/interface.d.ts +47 -0
  76. package/dist/components/base/DiffViewer/useDiffDrawer.d.ts +9 -0
  77. package/dist/components/base/DiffViewer/utils.d.ts +7 -0
  78. package/dist/components/base/index.d.ts +5 -0
  79. package/dist/components/index.d.ts +10 -0
  80. package/dist/config.d.ts +19 -0
  81. package/dist/constants.d.ts +50 -0
  82. package/dist/index.d.ts +3 -0
  83. package/dist/pages/BundleSize/components/asset.d.ts +26 -0
  84. package/dist/pages/BundleSize/components/cards.d.ts +7 -0
  85. package/dist/pages/BundleSize/components/index.d.ts +16 -0
  86. package/dist/pages/BundleSize/components/search-modal.d.ts +8 -0
  87. package/dist/pages/BundleSize/config.d.ts +6 -0
  88. package/dist/pages/BundleSize/constants.d.ts +5 -0
  89. package/dist/pages/BundleSize/index.d.ts +3 -0
  90. package/dist/pages/ModuleAnalyze/chunks.d.ts +6 -0
  91. package/dist/pages/ModuleAnalyze/components/fileTreeCom.d.ts +15 -0
  92. package/dist/pages/ModuleAnalyze/constants.d.ts +7 -0
  93. package/dist/pages/ModuleAnalyze/dependency.d.ts +9 -0
  94. package/dist/pages/ModuleAnalyze/fileTree.d.ts +10 -0
  95. package/dist/pages/ModuleAnalyze/index.d.ts +15 -0
  96. package/dist/pages/ModuleAnalyze/utils/hooks.d.ts +21 -0
  97. package/dist/pages/ModuleAnalyze/utils/index.d.ts +3 -0
  98. package/dist/pages/ModuleResolve/constants.d.ts +3 -0
  99. package/dist/pages/ModuleResolve/index.d.ts +3 -0
  100. package/dist/pages/Overall/constants.d.ts +3 -0
  101. package/dist/pages/Overall/index.d.ts +9 -0
  102. package/dist/pages/Overall/responsiveLayout.d.ts +6 -0
  103. package/dist/pages/Resources/BundleDiff/DiffContainer/assets.d.ts +7 -0
  104. package/dist/pages/Resources/BundleDiff/DiffContainer/cards.d.ts +3 -0
  105. package/dist/pages/Resources/BundleDiff/DiffContainer/changes.d.ts +15 -0
  106. package/dist/pages/Resources/BundleDiff/DiffContainer/constants.d.ts +11 -0
  107. package/dist/pages/Resources/BundleDiff/DiffContainer/index.d.ts +3 -0
  108. package/dist/pages/Resources/BundleDiff/DiffContainer/modules.d.ts +8 -0
  109. package/dist/pages/Resources/BundleDiff/DiffContainer/overview.d.ts +5 -0
  110. package/dist/pages/Resources/BundleDiff/DiffContainer/packages.d.ts +19 -0
  111. package/dist/pages/Resources/BundleDiff/DiffContainer/row.d.ts +9 -0
  112. package/dist/pages/Resources/BundleDiff/DiffContainer/types.d.ts +44 -0
  113. package/dist/pages/Resources/BundleDiff/DiffContainer/utils.d.ts +2 -0
  114. package/dist/pages/Resources/BundleDiff/DiffServerAPIProvider/index.d.ts +3 -0
  115. package/dist/pages/Resources/BundleDiff/constants.d.ts +11 -0
  116. package/dist/pages/Resources/BundleDiff/index.d.ts +4 -0
  117. package/dist/pages/Resources/RuleIndex/constants.d.ts +3 -0
  118. package/dist/pages/Resources/RuleIndex/index.d.ts +3 -0
  119. package/dist/pages/TreeShaking/constants.d.ts +3 -0
  120. package/dist/pages/TreeShaking/editor.d.ts +11 -0
  121. package/dist/pages/TreeShaking/index.d.ts +8 -0
  122. package/dist/pages/TreeShaking/open-tag.d.ts +11 -0
  123. package/dist/pages/TreeShaking/range.d.ts +282 -0
  124. package/dist/pages/TreeShaking/space.d.ts +1 -0
  125. package/dist/pages/TreeShaking/table.d.ts +13 -0
  126. package/dist/pages/TreeShaking/types.d.ts +3 -0
  127. package/dist/pages/TreeShaking/utils.d.ts +7 -0
  128. package/dist/pages/WebpackLoaders/Analysis/constants.d.ts +3 -0
  129. package/dist/pages/WebpackLoaders/Analysis/index.d.ts +3 -0
  130. package/dist/pages/WebpackLoaders/Overall/constants.d.ts +3 -0
  131. package/dist/pages/WebpackLoaders/Overall/index.d.ts +3 -0
  132. package/dist/pages/WebpackLoaders/constants.d.ts +2 -0
  133. package/dist/pages/WebpackPlugins/constants.d.ts +3 -0
  134. package/dist/pages/WebpackPlugins/index.d.ts +4 -0
  135. package/dist/pages/index.d.ts +10 -0
  136. package/dist/utils/data/base.d.ts +24 -0
  137. package/dist/utils/data/brief.d.ts +11 -0
  138. package/dist/utils/data/index.d.ts +5 -0
  139. package/dist/utils/data/local.d.ts +14 -0
  140. package/dist/utils/data/remote.d.ts +10 -0
  141. package/dist/utils/file.d.ts +47 -0
  142. package/dist/utils/hooks.d.ts +30 -0
  143. package/dist/utils/i18n/cn.d.ts +3 -0
  144. package/dist/utils/i18n/en.d.ts +40 -0
  145. package/dist/utils/i18n/index.d.ts +2 -0
  146. package/dist/utils/index.d.ts +15 -0
  147. package/dist/utils/loader.d.ts +7 -0
  148. package/dist/utils/locale.d.ts +4 -0
  149. package/dist/utils/manifest.d.ts +24 -0
  150. package/dist/utils/request.d.ts +29 -0
  151. package/dist/utils/routes.d.ts +3 -0
  152. package/dist/utils/size.d.ts +2 -0
  153. package/dist/utils/socket.d.ts +7 -0
  154. package/dist/utils/storage.d.ts +15 -0
  155. package/dist/utils/string.d.ts +2 -0
  156. package/dist/utils/time.d.ts +3 -0
  157. package/dist/utils/url.d.ts +7 -0
  158. package/dist/utils/worker/index.d.ts +4 -0
  159. package/dist/utils/worker/master.d.ts +8 -0
  160. package/dist/utils/worker/types.d.ts +9 -0
  161. package/dist/utils/worker/utils.d.ts +7 -0
  162. package/dist/utils/worker/worker.d.ts +13 -0
  163. package/package.json +4 -4
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const BuilderSelect: React.FC;
@@ -0,0 +1 @@
1
+ export declare const CompileName = "Compile Analysis";
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import './header.sass';
3
+ export declare const Header: React.FC;
@@ -0,0 +1,5 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export interface LayoutProps {
3
+ children: JSX.Element;
4
+ }
5
+ export declare const Layout: (props: PropsWithChildren<LayoutProps>) => JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { Manifest } from '@rsdoctor/types';
2
+ import React from 'react';
3
+ export declare const Menus: React.FC<Omit<{
4
+ style?: React.CSSProperties;
5
+ routes: Manifest.RsdoctorManifestClientRoutes[];
6
+ }, "routes"> & Partial<{
7
+ body?: any;
8
+ }>>;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { SDK } from '@rsdoctor/types';
3
+ export interface ProgressProps {
4
+ progress: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.APIExtends.GetCompileProgress>;
5
+ }
6
+ export declare const Progress: React.FC<Omit<ProgressProps, "progress"> & Partial<{
7
+ body?: any;
8
+ }>>;
@@ -0,0 +1,9 @@
1
+ import { SDK } from '@rsdoctor/types';
2
+ import React from 'react';
3
+ export declare const LoaderFiles: React.FC<{
4
+ filetree: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderFileTree>;
5
+ cwd: string;
6
+ loaders: string[];
7
+ filename: string;
8
+ layer?: string;
9
+ }>;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export declare const LoaderAnalysisBase: React.FC<{
3
+ cwd: string;
4
+ }>;
5
+ export declare const LoaderAnalysis: React.FC<Omit<{
6
+ cwd: string;
7
+ }, "cwd"> & Partial<{
8
+ body: {
9
+ key: import("@rsdoctor/types/dist/manifest").RsdoctorManifestMappingKeys;
10
+ };
11
+ }>>;
@@ -0,0 +1,9 @@
1
+ import { SDK } from '@rsdoctor/types';
2
+ import { PropsWithChildren } from 'react';
3
+ interface LoaderExecutionsProps {
4
+ cwd: string;
5
+ data: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderFileDetails>;
6
+ index?: number;
7
+ }
8
+ export declare const LoaderExecutions: ({ data, cwd, index, }: PropsWithChildren<LoaderExecutionsProps>) => JSX.Element;
9
+ export {};
@@ -0,0 +1,34 @@
1
+ import { Manifest, SDK } from '@rsdoctor/types';
2
+ import React from 'react';
3
+ export type InferServerAPIBody<T> = SDK.ServerAPI.InferRequestBodyType<T> extends void ? {
4
+ body?: any;
5
+ } : {
6
+ body: SDK.ServerAPI.InferRequestBodyType<T>;
7
+ };
8
+ type ServerAPIProviderProps<T extends SDK.ServerAPI.API | SDK.ServerAPI.APIExtends> = {
9
+ manifestLoader?: () => Promise<Manifest.RsdoctorManifestWithShardingFiles>;
10
+ api: T;
11
+ children: (response: SDK.ServerAPI.InferResponseType<T>) => JSX.Element;
12
+ fallbackComponent?: React.FC;
13
+ showSkeleton?: boolean;
14
+ } & InferServerAPIBody<T>;
15
+ /**
16
+ * this component will request server api to the sdk of Rsdoctor in local development.
17
+ * otherwise it will fallback to load full manifest for the data.
18
+ *
19
+ * @example usage
20
+ * <ServerAPIProvider {...props}>
21
+ * {(response) => {
22
+ * <Component {...}></Component>
23
+ * }}
24
+ * </ServerAPIProvider>
25
+ */
26
+ export declare const ServerAPIProvider: <T extends SDK.ServerAPI.API | SDK.ServerAPI.APIExtends>(props: ServerAPIProviderProps<T>) => JSX.Element | null;
27
+ export declare function withServerAPI<T, P extends keyof T, A extends SDK.ServerAPI.API | SDK.ServerAPI.APIExtends>({ Component, api, responsePropName, body: bodyInRoot, fallbackComponent, showSkeleton, }: {
28
+ Component: React.FC<T>;
29
+ api: A;
30
+ responsePropName: P;
31
+ fallbackComponent?: React.FC;
32
+ showSkeleton?: boolean;
33
+ } & Partial<Partial<InferServerAPIBody<A>>>): React.FC<Omit<T, P> & Partial<InferServerAPIBody<A>>>;
34
+ export {};
@@ -0,0 +1,8 @@
1
+ import { Manifest } from '@rsdoctor/types';
2
+ import React from 'react';
3
+ type ExtractAlias<T> = T extends [property: string, alias: infer P][] ? `${P extends string ? P : never}` : never;
4
+ /**
5
+ * @deprecated
6
+ */
7
+ export declare function ConnectManifestData<Props extends object, Keys extends [property: `${Manifest.RsdoctorManifestMappingKeys}`, alias: keyof Props][] | [property: string, alias: keyof Props][]>(manifestLoader: () => Promise<Manifest.RsdoctorManifestWithShardingFiles>, keys: Keys, Component: React.FC<Props>): React.FC<Omit<Props, ExtractAlias<Keys>>>;
8
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './data';
2
+ export * from './api';
@@ -0,0 +1,20 @@
1
+ import { PropsWithChildren } from 'react';
2
+ interface CodeOpenerProps {
3
+ windowId?: number;
4
+ /**
5
+ * @example /foo/src/pages/home/index.ts + 100 modules
6
+ * @example /foo/src/pages/b/index.ts
7
+ */
8
+ url: string;
9
+ /**
10
+ * @example 1:0-10
11
+ * @example 1:1
12
+ */
13
+ loc?: string;
14
+ cwd: string;
15
+ label?: string;
16
+ disabled?: boolean;
17
+ code?: boolean;
18
+ }
19
+ export declare const CodeOpener: ({ cwd, url, loc, windowId, label, disabled, code, }: PropsWithChildren<CodeOpenerProps>) => JSX.Element | null;
20
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './code';
2
+ export * from './vscode';
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface VSCodeProps {
3
+ file: string;
4
+ line?: number | string;
5
+ column?: number | string;
6
+ windowId?: number;
7
+ style?: React.CSSProperties;
8
+ }
9
+ export declare function openVSCode({ file, line, column, windowId, }: VSCodeProps): void;
10
+ export declare const VSCode: (props: VSCodeProps) => JSX.Element;
11
+ export {};
@@ -0,0 +1,8 @@
1
+ export interface DataSummaryProps {
2
+ theme: 'common' | 'warning';
3
+ number: string | number;
4
+ onClick?: () => void;
5
+ description: string;
6
+ numberFontSize?: string;
7
+ }
8
+ export declare const DataSummary: ({ theme, number, description, }: DataSummaryProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { Client, SDK } from '@rsdoctor/types';
3
+ import type { TreeDataNode } from 'antd';
4
+ export declare const getFiles: (data: Client.RsdoctorClientAssetsSummary["all"]["total"]) => {
5
+ treeData: TreeDataNode[];
6
+ };
7
+ export declare const getFilesWithDrawer: (data: Client.RsdoctorClientAssetsSummary["all"]["total"]) => JSX.Element;
8
+ export declare const BundleOverall: React.FC<{
9
+ errors: SDK.ErrorsData;
10
+ cwd: string;
11
+ }>;
@@ -0,0 +1,5 @@
1
+ import { SDK } from '@rsdoctor/types';
2
+ import React from 'react';
3
+ export declare const CompileOverall: React.FC<{
4
+ summary: SDK.SummaryData;
5
+ }>;
@@ -0,0 +1 @@
1
+ export declare const HelpCenter: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export * from './bundle';
2
+ export * from './compile';
3
+ export * from './project';
@@ -0,0 +1,8 @@
1
+ interface OverviewProps {
2
+ title?: string | React.ReactNode;
3
+ description?: string | React.ReactNode;
4
+ icon?: React.ReactNode;
5
+ style?: React.CSSProperties;
6
+ }
7
+ export declare const Overview: (props: OverviewProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default Overview;
@@ -0,0 +1,7 @@
1
+ import { SDK } from '@rsdoctor/types';
2
+ export declare const ProjectOverall: React.FC<{
3
+ configs: SDK.ConfigData;
4
+ cwd: string;
5
+ envinfo: SDK.EnvInfo;
6
+ alerts: SDK.ErrorsData;
7
+ }>;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { SDK } from '@rsdoctor/types';
3
+ interface WebpackPluginsTableDataItem {
4
+ tapName: string;
5
+ hook: string;
6
+ key: string;
7
+ hookData: SDK.PluginHookData[];
8
+ }
9
+ export interface WebpackPluginsDataTableProps {
10
+ dataSource: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetPluginData>;
11
+ }
12
+ export declare function useWebpackPluginsDataSource(plugin: SDK.PluginData, selectedTapNames: string[], selectedHooks: string[]): {
13
+ dataSource: WebpackPluginsTableDataItem[];
14
+ tapNames: string[];
15
+ hooks: string[];
16
+ };
17
+ export declare const WebpackPluginsDataTable: React.FC<WebpackPluginsDataTableProps>;
18
+ export {};
@@ -0,0 +1,15 @@
1
+ import { SDK } from '@rsdoctor/types';
2
+ import React from 'react';
3
+ export declare const ResolverFiles: React.FC<{
4
+ filename: string;
5
+ cwd: string;
6
+ resolver: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetResolverFileTree>;
7
+ }>;
8
+ export declare const ResolverAnalysisBase: React.FC<{
9
+ project: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>;
10
+ }>;
11
+ export declare const ResolverAnalysis: React.FC<Omit<{
12
+ project: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>;
13
+ }, "project"> & Partial<{
14
+ body?: any;
15
+ }>>;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ interface LoaderNamesSelectProps {
4
+ style?: React.CSSProperties;
5
+ onChange: (loaders: string[]) => void;
6
+ loaderNames: string[];
7
+ }
8
+ export type ISelectLoaderProps = {
9
+ loaders: string[];
10
+ filename: string;
11
+ layer?: string;
12
+ };
13
+ export declare const LoaderNamesSelect: React.FC<LoaderNamesSelectProps>;
14
+ export declare const LoaderCommonSelect: React.FC<{
15
+ onChange(value: ISelectLoaderProps): void;
16
+ loaderNames: string[];
17
+ }>;
18
+ export {};
@@ -0,0 +1,9 @@
1
+ import { Common } from '@rsdoctor/types';
2
+ import React from 'react';
3
+ interface FailedStatusProps {
4
+ title?: string;
5
+ buttonText?: string;
6
+ retry: Common.Function;
7
+ }
8
+ export declare const FailedStatus: React.NamedExoticComponent<FailedStatusProps>;
9
+ export {};
@@ -0,0 +1 @@
1
+ export * from './failed';
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { Rule, SDK } from '@rsdoctor/types';
3
+ import { TextDrawerProps } from './index';
4
+ import { PackageRelationAlertProps } from '../Alert/types';
5
+ interface DuplicatePackageDrawerContentProps extends Omit<TextDrawerProps, 'text'> {
6
+ duplicatePackages: Rule.PackageRelationDiffRuleStoreData[];
7
+ cwd: string;
8
+ textStyle?: React.CSSProperties;
9
+ children: PackageRelationAlertProps['getPackageRelationContentComponent'];
10
+ }
11
+ interface DuplicatePackageDrawerProps extends Omit<DuplicatePackageDrawerContentProps, 'children'> {
12
+ moduleGraph: Pick<SDK.ModuleGraphData, 'dependencies' | 'modules'>;
13
+ moduleCodeMap: SDK.ModuleCodeData;
14
+ }
15
+ export declare const DuplicatePackageDrawer: React.FC<DuplicatePackageDrawerProps>;
16
+ export declare const DuplicatePackageDrawerWithServer: React.FC<Omit<DuplicatePackageDrawerContentProps, 'children'>>;
17
+ export {};
@@ -0,0 +1,12 @@
1
+ import { ButtonProps, DrawerProps } from 'antd';
2
+ import React, { CSSProperties, HTMLAttributes, PropsWithChildren } from 'react';
3
+ export interface TextDrawerProps {
4
+ text?: string | React.ReactNode;
5
+ button?: React.ReactNode;
6
+ buttonProps?: ButtonProps;
7
+ buttonStyle?: CSSProperties;
8
+ drawerProps?: DrawerProps;
9
+ containerProps?: HTMLAttributes<HTMLDivElement>;
10
+ }
11
+ export declare const TextDrawer: (props: PropsWithChildren<TextDrawerProps>) => JSX.Element;
12
+ export * from './duplicate';
@@ -0,0 +1,15 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ interface TitleProps {
3
+ /**
4
+ * @default true
5
+ */
6
+ upperFirst?: boolean;
7
+ /**
8
+ * @default 16
9
+ */
10
+ fontSize?: number;
11
+ text: string | React.ReactNode;
12
+ hash?: string;
13
+ }
14
+ export declare const Title: React.FC<PropsWithChildren<TitleProps>>;
15
+ export {};
@@ -0,0 +1,5 @@
1
+ import { CodeViewerProps } from './interface';
2
+ export declare function CodeViewer({ className, style, code, lang, filePath, defaultLine, ranges, isEmbed, headerVisible, isLightTheme, }: CodeViewerProps): import("react/jsx-runtime").JSX.Element;
3
+ export type { CodeViewerProps } from './interface';
4
+ export { useCodeDrawer } from './useCodeDrawer';
5
+ export { defineMonacoOptions } from './utils';
@@ -0,0 +1,45 @@
1
+ import { SDK } from '@rsdoctor/types';
2
+ import { CSSProperties } from 'react';
3
+ export interface CodeViewerProps {
4
+ className?: string;
5
+ style?: CSSProperties;
6
+ /**
7
+ * Whether to display in embedded mode.
8
+ * Embedded mode has no border or border-radius
9
+ * @default false
10
+ */
11
+ isEmbed?: boolean;
12
+ /**
13
+ * Whether to use light theme configuration
14
+ * @default true
15
+ */
16
+ isLightTheme?: boolean;
17
+ /**
18
+ * Code content
19
+ */
20
+ code?: string;
21
+ /**
22
+ * Specify language format, highest priority. If not specified,
23
+ * it will be inferred from filePath
24
+ */
25
+ lang?: string;
26
+ /**
27
+ * File path
28
+ */
29
+ filePath?: string;
30
+ /**
31
+ * Default line to display in the editor
32
+ */
33
+ defaultLine?: number;
34
+ /**
35
+ * Editor text highlighting configuration. When configured,
36
+ * it will automatically position to the first highlighted location.
37
+ * Positioning priority is lower than defaultLine
38
+ */
39
+ ranges?: SDK.SourceRange[];
40
+ /**
41
+ * Whether the top bar is displayed
42
+ * @default true
43
+ */
44
+ headerVisible?: boolean;
45
+ }
@@ -0,0 +1,9 @@
1
+ import { CodeViewerProps } from './interface';
2
+ /**
3
+ * Use drawer to display code content
4
+ * @param emptyReason Text to display when there is no code content
5
+ */
6
+ export declare function useCodeDrawer(emptyReason: string): {
7
+ showCode(codeConfig: Pick<CodeViewerProps, "code" | "filePath" | "ranges" | "lang" | "defaultLine">): void;
8
+ codeDrawerComponent: import("react/jsx-runtime").JSX.Element;
9
+ };
@@ -0,0 +1,18 @@
1
+ import { Monaco } from '@monaco-editor/react';
2
+ import { SDK } from '@rsdoctor/types';
3
+ import type { Range as RangeClass } from 'monaco-editor';
4
+ import { editor } from 'monaco-editor';
5
+ export declare function getFilePathFormat(filePath: string): string;
6
+ /**
7
+ * 默认编辑器样式, 适合预览代码
8
+ */
9
+ export declare const DefaultEditorConfig: editor.IStandaloneEditorConstructionOptions;
10
+ /**
11
+ * get monaco options, it'll combine default config
12
+ * @param options
13
+ * @returns target options
14
+ */
15
+ export declare function defineMonacoOptions(options?: editor.IStandaloneEditorConstructionOptions): editor.IStandaloneEditorConstructionOptions;
16
+ export declare function getFileName(filePath: string): string;
17
+ export declare function getSelectionRange(source: SDK.SourceRange, Range: typeof RangeClass): RangeClass;
18
+ export declare function editorShowRange(editor: editor.IStandaloneCodeEditor, monaco: Monaco, ranges?: SDK.SourceRange[]): void;
@@ -0,0 +1,5 @@
1
+ import { DiffViewerProps } from './interface';
2
+ export declare function DiffViewer({ className, style, original, modified, originalFilePath, modifiedFilePath, originalLang, modifiedLang, isEmbed, isLightTheme, headerVisible, }: DiffViewerProps): import("react/jsx-runtime").JSX.Element;
3
+ export type { DiffViewerProps } from './interface';
4
+ export { useDiffDrawer } from './useDiffDrawer';
5
+ export { defineMonacoDiffOptions } from './utils';
@@ -0,0 +1,47 @@
1
+ import { CSSProperties } from 'react';
2
+ export interface DiffViewerProps {
3
+ className?: string;
4
+ style?: CSSProperties;
5
+ /**
6
+ * Original file, displayed on the left
7
+ */
8
+ original: string;
9
+ /**
10
+ * Modified file, displayed on the right
11
+ */
12
+ modified: string;
13
+ /**
14
+ * Original file language, highest priority.
15
+ * If not configured, it will be inferred from filePath
16
+ */
17
+ originalLang?: string;
18
+ /**
19
+ * Modified file language, highest priority.
20
+ * If not configured, it will be inferred from filePath
21
+ */
22
+ modifiedLang?: string;
23
+ /**
24
+ * Original file path
25
+ */
26
+ originalFilePath?: string;
27
+ /**
28
+ * Modified file path
29
+ */
30
+ modifiedFilePath?: string;
31
+ /**
32
+ * Whether to display in embedded mode.
33
+ * Embedded mode has no border or border-radius
34
+ * @default false
35
+ */
36
+ isEmbed?: boolean;
37
+ /**
38
+ * Whether to use light theme
39
+ * @default true
40
+ */
41
+ isLightTheme?: boolean;
42
+ /**
43
+ * Whether the top bar is displayed
44
+ * @default true
45
+ */
46
+ headerVisible?: boolean;
47
+ }
@@ -0,0 +1,9 @@
1
+ import { DiffViewerProps } from './interface';
2
+ /**
3
+ * Use drawer to display code diff content
4
+ * @param emptyReason Text to display when there is no code content
5
+ */
6
+ export declare function useDiffDrawer(emptyReason?: string): {
7
+ showCodeDiff(diffConfig: Pick<DiffViewerProps, "original" | "modified" | "originalFilePath" | "modifiedFilePath" | "originalLang" | "modifiedLang">): void;
8
+ codeDiffDrawerComponent: import("react/jsx-runtime").JSX.Element;
9
+ };
@@ -0,0 +1,7 @@
1
+ import { editor } from 'monaco-editor';
2
+ /**
3
+ * get monaco options, it'll combine default config
4
+ * @param options
5
+ * @returns target options
6
+ */
7
+ export declare function defineMonacoDiffOptions(options?: editor.IDiffEditorConstructionOptions): editor.IDiffEditorConstructionOptions;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 业务无关的基础组件
3
+ */
4
+ export * from './CodeViewer';
5
+ export * from './DiffViewer';
@@ -0,0 +1,10 @@
1
+ export * from './Alerts';
2
+ export * from './Badge';
3
+ export * from './base';
4
+ export * from './Card';
5
+ export { TimelineCom } from './Charts/TimelineCharts';
6
+ export * from './Form/keyword';
7
+ export * from './Layout';
8
+ export * from './Manifest';
9
+ export * from './Overall';
10
+ export * from './TextDrawer';
@@ -0,0 +1,19 @@
1
+ import { Manifest } from '@rsdoctor/types';
2
+ import { PageState, ViewMode, Language, Theme } from './constants';
3
+ export interface Config {
4
+ locale: Language;
5
+ theme: Theme;
6
+ pageState: PageState;
7
+ viewMode: {
8
+ bundleAlerts: ViewMode;
9
+ compileAlerts: ViewMode;
10
+ };
11
+ json: Manifest.RsdoctorManifest;
12
+ setTheme(theme: Config['theme']): void;
13
+ setManifest(json: Manifest.RsdoctorManifest): void;
14
+ setPageState(state: PageState): void;
15
+ setViewMode(mode: Partial<Config['viewMode']>, saveStorage?: boolean): void;
16
+ embedded?: boolean;
17
+ }
18
+ export declare const defaultConfig: Config;
19
+ export declare const ConfigContext: import("react").Context<Config>;
@@ -0,0 +1,50 @@
1
+ export declare enum Theme {
2
+ Light = "light",
3
+ Dark = "dark"
4
+ }
5
+ export declare enum PageState {
6
+ Success = 0,
7
+ Pending = 1,
8
+ Fail = 2
9
+ }
10
+ export declare enum ComponentState {
11
+ Success = 0,
12
+ Pending = 1,
13
+ Updating = 2,
14
+ Fail = 3
15
+ }
16
+ export declare enum ViewMode {
17
+ List = "list",
18
+ Group = "group"
19
+ }
20
+ export declare enum Language {
21
+ Cn = "cn",
22
+ En = "en"
23
+ }
24
+ export declare enum APILoaderMode4Dev {
25
+ Local = "local",
26
+ Remote = "remote",
27
+ Default = "default"
28
+ }
29
+ export declare enum Size {
30
+ BasePadding = 20,
31
+ BaseBorderRadius = 8,
32
+ NavBarHeight = 54
33
+ }
34
+ export declare enum Color {
35
+ Red = "#e17055",
36
+ Green = "#52c41a",
37
+ Yellow = "#faad14",
38
+ Blue = "#1677ff"
39
+ }
40
+ export declare const drawerWidth: number;
41
+ export declare const TAG_PALLETE: {
42
+ COLOR_A: string;
43
+ COLOR_B: string;
44
+ COLOR_C: string;
45
+ COLOR_D: string;
46
+ COLOR_E: string;
47
+ DARK_BLUE: string;
48
+ };
49
+ export declare const MAIN_BG = "";
50
+ export declare const ROOT_BG_COLOR = "rgb(105, 177, 255)";
@@ -0,0 +1,3 @@
1
+ export * from './components';
2
+ export * from './utils';
3
+ export * as Constants from './constants';
@@ -0,0 +1,26 @@
1
+ import { SDK } from '@rsdoctor/types';
2
+ import React from 'react';
3
+ import { DataNode } from '../../../utils';
4
+ export declare const ModuleCodeViewer: React.FC<{
5
+ data: SDK.ModuleData;
6
+ }>;
7
+ export declare const ModuleGraphViewer: React.FC<{
8
+ id: number | string;
9
+ show: boolean;
10
+ setShow: (_show: boolean) => void;
11
+ cwd: string;
12
+ }>;
13
+ export declare function getChildrenModule(node: DataNode, mods: string[]): string[];
14
+ export declare const ModulesStatistics: React.FC<{
15
+ modules: SDK.ModuleData[];
16
+ chunks: SDK.ChunkData[];
17
+ filteredModules: SDK.ModuleData[];
18
+ }>;
19
+ export declare const AssetDetail: React.FC<{
20
+ asset: SDK.AssetData;
21
+ chunks: SDK.ChunkData[];
22
+ modules: SDK.ModuleData[];
23
+ moduleSizeLimit?: number;
24
+ height?: number;
25
+ root: string;
26
+ }>;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { SDK } from '@rsdoctor/types';
3
+ export declare const BundleCards: React.FC<{
4
+ cwd: string;
5
+ errors: SDK.ErrorsData;
6
+ summary: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetAssetsSummary>;
7
+ }>;
@@ -0,0 +1,16 @@
1
+ import { Client, SDK } from '@rsdoctor/types';
2
+ import React from 'react';
3
+ import './index.sass';
4
+ interface WebpackModulesOverallProps {
5
+ cwd: string;
6
+ errors: SDK.ErrorsData;
7
+ summary: Client.RsdoctorClientAssetsSummary;
8
+ entryPoints: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetEntryPoints>;
9
+ }
10
+ export declare const WebpackModulesOverallBase: React.FC<WebpackModulesOverallProps>;
11
+ export declare const WebpackModulesOverall: React.FC<Omit<{
12
+ project: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>;
13
+ }, "project"> & Partial<{
14
+ body?: any;
15
+ }>>;
16
+ export {};