@authing/react-ui-components 3.0.2-beta.4 → 3.0.2-beta.9

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 (261) hide show
  1. package/lib/index.d.ts +453 -35
  2. package/lib/index.min.css +2 -2
  3. package/lib/index.min.js +1 -1
  4. package/package.json +25 -7
  5. package/.eslintignore +0 -6
  6. package/.eslintrc.js +0 -7
  7. package/.prettierrc +0 -5
  8. package/.vscode/settings.json +0 -31
  9. package/build/asset-manifest.json +0 -26
  10. package/build/favicon.ico +0 -0
  11. package/build/index.html +0 -1
  12. package/build/logo192.png +0 -0
  13. package/build/logo512.png +0 -0
  14. package/build/manifest.json +0 -25
  15. package/build/robots.txt +0 -3
  16. package/build/static/css/2.51c07e65.chunk.css +0 -3
  17. package/build/static/css/2.51c07e65.chunk.css.map +0 -1
  18. package/build/static/css/main.779f221a.chunk.css +0 -2
  19. package/build/static/css/main.779f221a.chunk.css.map +0 -1
  20. package/build/static/js/2.bbae9fdb.chunk.js +0 -3
  21. package/build/static/js/2.bbae9fdb.chunk.js.LICENSE.txt +0 -102
  22. package/build/static/js/2.bbae9fdb.chunk.js.map +0 -1
  23. package/build/static/js/3.fd17f196.chunk.js +0 -2
  24. package/build/static/js/3.fd17f196.chunk.js.map +0 -1
  25. package/build/static/js/main.5f341531.chunk.js +0 -2
  26. package/build/static/js/main.5f341531.chunk.js.map +0 -1
  27. package/build/static/js/runtime-main.ef138021.js +0 -2
  28. package/build/static/js/runtime-main.ef138021.js.map +0 -1
  29. package/build/static/media/loading.4a67a5f3.svg +0 -29
  30. package/components/AuthingDropdown/index.tsx +0 -52
  31. package/components/AuthingDropdown/style.less +0 -43
  32. package/components/AuthingGuard/AppMFALayout/index.tsx +0 -74
  33. package/components/AuthingGuard/AppMFALayout/style.less +0 -12
  34. package/components/AuthingGuard/CompleteUserInfoLayout/index.tsx +0 -29
  35. package/components/AuthingGuard/CompleteUserInfoLayout/style.less +0 -8
  36. package/components/AuthingGuard/Forms/ADLoginForm/index.tsx +0 -117
  37. package/components/AuthingGuard/Forms/Agreements/index.tsx +0 -81
  38. package/components/AuthingGuard/Forms/Agreements/style.less +0 -44
  39. package/components/AuthingGuard/Forms/CompleteUserInfoForm/index.tsx +0 -139
  40. package/components/AuthingGuard/Forms/EmailMfaVerifyForm/CheckEmailForm.tsx +0 -84
  41. package/components/AuthingGuard/Forms/EmailMfaVerifyForm/VerifyCodeForm.tsx +0 -116
  42. package/components/AuthingGuard/Forms/EmailMfaVerifyForm/index.tsx +0 -40
  43. package/components/AuthingGuard/Forms/EmailMfaVerifyForm/style.less +0 -0
  44. package/components/AuthingGuard/Forms/EmailRegisterForm/index.tsx +0 -181
  45. package/components/AuthingGuard/Forms/EmailRegisterForm/style.less +0 -0
  46. package/components/AuthingGuard/Forms/LdapLoginForm/index.tsx +0 -166
  47. package/components/AuthingGuard/Forms/LdapLoginForm/style.less +0 -0
  48. package/components/AuthingGuard/Forms/LoginFormFooter/index.tsx +0 -76
  49. package/components/AuthingGuard/Forms/LoginFormFooter/style.less +0 -6
  50. package/components/AuthingGuard/Forms/MfaResetCodeForm/Step1.tsx +0 -86
  51. package/components/AuthingGuard/Forms/MfaResetCodeForm/Step2.tsx +0 -53
  52. package/components/AuthingGuard/Forms/MfaResetCodeForm/index.tsx +0 -65
  53. package/components/AuthingGuard/Forms/MfaResetCodeForm/style.less +0 -20
  54. package/components/AuthingGuard/Forms/MfaVerifyForm/index.tsx +0 -105
  55. package/components/AuthingGuard/Forms/MfaVerifyForm/style.less +0 -12
  56. package/components/AuthingGuard/Forms/PasswordLoginForm/index.tsx +0 -261
  57. package/components/AuthingGuard/Forms/PhoneCodeLoginForm/index.tsx +0 -133
  58. package/components/AuthingGuard/Forms/PhoneRegisterForm/index.tsx +0 -202
  59. package/components/AuthingGuard/Forms/QrCodeLoginForm/index.tsx +0 -59
  60. package/components/AuthingGuard/Forms/QrCodeLoginForm/style.less +0 -14
  61. package/components/AuthingGuard/Forms/RegisterFormFooter/index.tsx +0 -56
  62. package/components/AuthingGuard/Forms/RegisterFormFooter/style.less +0 -0
  63. package/components/AuthingGuard/Forms/ResetPwdForm/Footer.tsx +0 -21
  64. package/components/AuthingGuard/Forms/ResetPwdForm/Step1.tsx +0 -86
  65. package/components/AuthingGuard/Forms/ResetPwdForm/Step2.tsx +0 -127
  66. package/components/AuthingGuard/Forms/ResetPwdForm/Step3.tsx +0 -141
  67. package/components/AuthingGuard/Forms/ResetPwdForm/Step4.tsx +0 -51
  68. package/components/AuthingGuard/Forms/ResetPwdForm/index.tsx +0 -96
  69. package/components/AuthingGuard/Forms/ResetPwdForm/style.less +0 -3
  70. package/components/AuthingGuard/Forms/SendPhoneCode/SendCodeBtn.tsx +0 -88
  71. package/components/AuthingGuard/Forms/SendPhoneCode/index.tsx +0 -50
  72. package/components/AuthingGuard/Forms/SendPhoneCode/style.less +0 -26
  73. package/components/AuthingGuard/Forms/SmsMfaVerifyForm/CheckPhoneForm.tsx +0 -86
  74. package/components/AuthingGuard/Forms/SmsMfaVerifyForm/VerifyCodeForm.tsx +0 -113
  75. package/components/AuthingGuard/Forms/SmsMfaVerifyForm/index.tsx +0 -40
  76. package/components/AuthingGuard/Forms/SmsMfaVerifyForm/style.less +0 -3
  77. package/components/AuthingGuard/Forms/SocialAndIdpLogin/index.tsx +0 -325
  78. package/components/AuthingGuard/Forms/SocialAndIdpLogin/style.less +0 -75
  79. package/components/AuthingGuard/Forms/UploadImage/index.tsx +0 -70
  80. package/components/AuthingGuard/Forms/index.ts +0 -13
  81. package/components/AuthingGuard/GuardLayout/index.tsx +0 -474
  82. package/components/AuthingGuard/GuardLayout/style.less +0 -111
  83. package/components/AuthingGuard/Header/index.tsx +0 -25
  84. package/components/AuthingGuard/Header/style.less +0 -52
  85. package/components/AuthingGuard/IconFont/iconfont.js +0 -74
  86. package/components/AuthingGuard/IconFont/index.tsx +0 -19
  87. package/components/AuthingGuard/IconFont/style.less +0 -6
  88. package/components/AuthingGuard/IconFont/svg.js +0 -2
  89. package/components/AuthingGuard/LoginLayout/index.tsx +0 -161
  90. package/components/AuthingGuard/LoginLayout/style.less +0 -0
  91. package/components/AuthingGuard/MfaLayout/Steps.ts +0 -4
  92. package/components/AuthingGuard/MfaLayout/index.tsx +0 -49
  93. package/components/AuthingGuard/MfaLayout/style.less +0 -3
  94. package/components/AuthingGuard/RegisterLayout/index.tsx +0 -89
  95. package/components/AuthingGuard/RegisterLayout/style.less +0 -0
  96. package/components/AuthingGuard/ResetPwdLayout/index.tsx +0 -20
  97. package/components/AuthingGuard/ToggleLang/index.tsx +0 -51
  98. package/components/AuthingGuard/api/appConfig.ts +0 -146
  99. package/components/AuthingGuard/api/index.ts +0 -3
  100. package/components/AuthingGuard/api/sso.ts +0 -29
  101. package/components/AuthingGuard/api/userPoolConfig.ts +0 -111
  102. package/components/AuthingGuard/constants.ts +0 -107
  103. package/components/AuthingGuard/hooks/index.tsx +0 -70
  104. package/components/AuthingGuard/hooks/useScreenSize.tsx +0 -68
  105. package/components/AuthingGuard/index.tsx +0 -126
  106. package/components/AuthingGuard/style.less +0 -103
  107. package/components/AuthingGuard/types/Forms.ts +0 -94
  108. package/components/AuthingGuard/types/GuardConfig.ts +0 -420
  109. package/components/AuthingGuard/types/GuardState.ts +0 -7
  110. package/components/AuthingGuard/types/Locales.ts +0 -12
  111. package/components/AuthingGuard/types/index.ts +0 -4
  112. package/components/AuthingTabs/index.tsx +0 -98
  113. package/components/AuthingTabs/style.less +0 -135
  114. package/components/BindTotp/core/bindSuccess.tsx +0 -72
  115. package/components/BindTotp/core/securityCode.tsx +0 -108
  116. package/components/BindTotp/index.tsx +0 -134
  117. package/components/BindTotp/interface.ts +0 -30
  118. package/components/BindTotp/styles.less +0 -57
  119. package/components/ChangeLanguage/index.tsx +0 -35
  120. package/components/ChangePassword/core/firstLoginReset.tsx +0 -104
  121. package/components/ChangePassword/core/rotateReset.tsx +0 -114
  122. package/components/ChangePassword/index.tsx +0 -59
  123. package/components/CompleteInfo/core/completeInfo.tsx +0 -155
  124. package/components/CompleteInfo/index.tsx +0 -45
  125. package/components/CompleteInfo/interface.ts +0 -40
  126. package/components/CompleteInfo/styles.less +0 -7
  127. package/components/CopyAbleText/index.tsx +0 -54
  128. package/components/CopyAbleText/style.less +0 -13
  129. package/components/DownloadAuthenticator/index.tsx +0 -97
  130. package/components/DownloadAuthenticator/interface.ts +0 -22
  131. package/components/DownloadAuthenticator/styles.less +0 -52
  132. package/components/Error/index.tsx +0 -21
  133. package/components/Error/interface.ts +0 -9
  134. package/components/Error/styles.less +0 -12
  135. package/components/ForgetPassword/core/resetPassword.tsx +0 -162
  136. package/components/ForgetPassword/index.tsx +0 -78
  137. package/components/ForgetPassword/interface.ts +0 -32
  138. package/components/Guard/Guard.tsx +0 -287
  139. package/components/Guard/authClient.ts +0 -44
  140. package/components/Guard/config.ts +0 -19
  141. package/components/Guard/event.ts +0 -52
  142. package/components/Guard/index.tsx +0 -4
  143. package/components/Guard/module.ts +0 -20
  144. package/components/Guard/stateMachine.ts +0 -152
  145. package/components/Guard/styles.less +0 -461
  146. package/components/IconFont/iconfont.js +0 -74
  147. package/components/IconFont/index.tsx +0 -16
  148. package/components/IconFont/style.less +0 -6
  149. package/components/IconFont/svg.js +0 -2
  150. package/components/ImagePro/index.tsx +0 -53
  151. package/components/ImagePro/styles.less +0 -40
  152. package/components/InputNumber/index.tsx +0 -33
  153. package/components/Login/codemap.ts +0 -47
  154. package/components/Login/core/withAD.tsx +0 -9
  155. package/components/Login/core/withAppQrcode.tsx +0 -49
  156. package/components/Login/core/withLDAP.tsx +0 -146
  157. package/components/Login/core/withPassword/FormItemAccount.tsx +0 -42
  158. package/components/Login/core/withPassword/GraphicVerifyCode.tsx +0 -30
  159. package/components/Login/core/withPassword/InputAccount.tsx +0 -64
  160. package/components/Login/core/withPassword/index.tsx +0 -173
  161. package/components/Login/core/withPhonecode.tsx +0 -122
  162. package/components/Login/core/withWechatMiniQrcode.tsx +0 -60
  163. package/components/Login/core/withWechatmpQrcode.tsx +0 -53
  164. package/components/Login/index.tsx +0 -373
  165. package/components/Login/props.ts +0 -74
  166. package/components/Login/socialLogin/index.tsx +0 -407
  167. package/components/Login/socialLogin/style.less +0 -69
  168. package/components/Login/styles.less +0 -53
  169. package/components/MFA/VerifyCodeInput/VerifyCodeFormItem.tsx +0 -41
  170. package/components/MFA/VerifyCodeInput/index.tsx +0 -145
  171. package/components/MFA/VerifyCodeInput/style.less +0 -35
  172. package/components/MFA/codemap.ts +0 -24
  173. package/components/MFA/core/email.tsx +0 -203
  174. package/components/MFA/core/face.tsx +0 -297
  175. package/components/MFA/core/face_deps.tsx +0 -37
  176. package/components/MFA/core/sms.tsx +0 -203
  177. package/components/MFA/core/totp.tsx +0 -122
  178. package/components/MFA/index.tsx +0 -143
  179. package/components/MFA/mfaMethods/index.tsx +0 -88
  180. package/components/MFA/mfaMethods/style.less +0 -39
  181. package/components/MFA/props.ts +0 -51
  182. package/components/MFA/styles.less +0 -100
  183. package/components/NeedHelpView/core/describeQuestions.tsx +0 -245
  184. package/components/NeedHelpView/index.tsx +0 -47
  185. package/components/RecoveryCode/core/useCode.tsx +0 -71
  186. package/components/RecoveryCode/index.tsx +0 -27
  187. package/components/RecoveryCode/interface.ts +0 -31
  188. package/components/RecoveryCode/style.less +0 -13
  189. package/components/Register/codemap.ts +0 -12
  190. package/components/Register/components/Agreements/index.tsx +0 -81
  191. package/components/Register/components/Agreements/style.less +0 -44
  192. package/components/Register/core/WithEmail.tsx +0 -242
  193. package/components/Register/core/WithPhone.tsx +0 -184
  194. package/components/Register/index.tsx +0 -139
  195. package/components/Register/props.ts +0 -50
  196. package/components/SendCode/SendCodeBtn.tsx +0 -96
  197. package/components/SendCode/index.tsx +0 -94
  198. package/components/SendCode/style.less +0 -31
  199. package/components/ShieldSpin/index.tsx +0 -27
  200. package/components/ShieldSpin/loading.svg +0 -29
  201. package/components/SubmitButton/index.tsx +0 -50
  202. package/components/SubmitSuccess/index.tsx +0 -66
  203. package/components/SubmitSuccess/interface.ts +0 -17
  204. package/components/Type/index.ts +0 -52
  205. package/components/ValidatorRules/ValidatorFormItem.tsx +0 -139
  206. package/components/ValidatorRules/index.ts +0 -20
  207. package/components/VerifyCodeInput/index.tsx +0 -76
  208. package/components/VerifyCodeInput/style.less +0 -24
  209. package/components/_utils/GuardErrorCode.ts +0 -9
  210. package/components/_utils/clipboard.ts +0 -27
  211. package/components/_utils/config.ts +0 -116
  212. package/components/_utils/guradHttp.ts +0 -97
  213. package/components/_utils/hooks/index.ts +0 -64
  214. package/components/_utils/http.ts +0 -85
  215. package/components/_utils/index.ts +0 -322
  216. package/components/_utils/locales/en/common.json +0 -227
  217. package/components/_utils/locales/en/index.ts +0 -6
  218. package/components/_utils/locales/en/login.json +0 -96
  219. package/components/_utils/locales/en/map.json +0 -4
  220. package/components/_utils/locales/en/user.json +0 -82
  221. package/components/_utils/locales/index.ts +0 -45
  222. package/components/_utils/locales/zh/common.json +0 -227
  223. package/components/_utils/locales/zh/index.ts +0 -6
  224. package/components/_utils/locales/zh/login.json +0 -96
  225. package/components/_utils/locales/zh/map.json +0 -4
  226. package/components/_utils/locales/zh/user.json +0 -82
  227. package/components/_utils/popupCenter.ts +0 -48
  228. package/components/assets/images/error.png +0 -0
  229. package/components/context/base.tsx +0 -28
  230. package/components/context/global/context.tsx +0 -39
  231. package/components/context/global/reducer.tsx +0 -56
  232. package/components/context/module/context.tsx +0 -23
  233. package/components/index.ts +0 -12
  234. package/config/antdReplacer.js +0 -51
  235. package/config/env.js +0 -104
  236. package/config/getHttpsConfig.js +0 -66
  237. package/config/jest/cssTransform.js +0 -14
  238. package/config/jest/fileTransform.js +0 -40
  239. package/config/modules.js +0 -134
  240. package/config/paths.js +0 -71
  241. package/config/pnpTs.js +0 -35
  242. package/config/webpack.config.js +0 -835
  243. package/config/webpackDevServer.config.js +0 -130
  244. package/examples.tsx +0 -86
  245. package/index.js +0 -1
  246. package/logo.svg +0 -7
  247. package/public/favicon.ico +0 -0
  248. package/public/index.html +0 -43
  249. package/public/logo192.png +0 -0
  250. package/public/logo512.png +0 -0
  251. package/public/manifest.json +0 -25
  252. package/public/robots.txt +0 -3
  253. package/react-app-env.d.ts +0 -71
  254. package/reportWebVitals.ts +0 -15
  255. package/scripts/build.js +0 -208
  256. package/scripts/lib.js +0 -200
  257. package/scripts/publish.js +0 -57
  258. package/scripts/start.js +0 -162
  259. package/scripts/test.js +0 -49
  260. package/setupTests.ts +0 -5
  261. package/tsconfig.json +0 -30
