@blocklet/launcher-workflow 2.0.7 → 2.0.8
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/lib/checkout.js +49 -11
- package/lib/locales/en.js +14 -17
- package/lib/locales/zh.js +24 -27
- package/package.json +5 -5
package/lib/checkout.js
CHANGED
|
@@ -5,29 +5,31 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _urlJoin = _interopRequireDefault(require("url-join"));
|
|
9
|
-
var _reactRouterDom = require("react-router-dom");
|
|
10
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
11
|
-
var _useAsync = _interopRequireDefault(require("react-use/lib/useAsync"));
|
|
12
8
|
var _Dialog = _interopRequireDefault(require("@arcblock/ux/lib/Dialog"));
|
|
13
|
-
var _button = _interopRequireDefault(require("@blocklet/launcher-ux/lib/button"));
|
|
14
9
|
var _constant = require("@blocklet/launcher-util/lib/constant");
|
|
10
|
+
var _button = _interopRequireDefault(require("@blocklet/launcher-ux/lib/button"));
|
|
15
11
|
var _useMobile = _interopRequireDefault(require("@blocklet/launcher-ux/lib/use-mobile"));
|
|
16
12
|
var _payment = _interopRequireDefault(require("@did-pay/react/lib/payment"));
|
|
13
|
+
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
17
14
|
var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
|
|
18
15
|
var _Skeleton = _interopRequireDefault(require("@mui/material/Skeleton"));
|
|
16
|
+
var _reactRouterDom = require("react-router-dom");
|
|
17
|
+
var _useAsync = _interopRequireDefault(require("react-use/lib/useAsync"));
|
|
18
|
+
var _useSetState = _interopRequireDefault(require("react-use/lib/useSetState"));
|
|
19
|
+
var _urlJoin = _interopRequireDefault(require("url-join"));
|
|
20
|
+
var _confirm = _interopRequireDefault(require("@arcblock/ux/lib/Dialog/confirm"));
|
|
21
|
+
var _agreement = _interopRequireDefault(require("./components/agreement"));
|
|
22
|
+
var _checkbox = _interopRequireDefault(require("./components/checkbox"));
|
|
19
23
|
var _layout = _interopRequireDefault(require("./components/layout"));
|
|
20
|
-
var _header = _interopRequireDefault(require("./components/layout/header"));
|
|
21
24
|
var _body = _interopRequireDefault(require("./components/layout/body"));
|
|
22
25
|
var _footer = _interopRequireDefault(require("./components/layout/footer"));
|
|
23
|
-
var
|
|
26
|
+
var _header = _interopRequireDefault(require("./components/layout/header"));
|
|
24
27
|
var _locale = require("./contexts/locale");
|
|
25
28
|
var _request = _interopRequireDefault(require("./contexts/request"));
|
|
26
|
-
var _query = _interopRequireDefault(require("./hooks/query"));
|
|
27
29
|
var _session = require("./contexts/session");
|
|
28
|
-
var _util = require("./util");
|
|
29
|
-
var _agreement = _interopRequireDefault(require("./components/agreement"));
|
|
30
30
|
var _workflow = require("./contexts/workflow");
|
|
31
|
+
var _query = _interopRequireDefault(require("./hooks/query"));
|
|
32
|
+
var _util = require("./util");
|
|
31
33
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
32
34
|
var _templateObject;
|
|
33
35
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -85,6 +87,10 @@ function CheckoutPage() {
|
|
|
85
87
|
const [showAgreement, setShowAgreement] = (0, _react.useState)(false);
|
|
86
88
|
const [showPayment, setShowPayment] = (0, _react.useState)(false);
|
|
87
89
|
const [agree, setAgree] = (0, _react.useState)(false);
|
|
90
|
+
const [showPaidDialog, setShowPaidDialog] = (0, _useSetState.default)({
|
|
91
|
+
open: false,
|
|
92
|
+
nftId: ''
|
|
93
|
+
});
|
|
88
94
|
const navigate = (0, _reactRouterDom.useNavigate)();
|
|
89
95
|
const {
|
|
90
96
|
create
|
|
@@ -98,7 +104,8 @@ function CheckoutPage() {
|
|
|
98
104
|
} = (0, _useMobile.default)();
|
|
99
105
|
const {
|
|
100
106
|
routerPrefix,
|
|
101
|
-
didPayPrefix
|
|
107
|
+
didPayPrefix,
|
|
108
|
+
embed
|
|
102
109
|
} = (0, _workflow.useWorkflowContext)();
|
|
103
110
|
const api = create({
|
|
104
111
|
baseURL: didPayPrefix
|
|
@@ -161,6 +168,14 @@ function CheckoutPage() {
|
|
|
161
168
|
} = _ref;
|
|
162
169
|
const nftState = await (0, _util.getAsset)(window.blocklet.CHAIN_HOST, nftId);
|
|
163
170
|
if ((nftState.tags || []).includes(_constant.NFT_TYPE_SERVERLESS)) {
|
|
171
|
+
if (!embed) {
|
|
172
|
+
setShowPaidDialog({
|
|
173
|
+
open: true,
|
|
174
|
+
nftId
|
|
175
|
+
});
|
|
176
|
+
setPaying(false);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
164
179
|
searchParams.set('launchType', 'serverless');
|
|
165
180
|
}
|
|
166
181
|
navigate({
|
|
@@ -319,6 +334,29 @@ function CheckoutPage() {
|
|
|
319
334
|
onComplete: handlePaid,
|
|
320
335
|
onFailed: handlePayFailed,
|
|
321
336
|
onCancel: handleCancelPay
|
|
337
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_confirm.default, {
|
|
338
|
+
open: showPaidDialog.open,
|
|
339
|
+
disableEscapeKeyDown: true,
|
|
340
|
+
title: t('purchase.serverlessDialog.title'),
|
|
341
|
+
confirmButton: {
|
|
342
|
+
text: t('purchase.serverlessDialog.redirectToStoreButton')
|
|
343
|
+
},
|
|
344
|
+
PaperProps: {
|
|
345
|
+
style: {
|
|
346
|
+
maxWidth: 1200,
|
|
347
|
+
minWidth: isMobile ? undefined : 600
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
onCancel: () => setShowPaidDialog(false),
|
|
351
|
+
showCancelButton: false,
|
|
352
|
+
onConfirm: () => {
|
|
353
|
+
const url = new URL(_util.BLOCKLET_STORE_URL);
|
|
354
|
+
url.searchParams.set('launcher_nft_id', showPaidDialog.nftId);
|
|
355
|
+
window.location = url.href;
|
|
356
|
+
},
|
|
357
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
358
|
+
children: t('purchase.serverlessDialog.purchaseServerlessSuccess')
|
|
359
|
+
})
|
|
322
360
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.default, {
|
|
323
361
|
open: showAgreement,
|
|
324
362
|
title: t('common.agreement'),
|
package/lib/locales/en.js
CHANGED
|
@@ -5,7 +5,7 @@ module.exports = {
|
|
|
5
5
|
agreeTo: 'Agree to the',
|
|
6
6
|
agreement: 'Agreement',
|
|
7
7
|
paymentMethod: 'Payment Method',
|
|
8
|
-
serverType: 'Blocklet
|
|
8
|
+
serverType: 'Blocklet Space Type',
|
|
9
9
|
paying: 'Paying',
|
|
10
10
|
name: 'Name',
|
|
11
11
|
description: 'Description',
|
|
@@ -30,12 +30,9 @@ module.exports = {
|
|
|
30
30
|
footer: 'Agree to the EULA and continue'
|
|
31
31
|
},
|
|
32
32
|
prepare: {
|
|
33
|
-
title: 'Naming Blocklet Server',
|
|
34
|
-
subTitle: 'Please enter server name and description, they will appear in your server passport',
|
|
35
33
|
serverless: {
|
|
36
|
-
title: 'Preparing Instance',
|
|
37
34
|
preparing: 'Preparing...',
|
|
38
|
-
prepared: '
|
|
35
|
+
prepared: 'The Blocklet Space is ready, redirecting...',
|
|
39
36
|
prepareFailed: 'Prepare for instance failure!'
|
|
40
37
|
}
|
|
41
38
|
},
|
|
@@ -43,12 +40,12 @@ module.exports = {
|
|
|
43
40
|
pageTitle: 'Prepare Space',
|
|
44
41
|
invalidFftId: 'Invalid Purchase NFT ID',
|
|
45
42
|
launchApp: 'Launch Application',
|
|
46
|
-
launching: 'Your Blocklet
|
|
47
|
-
launched: 'Your Blocklet
|
|
48
|
-
launchSuccess: 'Blocklet
|
|
49
|
-
loadStatusFailed: 'Failed to load Blocklet
|
|
50
|
-
waitingForLaunching: 'Your Blocklet
|
|
51
|
-
accessServer: 'Access Blocklet
|
|
43
|
+
launching: 'Your Blocklet Space is being baked, please be patient, it usually takes about 5 minutes',
|
|
44
|
+
launched: 'Your Blocklet Space is up and running',
|
|
45
|
+
launchSuccess: 'Blocklet Space is successfully launched',
|
|
46
|
+
loadStatusFailed: 'Failed to load Blocklet Space status',
|
|
47
|
+
waitingForLaunching: 'Your Blocklet Space launch request is being processed, please be patient, it usually takes about 5 minutes',
|
|
48
|
+
accessServer: 'Access Blocklet Space',
|
|
52
49
|
waiting: {
|
|
53
50
|
starting: 'Starting Server Instance',
|
|
54
51
|
securing: 'Securing Server Network',
|
|
@@ -57,7 +54,7 @@ module.exports = {
|
|
|
57
54
|
done: 'Server is Ready'
|
|
58
55
|
},
|
|
59
56
|
dialog: {
|
|
60
|
-
title: 'Launch Blocklet
|
|
57
|
+
title: 'Launch Blocklet Space',
|
|
61
58
|
scan: 'Scan following QRCode with your DID Wallet',
|
|
62
59
|
confirm: 'Confirm on your DID Wallet',
|
|
63
60
|
success: 'Launching'
|
|
@@ -65,7 +62,7 @@ module.exports = {
|
|
|
65
62
|
error: {
|
|
66
63
|
launchFailed: 'Launch Space Failed',
|
|
67
64
|
launchFailedDescription: 'You can retry by clicking the button below',
|
|
68
|
-
notFound: 'No Blocklet
|
|
65
|
+
notFound: 'No Blocklet Space being started',
|
|
69
66
|
notFoundDescription: 'You can launch the Space by clicking the button below'
|
|
70
67
|
}
|
|
71
68
|
},
|
|
@@ -78,7 +75,7 @@ module.exports = {
|
|
|
78
75
|
},
|
|
79
76
|
redeem: {
|
|
80
77
|
title: 'Redeem Space',
|
|
81
|
-
subTitle: 'Name the
|
|
78
|
+
subTitle: 'Name the Blocklet Space you are going to redeem, the name will exist on server passport',
|
|
82
79
|
dialog: {
|
|
83
80
|
title: 'Redeem Space',
|
|
84
81
|
scan: 'Scan the QR code below with your DID wallet to complete redeem',
|
|
@@ -88,8 +85,8 @@ module.exports = {
|
|
|
88
85
|
},
|
|
89
86
|
launchPrepare: {
|
|
90
87
|
formError: {
|
|
91
|
-
nameExceed: 'Blocklet
|
|
92
|
-
descriptionExceed: 'Blocklet
|
|
88
|
+
nameExceed: 'Blocklet Space name cannot exceed {length}',
|
|
89
|
+
descriptionExceed: 'Blocklet Space description cannot exceed {length}'
|
|
93
90
|
},
|
|
94
91
|
error: {
|
|
95
92
|
loginFirst: 'Please login first'
|
|
@@ -100,7 +97,7 @@ module.exports = {
|
|
|
100
97
|
selectSpaceHint: 'Already have dedicated space? Click here to select >',
|
|
101
98
|
morePlanPrompt: 'Flip the page to see more plans',
|
|
102
99
|
dialog: {
|
|
103
|
-
title: 'Purchase Blocklet
|
|
100
|
+
title: 'Purchase Blocklet Space NFT',
|
|
104
101
|
scan: 'Scan the QR code below with your DID wallet to complete purchase',
|
|
105
102
|
confirm: 'Confirm on your DID Wallet',
|
|
106
103
|
success: 'Purchase Success'
|
package/lib/locales/zh.js
CHANGED
|
@@ -5,7 +5,7 @@ module.exports = {
|
|
|
5
5
|
agreeTo: '同意',
|
|
6
6
|
agreement: '用户协议',
|
|
7
7
|
paymentMethod: '支付方式',
|
|
8
|
-
serverType: '
|
|
8
|
+
serverType: '空间信息',
|
|
9
9
|
paying: '支付中',
|
|
10
10
|
name: '名称',
|
|
11
11
|
description: '描述',
|
|
@@ -26,47 +26,44 @@ module.exports = {
|
|
|
26
26
|
space: '空间'
|
|
27
27
|
},
|
|
28
28
|
license: {
|
|
29
|
-
title: '
|
|
29
|
+
title: '空间用户协议',
|
|
30
30
|
footer: '同意协议并继续'
|
|
31
31
|
},
|
|
32
32
|
prepare: {
|
|
33
|
-
title: '命名节点',
|
|
34
|
-
subTitle: '请输入要创建的节点名称和描述,它们将显示在您的节点通行证中',
|
|
35
33
|
serverless: {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
prepareFailed: '准备实例失败!'
|
|
34
|
+
preparing: '准备中...',
|
|
35
|
+
prepared: '已准备好应用空间,跳转中...',
|
|
36
|
+
prepareFailed: '准备空间失败!'
|
|
40
37
|
}
|
|
41
38
|
},
|
|
42
39
|
launch: {
|
|
43
40
|
pageTitle: '准备空间',
|
|
44
41
|
invalidFftId: '无效的购买凭证',
|
|
45
42
|
launchApp: '启动应用',
|
|
46
|
-
launching: '
|
|
47
|
-
launched: '
|
|
48
|
-
launchSuccess: '
|
|
49
|
-
loadStatusFailed: '
|
|
50
|
-
waitingForLaunching: '
|
|
51
|
-
accessServer: '
|
|
43
|
+
launching: '空间正在启动中, 大约需要 5 分钟',
|
|
44
|
+
launched: '空间已启动',
|
|
45
|
+
launchSuccess: '创建空间成功',
|
|
46
|
+
loadStatusFailed: '加载空间状态失败',
|
|
47
|
+
waitingForLaunching: '空间正在启动中,大约需要 5 分钟',
|
|
48
|
+
accessServer: '访问空间',
|
|
52
49
|
waiting: {
|
|
53
|
-
starting: '
|
|
54
|
-
securing: '
|
|
55
|
-
prepare: '
|
|
56
|
-
waiting: '
|
|
57
|
-
done: '
|
|
50
|
+
starting: '启动空间',
|
|
51
|
+
securing: '确保空间的网络安全',
|
|
52
|
+
prepare: '准备好空间存储',
|
|
53
|
+
waiting: '等待空间就绪',
|
|
54
|
+
done: '空间已准备就绪'
|
|
58
55
|
},
|
|
59
56
|
dialog: {
|
|
60
|
-
title: '
|
|
57
|
+
title: '创建空间',
|
|
61
58
|
scan: '用您的 DID 钱包扫描下面的二维码',
|
|
62
59
|
confirm: '在您的 DID 钱包上确认',
|
|
63
60
|
success: '正在启动'
|
|
64
61
|
},
|
|
65
62
|
error: {
|
|
66
|
-
launchFailed: '
|
|
63
|
+
launchFailed: '空间空间失败',
|
|
67
64
|
launchFailedDescription: '您可以点击下面按钮重试',
|
|
68
65
|
notFound: '没有正在启动的空间',
|
|
69
|
-
notFoundDescription: '
|
|
66
|
+
notFoundDescription: '您可以点击下面按钮启动空间'
|
|
70
67
|
}
|
|
71
68
|
},
|
|
72
69
|
start: {
|
|
@@ -77,10 +74,10 @@ module.exports = {
|
|
|
77
74
|
}
|
|
78
75
|
},
|
|
79
76
|
redeem: {
|
|
80
|
-
title: '
|
|
81
|
-
subTitle: '
|
|
77
|
+
title: '启动空间',
|
|
78
|
+
subTitle: '为你的空间起个名字吧,空间名字将会打印在空间通行证上',
|
|
82
79
|
dialog: {
|
|
83
|
-
title: '
|
|
80
|
+
title: '兑换空间',
|
|
84
81
|
scan: '用您的 DID 钱包扫描下面的二维码,提供 NFT',
|
|
85
82
|
confirm: '在您的 DID 钱包上确认',
|
|
86
83
|
success: '兑换成功'
|
|
@@ -88,8 +85,8 @@ module.exports = {
|
|
|
88
85
|
},
|
|
89
86
|
launchPrepare: {
|
|
90
87
|
formError: {
|
|
91
|
-
nameExceed: '
|
|
92
|
-
descriptionExceed: '
|
|
88
|
+
nameExceed: '空间名称不能超过 {length}',
|
|
89
|
+
descriptionExceed: '空间描述不能超过 {length}'
|
|
93
90
|
},
|
|
94
91
|
error: {
|
|
95
92
|
loginFirst: '请先登录'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/launcher-workflow",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"description": "Purchase components for Launcher UI",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"@arcblock/icons": "^2.5.14",
|
|
41
41
|
"@arcblock/license": "^2.5.14",
|
|
42
42
|
"@arcblock/ux": "^2.5.14",
|
|
43
|
-
"@blocklet/launcher-layout": "2.0.
|
|
44
|
-
"@blocklet/launcher-util": "2.0.
|
|
45
|
-
"@blocklet/launcher-ux": "2.0.
|
|
43
|
+
"@blocklet/launcher-layout": "2.0.8",
|
|
44
|
+
"@blocklet/launcher-util": "2.0.8",
|
|
45
|
+
"@blocklet/launcher-ux": "2.0.8",
|
|
46
46
|
"@did-pay/react": "^1.9.44",
|
|
47
47
|
"@emotion/react": "^11.10.6",
|
|
48
48
|
"@emotion/styled": "^11.10.6",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"@babel/preset-react": "^7.18.6",
|
|
73
73
|
"babel-plugin-inline-react-svg": "^2.0.2"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "3c123612c60451a722befebdf2c58f04ed90f252"
|
|
76
76
|
}
|