@blocklet/launcher-workflow 2.3.107 → 2.3.109
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/prepare.js +4 -7
- package/lib/prepare.js +12 -15
- package/package.json +12 -12
package/es/prepare.js
CHANGED
|
@@ -14,7 +14,7 @@ import Stack from '@mui/material/Stack';
|
|
|
14
14
|
import ToggleButton from '@mui/material/ToggleButton';
|
|
15
15
|
import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
|
|
16
16
|
import PropTypes from 'prop-types';
|
|
17
|
-
import { useCallback, useEffect, useMemo
|
|
17
|
+
import { useCallback, useEffect, useMemo } from 'react';
|
|
18
18
|
import { Link, useNavigate, useSearchParams } from 'react-router-dom';
|
|
19
19
|
import useAsync from 'react-use/lib/useAsync';
|
|
20
20
|
import useSetState from 'react-use/lib/useSetState';
|
|
@@ -64,7 +64,6 @@ function Content({
|
|
|
64
64
|
isMobile
|
|
65
65
|
} = useMobile();
|
|
66
66
|
const navigate = useNavigate();
|
|
67
|
-
const launchLoaded = useRef(false);
|
|
68
67
|
const sessionId = params.get('sessionId');
|
|
69
68
|
const blockletMetaUrl = getBlockletMetaUrlFromQuery(params);
|
|
70
69
|
const defaultProductTypeName = params.get('product_type');
|
|
@@ -92,6 +91,7 @@ function Content({
|
|
|
92
91
|
metadata
|
|
93
92
|
};
|
|
94
93
|
}, [session.user, blockletMetaUrl]);
|
|
94
|
+
const launch = launchState.value?.launch || {};
|
|
95
95
|
const productTypes = useMemo(() => {
|
|
96
96
|
const result = [];
|
|
97
97
|
if (launchState.loading) {
|
|
@@ -164,8 +164,7 @@ function Content({
|
|
|
164
164
|
});
|
|
165
165
|
}
|
|
166
166
|
}, [launchState.value?.launch, params, setParams]);
|
|
167
|
-
if (!
|
|
168
|
-
launchLoaded.current = true;
|
|
167
|
+
if (!launch.id || blocklet.loading) {
|
|
169
168
|
return /*#__PURE__*/_jsx(Center, {
|
|
170
169
|
relative: "parent",
|
|
171
170
|
children: /*#__PURE__*/_jsx(CircularProgress, {})
|
|
@@ -194,8 +193,6 @@ function Content({
|
|
|
194
193
|
};
|
|
195
194
|
|
|
196
195
|
// TODO: PaymentKitV2 处理支付失败的情况
|
|
197
|
-
|
|
198
|
-
const launch = launchState.value?.launch || {};
|
|
199
196
|
if ([LAUNCH_STATUS.paid, LAUNCH_STATUS.nftMinted, LAUNCH_STATUS.allocated].includes(launch.status)) {
|
|
200
197
|
return /*#__PURE__*/_jsx(ConfirmDialog, {
|
|
201
198
|
title: t('purchase.unexpectedLaunchSession.paid'),
|
|
@@ -278,7 +275,7 @@ function Content({
|
|
|
278
275
|
}
|
|
279
276
|
},
|
|
280
277
|
children: [state.productType?.name === 'serverless' && /*#__PURE__*/_jsx(CheckoutOnDemand, {
|
|
281
|
-
launchSessionId: sessionId,
|
|
278
|
+
launchSessionId: sessionId || launch.id,
|
|
282
279
|
handlePaid: handlePaid,
|
|
283
280
|
components: (blocklet.components || []).map(x => {
|
|
284
281
|
const logoBaseUrl = x?.bundleSource?.store || blocklet.registryUrl;
|
package/lib/prepare.js
CHANGED
|
@@ -39,7 +39,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
39
39
|
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
40
40
|
const Root = (0, _styled.default)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: 100%;\n padding-top: 0;\n\n @media (max-width: 960px) {\n width: 100%;\n }\n"])));
|
|
41
41
|
function Content(_ref) {
|
|
42
|
-
var _launchState$
|
|
42
|
+
var _launchState$value, _launchState$value4, _launchState$value6, _state$productType, _state$productType2, _launchState$value7, _launchState$value8, _state$productType3, _window$blocklet3, _window$blocklet4, _window$blocklet5;
|
|
43
43
|
let {
|
|
44
44
|
blocklet
|
|
45
45
|
} = _ref;
|
|
@@ -67,7 +67,6 @@ function Content(_ref) {
|
|
|
67
67
|
isMobile
|
|
68
68
|
} = (0, _useMobile.default)();
|
|
69
69
|
const navigate = (0, _reactRouterDom.useNavigate)();
|
|
70
|
-
const launchLoaded = (0, _react.useRef)(false);
|
|
71
70
|
const sessionId = params.get('sessionId');
|
|
72
71
|
const blockletMetaUrl = (0, _util.getBlockletMetaUrlFromQuery)(params);
|
|
73
72
|
const defaultProductTypeName = params.get('product_type');
|
|
@@ -100,13 +99,14 @@ function Content(_ref) {
|
|
|
100
99
|
metadata
|
|
101
100
|
};
|
|
102
101
|
}, [session.user, blockletMetaUrl]);
|
|
102
|
+
const launch = ((_launchState$value = launchState.value) === null || _launchState$value === void 0 ? void 0 : _launchState$value.launch) || {};
|
|
103
103
|
const productTypes = (0, _react.useMemo)(() => {
|
|
104
|
-
var _launchState$
|
|
104
|
+
var _launchState$value2, _window$blocklet2;
|
|
105
105
|
const result = [];
|
|
106
106
|
if (launchState.loading) {
|
|
107
107
|
return result;
|
|
108
108
|
}
|
|
109
|
-
if (((_launchState$
|
|
109
|
+
if (((_launchState$value2 = launchState.value) === null || _launchState$value2 === void 0 || (_launchState$value2 = _launchState$value2.metadata) === null || _launchState$value2 === void 0 ? void 0 : _launchState$value2.isSupportOnDemand) === false) {
|
|
110
110
|
var _window$blocklet;
|
|
111
111
|
_Toast.default.info(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
112
112
|
component: "span",
|
|
@@ -157,15 +157,15 @@ function Content(_ref) {
|
|
|
157
157
|
}
|
|
158
158
|
}, [productTypes, defaultProductTypeName, params, setParams, setState]);
|
|
159
159
|
const getPurchaseNewLink = (0, _react.useCallback)(() => {
|
|
160
|
-
var _launchState$
|
|
161
|
-
window.location = launchState === null || launchState === void 0 || (_launchState$
|
|
160
|
+
var _launchState$value3;
|
|
161
|
+
window.location = launchState === null || launchState === void 0 || (_launchState$value3 = launchState.value) === null || _launchState$value3 === void 0 || (_launchState$value3 = _launchState$value3.launch) === null || _launchState$value3 === void 0 || (_launchState$value3 = _launchState$value3.app) === null || _launchState$value3 === void 0 ? void 0 : _launchState$value3.appUrl;
|
|
162
162
|
const urlObj = new URL(window.location.href);
|
|
163
163
|
urlObj.searchParams.delete('sessionId');
|
|
164
164
|
return urlObj.href;
|
|
165
|
-
}, [launchState === null || launchState === void 0 || (_launchState$
|
|
165
|
+
}, [launchState === null || launchState === void 0 || (_launchState$value4 = launchState.value) === null || _launchState$value4 === void 0 || (_launchState$value4 = _launchState$value4.launch) === null || _launchState$value4 === void 0 || (_launchState$value4 = _launchState$value4.app) === null || _launchState$value4 === void 0 ? void 0 : _launchState$value4.appUrl]);
|
|
166
166
|
(0, _react.useEffect)(() => {
|
|
167
|
-
var _launchState$
|
|
168
|
-
const tmpLaunch = (_launchState$
|
|
167
|
+
var _launchState$value5;
|
|
168
|
+
const tmpLaunch = (_launchState$value5 = launchState.value) === null || _launchState$value5 === void 0 ? void 0 : _launchState$value5.launch;
|
|
169
169
|
if (!tmpLaunch) {
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
@@ -175,9 +175,8 @@ function Content(_ref) {
|
|
|
175
175
|
replace: true
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
|
-
}, [(_launchState$
|
|
179
|
-
if (!
|
|
180
|
-
launchLoaded.current = true;
|
|
178
|
+
}, [(_launchState$value6 = launchState.value) === null || _launchState$value6 === void 0 ? void 0 : _launchState$value6.launch, params, setParams]);
|
|
179
|
+
if (!launch.id || blocklet.loading) {
|
|
181
180
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Center.default, {
|
|
182
181
|
relative: "parent",
|
|
183
182
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CircularProgress.default, {})
|
|
@@ -206,8 +205,6 @@ function Content(_ref) {
|
|
|
206
205
|
};
|
|
207
206
|
|
|
208
207
|
// TODO: PaymentKitV2 处理支付失败的情况
|
|
209
|
-
|
|
210
|
-
const launch = ((_launchState$value6 = launchState.value) === null || _launchState$value6 === void 0 ? void 0 : _launchState$value6.launch) || {};
|
|
211
208
|
if ([_constant.LAUNCH_STATUS.paid, _constant.LAUNCH_STATUS.nftMinted, _constant.LAUNCH_STATUS.allocated].includes(launch.status)) {
|
|
212
209
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_confirm.default, {
|
|
213
210
|
title: t('purchase.unexpectedLaunchSession.paid'),
|
|
@@ -292,7 +289,7 @@ function Content(_ref) {
|
|
|
292
289
|
}
|
|
293
290
|
},
|
|
294
291
|
children: [((_state$productType2 = state.productType) === null || _state$productType2 === void 0 ? void 0 : _state$productType2.name) === 'serverless' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_onDemand.default, {
|
|
295
|
-
launchSessionId: sessionId,
|
|
292
|
+
launchSessionId: sessionId || launch.id,
|
|
296
293
|
handlePaid: handlePaid,
|
|
297
294
|
components: (blocklet.components || []).map(x => {
|
|
298
295
|
var _x$bundleSource;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/launcher-workflow",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.109",
|
|
4
4
|
"description": "Purchase components for Launcher UI",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -41,22 +41,22 @@
|
|
|
41
41
|
"react": ">=18.1.0"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@arcblock/did-connect": "^2.12.
|
|
45
|
-
"@arcblock/icons": "^2.12.
|
|
46
|
-
"@arcblock/license": "^2.12.
|
|
47
|
-
"@arcblock/react-hooks": "^2.12.
|
|
48
|
-
"@arcblock/ux": "^2.12.
|
|
49
|
-
"@blocklet/launcher-layout": "^2.12.
|
|
50
|
-
"@blocklet/launcher-util": "2.3.
|
|
51
|
-
"@blocklet/launcher-ux": "2.3.
|
|
44
|
+
"@arcblock/did-connect": "^2.12.70",
|
|
45
|
+
"@arcblock/icons": "^2.12.70",
|
|
46
|
+
"@arcblock/license": "^2.12.70",
|
|
47
|
+
"@arcblock/react-hooks": "^2.12.70",
|
|
48
|
+
"@arcblock/ux": "^2.12.70",
|
|
49
|
+
"@blocklet/launcher-layout": "^2.12.70",
|
|
50
|
+
"@blocklet/launcher-util": "2.3.109",
|
|
51
|
+
"@blocklet/launcher-ux": "2.3.109",
|
|
52
52
|
"@blocklet/payment": "^1.14.8",
|
|
53
|
-
"@blocklet/payment-react": "^1.18.
|
|
53
|
+
"@blocklet/payment-react": "^1.18.27",
|
|
54
54
|
"@emotion/react": "^11.14.0",
|
|
55
55
|
"@emotion/styled": "^11.14.0",
|
|
56
56
|
"@mui/icons-material": "^5.17.1",
|
|
57
57
|
"@mui/lab": "^5.0.0-alpha.176",
|
|
58
58
|
"@mui/material": "^5.17.1",
|
|
59
|
-
"@ocap/util": "^1.19.
|
|
59
|
+
"@ocap/util": "^1.19.19",
|
|
60
60
|
"@splidejs/react-splide": "^0.7.12",
|
|
61
61
|
"@splidejs/splide": "^4.1.4",
|
|
62
62
|
"@splidejs/splide-extension-grid": "^0.4.1",
|
|
@@ -106,5 +106,5 @@
|
|
|
106
106
|
"require": "./lib/locales/index.js"
|
|
107
107
|
}
|
|
108
108
|
},
|
|
109
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "6c222bd195ae0b31bfe180056440cba81df4c237"
|
|
110
110
|
}
|