@arcblock/did-connect-react 3.2.19 → 3.3.0

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 (52) hide show
  1. package/docs/assets/diagram/core-components-session-provider-01.ja.jpg +0 -0
  2. package/docs/assets/diagram/core-components-session-provider-01.jpg +0 -0
  3. package/docs/assets/diagram/core-components-session-provider-01.zh-TW.jpg +0 -0
  4. package/docs/assets/diagram/core-components-session-provider-01.zh.jpg +0 -0
  5. package/docs/assets/diagram/did-connect-diagram-0.ja.jpg +0 -0
  6. package/docs/assets/diagram/did-connect-diagram-0.jpg +0 -0
  7. package/docs/assets/diagram/did-connect-diagram-0.zh-TW.jpg +0 -0
  8. package/docs/assets/diagram/did-connect-diagram-0.zh.jpg +0 -0
  9. package/docs/assets/diagram/overview-01.ja.jpg +0 -0
  10. package/docs/assets/diagram/overview-01.jpg +0 -0
  11. package/docs/assets/diagram/overview-01.zh-TW.jpg +0 -0
  12. package/docs/assets/diagram/overview-01.zh.jpg +0 -0
  13. package/docs/assets/diagram/use-connect-diagram-0.ja.jpg +0 -0
  14. package/docs/assets/diagram/use-connect-diagram-0.jpg +0 -0
  15. package/docs/assets/diagram/use-connect-diagram-0.zh-TW.jpg +0 -0
  16. package/docs/assets/diagram/use-connect-diagram-0.zh.jpg +0 -0
  17. package/docs/core-components-did-connect.ja.md +3 -50
  18. package/docs/core-components-did-connect.md +5 -52
  19. package/docs/core-components-did-connect.zh-TW.md +3 -50
  20. package/docs/core-components-did-connect.zh.md +3 -50
  21. package/docs/core-components-session-provider.ja.md +3 -45
  22. package/docs/core-components-session-provider.md +3 -45
  23. package/docs/core-components-session-provider.zh-TW.md +3 -45
  24. package/docs/core-components-session-provider.zh.md +3 -45
  25. package/docs/hooks-use-connect.ja.md +3 -39
  26. package/docs/hooks-use-connect.md +4 -40
  27. package/docs/hooks-use-connect.zh-TW.md +3 -39
  28. package/docs/hooks-use-connect.zh.md +3 -39
  29. package/docs/overview.ja.md +3 -45
  30. package/docs/overview.md +3 -45
  31. package/docs/overview.zh-TW.md +3 -45
  32. package/docs/overview.zh.md +3 -45
  33. package/lib/Connect/assets/locale.js +4 -2
  34. package/lib/Connect/components/login-item/connect-choose-list.js +2 -2
  35. package/lib/Connect/components/login-item/connect-provider-list.js +299 -0
  36. package/lib/Connect/components/login-item/login-method-item.js +42 -41
  37. package/lib/Connect/hooks/provider-list.js +50 -0
  38. package/lib/Connect/index.js +180 -196
  39. package/lib/OAuth/context.js +33 -32
  40. package/lib/Session/hooks/use-verify.js +1 -1
  41. package/lib/Session/libs/locales.js +3 -3
  42. package/lib/package.json.js +1 -1
  43. package/package.json +9 -9
  44. package/src/Connect/assets/locale.js +2 -0
  45. package/src/Connect/components/login-item/connect-choose-list.jsx +5 -5
  46. package/src/Connect/components/login-item/connect-provider-list.jsx +392 -0
  47. package/src/Connect/components/login-item/login-method-item.jsx +31 -28
  48. package/src/Connect/hooks/provider-list.js +127 -0
  49. package/src/Connect/index.jsx +8 -27
  50. package/src/OAuth/context.jsx +10 -2
  51. package/src/Session/hooks/use-verify.jsx +1 -1
  52. package/src/Session/libs/locales.js +3 -3
@@ -141,11 +141,19 @@ function OAuthProvider({
141
141
  const blocklet = await getBlocklet();
142
142
  const federatedEnabled = getFederatedEnabled(blocklet);
143
143
  const master = getMaster(blocklet);
144
+ let result = {};
144
145
  if (federatedEnabled && master?.appPid && sourceAppPid === master?.appPid) {
145
146
  const masterBlocklet = await getBlockletData(master.appUrl);
146
- return masterBlocklet?.settings?.oauth || {};
147
+ result = masterBlocklet?.settings?.authentication || {};
148
+ } else {
149
+ result = blocklet?.settings?.authentication || {};
147
150
  }
148
- return blocklet?.settings?.oauth || {};
151
+ return Object.keys(result).reduce((acc, cur) => {
152
+ if (result[cur]?.type === 'oauth') {
153
+ acc[cur] = result[cur];
154
+ }
155
+ return acc;
156
+ }, {});
149
157
  });
150
158
  const getOAuthConfigList = useMemoizedFn(async ({ sourceAppPid } = {}) => {
151
159
  const oauthConfigs = await getOAuthConfigs({ sourceAppPid });
@@ -2,7 +2,7 @@
2
2
  * 函数二次验证 hook
3
3
  */
4
4
  import { translate } from '@arcblock/ux/lib/Locale/util';
5
- import { LOGIN_PROVIDER } from '@blocklet/constant';
5
+ import { LOGIN_PROVIDER } from '@arcblock/ux/lib/Util/constant';
6
6
  import { toBase64 } from '@ocap/util';
7
7
  import { translations } from '../libs/locales';
8
8
 
@@ -2,10 +2,10 @@
2
2
  export const translations = {
3
3
  login: {
4
4
  en: {
5
- title: 'Connect',
6
- scan: 'Please use the following methods to complete the connection',
5
+ title: 'Login',
6
+ scan: 'Login with one of the following methods',
7
7
  confirm: 'Confirm connection in your DID Wallet',
8
- success: 'Successfully connected',
8
+ success: 'Successfully logged in',
9
9
  },
10
10
  zh: {
11
11
  title: '登录',