@logora/debate 0.3.79 → 0.3.80

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