@blocklet/launcher-ux 2.3.52 → 2.3.53

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.
@@ -25,6 +25,7 @@ export default function CheckoutOnDemand({
25
25
  api,
26
26
  connectApi,
27
27
  checkoutPath,
28
+ checkoutSession,
28
29
  session,
29
30
  t,
30
31
  locale,
@@ -45,6 +46,7 @@ export default function CheckoutOnDemand({
45
46
  launchSessionId: launchSessionId,
46
47
  handlePaid: handlePaid,
47
48
  checkoutPath: checkoutPath,
49
+ checkoutSession: checkoutSession,
48
50
  components: components,
49
51
  blockletStoreURL: blockletStoreURL,
50
52
  t: t,
@@ -64,7 +66,8 @@ const propTypes = {
64
66
  t: PropTypes.func.isRequired,
65
67
  locale: PropTypes.string.isRequired,
66
68
  api: PropTypes.object.isRequired,
67
- checkoutPath: PropTypes.string.isRequired,
69
+ checkoutPath: PropTypes.string,
70
+ checkoutSession: PropTypes.object,
68
71
  freeTrialProducts: PropTypes.array,
69
72
  minStakeAmount: PropTypes.number.isRequired,
70
73
  isResume: PropTypes.bool
@@ -87,6 +90,7 @@ function Component({
87
90
  blockletStoreURL,
88
91
  api,
89
92
  checkoutPath,
93
+ checkoutSession,
90
94
  t,
91
95
  locale,
92
96
  freeTrialProducts,
@@ -125,6 +129,12 @@ function Component({
125
129
  });
126
130
  const quantity = components?.length || 1;
127
131
  const checkoutState = useAsync(async () => {
132
+ if (checkoutSession) {
133
+ return {
134
+ checkoutSessionId: checkoutSession.checkoutSessionId,
135
+ price: checkoutSession.price
136
+ };
137
+ }
128
138
  const {
129
139
  data
130
140
  } = await api.post(checkoutPath, {
@@ -38,6 +38,7 @@ function CheckoutOnDemand(_ref) {
38
38
  api,
39
39
  connectApi,
40
40
  checkoutPath,
41
+ checkoutSession,
41
42
  session,
42
43
  t,
43
44
  locale,
@@ -58,6 +59,7 @@ function CheckoutOnDemand(_ref) {
58
59
  launchSessionId: launchSessionId,
59
60
  handlePaid: handlePaid,
60
61
  checkoutPath: checkoutPath,
62
+ checkoutSession: checkoutSession,
61
63
  components: components,
62
64
  blockletStoreURL: blockletStoreURL,
63
65
  t: t,
@@ -77,7 +79,8 @@ const propTypes = {
77
79
  t: _propTypes.default.func.isRequired,
78
80
  locale: _propTypes.default.string.isRequired,
79
81
  api: _propTypes.default.object.isRequired,
80
- checkoutPath: _propTypes.default.string.isRequired,
82
+ checkoutPath: _propTypes.default.string,
83
+ checkoutSession: _propTypes.default.object,
81
84
  freeTrialProducts: _propTypes.default.array,
82
85
  minStakeAmount: _propTypes.default.number.isRequired,
83
86
  isResume: _propTypes.default.bool
@@ -100,6 +103,7 @@ function Component(_ref2) {
100
103
  blockletStoreURL,
101
104
  api,
102
105
  checkoutPath,
106
+ checkoutSession,
103
107
  t,
104
108
  locale,
105
109
  freeTrialProducts,
@@ -138,6 +142,12 @@ function Component(_ref2) {
138
142
  });
139
143
  const quantity = (components === null || components === void 0 ? void 0 : components.length) || 1;
140
144
  const checkoutState = (0, _useAsync.default)(async () => {
145
+ if (checkoutSession) {
146
+ return {
147
+ checkoutSessionId: checkoutSession.checkoutSessionId,
148
+ price: checkoutSession.price
149
+ };
150
+ }
141
151
  const {
142
152
  data
143
153
  } = await api.post(checkoutPath, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/launcher-ux",
3
- "version": "2.3.52",
3
+ "version": "2.3.53",
4
4
  "description": "Launcher UX lib",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -44,7 +44,7 @@
44
44
  "react": ">=18.1.0"
45
45
  },
46
46
  "devDependencies": {
47
- "@babel/cli": "^7.24.8",
47
+ "@babel/cli": "^7.25.6",
48
48
  "@babel/core": "^7.25.2",
49
49
  "@babel/preset-env": "^7.25.4",
50
50
  "@babel/preset-react": "^7.24.7",
@@ -53,9 +53,9 @@
53
53
  "glob": "^10.4.5"
54
54
  },
55
55
  "dependencies": {
56
- "@arcblock/ux": "^2.10.23",
57
- "@blocklet/launcher-util": "2.3.52",
58
- "@blocklet/payment-react": "^1.14.34",
56
+ "@arcblock/ux": "^2.10.30",
57
+ "@blocklet/launcher-util": "2.3.53",
58
+ "@blocklet/payment-react": "^1.15.4",
59
59
  "@emotion/styled": "^11.13.0",
60
60
  "@mui/icons-material": "^5.16.7",
61
61
  "@mui/material": "^5.16.7",
@@ -93,5 +93,5 @@
93
93
  "require": "./lib/use-mobile/index.js"
94
94
  }
95
95
  },
96
- "gitHead": "3b510686ef692c377b8e1e837e420b2fefcfca9d"
96
+ "gitHead": "c2b1e2bf7b578703b6ba953831a26a8f243f1354"
97
97
  }