@logora/debate 0.4.42 → 0.4.44
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.
- package/dist/assets/components/action/back_link/BackLink.module-B9Ok2t4H.css +1 -0
- package/dist/assets/components/action/button/Button.module-D7nbgOES.css +1 -0
- package/dist/assets/components/action/icon_text_link/IconTextLink.module-CZKufK9Y.css +1 -0
- package/dist/assets/components/argument/argument/Argument.module-CC40BY1L.css +1 -0
- package/dist/assets/components/argument/argument/ReplyFooter.module-CoC9dY8T.css +1 -0
- package/dist/assets/components/auth/sso_form/SSOForm.module-DOw9cmCF.css +1 -0
- package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-97r47y_e.css +1 -0
- package/dist/assets/components/debate/debate_box/DebateBox.module-emnqIGNF.css +1 -0
- package/dist/assets/components/dialog/dialog_box/DialogBox.module-ZoM8d2Ly.css +1 -0
- package/dist/assets/components/dialog/dropdown/Dropdown.module-BmT3rAwz.css +1 -0
- package/dist/assets/components/dialog/modal/Modal.module-Dt4SWx6U.css +1 -0
- package/dist/assets/components/dialog/toast/Toast.module-CW6j5xe7.css +1 -0
- package/dist/assets/components/dialog/tooltip/Tooltip.module-bQbmPiMf.css +1 -0
- package/dist/assets/components/embed/embed_header/EmbedHeader.module-C8RPiVBp.css +1 -0
- package/dist/assets/components/follow/follow_button/FollowButton.module-BjwLVTeb.css +1 -0
- package/dist/assets/components/gamification/badge_box/BadgeBox.module-DWqqtICw.css +1 -0
- package/dist/assets/components/gamification/point_box/{PointBox.module-BlHdQyht.css → PointBox.module-Dj6cCgSB.css} +1 -1
- package/dist/assets/components/information/information_box/InformationBox.module-DJLT957y.css +1 -0
- package/dist/assets/components/input/text_editor/TextEditor.module-KPtqT1Y6.css +1 -0
- package/dist/assets/components/input/text_editor/plugins/ToolbarPlugin.module-C3yG2biv.css +1 -0
- package/dist/assets/components/input/toggle_position/TogglePosition.module-H4gGmJ0V.css +1 -0
- package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-BDMBrj2Y.css +1 -0
- package/dist/assets/components/navigation/tabs/Tabs.module-50P6bk0B.css +1 -0
- package/dist/assets/components/notification/notification_item/NotificationItem.module-BQcDopYB.css +1 -0
- package/dist/assets/components/notification/notification_menu/NotificationMenu.module-DrCrfzVk.css +1 -0
- package/dist/assets/components/progress/progress_bar/ProgressBar.module-DoCH9Qoo.css +1 -0
- package/dist/assets/components/proposal/proposal_box/ProposalBox.module-D1ccjSLm.css +1 -0
- package/dist/assets/components/section/section_box/SectionBox.module-DF7k7Vxq.css +1 -0
- package/dist/assets/components/share/share_button/{ShareButton.module-BS6STEUD.css → ShareButton.module-BnVEYTzr.css} +1 -1
- package/dist/assets/components/skeleton/user_content_skeleton/UserContentSkeleton.module-d4r3QpYe.css +1 -0
- package/dist/assets/components/source/context_source_box/ContextSourceBox.module-doiSb_NR.css +1 -0
- package/dist/assets/components/source/context_source_list/ContextSourceList.module-Df4z4DN-.css +1 -0
- package/dist/assets/components/source/source_box/SourceBox.module-CQOBgJ5n.css +1 -0
- package/dist/assets/components/source/source_list_item/SourceListItem.module-C5YDjksb.css +1 -0
- package/dist/assets/components/suggestion/suggestion_banner/SuggestionBanner.module-P95xqaUA.css +1 -0
- package/dist/assets/components/suggestion/suggestion_box/SuggestionBox.module-CE_Wvk-K.css +1 -0
- package/dist/assets/components/suggestion/suggestion_input/SuggestionInput.module-r5N57bDp.css +1 -0
- package/dist/assets/components/summary/argument_summary_box/ArgumentSummaryBox.module-EDxcqwRa.css +1 -0
- package/dist/assets/components/summary/keyword_box/KeywordBox.module-yNHAvcRh.css +1 -0
- package/dist/assets/components/summary/summary_box/SummaryBox.module-Bu-AnMIG.css +1 -0
- package/dist/assets/components/text/read_more/ReadMore.module-Bs-YaspR.css +1 -0
- package/dist/assets/components/user/author_box/AuthorBox.module-B8Sl2v33.css +1 -0
- package/dist/assets/components/user/onboarding_modal/OnboardingModal.module-CTpt3xSh.css +1 -0
- package/dist/assets/components/user/user_box/UserBox.module-DMFhZDAH.css +1 -0
- package/dist/assets/components/user/user_box_small/UserBoxSmall.module-D4Ut5xmS.css +1 -0
- package/dist/assets/components/user_content/content_footer/ContentFooter.module-9A9E8k5l.css +1 -0
- package/dist/assets/components/user_content/content_header/ContentHeader.module-CXO2IRui.css +1 -0
- package/dist/assets/components/user_content/summary_content_box/SummaryContentBox.module-CBlL2Xii.css +1 -0
- package/dist/assets/components/user_content/use_report_content/ReportModal.module-mjFuOdmL.css +1 -0
- package/dist/assets/components/vote/suggestion_vote_box/SuggestionVoteBox.module-CKFriPV5.css +1 -0
- package/dist/assets/components/vote/vote_box/VoteBox.module-BZU12qxT.css +1 -0
- package/dist/assets/components/vote/vote_button/VoteButton.module-DqD79xv_.css +1 -0
- package/dist/components/action/back_link/BackLink.module.scss.js +1 -1
- package/dist/components/action/button/Button.module.scss.js +9 -9
- package/dist/components/action/icon_text_link/IconTextLink.module.scss.js +2 -2
- package/dist/components/argument/argument/Argument.js +120 -112
- package/dist/components/argument/argument/Argument.module.scss.js +40 -40
- package/dist/components/argument/argument/ReplyFooter.module.scss.js +8 -8
- package/dist/components/auth/auth_initializer/AuthInitializer.js +58 -41
- package/dist/components/auth/providers/FormAuth.js +6 -3
- package/dist/components/auth/providers/PasswordAuth.js +6 -6
- package/dist/components/auth/sso_form/SSOForm.module.scss.js +20 -20
- package/dist/components/auth/use_auth/base64.js +4 -0
- package/dist/components/auth/use_auth/useAuthActions.js +24 -24
- package/dist/components/consultation/consultation_box/ConsultationBox.js +4 -3
- package/dist/components/consultation/consultation_box/ConsultationBox.module.scss.js +25 -25
- package/dist/components/debate/debate_box/DebateBox.module.scss.js +20 -20
- package/dist/components/dialog/dialog_box/DialogBox.module.scss.js +14 -14
- package/dist/components/dialog/dropdown/Dropdown.js +19 -17
- package/dist/components/dialog/dropdown/Dropdown.module.scss.js +17 -13
- package/dist/components/dialog/modal/Modal.module.scss.js +9 -9
- package/dist/components/dialog/toast/Toast.module.scss.js +18 -18
- package/dist/components/dialog/tooltip/Tooltip.module.scss.js +8 -8
- package/dist/components/embed/embed_header/EmbedHeader.module.scss.js +18 -18
- package/dist/components/follow/follow_button/FollowButton.module.scss.js +1 -1
- package/dist/components/forms/use_form_validation/useFormValidation.js +1 -1
- package/dist/components/gamification/badge_box/BadgeBox.module.scss.js +18 -18
- package/dist/components/gamification/point_box/PointBox.module.scss.js +1 -1
- package/dist/components/icons/clarin_icons/Alarm.js +6 -0
- package/dist/components/icons/clarin_icons/Announcement.js +6 -0
- package/dist/components/icons/clarin_icons/Chat.js +6 -0
- package/dist/components/icons/clarin_icons/CheckCircle.js +9 -0
- package/dist/components/icons/clarin_icons/Clock.js +6 -0
- package/dist/components/icons/clarin_icons/Follow.js +6 -0
- package/dist/components/icons/clarin_icons/MobileClose.js +9 -0
- package/dist/components/icons/clarin_icons/Question.js +6 -0
- package/dist/components/icons/clarin_icons/Search.js +6 -0
- package/dist/components/icons/clarin_icons/Send.js +6 -0
- package/dist/components/icons/clarin_icons/Share.js +6 -0
- package/dist/components/icons/clarin_icons/Upvote.js +9 -0
- package/dist/components/icons/clarin_icons/User.js +9 -0
- package/dist/components/icons/clarin_icons/index.js +106 -0
- package/dist/components/information/information_box/InformationBox.module.scss.js +4 -4
- package/dist/components/input/argument_input/ArgumentInput.js +172 -167
- package/dist/components/input/text_editor/TextEditor.js +49 -47
- package/dist/components/input/text_editor/TextEditor.module.scss.js +28 -28
- package/dist/components/input/text_editor/plugins/IOSInsertParagraphFallbackPlugin.js +34 -0
- package/dist/components/input/text_editor/plugins/ToolbarPlugin.js +143 -94
- package/dist/components/input/text_editor/plugins/ToolbarPlugin.module.scss.js +19 -19
- package/dist/components/input/toggle_position/TogglePosition.module.scss.js +4 -4
- package/dist/components/list/paginated_list/PaginatedList.js +134 -124
- package/dist/components/list/paginated_list/action_bar/ActionBar.module.scss.js +12 -12
- package/dist/components/navbar/navbar_modal/NavbarModal.js +14 -14
- package/dist/components/navigation/tabs/Tabs.js +85 -24
- package/dist/components/navigation/tabs/Tabs.module.scss.js +19 -9
- package/dist/components/notification/notification_item/NotificationItem.module.scss.js +5 -5
- package/dist/components/notification/notification_menu/NotificationMenu.module.scss.js +2 -2
- package/dist/components/progress/progress_bar/ProgressBar.module.scss.js +10 -10
- package/dist/components/proposal/proposal_box/ProposalBox.js +58 -56
- package/dist/components/proposal/proposal_box/ProposalBox.module.scss.js +1 -1
- package/dist/components/section/section_box/SectionBox.module.scss.js +12 -12
- package/dist/components/share/share_button/ShareButton.js +26 -24
- package/dist/components/share/share_button/ShareButton.module.scss.js +5 -3
- package/dist/components/skeleton/user_content_skeleton/UserContentSkeleton.module.scss.js +4 -4
- package/dist/components/source/context_source_box/ContextSourceBox.module.scss.js +4 -4
- package/dist/components/source/context_source_list/ContextSourceList.module.scss.js +5 -5
- package/dist/components/source/source_box/SourceBox.module.scss.js +8 -8
- package/dist/components/source/source_list_item/SourceListItem.module.scss.js +7 -5
- package/dist/components/suggestion/suggestion_banner/SuggestionBanner.module.scss.js +5 -5
- package/dist/components/suggestion/suggestion_box/SuggestionBox.module.scss.js +1 -1
- package/dist/components/suggestion/suggestion_input/SuggestionInput.module.scss.js +9 -9
- package/dist/components/summary/argument_summary_box/ArgumentSummaryBox.module.scss.js +10 -10
- package/dist/components/summary/keyword_box/KeywordBox.module.scss.js +1 -1
- package/dist/components/summary/summary_box/SummaryBox.module.scss.js +8 -8
- package/dist/components/text/read_more/ReadMore.module.scss.js +4 -4
- package/dist/components/user/author_box/AuthorBox.js +18 -17
- package/dist/components/user/author_box/AuthorBox.module.scss.js +24 -24
- package/dist/components/user/onboarding_modal/OnboardingModal.js +296 -0
- package/dist/components/user/onboarding_modal/OnboardingModal.module.scss.js +29 -0
- package/dist/components/user/onboarding_modal/useOnboarding.js +80 -0
- package/dist/components/user/user_box/UserBox.js +48 -38
- package/dist/components/user/user_box/UserBox.module.scss.js +9 -9
- package/dist/components/user/user_box_small/UserBoxSmall.js +19 -18
- package/dist/components/user/user_box_small/UserBoxSmall.module.scss.js +6 -6
- package/dist/components/user_content/content_footer/ContentFooter.js +95 -92
- package/dist/components/user_content/content_footer/ContentFooter.module.scss.js +11 -11
- package/dist/components/user_content/content_header/ContentHeader.module.scss.js +22 -22
- package/dist/components/user_content/summary_content_box/SummaryContentBox.module.scss.js +1 -1
- package/dist/components/user_content/use_report_content/ReportModal.module.scss.js +8 -8
- package/dist/components/vote/suggestion_vote_box/SuggestionVoteBox.module.scss.js +1 -1
- package/dist/components/vote/vote_box/VoteBox.module.scss.js +54 -54
- package/dist/components/vote/vote_button/VoteButton.module.scss.js +5 -5
- package/dist/index.js +319 -312
- package/package.json +3 -2
- package/dist/assets/components/action/back_link/BackLink.module-nMAM5nvb.css +0 -1
- package/dist/assets/components/action/button/Button.module-BXkLuURK.css +0 -1
- package/dist/assets/components/action/icon_text_link/IconTextLink.module-B5PF-MMK.css +0 -1
- package/dist/assets/components/argument/argument/Argument.module-QZdPjj_i.css +0 -1
- package/dist/assets/components/argument/argument/ReplyFooter.module-x9Xlkt3Z.css +0 -1
- package/dist/assets/components/auth/sso_form/SSOForm.module-D5v2TrOv.css +0 -1
- package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-DjNiVt-p.css +0 -1
- package/dist/assets/components/debate/debate_box/DebateBox.module-DTLafpl4.css +0 -1
- package/dist/assets/components/dialog/dialog_box/DialogBox.module-DKztqqmb.css +0 -1
- package/dist/assets/components/dialog/dropdown/Dropdown.module-FG2Sqrqs.css +0 -1
- package/dist/assets/components/dialog/modal/Modal.module-CIj-xCzY.css +0 -1
- package/dist/assets/components/dialog/toast/Toast.module-DJ2wSlJT.css +0 -1
- package/dist/assets/components/dialog/tooltip/Tooltip.module-zMXumgnX.css +0 -1
- package/dist/assets/components/embed/embed_header/EmbedHeader.module-CoyRY_jw.css +0 -1
- package/dist/assets/components/follow/follow_button/FollowButton.module-C9YXM8AM.css +0 -1
- package/dist/assets/components/gamification/badge_box/BadgeBox.module-BnskGH9b.css +0 -1
- package/dist/assets/components/information/information_box/InformationBox.module-B_MiEPn7.css +0 -1
- package/dist/assets/components/input/text_editor/TextEditor.module-CxuSL3l3.css +0 -1
- package/dist/assets/components/input/text_editor/plugins/ToolbarPlugin.module-CbPmMciY.css +0 -1
- package/dist/assets/components/input/toggle_position/TogglePosition.module-DDIigbfA.css +0 -1
- package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-DvwCbS9k.css +0 -1
- package/dist/assets/components/navigation/tabs/Tabs.module-CtDi0tAd.css +0 -1
- package/dist/assets/components/notification/notification_item/NotificationItem.module-BWdhgSy4.css +0 -1
- package/dist/assets/components/notification/notification_menu/NotificationMenu.module-BQwbvRIV.css +0 -1
- package/dist/assets/components/progress/progress_bar/ProgressBar.module-Dy-27Wf9.css +0 -1
- package/dist/assets/components/proposal/proposal_box/ProposalBox.module-Dm8XDnr1.css +0 -1
- package/dist/assets/components/section/section_box/SectionBox.module-qQs4B6bf.css +0 -1
- package/dist/assets/components/skeleton/user_content_skeleton/UserContentSkeleton.module-DhZm1xTr.css +0 -1
- package/dist/assets/components/source/context_source_box/ContextSourceBox.module-78Gxjx0w.css +0 -1
- package/dist/assets/components/source/context_source_list/ContextSourceList.module-DUPbI-wb.css +0 -1
- package/dist/assets/components/source/source_box/SourceBox.module-Cu_m3E85.css +0 -1
- package/dist/assets/components/source/source_list_item/SourceListItem.module-fm_uHuY4.css +0 -1
- package/dist/assets/components/suggestion/suggestion_banner/SuggestionBanner.module-D37NVZLS.css +0 -1
- package/dist/assets/components/suggestion/suggestion_box/SuggestionBox.module-DHxoF0oe.css +0 -1
- package/dist/assets/components/suggestion/suggestion_input/SuggestionInput.module-BsEj7sF3.css +0 -1
- package/dist/assets/components/summary/argument_summary_box/ArgumentSummaryBox.module-DLcsyMSD.css +0 -1
- package/dist/assets/components/summary/keyword_box/KeywordBox.module-DHkYfW0l.css +0 -1
- package/dist/assets/components/summary/summary_box/SummaryBox.module-Dr9PevSJ.css +0 -1
- package/dist/assets/components/text/read_more/ReadMore.module-Ni_Mm8o8.css +0 -1
- package/dist/assets/components/user/author_box/AuthorBox.module-CbH2S-MT.css +0 -1
- package/dist/assets/components/user/update_user_info_modal/UpdateUserInfoModal.module-DJym6u4r.css +0 -1
- package/dist/assets/components/user/user_box/UserBox.module-DGKK1afI.css +0 -1
- package/dist/assets/components/user/user_box_small/UserBoxSmall.module-ibAw9gGE.css +0 -1
- package/dist/assets/components/user_content/content_footer/ContentFooter.module-ax3j7VNT.css +0 -1
- package/dist/assets/components/user_content/content_header/ContentHeader.module-B0VwpU-R.css +0 -1
- package/dist/assets/components/user_content/summary_content_box/SummaryContentBox.module-DdzWnPjq.css +0 -1
- package/dist/assets/components/user_content/use_report_content/ReportModal.module-BxF-D5C5.css +0 -1
- package/dist/assets/components/vote/suggestion_vote_box/SuggestionVoteBox.module-CZeQKWIw.css +0 -1
- package/dist/assets/components/vote/vote_box/VoteBox.module-D5sSSHpi.css +0 -1
- package/dist/assets/components/vote/vote_button/VoteButton.module-aP9ZrGSd.css +0 -1
- package/dist/components/user/update_user_info_modal/UpdateUserInfoModal.js +0 -291
- package/dist/components/user/update_user_info_modal/UpdateUserInfoModal.module.scss.js +0 -29
- package/dist/components/user/update_user_info_modal/useUpdateUserInfo.js +0 -27
|
@@ -1,139 +1,140 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { useIntl as
|
|
5
|
-
import { useLocation as
|
|
6
|
-
import
|
|
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
|
|
9
|
-
import { useList as
|
|
10
|
-
import { useConfig as
|
|
11
|
-
import { useInput as
|
|
12
|
-
import { useAuth as
|
|
13
|
-
import { useFormValidation as
|
|
14
|
-
import { useResponsive as
|
|
15
|
-
import { useAuthRequired as
|
|
16
|
-
import { useModal as
|
|
17
|
-
import { useToast as
|
|
18
|
-
import { TogglePosition as
|
|
19
|
-
import { Avatar as
|
|
20
|
-
import { AuthorBox as
|
|
21
|
-
import { TextEditor as
|
|
22
|
-
import { Icon as
|
|
23
|
-
const
|
|
24
|
-
argumentListId:
|
|
25
|
-
avatarSize:
|
|
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:
|
|
29
|
-
groupId:
|
|
30
|
-
groupName:
|
|
28
|
+
disabledPositions: y = [],
|
|
29
|
+
groupId: _,
|
|
30
|
+
groupName: _e,
|
|
31
31
|
groupType: J,
|
|
32
|
-
hideSourceAction:
|
|
32
|
+
hideSourceAction: Me = !1,
|
|
33
33
|
isReply: r = !1,
|
|
34
34
|
onSubmit: K,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
onUpdate: G,
|
|
36
|
+
parentId: M,
|
|
37
|
+
placeholder: ve,
|
|
38
|
+
positionId: w,
|
|
39
|
+
focusOnInit: be = !1,
|
|
39
40
|
activeOnInit: P = !1,
|
|
40
|
-
userGuideUrl:
|
|
41
|
-
hideUserGuideLink:
|
|
42
|
-
hideCharCount:
|
|
43
|
-
disableAutoActivate:
|
|
44
|
-
autoFocus:
|
|
41
|
+
userGuideUrl: H,
|
|
42
|
+
hideUserGuideLink: Ae = !1,
|
|
43
|
+
hideCharCount: Ce = !1,
|
|
44
|
+
disableAutoActivate: we = !1,
|
|
45
|
+
autoFocus: Q = !1
|
|
45
46
|
}) => {
|
|
46
|
-
const o =
|
|
47
|
-
focus:
|
|
48
|
-
setFocus:
|
|
49
|
-
setReset:
|
|
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:
|
|
52
|
+
setInputContent: te,
|
|
52
53
|
setInputRichContent: Ie
|
|
53
|
-
} =
|
|
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] =
|
|
57
|
-
!
|
|
58
|
-
), k =
|
|
59
|
-
typeof window < "u" ? window.location.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
|
-
|
|
62
|
+
p(() => {
|
|
62
63
|
Te(
|
|
63
|
-
!
|
|
64
|
+
!S && v?.actions?.disableInputForVisitor
|
|
64
65
|
);
|
|
65
|
-
}, [
|
|
66
|
-
const j = u?.role === "editor" || u?.role === "moderator",
|
|
67
|
-
|
|
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 =
|
|
70
|
-
}, [
|
|
71
|
-
|
|
72
|
-
}, [
|
|
73
|
-
P && (z(), Y(!0),
|
|
74
|
-
}, [P]),
|
|
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 =
|
|
77
|
-
(e === !0 || e === "true") && (Y(!0),
|
|
77
|
+
const e = be || le.get("initArgument");
|
|
78
|
+
(e === !0 || e === "true") && (Y(!0), L(), De());
|
|
78
79
|
}
|
|
79
|
-
}, []),
|
|
80
|
-
|
|
81
|
-
}, [
|
|
82
|
-
B?.id && (
|
|
80
|
+
}, []), p(() => {
|
|
81
|
+
Z && (L(), ee(!1));
|
|
82
|
+
}, [Z]), p(() => {
|
|
83
|
+
B?.id && (Fe(B), ee(!0));
|
|
83
84
|
}, [B]);
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
/* @__PURE__ */ s(
|
|
95
|
-
|
|
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:
|
|
102
|
+
onChooseSide: Pe,
|
|
102
103
|
positions: a,
|
|
103
|
-
title:
|
|
104
|
-
disabledPositions: !r &&
|
|
105
|
-
isNeutral: f && f.groupId ==
|
|
104
|
+
title: _e,
|
|
105
|
+
disabledPositions: !r && y,
|
|
106
|
+
isNeutral: f && f.groupId == _ && f.positionId === a[2]?.id
|
|
106
107
|
}
|
|
107
108
|
) })
|
|
108
109
|
);
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
},
|
|
112
|
-
g ? k({ loginAction: "argument" }) : (
|
|
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
|
-
|
|
115
|
-
},
|
|
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
|
-
],
|
|
121
|
-
const t = e || d,
|
|
122
|
-
content:
|
|
123
|
-
rich_content:
|
|
124
|
-
group_id:
|
|
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: !!
|
|
128
|
-
message_id:
|
|
129
|
-
source_ids:
|
|
128
|
+
is_reply: !!M,
|
|
129
|
+
message_id: M || null,
|
|
130
|
+
source_ids: V?.map((i) => i.id)
|
|
130
131
|
};
|
|
131
|
-
|
|
132
|
-
groupId:
|
|
132
|
+
$(l, fe) && (t && a && a.map((i) => i.id).includes(t) && ye({
|
|
133
|
+
groupId: _,
|
|
133
134
|
positionId: t
|
|
134
|
-
}),
|
|
135
|
+
}), me(), X.create("messages", l).then((i) => {
|
|
135
136
|
if (i.data.success) {
|
|
136
|
-
if (
|
|
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
|
|
152
|
-
let
|
|
153
|
-
t && !m && (
|
|
154
|
-
|
|
155
|
-
a.find((
|
|
156
|
-
),
|
|
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
|
-
},
|
|
182
|
+
}, qe = () => {
|
|
182
183
|
const e = {
|
|
183
|
-
content:
|
|
184
|
-
rich_content:
|
|
185
|
-
source_ids:
|
|
184
|
+
content: D,
|
|
185
|
+
rich_content: ae,
|
|
186
|
+
source_ids: V?.map((t) => t.id),
|
|
186
187
|
...d && { position_id: d }
|
|
187
188
|
};
|
|
188
|
-
|
|
189
|
+
$(e, fe) && X.update("messages", se, e).then((t) => {
|
|
189
190
|
if (t.data.success) {
|
|
190
|
-
const
|
|
191
|
-
let i =
|
|
192
|
-
if (
|
|
193
|
-
const
|
|
194
|
-
|
|
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
|
-
|
|
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
|
-
}),
|
|
204
|
+
}), me();
|
|
200
205
|
}
|
|
201
206
|
});
|
|
202
|
-
},
|
|
203
|
-
if (!
|
|
204
|
-
|
|
207
|
+
}, De = () => {
|
|
208
|
+
if (!oe) {
|
|
209
|
+
re(!0);
|
|
205
210
|
const e = setTimeout(() => {
|
|
206
|
-
|
|
211
|
+
re(!1);
|
|
207
212
|
}, 2e3);
|
|
208
213
|
return () => clearTimeout(e);
|
|
209
214
|
}
|
|
210
215
|
}, z = () => {
|
|
211
|
-
g ? k({ loginAction: "argument" }) :
|
|
212
|
-
},
|
|
213
|
-
const e =
|
|
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__ */
|
|
226
|
-
O && /* @__PURE__ */ s("div", { className: n.disabledInputMask, children:
|
|
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:
|
|
237
|
-
[n.flash]:
|
|
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:
|
|
241
|
-
a.length > 0 &&
|
|
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
|
-
|
|
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) =>
|
|
257
|
+
onChange: (e) => b(a[e].id)
|
|
253
258
|
}
|
|
254
259
|
)
|
|
255
260
|
] }),
|
|
256
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ C(
|
|
257
262
|
"div",
|
|
258
263
|
{
|
|
259
|
-
className:
|
|
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:
|
|
272
|
+
className: x(n.argumentAuthorContainer, {
|
|
268
273
|
[n.argumentAuthorContainerMobile]: m,
|
|
269
|
-
[n.argumentAuthorContainerActivated]: !m &&
|
|
274
|
+
[n.argumentAuthorContainerActivated]: !m && I || r
|
|
270
275
|
}),
|
|
271
|
-
children: !m &&
|
|
272
|
-
|
|
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:
|
|
281
|
+
size: pe
|
|
277
282
|
}
|
|
278
283
|
) : /* @__PURE__ */ s(
|
|
279
|
-
|
|
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__ */
|
|
294
|
+
/* @__PURE__ */ C(
|
|
290
295
|
"div",
|
|
291
296
|
{
|
|
292
297
|
onClick: z,
|
|
293
298
|
"data-testid": "argument-input",
|
|
294
|
-
className:
|
|
299
|
+
className: x(n.textEditorBox, {
|
|
295
300
|
[n.replyTextEditorBox]: r
|
|
296
301
|
}),
|
|
297
302
|
children: [
|
|
298
303
|
/* @__PURE__ */ s(
|
|
299
|
-
|
|
304
|
+
ot,
|
|
300
305
|
{
|
|
301
306
|
handleChange: (e, t) => {
|
|
302
|
-
|
|
307
|
+
$e(e, t);
|
|
303
308
|
},
|
|
304
309
|
handleSourcesChange: (e) => {
|
|
305
310
|
Ve(e);
|
|
306
311
|
},
|
|
307
|
-
placeholder:
|
|
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:
|
|
313
|
-
sources:
|
|
314
|
-
hideSourceAction:
|
|
315
|
-
uid: `Argument${
|
|
317
|
+
onSubmit: Ee,
|
|
318
|
+
sources: V,
|
|
319
|
+
hideSourceAction: Me || g,
|
|
320
|
+
uid: M ? `Reply${_}_${M}` : `Argument${_}`,
|
|
316
321
|
onActivation: z,
|
|
317
|
-
showStylesControls:
|
|
318
|
-
disabled: O || g ||
|
|
319
|
-
maxLength: g ? !1 :
|
|
320
|
-
disableRichText:
|
|
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:
|
|
328
|
+
allowedDomains: v?.allowed_sources,
|
|
324
329
|
active: P,
|
|
325
|
-
autoFocus:
|
|
326
|
-
hideCharCount:
|
|
327
|
-
disableAutoActivate:
|
|
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
|
-
|
|
336
|
+
I && y?.find(
|
|
332
337
|
(e) => e.id === d
|
|
333
|
-
) && /* @__PURE__ */
|
|
338
|
+
) && /* @__PURE__ */ C(
|
|
334
339
|
"div",
|
|
335
340
|
{
|
|
336
|
-
className:
|
|
341
|
+
className: x(
|
|
337
342
|
n.argumentInputWarning,
|
|
338
343
|
n.disabledPositionWarning
|
|
339
344
|
),
|
|
340
345
|
children: [
|
|
341
346
|
/* @__PURE__ */ s(
|
|
342
|
-
|
|
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:
|
|
355
|
+
/* @__PURE__ */ s("div", { className: n.argumentInputWarningText, children: Ue() })
|
|
351
356
|
]
|
|
352
357
|
}
|
|
353
358
|
),
|
|
354
|
-
|
|
355
|
-
|
|
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:
|
|
369
|
+
href: H,
|
|
365
370
|
target: "_blank",
|
|
366
371
|
rel: "noreferrer",
|
|
367
372
|
children: /* @__PURE__ */ s(
|
|
368
|
-
|
|
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
|
-
|
|
396
|
+
Ft as ArgumentInput
|
|
392
397
|
};
|