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