@blocklet/payment-react 1.13.261 → 1.13.263

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.
@@ -68,15 +68,6 @@ export default function PricingTable({ table, alignItems, interval, mode, onSele
68
68
  .price-table-wrap:has(> div:nth-child(3)) {
69
69
  max-width: 1080px !important;
70
70
  }
71
- .price-table-wrap:has(> div:nth-child(1)) > .price-table-item {
72
- width: 90% !important;
73
- }
74
- .price-table-wrap:has(> div:nth-child(2)) > .price-table-item {
75
- width: 45% !important;
76
- }
77
- .price-table-wrap:has(> div:nth-child(3)) > .price-table-item {
78
- width: 30% !important;
79
- }
80
71
  }
81
72
  `;
82
73
  return /* @__PURE__ */ jsx(Root, { children: /* @__PURE__ */ jsxs(
@@ -167,6 +158,8 @@ export default function PricingTable({ table, alignItems, interval, mode, onSele
167
158
  borderColor: mode === "select" && x.is_selected ? "primary.main" : "#ddd",
168
159
  boxShadow: "0 8px 16px rgba(0, 0, 0, 20%)"
169
160
  },
161
+ width: "320px",
162
+ maxWidth: "360px",
170
163
  padding: "20px",
171
164
  position: "relative"
172
165
  },
package/es/libs/util.js CHANGED
@@ -64,6 +64,9 @@ export const formatLocale = (locale = "en") => {
64
64
  };
65
65
  export const formatPrettyMsLocale = (locale) => locale === "zh" ? "zh_CN" : "en_US";
66
66
  export const formatError = (err) => {
67
+ if (!err) {
68
+ return "Unknown error";
69
+ }
67
70
  const { details, errors, response } = err;
68
71
  if (Array.isArray(errors)) {
69
72
  return errors.map((x) => x.message).join("\n");
@@ -77,7 +80,7 @@ export const formatError = (err) => {
77
80
  return `Validate failed: ${formatted.join(";")}`;
78
81
  }
79
82
  if (response) {
80
- return response.data.error || `${err.message}: ${JSON.stringify(response.data)}`;
83
+ return response.data?.error || `${err.message}: ${JSON.stringify(response.data)}`;
81
84
  }
82
85
  return err.message;
83
86
  };
@@ -87,15 +87,6 @@ function PricingTable({
87
87
  .price-table-wrap:has(> div:nth-child(3)) {
88
88
  max-width: 1080px !important;
89
89
  }
90
- .price-table-wrap:has(> div:nth-child(1)) > .price-table-item {
91
- width: 90% !important;
92
- }
93
- .price-table-wrap:has(> div:nth-child(2)) > .price-table-item {
94
- width: 45% !important;
95
- }
96
- .price-table-wrap:has(> div:nth-child(3)) > .price-table-item {
97
- width: 30% !important;
98
- }
99
90
  }
100
91
  `;
101
92
  return /* @__PURE__ */(0, _jsxRuntime.jsx)(Root, {
@@ -173,6 +164,8 @@ function PricingTable({
173
164
  borderColor: mode === "select" && x.is_selected ? "primary.main" : "#ddd",
174
165
  boxShadow: "0 8px 16px rgba(0, 0, 0, 20%)"
175
166
  },
167
+ width: "320px",
168
+ maxWidth: "360px",
176
169
  padding: "20px",
177
170
  position: "relative"
178
171
  },
package/lib/libs/util.js CHANGED
@@ -111,6 +111,9 @@ exports.formatLocale = formatLocale;
111
111
  const formatPrettyMsLocale = locale => locale === "zh" ? "zh_CN" : "en_US";
112
112
  exports.formatPrettyMsLocale = formatPrettyMsLocale;
113
113
  const formatError = err => {
114
+ if (!err) {
115
+ return "Unknown error";
116
+ }
114
117
  const {
115
118
  details,
116
119
  errors,
@@ -128,7 +131,7 @@ const formatError = err => {
128
131
  return `Validate failed: ${formatted.join(";")}`;
129
132
  }
130
133
  if (response) {
131
- return response.data.error || `${err.message}: ${JSON.stringify(response.data)}`;
134
+ return response.data?.error || `${err.message}: ${JSON.stringify(response.data)}`;
132
135
  }
133
136
  return err.message;
134
137
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/payment-react",
3
- "version": "1.13.261",
3
+ "version": "1.13.263",
4
4
  "description": "Reusable react components for payment kit v2",
5
5
  "keywords": [
6
6
  "react",
@@ -91,7 +91,7 @@
91
91
  "@babel/core": "^7.24.5",
92
92
  "@babel/preset-env": "^7.24.5",
93
93
  "@babel/preset-react": "^7.24.1",
94
- "@blocklet/payment-types": "1.13.261",
94
+ "@blocklet/payment-types": "1.13.263",
95
95
  "@storybook/addon-essentials": "^7.6.19",
96
96
  "@storybook/addon-interactions": "^7.6.19",
97
97
  "@storybook/addon-links": "^7.6.19",
@@ -120,5 +120,5 @@
120
120
  "vite-plugin-babel": "^1.2.0",
121
121
  "vite-plugin-node-polyfills": "^0.21.0"
122
122
  },
123
- "gitHead": "30f66652a71168cbd4050639527dc7dbf15b12bb"
123
+ "gitHead": "be124b5d7d0e96734ac36d20a01c493a15cd443e"
124
124
  }
@@ -89,15 +89,6 @@ export default function PricingTable({ table, alignItems, interval, mode, onSele
89
89
  .price-table-wrap:has(> div:nth-child(3)) {
90
90
  max-width: 1080px !important;
91
91
  }
92
- .price-table-wrap:has(> div:nth-child(1)) > .price-table-item {
93
- width: 90% !important;
94
- }
95
- .price-table-wrap:has(> div:nth-child(2)) > .price-table-item {
96
- width: 45% !important;
97
- }
98
- .price-table-wrap:has(> div:nth-child(3)) > .price-table-item {
99
- width: 30% !important;
100
- }
101
92
  }
102
93
  `;
103
94
  return (
@@ -187,6 +178,8 @@ export default function PricingTable({ table, alignItems, interval, mode, onSele
187
178
  borderColor: mode === 'select' && x.is_selected ? 'primary.main' : '#ddd',
188
179
  boxShadow: '0 8px 16px rgba(0, 0, 0, 20%)',
189
180
  },
181
+ width: '320px',
182
+ maxWidth: '360px',
190
183
 
191
184
  padding: '20px',
192
185
  position: 'relative',
package/src/libs/util.ts CHANGED
@@ -96,6 +96,10 @@ export const formatLocale = (locale = 'en') => {
96
96
  export const formatPrettyMsLocale = (locale: string) => (locale === 'zh' ? 'zh_CN' : 'en_US');
97
97
 
98
98
  export const formatError = (err: any) => {
99
+ if (!err) {
100
+ return 'Unknown error';
101
+ }
102
+
99
103
  const { details, errors, response } = err;
100
104
 
101
105
  // graphql error
@@ -116,7 +120,7 @@ export const formatError = (err: any) => {
116
120
 
117
121
  // axios error
118
122
  if (response) {
119
- return response.data.error || `${err.message}: ${JSON.stringify(response.data)}`;
123
+ return response.data?.error || `${err.message}: ${JSON.stringify(response.data)}`;
120
124
  }
121
125
 
122
126
  return err.message;