@logora/debate 0.4.102 → 0.4.104
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/input/argument_input/ArgumentInput.js +151 -150
- package/dist/components/input/use_scroll_to_editor/useScrollToEditor.js +20 -0
- package/dist/components/util/pending_reply/pendingReply.js +32 -0
- package/dist/index.js +36 -34
- package/package.json +1 -1
|
@@ -1,197 +1,222 @@
|
|
|
1
|
-
import { jsx as o, jsxs as l, Fragment as
|
|
2
|
-
import { buildShareUrl as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
1
|
+
import { jsx as o, jsxs as l, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import { buildShareUrl as be } from "../../tools/share_url/index.js";
|
|
3
|
+
import { readPendingReply as Ie, clearPendingReply as Re } from "../../util/pending_reply/pendingReply.js";
|
|
4
|
+
import G from "classnames";
|
|
5
|
+
import { useState as p, useRef as V, useEffect as H, useCallback as Se, Suspense as Me, lazy as ve } from "react";
|
|
6
|
+
import { useIntl as Ce } from "react-intl";
|
|
6
7
|
import s from "./Argument.module.scss.js";
|
|
7
|
-
import { ReplyFooter as
|
|
8
|
-
import { useRichContent as
|
|
9
|
-
import { useAuth as
|
|
10
|
-
import { useConfig as
|
|
11
|
-
import { useList as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
|
|
8
|
+
import { ReplyFooter as Te } from "./ReplyFooter.js";
|
|
9
|
+
import { useRichContent as Ne } from "./useRichContent.js";
|
|
10
|
+
import { useAuth as we } from "../../auth/use_auth/useAuth.js";
|
|
11
|
+
import { useConfig as xe } from "../../data/config_provider/useConfig.js";
|
|
12
|
+
import { useList as Ae } from "../../list/list_provider/useList.js";
|
|
13
|
+
import { useDataProvider as Le } from "../../data/data_provider/useDataProvider.js";
|
|
14
|
+
import { useTranslatedContent as O } from "../../translation/translated_content/useTranslatedContent.js";
|
|
15
|
+
import { SourceListItem as Ue } from "../../source/source_list_item/SourceListItem.js";
|
|
16
|
+
import { HashScroll as Pe } from "../../tools/hash_scroll/HashScroll.js";
|
|
17
|
+
import { ContentHeader as ke } from "../../user_content/content_header/ContentHeader.js";
|
|
18
|
+
import { Icon as z } from "../../icons/icon/Icon.js";
|
|
19
|
+
import { ReadMore as Be } from "../../text/read_more/ReadMore.js";
|
|
20
|
+
import { TranslationButton as $e } from "../../translation/translation_button/TranslationButton.js";
|
|
21
|
+
import { ContentFooter as Ee } from "../../user_content/content_footer/ContentFooter.js";
|
|
22
|
+
import { VoteButton as De } from "../../vote/vote_button/VoteButton.js";
|
|
23
|
+
import { VotePaginatedList as Fe } from "../../list/paginated_list/VotePaginatedList.js";
|
|
24
|
+
import { UserContentSkeleton as je } from "../../skeleton/user_content_skeleton/UserContentSkeleton.js";
|
|
25
|
+
import { Button as Ge } from "../../action/button/Button.js";
|
|
26
|
+
const Ve = ve(() => import("../../input/argument_input/index.js").then((e) => ({ default: e.ArgumentInput }))), Y = (e) => e?.replace(/ /g, " "), He = ({
|
|
25
27
|
argument: e,
|
|
26
|
-
argumentReplies:
|
|
27
|
-
nestingLevel:
|
|
28
|
-
maxNestingLevel:
|
|
29
|
-
groupType:
|
|
30
|
-
groupName:
|
|
31
|
-
positions:
|
|
32
|
-
disableLinks:
|
|
33
|
-
parentArgument:
|
|
34
|
-
flashParent:
|
|
35
|
-
expandable:
|
|
36
|
-
disabled:
|
|
37
|
-
hideFooter:
|
|
38
|
-
hideReplies:
|
|
39
|
-
vote:
|
|
40
|
-
fixedContentHeight:
|
|
41
|
-
enableEdition:
|
|
42
|
-
enableDeletion:
|
|
43
|
-
deleteListId:
|
|
44
|
-
showModerationFeedback:
|
|
45
|
-
lineCount:
|
|
46
|
-
replyRedirectUrl:
|
|
47
|
-
hideContent:
|
|
28
|
+
argumentReplies: d,
|
|
29
|
+
nestingLevel: I = 0,
|
|
30
|
+
maxNestingLevel: N = 2,
|
|
31
|
+
groupType: w,
|
|
32
|
+
groupName: x,
|
|
33
|
+
positions: R = [],
|
|
34
|
+
disableLinks: q = !1,
|
|
35
|
+
parentArgument: u,
|
|
36
|
+
flashParent: J,
|
|
37
|
+
expandable: K,
|
|
38
|
+
disabled: S = !1,
|
|
39
|
+
hideFooter: A = !1,
|
|
40
|
+
hideReplies: L,
|
|
41
|
+
vote: Q,
|
|
42
|
+
fixedContentHeight: W = !1,
|
|
43
|
+
enableEdition: X = !0,
|
|
44
|
+
enableDeletion: Z = !0,
|
|
45
|
+
deleteListId: ee,
|
|
46
|
+
showModerationFeedback: te,
|
|
47
|
+
lineCount: oe = 5,
|
|
48
|
+
replyRedirectUrl: se,
|
|
49
|
+
hideContent: re = !1,
|
|
50
|
+
ancestorIds: U = []
|
|
48
51
|
}) => {
|
|
49
|
-
const a =
|
|
52
|
+
const a = Ce(), { isLoggedIn: m, currentUser: f } = we(), M = f?.moderation_status === "banned", i = xe(), ie = Ae(), ne = Le(), [h, c] = p(!1), [ae, P] = p(!1), [le, k] = p(!1), [de, ce] = p(!1), B = Ne(e), [g, y] = p(), $ = V(null), E = V(!1), _ = O(
|
|
50
53
|
e.content,
|
|
51
54
|
e.language,
|
|
52
55
|
"content",
|
|
53
56
|
e.translation_entries
|
|
54
|
-
),
|
|
57
|
+
), pe = O(
|
|
55
58
|
e.position?.name,
|
|
56
59
|
e.position?.language,
|
|
57
60
|
"name",
|
|
58
61
|
e.position?.translation_entries
|
|
59
|
-
),
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}, [
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
|
|
62
|
+
), v = `argument_${e.id}`, C = e.position && R?.map((t) => t.id).indexOf(e.position.id) + 1;
|
|
63
|
+
H(() => {
|
|
64
|
+
d !== void 0 && ye();
|
|
65
|
+
}, [d]);
|
|
66
|
+
const ue = (t) => {
|
|
67
|
+
t && ne.getOne("messages", t).then((r) => {
|
|
68
|
+
const n = r?.data?.data?.resource;
|
|
69
|
+
n && (y(
|
|
70
|
+
(T) => T?.some((_e) => String(_e.id) === String(n.id)) ? T : [...T || [], n]
|
|
71
|
+
), c(!0));
|
|
72
|
+
}).catch(() => {
|
|
73
|
+
});
|
|
74
|
+
}, me = (t) => {
|
|
75
|
+
const r = $.current;
|
|
76
|
+
!r || E.current || (E.current = !0, t?.some((n) => String(n.id) === String(r)) || ue(r));
|
|
77
|
+
};
|
|
78
|
+
H(() => {
|
|
79
|
+
if (!m)
|
|
80
|
+
return;
|
|
81
|
+
const t = Ie();
|
|
82
|
+
if (!t || String(t.groupId) !== String(e.group_id))
|
|
83
|
+
return;
|
|
84
|
+
const r = (t.ancestorIds || []).map(String), n = r.indexOf(String(e.id));
|
|
85
|
+
n >= 0 && (c(!0), $.current = r[n + 1] || null), String(t.parentId) === String(e.id) && (c(!0), k(!0), ce(!0), Re());
|
|
86
|
+
}, [m]);
|
|
87
|
+
const fe = (t) => {
|
|
88
|
+
if (v === t) {
|
|
89
|
+
const n = document.getElementById(t);
|
|
90
|
+
n && n.scrollIntoView({ behavior: "smooth" }), P(!0);
|
|
67
91
|
}
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
},
|
|
73
|
-
if (!
|
|
92
|
+
}, D = () => {
|
|
93
|
+
k((t) => !t);
|
|
94
|
+
}, F = () => {
|
|
95
|
+
c((t) => !t), y([]);
|
|
96
|
+
}, he = (t) => {
|
|
97
|
+
if (!g?.find((r) => r.id === t.id))
|
|
74
98
|
return t;
|
|
75
|
-
},
|
|
76
|
-
|
|
99
|
+
}, ge = Se((t, r) => /* @__PURE__ */ o(
|
|
100
|
+
Ue,
|
|
77
101
|
{
|
|
78
102
|
publisher: t.publisher,
|
|
79
103
|
url: t.source_url,
|
|
80
104
|
title: t.title,
|
|
81
|
-
index:
|
|
105
|
+
index: r
|
|
82
106
|
},
|
|
83
|
-
|
|
84
|
-
), []),
|
|
85
|
-
if (
|
|
86
|
-
const t =
|
|
87
|
-
(
|
|
107
|
+
r
|
|
108
|
+
), []), ye = () => {
|
|
109
|
+
if (d && Array.isArray(d)) {
|
|
110
|
+
const t = d.filter(
|
|
111
|
+
(r) => r.reply_to_id === e.id
|
|
88
112
|
);
|
|
89
|
-
t.length > 0 && (
|
|
113
|
+
t.length > 0 && (y(t), c(!0));
|
|
90
114
|
}
|
|
91
|
-
},
|
|
92
|
-
|
|
115
|
+
}, j = (t = null) => /* @__PURE__ */ o(
|
|
116
|
+
Oe,
|
|
93
117
|
{
|
|
94
118
|
...t ? { argument: t } : {},
|
|
95
|
-
nestingLevel:
|
|
96
|
-
maxNestingLevel:
|
|
97
|
-
disabled:
|
|
98
|
-
groupName:
|
|
99
|
-
groupType:
|
|
100
|
-
positions:
|
|
101
|
-
argumentReplies:
|
|
119
|
+
nestingLevel: I + 1,
|
|
120
|
+
maxNestingLevel: N,
|
|
121
|
+
disabled: S,
|
|
122
|
+
groupName: x,
|
|
123
|
+
groupType: w,
|
|
124
|
+
positions: R,
|
|
125
|
+
argumentReplies: d,
|
|
102
126
|
parentArgument: e,
|
|
103
|
-
flashParent: (
|
|
127
|
+
flashParent: (r) => fe(`argument_${r}`),
|
|
128
|
+
ancestorIds: [...U, e.id]
|
|
104
129
|
}
|
|
105
130
|
);
|
|
106
|
-
return /* @__PURE__ */ l(
|
|
131
|
+
return /* @__PURE__ */ l(Pe, { elementId: v, onScroll: () => P(!0), children: [
|
|
107
132
|
/* @__PURE__ */ l(
|
|
108
133
|
"div",
|
|
109
134
|
{
|
|
110
|
-
className:
|
|
135
|
+
className: G(
|
|
111
136
|
s.argument,
|
|
112
137
|
{
|
|
113
|
-
[s.flash]:
|
|
138
|
+
[s.flash]: ae,
|
|
114
139
|
[s.argumentReply]: e.is_reply === !0
|
|
115
140
|
},
|
|
116
|
-
s[`level-${
|
|
117
|
-
s[`position-${!(e.author.role === "editor" || e.author.role === "moderator") &&
|
|
141
|
+
s[`level-${I}`],
|
|
142
|
+
s[`position-${!(e.author.role === "editor" || e.author.role === "moderator") && C}`]
|
|
118
143
|
),
|
|
119
|
-
id:
|
|
144
|
+
id: v,
|
|
120
145
|
children: [
|
|
121
146
|
/* @__PURE__ */ o(
|
|
122
|
-
|
|
147
|
+
ke,
|
|
123
148
|
{
|
|
124
149
|
selectedContent: e.is_selected,
|
|
125
150
|
author: e.author,
|
|
126
|
-
tag: (e.author.role === "editor" || e.author.role === "moderator") && e.is_reply ? null :
|
|
151
|
+
tag: (e.author.role === "editor" || e.author.role === "moderator") && e.is_reply ? null : pe.translatedContent,
|
|
127
152
|
date: e.created_at,
|
|
128
|
-
tagClassName: s[`headerPosition-${
|
|
129
|
-
disableLinks:
|
|
153
|
+
tagClassName: s[`headerPosition-${C}`],
|
|
154
|
+
disableLinks: q,
|
|
130
155
|
isDeleted: e.is_deleted,
|
|
131
|
-
showModerationFeedback:
|
|
156
|
+
showModerationFeedback: te ?? (e.status === "rejected" && i.moderation?.showFeedback === !0),
|
|
132
157
|
moderationReason: e.moderation_entry?.moderation_reason,
|
|
133
158
|
moderationNotes: e.moderation_entry?.moderator_notes,
|
|
134
|
-
moderationPolicyUrl:
|
|
159
|
+
moderationPolicyUrl: i.provider?.userGuideUrl
|
|
135
160
|
}
|
|
136
161
|
),
|
|
137
162
|
e.is_deleted ? /* @__PURE__ */ o("div", { className: s.argumentDeletedBody, children: a.formatMessage({
|
|
138
163
|
id: "info.deleted_by_user",
|
|
139
164
|
defaultMessage: "Content deleted by the user"
|
|
140
|
-
}) }) :
|
|
165
|
+
}) }) : re ? /* @__PURE__ */ o("div", { className: s.argumentDeletedBody, children: a.formatMessage({
|
|
141
166
|
id: "argument.argument.content_deleted",
|
|
142
167
|
defaultMessage: "This content has been removed."
|
|
143
|
-
}) }) : /* @__PURE__ */ l(
|
|
168
|
+
}) }) : /* @__PURE__ */ l(b, { children: [
|
|
144
169
|
/* @__PURE__ */ l(
|
|
145
170
|
"div",
|
|
146
171
|
{
|
|
147
|
-
className:
|
|
148
|
-
[s.fixedHeight]:
|
|
172
|
+
className: G(s.argumentBody, {
|
|
173
|
+
[s.fixedHeight]: i?.layout?.showAllArgumentInEmbed !== !0 ? W : !1
|
|
149
174
|
}),
|
|
150
175
|
children: [
|
|
151
|
-
e.is_reply &&
|
|
176
|
+
e.is_reply && u && /* @__PURE__ */ l(
|
|
152
177
|
"div",
|
|
153
178
|
{
|
|
154
179
|
className: s.replyTo,
|
|
155
|
-
onClick: () =>
|
|
180
|
+
onClick: () => J(u.id),
|
|
156
181
|
children: [
|
|
157
182
|
a.formatMessage({
|
|
158
183
|
id: "info.replying_to",
|
|
159
184
|
defaultMessage: "Replying to"
|
|
160
185
|
}),
|
|
161
186
|
/* @__PURE__ */ l("span", { className: s.replyingTo, children: [
|
|
162
|
-
|
|
187
|
+
u.is_deleted ? a.formatMessage({
|
|
163
188
|
id: "info.deleted",
|
|
164
189
|
defaultMessage: "Deleted"
|
|
165
|
-
}) :
|
|
166
|
-
/* @__PURE__ */ o(
|
|
190
|
+
}) : u.author.full_name,
|
|
191
|
+
/* @__PURE__ */ o(z, { name: "chat", height: 16 })
|
|
167
192
|
] })
|
|
168
193
|
]
|
|
169
194
|
}
|
|
170
195
|
),
|
|
171
196
|
/* @__PURE__ */ o(
|
|
172
|
-
|
|
197
|
+
Be,
|
|
173
198
|
{
|
|
174
|
-
content: /* @__PURE__ */ l(
|
|
199
|
+
content: /* @__PURE__ */ l(b, { children: [
|
|
175
200
|
e.is_edited && /* @__PURE__ */ o("div", { className: s.edited, children: a.formatMessage({
|
|
176
201
|
id: "argument.argument.updated",
|
|
177
202
|
defaultMessage: "Updated argument"
|
|
178
203
|
}) }),
|
|
179
|
-
|
|
204
|
+
B && !_.isTranslated ? /* @__PURE__ */ o(
|
|
180
205
|
"div",
|
|
181
206
|
{
|
|
182
207
|
className: s.argumentContent,
|
|
183
|
-
dangerouslySetInnerHTML: { __html:
|
|
208
|
+
dangerouslySetInnerHTML: { __html: Y(B) }
|
|
184
209
|
}
|
|
185
|
-
) : /* @__PURE__ */ o("div", { className: s.argumentContent, children:
|
|
186
|
-
|
|
187
|
-
|
|
210
|
+
) : /* @__PURE__ */ o("div", { className: s.argumentContent, children: Y(_.translatedContent) }),
|
|
211
|
+
_.isTranslated && /* @__PURE__ */ o(
|
|
212
|
+
$e,
|
|
188
213
|
{
|
|
189
214
|
language: e.language,
|
|
190
|
-
callback: () =>
|
|
215
|
+
callback: () => _.toggleContent()
|
|
191
216
|
}
|
|
192
217
|
)
|
|
193
218
|
] }),
|
|
194
|
-
lineCount:
|
|
219
|
+
lineCount: i?.layout?.showAllArgumentInEmbed !== !0 ? oe : void 0,
|
|
195
220
|
readMoreText: a.formatMessage({
|
|
196
221
|
id: "action.read_more",
|
|
197
222
|
defaultMessage: "Read more"
|
|
@@ -200,29 +225,29 @@ const we = pe(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
200
225
|
id: "action.read_less",
|
|
201
226
|
defaultMessage: "Read less"
|
|
202
227
|
}),
|
|
203
|
-
expandable:
|
|
228
|
+
expandable: i?.layout?.showAllArgumentInEmbed !== !0 ? K : !1,
|
|
204
229
|
readMoreClassName: e.is_reply ? s.replyStyle : s.argumentStyle
|
|
205
230
|
}
|
|
206
231
|
)
|
|
207
232
|
]
|
|
208
233
|
}
|
|
209
234
|
),
|
|
210
|
-
e.sources?.length > 0 && /* @__PURE__ */ o("div", { className: s.argumentSourcesList, children: e.sources.map(
|
|
235
|
+
e.sources?.length > 0 && /* @__PURE__ */ o("div", { className: s.argumentSourcesList, children: e.sources.map(ge) })
|
|
211
236
|
] }),
|
|
212
|
-
!
|
|
213
|
-
|
|
237
|
+
!A && !e.is_deleted && /* @__PURE__ */ o(
|
|
238
|
+
Ee,
|
|
214
239
|
{
|
|
215
240
|
resource: e,
|
|
216
|
-
disabled:
|
|
217
|
-
disableEdition: e.status === "rejected" || !
|
|
241
|
+
disabled: S || e.status === "rejected" || e.status === "pending" || !m && i?.actions?.disableInputForVisitor === !0 || M,
|
|
242
|
+
disableEdition: e.status === "rejected" || !m && i?.actions?.disableInputForVisitor === !0 || M,
|
|
218
243
|
reportType: "Message",
|
|
219
|
-
softDelete:
|
|
244
|
+
softDelete: i.actions?.softDelete,
|
|
220
245
|
deleteType: "messages",
|
|
221
|
-
deleteListId:
|
|
222
|
-
enableReply:
|
|
223
|
-
handleReplyTo:
|
|
224
|
-
replyRedirectUrl:
|
|
225
|
-
shareUrl:
|
|
246
|
+
deleteListId: ee,
|
|
247
|
+
enableReply: I <= N || f.role === "editor" || f.role === "moderator",
|
|
248
|
+
handleReplyTo: D,
|
|
249
|
+
replyRedirectUrl: se,
|
|
250
|
+
shareUrl: be(i, "a", e.id),
|
|
226
251
|
shareTitle: a.formatMessage({
|
|
227
252
|
id: "share.argument.title",
|
|
228
253
|
defaultMessage: "Share a debate"
|
|
@@ -231,81 +256,83 @@ const we = pe(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
231
256
|
id: "share.argument.text",
|
|
232
257
|
defaultMessage: "This argument may interest you"
|
|
233
258
|
}),
|
|
234
|
-
shareCode: `<iframe src="https://cdn.logora.com/embed.html?shortname=${
|
|
235
|
-
showShareCode:
|
|
259
|
+
shareCode: `<iframe src="https://cdn.logora.com/embed.html?shortname=${i.shortname}&id=${e.id}&resource=argument" frameborder="0" width="100%" height="275px" scrolling="no"></iframe>`,
|
|
260
|
+
showShareCode: i?.actions?.hideCodeShare !== !0,
|
|
236
261
|
showShareText: !0,
|
|
237
|
-
showShareButton:
|
|
262
|
+
showShareButton: i?.actions?.hideShareButton !== !0,
|
|
238
263
|
enableReport: !(e.score === 100 && e.manual_score),
|
|
239
|
-
enableEdition:
|
|
240
|
-
enableDeletion:
|
|
264
|
+
enableEdition: X,
|
|
265
|
+
enableDeletion: Z,
|
|
241
266
|
children: /* @__PURE__ */ o(
|
|
242
|
-
|
|
267
|
+
De,
|
|
243
268
|
{
|
|
244
269
|
voteableType: "Message",
|
|
245
270
|
voteableId: e.id,
|
|
246
271
|
totalUpvote: e.upvotes,
|
|
247
272
|
totalDownvote: 0,
|
|
248
|
-
activeClassName: s[`voteButtonPosition-${
|
|
249
|
-
disabled: e.status === "rejected" ||
|
|
273
|
+
activeClassName: s[`voteButtonPosition-${C}`],
|
|
274
|
+
disabled: e.status === "rejected" || f?.id === e?.author?.id || M
|
|
250
275
|
}
|
|
251
276
|
)
|
|
252
277
|
}
|
|
253
278
|
),
|
|
254
|
-
!
|
|
255
|
-
|
|
279
|
+
!A && !L && /* @__PURE__ */ o(
|
|
280
|
+
Te,
|
|
256
281
|
{
|
|
257
282
|
numberReplies: e.number_replies,
|
|
258
283
|
repliesAuthors: e.replies_authors,
|
|
259
|
-
expandReplies:
|
|
260
|
-
onToggleReplies:
|
|
284
|
+
expandReplies: h,
|
|
285
|
+
onToggleReplies: F,
|
|
261
286
|
isReply: e.is_reply
|
|
262
287
|
}
|
|
263
288
|
)
|
|
264
289
|
]
|
|
265
290
|
}
|
|
266
291
|
),
|
|
267
|
-
!
|
|
268
|
-
|
|
269
|
-
|
|
292
|
+
!L && /* @__PURE__ */ l(b, { children: [
|
|
293
|
+
le && /* @__PURE__ */ o(Me, { fallback: null, children: /* @__PURE__ */ o(
|
|
294
|
+
Ve,
|
|
270
295
|
{
|
|
271
296
|
groupId: e.group_id,
|
|
272
|
-
groupType:
|
|
273
|
-
groupName:
|
|
274
|
-
positions:
|
|
297
|
+
groupType: w,
|
|
298
|
+
groupName: x,
|
|
299
|
+
positions: R,
|
|
275
300
|
parentId: e.id,
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
301
|
+
ancestorIds: [...U, e.id],
|
|
302
|
+
positionId: Q?.position_id,
|
|
303
|
+
disabled: S,
|
|
304
|
+
hideSourceAction: i?.actions?.disableUserSources || !1,
|
|
279
305
|
onSubmit: (t) => {
|
|
280
|
-
const
|
|
281
|
-
|
|
306
|
+
const r = `argument_${e.id}_reply_list`;
|
|
307
|
+
ie.add(r, [t]), D(), c(!0);
|
|
282
308
|
},
|
|
283
309
|
onUpdate: (t) => {
|
|
284
|
-
|
|
285
|
-
(
|
|
286
|
-
(
|
|
310
|
+
y(
|
|
311
|
+
(r) => r?.map(
|
|
312
|
+
(n) => n.id === t.id ? { ...n, ...t } : n
|
|
287
313
|
)
|
|
288
314
|
);
|
|
289
315
|
},
|
|
290
316
|
isReply: !0,
|
|
291
317
|
autoFocus: !0,
|
|
318
|
+
focusOnInit: de,
|
|
292
319
|
avatarSize: 40,
|
|
293
320
|
placeholder: a.formatMessage({
|
|
294
321
|
id: "input.reply_input.your_answer",
|
|
295
322
|
defaultMessage: "Your answer"
|
|
296
323
|
}),
|
|
297
|
-
userGuideUrl:
|
|
298
|
-
hideUserGuideLink:
|
|
324
|
+
userGuideUrl: i?.provider?.userGuideUrl,
|
|
325
|
+
hideUserGuideLink: i?.provider?.hideUserGuideLink
|
|
299
326
|
},
|
|
300
327
|
`Reply${e.id}`
|
|
301
328
|
) }),
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
329
|
+
g?.length > 0 && h && /* @__PURE__ */ o("div", { className: s.repliesList, children: g.map((t) => j(t)) }),
|
|
330
|
+
h && /* @__PURE__ */ o("div", { className: s.repliesList, children: /* @__PURE__ */ o(
|
|
331
|
+
Fe,
|
|
305
332
|
{
|
|
306
333
|
voteableType: "Message",
|
|
307
334
|
currentListId: `argument_${e.id}_reply_list`,
|
|
308
|
-
loadingComponent: /* @__PURE__ */ o(
|
|
335
|
+
loadingComponent: /* @__PURE__ */ o(je, {}),
|
|
309
336
|
resource: "messages",
|
|
310
337
|
sort: "+created_at",
|
|
311
338
|
filters: {
|
|
@@ -316,17 +343,18 @@ const we = pe(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
316
343
|
perPage: 5,
|
|
317
344
|
display: "column",
|
|
318
345
|
resourcePropName: "argument",
|
|
319
|
-
emptyListComponent: /* @__PURE__ */ o(
|
|
320
|
-
|
|
321
|
-
|
|
346
|
+
emptyListComponent: /* @__PURE__ */ o(b, {}),
|
|
347
|
+
onElementsLoad: me,
|
|
348
|
+
transformData: (t) => he(t),
|
|
349
|
+
children: j(e)
|
|
322
350
|
}
|
|
323
351
|
) }),
|
|
324
|
-
|
|
325
|
-
|
|
352
|
+
g?.length > 0 && !h && /* @__PURE__ */ o("div", { className: s.repliesList, children: e.number_replies > 1 && /* @__PURE__ */ o("div", { className: s.readMoreLink, children: /* @__PURE__ */ o(
|
|
353
|
+
Ge,
|
|
326
354
|
{
|
|
327
355
|
role: "link",
|
|
328
|
-
rightIcon: /* @__PURE__ */ o(
|
|
329
|
-
handleClick:
|
|
356
|
+
rightIcon: /* @__PURE__ */ o(z, { name: "lightArrow", height: 10, width: 10 }),
|
|
357
|
+
handleClick: F,
|
|
330
358
|
children: a.formatMessage({
|
|
331
359
|
id: "argument.argument.see_more",
|
|
332
360
|
defaultMessage: "See more"
|
|
@@ -335,8 +363,8 @@ const we = pe(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
335
363
|
) }) })
|
|
336
364
|
] })
|
|
337
365
|
] });
|
|
338
|
-
},
|
|
366
|
+
}, Oe = He;
|
|
339
367
|
export {
|
|
340
|
-
|
|
341
|
-
|
|
368
|
+
He as Argument,
|
|
369
|
+
Oe as ArgumentContainer
|
|
342
370
|
};
|