@logora/debate 0.3.119 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ ._proposalBoxContainer_1pwsd_3{display:flex!important;flex-direction:column!important;justify-content:space-between!important;position:relative;height:100%;overflow:hidden;box-shadow:var(--box-shadow, 0px 2px 5px rgba(7, 42, 68, .1));border:var(--box-border, 1px solid rgba(7, 42, 68, .1));color:var(--text-primary, #222222);border-radius:var(--box-border-radius, 6px);background-color:var(--background-color-primary, white);scroll-margin-top:150px;padding:var(--box-spacing, var(--space-unit, 1em));gap:var(--box-spacing, var(--space-unit, 1em))}._proposalBoxContainer_1pwsd_3._flash_1pwsd_19{-webkit-transition:box-shadow .8s ease-in-out;-moz-transition:box-shadow .8s ease-in-out;-o-transition:box-shadow .8s ease-in-out;transition:box-shadow .8s ease-in-out;box-shadow:0 0 15px var(--call-primary-color, #434343)}._edited_1pwsd_27{font-size:var(--font-size-extra-small, 14px);color:var(--text-secondary, #5F5F5F);line-height:var(--line-height-loose, 1.38em);margin-bottom:var(--spacer-xs, calc(var(--space-unit, 1em) * .325))!important}._proposalBoxContent_1pwsd_34{flex:1;min-height:0;overflow:hidden;font-size:var(--font-size-normal, 16px);text-align:left;white-space:pre-line;line-height:var(--line-height-loose, 1.38em)}@container (min-width: 768px){._proposalBoxContent_1pwsd_34._withMinHeight_1pwsd_44{min-height:185px}}._proposalBoxContent_1pwsd_34 ._proposalTitle_1pwsd_48{font-size:var(--font-size-normal, 16px);font-weight:var(--font-weight-bold, 700);padding-bottom:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important}._proposalBoxContent_1pwsd_34 ._proposalTitle_1pwsd_48:first-letter{text-transform:uppercase}._proposalBoxContent_1pwsd_34 ._proposalContent_1pwsd_56 *{font-size:var(--font-size-small, 16px)}._proposalSourcesList_1pwsd_60{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;width:100%;font-size:var(--font-size-extra-small, 14px);font-weight:var(--font-weight-normal, 400)}._proposalSourcesList_1pwsd_60 a{text-decoration:none}._fixedHeight_1pwsd_73{height:200px;overflow:hidden;position:relative}._fixedHeight_1pwsd_73:after{content:"";position:absolute;z-index:1;bottom:0;left:0;right:0;pointer-events:none;background-image:linear-gradient(to bottom,#fff0,#fff 90%);width:100%;height:5em}._proposalContent_1pwsd_56 ol{list-style-type:decimal!important;margin-left:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;padding-left:var(--spacer-xl, calc(var(--space-unit, 1em) * 3))!important}._proposalContent_1pwsd_56 ul{list-style-type:disc!important;margin-left:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;padding-left:var(--spacer-xl, calc(var(--space-unit, 1em) * 3))!important}._proposalContent_1pwsd_56 ol li::marker,._proposalContent_1pwsd_56 ul li::marker{content:normal!important}
@@ -1,52 +1,73 @@
1
- import { useEffect as u } from "react";
2
- import { useAuthInterceptor as v } from "../use_auth/useAuthInterceptor.js";
3
- import { authTokenHandler as w } from "../use_auth/authTokenHandler.js";
4
- import { useAuthActions as q } from "../use_auth/useAuthActions.js";
5
- import { useAuthRequired as I } from "../../hooks/use_auth_required/useAuthRequired.js";
6
- import { AuthProviderFactory as P } from "../providers/AuthProviderFactory.js";
7
- import { httpClient as n } from "../../data/axios_client/httpClient.js";
8
- const U = ({ authUrl: o, authType: c, provider: a, assertion: m }) => {
9
- const r = "logora_user_token";
10
- v(n, o, r);
11
- const { getToken: f, removeToken: h } = w(
12
- n,
13
- o,
14
- r
15
- ), { loginUser: d, logoutUser: l, fetchUser: A } = q(
16
- n,
17
- o,
18
- r
19
- ), i = I();
20
- u(() => {
21
- p();
22
- }, []), u(() => {
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 p = () => {
35
- const e = g(), t = f();
36
+ const I = () => {
37
+ const o = l(), t = A();
36
38
  if (t) {
37
- const k = t.session_id;
38
- e.isSameUser(k) ? A() : (h(), s(e));
39
+ const n = t.session_id;
40
+ o.isSameUser(n) ? P() : (v(), m(o));
39
41
  } else
40
- s(e);
41
- }, s = (e) => {
42
- if (e.shouldInitAuth()) {
43
- const t = e.getAuthorizationParams();
44
- t && d(t);
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
- l();
47
- }, g = () => P.create(c, a, m);
48
- return null;
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
- U as AuthInitializer
72
+ N as AuthInitializer
52
73
  };
@@ -1,9 +1,9 @@
1
- import { authTokenHandler as m } from "./authTokenHandler.js";
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 I = "logora:emailConsent", L = (i, u, f) => {
5
- const { removeToken: a, fetchToken: d } = m(
6
- i,
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
- c();
15
+ i();
16
16
  }).catch((o) => {
17
17
  r(o);
18
18
  });
19
19
  }, g = () => {
20
- s(!1), t(!1), n({}), a(), E();
21
- }, c = () => {
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), p(o);
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
- }, p = (e) => {
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
- }, E = () => {
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: c
45
+ fetchUser: i
46
46
  };
47
47
  };
48
48
  export {
49
- I as EMAIL_CONSENT_STORAGE_KEY,
49
+ A as EMAIL_CONSENT_STORAGE_KEY,
50
50
  L as useAuthActions
51
51
  };
@@ -1,23 +1,23 @@
1
- import '../../../assets/components/proposal/proposal_box/ProposalBox.module-BYR3mHx2.css';const o = "_proposalBoxContainer_1quqb_3", t = "_flash_1quqb_19", s = "_edited_1quqb_27", e = "_proposalBoxContent_1quqb_34", n = "_withMinHeight_1quqb_45", p = "_proposalTitle_1quqb_49", i = "_proposalContent_1quqb_57", _ = "_proposalSourcesList_1quqb_61", a = "_fixedHeight_1quqb_74", l = {
1
+ import '../../../assets/components/proposal/proposal_box/ProposalBox.module-4DTCpEUh.css';const o = "_proposalBoxContainer_1pwsd_3", s = "_flash_1pwsd_19", t = "_edited_1pwsd_27", p = "_proposalBoxContent_1pwsd_34", e = "_withMinHeight_1pwsd_44", n = "_proposalTitle_1pwsd_48", i = "_proposalContent_1pwsd_56", _ = "_proposalSourcesList_1pwsd_60", a = "_fixedHeight_1pwsd_73", l = {
2
2
  proposalBoxContainer: o,
3
- flash: t,
4
- edited: s,
5
- proposalBoxContent: e,
6
- withMinHeight: n,
7
- proposalTitle: p,
3
+ flash: s,
4
+ edited: t,
5
+ proposalBoxContent: p,
6
+ withMinHeight: e,
7
+ proposalTitle: n,
8
8
  proposalContent: i,
9
9
  proposalSourcesList: _,
10
10
  fixedHeight: a
11
11
  };
12
12
  export {
13
13
  l as default,
14
- s as edited,
14
+ t as edited,
15
15
  a as fixedHeight,
16
- t as flash,
16
+ s as flash,
17
17
  o as proposalBoxContainer,
18
- e as proposalBoxContent,
18
+ p as proposalBoxContent,
19
19
  i as proposalContent,
20
20
  _ as proposalSourcesList,
21
- p as proposalTitle,
22
- n as withMinHeight
21
+ n as proposalTitle,
22
+ e as withMinHeight
23
23
  };
@@ -1,225 +1,238 @@
1
- import { jsx as a, jsxs as o, Fragment as w } from "react/jsx-runtime";
2
- import { useState as n } from "react";
3
- import { useIntl as Y, FormattedMessage as Z } from "react-intl";
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 ee } from "../../auth/use_auth/useAuth.js";
6
- import { useDataProvider as ae } from "../../data/data_provider/useDataProvider.js";
7
- import { useConfig as te } from "../../data/config_provider/useConfig.js";
8
- import { useResponsive as se } from "../../hooks/use_responsive/useResponsive.js";
9
- import { useFormValidation as re } from "../../forms/use_form_validation/useFormValidation.js";
10
- import { useModal as ie } from "../../dialog/modal/useModal.js";
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 le } from "../../progress/loader/Loader.js";
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
- const Ie = ({
20
- termsUrl: O,
21
- privacyUrl: F,
22
- showEmailConsent: M = !1,
23
- showTerms: u = !1
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 l = ee(), D = ae(), i = Y(), r = te(), L = [...Array(r.avatars?.maxFileName || 0).keys()].map(
26
- (e) => `${r.avatars?.baseUrl}/${e + 1}.${r.avatars?.fileExtension}`
27
- ), [f, B] = n(l.currentUser.first_name || ""), [p, $] = n(
28
- l.currentUser.description || ""
29
- ), [g, j] = n(l.currentUser.last_name || ""), [_, R] = n(l.currentUser.language), [q, h] = n(!1), [N, U] = n(
30
- l.currentUser.image_url
31
- ), [c, E] = n(null), [C, x] = n(!1), [z, T] = n(!1), { isMobile: y } = se(), { errors: d, validate: V } = re(), { hideModal: k } = ie(), [v, W] = n(!1), [b, G] = n(!1), H = (e) => {
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
- U(s.result);
36
+ C(s.result);
35
37
  }, s.readAsDataURL(e);
36
- }, J = [
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
- ...u ? [{ accepts_terms: ["enforceValue", !0] }] : []
43
- ], K = (e) => {
43
+ ...n ? [] : [{ language: ["required", null] }],
44
+ ...h ? [{ accepts_terms: ["enforceValue", !0] }] : []
45
+ ], X = (e) => {
44
46
  e.preventDefault();
45
47
  const s = {};
46
- if (f && (s.first_name = f), g && (s.last_name = g), _ && (s.language = _), c && C && (s.image = c), c && !C && (s.origin_image_url = c), p && (s.description = p), M && (s.accepts_provider_email = b), u && (s.accepts_terms = v), s.is_onboarded = !0, V(s, J)) {
47
- T(!0);
48
- const P = new FormData();
49
- Object.entries(s).forEach(([m, X]) => {
50
- P.append(m, X);
51
- }), D.update("users", l.currentUser.slug, P).then((m) => {
52
- m.data.success && l.setCurrentUser(m.data.data.resource), k();
53
- });
54
- }
55
- }, Q = (e) => {
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
- E(e), h(!1), s.test(e) ? (U(e), x(!1)) : (x(!0), H(e));
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: i.formatMessage({
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: y ? "unset" : "max-content",
69
- minWidth: y ? "unset" : "500px",
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: z ? /* @__PURE__ */ a(le, {}) : q ? /* @__PURE__ */ o(w, { children: [
87
+ children: V ? /* @__PURE__ */ a(de, {}) : E && !n ? /* @__PURE__ */ d(S, { children: [
75
88
  /* @__PURE__ */ a(
76
89
  ce,
77
90
  {
78
- onChooseAvatar: Q,
79
- avatarUrlList: L,
80
- userName: l.currentUser.full_name,
81
- allowUserImage: r.avatars?.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: () => h(!1),
89
- children: i.formatMessage({
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__ */ o(w, { children: [
96
- /* @__PURE__ */ o("div", { className: t.container, children: [
97
- /* @__PURE__ */ o("div", { className: t.userImageContainer, children: [
98
- N ? /* @__PURE__ */ a(
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: N,
103
- alt: i.formatMessage({
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
- oe,
122
+ me,
110
123
  {
111
124
  name: "camera",
112
125
  height: 20,
113
126
  width: 20,
114
- alt: i.formatMessage({
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
- I,
133
+ !n && /* @__PURE__ */ a(
134
+ D,
122
135
  {
123
136
  "data-testid": "avatar-button",
124
137
  "data-tid": "action_save_profile",
125
- onClick: () => h(!0),
138
+ onClick: () => N(!0),
126
139
  style: { whiteSpace: "nowrap" },
127
- children: i.formatMessage({
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__ */ o("div", { className: t.inputsContainer, children: [
135
- /* @__PURE__ */ o("div", { className: t.nameContainer, children: [
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
- A,
150
+ O,
138
151
  {
139
152
  type: "text",
140
153
  name: "first_name",
141
- "aria-label": i.formatMessage({
154
+ "aria-label": r.formatMessage({
142
155
  id: "auth.signup_form.first_name.aria_label",
143
156
  defaultMessage: "First name"
144
157
  }),
145
- placeholder: i.formatMessage({
158
+ placeholder: r.formatMessage({
146
159
  id: "auth_signup_form_first_name_placeholder",
147
160
  defaultMessage: "First name"
148
161
  }),
149
- onChange: (e) => r.actions?.disableOnboardingNameUpdate === !0 ? null : B(e.target.value),
150
- value: f,
151
- error: !!d.first_name,
152
- message: d.first_name,
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: r.actions?.disableOnboardingNameUpdate === !0
167
+ disabled: i.actions?.disableOnboardingNameUpdate === !0
155
168
  }
156
169
  ) }),
157
170
  /* @__PURE__ */ a("div", { className: t.updateProfileInput, children: /* @__PURE__ */ a(
158
- A,
171
+ O,
159
172
  {
160
173
  type: "text",
161
174
  name: "last_name",
162
- "aria-label": i.formatMessage({
175
+ "aria-label": r.formatMessage({
163
176
  id: "auth.signup_form.last_name.aria_label",
164
177
  defaultMessage: "Last name"
165
178
  }),
166
- placeholder: i.formatMessage({
179
+ placeholder: r.formatMessage({
167
180
  id: "auth_signup_form_last_name_placeholder",
168
181
  defaultMessage: "Last name"
169
182
  }),
170
- onChange: (e) => r.actions?.disableOnboardingNameUpdate === !0 ? null : j(e.target.value),
171
- value: g,
172
- error: !!d.last_name,
173
- message: d.last_name,
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: r.actions?.disableOnboardingNameUpdate === !0
188
+ disabled: i.actions?.disableOnboardingNameUpdate === !0
176
189
  }
177
190
  ) })
178
191
  ] }),
179
- r.actions?.disableNameUpdate == !0 && r.actions?.disableOnboardingNameUpdate != !0 && /* @__PURE__ */ a("div", { className: t.hint, children: i.formatMessage({
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
- r.translation?.translationMethods && Object.keys(r.translation.translationMethods).length > 0 && /* @__PURE__ */ a(
184
- de,
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
- r.translation.translationMethods
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) => R(e.value)
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: i.formatMessage({
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: p,
207
- onChange: (e) => $(e.target.value),
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
- u && /* @__PURE__ */ a("div", { className: t.toggle, children: /* @__PURE__ */ a(
215
- S,
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: v,
233
+ checked: p,
221
234
  label: /* @__PURE__ */ a(
222
- Z,
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: O,
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: F,
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) => W(!v),
251
- message: d.accepts_terms,
263
+ onInputChanged: (e) => H(!p),
264
+ message: c.accepts_terms,
252
265
  "data-testid": "accepts-terms-input"
253
266
  }
254
267
  ) }),
255
- M && /* @__PURE__ */ a("div", { className: t.toggle, children: /* @__PURE__ */ a(
256
- S,
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: b,
262
- label: i.formatMessage(
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: r.provider?.companyName }
280
+ { provider: i.provider?.companyName }
268
281
  ),
269
- onInputChanged: (e) => G(!b),
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
- I,
287
+ D,
275
288
  {
276
289
  "data-testid": "save-button",
277
290
  "data-tid": "action_save_profile",
278
- onClick: (e) => K(e),
279
- children: i.formatMessage({
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
- Ie as UpdateUserInfoModal
303
+ De as UpdateUserInfoModal
291
304
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logora/debate",
3
- "version": "0.3.119",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0",
6
6
  "description": "Design system of @Logora made with React",
@@ -1 +0,0 @@
1
- ._proposalBoxContainer_1quqb_3{display:flex!important;flex-direction:column!important;justify-content:space-between!important;position:relative;height:100%;overflow:hidden;box-shadow:var(--box-shadow, 0px 2px 5px rgba(7, 42, 68, .1));border:var(--box-border, 1px solid rgba(7, 42, 68, .1));color:var(--text-primary, #222222);border-radius:var(--box-border-radius, 6px);background-color:var(--background-color-primary, white);scroll-margin-top:150px;padding:var(--box-spacing, var(--space-unit, 1em));gap:var(--box-spacing, var(--space-unit, 1em))}._proposalBoxContainer_1quqb_3._flash_1quqb_19{-webkit-transition:box-shadow .8s ease-in-out;-moz-transition:box-shadow .8s ease-in-out;-o-transition:box-shadow .8s ease-in-out;transition:box-shadow .8s ease-in-out;box-shadow:0 0 15px var(--call-primary-color, #434343)}._edited_1quqb_27{font-size:var(--font-size-extra-small, 14px);color:var(--text-secondary, #5F5F5F);line-height:var(--line-height-loose, 1.38em);margin-bottom:var(--spacer-xs, calc(var(--space-unit, 1em) * .325))!important}._proposalBoxContent_1quqb_34{flex:1;min-height:0;overflow:hidden;text-align:left;white-space:pre-line;line-height:var(--line-height-loose, 1.38em);font-size:var(--font-size-small, 16px)}@container (min-width: 768px){._proposalBoxContent_1quqb_34._withMinHeight_1quqb_45{min-height:185px}}._proposalBoxContent_1quqb_34 ._proposalTitle_1quqb_49{font-size:var(--font-size-normal, 16px);font-weight:var(--font-weight-bold, 700);padding-bottom:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important}._proposalBoxContent_1quqb_34 ._proposalTitle_1quqb_49:first-letter{text-transform:uppercase}._proposalBoxContent_1quqb_34 ._proposalContent_1quqb_57 *{font-size:var(--font-size-small, 16px)}._proposalSourcesList_1quqb_61{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;width:100%;font-size:var(--font-size-extra-small, 14px);font-weight:var(--font-weight-normal, 400)}._proposalSourcesList_1quqb_61 a{text-decoration:none}._fixedHeight_1quqb_74{height:200px;overflow:hidden;position:relative}._fixedHeight_1quqb_74:after{content:"";position:absolute;z-index:1;bottom:0;left:0;right:0;pointer-events:none;background-image:linear-gradient(to bottom,#fff0,#fff 90%);width:100%;height:5em}._proposalContent_1quqb_57 ol{list-style-type:decimal!important;margin-left:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;padding-left:var(--spacer-xl, calc(var(--space-unit, 1em) * 3))!important}._proposalContent_1quqb_57 ul{list-style-type:disc!important;margin-left:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;padding-left:var(--spacer-xl, calc(var(--space-unit, 1em) * 3))!important}._proposalContent_1quqb_57 ol li::marker,._proposalContent_1quqb_57 ul li::marker{content:normal!important}