@incodetech/web 2.0.0-alpha.5 → 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.
Files changed (36) hide show
  1. package/dist/base.css +230 -0
  2. package/dist/email/email.es.js +3 -3
  3. package/dist/flow/flow.es.js +555 -7
  4. package/dist/flow/styles.css +419 -189
  5. package/dist/{incodeModule-DFQUQvfY.js → incodeModule-BuCBWati.js} +47 -46
  6. package/dist/index.es.js +4 -99
  7. package/dist/{title-ng7q7YDh.js → instance-B-q0ZREN.js} +194 -215
  8. package/dist/{otpInput-BUrV4IAF.js → otpInput-cq1THeRd.js} +1 -1
  9. package/dist/phone/phone.es.js +3 -4
  10. package/dist/{button-DeMZ_34N.js → preact-custom-element.esm-BGQkPkOv.js} +145 -166
  11. package/dist/selfie/selfie.es.js +63 -63
  12. package/dist/selfie/styles.css +267 -787
  13. package/dist/setup-wNL83jmW.js +20 -0
  14. package/dist/title-XSxhaBDx.js +25 -0
  15. package/dist/types/email/email.d.ts +1 -1
  16. package/dist/types/email/styles.d.ts +1 -0
  17. package/dist/types/email.d.ts +1 -1
  18. package/dist/types/flow/flow.d.ts +1 -1
  19. package/dist/types/flow/styles.d.ts +1 -0
  20. package/dist/types/flow.d.ts +2 -2
  21. package/dist/types/index.d.ts +4 -99
  22. package/dist/types/phone/phone.d.ts +1 -1
  23. package/dist/types/phone/styles.d.ts +1 -0
  24. package/dist/types/phone.d.ts +1 -1
  25. package/dist/types/selfie/selfie.d.ts +1 -1
  26. package/dist/types/selfie/styles.d.ts +1 -0
  27. package/dist/types/selfie.d.ts +1 -1
  28. package/dist/types/styles.d.ts +1 -0
  29. package/dist/uiConfig-CQ1W9cUD.js +23 -0
  30. package/package.json +6 -5
  31. package/dist/button.css +0 -335
  32. package/dist/flow-ZK6OBsa3.js +0 -568
  33. package/dist/incodeModule.css +0 -119
  34. package/dist/otpInput.css +0 -167
  35. package/dist/successIcon.css +0 -4
  36. package/dist/title.css +0 -38
@@ -1,18 +1,22 @@
1
- import { d as f, u as C, S as s, c as p } from "./button-DeMZ_34N.js";
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
- const H = "https://assets.incode.com/@incodetech/web/2.0.0-alpha.5/assets/incode-logo-ed68c8e9.svg";
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 n of e)
6
- if (n !== void 0) return n;
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 n = e.match(/^(\d+)px$/);
12
- if (n) return Number(n[1]);
15
+ const o = e.match(/^(\d+)px$/);
16
+ if (o) return Number(o[1]);
13
17
  }
14
18
  function V(e) {
15
- const n = d([
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(n) ?? 80
30
+ logoHeightPx: L(o) ?? 80
27
31
  };
28
32
  }
29
33
  function m(e) {
30
- const n = f();
31
- return V({ ...e, uiConfig: n });
34
+ const o = p();
35
+ return V({ ...e, uiConfig: o });
32
36
  }
33
37
  const M = (e) => {
34
- let n = e.replace("#", "");
35
- n.length === 3 && (n = n.split("").map((t) => t + t).join(""));
36
- const o = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);
37
- return o?.[1] && o?.[2] && o?.[3] ? {
38
- r: Number.parseInt(o[1], 16) / 255,
39
- g: Number.parseInt(o[2], 16) / 255,
40
- b: Number.parseInt(o[3], 16) / 255
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, n, o) => {
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(n)}${t(o)}`;
51
+ return `#${t(e)}${t(o)}${t(n)}`;
48
52
  };
49
- function Z(e, n) {
50
- const o = typeof document < "u" ? document.documentElement : null;
51
- if (!o) return null;
52
- const t = getComputedStyle(o).getPropertyValue(e).trim();
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 w(e, n) {
66
- const o = M(n);
67
- if (!o) return e;
68
- const t = [o.r, o.g, o.b, 1];
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, o.r.toString()).replace(/"replaceG"/g, o.g.toString()).replace(/"replaceB"/g, o.b.toString())
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
- }, F = ({
180
+ }, y = ({
177
181
  title: e,
178
- subtitle: n,
179
- className: o,
182
+ subtitle: o,
183
+ className: n,
180
184
  logo: t,
181
185
  children: r,
182
186
  hideHeader: i,
@@ -189,11 +193,11 @@ const b = () => {
189
193
  hideFooterBranding: c,
190
194
  logo: t,
191
195
  defaultLogoSrc: H
192
- }), h = e || n;
196
+ }), h = e || o;
193
197
  return /* @__PURE__ */ C(
194
198
  "div",
195
199
  {
196
- class: `IncodePageContainer ${o ?? ""}`,
200
+ class: `IncodePageContainer ${n ?? ""}`,
197
201
  "data-testid": a,
198
202
  "data-permission-status": g,
199
203
  children: /* @__PURE__ */ C("div", { class: "IncodePageInner", children: [
@@ -210,9 +214,9 @@ const b = () => {
210
214
  /* @__PURE__ */ C(s, { size: l.hideHeader ? 40 : 24 }),
211
215
  /* @__PURE__ */ C("div", { class: "IncodePageTitleContainer", children: [
212
216
  e ? /* @__PURE__ */ C("h2", { class: "IncodePageTitle", children: e }) : null,
213
- n ? /* @__PURE__ */ C(u, { children: [
217
+ o ? /* @__PURE__ */ C(u, { children: [
214
218
  /* @__PURE__ */ C(s, { size: 12 }),
215
- /* @__PURE__ */ C("p", { class: "IncodePageSubtitle", children: n })
219
+ /* @__PURE__ */ C("p", { class: "IncodePageSubtitle", children: o })
216
220
  ] }) : null
217
221
  ] })
218
222
  ] }) : null,
@@ -222,22 +226,19 @@ const b = () => {
222
226
  }
223
227
  );
224
228
  };
225
- function N({ children: e }) {
226
- return /* @__PURE__ */ C("div", { class: "IncodeComponent", children: e });
227
- }
228
- function v(e, n, o) {
229
- p(e, n, [...o], {
229
+ function v(e, o, n) {
230
+ f(e, o, [...n], {
230
231
  shadow: !1
231
232
  });
232
233
  }
233
234
  const P = ["config", "onFinish", "onError"];
234
- function y(e, n) {
235
- v(e, n, P);
235
+ function $(e, o) {
236
+ v(e, o, P);
236
237
  }
237
238
  export {
238
- N as I,
239
- F as P,
240
- y as a,
239
+ F as I,
240
+ y as P,
241
+ N as a,
241
242
  Z as g,
242
- w as r
243
+ $ as r
243
244
  };
package/dist/index.es.js CHANGED
@@ -1,101 +1,6 @@
1
- import { I as T, p as x, s as B } from "./flow-ZK6OBsa3.js";
2
- import { c as h, u as s, B as g } from "./button-DeMZ_34N.js";
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.5/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
- y as FlowCompleted,
94
- P as FlowStart,
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
  };