@abtnode/ux 1.16.20-beta-20c7fb25 → 1.16.20
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.
- package/es/blocklet/add-cert.js +7 -2
- package/es/blocklet/component/navigation/locale-tabs.js +5 -1
- package/es/blocklet/component/navigation/navigation-dialog.js +8 -6
- package/lib/blocklet/add-cert.js +7 -2
- package/lib/blocklet/component/navigation/locale-tabs.js +6 -1
- package/lib/blocklet/component/navigation/navigation-dialog.js +8 -6
- package/package.json +7 -7
package/es/blocklet/add-cert.js
CHANGED
|
@@ -64,9 +64,14 @@ function Add(props) {
|
|
|
64
64
|
// Setup 模式下有全局通知,所以这里不需要通知
|
|
65
65
|
if (inService && mode !== 'setup') {
|
|
66
66
|
if (type === 'success') {
|
|
67
|
-
Toast.success(
|
|
67
|
+
Toast.success(t('setup.domain.genCertSuccess', {
|
|
68
|
+
domain: cert.domain
|
|
69
|
+
}));
|
|
68
70
|
} else if (type === 'error') {
|
|
69
|
-
Toast.error(
|
|
71
|
+
Toast.error(t('setup.domain.genCertFailed', {
|
|
72
|
+
domain: cert.domain,
|
|
73
|
+
message: cert.message
|
|
74
|
+
}));
|
|
70
75
|
}
|
|
71
76
|
}
|
|
72
77
|
}
|
|
@@ -52,6 +52,10 @@ function LocaleTabs({
|
|
|
52
52
|
value: locale
|
|
53
53
|
}));
|
|
54
54
|
}, [state.localeList]);
|
|
55
|
+
const defaultLocalLanguage = useMemo(() => {
|
|
56
|
+
const label = localeMap[defaultLocale] || Object.values(localeMap)?.[0];
|
|
57
|
+
return `Default (${label})`;
|
|
58
|
+
}, [localeMap]);
|
|
55
59
|
useEffect(() => {
|
|
56
60
|
state.localeList = [...locales];
|
|
57
61
|
}, [locales, state]);
|
|
@@ -126,7 +130,7 @@ function LocaleTabs({
|
|
|
126
130
|
onChange(value);
|
|
127
131
|
},
|
|
128
132
|
children: [/*#__PURE__*/_jsx(Tab, {
|
|
129
|
-
label:
|
|
133
|
+
label: defaultLocalLanguage,
|
|
130
134
|
value: "en"
|
|
131
135
|
}), state.localeList.map(item => /*#__PURE__*/_jsx(Tab, {
|
|
132
136
|
sx: {
|
|
@@ -86,12 +86,14 @@ const NavigationDialog = /*#__PURE__*/forwardRef(function NavigationDialog({
|
|
|
86
86
|
const {
|
|
87
87
|
blocklet
|
|
88
88
|
} = useBlockletContext();
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
const localeMap = useMemo(() => {
|
|
90
|
+
const config = blocklet.environments.find(x => x.key === 'BLOCKLET_APP_LANGUAGES');
|
|
91
|
+
const languages = config ? config.value.split(',') : ['en', 'zh'];
|
|
92
|
+
return languages.filter(x => SUPPORTED_LANGUAGES[x]).reduce((acc, x) => {
|
|
93
|
+
acc[x] = SUPPORTED_LANGUAGES[x].nativeName;
|
|
94
|
+
return acc;
|
|
95
|
+
}, {});
|
|
96
|
+
}, [blocklet.environments]);
|
|
95
97
|
const saveFn = useRef(() => {});
|
|
96
98
|
const [show, {
|
|
97
99
|
setFalse,
|
package/lib/blocklet/add-cert.js
CHANGED
|
@@ -78,9 +78,14 @@ function Add(props) {
|
|
|
78
78
|
// Setup 模式下有全局通知,所以这里不需要通知
|
|
79
79
|
if (inService && mode !== 'setup') {
|
|
80
80
|
if (type === 'success') {
|
|
81
|
-
_Toast.default.success(
|
|
81
|
+
_Toast.default.success(t('setup.domain.genCertSuccess', {
|
|
82
|
+
domain: cert.domain
|
|
83
|
+
}));
|
|
82
84
|
} else if (type === 'error') {
|
|
83
|
-
_Toast.default.error(
|
|
85
|
+
_Toast.default.error(t('setup.domain.genCertFailed', {
|
|
86
|
+
domain: cert.domain,
|
|
87
|
+
message: cert.message
|
|
88
|
+
}));
|
|
84
89
|
}
|
|
85
90
|
}
|
|
86
91
|
}
|
|
@@ -59,6 +59,11 @@ function LocaleTabs(_ref) {
|
|
|
59
59
|
value: locale
|
|
60
60
|
}));
|
|
61
61
|
}, [state.localeList]);
|
|
62
|
+
const defaultLocalLanguage = (0, _react.useMemo)(() => {
|
|
63
|
+
var _Object$values;
|
|
64
|
+
const label = localeMap[defaultLocale] || ((_Object$values = Object.values(localeMap)) === null || _Object$values === void 0 ? void 0 : _Object$values[0]);
|
|
65
|
+
return "Default (".concat(label, ")");
|
|
66
|
+
}, [localeMap]);
|
|
62
67
|
(0, _react.useEffect)(() => {
|
|
63
68
|
state.localeList = [...locales];
|
|
64
69
|
}, [locales, state]);
|
|
@@ -135,7 +140,7 @@ function LocaleTabs(_ref) {
|
|
|
135
140
|
_onChange(value);
|
|
136
141
|
},
|
|
137
142
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Tab.default, {
|
|
138
|
-
label:
|
|
143
|
+
label: defaultLocalLanguage,
|
|
139
144
|
value: "en"
|
|
140
145
|
}), state.localeList.map(item => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tab.default, {
|
|
141
146
|
sx: {
|
|
@@ -99,12 +99,14 @@ const NavigationDialog = /*#__PURE__*/(0, _react.forwardRef)(function Navigation
|
|
|
99
99
|
const {
|
|
100
100
|
blocklet
|
|
101
101
|
} = (0, _blocklet.useBlockletContext)();
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
102
|
+
const localeMap = (0, _react.useMemo)(() => {
|
|
103
|
+
const config = blocklet.environments.find(x => x.key === 'BLOCKLET_APP_LANGUAGES');
|
|
104
|
+
const languages = config ? config.value.split(',') : ['en', 'zh'];
|
|
105
|
+
return languages.filter(x => _constant.SUPPORTED_LANGUAGES[x]).reduce((acc, x) => {
|
|
106
|
+
acc[x] = _constant.SUPPORTED_LANGUAGES[x].nativeName;
|
|
107
|
+
return acc;
|
|
108
|
+
}, {});
|
|
109
|
+
}, [blocklet.environments]);
|
|
108
110
|
const saveFn = (0, _react.useRef)(() => {});
|
|
109
111
|
const [show, {
|
|
110
112
|
setFalse,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/ux",
|
|
3
|
-
"version": "1.16.20
|
|
3
|
+
"version": "1.16.20",
|
|
4
4
|
"description": "UX components shared across abtnode packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
|
|
28
28
|
"license": "Apache-2.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@abtnode/auth": "1.16.20
|
|
31
|
-
"@abtnode/constant": "1.16.20
|
|
32
|
-
"@abtnode/util": "1.16.20
|
|
30
|
+
"@abtnode/auth": "1.16.20",
|
|
31
|
+
"@abtnode/constant": "1.16.20",
|
|
32
|
+
"@abtnode/util": "1.16.20",
|
|
33
33
|
"@ahooksjs/use-url-state": "^3.5.1",
|
|
34
34
|
"@arcblock/did": "^1.18.105",
|
|
35
35
|
"@arcblock/did-connect": "^2.8.22",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"@arcblock/react-hooks": "^2.8.22",
|
|
40
40
|
"@arcblock/terminal": "^2.8.22",
|
|
41
41
|
"@arcblock/ux": "^2.8.22",
|
|
42
|
-
"@blocklet/constant": "1.16.20
|
|
42
|
+
"@blocklet/constant": "1.16.20",
|
|
43
43
|
"@blocklet/launcher-layout": "2.2.48",
|
|
44
44
|
"@blocklet/list": "^0.12.58",
|
|
45
|
-
"@blocklet/meta": "1.16.20
|
|
45
|
+
"@blocklet/meta": "1.16.20",
|
|
46
46
|
"@blocklet/ui-react": "^2.8.22",
|
|
47
47
|
"@blocklet/uploader": "^0.0.53",
|
|
48
48
|
"@emotion/react": "^11.10.4",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"babel-plugin-inline-react-svg": "^1.1.2",
|
|
101
101
|
"glob": "^10.3.3"
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "715efa6465e9143c23b152b5ef639266ea834843",
|
|
104
104
|
"exports": {
|
|
105
105
|
".": {
|
|
106
106
|
"import": "./es/index.js",
|