@blocklet/did-space-react 0.5.77 → 0.5.79
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/dist/cjs/components/space-card/index.d.ts +0 -1
- package/dist/cjs/components/space-card/index.js +19 -35
- package/dist/cjs/hooks/use-space-info.js +1 -1
- package/dist/cjs/libs/constants.d.ts +2 -0
- package/dist/cjs/libs/constants.js +3 -1
- package/dist/cjs/locales/en.js +3 -4
- package/dist/cjs/locales/zh.js +3 -4
- package/dist/cjs/package.json.js +1 -1
- package/dist/es/components/space-card/index.d.ts +0 -1
- package/dist/es/components/space-card/index.js +22 -38
- package/dist/es/hooks/use-space-info.js +1 -1
- package/dist/es/libs/constants.d.ts +2 -0
- package/dist/es/libs/constants.js +3 -1
- package/dist/es/locales/en.js +3 -4
- package/dist/es/locales/zh.js +3 -4
- package/dist/es/package.json.js +1 -1
- package/package.json +16 -16
|
@@ -24,6 +24,7 @@ const spaceConnected = require('../../icons/space-connected.svg.js');
|
|
|
24
24
|
const spaceDisconnect = require('../../icons/space-disconnect.svg.js');
|
|
25
25
|
const spaceConnectError = require('../../icons/space-connect-error.svg.js');
|
|
26
26
|
|
|
27
|
+
const expectVersion = `^${_package.version}`;
|
|
27
28
|
function Status({
|
|
28
29
|
spaceUrl,
|
|
29
30
|
status,
|
|
@@ -86,6 +87,17 @@ function Status({
|
|
|
86
87
|
[constants.SPACE_CONNECT_ERROR_CODE.CORS_BLOCKED]: {
|
|
87
88
|
icon: /* @__PURE__ */ jsxRuntime.jsx(spaceConnectError, { style: iconStyle }),
|
|
88
89
|
text: /* @__PURE__ */ jsxRuntime.jsx(ErrorLink, { title: t("storage.spaces.error.corsBlocked"), url: ufo.withQuery(constants.fixCorsErrorPageUrl, { locale }) })
|
|
90
|
+
},
|
|
91
|
+
// Space 版本不兼容
|
|
92
|
+
[constants.SPACE_CONNECT_ERROR_CODE.INCOMPATIBLE]: {
|
|
93
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(spaceConnectError, { style: iconStyle }),
|
|
94
|
+
text: /* @__PURE__ */ jsxRuntime.jsx(
|
|
95
|
+
ErrorLink,
|
|
96
|
+
{
|
|
97
|
+
title: t("storage.spaces.error.incompatible"),
|
|
98
|
+
url: ufo.joinURL(new URL(spaceUrl).origin, ".well-known/service/admin/components")
|
|
99
|
+
}
|
|
100
|
+
)
|
|
89
101
|
}
|
|
90
102
|
}),
|
|
91
103
|
[locale]
|
|
@@ -144,7 +156,6 @@ function SpaceCard({ endpoint, selected = false, compat, action, className, deps
|
|
|
144
156
|
}
|
|
145
157
|
const spaceDid = util.getSpaceDidFromEndpoint(endpoint);
|
|
146
158
|
const spaceUrl = util.getSpaceUrlFromEndpoint(endpoint);
|
|
147
|
-
const spaceOrigin = new URL(endpoint).origin;
|
|
148
159
|
const gatewayUrl = util.getSpaceGatewayUrlFromEndpoint(endpoint);
|
|
149
160
|
const [refreshSpaceInfo, setRefreshSpaceInfo] = React.useState(false);
|
|
150
161
|
const refresh = () => setRefreshSpaceInfo((p) => !p);
|
|
@@ -165,7 +176,12 @@ function SpaceCard({ endpoint, selected = false, compat, action, className, deps
|
|
|
165
176
|
spaceName = /* @__PURE__ */ jsxRuntime.jsx(material.Skeleton, { variant: "text", sx: { width: "180px", fontSize: "1rem" } });
|
|
166
177
|
} else if (spaceInfo) {
|
|
167
178
|
spaceName = spaceInfo.name;
|
|
168
|
-
|
|
179
|
+
const spaceVersion = spaceInfo.version;
|
|
180
|
+
const isIncompatible = !spaceVersion || !compareVersions.satisfies(spaceVersion, expectVersion);
|
|
181
|
+
if (isIncompatible) {
|
|
182
|
+
spaceStatus.current = index.SpaceStatus.UNAVAILABLE;
|
|
183
|
+
errorCode = constants.SPACE_CONNECT_ERROR_CODE.INCOMPATIBLE;
|
|
184
|
+
} else if (!isAvailable) {
|
|
169
185
|
spaceStatus.current = index.SpaceStatus.UNAVAILABLE;
|
|
170
186
|
errorCode = spaceInfo.errorCode;
|
|
171
187
|
if (errorCode === constants.SPACE_CONNECT_ERROR_CODE.UNAUTHORIZED) {
|
|
@@ -183,8 +199,6 @@ function SpaceCard({ endpoint, selected = false, compat, action, className, deps
|
|
|
183
199
|
errorCode = constants.SPACE_CONNECT_ERROR_CODE.NETWORK_ERROR;
|
|
184
200
|
}
|
|
185
201
|
}
|
|
186
|
-
const spaceVersion = spaceInfo?.version;
|
|
187
|
-
const isLegacySpace = !!spaceInfo && (!spaceVersion || compareVersions.compareVersions(spaceVersion, _package.version) < 0);
|
|
188
202
|
const renderAction = () => {
|
|
189
203
|
if (loading)
|
|
190
204
|
return null;
|
|
@@ -201,7 +215,6 @@ function SpaceCard({ endpoint, selected = false, compat, action, className, deps
|
|
|
201
215
|
errorCode,
|
|
202
216
|
selected,
|
|
203
217
|
compat: isCompact,
|
|
204
|
-
isLegacySpace,
|
|
205
218
|
refresh
|
|
206
219
|
});
|
|
207
220
|
}
|
|
@@ -217,36 +230,7 @@ function SpaceCard({ endpoint, selected = false, compat, action, className, deps
|
|
|
217
230
|
...rest,
|
|
218
231
|
children: [
|
|
219
232
|
/* @__PURE__ */ jsxRuntime.jsxs(material.Box, { display: "flex", alignItems: "center", children: [
|
|
220
|
-
/* @__PURE__ */ jsxRuntime.
|
|
221
|
-
isLegacySpace && /* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx: { position: "absolute", top: 0, right: 0, zIndex: 2, transform: "translate(40%, -50%)" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
222
|
-
material.Tooltip,
|
|
223
|
-
{
|
|
224
|
-
title: /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { whiteSpace: "pre-wrap" }, children: [
|
|
225
|
-
t("storage.spaces.helperText.outdatedSpace"),
|
|
226
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
227
|
-
material.Link,
|
|
228
|
-
{
|
|
229
|
-
href: ufo.joinURL(spaceOrigin, ".well-known/service/admin/components"),
|
|
230
|
-
target: "_blank",
|
|
231
|
-
sx: { pl: 0.5 },
|
|
232
|
-
children: t("storage.spaces.helperText.upgradeSpace")
|
|
233
|
-
}
|
|
234
|
-
)
|
|
235
|
-
] }),
|
|
236
|
-
placement: "top",
|
|
237
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
238
|
-
material.Chip,
|
|
239
|
-
{
|
|
240
|
-
label: t("common.upgrade"),
|
|
241
|
-
color: "error",
|
|
242
|
-
size: "small",
|
|
243
|
-
sx: { transform: "scale(0.8)", cursor: "pointer" }
|
|
244
|
-
}
|
|
245
|
-
)
|
|
246
|
-
}
|
|
247
|
-
) }),
|
|
248
|
-
/* @__PURE__ */ jsxRuntime.jsx(index$1.PreviewSpaceNft, { src: util.getSpaceNftDisplayUrlFromEndpoint(endpoint), width: "72px", height: "72px" })
|
|
249
|
-
] }),
|
|
233
|
+
/* @__PURE__ */ jsxRuntime.jsx(index$1.PreviewSpaceNft, { src: util.getSpaceNftDisplayUrlFromEndpoint(endpoint), width: "72px", height: "72px" }),
|
|
250
234
|
/* @__PURE__ */ jsxRuntime.jsxs(material.Stack, { ml: 2, flex: 1, spacing: 1, minWidth: 0, children: [
|
|
251
235
|
/* @__PURE__ */ jsxRuntime.jsxs(material.Box, { display: "flex", alignItems: "center", sx: { whiteSpace: "nowrap" }, children: [
|
|
252
236
|
spaceName && /* @__PURE__ */ jsxRuntime.jsx(material.Box, { className: "space-name", children: spaceName }),
|
|
@@ -40,7 +40,7 @@ function useSpaceInfo({ endpoint, deps = [] }) {
|
|
|
40
40
|
headers["x-error-code"]
|
|
41
41
|
];
|
|
42
42
|
const name = rawName ? decodeURIComponent(rawName) : "";
|
|
43
|
-
if (rawAvailable === void 0) {
|
|
43
|
+
if (rawAvailable === void 0 || rawErrorCode === void 0) {
|
|
44
44
|
const isAvailable = isListable && isReadable && isWriteable;
|
|
45
45
|
return {
|
|
46
46
|
version: rawVersion || "",
|
|
@@ -14,7 +14,9 @@ const SPACE_CONNECT_ERROR_CODE = {
|
|
|
14
14
|
/** 用量不足 */
|
|
15
15
|
UNIT_LIMIT: 1006,
|
|
16
16
|
/** 跨域限制 */
|
|
17
|
-
CORS_BLOCKED: 1007
|
|
17
|
+
CORS_BLOCKED: 1007,
|
|
18
|
+
/** Space 版本不兼容 */
|
|
19
|
+
INCOMPATIBLE: 1008
|
|
18
20
|
};
|
|
19
21
|
const AUTHORIZE = {
|
|
20
22
|
DEFAULT_SCOPE: "list:object read:object write:object"
|
package/dist/cjs/locales/en.js
CHANGED
|
@@ -41,7 +41,8 @@ const en = flat.flatten({
|
|
|
41
41
|
invalid: "DID Spaces subscription anomaly, click this link to check",
|
|
42
42
|
unitLimit: "DID Spaces free quota has been used up, click this link to pay for the upgrade",
|
|
43
43
|
corsBlocked: "The connection request may fail due to CORS restrictions:\n1. Please contact the DID Space administrator to verify the relevant configuration.\n2. If you are the administrator, click the link below to view the detailed setup guide and resolve the issue.",
|
|
44
|
-
networkError: "Network error"
|
|
44
|
+
networkError: "Network error",
|
|
45
|
+
incompatible: "The current DID Spaces version is incompatible. Please contact your administrator to make adjustments. \nIf you are the administrator, click the link below to proceed."
|
|
45
46
|
},
|
|
46
47
|
gateway: {
|
|
47
48
|
add: {
|
|
@@ -56,9 +57,7 @@ const en = flat.flatten({
|
|
|
56
57
|
success: "Connected successfully"
|
|
57
58
|
},
|
|
58
59
|
helperText: {
|
|
59
|
-
fixCorsError: "Fixing CORS Errors When Connecting to Space"
|
|
60
|
-
outdatedSpace: "The current version of DID Spaces is too low, please contact your administrator to upgrade for the best experience! \n If you are an administrator, you can upgrade by clicking the following link",
|
|
61
|
-
upgradeSpace: "Upgrade DID Spaces"
|
|
60
|
+
fixCorsError: "Fixing CORS Errors When Connecting to Space"
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
63
|
}
|
package/dist/cjs/locales/zh.js
CHANGED
|
@@ -41,7 +41,8 @@ const zh = flat.flatten({
|
|
|
41
41
|
invalid: "DID Spaces \u8BA2\u9605\u5F02\u5E38\uFF0C\u70B9\u51FB\u6B64\u94FE\u63A5\u68C0\u67E5",
|
|
42
42
|
unitLimit: "DID Spaces \u514D\u8D39\u989D\u5EA6\u5DF2\u7528\u5B8C\uFF0C\u70B9\u51FB\u6B64\u94FE\u63A5\u4ED8\u8D39\u5347\u7EA7",
|
|
43
43
|
corsBlocked: "\u8FDE\u63A5\u8BF7\u6C42\u53EF\u80FD\u56E0 CORS \u9650\u5236\u800C\u5931\u8D25\uFF1A\n1. \u8BF7\u8054\u7CFB DID Space \u7BA1\u7406\u5458\u786E\u8BA4\u76F8\u5173\u914D\u7F6E\u662F\u5426\u6B63\u786E\u3002\n2. \u5982\u679C\u60A8\u662F\u7BA1\u7406\u5458\uFF0C\u53EF\u4EE5\u70B9\u51FB\u4E0B\u65B9\u94FE\u63A5\uFF0C\u67E5\u770B\u8BE6\u7EC6\u7684\u914D\u7F6E\u6307\u5357\u5E76\u89E3\u51B3\u95EE\u9898\u3002",
|
|
44
|
-
networkError: "\u7F51\u7EDC\u9519\u8BEF"
|
|
44
|
+
networkError: "\u7F51\u7EDC\u9519\u8BEF",
|
|
45
|
+
incompatible: "\u5F53\u524D DID Spaces \u7248\u672C\u4E0D\u517C\u5BB9\u3002\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u8FDB\u884C\u8C03\u6574\u3002\n\u5982\u679C\u60A8\u662F\u7BA1\u7406\u5458\uFF0C\u53EF\u4EE5\u5355\u51FB\u4E0B\u9762\u7684\u94FE\u63A5\u8FDB\u884C\u64CD\u4F5C\u3002"
|
|
45
46
|
},
|
|
46
47
|
gateway: {
|
|
47
48
|
add: {
|
|
@@ -56,9 +57,7 @@ const zh = flat.flatten({
|
|
|
56
57
|
success: "\u8FDE\u63A5\u6210\u529F"
|
|
57
58
|
},
|
|
58
59
|
helperText: {
|
|
59
|
-
fixCorsError: "\u4FEE\u590D\u8FDE\u63A5 DID Spaces \u65F6\u7684 CORS \u9519\u8BEF"
|
|
60
|
-
outdatedSpace: "\u5F53\u524D DID Spaces \u7248\u672C\u8FC7\u4F4E\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u5347\u7EA7\u4EE5\u83B7\u5F97\u6700\u4F73\u4F53\u9A8C\uFF01\n\u5982\u679C\u60A8\u662F\u7BA1\u7406\u5458\uFF0C\u53EF\u70B9\u51FB\u4EE5\u4E0B\u94FE\u63A5\u5347\u7EA7",
|
|
61
|
-
upgradeSpace: "\u5347\u7EA7 DID Spaces"
|
|
60
|
+
fixCorsError: "\u4FEE\u590D\u8FDE\u63A5 DID Spaces \u65F6\u7684 CORS \u9519\u8BEF"
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
63
|
}
|
package/dist/cjs/package.json.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import isUndefined from 'lodash/isUndefined';
|
|
3
|
-
import {
|
|
4
|
-
import { Box, Tooltip, Link,
|
|
3
|
+
import { withQuery, joinURL } from 'ufo';
|
|
4
|
+
import { Box, Stack, Tooltip, Link, Skeleton } from '@mui/material';
|
|
5
5
|
import OpenInNewIcon from '@mui/icons-material/OpenInNew';
|
|
6
6
|
import DidAddress from '@arcblock/ux/lib/DID';
|
|
7
7
|
import { styled } from '@arcblock/ux/lib/Theme';
|
|
8
8
|
import { useState, useRef, useEffect } from 'react';
|
|
9
9
|
import { AxiosError } from 'axios';
|
|
10
10
|
import { useCreation } from 'ahooks';
|
|
11
|
-
import {
|
|
11
|
+
import { satisfies } from 'compare-versions';
|
|
12
12
|
import { version } from '../../package.json.js';
|
|
13
13
|
import { SPACE_CONNECT_ERROR_CODE, fixCorsErrorPageUrl } from '../../libs/constants.js';
|
|
14
14
|
import useMobile from '../../hooks/use-mobile.js';
|
|
@@ -22,6 +22,7 @@ import SvgSpaceConnected from '../../icons/space-connected.svg.js';
|
|
|
22
22
|
import SvgSpaceDisconnect from '../../icons/space-disconnect.svg.js';
|
|
23
23
|
import SvgSpaceConnectError from '../../icons/space-connect-error.svg.js';
|
|
24
24
|
|
|
25
|
+
const expectVersion = `^${version}`;
|
|
25
26
|
function Status({
|
|
26
27
|
spaceUrl,
|
|
27
28
|
status,
|
|
@@ -84,6 +85,17 @@ function Status({
|
|
|
84
85
|
[SPACE_CONNECT_ERROR_CODE.CORS_BLOCKED]: {
|
|
85
86
|
icon: /* @__PURE__ */ jsx(SvgSpaceConnectError, { style: iconStyle }),
|
|
86
87
|
text: /* @__PURE__ */ jsx(ErrorLink, { title: t("storage.spaces.error.corsBlocked"), url: withQuery(fixCorsErrorPageUrl, { locale }) })
|
|
88
|
+
},
|
|
89
|
+
// Space 版本不兼容
|
|
90
|
+
[SPACE_CONNECT_ERROR_CODE.INCOMPATIBLE]: {
|
|
91
|
+
icon: /* @__PURE__ */ jsx(SvgSpaceConnectError, { style: iconStyle }),
|
|
92
|
+
text: /* @__PURE__ */ jsx(
|
|
93
|
+
ErrorLink,
|
|
94
|
+
{
|
|
95
|
+
title: t("storage.spaces.error.incompatible"),
|
|
96
|
+
url: joinURL(new URL(spaceUrl).origin, ".well-known/service/admin/components")
|
|
97
|
+
}
|
|
98
|
+
)
|
|
87
99
|
}
|
|
88
100
|
}),
|
|
89
101
|
[locale]
|
|
@@ -142,7 +154,6 @@ function SpaceCard({ endpoint, selected = false, compat, action, className, deps
|
|
|
142
154
|
}
|
|
143
155
|
const spaceDid = getSpaceDidFromEndpoint(endpoint);
|
|
144
156
|
const spaceUrl = getSpaceUrlFromEndpoint(endpoint);
|
|
145
|
-
const spaceOrigin = new URL(endpoint).origin;
|
|
146
157
|
const gatewayUrl = getSpaceGatewayUrlFromEndpoint(endpoint);
|
|
147
158
|
const [refreshSpaceInfo, setRefreshSpaceInfo] = useState(false);
|
|
148
159
|
const refresh = () => setRefreshSpaceInfo((p) => !p);
|
|
@@ -163,7 +174,12 @@ function SpaceCard({ endpoint, selected = false, compat, action, className, deps
|
|
|
163
174
|
spaceName = /* @__PURE__ */ jsx(Skeleton, { variant: "text", sx: { width: "180px", fontSize: "1rem" } });
|
|
164
175
|
} else if (spaceInfo) {
|
|
165
176
|
spaceName = spaceInfo.name;
|
|
166
|
-
|
|
177
|
+
const spaceVersion = spaceInfo.version;
|
|
178
|
+
const isIncompatible = !spaceVersion || !satisfies(spaceVersion, expectVersion);
|
|
179
|
+
if (isIncompatible) {
|
|
180
|
+
spaceStatus.current = SpaceStatus.UNAVAILABLE;
|
|
181
|
+
errorCode = SPACE_CONNECT_ERROR_CODE.INCOMPATIBLE;
|
|
182
|
+
} else if (!isAvailable) {
|
|
167
183
|
spaceStatus.current = SpaceStatus.UNAVAILABLE;
|
|
168
184
|
errorCode = spaceInfo.errorCode;
|
|
169
185
|
if (errorCode === SPACE_CONNECT_ERROR_CODE.UNAUTHORIZED) {
|
|
@@ -181,8 +197,6 @@ function SpaceCard({ endpoint, selected = false, compat, action, className, deps
|
|
|
181
197
|
errorCode = SPACE_CONNECT_ERROR_CODE.NETWORK_ERROR;
|
|
182
198
|
}
|
|
183
199
|
}
|
|
184
|
-
const spaceVersion = spaceInfo?.version;
|
|
185
|
-
const isLegacySpace = !!spaceInfo && (!spaceVersion || compareVersions(spaceVersion, version) < 0);
|
|
186
200
|
const renderAction = () => {
|
|
187
201
|
if (loading)
|
|
188
202
|
return null;
|
|
@@ -199,7 +213,6 @@ function SpaceCard({ endpoint, selected = false, compat, action, className, deps
|
|
|
199
213
|
errorCode,
|
|
200
214
|
selected,
|
|
201
215
|
compat: isCompact,
|
|
202
|
-
isLegacySpace,
|
|
203
216
|
refresh
|
|
204
217
|
});
|
|
205
218
|
}
|
|
@@ -215,36 +228,7 @@ function SpaceCard({ endpoint, selected = false, compat, action, className, deps
|
|
|
215
228
|
...rest,
|
|
216
229
|
children: [
|
|
217
230
|
/* @__PURE__ */ jsxs(Box, { display: "flex", alignItems: "center", children: [
|
|
218
|
-
/* @__PURE__ */
|
|
219
|
-
isLegacySpace && /* @__PURE__ */ jsx(Box, { sx: { position: "absolute", top: 0, right: 0, zIndex: 2, transform: "translate(40%, -50%)" }, children: /* @__PURE__ */ jsx(
|
|
220
|
-
Tooltip,
|
|
221
|
-
{
|
|
222
|
-
title: /* @__PURE__ */ jsxs("span", { style: { whiteSpace: "pre-wrap" }, children: [
|
|
223
|
-
t("storage.spaces.helperText.outdatedSpace"),
|
|
224
|
-
/* @__PURE__ */ jsx(
|
|
225
|
-
Link,
|
|
226
|
-
{
|
|
227
|
-
href: joinURL(spaceOrigin, ".well-known/service/admin/components"),
|
|
228
|
-
target: "_blank",
|
|
229
|
-
sx: { pl: 0.5 },
|
|
230
|
-
children: t("storage.spaces.helperText.upgradeSpace")
|
|
231
|
-
}
|
|
232
|
-
)
|
|
233
|
-
] }),
|
|
234
|
-
placement: "top",
|
|
235
|
-
children: /* @__PURE__ */ jsx(
|
|
236
|
-
Chip,
|
|
237
|
-
{
|
|
238
|
-
label: t("common.upgrade"),
|
|
239
|
-
color: "error",
|
|
240
|
-
size: "small",
|
|
241
|
-
sx: { transform: "scale(0.8)", cursor: "pointer" }
|
|
242
|
-
}
|
|
243
|
-
)
|
|
244
|
-
}
|
|
245
|
-
) }),
|
|
246
|
-
/* @__PURE__ */ jsx(PreviewSpaceNft, { src: getSpaceNftDisplayUrlFromEndpoint(endpoint), width: "72px", height: "72px" })
|
|
247
|
-
] }),
|
|
231
|
+
/* @__PURE__ */ jsx(PreviewSpaceNft, { src: getSpaceNftDisplayUrlFromEndpoint(endpoint), width: "72px", height: "72px" }),
|
|
248
232
|
/* @__PURE__ */ jsxs(Stack, { ml: 2, flex: 1, spacing: 1, minWidth: 0, children: [
|
|
249
233
|
/* @__PURE__ */ jsxs(Box, { display: "flex", alignItems: "center", sx: { whiteSpace: "nowrap" }, children: [
|
|
250
234
|
spaceName && /* @__PURE__ */ jsx(Box, { className: "space-name", children: spaceName }),
|
|
@@ -38,7 +38,7 @@ function useSpaceInfo({ endpoint, deps = [] }) {
|
|
|
38
38
|
headers["x-error-code"]
|
|
39
39
|
];
|
|
40
40
|
const name = rawName ? decodeURIComponent(rawName) : "";
|
|
41
|
-
if (rawAvailable === void 0) {
|
|
41
|
+
if (rawAvailable === void 0 || rawErrorCode === void 0) {
|
|
42
42
|
const isAvailable = isListable && isReadable && isWriteable;
|
|
43
43
|
return {
|
|
44
44
|
version: rawVersion || "",
|
|
@@ -12,7 +12,9 @@ const SPACE_CONNECT_ERROR_CODE = {
|
|
|
12
12
|
/** 用量不足 */
|
|
13
13
|
UNIT_LIMIT: 1006,
|
|
14
14
|
/** 跨域限制 */
|
|
15
|
-
CORS_BLOCKED: 1007
|
|
15
|
+
CORS_BLOCKED: 1007,
|
|
16
|
+
/** Space 版本不兼容 */
|
|
17
|
+
INCOMPATIBLE: 1008
|
|
16
18
|
};
|
|
17
19
|
const AUTHORIZE = {
|
|
18
20
|
DEFAULT_SCOPE: "list:object read:object write:object"
|
package/dist/es/locales/en.js
CHANGED
|
@@ -39,7 +39,8 @@ const en = flatten({
|
|
|
39
39
|
invalid: "DID Spaces subscription anomaly, click this link to check",
|
|
40
40
|
unitLimit: "DID Spaces free quota has been used up, click this link to pay for the upgrade",
|
|
41
41
|
corsBlocked: "The connection request may fail due to CORS restrictions:\n1. Please contact the DID Space administrator to verify the relevant configuration.\n2. If you are the administrator, click the link below to view the detailed setup guide and resolve the issue.",
|
|
42
|
-
networkError: "Network error"
|
|
42
|
+
networkError: "Network error",
|
|
43
|
+
incompatible: "The current DID Spaces version is incompatible. Please contact your administrator to make adjustments. \nIf you are the administrator, click the link below to proceed."
|
|
43
44
|
},
|
|
44
45
|
gateway: {
|
|
45
46
|
add: {
|
|
@@ -54,9 +55,7 @@ const en = flatten({
|
|
|
54
55
|
success: "Connected successfully"
|
|
55
56
|
},
|
|
56
57
|
helperText: {
|
|
57
|
-
fixCorsError: "Fixing CORS Errors When Connecting to Space"
|
|
58
|
-
outdatedSpace: "The current version of DID Spaces is too low, please contact your administrator to upgrade for the best experience! \n If you are an administrator, you can upgrade by clicking the following link",
|
|
59
|
-
upgradeSpace: "Upgrade DID Spaces"
|
|
58
|
+
fixCorsError: "Fixing CORS Errors When Connecting to Space"
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
61
|
}
|
package/dist/es/locales/zh.js
CHANGED
|
@@ -39,7 +39,8 @@ const zh = flatten({
|
|
|
39
39
|
invalid: "DID Spaces \u8BA2\u9605\u5F02\u5E38\uFF0C\u70B9\u51FB\u6B64\u94FE\u63A5\u68C0\u67E5",
|
|
40
40
|
unitLimit: "DID Spaces \u514D\u8D39\u989D\u5EA6\u5DF2\u7528\u5B8C\uFF0C\u70B9\u51FB\u6B64\u94FE\u63A5\u4ED8\u8D39\u5347\u7EA7",
|
|
41
41
|
corsBlocked: "\u8FDE\u63A5\u8BF7\u6C42\u53EF\u80FD\u56E0 CORS \u9650\u5236\u800C\u5931\u8D25\uFF1A\n1. \u8BF7\u8054\u7CFB DID Space \u7BA1\u7406\u5458\u786E\u8BA4\u76F8\u5173\u914D\u7F6E\u662F\u5426\u6B63\u786E\u3002\n2. \u5982\u679C\u60A8\u662F\u7BA1\u7406\u5458\uFF0C\u53EF\u4EE5\u70B9\u51FB\u4E0B\u65B9\u94FE\u63A5\uFF0C\u67E5\u770B\u8BE6\u7EC6\u7684\u914D\u7F6E\u6307\u5357\u5E76\u89E3\u51B3\u95EE\u9898\u3002",
|
|
42
|
-
networkError: "\u7F51\u7EDC\u9519\u8BEF"
|
|
42
|
+
networkError: "\u7F51\u7EDC\u9519\u8BEF",
|
|
43
|
+
incompatible: "\u5F53\u524D DID Spaces \u7248\u672C\u4E0D\u517C\u5BB9\u3002\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u8FDB\u884C\u8C03\u6574\u3002\n\u5982\u679C\u60A8\u662F\u7BA1\u7406\u5458\uFF0C\u53EF\u4EE5\u5355\u51FB\u4E0B\u9762\u7684\u94FE\u63A5\u8FDB\u884C\u64CD\u4F5C\u3002"
|
|
43
44
|
},
|
|
44
45
|
gateway: {
|
|
45
46
|
add: {
|
|
@@ -54,9 +55,7 @@ const zh = flatten({
|
|
|
54
55
|
success: "\u8FDE\u63A5\u6210\u529F"
|
|
55
56
|
},
|
|
56
57
|
helperText: {
|
|
57
|
-
fixCorsError: "\u4FEE\u590D\u8FDE\u63A5 DID Spaces \u65F6\u7684 CORS \u9519\u8BEF"
|
|
58
|
-
outdatedSpace: "\u5F53\u524D DID Spaces \u7248\u672C\u8FC7\u4F4E\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u5347\u7EA7\u4EE5\u83B7\u5F97\u6700\u4F73\u4F53\u9A8C\uFF01\n\u5982\u679C\u60A8\u662F\u7BA1\u7406\u5458\uFF0C\u53EF\u70B9\u51FB\u4EE5\u4E0B\u94FE\u63A5\u5347\u7EA7",
|
|
59
|
-
upgradeSpace: "\u5347\u7EA7 DID Spaces"
|
|
58
|
+
fixCorsError: "\u4FEE\u590D\u8FDE\u63A5 DID Spaces \u65F6\u7684 CORS \u9519\u8BEF"
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
61
|
}
|
package/dist/es/package.json.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/did-space-react",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.79",
|
|
4
4
|
"description": "Reusable react components for did space",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -84,17 +84,17 @@
|
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@arcblock/did": "^1.18.
|
|
88
|
-
"@arcblock/did-connect": "^2.10.
|
|
89
|
-
"@arcblock/ux": "^2.10.
|
|
90
|
-
"@blocklet/js-sdk": "^1.16.34-beta-
|
|
91
|
-
"@blocklet/sdk": "^1.16.34-beta-
|
|
92
|
-
"@mui/icons-material": "^5.16.
|
|
87
|
+
"@arcblock/did": "^1.18.160",
|
|
88
|
+
"@arcblock/did-connect": "^2.10.86",
|
|
89
|
+
"@arcblock/ux": "^2.10.86",
|
|
90
|
+
"@blocklet/js-sdk": "^1.16.34-beta-20241207-134904-3c3d9a35",
|
|
91
|
+
"@blocklet/sdk": "^1.16.34-beta-20241207-134904-3c3d9a35",
|
|
92
|
+
"@mui/icons-material": "^5.16.9",
|
|
93
93
|
"@mui/lab": "^5.0.0-alpha.174",
|
|
94
|
-
"@mui/material": "^5.16.
|
|
94
|
+
"@mui/material": "^5.16.9",
|
|
95
95
|
"@mui/system": "^5.16.8",
|
|
96
|
-
"ahooks": "^3.8.
|
|
97
|
-
"axios": "^1.7.
|
|
96
|
+
"ahooks": "^3.8.4",
|
|
97
|
+
"axios": "^1.7.9",
|
|
98
98
|
"compare-versions": "^6.1.1",
|
|
99
99
|
"flat": "^5.0.2",
|
|
100
100
|
"is-url": "^1.2.4",
|
|
@@ -111,10 +111,10 @@
|
|
|
111
111
|
},
|
|
112
112
|
"devDependencies": {
|
|
113
113
|
"@arcblock/eslint-config-ts": "^0.3.3",
|
|
114
|
-
"@babel/cli": "^7.
|
|
114
|
+
"@babel/cli": "^7.26.4",
|
|
115
115
|
"@babel/core": "^7.26.0",
|
|
116
116
|
"@babel/preset-env": "^7.26.0",
|
|
117
|
-
"@babel/preset-react": "^7.
|
|
117
|
+
"@babel/preset-react": "^7.26.3",
|
|
118
118
|
"@babel/preset-typescript": "^7.26.0",
|
|
119
119
|
"@storybook/addon-essentials": "^7.6.20",
|
|
120
120
|
"@storybook/addon-interactions": "^7.6.20",
|
|
@@ -125,8 +125,8 @@
|
|
|
125
125
|
"@storybook/react-vite": "^7.6.20",
|
|
126
126
|
"@storybook/test": "^7.6.20",
|
|
127
127
|
"@svgr/rollup": "^8.1.0",
|
|
128
|
-
"@types/react": "^18.3.
|
|
129
|
-
"@types/react-dom": "^18.3.
|
|
128
|
+
"@types/react": "^18.3.14",
|
|
129
|
+
"@types/react-dom": "^18.3.3",
|
|
130
130
|
"@vitejs/plugin-legacy": "^5.4.3",
|
|
131
131
|
"@vitest/coverage-v8": "^2.1.8",
|
|
132
132
|
"babel-plugin-inline-react-svg": "^2.0.2",
|
|
@@ -142,9 +142,9 @@
|
|
|
142
142
|
"typescript": "~5.5.4",
|
|
143
143
|
"unbuild": "^2.0.0",
|
|
144
144
|
"vite": "^5.4.11",
|
|
145
|
-
"vite-plugin-babel": "^1.
|
|
145
|
+
"vite-plugin-babel": "^1.3.0",
|
|
146
146
|
"vite-plugin-node-polyfills": "^0.22.0",
|
|
147
147
|
"vitest": "^2.1.8"
|
|
148
148
|
},
|
|
149
|
-
"gitHead": "
|
|
149
|
+
"gitHead": "5961ad5182992541aedf083537cf33abed98ba4f"
|
|
150
150
|
}
|