@logora/debate 0.4.37 → 0.4.39
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as o, jsxs as l, Fragment as f } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import E from "classnames";
|
|
3
3
|
import { useState as y, useEffect as le, useCallback as ne, Suspense as de, lazy as ce } from "react";
|
|
4
4
|
import { useIntl as pe } from "react-intl";
|
|
5
5
|
import s from "./Argument.module.scss.js";
|
|
@@ -12,40 +12,40 @@ import { useTranslatedContent as D } from "../../translation/translated_content/
|
|
|
12
12
|
import { SourceListItem as _e } from "../../source/source_list_item/SourceListItem.js";
|
|
13
13
|
import { HashScroll as ge } from "../../tools/hash_scroll/HashScroll.js";
|
|
14
14
|
import { ContentHeader as be } from "../../user_content/content_header/ContentHeader.js";
|
|
15
|
-
import { Icon as
|
|
15
|
+
import { Icon as F } from "../../icons/icon/Icon.js";
|
|
16
16
|
import { ReadMore as Me } from "../../text/read_more/ReadMore.js";
|
|
17
|
-
import { TranslationButton as
|
|
18
|
-
import { ContentFooter as
|
|
17
|
+
import { TranslationButton as Ie } from "../../translation/translation_button/TranslationButton.js";
|
|
18
|
+
import { ContentFooter as ve } from "../../user_content/content_footer/ContentFooter.js";
|
|
19
19
|
import { VoteButton as Ce } from "../../vote/vote_button/VoteButton.js";
|
|
20
20
|
import { VotePaginatedList as Se } from "../../list/paginated_list/VotePaginatedList.js";
|
|
21
21
|
import { UserContentSkeleton as Re } from "../../skeleton/user_content_skeleton/UserContentSkeleton.js";
|
|
22
22
|
import { Button as Te } from "../../action/button/Button.js";
|
|
23
|
-
const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({ default: e.ArgumentInput }))),
|
|
23
|
+
const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({ default: e.ArgumentInput }))), P = (e) => e?.replace(/ /g, " "), we = ({
|
|
24
24
|
argument: e,
|
|
25
25
|
argumentReplies: n,
|
|
26
26
|
nestingLevel: _ = 0,
|
|
27
|
-
maxNestingLevel:
|
|
28
|
-
groupType:
|
|
29
|
-
groupName:
|
|
27
|
+
maxNestingLevel: R = 2,
|
|
28
|
+
groupType: T,
|
|
29
|
+
groupName: N,
|
|
30
30
|
positions: g = [],
|
|
31
|
-
disableLinks:
|
|
31
|
+
disableLinks: j = !1,
|
|
32
32
|
parentArgument: c,
|
|
33
|
-
flashParent:
|
|
34
|
-
expandable:
|
|
33
|
+
flashParent: G,
|
|
34
|
+
expandable: V,
|
|
35
35
|
disabled: b = !1,
|
|
36
|
-
hideFooter:
|
|
37
|
-
hideReplies:
|
|
36
|
+
hideFooter: w = !1,
|
|
37
|
+
hideReplies: A,
|
|
38
38
|
vote: H,
|
|
39
|
-
fixedContentHeight:
|
|
40
|
-
enableEdition:
|
|
41
|
-
enableDeletion:
|
|
42
|
-
deleteListId:
|
|
43
|
-
showModerationFeedback:
|
|
44
|
-
lineCount:
|
|
45
|
-
replyRedirectUrl:
|
|
46
|
-
hideContent:
|
|
39
|
+
fixedContentHeight: z = !1,
|
|
40
|
+
enableEdition: O = !0,
|
|
41
|
+
enableDeletion: Y = !0,
|
|
42
|
+
deleteListId: q,
|
|
43
|
+
showModerationFeedback: J,
|
|
44
|
+
lineCount: K = 5,
|
|
45
|
+
replyRedirectUrl: Q,
|
|
46
|
+
hideContent: W = !1
|
|
47
47
|
}) => {
|
|
48
|
-
const a = pe(), { isLoggedIn:
|
|
48
|
+
const a = pe(), { isLoggedIn: x, currentUser: p } = he(), M = p?.moderation_status === "banned", r = fe(), X = ye(), [m, I] = y(!1), [Z, L] = y(!1), [ee, te] = y(!1), U = ue(e), [u, v] = y(), h = D(
|
|
49
49
|
e.content,
|
|
50
50
|
e.language,
|
|
51
51
|
"content",
|
|
@@ -55,19 +55,19 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
55
55
|
e.position?.language,
|
|
56
56
|
"name",
|
|
57
57
|
e.position?.translation_entries
|
|
58
|
-
),
|
|
58
|
+
), C = `argument_${e.id}`, S = e.position && g?.map((t) => t.id).indexOf(e.position.id) + 1;
|
|
59
59
|
le(() => {
|
|
60
60
|
n !== void 0 && ae();
|
|
61
61
|
}, [n]);
|
|
62
62
|
const se = (t) => {
|
|
63
|
-
if (
|
|
63
|
+
if (C === t) {
|
|
64
64
|
const d = document.getElementById(t);
|
|
65
|
-
d && d.scrollIntoView({ behavior: "smooth" }),
|
|
65
|
+
d && d.scrollIntoView({ behavior: "smooth" }), L(!0);
|
|
66
66
|
}
|
|
67
|
-
}, U = () => {
|
|
68
|
-
te((t) => !t);
|
|
69
67
|
}, k = () => {
|
|
70
|
-
|
|
68
|
+
te((t) => !t);
|
|
69
|
+
}, $ = () => {
|
|
70
|
+
I((t) => !t), v([]);
|
|
71
71
|
}, re = (t) => {
|
|
72
72
|
if (!u?.find((i) => i.id === t.id))
|
|
73
73
|
return t;
|
|
@@ -85,37 +85,37 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
85
85
|
const t = n.filter(
|
|
86
86
|
(i) => i.reply_to_id === e.id
|
|
87
87
|
);
|
|
88
|
-
t.length > 0 && (v(t),
|
|
88
|
+
t.length > 0 && (v(t), I(!0));
|
|
89
89
|
}
|
|
90
|
-
},
|
|
90
|
+
}, B = (t = null) => /* @__PURE__ */ o(
|
|
91
91
|
Ae,
|
|
92
92
|
{
|
|
93
93
|
...t ? { argument: t } : {},
|
|
94
94
|
nestingLevel: _ + 1,
|
|
95
|
-
maxNestingLevel:
|
|
95
|
+
maxNestingLevel: R,
|
|
96
96
|
disabled: b,
|
|
97
|
-
groupName:
|
|
98
|
-
groupType:
|
|
97
|
+
groupName: N,
|
|
98
|
+
groupType: T,
|
|
99
99
|
positions: g,
|
|
100
100
|
argumentReplies: n,
|
|
101
101
|
parentArgument: e,
|
|
102
102
|
flashParent: (i) => se(`argument_${i}`)
|
|
103
103
|
}
|
|
104
104
|
);
|
|
105
|
-
return /* @__PURE__ */ l(ge, { elementId:
|
|
105
|
+
return /* @__PURE__ */ l(ge, { elementId: C, onScroll: () => L(!0), children: [
|
|
106
106
|
/* @__PURE__ */ l(
|
|
107
107
|
"div",
|
|
108
108
|
{
|
|
109
|
-
className:
|
|
109
|
+
className: E(
|
|
110
110
|
s.argument,
|
|
111
111
|
{
|
|
112
112
|
[s.flash]: Z,
|
|
113
113
|
[s.argumentReply]: e.is_reply === !0
|
|
114
114
|
},
|
|
115
115
|
s[`level-${_}`],
|
|
116
|
-
s[`position-${!(e.author.role === "editor" || e.author.role === "moderator") &&
|
|
116
|
+
s[`position-${!(e.author.role === "editor" || e.author.role === "moderator") && S}`]
|
|
117
117
|
),
|
|
118
|
-
id:
|
|
118
|
+
id: C,
|
|
119
119
|
children: [
|
|
120
120
|
/* @__PURE__ */ o(
|
|
121
121
|
be,
|
|
@@ -124,10 +124,10 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
124
124
|
author: e.author,
|
|
125
125
|
tag: (e.author.role === "editor" || e.author.role === "moderator") && e.is_reply ? null : oe.translatedContent,
|
|
126
126
|
date: e.created_at,
|
|
127
|
-
tagClassName: s[`headerPosition-${
|
|
128
|
-
disableLinks:
|
|
127
|
+
tagClassName: s[`headerPosition-${S}`],
|
|
128
|
+
disableLinks: j,
|
|
129
129
|
isDeleted: e.is_deleted,
|
|
130
|
-
showModerationFeedback:
|
|
130
|
+
showModerationFeedback: J ?? (e.status === "rejected" && r.moderation?.showFeedback === !0),
|
|
131
131
|
moderationReason: e.moderation_entry?.moderation_reason,
|
|
132
132
|
moderationNotes: e.moderation_entry?.moderator_notes,
|
|
133
133
|
moderationPolicyUrl: r.provider?.userGuideUrl
|
|
@@ -136,22 +136,22 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
136
136
|
e.is_deleted ? /* @__PURE__ */ o("div", { className: s.argumentDeletedBody, children: a.formatMessage({
|
|
137
137
|
id: "info.deleted_by_user",
|
|
138
138
|
defaultMessage: "Content deleted by the user"
|
|
139
|
-
}) }) :
|
|
139
|
+
}) }) : W ? /* @__PURE__ */ o("div", { className: s.argumentDeletedBody, children: a.formatMessage({
|
|
140
140
|
id: "argument.argument.content_deleted",
|
|
141
141
|
defaultMessage: "This content has been removed."
|
|
142
142
|
}) }) : /* @__PURE__ */ l(f, { children: [
|
|
143
143
|
/* @__PURE__ */ l(
|
|
144
144
|
"div",
|
|
145
145
|
{
|
|
146
|
-
className:
|
|
147
|
-
[s.fixedHeight]: r?.layout?.showAllArgumentInEmbed !== !0 ?
|
|
146
|
+
className: E(s.argumentBody, {
|
|
147
|
+
[s.fixedHeight]: r?.layout?.showAllArgumentInEmbed !== !0 ? z : !1
|
|
148
148
|
}),
|
|
149
149
|
children: [
|
|
150
150
|
e.is_reply && c && /* @__PURE__ */ l(
|
|
151
151
|
"div",
|
|
152
152
|
{
|
|
153
153
|
className: s.replyTo,
|
|
154
|
-
onClick: () =>
|
|
154
|
+
onClick: () => G(c.id),
|
|
155
155
|
children: [
|
|
156
156
|
a.formatMessage({
|
|
157
157
|
id: "info.replying_to",
|
|
@@ -162,7 +162,7 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
162
162
|
id: "info.deleted",
|
|
163
163
|
defaultMessage: "Deleted"
|
|
164
164
|
}) : c.author.full_name,
|
|
165
|
-
/* @__PURE__ */ o(
|
|
165
|
+
/* @__PURE__ */ o(F, { name: "chat", height: 16 })
|
|
166
166
|
] })
|
|
167
167
|
]
|
|
168
168
|
}
|
|
@@ -175,22 +175,22 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
175
175
|
id: "argument.argument.updated",
|
|
176
176
|
defaultMessage: "Updated argument"
|
|
177
177
|
}) }),
|
|
178
|
-
|
|
178
|
+
U && !h.isTranslated ? /* @__PURE__ */ o(
|
|
179
179
|
"div",
|
|
180
180
|
{
|
|
181
181
|
className: s.argumentContent,
|
|
182
|
-
dangerouslySetInnerHTML: { __html:
|
|
182
|
+
dangerouslySetInnerHTML: { __html: P(U) }
|
|
183
183
|
}
|
|
184
|
-
) : /* @__PURE__ */ o("div", { className: s.argumentContent, children:
|
|
184
|
+
) : /* @__PURE__ */ o("div", { className: s.argumentContent, children: P(h.translatedContent) }),
|
|
185
185
|
h.isTranslated && /* @__PURE__ */ o(
|
|
186
|
-
|
|
186
|
+
Ie,
|
|
187
187
|
{
|
|
188
188
|
language: e.language,
|
|
189
189
|
callback: () => h.toggleContent()
|
|
190
190
|
}
|
|
191
191
|
)
|
|
192
192
|
] }),
|
|
193
|
-
lineCount: r?.layout?.showAllArgumentInEmbed !== !0 ?
|
|
193
|
+
lineCount: r?.layout?.showAllArgumentInEmbed !== !0 ? K : void 0,
|
|
194
194
|
readMoreText: a.formatMessage({
|
|
195
195
|
id: "action.read_more",
|
|
196
196
|
defaultMessage: "Read more"
|
|
@@ -199,7 +199,7 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
199
199
|
id: "action.read_less",
|
|
200
200
|
defaultMessage: "Read less"
|
|
201
201
|
}),
|
|
202
|
-
expandable: r?.layout?.showAllArgumentInEmbed !== !0 ?
|
|
202
|
+
expandable: r?.layout?.showAllArgumentInEmbed !== !0 ? V : !1,
|
|
203
203
|
readMoreClassName: e.is_reply ? s.replyStyle : s.argumentStyle
|
|
204
204
|
}
|
|
205
205
|
)
|
|
@@ -208,18 +208,19 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
208
208
|
),
|
|
209
209
|
e.sources?.length > 0 && /* @__PURE__ */ o("div", { className: s.argumentSourcesList, children: e.sources.map(ie) })
|
|
210
210
|
] }),
|
|
211
|
-
!
|
|
212
|
-
|
|
211
|
+
!w && !e.is_deleted && /* @__PURE__ */ o(
|
|
212
|
+
ve,
|
|
213
213
|
{
|
|
214
214
|
resource: e,
|
|
215
|
-
disabled: b || e.status === "rejected" || e.status === "pending" || !
|
|
215
|
+
disabled: b || e.status === "rejected" || e.status === "pending" || !x && r?.actions?.disableInputForVisitor === !0 || M,
|
|
216
|
+
disableEdition: e.status === "rejected" || !x && r?.actions?.disableInputForVisitor === !0 || M,
|
|
216
217
|
reportType: "Message",
|
|
217
218
|
softDelete: r.actions?.softDelete,
|
|
218
219
|
deleteType: "messages",
|
|
219
|
-
deleteListId:
|
|
220
|
-
enableReply: _ <=
|
|
221
|
-
handleReplyTo:
|
|
222
|
-
replyRedirectUrl:
|
|
220
|
+
deleteListId: q,
|
|
221
|
+
enableReply: _ <= R || p.role === "editor" || p.role === "moderator",
|
|
222
|
+
handleReplyTo: k,
|
|
223
|
+
replyRedirectUrl: Q,
|
|
223
224
|
shareUrl: `https://app.logora.fr/share/a/${e.id}`,
|
|
224
225
|
shareTitle: a.formatMessage({
|
|
225
226
|
id: "share.argument.title",
|
|
@@ -234,8 +235,8 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
234
235
|
showShareText: !0,
|
|
235
236
|
showShareButton: r?.actions?.hideShareButton !== !0,
|
|
236
237
|
enableReport: !(e.score === 100 && e.manual_score),
|
|
237
|
-
enableEdition:
|
|
238
|
-
enableDeletion:
|
|
238
|
+
enableEdition: O,
|
|
239
|
+
enableDeletion: Y,
|
|
239
240
|
children: /* @__PURE__ */ o(
|
|
240
241
|
Ce,
|
|
241
242
|
{
|
|
@@ -243,32 +244,32 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
243
244
|
voteableId: e.id,
|
|
244
245
|
totalUpvote: e.upvotes,
|
|
245
246
|
totalDownvote: 0,
|
|
246
|
-
activeClassName: s[`voteButtonPosition-${
|
|
247
|
-
disabled: e.status === "rejected" || p?.id === e?.author?.id ||
|
|
247
|
+
activeClassName: s[`voteButtonPosition-${S}`],
|
|
248
|
+
disabled: e.status === "rejected" || p?.id === e?.author?.id || M
|
|
248
249
|
}
|
|
249
250
|
)
|
|
250
251
|
}
|
|
251
252
|
),
|
|
252
|
-
!
|
|
253
|
+
!w && !A && /* @__PURE__ */ o(
|
|
253
254
|
me,
|
|
254
255
|
{
|
|
255
256
|
numberReplies: e.number_replies,
|
|
256
257
|
repliesAuthors: e.replies_authors,
|
|
257
258
|
expandReplies: m,
|
|
258
|
-
onToggleReplies:
|
|
259
|
+
onToggleReplies: $,
|
|
259
260
|
isReply: e.is_reply
|
|
260
261
|
}
|
|
261
262
|
)
|
|
262
263
|
]
|
|
263
264
|
}
|
|
264
265
|
),
|
|
265
|
-
!
|
|
266
|
+
!A && /* @__PURE__ */ l(f, { children: [
|
|
266
267
|
ee && /* @__PURE__ */ o(de, { fallback: null, children: /* @__PURE__ */ o(
|
|
267
268
|
Ne,
|
|
268
269
|
{
|
|
269
270
|
groupId: e.group_id,
|
|
270
|
-
groupType:
|
|
271
|
-
groupName:
|
|
271
|
+
groupType: T,
|
|
272
|
+
groupName: N,
|
|
272
273
|
positions: g,
|
|
273
274
|
parentId: e.id,
|
|
274
275
|
positionId: H?.position_id,
|
|
@@ -276,7 +277,7 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
276
277
|
hideSourceAction: r?.actions?.disableUserSources || !1,
|
|
277
278
|
onSubmit: (t) => {
|
|
278
279
|
const i = `argument_${e.id}_reply_list`;
|
|
279
|
-
X.add(i, [t]),
|
|
280
|
+
X.add(i, [t]), k(), I(!0);
|
|
280
281
|
},
|
|
281
282
|
onUpdate: (t) => {
|
|
282
283
|
v(
|
|
@@ -297,7 +298,7 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
297
298
|
},
|
|
298
299
|
`Reply${e.id}`
|
|
299
300
|
) }),
|
|
300
|
-
u?.length > 0 && m && /* @__PURE__ */ o("div", { className: s.repliesList, children: u.map((t) =>
|
|
301
|
+
u?.length > 0 && m && /* @__PURE__ */ o("div", { className: s.repliesList, children: u.map((t) => B(t)) }),
|
|
301
302
|
m && /* @__PURE__ */ o("div", { className: s.repliesList, children: /* @__PURE__ */ o(
|
|
302
303
|
Se,
|
|
303
304
|
{
|
|
@@ -316,15 +317,15 @@ const Ne = ce(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
316
317
|
resourcePropName: "argument",
|
|
317
318
|
emptyListComponent: /* @__PURE__ */ o(f, {}),
|
|
318
319
|
transformData: (t) => re(t),
|
|
319
|
-
children:
|
|
320
|
+
children: B(e)
|
|
320
321
|
}
|
|
321
322
|
) }),
|
|
322
323
|
u?.length > 0 && !m && /* @__PURE__ */ o("div", { className: s.repliesList, children: e.number_replies > 1 && /* @__PURE__ */ o("div", { className: s.readMoreLink, children: /* @__PURE__ */ o(
|
|
323
324
|
Te,
|
|
324
325
|
{
|
|
325
326
|
role: "link",
|
|
326
|
-
rightIcon: /* @__PURE__ */ o(
|
|
327
|
-
handleClick:
|
|
327
|
+
rightIcon: /* @__PURE__ */ o(F, { name: "lightArrow", height: 10, width: 10 }),
|
|
328
|
+
handleClick: $,
|
|
328
329
|
children: a.formatMessage({
|
|
329
330
|
id: "argument.argument.see_more",
|
|
330
331
|
defaultMessage: "See more"
|
|
@@ -1,102 +1,103 @@
|
|
|
1
|
-
import { jsxs as r, jsx as t, Fragment as
|
|
2
|
-
import { Suspense as
|
|
3
|
-
import { useIntl as
|
|
4
|
-
import
|
|
1
|
+
import { jsxs as r, jsx as t, Fragment as J } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense as O, lazy as Q } from "react";
|
|
3
|
+
import { useIntl as V } from "react-intl";
|
|
4
|
+
import D from "classnames";
|
|
5
5
|
import e from "./ContentFooter.module.scss.js";
|
|
6
|
-
import { useConfig as
|
|
7
|
-
import { useAuth as
|
|
8
|
-
import { useModal as
|
|
9
|
-
import { useInput as
|
|
10
|
-
import { useReportContent as
|
|
11
|
-
import { useDeleteContent as
|
|
12
|
-
import { useResponsive as
|
|
13
|
-
import { Link as
|
|
14
|
-
import { Icon as
|
|
15
|
-
import { ShareButton as
|
|
16
|
-
import { Dropdown as
|
|
17
|
-
const
|
|
6
|
+
import { useConfig as X } from "../../data/config_provider/useConfig.js";
|
|
7
|
+
import { useAuth as Y } from "../../auth/use_auth/useAuth.js";
|
|
8
|
+
import { useModal as Z } from "../../dialog/modal/useModal.js";
|
|
9
|
+
import { useInput as $ } from "../../input/input_provider/useInput.js";
|
|
10
|
+
import { useReportContent as tt } from "../use_report_content/useReportContent.js";
|
|
11
|
+
import { useDeleteContent as et } from "../use_delete_content/useDeleteContent.js";
|
|
12
|
+
import { useResponsive as ot } from "../../hooks/use_responsive/useResponsive.js";
|
|
13
|
+
import { Link as nt } from "../../action/link/Link.js";
|
|
14
|
+
import { Icon as c } from "../../icons/icon/Icon.js";
|
|
15
|
+
import { ShareButton as at } from "../../share/share_button/ShareButton.js";
|
|
16
|
+
import { Dropdown as rt } from "../../dialog/dropdown/Dropdown.js";
|
|
17
|
+
const it = Q(() => import("../../share/share_modal/index.js").then((o) => ({ default: o.ShareModal }))), bt = ({
|
|
18
18
|
resource: o,
|
|
19
|
-
reportType:
|
|
20
|
-
deleteType:
|
|
21
|
-
deleteListId:
|
|
22
|
-
softDelete:
|
|
23
|
-
disabled:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
19
|
+
reportType: b,
|
|
20
|
+
deleteType: I,
|
|
21
|
+
deleteListId: k,
|
|
22
|
+
softDelete: N = !1,
|
|
23
|
+
disabled: x = !1,
|
|
24
|
+
disableEdition: C = !1,
|
|
25
|
+
children: S,
|
|
26
|
+
enableReply: A,
|
|
27
|
+
handleReplyTo: K,
|
|
28
|
+
showActions: E = !0,
|
|
29
|
+
showShareButton: R = !0,
|
|
30
|
+
shareModal: z,
|
|
31
|
+
shareUrl: m,
|
|
32
|
+
shareTitle: p,
|
|
33
|
+
shareText: u,
|
|
34
|
+
shareModalTitle: P,
|
|
35
|
+
showShareCode: f,
|
|
36
|
+
shareCode: h,
|
|
37
|
+
showShareText: T,
|
|
38
|
+
enableEdition: j = !0,
|
|
39
|
+
enableDeletion: F = !0,
|
|
40
|
+
enableReport: B = !0,
|
|
41
|
+
containerClassName: L,
|
|
42
|
+
voteActionClassName: U,
|
|
43
|
+
replyRedirectUrl: _
|
|
43
44
|
}) => {
|
|
44
|
-
const n =
|
|
45
|
+
const n = V(), g = X(), { currentUser: d } = Y(), { showModal: W } = Z(), { setInputContent: q } = $() || {}, { reportContent: y } = tt(b, o.id), { deleteContent: w } = et(
|
|
45
46
|
o,
|
|
47
|
+
I,
|
|
46
48
|
k,
|
|
47
|
-
N
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (o.created_at && y.actions?.editionTime) {
|
|
49
|
+
N
|
|
50
|
+
), { elementWidth: l } = ot(), G = () => d?.id ? o.author?.id === d?.id || o.debate_suggestion?.author?.id === d?.id : !1, M = () => {
|
|
51
|
+
q(o);
|
|
52
|
+
}, H = () => {
|
|
53
|
+
if (o.created_at && g.actions?.editionTime) {
|
|
53
54
|
const a = new Date(
|
|
54
55
|
new Date(o.created_at).setSeconds(
|
|
55
|
-
new Date(o.created_at).getSeconds() +
|
|
56
|
+
new Date(o.created_at).getSeconds() + g.actions?.editionTime
|
|
56
57
|
)
|
|
57
58
|
);
|
|
58
59
|
return /* @__PURE__ */ new Date() < a;
|
|
59
60
|
}
|
|
60
61
|
return !0;
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
/* @__PURE__ */ t(
|
|
64
|
-
|
|
62
|
+
}, v = () => {
|
|
63
|
+
W(
|
|
64
|
+
/* @__PURE__ */ t(O, { fallback: null, children: /* @__PURE__ */ t(
|
|
65
|
+
it,
|
|
65
66
|
{
|
|
66
|
-
shareUrl:
|
|
67
|
-
shareTitle:
|
|
68
|
-
shareText:
|
|
69
|
-
title:
|
|
70
|
-
showShareCode:
|
|
71
|
-
shareCode:
|
|
67
|
+
shareUrl: m,
|
|
68
|
+
shareTitle: p,
|
|
69
|
+
shareText: u,
|
|
70
|
+
title: P,
|
|
71
|
+
showShareCode: f,
|
|
72
|
+
shareCode: h
|
|
72
73
|
}
|
|
73
74
|
) })
|
|
74
75
|
);
|
|
75
76
|
}, i = (a) => (s) => {
|
|
76
77
|
(s.key === "Enter" || s.key === " ") && (s.preventDefault(), a());
|
|
77
78
|
};
|
|
78
|
-
return /* @__PURE__ */ r("div", { className:
|
|
79
|
+
return /* @__PURE__ */ r("div", { className: D(e.container, L), children: [
|
|
79
80
|
/* @__PURE__ */ t(
|
|
80
81
|
"div",
|
|
81
82
|
{
|
|
82
83
|
onKeyDown: (a) => {
|
|
83
84
|
(a.key === "Enter" || a.key === " ") && (a.preventDefault(), onClick());
|
|
84
85
|
},
|
|
85
|
-
className:
|
|
86
|
+
className: D(e.voteAction, U),
|
|
86
87
|
"data-tid": "action_vote_argument",
|
|
87
|
-
children:
|
|
88
|
+
children: S
|
|
88
89
|
}
|
|
89
90
|
),
|
|
90
|
-
!
|
|
91
|
-
|
|
91
|
+
!x && A && /* @__PURE__ */ t("div", { "data-tid": "action_reply_argument", "data-testid": "reply-button", children: _ ? /* @__PURE__ */ r(
|
|
92
|
+
nt,
|
|
92
93
|
{
|
|
93
|
-
to:
|
|
94
|
+
to: _,
|
|
94
95
|
className: e.replyAction,
|
|
95
96
|
tabIndex: "0",
|
|
96
97
|
"data-testid": "action-reply-button",
|
|
97
98
|
children: [
|
|
98
99
|
/* @__PURE__ */ t(
|
|
99
|
-
|
|
100
|
+
c,
|
|
100
101
|
{
|
|
101
102
|
name: "reply",
|
|
102
103
|
"data-tid": "action_reply_argument",
|
|
@@ -104,7 +105,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
|
|
|
104
105
|
width: 17
|
|
105
106
|
}
|
|
106
107
|
),
|
|
107
|
-
!(
|
|
108
|
+
!(l < 768) && /* @__PURE__ */ t("span", { className: e.replyText, children: n.formatMessage({
|
|
108
109
|
id: "user_content.content_footer.reply",
|
|
109
110
|
defaultMessage: "Reply"
|
|
110
111
|
}) })
|
|
@@ -115,11 +116,11 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
|
|
|
115
116
|
{
|
|
116
117
|
type: "button",
|
|
117
118
|
className: e.replyAction,
|
|
118
|
-
onClick:
|
|
119
|
+
onClick: K,
|
|
119
120
|
"data-testid": "action-reply-button",
|
|
120
121
|
children: [
|
|
121
122
|
/* @__PURE__ */ t(
|
|
122
|
-
|
|
123
|
+
c,
|
|
123
124
|
{
|
|
124
125
|
name: "reply",
|
|
125
126
|
"data-tid": "action_reply_argument",
|
|
@@ -127,27 +128,27 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
|
|
|
127
128
|
width: 17
|
|
128
129
|
}
|
|
129
130
|
),
|
|
130
|
-
!(
|
|
131
|
+
!(l < 768) && /* @__PURE__ */ t("span", { className: e.replyText, children: n.formatMessage({
|
|
131
132
|
id: "user_content.content_footer.reply",
|
|
132
133
|
defaultMessage: "Reply"
|
|
133
134
|
}) })
|
|
134
135
|
]
|
|
135
136
|
}
|
|
136
137
|
) }),
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
R && /* @__PURE__ */ t(
|
|
139
|
+
at,
|
|
139
140
|
{
|
|
140
|
-
shareUrl:
|
|
141
|
-
shareTitle:
|
|
142
|
-
shareText:
|
|
143
|
-
showShareCode:
|
|
144
|
-
shareCode:
|
|
145
|
-
showText: !(
|
|
141
|
+
shareUrl: m,
|
|
142
|
+
shareTitle: p,
|
|
143
|
+
shareText: u,
|
|
144
|
+
showShareCode: f,
|
|
145
|
+
shareCode: h,
|
|
146
|
+
showText: !(l < 768) && T,
|
|
146
147
|
iconSize: 17,
|
|
147
148
|
popoverPosition: "top"
|
|
148
149
|
}
|
|
149
150
|
),
|
|
150
|
-
|
|
151
|
+
E && /* @__PURE__ */ t(
|
|
151
152
|
"div",
|
|
152
153
|
{
|
|
153
154
|
className: e.moreAction,
|
|
@@ -156,14 +157,14 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
|
|
|
156
157
|
defaultMessage: "More options"
|
|
157
158
|
}),
|
|
158
159
|
children: /* @__PURE__ */ r(
|
|
159
|
-
|
|
160
|
+
rt,
|
|
160
161
|
{
|
|
161
162
|
className: e.moreActionDropdown,
|
|
162
163
|
horizontalPosition: "right",
|
|
163
164
|
verticalPosition: "top",
|
|
164
165
|
children: [
|
|
165
166
|
/* @__PURE__ */ t(
|
|
166
|
-
|
|
167
|
+
c,
|
|
167
168
|
{
|
|
168
169
|
name: "ellipsis",
|
|
169
170
|
width: 17,
|
|
@@ -176,29 +177,29 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
|
|
|
176
177
|
}
|
|
177
178
|
),
|
|
178
179
|
/* @__PURE__ */ r("div", { children: [
|
|
179
|
-
|
|
180
|
-
!
|
|
180
|
+
G() && /* @__PURE__ */ r(J, { children: [
|
|
181
|
+
!C && j && H() && /* @__PURE__ */ t(
|
|
181
182
|
"div",
|
|
182
183
|
{
|
|
183
184
|
"data-tid": "action_edit_argument",
|
|
184
185
|
className: e.dropdownItem,
|
|
185
186
|
tabIndex: "0",
|
|
186
|
-
onClick:
|
|
187
|
-
onKeyDown: i(
|
|
187
|
+
onClick: M,
|
|
188
|
+
onKeyDown: i(M),
|
|
188
189
|
children: n.formatMessage({
|
|
189
190
|
id: "user_content.content_footer.update",
|
|
190
191
|
defaultMessage: "Update"
|
|
191
192
|
})
|
|
192
193
|
}
|
|
193
194
|
),
|
|
194
|
-
|
|
195
|
+
F && /* @__PURE__ */ t(
|
|
195
196
|
"div",
|
|
196
197
|
{
|
|
197
198
|
"data-tid": "action_delete_argument",
|
|
198
199
|
className: e.dropdownItem,
|
|
199
200
|
tabIndex: "0",
|
|
200
|
-
onClick:
|
|
201
|
-
onKeyDown: i(
|
|
201
|
+
onClick: w,
|
|
202
|
+
onKeyDown: i(w),
|
|
202
203
|
children: n.formatMessage({
|
|
203
204
|
id: "user_content.content_footer.delete",
|
|
204
205
|
defaultMessage: "Delete"
|
|
@@ -206,29 +207,29 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
|
|
|
206
207
|
}
|
|
207
208
|
)
|
|
208
209
|
] }),
|
|
209
|
-
|
|
210
|
+
B && /* @__PURE__ */ t(
|
|
210
211
|
"div",
|
|
211
212
|
{
|
|
212
213
|
"data-tid": "action_report_argument",
|
|
213
214
|
className: e.dropdownItem,
|
|
214
215
|
tabIndex: "0",
|
|
215
|
-
onClick:
|
|
216
|
+
onClick: y,
|
|
216
217
|
"data-testid": "report-content",
|
|
217
|
-
onKeyDown: i(
|
|
218
|
+
onKeyDown: i(y),
|
|
218
219
|
children: n.formatMessage({
|
|
219
220
|
id: "user_content.content_footer.report",
|
|
220
221
|
defaultMessage: "Report"
|
|
221
222
|
})
|
|
222
223
|
}
|
|
223
224
|
),
|
|
224
|
-
|
|
225
|
+
z && /* @__PURE__ */ t(
|
|
225
226
|
"div",
|
|
226
227
|
{
|
|
227
228
|
"data-tid": "action_share_argument",
|
|
228
229
|
className: e.dropdownItem,
|
|
229
230
|
tabIndex: "0",
|
|
230
|
-
onClick:
|
|
231
|
-
onKeyDown: i(
|
|
231
|
+
onClick: v,
|
|
232
|
+
onKeyDown: i(v),
|
|
232
233
|
children: n.formatMessage({
|
|
233
234
|
id: "user_content.content_footer.share",
|
|
234
235
|
defaultMessage: "Share"
|
|
@@ -244,5 +245,5 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
|
|
|
244
245
|
] });
|
|
245
246
|
};
|
|
246
247
|
export {
|
|
247
|
-
|
|
248
|
+
bt as ContentFooter
|
|
248
249
|
};
|