@logora/debate 0.3.90 → 0.3.92

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 (88) hide show
  1. package/dist/assets/components/argument/argument/Argument.module-QZdPjj_i.css +1 -0
  2. package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-DjNiVt-p.css +1 -0
  3. package/dist/assets/components/follow/follow_button/FollowButton.module-C9YXM8AM.css +1 -0
  4. package/dist/assets/components/input/text_editor/{TextEditor.module-DePSfOvG.css → TextEditor.module-CxuSL3l3.css} +1 -1
  5. package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-DvwCbS9k.css +1 -0
  6. package/dist/assets/components/navigation/tabs/Tabs.module-CFizOU1d.css +1 -0
  7. package/dist/assets/components/proposal/proposal_box/ProposalBox.module-Dm8XDnr1.css +1 -0
  8. package/dist/assets/components/section/section_box/SectionBox.module-qQs4B6bf.css +1 -0
  9. package/dist/assets/components/source/context_source_list/ContextSourceList.module-DUPbI-wb.css +1 -0
  10. package/dist/assets/components/source/source_list_item/SourceListItem.module-fm_uHuY4.css +1 -0
  11. package/dist/assets/components/summary/summary/Summary.module-2bnx3egy.css +1 -0
  12. package/dist/assets/components/summary/summary_box/SummaryBox.module-Dr9PevSJ.css +1 -0
  13. package/dist/assets/components/vote/vote_box/VoteBox.module-D5sSSHpi.css +1 -0
  14. package/dist/components/argument/argument/Argument.js +111 -106
  15. package/dist/components/argument/argument/Argument.module.scss.js +31 -31
  16. package/dist/components/auth/providers/FormAuth.js +8 -7
  17. package/dist/components/auth/use_auth/base64.js +4 -0
  18. package/dist/components/consultation/consultation_box/ConsultationBox.js +80 -111
  19. package/dist/components/consultation/consultation_box/ConsultationBox.module.scss.js +31 -29
  20. package/dist/components/dialog/dropdown/Dropdown.js +35 -28
  21. package/dist/components/follow/follow_button/FollowButton.js +17 -16
  22. package/dist/components/follow/follow_button/FollowButton.module.scss.js +6 -4
  23. package/dist/components/icons/bild_icons/index.js +58 -56
  24. package/dist/components/icons/clarin_icons/Alarm.js +6 -0
  25. package/dist/components/icons/clarin_icons/Announcement.js +6 -0
  26. package/dist/components/icons/clarin_icons/Chat.js +6 -0
  27. package/dist/components/icons/clarin_icons/CheckCircle.js +9 -0
  28. package/dist/components/icons/clarin_icons/Clock.js +6 -0
  29. package/dist/components/icons/clarin_icons/Follow.js +6 -0
  30. package/dist/components/icons/clarin_icons/MobileClose.js +9 -0
  31. package/dist/components/icons/clarin_icons/Question.js +6 -0
  32. package/dist/components/icons/clarin_icons/Search.js +6 -0
  33. package/dist/components/icons/clarin_icons/Send.js +10 -0
  34. package/dist/components/icons/clarin_icons/Share.js +6 -0
  35. package/dist/components/icons/clarin_icons/Upvote.js +9 -0
  36. package/dist/components/icons/clarin_icons/User.js +9 -0
  37. package/dist/components/icons/clarin_icons/index.js +106 -0
  38. package/dist/components/icons/hero_icons/index.js +20 -18
  39. package/dist/components/icons/krone_icons/index.js +48 -46
  40. package/dist/components/icons/regular_icons/Follow.js +6 -0
  41. package/dist/components/icons/regular_icons/index.js +20 -18
  42. package/dist/components/icons/spiegel_icons/Downvote.js +6 -0
  43. package/dist/components/icons/spiegel_icons/Upvote.js +6 -0
  44. package/dist/components/icons/spiegel_icons/index.js +54 -52
  45. package/dist/components/icons/stern_icons/index.js +102 -70
  46. package/dist/components/input/argument_input/ArgumentInput.js +201 -197
  47. package/dist/components/input/select/Select.js +19 -19
  48. package/dist/components/input/text_editor/TextEditor.js +143 -129
  49. package/dist/components/input/text_editor/TextEditor.module.scss.js +5 -5
  50. package/dist/components/input/text_editor/plugins/FocusPlugin.js +12 -8
  51. package/dist/components/input/text_editor/plugins/SetContentPlugin.js +13 -13
  52. package/dist/components/input/text_editor/plugins/SetRichContentPlugin.js +10 -10
  53. package/dist/components/input/text_editor/plugins/ToolbarPlugin.js +70 -72
  54. package/dist/components/list/paginated_list/PaginatedList.js +152 -144
  55. package/dist/components/list/paginated_list/action_bar/ActionBar.js +72 -61
  56. package/dist/components/list/paginated_list/action_bar/ActionBar.module.scss.js +18 -16
  57. package/dist/components/navigation/tabs/Tabs.js +85 -24
  58. package/dist/components/navigation/tabs/Tabs.module.scss.js +20 -10
  59. package/dist/components/notification/notification_menu/NotificationMenu.js +23 -22
  60. package/dist/components/proposal/proposal_box/ProposalBox.js +70 -59
  61. package/dist/components/proposal/proposal_box/ProposalBox.module.scss.js +14 -10
  62. package/dist/components/section/section_box/SectionBox.js +10 -10
  63. package/dist/components/section/section_box/SectionBox.module.scss.js +9 -9
  64. package/dist/components/source/context_source_box/ContextSourceBox.js +7 -7
  65. package/dist/components/source/context_source_list/ContextSourceList.js +10 -13
  66. package/dist/components/source/context_source_list/ContextSourceList.module.scss.js +14 -12
  67. package/dist/components/source/source_list_item/SourceListItem.js +42 -28
  68. package/dist/components/source/source_list_item/SourceListItem.module.scss.js +8 -6
  69. package/dist/components/source/source_modal/SourceModal.js +15 -15
  70. package/dist/components/summary/summary/Summary.js +41 -63
  71. package/dist/components/summary/summary/Summary.module.scss.js +10 -6
  72. package/dist/components/summary/summary_box/SummaryBox.module.scss.js +9 -9
  73. package/dist/components/vote/vote_box/VoteBox.js +122 -143
  74. package/dist/components/vote/vote_box/VoteBox.module.scss.js +50 -48
  75. package/dist/index.js +323 -319
  76. package/package.json +1 -1
  77. package/dist/assets/components/argument/argument/Argument.module-gLfNRLks.css +0 -1
  78. package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-BnTr5IaF.css +0 -1
  79. package/dist/assets/components/follow/follow_button/FollowButton.module-Da-cPgwT.css +0 -1
  80. package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-pxwFC_Y2.css +0 -1
  81. package/dist/assets/components/navigation/tabs/Tabs.module-CtDi0tAd.css +0 -1
  82. package/dist/assets/components/proposal/proposal_box/ProposalBox.module-T4ms_LQ7.css +0 -1
  83. package/dist/assets/components/section/section_box/SectionBox.module-DUeUtdWr.css +0 -1
  84. package/dist/assets/components/source/context_source_list/ContextSourceList.module-D6X_0dB7.css +0 -1
  85. package/dist/assets/components/source/source_list_item/SourceListItem.module-mTxHhXPV.css +0 -1
  86. package/dist/assets/components/summary/summary/Summary.module-DjfmUlkW.css +0 -1
  87. package/dist/assets/components/summary/summary_box/SummaryBox.module-DQVkA8l7.css +0 -1
  88. package/dist/assets/components/vote/vote_box/VoteBox.module-CDrqb2SZ.css +0 -1
