ui.shipaid.com 0.3.44 → 0.3.45
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 +11997 -442
- package/dist/widget.iife.js +77 -62
- package/dist/widget.umd.js +77 -62
- package/dist-types/widget/src/shipaid-widget.d.ts +18 -2
- package/package.json +3 -2
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { LitElement, PropertyValues } from 'lit';
|
|
2
3
|
import './components/learn-more-popup';
|
|
3
4
|
import './components/confirmation-popup';
|
|
4
|
-
import type { ShopifyCart } from '../types/shopify';
|
|
5
|
+
import type { ShopifyCart, ShopifyCartItem } from '../types/shopify';
|
|
6
|
+
import { NhostClient } from '@nhost/nhost-js';
|
|
5
7
|
/**
|
|
6
8
|
* ShipAid Widget.
|
|
7
9
|
*
|
|
@@ -11,6 +13,11 @@ import type { ShopifyCart } from '../types/shopify';
|
|
|
11
13
|
*/
|
|
12
14
|
export declare class ShipAidWidget extends LitElement {
|
|
13
15
|
static styles: import("lit").CSSResult;
|
|
16
|
+
env: string;
|
|
17
|
+
useCustomStoreFront: boolean;
|
|
18
|
+
storeDomain: string;
|
|
19
|
+
storeAccessToken: string;
|
|
20
|
+
cartId: string;
|
|
14
21
|
disablePolling: boolean;
|
|
15
22
|
disableActions: boolean;
|
|
16
23
|
pollingInterval: number;
|
|
@@ -46,7 +53,7 @@ export declare class ShipAidWidget extends LitElement {
|
|
|
46
53
|
private _protectionVariant;
|
|
47
54
|
hasLoadedStrings: boolean;
|
|
48
55
|
fetchInterceptorCleanup: () => void;
|
|
49
|
-
intervalId:
|
|
56
|
+
intervalId: NodeJS.Timer | null;
|
|
50
57
|
protected shouldUpdate(props: PropertyValues): boolean;
|
|
51
58
|
protected shouldPersistPopup(): "learn-more" | null;
|
|
52
59
|
protected setPopupKey(): void;
|
|
@@ -58,6 +65,13 @@ export declare class ShipAidWidget extends LitElement {
|
|
|
58
65
|
* Internal popup state
|
|
59
66
|
*/
|
|
60
67
|
private _popup;
|
|
68
|
+
get nhost(): NhostClient;
|
|
69
|
+
/** Runs a GraphQL query and returns the data
|
|
70
|
+
* @param query GraphQL query string
|
|
71
|
+
* @param variables Variables for the query
|
|
72
|
+
* @returns Query response data
|
|
73
|
+
*/
|
|
74
|
+
runStoreFrontQuery<Data>(query: string, variables: any): Promise<Data>;
|
|
61
75
|
/** Getter to check if we should refresh the page or not */
|
|
62
76
|
get shouldRefreshOnUpdate(): boolean;
|
|
63
77
|
/** Getter to check whether to show the widget or not */
|
|
@@ -96,6 +110,8 @@ export declare class ShipAidWidget extends LitElement {
|
|
|
96
110
|
hasProtection(): boolean;
|
|
97
111
|
/** Update the internal cart, which will trigger any protection fee updates */
|
|
98
112
|
updateCart(cart?: ShopifyCart): Promise<void>;
|
|
113
|
+
addCartProtectionVariant(): Promise<any>;
|
|
114
|
+
updateCartProtectionVariant(qty: number, protectionCartItem?: ShopifyCartItem | null, sellingPlanId?: string | null): Promise<any>;
|
|
99
115
|
/** Add ShipAid shipping protection. */
|
|
100
116
|
addProtection(): Promise<void>;
|
|
101
117
|
/** Remove ShipAid shipping protection. */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ui.shipaid.com",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.45",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/widget.umd.js",
|
|
7
7
|
"unpkg": "dist/widget.iife.js",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"@lit-labs/task": "^2.0.0",
|
|
25
25
|
"lit": "^2.6.1",
|
|
26
26
|
"lit-element-effect": "^1.0.2",
|
|
27
|
-
"lit-translate": "^2.0.1"
|
|
27
|
+
"lit-translate": "^2.0.1",
|
|
28
|
+
"@nhost/nhost-js": "^3.1.10"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"@typescript-eslint/eslint-plugin": "^5.49.0",
|