mozrest-sdk-react-dev 0.3.26 → 0.3.27

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/mozrest-sdk.es.js CHANGED
@@ -39194,7 +39194,7 @@ const useService = (executer, { onSuccess, onError, successText } = {}) => {
39194
39194
  if (typeof onError === "function") {
39195
39195
  await onError(error22);
39196
39196
  }
39197
- showMessageError("Error");
39197
+ showMessageError((error22 == null ? void 0 : error22.message) ?? "Error");
39198
39198
  setError(error22 == null ? void 0 : error22.message);
39199
39199
  } finally {
39200
39200
  setIsExecuting(false);
@@ -122645,22 +122645,28 @@ const addModuleGoogle = async ({
122645
122645
  data: data2
122646
122646
  };
122647
122647
  };
122648
- const account = "_account_8539r_12";
122648
+ const account = "_account_p1rn0_12";
122649
+ const account__address = "_account__address_p1rn0_27";
122649
122650
  const styles$w = {
122650
122651
  account,
122651
- "account--selected": "_account--selected_8539r_23"
122652
+ "account--selected": "_account--selected_p1rn0_24",
122653
+ account__address
122652
122654
  };
122653
122655
  const Account = ({
122654
122656
  name: name2,
122655
122657
  onClick,
122656
- selected
122658
+ selected,
122659
+ address: address2
122657
122660
  }) => {
122658
- return /* @__PURE__ */ jsx$1("div", {
122661
+ return /* @__PURE__ */ jsxs("div", {
122659
122662
  className: classNames$2(styles$w.account, {
122660
122663
  [styles$w["account--selected"]]: selected
122661
122664
  }),
122662
122665
  onClick,
122663
- children: name2
122666
+ children: [name2, address2 && /* @__PURE__ */ jsx$1("div", {
122667
+ className: styles$w.account__address,
122668
+ children: address2
122669
+ })]
122664
122670
  });
122665
122671
  };
122666
122672
  const selectAccount$1 = "_selectAccount_1cl8x_1";
@@ -122671,6 +122677,17 @@ const styles$v = {
122671
122677
  selectAccount__title: selectAccount__title$1,
122672
122678
  close: close2
122673
122679
  };
122680
+ const googleAddressFormatter = (storefrontAddress) => {
122681
+ if (!storefrontAddress) return null;
122682
+ const addressParts = [
122683
+ ...storefrontAddress.addressLines,
122684
+ storefrontAddress.locality,
122685
+ storefrontAddress.administrativeArea,
122686
+ storefrontAddress.postalCode,
122687
+ storefrontAddress.regionCode
122688
+ ].filter(Boolean);
122689
+ return addressParts.join(", ");
122690
+ };
122674
122691
  const SelectAccount$1 = ({
122675
122692
  accounts,
122676
122693
  onNext,
@@ -122687,7 +122704,10 @@ const SelectAccount$1 = ({
122687
122704
  };
122688
122705
  const handleSearchAccount = (e) => {
122689
122706
  setSearchValue(e.target.value);
122690
- setFilteredAccounts(accounts.filter((a2) => a2.title.toLowerCase().includes(e.target.value)));
122707
+ setFilteredAccounts(accounts.filter((a2) => {
122708
+ var _a2;
122709
+ return a2.title.toLowerCase().includes(e.target.value) || (a2.storefrontAddress ? (_a2 = googleAddressFormatter(a2.storefrontAddress)) == null ? void 0 : _a2.toLowerCase().includes(e.target.value) : false);
122710
+ }));
122691
122711
  };
122692
122712
  useEffect(() => {
122693
122713
  setFilteredAccounts(accounts);
@@ -122731,6 +122751,7 @@ const SelectAccount$1 = ({
122731
122751
  }), /* @__PURE__ */ jsx$1("br", {}), filteredAccounts.map((account2) => {
122732
122752
  return /* @__PURE__ */ jsx$1(Account, {
122733
122753
  name: account2.title,
122754
+ address: googleAddressFormatter(account2 == null ? void 0 : account2.storefrontAddress),
122734
122755
  onClick: () => onSelectAccount(account2),
122735
122756
  selected: (selectedAccount == null ? void 0 : selectedAccount.name) === account2.name
122736
122757
  }, account2.name);
@@ -129417,16 +129438,16 @@ const index$7 = ({
129417
129438
  label: t2("notes"),
129418
129439
  placeholder: t2("notes")
129419
129440
  })
129441
+ }), selectedBooking && selectedBooking.status !== "canceled" && /* @__PURE__ */ jsxs(React__default.Fragment, {
129442
+ children: [/* @__PURE__ */ jsx$1(Divider2, {}), /* @__PURE__ */ jsx$1(BookingInfo, {
129443
+ item: selectedBooking
129444
+ })]
129420
129445
  })]
129421
129446
  }), /* @__PURE__ */ jsxs("div", {
129422
129447
  className: styles$e.sidebarFooter,
129423
129448
  children: [/* @__PURE__ */ jsx$1(Divider2, {}), canEdit && /* @__PURE__ */ jsx$1(ActionButtons, {
129424
129449
  onSubmit,
129425
129450
  venueId
129426
- }), selectedBooking && selectedBooking.status !== "canceled" && /* @__PURE__ */ jsxs(React__default.Fragment, {
129427
- children: [/* @__PURE__ */ jsx$1(Divider2, {}), /* @__PURE__ */ jsx$1(BookingInfo, {
129428
- item: selectedBooking
129429
- })]
129430
129451
  })]
129431
129452
  })]
129432
129453
  });
@@ -129575,6 +129596,9 @@ const EnableOnboarding = ({
129575
129596
  } = useService(EnableLive, {
129576
129597
  onSuccess: async () => {
129577
129598
  reloadSelectsData();
129599
+ },
129600
+ onError: () => {
129601
+ reloadSelectsData();
129578
129602
  }
129579
129603
  });
129580
129604
  useEffect(() => {
@@ -129708,7 +129732,7 @@ function MainComponent({
129708
129732
  className: styles$e.mainWrapper,
129709
129733
  children: [/* @__PURE__ */ jsx$1(EnableOnboarding, {
129710
129734
  venueId,
129711
- onboardingReady: filtersData == null ? void 0 : filtersData.onboardingReady,
129735
+ onboardingReady: !filtersData ? true : filtersData == null ? void 0 : filtersData.onboardingReady,
129712
129736
  reloadSelectsData
129713
129737
  }), /* @__PURE__ */ jsxs("div", {
129714
129738
  className: styles$e.mainConatiner,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mozrest-sdk-react-dev",
3
- "version": "0.3.26",
3
+ "version": "0.3.27",
4
4
  "main": "mozrest-sdk.es.js",
5
5
  "keywords": [
6
6
  "mozrest"
package/style.css CHANGED
@@ -3260,30 +3260,35 @@ hr {
3260
3260
  ._my-masonry-grid_column_vahsi_12 > div {
3261
3261
  /* change div to reference your elements you put in <Masonry> */
3262
3262
  margin-bottom: 40px;
3263
- }._selectAccount_8539r_1 {
3263
+ }._selectAccount_p1rn0_1 {
3264
3264
  display: flex;
3265
3265
  gap: 0.5rem;
3266
3266
  flex-direction: column;
3267
3267
  text-align: justify;
3268
3268
  }
3269
- ._selectAccount__title_8539r_7 {
3269
+ ._selectAccount__title_p1rn0_7 {
3270
3270
  font: 600 1.125rem/1.55 var(--moz-font-family);
3271
3271
  text-align: center;
3272
3272
  }
3273
3273
 
3274
- ._account_8539r_12 {
3274
+ ._account_p1rn0_12 {
3275
3275
  display: flex;
3276
+ flex-direction: column;
3276
3277
  justify-content: center;
3277
3278
  border: 1px solid var(--moz-input-border);
3278
3279
  border-radius: 1rem;
3279
3280
  padding: 0.5rem;
3280
3281
  cursor: default;
3281
3282
  }
3282
- ._account_8539r_12:hover {
3283
+ ._account_p1rn0_12:hover {
3283
3284
  background-color: var(--moz-cta-content-sec-bg);
3284
3285
  }
3285
- ._account--selected_8539r_23 {
3286
+ ._account--selected_p1rn0_24 {
3286
3287
  background-color: var(--moz-cta-body-bg);
3288
+ }
3289
+ ._account__address_p1rn0_27 {
3290
+ font: 0.75rem/1.75rem var(--moz-font-family-title);
3291
+ color: var(--moz-text-secondary);
3287
3292
  }._selectAccount_1cl8x_1 {
3288
3293
  display: flex;
3289
3294
  gap: 0.5rem;