@logora/debate 0.3.74 → 0.3.75
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/argument/argument/Argument.module-QZdPjj_i.css +1 -0
- package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-D2an6OmR.css +1 -0
- package/dist/assets/components/input/text_editor/{TextEditor.module-DePSfOvG.css → TextEditor.module-CxuSL3l3.css} +1 -1
- package/dist/assets/components/section/section_box/SectionBox.module-qQs4B6bf.css +1 -0
- package/dist/assets/components/source/context_source_list/ContextSourceList.module-DUPbI-wb.css +1 -0
- package/dist/assets/components/source/source_list_item/SourceListItem.module-fm_uHuY4.css +1 -0
- package/dist/assets/components/summary/summary/Summary.module-2bnx3egy.css +1 -0
- package/dist/assets/components/summary/summary_box/SummaryBox.module-Dr9PevSJ.css +1 -0
- package/dist/assets/components/vote/vote_box/VoteBox.module-C9Q6gBw3.css +1 -0
- package/dist/components/argument/argument/Argument.js +112 -108
- package/dist/components/argument/argument/Argument.module.scss.js +31 -31
- package/dist/components/consultation/consultation_box/ConsultationBox.js +80 -111
- package/dist/components/consultation/consultation_box/ConsultationBox.module.scss.js +23 -21
- package/dist/components/dialog/dropdown/Dropdown.js +35 -28
- 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/icons/stern_icons/index.js +100 -70
- package/dist/components/input/argument_input/ArgumentInput.js +142 -142
- package/dist/components/input/select/Select.js +19 -19
- package/dist/components/input/text_editor/TextEditor.js +135 -124
- package/dist/components/input/text_editor/TextEditor.module.scss.js +5 -5
- package/dist/components/input/text_editor/plugins/SetContentPlugin.js +13 -13
- package/dist/components/input/text_editor/plugins/SetRichContentPlugin.js +10 -10
- package/dist/components/list/paginated_list/PaginatedList.js +112 -110
- package/dist/components/notification/notification_menu/NotificationMenu.js +23 -22
- package/dist/components/proposal/proposal_box/ProposalBox.js +8 -10
- package/dist/components/section/section_box/SectionBox.js +10 -10
- package/dist/components/section/section_box/SectionBox.module.scss.js +9 -9
- package/dist/components/source/context_source_list/ContextSourceList.js +8 -7
- package/dist/components/source/context_source_list/ContextSourceList.module.scss.js +14 -12
- package/dist/components/source/source_list_item/SourceListItem.js +42 -28
- package/dist/components/source/source_list_item/SourceListItem.module.scss.js +8 -6
- package/dist/components/summary/summary/Summary.js +41 -63
- package/dist/components/summary/summary/Summary.module.scss.js +10 -6
- package/dist/components/summary/summary_box/SummaryBox.module.scss.js +9 -9
- package/dist/components/vote/vote_box/VoteBox.js +123 -145
- package/dist/components/vote/vote_box/VoteBox.module.scss.js +50 -50
- package/package.json +1 -1
- package/dist/assets/components/argument/argument/Argument.module-gLfNRLks.css +0 -1
- package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-BnTr5IaF.css +0 -1
- package/dist/assets/components/section/section_box/SectionBox.module-DUeUtdWr.css +0 -1
- package/dist/assets/components/source/context_source_list/ContextSourceList.module-D6X_0dB7.css +0 -1
- package/dist/assets/components/source/source_list_item/SourceListItem.module-mTxHhXPV.css +0 -1
- package/dist/assets/components/summary/summary/Summary.module-DjfmUlkW.css +0 -1
- package/dist/assets/components/summary/summary_box/SummaryBox.module-DQVkA8l7.css +0 -1
- package/dist/assets/components/vote/vote_box/VoteBox.module-CDrqb2SZ.css +0 -1
|
@@ -1,178 +1,180 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import Qe, { useState as m, useEffect as
|
|
5
|
-
import { useIntl as
|
|
6
|
-
import { useLocation as
|
|
1
|
+
import { jsxs as $, jsx as c, Fragment as je } from "react/jsx-runtime";
|
|
2
|
+
import Be from "@rooks/use-previous";
|
|
3
|
+
import Le from "classnames";
|
|
4
|
+
import Qe, { useState as m, useEffect as h } from "react";
|
|
5
|
+
import { useIntl as $e } from "react-intl";
|
|
6
|
+
import { useLocation as Pe } from "react-router";
|
|
7
7
|
import a from "./PaginatedList.module.scss.js";
|
|
8
|
-
import { ActionBar as
|
|
9
|
-
import { useList as
|
|
10
|
-
import { useDataProvider as
|
|
11
|
-
import { useResponsive as
|
|
12
|
-
import { useData as
|
|
13
|
-
import { uniqueBy as
|
|
14
|
-
import { Pagination as
|
|
15
|
-
import { StandardErrorBoundary as
|
|
16
|
-
const
|
|
8
|
+
import { ActionBar as Ue } from "./action_bar/ActionBar.js";
|
|
9
|
+
import { useList as We } from "../list_provider/useList.js";
|
|
10
|
+
import { useDataProvider as ze } from "../../data/data_provider/useDataProvider.js";
|
|
11
|
+
import { useResponsive as Ge } from "../../hooks/use_responsive/useResponsive.js";
|
|
12
|
+
import { useData as Ve } from "../../data/data_provider/useData.js";
|
|
13
|
+
import { uniqueBy as x } from "../../util/unique_by/uniqueBy.js";
|
|
14
|
+
import { Pagination as Xe } from "../pagination/Pagination.js";
|
|
15
|
+
import { StandardErrorBoundary as Ye } from "../../error/standard_error_boundary/StandardErrorBoundary.js";
|
|
16
|
+
const dt = ({
|
|
17
17
|
query: w,
|
|
18
18
|
sortOptions: i,
|
|
19
19
|
sort: N,
|
|
20
20
|
filters: o,
|
|
21
21
|
tagList: ne,
|
|
22
22
|
currentPage: M,
|
|
23
|
-
resource:
|
|
23
|
+
resource: A,
|
|
24
24
|
currentListId: n,
|
|
25
25
|
withToken: ae,
|
|
26
|
-
perPage:
|
|
26
|
+
perPage: p,
|
|
27
27
|
perPageParam: le = "per_page",
|
|
28
28
|
pageParam: ie = "page",
|
|
29
29
|
sortParam: oe = "sort",
|
|
30
30
|
queryParam: me = "query",
|
|
31
|
-
tagParam:
|
|
31
|
+
tagParam: de = "tag_id",
|
|
32
32
|
totalHeaderParam: D = "total",
|
|
33
|
-
onUpdateTotal:
|
|
33
|
+
onUpdateTotal: P,
|
|
34
34
|
onElementsLoad: R,
|
|
35
|
-
transformData:
|
|
36
|
-
uniqueIdKey:
|
|
37
|
-
children:
|
|
35
|
+
transformData: U,
|
|
36
|
+
uniqueIdKey: v = "id",
|
|
37
|
+
children: re,
|
|
38
38
|
resourcePropName: fe,
|
|
39
|
-
loadingComponent:
|
|
39
|
+
loadingComponent: W,
|
|
40
40
|
searchBar: ce = !1,
|
|
41
41
|
title: ue,
|
|
42
|
-
emptyListComponent:
|
|
43
|
-
emptyText:
|
|
44
|
-
display:
|
|
45
|
-
elementsPerLine:
|
|
42
|
+
emptyListComponent: z,
|
|
43
|
+
emptyText: G,
|
|
44
|
+
display: V,
|
|
45
|
+
elementsPerLine: X,
|
|
46
46
|
indexLayout: Ee = !1,
|
|
47
47
|
gap: ge = "1em",
|
|
48
48
|
withPagination: he = !0,
|
|
49
|
-
numberElements:
|
|
49
|
+
numberElements: Y,
|
|
50
50
|
countless: pe,
|
|
51
51
|
onElementClick: ve,
|
|
52
52
|
withUrlParams: Se = !1,
|
|
53
|
-
onLoadNewPage:
|
|
53
|
+
onLoadNewPage: Z
|
|
54
54
|
}) => {
|
|
55
|
-
const J =
|
|
56
|
-
|
|
57
|
-
), [
|
|
55
|
+
const J = $e(), t = We(), H = ze(), I = Pe(), { isMobile: K, isTablet: ye, isDesktop: j } = Ge(), [b, u] = m(!1), [we, Ne] = m(!1), [k, S] = Ve(n, []), [O, Me] = m(
|
|
56
|
+
k?.length || 0
|
|
57
|
+
), [E, B] = m(M || 1), [y, L] = m(w || null), [C, q] = m(null), [Re, ee] = m(null), d = new URLSearchParams(
|
|
58
58
|
typeof window < "u" ? window.location.search : I.search
|
|
59
59
|
), be = () => i && i[0].type === "sort" && i[0].value || N || "", ke = () => {
|
|
60
60
|
let e = {};
|
|
61
61
|
return i && i[0].type === "filter" && (e[i[0].name] = i[0].value), o && (e = Object.assign({}, e, o)), e;
|
|
62
|
-
}, [
|
|
63
|
-
M && M !==
|
|
64
|
-
if (
|
|
65
|
-
|
|
66
|
-
for (const e of
|
|
62
|
+
}, [F, T] = m(be()), [Q, _] = m(ke()), te = Be(o);
|
|
63
|
+
M && M !== E && B(M), w !== void 0 && w !== y && L(w), N !== void 0 && N !== F && T(N), te && JSON.stringify(o) !== JSON.stringify(te) && JSON.stringify(o) !== JSON.stringify(Q) && _(o), h(() => {
|
|
64
|
+
if (d.get("tagId") && q(Number.parseInt(d.get("tagId"))), d.get("search") && L(d.get("search")), d.get("sort")) {
|
|
65
|
+
T(d.get("sort"));
|
|
66
|
+
for (const e of d.values()) {
|
|
67
67
|
i?.map((s) => {
|
|
68
68
|
s.value === e && ee(s.name);
|
|
69
69
|
});
|
|
70
70
|
break;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
for (const e of
|
|
73
|
+
for (const e of d.keys()) {
|
|
74
74
|
i?.map((s) => {
|
|
75
|
-
s.name === e && (
|
|
75
|
+
s.name === e && (_({
|
|
76
76
|
...o,
|
|
77
77
|
[s.name]: s.value
|
|
78
78
|
}), ee(s.name));
|
|
79
79
|
});
|
|
80
80
|
break;
|
|
81
81
|
}
|
|
82
|
-
}, [I.search]),
|
|
83
|
-
|
|
82
|
+
}, [I.search]), h(() => {
|
|
83
|
+
A ? (B(1), S([]), u(!0), se(1)) : u(!1);
|
|
84
84
|
}, [
|
|
85
|
-
|
|
85
|
+
F,
|
|
86
86
|
Q,
|
|
87
87
|
y,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
]),
|
|
92
|
-
|
|
93
|
-
}, [
|
|
88
|
+
A,
|
|
89
|
+
C,
|
|
90
|
+
p
|
|
91
|
+
]), h(() => {
|
|
92
|
+
E > 1 && (u(!0), se(E));
|
|
93
|
+
}, [E]), h(() => {
|
|
94
94
|
if (t.addElements && n in t.addElements && t.addElements[n].length > 0) {
|
|
95
95
|
Te(t.addElements[n]);
|
|
96
96
|
const e = t.addElements;
|
|
97
97
|
delete e[n], t.setAddElements(e);
|
|
98
98
|
}
|
|
99
|
-
}, [t.addElements]),
|
|
100
|
-
if (t.updateElements && n in t.updateElements && t.updateElements[n].length > 0) {
|
|
101
|
-
|
|
99
|
+
}, [t.addElements]), h(() => {
|
|
100
|
+
if (t.updateElements && n in t.updateElements && (console.log("[PaginatedList] update received for listId:", n, t.updateElements[n]), t.updateElements[n].length > 0)) {
|
|
101
|
+
_e(t.updateElements[n]);
|
|
102
102
|
const e = t.updateElements;
|
|
103
103
|
delete e[n], t.setUpdateElements(e);
|
|
104
104
|
}
|
|
105
|
-
}, [t.updateElements]),
|
|
105
|
+
}, [t.updateElements]), h(() => {
|
|
106
106
|
if (t.removeElements && n in t.removeElements && t.removeElements[n].length > 0) {
|
|
107
|
-
|
|
107
|
+
xe(t.removeElements[n]);
|
|
108
108
|
const e = t.removeElements;
|
|
109
109
|
delete e[n], t.setRemoveElements(e);
|
|
110
110
|
}
|
|
111
111
|
}, [t.removeElements]);
|
|
112
112
|
const Ce = (e) => {
|
|
113
|
-
e.type === "filter" ? (
|
|
113
|
+
e.type === "filter" ? (T(""), _({
|
|
114
114
|
...o,
|
|
115
115
|
[e.name]: e.value
|
|
116
|
-
})) : (
|
|
116
|
+
})) : (T(e.value), _(o ? { ...o } : {}));
|
|
117
117
|
}, Fe = () => {
|
|
118
|
-
typeof
|
|
118
|
+
typeof Z == "function" && Z() !== null || B(E + 1);
|
|
119
119
|
}, se = (e) => {
|
|
120
120
|
const s = ae ? H.getListWithToken : H.getList;
|
|
121
|
-
if ((e - 1) *
|
|
122
|
-
const
|
|
121
|
+
if ((e - 1) * p <= (Y || O) || e === 1) {
|
|
122
|
+
const r = {
|
|
123
123
|
[ie]: e,
|
|
124
|
-
[le]:
|
|
125
|
-
...
|
|
124
|
+
[le]: p,
|
|
125
|
+
...F && !y && { [oe]: F },
|
|
126
126
|
...y && { [me]: y },
|
|
127
127
|
...pe === !0 && { countless: !0 },
|
|
128
128
|
...Q,
|
|
129
|
-
...
|
|
129
|
+
...C && { [de]: C }
|
|
130
130
|
};
|
|
131
|
-
s(
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
Number.parseInt(
|
|
135
|
-
),
|
|
136
|
-
let
|
|
137
|
-
R && R(
|
|
131
|
+
s(A, r).then((l) => {
|
|
132
|
+
const f = l.headers;
|
|
133
|
+
f && D in f && (Me(
|
|
134
|
+
Number.parseInt(f[D || "total"], 10)
|
|
135
|
+
), P && P(f[D || "total"]));
|
|
136
|
+
let g = l?.data?.data;
|
|
137
|
+
R && R(g), U && (g = g.filter(U)), t.addElements && n in t.addElements && t.addElements[n].length > 0 && (g = [...t.addElements[n], g]), Ae(g), u(!1);
|
|
138
138
|
}).catch((l) => {
|
|
139
|
-
console.error(l), l?.response?.status !== 404 && Ne(!0),
|
|
139
|
+
console.error(l), l?.response?.status !== 404 && Ne(!0), u(!1);
|
|
140
140
|
});
|
|
141
141
|
} else
|
|
142
|
-
|
|
142
|
+
u(!1);
|
|
143
143
|
}, Te = (e) => {
|
|
144
144
|
S(
|
|
145
|
-
(s) =>
|
|
145
|
+
(s) => x([...e, ...s], v || "id")
|
|
146
146
|
), R && R(e);
|
|
147
|
+
}, _e = (e) => {
|
|
148
|
+
S((s) => {
|
|
149
|
+
let r = s;
|
|
150
|
+
return e.forEach(
|
|
151
|
+
(l) => r = r.map(
|
|
152
|
+
(f) => f.id === l.id ? l : f
|
|
153
|
+
)
|
|
154
|
+
), x(r, v || "id");
|
|
155
|
+
});
|
|
147
156
|
}, xe = (e) => {
|
|
148
|
-
|
|
149
|
-
e.forEach(
|
|
150
|
-
(u) => s = s.map(
|
|
151
|
-
(l) => l.id === u.id ? u : l
|
|
152
|
-
)
|
|
153
|
-
), S(A(s, p || "id"));
|
|
154
|
-
}, Ae = (e) => {
|
|
155
|
-
const s = e.map((l) => l.id), u = v.filter(
|
|
157
|
+
const s = e.map((l) => l.id), r = k.filter(
|
|
156
158
|
(l) => s.indexOf(l.id) === -1
|
|
157
159
|
);
|
|
158
|
-
S(
|
|
159
|
-
},
|
|
160
|
+
S(x(r, v || "id"));
|
|
161
|
+
}, Ae = (e) => {
|
|
160
162
|
S(
|
|
161
|
-
(s) =>
|
|
163
|
+
(s) => x([...s, ...e], v || "id")
|
|
162
164
|
);
|
|
163
|
-
}, De = (e, s) => e !== void 0 ? /* @__PURE__ */
|
|
165
|
+
}, De = (e, s) => e !== void 0 ? /* @__PURE__ */ c(
|
|
164
166
|
"li",
|
|
165
167
|
{
|
|
166
168
|
className: a.paginatedListItem,
|
|
167
169
|
"data-testid": "list-item",
|
|
168
170
|
onClick: ve,
|
|
169
|
-
children: /* @__PURE__ */
|
|
171
|
+
children: /* @__PURE__ */ c(Ye, { hideMessage: !0, children: Qe.cloneElement(re, {
|
|
170
172
|
index: s,
|
|
171
173
|
[fe]: e
|
|
172
174
|
}) })
|
|
173
175
|
},
|
|
174
|
-
e[
|
|
175
|
-
) : null, Je = (e) =>
|
|
176
|
+
`${e[v || "id"]}_${e.updated_at || e.content}`
|
|
177
|
+
) : null, Je = (e) => W ? /* @__PURE__ */ c("li", { className: a.paginatedListItem, children: W }, e) : null;
|
|
176
178
|
if (we)
|
|
177
179
|
throw new Error(
|
|
178
180
|
J.formatMessage({
|
|
@@ -180,57 +182,57 @@ const rt = ({
|
|
|
180
182
|
defaultMessage: "Error when loading content."
|
|
181
183
|
})
|
|
182
184
|
);
|
|
183
|
-
return /* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
|
|
185
|
+
return /* @__PURE__ */ $("div", { className: a.listContainer, children: [
|
|
186
|
+
/* @__PURE__ */ c(
|
|
187
|
+
Ue,
|
|
186
188
|
{
|
|
187
189
|
title: ue,
|
|
188
190
|
sortOptions: i,
|
|
189
191
|
defaultSelectOption: Re,
|
|
190
192
|
searchBar: ce,
|
|
191
193
|
tagList: ne,
|
|
192
|
-
activeTagId:
|
|
193
|
-
onSearch: (e) =>
|
|
194
|
+
activeTagId: C,
|
|
195
|
+
onSearch: (e) => L(e),
|
|
194
196
|
onSortChange: Ce,
|
|
195
197
|
onTagChange: (e) => q(e),
|
|
196
198
|
withUrlParams: Se
|
|
197
199
|
}
|
|
198
200
|
),
|
|
199
|
-
!b &&
|
|
201
|
+
!b && k.length === 0 ? z ? /* @__PURE__ */ c("div", { className: a.emptyListElement, children: z }) : /* @__PURE__ */ c("div", { className: a.emptyList, children: G || J.formatMessage({
|
|
200
202
|
id: "info.emptyList",
|
|
201
203
|
defaultMessage: "No items for now."
|
|
202
|
-
}) }) : /* @__PURE__ */
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
+
}) }) : /* @__PURE__ */ $(je, { children: [
|
|
205
|
+
/* @__PURE__ */ $(
|
|
204
206
|
"ul",
|
|
205
207
|
{
|
|
206
|
-
className:
|
|
207
|
-
[a.paginatedListIsTablet]: !K && !
|
|
208
|
-
[a.centeredList]:
|
|
209
|
-
[a.column]:
|
|
210
|
-
[a.twoElementsPerLine]:
|
|
211
|
-
[a.oneElementPerLine]:
|
|
208
|
+
className: Le(a.paginatedList, {
|
|
209
|
+
[a.paginatedListIsTablet]: !K && !j,
|
|
210
|
+
[a.centeredList]: V === "column",
|
|
211
|
+
[a.column]: V === "column",
|
|
212
|
+
[a.twoElementsPerLine]: X === 2,
|
|
213
|
+
[a.oneElementPerLine]: X === 1,
|
|
212
214
|
[a.indexLayoutList]: Ee,
|
|
213
|
-
[a.listIsDesktop]:
|
|
214
|
-
[a.listIsTablet]: ye && !
|
|
215
|
+
[a.listIsDesktop]: j,
|
|
216
|
+
[a.listIsTablet]: ye && !j,
|
|
215
217
|
[a.listIsMobile]: K
|
|
216
218
|
}),
|
|
217
219
|
style: { gap: ge },
|
|
218
220
|
children: [
|
|
219
|
-
|
|
220
|
-
b ? Array(
|
|
221
|
+
k.map(De),
|
|
222
|
+
b ? Array(p).fill().map((e, s) => s).map(Je) : null
|
|
221
223
|
]
|
|
222
224
|
}
|
|
223
225
|
),
|
|
224
|
-
!b && he !== !1 && /* @__PURE__ */
|
|
225
|
-
|
|
226
|
+
!b && he !== !1 && /* @__PURE__ */ c(
|
|
227
|
+
Xe,
|
|
226
228
|
{
|
|
227
229
|
buttonText: J.formatMessage({
|
|
228
230
|
id: "action.see_more",
|
|
229
231
|
defaultMessage: "See more"
|
|
230
232
|
}),
|
|
231
|
-
currentPage:
|
|
232
|
-
perPage:
|
|
233
|
-
totalElements:
|
|
233
|
+
currentPage: E,
|
|
234
|
+
perPage: p,
|
|
235
|
+
totalElements: Y || O,
|
|
234
236
|
onLoad: Fe,
|
|
235
237
|
isLoading: b,
|
|
236
238
|
hideLoader: !0,
|
|
@@ -241,5 +243,5 @@ const rt = ({
|
|
|
241
243
|
] });
|
|
242
244
|
};
|
|
243
245
|
export {
|
|
244
|
-
|
|
246
|
+
dt as PaginatedList
|
|
245
247
|
};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { jsxs as a, Fragment as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as a, Fragment as c, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as l } from "react";
|
|
3
3
|
import { useIntl as m } from "react-intl";
|
|
4
|
-
import
|
|
4
|
+
import e from "./NotificationMenu.module.scss.js";
|
|
5
5
|
import { useDataProvider as f } from "../../data/data_provider/useDataProvider.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
import { StandardErrorBoundary as u } from "../../error/standard_error_boundary/StandardErrorBoundary.js";
|
|
7
|
+
import { PaginatedList as p } from "../../list/paginated_list/PaginatedList.js";
|
|
8
|
+
import { NotificationItem as h } from "../notification_item/NotificationItem.js";
|
|
9
|
+
import { UserContentSkeleton as g } from "../../skeleton/user_content_skeleton/UserContentSkeleton.js";
|
|
10
|
+
const P = ({ notificationDefinitions: o = {} }) => {
|
|
11
|
+
const i = m(), r = f(), [n, s] = l(!1), d = () => {
|
|
12
|
+
s(!0), r.create("notifications/read/all", {}).then(() => {
|
|
12
13
|
});
|
|
13
14
|
};
|
|
14
|
-
return /* @__PURE__ */ a(
|
|
15
|
-
/* @__PURE__ */ a("div", { className:
|
|
16
|
-
/* @__PURE__ */ t("div", { className:
|
|
15
|
+
return /* @__PURE__ */ a(c, { children: [
|
|
16
|
+
/* @__PURE__ */ a("div", { className: e.notificationMenuHeader, children: [
|
|
17
|
+
/* @__PURE__ */ t("div", { className: e.notificationMenuHeaderText, children: i.formatMessage({
|
|
17
18
|
id: "header.notifications",
|
|
18
19
|
defaultMessage: "Alerts"
|
|
19
20
|
}) }),
|
|
@@ -22,21 +23,21 @@ const C = ({ notificationDefinitions: o = {} }) => {
|
|
|
22
23
|
{
|
|
23
24
|
id: "read_all_notifications",
|
|
24
25
|
"data-tid": "action_read_all_notifications",
|
|
25
|
-
className:
|
|
26
|
+
className: e.readNotificationsButton,
|
|
26
27
|
tabIndex: "0",
|
|
27
|
-
onClick:
|
|
28
|
-
children:
|
|
28
|
+
onClick: d,
|
|
29
|
+
children: i.formatMessage({
|
|
29
30
|
id: "notifications.read_all",
|
|
30
31
|
defaultMessage: "Mark all as read"
|
|
31
32
|
})
|
|
32
33
|
}
|
|
33
34
|
)
|
|
34
35
|
] }),
|
|
35
|
-
/* @__PURE__ */ t("div", { className:
|
|
36
|
-
|
|
36
|
+
/* @__PURE__ */ t("div", { className: e.notificationList, children: /* @__PURE__ */ t(u, { hideMessage: !0, children: /* @__PURE__ */ t(
|
|
37
|
+
p,
|
|
37
38
|
{
|
|
38
39
|
currentListId: "notificationList",
|
|
39
|
-
loadingComponent: /* @__PURE__ */ t(
|
|
40
|
+
loadingComponent: /* @__PURE__ */ t(g, { numberLines: 0 }),
|
|
40
41
|
resourcePropName: "notification",
|
|
41
42
|
resource: "notifications",
|
|
42
43
|
sort: "-created_at",
|
|
@@ -45,16 +46,16 @@ const C = ({ notificationDefinitions: o = {} }) => {
|
|
|
45
46
|
display: "column",
|
|
46
47
|
gap: "0px",
|
|
47
48
|
children: /* @__PURE__ */ t(
|
|
48
|
-
|
|
49
|
+
h,
|
|
49
50
|
{
|
|
50
51
|
notificationDefinitions: o,
|
|
51
|
-
isRead:
|
|
52
|
+
isRead: n
|
|
52
53
|
}
|
|
53
54
|
)
|
|
54
55
|
}
|
|
55
|
-
) })
|
|
56
|
+
) }) })
|
|
56
57
|
] });
|
|
57
58
|
};
|
|
58
59
|
export {
|
|
59
|
-
|
|
60
|
+
P as NotificationMenu
|
|
60
61
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as t, jsxs as f, Fragment as y } from "react/jsx-runtime";
|
|
2
|
-
import u from "
|
|
3
|
-
import
|
|
2
|
+
import { useState as u, useEffect as I } from "react";
|
|
3
|
+
import g from "classnames";
|
|
4
4
|
import { useIntl as N } from "react-intl";
|
|
5
5
|
import o from "./ProposalBox.module.scss.js";
|
|
6
6
|
import { useConfig as S } from "../../data/config_provider/useConfig.js";
|
|
@@ -13,15 +13,14 @@ import { ReadMore as D } from "../../text/read_more/ReadMore.js";
|
|
|
13
13
|
import { TranslationButton as P } from "../../translation/translation_button/TranslationButton.js";
|
|
14
14
|
import { ContentFooter as R } from "../../user_content/content_footer/ContentFooter.js";
|
|
15
15
|
import { UpDownVoteBox as $ } from "../../vote/up_down_vote_box/UpDownVoteBox.js";
|
|
16
|
-
const
|
|
16
|
+
const Y = ({
|
|
17
17
|
proposal: e,
|
|
18
18
|
disabled: i = !1,
|
|
19
19
|
fixedContentHeight: C,
|
|
20
|
-
contentMaxHeight: F = 156,
|
|
21
20
|
enableEdition: T = !0,
|
|
22
21
|
hideFooter: _ = !1
|
|
23
22
|
}) => {
|
|
24
|
-
const [d,
|
|
23
|
+
const [d, v] = u(null), [x, M] = u(!1), a = N(), r = S(), { currentUser: l } = B(), c = l?.moderation_status === "banned", m = `proposal_${e.id}`, s = p(
|
|
25
24
|
e.title,
|
|
26
25
|
e.language,
|
|
27
26
|
"title",
|
|
@@ -37,7 +36,7 @@ const Z = ({
|
|
|
37
36
|
const h = JSON.parse(e.rich_content);
|
|
38
37
|
if (h.hasOwnProperty("root")) {
|
|
39
38
|
const b = H(h);
|
|
40
|
-
|
|
39
|
+
v(b);
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
}, [e.rich_content]);
|
|
@@ -47,7 +46,7 @@ const Z = ({
|
|
|
47
46
|
return /* @__PURE__ */ t(L, { elementId: m, onScroll: () => M(!0), children: /* @__PURE__ */ f(
|
|
48
47
|
"div",
|
|
49
48
|
{
|
|
50
|
-
className:
|
|
49
|
+
className: g(o.proposalBoxContainer, { [o.flash]: x }),
|
|
51
50
|
id: m,
|
|
52
51
|
children: [
|
|
53
52
|
/* @__PURE__ */ t(
|
|
@@ -62,7 +61,7 @@ const Z = ({
|
|
|
62
61
|
/* @__PURE__ */ t(
|
|
63
62
|
"div",
|
|
64
63
|
{
|
|
65
|
-
className:
|
|
64
|
+
className: g(o.proposalBoxContent, {
|
|
66
65
|
[o.fixedHeight]: C
|
|
67
66
|
}),
|
|
68
67
|
children: /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
|
|
@@ -110,7 +109,6 @@ const Z = ({
|
|
|
110
109
|
reportType: "Proposal",
|
|
111
110
|
deleteType: "proposals",
|
|
112
111
|
deleteListId: "proposalsList",
|
|
113
|
-
shareModal: !0,
|
|
114
112
|
shareModalTitle: a.formatMessage({ id: "share.proposal" }),
|
|
115
113
|
shareUrl: `https://app.logora.fr/share/p/${e.id}`,
|
|
116
114
|
shareTitle: a.formatMessage({ id: "share.proposal.title" }),
|
|
@@ -137,5 +135,5 @@ const Z = ({
|
|
|
137
135
|
) });
|
|
138
136
|
};
|
|
139
137
|
export {
|
|
140
|
-
|
|
138
|
+
Y as ProposalBox
|
|
141
139
|
};
|
|
@@ -6,20 +6,20 @@ import { useResponsive as N } from "../../hooks/use_responsive/useResponsive.js"
|
|
|
6
6
|
import { Icon as g } from "../../icons/icon/Icon.js";
|
|
7
7
|
const I = ({
|
|
8
8
|
isCollapsible: t = !1,
|
|
9
|
-
isCollapsedByDefault:
|
|
10
|
-
title:
|
|
9
|
+
isCollapsedByDefault: n = !1,
|
|
10
|
+
title: a,
|
|
11
11
|
subtitle: r = "",
|
|
12
|
-
className:
|
|
13
|
-
titleClassName:
|
|
14
|
-
children:
|
|
12
|
+
className: m,
|
|
13
|
+
titleClassName: l,
|
|
14
|
+
children: d
|
|
15
15
|
}) => {
|
|
16
|
-
const [c, h] = x(
|
|
16
|
+
const [c, h] = x(n), { isMobile: f } = N(), p = () => {
|
|
17
17
|
t && h((v) => !v);
|
|
18
18
|
};
|
|
19
19
|
return /* @__PURE__ */ s(
|
|
20
20
|
"div",
|
|
21
21
|
{
|
|
22
|
-
className: o(e.sectionBoxContainer, {
|
|
22
|
+
className: o(e.sectionBoxContainer, m, {
|
|
23
23
|
[e.isMobile]: f
|
|
24
24
|
}),
|
|
25
25
|
children: [
|
|
@@ -30,8 +30,8 @@ const I = ({
|
|
|
30
30
|
onClick: t ? p : null,
|
|
31
31
|
children: [
|
|
32
32
|
/* @__PURE__ */ s("div", { className: e.titleContainer, children: [
|
|
33
|
-
/* @__PURE__ */ i("div", { className: o(
|
|
34
|
-
r && /* @__PURE__ */ i("div", { className: o(
|
|
33
|
+
/* @__PURE__ */ i("div", { className: o(l, e.title), children: a }),
|
|
34
|
+
r && /* @__PURE__ */ i("div", { className: o(e.subtitle), children: r })
|
|
35
35
|
] }),
|
|
36
36
|
t && /* @__PURE__ */ i(
|
|
37
37
|
g,
|
|
@@ -47,7 +47,7 @@ const I = ({
|
|
|
47
47
|
]
|
|
48
48
|
}
|
|
49
49
|
),
|
|
50
|
-
(!c || !t) && /* @__PURE__ */ i("div", { className: o(e.body
|
|
50
|
+
(!c || !t) && /* @__PURE__ */ i("div", { className: o(e.body), children: d })
|
|
51
51
|
]
|
|
52
52
|
}
|
|
53
53
|
);
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import '../../../assets/components/section/section_box/SectionBox.module-
|
|
1
|
+
import '../../../assets/components/section/section_box/SectionBox.module-qQs4B6bf.css';const t = "_sectionBoxContainer_tcujo_3", o = "_isMobile_tcujo_15", e = "_header_tcujo_19", i = "_collapsible_tcujo_26", c = "_iconLightArrow_tcujo_30", n = "_iconRotated_tcujo_36", _ = "_titleContainer_tcujo_40", s = "_title_tcujo_40", l = "_subtitle_tcujo_54", a = "_body_tcujo_59", r = {
|
|
2
2
|
sectionBoxContainer: t,
|
|
3
3
|
isMobile: o,
|
|
4
4
|
header: e,
|
|
5
5
|
collapsible: i,
|
|
6
|
-
iconLightArrow:
|
|
6
|
+
iconLightArrow: c,
|
|
7
7
|
iconRotated: n,
|
|
8
8
|
titleContainer: _,
|
|
9
|
-
title:
|
|
10
|
-
subtitle:
|
|
11
|
-
body:
|
|
9
|
+
title: s,
|
|
10
|
+
subtitle: l,
|
|
11
|
+
body: a
|
|
12
12
|
};
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
a as body,
|
|
15
15
|
i as collapsible,
|
|
16
16
|
r as default,
|
|
17
17
|
e as header,
|
|
18
|
-
|
|
18
|
+
c as iconLightArrow,
|
|
19
19
|
n as iconRotated,
|
|
20
20
|
o as isMobile,
|
|
21
21
|
t as sectionBoxContainer,
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
l as subtitle,
|
|
23
|
+
s as title,
|
|
24
24
|
_ as titleContainer
|
|
25
25
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import m from "classnames";
|
|
3
3
|
import "react";
|
|
4
|
-
import { useIntl as
|
|
4
|
+
import { useIntl as c } from "react-intl";
|
|
5
5
|
import e from "./ContextSourceList.module.scss.js";
|
|
6
|
-
import { useResponsive as
|
|
6
|
+
import { useResponsive as p } from "../../hooks/use_responsive/useResponsive.js";
|
|
7
7
|
import { SectionBox as u } from "../../section/section_box/SectionBox.js";
|
|
8
8
|
import { Link as d } from "../../action/link/Link.js";
|
|
9
9
|
import { ContextSourceBox as f } from "../context_source_box/ContextSourceBox.js";
|
|
10
|
-
const
|
|
11
|
-
const r =
|
|
10
|
+
const M = ({ sources: i = [] }) => {
|
|
11
|
+
const r = c(), { isMobile: s, isTablet: l, isDesktop: n } = p(), a = (t) => /* @__PURE__ */ o(
|
|
12
12
|
d,
|
|
13
13
|
{
|
|
14
14
|
className: e.listItem,
|
|
@@ -30,6 +30,7 @@ const S = ({ sources: i = [] }) => {
|
|
|
30
30
|
return /* @__PURE__ */ o(
|
|
31
31
|
u,
|
|
32
32
|
{
|
|
33
|
+
className: e.sectionBox,
|
|
33
34
|
isCollapsible: !0,
|
|
34
35
|
isCollapsedByDefault: !1,
|
|
35
36
|
title: r.formatMessage({
|
|
@@ -41,8 +42,8 @@ const S = ({ sources: i = [] }) => {
|
|
|
41
42
|
{
|
|
42
43
|
className: m(e.content, {
|
|
43
44
|
[e.contentDesktop]: n,
|
|
44
|
-
[e.contentTablet]:
|
|
45
|
-
[e.contentMobile]:
|
|
45
|
+
[e.contentTablet]: l,
|
|
46
|
+
[e.contentMobile]: s
|
|
46
47
|
}),
|
|
47
48
|
children: i.map(a)
|
|
48
49
|
}
|
|
@@ -51,5 +52,5 @@ const S = ({ sources: i = [] }) => {
|
|
|
51
52
|
);
|
|
52
53
|
};
|
|
53
54
|
export {
|
|
54
|
-
|
|
55
|
+
M as ContextSourceList
|
|
55
56
|
};
|