@blocklet/payment-react 1.18.8 → 1.18.10
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/checkout/donate.d.ts +1 -0
- package/es/checkout/donate.js +26 -15
- package/es/index.d.ts +2 -2
- package/es/index.js +3 -2
- package/lib/checkout/donate.d.ts +1 -0
- package/lib/checkout/donate.js +6 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.js +11 -2
- package/package.json +6 -6
- package/src/checkout/donate.tsx +8 -2
- package/src/index.ts +2 -1
package/es/checkout/donate.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export type DonateProps = Pick<CheckoutProps, 'onPaid' | 'onError'> & {
|
|
|
49
49
|
theme?: 'default' | 'inherit' | PaymentThemeOptions;
|
|
50
50
|
children?: (openDialog: () => void, donateTotalAmount: string, supporters: DonateHistory, loading?: boolean, donateSettings?: DonationSettings) => React.ReactNode;
|
|
51
51
|
};
|
|
52
|
+
export declare function DonateDetails({ supporters, currency, method }: DonateHistory): import("react").JSX.Element;
|
|
52
53
|
declare function CheckoutDonate(props: DonateProps): import("react").JSX.Element;
|
|
53
54
|
declare namespace CheckoutDonate {
|
|
54
55
|
var defaultProps: {
|
package/es/checkout/donate.js
CHANGED
|
@@ -60,7 +60,7 @@ const fetchSupporters = (target, livemode = true) => {
|
|
|
60
60
|
const emojiFont = {
|
|
61
61
|
fontFamily: 'Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
|
|
62
62
|
};
|
|
63
|
-
function DonateDetails({ supporters = [], currency, method }) {
|
|
63
|
+
export function DonateDetails({ supporters = [], currency, method }) {
|
|
64
64
|
const { locale } = useLocaleContext();
|
|
65
65
|
return /* @__PURE__ */ jsx(
|
|
66
66
|
Stack,
|
|
@@ -180,22 +180,33 @@ function SupporterAvatar({
|
|
|
180
180
|
if (customersNum === 0)
|
|
181
181
|
return null;
|
|
182
182
|
return /* @__PURE__ */ jsxs(Stack, { flexDirection: "row", justifyContent: "center", alignItems: "center", children: [
|
|
183
|
-
/* @__PURE__ */ jsx(
|
|
184
|
-
|
|
183
|
+
/* @__PURE__ */ jsx(
|
|
184
|
+
AvatarGroup,
|
|
185
185
|
{
|
|
186
|
-
|
|
187
|
-
supporter.customer?.did,
|
|
188
|
-
supporter?.updated_at ? new Date(supporter.updated_at).toISOString() : "",
|
|
189
|
-
24
|
|
190
|
-
),
|
|
191
|
-
alt: supporter.customer?.name,
|
|
186
|
+
max: 5,
|
|
192
187
|
sx: {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
188
|
+
"& .MuiAvatar-root": {
|
|
189
|
+
backgroundColor: "background.paper"
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
children: customers.slice(0, 5).map((supporter) => /* @__PURE__ */ jsx(
|
|
193
|
+
Avatar,
|
|
194
|
+
{
|
|
195
|
+
src: getCustomerAvatar(
|
|
196
|
+
supporter.customer?.did,
|
|
197
|
+
supporter?.updated_at ? new Date(supporter.updated_at).toISOString() : "",
|
|
198
|
+
24
|
|
199
|
+
),
|
|
200
|
+
alt: supporter.customer?.name,
|
|
201
|
+
sx: {
|
|
202
|
+
width: "24px",
|
|
203
|
+
height: "24px"
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
supporter.customer?.id
|
|
207
|
+
))
|
|
208
|
+
}
|
|
209
|
+
),
|
|
199
210
|
/* @__PURE__ */ jsx(
|
|
200
211
|
Box,
|
|
201
212
|
{
|
package/es/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import CheckoutDonate from './checkout/donate';
|
|
1
|
+
import CheckoutDonate, { DonateDetails } from './checkout/donate';
|
|
2
2
|
import CheckoutForm from './checkout/form';
|
|
3
3
|
import CheckoutTable from './checkout/table';
|
|
4
4
|
import TxGas from './components/blockchain/gas';
|
|
@@ -43,4 +43,4 @@ export * from './hooks/mobile';
|
|
|
43
43
|
export * from './hooks/table';
|
|
44
44
|
export * from './hooks/scroll';
|
|
45
45
|
export { translations, createTranslator } from './locales';
|
|
46
|
-
export { createLazyComponent, api, dayjs, FormInput, PhoneInput, AddressForm, StripeForm, Status, Livemode, Switch, ConfirmDialog, CheckoutForm, CheckoutTable, CheckoutDonate, CurrencySelector, Payment, PaymentSummary, PricingTable, ProductSkeleton, Amount, CustomerInvoiceList, CustomerPaymentList, TxLink, TxGas, SafeGuard, PricingItem, CountrySelect, Table, TruncatedText, Link, OverdueInvoicePayment, PaymentBeneficiaries, LoadingButton, };
|
|
46
|
+
export { createLazyComponent, api, dayjs, FormInput, PhoneInput, AddressForm, StripeForm, Status, Livemode, Switch, ConfirmDialog, CheckoutForm, CheckoutTable, CheckoutDonate, CurrencySelector, Payment, PaymentSummary, PricingTable, ProductSkeleton, Amount, CustomerInvoiceList, CustomerPaymentList, TxLink, TxGas, SafeGuard, PricingItem, CountrySelect, Table, TruncatedText, Link, OverdueInvoicePayment, PaymentBeneficiaries, LoadingButton, DonateDetails, };
|
package/es/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import CheckoutDonate from "./checkout/donate.js";
|
|
1
|
+
import CheckoutDonate, { DonateDetails } from "./checkout/donate.js";
|
|
2
2
|
import CheckoutForm from "./checkout/form.js";
|
|
3
3
|
import CheckoutTable from "./checkout/table.js";
|
|
4
4
|
import TxGas from "./components/blockchain/gas.js";
|
|
@@ -76,5 +76,6 @@ export {
|
|
|
76
76
|
Link,
|
|
77
77
|
OverdueInvoicePayment,
|
|
78
78
|
PaymentBeneficiaries,
|
|
79
|
-
LoadingButton
|
|
79
|
+
LoadingButton,
|
|
80
|
+
DonateDetails
|
|
80
81
|
};
|
package/lib/checkout/donate.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export type DonateProps = Pick<CheckoutProps, 'onPaid' | 'onError'> & {
|
|
|
49
49
|
theme?: 'default' | 'inherit' | PaymentThemeOptions;
|
|
50
50
|
children?: (openDialog: () => void, donateTotalAmount: string, supporters: DonateHistory, loading?: boolean, donateSettings?: DonationSettings) => React.ReactNode;
|
|
51
51
|
};
|
|
52
|
+
export declare function DonateDetails({ supporters, currency, method }: DonateHistory): import("react").JSX.Element;
|
|
52
53
|
declare function CheckoutDonate(props: DonateProps): import("react").JSX.Element;
|
|
53
54
|
declare namespace CheckoutDonate {
|
|
54
55
|
var defaultProps: {
|
package/lib/checkout/donate.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.DonateDetails = DonateDetails;
|
|
6
7
|
module.exports = CheckoutDonate;
|
|
7
8
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
9
|
var _Dialog = _interopRequireDefault(require("@arcblock/ux/lib/Dialog"));
|
|
@@ -180,6 +181,11 @@ function SupporterAvatar({
|
|
|
180
181
|
alignItems: "center",
|
|
181
182
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.AvatarGroup, {
|
|
182
183
|
max: 5,
|
|
184
|
+
sx: {
|
|
185
|
+
"& .MuiAvatar-root": {
|
|
186
|
+
backgroundColor: "background.paper"
|
|
187
|
+
}
|
|
188
|
+
},
|
|
183
189
|
children: customers.slice(0, 5).map(supporter => /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Avatar, {
|
|
184
190
|
src: (0, _util.getCustomerAvatar)(supporter.customer?.did, supporter?.updated_at ? new Date(supporter.updated_at).toISOString() : "", 24),
|
|
185
191
|
alt: supporter.customer?.name,
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import CheckoutDonate from './checkout/donate';
|
|
1
|
+
import CheckoutDonate, { DonateDetails } from './checkout/donate';
|
|
2
2
|
import CheckoutForm from './checkout/form';
|
|
3
3
|
import CheckoutTable from './checkout/table';
|
|
4
4
|
import TxGas from './components/blockchain/gas';
|
|
@@ -43,4 +43,4 @@ export * from './hooks/mobile';
|
|
|
43
43
|
export * from './hooks/table';
|
|
44
44
|
export * from './hooks/scroll';
|
|
45
45
|
export { translations, createTranslator } from './locales';
|
|
46
|
-
export { createLazyComponent, api, dayjs, FormInput, PhoneInput, AddressForm, StripeForm, Status, Livemode, Switch, ConfirmDialog, CheckoutForm, CheckoutTable, CheckoutDonate, CurrencySelector, Payment, PaymentSummary, PricingTable, ProductSkeleton, Amount, CustomerInvoiceList, CustomerPaymentList, TxLink, TxGas, SafeGuard, PricingItem, CountrySelect, Table, TruncatedText, Link, OverdueInvoicePayment, PaymentBeneficiaries, LoadingButton, };
|
|
46
|
+
export { createLazyComponent, api, dayjs, FormInput, PhoneInput, AddressForm, StripeForm, Status, Livemode, Switch, ConfirmDialog, CheckoutForm, CheckoutTable, CheckoutDonate, CurrencySelector, Payment, PaymentSummary, PricingTable, ProductSkeleton, Amount, CustomerInvoiceList, CustomerPaymentList, TxLink, TxGas, SafeGuard, PricingItem, CountrySelect, Table, TruncatedText, Link, OverdueInvoicePayment, PaymentBeneficiaries, LoadingButton, DonateDetails, };
|
package/lib/index.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
7
|
CheckoutDonate: true,
|
|
8
|
+
DonateDetails: true,
|
|
8
9
|
CheckoutForm: true,
|
|
9
10
|
CheckoutTable: true,
|
|
10
11
|
TxGas: true,
|
|
@@ -101,6 +102,12 @@ Object.defineProperty(exports, "CustomerPaymentList", {
|
|
|
101
102
|
return _list2.default;
|
|
102
103
|
}
|
|
103
104
|
});
|
|
105
|
+
Object.defineProperty(exports, "DonateDetails", {
|
|
106
|
+
enumerable: true,
|
|
107
|
+
get: function () {
|
|
108
|
+
return _donate.DonateDetails;
|
|
109
|
+
}
|
|
110
|
+
});
|
|
104
111
|
Object.defineProperty(exports, "FormInput", {
|
|
105
112
|
enumerable: true,
|
|
106
113
|
get: function () {
|
|
@@ -257,7 +264,7 @@ Object.defineProperty(exports, "translations", {
|
|
|
257
264
|
return _locales.translations;
|
|
258
265
|
}
|
|
259
266
|
});
|
|
260
|
-
var _donate =
|
|
267
|
+
var _donate = _interopRequireWildcard(require("./checkout/donate"));
|
|
261
268
|
var _form = _interopRequireDefault(require("./checkout/form"));
|
|
262
269
|
var _table = _interopRequireDefault(require("./checkout/table"));
|
|
263
270
|
var _gas = _interopRequireDefault(require("./components/blockchain/gas"));
|
|
@@ -412,4 +419,6 @@ Object.keys(_scroll).forEach(function (key) {
|
|
|
412
419
|
});
|
|
413
420
|
});
|
|
414
421
|
var _locales = require("./locales");
|
|
415
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
422
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
423
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
424
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/payment-react",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.10",
|
|
4
4
|
"description": "Reusable react components for payment kit v2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@arcblock/did-connect": "^2.11.
|
|
57
|
-
"@arcblock/ux": "^2.11.
|
|
56
|
+
"@arcblock/did-connect": "^2.11.48",
|
|
57
|
+
"@arcblock/ux": "^2.11.48",
|
|
58
58
|
"@arcblock/ws": "^1.19.10",
|
|
59
|
-
"@blocklet/ui-react": "^2.11.
|
|
59
|
+
"@blocklet/ui-react": "^2.11.48",
|
|
60
60
|
"@mui/icons-material": "^5.16.6",
|
|
61
61
|
"@mui/lab": "^5.0.0-alpha.173",
|
|
62
62
|
"@mui/material": "^5.16.6",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@babel/core": "^7.25.2",
|
|
93
93
|
"@babel/preset-env": "^7.25.2",
|
|
94
94
|
"@babel/preset-react": "^7.24.7",
|
|
95
|
-
"@blocklet/payment-types": "1.18.
|
|
95
|
+
"@blocklet/payment-types": "1.18.10",
|
|
96
96
|
"@storybook/addon-essentials": "^7.6.20",
|
|
97
97
|
"@storybook/addon-interactions": "^7.6.20",
|
|
98
98
|
"@storybook/addon-links": "^7.6.20",
|
|
@@ -123,5 +123,5 @@
|
|
|
123
123
|
"vite-plugin-babel": "^1.2.0",
|
|
124
124
|
"vite-plugin-node-polyfills": "^0.21.0"
|
|
125
125
|
},
|
|
126
|
-
"gitHead": "
|
|
126
|
+
"gitHead": "942a9f4057f0cb1e7b3409d469b20c54ab7924a0"
|
|
127
127
|
}
|
package/src/checkout/donate.tsx
CHANGED
|
@@ -145,7 +145,7 @@ const emojiFont = {
|
|
|
145
145
|
'Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
|
|
146
146
|
};
|
|
147
147
|
|
|
148
|
-
function DonateDetails({ supporters = [], currency, method }: DonateHistory) {
|
|
148
|
+
export function DonateDetails({ supporters = [], currency, method }: DonateHistory) {
|
|
149
149
|
const { locale } = useLocaleContext();
|
|
150
150
|
return (
|
|
151
151
|
<Stack
|
|
@@ -249,7 +249,13 @@ function SupporterAvatar({
|
|
|
249
249
|
if (customersNum === 0) return null;
|
|
250
250
|
return (
|
|
251
251
|
<Stack flexDirection="row" justifyContent="center" alignItems="center">
|
|
252
|
-
<AvatarGroup
|
|
252
|
+
<AvatarGroup
|
|
253
|
+
max={5}
|
|
254
|
+
sx={{
|
|
255
|
+
'& .MuiAvatar-root': {
|
|
256
|
+
backgroundColor: 'background.paper',
|
|
257
|
+
},
|
|
258
|
+
}}>
|
|
253
259
|
{customers.slice(0, 5).map((supporter) => (
|
|
254
260
|
<Avatar
|
|
255
261
|
src={getCustomerAvatar(
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import CheckoutDonate from './checkout/donate';
|
|
1
|
+
import CheckoutDonate, { DonateDetails } from './checkout/donate';
|
|
2
2
|
import CheckoutForm from './checkout/form';
|
|
3
3
|
import CheckoutTable from './checkout/table';
|
|
4
4
|
import TxGas from './components/blockchain/gas';
|
|
@@ -81,4 +81,5 @@ export {
|
|
|
81
81
|
OverdueInvoicePayment,
|
|
82
82
|
PaymentBeneficiaries,
|
|
83
83
|
LoadingButton,
|
|
84
|
+
DonateDetails,
|
|
84
85
|
};
|