@logora/debate 0.1.1 → 0.2.0
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/README.md +14 -23
- package/dist/components/action/button/Button.js +1 -1
- package/dist/components/argument/argument/Argument.js +49 -49
- package/dist/components/argument/top_arguments/TopArguments.js +17 -17
- package/dist/components/auth/auth_initializer/AuthInitializer.js +5 -5
- package/dist/components/auth/auth_modal/AuthModal.js +9 -9
- package/dist/components/auth/login_form/LoginForm.js +1 -0
- package/dist/components/auth/oauth2_button/OAuth2Button.js +3 -3
- package/dist/components/auth/providers/AuthProviderFactory.js +4 -4
- package/dist/components/auth/signup_form/SignupForm.js +4 -4
- package/dist/components/auth/social_auth_form/SocialAuthForm.js +10 -10
- package/dist/components/auth/sso_form/SSOForm.js +4 -4
- package/dist/components/chart/line_chart/LineChart.js +10 -10
- package/dist/components/chart/pie_chart/PieChart.js +6 -10
- package/dist/components/consultation/consultation_box/ConsultationBox.js +19 -14
- package/dist/components/debate/debate_box/DebateBox.js +11 -11
- package/dist/components/dialog/drawer/Drawer.js +16 -16
- package/dist/components/dialog/modal/Modal.js +8 -8
- package/dist/components/dialog/toast_provider/ToastProvider.js +10 -10
- package/dist/components/hooks/use_responsive/ResponsiveProvider.js +4 -4
- package/dist/components/input/argument_input/ArgumentInput.js +100 -99
- package/dist/components/input/search_input/SearchInput.js +4 -4
- package/dist/components/input/text_editor/TextEditor.js +50 -50
- package/dist/components/input/text_editor/lexicalToHtml.js +7 -7
- package/dist/components/input/text_editor/plugins/MaxLengthPlugin.js +12 -12
- package/dist/components/input/text_editor/plugins/ResetPlugin.js +6 -6
- package/dist/components/input/text_editor/plugins/SetContentPlugin.js +6 -6
- package/dist/components/input/text_editor/plugins/ToolbarPlugin.js +21 -21
- package/dist/components/intl/intl_provider/IntlProvider.js +6 -6
- package/dist/components/list/paginated_list/PaginatedList.js +16 -16
- package/dist/components/list/paginated_list/VotePaginatedList.js +6 -6
- package/dist/components/list/paginated_list/action_bar/ActionBar.js +7 -7
- package/dist/components/navbar/navbar_button/NavbarButton.js +3 -3
- package/dist/components/navbar/navbar_modal/NavbarModal.js +11 -11
- package/dist/components/notification/notification_menu/NotificationMenu.js +4 -4
- package/dist/components/proposal/proposal_box/ProposalBox.js +8 -8
- package/dist/components/share/share_box/ShareBox.js +17 -17
- package/dist/components/source/context_source_list/ContextSourceList.js +3 -3
- package/dist/components/source/source_modal/SourceModal.js +16 -16
- package/dist/components/suggestion/suggestion_banner/SuggestionBanner.js +14 -14
- package/dist/components/suggestion/suggestion_box/SuggestionBox.js +6 -6
- package/dist/components/suggestion/suggestion_input/SuggestionInput.js +13 -12
- package/dist/components/user/avatar/Avatar.js +7 -7
- package/dist/components/user/update_user_info_modal/UpdateUserInfoModal.js +17 -15
- package/dist/components/user_content/content_footer/ContentFooter.js +11 -11
- package/dist/components/user_content/summary_content_box/SummaryContentBox.js +6 -6
- package/dist/components/user_content/use_delete_content/useDeleteContent.js +7 -7
- package/dist/components/user_content/use_report_content/ReportModal.js +9 -9
- package/dist/components/vote/use_vote/useVote.js +3 -3
- package/dist/components/vote/vote_box/VoteBox.js +7 -7
- package/dist/index.js +56 -56
- package/dist/node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalCharacterLimitPlugin.prod.js +57 -57
- package/dist/node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalComposer.prod.js +14 -14
- package/dist/node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalContentEditable.prod.js +15 -15
- package/dist/node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalListPlugin.prod.js +6 -6
- package/dist/node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalOnChangePlugin.prod.js +1 -1
- package/dist/node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalRichTextPlugin.prod.js +21 -21
- package/package.json +6 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { Lr as e, Ni as t, yr as n } from "../../../../node_modules/.pnpm/lexical@0.38.2/node_modules/lexical/Lexical.prod.js";
|
|
2
|
+
import { L as r } from "../../../../node_modules/.pnpm/@lexical_selection@0.38.2/node_modules/@lexical/selection/LexicalSelection.prod.js";
|
|
3
|
+
import { St as i } from "../../../../node_modules/.pnpm/@lexical_utils@0.38.2/node_modules/@lexical/utils/LexicalUtils.prod.js";
|
|
4
|
+
import { o as a } from "../../../../node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalComposerContext.prod.js";
|
|
5
5
|
import { useEffect as o } from "react";
|
|
6
6
|
//#region src/components/input/text_editor/plugins/MaxLengthPlugin.jsx
|
|
7
7
|
var s = ({ maxLength: s = 5e4 }) => {
|
|
8
|
-
let [c] =
|
|
8
|
+
let [c] = a();
|
|
9
9
|
return o(() => {
|
|
10
|
-
let
|
|
11
|
-
return c.registerNodeTransform(
|
|
12
|
-
let o =
|
|
13
|
-
if (!
|
|
14
|
-
let l = c.getEditorState(), u = l.read(() =>
|
|
10
|
+
let a = null;
|
|
11
|
+
return c.registerNodeTransform(t, (t) => {
|
|
12
|
+
let o = e();
|
|
13
|
+
if (!n(o) || !o.isCollapsed()) return;
|
|
14
|
+
let l = c.getEditorState(), u = l.read(() => t.getTextContent()), d = t.getTextContent();
|
|
15
15
|
if (u !== d) {
|
|
16
|
-
let
|
|
17
|
-
|
|
16
|
+
let e = d.length - s, t = o.anchor;
|
|
17
|
+
e > 0 && (u.length === s && a !== l ? (a = l, i(c, l)) : r(c, t, e));
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
}, [c, s]), null;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useInput as e } from "../../input_provider/useInput.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Li as t, No as n, ns as r } from "../../../../node_modules/.pnpm/lexical@0.38.2/node_modules/lexical/Lexical.prod.js";
|
|
3
|
+
import { o as i } from "../../../../node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalComposerContext.prod.js";
|
|
4
4
|
import a from "../../../../node_modules/.pnpm/@rooks_use-localstorage-state@4.11.2_react@18.3.1/node_modules/@rooks/use-localstorage-state/lib/index.esm.js";
|
|
5
5
|
import { useEffect as o } from "react";
|
|
6
6
|
//#region src/components/input/text_editor/plugins/ResetPlugin.jsx
|
|
7
7
|
var s = ({ storageUid: s }) => {
|
|
8
|
-
let [c] =
|
|
8
|
+
let [c] = i(), { reset: l, setReset: u } = e(), [d, f, p] = a(`TextEditor:content_${s}`, {});
|
|
9
9
|
return o(() => {
|
|
10
10
|
l && c.update(() => {
|
|
11
|
-
|
|
12
|
-
let e =
|
|
13
|
-
e.clear(), e.append(
|
|
11
|
+
r("skip-dom-selection");
|
|
12
|
+
let e = n(), i = t();
|
|
13
|
+
e.clear(), e.append(i), p(), u(!1);
|
|
14
14
|
});
|
|
15
15
|
}, [l]), null;
|
|
16
16
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useInput as e } from "../../input_provider/useInput.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Li as t, No as n, sr as r } from "../../../../node_modules/.pnpm/lexical@0.38.2/node_modules/lexical/Lexical.prod.js";
|
|
3
|
+
import { o as i } from "../../../../node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalComposerContext.prod.js";
|
|
4
4
|
import { useEffect as a } from "react";
|
|
5
5
|
//#region src/components/input/text_editor/plugins/SetContentPlugin.jsx
|
|
6
6
|
var o = () => {
|
|
7
|
-
let [o] =
|
|
7
|
+
let [o] = i(), { inputContent: s, setInputContent: c } = e();
|
|
8
8
|
return a(() => {
|
|
9
9
|
s && o.update(() => {
|
|
10
|
-
let e =
|
|
10
|
+
let e = n();
|
|
11
11
|
e.clear();
|
|
12
|
-
let
|
|
13
|
-
|
|
12
|
+
let i = t();
|
|
13
|
+
i.append(r(s)), e.append(i), c(null);
|
|
14
14
|
});
|
|
15
15
|
}, [s]), null;
|
|
16
16
|
};
|
|
@@ -4,42 +4,42 @@ import { Icon as n } from "../../../icons/icon/Icon.js";
|
|
|
4
4
|
import { require_classnames as r } from "../../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js";
|
|
5
5
|
import { Button as i } from "../../../action/button/Button.js";
|
|
6
6
|
import a from "../../../../node_modules/.pnpm/react-intl@7.1.14_react@18.3.1_typescript@5.9.3/node_modules/react-intl/lib/src/components/useIntl.js";
|
|
7
|
-
import { o } from "../../../../node_modules/.pnpm
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
7
|
+
import { Lr as o, _e as s, ie as c, yr as l } from "../../../../node_modules/.pnpm/lexical@0.38.2/node_modules/lexical/Lexical.prod.js";
|
|
8
|
+
import { W as u } from "../../../../node_modules/.pnpm/@lexical_selection@0.38.2/node_modules/@lexical/selection/LexicalSelection.prod.js";
|
|
9
|
+
import { U as d, wt as f } from "../../../../node_modules/.pnpm/@lexical_utils@0.38.2/node_modules/@lexical/utils/LexicalUtils.prod.js";
|
|
10
|
+
import { dt as p, lt as m, xt as h } from "../../../../node_modules/.pnpm/@lexical_list@0.38.2/node_modules/@lexical/list/LexicalList.prod.js";
|
|
11
|
+
import { o as g } from "../../../../node_modules/.pnpm/@lexical_react@0.38.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.30/node_modules/@lexical/react/LexicalComposerContext.prod.js";
|
|
12
|
+
import { It as _, _t as v } from "../../../../node_modules/.pnpm/@lexical_rich-text@0.38.2/node_modules/@lexical/rich-text/LexicalRichText.prod.js";
|
|
13
13
|
import y from "./ToolbarPlugin.module.js";
|
|
14
14
|
import { useCallback as b, useEffect as x, useRef as S, useState as C } from "react";
|
|
15
15
|
//#region src/components/input/text_editor/plugins/ToolbarPlugin.jsx
|
|
16
16
|
var w = /* @__PURE__ */ e(r()), T = t(), E = (e) => {
|
|
17
|
-
let t = a(), [r] =
|
|
18
|
-
let e =
|
|
19
|
-
if (
|
|
17
|
+
let t = a(), [r] = g(), E = S(null), [D, O] = C("paragraph"), [k, A] = C(null), [j, M] = C(!1), [N, P] = C(!1), [F, I] = C(!1), L = e.hideSubmit && e.hideSourceAction && e.disableRichText, R = b(() => {
|
|
18
|
+
let e = o();
|
|
19
|
+
if (l(e)) {
|
|
20
20
|
let t = e.anchor.getNode(), n = t.getKey() === "root" ? t : t.getTopLevelElementOrThrow(), i = n.getKey();
|
|
21
|
-
if (r.getElementByKey(i) !== null) if (A(i),
|
|
22
|
-
let e =
|
|
21
|
+
if (r.getElementByKey(i) !== null) if (A(i), p(n)) {
|
|
22
|
+
let e = f(t, m);
|
|
23
23
|
O(e ? e.getTag() : n.getTag());
|
|
24
|
-
} else O(
|
|
24
|
+
} else O(_(n) ? n.getTag() : n.getType());
|
|
25
25
|
M(e.hasFormat("bold")), P(e.hasFormat("italic")), I(e.hasFormat("underline"));
|
|
26
26
|
}
|
|
27
27
|
}, [r]);
|
|
28
|
-
x(() =>
|
|
28
|
+
x(() => d(r.registerUpdateListener(({ editorState: e }) => {
|
|
29
29
|
e.read(() => {
|
|
30
30
|
R();
|
|
31
31
|
});
|
|
32
|
-
}), r.registerCommand(
|
|
32
|
+
}), r.registerCommand(c, (e, t) => (R(), !1), 1)), [r, R]);
|
|
33
33
|
let z = () => {
|
|
34
34
|
r.update(() => {
|
|
35
|
-
let e =
|
|
36
|
-
|
|
35
|
+
let e = o();
|
|
36
|
+
l(e) && u(e, () => $createParagraphNode());
|
|
37
37
|
});
|
|
38
38
|
}, B = () => {
|
|
39
|
-
D === "number" ? z(r) : r.dispatchCommand(
|
|
39
|
+
D === "number" ? z(r) : r.dispatchCommand(h);
|
|
40
40
|
}, V = () => {
|
|
41
41
|
D !== "quote" && r.update(() => {
|
|
42
|
-
|
|
42
|
+
u(o(), () => v());
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
return L ? null : /* @__PURE__ */ (0, T.jsxs)("div", {
|
|
@@ -50,7 +50,7 @@ var w = /* @__PURE__ */ e(r()), T = t(), E = (e) => {
|
|
|
50
50
|
children: [
|
|
51
51
|
/* @__PURE__ */ (0, T.jsx)("button", {
|
|
52
52
|
onClick: () => {
|
|
53
|
-
r.dispatchCommand(
|
|
53
|
+
r.dispatchCommand(s, "bold");
|
|
54
54
|
},
|
|
55
55
|
type: "button",
|
|
56
56
|
className: (0, w.default)(y.toolbarItem, { [y.active]: j }),
|
|
@@ -68,7 +68,7 @@ var w = /* @__PURE__ */ e(r()), T = t(), E = (e) => {
|
|
|
68
68
|
}),
|
|
69
69
|
/* @__PURE__ */ (0, T.jsx)("button", {
|
|
70
70
|
onClick: () => {
|
|
71
|
-
r.dispatchCommand(
|
|
71
|
+
r.dispatchCommand(s, "italic");
|
|
72
72
|
},
|
|
73
73
|
type: "button",
|
|
74
74
|
className: (0, w.default)(y.toolbarItem, { [y.active]: N }),
|
|
@@ -85,7 +85,7 @@ var w = /* @__PURE__ */ e(r()), T = t(), E = (e) => {
|
|
|
85
85
|
}),
|
|
86
86
|
/* @__PURE__ */ (0, T.jsx)("button", {
|
|
87
87
|
onClick: () => {
|
|
88
|
-
r.dispatchCommand(
|
|
88
|
+
r.dispatchCommand(s, "underline");
|
|
89
89
|
},
|
|
90
90
|
type: "button",
|
|
91
91
|
className: (0, w.default)(y.toolbarItem, { [y.active]: F }),
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { require_jsx_runtime as e } from "../../../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
|
|
2
2
|
import t from "../../../node_modules/.pnpm/react-intl@7.1.14_react@18.3.1_typescript@5.9.3/node_modules/react-intl/lib/src/components/provider.js";
|
|
3
3
|
import n from "../../../node_modules/.pnpm/@rooks_use-sessionstorage-state@4.11.2_react@18.3.1/node_modules/@rooks/use-sessionstorage-state/lib/index.esm.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { require_flat as r } from "../../../node_modules/.pnpm/flat@5.0.2/node_modules/flat/index.js";
|
|
5
|
+
import { IntlContext as i } from "./IntlContext.js";
|
|
6
6
|
import { useEffect as a, useState as o } from "react";
|
|
7
7
|
//#region src/components/intl/intl_provider/IntlProvider.jsx
|
|
8
|
-
var s =
|
|
8
|
+
var s = r(), c = e(), l = ({ language: e, locales: r, async: l = !1, customMessages: u = {}, children: d, onError: f }) => {
|
|
9
9
|
let [p, m] = n("logora:locale", null), h = () => {
|
|
10
10
|
if (p) return p;
|
|
11
11
|
if (e) return e;
|
|
12
|
-
}, g = () => !l && _ in
|
|
12
|
+
}, g = () => !l && _ in r ? r[_] : {}, [_, v] = o(h()), [y, b] = o(g());
|
|
13
13
|
a(() => {
|
|
14
|
-
_ && (l && _ in
|
|
14
|
+
_ && (l && _ in r && r[_]().then((e) => {
|
|
15
15
|
b(e?.default || e);
|
|
16
16
|
}).catch(() => b({})), p !== _ && m(_));
|
|
17
17
|
}, [_]);
|
|
@@ -24,7 +24,7 @@ var s = i(), c = e(), l = ({ language: e, locales: i, async: l = !1, customMessa
|
|
|
24
24
|
locale: _,
|
|
25
25
|
messages: x((0, s.flatten)(y)),
|
|
26
26
|
onError: f,
|
|
27
|
-
children: /* @__PURE__ */ (0, c.jsx)(
|
|
27
|
+
children: /* @__PURE__ */ (0, c.jsx)(i.Provider, {
|
|
28
28
|
value: {
|
|
29
29
|
locale: _,
|
|
30
30
|
setLocale: v
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { __toESM as e } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { require_jsx_runtime as t } from "../../../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
|
|
3
3
|
import { require_classnames as n } from "../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js";
|
|
4
|
-
import { useDataProvider as
|
|
5
|
-
import { useData as
|
|
6
|
-
import
|
|
7
|
-
import { useList as ne } from "../list_provider/useList.js";
|
|
4
|
+
import { useDataProvider as ee } from "../../data/data_provider/useDataProvider.js";
|
|
5
|
+
import { useData as te } from "../../data/data_provider/useData.js";
|
|
6
|
+
import { StandardErrorBoundary as ne } from "../../error/standard_error_boundary/StandardErrorBoundary.js";
|
|
8
7
|
import { useResponsive as re } from "../../hooks/use_responsive/useResponsive.js";
|
|
9
|
-
import {
|
|
8
|
+
import { useList as ie } from "../list_provider/useList.js";
|
|
10
9
|
import { Pagination as ae } from "../pagination/Pagination.js";
|
|
11
|
-
import { uniqueBy as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
10
|
+
import { uniqueBy as r } from "../../util/unique_by/uniqueBy.js";
|
|
11
|
+
import i from "../../../node_modules/.pnpm/@rooks_use-previous@4.11.2/node_modules/@rooks/use-previous/lib/index.esm.js";
|
|
12
|
+
import a from "../../../node_modules/.pnpm/react-intl@7.1.14_react@18.3.1_typescript@5.9.3/node_modules/react-intl/lib/src/components/useIntl.js";
|
|
14
13
|
import o from "./PaginatedList.module.js";
|
|
14
|
+
import { ActionBar as oe } from "./action_bar/ActionBar.js";
|
|
15
15
|
import se, { useEffect as s, useState as c } from "react";
|
|
16
16
|
import { useLocation as ce } from "react-router";
|
|
17
17
|
//#region src/components/list/paginated_list/PaginatedList.jsx
|
|
18
18
|
var le = /* @__PURE__ */ e(n()), l = t(), u = ({ query: e, sortOptions: t, sort: n, filters: u, tagList: ue, currentPage: d, resource: f, currentListId: p, withToken: m, perPage: h, perPageParam: de = "per_page", pageParam: fe = "page", sortParam: pe = "sort", queryParam: me = "query", tagParam: he = "tag_id", totalHeaderParam: g = "total", onUpdateTotal: _, onElementsLoad: v, transformData: y, uniqueIdKey: b = "id", children: ge, resourcePropName: _e, loadingComponent: x, searchBar: ve = !1, title: ye, emptyListComponent: S, emptyText: be, display: C, elementsPerLine: w, indexLayout: xe = !1, gap: Se = "1em", withPagination: Ce = !0, numberElements: T, countless: we, onElementClick: E, withUrlParams: D = !1, onLoadNewPage: O }) => {
|
|
19
|
-
let k =
|
|
19
|
+
let k = a(), A = ie(), j = ee(), M = ce(), { isMobile: N, isTablet: Te, isDesktop: P } = re(), [F, I] = c(!1), [Ee, De] = c(!1), [L, R] = te(p, []), [z, Oe] = c(L?.length || 0), [B, V] = c(d || 1), [H, U] = c(e || null), [W, G] = c(null), [ke, K] = c(null), q = new URLSearchParams(typeof window < "u" ? window.location.search : M.search), Ae = () => t && t[0].type === "sort" && t[0].value || n || "", je = () => {
|
|
20
20
|
let e = {};
|
|
21
21
|
return t && t[0].type === "filter" && (e[t[0].name] = t[0].value), u && (e = Object.assign({}, e, u)), e;
|
|
22
|
-
}, [J, Y] = c(Ae()), [X, Z] = c(je()), Q =
|
|
22
|
+
}, [J, Y] = c(Ae()), [X, Z] = c(je()), Q = i(u);
|
|
23
23
|
d && d !== B && V(d), e !== void 0 && e !== H && U(e), n !== void 0 && n !== J && Y(n), Q && JSON.stringify(u) !== JSON.stringify(Q) && JSON.stringify(u) !== JSON.stringify(X) && Z(u), s(() => {
|
|
24
24
|
if (q.get("tagId") && G(Number.parseInt(q.get("tagId"))), q.get("search") && U(q.get("search")), q.get("sort")) {
|
|
25
25
|
Y(q.get("sort"));
|
|
@@ -95,20 +95,20 @@ var le = /* @__PURE__ */ e(n()), l = t(), u = ({ query: e, sortOptions: t, sort:
|
|
|
95
95
|
console.error(e), e?.response?.status !== 404 && De(!0), I(!1);
|
|
96
96
|
}) : I(!1);
|
|
97
97
|
}, Pe = (e) => {
|
|
98
|
-
R((t) =>
|
|
98
|
+
R((t) => r([...e, ...t], b || "id")), v && v(e);
|
|
99
99
|
}, Fe = (e) => {
|
|
100
100
|
let t = L;
|
|
101
|
-
e.forEach((e) => t = t.map((t) => t.id === e.id ? e : t)), R(
|
|
101
|
+
e.forEach((e) => t = t.map((t) => t.id === e.id ? e : t)), R(r(t, b || "id"));
|
|
102
102
|
}, Ie = (e) => {
|
|
103
103
|
let t = e.map((e) => e.id);
|
|
104
|
-
R(
|
|
104
|
+
R(r(L.filter((e) => t.indexOf(e.id) === -1), b || "id"));
|
|
105
105
|
}, Le = (e) => {
|
|
106
|
-
R((t) =>
|
|
106
|
+
R((t) => r([...t, ...e], b || "id"));
|
|
107
107
|
}, Re = (e, t) => e === void 0 ? null : /* @__PURE__ */ (0, l.jsx)("li", {
|
|
108
108
|
className: o.paginatedListItem,
|
|
109
109
|
"data-testid": "list-item",
|
|
110
110
|
onClick: E,
|
|
111
|
-
children: /* @__PURE__ */ (0, l.jsx)(
|
|
111
|
+
children: /* @__PURE__ */ (0, l.jsx)(ne, {
|
|
112
112
|
hideMessage: !0,
|
|
113
113
|
children: se.cloneElement(ge, {
|
|
114
114
|
index: t,
|
|
@@ -125,7 +125,7 @@ var le = /* @__PURE__ */ e(n()), l = t(), u = ({ query: e, sortOptions: t, sort:
|
|
|
125
125
|
}));
|
|
126
126
|
return /* @__PURE__ */ (0, l.jsxs)("div", {
|
|
127
127
|
className: o.listContainer,
|
|
128
|
-
children: [/* @__PURE__ */ (0, l.jsx)(
|
|
128
|
+
children: [/* @__PURE__ */ (0, l.jsx)(oe, {
|
|
129
129
|
title: ye,
|
|
130
130
|
sortOptions: t,
|
|
131
131
|
defaultSelectOption: ke,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { require_jsx_runtime as e } from "../../../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { PaginatedList as t } from "./PaginatedList.js";
|
|
3
|
+
import { VoteContext as n, VoteProvider as r } from "../../vote/vote_provider/VoteProvider.js";
|
|
4
4
|
import "react";
|
|
5
5
|
//#region src/components/list/paginated_list/VotePaginatedList.jsx
|
|
6
6
|
var i = e(), a = (e) => {
|
|
7
7
|
let a = (t, n) => {
|
|
8
8
|
e.onElementsLoad && e.onElementsLoad(t), n.addVoteableIds(t.map((t) => e.voteableIdFormat ? e.voteableIdFormat(t) : t.id));
|
|
9
9
|
};
|
|
10
|
-
return /* @__PURE__ */ (0, i.jsx)(
|
|
10
|
+
return /* @__PURE__ */ (0, i.jsx)(r, {
|
|
11
11
|
voteableType: e.voteableType,
|
|
12
|
-
children: /* @__PURE__ */ (0, i.jsx)(
|
|
12
|
+
children: /* @__PURE__ */ (0, i.jsx)(n.Consumer, { children: (n) => /* @__PURE__ */ (0, i.jsx)(t, {
|
|
13
13
|
...e,
|
|
14
|
-
...
|
|
15
|
-
onElementsLoad: (e) => a(e,
|
|
14
|
+
...n,
|
|
15
|
+
onElementsLoad: (e) => a(e, n)
|
|
16
16
|
}) })
|
|
17
17
|
});
|
|
18
18
|
};
|
|
@@ -2,17 +2,17 @@ import { __toESM as e } from "../../../../_virtual/_rolldown/runtime.js";
|
|
|
2
2
|
import { require_jsx_runtime as t } from "../../../../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
|
|
3
3
|
import { Icon as n } from "../../../icons/icon/Icon.js";
|
|
4
4
|
import { require_classnames as r } from "../../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js";
|
|
5
|
-
import i from "
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { useResponsive as i } from "../../../hooks/use_responsive/useResponsive.js";
|
|
6
|
+
import a from "../../../../node_modules/.pnpm/react-intl@7.1.14_react@18.3.1_typescript@5.9.3/node_modules/react-intl/lib/src/components/useIntl.js";
|
|
7
|
+
import { SearchInput as o } from "../../../input/search_input/SearchInput.js";
|
|
8
|
+
import { Select as s } from "../../../input/select/Select.js";
|
|
9
9
|
import { Tag as c } from "../../../tag/tag/Tag.js";
|
|
10
10
|
import l from "./ActionBar.module.js";
|
|
11
11
|
import { useState as u } from "react";
|
|
12
12
|
import { useLocation as d } from "react-router";
|
|
13
13
|
//#region src/components/list/paginated_list/action_bar/ActionBar.jsx
|
|
14
14
|
var f = /* @__PURE__ */ e(r()), p = t(), m = ({ title: e, sortOptions: t, defaultSelectOption: r, searchBar: m = !1, tagList: h, activeTagId: g, withUrlParams: _ = !1, onSearch: v, onSortChange: y, onTagChange: b }) => {
|
|
15
|
-
let x =
|
|
15
|
+
let x = a(), S = d(), { isMobile: C } = i(), [w, T] = u(!1), E = new URLSearchParams(typeof window < "u" ? window.location.search : S.search), D = (e) => {
|
|
16
16
|
if (_) {
|
|
17
17
|
for (let e of E.keys()) t.map((t) => {
|
|
18
18
|
t.name === e && E.delete(e);
|
|
@@ -49,7 +49,7 @@ var f = /* @__PURE__ */ e(r()), p = t(), m = ({ title: e, sortOptions: t, defaul
|
|
|
49
49
|
className: (0, f.default)(l.rightBar, { [l.rightBarOneItem]: !m || !t }),
|
|
50
50
|
children: [m ? /* @__PURE__ */ (0, p.jsx)("div", {
|
|
51
51
|
className: l.search,
|
|
52
|
-
children: /* @__PURE__ */ (0, p.jsx)(
|
|
52
|
+
children: /* @__PURE__ */ (0, p.jsx)(o, {
|
|
53
53
|
onSearchSubmit: k,
|
|
54
54
|
placeholder: x.formatMessage({
|
|
55
55
|
id: "info.search_mobile",
|
|
@@ -57,7 +57,7 @@ var f = /* @__PURE__ */ e(r()), p = t(), m = ({ title: e, sortOptions: t, defaul
|
|
|
57
57
|
}),
|
|
58
58
|
reducedByDefault: !1
|
|
59
59
|
})
|
|
60
|
-
}) : null, t ? /* @__PURE__ */ (0, p.jsx)(
|
|
60
|
+
}) : null, t ? /* @__PURE__ */ (0, p.jsx)(s, {
|
|
61
61
|
onChange: D,
|
|
62
62
|
options: t,
|
|
63
63
|
defaultOption: r,
|
|
@@ -2,13 +2,13 @@ import { __toESM as e } from "../../../_virtual/_rolldown/runtime.js";
|
|
|
2
2
|
import { require_jsx_runtime as t } from "../../../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
|
|
3
3
|
import { Icon as n } from "../../icons/icon/Icon.js";
|
|
4
4
|
import { require_classnames as r } from "../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useResponsive as i } from "../../hooks/use_responsive/useResponsive.js";
|
|
6
|
+
import { useModal as a } from "../../dialog/modal/useModal.js";
|
|
7
7
|
import { NavbarModal as o } from "../navbar_modal/NavbarModal.js";
|
|
8
8
|
import s from "./NavbarButton.module.js";
|
|
9
9
|
//#region src/components/navbar/navbar_button/NavbarButton.jsx
|
|
10
10
|
var c = /* @__PURE__ */ e(r()), l = t(), u = ({ inDrawer: e = !1, showNavbarButtonInDrawer: t = !0 }) => {
|
|
11
|
-
let r =
|
|
11
|
+
let r = a?.(), { isMobile: u, elementWidth: d } = i?.() || {}, f = () => {
|
|
12
12
|
r?.showModal?.(/* @__PURE__ */ (0, l.jsx)(o, {}));
|
|
13
13
|
};
|
|
14
14
|
return e && !t || !e && !(u && d <= 576) ? null : /* @__PURE__ */ (0, l.jsx)("div", {
|
|
@@ -6,19 +6,19 @@ import { require_classnames as i } from "../../../node_modules/.pnpm/classnames@
|
|
|
6
6
|
import { useAuth as a } from "../../auth/use_auth/useAuth.js";
|
|
7
7
|
import { useConfig as o } from "../../data/config_provider/useConfig.js";
|
|
8
8
|
import { useRoutes as s } from "../../data/config_provider/useRoutes.js";
|
|
9
|
-
import c from "
|
|
10
|
-
import
|
|
9
|
+
import { useResponsive as c } from "../../hooks/use_responsive/useResponsive.js";
|
|
10
|
+
import l from "../../../node_modules/.pnpm/react-intl@7.1.14_react@18.3.1_typescript@5.9.3/node_modules/react-intl/lib/src/components/message.js";
|
|
11
11
|
import { useModal as u } from "../../dialog/modal/useModal.js";
|
|
12
12
|
import { Modal as d } from "../../dialog/modal/Modal.js";
|
|
13
13
|
import { useAuthRequired as f } from "../../hooks/use_auth_required/useAuthRequired.js";
|
|
14
|
-
import {
|
|
14
|
+
import { Avatar as p } from "../../user/avatar/Avatar.js";
|
|
15
15
|
import m from "./NavbarModal.module.js";
|
|
16
16
|
import "react";
|
|
17
17
|
import { matchPath as h } from "react-router-dom";
|
|
18
18
|
import { useLocation as g } from "react-router";
|
|
19
19
|
//#region src/components/navbar/navbar_modal/NavbarModal.jsx
|
|
20
20
|
var _ = /* @__PURE__ */ e(i()), v = t(), y = () => {
|
|
21
|
-
let { hideModal: e } = u(), t = o(), i = s(), { pathname: y } = g(), { isLoggedIn: b, currentUser: x } = a(), S = f(), { isMobile: C, elementWidth: w } =
|
|
21
|
+
let { hideModal: e } = u(), t = o(), i = s(), { pathname: y } = g(), { isLoggedIn: b, currentUser: x } = a(), S = f(), { isMobile: C, elementWidth: w } = c?.() || {}, T = C && w <= 576 && !t.isDrawer, E = (e) => !!h(e, y), D = () => {
|
|
22
22
|
S({});
|
|
23
23
|
};
|
|
24
24
|
return /* @__PURE__ */ (0, v.jsxs)(d, {
|
|
@@ -28,7 +28,7 @@ var _ = /* @__PURE__ */ e(i()), v = t(), y = () => {
|
|
|
28
28
|
className: m.modalContainer,
|
|
29
29
|
children: [/* @__PURE__ */ (0, v.jsx)("div", {
|
|
30
30
|
className: m.modalTitle,
|
|
31
|
-
children: /* @__PURE__ */ (0, v.jsx)(
|
|
31
|
+
children: /* @__PURE__ */ (0, v.jsx)(l, {
|
|
32
32
|
id: "info.menu",
|
|
33
33
|
defaultMessage: "Navigation"
|
|
34
34
|
})
|
|
@@ -48,7 +48,7 @@ var _ = /* @__PURE__ */ e(i()), v = t(), y = () => {
|
|
|
48
48
|
width: 24
|
|
49
49
|
}), /* @__PURE__ */ (0, v.jsx)("span", {
|
|
50
50
|
className: m.text,
|
|
51
|
-
children: /* @__PURE__ */ (0, v.jsx)(
|
|
51
|
+
children: /* @__PURE__ */ (0, v.jsx)(l, {
|
|
52
52
|
id: "info.all_debates_short",
|
|
53
53
|
defaultMessage: "Debates"
|
|
54
54
|
})
|
|
@@ -68,7 +68,7 @@ var _ = /* @__PURE__ */ e(i()), v = t(), y = () => {
|
|
|
68
68
|
width: 24
|
|
69
69
|
}), /* @__PURE__ */ (0, v.jsx)("span", {
|
|
70
70
|
className: (0, _.default)(m.text, m.consultationText),
|
|
71
|
-
children: /* @__PURE__ */ (0, v.jsx)(
|
|
71
|
+
children: /* @__PURE__ */ (0, v.jsx)(l, {
|
|
72
72
|
id: "info.consultations",
|
|
73
73
|
defaultMessage: "Consultations"
|
|
74
74
|
})
|
|
@@ -88,7 +88,7 @@ var _ = /* @__PURE__ */ e(i()), v = t(), y = () => {
|
|
|
88
88
|
width: 24
|
|
89
89
|
}), /* @__PURE__ */ (0, v.jsx)("span", {
|
|
90
90
|
className: m.text,
|
|
91
|
-
children: /* @__PURE__ */ (0, v.jsx)(
|
|
91
|
+
children: /* @__PURE__ */ (0, v.jsx)(l, {
|
|
92
92
|
id: "info.suggestion",
|
|
93
93
|
defaultMessage: "Suggestions"
|
|
94
94
|
})
|
|
@@ -105,14 +105,14 @@ var _ = /* @__PURE__ */ e(i()), v = t(), y = () => {
|
|
|
105
105
|
children: /* @__PURE__ */ (0, v.jsxs)("div", {
|
|
106
106
|
"data-tid": "view_user_profile",
|
|
107
107
|
className: m.profile,
|
|
108
|
-
children: [/* @__PURE__ */ (0, v.jsx)(
|
|
108
|
+
children: [/* @__PURE__ */ (0, v.jsx)(p, {
|
|
109
109
|
avatarUrl: x.image_url,
|
|
110
110
|
userName: x.full_name,
|
|
111
111
|
size: 24,
|
|
112
112
|
"data-tid": "view_user_profile"
|
|
113
113
|
}), /* @__PURE__ */ (0, v.jsx)("span", {
|
|
114
114
|
className: m.text,
|
|
115
|
-
children: /* @__PURE__ */ (0, v.jsx)(
|
|
115
|
+
children: /* @__PURE__ */ (0, v.jsx)(l, {
|
|
116
116
|
id: "info.profile",
|
|
117
117
|
defaultMessage: "Profile"
|
|
118
118
|
})
|
|
@@ -133,7 +133,7 @@ var _ = /* @__PURE__ */ e(i()), v = t(), y = () => {
|
|
|
133
133
|
width: 24
|
|
134
134
|
}), /* @__PURE__ */ (0, v.jsx)("span", {
|
|
135
135
|
className: m.text,
|
|
136
|
-
children: /* @__PURE__ */ (0, v.jsx)(
|
|
136
|
+
children: /* @__PURE__ */ (0, v.jsx)(l, {
|
|
137
137
|
id: "action.sign_in",
|
|
138
138
|
defaultMessage: "Sign in"
|
|
139
139
|
})
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { require_jsx_runtime as e } from "../../../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
|
|
2
2
|
import { useDataProvider as t } from "../../data/data_provider/useDataProvider.js";
|
|
3
3
|
import n from "../../../node_modules/.pnpm/react-intl@7.1.14_react@18.3.1_typescript@5.9.3/node_modules/react-intl/lib/src/components/useIntl.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { PaginatedList as r } from "../../list/paginated_list/PaginatedList.js";
|
|
5
|
+
import { UserContentSkeleton as i } from "../../skeleton/user_content_skeleton/UserContentSkeleton.js";
|
|
6
6
|
import { NotificationItem as a } from "../notification_item/NotificationItem.js";
|
|
7
7
|
import o from "./NotificationMenu.module.js";
|
|
8
8
|
import { useState as s } from "react";
|
|
@@ -32,9 +32,9 @@ var c = e(), l = ({ notificationDefinitions: e = {} }) => {
|
|
|
32
32
|
})]
|
|
33
33
|
}), /* @__PURE__ */ (0, c.jsx)("div", {
|
|
34
34
|
className: o.notificationList,
|
|
35
|
-
children: /* @__PURE__ */ (0, c.jsx)(
|
|
35
|
+
children: /* @__PURE__ */ (0, c.jsx)(r, {
|
|
36
36
|
currentListId: "notificationList",
|
|
37
|
-
loadingComponent: /* @__PURE__ */ (0, c.jsx)(
|
|
37
|
+
loadingComponent: /* @__PURE__ */ (0, c.jsx)(i, { numberLines: 0 }),
|
|
38
38
|
resourcePropName: "notification",
|
|
39
39
|
resource: "notifications",
|
|
40
40
|
sort: "-created_at",
|
|
@@ -4,19 +4,19 @@ import { require_classnames as n } from "../../../node_modules/.pnpm/classnames@
|
|
|
4
4
|
import { useAuth as r } from "../../auth/use_auth/useAuth.js";
|
|
5
5
|
import { useConfig as i } from "../../data/config_provider/useConfig.js";
|
|
6
6
|
import a from "../../../node_modules/.pnpm/react-intl@7.1.14_react@18.3.1_typescript@5.9.3/node_modules/react-intl/lib/src/components/useIntl.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { ReadMore as o } from "../../text/read_more/ReadMore.js";
|
|
8
|
+
import { HashScroll as s } from "../../tools/hash_scroll/HashScroll.js";
|
|
9
|
+
import { useTranslatedContent as c } from "../../translation/translated_content/useTranslatedContent.js";
|
|
10
10
|
import { TranslationButton as l } from "../../translation/translation_button/TranslationButton.js";
|
|
11
11
|
import { ContentFooter as u } from "../../user_content/content_footer/ContentFooter.js";
|
|
12
|
-
import {
|
|
12
|
+
import { ContentHeader as d } from "../../user_content/content_header/ContentHeader.js";
|
|
13
13
|
import { lexicalToHtml as f } from "../../input/text_editor/lexicalToHtml.js";
|
|
14
14
|
import { UpDownVoteBox as p } from "../../vote/up_down_vote_box/UpDownVoteBox.js";
|
|
15
15
|
import m from "./ProposalBox.module.js";
|
|
16
16
|
import { useEffect as h, useState as g } from "react";
|
|
17
17
|
//#region src/components/proposal/proposal_box/ProposalBox.jsx
|
|
18
18
|
var _ = /* @__PURE__ */ e(n()), v = t(), y = ({ proposal: e, disabled: t = !1, fixedContentHeight: n, contentMaxHeight: y = 156, enableEdition: b = !0, hideFooter: x = !1 }) => {
|
|
19
|
-
let [S, C] = g(null), [w, T] = g(!1), E = a(), D = i(), { currentUser: O } = r(), k = O?.moderation_status === "banned", A = `proposal_${e.id}`, j =
|
|
19
|
+
let [S, C] = g(null), [w, T] = g(!1), E = a(), D = i(), { currentUser: O } = r(), k = O?.moderation_status === "banned", A = `proposal_${e.id}`, j = c(e.title, e.language, "title", e.translation_entries), M = c(e.content, e.language, "content", e.translation_entries);
|
|
20
20
|
h(() => {
|
|
21
21
|
if (e.rich_content) {
|
|
22
22
|
let t = JSON.parse(e.rich_content);
|
|
@@ -26,14 +26,14 @@ var _ = /* @__PURE__ */ e(n()), v = t(), y = ({ proposal: e, disabled: t = !1, f
|
|
|
26
26
|
let N = () => {
|
|
27
27
|
j.toggleContent(), M.toggleContent();
|
|
28
28
|
};
|
|
29
|
-
return /* @__PURE__ */ (0, v.jsx)(
|
|
29
|
+
return /* @__PURE__ */ (0, v.jsx)(s, {
|
|
30
30
|
elementId: A,
|
|
31
31
|
onScroll: () => T(!0),
|
|
32
32
|
children: /* @__PURE__ */ (0, v.jsxs)("div", {
|
|
33
33
|
className: (0, _.default)(m.proposalBoxContainer, { [m.flash]: w }),
|
|
34
34
|
id: A,
|
|
35
35
|
children: [
|
|
36
|
-
/* @__PURE__ */ (0, v.jsx)(
|
|
36
|
+
/* @__PURE__ */ (0, v.jsx)(d, {
|
|
37
37
|
author: e.author,
|
|
38
38
|
tag: e.tag?.display_name,
|
|
39
39
|
date: e.created_at,
|
|
@@ -41,7 +41,7 @@ var _ = /* @__PURE__ */ e(n()), v = t(), y = ({ proposal: e, disabled: t = !1, f
|
|
|
41
41
|
}),
|
|
42
42
|
/* @__PURE__ */ (0, v.jsx)("div", {
|
|
43
43
|
className: (0, _.default)(m.proposalBoxContent, { [m.fixedHeight]: n }),
|
|
44
|
-
children: /* @__PURE__ */ (0, v.jsx)("div", { children: /* @__PURE__ */ (0, v.jsx)(
|
|
44
|
+
children: /* @__PURE__ */ (0, v.jsx)("div", { children: /* @__PURE__ */ (0, v.jsx)(o, {
|
|
45
45
|
content: /* @__PURE__ */ (0, v.jsxs)(v.Fragment, { children: [
|
|
46
46
|
e.is_edited && /* @__PURE__ */ (0, v.jsx)("div", {
|
|
47
47
|
className: m.edited,
|