@logora/debate 0.4.42 → 0.4.43

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 (197) hide show
  1. package/dist/assets/components/action/back_link/BackLink.module-B9Ok2t4H.css +1 -0
  2. package/dist/assets/components/action/button/Button.module-D7nbgOES.css +1 -0
  3. package/dist/assets/components/action/icon_text_link/IconTextLink.module-CZKufK9Y.css +1 -0
  4. package/dist/assets/components/argument/argument/Argument.module-CC40BY1L.css +1 -0
  5. package/dist/assets/components/argument/argument/ReplyFooter.module-CoC9dY8T.css +1 -0
  6. package/dist/assets/components/auth/sso_form/SSOForm.module-DOw9cmCF.css +1 -0
  7. package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-97r47y_e.css +1 -0
  8. package/dist/assets/components/debate/debate_box/DebateBox.module-emnqIGNF.css +1 -0
  9. package/dist/assets/components/dialog/dialog_box/DialogBox.module-ZoM8d2Ly.css +1 -0
  10. package/dist/assets/components/dialog/dropdown/Dropdown.module-BmT3rAwz.css +1 -0
  11. package/dist/assets/components/dialog/modal/Modal.module-Dt4SWx6U.css +1 -0
  12. package/dist/assets/components/dialog/toast/Toast.module-CW6j5xe7.css +1 -0
  13. package/dist/assets/components/dialog/tooltip/Tooltip.module-bQbmPiMf.css +1 -0
  14. package/dist/assets/components/embed/embed_header/EmbedHeader.module-C8RPiVBp.css +1 -0
  15. package/dist/assets/components/follow/follow_button/FollowButton.module-BjwLVTeb.css +1 -0
  16. package/dist/assets/components/gamification/badge_box/BadgeBox.module-DWqqtICw.css +1 -0
  17. package/dist/assets/components/gamification/point_box/{PointBox.module-BlHdQyht.css → PointBox.module-Dj6cCgSB.css} +1 -1
  18. package/dist/assets/components/information/information_box/InformationBox.module-DJLT957y.css +1 -0
  19. package/dist/assets/components/input/text_editor/TextEditor.module-KPtqT1Y6.css +1 -0
  20. package/dist/assets/components/input/text_editor/plugins/ToolbarPlugin.module-C3yG2biv.css +1 -0
  21. package/dist/assets/components/input/toggle_position/TogglePosition.module-H4gGmJ0V.css +1 -0
  22. package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-BDMBrj2Y.css +1 -0
  23. package/dist/assets/components/navigation/tabs/Tabs.module-50P6bk0B.css +1 -0
  24. package/dist/assets/components/notification/notification_item/NotificationItem.module-BQcDopYB.css +1 -0
  25. package/dist/assets/components/notification/notification_menu/NotificationMenu.module-DrCrfzVk.css +1 -0
  26. package/dist/assets/components/progress/progress_bar/ProgressBar.module-DoCH9Qoo.css +1 -0
  27. package/dist/assets/components/proposal/proposal_box/ProposalBox.module-D1ccjSLm.css +1 -0
  28. package/dist/assets/components/section/section_box/SectionBox.module-DF7k7Vxq.css +1 -0
  29. package/dist/assets/components/share/share_button/{ShareButton.module-BS6STEUD.css → ShareButton.module-BnVEYTzr.css} +1 -1
  30. package/dist/assets/components/skeleton/user_content_skeleton/UserContentSkeleton.module-d4r3QpYe.css +1 -0
  31. package/dist/assets/components/source/context_source_box/ContextSourceBox.module-doiSb_NR.css +1 -0
  32. package/dist/assets/components/source/context_source_list/ContextSourceList.module-Df4z4DN-.css +1 -0
  33. package/dist/assets/components/source/source_box/SourceBox.module-CQOBgJ5n.css +1 -0
  34. package/dist/assets/components/source/source_list_item/SourceListItem.module-C5YDjksb.css +1 -0
  35. package/dist/assets/components/suggestion/suggestion_banner/SuggestionBanner.module-P95xqaUA.css +1 -0
  36. package/dist/assets/components/suggestion/suggestion_box/SuggestionBox.module-CE_Wvk-K.css +1 -0
  37. package/dist/assets/components/suggestion/suggestion_input/SuggestionInput.module-r5N57bDp.css +1 -0
  38. package/dist/assets/components/summary/argument_summary_box/ArgumentSummaryBox.module-EDxcqwRa.css +1 -0
  39. package/dist/assets/components/summary/keyword_box/KeywordBox.module-yNHAvcRh.css +1 -0
  40. package/dist/assets/components/summary/summary_box/SummaryBox.module-Bu-AnMIG.css +1 -0
  41. package/dist/assets/components/text/read_more/ReadMore.module-Bs-YaspR.css +1 -0
  42. package/dist/assets/components/user/author_box/AuthorBox.module-B8Sl2v33.css +1 -0
  43. package/dist/assets/components/user/onboarding_modal/OnboardingModal.module-CTpt3xSh.css +1 -0
  44. package/dist/assets/components/user/user_box/UserBox.module-DMFhZDAH.css +1 -0
  45. package/dist/assets/components/user/user_box_small/UserBoxSmall.module-D4Ut5xmS.css +1 -0
  46. package/dist/assets/components/user_content/content_footer/ContentFooter.module-9A9E8k5l.css +1 -0
  47. package/dist/assets/components/user_content/content_header/ContentHeader.module-CXO2IRui.css +1 -0
  48. package/dist/assets/components/user_content/summary_content_box/SummaryContentBox.module-CBlL2Xii.css +1 -0
  49. package/dist/assets/components/user_content/use_report_content/ReportModal.module-mjFuOdmL.css +1 -0
  50. package/dist/assets/components/vote/suggestion_vote_box/SuggestionVoteBox.module-CKFriPV5.css +1 -0
  51. package/dist/assets/components/vote/vote_box/VoteBox.module-Bv7WY_vr.css +1 -0
  52. package/dist/assets/components/vote/vote_button/VoteButton.module-DqD79xv_.css +1 -0
  53. package/dist/components/action/back_link/BackLink.module.scss.js +1 -1
  54. package/dist/components/action/button/Button.module.scss.js +9 -9
  55. package/dist/components/action/icon_text_link/IconTextLink.module.scss.js +2 -2
  56. package/dist/components/argument/argument/Argument.js +120 -112
  57. package/dist/components/argument/argument/Argument.module.scss.js +40 -40
  58. package/dist/components/argument/argument/ReplyFooter.module.scss.js +8 -8
  59. package/dist/components/auth/auth_initializer/AuthInitializer.js +58 -41
  60. package/dist/components/auth/providers/FormAuth.js +6 -3
  61. package/dist/components/auth/providers/PasswordAuth.js +6 -6
  62. package/dist/components/auth/sso_form/SSOForm.module.scss.js +20 -20
  63. package/dist/components/auth/use_auth/base64.js +4 -0
  64. package/dist/components/auth/use_auth/useAuthActions.js +24 -24
  65. package/dist/components/consultation/consultation_box/ConsultationBox.js +4 -3
  66. package/dist/components/consultation/consultation_box/ConsultationBox.module.scss.js +25 -25
  67. package/dist/components/debate/debate_box/DebateBox.module.scss.js +20 -20
  68. package/dist/components/dialog/dialog_box/DialogBox.module.scss.js +14 -14
  69. package/dist/components/dialog/dropdown/Dropdown.js +19 -17
  70. package/dist/components/dialog/dropdown/Dropdown.module.scss.js +17 -13
  71. package/dist/components/dialog/modal/Modal.module.scss.js +9 -9
  72. package/dist/components/dialog/toast/Toast.module.scss.js +18 -18
  73. package/dist/components/dialog/tooltip/Tooltip.module.scss.js +8 -8
  74. package/dist/components/embed/embed_header/EmbedHeader.module.scss.js +18 -18
  75. package/dist/components/follow/follow_button/FollowButton.module.scss.js +1 -1
  76. package/dist/components/forms/use_form_validation/useFormValidation.js +1 -1
  77. package/dist/components/gamification/badge_box/BadgeBox.module.scss.js +18 -18
  78. package/dist/components/gamification/point_box/PointBox.module.scss.js +1 -1
  79. package/dist/components/icons/clarin_icons/Alarm.js +6 -0
  80. package/dist/components/icons/clarin_icons/Announcement.js +6 -0
  81. package/dist/components/icons/clarin_icons/Chat.js +6 -0
  82. package/dist/components/icons/clarin_icons/CheckCircle.js +9 -0
  83. package/dist/components/icons/clarin_icons/Clock.js +6 -0
  84. package/dist/components/icons/clarin_icons/Follow.js +6 -0
  85. package/dist/components/icons/clarin_icons/MobileClose.js +9 -0
  86. package/dist/components/icons/clarin_icons/Question.js +6 -0
  87. package/dist/components/icons/clarin_icons/Search.js +6 -0
  88. package/dist/components/icons/clarin_icons/Send.js +6 -0
  89. package/dist/components/icons/clarin_icons/Share.js +6 -0
  90. package/dist/components/icons/clarin_icons/Upvote.js +9 -0
  91. package/dist/components/icons/clarin_icons/User.js +9 -0
  92. package/dist/components/icons/clarin_icons/index.js +106 -0
  93. package/dist/components/information/information_box/InformationBox.module.scss.js +4 -4
  94. package/dist/components/input/argument_input/ArgumentInput.js +172 -167
  95. package/dist/components/input/text_editor/TextEditor.js +49 -47
  96. package/dist/components/input/text_editor/TextEditor.module.scss.js +28 -28
  97. package/dist/components/input/text_editor/plugins/IOSInsertParagraphFallbackPlugin.js +34 -0
  98. package/dist/components/input/text_editor/plugins/ToolbarPlugin.js +143 -94
  99. package/dist/components/input/text_editor/plugins/ToolbarPlugin.module.scss.js +19 -19
  100. package/dist/components/input/toggle_position/TogglePosition.module.scss.js +4 -4
  101. package/dist/components/list/paginated_list/PaginatedList.js +134 -124
  102. package/dist/components/list/paginated_list/action_bar/ActionBar.module.scss.js +12 -12
  103. package/dist/components/navbar/navbar_modal/NavbarModal.js +14 -14
  104. package/dist/components/navigation/tabs/Tabs.js +85 -24
  105. package/dist/components/navigation/tabs/Tabs.module.scss.js +19 -9
  106. package/dist/components/notification/notification_item/NotificationItem.module.scss.js +5 -5
  107. package/dist/components/notification/notification_menu/NotificationMenu.module.scss.js +2 -2
  108. package/dist/components/progress/progress_bar/ProgressBar.module.scss.js +10 -10
  109. package/dist/components/proposal/proposal_box/ProposalBox.js +58 -56
  110. package/dist/components/proposal/proposal_box/ProposalBox.module.scss.js +1 -1
  111. package/dist/components/section/section_box/SectionBox.module.scss.js +12 -12
  112. package/dist/components/share/share_button/ShareButton.js +26 -24
  113. package/dist/components/share/share_button/ShareButton.module.scss.js +5 -3
  114. package/dist/components/skeleton/user_content_skeleton/UserContentSkeleton.module.scss.js +4 -4
  115. package/dist/components/source/context_source_box/ContextSourceBox.module.scss.js +4 -4
  116. package/dist/components/source/context_source_list/ContextSourceList.module.scss.js +5 -5
  117. package/dist/components/source/source_box/SourceBox.module.scss.js +8 -8
  118. package/dist/components/source/source_list_item/SourceListItem.module.scss.js +7 -5
  119. package/dist/components/suggestion/suggestion_banner/SuggestionBanner.module.scss.js +5 -5
  120. package/dist/components/suggestion/suggestion_box/SuggestionBox.module.scss.js +1 -1
  121. package/dist/components/suggestion/suggestion_input/SuggestionInput.module.scss.js +9 -9
  122. package/dist/components/summary/argument_summary_box/ArgumentSummaryBox.module.scss.js +10 -10
  123. package/dist/components/summary/keyword_box/KeywordBox.module.scss.js +1 -1
  124. package/dist/components/summary/summary_box/SummaryBox.module.scss.js +8 -8
  125. package/dist/components/text/read_more/ReadMore.module.scss.js +4 -4
  126. package/dist/components/user/author_box/AuthorBox.js +18 -17
  127. package/dist/components/user/author_box/AuthorBox.module.scss.js +24 -24
  128. package/dist/components/user/onboarding_modal/OnboardingModal.js +296 -0
  129. package/dist/components/user/onboarding_modal/OnboardingModal.module.scss.js +29 -0
  130. package/dist/components/user/onboarding_modal/useOnboarding.js +80 -0
  131. package/dist/components/user/user_box/UserBox.js +48 -38
  132. package/dist/components/user/user_box/UserBox.module.scss.js +9 -9
  133. package/dist/components/user/user_box_small/UserBoxSmall.js +19 -18
  134. package/dist/components/user/user_box_small/UserBoxSmall.module.scss.js +6 -6
  135. package/dist/components/user_content/content_footer/ContentFooter.js +95 -92
  136. package/dist/components/user_content/content_footer/ContentFooter.module.scss.js +11 -11
  137. package/dist/components/user_content/content_header/ContentHeader.module.scss.js +22 -22
  138. package/dist/components/user_content/summary_content_box/SummaryContentBox.module.scss.js +1 -1
  139. package/dist/components/user_content/use_report_content/ReportModal.module.scss.js +8 -8
  140. package/dist/components/vote/suggestion_vote_box/SuggestionVoteBox.module.scss.js +1 -1
  141. package/dist/components/vote/vote_box/VoteBox.module.scss.js +42 -42
  142. package/dist/components/vote/vote_button/VoteButton.module.scss.js +5 -5
  143. package/dist/index.js +319 -312
  144. package/package.json +3 -2
  145. package/dist/assets/components/action/back_link/BackLink.module-nMAM5nvb.css +0 -1
  146. package/dist/assets/components/action/button/Button.module-BXkLuURK.css +0 -1
  147. package/dist/assets/components/action/icon_text_link/IconTextLink.module-B5PF-MMK.css +0 -1
  148. package/dist/assets/components/argument/argument/Argument.module-QZdPjj_i.css +0 -1
  149. package/dist/assets/components/argument/argument/ReplyFooter.module-x9Xlkt3Z.css +0 -1
  150. package/dist/assets/components/auth/sso_form/SSOForm.module-D5v2TrOv.css +0 -1
  151. package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-DjNiVt-p.css +0 -1
  152. package/dist/assets/components/debate/debate_box/DebateBox.module-DTLafpl4.css +0 -1
  153. package/dist/assets/components/dialog/dialog_box/DialogBox.module-DKztqqmb.css +0 -1
  154. package/dist/assets/components/dialog/dropdown/Dropdown.module-FG2Sqrqs.css +0 -1
  155. package/dist/assets/components/dialog/modal/Modal.module-CIj-xCzY.css +0 -1
  156. package/dist/assets/components/dialog/toast/Toast.module-DJ2wSlJT.css +0 -1
  157. package/dist/assets/components/dialog/tooltip/Tooltip.module-zMXumgnX.css +0 -1
  158. package/dist/assets/components/embed/embed_header/EmbedHeader.module-CoyRY_jw.css +0 -1
  159. package/dist/assets/components/follow/follow_button/FollowButton.module-C9YXM8AM.css +0 -1
  160. package/dist/assets/components/gamification/badge_box/BadgeBox.module-BnskGH9b.css +0 -1
  161. package/dist/assets/components/information/information_box/InformationBox.module-B_MiEPn7.css +0 -1
  162. package/dist/assets/components/input/text_editor/TextEditor.module-CxuSL3l3.css +0 -1
  163. package/dist/assets/components/input/text_editor/plugins/ToolbarPlugin.module-CbPmMciY.css +0 -1
  164. package/dist/assets/components/input/toggle_position/TogglePosition.module-DDIigbfA.css +0 -1
  165. package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-DvwCbS9k.css +0 -1
  166. package/dist/assets/components/navigation/tabs/Tabs.module-CtDi0tAd.css +0 -1
  167. package/dist/assets/components/notification/notification_item/NotificationItem.module-BWdhgSy4.css +0 -1
  168. package/dist/assets/components/notification/notification_menu/NotificationMenu.module-BQwbvRIV.css +0 -1
  169. package/dist/assets/components/progress/progress_bar/ProgressBar.module-Dy-27Wf9.css +0 -1
  170. package/dist/assets/components/proposal/proposal_box/ProposalBox.module-Dm8XDnr1.css +0 -1
  171. package/dist/assets/components/section/section_box/SectionBox.module-qQs4B6bf.css +0 -1
  172. package/dist/assets/components/skeleton/user_content_skeleton/UserContentSkeleton.module-DhZm1xTr.css +0 -1
  173. package/dist/assets/components/source/context_source_box/ContextSourceBox.module-78Gxjx0w.css +0 -1
  174. package/dist/assets/components/source/context_source_list/ContextSourceList.module-DUPbI-wb.css +0 -1
  175. package/dist/assets/components/source/source_box/SourceBox.module-Cu_m3E85.css +0 -1
  176. package/dist/assets/components/source/source_list_item/SourceListItem.module-fm_uHuY4.css +0 -1
  177. package/dist/assets/components/suggestion/suggestion_banner/SuggestionBanner.module-D37NVZLS.css +0 -1
  178. package/dist/assets/components/suggestion/suggestion_box/SuggestionBox.module-DHxoF0oe.css +0 -1
  179. package/dist/assets/components/suggestion/suggestion_input/SuggestionInput.module-BsEj7sF3.css +0 -1
  180. package/dist/assets/components/summary/argument_summary_box/ArgumentSummaryBox.module-DLcsyMSD.css +0 -1
  181. package/dist/assets/components/summary/keyword_box/KeywordBox.module-DHkYfW0l.css +0 -1
  182. package/dist/assets/components/summary/summary_box/SummaryBox.module-Dr9PevSJ.css +0 -1
  183. package/dist/assets/components/text/read_more/ReadMore.module-Ni_Mm8o8.css +0 -1
  184. package/dist/assets/components/user/author_box/AuthorBox.module-CbH2S-MT.css +0 -1
  185. package/dist/assets/components/user/update_user_info_modal/UpdateUserInfoModal.module-DJym6u4r.css +0 -1
  186. package/dist/assets/components/user/user_box/UserBox.module-DGKK1afI.css +0 -1
  187. package/dist/assets/components/user/user_box_small/UserBoxSmall.module-ibAw9gGE.css +0 -1
  188. package/dist/assets/components/user_content/content_footer/ContentFooter.module-ax3j7VNT.css +0 -1
  189. package/dist/assets/components/user_content/content_header/ContentHeader.module-B0VwpU-R.css +0 -1
  190. package/dist/assets/components/user_content/summary_content_box/SummaryContentBox.module-DdzWnPjq.css +0 -1
  191. package/dist/assets/components/user_content/use_report_content/ReportModal.module-BxF-D5C5.css +0 -1
  192. package/dist/assets/components/vote/suggestion_vote_box/SuggestionVoteBox.module-CZeQKWIw.css +0 -1
  193. package/dist/assets/components/vote/vote_box/VoteBox.module-D5sSSHpi.css +0 -1
  194. package/dist/assets/components/vote/vote_button/VoteButton.module-aP9ZrGSd.css +0 -1
  195. package/dist/components/user/update_user_info_modal/UpdateUserInfoModal.js +0 -291
  196. package/dist/components/user/update_user_info_modal/UpdateUserInfoModal.module.scss.js +0 -29
  197. package/dist/components/user/update_user_info_modal/useUpdateUserInfo.js +0 -27
