@betterstore/react 0.3.9 → 0.3.11
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/CHANGELOG.md +12 -0
- package/dist/index.cjs.js +7 -7
- package/dist/index.mjs +7 -7
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -35604,7 +35604,9 @@ function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl,
|
|
|
35604
35604
|
};
|
|
35605
35605
|
React.useEffect(() => {
|
|
35606
35606
|
const asyncFunc = () => __awaiter(this, void 0, void 0, function* () {
|
|
35607
|
-
const { paymentSecret, publicKey, checkoutSession: newCheckout
|
|
35607
|
+
const _a = yield storeClient.generateCheckoutPaymentSecret(clientSecret, checkoutId), { paymentSecret, publicKey, checkoutSession: newCheckout } = _a, rest = __rest(_a, ["paymentSecret", "publicKey", "checkoutSession"]);
|
|
35608
|
+
console.log("newCheckout", newCheckout);
|
|
35609
|
+
console.log("rest", rest);
|
|
35608
35610
|
setPaymentSecret(paymentSecret);
|
|
35609
35611
|
setPublicKey(publicKey);
|
|
35610
35612
|
setCheckout(newCheckout);
|
|
@@ -35701,7 +35703,7 @@ function CheckoutSummary({ appliedDiscounts, lineItems, shipping, tax, currency,
|
|
|
35701
35703
|
return currentCombinations;
|
|
35702
35704
|
return intersection.filter((combination) => currentCombinations.some((currentCombination) => JSON.stringify(currentCombination) === JSON.stringify(combination)));
|
|
35703
35705
|
}, []);
|
|
35704
|
-
const canCombine = sharedCombinations.length > 0;
|
|
35706
|
+
const canCombine = appliedDiscounts.length === 0 || sharedCombinations.length > 0;
|
|
35705
35707
|
return (React.createElement("div", { className: "grid gap-5" },
|
|
35706
35708
|
React.createElement("div", { className: "flex justify-between items-center" },
|
|
35707
35709
|
React.createElement("div", { onClick: () => setIsOpen(!isOpen), className: "flex items-center gap-2 cursor-pointer" },
|
|
@@ -35776,11 +35778,9 @@ function CheckoutSummary({ appliedDiscounts, lineItems, shipping, tax, currency,
|
|
|
35776
35778
|
React.createElement("div", { className: "absolute -top-2 -right-2 w-6 h-6 bg-primary rounded-full flex items-center text-background justify-center text-sm" }, item.quantity)),
|
|
35777
35779
|
React.createElement("div", { className: "ml-4 flex-1" },
|
|
35778
35780
|
React.createElement("h3", { className: "text-lg font-medium" }, (_e = item.productData) === null || _e === void 0 ? void 0 : _e.title),
|
|
35779
|
-
React.createElement("p", { className: "text-muted-foreground text-ellipsis line-clamp-1 md:max-w-[75%] text-sm" }, item.variantOptions
|
|
35780
|
-
option.name
|
|
35781
|
-
"
|
|
35782
|
-
option.value,
|
|
35783
|
-
" "))))),
|
|
35781
|
+
React.createElement("p", { className: "text-muted-foreground text-ellipsis line-clamp-1 md:max-w-[75%] text-sm" }, item.variantOptions
|
|
35782
|
+
.map((option) => `${option.name}: ${option.value}`)
|
|
35783
|
+
.join(", "))),
|
|
35784
35784
|
React.createElement("div", { className: "text-right" }, isDiscounted ? (React.createElement("div", { className: "flex flex-col" },
|
|
35785
35785
|
React.createElement("p", { className: "text-sm font-medium -mb-0.5 line-through text-muted-foreground" }, storeHelpers.formatPrice((_f = productItem === null || productItem === void 0 ? void 0 : productItem.priceInCents) !== null && _f !== void 0 ? _f : 0, currency, exchangeRate)),
|
|
35786
35786
|
React.createElement("p", { className: "text-lg font-medium" }, discountedPrice <= 0
|
package/dist/index.mjs
CHANGED
|
@@ -35581,7 +35581,9 @@ function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl,
|
|
|
35581
35581
|
};
|
|
35582
35582
|
useEffect(() => {
|
|
35583
35583
|
const asyncFunc = () => __awaiter(this, void 0, void 0, function* () {
|
|
35584
|
-
const { paymentSecret, publicKey, checkoutSession: newCheckout
|
|
35584
|
+
const _a = yield storeClient.generateCheckoutPaymentSecret(clientSecret, checkoutId), { paymentSecret, publicKey, checkoutSession: newCheckout } = _a, rest = __rest(_a, ["paymentSecret", "publicKey", "checkoutSession"]);
|
|
35585
|
+
console.log("newCheckout", newCheckout);
|
|
35586
|
+
console.log("rest", rest);
|
|
35585
35587
|
setPaymentSecret(paymentSecret);
|
|
35586
35588
|
setPublicKey(publicKey);
|
|
35587
35589
|
setCheckout(newCheckout);
|
|
@@ -35678,7 +35680,7 @@ function CheckoutSummary({ appliedDiscounts, lineItems, shipping, tax, currency,
|
|
|
35678
35680
|
return currentCombinations;
|
|
35679
35681
|
return intersection.filter((combination) => currentCombinations.some((currentCombination) => JSON.stringify(currentCombination) === JSON.stringify(combination)));
|
|
35680
35682
|
}, []);
|
|
35681
|
-
const canCombine = sharedCombinations.length > 0;
|
|
35683
|
+
const canCombine = appliedDiscounts.length === 0 || sharedCombinations.length > 0;
|
|
35682
35684
|
return (React__default.createElement("div", { className: "grid gap-5" },
|
|
35683
35685
|
React__default.createElement("div", { className: "flex justify-between items-center" },
|
|
35684
35686
|
React__default.createElement("div", { onClick: () => setIsOpen(!isOpen), className: "flex items-center gap-2 cursor-pointer" },
|
|
@@ -35753,11 +35755,9 @@ function CheckoutSummary({ appliedDiscounts, lineItems, shipping, tax, currency,
|
|
|
35753
35755
|
React__default.createElement("div", { className: "absolute -top-2 -right-2 w-6 h-6 bg-primary rounded-full flex items-center text-background justify-center text-sm" }, item.quantity)),
|
|
35754
35756
|
React__default.createElement("div", { className: "ml-4 flex-1" },
|
|
35755
35757
|
React__default.createElement("h3", { className: "text-lg font-medium" }, (_e = item.productData) === null || _e === void 0 ? void 0 : _e.title),
|
|
35756
|
-
React__default.createElement("p", { className: "text-muted-foreground text-ellipsis line-clamp-1 md:max-w-[75%] text-sm" }, item.variantOptions
|
|
35757
|
-
option.name
|
|
35758
|
-
"
|
|
35759
|
-
option.value,
|
|
35760
|
-
" "))))),
|
|
35758
|
+
React__default.createElement("p", { className: "text-muted-foreground text-ellipsis line-clamp-1 md:max-w-[75%] text-sm" }, item.variantOptions
|
|
35759
|
+
.map((option) => `${option.name}: ${option.value}`)
|
|
35760
|
+
.join(", "))),
|
|
35761
35761
|
React__default.createElement("div", { className: "text-right" }, isDiscounted ? (React__default.createElement("div", { className: "flex flex-col" },
|
|
35762
35762
|
React__default.createElement("p", { className: "text-sm font-medium -mb-0.5 line-through text-muted-foreground" }, storeHelpers.formatPrice((_f = productItem === null || productItem === void 0 ? void 0 : productItem.priceInCents) !== null && _f !== void 0 ? _f : 0, currency, exchangeRate)),
|
|
35763
35763
|
React__default.createElement("p", { className: "text-lg font-medium" }, discountedPrice <= 0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@betterstore/react",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.11",
|
|
4
4
|
"description": "E-commerce for Developers",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"author": "Better Store",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@betterstore/sdk": "^0.3.
|
|
22
|
+
"@betterstore/sdk": "^0.3.62",
|
|
23
23
|
"@changesets/cli": "^2.28.1",
|
|
24
24
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
25
25
|
"@rollup/plugin-json": "^6.1.0",
|