@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
@@ -20,6 +20,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
20
20
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
21
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
22
22
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
23
+ const defaultValue = {
24
+ enabled: false,
25
+ domain: '',
26
+ clientId: '',
27
+ clientSecret: ''
28
+ };
23
29
  function OAuthAuth0() {
24
30
  var _blocklet$meta, _blocklet$settings;
25
31
  const {
@@ -32,12 +38,7 @@ function OAuthAuth0() {
32
38
  t
33
39
  } = (0, _context.useLocaleContext)();
34
40
  const did = blocklet === null || blocklet === void 0 || (_blocklet$meta = blocklet.meta) === null || _blocklet$meta === void 0 ? void 0 : _blocklet$meta.did;
35
- const auth0 = Object.assign({
36
- enabled: false,
37
- domain: '',
38
- clientId: '',
39
- clientSecret: ''
40
- }, (blocklet === null || blocklet === void 0 || (_blocklet$settings = blocklet.settings) === null || _blocklet$settings === void 0 || (_blocklet$settings = _blocklet$settings.oauth) === null || _blocklet$settings === void 0 ? void 0 : _blocklet$settings.auth0) || {});
41
+ const auth0 = Object.assign(_objectSpread({}, defaultValue), (blocklet === null || blocklet === void 0 || (_blocklet$settings = blocklet.settings) === null || _blocklet$settings === void 0 || (_blocklet$settings = _blocklet$settings.oauth) === null || _blocklet$settings === void 0 ? void 0 : _blocklet$settings.auth0) || {});
41
42
  const {
42
43
  handleSubmit,
43
44
  control,
@@ -45,7 +46,7 @@ function OAuthAuth0() {
45
46
  watch,
46
47
  reset
47
48
  } = (0, _reactHookForm.useForm)({
48
- defaultValues: (0, _pick.default)(auth0, ['domain', 'clientId', 'clientSecret', 'enabled'])
49
+ defaultValues: (0, _pick.default)(auth0, Object.keys(defaultValue))
49
50
  });
50
51
  const enabled = watch('enabled');
51
52
  const onSubmit = (0, _ahooks.useMemoizedFn)(async data => {
@@ -61,12 +62,7 @@ function OAuthAuth0() {
61
62
  })
62
63
  }
63
64
  });
64
- const defaultValues = Object.assign({
65
- enabled: false,
66
- domain: '',
67
- clientId: '',
68
- clientSecret: ''
69
- }, (blockletChanged === null || blockletChanged === void 0 || (_blockletChanged$sett = blockletChanged.settings) === null || _blockletChanged$sett === void 0 || (_blockletChanged$sett = _blockletChanged$sett.oauth) === null || _blockletChanged$sett === void 0 ? void 0 : _blockletChanged$sett.auth0) || {});
65
+ const defaultValues = Object.assign(_objectSpread({}, defaultValue), (blockletChanged === null || blockletChanged === void 0 || (_blockletChanged$sett = blockletChanged.settings) === null || _blockletChanged$sett === void 0 || (_blockletChanged$sett = _blockletChanged$sett.oauth) === null || _blockletChanged$sett === void 0 ? void 0 : _blockletChanged$sett.auth0) || {});
70
66
  // 将当前表单的默认值重置为新的数据,这样能够修正页面的 isDirty 数据
71
67
  reset(defaultValues);
72
68
  _Toast.default.success(t('oauth.saveSuccess'));
@@ -76,13 +72,19 @@ function OAuthAuth0() {
76
72
  });
77
73
  const validateDomain = (0, _ahooks.useMemoizedFn)(val => {
78
74
  if (!(val !== null && val !== void 0 && val.trim())) {
79
- return t('oauth.auth0.domainDescribe');
75
+ return t('oauth.auth0.domainDescription');
80
76
  }
81
77
  return true;
82
78
  });
83
79
  const validateClientId = (0, _ahooks.useMemoizedFn)(val => {
84
80
  if (!(val !== null && val !== void 0 && val.trim())) {
85
- return t('oauth.auth0.clientIdDescribe');
81
+ return t('oauth.auth0.clientIdDescription');
82
+ }
83
+ return true;
84
+ });
85
+ const validateClientSecret = (0, _ahooks.useMemoizedFn)(val => {
86
+ if (!(val !== null && val !== void 0 && val.trim())) {
87
+ return t('oauth.auth0.clientSecretDescription');
86
88
  }
87
89
  return true;
88
90
  });
