@baas-id/react 0.3.0 → 0.3.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.
- package/README.md +2 -2
- package/dist/esm/baas-id-react.css +1 -1
- package/dist/esm/chunks/ContinueFlow-mqBIxnlp.js +9327 -0
- package/dist/esm/continue.js +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/preview.js +22 -22
- package/dist/types/react/document/CardFrame.d.ts +11 -0
- package/dist/types/react/document/stats.d.ts +1 -1
- package/dist/types/react/handoff/ContinueFlow.d.ts +5 -1
- package/dist/types/react/i18n/types.d.ts +7 -0
- package/dist/types/react/version.d.ts +1 -1
- package/dist/types/react/vision/tinyDetector.d.ts +5 -0
- package/dist/types/react/vision/types.d.ts +6 -1
- package/package.json +1 -1
- package/dist/esm/chunks/ContinueFlow-vn9wv0tZ.js +0 -9147
package/dist/esm/continue.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./baas-id-react.css";
|
|
2
|
-
import { C as L, D as o, L as e, M as r, g as E, r as S } from "./chunks/ContinueFlow-
|
|
2
|
+
import { C as L, D as o, L as e, M as r, g as E, r as S } from "./chunks/ContinueFlow-mqBIxnlp.js";
|
|
3
3
|
export {
|
|
4
4
|
L as ContinueFlow,
|
|
5
5
|
o as DEFAULT_MODELS_URL,
|
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./baas-id-react.css";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import { Y as D, U as S, V as P, W as u } from "./chunks/ContinueFlow-
|
|
4
|
-
import { X as Z, Z as aa, C as ea, _ as sa, $ as ta, a0 as na, D as ra, a1 as oa, a2 as ia, a3 as ca, a4 as la, a5 as da, a6 as ua, a7 as pa, a8 as fa, a9 as ha, H as ma, L as Ma, M as Ca, aa as Ea, ab as _a, ac as Aa, ad as ga, ae as Na, af as Oa, ag as Sa, ah as La, ai as Fa, aj as va, ak as ya, al as Ra, am as wa, an as xa, ao as Ia, ap as Ta, aq as ba, ar as Da, as as Pa, at as Ya, au as ka, f as Xa, g as Ha, av as Wa, aw as Ua, ax as Ga, ay as Va, az as Ba, aA as Qa, aB as ja, aC as $a, aD as qa, aE as za, aF as Ka, aG as Ja, aH as Za, aI as ae, r as ee, aJ as se, aK as te, aL as ne, aM as re, aN as oe, aO as ie, aP as ce, aQ as le, aR as de, aS as ue, aT as pe } from "./chunks/ContinueFlow-
|
|
3
|
+
import { Y as D, U as S, V as P, W as u } from "./chunks/ContinueFlow-mqBIxnlp.js";
|
|
4
|
+
import { X as Z, Z as aa, C as ea, _ as sa, $ as ta, a0 as na, D as ra, a1 as oa, a2 as ia, a3 as ca, a4 as la, a5 as da, a6 as ua, a7 as pa, a8 as fa, a9 as ha, H as ma, L as Ma, M as Ca, aa as Ea, ab as _a, ac as Aa, ad as ga, ae as Na, af as Oa, ag as Sa, ah as La, ai as Fa, aj as va, ak as ya, al as Ra, am as wa, an as xa, ao as Ia, ap as Ta, aq as ba, ar as Da, as as Pa, at as Ya, au as ka, f as Xa, g as Ha, av as Wa, aw as Ua, ax as Ga, ay as Va, az as Ba, aA as Qa, aB as ja, aC as $a, aD as qa, aE as za, aF as Ka, aG as Ja, aH as Za, aI as ae, r as ee, aJ as se, aK as te, aL as ne, aM as re, aN as oe, aO as ie, aP as ce, aQ as le, aR as de, aS as ue, aT as pe } from "./chunks/ContinueFlow-mqBIxnlp.js";
|
|
5
5
|
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
6
6
|
function V({
|
|
7
7
|
direction: a,
|
package/dist/esm/preview.js
CHANGED
|
@@ -2,8 +2,8 @@ import "./baas-id-react.css";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
import { jsxs as R, jsx as p } from "react/jsx-runtime";
|
|
4
4
|
import { useMemo as E, useRef as M, useState as W, useEffect as U } from "react";
|
|
5
|
-
import { t as $, n as K, a as Q, m as Y, b as J, g as O, f as X, i as Z, c as ee, F as B, H as te, d as oe, e as ne, S as re, E as se, h as ie, j as ae, k as le, l as ce, o as L, p as de, q as
|
|
6
|
-
import { y as we, z as xe, A as De, B as Oe, I as Be, L as Le, J as Ne, K as Ue, N as
|
|
5
|
+
import { t as $, n as K, a as Q, m as Y, b as J, g as O, f as X, i as Z, c as ee, F as B, H as te, d as oe, e as ne, S as re, E as se, h as ie, j as ae, k as le, l as ce, o as L, p as de, q as H, s as fe, G, u as ue, v as pe, w as he, x as ye } from "./chunks/ContinueFlow-mqBIxnlp.js";
|
|
6
|
+
import { y as we, z as xe, A as De, B as Oe, I as Be, L as Le, J as Ne, K as Ue, N as He, O as Ge, P as je, Q as qe, R as Ve, T as ze } from "./chunks/ContinueFlow-mqBIxnlp.js";
|
|
7
7
|
function me(e) {
|
|
8
8
|
let r = e >>> 0;
|
|
9
9
|
return () => (r = r * 1664525 + 1013904223 >>> 0, r / 4294967296);
|
|
@@ -17,12 +17,12 @@ function j(e, r) {
|
|
|
17
17
|
{ x: n[3].x + s * 0.5, y: n[3].y - s * 0.8 }
|
|
18
18
|
];
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function T(e, r, n, s, i, t) {
|
|
21
21
|
e.beginPath(), e.moveTo(r + t, n), e.arcTo(r + s, n, r + s, n + i, t), e.arcTo(r + s, n + i, r, n + i, t), e.arcTo(r, n + i, r, n, t), e.arcTo(r, n, r + s, n, t), e.closePath();
|
|
22
22
|
}
|
|
23
23
|
function q(e, r, n, s) {
|
|
24
24
|
const i = n * 0.037;
|
|
25
|
-
|
|
25
|
+
T(e, 0, 0, n, s, i), e.save(), e.clip();
|
|
26
26
|
const t = e.createLinearGradient(0, 0, n, s);
|
|
27
27
|
t.addColorStop(0, "#E8EEEC"), t.addColorStop(1, "#D5DFDC"), e.fillStyle = t, e.fillRect(0, 0, n, s), e.strokeStyle = "rgba(19, 94, 110, 0.13)", e.lineWidth = Math.max(0.6, n * 16e-4);
|
|
28
28
|
for (let o = 0; o < 26; o++)
|
|
@@ -31,7 +31,7 @@ function q(e, r, n, s) {
|
|
|
31
31
|
const l = "rgba(22, 35, 44, 0.55)";
|
|
32
32
|
if (r === "front") {
|
|
33
33
|
const o = n * 0.05, a = s * 0.2, c = n * 0.27, d = s * 0.62;
|
|
34
|
-
e.fillStyle = "#B9C7CE",
|
|
34
|
+
e.fillStyle = "#B9C7CE", T(e, o, a, c, d, n * 0.012), e.fill(), e.fillStyle = "#8EA2AC", e.beginPath(), e.ellipse(o + c / 2, a + d * 0.38, c * 0.22, d * 0.2, 0, 0, Math.PI * 2), e.fill(), e.beginPath(), e.ellipse(o + c / 2, a + d * 0.98, c * 0.42, d * 0.3, 0, Math.PI, 0), e.fill(), e.fillStyle = l;
|
|
35
35
|
const u = n * 0.37;
|
|
36
36
|
[[0.24, 0.3], [0.32, 0.45], [0.44, 0.2], [0.52, 0.38], [0.64, 0.22], [0.72, 0.42]].forEach(([m, g], h) => {
|
|
37
37
|
e.globalAlpha = h % 2 ? 1 : 0.55, e.fillRect(u, s * m, n * g, s * (h % 2 ? 0.045 : 0.03));
|
|
@@ -56,7 +56,7 @@ function ve(e, r) {
|
|
|
56
56
|
const o = l.createRadialGradient(s * 0.5, i * 0.2, 10, s * 0.5, i * 0.6, s);
|
|
57
57
|
o.addColorStop(0, "#2B3A44"), o.addColorStop(1, "#141D23"), l.fillStyle = o, l.fillRect(0, 0, s, i);
|
|
58
58
|
const a = j(s, i).map((u) => ({ x: u.x * s, y: u.y * i })), c = Math.hypot(a[1].x - a[0].x, a[1].y - a[0].y), d = Math.hypot(a[3].x - a[0].x, a[3].y - a[0].y);
|
|
59
|
-
l.save(), l.transform((a[1].x - a[0].x) / c, (a[1].y - a[0].y) / c, (a[3].x - a[0].x) / d, (a[3].y - a[0].y) / d, a[0].x, a[0].y), l.shadowColor = "rgba(0,0,0,0.45)", l.shadowBlur = 18, l.shadowOffsetY = 6, l.fillStyle = "#000",
|
|
59
|
+
l.save(), l.transform((a[1].x - a[0].x) / c, (a[1].y - a[0].y) / c, (a[3].x - a[0].x) / d, (a[3].y - a[0].y) / d, a[0].x, a[0].y), l.shadowColor = "rgba(0,0,0,0.45)", l.shadowBlur = 18, l.shadowOffsetY = 6, l.fillStyle = "#000", T(l, 0, 0, c, d, c * 0.037), l.fill(), l.shadowColor = "transparent", q(l, r, c, d), l.restore();
|
|
60
60
|
}
|
|
61
61
|
function N(e) {
|
|
62
62
|
if (typeof document > "u") return;
|
|
@@ -146,12 +146,12 @@ function Fe(e) {
|
|
|
146
146
|
J(h, t, O(t, void 0, u))
|
|
147
147
|
);
|
|
148
148
|
return { t: O(t, y, u), overrides: y };
|
|
149
|
-
}, [h, t, u]), C = de(i, { document: a, documentSides: o }), S = C.includes(n) ? n : C[0], v = r === "success" ? { k: "done", result: be[i] } : r === "error" ? { k: "failed", reason: l } : S === "face" ? { k: "face" } : { k: "doc", side: S }, k = r === "intro" && Z(S, g),
|
|
149
|
+
}, [h, t, u]), C = de(i, { document: a, documentSides: o }), S = C.includes(n) ? n : C[0], v = r === "success" ? { k: "done", result: be[i] } : r === "error" ? { k: "failed", reason: l } : S === "face" ? { k: "face" } : { k: "doc", side: S }, k = r === "intro" && Z(S, g), _ = ee(S, t, f.t, g), w = v.k === "doc" || v.k === "face", x = C.length > 1, I = E(() => ({
|
|
150
150
|
front: S !== "front" && C.includes("front") ? N("front") : void 0,
|
|
151
151
|
back: S === "face" && C.includes("back") ? N("back") : void 0
|
|
152
152
|
}), [S, C.join()]);
|
|
153
153
|
if (r === "handoff" || r === "continue" || r === "continueDone") {
|
|
154
|
-
const y = e.handoff ?? {},
|
|
154
|
+
const y = e.handoff ?? {}, D = y.copy?.[t] ?? null, A = y.tenant || "Acme", F = P.slice(-4).toUpperCase(), V = y.continueUrl ? y.continueUrl.includes("{code}") ? y.continueUrl.replace("{code}", P) : `${y.continueUrl}${y.continueUrl.includes("?") ? "&" : "?"}h=${P}` : `https://baaslatam.com/c/${P}`, z = r === "handoff" ? D?.title || f.t.handoff.title : r === "continue" ? f.t.handoff.phoneTitle : f.t.handoff.doneTitle;
|
|
155
155
|
return /* @__PURE__ */ R(
|
|
156
156
|
B,
|
|
157
157
|
{
|
|
@@ -171,8 +171,8 @@ function Fe(e) {
|
|
|
171
171
|
{
|
|
172
172
|
t: f.t,
|
|
173
173
|
mode: y.mode ?? "suggest",
|
|
174
|
-
copy:
|
|
175
|
-
link: { url: V, codeHint:
|
|
174
|
+
copy: D,
|
|
175
|
+
link: { url: V, codeHint: F, tenant: A },
|
|
176
176
|
leftMs: (y.ttlMinutes ?? 10) * 6e4 - 18e3,
|
|
177
177
|
expired: !1,
|
|
178
178
|
failed: !1,
|
|
@@ -183,8 +183,8 @@ function Fe(e) {
|
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
r === "continue" && /* @__PURE__ */ p(oe, { t: f.t, tenant:
|
|
187
|
-
r === "continueDone" && /* @__PURE__ */ p(ne, { t: f.t })
|
|
186
|
+
r === "continue" && /* @__PURE__ */ p(oe, { t: f.t, tenant: A, codeHint: F }),
|
|
187
|
+
r === "continueDone" && /* @__PURE__ */ p(ne, { t: f.t, tenant: A, codeHint: F })
|
|
188
188
|
]
|
|
189
189
|
}
|
|
190
190
|
);
|
|
@@ -201,15 +201,15 @@ function Fe(e) {
|
|
|
201
201
|
manageFocus: !1,
|
|
202
202
|
colorScheme: e.colorScheme,
|
|
203
203
|
screen: k ? "intro" : void 0,
|
|
204
|
-
title: k ?
|
|
204
|
+
title: k ? _.title : ce(v, i, f.t),
|
|
205
205
|
children: [
|
|
206
|
-
|
|
207
|
-
|
|
206
|
+
w && x && /* @__PURE__ */ p(re, { step: v, t: f.t, plan: C }),
|
|
207
|
+
w && x && (I.front || I.back) && /* @__PURE__ */ p(se, { thumbs: I, t: f.t, plan: C }),
|
|
208
208
|
k && /* @__PURE__ */ p(
|
|
209
209
|
ie,
|
|
210
210
|
{
|
|
211
211
|
step: S,
|
|
212
|
-
body:
|
|
212
|
+
body: _.body,
|
|
213
213
|
t: f.t,
|
|
214
214
|
movements: S === "face" ? c : void 0,
|
|
215
215
|
sessionMinutes: C.indexOf(S) === 0 ? 15 : null,
|
|
@@ -244,7 +244,7 @@ function Ee({ side: e, t: r }) {
|
|
|
244
244
|
return { at: () => o, info: () => ({ kind: "edges", locks: [!0, !0, !0, !0] }) };
|
|
245
245
|
}, [i.w, i.h]);
|
|
246
246
|
return /* @__PURE__ */ p("div", { className: "baas-id-scope rpid-doc-capture", "data-rpid-preview": !0, children: /* @__PURE__ */ R(
|
|
247
|
-
|
|
247
|
+
H,
|
|
248
248
|
{
|
|
249
249
|
className: "rpid-viewport rpid-doc rpid-locked",
|
|
250
250
|
attrs: { "data-rpid-side": e, "data-rpid-frame": "holding" },
|
|
@@ -253,7 +253,7 @@ function Ee({ side: e, t: r }) {
|
|
|
253
253
|
canvasRef: s,
|
|
254
254
|
children: [
|
|
255
255
|
/* @__PURE__ */ p(fe, { source: i.w ? l : null, pct: 0.62, state: "holding", t: r }),
|
|
256
|
-
/* @__PURE__ */ p(
|
|
256
|
+
/* @__PURE__ */ p(G, { tone: "ok", children: /* @__PURE__ */ p("span", { className: "rpid-guide-line", children: r.guide.steady }) })
|
|
257
257
|
]
|
|
258
258
|
}
|
|
259
259
|
) });
|
|
@@ -274,7 +274,7 @@ function Re({ challenge: e, count: r, t: n }) {
|
|
|
274
274
|
const c = ue({ videoWidth: b.w, videoHeight: b.h }), d = e === "center" ? null : e, u = e === "center" ? "perfect" : e === "move_closer" ? "closer_more" : e, m = e === "center" ? 0 : 0.45, g = pe({ step: l, total: t.length, hold: 0.65, progress: m, done: !1 }), h = { "--rpid-video-ar": (b.w / b.h).toFixed(4) };
|
|
275
275
|
return /* @__PURE__ */ R("div", { className: "baas-id-scope", "data-rpid-preview": !0, children: [
|
|
276
276
|
/* @__PURE__ */ R(
|
|
277
|
-
|
|
277
|
+
H,
|
|
278
278
|
{
|
|
279
279
|
className: `rpid-viewport rpid-face rpid-${e === "center" ? "searching" : "locked"}`,
|
|
280
280
|
attrs: { "data-rpid-guide-state": e === "center" ? "aligned" : "capturing" },
|
|
@@ -298,7 +298,7 @@ function Re({ challenge: e, count: r, t: n }) {
|
|
|
298
298
|
t: n
|
|
299
299
|
}
|
|
300
300
|
),
|
|
301
|
-
/* @__PURE__ */ p(
|
|
301
|
+
/* @__PURE__ */ p(G, { tone: "ok", marker: !0, children: e === "center" ? n.guide.perfect : n.guide[u] })
|
|
302
302
|
]
|
|
303
303
|
}
|
|
304
304
|
),
|
|
@@ -315,8 +315,8 @@ export {
|
|
|
315
315
|
Le as LOCALES,
|
|
316
316
|
Ne as SDK_DEFAULTS,
|
|
317
317
|
Ue as appearanceGroups,
|
|
318
|
-
|
|
319
|
-
|
|
318
|
+
He as appearanceStyle,
|
|
319
|
+
Ge as contrastChecks,
|
|
320
320
|
je as contrastRatio,
|
|
321
321
|
qe as darkPalette,
|
|
322
322
|
O as getStrings,
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import type { Strings } from "../i18n";
|
|
2
|
+
import { type Quad } from "./overlay";
|
|
2
3
|
import type { QuadSource } from "./track";
|
|
3
4
|
export type FrameState = "searching" | "tracking" | "holding" | "locked";
|
|
5
|
+
export interface OutlinePath {
|
|
6
|
+
d: string;
|
|
7
|
+
length: number;
|
|
8
|
+
corners: Array<[number, number]>;
|
|
9
|
+
sides: number[];
|
|
10
|
+
}
|
|
11
|
+
export declare function outlinePath(q: Quad, radius: number): OutlinePath;
|
|
12
|
+
export type Dash = readonly [string, string];
|
|
13
|
+
export declare function dashOnly(from: number, to: number, length: number): Dash;
|
|
14
|
+
export declare function dashProgress(o: OutlinePath, pct: number): Dash;
|
|
4
15
|
export declare function CardFrame({ source, pct, state, label, t, }: {
|
|
5
16
|
source: QuadSource | null;
|
|
6
17
|
pct: number;
|
|
@@ -10,7 +10,7 @@ export declare class CaptureStats {
|
|
|
10
10
|
private coach;
|
|
11
11
|
private mode;
|
|
12
12
|
constructor(t0: number);
|
|
13
|
-
frame(found: boolean, confidence: number, veto?: "geometry" | "edges" | "content"): void;
|
|
13
|
+
frame(found: boolean, confidence: number, veto?: "geometry" | "edges" | "content" | "face", relaxed?: "held" | "stable"): void;
|
|
14
14
|
outline(mode: "edges" | "box" | null): void;
|
|
15
15
|
tick(gate: Gate | null, pFront: number | null, motion: number | null, stillOk: boolean | null, hold: number, coach: string): void;
|
|
16
16
|
searching(coach: string): void;
|
|
@@ -26,6 +26,10 @@ export declare function ContinueConfirmView({ t, tenant, codeHint, onContinue }:
|
|
|
26
26
|
codeHint: string;
|
|
27
27
|
onContinue?: () => void;
|
|
28
28
|
}): import("react").JSX.Element;
|
|
29
|
-
export
|
|
29
|
+
export type DoneStep = "front" | "back" | "face";
|
|
30
|
+
export declare function ContinueDoneView({ t, tenant, codeHint, steps }: {
|
|
30
31
|
t: Strings;
|
|
32
|
+
tenant?: string | null;
|
|
33
|
+
codeHint?: string | null;
|
|
34
|
+
steps?: readonly DoneStep[];
|
|
31
35
|
}): import("react").JSX.Element;
|
|
@@ -206,6 +206,13 @@ export interface Strings {
|
|
|
206
206
|
phoneClosedBody: string;
|
|
207
207
|
resumeOnPhone: string;
|
|
208
208
|
continueHereShort: string;
|
|
209
|
+
doneHeading: string;
|
|
210
|
+
doneSent: string;
|
|
211
|
+
doneOnComputer: string;
|
|
212
|
+
doneFor: string;
|
|
213
|
+
doneCode: string;
|
|
214
|
+
doneClose: string;
|
|
215
|
+
doneCloseHint: string;
|
|
209
216
|
stepWaiting: string;
|
|
210
217
|
stepConnected: string;
|
|
211
218
|
stepCapturing: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.3.
|
|
1
|
+
export declare const SDK_VERSION = "0.3.1";
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { type Quad } from "./corners";
|
|
2
2
|
import type { CardDetection, DocumentEngine, ProgressFn } from "./types";
|
|
3
3
|
export declare const TINY_FOLDERS: readonly ["card-tinydet-r6", "card-tinydet-r4"];
|
|
4
|
+
export declare const RELAX_STREAK = 3;
|
|
5
|
+
export declare const RELAX_MOTION = 0.04;
|
|
6
|
+
export declare const RELAX_DETAIL = 0.25;
|
|
7
|
+
export declare const RELAX_SIDES = 2;
|
|
8
|
+
export declare const FACE_FILL_MAX = 0.2;
|
|
4
9
|
export declare const ORIENT_VOTE_MIN = 0.6;
|
|
5
10
|
export declare const TINY_INPUT = 224;
|
|
6
11
|
export declare const TINY_GRID = 28;
|
|
@@ -13,7 +13,8 @@ export interface CardDetection {
|
|
|
13
13
|
};
|
|
14
14
|
weak?: boolean;
|
|
15
15
|
corners?: FrameCorners;
|
|
16
|
-
veto?: "geometry" | "edges" | "content";
|
|
16
|
+
veto?: "geometry" | "edges" | "content" | "face";
|
|
17
|
+
relaxed?: "held" | "stable";
|
|
17
18
|
}
|
|
18
19
|
export interface SideResult {
|
|
19
20
|
isFront: boolean;
|
|
@@ -49,6 +50,10 @@ export interface DetectOptions {
|
|
|
49
50
|
corners?: {
|
|
50
51
|
ks: number;
|
|
51
52
|
hint?: Quad | null;
|
|
53
|
+
faces?: (source: HTMLCanvasElement) => Promise<Array<{
|
|
54
|
+
topLeft: [number, number];
|
|
55
|
+
bottomRight: [number, number];
|
|
56
|
+
}>>;
|
|
52
57
|
};
|
|
53
58
|
}
|
|
54
59
|
export interface FaceEngine {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baas-id/react",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "BaaS identity verification for React: guided ID and face capture with on-device quality gating, server-side verdicts, phone handoff. Requires a BaaS account.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "BaaS, S.A.",
|