@logora/debate 0.1.1 → 0.2.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.
Files changed (58) hide show
  1. package/README.md +14 -23
  2. package/dist/components/action/button/Button.js +1 -1
  3. package/dist/components/argument/argument/Argument.js +49 -49
  4. package/dist/components/argument/top_arguments/TopArguments.js +17 -17
  5. package/dist/components/auth/auth_initializer/AuthInitializer.js +5 -5
  6. package/dist/components/auth/auth_modal/AuthModal.js +9 -9
  7. package/dist/components/auth/login_form/LoginForm.js +1 -0
  8. package/dist/components/auth/oauth2_button/OAuth2Button.js +3 -3
  9. package/dist/components/auth/providers/AuthProviderFactory.js +4 -4
  10. package/dist/components/auth/signup_form/SignupForm.js +4 -4
  11. package/dist/components/auth/social_auth_form/SocialAuthForm.js +10 -10
  12. package/dist/components/auth/sso_form/SSOForm.js +4 -4
  13. package/dist/components/chart/line_chart/LineChart.js +10 -10
  14. package/dist/components/chart/pie_chart/PieChart.js +6 -10
  15. package/dist/components/consultation/consultation_box/ConsultationBox.js +19 -14
  16. package/dist/components/debate/debate_box/DebateBox.js +11 -11
  17. package/dist/components/dialog/drawer/Drawer.js +16 -16
  18. package/dist/components/dialog/modal/Modal.js +8 -8
  19. package/dist/components/dialog/toast_provider/ToastProvider.js +10 -10
  20. package/dist/components/hooks/use_responsive/ResponsiveProvider.js +4 -4
  21. package/dist/components/input/argument_input/ArgumentInput.js +100 -99
  22. package/dist/components/input/search_input/SearchInput.js +4 -4
  23. package/dist/components/input/text_editor/TextEditor.js +50 -50
  24. package/dist/components/input/text_editor/lexicalToHtml.js +7 -7
  25. package/dist/components/input/text_editor/plugins/MaxLengthPlugin.js +12 -12
  26. package/dist/components/input/text_editor/plugins/ResetPlugin.js +6 -6
  27. package/dist/components/input/text_editor/plugins/SetContentPlugin.js +6 -6
  28. package/dist/components/input/text_editor/plugins/ToolbarPlugin.js +21 -21
  29. package/dist/components/intl/intl_provider/IntlProvider.js +6 -6
  30. package/dist/components/list/paginated_list/PaginatedList.js +16 -16
  31. package/dist/components/list/paginated_list/VotePaginatedList.js +6 -6
  32. package/dist/components/list/paginated_list/action_bar/ActionBar.js +7 -7
  33. package/dist/components/navbar/navbar_button/NavbarButton.js +3 -3
  34. package/dist/components/navbar/navbar_modal/NavbarModal.js +11 -11
  35. package/dist/components/notification/notification_menu/NotificationMenu.js +4 -4
  36. package/dist/components/proposal/proposal_box/ProposalBox.js +8 -8
  37. package/dist/components/share/share_box/ShareBox.js +17 -17
  38. package/dist/components/source/context_source_list/ContextSourceList.js +3 -3
  39. package/dist/components/source/source_modal/SourceModal.js +16 -16
  40. package/dist/components/suggestion/suggestion_banner/SuggestionBanner.js +14 -14
  41. package/dist/components/suggestion/suggestion_box/SuggestionBox.js +6 -6
  42. package/dist/components/suggestion/suggestion_input/SuggestionInput.js +13 -12
  43. package/dist/components/user/avatar/Avatar.js +7 -7
  44. package/dist/components/user/update_user_info_modal/UpdateUserInfoModal.js +17 -15
  45. package/dist/components/user_content/content_footer/ContentFooter.js +11 -11
  46. package/dist/components/user_content/summary_content_box/SummaryContentBox.js +6 -6
  47. package/dist/components/user_content/use_delete_content/useDeleteContent.js +7 -7
  48. package/dist/components/user_content/use_report_content/ReportModal.js +9 -9
  49. package/dist/components/vote/use_vote/useVote.js +3 -3
  50. package/dist/components/vote/vote_box/VoteBox.js +7 -7
  51. package/dist/index.js +56 -56
  52. package/dist/node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalCharacterLimitPlugin.prod.js +57 -57
  53. package/dist/node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalComposer.prod.js +14 -14
  54. package/dist/node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalContentEditable.prod.js +15 -15
  55. package/dist/node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalListPlugin.prod.js +6 -6
  56. package/dist/node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalOnChangePlugin.prod.js +1 -1
  57. package/dist/node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalRichTextPlugin.prod.js +21 -21
  58. package/package.json +6 -1
@@ -5,16 +5,16 @@ import { require_classnames as r } from "../../../node_modules/.pnpm/classnames@
5
5
  import { useAuth as i } from "../../auth/use_auth/useAuth.js";
6
6
  import { useDataProvider as ee } from "../../data/data_provider/useDataProvider.js";
7
7
  import { useConfig as te } from "../../data/config_provider/useConfig.js";
8
- import ne from "../../../node_modules/.pnpm/react-intl@7.1.14_react@18.3.1_typescript@5.9.3/node_modules/react-intl/lib/src/components/useIntl.js";
8
+ import { useResponsive as ne } from "../../hooks/use_responsive/useResponsive.js";
9
+ import { useList as re } from "../../list/list_provider/useList.js";
10
+ import ie from "../../../node_modules/.pnpm/react-intl@7.1.14_react@18.3.1_typescript@5.9.3/node_modules/react-intl/lib/src/components/useIntl.js";
9
11
  import a from "../../../node_modules/.pnpm/react-intl@7.1.14_react@18.3.1_typescript@5.9.3/node_modules/react-intl/lib/src/components/message.js";
