@logora/debate 0.4.23 → 0.4.24
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/input/text_editor/plugins/ToolbarPlugin.module-CjkE3oe-.css +1 -0
- package/dist/components/input/text_editor/plugins/ToolbarPlugin.js +20 -20
- package/dist/components/input/text_editor/plugins/ToolbarPlugin.module.scss.js +16 -16
- package/package.json +1 -1
- package/dist/assets/components/input/text_editor/plugins/ToolbarPlugin.module-C3yG2biv.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._toolbar_13b6u_3{display:flex!important;justify-content:space-between!important;flex-wrap:wrap;background:var(--background-color-primary, white);padding-top:var(--spacer-md, calc(var(--space-unit, 1em) * .75))!important;vertical-align:middle;align-items:flex-start;gap:var(--space-unit, 1em)}._toolbar_13b6u_3._toolbarIsActive_13b6u_13{border-top:1px solid var(--text-tertiary, #fafafa)}._iconToolbar_13b6u_17{display:flex!important;gap:var(--spacer-lg, calc(var(--space-unit, 1em) * 1.5))}._iconToolbar_13b6u_17._shortBar_13b6u_21{gap:var(--spacer-md, calc(var(--space-unit, 1em) * .75))}._toolbarItem_13b6u_25{border:0;background:none;padding:0!important;cursor:pointer;vertical-align:middle;touch-action:manipulation;display:flex;align-items:center;justify-content:center}@media(max-width:576px){._toolbarItem_13b6u_25{min-width:44px;min-height:44px}}._toolbarItem_13b6u_25._disabled_13b6u_42{cursor:not-allowed}._toolbarItem_13b6u_25._active_13b6u_45{background-color:#bababa66;border-radius:50%}._toolbarItem_13b6u_25 ._format_13b6u_49{background-size:contain;display:inline-block;vertical-align:-.25em;display:flex!important}._actionButton_13b6u_56{display:flex!important;gap:var(--space-unit, 1em);margin-left:auto}._inputSubmitActionButton_13b6u_62{width:100%;height:35px;display:flex!important;justify-content:center!important;align-items:center!important;background-color:var(--call-primary-color, #434343)!important}._inputSubmitActionButton_13b6u_62._submitAction_13b6u_70 svg{fill:var(--text-light, white)!important}._inputSubmitActionButton_13b6u_62 ._inputSourceText_13b6u_73{display:none!important;margin-left:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;font-size:var(--font-size-small, 16px)}@container (min-width: 576px){._inputSubmitActionButton_13b6u_62 ._inputSourceText_13b6u_73{display:block!important}}._tooltip_13b6u_84{width:230px!important;margin-left:-117px!important}
|
|
@@ -11,12 +11,12 @@ import { useIntl as ne } from "react-intl";
|
|
|
11
11
|
import e from "./ToolbarPlugin.module.scss.js";
|
|
12
12
|
import { Icon as u } from "../../../icons/icon/Icon.js";
|
|
13
13
|
import { Button as le } from "../../../action/button/Button.js";
|
|
14
|
-
const ye = (
|
|
15
|
-
const r = ne(), D = 1, [
|
|
14
|
+
const ye = (l) => {
|
|
15
|
+
const r = ne(), D = 1, [n] = J(), O = oe(null), [h, I] = g("paragraph"), [se, P] = g(null), [B, R] = g(!1), [$, q] = g(!1), [K, F] = g(!1), S = l.hideSubmit && l.hideSourceAction && l.disableRichText, p = ie(() => {
|
|
16
16
|
const t = N();
|
|
17
17
|
if (_(t)) {
|
|
18
18
|
const c = t.anchor.getNode(), s = c.getKey() === "root" ? c : c.getTopLevelElementOrThrow(), d = s.getKey();
|
|
19
|
-
if (
|
|
19
|
+
if (n.getElementByKey(d) !== null)
|
|
20
20
|
if (P(d), k(s)) {
|
|
21
21
|
const o = Y(c, z), f = o ? o.getTag() : s.getTag();
|
|
22
22
|
I(f);
|
|
@@ -26,31 +26,31 @@ const ye = (n) => {
|
|
|
26
26
|
}
|
|
27
27
|
R(t.hasFormat("bold")), q(t.hasFormat("italic")), F(t.hasFormat("underline"));
|
|
28
28
|
}
|
|
29
|
-
}, [
|
|
29
|
+
}, [n]);
|
|
30
30
|
ae(() => Z(
|
|
31
|
-
|
|
31
|
+
n.registerUpdateListener(({ editorState: t }) => {
|
|
32
32
|
t.read(() => {
|
|
33
33
|
p();
|
|
34
34
|
});
|
|
35
35
|
}),
|
|
36
|
-
|
|
36
|
+
n.registerCommand(
|
|
37
37
|
ee,
|
|
38
38
|
() => (p(), !1),
|
|
39
39
|
D
|
|
40
40
|
)
|
|
41
|
-
), [
|
|
41
|
+
), [n, p]);
|
|
42
42
|
const b = (t) => {
|
|
43
43
|
t.pointerType !== "touch" && t.pointerType !== "pen" && t.preventDefault();
|
|
44
44
|
}, x = () => {
|
|
45
45
|
setTimeout(() => {
|
|
46
|
-
|
|
46
|
+
n.getEditorState().read(() => {
|
|
47
47
|
p();
|
|
48
48
|
});
|
|
49
49
|
}, 0);
|
|
50
50
|
}, T = (t) => {
|
|
51
|
-
|
|
51
|
+
n.dispatchCommand(te, t), n.focus();
|
|
52
52
|
}, U = () => {
|
|
53
|
-
|
|
53
|
+
n.update(() => {
|
|
54
54
|
const t = N();
|
|
55
55
|
if (!_(t))
|
|
56
56
|
return;
|
|
@@ -80,9 +80,9 @@ const ye = (n) => {
|
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
82
|
}, j = () => {
|
|
83
|
-
h !== "ol" ?
|
|
83
|
+
h !== "ol" ? n.dispatchCommand(G) : U(), x();
|
|
84
84
|
}, H = () => {
|
|
85
|
-
h !== "quote" ?
|
|
85
|
+
h !== "quote" ? n.update(() => {
|
|
86
86
|
const t = N();
|
|
87
87
|
if (_(t))
|
|
88
88
|
if (t.isCollapsed()) {
|
|
@@ -90,7 +90,7 @@ const ye = (n) => {
|
|
|
90
90
|
s.insertAfter(d), d.selectEnd();
|
|
91
91
|
} else
|
|
92
92
|
v(t, () => A());
|
|
93
|
-
}) :
|
|
93
|
+
}) : n.update(() => {
|
|
94
94
|
const t = N();
|
|
95
95
|
_(t) && v(t, () => E());
|
|
96
96
|
}), x();
|
|
@@ -99,15 +99,15 @@ const ye = (n) => {
|
|
|
99
99
|
"div",
|
|
100
100
|
{
|
|
101
101
|
className: a(e.toolbar, {
|
|
102
|
-
[e.toolbarIsActive]: S ? !1 :
|
|
102
|
+
[e.toolbarIsActive]: S ? !1 : l.isActive
|
|
103
103
|
}),
|
|
104
104
|
ref: O,
|
|
105
105
|
children: [
|
|
106
|
-
|
|
106
|
+
l.isActive ? !l.disableRichText && /* @__PURE__ */ L(
|
|
107
107
|
"div",
|
|
108
108
|
{
|
|
109
109
|
className: a(e.iconToolbar, {
|
|
110
|
-
[e.shortBar]:
|
|
110
|
+
[e.shortBar]: l.shortBar
|
|
111
111
|
}),
|
|
112
112
|
children: [
|
|
113
113
|
/* @__PURE__ */ i(
|
|
@@ -229,11 +229,11 @@ const ye = (n) => {
|
|
|
229
229
|
)
|
|
230
230
|
}
|
|
231
231
|
),
|
|
232
|
-
!
|
|
232
|
+
!l.hideSourceAction && /* @__PURE__ */ i(
|
|
233
233
|
"button",
|
|
234
234
|
{
|
|
235
235
|
onPointerDown: b,
|
|
236
|
-
onClick:
|
|
236
|
+
onClick: l.onAddSource,
|
|
237
237
|
type: "button",
|
|
238
238
|
className: e.toolbarItem,
|
|
239
239
|
"aria-label": r.formatMessage({
|
|
@@ -254,12 +254,12 @@ const ye = (n) => {
|
|
|
254
254
|
]
|
|
255
255
|
}
|
|
256
256
|
) : null,
|
|
257
|
-
/* @__PURE__ */ i("div", { className: e.actionButton, children:
|
|
257
|
+
/* @__PURE__ */ i("div", { className: e.actionButton, children: l.hideSubmit ? null : /* @__PURE__ */ i(
|
|
258
258
|
le,
|
|
259
259
|
{
|
|
260
260
|
type: "button",
|
|
261
261
|
"data-testid": "submit-button",
|
|
262
|
-
handleClick:
|
|
262
|
+
handleClick: l.onSubmit,
|
|
263
263
|
className: a(e.inputSubmitActionButton, e.submitAction),
|
|
264
264
|
"aria-label": r.formatMessage({
|
|
265
265
|
id: "input.text_editor.plugins.toolbar_plugin.submit_button.aria_label",
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import '../../../../assets/components/input/text_editor/plugins/ToolbarPlugin.module-
|
|
1
|
+
import '../../../../assets/components/input/text_editor/plugins/ToolbarPlugin.module-CjkE3oe-.css';const t = "_toolbar_13b6u_3", o = "_toolbarIsActive_13b6u_13", n = "_iconToolbar_13b6u_17", _ = "_shortBar_13b6u_21", c = "_toolbarItem_13b6u_25", b = "_active_13b6u_45", i = "_format_13b6u_49", a = "_actionButton_13b6u_56", u = "_inputSubmitActionButton_13b6u_62", s = "_submitAction_13b6u_70", r = {
|
|
2
2
|
toolbar: t,
|
|
3
3
|
toolbarIsActive: o,
|
|
4
|
-
iconToolbar:
|
|
5
|
-
shortBar:
|
|
6
|
-
toolbarItem:
|
|
7
|
-
active:
|
|
4
|
+
iconToolbar: n,
|
|
5
|
+
shortBar: _,
|
|
6
|
+
toolbarItem: c,
|
|
7
|
+
active: b,
|
|
8
8
|
format: i,
|
|
9
|
-
actionButton:
|
|
10
|
-
inputSubmitActionButton:
|
|
11
|
-
submitAction:
|
|
9
|
+
actionButton: a,
|
|
10
|
+
inputSubmitActionButton: u,
|
|
11
|
+
submitAction: s
|
|
12
12
|
};
|
|
13
13
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
a as actionButton,
|
|
15
|
+
b as active,
|
|
16
|
+
r as default,
|
|
17
17
|
i as format,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
n as iconToolbar,
|
|
19
|
+
u as inputSubmitActionButton,
|
|
20
|
+
_ as shortBar,
|
|
21
|
+
s as submitAction,
|
|
22
22
|
t as toolbar,
|
|
23
23
|
o as toolbarIsActive,
|
|
24
|
-
|
|
24
|
+
c as toolbarItem
|
|
25
25
|
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._toolbar_awaxp_3{display:flex!important;justify-content:space-between!important;flex-wrap:wrap;background:var(--background-color-primary, white);padding-top:var(--spacer-md, calc(var(--space-unit, 1em) * .75))!important;vertical-align:middle;align-items:flex-start;gap:var(--space-unit, 1em)}._toolbar_awaxp_3._toolbarIsActive_awaxp_13{border-top:1px solid var(--text-tertiary, #fafafa)}._iconToolbar_awaxp_17{display:flex!important;gap:var(--spacer-lg, calc(var(--space-unit, 1em) * 1.5))}._iconToolbar_awaxp_17._shortBar_awaxp_21{gap:var(--spacer-md, calc(var(--space-unit, 1em) * .75))}._toolbarItem_awaxp_25{border:0;background:none;padding:0!important;cursor:pointer;vertical-align:middle;touch-action:manipulation;display:flex;align-items:center;justify-content:center}@container (max-width: 575.98px){._toolbarItem_awaxp_25{min-width:44px;min-height:44px}}._toolbarItem_awaxp_25._disabled_awaxp_42{cursor:not-allowed}._toolbarItem_awaxp_25._active_awaxp_45{background-color:#bababa66;border-radius:50%}._toolbarItem_awaxp_25 ._format_awaxp_49{background-size:contain;display:inline-block;vertical-align:-.25em;display:flex!important}._actionButton_awaxp_56{display:flex!important;gap:var(--space-unit, 1em);margin-left:auto}._inputSubmitActionButton_awaxp_62{width:100%;height:35px;display:flex!important;justify-content:center!important;align-items:center!important;background-color:var(--call-primary-color, #434343)!important}._inputSubmitActionButton_awaxp_62._submitAction_awaxp_70 svg{fill:var(--text-light, white)!important}._inputSubmitActionButton_awaxp_62 ._inputSourceText_awaxp_73{display:none!important;margin-left:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;font-size:var(--font-size-small, 16px)}@container (min-width: 576px){._inputSubmitActionButton_awaxp_62 ._inputSourceText_awaxp_73{display:block!important}}._tooltip_awaxp_84{width:230px!important;margin-left:-117px!important}
|