@logora/debate 0.3.62 → 0.3.64
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/consultation/consultation_box/{ConsultationBox.module-CZB4qRb2.css → ConsultationBox.module-D2an6OmR.css} +1 -1
- package/dist/components/argument/argument/Argument.js +147 -138
- package/dist/components/consultation/consultation_box/ConsultationBox.js +35 -44
- package/dist/components/consultation/consultation_box/ConsultationBox.module.scss.js +20 -20
- 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/input/argument_input/ArgumentInput.js +138 -135
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._container_1fmcx_3{display:flex!important;flex-direction:column!important;justify-content:space-between!important;box-shadow:var(--box-shadow, 0px 2px 5px rgba(7, 42, 68, .1));border:var(--box-border, 1px solid rgba(7, 42, 68, .1));color:var(--text-primary, #222222);border-radius:var(--box-border-radius, 6px);background:var(--background-color-primary, white)}._container_1fmcx_3 a{text-decoration:none!important;color:var(--text-primary, #222222)!important}._consultationImageBox_1fmcx_18{position:relative}._consultationImage_1fmcx_18{border-top-right-radius:var(--box-border-radius, 6px);border-top-left-radius:var(--box-border-radius, 6px);width:100%;aspect-ratio:var(--img-aspect-ratio, 16/9);object-fit:cover;display:block}._consultationTime_1fmcx_31{display:flex!important;align-items:center!important;position:absolute;left:var(--space-unit, 1em);bottom:var(--space-unit, 1em);padding-right:var(--spacer-md, calc(var(--space-unit, 1em) * .75))!important;padding-left:var(--spacer-md, calc(var(--space-unit, 1em) * .75))!important;padding-top:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;padding-bottom:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;background-color:var(--call-primary-color, #434343);border-radius:var(--box-border-radius, 6px);font-size:var(--font-size-normal, 16px);color:var(--text-light, white);max-width:93%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}._consultationTime_1fmcx_31 span{color:var(--text-light, white)}._consultationTime_1fmcx_31._ended_1fmcx_53{background-color:var(--call-primary-color, #434343)}._consultationTitle_1fmcx_57{padding-top:var(--spacer-lg, calc(var(--space-unit, 1em) * 1.5))!important;padding-bottom:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;padding-right:var(--space-unit, 1em)!important;padding-left:var(--space-unit, 1em)!important;font-size:var(--font-size-normal, 16px);font-weight:var(--font-weight-bold, 700)}._iconVote_1fmcx_66{padding-top:3px!important}._iconChat_1fmcx_70{padding-top:6px!important}._consultationButtonContainer_1fmcx_74{display:flex!important;padding-right:var(--space-unit, 1em)!important;padding-left:var(--space-unit, 1em)!important;padding-bottom:var(--spacer-lg, calc(var(--space-unit, 1em) * 1.5))!important;color:var(--text-secondary, #5F5F5F);font-size:var(--font-size-small, 16px)}._consultationButtonContainer_1fmcx_74:hover{text-decoration:underline;text-decoration-color:var(--text-secondary, #5F5F5F)}._consultationButtonContainer_1fmcx_74 ._arrowIcon_1fmcx_86{margin-left:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important;transform:rotate(180deg);fill:var(--text-secondary, #5F5F5F);top:1px;position:relative}._consultationInformations_1fmcx_94{display:flex!important;justify-content:space-between!important;align-items:center!important;padding-right:var(--space-unit, 1em)!important;padding-left:var(--space-unit, 1em)!important;padding-top:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;padding-bottom:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;min-height:50px}._consultationInformations_1fmcx_94 ._consultationLeft_1fmcx_104{display:flex!important}._consultationInformations_1fmcx_94 ._consultationGroupInformation_1fmcx_107{display:flex!important;align-items:center!important}._consultationInformations_1fmcx_94 ._consultationGroupInformation_1fmcx_107._consultationGroupRight_1fmcx_111{padding-right:var(--space-unit, 1em)!important}._consultationInformations_1fmcx_94 ._progressBarContainer_1fmcx_114{width:60%;display:flex!important;flex-direction:column!important;align-items:flex-end!important;font-size:var(--font-size-extra-small, 14px)}._consultationInformations_1fmcx_94 ._progressBarContainer_1fmcx_114 ._progress_1fmcx_114{margin-top:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important;height:15px;width:100%;border-radius:var(--box-border-radius, 6px);background-color:var(--background-color-secondary, #E8E8E8)!important}._consultationInformations_1fmcx_94 ._progressBarContainer_1fmcx_114 ._bar_1fmcx_128{background-color:var(--call-primary-color, #434343)}._consultationInformations_1fmcx_94 ._progressBarContainer_1fmcx_114 ._totalVotes_1fmcx_131{margin-right:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important}._consultationInformations_1fmcx_94 ._progressBarContainer_1fmcx_114 ._totalVotesPercentage_1fmcx_134{margin-left:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important}._consultationInformations_1fmcx_94 ._consultationTextInformation_1fmcx_137{padding-right:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important;padding-top:5px!important}
|
|
@@ -1,77 +1,86 @@
|
|
|
1
|
-
import { jsx as o, jsxs as l, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useIntl as
|
|
1
|
+
import { jsx as o, jsxs as l, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import D from "classnames";
|
|
3
|
+
import { useState as g, useEffect as P, useCallback as de, Suspense as ce, lazy as pe } from "react";
|
|
4
|
+
import { useIntl as ue } from "react-intl";
|
|
5
5
|
import s from "./Argument.module.scss.js";
|
|
6
|
-
import { ReplyFooter as
|
|
7
|
-
import { useRichContent as
|
|
8
|
-
import { useAuth as
|
|
9
|
-
import { useConfig as
|
|
10
|
-
import { useTranslatedContent as
|
|
11
|
-
import { SourceListItem as
|
|
12
|
-
import { HashScroll as
|
|
13
|
-
import { ContentHeader as
|
|
14
|
-
import { Icon as
|
|
15
|
-
import { ReadMore as
|
|
16
|
-
import { TranslationButton as
|
|
17
|
-
import { ContentFooter as
|
|
18
|
-
import { VoteButton as
|
|
19
|
-
import { VotePaginatedList as
|
|
20
|
-
import { UserContentSkeleton as
|
|
6
|
+
import { ReplyFooter as me } from "./ReplyFooter.js";
|
|
7
|
+
import { useRichContent as he } from "./useRichContent.js";
|
|
8
|
+
import { useAuth as fe } from "../../auth/use_auth/useAuth.js";
|
|
9
|
+
import { useConfig as ye } from "../../data/config_provider/useConfig.js";
|
|
10
|
+
import { useTranslatedContent as F } from "../../translation/translated_content/useTranslatedContent.js";
|
|
11
|
+
import { SourceListItem as _e } from "../../source/source_list_item/SourceListItem.js";
|
|
12
|
+
import { HashScroll as ge } from "../../tools/hash_scroll/HashScroll.js";
|
|
13
|
+
import { ContentHeader as be } from "../../user_content/content_header/ContentHeader.js";
|
|
14
|
+
import { Icon as j } from "../../icons/icon/Icon.js";
|
|
15
|
+
import { ReadMore as Me } from "../../text/read_more/ReadMore.js";
|
|
16
|
+
import { TranslationButton as ve } from "../../translation/translation_button/TranslationButton.js";
|
|
17
|
+
import { ContentFooter as Ie } from "../../user_content/content_footer/ContentFooter.js";
|
|
18
|
+
import { VoteButton as Ce } from "../../vote/vote_button/VoteButton.js";
|
|
19
|
+
import { VotePaginatedList as Re } from "../../list/paginated_list/VotePaginatedList.js";
|
|
20
|
+
import { UserContentSkeleton as we } from "../../skeleton/user_content_skeleton/UserContentSkeleton.js";
|
|
21
21
|
import { Button as Se } from "../../action/button/Button.js";
|
|
22
|
-
const
|
|
22
|
+
const Te = pe(() => import("../../input/argument_input/index.js").then((e) => ({ default: e.ArgumentInput }))), G = (e) => e?.replace(/ /g, " "), Ne = ({
|
|
23
23
|
argument: e,
|
|
24
|
-
argumentReplies:
|
|
25
|
-
nestingLevel:
|
|
26
|
-
maxNestingLevel:
|
|
24
|
+
argumentReplies: d,
|
|
25
|
+
nestingLevel: b = 0,
|
|
26
|
+
maxNestingLevel: w = 2,
|
|
27
27
|
groupType: S,
|
|
28
|
-
groupName:
|
|
29
|
-
positions:
|
|
30
|
-
disableLinks:
|
|
31
|
-
parentArgument:
|
|
32
|
-
flashParent:
|
|
33
|
-
expandable:
|
|
34
|
-
disabled:
|
|
35
|
-
hideFooter:
|
|
36
|
-
hideReplies:
|
|
37
|
-
vote:
|
|
38
|
-
fixedContentHeight:
|
|
39
|
-
enableEdition:
|
|
40
|
-
enableDeletion:
|
|
41
|
-
deleteListId:
|
|
42
|
-
showModerationFeedback:
|
|
43
|
-
lineCount:
|
|
44
|
-
replyRedirectUrl:
|
|
45
|
-
hideContent:
|
|
28
|
+
groupName: T,
|
|
29
|
+
positions: M = [],
|
|
30
|
+
disableLinks: H = !1,
|
|
31
|
+
parentArgument: c,
|
|
32
|
+
flashParent: V,
|
|
33
|
+
expandable: z,
|
|
34
|
+
disabled: v = !1,
|
|
35
|
+
hideFooter: N = !1,
|
|
36
|
+
hideReplies: A,
|
|
37
|
+
vote: O,
|
|
38
|
+
fixedContentHeight: Y = !1,
|
|
39
|
+
enableEdition: q = !0,
|
|
40
|
+
enableDeletion: J = !0,
|
|
41
|
+
deleteListId: K,
|
|
42
|
+
showModerationFeedback: Q,
|
|
43
|
+
lineCount: W = 5,
|
|
44
|
+
replyRedirectUrl: X,
|
|
45
|
+
hideContent: Z = !1
|
|
46
46
|
}) => {
|
|
47
|
-
const i =
|
|
47
|
+
const i = ue(), { isLoggedIn: ee, currentUser: p } = fe(), x = p?.moderation_status === "banned", r = ye(), [u, I] = g(!1), [te, L] = g(!1), [oe, se] = g(!1), U = he(e), [m, h] = g(), f = F(
|
|
48
48
|
e.content,
|
|
49
49
|
e.language,
|
|
50
50
|
"content",
|
|
51
51
|
e.translation_entries
|
|
52
|
-
),
|
|
52
|
+
), re = F(
|
|
53
53
|
e.position?.name,
|
|
54
54
|
e.position?.language,
|
|
55
55
|
"name",
|
|
56
56
|
e.position?.translation_entries
|
|
57
|
-
),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}, [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
|
|
57
|
+
), C = `argument_${e.id}`, R = e.position && M?.map((t) => t.id).indexOf(e.position.id) + 1;
|
|
58
|
+
P(() => {
|
|
59
|
+
d !== void 0 && ne();
|
|
60
|
+
}, [d]), P(() => {
|
|
61
|
+
if (typeof window > "u") return;
|
|
62
|
+
const t = (a) => {
|
|
63
|
+
const n = a.detail?.reply;
|
|
64
|
+
!n || n.reply_to_id !== e.id || h((y) => !y || y.length === 0 ? y : y.map((E) => E.id === n.id ? n : E));
|
|
65
|
+
};
|
|
66
|
+
return window.addEventListener("logora:reply:updated", t), () => {
|
|
67
|
+
window.removeEventListener("logora:reply:updated", t);
|
|
68
|
+
};
|
|
69
|
+
}, [e.id]);
|
|
70
|
+
const ie = (t) => {
|
|
71
|
+
if (C === t) {
|
|
72
|
+
const n = document.getElementById(t);
|
|
73
|
+
n && n.scrollIntoView({ behavior: "smooth" }), L(!0);
|
|
65
74
|
}
|
|
66
|
-
}, L = () => {
|
|
67
|
-
ee((t) => !t);
|
|
68
75
|
}, k = () => {
|
|
69
|
-
|
|
70
|
-
},
|
|
76
|
+
se((t) => !t);
|
|
77
|
+
}, $ = () => {
|
|
78
|
+
I((t) => !t), h([]);
|
|
79
|
+
}, ae = (t) => {
|
|
71
80
|
if (!m?.find((a) => a.id === t.id))
|
|
72
81
|
return t;
|
|
73
|
-
},
|
|
74
|
-
|
|
82
|
+
}, le = de((t, a) => /* @__PURE__ */ o(
|
|
83
|
+
_e,
|
|
75
84
|
{
|
|
76
85
|
publisher: t.publisher,
|
|
77
86
|
url: t.source_url,
|
|
@@ -79,54 +88,54 @@ const Re = de(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
79
88
|
index: a
|
|
80
89
|
},
|
|
81
90
|
a
|
|
82
|
-
), []),
|
|
83
|
-
if (
|
|
84
|
-
const t =
|
|
91
|
+
), []), ne = () => {
|
|
92
|
+
if (d && Array.isArray(d)) {
|
|
93
|
+
const t = d.filter(
|
|
85
94
|
(a) => a.reply_to_id === e.id
|
|
86
95
|
);
|
|
87
|
-
t.length > 0 && (
|
|
96
|
+
t.length > 0 && (h(t), I(!0));
|
|
88
97
|
}
|
|
89
|
-
},
|
|
90
|
-
|
|
98
|
+
}, B = (t = null) => /* @__PURE__ */ o(
|
|
99
|
+
Ae,
|
|
91
100
|
{
|
|
92
101
|
...t ? { argument: t } : {},
|
|
93
|
-
nestingLevel:
|
|
94
|
-
maxNestingLevel:
|
|
95
|
-
disabled:
|
|
96
|
-
groupName:
|
|
102
|
+
nestingLevel: b + 1,
|
|
103
|
+
maxNestingLevel: w,
|
|
104
|
+
disabled: v,
|
|
105
|
+
groupName: T,
|
|
97
106
|
groupType: S,
|
|
98
|
-
positions:
|
|
99
|
-
argumentReplies:
|
|
107
|
+
positions: M,
|
|
108
|
+
argumentReplies: d,
|
|
100
109
|
parentArgument: e,
|
|
101
|
-
flashParent: (a) =>
|
|
110
|
+
flashParent: (a) => ie(`argument_${a}`)
|
|
102
111
|
}
|
|
103
112
|
);
|
|
104
|
-
return /* @__PURE__ */ l(
|
|
113
|
+
return /* @__PURE__ */ l(ge, { elementId: C, onScroll: () => L(!0), children: [
|
|
105
114
|
/* @__PURE__ */ l(
|
|
106
115
|
"div",
|
|
107
116
|
{
|
|
108
|
-
className:
|
|
117
|
+
className: D(
|
|
109
118
|
s.argument,
|
|
110
119
|
{
|
|
111
|
-
[s.flash]:
|
|
120
|
+
[s.flash]: te,
|
|
112
121
|
[s.argumentReply]: e.is_reply === !0
|
|
113
122
|
},
|
|
114
|
-
s[`level-${
|
|
115
|
-
s[`position-${!(e.author.role === "editor" || e.author.role === "moderator") &&
|
|
123
|
+
s[`level-${b}`],
|
|
124
|
+
s[`position-${!(e.author.role === "editor" || e.author.role === "moderator") && R}`]
|
|
116
125
|
),
|
|
117
|
-
id:
|
|
126
|
+
id: C,
|
|
118
127
|
children: [
|
|
119
128
|
/* @__PURE__ */ o(
|
|
120
|
-
|
|
129
|
+
be,
|
|
121
130
|
{
|
|
122
131
|
selectedContent: e.is_selected,
|
|
123
132
|
author: e.author,
|
|
124
|
-
tag: (e.author.role === "editor" || e.author.role === "moderator") && e.is_reply ? null :
|
|
133
|
+
tag: (e.author.role === "editor" || e.author.role === "moderator") && e.is_reply ? null : re.translatedContent,
|
|
125
134
|
date: e.created_at,
|
|
126
|
-
tagClassName: s[`headerPosition-${
|
|
127
|
-
disableLinks:
|
|
135
|
+
tagClassName: s[`headerPosition-${R}`],
|
|
136
|
+
disableLinks: H,
|
|
128
137
|
isDeleted: e.is_deleted,
|
|
129
|
-
showModerationFeedback:
|
|
138
|
+
showModerationFeedback: Q ?? (e.status === "rejected" && r.moderation?.showFeedback === !0),
|
|
130
139
|
moderationReason: e.moderation_entry?.moderation_reason,
|
|
131
140
|
moderationNotes: e.moderation_entry?.moderator_notes,
|
|
132
141
|
moderationPolicyUrl: r.provider?.userGuideUrl
|
|
@@ -135,61 +144,61 @@ const Re = de(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
135
144
|
e.is_deleted ? /* @__PURE__ */ o("div", { className: s.argumentDeletedBody, children: i.formatMessage({
|
|
136
145
|
id: "info.deleted_by_user",
|
|
137
146
|
defaultMessage: "Content deleted by the user"
|
|
138
|
-
}) }) :
|
|
147
|
+
}) }) : Z ? /* @__PURE__ */ o("div", { className: s.argumentDeletedBody, children: i.formatMessage({
|
|
139
148
|
id: "argument.argument.content_deleted",
|
|
140
149
|
defaultMessage: "This content has been removed."
|
|
141
|
-
}) }) : /* @__PURE__ */ l(
|
|
150
|
+
}) }) : /* @__PURE__ */ l(_, { children: [
|
|
142
151
|
/* @__PURE__ */ l(
|
|
143
152
|
"div",
|
|
144
153
|
{
|
|
145
|
-
className:
|
|
146
|
-
[s.fixedHeight]: r?.layout?.showAllArgumentInEmbed !== !0 ?
|
|
154
|
+
className: D(s.argumentBody, {
|
|
155
|
+
[s.fixedHeight]: r?.layout?.showAllArgumentInEmbed !== !0 ? Y : !1
|
|
147
156
|
}),
|
|
148
157
|
children: [
|
|
149
|
-
e.is_reply &&
|
|
158
|
+
e.is_reply && c && /* @__PURE__ */ l(
|
|
150
159
|
"div",
|
|
151
160
|
{
|
|
152
161
|
className: s.replyTo,
|
|
153
|
-
onClick: () =>
|
|
162
|
+
onClick: () => V(c.id),
|
|
154
163
|
children: [
|
|
155
164
|
i.formatMessage({
|
|
156
165
|
id: "info.replying_to",
|
|
157
166
|
defaultMessage: "Replying to"
|
|
158
167
|
}),
|
|
159
168
|
/* @__PURE__ */ l("span", { className: s.replyingTo, children: [
|
|
160
|
-
|
|
169
|
+
c.is_deleted ? i.formatMessage({
|
|
161
170
|
id: "info.deleted",
|
|
162
171
|
defaultMessage: "Deleted"
|
|
163
|
-
}) :
|
|
164
|
-
/* @__PURE__ */ o(
|
|
172
|
+
}) : c.author.full_name,
|
|
173
|
+
/* @__PURE__ */ o(j, { name: "chat", height: 16 })
|
|
165
174
|
] })
|
|
166
175
|
]
|
|
167
176
|
}
|
|
168
177
|
),
|
|
169
178
|
/* @__PURE__ */ o(
|
|
170
|
-
|
|
179
|
+
Me,
|
|
171
180
|
{
|
|
172
|
-
content: /* @__PURE__ */ l(
|
|
181
|
+
content: /* @__PURE__ */ l(_, { children: [
|
|
173
182
|
e.is_edited && /* @__PURE__ */ o("div", { className: s.edited, children: i.formatMessage({
|
|
174
183
|
id: "argument.argument.updated",
|
|
175
184
|
defaultMessage: "Updated argument"
|
|
176
185
|
}) }),
|
|
177
|
-
|
|
186
|
+
U && !f.isTranslated ? /* @__PURE__ */ o(
|
|
178
187
|
"div",
|
|
179
188
|
{
|
|
180
189
|
className: s.argumentContent,
|
|
181
|
-
dangerouslySetInnerHTML: { __html:
|
|
190
|
+
dangerouslySetInnerHTML: { __html: G(U) }
|
|
182
191
|
}
|
|
183
|
-
) : /* @__PURE__ */ o("div", { className: s.argumentContent, children:
|
|
184
|
-
|
|
185
|
-
|
|
192
|
+
) : /* @__PURE__ */ o("div", { className: s.argumentContent, children: G(f.translatedContent) }),
|
|
193
|
+
f.isTranslated && /* @__PURE__ */ o(
|
|
194
|
+
ve,
|
|
186
195
|
{
|
|
187
196
|
language: e.language,
|
|
188
|
-
callback: () =>
|
|
197
|
+
callback: () => f.toggleContent()
|
|
189
198
|
}
|
|
190
199
|
)
|
|
191
200
|
] }),
|
|
192
|
-
lineCount: r?.layout?.showAllArgumentInEmbed !== !0 ?
|
|
201
|
+
lineCount: r?.layout?.showAllArgumentInEmbed !== !0 ? W : void 0,
|
|
193
202
|
readMoreText: i.formatMessage({
|
|
194
203
|
id: "action.read_more",
|
|
195
204
|
defaultMessage: "Read more"
|
|
@@ -198,27 +207,27 @@ const Re = de(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
198
207
|
id: "action.read_less",
|
|
199
208
|
defaultMessage: "Read less"
|
|
200
209
|
}),
|
|
201
|
-
expandable: r?.layout?.showAllArgumentInEmbed !== !0 ?
|
|
210
|
+
expandable: r?.layout?.showAllArgumentInEmbed !== !0 ? z : !1,
|
|
202
211
|
readMoreClassName: e.is_reply ? s.replyStyle : s.argumentStyle
|
|
203
212
|
}
|
|
204
213
|
)
|
|
205
214
|
]
|
|
206
215
|
}
|
|
207
216
|
),
|
|
208
|
-
e.sources?.length > 0 && /* @__PURE__ */ o("div", { className: s.argumentSourcesList, children: e.sources.map(
|
|
217
|
+
e.sources?.length > 0 && /* @__PURE__ */ o("div", { className: s.argumentSourcesList, children: e.sources.map(le) })
|
|
209
218
|
] }),
|
|
210
|
-
!
|
|
211
|
-
|
|
219
|
+
!N && !e.is_deleted && /* @__PURE__ */ o(
|
|
220
|
+
Ie,
|
|
212
221
|
{
|
|
213
222
|
resource: e,
|
|
214
|
-
disabled:
|
|
223
|
+
disabled: v || e.status === "rejected" || !ee && r?.actions?.disableInputForVisitor === !0 || x,
|
|
215
224
|
reportType: "Message",
|
|
216
225
|
softDelete: r.actions?.softDelete,
|
|
217
226
|
deleteType: "messages",
|
|
218
|
-
deleteListId:
|
|
219
|
-
enableReply:
|
|
220
|
-
handleReplyTo:
|
|
221
|
-
replyRedirectUrl:
|
|
227
|
+
deleteListId: K,
|
|
228
|
+
enableReply: b <= w || p.role === "editor" || p.role === "moderator",
|
|
229
|
+
handleReplyTo: k,
|
|
230
|
+
replyRedirectUrl: X,
|
|
222
231
|
shareUrl: `https://app.logora.fr/share/a/${e.id}`,
|
|
223
232
|
shareTitle: i.formatMessage({
|
|
224
233
|
id: "share.argument.title",
|
|
@@ -233,49 +242,49 @@ const Re = de(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
233
242
|
showShareText: !0,
|
|
234
243
|
showShareButton: r?.actions?.hideShareButton !== !0,
|
|
235
244
|
enableReport: !(e.score === 100 && e.manual_score),
|
|
236
|
-
enableEdition:
|
|
237
|
-
enableDeletion:
|
|
245
|
+
enableEdition: q,
|
|
246
|
+
enableDeletion: J,
|
|
238
247
|
children: /* @__PURE__ */ o(
|
|
239
|
-
|
|
248
|
+
Ce,
|
|
240
249
|
{
|
|
241
250
|
voteableType: "Message",
|
|
242
251
|
voteableId: e.id,
|
|
243
252
|
totalUpvote: e.upvotes,
|
|
244
253
|
totalDownvote: 0,
|
|
245
|
-
activeClassName: s[`voteButtonPosition-${
|
|
246
|
-
disabled: e.status === "rejected" ||
|
|
254
|
+
activeClassName: s[`voteButtonPosition-${R}`],
|
|
255
|
+
disabled: e.status === "rejected" || p?.id === e?.author?.id || x
|
|
247
256
|
}
|
|
248
257
|
)
|
|
249
258
|
}
|
|
250
259
|
),
|
|
251
|
-
!
|
|
252
|
-
|
|
260
|
+
!N && !A && /* @__PURE__ */ o(
|
|
261
|
+
me,
|
|
253
262
|
{
|
|
254
263
|
numberReplies: e.number_replies,
|
|
255
264
|
repliesAuthors: e.replies_authors,
|
|
256
|
-
expandReplies:
|
|
257
|
-
onToggleReplies:
|
|
265
|
+
expandReplies: u,
|
|
266
|
+
onToggleReplies: $,
|
|
258
267
|
isReply: e.is_reply
|
|
259
268
|
}
|
|
260
269
|
)
|
|
261
270
|
]
|
|
262
271
|
}
|
|
263
272
|
),
|
|
264
|
-
!
|
|
265
|
-
|
|
266
|
-
|
|
273
|
+
!A && /* @__PURE__ */ l(_, { children: [
|
|
274
|
+
oe && /* @__PURE__ */ o(ce, { fallback: null, children: /* @__PURE__ */ o(
|
|
275
|
+
Te,
|
|
267
276
|
{
|
|
268
277
|
groupId: e.group_id,
|
|
269
278
|
groupType: S,
|
|
270
|
-
groupName:
|
|
271
|
-
positions:
|
|
279
|
+
groupName: T,
|
|
280
|
+
positions: M,
|
|
272
281
|
parentId: e.id,
|
|
273
|
-
positionId:
|
|
274
|
-
disabled:
|
|
282
|
+
positionId: O?.position_id,
|
|
283
|
+
disabled: v,
|
|
275
284
|
hideSourceAction: r?.actions?.disableUserSources || !1,
|
|
276
285
|
argumentListId: `argument_${e.id}_reply_list`,
|
|
277
286
|
onSubmit: (t) => {
|
|
278
|
-
|
|
287
|
+
k(), h([t]), I(!0);
|
|
279
288
|
},
|
|
280
289
|
isReply: !0,
|
|
281
290
|
avatarSize: 40,
|
|
@@ -288,13 +297,13 @@ const Re = de(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
288
297
|
},
|
|
289
298
|
`Reply${e.id}`
|
|
290
299
|
) }),
|
|
291
|
-
m?.length > 0 &&
|
|
292
|
-
|
|
293
|
-
|
|
300
|
+
m?.length > 0 && u && /* @__PURE__ */ o("div", { className: s.repliesList, children: m.map((t) => B(t)) }),
|
|
301
|
+
u && /* @__PURE__ */ o("div", { className: s.repliesList, children: /* @__PURE__ */ o(
|
|
302
|
+
Re,
|
|
294
303
|
{
|
|
295
304
|
voteableType: "Message",
|
|
296
305
|
currentListId: `argument_${e.id}_reply_list`,
|
|
297
|
-
loadingComponent: /* @__PURE__ */ o(
|
|
306
|
+
loadingComponent: /* @__PURE__ */ o(we, {}),
|
|
298
307
|
resource: "messages",
|
|
299
308
|
sort: "+created_at",
|
|
300
309
|
filters: {
|
|
@@ -305,17 +314,17 @@ const Re = de(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
305
314
|
perPage: 5,
|
|
306
315
|
display: "column",
|
|
307
316
|
resourcePropName: "argument",
|
|
308
|
-
emptyListComponent: /* @__PURE__ */ o(
|
|
309
|
-
transformData: (t) =>
|
|
310
|
-
children:
|
|
317
|
+
emptyListComponent: /* @__PURE__ */ o(_, {}),
|
|
318
|
+
transformData: (t) => ae(t),
|
|
319
|
+
children: B(e)
|
|
311
320
|
}
|
|
312
321
|
) }),
|
|
313
|
-
m?.length > 0 && !
|
|
322
|
+
m?.length > 0 && !u && /* @__PURE__ */ o("div", { className: s.repliesList, children: e.number_replies > 1 && /* @__PURE__ */ o("div", { className: s.readMoreLink, children: /* @__PURE__ */ o(
|
|
314
323
|
Se,
|
|
315
324
|
{
|
|
316
325
|
role: "link",
|
|
317
|
-
rightIcon: /* @__PURE__ */ o(
|
|
318
|
-
handleClick:
|
|
326
|
+
rightIcon: /* @__PURE__ */ o(j, { name: "lightArrow", height: 10, width: 10 }),
|
|
327
|
+
handleClick: $,
|
|
319
328
|
children: i.formatMessage({
|
|
320
329
|
id: "argument.argument.see_more",
|
|
321
330
|
defaultMessage: "See more"
|
|
@@ -324,8 +333,8 @@ const Re = de(() => import("../../input/argument_input/index.js").then((e) => ({
|
|
|
324
333
|
) }) })
|
|
325
334
|
] })
|
|
326
335
|
] });
|
|
327
|
-
},
|
|
336
|
+
}, Ae = Ne;
|
|
328
337
|
export {
|
|
329
|
-
|
|
330
|
-
|
|
338
|
+
Ne as Argument,
|
|
339
|
+
Ae as ArgumentContainer
|
|
331
340
|
};
|
|
@@ -1,29 +1,22 @@
|
|
|
1
|
-
import { jsx as t, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { useIntl as
|
|
1
|
+
import { jsx as t, Fragment as u, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import s from "classnames";
|
|
3
|
+
import { useMemo as g } from "react";
|
|
4
|
+
import { useIntl as h, FormattedMessage as p } from "react-intl";
|
|
5
5
|
import o from "./ConsultationBox.module.scss.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { TranslatedContent as I } from "../../translation/translated_content/TranslatedContent.js";
|
|
6
|
+
import { useRoutes as f } from "../../data/config_provider/useRoutes.js";
|
|
7
|
+
import { useResponsive as v } from "../../hooks/use_responsive/useResponsive.js";
|
|
8
|
+
import { Link as i } from "../../action/link/Link.js";
|
|
9
|
+
import { TranslatedContent as N } from "../../translation/translated_content/TranslatedContent.js";
|
|
11
10
|
import { Icon as c } from "../../icons/icon/Icon.js";
|
|
12
|
-
import { ProgressBar as
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
{
|
|
17
|
-
id: "consultation.consultation_box.consultation_ended",
|
|
18
|
-
defaultMessage: "Consultation ended"
|
|
19
|
-
}
|
|
20
|
-
) }) : /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t("span", { children: g }) });
|
|
21
|
-
return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ n("div", { className: o.container, children: [
|
|
22
|
-
/* @__PURE__ */ n("div", { className: o.consultationImageBox, children: [
|
|
11
|
+
import { ProgressBar as _ } from "../../progress/progress_bar/ProgressBar.js";
|
|
12
|
+
const D = ({ consultation: e, showVoteProgress: m = !0 }) => {
|
|
13
|
+
const d = h(), r = g(() => /* @__PURE__ */ new Date()), l = new Date(e.ends_at), n = f(), { isMobile: x } = v();
|
|
14
|
+
return /* @__PURE__ */ t(u, { children: /* @__PURE__ */ a("div", { className: o.container, children: [
|
|
15
|
+
/* @__PURE__ */ a("div", { className: o.consultationImageBox, children: [
|
|
23
16
|
/* @__PURE__ */ t(
|
|
24
|
-
|
|
17
|
+
i,
|
|
25
18
|
{
|
|
26
|
-
to:
|
|
19
|
+
to: n.consultationShowLocation.toUrl({
|
|
27
20
|
consultationSlug: e.slug
|
|
28
21
|
}),
|
|
29
22
|
children: /* @__PURE__ */ t(
|
|
@@ -32,7 +25,7 @@ const P = ({ consultation: e, showVoteProgress: d = !0 }) => {
|
|
|
32
25
|
loading: "lazy",
|
|
33
26
|
className: o.consultationImage,
|
|
34
27
|
src: e.image_url,
|
|
35
|
-
alt:
|
|
28
|
+
alt: d.formatMessage({
|
|
36
29
|
id: "consultation.consultation_box.alt",
|
|
37
30
|
defaultMessage: "Presentation image for the consultation"
|
|
38
31
|
})
|
|
@@ -40,24 +33,22 @@ const P = ({ consultation: e, showVoteProgress: d = !0 }) => {
|
|
|
40
33
|
)
|
|
41
34
|
}
|
|
42
35
|
),
|
|
43
|
-
e.ends_at && /* @__PURE__ */ t(
|
|
44
|
-
|
|
36
|
+
e.ends_at && l < r && /* @__PURE__ */ t("div", { className: s(o.consultationTime, o.ended), children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(
|
|
37
|
+
p,
|
|
45
38
|
{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}),
|
|
49
|
-
children: h()
|
|
39
|
+
id: "consultation.consultation_box.consultation_ended",
|
|
40
|
+
defaultMessage: "Consultation ended"
|
|
50
41
|
}
|
|
51
|
-
)
|
|
42
|
+
) }) })
|
|
52
43
|
] }),
|
|
53
44
|
/* @__PURE__ */ t(
|
|
54
|
-
|
|
45
|
+
i,
|
|
55
46
|
{
|
|
56
|
-
to:
|
|
47
|
+
to: n.consultationShowLocation.toUrl({
|
|
57
48
|
consultationSlug: e.slug
|
|
58
49
|
}),
|
|
59
50
|
children: /* @__PURE__ */ t("div", { className: o.consultationTitle, children: /* @__PURE__ */ t(
|
|
60
|
-
|
|
51
|
+
N,
|
|
61
52
|
{
|
|
62
53
|
originalContent: e.title,
|
|
63
54
|
originalLanguage: e.language,
|
|
@@ -68,19 +59,19 @@ const P = ({ consultation: e, showVoteProgress: d = !0 }) => {
|
|
|
68
59
|
}
|
|
69
60
|
),
|
|
70
61
|
/* @__PURE__ */ t(
|
|
71
|
-
|
|
62
|
+
i,
|
|
72
63
|
{
|
|
73
|
-
to:
|
|
64
|
+
to: n.consultationShowLocation.toUrl({
|
|
74
65
|
consultationSlug: e.slug
|
|
75
66
|
})
|
|
76
67
|
}
|
|
77
68
|
),
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ a("div", { className: o.consultationInformations, children: [
|
|
70
|
+
/* @__PURE__ */ a("div", { className: o.consultationLeft, children: [
|
|
71
|
+
/* @__PURE__ */ a(
|
|
81
72
|
"div",
|
|
82
73
|
{
|
|
83
|
-
className:
|
|
74
|
+
className: s(
|
|
84
75
|
o.consultationGroupInformation,
|
|
85
76
|
o.consultationGroupRight
|
|
86
77
|
),
|
|
@@ -90,20 +81,20 @@ const P = ({ consultation: e, showVoteProgress: d = !0 }) => {
|
|
|
90
81
|
]
|
|
91
82
|
}
|
|
92
83
|
),
|
|
93
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ a("div", { className: o.consultationGroupInformation, children: [
|
|
94
85
|
/* @__PURE__ */ t("span", { className: o.consultationTextInformation, children: e.proposals_count }),
|
|
95
86
|
/* @__PURE__ */ t(c, { name: "chat", width: 15, height: 20, className: o.iconChat })
|
|
96
87
|
] })
|
|
97
88
|
] }),
|
|
98
|
-
|
|
89
|
+
m && e.vote_goal > 0 && l > r && /* @__PURE__ */ t(
|
|
99
90
|
"div",
|
|
100
91
|
{
|
|
101
|
-
className:
|
|
92
|
+
className: s(
|
|
102
93
|
o.consultationGroupInformation,
|
|
103
94
|
o.progressBarContainer
|
|
104
95
|
),
|
|
105
96
|
children: /* @__PURE__ */ t(
|
|
106
|
-
|
|
97
|
+
_,
|
|
107
98
|
{
|
|
108
99
|
className: o.progress,
|
|
109
100
|
innerClassName: o.bar,
|
|
@@ -119,5 +110,5 @@ const P = ({ consultation: e, showVoteProgress: d = !0 }) => {
|
|
|
119
110
|
] }) });
|
|
120
111
|
};
|
|
121
112
|
export {
|
|
122
|
-
|
|
113
|
+
D as ConsultationBox
|
|
123
114
|
};
|