10
- import { Avatar as re } from "../../user/avatar/Avatar.js";
11
- import { AuthorBox as ie } from "../../user/author_box/AuthorBox.js";
12
- import { useInput as ae } from "../input_provider/useInput.js";
13
- import { useModal as oe } from "../../dialog/modal/useModal.js";
14
- import { useAuthRequired as se } from "../../hooks/use_auth_required/useAuthRequired.js";
15
- import { useList as ce } from "../../list/list_provider/useList.js";
16
- import { useToast as le } from "../../dialog/toast_provider/useToast.js";
17
- import { useResponsive as ue } from "../../hooks/use_responsive/useResponsive.js";
12
+ import { useModal as ae } from "../../dialog/modal/useModal.js";
13
+ import { useInput as oe } from "../input_provider/useInput.js";
14
+ import { useToast as se } from "../../dialog/toast_provider/useToast.js";
15
+ import { useAuthRequired as ce } from "../../hooks/use_auth_required/useAuthRequired.js";
16
+ import { Avatar as le } from "../../user/avatar/Avatar.js";
17
+ import { AuthorBox as ue } from "../../user/author_box/AuthorBox.js";
18
18
  import { TextEditor as de } from "../text_editor/TextEditor.js";
19
19
  import fe from "../../../node_modules/.pnpm/@rooks_use-sessionstorage-state@4.11.2_react@18.3.1/node_modules/@rooks/use-sessionstorage-state/lib/index.esm.js";
20
20
  import { useFormValidation as pe } from "../../forms/use_form_validation/useFormValidation.js";
@@ -23,40 +23,40 @@ import o from "./ArgumentInput.module.js";
23
23
  import { Suspense as he, lazy as s, useEffect as c, useRef as ge, useState as l } from "react";
24
24
  import { useLocation as _e } from "react-router";
25
25
  //#region src/components/input/argument_input/ArgumentInput.jsx
