@rsdoctor/client 0.0.2-beta.0 → 0.0.2-beta.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.
- package/CHANGELOG.md +6 -0
- package/dist/index.html +1 -1
- package/dist/resource/css/index.0c35ee21.css +1 -0
- package/dist/resource/image/rsdoctor.508e522f.cc5166b8.png +0 -0
- package/dist/resource/image/rsdoctor.cc5166b8.png +0 -0
- package/dist/resource/js/{35.1be054fa.js → 35.b145fc87.js} +2 -2
- package/dist/resource/js/{35.1be054fa.js.LICENSE.txt → 35.b145fc87.js.LICENSE.txt} +7440 -7436
- package/dist/resource/js/index.9f88d7b3.js +150 -0
- package/dist/resource/js/{index.334311e0.js.LICENSE.txt → index.9f88d7b3.js.LICENSE.txt} +775 -775
- package/package.json +4 -4
- package/src/App.tsx +0 -1
- package/src/common/imgs/rsdoctor.png +0 -0
- package/src/index.tsx +1 -1
- package/dist/resource/css/index.ff20968e.css +0 -1
- package/dist/resource/js/index.334311e0.js +0 -150
- package/src/common/imgs/icon.svg +0 -21
- package/src/common/imgs/webpack.svg +0 -1
- package/src/main.tsx +0 -147
package/src/common/imgs/icon.svg
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<svg width="106.000000" height="113.000000" viewBox="0 0 106 113" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
2
|
-
<rect id="画板 934" width="106.000000" height="113.000000" fill="#FFFFFF" fill-opacity="0.035"/>
|
|
3
|
-
<g clip-path="url(#clip111_45)">
|
|
4
|
-
<rect id="矩形 2176" x="22.500000" y="10.500000" rx="3.000000" width="6.000000" height="11.000000" fill="#0F0D0D"/>
|
|
5
|
-
<rect id="矩形 2176" x="22.500000" y="10.500000" rx="3.000000" width="6.000000" height="11.000000" fill="#736C6C"/>
|
|
6
|
-
<rect id="矩形 2176" x="22.500000" y="10.500000" rx="3.000000" width="6.000000" height="11.000000" stroke="#000000" stroke-linejoin="bevel"/>
|
|
7
|
-
<rect id="矩形 2176" x="49.500000" y="10.500000" rx="3.000000" width="6.000000" height="11.000000" fill="#0F0D0D"/>
|
|
8
|
-
<rect id="矩形 2176" x="49.500000" y="10.500000" rx="3.000000" width="6.000000" height="11.000000" fill="#736C6C"/>
|
|
9
|
-
<rect id="矩形 2176" x="49.500000" y="10.500000" rx="3.000000" width="6.000000" height="11.000000" stroke="#000000" stroke-linejoin="bevel"/>
|
|
10
|
-
<path id="矢量 943" d="M24.0938 15.8218C24.0938 15.8218 14 11.3477 14 23.2773C14 35.207 26.1123 70 26.1123 70L41 70" stroke="#000000" stroke-width="5.000000"/>
|
|
11
|
-
<path id="矢量 943" d="M53.9062 15.8218C53.9062 15.8218 64 11.3477 64 23.2773C64 35.207 51.8877 70 51.8877 70L37 70" stroke="#000000" stroke-width="5.000000"/>
|
|
12
|
-
<path id="矢量 945" d="M40 83.0723C40 94.0781 48.9219 103 59.9277 103L70 103C81.0459 103 90 94.0459 90 83L90 48" stroke="#000000" stroke-width="5.000000"/>
|
|
13
|
-
<ellipse id="椭圆 54" cx="90.000000" cy="41.500000" rx="11.000000" ry="8.500000" fill="#5092FF"/>
|
|
14
|
-
<path id="矢量 946" d="M27 72C31.9609 80.7266 34.5361 81.2817 39.4443 80.9219C44.7744 81.2124 47.4326 79.7798 51 72" stroke="#000000" stroke-width="5.000000"/>
|
|
15
|
-
</g>
|
|
16
|
-
<defs>
|
|
17
|
-
<clipPath id="clip111_45">
|
|
18
|
-
<rect id="画板 934" width="106.000000" height="113.000000" fill="white"/>
|
|
19
|
-
</clipPath>
|
|
20
|
-
</defs>
|
|
21
|
-
</svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 1200 1200" xmlns="http://www.w3.org/2000/svg"><path d="m600 0 530.3 300v600l-530.3 300-530.3-300v-600z" fill="#fff"/><path d="m1035.6 879.3-418.1 236.5v-184.2l260.5-143.3zm28.6-25.9v-494.6l-153 88.3v317.9zm-901.5 25.9 418.1 236.5v-184.2l-260.5-143.3zm-28.6-25.9v-494.6l153 88.3v317.9zm17.9-526.6 428.8-242.6v178.1l-274.7 151.1-2.1 1.2zm894.3 0-428.8-242.6v178.1l274.7 151.1 2.1 1.2z" fill="#8ed6fb"/><path d="m580.8 889.7-257-141.3v-280l257 148.4zm36.7 0 257-141.3v-280l-257 148.4zm-276.3-453.7 258-141.9 258 141.9-258 149z" fill="#1c78c0"/></svg>
|
package/src/main.tsx
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { Constants } from '@rsdoctor/components';
|
|
2
|
-
import { Config, ConfigContext, defaultConfig } from '@rsdoctor/components/config';
|
|
3
|
-
import { Layout } from '@rsdoctor/components/elements';
|
|
4
|
-
import { getDemoUrl, getLocale, setThemeToStorage, setViewModeToStorage, useDetectIfCloudIdeEnv } from '@rsdoctor/components/utils';
|
|
5
|
-
import type { Manifest } from '@rsdoctor/types';
|
|
6
|
-
import { Alert, Button, ConfigProvider, Divider, Result, Space, Typography, theme as te } from 'antd';
|
|
7
|
-
import React, { useState } from 'react';
|
|
8
|
-
import { ErrorBoundary } from 'react-error-boundary';
|
|
9
|
-
import { HashRouter as BrowserRouter } from 'react-router-dom';
|
|
10
|
-
import Router from './router';
|
|
11
|
-
// import UploaderComponent from './pages/Resources/Uploader'; TODO: uploader components
|
|
12
|
-
|
|
13
|
-
const { PageState, Theme } = Constants;
|
|
14
|
-
|
|
15
|
-
const Index: React.FC = (): React.ReactElement => {
|
|
16
|
-
const ifCloudIdeEnv = useDetectIfCloudIdeEnv();
|
|
17
|
-
|
|
18
|
-
const [state, setState] = useState<Constants.PageState>(PageState.Success);
|
|
19
|
-
const [viewMode, setViewMode] = useState<Config['viewMode']>({ ...defaultConfig.viewMode });
|
|
20
|
-
const [manifest, setManifest] = useState<Manifest.DoctorManifest>();
|
|
21
|
-
const [theme, setTheme] = useState(defaultConfig.theme);
|
|
22
|
-
|
|
23
|
-
if (state === Constants.PageState.Fail) {
|
|
24
|
-
const demoUrl = getDemoUrl();
|
|
25
|
-
return (
|
|
26
|
-
<Space direction="vertical" style={{ padding: 14 }}>
|
|
27
|
-
<Typography.Text strong style={{ fontSize: 16 }}>
|
|
28
|
-
load json file of Rsdoctor failed.
|
|
29
|
-
</Typography.Text>
|
|
30
|
-
<Typography.Text>
|
|
31
|
-
try to use <Typography.Text keyboard>command + r</Typography.Text> to refresh page.
|
|
32
|
-
</Typography.Text>
|
|
33
|
-
{process.env.NODE_ENV === 'development' ? (
|
|
34
|
-
<Typography.Text>
|
|
35
|
-
in development, you need to run <Typography.Text keyboard>emo run build:analysis</Typography.Text> to make
|
|
36
|
-
sure the mock data has been generated.
|
|
37
|
-
</Typography.Text>
|
|
38
|
-
) : null}
|
|
39
|
-
<Divider />
|
|
40
|
-
<Space direction="vertical" style={{ width: '100%' }}>
|
|
41
|
-
<Typography.Text style={{ fontSize: 16 }}>
|
|
42
|
-
you can
|
|
43
|
-
<Typography.Text strong style={{ fontSize: 'inherit' }}>
|
|
44
|
-
{' '}
|
|
45
|
-
upload a file{' '}
|
|
46
|
-
</Typography.Text>
|
|
47
|
-
in the area below to analyze your project.
|
|
48
|
-
</Typography.Text>
|
|
49
|
-
{/* <UploaderComponent /> */}
|
|
50
|
-
</Space>
|
|
51
|
-
<Divider />
|
|
52
|
-
{demoUrl ? (
|
|
53
|
-
<Typography.Text style={{ fontSize: 16 }}>
|
|
54
|
-
or you can open the{' '}
|
|
55
|
-
<Typography.Text strong style={{ fontSize: 'inherit' }}>
|
|
56
|
-
<a href={demoUrl} target="_blank" rel="noreferrer">
|
|
57
|
-
demo
|
|
58
|
-
</a>
|
|
59
|
-
</Typography.Text>{' '}
|
|
60
|
-
to get started with the Rsdoctor.
|
|
61
|
-
</Typography.Text>
|
|
62
|
-
) : null}
|
|
63
|
-
</Space>
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return (
|
|
68
|
-
<BrowserRouter>
|
|
69
|
-
<ConfigContext.Provider
|
|
70
|
-
value={{
|
|
71
|
-
...defaultConfig,
|
|
72
|
-
theme,
|
|
73
|
-
setTheme: (v) => {
|
|
74
|
-
setTheme(v);
|
|
75
|
-
setThemeToStorage(v);
|
|
76
|
-
},
|
|
77
|
-
pageState: state,
|
|
78
|
-
json: manifest!,
|
|
79
|
-
viewMode,
|
|
80
|
-
setManifest,
|
|
81
|
-
setPageState: setState,
|
|
82
|
-
setViewMode(m, saveStorage = true) {
|
|
83
|
-
const res = { ...viewMode, ...m };
|
|
84
|
-
setViewMode(res);
|
|
85
|
-
saveStorage && setViewModeToStorage(res);
|
|
86
|
-
},
|
|
87
|
-
}}
|
|
88
|
-
>
|
|
89
|
-
<ConfigContext.Consumer>
|
|
90
|
-
{(v) => {
|
|
91
|
-
return (
|
|
92
|
-
<ConfigProvider
|
|
93
|
-
locale={getLocale(v.locale)}
|
|
94
|
-
theme={{
|
|
95
|
-
algorithm: theme === Theme.Dark ? te.darkAlgorithm : te.defaultAlgorithm,
|
|
96
|
-
}}
|
|
97
|
-
>
|
|
98
|
-
<Layout>
|
|
99
|
-
<>
|
|
100
|
-
{ifCloudIdeEnv && (
|
|
101
|
-
<Alert
|
|
102
|
-
message="Warning"
|
|
103
|
-
description={
|
|
104
|
-
<a
|
|
105
|
-
href={window.location.href.replace(/https/, 'http')}
|
|
106
|
-
>{`Please jump to:${window.location.href.replace(/https/, 'http')}`}</a>
|
|
107
|
-
}
|
|
108
|
-
type="warning"
|
|
109
|
-
showIcon
|
|
110
|
-
closable
|
|
111
|
-
/>
|
|
112
|
-
)}
|
|
113
|
-
<ErrorBoundary
|
|
114
|
-
FallbackComponent={({ error, resetErrorBoundary }) => (
|
|
115
|
-
<Result
|
|
116
|
-
status="error"
|
|
117
|
-
title="Sorry, something went wrong."
|
|
118
|
-
extra={
|
|
119
|
-
<Button type="primary" onClick={resetErrorBoundary} loading={state === PageState.Pending}>
|
|
120
|
-
Reload
|
|
121
|
-
</Button>
|
|
122
|
-
}
|
|
123
|
-
>
|
|
124
|
-
<Typography.Paragraph>
|
|
125
|
-
<Typography.Title level={3}>Error Stack</Typography.Title>
|
|
126
|
-
<pre>{error.stack || error.message}</pre>
|
|
127
|
-
</Typography.Paragraph>
|
|
128
|
-
</Result>
|
|
129
|
-
)}
|
|
130
|
-
onReset={() => {
|
|
131
|
-
window.location.reload();
|
|
132
|
-
}}
|
|
133
|
-
>
|
|
134
|
-
<Router />
|
|
135
|
-
</ErrorBoundary>
|
|
136
|
-
</>
|
|
137
|
-
</Layout>
|
|
138
|
-
</ConfigProvider>
|
|
139
|
-
);
|
|
140
|
-
}}
|
|
141
|
-
</ConfigContext.Consumer>
|
|
142
|
-
</ConfigContext.Provider>
|
|
143
|
-
</BrowserRouter>
|
|
144
|
-
);
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
export default Index;
|