@logora/debate 0.4.41 → 0.4.42

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