@logora/debate 0.3.111 → 0.3.113
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/navigation/tabs/Tabs.module-B4sJ1pVW.css +1 -0
- package/dist/components/input/text_editor/plugins/ToolbarPlugin.js +86 -78
- package/dist/components/navigation/tabs/Tabs.module.scss.js +15 -15
- package/package.json +1 -1
- package/dist/assets/components/navigation/tabs/Tabs.module-DvCQQR63.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._tabsWrapper_1ur7i_3{position:relative;display:flex;align-items:stretch;width:100%;max-width:100%}._navTabs_1ur7i_11{display:flex;flex-wrap:nowrap;gap:var(--spacer-xs, calc(var(--space-unit, 1em) * .325));white-space:nowrap;padding-left:0;margin-top:0;margin-bottom:0;border-bottom:none!important;list-style:none;flex:1}@container (max-width: 575.98px){._navTabs_1ur7i_11{font-size:var(--font-size-normal, 16px);gap:var(--space-unit, 1em)}}._navTabs_1ur7i_11{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:none}._navTabs_1ur7i_11::-webkit-scrollbar{display:none}._arrow_1ur7i_39{position:absolute;top:0;bottom:0;z-index:2;display:flex;align-items:center;justify-content:center;border:none;cursor:pointer;padding:0;transition:opacity .2s ease;outline:none;background-color:#fff!important;line-height:0}._arrow_1ur7i_39 svg{display:block}._arrow_1ur7i_39:focus-visible{outline:2px solid var(--call-primary-color, #434343);outline-offset:-2px}._arrowLeft_1ur7i_63{left:0;padding-left:var(--spacer-xs, calc(var(--space-unit, 1em) * .325));background:linear-gradient(to right,#ffffff 40%,transparent)!important}._arrowLeft_1ur7i_63 svg{transform:rotate(90deg)}._arrowRight_1ur7i_72{right:0;padding-right:var(--spacer-xs, calc(var(--space-unit, 1em) * .325));background:linear-gradient(to left,#ffffff 40%,transparent)!important}._arrowRight_1ur7i_72 svg{transform:rotate(-90deg)}._arrowHidden_1ur7i_81{opacity:0;pointer-events:none}._navItem_1ur7i_86{cursor:pointer}._navLink_1ur7i_90{display:block;position:relative;padding:var(--spacer-md, calc(var(--space-unit, 1em) * .75)) var(--spacer-md, calc(var(--space-unit, 1em) * .75));border:none!important;color:var(--text-primary, #222222);outline:0}._navLink_1ur7i_90:hover,._navLink_1ur7i_90:focus{text-decoration:none;color:var(--text-primary, #222222)!important;background:transparent}._navLink_1ur7i_90._disabled_1ur7i_103{color:var(--darkest-text-tertiary, #c7c7c7);pointer-events:none;cursor:default}._navLink_1ur7i_90:after{content:"";background-color:var(--text-primary, #222222);height:2px;position:absolute;width:100%;left:0;bottom:0;z-index:1;transition:transform .25s ease 0s;transform:scaleX(0)}._navLink_1ur7i_90._active_1ur7i_120{color:var(--text-primary, #222222)!important;background:transparent;font-weight:var(--font-weight-bold, 700)}._navLink_1ur7i_90._active_1ur7i_120:after{transform:scaleX(1)}
|
|
@@ -1,81 +1,84 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { $isListNode as q, ListNode as
|
|
3
|
-
import { useLexicalComposerContext as
|
|
4
|
-
import { $isHeadingNode as
|
|
5
|
-
import { $setBlocksType as
|
|
1
|
+
import { jsxs as T, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { $isListNode as q, ListNode as P, INSERT_ORDERED_LIST_COMMAND as $, REMOVE_LIST_COMMAND as K } from "@lexical/list";
|
|
3
|
+
import { useLexicalComposerContext as F } from "@lexical/react/LexicalComposerContext";
|
|
4
|
+
import { $isHeadingNode as U, $createQuoteNode as k } from "@lexical/rich-text";
|
|
5
|
+
import { $setBlocksType as w } from "@lexical/selection";
|
|
6
6
|
import { $getNearestNodeOfType as j, mergeRegister as H } from "@lexical/utils";
|
|
7
7
|
import a from "classnames";
|
|
8
|
-
import { $getSelection as
|
|
9
|
-
import { useRef as
|
|
8
|
+
import { $getSelection as h, $isRangeSelection as p, SELECTION_CHANGE_COMMAND as Q, $createParagraphNode as G } from "lexical";
|
|
9
|
+
import { useRef as V, useState as b, useCallback as z, useEffect as J } from "react";
|
|
10
10
|
import { useIntl as W } from "react-intl";
|
|
11
11
|
import e from "./ToolbarPlugin.module.scss.js";
|
|
12
|
-
import { Icon as
|
|
13
|
-
import { Button as
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const t =
|
|
17
|
-
if (
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
if (
|
|
21
|
-
const f = j(
|
|
22
|
-
_(
|
|
12
|
+
import { Icon as d } from "../../../icons/icon/Icon.js";
|
|
13
|
+
import { Button as X } from "../../../action/button/Button.js";
|
|
14
|
+
const be = (i) => {
|
|
15
|
+
const c = W(), x = 1, [n] = F(), C = V(null), [g, _] = b("paragraph"), [Y, D] = b(null), [I, E] = b(!1), [S, v] = b(!1), [A, L] = b(!1), M = i.hideSubmit && i.hideSourceAction && i.disableRichText, m = z(() => {
|
|
16
|
+
const t = h();
|
|
17
|
+
if (p(t)) {
|
|
18
|
+
const s = t.anchor.getNode(), r = s.getKey() === "root" ? s : s.getTopLevelElementOrThrow(), u = r.getKey();
|
|
19
|
+
if (n.getElementByKey(u) !== null)
|
|
20
|
+
if (D(u), q(r)) {
|
|
21
|
+
const f = j(s, P), R = f ? f.getTag() : r.getTag();
|
|
22
|
+
_(R);
|
|
23
23
|
} else {
|
|
24
|
-
const f =
|
|
24
|
+
const f = U(r) ? r.getTag() : r.getType();
|
|
25
25
|
_(f);
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
E(t.hasFormat("bold")), v(t.hasFormat("italic")), L(t.hasFormat("underline"));
|
|
28
28
|
}
|
|
29
|
-
}, [
|
|
29
|
+
}, [n]);
|
|
30
30
|
J(() => H(
|
|
31
|
-
|
|
31
|
+
n.registerUpdateListener(({ editorState: t }) => {
|
|
32
32
|
t.read(() => {
|
|
33
|
-
|
|
33
|
+
m();
|
|
34
34
|
});
|
|
35
35
|
}),
|
|
36
|
-
|
|
36
|
+
n.registerCommand(
|
|
37
37
|
Q,
|
|
38
|
-
(t,
|
|
38
|
+
(t, s) => (m(), !1),
|
|
39
39
|
x
|
|
40
40
|
)
|
|
41
|
-
), [
|
|
42
|
-
const
|
|
41
|
+
), [n, m]);
|
|
42
|
+
const l = (t) => {
|
|
43
43
|
t.preventDefault();
|
|
44
|
-
},
|
|
44
|
+
}, y = () => {
|
|
45
45
|
queueMicrotask(() => {
|
|
46
46
|
requestAnimationFrame(() => {
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
n.getEditorState().read(() => {
|
|
48
|
+
m();
|
|
49
49
|
});
|
|
50
50
|
});
|
|
51
51
|
});
|
|
52
|
-
},
|
|
53
|
-
|
|
52
|
+
}, N = (t) => {
|
|
53
|
+
n.update(() => {
|
|
54
|
+
const s = h();
|
|
55
|
+
p(s) && (s.formatText(t), m());
|
|
56
|
+
});
|
|
54
57
|
}, O = () => {
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
const t =
|
|
59
|
-
if (
|
|
58
|
+
g !== "ol" ? n.dispatchCommand($) : n.dispatchCommand(K), y();
|
|
59
|
+
}, B = () => {
|
|
60
|
+
g !== "quote" ? n.update(() => {
|
|
61
|
+
const t = h();
|
|
62
|
+
if (p(t))
|
|
60
63
|
if (t.isCollapsed()) {
|
|
61
|
-
const
|
|
62
|
-
|
|
64
|
+
const r = t.anchor.getNode().getTopLevelElementOrThrow(), u = k();
|
|
65
|
+
r.insertAfter(u), u.selectEnd();
|
|
63
66
|
} else
|
|
64
|
-
|
|
65
|
-
}) :
|
|
66
|
-
const t =
|
|
67
|
-
|
|
68
|
-
}),
|
|
67
|
+
w(t, () => k());
|
|
68
|
+
}) : n.update(() => {
|
|
69
|
+
const t = h();
|
|
70
|
+
p(t) && w(t, () => G());
|
|
71
|
+
}), y();
|
|
69
72
|
};
|
|
70
|
-
return
|
|
73
|
+
return M ? null : /* @__PURE__ */ T(
|
|
71
74
|
"div",
|
|
72
75
|
{
|
|
73
76
|
className: a(e.toolbar, {
|
|
74
|
-
[e.toolbarIsActive]:
|
|
77
|
+
[e.toolbarIsActive]: M ? !1 : i.isActive
|
|
75
78
|
}),
|
|
76
|
-
ref:
|
|
79
|
+
ref: C,
|
|
77
80
|
children: [
|
|
78
|
-
i.isActive ? !i.disableRichText && /* @__PURE__ */
|
|
81
|
+
i.isActive ? !i.disableRichText && /* @__PURE__ */ T(
|
|
79
82
|
"div",
|
|
80
83
|
{
|
|
81
84
|
className: a(e.iconToolbar, {
|
|
@@ -85,19 +88,20 @@ const ge = (i) => {
|
|
|
85
88
|
/* @__PURE__ */ o(
|
|
86
89
|
"button",
|
|
87
90
|
{
|
|
88
|
-
|
|
91
|
+
onPointerDown: l,
|
|
92
|
+
onMouseDown: l,
|
|
89
93
|
onClick: () => {
|
|
90
|
-
|
|
94
|
+
N("bold");
|
|
91
95
|
},
|
|
92
96
|
type: "button",
|
|
93
|
-
className: a(e.toolbarItem, { [e.active]:
|
|
97
|
+
className: a(e.toolbarItem, { [e.active]: I }),
|
|
94
98
|
"data-testid": "format-bold",
|
|
95
|
-
"aria-label":
|
|
99
|
+
"aria-label": c.formatMessage({
|
|
96
100
|
id: "input.text_editor.plugins.toolbar_plugin.bold.aria_label",
|
|
97
101
|
defaultMessage: "Make text bold"
|
|
98
102
|
}),
|
|
99
103
|
children: /* @__PURE__ */ o(
|
|
100
|
-
|
|
104
|
+
d,
|
|
101
105
|
{
|
|
102
106
|
name: "bold",
|
|
103
107
|
width: 24,
|
|
@@ -110,20 +114,21 @@ const ge = (i) => {
|
|
|
110
114
|
/* @__PURE__ */ o(
|
|
111
115
|
"button",
|
|
112
116
|
{
|
|
113
|
-
|
|
117
|
+
onPointerDown: l,
|
|
118
|
+
onMouseDown: l,
|
|
114
119
|
onClick: () => {
|
|
115
|
-
|
|
120
|
+
N("italic");
|
|
116
121
|
},
|
|
117
122
|
type: "button",
|
|
118
123
|
className: a(e.toolbarItem, {
|
|
119
|
-
[e.active]:
|
|
124
|
+
[e.active]: S
|
|
120
125
|
}),
|
|
121
|
-
"aria-label":
|
|
126
|
+
"aria-label": c.formatMessage({
|
|
122
127
|
id: "input.text_editor.plugins.toolbar_plugin.italic.aria_label",
|
|
123
128
|
defaultMessage: "Make text italic"
|
|
124
129
|
}),
|
|
125
130
|
children: /* @__PURE__ */ o(
|
|
126
|
-
|
|
131
|
+
d,
|
|
127
132
|
{
|
|
128
133
|
name: "italic",
|
|
129
134
|
width: 24,
|
|
@@ -136,20 +141,21 @@ const ge = (i) => {
|
|
|
136
141
|
/* @__PURE__ */ o(
|
|
137
142
|
"button",
|
|
138
143
|
{
|
|
139
|
-
|
|
144
|
+
onPointerDown: l,
|
|
145
|
+
onMouseDown: l,
|
|
140
146
|
onClick: () => {
|
|
141
|
-
|
|
147
|
+
N("underline");
|
|
142
148
|
},
|
|
143
149
|
type: "button",
|
|
144
150
|
className: a(e.toolbarItem, {
|
|
145
|
-
[e.active]:
|
|
151
|
+
[e.active]: A
|
|
146
152
|
}),
|
|
147
|
-
"aria-label":
|
|
153
|
+
"aria-label": c.formatMessage({
|
|
148
154
|
id: "input.text_editor.plugins.toolbar_plugin.underline.aria_label",
|
|
149
155
|
defaultMessage: "Underline text"
|
|
150
156
|
}),
|
|
151
157
|
children: /* @__PURE__ */ o(
|
|
152
|
-
|
|
158
|
+
d,
|
|
153
159
|
{
|
|
154
160
|
name: "underline",
|
|
155
161
|
width: 24,
|
|
@@ -162,16 +168,17 @@ const ge = (i) => {
|
|
|
162
168
|
/* @__PURE__ */ o(
|
|
163
169
|
"button",
|
|
164
170
|
{
|
|
165
|
-
|
|
166
|
-
|
|
171
|
+
onPointerDown: l,
|
|
172
|
+
onMouseDown: l,
|
|
173
|
+
onClick: () => B(),
|
|
167
174
|
type: "button",
|
|
168
|
-
className: a(e.toolbarItem, { [e.active]:
|
|
169
|
-
"aria-label":
|
|
175
|
+
className: a(e.toolbarItem, { [e.active]: g === "quote" }),
|
|
176
|
+
"aria-label": c.formatMessage({
|
|
170
177
|
id: "input.text_editor.plugins.toolbar_plugin.blockquote.aria_label",
|
|
171
178
|
defaultMessage: "Add a blockquote"
|
|
172
179
|
}),
|
|
173
180
|
children: /* @__PURE__ */ o(
|
|
174
|
-
|
|
181
|
+
d,
|
|
175
182
|
{
|
|
176
183
|
name: "blockquote",
|
|
177
184
|
width: 24,
|
|
@@ -184,16 +191,17 @@ const ge = (i) => {
|
|
|
184
191
|
/* @__PURE__ */ o(
|
|
185
192
|
"button",
|
|
186
193
|
{
|
|
187
|
-
|
|
194
|
+
onPointerDown: l,
|
|
195
|
+
onMouseDown: l,
|
|
188
196
|
onClick: () => O(),
|
|
189
197
|
type: "button",
|
|
190
|
-
className: a(e.toolbarItem, { [e.active]:
|
|
191
|
-
"aria-label":
|
|
198
|
+
className: a(e.toolbarItem, { [e.active]: g === "ol" }),
|
|
199
|
+
"aria-label": c.formatMessage({
|
|
192
200
|
id: "input.text_editor.plugins.toolbar_plugin.numbered_list.aria_label",
|
|
193
201
|
defaultMessage: "Insert a numbered list"
|
|
194
202
|
}),
|
|
195
203
|
children: /* @__PURE__ */ o(
|
|
196
|
-
|
|
204
|
+
d,
|
|
197
205
|
{
|
|
198
206
|
name: "orderedList",
|
|
199
207
|
width: 24,
|
|
@@ -209,12 +217,12 @@ const ge = (i) => {
|
|
|
209
217
|
onClick: i.onAddSource,
|
|
210
218
|
type: "button",
|
|
211
219
|
className: e.toolbarItem,
|
|
212
|
-
"aria-label":
|
|
220
|
+
"aria-label": c.formatMessage({
|
|
213
221
|
id: "input.text_editor.plugins.toolbar_plugin.add_link.aria_label",
|
|
214
222
|
defaultMessage: "Add hyperlink"
|
|
215
223
|
}),
|
|
216
224
|
children: /* @__PURE__ */ o(
|
|
217
|
-
|
|
225
|
+
d,
|
|
218
226
|
{
|
|
219
227
|
name: "link",
|
|
220
228
|
width: 20,
|
|
@@ -228,17 +236,17 @@ const ge = (i) => {
|
|
|
228
236
|
}
|
|
229
237
|
) : null,
|
|
230
238
|
/* @__PURE__ */ o("div", { className: e.actionButton, children: i.hideSubmit ? null : /* @__PURE__ */ o(
|
|
231
|
-
|
|
239
|
+
X,
|
|
232
240
|
{
|
|
233
241
|
type: "button",
|
|
234
242
|
"data-testid": "submit-button",
|
|
235
243
|
handleClick: i.onSubmit,
|
|
236
244
|
className: a(e.inputSubmitActionButton, e.submitAction),
|
|
237
|
-
"aria-label":
|
|
245
|
+
"aria-label": c.formatMessage({
|
|
238
246
|
id: "input.text_editor.plugins.toolbar_plugin.submit_button.aria_label",
|
|
239
247
|
defaultMessage: "Send message"
|
|
240
248
|
}),
|
|
241
|
-
children: /* @__PURE__ */ o(
|
|
249
|
+
children: /* @__PURE__ */ o(d, { name: "send", width: 20, height: 20 })
|
|
242
250
|
}
|
|
243
251
|
) })
|
|
244
252
|
]
|
|
@@ -246,5 +254,5 @@ const ge = (i) => {
|
|
|
246
254
|
);
|
|
247
255
|
};
|
|
248
256
|
export {
|
|
249
|
-
|
|
257
|
+
be as ToolbarPlugin
|
|
250
258
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import '../../../assets/components/navigation/tabs/Tabs.module-
|
|
2
|
-
tabsWrapper:
|
|
3
|
-
navTabs:
|
|
1
|
+
import '../../../assets/components/navigation/tabs/Tabs.module-B4sJ1pVW.css';const r = "_tabsWrapper_1ur7i_3", a = "_navTabs_1ur7i_11", t = "_arrow_1ur7i_39", _ = "_arrowLeft_1ur7i_63", n = "_arrowRight_1ur7i_72", o = "_arrowHidden_1ur7i_81", i = "_navItem_1ur7i_86", s = "_navLink_1ur7i_90", e = "_active_1ur7i_120", c = {
|
|
2
|
+
tabsWrapper: r,
|
|
3
|
+
navTabs: a,
|
|
4
4
|
arrow: t,
|
|
5
|
-
arrowLeft:
|
|
6
|
-
arrowRight:
|
|
7
|
-
arrowHidden:
|
|
8
|
-
navItem:
|
|
5
|
+
arrowLeft: _,
|
|
6
|
+
arrowRight: n,
|
|
7
|
+
arrowHidden: o,
|
|
8
|
+
navItem: i,
|
|
9
9
|
navLink: s,
|
|
10
|
-
active:
|
|
10
|
+
active: e
|
|
11
11
|
};
|
|
12
12
|
export {
|
|
13
|
-
|
|
13
|
+
e as active,
|
|
14
14
|
t as arrow,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
o as arrowHidden,
|
|
16
|
+
_ as arrowLeft,
|
|
17
|
+
n as arrowRight,
|
|
18
18
|
c as default,
|
|
19
|
-
|
|
19
|
+
i as navItem,
|
|
20
20
|
s as navLink,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
a as navTabs,
|
|
22
|
+
r as tabsWrapper
|
|
23
23
|
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._tabsWrapper_9pezl_3{position:relative;display:flex;align-items:stretch;width:100%;max-width:100%}._navTabs_9pezl_11{display:flex;flex-wrap:nowrap;gap:var(--spacer-xs, calc(var(--space-unit, 1em) * .325));white-space:nowrap;padding-left:0;margin-top:0;margin-bottom:0;border-bottom:none!important;list-style:none;flex:1}@container (max-width: 575.98px){._navTabs_9pezl_11{font-size:var(--font-size-normal, 16px);gap:var(--space-unit, 1em)}}._navTabs_9pezl_11{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:none}._navTabs_9pezl_11::-webkit-scrollbar{display:none}._arrow_9pezl_39{position:absolute;top:0;bottom:0;z-index:2;display:flex;align-items:center;justify-content:center;border:none;cursor:pointer;padding:0;transition:opacity .2s ease;outline:none;background-color:var(--background-color-secondary, #E8E8E8)!important;line-height:0}._arrow_9pezl_39 svg{display:block}._arrow_9pezl_39:focus-visible{outline:2px solid var(--call-primary-color, #434343);outline-offset:-2px}._arrowLeft_9pezl_63{left:0;padding-left:var(--spacer-xs, calc(var(--space-unit, 1em) * .325));background:linear-gradient(to right,var(--background-color-container, white) 40%,transparent)}._arrowLeft_9pezl_63 svg{transform:rotate(90deg)}._arrowRight_9pezl_72{right:0;padding-right:var(--spacer-xs, calc(var(--space-unit, 1em) * .325));background:linear-gradient(to left,var(--background-color-container, white) 40%,transparent)}._arrowRight_9pezl_72 svg{transform:rotate(-90deg)}._arrowHidden_9pezl_81{opacity:0;pointer-events:none}._navItem_9pezl_86{cursor:pointer}._navLink_9pezl_90{display:block;position:relative;padding:var(--spacer-md, calc(var(--space-unit, 1em) * .75)) var(--spacer-md, calc(var(--space-unit, 1em) * .75));border:none!important;color:var(--text-primary, #222222);outline:0}._navLink_9pezl_90:hover,._navLink_9pezl_90:focus{text-decoration:none;color:var(--text-primary, #222222)!important;background:transparent}._navLink_9pezl_90._disabled_9pezl_103{color:var(--darkest-text-tertiary, #c7c7c7);pointer-events:none;cursor:default}._navLink_9pezl_90:after{content:"";background-color:var(--text-primary, #222222);height:2px;position:absolute;width:100%;left:0;bottom:0;z-index:1;transition:transform .25s ease 0s;transform:scaleX(0)}._navLink_9pezl_90._active_9pezl_120{color:var(--text-primary, #222222)!important;background:transparent;font-weight:var(--font-weight-bold, 700)}._navLink_9pezl_90._active_9pezl_120:after{transform:scaleX(1)}
|