@pelcro/react-pelcro-js 3.26.0-beta.72 → 3.26.0-beta.74

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/dist/index.cjs.js CHANGED
@@ -11728,21 +11728,24 @@ const init$1 = () => {
11728
11728
  if (!quickPurchaseItem) {
11729
11729
  return console.error("invalid item SKU id");
11730
11730
  }
11731
- const purchaseResult = purchaseItem(itemSkuId);
11732
- const itemDidntMatchUserCurrency = purchaseResult === false;
11733
- if (itemDidntMatchUserCurrency) {
11734
- var _window$Pelcro$user$r;
11735
- const userCurrency = (_window$Pelcro$user$r = window.Pelcro.user.read().currency) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.toUpperCase();
11736
- const errorMsg = i18next.t("shop:messages.currencyMismatch", {
11737
- currency: userCurrency
11738
- });
11739
- notify.error(errorMsg);
11740
- }
11731
+ purchaseItem(itemSkuId);
11732
+
11733
+ // if (itemDidntMatchUserCurrency) {
11734
+ // const userCurrency = window.Pelcro.user
11735
+ // .read()
11736
+ // .currency?.toUpperCase();
11737
+ // const errorMsg = i18n.t(
11738
+ // "shop:messages.currencyMismatch",
11739
+ // { currency: userCurrency }
11740
+ // );
11741
+ // notify.error(errorMsg);
11742
+ // }
11741
11743
  });
11742
11744
  }
11743
11745
  }
11744
11746
  });
11745
11747
  };