@@ -1,237 +1,245 @@
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";
1
+ import { jsxs as $, jsx as c, Fragment as Qe } from "react/jsx-runtime";
2
+ import $e from "@rooks/use-previous";
3
+ import Pe from "classnames";
4
+ import Ue, { useState as m, useEffect as h } from "react";
5
+ import { useIntl as We } from "react-intl";
6
+ import { useLocation as ze } from "react-router";
7
7
  import a from "./PaginatedList.module.scss.js";
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 = ({
8
+ import { ActionBar as Ge } from "./action_bar/ActionBar.js";
9
+ import { useList as Ve } from "../list_provider/useList.js";
10
+ import { useDataProvider as Xe } from "../../data/data_provider/useDataProvider.js";
11
+ import { useResponsive as Ye } from "../../hooks/use_responsive/useResponsive.js";
12
+ import { useData as Ze } from "../../data/data_provider/useData.js";
13
+ import { uniqueBy as x } from "../../util/unique_by/uniqueBy.js";
14
+ import { Pagination as He } from "../pagination/Pagination.js";
15
+ import { StandardErrorBoundary as Ie } from "../../error/standard_error_boundary/StandardErrorBoundary.js";
16
+ const ct = ({
17
17
  query: w,
18
18
  sortOptions: i,
19
19
  sort: N,
20
20
  filters: o,
21
21
  tagList: ne,
22
+ pinnedTagList: ae,
22
23
  currentPage: M,
23
- resource: _,
24
+ resource: A,
24
25
  currentListId: n,
25
- withToken: ae,
26
- perPage: h,
27
- perPageParam: le = "per_page",
28
- pageParam: ie = "page",
29
- sortParam: oe = "sort",
30
- queryParam: me = "query",
26
+ withToken: le,
27
+ perPage: p,
28
+ perPageParam: ie = "per_page",
29
+ pageParam: oe = "page",
30
+ sortParam: me = "sort",
31
+ queryParam: de = "query",
31
32
  tagParam: re = "tag_id",
32
33
  totalHeaderParam: D = "total",
33
- onUpdateTotal: W,
34
+ onUpdateTotal: P,
34
35
  onElementsLoad: R,
35
- transformData: z,
36
- uniqueIdKey: p = "id",
37
- children: de,
38
- resourcePropName: fe,
39
- loadingComponent: G,
40
- searchBar: ce = !1,
41
- title: ue,
42
- emptyListComponent: P,
43
- emptyText: V,
44
- display: X,
45
- elementsPerLine: Y,
46
- indexLayout: Ee = !1,
47
- gap: ge = "1em",
48
- withPagination: he = !0,
49
- numberElements: Z,
50
- countless: pe,
51
- onElementClick: ve,
52
- withUrlParams: Se = !1,
53
- onLoadNewPage: $
36
+ transformData: U,
37
+ uniqueIdKey: v = "id",
38
+ children: fe,
39
+ resourcePropName: ce,
40
+ loadingComponent: W,
41
+ searchBar: ue = !1,
42
+ title: Ee,
43
+ subtitle: ge,
44
+ showDebateConsultationSubtitle: he = !1,
45
+ emptyListComponent: z,
46
+ emptyText: G,
47
+ display: V,
48
+ elementsPerLine: X,
49
+ indexLayout: pe = !1,
50
+ gap: ve = "1em",
51
+ withPagination: Se = !0,
52
+ numberElements: Y,
53
+ countless: ye,
54
+ onElementClick: we,
55
+ withUrlParams: Ne = !1,
56
+ onLoadNewPage: Z
54
57
  }) => {
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
+ const J = We(), t = Ve(), H = Xe(), I = ze(), { isMobile: K, isTablet: Me, isDesktop: j } = Ye(), [b, u] = m(!1), [Re, be] = m(!1), [k, S] = Ze(n, []), [O, ke] = m(
59
+ k?.length || 0
60
+ ), [E, B] = m(M || 1), [y, L] = m(w || null), [C, q] = m(null), [Ce, ee] = m(null), d = new URLSearchParams(
58
61
  typeof window < "u" ? window.location.search : I.search
59
- ), be = () => i && i[0].type === "sort" && i[0].value || N || "", ke = () => {
62
+ ), Fe = () => i && i[0].type === "sort" && i[0].value || N || "", Te = () => {
60
63
  let e = {};
61
64
  return i && i[0].type === "filter" && (e[i[0].name] = i[0].value), o && (e = Object.assign({}, e, o)), e;
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()) {
65
+ }, [F, T] = m(Fe()), [Q, _] = m(Te()), te = $e(o);
66
+ 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(() => {
67
+ if (d.get("tagId") && q(Number.parseInt(d.get("tagId"))), d.get("search") && L(d.get("search")), d.get("sort")) {
68
+ T(d.get("sort"));
69
+ for (const e of d.values()) {
67
70
  i?.map((s) => {
68
71
  s.value === e && ee(s.name);
69
72
  });
70
73
  break;
71
74
  }
72
75
  }
73
- for (const e of r.keys()) {
76
+ for (const e of d.keys()) {
74
77
  i?.map((s) => {
75
- s.name === e && (T({
78
+ s.name === e && (_({
76
79
  ...o,
77
80
  [s.name]: s.value
78
81
  }), ee(s.name));
79
82
  });
80
83
  break;
81
84
  }
82
- }, [I.search]), g(() => {
83
- _ ? (j(1), S([]), f(!0), se(1)) : f(!1);
85
+ }, [I.search]), h(() => {
86
+ A ? (B(1), S([]), u(!0), se(1)) : u(!1);
84
87
  }, [
85
- C,
88
+ F,
86
89
  Q,
87
90
  y,
88
- _,
89
- k,
90
- h
91
- ]), g(() => {
92
- c > 1 && (f(!0), se(c));
93
- }, [c]), g(() => {
91
+ A,
92
+ C,
93
+ p
94
+ ]), h(() => {
95
+ E > 1 && (u(!0), se(E));
96
+ }, [E]), h(() => {
94
97
  if (t.addElements && n in t.addElements && t.addElements[n].length > 0) {
95
- Te(t.addElements[n]);
98
+ Ae(t.addElements[n]);
96
99
  const e = t.addElements;
97
100
  delete e[n], t.setAddElements(e);
98
101
  }
99
- }, [t.addElements]), g(() => {
100
- if (t.updateElements && n in t.updateElements && t.updateElements[n].length > 0) {
101
- xe(t.updateElements[n]);
102
+ }, [t.addElements]), h(() => {
103
+ if (t.updateElements && n in t.updateElements && (console.log("[PaginatedList] update received for listId:", n, t.updateElements[n]), t.updateElements[n].length > 0)) {
104
+ De(t.updateElements[n]);
102
105
  const e = t.updateElements;
103
106
  delete e[n], t.setUpdateElements(e);
104
107
  }
105
- }, [t.updateElements]), g(() => {
108
+ }, [t.updateElements]), h(() => {
106
109
  if (t.removeElements && n in t.removeElements && t.removeElements[n].length > 0) {
107
- Ae(t.removeElements[n]);
110
+ Je(t.removeElements[n]);
108
111
  const e = t.removeElements;
109
112
  delete e[n], t.setRemoveElements(e);
110
113
  }
111
114
  }, [t.removeElements]);
112
- const Ce = (e) => {
113
- e.type === "filter" ? (F(""), T({
115
+ const _e = (e) => {
116
+ e.type === "filter" ? (T(""), _({
114
117
  ...o,
115
118
  [e.name]: e.value
116
- })) : (F(e.value), T(o ? { ...o } : {}));
117
- }, Fe = () => {
118
- typeof $ == "function" && $() !== null || j(c + 1);
119
+ })) : (T(e.value), _(o ? { ...o } : {}));
120
+ }, xe = () => {
121
+ typeof Z == "function" && Z() !== null || B(E + 1);
119
122
  }, se = (e) => {
120
- const s = ae ? H.getListWithToken : H.getList;
121
- if ((e - 1) * h <= (Z || O) || e === 1) {
122
- const u = {
123
- [ie]: e,
124
- [le]: h,
125
- ...C && !y && { [oe]: C },
126
- ...y && { [me]: y },
127
- ...pe === !0 && { countless: !0 },
123
+ const s = le ? H.getListWithToken : H.getList;
124
+ if ((e - 1) * p <= (Y || O) || e === 1) {
125
+ const r = {
126
+ [oe]: e,
127
+ [ie]: p,
128
+ ...F && !y && { [me]: F },
129
+ ...y && { [de]: y },
130
+ ...ye === !0 && { countless: !0 },
128
131
  ...Q,
129
- ...k && { [re]: k }
132
+ ...C && { [re]: C }
130
133
  };
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);
134
+ s(A, r).then((l) => {
135
+ const f = l.headers;
136
+ f && D in f && (ke(
137
+ Number.parseInt(f[D || "total"], 10)
138
+ ), P && P(f[D || "total"]));
139
+ let g = l?.data?.data;
140
+ R && R(g), U && (g = g.filter(U)), t.addElements && n in t.addElements && t.addElements[n].length > 0 && (g = [...t.addElements[n], g]), je(g), u(!1);
138
141
  }).catch((l) => {
139
- console.error(l), l?.response?.status !== 404 && Ne(!0), f(!1);
142
+ console.error(l), l?.response?.status !== 404 && be(!0), u(!1);
140
143
  });
141
144
  } else
142
- f(!1);
143
- }, Te = (e) => {
145
+ u(!1);
146
+ }, Ae = (e) => {
144
147
  S(
145
- (s) => A([...e, ...s], p || "id")
148
+ (s) => x([...e, ...s], v || "id")
146
149
  ), R && R(e);
147
- }, xe = (e) => {
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(
150
+ }, De = (e) => {
151
+ S((s) => {
152
+ let r = s;
153
+ return e.forEach(
154
+ (l) => r = r.map(
155
+ (f) => f.id === l.id ? l : f
156
+ )
157
+ ), x(r, v || "id");
158
+ });
159
+ }, Je = (e) => {
160
+ const s = e.map((l) => l.id), r = k.filter(
156
161
  (l) => s.indexOf(l.id) === -1
157
162
  );
158
- S(A(u, p || "id"));
159
- }, _e = (e) => {
163
+ S(x(r, v || "id"));
164
+ }, je = (e) => {
160
165
  S(
161
- (s) => A([...s, ...e], p || "id")
166
+ (s) => x([...s, ...e], v || "id")
162
167
  );
163
- }, De = (e, s) => e !== void 0 ? /* @__PURE__ */ d(
168
+ }, Be = (e, s) => e !== void 0 ? /* @__PURE__ */ c(
164
169
  "li",
165
170
  {
166
171
  className: a.paginatedListItem,
167
172
  "data-testid": "list-item",
168
- onClick: ve,
169
- children: /* @__PURE__ */ d(Ze, { hideMessage: !0, children: Qe.cloneElement(de, {
173
+ onClick: we,
174
+ children: /* @__PURE__ */ c(Ie, { hideMessage: !0, children: Ue.cloneElement(fe, {
170
175
  index: s,
171
- [fe]: e
176
+ [ce]: e
172
177
  }) })
173
178
  },
174
- e[p || "id"]
175
- ) : null, Je = (e) => G ? /* @__PURE__ */ d("li", { className: a.paginatedListItem, children: G }, e) : null;
176
- if (we)
179
+ `${e[v || "id"]}_${e.updated_at || e.content}`
180
+ ) : null, Le = (e) => W ? /* @__PURE__ */ c("li", { className: a.paginatedListItem, children: W }, e) : null;
181
+ if (Re)
177
182
  throw new Error(
178
183
  J.formatMessage({
179
184
  id: "error.list",
180
185
  defaultMessage: "Error when loading content."
181
186
  })
182
187
  );
183
- return /* @__PURE__ */ U("div", { className: a.listContainer, children: [
184
- /* @__PURE__ */ d(
185
- ze,
188
+ return /* @__PURE__ */ $("div", { className: a.listContainer, children: [
189
+ /* @__PURE__ */ c(
190
+ Ge,
186
191
  {
187
- title: ue,
192
+ title: Ee,
193
+ subtitle: ge,
194
+ showDebateConsultationSubtitle: he,
188
195
  sortOptions: i,
189
- defaultSelectOption: Re,
190
- searchBar: ce,
196
+ defaultSelectOption: Ce,
197
+ searchBar: ue,
191
198
  tagList: ne,
192
- activeTagId: k,
193
- onSearch: (e) => B(e),
194
- onSortChange: Ce,
199
+ pinnedTagList: ae,
200
+ activeTagId: C,
201
+ onSearch: (e) => L(e),
202
+ onSortChange: _e,
195
203
  onTagChange: (e) => q(e),
196
- withUrlParams: Se
204
+ withUrlParams: Ne
197
205
  }
198
206
  ),
199
- !b && v.length === 0 ? P ? /* @__PURE__ */ d("div", { className: a.emptyListElement, children: P }) : /* @__PURE__ */ d("div", { className: a.emptyList, children: V || J.formatMessage({
207
+ !b && k.length === 0 ? z ? /* @__PURE__ */ c("div", { className: a.emptyListElement, children: z }) : /* @__PURE__ */ c("div", { className: a.emptyList, children: G || J.formatMessage({
200
208
  id: "info.emptyList",
201
209
  defaultMessage: "No items for now."
202
- }) }) : /* @__PURE__ */ U(Le, { children: [
203
- /* @__PURE__ */ U(
210
+ }) }) : /* @__PURE__ */ $(Qe, { children: [
211
+ /* @__PURE__ */ $(
204
212
  "ul",
205
213
  {
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,
212
- [a.indexLayoutList]: Ee,
213
- [a.listIsDesktop]: L,
214
- [a.listIsTablet]: ye && !L,
214
+ className: Pe(a.paginatedList, {
215
+ [a.paginatedListIsTablet]: !K && !j,
216
+ [a.centeredList]: V === "column",
217
+ [a.column]: V === "column",
218
+ [a.twoElementsPerLine]: X === 2,
219
+ [a.oneElementPerLine]: X === 1,
220
+ [a.indexLayoutList]: pe,
221
+ [a.listIsDesktop]: j,
222
+ [a.listIsTablet]: Me && !j,
215
223
  [a.listIsMobile]: K
216
224
  }),
217
- style: { gap: ge },
225
+ style: { gap: ve },
218
226
  children: [
219
- v.map(De),
220
- b ? Array(h).fill().map((e, s) => s).map(Je) : null
227
+ k.map(Be),
228
+ b ? Array(p).fill().map((e, s) => s).map(Le) : null
221
229
  ]
222
230
  }
223
231
  ),
224
- !b && he !== !1 && /* @__PURE__ */ d(
225
- Ye,
232
+ !b && Se !== !1 && /* @__PURE__ */ c(
233
+ He,
226
234
  {
227
235
  buttonText: J.formatMessage({
228
236
  id: "action.see_more",
229
237
  defaultMessage: "See more"
230
238
  }),
231
- currentPage: c,
232
- perPage: h,
233
- totalElements: Z || O,
234
- onLoad: Fe,
239
+ currentPage: E,
240
+ perPage: p,
241
+ totalElements: Y || O,
242
+ onLoad: xe,
235
243
  isLoading: b,
236
244
  hideLoader: !0,
237
245
  "data-tid": "list_read_more"
@@ -241,5 +249,5 @@ const rt = ({
241
249
  ] });
242
250
  };
243
251
  export {
244
- rt as PaginatedList
252
+ ct as PaginatedList
245
253
  };
@@ -1,99 +1,109 @@
1
- import { jsx as i, Fragment as f, jsxs as m } from "react/jsx-runtime";
2
- import h from "classnames";
3
- import { useState as C } from "react";
4
- import { useIntl as M } from "react-intl";
5
- import { useLocation as j } from "react-router";
6
- import l from "./ActionBar.module.scss.js";
7
- import { useResponsive as H } from "../../../hooks/use_responsive/useResponsive.js";
8
- import { SearchInput as R } from "../../../input/search_input/SearchInput.js";
9
- import { Select as T } from "../../../input/select/Select.js";
10
- import { Tag as _ } from "../../../tag/tag/Tag.js";
11
- import { Icon as z } from "../../../icons/icon/Icon.js";
12
- const X = ({
1
+ import { jsx as i, Fragment as g, jsxs as h } from "react/jsx-runtime";
2
+ import v from "classnames";
3
+ import { useState as T } from "react";
4
+ import { useIntl as _ } from "react-intl";
5
+ import { useLocation as z } from "react-router";
6
+ import a from "./ActionBar.module.scss.js";
7
+ import { useResponsive as D } from "../../../hooks/use_responsive/useResponsive.js";
8
+ import { SearchInput as F } from "../../../input/search_input/SearchInput.js";
9
+ import { Select as P } from "../../../input/select/Select.js";
10
+ import { Tag as E } from "../../../tag/tag/Tag.js";
11
+ import { Icon as G } from "../../../icons/icon/Icon.js";
12
+ const O = ({
13
13
  title: n,
14
- sortOptions: s,
15
- defaultSelectOption: u,
16
- searchBar: a = !1,
17
- tagList: c,
18
- activeTagId: r,
19
- withUrlParams: d = !1,
20
- onSearch: p,
21
- onSortChange: v,
22
- onTagChange: S
14
+ subtitle: u,
15
+ showDebateConsultationSubtitle: y = !1,
16
+ sortOptions: r,
17
+ defaultSelectOption: A,
18
+ searchBar: s = !1,
19
+ tagList: o,
20
+ pinnedTagList: c = [],
21
+ activeTagId: d,
22
+ withUrlParams: m = !1,
23
+ onSearch: I,
24
+ onSortChange: N,
25
+ onTagChange: w
23
26
  }) => {
24
- const g = M(), I = j(), { isMobile: D } = H(), [N, x] = C(!1), o = new URLSearchParams(
25
- typeof window < "u" ? window.location.search : I.search
26
- ), y = (e) => {
27
- if (d) {
28
- for (const t of o.keys())
29
- s.map((k) => {
30
- k.name === t && o.delete(t);
27
+ const x = _(), b = z(), { isMobile: J } = D(), [k, C] = T(!1), l = new URLSearchParams(
28
+ typeof window < "u" ? window.location.search : b.search
29
+ ), f = Array.isArray(o) ? o : o?.data || [], p = [
30
+ ...new Set(
31
+ (Array.isArray(c) ? c : [c]).filter(Boolean).map(String)
32
+ )
33
+ ], S = f.length > 0 ? [
34
+ ...p.map((e) => f.find((t) => String(t.id) === e)).filter(Boolean),
35
+ ...f.filter((e) => !p.includes(String(e.id)))
36
+ ] : [], M = (e) => {
37
+ if (m) {
38
+ for (const t of l.keys())
39
+ r.map((R) => {
40
+ R.name === t && l.delete(t);
31
41
  });
32
- o.delete("sort"), o.set(
42
+ l.delete("sort"), l.set(
33
43
  e.type === "filter" ? e.name : "sort",
34
44
  e.value
35
45
  );
36
46
  }
37
- v(e);
38
- }, A = (e) => {
39
- d && (e.id === r ? o.delete("tagId") : o.set("tagId", e.id)), S(e.id === r ? null : e.id);
40
- }, b = (e) => {
41
- d && (e ? o.set("search", e) : o.delete("search")), p(e), x(e !== "");
42
- }, w = (e) => {
43
- const t = r === e.id;
47
+ N(e);
48
+ }, j = (e) => {
49
+ m && (e.id === d ? l.delete("tagId") : l.set("tagId", e.id)), w(e.id === d ? null : e.id);
50
+ }, B = (e) => {
51
+ m && (e ? l.set("search", e) : l.delete("search")), I(e), C(e !== "");
52
+ }, H = (e) => {
53
+ const t = d === e.id;
44
54
  return /* @__PURE__ */ i(
45
55
  "div",
46
56
  {
47
- className: l.tagItem,
48
- onClick: () => A(e),
57
+ className: a.tagItem,
58
+ onClick: () => j(e),
49
59
  children: /* @__PURE__ */ i(
50
- _,
60
+ E,
51
61
  {
52
62
  text: e.display_name,
53
63
  active: t,
54
- rightIcon: t && /* @__PURE__ */ i(z, { name: "close", height: 10, width: 10 })
64
+ rightIcon: t && /* @__PURE__ */ i(G, { name: "close", height: 10, width: 10 })
55
65
  }
56
66
  )
57
67
  },
58
68
  e.id
59
69
  );
60
70
  };
61
- return /* @__PURE__ */ i(f, { children: (n || s || a) && /* @__PURE__ */ m(f, { children: [
62
- /* @__PURE__ */ m(
71
+ return /* @__PURE__ */ i(g, { children: (n || r || s) && /* @__PURE__ */ h(g, { children: [
72
+ /* @__PURE__ */ h(
63
73
  "div",
64
74
  {
65
- className: h(l.listHeader, {
66
- [l.listHeaderOneItem]: !a || !s
75
+ className: v(a.listHeader, {
76
+ [a.listHeaderOneItem]: !s || !r
67
77
  }),
68
78
  children: [
69
- n && /* @__PURE__ */ i("div", { className: l.listTitle, children: n }),
70
- (s || a) && /* @__PURE__ */ m(
79
+ n && /* @__PURE__ */ i("div", { className: a.listTitle, children: n }),
80
+ (r || s) && /* @__PURE__ */ h(
71
81
  "div",
72
82
  {
73
- className: h(l.rightBar, {
74
- [l.rightBarOneItem]: !a || !s
83
+ className: v(a.rightBar, {
84
+ [a.rightBarOneItem]: !s || !r
75
85
  }),
76
86
  children: [
77
- a ? /* @__PURE__ */ i("div", { className: l.search, children: /* @__PURE__ */ i(
78
- R,
87
+ s ? /* @__PURE__ */ i("div", { className: a.search, children: /* @__PURE__ */ i(
88
+ F,
79
89
  {
80
- onSearchSubmit: b,
81
- placeholder: g.formatMessage({
90
+ onSearchSubmit: B,
91
+ placeholder: x.formatMessage({
82
92
  id: "info.search_mobile",
83
93
  defaultMessage: "Search"
84
94
  }),
85
95
  reducedByDefault: !1
86
96
  }
87
97
  ) }) : null,
88
- s ? /* @__PURE__ */ i(
89
- T,
98
+ r ? /* @__PURE__ */ i(
99
+ P,
90
100
  {
91
- onChange: y,
92
- options: s,
93
- defaultOption: u,
101
+ onChange: M,
102
+ options: r,
103
+ defaultOption: A,
94
104
  horizontalPosition: "right",
95
- disabled: N,
96
- className: l.select
105
+ disabled: k,
106
+ className: a.select
97
107
  }
98
108
  ) : null
99
109
  ]
@@ -102,9 +112,10 @@ const X = ({
102
112
  ]
103
113
  }
104
114
  ),
105
- c && c.length > 0 && /* @__PURE__ */ i("div", { className: l.tagList, children: c.map(w) })
115
+ y && u && /* @__PURE__ */ i("div", { className: a.listSubtitle, children: u }),
116
+ S.length > 0 && /* @__PURE__ */ i("div", { className: a.tagList, children: S.map(H) })
106
117
  ] }) });
107
118
  };
108
119
  export {
109
- X as ActionBar
120
+ O as ActionBar
110
121
  };
@@ -1,23 +1,25 @@
1
- import '../../../../assets/components/list/paginated_list/action_bar/ActionBar.module-pxwFC_Y2.css';const t = "_listHeader_fbaxc_3", e = "_listHeaderOneItem_fbaxc_16", a = "_listTitle_fbaxc_23", s = "_rightBar_fbaxc_30", _ = "_rightBarOneItem_fbaxc_40", c = "_search_fbaxc_51", r = "_tagList_fbaxc_61", i = "_tagItem_fbaxc_76", l = "_select_fbaxc_83", n = {
1
+ import '../../../../assets/components/list/paginated_list/action_bar/ActionBar.module-DvwCbS9k.css';const t = "_listHeader_un1z2_3", e = "_listHeaderOneItem_un1z2_16", s = "_listTitle_un1z2_23", _ = "_listSubtitle_un1z2_30", i = "_rightBar_un1z2_37", n = "_rightBarOneItem_un1z2_47", a = "_search_un1z2_58", l = "_tagList_un1z2_68", r = "_tagItem_un1z2_83", c = "_select_un1z2_90", u = {
2
2
  listHeader: t,
3
3
  listHeaderOneItem: e,
4
- listTitle: a,
5
- rightBar: s,
6
- rightBarOneItem: _,
7
- search: c,
8
- tagList: r,
9
- tagItem: i,
10
- select: l
4
+ listTitle: s,
5
+ listSubtitle: _,
6
+ rightBar: i,
7
+ rightBarOneItem: n,
8
+ search: a,
9
+ tagList: l,
10
+ tagItem: r,
11
+ select: c
11
12
  };
12
13
  export {
13
- n as default,
14
+ u as default,
14
15
  t as listHeader,
15
16
  e as listHeaderOneItem,
16
- a as listTitle,
17
- s as rightBar,
18
- _ as rightBarOneItem,
19
- c as search,
20
- l as select,
21
- i as tagItem,
22
- r as tagList
17
+ _ as listSubtitle,
18
+ s as listTitle,
19
+ i as rightBar,
20
+ n as rightBarOneItem,
21
+ a as search,
22
+ c as select,
23
+ r as tagItem,
24
+ l as tagList
23
25
  };