@quantaroute/checkout 1.4.2 → 1.4.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 CHANGED
@@ -5,6 +5,37 @@ All notable changes to `@quantaroute/checkout` are documented here.
5
5
  Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
  Release dates are from git history where available; earlier versions are estimated from the first public commit.
7
7
 
8
+ ## [Unreleased]
9
+
10
+ ## [1.4.4](https://github.com/quantaroute/checkout/compare/v1.4.3...v1.4.4) — 2026-06-16
11
+
12
+ ### Added
13
+
14
+ - **Custom "Other" address label** — text input when Other is selected; persisted as `label_text` while `label` stays `other`
15
+ - `CompleteAddress.labelText` — returned on completion and when re-selecting saved addresses
16
+ - `couldBeDigiPinInput` and `isPotentialDigiPinInput` — partial DigiPin typing no longer triggers address autocomplete
17
+ - `npm run verify:digipin` — regression script for dashed, spaced, and compact DigiPin input
18
+
19
+ ### Changed
20
+
21
+ - **Address label picker** — compact pill chips with stroke SVG icons (web) and View-drawn icons (native); selected state uses primary tint instead of heavy borders
22
+ - **Native address form** — vector map-pin section icon replaces emoji in "Your details" header
23
+ - Saved address cards show custom `label_text` (e.g. "Friend's home") instead of generic "Other"
24
+
25
+ ## [1.4.3](https://github.com/quantaroute/checkout/compare/v1.4.2...v1.4.3) — 2026-06-16
26
+
27
+ ### Added
28
+
29
+ - `normalizeDigiPinInput`, `formatDigiPin`, and `isCompleteDigiPinInput` exports for flexible DigiPin parsing
30
+ - `CompleteAddress.addressId` — set when a buyer re-selects an existing saved address
31
+ - `CheckoutWidgetController` + `registerController` prop for host-page step navigation (e.g. Shopify pre-checkout shell)
32
+
33
+ ### Changed
34
+
35
+ - **Offline DigiPin search** accepts dashed, spaced, and compact input (`4P3-J68-637F`, `4P3 J68 637F`, `4P3J68637F`)
36
+ - `looksLikeDigiPin` and `isValidDigiPin` use normalised 10-character body instead of dashed-only regex
37
+ - `createAddress` skipped when re-selecting a saved row; new addresses no longer auto-set `is_default: true`
38
+
8
39
  ## [1.4.2](https://github.com/quantaroute/checkout/compare/v1.4.1...v1.4.2) — 2026-06-16
9
40
 
10
41
  ### Added
package/README.md CHANGED
@@ -845,7 +845,7 @@ When publishing a new version to npm (maintainers only):
845
845
  2. Run `npm run type-check && npm run build:lib && npm pack --dry-run` — confirm tarball contents.
846
846
  3. Confirm no `.env`, `.pem`, or `supabase/` paths in the pack list.
847
847
  4. Publish from a **clean git tag** with provenance: `npm publish --provenance --access public`.
848
- 5. Do **not** bump version in the same change unless releasing; current version is `1.4.0`.
848
+ 5. Do **not** bump version in the same change unless releasing; current version is `1.4.4`.
849
849
 
850
850
  ---
851
851
 
@@ -881,7 +881,7 @@ npx expo run:android # requires Android Studio
881
881
 
882
882
  ## Changelog
883
883
 
884
- See [CHANGELOG.md](./CHANGELOG.md) for version history. Current release: **v1.4.1**.
884
+ See [CHANGELOG.md](./CHANGELOG.md) for version history. Current release: **v1.4.4**.
885
885
 
886
886
  ---
887
887
 
@@ -161,6 +161,13 @@ declare const CheckoutWidget: default_2.FC<CheckoutWidgetProps>;
161
161
  export { CheckoutWidget }
162
162
  export default CheckoutWidget;
163
163
 
