@authing/react-ui-components 3.0.0-alpha → 3.0.0-rc.11

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 (235) hide show
  1. package/dist/index.min.css +2 -0
  2. package/dist/index.min.js +2 -0
  3. package/dist/index.min.js.LICENSE.txt +71 -0
  4. package/{components/ShieldSpin/loading.svg → dist/static/media/loading.4a67a5f3.svg} +0 -0
  5. package/lib/index.d.ts +2108 -118
  6. package/lib/index.min.css +2 -2
  7. package/lib/index.min.js +1 -1
  8. package/lib/index.min.js.LICENSE.txt +2 -0
  9. package/package.json +32 -10
  10. package/.eslintignore +0 -6
  11. package/.eslintrc.js +0 -7
  12. package/.prettierrc +0 -5
  13. package/.vscode/settings.json +0 -31
  14. package/build/favicon.ico +0 -0
  15. package/build/logo192.png +0 -0
  16. package/build/logo512.png +0 -0
  17. package/build/manifest.json +0 -25
  18. package/build/robots.txt +0 -3
  19. package/components/AuthingDropdown/index.tsx +0 -52
  20. package/components/AuthingDropdown/style.less +0 -43
  21. package/components/AuthingGuard/AppMFALayout/index.tsx +0 -74
  22. package/components/AuthingGuard/AppMFALayout/style.less +0 -12
  23. package/components/AuthingGuard/CompleteUserInfoLayout/index.tsx +0 -29
  24. package/components/AuthingGuard/CompleteUserInfoLayout/style.less +0 -8
  25. package/components/AuthingGuard/Forms/ADLoginForm/index.tsx +0 -117
  26. package/components/AuthingGuard/Forms/Agreements/index.tsx +0 -81
  27. package/components/AuthingGuard/Forms/Agreements/style.less +0 -44
  28. package/components/AuthingGuard/Forms/CompleteUserInfoForm/index.tsx +0 -139
  29. package/components/AuthingGuard/Forms/EmailMfaVerifyForm/CheckEmailForm.tsx +0 -84
  30. package/components/AuthingGuard/Forms/EmailMfaVerifyForm/VerifyCodeForm.tsx +0 -116
  31. package/components/AuthingGuard/Forms/EmailMfaVerifyForm/index.tsx +0 -40
  32. package/components/AuthingGuard/Forms/EmailMfaVerifyForm/style.less +0 -0
  33. package/components/AuthingGuard/Forms/EmailRegisterForm/index.tsx +0 -181
  34. package/components/AuthingGuard/Forms/EmailRegisterForm/style.less +0 -0
  35. package/components/AuthingGuard/Forms/LdapLoginForm/index.tsx +0 -166
  36. package/components/AuthingGuard/Forms/LdapLoginForm/style.less +0 -0
  37. package/components/AuthingGuard/Forms/LoginFormFooter/index.tsx +0 -76
  38. package/components/AuthingGuard/Forms/LoginFormFooter/style.less +0 -6
  39. package/components/AuthingGuard/Forms/MfaResetCodeForm/Step1.tsx +0 -86
  40. package/components/AuthingGuard/Forms/MfaResetCodeForm/Step2.tsx +0 -53
  41. package/components/AuthingGuard/Forms/MfaResetCodeForm/index.tsx +0 -65
  42. package/components/AuthingGuard/Forms/MfaResetCodeForm/style.less +0 -20
  43. package/components/AuthingGuard/Forms/MfaVerifyForm/index.tsx +0 -105
  44. package/components/AuthingGuard/Forms/MfaVerifyForm/style.less +0 -12
  45. package/components/AuthingGuard/Forms/PasswordLoginForm/index.tsx +0 -261
  46. package/components/AuthingGuard/Forms/PhoneCodeLoginForm/index.tsx +0 -133
  47. package/components/AuthingGuard/Forms/PhoneRegisterForm/index.tsx +0 -202
  48. package/components/AuthingGuard/Forms/QrCodeLoginForm/index.tsx +0 -59
  49. package/components/AuthingGuard/Forms/QrCodeLoginForm/style.less +0 -14
  50. package/components/AuthingGuard/Forms/RegisterFormFooter/index.tsx +0 -56
  51. package/components/AuthingGuard/Forms/RegisterFormFooter/style.less +0 -0
  52. package/components/AuthingGuard/Forms/ResetPwdForm/Footer.tsx +0 -21
  53. package/components/AuthingGuard/Forms/ResetPwdForm/Step1.tsx +0 -86
  54. package/components/AuthingGuard/Forms/ResetPwdForm/Step2.tsx +0 -127
  55. package/components/AuthingGuard/Forms/ResetPwdForm/Step3.tsx +0 -141
  56. package/components/AuthingGuard/Forms/ResetPwdForm/Step4.tsx +0 -51
  57. package/components/AuthingGuard/Forms/ResetPwdForm/index.tsx +0 -96
  58. package/components/AuthingGuard/Forms/ResetPwdForm/style.less +0 -3
  59. package/components/AuthingGuard/Forms/SendPhoneCode/SendCodeBtn.tsx +0 -88
  60. package/components/AuthingGuard/Forms/SendPhoneCode/index.tsx +0 -50
  61. package/components/AuthingGuard/Forms/SendPhoneCode/style.less +0 -26
  62. package/components/AuthingGuard/Forms/SmsMfaVerifyForm/CheckPhoneForm.tsx +0 -86
  63. package/components/AuthingGuard/Forms/SmsMfaVerifyForm/VerifyCodeForm.tsx +0 -113
  64. package/components/AuthingGuard/Forms/SmsMfaVerifyForm/index.tsx +0 -40
  65. package/components/AuthingGuard/Forms/SmsMfaVerifyForm/style.less +0 -3
  66. package/components/AuthingGuard/Forms/SocialAndIdpLogin/index.tsx +0 -325
  67. package/components/AuthingGuard/Forms/SocialAndIdpLogin/style.less +0 -75
  68. package/components/AuthingGuard/Forms/UploadImage/index.tsx +0 -70
  69. package/components/AuthingGuard/Forms/index.ts +0 -13
  70. package/components/AuthingGuard/GuardLayout/index.tsx +0 -474
  71. package/components/AuthingGuard/GuardLayout/style.less +0 -111
  72. package/components/AuthingGuard/Header/index.tsx +0 -25
  73. package/components/AuthingGuard/Header/style.less +0 -52
  74. package/components/AuthingGuard/IconFont/iconfont.js +0 -74
  75. package/components/AuthingGuard/IconFont/index.tsx +0 -19
  76. package/components/AuthingGuard/IconFont/style.less +0 -6
  77. package/components/AuthingGuard/IconFont/svg.js +0 -2
  78. package/components/AuthingGuard/LoginLayout/index.tsx +0 -161
  79. package/components/AuthingGuard/LoginLayout/style.less +0 -0
  80. package/components/AuthingGuard/MfaLayout/Steps.ts +0 -4
  81. package/components/AuthingGuard/MfaLayout/index.tsx +0 -49
  82. package/components/AuthingGuard/MfaLayout/style.less +0 -3
  83. package/components/AuthingGuard/RegisterLayout/index.tsx +0 -89
  84. package/components/AuthingGuard/RegisterLayout/style.less +0 -0
  85. package/components/AuthingGuard/ResetPwdLayout/index.tsx +0 -20
  86. package/components/AuthingGuard/ToggleLang/index.tsx +0 -51
  87. package/components/AuthingGuard/api/appConfig.ts +0 -146
  88. package/components/AuthingGuard/api/index.ts +0 -3
  89. package/components/AuthingGuard/api/sso.ts +0 -29
  90. package/components/AuthingGuard/api/userPoolConfig.ts +0 -111
  91. package/components/AuthingGuard/constants.ts +0 -105
  92. package/components/AuthingGuard/hooks/index.tsx +0 -70
  93. package/components/AuthingGuard/hooks/useScreenSize.tsx +0 -68
  94. package/components/AuthingGuard/index.tsx +0 -126
  95. package/components/AuthingGuard/style.less +0 -103
  96. package/components/AuthingGuard/types/Forms.ts +0 -94
  97. package/components/AuthingGuard/types/GuardConfig.ts +0 -420
  98. package/components/AuthingGuard/types/GuardState.ts +0 -7
  99. package/components/AuthingGuard/types/Locales.ts +0 -12
  100. package/components/AuthingGuard/types/index.ts +0 -4
  101. package/components/AuthingTabs/index.tsx +0 -98
  102. package/components/AuthingTabs/style.less +0 -135
  103. package/components/BindTotp/core/bindSuccess.tsx +0 -61
  104. package/components/BindTotp/core/securityCode.tsx +0 -119
  105. package/components/BindTotp/index.tsx +0 -134
  106. package/components/BindTotp/props.ts +0 -30
  107. package/components/BindTotp/styles.less +0 -56
  108. package/components/ChangeLanguage/index.tsx +0 -35
  109. package/components/ChangePassword/core/firstLoginReset.tsx +0 -104
  110. package/components/ChangePassword/core/rotateReset.tsx +0 -114
  111. package/components/ChangePassword/index.tsx +0 -59
  112. package/components/CompleteInfo/core/completeInfo.tsx +0 -155
  113. package/components/CompleteInfo/index.tsx +0 -45
  114. package/components/CompleteInfo/props.ts +0 -40
  115. package/components/CompleteInfo/styles.less +0 -7
  116. package/components/CompleteUserInfo/index.tsx +0 -49
  117. package/components/CompleteUserInfo/props.ts +0 -25
  118. package/components/ComponentsRender/index.back +0 -64
  119. package/components/CopyAbleText/index.tsx +0 -54
  120. package/components/CopyAbleText/style.less +0 -13
  121. package/components/DownloadAuthenticator/index.tsx +0 -97
  122. package/components/DownloadAuthenticator/props.ts +0 -22
  123. package/components/DownloadAuthenticator/styles.less +0 -52
  124. package/components/ForgetPassword/core/resetPassword.tsx +0 -150
  125. package/components/ForgetPassword/index.tsx +0 -51
  126. package/components/Guard/Guard.tsx +0 -226
  127. package/components/Guard/authClient.ts +0 -55
  128. package/components/Guard/config.ts +0 -19
  129. package/components/Guard/event.ts +0 -18
  130. package/components/Guard/index.tsx +0 -10
  131. package/components/Guard/module.ts +0 -19
  132. package/components/Guard/stateMachine.ts +0 -133
  133. package/components/Guard/styles.less +0 -444
  134. package/components/IconFont/iconfont.js +0 -74
  135. package/components/IconFont/index.tsx +0 -16
  136. package/components/IconFont/style.less +0 -6
  137. package/components/IconFont/svg.js +0 -2
  138. package/components/ImagePro/index.tsx +0 -52
  139. package/components/ImagePro/styles.less +0 -40
  140. package/components/Login/codemap.ts +0 -35
  141. package/components/Login/core/withAD.tsx +0 -9
  142. package/components/Login/core/withAppQrcode.tsx +0 -49
  143. package/components/Login/core/withLDAP.tsx +0 -145
  144. package/components/Login/core/withPassword.tsx +0 -176
  145. package/components/Login/core/withPhonecode.tsx +0 -135
  146. package/components/Login/core/withWechatMiniQrcode.tsx +0 -60
  147. package/components/Login/core/withWechatmpQrcode.tsx +0 -53
  148. package/components/Login/index.tsx +0 -359
  149. package/components/Login/props.ts +0 -90
  150. package/components/Login/socialLogin/index.tsx +0 -413
  151. package/components/Login/socialLogin/style.less +0 -61
  152. package/components/Login/styles.less +0 -53
  153. package/components/MFA/codemap.ts +0 -21
  154. package/components/MFA/core/email.tsx +0 -226
  155. package/components/MFA/core/face.tsx +0 -297
  156. package/components/MFA/core/face_deps.tsx +0 -37
  157. package/components/MFA/core/sms.tsx +0 -222
  158. package/components/MFA/core/totp.tsx +0 -137
  159. package/components/MFA/index.tsx +0 -135
  160. package/components/MFA/mfaMethods/index.tsx +0 -81
  161. package/components/MFA/mfaMethods/style.less +0 -39
  162. package/components/MFA/props.ts +0 -51
  163. package/components/MFA/styles.less +0 -92
  164. package/components/NeedHelpView/core/describeQuestions.tsx +0 -227
  165. package/components/NeedHelpView/index.tsx +0 -99
  166. package/components/RecoveryCode/core/useCode.tsx +0 -71
  167. package/components/RecoveryCode/index.tsx +0 -27
  168. package/components/RecoveryCode/interface.ts +0 -31
  169. package/components/RecoveryCode/style.less +0 -13
  170. package/components/Register/codemap.ts +0 -16
  171. package/components/Register/components/Agreements/index.tsx +0 -81
  172. package/components/Register/components/Agreements/style.less +0 -44
  173. package/components/Register/core/WithEmail.tsx +0 -250
  174. package/components/Register/core/WithPhone.tsx +0 -190
  175. package/components/Register/index.tsx +0 -122
  176. package/components/Register/props.ts +0 -50
  177. package/components/SendCode/SendCodeBtn.tsx +0 -96
  178. package/components/SendCode/index.tsx +0 -98
  179. package/components/SendCode/style.less +0 -31
  180. package/components/ShieldSpin/index.tsx +0 -27
  181. package/components/SubmitButton/index.tsx +0 -50
  182. package/components/Type/index.ts +0 -61
  183. package/components/VerifyCodeInput/index.tsx +0 -76
  184. package/components/VerifyCodeInput/style.less +0 -24
  185. package/components/_utils/GuardErrorCode.ts +0 -8
  186. package/components/_utils/clipboard.ts +0 -27
  187. package/components/_utils/config.ts +0 -123
  188. package/components/_utils/guradHttp.ts +0 -93
  189. package/components/_utils/hooks/index.ts +0 -56
  190. package/components/_utils/http.ts +0 -85
  191. package/components/_utils/index.ts +0 -310
  192. package/components/_utils/locales/en/common.json +0 -218
  193. package/components/_utils/locales/en/index.ts +0 -6
  194. package/components/_utils/locales/en/login.json +0 -95
  195. package/components/_utils/locales/en/map.json +0 -4
  196. package/components/_utils/locales/en/user.json +0 -82
  197. package/components/_utils/locales/index.ts +0 -45
  198. package/components/_utils/locales/zh/common.json +0 -218
  199. package/components/_utils/locales/zh/index.ts +0 -6
  200. package/components/_utils/locales/zh/login.json +0 -95
  201. package/components/_utils/locales/zh/map.json +0 -4
  202. package/components/_utils/locales/zh/user.json +0 -82
  203. package/components/_utils/popupCenter.ts +0 -48
  204. package/components/context/base.tsx +0 -28
  205. package/components/context/global/context.tsx +0 -39
  206. package/components/context/global/reducer.tsx +0 -56
  207. package/components/context/module/context.tsx +0 -23
  208. package/components/index.ts +0 -10
  209. package/config/antdReplacer.js +0 -51
  210. package/config/env.js +0 -104
  211. package/config/getHttpsConfig.js +0 -66
  212. package/config/jest/cssTransform.js +0 -14
  213. package/config/jest/fileTransform.js +0 -40
  214. package/config/modules.js +0 -134
  215. package/config/paths.js +0 -71
  216. package/config/pnpTs.js +0 -35
  217. package/config/webpack.config.js +0 -835
  218. package/config/webpackDevServer.config.js +0 -130
  219. package/examples.tsx +0 -100
  220. package/index.js +0 -1
  221. package/logo.svg +0 -7
  222. package/public/favicon.ico +0 -0
  223. package/public/index.html +0 -43
  224. package/public/logo192.png +0 -0
  225. package/public/logo512.png +0 -0
  226. package/public/manifest.json +0 -25
  227. package/public/robots.txt +0 -3
  228. package/react-app-env.d.ts +0 -71
  229. package/reportWebVitals.ts +0 -15
  230. package/scripts/build.js +0 -208
  231. package/scripts/lib.js +0 -200
  232. package/scripts/start.js +0 -162
  233. package/scripts/test.js +0 -49
  234. package/setupTests.ts +0 -5
  235. package/tsconfig.json +0 -30
