@logora/debate 0.3.93 → 0.3.94
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.
|
@@ -35,7 +35,7 @@ const y = (l) => l?.replace(/ /g, " "), st = ({
|
|
|
35
35
|
sources: p,
|
|
36
36
|
hideSubmit: _ = !1,
|
|
37
37
|
hideSourceAction: A = !1,
|
|
38
|
-
onActivation:
|
|
38
|
+
onActivation: n,
|
|
39
39
|
disabled: B = !1,
|
|
40
40
|
handleChange: C,
|
|
41
41
|
handleSourcesChange: h,
|
|
@@ -51,14 +51,14 @@ const y = (l) => l?.replace(/ /g, " "), st = ({
|
|
|
51
51
|
autoFocus: a = !1,
|
|
52
52
|
...H
|
|
53
53
|
}) => {
|
|
54
|
-
const [
|
|
54
|
+
const [s, J] = f(a || g), [Q, W] = f(""), [$, q] = f(""), [d, u] = f([]), { showModal: D } = Me(), N = Ce(), v = Se(), E = xe(!1);
|
|
55
55
|
M(() => {
|
|
56
|
-
a && !E.current &&
|
|
57
|
-
}, [a,
|
|
56
|
+
a && !E.current && n && (E.current = !0, n());
|
|
57
|
+
}, [a, n]), M(() => {
|
|
58
58
|
p && u(p);
|
|
59
59
|
}, [p]);
|
|
60
60
|
const I = () => {
|
|
61
|
-
|
|
61
|
+
s || (J(!0), n && n());
|
|
62
62
|
}, F = {
|
|
63
63
|
editable: !B,
|
|
64
64
|
theme: Pe,
|
|
@@ -114,7 +114,7 @@ const y = (l) => l?.replace(/ /g, " "), st = ({
|
|
|
114
114
|
"div",
|
|
115
115
|
{
|
|
116
116
|
className: b(i.editorInner, {
|
|
117
|
-
[i.editorInnerInactive]: !
|
|
117
|
+
[i.editorInnerInactive]: !s && !g
|
|
118
118
|
}),
|
|
119
119
|
children: [
|
|
120
120
|
/* @__PURE__ */ e(
|
|
@@ -124,7 +124,7 @@ const y = (l) => l?.replace(/ /g, " "), st = ({
|
|
|
124
124
|
le,
|
|
125
125
|
{
|
|
126
126
|
className: b(i.editorInput, {
|
|
127
|
-
[i.editorInputInactive]: !
|
|
127
|
+
[i.editorInputInactive]: !s
|
|
128
128
|
}),
|
|
129
129
|
...H
|
|
130
130
|
}
|
|
@@ -142,14 +142,14 @@ const y = (l) => l?.replace(/ /g, " "), st = ({
|
|
|
142
142
|
shortBar: O,
|
|
143
143
|
onSubmit: V,
|
|
144
144
|
onAddSource: X,
|
|
145
|
-
isActive:
|
|
145
|
+
isActive: s || g,
|
|
146
146
|
sourceTooltip: T?.length > 0 && N.formatMessage({
|
|
147
147
|
id: "input.allowed_domains_tooltip",
|
|
148
148
|
defaultMessage: "With the new source function, you can add links to your article."
|
|
149
149
|
})
|
|
150
150
|
}
|
|
151
151
|
),
|
|
152
|
-
|
|
152
|
+
s && m && !k && /* @__PURE__ */ S("div", { className: i.charactersCount, children: [
|
|
153
153
|
/* @__PURE__ */ e(se, { maxLength: m }),
|
|
154
154
|
" ",
|
|
155
155
|
N.formatMessage({
|
|
@@ -170,7 +170,7 @@ const y = (l) => l?.replace(/ /g, " "), st = ({
|
|
|
170
170
|
),
|
|
171
171
|
/* @__PURE__ */ e(Ie, { content: w }),
|
|
172
172
|
/* @__PURE__ */ e(Re, { richContent: L }),
|
|
173
|
-
/* @__PURE__ */ e(Ne, { autoFocus: a
|
|
173
|
+
/* @__PURE__ */ e(Ne, { autoFocus: a }),
|
|
174
174
|
m && /* @__PURE__ */ e(ve, { maxLength: m }),
|
|
175
175
|
/* @__PURE__ */ e(Ee, { storageUid: P || v }),
|
|
176
176
|
/* @__PURE__ */ e(me, { editorRef: j })
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import { useLexicalComposerContext as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { useInput as
|
|
4
|
-
const
|
|
5
|
-
const [o] =
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { useLexicalComposerContext as u } from "@lexical/react/LexicalComposerContext";
|
|
2
|
+
import { useRef as c, useEffect as s } from "react";
|
|
3
|
+
import { useInput as f } from "../../input_provider/useInput.js";
|
|
4
|
+
const E = ({ autoFocus: t = !1 }) => {
|
|
5
|
+
const [o] = u(), { focus: e } = f(), r = c(!1);
|
|
6
|
+
return s(() => {
|
|
7
|
+
e && o.focus(() => {
|
|
8
|
+
o.getRootElement().focus();
|
|
8
9
|
});
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
n && !u.current && (u.current = !0, e());
|
|
14
|
-
}, [n, o]), r(() => {
|
|
15
|
-
t && !c.current && e(), c.current = t;
|
|
10
|
+
}, [e, o]), s(() => {
|
|
11
|
+
t && !r.current && (r.current = !0, o.focus(() => {
|
|
12
|
+
o.getRootElement().focus();
|
|
13
|
+
}));
|
|
16
14
|
}, [t, o]), null;
|
|
17
15
|
};
|
|
18
16
|
export {
|
|
19
|
-
|
|
17
|
+
E as FocusPlugin
|
|
20
18
|
};
|