@@ -1,139 +1,140 @@
1
- import { jsxs as v, jsx as s } from "react/jsx-runtime";
2
- import We from "@rooks/use-sessionstorage-state";
3
- import { useRef as Ye, useState as l, useEffect as h, Suspense as ke, lazy as Re } from "react";
4
- import { useIntl as je, FormattedMessage as ge } from "react-intl";
5
- import { useLocation as ze } from "react-router";
6
- import I from "classnames";
1
+ import { jsxs as C, jsx as s } from "react/jsx-runtime";
2
+ import Ye from "@rooks/use-sessionstorage-state";
3
+ import { useRef as ke, useState as c, useEffect as p, Suspense as Re, lazy as je } from "react";
4
+ import { useIntl as ze, FormattedMessage as he } from "react-intl";
5
+ import { useLocation as Oe } from "react-router";
6
+ import x from "classnames";
7
7
  import n from "./ArgumentInput.module.scss.js";
8
- import { useDataProvider as Oe } from "../../data/data_provider/useDataProvider.js";
9
- import { useList as Je } from "../../list/list_provider/useList.js";
10
- import { useConfig as Ke } from "../../data/config_provider/useConfig.js";
11
- import { useInput as Ge } from "../input_provider/useInput.js";
12
- import { useAuth as He } from "../../auth/use_auth/useAuth.js";
13
- import { useFormValidation as Qe } from "../../forms/use_form_validation/useFormValidation.js";
14
- import { useResponsive as Xe } from "../../hooks/use_responsive/useResponsive.js";
15
- import { useAuthRequired as Ze } from "../../hooks/use_auth_required/useAuthRequired.js";
16
- import { useModal as et } from "../../dialog/modal/useModal.js";
17
- import { useToast as tt } from "../../dialog/toast_provider/useToast.js";
18
- import { TogglePosition as nt } from "../toggle_position/TogglePosition.js";
19
- import { Avatar as at } from "../../user/avatar/Avatar.js";
20
- import { AuthorBox as st } from "../../user/author_box/AuthorBox.js";
21
- import { TextEditor as it } from "../text_editor/TextEditor.js";
22
- import { Icon as ot } from "../../icons/icon/Icon.js";
23
- const rt = Re(() => import("../../modal/side_modal/index.js").then((S) => ({ default: S.SideModal }))), Lt = ({
24
- argumentListId: S,
25
- avatarSize: he = 48,
8
+ import { useDataProvider as Je } from "../../data/data_provider/useDataProvider.js";
9
+ import { useList as Ke } from "../../list/list_provider/useList.js";
10
+ import { useConfig as Ge } from "../../data/config_provider/useConfig.js";
11
+ import { useInput as He } from "../input_provider/useInput.js";
12
+ import { useAuth as Qe } from "../../auth/use_auth/useAuth.js";
13
+ import { useFormValidation as Xe } from "../../forms/use_form_validation/useFormValidation.js";
14
+ import { useResponsive as Ze } from "../../hooks/use_responsive/useResponsive.js";
15
+ import { useAuthRequired as et } from "../../hooks/use_auth_required/useAuthRequired.js";
16
+ import { useModal as tt } from "../../dialog/modal/useModal.js";
17
+ import { useToast as nt } from "../../dialog/toast_provider/useToast.js";
18
+ import { TogglePosition as at } from "../toggle_position/TogglePosition.js";
19
+ import { Avatar as st } from "../../user/avatar/Avatar.js";
20
+ import { AuthorBox as it } from "../../user/author_box/AuthorBox.js";
21
+ import { TextEditor as ot } from "../text_editor/TextEditor.js";
22
+ import { Icon as rt } from "../../icons/icon/Icon.js";
23
+ const ut = je(() => import("../../modal/side_modal/index.js").then((N) => ({ default: N.SideModal }))), Ft = ({
24
+ argumentListId: N,
25
+ avatarSize: pe = 48,
26
26
  disabled: O = !1,
27
27
  positions: a = [],
28
- disabledPositions: x = [],
29
- groupId: b,
30
- groupName: pe,
28
+ disabledPositions: y = [],
29
+ groupId: _,
30
+ groupName: _e,
31
31
  groupType: J,
32
- hideSourceAction: _e = !1,
32
+ hideSourceAction: Me = !1,
33
33
  isReply: r = !1,
34
34
  onSubmit: K,
35
- parentId: F,
36
- placeholder: Me,
37
- positionId: A,
38
- focusOnInit: ve = !1,
35
+ onUpdate: G,
36
+ parentId: M,
37
+ placeholder: ve,
38
+ positionId: w,
39
+ focusOnInit: be = !1,
39
40
  activeOnInit: P = !1,
40
- userGuideUrl: G,
41
- hideUserGuideLink: be = !1,
42
- hideCharCount: Ae = !1,
43
- disableAutoActivate: Ce = !1,
44
- autoFocus: H = !1
41
+ userGuideUrl: H,
42
+ hideUserGuideLink: Ae = !1,
43
+ hideCharCount: Ce = !1,
44
+ disableAutoActivate: we = !1,
45
+ autoFocus: Q = !1
45
46
  }) => {
46
- const o = je(), Q = Oe(), N = Je(), p = Ke(), {
47
- focus: X,
48
- setFocus: Z,
49
- setReset: we,
47
+ const o = ze(), X = Je(), T = Ke(), v = Ge(), {
48
+ focus: Z,
49
+ setFocus: ee,
50
+ setReset: Se,
50
51
  inputContent: B,
51
- setInputContent: ee,
52
+ setInputContent: te,
52
53
  setInputRichContent: Ie
53
- } = Ge(), { isLoggedIn: C, currentUser: u } = He(), { errors: E, validate: V } = Qe(), { isMobile: m } = Xe(), Se = ze(), te = Ye(null), [U, $] = l([]), [q, D] = l(""), [ne, W] = l(null), [d, _] = l(null), [ae, se] = l(null), [ie, oe] = l(!1), [w, re] = l(!1), [M, ue] = l({}), [xe, Y] = l(!1), [f, Ne] = We(
54
+ } = He(), { isLoggedIn: S, currentUser: u } = Qe(), { errors: E, validate: $ } = Xe(), { isMobile: m } = Ze(), xe = Oe(), ne = ke(null), [V, q] = c([]), [D, U] = c(""), [ae, W] = c(null), [d, b] = c(null), [se, ie] = c(null), [oe, re] = c(!1), [I, ue] = c(!1), [A, de] = c({}), [Ne, Y] = c(!1), [f, ye] = Ye(
54
55
  "userSide",
55
56
  {}
56
- ), [g, Te] = l(
57
- !C && p?.actions?.disableInputForVisitor
58
- ), k = Ze(), { showModal: ye } = et(), { toast: R } = tt() || {}, de = new URLSearchParams(
59
- typeof window < "u" ? window.location.search : Se.search
57
+ ), [g, Te] = c(
58
+ !S && v?.actions?.disableInputForVisitor
59
+ ), k = et(), { showModal: Le } = tt(), { toast: R } = nt() || {}, le = new URLSearchParams(
60
+ typeof window < "u" ? window.location.search : xe.search
60
61
  );
61
- h(() => {
62
+ p(() => {
62
63
  Te(
63
- !C && p?.actions?.disableInputForVisitor
64
+ !S && v?.actions?.disableInputForVisitor
64
65
  );
65
- }, [C, p]);
66
- const j = u?.role === "editor" || u?.role === "moderator", le = u?.moderation_status === "banned";
67
- h(() => {
66
+ }, [S, v]);
67
+ const j = u?.role === "editor" || u?.role === "moderator", ce = u?.moderation_status === "banned";
68
+ p(() => {
68
69
  let e = null;
69
- typeof window < "u" && (e = de.get("positionId")), A && A != a[2]?.id && a?.find((t) => t.id === A) ? _(A) : e && e != a[2]?.id ? _(e) : f && f.groupId == b && f.positionId != a[2]?.id && _(f.positionId);
70
- }, [A]), h(() => {
71
- H && Y(!0);
72
- }, [H]), h(() => {
73
- P && (z(), Y(!0), T());
74
- }, [P]), h(() => {
70
+ typeof window < "u" && (e = le.get("positionId")), w && w != a[2]?.id && a?.find((t) => t.id === w) ? b(w) : e && e != a[2]?.id ? b(e) : f && f.groupId == _ && f.positionId != a[2]?.id && b(f.positionId);
71
+ }, [w]), p(() => {
72
+ Q && Y(!0);
73
+ }, [Q]), p(() => {
74
+ P && (z(), Y(!0), L());
75
+ }, [P]), p(() => {
75
76
  if (typeof window < "u") {
76
- const e = ve || de.get("initArgument");
77
- (e === !0 || e === "true") && (Y(!0), T(), $e());
77
+ const e = be || le.get("initArgument");
78
+ (e === !0 || e === "true") && (Y(!0), L(), De());
78
79
  }
79
- }, []), h(() => {
80
- X && (T(), Z(!1));
81
- }, [X]), h(() => {
82
- B?.id && (Le(B), Z(!0));
80
+ }, []), p(() => {
81
+ Z && (L(), ee(!1));
82
+ }, [Z]), p(() => {
83
+ B?.id && (Fe(B), ee(!0));
83
84
  }, [B]);
84
- const Le = (e) => {
85
- ue(e), re(!0), $(e.sources), D(e.content), W(e.rich_content), se(e.id), T(), _(e.position?.id), JSON.parse(e.rich_content).hasOwnProperty("root") ? Ie(e.rich_content) : ee(e.content);
86
- }, T = () => {
87
- te.current.scrollIntoView(!1);
88
- }, ce = () => {
89
- D(""), W(null), ue({}), se(null), $([]), we(!0), ee(null);
90
- }, Fe = (e) => {
91
- _(e), fe(e);
92
- }, Pe = () => {
93
- ye(
94
- /* @__PURE__ */ s(ke, { fallback: null, children: /* @__PURE__ */ s(
95
- rt,
85
+ const Fe = (e) => {
86
+ de(e), ue(!0), q(e.sources), U(e.content), W(e.rich_content), ie(e.id), L(), b(e.position?.id), JSON.parse(e.rich_content).hasOwnProperty("root") ? Ie(e.rich_content) : te(e.content);
87
+ }, L = () => {
88
+ ne.current.scrollIntoView(!1);
89
+ }, me = () => {
90
+ U(""), W(null), de({}), ie(null), q([]), Se(!0), te(null);
91
+ }, Pe = (e) => {
92
+ b(e), ge(e);
93
+ }, Be = () => {
94
+ Le(
95
+ /* @__PURE__ */ s(Re, { fallback: null, children: /* @__PURE__ */ s(
96
+ ut,
96
97
  {
97
98
  modalTitle: o.formatMessage({
98
99
  id: "modal.side_modal.modal_title",
99
100
  defaultMessage: "Choose your side"
100
101
  }),
101
- onChooseSide: Fe,
102
+ onChooseSide: Pe,
102
103
  positions: a,
103
- title: pe,
104
- disabledPositions: !r && x,
105
- isNeutral: f && f.groupId == b && f.positionId === a[2]?.id
104
+ title: _e,
105
+ disabledPositions: !r && y,
106
+ isNeutral: f && f.groupId == _ && f.positionId === a[2]?.id
106
107
  }
107
108
  ) })
108
109
  );
109
- }, Be = () => {
110
- C ? ae ? Ue() : !a || a?.length === 0 || !x?.find((e) => e?.id === d) && d || j && r ? fe(r && j && a[0]?.id) : Pe() : k({ loginAction: "argument" });
111
- }, Ee = (e, t) => {
112
- g ? k({ loginAction: "argument" }) : (D(e), W(t), V({ content: e }, [{ content: ["url", null] }]));
110
+ }, Ee = () => {
111
+ S ? se ? qe() : !a || a?.length === 0 || !y?.find((e) => e?.id === d) && d || j && r ? ge(r && j && a[0]?.id) : Be() : k({ loginAction: "argument" });
112
+ }, $e = (e, t) => {
113
+ g ? k({ loginAction: "argument" }) : (U(e), W(t), $({ content: e }, [{ content: ["url", null] }]));
113
114
  }, Ve = (e) => {
114
- $(e);
115
- }, me = [
115
+ q(e);
116
+ }, fe = [
116
117
  { content: ["length", 3] },
117
118
  { content: ["required", null] },
118
119
  { content: ["url", null] },
119
120
  ...!a || a?.length === 0 ? [] : [{ position_id: ["required", null] }]
120
- ], fe = (e) => {
121
- const t = e || d, c = {
122
- content: q,
123
- rich_content: ne,
124
- group_id: b,
121
+ ], ge = (e) => {
122
+ const t = e || d, l = {
123
+ content: D,
124
+ rich_content: ae,
125
+ group_id: _,
125
126
  ...J && { group_type: J },
126
127
  ...t && { position_id: t },
127
- is_reply: !!F,
128
- message_id: F || null,
129
- source_ids: U?.map((i) => i.id)
128
+ is_reply: !!M,
129
+ message_id: M || null,
130
+ source_ids: V?.map((i) => i.id)
130
131
  };
131
- V(c, me) && (t && a && a.map((i) => i.id).includes(t) && Ne({
132
- groupId: b,
132
+ $(l, fe) && (t && a && a.map((i) => i.id).includes(t) && ye({
133
+ groupId: _,
133
134
  positionId: t
134
- }), ce(), Q.create("messages", c).then((i) => {
135
+ }), me(), X.create("messages", l).then((i) => {
135
136
  if (i.data.success) {
136
- if (F)
137
+ if (M)
137
138
  K(i.data.data.resource), R(
138
139
  o.formatMessage({
139
140
  id: "alert.argument_create",
@@ -148,12 +149,12 @@ const rt = Re(() => import("../../modal/side_modal/index.js").then((S) => ({ def
148
149
  }
149
150
  );
150
151
  else {
151
- const y = i.data.data.resource;
152
- let L = S;
153
- t && !m && (L = `argumentList${y.position.id}`), K?.(
154
- q,
155
- a.find((De) => De.id === t) || null
156
- ), N.add(L, [y]), R(
152
+ const h = i.data.data.resource;
153
+ let F = N;
154
+ t && !m && (F = `argumentList${h.position.id}`), K?.(
155
+ D,
156
+ a.find((We) => We.id === t) || null
157
+ ), T.add(F, [h]), R(
157
158
  o.formatMessage({
158
159
  id: "alert.argument_create",
159
160
  defaultMessage: "Your contribution has been sent !"
@@ -178,39 +179,43 @@ const rt = Re(() => import("../../modal/side_modal/index.js").then((S) => ({ def
178
179
  );
179
180
  }
180
181
  }));
181
- }, Ue = () => {
182
+ }, qe = () => {
182
183
  const e = {
183
- content: q,
184
- rich_content: ne,
185
- source_ids: U?.map((t) => t.id),
184
+ content: D,
185
+ rich_content: ae,
186
+ source_ids: V?.map((t) => t.id),
186
187
  ...d && { position_id: d }
187
188
  };
188
- V(e, me) && Q.update("messages", ae, e).then((t) => {
189
+ $(e, fe) && X.update("messages", se, e).then((t) => {
189
190
  if (t.data.success) {
190
- const c = t.data.data.resource;
191
- let i = S;
192
- if (M?.is_reply && M?.message_id ? i = `argument_${M.message_id}_reply_list` : d && !m && (i = `argumentList${c.position?.id}`), !M?.is_reply && M?.position?.id != c.position?.id && !m) {
193
- const y = `argumentList${M.position.id}`, L = `argumentList${c.position.id}`;
194
- N.remove(y, [c]), N.add(L, [c]);
191
+ const l = t.data.data.resource;
192
+ let i = N;
193
+ if (A?.is_reply || r) {
194
+ const h = A?.message_id || A?.reply_to_id || M;
195
+ h && (i = `argument_${h}_reply_list`);
196
+ } else d && !m && (i = `argumentList${l.position?.id}`);
197
+ if (!A?.is_reply && A?.position?.id != l.position?.id && !m) {
198
+ const h = `argumentList${A.position.id}`, F = `argumentList${l.position.id}`;
199
+ T.remove(h, [l]), T.add(F, [l]);
195
200
  } else
196
- N.update(i, [c]);
197
- R(o.formatMessage({ id: "alert.argument_modify" }), {
201
+ T.update(i, [l]);
202
+ G && G(l), R(o.formatMessage({ id: "alert.argument_modify" }), {
198
203
  type: "success"
199
- }), ce();
204
+ }), me();
200
205
  }
201
206
  });
202
- }, $e = () => {
203
- if (!ie) {
204
- oe(!0);
207
+ }, De = () => {
208
+ if (!oe) {
209
+ re(!0);
205
210
  const e = setTimeout(() => {
206
- oe(!1);
211
+ re(!1);
207
212
  }, 2e3);
208
213
  return () => clearTimeout(e);
209
214
  }
210
215
  }, z = () => {
211
- g ? k({ loginAction: "argument" }) : re(!0);
212
- }, qe = () => {
213
- const e = x.find(
216
+ g ? k({ loginAction: "argument" }) : ue(!0);
217
+ }, Ue = () => {
218
+ const e = y.find(
214
219
  (t) => t.id === d
215
220
  );
216
221
  if (e)
@@ -222,8 +227,8 @@ const rt = Re(() => import("../../modal/side_modal/index.js").then((S) => ({ def
222
227
  { position: e.name }
223
228
  );
224
229
  };
225
- return /* @__PURE__ */ v("div", { className: n.inputContainer, children: [
226
- O && /* @__PURE__ */ s("div", { className: n.disabledInputMask, children: le ? o.formatMessage({
230
+ return /* @__PURE__ */ C("div", { className: n.inputContainer, children: [
231
+ O && /* @__PURE__ */ s("div", { className: n.disabledInputMask, children: ce ? o.formatMessage({
227
232
  id: "input.argument_input.user_banned",
228
233
  defaultMessage: "You are banned from the debate space."
229
234
  }) : o.formatMessage({
@@ -233,30 +238,30 @@ const rt = Re(() => import("../../modal/side_modal/index.js").then((S) => ({ def
233
238
  /* @__PURE__ */ s(
234
239
  "div",
235
240
  {
236
- className: I(n.argumentInput, {
237
- [n.flash]: ie,
241
+ className: x(n.argumentInput, {
242
+ [n.flash]: oe,
238
243
  [n.replyInputContainer]: r
239
244
  }),
240
- children: /* @__PURE__ */ s("div", { "data-tid": "action_add_argument", ref: te, children: /* @__PURE__ */ v("div", { className: n.argumentInputBox, children: [
241
- a.length > 0 && C && (!r || !j) && /* @__PURE__ */ v("div", { className: n.userPosition, children: [
245
+ children: /* @__PURE__ */ s("div", { "data-tid": "action_add_argument", ref: ne, children: /* @__PURE__ */ C("div", { className: n.argumentInputBox, children: [
246
+ a.length > 0 && S && (!r || !j) && /* @__PURE__ */ C("div", { className: n.userPosition, children: [
242
247
  /* @__PURE__ */ s("div", { children: o.formatMessage({
243
248
  id: "input.position",
244
249
  defaultMessage: "Your position"
245
250
  }) }),
246
251
  /* @__PURE__ */ s(
247
- nt,
252
+ at,
248
253
  {
249
254
  activeLabel: d === a[0].id ? 0 : d === a[1].id ? 1 : null,
250
255
  firstLabel: a[0],
251
256
  secondLabel: a[1],
252
- onChange: (e) => _(a[e].id)
257
+ onChange: (e) => b(a[e].id)
253
258
  }
254
259
  )
255
260
  ] }),
256
- /* @__PURE__ */ v(
261
+ /* @__PURE__ */ C(
257
262
  "div",
258
263
  {
259
- className: I(n.argumentTextInputBox, {
264
+ className: x(n.argumentTextInputBox, {
260
265
  [n.argumentTextInputBoxisTablet]: !m,
261
266
  [n.replyEditorRow]: r
262
267
  }),
@@ -264,19 +269,19 @@ const rt = Re(() => import("../../modal/side_modal/index.js").then((S) => ({ def
264
269
  /* @__PURE__ */ s(
265
270
  "div",
266
271
  {
267
- className: I(n.argumentAuthorContainer, {
272
+ className: x(n.argumentAuthorContainer, {
268
273
  [n.argumentAuthorContainerMobile]: m,
269
- [n.argumentAuthorContainerActivated]: !m && w || r
274
+ [n.argumentAuthorContainerActivated]: !m && I || r
270
275
  }),
271
- children: !m && w || r ? /* @__PURE__ */ s(
272
- at,
276
+ children: !m && I || r ? /* @__PURE__ */ s(
277
+ st,
273
278
  {
274
279
  avatarUrl: u.image_url,
275
280
  userName: u.full_name,
276
- size: he
281
+ size: pe
277
282
  }
278
283
  ) : /* @__PURE__ */ s(
279
- st,
284
+ it,
280
285
  {
281
286
  fullName: u?.full_name || o.formatMessage({ id: "default_author.full_name" }),
282
287
  avatarUrl: u?.image_url,
@@ -286,60 +291,60 @@ const rt = Re(() => import("../../modal/side_modal/index.js").then((S) => ({ def
286
291
  )
287
292
  }
288
293
  ),
289
- /* @__PURE__ */ v(
294
+ /* @__PURE__ */ C(
290
295
  "div",
291
296
  {
292
297
  onClick: z,
293
298
  "data-testid": "argument-input",
294
- className: I(n.textEditorBox, {
299
+ className: x(n.textEditorBox, {
295
300
  [n.replyTextEditorBox]: r
296
301
  }),
297
302
  children: [
298
303
  /* @__PURE__ */ s(
299
- it,
304
+ ot,
300
305
  {
301
306
  handleChange: (e, t) => {
302
- Ee(e, t);
307
+ $e(e, t);
303
308
  },
304
309
  handleSourcesChange: (e) => {
305
310
  Ve(e);
306
311
  },
307
- placeholder: Me,
312
+ placeholder: ve,
308
313
  "aria-label": o.formatMessage({
309
314
  id: "input.argument_input.aria_label",
310
315
  defaultMessage: "Message input field"
311
316
  }),
312
- onSubmit: Be,
313
- sources: U,
314
- hideSourceAction: _e || g,
315
- uid: `Argument${b}`,
317
+ onSubmit: Ee,
318
+ sources: V,
319
+ hideSourceAction: Me || g,
320
+ uid: M ? `Reply${_}_${M}` : `Argument${_}`,
316
321
  onActivation: z,
317
- showStylesControls: w,
318
- disabled: O || g || le,
319
- maxLength: g ? !1 : p?.actions?.argumentMaxLength,
320
- disableRichText: p?.actions?.disableRichText || g,
322
+ showStylesControls: I,
323
+ disabled: O || g || ce,
324
+ maxLength: g ? !1 : v?.actions?.argumentMaxLength,
325
+ disableRichText: v?.actions?.disableRichText || g,
321
326
  shortBar: r,
322
327
  hideSubmit: g,
323
- allowedDomains: p?.allowed_sources,
328
+ allowedDomains: v?.allowed_sources,
324
329
  active: P,
325
- autoFocus: xe,
326
- hideCharCount: Ae,
327
- disableAutoActivate: Ce
330
+ autoFocus: Ne,
331
+ hideCharCount: Ce,
332
+ disableAutoActivate: we
328
333
  }
329
334
  ),
330
335
  E?.content && /* @__PURE__ */ s("div", { className: n.argumentInputWarning, children: E && Object.values(E).map((e, t) => /* @__PURE__ */ s("div", { children: e }, t)) }),
331
- w && x?.find(
336
+ I && y?.find(
332
337
  (e) => e.id === d
333
- ) && /* @__PURE__ */ v(
338
+ ) && /* @__PURE__ */ C(
334
339
  "div",
335
340
  {
336
- className: I(
341
+ className: x(
337
342
  n.argumentInputWarning,
338
343
  n.disabledPositionWarning
339
344
  ),
340
345
  children: [
341
346
  /* @__PURE__ */ s(
342
- ot,
347
+ rt,
343
348
  {
344
349
  name: "announcement",
345
350
  className: n.warningIcon,
@@ -347,12 +352,12 @@ const rt = Re(() => import("../../modal/side_modal/index.js").then((S) => ({ def
347
352
  width: 20
348
353
  }
349
354
  ),
350
- /* @__PURE__ */ s("div", { className: n.argumentInputWarningText, children: qe() })
355
+ /* @__PURE__ */ s("div", { className: n.argumentInputWarningText, children: Ue() })
351
356
  ]
352
357
  }
353
358
  ),
354
- w && G && !be && /* @__PURE__ */ s("div", { className: n.guideMessage, children: /* @__PURE__ */ s(
355
- ge,
359
+ I && H && !Ae && /* @__PURE__ */ s("div", { className: n.guideMessage, children: /* @__PURE__ */ s(
360
+ he,
356
361
  {
357
362
  id: "alert.guide_message",
358
363
  defaultMessage: "Contributions must comply with our {userCharter}.",
@@ -361,11 +366,11 @@ const rt = Re(() => import("../../modal/side_modal/index.js").then((S) => ({ def
361
366
  "a",
362
367
  {
363
368
  className: n.guideMessage,
364
- href: G,
369
+ href: H,
365
370
  target: "_blank",
366
371
  rel: "noreferrer",
367
372
  children: /* @__PURE__ */ s(
368
- ge,
373
+ he,
369
374
  {
370
375
  id: "alert.user_charter",
371
376
  defaultMessage: "user charter"
@@ -388,5 +393,5 @@ const rt = Re(() => import("../../modal/side_modal/index.js").then((S) => ({ def
388
393
  ] });
389
394
  };
390
395
  export {
391
- Lt as ArgumentInput
396
+ Ft as ArgumentInput
392
397
  };