@blocklet/launcher-workflow 2.3.56 → 2.3.58
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/locales/en.js +2 -1
- package/es/locales/zh.js +2 -1
- package/es/prepare.js +22 -4
- package/lib/locales/en.js +2 -1
- package/lib/locales/zh.js +2 -1
- package/lib/prepare.js +28 -9
- package/package.json +4 -4
package/es/locales/en.js
CHANGED
package/es/locales/zh.js
CHANGED
package/es/prepare.js
CHANGED
|
@@ -6,6 +6,7 @@ import CheckoutOnDemand from '@blocklet/launcher-ux/lib/payment/checkout/on-dema
|
|
|
6
6
|
import { CheckoutTable, PaymentProvider } from '@blocklet/payment-react';
|
|
7
7
|
import styled from '@emotion/styled';
|
|
8
8
|
import Box from '@mui/material/Box';
|
|
9
|
+
import ExternalLink from '@mui/material/Link';
|
|
9
10
|
import CircularProgress from '@mui/material/CircularProgress';
|
|
10
11
|
import Stack from '@mui/material/Stack';
|
|
11
12
|
import ToggleButton from '@mui/material/ToggleButton';
|
|
@@ -24,7 +25,7 @@ import useRequest from './contexts/request';
|
|
|
24
25
|
import { useSessionContext } from './contexts/session';
|
|
25
26
|
import { useWorkflowContext } from './contexts/workflow';
|
|
26
27
|
import { launchSession } from './util';
|
|
27
|
-
import {
|
|
28
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
28
29
|
const Root = styled('div')`
|
|
29
30
|
width: 100%;
|
|
30
31
|
height: 100%;
|
|
@@ -90,9 +91,26 @@ function Content({
|
|
|
90
91
|
if (launchState.loading) {
|
|
91
92
|
return result;
|
|
92
93
|
}
|
|
93
|
-
if (launchState.value?.metadata?.
|
|
94
|
-
Toast.info(
|
|
95
|
-
|
|
94
|
+
if (launchState.value?.metadata?.isSupportOnDemand === false) {
|
|
95
|
+
Toast.info( /*#__PURE__*/_jsxs(Box, {
|
|
96
|
+
component: "span",
|
|
97
|
+
children: [t('purchase.onDemandNotSupport'), ",", /*#__PURE__*/_jsxs(ExternalLink, {
|
|
98
|
+
target: "_blank",
|
|
99
|
+
sx: {
|
|
100
|
+
ml: '4px',
|
|
101
|
+
textDecoration: 'underline !important',
|
|
102
|
+
color: 'text.contrastText',
|
|
103
|
+
fontStyle: 'italic'
|
|
104
|
+
},
|
|
105
|
+
href: window.blocklet?.preferences?.untrustedSourceDocURL,
|
|
106
|
+
children: [t('common.moreReference'), "."]
|
|
107
|
+
})]
|
|
108
|
+
}), {
|
|
109
|
+
persist: true,
|
|
110
|
+
anchorOrigin: {
|
|
111
|
+
horizontal: 'center',
|
|
112
|
+
vertical: 'bottom'
|
|
113
|
+
}
|
|
96
114
|
});
|
|
97
115
|
} else {
|
|
98
116
|
const name = 'serverless';
|
package/lib/locales/en.js
CHANGED
package/lib/locales/zh.js
CHANGED
package/lib/prepare.js
CHANGED
|
@@ -12,6 +12,7 @@ var _onDemand = _interopRequireDefault(require("@blocklet/launcher-ux/lib/paymen
|
|
|
12
12
|
var _paymentReact = require("@blocklet/payment-react");
|
|
13
13
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
14
14
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
15
|
+
var _Link = _interopRequireDefault(require("@mui/material/Link"));
|
|
15
16
|
var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
|
|
16
17
|
var _Stack = _interopRequireDefault(require("@mui/material/Stack"));
|
|
17
18
|
var _ToggleButton = _interopRequireDefault(require("@mui/material/ToggleButton"));
|
|
@@ -36,7 +37,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
36
37
|
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
37
38
|
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"])));
|
|
38
39
|
function Content(_ref) {
|
|
39
|
-
var _launchState$value3, _launchState$value5, _launchState$value6, _state$productType, _state$productType2, _launchState$value7, _launchState$value8, _state$productType3, _window$
|
|
40
|
+
var _launchState$value3, _launchState$value5, _launchState$value6, _state$productType, _state$productType2, _launchState$value7, _launchState$value8, _state$productType3, _window$blocklet3, _window$blocklet4, _window$blocklet5;
|
|
40
41
|
let {
|
|
41
42
|
blocklet
|
|
42
43
|
} = _ref;
|
|
@@ -94,14 +95,32 @@ function Content(_ref) {
|
|
|
94
95
|
};
|
|
95
96
|
}, [session.user, blockletMetaUrl]);
|
|
96
97
|
const productTypes = (0, _react.useMemo)(() => {
|
|
97
|
-
var _launchState$value, _window$
|
|
98
|
+
var _launchState$value, _window$blocklet2;
|
|
98
99
|
const result = [];
|
|
99
100
|
if (launchState.loading) {
|
|
100
101
|
return result;
|
|
101
102
|
}
|
|
102
|
-
if (((_launchState$value = launchState.value) === null || _launchState$value === void 0 || (_launchState$value = _launchState$value.metadata) === null || _launchState$value === void 0 ? void 0 : _launchState$value.
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
if (((_launchState$value = launchState.value) === null || _launchState$value === void 0 || (_launchState$value = _launchState$value.metadata) === null || _launchState$value === void 0 ? void 0 : _launchState$value.isSupportOnDemand) === false) {
|
|
104
|
+
var _window$blocklet;
|
|
105
|
+
_Toast.default.info( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
106
|
+
component: "span",
|
|
107
|
+
children: [t('purchase.onDemandNotSupport'), ",", /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Link.default, {
|
|
108
|
+
target: "_blank",
|
|
109
|
+
sx: {
|
|
110
|
+
ml: '4px',
|
|
111
|
+
textDecoration: 'underline !important',
|
|
112
|
+
color: 'text.contrastText',
|
|
113
|
+
fontStyle: 'italic'
|
|
114
|
+
},
|
|
115
|
+
href: (_window$blocklet = window.blocklet) === null || _window$blocklet === void 0 || (_window$blocklet = _window$blocklet.preferences) === null || _window$blocklet === void 0 ? void 0 : _window$blocklet.untrustedSourceDocURL,
|
|
116
|
+
children: [t('common.moreReference'), "."]
|
|
117
|
+
})]
|
|
118
|
+
}), {
|
|
119
|
+
persist: true,
|
|
120
|
+
anchorOrigin: {
|
|
121
|
+
horizontal: 'center',
|
|
122
|
+
vertical: 'bottom'
|
|
123
|
+
}
|
|
105
124
|
});
|
|
106
125
|
} else {
|
|
107
126
|
const name = 'serverless';
|
|
@@ -109,7 +128,7 @@ function Content(_ref) {
|
|
|
109
128
|
name
|
|
110
129
|
});
|
|
111
130
|
}
|
|
112
|
-
if ((_window$
|
|
131
|
+
if ((_window$blocklet2 = window.blocklet) !== null && _window$blocklet2 !== void 0 && (_window$blocklet2 = _window$blocklet2.preferences) !== null && _window$blocklet2 !== void 0 && _window$blocklet2.dedicatedPricingTableId) {
|
|
113
132
|
const name = 'dedicated';
|
|
114
133
|
result.push({
|
|
115
134
|
name
|
|
@@ -290,7 +309,7 @@ function Content(_ref) {
|
|
|
290
309
|
freeTrialProducts: ((_launchState$value7 = launchState.value) === null || _launchState$value7 === void 0 || (_launchState$value7 = _launchState$value7.metadata) === null || _launchState$value7 === void 0 ? void 0 : _launchState$value7.freeTrialProducts) || [],
|
|
291
310
|
checkoutPath: "/payment/checkout",
|
|
292
311
|
minStakeAmount: (_launchState$value8 = launchState.value) === null || _launchState$value8 === void 0 || (_launchState$value8 = _launchState$value8.metadata) === null || _launchState$value8 === void 0 ? void 0 : _launchState$value8.minStakeAmount
|
|
293
|
-
}), ((_state$productType3 = state.productType) === null || _state$productType3 === void 0 ? void 0 : _state$productType3.name) === 'dedicated' && ((_window$
|
|
312
|
+
}), ((_state$productType3 = state.productType) === null || _state$productType3 === void 0 ? void 0 : _state$productType3.name) === 'dedicated' && ((_window$blocklet3 = window.blocklet) === null || _window$blocklet3 === void 0 || (_window$blocklet3 = _window$blocklet3.preferences) === null || _window$blocklet3 === void 0 ? void 0 : _window$blocklet3.dedicatedPricingTableId) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
294
313
|
sx: {
|
|
295
314
|
display: 'flex',
|
|
296
315
|
width: '100%',
|
|
@@ -327,13 +346,13 @@ function Content(_ref) {
|
|
|
327
346
|
session: session,
|
|
328
347
|
connect: connectApi,
|
|
329
348
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_paymentReact.CheckoutTable, {
|
|
330
|
-
id: (_window$
|
|
349
|
+
id: (_window$blocklet4 = window.blocklet) === null || _window$blocklet4 === void 0 || (_window$blocklet4 = _window$blocklet4.preferences) === null || _window$blocklet4 === void 0 ? void 0 : _window$blocklet4.dedicatedPricingTableId,
|
|
331
350
|
mode: "inline",
|
|
332
351
|
extraParams: {
|
|
333
352
|
'metadata.session_id': launch._id,
|
|
334
353
|
'subscription_data.trial_end': (0, _util.getDefaultTrialEnd)(),
|
|
335
354
|
'subscription_data.days_until_due': 0,
|
|
336
|
-
'subscription_data.days_until_cancel': ((_window$
|
|
355
|
+
'subscription_data.days_until_cancel': ((_window$blocklet5 = window.blocklet) === null || _window$blocklet5 === void 0 || (_window$blocklet5 = _window$blocklet5.preferences) === null || _window$blocklet5 === void 0 ? void 0 : _window$blocklet5.daysUntilCancel) || 30
|
|
337
356
|
},
|
|
338
357
|
onPaid: handlePaid,
|
|
339
358
|
theme: "inherit"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/launcher-workflow",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.58",
|
|
4
4
|
"description": "Purchase components for Launcher UI",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"@arcblock/react-hooks": "^2.10.33",
|
|
48
48
|
"@arcblock/ux": "^2.10.33",
|
|
49
49
|
"@blocklet/launcher-layout": "^2.10.33",
|
|
50
|
-
"@blocklet/launcher-util": "2.3.
|
|
51
|
-
"@blocklet/launcher-ux": "2.3.
|
|
50
|
+
"@blocklet/launcher-util": "2.3.58",
|
|
51
|
+
"@blocklet/launcher-ux": "2.3.58",
|
|
52
52
|
"@blocklet/payment": "^1.14.8",
|
|
53
53
|
"@blocklet/payment-react": "^1.15.4",
|
|
54
54
|
"@emotion/react": "^11.13.3",
|
|
@@ -105,5 +105,5 @@
|
|
|
105
105
|
"require": "./lib/locales/index.js"
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "d51f08714321826bb61a4b643314c651afc965c6"
|
|
109
109
|
}
|