@logora/debate 0.4.38 → 0.4.40

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.
@@ -1,5 +1,5 @@
1
1
  import { jsx as o, jsxs as l, Fragment as f } from "react/jsx-runtime";
2
- import B from "classnames";
2
+ import E from "classnames";
3
3
  import { useState as y, useEffect as le, useCallback as ne, Suspense as de, lazy as ce } from "react";
4
4
  import { useIntl as pe } from "react-intl";
5
5
  import s from "./Argument.module.scss.js";
@@ -12,40 +12,40 @@ import { useTranslatedContent as D } from "../../translation/translated_content/
12
12
  import { SourceListItem as _e } from "../../source/source_list_item/SourceListItem.js";
13
13
  import { HashScroll as ge } from "../../tools/hash_scroll/HashScroll.js";
14
14
  import { ContentHeader as be } from "../../user_content/content_header/ContentHeader.js";
15
- import { Icon as E } from "../../icons/icon/Icon.js";
15
+ import { Icon as F } from "../../icons/icon/Icon.js";
16
16
  import { ReadMore as Me } from "../../text/read_more/ReadMore.js";
17
- import { TranslationButton as ve } from "../../translation/translation_button/TranslationButton.js";
18
- import { ContentFooter as Ie } from "../../user_content/content_footer/ContentFooter.js";
17
+ import { TranslationButton as Ie } from "../../translation/translation_button/TranslationButton.js";
18
+ import { ContentFooter as ve } from "../../user_content/content_footer/ContentFooter.js";
19
19
  import { VoteButton as Ce } from "../../vote/vote_button/VoteButton.js";
20
20
  import { VotePaginatedList as Se } from "../../list/paginated_list/VotePaginatedList.js";
21
21
  import { UserContentSkeleton as Re } from "../../skeleton/user_content_skeleton/UserContentSkeleton.js";
22
22
  import { Button as Te } from "../../action/button/Button.js";
