@authing/react-ui-components 3.1.1 → 3.1.3
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/lib/index.d.ts +2573 -201
- package/lib/index.min.css +2 -1
- package/lib/index.min.js +1 -1
- package/lib/index.min.js.LICENSE.txt +42 -0
- package/lib/static/media/loading.4a67a5f3.svg +29 -0
- package/package.json +54 -18
- package/.eslintignore +0 -6
- package/.eslintrc.js +0 -7
- package/.prettierrc +0 -5
- package/.vscode/settings.json +0 -31
- package/LICENSE +0 -21
- package/config/antdReplacer.js +0 -51
- package/config/env.js +0 -106
- package/config/getHttpsConfig.js +0 -66
- package/config/jest/cssTransform.js +0 -14
- package/config/jest/fileTransform.js +0 -40
- package/config/modules.js +0 -134
- package/config/paths.js +0 -71
- package/config/pnpTs.js +0 -35
- package/config/webpack.config.js +0 -857
- package/config/webpackDevServer.config.js +0 -130
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -43
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +0 -25
- package/public/robots.txt +0 -3
- package/scripts/build.js +0 -212
- package/scripts/lib.js +0 -200
- package/scripts/start.js +0 -166
- package/scripts/test.js +0 -53
- package/src/common/AuthingDropdown/index.tsx +0 -52
- package/src/common/AuthingDropdown/style.less +0 -43
- package/src/common/AuthingTabs/index.tsx +0 -98
- package/src/common/AuthingTabs/style.less +0 -135
- package/src/common/CopyAbleText/index.tsx +0 -54
- package/src/common/CopyAbleText/style.less +0 -13
- package/src/common/VerifyCodeInput/index.tsx +0 -76
- package/src/common/VerifyCodeInput/style.less +0 -24
- package/src/components/AuthingGuard/AppMFALayout/index.tsx +0 -74
- package/src/components/AuthingGuard/AppMFALayout/style.less +0 -12
- package/src/components/AuthingGuard/CompleteUserInfoLayout/index.tsx +0 -29
- package/src/components/AuthingGuard/CompleteUserInfoLayout/style.less +0 -8
- package/src/components/AuthingGuard/Forms/ADLoginForm/index.tsx +0 -117
- package/src/components/AuthingGuard/Forms/Agreements/index.tsx +0 -81
- package/src/components/AuthingGuard/Forms/Agreements/style.less +0 -44
- package/src/components/AuthingGuard/Forms/CompleteUserInfoForm/index.tsx +0 -139
- package/src/components/AuthingGuard/Forms/EmailMfaVerifyForm/CheckEmailForm.tsx +0 -86
- package/src/components/AuthingGuard/Forms/EmailMfaVerifyForm/VerifyCodeForm.tsx +0 -116
- package/src/components/AuthingGuard/Forms/EmailMfaVerifyForm/index.tsx +0 -40
- package/src/components/AuthingGuard/Forms/EmailMfaVerifyForm/style.less +0 -0
- package/src/components/AuthingGuard/Forms/EmailRegisterForm/index.tsx +0 -181
- package/src/components/AuthingGuard/Forms/EmailRegisterForm/style.less +0 -0
- package/src/components/AuthingGuard/Forms/LdapLoginForm/index.tsx +0 -161
- package/src/components/AuthingGuard/Forms/LdapLoginForm/style.less +0 -0
- package/src/components/AuthingGuard/Forms/LoginFormFooter/index.tsx +0 -76
- package/src/components/AuthingGuard/Forms/LoginFormFooter/style.less +0 -6
- package/src/components/AuthingGuard/Forms/MfaResetCodeForm/Step1.tsx +0 -86
- package/src/components/AuthingGuard/Forms/MfaResetCodeForm/Step2.tsx +0 -53
- package/src/components/AuthingGuard/Forms/MfaResetCodeForm/index.tsx +0 -65
- package/src/components/AuthingGuard/Forms/MfaResetCodeForm/style.less +0 -20
- package/src/components/AuthingGuard/Forms/MfaVerifyForm/index.tsx +0 -105
- package/src/components/AuthingGuard/Forms/MfaVerifyForm/style.less +0 -12
- package/src/components/AuthingGuard/Forms/PasswordLoginForm/index.tsx +0 -261
- package/src/components/AuthingGuard/Forms/PhoneCodeLoginForm/index.tsx +0 -133
- package/src/components/AuthingGuard/Forms/PhoneRegisterForm/index.tsx +0 -202
- package/src/components/AuthingGuard/Forms/QrCodeLoginForm/index.tsx +0 -61
- package/src/components/AuthingGuard/Forms/QrCodeLoginForm/style.less +0 -14
- package/src/components/AuthingGuard/Forms/RegisterFormFooter/index.tsx +0 -56
- package/src/components/AuthingGuard/Forms/RegisterFormFooter/style.less +0 -0
- package/src/components/AuthingGuard/Forms/ResetPwdForm/Footer.tsx +0 -21
- package/src/components/AuthingGuard/Forms/ResetPwdForm/Step1.tsx +0 -86
- package/src/components/AuthingGuard/Forms/ResetPwdForm/Step2.tsx +0 -127
- package/src/components/AuthingGuard/Forms/ResetPwdForm/Step3.tsx +0 -141
- package/src/components/AuthingGuard/Forms/ResetPwdForm/Step4.tsx +0 -51
- package/src/components/AuthingGuard/Forms/ResetPwdForm/index.tsx +0 -96
- package/src/components/AuthingGuard/Forms/ResetPwdForm/style.less +0 -3
- package/src/components/AuthingGuard/Forms/SendPhoneCode/SendCodeBtn.tsx +0 -88
- package/src/components/AuthingGuard/Forms/SendPhoneCode/index.tsx +0 -50
- package/src/components/AuthingGuard/Forms/SendPhoneCode/style.less +0 -26
- package/src/components/AuthingGuard/Forms/SmsMfaVerifyForm/CheckPhoneForm.tsx +0 -86
- package/src/components/AuthingGuard/Forms/SmsMfaVerifyForm/VerifyCodeForm.tsx +0 -113
- package/src/components/AuthingGuard/Forms/SmsMfaVerifyForm/index.tsx +0 -40
- package/src/components/AuthingGuard/Forms/SmsMfaVerifyForm/style.less +0 -3
- package/src/components/AuthingGuard/Forms/SocialAndIdpLogin/index.tsx +0 -325
- package/src/components/AuthingGuard/Forms/SocialAndIdpLogin/style.less +0 -75
- package/src/components/AuthingGuard/Forms/UploadImage/index.tsx +0 -70
- package/src/components/AuthingGuard/Forms/index.ts +0 -13
- package/src/components/AuthingGuard/GuardLayout/index.tsx +0 -488
- package/src/components/AuthingGuard/GuardLayout/style.less +0 -111
- package/src/components/AuthingGuard/Header/index.tsx +0 -28
- package/src/components/AuthingGuard/Header/style.less +0 -64
- package/src/components/AuthingGuard/IconFont/iconfont.js +0 -74
- package/src/components/AuthingGuard/IconFont/index.tsx +0 -19
- package/src/components/AuthingGuard/IconFont/style.less +0 -6
- package/src/components/AuthingGuard/IconFont/svg.js +0 -2
- package/src/components/AuthingGuard/LoginLayout/index.tsx +0 -205
- package/src/components/AuthingGuard/LoginLayout/style.less +0 -0
- package/src/components/AuthingGuard/MfaLayout/Steps.ts +0 -4
- package/src/components/AuthingGuard/MfaLayout/index.tsx +0 -49
- package/src/components/AuthingGuard/MfaLayout/style.less +0 -3
- package/src/components/AuthingGuard/RegisterLayout/index.tsx +0 -89
- package/src/components/AuthingGuard/RegisterLayout/style.less +0 -0
- package/src/components/AuthingGuard/ResetPwdLayout/index.tsx +0 -20
- package/src/components/AuthingGuard/ToggleLang/index.tsx +0 -51
- package/src/components/AuthingGuard/api/appConfig.ts +0 -154
- package/src/components/AuthingGuard/api/http.ts +0 -88
- package/src/components/AuthingGuard/api/index.ts +0 -3
- package/src/components/AuthingGuard/api/sso.ts +0 -29
- package/src/components/AuthingGuard/api/userPoolConfig.ts +0 -112
- package/src/components/AuthingGuard/constants.ts +0 -107
- package/src/components/AuthingGuard/hooks/index.tsx +0 -70
- package/src/components/AuthingGuard/hooks/useScreenSize.tsx +0 -68
- package/src/components/AuthingGuard/index.tsx +0 -134
- package/src/components/AuthingGuard/locales/en/common.json +0 -185
- package/src/components/AuthingGuard/locales/en/index.ts +0 -6
- package/src/components/AuthingGuard/locales/en/login.json +0 -94
- package/src/components/AuthingGuard/locales/en/map.json +0 -4
- package/src/components/AuthingGuard/locales/en/user.json +0 -81
- package/src/components/AuthingGuard/locales/index.ts +0 -45
- package/src/components/AuthingGuard/locales/zh/common.json +0 -185
- package/src/components/AuthingGuard/locales/zh/index.ts +0 -6
- package/src/components/AuthingGuard/locales/zh/login.json +0 -94
- package/src/components/AuthingGuard/locales/zh/map.json +0 -4
- package/src/components/AuthingGuard/locales/zh/user.json +0 -81
- package/src/components/AuthingGuard/style.less +0 -104
- package/src/components/AuthingGuard/types/Forms.ts +0 -95
- package/src/components/AuthingGuard/types/GuardConfig.ts +0 -424
- package/src/components/AuthingGuard/types/GuardState.ts +0 -7
- package/src/components/AuthingGuard/types/Locales.ts +0 -12
- package/src/components/AuthingGuard/types/index.ts +0 -4
- package/src/components/index.ts +0 -7
- package/src/context/base.tsx +0 -28
- package/src/context/global/context.tsx +0 -39
- package/src/context/global/reducer.tsx +0 -56
- package/src/index.tsx +0 -142
- package/src/logo.svg +0 -7
- package/src/react-app-env.d.ts +0 -71
- package/src/reportWebVitals.ts +0 -15
- package/src/setupTests.ts +0 -5
- package/src/utils/clipboard.ts +0 -27
- package/src/utils/index.ts +0 -180
- package/src/utils/popupCenter.ts +0 -48
- package/tsconfig.json +0 -24
|
@@ -1,9 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
object-assign
|
|
3
|
+
(c) Sindre Sorhus
|
|
4
|
+
@license MIT
|
|
5
|
+
*/
|
|
6
|
+
|
|
1
7
|
/*!
|
|
2
8
|
Copyright (c) 2017 Jed Watson.
|
|
3
9
|
Licensed under the MIT License (MIT), see
|
|
4
10
|
http://jedwatson.github.io/classnames
|
|
5
11
|
*/
|
|
6
12
|
|
|
13
|
+
/*! *****************************************************************************
|
|
14
|
+
Copyright (c) Microsoft Corporation.
|
|
15
|
+
|
|
16
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
17
|
+
purpose with or without fee is hereby granted.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
20
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
21
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
22
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
23
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
24
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
25
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
26
|
+
***************************************************************************** */
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @license
|
|
30
|
+
* Copyright 2020 Google LLC. All Rights Reserved.
|
|
31
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
32
|
+
* you may not use this file except in compliance with the License.
|
|
33
|
+
* You may obtain a copy of the License at
|
|
34
|
+
*
|
|
35
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
36
|
+
*
|
|
37
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
38
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
39
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
40
|
+
* See the License for the specific language governing permissions and
|
|
41
|
+
* limitations under the License.
|
|
42
|
+
* =============================================================================
|
|
43
|
+
*/
|
|
44
|
+
|
|
7
45
|
/**
|
|
8
46
|
* @license
|
|
9
47
|
* Lodash <https://lodash.com/>
|
|
@@ -35,3 +73,7 @@
|
|
|
35
73
|
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
36
74
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
37
75
|
*/
|
|
76
|
+
|
|
77
|
+
//! moment.js
|
|
78
|
+
|
|
79
|
+
//! moment.js locale configuration
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<svg width="100%" height="100%"
|
|
2
|
+
viewBox="0 0 150 150" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<style>
|
|
4
|
+
#path-f {
|
|
5
|
+
fill: none;
|
|
6
|
+
stroke: #eaebee;
|
|
7
|
+
stroke-width: 10;
|
|
8
|
+
stroke-dasharray: 100 220;
|
|
9
|
+
animation: dash 40s infinite linear forwards;
|
|
10
|
+
}
|
|
11
|
+
#path-b {
|
|
12
|
+
fill: none;
|
|
13
|
+
stroke: #0080ff;
|
|
14
|
+
stroke-width: 8;
|
|
15
|
+
stroke-linecap: round;
|
|
16
|
+
stroke-linejoin: round;
|
|
17
|
+
}
|
|
18
|
+
@keyframes dash {
|
|
19
|
+
to {
|
|
20
|
+
stroke-dashoffset: 12000;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
</style>
|
|
24
|
+
<title>Loading</title>
|
|
25
|
+
<g id="单独" transform="translate(25.000000, 16.000000)" fill-rule="nonzero" stroke-width="2" >
|
|
26
|
+
<path d="M50,0 L0,30 C0,31 0,32 0,33 C0,69 20,100 50,116 C79,100 100,69 100,33 C100,32 99,31 99,30 L50,0 Z" id="path-b"/>
|
|
27
|
+
<path d="M50,0 L0,30 C0,31 0,32 0,33 C0,69 20,100 50,116 C79,100 100,69 100,33 C100,32 99,31 99,30 L50,0 Z" id="path-f"/>
|
|
28
|
+
</g>
|
|
29
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,23 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authing/react-ui-components",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "lib/index.min.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
|
+
"types": "react-app-env.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"lib"
|
|
11
|
+
],
|
|
7
12
|
"dependencies": {
|
|
8
13
|
"antd": "^4.8.0",
|
|
9
|
-
"authing-js-sdk": "4.23.1",
|
|
10
|
-
"
|
|
14
|
+
"authing-js-sdk": "4.23.29-alpha.1",
|
|
15
|
+
"face-api.js": "^0.22.2",
|
|
16
|
+
"fastclick": "^1.0.6",
|
|
17
|
+
"global": "^4.4.0",
|
|
18
|
+
"phone": "^3.1.12",
|
|
19
|
+
"qs": "^6.9.4",
|
|
20
|
+
"react-responsive": "^9.0.0-beta.5",
|
|
21
|
+
"react-use": "^17.3.1",
|
|
22
|
+
"wildcard": "^1.1.2"
|
|
11
23
|
},
|
|
12
24
|
"peerDependencies": {
|
|
13
|
-
"react": "
|
|
14
|
-
"react-dom": "
|
|
25
|
+
"react": ">=16.9.0",
|
|
26
|
+
"react-dom": ">=16.9.0"
|
|
15
27
|
},
|
|
16
28
|
"scripts": {
|
|
17
|
-
"
|
|
18
|
-
"build": "node scripts/
|
|
19
|
-
"
|
|
20
|
-
"
|
|
29
|
+
"build": "node ./scripts/build.js",
|
|
30
|
+
"build:lib": "node ./scripts/lib.js",
|
|
31
|
+
"clear": "clear:lib && clear:dist",
|
|
32
|
+
"clear:dist": "rm -rf dist",
|
|
33
|
+
"clear:lib": "rm -rf lib",
|
|
34
|
+
"log-tag": "node ./scripts/tag.js",
|
|
35
|
+
"pretty-quick": "pretty-quick",
|
|
36
|
+
"prestart": "npm run log-tag && npm run version && npm run generate-examples",
|
|
37
|
+
"prebuild:lib": "npm run log-tag && npm run version",
|
|
38
|
+
"prepare": "cd ../.. && husky install packages/react-components/.husky",
|
|
39
|
+
"pub": "npm run build:lib && node ./scripts/publish.js",
|
|
40
|
+
"start": "PORT=1221 node ./scripts/start.js",
|
|
41
|
+
"vite": "vite",
|
|
42
|
+
"version": "node ./scripts/generate-version",
|
|
43
|
+
"generate-examples": "node ./scripts/generate-examples.js"
|
|
21
44
|
},
|
|
22
45
|
"publishConfig": {
|
|
23
46
|
"access": "public",
|
|
@@ -43,21 +66,21 @@
|
|
|
43
66
|
},
|
|
44
67
|
"jest": {
|
|
45
68
|
"roots": [
|
|
46
|
-
"<rootDir>/
|
|
69
|
+
"<rootDir>/components"
|
|
47
70
|
],
|
|
48
71
|
"collectCoverageFrom": [
|
|
49
|
-
"
|
|
50
|
-
"!
|
|
72
|
+
"components/**/*.{js,jsx,ts,tsx}",
|
|
73
|
+
"!components/**/*.d.ts"
|
|
51
74
|
],
|
|
52
75
|
"setupFiles": [
|
|
53
76
|
"react-app-polyfill/jsdom"
|
|
54
77
|
],
|
|
55
78
|
"setupFilesAfterEnv": [
|
|
56
|
-
"<rootDir>/
|
|
79
|
+
"<rootDir>/components/setupTests.ts"
|
|
57
80
|
],
|
|
58
81
|
"testMatch": [
|
|
59
|
-
"<rootDir>/
|
|
60
|
-
"<rootDir>/
|
|
82
|
+
"<rootDir>/components/**/__tests__/**/*.{js,jsx,ts,tsx}",
|
|
83
|
+
"<rootDir>/components/**/*.{spec,test}.{js,jsx,ts,tsx}"
|
|
61
84
|
],
|
|
62
85
|
"testEnvironment": "jsdom",
|
|
63
86
|
"testRunner": "/Users/lixpng/workspace/authing/ui-components/packages/react-components/node_modules/jest-circus/runner.js",
|
|
@@ -100,13 +123,20 @@
|
|
|
100
123
|
},
|
|
101
124
|
"devDependencies": {
|
|
102
125
|
"@ant-design/icons": "^4.2.2",
|
|
103
|
-
"@babel/core": "7.
|
|
126
|
+
"@babel/core": "^7.17.8",
|
|
127
|
+
"@babel/plugin-proposal-class-properties": "^7.16.7",
|
|
128
|
+
"@babel/plugin-transform-runtime": "^7.17.0",
|
|
129
|
+
"@babel/preset-env": "^7.16.11",
|
|
130
|
+
"@babel/preset-flow": "^7.16.7",
|
|
131
|
+
"@babel/preset-react": "^7.16.7",
|
|
132
|
+
"@babel/preset-typescript": "^7.16.7",
|
|
104
133
|
"@pmmmwh/react-refresh-webpack-plugin": "0.4.2",
|
|
105
134
|
"@svgr/webpack": "5.4.0",
|
|
106
135
|
"@testing-library/jest-dom": "^5.11.4",
|
|
107
136
|
"@testing-library/react": "^11.1.0",
|
|
108
137
|
"@testing-library/user-event": "^12.1.10",
|
|
109
138
|
"@types/jest": "^26.0.15",
|
|
139
|
+
"@types/lodash": "^4.14.175",
|
|
110
140
|
"@types/node": "^12.0.0",
|
|
111
141
|
"@types/qs": "^6.9.5",
|
|
112
142
|
"@types/react": "^16.9.53",
|
|
@@ -114,6 +144,7 @@
|
|
|
114
144
|
"@types/shortid": "^0.0.29",
|
|
115
145
|
"@typescript-eslint/eslint-plugin": "^4.5.0",
|
|
116
146
|
"@typescript-eslint/parser": "^4.5.0",
|
|
147
|
+
"@vitejs/plugin-react": "1.1.0",
|
|
117
148
|
"babel-eslint": "^10.1.0",
|
|
118
149
|
"babel-jest": "^26.6.0",
|
|
119
150
|
"babel-loader": "8.1.0",
|
|
@@ -123,6 +154,8 @@
|
|
|
123
154
|
"bfj": "^7.0.2",
|
|
124
155
|
"camelcase": "^6.1.0",
|
|
125
156
|
"case-sensitive-paths-webpack-plugin": "2.3.0",
|
|
157
|
+
"chalk": "^4.1.2",
|
|
158
|
+
"cross-env": "^7.0.3",
|
|
126
159
|
"css-loader": "4.3.0",
|
|
127
160
|
"dotenv": "8.2.0",
|
|
128
161
|
"dotenv-expand": "5.1.0",
|
|
@@ -141,6 +174,7 @@
|
|
|
141
174
|
"file-loader": "6.1.1",
|
|
142
175
|
"fs-extra": "^9.0.1",
|
|
143
176
|
"html-webpack-plugin": "4.5.0",
|
|
177
|
+
"husky": "^7.0.4",
|
|
144
178
|
"i18next": "^20.1.0",
|
|
145
179
|
"i18next-browser-languagedetector": "^6.1.0",
|
|
146
180
|
"identity-obj-proxy": "3.0.0",
|
|
@@ -161,6 +195,7 @@
|
|
|
161
195
|
"postcss-rename-selector": "^0.1.1",
|
|
162
196
|
"postcss-safe-parser": "5.0.2",
|
|
163
197
|
"prettier": "^2.1.2",
|
|
198
|
+
"pretty-quick": "^3.0.0",
|
|
164
199
|
"query-string": "^7.0.0",
|
|
165
200
|
"react": "16.14.0",
|
|
166
201
|
"react-app-polyfill": "^2.0.0",
|
|
@@ -172,18 +207,19 @@
|
|
|
172
207
|
"resolve-url-loader": "^3.1.2",
|
|
173
208
|
"sass-loader": "8.0.2",
|
|
174
209
|
"semver": "7.3.2",
|
|
210
|
+
"shelljs": "^0.8.4",
|
|
175
211
|
"shortid": "^2.2.16",
|
|
176
212
|
"style-loader": "1.3.0",
|
|
177
213
|
"terser-webpack-plugin": "4.2.3",
|
|
178
214
|
"ts-pnp": "1.2.0",
|
|
179
215
|
"typescript": "^4.0.3",
|
|
180
216
|
"url-loader": "4.1.1",
|
|
217
|
+
"vite": "^2.6.14",
|
|
181
218
|
"web-vitals": "^0.2.4",
|
|
182
219
|
"webpack": "4.44.2",
|
|
183
220
|
"webpack-bundle-analyzer": "^4.1.0",
|
|
184
221
|
"webpack-dev-server": "3.11.0",
|
|
185
222
|
"webpack-manifest-plugin": "2.2.0",
|
|
186
223
|
"workbox-webpack-plugin": "5.1.4"
|
|
187
|
-
}
|
|
188
|
-
"gitHead": "2fd4f4170d33b498f325dd026a727bd021f0cf32"
|
|
224
|
+
}
|
|
189
225
|
}
|
package/.eslintignore
DELETED
package/.eslintrc.js
DELETED
package/.prettierrc
DELETED
package/.vscode/settings.json
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"eslint.validate": [
|
|
3
|
-
"javascript",
|
|
4
|
-
"javascriptreact",
|
|
5
|
-
"typescript",
|
|
6
|
-
"typescriptreact"
|
|
7
|
-
],
|
|
8
|
-
"files.associations": {
|
|
9
|
-
"*.mw.json": "jsonc",
|
|
10
|
-
"*.icon": "xml"
|
|
11
|
-
},
|
|
12
|
-
"cssModules.camelCase": true,
|
|
13
|
-
"editor.snippetSuggestions": "top",
|
|
14
|
-
"emmet.showSuggestionsAsSnippets": true,
|
|
15
|
-
"editor.formatOnSave": true,
|
|
16
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
17
|
-
"typescript.tsdk": "node_modules/typescript/lib",
|
|
18
|
-
"editor.codeActionsOnSave": {
|
|
19
|
-
"source.fixAll": true
|
|
20
|
-
},
|
|
21
|
-
"prettier.printWidth": 120,
|
|
22
|
-
"prettier.singleQuote": false,
|
|
23
|
-
"prettier.semi": true,
|
|
24
|
-
"i18n-ally.localesPaths": "src/components/AuthingGuard/locales",
|
|
25
|
-
"i18n-ally.displayLanguage": "zh",
|
|
26
|
-
"i18n-ally.keystyle": "nested",
|
|
27
|
-
"i18n-ally.annotations": true,
|
|
28
|
-
"i18n-ally.extract.targetPickingStrategy": "file-previous",
|
|
29
|
-
"i18n-ally.namespace": true,
|
|
30
|
-
"i18n-ally.sourceLanguage": "zh"
|
|
31
|
-
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2018 Authing
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/config/antdReplacer.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 全面提高 antd 样式优先级
|
|
3
|
-
* https://juejin.cn/post/6844904116288749581#heading-8
|
|
4
|
-
* https://github.com/fi3ework/postcss-rename-selector/blob/master/src/presets/antd.ts
|
|
5
|
-
* */
|
|
6
|
-
|
|
7
|
-
const parser = require('postcss-selector-parser')
|
|
8
|
-
|
|
9
|
-
function antdScopeReplacerFn(node) {
|
|
10
|
-
if (node.type !== 'selector') return
|
|
11
|
-
|
|
12
|
-
const firstAntClassNodeIndex = node.nodes.findIndex((n) => {
|
|
13
|
-
return n.type === 'class' && n.value.startsWith('authing-')
|
|
14
|
-
})
|
|
15
|
-
if (firstAntClassNodeIndex < 0) return
|
|
16
|
-
|
|
17
|
-
const firstAntClassNode = node.nodes[firstAntClassNodeIndex]
|
|
18
|
-
const prevNode = node.nodes[firstAntClassNodeIndex - 1]
|
|
19
|
-
|
|
20
|
-
// preserve line break
|
|
21
|
-
const spaces = {
|
|
22
|
-
before: firstAntClassNode.rawSpaceBefore,
|
|
23
|
-
after: firstAntClassNode.rawSpaceAfter,
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
firstAntClassNode.setPropertyWithoutEscape('rawSpaceBefore', '')
|
|
27
|
-
const toInsert = []
|
|
28
|
-
|
|
29
|
-
if (firstAntClassNodeIndex === 0 || prevNode.type === 'combinator') {
|
|
30
|
-
const universal = parser.universal({
|
|
31
|
-
value: '*',
|
|
32
|
-
})
|
|
33
|
-
toInsert.push(universal)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const attr = parser.attribute({
|
|
37
|
-
attribute: 'class',
|
|
38
|
-
operator: '*=',
|
|
39
|
-
value: `"authing-"`,
|
|
40
|
-
raws: {},
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
toInsert.push(attr)
|
|
44
|
-
toInsert[0].spaces = spaces
|
|
45
|
-
|
|
46
|
-
firstAntClassNode.parent.nodes.splice(firstAntClassNodeIndex, 0, ...toInsert)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
module.exports = {
|
|
50
|
-
antdScopeReplacerFn,
|
|
51
|
-
}
|
package/config/env.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const paths = require('./paths');
|
|
6
|
-
|
|
7
|
-
// Make sure that including paths.js after env.js will read .env variables.
|
|
8
|
-
delete require.cache[require.resolve('./paths')];
|
|
9
|
-
|
|
10
|
-
const NODE_ENV = process.env.NODE_ENV;
|
|
11
|
-
if (!NODE_ENV) {
|
|
12
|
-
throw new Error(
|
|
13
|
-
'The NODE_ENV environment variable is required but was not specified.'
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
|
|
18
|
-
const dotenvFiles = [
|
|
19
|
-
`${paths.dotenv}.${NODE_ENV}.local`,
|
|
20
|
-
// Don't include `.env.local` for `test` environment
|
|
21
|
-
// since normally you expect tests to produce the same
|
|
22
|
-
// results for everyone
|
|
23
|
-
NODE_ENV !== 'test' && `${paths.dotenv}.local`,
|
|
24
|
-
`${paths.dotenv}.${NODE_ENV}`,
|
|
25
|
-
paths.dotenv,
|
|
26
|
-
].filter(Boolean);
|
|
27
|
-
|
|
28
|
-
// Load environment variables from .env* files. Suppress warnings using silent
|
|
29
|
-
// if this file is missing. dotenv will never modify any environment variables
|
|
30
|
-
// that have already been set. Variable expansion is supported in .env files.
|
|
31
|
-
// https://github.com/motdotla/dotenv
|
|
32
|
-
// https://github.com/motdotla/dotenv-expand
|
|
33
|
-
dotenvFiles.forEach(dotenvFile => {
|
|
34
|
-
if (fs.existsSync(dotenvFile)) {
|
|
35
|
-
require('dotenv-expand')(
|
|
36
|
-
require('dotenv').config({
|
|
37
|
-
path: dotenvFile,
|
|
38
|
-
})
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
// We support resolving modules according to `NODE_PATH`.
|
|
44
|
-
// This lets you use absolute paths in imports inside large monorepos:
|
|
45
|
-
// https://github.com/facebook/create-react-app/issues/253.
|
|
46
|
-
// It works similar to `NODE_PATH` in Node itself:
|
|
47
|
-
// https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
|
|
48
|
-
// Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
|
|
49
|
-
// Otherwise, we risk importing Node.js core modules into an app instead of webpack shims.
|
|
50
|
-
// https://github.com/facebook/create-react-app/issues/1023#issuecomment-265344421
|
|
51
|
-
// We also resolve them to make sure all tools using them work consistently.
|
|
52
|
-
const appDirectory = fs.realpathSync(process.cwd());
|
|
53
|
-
process.env.NODE_PATH = (process.env.NODE_PATH || '')
|
|
54
|
-
.split(path.delimiter)
|
|
55
|
-
.filter(folder => folder && !path.isAbsolute(folder))
|
|
56
|
-
.map(folder => path.resolve(appDirectory, folder))
|
|
57
|
-
.join(path.delimiter);
|
|
58
|
-
|
|
59
|
-
// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
|
|
60
|
-
// injected into the application via DefinePlugin in webpack configuration.
|
|
61
|
-
const REACT_APP = /^REACT_APP_/i;
|
|
62
|
-
|
|
63
|
-
function getClientEnvironment(publicUrl) {
|
|
64
|
-
const raw = Object.keys(process.env)
|
|
65
|
-
.filter(key => REACT_APP.test(key))
|
|
66
|
-
.reduce(
|
|
67
|
-
(env, key) => {
|
|
68
|
-
env[key] = process.env[key];
|
|
69
|
-
return env;
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
// Useful for determining whether we’re running in production mode.
|
|
73
|
-
// Most importantly, it switches React into the correct mode.
|
|
74
|
-
NODE_ENV: process.env.NODE_ENV || 'development',
|
|
75
|
-
// Useful for resolving the correct path to static assets in `public`.
|
|
76
|
-
// For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
|
|
77
|
-
// This should only be used as an escape hatch. Normally you would put
|
|
78
|
-
// images into the `src` and `import` them in code to get their paths.
|
|
79
|
-
PUBLIC_URL: publicUrl,
|
|
80
|
-
// We support configuring the sockjs pathname during development.
|
|
81
|
-
// These settings let a developer run multiple simultaneous projects.
|
|
82
|
-
// They are used as the connection `hostname`, `pathname` and `port`
|
|
83
|
-
// in webpackHotDevClient. They are used as the `sockHost`, `sockPath`
|
|
84
|
-
// and `sockPort` options in webpack-dev-server.
|
|
85
|
-
WDS_SOCKET_HOST: process.env.WDS_SOCKET_HOST,
|
|
86
|
-
WDS_SOCKET_PATH: process.env.WDS_SOCKET_PATH,
|
|
87
|
-
WDS_SOCKET_PORT: process.env.WDS_SOCKET_PORT,
|
|
88
|
-
// Whether or not react-refresh is enabled.
|
|
89
|
-
// react-refresh is not 100% stable at this time,
|
|
90
|
-
// which is why it's disabled by default.
|
|
91
|
-
// It is defined here so it is available in the webpackHotDevClient.
|
|
92
|
-
FAST_REFRESH: process.env.FAST_REFRESH !== 'false',
|
|
93
|
-
}
|
|
94
|
-
);
|
|
95
|
-
// Stringify all values so we can feed into webpack DefinePlugin
|
|
96
|
-
const stringified = {
|
|
97
|
-
'process.env': Object.keys(raw).reduce((env, key) => {
|
|
98
|
-
env[key] = JSON.stringify(raw[key]);
|
|
99
|
-
return env;
|
|
100
|
-
}, {}),
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
return { raw, stringified };
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
module.exports = getClientEnvironment;
|
package/config/getHttpsConfig.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const crypto = require('crypto');
|
|
6
|
-
const chalk = require('react-dev-utils/chalk');
|
|
7
|
-
const paths = require('./paths');
|
|
8
|
-
|
|
9
|
-
// Ensure the certificate and key provided are valid and if not
|
|
10
|
-
// throw an easy to debug error
|
|
11
|
-
function validateKeyAndCerts({ cert, key, keyFile, crtFile }) {
|
|
12
|
-
let encrypted;
|
|
13
|
-
try {
|
|
14
|
-
// publicEncrypt will throw an error with an invalid cert
|
|
15
|
-
encrypted = crypto.publicEncrypt(cert, Buffer.from('test'));
|
|
16
|
-
} catch (err) {
|
|
17
|
-
throw new Error(
|
|
18
|
-
`The certificate "${chalk.yellow(crtFile)}" is invalid.\n${err.message}`
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
try {
|
|
23
|
-
// privateDecrypt will throw an error with an invalid key
|
|
24
|
-
crypto.privateDecrypt(key, encrypted);
|
|
25
|
-
} catch (err) {
|
|
26
|
-
throw new Error(
|
|
27
|
-
`The certificate key "${chalk.yellow(keyFile)}" is invalid.\n${
|
|
28
|
-
err.message
|
|
29
|
-
}`
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// Read file and throw an error if it doesn't exist
|
|
35
|
-
function readEnvFile(file, type) {
|
|
36
|
-
if (!fs.existsSync(file)) {
|
|
37
|
-
throw new Error(
|
|
38
|
-
`You specified ${chalk.cyan(
|
|
39
|
-
type
|
|
40
|
-
)} in your env, but the file "${chalk.yellow(file)}" can't be found.`
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
return fs.readFileSync(file);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Get the https config
|
|
47
|
-
// Return cert files if provided in env, otherwise just true or false
|
|
48
|
-
function getHttpsConfig() {
|
|
49
|
-
const { SSL_CRT_FILE, SSL_KEY_FILE, HTTPS } = process.env;
|
|
50
|
-
const isHttps = HTTPS === 'true';
|
|
51
|
-
|
|
52
|
-
if (isHttps && SSL_CRT_FILE && SSL_KEY_FILE) {
|
|
53
|
-
const crtFile = path.resolve(paths.appPath, SSL_CRT_FILE);
|
|
54
|
-
const keyFile = path.resolve(paths.appPath, SSL_KEY_FILE);
|
|
55
|
-
const config = {
|
|
56
|
-
cert: readEnvFile(crtFile, 'SSL_CRT_FILE'),
|
|
57
|
-
key: readEnvFile(keyFile, 'SSL_KEY_FILE'),
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
validateKeyAndCerts({ ...config, keyFile, crtFile });
|
|
61
|
-
return config;
|
|
62
|
-
}
|
|
63
|
-
return isHttps;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
module.exports = getHttpsConfig;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// This is a custom Jest transformer turning style imports into empty objects.
|
|
4
|
-
// http://facebook.github.io/jest/docs/en/webpack.html
|
|
5
|
-
|
|
6
|
-
module.exports = {
|
|
7
|
-
process() {
|
|
8
|
-
return 'module.exports = {};';
|
|
9
|
-
},
|
|
10
|
-
getCacheKey() {
|
|
11
|
-
// The output is always the same.
|
|
12
|
-
return 'cssTransform';
|
|
13
|
-
},
|
|
14
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const path = require('path');
|
|
4
|
-
const camelcase = require('camelcase');
|
|
5
|
-
|
|
6
|
-
// This is a custom Jest transformer turning file imports into filenames.
|
|
7
|
-
// http://facebook.github.io/jest/docs/en/webpack.html
|
|
8
|
-
|
|
9
|
-
module.exports = {
|
|
10
|
-
process(src, filename) {
|
|
11
|
-
const assetFilename = JSON.stringify(path.basename(filename));
|
|
12
|
-
|
|
13
|
-
if (filename.match(/\.svg$/)) {
|
|
14
|
-
// Based on how SVGR generates a component name:
|
|
15
|
-
// https://github.com/smooth-code/svgr/blob/01b194cf967347d43d4cbe6b434404731b87cf27/packages/core/src/state.js#L6
|
|
16
|
-
const pascalCaseFilename = camelcase(path.parse(filename).name, {
|
|
17
|
-
pascalCase: true,
|
|
18
|
-
});
|
|
19
|
-
const componentName = `Svg${pascalCaseFilename}`;
|
|
20
|
-
return `const React = require('react');
|
|
21
|
-
module.exports = {
|
|
22
|
-
__esModule: true,
|
|
23
|
-
default: ${assetFilename},
|
|
24
|
-
ReactComponent: React.forwardRef(function ${componentName}(props, ref) {
|
|
25
|
-
return {
|
|
26
|
-
$$typeof: Symbol.for('react.element'),
|
|
27
|
-
type: 'svg',
|
|
28
|
-
ref: ref,
|
|
29
|
-
key: null,
|
|
30
|
-
props: Object.assign({}, props, {
|
|
31
|
-
children: ${assetFilename}
|
|
32
|
-
})
|
|
33
|
-
};
|
|
34
|
-
}),
|
|
35
|
-
};`;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return `module.exports = ${assetFilename};`;
|
|
39
|
-
},
|
|
40
|
-
};
|