@rsdoctor/components 0.0.2-beta.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.
- package/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/assets/connection-point.3b3c78ca.svg +1 -0
- package/dist/assets/icon.7509d763.svg +21 -0
- package/dist/assets/webpack.98604d64.svg +1 -0
- package/dist/components/Alert/change.d.ts +8 -0
- package/dist/components/Alert/change.js +94 -0
- package/dist/components/Alert/file-relation.d.ts +3 -0
- package/dist/components/Alert/file-relation.js +9 -0
- package/dist/components/Alert/index.css +29 -0
- package/dist/components/Alert/index.d.ts +4 -0
- package/dist/components/Alert/index.js +37 -0
- package/dist/components/Alert/link.d.ts +3 -0
- package/dist/components/Alert/link.js +27 -0
- package/dist/components/Alert/package-relation.d.ts +17 -0
- package/dist/components/Alert/package-relation.js +206 -0
- package/dist/components/Alert/types.d.ts +31 -0
- package/dist/components/Alert/types.js +0 -0
- package/dist/components/Alert/view.d.ts +4 -0
- package/dist/components/Alert/view.js +59 -0
- package/dist/components/Alerts/bundle.d.ts +11 -0
- package/dist/components/Alerts/bundle.js +47 -0
- package/dist/components/Alerts/common.d.ts +15 -0
- package/dist/components/Alerts/common.js +106 -0
- package/dist/components/Alerts/compile.d.ts +10 -0
- package/dist/components/Alerts/compile.js +46 -0
- package/dist/components/Alerts/index.d.ts +3 -0
- package/dist/components/Alerts/index.js +3 -0
- package/dist/components/Alerts/overlay.d.ts +26 -0
- package/dist/components/Alerts/overlay.js +154 -0
- package/dist/components/Badge/index.d.ts +21 -0
- package/dist/components/Badge/index.js +105 -0
- package/dist/components/Card/diff.d.ts +23 -0
- package/dist/components/Card/diff.js +131 -0
- package/dist/components/Card/index.d.ts +7 -0
- package/dist/components/Card/index.js +62 -0
- package/dist/components/Card/size.d.ts +16 -0
- package/dist/components/Card/size.js +71 -0
- package/dist/components/Card/statistic.css +16 -0
- package/dist/components/Card/statistic.d.ts +9 -0
- package/dist/components/Card/statistic.js +34 -0
- package/dist/components/Charts/TimelineCharts/index.d.ts +8 -0
- package/dist/components/Charts/TimelineCharts/index.js +197 -0
- package/dist/components/Charts/bootstrap.d.ts +5 -0
- package/dist/components/Charts/bootstrap.js +44 -0
- package/dist/components/Charts/common.d.ts +13 -0
- package/dist/components/Charts/common.js +56 -0
- package/dist/components/Charts/done.d.ts +5 -0
- package/dist/components/Charts/done.js +45 -0
- package/dist/components/Charts/index.d.ts +10 -0
- package/dist/components/Charts/index.js +37 -0
- package/dist/components/Charts/loader.css +31 -0
- package/dist/components/Charts/loader.d.ts +4 -0
- package/dist/components/Charts/loader.js +68 -0
- package/dist/components/Charts/minify.d.ts +5 -0
- package/dist/components/Charts/minify.js +37 -0
- package/dist/components/Charts/tooltips.css +62 -0
- package/dist/components/Charts/types.d.ts +61 -0
- package/dist/components/Charts/types.js +11 -0
- package/dist/components/Charts/utils.d.ts +13 -0
- package/dist/components/Charts/utils.js +203 -0
- package/dist/components/CodeViewer/config.d.ts +2 -0
- package/dist/components/CodeViewer/config.js +18 -0
- package/dist/components/CodeViewer/diff.d.ts +11 -0
- package/dist/components/CodeViewer/diff.js +53 -0
- package/dist/components/CodeViewer/hightlight.d.ts +10 -0
- package/dist/components/CodeViewer/hightlight.js +76 -0
- package/dist/components/CodeViewer/index.d.ts +4 -0
- package/dist/components/CodeViewer/index.js +4 -0
- package/dist/components/CodeViewer/viewer.d.ts +13 -0
- package/dist/components/CodeViewer/viewer.js +76 -0
- package/dist/components/Configuration/index.d.ts +1 -0
- package/dist/components/Configuration/index.js +1 -0
- package/dist/components/Configuration/webpack.d.ts +13 -0
- package/dist/components/Configuration/webpack.js +70 -0
- package/dist/components/FileTree/index.css +58 -0
- package/dist/components/FileTree/index.d.ts +4 -0
- package/dist/components/FileTree/index.js +53 -0
- package/dist/components/Form/keyword.d.ts +14 -0
- package/dist/components/Form/keyword.js +76 -0
- package/dist/components/Keyword/index.d.ts +6 -0
- package/dist/components/Keyword/index.js +68 -0
- package/dist/components/Layout/builder-select.d.ts +2 -0
- package/dist/components/Layout/builder-select.js +50 -0
- package/dist/components/Layout/constants.d.ts +1 -0
- package/dist/components/Layout/constants.js +4 -0
- package/dist/components/Layout/header.css +12 -0
- package/dist/components/Layout/header.d.ts +3 -0
- package/dist/components/Layout/header.js +87 -0
- package/dist/components/Layout/index.d.ts +5 -0
- package/dist/components/Layout/index.js +34 -0
- package/dist/components/Layout/menus.d.ts +8 -0
- package/dist/components/Layout/menus.js +155 -0
- package/dist/components/Layout/progress.d.ts +8 -0
- package/dist/components/Layout/progress.js +44 -0
- package/dist/components/Loader/Analysis/files.d.ts +8 -0
- package/dist/components/Loader/Analysis/files.js +187 -0
- package/dist/components/Loader/Analysis/index.d.ts +11 -0
- package/dist/components/Loader/Analysis/index.js +23 -0
- package/dist/components/Loader/executions.d.ts +13 -0
- package/dist/components/Loader/executions.js +221 -0
- package/dist/components/Manifest/api.d.ts +41 -0
- package/dist/components/Manifest/api.js +157 -0
- package/dist/components/Manifest/data.d.ts +8 -0
- package/dist/components/Manifest/data.js +81 -0
- package/dist/components/Manifest/index.d.ts +2 -0
- package/dist/components/Manifest/index.js +2 -0
- package/dist/components/Opener/code.d.ts +28 -0
- package/dist/components/Opener/code.js +69 -0
- package/dist/components/Opener/index.d.ts +2 -0
- package/dist/components/Opener/index.js +2 -0
- package/dist/components/Opener/vscode.d.ts +16 -0
- package/dist/components/Opener/vscode.js +57 -0
- package/dist/components/Overall/NumberButton.d.ts +14 -0
- package/dist/components/Overall/NumberButton.js +29 -0
- package/dist/components/Overall/NumberButton.module.js +5 -0
- package/dist/components/Overall/NumberButton_module.css +70 -0
- package/dist/components/Overall/bundle.d.ts +6 -0
- package/dist/components/Overall/bundle.js +167 -0
- package/dist/components/Overall/bundle.module.css +0 -0
- package/dist/components/Overall/card.module.js +5 -0
- package/dist/components/Overall/card_module.css +6 -0
- package/dist/components/Overall/compile.d.ts +5 -0
- package/dist/components/Overall/compile.js +68 -0
- package/dist/components/Overall/compile.module.js +5 -0
- package/dist/components/Overall/compile_module.css +4 -0
- package/dist/components/Overall/index.d.ts +3 -0
- package/dist/components/Overall/index.js +3 -0
- package/dist/components/Overall/list.module.js +5 -0
- package/dist/components/Overall/list_module.css +7 -0
- package/dist/components/Overall/project.d.ts +8 -0
- package/dist/components/Overall/project.js +73 -0
- package/dist/components/Plugins/webpack.d.ts +18 -0
- package/dist/components/Plugins/webpack.js +76 -0
- package/dist/components/Resolver/analysis.d.ts +15 -0
- package/dist/components/Resolver/analysis.js +160 -0
- package/dist/components/Select/index.d.ts +15 -0
- package/dist/components/Select/index.js +68 -0
- package/dist/components/Status/failed.d.ts +9 -0
- package/dist/components/Status/failed.js +33 -0
- package/dist/components/Status/index.d.ts +1 -0
- package/dist/components/Status/index.js +1 -0
- package/dist/components/TextDrawer/duplicate.d.ts +17 -0
- package/dist/components/TextDrawer/duplicate.js +107 -0
- package/dist/components/TextDrawer/index.d.ts +11 -0
- package/dist/components/TextDrawer/index.js +55 -0
- package/dist/components/Title/index.d.ts +15 -0
- package/dist/components/Title/index.js +10 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.js +11 -0
- package/dist/components/worker/ecmaversion/client.d.ts +10 -0
- package/dist/components/worker/ecmaversion/client.js +61 -0
- package/dist/components/worker/ecmaversion/worker.d.ts +1 -0
- package/dist/components/worker/ecmaversion/worker.js +13 -0
- package/dist/components/worker/jsequal/client.d.ts +11 -0
- package/dist/components/worker/jsequal/client.js +39 -0
- package/dist/components/worker/jsequal/worker.d.ts +1 -0
- package/dist/components/worker/jsequal/worker.js +52 -0
- package/dist/config.d.ts +19 -0
- package/dist/config.js +39 -0
- package/dist/constants.d.ts +48 -0
- package/dist/constants.js +71 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6 -0
- package/dist/pages/BundleSize/components/asset.d.ts +26 -0
- package/dist/pages/BundleSize/components/asset.js +405 -0
- package/dist/pages/BundleSize/components/cards.d.ts +7 -0
- package/dist/pages/BundleSize/components/cards.js +154 -0
- package/dist/pages/BundleSize/components/editor.d.ts +5 -0
- package/dist/pages/BundleSize/components/editor.js +38 -0
- package/dist/pages/BundleSize/components/index.css +20 -0
- package/dist/pages/BundleSize/components/index.d.ts +16 -0
- package/dist/pages/BundleSize/components/index.js +314 -0
- package/dist/pages/BundleSize/config.d.ts +7 -0
- package/dist/pages/BundleSize/config.js +9 -0
- package/dist/pages/BundleSize/constants.d.ts +5 -0
- package/dist/pages/BundleSize/constants.js +9 -0
- package/dist/pages/BundleSize/index.d.ts +3 -0
- package/dist/pages/BundleSize/index.js +11 -0
- package/dist/pages/ModuleAnalyze/chunks.d.ts +6 -0
- package/dist/pages/ModuleAnalyze/chunks.js +48 -0
- package/dist/pages/ModuleAnalyze/components/fileTreeCom.css +88 -0
- package/dist/pages/ModuleAnalyze/components/fileTreeCom.d.ts +15 -0
- package/dist/pages/ModuleAnalyze/components/fileTreeCom.js +138 -0
- package/dist/pages/ModuleAnalyze/constants.d.ts +7 -0
- package/dist/pages/ModuleAnalyze/constants.js +14 -0
- package/dist/pages/ModuleAnalyze/dependncy.d.ts +9 -0
- package/dist/pages/ModuleAnalyze/dependncy.js +31 -0
- package/dist/pages/ModuleAnalyze/fileTree.d.ts +9 -0
- package/dist/pages/ModuleAnalyze/fileTree.js +125 -0
- package/dist/pages/ModuleAnalyze/index.css +10 -0
- package/dist/pages/ModuleAnalyze/index.d.ts +8 -0
- package/dist/pages/ModuleAnalyze/index.js +64 -0
- package/dist/pages/ModuleAnalyze/utils/hooks.d.ts +21 -0
- package/dist/pages/ModuleAnalyze/utils/hooks.js +65 -0
- package/dist/pages/ModuleAnalyze/utils/index.d.ts +3 -0
- package/dist/pages/ModuleAnalyze/utils/index.js +36 -0
- package/dist/pages/ModuleResolve/constants.d.ts +3 -0
- package/dist/pages/ModuleResolve/constants.js +7 -0
- package/dist/pages/ModuleResolve/index.d.ts +3 -0
- package/dist/pages/ModuleResolve/index.js +19 -0
- package/dist/pages/Overall/constants.d.ts +3 -0
- package/dist/pages/Overall/constants.js +7 -0
- package/dist/pages/Overall/index.d.ts +9 -0
- package/dist/pages/Overall/index.js +28 -0
- package/dist/pages/WebpackLoaders/Analysis/constants.d.ts +3 -0
- package/dist/pages/WebpackLoaders/Analysis/constants.js +7 -0
- package/dist/pages/WebpackLoaders/Analysis/index.d.ts +3 -0
- package/dist/pages/WebpackLoaders/Analysis/index.js +19 -0
- package/dist/pages/WebpackLoaders/Overall/constants.d.ts +3 -0
- package/dist/pages/WebpackLoaders/Overall/constants.js +7 -0
- package/dist/pages/WebpackLoaders/Overall/index.d.ts +3 -0
- package/dist/pages/WebpackLoaders/Overall/index.js +11 -0
- package/dist/pages/WebpackLoaders/constants.d.ts +2 -0
- package/dist/pages/WebpackLoaders/constants.js +6 -0
- package/dist/pages/WebpackPlugins/constants.d.ts +3 -0
- package/dist/pages/WebpackPlugins/constants.js +7 -0
- package/dist/pages/WebpackPlugins/index.d.ts +3 -0
- package/dist/pages/WebpackPlugins/index.js +79 -0
- package/dist/pages/index.d.ts +7 -0
- package/dist/pages/index.js +16 -0
- package/dist/utils/data/base.d.ts +24 -0
- package/dist/utils/data/base.js +70 -0
- package/dist/utils/data/index.d.ts +5 -0
- package/dist/utils/data/index.js +66 -0
- package/dist/utils/data/local.d.ts +14 -0
- package/dist/utils/data/local.js +106 -0
- package/dist/utils/data/remote.d.ts +10 -0
- package/dist/utils/data/remote.js +70 -0
- package/dist/utils/file.d.ts +39 -0
- package/dist/utils/file.js +154 -0
- package/dist/utils/hooks.d.ts +30 -0
- package/dist/utils/hooks.js +256 -0
- package/dist/utils/i18n/cn.d.ts +3 -0
- package/dist/utils/i18n/cn.js +33 -0
- package/dist/utils/i18n/en.d.ts +30 -0
- package/dist/utils/i18n/en.js +33 -0
- package/dist/utils/i18n/index.d.ts +2 -0
- package/dist/utils/i18n/index.js +34 -0
- package/dist/utils/index.d.ts +16 -0
- package/dist/utils/index.js +16 -0
- package/dist/utils/loader.d.ts +7 -0
- package/dist/utils/loader.js +29 -0
- package/dist/utils/locale.d.ts +2 -0
- package/dist/utils/locale.js +9 -0
- package/dist/utils/manifest.d.ts +27 -0
- package/dist/utils/manifest.js +54 -0
- package/dist/utils/monaco.d.ts +9 -0
- package/dist/utils/monaco.js +48 -0
- package/dist/utils/request.d.ts +23 -0
- package/dist/utils/request.js +162 -0
- package/dist/utils/routes.d.ts +3 -0
- package/dist/utils/routes.js +14 -0
- package/dist/utils/size.d.ts +2 -0
- package/dist/utils/size.js +24 -0
- package/dist/utils/socket.d.ts +2 -0
- package/dist/utils/socket.js +20 -0
- package/dist/utils/storage.d.ts +13 -0
- package/dist/utils/storage.js +70 -0
- package/dist/utils/string.d.ts +2 -0
- package/dist/utils/string.js +14 -0
- package/dist/utils/time.d.ts +3 -0
- package/dist/utils/time.js +7 -0
- package/dist/utils/url.d.ts +6 -0
- package/dist/utils/url.js +89 -0
- package/dist/utils/worker/index.d.ts +4 -0
- package/dist/utils/worker/index.js +4 -0
- package/dist/utils/worker/master.d.ts +8 -0
- package/dist/utils/worker/master.js +18 -0
- package/dist/utils/worker/types.d.ts +9 -0
- package/dist/utils/worker/types.js +0 -0
- package/dist/utils/worker/utils.d.ts +9 -0
- package/dist/utils/worker/utils.js +29 -0
- package/dist/utils/worker/worker.d.ts +13 -0
- package/dist/utils/worker/worker.js +38 -0
- package/package.json +87 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { Button, Input, Select, Space, Typography } from "antd";
|
|
4
|
+
import { FileSearchOutlined, SelectOutlined } from "@ant-design/icons";
|
|
5
|
+
import { KeywordInput } from "../Form/keyword";
|
|
6
|
+
import { Size } from "../../constants";
|
|
7
|
+
const LoaderNamesSelect = ({ style, onChange, loaderNames }) => {
|
|
8
|
+
const [selectLoaders, setSelectLoaders] = useState([]);
|
|
9
|
+
const labelStyle = { width: 120 };
|
|
10
|
+
return /* @__PURE__ */ jsxs(Input.Group, { compact: true, style, children: [
|
|
11
|
+
/* @__PURE__ */ jsxs(Button, { style: labelStyle, children: [
|
|
12
|
+
/* @__PURE__ */ jsx(SelectOutlined, {}),
|
|
13
|
+
/* @__PURE__ */ jsx(Typography.Text, { children: "Loaders" })
|
|
14
|
+
] }),
|
|
15
|
+
/* @__PURE__ */ jsx(
|
|
16
|
+
Select,
|
|
17
|
+
{
|
|
18
|
+
mode: "multiple",
|
|
19
|
+
allowClear: true,
|
|
20
|
+
defaultValue: selectLoaders,
|
|
21
|
+
style: { width: 350 },
|
|
22
|
+
dropdownMatchSelectWidth: true,
|
|
23
|
+
placeholder: "select loaders",
|
|
24
|
+
onChange: (e) => {
|
|
25
|
+
setSelectLoaders(e);
|
|
26
|
+
onChange(e);
|
|
27
|
+
},
|
|
28
|
+
children: loaderNames.map((e) => {
|
|
29
|
+
return /* @__PURE__ */ jsx(Select.Option, { label: e, value: e, children: e }, e);
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
] });
|
|
34
|
+
};
|
|
35
|
+
const LoaderCommonSelect = ({ onChange, loaderNames }) => {
|
|
36
|
+
const [selectLoaders, setSelectLoaders] = useState([]);
|
|
37
|
+
const [filename, setFilename] = useState("");
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
onChange({ loaders: selectLoaders, filename });
|
|
40
|
+
}, [selectLoaders, filename]);
|
|
41
|
+
return /* @__PURE__ */ jsxs(Space, { style: { marginBottom: Size.BasePadding }, children: [
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
LoaderNamesSelect,
|
|
44
|
+
{
|
|
45
|
+
loaderNames,
|
|
46
|
+
style: { marginRight: Size.BasePadding - 8 },
|
|
47
|
+
onChange: (e) => {
|
|
48
|
+
setSelectLoaders(e);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ jsx(
|
|
53
|
+
KeywordInput,
|
|
54
|
+
{
|
|
55
|
+
icon: /* @__PURE__ */ jsx(FileSearchOutlined, {}),
|
|
56
|
+
label: "Filename",
|
|
57
|
+
placeholder: "search filename by keyword",
|
|
58
|
+
onChange: (e) => {
|
|
59
|
+
setFilename(e);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
] });
|
|
64
|
+
};
|
|
65
|
+
export {
|
|
66
|
+
LoaderCommonSelect,
|
|
67
|
+
LoaderNamesSelect
|
|
68
|
+
};
|
|
@@ -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,33 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Empty, Space, Typography } from "antd";
|
|
3
|
+
import React from "react";
|
|
4
|
+
const defaultTitle = "Load data failed, please try again";
|
|
5
|
+
const defaultBottonText = "retry";
|
|
6
|
+
const FailedStatusComponent = ({
|
|
7
|
+
title = defaultTitle,
|
|
8
|
+
buttonText = defaultBottonText,
|
|
9
|
+
retry
|
|
10
|
+
}) => {
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
Empty,
|
|
13
|
+
{
|
|
14
|
+
description: /* @__PURE__ */ jsxs(Space, { direction: "vertical", children: [
|
|
15
|
+
/* @__PURE__ */ jsx(Typography.Text, { children: title }),
|
|
16
|
+
/* @__PURE__ */ jsx(
|
|
17
|
+
Button,
|
|
18
|
+
{
|
|
19
|
+
type: "primary",
|
|
20
|
+
onClick: () => {
|
|
21
|
+
retry();
|
|
22
|
+
},
|
|
23
|
+
children: buttonText
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
] })
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
const FailedStatus = React.memo(FailedStatusComponent);
|
|
31
|
+
export {
|
|
32
|
+
FailedStatus
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './failed';
|
|
@@ -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,107 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
33
|
+
import { Col, Row, Space, Tooltip, Typography } from "antd";
|
|
34
|
+
import { SDK } from "@rsdoctor/types";
|
|
35
|
+
import { ExceptionOutlined } from "@ant-design/icons";
|
|
36
|
+
import { Alerts } from "@rsdoctor/utils/common";
|
|
37
|
+
import { Size } from "../../constants";
|
|
38
|
+
import { TextDrawer } from "./index";
|
|
39
|
+
import {
|
|
40
|
+
PackageRelationAlert,
|
|
41
|
+
PackageRelationReasons,
|
|
42
|
+
PackageRelationReasonsWithServer
|
|
43
|
+
} from "../Alert/package-relation";
|
|
44
|
+
import { ServerAPIProvider } from "../Manifest";
|
|
45
|
+
const DuplicatePackageDrawerContent = (_a) => {
|
|
46
|
+
var _b = _a, {
|
|
47
|
+
duplicatePackages = [],
|
|
48
|
+
cwd,
|
|
49
|
+
children
|
|
50
|
+
} = _b, props = __objRest(_b, [
|
|
51
|
+
"duplicatePackages",
|
|
52
|
+
"cwd",
|
|
53
|
+
"children"
|
|
54
|
+
]);
|
|
55
|
+
if (!duplicatePackages.length) {
|
|
56
|
+
return /* @__PURE__ */ jsx(Space, { style: __spreadValues({ fontSize: "inherit" }, props.buttonStyle), children: /* @__PURE__ */ jsx(Typography.Text, { style: __spreadValues({ fontSize: "inherit" }, props.textStyle), children: "0" }) });
|
|
57
|
+
}
|
|
58
|
+
return /* @__PURE__ */ jsx(
|
|
59
|
+
TextDrawer,
|
|
60
|
+
__spreadProps(__spreadValues({}, props), {
|
|
61
|
+
buttonStyle: __spreadValues({ fontSize: "inherit" }, props.buttonStyle),
|
|
62
|
+
buttonProps: __spreadValues({ type: "text" }, props.buttonProps),
|
|
63
|
+
text: /* @__PURE__ */ jsx(Tooltip, { title: "Click to show the details of duplicate packages", children: /* @__PURE__ */ jsxs(Space, { style: { fontSize: "inherit" }, children: [
|
|
64
|
+
/* @__PURE__ */ jsx(Typography.Text, { strong: true, style: __spreadValues({ fontSize: "inherit", color: "inherit" }, props.textStyle), children: duplicatePackages.length }),
|
|
65
|
+
/* @__PURE__ */ jsx(ExceptionOutlined, {})
|
|
66
|
+
] }) }),
|
|
67
|
+
drawerProps: __spreadValues({ title: "Duplicate Packages Viewer" }, props.drawerProps),
|
|
68
|
+
children: /* @__PURE__ */ jsx(Row, { gutter: [Size.BasePadding, Size.BasePadding], children: duplicatePackages.map((err, i) => {
|
|
69
|
+
return /* @__PURE__ */ jsx(Col, { span: 24, children: /* @__PURE__ */ jsx(PackageRelationAlert, { data: err, cwd, getPackageRelationContentComponent: children }) }, i);
|
|
70
|
+
}) })
|
|
71
|
+
})
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
const DuplicatePackageDrawer = (_c) => {
|
|
75
|
+
var _d = _c, { moduleGraph } = _d, props = __objRest(_d, ["moduleGraph"]);
|
|
76
|
+
return /* @__PURE__ */ jsx(DuplicatePackageDrawerContent, __spreadProps(__spreadValues({}, props), { children: (res) => {
|
|
77
|
+
return /* @__PURE__ */ jsx(
|
|
78
|
+
ServerAPIProvider,
|
|
79
|
+
{
|
|
80
|
+
api: SDK.ServerAPI.API.GetModuleCodeByModuleIds,
|
|
81
|
+
body: { moduleIds: moduleGraph.modules.map((mod) => mod.id) },
|
|
82
|
+
children: (moduleCodes) => /* @__PURE__ */ jsx(
|
|
83
|
+
PackageRelationReasons,
|
|
84
|
+
{
|
|
85
|
+
data: Alerts.getPackageRelationAlertDetails(
|
|
86
|
+
moduleGraph.modules,
|
|
87
|
+
moduleGraph.dependencies,
|
|
88
|
+
props.cwd,
|
|
89
|
+
res.package.dependencies,
|
|
90
|
+
moduleCodes
|
|
91
|
+
),
|
|
92
|
+
cwd: props.cwd
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
} }));
|
|
98
|
+
};
|
|
99
|
+
const DuplicatePackageDrawerWithServer = (props) => {
|
|
100
|
+
return /* @__PURE__ */ jsx(DuplicatePackageDrawerContent, __spreadProps(__spreadValues({}, props), { children: (res) => {
|
|
101
|
+
return /* @__PURE__ */ jsx(PackageRelationReasonsWithServer, { body: { id: res.data.id, target: res.package.target }, cwd: props.cwd });
|
|
102
|
+
} }));
|
|
103
|
+
};
|
|
104
|
+
export {
|
|
105
|
+
DuplicatePackageDrawer,
|
|
106
|
+
DuplicatePackageDrawerWithServer
|
|
107
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ButtonProps, DrawerProps } from 'antd';
|
|
2
|
+
import React, { CSSProperties, 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
|
+
}
|
|
10
|
+
export declare const TextDrawer: (props: PropsWithChildren<TextDrawerProps>) => JSX.Element;
|
|
11
|
+
export * from './duplicate';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
+
import { Button, Drawer } from "antd";
|
|
22
|
+
import React, { useState } from "react";
|
|
23
|
+
import { drawerWidth } from "../../constants";
|
|
24
|
+
const TextDrawer = (props) => {
|
|
25
|
+
const [visible, setVisible] = useState(false);
|
|
26
|
+
return /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
27
|
+
props.button ? /* @__PURE__ */ jsx("div", { onClick: () => setVisible(!visible), children: props.button }) : /* @__PURE__ */ jsx(
|
|
28
|
+
Button,
|
|
29
|
+
__spreadProps(__spreadValues({
|
|
30
|
+
type: "link"
|
|
31
|
+
}, props.buttonProps), {
|
|
32
|
+
onClick: () => setVisible(!visible),
|
|
33
|
+
style: __spreadValues({ padding: 0 }, props.buttonStyle),
|
|
34
|
+
children: props.text
|
|
35
|
+
})
|
|
36
|
+
),
|
|
37
|
+
/* @__PURE__ */ jsx(
|
|
38
|
+
Drawer,
|
|
39
|
+
__spreadProps(__spreadValues({
|
|
40
|
+
maskClosable: true,
|
|
41
|
+
width: drawerWidth,
|
|
42
|
+
zIndex: 999
|
|
43
|
+
}, props.drawerProps), {
|
|
44
|
+
open: visible,
|
|
45
|
+
onClose: () => setVisible(false),
|
|
46
|
+
destroyOnClose: true,
|
|
47
|
+
children: props.children
|
|
48
|
+
})
|
|
49
|
+
)
|
|
50
|
+
] });
|
|
51
|
+
};
|
|
52
|
+
export * from "./duplicate";
|
|
53
|
+
export {
|
|
54
|
+
TextDrawer
|
|
55
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
interface TitleProps {
|
|
3
|
+
/**
|
|
4
|
+
* @default true
|
|
5
|
+
*/
|
|
6
|
+
upperFisrt?: 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,10 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Typography } from "antd";
|
|
3
|
+
import { upperFirst as upf } from "lodash-es";
|
|
4
|
+
const Title = ({ upperFisrt = true, fontSize = 16, text, hash }) => {
|
|
5
|
+
const t = typeof text === "string" ? upperFisrt ? upf(text) : text : text;
|
|
6
|
+
return /* @__PURE__ */ jsx(Typography.Text, { style: { fontSize }, strong: true, children: hash ? /* @__PURE__ */ jsx("a", { href: hash, id: hash.replace(/^#/, ""), style: { color: "inherit" }, children: t }) : t });
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
Title
|
|
10
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./Alert";
|
|
2
|
+
export * from "./Alerts";
|
|
3
|
+
export * from "./Badge";
|
|
4
|
+
export * from "./Card";
|
|
5
|
+
export * from "./CodeViewer";
|
|
6
|
+
export * from "./Layout";
|
|
7
|
+
export * from "./Overall";
|
|
8
|
+
import { TimelineCom } from "./Charts/TimelineCharts";
|
|
9
|
+
export {
|
|
10
|
+
TimelineCom
|
|
11
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ECMAVersion } from '@rsdoctor/utils/ruleUtils';
|
|
3
|
+
export declare function useECMAVersionDetectWorker(props: {
|
|
4
|
+
code: string;
|
|
5
|
+
}): {
|
|
6
|
+
version: ECMAVersion | undefined;
|
|
7
|
+
};
|
|
8
|
+
export declare const ECMAVersionDetectTag: React.FC<{
|
|
9
|
+
code: string;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
const import_meta = {};
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { BadgeColorMap, BadgeType } from "../../Badge";
|
|
5
|
+
import { ECMAVersion } from "@rsdoctor/utils/ruleUtils";
|
|
6
|
+
import { master } from "../../../utils/worker";
|
|
7
|
+
const getECMAVersionDetectWorker = () => new Worker(new URL("./worker.ts", import_meta.url));
|
|
8
|
+
function useECMAVersionDetectWorker(props) {
|
|
9
|
+
const { code } = props;
|
|
10
|
+
const [version, setVersion] = useState();
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (!code)
|
|
13
|
+
return;
|
|
14
|
+
const worker = master.detectWorker(getECMAVersionDetectWorker);
|
|
15
|
+
const { abort } = worker.emit(code, (data) => {
|
|
16
|
+
setVersion(data);
|
|
17
|
+
});
|
|
18
|
+
return () => {
|
|
19
|
+
abort();
|
|
20
|
+
};
|
|
21
|
+
}, [code]);
|
|
22
|
+
return {
|
|
23
|
+
version
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const TagColor = {
|
|
27
|
+
[ECMAVersion.ES5]: BadgeColorMap[BadgeType.Success],
|
|
28
|
+
[ECMAVersion.ES6]: BadgeColorMap[BadgeType.Error],
|
|
29
|
+
[ECMAVersion.ES7P]: BadgeColorMap[BadgeType.Error]
|
|
30
|
+
};
|
|
31
|
+
const ECMAVersionDetectTag = ({ code }) => {
|
|
32
|
+
if (!code)
|
|
33
|
+
return null;
|
|
34
|
+
const height = 19.5;
|
|
35
|
+
const { version } = useECMAVersionDetectWorker({ code });
|
|
36
|
+
if (!version) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
return /* @__PURE__ */ jsx(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
style: {
|
|
43
|
+
display: "inline-block",
|
|
44
|
+
height,
|
|
45
|
+
padding: `0px 4px`,
|
|
46
|
+
width: 40,
|
|
47
|
+
fontSize: 10,
|
|
48
|
+
lineHeight: `${height}px`,
|
|
49
|
+
textAlign: "center",
|
|
50
|
+
color: "#fff",
|
|
51
|
+
background: TagColor[version] || BadgeColorMap[BadgeType.Default],
|
|
52
|
+
borderRadius: 4
|
|
53
|
+
},
|
|
54
|
+
children: version
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
ECMAVersionDetectTag,
|
|
60
|
+
useECMAVersionDetectWorker
|
|
61
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { parser } from "@rsdoctor/utils/ruleUtils";
|
|
2
|
+
import { handleMessageInWorker } from "../../../utils/worker";
|
|
3
|
+
const cache = /* @__PURE__ */ new Map();
|
|
4
|
+
handleMessageInWorker({
|
|
5
|
+
workerName: "ecmaversion",
|
|
6
|
+
handler: (code) => {
|
|
7
|
+
if (cache.has(code))
|
|
8
|
+
return cache.get(code);
|
|
9
|
+
const version = parser.utils.detectECMAVersion(code);
|
|
10
|
+
cache.set(code, version);
|
|
11
|
+
return version;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const import_meta = {};
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { Tag } from "antd";
|
|
5
|
+
import { master } from "../../../utils/worker";
|
|
6
|
+
import { useI18n } from "../../../utils";
|
|
7
|
+
const getJSEqualWorker = () => new Worker(new URL("./worker.ts", import_meta.url));
|
|
8
|
+
function useJSEqualWorker(props) {
|
|
9
|
+
const { input, output } = props;
|
|
10
|
+
const [isEqual, setIsEqual] = useState(false);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (!input || !output)
|
|
13
|
+
return;
|
|
14
|
+
const worker = master.detectWorker(getJSEqualWorker);
|
|
15
|
+
const { abort } = worker.emit({ input, output }, (data) => {
|
|
16
|
+
setIsEqual(data);
|
|
17
|
+
});
|
|
18
|
+
return () => {
|
|
19
|
+
abort();
|
|
20
|
+
};
|
|
21
|
+
}, [input, output]);
|
|
22
|
+
return {
|
|
23
|
+
isEqual
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const JSIsEqualTag = ({ input, output }) => {
|
|
27
|
+
if (!input || !output)
|
|
28
|
+
return null;
|
|
29
|
+
const { isEqual } = useJSEqualWorker({ input, output });
|
|
30
|
+
const { t } = useI18n();
|
|
31
|
+
if (!isEqual) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
return /* @__PURE__ */ jsx(Tag, { color: "warning", children: t("the file content not changed after transpiled by this loader") });
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
JSIsEqualTag,
|
|
38
|
+
useJSEqualWorker
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
3
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
4
|
+
};
|
|
5
|
+
var __async = (__this, __arguments, generator) => {
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
var fulfilled = (value) => {
|
|
8
|
+
try {
|
|
9
|
+
step(generator.next(value));
|
|
10
|
+
} catch (e) {
|
|
11
|
+
reject(e);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
var rejected = (value) => {
|
|
15
|
+
try {
|
|
16
|
+
step(generator.throw(value));
|
|
17
|
+
} catch (e) {
|
|
18
|
+
reject(e);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
22
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
import { minify as terserMinify } from "terser";
|
|
26
|
+
import { handleMessageInWorker } from "../../../utils/worker";
|
|
27
|
+
var require_worker = __commonJS({
|
|
28
|
+
"src/components/worker/jsequal/worker.ts"(exports) {
|
|
29
|
+
const cache = /* @__PURE__ */ new Map();
|
|
30
|
+
function minify(code) {
|
|
31
|
+
return terserMinify(code, {
|
|
32
|
+
module: true,
|
|
33
|
+
compress: false,
|
|
34
|
+
mangle: false,
|
|
35
|
+
sourceMap: false
|
|
36
|
+
}).then((res) => res.code);
|
|
37
|
+
}
|
|
38
|
+
handleMessageInWorker({
|
|
39
|
+
workerName: "jsequal",
|
|
40
|
+
handler: (_0) => __async(exports, [_0], function* ({ input = "", output = "" }) {
|
|
41
|
+
const key = input + output;
|
|
42
|
+
if (cache.has(key))
|
|
43
|
+
return cache.get(key);
|
|
44
|
+
const [inputMinified, outputMinified] = yield Promise.all([minify(input), minify(output)]);
|
|
45
|
+
const isEqual = inputMinified === outputMinified;
|
|
46
|
+
cache.set(key, isEqual);
|
|
47
|
+
return isEqual;
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
export default require_worker();
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Manifest } from '@rsdoctor/types';
|
|
3
|
+
import { PageState, ViewMode, Language, Theme } from './constants';
|
|
4
|
+
export interface Config {
|
|
5
|
+
locale: Language;
|
|
6
|
+
theme: Theme;
|
|
7
|
+
pageState: PageState;
|
|
8
|
+
viewMode: {
|
|
9
|
+
bundleAlerts: ViewMode;
|
|
10
|
+
compileAlerts: ViewMode;
|
|
11
|
+
};
|
|
12
|
+
json: Manifest.DoctorManifest;
|
|
13
|
+
setTheme(theme: Config['theme']): void;
|
|
14
|
+
setManifest(json: Manifest.DoctorManifest): void;
|
|
15
|
+
setPageState(state: PageState): void;
|
|
16
|
+
setViewMode(mode: Partial<Config['viewMode']>, saveStorage?: boolean): void;
|
|
17
|
+
}
|
|
18
|
+
export declare const defaultConfig: Config;
|
|
19
|
+
export declare const ConfigContext: import("react").Context<Config>;
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
import { createContext } from "react";
|
|
18
|
+
import { getLocaleFromStorage, getThemeFromStorage, getViewModeFromStorage } from "./utils/storage";
|
|
19
|
+
import { PageState } from "./constants";
|
|
20
|
+
const defaultConfig = {
|
|
21
|
+
locale: getLocaleFromStorage(),
|
|
22
|
+
theme: getThemeFromStorage(),
|
|
23
|
+
pageState: PageState.Pending,
|
|
24
|
+
viewMode: getViewModeFromStorage(),
|
|
25
|
+
json: {},
|
|
26
|
+
setTheme() {
|
|
27
|
+
},
|
|
28
|
+
setManifest() {
|
|
29
|
+
},
|
|
30
|
+
setPageState(_state) {
|
|
31
|
+
},
|
|
32
|
+
setViewMode() {
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const ConfigContext = createContext(__spreadValues({}, defaultConfig));
|
|
36
|
+
export {
|
|
37
|
+
ConfigContext,
|
|
38
|
+
defaultConfig
|
|
39
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
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 = 24,
|
|
31
|
+
BaseBorderRadius = 8,
|
|
32
|
+
NavBarHeight = 54,
|
|
33
|
+
}
|
|
34
|
+
export declare enum Color {
|
|
35
|
+
Red = "rgb(207, 19, 34)",
|
|
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
|
+
};
|