23
- const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({ default: e.ArgumentInput }))), F = (e) => e?.replace(/ /g, " "), we = ({
23
+ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({ default: e.ArgumentInput }))), P = (e) => e?.replace(/ /g, " "), we = ({
24
24
  argument: e,
25
25
  argumentReplies: n,
26
26
  nestingLevel: _ = 0,
27
- maxNestingLevel: S = 2,
28
- groupType: R,
29
- groupName: T,
27
+ maxNestingLevel: R = 2,
28
+ groupType: T,
29
+ groupName: N,
30
30
  positions: g = [],
31
- disableLinks: P = !1,
31
+ disableLinks: j = !1,
32
32
  parentArgument: c,
33
- flashParent: j,
34
- expandable: G,
33
+ flashParent: G,
34
+ expandable: V,
35
35
  disabled: b = !1,
36
- hideFooter: N = !1,
37
- hideReplies: w,
36
+ hideFooter: w = !1,
37
+ hideReplies: A,
38
38
  vote: H,
39
- fixedContentHeight: V = !1,
40
- enableEdition: z = !0,
41
- enableDeletion: O = !0,
42
- deleteListId: Y,
43
- showModerationFeedback: q,
44
- lineCount: J = 5,
45
- replyRedirectUrl: K,
46
- hideContent: Q = !1
39
+ fixedContentHeight: z = !1,
40
+ enableEdition: O = !0,
41
+ enableDeletion: Y = !0,
42
+ deleteListId: q,
43
+ showModerationFeedback: J,
44
+ lineCount: K = 5,
45
+ replyRedirectUrl: Q,
46
+ hideContent: W = !1
47
47
  }) => {
48
- const a = pe(), { isLoggedIn: W, currentUser: p } = he(), A = p?.moderation_status === "banned", r = fe(), X = ye(), [m, M] = y(!1), [Z, x] = y(!1), [ee, te] = y(!1), L = ue(e), [u, v] = y(), h = D(
48
+ const a = pe(), { isLoggedIn: x, currentUser: p } = he(), M = p?.moderation_status === "banned", r = fe(), X = ye(), [m, I] = y(!1), [Z, L] = y(!1), [ee, te] = y(!1), U = ue(e), [u, v] = y(), h = D(
49
49
  e.content,
50
50
  e.language,
51
51
  "content",
@@ -55,19 +55,19 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
55
55
  e.position?.language,
56
56
  "name",
57
57
  e.position?.translation_entries
58
- ), I = `argument_${e.id}`, C = e.position && g?.map((t) => t.id).indexOf(e.position.id) + 1;
58
+ ), C = `argument_${e.id}`, S = e.position && g?.map((t) => t.id).indexOf(e.position.id) + 1;
59
59
  le(() => {
60
60
  n !== void 0 && ae();
61
61
  }, [n]);
62
62
  const se = (t) => {
63
- if (I === t) {
63
+ if (C === t) {
64
64
  const d = document.getElementById(t);
65
- d && d.scrollIntoView({ behavior: "smooth" }), x(!0);
65
+ d && d.scrollIntoView({ behavior: "smooth" }), L(!0);
66
66
  }
67
- }, U = () => {
68
- te((t) => !t);
69
67
  }, k = () => {
70
- M((t) => !t), v([]);
68
+ te((t) => !t);
69
+ }, $ = () => {
70
+ I((t) => !t), v([]);
71
71
  }, re = (t) => {
72
72
  if (!u?.find((i) => i.id === t.id))
73
73
  return t;
@@ -85,37 +85,37 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
85
85
  const t = n.filter(
86
86
  (i) => i.reply_to_id === e.id
87
87
  );
88
- t.length > 0 && (v(t), M(!0));
88
+ t.length > 0 && (v(t), I(!0));
89
89
  }
90
- }, $ = (t = null) => /* @__PURE__ */ o(
90
+ }, B = (t = null) => /* @__PURE__ */ o(
91
91
  Ae,
92
92
  {
93
93
  ...t ? { argument: t } : {},
94
94
  nestingLevel: _ + 1,
95
- maxNestingLevel: S,
95
+ maxNestingLevel: R,
96
96
  disabled: b,
97
- groupName: T,
98
- groupType: R,
97
+ groupName: N,
98
+ groupType: T,
99
99
  positions: g,
100
100
  argumentReplies: n,
101
101
  parentArgument: e,
102
102
  flashParent: (i) => se(`argument_${i}`)
103
103
  }
104
104
  );
105
- return /* @__PURE__ */ l(ge, { elementId: I, onScroll: () => x(!0), children: [
105
+ return /* @__PURE__ */ l(ge, { elementId: C, onScroll: () => L(!0), children: [
106
106
  /* @__PURE__ */ l(
107
107
  "div",
108
108
  {
109
- className: B(
109
+ className: E(
110
110
  s.argument,
111
111
  {
112
112
  [s.flash]: Z,
113
113
  [s.argumentReply]: e.is_reply === !0
114
114
  },
115
115
  s[`level-${_}`],
116
- s[`position-${!(e.author.role === "editor" || e.author.role === "moderator") && C}`]
116
+ s[`position-${!(e.author.role === "editor" || e.author.role === "moderator") && S}`]
117
117
  ),
118
- id: I,
118
+ id: C,
119
119
  children: [
120
120
  /* @__PURE__ */ o(
121
121
  be,
@@ -124,10 +124,10 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
124
124
  author: e.author,
125
125
  tag: (e.author.role === "editor" || e.author.role === "moderator") && e.is_reply ? null : oe.translatedContent,
126
126
  date: e.created_at,
127
- tagClassName: s[`headerPosition-${C}`],
128
- disableLinks: P,
127
+ tagClassName: s[`headerPosition-${S}`],
128
+ disableLinks: j,
129
129
  isDeleted: e.is_deleted,
130
- showModerationFeedback: q ?? (e.status === "rejected" && r.moderation?.showFeedback === !0),
130
+ showModerationFeedback: J ?? (e.status === "rejected" && r.moderation?.showFeedback === !0),
131
131
  moderationReason: e.moderation_entry?.moderation_reason,
132
132
  moderationNotes: e.moderation_entry?.moderator_notes,
133
133
  moderationPolicyUrl: r.provider?.userGuideUrl
@@ -136,22 +136,22 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
136
136
  e.is_deleted ? /* @__PURE__ */ o("div", { className: s.argumentDeletedBody, children: a.formatMessage({
137
137
  id: "info.deleted_by_user",
138
138
  defaultMessage: "Content deleted by the user"
139
- }) }) : Q ? /* @__PURE__ */ o("div", { className: s.argumentDeletedBody, children: a.formatMessage({
139
+ }) }) : W ? /* @__PURE__ */ o("div", { className: s.argumentDeletedBody, children: a.formatMessage({
140
140
  id: "argument.argument.content_deleted",
141
141
  defaultMessage: "This content has been removed."
142
142
  }) }) : /* @__PURE__ */ l(f, { children: [
143
143
  /* @__PURE__ */ l(
144
144
  "div",
145
145
  {
146
- className: B(s.argumentBody, {
147
- [s.fixedHeight]: r?.layout?.showAllArgumentInEmbed !== !0 ? V : !1
146
+ className: E(s.argumentBody, {
147
+ [s.fixedHeight]: r?.layout?.showAllArgumentInEmbed !== !0 ? z : !1
148
148
  }),
149
149
  children: [
150
150
  e.is_reply && c && /* @__PURE__ */ l(
151
151
  "div",
152
152
  {
153
153
  className: s.replyTo,
154
- onClick: () => j(c.id),
154
+ onClick: () => G(c.id),
155
155
  children: [
156
156
  a.formatMessage({
157
157
  id: "info.replying_to",
@@ -162,7 +162,7 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
162
162
  id: "info.deleted",
163
163
  defaultMessage: "Deleted"
164
164
  }) : c.author.full_name,
165
- /* @__PURE__ */ o(E, { name: "chat", height: 16 })
165
+ /* @__PURE__ */ o(F, { name: "chat", height: 16 })
166
166
  ] })
167
167
  ]
168
168
  }
@@ -175,22 +175,22 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
175
175
  id: "argument.argument.updated",
176
176
  defaultMessage: "Updated argument"
177
177
  }) }),
178
- L && !h.isTranslated ? /* @__PURE__ */ o(
178
+ U && !h.isTranslated ? /* @__PURE__ */ o(
179
179
  "div",
180
180
  {
181
181
  className: s.argumentContent,
182
- dangerouslySetInnerHTML: { __html: F(L) }
182
+ dangerouslySetInnerHTML: { __html: P(U) }
183
183
  }
184
- ) : /* @__PURE__ */ o("div", { className: s.argumentContent, children: F(h.translatedContent) }),
184
+ ) : /* @__PURE__ */ o("div", { className: s.argumentContent, children: P(h.translatedContent) }),
185
185
  h.isTranslated && /* @__PURE__ */ o(
186
- ve,
186
+ Ie,
187
187
  {
188
188
  language: e.language,
189
189
  callback: () => h.toggleContent()
190
190
  }
191
191
  )
192
192
  ] }),
193
- lineCount: r?.layout?.showAllArgumentInEmbed !== !0 ? J : void 0,
193
+ lineCount: r?.layout?.showAllArgumentInEmbed !== !0 ? K : void 0,
194
194
  readMoreText: a.formatMessage({
195
195
  id: "action.read_more",
196
196
  defaultMessage: "Read more"
@@ -199,7 +199,7 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
199
199
  id: "action.read_less",
200
200
  defaultMessage: "Read less"
201
201
  }),
202
- expandable: r?.layout?.showAllArgumentInEmbed !== !0 ? G : !1,
202
+ expandable: r?.layout?.showAllArgumentInEmbed !== !0 ? V : !1,
203
203
  readMoreClassName: e.is_reply ? s.replyStyle : s.argumentStyle
204
204
  }
205
205
  )
@@ -208,18 +208,19 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
208
208
  ),
209
209
  e.sources?.length > 0 && /* @__PURE__ */ o("div", { className: s.argumentSourcesList, children: e.sources.map(ie) })
210
210
  ] }),
211
- !N && !e.is_deleted && /* @__PURE__ */ o(
212
- Ie,
211
+ !w && !e.is_deleted && /* @__PURE__ */ o(
212
+ ve,
213
213
  {
214
214
  resource: e,
215
- disabled: b || e.status === "rejected" || e.status === "pending" || !W && r?.actions?.disableInputForVisitor === !0 || A,
215
+ disabled: b || e.status === "rejected" || e.status === "pending" || !x && r?.actions?.disableInputForVisitor === !0 || M,
216
+ disableEdition: e.status === "rejected" || !x && r?.actions?.disableInputForVisitor === !0 || M,
216
217
  reportType: "Message",
217
218
  softDelete: r.actions?.softDelete,
218
219
  deleteType: "messages",
219
- deleteListId: Y,
220
- enableReply: _ <= S || p.role === "editor" || p.role === "moderator",
221
- handleReplyTo: U,
222
- replyRedirectUrl: K,
220
+ deleteListId: q,
221
+ enableReply: _ <= R || p.role === "editor" || p.role === "moderator",
222
+ handleReplyTo: k,
223
+ replyRedirectUrl: Q,
223
224
  shareUrl: `https://app.logora.fr/share/a/${e.id}`,
224
225
  shareTitle: a.formatMessage({
225
226
  id: "share.argument.title",
@@ -234,8 +235,8 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
234
235
  showShareText: !0,
235
236
  showShareButton: r?.actions?.hideShareButton !== !0,
236
237
  enableReport: !(e.score === 100 && e.manual_score),
237
- enableEdition: z,
238
- enableDeletion: O,
238
+ enableEdition: O,
239
+ enableDeletion: Y,
239
240
  children: /* @__PURE__ */ o(
240
241
  Ce,
241
242
  {
@@ -243,32 +244,32 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
243
244
  voteableId: e.id,
244
245
  totalUpvote: e.upvotes,
245
246
  totalDownvote: 0,
246
- activeClassName: s[`voteButtonPosition-${C}`],
247
- disabled: e.status === "rejected" || p?.id === e?.author?.id || A
247
+ activeClassName: s[`voteButtonPosition-${S}`],
248
+ disabled: e.status === "rejected" || p?.id === e?.author?.id || M
248
249
  }
249
250
  )
250
251
  }
251
252
  ),
252
- !N && !w && /* @__PURE__ */ o(
253
+ !w && !A && /* @__PURE__ */ o(
253
254
  me,
254
255
  {
255
256
  numberReplies: e.number_replies,
256
257
  repliesAuthors: e.replies_authors,
257
258
  expandReplies: m,
258
- onToggleReplies: k,
259
+ onToggleReplies: $,
259
260
  isReply: e.is_reply
260
261
  }
261
262
  )
262
263
  ]
263
264
  }
264
265
  ),
265
- !w && /* @__PURE__ */ l(f, { children: [
266
+ !A && /* @__PURE__ */ l(f, { children: [
266
267
  ee && /* @__PURE__ */ o(de, { fallback: null, children: /* @__PURE__ */ o(
267
268
  Ne,
268
269
  {
269
270
  groupId: e.group_id,
270
- groupType: R,
271
- groupName: T,
271
+ groupType: T,
272
+ groupName: N,
272
273
  positions: g,
273
274
  parentId: e.id,
274
275
  positionId: H?.position_id,
@@ -276,7 +277,7 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
276
277
  hideSourceAction: r?.actions?.disableUserSources || !1,
277
278
  onSubmit: (t) => {
278
279
  const i = `argument_${e.id}_reply_list`;
279
- X.add(i, [t]), U(), M(!0);
280
+ X.add(i, [t]), k(), I(!0);
280
281
  },
281
282
  onUpdate: (t) => {
282
283
  v(
@@ -297,7 +298,7 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
297
298
  },
298
299
  `Reply${e.id}`
299
300
  ) }),
300
- u?.length > 0 && m && /* @__PURE__ */ o("div", { className: s.repliesList, children: u.map((t) => $(t)) }),
301
+ u?.length > 0 && m && /* @__PURE__ */ o("div", { className: s.repliesList, children: u.map((t) => B(t)) }),
301
302
  m && /* @__PURE__ */ o("div", { className: s.repliesList, children: /* @__PURE__ */ o(
302
303
  Se,
303
304
  {
@@ -316,15 +317,15 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
316
317
  resourcePropName: "argument",
317
318
  emptyListComponent: /* @__PURE__ */ o(f, {}),
318
319
  transformData: (t) => re(t),
319
- children: $(e)
320
+ children: B(e)
320
321
  }
321
322
  ) }),
322
323
  u?.length > 0 && !m && /* @__PURE__ */ o("div", { className: s.repliesList, children: e.number_replies > 1 && /* @__PURE__ */ o("div", { className: s.readMoreLink, children: /* @__PURE__ */ o(
323
324
  Te,
324
325
  {
325
326
  role: "link",
326
- rightIcon: /* @__PURE__ */ o(E, { name: "lightArrow", height: 10, width: 10 }),
327
- handleClick: k,
327
+ rightIcon: /* @__PURE__ */ o(F, { name: "lightArrow", height: 10, width: 10 }),
328
+ handleClick: $,
328
329
  children: a.formatMessage({
329
330
  id: "argument.argument.see_more",
330
331
  defaultMessage: "See more"
@@ -5,15 +5,15 @@ import { useConfig as I } from "../../data/config_provider/useConfig.js";
5
5
  import { useModal as y } from "../../dialog/modal/useModal.js";
6
6
  import { useAuth as C } from "../use_auth/useAuth.js";
7
7
  import { useAuthActions as E } from "../use_auth/useAuthActions.js";
8
- import { httpClient as P } from "../../data/axios_client/httpClient.js";
9
- import { Modal as T } from "../../dialog/modal/Modal.js";
8
+ import { httpClient as T } from "../../data/axios_client/httpClient.js";
9
+ import { Modal as P } from "../../dialog/modal/Modal.js";
10
10
  import { Loader as R } from "../../progress/loader/Loader.js";
11
11
  import { SocialAuthForm as B } from "../social_auth_form/SocialAuthForm.js";
12
12
  import { SSOForm as L } from "../sso_form/SSOForm.js";
13
13
  import { AuthProviderFactory as M } from "../providers/AuthProviderFactory.js";
14
14
  const $ = ({ onHideModal: s = null }) => {
15
15
  const o = I(), { hideModal: c } = y(), { isLoggedIn: l, authError: r } = C(), [p, n] = h(!1), [e, d] = h(null), { loginUser: g } = E(
16
- P,
16
+ T,
17
17
  process.env.API_AUTH_URL,
18
18
  "logora_user_token"
19
19
  );
@@ -35,7 +35,7 @@ const $ = ({ onHideModal: s = null }) => {
35
35
  ).getAuthorizationParams();
36
36
  g(v);
37
37
  };
38
- return /* @__PURE__ */ t(T, { "data-vid": "login_modal", children: /* @__PURE__ */ t("div", { className: w.loginModalBody, children: p ? /* @__PURE__ */ t(R, {}) : /* @__PURE__ */ t(_, { children: o.auth.type === "form" || o.auth.type === "social" ? /* @__PURE__ */ t(
38
+ return /* @__PURE__ */ t(P, { "data-vid": "login_modal", children: /* @__PURE__ */ t("div", { className: w.loginModalBody, children: p ? /* @__PURE__ */ t(R, {}) : /* @__PURE__ */ t(_, { children: o.auth.type === "form" || o.auth.type === "social" ? /* @__PURE__ */ t(
39
39
  B,
40
40
  {
41
41
  onSubmit: A,
@@ -69,7 +69,8 @@ const $ = ({ onHideModal: s = null }) => {
69
69
  hideLoginButton: o.auth.hideModalLoginButton,
70
70
  showEmailConsent: o.auth.showEmailConsent,
71
71
  showTerms: o.auth.hideCgu !== !0,
72
- hideBelowButton: o.auth.hideBelowButton
72
+ hideBelowButton: o.auth.hideBelowButton,
73
+ hideTerms: o.auth.hideTerms
73
74
  }
74
75
  ) }) }) });
75
76
  };
@@ -1,17 +1,17 @@
1
- import { jsxs as n, jsx as e, Fragment as m } from "react/jsx-runtime";
2
- import G from "@rooks/use-sessionstorage-state";
3
- import D from "classnames";
1
+ import { jsxs as o, jsx as e, Fragment as d } from "react/jsx-runtime";
2
+ import D from "@rooks/use-sessionstorage-state";
3
+ import Y from "classnames";
4
4
  import "react";
5
- import { useIntl as Y, FormattedMessage as w } from "react-intl";
6
- import { useLocation as z } from "react-router";
5
+ import { useIntl as z, FormattedMessage as w } from "react-intl";
6
+ import { useLocation as H } from "react-router";
7
7
  import a from "./SSOForm.module.scss.js";
8
- import { EMAIL_CONSENT_STORAGE_KEY as H } from "../use_auth/useAuthActions.js";
9
- import { Icon as K } from "../../icons/icon/Icon.js";
10
- import { Button as V } from "../../action/button/Button.js";
11
- import { Toggle as W } from "../../input/toggle/Toggle.js";
12
- const oe = ({
8
+ import { EMAIL_CONSENT_STORAGE_KEY as K } from "../use_auth/useAuthActions.js";
9
+ import { Icon as V } from "../../icons/icon/Icon.js";
10
+ import { Button as W } from "../../action/button/Button.js";
11
+ import { Toggle as $ } from "../../input/toggle/Toggle.js";
12
+ const ne = ({
13
13
  authType: v,
14
- providerName: d,
14
+ providerName: c,
15
15
  loginUrl: M,
16
16
  signupUrl: b,
17
17
  termsUrl: N,
@@ -26,26 +26,27 @@ const oe = ({
26
26
  showEmailConsent: g = !1,
27
27
  showTerms: L = !1,
28
28
  hideBelowButton: R = !1,
29
- error: x = !1
29
+ hideTerms: x = !1,
30
+ error: A = !1
30
31
  }) => {
31
- const [h, A] = g ? G(H, !1) : [!1, () => {
32
- }], o = Y(), c = z(), C = (t) => {
32
+ const [h, C] = g ? D(K, !1) : [!1, () => {
33
+ }], n = z(), m = H(), T = (t) => {
33
34
  if (typeof window < "u") {
34
- const s = t === "CURRENT_LOCATION" ? window.location : t, i = new URL(s, window.location.origin), l = i.searchParams, E = new URLSearchParams(c.search);
35
+ const s = t === "CURRENT_LOCATION" ? window.location : t, i = new URL(s, window.location.origin), l = i.searchParams, F = new URLSearchParams(m.search);
35
36
  l.has("code") && l.delete("code"), f && l.append(f, window.location.toString());
36
- for (const [_, F] of Object.entries(U)) {
37
- let r = F;
37
+ for (const [_, j] of Object.entries(U)) {
38
+ let r = j;
38
39
  if (r) {
39
- const j = c.pathname.slice(
40
+ const G = m.pathname.slice(
40
41
  0,
41
- c.pathname.lastIndexOf("/")
42
+ m.pathname.lastIndexOf("/")
42
43
  );
43
44
  r = r.replace(
44
45
  "{{UTM_CAMPAIGN}}",
45
- E.get("utm_campaign")
46
+ F.get("utm_campaign")
46
47
  ), r = r.replace(
47
48
  "{{CURRENT_PATH}}",
48
- decodeURIComponent(j)
49
+ decodeURIComponent(G)
49
50
  );
50
51
  }
51
52
  _ === "metadata" && r && (r = window.btoa(r)), l.append(_, encodeURIComponent(r));
@@ -53,15 +54,15 @@ const oe = ({
53
54
  return i.search = l.toString(), i.toString();
54
55
  }
55
56
  return "";
56
- }, T = (t) => {
57
+ }, O = (t) => {
57
58
  const s = new URL(t);
58
59
  if (s.searchParams.delete("code"), s.searchParams.append("client_id", S), s.searchParams.append("redirect_uri", y), s.searchParams.append("scope", I), s.searchParams.append("response_type", "code"), typeof window < "u") {
59
60
  const i = new URL(window.location.href);
60
61
  i.searchParams.delete("code"), s.searchParams.append("state", window.btoa(i.toString()));
61
62
  }
62
63
  return s.href;
63
- }, p = (t) => v === "oauth2_server" ? T(t) : C(t), O = p(M), B = p(b);
64
- return /* @__PURE__ */ n("div", { className: a.ssoForm, children: [
64
+ }, p = (t) => v === "oauth2_server" ? O(t) : T(t), B = p(M), E = p(b);
65
+ return /* @__PURE__ */ o("div", { className: a.ssoForm, children: [
65
66
  /* @__PURE__ */ e("div", { className: a.logo, children: u ? /* @__PURE__ */ e(
66
67
  "img",
67
68
  {
@@ -69,10 +70,10 @@ const oe = ({
69
70
  width: 100,
70
71
  className: a.logoImage,
71
72
  src: u,
72
- alt: `Logo ${d}`
73
+ alt: `Logo ${c}`
73
74
  }
74
75
  ) : /* @__PURE__ */ e(
75
- K,
76
+ V,
76
77
  {
77
78
  name: "next",
78
79
  "aria-hidden": "true",
@@ -81,41 +82,41 @@ const oe = ({
81
82
  className: a.loginIcon
82
83
  }
83
84
  ) }),
84
- /* @__PURE__ */ n("div", { className: a.mainText, children: [
85
- /* @__PURE__ */ n("div", { className: a.title, children: [
86
- o.formatMessage({
85
+ /* @__PURE__ */ o("div", { className: a.mainText, children: [
86
+ /* @__PURE__ */ o("div", { className: a.title, children: [
87
+ n.formatMessage({
87
88
  id: "auth.sso_form.title",
88
89
  defaultMessage: "Debate now !"
89
90
  }),
90
91
  /* @__PURE__ */ e("br", {})
91
92
  ] }),
92
- o.formatMessage(
93
+ n.formatMessage(
93
94
  {
94
95
  id: "auth.sso_form.subtitle",
95
96
  defaultMessage: "Sign up right now and receive alerts by email."
96
97
  },
97
- { provider: d }
98
+ { provider: c }
98
99
  )
99
100
  ] }),
100
- P ? null : /* @__PURE__ */ n(m, { children: [
101
+ P ? null : /* @__PURE__ */ o(d, { children: [
101
102
  /* @__PURE__ */ e(
102
- V,
103
+ W,
103
104
  {
104
105
  "data-tid": "link_signup",
105
106
  "data-testid": "signup-button",
106
107
  className: a.loginButton,
107
- to: B,
108
+ to: E,
108
109
  external: !0,
109
110
  border: !1,
110
- children: o.formatMessage({
111
+ children: n.formatMessage({
111
112
  id: "auth.sso_form.signup",
112
113
  defaultMessage: "Sign up"
113
114
  })
114
115
  }
115
116
  ),
116
- R ? null : /* @__PURE__ */ n(m, { children: [
117
- k === !0 ? null : /* @__PURE__ */ n("div", { className: a.cgu, children: [
118
- o.formatMessage({
117
+ R ? null : /* @__PURE__ */ o(d, { children: [
118
+ k === !0 ? null : /* @__PURE__ */ o("div", { className: a.cgu, children: [
119
+ n.formatMessage({
119
120
  id: "auth.sso_form.already_account",
120
121
  defaultMessage: "Already have an account ?"
121
122
  }),
@@ -126,68 +127,70 @@ const oe = ({
126
127
  "data-testid": "signin-link",
127
128
  "data-tid": "link_login",
128
129
  rel: "nofollow",
129
- href: O,
130
- children: o.formatMessage({
130
+ href: B,
131
+ children: n.formatMessage({
131
132
  id: "auth.sso_form.signin",
132
133
  defaultMessage: "Sign in"
133
134
  })
134
135
  }
135
136
  )
136
137
  ] }),
137
- g ? /* @__PURE__ */ e("div", { className: D(a.switchBox), children: /* @__PURE__ */ e(
138
- W,
139
- {
140
- type: "checkbox",
141
- name: "accepts_provider_email",
142
- style: { fontSize: 18 },
143
- checked: h,
144
- label: o.formatMessage(
145
- {
146
- id: "auth.sso_form.consent_label",
147
- defaultMessage: "I agree to receive emails from the editor"
148
- },
149
- { variable: d }
150
- ),
151
- onInputChanged: (t) => A(!h),
152
- "data-testid": "accepts-email-input"
153
- }
154
- ) }) : null,
155
- x ? /* @__PURE__ */ e("div", { className: a.error, children: o.formatMessage({
156
- id: "auth.sso_form.error",
157
- defaultMessage: "An error occurred during sign in. Please try again in a few moments."
158
- }) }) : null,
159
- L && /* @__PURE__ */ n(m, { children: [
160
- /* @__PURE__ */ e("div", { className: a.cguButton, children: /* @__PURE__ */ e(
161
- w,
162
- {
163
- id: "auth.sso_form.terms",
164
- defaultMessage: "By clicking on « Sign up », I declare that I have read the <var1> General Conditions of Use </var1> of the debate space and accept them",
165
- values: {
166
- var1: (t) => /* @__PURE__ */ e(
167
- "a",
168
- {
169
- className: a.termsTarget,
170
- target: "_blank",
171
- href: N,
172
- rel: "noreferrer",
173
- children: t
174
- }
175
- )
176
- }
177
- }
178
- ) }),
179
- /* @__PURE__ */ e("div", { className: a.cguButton, children: /* @__PURE__ */ e(
180
- w,
138
+ x ? null : /* @__PURE__ */ o(d, { children: [
139
+ g ? /* @__PURE__ */ e("div", { className: Y(a.switchBox), children: /* @__PURE__ */ e(
140
+ $,
181
141
  {
182
- id: "auth.sso_form.data_terms",
183
- defaultMessage: "Your personal data are being processed by the Editor. For more information and to exercise your rights, see our personal data policy available on the site."
142
+ type: "checkbox",
143
+ name: "accepts_provider_email",
144
+ style: { fontSize: 18 },
145
+ checked: h,
146
+ label: n.formatMessage(
147
+ {
148
+ id: "auth.sso_form.consent_label",
149
+ defaultMessage: "I agree to receive emails from the editor"
150
+ },
151
+ { variable: c }
152
+ ),
153
+ onInputChanged: (t) => C(!h),
154
+ "data-testid": "accepts-email-input"
184
155
  }
185
- ) })
156
+ ) }) : null,
157
+ A ? /* @__PURE__ */ e("div", { className: a.error, children: n.formatMessage({
158
+ id: "auth.sso_form.error",
159
+ defaultMessage: "An error occurred during sign in. Please try again in a few moments."
160
+ }) }) : null,
161
+ L && /* @__PURE__ */ o(d, { children: [
162
+ /* @__PURE__ */ e("div", { className: a.cguButton, children: /* @__PURE__ */ e(
163
+ w,
164
+ {
165
+ id: "auth.sso_form.terms",
166
+ defaultMessage: "By clicking on « Sign up », I declare that I have read the <var1> General Conditions of Use </var1> of the debate space and accept them",
167
+ values: {
168
+ var1: (t) => /* @__PURE__ */ e(
169
+ "a",
170
+ {
171
+ className: a.termsTarget,
172
+ target: "_blank",
173
+ href: N,
174
+ rel: "noreferrer",
175
+ children: t
176
+ }
177
+ )
178
+ }
179
+ }
180
+ ) }),
181
+ /* @__PURE__ */ e("div", { className: a.cguButton, children: /* @__PURE__ */ e(
182
+ w,
183
+ {
184
+ id: "auth.sso_form.data_terms",
185
+ defaultMessage: "Your personal data are being processed by the Editor. For more information and to exercise your rights, see our personal data policy available on the site."
186
+ }
187
+ ) })
188
+ ] })
186
189
  ] })
187
190
  ] })
188
191
  ] })
189
192
  ] });
190
193
  };
191
194
  export {
192
- oe as SSOForm
195
+ ne as SSOForm
193
196
  };
@@ -1,54 +1,55 @@
1
- import { jsxs as r, jsx as t, Fragment as H } from "react/jsx-runtime";
2
- import { Suspense as J, lazy as O } from "react";
3
- import { useIntl as Q } from "react-intl";
1
+ import { jsxs as r, jsx as t, Fragment as J } from "react/jsx-runtime";
2
+ import { Suspense as O, lazy as Q } from "react";
3
+ import { useIntl as V } from "react-intl";
4
4
  import D from "classnames";
5
5
  import e from "./ContentFooter.module.scss.js";
6
- import { useConfig as V } from "../../data/config_provider/useConfig.js";
7
- import { useAuth as X } from "../../auth/use_auth/useAuth.js";
8
- import { useModal as Y } from "../../dialog/modal/useModal.js";
9
- import { useInput as Z } from "../../input/input_provider/useInput.js";
10
- import { useReportContent as $ } from "../use_report_content/useReportContent.js";
11
- import { useDeleteContent as tt } from "../use_delete_content/useDeleteContent.js";
12
- import { useResponsive as et } from "../../hooks/use_responsive/useResponsive.js";
13
- import { Link as ot } from "../../action/link/Link.js";
6
+ import { useConfig as X } from "../../data/config_provider/useConfig.js";
7
+ import { useAuth as Y } from "../../auth/use_auth/useAuth.js";
8
+ import { useModal as Z } from "../../dialog/modal/useModal.js";
9
+ import { useInput as $ } from "../../input/input_provider/useInput.js";
10
+ import { useReportContent as tt } from "../use_report_content/useReportContent.js";
11
+ import { useDeleteContent as et } from "../use_delete_content/useDeleteContent.js";
12
+ import { useResponsive as ot } from "../../hooks/use_responsive/useResponsive.js";
13
+ import { Link as nt } from "../../action/link/Link.js";
14
14
  import { Icon as c } from "../../icons/icon/Icon.js";
15
- import { ShareButton as nt } from "../../share/share_button/ShareButton.js";
16
- import { Dropdown as at } from "../../dialog/dropdown/Dropdown.js";
17
- const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ default: o.ShareModal }))), Dt = ({
15
+ import { ShareButton as at } from "../../share/share_button/ShareButton.js";
16
+ import { Dropdown as rt } from "../../dialog/dropdown/Dropdown.js";
17
+ const it = Q(() => import("../../share/share_modal/index.js").then((o) => ({ default: o.ShareModal }))), bt = ({
18
18
  resource: o,
19
19
  reportType: b,
20
20
  deleteType: I,
21
21
  deleteListId: k,
22
22
  softDelete: N = !1,
23
23
  disabled: x = !1,
24
- children: C,
25
- enableReply: S,
26
- handleReplyTo: A,
27
- showActions: K = !0,
28
- showShareButton: E = !0,
29
- shareModal: R,
24
+ disableEdition: C = !1,
25
+ children: S,
26
+ enableReply: A,
27
+ handleReplyTo: K,
28
+ showActions: E = !0,
29
+ showShareButton: R = !0,
30
+ shareModal: z,
30
31
  shareUrl: m,
31
32
  shareTitle: p,
32
33
  shareText: u,
33
- shareModalTitle: z,
34
+ shareModalTitle: P,
34
35
  showShareCode: f,
35
36
  shareCode: h,
36
- showShareText: P,
37
- enableEdition: T = !0,
38
- enableDeletion: j = !0,
39
- enableReport: F = !0,
40
- containerClassName: B,
41
- voteActionClassName: L,
37
+ showShareText: T,
38
+ enableEdition: j = !0,
39
+ enableDeletion: F = !0,
40
+ enableReport: B = !0,
41
+ containerClassName: L,
42
+ voteActionClassName: U,
42
43
  replyRedirectUrl: _
43
44
  }) => {
44
- const n = Q(), g = V(), { currentUser: d } = X(), { showModal: U } = Y(), { setInputContent: W } = Z() || {}, { reportContent: y } = $(b, o.id), { deleteContent: w } = tt(
45
+ const n = V(), g = X(), { currentUser: d } = Y(), { showModal: W } = Z(), { setInputContent: q } = $() || {}, { reportContent: y } = tt(b, o.id), { deleteContent: w } = et(
45
46
  o,
46
47
  I,
47
48
  k,
48
49
  N
49
- ), { elementWidth: l } = et(), q = () => d?.id ? o.author?.id === d?.id || o.debate_suggestion?.author?.id === d?.id : !1, M = () => {
50
- W(o);
51
- }, G = () => {
50
+ ), { elementWidth: l } = ot(), G = () => d?.id ? o.author?.id === d?.id || o.debate_suggestion?.author?.id === d?.id : !1, M = () => {
51
+ q(o);
52
+ }, H = () => {
52
53
  if (o.created_at && g.actions?.editionTime) {
53
54
  const a = new Date(
54
55
  new Date(o.created_at).setSeconds(
@@ -59,14 +60,14 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
59
60
  }
60
61
  return !0;
61
62
  }, v = () => {
62
- U(
63
- /* @__PURE__ */ t(J, { fallback: null, children: /* @__PURE__ */ t(
64
- rt,
63
+ W(
64
+ /* @__PURE__ */ t(O, { fallback: null, children: /* @__PURE__ */ t(
65
+ it,
65
66
  {
66
67
  shareUrl: m,
67
68
  shareTitle: p,
68
69
  shareText: u,
69
- title: z,
70
+ title: P,
70
71
  showShareCode: f,
71
72
  shareCode: h
72
73
  }
@@ -75,20 +76,20 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
75
76
  }, i = (a) => (s) => {
76
77
  (s.key === "Enter" || s.key === " ") && (s.preventDefault(), a());
77
78
  };
78
- return /* @__PURE__ */ r("div", { className: D(e.container, B), children: [
79
+ return /* @__PURE__ */ r("div", { className: D(e.container, L), children: [
79
80
  /* @__PURE__ */ t(
80
81
  "div",
81
82
  {
82
83
  onKeyDown: (a) => {
83
84
  (a.key === "Enter" || a.key === " ") && (a.preventDefault(), onClick());
84
85
  },
85
- className: D(e.voteAction, L),
86
+ className: D(e.voteAction, U),
86
87
  "data-tid": "action_vote_argument",
87
- children: C
88
+ children: S
88
89
  }
89
90
  ),
90
- !x && S && /* @__PURE__ */ t("div", { "data-tid": "action_reply_argument", "data-testid": "reply-button", children: _ ? /* @__PURE__ */ r(
91
- ot,
91
+ !x && A && /* @__PURE__ */ t("div", { "data-tid": "action_reply_argument", "data-testid": "reply-button", children: _ ? /* @__PURE__ */ r(
92
+ nt,
92
93
  {
93
94
  to: _,
94
95
  className: e.replyAction,
@@ -115,7 +116,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
115
116
  {
116
117
  type: "button",
117
118
  className: e.replyAction,
118
- onClick: A,
119
+ onClick: K,
119
120
  "data-testid": "action-reply-button",
120
121
  children: [
121
122
  /* @__PURE__ */ t(
@@ -134,20 +135,20 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
134
135
  ]
135
136
  }
136
137
  ) }),
137
- E && /* @__PURE__ */ t(
138
- nt,
138
+ R && /* @__PURE__ */ t(
139
+ at,
139
140
  {
140
141
  shareUrl: m,
141
142
  shareTitle: p,
142
143
  shareText: u,
143
144
  showShareCode: f,
144
145
  shareCode: h,
145
- showText: !(l < 768) && P,
146
+ showText: !(l < 768) && T,
146
147
  iconSize: 17,
147
148
  popoverPosition: "top"
148
149
  }
149
150
  ),
150
- K && /* @__PURE__ */ t(
151
+ E && /* @__PURE__ */ t(
151
152
  "div",
152
153
  {
153
154
  className: e.moreAction,
@@ -156,7 +157,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
156
157
  defaultMessage: "More options"
157
158
  }),
158
159
  children: /* @__PURE__ */ r(
159
- at,
160
+ rt,
160
161
  {
161
162
  className: e.moreActionDropdown,
162
163
  horizontalPosition: "right",
@@ -176,8 +177,8 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
176
177
  }
177
178
  ),
178
179
  /* @__PURE__ */ r("div", { children: [
179
- q() && /* @__PURE__ */ r(H, { children: [
180
- T && G() && /* @__PURE__ */ t(
180
+ G() && /* @__PURE__ */ r(J, { children: [
181
+ !C && j && H() && /* @__PURE__ */ t(
181
182
  "div",
182
183
  {
183
184
  "data-tid": "action_edit_argument",
@@ -191,7 +192,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
191
192
  })
192
193
  }
193
194
  ),
194
- j && /* @__PURE__ */ t(
195
+ F && /* @__PURE__ */ t(
195
196
  "div",
196
197
  {
197
198
  "data-tid": "action_delete_argument",
@@ -206,7 +207,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
206
207
  }
207
208
  )
208
209
  ] }),
209
- F && /* @__PURE__ */ t(
210
+ B && /* @__PURE__ */ t(
210
211
  "div",
211
212
  {
212
213
  "data-tid": "action_report_argument",
@@ -221,7 +222,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
221
222
  })
222
223
  }
223
224
  ),
224
- R && /* @__PURE__ */ t(
225
+ z && /* @__PURE__ */ t(
225
226
  "div",
226
227
  {
227
228
  "data-tid": "action_share_argument",
@@ -244,5 +245,5 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
244
245
  ] });
245
246
  };
246
247
  export {
247
- Dt as ContentFooter
248
+ bt as ContentFooter
248
249
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logora/debate",
3
- "version": "0.4.38",
3
+ "version": "0.4.40",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0",
6
6
  "description": "Design system of @Logora made with React",