@logora/debate 0.3.90 → 0.3.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/components/argument/argument/Argument.module-QZdPjj_i.css +1 -0
- package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-DjNiVt-p.css +1 -0
- package/dist/assets/components/follow/follow_button/FollowButton.module-C9YXM8AM.css +1 -0
- package/dist/assets/components/input/text_editor/{TextEditor.module-DePSfOvG.css → TextEditor.module-CxuSL3l3.css} +1 -1
- package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-DvwCbS9k.css +1 -0
- package/dist/assets/components/navigation/tabs/Tabs.module-CFizOU1d.css +1 -0
- package/dist/assets/components/proposal/proposal_box/ProposalBox.module-Dm8XDnr1.css +1 -0
- package/dist/assets/components/section/section_box/SectionBox.module-qQs4B6bf.css +1 -0
- package/dist/assets/components/source/context_source_list/ContextSourceList.module-DUPbI-wb.css +1 -0
- package/dist/assets/components/source/source_list_item/SourceListItem.module-fm_uHuY4.css +1 -0
- package/dist/assets/components/summary/summary/Summary.module-2bnx3egy.css +1 -0
- package/dist/assets/components/summary/summary_box/SummaryBox.module-Dr9PevSJ.css +1 -0
- package/dist/assets/components/vote/vote_box/VoteBox.module-D5sSSHpi.css +1 -0
- package/dist/components/argument/argument/Argument.js +111 -106
- package/dist/components/argument/argument/Argument.module.scss.js +31 -31
- package/dist/components/auth/providers/FormAuth.js +8 -7
- package/dist/components/auth/use_auth/base64.js +4 -0
- package/dist/components/consultation/consultation_box/ConsultationBox.js +80 -111
- package/dist/components/consultation/consultation_box/ConsultationBox.module.scss.js +31 -29
- package/dist/components/dialog/dropdown/Dropdown.js +35 -28
- package/dist/components/follow/follow_button/FollowButton.js +17 -16
- package/dist/components/follow/follow_button/FollowButton.module.scss.js +6 -4
- package/dist/components/icons/bild_icons/index.js +58 -56
- package/dist/components/icons/clarin_icons/Alarm.js +6 -0
- package/dist/components/icons/clarin_icons/Announcement.js +6 -0
- package/dist/components/icons/clarin_icons/Chat.js +6 -0
- package/dist/components/icons/clarin_icons/CheckCircle.js +9 -0
- package/dist/components/icons/clarin_icons/Clock.js +6 -0
- package/dist/components/icons/clarin_icons/Follow.js +6 -0
- package/dist/components/icons/clarin_icons/MobileClose.js +9 -0
- package/dist/components/icons/clarin_icons/Question.js +6 -0
- package/dist/components/icons/clarin_icons/Search.js +6 -0
- package/dist/components/icons/clarin_icons/Send.js +10 -0
- package/dist/components/icons/clarin_icons/Share.js +6 -0
- package/dist/components/icons/clarin_icons/Upvote.js +9 -0
- package/dist/components/icons/clarin_icons/User.js +9 -0
- package/dist/components/icons/clarin_icons/index.js +106 -0
- package/dist/components/icons/hero_icons/index.js +20 -18
- package/dist/components/icons/krone_icons/index.js +48 -46
- package/dist/components/icons/regular_icons/Follow.js +6 -0
- package/dist/components/icons/regular_icons/index.js +20 -18
- 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 +54 -52
- package/dist/components/icons/stern_icons/index.js +102 -70
- package/dist/components/input/argument_input/ArgumentInput.js +201 -197
- package/dist/components/input/select/Select.js +19 -19
- package/dist/components/input/text_editor/TextEditor.js +143 -129
- package/dist/components/input/text_editor/TextEditor.module.scss.js +5 -5
- package/dist/components/input/text_editor/plugins/FocusPlugin.js +12 -8
- package/dist/components/input/text_editor/plugins/SetContentPlugin.js +13 -13
- package/dist/components/input/text_editor/plugins/SetRichContentPlugin.js +10 -10
- package/dist/components/input/text_editor/plugins/ToolbarPlugin.js +70 -72
- package/dist/components/list/paginated_list/PaginatedList.js +152 -144
- package/dist/components/list/paginated_list/action_bar/ActionBar.js +72 -61
- package/dist/components/list/paginated_list/action_bar/ActionBar.module.scss.js +18 -16
- package/dist/components/navigation/tabs/Tabs.js +85 -24
- package/dist/components/navigation/tabs/Tabs.module.scss.js +20 -10
- package/dist/components/notification/notification_menu/NotificationMenu.js +23 -22
- package/dist/components/proposal/proposal_box/ProposalBox.js +70 -59
- package/dist/components/proposal/proposal_box/ProposalBox.module.scss.js +14 -10
- package/dist/components/section/section_box/SectionBox.js +10 -10
- package/dist/components/section/section_box/SectionBox.module.scss.js +9 -9
- package/dist/components/source/context_source_box/ContextSourceBox.js +7 -7
- package/dist/components/source/context_source_list/ContextSourceList.js +10 -13
- package/dist/components/source/context_source_list/ContextSourceList.module.scss.js +14 -12
- package/dist/components/source/source_list_item/SourceListItem.js +42 -28
- package/dist/components/source/source_list_item/SourceListItem.module.scss.js +8 -6
- package/dist/components/source/source_modal/SourceModal.js +15 -15
- package/dist/components/summary/summary/Summary.js +41 -63
- package/dist/components/summary/summary/Summary.module.scss.js +10 -6
- package/dist/components/summary/summary_box/SummaryBox.module.scss.js +9 -9
- package/dist/components/vote/vote_box/VoteBox.js +122 -143
- package/dist/components/vote/vote_box/VoteBox.module.scss.js +50 -48
- package/dist/index.js +323 -319
- package/package.json +1 -1
- package/dist/assets/components/argument/argument/Argument.module-gLfNRLks.css +0 -1
- package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-BnTr5IaF.css +0 -1
- package/dist/assets/components/follow/follow_button/FollowButton.module-Da-cPgwT.css +0 -1
- package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-pxwFC_Y2.css +0 -1
- package/dist/assets/components/navigation/tabs/Tabs.module-CtDi0tAd.css +0 -1
- package/dist/assets/components/proposal/proposal_box/ProposalBox.module-T4ms_LQ7.css +0 -1
- package/dist/assets/components/section/section_box/SectionBox.module-DUeUtdWr.css +0 -1
- package/dist/assets/components/source/context_source_list/ContextSourceList.module-D6X_0dB7.css +0 -1
- package/dist/assets/components/source/source_list_item/SourceListItem.module-mTxHhXPV.css +0 -1
- package/dist/assets/components/summary/summary/Summary.module-DjfmUlkW.css +0 -1
- package/dist/assets/components/summary/summary_box/SummaryBox.module-DQVkA8l7.css +0 -1
- package/dist/assets/components/vote/vote_box/VoteBox.module-CDrqb2SZ.css +0 -1
|
@@ -1,80 +1,78 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { $isListNode as R, ListNode as
|
|
3
|
-
import { useLexicalComposerContext as
|
|
4
|
-
import { $isHeadingNode as q, $createQuoteNode as
|
|
5
|
-
import { $setBlocksType as
|
|
6
|
-
import { $getNearestNodeOfType as
|
|
7
|
-
import
|
|
8
|
-
import { $getSelection as
|
|
9
|
-
import { useRef as
|
|
1
|
+
import { jsxs as N, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { $isListNode as R, ListNode as w, INSERT_ORDERED_LIST_COMMAND as B, REMOVE_LIST_COMMAND as D } from "@lexical/list";
|
|
3
|
+
import { useLexicalComposerContext as $ } from "@lexical/react/LexicalComposerContext";
|
|
4
|
+
import { $isHeadingNode as q, $createQuoteNode as K } from "@lexical/rich-text";
|
|
5
|
+
import { $setBlocksType as M } from "@lexical/selection";
|
|
6
|
+
import { $getNearestNodeOfType as F, mergeRegister as U } from "@lexical/utils";
|
|
7
|
+
import a from "classnames";
|
|
8
|
+
import { $getSelection as g, $isRangeSelection as P, SELECTION_CHANGE_COMMAND as j, FORMAT_TEXT_COMMAND as h, $createParagraphNode as H } from "lexical";
|
|
9
|
+
import { useRef as Q, useState as c, useCallback as G, useEffect as V } from "react";
|
|
10
10
|
import { useIntl as X } from "react-intl";
|
|
11
11
|
import e from "./ToolbarPlugin.module.scss.js";
|
|
12
12
|
import { Icon as s } from "../../../icons/icon/Icon.js";
|
|
13
13
|
import { Button as z } from "../../../action/button/Button.js";
|
|
14
|
-
const
|
|
15
|
-
const n = X(),
|
|
16
|
-
const
|
|
17
|
-
if (
|
|
18
|
-
const d =
|
|
19
|
-
if (
|
|
20
|
-
if (
|
|
21
|
-
const
|
|
22
|
-
|
|
14
|
+
const me = (l) => {
|
|
15
|
+
const n = X(), y = 1, [o] = $(), C = Q(null), [m, f] = c("paragraph"), [J, T] = c(null), [k, I] = c(!1), [x, A] = c(!1), [S, E] = c(!1), p = l.hideSubmit && l.hideSourceAction && l.disableRichText, b = G(() => {
|
|
16
|
+
const i = g();
|
|
17
|
+
if (P(i)) {
|
|
18
|
+
const d = i.anchor.getNode(), r = d.getKey() === "root" ? d : d.getTopLevelElementOrThrow(), _ = r.getKey();
|
|
19
|
+
if (o.getElementByKey(_) !== null)
|
|
20
|
+
if (T(_), R(r)) {
|
|
21
|
+
const u = F(d, w), O = u ? u.getTag() : r.getTag();
|
|
22
|
+
f(O);
|
|
23
23
|
} else {
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const u = q(r) ? r.getTag() : r.getType();
|
|
25
|
+
f(u);
|
|
26
26
|
}
|
|
27
|
-
I(
|
|
27
|
+
I(i.hasFormat("bold")), A(i.hasFormat("italic")), E(i.hasFormat("underline"));
|
|
28
28
|
}
|
|
29
|
-
}, [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
}, [o]);
|
|
30
|
+
V(() => U(
|
|
31
|
+
o.registerUpdateListener(({ editorState: i }) => {
|
|
32
|
+
i.read(() => {
|
|
33
|
+
b();
|
|
34
34
|
});
|
|
35
35
|
}),
|
|
36
|
-
|
|
36
|
+
o.registerCommand(
|
|
37
37
|
j,
|
|
38
|
-
(
|
|
39
|
-
|
|
38
|
+
(i, d) => (b(), !1),
|
|
39
|
+
y
|
|
40
40
|
)
|
|
41
|
-
), [
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const a = b();
|
|
52
|
-
y(a, () => F());
|
|
41
|
+
), [o, b]);
|
|
42
|
+
const L = () => {
|
|
43
|
+
m !== "ol" ? o.dispatchCommand(B) : o.dispatchCommand(D);
|
|
44
|
+
}, v = () => {
|
|
45
|
+
m !== "quote" ? o.update(() => {
|
|
46
|
+
const i = g();
|
|
47
|
+
M(i, () => K());
|
|
48
|
+
}) : o.update(() => {
|
|
49
|
+
const i = g();
|
|
50
|
+
M(i, () => H());
|
|
53
51
|
});
|
|
54
52
|
};
|
|
55
|
-
return p ? null : /* @__PURE__ */
|
|
53
|
+
return p ? null : /* @__PURE__ */ N(
|
|
56
54
|
"div",
|
|
57
55
|
{
|
|
58
|
-
className:
|
|
59
|
-
[e.toolbarIsActive]: p ? !1 :
|
|
56
|
+
className: a(e.toolbar, {
|
|
57
|
+
[e.toolbarIsActive]: p ? !1 : l.isActive
|
|
60
58
|
}),
|
|
61
|
-
ref:
|
|
59
|
+
ref: C,
|
|
62
60
|
children: [
|
|
63
|
-
|
|
61
|
+
l.isActive ? !l.disableRichText && /* @__PURE__ */ N(
|
|
64
62
|
"div",
|
|
65
63
|
{
|
|
66
|
-
className:
|
|
67
|
-
[e.shortBar]:
|
|
64
|
+
className: a(e.iconToolbar, {
|
|
65
|
+
[e.shortBar]: l.shortBar
|
|
68
66
|
}),
|
|
69
67
|
children: [
|
|
70
68
|
/* @__PURE__ */ t(
|
|
71
69
|
"button",
|
|
72
70
|
{
|
|
73
71
|
onClick: () => {
|
|
74
|
-
|
|
72
|
+
o.dispatchCommand(h, "bold");
|
|
75
73
|
},
|
|
76
74
|
type: "button",
|
|
77
|
-
className:
|
|
75
|
+
className: a(e.toolbarItem, { [e.active]: k }),
|
|
78
76
|
"data-testid": "format-bold",
|
|
79
77
|
"aria-label": n.formatMessage({
|
|
80
78
|
id: "input.text_editor.plugins.toolbar_plugin.bold.aria_label",
|
|
@@ -86,7 +84,7 @@ const ce = (i) => {
|
|
|
86
84
|
name: "bold",
|
|
87
85
|
width: 24,
|
|
88
86
|
height: 24,
|
|
89
|
-
className:
|
|
87
|
+
className: a(e.format, e.bold)
|
|
90
88
|
}
|
|
91
89
|
)
|
|
92
90
|
}
|
|
@@ -95,11 +93,11 @@ const ce = (i) => {
|
|
|
95
93
|
"button",
|
|
96
94
|
{
|
|
97
95
|
onClick: () => {
|
|
98
|
-
|
|
96
|
+
o.dispatchCommand(h, "italic");
|
|
99
97
|
},
|
|
100
98
|
type: "button",
|
|
101
|
-
className:
|
|
102
|
-
[e.active]:
|
|
99
|
+
className: a(e.toolbarItem, {
|
|
100
|
+
[e.active]: x
|
|
103
101
|
}),
|
|
104
102
|
"aria-label": n.formatMessage({
|
|
105
103
|
id: "input.text_editor.plugins.toolbar_plugin.italic.aria_label",
|
|
@@ -111,7 +109,7 @@ const ce = (i) => {
|
|
|
111
109
|
name: "italic",
|
|
112
110
|
width: 24,
|
|
113
111
|
height: 24,
|
|
114
|
-
className:
|
|
112
|
+
className: a(e.format, e.italic)
|
|
115
113
|
}
|
|
116
114
|
)
|
|
117
115
|
}
|
|
@@ -120,11 +118,11 @@ const ce = (i) => {
|
|
|
120
118
|
"button",
|
|
121
119
|
{
|
|
122
120
|
onClick: () => {
|
|
123
|
-
|
|
121
|
+
o.dispatchCommand(h, "underline");
|
|
124
122
|
},
|
|
125
123
|
type: "button",
|
|
126
|
-
className:
|
|
127
|
-
[e.active]:
|
|
124
|
+
className: a(e.toolbarItem, {
|
|
125
|
+
[e.active]: S
|
|
128
126
|
}),
|
|
129
127
|
"aria-label": n.formatMessage({
|
|
130
128
|
id: "input.text_editor.plugins.toolbar_plugin.underline.aria_label",
|
|
@@ -136,7 +134,7 @@ const ce = (i) => {
|
|
|
136
134
|
name: "underline",
|
|
137
135
|
width: 24,
|
|
138
136
|
height: 24,
|
|
139
|
-
className:
|
|
137
|
+
className: a(e.format, e.underline)
|
|
140
138
|
}
|
|
141
139
|
)
|
|
142
140
|
}
|
|
@@ -144,9 +142,9 @@ const ce = (i) => {
|
|
|
144
142
|
/* @__PURE__ */ t(
|
|
145
143
|
"button",
|
|
146
144
|
{
|
|
147
|
-
onClick: () =>
|
|
145
|
+
onClick: () => v(),
|
|
148
146
|
type: "button",
|
|
149
|
-
className: e.toolbarItem,
|
|
147
|
+
className: a(e.toolbarItem, { [e.active]: m === "quote" }),
|
|
150
148
|
"aria-label": n.formatMessage({
|
|
151
149
|
id: "input.text_editor.plugins.toolbar_plugin.blockquote.aria_label",
|
|
152
150
|
defaultMessage: "Add a blockquote"
|
|
@@ -157,7 +155,7 @@ const ce = (i) => {
|
|
|
157
155
|
name: "blockquote",
|
|
158
156
|
width: 24,
|
|
159
157
|
height: 24,
|
|
160
|
-
className:
|
|
158
|
+
className: a(e.format, e.quote)
|
|
161
159
|
}
|
|
162
160
|
)
|
|
163
161
|
}
|
|
@@ -165,9 +163,9 @@ const ce = (i) => {
|
|
|
165
163
|
/* @__PURE__ */ t(
|
|
166
164
|
"button",
|
|
167
165
|
{
|
|
168
|
-
onClick: () =>
|
|
166
|
+
onClick: () => L(),
|
|
169
167
|
type: "button",
|
|
170
|
-
className: e.toolbarItem,
|
|
168
|
+
className: a(e.toolbarItem, { [e.active]: m === "ol" }),
|
|
171
169
|
"aria-label": n.formatMessage({
|
|
172
170
|
id: "input.text_editor.plugins.toolbar_plugin.numbered_list.aria_label",
|
|
173
171
|
defaultMessage: "Insert a numbered list"
|
|
@@ -178,15 +176,15 @@ const ce = (i) => {
|
|
|
178
176
|
name: "orderedList",
|
|
179
177
|
width: 24,
|
|
180
178
|
height: 24,
|
|
181
|
-
className:
|
|
179
|
+
className: a(e.format, e.numberedList)
|
|
182
180
|
}
|
|
183
181
|
)
|
|
184
182
|
}
|
|
185
183
|
),
|
|
186
|
-
!
|
|
184
|
+
!l.hideSourceAction && /* @__PURE__ */ t(
|
|
187
185
|
"button",
|
|
188
186
|
{
|
|
189
|
-
onClick:
|
|
187
|
+
onClick: l.onAddSource,
|
|
190
188
|
type: "button",
|
|
191
189
|
className: e.toolbarItem,
|
|
192
190
|
"aria-label": n.formatMessage({
|
|
@@ -199,7 +197,7 @@ const ce = (i) => {
|
|
|
199
197
|
name: "link",
|
|
200
198
|
width: 20,
|
|
201
199
|
height: 20,
|
|
202
|
-
className:
|
|
200
|
+
className: a(e.format, e.link)
|
|
203
201
|
}
|
|
204
202
|
)
|
|
205
203
|
}
|
|
@@ -207,13 +205,13 @@ const ce = (i) => {
|
|
|
207
205
|
]
|
|
208
206
|
}
|
|
209
207
|
) : null,
|
|
210
|
-
/* @__PURE__ */ t("div", { className: e.actionButton, children:
|
|
208
|
+
/* @__PURE__ */ t("div", { className: e.actionButton, children: l.hideSubmit ? null : /* @__PURE__ */ t(
|
|
211
209
|
z,
|
|
212
210
|
{
|
|
213
211
|
type: "button",
|
|
214
212
|
"data-testid": "submit-button",
|
|
215
|
-
handleClick:
|
|
216
|
-
className:
|
|
213
|
+
handleClick: l.onSubmit,
|
|
214
|
+
className: a(e.inputSubmitActionButton, e.submitAction),
|
|
217
215
|
"aria-label": n.formatMessage({
|
|
218
216
|
id: "input.text_editor.plugins.toolbar_plugin.submit_button.aria_label",
|
|
219
217
|
defaultMessage: "Send message"
|
|
@@ -226,5 +224,5 @@ const ce = (i) => {
|
|
|
226
224
|
);
|
|
227
225
|
};
|
|
228
226
|
export {
|
|
229
|
-
|
|
227
|
+
me as ToolbarPlugin
|
|
230
228
|
};
|