@quantaroute/checkout 1.7.3 → 1.7.4
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 +16 -0
- package/README.md +3 -0
- package/dist/lib/index.d.ts +20 -1
- package/dist/lib/quantaroute-checkout.es.js +146 -131
- package/dist/lib/quantaroute-checkout.umd.js +148 -133
- package/package.json +1 -1
- package/src/components/AddressForm.native.tsx +3 -3
- package/src/components/AddressForm.tsx +3 -3
- package/src/components/CheckoutWidget.tsx +48 -14
- package/src/components/MapPinSelector.native.tsx +14 -3
- package/src/components/MapPinSelector.tsx +23 -2
- package/src/components/PaymentStep.tsx +36 -8
- package/src/core/map-runtime.ts +22 -0
- package/src/core/types.ts +13 -1
- package/src/index.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,22 @@ Release dates are from git history where available; earlier versions are estimat
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.7.4](https://github.com/quantaroute/checkout/compare/v1.7.3...v1.7.4) — 2026-11-14
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **`mapsKey` prop** on `MapPinSelector` and `CheckoutWidget`. When the style is on `maps.quantaroute.com`, MapLibre `transformRequest` attaches `?key=` to style, sprite, font and tile requests. Shopify and other third-party hosts need a public `dp_` key with the maps scope; first-party sites can omit it.
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- **Cash on Delivery at the payment step**: eligibility is now checked as soon as an address is chosen, so the COD option can appear before `done`; it resets when the address changes
|
|
19
|
+
- **Address form**: no duplicate address when Save is clicked twice; `onAddressComplete` may return a promise and the form stays in its submitting state until it settles (web and native)
|
|
20
|
+
- **Map search**: spinner no longer sticks after deleting characters or entering a DigiPin, and a slow older autocomplete response no longer overwrites newer results (web and native)
|
|
21
|
+
- **Saved address selection**: `session.address_completed` webhook, CRM relay and funnel event fire once instead of twice
|
|
22
|
+
- **Razorpay loader**: the pay button no longer hangs on "Processing..." when the script tag failed or stalled; it times out after 15 s and retries cleanly
|
|
23
|
+
- **Change Address**: a verified buyer returns to saved addresses instead of the OTP step; after a payment the finished session is dropped and the buyer signs in again
|
|
24
|
+
- **Edge functions**: `checkout-addresses`, `checkout-payment` and `checkout-session-expiry` no longer overwrite a `completed` or `expired` session
|
|
25
|
+
|
|
10
26
|
## [1.7.3](https://github.com/quantaroute/checkout/compare/v1.7.2...v1.7.3) — 2026-11-09
|
|
11
27
|
|
|
12
28
|
### Changed
|
package/README.md
CHANGED
|
@@ -92,6 +92,7 @@ export default function CheckoutPage() {
|
|
|
92
92
|
return (
|
|
93
93
|
<CheckoutWidget
|
|
94
94
|
apiKey={process.env.NEXT_PUBLIC_QUANTAROUTE_KEY!}
|
|
95
|
+
mapsKey={process.env.NEXT_PUBLIC_QUANTAROUTE_MAPS_KEY}
|
|
95
96
|
onComplete={(address) => {
|
|
96
97
|
console.log(address.digipin); // "39J-438-TJC7"
|
|
97
98
|
console.log(address.pincode); // "110011"
|
|
@@ -103,6 +104,8 @@ export default function CheckoutPage() {
|
|
|
103
104
|
}
|
|
104
105
|
```
|
|
105
106
|
|
|
107
|
+
Third-party hosts must pass `mapsKey` (a public `dp_` key with the maps scope). First-party QuantaRoute sites can omit it.
|
|
108
|
+
|
|
106
109
|
### Next.js (App Router)
|
|
107
110
|
|
|
108
111
|
```tsx
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -50,7 +50,8 @@ export declare interface AddressFormProps {
|
|
|
50
50
|
lng: number;
|
|
51
51
|
apiKey: string;
|
|
52
52
|
apiBaseUrl?: string;
|
|
53
|
-
|
|
53
|
+
/** May return a promise; the form stays in its submitting state until it settles. */
|
|
54
|
+
onAddressComplete: (address: CompleteAddress) => void | Promise<void>;
|
|
54
55
|
onBack: () => void;
|
|
55
56
|
onError?: (error: Error) => void;
|
|
56
57
|
theme?: 'light' | 'dark';
|
|
@@ -318,6 +319,11 @@ export declare interface CheckoutWidgetProps {
|
|
|
318
319
|
* when the host loads MapLibre from a CDN (e.g. Shopify theme extensions).
|
|
319
320
|
*/
|
|
320
321
|
embedMode?: MapEmbedMode;
|
|
322
|
+
/**
|
|
323
|
+
* Public `dp_` key with the maps scope. Passed through to the map step.
|
|
324
|
+
* Shopify and other third-party hosts must set this; first-party sites can omit it.
|
|
325
|
+
*/
|
|
326
|
+
mapsKey?: string;
|
|
321
327
|
/**
|
|
322
328
|
* Show the smart search bar on the map step (default: true).
|
|
323
329
|
* Supports address search (API) and DigiPin lookup (100% offline).
|
|
@@ -780,6 +786,12 @@ export declare interface MapPinSelectorProps {
|
|
|
780
786
|
* `external` waits for `window.maplibregl` (CDN script loaded by the host).
|
|
781
787
|
*/
|
|
782
788
|
embedMode?: MapEmbedMode;
|
|
789
|
+
/**
|
|
790
|
+
* Public `dp_` key with the maps scope. Required when the style is on
|
|
791
|
+
* maps.quantaroute.com and the page is not a first-party origin. MapLibre
|
|
792
|
+
* `transformRequest` attaches it to the style, sprite, font and tile URLs.
|
|
793
|
+
*/
|
|
794
|
+
mapsKey?: string;
|
|
783
795
|
}
|
|
784
796
|
|
|
785
797
|
/** Subset of maplibre-gl used by the web MapPinSelector. */
|
|
@@ -790,6 +802,10 @@ export declare interface MapRuntime {
|
|
|
790
802
|
NavigationControl?: new (options?: ConstructorParameters<NonNullable<NavigationControl>>[0]) => NavigationControl;
|
|
791
803
|
}
|
|
792
804
|
|
|
805
|
+
export declare function mapsTransformRequest(key?: string): ((url: string) => {
|
|
806
|
+
url: string;
|
|
807
|
+
}) | undefined;
|
|
808
|
+
|
|
793
809
|
/**
|
|
794
810
|
* Normalise user input to a 10-character DigiPin body (no separators).
|
|
795
811
|
* Accepts dashed, spaced, or compact forms — e.g. `4P3-J68-637F`, `4P3 J68 637F`, `4P3J68637F`.
|
|
@@ -1149,4 +1165,7 @@ export declare function verifyPayment(config: CheckoutApiConfig, sessionToken: s
|
|
|
1149
1165
|
*/
|
|
1150
1166
|
export declare function waitForExternalMapRuntime(onReady: (runtime: MapRuntime) => void, onUnavailable: () => void, waitMs?: number, retryMs?: number): () => void;
|
|
1151
1167
|
|
|
1168
|
+
/** Attach `?key=` for MapLibre requests to maps.quantaroute.com. No-op for other hosts or a missing key. */
|
|
1169
|
+
export declare function withMapsKey(url: string, key?: string): string;
|
|
1170
|
+
|
|
1152
1171
|
export { }
|