@abtnode/ux 1.16.26-beta-351de484 → 1.16.26-beta-63f52a83

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 (59) hide show
  1. package/es/blocklet/app-avatar.js +7 -19
  2. package/es/blocklet/authentication/index.js +1 -3
  3. package/es/blocklet/authentication/oauth/apple.js +39 -15
  4. package/es/blocklet/authentication/oauth/auth0.js +18 -12
  5. package/es/blocklet/authentication/oauth/github.js +10 -9
  6. package/es/blocklet/authentication/oauth/google.js +10 -9
  7. package/es/blocklet/component/component-cell.js +201 -359
  8. package/es/blocklet/component/component-info-dialog.js +257 -0
  9. package/es/blocklet/component/index.js +14 -12
  10. package/es/blocklet/component/store-blocklet-list.js +3 -0
  11. package/es/blocklet/publish/connect-store-list.js +33 -4
  12. package/es/blocklet/publish/create-release.js +9 -4
  13. package/es/blocklet/status.js +13 -7
  14. package/es/locales/ar.js +19 -12
  15. package/es/locales/de.js +19 -12
  16. package/es/locales/en.js +18 -11
  17. package/es/locales/es.js +20 -13
  18. package/es/locales/fr.js +19 -12
  19. package/es/locales/hi.js +19 -12
  20. package/es/locales/i18n.db +0 -0
  21. package/es/locales/id.js +19 -12
  22. package/es/locales/ja.js +19 -12
  23. package/es/locales/ko.js +19 -12
  24. package/es/locales/pt.js +19 -12
  25. package/es/locales/ru.js +19 -12
  26. package/es/locales/th.js +19 -12
  27. package/es/locales/vi.js +19 -12
  28. package/es/locales/zh-tw.js +28 -21
  29. package/es/locales/zh.js +27 -20
  30. package/lib/blocklet/app-avatar.js +7 -20
  31. package/lib/blocklet/authentication/index.js +1 -3
  32. package/lib/blocklet/authentication/oauth/apple.js +51 -28
  33. package/lib/blocklet/authentication/oauth/auth0.js +18 -16
  34. package/lib/blocklet/authentication/oauth/github.js +10 -13
  35. package/lib/blocklet/authentication/oauth/google.js +10 -13
  36. package/lib/blocklet/component/component-cell.js +209 -370
  37. package/lib/blocklet/component/component-info-dialog.js +253 -0
  38. package/lib/blocklet/component/index.js +14 -12
  39. package/lib/blocklet/component/store-blocklet-list.js +3 -0
  40. package/lib/blocklet/publish/connect-store-list.js +32 -3
  41. package/lib/blocklet/publish/create-release.js +9 -4
  42. package/lib/blocklet/status.js +14 -8
  43. package/lib/locales/ar.js +19 -12
  44. package/lib/locales/de.js +19 -12
  45. package/lib/locales/en.js +18 -11
  46. package/lib/locales/es.js +20 -13
  47. package/lib/locales/fr.js +19 -12
  48. package/lib/locales/hi.js +19 -12
  49. package/lib/locales/i18n.db +0 -0
  50. package/lib/locales/id.js +19 -12
  51. package/lib/locales/ja.js +19 -12
  52. package/lib/locales/ko.js +19 -12
  53. package/lib/locales/pt.js +19 -12
  54. package/lib/locales/ru.js +19 -12
  55. package/lib/locales/th.js +19 -12
  56. package/lib/locales/vi.js +19 -12
  57. package/lib/locales/zh-tw.js +28 -21
  58. package/lib/locales/zh.js +27 -20
  59. package/package.json +17 -17
@@ -1,7 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import Avatar from '@mui/material/Avatar';
3
- import DiDAvatar from '@arcblock/did-connect/lib/Avatar';
4
- import { BLOCKLET_CONFIGURABLE_KEY } from '@blocklet/constant';
5
3
  import useAppLogo from '../hooks/use-app-logo';
6
4
  import { jsx as _jsx } from "react/jsx-runtime";
