@haklex/rich-editor 0.0.12 → 0.0.13
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.
|
@@ -571,7 +571,12 @@ function AlertPlugin() {
|
|
|
571
571
|
function AutoFocusPlugin() {
|
|
572
572
|
const [editor] = useLexicalComposerContext();
|
|
573
573
|
useEffect(() => {
|
|
574
|
-
editor.
|
|
574
|
+
const root = editor.getRootElement();
|
|
575
|
+
if (root) {
|
|
576
|
+
root.focus({ preventScroll: true });
|
|
577
|
+
} else {
|
|
578
|
+
editor.focus();
|
|
579
|
+
}
|
|
575
580
|
}, [editor]);
|
|
576
581
|
return null;
|
|
577
582
|
}
|
package/dist/editor.mjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, F, I, b, d, e, f, R, a, c, g, s } from "./RichEditor-
|
|
1
|
+
import { A, F, I, b, d, e, f, R, a, c, g, s } from "./RichEditor-DeAuc6CQ.js";
|
|
2
2
|
import { R as R2 } from "./RichRenderer-CtBjK31O.js";
|
|
3
3
|
import { $, f as f2, h, i, j, k, l, m, n, o, A as A2, p, B, q, C, r, F as F2, s as s2, G, K, t, u, L, v, M, N, a as a2, w, b as b2, x, y, z, c as c2, D, E, H, I as I2, e as e2, g as g2, J, O, P, Q, S, T, U } from "./utils-DvP2uSr7.js";
|
|
4
4
|
var richContent = "r8uj4t0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoFocusPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/AutoFocusPlugin.tsx"],"names":[],"mappings":"AAGA,wBAAgB,eAAe,
|
|
1
|
+
{"version":3,"file":"AutoFocusPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/AutoFocusPlugin.tsx"],"names":[],"mappings":"AAGA,wBAAgB,eAAe,SAa9B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-editor",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "Core rich text editor based on Lexical",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"thumbhash": "^0.1.1",
|
|
28
|
-
"@haklex/rich-editor-ui": "0.0.
|
|
29
|
-
"@haklex/rich-
|
|
30
|
-
"@haklex/rich-
|
|
28
|
+
"@haklex/rich-editor-ui": "0.0.13",
|
|
29
|
+
"@haklex/rich-headless": "0.0.13",
|
|
30
|
+
"@haklex/rich-style-token": "0.0.13"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@base-ui/react": "^1.1.0",
|