@evervault/react
Advanced tools
Comparing version 2.14.0 to 2.15.0
@@ -131,3 +131,3 @@ import { events } from 'events'; | ||
export declare interface ApplePayErrorMessage { | ||
message: string | ||
message: string; | ||
code?: ApplePayJS.ApplePayErrorCode; | ||
@@ -164,12 +164,12 @@ contactField?: ApplePayJS.ApplePayErrorContactField; | ||
allowedCardNetworks?: ApplePayCardNetwork[]; | ||
paymentRequest?: ApplePayPaymentRequest; | ||
paymentRequest?: ApplePayPaymentRequest; | ||
} | ||
export declare interface ApplePayPaymentDataRequest { | ||
export declare interface ApplePayPaymentDataRequest { | ||
encryptedCredentials: ApplePayToken; | ||
} | ||
export declare type ApplePayPaymentRequest = | ||
| ApplePayRecurringPaymentRequest | ||
| ApplePayDeferredPaymentRequest | ||
export declare type ApplePayPaymentRequest = | ||
| ApplePayRecurringPaymentRequest | ||
| ApplePayDeferredPaymentRequest | ||
| ApplePayAutomaticReloadPaymentRequest | ||
@@ -639,3 +639,3 @@ | ApplePayStandardPaymentRequest; | ||
forms: { | ||
handleForm(form: any): Promise<{}>; | ||
handleForm(form: HTMLFormElement): Promise<{}>; | ||
register(): void; | ||
@@ -1480,3 +1480,3 @@ events: events<[never]>; | ||
export declare function ThreeDSecure({ session, theme, size, onReady, onError, onSuccess, onFailure, }: ThreeDSecureProps): React_2.JSX.Element; | ||
export declare function ThreeDSecure({ session, theme, size, onReady, onError, onSuccess, onFailure, failOnChallenge, }: ThreeDSecureProps): React_2.JSX.Element; | ||
@@ -1495,2 +1495,3 @@ declare class ThreeDSecure_2 { | ||
isOverlay: boolean; | ||
failOnChallenge: boolean; | ||
}; | ||
@@ -1515,8 +1516,15 @@ }; | ||
EV_FAILURE: string | undefined | null; | ||
EV_FAIL_ON_CHALLENGE: undefined; | ||
EV_CANCEL: undefined; | ||
} | ||
export declare interface ThreeDSecureFrameHostMessages | ||
extends EvervaultFrameHostMessages { | ||
EV_FAIL_ON_CHALLENGE_RESULT: boolean; | ||
} | ||
export declare interface ThreeDSecureOptions { | ||
theme?: ThemeDefinition; | ||
size?: { width: string; height: string }; | ||
failOnChallenge?: boolean | (() => boolean) | (() => Promise<boolean>); | ||
} | ||
@@ -1535,2 +1543,3 @@ | ||
onError?: (error: ComponentError) => void; | ||
failOnChallenge?: boolean | (() => boolean) | (() => Promise<boolean>); | ||
} | ||
@@ -1602,2 +1611,3 @@ | ||
}; | ||
failOnChallenge?: boolean | (() => boolean) | (() => Promise<boolean>); | ||
} | ||
@@ -1604,0 +1614,0 @@ |
"use client"; | ||
import * as d from "react"; | ||
import { createContext as _, useContext as q, useState as C, useRef as b, useLayoutEffect as S, useEffect as h, useMemo as M, useCallback as j } from "react"; | ||
function G(o) { | ||
return (n) => ({ | ||
import * as u from "react"; | ||
import { createContext as _, useContext as q, useState as C, useRef as b, useLayoutEffect as S, useEffect as m, useMemo as M, useCallback as j } from "react"; | ||
function G(t) { | ||
return (o) => ({ | ||
styles: { | ||
@@ -99,8 +99,8 @@ ":root": { | ||
}, | ||
...o ? n.extend(o) : {} | ||
...t ? o.extend(t) : {} | ||
} | ||
}); | ||
} | ||
function J(o) { | ||
return (n) => ({ | ||
function J(t) { | ||
return (o) => ({ | ||
styles: { | ||
@@ -203,8 +203,8 @@ body: { | ||
}, | ||
...o ? n.extend(o) : {} | ||
...t ? o.extend(t) : {} | ||
} | ||
}); | ||
} | ||
function N(o) { | ||
return (n) => ({ | ||
function N(t) { | ||
return (o) => ({ | ||
styles: { | ||
@@ -353,3 +353,3 @@ ":root": { | ||
}, | ||
...o ? n.extend(o) : {} | ||
...t ? o.extend(t) : {} | ||
} | ||
@@ -367,12 +367,12 @@ }); | ||
return null; | ||
if (typeof d.useContext != "function") | ||
if (typeof u.useContext != "function") | ||
throw new Error( | ||
"You must use React >= 18.0 in order to use useEvervault()" | ||
); | ||
const o = d.useContext(L); | ||
if (!o) | ||
const t = u.useContext(L); | ||
if (!t) | ||
throw new Error( | ||
"You must wrap your app in an <EvervaultProvider> to use useEvervault()" | ||
); | ||
return o; | ||
return t; | ||
} | ||
@@ -383,56 +383,56 @@ const O = _( | ||
function Y() { | ||
const o = q(O); | ||
if (!o) | ||
const t = q(O); | ||
if (!t) | ||
throw new Error("Reveal consumers must be used within a Reveal component"); | ||
return o; | ||
return t; | ||
} | ||
function Q({ | ||
path: o, | ||
onCopy: n, | ||
path: t, | ||
onCopy: o, | ||
...r | ||
}) { | ||
const [u, l] = C(null), f = b(null), { reveal: e } = Y(); | ||
return d.useEffect(() => { | ||
if (!(!u || !n)) | ||
return u == null ? void 0 : u.on("copy", n); | ||
}, [u, n]), S(() => { | ||
if ((!f.current || u) ?? !e) | ||
const [i, a] = C(null), f = b(null), { reveal: e } = Y(); | ||
return u.useEffect(() => { | ||
if (!(!i || !o)) | ||
return i == null ? void 0 : i.on("copy", o); | ||
}, [i, o]), S(() => { | ||
if ((!f.current || i) ?? !e) | ||
return; | ||
const a = e == null ? void 0 : e.copyButton(o, r); | ||
a.mount(f.current), l(a); | ||
}, [e, o, r, u]), /* @__PURE__ */ d.createElement("div", { ref: f }); | ||
const c = e == null ? void 0 : e.copyButton(t, r); | ||
c.mount(f.current), a(c); | ||
}, [e, t, r, i]), /* @__PURE__ */ u.createElement("div", { ref: f }); | ||
} | ||
function U({ path: o, theme: n, format: r }) { | ||
const [u, l] = C(null), f = b(null), { reveal: e } = Y(); | ||
function U({ path: t, theme: o, format: r }) { | ||
const [i, a] = C(null), f = b(null), { reveal: e } = Y(); | ||
return S(() => { | ||
if ((!f.current || u) ?? !e) | ||
if ((!f.current || i) ?? !e) | ||
return; | ||
const a = e.text(o, { | ||
theme: n, | ||
const c = e.text(t, { | ||
theme: o, | ||
format: r | ||
}); | ||
a.mount(f.current), l(a); | ||
}, [e, o, n, r, u]), /* @__PURE__ */ d.createElement("div", { ref: f }); | ||
c.mount(f.current), a(c); | ||
}, [e, t, o, r, i]), /* @__PURE__ */ u.createElement("div", { ref: f }); | ||
} | ||
function D({ request: o, children: n, onReady: r, onError: u }) { | ||
const l = b(!1), f = E(), [e, a] = C(null), c = b(null); | ||
return d.useEffect(() => { | ||
function D({ request: t, children: o, onReady: r, onError: i }) { | ||
const a = b(!1), f = E(), [e, c] = C(null), v = b(null); | ||
return u.useEffect(() => { | ||
if (!(!e || !r)) | ||
return e == null ? void 0 : e.on("ready", r); | ||
}, [e, r]), d.useEffect(() => { | ||
if (!(!e || !u)) | ||
return e == null ? void 0 : e.on("error", u); | ||
}, [e, u]), h(() => { | ||
if (!c.current || l.current) | ||
}, [e, r]), u.useEffect(() => { | ||
if (!(!e || !i)) | ||
return e == null ? void 0 : e.on("error", i); | ||
}, [e, i]), m(() => { | ||
if (!v.current || a.current) | ||
return; | ||
async function s() { | ||
l.current = !0; | ||
const t = await f; | ||
if (!t) | ||
a.current = !0; | ||
const l = await f; | ||
if (!l) | ||
return; | ||
const v = t.ui.reveal(o); | ||
a(v); | ||
const d = l.ui.reveal(t); | ||
c(d); | ||
} | ||
s().catch(console.error); | ||
}, [e, o, f]), /* @__PURE__ */ d.createElement(O.Provider, { value: { reveal: e } }, /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("div", { ref: c }), n)); | ||
}, [e, t, f]), /* @__PURE__ */ u.createElement(O.Provider, { value: { reveal: e } }, /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement("div", { ref: v }), o)); | ||
} | ||
@@ -442,71 +442,71 @@ D.Text = U; | ||
function ee({ | ||
theme: o, | ||
icons: n, | ||
theme: t, | ||
icons: o, | ||
fields: r, | ||
autoFocus: u, | ||
translations: l, | ||
autoFocus: i, | ||
translations: a, | ||
onSwipe: f, | ||
onReady: e, | ||
onError: a, | ||
onChange: c, | ||
onError: c, | ||
onChange: v, | ||
onComplete: s, | ||
onFocus: t, | ||
onBlur: v, | ||
onFocus: l, | ||
onBlur: d, | ||
onKeyUp: p, | ||
onKeyDown: m, | ||
autoComplete: g, | ||
onKeyDown: h, | ||
autoComplete: w, | ||
autoProgress: x, | ||
acceptedBrands: w, | ||
acceptedBrands: g, | ||
defaultValues: P | ||
}) { | ||
const A = E(), B = b(!1), y = b(null), [i, H] = d.useState(null); | ||
h(() => { | ||
if (!(!i || !e)) | ||
return i == null ? void 0 : i.on("ready", e); | ||
}, [i, e]), h(() => { | ||
if (!(!i || !a)) | ||
return i == null ? void 0 : i.on("error", a); | ||
}, [i, a]), h(() => { | ||
if (!(!i || !f)) | ||
return i == null ? void 0 : i.on("swipe", f); | ||
}, [i, f]), h(() => { | ||
if (!(!i || !c)) | ||
return i == null ? void 0 : i.on("change", c); | ||
}, [i, c]), h(() => { | ||
if (!(!i || !s)) | ||
return i == null ? void 0 : i.on("complete", s); | ||
}, [i, s]), h(() => { | ||
if (!(!i || !t)) | ||
return i == null ? void 0 : i.on("focus", t); | ||
}, [i, t]), h(() => { | ||
if (!(!i || !v)) | ||
return i == null ? void 0 : i.on("blur", v); | ||
}, [i, v]), h(() => { | ||
if (!(!i || !p)) | ||
return i == null ? void 0 : i.on("keyup", p); | ||
}, [i, p]), h(() => { | ||
if (!(!i || !m)) | ||
return i == null ? void 0 : i.on("keydown", m); | ||
}, [i, m]); | ||
const A = E(), B = b(!1), y = b(null), [n, H] = u.useState(null); | ||
m(() => { | ||
if (!(!n || !e)) | ||
return n == null ? void 0 : n.on("ready", e); | ||
}, [n, e]), m(() => { | ||
if (!(!n || !c)) | ||
return n == null ? void 0 : n.on("error", c); | ||
}, [n, c]), m(() => { | ||
if (!(!n || !f)) | ||
return n == null ? void 0 : n.on("swipe", f); | ||
}, [n, f]), m(() => { | ||
if (!(!n || !v)) | ||
return n == null ? void 0 : n.on("change", v); | ||
}, [n, v]), m(() => { | ||
if (!(!n || !s)) | ||
return n == null ? void 0 : n.on("complete", s); | ||
}, [n, s]), m(() => { | ||
if (!(!n || !l)) | ||
return n == null ? void 0 : n.on("focus", l); | ||
}, [n, l]), m(() => { | ||
if (!(!n || !d)) | ||
return n == null ? void 0 : n.on("blur", d); | ||
}, [n, d]), m(() => { | ||
if (!(!n || !p)) | ||
return n == null ? void 0 : n.on("keyup", p); | ||
}, [n, p]), m(() => { | ||
if (!(!n || !h)) | ||
return n == null ? void 0 : n.on("keydown", h); | ||
}, [n, h]); | ||
const z = M( | ||
() => ({ | ||
theme: o, | ||
icons: n, | ||
theme: t, | ||
icons: o, | ||
fields: r, | ||
autoFocus: u, | ||
translations: l, | ||
autoComplete: g, | ||
autoFocus: i, | ||
translations: a, | ||
autoComplete: w, | ||
autoProgress: x, | ||
acceptedBrands: w, | ||
acceptedBrands: g, | ||
defaultValues: P | ||
}), | ||
[ | ||
t, | ||
o, | ||
n, | ||
l, | ||
a, | ||
r, | ||
u, | ||
i, | ||
w, | ||
x, | ||
g, | ||
x, | ||
w, | ||
P | ||
@@ -528,35 +528,35 @@ ] | ||
} | ||
i ? i.update(z) : V().catch(console.error); | ||
}, [z, i]), /* @__PURE__ */ d.createElement("div", { ref: y }); | ||
n ? n.update(z) : V().catch(console.error); | ||
}, [z, n]), /* @__PURE__ */ u.createElement("div", { ref: y }); | ||
} | ||
function re({ | ||
theme: o, | ||
autoFocus: n, | ||
theme: t, | ||
autoFocus: o, | ||
mode: r, | ||
inputType: u, | ||
length: l, | ||
inputType: i, | ||
length: a, | ||
onReady: f, | ||
onChange: e, | ||
onError: a | ||
onError: c | ||
}) { | ||
const c = E(), s = b(!1), [t, v] = d.useState(null), p = b(null); | ||
d.useEffect(() => { | ||
if (!(!t || !f)) | ||
return t == null ? void 0 : t.on("ready", f); | ||
}, [t, f]), d.useEffect(() => { | ||
if (!(!t || !a)) | ||
return t == null ? void 0 : t.on("error", a); | ||
}, [t, a]), d.useEffect(() => { | ||
if (!(!t || !e)) | ||
return t == null ? void 0 : t.on("change", e); | ||
}, [t, e]); | ||
const m = M( | ||
const v = E(), s = b(!1), [l, d] = u.useState(null), p = b(null); | ||
u.useEffect(() => { | ||
if (!(!l || !f)) | ||
return l == null ? void 0 : l.on("ready", f); | ||
}, [l, f]), u.useEffect(() => { | ||
if (!(!l || !c)) | ||
return l == null ? void 0 : l.on("error", c); | ||
}, [l, c]), u.useEffect(() => { | ||
if (!(!l || !e)) | ||
return l == null ? void 0 : l.on("change", e); | ||
}, [l, e]); | ||
const h = M( | ||
() => ({ | ||
theme: o, | ||
length: l, | ||
autoFocus: n, | ||
theme: t, | ||
length: a, | ||
autoFocus: o, | ||
mode: r, | ||
inputType: u | ||
inputType: i | ||
}), | ||
[o, l, n, r, u] | ||
[t, a, o, r, i] | ||
); | ||
@@ -566,70 +566,72 @@ return S(() => { | ||
return; | ||
async function g() { | ||
async function w() { | ||
if (s.current || !p.current) | ||
return; | ||
s.current = !0; | ||
const x = await c; | ||
const x = await v; | ||
if (!x) | ||
return; | ||
const w = x.ui.pin(m); | ||
w.mount(p.current), v(w); | ||
const g = x.ui.pin(h); | ||
g.mount(p.current), d(g); | ||
} | ||
t ? t.update(m) : g().catch(console.error); | ||
}, [t, m]), /* @__PURE__ */ d.createElement("div", { ref: p }); | ||
l ? l.update(h) : w().catch(console.error); | ||
}, [l, h]), /* @__PURE__ */ u.createElement("div", { ref: p }); | ||
} | ||
function te({ | ||
session: o, | ||
theme: n, | ||
session: t, | ||
theme: o, | ||
size: r, | ||
onReady: u, | ||
onError: l, | ||
onReady: i, | ||
onError: a, | ||
onSuccess: f, | ||
onFailure: e | ||
onFailure: e, | ||
failOnChallenge: c | ||
}) { | ||
const a = E(), c = d.useRef(!1), s = d.useRef(null), [t, v] = d.useState( | ||
const v = E(), s = u.useRef(!1), l = u.useRef(null), [d, p] = u.useState( | ||
null | ||
); | ||
d.useEffect(() => { | ||
if (!(!t || !u)) | ||
return t == null ? void 0 : t.on("ready", u); | ||
}, [t, u]), d.useEffect(() => { | ||
if (!(!t || !f)) | ||
return t == null ? void 0 : t.on("success", f); | ||
}, [t, f]), d.useEffect(() => { | ||
if (!(!t || !e)) | ||
return t == null ? void 0 : t.on("failure", e); | ||
}, [t, e]), d.useEffect(() => { | ||
if (!(!t || !l)) | ||
return t == null ? void 0 : t.on("error", l); | ||
}, [t, l]); | ||
const p = d.useMemo( | ||
u.useEffect(() => { | ||
if (!(!d || !i)) | ||
return d == null ? void 0 : d.on("ready", i); | ||
}, [d, i]), u.useEffect(() => { | ||
if (!(!d || !f)) | ||
return d == null ? void 0 : d.on("success", f); | ||
}, [d, f]), u.useEffect(() => { | ||
if (!(!d || !e)) | ||
return d == null ? void 0 : d.on("failure", e); | ||
}, [d, e]), u.useEffect(() => { | ||
if (!(!d || !a)) | ||
return d == null ? void 0 : d.on("error", a); | ||
}, [d, a]); | ||
const h = u.useMemo( | ||
() => ({ | ||
theme: n, | ||
size: r | ||
theme: o, | ||
size: r, | ||
failOnChallenge: c | ||
}), | ||
[n, r] | ||
[o, r, c] | ||
); | ||
return d.useLayoutEffect(() => { | ||
async function m() { | ||
if (c.current) | ||
return u.useLayoutEffect(() => { | ||
async function w() { | ||
if (s.current) | ||
return; | ||
c.current = !0; | ||
const g = await a; | ||
if (!g) | ||
s.current = !0; | ||
const x = await v; | ||
if (!x) | ||
return; | ||
const x = g.ui.threeDSecure(o, p); | ||
x.mount(s.current), v(x); | ||
const g = x.ui.threeDSecure(t, h); | ||
g.mount(l.current), p(g); | ||
} | ||
t ? t.update(p) : m().catch(console.error); | ||
}, [t, o, p]), /* @__PURE__ */ d.createElement("div", { ref: s }); | ||
d ? d.update(h) : w().catch(console.error); | ||
}, [d, t, h]), /* @__PURE__ */ u.createElement("div", { ref: l }); | ||
} | ||
function oe(o) { | ||
const n = E(), r = b(null), u = j( | ||
function oe(t) { | ||
const o = E(), r = b(null), i = j( | ||
(f, e) => { | ||
r.current && (r.current.unmount(), r.current = null); | ||
async function a() { | ||
const c = await n; | ||
if (c) | ||
async function c() { | ||
const v = await o; | ||
if (v) | ||
try { | ||
r.current = c.ui.threeDSecure(f, o), e != null && e.onReady && r.current.on("ready", e.onReady), e != null && e.onSuccess && r.current.on("success", e.onSuccess), e != null && e.onFailure && r.current.on("failure", e.onFailure), e != null && e.onError && r.current.on("error", e.onError), r.current.mount(); | ||
r.current = v.ui.threeDSecure(f, t), e != null && e.onReady && r.current.on("ready", e.onReady), e != null && e.onSuccess && r.current.on("success", e.onSuccess), e != null && e.onFailure && r.current.on("failure", e.onFailure), e != null && e.onError && r.current.on("error", e.onError), r.current.mount(); | ||
} catch (s) { | ||
@@ -639,29 +641,29 @@ r.current = null, e != null && e.onError && e.onError(s); | ||
} | ||
a(); | ||
c(); | ||
}, | ||
[n, o] | ||
[o, t] | ||
); | ||
h(() => () => { | ||
m(() => () => { | ||
r.current && (r.current.unmount(), r.current = null); | ||
}, []); | ||
const l = j((f) => { | ||
const a = j((f) => { | ||
r.current && r.current.update(f); | ||
}, []); | ||
return { | ||
start: u, | ||
update: l | ||
start: i, | ||
update: a | ||
}; | ||
} | ||
class W extends Promise { | ||
async encrypt(n) { | ||
return (await this).encrypt(n); | ||
async encrypt(o) { | ||
return (await this).encrypt(o); | ||
} | ||
async decrypt(n, r) { | ||
return (await this).decrypt(n, r); | ||
async decrypt(o, r) { | ||
return (await this).decrypt(o, r); | ||
} | ||
} | ||
const X = "https://js.evervault.com/v2"; | ||
function Z(o) { | ||
const n = document.createElement("script"); | ||
o ? n.src = o : n.src = X; | ||
function Z(t) { | ||
const o = document.createElement("script"); | ||
t ? o.src = t : o.src = X; | ||
const r = document.head || document.body; | ||
@@ -672,92 +674,92 @@ if (!r) | ||
); | ||
return r.appendChild(n), n; | ||
return r.appendChild(o), o; | ||
} | ||
let R = null; | ||
function $(o) { | ||
return R !== null || (R = new Promise((n, r) => { | ||
function $(t) { | ||
return R !== null || (R = new Promise((o, r) => { | ||
if (typeof window > "u") { | ||
n(void 0); | ||
o(void 0); | ||
return; | ||
} | ||
if (window.Evervault) { | ||
console.warn("Evervault has already been loaded"), n(window.Evervault); | ||
console.warn("Evervault has already been loaded"), o(window.Evervault); | ||
return; | ||
} | ||
try { | ||
const u = Z(o); | ||
u.addEventListener("load", () => { | ||
window.Evervault ? n(window.Evervault) : r(new Error("Evervault.js not available")); | ||
}), u.addEventListener("error", () => { | ||
const i = Z(t); | ||
i.addEventListener("load", () => { | ||
window.Evervault ? o(window.Evervault) : r(new Error("Evervault.js not available")); | ||
}), i.addEventListener("error", () => { | ||
r(new Error("Failed to load Evervault.js")); | ||
}); | ||
} catch (u) { | ||
r(u); | ||
} catch (i) { | ||
r(i); | ||
} | ||
})), R; | ||
} | ||
function F(o) { | ||
const n = Promise.resolve().then(() => $(o)); | ||
function F(t) { | ||
const o = Promise.resolve().then(() => $(t)); | ||
let r = !1; | ||
return n.catch((u) => { | ||
r || console.warn(u); | ||
}), r = !0, n.then((u) => typeof window < "u" ? window.Evervault : u ?? void 0); | ||
return o.catch((i) => { | ||
r || console.warn(i); | ||
}), r = !0, o.then((i) => typeof window < "u" ? window.Evervault : i ?? void 0); | ||
} | ||
const ne = ({ | ||
teamId: o, | ||
appId: n, | ||
teamId: t, | ||
appId: o, | ||
customConfig: r, | ||
children: u, | ||
...l | ||
children: i, | ||
...a | ||
}) => { | ||
if (typeof window > "u") | ||
return /* @__PURE__ */ d.createElement(L.Provider, { value: null }, u); | ||
const f = d.useMemo( | ||
() => new W((e, a) => { | ||
F(r == null ? void 0 : r.jsSdkUrl).then((c) => { | ||
c !== void 0 ? e(new c(o, n, r)) : (console.error("Evervault.js not available"), a("Evervault.js not available")); | ||
}).catch((c) => a(c)); | ||
return /* @__PURE__ */ u.createElement(L.Provider, { value: null }, i); | ||
const f = u.useMemo( | ||
() => new W((e, c) => { | ||
F(r == null ? void 0 : r.jsSdkUrl).then((v) => { | ||
v !== void 0 ? e(new v(t, o, r)) : (console.error("Evervault.js not available"), c("Evervault.js not available")); | ||
}).catch((v) => c(v)); | ||
}), | ||
[] | ||
); | ||
return /* @__PURE__ */ d.createElement(L.Provider, { ...l, value: f }, u); | ||
return /* @__PURE__ */ u.createElement(L.Provider, { ...a, value: f }, i); | ||
}; | ||
function ie({ | ||
onChange: o, | ||
config: n, | ||
onChange: t, | ||
config: o, | ||
onInputsLoad: r | ||
}) { | ||
const u = d.useId(); | ||
const i = u.useId(); | ||
if (typeof window > "u") | ||
return /* @__PURE__ */ d.createElement("div", { id: u }); | ||
const l = E(), { height: f = "auto", ...e } = n ?? {}, a = e ? { height: f, ...e } : { height: f }; | ||
return d.useEffect(() => { | ||
l == null || l.then((c) => { | ||
const s = c.inputs(u, a); | ||
s == null || s.on("change", (t) => { | ||
typeof o == "function" && o(t); | ||
return /* @__PURE__ */ u.createElement("div", { id: i }); | ||
const a = E(), { height: f = "auto", ...e } = o ?? {}, c = e ? { height: f, ...e } : { height: f }; | ||
return u.useEffect(() => { | ||
a == null || a.then((v) => { | ||
const s = v.inputs(i, c); | ||
s == null || s.on("change", (l) => { | ||
typeof t == "function" && t(l); | ||
}), r && (s == null ? void 0 : s.isInputsLoaded) != null && s.isInputsLoaded instanceof Promise && s.isInputsLoaded.then(() => r()); | ||
}); | ||
}, [l]), /* @__PURE__ */ d.createElement("div", { id: u }); | ||
}, [a]), /* @__PURE__ */ u.createElement("div", { id: i }); | ||
} | ||
function ue({ | ||
request: o, | ||
config: n, | ||
request: t, | ||
config: o, | ||
onCopy: r, | ||
onRevealLoad: u, | ||
onRevealError: l | ||
onRevealLoad: i, | ||
onRevealError: a | ||
}) { | ||
const f = d.useId(); | ||
const f = u.useId(); | ||
if (typeof window > "u") | ||
return /* @__PURE__ */ d.createElement("div", { id: f }); | ||
const e = E(), { height: a = "auto", ...c } = n ?? {}, s = c ? { height: a, ...c } : { height: a }; | ||
return d.useEffect(() => { | ||
e == null || e.then((t) => { | ||
const v = t.reveal(f, o, s, r); | ||
(v == null ? void 0 : v.isRevealLoaded) != null && v.isRevealLoaded instanceof Promise && v.isRevealLoaded.then(() => { | ||
u && u(); | ||
return /* @__PURE__ */ u.createElement("div", { id: f }); | ||
const e = E(), { height: c = "auto", ...v } = o ?? {}, s = v ? { height: c, ...v } : { height: c }; | ||
return u.useEffect(() => { | ||
e == null || e.then((l) => { | ||
const d = l.reveal(f, t, s, r); | ||
(d == null ? void 0 : d.isRevealLoaded) != null && d.isRevealLoaded instanceof Promise && d.isRevealLoaded.then(() => { | ||
i && i(); | ||
}).catch((p) => { | ||
l && l(p); | ||
a && a(p); | ||
}); | ||
}); | ||
}, [e]), /* @__PURE__ */ d.createElement("div", { id: f }); | ||
}, [e]), /* @__PURE__ */ u.createElement("div", { id: f }); | ||
} | ||
@@ -764,0 +766,0 @@ export { |
{ | ||
"private": false, | ||
"name": "@evervault/react", | ||
"version": "2.14.0", | ||
"version": "2.15.0", | ||
"description": "React package for the Evervault SDK", | ||
@@ -37,6 +37,6 @@ "license": "MIT", | ||
"vite-plugin-dts": "^3.6.3", | ||
"@evervault/browser": "^2.35.0", | ||
"themes": "^0.1.5", | ||
"@evervault/browser": "^2.36.0", | ||
"types": "^0.5.0", | ||
"tsconfig": "^0.0.1", | ||
"types": "^0.5.0" | ||
"themes": "^0.1.5" | ||
}, | ||
@@ -43,0 +43,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
96382
2245