@logora/debate 0.3.88 → 0.3.90
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/argument/argument/Argument.module-gLfNRLks.css +1 -0
- package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-BnTr5IaF.css +1 -0
- package/dist/assets/components/follow/follow_button/FollowButton.module-Da-cPgwT.css +1 -0
- package/dist/assets/components/input/text_editor/{TextEditor.module-CxuSL3l3.css → TextEditor.module-DePSfOvG.css} +1 -1
- package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-pxwFC_Y2.css +1 -0
- package/dist/assets/components/proposal/proposal_box/ProposalBox.module-T4ms_LQ7.css +1 -0
- package/dist/assets/components/section/section_box/SectionBox.module-DUeUtdWr.css +1 -0
- package/dist/assets/components/source/context_source_list/ContextSourceList.module-D6X_0dB7.css +1 -0
- package/dist/assets/components/source/source_list_item/SourceListItem.module-mTxHhXPV.css +1 -0
- package/dist/assets/components/summary/summary/Summary.module-DjfmUlkW.css +1 -0
- package/dist/assets/components/summary/summary_box/SummaryBox.module-DQVkA8l7.css +1 -0
- package/dist/assets/components/vote/vote_box/VoteBox.module-CDrqb2SZ.css +1 -0
- package/dist/components/argument/argument/Argument.js +106 -111
- package/dist/components/argument/argument/Argument.module.scss.js +31 -31
- package/dist/components/consultation/consultation_box/ConsultationBox.js +111 -80
- package/dist/components/consultation/consultation_box/ConsultationBox.module.scss.js +29 -31
- package/dist/components/dialog/dropdown/Dropdown.js +28 -35
- package/dist/components/follow/follow_button/FollowButton.js +16 -17
- package/dist/components/follow/follow_button/FollowButton.module.scss.js +4 -6
- package/dist/components/icons/bild_icons/index.js +56 -58
- package/dist/components/icons/hero_icons/index.js +18 -20
- package/dist/components/icons/krone_icons/index.js +46 -48
- package/dist/components/icons/regular_icons/index.js +18 -20
- package/dist/components/icons/spiegel_icons/index.js +52 -54
- package/dist/components/icons/stern_icons/index.js +70 -102
- package/dist/components/input/argument_input/ArgumentInput.js +197 -201
- package/dist/components/input/select/Select.js +19 -19
- package/dist/components/input/text_editor/TextEditor.js +129 -143
- package/dist/components/input/text_editor/TextEditor.module.scss.js +5 -5
- package/dist/components/input/text_editor/plugins/FocusPlugin.js +8 -12
- package/dist/components/input/text_editor/plugins/SetContentPlugin.js +13 -13
- package/dist/components/input/text_editor/plugins/SetRichContentPlugin.js +10 -10
- package/dist/components/input/text_editor/plugins/ToolbarPlugin.js +72 -70
- package/dist/components/list/paginated_list/PaginatedList.js +125 -131
- package/dist/components/list/paginated_list/action_bar/ActionBar.js +50 -53
- package/dist/components/list/paginated_list/action_bar/ActionBar.module.scss.js +16 -18
- package/dist/components/notification/notification_menu/NotificationMenu.js +22 -23
- package/dist/components/proposal/proposal_box/ProposalBox.js +59 -70
- package/dist/components/proposal/proposal_box/ProposalBox.module.scss.js +10 -14
- package/dist/components/section/section_box/SectionBox.js +10 -10
- package/dist/components/section/section_box/SectionBox.module.scss.js +9 -9
- package/dist/components/source/context_source_box/ContextSourceBox.js +7 -7
- package/dist/components/source/context_source_list/ContextSourceList.js +13 -10
- package/dist/components/source/context_source_list/ContextSourceList.module.scss.js +12 -14
- package/dist/components/source/source_list_item/SourceListItem.js +28 -42
- package/dist/components/source/source_list_item/SourceListItem.module.scss.js +6 -8
- package/dist/components/source/source_modal/SourceModal.js +15 -15
- package/dist/components/summary/summary/Summary.js +63 -41
- package/dist/components/summary/summary/Summary.module.scss.js +6 -10
- package/dist/components/summary/summary_box/SummaryBox.module.scss.js +9 -9
- package/dist/components/vote/vote_box/VoteBox.js +143 -122
- package/dist/components/vote/vote_box/VoteBox.module.scss.js +48 -50
- package/package.json +1 -1
- package/dist/assets/components/argument/argument/Argument.module-QZdPjj_i.css +0 -1
- package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-DjNiVt-p.css +0 -1
- package/dist/assets/components/follow/follow_button/FollowButton.module-C9YXM8AM.css +0 -1
- package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-DvwCbS9k.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/source/context_source_list/ContextSourceList.module-DUPbI-wb.css +0 -1
- package/dist/assets/components/source/source_list_item/SourceListItem.module-fm_uHuY4.css +0 -1
- package/dist/assets/components/summary/summary/Summary.module-2bnx3egy.css +0 -1
- package/dist/assets/components/summary/summary_box/SummaryBox.module-Dr9PevSJ.css +0 -1
- package/dist/assets/components/vote/vote_box/VoteBox.module-D5sSSHpi.css +0 -1
- package/dist/components/icons/regular_icons/Follow.js +0 -6
- package/dist/components/icons/spiegel_icons/Downvote.js +0 -6
- package/dist/components/icons/spiegel_icons/Upvote.js +0 -6
|
@@ -1,166 +1,163 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { useIntl as
|
|
5
|
-
import { useLocation as
|
|
6
|
-
import
|
|
1
|
+
import { jsxs as _, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import qe from "@rooks/use-sessionstorage-state";
|
|
3
|
+
import { useRef as De, useState as c, useEffect as M, Suspense as We, lazy as Ye } from "react";
|
|
4
|
+
import { useIntl as $e, FormattedMessage as ce } from "react-intl";
|
|
5
|
+
import { useLocation as ke } from "react-router";
|
|
6
|
+
import w 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:
|
|
26
|
-
disabled:
|
|
8
|
+
import { useDataProvider as Re } from "../../data/data_provider/useDataProvider.js";
|
|
9
|
+
import { useList as je } from "../../list/list_provider/useList.js";
|
|
10
|
+
import { useConfig as ze } from "../../data/config_provider/useConfig.js";
|
|
11
|
+
import { useInput as Oe } from "../input_provider/useInput.js";
|
|
12
|
+
import { useAuth as Je } from "../../auth/use_auth/useAuth.js";
|
|
13
|
+
import { useFormValidation as Ke } from "../../forms/use_form_validation/useFormValidation.js";
|
|
14
|
+
import { useResponsive as Ge } from "../../hooks/use_responsive/useResponsive.js";
|
|
15
|
+
import { useAuthRequired as He } from "../../hooks/use_auth_required/useAuthRequired.js";
|
|
16
|
+
import { useModal as Qe } from "../../dialog/modal/useModal.js";
|
|
17
|
+
import { useToast as Xe } from "../../dialog/toast_provider/useToast.js";
|
|
18
|
+
import { TogglePosition as Ze } from "../toggle_position/TogglePosition.js";
|
|
19
|
+
import { Avatar as et } from "../../user/avatar/Avatar.js";
|
|
20
|
+
import { AuthorBox as tt } from "../../user/author_box/AuthorBox.js";
|
|
21
|
+
import { TextEditor as nt } from "../text_editor/TextEditor.js";
|
|
22
|
+
import { Icon as at } from "../../icons/icon/Icon.js";
|
|
23
|
+
const it = Ye(() => import("../../modal/side_modal/index.js").then((I) => ({ default: I.SideModal }))), Nt = ({
|
|
24
|
+
argumentListId: I,
|
|
25
|
+
avatarSize: me = 48,
|
|
26
|
+
disabled: j = !1,
|
|
27
27
|
positions: a = [],
|
|
28
|
-
disabledPositions:
|
|
29
|
-
groupId:
|
|
30
|
-
groupName:
|
|
31
|
-
groupType:
|
|
32
|
-
hideSourceAction:
|
|
28
|
+
disabledPositions: S = [],
|
|
29
|
+
groupId: v,
|
|
30
|
+
groupName: fe,
|
|
31
|
+
groupType: z,
|
|
32
|
+
hideSourceAction: ge = !1,
|
|
33
33
|
isReply: r = !1,
|
|
34
|
-
onSubmit:
|
|
35
|
-
parentId:
|
|
36
|
-
placeholder:
|
|
37
|
-
positionId:
|
|
38
|
-
focusOnInit:
|
|
39
|
-
activeOnInit:
|
|
40
|
-
userGuideUrl:
|
|
41
|
-
hideUserGuideLink:
|
|
42
|
-
hideCharCount:
|
|
43
|
-
disableAutoActivate:
|
|
44
|
-
autoFocus: H = !1
|
|
34
|
+
onSubmit: O,
|
|
35
|
+
parentId: y,
|
|
36
|
+
placeholder: he,
|
|
37
|
+
positionId: b,
|
|
38
|
+
focusOnInit: pe = !1,
|
|
39
|
+
activeOnInit: F = !1,
|
|
40
|
+
userGuideUrl: J,
|
|
41
|
+
hideUserGuideLink: _e = !1,
|
|
42
|
+
hideCharCount: Me = !1,
|
|
43
|
+
disableAutoActivate: ve = !1
|
|
45
44
|
}) => {
|
|
46
|
-
const
|
|
47
|
-
focus:
|
|
48
|
-
setFocus:
|
|
49
|
-
setReset:
|
|
50
|
-
inputContent:
|
|
51
|
-
setInputContent:
|
|
52
|
-
setInputRichContent:
|
|
53
|
-
} =
|
|
45
|
+
const s = $e(), K = Re(), x = je(), h = ze(), {
|
|
46
|
+
focus: G,
|
|
47
|
+
setFocus: N,
|
|
48
|
+
setReset: be,
|
|
49
|
+
inputContent: P,
|
|
50
|
+
setInputContent: Ae,
|
|
51
|
+
setInputRichContent: Ce
|
|
52
|
+
} = Oe(), { isLoggedIn: A, currentUser: u } = Je(), { errors: B, validate: E } = Ke(), { isMobile: m } = Ge(), we = ke(), H = De(null), [V, U] = c([]), [q, D] = c(""), [Q, W] = c(null), [d, p] = c(null), [X, Z] = c(null), [ee, te] = c(!1), [C, ne] = c(!1), [ae, ie] = c({}), [f, Ie] = qe(
|
|
54
53
|
"userSide",
|
|
55
54
|
{}
|
|
56
|
-
), [g,
|
|
57
|
-
!
|
|
58
|
-
),
|
|
59
|
-
typeof window < "u" ? window.location.search :
|
|
55
|
+
), [g, Se] = c(
|
|
56
|
+
!A && h?.actions?.disableInputForVisitor
|
|
57
|
+
), Y = He(), { showModal: xe } = Qe(), { toast: $ } = Xe() || {}, se = new URLSearchParams(
|
|
58
|
+
typeof window < "u" ? window.location.search : we.search
|
|
60
59
|
);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
!
|
|
60
|
+
M(() => {
|
|
61
|
+
Se(
|
|
62
|
+
!A && h?.actions?.disableInputForVisitor
|
|
64
63
|
);
|
|
65
|
-
}, [
|
|
66
|
-
const
|
|
67
|
-
|
|
64
|
+
}, [A, h]);
|
|
65
|
+
const k = u?.role === "editor" || u?.role === "moderator", oe = u?.moderation_status === "banned";
|
|
66
|
+
M(() => {
|
|
68
67
|
let e = null;
|
|
69
|
-
typeof window < "u" && (e =
|
|
70
|
-
}, [
|
|
71
|
-
|
|
72
|
-
}, [
|
|
73
|
-
P && (z(), Y(!0), T());
|
|
74
|
-
}, [P]), h(() => {
|
|
68
|
+
typeof window < "u" && (e = se.get("positionId")), b && b != a[2]?.id && a?.find((t) => t.id === b) ? p(b) : e && e != a[2]?.id ? p(e) : f && f.groupId == v && f.positionId != a[2]?.id && p(f.positionId);
|
|
69
|
+
}, [b]), M(() => {
|
|
70
|
+
F && (R(), N(!0));
|
|
71
|
+
}, [F]), M(() => {
|
|
75
72
|
if (typeof window < "u") {
|
|
76
|
-
const e =
|
|
77
|
-
(e === !0 || e === "true") && (
|
|
73
|
+
const e = pe || se.get("initArgument");
|
|
74
|
+
(e === !0 || e === "true") && (N(!0), Ee());
|
|
78
75
|
}
|
|
79
|
-
}, []),
|
|
80
|
-
|
|
81
|
-
}, [
|
|
82
|
-
|
|
83
|
-
}, [
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
},
|
|
89
|
-
D(""), W(null),
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
|
|
76
|
+
}, []), M(() => {
|
|
77
|
+
G && (re(), N(!1));
|
|
78
|
+
}, [G]), M(() => {
|
|
79
|
+
P?.id && (Ne(P), N(!0));
|
|
80
|
+
}, [P]);
|
|
81
|
+
const Ne = (e) => {
|
|
82
|
+
ie(e), ne(!0), U(e.sources), D(e.content), W(e.rich_content), Z(e.id), re(), p(e.position?.id), JSON.parse(e.rich_content).hasOwnProperty("root") ? Ce(e.rich_content) : Ae(e.content);
|
|
83
|
+
}, re = () => {
|
|
84
|
+
H.current.scrollIntoView(!1);
|
|
85
|
+
}, ue = () => {
|
|
86
|
+
D(""), W(null), ie({}), Z(null), U([]), be(!0);
|
|
87
|
+
}, Te = (e) => {
|
|
88
|
+
p(e), le(e);
|
|
89
|
+
}, Le = () => {
|
|
90
|
+
xe(
|
|
91
|
+
/* @__PURE__ */ i(We, { fallback: null, children: /* @__PURE__ */ i(
|
|
92
|
+
it,
|
|
96
93
|
{
|
|
97
|
-
modalTitle:
|
|
94
|
+
modalTitle: s.formatMessage({
|
|
98
95
|
id: "modal.side_modal.modal_title",
|
|
99
96
|
defaultMessage: "Choose your side"
|
|
100
97
|
}),
|
|
101
|
-
onChooseSide:
|
|
98
|
+
onChooseSide: Te,
|
|
102
99
|
positions: a,
|
|
103
|
-
title:
|
|
104
|
-
disabledPositions: !r &&
|
|
105
|
-
isNeutral: f && f.groupId ==
|
|
100
|
+
title: fe,
|
|
101
|
+
disabledPositions: !r && S,
|
|
102
|
+
isNeutral: f && f.groupId == v && f.positionId === a[2]?.id
|
|
106
103
|
}
|
|
107
104
|
) })
|
|
108
105
|
);
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
},
|
|
112
|
-
g ?
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
},
|
|
106
|
+
}, ye = () => {
|
|
107
|
+
A ? X ? Be() : !a || a?.length === 0 || !S?.find((e) => e?.id === d) && d || k && r ? le(r && k && a[0]?.id) : Le() : Y({ loginAction: "argument" });
|
|
108
|
+
}, Fe = (e, t) => {
|
|
109
|
+
g ? Y({ loginAction: "argument" }) : (D(e), W(t), E({ content: e }, [{ content: ["url", null] }]));
|
|
110
|
+
}, Pe = (e) => {
|
|
111
|
+
U(e);
|
|
112
|
+
}, de = [
|
|
116
113
|
{ content: ["length", 3] },
|
|
117
114
|
{ content: ["required", null] },
|
|
118
115
|
{ content: ["url", null] },
|
|
119
116
|
...!a || a?.length === 0 ? [] : [{ position_id: ["required", null] }]
|
|
120
|
-
],
|
|
121
|
-
const t = e || d,
|
|
117
|
+
], le = (e) => {
|
|
118
|
+
const t = e || d, l = {
|
|
122
119
|
content: q,
|
|
123
|
-
rich_content:
|
|
124
|
-
group_id:
|
|
125
|
-
...
|
|
120
|
+
rich_content: Q,
|
|
121
|
+
group_id: v,
|
|
122
|
+
...z && { group_type: z },
|
|
126
123
|
...t && { position_id: t },
|
|
127
|
-
is_reply: !!
|
|
128
|
-
message_id:
|
|
129
|
-
source_ids:
|
|
124
|
+
is_reply: !!y,
|
|
125
|
+
message_id: y || null,
|
|
126
|
+
source_ids: V?.map((o) => o.id)
|
|
130
127
|
};
|
|
131
|
-
|
|
132
|
-
groupId:
|
|
128
|
+
E(l, de) && (t && a && a.map((o) => o.id).includes(t) && Ie({
|
|
129
|
+
groupId: v,
|
|
133
130
|
positionId: t
|
|
134
|
-
}),
|
|
135
|
-
if (
|
|
136
|
-
if (
|
|
137
|
-
|
|
138
|
-
|
|
131
|
+
}), ue(), K.create("messages", l).then((o) => {
|
|
132
|
+
if (o.data.success) {
|
|
133
|
+
if (y)
|
|
134
|
+
O(o.data.data.resource), $(
|
|
135
|
+
s.formatMessage({
|
|
139
136
|
id: "alert.argument_create",
|
|
140
137
|
defaultMessage: "Your contribution has been sent !"
|
|
141
138
|
}),
|
|
142
139
|
{
|
|
143
140
|
type: "success",
|
|
144
|
-
points:
|
|
141
|
+
points: s.formatMessage({
|
|
145
142
|
id: "alert.reply_gain",
|
|
146
143
|
defaultMessage: " "
|
|
147
144
|
})
|
|
148
145
|
}
|
|
149
146
|
);
|
|
150
147
|
else {
|
|
151
|
-
const
|
|
152
|
-
let L =
|
|
153
|
-
t && !m && (L = `argumentList${
|
|
148
|
+
const T = o.data.data.resource;
|
|
149
|
+
let L = I;
|
|
150
|
+
t && !m && (L = `argumentList${T.position.id}`), O?.(
|
|
154
151
|
q,
|
|
155
|
-
a.find((
|
|
156
|
-
),
|
|
157
|
-
|
|
152
|
+
a.find((Ue) => Ue.id === t) || null
|
|
153
|
+
), x.add(L, [T]), $(
|
|
154
|
+
s.formatMessage({
|
|
158
155
|
id: "alert.argument_create",
|
|
159
156
|
defaultMessage: "Your contribution has been sent !"
|
|
160
157
|
}),
|
|
161
158
|
{
|
|
162
159
|
type: "success",
|
|
163
|
-
points:
|
|
160
|
+
points: s.formatMessage({
|
|
164
161
|
id: "alert.argument_create_gain",
|
|
165
162
|
defaultMessage: "Up to 10 eloquence points"
|
|
166
163
|
}),
|
|
@@ -172,49 +169,49 @@ const rt = Re(() => import("../../modal/side_modal/index.js").then((S) => ({ def
|
|
|
172
169
|
typeof window < "u" && window.dispatchEvent(
|
|
173
170
|
new CustomEvent("logora:user_content:created", {
|
|
174
171
|
detail: {
|
|
175
|
-
content:
|
|
172
|
+
content: o.data.data?.resource
|
|
176
173
|
}
|
|
177
174
|
})
|
|
178
175
|
);
|
|
179
176
|
}
|
|
180
177
|
}));
|
|
181
|
-
},
|
|
178
|
+
}, Be = () => {
|
|
182
179
|
const e = {
|
|
183
180
|
content: q,
|
|
184
|
-
rich_content:
|
|
185
|
-
source_ids:
|
|
181
|
+
rich_content: Q,
|
|
182
|
+
source_ids: V?.map((t) => t.id),
|
|
186
183
|
...d && { position_id: d }
|
|
187
184
|
};
|
|
188
|
-
|
|
185
|
+
E(e, de) && K.update("messages", X, e).then((t) => {
|
|
189
186
|
if (t.data.success) {
|
|
190
|
-
const
|
|
191
|
-
let
|
|
192
|
-
if (
|
|
193
|
-
const
|
|
194
|
-
|
|
187
|
+
const l = t.data.data.resource;
|
|
188
|
+
let o = I;
|
|
189
|
+
if (d && !m && (o = `argumentList${l.position?.id}`), ae?.position?.id != l.position?.id && !m && !l.is_reply) {
|
|
190
|
+
const T = `argumentList${ae.position.id}`, L = `argumentList${l.position.id}`;
|
|
191
|
+
x.remove(T, [l]), x.add(L, [l]);
|
|
195
192
|
} else
|
|
196
|
-
|
|
197
|
-
|
|
193
|
+
x.update(o, [l]);
|
|
194
|
+
$(s.formatMessage({ id: "alert.argument_modify" }), {
|
|
198
195
|
type: "success"
|
|
199
|
-
}),
|
|
196
|
+
}), ue();
|
|
200
197
|
}
|
|
201
198
|
});
|
|
202
|
-
},
|
|
203
|
-
if (!
|
|
204
|
-
|
|
199
|
+
}, Ee = () => {
|
|
200
|
+
if (!ee) {
|
|
201
|
+
te(!0);
|
|
205
202
|
const e = setTimeout(() => {
|
|
206
|
-
|
|
203
|
+
te(!1);
|
|
207
204
|
}, 2e3);
|
|
208
205
|
return () => clearTimeout(e);
|
|
209
206
|
}
|
|
210
|
-
},
|
|
211
|
-
g ?
|
|
212
|
-
},
|
|
213
|
-
const e =
|
|
207
|
+
}, R = () => {
|
|
208
|
+
g ? Y({ loginAction: "argument" }) : ne(!0);
|
|
209
|
+
}, Ve = () => {
|
|
210
|
+
const e = S.find(
|
|
214
211
|
(t) => t.id === d
|
|
215
212
|
);
|
|
216
213
|
if (e)
|
|
217
|
-
return
|
|
214
|
+
return s.formatMessage(
|
|
218
215
|
{
|
|
219
216
|
id: "info.argument_side_limit",
|
|
220
217
|
defaultMessage: "You have reached the argument limit (10) for position {position}."
|
|
@@ -222,63 +219,63 @@ const rt = Re(() => import("../../modal/side_modal/index.js").then((S) => ({ def
|
|
|
222
219
|
{ position: e.name }
|
|
223
220
|
);
|
|
224
221
|
};
|
|
225
|
-
return /* @__PURE__ */
|
|
226
|
-
|
|
222
|
+
return /* @__PURE__ */ _("div", { className: n.inputContainer, children: [
|
|
223
|
+
j && /* @__PURE__ */ i("div", { className: n.disabledInputMask, children: oe ? s.formatMessage({
|
|
227
224
|
id: "input.argument_input.user_banned",
|
|
228
225
|
defaultMessage: "You are banned from the debate space."
|
|
229
|
-
}) :
|
|
226
|
+
}) : s.formatMessage({
|
|
230
227
|
id: "info.debate_is_inactive",
|
|
231
228
|
defaultMessage: "Debate is closed"
|
|
232
229
|
}) }),
|
|
233
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ i(
|
|
234
231
|
"div",
|
|
235
232
|
{
|
|
236
|
-
className:
|
|
237
|
-
[n.flash]:
|
|
233
|
+
className: w(n.argumentInput, {
|
|
234
|
+
[n.flash]: ee,
|
|
238
235
|
[n.replyInputContainer]: r
|
|
239
236
|
}),
|
|
240
|
-
children: /* @__PURE__ */
|
|
241
|
-
a.length > 0 &&
|
|
242
|
-
/* @__PURE__ */
|
|
237
|
+
children: /* @__PURE__ */ i("div", { "data-tid": "action_add_argument", ref: H, children: /* @__PURE__ */ _("div", { className: n.argumentInputBox, children: [
|
|
238
|
+
a.length > 0 && A && (!r || !k) && /* @__PURE__ */ _("div", { className: n.userPosition, children: [
|
|
239
|
+
/* @__PURE__ */ i("div", { children: s.formatMessage({
|
|
243
240
|
id: "input.position",
|
|
244
241
|
defaultMessage: "Your position"
|
|
245
242
|
}) }),
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
-
|
|
243
|
+
/* @__PURE__ */ i(
|
|
244
|
+
Ze,
|
|
248
245
|
{
|
|
249
246
|
activeLabel: d === a[0].id ? 0 : d === a[1].id ? 1 : null,
|
|
250
247
|
firstLabel: a[0],
|
|
251
248
|
secondLabel: a[1],
|
|
252
|
-
onChange: (e) =>
|
|
249
|
+
onChange: (e) => p(a[e].id)
|
|
253
250
|
}
|
|
254
251
|
)
|
|
255
252
|
] }),
|
|
256
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ _(
|
|
257
254
|
"div",
|
|
258
255
|
{
|
|
259
|
-
className:
|
|
256
|
+
className: w(n.argumentTextInputBox, {
|
|
260
257
|
[n.argumentTextInputBoxisTablet]: !m,
|
|
261
258
|
[n.replyEditorRow]: r
|
|
262
259
|
}),
|
|
263
260
|
children: [
|
|
264
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ i(
|
|
265
262
|
"div",
|
|
266
263
|
{
|
|
267
|
-
className:
|
|
264
|
+
className: w(n.argumentAuthorContainer, {
|
|
268
265
|
[n.argumentAuthorContainerMobile]: m,
|
|
269
|
-
[n.argumentAuthorContainerActivated]: !m &&
|
|
266
|
+
[n.argumentAuthorContainerActivated]: !m && C || r
|
|
270
267
|
}),
|
|
271
|
-
children: !m &&
|
|
272
|
-
|
|
268
|
+
children: !m && C || r ? /* @__PURE__ */ i(
|
|
269
|
+
et,
|
|
273
270
|
{
|
|
274
271
|
avatarUrl: u.image_url,
|
|
275
272
|
userName: u.full_name,
|
|
276
|
-
size:
|
|
273
|
+
size: me
|
|
277
274
|
}
|
|
278
|
-
) : /* @__PURE__ */
|
|
279
|
-
|
|
275
|
+
) : /* @__PURE__ */ i(
|
|
276
|
+
tt,
|
|
280
277
|
{
|
|
281
|
-
fullName: u?.full_name ||
|
|
278
|
+
fullName: u?.full_name || s.formatMessage({ id: "default_author.full_name" }),
|
|
282
279
|
avatarUrl: u?.image_url,
|
|
283
280
|
points: u?.points || 0,
|
|
284
281
|
slug: u?.hash_id
|
|
@@ -286,60 +283,59 @@ const rt = Re(() => import("../../modal/side_modal/index.js").then((S) => ({ def
|
|
|
286
283
|
)
|
|
287
284
|
}
|
|
288
285
|
),
|
|
289
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ _(
|
|
290
287
|
"div",
|
|
291
288
|
{
|
|
292
|
-
onClick:
|
|
289
|
+
onClick: R,
|
|
293
290
|
"data-testid": "argument-input",
|
|
294
|
-
className:
|
|
291
|
+
className: w(n.textEditorBox, {
|
|
295
292
|
[n.replyTextEditorBox]: r
|
|
296
293
|
}),
|
|
297
294
|
children: [
|
|
298
|
-
/* @__PURE__ */
|
|
299
|
-
|
|
295
|
+
/* @__PURE__ */ i(
|
|
296
|
+
nt,
|
|
300
297
|
{
|
|
301
298
|
handleChange: (e, t) => {
|
|
302
|
-
|
|
299
|
+
Fe(e, t);
|
|
303
300
|
},
|
|
304
301
|
handleSourcesChange: (e) => {
|
|
305
|
-
|
|
302
|
+
Pe(e);
|
|
306
303
|
},
|
|
307
|
-
placeholder:
|
|
308
|
-
"aria-label":
|
|
304
|
+
placeholder: he,
|
|
305
|
+
"aria-label": s.formatMessage({
|
|
309
306
|
id: "input.argument_input.aria_label",
|
|
310
307
|
defaultMessage: "Message input field"
|
|
311
308
|
}),
|
|
312
|
-
onSubmit:
|
|
313
|
-
sources:
|
|
314
|
-
hideSourceAction:
|
|
315
|
-
uid: `Argument${
|
|
316
|
-
onActivation:
|
|
317
|
-
showStylesControls:
|
|
318
|
-
disabled:
|
|
319
|
-
maxLength: g ? !1 :
|
|
320
|
-
disableRichText:
|
|
309
|
+
onSubmit: ye,
|
|
310
|
+
sources: V,
|
|
311
|
+
hideSourceAction: ge || g,
|
|
312
|
+
uid: `Argument${v}`,
|
|
313
|
+
onActivation: R,
|
|
314
|
+
showStylesControls: C,
|
|
315
|
+
disabled: j || g || oe,
|
|
316
|
+
maxLength: g ? !1 : h?.actions?.argumentMaxLength,
|
|
317
|
+
disableRichText: h?.actions?.disableRichText || g,
|
|
321
318
|
shortBar: r,
|
|
322
319
|
hideSubmit: g,
|
|
323
|
-
allowedDomains:
|
|
324
|
-
active:
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
disableAutoActivate: Ce
|
|
320
|
+
allowedDomains: h?.allowed_sources,
|
|
321
|
+
active: F,
|
|
322
|
+
hideCharCount: Me,
|
|
323
|
+
disableAutoActivate: ve
|
|
328
324
|
}
|
|
329
325
|
),
|
|
330
|
-
|
|
331
|
-
|
|
326
|
+
B?.content && /* @__PURE__ */ i("div", { className: n.argumentInputWarning, children: B && Object.values(B).map((e, t) => /* @__PURE__ */ i("div", { children: e }, t)) }),
|
|
327
|
+
C && S?.find(
|
|
332
328
|
(e) => e.id === d
|
|
333
|
-
) && /* @__PURE__ */
|
|
329
|
+
) && /* @__PURE__ */ _(
|
|
334
330
|
"div",
|
|
335
331
|
{
|
|
336
|
-
className:
|
|
332
|
+
className: w(
|
|
337
333
|
n.argumentInputWarning,
|
|
338
334
|
n.disabledPositionWarning
|
|
339
335
|
),
|
|
340
336
|
children: [
|
|
341
|
-
/* @__PURE__ */
|
|
342
|
-
|
|
337
|
+
/* @__PURE__ */ i(
|
|
338
|
+
at,
|
|
343
339
|
{
|
|
344
340
|
name: "announcement",
|
|
345
341
|
className: n.warningIcon,
|
|
@@ -347,25 +343,25 @@ const rt = Re(() => import("../../modal/side_modal/index.js").then((S) => ({ def
|
|
|
347
343
|
width: 20
|
|
348
344
|
}
|
|
349
345
|
),
|
|
350
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ i("div", { className: n.argumentInputWarningText, children: Ve() })
|
|
351
347
|
]
|
|
352
348
|
}
|
|
353
349
|
),
|
|
354
|
-
|
|
355
|
-
|
|
350
|
+
C && J && !_e && /* @__PURE__ */ i("div", { className: n.guideMessage, children: /* @__PURE__ */ i(
|
|
351
|
+
ce,
|
|
356
352
|
{
|
|
357
353
|
id: "alert.guide_message",
|
|
358
354
|
defaultMessage: "Contributions must comply with our {userCharter}.",
|
|
359
355
|
values: {
|
|
360
|
-
userCharter: /* @__PURE__ */
|
|
356
|
+
userCharter: /* @__PURE__ */ i(
|
|
361
357
|
"a",
|
|
362
358
|
{
|
|
363
359
|
className: n.guideMessage,
|
|
364
|
-
href:
|
|
360
|
+
href: J,
|
|
365
361
|
target: "_blank",
|
|
366
362
|
rel: "noreferrer",
|
|
367
|
-
children: /* @__PURE__ */
|
|
368
|
-
|
|
363
|
+
children: /* @__PURE__ */ i(
|
|
364
|
+
ce,
|
|
369
365
|
{
|
|
370
366
|
id: "alert.user_charter",
|
|
371
367
|
defaultMessage: "user charter"
|
|
@@ -388,5 +384,5 @@ const rt = Re(() => import("../../modal/side_modal/index.js").then((S) => ({ def
|
|
|
388
384
|
] });
|
|
389
385
|
};
|
|
390
386
|
export {
|
|
391
|
-
|
|
387
|
+
Nt as ArgumentInput
|
|
392
388
|
};
|