@authing/react-ui-components 3.0.2-beta.1 → 3.0.2-beta.14

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 (263) hide show
  1. package/lib/index.d.ts +555 -46
  2. package/lib/index.min.css +2 -2
  3. package/lib/index.min.js +1 -1
  4. package/lib/index.min.js.LICENSE.txt +2 -0
  5. package/package.json +30 -10
  6. package/.eslintignore +0 -6
  7. package/.eslintrc.js +0 -7
  8. package/.prettierrc +0 -5
  9. package/.vscode/settings.json +0 -31
  10. package/build/asset-manifest.json +0 -26
  11. package/build/favicon.ico +0 -0
  12. package/build/index.html +0 -1
  13. package/build/logo192.png +0 -0
  14. package/build/logo512.png +0 -0
  15. package/build/manifest.json +0 -25
  16. package/build/robots.txt +0 -3
  17. package/build/static/css/2.9512539b.chunk.css +0 -3
  18. package/build/static/css/2.9512539b.chunk.css.map +0 -1
  19. package/build/static/css/main.0ff9e24a.chunk.css +0 -2
  20. package/build/static/css/main.0ff9e24a.chunk.css.map +0 -1
  21. package/build/static/js/2.1105ecfb.chunk.js +0 -3
  22. package/build/static/js/2.1105ecfb.chunk.js.LICENSE.txt +0 -102
  23. package/build/static/js/2.1105ecfb.chunk.js.map +0 -1
  24. package/build/static/js/3.fd17f196.chunk.js +0 -2
  25. package/build/static/js/3.fd17f196.chunk.js.map +0 -1
  26. package/build/static/js/main.a47645ff.chunk.js +0 -2
  27. package/build/static/js/main.a47645ff.chunk.js.map +0 -1
  28. package/build/static/js/runtime-main.ef138021.js +0 -2
  29. package/build/static/js/runtime-main.ef138021.js.map +0 -1
  30. package/build/static/media/loading.4a67a5f3.svg +0 -29
  31. package/components/AuthingDropdown/index.tsx +0 -52
  32. package/components/AuthingDropdown/style.less +0 -43
  33. package/components/AuthingGuard/AppMFALayout/index.tsx +0 -74
  34. package/components/AuthingGuard/AppMFALayout/style.less +0 -12
  35. package/components/AuthingGuard/CompleteUserInfoLayout/index.tsx +0 -29
  36. package/components/AuthingGuard/CompleteUserInfoLayout/style.less +0 -8
  37. package/components/AuthingGuard/Forms/ADLoginForm/index.tsx +0 -117
  38. package/components/AuthingGuard/Forms/Agreements/index.tsx +0 -81
  39. package/components/AuthingGuard/Forms/Agreements/style.less +0 -44
  40. package/components/AuthingGuard/Forms/CompleteUserInfoForm/index.tsx +0 -139
  41. package/components/AuthingGuard/Forms/EmailMfaVerifyForm/CheckEmailForm.tsx +0 -84
  42. package/components/AuthingGuard/Forms/EmailMfaVerifyForm/VerifyCodeForm.tsx +0 -116
  43. package/components/AuthingGuard/Forms/EmailMfaVerifyForm/index.tsx +0 -40
  44. package/components/AuthingGuard/Forms/EmailMfaVerifyForm/style.less +0 -0
  45. package/components/AuthingGuard/Forms/EmailRegisterForm/index.tsx +0 -181
  46. package/components/AuthingGuard/Forms/EmailRegisterForm/style.less +0 -0
  47. package/components/AuthingGuard/Forms/LdapLoginForm/index.tsx +0 -166
  48. package/components/AuthingGuard/Forms/LdapLoginForm/style.less +0 -0
  49. package/components/AuthingGuard/Forms/LoginFormFooter/index.tsx +0 -76
  50. package/components/AuthingGuard/Forms/LoginFormFooter/style.less +0 -6
  51. package/components/AuthingGuard/Forms/MfaResetCodeForm/Step1.tsx +0 -86
  52. package/components/AuthingGuard/Forms/MfaResetCodeForm/Step2.tsx +0 -53
  53. package/components/AuthingGuard/Forms/MfaResetCodeForm/index.tsx +0 -65
  54. package/components/AuthingGuard/Forms/MfaResetCodeForm/style.less +0 -20
  55. package/components/AuthingGuard/Forms/MfaVerifyForm/index.tsx +0 -105
  56. package/components/AuthingGuard/Forms/MfaVerifyForm/style.less +0 -12
  57. package/components/AuthingGuard/Forms/PasswordLoginForm/index.tsx +0 -261
  58. package/components/AuthingGuard/Forms/PhoneCodeLoginForm/index.tsx +0 -133
  59. package/components/AuthingGuard/Forms/PhoneRegisterForm/index.tsx +0 -202
  60. package/components/AuthingGuard/Forms/QrCodeLoginForm/index.tsx +0 -59
  61. package/components/AuthingGuard/Forms/QrCodeLoginForm/style.less +0 -14
  62. package/components/AuthingGuard/Forms/RegisterFormFooter/index.tsx +0 -56
  63. package/components/AuthingGuard/Forms/RegisterFormFooter/style.less +0 -0
  64. package/components/AuthingGuard/Forms/ResetPwdForm/Footer.tsx +0 -21
  65. package/components/AuthingGuard/Forms/ResetPwdForm/Step1.tsx +0 -86
  66. package/components/AuthingGuard/Forms/ResetPwdForm/Step2.tsx +0 -127
  67. package/components/AuthingGuard/Forms/ResetPwdForm/Step3.tsx +0 -141
  68. package/components/AuthingGuard/Forms/ResetPwdForm/Step4.tsx +0 -51
  69. package/components/AuthingGuard/Forms/ResetPwdForm/index.tsx +0 -96
  70. package/components/AuthingGuard/Forms/ResetPwdForm/style.less +0 -3
  71. package/components/AuthingGuard/Forms/SendPhoneCode/SendCodeBtn.tsx +0 -88
  72. package/components/AuthingGuard/Forms/SendPhoneCode/index.tsx +0 -50
  73. package/components/AuthingGuard/Forms/SendPhoneCode/style.less +0 -26
  74. package/components/AuthingGuard/Forms/SmsMfaVerifyForm/CheckPhoneForm.tsx +0 -86
  75. package/components/AuthingGuard/Forms/SmsMfaVerifyForm/VerifyCodeForm.tsx +0 -113
  76. package/components/AuthingGuard/Forms/SmsMfaVerifyForm/index.tsx +0 -40
  77. package/components/AuthingGuard/Forms/SmsMfaVerifyForm/style.less +0 -3
  78. package/components/AuthingGuard/Forms/SocialAndIdpLogin/index.tsx +0 -325
  79. package/components/AuthingGuard/Forms/SocialAndIdpLogin/style.less +0 -75
  80. package/components/AuthingGuard/Forms/UploadImage/index.tsx +0 -70
  81. package/components/AuthingGuard/Forms/index.ts +0 -13
  82. package/components/AuthingGuard/GuardLayout/index.tsx +0 -474
  83. package/components/AuthingGuard/GuardLayout/style.less +0 -111
  84. package/components/AuthingGuard/Header/index.tsx +0 -25
  85. package/components/AuthingGuard/Header/style.less +0 -52
  86. package/components/AuthingGuard/IconFont/iconfont.js +0 -74
  87. package/components/AuthingGuard/IconFont/index.tsx +0 -19
  88. package/components/AuthingGuard/IconFont/style.less +0 -6
  89. package/components/AuthingGuard/IconFont/svg.js +0 -2
  90. package/components/AuthingGuard/LoginLayout/index.tsx +0 -161
  91. package/components/AuthingGuard/LoginLayout/style.less +0 -0
  92. package/components/AuthingGuard/MfaLayout/Steps.ts +0 -4
  93. package/components/AuthingGuard/MfaLayout/index.tsx +0 -49
  94. package/components/AuthingGuard/MfaLayout/style.less +0 -3
  95. package/components/AuthingGuard/RegisterLayout/index.tsx +0 -89
  96. package/components/AuthingGuard/RegisterLayout/style.less +0 -0
  97. package/components/AuthingGuard/ResetPwdLayout/index.tsx +0 -20
  98. package/components/AuthingGuard/ToggleLang/index.tsx +0 -51
  99. package/components/AuthingGuard/api/appConfig.ts +0 -146
  100. package/components/AuthingGuard/api/index.ts +0 -3
  101. package/components/AuthingGuard/api/sso.ts +0 -29
  102. package/components/AuthingGuard/api/userPoolConfig.ts +0 -111
  103. package/components/AuthingGuard/constants.ts +0 -107
  104. package/components/AuthingGuard/hooks/index.tsx +0 -70
  105. package/components/AuthingGuard/hooks/useScreenSize.tsx +0 -68
  106. package/components/AuthingGuard/index.tsx +0 -126
  107. package/components/AuthingGuard/style.less +0 -103
  108. package/components/AuthingGuard/types/Forms.ts +0 -94
  109. package/components/AuthingGuard/types/GuardConfig.ts +0 -420
  110. package/components/AuthingGuard/types/GuardState.ts +0 -7
  111. package/components/AuthingGuard/types/Locales.ts +0 -12
  112. package/components/AuthingGuard/types/index.ts +0 -4
  113. package/components/AuthingTabs/index.tsx +0 -98
  114. package/components/AuthingTabs/style.less +0 -135
  115. package/components/BindTotp/core/bindSuccess.tsx +0 -73
  116. package/components/BindTotp/core/securityCode.tsx +0 -108
  117. package/components/BindTotp/index.tsx +0 -134
  118. package/components/BindTotp/interface.ts +0 -30
  119. package/components/BindTotp/styles.less +0 -57
  120. package/components/ChangeLanguage/index.tsx +0 -35
  121. package/components/ChangePassword/core/firstLoginReset.tsx +0 -104
  122. package/components/ChangePassword/core/rotateReset.tsx +0 -114
  123. package/components/ChangePassword/index.tsx +0 -59
  124. package/components/CompleteInfo/core/completeInfo.tsx +0 -155
  125. package/components/CompleteInfo/index.tsx +0 -45
  126. package/components/CompleteInfo/interface.ts +0 -40
  127. package/components/CompleteInfo/styles.less +0 -7
  128. package/components/CopyAbleText/index.tsx +0 -54
  129. package/components/CopyAbleText/style.less +0 -13
  130. package/components/DownloadAuthenticator/index.tsx +0 -97
  131. package/components/DownloadAuthenticator/interface.ts +0 -22
  132. package/components/DownloadAuthenticator/styles.less +0 -52
  133. package/components/Error/index.tsx +0 -21
  134. package/components/Error/interface.ts +0 -9
  135. package/components/Error/styles.less +0 -12
  136. package/components/ForgetPassword/core/resetPassword.tsx +0 -162
  137. package/components/ForgetPassword/index.tsx +0 -78
  138. package/components/ForgetPassword/interface.ts +0 -32
  139. package/components/Guard/Guard.tsx +0 -255
  140. package/components/Guard/authClient.ts +0 -46
  141. package/components/Guard/config.ts +0 -19
  142. package/components/Guard/event.ts +0 -52
  143. package/components/Guard/index.tsx +0 -4
  144. package/components/Guard/module.ts +0 -20
  145. package/components/Guard/stateMachine.ts +0 -133
  146. package/components/Guard/styles.less +0 -461
  147. package/components/IconFont/iconfont.js +0 -74
  148. package/components/IconFont/index.tsx +0 -16
  149. package/components/IconFont/style.less +0 -6
  150. package/components/IconFont/svg.js +0 -2
  151. package/components/ImagePro/index.tsx +0 -53
  152. package/components/ImagePro/styles.less +0 -40
  153. package/components/InputNumber/index.tsx +0 -33
  154. package/components/Login/codemap.ts +0 -47
  155. package/components/Login/core/withAD.tsx +0 -9
  156. package/components/Login/core/withAppQrcode.tsx +0 -49
  157. package/components/Login/core/withLDAP.tsx +0 -146
  158. package/components/Login/core/withPassword/FormItemAccount.tsx +0 -42
  159. package/components/Login/core/withPassword/GraphicVerifyCode.tsx +0 -31
  160. package/components/Login/core/withPassword/InputAccount.tsx +0 -64
  161. package/components/Login/core/withPassword/index.tsx +0 -173
  162. package/components/Login/core/withPhonecode.tsx +0 -122
  163. package/components/Login/core/withWechatMiniQrcode.tsx +0 -60
  164. package/components/Login/core/withWechatmpQrcode.tsx +0 -53
  165. package/components/Login/index.tsx +0 -373
  166. package/components/Login/props.ts +0 -74
  167. package/components/Login/socialLogin/index.tsx +0 -407
  168. package/components/Login/socialLogin/style.less +0 -69
  169. package/components/Login/styles.less +0 -53
  170. package/components/MFA/VerifyCodeInput/VerifyCodeFormItem.tsx +0 -41
  171. package/components/MFA/VerifyCodeInput/index.tsx +0 -145
  172. package/components/MFA/VerifyCodeInput/style.less +0 -35
  173. package/components/MFA/codemap.ts +0 -24
  174. package/components/MFA/core/email.tsx +0 -203
  175. package/components/MFA/core/face.tsx +0 -297
  176. package/components/MFA/core/face_deps.tsx +0 -37
  177. package/components/MFA/core/sms.tsx +0 -204
  178. package/components/MFA/core/totp.tsx +0 -122
  179. package/components/MFA/index.tsx +0 -143
  180. package/components/MFA/mfaMethods/index.tsx +0 -88
  181. package/components/MFA/mfaMethods/style.less +0 -39
  182. package/components/MFA/props.ts +0 -51
  183. package/components/MFA/styles.less +0 -100
  184. package/components/NeedHelpView/core/describeQuestions.tsx +0 -245
  185. package/components/NeedHelpView/index.tsx +0 -47
  186. package/components/RecoveryCode/core/useCode.tsx +0 -71
  187. package/components/RecoveryCode/index.tsx +0 -27
  188. package/components/RecoveryCode/interface.ts +0 -31
  189. package/components/RecoveryCode/style.less +0 -13
  190. package/components/Register/codemap.ts +0 -12
  191. package/components/Register/components/Agreements/index.tsx +0 -81
  192. package/components/Register/components/Agreements/style.less +0 -44
  193. package/components/Register/core/WithEmail.tsx +0 -239
  194. package/components/Register/core/WithPhone.tsx +0 -184
  195. package/components/Register/index.tsx +0 -138
  196. package/components/Register/props.ts +0 -50
  197. package/components/SendCode/SendCodeBtn.tsx +0 -96
  198. package/components/SendCode/index.tsx +0 -94
  199. package/components/SendCode/style.less +0 -31
  200. package/components/ShieldSpin/index.tsx +0 -27
  201. package/components/ShieldSpin/loading.svg +0 -29
  202. package/components/SubmitButton/index.tsx +0 -50
  203. package/components/SubmitSuccess/index.tsx +0 -66
  204. package/components/SubmitSuccess/interface.ts +0 -17
  205. package/components/Type/index.ts +0 -52
  206. package/components/ValidatorRules/EmailFormItem.tsx +0 -95
  207. package/components/ValidatorRules/PhoneFormItem.tsx +0 -100
  208. package/components/ValidatorRules/index.ts +0 -14
  209. package/components/VerifyCodeInput/index.tsx +0 -76
  210. package/components/VerifyCodeInput/style.less +0 -24
  211. package/components/_utils/GuardErrorCode.ts +0 -9
  212. package/components/_utils/clipboard.ts +0 -27
  213. package/components/_utils/config.ts +0 -118
  214. package/components/_utils/guradHttp.ts +0 -97
  215. package/components/_utils/hooks/index.ts +0 -64
  216. package/components/_utils/http.ts +0 -85
  217. package/components/_utils/index.ts +0 -322
  218. package/components/_utils/locales/en/common.json +0 -227
  219. package/components/_utils/locales/en/index.ts +0 -6
  220. package/components/_utils/locales/en/login.json +0 -96
  221. package/components/_utils/locales/en/map.json +0 -4
  222. package/components/_utils/locales/en/user.json +0 -82
  223. package/components/_utils/locales/index.ts +0 -45
  224. package/components/_utils/locales/zh/common.json +0 -227
  225. package/components/_utils/locales/zh/index.ts +0 -6
  226. package/components/_utils/locales/zh/login.json +0 -96
  227. package/components/_utils/locales/zh/map.json +0 -4
  228. package/components/_utils/locales/zh/user.json +0 -82
  229. package/components/_utils/popupCenter.ts +0 -48
  230. package/components/assets/images/error.png +0 -0
  231. package/components/context/base.tsx +0 -28
  232. package/components/context/global/context.tsx +0 -39
  233. package/components/context/global/reducer.tsx +0 -56
  234. package/components/context/module/context.tsx +0 -23
  235. package/components/index.ts +0 -12
  236. package/config/antdReplacer.js +0 -51
  237. package/config/env.js +0 -104
  238. package/config/getHttpsConfig.js +0 -66
  239. package/config/jest/cssTransform.js +0 -14
  240. package/config/jest/fileTransform.js +0 -40
  241. package/config/modules.js +0 -134
  242. package/config/paths.js +0 -71
  243. package/config/pnpTs.js +0 -35
  244. package/config/webpack.config.js +0 -835
  245. package/config/webpackDevServer.config.js +0 -130
  246. package/examples.tsx +0 -82
  247. package/index.js +0 -1
  248. package/logo.svg +0 -7
  249. package/public/favicon.ico +0 -0
  250. package/public/index.html +0 -43
  251. package/public/logo192.png +0 -0
  252. package/public/logo512.png +0 -0
  253. package/public/manifest.json +0 -25
  254. package/public/robots.txt +0 -3
  255. package/react-app-env.d.ts +0 -71
  256. package/reportWebVitals.ts +0 -15
  257. package/scripts/build.js +0 -208
  258. package/scripts/lib.js +0 -200
  259. package/scripts/publish.js +0 -57
  260. package/scripts/start.js +0 -162
  261. package/scripts/test.js +0 -49
  262. package/setupTests.ts +0 -5
  263. package/tsconfig.json +0 -30