@@ -158,7 +160,7 @@ function OAuthAuth0() {
158
160
  name: "clientSecret",
159
161
  control: control,
160
162
  rules: {
161
- validate: noop
163
+ validate: enabled ? validateClientSecret : noop
162
164
  },
163
165
  render: _ref4 => {
164
166
  var _formState$errors$fie3;
@@ -20,6 +20,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
20
20
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
21
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
22
22
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
23
+ const defaultValue = {
24
+ enabled: false,
25
+ clientId: '',
26
+ clientSecret: ''
27
+ };
23
28
  function OAuthGithub() {
24
29
  var _blocklet$meta, _blocklet$settings;
25
30
  const {
@@ -33,11 +38,7 @@ function OAuthGithub() {
33
38
  } = (0, _context.useLocaleContext)();
34
39
  // TODO: @zhanghan 将来需要换成 permanent did
35
40
  const did = blocklet === null || blocklet === void 0 || (_blocklet$meta = blocklet.meta) === null || _blocklet$meta === void 0 ? void 0 : _blocklet$meta.did;
36
- const github = Object.assign({
37
- enabled: false,
38
- clientId: '',
39
- clientSecret: ''
40
- }, (blocklet === null || blocklet === void 0 || (_blocklet$settings = blocklet.settings) === null || _blocklet$settings === void 0 || (_blocklet$settings = _blocklet$settings.oauth) === null || _blocklet$settings === void 0 ? void 0 : _blocklet$settings.github) || {});
41
+ const github = Object.assign(_objectSpread({}, defaultValue), (blocklet === null || blocklet === void 0 || (_blocklet$settings = blocklet.settings) === null || _blocklet$settings === void 0 || (_blocklet$settings = _blocklet$settings.oauth) === null || _blocklet$settings === void 0 ? void 0 : _blocklet$settings.github) || {});
41
42
  const {
42
43
  handleSubmit,
43
44
  control,
@@ -45,7 +46,7 @@ function OAuthGithub() {
45
46
  watch,
46
47
  reset
47
48
  } = (0, _reactHookForm.useForm)({
48
- defaultValues: (0, _pick.default)(github, ['clientSecret', 'clientId', 'enabled'])
49
+ defaultValues: (0, _pick.default)(github, Object.keys(defaultValue))
49
50
  });
50
51
  const enabled = watch('enabled');
51
52
  const onSubmit = (0, _ahooks.useMemoizedFn)(async data => {
@@ -61,11 +62,7 @@ function OAuthGithub() {
61
62
  })
62
63
  }
63
64
  });
64
- const defaultValues = Object.assign({
65
- enabled: false,
66
- clientId: '',
67
- clientSecret: ''
68
- }, (blockletChanged === null || blockletChanged === void 0 || (_blockletChanged$sett = blockletChanged.settings) === null || _blockletChanged$sett === void 0 || (_blockletChanged$sett = _blockletChanged$sett.oauth) === null || _blockletChanged$sett === void 0 ? void 0 : _blockletChanged$sett.github) || {});
65
+ const defaultValues = Object.assign(_objectSpread({}, defaultValue), (blockletChanged === null || blockletChanged === void 0 || (_blockletChanged$sett = blockletChanged.settings) === null || _blockletChanged$sett === void 0 || (_blockletChanged$sett = _blockletChanged$sett.oauth) === null || _blockletChanged$sett === void 0 ? void 0 : _blockletChanged$sett.github) || {});
69
66
  // 将当前表单的默认值重置为新的数据,这样能够修正页面的 isDirty 数据
70
67
  reset(defaultValues);
71
68
  _Toast.default.success(t('oauth.saveSuccess'));
@@ -75,13 +72,13 @@ function OAuthGithub() {
75
72
  });
76
73
  const validateClientId = (0, _ahooks.useMemoizedFn)(val => {
77
74
  if (!(val !== null && val !== void 0 && val.trim())) {
78
- return t('oauth.github.clientIdDescribe');
75
+ return t('oauth.github.clientIdDescription');
79
76
  }
80
77
  return true;
81
78
  });
82
79
  const validateClientSecret = (0, _ahooks.useMemoizedFn)(val => {
83
80
  if (!(val !== null && val !== void 0 && val.trim())) {
84
- return t('oauth.github.clientSecretDescribe');
81
+ return t('oauth.github.clientSecretDescription');
85
82
  }
86
83
  return true;
87
84
  });
@@ -20,6 +20,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
20
20
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
21
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
22
22
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
23
+ const defaultValue = {
24
+ enabled: false,
25
+ clientId: '',
26
+ clientSecret: ''
27
+ };
23
28
  function OAuthGoogle() {
24
29
  var _blocklet$meta, _blocklet$settings;
25
30
  const {
@@ -32,11 +37,7 @@ function OAuthGoogle() {
32
37
  t
33
38
  } = (0, _context.useLocaleContext)();
34
39
  const did = blocklet === null || blocklet === void 0 || (_blocklet$meta = blocklet.meta) === null || _blocklet$meta === void 0 ? void 0 : _blocklet$meta.did;
35
- const authData = Object.assign({
36
- enabled: false,
37
- clientId: '',
38
- clientSecret: ''
39
- }, (blocklet === null || blocklet === void 0 || (_blocklet$settings = blocklet.settings) === null || _blocklet$settings === void 0 || (_blocklet$settings = _blocklet$settings.oauth) === null || _blocklet$settings === void 0 ? void 0 : _blocklet$settings.google) || {});
40
+ const authData = Object.assign(_objectSpread({}, defaultValue), (blocklet === null || blocklet === void 0 || (_blocklet$settings = blocklet.settings) === null || _blocklet$settings === void 0 || (_blocklet$settings = _blocklet$settings.oauth) === null || _blocklet$settings === void 0 ? void 0 : _blocklet$settings.google) || {});
40
41
  const {
41
42
  handleSubmit,
42
43
  control,
@@ -44,7 +45,7 @@ function OAuthGoogle() {
44
45
  watch,
45
46
  reset
46
47
  } = (0, _reactHookForm.useForm)({
47
- defaultValues: (0, _pick.default)(authData, ['clientSecret', 'clientId', 'enabled'])
48
+ defaultValues: (0, _pick.default)(authData, Object.keys(defaultValue))
48
49
  });
49
50
  const enabled = watch('enabled');
50
51
  const onSubmit = (0, _ahooks.useMemoizedFn)(async data => {
@@ -60,11 +61,7 @@ function OAuthGoogle() {
60
61
  })
61
62
  }
62
63
  });
63
- const defaultValues = Object.assign({
64
- enabled: false,
65
- clientId: '',
66
- clientSecret: ''
67
- }, (blockletChanged === null || blockletChanged === void 0 || (_blockletChanged$sett = blockletChanged.settings) === null || _blockletChanged$sett === void 0 || (_blockletChanged$sett = _blockletChanged$sett.oauth) === null || _blockletChanged$sett === void 0 ? void 0 : _blockletChanged$sett.google) || {});
64
+ const defaultValues = Object.assign(_objectSpread({}, defaultValue), (blockletChanged === null || blockletChanged === void 0 || (_blockletChanged$sett = blockletChanged.settings) === null || _blockletChanged$sett === void 0 || (_blockletChanged$sett = _blockletChanged$sett.oauth) === null || _blockletChanged$sett === void 0 ? void 0 : _blockletChanged$sett.google) || {});
68
65
  // 将当前表单的默认值重置为新的数据,这样能够修正页面的 isDirty 数据
69
66
  reset(defaultValues);
70
67
  _Toast.default.success(t('oauth.saveSuccess'));
@@ -74,13 +71,13 @@ function OAuthGoogle() {
74
71
  });
75
72
  const validateClientId = (0, _ahooks.useMemoizedFn)(val => {
76
73
  if (!(val !== null && val !== void 0 && val.trim())) {
77
- return t('oauth.google.clientIdDescribe');
74
+ return t('oauth.google.clientIdDescription');
78
75
  }
79
76
  return true;
80
77
  });
81
78
  const validateClientSecret = (0, _ahooks.useMemoizedFn)(val => {
82
79
  if (!(val !== null && val !== void 0 && val.trim())) {
83
- return t('oauth.google.clientSecretDescribe');
80
+ return t('oauth.google.clientSecretDescription');
84
81
  }
85
82
  return true;
86
83
  });