@lobehub/editor 3.12.0 → 3.12.1
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.
|
@@ -6,6 +6,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
6
6
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
7
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
8
8
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
9
|
+
import { LOBE_THEME_APP_ID } from '@lobehub/ui';
|
|
9
10
|
import { useMemo } from 'react';
|
|
10
11
|
import { useLexicalComposerContext } from "./react-context";
|
|
11
12
|
export var useAnchor = function useAnchor() {
|
|
@@ -20,7 +21,7 @@ export var useAnchor = function useAnchor() {
|
|
|
20
21
|
var anchor = root ? root.parentElement : null;
|
|
21
22
|
if (anchor) return anchor;
|
|
22
23
|
// Fallback to .ant-app if exists, otherwise document.body
|
|
23
|
-
var
|
|
24
|
-
return
|
|
24
|
+
var app = document.querySelector("#".concat(LOBE_THEME_APP_ID));
|
|
25
|
+
return app || document.body;
|
|
25
26
|
}, [editor]);
|
|
26
27
|
};
|
package/package.json
CHANGED