ui.shipaid.com 0.3.84 → 0.3.85

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
@@ -3092,7 +3092,7 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
3092
3092
  return this.useShipAidCheckout ? this : super.createRenderRoot();
3093
3093
  }
3094
3094
  checkoutButtonTemplate() {
3095
- var _a, _b;
3095
+ var _a, _b, _c, _d;
3096
3096
  if (!document.getElementById("shipaid-styles")) {
3097
3097
  const style = document.createElement("style");
3098
3098
  style.id = "shipaid-styles";
@@ -3146,6 +3146,16 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
3146
3146
  width: 100%;
3147
3147
  }
3148
3148
 
3149
+ .shipaid-container a#shipaid-checkout-button {
3150
+ width: 100%;
3151
+ margin: 0px;
3152
+ text-decoration: unset;
3153
+ }
3154
+ .shipaid-container a#shipaid-continue-button {
3155
+ display: block;
3156
+ margin: 1rem 0px 0px;
3157
+ }
3158
+
3149
3159
  .shipaid-container button {
3150
3160
  width: 100%;
3151
3161
  }
@@ -3241,13 +3251,12 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
3241
3251
  </div>
3242
3252
  </div>
3243
3253
 
3244
- <button id="shipaid-checkout-button" class="${originalClasses}" @click=${() => {
3245
- var _a2, _b2;
3254
+ <a href="/checkout${((_c = this._protectionVariant) == null ? void 0 : _c.id) ? `?attributes[_shipaid-internal]=1&updates[${(_d = this._protectionVariant) == null ? void 0 : _d.id}]=1` : ""}" id="shipaid-checkout-button" class="${originalClasses}" @click=${() => {
3255
+ var _a2;
3246
3256
  sessionStorage.setItem("shipaid_variant", JSON.stringify((_a2 = this._protectionVariant) == null ? void 0 : _a2.id));
3247
- window.location.href = `/checkout?attributes[_shipaid-internal]=1&updates[${(_b2 = this._protectionVariant) == null ? void 0 : _b2.id}]=1`;
3248
3257
  }}>
3249
3258
  <slot name="checkout-button-text">CHECKOUT+</slot> ${cartTotal ? this._currencyFormat(cartTotal) : loading2}
3250
- </button>
3259
+ </a>
3251
3260
 
3252
3261
  <a href="#" class="continue-link" @click=${async () => {
3253
3262
  await this.removeProtection();
@@ -1267,7 +1267,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
1267
1267
  @shipaid-about=${()=>{this._popup="learn-more",this.persistPopup&&this.setPopupKey()}}
1268
1268
  @shipaid-remove-protection=${async()=>{await this.removeProtection(),window.location.href="/checkout"}}
1269
1269
  ></checkout-package-protection>
1270
- `,s)})),Z}createRenderRoot(){return this.useShipAidCheckout?this:super.createRenderRoot()}checkoutButtonTemplate(){var t,e;if(!document.getElementById("shipaid-styles")){const t=document.createElement("style");t.id="shipaid-styles",t.textContent="\n [shipaid-hidden] {\n display: none !important;\n }\n shipaid-widget {\n width: 100%;\n }\n ",document.head.appendChild(t)}if(!this.dataSelector)return void console.error("[shipaid-widget] we couldn't find the 'data-selector' attribute.");let i=null;if(this.shadowRootSelector){const t=document.querySelector(this.shadowRootSelector);if(!t||!t.shadowRoot)return void console.warn(`ShadowRoot not found in the element '${this.shadowRootSelector}'.`);i=t.shadowRoot.querySelector(`${this.dataSelector}:not(#shipaid-checkout-button)`)}else i=document.querySelector(`${this.dataSelector}:not(#shipaid-checkout-button)`);if(!i)return void console.warn(`Button not found with selector '${this.dataSelector}'.`);const o=i.className,r=Number(null==(t=this._protectionVariant)?void 0:t.price)||0,n=(Number(null==(e=this._cart)?void 0:e.total_price)||0)/100,a=this._hasProtectionInCart?n:r+n,s=H`
1270
+ `,s)})),Z}createRenderRoot(){return this.useShipAidCheckout?this:super.createRenderRoot()}checkoutButtonTemplate(){var t,e,i,o;if(!document.getElementById("shipaid-styles")){const t=document.createElement("style");t.id="shipaid-styles",t.textContent="\n [shipaid-hidden] {\n display: none !important;\n }\n shipaid-widget {\n width: 100%;\n }\n ",document.head.appendChild(t)}if(!this.dataSelector)return void console.error("[shipaid-widget] we couldn't find the 'data-selector' attribute.");let r=null;if(this.shadowRootSelector){const t=document.querySelector(this.shadowRootSelector);if(!t||!t.shadowRoot)return void console.warn(`ShadowRoot not found in the element '${this.shadowRootSelector}'.`);r=t.shadowRoot.querySelector(`${this.dataSelector}:not(#shipaid-checkout-button)`)}else r=document.querySelector(`${this.dataSelector}:not(#shipaid-checkout-button)`);if(!r)return void console.warn(`Button not found with selector '${this.dataSelector}'.`);const n=r.className,a=Number(null==(t=this._protectionVariant)?void 0:t.price)||0,s=(Number(null==(e=this._cart)?void 0:e.total_price)||0)/100,d=this._hasProtectionInCart?s:a+s,p=H`
1271
1271
  <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">
1272
1272
  <circle cx="25" cy="25" r="20" stroke-opacity="0.5"/>
1273
1273
  <path d="M45 25a20 20 0 0 1-40 0" stroke="currentColor">
@@ -1282,6 +1282,16 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
1282
1282
  width: 100%;
1283
1283
  }
1284
1284
 
1285
+ .shipaid-container a#shipaid-checkout-button {
1286
+ width: 100%;
1287
+ margin: 0px;
1288
+ text-decoration: unset;
1289
+ }
1290
+ .shipaid-container a#shipaid-continue-button {
1291
+ display: block;
1292
+ margin: 1rem 0px 0px;
1293
+ }
1294
+
1285
1295
  .shipaid-container button {
1286
1296
  width: 100%;
1287
1297
  }
@@ -1361,7 +1371,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
1361
1371
  <strong>Checkout+</strong>
1362
1372
  <div class="protection-value">
1363
1373
  <slot name="title">ShipAid Delivery Guarantee</slot>
1364
- - ${r?this._currencyFormat(r):s}
1374
+ - ${a?this._currencyFormat(a):p}
1365
1375
  </div>
1366
1376
  </div>
1367
1377
  <div class="help-icon" @click=${()=>{this._popup="learn-more",this.persistPopup&&this.setPopupKey()}}>
@@ -1372,9 +1382,9 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
1372
1382
  </div>
1373
1383
  </div>
1374
1384
 
1375
- <button id="shipaid-checkout-button" class="${o}" @click=${()=>{var t,e;sessionStorage.setItem("shipaid_variant",JSON.stringify(null==(t=this._protectionVariant)?void 0:t.id)),window.location.href=`/checkout?attributes[_shipaid-internal]=1&updates[${null==(e=this._protectionVariant)?void 0:e.id}]=1`}}>
1376
- <slot name="checkout-button-text">CHECKOUT+</slot> ${a?this._currencyFormat(a):s}
1377
- </button>
1385
+ <a href="/checkout${(null==(i=this._protectionVariant)?void 0:i.id)?`?attributes[_shipaid-internal]=1&updates[${null==(o=this._protectionVariant)?void 0:o.id}]=1`:""}" id="shipaid-checkout-button" class="${n}" @click=${()=>{var t;sessionStorage.setItem("shipaid_variant",JSON.stringify(null==(t=this._protectionVariant)?void 0:t.id))}}>
1386
+ <slot name="checkout-button-text">CHECKOUT+</slot> ${d?this._currencyFormat(d):p}
1387
+ </a>
1378
1388
 
1379
1389
  <a href="#" class="continue-link" @click=${async()=>{await this.removeProtection(),window.location.href="/checkout"}}>
1380
1390
  <slot name="link-continue">Continue without delivery guarantee</slot>
@@ -1267,7 +1267,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
1267
1267
  @shipaid-about=${()=>{this._popup="learn-more",this.persistPopup&&this.setPopupKey()}}
1268
1268
  @shipaid-remove-protection=${async()=>{await this.removeProtection(),window.location.href="/checkout"}}
1269
1269
  ></checkout-package-protection>
1270
- `,s)})),Z}createRenderRoot(){return this.useShipAidCheckout?this:super.createRenderRoot()}checkoutButtonTemplate(){var t,e;if(!document.getElementById("shipaid-styles")){const t=document.createElement("style");t.id="shipaid-styles",t.textContent="\n [shipaid-hidden] {\n display: none !important;\n }\n shipaid-widget {\n width: 100%;\n }\n ",document.head.appendChild(t)}if(!this.dataSelector)return void console.error("[shipaid-widget] we couldn't find the 'data-selector' attribute.");let i=null;if(this.shadowRootSelector){const t=document.querySelector(this.shadowRootSelector);if(!t||!t.shadowRoot)return void console.warn(`ShadowRoot not found in the element '${this.shadowRootSelector}'.`);i=t.shadowRoot.querySelector(`${this.dataSelector}:not(#shipaid-checkout-button)`)}else i=document.querySelector(`${this.dataSelector}:not(#shipaid-checkout-button)`);if(!i)return void console.warn(`Button not found with selector '${this.dataSelector}'.`);const o=i.className,r=Number(null==(t=this._protectionVariant)?void 0:t.price)||0,n=(Number(null==(e=this._cart)?void 0:e.total_price)||0)/100,a=this._hasProtectionInCart?n:r+n,s=H`
1270
+ `,s)})),Z}createRenderRoot(){return this.useShipAidCheckout?this:super.createRenderRoot()}checkoutButtonTemplate(){var t,e,i,o;if(!document.getElementById("shipaid-styles")){const t=document.createElement("style");t.id="shipaid-styles",t.textContent="\n [shipaid-hidden] {\n display: none !important;\n }\n shipaid-widget {\n width: 100%;\n }\n ",document.head.appendChild(t)}if(!this.dataSelector)return void console.error("[shipaid-widget] we couldn't find the 'data-selector' attribute.");let r=null;if(this.shadowRootSelector){const t=document.querySelector(this.shadowRootSelector);if(!t||!t.shadowRoot)return void console.warn(`ShadowRoot not found in the element '${this.shadowRootSelector}'.`);r=t.shadowRoot.querySelector(`${this.dataSelector}:not(#shipaid-checkout-button)`)}else r=document.querySelector(`${this.dataSelector}:not(#shipaid-checkout-button)`);if(!r)return void console.warn(`Button not found with selector '${this.dataSelector}'.`);const n=r.className,a=Number(null==(t=this._protectionVariant)?void 0:t.price)||0,s=(Number(null==(e=this._cart)?void 0:e.total_price)||0)/100,d=this._hasProtectionInCart?s:a+s,p=H`
1271
1271
  <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">
1272
1272
  <circle cx="25" cy="25" r="20" stroke-opacity="0.5"/>
1273
1273
  <path d="M45 25a20 20 0 0 1-40 0" stroke="currentColor">
@@ -1282,6 +1282,16 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
1282
1282
  width: 100%;
1283
1283
  }
1284
1284
 
1285
+ .shipaid-container a#shipaid-checkout-button {
1286
+ width: 100%;
1287
+ margin: 0px;
1288
+ text-decoration: unset;
1289
+ }
1290
+ .shipaid-container a#shipaid-continue-button {
1291
+ display: block;
1292
+ margin: 1rem 0px 0px;
1293
+ }
1294
+
1285
1295
  .shipaid-container button {
1286
1296
  width: 100%;
1287
1297
  }
@@ -1361,7 +1371,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
1361
1371
  <strong>Checkout+</strong>
1362
1372
  <div class="protection-value">
1363
1373
  <slot name="title">ShipAid Delivery Guarantee</slot>
1364
- - ${r?this._currencyFormat(r):s}
1374
+ - ${a?this._currencyFormat(a):p}
1365
1375
  </div>
1366
1376
  </div>
1367
1377
  <div class="help-icon" @click=${()=>{this._popup="learn-more",this.persistPopup&&this.setPopupKey()}}>
@@ -1372,9 +1382,9 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
1372
1382
  </div>
1373
1383
  </div>
1374
1384
 
1375
- <button id="shipaid-checkout-button" class="${o}" @click=${()=>{var t,e;sessionStorage.setItem("shipaid_variant",JSON.stringify(null==(t=this._protectionVariant)?void 0:t.id)),window.location.href=`/checkout?attributes[_shipaid-internal]=1&updates[${null==(e=this._protectionVariant)?void 0:e.id}]=1`}}>
1376
- <slot name="checkout-button-text">CHECKOUT+</slot> ${a?this._currencyFormat(a):s}
1377
- </button>
1385
+ <a href="/checkout${(null==(i=this._protectionVariant)?void 0:i.id)?`?attributes[_shipaid-internal]=1&updates[${null==(o=this._protectionVariant)?void 0:o.id}]=1`:""}" id="shipaid-checkout-button" class="${n}" @click=${()=>{var t;sessionStorage.setItem("shipaid_variant",JSON.stringify(null==(t=this._protectionVariant)?void 0:t.id))}}>
1386
+ <slot name="checkout-button-text">CHECKOUT+</slot> ${d?this._currencyFormat(d):p}
1387
+ </a>
1378
1388
 
1379
1389
  <a href="#" class="continue-link" @click=${async()=>{await this.removeProtection(),window.location.href="/checkout"}}>
1380
1390
  <slot name="link-continue">Continue without delivery guarantee</slot>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ui.shipaid.com",
3
3
  "private": false,
4
- "version": "0.3.84",
4
+ "version": "0.3.85",
5
5
  "type": "module",
6
6
  "main": "dist/widget.umd.js",
7
7
  "unpkg": "dist/widget.iife.js",