11748
+
11746
11749
  const authenticatedButtons = () => {
11747
11750
  saveToMetadataButton.authenticated();
11748
11751
  const pelcroLoginByClass = document.getElementsByClassName("pelcro-login-button");
@@ -14964,7 +14967,7 @@ function Phone(_ref) {
14964
14967
  *
14965
14968
  */
14966
14969
  function RegisterView(props) {
14967
- var _product$paywall$regi, _product$paywall, _product$paywall$regi2, _product$paywall2, _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$site$r3, _window$Pelcro, _window$Pelcro$uiSett;
14970
+ var _product$paywall$regi, _product$paywall, _product$paywall$regi2, _product$paywall2, _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$site$r3, _window$Pelcro, _window$Pelcro$uiSett, _window$Pelcro2, _window$Pelcro2$uiSet;
14968
14971
  const {
14969
14972
  t
14970
14973
  } = useTranslation("register");
@@ -14975,6 +14978,7 @@ function RegisterView(props) {
14975
14978
  const subtitle = (_product$paywall$regi2 = product === null || product === void 0 ? void 0 : (_product$paywall2 = product.paywall) === null || _product$paywall2 === void 0 ? void 0 : _product$paywall2.register_subtitle) !== null && _product$paywall$regi2 !== void 0 ? _product$paywall$regi2 : t("subtitle");
14976
14979
  const socialLoginEnabled = ((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.facebook_app_id) || ((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.google_app_id) || ((_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.auth0_client_id);
14977
14980
  const showNameFields = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.enableNameFieldsInRegister;
14981
+ const nameFieldsRequired = (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$uiSet = _window$Pelcro2.uiSettings) === null || _window$Pelcro2$uiSet === void 0 ? void 0 : _window$Pelcro2$uiSet.requireNameFieldsInRegister;
14978
14982
  return /*#__PURE__*/React__default['default'].createElement("div", {
14979
14983
  id: "pelcro-register-view"
14980
14984
  }, /*#__PURE__*/React__default['default'].createElement("div", {
@@ -14988,13 +14992,15 @@ function RegisterView(props) {
14988
14992
  className: "plc-flex plc-items-start"
14989
14993
  }, /*#__PURE__*/React__default['default'].createElement(RegisterFirstName, {
14990
14994
  id: "pelcro-input-first-name",
14991
- label: t("labels.firstName"),
14992
- errorId: "pelcro-input-firstName-error"
14995
+ label: `${t("labels.firstName")}${nameFieldsRequired ? " *" : ""}`,
14996
+ errorId: "pelcro-input-firstName-error",
14997
+ required: showNameFields
14993
14998
  }), /*#__PURE__*/React__default['default'].createElement(RegisterLastName, {
14994
14999
  wrapperClassName: "plc-ml-3",
14995
15000
  id: "pelcro-input-last-name",
14996
- label: t("labels.lastName"),
14997
- errorId: "pelcro-input-lastName-error"
15001
+ label: `${t("labels.lastName")}${nameFieldsRequired ? " *" : ""}`,
15002
+ errorId: "pelcro-input-lastName-error",
15003
+ required: showNameFields
14998
15004
  })), /*#__PURE__*/React__default['default'].createElement(RegisterEmail, {
14999
15005
  id: "pelcro-input-email",
15000
15006
  errorId: "pelcro-input-email-error",
@@ -28834,23 +28840,21 @@ const CartContainer = _ref => {
28834
28840
  }
28835
28841
  });
28836
28842
  } else {
28837
- const userCurrency = window.Pelcro.user.read().currency;
28838
- const itemsCurrency = cartItems[0].currency;
28839
- if (userCurrency && userCurrency !== itemsCurrency) {
28840
- dispatch({
28841
- type: DISABLE_SUBMIT,
28842
- payload: true
28843
- });
28844
- dispatch({
28845
- type: SHOW_ALERT,
28846
- payload: {
28847
- type: "error",
28848
- content: t("messages.currencyMismatch", {
28849
- currency: userCurrency.toUpperCase()
28850
- })
28851
- }
28852
- });
28853
- }
28843
+ window.Pelcro.user.read().currency;
28844
+ cartItems[0].currency;
28845
+
28846
+ // if (userCurrency && userCurrency !== itemsCurrency) {
28847
+ // dispatch({ type: DISABLE_SUBMIT, payload: true });
28848
+ // dispatch({
28849
+ // type: SHOW_ALERT,
28850
+ // payload: {
28851
+ // type: "error",
28852
+ // content: t("messages.currencyMismatch", {
28853
+ // currency: userCurrency.toUpperCase()
28854
+ // })
28855
+ // }
28856
+ // });
28857
+ // }
28854
28858
  }
28855
28859
  }, [cartItems]);
28856
28860
  const submit = (state, dispatch) => {
package/dist/index.esm.js CHANGED
@@ -11698,21 +11698,24 @@ const init$1 = () => {
11698
11698
  if (!quickPurchaseItem) {
11699
11699
  return console.error("invalid item SKU id");
11700
11700
  }
11701
- const purchaseResult = purchaseItem(itemSkuId);
11702
- const itemDidntMatchUserCurrency = purchaseResult === false;
11703
- if (itemDidntMatchUserCurrency) {
11704
- var _window$Pelcro$user$r;
11705
- const userCurrency = (_window$Pelcro$user$r = window.Pelcro.user.read().currency) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.toUpperCase();
11706
- const errorMsg = i18next.t("shop:messages.currencyMismatch", {
11707
- currency: userCurrency
11708
- });
11709
- notify.error(errorMsg);
11710
- }
11701
+ purchaseItem(itemSkuId);
11702
+
11703
+ // if (itemDidntMatchUserCurrency) {
11704
+ // const userCurrency = window.Pelcro.user
11705
+ // .read()
11706
+ // .currency?.toUpperCase();
11707
+ // const errorMsg = i18n.t(
11708
+ // "shop:messages.currencyMismatch",
11709
+ // { currency: userCurrency }
11710
+ // );
11711
+ // notify.error(errorMsg);
11712
+ // }
11711
11713
  });
11712
11714
  }
11713
11715
  }
11714
11716
  });
11715
11717
  };
11718
+
11716
11719
  const authenticatedButtons = () => {
11717
11720
  saveToMetadataButton.authenticated();
11718
11721
  const pelcroLoginByClass = document.getElementsByClassName("pelcro-login-button");
@@ -14934,7 +14937,7 @@ function Phone(_ref) {
14934
14937
  *
14935
14938
  */
14936
14939
  function RegisterView(props) {
14937
- var _product$paywall$regi, _product$paywall, _product$paywall$regi2, _product$paywall2, _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$site$r3, _window$Pelcro, _window$Pelcro$uiSett;
14940
+ var _product$paywall$regi, _product$paywall, _product$paywall$regi2, _product$paywall2, _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$site$r3, _window$Pelcro, _window$Pelcro$uiSett, _window$Pelcro2, _window$Pelcro2$uiSet;
14938
14941
  const {
14939
14942
  t
14940
14943
  } = useTranslation("register");
@@ -14945,6 +14948,7 @@ function RegisterView(props) {
14945
14948
  const subtitle = (_product$paywall$regi2 = product === null || product === void 0 ? void 0 : (_product$paywall2 = product.paywall) === null || _product$paywall2 === void 0 ? void 0 : _product$paywall2.register_subtitle) !== null && _product$paywall$regi2 !== void 0 ? _product$paywall$regi2 : t("subtitle");
14946
14949
  const socialLoginEnabled = ((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.facebook_app_id) || ((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.google_app_id) || ((_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.auth0_client_id);
14947
14950
  const showNameFields = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.enableNameFieldsInRegister;
14951
+ const nameFieldsRequired = (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$uiSet = _window$Pelcro2.uiSettings) === null || _window$Pelcro2$uiSet === void 0 ? void 0 : _window$Pelcro2$uiSet.requireNameFieldsInRegister;
14948
14952
  return /*#__PURE__*/React__default.createElement("div", {
14949
14953
  id: "pelcro-register-view"
14950
14954
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -14958,13 +14962,15 @@ function RegisterView(props) {
14958
14962
  className: "plc-flex plc-items-start"
14959
14963
  }, /*#__PURE__*/React__default.createElement(RegisterFirstName, {
14960
14964
  id: "pelcro-input-first-name",
14961
- label: t("labels.firstName"),
14962
- errorId: "pelcro-input-firstName-error"
14965
+ label: `${t("labels.firstName")}${nameFieldsRequired ? " *" : ""}`,
14966
+ errorId: "pelcro-input-firstName-error",
14967
+ required: showNameFields
14963
14968
  }), /*#__PURE__*/React__default.createElement(RegisterLastName, {
14964
14969
  wrapperClassName: "plc-ml-3",
14965
14970
  id: "pelcro-input-last-name",
14966
- label: t("labels.lastName"),
14967
- errorId: "pelcro-input-lastName-error"
14971
+ label: `${t("labels.lastName")}${nameFieldsRequired ? " *" : ""}`,
14972
+ errorId: "pelcro-input-lastName-error",
14973
+ required: showNameFields
14968
14974
  })), /*#__PURE__*/React__default.createElement(RegisterEmail, {
14969
14975
  id: "pelcro-input-email",
14970
14976
  errorId: "pelcro-input-email-error",
@@ -28804,23 +28810,21 @@ const CartContainer = _ref => {
28804
28810
  }
28805
28811
  });
28806
28812
  } else {
28807
- const userCurrency = window.Pelcro.user.read().currency;
28808
- const itemsCurrency = cartItems[0].currency;
28809
- if (userCurrency && userCurrency !== itemsCurrency) {
28810
- dispatch({
28811
- type: DISABLE_SUBMIT,
28812
- payload: true
28813
- });
28814
- dispatch({
28815
- type: SHOW_ALERT,
28816
- payload: {
28817
- type: "error",
28818
- content: t("messages.currencyMismatch", {
28819
- currency: userCurrency.toUpperCase()
28820
- })
28821
- }
28822
- });
28823
- }
28813
+ window.Pelcro.user.read().currency;
28814
+ cartItems[0].currency;
28815
+
28816
+ // if (userCurrency && userCurrency !== itemsCurrency) {
28817
+ // dispatch({ type: DISABLE_SUBMIT, payload: true });
28818
+ // dispatch({
28819
+ // type: SHOW_ALERT,
28820
+ // payload: {
28821
+ // type: "error",
28822
+ // content: t("messages.currencyMismatch", {
28823
+ // currency: userCurrency.toUpperCase()
28824
+ // })
28825
+ // }
28826
+ // });
28827
+ // }
28824
28828
  }
28825
28829
  }, [cartItems]);
28826
28830
  const submit = (state, dispatch) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pelcro/react-pelcro-js",
3
3
  "description": "Pelcro's React UI Elements",
4
- "version": "3.26.0-beta.72",
4
+ "version": "3.26.0-beta.74",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",