@getspot/spot-widget 2.1.0 → 3.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 +12 -0
- package/README.md +13 -6
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +280 -255
- package/dist/index.umd.js +4 -4
- package/dist/types.d.ts +7 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @getspot/spot-widget
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- c1cce5f: Add ability to override displayed price in onQuoteRetrieved callback
|
|
8
|
+
|
|
9
|
+
## 2.1.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 0308688: test publish commands
|
|
14
|
+
|
|
3
15
|
## 2.1.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -456,6 +456,15 @@ export interface Quote {
|
|
|
456
456
|
}
|
|
457
457
|
```
|
|
458
458
|
|
|
459
|
+
#### QuoteUpdates
|
|
460
|
+
|
|
461
|
+
```typescript
|
|
462
|
+
export interface QuoteUpdates {
|
|
463
|
+
spotPrice?: number;
|
|
464
|
+
yesOptionText?: string;
|
|
465
|
+
}
|
|
466
|
+
```
|
|
467
|
+
|
|
459
468
|
#### ApiResponse
|
|
460
469
|
|
|
461
470
|
```typescript
|
|
@@ -494,12 +503,8 @@ export interface SelectionData {
|
|
|
494
503
|
export interface Callbacks {
|
|
495
504
|
onOptIn?: (data: SelectionData) => void;
|
|
496
505
|
onOptOut?: (data: SelectionData) => void;
|
|
497
|
-
onQuoteRetrieved?: (quote: Quote) => void;
|
|
498
|
-
onError?: (error: {
|
|
499
|
-
message: string;
|
|
500
|
-
status?: number;
|
|
501
|
-
responseBody?: any;
|
|
502
|
-
}) => void;
|
|
506
|
+
onQuoteRetrieved?: (quote: Quote) => QuoteUpdates | void;
|
|
507
|
+
onError?: (error: { message: string; status?: number; responseBody?: any }) => void;
|
|
503
508
|
noMatchingQuote?: (data: { status: string; data: QuoteRequestData }) => void;
|
|
504
509
|
}
|
|
505
510
|
```
|
|
@@ -525,6 +530,8 @@ export interface SpotWidgetOptions {
|
|
|
525
530
|
callbacks?: Callbacks;
|
|
526
531
|
theme?: Theme;
|
|
527
532
|
isPartialPayment?: boolean;
|
|
533
|
+
useMockData?: boolean;
|
|
534
|
+
mockData?: ApiResponse;
|
|
528
535
|
}
|
|
529
536
|
```
|
|
530
537
|
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ declare class SpotWidget {
|
|
|
16
16
|
private _shouldUseDesktopLayout;
|
|
17
17
|
private _setupResizeObserver;
|
|
18
18
|
private _resizeTimeout?;
|
|
19
|
+
private _applyQuoteUpdates;
|
|
19
20
|
private _setupOptionListeners;
|
|
20
21
|
showSelectionError(): void;
|
|
21
22
|
hideSelectionError(): void;
|
|
@@ -25,5 +26,5 @@ declare class SpotWidget {
|
|
|
25
26
|
destroy(): void;
|
|
26
27
|
}
|
|
27
28
|
export default SpotWidget;
|
|
28
|
-
export type { SpotWidgetOptions, SelectionData, Quote, ApiConfig, QuoteRequestData, QuoteItem, BatchQuoteItem, BatchQuoteRequest, CartInfo, QualifyingReason, PayoutScheduleItem, Communication, ApiResponse, ApiError, ElementOptions, QuoteMetadata, Callbacks, Theme, } from "./types.js";
|
|
29
|
+
export type { SpotWidgetOptions, SelectionData, Quote, QuoteUpdates, ApiConfig, QuoteRequestData, QuoteItem, BatchQuoteItem, BatchQuoteRequest, CartInfo, QualifyingReason, PayoutScheduleItem, Communication, ApiResponse, ApiError, ElementOptions, QuoteMetadata, Callbacks, Theme, } from "./types.js";
|
|
29
30
|
//# 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,KAAK,EAAE,iBAAiB,EAAS,aAAa,EAAmC,MAAM,YAAY,CAAC;AAkB3G,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;IAiGnB,OAAO,CAAC,aAAa;IAkDrB,OAAO,CAAC,aAAa;IAkBrB,OAAO,CAAC,uBAAuB;IAqC/B,OAAO,CAAC,oBAAoB;IAkB5B,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;IAoEnB,YAAY,IAAI,aAAa,GAAG,IAAI;IA+BpC,OAAO,IAAI,IAAI;CAahB;AAED,eAAe,UAAU,CAAC;AAC1B,YAAY,EACV,iBAAiB,EACjB,aAAa,EACb,KAAK,EACL,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,QAAQ,EACR,cAAc,EACd,aAAa,EACb,SAAS,EACT,KAAK,GACN,MAAM,YAAY,CAAC"}
|