26
- var u = t(), d = /* @__PURE__ */ e(r()), ve = s(() => import("../../modal/side_modal/index.js")), f = ({ argumentListId: e, avatarSize: t = 48, disabled: r = !1, positions: s = [], disabledPositions: f = [], groupId: p, groupName: ye, groupType: m, hideSourceAction: be = !1, isReply: h = !1, onSubmit: xe, parentId: g, placeholder: Se, positionId: _, focusOnInit: Ce = !1, activeOnInit: v = !1, userGuideUrl: we, hideUserGuideLink: Te = !1, hideCharCount: Ee = !1, disableAutoActivate: De = !1 }) => {
27
- let y = ne(), Oe = ee(), b = ce(), x = te(), { focus: S, setFocus: C, setReset: ke, inputContent: w, setInputContent: Ae, setInputRichContent: je } = ae(), { isLoggedIn: T, currentUser: E } = i(), { errors: D, validate: O } = pe(), { isMobile: k } = ue(), Me = _e(), A = ge(null), [j, M] = l([]), [N, P] = l(""), [F, I] = l(null), [L, R] = l(null), [z, B] = l(null), [V, H] = l(!1), [U, W] = l(!1), [G, K] = l({}), [q, Ne] = fe("userSide", {}), [J, Pe] = l(!T && x?.actions?.disableInputForVisitor), Y = se(), { showModal: Fe } = oe(), { toast: X } = le() || {}, Z = new URLSearchParams(typeof window < "u" ? window.location.search : Me.search);
26
+ var u = t(), d = /* @__PURE__ */ e(r()), ve = s(() => import("../../modal/side_modal/index.js")), f = ({ argumentListId: e, avatarSize: t = 48, disabled: r = !1, positions: s = [], disabledPositions: f = [], groupId: p, groupName: ye, groupType: m, hideSourceAction: be = !1, isReply: h = !1, onSubmit: g, parentId: _, placeholder: xe, positionId: v, focusOnInit: Se = !1, activeOnInit: y = !1, userGuideUrl: b, hideUserGuideLink: Ce = !1, hideCharCount: we = !1, disableAutoActivate: Te = !1 }) => {
27
+ let x = ie(), Ee = ee(), S = re(), C = te(), { focus: De, setFocus: w, setReset: Oe, inputContent: T, setInputContent: ke, setInputRichContent: Ae } = oe(), { isLoggedIn: E, currentUser: D } = i(), { errors: O, validate: k } = pe(), { isMobile: A } = ne(), je = _e(), j = ge(null), [M, N] = l([]), [P, F] = l(""), [I, L] = l(null), [R, z] = l(null), [B, V] = l(null), [H, U] = l(!1), [W, G] = l(!1), [K, q] = l({}), [J, Me] = fe("userSide", {}), [Y, Ne] = l(!E && C?.actions?.disableInputForVisitor), X = ce(), { showModal: Pe } = ae(), { toast: Z } = se() || {}, Fe = new URLSearchParams(typeof window < "u" ? window.location.search : je.search);
28
28
  c(() => {
29
- Pe(!T && x?.actions?.disableInputForVisitor);
30
- }, [T, x]);
31
- let Q = E?.role === "editor" || E?.role === "moderator", Ie = E?.moderation_status === "banned";
29
+ Ne(!E && C?.actions?.disableInputForVisitor);
30
+ }, [E, C]);
31
+ let Q = D?.role === "editor" || D?.role === "moderator", Ie = D?.moderation_status === "banned";
32
32
  c(() => {
33
33
  let e = null;
34
- typeof window < "u" && (e = Z.get("positionId")), _ && _ != s[2]?.id && s?.find((e) => e.id === _) ? R(_) : e && e != s[2]?.id ? R(e) : q && q.groupId == p && q.positionId != s[2]?.id && R(q.positionId);
35
- }, [_]), c(() => {
36
- v && ($(), C(!0));
34
+ typeof window < "u" && (e = Fe.get("positionId")), v && v != s[2]?.id && s?.find((e) => e.id === v) ? z(v) : e && e != s[2]?.id ? z(e) : J && J.groupId == p && J.positionId != s[2]?.id && z(J.positionId);
37
35
  }, [v]), c(() => {
36
+ y && ($(), w(!0));
37
+ }, [y]), c(() => {
38
38
  if (typeof window < "u") {
39
- let e = Ce || Z.get("initArgument");
40
- (e === !0 || e === "true") && (C(!0), Je());
39
+ let e = Se || Fe.get("initArgument");
40
+ (e === !0 || e === "true") && (w(!0), Je());
41
41
  }
42
42
  }, []), c(() => {
43
- S && (Re(), C(!1));
44
- }, [S]), c(() => {
45
- w?.id && (Le(w), C(!0));
46
- }, [w]);
43
+ De && (Re(), w(!1));
44
+ }, [De]), c(() => {
45
+ T?.id && (Le(T), w(!0));
46
+ }, [T]);
47
47
  let Le = (e) => {
48
- K(e), W(!0), M(e.sources), P(e.content), I(e.rich_content), B(e.id), Re(), R(e.position?.id), JSON.parse(e.rich_content).hasOwnProperty("root") ? je(e.rich_content) : Ae(e.content);
48
+ q(e), G(!0), N(e.sources), F(e.content), L(e.rich_content), V(e.id), Re(), z(e.position?.id), JSON.parse(e.rich_content).hasOwnProperty("root") ? Ae(e.rich_content) : ke(e.content);
49
49
  }, Re = () => {
50
- A.current.scrollIntoView(!1);
50
+ j.current.scrollIntoView(!1);
51
51
  }, ze = () => {
52
- P(""), I(null), K({}), B(null), M([]), ke(!0);
52
+ F(""), L(null), q({}), V(null), N([]), Oe(!0);
53
53
  }, Be = (e) => {
54
- R(e), Ke(e);
54
+ z(e), Ke(e);
55
55
  }, Ve = () => {
56
- Fe(/* @__PURE__ */ (0, u.jsx)(he, {
56
+ Pe(/* @__PURE__ */ (0, u.jsx)(he, {
57
57
  fallback: null,
58
58
  children: /* @__PURE__ */ (0, u.jsx)(ve, {
59
- modalTitle: y.formatMessage({
59
+ modalTitle: x.formatMessage({
60
60
  id: "modal.side_modal.modal_title",
61
61
  defaultMessage: "Choose your side"
62
62
  }),
@@ -64,59 +64,59 @@ var u = t(), d = /* @__PURE__ */ e(r()), ve = s(() => import("../../modal/side_m
64
64
  positions: s,
65
65
  title: ye,
66
66
  disabledPositions: !h && f,
67
- isNeutral: q && q.groupId == p && q.positionId === s[2]?.id
67
+ isNeutral: J && J.groupId == p && J.positionId === s[2]?.id
68
68
  })
69
69
  }));
70
70
  }, He = () => {
71
- T ? z ? qe() : !s || s?.length === 0 || !f?.find((e) => e?.id === L) && L || Q && h ? Ke(h && Q && s[0]?.id) : Ve() : Y({ loginAction: "argument" });
71
+ E ? B ? qe() : !s || s?.length === 0 || !f?.find((e) => e?.id === R) && R || Q && h ? Ke(h && Q && s[0]?.id) : Ve() : X({ loginAction: "argument" });
72
72
  }, Ue = (e, t) => {
73
- J ? Y({ loginAction: "argument" }) : (P(e), I(t), O({ content: e }, [{ content: ["url", null] }]));
73
+ Y ? X({ loginAction: "argument" }) : (F(e), L(t), k({ content: e }, [{ content: ["url", null] }]));
74
74
  }, We = (e) => {
75
- M(e);
75
+ N(e);
76
76
  }, Ge = [
77
77
  { content: ["length", 3] },
78
78
  { content: ["required", null] },
79
79
  { content: ["url", null] },
80
80
  ...!s || s?.length === 0 ? [] : [{ position_id: ["required", null] }]
81
81
  ], Ke = (t) => {
82
- let n = t || L, r = {
83
- content: N,
84
- rich_content: F,
82
+ let n = t || R, r = {
83
+ content: P,
84
+ rich_content: I,
85
85
  group_id: p,
86
86
  ...m && { group_type: m },
87
87
  ...n && { position_id: n },
88
- is_reply: !!g,
89
- message_id: g || null,
90
- source_ids: j?.map((e) => e.id)
88
+ is_reply: !!_,
89
+ message_id: _ || null,
90
+ source_ids: M?.map((e) => e.id)
91
91
  };
92
- O(r, Ge) && (n && s && s.map((e) => e.id).includes(n) && Ne({
92
+ k(r, Ge) && (n && s && s.map((e) => e.id).includes(n) && Me({
93
93
  groupId: p,
94
94
  positionId: n
95
- }), ze(), Oe.create("messages", r).then((t) => {
95
+ }), ze(), Ee.create("messages", r).then((t) => {
96
96
  if (t.data.success) {
97
- if (g) xe(t.data.data.resource), X(y.formatMessage({
97
+ if (_) g(t.data.data.resource), Z(x.formatMessage({
98
98
  id: "alert.argument_create",
99
99
  defaultMessage: "Your contribution has been sent !"
100
100
  }), {
101
101
  type: "success",
102
- points: y.formatMessage({
102
+ points: x.formatMessage({
103
103
  id: "alert.reply_gain",
104
104
  defaultMessage: " "
105
105
  })
106
106
  });
107
107
  else {
108
108
  let r = t.data.data.resource, i = e;
109
- n && !k && (i = `argumentList${r.position.id}`), xe?.(N, s.find((e) => e.id === n) || null), b.add(i, [r]), X(y.formatMessage({
109
+ n && !A && (i = `argumentList${r.position.id}`), g?.(P, s.find((e) => e.id === n) || null), S.add(i, [r]), Z(x.formatMessage({
110
110
  id: "alert.argument_create",
111
111
  defaultMessage: "Your contribution has been sent !"
112
112
  }), {
113
113
  type: "success",
114
- points: y.formatMessage({
114
+ points: x.formatMessage({
115
115
  id: "alert.argument_create_gain",
116
116
  defaultMessage: "Up to 10 eloquence points"
117
117
  }),
118
118
  category: "ARGUMENT",
119
- contentKey: E.messages_count === 2 ? "alert.third_argument" : "alert.first_argument"
119
+ contentKey: D.messages_count === 2 ? "alert.third_argument" : "alert.first_argument"
120
120
  });
121
121
  }
122
122
  typeof window < "u" && window.dispatchEvent(new CustomEvent("logora:user_content:created", { detail: { content: t.data.data?.resource } }));
@@ -124,34 +124,34 @@ var u = t(), d = /* @__PURE__ */ e(r()), ve = s(() => import("../../modal/side_m
124
124
  }));
125
125
  }, qe = () => {
126
126
  let t = {
127
- content: N,
128
- rich_content: F,
129
- source_ids: j?.map((e) => e.id),
130
- ...L && { position_id: L }
127
+ content: P,
128
+ rich_content: I,
129
+ source_ids: M?.map((e) => e.id),
130
+ ...R && { position_id: R }
131
131
  };
132
- O(t, Ge) && Oe.update("messages", z, t).then((t) => {
132
+ k(t, Ge) && Ee.update("messages", B, t).then((t) => {
133
133
  if (t.data.success) {
134
134
  let n = t.data.data.resource, r = e;
135
- if (L && !k && (r = `argumentList${n.position?.id}`), G?.position?.id != n.position?.id && !k && !n.is_reply) {
136
- let e = `argumentList${G.position.id}`, t = `argumentList${n.position.id}`;
137
- b.remove(e, [n]), b.add(t, [n]);
138
- } else b.update(r, [n]);
139
- X(y.formatMessage({ id: "alert.argument_modify" }), { type: "success" }), ze();
135
+ if (R && !A && (r = `argumentList${n.position?.id}`), K?.position?.id != n.position?.id && !A && !n.is_reply) {
136
+ let e = `argumentList${K.position.id}`, t = `argumentList${n.position.id}`;
137
+ S.remove(e, [n]), S.add(t, [n]);
138
+ } else S.update(r, [n]);
139
+ Z(x.formatMessage({ id: "alert.argument_modify" }), { type: "success" }), ze();
140
140
  }
141
141
  });
142
142
  }, Je = () => {
143
- if (!V) {
144
- H(!0);
143
+ if (!H) {
144
+ U(!0);
145
145
  let e = setTimeout(() => {
146
- H(!1);
146
+ U(!1);
147
147
  }, 2e3);
148
148
  return () => clearTimeout(e);
149
149
  }
150
150
  }, $ = () => {
151
- J ? Y({ loginAction: "argument" }) : W(!0);
151
+ Y ? X({ loginAction: "argument" }) : G(!0);
152
152
  }, Ye = () => {
153
- let e = f.find((e) => e.id === L);
154
- if (e) return y.formatMessage({
153
+ let e = f.find((e) => e.id === R);
154
+ if (e) return x.formatMessage({
155
155
  id: "info.argument_side_limit",
156
156
  defaultMessage: "You have reached the argument limit (10) for position {position}."
157
157
  }, { position: e.name });
@@ -160,53 +160,53 @@ var u = t(), d = /* @__PURE__ */ e(r()), ve = s(() => import("../../modal/side_m
160
160
  className: o.inputContainer,
161
161
  children: [r && /* @__PURE__ */ (0, u.jsx)("div", {
162
162
  className: o.disabledInputMask,
163
- children: Ie ? y.formatMessage({
163
+ children: Ie ? x.formatMessage({
164
164
  id: "input.argument_input.user_banned",
165
165
  defaultMessage: "You are banned from the debate space."
166
- }) : y.formatMessage({
166
+ }) : x.formatMessage({
167
167
  id: "info.debate_is_inactive",
168
168
  defaultMessage: "Debate is closed"
169
169
  })
170
170
  }), /* @__PURE__ */ (0, u.jsx)("div", {
171
171
  className: (0, d.default)(o.argumentInput, {
172
- [o.flash]: V,
172
+ [o.flash]: H,
173
173
  [o.replyInputContainer]: h
174
174
  }),
175
175
  children: /* @__PURE__ */ (0, u.jsx)("div", {
176
176
  "data-tid": "action_add_argument",
177
- ref: A,
177
+ ref: j,
178
178
  children: /* @__PURE__ */ (0, u.jsxs)("div", {
179
179
  className: o.argumentInputBox,
180
- children: [s.length > 0 && T && (!h || !Q) && /* @__PURE__ */ (0, u.jsxs)("div", {
180
+ children: [s.length > 0 && E && (!h || !Q) && /* @__PURE__ */ (0, u.jsxs)("div", {
181
181
  className: o.userPosition,
182
- children: [/* @__PURE__ */ (0, u.jsx)("div", { children: y.formatMessage({
182
+ children: [/* @__PURE__ */ (0, u.jsx)("div", { children: x.formatMessage({
183
183
  id: "input.position",
184
184
  defaultMessage: "Your position"
185
185
  }) }), /* @__PURE__ */ (0, u.jsx)(me, {
186
- activeLabel: L === s[0].id ? 0 : L === s[1].id ? 1 : null,
186
+ activeLabel: R === s[0].id ? 0 : R === s[1].id ? 1 : null,
187
187
  firstLabel: s[0],
188
188
  secondLabel: s[1],
189
- onChange: (e) => R(s[e].id)
189
+ onChange: (e) => z(s[e].id)
190
190
  })]
191
191
  }), /* @__PURE__ */ (0, u.jsxs)("div", {
192
192
  className: (0, d.default)(o.argumentTextInputBox, {
193
- [o.argumentTextInputBoxisTablet]: !k,
193
+ [o.argumentTextInputBoxisTablet]: !A,
194
194
  [o.replyEditorRow]: h
195
195
  }),
196
196
  children: [/* @__PURE__ */ (0, u.jsx)("div", {
197
197
  className: (0, d.default)(o.argumentAuthorContainer, {
198
- [o.argumentAuthorContainerMobile]: k,
199
- [o.argumentAuthorContainerActivated]: !k && U || h
198
+ [o.argumentAuthorContainerMobile]: A,
199
+ [o.argumentAuthorContainerActivated]: !A && W || h
200
200
  }),
201
- children: !k && U || h ? /* @__PURE__ */ (0, u.jsx)(re, {
202
- avatarUrl: E.image_url,
203
- userName: E.full_name,
201
+ children: !A && W || h ? /* @__PURE__ */ (0, u.jsx)(le, {
202
+ avatarUrl: D.image_url,
203
+ userName: D.full_name,
204
204
  size: t
205
- }) : /* @__PURE__ */ (0, u.jsx)(ie, {
206
- fullName: E?.full_name || y.formatMessage({ id: "default_author.full_name" }),
207
- avatarUrl: E?.image_url,
208
- points: E?.points || 0,
209
- slug: E?.hash_id
205
+ }) : /* @__PURE__ */ (0, u.jsx)(ue, {
206
+ fullName: D?.full_name || x.formatMessage({ id: "default_author.full_name" }),
207
+ avatarUrl: D?.image_url,
208
+ points: D?.points || 0,
209
+ slug: D?.hash_id
210
210
  })
211
211
  }), /* @__PURE__ */ (0, u.jsxs)("div", {
212
212
  onClick: $,
@@ -220,32 +220,32 @@ var u = t(), d = /* @__PURE__ */ e(r()), ve = s(() => import("../../modal/side_m
220
220
  handleSourcesChange: (e) => {
221
221
  We(e);
222
222
  },
223
- placeholder: Se,
224
- "aria-label": y.formatMessage({
223
+ placeholder: xe,
224
+ "aria-label": x.formatMessage({
225
225
  id: "input.argument_input.aria_label",
226
226
  defaultMessage: "Message input field"
227
227
  }),
228
228
  onSubmit: He,
229
- sources: j,
230
- hideSourceAction: be || J,
229
+ sources: M,
230
+ hideSourceAction: be || Y,
231
231
  uid: `Argument${p}`,
232
232
  onActivation: $,
233
- showStylesControls: U,
234
- disabled: r || J || Ie,
235
- maxLength: J ? !1 : x?.actions?.argumentMaxLength,
236
- disableRichText: x?.actions?.disableRichText || J,
233
+ showStylesControls: W,
234
+ disabled: r || Y || Ie,
235
+ maxLength: Y ? !1 : C?.actions?.argumentMaxLength,
236
+ disableRichText: C?.actions?.disableRichText || Y,
237
237
  shortBar: h,
238
- hideSubmit: J,
239
- allowedDomains: x?.allowed_sources,
240
- active: v,
241
- hideCharCount: Ee,
242
- disableAutoActivate: De
238
+ hideSubmit: Y,
239
+ allowedDomains: C?.allowed_sources,
240
+ active: y,
241
+ hideCharCount: we,
242
+ disableAutoActivate: Te
243
243
  }),
244
- D?.content && /* @__PURE__ */ (0, u.jsx)("div", {
244
+ O?.content && /* @__PURE__ */ (0, u.jsx)("div", {
245
245
  className: o.argumentInputWarning,
246
- children: D && Object.values(D).map((e, t) => /* @__PURE__ */ (0, u.jsx)("div", { children: e }, t))
246
+ children: O && Object.values(O).map((e, t) => /* @__PURE__ */ (0, u.jsx)("div", { children: e }, t))
247
247
  }),
248
- U && f?.find((e) => e.id === L) && /* @__PURE__ */ (0, u.jsxs)("div", {
248
+ W && f?.find((e) => e.id === R) && /* @__PURE__ */ (0, u.jsxs)("div", {
249
249
  className: (0, d.default)(o.argumentInputWarning, o.disabledPositionWarning),
250
250
  children: [/* @__PURE__ */ (0, u.jsx)(n, {
251
251
  name: "announcement",
@@ -257,15 +257,16 @@ var u = t(), d = /* @__PURE__ */ e(r()), ve = s(() => import("../../modal/side_m
257
257
  children: Ye()
258
258
  })]
259
259
  }),
260
- U && we && !Te && /* @__PURE__ */ (0, u.jsx)("div", {
260
+ W && b && !Ce && /* @__PURE__ */ (0, u.jsx)("div", {
261
261
  className: o.guideMessage,
262
262
  children: /* @__PURE__ */ (0, u.jsx)(a, {
263
263
  id: "alert.guide_message",
264
264
  defaultMessage: "Contributions must comply with our {userCharter}.",
265
265
  values: { userCharter: /* @__PURE__ */ (0, u.jsx)("a", {
266
266
  className: o.guideMessage,
267
- href: we,
267
+ href: b,
268
268
  target: "_blank",
269
+ rel: "noreferrer",
269
270
  children: /* @__PURE__ */ (0, u.jsx)(a, {
270
271
  id: "alert.user_charter",
271
272
  defaultMessage: "user charter"
@@ -1,14 +1,14 @@
1
1
  import { require_jsx_runtime as e } from "../../../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
2
2
  import { Icon as t } from "../../icons/icon/Icon.js";
3
3
  import n from "../../../node_modules/.pnpm/react-intl@7.1.14_react@18.3.1_typescript@5.9.3/node_modules/react-intl/lib/src/components/useIntl.js";
4
- import { useOnClickOutside as r } from "../../../node_modules/.pnpm/use-onclickoutside@0.4.1_@types_react@19.2.14_react@18.3.1/node_modules/use-onclickoutside/dist/use-onclickoutside.browser.esm.js";
5
- import { TextInput as i } from "../text_input/TextInput.js";
4
+ import { TextInput as r } from "../text_input/TextInput.js";
5
+ import { useOnClickOutside as i } from "../../../node_modules/.pnpm/use-onclickoutside@0.4.1_@types_react@19.2.14_react@18.3.1/node_modules/use-onclickoutside/dist/use-onclickoutside.browser.esm.js";
6
6
  import a from "./SearchInput.module.js";
7
7
  import { useRef as o, useState as s } from "react";
8
8
  //#region src/components/input/search_input/SearchInput.jsx
9
9
  var c = e(), l = ({ onSearchSubmit: e, placeholder: l, disabled: u, reducedByDefault: d }) => {
10
10
  let f = n(), [p, m] = s(""), [h, g] = s(!1), _ = o(null);
11
- r(_, d ? () => g(!1) : null);
11
+ i(_, d ? () => g(!1) : null);
12
12
  let v = (t) => {
13
13
  t.preventDefault(), e(p);
14
14
  }, y = (t) => {
@@ -20,7 +20,7 @@ var c = e(), l = ({ onSearchSubmit: e, placeholder: l, disabled: u, reducedByDef
20
20
  method: "get",
21
21
  autoComplete: "off",
22
22
  ref: _,
23
- children: /* @__PURE__ */ (0, c.jsx)(i, {
23
+ children: /* @__PURE__ */ (0, c.jsx)(r, {
24
24
  type: "text",
25
25
  name: "q",
26
26
  "aria-label": f.formatMessage({
@@ -5,28 +5,28 @@ import r from "../../../node_modules/.pnpm/react-intl@7.1.14_react@18.3.1_typesc
5
5
  import { SourceListItem as i } from "../../source/source_list_item/SourceListItem.js";
6
6
  import { useModal as a } from "../../dialog/modal/useModal.js";
7
7
  import { No as o } from "../../../node_modules/.pnpm/lexical@0.38.2/node_modules/lexical/Lexical.prod.js";
8
- import { f as s } from "../../../node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalComposer.prod.js";
9
- import { Et as c } from "../../../node_modules/.pnpm/@lexical_rich-text@0.38.2/node_modules/@lexical/rich-text/LexicalRichText.prod.js";
10
- import { L as ee } from "../../../node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalRichTextPlugin.prod.js";
11
- import { x as te } from "../../../node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalContentEditable.prod.js";
12
- import { lt as l, nt as u } from "../../../node_modules/.pnpm/@lexical_list@0.38.2/node_modules/@lexical/list/LexicalList.prod.js";
13
- import { ToolbarPlugin as d } from "./plugins/ToolbarPlugin.js";
14
- import { n as f } from "../../../node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalOnChangePlugin.prod.js";
15
- import { o as p } from "../../../node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalEditorRefPlugin.prod.js";
16
- import { n as m } from "../../../node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalErrorBoundary.prod.js";
17
- import { n as h } from "../../../node_modules/.pnpm/@lexical_overflow@0.38.2/node_modules/@lexical/overflow/LexicalOverflow.prod.js";
18
- import { AutoSavePlugin as g } from "./plugins/AutoSavePlugin.js";
19
- import { SetContentPlugin as _ } from "./plugins/SetContentPlugin.js";
20
- import { SetRichContentPlugin as v } from "./plugins/SetRichContentPlugin.js";
21
- import { ResetPlugin as y } from "./plugins/ResetPlugin.js";
22
- import { FocusPlugin as ne } from "./plugins/FocusPlugin.js";
23
- import { MaxLengthPlugin as re } from "./plugins/MaxLengthPlugin.js";
24
- import { s as ie } from "../../../node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalListPlugin.prod.js";
25
- import { a as b } from "../../../node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalHistoryPlugin.prod.js";
26
- import { U as x } from "../../../node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalCharacterLimitPlugin.prod.js";
27
- import { SourceModal as S } from "../../source/source_modal/SourceModal.js";
28
- import C from "./TextEditor.module.js";
29
- import w from "./EditorTheme.js";
8
+ import { lt as s, nt as c } from "../../../node_modules/.pnpm/@lexical_list@0.38.2/node_modules/@lexical/list/LexicalList.prod.js";
9
+ import { n as ee } from "../../../node_modules/.pnpm/@lexical_overflow@0.38.2/node_modules/@lexical/overflow/LexicalOverflow.prod.js";
10
+ import { U as te } from "../../../node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalCharacterLimitPlugin.prod.js";
11
+ import { f as l } from "../../../node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalComposer.prod.js";
12
+ import { x as u } from "../../../node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalContentEditable.prod.js";
13
+ import { o as d } from "../../../node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalEditorRefPlugin.prod.js";
14
+ import { n as f } from "../../../node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalErrorBoundary.prod.js";
15
+ import { a as p } from "../../../node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalHistoryPlugin.prod.js";
16
+ import { s as m } from "../../../node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalListPlugin.prod.js";
17
+ import { n as h } from "../../../node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalOnChangePlugin.prod.js";
18
+ import { Et as g } from "../../../node_modules/.pnpm/@lexical_rich-text@0.38.2/node_modules/@lexical/rich-text/LexicalRichText.prod.js";
19
+ import { L as _ } from "../../../node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalRichTextPlugin.prod.js";
20
+ import { SourceModal as v } from "../../source/source_modal/SourceModal.js";
21
+ import y from "./TextEditor.module.js";
22
+ import ne from "./EditorTheme.js";
23
+ import { AutoSavePlugin as re } from "./plugins/AutoSavePlugin.js";
24
+ import { FocusPlugin as ie } from "./plugins/FocusPlugin.js";
25
+ import { MaxLengthPlugin as b } from "./plugins/MaxLengthPlugin.js";
26
+ import { ResetPlugin as x } from "./plugins/ResetPlugin.js";
27
+ import { SetContentPlugin as S } from "./plugins/SetContentPlugin.js";
28
+ import { SetRichContentPlugin as C } from "./plugins/SetRichContentPlugin.js";
29
+ import { ToolbarPlugin as w } from "./plugins/ToolbarPlugin.js";
30
30
  import { useEffect as T, useId as E, useState as D } from "react";
31
31
  //#region src/components/input/text_editor/TextEditor.jsx
32
32
  var O = /* @__PURE__ */ e(n()), k = t(), A = ({ placeholder: e, onSubmit: t, sources: n, hideSubmit: A = !1, hideSourceAction: j = !1, onActivation: M, disabled: N = !1, handleChange: P, handleSourcesChange: F, shortBar: I = !1, active: L = !1, maxLength: R, disableRichText: z = !1, editorRef: ae, uid: B, allowedDomains: V = [], hideCharCount: H = !1, disableAutoActivate: U = !1, ...W }) => {
@@ -40,15 +40,15 @@ var O = /* @__PURE__ */ e(n()), k = t(), A = ({ placeholder: e, onSubmit: t, sou
40
40
  G || (K(!0), M && M());
41
41
  }, le = {
42
42
  editable: !N,
43
- theme: w,
43
+ theme: ne,
44
44
  onError(e) {
45
45
  console.error("TextEditor error:", e);
46
46
  },
47
47
  nodes: [
48
- l,
49
- u,
48
+ s,
50
49
  c,
51
- h
50
+ g,
51
+ ee
52
52
  ]
53
53
  }, ue = () => {
54
54
  $();
@@ -61,7 +61,7 @@ var O = /* @__PURE__ */ e(n()), k = t(), A = ({ placeholder: e, onSubmit: t, sou
61
61
  let n = q, r = oe, i = Y;
62
62
  t && (e.preventDefault(), t(n, r, i)), X([]);
63
63
  }, pe = () => {
64
- ce(/* @__PURE__ */ (0, k.jsx)(S, {
64
+ ce(/* @__PURE__ */ (0, k.jsx)(v, {
65
65
  onAddSource: me,
66
66
  allowedSources: V
67
67
  }));
@@ -73,26 +73,26 @@ var O = /* @__PURE__ */ e(n()), k = t(), A = ({ placeholder: e, onSubmit: t, sou
73
73
  title: e.title,
74
74
  index: t
75
75
  }, t), ge = () => /* @__PURE__ */ (0, k.jsx)("div", {
76
- className: C.editorPlaceholder,
76
+ className: y.editorPlaceholder,
77
77
  children: e
78
78
  });
79
- return /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: [/* @__PURE__ */ (0, k.jsx)(s, {
79
+ return /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: [/* @__PURE__ */ (0, k.jsx)(l, {
80
80
  initialConfig: le,
81
81
  children: /* @__PURE__ */ (0, k.jsx)("div", {
82
- className: C.editorContainer,
82
+ className: y.editorContainer,
83
83
  onClick: ue,
84
84
  children: /* @__PURE__ */ (0, k.jsxs)("div", {
85
- className: (0, O.default)(C.editorInner, { [C.editorInnerInactive]: !G && !L }),
85
+ className: (0, O.default)(y.editorInner, { [y.editorInnerInactive]: !G && !L }),
86
86
  children: [
87
- /* @__PURE__ */ (0, k.jsx)(ee, {
88
- contentEditable: /* @__PURE__ */ (0, k.jsx)(te, {
89
- className: (0, O.default)(C.editorInput, { [C.editorInputInactive]: !G }),
87
+ /* @__PURE__ */ (0, k.jsx)(_, {
88
+ contentEditable: /* @__PURE__ */ (0, k.jsx)(u, {
89
+ className: (0, O.default)(y.editorInput, { [y.editorInputInactive]: !G }),
90
90
  ...W
91
91
  }),
92
92
  placeholder: e && /* @__PURE__ */ (0, k.jsx)(ge, {}),
93
- ErrorBoundary: m
93
+ ErrorBoundary: f
94
94
  }),
95
- /* @__PURE__ */ (0, k.jsx)(d, {
95
+ /* @__PURE__ */ (0, k.jsx)(w, {
96
96
  hideSourceAction: j,
97
97
  hideSubmit: A,
98
98
  disableRichText: z,
@@ -106,9 +106,9 @@ var O = /* @__PURE__ */ e(n()), k = t(), A = ({ placeholder: e, onSubmit: t, sou
106
106
  })
107
107
  }),
108
108
  G && R && !H && /* @__PURE__ */ (0, k.jsxs)("div", {
109
- className: C.charactersCount,
109
+ className: y.charactersCount,
110
110
  children: [
111
- /* @__PURE__ */ (0, k.jsx)(x, { maxLength: R }),
111
+ /* @__PURE__ */ (0, k.jsx)(te, { maxLength: R }),
112
112
  " ",
113
113
  Z.formatMessage({
114
114
  id: "input.remaining_chars",
@@ -116,29 +116,29 @@ var O = /* @__PURE__ */ e(n()), k = t(), A = ({ placeholder: e, onSubmit: t, sou
116
116
  })
117
117
  ]
118
118
  }),
119
- /* @__PURE__ */ (0, k.jsx)(ie, {}),
120
- /* @__PURE__ */ (0, k.jsx)(b, {}),
121
- /* @__PURE__ */ (0, k.jsx)(f, {
119
+ /* @__PURE__ */ (0, k.jsx)(m, {}),
120
+ /* @__PURE__ */ (0, k.jsx)(p, {}),
121
+ /* @__PURE__ */ (0, k.jsx)(h, {
122
122
  onChange: de,
123
123
  ignoreSelectionChange: !0
124
124
  }),
125
- /* @__PURE__ */ (0, k.jsx)(g, {
125
+ /* @__PURE__ */ (0, k.jsx)(re, {
126
126
  onSetContent: U ? () => {} : $,
127
127
  storageUid: B || Q
128
128
  }),
129
- /* @__PURE__ */ (0, k.jsx)(_, {}),
130
- /* @__PURE__ */ (0, k.jsx)(v, {}),
131
- /* @__PURE__ */ (0, k.jsx)(ne, {}),
132
- R && /* @__PURE__ */ (0, k.jsx)(re, { maxLength: R }),
133
- /* @__PURE__ */ (0, k.jsx)(y, { storageUid: B || Q }),
134
- /* @__PURE__ */ (0, k.jsx)(p, { editorRef: ae })
129
+ /* @__PURE__ */ (0, k.jsx)(S, {}),
130
+ /* @__PURE__ */ (0, k.jsx)(C, {}),
131
+ /* @__PURE__ */ (0, k.jsx)(ie, {}),
132
+ R && /* @__PURE__ */ (0, k.jsx)(b, { maxLength: R }),
133
+ /* @__PURE__ */ (0, k.jsx)(x, { storageUid: B || Q }),
134
+ /* @__PURE__ */ (0, k.jsx)(d, { editorRef: ae })
135
135
  ]
136
136
  })
137
137
  })
138
138
  }), n && n.length !== 0 ? /* @__PURE__ */ (0, k.jsx)("div", {
139
- className: C.sourcesBox,
139
+ className: y.sourcesBox,
140
140
  children: /* @__PURE__ */ (0, k.jsx)("div", {
141
- className: C.sourceList,
141
+ className: y.sourceList,
142
142
  children: n.map(he)
143
143
  })
144
144
  }) : null] });
@@ -1,21 +1,21 @@
1
- import { g as e } from "../../../node_modules/.pnpm/@lexical_html@0.38.2/node_modules/@lexical/html/LexicalHtml.prod.js";
2
- import { Et as t } from "../../../node_modules/.pnpm/@lexical_rich-text@0.38.2/node_modules/@lexical/rich-text/LexicalRichText.prod.js";
3
- import { lt as n, nt as r } from "../../../node_modules/.pnpm/@lexical_list@0.38.2/node_modules/@lexical/list/LexicalList.prod.js";
1
+ import { lt as e, nt as t } from "../../../node_modules/.pnpm/@lexical_list@0.38.2/node_modules/@lexical/list/LexicalList.prod.js";
2
+ import { g as n } from "../../../node_modules/.pnpm/@lexical_html@0.38.2/node_modules/@lexical/html/LexicalHtml.prod.js";
3
+ import { Et as r } from "../../../node_modules/.pnpm/@lexical_rich-text@0.38.2/node_modules/@lexical/rich-text/LexicalRichText.prod.js";
4
4
  import { t as i } from "../../../node_modules/.pnpm/@lexical_headless@0.38.2/node_modules/@lexical/headless/LexicalHeadless.prod.js";
5
5
  import { purify as a } from "../../../node_modules/.pnpm/dompurify@3.3.3/node_modules/dompurify/dist/purify.es.js";
6
6
  //#region src/components/input/text_editor/lexicalToHtml.js
7
7
  var o = (o) => {
8
8
  let s = null, c = i({
9
9
  nodes: [
10
- t,
11
10
  r,
12
- n
11
+ t,
12
+ e
13
13
  ],
14
14
  onError: () => {}
15
15
  }), l = c.parseEditorState(o);
16
16
  return c.setEditorState(l), c.update(() => {
17
- let t = e(c, null);
18
- s = a.sanitize(t);
17
+ let e = n(c, null);
18
+ s = a.sanitize(e);
19
19
  }), s;
20
20
  };
21
21
  //#endregion