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