@pelcro/react-pelcro-js 2.6.0-beta.7 → 2.6.0-beta.8

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
@@ -13580,7 +13580,16 @@ const PaymentMethodContainerWithoutStripe = ({
13580
13580
  const UnwrappedForm = es_12(PaymentMethodContainerWithoutStripe);
13581
13581
 
13582
13582
  const PaymentMethodContainer = props => {
13583
- if (window.Stripe) {
13583
+ const [isStripeLoaded, setIsStripeLoaded] = React.useState(Boolean(window.Stripe));
13584
+ React.useEffect(() => {
13585
+ if (!window.Stripe) {
13586
+ document.querySelector('script[src="https://js.stripe.com/v3"]').addEventListener("load", () => {
13587
+ setIsStripeLoaded(true);
13588
+ });
13589
+ }
13590
+ }, []);
13591
+
13592
+ if (isStripeLoaded) {
13584
13593
  return /*#__PURE__*/React__default['default'].createElement(es_13, {
13585
13594
  apiKey: window.Pelcro.environment.stripe,
13586
13595
  stripeAccount: window.Pelcro.site.read().account_id,
package/dist/index.esm.js CHANGED
@@ -13550,7 +13550,16 @@ const PaymentMethodContainerWithoutStripe = ({
13550
13550
  const UnwrappedForm = es_12(PaymentMethodContainerWithoutStripe);
13551
13551
 
13552
13552
  const PaymentMethodContainer = props => {
13553
- if (window.Stripe) {
13553
+ const [isStripeLoaded, setIsStripeLoaded] = useState(Boolean(window.Stripe));
13554
+ useEffect(() => {
13555
+ if (!window.Stripe) {
13556
+ document.querySelector('script[src="https://js.stripe.com/v3"]').addEventListener("load", () => {
13557
+ setIsStripeLoaded(true);
13558
+ });
13559
+ }
13560
+ }, []);
13561
+
13562
+ if (isStripeLoaded) {
13554
13563
  return /*#__PURE__*/React__default.createElement(es_13, {
13555
13564
  apiKey: window.Pelcro.environment.stripe,
13556
13565
  stripeAccount: window.Pelcro.site.read().account_id,
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": "2.6.0-beta.7",
4
+ "version": "2.6.0-beta.8",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",
@@ -59,7 +59,6 @@
59
59
  "browserslist": "^4.16.3",
60
60
  "cross-env": "^7.0.3",
61
61
  "css-loader": "^3.2.0",
62
- "cssimportant-loader": "^0.4.0",
63
62
  "cz-conventional-changelog": "3.3.0",
64
63
  "eslint": "^7.19.0",
65
64
  "eslint-config-google": "^0.14.0",
@@ -74,7 +73,6 @@
74
73
  "html-webpack-plugin": "^3.2.0",
75
74
  "image-webpack-loader": "^7.0.1",
76
75
  "jest": "^26.6.3",
77
- "node-sass": "^4.14.1",
78
76
  "postcss": "^8.2.4",
79
77
  "postcss-import": "^14.0.0",
80
78
  "postcss-loader": "4.2.0",
@@ -92,7 +90,6 @@
92
90
  "rollup-plugin-peer-deps-external": "^2.2.4",
93
91
  "rollup-plugin-postcss": "^4.0.0",
94
92
  "rollup-plugin-visualizer": "^4.2.0",
95
- "sass-loader": "^7.1.0",
96
93
  "semantic-release": "^17.4.4",
97
94
  "simple-zustand-devtools": "^1.0.0",
98
95
  "style-loader": "^2.0.0",