@logora/debate 0.4.104 → 0.4.106
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/vote/vote_box/VoteBox.module-OmU1GLQG.css +1 -0
- package/dist/components/data/data_provider/DataProvider.js +49 -49
- package/dist/components/input/argument_input/ArgumentInput.js +245 -203
- package/dist/components/input/text_editor/TextEditor.js +76 -74
- package/dist/components/input/text_editor/plugins/ToolbarPlugin.js +50 -48
- package/dist/components/vote/vote_box/VoteBox.module.scss.js +31 -31
- package/package.json +1 -1
- package/dist/assets/components/vote/vote_box/VoteBox.module-DZcJagif.css +0 -1
|
@@ -1,141 +1,171 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { storePendingReply as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { useIntl as
|
|
5
|
-
import { useLocation as
|
|
1
|
+
import { jsxs as S, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { storePendingReply as Qe } from "../../util/pending_reply/pendingReply.js";
|
|
3
|
+
import { useRef as be, useState as d, useEffect as M, Suspense as Xe, lazy as Ze } from "react";
|
|
4
|
+
import { useIntl as et, FormattedMessage as ve } from "react-intl";
|
|
5
|
+
import { useLocation as tt } from "react-router";
|
|
6
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 { useScrollToEditor as
|
|
16
|
-
import { useSessionStorageState as
|
|
17
|
-
import { useAuthRequired as
|
|
18
|
-
import { useModal as
|
|
19
|
-
import { useToast as
|
|
20
|
-
import { TogglePosition as
|
|
21
|
-
import { Avatar as
|
|
22
|
-
import { AuthorBox as
|
|
23
|
-
import { TextEditor as
|
|
24
|
-
import { Icon as
|
|
25
|
-
const
|
|
26
|
-
argumentListId:
|
|
27
|
-
avatarSize:
|
|
28
|
-
disabled:
|
|
8
|
+
import { useDataProvider as nt } from "../../data/data_provider/useDataProvider.js";
|
|
9
|
+
import { useList as at } from "../../list/list_provider/useList.js";
|
|
10
|
+
import { useConfig as st } from "../../data/config_provider/useConfig.js";
|
|
11
|
+
import { useInput as it } from "../input_provider/useInput.js";
|
|
12
|
+
import { useAuth as ot } from "../../auth/use_auth/useAuth.js";
|
|
13
|
+
import { useFormValidation as rt } from "../../forms/use_form_validation/useFormValidation.js";
|
|
14
|
+
import { useResponsive as ut } from "../../hooks/use_responsive/useResponsive.js";
|
|
15
|
+
import { useScrollToEditor as dt } from "../use_scroll_to_editor/useScrollToEditor.js";
|
|
16
|
+
import { useSessionStorageState as lt } from "../../hooks/use_session_storage_state/useSessionStorageState.js";
|
|
17
|
+
import { useAuthRequired as ct } from "../../hooks/use_auth_required/useAuthRequired.js";
|
|
18
|
+
import { useModal as mt } from "../../dialog/modal/useModal.js";
|
|
19
|
+
import { useToast as ft } from "../../dialog/toast_provider/useToast.js";
|
|
20
|
+
import { TogglePosition as gt } from "../toggle_position/TogglePosition.js";
|
|
21
|
+
import { Avatar as ht } from "../../user/avatar/Avatar.js";
|
|
22
|
+
import { AuthorBox as pt } from "../../user/author_box/AuthorBox.js";
|
|
23
|
+
import { TextEditor as _t } from "../text_editor/TextEditor.js";
|
|
24
|
+
import { Icon as Mt } from "../../icons/icon/Icon.js";
|
|
25
|
+
const bt = Ze(() => import("../../modal/side_modal/index.js").then((x) => ({ default: x.SideModal }))), Ae = 2e4, Rt = ({
|
|
26
|
+
argumentListId: x,
|
|
27
|
+
avatarSize: Se = 48,
|
|
28
|
+
disabled: K = !1,
|
|
29
29
|
positions: a = [],
|
|
30
|
-
disabledPositions:
|
|
30
|
+
disabledPositions: N = [],
|
|
31
31
|
groupId: f,
|
|
32
|
-
groupName:
|
|
33
|
-
groupType:
|
|
34
|
-
hideSourceAction:
|
|
35
|
-
isReply:
|
|
36
|
-
onSubmit:
|
|
37
|
-
onUpdate:
|
|
32
|
+
groupName: we,
|
|
33
|
+
groupType: G,
|
|
34
|
+
hideSourceAction: Ce = !1,
|
|
35
|
+
isReply: o = !1,
|
|
36
|
+
onSubmit: H,
|
|
37
|
+
onUpdate: Q,
|
|
38
38
|
parentId: m,
|
|
39
|
-
ancestorIds:
|
|
40
|
-
placeholder:
|
|
39
|
+
ancestorIds: ye = [],
|
|
40
|
+
placeholder: Ie,
|
|
41
41
|
positionId: w,
|
|
42
|
-
focusOnInit:
|
|
43
|
-
activeOnInit:
|
|
44
|
-
userGuideUrl:
|
|
45
|
-
hideUserGuideLink:
|
|
46
|
-
hideCharCount:
|
|
47
|
-
disableAutoActivate:
|
|
48
|
-
autoFocus:
|
|
42
|
+
focusOnInit: xe = !1,
|
|
43
|
+
activeOnInit: Y = !1,
|
|
44
|
+
userGuideUrl: X,
|
|
45
|
+
hideUserGuideLink: Ne = !1,
|
|
46
|
+
hideCharCount: Te = !1,
|
|
47
|
+
disableAutoActivate: Le = !1,
|
|
48
|
+
autoFocus: Z = !1
|
|
49
49
|
}) => {
|
|
50
|
-
const r =
|
|
51
|
-
focus:
|
|
52
|
-
setFocus:
|
|
53
|
-
inputContent:
|
|
54
|
-
setInputContent:
|
|
55
|
-
setInputRichContent:
|
|
56
|
-
} =
|
|
50
|
+
const r = et(), ee = nt(), T = at(), b = st(), {
|
|
51
|
+
focus: te,
|
|
52
|
+
setFocus: ne,
|
|
53
|
+
inputContent: $,
|
|
54
|
+
setInputContent: ae,
|
|
55
|
+
setInputRichContent: Pe
|
|
56
|
+
} = it(), { isLoggedIn: C, currentUser: l } = ot(), { errors: U, validate: q } = rt(), { isMobile: g } = ut(), Fe = tt(), se = be(null), L = dt(se), [V, D] = d([]), [W, k] = d(""), [ie, O] = d(null), [c, v] = d(null), [oe, re] = d(null), [ue, de] = d(!1), [y, le] = d(!1), [A, ce] = d({}), [Ee, R] = d(!1), [Be, Ye] = d(0), P = be(!1), [$e, me] = d(!1), [h, Ue] = lt(
|
|
57
57
|
"userSide",
|
|
58
58
|
{}
|
|
59
|
-
), [p,
|
|
60
|
-
!
|
|
61
|
-
),
|
|
62
|
-
typeof window < "u" ? window.location.search :
|
|
59
|
+
), [p, qe] = d(
|
|
60
|
+
!C && b?.actions?.disableInputForVisitor
|
|
61
|
+
), j = ct(), { showModal: Ve } = mt(), { toast: F } = ft() || {}, fe = new URLSearchParams(
|
|
62
|
+
typeof window < "u" ? window.location.search : Fe.search
|
|
63
63
|
);
|
|
64
64
|
M(() => {
|
|
65
|
-
|
|
66
|
-
!
|
|
65
|
+
qe(
|
|
66
|
+
!C && b?.actions?.disableInputForVisitor
|
|
67
67
|
);
|
|
68
|
-
}, [
|
|
69
|
-
const z =
|
|
68
|
+
}, [C, b]);
|
|
69
|
+
const z = l?.role === "editor" || l?.role === "moderator", ge = l?.moderation_status === "banned";
|
|
70
70
|
M(() => {
|
|
71
71
|
let e = null;
|
|
72
|
-
typeof window < "u" && (e =
|
|
72
|
+
typeof window < "u" && (e = fe.get("positionId")), w && w != a[2]?.id && a?.find((t) => t.id === w) ? v(w) : e && e != a[2]?.id ? v(e) : h && h.groupId == f && h.positionId != a[2]?.id && v(h.positionId);
|
|
73
73
|
}, [w]), M(() => {
|
|
74
|
-
|
|
75
|
-
}, [
|
|
76
|
-
|
|
77
|
-
}, [
|
|
74
|
+
Z && R(!0);
|
|
75
|
+
}, [Z]), M(() => {
|
|
76
|
+
Y && (J(), R(!0), L());
|
|
77
|
+
}, [Y]), M(() => {
|
|
78
78
|
if (typeof window < "u") {
|
|
79
|
-
const e =
|
|
80
|
-
(e === !0 || e === "true") && (
|
|
79
|
+
const e = xe || fe.get("initArgument");
|
|
80
|
+
(e === !0 || e === "true") && (R(!0), L(), Ke());
|
|
81
81
|
}
|
|
82
82
|
}, []), M(() => {
|
|
83
|
-
|
|
84
|
-
}, [
|
|
85
|
-
|
|
86
|
-
}, [
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
83
|
+
te && !o && (L(), ne(!1));
|
|
84
|
+
}, [te]), M(() => {
|
|
85
|
+
$?.id && !o && (De($), ne(!0));
|
|
86
|
+
}, [$]);
|
|
87
|
+
const De = (e) => {
|
|
88
|
+
ce(e), le(!0), D(e.sources), k(e.content), O(e.rich_content), re(e.id), L(), v(e.position?.id), JSON.parse(e.rich_content).hasOwnProperty("root") ? Pe(e.rich_content) : ae(e.content);
|
|
89
|
+
}, he = () => {
|
|
90
|
+
k(""), O(null), ce({}), re(null), D([]), Ye((e) => e + 1), ae(null);
|
|
91
|
+
}, We = {
|
|
92
|
+
create: {
|
|
93
|
+
id: "alert.argument_create_error",
|
|
94
|
+
defaultMessage: "Your contribution could not be sent. Please try again."
|
|
95
|
+
},
|
|
96
|
+
update: {
|
|
97
|
+
id: "alert.argument_modify_error",
|
|
98
|
+
defaultMessage: "Your contribution could not be saved. Please try again."
|
|
99
|
+
},
|
|
100
|
+
rateLimited: {
|
|
101
|
+
id: "alert.argument_rate_limited",
|
|
102
|
+
defaultMessage: "Your contribution could not be sent. Please try again in a few moments."
|
|
103
|
+
}
|
|
104
|
+
}, E = (e, t) => {
|
|
105
|
+
t && console.error("[ArgumentInput] submission failed", t);
|
|
106
|
+
const { id: u, defaultMessage: i } = We[t?.response?.status === 429 ? "rateLimited" : e];
|
|
107
|
+
F?.(r.formatMessage({ id: u, defaultMessage: i }), { type: "error" });
|
|
108
|
+
}, pe = async (e) => {
|
|
109
|
+
P.current = !0, me(!0);
|
|
110
|
+
try {
|
|
111
|
+
return await e();
|
|
112
|
+
} finally {
|
|
113
|
+
P.current = !1, me(!1);
|
|
114
|
+
}
|
|
115
|
+
}, ke = (e) => {
|
|
116
|
+
v(e), Me(e);
|
|
117
|
+
}, Oe = () => {
|
|
118
|
+
Ve(
|
|
119
|
+
/* @__PURE__ */ s(Xe, { fallback: null, children: /* @__PURE__ */ s(
|
|
120
|
+
bt,
|
|
97
121
|
{
|
|
98
122
|
modalTitle: r.formatMessage({
|
|
99
123
|
id: "modal.side_modal.modal_title",
|
|
100
124
|
defaultMessage: "Choose your side"
|
|
101
125
|
}),
|
|
102
|
-
onChooseSide:
|
|
126
|
+
onChooseSide: ke,
|
|
103
127
|
positions: a,
|
|
104
|
-
title:
|
|
105
|
-
disabledPositions: !
|
|
128
|
+
title: we,
|
|
129
|
+
disabledPositions: !o && N,
|
|
106
130
|
isNeutral: h && h.groupId == f && h.positionId === a[2]?.id
|
|
107
131
|
}
|
|
108
132
|
) })
|
|
109
133
|
);
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
},
|
|
113
|
-
p ?
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
},
|
|
134
|
+
}, Re = () => {
|
|
135
|
+
C ? oe ? Je() : !a || a?.length === 0 || !N?.find((e) => e?.id === c) && c || z && o ? Me(o && z && a[0]?.id) : Oe() : (m && Qe({ groupId: f, parentId: m, ancestorIds: ye }), j({ loginAction: "argument" }));
|
|
136
|
+
}, je = (e, t) => {
|
|
137
|
+
p ? j({ loginAction: "argument" }) : (k(e), O(t), q({ content: e }, [{ content: ["url", null] }]));
|
|
138
|
+
}, ze = (e) => {
|
|
139
|
+
D(e);
|
|
140
|
+
}, _e = [
|
|
117
141
|
{ content: ["length", 3] },
|
|
118
142
|
{ content: ["required", null] },
|
|
119
143
|
{ content: ["url", null] },
|
|
120
144
|
...!a || a?.length === 0 ? [] : [{ position_id: ["required", null] }]
|
|
121
|
-
],
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
145
|
+
], Me = (e) => {
|
|
146
|
+
if (P.current)
|
|
147
|
+
return;
|
|
148
|
+
const t = e || c, u = {
|
|
149
|
+
content: W,
|
|
150
|
+
rich_content: ie,
|
|
125
151
|
group_id: f,
|
|
126
|
-
...
|
|
152
|
+
...G && { group_type: G },
|
|
127
153
|
...t && { position_id: t },
|
|
128
154
|
is_reply: !!m,
|
|
129
155
|
message_id: m || null,
|
|
130
|
-
source_ids: V?.map((
|
|
156
|
+
source_ids: V?.map((i) => i.id)
|
|
131
157
|
};
|
|
132
|
-
|
|
158
|
+
q(u, _e) && (t && a && a.map((i) => i.id).includes(t) && Ue({
|
|
133
159
|
groupId: f,
|
|
134
160
|
positionId: t
|
|
135
|
-
}),
|
|
136
|
-
|
|
161
|
+
}), pe(
|
|
162
|
+
() => ee.create("messages", u, {}, !0, {
|
|
163
|
+
timeout: Ae
|
|
164
|
+
})
|
|
165
|
+
).then((i) => {
|
|
166
|
+
if (i?.data?.success) {
|
|
137
167
|
if (m)
|
|
138
|
-
|
|
168
|
+
H(i.data.data.resource), F(
|
|
139
169
|
r.formatMessage({
|
|
140
170
|
id: "alert.argument_create",
|
|
141
171
|
defaultMessage: "Your contribution has been sent !"
|
|
@@ -149,12 +179,12 @@ const mt = Re(() => import("../../modal/side_modal/index.js").then((N) => ({ def
|
|
|
149
179
|
}
|
|
150
180
|
);
|
|
151
181
|
else {
|
|
152
|
-
const _ =
|
|
153
|
-
let
|
|
154
|
-
t && !g && (
|
|
155
|
-
|
|
156
|
-
a.find((
|
|
157
|
-
),
|
|
182
|
+
const _ = i.data.data.resource;
|
|
183
|
+
let B = x;
|
|
184
|
+
t && !g && (B = `argumentList${_.position.id}`), H?.(
|
|
185
|
+
W,
|
|
186
|
+
a.find((He) => He.id === t) || null
|
|
187
|
+
), T.add(B, [_]), F(
|
|
158
188
|
r.formatMessage({
|
|
159
189
|
id: "alert.argument_create",
|
|
160
190
|
defaultMessage: "Your contribution has been sent !"
|
|
@@ -166,57 +196,68 @@ const mt = Re(() => import("../../modal/side_modal/index.js").then((N) => ({ def
|
|
|
166
196
|
defaultMessage: "Up to 10 eloquence points"
|
|
167
197
|
}),
|
|
168
198
|
category: "ARGUMENT",
|
|
169
|
-
contentKey:
|
|
199
|
+
contentKey: l.messages_count === 2 ? "alert.third_argument" : "alert.first_argument"
|
|
170
200
|
}
|
|
171
201
|
);
|
|
172
202
|
}
|
|
173
203
|
typeof window < "u" && window.dispatchEvent(
|
|
174
204
|
new CustomEvent("logora:user_content:created", {
|
|
175
205
|
detail: {
|
|
176
|
-
content:
|
|
206
|
+
content: i.data.data?.resource
|
|
177
207
|
}
|
|
178
208
|
})
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
|
|
209
|
+
), he();
|
|
210
|
+
} else
|
|
211
|
+
E("create");
|
|
212
|
+
}, (i) => E("create", i)));
|
|
213
|
+
}, Je = () => {
|
|
214
|
+
if (P.current)
|
|
215
|
+
return;
|
|
183
216
|
const e = {
|
|
184
|
-
content:
|
|
185
|
-
rich_content:
|
|
217
|
+
content: W,
|
|
218
|
+
rich_content: ie,
|
|
186
219
|
source_ids: V?.map((t) => t.id),
|
|
187
|
-
...
|
|
220
|
+
...c && { position_id: c }
|
|
188
221
|
};
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
222
|
+
q(e, _e) && pe(
|
|
223
|
+
() => ee.update("messages", oe, e, {}, !0, {
|
|
224
|
+
timeout: Ae
|
|
225
|
+
})
|
|
226
|
+
).then(
|
|
227
|
+
(t) => {
|
|
228
|
+
if (t?.data?.success) {
|
|
229
|
+
const u = t.data.data.resource;
|
|
230
|
+
let i = x;
|
|
231
|
+
if (A?.is_reply || o) {
|
|
232
|
+
const _ = A?.message_id || A?.reply_to_id || m;
|
|
233
|
+
_ && (i = `argument_${_}_reply_list`);
|
|
234
|
+
} else c && !g && (i = `argumentList${u.position?.id}`);
|
|
235
|
+
if (!A?.is_reply && A?.position?.id != u.position?.id && !g) {
|
|
236
|
+
const _ = `argumentList${A.position.id}`, B = `argumentList${u.position.id}`;
|
|
237
|
+
T.remove(_, [u]), T.add(B, [u]);
|
|
238
|
+
} else
|
|
239
|
+
T.update(i, [u]);
|
|
240
|
+
Q && Q(u), F(r.formatMessage({ id: "alert.argument_modify" }), {
|
|
241
|
+
type: "success"
|
|
242
|
+
}), he();
|
|
200
243
|
} else
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
if (!oe) {
|
|
209
|
-
re(!0);
|
|
244
|
+
E("update");
|
|
245
|
+
},
|
|
246
|
+
(t) => E("update", t)
|
|
247
|
+
);
|
|
248
|
+
}, Ke = () => {
|
|
249
|
+
if (!ue) {
|
|
250
|
+
de(!0);
|
|
210
251
|
const e = setTimeout(() => {
|
|
211
|
-
|
|
252
|
+
de(!1);
|
|
212
253
|
}, 2e3);
|
|
213
254
|
return () => clearTimeout(e);
|
|
214
255
|
}
|
|
215
|
-
},
|
|
216
|
-
p ?
|
|
217
|
-
},
|
|
218
|
-
const e =
|
|
219
|
-
(t) => t.id ===
|
|
256
|
+
}, J = () => {
|
|
257
|
+
p ? j({ loginAction: "argument" }) : le(!0);
|
|
258
|
+
}, Ge = () => {
|
|
259
|
+
const e = N.find(
|
|
260
|
+
(t) => t.id === c
|
|
220
261
|
);
|
|
221
262
|
if (e)
|
|
222
263
|
return r.formatMessage(
|
|
@@ -227,117 +268,118 @@ const mt = Re(() => import("../../modal/side_modal/index.js").then((N) => ({ def
|
|
|
227
268
|
{ position: e.name }
|
|
228
269
|
);
|
|
229
270
|
};
|
|
230
|
-
return /* @__PURE__ */
|
|
231
|
-
|
|
271
|
+
return /* @__PURE__ */ S("div", { className: n.inputContainer, children: [
|
|
272
|
+
K && /* @__PURE__ */ s("div", { className: n.disabledInputMask, children: ge ? r.formatMessage({
|
|
232
273
|
id: "input.argument_input.user_banned",
|
|
233
274
|
defaultMessage: "You are banned from the debate space."
|
|
234
275
|
}) : r.formatMessage({
|
|
235
276
|
id: "info.debate_is_inactive",
|
|
236
277
|
defaultMessage: "Debate is closed"
|
|
237
278
|
}) }),
|
|
238
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ s(
|
|
239
280
|
"div",
|
|
240
281
|
{
|
|
241
282
|
className: I(n.argumentInput, {
|
|
242
|
-
[n.flash]:
|
|
243
|
-
[n.replyInputContainer]:
|
|
283
|
+
[n.flash]: ue,
|
|
284
|
+
[n.replyInputContainer]: o
|
|
244
285
|
}),
|
|
245
|
-
children: /* @__PURE__ */
|
|
246
|
-
a.length > 0 &&
|
|
247
|
-
/* @__PURE__ */
|
|
286
|
+
children: /* @__PURE__ */ s("div", { "data-tid": "action_add_argument", ref: se, children: /* @__PURE__ */ S("div", { className: n.argumentInputBox, children: [
|
|
287
|
+
a.length > 0 && C && (!o || !z) && /* @__PURE__ */ S("div", { className: n.userPosition, children: [
|
|
288
|
+
/* @__PURE__ */ s("div", { children: r.formatMessage({
|
|
248
289
|
id: "input.position",
|
|
249
290
|
defaultMessage: "Your position"
|
|
250
291
|
}) }),
|
|
251
|
-
/* @__PURE__ */
|
|
252
|
-
|
|
292
|
+
/* @__PURE__ */ s(
|
|
293
|
+
gt,
|
|
253
294
|
{
|
|
254
|
-
activeLabel:
|
|
295
|
+
activeLabel: c === a[0].id ? 0 : c === a[1].id ? 1 : null,
|
|
255
296
|
firstLabel: a[0],
|
|
256
297
|
secondLabel: a[1],
|
|
257
|
-
onChange: (e) =>
|
|
298
|
+
onChange: (e) => v(a[e].id)
|
|
258
299
|
}
|
|
259
300
|
)
|
|
260
301
|
] }),
|
|
261
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ S(
|
|
262
303
|
"div",
|
|
263
304
|
{
|
|
264
305
|
className: I(n.argumentTextInputBox, {
|
|
265
306
|
[n.argumentTextInputBoxisTablet]: !g,
|
|
266
|
-
[n.replyEditorRow]:
|
|
307
|
+
[n.replyEditorRow]: o
|
|
267
308
|
}),
|
|
268
309
|
children: [
|
|
269
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ s(
|
|
270
311
|
"div",
|
|
271
312
|
{
|
|
272
313
|
className: I(n.argumentAuthorContainer, {
|
|
273
314
|
[n.argumentAuthorContainerMobile]: g,
|
|
274
|
-
[n.argumentAuthorContainerActivated]: !g &&
|
|
315
|
+
[n.argumentAuthorContainerActivated]: !g && y || o
|
|
275
316
|
}),
|
|
276
|
-
children: !g &&
|
|
277
|
-
|
|
317
|
+
children: !g && y || o ? /* @__PURE__ */ s(
|
|
318
|
+
ht,
|
|
278
319
|
{
|
|
279
|
-
avatarUrl:
|
|
280
|
-
userName:
|
|
281
|
-
size:
|
|
320
|
+
avatarUrl: l.image_url,
|
|
321
|
+
userName: l.full_name,
|
|
322
|
+
size: Se
|
|
282
323
|
}
|
|
283
|
-
) : /* @__PURE__ */
|
|
284
|
-
|
|
324
|
+
) : /* @__PURE__ */ s(
|
|
325
|
+
pt,
|
|
285
326
|
{
|
|
286
|
-
fullName:
|
|
287
|
-
avatarUrl:
|
|
288
|
-
points:
|
|
289
|
-
slug:
|
|
327
|
+
fullName: l?.full_name || r.formatMessage({ id: "default_author.full_name" }),
|
|
328
|
+
avatarUrl: l?.image_url,
|
|
329
|
+
points: l?.points || 0,
|
|
330
|
+
slug: l?.hash_id
|
|
290
331
|
}
|
|
291
332
|
)
|
|
292
333
|
}
|
|
293
334
|
),
|
|
294
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ S(
|
|
295
336
|
"div",
|
|
296
337
|
{
|
|
297
|
-
onClick:
|
|
338
|
+
onClick: J,
|
|
298
339
|
"data-testid": "argument-input",
|
|
299
340
|
className: I(n.textEditorBox, {
|
|
300
|
-
[n.replyTextEditorBox]:
|
|
341
|
+
[n.replyTextEditorBox]: o
|
|
301
342
|
}),
|
|
302
343
|
children: [
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
|
|
344
|
+
/* @__PURE__ */ s(
|
|
345
|
+
_t,
|
|
305
346
|
{
|
|
306
347
|
handleChange: (e, t) => {
|
|
307
|
-
|
|
348
|
+
je(e, t);
|
|
308
349
|
},
|
|
309
350
|
handleSourcesChange: (e) => {
|
|
310
|
-
|
|
351
|
+
ze(e);
|
|
311
352
|
},
|
|
312
|
-
placeholder:
|
|
353
|
+
placeholder: Ie,
|
|
313
354
|
"aria-label": r.formatMessage({
|
|
314
355
|
id: "input.argument_input.aria_label",
|
|
315
356
|
defaultMessage: "Message input field"
|
|
316
357
|
}),
|
|
317
|
-
onSubmit:
|
|
358
|
+
onSubmit: Re,
|
|
318
359
|
sources: V,
|
|
319
|
-
hideSourceAction:
|
|
360
|
+
hideSourceAction: Ce || p,
|
|
320
361
|
uid: m ? `Reply${f}_${m}` : `Argument${f}`,
|
|
321
|
-
onActivation:
|
|
322
|
-
showStylesControls:
|
|
323
|
-
disabled:
|
|
324
|
-
maxLength: p ? !1 :
|
|
325
|
-
disableRichText:
|
|
326
|
-
shortBar:
|
|
327
|
-
isReply:
|
|
328
|
-
resetSignal:
|
|
362
|
+
onActivation: J,
|
|
363
|
+
showStylesControls: y,
|
|
364
|
+
disabled: K || p || ge,
|
|
365
|
+
maxLength: p ? !1 : b?.actions?.argumentMaxLength,
|
|
366
|
+
disableRichText: b?.actions?.disableRichText || p,
|
|
367
|
+
shortBar: o,
|
|
368
|
+
isReply: o,
|
|
369
|
+
resetSignal: Be,
|
|
329
370
|
hideSubmit: p,
|
|
330
|
-
allowedDomains:
|
|
331
|
-
active:
|
|
332
|
-
autoFocus:
|
|
333
|
-
hideCharCount:
|
|
334
|
-
disableAutoActivate:
|
|
371
|
+
allowedDomains: b?.allowed_sources,
|
|
372
|
+
active: Y,
|
|
373
|
+
autoFocus: Ee,
|
|
374
|
+
hideCharCount: Te,
|
|
375
|
+
disableAutoActivate: Le,
|
|
376
|
+
submitting: $e
|
|
335
377
|
}
|
|
336
378
|
),
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
(e) => e.id ===
|
|
340
|
-
) && /* @__PURE__ */
|
|
379
|
+
U?.content && /* @__PURE__ */ s("div", { className: n.argumentInputWarning, children: U && Object.values(U).map((e, t) => /* @__PURE__ */ s("div", { children: e }, t)) }),
|
|
380
|
+
y && N?.find(
|
|
381
|
+
(e) => e.id === c
|
|
382
|
+
) && /* @__PURE__ */ S(
|
|
341
383
|
"div",
|
|
342
384
|
{
|
|
343
385
|
className: I(
|
|
@@ -345,8 +387,8 @@ const mt = Re(() => import("../../modal/side_modal/index.js").then((N) => ({ def
|
|
|
345
387
|
n.disabledPositionWarning
|
|
346
388
|
),
|
|
347
389
|
children: [
|
|
348
|
-
/* @__PURE__ */
|
|
349
|
-
|
|
390
|
+
/* @__PURE__ */ s(
|
|
391
|
+
Mt,
|
|
350
392
|
{
|
|
351
393
|
name: "announcement",
|
|
352
394
|
className: n.warningIcon,
|
|
@@ -354,25 +396,25 @@ const mt = Re(() => import("../../modal/side_modal/index.js").then((N) => ({ def
|
|
|
354
396
|
width: 20
|
|
355
397
|
}
|
|
356
398
|
),
|
|
357
|
-
/* @__PURE__ */
|
|
399
|
+
/* @__PURE__ */ s("div", { className: n.argumentInputWarningText, children: Ge() })
|
|
358
400
|
]
|
|
359
401
|
}
|
|
360
402
|
),
|
|
361
|
-
|
|
362
|
-
|
|
403
|
+
y && X && !Ne && /* @__PURE__ */ s("div", { className: n.guideMessage, children: /* @__PURE__ */ s(
|
|
404
|
+
ve,
|
|
363
405
|
{
|
|
364
406
|
id: "alert.guide_message",
|
|
365
407
|
defaultMessage: "Contributions must comply with our {userCharter}.",
|
|
366
408
|
values: {
|
|
367
|
-
userCharter: /* @__PURE__ */
|
|
409
|
+
userCharter: /* @__PURE__ */ s(
|
|
368
410
|
"a",
|
|
369
411
|
{
|
|
370
412
|
className: n.guideMessage,
|
|
371
|
-
href:
|
|
413
|
+
href: X,
|
|
372
414
|
target: "_blank",
|
|
373
415
|
rel: "noreferrer",
|
|
374
|
-
children: /* @__PURE__ */
|
|
375
|
-
|
|
416
|
+
children: /* @__PURE__ */ s(
|
|
417
|
+
ve,
|
|
376
418
|
{
|
|
377
419
|
id: "alert.user_charter",
|
|
378
420
|
defaultMessage: "user charter"
|
|
@@ -395,5 +437,5 @@ const mt = Re(() => import("../../modal/side_modal/index.js").then((N) => ({ def
|
|
|
395
437
|
] });
|
|
396
438
|
};
|
|
397
439
|
export {
|
|
398
|
-
|
|
440
|
+
Rt as ArgumentInput
|
|
399
441
|
};
|