ui.shipaid.com 0.3.155 → 0.3.157
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/widget.es.js
CHANGED
|
@@ -3757,6 +3757,30 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
3757
3757
|
}
|
|
3758
3758
|
return x`${parts.map((p2) => x`${p2} `)}`;
|
|
3759
3759
|
};
|
|
3760
|
+
this.updated = (changedProperties) => {
|
|
3761
|
+
super.updated(changedProperties);
|
|
3762
|
+
if (!this._hasFinishedSetup) return;
|
|
3763
|
+
const dbContactlessSelector = this._getContactlessCheckoutSelector();
|
|
3764
|
+
const sessionSelector = sessionStorage.getItem("shipaidWidgetTheme");
|
|
3765
|
+
if (!sessionSelector && dbContactlessSelector) {
|
|
3766
|
+
sessionStorage.setItem("shipaidWidgetTheme", dbContactlessSelector);
|
|
3767
|
+
}
|
|
3768
|
+
if (this.useShipAidCheckout || !dbContactlessSelector) {
|
|
3769
|
+
sessionStorage.removeItem("shipaidWidgetTheme");
|
|
3770
|
+
}
|
|
3771
|
+
if (!this.useShipAidCheckout) {
|
|
3772
|
+
document.querySelectorAll('[id*="shipaid-checkout-container"]').forEach((container) => container.remove());
|
|
3773
|
+
}
|
|
3774
|
+
if (!this._shouldShowWidgetContent()) {
|
|
3775
|
+
const selector = sessionStorage.getItem("shipaidWidgetTheme") || this.dataSelector;
|
|
3776
|
+
if (selector) {
|
|
3777
|
+
this.getElementsBySelector(selector).forEach((button) => {
|
|
3778
|
+
button.removeAttribute("shipaid-hidden");
|
|
3779
|
+
});
|
|
3780
|
+
}
|
|
3781
|
+
this._restoreCheckoutButtonState();
|
|
3782
|
+
}
|
|
3783
|
+
};
|
|
3760
3784
|
}
|
|
3761
3785
|
shouldUpdate(props) {
|
|
3762
3786
|
return this.hasLoadedStrings && super.shouldUpdate(props);
|
|
@@ -5033,6 +5057,10 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
5033
5057
|
width: 100%;
|
|
5034
5058
|
}
|
|
5035
5059
|
|
|
5060
|
+
.shipaid-container {
|
|
5061
|
+
width: 100%;
|
|
5062
|
+
}
|
|
5063
|
+
|
|
5036
5064
|
.shipaid-container a#${this.buttonId || "shipaid-checkout-button"} {
|
|
5037
5065
|
width: 100%;
|
|
5038
5066
|
margin: 0px;
|
|
@@ -5518,30 +5546,6 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
5518
5546
|
}
|
|
5519
5547
|
this._restoreCheckoutButtonState();
|
|
5520
5548
|
}
|
|
5521
|
-
updated(changedProperties) {
|
|
5522
|
-
super.updated(changedProperties);
|
|
5523
|
-
if (!this._hasFinishedSetup) return;
|
|
5524
|
-
const dbContactlessSelector = this._getContactlessCheckoutSelector();
|
|
5525
|
-
const sessionSelector = sessionStorage.getItem("shipaidWidgetTheme");
|
|
5526
|
-
if (!sessionSelector && dbContactlessSelector) {
|
|
5527
|
-
sessionStorage.setItem("shipaidWidgetTheme", dbContactlessSelector);
|
|
5528
|
-
}
|
|
5529
|
-
if (this.useShipAidCheckout || !dbContactlessSelector) {
|
|
5530
|
-
sessionStorage.removeItem("shipaidWidgetTheme");
|
|
5531
|
-
}
|
|
5532
|
-
if (!this.useShipAidCheckout) {
|
|
5533
|
-
document.querySelectorAll('[id*="shipaid-checkout-container"]').forEach((container) => container.remove());
|
|
5534
|
-
}
|
|
5535
|
-
if (!this._shouldShowWidgetContent()) {
|
|
5536
|
-
const selector = sessionStorage.getItem("shipaidWidgetTheme") || this.dataSelector;
|
|
5537
|
-
if (selector) {
|
|
5538
|
-
this.getElementsBySelector(selector).forEach((button) => {
|
|
5539
|
-
button.removeAttribute("shipaid-hidden");
|
|
5540
|
-
});
|
|
5541
|
-
}
|
|
5542
|
-
this._restoreCheckoutButtonState();
|
|
5543
|
-
}
|
|
5544
|
-
}
|
|
5545
5549
|
async updateProtection(force = false) {
|
|
5546
5550
|
var _a, _b, _c;
|
|
5547
5551
|
this._cartLastUpdated = /* @__PURE__ */ new Date();
|