@layers-app/editor 0.5.7-optimization → 0.5.10-optimization
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/README.md +0 -19
- package/dist/ExcalidrawComponent-D7Z_2awF.cjs +1 -0
- package/dist/ExcalidrawComponent-Re4zFgLg.js +283 -0
- package/dist/InlineImageComponent-DHgCaPNk.cjs +1 -0
- package/dist/InlineImageComponent-kXhZcmF6.js +265 -0
- package/dist/collaboration-C7xVk0Zj.cjs +4 -0
- package/dist/collaboration-Cn7KizEJ.js +5997 -0
- package/dist/excalidraw-C-6bid_P.js +16497 -0
- package/dist/excalidraw-DpwKTNBz.cjs +574 -0
- package/dist/index-B4yOqKUQ.cjs +1 -0
- package/dist/index-BZu8Qnrg.cjs +1 -0
- package/dist/index-CFA9Drk2.cjs +16 -0
- package/dist/index-CX5msaMB.js +296 -0
- package/dist/index-CbQX0N2c.js +136 -0
- package/dist/index-DEC5JR_F.js +60 -0
- package/dist/index-Dan3tqoj.cjs +1 -0
- package/dist/index-WCOc4LNL.js +16600 -0
- package/dist/index.cjs +2 -2
- package/dist/index.js +12 -13
- package/dist/lexical-2rxs76dr.cjs +41 -0
- package/dist/lexical-C60GkwxR.js +13122 -0
- package/dist/lexical-code-DKIWiZdJ.js +604 -0
- package/dist/lexical-code-VafvPacU.cjs +9 -0
- package/dist/lexical-collab-1tX9tFVC.js +1025 -0
- package/dist/lexical-collab-Nk2LVpJv.cjs +1 -0
- package/dist/lexical-file-C52Mze5k.cjs +1 -0
- package/dist/lexical-file-DjHP4vVw.js +43 -0
- package/dist/lexical-markdown-BSl_ahWw.cjs +12 -0
- package/dist/lexical-markdown-DcEwQQba.js +488 -0
- package/dist/lodash-3PEMjFQT.cjs +1 -0
- package/dist/lodash-jftOdrxX.js +711 -0
- package/dist/stats.html +4949 -0
- package/dist/vendor-BrXDSyZX.js +136433 -0
- package/dist/vendor-Bt6Lma3y.cjs +2469 -0
- package/package.json +56 -87
- package/dist/layers.BC4vtoR_.js +0 -1
- package/dist/layers.B_yux7vw.js +0 -4
- package/dist/layers.BcAsUBEd.js +0 -341
- package/dist/layers.BtlL1tAr.js +0 -2
- package/dist/layers.DDFAbldJ.js +0 -530
- package/dist/layers.DNCgFYS7.js +0 -27
- package/dist/layers.DRco4RUq.js +0 -6
- package/dist/layers.DmkizKAP.js +0 -2511
- package/dist/layers.DydTPA8C.js +0 -2227
- package/dist/layers.JnfXnfvp.js +0 -1
- package/dist/layers.NH0RP3cX.js +0 -3
- package/dist/layers.QjAkD17S.js +0 -3677
- package/dist/layers.ZHcm9ChQ.js +0 -6774
- package/dist/layers.bsL5r2kj.js +0 -864
- package/dist/layers.hBfNB8NK.js +0 -7
- package/dist/layers.vxLVQC3Y.js +0 -7723
package/dist/layers.DDFAbldJ.js
DELETED
|
@@ -1,530 +0,0 @@
|
|
|
1
|
-
import { $isElementNode as y, createCommand as h, $getRoot as S, $createParagraphNode as b, $getSelection as g, $isRangeSelection as p, $getNearestNodeFromDOMNode as N, $setSelection as M, $getNodeByKey as G, $createRangeSelection as V, $copyNode as O, ElementNode as x, ParagraphNode as W, INSERT_PARAGRAPH_COMMAND as j, COMMAND_PRIORITY_NORMAL as $, $isParagraphNode as J, DELETE_CHARACTER_COMMAND as Y, REDO_COMMAND as q } from "lexical";
|
|
2
|
-
import { p as k, D as I, f as E, aF as Z, a6 as Q, U as H, u as v, Q as A, C as X, aj as tt, n as et } from "./layers.vxLVQC3Y.js";
|
|
3
|
-
import { s as st } from "./layers.DmkizKAP.js";
|
|
4
|
-
import { $getNearestNodeOfType as nt } from "@lexical/utils";
|
|
5
|
-
import { $isAtNodeEnd as D } from "@lexical/selection";
|
|
6
|
-
import "@lexical/code";
|
|
7
|
-
import "@lexical/hashtag";
|
|
8
|
-
import "@lexical/link";
|
|
9
|
-
import "@lexical/mark";
|
|
10
|
-
import "@lexical/overflow";
|
|
11
|
-
import "@lexical/react/LexicalHorizontalRuleNode";
|
|
12
|
-
import "@lexical/rich-text";
|
|
13
|
-
import { G as F, H as ot, _ as lt, a0 as rt, a1 as it, a2 as at, a3 as K, a4 as ct, a5 as ft, a6 as ut, a7 as dt, a8 as gt, a9 as ht, aa as pt, ab as mt } from "./layers.ZHcm9ChQ.js";
|
|
14
|
-
function Ct(t, e) {
|
|
15
|
-
if (e.add(t.getKey()), y(t))
|
|
16
|
-
for (const s of t.getChildren())
|
|
17
|
-
Ct(s, e);
|
|
18
|
-
}
|
|
19
|
-
function Vt(t) {
|
|
20
|
-
t.preventDefault(), t.stopImmediatePropagation(), t.stopPropagation();
|
|
21
|
-
}
|
|
22
|
-
const Wt = h(), jt = h(), Jt = h(), Yt = h(), qt = h(), Zt = h(), Qt = h(), Ht = h(), vt = (() => {
|
|
23
|
-
var e;
|
|
24
|
-
const t = (e = window.navigator) == null ? void 0 : e.userAgentData;
|
|
25
|
-
return t !== void 0 ? t.mobile : window.innerWidth <= 800 && window.innerHeight <= 600;
|
|
26
|
-
})(), Xt = (t) => typeof t == "string" && t.includes("%") ? parseFloat(t) : t;
|
|
27
|
-
function te(t, e) {
|
|
28
|
-
if (!e || !(e instanceof HTMLElement)) {
|
|
29
|
-
console.error("Invalid DOM element provided.");
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
t ? e.classList.add("disable-scroll") : e.classList.remove("disable-scroll");
|
|
33
|
-
}
|
|
34
|
-
function m(t) {
|
|
35
|
-
const e = g();
|
|
36
|
-
if (p(e)) {
|
|
37
|
-
const n = e.anchor.getNode();
|
|
38
|
-
if (n !== null) {
|
|
39
|
-
const o = n.getParent();
|
|
40
|
-
return t ? o : n;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
function ee(t) {
|
|
46
|
-
t.update(() => {
|
|
47
|
-
const e = g();
|
|
48
|
-
if (p(e)) {
|
|
49
|
-
const s = e.getNodes();
|
|
50
|
-
let n = null, o = null;
|
|
51
|
-
if (s.forEach((l, i) => {
|
|
52
|
-
i === 0 && (n = l.getParent()), i === s.length - 1 && (o = l.getParent());
|
|
53
|
-
}), n && o) {
|
|
54
|
-
const l = g();
|
|
55
|
-
p(l) && (n.isAttached() && o.isAttached() ? E(n) && E(o) ? l.setTextNodeRange(
|
|
56
|
-
n,
|
|
57
|
-
0,
|
|
58
|
-
o,
|
|
59
|
-
o.getTextContentSize()
|
|
60
|
-
) : (l.anchor.set(n.getKey(), 0, "element"), l.focus.set(
|
|
61
|
-
o.getKey(),
|
|
62
|
-
o.getChildrenSize(),
|
|
63
|
-
"element"
|
|
64
|
-
)) : console.error("Error: One of the nodes is not attached."));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
const yt = (t, e) => {
|
|
70
|
-
t.update(() => {
|
|
71
|
-
if (typeof e == "string") {
|
|
72
|
-
const s = G(e);
|
|
73
|
-
s && s.remove();
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
e && e.remove();
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
function se(t, e) {
|
|
80
|
-
e.update(() => {
|
|
81
|
-
let s = V();
|
|
82
|
-
t.getParent() && (s.anchor.set(t.getKey(), 0, "element"), s.focus.set(t.getKey(), 0, "element"), M(s));
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
function ne() {
|
|
86
|
-
const t = g();
|
|
87
|
-
if (p(t)) {
|
|
88
|
-
const e = t.anchor, s = t.focus, n = s.getNode(), o = k(n) ? n.__size : n.getTextContentSize(), l = e.offset === 0, i = s.offset === o;
|
|
89
|
-
if (l && i)
|
|
90
|
-
return !0;
|
|
91
|
-
}
|
|
92
|
-
return !1;
|
|
93
|
-
}
|
|
94
|
-
function oe(t, e) {
|
|
95
|
-
const s = O(t), n = [[t, s]];
|
|
96
|
-
let o;
|
|
97
|
-
for (; (o = n.length) > 0; )
|
|
98
|
-
for (let l = 0; l < o; l++) {
|
|
99
|
-
const i = n.shift();
|
|
100
|
-
if (i !== void 0) {
|
|
101
|
-
const [a, r] = i;
|
|
102
|
-
if (y(a) && y(r)) {
|
|
103
|
-
const c = a.getChildren();
|
|
104
|
-
for (const f of c) {
|
|
105
|
-
if (e && f.is(e))
|
|
106
|
-
continue;
|
|
107
|
-
const u = O(f);
|
|
108
|
-
E(f) && E(u) && (u.setFormat(f.__format), u.setStyle(f.__style)), r.append(u), n.push([f, u]);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return s;
|
|
114
|
-
}
|
|
115
|
-
function Et(t, e, s = 3) {
|
|
116
|
-
if (!t) return null;
|
|
117
|
-
let n = t, o = 0;
|
|
118
|
-
for (; n && o < s; ) {
|
|
119
|
-
if (e(n))
|
|
120
|
-
return n;
|
|
121
|
-
if (n.__type === "root")
|
|
122
|
-
break;
|
|
123
|
-
n = n.getParent(), o++;
|
|
124
|
-
}
|
|
125
|
-
return null;
|
|
126
|
-
}
|
|
127
|
-
function L(t, e, s) {
|
|
128
|
-
var o;
|
|
129
|
-
const n = s || { root: !0 };
|
|
130
|
-
if (t) {
|
|
131
|
-
let l = t.getParent();
|
|
132
|
-
if (n[l == null ? void 0 : l.__type]) {
|
|
133
|
-
const i = e.getElementByKey(t.__key), a = Et(l, I);
|
|
134
|
-
if (a && (a.getFirstChild() === t.getTopLevelElement() || a.getFirstChild() === ((o = t.getTopLevelElement()) == null ? void 0 : o.getParent()))) {
|
|
135
|
-
const c = a.getParent(), f = c ? e.getElementByKey(c.__key) : null;
|
|
136
|
-
if (f)
|
|
137
|
-
return {
|
|
138
|
-
htmlElement: f,
|
|
139
|
-
lexicalNode: N(f)
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
return { htmlElement: i, lexicalNode: t };
|
|
143
|
-
}
|
|
144
|
-
return L(l, e, n);
|
|
145
|
-
}
|
|
146
|
-
return { htmlElement: null, lexicalNode: null };
|
|
147
|
-
}
|
|
148
|
-
function le(t, e, s, n) {
|
|
149
|
-
var o;
|
|
150
|
-
if (t)
|
|
151
|
-
if ((t == null ? void 0 : t.__type) === "root" || (t == null ? void 0 : t.__type) === "layout-item" || (t == null ? void 0 : t.__type) === "callout-wrapper" || (t == null ? void 0 : t.__type) === "collapsible-content") {
|
|
152
|
-
const l = (n == null ? void 0 : n.clientY) || 0, { left: i } = ((o = e.getElementByKey(t.__key)) == null ? void 0 : o.getBoundingClientRect()) || {
|
|
153
|
-
left: 0
|
|
154
|
-
}, { paddingLeft: a } = window.getComputedStyle(
|
|
155
|
-
n == null ? void 0 : n.target
|
|
156
|
-
), r = document.elementFromPoint(
|
|
157
|
-
i + parseFloat(a) + 10,
|
|
158
|
-
l
|
|
159
|
-
), c = N(r || document.body);
|
|
160
|
-
return c ? L(c, e, s) : { htmlElement: null, lexicalNode: null };
|
|
161
|
-
} else
|
|
162
|
-
return L(t, e, s);
|
|
163
|
-
return { htmlElement: null, lexicalNode: null };
|
|
164
|
-
}
|
|
165
|
-
const re = (t) => {
|
|
166
|
-
t.update(() => {
|
|
167
|
-
g() !== null && M(null);
|
|
168
|
-
});
|
|
169
|
-
}, ie = () => {
|
|
170
|
-
const t = S(), e = t == null ? void 0 : t.getFirstChild();
|
|
171
|
-
return t.getChildren().length > 1 ? !1 : e && y(e) && e.isEmpty() && !k(e);
|
|
172
|
-
}, ae = (t) => {
|
|
173
|
-
t.update(() => {
|
|
174
|
-
const e = S(), s = b(), n = g();
|
|
175
|
-
p(n) && (n.format = 0, n.setStyle("")), e.append(s).selectEnd();
|
|
176
|
-
});
|
|
177
|
-
}, ce = (t, e, s) => {
|
|
178
|
-
const n = t.target;
|
|
179
|
-
if (n && (n instanceof HTMLElement || n instanceof SVGElement)) {
|
|
180
|
-
let o = null;
|
|
181
|
-
const l = n.closest(e);
|
|
182
|
-
for (const a of s)
|
|
183
|
-
if (o = n.closest(a), o)
|
|
184
|
-
break;
|
|
185
|
-
return { lexicalDOMNode: l, isOutside: !(l || o) };
|
|
186
|
-
} else
|
|
187
|
-
return { lexicalDOMNode: null, isOutside: !0 };
|
|
188
|
-
};
|
|
189
|
-
async function* B(t) {
|
|
190
|
-
let e = !1;
|
|
191
|
-
for (; !e; ) {
|
|
192
|
-
const s = await t.read(), { value: n } = s;
|
|
193
|
-
n !== void 0 && (yield n), e = s.done;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
async function _t(t) {
|
|
197
|
-
const e = [];
|
|
198
|
-
for await (const n of B(t))
|
|
199
|
-
for (let o = 0; o < n.length; o += 32768)
|
|
200
|
-
e.push(String.fromCharCode(...n.subarray(o, o + 32768)));
|
|
201
|
-
return e.join("");
|
|
202
|
-
}
|
|
203
|
-
async function fe(t) {
|
|
204
|
-
const e = new CompressionStream("gzip"), s = e.writable.getWriter(), [, n] = await Promise.all([
|
|
205
|
-
s.write(new TextEncoder().encode(JSON.stringify(t))).then(() => s.close()),
|
|
206
|
-
_t(e.readable.getReader())
|
|
207
|
-
]);
|
|
208
|
-
return `#doc=${btoa(n).replace(/\//g, "_").replace(/\+/g, "-").replace(/=+$/, "")}`;
|
|
209
|
-
}
|
|
210
|
-
async function ue(t) {
|
|
211
|
-
const e = /^#doc=(.*)$/.exec(t);
|
|
212
|
-
if (!e)
|
|
213
|
-
return null;
|
|
214
|
-
const s = new DecompressionStream("gzip"), n = s.writable.getWriter(), o = atob(e[1].replace(/_/g, "/").replace(/-/g, "+")), l = new Uint8Array(o.length);
|
|
215
|
-
for (let r = 0; r < o.length; r++)
|
|
216
|
-
l[r] = o.charCodeAt(r);
|
|
217
|
-
const i = n.write(l).then(() => n.close()), a = [];
|
|
218
|
-
for await (const r of B(
|
|
219
|
-
s.readable.pipeThrough(new TextDecoderStream()).getReader()
|
|
220
|
-
))
|
|
221
|
-
a.push(r);
|
|
222
|
-
return await i, JSON.parse(a.join(""));
|
|
223
|
-
}
|
|
224
|
-
const St = () => !!document.querySelector(".selected-all-document"), de = (t, e, s) => {
|
|
225
|
-
var o, l, i, a, r;
|
|
226
|
-
const n = g();
|
|
227
|
-
if (p(n) && n.isCollapsed()) {
|
|
228
|
-
const c = n.anchor.getNode(), f = c.getKey(), u = c.getParent() === s, C = s instanceof x && (s.__type === "layout-item" ? (l = (o = s.getLastChild()) == null ? void 0 : o.getPreviousSibling()) == null ? void 0 : l.getKey() : (i = s.getLastChild()) == null ? void 0 : i.getKey()) === f, R = s instanceof x && ((a = s.getFirstChild()) == null ? void 0 : a.getKey()) === f;
|
|
229
|
-
if (s && c instanceof W && !c.getTextContent() && u && !((r = c.getPreviousSibling()) != null && r.getTextContent()) && C && !R) {
|
|
230
|
-
const U = t.registerCommand(
|
|
231
|
-
j,
|
|
232
|
-
() => (U(), !0),
|
|
233
|
-
$
|
|
234
|
-
);
|
|
235
|
-
return t.update(() => {
|
|
236
|
-
var P;
|
|
237
|
-
if (s) {
|
|
238
|
-
let d = s.getChildren();
|
|
239
|
-
const z = s.getLastChild();
|
|
240
|
-
Z(z) && (d = d.slice(0, -1)), d.length === 2 ? d.slice(-1).forEach((T) => T.remove()) : d.slice(-2).forEach((T) => T.remove());
|
|
241
|
-
}
|
|
242
|
-
const w = e == null ? void 0 : e.getNextSibling();
|
|
243
|
-
if (J(w) && w.getTextContent() === "")
|
|
244
|
-
(P = e == null ? void 0 : e.getNextSibling()) == null || P.selectEnd();
|
|
245
|
-
else {
|
|
246
|
-
const d = e == null ? void 0 : e.insertAfter(b());
|
|
247
|
-
d == null || d.selectStart();
|
|
248
|
-
}
|
|
249
|
-
}), !0;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
return !1;
|
|
253
|
-
}, ge = (t, e, s) => {
|
|
254
|
-
var l, i, a;
|
|
255
|
-
const n = (s == null ? void 0 : s.getChildren()) || [];
|
|
256
|
-
if ((n == null ? void 0 : n.length) === 2) {
|
|
257
|
-
for (const r of n)
|
|
258
|
-
r.__key !== (e == null ? void 0 : e.__key) && (s == null || s.insertBefore(r), (l = r.getFirstChild()) == null || l.selectEnd());
|
|
259
|
-
s.remove();
|
|
260
|
-
} else
|
|
261
|
-
for (const r of n)
|
|
262
|
-
if (r.__key === (e == null ? void 0 : e.__key)) {
|
|
263
|
-
st(t, r), yt(t, r);
|
|
264
|
-
const c = r.getPreviousSibling() ?? r.getNextSibling();
|
|
265
|
-
(a = (i = c == null ? void 0 : c.getFirstChild) == null ? void 0 : i.call(c)) == null || a.selectEnd();
|
|
266
|
-
}
|
|
267
|
-
const o = t.registerCommand(
|
|
268
|
-
Y,
|
|
269
|
-
() => (o(), !0),
|
|
270
|
-
$
|
|
271
|
-
);
|
|
272
|
-
return !0;
|
|
273
|
-
}, he = (t, e, s) => {
|
|
274
|
-
if (!t) return null;
|
|
275
|
-
let n = null;
|
|
276
|
-
return s.read(() => {
|
|
277
|
-
const o = N(t);
|
|
278
|
-
n = o && nt(o, e);
|
|
279
|
-
}), n;
|
|
280
|
-
};
|
|
281
|
-
function pe(t) {
|
|
282
|
-
return t instanceof HTMLElement;
|
|
283
|
-
}
|
|
284
|
-
function _(t) {
|
|
285
|
-
let e = 0;
|
|
286
|
-
t instanceof WheelEvent ? e = t.deltaY : t instanceof TouchEvent && (e = 1);
|
|
287
|
-
let s = t.target;
|
|
288
|
-
for (; s && s !== document.body && s !== document.documentElement; ) {
|
|
289
|
-
if (s.scrollHeight > s.clientHeight && (e < 0 && s.scrollTop > 0 || e > 0 && s.scrollTop + s.clientHeight < s.scrollHeight))
|
|
290
|
-
return;
|
|
291
|
-
s = s.parentElement;
|
|
292
|
-
}
|
|
293
|
-
t.preventDefault();
|
|
294
|
-
}
|
|
295
|
-
function Nt() {
|
|
296
|
-
document.addEventListener("wheel", _, { passive: !1 }), document.addEventListener("touchmove", _, { passive: !1 });
|
|
297
|
-
}
|
|
298
|
-
function Tt() {
|
|
299
|
-
document.removeEventListener("wheel", _), document.removeEventListener("touchmove", _);
|
|
300
|
-
}
|
|
301
|
-
function me(t) {
|
|
302
|
-
const e = t.anchor, s = t.focus, n = t.anchor.getNode(), o = t.focus.getNode();
|
|
303
|
-
return n === o ? n : t.isBackward() ? D(s) ? n : o : D(e) ? n : o;
|
|
304
|
-
}
|
|
305
|
-
const Lt = /* @__PURE__ */ new Set([
|
|
306
|
-
"http:",
|
|
307
|
-
"https:",
|
|
308
|
-
"mailto:",
|
|
309
|
-
"sms:",
|
|
310
|
-
"tel:"
|
|
311
|
-
]);
|
|
312
|
-
function Ce(t) {
|
|
313
|
-
try {
|
|
314
|
-
const e = new URL(t);
|
|
315
|
-
if (!Lt.has(e.protocol))
|
|
316
|
-
return "about:blank";
|
|
317
|
-
} catch {
|
|
318
|
-
return t;
|
|
319
|
-
}
|
|
320
|
-
return t;
|
|
321
|
-
}
|
|
322
|
-
function ye(t, e) {
|
|
323
|
-
const s = t.getRangeAt(0);
|
|
324
|
-
let n;
|
|
325
|
-
if (t.anchorNode === e) {
|
|
326
|
-
let o = e;
|
|
327
|
-
for (; o.firstElementChild != null; )
|
|
328
|
-
o = o.firstElementChild;
|
|
329
|
-
n = o.getBoundingClientRect();
|
|
330
|
-
} else
|
|
331
|
-
n = s.getBoundingClientRect();
|
|
332
|
-
return n;
|
|
333
|
-
}
|
|
334
|
-
const Ee = () => {
|
|
335
|
-
var s;
|
|
336
|
-
const t = (s = window.getSelection()) == null ? void 0 : s.toString().trim();
|
|
337
|
-
return t == null ? void 0 : t.replace(/\s+/g, "");
|
|
338
|
-
}, bt = 10, wt = 5;
|
|
339
|
-
function _e(t, e, s, n = !1, o = bt, l = wt) {
|
|
340
|
-
const i = s.parentElement, a = document.querySelector(".ai-editor-menu");
|
|
341
|
-
if (t === null || !i || a) {
|
|
342
|
-
e.style.opacity = "0", e.style.transform = "translate(-10000px, -10000px)", Tt();
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
const r = e.getBoundingClientRect(), c = i.getBoundingClientRect();
|
|
346
|
-
let f = t.top - r.height - o;
|
|
347
|
-
f < 0 && (f = 10);
|
|
348
|
-
let u = t.left - l;
|
|
349
|
-
if (f < c.top && (f += r.height + t.height + o * 2), u + r.width > c.right && (u = c.right - r.width - l), t.bottom - t.height > c.bottom) {
|
|
350
|
-
e.style.transform = "translate(-1000px, -1000px)";
|
|
351
|
-
return;
|
|
352
|
-
}
|
|
353
|
-
if (t.bottom + t.height < c.top) {
|
|
354
|
-
e.style.transform = "translate(-1000px, -1000px)";
|
|
355
|
-
return;
|
|
356
|
-
}
|
|
357
|
-
let C = f;
|
|
358
|
-
r.top >= c.bottom && (C = c.bottom), e.style.transform = `translate(${u}px, ${C}px)`, e.style.opacity = "1", Nt();
|
|
359
|
-
}
|
|
360
|
-
const Se = (t) => {
|
|
361
|
-
const e = g(), s = m(), n = s == null ? void 0 : s.getParent(), o = n == null ? void 0 : n.getParent();
|
|
362
|
-
if (s) {
|
|
363
|
-
if (St())
|
|
364
|
-
return S().clear(), e.insertParagraph(), !0;
|
|
365
|
-
if (o instanceof F || o instanceof ot)
|
|
366
|
-
return lt();
|
|
367
|
-
if (n instanceof Q)
|
|
368
|
-
return rt();
|
|
369
|
-
}
|
|
370
|
-
return !1;
|
|
371
|
-
}, Ne = (t, e) => {
|
|
372
|
-
var s, n, o, l, i, a;
|
|
373
|
-
if (t.dataTransfer) {
|
|
374
|
-
const r = Object.values(t.dataTransfer.files);
|
|
375
|
-
if (r && r.length)
|
|
376
|
-
return t.preventDefault(), t.target instanceof HTMLElement && ((s = e.current) != null && s.insertImages) && ((n = N(t.target)) == null || n.selectEnd(), r[0].type.includes("video") && ((o = e.current) != null && o.insertVideos) ? e.current.insertVideos(r) : r[0].type.includes("image") && ((l = e.current) != null && l.insertImages) ? e.current.insertImages(r) : r[0].type.includes("audio") && ((i = e.current) != null && i.insertMusics) ? e.current.insertMusics(r) : (a = e.current) != null && a.insertFiles && (e == null || e.current.insertFiles(r))), !0;
|
|
377
|
-
}
|
|
378
|
-
return !1;
|
|
379
|
-
}, Te = () => {
|
|
380
|
-
const t = m(), e = t == null ? void 0 : t.getParent();
|
|
381
|
-
return t && it(e) ? at() : !1;
|
|
382
|
-
}, Le = () => {
|
|
383
|
-
const t = m(), e = t == null ? void 0 : t.getParent();
|
|
384
|
-
return t && K(e) ? ct() : !1;
|
|
385
|
-
}, Pt = (t) => {
|
|
386
|
-
const e = g();
|
|
387
|
-
if (!p(e) || !e.isCollapsed())
|
|
388
|
-
return !1;
|
|
389
|
-
const s = e.anchor.getNode();
|
|
390
|
-
if (s.getPreviousSibling() === null && e.anchor.offset === 0) {
|
|
391
|
-
const n = s.getParent();
|
|
392
|
-
if (n) {
|
|
393
|
-
const o = b();
|
|
394
|
-
return o.append(...n.getChildren()), n.replace(o), t.preventDefault(), !0;
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
return !1;
|
|
398
|
-
};
|
|
399
|
-
function Ot(t) {
|
|
400
|
-
if (!t) return null;
|
|
401
|
-
const s = new DOMParser().parseFromString(t, "text/html").body, n = Array.from(s.children);
|
|
402
|
-
if (n.length !== 1) return null;
|
|
403
|
-
const o = n[0];
|
|
404
|
-
return o.tagName !== "IMG" || s.textContent && s.textContent.trim().length > 0 ? null : o.getAttribute("src") || "" || null;
|
|
405
|
-
}
|
|
406
|
-
const be = (t, e, s) => {
|
|
407
|
-
var l, i;
|
|
408
|
-
const n = m(), o = n == null ? void 0 : n.getParent();
|
|
409
|
-
if (n) {
|
|
410
|
-
if (K(o))
|
|
411
|
-
return ft(t);
|
|
412
|
-
if (I(o))
|
|
413
|
-
(i = (l = s.current) == null ? void 0 : l.onDeleteCallout) == null || i.call(l, e);
|
|
414
|
-
else {
|
|
415
|
-
if (H(o))
|
|
416
|
-
return ut(t);
|
|
417
|
-
if (v(o))
|
|
418
|
-
return Pt(e);
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
return !1;
|
|
422
|
-
}, we = (t, e) => {
|
|
423
|
-
const s = e.ctrlKey || e.metaKey, n = e.shiftKey, o = e.code === "KeyZ";
|
|
424
|
-
return s && n && o ? (e.preventDefault(), t.dispatchCommand(q, void 0), !0) : !1;
|
|
425
|
-
}, Pe = (t, e, s, n, o) => {
|
|
426
|
-
var a, r;
|
|
427
|
-
if (o)
|
|
428
|
-
return n.preventDefault(), n.key === "Enter" && n.shiftKey && e.insertParagraph(), !0;
|
|
429
|
-
const l = m(), i = l == null ? void 0 : l.getParent();
|
|
430
|
-
if (l) {
|
|
431
|
-
if (i instanceof A)
|
|
432
|
-
return dt(t);
|
|
433
|
-
if (i instanceof F)
|
|
434
|
-
return gt(t);
|
|
435
|
-
if (i instanceof X)
|
|
436
|
-
return ht(t);
|
|
437
|
-
if (i instanceof tt)
|
|
438
|
-
return pt(t);
|
|
439
|
-
if (i instanceof et || A)
|
|
440
|
-
return mt();
|
|
441
|
-
}
|
|
442
|
-
return (r = (a = s.current) == null ? void 0 : a.decoratorEnterAction) == null || r.call(a), !1;
|
|
443
|
-
};
|
|
444
|
-
function Oe(t, e) {
|
|
445
|
-
var s, n, o, l, i, a, r, c;
|
|
446
|
-
if ("dataTransfer" in t && ((n = (s = t.dataTransfer) == null ? void 0 : s.files) != null && n.length)) {
|
|
447
|
-
const f = Array.from(t.dataTransfer.files), u = f[0];
|
|
448
|
-
return u.type.includes("video") && ((o = e.current) != null && o.insertVideos) ? e.current.insertVideos(f) : u.type.includes("image") && ((l = e.current) != null && l.insertImages) ? e.current.insertImages(f) : u.type.includes("audio") && ((i = e.current) != null && i.insertMusics) ? e.current.insertMusics(f) : (a = e.current) != null && a.insertFiles && e.current.insertFiles(f), !0;
|
|
449
|
-
}
|
|
450
|
-
if ("clipboardData" in t) {
|
|
451
|
-
const f = (c = (r = t.clipboardData) == null ? void 0 : r.getData("text/html")) == null ? void 0 : c.trim();
|
|
452
|
-
if (Ot(f))
|
|
453
|
-
return !0;
|
|
454
|
-
}
|
|
455
|
-
return !1;
|
|
456
|
-
}
|
|
457
|
-
function xe(t) {
|
|
458
|
-
if (!t || t.classList.contains("video-container") || t.classList.contains("resizable-container") || t.classList.contains("editor-image"))
|
|
459
|
-
return null;
|
|
460
|
-
if (t.closest("ol, ul"))
|
|
461
|
-
return t;
|
|
462
|
-
let e = t;
|
|
463
|
-
for (; e && !e.classList.contains("ContentEditable__root"); )
|
|
464
|
-
e = e.parentElement;
|
|
465
|
-
if (e != null && e.classList.contains("ContentEditable__root")) {
|
|
466
|
-
let s = t;
|
|
467
|
-
for (; s && s.parentElement !== e; )
|
|
468
|
-
s = s.parentElement;
|
|
469
|
-
return s;
|
|
470
|
-
}
|
|
471
|
-
return null;
|
|
472
|
-
}
|
|
473
|
-
function Ae(t, e = !1) {
|
|
474
|
-
t.focus(), t.update(() => {
|
|
475
|
-
var n, o;
|
|
476
|
-
const s = S();
|
|
477
|
-
e ? (s.selectStart(), (n = s.getFirstChild()) == null || n.selectEnd()) : (s.selectEnd(), (o = s.getLastChild()) == null || o.selectEnd());
|
|
478
|
-
});
|
|
479
|
-
}
|
|
480
|
-
export {
|
|
481
|
-
L as $,
|
|
482
|
-
me as A,
|
|
483
|
-
qt as B,
|
|
484
|
-
ae as C,
|
|
485
|
-
re as D,
|
|
486
|
-
se as E,
|
|
487
|
-
oe as F,
|
|
488
|
-
Nt as G,
|
|
489
|
-
jt as H,
|
|
490
|
-
Jt as I,
|
|
491
|
-
pe as J,
|
|
492
|
-
be as K,
|
|
493
|
-
le as L,
|
|
494
|
-
Tt as M,
|
|
495
|
-
Ee as N,
|
|
496
|
-
Wt as O,
|
|
497
|
-
_e as P,
|
|
498
|
-
ee as Q,
|
|
499
|
-
Qt as R,
|
|
500
|
-
ne as S,
|
|
501
|
-
ye as T,
|
|
502
|
-
Zt as U,
|
|
503
|
-
Ae as V,
|
|
504
|
-
we as a,
|
|
505
|
-
Le as b,
|
|
506
|
-
ie as c,
|
|
507
|
-
Se as d,
|
|
508
|
-
Te as e,
|
|
509
|
-
Ne as f,
|
|
510
|
-
Yt as g,
|
|
511
|
-
xe as h,
|
|
512
|
-
m as i,
|
|
513
|
-
Xt as j,
|
|
514
|
-
Pe as k,
|
|
515
|
-
vt as l,
|
|
516
|
-
ce as m,
|
|
517
|
-
yt as n,
|
|
518
|
-
Ct as o,
|
|
519
|
-
Oe as p,
|
|
520
|
-
ue as q,
|
|
521
|
-
fe as r,
|
|
522
|
-
Vt as s,
|
|
523
|
-
te as t,
|
|
524
|
-
St as u,
|
|
525
|
-
de as v,
|
|
526
|
-
ge as w,
|
|
527
|
-
Ht as x,
|
|
528
|
-
he as y,
|
|
529
|
-
Ce as z
|
|
530
|
-
};
|