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