@odus/checkout 1.10.2 → 1.11.1

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.
@@ -1,5 +1,6 @@
1
1
  export * from './appendGoogleFont';
2
2
  export * from './createSyntheticEvent.util';
3
3
  export * from './fetchGoogleFontFace';
4
+ export * from './preconnectOrigins';
4
5
  export * from './restoreCursorAfterFormat.util';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/dom/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/dom/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Adds the preconnect hints to the host page. Safe to call more than once: a
3
+ * hint the host page or the VGS vendor already added is left alone.
4
+ *
5
+ * The work waits for one microtask. `@vgs/collect-js` adds its own hints from a
6
+ * microtask that it queues when the bundle evaluates, which is always before
7
+ * this call, so the wait lets that hint arrive first and keeps the VGS target
8
+ * from becoming a duplicate. If the vendor ever stops, the VGS target above
9
+ * still warms the origin.
10
+ */
11
+ export declare const preconnectOrigins: () => void;
12
+ //# sourceMappingURL=preconnectOrigins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preconnectOrigins.d.ts","sourceRoot":"","sources":["../../../src/utils/dom/preconnectOrigins.ts"],"names":[],"mappings":"AA2FA;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,QAAO,IAIpC,CAAC"}
@@ -1,20 +1,43 @@
1
- type Country = 'US' | 'CA';
1
+ /**
2
+ * The countries whose first-level subdivision the SDK knows by name, and so
3
+ * renders as a required select instead of free text. This list is the single
4
+ * source for every place that asks the question — the Drop-in address section,
5
+ * the Elements state field and the validation schema — so a fourth country is
6
+ * added here and nowhere else.
7
+ */
8
+ export type StateCountry = 'US' | 'CA' | 'AU';
9
+ export declare const STATE_COUNTRIES: ReadonlySet<string>;
10
+ /**
11
+ * Whether a country code has a subdivision list the SDK can render.
12
+ */
13
+ export declare const isStateCountry: (country: string | undefined) => country is StateCountry;
14
+ /**
15
+ * Narrows a country code to one with a subdivision list. An unknown code
16
+ * answers `US`, which keeps a caller that already decided to render a select
17
+ * from rendering an empty one.
18
+ */
19
+ export declare const toStateCountry: (country: string | undefined) => StateCountry;
20
+ /**
21
+ * The translation key of the placeholder a country's select shows. Australian
22
+ * subdivisions are states and territories, so Australia shares the American
23
+ * key rather than the Canadian one.
24
+ */
25
+ export declare const getStatePlaceholderKey: (country: StateCountry) => string;
2
26
  /**
3
27
  * Get all region codes for a country
4
28
  */
5
- export declare const getAllStateCodes: (country?: Country) => string[];
29
+ export declare const getAllStateCodes: (country?: StateCountry) => string[];
6
30
  /**
7
31
  * Get human-readable region name from code
8
32
  */
9
- export declare const getStateName: (stateCode: string, country?: Country) => string;
33
+ export declare const getStateName: (stateCode: string, country?: StateCountry) => string;
10
34
  /**
11
35
  * Get state/province options for dropdown
12
- * @param country Country code ('US' or 'CA'). Defaults to 'US'.
36
+ * @param country Country code ('US', 'CA' or 'AU'). Defaults to 'US'.
13
37
  * @returns Array of options with value (code) and text (name)
14
38
  */
15
- export declare const getStateOptions: (country?: Country) => Array<{
39
+ export declare const getStateOptions: (country?: StateCountry) => Array<{
16
40
  value: string;
17
41
  text: string;
18
42
  }>;
19
- export {};
20
43
  //# sourceMappingURL=stateNames.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stateNames.d.ts","sourceRoot":"","sources":["../../../src/utils/state/stateNames.ts"],"names":[],"mappings":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":3,"file":"createValidationSchema.d.ts","sourceRoot":"","sources":["../../../src/utils/validation/createValidationSchema.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;mBAKhB,MAAM,KAAG,MAAM,GAAG,SAAS;IAK1C;;;OAGG;6BACsB,MAAM,KAAG,MAAM,GAAG,SAAS;yBAK/B,MAAM,gBAAgB,MAAM,KAAG,MAAM,GAAG,SAAS;kBAiCxD,MAAM,KAAG,MAAM,GAAG,SAAS;oBAQzB,MAAM,KAAG,MAAM,GAAG,SAAS;uBAOxB,MAAM,KAAG,MAAM,GAAG,SAAS;sBAO5B,MAAM,KAAG,MAAM,GAAG,SAAS;kBAO/B,MAAM,KAAG,MAAM,GAAG,SAAS;mBAO1B,MAAM,YAAY,MAAM,KAAG,MAAM,GAAG,SAAS;qBAU3C,MAAM,KAAG,MAAM,GAAG,SAAS;qBAO3B,MAAM,KAAG,MAAM,GAAG,SAAS;CAO/C,CAAC"}
1
+ {"version":3,"file":"createValidationSchema.d.ts","sourceRoot":"","sources":["../../../src/utils/validation/createValidationSchema.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;mBAKhB,MAAM,KAAG,MAAM,GAAG,SAAS;IAK1C;;;OAGG;6BACsB,MAAM,KAAG,MAAM,GAAG,SAAS;yBAK/B,MAAM,gBAAgB,MAAM,KAAG,MAAM,GAAG,SAAS;kBAiCxD,MAAM,KAAG,MAAM,GAAG,SAAS;oBAQzB,MAAM,KAAG,MAAM,GAAG,SAAS;uBAOxB,MAAM,KAAG,MAAM,GAAG,SAAS;sBAO5B,MAAM,KAAG,MAAM,GAAG,SAAS;kBAO/B,MAAM,KAAG,MAAM,GAAG,SAAS;mBAO1B,MAAM,YAAY,MAAM,KAAG,MAAM,GAAG,SAAS;qBAU3C,MAAM,KAAG,MAAM,GAAG,SAAS;qBAO3B,MAAM,KAAG,MAAM,GAAG,SAAS;CAO/C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odus/checkout",
3
- "version": "1.10.2",
3
+ "version": "1.11.1",
4
4
  "displayName": "Odus Checkout SDK",
5
5
  "keywords": [
6
6
  "odus",