@@ -1,19 +0,0 @@
1
- import { getDefaultLoginConfig, LoginConfig } from '../Login/props'
2
- import { getDefaultRegisterConfig, RegisterConfig } from '../Register/props'
3
-
4
- export interface GuardComponentConifg extends Partial<GuardLocalConfig> {}
5
-
6
- export interface GuardLocalConfig extends RegisterConfig, LoginConfig {}
7
-
8
- let defaultConfig: GuardLocalConfig
9
-
10
- export const getDefaultGuardLocalConfig = (): GuardLocalConfig => {
11
- if (!defaultConfig) {
12
- defaultConfig = {
13
- ...getDefaultLoginConfig(),
14
- ...getDefaultRegisterConfig(),
15
- }
16
- }
17
-
18
- return defaultConfig
19
- }
@@ -1,52 +0,0 @@
1
- import { message } from 'antd'
2
- import { CompleteInfoEvents } from '../CompleteInfo/interface'
3
- import { ForgetPasswordEvents } from '../ForgetPassword/interface'
4
- import { LoginEvents } from '../Login/props'
5
- import { RegisterEvents } from '../Register/props'
6
- import { i18n } from '../_utils/locales'
7
-
8
- export interface GuardEvents
9
- extends LoginEvents,
10
- RegisterEvents,
11
- CompleteInfoEvents,
12
- ForgetPasswordEvents {}
13
-
14
- export const guardEventsFilter = (props: any) => {
15
- const events: GuardEvents = {}
16
- const eventsName = Object.keys(props).filter((name) => name.startsWith('on'))
17
- eventsName.forEach((eventName) => {
18
- events[eventName as keyof GuardEvents] = props[eventName]
19
- })
20
-
21
- return guardEventsHijacking(events)
22
- }
23
-
24
- const eventsMapping: Partial<GuardEvents> = {
25
- onLogin: (...props) => {
26
- message.success(i18n.t('common.LoginSuccess'))
27
- return props
28
- },
29
-
30
- onRegister: (...props) => {
31
- message.success(i18n.t('common.registrationSuccess'))
32
- return props
33
- },
34
- }
35
-
36
- export const guardEventsHijacking = (events: GuardEvents): GuardEvents => {
37
- const newEvents: GuardEvents = {}
38
- Object.keys(eventsMapping).forEach((eventsKey) => {
39
- // @ts-ignore
40
- newEvents[eventsKey] = (...props) => {
41
- // @ts-ignore
42
- const newProps = eventsMapping[eventsKey](...props)
43
- // @ts-ignore
44
- events[eventsKey]?.(newProps)
45
- }
46
- })
47
-
48
- return {
49
- ...events,
50
- ...newEvents,
51
- }
52
- }
@@ -1,4 +0,0 @@
1
- export * from './Guard'
2
- export * from './module'
3
- export * from './event'
4
- export * from './config'
@@ -1,20 +0,0 @@
1
- export enum GuardModuleType {
2
- ERROR = 'error',
3
- LOGIN = 'login',
4
- REGISTER = 'register',
5
- MFA = 'mfa',
6
- FORGET_PWD = 'forgetPassword',
7
- CHANGE_PWD = 'changePassword',
8
- DOWNLOAD_AT = 'downloadAT',
9
- BIND_TOTP = 'bindTotp',
10
- ANY_QUESTIONS = 'anyQuestions',
11
- COMPLETE_INFO = 'completeInfo',
12
- RECOVERY_CODE = 'recoveryCode',
13
- SUBMIT_SUCCESS = 'submitSuccess',
14
- }
15
- export interface GuardModuleAction {
16
- action: string
17
- module?: GuardModuleType
18
- message?: string
19
- initData?: any
20
- }
@@ -1,133 +0,0 @@
1
- import { useEffect } from 'react'
2
- import { GuardComponentConifg, GuardLocalConfig } from './config'
3
- import { GuardModuleType } from './module'
4
- const window: Window = require('global/window')
5
-
6
- export interface ModuleState {
7
- moduleName: GuardModuleType
8
- initData?: any
9
- }
10
-
11
- export enum ActionType {
12
- ChangeModule = 'ChangeModule',
13
- Back = 'Back',
14
- Init = 'Init',
15
- }
16
-
17
- export interface StateMachineLog {
18
- action: ActionType
19
- date: number
20
- dataSource: ModuleState
21
- }
22
-
23
- export type ChangeModuleEvent = (
24
- nextModelu: GuardModuleType,
25
- initData?: any
26
- ) => void
27
- export class GuardStateMachine {
28
- // 计数器
29
- private order: number = 0
30
-
31
- // 总体的配置信息
32
- private config: GuardComponentConifg = {}
33
-
34
- // 历史记录
35
- private moduleStateHistory: ModuleState[] = []
36
-
37
- private changeMouleEvent: ChangeModuleEvent
38
-
39
- // Log
40
- private stateMachineLog: Record<number, StateMachineLog> = {}
41
-
42
- constructor(changeMouleEvent: ChangeModuleEvent, initData: ModuleState) {
43
- this.changeMouleEvent = changeMouleEvent
44
-
45
- this.historyPush(initData, ActionType.Init)
46
- }
47
- globalWindow = (): Window | undefined =>
48
- typeof window !== undefined ? window : undefined
49
-
50
- next = (nextModelu: GuardModuleType, initData: any) => {
51
- const moduleData: ModuleState = {
52
- moduleName: nextModelu,
53
- initData,
54
- }
55
- this.changeMouleEvent(nextModelu, initData)
56
-
57
- this.historyPush(moduleData)
58
- console.log('next Log', this.stateMachineLog)
59
- console.log('next History', this.moduleStateHistory)
60
- }
61
-
62
- back = (initData: any = {}) => {
63
- if (this.moduleStateHistory.length <= 1) return
64
-
65
- const backModule = this.moduleStateHistory[1]
66
- this.changeMouleEvent(backModule.moduleName, {
67
- ...initData,
68
- ...backModule.initData,
69
- })
70
-
71
- this.moduleStateHistory.splice(0, 1)
72
- console.log('back Log', this.stateMachineLog)
73
- }
74
-
75
- // 业务终点 Log 发送
76
- end = () => {
77
- console.log('业务终点 Log', this.stateMachineLog)
78
-
79
- // TODO 请求
80
- }
81
-
82
- historyPush = (
83
- data: ModuleState,
84
- actionType: ActionType = ActionType.ChangeModule
85
- ) => {
86
- this.moduleStateHistory.unshift(data)
87
-
88
- this.stateMachineLog[this.order++] = {
89
- action: actionType,
90
- date: new Date().getTime(),
91
- dataSource: data,
92
- }
93
-
94
- if (this.moduleStateHistory.length > 10)
95
- this.moduleStateHistory.splice(10, this.moduleStateHistory.length - 10)
96
- }
97
-
98
- historyBack = (data: ModuleState) => {
99
- if (this.moduleStateHistory.length <= 1) return
100
-
101
- this.moduleStateHistory.splice(0, 1)
102
-
103
- this.stateMachineLog[this.order++] = {
104
- action: ActionType.Back,
105
- date: new Date().getTime(),
106
- dataSource: data,
107
- }
108
- }
109
-
110
- setConfig = (config: GuardLocalConfig) => {
111
- this.config = config
112
- }
113
- }
114
-
115
- export const useHistoryHijack = (back?: () => void) => {
116
- const next = (state: any = {}) => {
117
- window?.history.pushState(state, '', window?.location.href)
118
- }
119
-
120
- useEffect(() => {
121
- const onPopstate = () => {
122
- back?.()
123
- }
124
-
125
- back && window?.addEventListener('popstate', onPopstate)
126
-
127
- return () => {
128
- back && window.removeEventListener('popstate', onPopstate)
129
- }
130
- }, [back])
131
-
132
- return [next]
133
- }
@@ -1,461 +0,0 @@
1
- @import '~antd/lib/style/mixins/index.less';
2
-
3
- *[class*='authing-'] {
4
- @import '~antd/lib/style/core/global.less';
5
- }
6
-
7
- .authing-g2-render-module {
8
- --sidePadding: 38px;
9
- --containerWidth: 456px;
10
- }
11
- .authing-g2-render-module-modal {
12
- --containerWidth: 456px;
13
- }
14
-
15
- @media only screen and (max-width: 450px) {
16
- .authing-g2-render-module {
17
- --sidePadding: 8px;
18
- --containerWidth: 100%;
19
- }
20
- .authing-g2-render-module-modal {
21
- --containerWidth: 100%;
22
- }
23
- }
24
-
25
- // 侵入 core 的样式代码,guard view 皮肤
26
- .g2-view-container {
27
- font-family: sans-serif;
28
- box-shadow: 0px 0px 60px rgba(84, 89, 104, 0.05);
29
- background: #ffffff;
30
- display: flex;
31
- flex-direction: column;
32
- width: var(--containerWidth);
33
- min-height: 610px;
34
- box-sizing: border-box;
35
- padding: 16px;
36
- padding-bottom: 32px;
37
- border-radius: 8px;
38
- position: relative;
39
- .none {
40
- display: none;
41
- }
42
- .g2-view-back {
43
- margin-top: 26px;
44
- padding-left: 38px;
45
- cursor: pointer;
46
- font-size: 14px;
47
- color: #878a95;
48
- .g2-icon {
49
- margin-right: 8px;
50
- }
51
- }
52
- .g2-view-header {
53
- user-select: none;
54
- padding: 44px var(--sidePadding) 0;
55
- .icon {
56
- width: 48px;
57
- height: 48px;
58
- border-radius: 4px;
59
- margin-bottom: 8px;
60
- }
61
- .title {
62
- font-weight: 600;
63
- font-size: 24px;
64
- white-space: nowrap;
65
- overflow: hidden;
66
- text-overflow: ellipsis;
67
- }
68
- .title-explain {
69
- font-weight: 300;
70
- font-size: 14px;
71
- color: #545968;
72
- }
73
- margin-bottom: 24px;
74
- }
75
-
76
- .g2-view-tabs {
77
- padding: 0 var(--sidePadding);
78
-
79
- .authing-ant-tabs-tab {
80
- color: #878a95;
81
- &:hover {
82
- color: #282d3c;
83
- }
84
- }
85
- }
86
-
87
- .authing-g2-submit-button {
88
- width: calc(100% - 4px);
89
- border-radius: 4px;
90
- height: 42px;
91
- margin: 0 2px;
92
- &.shaking {
93
- animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
94
- }
95
- @keyframes shake {
96
- 10%,
97
- 90% {
98
- transform: translate3d(-1px, 0, 0);
99
- }
100
-
101
- 20%,
102
- 80% {
103
- transform: translate3d(2px, 0, 0);
104
- }
105
-
106
- 30%,
107
- 50%,
108
- 70% {
109
- transform: translate3d(-4px, 0, 0);
110
- }
111
-
112
- 40%,
113
- 60% {
114
- transform: translate3d(4px, 0, 0);
115
- }
116
- }
117
- }
118
- }
119
-
120
- .authing-g2-button-group {
121
- background: #eff2f6;
122
- border-radius: 8px;
123
- padding: 4px 2px;
124
- margin-bottom: 16px;
125
- width: fit-content;
126
-
127
- .authing-ant-radio-button-wrapper {
128
- margin: 0 2px;
129
- border-radius: 8px;
130
- color: #545968;
131
- cursor: pointer;
132
- border: none;
133
- background: none;
134
- height: auto;
135
- &.authing-ant-radio-button-wrapper-checked {
136
- color: #396aff;
137
- background: #ffffff;
138
- }
139
- &:not(:first-child)::before {
140
- display: none;
141
- }
142
- }
143
- }
144
-
145
- .authing-g2-input-form {
146
- padding: 0 2px;
147
- margin-bottom: 16px;
148
- &.submit-form {
149
- margin-top: 32px;
150
- }
151
- .label-title {
152
- padding: 0 0 8px;
153
- }
154
- // .authing-ant-form-item-explain {
155
- // // display: none;
156
- // transition: 0.2s all;
157
- // position: absolute;
158
- // user-select: none;
159
- // background: white;
160
- // left: 10px;
161
- // top: -15px;
162
- // z-index: 100;
163
- // padding: 4px 8px;
164
- // border-radius: 4px;
165
- // box-shadow: #eeeff1;
166
- // }
167
- }
168
- .authing-g2-input-form {
169
- .authing-g2-select {
170
- border: 1px solid #f5f6f7;
171
- border-color: #f5f6f7;
172
- height: 46px;
173
- border-radius: 4px;
174
- .authing-ant-select-selector {
175
- height: 100% !important;
176
- border-color: #f5f6f7 !important;
177
- background-color: #f5f6f7 !important;
178
- .authing-ant-select-selection-item {
179
- line-height: 42px;
180
- }
181
- &:hover {
182
- border-color: #eeeff1 !important;
183
- background-color: #eeeff1 !important;
184
- }
185
- }
186
- }
187
- }
188
-
189
- .authing-g2-input {
190
- border: 1px solid #f5f6f7;
191
- height: 46px;
192
- border-radius: 4px;
193
- background: #f5f6f7;
194
-
195
- &:hover {
196
- background-color: #eeeff1;
197
- }
198
- &:focus {
199
- background: #ffffff !important;
200
- border-color: #618eff;
201
- }
202
-
203
- input {
204
- // 通过这个方式 hack 浏览器自动填充:
205
- // 自动填充的浏览器可以说罪恶滔天,钉死在 mdn 的耻辱柱上:https://developer.mozilla.org/en-US/docs/Web/CSS/:autofill
206
- // 下方的 focused 同样需要这样处理
207
- height: 0;
208
- background-color: #f5f6f7;
209
- padding: 1em 0.5em !important;
210
- background-clip: content-box !important;
211
- &::placeholder,
212
- &::-webkit-input-placeholder {
213
- color: #a7a7a7;
214
- }
215
- }
216
-
217
- // affix-wrapper 特殊处理 hover
218
- &.authing-ant-input-affix-wrapper:hover {
219
- border-color: #eeeff1;
220
- background: #eeeff1;
221
- border-color: #618eff;
222
-
223
- .authing-ant-input {
224
- background: #eeeff1;
225
- }
226
- }
227
-
228
- // focus
229
- &.authing-ant-input-affix-wrapper-focused {
230
- background: #ffffff !important;
231
- border-color: #618eff;
232
- input {
233
- height: 0;
234
- padding: 1em 0.5em !important;
235
- background-clip: content-box !important;
236
- &::placeholder,
237
- &::-webkit-input-placeholder {
238
- color: #a7a7a7;
239
- }
240
- }
241
- }
242
-
243
- // 适配图形验证码
244
- &.add-after {
245
- border: none;
246
- .authing-ant-input-group {
247
- .authing-ant-input,
248
- .authing-ant-input-group-addon {
249
- border-radius: 4px;
250
- height: 46px;
251
- }
252
- }
253
- }
254
-
255
- // 适配数字输入框
256
- &.authing-ant-input-number {
257
- width: 100%;
258
- input {
259
- padding: 1.4em 0.5em !important;
260
- }
261
- .authing-ant-input-number-handler-wrap {
262
- display: none;
263
- }
264
- }
265
- .g2-captcha-code-image {
266
- min-width: 100px;
267
- }
268
- }
269
-
270
- .g2-graphic-verify-code {
271
- display: flex;
272
- justify-content: space-between;
273
-
274
- .authing-ant-input {
275
- width: 55%;
276
- }
277
-
278
- .g2-captcha-code-image {
279
- min-width: 100px;
280
- border-radius: 4px;
281
- border: 1px solid #eff2f6 !important;
282
- }
283
- }
284
-
285
- // input error 的情况
286
- .authing-ant-form-item-has-error {
287
- .authing-ant-input-affix-wrapper:hover {
288
- border-color: #ff4d4f !important;
289
- }
290
-
291
- // focus
292
- .authing-ant-input-affix-wrapper-focused {
293
- border-color: #ff4d4f !important;
294
- }
295
- }
296
-
297
- .authing-g2-send-code {
298
- color: #396aff;
299
- cursor: pointer;
300
- &.sending {
301
- cursor: not-allowed;
302
- filter: opacity(0.5);
303
- }
304
- }
305
-
306
- .g2-tips-line {
307
- display: flex;
308
- font-size: 14px;
309
- padding: 0 var(--sidePadding);
310
- height: 22px;
311
- .link-like {
312
- color: #396aff;
313
- cursor: pointer;
314
- transition: all 0.3s;
315
- &:hover {
316
- color: #557fff;
317
- }
318
- &:active {
319
- color: #254cd9;
320
- }
321
- }
322
- .gray {
323
- color: #999;
324
- }
325
- .go-to-register {
326
- margin-left: auto;
327
- }
328
- .back-to-login {
329
- margin-left: auto;
330
- }
331
- .touch-tip {
332
- color: #d4d6dc;
333
- cursor: pointer;
334
- &:hover {
335
- color: #878a95;
336
- }
337
- }
338
- }
339
- .g2-init-setting-loading {
340
- width: var(--containerWidth);
341
- min-height: 610px;
342
- display: flex;
343
- justify-content: center;
344
- align-items: center;
345
- box-shadow: 0px 0px 60px rgba(84, 89, 104, 0.05);
346
- }
347
-
348
- .g2-questions {
349
- .authing-ant-upload-list-picture-card-container {
350
- height: 56px;
351
- width: 56px;
352
-
353
- .authing-ant-upload-list-item-list-type-picture-card {
354
- padding: 4px;
355
- }
356
- }
357
- // authing-ant-upload authing-ant-upload-select
358
- .authing-ant-upload-select-picture-card {
359
- height: 56px;
360
- width: 56px;
361
- border: none;
362
- background: #f5f6f7;
363
- transition: 0.2s all;
364
- &:hover {
365
- background: #eeeff1;
366
- }
367
- }
368
- }
369
-
370
- .g2-questions-send-success-page {
371
- display: flex;
372
- flex-direction: column;
373
- justify-content: center;
374
- align-items: center;
375
- min-height: 610px;
376
- .plate {
377
- margin-bottom: 14px;
378
- }
379
- .title {
380
- color: #282d3c;
381
- font-weight: 500;
382
- font-size: 16px;
383
- margin-bottom: 10px;
384
- }
385
- .message {
386
- font-size: 14px;
387
- color: #545968;
388
- margin-bottom: 32px;
389
- text-align: center;
390
- }
391
- .timer-tip {
392
- font-size: 14px;
393
- color: #545968;
394
- margin-top: 12px;
395
- }
396
- }
397
-
398
- .g2-change-language-container {
399
- margin: auto 0 20px;
400
- padding-top: 10px;
401
- text-align: center;
402
- .g2-change-language-button {
403
- user-select: none;
404
- font-size: 14px;
405
- color: #878a95;
406
- cursor: pointer;
407
- margin: auto;
408
- transition: 0.2s all;
409
- &:hover {
410
- color: #282d3c;
411
- }
412
- .g2-change-language-text {
413
- margin-left: 5px;
414
- }
415
- }
416
- }
417
- .authing-g2-render-module-modal {
418
- width: var(--containerWidth);
419
- .authing-ant-modal-content {
420
- width: var(--containerWidth);
421
- border-radius: 8px;
422
- }
423
- .authing-ant-modal-body {
424
- padding: 0;
425
- }
426
- .authing-ant-modal-close {
427
- left: 0;
428
- border-radius: 4px;
429
- transform: scale(0.5);
430
- color: #d4d6dc;
431
- transition: 0.2s all;
432
- width: 56px;
433
- height: 56px;
434
- &:hover {
435
- background: #eeeff1;
436
- color: #878a95;
437
- }
438
-
439
- .g2-modal-close {
440
- font-size: 36px;
441
- margin-top: 10px;
442
- }
443
- }
444
- .authing-ant-modal-footer {
445
- display: none;
446
- }
447
- }
448
-
449
- .g2-send-code-input-col {
450
- /* Chrome, Safari, Edge, Opera */
451
- input::-webkit-outer-spin-button,
452
- input::-webkit-inner-spin-button {
453
- -webkit-appearance: none;
454
- margin: 0;
455
- }
456
-
457
- /* Firefox */
458
- input[type='number'] {
459
- -moz-appearance: textfield;
460
- }
461
- }