@logora/debate 0.3.8 → 0.3.10
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/argument/argument/Argument.module-gLfNRLks.css +1 -0
- package/dist/assets/components/dialog/dropdown/Dropdown.module-B6DdHxbY.css +1 -0
- package/dist/assets/components/gamification/point_box/PointBox.module-BlHdQyht.css +1 -0
- package/dist/assets/components/vote/vote_box/VoteBox.module-Dss3uPgM.css +1 -0
- package/dist/assets/components/vote/vote_button/VoteButton.module-BdTTr7vk.css +1 -0
- package/dist/components/argument/argument/Argument.js +15 -15
- package/dist/components/argument/argument/Argument.module.scss.js +30 -30
- package/dist/components/dialog/dropdown/Dropdown.module.scss.js +1 -1
- package/dist/components/gamification/point_box/PointBox.module.scss.js +1 -1
- package/dist/components/icons/bild_icons/index.js +102 -104
- package/dist/components/icons/hero_icons/index.js +66 -68
- package/dist/components/icons/krone_icons/index.js +98 -100
- package/dist/components/icons/regular_icons/index.js +22 -24
- package/dist/components/icons/spiegel_icons/index.js +100 -102
- package/dist/components/input/text_editor/TextEditor.js +108 -108
- package/dist/components/vote/vote_box/VoteBox.js +113 -121
- package/dist/components/vote/vote_box/VoteBox.module.scss.js +54 -50
- package/dist/components/vote/vote_button/VoteButton.module.scss.js +2 -2
- package/package.json +15 -14
- package/dist/assets/components/argument/argument/Argument.module-ynS4ZRdG.css +0 -1
- package/dist/assets/components/dialog/dropdown/Dropdown.module-BL67cFpj.css +0 -1
- package/dist/assets/components/gamification/point_box/PointBox.module-BzKRidYf.css +0 -1
- package/dist/assets/components/vote/vote_box/VoteBox.module-BhTSjU8w.css +0 -1
- package/dist/assets/components/vote/vote_button/VoteButton.module-mxq12D3_.css +0 -1
- package/dist/components/icons/bild_icons/Alarm.js +0 -13
- package/dist/components/icons/bild_icons/Announcement.js +0 -15
- package/dist/components/icons/bild_icons/Arrow.js +0 -6
- package/dist/components/icons/bild_icons/Blockquote.js +0 -6
- package/dist/components/icons/bild_icons/Bold.js +0 -6
- package/dist/components/icons/bild_icons/Camera.js +0 -9
- package/dist/components/icons/bild_icons/CheckCircle.js +0 -22
- package/dist/components/icons/bild_icons/Checkbox.js +0 -9
- package/dist/components/icons/bild_icons/Clock.js +0 -6
- package/dist/components/icons/bild_icons/Close.js +0 -6
- package/dist/components/icons/bild_icons/Code.js +0 -36
- package/dist/components/icons/bild_icons/Community.js +0 -6
- package/dist/components/icons/bild_icons/Document.js +0 -6
- package/dist/components/icons/bild_icons/Downvote.js +0 -6
- package/dist/components/icons/bild_icons/Facebook.js +0 -6
- package/dist/components/icons/bild_icons/Flag.js +0 -6
- package/dist/components/icons/bild_icons/Home.js +0 -6
- package/dist/components/icons/bild_icons/Italic.js +0 -6
- package/dist/components/icons/bild_icons/Link.js +0 -9
- package/dist/components/icons/bild_icons/Logora.js +0 -56
- package/dist/components/icons/bild_icons/Mail.js +0 -6
- package/dist/components/icons/bild_icons/MinusCircle.js +0 -21
- package/dist/components/icons/bild_icons/MobileMenu.js +0 -29
- package/dist/components/icons/bild_icons/Next.js +0 -23
- package/dist/components/icons/bild_icons/OpenBlank.js +0 -21
- package/dist/components/icons/bild_icons/OrderedList.js +0 -6
- package/dist/components/icons/bild_icons/Point.js +0 -25
- package/dist/components/icons/bild_icons/Question.js +0 -15
- package/dist/components/icons/bild_icons/Refresh.js +0 -9
- package/dist/components/icons/bild_icons/Reply.js +0 -9
- package/dist/components/icons/bild_icons/Search.js +0 -6
- package/dist/components/icons/bild_icons/Send.js +0 -6
- package/dist/components/icons/bild_icons/Share.js +0 -15
- package/dist/components/icons/bild_icons/SmallArrow.js +0 -6
- package/dist/components/icons/bild_icons/Source.js +0 -6
- package/dist/components/icons/bild_icons/Suggestion.js +0 -25
- package/dist/components/icons/bild_icons/Twitter.js +0 -44
- package/dist/components/icons/bild_icons/Underline.js +0 -6
- package/dist/components/icons/bild_icons/Upvote.js +0 -6
- package/dist/components/icons/bild_icons/User.js +0 -6
- package/dist/components/icons/bild_icons/Versus.js +0 -12
- package/dist/components/icons/bild_icons/Votebox.js +0 -15
- package/dist/components/icons/hero_icons/CheckCircle.js +0 -22
- package/dist/components/icons/hero_icons/Facebook.js +0 -6
- package/dist/components/icons/hero_icons/Flag.js +0 -6
- package/dist/components/icons/hero_icons/Logora.js +0 -56
- package/dist/components/icons/hero_icons/MinusCircle.js +0 -21
- package/dist/components/icons/hero_icons/Point.js +0 -25
- package/dist/components/icons/hero_icons/Twitter.js +0 -44
- package/dist/components/icons/hero_icons/Versus.js +0 -24
- package/dist/components/icons/krone_icons/Arrow.js +0 -6
- package/dist/components/icons/krone_icons/Blockquote.js +0 -6
- package/dist/components/icons/krone_icons/Bold.js +0 -6
- package/dist/components/icons/krone_icons/Camera.js +0 -9
- package/dist/components/icons/krone_icons/Check.js +0 -6
- package/dist/components/icons/krone_icons/CheckCircle.js +0 -22
- package/dist/components/icons/krone_icons/Clock.js +0 -6
- package/dist/components/icons/krone_icons/Close.js +0 -6
- package/dist/components/icons/krone_icons/Code.js +0 -36
- package/dist/components/icons/krone_icons/Community.js +0 -6
- package/dist/components/icons/krone_icons/Crown.js +0 -6
- package/dist/components/icons/krone_icons/Document.js +0 -6
- package/dist/components/icons/krone_icons/Downvote.js +0 -6
- package/dist/components/icons/krone_icons/Facebook.js +0 -6
- package/dist/components/icons/krone_icons/Flag.js +0 -6
- package/dist/components/icons/krone_icons/Italic.js +0 -6
- package/dist/components/icons/krone_icons/LightArrow.js +0 -6
- package/dist/components/icons/krone_icons/Link.js +0 -9
- package/dist/components/icons/krone_icons/Login.js +0 -30
- package/dist/components/icons/krone_icons/Logora.js +0 -56
- package/dist/components/icons/krone_icons/Mail.js +0 -6
- package/dist/components/icons/krone_icons/MinusCircle.js +0 -21
- package/dist/components/icons/krone_icons/MobileClose.js +0 -15
- package/dist/components/icons/krone_icons/MobileMenu.js +0 -29
- package/dist/components/icons/krone_icons/Next.js +0 -23
- package/dist/components/icons/krone_icons/OpenBlank.js +0 -21
- package/dist/components/icons/krone_icons/OrderedList.js +0 -6
- package/dist/components/icons/krone_icons/PauseCircle.js +0 -22
- package/dist/components/icons/krone_icons/Point.js +0 -25
- package/dist/components/icons/krone_icons/Refresh.js +0 -9
- package/dist/components/icons/krone_icons/Search.js +0 -6
- package/dist/components/icons/krone_icons/SmallArrow.js +0 -6
- package/dist/components/icons/krone_icons/Source.js +0 -6
- package/dist/components/icons/krone_icons/Twitter.js +0 -44
- package/dist/components/icons/krone_icons/Underline.js +0 -6
- package/dist/components/icons/krone_icons/Versus.js +0 -6
- package/dist/components/icons/regular_icons/Versus.js +0 -6
- package/dist/components/icons/spiegel_icons/Alarm.js +0 -13
- package/dist/components/icons/spiegel_icons/Announcement.js +0 -15
- package/dist/components/icons/spiegel_icons/Arrow.js +0 -6
- package/dist/components/icons/spiegel_icons/Camera.js +0 -9
- package/dist/components/icons/spiegel_icons/Check.js +0 -6
- package/dist/components/icons/spiegel_icons/Code.js +0 -36
- package/dist/components/icons/spiegel_icons/Community.js +0 -6
- package/dist/components/icons/spiegel_icons/Downvote.js +0 -6
- package/dist/components/icons/spiegel_icons/Home.js +0 -6
- package/dist/components/icons/spiegel_icons/Logora.js +0 -56
- package/dist/components/icons/spiegel_icons/MobileMenu.js +0 -29
- package/dist/components/icons/spiegel_icons/Next.js +0 -23
- package/dist/components/icons/spiegel_icons/OpenBlank.js +0 -21
- package/dist/components/icons/spiegel_icons/Point.js +0 -25
- package/dist/components/icons/spiegel_icons/Refresh.js +0 -9
- package/dist/components/icons/spiegel_icons/Search.js +0 -6
- package/dist/components/icons/spiegel_icons/Send.js +0 -6
- package/dist/components/icons/spiegel_icons/Source.js +0 -6
- package/dist/components/icons/spiegel_icons/Twitter.js +0 -44
- package/dist/components/icons/spiegel_icons/Upvote.js +0 -6
- package/dist/components/icons/spiegel_icons/User.js +0 -6
- package/dist/components/icons/spiegel_icons/Versus.js +0 -12
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
import { jsxs 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
|
|
17
|
-
import { useIntl as
|
|
18
|
-
import
|
|
1
|
+
import { jsxs as u, Fragment as X, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { ListNode as Y, ListItemNode as Z } from "@lexical/list";
|
|
3
|
+
import { OverflowNode as tt } from "@lexical/overflow";
|
|
4
|
+
import { CharacterLimitPlugin as ot } from "@lexical/react/LexicalCharacterLimitPlugin";
|
|
5
|
+
import { LexicalComposer as et } from "@lexical/react/LexicalComposer";
|
|
6
|
+
import { ContentEditable as rt } from "@lexical/react/LexicalContentEditable";
|
|
7
|
+
import { EditorRefPlugin as it } from "@lexical/react/LexicalEditorRefPlugin";
|
|
8
|
+
import { LexicalErrorBoundary as nt } from "@lexical/react/LexicalErrorBoundary";
|
|
9
|
+
import { HistoryPlugin as st } from "@lexical/react/LexicalHistoryPlugin";
|
|
10
|
+
import { ListPlugin as lt } from "@lexical/react/LexicalListPlugin";
|
|
11
|
+
import { OnChangePlugin as ct } from "@lexical/react/LexicalOnChangePlugin";
|
|
12
|
+
import { RichTextPlugin as mt } from "@lexical/react/LexicalRichTextPlugin";
|
|
13
|
+
import { QuoteNode as at } from "@lexical/rich-text";
|
|
14
|
+
import I from "classnames";
|
|
15
|
+
import { $getRoot as dt } from "lexical";
|
|
16
|
+
import { useState as a, useId as ft, useEffect as b } from "react";
|
|
17
|
+
import { useIntl as ut } from "react-intl";
|
|
18
|
+
import pt from "./EditorTheme.js";
|
|
19
19
|
import e from "./TextEditor.module.scss.js";
|
|
20
|
-
import { AutoSavePlugin as
|
|
21
|
-
import { FocusPlugin as
|
|
22
|
-
import { MaxLengthPlugin as
|
|
23
|
-
import { ResetPlugin as
|
|
24
|
-
import { SetContentPlugin as
|
|
25
|
-
import { SetRichContentPlugin as
|
|
26
|
-
import { ToolbarPlugin as
|
|
27
|
-
import { useModal as
|
|
28
|
-
import { SourceModal as
|
|
20
|
+
import { AutoSavePlugin as ht } from "./plugins/AutoSavePlugin.js";
|
|
21
|
+
import { FocusPlugin as gt } from "./plugins/FocusPlugin.js";
|
|
22
|
+
import { MaxLengthPlugin as xt } from "./plugins/MaxLengthPlugin.js";
|
|
23
|
+
import { ResetPlugin as St } from "./plugins/ResetPlugin.js";
|
|
24
|
+
import { SetContentPlugin as Ct } from "./plugins/SetContentPlugin.js";
|
|
25
|
+
import { SetRichContentPlugin as Pt } from "./plugins/SetRichContentPlugin.js";
|
|
26
|
+
import { ToolbarPlugin as Tt } from "./plugins/ToolbarPlugin.js";
|
|
27
|
+
import { useModal as vt } from "../../dialog/modal/useModal.js";
|
|
28
|
+
import { SourceModal as Nt } from "../../source/source_modal/SourceModal.js";
|
|
29
29
|
import { SourceListItem as Et } from "../../source/source_list_item/SourceListItem.js";
|
|
30
|
-
const
|
|
31
|
-
placeholder:
|
|
32
|
-
onSubmit:
|
|
30
|
+
const M = (l) => l?.replace(/ /g, " "), to = ({
|
|
31
|
+
placeholder: l,
|
|
32
|
+
onSubmit: p,
|
|
33
33
|
sources: r,
|
|
34
|
-
hideSubmit:
|
|
35
|
-
hideSourceAction:
|
|
36
|
-
onActivation:
|
|
37
|
-
disabled:
|
|
38
|
-
handleChange:
|
|
39
|
-
handleSourcesChange:
|
|
40
|
-
shortBar:
|
|
34
|
+
hideSubmit: y = !1,
|
|
35
|
+
hideSourceAction: R = !1,
|
|
36
|
+
onActivation: h,
|
|
37
|
+
disabled: w = !1,
|
|
38
|
+
handleChange: g,
|
|
39
|
+
handleSourcesChange: x,
|
|
40
|
+
shortBar: A = !1,
|
|
41
41
|
active: S = !1,
|
|
42
|
-
maxLength:
|
|
43
|
-
disableRichText:
|
|
44
|
-
editorRef:
|
|
45
|
-
uid:
|
|
46
|
-
allowedDomains:
|
|
47
|
-
hideCharCount:
|
|
48
|
-
disableAutoActivate:
|
|
49
|
-
...
|
|
42
|
+
maxLength: c,
|
|
43
|
+
disableRichText: L = !1,
|
|
44
|
+
editorRef: _,
|
|
45
|
+
uid: C,
|
|
46
|
+
allowedDomains: P = [],
|
|
47
|
+
hideCharCount: B = !1,
|
|
48
|
+
disableAutoActivate: F = !1,
|
|
49
|
+
...O
|
|
50
50
|
}) => {
|
|
51
|
-
const [n,
|
|
52
|
-
|
|
53
|
-
r && r.length > 0 &&
|
|
54
|
-
}, [r]),
|
|
55
|
-
|
|
51
|
+
const [n, U] = a(!1), [j, k] = a(""), [z, H] = a(""), [s, d] = a([]), { showModal: J } = vt(), T = ut(), v = ft();
|
|
52
|
+
b(() => {
|
|
53
|
+
r && r.length > 0 && d(r);
|
|
54
|
+
}, [r]), b(() => {
|
|
55
|
+
x && s.length > 0 && x(s);
|
|
56
56
|
}, [s]);
|
|
57
|
-
const
|
|
58
|
-
n || (
|
|
59
|
-
},
|
|
60
|
-
editable: !
|
|
61
|
-
theme:
|
|
57
|
+
const N = () => {
|
|
58
|
+
n || (U(!0), h && h());
|
|
59
|
+
}, Q = {
|
|
60
|
+
editable: !w,
|
|
61
|
+
theme: pt,
|
|
62
62
|
onError(o) {
|
|
63
63
|
console.error("TextEditor error:", o);
|
|
64
64
|
},
|
|
65
|
-
nodes: [
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
},
|
|
65
|
+
nodes: [Y, Z, at, tt]
|
|
66
|
+
}, W = () => {
|
|
67
|
+
N();
|
|
68
|
+
}, $ = (o) => {
|
|
69
69
|
o.read(() => {
|
|
70
|
-
const i =
|
|
71
|
-
|
|
70
|
+
const i = dt().getTextContent(), m = M(i), f = JSON.stringify(o), E = M(f);
|
|
71
|
+
k(m), H(E), g && g(m, E);
|
|
72
72
|
});
|
|
73
|
-
},
|
|
74
|
-
const i =
|
|
75
|
-
|
|
76
|
-
},
|
|
77
|
-
|
|
73
|
+
}, q = (o) => {
|
|
74
|
+
const i = j, m = z, f = s;
|
|
75
|
+
p && (o.preventDefault(), p(i, m, f)), d([]);
|
|
76
|
+
}, D = () => {
|
|
77
|
+
J(
|
|
78
78
|
/* @__PURE__ */ t(
|
|
79
|
-
|
|
79
|
+
Nt,
|
|
80
80
|
{
|
|
81
|
-
onAddSource:
|
|
82
|
-
allowedSources:
|
|
81
|
+
onAddSource: G,
|
|
82
|
+
allowedSources: P
|
|
83
83
|
}
|
|
84
84
|
)
|
|
85
85
|
);
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
},
|
|
86
|
+
}, G = (o) => {
|
|
87
|
+
d([...s, o]);
|
|
88
|
+
}, K = (o, i) => /* @__PURE__ */ t(
|
|
89
89
|
Et,
|
|
90
90
|
{
|
|
91
91
|
publisher: o.publisher,
|
|
@@ -94,78 +94,78 @@ const Yt = ({
|
|
|
94
94
|
index: i
|
|
95
95
|
},
|
|
96
96
|
i
|
|
97
|
-
),
|
|
98
|
-
return /* @__PURE__ */
|
|
99
|
-
/* @__PURE__ */ t(
|
|
97
|
+
), V = () => /* @__PURE__ */ t("div", { className: e.editorPlaceholder, children: l });
|
|
98
|
+
return /* @__PURE__ */ u(X, { children: [
|
|
99
|
+
/* @__PURE__ */ t(et, { initialConfig: Q, children: /* @__PURE__ */ t("div", { className: e.editorContainer, onClick: W, children: /* @__PURE__ */ u(
|
|
100
100
|
"div",
|
|
101
101
|
{
|
|
102
|
-
className:
|
|
102
|
+
className: I(e.editorInner, {
|
|
103
103
|
[e.editorInnerInactive]: !n && !S
|
|
104
104
|
}),
|
|
105
105
|
children: [
|
|
106
106
|
/* @__PURE__ */ t(
|
|
107
|
-
|
|
107
|
+
mt,
|
|
108
108
|
{
|
|
109
109
|
contentEditable: /* @__PURE__ */ t(
|
|
110
|
-
|
|
110
|
+
rt,
|
|
111
111
|
{
|
|
112
|
-
className:
|
|
112
|
+
className: I(e.editorInput, {
|
|
113
113
|
[e.editorInputInactive]: !n
|
|
114
114
|
}),
|
|
115
|
-
...
|
|
115
|
+
...O
|
|
116
116
|
}
|
|
117
117
|
),
|
|
118
|
-
placeholder:
|
|
119
|
-
ErrorBoundary:
|
|
118
|
+
placeholder: l && /* @__PURE__ */ t(V, {}),
|
|
119
|
+
ErrorBoundary: nt
|
|
120
120
|
}
|
|
121
121
|
),
|
|
122
122
|
/* @__PURE__ */ t(
|
|
123
|
-
|
|
123
|
+
Tt,
|
|
124
124
|
{
|
|
125
|
-
hideSourceAction:
|
|
126
|
-
hideSubmit:
|
|
127
|
-
disableRichText:
|
|
128
|
-
shortBar:
|
|
129
|
-
onSubmit:
|
|
130
|
-
onAddSource:
|
|
125
|
+
hideSourceAction: R,
|
|
126
|
+
hideSubmit: y,
|
|
127
|
+
disableRichText: L,
|
|
128
|
+
shortBar: A,
|
|
129
|
+
onSubmit: q,
|
|
130
|
+
onAddSource: D,
|
|
131
131
|
isActive: n || S,
|
|
132
|
-
sourceTooltip:
|
|
132
|
+
sourceTooltip: P?.length > 0 && T.formatMessage({
|
|
133
133
|
id: "input.allowed_domains_tooltip",
|
|
134
134
|
defaultMessage: "With the new source function, you can add links to your article."
|
|
135
135
|
})
|
|
136
136
|
}
|
|
137
137
|
),
|
|
138
|
-
n &&
|
|
139
|
-
/* @__PURE__ */ t(
|
|
138
|
+
n && c && !B && /* @__PURE__ */ u("div", { className: e.charactersCount, children: [
|
|
139
|
+
/* @__PURE__ */ t(ot, { maxLength: c }),
|
|
140
140
|
" ",
|
|
141
|
-
|
|
141
|
+
T.formatMessage({
|
|
142
142
|
id: "input.remaining_chars",
|
|
143
143
|
defaultMessage: "remaining characters"
|
|
144
144
|
})
|
|
145
145
|
] }),
|
|
146
|
-
/* @__PURE__ */ t(
|
|
147
|
-
/* @__PURE__ */ t(
|
|
148
|
-
/* @__PURE__ */ t(
|
|
146
|
+
/* @__PURE__ */ t(lt, {}),
|
|
147
|
+
/* @__PURE__ */ t(st, {}),
|
|
148
|
+
/* @__PURE__ */ t(ct, { onChange: $, ignoreSelectionChange: !0 }),
|
|
149
149
|
/* @__PURE__ */ t(
|
|
150
|
-
|
|
150
|
+
ht,
|
|
151
151
|
{
|
|
152
|
-
onSetContent:
|
|
153
|
-
} :
|
|
154
|
-
storageUid:
|
|
152
|
+
onSetContent: F ? () => {
|
|
153
|
+
} : N,
|
|
154
|
+
storageUid: C || v
|
|
155
155
|
}
|
|
156
156
|
),
|
|
157
|
-
/* @__PURE__ */ t(
|
|
158
|
-
/* @__PURE__ */ t(
|
|
159
|
-
/* @__PURE__ */ t(
|
|
160
|
-
|
|
161
|
-
/* @__PURE__ */ t(
|
|
162
|
-
/* @__PURE__ */ t(
|
|
157
|
+
/* @__PURE__ */ t(Ct, {}),
|
|
158
|
+
/* @__PURE__ */ t(Pt, {}),
|
|
159
|
+
/* @__PURE__ */ t(gt, {}),
|
|
160
|
+
c && /* @__PURE__ */ t(xt, { maxLength: c }),
|
|
161
|
+
/* @__PURE__ */ t(St, { storageUid: C || v }),
|
|
162
|
+
/* @__PURE__ */ t(it, { editorRef: _ })
|
|
163
163
|
]
|
|
164
164
|
}
|
|
165
165
|
) }) }),
|
|
166
|
-
r && r.length !== 0 ? /* @__PURE__ */ t("div", { className: e.sourcesBox, children: /* @__PURE__ */ t("div", { className: e.sourceList, children: r.map(
|
|
166
|
+
r && r.length !== 0 ? /* @__PURE__ */ t("div", { className: e.sourcesBox, children: /* @__PURE__ */ t("div", { className: e.sourceList, children: r.map(K) }) }) : null
|
|
167
167
|
] });
|
|
168
168
|
};
|
|
169
169
|
export {
|
|
170
|
-
|
|
170
|
+
to as TextEditor
|
|
171
171
|
};
|