@odus/checkout 1.17.1 → 1.19.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/dist/checkout.es.js +241 -231
- package/dist/components/checkout/form/AddressSection.d.ts.map +1 -1
- package/dist/components/checkout/form/CardSection.d.ts.map +1 -1
- package/dist/components/checkout/form/CardUnavailableNotice.d.ts.map +1 -1
- package/dist/components/checkout/form/CardholderSection.d.ts.map +1 -1
- package/dist/components/checkout/form/Form.d.ts.map +1 -1
- package/dist/components/checkout/form/FormComponentManager.d.ts.map +1 -1
- package/dist/components/checkout/form/PhoneCountrySelector.d.ts.map +1 -1
- package/dist/components/checkout/form/PhoneNumberField.d.ts.map +1 -1
- package/dist/components/common/CountryDialCodeDropdown.d.ts.map +1 -1
- package/dist/components/common/Input.d.ts.map +1 -1
- package/dist/components/common/Select.d.ts.map +1 -1
- package/dist/core/constants/fontSize.constants.d.ts +7 -0
- package/dist/core/constants/fontSize.constants.d.ts.map +1 -0
- package/dist/core/vgs/VGSCollectService.d.ts +0 -7
- package/dist/core/vgs/VGSCollectService.d.ts.map +1 -1
- package/dist/elements/ApplePayElement.d.ts.map +1 -1
- package/dist/elements/EmailElement.d.ts.map +1 -1
- package/dist/elements/PayPalElement.d.ts.map +1 -1
- package/dist/elements/PhoneElement.d.ts.map +1 -1
- package/dist/elements/card/VgsCardAdapter.d.ts.map +1 -1
- package/dist/elements/cardElement.constants.d.ts.map +1 -1
- package/dist/elements/theme/index.d.ts.map +1 -1
- package/dist/elements.es.js +267 -267
- package/dist/factories/createCheckoutProfile.d.ts.map +1 -1
- package/dist/loader/loadOdus.d.ts +9 -1
- package/dist/loader/loadOdus.d.ts.map +1 -1
- package/dist/loader.d.ts +1 -1
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.es.js +20 -17
- package/dist/phone.js +477 -474
- package/dist/shared.js +360 -391
- package/dist/types/common/FormData.type.d.ts +0 -2
- package/dist/types/common/FormData.type.d.ts.map +1 -1
- package/dist/types/telemetry/TelemetryEvents.type.d.ts +2 -2
- package/dist/types/telemetry/TelemetryEvents.type.d.ts.map +1 -1
- package/dist/utils/dom/fontFamily.util.d.ts +23 -0
- package/dist/utils/dom/fontFamily.util.d.ts.map +1 -0
- package/dist/utils/dom/googleFontUrl.d.ts +5 -5
- package/dist/utils/dom/googleFontUrl.d.ts.map +1 -1
- package/dist/utils/dom/index.d.ts +1 -0
- package/dist/utils/dom/index.d.ts.map +1 -1
- package/dist/utils/phone/countryDialCodes.d.ts +6 -0
- package/dist/utils/phone/countryDialCodes.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCheckoutProfile.d.ts","sourceRoot":"","sources":["../../src/factories/createCheckoutProfile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createCheckoutProfile.d.ts","sourceRoot":"","sources":["../../src/factories/createCheckoutProfile.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAE9E,UAAU,oBAAqB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC5D,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,UAAU,GACrB,eAAe,CA0HjB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,UAAU,GACX,EAAE;IACD,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;;;mCAwBoC,UAAU;;EAoE9C"}
|
|
@@ -16,6 +16,8 @@ export type OdusIntegration = keyof RuntimeExports;
|
|
|
16
16
|
export type LoadedRuntime<I extends OdusIntegration> = RuntimeExports[I] & {
|
|
17
17
|
version: string;
|
|
18
18
|
};
|
|
19
|
+
/** The channels the CDN serves: `stable` (the default) and `beta`. */
|
|
20
|
+
export type OdusChannel = 'stable' | 'beta';
|
|
19
21
|
export type LoadOdusOptions = {
|
|
20
22
|
/**
|
|
21
23
|
* Where a failed load is reported: `test` to our sandbox, `live` (the
|
|
@@ -24,6 +26,11 @@ export type LoadOdusOptions = {
|
|
|
24
26
|
environment?: Environment;
|
|
25
27
|
/** How long to wait for the runtime and its styles, in ms. Default 15 s. */
|
|
26
28
|
timeout?: number;
|
|
29
|
+
/**
|
|
30
|
+
* The channel to load: `stable` (the default), or `beta` for the newest
|
|
31
|
+
* beta, which is never older than stable. Ignored when `version` is set.
|
|
32
|
+
*/
|
|
33
|
+
channel?: OdusChannel;
|
|
27
34
|
/**
|
|
28
35
|
* Pins an exact runtime version, `/r/<version>/`, instead of the channel
|
|
29
36
|
* that receives our fixes. Only a pinned version can carry `integrity`.
|
|
@@ -55,7 +62,8 @@ export declare class OdusLoadError extends Error {
|
|
|
55
62
|
* ```
|
|
56
63
|
*
|
|
57
64
|
* It fetches `/v1/<integration>.js`, the version we serve now, and never an
|
|
58
|
-
* older one than this loader's own
|
|
65
|
+
* older one than this loader's own; `{ channel: 'beta' }` fetches
|
|
66
|
+
* `/v1-beta/<integration>.js` instead. A failed load rejects with an
|
|
59
67
|
* `OdusLoadError`; calling again after a failure tries again.
|
|
60
68
|
*/
|
|
61
69
|
export declare function loadOdus<I extends OdusIntegration>(integration: I, options?: LoadOdusOptions): Promise<LoadedRuntime<I>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadOdus.d.ts","sourceRoot":"","sources":["../../src/loader/loadOdus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,KAAK,EAAE,W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C5B,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAiB3B"}
|
package/dist/loader.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { loadOdus, OdusLoadError, RUNTIME_ORIGIN } from './loader/loadOdus';
|
|
2
|
-
export type { LoadedRuntime, LoadOdusOptions, OdusIntegration, OdusLoadErrorCode, } from './loader/loadOdus';
|
|
2
|
+
export type { LoadedRuntime, LoadOdusOptions, OdusChannel, OdusIntegration, OdusLoadErrorCode, } from './loader/loadOdus';
|
|
3
3
|
//# sourceMappingURL=loader.d.ts.map
|
package/dist/loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC5E,YAAY,EACV,aAAa,EACb,eAAe,EACf,eAAe,EACf,iBAAiB,GAClB,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC5E,YAAY,EACV,aAAa,EACb,eAAe,EACf,WAAW,EACX,eAAe,EACf,iBAAiB,GAClB,MAAM,mBAAmB,CAAC"}
|
package/dist/loader.es.js
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
//#region libs/checkout/src/loader/loadOdus.ts
|
|
2
|
-
var e = "https://js.odus.com", t = "1.
|
|
2
|
+
var e = "https://js.odus.com", t = "1.19.0", n = {
|
|
3
3
|
test: "https://sandbox-analytics.odus.com/collect",
|
|
4
4
|
live: "https://analytics.odus.com/collect"
|
|
5
5
|
}, r = {
|
|
6
6
|
checkout: "OdusCheckout",
|
|
7
7
|
elements: "OdusElements"
|
|
8
|
-
}, i =
|
|
8
|
+
}, i = {
|
|
9
|
+
stable: "v1",
|
|
10
|
+
beta: "v1-beta"
|
|
11
|
+
}, a = class extends Error {
|
|
9
12
|
code;
|
|
10
13
|
constructor(e, t) {
|
|
11
14
|
super(t), this.name = "OdusLoadError", this.code = e;
|
|
12
15
|
}
|
|
13
|
-
},
|
|
14
|
-
function
|
|
15
|
-
if (
|
|
16
|
-
|
|
16
|
+
}, o = /* @__PURE__ */ new Map(), s = !1;
|
|
17
|
+
function c() {
|
|
18
|
+
if (s || typeof document > "u") return;
|
|
19
|
+
s = !0;
|
|
17
20
|
let t = document.createElement("link");
|
|
18
21
|
t.rel = "preconnect", t.href = e, t.crossOrigin = "anonymous", document.head.append(t);
|
|
19
22
|
}
|
|
20
|
-
|
|
21
|
-
function
|
|
23
|
+
c();
|
|
24
|
+
function l(e, r, i, a) {
|
|
22
25
|
try {
|
|
23
26
|
if (/^(localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1\])$|\.localhost$/.test(window.location.hostname)) return;
|
|
24
27
|
window.navigator.sendBeacon(n[e], JSON.stringify({
|
|
@@ -44,19 +47,19 @@ function c(e, r, i, a) {
|
|
|
44
47
|
}));
|
|
45
48
|
} catch {}
|
|
46
49
|
}
|
|
47
|
-
function
|
|
48
|
-
let { environment: o = "live", timeout: s = 15e3, integrity:
|
|
50
|
+
function u(e, n, i) {
|
|
51
|
+
let { environment: o = "live", timeout: s = 15e3, integrity: c } = i, u = performance.now();
|
|
49
52
|
return new Promise((d, f) => {
|
|
50
53
|
let p = !1, m = !1, h = (e) => {
|
|
51
54
|
e.disposition !== "report" && `${e.blockedURI}/`.startsWith("https://js.odus.com/") && (p = !0);
|
|
52
55
|
}, g = () => !m && (m = !0, clearTimeout(y), document.removeEventListener("securitypolicyviolation", h), !0), _ = (t, n) => {
|
|
53
|
-
g() && (
|
|
56
|
+
g() && (l(o, e, t, i.version ?? (i.channel === "beta" ? "beta" : "channel")), f(new a(t, n)));
|
|
54
57
|
}, v = (e) => _(p ? "blocked_by_csp" : "network", `${e} ${p ? "was blocked by the page CSP" : "could not load"}: ${n}`);
|
|
55
58
|
document.addEventListener("securitypolicyviolation", h);
|
|
56
59
|
let y = setTimeout(() => _("timeout", `No runtime within ${s} ms: ${n}`), s), b = globalThis.__ODUS_RUNTIME__ ??= {};
|
|
57
60
|
delete b[1];
|
|
58
61
|
let x = document.createElement("script");
|
|
59
|
-
x.src = n, x.crossOrigin = "anonymous",
|
|
62
|
+
x.src = n, x.crossOrigin = "anonymous", c && (x.integrity = c), x.addEventListener("error", () => setTimeout(() => v("The Odus runtime"))), x.addEventListener("load", () => {
|
|
60
63
|
let i = b[1];
|
|
61
64
|
if (delete b[1], m) return;
|
|
62
65
|
let a;
|
|
@@ -78,10 +81,10 @@ function l(e, n, a) {
|
|
|
78
81
|
}), document.head.append(x);
|
|
79
82
|
});
|
|
80
83
|
}
|
|
81
|
-
function
|
|
82
|
-
|
|
83
|
-
let
|
|
84
|
-
return
|
|
84
|
+
function d(n, r = {}) {
|
|
85
|
+
c();
|
|
86
|
+
let a = r.version ? `${e}/r/${r.version}/${n}.js` : `${e}/${r.channel === "beta" ? i.beta : i.stable}/${n}.js?min=${t}`, s = `${a} ${r.integrity ?? ""}`, l = o.get(s);
|
|
87
|
+
return l || (l = u(n, a, r), o.set(s, l), l.catch(() => o.delete(s))), l;
|
|
85
88
|
}
|
|
86
89
|
//#endregion
|
|
87
|
-
export {
|
|
90
|
+
export { a as OdusLoadError, e as RUNTIME_ORIGIN, d as loadOdus };
|