@incodetech/web 2.0.0-alpha.4 → 2.0.0-alpha.6
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/base.css +230 -0
- package/dist/email/email.es.js +3 -3
- package/dist/flow/flow.es.js +555 -7
- package/dist/flow/styles.css +419 -189
- package/dist/{incodeModule-Ct9jp5k6.js → incodeModule-BuCBWati.js} +56 -58
- package/dist/index.es.js +4 -99
- package/dist/{title-ng7q7YDh.js → instance-B-q0ZREN.js} +194 -215
- package/dist/{otpInput-BUrV4IAF.js → otpInput-cq1THeRd.js} +1 -1
- package/dist/phone/phone.es.js +3 -4
- package/dist/{button-DeMZ_34N.js → preact-custom-element.esm-BGQkPkOv.js} +145 -166
- package/dist/selfie/selfie.es.js +63 -63
- package/dist/selfie/styles.css +267 -787
- package/dist/setup-wNL83jmW.js +20 -0
- package/dist/title-XSxhaBDx.js +25 -0
- package/dist/types/email/email.d.ts +1 -1
- package/dist/types/email/styles.d.ts +1 -0
- package/dist/types/email.d.ts +1 -1
- package/dist/types/flow/flow.d.ts +1 -1
- package/dist/types/flow/styles.d.ts +1 -0
- package/dist/types/flow.d.ts +2 -2
- package/dist/types/index.d.ts +4 -99
- package/dist/types/phone/phone.d.ts +1 -1
- package/dist/types/phone/styles.d.ts +1 -0
- package/dist/types/phone.d.ts +1 -1
- package/dist/types/selfie/selfie.d.ts +1 -1
- package/dist/types/selfie/styles.d.ts +1 -0
- package/dist/types/selfie.d.ts +1 -1
- package/dist/types/styles.d.ts +1 -0
- package/dist/uiConfig-CQ1W9cUD.js +23 -0
- package/package.json +6 -5
- package/dist/button.css +0 -335
- package/dist/flow-ZK6OBsa3.js +0 -568
- package/dist/incodeModule.css +0 -119
- package/dist/otpInput.css +0 -167
- package/dist/successIcon.css +0 -4
- package/dist/title.css +0 -38
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { u as C, S as s, c as f } from "./preact-custom-element.esm-BGQkPkOv.js";
|
|
2
|
+
import { u as p } from "./uiConfig-CQ1W9cUD.js";
|
|
2
3
|
import { k as u } from "./vendor-preact-CK0WeTOR.js";
|
|
3
|
-
|
|
4
|
+
function F({ children: e }) {
|
|
5
|
+
return /* @__PURE__ */ C("div", { class: "IncodeComponent", children: e });
|
|
6
|
+
}
|
|
7
|
+
const H = "https://assets.incode.com/@incodetech/web/2.0.0-alpha.6/assets/incode-logo-ed68c8e9.svg";
|
|
4
8
|
function d(e) {
|
|
5
|
-
for (const
|
|
6
|
-
if (
|
|
9
|
+
for (const o of e)
|
|
10
|
+
if (o !== void 0) return o;
|
|
7
11
|
}
|
|
8
12
|
function L(e) {
|
|
9
13
|
if (!e) return;
|
|
10
14
|
if (/^\d+$/.test(e)) return Number(e);
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
15
|
+
const o = e.match(/^(\d+)px$/);
|
|
16
|
+
if (o) return Number(o[1]);
|
|
13
17
|
}
|
|
14
18
|
function V(e) {
|
|
15
|
-
const
|
|
19
|
+
const o = d([
|
|
16
20
|
e.logo?.height,
|
|
17
21
|
e.uiConfig.logoHeight
|
|
18
22
|
]);
|
|
@@ -23,33 +27,33 @@ function V(e) {
|
|
|
23
27
|
e.uiConfig.hideFooterBranding
|
|
24
28
|
]) ?? !1,
|
|
25
29
|
logoSrc: d([e.logo?.src, e.uiConfig.logoSrc]) ?? e.defaultLogoSrc,
|
|
26
|
-
logoHeightPx: L(
|
|
30
|
+
logoHeightPx: L(o) ?? 80
|
|
27
31
|
};
|
|
28
32
|
}
|
|
29
33
|
function m(e) {
|
|
30
|
-
const
|
|
31
|
-
return V({ ...e, uiConfig:
|
|
34
|
+
const o = p();
|
|
35
|
+
return V({ ...e, uiConfig: o });
|
|
32
36
|
}
|
|
33
37
|
const M = (e) => {
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
return
|
|
38
|
-
r: Number.parseInt(
|
|
39
|
-
g: Number.parseInt(
|
|
40
|
-
b: Number.parseInt(
|
|
38
|
+
let o = e.replace("#", "");
|
|
39
|
+
o.length === 3 && (o = o.split("").map((t) => t + t).join(""));
|
|
40
|
+
const n = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(o);
|
|
41
|
+
return n?.[1] && n?.[2] && n?.[3] ? {
|
|
42
|
+
r: Number.parseInt(n[1], 16) / 255,
|
|
43
|
+
g: Number.parseInt(n[2], 16) / 255,
|
|
44
|
+
b: Number.parseInt(n[3], 16) / 255
|
|
41
45
|
} : null;
|
|
42
|
-
}, I = (e,
|
|
46
|
+
}, I = (e, o, n) => {
|
|
43
47
|
const t = (r) => {
|
|
44
48
|
const i = Math.round(r * 255).toString(16);
|
|
45
49
|
return i.length === 1 ? `0${i}` : i;
|
|
46
50
|
};
|
|
47
|
-
return `#${t(e)}${t(
|
|
51
|
+
return `#${t(e)}${t(o)}${t(n)}`;
|
|
48
52
|
};
|
|
49
|
-
function Z(e,
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
52
|
-
const t = getComputedStyle(
|
|
53
|
+
function Z(e, o) {
|
|
54
|
+
const n = typeof document < "u" ? document.documentElement : null;
|
|
55
|
+
if (!n) return null;
|
|
56
|
+
const t = getComputedStyle(n).getPropertyValue(e).trim();
|
|
53
57
|
if (!t) return null;
|
|
54
58
|
if (t.startsWith("#"))
|
|
55
59
|
return t;
|
|
@@ -62,12 +66,12 @@ function Z(e, n) {
|
|
|
62
66
|
}
|
|
63
67
|
return null;
|
|
64
68
|
}
|
|
65
|
-
function
|
|
66
|
-
const
|
|
67
|
-
if (!
|
|
68
|
-
const t = [
|
|
69
|
+
function N(e, o) {
|
|
70
|
+
const n = M(o);
|
|
71
|
+
if (!n) return e;
|
|
72
|
+
const t = [n.r, n.g, n.b, 1];
|
|
69
73
|
return JSON.parse(
|
|
70
|
-
JSON.stringify(e).replace(/"replaceColorWithYours"/g, t.join(", ")).replace(/"replaceR"/g,
|
|
74
|
+
JSON.stringify(e).replace(/"replaceColorWithYours"/g, t.join(", ")).replace(/"replaceR"/g, n.r.toString()).replace(/"replaceG"/g, n.g.toString()).replace(/"replaceB"/g, n.b.toString())
|
|
71
75
|
);
|
|
72
76
|
}
|
|
73
77
|
const b = () => {
|
|
@@ -173,10 +177,10 @@ const b = () => {
|
|
|
173
177
|
]
|
|
174
178
|
}
|
|
175
179
|
);
|
|
176
|
-
},
|
|
180
|
+
}, y = ({
|
|
177
181
|
title: e,
|
|
178
|
-
subtitle:
|
|
179
|
-
className:
|
|
182
|
+
subtitle: o,
|
|
183
|
+
className: n,
|
|
180
184
|
logo: t,
|
|
181
185
|
children: r,
|
|
182
186
|
hideHeader: i,
|
|
@@ -189,33 +193,30 @@ const b = () => {
|
|
|
189
193
|
hideFooterBranding: c,
|
|
190
194
|
logo: t,
|
|
191
195
|
defaultLogoSrc: H
|
|
192
|
-
}), h = e ||
|
|
196
|
+
}), h = e || o;
|
|
193
197
|
return /* @__PURE__ */ C(
|
|
194
198
|
"div",
|
|
195
199
|
{
|
|
196
|
-
class: `IncodePageContainer ${
|
|
200
|
+
class: `IncodePageContainer ${n ?? ""}`,
|
|
197
201
|
"data-testid": a,
|
|
198
202
|
"data-permission-status": g,
|
|
199
203
|
children: /* @__PURE__ */ C("div", { class: "IncodePageInner", children: [
|
|
200
|
-
!l.hideHeader && /* @__PURE__ */ C("header", { class: "IncodePageHeader", children:
|
|
201
|
-
"
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}
|
|
210
|
-
)
|
|
211
|
-
] }),
|
|
204
|
+
!l.hideHeader && /* @__PURE__ */ C("header", { class: "IncodePageHeader", children: /* @__PURE__ */ C(
|
|
205
|
+
"img",
|
|
206
|
+
{
|
|
207
|
+
src: l.logoSrc,
|
|
208
|
+
height: l.logoHeightPx,
|
|
209
|
+
alt: "Logo",
|
|
210
|
+
class: "IncodePageLogo"
|
|
211
|
+
}
|
|
212
|
+
) }),
|
|
212
213
|
h ? /* @__PURE__ */ C(u, { children: [
|
|
213
214
|
/* @__PURE__ */ C(s, { size: l.hideHeader ? 40 : 24 }),
|
|
214
215
|
/* @__PURE__ */ C("div", { class: "IncodePageTitleContainer", children: [
|
|
215
216
|
e ? /* @__PURE__ */ C("h2", { class: "IncodePageTitle", children: e }) : null,
|
|
216
|
-
|
|
217
|
+
o ? /* @__PURE__ */ C(u, { children: [
|
|
217
218
|
/* @__PURE__ */ C(s, { size: 12 }),
|
|
218
|
-
/* @__PURE__ */ C("p", { class: "IncodePageSubtitle", children:
|
|
219
|
+
/* @__PURE__ */ C("p", { class: "IncodePageSubtitle", children: o })
|
|
219
220
|
] }) : null
|
|
220
221
|
] })
|
|
221
222
|
] }) : null,
|
|
@@ -225,22 +226,19 @@ const b = () => {
|
|
|
225
226
|
}
|
|
226
227
|
);
|
|
227
228
|
};
|
|
228
|
-
function
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
function v(e, n, o) {
|
|
232
|
-
p(e, n, [...o], {
|
|
229
|
+
function v(e, o, n) {
|
|
230
|
+
f(e, o, [...n], {
|
|
233
231
|
shadow: !1
|
|
234
232
|
});
|
|
235
233
|
}
|
|
236
234
|
const P = ["config", "onFinish", "onError"];
|
|
237
|
-
function
|
|
238
|
-
v(e,
|
|
235
|
+
function $(e, o) {
|
|
236
|
+
v(e, o, P);
|
|
239
237
|
}
|
|
240
238
|
export {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
239
|
+
F as I,
|
|
240
|
+
y as P,
|
|
241
|
+
N as a,
|
|
244
242
|
Z as g,
|
|
245
|
-
|
|
243
|
+
$ as r
|
|
246
244
|
};
|
package/dist/index.es.js
CHANGED
|
@@ -1,101 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { s as M, a as $ } from "./button-DeMZ_34N.js";
|
|
4
|
-
import { y as f } from "./vendor-preact-CK0WeTOR.js";
|
|
5
|
-
import { u as m } from "./title-ng7q7YDh.js";
|
|
6
|
-
const S = (a) => new Promise((e) => setTimeout(e, a)), F = (a, e, t) => {
|
|
7
|
-
try {
|
|
8
|
-
const o = new URL(a);
|
|
9
|
-
return e && o.searchParams.set("flowId", e), t && window.location.origin !== o.origin && o.searchParams.set("interviewId", t), o.toString();
|
|
10
|
-
} catch {
|
|
11
|
-
const n = new URLSearchParams();
|
|
12
|
-
e && n.set("flowId", e), t && n.set("interviewId", t);
|
|
13
|
-
const r = n.toString();
|
|
14
|
-
return r ? `${a}?${r}` : a;
|
|
15
|
-
}
|
|
16
|
-
}, y = ({
|
|
17
|
-
title: a,
|
|
18
|
-
message: e,
|
|
19
|
-
redirectionUrl: t,
|
|
20
|
-
redirectDelay: o = 3e3,
|
|
21
|
-
disableRedirect: n = !1,
|
|
22
|
-
redirectOriginOnly: r = !1,
|
|
23
|
-
flowId: c,
|
|
24
|
-
interviewId: i
|
|
25
|
-
}) => {
|
|
26
|
-
const { t: l } = m(), d = a || l("verificationComplete.title"), p = e || l("verificationComplete.message");
|
|
27
|
-
return f(() => {
|
|
28
|
-
(async () => {
|
|
29
|
-
if (n || !t) return;
|
|
30
|
-
const u = new URLSearchParams(window.location.search);
|
|
31
|
-
if (r && u.get("isRedirect") === "true")
|
|
32
|
-
return;
|
|
33
|
-
await S(o);
|
|
34
|
-
const w = F(
|
|
35
|
-
t,
|
|
36
|
-
c,
|
|
37
|
-
i
|
|
38
|
-
);
|
|
39
|
-
window.location.href = w;
|
|
40
|
-
})();
|
|
41
|
-
}, [
|
|
42
|
-
t,
|
|
43
|
-
o,
|
|
44
|
-
n,
|
|
45
|
-
r,
|
|
46
|
-
c,
|
|
47
|
-
i
|
|
48
|
-
]), /* @__PURE__ */ s("section", { class: "IncodeFlowCompleted", "aria-live": "assertive", children: [
|
|
49
|
-
d ? /* @__PURE__ */ s("h1", { class: "IncodeFlowCompletedTitle", children: d }) : null,
|
|
50
|
-
p ? /* @__PURE__ */ s("p", { class: "IncodeFlowCompletedSubtitle", children: p }) : null
|
|
51
|
-
] });
|
|
52
|
-
};
|
|
53
|
-
h(
|
|
54
|
-
y,
|
|
55
|
-
"incode-flow-completed",
|
|
56
|
-
[
|
|
57
|
-
"title",
|
|
58
|
-
"message",
|
|
59
|
-
"redirectionUrl",
|
|
60
|
-
"action",
|
|
61
|
-
"scoreStatus",
|
|
62
|
-
"redirectDelay",
|
|
63
|
-
"disableRedirect",
|
|
64
|
-
"redirectOriginOnly",
|
|
65
|
-
"flowId",
|
|
66
|
-
"interviewId"
|
|
67
|
-
],
|
|
68
|
-
{ shadow: !1 }
|
|
69
|
-
);
|
|
70
|
-
const C = "https://assets.incode.com/@incodetech/web/2.0.0-alpha.4/assets/incode-logo-00b4a3b0.svg", P = ({
|
|
71
|
-
logoUrl: a,
|
|
72
|
-
subtitle: e,
|
|
73
|
-
onStart: t
|
|
74
|
-
}) => {
|
|
75
|
-
const { t: o } = m();
|
|
76
|
-
return /* @__PURE__ */ s("section", { class: "IncodeFlowStart", "aria-live": "polite", children: /* @__PURE__ */ s("div", { class: "IncodeFlowStartContent", children: [
|
|
77
|
-
/* @__PURE__ */ s("div", { class: "IncodeFlowStartCenterSection", children: [
|
|
78
|
-
/* @__PURE__ */ s("div", { class: "IncodeFlowStartLogoContainer", children: /* @__PURE__ */ s("img", { src: a || C, alt: "Logo", class: "IncodeFlowStartLogo" }) }),
|
|
79
|
-
/* @__PURE__ */ s("h2", { class: "IncodeFlowStartSubtitle", children: e || "Demo App" })
|
|
80
|
-
] }),
|
|
81
|
-
/* @__PURE__ */ s(
|
|
82
|
-
g,
|
|
83
|
-
{
|
|
84
|
-
onClick: t,
|
|
85
|
-
class: "IncodeFlowStartButton",
|
|
86
|
-
"data-testid": "flow-start-button",
|
|
87
|
-
children: o("home.start")
|
|
88
|
-
}
|
|
89
|
-
)
|
|
90
|
-
] }) });
|
|
91
|
-
};
|
|
1
|
+
import { s as e } from "./setup-wNL83jmW.js";
|
|
2
|
+
import { s as t } from "./uiConfig-CQ1W9cUD.js";
|
|
92
3
|
export {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
T as IncodeFlow,
|
|
96
|
-
x as preloadIncodeFlow,
|
|
97
|
-
M as setUiConfig,
|
|
98
|
-
B as setup,
|
|
99
|
-
$ as useManager,
|
|
100
|
-
m as useTranslation
|
|
4
|
+
t as setUiConfig,
|
|
5
|
+
e as setup
|
|
101
6
|
};
|