@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
|
@@ -4,18 +4,18 @@ import { Link as n } from "../../action/link/Link.js";
|
|
|
4
4
|
import { Icon as r } from "../../icons/icon/Icon.js";
|
|
5
5
|
import { require_classnames as i } from "../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.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/message.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { ReadMore as o } from "../../text/read_more/ReadMore.js";
|
|
8
|
+
import { useTranslatedContent as s } from "../../translation/translated_content/useTranslatedContent.js";
|
|
9
|
+
import { ContentHeader as c } from "../content_header/ContentHeader.js";
|
|
10
10
|
import l from "./SummaryContentBox.module.js";
|
|
11
11
|
import "react";
|
|
12
12
|
//#region src/components/user_content/summary_content_box/SummaryContentBox.jsx
|
|
13
13
|
var u = /* @__PURE__ */ e(i()), d = t(), f = ({ author: e, tag: t, date: i, title: f = "", content: p, link: m, contentCount: h = 0, tagClassName: g, headerOneLine: _ = !1, showFooter: v = !1, language: y, lineCount: b, translationEntries: x = [] }) => {
|
|
14
|
-
let S =
|
|
14
|
+
let S = s(f, y, "title", x), C = s(p, y, "content", x);
|
|
15
15
|
return /* @__PURE__ */ (0, d.jsx)("div", {
|
|
16
16
|
className: l.contentBox,
|
|
17
17
|
children: /* @__PURE__ */ (0, d.jsxs)(d.Fragment, { children: [
|
|
18
|
-
/* @__PURE__ */ (0, d.jsx)(
|
|
18
|
+
/* @__PURE__ */ (0, d.jsx)(c, {
|
|
19
19
|
author: e,
|
|
20
20
|
tag: t,
|
|
21
21
|
tagClassName: g,
|
|
@@ -27,7 +27,7 @@ var u = /* @__PURE__ */ e(i()), d = t(), f = ({ author: e, tag: t, date: i, titl
|
|
|
27
27
|
children: [f && /* @__PURE__ */ (0, d.jsx)("div", {
|
|
28
28
|
className: l.title,
|
|
29
29
|
children: S.translatedContent
|
|
30
|
-
}), /* @__PURE__ */ (0, d.jsx)(
|
|
30
|
+
}), /* @__PURE__ */ (0, d.jsx)(o, {
|
|
31
31
|
content: C.translatedContent,
|
|
32
32
|
charCount: b ? void 0 : 200,
|
|
33
33
|
lineCount: b ?? void 0,
|
|
@@ -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 { useAuth as t } from "../../auth/use_auth/useAuth.js";
|
|
3
3
|
import { useDataProvider as n } from "../../data/data_provider/useDataProvider.js";
|
|
4
|
-
import r from "
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { useList as r } from "../../list/list_provider/useList.js";
|
|
5
|
+
import i 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";
|
|
6
|
+
import { useModal as a } from "../../dialog/modal/useModal.js";
|
|
7
|
+
import { ConfirmModal as o } from "../../dialog/confirm_modal/ConfirmModal.js";
|
|
8
8
|
import { useToast as s } from "../../dialog/toast_provider/useToast.js";
|
|
9
|
-
import {
|
|
9
|
+
import { useAuthRequired as c } from "../../hooks/use_auth_required/useAuthRequired.js";
|
|
10
10
|
import "react";
|
|
11
11
|
//#region src/components/user_content/use_delete_content/useDeleteContent.jsx
|
|
12
12
|
var l = e(), u = (e, u, d, f = !1, p, m, h) => {
|
|
13
|
-
let { showModal: g } =
|
|
14
|
-
_ ? g(/* @__PURE__ */ (0, l.jsx)(
|
|
13
|
+
let { showModal: g } = a(), { isLoggedIn: _ } = t(), v = i(), y = r(), b = n(), { toast: x } = s() || {}, S = c(), C = () => {
|
|
14
|
+
_ ? g(/* @__PURE__ */ (0, l.jsx)(o, {
|
|
15
15
|
title: p || v.formatMessage({
|
|
16
16
|
id: "info.delete_content_title",
|
|
17
17
|
defaultMessage: "Delete content"
|
|
@@ -4,17 +4,17 @@ import { require_classnames as n } from "../../../node_modules/.pnpm/classnames@
|
|
|
4
4
|
import { Button as r } from "../../action/button/Button.js";
|
|
5
5
|
import { useAuth as i } from "../../auth/use_auth/useAuth.js";
|
|
6
6
|
import { useDataProvider as a } from "../../data/data_provider/useDataProvider.js";
|
|
7
|
-
import o from "
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
7
|
+
import { Loader as o } from "../../progress/loader/Loader.js";
|
|
8
|
+
import s 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";
|
|
9
|
+
import { Select as c } from "../../input/select/Select.js";
|
|
10
|
+
import { useModal as l } from "../../dialog/modal/useModal.js";
|
|
11
|
+
import { Modal as u } from "../../dialog/modal/Modal.js";
|
|
12
12
|
import d from "./ReportModal.module.js";
|
|
13
13
|
import { useState as f } from "react";
|
|
14
14
|
//#region src/components/user_content/use_report_content/ReportModal.jsx
|
|
15
15
|
var p = /* @__PURE__ */ e(n()), m = t(), h = (e) => {
|
|
16
|
-
let [t, n] = f("SUBMIT"), [h, g] = f(""), [_, v] = f(""), [y, b] = f(""), [x, S] = f(""), [C, w] = f(""), [T, E] = f(!1), { hideModal: D } =
|
|
17
|
-
return /* @__PURE__ */ (0, m.jsx)("div", { children: /* @__PURE__ */ (0, m.jsx)(
|
|
16
|
+
let [t, n] = f("SUBMIT"), [h, g] = f(""), [_, v] = f(""), [y, b] = f(""), [x, S] = f(""), [C, w] = f(""), [T, E] = f(!1), { hideModal: D } = l(), { isLoggedIn: O, currentUser: k } = i(), A = s(), j = a();
|
|
17
|
+
return /* @__PURE__ */ (0, m.jsx)("div", { children: /* @__PURE__ */ (0, m.jsx)(u, {
|
|
18
18
|
"data-vid": "report_modal",
|
|
19
19
|
title: e.title || A.formatMessage({
|
|
20
20
|
id: "report.report_modal.title",
|
|
@@ -52,7 +52,7 @@ var p = /* @__PURE__ */ e(n()), m = t(), h = (e) => {
|
|
|
52
52
|
id: "report.report_modal.type_input_label",
|
|
53
53
|
defaultMessage: "Report type"
|
|
54
54
|
})
|
|
55
|
-
}), /* @__PURE__ */ (0, m.jsx)(
|
|
55
|
+
}), /* @__PURE__ */ (0, m.jsx)(c, {
|
|
56
56
|
onChange: (e) => v(e.value),
|
|
57
57
|
options: [
|
|
58
58
|
{
|
|
@@ -241,7 +241,7 @@ var p = /* @__PURE__ */ e(n()), m = t(), h = (e) => {
|
|
|
241
241
|
})
|
|
242
242
|
]
|
|
243
243
|
}),
|
|
244
|
-
LOADING: /* @__PURE__ */ (0, m.jsx)(
|
|
244
|
+
LOADING: /* @__PURE__ */ (0, m.jsx)(o, {}),
|
|
245
245
|
SUCCESS: /* @__PURE__ */ (0, m.jsxs)("div", { children: [/* @__PURE__ */ (0, m.jsx)("div", {
|
|
246
246
|
className: d.successText,
|
|
247
247
|
children: A.formatMessage({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useAuth as e } from "../../auth/use_auth/useAuth.js";
|
|
2
2
|
import { useDataProvider as t } from "../../data/data_provider/useDataProvider.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { VoteContext as n } from "../vote_provider/VoteProvider.js";
|
|
4
|
+
import { useAuthRequired as r } from "../../hooks/use_auth_required/useAuthRequired.js";
|
|
5
5
|
import { useContext as i, useEffect as a, useState as o } from "react";
|
|
6
6
|
//#region src/components/vote/use_vote/useVote.jsx
|
|
7
7
|
var s = (s, c, l, u, d = null) => {
|
|
8
|
-
let { votes: f } = i(
|
|
8
|
+
let { votes: f } = i(n), { isLoggedIn: p } = e(), m = t(), [h, g] = o(!1), [_, v] = o(!0), [y, b] = o(), [x, S] = o(l), [C, w] = o(u), [T, E] = o(!1), [D, O] = o(!1), k = r();
|
|
9
9
|
a(() => {
|
|
10
10
|
if (!D && p && Object.keys(f).length > 0 && c in f) {
|
|
11
11
|
let e = f[c];
|
|
@@ -7,13 +7,13 @@ import { Button as a } from "../../action/button/Button.js";
|
|
|
7
7
|
import { useAuth as ee } from "../../auth/use_auth/useAuth.js";
|
|
8
8
|
import { useDataProvider as o } from "../../data/data_provider/useDataProvider.js";
|
|
9
9
|
import { useConfig as te } from "../../data/config_provider/useConfig.js";
|
|
10
|
+
import { useResponsive as ne } from "../../hooks/use_responsive/useResponsive.js";
|
|
10
11
|
import s 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";
|
|
11
12
|
import c 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";
|
|
12
13
|
import { useTranslatedContent as l } from "../../translation/translated_content/useTranslatedContent.js";
|
|
13
14
|
import { Tooltip as u } from "../../dialog/tooltip/Tooltip.js";
|
|
14
|
-
import { useAuthRequired as ne } from "../../hooks/use_auth_required/useAuthRequired.js";
|
|
15
15
|
import { useToast as re } from "../../dialog/toast_provider/useToast.js";
|
|
16
|
-
import {
|
|
16
|
+
import { useAuthRequired as ie } from "../../hooks/use_auth_required/useAuthRequired.js";
|
|
17
17
|
import d 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";
|
|
18
18
|
import { ProgressBar as ae } from "../../progress/progress_bar/ProgressBar.js";
|
|
19
19
|
import f from "./VoteBox.module.js";
|
|
@@ -21,13 +21,13 @@ import { useEffect as p, useState as m } from "react";
|
|
|
21
21
|
import { useLocation as oe } from "react-router";
|
|
22
22
|
//#region src/components/vote/vote_box/VoteBox.jsx
|
|
23
23
|
var h = /* @__PURE__ */ e(i()), g = t(), _ = ({ numberVotes: e, votePositions: t, voteableType: i, voteableId: _, redirectUrl: v, displayColumn: y, textAlignLeft: se, showTotal: ce = !0, voteBoxClassName: b, buttonContainerClassName: x, buttonClassName: S, showResultClassName: C, onVote: w, disabled: T = !1, showVotesCommentsNumber: le = !1, commentsCount: ue }) => {
|
|
24
|
-
let [E, D] = m(!0), [O, k] = m(void 0), [A, j] = m(!1), [M, de] = m(parseFloat(e.total) || Object.values(e).reduce((e, t) => e + parseFloat(t), 0) || 0), N = l(t[0]?.name, t[0]?.language, "name", t[0]?.translation_entries), P = l(t[1]?.name, t[1]?.language, "name", t[1]?.translation_entries), F = l(t[2]?.name, t[2]?.language, "name", t[2]?.translation_entries), [I, fe, L] = d("storedUserVote", {}), [pe, R, z] = d("userSide", {}), { toast: B } = re() || {}, { isMobile: V } =
|
|
24
|
+
let [E, D] = m(!0), [O, k] = m(void 0), [A, j] = m(!1), [M, de] = m(Number.parseFloat(e.total) || Object.values(e).reduce((e, t) => e + Number.parseFloat(t), 0) || 0), N = l(t[0]?.name, t[0]?.language, "name", t[0]?.translation_entries), P = l(t[1]?.name, t[1]?.language, "name", t[1]?.translation_entries), F = l(t[2]?.name, t[2]?.language, "name", t[2]?.translation_entries), [I, fe, L] = d("storedUserVote", {}), [pe, R, z] = d("userSide", {}), { toast: B } = re() || {}, { isMobile: V } = ne(), [H, U] = m((() => {
|
|
25
25
|
let n = {};
|
|
26
26
|
return t?.forEach((t) => n[t.id] = {
|
|
27
|
-
count: parseFloat(e[t.id]) || 0,
|
|
27
|
+
count: Number.parseFloat(e[t.id]) || 0,
|
|
28
28
|
percentage: M === 0 ? 0 : Math.round(100 * ((e[t.id] || 0) / M))
|
|
29
29
|
}), n;
|
|
30
|
-
})()), W =
|
|
30
|
+
})()), W = ie(), me = oe(), G = o(), K = te(), q = s(), { isLoggedIn: J, isLoggingIn: Y } = ee();
|
|
31
31
|
p(() => {
|
|
32
32
|
Y === !1 && (J ? ge(_) : D(!1));
|
|
33
33
|
}, [Y, J]), p(() => {
|
|
@@ -41,7 +41,7 @@ var h = /* @__PURE__ */ e(i()), g = t(), _ = ({ numberVotes: e, votePositions: t
|
|
|
41
41
|
let he = () => {
|
|
42
42
|
if (I && Object.keys(I).length !== 0) return I.groupId === _ && I.voteableType === i ? [!0, I.positionId] : (L(), [!1, !1]);
|
|
43
43
|
let e = new URLSearchParams(typeof window < "u" ? window.location.search : me.search);
|
|
44
|
-
return [!!e.get("initVote"), parseInt(e.get("positionId")) || !1];
|
|
44
|
+
return [!!e.get("initVote"), Number.parseInt(e.get("positionId")) || !1];
|
|
45
45
|
}, ge = (e) => {
|
|
46
46
|
D(!0), w && w(O), G.getOneWithToken("votes", `${i.toLowerCase()}/${e}`, {}).then((e) => {
|
|
47
47
|
e.data.data.resource ? (k(e.data.data.resource), j(!0), D(!1)) : (D(!1), j(!1));
|
|
@@ -121,7 +121,7 @@ var h = /* @__PURE__ */ e(i()), g = t(), _ = ({ numberVotes: e, votePositions: t
|
|
|
121
121
|
[f.textAlignLeft]: se,
|
|
122
122
|
[S]: S
|
|
123
123
|
}),
|
|
124
|
-
onClick: r ? (
|
|
124
|
+
onClick: r ? () => Q(e.id) : null,
|
|
125
125
|
disabled: T,
|
|
126
126
|
"data-testid": "voteButton",
|
|
127
127
|
to: r ? null : Z(e.id),
|
package/dist/index.js
CHANGED
|
@@ -22,61 +22,61 @@ import { ConfigContext as S, ConfigProvider as C } from "./components/data/confi
|
|
|
22
22
|
import { useConfig as w } from "./components/data/config_provider/useConfig.js";
|
|
23
23
|
import { useRoutes as T } from "./components/data/config_provider/useRoutes.js";
|
|
24
24
|
import { withConfig as E } from "./components/data/config_provider/withConfig.js";
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
25
|
+
import { AnnouncementDialog as D } from "./components/dialog/announcement_dialog/AnnouncementDialog.js";
|
|
26
|
+
import { ResponsiveProvider as O } from "./components/hooks/use_responsive/ResponsiveProvider.js";
|
|
27
|
+
import { useResponsive as k } from "./components/hooks/use_responsive/useResponsive.js";
|
|
28
|
+
import { ListProvider as A } from "./components/list/list_provider/ListProvider.js";
|
|
29
|
+
import { useList as j } from "./components/list/list_provider/useList.js";
|
|
30
|
+
import { Loader as M } from "./components/progress/loader/Loader.js";
|
|
31
|
+
import { Pagination as N } from "./components/list/pagination/Pagination.js";
|
|
32
|
+
import { uniqueBy as P } from "./components/util/unique_by/uniqueBy.js";
|
|
33
|
+
import { FormContext as F } from "./components/forms/form/form-context.js";
|
|
34
|
+
import { useFormContext as I } from "./components/forms/form/use-form-context.js";
|
|
35
|
+
import { Form as L } from "./components/forms/form/form.js";
|
|
36
|
+
import { useForm as R } from "./components/forms/form/use-form.js";
|
|
37
|
+
import { extractFormData as z } from "./components/forms/form/extract-form-data.js";
|
|
38
|
+
import { classes as B, getAccent as V } from "./components/input/text_input/color-accent.js";
|
|
39
|
+
import { Message as H } from "./components/input/text_input/message.js";
|
|
40
|
+
import { TextInput as U } from "./components/input/text_input/TextInput.js";
|
|
41
|
+
import { SearchInput as W } from "./components/input/search_input/SearchInput.js";
|
|
42
|
+
import { Dropdown as G } from "./components/dialog/dropdown/Dropdown.js";
|
|
43
|
+
import { Select as K } from "./components/input/select/Select.js";
|
|
44
|
+
import { Tag as q } from "./components/tag/tag/Tag.js";
|
|
45
|
+
import { ActionBar as J } from "./components/list/paginated_list/action_bar/ActionBar.js";
|
|
46
|
+
import { PaginatedList as Y } from "./components/list/paginated_list/PaginatedList.js";
|
|
47
|
+
import { VoteContext as X, VoteProvider as Z } from "./components/vote/vote_provider/VoteProvider.js";
|
|
48
|
+
import { VotePaginatedList as Q } from "./components/list/paginated_list/VotePaginatedList.js";
|
|
49
|
+
import { UserContentSkeleton as $ } from "./components/skeleton/user_content_skeleton/UserContentSkeleton.js";
|
|
50
|
+
import { SourceListItem as ee } from "./components/source/source_list_item/SourceListItem.js";
|
|
51
|
+
import { ReadMore as te } from "./components/text/read_more/ReadMore.js";
|
|
52
|
+
import { HashScroll as ne } from "./components/tools/hash_scroll/HashScroll.js";
|
|
53
|
+
import { getTranslatedContent as re, useTranslatedContent as ie } from "./components/translation/translated_content/useTranslatedContent.js";
|
|
54
|
+
import { TranslatedContent as ae } from "./components/translation/translated_content/TranslatedContent.js";
|
|
55
|
+
import { TranslationButton as oe } from "./components/translation/translation_button/TranslationButton.js";
|
|
56
|
+
import { ModalContext as se, ModalProvider as ce } from "./components/dialog/modal/ModalProvider.js";
|
|
57
|
+
import { useModal as le } from "./components/dialog/modal/useModal.js";
|
|
58
|
+
import { Modal as ue } from "./components/dialog/modal/Modal.js";
|
|
59
|
+
import { InputProvider as de } from "./components/input/input_provider/InputProvider.js";
|
|
60
|
+
import { useInput as fe } from "./components/input/input_provider/useInput.js";
|
|
61
|
+
import { Tooltip as pe } from "./components/dialog/tooltip/Tooltip.js";
|
|
62
|
+
import { ShareBox as me } from "./components/share/share_box/ShareBox.js";
|
|
63
|
+
import { ShareButton as he } from "./components/share/share_button/ShareButton.js";
|
|
64
|
+
import { ConfirmModal as ge } from "./components/dialog/confirm_modal/ConfirmModal.js";
|
|
65
|
+
import { Toast as _e } from "./components/dialog/toast/Toast.js";
|
|
66
|
+
import { ToastProvider as ve } from "./components/dialog/toast_provider/ToastProvider.js";
|
|
67
|
+
import { useToast as ye } from "./components/dialog/toast_provider/useToast.js";
|
|
68
|
+
import { useAuthRequired as be } from "./components/hooks/use_auth_required/useAuthRequired.js";
|
|
69
|
+
import { useDeleteContent as xe } from "./components/user_content/use_delete_content/useDeleteContent.js";
|
|
70
|
+
import { useReportContent as Se } from "./components/user_content/use_report_content/useReportContent.js";
|
|
71
|
+
import { ContentFooter as Ce } from "./components/user_content/content_footer/ContentFooter.js";
|
|
72
|
+
import { useRelativeTime as we } from "./components/hooks/use_relative_time/useRelativeTime.js";
|
|
73
|
+
import { Avatar as Te } from "./components/user/avatar/Avatar.js";
|
|
74
|
+
import { LANGUAGES as Ee, getLocaleIcon as De, getLocaleName as Oe } from "./components/util/lang_emojis/langEmojis.js";
|
|
75
|
+
import { AuthorBox as ke } from "./components/user/author_box/AuthorBox.js";
|
|
76
|
+
import { UserBoxSmall as Ae } from "./components/user/user_box_small/UserBoxSmall.js";
|
|
77
|
+
import { ContentHeader as je } from "./components/user_content/content_header/ContentHeader.js";
|
|
78
|
+
import { useVote as Me } from "./components/vote/use_vote/useVote.js";
|
|
79
|
+
import { VoteButton as Ne } from "./components/vote/vote_button/VoteButton.js";
|
|
80
80
|
import { SourceBox as Pe } from "./components/source/source_box/SourceBox.js";
|
|
81
81
|
import { SourceModal as Fe } from "./components/source/source_modal/SourceModal.js";
|
|
82
82
|
import { lexicalToHtml as Ie } from "./components/input/text_editor/lexicalToHtml.js";
|
|
@@ -143,4 +143,4 @@ import { useUpdateUserInfo as Ht } from "./components/user/update_user_info_moda
|
|
|
143
143
|
import { UserBox as Ut } from "./components/user/user_box/UserBox.js";
|
|
144
144
|
import { Location as Wt } from "./components/util/location/Location.js";
|
|
145
145
|
import { VoteBox as Gt } from "./components/vote/vote_box/VoteBox.js";
|
|
146
|
-
export {
|
|
146
|
+
export { J as ActionBar, o as AdUnit, D as AnnouncementDialog, Re as Argument, Pt as ArgumentSummaryBox, u as AuthContext, He as AuthInitializer, d as AuthProvider, ke as AuthorBox, Te as Avatar, Bt as AvatarSelector, r as BackLink, pt as BadgeBox, kt as BoxSkeleton, i as Button, vt as CheckBox, S as ConfigContext, C as ConfigProvider, ge as ConfirmModal, tt as ConsultationBox, Ce as ContentFooter, je as ContentHeader, At as ContextSourceBox, jt as ContextSourceList, rt as Countdown, g as DataProviderContext, nt as DebateBox, it as DialogBox, ct as Drawer, G as Dropdown, y as EMAIL_CONSENT_STORAGE_KEY, lt as EmbedHeader, Rt as ExpandableText, We as FacebookLoginButton, dt as FollowButton, L as Form, F as FormContext, Ge as GoogleLoginButton, ne as HashScroll, n as Icon, e as IconContext, t as IconProvider, a as IconTextLink, qe as Input, de as InputProvider, bt as IntlContext, xt as IntlProvider, Ft as KeywordBox, Ee as LANGUAGES, Qe as LineChart, A as ListProvider, M as Loader, Wt as Location, Ke as LoginForm, H as Message, ue as Modal, se as ModalContext, ce as ModalProvider, ot as NavbarButton, at as NavbarModal, st as NotificationItem, Ue as OAuth2Button, Y as PaginatedList, N as Pagination, $e as PieChart, mt as PointBox, et as ProgressBar, wt as ProposalBox, te as ReadMore, Dt as ReportBox, O as ResponsiveProvider, Ze as SSOForm, zt as ScrollToTop, W as SearchInput, Ot as SectionBox, K as Select, me as ShareBox, he as ShareButton, Ye as SignupForm, Xe as SocialAuthForm, Pe as SourceBox, ee as SourceListItem, Fe as SourceModal, Mt as SuggestionBanner, Et as SuggestionBox, Nt as SuggestionInput, Tt as SuggestionVoteBox, Lt as Summary, It as SummaryBox, ze as SummaryContentBox, q as Tag, U as TextInput, _e as Toast, ve as ToastProvider, Je as Toggle, yt as TogglePosition, pe as Tooltip, Be as TopArguments, ae as TranslatedContent, oe as TranslationButton, Ct as UpDownVoteBox, Vt as UpdateUserInfoModal, Ut as UserBox, Ae as UserBoxSmall, $ as UserContentSkeleton, Gt as VoteBox, Ne as VoteButton, X as VoteContext, Q as VotePaginatedList, Z as VoteProvider, c as WithAd, m as authTokenHandler, B as classes, h as dataProvider, z as extractFormData, V as getAccent, De as getLocaleIcon, Oe as getLocaleName, re as getTranslatedContent, Ve as httpClient, Ie as lexicalToHtml, l as makeStorage, P as uniqueBy, p as useAuth, b as useAuthActions, x as useAuthInterceptor, be as useAuthRequired, w as useConfig, ht as useCssTheme, v as useData, _ as useDataProvider, xe as useDeleteContent, ut as useFollow, gt as useFontLoader, R as useForm, I as useFormContext, ft as useFormValidation, s as useGoogleAdManager, fe as useInput, j as useList, St as useLocale, _t as useMatomo, le as useModal, we as useRelativeTime, Se as useReportContent, k as useResponsive, Le as useRichContent, T as useRoutes, ye as useToast, ie as useTranslatedContent, Ht as useUpdateUserInfo, Me as useVote, f as withAuth, E as withConfig };
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { require_jsx_runtime as e } from "../../../../react@18.3.1/node_modules/react/jsx-runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { Dn as t, Lr as n, Si as r, ho as i, le as a, lr as o, wo as s, yr as c, zs as l } from "../../../../lexical@0.38.2/node_modules/lexical/Lexical.prod.js";
|
|
3
|
+
import { Ht as u, U as d, at as f } from "../../../../@lexical_utils@0.38.2/node_modules/@lexical/utils/LexicalUtils.prod.js";
|
|
4
|
+
import { n as p, o as m, s as h } from "../../../../@lexical_overflow@0.38.2/node_modules/@lexical/overflow/LexicalOverflow.prod.js";
|
|
5
|
+
import { o as g } from "./LexicalComposerContext.prod.js";
|
|
6
|
+
import { s as _ } from "../../../../@lexical_text@0.38.2/node_modules/@lexical/text/LexicalText.prod.js";
|
|
7
7
|
import { useEffect as v, useMemo as y, useState as b } from "react";
|
|
8
8
|
//#region 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.mjs
|
|
9
9
|
var x = e();
|
|
10
|
-
function S(e,
|
|
10
|
+
function S(e, m, g = Object.freeze({})) {
|
|
11
11
|
let { strlen: y = (e) => e.length, remainingCharacters: b = () => {} } = g;
|
|
12
12
|
v(() => {
|
|
13
|
-
e.hasNodes([
|
|
13
|
+
e.hasNodes([p]) || function(e, ...t) {
|
|
14
14
|
let n = new URL("https://lexical.dev/docs/error"), r = new URLSearchParams();
|
|
15
15
|
r.append("code", e);
|
|
16
16
|
for (let e of t) r.append("v", e);
|
|
17
17
|
throw n.search = r.toString(), Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
18
18
|
}(57);
|
|
19
19
|
}, [e]), v(() => {
|
|
20
|
-
let
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
}), e.registerUpdateListener(({ dirtyLeaves:
|
|
24
|
-
let
|
|
25
|
-
if (
|
|
26
|
-
let v = y(
|
|
27
|
-
if (b(
|
|
28
|
-
let
|
|
20
|
+
let p = e.getEditorState().read(_), g = 0;
|
|
21
|
+
return d(e.registerTextContentListener((e) => {
|
|
22
|
+
p = e;
|
|
23
|
+
}), e.registerUpdateListener(({ dirtyLeaves: r, dirtyElements: a }) => {
|
|
24
|
+
let d = e.isComposing(), _ = r.size > 0 || a.size > 0;
|
|
25
|
+
if (d || !_) return;
|
|
26
|
+
let v = y(p), x = v > m || g !== null && g > m;
|
|
27
|
+
if (b(m - v), g === null || x) {
|
|
28
|
+
let r = function(e, t, n) {
|
|
29
29
|
let r = Intl.Segmenter, i = 0, a = 0;
|
|
30
30
|
if (typeof r == "function") {
|
|
31
31
|
let o = new r().segment(e);
|
|
@@ -43,64 +43,64 @@ function S(e, t, g = Object.freeze({})) {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
return i;
|
|
46
|
-
}(
|
|
46
|
+
}(p, m, y);
|
|
47
47
|
e.update(() => {
|
|
48
48
|
(function(e) {
|
|
49
|
-
let t =
|
|
50
|
-
for (let
|
|
51
|
-
let { node:
|
|
52
|
-
if (
|
|
53
|
-
let t =
|
|
54
|
-
if (
|
|
55
|
-
let e =
|
|
56
|
-
|
|
57
|
-
let a =
|
|
58
|
-
!
|
|
49
|
+
let t = f(), r = t.length, a = 0;
|
|
50
|
+
for (let d = 0; d < r; d += 1) {
|
|
51
|
+
let { node: r } = t[d], f = i(r) && !l(r, h);
|
|
52
|
+
if (h(r)) {
|
|
53
|
+
let t = a;
|
|
54
|
+
if (a + r.getTextContentSize() <= e) {
|
|
55
|
+
let e = r.getParent(), t = r.getPreviousSibling(), i = r.getNextSibling();
|
|
56
|
+
u(r);
|
|
57
|
+
let a = n();
|
|
58
|
+
!c(a) || a.anchor.getNode().isAttached() && a.focus.getNode().isAttached() || (o(t) ? t.select() : o(i) ? i.select() : e !== null && e.select());
|
|
59
59
|
} else if (t < e) {
|
|
60
|
-
let
|
|
61
|
-
(
|
|
60
|
+
let n = r.getFirstDescendant(), i = t + (n === null ? 0 : n.getTextContentSize());
|
|
61
|
+
(o(n) && n.isSimpleText() || i <= e) && u(r);
|
|
62
62
|
}
|
|
63
63
|
} else if (f) {
|
|
64
|
-
let t =
|
|
65
|
-
if (
|
|
66
|
-
let i =
|
|
67
|
-
if (t < e &&
|
|
68
|
-
let [,
|
|
69
|
-
a = C(
|
|
70
|
-
} else a = C(
|
|
71
|
-
i !== null &&
|
|
64
|
+
let t = a;
|
|
65
|
+
if (a += r.getTextContentSize(), a > e && !h(r.getParent())) {
|
|
66
|
+
let i = n(), a;
|
|
67
|
+
if (t < e && o(r) && r.isSimpleText()) {
|
|
68
|
+
let [, n] = r.splitText(e - t);
|
|
69
|
+
a = C(n);
|
|
70
|
+
} else a = C(r);
|
|
71
|
+
i !== null && s(i), w(a);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
})(
|
|
76
|
-
}, { tag:
|
|
75
|
+
})(r);
|
|
76
|
+
}, { tag: t });
|
|
77
77
|
}
|
|
78
78
|
g = v;
|
|
79
|
-
}), e.registerCommand(
|
|
80
|
-
let t =
|
|
81
|
-
if (!
|
|
82
|
-
let
|
|
83
|
-
return t.deleteCharacter(e), a && a.isEmpty() ? a.remove() :
|
|
79
|
+
}), e.registerCommand(a, (e) => {
|
|
80
|
+
let t = n();
|
|
81
|
+
if (!c(t)) return !1;
|
|
82
|
+
let i = t.anchor.getNode().getParent(), a = i ? i.getParent() : null, o = a ? a.getNextSibling() : null;
|
|
83
|
+
return t.deleteCharacter(e), a && a.isEmpty() ? a.remove() : r(o) && o.isEmpty() && o.remove(), !0;
|
|
84
84
|
}, 1));
|
|
85
85
|
}, [
|
|
86
86
|
e,
|
|
87
|
-
|
|
87
|
+
m,
|
|
88
88
|
b,
|
|
89
89
|
y
|
|
90
90
|
]);
|
|
91
91
|
}
|
|
92
92
|
function C(e) {
|
|
93
|
-
let t =
|
|
93
|
+
let t = m();
|
|
94
94
|
return e.replace(t), t.append(e), t;
|
|
95
95
|
}
|
|
96
96
|
function w(e) {
|
|
97
97
|
let t = e.getPreviousSibling();
|
|
98
|
-
if (!
|
|
99
|
-
let
|
|
100
|
-
if (
|
|
101
|
-
else for (let e = 0; e < a; e++)
|
|
102
|
-
let o =
|
|
103
|
-
if (
|
|
98
|
+
if (!h(t)) return;
|
|
99
|
+
let r = e.getFirstChild(), i = t.getChildren(), a = i.length;
|
|
100
|
+
if (r === null) e.append(...i);
|
|
101
|
+
else for (let e = 0; e < a; e++) r.insertBefore(i[e]);
|
|
102
|
+
let o = n();
|
|
103
|
+
if (c(o)) {
|
|
104
104
|
let n = o.anchor, r = n.getNode(), i = o.focus, s = n.getNode();
|
|
105
105
|
r.is(t) ? n.set(e.getKey(), n.offset, "element") : r.is(e) && n.set(e.getKey(), a + n.offset, "element"), s.is(t) ? i.set(e.getKey(), i.offset, "element") : s.is(e) && i.set(e.getKey(), a + i.offset, "element");
|
|
106
106
|
}
|
|
@@ -121,16 +121,16 @@ function D({ remainingCharacters: e }) {
|
|
|
121
121
|
children: e
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
-
function O({ charset: e = "UTF-16", maxLength:
|
|
125
|
-
let [
|
|
126
|
-
return S(
|
|
127
|
-
remainingCharacters:
|
|
124
|
+
function O({ charset: e = "UTF-16", maxLength: t = 5, renderer: n = D }) {
|
|
125
|
+
let [r] = g(), [i, a] = b(t);
|
|
126
|
+
return S(r, t, y(() => ({
|
|
127
|
+
remainingCharacters: a,
|
|
128
128
|
strlen: (t) => {
|
|
129
129
|
if (e === "UTF-8") return E(t);
|
|
130
130
|
if (e === "UTF-16") return t.length;
|
|
131
131
|
throw Error("Unrecognized charset");
|
|
132
132
|
}
|
|
133
|
-
}), [e])),
|
|
133
|
+
}), [e])), n({ remainingCharacters: i });
|
|
134
134
|
}
|
|
135
135
|
//#endregion
|
|
136
136
|
export { O as U };
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { require_jsx_runtime as e } from "../../../../react@18.3.1/node_modules/react/jsx-runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { $i as t, Dn as n, Li as r, Lr as i, No as a } from "../../../../lexical@0.38.2/node_modules/lexical/Lexical.prod.js";
|
|
3
|
+
import { r as o, t as s } from "./LexicalComposerContext.prod.js";
|
|
4
4
|
import { useEffect as c, useLayoutEffect as l, useMemo as u } from "react";
|
|
5
5
|
//#region 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.mjs
|
|
6
|
-
var d = e(), f = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, p = f ? l : c, m = { tag:
|
|
7
|
-
function h({ initialConfig: e, children:
|
|
6
|
+
var d = e(), f = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, p = f ? l : c, m = { tag: n };
|
|
7
|
+
function h({ initialConfig: e, children: n }) {
|
|
8
8
|
let c = u(() => {
|
|
9
|
-
let { theme:
|
|
9
|
+
let { theme: n, namespace: o, nodes: c, onError: l, editorState: u, html: d } = e, p = s(null, n), h = t({
|
|
10
10
|
editable: e.editable,
|
|
11
11
|
html: d,
|
|
12
|
-
namespace:
|
|
12
|
+
namespace: o,
|
|
13
13
|
nodes: c,
|
|
14
14
|
onError: (e) => l(e, h),
|
|
15
|
-
theme:
|
|
15
|
+
theme: n
|
|
16
16
|
});
|
|
17
17
|
return function(e, t) {
|
|
18
18
|
if (t !== null) {
|
|
19
19
|
if (t === void 0) e.update(() => {
|
|
20
|
-
let t =
|
|
20
|
+
let t = a();
|
|
21
21
|
if (t.isEmpty()) {
|
|
22
|
-
let n =
|
|
22
|
+
let n = r();
|
|
23
23
|
t.append(n);
|
|
24
|
-
let
|
|
25
|
-
(
|
|
24
|
+
let a = f ? document.activeElement : null;
|
|
25
|
+
(i() !== null || a !== null && a === e.getRootElement()) && n.select();
|
|
26
26
|
}
|
|
27
27
|
}, m);
|
|
28
28
|
else if (t !== null) switch (typeof t) {
|
|
@@ -35,7 +35,7 @@ function h({ initialConfig: e, children: i }) {
|
|
|
35
35
|
e.setEditorState(t, m);
|
|
36
36
|
break;
|
|
37
37
|
case "function": e.update(() => {
|
|
38
|
-
|
|
38
|
+
a().isEmpty() && t(e);
|
|
39
39
|
}, m);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -44,9 +44,9 @@ function h({ initialConfig: e, children: i }) {
|
|
|
44
44
|
return p(() => {
|
|
45
45
|
let t = e.editable, [n] = c;
|
|
46
46
|
n.setEditable(t === void 0 || t);
|
|
47
|
-
}, []), (0, d.jsx)(
|
|
47
|
+
}, []), (0, d.jsx)(o.Provider, {
|
|
48
48
|
value: c,
|
|
49
|
-
children:
|
|
49
|
+
children: n
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
//#endregion
|