@@ -1,130 +0,0 @@
1
- 'use strict';
2
-
3
- const fs = require('fs');
4
- const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware');
5
- const evalSourceMapMiddleware = require('react-dev-utils/evalSourceMapMiddleware');
6
- const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware');
7
- const ignoredFiles = require('react-dev-utils/ignoredFiles');
8
- const redirectServedPath = require('react-dev-utils/redirectServedPathMiddleware');
9
- const paths = require('./paths');
10
- const getHttpsConfig = require('./getHttpsConfig');
11
-
12
- const host = process.env.HOST || '0.0.0.0';
13
- const sockHost = process.env.WDS_SOCKET_HOST;
14
- const sockPath = process.env.WDS_SOCKET_PATH; // default: '/sockjs-node'
15
- const sockPort = process.env.WDS_SOCKET_PORT;
16
-
17
- module.exports = function (proxy, allowedHost) {
18
- return {
19
- // WebpackDevServer 2.4.3 introduced a security fix that prevents remote
20
- // websites from potentially accessing local content through DNS rebinding:
21
- // https://github.com/webpack/webpack-dev-server/issues/887
22
- // https://medium.com/webpack/webpack-dev-server-middleware-security-issues-1489d950874a
23
- // However, it made several existing use cases such as development in cloud
24
- // environment or subdomains in development significantly more complicated:
25
- // https://github.com/facebook/create-react-app/issues/2271
26
- // https://github.com/facebook/create-react-app/issues/2233
27
- // While we're investigating better solutions, for now we will take a
28
- // compromise. Since our WDS configuration only serves files in the `public`
29
- // folder we won't consider accessing them a vulnerability. However, if you
30
- // use the `proxy` feature, it gets more dangerous because it can expose
31
- // remote code execution vulnerabilities in backends like Django and Rails.
32
- // So we will disable the host check normally, but enable it if you have
33
- // specified the `proxy` setting. Finally, we let you override it if you
34
- // really know what you're doing with a special environment variable.
35
- disableHostCheck:
36
- !proxy || process.env.DANGEROUSLY_DISABLE_HOST_CHECK === 'true',
37
- // Enable gzip compression of generated files.
38
- compress: true,
39
- // Silence WebpackDevServer's own logs since they're generally not useful.
40
- // It will still show compile warnings and errors with this setting.
41
- clientLogLevel: 'none',
42
- // By default WebpackDevServer serves physical files from current directory
43
- // in addition to all the virtual build products that it serves from memory.
44
- // This is confusing because those files won’t automatically be available in
45
- // production build folder unless we copy them. However, copying the whole
46
- // project directory is dangerous because we may expose sensitive files.
47
- // Instead, we establish a convention that only files in `public` directory
48
- // get served. Our build script will copy `public` into the `build` folder.
49
- // In `index.html`, you can get URL of `public` folder with %PUBLIC_URL%:
50
- // <link rel="icon" href="%PUBLIC_URL%/favicon.ico">
51
- // In JavaScript code, you can access it with `process.env.PUBLIC_URL`.
52
- // Note that we only recommend to use `public` folder as an escape hatch
53
- // for files like `favicon.ico`, `manifest.json`, and libraries that are
54
- // for some reason broken when imported through webpack. If you just want to
55
- // use an image, put it in `src` and `import` it from JavaScript instead.
56
- contentBase: paths.appPublic,
57
- contentBasePublicPath: paths.publicUrlOrPath,
58
- // By default files from `contentBase` will not trigger a page reload.
59
- watchContentBase: true,
60
- // Enable hot reloading server. It will provide WDS_SOCKET_PATH endpoint
61
- // for the WebpackDevServer client so it can learn when the files were
62
- // updated. The WebpackDevServer client is included as an entry point
63
- // in the webpack development configuration. Note that only changes
64
- // to CSS are currently hot reloaded. JS changes will refresh the browser.
65
- hot: true,
66
- // Use 'ws' instead of 'sockjs-node' on server since we're using native
67
- // websockets in `webpackHotDevClient`.
68
- transportMode: 'ws',
69
- // Prevent a WS client from getting injected as we're already including
70
- // `webpackHotDevClient`.
71
- injectClient: false,
72
- // Enable custom sockjs pathname for websocket connection to hot reloading server.
73
- // Enable custom sockjs hostname, pathname and port for websocket connection
74
- // to hot reloading server.
75
- sockHost,
76
- sockPath,
77
- sockPort,
78
- // It is important to tell WebpackDevServer to use the same "publicPath" path as
79
- // we specified in the webpack config. When homepage is '.', default to serving
80
- // from the root.
81
- // remove last slash so user can land on `/test` instead of `/test/`
82
- publicPath: paths.publicUrlOrPath.slice(0, -1),
83
- // WebpackDevServer is noisy by default so we emit custom message instead
84
- // by listening to the compiler events with `compiler.hooks[...].tap` calls above.
85
- quiet: true,
86
- // Reportedly, this avoids CPU overload on some systems.
87
- // https://github.com/facebook/create-react-app/issues/293
88
- // src/node_modules is not ignored to support absolute imports
89
- // https://github.com/facebook/create-react-app/issues/1065
90
- watchOptions: {
91
- ignored: ignoredFiles(paths.appSrc),
92
- },
93
- https: getHttpsConfig(),
94
- host,
95
- overlay: false,
96
- historyApiFallback: {
97
- // Paths with dots should still use the history fallback.
98
- // See https://github.com/facebook/create-react-app/issues/387.
99
- disableDotRule: true,
100
- index: paths.publicUrlOrPath,
101
- },
102
- public: allowedHost,
103
- // `proxy` is run between `before` and `after` `webpack-dev-server` hooks
104
- proxy,
105
- before(app, server) {
106
- // Keep `evalSourceMapMiddleware` and `errorOverlayMiddleware`
107
- // middlewares before `redirectServedPath` otherwise will not have any effect
108
- // This lets us fetch source contents from webpack for the error overlay
109
- app.use(evalSourceMapMiddleware(server));
110
- // This lets us open files from the runtime error overlay.
111
- app.use(errorOverlayMiddleware());
112
-
113
- if (fs.existsSync(paths.proxySetup)) {
114
- // This registers user provided middleware for proxy reasons
115
- require(paths.proxySetup)(app);
116
- }
117
- },
118
- after(app) {
119
- // Redirect to `PUBLIC_URL` or `homepage` from `package.json` if url not match
120
- app.use(redirectServedPath(paths.publicUrlOrPath));
121
-
122
- // This service worker file is effectively a 'no-op' that will reset any
123
- // previous service worker registered for the same host:port combination.
124
- // We do this in development to avoid hitting the production cache if
125
- // it used the same host and port.
126
- // https://github.com/facebook/create-react-app/issues/2272#issuecomment-302832432
127
- app.use(noopServiceWorkerMiddleware(paths.publicUrlOrPath));
128
- },
129
- };
130
- };
package/examples.tsx DELETED
@@ -1,86 +0,0 @@
1
- import React from 'react'
2
- import ReactDOM from 'react-dom'
3
-
4
- import reportWebVitals from './reportWebVitals'
5
- import { message } from 'antd'
6
- import { Guard } from './components/Guard'
7
-
8
- const App = () => {
9
- return (
10
- <div
11
- style={{
12
- display: 'flex',
13
- width: '100vw',
14
- justifyContent: 'center',
15
- }}
16
- >
17
- <Guard
18
- // appId="618e093c3a9138c729fe7d0b"
19
- appId="6191cf610f772aa56dc70637"
20
- tenantId="6194a41abf23c1d5268b362a1"
21
- onLogin={(u) => {
22
- message.info('🏁 用户业务层终点,登录完成。')
23
- console.log(u)
24
- }}
25
- onLoad={(authClint) => console.log('🪝 onLoad', authClint)}
26
- onLoadError={(error) => console.log('🪝 onLoadError', error)}
27
- onBeforeLogin={(m) => {
28
- console.log('🪝onBeforeLogin 触发,返回 promise 或布尔', m)
29
- return new Promise((resolve) => {
30
- resolve(true)
31
- })
32
- }}
33
- onRegister={(user, authClint) => {
34
- console.log('🪝 onRegister 触发', user, authClint)
35
- }}
36
- onRegisterError={(e) => console.log('🪝 onRegisterError 触发', e)}
37
- onLoginError={() => {
38
- console.log('❌ onLoginError 触发')
39
- }}
40
- onLoginTabChange={(key) => {
41
- console.log('📁 onLoginTabChange 触发', key)
42
- }}
43
- onRegisterTabChange={(registerMethod) => {
44
- console.log('📁 onRegisterTabChange 触发', registerMethod)
45
- }}
46
- config={{
47
- host: 'https://core.dev2.authing-inc.co/',
48
- // registerMethods: [RegisterMethods.Email],
49
- // autoRegister: true,
50
- // defaultRegisterMethod: RegisterMethods.Phone,
51
- // disableRegister: false,
52
- // disableResetPwd: false,
53
- // defaultLoginMethod: LoginMethods.WxMinQr, // 指定默认登录方式,如果这个方式不存在于 LoginMethods,那么就当作没有传入
54
- // loginMethods: [],
55
- // LoginMethods.Password,
56
- // LoginMethods.PhoneCode,
57
- // LoginMethods.WxMinQr,
58
- // ],
59
- // socialConnections: [
60
- // SocialConnectionProvider.ALIPAY,
61
- // SocialConnectionProvider.APPLE_WEB,
62
- // ], // 指定可选的社会化登录方式
63
- // qrCodeScanOptions?: Parameters<QrCodeAuthenticationClient['startScanning']>[1]
64
- // passwordLoginMethods?: PasswordLoginMethods[]
65
- // enterpriseConnections: [] // 这个有啥用?
66
- // publicKey?: string
67
- // lang: 'en-US',
68
- // lang: 'zh-CN',
69
- // mode: GuardMode.Modal,
70
- // logo: '',
71
- // clickCloseable: false, // clickCloseable Modal 模式时是否隐藏登录框右上角的关闭按钮
72
- // escCloseable: true, //
73
- // target: '#c1',
74
- // socialConnectionsBtnShape: 'rectangle',
75
- }}
76
- />
77
- </div>
78
- )
79
- }
80
-
81
- ReactDOM.render(<App />, document.getElementById('root'))
82
-
83
- // If you want to start measuring performance in your app, pass a function
84
- // to log results (for example: reportWebVitals(console.log))
85
- // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
86
- reportWebVitals()
package/index.js DELETED
@@ -1 +0,0 @@
1
- module.exports = require('./components')
package/logo.svg DELETED
@@ -1,7 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
2
- <g fill="#61DAFB">
3
- <path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/>
4
- <circle cx="420.9" cy="296.5" r="45.7"/>
5
- <path d="M520.5 78.1z"/>
6
- </g>
7
- </svg>
Binary file
package/public/index.html DELETED
@@ -1,43 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1" />
7
- <meta name="theme-color" content="#000000" />
8
- <meta
9
- name="description"
10
- content="Web site created using create-react-app"
11
- />
12
- <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13
- <!--
14
- manifest.json provides metadata used when your web app is installed on a
15
- user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16
- -->
17
- <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18
- <!--
19
- Notice the use of %PUBLIC_URL% in the tags above.
20
- It will be replaced with the URL of the `public` folder during the build.
21
- Only files inside the `public` folder can be referenced from the HTML.
22
-
23
- Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
24
- work correctly both with client-side routing and a non-root public URL.
25
- Learn how to configure a non-root public URL by running `npm run build`.
26
- -->
27
- <title>React App</title>
28
- </head>
29
- <body>
30
- <noscript>You need to enable JavaScript to run this app.</noscript>
31
- <div id="root"></div>
32
- <!--
33
- This HTML file is a template.
34
- If you open it directly in the browser, you will see an empty page.
35
-
36
- You can add webfonts, meta tags, or analytics to this file.
37
- The build step will place the bundled scripts into the <body> tag.
38
-
39
- To begin the development, run `npm start` or `yarn start`.
40
- To create a production bundle, use `npm run build` or `yarn build`.
41
- -->
42
- </body>
43
- </html>
Binary file
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/public/robots.txt DELETED
@@ -1,3 +0,0 @@
1
- # https://www.robotstxt.org/robotstxt.html
2
- User-agent: *
3
- Disallow:
@@ -1,71 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="react" />
3
- /// <reference types="react-dom" />
4
-
5
- declare namespace NodeJS {
6
- interface ProcessEnv {
7
- readonly NODE_ENV: 'development' | 'production' | 'test'
8
- readonly PUBLIC_URL: string
9
- }
10
- }
11
-
12
- declare module '*.avif' {
13
- const src: string
14
- export default src
15
- }
16
-
17
- declare module '*.bmp' {
18
- const src: string
19
- export default src
20
- }
21
-
22
- declare module '*.gif' {
23
- const src: string
24
- export default src
25
- }
26
-
27
- declare module '*.jpg' {
28
- const src: string
29
- export default src
30
- }
31
-
32
- declare module '*.jpeg' {
33
- const src: string
34
- export default src
35
- }
36
-
37
- declare module '*.png' {
38
- const src: string
39
- export default src
40
- }
41
-
42
- declare module '*.webp' {
43
- const src: string
44
- export default src
45
- }
46
-
47
- declare module '*.svg' {
48
- import * as React from 'react'
49
-
50
- export const ReactComponent: React.FunctionComponent<
51
- React.SVGProps<SVGSVGElement> & { title?: string }
52
- >
53
-
54
- const src: string
55
- export default src
56
- }
57
-
58
- declare module '*.module.css' {
59
- const classes: { readonly [key: string]: string }
60
- export default classes
61
- }
62
-
63
- declare module '*.module.scss' {
64
- const classes: { readonly [key: string]: string }
65
- export default classes
66
- }
67
-
68
- declare module '*.module.sass' {
69
- const classes: { readonly [key: string]: string }
70
- export default classes
71
- }
@@ -1,15 +0,0 @@
1
- import { ReportHandler } from 'web-vitals'
2
-
3
- const reportWebVitals = (onPerfEntry?: ReportHandler) => {
4
- if (onPerfEntry && onPerfEntry instanceof Function) {
5
- import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
6
- getCLS(onPerfEntry)
7
- getFID(onPerfEntry)
8
- getFCP(onPerfEntry)
9
- getLCP(onPerfEntry)
10
- getTTFB(onPerfEntry)
11
- })
12
- }
13
- }
14
-
15
- export default reportWebVitals
package/scripts/build.js DELETED
@@ -1,208 +0,0 @@
1
- // Do this as the first thing so that any code reading it knows the right env.
2
- process.env.BABEL_ENV = 'production'
3
- process.env.NODE_ENV = 'production'
4
-
5
- // Makes the script crash on unhandled rejections instead of silently
6
- // ignoring them. In the future, promise rejections that are not handled will
7
- // terminate the Node.js process with a non-zero exit code.
8
- process.on('unhandledRejection', (err) => {
9
- throw err
10
- })
11
-
12
- // Ensure environment variables are read.
13
- require('../config/env')
14
-
15
- const path = require('path')
16
- const chalk = require('react-dev-utils/chalk')
17
- const fs = require('fs-extra')
18
- const bfj = require('bfj')
19
- const webpack = require('webpack')
20
- const configFactory = require('../config/webpack.config')
21
- const paths = require('../config/paths')
22
- const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles')
23
- const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages')
24
- const printHostingInstructions = require('react-dev-utils/printHostingInstructions')
25
- const FileSizeReporter = require('react-dev-utils/FileSizeReporter')
26
- const printBuildError = require('react-dev-utils/printBuildError')
27
-
28
- const measureFileSizesBeforeBuild = FileSizeReporter.measureFileSizesBeforeBuild
29
- const printFileSizesAfterBuild = FileSizeReporter.printFileSizesAfterBuild
30
- const useYarn = fs.existsSync(paths.yarnLockFile)
31
-
32
- // These sizes are pretty large. We'll warn for bundles exceeding them.
33
- const WARN_AFTER_BUNDLE_GZIP_SIZE = 512 * 1024
34
- const WARN_AFTER_CHUNK_GZIP_SIZE = 1024 * 1024
35
-
36
- const isInteractive = process.stdout.isTTY
37
-
38
- // Warn and crash if required files are missing
39
- if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
40
- process.exit(1)
41
- }
42
-
43
- const argv = process.argv.slice(2)
44
- const writeStatsJson = argv.indexOf('--stats') !== -1
45
-
46
- // Generate configuration
47
- const config = configFactory('production')
48
-
49
- // We require that you explicitly set browsers and do not fall back to
50
- // browserslist defaults.
51
- const { checkBrowsers } = require('react-dev-utils/browsersHelper')
52
- checkBrowsers(paths.appPath, isInteractive)
53
- .then(() => {
54
- // First, read the current file sizes in build directory.
55
- // This lets us display how much they changed later.
56
- return measureFileSizesBeforeBuild(paths.appBuild)
57
- })
58
- .then((previousFileSizes) => {
59
- // Remove all content but keep the directory so that
60
- // if you're in it, you don't end up in Trash
61
- fs.emptyDirSync(paths.appBuild)
62
- // Merge with the public folder
63
- copyPublicFolder()
64
- // Start the webpack build
65
- return build(previousFileSizes)
66
- })
67
- .then(
68
- ({ stats, previousFileSizes, warnings }) => {
69
- if (warnings.length) {
70
- console.log(chalk.yellow('Compiled with warnings.\n'))
71
- console.log(warnings.join('\n\n'))
72
- console.log(
73
- '\nSearch for the ' +
74
- chalk.underline(chalk.yellow('keywords')) +
75
- ' to learn more about each warning.'
76
- )
77
- console.log(
78
- 'To ignore, add ' +
79
- chalk.cyan('// eslint-disable-next-line') +
80
- ' to the line before.\n'
81
- )
82
- } else {
83
- console.log(chalk.green('Compiled successfully.\n'))
84
- }
85
-
86
- console.log('File sizes after gzip:\n')
87
- printFileSizesAfterBuild(
88
- stats,
89
- previousFileSizes,
90
- paths.appBuild,
91
- WARN_AFTER_BUNDLE_GZIP_SIZE,
92
- WARN_AFTER_CHUNK_GZIP_SIZE
93
- )
94
- console.log()
95
-
96
- const appPackage = require(paths.appPackageJson)
97
- const publicUrl = paths.publicUrlOrPath
98
- const publicPath = config.output.publicPath
99
- const buildFolder = path.relative(process.cwd(), paths.appBuild)
100
- printHostingInstructions(
101
- appPackage,
102
- publicUrl,
103
- publicPath,
104
- buildFolder,
105
- useYarn
106
- )
107
- },
108
- (err) => {
109
- const tscCompileOnError = process.env.TSC_COMPILE_ON_ERROR === 'true'
110
- if (tscCompileOnError) {
111
- console.log(
112
- chalk.yellow(
113
- 'Compiled with the following type errors (you may want to check these before deploying your app):\n'
114
- )
115
- )
116
- printBuildError(err)
117
- } else {
118
- console.log(chalk.red('Failed to compile.\n'))
119
- printBuildError(err)
120
- process.exit(1)
121
- }
122
- }
123
- )
124
- .catch((err) => {
125
- if (err && err.message) {
126
- console.log(err.message)
127
- }
128
- process.exit(1)
129
- })
130
-
131
- // Create the production build and print the deployment instructions.
132
- function build(previousFileSizes) {
133
- console.log('Creating an optimized production build...')
134
-
135
- const compiler = webpack(config)
136
- return new Promise((resolve, reject) => {
137
- compiler.run((err, stats) => {
138
- let messages
139
- if (err) {
140
- if (!err.message) {
141
- return reject(err)
142
- }
143
-
144
- let errMessage = err.message
145
-
146
- // Add additional information for postcss errors
147
- if (Object.prototype.hasOwnProperty.call(err, 'postcssNode')) {
148
- errMessage +=
149
- '\nCompileError: Begins at CSS selector ' +
150
- err['postcssNode'].selector
151
- }
152
-
153
- messages = formatWebpackMessages({
154
- errors: [errMessage],
155
- warnings: [],
156
- })
157
- } else {
158
- messages = formatWebpackMessages(
159
- stats.toJson({ all: false, warnings: true, errors: true })
160
- )
161
- }
162
- if (messages.errors.length) {
163
- // Only keep the first error. Others are often indicative
164
- // of the same problem, but confuse the reader with noise.
165
- if (messages.errors.length > 1) {
166
- messages.errors.length = 1
167
- }
168
- return reject(new Error(messages.errors.join('\n\n')))
169
- }
170
- if (
171
- process.env.CI &&
172
- (typeof process.env.CI !== 'string' ||
173
- process.env.CI.toLowerCase() !== 'false') &&
174
- messages.warnings.length
175
- ) {
176
- console.log(
177
- chalk.yellow(
178
- '\nTreating warnings as errors because process.env.CI = true.\n' +
179
- 'Most CI servers set it automatically.\n'
180
- )
181
- )
182
- return reject(new Error(messages.warnings.join('\n\n')))
183
- }
184
-
185
- const resolveArgs = {
186
- stats,
187
- previousFileSizes,
188
- warnings: messages.warnings,
189
- }
190
-
191
- if (writeStatsJson) {
192
- return bfj
193
- .write(paths.appBuild + '/bundle-stats.json', stats.toJson())
194
- .then(() => resolve(resolveArgs))
195
- .catch((error) => reject(new Error(error)))
196
- }
197
-
198
- return resolve(resolveArgs)
199
- })
200
- })
201
- }
202
-
203
- function copyPublicFolder() {
204
- fs.copySync(paths.appPublic, paths.appBuild, {
205
- dereference: true,
206
- filter: (file) => file !== paths.appHtml,
207
- })
208
- }