@logora/debate 0.3.118 → 0.4.0
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/assets/components/dialog/dropdown/Dropdown.module-BmT3rAwz.css +1 -0
- package/dist/components/auth/auth_initializer/AuthInitializer.js +64 -43
- package/dist/components/auth/use_auth/useAuthActions.js +12 -12
- package/dist/components/dialog/dropdown/Dropdown.js +19 -17
- package/dist/components/dialog/dropdown/Dropdown.module.scss.js +17 -13
- package/dist/components/user/update_user_info_modal/UpdateUserInfoModal.js +124 -111
- package/dist/components/user_content/content_footer/ContentFooter.js +15 -14
- package/package.json +1 -1
- package/dist/assets/components/dialog/dropdown/Dropdown.module-FG2Sqrqs.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._dropdownWrapper_7839n_3{position:relative;display:inline-block}._dropdownHeader_7839n_8{border:none;padding:0!important;cursor:pointer;background-color:var(--background-color-primary, white)}._dropdownHeader_7839n_8:focus:not(:focus-visible){outline:none;box-shadow:none}._dropdownList_7839n_19{position:absolute;z-index:3;background:var(--background-color-primary, white);box-shadow:var(--box-shadow, 0px 2px 5px rgba(7, 42, 68, .1));border:var(--box-border, 1px solid rgba(7, 42, 68, .1));border-radius:var(--box-border-radius, 6px);overscroll-behavior-y:contain;width:max-content}._bottom_7839n_30{top:calc(100% + 2px)}._top_7839n_34{bottom:calc(100% + 2px)}._left_7839n_38{left:0!important}._right_7839n_42{right:0!important}._center_7839n_46{left:50%;transform:translate(-50%)}
|
|
@@ -1,52 +1,73 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
),
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import { jsx as d, Fragment as q } from "react/jsx-runtime";
|
|
2
|
+
import { useState as E, useEffect as f } from "react";
|
|
3
|
+
import { useConfig as _ } from "../../data/config_provider/useConfig.js";
|
|
4
|
+
import { useAuthInterceptor as J } from "../use_auth/useAuthInterceptor.js";
|
|
5
|
+
import { authTokenHandler as S } from "../use_auth/authTokenHandler.js";
|
|
6
|
+
import { useAuthActions as T } from "../use_auth/useAuthActions.js";
|
|
7
|
+
import { useAuthRequired as W } from "../../hooks/use_auth_required/useAuthRequired.js";
|
|
8
|
+
import { useAuth as y } from "../use_auth/useAuth.js";
|
|
9
|
+
import { AuthProviderFactory as z } from "../providers/AuthProviderFactory.js";
|
|
10
|
+
import { UpdateUserInfoModal as L } from "../../user/update_user_info_modal/UpdateUserInfoModal.js";
|
|
11
|
+
import { httpClient as a } from "../../data/axios_client/httpClient.js";
|
|
12
|
+
const N = ({ authUrl: s, authType: r, provider: g, assertion: p }) => {
|
|
13
|
+
const i = "logora_user_token", e = _();
|
|
14
|
+
J(a, s, i);
|
|
15
|
+
const [w, u] = E(!1), { getToken: A, removeToken: v } = S(
|
|
16
|
+
a,
|
|
17
|
+
s,
|
|
18
|
+
i
|
|
19
|
+
), { loginUser: c, logoutUser: C, fetchUser: P } = T(
|
|
20
|
+
a,
|
|
21
|
+
s,
|
|
22
|
+
i
|
|
23
|
+
), U = W(), { setIsLoggingIn: k } = y();
|
|
24
|
+
f(() => {
|
|
25
|
+
I();
|
|
26
|
+
}, []);
|
|
27
|
+
const h = (o) => {
|
|
28
|
+
r !== "social" && r !== "oauth2_server" && e.auth?.showOnboarding === !0 ? u(!0) : U(o);
|
|
29
|
+
};
|
|
30
|
+
f(() => {
|
|
23
31
|
if (typeof window < "u")
|
|
24
|
-
return window.addEventListener(
|
|
25
|
-
"logora:authentication:require",
|
|
26
|
-
i
|
|
27
|
-
), () => {
|
|
28
|
-
window.removeEventListener(
|
|
29
|
-
"logora:authentication:require",
|
|
30
|
-
i
|
|
31
|
-
);
|
|
32
|
+
return window.addEventListener("logora:authentication:require", h), () => {
|
|
33
|
+
window.removeEventListener("logora:authentication:require", h);
|
|
32
34
|
};
|
|
33
35
|
}, []);
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
+
const I = () => {
|
|
37
|
+
const o = l(), t = A();
|
|
36
38
|
if (t) {
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
+
const n = t.session_id;
|
|
40
|
+
o.isSameUser(n) ? P() : (v(), m(o));
|
|
39
41
|
} else
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
if (
|
|
43
|
-
const t =
|
|
44
|
-
|
|
42
|
+
m(o);
|
|
43
|
+
}, m = (o) => {
|
|
44
|
+
if (o.shouldInitAuth()) {
|
|
45
|
+
const t = o.getAuthorizationParams();
|
|
46
|
+
if (t) {
|
|
47
|
+
if (r !== "social" && r !== "oauth2_server" && e.auth?.showOnboarding === !0) {
|
|
48
|
+
k(!1);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
c(t);
|
|
52
|
+
}
|
|
45
53
|
} else
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
|
|
54
|
+
C();
|
|
55
|
+
}, b = (o) => {
|
|
56
|
+
const n = l().getAuthorizationParams();
|
|
57
|
+
c({ ...n, ...o }), u(!1);
|
|
58
|
+
}, l = () => z.create(r, g, p);
|
|
59
|
+
return /* @__PURE__ */ d(q, { children: w && /* @__PURE__ */ d(
|
|
60
|
+
L,
|
|
61
|
+
{
|
|
62
|
+
pendingAuth: !0,
|
|
63
|
+
onConsentConfirmed: b,
|
|
64
|
+
showTerms: e.auth?.hideCgu !== !0,
|
|
65
|
+
showEmailConsent: e.auth?.showEmailConsent,
|
|
66
|
+
termsUrl: e.provider?.cguUrl || "https://www.logora.com/blog-posts/cgu",
|
|
67
|
+
privacyUrl: e.provider?.privacyUrl || "https://www.logora.com/blog-posts/privacy-policy"
|
|
68
|
+
}
|
|
69
|
+
) });
|
|
49
70
|
};
|
|
50
71
|
export {
|
|
51
|
-
|
|
72
|
+
N as AuthInitializer
|
|
52
73
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { authTokenHandler as
|
|
1
|
+
import { authTokenHandler as E } from "./authTokenHandler.js";
|
|
2
2
|
import { useAuth as w } from "./useAuth.js";
|
|
3
3
|
import { useDataProvider as v } from "../../data/data_provider/useDataProvider.js";
|
|
4
|
-
const
|
|
5
|
-
const { removeToken: a, fetchToken: d } =
|
|
6
|
-
|
|
4
|
+
const A = "logora:emailConsent", L = (c, u, f) => {
|
|
5
|
+
const { removeToken: a, fetchToken: d } = E(
|
|
6
|
+
c,
|
|
7
7
|
u,
|
|
8
8
|
f
|
|
9
9
|
), { setCurrentUser: n, setIsLoggedIn: s, setIsLoggingIn: t, setAuthError: r } = w(), l = v(), h = (e) => {
|
|
@@ -12,23 +12,23 @@ const I = "logora:emailConsent", L = (i, u, f) => {
|
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
d(e).then((o) => {
|
|
15
|
-
|
|
15
|
+
i();
|
|
16
16
|
}).catch((o) => {
|
|
17
17
|
r(o);
|
|
18
18
|
});
|
|
19
19
|
}, g = () => {
|
|
20
|
-
s(!1), t(!1), n({}), a(),
|
|
21
|
-
},
|
|
20
|
+
s(!1), t(!1), n({}), a(), sessionStorage.removeItem(A), p();
|
|
21
|
+
}, i = () => {
|
|
22
22
|
l.getOneWithToken("me", "").then((e) => {
|
|
23
23
|
if (e.data.success) {
|
|
24
24
|
const o = e.data.data.resource;
|
|
25
|
-
n(o), s(!0), t(!1),
|
|
25
|
+
n(o), s(!0), t(!1), m(o);
|
|
26
26
|
} else
|
|
27
27
|
r(!0), s(!1), t(!1), n({}), a();
|
|
28
28
|
}).catch((e) => {
|
|
29
29
|
r(!0), s(!1), t(!1), n({}), a();
|
|
30
30
|
});
|
|
31
|
-
},
|
|
31
|
+
}, m = (e) => {
|
|
32
32
|
typeof window < "u" && window.dispatchEvent(
|
|
33
33
|
new CustomEvent("logora:authentication:success", {
|
|
34
34
|
detail: {
|
|
@@ -36,16 +36,16 @@ const I = "logora:emailConsent", L = (i, u, f) => {
|
|
|
36
36
|
}
|
|
37
37
|
})
|
|
38
38
|
);
|
|
39
|
-
},
|
|
39
|
+
}, p = () => {
|
|
40
40
|
typeof window < "u" && window.dispatchEvent(new CustomEvent("logora:authentication:logout"));
|
|
41
41
|
};
|
|
42
42
|
return {
|
|
43
43
|
loginUser: h,
|
|
44
44
|
logoutUser: g,
|
|
45
|
-
fetchUser:
|
|
45
|
+
fetchUser: i
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
48
|
export {
|
|
49
|
-
|
|
49
|
+
A as EMAIL_CONSENT_STORAGE_KEY,
|
|
50
50
|
L as useAuthActions
|
|
51
51
|
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { useState as
|
|
1
|
+
import { jsxs as g, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import m from "classnames";
|
|
3
|
+
import { useState as x, useRef as b, useEffect as E } from "react";
|
|
4
4
|
import t from "./Dropdown.module.scss.js";
|
|
5
|
-
const
|
|
5
|
+
const y = ({
|
|
6
6
|
onClick: s,
|
|
7
|
-
horizontalPosition:
|
|
7
|
+
horizontalPosition: d = "left",
|
|
8
|
+
verticalPosition: c = "bottom",
|
|
8
9
|
disabled: l = !1,
|
|
9
|
-
closeOnContentClick:
|
|
10
|
-
className:
|
|
10
|
+
closeOnContentClick: p = !1,
|
|
11
|
+
className: f,
|
|
11
12
|
dropdownClassName: a,
|
|
12
|
-
children:
|
|
13
|
+
children: u
|
|
13
14
|
}) => {
|
|
14
|
-
const [r, o] =
|
|
15
|
+
const [r, o] = x(!1), n = b(null), w = () => {
|
|
15
16
|
l || (s && s(), o(!r));
|
|
16
17
|
};
|
|
17
18
|
return E(() => {
|
|
@@ -19,11 +20,11 @@ const k = ({
|
|
|
19
20
|
n.current && !n.current.contains(v.target) && o(!1);
|
|
20
21
|
};
|
|
21
22
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
22
|
-
}, []), /* @__PURE__ */
|
|
23
|
+
}, []), /* @__PURE__ */ g(
|
|
23
24
|
"div",
|
|
24
25
|
{
|
|
25
26
|
ref: n,
|
|
26
|
-
className:
|
|
27
|
+
className: m(t.dropdownWrapper, { [f]: f }),
|
|
27
28
|
children: [
|
|
28
29
|
/* @__PURE__ */ i(
|
|
29
30
|
"button",
|
|
@@ -31,20 +32,21 @@ const k = ({
|
|
|
31
32
|
type: "button",
|
|
32
33
|
"aria-expanded": r,
|
|
33
34
|
className: t.dropdownHeader,
|
|
34
|
-
onClick:
|
|
35
|
-
children:
|
|
35
|
+
onClick: w,
|
|
36
|
+
children: u[0]
|
|
36
37
|
}
|
|
37
38
|
),
|
|
38
39
|
r && /* @__PURE__ */ i(
|
|
39
40
|
"div",
|
|
40
41
|
{
|
|
41
|
-
className: a ||
|
|
42
|
+
className: a || m(t.dropdownList, {
|
|
43
|
+
[t[d]]: d,
|
|
42
44
|
[t[c]]: c
|
|
43
45
|
}),
|
|
44
46
|
onClick: (e) => {
|
|
45
|
-
(
|
|
47
|
+
(p || e.target === e.currentTarget) && o(!1);
|
|
46
48
|
},
|
|
47
|
-
children:
|
|
49
|
+
children: u[1]
|
|
48
50
|
}
|
|
49
51
|
)
|
|
50
52
|
]
|
|
@@ -52,5 +54,5 @@ const k = ({
|
|
|
52
54
|
);
|
|
53
55
|
};
|
|
54
56
|
export {
|
|
55
|
-
|
|
57
|
+
y as Dropdown
|
|
56
58
|
};
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import '../../../assets/components/dialog/dropdown/Dropdown.module-
|
|
2
|
-
dropdownWrapper:
|
|
3
|
-
dropdownHeader:
|
|
4
|
-
dropdownList:
|
|
5
|
-
|
|
1
|
+
import '../../../assets/components/dialog/dropdown/Dropdown.module-BmT3rAwz.css';const o = "_dropdownWrapper_7839n_3", t = "_dropdownHeader_7839n_8", n = "_dropdownList_7839n_19", r = "_bottom_7839n_30", _ = "_top_7839n_34", d = "_left_7839n_38", e = "_right_7839n_42", p = "_center_7839n_46", s = {
|
|
2
|
+
dropdownWrapper: o,
|
|
3
|
+
dropdownHeader: t,
|
|
4
|
+
dropdownList: n,
|
|
5
|
+
bottom: r,
|
|
6
|
+
top: _,
|
|
7
|
+
left: d,
|
|
6
8
|
right: e,
|
|
7
|
-
center:
|
|
9
|
+
center: p
|
|
8
10
|
};
|
|
9
11
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
r as bottom,
|
|
13
|
+
p as center,
|
|
14
|
+
s as default,
|
|
15
|
+
t as dropdownHeader,
|
|
16
|
+
n as dropdownList,
|
|
17
|
+
o as dropdownWrapper,
|
|
18
|
+
d as left,
|
|
19
|
+
e as right,
|
|
20
|
+
_ as top
|
|
17
21
|
};
|
|
@@ -1,225 +1,238 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useIntl as
|
|
1
|
+
import { jsx as a, jsxs as d, Fragment as S } from "react/jsx-runtime";
|
|
2
|
+
import { useState as l } from "react";
|
|
3
|
+
import { useIntl as ee, FormattedMessage as ae } from "react-intl";
|
|
4
4
|
import t from "./UpdateUserInfoModal.module.scss.js";
|
|
5
|
-
import { useAuth as
|
|
6
|
-
import { useDataProvider as
|
|
7
|
-
import { useConfig as
|
|
8
|
-
import { useResponsive as
|
|
9
|
-
import { useFormValidation as
|
|
10
|
-
import { useModal as
|
|
5
|
+
import { useAuth as te } from "../../auth/use_auth/useAuth.js";
|
|
6
|
+
import { useDataProvider as se } from "../../data/data_provider/useDataProvider.js";
|
|
7
|
+
import { useConfig as re } from "../../data/config_provider/useConfig.js";
|
|
8
|
+
import { useResponsive as ie } from "../../hooks/use_responsive/useResponsive.js";
|
|
9
|
+
import { useFormValidation as le } from "../../forms/use_form_validation/useFormValidation.js";
|
|
10
|
+
import { useModal as oe } from "../../dialog/modal/useModal.js";
|
|
11
11
|
import { Modal as ne } from "../../dialog/modal/Modal.js";
|
|
12
|
-
import { Loader as
|
|
13
|
-
import { Icon as oe } from "../../icons/icon/Icon.js";
|
|
14
|
-
import { Button as I } from "../../action/button/Button.js";
|
|
15
|
-
import { TextInput as A } from "../../input/text_input/TextInput.js";
|
|
16
|
-
import { Select as de } from "../../input/select/Select.js";
|
|
17
|
-
import { Toggle as S } from "../../input/toggle/Toggle.js";
|
|
12
|
+
import { Loader as de } from "../../progress/loader/Loader.js";
|
|
18
13
|
import { AvatarSelector as ce } from "../avatar_selector/AvatarSelector.js";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
import { Icon as me } from "../../icons/icon/Icon.js";
|
|
15
|
+
import { Button as D } from "../../action/button/Button.js";
|
|
16
|
+
import { TextInput as O } from "../../input/text_input/TextInput.js";
|
|
17
|
+
import { Select as ue } from "../../input/select/Select.js";
|
|
18
|
+
import { Toggle as F } from "../../input/toggle/Toggle.js";
|
|
19
|
+
const De = ({
|
|
20
|
+
termsUrl: L,
|
|
21
|
+
privacyUrl: B,
|
|
22
|
+
showEmailConsent: v = !1,
|
|
23
|
+
showTerms: h = !1,
|
|
24
|
+
pendingAuth: n = !1,
|
|
25
|
+
onConsentConfirmed: y = null
|
|
24
26
|
}) => {
|
|
25
|
-
const
|
|
26
|
-
(e) => `${
|
|
27
|
-
), [
|
|
28
|
-
|
|
29
|
-
), [
|
|
30
|
-
|
|
31
|
-
), [
|
|
27
|
+
const o = te(), A = se(), r = ee(), i = re(), $ = [...Array(i.avatars?.maxFileName || 0).keys()].map(
|
|
28
|
+
(e) => `${i.avatars?.baseUrl}/${e + 1}.${i.avatars?.fileExtension}`
|
|
29
|
+
), [m, j] = l(o.currentUser.first_name || ""), [b, R] = l(
|
|
30
|
+
o.currentUser.description || ""
|
|
31
|
+
), [u, q] = l(o.currentUser.last_name || ""), [M, z] = l(o.currentUser.language), [E, N] = l(!1), [x, C] = l(
|
|
32
|
+
o.currentUser.image_url
|
|
33
|
+
), [f, T] = l(null), [k, P] = l(!1), [V, W] = l(!1), { isMobile: I } = ie(), { errors: c, validate: G } = le(), { hideModal: w } = oe(), [p, H] = l(!1), [_, J] = l(!1), K = (e) => {
|
|
32
34
|
const s = new FileReader();
|
|
33
35
|
s.onloadend = () => {
|
|
34
|
-
|
|
36
|
+
C(s.result);
|
|
35
37
|
}, s.readAsDataURL(e);
|
|
36
|
-
},
|
|
38
|
+
}, Q = [
|
|
37
39
|
{ first_name: ["required", null] },
|
|
38
40
|
{ first_name: ["minChar", 2] },
|
|
39
41
|
{ last_name: ["required", null] },
|
|
40
42
|
{ last_name: ["minChar", 2] },
|
|
41
|
-
{ language: ["required", null] },
|
|
42
|
-
...
|
|
43
|
-
],
|
|
43
|
+
...n ? [] : [{ language: ["required", null] }],
|
|
44
|
+
...h ? [{ accepts_terms: ["enforceValue", !0] }] : []
|
|
45
|
+
], X = (e) => {
|
|
44
46
|
e.preventDefault();
|
|
45
47
|
const s = {};
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
if (m && (s.first_name = m), u && (s.last_name = u), M && (s.language = M), f && k && (s.image = f), f && !k && (s.origin_image_url = f), b && (s.description = b), v && (s.accepts_provider_email = _), h && (s.accepts_terms = p), s.is_onboarded = !0, G(s, Q))
|
|
49
|
+
if (W(!0), n && y)
|
|
50
|
+
y({
|
|
51
|
+
first_name: m,
|
|
52
|
+
last_name: u,
|
|
53
|
+
accepts_terms: p,
|
|
54
|
+
accepts_provider_email: v ? _ : !1,
|
|
55
|
+
is_onboarded: !0
|
|
56
|
+
});
|
|
57
|
+
else {
|
|
58
|
+
const U = new FormData();
|
|
59
|
+
Object.entries(s).forEach(([g, Z]) => {
|
|
60
|
+
U.append(g, Z);
|
|
61
|
+
}), A.update("users", o.currentUser.slug, U).then((g) => {
|
|
62
|
+
g.data.success && o.setCurrentUser(g.data.data.resource), w();
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}, Y = (e) => {
|
|
56
66
|
const s = /^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i;
|
|
57
|
-
|
|
67
|
+
T(e), N(!1), s.test(e) ? (C(e), P(!1)) : (P(!0), K(e));
|
|
58
68
|
};
|
|
59
69
|
return /* @__PURE__ */ a(
|
|
60
70
|
ne,
|
|
61
71
|
{
|
|
62
72
|
"data-vid": "update_user_info_modal",
|
|
63
|
-
title:
|
|
73
|
+
title: n ? r.formatMessage({
|
|
74
|
+
id: "modal.update_user_info_modal.complete_registration",
|
|
75
|
+
defaultMessage: "Complete your registration"
|
|
76
|
+
}) : r.formatMessage({
|
|
64
77
|
id: "modal.update_user_info_modal.modal_title",
|
|
65
78
|
defaultMessage: "Update your profile"
|
|
66
79
|
}),
|
|
67
80
|
style: {
|
|
68
|
-
width:
|
|
69
|
-
minWidth:
|
|
81
|
+
width: I ? "unset" : "max-content",
|
|
82
|
+
minWidth: I ? "unset" : "500px",
|
|
70
83
|
maxWidth: "800px"
|
|
71
84
|
},
|
|
72
85
|
showCloseButton: !1,
|
|
73
86
|
disableClickOutside: !0,
|
|
74
|
-
children:
|
|
87
|
+
children: V ? /* @__PURE__ */ a(de, {}) : E && !n ? /* @__PURE__ */ d(S, { children: [
|
|
75
88
|
/* @__PURE__ */ a(
|
|
76
89
|
ce,
|
|
77
90
|
{
|
|
78
|
-
onChooseAvatar:
|
|
79
|
-
avatarUrlList:
|
|
80
|
-
userName:
|
|
81
|
-
allowUserImage:
|
|
91
|
+
onChooseAvatar: Y,
|
|
92
|
+
avatarUrlList: $,
|
|
93
|
+
userName: o.currentUser.full_name,
|
|
94
|
+
allowUserImage: i.avatars?.allowUserImage
|
|
82
95
|
}
|
|
83
96
|
),
|
|
84
97
|
/* @__PURE__ */ a(
|
|
85
98
|
"div",
|
|
86
99
|
{
|
|
87
100
|
className: t.backButton,
|
|
88
|
-
onClick: () =>
|
|
89
|
-
children:
|
|
101
|
+
onClick: () => N(!1),
|
|
102
|
+
children: r.formatMessage({
|
|
90
103
|
id: "user.user_edit.back",
|
|
91
104
|
defaultMessage: "Back"
|
|
92
105
|
})
|
|
93
106
|
}
|
|
94
107
|
)
|
|
95
|
-
] }) : /* @__PURE__ */
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
|
|
108
|
+
] }) : /* @__PURE__ */ d(S, { children: [
|
|
109
|
+
/* @__PURE__ */ d("div", { className: t.container, children: [
|
|
110
|
+
/* @__PURE__ */ d("div", { className: t.userImageContainer, children: [
|
|
111
|
+
x ? /* @__PURE__ */ a(
|
|
99
112
|
"img",
|
|
100
113
|
{
|
|
101
114
|
className: t.userPictureUpload,
|
|
102
|
-
src:
|
|
103
|
-
alt:
|
|
115
|
+
src: x,
|
|
116
|
+
alt: r.formatMessage({
|
|
104
117
|
id: "alt.my_profile_picture",
|
|
105
118
|
defaultMessage: "Ma photo de profil"
|
|
106
119
|
})
|
|
107
120
|
}
|
|
108
121
|
) : /* @__PURE__ */ a("div", { className: t.userPictureUpload, children: /* @__PURE__ */ a(
|
|
109
|
-
|
|
122
|
+
me,
|
|
110
123
|
{
|
|
111
124
|
name: "camera",
|
|
112
125
|
height: 20,
|
|
113
126
|
width: 20,
|
|
114
|
-
alt:
|
|
127
|
+
alt: r.formatMessage({
|
|
115
128
|
id: "user.user_edit.profile_picture",
|
|
116
129
|
defaultMessage: "Profile picture"
|
|
117
130
|
})
|
|
118
131
|
}
|
|
119
132
|
) }),
|
|
120
|
-
/* @__PURE__ */ a(
|
|
121
|
-
|
|
133
|
+
!n && /* @__PURE__ */ a(
|
|
134
|
+
D,
|
|
122
135
|
{
|
|
123
136
|
"data-testid": "avatar-button",
|
|
124
137
|
"data-tid": "action_save_profile",
|
|
125
|
-
onClick: () =>
|
|
138
|
+
onClick: () => N(!0),
|
|
126
139
|
style: { whiteSpace: "nowrap" },
|
|
127
|
-
children:
|
|
140
|
+
children: r.formatMessage({
|
|
128
141
|
id: "user.user_edit.avatar",
|
|
129
142
|
defaultMessage: "Select an avatar"
|
|
130
143
|
})
|
|
131
144
|
}
|
|
132
145
|
)
|
|
133
146
|
] }),
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ d("div", { className: t.inputsContainer, children: [
|
|
148
|
+
/* @__PURE__ */ d("div", { className: t.nameContainer, children: [
|
|
136
149
|
/* @__PURE__ */ a("div", { className: t.updateProfileInput, children: /* @__PURE__ */ a(
|
|
137
|
-
|
|
150
|
+
O,
|
|
138
151
|
{
|
|
139
152
|
type: "text",
|
|
140
153
|
name: "first_name",
|
|
141
|
-
"aria-label":
|
|
154
|
+
"aria-label": r.formatMessage({
|
|
142
155
|
id: "auth.signup_form.first_name.aria_label",
|
|
143
156
|
defaultMessage: "First name"
|
|
144
157
|
}),
|
|
145
|
-
placeholder:
|
|
158
|
+
placeholder: r.formatMessage({
|
|
146
159
|
id: "auth_signup_form_first_name_placeholder",
|
|
147
160
|
defaultMessage: "First name"
|
|
148
161
|
}),
|
|
149
|
-
onChange: (e) =>
|
|
150
|
-
value:
|
|
151
|
-
error: !!
|
|
152
|
-
message:
|
|
162
|
+
onChange: (e) => i.actions?.disableOnboardingNameUpdate === !0 ? null : j(e.target.value),
|
|
163
|
+
value: m,
|
|
164
|
+
error: !!c.first_name,
|
|
165
|
+
message: c.first_name,
|
|
153
166
|
"data-testid": "first-name",
|
|
154
|
-
disabled:
|
|
167
|
+
disabled: i.actions?.disableOnboardingNameUpdate === !0
|
|
155
168
|
}
|
|
156
169
|
) }),
|
|
157
170
|
/* @__PURE__ */ a("div", { className: t.updateProfileInput, children: /* @__PURE__ */ a(
|
|
158
|
-
|
|
171
|
+
O,
|
|
159
172
|
{
|
|
160
173
|
type: "text",
|
|
161
174
|
name: "last_name",
|
|
162
|
-
"aria-label":
|
|
175
|
+
"aria-label": r.formatMessage({
|
|
163
176
|
id: "auth.signup_form.last_name.aria_label",
|
|
164
177
|
defaultMessage: "Last name"
|
|
165
178
|
}),
|
|
166
|
-
placeholder:
|
|
179
|
+
placeholder: r.formatMessage({
|
|
167
180
|
id: "auth_signup_form_last_name_placeholder",
|
|
168
181
|
defaultMessage: "Last name"
|
|
169
182
|
}),
|
|
170
|
-
onChange: (e) =>
|
|
171
|
-
value:
|
|
172
|
-
error: !!
|
|
173
|
-
message:
|
|
183
|
+
onChange: (e) => i.actions?.disableOnboardingNameUpdate === !0 ? null : q(e.target.value),
|
|
184
|
+
value: u,
|
|
185
|
+
error: !!c.last_name,
|
|
186
|
+
message: c.last_name,
|
|
174
187
|
"data-testid": "last-name",
|
|
175
|
-
disabled:
|
|
188
|
+
disabled: i.actions?.disableOnboardingNameUpdate === !0
|
|
176
189
|
}
|
|
177
190
|
) })
|
|
178
191
|
] }),
|
|
179
|
-
|
|
192
|
+
i.actions?.disableNameUpdate == !0 && i.actions?.disableOnboardingNameUpdate != !0 && /* @__PURE__ */ a("div", { className: t.hint, children: r.formatMessage({
|
|
180
193
|
id: "user.user_edit.user_name_hint",
|
|
181
194
|
defaultMessage: "last name"
|
|
182
195
|
}) }),
|
|
183
|
-
|
|
184
|
-
|
|
196
|
+
!n && i.translation?.translationMethods && Object.keys(i.translation.translationMethods).length > 0 && /* @__PURE__ */ a(
|
|
197
|
+
ue,
|
|
185
198
|
{
|
|
186
199
|
selectClassName: t.langSelect,
|
|
187
200
|
options: Object.keys(
|
|
188
|
-
|
|
201
|
+
i.translation.translationMethods
|
|
189
202
|
).map((e) => ({
|
|
190
203
|
name: e,
|
|
191
204
|
value: e,
|
|
192
205
|
text: `${e.toUpperCase()}`
|
|
193
206
|
})),
|
|
194
|
-
defaultOption:
|
|
195
|
-
onChange: (e) =>
|
|
207
|
+
defaultOption: M,
|
|
208
|
+
onChange: (e) => z(e.value)
|
|
196
209
|
}
|
|
197
210
|
),
|
|
198
|
-
/* @__PURE__ */ a("div", { className: t.userDescription, children: /* @__PURE__ */ a(
|
|
211
|
+
!n && /* @__PURE__ */ a("div", { className: t.userDescription, children: /* @__PURE__ */ a(
|
|
199
212
|
"textarea",
|
|
200
213
|
{
|
|
201
214
|
className: t.textArea,
|
|
202
|
-
placeholder:
|
|
215
|
+
placeholder: r.formatMessage({
|
|
203
216
|
id: "user.user_edit.user_description",
|
|
204
217
|
defaultMessage: "Describe yourself in a few words"
|
|
205
218
|
}),
|
|
206
|
-
value:
|
|
207
|
-
onChange: (e) =>
|
|
219
|
+
value: b,
|
|
220
|
+
onChange: (e) => R(e.target.value),
|
|
208
221
|
maxLength: 500,
|
|
209
222
|
"data-testid": "description"
|
|
210
223
|
}
|
|
211
224
|
) })
|
|
212
225
|
] })
|
|
213
226
|
] }),
|
|
214
|
-
|
|
215
|
-
|
|
227
|
+
h && /* @__PURE__ */ a("div", { className: t.toggle, children: /* @__PURE__ */ a(
|
|
228
|
+
F,
|
|
216
229
|
{
|
|
217
230
|
type: "checkbox",
|
|
218
231
|
name: "accepts_terms",
|
|
219
232
|
style: { fontSize: 18 },
|
|
220
|
-
checked:
|
|
233
|
+
checked: p,
|
|
221
234
|
label: /* @__PURE__ */ a(
|
|
222
|
-
|
|
235
|
+
ae,
|
|
223
236
|
{
|
|
224
237
|
id: "modal.update_user_info_modal.accepts_terms",
|
|
225
238
|
defaultMessage: "I declare I have read the <var1>General Conditions of Use</var1> and the <var2>Privacy policy</var2> of the debate space and accept them.",
|
|
@@ -229,7 +242,7 @@ const Ie = ({
|
|
|
229
242
|
{
|
|
230
243
|
className: t.cgu,
|
|
231
244
|
target: "_blank",
|
|
232
|
-
href:
|
|
245
|
+
href: L,
|
|
233
246
|
rel: "noreferrer",
|
|
234
247
|
children: e
|
|
235
248
|
}
|
|
@@ -239,7 +252,7 @@ const Ie = ({
|
|
|
239
252
|
{
|
|
240
253
|
className: t.cgu,
|
|
241
254
|
target: "_blank",
|
|
242
|
-
href:
|
|
255
|
+
href: B,
|
|
243
256
|
rel: "noreferrer",
|
|
244
257
|
children: e
|
|
245
258
|
}
|
|
@@ -247,36 +260,36 @@ const Ie = ({
|
|
|
247
260
|
}
|
|
248
261
|
}
|
|
249
262
|
),
|
|
250
|
-
onInputChanged: (e) =>
|
|
251
|
-
message:
|
|
263
|
+
onInputChanged: (e) => H(!p),
|
|
264
|
+
message: c.accepts_terms,
|
|
252
265
|
"data-testid": "accepts-terms-input"
|
|
253
266
|
}
|
|
254
267
|
) }),
|
|
255
|
-
|
|
256
|
-
|
|
268
|
+
v && /* @__PURE__ */ a("div", { className: t.toggle, children: /* @__PURE__ */ a(
|
|
269
|
+
F,
|
|
257
270
|
{
|
|
258
271
|
type: "checkbox",
|
|
259
272
|
name: "accepts_provider_email",
|
|
260
273
|
style: { fontSize: 18 },
|
|
261
|
-
checked:
|
|
262
|
-
label:
|
|
274
|
+
checked: _,
|
|
275
|
+
label: r.formatMessage(
|
|
263
276
|
{
|
|
264
277
|
id: "modal.update_user_info_modal.consent_label",
|
|
265
278
|
defaultMessage: "I agree to receive emails from the editor"
|
|
266
279
|
},
|
|
267
|
-
{ provider:
|
|
280
|
+
{ provider: i.provider?.companyName }
|
|
268
281
|
),
|
|
269
|
-
onInputChanged: (e) =>
|
|
282
|
+
onInputChanged: (e) => J(!_),
|
|
270
283
|
"data-testid": "accepts-email-input"
|
|
271
284
|
}
|
|
272
285
|
) }),
|
|
273
286
|
/* @__PURE__ */ a("div", { className: t.userSaveBox, children: /* @__PURE__ */ a(
|
|
274
|
-
|
|
287
|
+
D,
|
|
275
288
|
{
|
|
276
289
|
"data-testid": "save-button",
|
|
277
290
|
"data-tid": "action_save_profile",
|
|
278
|
-
onClick: (e) =>
|
|
279
|
-
children:
|
|
291
|
+
onClick: (e) => X(e),
|
|
292
|
+
children: r.formatMessage({
|
|
280
293
|
id: "user.user_edit.save",
|
|
281
294
|
defaultMessage: "Save"
|
|
282
295
|
})
|
|
@@ -287,5 +300,5 @@ const Ie = ({
|
|
|
287
300
|
);
|
|
288
301
|
};
|
|
289
302
|
export {
|
|
290
|
-
|
|
303
|
+
De as UpdateUserInfoModal
|
|
291
304
|
};
|
|
@@ -14,7 +14,7 @@ import { Link as nt } from "../../action/link/Link.js";
|
|
|
14
14
|
import { Icon as l } from "../../icons/icon/Icon.js";
|
|
15
15
|
import { ShareButton as ot } from "../../share/share_button/ShareButton.js";
|
|
16
16
|
import { Dropdown as at } from "../../dialog/dropdown/Dropdown.js";
|
|
17
|
-
const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ default: n.ShareModal }))),
|
|
17
|
+
const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ default: n.ShareModal }))), Dt = ({
|
|
18
18
|
resource: n,
|
|
19
19
|
reportType: I,
|
|
20
20
|
deleteType: k,
|
|
@@ -36,9 +36,9 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
36
36
|
showShareText: T,
|
|
37
37
|
enableEdition: j = !0,
|
|
38
38
|
enableDeletion: F = !0,
|
|
39
|
-
enableReport:
|
|
40
|
-
containerClassName:
|
|
41
|
-
voteActionClassName:
|
|
39
|
+
enableReport: P = !0,
|
|
40
|
+
containerClassName: B,
|
|
41
|
+
voteActionClassName: L,
|
|
42
42
|
replyRedirectUrl: g
|
|
43
43
|
}) => {
|
|
44
44
|
const o = Q(), y = V(), { currentUser: d } = X(), { showModal: U } = Y(), { setInputContent: W } = Z() || {}, { reportContent: w } = $(I, n.id), { deleteContent: M } = tt(
|
|
@@ -46,7 +46,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
46
46
|
k,
|
|
47
47
|
N,
|
|
48
48
|
x
|
|
49
|
-
), { elementWidth: c } = et(), q = () => d?.id ? n.author?.id === d?.id || n.debate_suggestion?.author?.id === d?.id : !1,
|
|
49
|
+
), { elementWidth: c } = et(), q = () => d?.id ? n.author?.id === d?.id || n.debate_suggestion?.author?.id === d?.id : !1, v = () => {
|
|
50
50
|
W(n);
|
|
51
51
|
}, G = () => {
|
|
52
52
|
if (n.created_at && y.actions?.editionTime) {
|
|
@@ -58,7 +58,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
58
58
|
return /* @__PURE__ */ new Date() < a;
|
|
59
59
|
}
|
|
60
60
|
return !0;
|
|
61
|
-
},
|
|
61
|
+
}, D = () => {
|
|
62
62
|
U(
|
|
63
63
|
/* @__PURE__ */ t(J, { fallback: null, children: /* @__PURE__ */ t(
|
|
64
64
|
rt,
|
|
@@ -75,14 +75,14 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
75
75
|
}, i = (a) => (s) => {
|
|
76
76
|
(s.key === "Enter" || s.key === " ") && (s.preventDefault(), a());
|
|
77
77
|
};
|
|
78
|
-
return /* @__PURE__ */ r("div", { className: b(e.container,
|
|
78
|
+
return /* @__PURE__ */ r("div", { className: b(e.container, B), children: [
|
|
79
79
|
/* @__PURE__ */ t(
|
|
80
80
|
"div",
|
|
81
81
|
{
|
|
82
82
|
onKeyDown: (a) => {
|
|
83
83
|
(a.key === "Enter" || a.key === " ") && (a.preventDefault(), onClick());
|
|
84
84
|
},
|
|
85
|
-
className: b(e.voteAction,
|
|
85
|
+
className: b(e.voteAction, L),
|
|
86
86
|
"data-tid": "action_vote_argument",
|
|
87
87
|
children: C
|
|
88
88
|
}
|
|
@@ -159,6 +159,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
159
159
|
{
|
|
160
160
|
className: e.moreActionDropdown,
|
|
161
161
|
horizontalPosition: "right",
|
|
162
|
+
verticalPosition: "top",
|
|
162
163
|
children: [
|
|
163
164
|
/* @__PURE__ */ t(
|
|
164
165
|
l,
|
|
@@ -181,8 +182,8 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
181
182
|
"data-tid": "action_edit_argument",
|
|
182
183
|
className: e.dropdownItem,
|
|
183
184
|
tabIndex: "0",
|
|
184
|
-
onClick:
|
|
185
|
-
onKeyDown: i(
|
|
185
|
+
onClick: v,
|
|
186
|
+
onKeyDown: i(v),
|
|
186
187
|
children: o.formatMessage({
|
|
187
188
|
id: "user_content.content_footer.update",
|
|
188
189
|
defaultMessage: "Update"
|
|
@@ -204,7 +205,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
204
205
|
}
|
|
205
206
|
)
|
|
206
207
|
] }),
|
|
207
|
-
|
|
208
|
+
P && /* @__PURE__ */ t(
|
|
208
209
|
"div",
|
|
209
210
|
{
|
|
210
211
|
"data-tid": "action_report_argument",
|
|
@@ -225,8 +226,8 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
225
226
|
"data-tid": "action_share_argument",
|
|
226
227
|
className: e.dropdownItem,
|
|
227
228
|
tabIndex: "0",
|
|
228
|
-
onClick:
|
|
229
|
-
onKeyDown: i(
|
|
229
|
+
onClick: D,
|
|
230
|
+
onKeyDown: i(D),
|
|
230
231
|
children: o.formatMessage({
|
|
231
232
|
id: "user_content.content_footer.share",
|
|
232
233
|
defaultMessage: "Share"
|
|
@@ -242,5 +243,5 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
242
243
|
] });
|
|
243
244
|
};
|
|
244
245
|
export {
|
|
245
|
-
|
|
246
|
+
Dt as ContentFooter
|
|
246
247
|
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._dropdownWrapper_zrxfa_3{position:relative;display:inline-block}._dropdownHeader_zrxfa_8{border:none;padding:0!important;cursor:pointer;background-color:var(--background-color-primary, white)}._dropdownHeader_zrxfa_8:focus:not(:focus-visible){outline:none;box-shadow:none}._dropdownList_zrxfa_19{position:absolute;top:calc(100% + 2px);z-index:3;background:var(--background-color-primary, white);box-shadow:var(--box-shadow, 0px 2px 5px rgba(7, 42, 68, .1));border:var(--box-border, 1px solid rgba(7, 42, 68, .1));border-radius:var(--box-border-radius, 6px);overscroll-behavior-y:contain;width:max-content}._left_zrxfa_31{left:0!important}._right_zrxfa_35{right:0!important}._center_zrxfa_39{left:50%;transform:translate(-50%)}
|