ui.shipaid.com 0.3.76 → 0.3.79
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 +18 -13
- package/dist/widget.iife.js +1 -1
- package/dist/widget.umd.js +1 -1
- package/package.json +1 -1
package/dist/widget.es.js
CHANGED
|
@@ -2946,19 +2946,26 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
2946
2946
|
contactlessCheckoutButtonTemplate() {
|
|
2947
2947
|
var _a, _b, _c, _d;
|
|
2948
2948
|
const styles2 = ((_d = (_c = (_b = (_a = this._store) == null ? void 0 : _a.widgetConfigurations) == null ? void 0 : _b.widget) == null ? void 0 : _c.theme_checkout) == null ? void 0 : _d.styles) || "";
|
|
2949
|
-
if (!document.getElementById("shipaid-styles") && styles2) {
|
|
2950
|
-
const
|
|
2951
|
-
|
|
2952
|
-
|
|
2949
|
+
if (!document.getElementById("shipaid-styles") && styles2.trim()) {
|
|
2950
|
+
const styleRules = styles2.split(";").map((rule) => rule.trim()).filter(Boolean);
|
|
2951
|
+
const shipaidCheckoutContainerStyles = styleRules.filter((rule) => rule.includes("shipaid-checkout-container")).join("; ");
|
|
2952
|
+
const shipaidCheckoutComponentStyles = styleRules.filter((rule) => !rule.includes("shipaid-checkout-container")).join("; ");
|
|
2953
|
+
console.log("Styles applied ===========>", { shipaidCheckoutContainerStyles, shipaidCheckoutComponentStyles });
|
|
2954
|
+
const styleElement = document.createElement("style");
|
|
2955
|
+
styleElement.id = "shipaid-styles";
|
|
2956
|
+
styleElement.textContent = `
|
|
2953
2957
|
checkout-package-protection {
|
|
2954
|
-
|
|
2955
|
-
justify-content: var(--shipaid-checkout-x-position, center);;
|
|
2956
|
-
display: flex;
|
|
2957
|
-
${styles2}
|
|
2958
|
+
${shipaidCheckoutComponentStyles};
|
|
2958
2959
|
}
|
|
2959
2960
|
|
|
2960
|
-
|
|
2961
|
-
|
|
2961
|
+
.shipaid-checkout-container {
|
|
2962
|
+
width: 100%;
|
|
2963
|
+
display: flex;
|
|
2964
|
+
${shipaidCheckoutContainerStyles};
|
|
2965
|
+
justify-content: var(--shipaid-checkout-container-x-position, center);
|
|
2966
|
+
}
|
|
2967
|
+
`.trim();
|
|
2968
|
+
document.head.appendChild(styleElement);
|
|
2962
2969
|
}
|
|
2963
2970
|
const originalCheckoutButtons = document.querySelectorAll(`${sessionStorage.getItem("shipaidWidgetTheme")}:not(#shipaid-checkout-button)`);
|
|
2964
2971
|
if (!originalCheckoutButtons.length) return;
|
|
@@ -2971,9 +2978,7 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
2971
2978
|
if (!container) {
|
|
2972
2979
|
container = document.createElement("div");
|
|
2973
2980
|
container.id = containerId;
|
|
2974
|
-
container.
|
|
2975
|
-
container.style.display = "flex";
|
|
2976
|
-
container.style.justifyContent = "center";
|
|
2981
|
+
container.className = "shipaid-checkout-container";
|
|
2977
2982
|
originalCheckoutButton.insertAdjacentElement("afterend", container);
|
|
2978
2983
|
}
|
|
2979
2984
|
const protectionPrice = Number((_a2 = this._protectionVariant) == null ? void 0 : _a2.price) || 0;
|
package/dist/widget.iife.js
CHANGED
|
@@ -1179,7 +1179,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1179
1179
|
@close=${()=>{this.persistPopup&&localStorage.removeItem(`${Ce}`),this._popup=null}}
|
|
1180
1180
|
@remove-protection=${()=>{this.removeProtection(),this.persistPopup&&localStorage.removeItem(`${Ce}`),this._popup=null}}
|
|
1181
1181
|
></shipaid-popup-confirmation>
|
|
1182
|
-
`}contactlessCheckoutButtonTemplate(){var t,e,i,o;const r=(null==(o=null==(i=null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)?void 0:i.theme_checkout)?void 0:o.styles)||"";if(!document.getElementById("shipaid-styles")&&r){const t=document.createElement("style");
|
|
1182
|
+
`}contactlessCheckoutButtonTemplate(){var t,e,i,o;const r=(null==(o=null==(i=null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)?void 0:i.theme_checkout)?void 0:o.styles)||"";if(!document.getElementById("shipaid-styles")&&r.trim()){const t=r.split(";").map((t=>t.trim())).filter(Boolean),e=t.filter((t=>t.includes("shipaid-checkout-container"))).join("; "),i=t.filter((t=>!t.includes("shipaid-checkout-container"))).join("; ");console.log("Styles applied ===========>",{shipaidCheckoutContainerStyles:e,shipaidCheckoutComponentStyles:i});const o=document.createElement("style");o.id="shipaid-styles",o.textContent=`\n checkout-package-protection {\n ${i};\n }\n\n .shipaid-checkout-container {\n width: 100%;\n display: flex;\n ${e};\n justify-content: var(--shipaid-checkout-container-x-position, center);\n }\n `.trim(),document.head.appendChild(o)}const n=document.querySelectorAll(`${sessionStorage.getItem("shipaidWidgetTheme")}:not(#shipaid-checkout-button)`);if(n.length)return n.forEach(((t,e)=>{var i,o,r;const n=`shipaid-checkout-container-${e}`;t.style.display="none";const a=t.className;let s=document.getElementById(n);s||(s=document.createElement("div"),s.id=n,s.className="shipaid-checkout-container",t.insertAdjacentElement("afterend",s));const p=Number(null==(i=this._protectionVariant)?void 0:i.price)||0,d=(Number(null==(o=this._cart)?void 0:o.total_price)||0)/100,l=this._hasProtectionInCart?d:p+d,c=H`
|
|
1183
1183
|
<svg width="1.5rem" height="1.5rem" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="4" class="shipaid-loader">
|
|
1184
1184
|
<circle cx="25" cy="25" r="20" stroke-opacity="0.5"/>
|
|
1185
1185
|
<path d="M45 25a20 20 0 0 1-40 0" stroke="currentColor">
|
package/dist/widget.umd.js
CHANGED
|
@@ -1179,7 +1179,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1179
1179
|
@close=${()=>{this.persistPopup&&localStorage.removeItem(`${Ce}`),this._popup=null}}
|
|
1180
1180
|
@remove-protection=${()=>{this.removeProtection(),this.persistPopup&&localStorage.removeItem(`${Ce}`),this._popup=null}}
|
|
1181
1181
|
></shipaid-popup-confirmation>
|
|
1182
|
-
`}contactlessCheckoutButtonTemplate(){var t,e,i,o;const r=(null==(o=null==(i=null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)?void 0:i.theme_checkout)?void 0:o.styles)||"";if(!document.getElementById("shipaid-styles")&&r){const t=document.createElement("style");
|
|
1182
|
+
`}contactlessCheckoutButtonTemplate(){var t,e,i,o;const r=(null==(o=null==(i=null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)?void 0:i.theme_checkout)?void 0:o.styles)||"";if(!document.getElementById("shipaid-styles")&&r.trim()){const t=r.split(";").map((t=>t.trim())).filter(Boolean),e=t.filter((t=>t.includes("shipaid-checkout-container"))).join("; "),i=t.filter((t=>!t.includes("shipaid-checkout-container"))).join("; ");console.log("Styles applied ===========>",{shipaidCheckoutContainerStyles:e,shipaidCheckoutComponentStyles:i});const o=document.createElement("style");o.id="shipaid-styles",o.textContent=`\n checkout-package-protection {\n ${i};\n }\n\n .shipaid-checkout-container {\n width: 100%;\n display: flex;\n ${e};\n justify-content: var(--shipaid-checkout-container-x-position, center);\n }\n `.trim(),document.head.appendChild(o)}const n=document.querySelectorAll(`${sessionStorage.getItem("shipaidWidgetTheme")}:not(#shipaid-checkout-button)`);if(n.length)return n.forEach(((t,e)=>{var i,o,r;const n=`shipaid-checkout-container-${e}`;t.style.display="none";const a=t.className;let s=document.getElementById(n);s||(s=document.createElement("div"),s.id=n,s.className="shipaid-checkout-container",t.insertAdjacentElement("afterend",s));const p=Number(null==(i=this._protectionVariant)?void 0:i.price)||0,d=(Number(null==(o=this._cart)?void 0:o.total_price)||0)/100,l=this._hasProtectionInCart?d:p+d,c=H`
|
|
1183
1183
|
<svg width="1.5rem" height="1.5rem" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="4" class="shipaid-loader">
|
|
1184
1184
|
<circle cx="25" cy="25" r="20" stroke-opacity="0.5"/>
|
|
1185
1185
|
<path d="M45 25a20 20 0 0 1-40 0" stroke="currentColor">
|