@novasamatech/host-papp-react-ui 0.7.9-2 → 0.7.9-4
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/flow/Pairing.module.css.js +18 -20
- package/dist/flow/PairingModal.js +74 -80
- package/dist/flow/PairingPopover.js +84 -90
- package/dist/hooks/authStatus.d.ts +1 -20
- package/dist/hooks/authStatus.js +17 -44
- package/dist/index.css +1 -1
- package/dist/providers/AuthProvider.d.ts +1 -2
- package/dist/providers/AuthProvider.js +32 -39
- package/dist/providers/TranslationProvider.d.ts +0 -3
- package/dist/providers/TranslationProvider.js +20 -23
- package/package.json +3 -3
|
@@ -1,49 +1,47 @@
|
|
|
1
|
-
const o = "papp_Pairing-module_popoverContent_3xnU8", r = "papp_Pairing-module_container_gH7WU", e = "papp_Pairing-module_pairingContainer_R5atH", n = "papp_Pairing-module_pairingHeader_bpfNW", i = "papp_Pairing-module_scanCallToAction_lOQ-T",
|
|
1
|
+
const o = "papp_Pairing-module_popoverContent_3xnU8", r = "papp_Pairing-module_container_gH7WU", e = "papp_Pairing-module_pairingContainer_R5atH", n = "papp_Pairing-module_pairingHeader_bpfNW", i = "papp_Pairing-module_scanCallToAction_lOQ-T", p = "papp_Pairing-module_pairingDescription_UJE0U", a = "papp_Pairing-module_loaderLogo_iHsP9", t = "papp_Pairing-module_loaderContainer_cR46U", _ = "papp_Pairing-module_loaderText_beteT", l = "papp_Pairing-module_loaderContainerPopover_n1-JJ", c = "papp_Pairing-module_errorContainer_KW5T-", P = "papp_Pairing-module_errorTitle_qokH0", g = "papp_Pairing-module_popoverContainer_fOWoF", d = "papp_Pairing-module_pairingPopoverHeader_PAQot", s = "papp_Pairing-module_scanCallToActionPopover_Irz-z", C = "papp_Pairing-module_pairingDescriptionPopover_z71yj", v = "papp_Pairing-module_errorContainerPopover_4mELg", u = "papp_Pairing-module_pairingPopoverContainer_RvVnH", m = "papp_Pairing-module_errorTitlePopover_-FPrd", T = "papp_Pairing-module_errorGenericText_ZPwQb", H = "papp_Pairing-module_retryButton_kWeRx", x = {
|
|
2
2
|
popoverContent: o,
|
|
3
3
|
container: r,
|
|
4
4
|
pairingContainer: e,
|
|
5
5
|
pairingHeader: n,
|
|
6
6
|
scanCallToAction: i,
|
|
7
|
-
pairingDescription:
|
|
8
|
-
loaderLogo:
|
|
7
|
+
pairingDescription: p,
|
|
8
|
+
loaderLogo: a,
|
|
9
9
|
loaderContainer: t,
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
loaderText: _,
|
|
11
|
+
loaderContainerPopover: l,
|
|
12
12
|
errorContainer: c,
|
|
13
|
-
errorTitle:
|
|
14
|
-
popoverContainer:
|
|
15
|
-
pairingPopoverHeader:
|
|
13
|
+
errorTitle: P,
|
|
14
|
+
popoverContainer: g,
|
|
15
|
+
pairingPopoverHeader: d,
|
|
16
16
|
scanCallToActionPopover: s,
|
|
17
17
|
pairingDescriptionPopover: C,
|
|
18
18
|
errorContainerPopover: v,
|
|
19
19
|
pairingPopoverContainer: u,
|
|
20
20
|
errorTitlePopover: m,
|
|
21
21
|
errorGenericText: T,
|
|
22
|
-
|
|
23
|
-
retryButton: x
|
|
22
|
+
retryButton: H
|
|
24
23
|
};
|
|
25
24
|
export {
|
|
26
25
|
r as container,
|
|
27
|
-
|
|
26
|
+
x as default,
|
|
28
27
|
c as errorContainer,
|
|
29
28
|
v as errorContainerPopover,
|
|
30
29
|
T as errorGenericText,
|
|
31
|
-
|
|
30
|
+
P as errorTitle,
|
|
32
31
|
m as errorTitlePopover,
|
|
33
32
|
t as loaderContainer,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
l as loaderText,
|
|
33
|
+
l as loaderContainerPopover,
|
|
34
|
+
a as loaderLogo,
|
|
35
|
+
_ as loaderText,
|
|
38
36
|
e as pairingContainer,
|
|
39
|
-
|
|
37
|
+
p as pairingDescription,
|
|
40
38
|
C as pairingDescriptionPopover,
|
|
41
39
|
n as pairingHeader,
|
|
42
40
|
u as pairingPopoverContainer,
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
d as pairingPopoverHeader,
|
|
42
|
+
g as popoverContainer,
|
|
45
43
|
o as popoverContent,
|
|
46
|
-
|
|
44
|
+
H as retryButton,
|
|
47
45
|
i as scanCallToAction,
|
|
48
46
|
s as scanCallToActionPopover
|
|
49
47
|
};
|
|
@@ -1,104 +1,98 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as p, jsxs as v } from "react/jsx-runtime";
|
|
2
2
|
import { c as S } from "react/compiler-runtime";
|
|
3
3
|
import { Button as x } from "@novasamatech/tr-ui";
|
|
4
|
-
import { memo as
|
|
4
|
+
import { memo as M, useEffect as b } from "react";
|
|
5
5
|
import { useAuthStatus as z } from "../hooks/authStatus.js";
|
|
6
|
-
import { useAuthentication as
|
|
7
|
-
import { useTranslations as
|
|
6
|
+
import { useAuthentication as A } from "../providers/AuthProvider.js";
|
|
7
|
+
import { useTranslations as T } from "../providers/TranslationProvider.js";
|
|
8
8
|
import { LogoSmall as D } from "../ui/LogoSmall.js";
|
|
9
|
-
import { Modal as
|
|
10
|
-
import { QrCode as
|
|
11
|
-
import
|
|
12
|
-
const
|
|
13
|
-
const e = S(
|
|
14
|
-
let
|
|
15
|
-
e[0] !==
|
|
9
|
+
import { Modal as H } from "../ui/Modal.js";
|
|
10
|
+
import { QrCode as $ } from "../ui/QrCode.js";
|
|
11
|
+
import c from "./Pairing.module.css.js";
|
|
12
|
+
const F = M((m) => {
|
|
13
|
+
const e = S(28);
|
|
14
|
+
let r;
|
|
15
|
+
e[0] !== m ? (r = m === void 0 ? {} : m, e[0] = m, e[1] = r) : r = e[1];
|
|
16
16
|
const {
|
|
17
|
-
theme:
|
|
18
|
-
size:
|
|
19
|
-
} =
|
|
17
|
+
theme: o,
|
|
18
|
+
size: a
|
|
19
|
+
} = r, s = a === void 0 ? 280 : a, i = A(), {
|
|
20
20
|
status: t
|
|
21
|
-
} = z(),
|
|
22
|
-
let
|
|
23
|
-
e[2] !==
|
|
24
|
-
!E && t.step !== "
|
|
25
|
-
}, e[2] =
|
|
26
|
-
const d =
|
|
27
|
-
let
|
|
28
|
-
e[5] !==
|
|
29
|
-
|
|
30
|
-
},
|
|
21
|
+
} = z(), n = i.authUIMode === "modal" && t.step !== "none" && t.step !== "finished";
|
|
22
|
+
let l;
|
|
23
|
+
e[2] !== i || e[3] !== t.step ? (l = (E) => {
|
|
24
|
+
!E && t.step !== "pending" && i.abortAuthentication();
|
|
25
|
+
}, e[2] = i, e[3] = t.step, e[4] = l) : l = e[4];
|
|
26
|
+
const d = l;
|
|
27
|
+
let y, N;
|
|
28
|
+
e[5] !== i || e[6] !== t.step ? (y = () => {
|
|
29
|
+
i.authUIMode === "modal" && t.step === "finished" && i.abortAuthentication();
|
|
30
|
+
}, N = [i, t.step], e[5] = i, e[6] = t.step, e[7] = y, e[8] = N) : (y = e[7], N = e[8]), b(y, N);
|
|
31
31
|
let g;
|
|
32
|
-
e[9] !== s || e[10] !== t.payload || e[11] !== t.step || e[12] !==
|
|
32
|
+
e[9] !== s || e[10] !== t.payload || e[11] !== t.step || e[12] !== o ? (g = t.step === "pairing" && /* @__PURE__ */ p(L, { theme: o, size: s, payload: t.payload }), e[9] = s, e[10] = t.payload, e[11] = t.step, e[12] = o, e[13] = g) : g = e[13];
|
|
33
33
|
let f;
|
|
34
|
-
e[14] !== t.
|
|
34
|
+
e[14] !== t.stage || e[15] !== t.step ? (f = t.step === "pending" && /* @__PURE__ */ p(P, { stage: t.stage }), e[14] = t.stage, e[15] = t.step, e[16] = f) : f = e[16];
|
|
35
35
|
let h;
|
|
36
|
-
e[17] !== t.step ? (h = t.step === "
|
|
36
|
+
e[17] !== t.message || e[18] !== t.step ? (h = t.step === "pairingError" && /* @__PURE__ */ p(R, { message: t.message }), e[17] = t.message, e[18] = t.step, e[19] = h) : h = e[19];
|
|
37
37
|
let u;
|
|
38
|
-
e[
|
|
39
|
-
let y;
|
|
40
|
-
e[22] !== g || e[23] !== f || e[24] !== h || e[25] !== u ? (y = /* @__PURE__ */ L("div", { className: m.container, children: [
|
|
38
|
+
e[20] !== g || e[21] !== f || e[22] !== h ? (u = /* @__PURE__ */ v("div", { className: c.container, children: [
|
|
41
39
|
g,
|
|
42
40
|
f,
|
|
43
|
-
h
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}), R = (i) => {
|
|
41
|
+
h
|
|
42
|
+
] }), e[20] = g, e[21] = f, e[22] = h, e[23] = u) : u = e[23];
|
|
43
|
+
let C;
|
|
44
|
+
return e[24] !== n || e[25] !== u || e[26] !== d ? (C = /* @__PURE__ */ p(H, { open: n, onOpenChange: d, width: "fit-content", children: u }), e[24] = n, e[25] = u, e[26] = d, e[27] = C) : C = e[27], C;
|
|
45
|
+
}), L = (m) => {
|
|
49
46
|
const e = S(15), {
|
|
50
|
-
payload:
|
|
51
|
-
size:
|
|
52
|
-
theme:
|
|
53
|
-
} =
|
|
54
|
-
let
|
|
55
|
-
e[0] !== s.pairingHeader ? (
|
|
47
|
+
payload: r,
|
|
48
|
+
size: o,
|
|
49
|
+
theme: a
|
|
50
|
+
} = m, s = T();
|
|
51
|
+
let i;
|
|
52
|
+
e[0] !== s.pairingHeader ? (i = /* @__PURE__ */ p("span", { className: c.pairingHeader, children: s.pairingHeader }), e[0] = s.pairingHeader, e[1] = i) : i = e[1];
|
|
56
53
|
let t;
|
|
57
|
-
e[2] !== s.pairingScanCallToAction ? (t = /* @__PURE__ */
|
|
58
|
-
let o;
|
|
59
|
-
e[4] !== n || e[5] !== l || e[6] !== r ? (o = /* @__PURE__ */ c(P, { value: n, size: l, theme: r }), e[4] = n, e[5] = l, e[6] = r, e[7] = o) : o = e[7];
|
|
60
|
-
let p;
|
|
61
|
-
e[8] !== s.pairingDescription ? (p = /* @__PURE__ */ c("span", { className: m.pairingDescription, children: s.pairingDescription }), e[8] = s.pairingDescription, e[9] = p) : p = e[9];
|
|
62
|
-
let d;
|
|
63
|
-
return e[10] !== a || e[11] !== t || e[12] !== o || e[13] !== p ? (d = /* @__PURE__ */ L("div", { className: m.pairingContainer, children: [
|
|
64
|
-
a,
|
|
65
|
-
t,
|
|
66
|
-
o,
|
|
67
|
-
p
|
|
68
|
-
] }), e[10] = a, e[11] = t, e[12] = o, e[13] = p, e[14] = d) : d = e[14], d;
|
|
69
|
-
}, j = () => {
|
|
70
|
-
const i = S(8), e = A();
|
|
54
|
+
e[2] !== s.pairingScanCallToAction ? (t = /* @__PURE__ */ p("span", { className: c.scanCallToAction, children: s.pairingScanCallToAction }), e[2] = s.pairingScanCallToAction, e[3] = t) : t = e[3];
|
|
71
55
|
let n;
|
|
72
|
-
|
|
56
|
+
e[4] !== r || e[5] !== o || e[6] !== a ? (n = /* @__PURE__ */ p($, { value: r, size: o, theme: a }), e[4] = r, e[5] = o, e[6] = a, e[7] = n) : n = e[7];
|
|
73
57
|
let l;
|
|
74
|
-
|
|
75
|
-
let
|
|
76
|
-
i[
|
|
77
|
-
|
|
78
|
-
|
|
58
|
+
e[8] !== s.pairingDescription ? (l = /* @__PURE__ */ p("span", { className: c.pairingDescription, children: s.pairingDescription }), e[8] = s.pairingDescription, e[9] = l) : l = e[9];
|
|
59
|
+
let d;
|
|
60
|
+
return e[10] !== i || e[11] !== t || e[12] !== n || e[13] !== l ? (d = /* @__PURE__ */ v("div", { className: c.pairingContainer, children: [
|
|
61
|
+
i,
|
|
62
|
+
t,
|
|
79
63
|
n,
|
|
80
|
-
l
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
64
|
+
l
|
|
65
|
+
] }), e[10] = i, e[11] = t, e[12] = n, e[13] = l, e[14] = d) : d = e[14], d;
|
|
66
|
+
}, P = (m) => {
|
|
67
|
+
const e = S(3), {
|
|
68
|
+
stage: r
|
|
69
|
+
} = m;
|
|
70
|
+
let o;
|
|
71
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ p("div", { className: c.loaderLogo, children: /* @__PURE__ */ p(D, { size: 100 }) }), e[0] = o) : o = e[0];
|
|
72
|
+
let a;
|
|
73
|
+
return e[1] !== r ? (a = /* @__PURE__ */ v("div", { className: c.loaderContainer, children: [
|
|
74
|
+
o,
|
|
75
|
+
/* @__PURE__ */ p("span", { className: c.loaderText, children: r })
|
|
76
|
+
] }), e[1] = r, e[2] = a) : a = e[2], a;
|
|
77
|
+
}, R = (m) => {
|
|
84
78
|
const e = S(13), {
|
|
85
|
-
message:
|
|
86
|
-
} =
|
|
79
|
+
message: r
|
|
80
|
+
} = m, o = A(), a = T();
|
|
87
81
|
let s;
|
|
88
|
-
e[0] !==
|
|
89
|
-
let
|
|
90
|
-
e[2] !==
|
|
82
|
+
e[0] !== a.pairingError ? (s = /* @__PURE__ */ p("span", { className: c.errorTitle, children: a.pairingError }), e[0] = a.pairingError, e[1] = s) : s = e[1];
|
|
83
|
+
let i;
|
|
84
|
+
e[2] !== r ? (i = /* @__PURE__ */ p("span", { className: c.errorGenericText, children: r }), e[2] = r, e[3] = i) : i = e[3];
|
|
91
85
|
let t;
|
|
92
|
-
e[4] !==
|
|
93
|
-
let
|
|
94
|
-
e[6] !== t || e[7] !==
|
|
95
|
-
let
|
|
96
|
-
return e[9] !== s || e[10] !==
|
|
86
|
+
e[4] !== o ? (t = () => o.authenticate(), e[4] = o, e[5] = t) : t = e[5];
|
|
87
|
+
let n;
|
|
88
|
+
e[6] !== t || e[7] !== a.pairingRetry ? (n = /* @__PURE__ */ p(x, { variant: "secondary", type: "button", onClick: t, children: a.pairingRetry }), e[6] = t, e[7] = a.pairingRetry, e[8] = n) : n = e[8];
|
|
89
|
+
let l;
|
|
90
|
+
return e[9] !== s || e[10] !== i || e[11] !== n ? (l = /* @__PURE__ */ v("div", { className: c.errorContainer, children: [
|
|
97
91
|
s,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
] }), e[9] = s, e[10] =
|
|
92
|
+
i,
|
|
93
|
+
n
|
|
94
|
+
] }), e[9] = s, e[10] = i, e[11] = n, e[12] = l) : l = e[12], l;
|
|
101
95
|
};
|
|
102
96
|
export {
|
|
103
|
-
|
|
97
|
+
F as PairingModal
|
|
104
98
|
};
|
|
@@ -1,123 +1,117 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n, jsxs as D } from "react/jsx-runtime";
|
|
2
2
|
import { c as A } from "react/compiler-runtime";
|
|
3
3
|
import * as x from "@radix-ui/react-popover";
|
|
4
|
-
import { memo as
|
|
5
|
-
import { useAuthStatus as
|
|
6
|
-
import { useAuthentication as
|
|
4
|
+
import { memo as I, useEffect as K } from "react";
|
|
5
|
+
import { useAuthStatus as _ } from "../hooks/authStatus.js";
|
|
6
|
+
import { useAuthentication as W } from "../providers/AuthProvider.js";
|
|
7
7
|
import { useTranslations as j } from "../providers/TranslationProvider.js";
|
|
8
|
-
import { LogoSmall as
|
|
9
|
-
import { QrCode as
|
|
8
|
+
import { LogoSmall as w } from "../ui/LogoSmall.js";
|
|
9
|
+
import { QrCode as G } from "../ui/QrCode.js";
|
|
10
10
|
import g from "./Pairing.module.css.js";
|
|
11
|
-
const
|
|
12
|
-
const e = A(
|
|
13
|
-
theme:
|
|
14
|
-
size:
|
|
11
|
+
const oe = I((v) => {
|
|
12
|
+
const e = A(43), {
|
|
13
|
+
theme: a,
|
|
14
|
+
size: l,
|
|
15
15
|
align: i,
|
|
16
|
-
side:
|
|
17
|
-
alignOffset:
|
|
18
|
-
sizeOffset:
|
|
19
|
-
children:
|
|
20
|
-
} =
|
|
16
|
+
side: c,
|
|
17
|
+
alignOffset: o,
|
|
18
|
+
sizeOffset: r,
|
|
19
|
+
children: s
|
|
20
|
+
} = v, p = a === void 0 ? "dark" : a, f = l === void 0 ? 240 : l, m = r === void 0 ? 4 : r, d = W(), {
|
|
21
21
|
status: t
|
|
22
|
-
} =
|
|
23
|
-
let
|
|
24
|
-
e[0] !==
|
|
25
|
-
t.step === "none" &&
|
|
26
|
-
}, e[0] =
|
|
27
|
-
const
|
|
22
|
+
} = _(), B = typeof process < "u" && process.env?.STORYBOOK === "true", R = d.authUIMode === "popover" && (B || t.step !== "none");
|
|
23
|
+
let E;
|
|
24
|
+
e[0] !== d || e[1] !== t.step ? (E = () => {
|
|
25
|
+
t.step === "none" && d.authenticate("popover");
|
|
26
|
+
}, e[0] = d, e[1] = t.step, e[2] = E) : E = e[2];
|
|
27
|
+
const H = E;
|
|
28
28
|
let b;
|
|
29
|
-
e[3] !==
|
|
30
|
-
!
|
|
31
|
-
}, e[3] =
|
|
29
|
+
e[3] !== d || e[4] !== t.step ? (b = (T) => {
|
|
30
|
+
!T && t.step !== "pending" && d.abortAuthentication();
|
|
31
|
+
}, e[3] = d, e[4] = t.step, e[5] = b) : b = e[5];
|
|
32
32
|
const $ = b;
|
|
33
|
-
let z,
|
|
34
|
-
e[6] !==
|
|
35
|
-
|
|
36
|
-
},
|
|
33
|
+
let z, L;
|
|
34
|
+
e[6] !== d ? (z = () => () => {
|
|
35
|
+
d.abortAuthentication();
|
|
36
|
+
}, L = [d], e[6] = d, e[7] = z, e[8] = L) : (z = e[7], L = e[8]), K(z, L);
|
|
37
37
|
let h;
|
|
38
|
-
e[9] !==
|
|
38
|
+
e[9] !== s || e[10] !== H ? (h = /* @__PURE__ */ n(x.Trigger, { asChild: !0, onClick: H, children: s }), e[9] = s, e[10] = H, e[11] = h) : h = e[11];
|
|
39
39
|
let u, P;
|
|
40
|
-
e[12] !== t.step ? (P = (
|
|
41
|
-
t.step === "
|
|
42
|
-
}, u = (
|
|
43
|
-
t.step === "
|
|
40
|
+
e[12] !== t.step ? (P = (T) => {
|
|
41
|
+
t.step === "pending" && T.preventDefault();
|
|
42
|
+
}, u = (T) => {
|
|
43
|
+
t.step === "pending" && T.preventDefault();
|
|
44
44
|
}, e[12] = t.step, e[13] = u, e[14] = P) : (u = e[13], P = e[14]);
|
|
45
45
|
let y;
|
|
46
|
-
e[15] !==
|
|
47
|
-
let N;
|
|
48
|
-
e[20] !== t.message || e[21] !== t.step ? (N = t.step === "pairingError" && /* @__PURE__ */ a(B, { message: t.message }), e[20] = t.message, e[21] = t.step, e[22] = N) : N = e[22];
|
|
46
|
+
e[15] !== f || e[16] !== t.payload || e[17] !== t.step || e[18] !== p ? (y = t.step === "pairing" && /* @__PURE__ */ n(M, { theme: p, size: f, payload: t.payload }), e[15] = f, e[16] = t.payload, e[17] = t.step, e[18] = p, e[19] = y) : y = e[19];
|
|
49
47
|
let C;
|
|
50
|
-
e[
|
|
48
|
+
e[20] !== t.stage || e[21] !== t.step ? (C = t.step === "pending" && /* @__PURE__ */ n(Q, { stage: t.stage }), e[20] = t.stage, e[21] = t.step, e[22] = C) : C = e[22];
|
|
49
|
+
let N;
|
|
50
|
+
e[23] !== t.message || e[24] !== t.step ? (N = t.step === "pairingError" && /* @__PURE__ */ n(U, { message: t.message }), e[23] = t.message, e[24] = t.step, e[25] = N) : N = e[25];
|
|
51
51
|
let S;
|
|
52
|
-
e[
|
|
53
|
-
let L;
|
|
54
|
-
e[28] !== y || e[29] !== N || e[30] !== C || e[31] !== S ? (L = /* @__PURE__ */ T("div", { className: g.popoverContainer, children: [
|
|
52
|
+
e[26] !== y || e[27] !== C || e[28] !== N ? (S = /* @__PURE__ */ D("div", { className: g.popoverContainer, children: [
|
|
55
53
|
y,
|
|
56
|
-
N,
|
|
57
54
|
C,
|
|
58
|
-
|
|
59
|
-
] }), e[
|
|
55
|
+
N
|
|
56
|
+
] }), e[26] = y, e[27] = C, e[28] = N, e[29] = S) : S = e[29];
|
|
60
57
|
let O;
|
|
61
|
-
e[
|
|
58
|
+
e[30] !== i || e[31] !== o || e[32] !== c || e[33] !== m || e[34] !== u || e[35] !== S || e[36] !== P ? (O = /* @__PURE__ */ n(x.Portal, { children: /* @__PURE__ */ n(x.Content, { side: c, align: i, sideOffset: m, alignOffset: o, className: g.popoverContent, onInteractOutside: P, onEscapeKeyDown: u, children: S }) }), e[30] = i, e[31] = o, e[32] = c, e[33] = m, e[34] = u, e[35] = S, e[36] = P, e[37] = O) : O = e[37];
|
|
62
59
|
let k;
|
|
63
|
-
return e[
|
|
60
|
+
return e[38] !== R || e[39] !== O || e[40] !== h || e[41] !== $ ? (k = /* @__PURE__ */ D(x.Root, { open: R, onOpenChange: $, children: [
|
|
64
61
|
h,
|
|
65
62
|
O
|
|
66
|
-
] }), e[
|
|
67
|
-
}),
|
|
63
|
+
] }), e[38] = R, e[39] = O, e[40] = h, e[41] = $, e[42] = k) : k = e[42], k;
|
|
64
|
+
}), M = (v) => {
|
|
68
65
|
const e = A(15), {
|
|
69
|
-
payload:
|
|
70
|
-
size:
|
|
66
|
+
payload: a,
|
|
67
|
+
size: l,
|
|
71
68
|
theme: i
|
|
72
|
-
} =
|
|
69
|
+
} = v, c = i === void 0 ? "light" : i, o = j();
|
|
70
|
+
let r;
|
|
71
|
+
e[0] !== o.pairingPopoverWelcome ? (r = /* @__PURE__ */ n("span", { className: g.pairingPopoverHeader, children: o.pairingPopoverWelcome }), e[0] = o.pairingPopoverWelcome, e[1] = r) : r = e[1];
|
|
72
|
+
let s;
|
|
73
|
+
e[2] !== a || e[3] !== l || e[4] !== c ? (s = /* @__PURE__ */ n(G, { value: a, size: l, theme: c }), e[2] = a, e[3] = l, e[4] = c, e[5] = s) : s = e[5];
|
|
73
74
|
let p;
|
|
74
|
-
e[
|
|
75
|
-
let
|
|
76
|
-
e[
|
|
75
|
+
e[6] !== o.pairingPopoverLoginHeading ? (p = /* @__PURE__ */ n("span", { className: g.scanCallToActionPopover, children: o.pairingPopoverLoginHeading }), e[6] = o.pairingPopoverLoginHeading, e[7] = p) : p = e[7];
|
|
76
|
+
let f;
|
|
77
|
+
e[8] !== o.pairingPopoverScanDescription ? (f = /* @__PURE__ */ n("span", { className: g.pairingDescriptionPopover, children: o.pairingPopoverScanDescription }), e[8] = o.pairingPopoverScanDescription, e[9] = f) : f = e[9];
|
|
77
78
|
let m;
|
|
78
|
-
e[
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
let v;
|
|
82
|
-
return e[10] !== p || e[11] !== l || e[12] !== m || e[13] !== d ? (v = /* @__PURE__ */ T("div", { className: g.pairingPopoverContainer, children: [
|
|
79
|
+
return e[10] !== r || e[11] !== s || e[12] !== p || e[13] !== f ? (m = /* @__PURE__ */ D("div", { className: g.pairingPopoverContainer, children: [
|
|
80
|
+
r,
|
|
81
|
+
s,
|
|
83
82
|
p,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
let
|
|
91
|
-
|
|
92
|
-
let c;
|
|
93
|
-
o[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ a("div", { className: g.loaderLogo, children: /* @__PURE__ */ a(M, { size: 100 }) }), o[2] = c) : c = o[2];
|
|
83
|
+
f
|
|
84
|
+
] }), e[10] = r, e[11] = s, e[12] = p, e[13] = f, e[14] = m) : m = e[14], m;
|
|
85
|
+
}, Q = (v) => {
|
|
86
|
+
const e = A(3), {
|
|
87
|
+
stage: a
|
|
88
|
+
} = v;
|
|
89
|
+
let l;
|
|
90
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ n("div", { className: g.loaderLogo, children: /* @__PURE__ */ n(w, { size: 100 }) }), e[0] = l) : l = e[0];
|
|
94
91
|
let i;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
i
|
|
101
|
-
] }), o[5] = n, o[6] = i, o[7] = r) : r = o[7], r;
|
|
102
|
-
}, B = (o) => {
|
|
92
|
+
return e[1] !== a ? (i = /* @__PURE__ */ D("div", { className: g.loaderContainerPopover, children: [
|
|
93
|
+
l,
|
|
94
|
+
/* @__PURE__ */ n("span", { className: g.loaderText, children: a })
|
|
95
|
+
] }), e[1] = a, e[2] = i) : i = e[2], i;
|
|
96
|
+
}, U = (v) => {
|
|
103
97
|
const e = A(13), {
|
|
104
|
-
message:
|
|
105
|
-
} =
|
|
98
|
+
message: a
|
|
99
|
+
} = v, l = W(), i = j();
|
|
100
|
+
let c;
|
|
101
|
+
e[0] !== i.pairingError ? (c = /* @__PURE__ */ n("span", { className: g.errorTitlePopover, children: i.pairingError }), e[0] = i.pairingError, e[1] = c) : c = e[1];
|
|
102
|
+
let o;
|
|
103
|
+
e[2] !== a ? (o = a && /* @__PURE__ */ n("span", { className: g.errorGenericText, children: a }), e[2] = a, e[3] = o) : o = e[3];
|
|
106
104
|
let r;
|
|
107
|
-
e[
|
|
105
|
+
e[4] !== l ? (r = () => l.authenticate(), e[4] = l, e[5] = r) : r = e[5];
|
|
108
106
|
let s;
|
|
109
|
-
e[
|
|
107
|
+
e[6] !== r || e[7] !== i.pairingRetry ? (s = /* @__PURE__ */ n("button", { className: g.retryButton, type: "button", onClick: r, children: i.pairingRetry }), e[6] = r, e[7] = i.pairingRetry, e[8] = s) : s = e[8];
|
|
110
108
|
let p;
|
|
111
|
-
e[
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
r,
|
|
117
|
-
s,
|
|
118
|
-
l
|
|
119
|
-
] }), e[9] = r, e[10] = s, e[11] = l, e[12] = m) : m = e[12], m;
|
|
109
|
+
return e[9] !== c || e[10] !== o || e[11] !== s ? (p = /* @__PURE__ */ D("div", { className: g.errorContainerPopover, children: [
|
|
110
|
+
c,
|
|
111
|
+
o,
|
|
112
|
+
s
|
|
113
|
+
] }), e[9] = c, e[10] = o, e[11] = s, e[12] = p) : p = e[12], p;
|
|
120
114
|
};
|
|
121
115
|
export {
|
|
122
|
-
|
|
116
|
+
oe as PairingPopover
|
|
123
117
|
};
|
|
@@ -1,24 +1,5 @@
|
|
|
1
1
|
export declare const useAuthStatus: () => {
|
|
2
|
-
status:
|
|
3
|
-
step: "none";
|
|
4
|
-
} | {
|
|
5
|
-
step: "initial";
|
|
6
|
-
} | {
|
|
7
|
-
step: "attestation";
|
|
8
|
-
} | {
|
|
9
|
-
step: "pairing";
|
|
10
|
-
payload: string;
|
|
11
|
-
} | {
|
|
12
|
-
step: "pairingError";
|
|
13
|
-
message: string;
|
|
14
|
-
} | {
|
|
15
|
-
step: "finished";
|
|
16
|
-
session: import('@novasamatech/host-papp').StoredUserSession;
|
|
17
|
-
} | {
|
|
18
|
-
step: "attestationError";
|
|
19
|
-
message: string;
|
|
20
|
-
};
|
|
21
|
-
guestUsername: string | null;
|
|
2
|
+
status: import('@novasamatech/host-papp').PairingStatus;
|
|
22
3
|
signedInUser: {
|
|
23
4
|
id: string;
|
|
24
5
|
localAccount: {
|
package/dist/hooks/authStatus.js
CHANGED
|
@@ -1,52 +1,25 @@
|
|
|
1
|
-
import { c as
|
|
1
|
+
import { c as o } from "react/compiler-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { useAuthentication as
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
pairingStatus:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
let r;
|
|
3
|
+
import { useAuthentication as r } from "../providers/AuthProvider.js";
|
|
4
|
+
const p = () => {
|
|
5
|
+
const t = o(3), {
|
|
6
|
+
pairingStatus: s
|
|
7
|
+
} = r();
|
|
8
|
+
let i;
|
|
10
9
|
t: {
|
|
11
|
-
if (
|
|
12
|
-
|
|
10
|
+
if (s.step === "finished") {
|
|
11
|
+
i = s.session;
|
|
13
12
|
break t;
|
|
14
13
|
}
|
|
15
|
-
|
|
14
|
+
i = null;
|
|
16
15
|
}
|
|
17
|
-
const
|
|
18
|
-
let
|
|
19
|
-
t
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
if (t.step === "initial") {
|
|
25
|
-
s = t;
|
|
26
|
-
break t;
|
|
27
|
-
}
|
|
28
|
-
if (t.step === "pairing") {
|
|
29
|
-
s = t;
|
|
30
|
-
break t;
|
|
31
|
-
}
|
|
32
|
-
if (i.step === "attestation") {
|
|
33
|
-
s = i;
|
|
34
|
-
break t;
|
|
35
|
-
}
|
|
36
|
-
if (i.step === "attestationError") {
|
|
37
|
-
s = i;
|
|
38
|
-
break t;
|
|
39
|
-
}
|
|
40
|
-
s = t;
|
|
41
|
-
}
|
|
42
|
-
const u = s;
|
|
43
|
-
let n;
|
|
44
|
-
return e[0] !== a || e[1] !== o || e[2] !== u ? (n = {
|
|
45
|
-
status: u,
|
|
46
|
-
guestUsername: a,
|
|
47
|
-
signedInUser: o
|
|
48
|
-
}, e[0] = a, e[1] = o, e[2] = u, e[3] = n) : n = e[3], n;
|
|
16
|
+
const n = i;
|
|
17
|
+
let e;
|
|
18
|
+
return t[0] !== s || t[1] !== n ? (e = {
|
|
19
|
+
status: s,
|
|
20
|
+
signedInUser: n
|
|
21
|
+
}, t[0] = s, t[1] = n, t[2] = e) : e = t[2], e;
|
|
49
22
|
};
|
|
50
23
|
export {
|
|
51
|
-
|
|
24
|
+
p as useAuthStatus
|
|
52
25
|
};
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@keyframes papp_Modal-module_fadeInOpacity_lXaQm{0%{opacity:0}to{opacity:1}}.papp_Modal-module_backdrop_5PnfC{z-index:1000;position:fixed;inset:0;background:hsl(var(--general-background) / .3);opacity:1;animation-name:papp_Modal-module_fadeInOpacity_lXaQm;animation-iteration-count:1;animation-timing-function:ease-in;animation-duration:.3s}.papp_Modal-module_modal_L5tLT{z-index:1001;position:absolute;inset:0;margin:auto;width:300px;height:fit-content;border-radius:32px;opacity:1;animation-name:papp_Modal-module_fadeInOpacity_lXaQm;animation-iteration-count:1;animation-timing-function:ease-in;animation-duration:.5s;text-rendering:geometricPrecision;background:var(--color-surface-tertiary-inverse);color:var(--color-text-foreground-inverse)}@keyframes papp_QrCode-module_fadeInOpacity_ZCaTW{0%{opacity:0}to{opacity:1}}.papp_QrCode-module_container_L11My{border-radius:34px;animation-name:papp_QrCode-module_fadeInOpacity_ZCaTW;animation-iteration-count:1;animation-timing-function:ease-in;animation-duration:.3s;display:flex;justify-content:center;align-items:center;padding:16px}.papp_QrCode-module_gradientLayer_0Gbcy{position:absolute;inset:0;background:radial-gradient(circle at 50% 50%,rgba(255,255,255,.9) 0%,rgba(255,240,200,.7) 5%,rgba(255,200,150,.4) 10%,transparent 18%),radial-gradient(ellipse at 50% 30%,rgba(255,100,200,.6) 0%,rgba(200,120,255,.5) 15%,rgba(150,100,255,.3) 30%,transparent 50%),radial-gradient(ellipse at 50% 70%,rgba(100,200,255,.5) 0%,rgba(80,150,255,.4) 20%,rgba(60,100,200,.3) 40%,transparent 55%),radial-gradient(circle at 20% 20%,rgba(150,100,255,.5) 0%,rgba(120,80,200,.3) 25%,transparent 45%),radial-gradient(circle at 80% 20%,rgba(100,200,255,.5) 0%,rgba(80,150,200,.3) 25%,transparent 45%),radial-gradient(circle at 20% 80%,rgba(255,150,100,.5) 0%,rgba(200,100,150,.3) 25%,transparent 45%),linear-gradient(135deg,#3c5096e6,#5064b4cc 12%,#6478c8b3 25%,#7864b4b3 37%,#8c50a0b3 50%,#78468cbf 62%,#645078cc 75%,#505a82d9 87%,#3c466ee6)}.papp_QrCode-module_gradient-layer_7agFl:before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 30% 40%,rgba(255,200,100,.3) 0%,rgba(255,150,150,.2) 15%,transparent 30%),radial-gradient(circle at 70% 60%,rgba(100,255,200,.3) 0%,rgba(100,200,255,.2) 15%,transparent 30%),radial-gradient(circle at 50% 80%,rgba(200,100,255,.3) 0%,rgba(150,100,200,.2) 20%,transparent 35%);filter:blur(25px)}.papp_QrCode-module_gradient-layer_7agFl:after{content:"";position:absolute;inset:0;background:radial-gradient(circle at 40% 30%,rgba(255,180,200,.2) 0%,rgba(200,150,255,.15) 20%,transparent 35%),radial-gradient(circle at 60% 70%,rgba(100,220,255,.2) 0%,rgba(150,180,255,.15) 20%,transparent 35%),radial-gradient(ellipse at 80% 50%,rgba(255,150,100,.2) 0%,rgba(255,100,150,.1) 25%,transparent 40%);filter:blur(35px);mix-blend-mode:screen}.papp_Pairing-module_popoverContent_3xnU8{padding:0;border-radius:32px;background:var(--color-surface-tertiary-inverse);color:var(--color-text-foreground-inverse)}.papp_Pairing-module_container_gH7WU{width:350px}.papp_Pairing-module_genericText_zDzqC{font-family:Inter,sans-serif;font-size:24px}.papp_Pairing-module_pairingContainer_R5atH{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px 50px 30px}.papp_Pairing-module_pairingHeader_bpfNW{font-family:Inter,sans-serif;text-align:center;font-size:20px;font-style:normal;font-weight:400;line-height:1.83;letter-spacing:-.573px;margin-bottom:9px;color:var(--color-text-foreground-inverse)}.papp_Pairing-module_scanCallToAction_lOQ-T{font-family:Inter,sans-serif;color:var(--color-text-foreground-inverse, hsl(var(--muted-foreground)));text-align:center;font-size:22px;font-style:normal;font-weight:400;line-height:1.5;margin-bottom:15px}.papp_Pairing-module_pairingDescription_UJE0U{font-family:Inter,sans-serif;width:300px;color:var(--color-text-foreground-inverse, hsl(var(--muted-foreground)));text-align:center;font-size:16px;font-style:normal;font-weight:400;line-height:1.2;margin-top:20px}@keyframes papp_Pairing-module_loader_S62aK{0%{opacity:1}50%{opacity:.5}to{opacity:1}}.papp_Pairing-module_loaderLogo_iHsP9{width:fit-content;height:fit-content;animation:papp_Pairing-module_loader_S62aK 3s linear infinite}.papp_Pairing-module_loaderContainer_cR46U{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:40px;padding:30px;box-sizing:border-box}.papp_Pairing-
|
|
1
|
+
@keyframes papp_Modal-module_fadeInOpacity_lXaQm{0%{opacity:0}to{opacity:1}}.papp_Modal-module_backdrop_5PnfC{z-index:1000;position:fixed;inset:0;background:hsl(var(--general-background) / .3);opacity:1;animation-name:papp_Modal-module_fadeInOpacity_lXaQm;animation-iteration-count:1;animation-timing-function:ease-in;animation-duration:.3s}.papp_Modal-module_modal_L5tLT{z-index:1001;position:absolute;inset:0;margin:auto;width:300px;height:fit-content;border-radius:32px;opacity:1;animation-name:papp_Modal-module_fadeInOpacity_lXaQm;animation-iteration-count:1;animation-timing-function:ease-in;animation-duration:.5s;text-rendering:geometricPrecision;background:var(--color-surface-tertiary-inverse);color:var(--color-text-foreground-inverse)}@keyframes papp_QrCode-module_fadeInOpacity_ZCaTW{0%{opacity:0}to{opacity:1}}.papp_QrCode-module_container_L11My{border-radius:34px;animation-name:papp_QrCode-module_fadeInOpacity_ZCaTW;animation-iteration-count:1;animation-timing-function:ease-in;animation-duration:.3s;display:flex;justify-content:center;align-items:center;padding:16px}.papp_QrCode-module_gradientLayer_0Gbcy{position:absolute;inset:0;background:radial-gradient(circle at 50% 50%,rgba(255,255,255,.9) 0%,rgba(255,240,200,.7) 5%,rgba(255,200,150,.4) 10%,transparent 18%),radial-gradient(ellipse at 50% 30%,rgba(255,100,200,.6) 0%,rgba(200,120,255,.5) 15%,rgba(150,100,255,.3) 30%,transparent 50%),radial-gradient(ellipse at 50% 70%,rgba(100,200,255,.5) 0%,rgba(80,150,255,.4) 20%,rgba(60,100,200,.3) 40%,transparent 55%),radial-gradient(circle at 20% 20%,rgba(150,100,255,.5) 0%,rgba(120,80,200,.3) 25%,transparent 45%),radial-gradient(circle at 80% 20%,rgba(100,200,255,.5) 0%,rgba(80,150,200,.3) 25%,transparent 45%),radial-gradient(circle at 20% 80%,rgba(255,150,100,.5) 0%,rgba(200,100,150,.3) 25%,transparent 45%),linear-gradient(135deg,#3c5096e6,#5064b4cc 12%,#6478c8b3 25%,#7864b4b3 37%,#8c50a0b3 50%,#78468cbf 62%,#645078cc 75%,#505a82d9 87%,#3c466ee6)}.papp_QrCode-module_gradient-layer_7agFl:before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 30% 40%,rgba(255,200,100,.3) 0%,rgba(255,150,150,.2) 15%,transparent 30%),radial-gradient(circle at 70% 60%,rgba(100,255,200,.3) 0%,rgba(100,200,255,.2) 15%,transparent 30%),radial-gradient(circle at 50% 80%,rgba(200,100,255,.3) 0%,rgba(150,100,200,.2) 20%,transparent 35%);filter:blur(25px)}.papp_QrCode-module_gradient-layer_7agFl:after{content:"";position:absolute;inset:0;background:radial-gradient(circle at 40% 30%,rgba(255,180,200,.2) 0%,rgba(200,150,255,.15) 20%,transparent 35%),radial-gradient(circle at 60% 70%,rgba(100,220,255,.2) 0%,rgba(150,180,255,.15) 20%,transparent 35%),radial-gradient(ellipse at 80% 50%,rgba(255,150,100,.2) 0%,rgba(255,100,150,.1) 25%,transparent 40%);filter:blur(35px);mix-blend-mode:screen}.papp_Pairing-module_popoverContent_3xnU8{padding:0;border-radius:32px;background:var(--color-surface-tertiary-inverse);color:var(--color-text-foreground-inverse)}.papp_Pairing-module_container_gH7WU{width:350px}.papp_Pairing-module_genericText_zDzqC{font-family:Inter,sans-serif;font-size:24px}.papp_Pairing-module_pairingContainer_R5atH{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px 50px 30px}.papp_Pairing-module_pairingHeader_bpfNW{font-family:Inter,sans-serif;text-align:center;font-size:20px;font-style:normal;font-weight:400;line-height:1.83;letter-spacing:-.573px;margin-bottom:9px;color:var(--color-text-foreground-inverse)}.papp_Pairing-module_scanCallToAction_lOQ-T{font-family:Inter,sans-serif;color:var(--color-text-foreground-inverse, hsl(var(--muted-foreground)));text-align:center;font-size:22px;font-style:normal;font-weight:400;line-height:1.5;margin-bottom:15px}.papp_Pairing-module_pairingDescription_UJE0U{font-family:Inter,sans-serif;width:300px;color:var(--color-text-foreground-inverse, hsl(var(--muted-foreground)));text-align:center;font-size:16px;font-style:normal;font-weight:400;line-height:1.2;margin-top:20px}@keyframes papp_Pairing-module_loader_S62aK{0%{opacity:1}50%{opacity:.5}to{opacity:1}}.papp_Pairing-module_loaderLogo_iHsP9{width:fit-content;height:fit-content;animation:papp_Pairing-module_loader_S62aK 3s linear infinite}.papp_Pairing-module_loaderContainer_cR46U{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:40px;padding:30px;box-sizing:border-box}.papp_Pairing-module_loaderText_beteT{color:var(--color-text-foreground-inverse);text-align:center;font-family:Inter,sans-serif;font-size:22px;line-height:1.5;letter-spacing:-.526px}.papp_Pairing-module_loaderContainerPopover_n1-JJ{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:40px;padding:20px}.papp_Pairing-module_finishedContainer_FtMTm{display:flex;flex-direction:column;align-items:center;height:100%;box-sizing:border-box;padding:40px 70px}.papp_Pairing-module_finishedLogo_jkEDX{display:flex;flex-direction:row;align-items:center;gap:12px}.papp_Pairing-module_finishedLogoSeparator_iRufd{width:1px;height:24px;background:var(--color-text-foreground-inverse, hsl(var(--muted-foreground)))}.papp_Pairing-module_finishedLogoTitle_qKs3e{color:var(--color-text-foreground-inverse);text-align:center;font-family:Inter,sans-serif;font-size:16px;white-space:nowrap;font-style:normal;font-weight:600;line-height:140%;letter-spacing:-.329px}.papp_Pairing-module_finishedWelcome_Zvm-X{margin-top:54px;color:var(--color-text-foreground-inverse, hsl(var(--muted-foreground)));font-family:Inter,sans-serif;font-size:18.39px;font-style:normal;font-weight:400;line-height:27.585px;letter-spacing:1.947px;text-transform:uppercase}.papp_Pairing-module_finishedUsername_RIpsa{color:var(--color-text-foreground-inverse);text-align:center;font-family:Inter,sans-serif;font-size:32.882px;font-style:normal;font-weight:400;line-height:60.185px;letter-spacing:-.593px}.papp_Pairing-module_finishedVoucher_rR0jH{flex-grow:1}.papp_Pairing-module_finishedButton_iuvIR{display:flex;flex-direction:column;width:262px}.papp_Pairing-module_errorContainer_KW5T-{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:12px;height:100%;box-sizing:border-box;padding:40px 30px}.papp_Pairing-module_errorTitle_qokH0{font-family:Inter,sans-serif;text-align:center;font-size:22px;font-style:normal;font-weight:400;line-height:1.83;letter-spacing:-.573px;margin-bottom:9px;color:var(--color-text-foreground-inverse)}.papp_Pairing-module_genericText_zDzqC{font-family:Inter,sans-serif;font-size:24px;color:var(--color-text-foreground-inverse, hsl(var(--muted-foreground)))}.papp_Pairing-module_popoverContainer_fOWoF{width:280px}.papp_Pairing-module_pairingPopoverHeader_PAQot{font-family:Inter,sans-serif;text-align:center;font-size:16px;line-height:1.5;letter-spacing:-.573px;margin-bottom:15px;color:var(--color-text-foreground-inverse)}.papp_Pairing-module_scanCallToActionPopover_Irz-z{font-family:Inter,sans-serif;color:var(--color-text-foreground-inverse, hsl(var(--muted-foreground)));text-align:center;font-size:20px;font-weight:600;line-height:1.2;margin:15px 0 10px}.papp_Pairing-module_pairingDescriptionPopover_z71yj{font-family:Inter,sans-serif;color:var(--color-text-foreground-inverse, hsl(var(--muted-foreground)));text-align:center;font-size:14px;line-height:1.2}.papp_Pairing-module_errorContainerPopover_4mELg{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:15px;padding:50px 20px;min-height:250px}.papp_Pairing-module_pairingPopoverContainer_RvVnH{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px 25px}.papp_Pairing-module_errorTitlePopover_-FPrd{font-family:Inter,sans-serif;text-align:center;font-size:18px;font-style:normal;line-height:1.5;letter-spacing:-.573px;margin-bottom:10px;color:var(--color-text-foreground-inverse)}.papp_Pairing-module_errorGenericText_ZPwQb{font-family:Inter,sans-serif;text-align:center;font-size:16px;font-style:normal;line-height:1.5;letter-spacing:-.573px;margin-bottom:20px;color:var(--color-text-foreground-inverse)}.papp_Pairing-module_retryButton_kWeRx{font-family:Inter,sans-serif;font-size:16px;font-weight:500;padding:10px 24px;border-radius:12px;border:1px solid var(--color-text-foreground-inverse);background:transparent;color:var(--color-text-foreground-inverse);cursor:pointer}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PairingStatus, UserSession } from '@novasamatech/host-papp';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
3
|
export type AuthUIMode = 'popover' | 'modal' | null;
|
|
4
4
|
export declare function withRetry<T>(fn: () => Promise<T>, maxRetries?: number): Promise<T>;
|
|
5
5
|
type Auth = {
|
|
6
6
|
pairingStatus: PairingStatus;
|
|
7
|
-
attestationStatus: AttestationStatus;
|
|
8
7
|
pending: boolean;
|
|
9
8
|
authUIMode: AuthUIMode;
|
|
10
9
|
authenticate(ui?: AuthUIMode): Promise<void>;
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { toastError as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { usePapp as
|
|
5
|
-
function h(t,
|
|
6
|
-
return t().catch((
|
|
7
|
-
if (
|
|
8
|
-
return h(t,
|
|
9
|
-
throw
|
|
1
|
+
import { jsx as v } from "react/jsx-runtime";
|
|
2
|
+
import { toastError as A } from "@novasamatech/tr-ui";
|
|
3
|
+
import { createContext as w, useContext as x, useState as u, useCallback as i, useSyncExternalStore as C, useDebugValue as y } from "react";
|
|
4
|
+
import { usePapp as p } from "../flow/PappProvider.js";
|
|
5
|
+
function h(t, e = 2) {
|
|
6
|
+
return t().catch((r) => {
|
|
7
|
+
if (e > 0)
|
|
8
|
+
return h(t, e - 1);
|
|
9
|
+
throw r;
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
|
-
const
|
|
12
|
+
const l = w({
|
|
13
13
|
pairingStatus: {
|
|
14
14
|
step: "none"
|
|
15
15
|
},
|
|
16
|
-
attestationStatus: {
|
|
17
|
-
step: "none"
|
|
18
|
-
},
|
|
19
16
|
pending: !1,
|
|
20
17
|
authUIMode: null,
|
|
21
18
|
authenticate: () => Promise.resolve(),
|
|
@@ -23,38 +20,34 @@ const S = k({
|
|
|
23
20
|
},
|
|
24
21
|
async disconnect() {
|
|
25
22
|
}
|
|
26
|
-
}),
|
|
27
|
-
const t =
|
|
28
|
-
return
|
|
29
|
-
},
|
|
30
|
-
const t = u(), s = d(t.sso.attestationStatus.subscribe, t.sso.attestationStatus.read);
|
|
31
|
-
return l(`Polkadot app attestation status: ${s.step}`), s;
|
|
32
|
-
}, j = ({
|
|
23
|
+
}), E = () => x(l), I = () => {
|
|
24
|
+
const t = p(), e = C(t.sso.pairingStatus.subscribe, t.sso.pairingStatus.read);
|
|
25
|
+
return y(`Polkadot app pairing status: ${e.step}`), e;
|
|
26
|
+
}, T = ({
|
|
33
27
|
children: t
|
|
34
28
|
}) => {
|
|
35
|
-
const [
|
|
36
|
-
|
|
37
|
-
})), [
|
|
38
|
-
c(null),
|
|
39
|
-
}, [
|
|
40
|
-
|
|
41
|
-
}),
|
|
42
|
-
throw
|
|
29
|
+
const [e, r] = u(!1), [d, c] = u(null), n = p(), m = I(), g = i((s) => (s && c(s), r(!0), new Promise((o, a) => {
|
|
30
|
+
n.sso.authenticate().andTee(() => r(!1)).orTee(() => r(!1)).match(() => o(), a);
|
|
31
|
+
})), [n]), f = i(() => {
|
|
32
|
+
c(null), n.sso.abortAuthentication();
|
|
33
|
+
}, [n]), P = (s) => new Promise((o, a) => {
|
|
34
|
+
n.sessions.disconnect(s).match(o, a);
|
|
35
|
+
}), S = i((s) => h(() => P(s)).catch((o) => {
|
|
36
|
+
throw A({
|
|
43
37
|
title: o.message
|
|
44
38
|
}), o;
|
|
45
|
-
}), [
|
|
46
|
-
pending:
|
|
47
|
-
pairingStatus:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
disconnect: A
|
|
39
|
+
}), [n]), b = {
|
|
40
|
+
pending: e,
|
|
41
|
+
pairingStatus: m,
|
|
42
|
+
authUIMode: d,
|
|
43
|
+
authenticate: g,
|
|
44
|
+
abortAuthentication: f,
|
|
45
|
+
disconnect: S
|
|
53
46
|
};
|
|
54
|
-
return /* @__PURE__ */
|
|
47
|
+
return /* @__PURE__ */ v(l.Provider, { value: b, children: t });
|
|
55
48
|
};
|
|
56
49
|
export {
|
|
57
|
-
|
|
58
|
-
|
|
50
|
+
T as AuthProvider,
|
|
51
|
+
E as useAuthentication,
|
|
59
52
|
h as withRetry
|
|
60
53
|
};
|
|
@@ -3,12 +3,9 @@ export type Translations = {
|
|
|
3
3
|
pairingHeader: string;
|
|
4
4
|
pairingScanCallToAction: string;
|
|
5
5
|
pairingDescription: string;
|
|
6
|
-
pairingLoader: string;
|
|
7
|
-
pairingAttestationError: string;
|
|
8
6
|
pairingRetry: string;
|
|
9
7
|
pairingError: string;
|
|
10
8
|
pairingWelcomeMessage: string;
|
|
11
|
-
pairingLoginMessage: string;
|
|
12
9
|
pairingPopoverWelcome: string;
|
|
13
10
|
pairingPopoverLoginHeading: string;
|
|
14
11
|
pairingPopoverScanDescription: string;
|
|
@@ -1,50 +1,47 @@
|
|
|
1
1
|
import { jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import { c as h } from "react/compiler-runtime";
|
|
3
3
|
import { createContext as m, useContext as f } from "react";
|
|
4
|
-
const
|
|
5
|
-
[
|
|
4
|
+
const g = "en", c = {
|
|
5
|
+
[g]: {
|
|
6
6
|
pairingHeader: "Log in to save",
|
|
7
7
|
pairingScanCallToAction: "Scan it with a phone",
|
|
8
8
|
pairingDescription: "Scanning the QR code opens the Polkadot mobile app, where users are guided step-by-step through the onboarding or setup process.",
|
|
9
|
-
pairingLoader: "Just a second...",
|
|
10
|
-
pairingAttestationError: "Error while passing attestation",
|
|
11
9
|
pairingRetry: "Retry",
|
|
12
10
|
pairingError: "Error while pairing",
|
|
13
11
|
pairingWelcomeMessage: "Welcome back,",
|
|
14
|
-
pairingLoginMessage: "Loggin in",
|
|
15
12
|
pairingPopoverWelcome: "Welcome to Polkadot!",
|
|
16
13
|
pairingPopoverLoginHeading: "Login to explore all Polkadot features",
|
|
17
14
|
pairingPopoverScanDescription: "Scan with your phone camera to log in using the Polkadot mobile app"
|
|
18
15
|
}
|
|
19
16
|
}, u = m({
|
|
20
|
-
language:
|
|
17
|
+
language: g,
|
|
21
18
|
keys: c
|
|
22
|
-
}), v = (
|
|
19
|
+
}), v = (t) => {
|
|
23
20
|
const e = h(8), {
|
|
24
|
-
language:
|
|
25
|
-
keys:
|
|
26
|
-
children:
|
|
27
|
-
} =
|
|
21
|
+
language: p,
|
|
22
|
+
keys: a,
|
|
23
|
+
children: i
|
|
24
|
+
} = t, s = p === void 0 ? g : p;
|
|
28
25
|
let o;
|
|
29
|
-
e[0] !==
|
|
26
|
+
e[0] !== a ? (o = {
|
|
30
27
|
...c,
|
|
31
|
-
...
|
|
32
|
-
}, e[0] =
|
|
33
|
-
let
|
|
34
|
-
e[2] !== s || e[3] !== o ? (
|
|
28
|
+
...a
|
|
29
|
+
}, e[0] = a, e[1] = o) : o = e[1];
|
|
30
|
+
let n;
|
|
31
|
+
e[2] !== s || e[3] !== o ? (n = {
|
|
35
32
|
language: s,
|
|
36
33
|
keys: o
|
|
37
|
-
}, e[2] = s, e[3] = o, e[4] =
|
|
38
|
-
const
|
|
34
|
+
}, e[2] = s, e[3] = o, e[4] = n) : n = e[4];
|
|
35
|
+
const l = n;
|
|
39
36
|
let r;
|
|
40
|
-
return e[5] !==
|
|
41
|
-
},
|
|
42
|
-
const
|
|
37
|
+
return e[5] !== i || e[6] !== l ? (r = /* @__PURE__ */ d(u.Provider, { value: l, children: i }), e[5] = i, e[6] = l, e[7] = r) : r = e[7], r;
|
|
38
|
+
}, x = () => {
|
|
39
|
+
const t = f(u), e = t.keys[t.language];
|
|
43
40
|
if (!e)
|
|
44
|
-
throw new Error(`Papp integration: translation keys for "${
|
|
41
|
+
throw new Error(`Papp integration: translation keys for "${t.language}" not found`);
|
|
45
42
|
return e;
|
|
46
43
|
};
|
|
47
44
|
export {
|
|
48
45
|
v as TranslationProvider,
|
|
49
|
-
|
|
46
|
+
x as useTranslations
|
|
50
47
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novasamatech/host-papp-react-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.7.9-
|
|
4
|
+
"version": "0.7.9-4",
|
|
5
5
|
"description": "Polkadot app UI Flow",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"react-dom": ">=18"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@novasamatech/host-papp": "0.7.9-
|
|
34
|
-
"@novasamatech/statement-store": "0.7.9-
|
|
33
|
+
"@novasamatech/host-papp": "0.7.9-4",
|
|
34
|
+
"@novasamatech/statement-store": "0.7.9-4",
|
|
35
35
|
"@polkadot-api/utils": "^0.4.0",
|
|
36
36
|
"@radix-ui/react-dialog": "1.1.15",
|
|
37
37
|
"@radix-ui/react-popover": "1.1.15",
|