ui.shipaid.com 0.3.40 → 0.3.42

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.
@@ -38,6 +38,31 @@ export interface ProtectionSettingsFixed {
38
38
  rangeUpper?: number;
39
39
  }>;
40
40
  }
41
+ declare enum Deadline {
42
+ THIRTY_MIN = "THIRTY_MIN",
43
+ SIXTY_MIN = "SIXTY_MIN",
44
+ NINETY_MIN = "NINETY_MIN",
45
+ TWO_HOURS = "TWO_HOURS",
46
+ THREE_HOURS = "THREE_HOURS",
47
+ SIX_HOURS = "SIX_HOURS",
48
+ TWELVE_HOURS = "TWELVE_HOURS",
49
+ ONE_DAY = "ONE_DAY",
50
+ TWO_DAYS = "TWO_DAYS",
51
+ THREE_DAYS = "THREE_DAYS",
52
+ FIVE_DAYS = "FIVE_DAYS",
53
+ TEN_DAYS = "TEN_DAYS"
54
+ }
55
+ interface OrderSettings {
56
+ deadline: {
57
+ timing: Deadline;
58
+ description: string;
59
+ };
60
+ shipping: {
61
+ allow_customer_to_use_po_boxes: boolean;
62
+ allow_customer_to_edit_shipping: boolean;
63
+ allow_gmaps_to_verify_addresses: boolean;
64
+ };
65
+ }
41
66
  export interface ShipAidStore {
42
67
  store: string;
43
68
  currency: string;
@@ -50,4 +75,7 @@ export interface ShipAidStore {
50
75
  planActive: boolean;
51
76
  protectionSettings: ProtectionSettingsFixed | ProtectionSettingsPercentage;
52
77
  widgetConfigurations: any;
78
+ orderSettings: OrderSettings;
79
+ autoOptInProbability: any;
53
80
  }
81
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const styles: import("lit").CSSResult;
2
+ export default styles;
@@ -0,0 +1,9 @@
1
+ import { LitElement } from 'lit';
2
+ declare class ConfirmationPopup extends LitElement {
3
+ static styles: import("lit").CSSResult;
4
+ active: boolean;
5
+ handleClosePopup(): void;
6
+ handleRemoveProtection(): void;
7
+ render(): import("lit").TemplateResult<1>;
8
+ }
9
+ export default ConfirmationPopup;
@@ -1,5 +1,6 @@
1
1
  import { LitElement, PropertyValues } from 'lit';
2
2
  import './components/learn-more-popup';
3
+ import './components/confirmation-popup';
3
4
  import type { ShopifyCart } from '../types/shopify';
4
5
  /**
5
6
  * ShipAid Widget.
@@ -44,7 +45,8 @@ export declare class ShipAidWidget extends LitElement {
44
45
  /** The protection variant that will be used */
45
46
  private _protectionVariant;
46
47
  hasLoadedStrings: boolean;
47
- intervalId: number;
48
+ fetchInterceptorCleanup: () => void;
49
+ intervalId: any;
48
50
  protected shouldUpdate(props: PropertyValues): boolean;
49
51
  protected shouldPersistPopup(): "learn-more" | null;
50
52
  protected setPopupKey(): void;
@@ -75,6 +77,8 @@ export declare class ShipAidWidget extends LitElement {
75
77
  private _findProtectionVariant;
76
78
  /** Update State */
77
79
  private _setState;
80
+ /** Trigger confirmation popup */
81
+ private _handleConfirmationPopup;
78
82
  /** Updates the current protection status, calling the relevant add/remove function. */
79
83
  private _updateProtection;
80
84
  /** General fetch function, which handles error responses, and returns JSON responses. */
@@ -101,8 +105,12 @@ export declare class ShipAidWidget extends LitElement {
101
105
  handleMultipleProtectionVariants(): Promise<void>;
102
106
  /** Templates */
103
107
  learnMorePopupTemplate(): import("lit").TemplateResult<1>;
108
+ confirmationPopupTemplate(): import("lit").TemplateResult<1>;
109
+ renderPopups(): import("lit").TemplateResult<1> | null;
104
110
  promptTemplate(): import("lit").TemplateResult<1>;
105
111
  connectedCallback(): Promise<void>;
112
+ disconnectedCallback(): void;
113
+ updateProtection(): Promise<void>;
106
114
  protected render(): import("lit").TemplateResult<1>;
107
115
  }
108
116
  declare global {
@@ -0,0 +1,3 @@
1
+ type FetchInterceptor = (args: any[], promise: Promise<Response>) => void | Promise<void>;
2
+ export declare function interceptFetch(interceptor: FetchInterceptor): () => void;
3
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ui.shipaid.com",
3
3
  "private": false,
4
- "version": "0.3.40",
4
+ "version": "0.3.42",
5
5
  "type": "module",
6
6
  "main": "dist/widget.umd.js",
7
7
  "unpkg": "dist/widget.iife.js",
@@ -17,7 +17,8 @@
17
17
  "scripts": {
18
18
  "develop": "vite",
19
19
  "build": "tsc && node build",
20
- "lint": "eslint . --ext=ts --fix"
20
+ "lint": "eslint . --ext=ts --fix",
21
+ "test": "vitest"
21
22
  },
22
23
  "dependencies": {
23
24
  "@lit-labs/task": "^2.0.0",
@@ -28,6 +29,7 @@
28
29
  "devDependencies": {
29
30
  "@typescript-eslint/eslint-plugin": "^5.49.0",
30
31
  "@typescript-eslint/parser": "^5.49.0",
32
+ "@vitest/browser": "^2.1.4",
31
33
  "eslint": "^8.32.0",
32
34
  "eslint-config-standard": "^17.0.0",
33
35
  "eslint-plugin-html": "^7.1.0",
@@ -36,8 +38,11 @@
36
38
  "eslint-plugin-lit-a11y": "^2.3.0",
37
39
  "eslint-plugin-n": "^15.6.1",
38
40
  "eslint-plugin-promise": "^6.1.1",
41
+ "jsdom": "^25.0.1",
42
+ "playwright": "^1.48.2",
39
43
  "terser": "^5.16.1",
40
44
  "typescript": "^4.9.4",
41
- "vite": "^4.0.4"
45
+ "vite": "^5.4.10",
46
+ "vitest": "^2.1.4"
42
47
  }
43
48
  }
File without changes
File without changes
File without changes
File without changes
File without changes