@logora/debate 0.3.63 → 0.3.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/components/consultation/consultation_box/{ConsultationBox.module-CZB4qRb2.css → ConsultationBox.module-D2an6OmR.css} +1 -1
- package/dist/components/consultation/consultation_box/ConsultationBox.js +35 -44
- package/dist/components/consultation/consultation_box/ConsultationBox.module.scss.js +20 -20
- package/dist/components/icons/spiegel_icons/Downvote.js +6 -0
- package/dist/components/icons/spiegel_icons/Upvote.js +6 -0
- package/dist/components/icons/spiegel_icons/index.js +46 -46
- package/dist/components/input/text_editor/TextEditor.js +95 -93
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._container_1fmcx_3{display:flex!important;flex-direction:column!important;justify-content:space-between!important;box-shadow:var(--box-shadow, 0px 2px 5px rgba(7, 42, 68, .1));border:var(--box-border, 1px solid rgba(7, 42, 68, .1));color:var(--text-primary, #222222);border-radius:var(--box-border-radius, 6px);background:var(--background-color-primary, white)}._container_1fmcx_3 a{text-decoration:none!important;color:var(--text-primary, #222222)!important}._consultationImageBox_1fmcx_18{position:relative}._consultationImage_1fmcx_18{border-top-right-radius:var(--box-border-radius, 6px);border-top-left-radius:var(--box-border-radius, 6px);width:100%;aspect-ratio:var(--img-aspect-ratio, 16/9);object-fit:cover;display:block}._consultationTime_1fmcx_31{display:flex!important;align-items:center!important;position:absolute;left:var(--space-unit, 1em);bottom:var(--space-unit, 1em);padding-right:var(--spacer-md, calc(var(--space-unit, 1em) * .75))!important;padding-left:var(--spacer-md, calc(var(--space-unit, 1em) * .75))!important;padding-top:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;padding-bottom:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;background-color:var(--call-primary-color, #434343);border-radius:var(--box-border-radius, 6px);font-size:var(--font-size-normal, 16px);color:var(--text-light, white);max-width:93%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}._consultationTime_1fmcx_31 span{color:var(--text-light, white)}._consultationTime_1fmcx_31._ended_1fmcx_53{background-color:var(--call-primary-color, #434343)}._consultationTitle_1fmcx_57{padding-top:var(--spacer-lg, calc(var(--space-unit, 1em) * 1.5))!important;padding-bottom:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;padding-right:var(--space-unit, 1em)!important;padding-left:var(--space-unit, 1em)!important;font-size:var(--font-size-normal, 16px);font-weight:var(--font-weight-bold, 700)}._iconVote_1fmcx_66{padding-top:3px!important}._iconChat_1fmcx_70{padding-top:6px!important}._consultationButtonContainer_1fmcx_74{display:flex!important;padding-right:var(--space-unit, 1em)!important;padding-left:var(--space-unit, 1em)!important;padding-bottom:var(--spacer-lg, calc(var(--space-unit, 1em) * 1.5))!important;color:var(--text-secondary, #5F5F5F);font-size:var(--font-size-small, 16px)}._consultationButtonContainer_1fmcx_74:hover{text-decoration:underline;text-decoration-color:var(--text-secondary, #5F5F5F)}._consultationButtonContainer_1fmcx_74 ._arrowIcon_1fmcx_86{margin-left:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important;transform:rotate(180deg);fill:var(--text-secondary, #5F5F5F);top:1px;position:relative}._consultationInformations_1fmcx_94{display:flex!important;justify-content:space-between!important;align-items:center!important;padding-right:var(--space-unit, 1em)!important;padding-left:var(--space-unit, 1em)!important;padding-top:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;padding-bottom:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;min-height:50px}._consultationInformations_1fmcx_94 ._consultationLeft_1fmcx_104{display:flex!important}._consultationInformations_1fmcx_94 ._consultationGroupInformation_1fmcx_107{display:flex!important;align-items:center!important}._consultationInformations_1fmcx_94 ._consultationGroupInformation_1fmcx_107._consultationGroupRight_1fmcx_111{padding-right:var(--space-unit, 1em)!important}._consultationInformations_1fmcx_94 ._progressBarContainer_1fmcx_114{width:60%;display:flex!important;flex-direction:column!important;align-items:flex-end!important;font-size:var(--font-size-extra-small, 14px)}._consultationInformations_1fmcx_94 ._progressBarContainer_1fmcx_114 ._progress_1fmcx_114{margin-top:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important;height:15px;width:100%;border-radius:var(--box-border-radius, 6px);background-color:var(--background-color-secondary, #E8E8E8)!important}._consultationInformations_1fmcx_94 ._progressBarContainer_1fmcx_114 ._bar_1fmcx_128{background-color:var(--call-primary-color, #434343)}._consultationInformations_1fmcx_94 ._progressBarContainer_1fmcx_114 ._totalVotes_1fmcx_131{margin-right:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important}._consultationInformations_1fmcx_94 ._progressBarContainer_1fmcx_114 ._totalVotesPercentage_1fmcx_134{margin-left:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important}._consultationInformations_1fmcx_94 ._consultationTextInformation_1fmcx_137{padding-right:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important;padding-top:5px!important}
|
|
@@ -1,29 +1,22 @@
|
|
|
1
|
-
import { jsx as t, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { useIntl as
|
|
1
|
+
import { jsx as t, Fragment as u, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import s from "classnames";
|
|
3
|
+
import { useMemo as g } from "react";
|
|
4
|
+
import { useIntl as h, FormattedMessage as p } from "react-intl";
|
|
5
5
|
import o from "./ConsultationBox.module.scss.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { TranslatedContent as I } from "../../translation/translated_content/TranslatedContent.js";
|
|
6
|
+
import { useRoutes as f } from "../../data/config_provider/useRoutes.js";
|
|
7
|
+
import { useResponsive as v } from "../../hooks/use_responsive/useResponsive.js";
|
|
8
|
+
import { Link as i } from "../../action/link/Link.js";
|
|
9
|
+
import { TranslatedContent as N } from "../../translation/translated_content/TranslatedContent.js";
|
|
11
10
|
import { Icon as c } from "../../icons/icon/Icon.js";
|
|
12
|
-
import { ProgressBar as
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
{
|
|
17
|
-
id: "consultation.consultation_box.consultation_ended",
|
|
18
|
-
defaultMessage: "Consultation ended"
|
|
19
|
-
}
|
|
20
|
-
) }) : /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t("span", { children: g }) });
|
|
21
|
-
return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ n("div", { className: o.container, children: [
|
|
22
|
-
/* @__PURE__ */ n("div", { className: o.consultationImageBox, children: [
|
|
11
|
+
import { ProgressBar as _ } from "../../progress/progress_bar/ProgressBar.js";
|
|
12
|
+
const D = ({ consultation: e, showVoteProgress: m = !0 }) => {
|
|
13
|
+
const d = h(), r = g(() => /* @__PURE__ */ new Date()), l = new Date(e.ends_at), n = f(), { isMobile: x } = v();
|
|
14
|
+
return /* @__PURE__ */ t(u, { children: /* @__PURE__ */ a("div", { className: o.container, children: [
|
|
15
|
+
/* @__PURE__ */ a("div", { className: o.consultationImageBox, children: [
|
|
23
16
|
/* @__PURE__ */ t(
|
|
24
|
-
|
|
17
|
+
i,
|
|
25
18
|
{
|
|
26
|
-
to:
|
|
19
|
+
to: n.consultationShowLocation.toUrl({
|
|
27
20
|
consultationSlug: e.slug
|
|
28
21
|
}),
|
|
29
22
|
children: /* @__PURE__ */ t(
|
|
@@ -32,7 +25,7 @@ const P = ({ consultation: e, showVoteProgress: d = !0 }) => {
|
|
|
32
25
|
loading: "lazy",
|
|
33
26
|
className: o.consultationImage,
|
|
34
27
|
src: e.image_url,
|
|
35
|
-
alt:
|
|
28
|
+
alt: d.formatMessage({
|
|
36
29
|
id: "consultation.consultation_box.alt",
|
|
37
30
|
defaultMessage: "Presentation image for the consultation"
|
|
38
31
|
})
|
|
@@ -40,24 +33,22 @@ const P = ({ consultation: e, showVoteProgress: d = !0 }) => {
|
|
|
40
33
|
)
|
|
41
34
|
}
|
|
42
35
|
),
|
|
43
|
-
e.ends_at && /* @__PURE__ */ t(
|
|
44
|
-
|
|
36
|
+
e.ends_at && l < r && /* @__PURE__ */ t("div", { className: s(o.consultationTime, o.ended), children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(
|
|
37
|
+
p,
|
|
45
38
|
{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}),
|
|
49
|
-
children: h()
|
|
39
|
+
id: "consultation.consultation_box.consultation_ended",
|
|
40
|
+
defaultMessage: "Consultation ended"
|
|
50
41
|
}
|
|
51
|
-
)
|
|
42
|
+
) }) })
|
|
52
43
|
] }),
|
|
53
44
|
/* @__PURE__ */ t(
|
|
54
|
-
|
|
45
|
+
i,
|
|
55
46
|
{
|
|
56
|
-
to:
|
|
47
|
+
to: n.consultationShowLocation.toUrl({
|
|
57
48
|
consultationSlug: e.slug
|
|
58
49
|
}),
|
|
59
50
|
children: /* @__PURE__ */ t("div", { className: o.consultationTitle, children: /* @__PURE__ */ t(
|
|
60
|
-
|
|
51
|
+
N,
|
|
61
52
|
{
|
|
62
53
|
originalContent: e.title,
|
|
63
54
|
originalLanguage: e.language,
|
|
@@ -68,19 +59,19 @@ const P = ({ consultation: e, showVoteProgress: d = !0 }) => {
|
|
|
68
59
|
}
|
|
69
60
|
),
|
|
70
61
|
/* @__PURE__ */ t(
|
|
71
|
-
|
|
62
|
+
i,
|
|
72
63
|
{
|
|
73
|
-
to:
|
|
64
|
+
to: n.consultationShowLocation.toUrl({
|
|
74
65
|
consultationSlug: e.slug
|
|
75
66
|
})
|
|
76
67
|
}
|
|
77
68
|
),
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ a("div", { className: o.consultationInformations, children: [
|
|
70
|
+
/* @__PURE__ */ a("div", { className: o.consultationLeft, children: [
|
|
71
|
+
/* @__PURE__ */ a(
|
|
81
72
|
"div",
|
|
82
73
|
{
|
|
83
|
-
className:
|
|
74
|
+
className: s(
|
|
84
75
|
o.consultationGroupInformation,
|
|
85
76
|
o.consultationGroupRight
|
|
86
77
|
),
|
|
@@ -90,20 +81,20 @@ const P = ({ consultation: e, showVoteProgress: d = !0 }) => {
|
|
|
90
81
|
]
|
|
91
82
|
}
|
|
92
83
|
),
|
|
93
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ a("div", { className: o.consultationGroupInformation, children: [
|
|
94
85
|
/* @__PURE__ */ t("span", { className: o.consultationTextInformation, children: e.proposals_count }),
|
|
95
86
|
/* @__PURE__ */ t(c, { name: "chat", width: 15, height: 20, className: o.iconChat })
|
|
96
87
|
] })
|
|
97
88
|
] }),
|
|
98
|
-
|
|
89
|
+
m && e.vote_goal > 0 && l > r && /* @__PURE__ */ t(
|
|
99
90
|
"div",
|
|
100
91
|
{
|
|
101
|
-
className:
|
|
92
|
+
className: s(
|
|
102
93
|
o.consultationGroupInformation,
|
|
103
94
|
o.progressBarContainer
|
|
104
95
|
),
|
|
105
96
|
children: /* @__PURE__ */ t(
|
|
106
|
-
|
|
97
|
+
_,
|
|
107
98
|
{
|
|
108
99
|
className: o.progress,
|
|
109
100
|
innerClassName: o.bar,
|
|
@@ -119,5 +110,5 @@ const P = ({ consultation: e, showVoteProgress: d = !0 }) => {
|
|
|
119
110
|
] }) });
|
|
120
111
|
};
|
|
121
112
|
export {
|
|
122
|
-
|
|
113
|
+
D as ConsultationBox
|
|
123
114
|
};
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import '../../../assets/components/consultation/consultation_box/ConsultationBox.module-
|
|
1
|
+
import '../../../assets/components/consultation/consultation_box/ConsultationBox.module-D2an6OmR.css';const o = "_container_1fmcx_3", n = "_consultationImageBox_1fmcx_18", t = "_consultationImage_1fmcx_18", c = "_consultationTime_1fmcx_31", s = "_ended_1fmcx_53", a = "_consultationTitle_1fmcx_57", i = "_iconVote_1fmcx_66", _ = "_iconChat_1fmcx_70", e = "_consultationInformations_1fmcx_94", r = "_consultationLeft_1fmcx_104", m = "_consultationGroupInformation_1fmcx_107", u = "_consultationGroupRight_1fmcx_111", l = "_progressBarContainer_1fmcx_114", f = "_progress_1fmcx_114", x = "_bar_1fmcx_128", g = "_consultationTextInformation_1fmcx_137", I = {
|
|
2
2
|
container: o,
|
|
3
3
|
consultationImageBox: n,
|
|
4
4
|
consultationImage: t,
|
|
5
|
-
consultationTime:
|
|
5
|
+
consultationTime: c,
|
|
6
6
|
ended: s,
|
|
7
|
-
consultationTitle:
|
|
8
|
-
iconVote:
|
|
7
|
+
consultationTitle: a,
|
|
8
|
+
iconVote: i,
|
|
9
9
|
iconChat: _,
|
|
10
10
|
consultationInformations: e,
|
|
11
11
|
consultationLeft: r,
|
|
12
|
-
consultationGroupInformation:
|
|
13
|
-
consultationGroupRight:
|
|
14
|
-
progressBarContainer:
|
|
15
|
-
progress:
|
|
16
|
-
bar:
|
|
17
|
-
consultationTextInformation:
|
|
12
|
+
consultationGroupInformation: m,
|
|
13
|
+
consultationGroupRight: u,
|
|
14
|
+
progressBarContainer: l,
|
|
15
|
+
progress: f,
|
|
16
|
+
bar: x,
|
|
17
|
+
consultationTextInformation: g
|
|
18
18
|
};
|
|
19
19
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
x as bar,
|
|
21
|
+
m as consultationGroupInformation,
|
|
22
|
+
u as consultationGroupRight,
|
|
23
23
|
t as consultationImage,
|
|
24
24
|
n as consultationImageBox,
|
|
25
25
|
e as consultationInformations,
|
|
26
26
|
r as consultationLeft,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
g as consultationTextInformation,
|
|
28
|
+
c as consultationTime,
|
|
29
|
+
a as consultationTitle,
|
|
30
30
|
o as container,
|
|
31
|
-
|
|
31
|
+
I as default,
|
|
32
32
|
s as ended,
|
|
33
33
|
_ as iconChat,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
i as iconVote,
|
|
35
|
+
f as progress,
|
|
36
|
+
l as progressBarContainer
|
|
37
37
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as L } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
const e = (C) => /* @__PURE__ */ L("svg", { viewBox: "0 0 50 50", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...C, children: /* @__PURE__ */ L("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M25.1109 48.0906C29.3616 48.0903 32.8082 44.644 32.8082 40.3933V32.697H41.2457C44.8599 32.6967 47.5856 29.4125 46.9195 25.8601L43.3121 6.61792L43.2584 6.36401C42.6504 3.76613 40.329 1.9092 37.6383 1.90894H25.0035L24.5572 1.92261C23.6651 1.97446 22.7885 2.18144 21.9674 2.53394L21.5621 2.72241L16.3023 5.35132C15.835 5.58497 15.3253 5.72136 14.8053 5.75171L14.5816 5.75757H9.71738L2.01953 5.7578V28.8484L9.71738 28.8484H15.4898L19.0963 34.2576C19.2556 34.4966 19.3594 34.7691 19.4 35.0535L21.0269 46.4382C21.1624 47.3861 21.9738 48.0904 22.9312 48.0906H25.1109ZM21.5924 32.5935C22.0001 33.2052 22.2657 33.9009 22.3697 34.6287L23.8648 45.0906H25.1109C27.7047 45.0903 29.8082 42.9872 29.8082 40.3933V29.697H41.2457C42.9815 29.6967 44.2911 28.119 43.9713 26.4128L40.3629 7.17065C40.1169 5.85969 38.9721 4.90921 37.6383 4.90894H25.0035C24.2746 4.90899 23.5549 5.07912 22.9029 5.40503L17.6441 8.03491C16.6934 8.51025 15.6446 8.75748 14.5816 8.75757H12.7174V25.8484H17.0953L21.5924 32.5935Z", fill: "black" }) });
|
|
4
|
+
export {
|
|
5
|
+
e as Downvote
|
|
6
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as L } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
const o = (C) => /* @__PURE__ */ L("svg", { viewBox: "0 0 50 50", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...C, children: /* @__PURE__ */ L("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M32.8082 9.60669C32.8082 5.35599 29.3616 1.90969 25.1109 1.90942H22.9312C21.9738 1.90957 21.1624 2.61392 21.0269 3.56177L19.4 14.9465C19.3594 15.2309 19.2556 15.5034 19.0963 15.7424L15.4898 21.1516H9.7164L2.01953 21.1516V44.2422L9.7164 44.2424H14.5816L14.8053 44.2483C15.3253 44.2786 15.835 44.415 16.3023 44.6487L21.5621 47.2776L21.9674 47.4661C22.7885 47.8186 23.6651 48.0255 24.5572 48.0774L25.0035 48.0911H37.6383C40.329 48.0908 42.6504 46.2339 43.2584 43.636L43.3121 43.3821L46.9195 24.1399C47.5856 20.5875 44.8599 17.3033 41.2457 17.303H32.8082V9.60669ZM21.5924 17.4065C22.0001 16.7948 22.2657 16.0991 22.3697 15.3713L23.8648 4.90942H25.1109C27.7047 4.90969 29.8082 7.01284 29.8082 9.60669V20.303H41.2457C42.9815 20.3033 44.2911 21.881 43.9713 23.5872L40.3629 42.8293C40.1169 44.1403 38.9721 45.0908 37.6383 45.0911H25.0035C24.2746 45.091 23.5549 44.9209 22.9029 44.595L17.6441 41.9651C16.6934 41.4897 15.6446 41.2425 14.5816 41.2424H12.7164V24.1516H17.0953L21.5924 17.4065Z", fill: "black" }) });
|
|
4
|
+
export {
|
|
5
|
+
o as Upvote
|
|
6
|
+
};
|
|
@@ -24,79 +24,79 @@ import { Suggestion as J } from "./Suggestion.js";
|
|
|
24
24
|
import { Underline as W } from "./Underline.js";
|
|
25
25
|
import { Votebox as Y } from "./Votebox.js";
|
|
26
26
|
import { CheckCircle as _ } from "./CheckCircle.js";
|
|
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 {
|
|
27
|
+
import { Downvote as oo } from "./Downvote.js";
|
|
28
|
+
import { MinusCircle as eo } from "./MinusCircle.js";
|
|
29
|
+
import { Upvote as mo } from "./Upvote.js";
|
|
30
|
+
import { Flag as xo } from "./Flag.js";
|
|
31
|
+
import { PauseCircle as lo } from "./PauseCircle.js";
|
|
32
|
+
import { Alarm as no } from "../regular_icons/Alarm.js";
|
|
33
|
+
import { Announcement as Co } from "../regular_icons/Announcement.js";
|
|
34
|
+
import { Arrow as so } from "../regular_icons/Arrow.js";
|
|
35
|
+
import { Camera as ho } from "../regular_icons/Camera.js";
|
|
36
|
+
import { Check as go } from "../regular_icons/Check.js";
|
|
37
|
+
import { Code as So } from "../regular_icons/Code.js";
|
|
38
|
+
import { Community as Ao } from "../regular_icons/Community.js";
|
|
39
|
+
import { Home as Mo } from "../regular_icons/Home.js";
|
|
40
|
+
import { Logora as Uo } from "../regular_icons/Logora.js";
|
|
41
|
+
import { MobileMenu as yo } from "../regular_icons/MobileMenu.js";
|
|
42
|
+
import { Next as Fo } from "../regular_icons/Next.js";
|
|
43
|
+
import { OpenBlank as Po } from "../regular_icons/OpenBlank.js";
|
|
44
|
+
import { Point as qo } from "../regular_icons/Point.js";
|
|
45
|
+
import { Refresh as Ho } from "../regular_icons/Refresh.js";
|
|
46
|
+
import { Search as No } from "../regular_icons/Search.js";
|
|
47
|
+
import { Send as To } from "../regular_icons/Send.js";
|
|
48
|
+
import { Source as jo } from "../regular_icons/Source.js";
|
|
49
|
+
import { Twitter as Go } from "../regular_icons/Twitter.js";
|
|
50
50
|
import { User as Ko } from "../regular_icons/User.js";
|
|
51
51
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
no as Alarm,
|
|
53
|
+
Co as Announcement,
|
|
54
|
+
so as Arrow,
|
|
55
55
|
e as Blockquote,
|
|
56
56
|
m as Bold,
|
|
57
|
-
|
|
57
|
+
ho as Camera,
|
|
58
58
|
x as Chat,
|
|
59
|
-
|
|
59
|
+
go as Check,
|
|
60
60
|
_ as CheckCircle,
|
|
61
61
|
l as Checkbox,
|
|
62
62
|
n as Clap,
|
|
63
63
|
C as Clock,
|
|
64
64
|
s as Close,
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
So as Code,
|
|
66
|
+
Ao as Community,
|
|
67
67
|
h as Crown,
|
|
68
|
-
|
|
68
|
+
oo as Downvote,
|
|
69
69
|
d as Ellipsis,
|
|
70
70
|
w as ExpertBadge,
|
|
71
71
|
b as Facebook,
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
xo as Flag,
|
|
73
|
+
Mo as Home,
|
|
74
74
|
L as Italic,
|
|
75
75
|
B as LightArrow,
|
|
76
76
|
v as Link,
|
|
77
77
|
E as Login,
|
|
78
|
-
|
|
78
|
+
Uo as Logora,
|
|
79
79
|
O as Mail,
|
|
80
|
-
|
|
80
|
+
eo as MinusCircle,
|
|
81
81
|
R as MobileClose,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
yo as MobileMenu,
|
|
83
|
+
Fo as Next,
|
|
84
|
+
Po as OpenBlank,
|
|
85
85
|
D as OrderedList,
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
lo as PauseCircle,
|
|
87
|
+
qo as Point,
|
|
88
88
|
I as Question,
|
|
89
|
-
|
|
89
|
+
Ho as Refresh,
|
|
90
90
|
Q as Reply,
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
No as Search,
|
|
92
|
+
To as Send,
|
|
93
93
|
V as Share,
|
|
94
94
|
z as SmallArrow,
|
|
95
|
-
|
|
95
|
+
jo as Source,
|
|
96
96
|
J as Suggestion,
|
|
97
|
-
|
|
97
|
+
Go as Twitter,
|
|
98
98
|
W as Underline,
|
|
99
|
-
|
|
99
|
+
mo as Upvote,
|
|
100
100
|
Ko as User,
|
|
101
101
|
Y as Votebox
|
|
102
102
|
};
|
|
@@ -1,142 +1,144 @@
|
|
|
1
|
-
import { jsxs as p, Fragment as
|
|
2
|
-
import { ListNode as
|
|
3
|
-
import { OverflowNode as
|
|
4
|
-
import { CharacterLimitPlugin as
|
|
5
|
-
import { LexicalComposer as
|
|
6
|
-
import { ContentEditable as
|
|
7
|
-
import { EditorRefPlugin as
|
|
8
|
-
import { LexicalErrorBoundary as
|
|
9
|
-
import { HistoryPlugin as
|
|
10
|
-
import { ListPlugin as
|
|
11
|
-
import { OnChangePlugin as
|
|
12
|
-
import { RichTextPlugin as
|
|
13
|
-
import { QuoteNode as
|
|
14
|
-
import
|
|
15
|
-
import { $getRoot as
|
|
16
|
-
import { useState as d, useId as
|
|
17
|
-
import { useIntl as
|
|
18
|
-
import
|
|
1
|
+
import { jsxs as p, Fragment as Y, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { ListNode as Z, ListItemNode as oo } from "@lexical/list";
|
|
3
|
+
import { OverflowNode as to } from "@lexical/overflow";
|
|
4
|
+
import { CharacterLimitPlugin as eo } from "@lexical/react/LexicalCharacterLimitPlugin";
|
|
5
|
+
import { LexicalComposer as ro } from "@lexical/react/LexicalComposer";
|
|
6
|
+
import { ContentEditable as io } from "@lexical/react/LexicalContentEditable";
|
|
7
|
+
import { EditorRefPlugin as no } from "@lexical/react/LexicalEditorRefPlugin";
|
|
8
|
+
import { LexicalErrorBoundary as so } from "@lexical/react/LexicalErrorBoundary";
|
|
9
|
+
import { HistoryPlugin as co } from "@lexical/react/LexicalHistoryPlugin";
|
|
10
|
+
import { ListPlugin as lo } from "@lexical/react/LexicalListPlugin";
|
|
11
|
+
import { OnChangePlugin as mo } from "@lexical/react/LexicalOnChangePlugin";
|
|
12
|
+
import { RichTextPlugin as ao } from "@lexical/react/LexicalRichTextPlugin";
|
|
13
|
+
import { QuoteNode as uo } from "@lexical/rich-text";
|
|
14
|
+
import R from "classnames";
|
|
15
|
+
import { $getRoot as fo } from "lexical";
|
|
16
|
+
import { useState as d, useId as po, useEffect as ho } from "react";
|
|
17
|
+
import { useIntl as go } from "react-intl";
|
|
18
|
+
import So from "./EditorTheme.js";
|
|
19
19
|
import i from "./TextEditor.module.scss.js";
|
|
20
|
-
import { AutoSavePlugin as
|
|
21
|
-
import { FocusPlugin as
|
|
22
|
-
import { MaxLengthPlugin as
|
|
23
|
-
import { ResetPlugin as
|
|
20
|
+
import { AutoSavePlugin as xo } from "./plugins/AutoSavePlugin.js";
|
|
21
|
+
import { FocusPlugin as vo } from "./plugins/FocusPlugin.js";
|
|
22
|
+
import { MaxLengthPlugin as Po } from "./plugins/MaxLengthPlugin.js";
|
|
23
|
+
import { ResetPlugin as To } from "./plugins/ResetPlugin.js";
|
|
24
24
|
import { SetContentPlugin as Co } from "./plugins/SetContentPlugin.js";
|
|
25
|
-
import { SetRichContentPlugin as
|
|
26
|
-
import { ToolbarPlugin as
|
|
27
|
-
import { useModal as
|
|
28
|
-
import { SourceModal as
|
|
29
|
-
import { SourceListItem as
|
|
30
|
-
const
|
|
25
|
+
import { SetRichContentPlugin as No } from "./plugins/SetRichContentPlugin.js";
|
|
26
|
+
import { ToolbarPlugin as Eo } from "./plugins/ToolbarPlugin.js";
|
|
27
|
+
import { useModal as Io } from "../../dialog/modal/useModal.js";
|
|
28
|
+
import { SourceModal as Ro } from "../../source/source_modal/SourceModal.js";
|
|
29
|
+
import { SourceListItem as bo } from "../../source/source_list_item/SourceListItem.js";
|
|
30
|
+
const b = (c) => c?.replace(/ /g, " "), rt = ({
|
|
31
31
|
placeholder: c,
|
|
32
32
|
onSubmit: h,
|
|
33
33
|
sources: u,
|
|
34
|
-
hideSubmit:
|
|
35
|
-
hideSourceAction:
|
|
34
|
+
hideSubmit: M = !1,
|
|
35
|
+
hideSourceAction: y = !1,
|
|
36
36
|
onActivation: g,
|
|
37
|
-
disabled:
|
|
37
|
+
disabled: w = !1,
|
|
38
38
|
handleChange: S,
|
|
39
39
|
handleSourcesChange: f,
|
|
40
|
-
shortBar:
|
|
40
|
+
shortBar: A = !1,
|
|
41
41
|
active: x = !1,
|
|
42
42
|
maxLength: l,
|
|
43
|
-
disableRichText:
|
|
44
|
-
editorRef:
|
|
43
|
+
disableRichText: L = !1,
|
|
44
|
+
editorRef: _,
|
|
45
45
|
uid: v,
|
|
46
46
|
allowedDomains: P = [],
|
|
47
|
-
hideCharCount:
|
|
48
|
-
disableAutoActivate:
|
|
49
|
-
|
|
47
|
+
hideCharCount: B = !1,
|
|
48
|
+
disableAutoActivate: F = !1,
|
|
49
|
+
initialContent: T,
|
|
50
|
+
...O
|
|
50
51
|
}) => {
|
|
51
|
-
const [n,
|
|
52
|
-
|
|
52
|
+
const [n, U] = d(!1), [j, k] = d(""), [z, H] = d(""), [m, a] = d([]), { showModal: J } = Io(), C = go(), N = po();
|
|
53
|
+
ho(() => {
|
|
53
54
|
u && a(u);
|
|
54
55
|
}, [u]);
|
|
55
|
-
const
|
|
56
|
-
n || (
|
|
57
|
-
},
|
|
58
|
-
editable: !
|
|
59
|
-
theme:
|
|
56
|
+
const E = () => {
|
|
57
|
+
n || (U(!0), g && g());
|
|
58
|
+
}, Q = {
|
|
59
|
+
editable: !w,
|
|
60
|
+
theme: So,
|
|
60
61
|
onError(t) {
|
|
61
62
|
console.error("TextEditor error:", t);
|
|
62
63
|
},
|
|
63
|
-
nodes: [
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
nodes: [Z, oo, uo, to],
|
|
65
|
+
...T ? { editorState: T } : {}
|
|
66
|
+
}, W = () => {
|
|
67
|
+
E();
|
|
68
|
+
}, $ = (t) => {
|
|
67
69
|
t.read(() => {
|
|
68
|
-
const e =
|
|
69
|
-
|
|
70
|
+
const e = fo().getTextContent(), r = b(e), s = JSON.stringify(t), I = b(s);
|
|
71
|
+
k(r), H(I), S && S(r, I);
|
|
70
72
|
});
|
|
71
|
-
},
|
|
72
|
-
const e =
|
|
73
|
+
}, q = (t) => {
|
|
74
|
+
const e = j, r = z, s = m;
|
|
73
75
|
h && (t.preventDefault(), h(e, r, s)), a([]), f?.([]);
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
+
}, D = () => {
|
|
77
|
+
J(
|
|
76
78
|
/* @__PURE__ */ o(
|
|
77
|
-
|
|
79
|
+
Ro,
|
|
78
80
|
{
|
|
79
|
-
onAddSource:
|
|
81
|
+
onAddSource: G,
|
|
80
82
|
allowedSources: P
|
|
81
83
|
}
|
|
82
84
|
)
|
|
83
85
|
);
|
|
84
|
-
},
|
|
86
|
+
}, G = (t) => {
|
|
85
87
|
a((e) => {
|
|
86
88
|
const r = [...e, t];
|
|
87
89
|
return f?.(r), r;
|
|
88
90
|
});
|
|
89
|
-
},
|
|
91
|
+
}, K = (t) => {
|
|
90
92
|
a((e) => {
|
|
91
93
|
const r = e.filter(
|
|
92
94
|
(s) => s.source_url !== t.source_url
|
|
93
95
|
);
|
|
94
96
|
return f?.(r), r;
|
|
95
97
|
});
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
+
}, V = (t, e) => /* @__PURE__ */ o(
|
|
99
|
+
bo,
|
|
98
100
|
{
|
|
99
101
|
publisher: t.publisher,
|
|
100
102
|
url: t.source_url,
|
|
101
103
|
title: t.title,
|
|
102
104
|
index: e,
|
|
103
|
-
onRemove: () =>
|
|
105
|
+
onRemove: () => K(t)
|
|
104
106
|
},
|
|
105
107
|
e
|
|
106
|
-
),
|
|
107
|
-
return /* @__PURE__ */ p(
|
|
108
|
-
/* @__PURE__ */ o(
|
|
108
|
+
), X = () => /* @__PURE__ */ o("div", { className: i.editorPlaceholder, children: c });
|
|
109
|
+
return /* @__PURE__ */ p(Y, { children: [
|
|
110
|
+
/* @__PURE__ */ o(ro, { initialConfig: Q, children: /* @__PURE__ */ o("div", { className: i.editorContainer, onClick: W, children: /* @__PURE__ */ p(
|
|
109
111
|
"div",
|
|
110
112
|
{
|
|
111
|
-
className:
|
|
113
|
+
className: R(i.editorInner, {
|
|
112
114
|
[i.editorInnerInactive]: !n && !x
|
|
113
115
|
}),
|
|
114
116
|
children: [
|
|
115
117
|
/* @__PURE__ */ o(
|
|
116
|
-
|
|
118
|
+
ao,
|
|
117
119
|
{
|
|
118
120
|
contentEditable: /* @__PURE__ */ o(
|
|
119
|
-
|
|
121
|
+
io,
|
|
120
122
|
{
|
|
121
|
-
className:
|
|
123
|
+
className: R(i.editorInput, {
|
|
122
124
|
[i.editorInputInactive]: !n
|
|
123
125
|
}),
|
|
124
|
-
...
|
|
126
|
+
...O
|
|
125
127
|
}
|
|
126
128
|
),
|
|
127
|
-
placeholder: c && /* @__PURE__ */ o(
|
|
128
|
-
ErrorBoundary:
|
|
129
|
+
placeholder: c && /* @__PURE__ */ o(X, {}),
|
|
130
|
+
ErrorBoundary: so
|
|
129
131
|
}
|
|
130
132
|
),
|
|
131
133
|
/* @__PURE__ */ o(
|
|
132
|
-
|
|
134
|
+
Eo,
|
|
133
135
|
{
|
|
134
|
-
hideSourceAction:
|
|
135
|
-
hideSubmit:
|
|
136
|
-
disableRichText:
|
|
137
|
-
shortBar:
|
|
138
|
-
onSubmit:
|
|
139
|
-
onAddSource:
|
|
136
|
+
hideSourceAction: y,
|
|
137
|
+
hideSubmit: M,
|
|
138
|
+
disableRichText: L,
|
|
139
|
+
shortBar: A,
|
|
140
|
+
onSubmit: q,
|
|
141
|
+
onAddSource: D,
|
|
140
142
|
isActive: n || x,
|
|
141
143
|
sourceTooltip: P?.length > 0 && C.formatMessage({
|
|
142
144
|
id: "input.allowed_domains_tooltip",
|
|
@@ -144,37 +146,37 @@ const R = (c) => c?.replace(/ /g, " "), et = ({
|
|
|
144
146
|
})
|
|
145
147
|
}
|
|
146
148
|
),
|
|
147
|
-
n && l && !
|
|
148
|
-
/* @__PURE__ */ o(
|
|
149
|
+
n && l && !B && /* @__PURE__ */ p("div", { className: i.charactersCount, children: [
|
|
150
|
+
/* @__PURE__ */ o(eo, { maxLength: l }),
|
|
149
151
|
" ",
|
|
150
152
|
C.formatMessage({
|
|
151
153
|
id: "input.remaining_chars",
|
|
152
154
|
defaultMessage: "remaining characters"
|
|
153
155
|
})
|
|
154
156
|
] }),
|
|
157
|
+
/* @__PURE__ */ o(lo, {}),
|
|
155
158
|
/* @__PURE__ */ o(co, {}),
|
|
156
|
-
/* @__PURE__ */ o(
|
|
157
|
-
/* @__PURE__ */ o(lo, { onChange: W, ignoreSelectionChange: !0 }),
|
|
159
|
+
/* @__PURE__ */ o(mo, { onChange: $, ignoreSelectionChange: !0 }),
|
|
158
160
|
/* @__PURE__ */ o(
|
|
159
|
-
|
|
161
|
+
xo,
|
|
160
162
|
{
|
|
161
|
-
onSetContent:
|
|
162
|
-
} :
|
|
163
|
-
storageUid: v ||
|
|
163
|
+
onSetContent: F ? () => {
|
|
164
|
+
} : E,
|
|
165
|
+
storageUid: v || N
|
|
164
166
|
}
|
|
165
167
|
),
|
|
166
168
|
/* @__PURE__ */ o(Co, {}),
|
|
167
|
-
/* @__PURE__ */ o(
|
|
168
|
-
/* @__PURE__ */ o(
|
|
169
|
-
l && /* @__PURE__ */ o(
|
|
170
|
-
/* @__PURE__ */ o(
|
|
171
|
-
/* @__PURE__ */ o(
|
|
169
|
+
/* @__PURE__ */ o(No, {}),
|
|
170
|
+
/* @__PURE__ */ o(vo, {}),
|
|
171
|
+
l && /* @__PURE__ */ o(Po, { maxLength: l }),
|
|
172
|
+
/* @__PURE__ */ o(To, { storageUid: v || N }),
|
|
173
|
+
/* @__PURE__ */ o(no, { editorRef: _ })
|
|
172
174
|
]
|
|
173
175
|
}
|
|
174
176
|
) }) }),
|
|
175
|
-
m && m.length !== 0 ? /* @__PURE__ */ o("div", { className: i.sourcesBox, children: /* @__PURE__ */ o("div", { className: i.sourceList, children: m.map(
|
|
177
|
+
m && m.length !== 0 ? /* @__PURE__ */ o("div", { className: i.sourcesBox, children: /* @__PURE__ */ o("div", { className: i.sourceList, children: m.map(V) }) }) : null
|
|
176
178
|
] });
|
|
177
179
|
};
|
|
178
180
|
export {
|
|
179
|
-
|
|
181
|
+
rt as TextEditor
|
|
180
182
|
};
|