ui.shipaid.com 0.3.129 → 0.3.131
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 +314 -6
- package/dist/widget.iife.js +356 -56
- package/dist/widget.umd.js +356 -56
- package/dist-types/widget/src/assets/learn-more-styles.d.ts +2 -2
- package/dist-types/widget/src/components/learn-more-popup.d.ts +6 -7
- package/dist-types/widget/src/components/shipaid-green-protection-popup.d.ts +6 -6
- package/dist-types/widget/src/components/shipaid-leanr-more-carousel.d.ts +30 -0
- package/dist-types/widget/src/components/shipaid-learn-more-carousel.d.ts +13 -13
- package/dist-types/widget/src/entry-add-to-cart-plus.d.ts +1 -0
- package/dist-types/widget/src/entry-bootstrap.d.ts +1 -0
- package/dist-types/widget/src/entry-v2.d.ts +2 -0
- package/dist-types/widget/src/shipaid-add-to-cart-plus.d.ts +62 -0
- package/dist-types/widget/src/shipaid-widget-v2.d.ts +62 -0
- package/package.json +1 -1
- package/dist-types/widget/src/components/product-add-confirmation.d.ts +0 -13
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const styles: import(
|
|
2
|
-
export default styles
|
|
1
|
+
declare const styles: import('lit').CSSResult
|
|
2
|
+
export default styles
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { LitElement
|
|
2
|
-
import './shipaid-learn-more-carousel';
|
|
1
|
+
import { LitElement } from 'lit'
|
|
3
2
|
declare class LearnMorePopup extends LitElement {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
static styles: import('lit').CSSResult
|
|
4
|
+
active: boolean
|
|
5
|
+
handleClosePopup(): void
|
|
6
|
+
render(): import('lit').TemplateResult<1>
|
|
8
7
|
}
|
|
9
|
-
export default LearnMorePopup
|
|
8
|
+
export default LearnMorePopup
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { LitElement } from 'lit'
|
|
1
|
+
import { LitElement } from 'lit'
|
|
2
2
|
declare class GreenProtectionHelpPopup extends LitElement {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
static styles: import('lit').CSSResult
|
|
4
|
+
active: boolean
|
|
5
|
+
handleClosePopup(): void
|
|
6
|
+
render(): import('lit').TemplateResult<1>
|
|
7
7
|
}
|
|
8
|
-
export default GreenProtectionHelpPopup
|
|
8
|
+
export default GreenProtectionHelpPopup
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { LitElement } from 'lit'
|
|
2
|
+
export declare class ShipAidCarousel extends LitElement {
|
|
3
|
+
static styles: import('lit').CSSResult
|
|
4
|
+
slideImages: string[]
|
|
5
|
+
currentSlide: number
|
|
6
|
+
visible: boolean
|
|
7
|
+
private isDragging
|
|
8
|
+
private startX
|
|
9
|
+
private initialOffset
|
|
10
|
+
private cardWidth
|
|
11
|
+
private gap
|
|
12
|
+
private wrapper
|
|
13
|
+
private container
|
|
14
|
+
firstUpdated(): void
|
|
15
|
+
closeModal(): void
|
|
16
|
+
private onDragStart
|
|
17
|
+
private onDragMove
|
|
18
|
+
private onDragEnd
|
|
19
|
+
private onOverlayClick
|
|
20
|
+
private onCloseKeyDown
|
|
21
|
+
updatePosition(): void
|
|
22
|
+
private prevSlide
|
|
23
|
+
private nextSlide
|
|
24
|
+
render(): import('lit').TemplateResult<1> | null
|
|
25
|
+
}
|
|
26
|
+
declare global {
|
|
27
|
+
interface HTMLElementTagNameMap {
|
|
28
|
+
'shipaid-learn-more-carousel': ShipAidCarousel;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export declare class ShipAidLearnMoreCarousel extends HTMLElement {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
private modal
|
|
3
|
+
private close
|
|
4
|
+
private boxesWrapper
|
|
5
|
+
private prevBtn
|
|
6
|
+
private nextBtn
|
|
7
|
+
private totalSlides
|
|
8
|
+
private currentSlide
|
|
9
|
+
private getSlide1
|
|
10
|
+
private getSlide2
|
|
11
|
+
private getSlide3
|
|
12
|
+
private getSlide4
|
|
13
|
+
private updateSlider
|
|
14
|
+
connectedCallback(): void
|
|
15
15
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './shipaid-add-to-cart-plus'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './shipaid-widget'
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { LitElement, nothing } from 'lit'
|
|
2
|
+
export declare class ShipAidAddToCartPlus extends LitElement {
|
|
3
|
+
static styles: import('lit').CSSResult
|
|
4
|
+
private addToCartButton
|
|
5
|
+
private addToCartForm
|
|
6
|
+
private originalAtcLabel
|
|
7
|
+
private productData
|
|
8
|
+
private storeData
|
|
9
|
+
private protectionVariantId
|
|
10
|
+
private productVariantId
|
|
11
|
+
private productPriceCents
|
|
12
|
+
private widgetLoadedHandler?
|
|
13
|
+
private protectionStatusHandler?
|
|
14
|
+
private formChangeHandler?
|
|
15
|
+
private documentVariantHandler?
|
|
16
|
+
private guardObserver?
|
|
17
|
+
private guardTimer
|
|
18
|
+
private currentCurrency
|
|
19
|
+
private hasProtection
|
|
20
|
+
private isWidgetVisible
|
|
21
|
+
private isGreen
|
|
22
|
+
private hasFreeGift
|
|
23
|
+
private priceLabel
|
|
24
|
+
private primaryLabel
|
|
25
|
+
private primaryDisabled
|
|
26
|
+
private primaryLoading
|
|
27
|
+
private primaryLoadingLabel
|
|
28
|
+
connectedCallback(): void
|
|
29
|
+
disconnectedCallback(): void
|
|
30
|
+
protected render(): import('lit').TemplateResult<1> | typeof nothing
|
|
31
|
+
private bootstrap
|
|
32
|
+
private setupGlobalListeners
|
|
33
|
+
private ensureButton
|
|
34
|
+
private startPlacementGuard
|
|
35
|
+
private schedulePlacement
|
|
36
|
+
private ensureHostPlacement
|
|
37
|
+
private captureOriginalButtonLabel
|
|
38
|
+
private updateOriginalButtonLabel
|
|
39
|
+
private restoreOriginalButtonLabel
|
|
40
|
+
private ensureProductData
|
|
41
|
+
private resolveSelectedVariant
|
|
42
|
+
private refreshOffer
|
|
43
|
+
private extractVariantPrice
|
|
44
|
+
private updateStoreDecor
|
|
45
|
+
private syncProtectionState
|
|
46
|
+
private updateVisibility
|
|
47
|
+
private hasProtectionInCart
|
|
48
|
+
private setButtonsLoading
|
|
49
|
+
private setATCLoading
|
|
50
|
+
private handlePrimaryClick
|
|
51
|
+
private resolveSelectedVariantId
|
|
52
|
+
private resolveQuantity
|
|
53
|
+
private fallbackSequentialAdds
|
|
54
|
+
private normalizeVariantId
|
|
55
|
+
private ensureOriginalButtonStyles
|
|
56
|
+
private tagOriginalButton
|
|
57
|
+
private fetchCart
|
|
58
|
+
private notifyProtectionAdded
|
|
59
|
+
private findProtectionLineItem
|
|
60
|
+
private openCartDrawer
|
|
61
|
+
private handleHelpClick
|
|
62
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { LitElement, nothing } from 'lit'
|
|
2
|
+
import type { ShopifyCart, ShopifyProductVariant } from '../types/shopify'
|
|
3
|
+
import './components/shipaid-learn-more-carousel'
|
|
4
|
+
export declare class ShipAidWidgetV2 extends LitElement {
|
|
5
|
+
env: string
|
|
6
|
+
lang: string
|
|
7
|
+
previewGreenShipAid: boolean
|
|
8
|
+
dataSelector: string
|
|
9
|
+
isClone: boolean
|
|
10
|
+
private _store?
|
|
11
|
+
private _cart?
|
|
12
|
+
private _protectionProduct?
|
|
13
|
+
private _protectionVariant?
|
|
14
|
+
private _hasFinishedSetup
|
|
15
|
+
private _hasProtectionInCart
|
|
16
|
+
private _originalCheckoutButton
|
|
17
|
+
private _observer
|
|
18
|
+
private _remountTimer
|
|
19
|
+
private _aboutToUnload
|
|
20
|
+
itemsSelector: string
|
|
21
|
+
private _itemsObserver
|
|
22
|
+
private _itemsTargetEl
|
|
23
|
+
private _itemsDebounceTimer
|
|
24
|
+
private _onShipAidCartEvent
|
|
25
|
+
private _apiEndpoint
|
|
26
|
+
private _fetch
|
|
27
|
+
connectedCallback(): Promise<void>
|
|
28
|
+
private _ensureLearnMoreCarousel
|
|
29
|
+
private _shouldShowWidget
|
|
30
|
+
protected updated(changed: Map<string, unknown>): void
|
|
31
|
+
private _ensureBaseStyles
|
|
32
|
+
private _applyButtonStylesFrom
|
|
33
|
+
private _hideProtectionRowsByHref
|
|
34
|
+
private _mountNearCheckoutButton
|
|
35
|
+
private _startObserver
|
|
36
|
+
disconnectedCallback(): void
|
|
37
|
+
private _observeCartItems
|
|
38
|
+
private _fetchShipAidData
|
|
39
|
+
private _fetchCart
|
|
40
|
+
private _fetchProduct
|
|
41
|
+
hasProtection(): boolean
|
|
42
|
+
updateCart(cart?: ShopifyCart): Promise<void>
|
|
43
|
+
calculateProtectionTotal(cart?: ShopifyCart): Promise<number>
|
|
44
|
+
getProtectionVariantForFee(protectionFee: number): ShopifyProductVariant | undefined
|
|
45
|
+
calculateProtectionFeeForCartPlusAmountCents(amountCents: number): Promise<{
|
|
46
|
+
fee: number;
|
|
47
|
+
variant: ShopifyProductVariant | undefined;
|
|
48
|
+
}>
|
|
49
|
+
|
|
50
|
+
addProtection(): Promise<void>
|
|
51
|
+
removeProtection(): Promise<void>
|
|
52
|
+
private _currencyFormat
|
|
53
|
+
updateProtection(): Promise<void>
|
|
54
|
+
openModal(): void
|
|
55
|
+
private proceedToCheckout
|
|
56
|
+
render(): import('lit').TemplateResult<1> | typeof nothing
|
|
57
|
+
}
|
|
58
|
+
declare global {
|
|
59
|
+
interface HTMLElementTagNameMap {
|
|
60
|
+
'shipaid-widget-v2': ShipAidWidgetV2;
|
|
61
|
+
}
|
|
62
|
+
}
|
package/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit'
|
|
2
|
-
declare class ProductAddConfirmation extends LitElement {
|
|
3
|
-
static styles: import('lit').CSSResult
|
|
4
|
-
open: boolean
|
|
5
|
-
product: null
|
|
6
|
-
imageUrl: null
|
|
7
|
-
priceOfVariant: null
|
|
8
|
-
quantity: number
|
|
9
|
-
handleDismiss(): void
|
|
10
|
-
handleConfirm(): void
|
|
11
|
-
render(): import('lit-html').TemplateResult<1>
|
|
12
|
-
}
|
|
13
|
-
export default ProductAddConfirmation
|