@betterstore/react 0.3.83 → 0.3.84

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @betterstore/sdk
2
2
 
3
+ ## 0.3.84
4
+
5
+ ### Patch Changes
6
+
7
+ - bug fixes
8
+
3
9
  ## 0.3.83
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -35214,47 +35214,25 @@ function ShippingMethodForm({ shippingRates, initialData, onSubmit, onBack, cont
35214
35214
  ? t("CheckoutEmbed.Shipping.description.zasilkovna")
35215
35215
  : t("CheckoutEmbed.Shipping.description.other");
35216
35216
  return (React.createElement(ShippingOptionWrapper, { rate: rate, key: rateId, onPickupPointSelected: (pickupPointId, pickupPointName) => {
35217
- form.setValue("pickupPointId", pickupPointId);
35218
- form.setValue("pickupPointDisplayName", pickupPointName);
35219
- setFormData(Object.assign(Object.assign({}, formData), { shipping: {
35220
- rateId,
35221
- provider: rate.provider,
35222
- price: intPrice,
35223
- name: rate.name,
35224
- pickupPointId,
35225
- pickupPointDisplayName,
35226
- } }));
35217
+ const newFormData = {
35218
+ rateId,
35219
+ provider: rate.provider,
35220
+ price: intPrice,
35221
+ name: rate.name,
35222
+ pickupPointId: rate.provider === "zasilkovna" ? pickupPointId : "",
35223
+ pickupPointDisplayName: rate.provider === "zasilkovna" ? pickupPointName : "",
35224
+ };
35225
+ form.setValue("rateId", newFormData.rateId);
35226
+ form.setValue("provider", newFormData.provider);
35227
+ form.setValue("name", newFormData.name);
35228
+ form.setValue("price", newFormData.price);
35229
+ form.setValue("pickupPointId", newFormData.pickupPointId);
35230
+ form.setValue("pickupPointDisplayName", newFormData.pickupPointDisplayName);
35231
+ setFormData(Object.assign(Object.assign({}, formData), { shipping: Object.assign({}, newFormData) }));
35227
35232
  }, locale: locale, countryCode: countryCode },
35228
35233
  React.createElement("div", { className: clsx("p-4 cursor-pointer rounded-md border bg-background", {
35229
35234
  "bg-muted border-primary": currentRateId === rateId,
35230
- }), onClick: () => {
35231
- // For Zasilkovna, require pickup point selection
35232
- if (rate.provider === "zasilkovna" &&
35233
- !form.watch("pickupPointId")) {
35234
- return; // Don't proceed if no pickup point selected
35235
- }
35236
- const newFormData = {
35237
- rateId,
35238
- provider: rate.provider,
35239
- price: intPrice,
35240
- name: rate.name,
35241
- pickupPointId: rate.provider === "zasilkovna"
35242
- ? form.watch("pickupPointId")
35243
- : "",
35244
- pickupPointDisplayName: rate.provider === "zasilkovna"
35245
- ? form.watch("pickupPointDisplayName")
35246
- : "",
35247
- };
35248
- form.setValue("rateId", rateId);
35249
- form.setValue("provider", rate.provider);
35250
- form.setValue("name", rate.name);
35251
- form.setValue("price", intPrice);
35252
- if (rate.provider !== "zasilkovna") {
35253
- form.setValue("pickupPointDisplayName", "");
35254
- form.setValue("pickupPointId", "");
35255
- }
35256
- setFormData(Object.assign(Object.assign({}, formData), { shipping: newFormData }));
35257
- } },
35235
+ }) },
35258
35236
  React.createElement("div", { className: "flex items-center justify-between w-full" },
35259
35237
  React.createElement("p", null, rate.name),
35260
35238
  React.createElement("p", null, displayPrice)),
package/dist/index.mjs CHANGED
@@ -35194,47 +35194,25 @@ function ShippingMethodForm({ shippingRates, initialData, onSubmit, onBack, cont
35194
35194
  ? t("CheckoutEmbed.Shipping.description.zasilkovna")
35195
35195
  : t("CheckoutEmbed.Shipping.description.other");
35196
35196
  return (React__default.createElement(ShippingOptionWrapper, { rate: rate, key: rateId, onPickupPointSelected: (pickupPointId, pickupPointName) => {
35197
- form.setValue("pickupPointId", pickupPointId);
35198
- form.setValue("pickupPointDisplayName", pickupPointName);
35199
- setFormData(Object.assign(Object.assign({}, formData), { shipping: {
35200
- rateId,
35201
- provider: rate.provider,
35202
- price: intPrice,
35203
- name: rate.name,
35204
- pickupPointId,
35205
- pickupPointDisplayName,
35206
- } }));
35197
+ const newFormData = {
35198
+ rateId,
35199
+ provider: rate.provider,
35200
+ price: intPrice,
35201
+ name: rate.name,
35202
+ pickupPointId: rate.provider === "zasilkovna" ? pickupPointId : "",
35203
+ pickupPointDisplayName: rate.provider === "zasilkovna" ? pickupPointName : "",
35204
+ };
35205
+ form.setValue("rateId", newFormData.rateId);
35206
+ form.setValue("provider", newFormData.provider);
35207
+ form.setValue("name", newFormData.name);
35208
+ form.setValue("price", newFormData.price);
35209
+ form.setValue("pickupPointId", newFormData.pickupPointId);
35210
+ form.setValue("pickupPointDisplayName", newFormData.pickupPointDisplayName);
35211
+ setFormData(Object.assign(Object.assign({}, formData), { shipping: Object.assign({}, newFormData) }));
35207
35212
  }, locale: locale, countryCode: countryCode },
35208
35213
  React__default.createElement("div", { className: clsx("p-4 cursor-pointer rounded-md border bg-background", {
35209
35214
  "bg-muted border-primary": currentRateId === rateId,
35210
- }), onClick: () => {
35211
- // For Zasilkovna, require pickup point selection
35212
- if (rate.provider === "zasilkovna" &&
35213
- !form.watch("pickupPointId")) {
35214
- return; // Don't proceed if no pickup point selected
35215
- }
35216
- const newFormData = {
35217
- rateId,
35218
- provider: rate.provider,
35219
- price: intPrice,
35220
- name: rate.name,
35221
- pickupPointId: rate.provider === "zasilkovna"
35222
- ? form.watch("pickupPointId")
35223
- : "",
35224
- pickupPointDisplayName: rate.provider === "zasilkovna"
35225
- ? form.watch("pickupPointDisplayName")
35226
- : "",
35227
- };
35228
- form.setValue("rateId", rateId);
35229
- form.setValue("provider", rate.provider);
35230
- form.setValue("name", rate.name);
35231
- form.setValue("price", intPrice);
35232
- if (rate.provider !== "zasilkovna") {
35233
- form.setValue("pickupPointDisplayName", "");
35234
- form.setValue("pickupPointId", "");
35235
- }
35236
- setFormData(Object.assign(Object.assign({}, formData), { shipping: newFormData }));
35237
- } },
35215
+ }) },
35238
35216
  React__default.createElement("div", { className: "flex items-center justify-between w-full" },
35239
35217
  React__default.createElement("p", null, rate.name),
35240
35218
  React__default.createElement("p", null, displayPrice)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterstore/react",
3
- "version": "0.3.83",
3
+ "version": "0.3.84",
4
4
  "description": "E-commerce for Developers",
5
5
  "private": false,
6
6
  "publishConfig": {