@blocklet/did-space-react 0.5.73 → 0.5.74
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/base-connect-to/index.js +51 -36
- package/dist/cjs/components/space-card/index.js +2 -2
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/libs/constants.d.ts +1 -0
- package/dist/cjs/libs/constants.js +2 -0
- package/dist/cjs/locales/en.js +4 -1
- package/dist/cjs/locales/zh.js +1 -1
- package/dist/es/components/base-connect-to/index.js +52 -37
- package/dist/es/components/space-card/index.js +3 -3
- package/dist/es/index.js +1 -1
- package/dist/es/libs/constants.d.ts +1 -0
- package/dist/es/libs/constants.js +2 -1
- package/dist/es/locales/en.js +4 -1
- package/dist/es/locales/zh.js +1 -1
- package/package.json +3 -3
|
@@ -20,6 +20,7 @@ function BaseConnectTo({ style, onWalletClick, onGatewayConfirm, ...rest }) {
|
|
|
20
20
|
const [loading, setLoading] = React.useState(false);
|
|
21
21
|
const [open, setOpen] = React.useState(false);
|
|
22
22
|
const [errorMessage, setErrorMessage] = React.useState("");
|
|
23
|
+
const [corsBlocked, setCorsBlocked] = React.useState(false);
|
|
23
24
|
const onGatewayChange = async () => {
|
|
24
25
|
try {
|
|
25
26
|
setLoading(true);
|
|
@@ -34,6 +35,7 @@ function BaseConnectTo({ style, onWalletClick, onGatewayConfirm, ...rest }) {
|
|
|
34
35
|
setOpen(false);
|
|
35
36
|
} catch (err) {
|
|
36
37
|
if (err instanceof axios.AxiosError && util.isCorsBlockedError(err)) {
|
|
38
|
+
setCorsBlocked(true);
|
|
37
39
|
err.message = t("storage.spaces.error.corsBlocked");
|
|
38
40
|
}
|
|
39
41
|
console.error(err);
|
|
@@ -45,6 +47,7 @@ function BaseConnectTo({ style, onWalletClick, onGatewayConfirm, ...rest }) {
|
|
|
45
47
|
const onGatewayClick = () => {
|
|
46
48
|
setErrorMessage("");
|
|
47
49
|
setUrl("");
|
|
50
|
+
setCorsBlocked(false);
|
|
48
51
|
setOpen(true);
|
|
49
52
|
};
|
|
50
53
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -101,44 +104,56 @@ function BaseConnectTo({ style, onWalletClick, onGatewayConfirm, ...rest }) {
|
|
|
101
104
|
t("common.confirm")
|
|
102
105
|
] })
|
|
103
106
|
] }),
|
|
104
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { paddingTop: 12, overflowY: "hidden" }, children: /* @__PURE__ */ jsxRuntime.
|
|
105
|
-
material.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
},
|
|
125
|
-
autoFocus: true,
|
|
126
|
-
InputProps: {
|
|
127
|
-
endAdornment: /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: t("storage.spaces.connect.howToGetGatewayUrl"), placement: "top", children: /* @__PURE__ */ jsxRuntime.jsx(material.Link, { href: ufo.withQuery(constants.copyGatewayPageUrl, { locale }), target: "_blank", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
128
|
-
HelpOutlineIcon,
|
|
129
|
-
{
|
|
130
|
-
sx: {
|
|
131
|
-
ml: 0.5,
|
|
132
|
-
color: "text.secondary",
|
|
133
|
-
cursor: "pointer",
|
|
134
|
-
fontSize: "18px",
|
|
135
|
-
verticalAlign: "-2px"
|
|
136
|
-
}
|
|
107
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { paddingTop: 12, overflowY: "hidden" }, children: /* @__PURE__ */ jsxRuntime.jsxs(material.DialogContentText, { component: "div", children: [
|
|
108
|
+
/* @__PURE__ */ jsxRuntime.jsx(material.Typography, { component: "div", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
109
|
+
material.TextField,
|
|
110
|
+
{
|
|
111
|
+
label: t("storage.spaces.gateway.add.label"),
|
|
112
|
+
autoComplete: "off",
|
|
113
|
+
variant: "outlined",
|
|
114
|
+
name: "url",
|
|
115
|
+
fullWidth: true,
|
|
116
|
+
value: url,
|
|
117
|
+
onChange: (e) => {
|
|
118
|
+
setErrorMessage("");
|
|
119
|
+
setUrl(e.target.value);
|
|
120
|
+
},
|
|
121
|
+
disabled: loading,
|
|
122
|
+
error: Boolean(errorMessage),
|
|
123
|
+
helperText: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { whiteSpace: "pre-wrap" }, children: errorMessage }),
|
|
124
|
+
onKeyDown: async (e) => {
|
|
125
|
+
if (e.key === "Enter") {
|
|
126
|
+
await onGatewayChange();
|
|
137
127
|
}
|
|
138
|
-
|
|
128
|
+
},
|
|
129
|
+
autoFocus: true,
|
|
130
|
+
InputProps: {
|
|
131
|
+
endAdornment: /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: t("storage.spaces.connect.howToGetGatewayUrl"), placement: "top", children: /* @__PURE__ */ jsxRuntime.jsx(material.Link, { href: ufo.withQuery(constants.copyGatewayPageUrl, { locale }), target: "_blank", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
132
|
+
HelpOutlineIcon,
|
|
133
|
+
{
|
|
134
|
+
sx: {
|
|
135
|
+
ml: 0.5,
|
|
136
|
+
color: "text.secondary",
|
|
137
|
+
cursor: "pointer",
|
|
138
|
+
fontSize: "18px",
|
|
139
|
+
verticalAlign: "-2px"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
) }) })
|
|
143
|
+
}
|
|
139
144
|
}
|
|
140
|
-
}
|
|
141
|
-
|
|
145
|
+
) }),
|
|
146
|
+
errorMessage && corsBlocked && /* @__PURE__ */ jsxRuntime.jsx(
|
|
147
|
+
material.Link,
|
|
148
|
+
{
|
|
149
|
+
color: "error",
|
|
150
|
+
href: ufo.withQuery(constants.fixCorsErrorPageUrl, { locale }),
|
|
151
|
+
target: "_blank",
|
|
152
|
+
sx: { ml: "14px", fontSize: "14px" },
|
|
153
|
+
children: t("storage.spaces.helperText.fixCorsError")
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
] }) })
|
|
142
157
|
}
|
|
143
158
|
)
|
|
144
159
|
] });
|
|
@@ -83,7 +83,7 @@ function Status({
|
|
|
83
83
|
// CORS 拦截
|
|
84
84
|
[constants.SPACE_CONNECT_ERROR_CODE.CORS_BLOCKED]: {
|
|
85
85
|
icon: /* @__PURE__ */ jsxRuntime.jsx(spaceConnectError, { style: iconStyle }),
|
|
86
|
-
text: /* @__PURE__ */ jsxRuntime.jsx(
|
|
86
|
+
text: /* @__PURE__ */ jsxRuntime.jsx(ErrorLink, { title: t("storage.spaces.error.corsBlocked"), url: ufo.withQuery(constants.fixCorsErrorPageUrl, { locale }) })
|
|
87
87
|
}
|
|
88
88
|
}),
|
|
89
89
|
[locale]
|
|
@@ -118,7 +118,7 @@ function Status({
|
|
|
118
118
|
}
|
|
119
119
|
function ErrorLink({ title, url }) {
|
|
120
120
|
const { t } = useLocale();
|
|
121
|
-
return /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title, placement: "top", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
121
|
+
return /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { whiteSpace: "pre-wrap" }, children: title }), placement: "top", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
122
122
|
material.Link,
|
|
123
123
|
{
|
|
124
124
|
href: url,
|
package/dist/cjs/index.js
CHANGED
|
@@ -37,6 +37,7 @@ exports.SessionConnectTo = index$4.SessionConnectTo;
|
|
|
37
37
|
exports.AUTHORIZE = constants.AUTHORIZE;
|
|
38
38
|
exports.SPACE_CONNECT_ERROR_CODE = constants.SPACE_CONNECT_ERROR_CODE;
|
|
39
39
|
exports.copyGatewayPageUrl = constants.copyGatewayPageUrl;
|
|
40
|
+
exports.fixCorsErrorPageUrl = constants.fixCorsErrorPageUrl;
|
|
40
41
|
exports.classNames = util.classNames;
|
|
41
42
|
exports.decryptSpaceGateway = util.decryptSpaceGateway;
|
|
42
43
|
exports.extraDIDSpacesCoreUrl = util.extraDIDSpacesCoreUrl;
|
|
@@ -18,3 +18,4 @@ export declare const AUTHORIZE: {
|
|
|
18
18
|
DEFAULT_SCOPE: string;
|
|
19
19
|
};
|
|
20
20
|
export declare const copyGatewayPageUrl = "https://www.arcblock.io/content/docs/did-spaces/how-to-obtain-space-gateway-url";
|
|
21
|
+
export declare const fixCorsErrorPageUrl = "https://www.arcblock.io/docs/did-spaces/fixing-cors-errors-when-connecting-to-space";
|
|
@@ -20,7 +20,9 @@ const AUTHORIZE = {
|
|
|
20
20
|
DEFAULT_SCOPE: "list:object read:object write:object"
|
|
21
21
|
};
|
|
22
22
|
const copyGatewayPageUrl = "https://www.arcblock.io/content/docs/did-spaces/how-to-obtain-space-gateway-url";
|
|
23
|
+
const fixCorsErrorPageUrl = "https://www.arcblock.io/docs/did-spaces/fixing-cors-errors-when-connecting-to-space";
|
|
23
24
|
|
|
24
25
|
exports.AUTHORIZE = AUTHORIZE;
|
|
25
26
|
exports.SPACE_CONNECT_ERROR_CODE = SPACE_CONNECT_ERROR_CODE;
|
|
26
27
|
exports.copyGatewayPageUrl = copyGatewayPageUrl;
|
|
28
|
+
exports.fixCorsErrorPageUrl = fixCorsErrorPageUrl;
|
package/dist/cjs/locales/en.js
CHANGED
|
@@ -39,7 +39,7 @@ const en = flat.flatten({
|
|
|
39
39
|
pastDue: "DID Spaces has unpaid bills, click this link to complete payment",
|
|
40
40
|
invalid: "DID Spaces subscription anomaly, click this link to check",
|
|
41
41
|
unitLimit: "DID Spaces free quota has been used up, click this link to pay for the upgrade",
|
|
42
|
-
corsBlocked: "
|
|
42
|
+
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.",
|
|
43
43
|
networkError: "Network error"
|
|
44
44
|
},
|
|
45
45
|
gateway: {
|
|
@@ -53,6 +53,9 @@ const en = flat.flatten({
|
|
|
53
53
|
title: "Please show the DID Spaces NFT for {appName}",
|
|
54
54
|
scan: "Use your DID Wallet to scan the QR code below to allow the app {appName} show DID space NFT",
|
|
55
55
|
success: "Connected successfully"
|
|
56
|
+
},
|
|
57
|
+
helperText: {
|
|
58
|
+
fixCorsError: "Fixing CORS Errors When Connecting to Space"
|
|
56
59
|
}
|
|
57
60
|
}
|
|
58
61
|
}
|
package/dist/cjs/locales/zh.js
CHANGED
|
@@ -39,7 +39,7 @@ const zh = flat.flatten({
|
|
|
39
39
|
pastDue: "DID Spaces \u6709\u672A\u652F\u4ED8\u8D26\u5355\uFF0C\u70B9\u51FB\u6B64\u94FE\u63A5\u5B8C\u6210\u652F\u4ED8",
|
|
40
40
|
invalid: "DID Spaces \u8BA2\u9605\u5F02\u5E38\uFF0C\u70B9\u51FB\u6B64\u94FE\u63A5\u68C0\u67E5",
|
|
41
41
|
unitLimit: "DID Spaces \u514D\u8D39\u989D\u5EA6\u5DF2\u7528\u5B8C\uFF0C\u70B9\u51FB\u6B64\u94FE\u63A5\u4ED8\u8D39\u5347\u7EA7",
|
|
42
|
-
corsBlocked: "\u8FDE\u63A5\u8BF7\u6C42\u53EF\u80FD\
|
|
42
|
+
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",
|
|
43
43
|
networkError: "\u7F51\u7EDC\u9519\u8BEF"
|
|
44
44
|
},
|
|
45
45
|
gateway: {
|
|
@@ -7,7 +7,7 @@ import SplitButton from '@arcblock/ux/lib/SplitButton';
|
|
|
7
7
|
import Dialog from '@arcblock/ux/lib/Dialog';
|
|
8
8
|
import { withQuery } from 'ufo';
|
|
9
9
|
import { AxiosError } from 'axios';
|
|
10
|
-
import { copyGatewayPageUrl } from '../../libs/constants.js';
|
|
10
|
+
import { copyGatewayPageUrl, fixCorsErrorPageUrl } from '../../libs/constants.js';
|
|
11
11
|
import { extraDIDSpacesCoreUrl, getSpaceDidFromSpaceUrl, isCorsBlockedError } from '../../libs/util.js';
|
|
12
12
|
import { getSpaceGatewayUrl, verifySpaceUrl } from '../../libs/gateway.js';
|
|
13
13
|
import useLocale from '../../hooks/use-locale.js';
|
|
@@ -18,6 +18,7 @@ function BaseConnectTo({ style, onWalletClick, onGatewayConfirm, ...rest }) {
|
|
|
18
18
|
const [loading, setLoading] = useState(false);
|
|
19
19
|
const [open, setOpen] = useState(false);
|
|
20
20
|
const [errorMessage, setErrorMessage] = useState("");
|
|
21
|
+
const [corsBlocked, setCorsBlocked] = useState(false);
|
|
21
22
|
const onGatewayChange = async () => {
|
|
22
23
|
try {
|
|
23
24
|
setLoading(true);
|
|
@@ -32,6 +33,7 @@ function BaseConnectTo({ style, onWalletClick, onGatewayConfirm, ...rest }) {
|
|
|
32
33
|
setOpen(false);
|
|
33
34
|
} catch (err) {
|
|
34
35
|
if (err instanceof AxiosError && isCorsBlockedError(err)) {
|
|
36
|
+
setCorsBlocked(true);
|
|
35
37
|
err.message = t("storage.spaces.error.corsBlocked");
|
|
36
38
|
}
|
|
37
39
|
console.error(err);
|
|
@@ -43,6 +45,7 @@ function BaseConnectTo({ style, onWalletClick, onGatewayConfirm, ...rest }) {
|
|
|
43
45
|
const onGatewayClick = () => {
|
|
44
46
|
setErrorMessage("");
|
|
45
47
|
setUrl("");
|
|
48
|
+
setCorsBlocked(false);
|
|
46
49
|
setOpen(true);
|
|
47
50
|
};
|
|
48
51
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -99,44 +102,56 @@ function BaseConnectTo({ style, onWalletClick, onGatewayConfirm, ...rest }) {
|
|
|
99
102
|
t("common.confirm")
|
|
100
103
|
] })
|
|
101
104
|
] }),
|
|
102
|
-
children: /* @__PURE__ */ jsx("div", { style: { paddingTop: 12, overflowY: "hidden" }, children: /* @__PURE__ */
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
},
|
|
123
|
-
autoFocus: true,
|
|
124
|
-
InputProps: {
|
|
125
|
-
endAdornment: /* @__PURE__ */ jsx(Tooltip, { title: t("storage.spaces.connect.howToGetGatewayUrl"), placement: "top", children: /* @__PURE__ */ jsx(Link, { href: withQuery(copyGatewayPageUrl, { locale }), target: "_blank", children: /* @__PURE__ */ jsx(
|
|
126
|
-
HelpOutlineIcon,
|
|
127
|
-
{
|
|
128
|
-
sx: {
|
|
129
|
-
ml: 0.5,
|
|
130
|
-
color: "text.secondary",
|
|
131
|
-
cursor: "pointer",
|
|
132
|
-
fontSize: "18px",
|
|
133
|
-
verticalAlign: "-2px"
|
|
134
|
-
}
|
|
105
|
+
children: /* @__PURE__ */ jsx("div", { style: { paddingTop: 12, overflowY: "hidden" }, children: /* @__PURE__ */ jsxs(DialogContentText, { component: "div", children: [
|
|
106
|
+
/* @__PURE__ */ jsx(Typography, { component: "div", children: /* @__PURE__ */ jsx(
|
|
107
|
+
TextField,
|
|
108
|
+
{
|
|
109
|
+
label: t("storage.spaces.gateway.add.label"),
|
|
110
|
+
autoComplete: "off",
|
|
111
|
+
variant: "outlined",
|
|
112
|
+
name: "url",
|
|
113
|
+
fullWidth: true,
|
|
114
|
+
value: url,
|
|
115
|
+
onChange: (e) => {
|
|
116
|
+
setErrorMessage("");
|
|
117
|
+
setUrl(e.target.value);
|
|
118
|
+
},
|
|
119
|
+
disabled: loading,
|
|
120
|
+
error: Boolean(errorMessage),
|
|
121
|
+
helperText: /* @__PURE__ */ jsx("span", { style: { whiteSpace: "pre-wrap" }, children: errorMessage }),
|
|
122
|
+
onKeyDown: async (e) => {
|
|
123
|
+
if (e.key === "Enter") {
|
|
124
|
+
await onGatewayChange();
|
|
135
125
|
}
|
|
136
|
-
|
|
126
|
+
},
|
|
127
|
+
autoFocus: true,
|
|
128
|
+
InputProps: {
|
|
129
|
+
endAdornment: /* @__PURE__ */ jsx(Tooltip, { title: t("storage.spaces.connect.howToGetGatewayUrl"), placement: "top", children: /* @__PURE__ */ jsx(Link, { href: withQuery(copyGatewayPageUrl, { locale }), target: "_blank", children: /* @__PURE__ */ jsx(
|
|
130
|
+
HelpOutlineIcon,
|
|
131
|
+
{
|
|
132
|
+
sx: {
|
|
133
|
+
ml: 0.5,
|
|
134
|
+
color: "text.secondary",
|
|
135
|
+
cursor: "pointer",
|
|
136
|
+
fontSize: "18px",
|
|
137
|
+
verticalAlign: "-2px"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
) }) })
|
|
141
|
+
}
|
|
137
142
|
}
|
|
138
|
-
}
|
|
139
|
-
|
|
143
|
+
) }),
|
|
144
|
+
errorMessage && corsBlocked && /* @__PURE__ */ jsx(
|
|
145
|
+
Link,
|
|
146
|
+
{
|
|
147
|
+
color: "error",
|
|
148
|
+
href: withQuery(fixCorsErrorPageUrl, { locale }),
|
|
149
|
+
target: "_blank",
|
|
150
|
+
sx: { ml: "14px", fontSize: "14px" },
|
|
151
|
+
children: t("storage.spaces.helperText.fixCorsError")
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
] }) })
|
|
140
155
|
}
|
|
141
156
|
)
|
|
142
157
|
] });
|
|
@@ -8,7 +8,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 { SPACE_CONNECT_ERROR_CODE } from '../../libs/constants.js';
|
|
11
|
+
import { SPACE_CONNECT_ERROR_CODE, fixCorsErrorPageUrl } from '../../libs/constants.js';
|
|
12
12
|
import useMobile from '../../hooks/use-mobile.js';
|
|
13
13
|
import useSpaceInfo from '../../hooks/use-space-info.js';
|
|
14
14
|
import useLocale from '../../hooks/use-locale.js';
|
|
@@ -81,7 +81,7 @@ function Status({
|
|
|
81
81
|
// CORS 拦截
|
|
82
82
|
[SPACE_CONNECT_ERROR_CODE.CORS_BLOCKED]: {
|
|
83
83
|
icon: /* @__PURE__ */ jsx(SvgSpaceConnectError, { style: iconStyle }),
|
|
84
|
-
text: /* @__PURE__ */ jsx(
|
|
84
|
+
text: /* @__PURE__ */ jsx(ErrorLink, { title: t("storage.spaces.error.corsBlocked"), url: withQuery(fixCorsErrorPageUrl, { locale }) })
|
|
85
85
|
}
|
|
86
86
|
}),
|
|
87
87
|
[locale]
|
|
@@ -116,7 +116,7 @@ function Status({
|
|
|
116
116
|
}
|
|
117
117
|
function ErrorLink({ title, url }) {
|
|
118
118
|
const { t } = useLocale();
|
|
119
|
-
return /* @__PURE__ */ jsx(Tooltip, { title, placement: "top", children: /* @__PURE__ */ jsxs(
|
|
119
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: /* @__PURE__ */ jsx("span", { style: { whiteSpace: "pre-wrap" }, children: title }), placement: "top", children: /* @__PURE__ */ jsxs(
|
|
120
120
|
Link,
|
|
121
121
|
{
|
|
122
122
|
href: url,
|
package/dist/es/index.js
CHANGED
|
@@ -7,7 +7,7 @@ export { PreviewSpaceNft } from './components/preview-space-nft/index.js';
|
|
|
7
7
|
export { BaseConnectTo } from './components/base-connect-to/index.js';
|
|
8
8
|
export { AuthConnectTo } from './components/auth-connect-to/index.js';
|
|
9
9
|
export { SessionConnectTo } from './components/session-connect-to/index.js';
|
|
10
|
-
export { AUTHORIZE, SPACE_CONNECT_ERROR_CODE, copyGatewayPageUrl } from './libs/constants.js';
|
|
10
|
+
export { AUTHORIZE, SPACE_CONNECT_ERROR_CODE, copyGatewayPageUrl, fixCorsErrorPageUrl } from './libs/constants.js';
|
|
11
11
|
export { classNames, decryptSpaceGateway, extraDIDSpacesCoreUrl, getDIDSpaceDidFromEndpoint, getDIDSpaceUrlFromEndpoint, getSpaceDidFromEndpoint, getSpaceDidFromSpaceUrl, getSpaceGatewayUrlFromEndpoint, getSpaceNftDisplayUrlFromEndpoint, isCorsBlockedError, t } from './libs/util.js';
|
|
12
12
|
export { getSpaceGatewayUrl, verifySpaceUrl } from './libs/gateway.js';
|
|
13
13
|
export { translations } from './locales/index.js';
|
|
@@ -18,3 +18,4 @@ export declare const AUTHORIZE: {
|
|
|
18
18
|
DEFAULT_SCOPE: string;
|
|
19
19
|
};
|
|
20
20
|
export declare const copyGatewayPageUrl = "https://www.arcblock.io/content/docs/did-spaces/how-to-obtain-space-gateway-url";
|
|
21
|
+
export declare const fixCorsErrorPageUrl = "https://www.arcblock.io/docs/did-spaces/fixing-cors-errors-when-connecting-to-space";
|
|
@@ -18,5 +18,6 @@ const AUTHORIZE = {
|
|
|
18
18
|
DEFAULT_SCOPE: "list:object read:object write:object"
|
|
19
19
|
};
|
|
20
20
|
const copyGatewayPageUrl = "https://www.arcblock.io/content/docs/did-spaces/how-to-obtain-space-gateway-url";
|
|
21
|
+
const fixCorsErrorPageUrl = "https://www.arcblock.io/docs/did-spaces/fixing-cors-errors-when-connecting-to-space";
|
|
21
22
|
|
|
22
|
-
export { AUTHORIZE, SPACE_CONNECT_ERROR_CODE, copyGatewayPageUrl };
|
|
23
|
+
export { AUTHORIZE, SPACE_CONNECT_ERROR_CODE, copyGatewayPageUrl, fixCorsErrorPageUrl };
|
package/dist/es/locales/en.js
CHANGED
|
@@ -37,7 +37,7 @@ const en = flatten({
|
|
|
37
37
|
pastDue: "DID Spaces has unpaid bills, click this link to complete payment",
|
|
38
38
|
invalid: "DID Spaces subscription anomaly, click this link to check",
|
|
39
39
|
unitLimit: "DID Spaces free quota has been used up, click this link to pay for the upgrade",
|
|
40
|
-
corsBlocked: "
|
|
40
|
+
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.",
|
|
41
41
|
networkError: "Network error"
|
|
42
42
|
},
|
|
43
43
|
gateway: {
|
|
@@ -51,6 +51,9 @@ const en = flatten({
|
|
|
51
51
|
title: "Please show the DID Spaces NFT for {appName}",
|
|
52
52
|
scan: "Use your DID Wallet to scan the QR code below to allow the app {appName} show DID space NFT",
|
|
53
53
|
success: "Connected successfully"
|
|
54
|
+
},
|
|
55
|
+
helperText: {
|
|
56
|
+
fixCorsError: "Fixing CORS Errors When Connecting to Space"
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
59
|
}
|
package/dist/es/locales/zh.js
CHANGED
|
@@ -37,7 +37,7 @@ const zh = flatten({
|
|
|
37
37
|
pastDue: "DID Spaces \u6709\u672A\u652F\u4ED8\u8D26\u5355\uFF0C\u70B9\u51FB\u6B64\u94FE\u63A5\u5B8C\u6210\u652F\u4ED8",
|
|
38
38
|
invalid: "DID Spaces \u8BA2\u9605\u5F02\u5E38\uFF0C\u70B9\u51FB\u6B64\u94FE\u63A5\u68C0\u67E5",
|
|
39
39
|
unitLimit: "DID Spaces \u514D\u8D39\u989D\u5EA6\u5DF2\u7528\u5B8C\uFF0C\u70B9\u51FB\u6B64\u94FE\u63A5\u4ED8\u8D39\u5347\u7EA7",
|
|
40
|
-
corsBlocked: "\u8FDE\u63A5\u8BF7\u6C42\u53EF\u80FD\
|
|
40
|
+
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",
|
|
41
41
|
networkError: "\u7F51\u7EDC\u9519\u8BEF"
|
|
42
42
|
},
|
|
43
43
|
gateway: {
|
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.74",
|
|
4
4
|
"description": "Reusable react components for did space",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@arcblock/did": "^1.18.
|
|
87
|
+
"@arcblock/did": "^1.18.152",
|
|
88
88
|
"@arcblock/did-connect": "^2.10.74",
|
|
89
89
|
"@arcblock/ux": "^2.10.74",
|
|
90
90
|
"@blocklet/js-sdk": "^1.16.33",
|
|
@@ -145,5 +145,5 @@
|
|
|
145
145
|
"vite-plugin-node-polyfills": "^0.22.0",
|
|
146
146
|
"vitest": "^2.1.6"
|
|
147
147
|
},
|
|
148
|
-
"gitHead": "
|
|
148
|
+
"gitHead": "65431172d5fd6faec61194e635e05ed018a9ac6a"
|
|
149
149
|
}
|