ui.shipaid.com 0.3.68 → 0.3.70
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/README.md +2 -0
- package/dist/widget.es.js +21 -22
- package/dist/widget.iife.js +8 -10
- package/dist/widget.umd.js +8 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -142,6 +142,8 @@ If you need to change any of the widget colors to suit a specific theme, there a
|
|
|
142
142
|
| `--shipaid-prompt-product-actions-content` | Changes the spaces between price and add/remove button | `var(--shipaid-prompt-product-actions-content, space-between)` |
|
|
143
143
|
| `--shipaid-prompt-footer-topMargin` | Changes margin between header and badge footer | `var(--shipaid-prompt-footer-topMargin, 0px)` |
|
|
144
144
|
| `-shipaid-prompt-footer-display` | Changes the display option for footer | `var(-shipaid-prompt-footer-display, flex)` |
|
|
145
|
+
| `--shipaid-active-logo-color` | Changes the logo color when the product is in the cart | `#000000` |
|
|
146
|
+
| `--shipaid-inactive-logo-color` | Changes the logo color when the product isn't in the cart | `#0056d6` |
|
|
145
147
|
|
|
146
148
|
Other variables can be found [here](/widget/src/assets/styles.ts) (`/widget/src/assets/styles.ts`).
|
|
147
149
|
|
package/dist/widget.es.js
CHANGED
|
@@ -2943,25 +2943,26 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
2943
2943
|
// `
|
|
2944
2944
|
// }
|
|
2945
2945
|
contactlessCheckoutButtonTemplate() {
|
|
2946
|
-
|
|
2946
|
+
var _a, _b, _c, _d;
|
|
2947
|
+
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) || "";
|
|
2948
|
+
if (!document.getElementById("shipaid-styles") && styles2) {
|
|
2947
2949
|
const style = document.createElement("style");
|
|
2948
2950
|
style.id = "shipaid-styles";
|
|
2949
2951
|
style.textContent = `
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
shipaid-widget {
|
|
2954
|
-
width: 100%;
|
|
2952
|
+
checkout-package-protection {
|
|
2953
|
+
${styles2}
|
|
2954
|
+
width: var(--shipaid-checkout-width, 100%);
|
|
2955
2955
|
}
|
|
2956
|
+
|
|
2956
2957
|
`;
|
|
2957
2958
|
document.head.appendChild(style);
|
|
2958
2959
|
}
|
|
2959
2960
|
const originalCheckoutButtons = document.querySelectorAll(`${sessionStorage.getItem("shipaidWidgetTheme")}:not(#shipaid-checkout-button)`);
|
|
2960
2961
|
if (!originalCheckoutButtons.length) return;
|
|
2961
2962
|
originalCheckoutButtons.forEach((originalCheckoutButton, index) => {
|
|
2962
|
-
var
|
|
2963
|
+
var _a2, _b2;
|
|
2963
2964
|
const containerId = `shipaid-checkout-container-${index}`;
|
|
2964
|
-
originalCheckoutButton.
|
|
2965
|
+
originalCheckoutButton.style.display = "none";
|
|
2965
2966
|
const originalClasses = originalCheckoutButton.className;
|
|
2966
2967
|
let container = document.getElementById(containerId);
|
|
2967
2968
|
if (!container) {
|
|
@@ -2970,8 +2971,8 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
2970
2971
|
container.style.width = "100%";
|
|
2971
2972
|
originalCheckoutButton.insertAdjacentElement("afterend", container);
|
|
2972
2973
|
}
|
|
2973
|
-
const protectionPrice = Number((
|
|
2974
|
-
const cartPrice = (Number((
|
|
2974
|
+
const protectionPrice = Number((_a2 = this._protectionVariant) == null ? void 0 : _a2.price) || 0;
|
|
2975
|
+
const cartPrice = (Number((_b2 = this._cart) == null ? void 0 : _b2.total_price) || 0) / 100;
|
|
2975
2976
|
const cartTotal = !this._hasProtectionInCart ? protectionPrice + cartPrice : cartPrice;
|
|
2976
2977
|
const loading2 = x`
|
|
2977
2978
|
<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">
|
|
@@ -2984,11 +2985,6 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
2984
2985
|
D(
|
|
2985
2986
|
x`
|
|
2986
2987
|
<style>
|
|
2987
|
-
:host {
|
|
2988
|
-
display: inline-block;
|
|
2989
|
-
font-family: Arial, sans-serif;
|
|
2990
|
-
width: 100%;
|
|
2991
|
-
}
|
|
2992
2988
|
.shipaid-container button {
|
|
2993
2989
|
width: 100%;
|
|
2994
2990
|
}
|
|
@@ -2999,7 +2995,7 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
2999
2995
|
display: flex;
|
|
3000
2996
|
align-items: center;
|
|
3001
2997
|
justify-content: space-between;
|
|
3002
|
-
font-size: 14px;
|
|
2998
|
+
font-size: var(--shipaid-checkout-font-size, 14px);
|
|
3003
2999
|
margin-bottom: 1rem;
|
|
3004
3000
|
}
|
|
3005
3001
|
.protection-text {
|
|
@@ -3008,9 +3004,8 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
3008
3004
|
align-items: center;
|
|
3009
3005
|
gap: 0.5rem;
|
|
3010
3006
|
}
|
|
3011
|
-
|
|
3012
3007
|
.protection-text p {
|
|
3013
|
-
|
|
3008
|
+
margin: 0px;
|
|
3014
3009
|
}
|
|
3015
3010
|
.help-icon {
|
|
3016
3011
|
cursor: pointer;
|
|
@@ -3063,9 +3058,9 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
3063
3058
|
}
|
|
3064
3059
|
}}
|
|
3065
3060
|
@shipaid-add-protection=${() => {
|
|
3066
|
-
var
|
|
3067
|
-
sessionStorage.setItem("shipaid_variant", JSON.stringify((
|
|
3068
|
-
window.location.href = `/checkout?attributes[_shipaid-internal]=1&updates[${(
|
|
3061
|
+
var _a3, _b3;
|
|
3062
|
+
sessionStorage.setItem("shipaid_variant", JSON.stringify((_a3 = this._protectionVariant) == null ? void 0 : _a3.id));
|
|
3063
|
+
window.location.href = `/checkout?attributes[_shipaid-internal]=1&updates[${(_b3 = this._protectionVariant) == null ? void 0 : _b3.id}]=1`;
|
|
3069
3064
|
}}
|
|
3070
3065
|
@shipaid-remove-protection=${async () => {
|
|
3071
3066
|
await this.removeProtection();
|
|
@@ -3130,7 +3125,7 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
3130
3125
|
display: flex;
|
|
3131
3126
|
align-items: center;
|
|
3132
3127
|
justify-content: space-between;
|
|
3133
|
-
font-size:
|
|
3128
|
+
font-size: calc(0.1rem + 0.334vw);
|
|
3134
3129
|
margin-bottom: 1rem;
|
|
3135
3130
|
}
|
|
3136
3131
|
|
|
@@ -3142,6 +3137,10 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
3142
3137
|
font-size: 1.3rem;
|
|
3143
3138
|
}
|
|
3144
3139
|
|
|
3140
|
+
.protection-text p {
|
|
3141
|
+
margin: 0px;
|
|
3142
|
+
}
|
|
3143
|
+
|
|
3145
3144
|
.help-icon {
|
|
3146
3145
|
cursor: pointer;
|
|
3147
3146
|
opacity: 0.7;
|
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(){if(!document.getElementById("shipaid-styles")){const t=document.createElement("style");t.id="shipaid-styles",t.textContent
|
|
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");t.id="shipaid-styles",t.textContent=`\n checkout-package-protection {\n ${r}\n width: var(--shipaid-checkout-width, 100%);\n }\n\n `,document.head.appendChild(t)}const n=document.querySelectorAll(`${sessionStorage.getItem("shipaidWidgetTheme")}:not(#shipaid-checkout-button)`);if(n.length)return n.forEach(((t,e)=>{var i,o;const r=`shipaid-checkout-container-${e}`;t.style.display="none";const n=t.className;let s=document.getElementById(r);s||(s=document.createElement("div"),s.id=r,s.style.width="100%",t.insertAdjacentElement("afterend",s));const a=Number(null==(i=this._protectionVariant)?void 0:i.price)||0,d=(Number(null==(o=this._cart)?void 0:o.total_price)||0)/100,p=this._hasProtectionInCart?d:a+d,l=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">
|
|
@@ -1188,11 +1188,6 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1188
1188
|
</svg>
|
|
1189
1189
|
`;pt(H`
|
|
1190
1190
|
<style>
|
|
1191
|
-
:host {
|
|
1192
|
-
display: inline-block;
|
|
1193
|
-
font-family: Arial, sans-serif;
|
|
1194
|
-
width: 100%;
|
|
1195
|
-
}
|
|
1196
1191
|
.shipaid-container button {
|
|
1197
1192
|
width: 100%;
|
|
1198
1193
|
}
|
|
@@ -1203,7 +1198,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1203
1198
|
display: flex;
|
|
1204
1199
|
align-items: center;
|
|
1205
1200
|
justify-content: space-between;
|
|
1206
|
-
font-size: 14px;
|
|
1201
|
+
font-size: var(--shipaid-checkout-font-size, 14px);
|
|
1207
1202
|
margin-bottom: 1rem;
|
|
1208
1203
|
}
|
|
1209
1204
|
.protection-text {
|
|
@@ -1212,9 +1207,8 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1212
1207
|
align-items: center;
|
|
1213
1208
|
gap: 0.5rem;
|
|
1214
1209
|
}
|
|
1215
|
-
|
|
1216
1210
|
.protection-text p {
|
|
1217
|
-
|
|
1211
|
+
margin: 0px;
|
|
1218
1212
|
}
|
|
1219
1213
|
.help-icon {
|
|
1220
1214
|
cursor: pointer;
|
|
@@ -1291,7 +1285,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1291
1285
|
display: flex;
|
|
1292
1286
|
align-items: center;
|
|
1293
1287
|
justify-content: space-between;
|
|
1294
|
-
font-size:
|
|
1288
|
+
font-size: calc(0.1rem + 0.334vw);
|
|
1295
1289
|
margin-bottom: 1rem;
|
|
1296
1290
|
}
|
|
1297
1291
|
|
|
@@ -1303,6 +1297,10 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1303
1297
|
font-size: 1.3rem;
|
|
1304
1298
|
}
|
|
1305
1299
|
|
|
1300
|
+
.protection-text p {
|
|
1301
|
+
margin: 0px;
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1306
1304
|
.help-icon {
|
|
1307
1305
|
cursor: pointer;
|
|
1308
1306
|
opacity: 0.7;
|
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(){if(!document.getElementById("shipaid-styles")){const t=document.createElement("style");t.id="shipaid-styles",t.textContent
|
|
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");t.id="shipaid-styles",t.textContent=`\n checkout-package-protection {\n ${r}\n width: var(--shipaid-checkout-width, 100%);\n }\n\n `,document.head.appendChild(t)}const n=document.querySelectorAll(`${sessionStorage.getItem("shipaidWidgetTheme")}:not(#shipaid-checkout-button)`);if(n.length)return n.forEach(((t,e)=>{var i,o;const r=`shipaid-checkout-container-${e}`;t.style.display="none";const n=t.className;let s=document.getElementById(r);s||(s=document.createElement("div"),s.id=r,s.style.width="100%",t.insertAdjacentElement("afterend",s));const a=Number(null==(i=this._protectionVariant)?void 0:i.price)||0,d=(Number(null==(o=this._cart)?void 0:o.total_price)||0)/100,p=this._hasProtectionInCart?d:a+d,l=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">
|
|
@@ -1188,11 +1188,6 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1188
1188
|
</svg>
|
|
1189
1189
|
`;pt(H`
|
|
1190
1190
|
<style>
|
|
1191
|
-
:host {
|
|
1192
|
-
display: inline-block;
|
|
1193
|
-
font-family: Arial, sans-serif;
|
|
1194
|
-
width: 100%;
|
|
1195
|
-
}
|
|
1196
1191
|
.shipaid-container button {
|
|
1197
1192
|
width: 100%;
|
|
1198
1193
|
}
|
|
@@ -1203,7 +1198,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1203
1198
|
display: flex;
|
|
1204
1199
|
align-items: center;
|
|
1205
1200
|
justify-content: space-between;
|
|
1206
|
-
font-size: 14px;
|
|
1201
|
+
font-size: var(--shipaid-checkout-font-size, 14px);
|
|
1207
1202
|
margin-bottom: 1rem;
|
|
1208
1203
|
}
|
|
1209
1204
|
.protection-text {
|
|
@@ -1212,9 +1207,8 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1212
1207
|
align-items: center;
|
|
1213
1208
|
gap: 0.5rem;
|
|
1214
1209
|
}
|
|
1215
|
-
|
|
1216
1210
|
.protection-text p {
|
|
1217
|
-
|
|
1211
|
+
margin: 0px;
|
|
1218
1212
|
}
|
|
1219
1213
|
.help-icon {
|
|
1220
1214
|
cursor: pointer;
|
|
@@ -1291,7 +1285,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1291
1285
|
display: flex;
|
|
1292
1286
|
align-items: center;
|
|
1293
1287
|
justify-content: space-between;
|
|
1294
|
-
font-size:
|
|
1288
|
+
font-size: calc(0.1rem + 0.334vw);
|
|
1295
1289
|
margin-bottom: 1rem;
|
|
1296
1290
|
}
|
|
1297
1291
|
|
|
@@ -1303,6 +1297,10 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1303
1297
|
font-size: 1.3rem;
|
|
1304
1298
|
}
|
|
1305
1299
|
|
|
1300
|
+
.protection-text p {
|
|
1301
|
+
margin: 0px;
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1306
1304
|
.help-icon {
|
|
1307
1305
|
cursor: pointer;
|
|
1308
1306
|
opacity: 0.7;
|