ui.shipaid.com 0.3.26 → 0.3.28
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 +200 -200
- package/dist/widget.es.js +75 -2
- package/dist/widget.iife.js +51 -51
- package/dist/widget.umd.js +51 -51
- package/dist-types/common/shopify/index.d.ts +6 -6
- package/dist-types/common/shopify/protection.d.ts +7 -6
- package/dist-types/common/shopify/types/ShopifyCart.d.ts +29 -28
- package/dist-types/common/shopify/types/ShopifyProduct.d.ts +7 -7
- package/dist-types/common/types/ShipAid.d.ts +53 -53
- package/dist-types/widget/src/assets/icons.d.ts +8 -8
- package/dist-types/widget/src/assets/learn-more-styles.d.ts +2 -2
- package/dist-types/widget/src/assets/styles.d.ts +2 -2
- package/dist-types/widget/src/components/learn-more-popup.d.ts +8 -8
- package/dist-types/widget/src/shipaid-widget.d.ts +111 -108
- package/dist-types/widget/types/shipaid.d.ts +10 -10
- package/dist-types/widget/types/shopify.d.ts +29 -28
- package/dist-types/widget/types/widget.d.ts +13 -13
- package/package.json +43 -43
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
export interface ShopifyCart {
|
|
2
|
-
/** Should be the lowest common denomination */
|
|
3
|
-
total_price: number;
|
|
4
|
-
item_count: number;
|
|
5
|
-
items?: ShopifyCartItem[];
|
|
6
|
-
}
|
|
7
|
-
export interface ShopifyCartItem {
|
|
8
|
-
id: number;
|
|
9
|
-
index: number;
|
|
10
|
-
position: number;
|
|
11
|
-
quantity: number;
|
|
12
|
-
variant_id: number;
|
|
13
|
-
key: string;
|
|
14
|
-
sku: string;
|
|
15
|
-
/** Should be the lowest common denomination */
|
|
16
|
-
final_line_price: number;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
export interface ShopifyCart {
|
|
2
|
+
/** Should be the lowest common denomination */
|
|
3
|
+
total_price: number;
|
|
4
|
+
item_count: number;
|
|
5
|
+
items?: ShopifyCartItem[];
|
|
6
|
+
}
|
|
7
|
+
export interface ShopifyCartItem {
|
|
8
|
+
id: number;
|
|
9
|
+
index: number;
|
|
10
|
+
position: number;
|
|
11
|
+
quantity: number;
|
|
12
|
+
variant_id: number;
|
|
13
|
+
key: string;
|
|
14
|
+
sku: string;
|
|
15
|
+
/** Should be the lowest common denomination */
|
|
16
|
+
final_line_price: number;
|
|
17
|
+
selling_plan_allocation?: any;
|
|
18
|
+
}
|
|
19
|
+
export interface FeaturedImage {
|
|
20
|
+
aspect_ratio: number;
|
|
21
|
+
alt: string;
|
|
22
|
+
height: number;
|
|
23
|
+
url: string;
|
|
24
|
+
width: number;
|
|
25
|
+
}
|
|
26
|
+
export interface OptionsWithValues {
|
|
27
|
+
name: string;
|
|
28
|
+
value: string;
|
|
29
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export interface ShopifyProduct {
|
|
2
|
-
variants?: ShopifyProductVariant[];
|
|
3
|
-
}
|
|
4
|
-
export interface ShopifyProductVariant {
|
|
5
|
-
id: number;
|
|
6
|
-
price: string;
|
|
7
|
-
}
|
|
1
|
+
export interface ShopifyProduct {
|
|
2
|
+
variants?: ShopifyProductVariant[];
|
|
3
|
+
}
|
|
4
|
+
export interface ShopifyProductVariant {
|
|
5
|
+
id: number;
|
|
6
|
+
price: string;
|
|
7
|
+
}
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
export interface ProtectionSettingsProductVariant {
|
|
2
|
-
id?: string;
|
|
3
|
-
sku?: string;
|
|
4
|
-
price?: string;
|
|
5
|
-
title?: string;
|
|
6
|
-
selectedOptions?: Array<{
|
|
7
|
-
name?: string;
|
|
8
|
-
value?: string;
|
|
9
|
-
}>;
|
|
10
|
-
}
|
|
11
|
-
export interface ProtectionSettingsProduct {
|
|
12
|
-
id?: string;
|
|
13
|
-
title?: string;
|
|
14
|
-
options?: Array<{
|
|
15
|
-
name: string;
|
|
16
|
-
value: string;
|
|
17
|
-
}>;
|
|
18
|
-
variants?: {
|
|
19
|
-
edges?: Array<{
|
|
20
|
-
node?: ProtectionSettingsProductVariant;
|
|
21
|
-
}>;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export interface ProtectionSettings {
|
|
25
|
-
product?: ProtectionSettingsProduct;
|
|
26
|
-
}
|
|
27
|
-
export interface ProtectionSettingsPercentage {
|
|
28
|
-
protectionType: 'PERCENTAGE';
|
|
29
|
-
percentage: number;
|
|
30
|
-
minimumFee: number;
|
|
31
|
-
}
|
|
32
|
-
export interface ProtectionSettingsFixed {
|
|
33
|
-
protectionType: 'FIXED';
|
|
34
|
-
defaultFee?: number;
|
|
35
|
-
rules?: Array<{
|
|
36
|
-
fee?: number;
|
|
37
|
-
rangeLower?: number;
|
|
38
|
-
rangeUpper?: number;
|
|
39
|
-
}>;
|
|
40
|
-
}
|
|
41
|
-
export interface ShipAidStore {
|
|
42
|
-
store: string;
|
|
43
|
-
currency: string;
|
|
44
|
-
widgetAutoOptIn?: boolean;
|
|
45
|
-
widgetPollProtection?: boolean;
|
|
46
|
-
widgetShowCart?: boolean;
|
|
47
|
-
excludedProductSkus?: string[];
|
|
48
|
-
excludedProductsVariantsId?: string[];
|
|
49
|
-
excludedCustomersIdsAutoOptIn?: string[] | null;
|
|
50
|
-
planActive: boolean;
|
|
51
|
-
protectionSettings: ProtectionSettingsFixed | ProtectionSettingsPercentage;
|
|
52
|
-
widgetConfigurations: any;
|
|
53
|
-
}
|
|
1
|
+
export interface ProtectionSettingsProductVariant {
|
|
2
|
+
id?: string;
|
|
3
|
+
sku?: string;
|
|
4
|
+
price?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
selectedOptions?: Array<{
|
|
7
|
+
name?: string;
|
|
8
|
+
value?: string;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
export interface ProtectionSettingsProduct {
|
|
12
|
+
id?: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
options?: Array<{
|
|
15
|
+
name: string;
|
|
16
|
+
value: string;
|
|
17
|
+
}>;
|
|
18
|
+
variants?: {
|
|
19
|
+
edges?: Array<{
|
|
20
|
+
node?: ProtectionSettingsProductVariant;
|
|
21
|
+
}>;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface ProtectionSettings {
|
|
25
|
+
product?: ProtectionSettingsProduct;
|
|
26
|
+
}
|
|
27
|
+
export interface ProtectionSettingsPercentage {
|
|
28
|
+
protectionType: 'PERCENTAGE';
|
|
29
|
+
percentage: number;
|
|
30
|
+
minimumFee: number;
|
|
31
|
+
}
|
|
32
|
+
export interface ProtectionSettingsFixed {
|
|
33
|
+
protectionType: 'FIXED';
|
|
34
|
+
defaultFee?: number;
|
|
35
|
+
rules?: Array<{
|
|
36
|
+
fee?: number;
|
|
37
|
+
rangeLower?: number;
|
|
38
|
+
rangeUpper?: number;
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
export interface ShipAidStore {
|
|
42
|
+
store: string;
|
|
43
|
+
currency: string;
|
|
44
|
+
widgetAutoOptIn?: boolean;
|
|
45
|
+
widgetPollProtection?: boolean;
|
|
46
|
+
widgetShowCart?: boolean;
|
|
47
|
+
excludedProductSkus?: string[];
|
|
48
|
+
excludedProductsVariantsId?: string[];
|
|
49
|
+
excludedCustomersIdsAutoOptIn?: string[] | null;
|
|
50
|
+
planActive: boolean;
|
|
51
|
+
protectionSettings: ProtectionSettingsFixed | ProtectionSettingsPercentage;
|
|
52
|
+
widgetConfigurations: any;
|
|
53
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export declare const CheckmarkIcon: import("lit").TemplateResult<1>;
|
|
2
|
-
export declare const ShipAidLogo: import("lit").TemplateResult<1>;
|
|
3
|
-
export declare const ShipAidLogoText: import("lit").TemplateResult<1>;
|
|
4
|
-
export declare const ShipAidLogoPopUp: import("lit").TemplateResult<1>;
|
|
5
|
-
export declare const CheckmarkRibbon: import("lit").TemplateResult<1>;
|
|
6
|
-
export declare const MapIcon: import("lit").TemplateResult<1>;
|
|
7
|
-
export declare const BoxIcon: import("lit").TemplateResult<1>;
|
|
8
|
-
export declare const BellIcon: import("lit").TemplateResult<1>;
|
|
1
|
+
export declare const CheckmarkIcon: import("lit").TemplateResult<1>;
|
|
2
|
+
export declare const ShipAidLogo: import("lit").TemplateResult<1>;
|
|
3
|
+
export declare const ShipAidLogoText: import("lit").TemplateResult<1>;
|
|
4
|
+
export declare const ShipAidLogoPopUp: import("lit").TemplateResult<1>;
|
|
5
|
+
export declare const CheckmarkRibbon: import("lit").TemplateResult<1>;
|
|
6
|
+
export declare const MapIcon: import("lit").TemplateResult<1>;
|
|
7
|
+
export declare const BoxIcon: import("lit").TemplateResult<1>;
|
|
8
|
+
export declare const BellIcon: import("lit").TemplateResult<1>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const styles: import("lit").CSSResult;
|
|
2
|
-
export default styles;
|
|
1
|
+
declare const styles: import("lit").CSSResult;
|
|
2
|
+
export default styles;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("lit").CSSResult;
|
|
2
|
-
export default _default;
|
|
1
|
+
declare const _default: import("lit").CSSResult;
|
|
2
|
+
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
declare class LearnMorePopup extends LitElement {
|
|
3
|
-
static styles: import("lit").CSSResult;
|
|
4
|
-
active: boolean;
|
|
5
|
-
handleClosePopup(): void;
|
|
6
|
-
render(): import("lit").TemplateResult<1>;
|
|
7
|
-
}
|
|
8
|
-
export default LearnMorePopup;
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
declare class LearnMorePopup extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult;
|
|
4
|
+
active: boolean;
|
|
5
|
+
handleClosePopup(): void;
|
|
6
|
+
render(): import("lit").TemplateResult<1>;
|
|
7
|
+
}
|
|
8
|
+
export default LearnMorePopup;
|
|
@@ -1,108 +1,111 @@
|
|
|
1
|
-
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
-
import './components/learn-more-popup';
|
|
3
|
-
import type { ShopifyCart } from '../types/shopify';
|
|
4
|
-
/**
|
|
5
|
-
* ShipAid Widget.
|
|
6
|
-
*
|
|
7
|
-
* @description When the <shipaid-widget> element is added to page, it will render this element,
|
|
8
|
-
* allowing a customer to add ShipAid protection to cart (and remove).
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
export declare class ShipAidWidget extends LitElement {
|
|
12
|
-
static styles: import("lit").CSSResult;
|
|
13
|
-
disablePolling: boolean;
|
|
14
|
-
disableActions: boolean;
|
|
15
|
-
pollingInterval: number;
|
|
16
|
-
disableRefresh: boolean;
|
|
17
|
-
refreshCart: boolean;
|
|
18
|
-
persistPopup: boolean;
|
|
19
|
-
defaultToggleButton: boolean;
|
|
20
|
-
lang: string;
|
|
21
|
-
currency: undefined;
|
|
22
|
-
customerId: undefined;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
protected
|
|
49
|
-
protected
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
private
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
*
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
import './components/learn-more-popup';
|
|
3
|
+
import type { ShopifyCart } from '../types/shopify';
|
|
4
|
+
/**
|
|
5
|
+
* ShipAid Widget.
|
|
6
|
+
*
|
|
7
|
+
* @description When the <shipaid-widget> element is added to page, it will render this element,
|
|
8
|
+
* allowing a customer to add ShipAid protection to cart (and remove).
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export declare class ShipAidWidget extends LitElement {
|
|
12
|
+
static styles: import("lit").CSSResult;
|
|
13
|
+
disablePolling: boolean;
|
|
14
|
+
disableActions: boolean;
|
|
15
|
+
pollingInterval: number;
|
|
16
|
+
disableRefresh: boolean;
|
|
17
|
+
refreshCart: boolean;
|
|
18
|
+
persistPopup: boolean;
|
|
19
|
+
defaultToggleButton: boolean;
|
|
20
|
+
lang: string;
|
|
21
|
+
currency: undefined;
|
|
22
|
+
customerId: undefined;
|
|
23
|
+
supportSubscriptions: boolean;
|
|
24
|
+
/** API Proxy pathname */
|
|
25
|
+
private _apiEndpoint;
|
|
26
|
+
/** The current store domain */
|
|
27
|
+
private _storeDomain;
|
|
28
|
+
/** The current store data object from the ShipAid API */
|
|
29
|
+
private _store;
|
|
30
|
+
/** The current cart data object from the Shopify API */
|
|
31
|
+
private _cart;
|
|
32
|
+
/** The current protection product data object from the Shopify API */
|
|
33
|
+
private _protectionProduct;
|
|
34
|
+
/** When the cart was last updated */
|
|
35
|
+
private _cartLastUpdated;
|
|
36
|
+
/** Whether we have finished the initial setup */
|
|
37
|
+
private _hasFinishedSetup;
|
|
38
|
+
/** Can be used to hide all widget content */
|
|
39
|
+
private _shouldShowWidget;
|
|
40
|
+
/** Whether the ShipAid protection product is currently added to the cart */
|
|
41
|
+
private _hasProtectionInCart;
|
|
42
|
+
/** The protection item from the Shopify cart */
|
|
43
|
+
private _protectionCartItem;
|
|
44
|
+
/** The protection variant that will be used */
|
|
45
|
+
private _protectionVariant;
|
|
46
|
+
hasLoadedStrings: boolean;
|
|
47
|
+
intervalId: number;
|
|
48
|
+
protected shouldUpdate(props: PropertyValues): boolean;
|
|
49
|
+
protected shouldPersistPopup(): "learn-more" | null;
|
|
50
|
+
protected setPopupKey(): void;
|
|
51
|
+
/**
|
|
52
|
+
* Internal state
|
|
53
|
+
*/
|
|
54
|
+
private _state;
|
|
55
|
+
/**
|
|
56
|
+
* Internal popup state
|
|
57
|
+
*/
|
|
58
|
+
private _popup;
|
|
59
|
+
/** Getter to check if we should refresh the page or not */
|
|
60
|
+
get shouldRefreshOnUpdate(): boolean;
|
|
61
|
+
/** Getter to check whether to show the widget or not */
|
|
62
|
+
get planActive(): boolean;
|
|
63
|
+
private _currencyFormat;
|
|
64
|
+
/** Emit events */
|
|
65
|
+
private _dispatchEvent;
|
|
66
|
+
private _handleRefreshCart;
|
|
67
|
+
/** Handle cart or page refreshes */
|
|
68
|
+
private _handleRefresh;
|
|
69
|
+
/** Given the current order, it calculates the protection total according to the store protection settings. */
|
|
70
|
+
calculateProtectionTotal(cart?: ShopifyCart): Promise<number>;
|
|
71
|
+
/**
|
|
72
|
+
* Given the current order, it finds the relevant protection product variant, and adds it to cart.
|
|
73
|
+
* This should be run whenever the cart updates, or it is manually triggered.
|
|
74
|
+
*/
|
|
75
|
+
private _findProtectionVariant;
|
|
76
|
+
/** Update State */
|
|
77
|
+
private _setState;
|
|
78
|
+
/** Updates the current protection status, calling the relevant add/remove function. */
|
|
79
|
+
private _updateProtection;
|
|
80
|
+
/** General fetch function, which handles error responses, and returns JSON responses. */
|
|
81
|
+
private _fetch;
|
|
82
|
+
/** Fetches store info from the ShipAid public API. */
|
|
83
|
+
private _fetchShipAidData;
|
|
84
|
+
/** Fetches store info from the ShipAid public API. */
|
|
85
|
+
private _fetchSellingPlanFromVariant;
|
|
86
|
+
/** Fetch current cart from the Shopify ajax API */
|
|
87
|
+
private _fetchCart;
|
|
88
|
+
/** Fetch current product from the Shopify ajax API */
|
|
89
|
+
private _fetchProduct;
|
|
90
|
+
/** Whether the cart currently contains Shipping protection from ShipAid. */
|
|
91
|
+
hasProtection(): boolean;
|
|
92
|
+
/** Update the internal cart, which will trigger any protection fee updates */
|
|
93
|
+
updateCart(cart?: ShopifyCart): Promise<void>;
|
|
94
|
+
/** Add ShipAid shipping protection. */
|
|
95
|
+
addProtection(): Promise<void>;
|
|
96
|
+
/** Remove ShipAid shipping protection. */
|
|
97
|
+
removeProtection(): Promise<void>;
|
|
98
|
+
/** Try adding ShipAid shipping protection during polling if applicable */
|
|
99
|
+
attemptAddProtection(): Promise<void>;
|
|
100
|
+
handleMultipleProtectionVariants(): Promise<void>;
|
|
101
|
+
/** Templates */
|
|
102
|
+
learnMorePopupTemplate(): import("lit").TemplateResult<1>;
|
|
103
|
+
promptTemplate(): import("lit").TemplateResult<1>;
|
|
104
|
+
connectedCallback(): Promise<void>;
|
|
105
|
+
protected render(): import("lit").TemplateResult<1>;
|
|
106
|
+
}
|
|
107
|
+
declare global {
|
|
108
|
+
interface HTMLElementTagNameMap {
|
|
109
|
+
'shipaid-widget': ShipAidWidget;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ShipAidStore } from '../../common/types/ShipAid';
|
|
2
|
-
export interface ShipAidStoreQuery {
|
|
3
|
-
data: null | {
|
|
4
|
-
store: ShipAidStore;
|
|
5
|
-
};
|
|
6
|
-
errors?: {
|
|
7
|
-
message: string;
|
|
8
|
-
}[];
|
|
9
|
-
}
|
|
10
|
-
export { ShipAidStore };
|
|
1
|
+
import { ShipAidStore } from '../../common/types/ShipAid';
|
|
2
|
+
export interface ShipAidStoreQuery {
|
|
3
|
+
data: null | {
|
|
4
|
+
store: ShipAidStore;
|
|
5
|
+
};
|
|
6
|
+
errors?: {
|
|
7
|
+
message: string;
|
|
8
|
+
}[];
|
|
9
|
+
}
|
|
10
|
+
export { ShipAidStore };
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { ShopifyProduct } from '../../common/shopify/types/ShopifyProduct';
|
|
2
|
-
export * from '../../common/shopify/types/ShopifyCart';
|
|
3
|
-
export * from '../../common/shopify/types/ShopifyProduct';
|
|
4
|
-
declare global {
|
|
5
|
-
interface Window {
|
|
6
|
-
Shopify?: {
|
|
7
|
-
shop?: string;
|
|
8
|
-
locale?: string;
|
|
9
|
-
designMode?: boolean;
|
|
10
|
-
currency?: {
|
|
11
|
-
active?: string;
|
|
12
|
-
};
|
|
13
|
-
Checkout?: Record<string, string> & {
|
|
14
|
-
apiHost?: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
export interface ShopifyCartAddPayload {
|
|
20
|
-
id: number | string;
|
|
21
|
-
quantity?: number;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
import { ShopifyProduct } from '../../common/shopify/types/ShopifyProduct';
|
|
2
|
+
export * from '../../common/shopify/types/ShopifyCart';
|
|
3
|
+
export * from '../../common/shopify/types/ShopifyProduct';
|
|
4
|
+
declare global {
|
|
5
|
+
interface Window {
|
|
6
|
+
Shopify?: {
|
|
7
|
+
shop?: string;
|
|
8
|
+
locale?: string;
|
|
9
|
+
designMode?: boolean;
|
|
10
|
+
currency?: {
|
|
11
|
+
active?: string;
|
|
12
|
+
};
|
|
13
|
+
Checkout?: Record<string, string> & {
|
|
14
|
+
apiHost?: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export interface ShopifyCartAddPayload {
|
|
20
|
+
id: number | string;
|
|
21
|
+
quantity?: number;
|
|
22
|
+
selling_plan?: number | string | null;
|
|
23
|
+
}
|
|
24
|
+
export interface ShopifyCartUpdatePayload {
|
|
25
|
+
updates: Record<string | number, number>;
|
|
26
|
+
}
|
|
27
|
+
export interface ShopifyProductResponse {
|
|
28
|
+
product: ShopifyProduct;
|
|
29
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export declare enum Events {
|
|
2
|
-
LOADED = "shipaid-loaded",
|
|
3
|
-
STATUS_UPDATE = "shipaid-protection-status"
|
|
4
|
-
}
|
|
5
|
-
export interface State {
|
|
6
|
-
loading: boolean;
|
|
7
|
-
success: boolean | null;
|
|
8
|
-
error: boolean | string | null;
|
|
9
|
-
}
|
|
10
|
-
export interface FetchHelper {
|
|
11
|
-
get: <Data>(url: string) => Promise<Data>;
|
|
12
|
-
post: <Data>(url: string, body: unknown) => Promise<Data>;
|
|
13
|
-
}
|
|
1
|
+
export declare enum Events {
|
|
2
|
+
LOADED = "shipaid-loaded",
|
|
3
|
+
STATUS_UPDATE = "shipaid-protection-status"
|
|
4
|
+
}
|
|
5
|
+
export interface State {
|
|
6
|
+
loading: boolean;
|
|
7
|
+
success: boolean | null;
|
|
8
|
+
error: boolean | string | null;
|
|
9
|
+
}
|
|
10
|
+
export interface FetchHelper {
|
|
11
|
+
get: <Data>(url: string) => Promise<Data>;
|
|
12
|
+
post: <Data>(url: string, body: unknown) => Promise<Data>;
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "ui.shipaid.com",
|
|
3
|
-
"private": false,
|
|
4
|
-
"version": "0.3.
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "dist/widget.umd.js",
|
|
7
|
-
"unpkg": "dist/widget.iife.js",
|
|
8
|
-
"module": "dist/widget.es.js",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": "./dist/widget.es.js"
|
|
11
|
-
},
|
|
12
|
-
"types": "dist-types/src/shipaid-widget.d.ts",
|
|
13
|
-
"files": [
|
|
14
|
-
"dist-types",
|
|
15
|
-
"dist"
|
|
16
|
-
],
|
|
17
|
-
"scripts": {
|
|
18
|
-
"develop": "vite",
|
|
19
|
-
"build": "tsc && node build",
|
|
20
|
-
"lint": "eslint . --ext=ts --fix"
|
|
21
|
-
},
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"@lit-labs/task": "^2.0.0",
|
|
24
|
-
"lit": "^2.6.1",
|
|
25
|
-
"lit-element-effect": "^1.0.2",
|
|
26
|
-
"lit-translate": "^2.0.1"
|
|
27
|
-
},
|
|
28
|
-
"devDependencies": {
|
|
29
|
-
"@typescript-eslint/eslint-plugin": "^5.49.0",
|
|
30
|
-
"@typescript-eslint/parser": "^5.49.0",
|
|
31
|
-
"eslint": "^8.32.0",
|
|
32
|
-
"eslint-config-standard": "^17.0.0",
|
|
33
|
-
"eslint-plugin-html": "^7.1.0",
|
|
34
|
-
"eslint-plugin-import": "^2.27.5",
|
|
35
|
-
"eslint-plugin-lit": "^1.8.2",
|
|
36
|
-
"eslint-plugin-lit-a11y": "^2.3.0",
|
|
37
|
-
"eslint-plugin-n": "^15.6.1",
|
|
38
|
-
"eslint-plugin-promise": "^6.1.1",
|
|
39
|
-
"terser": "^5.16.1",
|
|
40
|
-
"typescript": "^4.9.4",
|
|
41
|
-
"vite": "^4.0.4"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "ui.shipaid.com",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "0.3.28",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/widget.umd.js",
|
|
7
|
+
"unpkg": "dist/widget.iife.js",
|
|
8
|
+
"module": "dist/widget.es.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./dist/widget.es.js"
|
|
11
|
+
},
|
|
12
|
+
"types": "dist-types/src/shipaid-widget.d.ts",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist-types",
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"develop": "vite",
|
|
19
|
+
"build": "tsc && node build",
|
|
20
|
+
"lint": "eslint . --ext=ts --fix"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@lit-labs/task": "^2.0.0",
|
|
24
|
+
"lit": "^2.6.1",
|
|
25
|
+
"lit-element-effect": "^1.0.2",
|
|
26
|
+
"lit-translate": "^2.0.1"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "^5.49.0",
|
|
30
|
+
"@typescript-eslint/parser": "^5.49.0",
|
|
31
|
+
"eslint": "^8.32.0",
|
|
32
|
+
"eslint-config-standard": "^17.0.0",
|
|
33
|
+
"eslint-plugin-html": "^7.1.0",
|
|
34
|
+
"eslint-plugin-import": "^2.27.5",
|
|
35
|
+
"eslint-plugin-lit": "^1.8.2",
|
|
36
|
+
"eslint-plugin-lit-a11y": "^2.3.0",
|
|
37
|
+
"eslint-plugin-n": "^15.6.1",
|
|
38
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
39
|
+
"terser": "^5.16.1",
|
|
40
|
+
"typescript": "^4.9.4",
|
|
41
|
+
"vite": "^4.0.4"
|
|
42
|
+
}
|
|
43
|
+
}
|