@@ -67,3 +67,5 @@ PERFORMANCE OF THIS SOFTWARE.
67
67
  - 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.
68
68
  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.
69
69
  */
70
+
71
+ //! moment.js
package/package.json CHANGED
@@ -1,28 +1,43 @@
1
1
  {
2
2
  "name": "@authing/react-ui-components",
3
- "version": "3.0.0-alpha",
4
- "framework": "React",
3
+ "version": "3.0.0-rc.11",
5
4
  "private": false,
6
5
  "main": "lib/index.min.js",
7
6
  "typings": "lib/index.d.ts",
7
+ "types": "react-app-env.d.ts",
8
+ "files": [
9
+ "dist",
10
+ "lib"
11
+ ],
8
12
  "dependencies": {
9
13
  "antd": "^4.8.0",
10
- "authing-js-sdk": "4.22.18",
11
14
  "face-api.js": "^0.22.2",
15
+ "fastclick": "^1.0.6",
12
16
  "global": "^4.4.0",
13
17
  "qs": "^6.9.4",
14
18
  "react-use": "^17.3.1"
15
19
  },
16
- "types": "react-app-env.d.ts",
17
20
  "peerDependencies": {
18
- "react": "16.14.0",
19
- "react-dom": "16.14.0"
21
+ "react": ">=16.9.0",
22
+ "react-dom": ">=16.9.0",
23
+ "authing-js-sdk": ">=4.23.3"
20
24
  },
21
25
  "scripts": {
22
- "start": "PORT=3006 node scripts/start.js",
23
- "build": "node scripts/build.js",
24
- "build:lib": "node scripts/lib.js",
25
- "test": "node scripts/test.js"
26
+ "build": "node ./scripts/build.js",
27
+ "build:lib": "node ./scripts/lib.js",
28
+ "clear": "clear:lib && clear:dist",
29
+ "clear:dist": "rm -rf dist",
30
+ "clear:lib": "rm -rf lib",
31
+ "log-tag": "node ./scripts/tag.js",
32
+ "pretty-quick": "pretty-quick",
33
+ "prestart": "npm run log-tag && npm run version && npm run generate-examples",
34
+ "prebuild:lib": "npm run log-tag && npm run version",
35
+ "prepare": "cd ../.. && husky install packages/react-components/.husky",
36
+ "pub": "npm run build:lib && node ./scripts/publish.js",
37
+ "start": "PORT=1221 node ./scripts/start.js",
38
+ "vite": "vite",
39
+ "version": "node ./scripts/generate-version",
40
+ "generate-examples": "node ./scripts/generate-examples.js"
26
41
  },
27
42
  "publishConfig": {
28
43
  "access": "public",
@@ -120,6 +135,7 @@
120
135
  "@types/shortid": "^0.0.29",
121
136
  "@typescript-eslint/eslint-plugin": "^4.5.0",
122
137
  "@typescript-eslint/parser": "^4.5.0",
138
+ "@vitejs/plugin-react": "1.1.0",
123
139
  "babel-eslint": "^10.1.0",
124
140
  "babel-jest": "^26.6.0",
125
141
  "babel-loader": "8.1.0",
@@ -129,6 +145,8 @@
129
145
  "bfj": "^7.0.2",
130
146
  "camelcase": "^6.1.0",
131
147
  "case-sensitive-paths-webpack-plugin": "2.3.0",
148
+ "chalk": "^4.1.2",
149
+ "cross-env": "^7.0.3",
132
150
  "css-loader": "4.3.0",
133
151
  "dotenv": "8.2.0",
134
152
  "dotenv-expand": "5.1.0",
@@ -147,6 +165,7 @@
147
165
  "file-loader": "6.1.1",
148
166
  "fs-extra": "^9.0.1",
149
167
  "html-webpack-plugin": "4.5.0",
168
+ "husky": "^7.0.4",
150
169
  "i18next": "^20.1.0",
151
170
  "i18next-browser-languagedetector": "^6.1.0",
152
171
  "identity-obj-proxy": "3.0.0",
@@ -167,6 +186,7 @@
167
186
  "postcss-rename-selector": "^0.1.1",
168
187
  "postcss-safe-parser": "5.0.2",
169
188
  "prettier": "^2.1.2",
189
+ "pretty-quick": "^3.0.0",
170
190
  "query-string": "^7.0.0",
171
191
  "react": "16.14.0",
172
192
  "react-app-polyfill": "^2.0.0",
@@ -178,12 +198,14 @@
178
198
  "resolve-url-loader": "^3.1.2",
179
199
  "sass-loader": "8.0.2",
180
200
  "semver": "7.3.2",
201
+ "shelljs": "^0.8.4",
181
202
  "shortid": "^2.2.16",
182
203
  "style-loader": "1.3.0",
183
204
  "terser-webpack-plugin": "4.2.3",
184
205
  "ts-pnp": "1.2.0",
185
206
  "typescript": "^4.0.3",
186
207
  "url-loader": "4.1.1",
208
+ "vite": "^2.6.14",
187
209
  "web-vitals": "^0.2.4",
188
210
  "webpack": "4.44.2",
189
211
  "webpack-bundle-analyzer": "^4.1.0",
package/.eslintignore DELETED
@@ -1,6 +0,0 @@
1
- # /node_modules/* and /bower_components/* ignored by default
2
-
3
- # Ignore built files except build/index.js
4
- build/*
5
- lib/*
6
- iconfont.js
package/.eslintrc.js DELETED
@@ -1,7 +0,0 @@
1
- module.exports = {
2
- extends: ['react-app'],
3
- plugins: ['prettier'],
4
- rules: {
5
- 'prettier/prettier': 'error',
6
- },
7
- }
package/.prettierrc DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "singleQuote": true,
3
- "semi": false,
4
- "trailingComma": "es5"
5
- }
@@ -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": "components/_utils/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/build/favicon.ico DELETED
Binary file
package/build/logo192.png DELETED
Binary file
package/build/logo512.png DELETED
Binary file
@@ -1,25 +0,0 @@
1
- {
2
- "short_name": "React App",
3
- "name": "Create React App Sample",
4
- "icons": [
5
- {
6
- "src": "favicon.ico",
7
- "sizes": "64x64 32x32 24x24 16x16",
8
- "type": "image/x-icon"
9
- },
10
- {
11
- "src": "logo192.png",
12
- "type": "image/png",
13
- "sizes": "192x192"
14
- },
15
- {
16
- "src": "logo512.png",
17
- "type": "image/png",
18
- "sizes": "512x512"
19
- }
20
- ],
21
- "start_url": ".",
22
- "display": "standalone",
23
- "theme_color": "#000000",
24
- "background_color": "#ffffff"
25
- }
package/build/robots.txt DELETED
@@ -1,3 +0,0 @@
1
- # https://www.robotstxt.org/robotstxt.html
2
- User-agent: *
3
- Disallow:
@@ -1,52 +0,0 @@
1
- import { DownOutlined } from '@ant-design/icons'
2
- import React, { FC, useState } from 'react'
3
- import { getClassnames } from '../_utils'
4
-
5
- import './style.less'
6
-
7
- /**
8
- * 不使用 antd 的 dropdown,因为里面会用 tooltip,体积过大
9
- */
10
- export const AuthingDropdown: FC<{
11
- className?: string
12
- menus: {
13
- label: React.ReactNode
14
- key: string | number
15
- onClick?: (
16
- key: string | number,
17
- evt: React.MouseEvent<HTMLDivElement, MouseEvent>
18
- ) => void
19
- }[]
20
- }> = ({ menus, children, className }) => {
21
- const [visible, setVisible] = useState(false)
22
-
23
- return (
24
- <div
25
- className={getClassnames(['authing-dropdown', className])}
26
- onMouseEnter={() => setVisible(true)}
27
- onMouseLeave={() => setVisible(false)}
28
- >
29
- <div className="authing-dropdown-trigger">{children}</div>
30
- <div
31
- className={getClassnames([
32
- 'authing-dropdown-menu-container',
33
- visible && 'authing-dropdown-menu-container__visible',
34
- ])}
35
- >
36
- {menus.map((item) => (
37
- <div
38
- className="authing-dropdown-menu-item"
39
- onClick={(evt) => {
40
- setVisible(false)
41
- item.onClick?.(item.key, evt)
42
- }}
43
- key={item.key}
44
- >
45
- {item.label}
46
- </div>
47
- ))}
48
- </div>
49
- <DownOutlined className="authing-dropdown-icon" />
50
- </div>
51
- )
52
- }
@@ -1,43 +0,0 @@
1
- .authing-dropdown {
2
- display: inline-flex;
3
- position: relative;
4
- align-items: center;
5
- }
6
-
7
- .authing-dropdown-trigger {
8
- cursor: pointer;
9
- }
10
-
11
- .authing-dropdown-menu-container {
12
- height: 0;
13
- opacity: 0;
14
- position: absolute;
15
- top: 100%;
16
- left: 0;
17
- transition: all 0.3s;
18
- cursor: pointer;
19
- background-color: #fff;
20
- padding: 4px 0;
21
- border-radius: 2px;
22
- box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12),
23
- 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
24
- pointer-events: none;
25
- }
26
-
27
- .authing-dropdown-menu-container__visible {
28
- height: auto;
29
- opacity: 1;
30
- pointer-events: unset;
31
- }
32
-
33
- .authing-dropdown-menu-item {
34
- padding: 5px 12px;
35
- transition: all 0.3s;
36
- &:hover {
37
- background-color: #f5f5f5;
38
- }
39
- }
40
-
41
- .authing-dropdown-icon {
42
- margin-left: 8px;
43
- }
@@ -1,74 +0,0 @@
1
- import { message } from 'antd'
2
- import { User } from 'authing-js-sdk'
3
- import React, { FC, useState } from 'react'
4
- import { useTranslation } from 'react-i18next'
5
- import { AuthingDropdown } from '../../AuthingDropdown'
6
-
7
- import {
8
- EmailMfaVerifyForm,
9
- SmsMfaVerifyForm,
10
- } from '../../../components/AuthingGuard/Forms'
11
- import { useGuardContext } from '../../context/global/context'
12
- import { ApplicationMfaType, ApplicationMfaTypeLabel } from '../api'
13
-
14
- import './style.less'
15
-
16
- export interface MfaLayoutProps {}
17
-
18
- export const AppMfaLayout: FC<MfaLayoutProps> = () => {
19
- const { t } = useTranslation()
20
- const {
21
- state: { guardEvents, authClient, mfaData },
22
- } = useGuardContext()
23
-
24
- const [type, setType] = useState(ApplicationMfaType.SMS)
25
-
26
- const onSuccess = (user: User) => {
27
- message.success(t('common.LoginSuccess'))
28
- guardEvents.onLogin?.(user, authClient)
29
- }
30
-
31
- const onFail = (error: any) => {
32
- guardEvents.onLoginError?.(error, authClient)
33
- }
34
-
35
- const formProps = {
36
- onSuccess,
37
- onFail,
38
- }
39
-
40
- const formMap = {
41
- [ApplicationMfaType.EMAIL]: <EmailMfaVerifyForm {...formProps} />,
42
- [ApplicationMfaType.SMS]: <SmsMfaVerifyForm {...formProps} />,
43
- }
44
-
45
- const availableMfaType = mfaData.applicationMfa
46
- ?.filter(
47
- (item) =>
48
- item.status && Object.keys(ApplicationMfaType).includes(item.mfaPolicy)
49
- )
50
- ?.sort((a, b) => a.sort - b.sort)
51
- ?.map((item) => ({
52
- label: ApplicationMfaTypeLabel()[item.mfaPolicy],
53
- key: item.mfaPolicy,
54
- onClick() {
55
- setType(item.mfaPolicy)
56
- },
57
- }))
58
-
59
- return (
60
- <div className="authing-text-center">
61
- {formMap[type]}
62
- {(availableMfaType?.length || 0 > 1) && (
63
- <AuthingDropdown
64
- className="toggle-mfa-dropdown"
65
- menus={availableMfaType!}
66
- >
67
- <span className="authing-toggle-mfa">
68
- {t('login.otherVerifyWay')}
69
- </span>
70
- </AuthingDropdown>
71
- )}
72
- </div>
73
- )
74
- }
@@ -1,12 +0,0 @@
1
- .authing-toggle-mfa,
2
- .toggle-mfa-dropdown .authing-dropdown-icon {
3
- color: #999;
4
- }
5
-
6
- .toggle-mfa-dropdown {
7
- margin-top: 30px;
8
- align-self: center;
9
- .authing-dropdown-menu-item {
10
- white-space: nowrap;
11
- }
12
- }
@@ -1,29 +0,0 @@
1
- import React, { FC } from 'react'
2
- import { useTranslation } from 'react-i18next'
3
- import { useGuardContext } from '../../context/global/context'
4
- import { CompleteUserInfoForm } from '../Forms/CompleteUserInfoForm'
5
-
6
- import './style.less'
7
-
8
- export const CompleteUserInfoLayout: FC = () => {
9
- const {
10
- state: { guardTitle },
11
- } = useGuardContext()
12
-
13
- const { t } = useTranslation()
14
- return (
15
- <div>
16
- <h2 className="authing-guard-complete-info-title">
17
- {t('common.perfectUserInfo')}
18
- </h2>
19
-
20
- <p className="authing-guard-complete-info-msg">
21
- {t('common.welcomeDoc', {
22
- name: guardTitle,
23
- })}
24
- </p>
25
-
26
- <CompleteUserInfoForm />
27
- </div>
28
- )
29
- }
@@ -1,8 +0,0 @@
1
- .authing-guard-complete-info-title {
2
- font-size: 20px;
3
- text-align: center;
4
- color: #333;
5
- }
6
- .authing-guard-complete-info-msg {
7
- color: #b2b2b2;
8
- }
@@ -1,117 +0,0 @@
1
- import { Input, Form, message } from 'antd'
2
- import { FormInstance } from 'antd/lib/form'
3
- import { UserOutlined, LockOutlined } from '@ant-design/icons'
4
- import React, { forwardRef, useImperativeHandle, useState } from 'react'
5
-
6
- import { useGuardContext } from '../../../context/global/context'
7
- import {
8
- ADLoginFormProps,
9
- LoginMethods,
10
- } from '../../../../components/AuthingGuard/types'
11
- import { LoginFormFooter } from '../../../../components/AuthingGuard/Forms/LoginFormFooter'
12
- import { useTranslation } from 'react-i18next'
13
- import { getRequiredRules } from '../../../_utils'
14
-
15
- export const ADLoginForm = forwardRef<FormInstance, ADLoginFormProps>(
16
- ({ onSuccess, onValidateFail, onFail }, ref) => {
17
- const { t } = useTranslation()
18
- const { state } = useGuardContext()
19
- const { authClient, guardEvents } = state
20
-
21
- const [loading, setLoading] = useState(false)
22
-
23
- const onFinishFailed = (errorInfo: any) => {
24
- setLoading(false)
25
- onValidateFail && onValidateFail(errorInfo)
26
- }
27
-
28
- const [rawForm] = Form.useForm()
29
-
30
- const onFinish = async (values: any) => {
31
- if (guardEvents.onBeforeLogin) {
32
- try {
33
- const canLogin = await guardEvents.onBeforeLogin(
34
- {
35
- type: LoginMethods.AD,
36
- data: {
37
- identity: values.identity,
38
- password: values.password,
39
- },
40
- },
41
- authClient
42
- )
43
-
44
- if (!canLogin) {
45
- setLoading(false)
46
- return
47
- }
48
- } catch (e) {
49
- if (typeof e === 'string') {
50
- message.error(e)
51
- } else {
52
- message.error(e.message)
53
- }
54
- setLoading(false)
55
- return
56
- }
57
- }
58
-
59
- try {
60
- const identity = values.identity && values.identity.trim()
61
- const password = values.password && values.password.trim()
62
- const user = await authClient.loginByAd(identity, password)
63
- onSuccess && onSuccess(user)
64
- } catch (error) {
65
- if (typeof error.message === 'string') {
66
- // js sdk httpclient 的报错,这里只有一种情况就是用户开启了 mfa 的报错
67
- try {
68
- const errorData = JSON.parse(error.message)
69
- onFail && onFail(errorData)
70
- return
71
- } catch (_) {
72
- // do nothing
73
- }
74
- }
75
- onFail && onFail(error)
76
- } finally {
77
- setLoading(false)
78
- }
79
- }
80
-
81
- useImperativeHandle(ref, () => rawForm)
82
-
83
- return (
84
- <Form
85
- form={rawForm}
86
- onSubmitCapture={() => setLoading(true)}
87
- onFinishFailed={onFinishFailed}
88
- onFinish={onFinish}
89
- >
90
- <Form.Item
91
- name="identity"
92
- rules={getRequiredRules(t('login.inputAdUsername'))}
93
- >
94
- <Input
95
- autoComplete="email,username,tel"
96
- size="large"
97
- placeholder={t('login.inputAdUsername')}
98
- prefix={<UserOutlined style={{ color: '#ddd' }} />}
99
- />
100
- </Form.Item>
101
- <Form.Item
102
- name="password"
103
- rules={getRequiredRules(t('login.inputAdPwd'))}
104
- >
105
- <Input.Password
106
- autoComplete="current-password"
107
- size="large"
108
- visibilityToggle={false}
109
- placeholder={t('login.inputAdPwd')}
110
- prefix={<LockOutlined style={{ color: '#ddd' }} />}
111
- />
112
- </Form.Item>
113
- <LoginFormFooter loading={loading}></LoginFormFooter>
114
- </Form>
115
- )
116
- }
117
- )
@@ -1,81 +0,0 @@
1
- import React, { FC, useState, useMemo, useEffect } from 'react'
2
- import { Space, Checkbox } from 'antd'
3
- import { Agreement } from '../../api'
4
- import './style.less'
5
- import { getClassnames } from '../../../_utils'
6
-
7
- export interface AgreementsProps {
8
- value?: boolean
9
- onChange?: (value: boolean) => void
10
- style?: React.CSSProperties
11
- agreements: Agreement[]
12
- showError?: boolean
13
- }
14
-
15
- export const Agreements: FC<AgreementsProps> = ({
16
- showError,
17
- onChange = () => {},
18
- style,
19
- agreements,
20
- }) => {
21
- const [acceptList, setAcceptList] = useState<(string | number)[]>([])
22
-
23
- const toggleItemCheck = (id: string | number) => {
24
- setAcceptList((prev) => {
25
- if (prev.includes(id)) {
26
- return prev.filter((item) => item !== id)
27
- }
28
- return [...prev, id]
29
- })
30
- }
31
-
32
- /** 是否可以注册 */
33
- const isAccept = useMemo(() => {
34
- /** 所有必须勾选的都勾了就可以通过 */
35
- return agreements
36
- .filter((item) => item.required)
37
- .every((item) => acceptList.includes(item.id))
38
- }, [acceptList, agreements])
39
-
40
- useEffect(() => {
41
- onChange(isAccept)
42
- }, [isAccept, onChange])
43
-
44
- return (
45
- <div
46
- className={getClassnames([
47
- 'authing-agreements',
48
- showError && 'authing-agreements-error',
49
- ])}
50
- >
51
- {agreements.map((item) => {
52
- return (
53
- <div
54
- key={item.id}
55
- style={{ ...style }}
56
- className={getClassnames([
57
- 'authing-agreements-item',
58
- item.required &&
59
- !acceptList.includes(item.id) &&
60
- 'authing-agreements-item-invalid',
61
- ])}
62
- onClick={() => toggleItemCheck(item.id)}
63
- >
64
- <Space align="start" size={5}>
65
- <Checkbox
66
- className="authing-agreements-checkbox"
67
- checked={acceptList.includes(item.id)}
68
- />
69
- <div
70
- className="authing-agreements-item-content"
71
- dangerouslySetInnerHTML={{
72
- __html: item.title,
73
- }}
74
- ></div>
75
- </Space>
76
- </div>
77
- )
78
- })}
79
- </div>
80
- )
81
- }
@@ -1,44 +0,0 @@
1
- .authing-agreements {
2
- margin-top: 20px;
3
- margin-bottom: 20px;
4
- &.authing-agreements-error {
5
- .authing-agreements-item-invalid {
6
- color: #ff4d4f;
7
- a {
8
- color: #ff4d4f;
9
- }
10
- :global(.ant-checkbox-inner) {
11
- border-color: #ff4d4f;
12
- }
13
- }
14
- }
15
- }
16
-
17
- .authing-agreements-item {
18
- color: #999999;
19
- user-select: none;
20
- cursor: pointer;
21
- font-size: 12px;
22
- &:not(:first-child) {
23
- margin-top: 4px;
24
- }
25
- p {
26
- margin-bottom: 0;
27
- display: inline-block;
28
- }
29
- }
30
-
31
- .authing-agreements-checkbox {
32
- margin-bottom: 2px;
33
- :global(.ant-checkbox-inner) {
34
- width: 14px;
35
- height: 14px;
36
- &::after {
37
- left: 20%;
38
- }
39
- }
40
- }
41
-
42
- .authing-agreements-item-content {
43
- line-height: 23px;
44
- }