164
+ /** Imperative hooks for host pages (e.g. Shopify pre-checkout shell). */
165
+ declare interface CheckoutWidgetController {
166
+ /** Navigate one step back within the widget. Returns true if handled. */
167
+ goBack: () => boolean;
168
+ getStep: () => string;
169
+ }
170
+
164
171
  export declare interface CheckoutWidgetProps {
165
172
  /**
166
173
  * Your QuantaRoute API key.
@@ -293,6 +300,11 @@ export declare interface CheckoutWidgetProps {
293
300
  prepaidNudgeCopy?: string;
294
301
  /** Override merchant prepaid nudge CTA URL. */
295
302
  prepaidNudgeCtaUrl?: string;
303
+ /**
304
+ * Called once on mount with imperative navigation helpers for host shells
305
+ * (step-aware back button, etc.).
306
+ */
307
+ registerController?: (controller: CheckoutWidgetController) => void;
296
308
  }
297
309
 
298
310
  /**
@@ -356,6 +368,10 @@ export declare interface CompleteAddress {
356
368
  formattedAddress: string;
357
369
  /** Buyer-chosen label for saved-address book (defaults to home) */
358
370
  label?: AddressLabel;
371
+ /** Custom label text when `label` is `other` (e.g. "Friend's home") */
372
+ labelText?: string;
373
+ /** Set when the buyer re-selected an existing saved row (skip createAddress). */
374
+ addressId?: string;
359
375
  }
360
376
 
361
377
  export declare interface Coordinates {
@@ -363,6 +379,12 @@ export declare interface Coordinates {
363
379
  lng: number;
364
380
  }
365
381
 
382
+ /**
383
+ * Returns true while the user is typing a DigiPin (compact, dashed, or spaced).
384
+ * Used to suppress address autocomplete until the code is complete or abandoned.
385
+ */
386
+ export declare function couldBeDigiPinInput(input: string): boolean;
387
+
366
388
  /** Save a new address for the authenticated buyer. */
367
389
  export declare function createAddress(config: CheckoutApiConfig, sessionToken: string, address: SavedAddressPayload): Promise<SavedAddress>;
368
390
 
@@ -437,6 +459,9 @@ export declare function fetchPrepaidNudgeConfig(functionBaseUrl: string, adminAp
437
459
  /** Fetch UTM-matched offer banner for the current session. */
438
460
  export declare function fetchSessionOffer(config: CheckoutApiConfig, sessionToken: string): Promise<SessionOffer | null>;
439
461
 
462
+ /** Canonical display format: XXX-XXX-XXXX */
463
+ export declare function formatDigiPin(input: string): string;
464
+
440
465
  export declare interface FunnelEventPayload {
441
466
  event_type: string;
442
467
  step?: string;
@@ -468,6 +493,12 @@ export declare function getWebDeviceContext(): DeviceContext;
468
493
  /** True when at least one UTM field is set. */
469
494
  export declare function hasUtmParams(utm: UtmParams): boolean;
470
495
 
496
+ /** True when input is a complete 10-character DigiPin (any common separator style). */
497
+ export declare function isCompleteDigiPinInput(input: string): boolean;
498
+
499
+ /** True when normalised input is a non-empty prefix of a DigiPin (still being typed). */
500
+ export declare function isPotentialDigiPinInput(input: string): boolean;
501
+
471
502
  /**
472
503
  * Validate a DigiPin string (format + character check).
473
504
  */
@@ -559,6 +590,12 @@ export declare interface MapPinSelectorProps {
559
590
  brandColor?: string;
560
591
  }
561
592
 
593
+ /**
594
+ * Normalise user input to a 10-character DigiPin body (no separators).
595
+ * Accepts dashed, spaced, or compact forms — e.g. `4P3-J68-637F`, `4P3 J68 637F`, `4P3J68637F`.
596
+ */
597
+ export declare function normalizeDigiPinInput(input: string): string;
598
+
562
599
  /**
563
600
  * Notify the server that the buyer has confirmed their delivery address.
564
601
  * Triggers `session.address_completed` webhook on the merchant's configured URL.
@@ -695,6 +732,8 @@ export declare interface SavedAddress {
695
732
  building_name: string;
696
733
  street_name: string;
697
734
  label: string;
735
+ /** Custom display text when label is `other` */
736
+ label_text: string | null;
698
737
  is_default: boolean;
699
738
  created_at: string;
700
739
  updated_at: string;
@@ -717,6 +756,7 @@ export declare interface SavedAddressPayload {
717
756
  street_name?: string;
718
757
  full_address_json?: Record<string, unknown>;
719
758
  label?: string;
759
+ label_text?: string | null;
720
760
  is_default?: boolean;
721
761
  }
722
762