@getspot/spot-widget 3.3.1 → 4.0.0
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/CHANGELOG.md +17 -0
- package/README.md +15 -25
- package/dist/api.d.ts +2 -2
- package/dist/api.d.ts.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +316 -316
- package/dist/index.umd.js +4 -4
- package/dist/types.d.ts +7 -14
- package/dist/types.d.ts.map +1 -1
- package/dist/ui.d.ts +2 -2
- package/dist/ui.d.ts.map +1 -1
- package/dist/validateOptions.d.ts.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
# [4.0.0](https://gitlab.com/getspot/spot-widget/compare/@getspot/spot-widget@3.3.2...@getspot/spot-widget@4.0.0) (2026-01-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
* feat!(core): replacing optInSelected prop with selection enum ([0d40913](https://gitlab.com/getspot/spot-widget/commit/0d409135aa50eaa98995b9c1e20ca05cc7e2b2fc))
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
### BREAKING CHANGES
|
|
8
|
+
|
|
9
|
+
* better preselection of widget optIn/optOut
|
|
10
|
+
|
|
11
|
+
## [3.3.2](https://gitlab.com/getspot/spot-widget/compare/@getspot/spot-widget@3.3.1...@getspot/spot-widget@3.3.2) (2026-01-09)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **core:** render payment terms if quote contains paymentTerms ([852af4e](https://gitlab.com/getspot/spot-widget/commit/852af4e7fe9838aac0409e26713614e20d523a9b))
|
|
17
|
+
|
|
1
18
|
## [3.3.1](https://gitlab.com/getspot/spot-widget/compare/@getspot/spot-widget@3.3.0...@getspot/spot-widget@3.3.1) (2026-01-07)
|
|
2
19
|
|
|
3
20
|
|
package/README.md
CHANGED
|
@@ -75,7 +75,7 @@ const widget = new SpotWidget(options);
|
|
|
75
75
|
| `apiConfig` | `ApiConfig` | Yes | - | API configuration |
|
|
76
76
|
| `quoteRequestData` | `QuoteRequestData` | Yes | - | Quote request information |
|
|
77
77
|
| `showTable` | `boolean` | No | `true` | Whether to show payout table |
|
|
78
|
-
| `
|
|
78
|
+
| `selection` | `SelectionEnum` | No | `SelectionEnum.UNSELECTED` | Initial selection state for the widget |
|
|
79
79
|
| `theme` | `Theme` | No | - | Custom styling |
|
|
80
80
|
| `callbacks` | `Callbacks` | No | `{}` | Event callbacks |
|
|
81
81
|
|
|
@@ -356,19 +356,6 @@ export interface QuoteMetadata {
|
|
|
356
356
|
}
|
|
357
357
|
```
|
|
358
358
|
|
|
359
|
-
#### CartInfo
|
|
360
|
-
|
|
361
|
-
```typescript
|
|
362
|
-
export interface CartInfo {
|
|
363
|
-
cartId: string;
|
|
364
|
-
cartName: string;
|
|
365
|
-
currencyCode: "USD" | "CAD" | "AUD";
|
|
366
|
-
metadata?: QuoteMetadata;
|
|
367
|
-
isPartialPayment?: boolean;
|
|
368
|
-
roundTo?: number;
|
|
369
|
-
}
|
|
370
|
-
```
|
|
371
|
-
|
|
372
359
|
#### QuoteItem
|
|
373
360
|
|
|
374
361
|
```typescript
|
|
@@ -402,15 +389,6 @@ export interface QuoteItem {
|
|
|
402
389
|
|
|
403
390
|
```typescript
|
|
404
391
|
export interface BatchQuoteRequest {
|
|
405
|
-
cartInfo: CartInfo;
|
|
406
|
-
items: BatchQuoteItem[];
|
|
407
|
-
}
|
|
408
|
-
```
|
|
409
|
-
|
|
410
|
-
#### ApiBatchQuoteRequest
|
|
411
|
-
|
|
412
|
-
```typescript
|
|
413
|
-
export interface ApiBatchQuoteRequest {
|
|
414
392
|
cartId: string;
|
|
415
393
|
cartName: string;
|
|
416
394
|
currencyCode: "USD" | "CAD" | "AUD";
|
|
@@ -540,7 +518,7 @@ export interface Theme {
|
|
|
540
518
|
export interface SpotWidgetOptions {
|
|
541
519
|
location?: string | HTMLElement;
|
|
542
520
|
showTable?: boolean;
|
|
543
|
-
|
|
521
|
+
selection?: SelectionEnum;
|
|
544
522
|
logoPosition?: "bottom-right" | "top-right";
|
|
545
523
|
apiConfig: ApiConfig;
|
|
546
524
|
quoteRequestData: QuoteRequestData;
|
|
@@ -565,12 +543,24 @@ export interface ElementOptions {
|
|
|
565
543
|
}
|
|
566
544
|
```
|
|
567
545
|
|
|
546
|
+
### Enums
|
|
547
|
+
|
|
548
|
+
#### SelectionEnum
|
|
549
|
+
|
|
550
|
+
```typescript
|
|
551
|
+
export enum SelectionEnum {
|
|
552
|
+
YES = 'yes',
|
|
553
|
+
NO = 'no',
|
|
554
|
+
UNSELECTED = 'unselected',
|
|
555
|
+
}
|
|
556
|
+
```
|
|
557
|
+
|
|
568
558
|
### Type Aliases
|
|
569
559
|
|
|
570
560
|
#### QuoteRequestData
|
|
571
561
|
|
|
572
562
|
```typescript
|
|
573
|
-
export type QuoteRequestData = QuoteItem | BatchQuoteRequest;
|
|
563
|
+
export type QuoteRequestData = QuoteItem | BatchQuoteRequest | QuoteItem[];
|
|
574
564
|
```
|
|
575
565
|
|
|
576
566
|
## Framework Integration
|
package/dist/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ApiResponse, QuoteRequestData, BatchQuoteRequest
|
|
1
|
+
import type { ApiResponse, QuoteRequestData, BatchQuoteRequest } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Retrieve quote from Spot API
|
|
4
4
|
* @param endpoint – Spot API URL
|
|
@@ -14,7 +14,7 @@ export declare function fetchQuote(endpoint: string, partnerId: string, payload:
|
|
|
14
14
|
* @param batchPayload – batch request data with items array
|
|
15
15
|
* @returns Promise resolving to API response
|
|
16
16
|
*/
|
|
17
|
-
export declare function fetchBatchQuote(endpoint: string, partnerId: string, batchPayload:
|
|
17
|
+
export declare function fetchBatchQuote(endpoint: string, partnerId: string, batchPayload: BatchQuoteRequest): Promise<ApiResponse>;
|
|
18
18
|
/**
|
|
19
19
|
* Retrieve multiple quotes in parallel from Spot API
|
|
20
20
|
* @param endpoint – Spot API URL
|
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAY,gBAAgB,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAY,gBAAgB,EAAE,iBAAiB,EAAkB,MAAM,YAAY,CAAC;AAE7G;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,WAAW,CAAC,CAwBtB;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,iBAAiB,GAC9B,OAAO,CAAC,WAAW,CAAC,CAyBtB;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,iBAAiB,GAC3B,OAAO,CAAC,WAAW,CAAC,CAwEtB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type SpotWidgetOptions, type SelectionData } from "./types.js";
|
|
2
2
|
declare class SpotWidget {
|
|
3
3
|
private options;
|
|
4
4
|
private root;
|
|
@@ -27,5 +27,6 @@ declare class SpotWidget {
|
|
|
27
27
|
destroy(): void;
|
|
28
28
|
}
|
|
29
29
|
export default SpotWidget;
|
|
30
|
-
export
|
|
30
|
+
export { SelectionEnum } from "./types.js";
|
|
31
|
+
export type { SpotWidgetOptions, SelectionData, Quote, QuoteUpdates, ApiConfig, QuoteRequestData, QuoteItem, BatchQuoteItem, BatchQuoteRequest, QualifyingReason, PayoutScheduleItem, Communication, ApiResponse, ApiError, ElementOptions, QuoteMetadata, Callbacks, Theme, } from "./types.js";
|
|
31
32
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,aAAa,EAInB,MAAM,YAAY,CAAC;AAkBpB,cAAM,UAAU;IACd,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,IAAI,CAAc;IAC1B,OAAO,CAAC,gBAAgB,CAAgB;IACxC,OAAO,CAAC,SAAS,CAAC,CAAc;IAChC,OAAO,CAAC,cAAc,CAAC,CAAc;IACrC,OAAO,CAAC,OAAO,CAAC,CAAc;IAC9B,OAAO,CAAC,KAAK,CAAC,CAAQ;IACtB,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,eAAe,CAAC,CAAiB;gBAE7B,OAAO,GAAE,OAAO,CAAC,iBAAiB,CAAM;YAuBtC,KAAK;IA+FnB,OAAO,CAAC,aAAa;IAoDrB,OAAO,CAAC,aAAa;IAkBrB,OAAO,CAAC,uBAAuB;IAqC/B,OAAO,CAAC,oBAAoB;IAkB5B,OAAO,CAAC,uBAAuB;IAW/B,OAAO,CAAC,cAAc,CAAC,CAAS;IAEhC,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,qBAAqB;IA2F7B,kBAAkB,IAAI,IAAI;IAgB1B,kBAAkB,IAAI,IAAI;IAM1B,iBAAiB,IAAI,OAAO;IAgBtB,WAAW,CACf,mBAAmB,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,GACzD,OAAO,CAAC,OAAO,CAAC;IAqEnB,YAAY,IAAI,aAAa,GAAG,IAAI;IA+BpC,OAAO,IAAI,IAAI;CAahB;AAED,eAAe,UAAU,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,YAAY,EACV,iBAAiB,EACjB,aAAa,EACb,KAAK,EACL,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,QAAQ,EACR,cAAc,EACd,aAAa,EACb,SAAS,EACT,KAAK,GACN,MAAM,YAAY,CAAC"}
|