7
5
  export default function BlockletAppAvatar({
@@ -18,22 +16,6 @@ export default function BlockletAppAvatar({
18
16
  const {
19
17
  variant
20
18
  } = rest;
21
- let imgEle = /*#__PURE__*/_jsx("img", {
22
- src: logoUrl,
23
- alt: "",
24
- style: {
25
- width: size
26
- }
27
- });
28
- if (!blocklet.meta.logo) {
29
- const exist = (blocklet.configs || []).find(x => x.key === BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE)?.value;
30
- if (!exist) {
31
- imgEle = /*#__PURE__*/_jsx(DiDAvatar, {
32
- did: blocklet.meta.did || '',
33
- responsive: true
34
- });
35
- }
36
- }
37
19
  return /*#__PURE__*/_jsx(Avatar, {
38
20
  variant: variant || 'square',
39
21
  style: Object.assign({
@@ -43,7 +25,13 @@ export default function BlockletAppAvatar({
43
25
  borderRadius: 10
44
26
  }, style),
45
27
  ...rest,
46
- children: imgEle
28
+ children: /*#__PURE__*/_jsx("img", {
29
+ src: logoUrl,
30
+ alt: "",
31
+ style: {
32
+ width: size
33
+ }
34
+ })
47
35
  });
48
36
  }
49
37
  BlockletAppAvatar.propTypes = {
@@ -41,9 +41,7 @@ function OAuth() {
41
41
  }),
42
42
  value: 'more'
43
43
  }];
44
-
45
- // tabs[0].value
46
- const [currentTab, setCurrentTab] = useState('oauth');
44
+ const [currentTab, setCurrentTab] = useState(tabs[0].value);
47
45
  const contents = useCreation(() => ({
48
46
  oauth: /*#__PURE__*/_jsx(OAuthLogin, {}),
49
47
  federated: /*#__PURE__*/_jsx(FederatedLogin, {}),
@@ -8,6 +8,14 @@ import { useNodeContext } from '../../../contexts/node';
8
8
  import { useBlockletContext } from '../../../contexts/blocklet';
9
9
  import SwitchControl from '../../component/switch-control';
10
10
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ const defaultValue = {
12
+ enabled: false,
13
+ teamId: '',
14
+ serviceId: '',
15
+ keyId: '',
16
+ authKey: '',
17
+ bundleId: ''
18
+ };
11
19
  function OAuthApple() {
12
20
  const {
13
21
  api
@@ -20,11 +28,7 @@ function OAuthApple() {
20
28
  } = useLocaleContext();
21
29
  const did = blocklet?.meta?.did;
22
30
  const authData = Object.assign({
23
- enabled: false,
24
- teamId: '',
25
- serviceId: '',
26
- keyId: '',
27
- authKey: ''
31
+ ...defaultValue
28
32
  }, blocklet?.settings?.oauth?.apple || {});
29
33
  const {
30
34
  handleSubmit,
@@ -33,7 +37,7 @@ function OAuthApple() {
33
37
  watch,
34
38
  reset
35
39
  } = useForm({
36
- defaultValues: pick(authData, ['enabled', 'teamId', 'serviceId', 'keyId', 'authKey'])
40
+ defaultValues: pick(authData, Object.keys(defaultValue))
37
41
  });
38
42
  const enabled = watch('enabled');
39
43
  const onSubmit = useMemoizedFn(async data => {
@@ -49,11 +53,7 @@ function OAuthApple() {
49
53
  }
50
54
  });
51
55
  const defaultValues = Object.assign({
52
- enabled: false,
53
- teamId: '',
54
- serviceId: '',
55
- keyId: '',
56
- authKey: ''
56
+ ...defaultValue
57
57
  }, blockletChanged?.settings?.oauth?.apple || {});
58
58
  // 将当前表单的默认值重置为新的数据,这样能够修正页面的 isDirty 数据
59
59
  reset(defaultValues);
@@ -64,25 +64,31 @@ function OAuthApple() {
64
64
  });
65
65
  const validateTeamId = useMemoizedFn(val => {
66
66
  if (!val?.trim()) {
67
- return t('oauth.apple.teamIdDescribe');
67
+ return t('oauth.apple.teamIdDescription');
68
68
  }
69
69
  return true;
70
70
  });
71
71
  const validateServiceId = useMemoizedFn(val => {
72
72
  if (!val?.trim()) {
73
- return t('oauth.apple.serviceIdDescribe');
73
+ return t('oauth.apple.serviceIdDescription');
74
74
  }
75
75
  return true;
76
76
  });
77
77
  const validateKeyId = useMemoizedFn(val => {
78
78
  if (!val?.trim()) {
79
- return t('oauth.apple.keyIdDescribe');
79
+ return t('oauth.apple.keyIdDescription');
80
80
  }
81
81
  return true;
82
82
  });
83
83
  const validateAuthKey = useMemoizedFn(val => {
84
84
  if (!val?.trim()) {
85
- return t('oauth.apple.authKeyDescribe');
85
+ return t('oauth.apple.authKeyDescription');
86
+ }
87
+ return true;
88
+ });
89
+ const validateBundleId = useMemoizedFn(val => {
90
+ if (!val?.trim()) {
91
+ return t('oauth.apple.bundleIdDescription');
86
92
  }
87
93
  return true;
88
94
  });
@@ -128,6 +134,24 @@ function OAuthApple() {
128
134
  disabled: !enabled
129
135
  })
130
136
  })
137
+ }), /*#__PURE__*/_jsx(Controller, {
138
+ name: "bundleId",
139
+ control: control,
140
+ rules: {
141
+ validate: enabled ? validateBundleId : noop
142
+ },
143
+ render: ({
144
+ field
145
+ }) => /*#__PURE__*/_jsx(FormControl, {
146
+ fullWidth: true,
147
+ children: /*#__PURE__*/_jsx(TextField, {
148
+ ...field,
149
+ error: !!formState.errors[field.name],
150
+ label: t('oauth.apple.bundleId'),
151
+ helperText: formState.errors[field.name]?.message || ' ',
152
+ disabled: !enabled
153
+ })
154
+ })
131
155
  }), /*#__PURE__*/_jsx(Controller, {
132
156
  name: "serviceId",
133
157
  control: control,
@@ -8,6 +8,12 @@ import { useNodeContext } from '../../../contexts/node';
8
8
  import { useBlockletContext } from '../../../contexts/blocklet';
9
9
  import SwitchControl from '../../component/switch-control';
10
10
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ const defaultValue = {
12
+ enabled: false,
13
+ domain: '',
14
+ clientId: '',
15
+ clientSecret: ''
16
+ };
11
17
  function OAuthAuth0() {
12
18
  const {
13
19
  api
@@ -20,10 +26,7 @@ function OAuthAuth0() {
20
26
  } = useLocaleContext();
21
27
  const did = blocklet?.meta?.did;
22
28
  const auth0 = Object.assign({
23
- enabled: false,
24
- domain: '',
25
- clientId: '',
26
- clientSecret: ''
29
+ ...defaultValue
27
30
  }, blocklet?.settings?.oauth?.auth0 || {});
28
31
  const {
29
32
  handleSubmit,
@@ -32,7 +35,7 @@ function OAuthAuth0() {
32
35
  watch,
33
36
  reset
34
37
  } = useForm({
35
- defaultValues: pick(auth0, ['domain', 'clientId', 'clientSecret', 'enabled'])
38
+ defaultValues: pick(auth0, Object.keys(defaultValue))
36
39
  });
37
40
  const enabled = watch('enabled');
38
41
  const onSubmit = useMemoizedFn(async data => {
@@ -48,10 +51,7 @@ function OAuthAuth0() {
48
51
  }
49
52
  });
50
53
  const defaultValues = Object.assign({
51
- enabled: false,
52
- domain: '',
53
- clientId: '',
54
- clientSecret: ''
54
+ ...defaultValue
55
55
  }, blockletChanged?.settings?.oauth?.auth0 || {});
56
56
  // 将当前表单的默认值重置为新的数据,这样能够修正页面的 isDirty 数据
57
57
  reset(defaultValues);
@@ -62,13 +62,19 @@ function OAuthAuth0() {
62
62
  });
63
63
  const validateDomain = useMemoizedFn(val => {
64
64
  if (!val?.trim()) {
65
- return t('oauth.auth0.domainDescribe');
65
+ return t('oauth.auth0.domainDescription');
66
66
  }
67
67
  return true;
68
68
  });
69
69
  const validateClientId = useMemoizedFn(val => {
70
70
  if (!val?.trim()) {
71
- return t('oauth.auth0.clientIdDescribe');
71
+ return t('oauth.auth0.clientIdDescription');
72
+ }
73
+ return true;
74
+ });
75
+ const validateClientSecret = useMemoizedFn(val => {
76
+ if (!val?.trim()) {
77
+ return t('oauth.auth0.clientSecretDescription');
72
78
  }
73
79
  return true;
74
80
  });
@@ -136,7 +142,7 @@ function OAuthAuth0() {
136
142
  name: "clientSecret",
137
143
  control: control,
138
144
  rules: {
139
- validate: noop
145
+ validate: enabled ? validateClientSecret : noop
140
146
  },
141
147
  render: ({
142
148
  field
@@ -8,6 +8,11 @@ import { useNodeContext } from '../../../contexts/node';
8
8
  import { useBlockletContext } from '../../../contexts/blocklet';
9
9
  import SwitchControl from '../../component/switch-control';
10
10
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ const defaultValue = {
12
+ enabled: false,
13
+ clientId: '',
14
+ clientSecret: ''
15
+ };
11
16
  function OAuthGithub() {
12
17
  const {
13
18
  api
@@ -21,9 +26,7 @@ function OAuthGithub() {
21
26
  // TODO: @zhanghan 将来需要换成 permanent did
22
27
  const did = blocklet?.meta?.did;
23
28
  const github = Object.assign({
24
- enabled: false,
25
- clientId: '',
26
- clientSecret: ''
29
+ ...defaultValue
27
30
  }, blocklet?.settings?.oauth?.github || {});
28
31
  const {
29
32
  handleSubmit,
@@ -32,7 +35,7 @@ function OAuthGithub() {
32
35
  watch,
33
36
  reset
34
37
  } = useForm({
35
- defaultValues: pick(github, ['clientSecret', 'clientId', 'enabled'])
38
+ defaultValues: pick(github, Object.keys(defaultValue))
36
39
  });
37
40
  const enabled = watch('enabled');
38
41
  const onSubmit = useMemoizedFn(async data => {
@@ -48,9 +51,7 @@ function OAuthGithub() {
48
51
  }
49
52
  });
50
53
  const defaultValues = Object.assign({
51
- enabled: false,
52
- clientId: '',
53
- clientSecret: ''
54
+ ...defaultValue
54
55
  }, blockletChanged?.settings?.oauth?.github || {});
55
56
  // 将当前表单的默认值重置为新的数据,这样能够修正页面的 isDirty 数据
56
57
  reset(defaultValues);
@@ -61,13 +62,13 @@ function OAuthGithub() {
61
62
  });
62
63
  const validateClientId = useMemoizedFn(val => {
63
64
  if (!val?.trim()) {
64
- return t('oauth.github.clientIdDescribe');
65
+ return t('oauth.github.clientIdDescription');
65
66
  }
66
67
  return true;
67
68
  });
68
69
  const validateClientSecret = useMemoizedFn(val => {
69
70
  if (!val?.trim()) {
70
- return t('oauth.github.clientSecretDescribe');
71
+ return t('oauth.github.clientSecretDescription');
71
72
  }
72
73
  return true;
73
74
  });
@@ -8,6 +8,11 @@ import { useNodeContext } from '../../../contexts/node';
8
8
  import { useBlockletContext } from '../../../contexts/blocklet';
9
9
  import SwitchControl from '../../component/switch-control';
10
10
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ const defaultValue = {
12
+ enabled: false,
13
+ clientId: '',
14
+ clientSecret: ''
15
+ };
11
16
  function OAuthGoogle() {
12
17
  const {
13
18
  api
@@ -20,9 +25,7 @@ function OAuthGoogle() {
20
25
  } = useLocaleContext();
21
26
  const did = blocklet?.meta?.did;
22
27
  const authData = Object.assign({
23
- enabled: false,
24
- clientId: '',
25
- clientSecret: ''
28
+ ...defaultValue
26
29
  }, blocklet?.settings?.oauth?.google || {});
27
30
  const {
28
31
  handleSubmit,
@@ -31,7 +34,7 @@ function OAuthGoogle() {
31
34
  watch,
32
35
  reset
33
36
  } = useForm({
34
- defaultValues: pick(authData, ['clientSecret', 'clientId', 'enabled'])
37
+ defaultValues: pick(authData, Object.keys(defaultValue))
35
38
  });
36
39
  const enabled = watch('enabled');
37
40
  const onSubmit = useMemoizedFn(async data => {
@@ -47,9 +50,7 @@ function OAuthGoogle() {
47
50
  }
48
51
  });
49
52
  const defaultValues = Object.assign({
50
- enabled: false,
51
- clientId: '',
52
- clientSecret: ''
53
+ ...defaultValue
53
54
  }, blockletChanged?.settings?.oauth?.google || {});
54
55
  // 将当前表单的默认值重置为新的数据,这样能够修正页面的 isDirty 数据
55
56
  reset(defaultValues);
@@ -60,13 +61,13 @@ function OAuthGoogle() {
60
61
  });
61
62
  const validateClientId = useMemoizedFn(val => {
62
63
  if (!val?.trim()) {
63
- return t('oauth.google.clientIdDescribe');
64
+ return t('oauth.google.clientIdDescription');
64
65
  }
65
66
  return true;
66
67
  });
67
68
  const validateClientSecret = useMemoizedFn(val => {
68
69
  if (!val?.trim()) {
69
- return t('oauth.google.clientSecretDescribe');
70
+ return t('oauth.google.clientSecretDescription');
70
71
  }
71
72
  return true;
72
73
  });