tiptap-editor-codeveda 0.9.0 → 0.9.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.
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import * as ge from "react";
|
|
2
|
-
import Ze, { useState as
|
|
3
|
-
import { NodeViewWrapper as ce, NodeViewContent as Ct, ReactNodeViewRenderer as De, useCurrentEditor as
|
|
4
|
-
import
|
|
5
|
-
import { Table as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { TextStyle as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { Check as
|
|
16
|
-
import { createLowlight as
|
|
17
|
-
import { Mark as
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import { Slot as
|
|
23
|
-
import { cva as
|
|
24
|
-
import { clsx as
|
|
25
|
-
import { twMerge as
|
|
26
|
-
import { useMergeRefs as
|
|
27
|
-
import { createPortal as
|
|
2
|
+
import Ze, { useState as B, useRef as _e, useEffect as Y, useMemo as ln, useCallback as Pe } from "react";
|
|
3
|
+
import { NodeViewWrapper as ce, NodeViewContent as Ct, ReactNodeViewRenderer as De, useCurrentEditor as Bn, useEditor as zn, EditorContent as Un } from "@tiptap/react";
|
|
4
|
+
import As from "@tiptap/starter-kit";
|
|
5
|
+
import { Table as Fn, TableView as Os } from "@tiptap/extension-table";
|
|
6
|
+
import Hn from "@tiptap/extension-table-row";
|
|
7
|
+
import $n from "@tiptap/extension-table-cell";
|
|
8
|
+
import Kn from "@tiptap/extension-table-header";
|
|
9
|
+
import Rs from "@tiptap/extension-image";
|
|
10
|
+
import Ms from "@tiptap/extension-link";
|
|
11
|
+
import { TextStyle as Is } from "@tiptap/extension-text-style";
|
|
12
|
+
import Ls from "@tiptap/extension-color";
|
|
13
|
+
import js from "@tiptap/extension-highlight";
|
|
14
|
+
import Ds from "@tiptap/extension-code-block-lowlight";
|
|
15
|
+
import { Check as Ps, Copy as Jn, Trash2 as nt, Settings as Wn, ExternalLink as Bs, Minimize as zs, Maximize as Us, Code2 as cn, Eye as Fs, Play as Hs, Heading1 as qn, Heading2 as Vn, Heading3 as Gn, Heading4 as $s, FileText as Yn, List as Ks, ListOrdered as Js, Table as Ws, Quote as qs, Minus as Kt, Image as Zn, Video as Vs, Code as Zt, PanelTopOpen as Gs, ChevronDown as Xn, Frame as Ys, MonitorPlay as Zs, Columns3 as Xs, Bold as Qs, Italic as eo, Underline as to, Strikethrough as no, Type as ro, Palette as Qn, Link as so, Plus as it, Terminal as oo, Lock as io, LockOpen as ao } from "lucide-react";
|
|
16
|
+
import { createLowlight as lo, all as co } from "lowlight";
|
|
17
|
+
import { Mark as uo, Node as ke, mergeAttributes as de, findParentNode as fo, isTextSelection as ho, posToDOMRect as er, Extension as tr, getText as mo, getTextSerializersFromSchema as po } from "@tiptap/core";
|
|
18
|
+
import go from "@tiptap/extension-underline";
|
|
19
|
+
import bo from "@tiptap/extension-strike";
|
|
20
|
+
import wo from "@tiptap/extension-blockquote";
|
|
21
|
+
import yo from "@tiptap/extension-horizontal-rule";
|
|
22
|
+
import { Slot as xo } from "@radix-ui/react-slot";
|
|
23
|
+
import { cva as vo } from "class-variance-authority";
|
|
24
|
+
import { clsx as Eo } from "clsx";
|
|
25
|
+
import { twMerge as No } from "tailwind-merge";
|
|
26
|
+
import { useMergeRefs as nr, FloatingPortal as Co, FloatingDelayGroup as To, useFloating as So, offset as _o, flip as ko, shift as Ao, autoUpdate as Oo, useHover as Ro, useFocus as Mo, useDismiss as Io, useRole as Lo, useInteractions as jo } from "@floating-ui/react";
|
|
27
|
+
import { createPortal as rr } from "react-dom";
|
|
28
28
|
var at = { exports: {} }, qe = {};
|
|
29
29
|
/**
|
|
30
30
|
* @license React
|
|
@@ -36,7 +36,7 @@ var at = { exports: {} }, qe = {};
|
|
|
36
36
|
* LICENSE file in the root directory of this source tree.
|
|
37
37
|
*/
|
|
38
38
|
var dn;
|
|
39
|
-
function
|
|
39
|
+
function Do() {
|
|
40
40
|
if (dn) return qe;
|
|
41
41
|
dn = 1;
|
|
42
42
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
@@ -68,7 +68,7 @@ var Ve = {};
|
|
|
68
68
|
* LICENSE file in the root directory of this source tree.
|
|
69
69
|
*/
|
|
70
70
|
var un;
|
|
71
|
-
function
|
|
71
|
+
function Po() {
|
|
72
72
|
return un || (un = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
73
73
|
function t(m) {
|
|
74
74
|
if (m == null) return null;
|
|
@@ -78,13 +78,13 @@ function Do() {
|
|
|
78
78
|
switch (m) {
|
|
79
79
|
case w:
|
|
80
80
|
return "Fragment";
|
|
81
|
-
case
|
|
81
|
+
case _:
|
|
82
82
|
return "Profiler";
|
|
83
83
|
case g:
|
|
84
84
|
return "StrictMode";
|
|
85
85
|
case y:
|
|
86
86
|
return "Suspense";
|
|
87
|
-
case
|
|
87
|
+
case k:
|
|
88
88
|
return "SuspenseList";
|
|
89
89
|
case L:
|
|
90
90
|
return "Activity";
|
|
@@ -104,7 +104,7 @@ function Do() {
|
|
|
104
104
|
return m = m.displayName, m || (m = E.displayName || E.name || "", m = m !== "" ? "ForwardRef(" + m + ")" : "ForwardRef"), m;
|
|
105
105
|
case A:
|
|
106
106
|
return E = m.displayName || null, E !== null ? E : t(m.type) || "Memo";
|
|
107
|
-
case
|
|
107
|
+
case z:
|
|
108
108
|
E = m._payload, m = m._init;
|
|
109
109
|
try {
|
|
110
110
|
return t(m(E));
|
|
@@ -125,17 +125,17 @@ function Do() {
|
|
|
125
125
|
}
|
|
126
126
|
if (E) {
|
|
127
127
|
E = console;
|
|
128
|
-
var R = E.error,
|
|
128
|
+
var R = E.error, P = typeof Symbol == "function" && Symbol.toStringTag && m[Symbol.toStringTag] || m.constructor.name || "Object";
|
|
129
129
|
return R.call(
|
|
130
130
|
E,
|
|
131
131
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
132
|
-
|
|
132
|
+
P
|
|
133
133
|
), e(m);
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
function r(m) {
|
|
137
137
|
if (m === w) return "<>";
|
|
138
|
-
if (typeof m == "object" && m !== null && m.$$typeof ===
|
|
138
|
+
if (typeof m == "object" && m !== null && m.$$typeof === z)
|
|
139
139
|
return "<...>";
|
|
140
140
|
try {
|
|
141
141
|
var E = t(m);
|
|
@@ -160,7 +160,7 @@ function Do() {
|
|
|
160
160
|
}
|
|
161
161
|
function l(m, E) {
|
|
162
162
|
function R() {
|
|
163
|
-
|
|
163
|
+
J || (J = !0, console.error(
|
|
164
164
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
165
165
|
E
|
|
166
166
|
));
|
|
@@ -172,11 +172,11 @@ function Do() {
|
|
|
172
172
|
}
|
|
173
173
|
function c() {
|
|
174
174
|
var m = t(this.type);
|
|
175
|
-
return
|
|
175
|
+
return H[m] || (H[m] = !0, console.error(
|
|
176
176
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
177
177
|
)), m = this.props.ref, m !== void 0 ? m : null;
|
|
178
178
|
}
|
|
179
|
-
function d(m, E, R,
|
|
179
|
+
function d(m, E, R, P, q, V, te, oe) {
|
|
180
180
|
return R = V.ref, m = {
|
|
181
181
|
$$typeof: h,
|
|
182
182
|
type: m,
|
|
@@ -208,13 +208,13 @@ function Do() {
|
|
|
208
208
|
value: oe
|
|
209
209
|
}), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
|
|
210
210
|
}
|
|
211
|
-
function u(m, E, R,
|
|
211
|
+
function u(m, E, R, P, q, V, te, oe) {
|
|
212
212
|
var G = E.children;
|
|
213
213
|
if (G !== void 0)
|
|
214
|
-
if (
|
|
215
|
-
if (
|
|
216
|
-
for (
|
|
217
|
-
f(G[
|
|
214
|
+
if (P)
|
|
215
|
+
if (j(G)) {
|
|
216
|
+
for (P = 0; P < G.length; P++)
|
|
217
|
+
f(G[P]);
|
|
218
218
|
Object.freeze && Object.freeze(G);
|
|
219
219
|
} else
|
|
220
220
|
console.error(
|
|
@@ -226,18 +226,18 @@ function Do() {
|
|
|
226
226
|
var ne = Object.keys(E).filter(function(ot) {
|
|
227
227
|
return ot !== "key";
|
|
228
228
|
});
|
|
229
|
-
|
|
229
|
+
P = 0 < ne.length ? "{key: someKey, " + ne.join(": ..., ") + ": ...}" : "{key: someKey}", O[G + P] || (ne = 0 < ne.length ? "{" + ne.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
230
230
|
`A props object containing a "key" prop is being spread into JSX:
|
|
231
231
|
let props = %s;
|
|
232
232
|
<%s {...props} />
|
|
233
233
|
React keys must be passed directly to JSX without using spread:
|
|
234
234
|
let props = %s;
|
|
235
235
|
<%s key={someKey} {...props} />`,
|
|
236
|
-
|
|
236
|
+
P,
|
|
237
237
|
G,
|
|
238
238
|
ne,
|
|
239
239
|
G
|
|
240
|
-
), O[G +
|
|
240
|
+
), O[G + P] = !0);
|
|
241
241
|
}
|
|
242
242
|
if (G = null, R !== void 0 && (n(R), G = "" + R), a(E) && (n(E.key), G = "" + E.key), "key" in E) {
|
|
243
243
|
R = {};
|
|
@@ -261,7 +261,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
261
261
|
function f(m) {
|
|
262
262
|
typeof m == "object" && m !== null && m.$$typeof === h && m._store && (m._store.validated = 1);
|
|
263
263
|
}
|
|
264
|
-
var p = Ze, h = Symbol.for("react.transitional.element"), b = Symbol.for("react.portal"), w = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"),
|
|
264
|
+
var p = Ze, h = Symbol.for("react.transitional.element"), b = Symbol.for("react.portal"), w = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), _ = Symbol.for("react.profiler"), N = Symbol.for("react.consumer"), x = Symbol.for("react.context"), T = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), k = Symbol.for("react.suspense_list"), A = Symbol.for("react.memo"), z = Symbol.for("react.lazy"), L = Symbol.for("react.activity"), C = Symbol.for("react.client.reference"), M = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, v = Object.prototype.hasOwnProperty, j = Array.isArray, D = console.createTask ? console.createTask : function() {
|
|
265
265
|
return null;
|
|
266
266
|
};
|
|
267
267
|
p = {
|
|
@@ -269,68 +269,68 @@ React keys must be passed directly to JSX without using spread:
|
|
|
269
269
|
return m();
|
|
270
270
|
}
|
|
271
271
|
};
|
|
272
|
-
var
|
|
272
|
+
var J, H = {}, W = p.react_stack_bottom_frame.bind(
|
|
273
273
|
p,
|
|
274
274
|
o
|
|
275
|
-
)(),
|
|
276
|
-
Ve.Fragment = w, Ve.jsx = function(m, E, R,
|
|
275
|
+
)(), S = D(r(o)), O = {};
|
|
276
|
+
Ve.Fragment = w, Ve.jsx = function(m, E, R, P, q) {
|
|
277
277
|
var V = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
278
278
|
return u(
|
|
279
279
|
m,
|
|
280
280
|
E,
|
|
281
281
|
R,
|
|
282
282
|
!1,
|
|
283
|
-
|
|
283
|
+
P,
|
|
284
284
|
q,
|
|
285
285
|
V ? Error("react-stack-top-frame") : W,
|
|
286
|
-
V ?
|
|
286
|
+
V ? D(r(m)) : S
|
|
287
287
|
);
|
|
288
|
-
}, Ve.jsxs = function(m, E, R,
|
|
288
|
+
}, Ve.jsxs = function(m, E, R, P, q) {
|
|
289
289
|
var V = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
290
290
|
return u(
|
|
291
291
|
m,
|
|
292
292
|
E,
|
|
293
293
|
R,
|
|
294
294
|
!0,
|
|
295
|
-
|
|
295
|
+
P,
|
|
296
296
|
q,
|
|
297
297
|
V ? Error("react-stack-top-frame") : W,
|
|
298
|
-
V ?
|
|
298
|
+
V ? D(r(m)) : S
|
|
299
299
|
);
|
|
300
300
|
};
|
|
301
301
|
})()), Ve;
|
|
302
302
|
}
|
|
303
303
|
var fn;
|
|
304
|
-
function
|
|
305
|
-
return fn || (fn = 1, process.env.NODE_ENV === "production" ? at.exports =
|
|
304
|
+
function Bo() {
|
|
305
|
+
return fn || (fn = 1, process.env.NODE_ENV === "production" ? at.exports = Do() : at.exports = Po()), at.exports;
|
|
306
306
|
}
|
|
307
|
-
var i =
|
|
308
|
-
const
|
|
307
|
+
var i = Bo();
|
|
308
|
+
const sr = As.configure({
|
|
309
309
|
codeBlock: !1
|
|
310
310
|
// We'll use our own code block with syntax highlighting
|
|
311
|
-
}),
|
|
311
|
+
}), zo = Fn.configure({
|
|
312
312
|
resizable: !0
|
|
313
|
-
}),
|
|
313
|
+
}), Uo = Fn.extend({
|
|
314
314
|
addNodeView() {
|
|
315
|
-
return ({ node: t }) => new
|
|
315
|
+
return ({ node: t }) => new Os(t, this.options.cellMinWidth);
|
|
316
316
|
}
|
|
317
|
-
}).configure({ resizable: !1 }),
|
|
317
|
+
}).configure({ resizable: !1 }), or = Rs.configure({
|
|
318
318
|
inline: !1,
|
|
319
319
|
allowBase64: !1,
|
|
320
320
|
// Disable base64 to force URL usage
|
|
321
321
|
HTMLAttributes: {
|
|
322
322
|
class: "max-w-full h-auto rounded-lg shadow-sm"
|
|
323
323
|
}
|
|
324
|
-
}),
|
|
324
|
+
}), ir = Ms.configure({
|
|
325
325
|
openOnClick: !1,
|
|
326
326
|
autolink: !0,
|
|
327
327
|
defaultProtocol: "https"
|
|
328
|
-
}),
|
|
328
|
+
}), ar = Is, lr = Ls.configure({
|
|
329
329
|
types: ["textStyle"]
|
|
330
|
-
}),
|
|
330
|
+
}), cr = js.configure({
|
|
331
331
|
multicolor: !0
|
|
332
|
-
}),
|
|
333
|
-
const [e, n] =
|
|
332
|
+
}), Fo = ({ node: t }) => {
|
|
333
|
+
const [e, n] = B(!1), r = _e(null);
|
|
334
334
|
Y(() => () => {
|
|
335
335
|
r.current && clearTimeout(r.current);
|
|
336
336
|
}, []);
|
|
@@ -349,12 +349,12 @@ const rr = ks.configure({
|
|
|
349
349
|
onClick: s,
|
|
350
350
|
"aria-label": e ? "Copied!" : "Copy code",
|
|
351
351
|
title: e ? "Copied!" : "Copy code",
|
|
352
|
-
children: e ? /* @__PURE__ */ i.jsx(
|
|
352
|
+
children: e ? /* @__PURE__ */ i.jsx(Ps, { className: "h-4 w-4" }) : /* @__PURE__ */ i.jsx(Jn, { className: "h-4 w-4" })
|
|
353
353
|
}
|
|
354
354
|
),
|
|
355
355
|
/* @__PURE__ */ i.jsx("pre", { children: /* @__PURE__ */ i.jsx(Ct, { style: { whiteSpace: "pre", wordBreak: "normal", overflowWrap: "normal" } }) })
|
|
356
356
|
] });
|
|
357
|
-
},
|
|
357
|
+
}, Ho = (t) => ({
|
|
358
358
|
IMPORTANT: {
|
|
359
359
|
scope: "meta",
|
|
360
360
|
begin: "!important"
|
|
@@ -387,7 +387,7 @@ const rr = ks.configure({
|
|
|
387
387
|
className: "attr",
|
|
388
388
|
begin: /--[A-Za-z_][A-Za-z0-9_-]*/
|
|
389
389
|
}
|
|
390
|
-
}),
|
|
390
|
+
}), $o = [
|
|
391
391
|
"a",
|
|
392
392
|
"abbr",
|
|
393
393
|
"address",
|
|
@@ -465,7 +465,7 @@ const rr = ks.configure({
|
|
|
465
465
|
"ul",
|
|
466
466
|
"var",
|
|
467
467
|
"video"
|
|
468
|
-
],
|
|
468
|
+
], Ko = [
|
|
469
469
|
"defs",
|
|
470
470
|
"g",
|
|
471
471
|
"marker",
|
|
@@ -507,10 +507,10 @@ const rr = ks.configure({
|
|
|
507
507
|
"tspan",
|
|
508
508
|
"foreignObject",
|
|
509
509
|
"clipPath"
|
|
510
|
-
], Ko = [
|
|
511
|
-
...Ho,
|
|
512
|
-
...$o
|
|
513
510
|
], Jo = [
|
|
511
|
+
...$o,
|
|
512
|
+
...Ko
|
|
513
|
+
], Wo = [
|
|
514
514
|
"any-hover",
|
|
515
515
|
"any-pointer",
|
|
516
516
|
"aspect-ratio",
|
|
@@ -545,7 +545,7 @@ const rr = ks.configure({
|
|
|
545
545
|
"max-width",
|
|
546
546
|
"min-height",
|
|
547
547
|
"max-height"
|
|
548
|
-
].sort().reverse(),
|
|
548
|
+
].sort().reverse(), qo = [
|
|
549
549
|
"active",
|
|
550
550
|
"any-link",
|
|
551
551
|
"blank",
|
|
@@ -619,7 +619,7 @@ const rr = ks.configure({
|
|
|
619
619
|
"visited",
|
|
620
620
|
"where"
|
|
621
621
|
// where()
|
|
622
|
-
].sort().reverse(),
|
|
622
|
+
].sort().reverse(), Vo = [
|
|
623
623
|
"after",
|
|
624
624
|
"backdrop",
|
|
625
625
|
"before",
|
|
@@ -634,7 +634,7 @@ const rr = ks.configure({
|
|
|
634
634
|
"selection",
|
|
635
635
|
"slotted",
|
|
636
636
|
"spelling-error"
|
|
637
|
-
].sort().reverse(),
|
|
637
|
+
].sort().reverse(), Go = [
|
|
638
638
|
"accent-color",
|
|
639
639
|
"align-content",
|
|
640
640
|
"align-items",
|
|
@@ -1151,8 +1151,8 @@ const rr = ks.configure({
|
|
|
1151
1151
|
"z-index",
|
|
1152
1152
|
"zoom"
|
|
1153
1153
|
].sort().reverse();
|
|
1154
|
-
function
|
|
1155
|
-
const e = t.regex, n =
|
|
1154
|
+
function Yo(t) {
|
|
1155
|
+
const e = t.regex, n = Ho(t), r = { begin: /-(webkit|moz|ms|o)-(?=[a-z])/ }, s = "and or not only", o = /@-?\w[\w]*(-\w+)*/, a = "[a-zA-Z-][a-zA-Z0-9_-]*", l = [
|
|
1156
1156
|
t.APOS_STRING_MODE,
|
|
1157
1157
|
t.QUOTE_STRING_MODE
|
|
1158
1158
|
];
|
|
@@ -1186,8 +1186,8 @@ function Go(t) {
|
|
|
1186
1186
|
{
|
|
1187
1187
|
className: "selector-pseudo",
|
|
1188
1188
|
variants: [
|
|
1189
|
-
{ begin: ":(" +
|
|
1190
|
-
{ begin: ":(:)?(" +
|
|
1189
|
+
{ begin: ":(" + qo.join("|") + ")" },
|
|
1190
|
+
{ begin: ":(:)?(" + Vo.join("|") + ")" }
|
|
1191
1191
|
]
|
|
1192
1192
|
},
|
|
1193
1193
|
// we may actually need this (12/2020)
|
|
@@ -1199,7 +1199,7 @@ function Go(t) {
|
|
|
1199
1199
|
n.CSS_VARIABLE,
|
|
1200
1200
|
{
|
|
1201
1201
|
className: "attribute",
|
|
1202
|
-
begin: "\\b(" +
|
|
1202
|
+
begin: "\\b(" + Go.join("|") + ")\\b"
|
|
1203
1203
|
},
|
|
1204
1204
|
// attribute values
|
|
1205
1205
|
{
|
|
@@ -1254,7 +1254,7 @@ function Go(t) {
|
|
|
1254
1254
|
keywords: {
|
|
1255
1255
|
$pattern: /[a-z-]+/,
|
|
1256
1256
|
keyword: s,
|
|
1257
|
-
attribute:
|
|
1257
|
+
attribute: Wo.join(" ")
|
|
1258
1258
|
},
|
|
1259
1259
|
contains: [
|
|
1260
1260
|
{
|
|
@@ -1269,12 +1269,12 @@ function Go(t) {
|
|
|
1269
1269
|
},
|
|
1270
1270
|
{
|
|
1271
1271
|
className: "selector-tag",
|
|
1272
|
-
begin: "\\b(" +
|
|
1272
|
+
begin: "\\b(" + Jo.join("|") + ")\\b"
|
|
1273
1273
|
}
|
|
1274
1274
|
]
|
|
1275
1275
|
};
|
|
1276
1276
|
}
|
|
1277
|
-
const hn = "[A-Za-z$_][0-9A-Za-z$_]*",
|
|
1277
|
+
const hn = "[A-Za-z$_][0-9A-Za-z$_]*", Zo = [
|
|
1278
1278
|
"as",
|
|
1279
1279
|
// for exports
|
|
1280
1280
|
"in",
|
|
@@ -1319,14 +1319,14 @@ const hn = "[A-Za-z$_][0-9A-Za-z$_]*", Yo = [
|
|
|
1319
1319
|
"extends",
|
|
1320
1320
|
// It's reached stage 3, which is "recommended for implementation":
|
|
1321
1321
|
"using"
|
|
1322
|
-
],
|
|
1322
|
+
], Xo = [
|
|
1323
1323
|
"true",
|
|
1324
1324
|
"false",
|
|
1325
1325
|
"null",
|
|
1326
1326
|
"undefined",
|
|
1327
1327
|
"NaN",
|
|
1328
1328
|
"Infinity"
|
|
1329
|
-
],
|
|
1329
|
+
], dr = [
|
|
1330
1330
|
// Fundamental objects
|
|
1331
1331
|
"Object",
|
|
1332
1332
|
"Function",
|
|
@@ -1376,7 +1376,7 @@ const hn = "[A-Za-z$_][0-9A-Za-z$_]*", Yo = [
|
|
|
1376
1376
|
"Intl",
|
|
1377
1377
|
// WebAssembly
|
|
1378
1378
|
"WebAssembly"
|
|
1379
|
-
],
|
|
1379
|
+
], ur = [
|
|
1380
1380
|
"Error",
|
|
1381
1381
|
"EvalError",
|
|
1382
1382
|
"InternalError",
|
|
@@ -1385,7 +1385,7 @@ const hn = "[A-Za-z$_][0-9A-Za-z$_]*", Yo = [
|
|
|
1385
1385
|
"SyntaxError",
|
|
1386
1386
|
"TypeError",
|
|
1387
1387
|
"URIError"
|
|
1388
|
-
],
|
|
1388
|
+
], fr = [
|
|
1389
1389
|
"setInterval",
|
|
1390
1390
|
"setTimeout",
|
|
1391
1391
|
"clearInterval",
|
|
@@ -1403,7 +1403,7 @@ const hn = "[A-Za-z$_][0-9A-Za-z$_]*", Yo = [
|
|
|
1403
1403
|
"encodeURIComponent",
|
|
1404
1404
|
"escape",
|
|
1405
1405
|
"unescape"
|
|
1406
|
-
],
|
|
1406
|
+
], Qo = [
|
|
1407
1407
|
"arguments",
|
|
1408
1408
|
"this",
|
|
1409
1409
|
"super",
|
|
@@ -1415,15 +1415,15 @@ const hn = "[A-Za-z$_][0-9A-Za-z$_]*", Yo = [
|
|
|
1415
1415
|
"module",
|
|
1416
1416
|
"global"
|
|
1417
1417
|
// Node.js
|
|
1418
|
-
],
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1418
|
+
], ei = [].concat(
|
|
1419
|
+
fr,
|
|
1420
|
+
dr,
|
|
1421
|
+
ur
|
|
1422
1422
|
);
|
|
1423
|
-
function
|
|
1424
|
-
const e = t.regex, n = (
|
|
1425
|
-
const m = "</" +
|
|
1426
|
-
return
|
|
1423
|
+
function ti(t) {
|
|
1424
|
+
const e = t.regex, n = (S, { after: O }) => {
|
|
1425
|
+
const m = "</" + S[0].slice(1);
|
|
1426
|
+
return S.input.indexOf(m, O) !== -1;
|
|
1427
1427
|
}, r = hn, s = {
|
|
1428
1428
|
begin: "<>",
|
|
1429
1429
|
end: "</>"
|
|
@@ -1434,8 +1434,8 @@ function ei(t) {
|
|
|
1434
1434
|
* @param {RegExpMatchArray} match
|
|
1435
1435
|
* @param {CallbackResponse} response
|
|
1436
1436
|
*/
|
|
1437
|
-
isTrulyOpeningTag: (
|
|
1438
|
-
const m =
|
|
1437
|
+
isTrulyOpeningTag: (S, O) => {
|
|
1438
|
+
const m = S[0].length + S.index, E = S.input[m];
|
|
1439
1439
|
if (
|
|
1440
1440
|
// HTML should not include another raw `<` inside a tag
|
|
1441
1441
|
// nested type?
|
|
@@ -1447,24 +1447,24 @@ function ei(t) {
|
|
|
1447
1447
|
O.ignoreMatch();
|
|
1448
1448
|
return;
|
|
1449
1449
|
}
|
|
1450
|
-
E === ">" && (n(
|
|
1450
|
+
E === ">" && (n(S, { after: m }) || O.ignoreMatch());
|
|
1451
1451
|
let R;
|
|
1452
|
-
const
|
|
1453
|
-
if (R =
|
|
1452
|
+
const P = S.input.substring(m);
|
|
1453
|
+
if (R = P.match(/^\s*=/)) {
|
|
1454
1454
|
O.ignoreMatch();
|
|
1455
1455
|
return;
|
|
1456
1456
|
}
|
|
1457
|
-
if ((R =
|
|
1457
|
+
if ((R = P.match(/^\s+extends\s+/)) && R.index === 0) {
|
|
1458
1458
|
O.ignoreMatch();
|
|
1459
1459
|
return;
|
|
1460
1460
|
}
|
|
1461
1461
|
}
|
|
1462
1462
|
}, l = {
|
|
1463
1463
|
$pattern: hn,
|
|
1464
|
-
keyword:
|
|
1465
|
-
literal:
|
|
1466
|
-
built_in:
|
|
1467
|
-
"variable.language":
|
|
1464
|
+
keyword: Zo,
|
|
1465
|
+
literal: Xo,
|
|
1466
|
+
built_in: ei,
|
|
1467
|
+
"variable.language": Qo
|
|
1468
1468
|
}, c = "[0-9](_?[0-9])*", d = `\\.(${c})`, u = "0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*", f = {
|
|
1469
1469
|
className: "number",
|
|
1470
1470
|
variants: [
|
|
@@ -1610,7 +1610,7 @@ function ei(t) {
|
|
|
1610
1610
|
keywords: l,
|
|
1611
1611
|
contains: ["self"].concat(T)
|
|
1612
1612
|
}
|
|
1613
|
-
]),
|
|
1613
|
+
]), k = {
|
|
1614
1614
|
className: "params",
|
|
1615
1615
|
// convert this to negative lookbehind in v12
|
|
1616
1616
|
begin: /(\s*)\(/,
|
|
@@ -1653,7 +1653,7 @@ function ei(t) {
|
|
|
1653
1653
|
}
|
|
1654
1654
|
}
|
|
1655
1655
|
]
|
|
1656
|
-
},
|
|
1656
|
+
}, z = {
|
|
1657
1657
|
relevance: 0,
|
|
1658
1658
|
match: e.either(
|
|
1659
1659
|
// Hard coded exceptions
|
|
@@ -1673,8 +1673,8 @@ function ei(t) {
|
|
|
1673
1673
|
keywords: {
|
|
1674
1674
|
_: [
|
|
1675
1675
|
// se we still get relevance credit for JS library classes
|
|
1676
|
-
...
|
|
1677
|
-
...
|
|
1676
|
+
...dr,
|
|
1677
|
+
...ur
|
|
1678
1678
|
]
|
|
1679
1679
|
}
|
|
1680
1680
|
}, L = {
|
|
@@ -1705,30 +1705,30 @@ function ei(t) {
|
|
|
1705
1705
|
3: "title.function"
|
|
1706
1706
|
},
|
|
1707
1707
|
label: "func.def",
|
|
1708
|
-
contains: [
|
|
1708
|
+
contains: [k],
|
|
1709
1709
|
illegal: /%/
|
|
1710
1710
|
}, M = {
|
|
1711
1711
|
relevance: 0,
|
|
1712
1712
|
match: /\b[A-Z][A-Z_0-9]+\b/,
|
|
1713
1713
|
className: "variable.constant"
|
|
1714
1714
|
};
|
|
1715
|
-
function v(
|
|
1716
|
-
return e.concat("(?!",
|
|
1715
|
+
function v(S) {
|
|
1716
|
+
return e.concat("(?!", S.join("|"), ")");
|
|
1717
1717
|
}
|
|
1718
|
-
const
|
|
1718
|
+
const j = {
|
|
1719
1719
|
match: e.concat(
|
|
1720
1720
|
/\b/,
|
|
1721
1721
|
v([
|
|
1722
|
-
...
|
|
1722
|
+
...fr,
|
|
1723
1723
|
"super",
|
|
1724
1724
|
"import"
|
|
1725
|
-
].map((
|
|
1725
|
+
].map((S) => `${S}\\s*\\(`)),
|
|
1726
1726
|
r,
|
|
1727
1727
|
e.lookahead(/\s*\(/)
|
|
1728
1728
|
),
|
|
1729
1729
|
className: "title.function",
|
|
1730
1730
|
relevance: 0
|
|
1731
|
-
},
|
|
1731
|
+
}, D = {
|
|
1732
1732
|
begin: e.concat(/\./, e.lookahead(
|
|
1733
1733
|
e.concat(r, /(?![0-9A-Za-z$_(])/)
|
|
1734
1734
|
)),
|
|
@@ -1737,7 +1737,7 @@ function ei(t) {
|
|
|
1737
1737
|
keywords: "prototype",
|
|
1738
1738
|
className: "property",
|
|
1739
1739
|
relevance: 0
|
|
1740
|
-
},
|
|
1740
|
+
}, J = {
|
|
1741
1741
|
match: [
|
|
1742
1742
|
/get|set/,
|
|
1743
1743
|
/\s+/,
|
|
@@ -1753,9 +1753,9 @@ function ei(t) {
|
|
|
1753
1753
|
// eat to avoid empty params
|
|
1754
1754
|
begin: /\(\)/
|
|
1755
1755
|
},
|
|
1756
|
-
|
|
1756
|
+
k
|
|
1757
1757
|
]
|
|
1758
|
-
},
|
|
1758
|
+
}, H = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + t.UNDERSCORE_IDENT_RE + ")\\s*=>", W = {
|
|
1759
1759
|
match: [
|
|
1760
1760
|
/const|var|let/,
|
|
1761
1761
|
/\s+/,
|
|
@@ -1764,7 +1764,7 @@ function ei(t) {
|
|
|
1764
1764
|
/=\s*/,
|
|
1765
1765
|
/(async\s*)?/,
|
|
1766
1766
|
// async is optional
|
|
1767
|
-
e.lookahead(
|
|
1767
|
+
e.lookahead(H)
|
|
1768
1768
|
],
|
|
1769
1769
|
keywords: "async",
|
|
1770
1770
|
className: {
|
|
@@ -1772,7 +1772,7 @@ function ei(t) {
|
|
|
1772
1772
|
3: "title.function"
|
|
1773
1773
|
},
|
|
1774
1774
|
contains: [
|
|
1775
|
-
|
|
1775
|
+
k
|
|
1776
1776
|
]
|
|
1777
1777
|
};
|
|
1778
1778
|
return {
|
|
@@ -1780,7 +1780,7 @@ function ei(t) {
|
|
|
1780
1780
|
aliases: ["js", "jsx", "mjs", "cjs"],
|
|
1781
1781
|
keywords: l,
|
|
1782
1782
|
// this will be extended by TypeScript
|
|
1783
|
-
exports: { PARAMS_CONTAINS: y, CLASS_REFERENCE:
|
|
1783
|
+
exports: { PARAMS_CONTAINS: y, CLASS_REFERENCE: z },
|
|
1784
1784
|
illegal: /#(?![$_A-z])/,
|
|
1785
1785
|
contains: [
|
|
1786
1786
|
t.SHEBANG({
|
|
@@ -1799,7 +1799,7 @@ function ei(t) {
|
|
|
1799
1799
|
// Skip numbers when they are part of a variable name
|
|
1800
1800
|
{ match: /\$\d+/ },
|
|
1801
1801
|
f,
|
|
1802
|
-
|
|
1802
|
+
z,
|
|
1803
1803
|
{
|
|
1804
1804
|
scope: "attr",
|
|
1805
1805
|
match: r + e.lookahead(":"),
|
|
@@ -1819,7 +1819,7 @@ function ei(t) {
|
|
|
1819
1819
|
// we have to count the parens to make sure we actually have the
|
|
1820
1820
|
// correct bounding ( ) before the =>. There could be any number of
|
|
1821
1821
|
// sub-expressions inside also surrounded by parens.
|
|
1822
|
-
begin:
|
|
1822
|
+
begin: H,
|
|
1823
1823
|
returnBegin: !0,
|
|
1824
1824
|
end: "\\s*=>",
|
|
1825
1825
|
contains: [
|
|
@@ -1896,7 +1896,7 @@ function ei(t) {
|
|
|
1896
1896
|
returnBegin: !0,
|
|
1897
1897
|
label: "func.def",
|
|
1898
1898
|
contains: [
|
|
1899
|
-
|
|
1899
|
+
k,
|
|
1900
1900
|
t.inherit(t.TITLE_MODE, { begin: r, className: "title.function" })
|
|
1901
1901
|
]
|
|
1902
1902
|
},
|
|
@@ -1905,7 +1905,7 @@ function ei(t) {
|
|
|
1905
1905
|
match: /\.\.\./,
|
|
1906
1906
|
relevance: 0
|
|
1907
1907
|
},
|
|
1908
|
-
|
|
1908
|
+
D,
|
|
1909
1909
|
// hack: prevents detection of keywords in some circumstances
|
|
1910
1910
|
// .keyword()
|
|
1911
1911
|
// $keyword = x
|
|
@@ -1916,12 +1916,12 @@ function ei(t) {
|
|
|
1916
1916
|
{
|
|
1917
1917
|
match: [/\bconstructor(?=\s*\()/],
|
|
1918
1918
|
className: { 1: "title.function" },
|
|
1919
|
-
contains: [
|
|
1919
|
+
contains: [k]
|
|
1920
1920
|
},
|
|
1921
|
-
|
|
1921
|
+
j,
|
|
1922
1922
|
M,
|
|
1923
1923
|
A,
|
|
1924
|
-
|
|
1924
|
+
J,
|
|
1925
1925
|
{
|
|
1926
1926
|
match: /\$[(.]/
|
|
1927
1927
|
// relevance booster for a pattern common to JS libs: `$(something)` and `$.something`
|
|
@@ -1929,7 +1929,7 @@ function ei(t) {
|
|
|
1929
1929
|
]
|
|
1930
1930
|
};
|
|
1931
1931
|
}
|
|
1932
|
-
const wt = "[A-Za-z$_][0-9A-Za-z$_]*",
|
|
1932
|
+
const wt = "[A-Za-z$_][0-9A-Za-z$_]*", hr = [
|
|
1933
1933
|
"as",
|
|
1934
1934
|
// for exports
|
|
1935
1935
|
"in",
|
|
@@ -1974,14 +1974,14 @@ const wt = "[A-Za-z$_][0-9A-Za-z$_]*", fr = [
|
|
|
1974
1974
|
"extends",
|
|
1975
1975
|
// It's reached stage 3, which is "recommended for implementation":
|
|
1976
1976
|
"using"
|
|
1977
|
-
],
|
|
1977
|
+
], mr = [
|
|
1978
1978
|
"true",
|
|
1979
1979
|
"false",
|
|
1980
1980
|
"null",
|
|
1981
1981
|
"undefined",
|
|
1982
1982
|
"NaN",
|
|
1983
1983
|
"Infinity"
|
|
1984
|
-
],
|
|
1984
|
+
], pr = [
|
|
1985
1985
|
// Fundamental objects
|
|
1986
1986
|
"Object",
|
|
1987
1987
|
"Function",
|
|
@@ -2031,7 +2031,7 @@ const wt = "[A-Za-z$_][0-9A-Za-z$_]*", fr = [
|
|
|
2031
2031
|
"Intl",
|
|
2032
2032
|
// WebAssembly
|
|
2033
2033
|
"WebAssembly"
|
|
2034
|
-
],
|
|
2034
|
+
], gr = [
|
|
2035
2035
|
"Error",
|
|
2036
2036
|
"EvalError",
|
|
2037
2037
|
"InternalError",
|
|
@@ -2040,7 +2040,7 @@ const wt = "[A-Za-z$_][0-9A-Za-z$_]*", fr = [
|
|
|
2040
2040
|
"SyntaxError",
|
|
2041
2041
|
"TypeError",
|
|
2042
2042
|
"URIError"
|
|
2043
|
-
],
|
|
2043
|
+
], br = [
|
|
2044
2044
|
"setInterval",
|
|
2045
2045
|
"setTimeout",
|
|
2046
2046
|
"clearInterval",
|
|
@@ -2058,7 +2058,7 @@ const wt = "[A-Za-z$_][0-9A-Za-z$_]*", fr = [
|
|
|
2058
2058
|
"encodeURIComponent",
|
|
2059
2059
|
"escape",
|
|
2060
2060
|
"unescape"
|
|
2061
|
-
],
|
|
2061
|
+
], wr = [
|
|
2062
2062
|
"arguments",
|
|
2063
2063
|
"this",
|
|
2064
2064
|
"super",
|
|
@@ -2070,15 +2070,15 @@ const wt = "[A-Za-z$_][0-9A-Za-z$_]*", fr = [
|
|
|
2070
2070
|
"module",
|
|
2071
2071
|
"global"
|
|
2072
2072
|
// Node.js
|
|
2073
|
-
],
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2073
|
+
], yr = [].concat(
|
|
2074
|
+
br,
|
|
2075
|
+
pr,
|
|
2076
|
+
gr
|
|
2077
2077
|
);
|
|
2078
|
-
function
|
|
2079
|
-
const e = t.regex, n = (
|
|
2080
|
-
const m = "</" +
|
|
2081
|
-
return
|
|
2078
|
+
function ni(t) {
|
|
2079
|
+
const e = t.regex, n = (S, { after: O }) => {
|
|
2080
|
+
const m = "</" + S[0].slice(1);
|
|
2081
|
+
return S.input.indexOf(m, O) !== -1;
|
|
2082
2082
|
}, r = wt, s = {
|
|
2083
2083
|
begin: "<>",
|
|
2084
2084
|
end: "</>"
|
|
@@ -2089,8 +2089,8 @@ function ti(t) {
|
|
|
2089
2089
|
* @param {RegExpMatchArray} match
|
|
2090
2090
|
* @param {CallbackResponse} response
|
|
2091
2091
|
*/
|
|
2092
|
-
isTrulyOpeningTag: (
|
|
2093
|
-
const m =
|
|
2092
|
+
isTrulyOpeningTag: (S, O) => {
|
|
2093
|
+
const m = S[0].length + S.index, E = S.input[m];
|
|
2094
2094
|
if (
|
|
2095
2095
|
// HTML should not include another raw `<` inside a tag
|
|
2096
2096
|
// nested type?
|
|
@@ -2102,24 +2102,24 @@ function ti(t) {
|
|
|
2102
2102
|
O.ignoreMatch();
|
|
2103
2103
|
return;
|
|
2104
2104
|
}
|
|
2105
|
-
E === ">" && (n(
|
|
2105
|
+
E === ">" && (n(S, { after: m }) || O.ignoreMatch());
|
|
2106
2106
|
let R;
|
|
2107
|
-
const
|
|
2108
|
-
if (R =
|
|
2107
|
+
const P = S.input.substring(m);
|
|
2108
|
+
if (R = P.match(/^\s*=/)) {
|
|
2109
2109
|
O.ignoreMatch();
|
|
2110
2110
|
return;
|
|
2111
2111
|
}
|
|
2112
|
-
if ((R =
|
|
2112
|
+
if ((R = P.match(/^\s+extends\s+/)) && R.index === 0) {
|
|
2113
2113
|
O.ignoreMatch();
|
|
2114
2114
|
return;
|
|
2115
2115
|
}
|
|
2116
2116
|
}
|
|
2117
2117
|
}, l = {
|
|
2118
2118
|
$pattern: wt,
|
|
2119
|
-
keyword:
|
|
2120
|
-
literal:
|
|
2121
|
-
built_in:
|
|
2122
|
-
"variable.language":
|
|
2119
|
+
keyword: hr,
|
|
2120
|
+
literal: mr,
|
|
2121
|
+
built_in: yr,
|
|
2122
|
+
"variable.language": wr
|
|
2123
2123
|
}, c = "[0-9](_?[0-9])*", d = `\\.(${c})`, u = "0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*", f = {
|
|
2124
2124
|
className: "number",
|
|
2125
2125
|
variants: [
|
|
@@ -2265,7 +2265,7 @@ function ti(t) {
|
|
|
2265
2265
|
keywords: l,
|
|
2266
2266
|
contains: ["self"].concat(T)
|
|
2267
2267
|
}
|
|
2268
|
-
]),
|
|
2268
|
+
]), k = {
|
|
2269
2269
|
className: "params",
|
|
2270
2270
|
// convert this to negative lookbehind in v12
|
|
2271
2271
|
begin: /(\s*)\(/,
|
|
@@ -2308,7 +2308,7 @@ function ti(t) {
|
|
|
2308
2308
|
}
|
|
2309
2309
|
}
|
|
2310
2310
|
]
|
|
2311
|
-
},
|
|
2311
|
+
}, z = {
|
|
2312
2312
|
relevance: 0,
|
|
2313
2313
|
match: e.either(
|
|
2314
2314
|
// Hard coded exceptions
|
|
@@ -2328,8 +2328,8 @@ function ti(t) {
|
|
|
2328
2328
|
keywords: {
|
|
2329
2329
|
_: [
|
|
2330
2330
|
// se we still get relevance credit for JS library classes
|
|
2331
|
-
...
|
|
2332
|
-
...
|
|
2331
|
+
...pr,
|
|
2332
|
+
...gr
|
|
2333
2333
|
]
|
|
2334
2334
|
}
|
|
2335
2335
|
}, L = {
|
|
@@ -2360,30 +2360,30 @@ function ti(t) {
|
|
|
2360
2360
|
3: "title.function"
|
|
2361
2361
|
},
|
|
2362
2362
|
label: "func.def",
|
|
2363
|
-
contains: [
|
|
2363
|
+
contains: [k],
|
|
2364
2364
|
illegal: /%/
|
|
2365
2365
|
}, M = {
|
|
2366
2366
|
relevance: 0,
|
|
2367
2367
|
match: /\b[A-Z][A-Z_0-9]+\b/,
|
|
2368
2368
|
className: "variable.constant"
|
|
2369
2369
|
};
|
|
2370
|
-
function v(
|
|
2371
|
-
return e.concat("(?!",
|
|
2370
|
+
function v(S) {
|
|
2371
|
+
return e.concat("(?!", S.join("|"), ")");
|
|
2372
2372
|
}
|
|
2373
|
-
const
|
|
2373
|
+
const j = {
|
|
2374
2374
|
match: e.concat(
|
|
2375
2375
|
/\b/,
|
|
2376
2376
|
v([
|
|
2377
|
-
...
|
|
2377
|
+
...br,
|
|
2378
2378
|
"super",
|
|
2379
2379
|
"import"
|
|
2380
|
-
].map((
|
|
2380
|
+
].map((S) => `${S}\\s*\\(`)),
|
|
2381
2381
|
r,
|
|
2382
2382
|
e.lookahead(/\s*\(/)
|
|
2383
2383
|
),
|
|
2384
2384
|
className: "title.function",
|
|
2385
2385
|
relevance: 0
|
|
2386
|
-
},
|
|
2386
|
+
}, D = {
|
|
2387
2387
|
begin: e.concat(/\./, e.lookahead(
|
|
2388
2388
|
e.concat(r, /(?![0-9A-Za-z$_(])/)
|
|
2389
2389
|
)),
|
|
@@ -2392,7 +2392,7 @@ function ti(t) {
|
|
|
2392
2392
|
keywords: "prototype",
|
|
2393
2393
|
className: "property",
|
|
2394
2394
|
relevance: 0
|
|
2395
|
-
},
|
|
2395
|
+
}, J = {
|
|
2396
2396
|
match: [
|
|
2397
2397
|
/get|set/,
|
|
2398
2398
|
/\s+/,
|
|
@@ -2408,9 +2408,9 @@ function ti(t) {
|
|
|
2408
2408
|
// eat to avoid empty params
|
|
2409
2409
|
begin: /\(\)/
|
|
2410
2410
|
},
|
|
2411
|
-
|
|
2411
|
+
k
|
|
2412
2412
|
]
|
|
2413
|
-
},
|
|
2413
|
+
}, H = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + t.UNDERSCORE_IDENT_RE + ")\\s*=>", W = {
|
|
2414
2414
|
match: [
|
|
2415
2415
|
/const|var|let/,
|
|
2416
2416
|
/\s+/,
|
|
@@ -2419,7 +2419,7 @@ function ti(t) {
|
|
|
2419
2419
|
/=\s*/,
|
|
2420
2420
|
/(async\s*)?/,
|
|
2421
2421
|
// async is optional
|
|
2422
|
-
e.lookahead(
|
|
2422
|
+
e.lookahead(H)
|
|
2423
2423
|
],
|
|
2424
2424
|
keywords: "async",
|
|
2425
2425
|
className: {
|
|
@@ -2427,7 +2427,7 @@ function ti(t) {
|
|
|
2427
2427
|
3: "title.function"
|
|
2428
2428
|
},
|
|
2429
2429
|
contains: [
|
|
2430
|
-
|
|
2430
|
+
k
|
|
2431
2431
|
]
|
|
2432
2432
|
};
|
|
2433
2433
|
return {
|
|
@@ -2435,7 +2435,7 @@ function ti(t) {
|
|
|
2435
2435
|
aliases: ["js", "jsx", "mjs", "cjs"],
|
|
2436
2436
|
keywords: l,
|
|
2437
2437
|
// this will be extended by TypeScript
|
|
2438
|
-
exports: { PARAMS_CONTAINS: y, CLASS_REFERENCE:
|
|
2438
|
+
exports: { PARAMS_CONTAINS: y, CLASS_REFERENCE: z },
|
|
2439
2439
|
illegal: /#(?![$_A-z])/,
|
|
2440
2440
|
contains: [
|
|
2441
2441
|
t.SHEBANG({
|
|
@@ -2454,7 +2454,7 @@ function ti(t) {
|
|
|
2454
2454
|
// Skip numbers when they are part of a variable name
|
|
2455
2455
|
{ match: /\$\d+/ },
|
|
2456
2456
|
f,
|
|
2457
|
-
|
|
2457
|
+
z,
|
|
2458
2458
|
{
|
|
2459
2459
|
scope: "attr",
|
|
2460
2460
|
match: r + e.lookahead(":"),
|
|
@@ -2474,7 +2474,7 @@ function ti(t) {
|
|
|
2474
2474
|
// we have to count the parens to make sure we actually have the
|
|
2475
2475
|
// correct bounding ( ) before the =>. There could be any number of
|
|
2476
2476
|
// sub-expressions inside also surrounded by parens.
|
|
2477
|
-
begin:
|
|
2477
|
+
begin: H,
|
|
2478
2478
|
returnBegin: !0,
|
|
2479
2479
|
end: "\\s*=>",
|
|
2480
2480
|
contains: [
|
|
@@ -2551,7 +2551,7 @@ function ti(t) {
|
|
|
2551
2551
|
returnBegin: !0,
|
|
2552
2552
|
label: "func.def",
|
|
2553
2553
|
contains: [
|
|
2554
|
-
|
|
2554
|
+
k,
|
|
2555
2555
|
t.inherit(t.TITLE_MODE, { begin: r, className: "title.function" })
|
|
2556
2556
|
]
|
|
2557
2557
|
},
|
|
@@ -2560,7 +2560,7 @@ function ti(t) {
|
|
|
2560
2560
|
match: /\.\.\./,
|
|
2561
2561
|
relevance: 0
|
|
2562
2562
|
},
|
|
2563
|
-
|
|
2563
|
+
D,
|
|
2564
2564
|
// hack: prevents detection of keywords in some circumstances
|
|
2565
2565
|
// .keyword()
|
|
2566
2566
|
// $keyword = x
|
|
@@ -2571,12 +2571,12 @@ function ti(t) {
|
|
|
2571
2571
|
{
|
|
2572
2572
|
match: [/\bconstructor(?=\s*\()/],
|
|
2573
2573
|
className: { 1: "title.function" },
|
|
2574
|
-
contains: [
|
|
2574
|
+
contains: [k]
|
|
2575
2575
|
},
|
|
2576
|
-
|
|
2576
|
+
j,
|
|
2577
2577
|
M,
|
|
2578
2578
|
A,
|
|
2579
|
-
|
|
2579
|
+
J,
|
|
2580
2580
|
{
|
|
2581
2581
|
match: /\$[(.]/
|
|
2582
2582
|
// relevance booster for a pattern common to JS libs: `$(something)` and `$.something`
|
|
@@ -2584,8 +2584,8 @@ function ti(t) {
|
|
|
2584
2584
|
]
|
|
2585
2585
|
};
|
|
2586
2586
|
}
|
|
2587
|
-
function
|
|
2588
|
-
const e = t.regex, n =
|
|
2587
|
+
function ri(t) {
|
|
2588
|
+
const e = t.regex, n = ni(t), r = wt, s = [
|
|
2589
2589
|
"any",
|
|
2590
2590
|
"void",
|
|
2591
2591
|
"number",
|
|
@@ -2635,18 +2635,18 @@ function ni(t) {
|
|
|
2635
2635
|
"satisfies"
|
|
2636
2636
|
], d = {
|
|
2637
2637
|
$pattern: wt,
|
|
2638
|
-
keyword:
|
|
2639
|
-
literal:
|
|
2640
|
-
built_in:
|
|
2641
|
-
"variable.language":
|
|
2638
|
+
keyword: hr.concat(c),
|
|
2639
|
+
literal: mr,
|
|
2640
|
+
built_in: yr.concat(s),
|
|
2641
|
+
"variable.language": wr
|
|
2642
2642
|
}, u = {
|
|
2643
2643
|
className: "meta",
|
|
2644
2644
|
begin: "@" + r
|
|
2645
|
-
}, f = (w, g,
|
|
2645
|
+
}, f = (w, g, _) => {
|
|
2646
2646
|
const N = w.contains.findIndex((x) => x.label === g);
|
|
2647
2647
|
if (N === -1)
|
|
2648
2648
|
throw new Error("can not find mode to replace");
|
|
2649
|
-
w.contains.splice(N, 1,
|
|
2649
|
+
w.contains.splice(N, 1, _);
|
|
2650
2650
|
};
|
|
2651
2651
|
Object.assign(n.keywords, d), n.exports.PARAMS_CONTAINS.push(u);
|
|
2652
2652
|
const p = n.contains.find((w) => w.scope === "attr"), h = Object.assign(
|
|
@@ -2679,7 +2679,7 @@ function ni(t) {
|
|
|
2679
2679
|
]
|
|
2680
2680
|
}), n;
|
|
2681
2681
|
}
|
|
2682
|
-
function
|
|
2682
|
+
function si(t) {
|
|
2683
2683
|
const e = t.regex, n = e.concat(/[\p{L}_]/u, e.optional(/[\p{L}0-9_.-]*:/u), /[\p{L}0-9_.-]*/u), r = /[\p{L}0-9._:-]+/u, s = {
|
|
2684
2684
|
className: "symbol",
|
|
2685
2685
|
begin: /&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/
|
|
@@ -2895,7 +2895,7 @@ function ri(t) {
|
|
|
2895
2895
|
]
|
|
2896
2896
|
};
|
|
2897
2897
|
}
|
|
2898
|
-
function
|
|
2898
|
+
function oi(t) {
|
|
2899
2899
|
const e = t.regex, n = new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*", "u"), r = [
|
|
2900
2900
|
"and",
|
|
2901
2901
|
"as",
|
|
@@ -3182,7 +3182,7 @@ function si(t) {
|
|
|
3182
3182
|
endsWithParent: !0
|
|
3183
3183
|
}
|
|
3184
3184
|
]
|
|
3185
|
-
},
|
|
3185
|
+
}, _ = {
|
|
3186
3186
|
className: "params",
|
|
3187
3187
|
variants: [
|
|
3188
3188
|
// Exclude params in functions without params
|
|
@@ -3249,7 +3249,7 @@ function si(t) {
|
|
|
3249
3249
|
1: "keyword",
|
|
3250
3250
|
3: "title.function"
|
|
3251
3251
|
},
|
|
3252
|
-
contains: [
|
|
3252
|
+
contains: [_]
|
|
3253
3253
|
},
|
|
3254
3254
|
{
|
|
3255
3255
|
variants: [
|
|
@@ -3284,7 +3284,7 @@ function si(t) {
|
|
|
3284
3284
|
end: /(?=#)|$/,
|
|
3285
3285
|
contains: [
|
|
3286
3286
|
w,
|
|
3287
|
-
|
|
3287
|
+
_,
|
|
3288
3288
|
f
|
|
3289
3289
|
]
|
|
3290
3290
|
}
|
|
@@ -3314,11 +3314,11 @@ var Be = "[0-9](_*[0-9])*", lt = `\\.(${Be})`, ct = "[0-9a-fA-F](_*[0-9a-fA-F])*
|
|
|
3314
3314
|
],
|
|
3315
3315
|
relevance: 0
|
|
3316
3316
|
};
|
|
3317
|
-
function
|
|
3318
|
-
return n === -1 ? "" : t.replace(e, (r) =>
|
|
3317
|
+
function xr(t, e, n) {
|
|
3318
|
+
return n === -1 ? "" : t.replace(e, (r) => xr(t, e, n - 1));
|
|
3319
3319
|
}
|
|
3320
|
-
function
|
|
3321
|
-
const e = t.regex, n = "[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*", r = n +
|
|
3320
|
+
function ii(t) {
|
|
3321
|
+
const e = t.regex, n = "[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*", r = n + xr("(?:<" + n + "~~~(?:\\s*,\\s*" + n + "~~~)*>)?", /~~~/g, 2), c = {
|
|
3322
3322
|
keyword: [
|
|
3323
3323
|
"synchronized",
|
|
3324
3324
|
"abstract",
|
|
@@ -3528,7 +3528,7 @@ function oi(t) {
|
|
|
3528
3528
|
]
|
|
3529
3529
|
};
|
|
3530
3530
|
}
|
|
3531
|
-
function
|
|
3531
|
+
function ai(t) {
|
|
3532
3532
|
const e = t.regex, n = t.COMMENT("//", "$", { contains: [{ begin: /\\\n/ }] }), r = "decltype\\(auto\\)", s = "[a-zA-Z_]\\w*::", a = "(" + r + "|" + e.optional(s) + "[a-zA-Z_]\\w*" + e.optional("<[^<>]+>") + ")", l = {
|
|
3533
3533
|
className: "type",
|
|
3534
3534
|
variants: [
|
|
@@ -3669,7 +3669,7 @@ function ii(t) {
|
|
|
3669
3669
|
literal: "true false NULL",
|
|
3670
3670
|
// TODO: apply hinting work similar to what was done in cpp.js
|
|
3671
3671
|
built_in: "std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"
|
|
3672
|
-
},
|
|
3672
|
+
}, _ = [
|
|
3673
3673
|
f,
|
|
3674
3674
|
l,
|
|
3675
3675
|
n,
|
|
@@ -3695,12 +3695,12 @@ function ii(t) {
|
|
|
3695
3695
|
}
|
|
3696
3696
|
],
|
|
3697
3697
|
keywords: g,
|
|
3698
|
-
contains:
|
|
3698
|
+
contains: _.concat([
|
|
3699
3699
|
{
|
|
3700
3700
|
begin: /\(/,
|
|
3701
3701
|
end: /\)/,
|
|
3702
3702
|
keywords: g,
|
|
3703
|
-
contains:
|
|
3703
|
+
contains: _.concat(["self"]),
|
|
3704
3704
|
relevance: 0
|
|
3705
3705
|
}
|
|
3706
3706
|
]),
|
|
@@ -3777,7 +3777,7 @@ function ii(t) {
|
|
|
3777
3777
|
contains: [].concat(
|
|
3778
3778
|
N,
|
|
3779
3779
|
x,
|
|
3780
|
-
|
|
3780
|
+
_,
|
|
3781
3781
|
[
|
|
3782
3782
|
f,
|
|
3783
3783
|
{
|
|
@@ -3802,7 +3802,7 @@ function ii(t) {
|
|
|
3802
3802
|
}
|
|
3803
3803
|
};
|
|
3804
3804
|
}
|
|
3805
|
-
function
|
|
3805
|
+
function li(t) {
|
|
3806
3806
|
const e = t.regex, n = t.COMMENT("//", "$", { contains: [{ begin: /\\\n/ }] }), r = "decltype\\(auto\\)", s = "[a-zA-Z_]\\w*::", a = "(?!struct)(" + r + "|" + e.optional(s) + "[a-zA-Z_]\\w*" + e.optional("<[^<>]+>") + ")", l = {
|
|
3807
3807
|
className: "type",
|
|
3808
3808
|
begin: "\\b[a-z\\d_]*_t\\b"
|
|
@@ -4025,7 +4025,7 @@ function ai(t) {
|
|
|
4025
4025
|
"weak_ptr",
|
|
4026
4026
|
"wstring",
|
|
4027
4027
|
"wstring_view"
|
|
4028
|
-
],
|
|
4028
|
+
], _ = [
|
|
4029
4029
|
"abort",
|
|
4030
4030
|
"abs",
|
|
4031
4031
|
"acos",
|
|
@@ -4143,7 +4143,7 @@ function ai(t) {
|
|
|
4143
4143
|
relevance: 0,
|
|
4144
4144
|
keywords: {
|
|
4145
4145
|
// Only for relevance, not highlighting.
|
|
4146
|
-
_hint:
|
|
4146
|
+
_hint: _
|
|
4147
4147
|
},
|
|
4148
4148
|
begin: e.concat(
|
|
4149
4149
|
/\b/,
|
|
@@ -4155,7 +4155,7 @@ function ai(t) {
|
|
|
4155
4155
|
t.IDENT_RE,
|
|
4156
4156
|
e.lookahead(/(<[^<>]+>|)\s*\(/)
|
|
4157
4157
|
)
|
|
4158
|
-
},
|
|
4158
|
+
}, k = [
|
|
4159
4159
|
y,
|
|
4160
4160
|
f,
|
|
4161
4161
|
l,
|
|
@@ -4182,17 +4182,17 @@ function ai(t) {
|
|
|
4182
4182
|
}
|
|
4183
4183
|
],
|
|
4184
4184
|
keywords: T,
|
|
4185
|
-
contains:
|
|
4185
|
+
contains: k.concat([
|
|
4186
4186
|
{
|
|
4187
4187
|
begin: /\(/,
|
|
4188
4188
|
end: /\)/,
|
|
4189
4189
|
keywords: T,
|
|
4190
|
-
contains:
|
|
4190
|
+
contains: k.concat(["self"]),
|
|
4191
4191
|
relevance: 0
|
|
4192
4192
|
}
|
|
4193
4193
|
]),
|
|
4194
4194
|
relevance: 0
|
|
4195
|
-
},
|
|
4195
|
+
}, z = {
|
|
4196
4196
|
className: "function",
|
|
4197
4197
|
begin: "(" + a + "[\\*&\\s]+)+" + h,
|
|
4198
4198
|
returnBegin: !0,
|
|
@@ -4285,9 +4285,9 @@ function ai(t) {
|
|
|
4285
4285
|
classNameAliases: { "function.dispatch": "built_in" },
|
|
4286
4286
|
contains: [].concat(
|
|
4287
4287
|
A,
|
|
4288
|
-
|
|
4288
|
+
z,
|
|
4289
4289
|
y,
|
|
4290
|
-
|
|
4290
|
+
k,
|
|
4291
4291
|
[
|
|
4292
4292
|
f,
|
|
4293
4293
|
{
|
|
@@ -4320,7 +4320,7 @@ function ai(t) {
|
|
|
4320
4320
|
)
|
|
4321
4321
|
};
|
|
4322
4322
|
}
|
|
4323
|
-
function
|
|
4323
|
+
function ci(t) {
|
|
4324
4324
|
const e = t.regex, n = t.COMMENT("--", "$"), r = {
|
|
4325
4325
|
scope: "string",
|
|
4326
4326
|
variants: [
|
|
@@ -4879,7 +4879,7 @@ function li(t) {
|
|
|
4879
4879
|
scope: "operator",
|
|
4880
4880
|
match: /[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,
|
|
4881
4881
|
relevance: 0
|
|
4882
|
-
},
|
|
4882
|
+
}, _ = {
|
|
4883
4883
|
match: e.concat(/\b/, e.either(...h), /\s*\(/),
|
|
4884
4884
|
relevance: 0,
|
|
4885
4885
|
keywords: { built_in: h }
|
|
@@ -4887,7 +4887,7 @@ function li(t) {
|
|
|
4887
4887
|
function N(y) {
|
|
4888
4888
|
return e.concat(
|
|
4889
4889
|
/\b/,
|
|
4890
|
-
e.either(...y.map((
|
|
4890
|
+
e.either(...y.map((k) => k.replace(/\s+/, "\\s+"))),
|
|
4891
4891
|
/\b/
|
|
4892
4892
|
);
|
|
4893
4893
|
}
|
|
@@ -4897,11 +4897,11 @@ function li(t) {
|
|
|
4897
4897
|
relevance: 0
|
|
4898
4898
|
};
|
|
4899
4899
|
function T(y, {
|
|
4900
|
-
exceptions:
|
|
4900
|
+
exceptions: k,
|
|
4901
4901
|
when: A
|
|
4902
4902
|
} = {}) {
|
|
4903
|
-
const
|
|
4904
|
-
return
|
|
4903
|
+
const z = A;
|
|
4904
|
+
return k = k || [], y.map((L) => L.match(/\|\d+$/) || k.includes(L) ? L : z(L) ? `${L}|0` : L);
|
|
4905
4905
|
}
|
|
4906
4906
|
return {
|
|
4907
4907
|
name: "SQL",
|
|
@@ -4921,7 +4921,7 @@ function li(t) {
|
|
|
4921
4921
|
match: N(a)
|
|
4922
4922
|
},
|
|
4923
4923
|
x,
|
|
4924
|
-
|
|
4924
|
+
_,
|
|
4925
4925
|
w,
|
|
4926
4926
|
r,
|
|
4927
4927
|
s,
|
|
@@ -4932,7 +4932,7 @@ function li(t) {
|
|
|
4932
4932
|
]
|
|
4933
4933
|
};
|
|
4934
4934
|
}
|
|
4935
|
-
const
|
|
4935
|
+
const vr = uo.create({
|
|
4936
4936
|
name: "codeBlockBg",
|
|
4937
4937
|
addOptions() {
|
|
4938
4938
|
return {
|
|
@@ -4982,32 +4982,32 @@ const xr = co.create({
|
|
|
4982
4982
|
unsetCodeBlockBg: () => ({ commands: t }) => t.unsetMark(this.name)
|
|
4983
4983
|
};
|
|
4984
4984
|
}
|
|
4985
|
-
}), Ee =
|
|
4986
|
-
Ee.register("html",
|
|
4987
|
-
Ee.register("css",
|
|
4988
|
-
Ee.register("js",
|
|
4989
|
-
Ee.register("ts",
|
|
4990
|
-
Ee.register("java",
|
|
4991
|
-
Ee.register("c",
|
|
4992
|
-
Ee.register("cpp",
|
|
4993
|
-
Ee.register("python",
|
|
4994
|
-
Ee.register("sql",
|
|
4995
|
-
const
|
|
4985
|
+
}), Ee = lo(co);
|
|
4986
|
+
Ee.register("html", si);
|
|
4987
|
+
Ee.register("css", Yo);
|
|
4988
|
+
Ee.register("js", ti);
|
|
4989
|
+
Ee.register("ts", ri);
|
|
4990
|
+
Ee.register("java", ii);
|
|
4991
|
+
Ee.register("c", ai);
|
|
4992
|
+
Ee.register("cpp", li);
|
|
4993
|
+
Ee.register("python", oi);
|
|
4994
|
+
Ee.register("sql", ci);
|
|
4995
|
+
const Er = Ds.extend({
|
|
4996
4996
|
marks() {
|
|
4997
4997
|
return "codeBlockBg";
|
|
4998
4998
|
},
|
|
4999
4999
|
addNodeView() {
|
|
5000
|
-
return De(
|
|
5000
|
+
return De(Fo);
|
|
5001
5001
|
}
|
|
5002
5002
|
}).configure({
|
|
5003
5003
|
lowlight: Ee
|
|
5004
|
-
}),
|
|
5005
|
-
function
|
|
5004
|
+
}), Nr = go, Cr = bo, Tr = wo, Sr = yo;
|
|
5005
|
+
function di({
|
|
5006
5006
|
node: t,
|
|
5007
5007
|
updateAttributes: e,
|
|
5008
5008
|
editor: n
|
|
5009
5009
|
}) {
|
|
5010
|
-
const [r, s] =
|
|
5010
|
+
const [r, s] = B(t.attrs?.open ?? !0), [o, a] = B(!1), [l, c] = B(t.attrs?.title || "Output"), d = _e(null), u = n?.isEditable ?? !1;
|
|
5011
5011
|
Y(() => {
|
|
5012
5012
|
o && d.current && (d.current.focus(), d.current.select());
|
|
5013
5013
|
}, [o]);
|
|
@@ -5022,7 +5022,7 @@ function ci({
|
|
|
5022
5022
|
u && n && confirm("Are you sure you want to delete this accordion?") && n.chain().focus().deleteNode("accordion").run();
|
|
5023
5023
|
}, w = (g) => {
|
|
5024
5024
|
if (!u || !n) return;
|
|
5025
|
-
const { selection:
|
|
5025
|
+
const { selection: _ } = n.state, { $anchor: N } = _;
|
|
5026
5026
|
if (g.key === "Enter" && !g.shiftKey && N.nodeBefore?.type.name === "accordion") {
|
|
5027
5027
|
g.preventDefault(), g.stopPropagation();
|
|
5028
5028
|
const x = N.nodeBefore;
|
|
@@ -5030,17 +5030,17 @@ function ci({
|
|
|
5030
5030
|
const T = x.lastChild;
|
|
5031
5031
|
if (T && T.content.size > 0) {
|
|
5032
5032
|
let y = -1;
|
|
5033
|
-
if (n.state.doc.descendants((
|
|
5034
|
-
if (
|
|
5033
|
+
if (n.state.doc.descendants((k, A) => {
|
|
5034
|
+
if (k.type.name === "accordionItem")
|
|
5035
5035
|
return y = A, !1;
|
|
5036
5036
|
}), y !== -1) {
|
|
5037
|
-
const
|
|
5038
|
-
n.chain().focus().setTextSelection(
|
|
5037
|
+
const k = y + T.nodeSize - 2;
|
|
5038
|
+
n.chain().focus().setTextSelection(k).run();
|
|
5039
5039
|
}
|
|
5040
5040
|
} else {
|
|
5041
5041
|
let y = -1;
|
|
5042
|
-
n.state.doc.descendants((
|
|
5043
|
-
if (
|
|
5042
|
+
n.state.doc.descendants((k, A) => {
|
|
5043
|
+
if (k.type.name === "accordionItem")
|
|
5044
5044
|
return y = A, !1;
|
|
5045
5045
|
}), y !== -1 && n.chain().focus().setTextSelection(y + 1).run();
|
|
5046
5046
|
}
|
|
@@ -5057,13 +5057,13 @@ function ci({
|
|
|
5057
5057
|
return;
|
|
5058
5058
|
}
|
|
5059
5059
|
if (N.parent.type.name === "accordionItem") {
|
|
5060
|
-
const x = N.parent, T = N.parentOffset === 0, y = x.content.content.some((
|
|
5060
|
+
const x = N.parent, T = N.parentOffset === 0, y = x.content.content.some((k) => k.type.name === "paragraph" ? k.content.size > 0 : !0);
|
|
5061
5061
|
if (T && !y && g.key === "Backspace") {
|
|
5062
5062
|
g.preventDefault(), g.stopPropagation();
|
|
5063
5063
|
return;
|
|
5064
5064
|
}
|
|
5065
5065
|
}
|
|
5066
|
-
if (N.parent.type.name === "accordion" && !N.parent.content.content.some((y) => y.type.name === "accordionItem" ? y.content.content.some((
|
|
5066
|
+
if (N.parent.type.name === "accordion" && !N.parent.content.content.some((y) => y.type.name === "accordionItem" ? y.content.content.some((k) => k.type.name === "paragraph" ? k.content.size > 0 : !0) : !0)) {
|
|
5067
5067
|
g.preventDefault(), g.stopPropagation();
|
|
5068
5068
|
return;
|
|
5069
5069
|
}
|
|
@@ -5142,7 +5142,7 @@ function ci({
|
|
|
5142
5142
|
}
|
|
5143
5143
|
);
|
|
5144
5144
|
}
|
|
5145
|
-
const
|
|
5145
|
+
const _r = ke.create({
|
|
5146
5146
|
name: "accordion",
|
|
5147
5147
|
group: "block",
|
|
5148
5148
|
content: "accordionItem+",
|
|
@@ -5177,7 +5177,7 @@ const Sr = ke.create({
|
|
|
5177
5177
|
];
|
|
5178
5178
|
},
|
|
5179
5179
|
addNodeView() {
|
|
5180
|
-
return De(
|
|
5180
|
+
return De(di);
|
|
5181
5181
|
},
|
|
5182
5182
|
addKeyboardShortcuts() {
|
|
5183
5183
|
return {
|
|
@@ -5209,7 +5209,7 @@ const Sr = ke.create({
|
|
|
5209
5209
|
})
|
|
5210
5210
|
};
|
|
5211
5211
|
}
|
|
5212
|
-
}),
|
|
5212
|
+
}), kr = ke.create({
|
|
5213
5213
|
name: "accordionItem",
|
|
5214
5214
|
group: "block",
|
|
5215
5215
|
content: "block+",
|
|
@@ -5244,12 +5244,12 @@ const Sr = ke.create({
|
|
|
5244
5244
|
};
|
|
5245
5245
|
}
|
|
5246
5246
|
});
|
|
5247
|
-
function
|
|
5247
|
+
function ui({
|
|
5248
5248
|
node: t,
|
|
5249
5249
|
updateAttributes: e,
|
|
5250
5250
|
editor: n
|
|
5251
5251
|
}) {
|
|
5252
|
-
const [r, s] =
|
|
5252
|
+
const [r, s] = B(t.attrs?.activeTab ?? 0), [o, a] = B(null), [l, c] = B(""), d = _e(null), u = t.content?.content || [], f = n?.isEditable ?? !1;
|
|
5253
5253
|
Y(() => {
|
|
5254
5254
|
const x = t.attrs?.activeTab ?? 0;
|
|
5255
5255
|
x !== r && s(x);
|
|
@@ -5270,9 +5270,9 @@ function di({
|
|
|
5270
5270
|
return x = y, !1;
|
|
5271
5271
|
}), x !== -1 && n.chain().focus().command(({ tr: T, dispatch: y }) => {
|
|
5272
5272
|
if (y) {
|
|
5273
|
-
const
|
|
5274
|
-
|
|
5275
|
-
...
|
|
5273
|
+
const k = T.doc.nodeAt(x);
|
|
5274
|
+
k && T.setNodeMarkup(x, void 0, {
|
|
5275
|
+
...k.attrs,
|
|
5276
5276
|
title: l
|
|
5277
5277
|
});
|
|
5278
5278
|
}
|
|
@@ -5282,21 +5282,21 @@ function di({
|
|
|
5282
5282
|
a(null), c("");
|
|
5283
5283
|
}, g = (x) => {
|
|
5284
5284
|
x.key === "Enter" ? w() : x.key === "Escape" && (a(null), c(""));
|
|
5285
|
-
},
|
|
5285
|
+
}, _ = (x) => u[x]?.attrs?.title || `Tab ${x + 1}`, N = (x) => {
|
|
5286
5286
|
if (!f || !n) return;
|
|
5287
5287
|
const { selection: T } = n.state, { $anchor: y } = T;
|
|
5288
5288
|
if (x.key === "Enter" && !x.shiftKey && y.nodeBefore?.type.name === "tabs") {
|
|
5289
5289
|
x.preventDefault(), x.stopPropagation();
|
|
5290
|
-
const
|
|
5291
|
-
if (
|
|
5292
|
-
const A =
|
|
5290
|
+
const k = y.nodeBefore;
|
|
5291
|
+
if (k && k.childCount > 0) {
|
|
5292
|
+
const A = k.lastChild;
|
|
5293
5293
|
if (A && A.content.size > 0) {
|
|
5294
|
-
let
|
|
5294
|
+
let z = -1;
|
|
5295
5295
|
if (n.state.doc.descendants((L, C) => {
|
|
5296
|
-
if (L.type.name === "tabItem" && L.attrs.tabIndex ===
|
|
5297
|
-
return
|
|
5298
|
-
}),
|
|
5299
|
-
const L =
|
|
5296
|
+
if (L.type.name === "tabItem" && L.attrs.tabIndex === k.childCount - 1)
|
|
5297
|
+
return z = C, !1;
|
|
5298
|
+
}), z !== -1) {
|
|
5299
|
+
const L = z + A.nodeSize - 2;
|
|
5300
5300
|
n.chain().focus().setTextSelection(L).run();
|
|
5301
5301
|
}
|
|
5302
5302
|
}
|
|
@@ -5344,11 +5344,11 @@ function di({
|
|
|
5344
5344
|
"span",
|
|
5345
5345
|
{
|
|
5346
5346
|
onClick: f ? (y) => {
|
|
5347
|
-
y.stopPropagation(), h(T,
|
|
5347
|
+
y.stopPropagation(), h(T, _(T));
|
|
5348
5348
|
} : void 0,
|
|
5349
5349
|
className: `block w-full text-center ${f ? "cursor-text" : "cursor-pointer"}`,
|
|
5350
5350
|
title: f ? "Click to edit title" : void 0,
|
|
5351
|
-
children:
|
|
5351
|
+
children: _(T)
|
|
5352
5352
|
}
|
|
5353
5353
|
)
|
|
5354
5354
|
},
|
|
@@ -5376,7 +5376,7 @@ function di({
|
|
|
5376
5376
|
}
|
|
5377
5377
|
);
|
|
5378
5378
|
}
|
|
5379
|
-
function
|
|
5379
|
+
function fi({
|
|
5380
5380
|
node: t,
|
|
5381
5381
|
editor: e
|
|
5382
5382
|
}) {
|
|
@@ -5404,7 +5404,7 @@ function ui({
|
|
|
5404
5404
|
}
|
|
5405
5405
|
);
|
|
5406
5406
|
}
|
|
5407
|
-
const
|
|
5407
|
+
const Ar = ke.create({
|
|
5408
5408
|
name: "tabs",
|
|
5409
5409
|
group: "block",
|
|
5410
5410
|
content: "tabItem+",
|
|
@@ -5435,7 +5435,7 @@ const kr = ke.create({
|
|
|
5435
5435
|
return ["div", de(t, { "data-type": "tabs" }), 0];
|
|
5436
5436
|
},
|
|
5437
5437
|
addNodeView() {
|
|
5438
|
-
return De(
|
|
5438
|
+
return De(ui, {
|
|
5439
5439
|
contentDOMElementTag: "div"
|
|
5440
5440
|
});
|
|
5441
5441
|
},
|
|
@@ -5477,7 +5477,7 @@ const kr = ke.create({
|
|
|
5477
5477
|
}
|
|
5478
5478
|
};
|
|
5479
5479
|
}
|
|
5480
|
-
}),
|
|
5480
|
+
}), Or = ke.create({
|
|
5481
5481
|
name: "tabItem",
|
|
5482
5482
|
group: "block",
|
|
5483
5483
|
content: "block+",
|
|
@@ -5512,7 +5512,7 @@ const kr = ke.create({
|
|
|
5512
5512
|
];
|
|
5513
5513
|
},
|
|
5514
5514
|
addNodeView() {
|
|
5515
|
-
return De(
|
|
5515
|
+
return De(fi, {
|
|
5516
5516
|
contentDOMElementTag: "div"
|
|
5517
5517
|
});
|
|
5518
5518
|
},
|
|
@@ -5533,10 +5533,10 @@ const kr = ke.create({
|
|
|
5533
5533
|
};
|
|
5534
5534
|
}
|
|
5535
5535
|
});
|
|
5536
|
-
function
|
|
5537
|
-
return Eo(
|
|
5536
|
+
function hi(...t) {
|
|
5537
|
+
return No(Eo(t));
|
|
5538
5538
|
}
|
|
5539
|
-
const
|
|
5539
|
+
const mi = vo(
|
|
5540
5540
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
5541
5541
|
{
|
|
5542
5542
|
variants: {
|
|
@@ -5568,23 +5568,23 @@ function F({
|
|
|
5568
5568
|
asChild: r = !1,
|
|
5569
5569
|
...s
|
|
5570
5570
|
}) {
|
|
5571
|
-
const o = r ?
|
|
5571
|
+
const o = r ? xo : "button";
|
|
5572
5572
|
return /* @__PURE__ */ i.jsx(
|
|
5573
5573
|
o,
|
|
5574
5574
|
{
|
|
5575
5575
|
"data-slot": "button",
|
|
5576
|
-
className:
|
|
5576
|
+
className: hi(mi({ variant: e, size: n, className: t })),
|
|
5577
5577
|
...s
|
|
5578
5578
|
}
|
|
5579
5579
|
);
|
|
5580
5580
|
}
|
|
5581
|
-
const
|
|
5581
|
+
const pi = ({
|
|
5582
5582
|
node: t,
|
|
5583
5583
|
updateAttributes: e,
|
|
5584
5584
|
deleteNode: n,
|
|
5585
5585
|
editor: r
|
|
5586
5586
|
}) => {
|
|
5587
|
-
const [s, o] =
|
|
5587
|
+
const [s, o] = B(!1), [a, l] = B("simple"), [c, d] = B(""), [u, f] = B(!1), p = _e(null), [h, b] = B({
|
|
5588
5588
|
src: t.attrs.src || "",
|
|
5589
5589
|
width: t.attrs.width || "100%",
|
|
5590
5590
|
height: t.attrs.height || "500px",
|
|
@@ -5602,7 +5602,7 @@ const mi = ({
|
|
|
5602
5602
|
src: C,
|
|
5603
5603
|
sandbox: M
|
|
5604
5604
|
});
|
|
5605
|
-
},
|
|
5605
|
+
}, _ = () => {
|
|
5606
5606
|
x && (e(h), o(!1));
|
|
5607
5607
|
}, N = () => {
|
|
5608
5608
|
b({
|
|
@@ -5614,7 +5614,7 @@ const mi = ({
|
|
|
5614
5614
|
sandbox: t.attrs.sandbox || "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-presentation",
|
|
5615
5615
|
style: t.attrs.style || ""
|
|
5616
5616
|
}), o(!1);
|
|
5617
|
-
}, [x, T] =
|
|
5617
|
+
}, [x, T] = B(r?.isEditable ?? !1);
|
|
5618
5618
|
Y(() => {
|
|
5619
5619
|
if (r) {
|
|
5620
5620
|
const C = () => {
|
|
@@ -5627,7 +5627,7 @@ const mi = ({
|
|
|
5627
5627
|
}, [r]);
|
|
5628
5628
|
const y = () => {
|
|
5629
5629
|
x && o(!0);
|
|
5630
|
-
},
|
|
5630
|
+
}, k = () => {
|
|
5631
5631
|
const C = `<iframe src="${h.src}" style="width:${h.width}; height: ${h.height}; ${h.style}" title="${h.title}" allow="${h.allow}" sandbox="${h.sandbox}"></iframe>`;
|
|
5632
5632
|
navigator.clipboard.writeText(C);
|
|
5633
5633
|
}, A = () => {
|
|
@@ -5651,23 +5651,23 @@ const mi = ({
|
|
|
5651
5651
|
);
|
|
5652
5652
|
};
|
|
5653
5653
|
}, []);
|
|
5654
|
-
const
|
|
5655
|
-
const
|
|
5656
|
-
if (
|
|
5657
|
-
const
|
|
5658
|
-
src:
|
|
5659
|
-
width:
|
|
5660
|
-
height:
|
|
5661
|
-
title:
|
|
5662
|
-
allow:
|
|
5663
|
-
sandbox:
|
|
5664
|
-
style:
|
|
5654
|
+
const z = (C) => {
|
|
5655
|
+
const j = new DOMParser().parseFromString(C, "text/html").querySelector("iframe");
|
|
5656
|
+
if (j) {
|
|
5657
|
+
const D = j.getAttribute("src") || "", J = {
|
|
5658
|
+
src: D,
|
|
5659
|
+
width: j.getAttribute("width") || "100%",
|
|
5660
|
+
height: j.getAttribute("height") || "500px",
|
|
5661
|
+
title: j.getAttribute("title") || "",
|
|
5662
|
+
allow: j.getAttribute("allow") || "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
|
|
5663
|
+
sandbox: j.getAttribute("sandbox") || w(D),
|
|
5664
|
+
style: j.getAttribute("style") || ""
|
|
5665
5665
|
};
|
|
5666
|
-
return b(
|
|
5666
|
+
return b(J), !0;
|
|
5667
5667
|
}
|
|
5668
5668
|
return !1;
|
|
5669
5669
|
}, L = () => {
|
|
5670
|
-
|
|
5670
|
+
z(c) ? (l("simple"), d("")) : alert("Invalid iframe HTML code. Please check your input.");
|
|
5671
5671
|
};
|
|
5672
5672
|
return s ? /* @__PURE__ */ i.jsx(ce, { className: "iframe-extension-editing", children: /* @__PURE__ */ i.jsxs("div", { className: "border-2 border-blue-500 rounded-lg p-4 bg-blue-50", children: [
|
|
5673
5673
|
/* @__PURE__ */ i.jsxs("div", { className: "flex gap-2 mb-4", children: [
|
|
@@ -5790,7 +5790,7 @@ const mi = ({
|
|
|
5790
5790
|
/* @__PURE__ */ i.jsx(
|
|
5791
5791
|
F,
|
|
5792
5792
|
{
|
|
5793
|
-
onClick:
|
|
5793
|
+
onClick: _,
|
|
5794
5794
|
size: "sm",
|
|
5795
5795
|
className: "bg-blue-600 hover:bg-blue-700",
|
|
5796
5796
|
children: "Save"
|
|
@@ -5808,7 +5808,7 @@ const mi = ({
|
|
|
5808
5808
|
allow: t.attrs.allow,
|
|
5809
5809
|
sandbox: t.attrs.sandbox,
|
|
5810
5810
|
style: {
|
|
5811
|
-
...
|
|
5811
|
+
...gi(t.attrs.style),
|
|
5812
5812
|
...u ? {
|
|
5813
5813
|
width: "100vw",
|
|
5814
5814
|
height: "100vh"
|
|
@@ -5829,7 +5829,7 @@ const mi = ({
|
|
|
5829
5829
|
variant: "ghost",
|
|
5830
5830
|
className: "h-8 w-8 p-0",
|
|
5831
5831
|
title: "Edit iframe",
|
|
5832
|
-
children: /* @__PURE__ */ i.jsx(
|
|
5832
|
+
children: /* @__PURE__ */ i.jsx(Wn, { className: "h-4 w-4" })
|
|
5833
5833
|
}
|
|
5834
5834
|
),
|
|
5835
5835
|
/* @__PURE__ */ i.jsx(
|
|
@@ -5840,18 +5840,18 @@ const mi = ({
|
|
|
5840
5840
|
variant: "ghost",
|
|
5841
5841
|
className: "h-8 w-8 p-0",
|
|
5842
5842
|
title: "Open in new tab",
|
|
5843
|
-
children: /* @__PURE__ */ i.jsx(
|
|
5843
|
+
children: /* @__PURE__ */ i.jsx(Bs, { className: "h-4 w-4" })
|
|
5844
5844
|
}
|
|
5845
5845
|
),
|
|
5846
5846
|
/* @__PURE__ */ i.jsx(
|
|
5847
5847
|
F,
|
|
5848
5848
|
{
|
|
5849
|
-
onClick:
|
|
5849
|
+
onClick: k,
|
|
5850
5850
|
size: "sm",
|
|
5851
5851
|
variant: "ghost",
|
|
5852
5852
|
className: "h-8 w-8 p-0",
|
|
5853
5853
|
title: "Copy iframe code",
|
|
5854
|
-
children: /* @__PURE__ */ i.jsx(
|
|
5854
|
+
children: /* @__PURE__ */ i.jsx(Jn, { className: "h-4 w-4" })
|
|
5855
5855
|
}
|
|
5856
5856
|
),
|
|
5857
5857
|
/* @__PURE__ */ i.jsx(
|
|
@@ -5876,7 +5876,7 @@ const mi = ({
|
|
|
5876
5876
|
variant: "ghost",
|
|
5877
5877
|
className: "h-6 w-8 p-0 cursor-pointer",
|
|
5878
5878
|
title: u ? "Exit fullscreen" : "Enter fullscreen",
|
|
5879
|
-
children: u ? /* @__PURE__ */ i.jsx(
|
|
5879
|
+
children: u ? /* @__PURE__ */ i.jsx(zs, { className: "h-4 w-4" }) : /* @__PURE__ */ i.jsx(Us, { className: "h-4 w-4" })
|
|
5880
5880
|
}
|
|
5881
5881
|
) }),
|
|
5882
5882
|
x && t.attrs.src && /* @__PURE__ */ i.jsxs("div", { className: "mt-2 text-xs text-gray-500 bg-gray-100 px-2 py-1 rounded", children: [
|
|
@@ -5884,7 +5884,7 @@ const mi = ({
|
|
|
5884
5884
|
t.attrs.src
|
|
5885
5885
|
] })
|
|
5886
5886
|
] }) });
|
|
5887
|
-
},
|
|
5887
|
+
}, gi = (t) => {
|
|
5888
5888
|
const e = {};
|
|
5889
5889
|
return t && t.split(";").forEach((n) => {
|
|
5890
5890
|
const [r, s] = n.split(":").map((o) => o.trim());
|
|
@@ -5896,7 +5896,7 @@ const mi = ({
|
|
|
5896
5896
|
e[o] = s;
|
|
5897
5897
|
}
|
|
5898
5898
|
}), e;
|
|
5899
|
-
},
|
|
5899
|
+
}, Rr = ke.create({
|
|
5900
5900
|
name: "iframe",
|
|
5901
5901
|
group: "block",
|
|
5902
5902
|
atom: !0,
|
|
@@ -5965,7 +5965,7 @@ const mi = ({
|
|
|
5965
5965
|
return ["iframe", de(t)];
|
|
5966
5966
|
},
|
|
5967
5967
|
addNodeView() {
|
|
5968
|
-
return De(
|
|
5968
|
+
return De(pi);
|
|
5969
5969
|
},
|
|
5970
5970
|
addCommands() {
|
|
5971
5971
|
return {
|
|
@@ -6056,14 +6056,14 @@ ${t}
|
|
|
6056
6056
|
</body>
|
|
6057
6057
|
</html>`;
|
|
6058
6058
|
}
|
|
6059
|
-
const
|
|
6059
|
+
const bi = [
|
|
6060
6060
|
{ id: "html", label: "HTML" },
|
|
6061
6061
|
{ id: "css", label: "CSS" },
|
|
6062
6062
|
{ id: "js", label: "JS" }
|
|
6063
|
-
], Ge = "Interactive view", pt = "auto",
|
|
6063
|
+
], Ge = "Interactive view", pt = "auto", wi = (t) => {
|
|
6064
6064
|
const e = (t || "").trim().toLowerCase();
|
|
6065
6065
|
return e === "" || e === "auto" || e === "fit" || e === "fit-content" || e === "max" || e === "max-content";
|
|
6066
|
-
},
|
|
6066
|
+
}, gn = (t) => {
|
|
6067
6067
|
const e = (t || "").trim();
|
|
6068
6068
|
if (!e) return pt;
|
|
6069
6069
|
if (/^\d+(\.\d+)?$/.test(e)) return `${e}px`;
|
|
@@ -6075,13 +6075,13 @@ const gi = [
|
|
|
6075
6075
|
deleteNode: n,
|
|
6076
6076
|
editor: r
|
|
6077
6077
|
}) => {
|
|
6078
|
-
const [s, o] =
|
|
6078
|
+
const [s, o] = B(!!t.attrs.pendingEdit), [a, l] = B("html"), [c, d] = B("code"), [u, f] = B(0), [p, h] = B(null), b = Ze.useRef(null), w = Ze.useRef(null), [g, _] = B({
|
|
6079
6079
|
html: t.attrs.html || "",
|
|
6080
6080
|
css: t.attrs.css || "",
|
|
6081
6081
|
js: t.attrs.js || "",
|
|
6082
6082
|
height: t.attrs.height || pt,
|
|
6083
6083
|
title: t.attrs.title || Ge
|
|
6084
|
-
}), [N, x] =
|
|
6084
|
+
}), [N, x] = B(r?.isEditable ?? !1);
|
|
6085
6085
|
Y(() => {
|
|
6086
6086
|
t.attrs.pendingEdit && N && (o(!0), e({ pendingEdit: !1 }));
|
|
6087
6087
|
}, [t.attrs.pendingEdit, N, e]), Y(() => {
|
|
@@ -6097,8 +6097,8 @@ const gi = [
|
|
|
6097
6097
|
), y = ln(
|
|
6098
6098
|
() => pn(g.html, g.css, g.js),
|
|
6099
6099
|
[g.html, g.css, g.js]
|
|
6100
|
-
),
|
|
6101
|
-
N && (
|
|
6100
|
+
), k = () => {
|
|
6101
|
+
N && (_({
|
|
6102
6102
|
html: t.attrs.html || "",
|
|
6103
6103
|
css: t.attrs.css || "",
|
|
6104
6104
|
js: t.attrs.js || "",
|
|
@@ -6107,8 +6107,8 @@ const gi = [
|
|
|
6107
6107
|
}), l("html"), d("code"), o(!0));
|
|
6108
6108
|
}, A = () => {
|
|
6109
6109
|
N && (e(g), f((v) => v + 1), o(!1));
|
|
6110
|
-
},
|
|
6111
|
-
|
|
6110
|
+
}, z = () => {
|
|
6111
|
+
_({
|
|
6112
6112
|
html: t.attrs.html || "",
|
|
6113
6113
|
css: t.attrs.css || "",
|
|
6114
6114
|
js: t.attrs.js || "",
|
|
@@ -6117,20 +6117,30 @@ const gi = [
|
|
|
6117
6117
|
}), o(!1);
|
|
6118
6118
|
}, L = () => {
|
|
6119
6119
|
f((v) => v + 1), d("preview");
|
|
6120
|
-
}, C = (v,
|
|
6121
|
-
|
|
6120
|
+
}, C = (v, j) => {
|
|
6121
|
+
_((D) => ({ ...D, [v]: j }));
|
|
6122
6122
|
};
|
|
6123
6123
|
Y(() => {
|
|
6124
|
-
const v = (
|
|
6125
|
-
if (!w.current ||
|
|
6124
|
+
const v = (j) => {
|
|
6125
|
+
if (!w.current || j.source !== w.current.contentWindow)
|
|
6126
6126
|
return;
|
|
6127
|
-
const
|
|
6128
|
-
|
|
6127
|
+
const D = j.data;
|
|
6128
|
+
D && D.type === "live-preview-height" && typeof D.height == "number" && h(D.height);
|
|
6129
6129
|
};
|
|
6130
6130
|
return window.addEventListener("message", v), () => window.removeEventListener("message", v);
|
|
6131
6131
|
}, []);
|
|
6132
|
-
const M = (v,
|
|
6133
|
-
const
|
|
6132
|
+
const M = (v, j, D) => {
|
|
6133
|
+
const J = wi(j);
|
|
6134
|
+
let H, W = !1;
|
|
6135
|
+
if (p != null)
|
|
6136
|
+
if (J)
|
|
6137
|
+
H = `${p}px`;
|
|
6138
|
+
else {
|
|
6139
|
+
const S = gn(j), O = /^\d+(\.\d+)?px$/.test(S) ? parseFloat(S) : null;
|
|
6140
|
+
O != null ? H = `${Math.max(O, p)}px` : (H = S, W = !0);
|
|
6141
|
+
}
|
|
6142
|
+
else
|
|
6143
|
+
H = J ? "auto" : gn(j), W = !J;
|
|
6134
6144
|
return /* @__PURE__ */ i.jsx(
|
|
6135
6145
|
"iframe",
|
|
6136
6146
|
{
|
|
@@ -6139,22 +6149,22 @@ const gi = [
|
|
|
6139
6149
|
srcDoc: v,
|
|
6140
6150
|
sandbox: "allow-scripts allow-modals",
|
|
6141
6151
|
className: "live-preview-iframe",
|
|
6142
|
-
scrolling:
|
|
6143
|
-
onLoad: (
|
|
6144
|
-
|
|
6152
|
+
scrolling: W ? "auto" : "no",
|
|
6153
|
+
onLoad: (S) => {
|
|
6154
|
+
S.currentTarget.contentWindow?.postMessage(
|
|
6145
6155
|
{ type: "live-preview-request-height" },
|
|
6146
6156
|
"*"
|
|
6147
6157
|
);
|
|
6148
6158
|
},
|
|
6149
6159
|
style: {
|
|
6150
6160
|
width: "100%",
|
|
6151
|
-
height:
|
|
6161
|
+
height: H,
|
|
6152
6162
|
border: "none",
|
|
6153
6163
|
borderRadius: 0,
|
|
6154
6164
|
display: "block"
|
|
6155
6165
|
}
|
|
6156
6166
|
},
|
|
6157
|
-
|
|
6167
|
+
D
|
|
6158
6168
|
);
|
|
6159
6169
|
};
|
|
6160
6170
|
return s ? /* @__PURE__ */ i.jsx(ce, { className: "live-preview-extension live-preview-editing", children: /* @__PURE__ */ i.jsxs("div", { className: "live-preview-editor-panel", children: [
|
|
@@ -6187,7 +6197,7 @@ const gi = [
|
|
|
6187
6197
|
f((v) => v + 1), d("preview");
|
|
6188
6198
|
},
|
|
6189
6199
|
children: [
|
|
6190
|
-
/* @__PURE__ */ i.jsx(
|
|
6200
|
+
/* @__PURE__ */ i.jsx(Fs, { className: "h-3.5 w-3.5 mr-1" }),
|
|
6191
6201
|
"Preview"
|
|
6192
6202
|
]
|
|
6193
6203
|
}
|
|
@@ -6195,7 +6205,7 @@ const gi = [
|
|
|
6195
6205
|
] })
|
|
6196
6206
|
] }),
|
|
6197
6207
|
c === "code" ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
6198
|
-
/* @__PURE__ */ i.jsx("div", { className: "live-preview-tabs", children:
|
|
6208
|
+
/* @__PURE__ */ i.jsx("div", { className: "live-preview-tabs", children: bi.map((v) => /* @__PURE__ */ i.jsx(
|
|
6199
6209
|
"button",
|
|
6200
6210
|
{
|
|
6201
6211
|
type: "button",
|
|
@@ -6252,13 +6262,13 @@ const gi = [
|
|
|
6252
6262
|
onClick: L,
|
|
6253
6263
|
className: "text-green-700 border-green-300 hover:bg-green-50",
|
|
6254
6264
|
children: [
|
|
6255
|
-
/* @__PURE__ */ i.jsx(
|
|
6265
|
+
/* @__PURE__ */ i.jsx(Hs, { className: "h-3.5 w-3.5 mr-1" }),
|
|
6256
6266
|
"Run"
|
|
6257
6267
|
]
|
|
6258
6268
|
}
|
|
6259
6269
|
),
|
|
6260
6270
|
/* @__PURE__ */ i.jsx(F, { type: "button", size: "sm", onClick: A, children: "Save" }),
|
|
6261
|
-
/* @__PURE__ */ i.jsx(F, { type: "button", size: "sm", variant: "outline", onClick:
|
|
6271
|
+
/* @__PURE__ */ i.jsx(F, { type: "button", size: "sm", variant: "outline", onClick: z, children: "Cancel" })
|
|
6262
6272
|
] })
|
|
6263
6273
|
] }) }) : /* @__PURE__ */ i.jsx(ce, { className: "live-preview-extension", children: /* @__PURE__ */ i.jsxs("div", { ref: b, className: "live-preview-output group relative", children: [
|
|
6264
6274
|
M(T, t.attrs.height, u),
|
|
@@ -6271,8 +6281,8 @@ const gi = [
|
|
|
6271
6281
|
variant: "ghost",
|
|
6272
6282
|
className: "h-8 w-8 p-0",
|
|
6273
6283
|
title: "Edit code",
|
|
6274
|
-
onClick:
|
|
6275
|
-
children: /* @__PURE__ */ i.jsx(
|
|
6284
|
+
onClick: k,
|
|
6285
|
+
children: /* @__PURE__ */ i.jsx(Wn, { className: "h-4 w-4" })
|
|
6276
6286
|
}
|
|
6277
6287
|
),
|
|
6278
6288
|
/* @__PURE__ */ i.jsx(
|
|
@@ -6294,7 +6304,7 @@ const gi = [
|
|
|
6294
6304
|
function Dt(t, e) {
|
|
6295
6305
|
return t.querySelector(`[data-part="${e}"]`)?.textContent ?? "";
|
|
6296
6306
|
}
|
|
6297
|
-
const
|
|
6307
|
+
const Mr = ke.create({
|
|
6298
6308
|
name: "livePreview",
|
|
6299
6309
|
group: "block",
|
|
6300
6310
|
atom: !0,
|
|
@@ -6417,7 +6427,7 @@ const vi = ({ node: t }) => {
|
|
|
6417
6427
|
] }),
|
|
6418
6428
|
r && /* @__PURE__ */ i.jsx("div", { className: "video-caption", children: /* @__PURE__ */ i.jsx("span", { className: "video-caption-text", children: r }) })
|
|
6419
6429
|
] }) });
|
|
6420
|
-
}, Ei = "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
|
|
6430
|
+
}, Ei = "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share", Ir = ke.create({
|
|
6421
6431
|
name: "video",
|
|
6422
6432
|
addOptions() {
|
|
6423
6433
|
return {
|
|
@@ -6531,7 +6541,7 @@ const vi = ({ node: t }) => {
|
|
|
6531
6541
|
type: "paragraph"
|
|
6532
6542
|
}
|
|
6533
6543
|
]
|
|
6534
|
-
}),
|
|
6544
|
+
}), Lr = ke.create({
|
|
6535
6545
|
name: "columnLayout",
|
|
6536
6546
|
group: "block",
|
|
6537
6547
|
content: "column+",
|
|
@@ -6587,7 +6597,7 @@ const vi = ({ node: t }) => {
|
|
|
6587
6597
|
});
|
|
6588
6598
|
},
|
|
6589
6599
|
setColumnLayoutColumns: (t) => ({ state: e, dispatch: n }) => {
|
|
6590
|
-
const r =
|
|
6600
|
+
const r = fo((s) => s.type === this.type)(
|
|
6591
6601
|
e.selection
|
|
6592
6602
|
);
|
|
6593
6603
|
if (!r)
|
|
@@ -6608,7 +6618,7 @@ const vi = ({ node: t }) => {
|
|
|
6608
6618
|
}
|
|
6609
6619
|
};
|
|
6610
6620
|
}
|
|
6611
|
-
}),
|
|
6621
|
+
}), jr = ke.create({
|
|
6612
6622
|
name: "column",
|
|
6613
6623
|
content: "block+",
|
|
6614
6624
|
isolating: !0,
|
|
@@ -6638,21 +6648,21 @@ function Ci({
|
|
|
6638
6648
|
delay: s = 600,
|
|
6639
6649
|
closeDelay: o = 0
|
|
6640
6650
|
} = {}) {
|
|
6641
|
-
const [a, l] = ge.useState(t), c = n ?? a, d = r ?? l, u =
|
|
6651
|
+
const [a, l] = ge.useState(t), c = n ?? a, d = r ?? l, u = So({
|
|
6642
6652
|
placement: e,
|
|
6643
6653
|
open: c,
|
|
6644
6654
|
onOpenChange: d,
|
|
6645
|
-
whileElementsMounted:
|
|
6655
|
+
whileElementsMounted: Oo,
|
|
6646
6656
|
middleware: [
|
|
6647
|
-
|
|
6648
|
-
|
|
6657
|
+
_o(4),
|
|
6658
|
+
ko({
|
|
6649
6659
|
crossAxis: e.includes("-"),
|
|
6650
6660
|
fallbackAxisSideDirection: "start",
|
|
6651
6661
|
padding: 4
|
|
6652
6662
|
}),
|
|
6653
|
-
|
|
6663
|
+
Ao({ padding: 4 })
|
|
6654
6664
|
]
|
|
6655
|
-
}), f = u.context, p =
|
|
6665
|
+
}), f = u.context, p = Ro(f, {
|
|
6656
6666
|
mouseOnly: !0,
|
|
6657
6667
|
move: !1,
|
|
6658
6668
|
restMs: s,
|
|
@@ -6660,9 +6670,9 @@ function Ci({
|
|
|
6660
6670
|
delay: {
|
|
6661
6671
|
close: o
|
|
6662
6672
|
}
|
|
6663
|
-
}), h =
|
|
6673
|
+
}), h = Mo(f, {
|
|
6664
6674
|
enabled: n == null
|
|
6665
|
-
}), b =
|
|
6675
|
+
}), b = Io(f), w = Lo(f, { role: "tooltip" }), g = jo([p, h, b, w]);
|
|
6666
6676
|
return ge.useMemo(
|
|
6667
6677
|
() => ({
|
|
6668
6678
|
open: c,
|
|
@@ -6674,7 +6684,7 @@ function Ci({
|
|
|
6674
6684
|
);
|
|
6675
6685
|
}
|
|
6676
6686
|
const Jt = ge.createContext(null);
|
|
6677
|
-
function
|
|
6687
|
+
function Dr() {
|
|
6678
6688
|
const t = ge.useContext(Jt);
|
|
6679
6689
|
if (t == null)
|
|
6680
6690
|
throw new Error("Tooltip components must be wrapped in <TooltipProvider />");
|
|
@@ -6683,7 +6693,7 @@ function jr() {
|
|
|
6683
6693
|
function Tt({ children: t, ...e }) {
|
|
6684
6694
|
const n = Ci(e);
|
|
6685
6695
|
return e.useDelayGroup ? /* @__PURE__ */ i.jsx(
|
|
6686
|
-
|
|
6696
|
+
To,
|
|
6687
6697
|
{
|
|
6688
6698
|
delay: { open: e.delay ?? 0, close: e.closeDelay ?? 0 },
|
|
6689
6699
|
timeoutMs: e.timeout,
|
|
@@ -6692,13 +6702,13 @@ function Tt({ children: t, ...e }) {
|
|
|
6692
6702
|
) : /* @__PURE__ */ i.jsx(Jt.Provider, { value: n, children: t });
|
|
6693
6703
|
}
|
|
6694
6704
|
const St = ge.forwardRef(function({ children: e, asChild: n = !1, ...r }, s) {
|
|
6695
|
-
const o =
|
|
6705
|
+
const o = Dr(), a = ge.isValidElement(e) ? parseInt(ge.version, 10) >= 19 ? (
|
|
6696
6706
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6697
6707
|
e.props.ref
|
|
6698
6708
|
) : (
|
|
6699
6709
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6700
6710
|
e.ref
|
|
6701
|
-
) : void 0, l =
|
|
6711
|
+
) : void 0, l = nr([o.refs.setReference, s, a]);
|
|
6702
6712
|
if (n && ge.isValidElement(e)) {
|
|
6703
6713
|
const c = {
|
|
6704
6714
|
"data-tooltip-state": o.open ? "open" : "closed"
|
|
@@ -6723,7 +6733,7 @@ const St = ge.forwardRef(function({ children: e, asChild: n = !1, ...r }, s) {
|
|
|
6723
6733
|
}
|
|
6724
6734
|
);
|
|
6725
6735
|
}), _t = ge.forwardRef(function({ style: e, children: n, portal: r = !0, portalProps: s = {}, ...o }, a) {
|
|
6726
|
-
const l =
|
|
6736
|
+
const l = Dr(), c = nr([l.refs.setFloating, a]);
|
|
6727
6737
|
if (!l.open) return null;
|
|
6728
6738
|
const d = /* @__PURE__ */ i.jsx(
|
|
6729
6739
|
"div",
|
|
@@ -6738,7 +6748,7 @@ const St = ge.forwardRef(function({ children: e, asChild: n = !1, ...r }, s) {
|
|
|
6738
6748
|
children: n
|
|
6739
6749
|
}
|
|
6740
6750
|
);
|
|
6741
|
-
return r ? /* @__PURE__ */ i.jsx(
|
|
6751
|
+
return r ? /* @__PURE__ */ i.jsx(Co, { ...s, children: d }) : d;
|
|
6742
6752
|
});
|
|
6743
6753
|
Tt.displayName = "Tooltip";
|
|
6744
6754
|
St.displayName = "TooltipTrigger";
|
|
@@ -6841,12 +6851,12 @@ const I = ({
|
|
|
6841
6851
|
videoUrl: b,
|
|
6842
6852
|
setVideoUrl: w,
|
|
6843
6853
|
handleVideoUrlInsert: g,
|
|
6844
|
-
videoUploadFunction:
|
|
6854
|
+
videoUploadFunction: _
|
|
6845
6855
|
}) => {
|
|
6846
|
-
const [N, x] =
|
|
6856
|
+
const [N, x] = B(!1), T = _e(null);
|
|
6847
6857
|
return Y(() => {
|
|
6848
|
-
const y = (
|
|
6849
|
-
T.current && !T.current.contains(
|
|
6858
|
+
const y = (k) => {
|
|
6859
|
+
T.current && !T.current.contains(k.target) && x(!1);
|
|
6850
6860
|
};
|
|
6851
6861
|
return N && document.addEventListener("mousedown", y), () => {
|
|
6852
6862
|
document.removeEventListener("mousedown", y);
|
|
@@ -6859,7 +6869,7 @@ const I = ({
|
|
|
6859
6869
|
onClick: () => t.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
6860
6870
|
isActive: t.isActive("heading", { level: 1 }),
|
|
6861
6871
|
title: "Heading 1",
|
|
6862
|
-
children: /* @__PURE__ */ i.jsx(
|
|
6872
|
+
children: /* @__PURE__ */ i.jsx(qn, { className: "h-4 w-4" })
|
|
6863
6873
|
}
|
|
6864
6874
|
),
|
|
6865
6875
|
/* @__PURE__ */ i.jsx(
|
|
@@ -6868,7 +6878,7 @@ const I = ({
|
|
|
6868
6878
|
onClick: () => t.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
6869
6879
|
isActive: t.isActive("heading", { level: 2 }),
|
|
6870
6880
|
title: "Heading 2",
|
|
6871
|
-
children: /* @__PURE__ */ i.jsx(
|
|
6881
|
+
children: /* @__PURE__ */ i.jsx(Vn, { className: "h-4 w-4" })
|
|
6872
6882
|
}
|
|
6873
6883
|
),
|
|
6874
6884
|
/* @__PURE__ */ i.jsx(
|
|
@@ -6877,7 +6887,7 @@ const I = ({
|
|
|
6877
6887
|
onClick: () => t.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
6878
6888
|
isActive: t.isActive("heading", { level: 3 }),
|
|
6879
6889
|
title: "Heading 3",
|
|
6880
|
-
children: /* @__PURE__ */ i.jsx(
|
|
6890
|
+
children: /* @__PURE__ */ i.jsx(Gn, { className: "h-4 w-4" })
|
|
6881
6891
|
}
|
|
6882
6892
|
),
|
|
6883
6893
|
/* @__PURE__ */ i.jsx(
|
|
@@ -6886,7 +6896,7 @@ const I = ({
|
|
|
6886
6896
|
onClick: () => t.chain().focus().toggleHeading({ level: 4 }).run(),
|
|
6887
6897
|
isActive: t.isActive("heading", { level: 4 }),
|
|
6888
6898
|
title: "Heading 4",
|
|
6889
|
-
children: /* @__PURE__ */ i.jsx(
|
|
6899
|
+
children: /* @__PURE__ */ i.jsx($s, { className: "h-4 w-4" })
|
|
6890
6900
|
}
|
|
6891
6901
|
),
|
|
6892
6902
|
/* @__PURE__ */ i.jsx(
|
|
@@ -6895,7 +6905,7 @@ const I = ({
|
|
|
6895
6905
|
onClick: () => t.chain().focus().setParagraph().run(),
|
|
6896
6906
|
isActive: t.isActive("paragraph"),
|
|
6897
6907
|
title: "Paragraph",
|
|
6898
|
-
children: /* @__PURE__ */ i.jsx(
|
|
6908
|
+
children: /* @__PURE__ */ i.jsx(Yn, { className: "h-4 w-4" })
|
|
6899
6909
|
}
|
|
6900
6910
|
)
|
|
6901
6911
|
] }),
|
|
@@ -6906,7 +6916,7 @@ const I = ({
|
|
|
6906
6916
|
onClick: () => t.chain().focus().toggleBulletList().run(),
|
|
6907
6917
|
isActive: t.isActive("bulletList"),
|
|
6908
6918
|
title: "Bullet List",
|
|
6909
|
-
children: /* @__PURE__ */ i.jsx(
|
|
6919
|
+
children: /* @__PURE__ */ i.jsx(Ks, { className: "h-4 w-4" })
|
|
6910
6920
|
}
|
|
6911
6921
|
),
|
|
6912
6922
|
/* @__PURE__ */ i.jsx(
|
|
@@ -6915,7 +6925,7 @@ const I = ({
|
|
|
6915
6925
|
onClick: () => t.chain().focus().toggleOrderedList().run(),
|
|
6916
6926
|
isActive: t.isActive("orderedList"),
|
|
6917
6927
|
title: "Numbered List",
|
|
6918
|
-
children: /* @__PURE__ */ i.jsx(
|
|
6928
|
+
children: /* @__PURE__ */ i.jsx(Js, { className: "h-4 w-4" })
|
|
6919
6929
|
}
|
|
6920
6930
|
)
|
|
6921
6931
|
] }),
|
|
@@ -6924,7 +6934,7 @@ const I = ({
|
|
|
6924
6934
|
{
|
|
6925
6935
|
onClick: () => t.chain().focus().insertTable({ rows: 3, cols: 3, withHeaderRow: !0 }).run(),
|
|
6926
6936
|
title: "Insert Table (3x3)",
|
|
6927
|
-
children: /* @__PURE__ */ i.jsx(
|
|
6937
|
+
children: /* @__PURE__ */ i.jsx(Ws, { className: "h-4 w-4" })
|
|
6928
6938
|
}
|
|
6929
6939
|
) }),
|
|
6930
6940
|
/* @__PURE__ */ i.jsxs("div", { className: "flex gap-1 border-r border-gray-300 pr-2", children: [
|
|
@@ -6934,7 +6944,7 @@ const I = ({
|
|
|
6934
6944
|
onClick: () => t.chain().focus().toggleBlockquote().run(),
|
|
6935
6945
|
isActive: t.isActive("blockquote"),
|
|
6936
6946
|
title: "Block Quote",
|
|
6937
|
-
children: /* @__PURE__ */ i.jsx(
|
|
6947
|
+
children: /* @__PURE__ */ i.jsx(qs, { className: "h-4 w-4" })
|
|
6938
6948
|
}
|
|
6939
6949
|
),
|
|
6940
6950
|
/* @__PURE__ */ i.jsx(
|
|
@@ -6954,7 +6964,7 @@ const I = ({
|
|
|
6954
6964
|
onClick: () => l(!a),
|
|
6955
6965
|
title: "Insert Image",
|
|
6956
6966
|
className: s ? "opacity-50" : "",
|
|
6957
|
-
children: s ? /* @__PURE__ */ i.jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600" }) : /* @__PURE__ */ i.jsx(
|
|
6967
|
+
children: s ? /* @__PURE__ */ i.jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600" }) : /* @__PURE__ */ i.jsx(Zn, { className: "h-4 w-4" })
|
|
6958
6968
|
}
|
|
6959
6969
|
),
|
|
6960
6970
|
s && /* @__PURE__ */ i.jsx("div", { className: "absolute -top-1 -right-1 w-3 h-3 bg-blue-600 rounded-full animate-pulse" }),
|
|
@@ -7014,9 +7024,9 @@ const I = ({
|
|
|
7014
7024
|
alt: "Preview",
|
|
7015
7025
|
className: "max-w-full h-auto max-h-32 rounded border",
|
|
7016
7026
|
onError: (y) => {
|
|
7017
|
-
const
|
|
7018
|
-
|
|
7019
|
-
const A =
|
|
7027
|
+
const k = y.currentTarget;
|
|
7028
|
+
k.style.display = "none";
|
|
7029
|
+
const A = k.nextElementSibling;
|
|
7020
7030
|
A && (A.style.display = "block");
|
|
7021
7031
|
}
|
|
7022
7032
|
}
|
|
@@ -7058,7 +7068,7 @@ const I = ({
|
|
|
7058
7068
|
onClick: () => h(!p),
|
|
7059
7069
|
title: "Insert Video",
|
|
7060
7070
|
className: o ? "opacity-50" : "",
|
|
7061
|
-
children: o ? /* @__PURE__ */ i.jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600" }) : /* @__PURE__ */ i.jsx(
|
|
7071
|
+
children: o ? /* @__PURE__ */ i.jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600" }) : /* @__PURE__ */ i.jsx(Vs, { className: "h-4 w-4" })
|
|
7062
7072
|
}
|
|
7063
7073
|
),
|
|
7064
7074
|
o && /* @__PURE__ */ i.jsx("div", { className: "absolute -top-1 -right-1 w-3 h-3 bg-blue-600 rounded-full animate-pulse" }),
|
|
@@ -7144,10 +7154,10 @@ const I = ({
|
|
|
7144
7154
|
children: o ? /* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7145
7155
|
/* @__PURE__ */ i.jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600" }),
|
|
7146
7156
|
/* @__PURE__ */ i.jsx("span", { children: "Uploading..." })
|
|
7147
|
-
] }) :
|
|
7157
|
+
] }) : _ ? "Choose File" : "Choose File (Base64)"
|
|
7148
7158
|
}
|
|
7149
7159
|
),
|
|
7150
|
-
!
|
|
7160
|
+
!_ && /* @__PURE__ */ i.jsx("p", { className: "text-xs text-gray-500 mt-1", children: "No upload service provided — files embed as Base64." })
|
|
7151
7161
|
] })
|
|
7152
7162
|
] })
|
|
7153
7163
|
}
|
|
@@ -7169,7 +7179,7 @@ const I = ({
|
|
|
7169
7179
|
{
|
|
7170
7180
|
onClick: () => t.chain().focus().insertAccordion().run(),
|
|
7171
7181
|
title: "Insert Accordion",
|
|
7172
|
-
children: /* @__PURE__ */ i.jsx(
|
|
7182
|
+
children: /* @__PURE__ */ i.jsx(Gs, { className: "h-4 w-4 cursor-pointer" })
|
|
7173
7183
|
}
|
|
7174
7184
|
)
|
|
7175
7185
|
] }),
|
|
@@ -7191,7 +7201,7 @@ const I = ({
|
|
|
7191
7201
|
className: "w-full px-2",
|
|
7192
7202
|
children: /* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-1 w-full justify-between", children: [
|
|
7193
7203
|
/* @__PURE__ */ i.jsx("span", { className: "text-xs font-mono", children: "Tabs" }),
|
|
7194
|
-
/* @__PURE__ */ i.jsx(
|
|
7204
|
+
/* @__PURE__ */ i.jsx(Xn, { className: "h-3 w-3" })
|
|
7195
7205
|
] })
|
|
7196
7206
|
}
|
|
7197
7207
|
),
|
|
@@ -7268,7 +7278,7 @@ const I = ({
|
|
|
7268
7278
|
}).run();
|
|
7269
7279
|
},
|
|
7270
7280
|
title: "Insert iframe",
|
|
7271
|
-
children: /* @__PURE__ */ i.jsx(
|
|
7281
|
+
children: /* @__PURE__ */ i.jsx(Ys, { className: "h-4 w-4" })
|
|
7272
7282
|
}
|
|
7273
7283
|
),
|
|
7274
7284
|
/* @__PURE__ */ i.jsx(
|
|
@@ -7278,7 +7288,7 @@ const I = ({
|
|
|
7278
7288
|
t.chain().focus().insertLivePreview({ pendingEdit: !0 }).run();
|
|
7279
7289
|
},
|
|
7280
7290
|
title: "Insert live HTML/CSS/JS preview",
|
|
7281
|
-
children: /* @__PURE__ */ i.jsx(
|
|
7291
|
+
children: /* @__PURE__ */ i.jsx(Zs, { className: "h-4 w-4" })
|
|
7282
7292
|
}
|
|
7283
7293
|
)
|
|
7284
7294
|
] }),
|
|
@@ -7287,11 +7297,11 @@ const I = ({
|
|
|
7287
7297
|
{
|
|
7288
7298
|
onClick: () => t.chain().focus().insertColumnLayout({ columns: 2 }).run(),
|
|
7289
7299
|
title: "Insert 2 Column Layout",
|
|
7290
|
-
children: /* @__PURE__ */ i.jsx("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ i.jsx(
|
|
7300
|
+
children: /* @__PURE__ */ i.jsx("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ i.jsx(Xs, { className: "h-4 w-4" }) })
|
|
7291
7301
|
}
|
|
7292
7302
|
) })
|
|
7293
7303
|
] });
|
|
7294
|
-
},
|
|
7304
|
+
}, Pr = ["top", "right", "bottom", "left"], bn = ["start", "end"], wn = /* @__PURE__ */ Pr.reduce((t, e) => t.concat(e, e + "-" + bn[0], e + "-" + bn[1]), []), xe = Math.min, ee = Math.max, yt = Math.round, we = (t) => ({
|
|
7295
7305
|
x: t,
|
|
7296
7306
|
y: t
|
|
7297
7307
|
}), ki = {
|
|
@@ -7315,7 +7325,7 @@ function le(t) {
|
|
|
7315
7325
|
function ue(t) {
|
|
7316
7326
|
return t.split("-")[1];
|
|
7317
7327
|
}
|
|
7318
|
-
function
|
|
7328
|
+
function Br(t) {
|
|
7319
7329
|
return t === "x" ? "y" : "x";
|
|
7320
7330
|
}
|
|
7321
7331
|
function Xt(t) {
|
|
@@ -7326,9 +7336,9 @@ function be(t) {
|
|
|
7326
7336
|
return Oi.has(le(t)) ? "y" : "x";
|
|
7327
7337
|
}
|
|
7328
7338
|
function Qt(t) {
|
|
7329
|
-
return
|
|
7339
|
+
return Br(be(t));
|
|
7330
7340
|
}
|
|
7331
|
-
function
|
|
7341
|
+
function zr(t, e, n) {
|
|
7332
7342
|
n === void 0 && (n = !1);
|
|
7333
7343
|
const r = ue(t), s = Qt(t), o = Xt(s);
|
|
7334
7344
|
let a = s === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
|
|
@@ -7341,12 +7351,12 @@ function Ri(t) {
|
|
|
7341
7351
|
function xt(t) {
|
|
7342
7352
|
return t.replace(/start|end/g, (e) => Ai[e]);
|
|
7343
7353
|
}
|
|
7344
|
-
const
|
|
7354
|
+
const yn = ["left", "right"], xn = ["right", "left"], Mi = ["top", "bottom"], Ii = ["bottom", "top"];
|
|
7345
7355
|
function Li(t, e, n) {
|
|
7346
7356
|
switch (t) {
|
|
7347
7357
|
case "top":
|
|
7348
7358
|
case "bottom":
|
|
7349
|
-
return n ? e ?
|
|
7359
|
+
return n ? e ? xn : yn : e ? yn : xn;
|
|
7350
7360
|
case "left":
|
|
7351
7361
|
case "right":
|
|
7352
7362
|
return e ? Mi : Ii;
|
|
@@ -7397,7 +7407,7 @@ function He(t) {
|
|
|
7397
7407
|
y: n
|
|
7398
7408
|
};
|
|
7399
7409
|
}
|
|
7400
|
-
function
|
|
7410
|
+
function vn(t, e, n) {
|
|
7401
7411
|
let {
|
|
7402
7412
|
reference: r,
|
|
7403
7413
|
floating: s
|
|
@@ -7459,17 +7469,17 @@ const Pi = async (t, e, n) => {
|
|
|
7459
7469
|
}), {
|
|
7460
7470
|
x: u,
|
|
7461
7471
|
y: f
|
|
7462
|
-
} =
|
|
7472
|
+
} = vn(d, r, c), p = r, h = {}, b = 0;
|
|
7463
7473
|
for (let w = 0; w < l.length; w++) {
|
|
7464
7474
|
const {
|
|
7465
7475
|
name: g,
|
|
7466
|
-
fn:
|
|
7476
|
+
fn: _
|
|
7467
7477
|
} = l[w], {
|
|
7468
7478
|
x: N,
|
|
7469
7479
|
y: x,
|
|
7470
7480
|
data: T,
|
|
7471
7481
|
reset: y
|
|
7472
|
-
} = await
|
|
7482
|
+
} = await _({
|
|
7473
7483
|
x: u,
|
|
7474
7484
|
y: f,
|
|
7475
7485
|
initialPlacement: r,
|
|
@@ -7496,7 +7506,7 @@ const Pi = async (t, e, n) => {
|
|
|
7496
7506
|
}) : y.rects), {
|
|
7497
7507
|
x: u,
|
|
7498
7508
|
y: f
|
|
7499
|
-
} =
|
|
7509
|
+
} = vn(d, p, c)), w = -1);
|
|
7500
7510
|
}
|
|
7501
7511
|
return {
|
|
7502
7512
|
x: u,
|
|
@@ -7522,7 +7532,7 @@ async function $e(t, e) {
|
|
|
7522
7532
|
elementContext: f = "floating",
|
|
7523
7533
|
altBoundary: p = !1,
|
|
7524
7534
|
padding: h = 0
|
|
7525
|
-
} = Ae(e, t), b = en(h), g = l[p ? f === "floating" ? "reference" : "floating" : f],
|
|
7535
|
+
} = Ae(e, t), b = en(h), g = l[p ? f === "floating" ? "reference" : "floating" : f], _ = He(await o.getClippingRect({
|
|
7526
7536
|
element: (n = await (o.isElement == null ? void 0 : o.isElement(g))) == null || n ? g : g.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(l.floating)),
|
|
7527
7537
|
boundary: d,
|
|
7528
7538
|
rootBoundary: u,
|
|
@@ -7545,10 +7555,10 @@ async function $e(t, e) {
|
|
|
7545
7555
|
strategy: c
|
|
7546
7556
|
}) : N);
|
|
7547
7557
|
return {
|
|
7548
|
-
top: (
|
|
7549
|
-
bottom: (y.bottom -
|
|
7550
|
-
left: (
|
|
7551
|
-
right: (y.right -
|
|
7558
|
+
top: (_.top - y.top + b.top) / T.y,
|
|
7559
|
+
bottom: (y.bottom - _.bottom + b.bottom) / T.y,
|
|
7560
|
+
left: (_.left - y.left + b.left) / T.x,
|
|
7561
|
+
right: (y.right - _.right + b.right) / T.x
|
|
7552
7562
|
};
|
|
7553
7563
|
}
|
|
7554
7564
|
const Bi = (t) => ({
|
|
@@ -7572,20 +7582,20 @@ const Bi = (t) => ({
|
|
|
7572
7582
|
const f = en(u), p = {
|
|
7573
7583
|
x: n,
|
|
7574
7584
|
y: r
|
|
7575
|
-
}, h = Qt(s), b = Xt(h), w = await a.getDimensions(d), g = h === "y",
|
|
7576
|
-
let A =
|
|
7577
|
-
(!A || !await (a.isElement == null ? void 0 : a.isElement(
|
|
7578
|
-
const
|
|
7585
|
+
}, h = Qt(s), b = Xt(h), w = await a.getDimensions(d), g = h === "y", _ = g ? "top" : "left", N = g ? "bottom" : "right", x = g ? "clientHeight" : "clientWidth", T = o.reference[b] + o.reference[h] - p[h] - o.floating[b], y = p[h] - o.reference[h], k = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(d));
|
|
7586
|
+
let A = k ? k[x] : 0;
|
|
7587
|
+
(!A || !await (a.isElement == null ? void 0 : a.isElement(k))) && (A = l.floating[x] || o.floating[b]);
|
|
7588
|
+
const z = T / 2 - y / 2, L = A / 2 - w[b] / 2 - 1, C = xe(f[_], L), M = xe(f[N], L), v = C, j = A - w[b] - M, D = A / 2 - w[b] / 2 + z, J = Wt(v, D, j), H = !c.arrow && ue(s) != null && D !== J && o.reference[b] / 2 - (D < v ? C : M) - w[b] / 2 < 0, W = H ? D < v ? D - v : D - j : 0;
|
|
7579
7589
|
return {
|
|
7580
7590
|
[h]: p[h] + W,
|
|
7581
7591
|
data: {
|
|
7582
|
-
[h]:
|
|
7583
|
-
centerOffset:
|
|
7584
|
-
...
|
|
7592
|
+
[h]: J,
|
|
7593
|
+
centerOffset: D - J - W,
|
|
7594
|
+
...H && {
|
|
7585
7595
|
alignmentOffset: W
|
|
7586
7596
|
}
|
|
7587
7597
|
},
|
|
7588
|
-
reset:
|
|
7598
|
+
reset: H
|
|
7589
7599
|
};
|
|
7590
7600
|
}
|
|
7591
7601
|
});
|
|
@@ -7607,13 +7617,13 @@ const Ui = function(t) {
|
|
|
7607
7617
|
} = e, {
|
|
7608
7618
|
crossAxis: u = !1,
|
|
7609
7619
|
alignment: f,
|
|
7610
|
-
allowedPlacements: p =
|
|
7620
|
+
allowedPlacements: p = wn,
|
|
7611
7621
|
autoAlignment: h = !0,
|
|
7612
7622
|
...b
|
|
7613
|
-
} = Ae(t, e), w = f !== void 0 || p ===
|
|
7623
|
+
} = Ae(t, e), w = f !== void 0 || p === wn ? zi(f || null, h, p) : p, g = await $e(e, b), _ = ((n = a.autoPlacement) == null ? void 0 : n.index) || 0, N = w[_];
|
|
7614
7624
|
if (N == null)
|
|
7615
7625
|
return {};
|
|
7616
|
-
const x =
|
|
7626
|
+
const x = zr(N, o, await (c.isRTL == null ? void 0 : c.isRTL(d.floating)));
|
|
7617
7627
|
if (l !== N)
|
|
7618
7628
|
return {
|
|
7619
7629
|
reset: {
|
|
@@ -7623,22 +7633,22 @@ const Ui = function(t) {
|
|
|
7623
7633
|
const T = [g[le(N)], g[x[0]], g[x[1]]], y = [...((r = a.autoPlacement) == null ? void 0 : r.overflows) || [], {
|
|
7624
7634
|
placement: N,
|
|
7625
7635
|
overflows: T
|
|
7626
|
-
}],
|
|
7627
|
-
if (
|
|
7636
|
+
}], k = w[_ + 1];
|
|
7637
|
+
if (k)
|
|
7628
7638
|
return {
|
|
7629
7639
|
data: {
|
|
7630
|
-
index:
|
|
7640
|
+
index: _ + 1,
|
|
7631
7641
|
overflows: y
|
|
7632
7642
|
},
|
|
7633
7643
|
reset: {
|
|
7634
|
-
placement:
|
|
7644
|
+
placement: k
|
|
7635
7645
|
}
|
|
7636
7646
|
};
|
|
7637
7647
|
const A = y.map((C) => {
|
|
7638
7648
|
const M = ue(C.placement);
|
|
7639
7649
|
return [C.placement, M && u ? (
|
|
7640
7650
|
// Check along the mainAxis and main crossAxis side.
|
|
7641
|
-
C.overflows.slice(0, 2).reduce((v,
|
|
7651
|
+
C.overflows.slice(0, 2).reduce((v, j) => v + j, 0)
|
|
7642
7652
|
) : (
|
|
7643
7653
|
// Check only the mainAxis.
|
|
7644
7654
|
C.overflows[0]
|
|
@@ -7651,7 +7661,7 @@ const Ui = function(t) {
|
|
|
7651
7661
|
).every((M) => M <= 0))[0]) == null ? void 0 : s[0]) || A[0][0];
|
|
7652
7662
|
return L !== l ? {
|
|
7653
7663
|
data: {
|
|
7654
|
-
index:
|
|
7664
|
+
index: _ + 1,
|
|
7655
7665
|
overflows: y
|
|
7656
7666
|
},
|
|
7657
7667
|
reset: {
|
|
@@ -7684,57 +7694,57 @@ const Ui = function(t) {
|
|
|
7684
7694
|
} = Ae(t, e);
|
|
7685
7695
|
if ((n = o.arrow) != null && n.alignmentOffset)
|
|
7686
7696
|
return {};
|
|
7687
|
-
const
|
|
7688
|
-
!p &&
|
|
7689
|
-
const A = [l, ...y],
|
|
7697
|
+
const _ = le(s), N = be(l), x = le(l) === l, T = await (c.isRTL == null ? void 0 : c.isRTL(d.floating)), y = p || (x || !w ? [vt(l)] : Ri(l)), k = b !== "none";
|
|
7698
|
+
!p && k && y.push(...ji(l, w, b, T));
|
|
7699
|
+
const A = [l, ...y], z = await $e(e, g), L = [];
|
|
7690
7700
|
let C = ((r = o.flip) == null ? void 0 : r.overflows) || [];
|
|
7691
|
-
if (u && L.push(
|
|
7692
|
-
const
|
|
7693
|
-
L.push(
|
|
7701
|
+
if (u && L.push(z[_]), f) {
|
|
7702
|
+
const D = zr(s, a, T);
|
|
7703
|
+
L.push(z[D[0]], z[D[1]]);
|
|
7694
7704
|
}
|
|
7695
7705
|
if (C = [...C, {
|
|
7696
7706
|
placement: s,
|
|
7697
7707
|
overflows: L
|
|
7698
|
-
}], !L.every((
|
|
7708
|
+
}], !L.every((D) => D <= 0)) {
|
|
7699
7709
|
var M, v;
|
|
7700
|
-
const
|
|
7701
|
-
if (
|
|
7710
|
+
const D = (((M = o.flip) == null ? void 0 : M.index) || 0) + 1, J = A[D];
|
|
7711
|
+
if (J && (!(f === "alignment" ? N !== be(J) : !1) || // We leave the current main axis only if every placement on that axis
|
|
7702
7712
|
// overflows the main axis.
|
|
7703
|
-
C.every((
|
|
7713
|
+
C.every((S) => be(S.placement) === N ? S.overflows[0] > 0 : !0)))
|
|
7704
7714
|
return {
|
|
7705
7715
|
data: {
|
|
7706
|
-
index:
|
|
7716
|
+
index: D,
|
|
7707
7717
|
overflows: C
|
|
7708
7718
|
},
|
|
7709
7719
|
reset: {
|
|
7710
|
-
placement:
|
|
7720
|
+
placement: J
|
|
7711
7721
|
}
|
|
7712
7722
|
};
|
|
7713
|
-
let
|
|
7714
|
-
if (!
|
|
7723
|
+
let H = (v = C.filter((W) => W.overflows[0] <= 0).sort((W, S) => W.overflows[1] - S.overflows[1])[0]) == null ? void 0 : v.placement;
|
|
7724
|
+
if (!H)
|
|
7715
7725
|
switch (h) {
|
|
7716
7726
|
case "bestFit": {
|
|
7717
|
-
var
|
|
7718
|
-
const W = (
|
|
7719
|
-
if (
|
|
7720
|
-
const O = be(
|
|
7727
|
+
var j;
|
|
7728
|
+
const W = (j = C.filter((S) => {
|
|
7729
|
+
if (k) {
|
|
7730
|
+
const O = be(S.placement);
|
|
7721
7731
|
return O === N || // Create a bias to the `y` side axis due to horizontal
|
|
7722
7732
|
// reading directions favoring greater width.
|
|
7723
7733
|
O === "y";
|
|
7724
7734
|
}
|
|
7725
7735
|
return !0;
|
|
7726
|
-
}).map((
|
|
7727
|
-
W && (
|
|
7736
|
+
}).map((S) => [S.placement, S.overflows.filter((O) => O > 0).reduce((O, m) => O + m, 0)]).sort((S, O) => S[1] - O[1])[0]) == null ? void 0 : j[0];
|
|
7737
|
+
W && (H = W);
|
|
7728
7738
|
break;
|
|
7729
7739
|
}
|
|
7730
7740
|
case "initialPlacement":
|
|
7731
|
-
|
|
7741
|
+
H = l;
|
|
7732
7742
|
break;
|
|
7733
7743
|
}
|
|
7734
|
-
if (s !==
|
|
7744
|
+
if (s !== H)
|
|
7735
7745
|
return {
|
|
7736
7746
|
reset: {
|
|
7737
|
-
placement:
|
|
7747
|
+
placement: H
|
|
7738
7748
|
}
|
|
7739
7749
|
};
|
|
7740
7750
|
}
|
|
@@ -7742,7 +7752,7 @@ const Ui = function(t) {
|
|
|
7742
7752
|
}
|
|
7743
7753
|
};
|
|
7744
7754
|
};
|
|
7745
|
-
function
|
|
7755
|
+
function En(t, e) {
|
|
7746
7756
|
return {
|
|
7747
7757
|
top: t.top - e.height,
|
|
7748
7758
|
right: t.right - e.width,
|
|
@@ -7750,8 +7760,8 @@ function vn(t, e) {
|
|
|
7750
7760
|
left: t.left - e.width
|
|
7751
7761
|
};
|
|
7752
7762
|
}
|
|
7753
|
-
function
|
|
7754
|
-
return
|
|
7763
|
+
function Nn(t) {
|
|
7764
|
+
return Pr.some((e) => t[e] >= 0);
|
|
7755
7765
|
}
|
|
7756
7766
|
const Hi = function(t) {
|
|
7757
7767
|
return t === void 0 && (t = {}), {
|
|
@@ -7769,11 +7779,11 @@ const Hi = function(t) {
|
|
|
7769
7779
|
const o = await $e(e, {
|
|
7770
7780
|
...s,
|
|
7771
7781
|
elementContext: "reference"
|
|
7772
|
-
}), a =
|
|
7782
|
+
}), a = En(o, n.reference);
|
|
7773
7783
|
return {
|
|
7774
7784
|
data: {
|
|
7775
7785
|
referenceHiddenOffsets: a,
|
|
7776
|
-
referenceHidden:
|
|
7786
|
+
referenceHidden: Nn(a)
|
|
7777
7787
|
}
|
|
7778
7788
|
};
|
|
7779
7789
|
}
|
|
@@ -7781,11 +7791,11 @@ const Hi = function(t) {
|
|
|
7781
7791
|
const o = await $e(e, {
|
|
7782
7792
|
...s,
|
|
7783
7793
|
altBoundary: !0
|
|
7784
|
-
}), a =
|
|
7794
|
+
}), a = En(o, n.floating);
|
|
7785
7795
|
return {
|
|
7786
7796
|
data: {
|
|
7787
7797
|
escapedOffsets: a,
|
|
7788
|
-
escaped:
|
|
7798
|
+
escaped: Nn(a)
|
|
7789
7799
|
}
|
|
7790
7800
|
};
|
|
7791
7801
|
}
|
|
@@ -7795,7 +7805,7 @@ const Hi = function(t) {
|
|
|
7795
7805
|
}
|
|
7796
7806
|
};
|
|
7797
7807
|
};
|
|
7798
|
-
function
|
|
7808
|
+
function Ur(t) {
|
|
7799
7809
|
const e = xe(...t.map((o) => o.left)), n = xe(...t.map((o) => o.top)), r = ee(...t.map((o) => o.right)), s = ee(...t.map((o) => o.bottom));
|
|
7800
7810
|
return {
|
|
7801
7811
|
x: e,
|
|
@@ -7811,7 +7821,7 @@ function $i(t) {
|
|
|
7811
7821
|
const o = e[s];
|
|
7812
7822
|
!r || o.y - r.y > r.height / 2 ? n.push([o]) : n[n.length - 1].push(o), r = o;
|
|
7813
7823
|
}
|
|
7814
|
-
return n.map((s) => He(
|
|
7824
|
+
return n.map((s) => He(Ur(s)));
|
|
7815
7825
|
}
|
|
7816
7826
|
const Ki = function(t) {
|
|
7817
7827
|
return t === void 0 && (t = {}), {
|
|
@@ -7828,33 +7838,33 @@ const Ki = function(t) {
|
|
|
7828
7838
|
padding: l = 2,
|
|
7829
7839
|
x: c,
|
|
7830
7840
|
y: d
|
|
7831
|
-
} = Ae(t, e), u = Array.from(await (o.getClientRects == null ? void 0 : o.getClientRects(r.reference)) || []), f = $i(u), p = He(
|
|
7841
|
+
} = Ae(t, e), u = Array.from(await (o.getClientRects == null ? void 0 : o.getClientRects(r.reference)) || []), f = $i(u), p = He(Ur(u)), h = en(l);
|
|
7832
7842
|
function b() {
|
|
7833
7843
|
if (f.length === 2 && f[0].left > f[1].right && c != null && d != null)
|
|
7834
7844
|
return f.find((g) => c > g.left - h.left && c < g.right + h.right && d > g.top - h.top && d < g.bottom + h.bottom) || p;
|
|
7835
7845
|
if (f.length >= 2) {
|
|
7836
7846
|
if (be(n) === "y") {
|
|
7837
|
-
const C = f[0], M = f[f.length - 1], v = le(n) === "top",
|
|
7847
|
+
const C = f[0], M = f[f.length - 1], v = le(n) === "top", j = C.top, D = M.bottom, J = v ? C.left : M.left, H = v ? C.right : M.right, W = H - J, S = D - j;
|
|
7838
7848
|
return {
|
|
7839
|
-
top:
|
|
7840
|
-
bottom:
|
|
7841
|
-
left:
|
|
7842
|
-
right:
|
|
7849
|
+
top: j,
|
|
7850
|
+
bottom: D,
|
|
7851
|
+
left: J,
|
|
7852
|
+
right: H,
|
|
7843
7853
|
width: W,
|
|
7844
|
-
height:
|
|
7845
|
-
x:
|
|
7846
|
-
y:
|
|
7854
|
+
height: S,
|
|
7855
|
+
x: J,
|
|
7856
|
+
y: j
|
|
7847
7857
|
};
|
|
7848
7858
|
}
|
|
7849
|
-
const g = le(n) === "left",
|
|
7859
|
+
const g = le(n) === "left", _ = ee(...f.map((C) => C.right)), N = xe(...f.map((C) => C.left)), x = f.filter((C) => g ? C.left === N : C.right === _), T = x[0].top, y = x[x.length - 1].bottom, k = N, A = _, z = A - k, L = y - T;
|
|
7850
7860
|
return {
|
|
7851
7861
|
top: T,
|
|
7852
7862
|
bottom: y,
|
|
7853
|
-
left:
|
|
7863
|
+
left: k,
|
|
7854
7864
|
right: A,
|
|
7855
|
-
width:
|
|
7865
|
+
width: z,
|
|
7856
7866
|
height: L,
|
|
7857
|
-
x:
|
|
7867
|
+
x: k,
|
|
7858
7868
|
y: T
|
|
7859
7869
|
};
|
|
7860
7870
|
}
|
|
@@ -7939,11 +7949,11 @@ const qi = function(t) {
|
|
|
7939
7949
|
limiter: l = {
|
|
7940
7950
|
fn: (g) => {
|
|
7941
7951
|
let {
|
|
7942
|
-
x:
|
|
7952
|
+
x: _,
|
|
7943
7953
|
y: N
|
|
7944
7954
|
} = g;
|
|
7945
7955
|
return {
|
|
7946
|
-
x:
|
|
7956
|
+
x: _,
|
|
7947
7957
|
y: N
|
|
7948
7958
|
};
|
|
7949
7959
|
}
|
|
@@ -7952,14 +7962,14 @@ const qi = function(t) {
|
|
|
7952
7962
|
} = Ae(t, e), d = {
|
|
7953
7963
|
x: n,
|
|
7954
7964
|
y: r
|
|
7955
|
-
}, u = await $e(e, c), f = be(le(s)), p =
|
|
7965
|
+
}, u = await $e(e, c), f = be(le(s)), p = Br(f);
|
|
7956
7966
|
let h = d[p], b = d[f];
|
|
7957
7967
|
if (o) {
|
|
7958
|
-
const g = p === "y" ? "top" : "left",
|
|
7968
|
+
const g = p === "y" ? "top" : "left", _ = p === "y" ? "bottom" : "right", N = h + u[g], x = h - u[_];
|
|
7959
7969
|
h = Wt(N, h, x);
|
|
7960
7970
|
}
|
|
7961
7971
|
if (a) {
|
|
7962
|
-
const g = f === "y" ? "top" : "left",
|
|
7972
|
+
const g = f === "y" ? "top" : "left", _ = f === "y" ? "bottom" : "right", N = b + u[g], x = b - u[_];
|
|
7963
7973
|
b = Wt(N, b, x);
|
|
7964
7974
|
}
|
|
7965
7975
|
const w = l.fn({
|
|
@@ -7999,17 +8009,17 @@ const qi = function(t) {
|
|
|
7999
8009
|
width: b,
|
|
8000
8010
|
height: w
|
|
8001
8011
|
} = o.floating;
|
|
8002
|
-
let g,
|
|
8003
|
-
f === "top" || f === "bottom" ? (g = f,
|
|
8004
|
-
const N = w - u.top - u.bottom, x = b - u.left - u.right, T = xe(w - u[g], N), y = xe(b - u[
|
|
8005
|
-
let A = T,
|
|
8006
|
-
if ((n = e.middlewareData.shift) != null && n.enabled.x && (
|
|
8007
|
-
const C = ee(u.left, 0), M = ee(u.right, 0), v = ee(u.top, 0),
|
|
8008
|
-
h ?
|
|
8012
|
+
let g, _;
|
|
8013
|
+
f === "top" || f === "bottom" ? (g = f, _ = p === (await (a.isRTL == null ? void 0 : a.isRTL(l.floating)) ? "start" : "end") ? "left" : "right") : (_ = f, g = p === "end" ? "top" : "bottom");
|
|
8014
|
+
const N = w - u.top - u.bottom, x = b - u.left - u.right, T = xe(w - u[g], N), y = xe(b - u[_], x), k = !e.middlewareData.shift;
|
|
8015
|
+
let A = T, z = y;
|
|
8016
|
+
if ((n = e.middlewareData.shift) != null && n.enabled.x && (z = x), (r = e.middlewareData.shift) != null && r.enabled.y && (A = N), k && !p) {
|
|
8017
|
+
const C = ee(u.left, 0), M = ee(u.right, 0), v = ee(u.top, 0), j = ee(u.bottom, 0);
|
|
8018
|
+
h ? z = b - 2 * (C !== 0 || M !== 0 ? C + M : ee(u.left, u.right)) : A = w - 2 * (v !== 0 || j !== 0 ? v + j : ee(u.top, u.bottom));
|
|
8009
8019
|
}
|
|
8010
8020
|
await c({
|
|
8011
8021
|
...e,
|
|
8012
|
-
availableWidth:
|
|
8022
|
+
availableWidth: z,
|
|
8013
8023
|
availableHeight: A
|
|
8014
8024
|
});
|
|
8015
8025
|
const L = await a.getDimensions(l.floating);
|
|
@@ -8025,7 +8035,7 @@ function kt() {
|
|
|
8025
8035
|
return typeof window < "u";
|
|
8026
8036
|
}
|
|
8027
8037
|
function Je(t) {
|
|
8028
|
-
return
|
|
8038
|
+
return Fr(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
8029
8039
|
}
|
|
8030
8040
|
function se(t) {
|
|
8031
8041
|
var e;
|
|
@@ -8033,9 +8043,9 @@ function se(t) {
|
|
|
8033
8043
|
}
|
|
8034
8044
|
function Oe(t) {
|
|
8035
8045
|
var e;
|
|
8036
|
-
return (e = (
|
|
8046
|
+
return (e = (Fr(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
8037
8047
|
}
|
|
8038
|
-
function
|
|
8048
|
+
function Fr(t) {
|
|
8039
8049
|
return kt() ? t instanceof Node || t instanceof se(t).Node : !1;
|
|
8040
8050
|
}
|
|
8041
8051
|
function fe(t) {
|
|
@@ -8044,7 +8054,7 @@ function fe(t) {
|
|
|
8044
8054
|
function ve(t) {
|
|
8045
8055
|
return kt() ? t instanceof HTMLElement || t instanceof se(t).HTMLElement : !1;
|
|
8046
8056
|
}
|
|
8047
|
-
function
|
|
8057
|
+
function Cn(t) {
|
|
8048
8058
|
return !kt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof se(t).ShadowRoot;
|
|
8049
8059
|
}
|
|
8050
8060
|
const Yi = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
@@ -8113,25 +8123,25 @@ function Re(t) {
|
|
|
8113
8123
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
8114
8124
|
t.assignedSlot || // DOM Element detected.
|
|
8115
8125
|
t.parentNode || // ShadowRoot detected.
|
|
8116
|
-
|
|
8126
|
+
Cn(t) && t.host || // Fallback.
|
|
8117
8127
|
Oe(t)
|
|
8118
8128
|
);
|
|
8119
|
-
return
|
|
8129
|
+
return Cn(e) ? e.host : e;
|
|
8120
8130
|
}
|
|
8121
|
-
function
|
|
8131
|
+
function Hr(t) {
|
|
8122
8132
|
const e = Re(t);
|
|
8123
|
-
return Ke(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : ve(e) && rt(e) ? e :
|
|
8133
|
+
return Ke(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : ve(e) && rt(e) ? e : Hr(e);
|
|
8124
8134
|
}
|
|
8125
|
-
function
|
|
8135
|
+
function $r(t, e, n) {
|
|
8126
8136
|
var r;
|
|
8127
8137
|
e === void 0 && (e = []);
|
|
8128
|
-
const s =
|
|
8129
|
-
return o ? (qt(a), e.concat(a, a.visualViewport || [], rt(s) ? s : [], [])) : e.concat(s,
|
|
8138
|
+
const s = Hr(t), o = s === ((r = t.ownerDocument) == null ? void 0 : r.body), a = se(s);
|
|
8139
|
+
return o ? (qt(a), e.concat(a, a.visualViewport || [], rt(s) ? s : [], [])) : e.concat(s, $r(s, []));
|
|
8130
8140
|
}
|
|
8131
8141
|
function qt(t) {
|
|
8132
8142
|
return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
|
|
8133
8143
|
}
|
|
8134
|
-
function
|
|
8144
|
+
function Kr(t) {
|
|
8135
8145
|
const e = he(t);
|
|
8136
8146
|
let n = parseFloat(e.width) || 0, r = parseFloat(e.height) || 0;
|
|
8137
8147
|
const s = ve(t), o = s ? t.offsetWidth : n, a = s ? t.offsetHeight : r, l = yt(n) !== o || yt(r) !== a;
|
|
@@ -8141,18 +8151,18 @@ function $r(t) {
|
|
|
8141
8151
|
$: l
|
|
8142
8152
|
};
|
|
8143
8153
|
}
|
|
8144
|
-
function
|
|
8154
|
+
function Jr(t) {
|
|
8145
8155
|
return fe(t) ? t : t.contextElement;
|
|
8146
8156
|
}
|
|
8147
8157
|
function Ue(t) {
|
|
8148
|
-
const e =
|
|
8158
|
+
const e = Jr(t);
|
|
8149
8159
|
if (!ve(e))
|
|
8150
8160
|
return we(1);
|
|
8151
8161
|
const n = e.getBoundingClientRect(), {
|
|
8152
8162
|
width: r,
|
|
8153
8163
|
height: s,
|
|
8154
8164
|
$: o
|
|
8155
|
-
} =
|
|
8165
|
+
} = Kr(e);
|
|
8156
8166
|
let a = (o ? yt(n.width) : n.width) / r, l = (o ? yt(n.height) : n.height) / s;
|
|
8157
8167
|
return (!a || !Number.isFinite(a)) && (a = 1), (!l || !Number.isFinite(l)) && (l = 1), {
|
|
8158
8168
|
x: a,
|
|
@@ -8160,7 +8170,7 @@ function Ue(t) {
|
|
|
8160
8170
|
};
|
|
8161
8171
|
}
|
|
8162
8172
|
const oa = /* @__PURE__ */ we(0);
|
|
8163
|
-
function
|
|
8173
|
+
function Wr(t) {
|
|
8164
8174
|
const e = se(t);
|
|
8165
8175
|
return !nn() || !e.visualViewport ? oa : {
|
|
8166
8176
|
x: e.visualViewport.offsetLeft,
|
|
@@ -8172,16 +8182,16 @@ function ia(t, e, n) {
|
|
|
8172
8182
|
}
|
|
8173
8183
|
function Qe(t, e, n, r) {
|
|
8174
8184
|
e === void 0 && (e = !1), n === void 0 && (n = !1);
|
|
8175
|
-
const s = t.getBoundingClientRect(), o =
|
|
8185
|
+
const s = t.getBoundingClientRect(), o = Jr(t);
|
|
8176
8186
|
let a = we(1);
|
|
8177
8187
|
e && (r ? fe(r) && (a = Ue(r)) : a = Ue(t));
|
|
8178
|
-
const l = ia(o, n, r) ?
|
|
8188
|
+
const l = ia(o, n, r) ? Wr(o) : we(0);
|
|
8179
8189
|
let c = (s.left + l.x) / a.x, d = (s.top + l.y) / a.y, u = s.width / a.x, f = s.height / a.y;
|
|
8180
8190
|
if (o) {
|
|
8181
8191
|
const p = se(o), h = r && fe(r) ? se(r) : r;
|
|
8182
8192
|
let b = p, w = qt(b);
|
|
8183
8193
|
for (; w && r && h !== b; ) {
|
|
8184
|
-
const g = Ue(w),
|
|
8194
|
+
const g = Ue(w), _ = w.getBoundingClientRect(), N = he(w), x = _.left + (w.clientLeft + parseFloat(N.paddingLeft)) * g.x, T = _.top + (w.clientTop + parseFloat(N.paddingTop)) * g.y;
|
|
8185
8195
|
c *= g.x, d *= g.y, u *= g.x, f *= g.y, c += x, d += T, b = se(w), w = qt(b);
|
|
8186
8196
|
}
|
|
8187
8197
|
}
|
|
@@ -8196,7 +8206,7 @@ function Rt(t, e) {
|
|
|
8196
8206
|
const n = Ot(t).scrollLeft;
|
|
8197
8207
|
return e ? e.left + n : Qe(Oe(t)).left + n;
|
|
8198
8208
|
}
|
|
8199
|
-
function
|
|
8209
|
+
function qr(t, e) {
|
|
8200
8210
|
const n = t.getBoundingClientRect(), r = n.left + e.scrollLeft - Rt(t, n), s = n.top + e.scrollTop;
|
|
8201
8211
|
return {
|
|
8202
8212
|
x: r,
|
|
@@ -8222,7 +8232,7 @@ function aa(t) {
|
|
|
8222
8232
|
const h = Qe(r);
|
|
8223
8233
|
d = Ue(r), u.x = h.x + r.clientLeft, u.y = h.y + r.clientTop;
|
|
8224
8234
|
}
|
|
8225
|
-
const p = a && !f && !o ?
|
|
8235
|
+
const p = a && !f && !o ? qr(a, c) : we(0);
|
|
8226
8236
|
return {
|
|
8227
8237
|
width: n.width * d.x,
|
|
8228
8238
|
height: n.height * d.y,
|
|
@@ -8244,7 +8254,7 @@ function ca(t) {
|
|
|
8244
8254
|
y: l
|
|
8245
8255
|
};
|
|
8246
8256
|
}
|
|
8247
|
-
const
|
|
8257
|
+
const Tn = 25;
|
|
8248
8258
|
function da(t, e) {
|
|
8249
8259
|
const n = se(t), r = Oe(t), s = n.visualViewport;
|
|
8250
8260
|
let o = r.clientWidth, a = r.clientHeight, l = 0, c = 0;
|
|
@@ -8256,8 +8266,8 @@ function da(t, e) {
|
|
|
8256
8266
|
const d = Rt(r);
|
|
8257
8267
|
if (d <= 0) {
|
|
8258
8268
|
const u = r.ownerDocument, f = u.body, p = getComputedStyle(f), h = u.compatMode === "CSS1Compat" && parseFloat(p.marginLeft) + parseFloat(p.marginRight) || 0, b = Math.abs(r.clientWidth - f.clientWidth - h);
|
|
8259
|
-
b <=
|
|
8260
|
-
} else d <=
|
|
8269
|
+
b <= Tn && (o -= b);
|
|
8270
|
+
} else d <= Tn && (o += d);
|
|
8261
8271
|
return {
|
|
8262
8272
|
width: o,
|
|
8263
8273
|
height: a,
|
|
@@ -8275,7 +8285,7 @@ function fa(t, e) {
|
|
|
8275
8285
|
y: d
|
|
8276
8286
|
};
|
|
8277
8287
|
}
|
|
8278
|
-
function
|
|
8288
|
+
function Sn(t, e, n) {
|
|
8279
8289
|
let r;
|
|
8280
8290
|
if (e === "viewport")
|
|
8281
8291
|
r = da(t, n);
|
|
@@ -8284,7 +8294,7 @@ function Tn(t, e, n) {
|
|
|
8284
8294
|
else if (fe(e))
|
|
8285
8295
|
r = fa(e, n);
|
|
8286
8296
|
else {
|
|
8287
|
-
const s =
|
|
8297
|
+
const s = Wr(t);
|
|
8288
8298
|
r = {
|
|
8289
8299
|
x: e.x - s.x,
|
|
8290
8300
|
y: e.y - s.y,
|
|
@@ -8294,20 +8304,20 @@ function Tn(t, e, n) {
|
|
|
8294
8304
|
}
|
|
8295
8305
|
return He(r);
|
|
8296
8306
|
}
|
|
8297
|
-
function
|
|
8307
|
+
function Vr(t, e) {
|
|
8298
8308
|
const n = Re(t);
|
|
8299
|
-
return n === e || !fe(n) || Ke(n) ? !1 : he(n).position === "fixed" ||
|
|
8309
|
+
return n === e || !fe(n) || Ke(n) ? !1 : he(n).position === "fixed" || Vr(n, e);
|
|
8300
8310
|
}
|
|
8301
8311
|
function ha(t, e) {
|
|
8302
8312
|
const n = e.get(t);
|
|
8303
8313
|
if (n)
|
|
8304
8314
|
return n;
|
|
8305
|
-
let r =
|
|
8315
|
+
let r = $r(t, []).filter((l) => fe(l) && Je(l) !== "body"), s = null;
|
|
8306
8316
|
const o = he(t).position === "fixed";
|
|
8307
8317
|
let a = o ? Re(t) : t;
|
|
8308
8318
|
for (; fe(a) && !Ke(a); ) {
|
|
8309
8319
|
const l = he(a), c = tn(a);
|
|
8310
|
-
!c && l.position === "fixed" && (s = null), (o ? !c && !s : !c && l.position === "static" && !!s && ua.has(s.position) || rt(a) && !c &&
|
|
8320
|
+
!c && l.position === "fixed" && (s = null), (o ? !c && !s : !c && l.position === "static" && !!s && ua.has(s.position) || rt(a) && !c && Vr(t, a)) ? r = r.filter((u) => u !== a) : s = l, a = Re(a);
|
|
8311
8321
|
}
|
|
8312
8322
|
return e.set(t, r), r;
|
|
8313
8323
|
}
|
|
@@ -8319,9 +8329,9 @@ function ma(t) {
|
|
|
8319
8329
|
strategy: s
|
|
8320
8330
|
} = t;
|
|
8321
8331
|
const a = [...n === "clippingAncestors" ? At(e) ? [] : ha(e, this._c) : [].concat(n), r], l = a[0], c = a.reduce((d, u) => {
|
|
8322
|
-
const f =
|
|
8332
|
+
const f = Sn(e, u, s);
|
|
8323
8333
|
return d.top = ee(f.top, d.top), d.right = xe(f.right, d.right), d.bottom = xe(f.bottom, d.bottom), d.left = ee(f.left, d.left), d;
|
|
8324
|
-
},
|
|
8334
|
+
}, Sn(e, l, s));
|
|
8325
8335
|
return {
|
|
8326
8336
|
width: c.right - c.left,
|
|
8327
8337
|
height: c.bottom - c.top,
|
|
@@ -8333,7 +8343,7 @@ function pa(t) {
|
|
|
8333
8343
|
const {
|
|
8334
8344
|
width: e,
|
|
8335
8345
|
height: n
|
|
8336
|
-
} =
|
|
8346
|
+
} = Kr(t);
|
|
8337
8347
|
return {
|
|
8338
8348
|
width: e,
|
|
8339
8349
|
height: n
|
|
@@ -8355,7 +8365,7 @@ function ga(t, e, n) {
|
|
|
8355
8365
|
c.x = h.x + e.clientLeft, c.y = h.y + e.clientTop;
|
|
8356
8366
|
} else s && d();
|
|
8357
8367
|
o && !r && s && d();
|
|
8358
|
-
const u = s && !r && !o ?
|
|
8368
|
+
const u = s && !r && !o ? qr(s, l) : we(0), f = a.left + l.scrollLeft - c.x - u.x, p = a.top + l.scrollTop - c.y - u.y;
|
|
8359
8369
|
return {
|
|
8360
8370
|
x: f,
|
|
8361
8371
|
y: p,
|
|
@@ -8366,7 +8376,7 @@ function ga(t, e, n) {
|
|
|
8366
8376
|
function Pt(t) {
|
|
8367
8377
|
return he(t).position === "static";
|
|
8368
8378
|
}
|
|
8369
|
-
function
|
|
8379
|
+
function _n(t, e) {
|
|
8370
8380
|
if (!ve(t) || he(t).position === "fixed")
|
|
8371
8381
|
return null;
|
|
8372
8382
|
if (e)
|
|
@@ -8374,7 +8384,7 @@ function Sn(t, e) {
|
|
|
8374
8384
|
let n = t.offsetParent;
|
|
8375
8385
|
return Oe(t) === n && (n = n.ownerDocument.body), n;
|
|
8376
8386
|
}
|
|
8377
|
-
function
|
|
8387
|
+
function Gr(t, e) {
|
|
8378
8388
|
const n = se(t);
|
|
8379
8389
|
if (At(t))
|
|
8380
8390
|
return n;
|
|
@@ -8387,13 +8397,13 @@ function Vr(t, e) {
|
|
|
8387
8397
|
}
|
|
8388
8398
|
return n;
|
|
8389
8399
|
}
|
|
8390
|
-
let r =
|
|
8400
|
+
let r = _n(t, e);
|
|
8391
8401
|
for (; r && Xi(r) && Pt(r); )
|
|
8392
|
-
r =
|
|
8402
|
+
r = _n(r, e);
|
|
8393
8403
|
return r && Ke(r) && Pt(r) && !tn(r) ? n : r || ra(t) || n;
|
|
8394
8404
|
}
|
|
8395
8405
|
const ba = async function(t) {
|
|
8396
|
-
const e = this.getOffsetParent ||
|
|
8406
|
+
const e = this.getOffsetParent || Gr, n = this.getDimensions, r = await n(t.floating);
|
|
8397
8407
|
return {
|
|
8398
8408
|
reference: ga(t.reference, await e(t.floating), t.strategy),
|
|
8399
8409
|
floating: {
|
|
@@ -8411,14 +8421,14 @@ const ya = {
|
|
|
8411
8421
|
convertOffsetParentRelativeRectToViewportRelativeRect: aa,
|
|
8412
8422
|
getDocumentElement: Oe,
|
|
8413
8423
|
getClippingRect: ma,
|
|
8414
|
-
getOffsetParent:
|
|
8424
|
+
getOffsetParent: Gr,
|
|
8415
8425
|
getElementRects: ba,
|
|
8416
8426
|
getClientRects: la,
|
|
8417
8427
|
getDimensions: pa,
|
|
8418
8428
|
getScale: Ue,
|
|
8419
8429
|
isElement: fe,
|
|
8420
8430
|
isRTL: wa
|
|
8421
|
-
},
|
|
8431
|
+
}, Yr = qi, Zr = Ui, Xr = Vi, Qr = Fi, es = Gi, ts = Hi, ns = Bi, rs = Ki, ss = (t, e, n) => {
|
|
8422
8432
|
const r = /* @__PURE__ */ new Map(), s = {
|
|
8423
8433
|
platform: ya,
|
|
8424
8434
|
...n
|
|
@@ -8431,7 +8441,7 @@ const ya = {
|
|
|
8431
8441
|
platform: o
|
|
8432
8442
|
});
|
|
8433
8443
|
};
|
|
8434
|
-
function
|
|
8444
|
+
function os(t, e, n) {
|
|
8435
8445
|
for (let r = 0; ; r++) {
|
|
8436
8446
|
if (r == t.childCount || r == e.childCount)
|
|
8437
8447
|
return t.childCount == e.childCount ? null : n;
|
|
@@ -8448,14 +8458,14 @@ function ss(t, e, n) {
|
|
|
8448
8458
|
return n;
|
|
8449
8459
|
}
|
|
8450
8460
|
if (s.content.size || o.content.size) {
|
|
8451
|
-
let a =
|
|
8461
|
+
let a = os(s.content, o.content, n + 1);
|
|
8452
8462
|
if (a != null)
|
|
8453
8463
|
return a;
|
|
8454
8464
|
}
|
|
8455
8465
|
n += s.nodeSize;
|
|
8456
8466
|
}
|
|
8457
8467
|
}
|
|
8458
|
-
function
|
|
8468
|
+
function is(t, e, n, r) {
|
|
8459
8469
|
for (let s = t.childCount, o = e.childCount; ; ) {
|
|
8460
8470
|
if (s == 0 || o == 0)
|
|
8461
8471
|
return s == o ? null : { a: n, b: r };
|
|
@@ -8473,14 +8483,14 @@ function os(t, e, n, r) {
|
|
|
8473
8483
|
return { a: n, b: r };
|
|
8474
8484
|
}
|
|
8475
8485
|
if (a.content.size || l.content.size) {
|
|
8476
|
-
let d =
|
|
8486
|
+
let d = is(a.content, l.content, n - 1, r - 1);
|
|
8477
8487
|
if (d)
|
|
8478
8488
|
return d;
|
|
8479
8489
|
}
|
|
8480
8490
|
n -= c, r -= c;
|
|
8481
8491
|
}
|
|
8482
8492
|
}
|
|
8483
|
-
class
|
|
8493
|
+
class $ {
|
|
8484
8494
|
/**
|
|
8485
8495
|
@internal
|
|
8486
8496
|
*/
|
|
@@ -8535,7 +8545,7 @@ class H {
|
|
|
8535
8545
|
let n = this.lastChild, r = e.firstChild, s = this.content.slice(), o = 0;
|
|
8536
8546
|
for (n.isText && n.sameMarkup(r) && (s[s.length - 1] = n.withText(n.text + r.text), o = 1); o < e.content.length; o++)
|
|
8537
8547
|
s.push(e.content[o]);
|
|
8538
|
-
return new
|
|
8548
|
+
return new $(s, this.size + e.size);
|
|
8539
8549
|
}
|
|
8540
8550
|
/**
|
|
8541
8551
|
Cut out the sub-fragment between the two given positions.
|
|
@@ -8549,13 +8559,13 @@ class H {
|
|
|
8549
8559
|
let l = this.content[o], c = a + l.nodeSize;
|
|
8550
8560
|
c > e && ((a < e || c > n) && (l.isText ? l = l.cut(Math.max(0, e - a), Math.min(l.text.length, n - a)) : l = l.cut(Math.max(0, e - a - 1), Math.min(l.content.size, n - a - 1))), r.push(l), s += l.nodeSize), a = c;
|
|
8551
8561
|
}
|
|
8552
|
-
return new
|
|
8562
|
+
return new $(r, s);
|
|
8553
8563
|
}
|
|
8554
8564
|
/**
|
|
8555
8565
|
@internal
|
|
8556
8566
|
*/
|
|
8557
8567
|
cutByIndex(e, n) {
|
|
8558
|
-
return e == n ?
|
|
8568
|
+
return e == n ? $.empty : e == 0 && n == this.content.length ? this : new $(this.content.slice(e, n));
|
|
8559
8569
|
}
|
|
8560
8570
|
/**
|
|
8561
8571
|
Create a new fragment in which the node at the given index is
|
|
@@ -8566,21 +8576,21 @@ class H {
|
|
|
8566
8576
|
if (r == n)
|
|
8567
8577
|
return this;
|
|
8568
8578
|
let s = this.content.slice(), o = this.size + n.nodeSize - r.nodeSize;
|
|
8569
|
-
return s[e] = n, new
|
|
8579
|
+
return s[e] = n, new $(s, o);
|
|
8570
8580
|
}
|
|
8571
8581
|
/**
|
|
8572
8582
|
Create a new fragment by prepending the given node to this
|
|
8573
8583
|
fragment.
|
|
8574
8584
|
*/
|
|
8575
8585
|
addToStart(e) {
|
|
8576
|
-
return new
|
|
8586
|
+
return new $([e].concat(this.content), this.size + e.nodeSize);
|
|
8577
8587
|
}
|
|
8578
8588
|
/**
|
|
8579
8589
|
Create a new fragment by appending the given node to this
|
|
8580
8590
|
fragment.
|
|
8581
8591
|
*/
|
|
8582
8592
|
addToEnd(e) {
|
|
8583
|
-
return new
|
|
8593
|
+
return new $(this.content.concat(e), this.size + e.nodeSize);
|
|
8584
8594
|
}
|
|
8585
8595
|
/**
|
|
8586
8596
|
Compare this fragment to another one.
|
|
@@ -8642,7 +8652,7 @@ class H {
|
|
|
8642
8652
|
fragment differ, or `null` if they are the same.
|
|
8643
8653
|
*/
|
|
8644
8654
|
findDiffStart(e, n = 0) {
|
|
8645
|
-
return
|
|
8655
|
+
return os(this, e, n);
|
|
8646
8656
|
}
|
|
8647
8657
|
/**
|
|
8648
8658
|
Find the first position, searching from the end, at which this
|
|
@@ -8651,7 +8661,7 @@ class H {
|
|
|
8651
8661
|
nodes, an object with two separate positions is returned.
|
|
8652
8662
|
*/
|
|
8653
8663
|
findDiffEnd(e, n = this.size, r = e.size) {
|
|
8654
|
-
return
|
|
8664
|
+
return is(this, e, n, r);
|
|
8655
8665
|
}
|
|
8656
8666
|
/**
|
|
8657
8667
|
Find the index and inner offset corresponding to a given relative
|
|
@@ -8695,10 +8705,10 @@ class H {
|
|
|
8695
8705
|
*/
|
|
8696
8706
|
static fromJSON(e, n) {
|
|
8697
8707
|
if (!n)
|
|
8698
|
-
return
|
|
8708
|
+
return $.empty;
|
|
8699
8709
|
if (!Array.isArray(n))
|
|
8700
8710
|
throw new RangeError("Invalid input for Fragment.fromJSON");
|
|
8701
|
-
return new
|
|
8711
|
+
return new $(n.map(e.nodeFromJSON));
|
|
8702
8712
|
}
|
|
8703
8713
|
/**
|
|
8704
8714
|
Build a fragment from an array of nodes. Ensures that adjacent
|
|
@@ -8706,13 +8716,13 @@ class H {
|
|
|
8706
8716
|
*/
|
|
8707
8717
|
static fromArray(e) {
|
|
8708
8718
|
if (!e.length)
|
|
8709
|
-
return
|
|
8719
|
+
return $.empty;
|
|
8710
8720
|
let n, r = 0;
|
|
8711
8721
|
for (let s = 0; s < e.length; s++) {
|
|
8712
8722
|
let o = e[s];
|
|
8713
8723
|
r += o.nodeSize, s && o.isText && e[s - 1].sameMarkup(o) ? (n || (n = e.slice(0, s)), n[n.length - 1] = o.withText(n[n.length - 1].text + o.text)) : n && n.push(o);
|
|
8714
8724
|
}
|
|
8715
|
-
return new
|
|
8725
|
+
return new $(n || e, r);
|
|
8716
8726
|
}
|
|
8717
8727
|
/**
|
|
8718
8728
|
Create a fragment from something that can be interpreted as a
|
|
@@ -8722,17 +8732,17 @@ class H {
|
|
|
8722
8732
|
*/
|
|
8723
8733
|
static from(e) {
|
|
8724
8734
|
if (!e)
|
|
8725
|
-
return
|
|
8726
|
-
if (e instanceof
|
|
8735
|
+
return $.empty;
|
|
8736
|
+
if (e instanceof $)
|
|
8727
8737
|
return e;
|
|
8728
8738
|
if (Array.isArray(e))
|
|
8729
8739
|
return this.fromArray(e);
|
|
8730
8740
|
if (e.attrs)
|
|
8731
|
-
return new
|
|
8741
|
+
return new $([e], e.nodeSize);
|
|
8732
8742
|
throw new RangeError("Can not convert " + e + " to a Fragment" + (e.nodesBetween ? " (looks like multiple versions of prosemirror-model were loaded)" : ""));
|
|
8733
8743
|
}
|
|
8734
8744
|
}
|
|
8735
|
-
|
|
8745
|
+
$.empty = new $([], 0);
|
|
8736
8746
|
const Bt = { index: 0, offset: 0 };
|
|
8737
8747
|
function dt(t, e) {
|
|
8738
8748
|
return Bt.index = t, Bt.offset = e, Bt;
|
|
@@ -8765,14 +8775,14 @@ class U {
|
|
|
8765
8775
|
@internal
|
|
8766
8776
|
*/
|
|
8767
8777
|
insertAt(e, n) {
|
|
8768
|
-
let r =
|
|
8778
|
+
let r = ls(this.content, e + this.openStart, n);
|
|
8769
8779
|
return r && new U(r, this.openStart, this.openEnd);
|
|
8770
8780
|
}
|
|
8771
8781
|
/**
|
|
8772
8782
|
@internal
|
|
8773
8783
|
*/
|
|
8774
8784
|
removeBetween(e, n) {
|
|
8775
|
-
return new U(
|
|
8785
|
+
return new U(as(this.content, e + this.openStart, n + this.openStart), this.openStart, this.openEnd);
|
|
8776
8786
|
}
|
|
8777
8787
|
/**
|
|
8778
8788
|
Tests whether this slice is equal to another slice.
|
|
@@ -8804,7 +8814,7 @@ class U {
|
|
|
8804
8814
|
let r = n.openStart || 0, s = n.openEnd || 0;
|
|
8805
8815
|
if (typeof r != "number" || typeof s != "number")
|
|
8806
8816
|
throw new RangeError("Invalid input for Slice.fromJSON");
|
|
8807
|
-
return new U(
|
|
8817
|
+
return new U($.fromJSON(e, n.content), r, s);
|
|
8808
8818
|
}
|
|
8809
8819
|
/**
|
|
8810
8820
|
Create a slice from a fragment by taking the maximum possible
|
|
@@ -8819,8 +8829,8 @@ class U {
|
|
|
8819
8829
|
return new U(e, r, s);
|
|
8820
8830
|
}
|
|
8821
8831
|
}
|
|
8822
|
-
U.empty = new U(
|
|
8823
|
-
function
|
|
8832
|
+
U.empty = new U($.empty, 0, 0);
|
|
8833
|
+
function as(t, e, n) {
|
|
8824
8834
|
let { index: r, offset: s } = t.findIndex(e), o = t.maybeChild(r), { index: a, offset: l } = t.findIndex(n);
|
|
8825
8835
|
if (s == e || o.isText) {
|
|
8826
8836
|
if (l != n && !t.child(a).isText)
|
|
@@ -8829,27 +8839,27 @@ function is(t, e, n) {
|
|
|
8829
8839
|
}
|
|
8830
8840
|
if (r != a)
|
|
8831
8841
|
throw new RangeError("Removing non-flat range");
|
|
8832
|
-
return t.replaceChild(r, o.copy(
|
|
8842
|
+
return t.replaceChild(r, o.copy(as(o.content, e - s - 1, n - s - 1)));
|
|
8833
8843
|
}
|
|
8834
|
-
function
|
|
8844
|
+
function ls(t, e, n, r) {
|
|
8835
8845
|
let { index: s, offset: o } = t.findIndex(e), a = t.maybeChild(s);
|
|
8836
8846
|
if (o == e || a.isText)
|
|
8837
8847
|
return r && !r.canReplace(s, s, n) ? null : t.cut(0, e).append(n).append(t.cut(e));
|
|
8838
|
-
let l =
|
|
8848
|
+
let l = ls(a.content, e - o - 1, n, a);
|
|
8839
8849
|
return l && t.replaceChild(s, a.copy(l));
|
|
8840
8850
|
}
|
|
8841
|
-
const
|
|
8851
|
+
const cs = 65535, ds = Math.pow(2, 16);
|
|
8842
8852
|
function va(t, e) {
|
|
8843
|
-
return t + e *
|
|
8853
|
+
return t + e * ds;
|
|
8844
8854
|
}
|
|
8845
|
-
function
|
|
8846
|
-
return t &
|
|
8855
|
+
function kn(t) {
|
|
8856
|
+
return t & cs;
|
|
8847
8857
|
}
|
|
8848
8858
|
function Ea(t) {
|
|
8849
|
-
return (t - (t &
|
|
8859
|
+
return (t - (t & cs)) / ds;
|
|
8850
8860
|
}
|
|
8851
|
-
const
|
|
8852
|
-
class
|
|
8861
|
+
const us = 1, fs = 2, gt = 4, hs = 8;
|
|
8862
|
+
class An {
|
|
8853
8863
|
/**
|
|
8854
8864
|
@internal
|
|
8855
8865
|
*/
|
|
@@ -8862,19 +8872,19 @@ class kn {
|
|
|
8862
8872
|
argument from the document.
|
|
8863
8873
|
*/
|
|
8864
8874
|
get deleted() {
|
|
8865
|
-
return (this.delInfo &
|
|
8875
|
+
return (this.delInfo & hs) > 0;
|
|
8866
8876
|
}
|
|
8867
8877
|
/**
|
|
8868
8878
|
Tells you whether the token before the mapped position was deleted.
|
|
8869
8879
|
*/
|
|
8870
8880
|
get deletedBefore() {
|
|
8871
|
-
return (this.delInfo & (
|
|
8881
|
+
return (this.delInfo & (us | gt)) > 0;
|
|
8872
8882
|
}
|
|
8873
8883
|
/**
|
|
8874
8884
|
True when the token after the mapped position was deleted.
|
|
8875
8885
|
*/
|
|
8876
8886
|
get deletedAfter() {
|
|
8877
|
-
return (this.delInfo & (
|
|
8887
|
+
return (this.delInfo & (fs | gt)) > 0;
|
|
8878
8888
|
}
|
|
8879
8889
|
/**
|
|
8880
8890
|
Tells whether any of the steps mapped through deletes across the
|
|
@@ -8899,7 +8909,7 @@ class re {
|
|
|
8899
8909
|
@internal
|
|
8900
8910
|
*/
|
|
8901
8911
|
recover(e) {
|
|
8902
|
-
let n = 0, r =
|
|
8912
|
+
let n = 0, r = kn(e);
|
|
8903
8913
|
if (!this.inverted)
|
|
8904
8914
|
for (let s = 0; s < r; s++)
|
|
8905
8915
|
n += this.ranges[s * 3 + 2] - this.ranges[s * 3 + 1];
|
|
@@ -8925,18 +8935,18 @@ class re {
|
|
|
8925
8935
|
let p = d ? e == c ? -1 : e == f ? 1 : n : n, h = c + s + (p < 0 ? 0 : u);
|
|
8926
8936
|
if (r)
|
|
8927
8937
|
return h;
|
|
8928
|
-
let b = e == (n < 0 ? c : f) ? null : va(l / 3, e - c), w = e == c ?
|
|
8929
|
-
return (n < 0 ? e != c : e != f) && (w |=
|
|
8938
|
+
let b = e == (n < 0 ? c : f) ? null : va(l / 3, e - c), w = e == c ? fs : e == f ? us : gt;
|
|
8939
|
+
return (n < 0 ? e != c : e != f) && (w |= hs), new An(h, w, b);
|
|
8930
8940
|
}
|
|
8931
8941
|
s += u - d;
|
|
8932
8942
|
}
|
|
8933
|
-
return r ? e + s : new
|
|
8943
|
+
return r ? e + s : new An(e + s, 0, null);
|
|
8934
8944
|
}
|
|
8935
8945
|
/**
|
|
8936
8946
|
@internal
|
|
8937
8947
|
*/
|
|
8938
8948
|
touches(e, n) {
|
|
8939
|
-
let r = 0, s =
|
|
8949
|
+
let r = 0, s = kn(n), o = this.inverted ? 2 : 1, a = this.inverted ? 1 : 2;
|
|
8940
8950
|
for (let l = 0; l < this.ranges.length; l += 3) {
|
|
8941
8951
|
let c = this.ranges[l] - (this.inverted ? r : 0);
|
|
8942
8952
|
if (c > e)
|
|
@@ -9064,7 +9074,7 @@ function rn(t, e, n) {
|
|
|
9064
9074
|
let o = t.child(s);
|
|
9065
9075
|
o.content.size && (o = o.copy(rn(o.content, e, o))), o.isInline && (o = e(o, n, s)), r.push(o);
|
|
9066
9076
|
}
|
|
9067
|
-
return
|
|
9077
|
+
return $.fromArray(r);
|
|
9068
9078
|
}
|
|
9069
9079
|
class Ie extends Q {
|
|
9070
9080
|
/**
|
|
@@ -9156,7 +9166,7 @@ class je extends Q {
|
|
|
9156
9166
|
if (!n)
|
|
9157
9167
|
return Z.fail("No node at mark step's position");
|
|
9158
9168
|
let r = n.type.create(n.attrs, null, this.mark.addToSet(n.marks));
|
|
9159
|
-
return Z.fromReplace(e, this.pos, this.pos + 1, new U(
|
|
9169
|
+
return Z.fromReplace(e, this.pos, this.pos + 1, new U($.from(r), 0, n.isLeaf ? 0 : 1));
|
|
9160
9170
|
}
|
|
9161
9171
|
invert(e) {
|
|
9162
9172
|
let n = e.nodeAt(this.pos);
|
|
@@ -9200,7 +9210,7 @@ class et extends Q {
|
|
|
9200
9210
|
if (!n)
|
|
9201
9211
|
return Z.fail("No node at mark step's position");
|
|
9202
9212
|
let r = n.type.create(n.attrs, null, this.mark.removeFromSet(n.marks));
|
|
9203
|
-
return Z.fromReplace(e, this.pos, this.pos + 1, new U(
|
|
9213
|
+
return Z.fromReplace(e, this.pos, this.pos + 1, new U($.from(r), 0, n.isLeaf ? 0 : 1));
|
|
9204
9214
|
}
|
|
9205
9215
|
invert(e) {
|
|
9206
9216
|
let n = e.nodeAt(this.pos);
|
|
@@ -9363,7 +9373,7 @@ class Ye extends Q {
|
|
|
9363
9373
|
r[o] = n.attrs[o];
|
|
9364
9374
|
r[this.attr] = this.value;
|
|
9365
9375
|
let s = n.type.create(r, null, n.marks);
|
|
9366
|
-
return Z.fromReplace(e, this.pos, this.pos + 1, new U(
|
|
9376
|
+
return Z.fromReplace(e, this.pos, this.pos + 1, new U($.from(s), 0, n.isLeaf ? 0 : 1));
|
|
9367
9377
|
}
|
|
9368
9378
|
getMap() {
|
|
9369
9379
|
return re.empty;
|
|
@@ -9429,14 +9439,14 @@ tt.prototype = Object.create(Error.prototype);
|
|
|
9429
9439
|
tt.prototype.constructor = tt;
|
|
9430
9440
|
tt.prototype.name = "TransformError";
|
|
9431
9441
|
const Ut = /* @__PURE__ */ Object.create(null);
|
|
9432
|
-
class
|
|
9442
|
+
class K {
|
|
9433
9443
|
/**
|
|
9434
9444
|
Initialize a selection with the head and anchor and ranges. If no
|
|
9435
9445
|
ranges are given, constructs a single range across `$anchor` and
|
|
9436
9446
|
`$head`.
|
|
9437
9447
|
*/
|
|
9438
9448
|
constructor(e, n, r) {
|
|
9439
|
-
this.$anchor = e, this.$head = n, this.ranges = r || [new
|
|
9449
|
+
this.$anchor = e, this.$head = n, this.ranges = r || [new ms(e.min(n), e.max(n))];
|
|
9440
9450
|
}
|
|
9441
9451
|
/**
|
|
9442
9452
|
The selection's anchor, as an unresolved position.
|
|
@@ -9501,7 +9511,7 @@ class $ {
|
|
|
9501
9511
|
let o = e.steps.length, a = this.ranges;
|
|
9502
9512
|
for (let l = 0; l < a.length; l++) {
|
|
9503
9513
|
let { $from: c, $to: d } = a[l], u = e.mapping.slice(o);
|
|
9504
|
-
e.replaceRange(u.map(c.pos), u.map(d.pos), l ? U.empty : n), l == 0 &&
|
|
9514
|
+
e.replaceRange(u.map(c.pos), u.map(d.pos), l ? U.empty : n), l == 0 && Mn(e, o, (r ? r.isInline : s && s.isTextblock) ? -1 : 1);
|
|
9505
9515
|
}
|
|
9506
9516
|
}
|
|
9507
9517
|
/**
|
|
@@ -9512,7 +9522,7 @@ class $ {
|
|
|
9512
9522
|
let r = e.steps.length, s = this.ranges;
|
|
9513
9523
|
for (let o = 0; o < s.length; o++) {
|
|
9514
9524
|
let { $from: a, $to: l } = s[o], c = e.mapping.slice(r), d = c.map(a.pos), u = c.map(l.pos);
|
|
9515
|
-
o ? e.deleteRange(d, u) : (e.replaceRangeWith(d, u, n),
|
|
9525
|
+
o ? e.deleteRange(d, u) : (e.replaceRangeWith(d, u, n), Mn(e, r, n.isInline ? -1 : 1));
|
|
9516
9526
|
}
|
|
9517
9527
|
}
|
|
9518
9528
|
/**
|
|
@@ -9593,8 +9603,8 @@ class $ {
|
|
|
9593
9603
|
return ie.between(this.$anchor, this.$head).getBookmark();
|
|
9594
9604
|
}
|
|
9595
9605
|
}
|
|
9596
|
-
|
|
9597
|
-
class
|
|
9606
|
+
K.prototype.visible = !0;
|
|
9607
|
+
class ms {
|
|
9598
9608
|
/**
|
|
9599
9609
|
Create a range.
|
|
9600
9610
|
*/
|
|
@@ -9602,16 +9612,16 @@ class hs {
|
|
|
9602
9612
|
this.$from = e, this.$to = n;
|
|
9603
9613
|
}
|
|
9604
9614
|
}
|
|
9605
|
-
let
|
|
9606
|
-
function
|
|
9607
|
-
!
|
|
9615
|
+
let On = !1;
|
|
9616
|
+
function Rn(t) {
|
|
9617
|
+
!On && !t.parent.inlineContent && (On = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + t.parent.type.name + ")"));
|
|
9608
9618
|
}
|
|
9609
|
-
class ie extends
|
|
9619
|
+
class ie extends K {
|
|
9610
9620
|
/**
|
|
9611
9621
|
Construct a text selection between the given points.
|
|
9612
9622
|
*/
|
|
9613
9623
|
constructor(e, n = e) {
|
|
9614
|
-
|
|
9624
|
+
Rn(e), Rn(n), super(e, n);
|
|
9615
9625
|
}
|
|
9616
9626
|
/**
|
|
9617
9627
|
Returns a resolved position if this is a cursor selection (an
|
|
@@ -9623,7 +9633,7 @@ class ie extends $ {
|
|
|
9623
9633
|
map(e, n) {
|
|
9624
9634
|
let r = e.resolve(n.map(this.head));
|
|
9625
9635
|
if (!r.parent.inlineContent)
|
|
9626
|
-
return
|
|
9636
|
+
return K.near(r);
|
|
9627
9637
|
let s = e.resolve(n.map(this.anchor));
|
|
9628
9638
|
return new ie(s.parent.inlineContent ? s : r, r);
|
|
9629
9639
|
}
|
|
@@ -9668,16 +9678,16 @@ class ie extends $ {
|
|
|
9668
9678
|
static between(e, n, r) {
|
|
9669
9679
|
let s = e.pos - n.pos;
|
|
9670
9680
|
if ((!r || s) && (r = s >= 0 ? 1 : -1), !n.parent.inlineContent) {
|
|
9671
|
-
let o =
|
|
9681
|
+
let o = K.findFrom(n, r, !0) || K.findFrom(n, -r, !0);
|
|
9672
9682
|
if (o)
|
|
9673
9683
|
n = o.$head;
|
|
9674
9684
|
else
|
|
9675
|
-
return
|
|
9685
|
+
return K.near(n, r);
|
|
9676
9686
|
}
|
|
9677
|
-
return e.parent.inlineContent || (s == 0 ? e = n : (e = (
|
|
9687
|
+
return e.parent.inlineContent || (s == 0 ? e = n : (e = (K.findFrom(e, -r, !0) || K.findFrom(e, r, !0)).$anchor, e.pos < n.pos != s < 0 && (e = n))), new ie(e, n);
|
|
9678
9688
|
}
|
|
9679
9689
|
}
|
|
9680
|
-
|
|
9690
|
+
K.jsonID("text", ie);
|
|
9681
9691
|
class Mt {
|
|
9682
9692
|
constructor(e, n) {
|
|
9683
9693
|
this.anchor = e, this.head = n;
|
|
@@ -9689,7 +9699,7 @@ class Mt {
|
|
|
9689
9699
|
return ie.between(e.resolve(this.anchor), e.resolve(this.head));
|
|
9690
9700
|
}
|
|
9691
9701
|
}
|
|
9692
|
-
class ae extends
|
|
9702
|
+
class ae extends K {
|
|
9693
9703
|
/**
|
|
9694
9704
|
Create a node selection. Does not verify the validity of its
|
|
9695
9705
|
argument.
|
|
@@ -9700,10 +9710,10 @@ class ae extends $ {
|
|
|
9700
9710
|
}
|
|
9701
9711
|
map(e, n) {
|
|
9702
9712
|
let { deleted: r, pos: s } = n.mapResult(this.anchor), o = e.resolve(s);
|
|
9703
|
-
return r ?
|
|
9713
|
+
return r ? K.near(o) : new ae(o);
|
|
9704
9714
|
}
|
|
9705
9715
|
content() {
|
|
9706
|
-
return new U(
|
|
9716
|
+
return new U($.from(this.node), 0, 0);
|
|
9707
9717
|
}
|
|
9708
9718
|
eq(e) {
|
|
9709
9719
|
return e instanceof ae && e.anchor == this.anchor;
|
|
@@ -9737,7 +9747,7 @@ class ae extends $ {
|
|
|
9737
9747
|
}
|
|
9738
9748
|
}
|
|
9739
9749
|
ae.prototype.visible = !1;
|
|
9740
|
-
|
|
9750
|
+
K.jsonID("node", ae);
|
|
9741
9751
|
class sn {
|
|
9742
9752
|
constructor(e) {
|
|
9743
9753
|
this.anchor = e;
|
|
@@ -9748,10 +9758,10 @@ class sn {
|
|
|
9748
9758
|
}
|
|
9749
9759
|
resolve(e) {
|
|
9750
9760
|
let n = e.resolve(this.anchor), r = n.nodeAfter;
|
|
9751
|
-
return r && ae.isSelectable(r) ? new ae(n) :
|
|
9761
|
+
return r && ae.isSelectable(r) ? new ae(n) : K.near(n);
|
|
9752
9762
|
}
|
|
9753
9763
|
}
|
|
9754
|
-
class Se extends
|
|
9764
|
+
class Se extends K {
|
|
9755
9765
|
/**
|
|
9756
9766
|
Create an all-selection over the given document.
|
|
9757
9767
|
*/
|
|
@@ -9761,7 +9771,7 @@ class Se extends $ {
|
|
|
9761
9771
|
replace(e, n = U.empty) {
|
|
9762
9772
|
if (n == U.empty) {
|
|
9763
9773
|
e.delete(0, e.doc.content.size);
|
|
9764
|
-
let r =
|
|
9774
|
+
let r = K.atStart(e.doc);
|
|
9765
9775
|
r.eq(e.selection) || e.setSelection(r);
|
|
9766
9776
|
} else
|
|
9767
9777
|
super.replace(e, n);
|
|
@@ -9785,7 +9795,7 @@ class Se extends $ {
|
|
|
9785
9795
|
return Na;
|
|
9786
9796
|
}
|
|
9787
9797
|
}
|
|
9788
|
-
|
|
9798
|
+
K.jsonID("all", Se);
|
|
9789
9799
|
const Na = {
|
|
9790
9800
|
map() {
|
|
9791
9801
|
return this;
|
|
@@ -9811,7 +9821,7 @@ function ze(t, e, n, r, s, o = !1) {
|
|
|
9811
9821
|
}
|
|
9812
9822
|
return null;
|
|
9813
9823
|
}
|
|
9814
|
-
function
|
|
9824
|
+
function Mn(t, e, n) {
|
|
9815
9825
|
let r = t.steps.length - 1;
|
|
9816
9826
|
if (r < e)
|
|
9817
9827
|
return;
|
|
@@ -9821,14 +9831,14 @@ function Rn(t, e, n) {
|
|
|
9821
9831
|
let o = t.mapping.maps[r], a;
|
|
9822
9832
|
o.forEach((l, c, d, u) => {
|
|
9823
9833
|
a == null && (a = u);
|
|
9824
|
-
}), t.setSelection(
|
|
9834
|
+
}), t.setSelection(K.near(t.doc.resolve(a), n));
|
|
9825
9835
|
}
|
|
9826
|
-
function
|
|
9836
|
+
function In(t, e) {
|
|
9827
9837
|
return !e || !t ? t : t.bind(e);
|
|
9828
9838
|
}
|
|
9829
9839
|
class ut {
|
|
9830
9840
|
constructor(e, n, r) {
|
|
9831
|
-
this.name = e, this.init =
|
|
9841
|
+
this.name = e, this.init = In(n.init, r), this.apply = In(n.apply, r);
|
|
9832
9842
|
}
|
|
9833
9843
|
}
|
|
9834
9844
|
new ut("doc", {
|
|
@@ -9840,7 +9850,7 @@ new ut("doc", {
|
|
|
9840
9850
|
}
|
|
9841
9851
|
}), new ut("selection", {
|
|
9842
9852
|
init(t, e) {
|
|
9843
|
-
return t.selection ||
|
|
9853
|
+
return t.selection || K.atStart(e.doc);
|
|
9844
9854
|
},
|
|
9845
9855
|
apply(t) {
|
|
9846
9856
|
return t.selection;
|
|
@@ -9860,19 +9870,19 @@ new ut("doc", {
|
|
|
9860
9870
|
return t.scrolledIntoView ? e + 1 : e;
|
|
9861
9871
|
}
|
|
9862
9872
|
});
|
|
9863
|
-
function
|
|
9873
|
+
function ps(t, e, n) {
|
|
9864
9874
|
for (let r in t) {
|
|
9865
9875
|
let s = t[r];
|
|
9866
|
-
s instanceof Function ? s = s.bind(e) : r == "handleDOMEvents" && (s =
|
|
9876
|
+
s instanceof Function ? s = s.bind(e) : r == "handleDOMEvents" && (s = ps(s, e, {})), n[r] = s;
|
|
9867
9877
|
}
|
|
9868
9878
|
return n;
|
|
9869
9879
|
}
|
|
9870
|
-
class
|
|
9880
|
+
class gs {
|
|
9871
9881
|
/**
|
|
9872
9882
|
Create a plugin.
|
|
9873
9883
|
*/
|
|
9874
9884
|
constructor(e) {
|
|
9875
|
-
this.spec = e, this.props = {}, e.props &&
|
|
9885
|
+
this.spec = e, this.props = {}, e.props && ps(e.props, this, this.props), this.key = e.key ? e.key.key : bs("plugin");
|
|
9876
9886
|
}
|
|
9877
9887
|
/**
|
|
9878
9888
|
Extract the plugin's state field from an editor state.
|
|
@@ -9882,7 +9892,7 @@ class ps {
|
|
|
9882
9892
|
}
|
|
9883
9893
|
}
|
|
9884
9894
|
const Ft = /* @__PURE__ */ Object.create(null);
|
|
9885
|
-
function
|
|
9895
|
+
function bs(t) {
|
|
9886
9896
|
return t in Ft ? t + "$" + ++Ft[t] : (Ft[t] = 0, t + "$");
|
|
9887
9897
|
}
|
|
9888
9898
|
class st {
|
|
@@ -9890,7 +9900,7 @@ class st {
|
|
|
9890
9900
|
Create a plugin key.
|
|
9891
9901
|
*/
|
|
9892
9902
|
constructor(e = "key") {
|
|
9893
|
-
this.key =
|
|
9903
|
+
this.key = bs(e);
|
|
9894
9904
|
}
|
|
9895
9905
|
/**
|
|
9896
9906
|
Get the active plugin with this key, if any, from an editor
|
|
@@ -10154,13 +10164,13 @@ function Ma(t) {
|
|
|
10154
10164
|
for (let b = 0; ; b++) {
|
|
10155
10165
|
for (; s < r.length && r[s] != 0; ) s++;
|
|
10156
10166
|
if (b == f.childCount) break;
|
|
10157
|
-
const w = f.child(b), { colspan: g, rowspan:
|
|
10158
|
-
for (let x = 0; x <
|
|
10167
|
+
const w = f.child(b), { colspan: g, rowspan: _, colwidth: N } = w.attrs;
|
|
10168
|
+
for (let x = 0; x < _; x++) {
|
|
10159
10169
|
if (x + d >= n) {
|
|
10160
10170
|
(o || (o = [])).push({
|
|
10161
10171
|
type: "overlong_rowspan",
|
|
10162
10172
|
pos: u,
|
|
10163
|
-
n:
|
|
10173
|
+
n: _ - x
|
|
10164
10174
|
});
|
|
10165
10175
|
break;
|
|
10166
10176
|
}
|
|
@@ -10172,10 +10182,10 @@ function Ma(t) {
|
|
|
10172
10182
|
pos: u,
|
|
10173
10183
|
n: g - y
|
|
10174
10184
|
});
|
|
10175
|
-
const
|
|
10176
|
-
if (
|
|
10177
|
-
const A = (T + y) % e * 2,
|
|
10178
|
-
|
|
10185
|
+
const k = N && N[y];
|
|
10186
|
+
if (k) {
|
|
10187
|
+
const A = (T + y) % e * 2, z = a[A];
|
|
10188
|
+
z == null || z != k && a[A + 1] == 1 ? (a[A] = k, a[A + 1] = 1) : z == k && a[A + 1]++;
|
|
10179
10189
|
}
|
|
10180
10190
|
}
|
|
10181
10191
|
}
|
|
@@ -10261,7 +10271,7 @@ function Da(t) {
|
|
|
10261
10271
|
return t.node(0).resolve(t.before(e + 1));
|
|
10262
10272
|
return null;
|
|
10263
10273
|
}
|
|
10264
|
-
function
|
|
10274
|
+
function ws(t) {
|
|
10265
10275
|
const e = t.selection.$head;
|
|
10266
10276
|
for (let n = e.depth; n > 0; n--)
|
|
10267
10277
|
if (e.node(n).type.spec.tableRole == "row") return !0;
|
|
@@ -10289,21 +10299,21 @@ function Ba(t) {
|
|
|
10289
10299
|
return t.doc.resolve(n - e.nodeSize);
|
|
10290
10300
|
}
|
|
10291
10301
|
}
|
|
10292
|
-
function
|
|
10302
|
+
function Ln(t) {
|
|
10293
10303
|
return t.parent.type.spec.tableRole == "row" && !!t.nodeAfter;
|
|
10294
10304
|
}
|
|
10295
|
-
function
|
|
10305
|
+
function ys(t, e) {
|
|
10296
10306
|
return t.depth == e.depth && t.pos >= e.start(-1) && t.pos <= e.end(-1);
|
|
10297
10307
|
}
|
|
10298
|
-
function
|
|
10308
|
+
function xs(t, e, n) {
|
|
10299
10309
|
const r = t.node(-1), s = Te.get(r), o = t.start(-1), a = s.nextCell(t.pos - o, e, n);
|
|
10300
10310
|
return a == null ? null : t.node(0).resolve(o + a);
|
|
10301
10311
|
}
|
|
10302
|
-
function
|
|
10312
|
+
function jn(t, e, n = 1) {
|
|
10303
10313
|
const r = { ...t, colspan: t.colspan - n };
|
|
10304
10314
|
return r.colwidth && (r.colwidth = r.colwidth.slice(), r.colwidth.splice(e, n), r.colwidth.some((s) => s > 0) || (r.colwidth = null)), r;
|
|
10305
10315
|
}
|
|
10306
|
-
var ye = class Ne extends
|
|
10316
|
+
var ye = class Ne extends K {
|
|
10307
10317
|
// A table selection is identified by its anchor and head cells. The
|
|
10308
10318
|
// positions given to this constructor should point _before_ two
|
|
10309
10319
|
// cells in the same table. They may be the same, to select a single
|
|
@@ -10319,7 +10329,7 @@ var ye = class Ne extends $ {
|
|
|
10319
10329
|
if (!f)
|
|
10320
10330
|
throw RangeError(`No cell with offset ${u} found`);
|
|
10321
10331
|
const p = o + u + 1;
|
|
10322
|
-
return new
|
|
10332
|
+
return new ms(
|
|
10323
10333
|
l.resolve(p),
|
|
10324
10334
|
l.resolve(p + f.content.size)
|
|
10325
10335
|
);
|
|
@@ -10328,7 +10338,7 @@ var ye = class Ne extends $ {
|
|
|
10328
10338
|
}
|
|
10329
10339
|
map(e, n) {
|
|
10330
10340
|
const r = e.resolve(n.map(this.$anchorCell.pos)), s = e.resolve(n.map(this.$headCell.pos));
|
|
10331
|
-
if (
|
|
10341
|
+
if (Ln(r) && Ln(s) && ys(r, s)) {
|
|
10332
10342
|
const o = this.$anchorCell.node(-1) != r.node(-1);
|
|
10333
10343
|
return o && this.isRowSelection() ? Ne.rowSelection(r, s) : o && this.isColSelection() ? Ne.colSelection(r, s) : new Ne(r, s);
|
|
10334
10344
|
}
|
|
@@ -10353,32 +10363,32 @@ var ye = class Ne extends $ {
|
|
|
10353
10363
|
throw RangeError(`No cell with offset ${p} found`);
|
|
10354
10364
|
const w = s.left - h.left, g = h.right - s.right;
|
|
10355
10365
|
if (w > 0 || g > 0) {
|
|
10356
|
-
let
|
|
10357
|
-
if (w > 0 && (
|
|
10358
|
-
|
|
10359
|
-
|
|
10366
|
+
let _ = b.attrs;
|
|
10367
|
+
if (w > 0 && (_ = jn(_, 0, w)), g > 0 && (_ = jn(
|
|
10368
|
+
_,
|
|
10369
|
+
_.colspan - g,
|
|
10360
10370
|
g
|
|
10361
10371
|
)), h.left < s.left) {
|
|
10362
|
-
if (b = b.type.createAndFill(
|
|
10372
|
+
if (b = b.type.createAndFill(_), !b)
|
|
10363
10373
|
throw RangeError(
|
|
10364
|
-
`Could not create cell with attrs ${JSON.stringify(
|
|
10374
|
+
`Could not create cell with attrs ${JSON.stringify(_)}`
|
|
10365
10375
|
);
|
|
10366
10376
|
} else
|
|
10367
|
-
b = b.type.create(
|
|
10377
|
+
b = b.type.create(_, b.content);
|
|
10368
10378
|
}
|
|
10369
10379
|
if (h.top < s.top || h.bottom > s.bottom) {
|
|
10370
|
-
const
|
|
10380
|
+
const _ = {
|
|
10371
10381
|
...b.attrs,
|
|
10372
10382
|
rowspan: Math.min(h.bottom, s.bottom) - Math.max(h.top, s.top)
|
|
10373
10383
|
};
|
|
10374
|
-
h.top < s.top ? b = b.type.createAndFill(
|
|
10384
|
+
h.top < s.top ? b = b.type.createAndFill(_) : b = b.type.create(_, b.content);
|
|
10375
10385
|
}
|
|
10376
10386
|
d.push(b);
|
|
10377
10387
|
}
|
|
10378
|
-
a.push(e.child(c).copy(
|
|
10388
|
+
a.push(e.child(c).copy($.from(d)));
|
|
10379
10389
|
}
|
|
10380
10390
|
const l = this.isColSelection() && this.isRowSelection() ? e : a;
|
|
10381
|
-
return new U(
|
|
10391
|
+
return new U($.from(l), 1, 1);
|
|
10382
10392
|
}
|
|
10383
10393
|
replace(e, n = U.empty) {
|
|
10384
10394
|
const r = e.steps.length, s = this.ranges;
|
|
@@ -10390,14 +10400,14 @@ var ye = class Ne extends $ {
|
|
|
10390
10400
|
a ? U.empty : n
|
|
10391
10401
|
);
|
|
10392
10402
|
}
|
|
10393
|
-
const o =
|
|
10403
|
+
const o = K.findFrom(
|
|
10394
10404
|
e.doc.resolve(e.mapping.slice(r).map(this.to)),
|
|
10395
10405
|
-1
|
|
10396
10406
|
);
|
|
10397
10407
|
o && e.setSelection(o);
|
|
10398
10408
|
}
|
|
10399
10409
|
replaceWith(e, n) {
|
|
10400
|
-
this.replace(e, new U(
|
|
10410
|
+
this.replace(e, new U($.from(n), 0, 0));
|
|
10401
10411
|
}
|
|
10402
10412
|
forEachCell(e) {
|
|
10403
10413
|
const n = this.$anchorCell.node(-1), r = Te.get(n), s = this.$anchorCell.start(-1), o = r.cellsInRect(
|
|
@@ -10468,21 +10478,21 @@ var ye = class Ne extends $ {
|
|
|
10468
10478
|
}
|
|
10469
10479
|
};
|
|
10470
10480
|
ye.prototype.visible = !1;
|
|
10471
|
-
|
|
10472
|
-
var za = class
|
|
10481
|
+
K.jsonID("cell", ye);
|
|
10482
|
+
var za = class vs {
|
|
10473
10483
|
constructor(e, n) {
|
|
10474
10484
|
this.anchor = e, this.head = n;
|
|
10475
10485
|
}
|
|
10476
10486
|
map(e) {
|
|
10477
|
-
return new
|
|
10487
|
+
return new vs(e.map(this.anchor), e.map(this.head));
|
|
10478
10488
|
}
|
|
10479
10489
|
resolve(e) {
|
|
10480
10490
|
const n = e.resolve(this.anchor), r = e.resolve(this.head);
|
|
10481
|
-
return n.parent.type.spec.tableRole == "row" && r.parent.type.spec.tableRole == "row" && n.index() < n.parent.childCount && r.index() < r.parent.childCount &&
|
|
10491
|
+
return n.parent.type.spec.tableRole == "row" && r.parent.type.spec.tableRole == "row" && n.index() < n.parent.childCount && r.index() < r.parent.childCount && ys(n, r) ? new ye(n, r) : K.near(r, 1);
|
|
10482
10492
|
}
|
|
10483
10493
|
};
|
|
10484
10494
|
new st("fix-tables");
|
|
10485
|
-
function
|
|
10495
|
+
function Es(t) {
|
|
10486
10496
|
const e = t.selection, n = Pa(t), r = n.node(-1), s = n.start(-1), o = Te.get(r);
|
|
10487
10497
|
return { ...e instanceof ye ? o.rectBetween(
|
|
10488
10498
|
e.$anchorCell.pos - s,
|
|
@@ -10491,9 +10501,9 @@ function vs(t) {
|
|
|
10491
10501
|
}
|
|
10492
10502
|
function Ua(t) {
|
|
10493
10503
|
return function(e, n) {
|
|
10494
|
-
if (!
|
|
10504
|
+
if (!ws(e)) return !1;
|
|
10495
10505
|
if (n) {
|
|
10496
|
-
const r = on(e.schema), s =
|
|
10506
|
+
const r = on(e.schema), s = Es(e), o = e.tr, a = s.map.cellsInRect(
|
|
10497
10507
|
t == "column" ? {
|
|
10498
10508
|
left: s.left,
|
|
10499
10509
|
top: 0,
|
|
@@ -10524,7 +10534,7 @@ function Ua(t) {
|
|
|
10524
10534
|
return !0;
|
|
10525
10535
|
};
|
|
10526
10536
|
}
|
|
10527
|
-
function
|
|
10537
|
+
function Dn(t, e, n) {
|
|
10528
10538
|
const r = e.map.cellsInRect({
|
|
10529
10539
|
left: 0,
|
|
10530
10540
|
top: 0,
|
|
@@ -10540,9 +10550,9 @@ function jn(t, e, n) {
|
|
|
10540
10550
|
}
|
|
10541
10551
|
function an(t, e) {
|
|
10542
10552
|
return e = e || { useDeprecatedLogic: !1 }, e.useDeprecatedLogic ? Ua(t) : function(n, r) {
|
|
10543
|
-
if (!
|
|
10553
|
+
if (!ws(n)) return !1;
|
|
10544
10554
|
if (r) {
|
|
10545
|
-
const s = on(n.schema), o =
|
|
10555
|
+
const s = on(n.schema), o = Es(n), a = n.tr, l = Dn("row", o, s), c = Dn(
|
|
10546
10556
|
"column",
|
|
10547
10557
|
o,
|
|
10548
10558
|
s
|
|
@@ -10614,21 +10624,21 @@ function ht(t, e) {
|
|
|
10614
10624
|
return bt(
|
|
10615
10625
|
n,
|
|
10616
10626
|
r,
|
|
10617
|
-
|
|
10627
|
+
K.near(o.$headCell, e)
|
|
10618
10628
|
);
|
|
10619
10629
|
if (t != "horiz" && !o.empty) return !1;
|
|
10620
|
-
const a =
|
|
10630
|
+
const a = Ns(s, t, e);
|
|
10621
10631
|
if (a == null) return !1;
|
|
10622
10632
|
if (t == "horiz")
|
|
10623
10633
|
return bt(
|
|
10624
10634
|
n,
|
|
10625
10635
|
r,
|
|
10626
|
-
|
|
10636
|
+
K.near(n.doc.resolve(o.head + e), e)
|
|
10627
10637
|
);
|
|
10628
10638
|
{
|
|
10629
|
-
const l = n.doc.resolve(a), c =
|
|
10639
|
+
const l = n.doc.resolve(a), c = xs(l, t, e);
|
|
10630
10640
|
let d;
|
|
10631
|
-
return c ? d =
|
|
10641
|
+
return c ? d = K.near(c, 1) : e < 0 ? d = K.near(n.doc.resolve(l.before(-1)), -1) : d = K.near(n.doc.resolve(l.after(-1)), 1), bt(n, r, d);
|
|
10632
10642
|
}
|
|
10633
10643
|
};
|
|
10634
10644
|
}
|
|
@@ -10640,11 +10650,11 @@ function mt(t, e) {
|
|
|
10640
10650
|
if (o instanceof ye)
|
|
10641
10651
|
a = o;
|
|
10642
10652
|
else {
|
|
10643
|
-
const c =
|
|
10653
|
+
const c = Ns(s, t, e);
|
|
10644
10654
|
if (c == null) return !1;
|
|
10645
10655
|
a = new ye(n.doc.resolve(c));
|
|
10646
10656
|
}
|
|
10647
|
-
const l =
|
|
10657
|
+
const l = xs(a.$headCell, t, e);
|
|
10648
10658
|
return l ? bt(
|
|
10649
10659
|
n,
|
|
10650
10660
|
r,
|
|
@@ -10652,7 +10662,7 @@ function mt(t, e) {
|
|
|
10652
10662
|
) : !1;
|
|
10653
10663
|
};
|
|
10654
10664
|
}
|
|
10655
|
-
function
|
|
10665
|
+
function Ns(t, e, n) {
|
|
10656
10666
|
if (!(t.state.selection instanceof ie)) return null;
|
|
10657
10667
|
const { $head: r } = t.state.selection;
|
|
10658
10668
|
for (let s = r.depth - 1; s >= 0; s--) {
|
|
@@ -10699,7 +10709,7 @@ var Ha = class {
|
|
|
10699
10709
|
onUpdate: void 0,
|
|
10700
10710
|
onDestroy: void 0
|
|
10701
10711
|
}, this.shouldShow = ({ view: c, state: d, from: u, to: f }) => {
|
|
10702
|
-
const { doc: p, selection: h } = d, { empty: b } = h, w = !p.textBetween(u, f).length &&
|
|
10712
|
+
const { doc: p, selection: h } = d, { empty: b } = h, w = !p.textBetween(u, f).length && ho(d.selection), g = this.element.contains(document.activeElement);
|
|
10703
10713
|
return !(!(c.hasFocus() || g) || b || w || !this.editor.isEditable);
|
|
10704
10714
|
}, this.mousedownHandler = () => {
|
|
10705
10715
|
this.preventHide = !0;
|
|
@@ -10739,20 +10749,20 @@ var Ha = class {
|
|
|
10739
10749
|
}
|
|
10740
10750
|
get middlewares() {
|
|
10741
10751
|
const t = [];
|
|
10742
|
-
return this.floatingUIOptions.flip && t.push(
|
|
10743
|
-
|
|
10752
|
+
return this.floatingUIOptions.flip && t.push(Qr(typeof this.floatingUIOptions.flip != "boolean" ? this.floatingUIOptions.flip : void 0)), this.floatingUIOptions.shift && t.push(
|
|
10753
|
+
Xr(typeof this.floatingUIOptions.shift != "boolean" ? this.floatingUIOptions.shift : void 0)
|
|
10744
10754
|
), this.floatingUIOptions.offset && t.push(
|
|
10745
|
-
|
|
10746
|
-
), this.floatingUIOptions.arrow && t.push(
|
|
10747
|
-
|
|
10755
|
+
Yr(typeof this.floatingUIOptions.offset != "boolean" ? this.floatingUIOptions.offset : void 0)
|
|
10756
|
+
), this.floatingUIOptions.arrow && t.push(ns(this.floatingUIOptions.arrow)), this.floatingUIOptions.size && t.push(es(typeof this.floatingUIOptions.size != "boolean" ? this.floatingUIOptions.size : void 0)), this.floatingUIOptions.autoPlacement && t.push(
|
|
10757
|
+
Zr(
|
|
10748
10758
|
typeof this.floatingUIOptions.autoPlacement != "boolean" ? this.floatingUIOptions.autoPlacement : void 0
|
|
10749
10759
|
)
|
|
10750
|
-
), this.floatingUIOptions.hide && t.push(
|
|
10751
|
-
|
|
10760
|
+
), this.floatingUIOptions.hide && t.push(ts(typeof this.floatingUIOptions.hide != "boolean" ? this.floatingUIOptions.hide : void 0)), this.floatingUIOptions.inline && t.push(
|
|
10761
|
+
rs(typeof this.floatingUIOptions.inline != "boolean" ? this.floatingUIOptions.inline : void 0)
|
|
10752
10762
|
), t;
|
|
10753
10763
|
}
|
|
10754
10764
|
updatePosition() {
|
|
10755
|
-
const { selection: t } = this.editor.state, e =
|
|
10765
|
+
const { selection: t } = this.editor.state, e = er(this.view, t.from, t.to);
|
|
10756
10766
|
let n = {
|
|
10757
10767
|
getBoundingClientRect: () => e,
|
|
10758
10768
|
getClientRects: () => [e]
|
|
@@ -10778,7 +10788,7 @@ var Ha = class {
|
|
|
10778
10788
|
getClientRects: () => [d]
|
|
10779
10789
|
};
|
|
10780
10790
|
}
|
|
10781
|
-
|
|
10791
|
+
ss(n, this.element, {
|
|
10782
10792
|
placement: this.floatingUIOptions.placement,
|
|
10783
10793
|
strategy: this.floatingUIOptions.strategy,
|
|
10784
10794
|
middleware: this.middlewares
|
|
@@ -10818,11 +10828,11 @@ var Ha = class {
|
|
|
10818
10828
|
destroy() {
|
|
10819
10829
|
this.hide(), this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.removeEventListener("dragstart", this.dragstartHandler), window.removeEventListener("resize", this.resizeHandler), this.editor.off("focus", this.focusHandler), this.editor.off("blur", this.blurHandler), this.floatingUIOptions.onDestroy && this.floatingUIOptions.onDestroy();
|
|
10820
10830
|
}
|
|
10821
|
-
},
|
|
10831
|
+
}, Cs = (t) => new gs({
|
|
10822
10832
|
key: typeof t.pluginKey == "string" ? new st(t.pluginKey) : t.pluginKey,
|
|
10823
10833
|
view: (e) => new Ha({ view: e, ...t })
|
|
10824
10834
|
});
|
|
10825
|
-
|
|
10835
|
+
tr.create({
|
|
10826
10836
|
name: "bubbleMenu",
|
|
10827
10837
|
addOptions() {
|
|
10828
10838
|
return {
|
|
@@ -10835,7 +10845,7 @@ er.create({
|
|
|
10835
10845
|
},
|
|
10836
10846
|
addProseMirrorPlugins() {
|
|
10837
10847
|
return this.options.element ? [
|
|
10838
|
-
|
|
10848
|
+
Cs({
|
|
10839
10849
|
pluginKey: this.options.pluginKey,
|
|
10840
10850
|
editor: this.editor,
|
|
10841
10851
|
element: this.options.element,
|
|
@@ -10889,20 +10899,20 @@ var $a = class {
|
|
|
10889
10899
|
}, this.element.tabIndex = 0, s && (this.shouldShow = s), this.element.addEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.editor.on("focus", this.focusHandler), this.editor.on("blur", this.blurHandler), this.update(n, n.state), this.getShouldShow() && this.show();
|
|
10890
10900
|
}
|
|
10891
10901
|
getTextContent(t) {
|
|
10892
|
-
return
|
|
10902
|
+
return mo(t, { textSerializers: po(this.editor.schema) });
|
|
10893
10903
|
}
|
|
10894
10904
|
get middlewares() {
|
|
10895
10905
|
const t = [];
|
|
10896
|
-
return this.floatingUIOptions.flip && t.push(
|
|
10897
|
-
|
|
10906
|
+
return this.floatingUIOptions.flip && t.push(Qr(typeof this.floatingUIOptions.flip != "boolean" ? this.floatingUIOptions.flip : void 0)), this.floatingUIOptions.shift && t.push(
|
|
10907
|
+
Xr(typeof this.floatingUIOptions.shift != "boolean" ? this.floatingUIOptions.shift : void 0)
|
|
10898
10908
|
), this.floatingUIOptions.offset && t.push(
|
|
10899
|
-
|
|
10900
|
-
), this.floatingUIOptions.arrow && t.push(
|
|
10901
|
-
|
|
10909
|
+
Yr(typeof this.floatingUIOptions.offset != "boolean" ? this.floatingUIOptions.offset : void 0)
|
|
10910
|
+
), this.floatingUIOptions.arrow && t.push(ns(this.floatingUIOptions.arrow)), this.floatingUIOptions.size && t.push(es(typeof this.floatingUIOptions.size != "boolean" ? this.floatingUIOptions.size : void 0)), this.floatingUIOptions.autoPlacement && t.push(
|
|
10911
|
+
Zr(
|
|
10902
10912
|
typeof this.floatingUIOptions.autoPlacement != "boolean" ? this.floatingUIOptions.autoPlacement : void 0
|
|
10903
10913
|
)
|
|
10904
|
-
), this.floatingUIOptions.hide && t.push(
|
|
10905
|
-
|
|
10914
|
+
), this.floatingUIOptions.hide && t.push(ts(typeof this.floatingUIOptions.hide != "boolean" ? this.floatingUIOptions.hide : void 0)), this.floatingUIOptions.inline && t.push(
|
|
10915
|
+
rs(typeof this.floatingUIOptions.inline != "boolean" ? this.floatingUIOptions.inline : void 0)
|
|
10906
10916
|
), t;
|
|
10907
10917
|
}
|
|
10908
10918
|
getShouldShow(t) {
|
|
@@ -10918,8 +10928,8 @@ var $a = class {
|
|
|
10918
10928
|
});
|
|
10919
10929
|
}
|
|
10920
10930
|
updatePosition() {
|
|
10921
|
-
const { selection: t } = this.editor.state, e =
|
|
10922
|
-
|
|
10931
|
+
const { selection: t } = this.editor.state, e = er(this.view, t.from, t.to);
|
|
10932
|
+
ss({
|
|
10923
10933
|
getBoundingClientRect: () => e,
|
|
10924
10934
|
getClientRects: () => [e]
|
|
10925
10935
|
}, this.element, {
|
|
@@ -10944,11 +10954,11 @@ var $a = class {
|
|
|
10944
10954
|
destroy() {
|
|
10945
10955
|
this.hide(), this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.editor.off("focus", this.focusHandler), this.editor.off("blur", this.blurHandler), this.floatingUIOptions.onDestroy && this.floatingUIOptions.onDestroy();
|
|
10946
10956
|
}
|
|
10947
|
-
},
|
|
10957
|
+
}, Ts = (t) => new gs({
|
|
10948
10958
|
key: typeof t.pluginKey == "string" ? new st(t.pluginKey) : t.pluginKey,
|
|
10949
10959
|
view: (e) => new $a({ view: e, ...t })
|
|
10950
10960
|
});
|
|
10951
|
-
|
|
10961
|
+
tr.create({
|
|
10952
10962
|
name: "floatingMenu",
|
|
10953
10963
|
addOptions() {
|
|
10954
10964
|
return {
|
|
@@ -10960,7 +10970,7 @@ er.create({
|
|
|
10960
10970
|
},
|
|
10961
10971
|
addProseMirrorPlugins() {
|
|
10962
10972
|
return this.options.element ? [
|
|
10963
|
-
|
|
10973
|
+
Ts({
|
|
10964
10974
|
pluginKey: this.options.pluginKey,
|
|
10965
10975
|
editor: this.editor,
|
|
10966
10976
|
element: this.options.element,
|
|
@@ -10970,11 +10980,11 @@ er.create({
|
|
|
10970
10980
|
] : [];
|
|
10971
10981
|
}
|
|
10972
10982
|
});
|
|
10973
|
-
var
|
|
10983
|
+
var Ss = Ze.forwardRef(
|
|
10974
10984
|
({ pluginKey: t = "bubbleMenu", editor: e, updateDelay: n, resizeDelay: r, shouldShow: s = null, options: o, children: a, ...l }, c) => {
|
|
10975
10985
|
const d = _e(document.createElement("div"));
|
|
10976
10986
|
typeof c == "function" ? c(d.current) : c && (c.current = d.current);
|
|
10977
|
-
const { editor: u } =
|
|
10987
|
+
const { editor: u } = Bn();
|
|
10978
10988
|
return Y(() => {
|
|
10979
10989
|
const f = d.current;
|
|
10980
10990
|
if (f.style.visibility = "hidden", f.style.position = "absolute", e?.isDestroyed || u?.isDestroyed)
|
|
@@ -10984,7 +10994,7 @@ var Ts = Ze.forwardRef(
|
|
|
10984
10994
|
console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");
|
|
10985
10995
|
return;
|
|
10986
10996
|
}
|
|
10987
|
-
const h =
|
|
10997
|
+
const h = Cs({
|
|
10988
10998
|
updateDelay: n,
|
|
10989
10999
|
resizeDelay: r,
|
|
10990
11000
|
editor: p,
|
|
@@ -10998,13 +11008,13 @@ var Ts = Ze.forwardRef(
|
|
|
10998
11008
|
f.parentNode && f.parentNode.removeChild(f);
|
|
10999
11009
|
});
|
|
11000
11010
|
};
|
|
11001
|
-
}, [e, u]),
|
|
11011
|
+
}, [e, u]), rr(/* @__PURE__ */ i.jsx("div", { ...l, children: a }), d.current);
|
|
11002
11012
|
}
|
|
11003
11013
|
), Ka = Ze.forwardRef(
|
|
11004
11014
|
({ pluginKey: t = "floatingMenu", editor: e, shouldShow: n = null, options: r, children: s, ...o }, a) => {
|
|
11005
11015
|
const l = _e(document.createElement("div"));
|
|
11006
11016
|
typeof a == "function" ? a(l.current) : a && (a.current = l.current);
|
|
11007
|
-
const { editor: c } =
|
|
11017
|
+
const { editor: c } = Bn();
|
|
11008
11018
|
return Y(() => {
|
|
11009
11019
|
const d = l.current;
|
|
11010
11020
|
if (d.style.visibility = "hidden", d.style.position = "absolute", e?.isDestroyed || c?.isDestroyed)
|
|
@@ -11016,7 +11026,7 @@ var Ts = Ze.forwardRef(
|
|
|
11016
11026
|
);
|
|
11017
11027
|
return;
|
|
11018
11028
|
}
|
|
11019
|
-
const f =
|
|
11029
|
+
const f = Ts({
|
|
11020
11030
|
editor: u,
|
|
11021
11031
|
element: d,
|
|
11022
11032
|
pluginKey: t,
|
|
@@ -11028,15 +11038,15 @@ var Ts = Ze.forwardRef(
|
|
|
11028
11038
|
d.parentNode && d.parentNode.removeChild(d);
|
|
11029
11039
|
});
|
|
11030
11040
|
};
|
|
11031
|
-
}, [e, c]),
|
|
11041
|
+
}, [e, c]), rr(/* @__PURE__ */ i.jsx("div", { ...o, children: s }), l.current);
|
|
11032
11042
|
}
|
|
11033
11043
|
);
|
|
11034
11044
|
const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
11035
|
-
const [n, r] =
|
|
11045
|
+
const [n, r] = B(!1), [s, o] = B(!1), [a, l] = B(""), [c, d] = B(!1), u = () => {
|
|
11036
11046
|
a && (t.chain().focus().extendMarkRange("link").setLink({ href: a }).run(), l(""), d(!1));
|
|
11037
11047
|
};
|
|
11038
11048
|
return e ? null : /* @__PURE__ */ i.jsx(
|
|
11039
|
-
|
|
11049
|
+
Ss,
|
|
11040
11050
|
{
|
|
11041
11051
|
editor: t,
|
|
11042
11052
|
shouldShow: ({ editor: f, state: p }) => {
|
|
@@ -11051,7 +11061,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11051
11061
|
onClick: () => t.chain().focus().toggleBold().run(),
|
|
11052
11062
|
isActive: t.isActive("bold"),
|
|
11053
11063
|
title: "Bold",
|
|
11054
|
-
children: /* @__PURE__ */ i.jsx(
|
|
11064
|
+
children: /* @__PURE__ */ i.jsx(Qs, { className: "h-4 w-4 cursor-pointer" })
|
|
11055
11065
|
}
|
|
11056
11066
|
),
|
|
11057
11067
|
/* @__PURE__ */ i.jsx(
|
|
@@ -11060,7 +11070,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11060
11070
|
onClick: () => t.chain().focus().toggleItalic().run(),
|
|
11061
11071
|
isActive: t.isActive("italic"),
|
|
11062
11072
|
title: "Italic",
|
|
11063
|
-
children: /* @__PURE__ */ i.jsx(
|
|
11073
|
+
children: /* @__PURE__ */ i.jsx(eo, { className: "h-4 w-4 cursor-pointer" })
|
|
11064
11074
|
}
|
|
11065
11075
|
),
|
|
11066
11076
|
/* @__PURE__ */ i.jsx(
|
|
@@ -11069,7 +11079,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11069
11079
|
onClick: () => t.chain().focus().toggleUnderline().run(),
|
|
11070
11080
|
isActive: t.isActive("underline"),
|
|
11071
11081
|
title: "Underline",
|
|
11072
|
-
children: /* @__PURE__ */ i.jsx(
|
|
11082
|
+
children: /* @__PURE__ */ i.jsx(to, { className: "h-4 w-4 cursor-pointer" })
|
|
11073
11083
|
}
|
|
11074
11084
|
),
|
|
11075
11085
|
/* @__PURE__ */ i.jsx(
|
|
@@ -11078,7 +11088,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11078
11088
|
onClick: () => t.chain().focus().toggleStrike().run(),
|
|
11079
11089
|
isActive: t.isActive("strike"),
|
|
11080
11090
|
title: "Strikethrough",
|
|
11081
|
-
children: /* @__PURE__ */ i.jsx(
|
|
11091
|
+
children: /* @__PURE__ */ i.jsx(no, { className: "h-4 w-4 cursor-pointer" })
|
|
11082
11092
|
}
|
|
11083
11093
|
),
|
|
11084
11094
|
/* @__PURE__ */ i.jsx(
|
|
@@ -11096,7 +11106,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11096
11106
|
{
|
|
11097
11107
|
onClick: () => r(!n),
|
|
11098
11108
|
title: "Text Color",
|
|
11099
|
-
children: /* @__PURE__ */ i.jsx(
|
|
11109
|
+
children: /* @__PURE__ */ i.jsx(ro, { className: "h-4 w-4 cursor-pointer" })
|
|
11100
11110
|
}
|
|
11101
11111
|
),
|
|
11102
11112
|
n && /* @__PURE__ */ i.jsx("div", { className: "absolute top-full mt-1 z-10 bg-white border border-gray-300 rounded-lg p-2 shadow-lg", children: /* @__PURE__ */ i.jsx(
|
|
@@ -11114,7 +11124,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11114
11124
|
{
|
|
11115
11125
|
onClick: () => o(!s),
|
|
11116
11126
|
title: "Background Color",
|
|
11117
|
-
children: /* @__PURE__ */ i.jsx(
|
|
11127
|
+
children: /* @__PURE__ */ i.jsx(Qn, { className: "h-4 w-4 cursor-pointer" })
|
|
11118
11128
|
}
|
|
11119
11129
|
),
|
|
11120
11130
|
s && /* @__PURE__ */ i.jsx("div", { className: "absolute top-full mt-1 z-10 bg-white border border-gray-300 rounded-lg p-2 shadow-lg", children: /* @__PURE__ */ i.jsx(
|
|
@@ -11133,7 +11143,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11133
11143
|
onClick: () => d(!c),
|
|
11134
11144
|
isActive: t.isActive("link"),
|
|
11135
11145
|
title: "Add/Edit Link",
|
|
11136
|
-
children: /* @__PURE__ */ i.jsx(
|
|
11146
|
+
children: /* @__PURE__ */ i.jsx(so, { className: "h-4 w-4 cursor-pointer" })
|
|
11137
11147
|
}
|
|
11138
11148
|
),
|
|
11139
11149
|
c && /* @__PURE__ */ i.jsx("div", { className: "absolute top-full mt-1 z-10 bg-white border border-gray-300 rounded-lg p-2 shadow-lg", children: /* @__PURE__ */ i.jsxs("div", { className: "flex gap-2", children: [
|
|
@@ -11189,7 +11199,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11189
11199
|
]
|
|
11190
11200
|
},
|
|
11191
11201
|
n
|
|
11192
|
-
)) }),
|
|
11202
|
+
)) }), Pn = [
|
|
11193
11203
|
{ value: "", label: "Plain Text" },
|
|
11194
11204
|
{ value: "html", label: "HTML" },
|
|
11195
11205
|
{ value: "css", label: "CSS" },
|
|
@@ -11204,7 +11214,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11204
11214
|
editor: t,
|
|
11205
11215
|
isReadOnly: e
|
|
11206
11216
|
}) => {
|
|
11207
|
-
const [n, r] =
|
|
11217
|
+
const [n, r] = B(!1), [s, o] = B(!1), a = _e(null), l = t.getAttributes("codeBlock").language || "";
|
|
11208
11218
|
if (Y(() => {
|
|
11209
11219
|
const d = (u) => {
|
|
11210
11220
|
a.current && !a.current.contains(u.target) && o(!1);
|
|
@@ -11217,7 +11227,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11217
11227
|
t.chain().focus().updateAttributes("codeBlock", { language: d || null }).run(), o(!1);
|
|
11218
11228
|
};
|
|
11219
11229
|
return /* @__PURE__ */ i.jsx(
|
|
11220
|
-
|
|
11230
|
+
Ss,
|
|
11221
11231
|
{
|
|
11222
11232
|
editor: t,
|
|
11223
11233
|
shouldShow: ({ editor: d }) => d.isActive("codeBlock"),
|
|
@@ -11235,13 +11245,13 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11235
11245
|
children: /* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-1 w-full justify-between", children: [
|
|
11236
11246
|
/* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
11237
11247
|
/* @__PURE__ */ i.jsx(Zt, { className: "h-3 w-3" }),
|
|
11238
|
-
/* @__PURE__ */ i.jsx("span", { className: "text-xs", children:
|
|
11248
|
+
/* @__PURE__ */ i.jsx("span", { className: "text-xs", children: Pn.find((d) => d.value === l)?.label || "Plain Text" })
|
|
11239
11249
|
] }),
|
|
11240
|
-
/* @__PURE__ */ i.jsx(
|
|
11250
|
+
/* @__PURE__ */ i.jsx(Xn, { className: "h-3 w-3" })
|
|
11241
11251
|
] })
|
|
11242
11252
|
}
|
|
11243
11253
|
),
|
|
11244
|
-
s && /* @__PURE__ */ i.jsx("div", { className: "absolute top-full mt-1 left-0 z-10 bg-white border border-gray-300 rounded-lg shadow-lg min-w-[140px] max-h-[300px] overflow-y-auto", children: /* @__PURE__ */ i.jsx("div", { className: "p-1 space-y-1", children:
|
|
11254
|
+
s && /* @__PURE__ */ i.jsx("div", { className: "absolute top-full mt-1 left-0 z-10 bg-white border border-gray-300 rounded-lg shadow-lg min-w-[140px] max-h-[300px] overflow-y-auto", children: /* @__PURE__ */ i.jsx("div", { className: "p-1 space-y-1", children: Pn.map((d) => /* @__PURE__ */ i.jsx(
|
|
11245
11255
|
F,
|
|
11246
11256
|
{
|
|
11247
11257
|
type: "button",
|
|
@@ -11263,7 +11273,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11263
11273
|
},
|
|
11264
11274
|
title: "Background Color",
|
|
11265
11275
|
isActive: t.isActive("codeBlockBg"),
|
|
11266
|
-
children: /* @__PURE__ */ i.jsx(
|
|
11276
|
+
children: /* @__PURE__ */ i.jsx(Qn, { className: "h-4 w-4 cursor-pointer" })
|
|
11267
11277
|
}
|
|
11268
11278
|
),
|
|
11269
11279
|
n && /* @__PURE__ */ i.jsx("div", { className: "absolute top-full mt-1 z-10 bg-white border border-gray-300 rounded-lg p-2 shadow-lg", children: /* @__PURE__ */ i.jsx(
|
|
@@ -11293,7 +11303,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11293
11303
|
{
|
|
11294
11304
|
onClick: () => t.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
11295
11305
|
title: "Heading 1",
|
|
11296
|
-
children: /* @__PURE__ */ i.jsx(
|
|
11306
|
+
children: /* @__PURE__ */ i.jsx(qn, { className: "h-4 w-4" })
|
|
11297
11307
|
}
|
|
11298
11308
|
),
|
|
11299
11309
|
/* @__PURE__ */ i.jsx(
|
|
@@ -11301,7 +11311,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11301
11311
|
{
|
|
11302
11312
|
onClick: () => t.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
11303
11313
|
title: "Heading 2",
|
|
11304
|
-
children: /* @__PURE__ */ i.jsx(
|
|
11314
|
+
children: /* @__PURE__ */ i.jsx(Vn, { className: "h-4 w-4" })
|
|
11305
11315
|
}
|
|
11306
11316
|
),
|
|
11307
11317
|
/* @__PURE__ */ i.jsx(
|
|
@@ -11309,7 +11319,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11309
11319
|
{
|
|
11310
11320
|
onClick: () => t.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
11311
11321
|
title: "Heading 3",
|
|
11312
|
-
children: /* @__PURE__ */ i.jsx(
|
|
11322
|
+
children: /* @__PURE__ */ i.jsx(Gn, { className: "h-4 w-4" })
|
|
11313
11323
|
}
|
|
11314
11324
|
),
|
|
11315
11325
|
/* @__PURE__ */ i.jsx(
|
|
@@ -11317,10 +11327,10 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11317
11327
|
{
|
|
11318
11328
|
onClick: () => t.chain().focus().setParagraph().run(),
|
|
11319
11329
|
title: "Paragraph",
|
|
11320
|
-
children: /* @__PURE__ */ i.jsx(
|
|
11330
|
+
children: /* @__PURE__ */ i.jsx(Yn, { className: "h-4 w-4" })
|
|
11321
11331
|
}
|
|
11322
11332
|
),
|
|
11323
|
-
/* @__PURE__ */ i.jsx(I, { onClick: n, title: "Insert Image", children: /* @__PURE__ */ i.jsx(
|
|
11333
|
+
/* @__PURE__ */ i.jsx(I, { onClick: n, title: "Insert Image", children: /* @__PURE__ */ i.jsx(Zn, { className: "h-4 w-4" }) })
|
|
11324
11334
|
]
|
|
11325
11335
|
}
|
|
11326
11336
|
), Ya = ({
|
|
@@ -11468,7 +11478,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11468
11478
|
className: "flex items-center gap-2",
|
|
11469
11479
|
title: "Log content to console for backend storage",
|
|
11470
11480
|
children: [
|
|
11471
|
-
/* @__PURE__ */ i.jsx(
|
|
11481
|
+
/* @__PURE__ */ i.jsx(oo, { className: "h-4 w-4" }),
|
|
11472
11482
|
"Log Content"
|
|
11473
11483
|
]
|
|
11474
11484
|
}
|
|
@@ -11482,10 +11492,10 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11482
11492
|
size: "sm",
|
|
11483
11493
|
className: "flex items-center gap-2",
|
|
11484
11494
|
children: t ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
11485
|
-
/* @__PURE__ */ i.jsx(
|
|
11495
|
+
/* @__PURE__ */ i.jsx(io, { className: "h-4 w-4" }),
|
|
11486
11496
|
"Read Only"
|
|
11487
11497
|
] }) : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
11488
|
-
/* @__PURE__ */ i.jsx(
|
|
11498
|
+
/* @__PURE__ */ i.jsx(ao, { className: "h-4 w-4" }),
|
|
11489
11499
|
"Editable"
|
|
11490
11500
|
] })
|
|
11491
11501
|
}
|
|
@@ -11514,33 +11524,32 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11514
11524
|
content: s,
|
|
11515
11525
|
setEditorContent: o
|
|
11516
11526
|
}) => {
|
|
11517
|
-
const [a, l] =
|
|
11527
|
+
const [a, l] = B(""), [c, d] = B(!1), [u, f] = B(""), [p, h] = B(!1), [, b] = B({}), [w, g] = B(!1), [_, N] = B(!1), [x, T] = B(!1), [y, k] = B(null), A = _e(null), [z, L] = B({ top: 0, left: 0, show: !1 }), C = (S) => {
|
|
11518
11528
|
const O = /* @__PURE__ */ new Set(), m = (E) => {
|
|
11519
11529
|
E.type === "image" && E.attrs?.src && O.add(E.attrs.src), E.content && Array.isArray(E.content) && E.content.forEach(m);
|
|
11520
11530
|
};
|
|
11521
|
-
return m(
|
|
11522
|
-
}, M = (
|
|
11531
|
+
return m(S), O;
|
|
11532
|
+
}, M = (S) => {
|
|
11523
11533
|
const O = /* @__PURE__ */ new Set(), m = (E) => {
|
|
11524
11534
|
E.type === "video" && E.attrs?.src && O.add(E.attrs.src), E.content && Array.isArray(E.content) && E.content.forEach(m);
|
|
11525
11535
|
};
|
|
11526
|
-
return m(
|
|
11527
|
-
}, v =
|
|
11536
|
+
return m(S), O;
|
|
11537
|
+
}, v = zn({
|
|
11528
11538
|
extensions: [
|
|
11529
|
-
rr,
|
|
11530
|
-
Bo,
|
|
11531
|
-
Fn,
|
|
11532
|
-
$n,
|
|
11533
|
-
Hn,
|
|
11534
11539
|
sr,
|
|
11540
|
+
zo,
|
|
11541
|
+
Hn,
|
|
11542
|
+
Kn,
|
|
11543
|
+
$n,
|
|
11535
11544
|
or,
|
|
11536
|
-
Er,
|
|
11537
|
-
Nr,
|
|
11538
11545
|
ir,
|
|
11546
|
+
Nr,
|
|
11547
|
+
Cr,
|
|
11539
11548
|
ar,
|
|
11540
11549
|
lr,
|
|
11550
|
+
cr,
|
|
11551
|
+
Er,
|
|
11541
11552
|
vr,
|
|
11542
|
-
xr,
|
|
11543
|
-
Cr,
|
|
11544
11553
|
Tr,
|
|
11545
11554
|
Sr,
|
|
11546
11555
|
_r,
|
|
@@ -11548,9 +11557,10 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11548
11557
|
Ar,
|
|
11549
11558
|
Or,
|
|
11550
11559
|
Rr,
|
|
11551
|
-
|
|
11560
|
+
Mr,
|
|
11552
11561
|
Lr,
|
|
11553
|
-
|
|
11562
|
+
jr,
|
|
11563
|
+
Ir.configure({
|
|
11554
11564
|
inline: !1,
|
|
11555
11565
|
allowBase64: !0,
|
|
11556
11566
|
HTMLAttributes: {
|
|
@@ -11567,7 +11577,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11567
11577
|
class: "prose prose-sm sm:prose lg:prose-lg xl:prose-2xl mx-auto focus:outline-none min-h-[400px] p-4"
|
|
11568
11578
|
},
|
|
11569
11579
|
// @ts-ignore
|
|
11570
|
-
handlePaste: (
|
|
11580
|
+
handlePaste: (S, O, m) => {
|
|
11571
11581
|
const R = Array.from(O.clipboardData?.items || []).filter(
|
|
11572
11582
|
(q) => q.type.indexOf("image") !== -1
|
|
11573
11583
|
);
|
|
@@ -11581,9 +11591,9 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11581
11591
|
N(!1);
|
|
11582
11592
|
}), !0;
|
|
11583
11593
|
}
|
|
11584
|
-
const
|
|
11585
|
-
if (
|
|
11586
|
-
const te = new DOMParser().parseFromString(
|
|
11594
|
+
const P = O.clipboardData?.getData("text/html");
|
|
11595
|
+
if (P && t && A.current) {
|
|
11596
|
+
const te = new DOMParser().parseFromString(P, "text/html").querySelectorAll("img");
|
|
11587
11597
|
if (te.length > 0) {
|
|
11588
11598
|
const oe = Array.from(te).filter((G) => {
|
|
11589
11599
|
const ne = G.getAttribute("src");
|
|
@@ -11594,11 +11604,11 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11594
11604
|
const G = oe.map((ne) => {
|
|
11595
11605
|
const me = ne.getAttribute("src");
|
|
11596
11606
|
if (!me) return Promise.resolve(null);
|
|
11597
|
-
const ot = (pe,
|
|
11598
|
-
const
|
|
11607
|
+
const ot = (pe, _s) => {
|
|
11608
|
+
const ks = new File([pe], _s, {
|
|
11599
11609
|
type: pe.type || "image/png"
|
|
11600
11610
|
});
|
|
11601
|
-
return t(
|
|
11611
|
+
return t(ks).then((We) => (We && A.current && A.current.chain().focus().setImage({ src: We }).run(), We)).catch((We) => (console.error("Failed to upload pasted image:", We), alert("Failed to upload pasted image. Please try again."), null));
|
|
11602
11612
|
};
|
|
11603
11613
|
return me.startsWith("data:") ? fetch(me).then((pe) => pe.blob()).then((pe) => ot(pe, "pasted-image.png")) : me.startsWith("http://") || me.startsWith("https://") ? fetch(me).then((pe) => pe.blob()).then((pe) => ot(pe, "pasted-image.png")) : Promise.resolve(null);
|
|
11604
11614
|
});
|
|
@@ -11612,12 +11622,12 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11612
11622
|
}
|
|
11613
11623
|
},
|
|
11614
11624
|
onUpdate: () => {
|
|
11615
|
-
const
|
|
11625
|
+
const S = v.getJSON();
|
|
11616
11626
|
if (y) {
|
|
11617
|
-
const O = C(y), m = C(
|
|
11627
|
+
const O = C(y), m = C(S), E = [...O].filter(
|
|
11618
11628
|
(V) => !m.has(V)
|
|
11619
|
-
), R = M(y),
|
|
11620
|
-
(V) => !
|
|
11629
|
+
), R = M(y), P = M(S), q = [...R].filter(
|
|
11630
|
+
(V) => !P.has(V)
|
|
11621
11631
|
);
|
|
11622
11632
|
E.forEach((V) => {
|
|
11623
11633
|
n && n(V).catch((te) => {
|
|
@@ -11629,72 +11639,72 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11629
11639
|
});
|
|
11630
11640
|
});
|
|
11631
11641
|
}
|
|
11632
|
-
|
|
11642
|
+
k(S), o?.({ html: v.getHTML(), json: S }), b({});
|
|
11633
11643
|
},
|
|
11634
11644
|
onSelectionUpdate: () => {
|
|
11635
11645
|
o?.({ html: v.getHTML(), json: v.getJSON() }), b({});
|
|
11636
11646
|
}
|
|
11637
11647
|
});
|
|
11638
11648
|
Y(() => {
|
|
11639
|
-
v && (A.current = v,
|
|
11649
|
+
v && (A.current = v, k(v.getJSON()));
|
|
11640
11650
|
}, [v]), Y(() => {
|
|
11641
11651
|
if (v && s !== void 0) {
|
|
11642
|
-
const
|
|
11643
|
-
|
|
11652
|
+
const S = v.getJSON();
|
|
11653
|
+
k(S);
|
|
11644
11654
|
}
|
|
11645
11655
|
}, [s, v]), Y(() => {
|
|
11646
11656
|
v && v.setEditable(!w);
|
|
11647
11657
|
}, [v, w]), Y(() => {
|
|
11648
11658
|
if (!v) return;
|
|
11649
|
-
const
|
|
11659
|
+
const S = () => {
|
|
11650
11660
|
if (v.isActive("table") && !w) {
|
|
11651
11661
|
const { from: m } = v.state.selection;
|
|
11652
11662
|
let E = null;
|
|
11653
11663
|
const R = v.view.domAtPos(m);
|
|
11654
11664
|
if (R.node && R.node.parentElement) {
|
|
11655
|
-
let
|
|
11656
|
-
for (;
|
|
11657
|
-
if (
|
|
11658
|
-
E =
|
|
11665
|
+
let P = R.node.parentElement;
|
|
11666
|
+
for (; P && P !== v.view.dom; ) {
|
|
11667
|
+
if (P.tagName === "TABLE") {
|
|
11668
|
+
E = P;
|
|
11659
11669
|
break;
|
|
11660
11670
|
}
|
|
11661
|
-
|
|
11671
|
+
P = P.parentElement;
|
|
11662
11672
|
}
|
|
11663
11673
|
}
|
|
11664
11674
|
if (E) {
|
|
11665
|
-
const
|
|
11675
|
+
const P = E.getBoundingClientRect(), q = v.view.dom.getBoundingClientRect();
|
|
11666
11676
|
L({
|
|
11667
|
-
top:
|
|
11668
|
-
left:
|
|
11677
|
+
top: P.bottom - q.top + 10,
|
|
11678
|
+
left: P.left - q.left,
|
|
11669
11679
|
show: !0
|
|
11670
11680
|
});
|
|
11671
11681
|
}
|
|
11672
11682
|
} else
|
|
11673
11683
|
L((m) => ({ ...m, show: !1 }));
|
|
11674
11684
|
}, O = () => {
|
|
11675
|
-
|
|
11685
|
+
S();
|
|
11676
11686
|
};
|
|
11677
11687
|
return v.on("selectionUpdate", O), v.on("update", O), () => {
|
|
11678
11688
|
v.off("selectionUpdate", O), v.off("update", O);
|
|
11679
11689
|
};
|
|
11680
11690
|
}, [v]), Y(() => {
|
|
11681
|
-
const
|
|
11691
|
+
const S = (O) => {
|
|
11682
11692
|
O.target.closest(".image-input-container") || d(!1);
|
|
11683
11693
|
};
|
|
11684
|
-
return c && document.addEventListener("mousedown",
|
|
11685
|
-
document.removeEventListener("mousedown",
|
|
11694
|
+
return c && document.addEventListener("mousedown", S), () => {
|
|
11695
|
+
document.removeEventListener("mousedown", S);
|
|
11686
11696
|
};
|
|
11687
11697
|
}, [c]), Y(() => {
|
|
11688
|
-
const
|
|
11698
|
+
const S = (O) => {
|
|
11689
11699
|
O.target.closest(".video-input-container") || h(!1);
|
|
11690
11700
|
};
|
|
11691
|
-
return p && document.addEventListener("mousedown",
|
|
11692
|
-
document.removeEventListener("mousedown",
|
|
11701
|
+
return p && document.addEventListener("mousedown", S), () => {
|
|
11702
|
+
document.removeEventListener("mousedown", S);
|
|
11693
11703
|
};
|
|
11694
11704
|
}, [p]);
|
|
11695
|
-
const
|
|
11696
|
-
const
|
|
11697
|
-
|
|
11705
|
+
const j = Pe(async () => {
|
|
11706
|
+
const S = document.createElement("input");
|
|
11707
|
+
S.type = "file", S.accept = "image/*", S.onchange = async (O) => {
|
|
11698
11708
|
const m = O.target.files?.[0];
|
|
11699
11709
|
if (m && t)
|
|
11700
11710
|
try {
|
|
@@ -11706,19 +11716,19 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11706
11716
|
} finally {
|
|
11707
11717
|
N(!1);
|
|
11708
11718
|
}
|
|
11709
|
-
},
|
|
11710
|
-
}, [v, t]),
|
|
11719
|
+
}, S.click();
|
|
11720
|
+
}, [v, t]), D = Pe(() => {
|
|
11711
11721
|
a.trim() && (v?.chain().focus().setImage({ src: a.trim() }).run(), l(""), d(!1));
|
|
11712
|
-
}, [v, a]),
|
|
11713
|
-
const
|
|
11714
|
-
|
|
11715
|
-
src:
|
|
11716
|
-
type: xi(
|
|
11722
|
+
}, [v, a]), J = Pe(() => {
|
|
11723
|
+
const S = u.trim();
|
|
11724
|
+
S && (v?.chain().focus().setVideo({
|
|
11725
|
+
src: S,
|
|
11726
|
+
type: xi(S) ? "youtube" : "video/mp4",
|
|
11717
11727
|
title: ""
|
|
11718
11728
|
}).run(), f(""), h(!1));
|
|
11719
|
-
}, [v, u]),
|
|
11720
|
-
const
|
|
11721
|
-
|
|
11729
|
+
}, [v, u]), H = Pe(async () => {
|
|
11730
|
+
const S = document.createElement("input");
|
|
11731
|
+
S.type = "file", S.accept = "video/*", S.onchange = async (O) => {
|
|
11722
11732
|
const m = O.target.files?.[0];
|
|
11723
11733
|
if (m && h(!1), m && e)
|
|
11724
11734
|
try {
|
|
@@ -11754,15 +11764,15 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11754
11764
|
else if (m && !e) {
|
|
11755
11765
|
const E = new FileReader();
|
|
11756
11766
|
E.onload = (R) => {
|
|
11757
|
-
const
|
|
11767
|
+
const P = R.target?.result;
|
|
11758
11768
|
console.log("Attempting to insert base64 video:", {
|
|
11759
|
-
src:
|
|
11769
|
+
src: P.substring(0, 100) + "...",
|
|
11760
11770
|
type: m.type,
|
|
11761
11771
|
title: m.name
|
|
11762
11772
|
});
|
|
11763
11773
|
try {
|
|
11764
11774
|
const q = v?.chain().focus().setVideo({
|
|
11765
|
-
src:
|
|
11775
|
+
src: P,
|
|
11766
11776
|
type: m.type,
|
|
11767
11777
|
title: m.name
|
|
11768
11778
|
}).run();
|
|
@@ -11775,7 +11785,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11775
11785
|
}
|
|
11776
11786
|
}, E.readAsDataURL(m);
|
|
11777
11787
|
}
|
|
11778
|
-
},
|
|
11788
|
+
}, S.click();
|
|
11779
11789
|
}, [v, e]), W = Pe(() => {
|
|
11780
11790
|
if (v)
|
|
11781
11791
|
return Qa(v);
|
|
@@ -11796,27 +11806,27 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11796
11806
|
{
|
|
11797
11807
|
editor: v,
|
|
11798
11808
|
isReadOnly: w,
|
|
11799
|
-
onImageUpload:
|
|
11800
|
-
onVideoUpload:
|
|
11801
|
-
isImageUploading:
|
|
11809
|
+
onImageUpload: j,
|
|
11810
|
+
onVideoUpload: H,
|
|
11811
|
+
isImageUploading: _,
|
|
11802
11812
|
isVideoUploading: x,
|
|
11803
11813
|
showImageInput: c,
|
|
11804
11814
|
setShowImageInput: d,
|
|
11805
11815
|
imageUrl: a,
|
|
11806
11816
|
setImageUrl: l,
|
|
11807
|
-
handleImageUrlInsert:
|
|
11817
|
+
handleImageUrlInsert: D,
|
|
11808
11818
|
imageUploadFunction: t,
|
|
11809
11819
|
showVideoInput: p,
|
|
11810
11820
|
setShowVideoInput: h,
|
|
11811
11821
|
videoUrl: u,
|
|
11812
11822
|
setVideoUrl: f,
|
|
11813
|
-
handleVideoUrlInsert:
|
|
11823
|
+
handleVideoUrlInsert: J,
|
|
11814
11824
|
videoUploadFunction: e
|
|
11815
11825
|
}
|
|
11816
11826
|
),
|
|
11817
11827
|
/* @__PURE__ */ i.jsxs("div", { className: "relative border border-gray-300 border-t-1 rounded-t-lg rounded-b-lg min-h-[400px]", children: [
|
|
11818
|
-
/* @__PURE__ */ i.jsx(
|
|
11819
|
-
|
|
11828
|
+
/* @__PURE__ */ i.jsx(Un, { editor: v, className: "tiptap-editor" }),
|
|
11829
|
+
_ && /* @__PURE__ */ i.jsx("div", { className: "absolute inset-0 bg-white/80 backdrop-blur-sm flex items-center justify-center z-50 rounded-lg", children: /* @__PURE__ */ i.jsxs("div", { className: "flex flex-col items-center gap-3", children: [
|
|
11820
11830
|
/* @__PURE__ */ i.jsxs("div", { className: "relative", children: [
|
|
11821
11831
|
/* @__PURE__ */ i.jsx("div", { className: "animate-spin rounded-full h-12 w-12 border-4 border-gray-200 border-t-blue-600" }),
|
|
11822
11832
|
/* @__PURE__ */ i.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ i.jsx(
|
|
@@ -11855,7 +11865,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11855
11865
|
{
|
|
11856
11866
|
editor: v,
|
|
11857
11867
|
isReadOnly: w,
|
|
11858
|
-
position:
|
|
11868
|
+
position: z
|
|
11859
11869
|
}
|
|
11860
11870
|
)
|
|
11861
11871
|
] })
|
|
@@ -11865,34 +11875,33 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11865
11875
|
editorContent: e,
|
|
11866
11876
|
immediatelyRender: n = !1
|
|
11867
11877
|
}) => {
|
|
11868
|
-
const [, r] =
|
|
11878
|
+
const [, r] = B({}), [s] = B(!0), o = zn({
|
|
11869
11879
|
extensions: [
|
|
11870
|
-
|
|
11871
|
-
|
|
11872
|
-
Fn,
|
|
11873
|
-
$n,
|
|
11880
|
+
sr,
|
|
11881
|
+
Uo,
|
|
11874
11882
|
Hn,
|
|
11875
|
-
|
|
11883
|
+
Kn,
|
|
11884
|
+
$n,
|
|
11885
|
+
or.configure({
|
|
11876
11886
|
inline: !1,
|
|
11877
11887
|
allowBase64: !0
|
|
11878
11888
|
}),
|
|
11879
|
-
|
|
11889
|
+
ir.configure({
|
|
11880
11890
|
openOnClick: !1,
|
|
11881
11891
|
autolink: !0,
|
|
11882
11892
|
defaultProtocol: "https"
|
|
11883
11893
|
}),
|
|
11884
|
-
Er,
|
|
11885
11894
|
Nr,
|
|
11886
|
-
|
|
11887
|
-
ar
|
|
11895
|
+
Cr,
|
|
11896
|
+
ar,
|
|
11897
|
+
lr.configure({
|
|
11888
11898
|
types: ["textStyle"]
|
|
11889
11899
|
}),
|
|
11890
|
-
|
|
11900
|
+
cr.configure({
|
|
11891
11901
|
multicolor: !0
|
|
11892
11902
|
}),
|
|
11903
|
+
Er,
|
|
11893
11904
|
vr,
|
|
11894
|
-
xr,
|
|
11895
|
-
Cr,
|
|
11896
11905
|
Tr,
|
|
11897
11906
|
Sr,
|
|
11898
11907
|
_r,
|
|
@@ -11900,9 +11909,10 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11900
11909
|
Ar,
|
|
11901
11910
|
Or,
|
|
11902
11911
|
Rr,
|
|
11903
|
-
|
|
11912
|
+
Mr,
|
|
11904
11913
|
Lr,
|
|
11905
|
-
|
|
11914
|
+
jr,
|
|
11915
|
+
Ir.configure({
|
|
11906
11916
|
inline: !1,
|
|
11907
11917
|
allowBase64: !0,
|
|
11908
11918
|
HTMLAttributes: {
|
|
@@ -11927,10 +11937,10 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11927
11937
|
});
|
|
11928
11938
|
return Y(() => {
|
|
11929
11939
|
o && o.setEditable(!s);
|
|
11930
|
-
}, [o, s]), o ? /* @__PURE__ */ i.jsx("div", { className: "w-full max-w-6xl mx-auto p-4", children: /* @__PURE__ */ i.jsx(
|
|
11940
|
+
}, [o, s]), o ? /* @__PURE__ */ i.jsx("div", { className: "w-full max-w-6xl mx-auto p-4", children: /* @__PURE__ */ i.jsx(Un, { editor: o, className: "tiptap-editor" }) }) : null;
|
|
11931
11941
|
};
|
|
11932
11942
|
function kl(t) {
|
|
11933
|
-
const [e, n] =
|
|
11943
|
+
const [e, n] = B(
|
|
11934
11944
|
t ?? { html: "", json: null }
|
|
11935
11945
|
), r = Pe((s) => {
|
|
11936
11946
|
n(s);
|