tiptap-editor-codeveda 0.8.0 → 0.9.0
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,5 +1,5 @@
|
|
|
1
1
|
import * as ge from "react";
|
|
2
|
-
import Ze, { useState as P, useRef as
|
|
2
|
+
import Ze, { useState as P, useRef as _e, useEffect as Y, useMemo as ln, useCallback as Pe } from "react";
|
|
3
3
|
import { NodeViewWrapper as ce, NodeViewContent as Ct, ReactNodeViewRenderer as De, useCurrentEditor as Pn, useEditor as Bn, EditorContent as zn } from "@tiptap/react";
|
|
4
4
|
import ks from "@tiptap/starter-kit";
|
|
5
5
|
import { Table as Un, TableView as As } from "@tiptap/extension-table";
|
|
@@ -8,8 +8,8 @@ import Hn from "@tiptap/extension-table-cell";
|
|
|
8
8
|
import $n from "@tiptap/extension-table-header";
|
|
9
9
|
import Os from "@tiptap/extension-image";
|
|
10
10
|
import Rs from "@tiptap/extension-link";
|
|
11
|
-
import { TextStyle as
|
|
12
|
-
import
|
|
11
|
+
import { TextStyle as Ms } from "@tiptap/extension-text-style";
|
|
12
|
+
import Is from "@tiptap/extension-color";
|
|
13
13
|
import Ls from "@tiptap/extension-highlight";
|
|
14
14
|
import js from "@tiptap/extension-code-block-lowlight";
|
|
15
15
|
import { Check as Ds, Copy as Kn, Trash2 as nt, Settings as Jn, ExternalLink as Ps, Minimize as Bs, Maximize as zs, Code2 as cn, Eye as Us, Play as Fs, Heading1 as Wn, Heading2 as qn, Heading3 as Vn, Heading4 as Hs, FileText as Gn, List as $s, ListOrdered as Ks, Table as Js, Quote as Ws, Minus as Kt, Image as Yn, Video as qs, Code as Zt, PanelTopOpen as Vs, ChevronDown as Zn, Frame as Gs, MonitorPlay as Ys, Columns3 as Zs, Bold as Xs, Italic as Qs, Underline as eo, Strikethrough as to, Type as no, Palette as Xn, Link as ro, Plus as it, Terminal as so, Lock as oo, LockOpen as io } from "lucide-react";
|
|
@@ -19,11 +19,11 @@ import po from "@tiptap/extension-underline";
|
|
|
19
19
|
import go from "@tiptap/extension-strike";
|
|
20
20
|
import bo from "@tiptap/extension-blockquote";
|
|
21
21
|
import wo from "@tiptap/extension-horizontal-rule";
|
|
22
|
-
import { Slot as
|
|
23
|
-
import { cva as
|
|
22
|
+
import { Slot as yo } from "@radix-ui/react-slot";
|
|
23
|
+
import { cva as xo } from "class-variance-authority";
|
|
24
24
|
import { clsx as vo } from "clsx";
|
|
25
25
|
import { twMerge as Eo } from "tailwind-merge";
|
|
26
|
-
import { useMergeRefs as tr, FloatingPortal as No, FloatingDelayGroup as Co, useFloating as To, offset as
|
|
26
|
+
import { useMergeRefs as tr, FloatingPortal as No, FloatingDelayGroup as Co, useFloating as To, offset as So, flip as _o, shift as ko, autoUpdate as Ao, useHover as Oo, useFocus as Ro, useDismiss as Mo, useRole as Io, useInteractions as Lo } from "@floating-ui/react";
|
|
27
27
|
import { createPortal as nr } from "react-dom";
|
|
28
28
|
var at = { exports: {} }, qe = {};
|
|
29
29
|
/**
|
|
@@ -78,13 +78,13 @@ function Do() {
|
|
|
78
78
|
switch (m) {
|
|
79
79
|
case w:
|
|
80
80
|
return "Fragment";
|
|
81
|
-
case
|
|
81
|
+
case S:
|
|
82
82
|
return "Profiler";
|
|
83
83
|
case g:
|
|
84
84
|
return "StrictMode";
|
|
85
|
-
case
|
|
85
|
+
case y:
|
|
86
86
|
return "Suspense";
|
|
87
|
-
case
|
|
87
|
+
case _:
|
|
88
88
|
return "SuspenseList";
|
|
89
89
|
case L:
|
|
90
90
|
return "Activity";
|
|
@@ -95,7 +95,7 @@ function Do() {
|
|
|
95
95
|
), m.$$typeof) {
|
|
96
96
|
case b:
|
|
97
97
|
return "Portal";
|
|
98
|
-
case
|
|
98
|
+
case x:
|
|
99
99
|
return (m.displayName || "Context") + ".Provider";
|
|
100
100
|
case N:
|
|
101
101
|
return (m._context.displayName || "Context") + ".Consumer";
|
|
@@ -145,7 +145,7 @@ function Do() {
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
function s() {
|
|
148
|
-
var m =
|
|
148
|
+
var m = M.A;
|
|
149
149
|
return m === null ? null : m.getOwner();
|
|
150
150
|
}
|
|
151
151
|
function o() {
|
|
@@ -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"), S = 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"), _ = Symbol.for("react.suspense_list"), A = Symbol.for("react.memo"), B = 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, z = Array.isArray, j = console.createTask ? console.createTask : function() {
|
|
265
265
|
return null;
|
|
266
266
|
};
|
|
267
267
|
p = {
|
|
@@ -274,7 +274,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
274
274
|
o
|
|
275
275
|
)(), k = j(r(o)), O = {};
|
|
276
276
|
Ve.Fragment = w, Ve.jsx = function(m, E, R, D, q) {
|
|
277
|
-
var V = 1e4 >
|
|
277
|
+
var V = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
278
278
|
return u(
|
|
279
279
|
m,
|
|
280
280
|
E,
|
|
@@ -286,7 +286,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
286
286
|
V ? j(r(m)) : k
|
|
287
287
|
);
|
|
288
288
|
}, Ve.jsxs = function(m, E, R, D, q) {
|
|
289
|
-
var V = 1e4 >
|
|
289
|
+
var V = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
290
290
|
return u(
|
|
291
291
|
m,
|
|
292
292
|
E,
|
|
@@ -325,12 +325,12 @@ const rr = ks.configure({
|
|
|
325
325
|
openOnClick: !1,
|
|
326
326
|
autolink: !0,
|
|
327
327
|
defaultProtocol: "https"
|
|
328
|
-
}), ir =
|
|
328
|
+
}), ir = Ms, ar = Is.configure({
|
|
329
329
|
types: ["textStyle"]
|
|
330
330
|
}), lr = Ls.configure({
|
|
331
331
|
multicolor: !0
|
|
332
332
|
}), Uo = ({ node: t }) => {
|
|
333
|
-
const [e, n] = P(!1), r =
|
|
333
|
+
const [e, n] = P(!1), r = _e(null);
|
|
334
334
|
Y(() => () => {
|
|
335
335
|
r.current && clearTimeout(r.current);
|
|
336
336
|
}, []);
|
|
@@ -1578,7 +1578,7 @@ function ei(t) {
|
|
|
1578
1578
|
t.C_BLOCK_COMMENT_MODE,
|
|
1579
1579
|
t.C_LINE_COMMENT_MODE
|
|
1580
1580
|
]
|
|
1581
|
-
},
|
|
1581
|
+
}, x = [
|
|
1582
1582
|
t.APOS_STRING_MODE,
|
|
1583
1583
|
t.QUOTE_STRING_MODE,
|
|
1584
1584
|
h,
|
|
@@ -1592,7 +1592,7 @@ function ei(t) {
|
|
|
1592
1592
|
// See https://github.com/highlightjs/highlight.js/issues/3288
|
|
1593
1593
|
// hljs.REGEXP_MODE
|
|
1594
1594
|
];
|
|
1595
|
-
p.contains =
|
|
1595
|
+
p.contains = x.concat({
|
|
1596
1596
|
// we need to pair up {} inside our subst to prevent
|
|
1597
1597
|
// it from ending too early by matching another }
|
|
1598
1598
|
begin: /\{/,
|
|
@@ -1600,9 +1600,9 @@ function ei(t) {
|
|
|
1600
1600
|
keywords: l,
|
|
1601
1601
|
contains: [
|
|
1602
1602
|
"self"
|
|
1603
|
-
].concat(
|
|
1603
|
+
].concat(x)
|
|
1604
1604
|
});
|
|
1605
|
-
const T = [].concat(N, p.contains),
|
|
1605
|
+
const T = [].concat(N, p.contains), y = T.concat([
|
|
1606
1606
|
// eat recursive parens in sub expressions
|
|
1607
1607
|
{
|
|
1608
1608
|
begin: /(\s*)\(/,
|
|
@@ -1610,7 +1610,7 @@ function ei(t) {
|
|
|
1610
1610
|
keywords: l,
|
|
1611
1611
|
contains: ["self"].concat(T)
|
|
1612
1612
|
}
|
|
1613
|
-
]),
|
|
1613
|
+
]), _ = {
|
|
1614
1614
|
className: "params",
|
|
1615
1615
|
// convert this to negative lookbehind in v12
|
|
1616
1616
|
begin: /(\s*)\(/,
|
|
@@ -1619,7 +1619,7 @@ function ei(t) {
|
|
|
1619
1619
|
excludeBegin: !0,
|
|
1620
1620
|
excludeEnd: !0,
|
|
1621
1621
|
keywords: l,
|
|
1622
|
-
contains:
|
|
1622
|
+
contains: y
|
|
1623
1623
|
}, A = {
|
|
1624
1624
|
variants: [
|
|
1625
1625
|
// class Car extends vehicle
|
|
@@ -1705,9 +1705,9 @@ function ei(t) {
|
|
|
1705
1705
|
3: "title.function"
|
|
1706
1706
|
},
|
|
1707
1707
|
label: "func.def",
|
|
1708
|
-
contains: [
|
|
1708
|
+
contains: [_],
|
|
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"
|
|
@@ -1753,7 +1753,7 @@ function ei(t) {
|
|
|
1753
1753
|
// eat to avoid empty params
|
|
1754
1754
|
begin: /\(\)/
|
|
1755
1755
|
},
|
|
1756
|
-
|
|
1756
|
+
_
|
|
1757
1757
|
]
|
|
1758
1758
|
}, J = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + t.UNDERSCORE_IDENT_RE + ")\\s*=>", W = {
|
|
1759
1759
|
match: [
|
|
@@ -1772,7 +1772,7 @@ function ei(t) {
|
|
|
1772
1772
|
3: "title.function"
|
|
1773
1773
|
},
|
|
1774
1774
|
contains: [
|
|
1775
|
-
|
|
1775
|
+
_
|
|
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:
|
|
1783
|
+
exports: { PARAMS_CONTAINS: y, CLASS_REFERENCE: B },
|
|
1784
1784
|
illegal: /#(?![$_A-z])/,
|
|
1785
1785
|
contains: [
|
|
1786
1786
|
t.SHEBANG({
|
|
@@ -1841,7 +1841,7 @@ function ei(t) {
|
|
|
1841
1841
|
excludeBegin: !0,
|
|
1842
1842
|
excludeEnd: !0,
|
|
1843
1843
|
keywords: l,
|
|
1844
|
-
contains:
|
|
1844
|
+
contains: y
|
|
1845
1845
|
}
|
|
1846
1846
|
]
|
|
1847
1847
|
}
|
|
@@ -1896,7 +1896,7 @@ function ei(t) {
|
|
|
1896
1896
|
returnBegin: !0,
|
|
1897
1897
|
label: "func.def",
|
|
1898
1898
|
contains: [
|
|
1899
|
-
|
|
1899
|
+
_,
|
|
1900
1900
|
t.inherit(t.TITLE_MODE, { begin: r, className: "title.function" })
|
|
1901
1901
|
]
|
|
1902
1902
|
},
|
|
@@ -1916,10 +1916,10 @@ function ei(t) {
|
|
|
1916
1916
|
{
|
|
1917
1917
|
match: [/\bconstructor(?=\s*\()/],
|
|
1918
1918
|
className: { 1: "title.function" },
|
|
1919
|
-
contains: [
|
|
1919
|
+
contains: [_]
|
|
1920
1920
|
},
|
|
1921
1921
|
z,
|
|
1922
|
-
|
|
1922
|
+
M,
|
|
1923
1923
|
A,
|
|
1924
1924
|
K,
|
|
1925
1925
|
{
|
|
@@ -2233,7 +2233,7 @@ function ti(t) {
|
|
|
2233
2233
|
t.C_BLOCK_COMMENT_MODE,
|
|
2234
2234
|
t.C_LINE_COMMENT_MODE
|
|
2235
2235
|
]
|
|
2236
|
-
},
|
|
2236
|
+
}, x = [
|
|
2237
2237
|
t.APOS_STRING_MODE,
|
|
2238
2238
|
t.QUOTE_STRING_MODE,
|
|
2239
2239
|
h,
|
|
@@ -2247,7 +2247,7 @@ function ti(t) {
|
|
|
2247
2247
|
// See https://github.com/highlightjs/highlight.js/issues/3288
|
|
2248
2248
|
// hljs.REGEXP_MODE
|
|
2249
2249
|
];
|
|
2250
|
-
p.contains =
|
|
2250
|
+
p.contains = x.concat({
|
|
2251
2251
|
// we need to pair up {} inside our subst to prevent
|
|
2252
2252
|
// it from ending too early by matching another }
|
|
2253
2253
|
begin: /\{/,
|
|
@@ -2255,9 +2255,9 @@ function ti(t) {
|
|
|
2255
2255
|
keywords: l,
|
|
2256
2256
|
contains: [
|
|
2257
2257
|
"self"
|
|
2258
|
-
].concat(
|
|
2258
|
+
].concat(x)
|
|
2259
2259
|
});
|
|
2260
|
-
const T = [].concat(N, p.contains),
|
|
2260
|
+
const T = [].concat(N, p.contains), y = T.concat([
|
|
2261
2261
|
// eat recursive parens in sub expressions
|
|
2262
2262
|
{
|
|
2263
2263
|
begin: /(\s*)\(/,
|
|
@@ -2265,7 +2265,7 @@ function ti(t) {
|
|
|
2265
2265
|
keywords: l,
|
|
2266
2266
|
contains: ["self"].concat(T)
|
|
2267
2267
|
}
|
|
2268
|
-
]),
|
|
2268
|
+
]), _ = {
|
|
2269
2269
|
className: "params",
|
|
2270
2270
|
// convert this to negative lookbehind in v12
|
|
2271
2271
|
begin: /(\s*)\(/,
|
|
@@ -2274,7 +2274,7 @@ function ti(t) {
|
|
|
2274
2274
|
excludeBegin: !0,
|
|
2275
2275
|
excludeEnd: !0,
|
|
2276
2276
|
keywords: l,
|
|
2277
|
-
contains:
|
|
2277
|
+
contains: y
|
|
2278
2278
|
}, A = {
|
|
2279
2279
|
variants: [
|
|
2280
2280
|
// class Car extends vehicle
|
|
@@ -2360,9 +2360,9 @@ function ti(t) {
|
|
|
2360
2360
|
3: "title.function"
|
|
2361
2361
|
},
|
|
2362
2362
|
label: "func.def",
|
|
2363
|
-
contains: [
|
|
2363
|
+
contains: [_],
|
|
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"
|
|
@@ -2408,7 +2408,7 @@ function ti(t) {
|
|
|
2408
2408
|
// eat to avoid empty params
|
|
2409
2409
|
begin: /\(\)/
|
|
2410
2410
|
},
|
|
2411
|
-
|
|
2411
|
+
_
|
|
2412
2412
|
]
|
|
2413
2413
|
}, J = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + t.UNDERSCORE_IDENT_RE + ")\\s*=>", W = {
|
|
2414
2414
|
match: [
|
|
@@ -2427,7 +2427,7 @@ function ti(t) {
|
|
|
2427
2427
|
3: "title.function"
|
|
2428
2428
|
},
|
|
2429
2429
|
contains: [
|
|
2430
|
-
|
|
2430
|
+
_
|
|
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:
|
|
2438
|
+
exports: { PARAMS_CONTAINS: y, CLASS_REFERENCE: B },
|
|
2439
2439
|
illegal: /#(?![$_A-z])/,
|
|
2440
2440
|
contains: [
|
|
2441
2441
|
t.SHEBANG({
|
|
@@ -2496,7 +2496,7 @@ function ti(t) {
|
|
|
2496
2496
|
excludeBegin: !0,
|
|
2497
2497
|
excludeEnd: !0,
|
|
2498
2498
|
keywords: l,
|
|
2499
|
-
contains:
|
|
2499
|
+
contains: y
|
|
2500
2500
|
}
|
|
2501
2501
|
]
|
|
2502
2502
|
}
|
|
@@ -2551,7 +2551,7 @@ function ti(t) {
|
|
|
2551
2551
|
returnBegin: !0,
|
|
2552
2552
|
label: "func.def",
|
|
2553
2553
|
contains: [
|
|
2554
|
-
|
|
2554
|
+
_,
|
|
2555
2555
|
t.inherit(t.TITLE_MODE, { begin: r, className: "title.function" })
|
|
2556
2556
|
]
|
|
2557
2557
|
},
|
|
@@ -2571,10 +2571,10 @@ function ti(t) {
|
|
|
2571
2571
|
{
|
|
2572
2572
|
match: [/\bconstructor(?=\s*\()/],
|
|
2573
2573
|
className: { 1: "title.function" },
|
|
2574
|
-
contains: [
|
|
2574
|
+
contains: [_]
|
|
2575
2575
|
},
|
|
2576
2576
|
z,
|
|
2577
|
-
|
|
2577
|
+
M,
|
|
2578
2578
|
A,
|
|
2579
2579
|
K,
|
|
2580
2580
|
{
|
|
@@ -2642,11 +2642,11 @@ function ni(t) {
|
|
|
2642
2642
|
}, u = {
|
|
2643
2643
|
className: "meta",
|
|
2644
2644
|
begin: "@" + r
|
|
2645
|
-
}, f = (w, g,
|
|
2646
|
-
const N = w.contains.findIndex((
|
|
2645
|
+
}, f = (w, g, S) => {
|
|
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, S);
|
|
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(
|
|
@@ -3182,7 +3182,7 @@ function si(t) {
|
|
|
3182
3182
|
endsWithParent: !0
|
|
3183
3183
|
}
|
|
3184
3184
|
]
|
|
3185
|
-
},
|
|
3185
|
+
}, S = {
|
|
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: [S]
|
|
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
|
+
S,
|
|
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 yr(t, e, n) {
|
|
3318
|
+
return n === -1 ? "" : t.replace(e, (r) => yr(t, e, n - 1));
|
|
3319
3319
|
}
|
|
3320
3320
|
function oi(t) {
|
|
3321
|
-
const e = t.regex, n = "[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*", r = n +
|
|
3321
|
+
const e = t.regex, n = "[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*", r = n + yr("(?:<" + n + "~~~(?:\\s*,\\s*" + n + "~~~)*>)?", /~~~/g, 2), c = {
|
|
3322
3322
|
keyword: [
|
|
3323
3323
|
"synchronized",
|
|
3324
3324
|
"abstract",
|
|
@@ -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
|
+
}, S = [
|
|
3673
3673
|
f,
|
|
3674
3674
|
l,
|
|
3675
3675
|
n,
|
|
@@ -3695,17 +3695,17 @@ function ii(t) {
|
|
|
3695
3695
|
}
|
|
3696
3696
|
],
|
|
3697
3697
|
keywords: g,
|
|
3698
|
-
contains:
|
|
3698
|
+
contains: S.concat([
|
|
3699
3699
|
{
|
|
3700
3700
|
begin: /\(/,
|
|
3701
3701
|
end: /\)/,
|
|
3702
3702
|
keywords: g,
|
|
3703
|
-
contains:
|
|
3703
|
+
contains: S.concat(["self"]),
|
|
3704
3704
|
relevance: 0
|
|
3705
3705
|
}
|
|
3706
3706
|
]),
|
|
3707
3707
|
relevance: 0
|
|
3708
|
-
},
|
|
3708
|
+
}, x = {
|
|
3709
3709
|
begin: "(" + a + "[\\*&\\s]+)+" + h,
|
|
3710
3710
|
returnBegin: !0,
|
|
3711
3711
|
end: /[{;=]/,
|
|
@@ -3776,8 +3776,8 @@ function ii(t) {
|
|
|
3776
3776
|
illegal: "</",
|
|
3777
3777
|
contains: [].concat(
|
|
3778
3778
|
N,
|
|
3779
|
-
|
|
3780
|
-
|
|
3779
|
+
x,
|
|
3780
|
+
S,
|
|
3781
3781
|
[
|
|
3782
3782
|
f,
|
|
3783
3783
|
{
|
|
@@ -4025,7 +4025,7 @@ function ai(t) {
|
|
|
4025
4025
|
"weak_ptr",
|
|
4026
4026
|
"wstring",
|
|
4027
4027
|
"wstring_view"
|
|
4028
|
-
],
|
|
4028
|
+
], S = [
|
|
4029
4029
|
"abort",
|
|
4030
4030
|
"abs",
|
|
4031
4031
|
"acos",
|
|
@@ -4138,12 +4138,12 @@ function ai(t) {
|
|
|
4138
4138
|
],
|
|
4139
4139
|
built_in: ["_Pragma"],
|
|
4140
4140
|
_type_hints: g
|
|
4141
|
-
},
|
|
4141
|
+
}, y = {
|
|
4142
4142
|
className: "function.dispatch",
|
|
4143
4143
|
relevance: 0,
|
|
4144
4144
|
keywords: {
|
|
4145
4145
|
// Only for relevance, not highlighting.
|
|
4146
|
-
_hint:
|
|
4146
|
+
_hint: S
|
|
4147
4147
|
},
|
|
4148
4148
|
begin: e.concat(
|
|
4149
4149
|
/\b/,
|
|
@@ -4155,8 +4155,8 @@ function ai(t) {
|
|
|
4155
4155
|
t.IDENT_RE,
|
|
4156
4156
|
e.lookahead(/(<[^<>]+>|)\s*\(/)
|
|
4157
4157
|
)
|
|
4158
|
-
},
|
|
4159
|
-
|
|
4158
|
+
}, _ = [
|
|
4159
|
+
y,
|
|
4160
4160
|
f,
|
|
4161
4161
|
l,
|
|
4162
4162
|
n,
|
|
@@ -4182,12 +4182,12 @@ function ai(t) {
|
|
|
4182
4182
|
}
|
|
4183
4183
|
],
|
|
4184
4184
|
keywords: T,
|
|
4185
|
-
contains:
|
|
4185
|
+
contains: _.concat([
|
|
4186
4186
|
{
|
|
4187
4187
|
begin: /\(/,
|
|
4188
4188
|
end: /\)/,
|
|
4189
4189
|
keywords: T,
|
|
4190
|
-
contains:
|
|
4190
|
+
contains: _.concat(["self"]),
|
|
4191
4191
|
relevance: 0
|
|
4192
4192
|
}
|
|
4193
4193
|
]),
|
|
@@ -4286,8 +4286,8 @@ function ai(t) {
|
|
|
4286
4286
|
contains: [].concat(
|
|
4287
4287
|
A,
|
|
4288
4288
|
B,
|
|
4289
|
-
|
|
4290
|
-
|
|
4289
|
+
y,
|
|
4290
|
+
_,
|
|
4291
4291
|
[
|
|
4292
4292
|
f,
|
|
4293
4293
|
{
|
|
@@ -4872,36 +4872,36 @@ function li(t) {
|
|
|
4872
4872
|
], h = u, b = [
|
|
4873
4873
|
...d,
|
|
4874
4874
|
...c
|
|
4875
|
-
].filter((
|
|
4875
|
+
].filter((y) => !u.includes(y)), w = {
|
|
4876
4876
|
scope: "variable",
|
|
4877
4877
|
match: /@[a-z0-9][a-z0-9_]*/
|
|
4878
4878
|
}, g = {
|
|
4879
4879
|
scope: "operator",
|
|
4880
4880
|
match: /[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,
|
|
4881
4881
|
relevance: 0
|
|
4882
|
-
},
|
|
4882
|
+
}, S = {
|
|
4883
4883
|
match: e.concat(/\b/, e.either(...h), /\s*\(/),
|
|
4884
4884
|
relevance: 0,
|
|
4885
4885
|
keywords: { built_in: h }
|
|
4886
4886
|
};
|
|
4887
|
-
function N(
|
|
4887
|
+
function N(y) {
|
|
4888
4888
|
return e.concat(
|
|
4889
4889
|
/\b/,
|
|
4890
|
-
e.either(...
|
|
4890
|
+
e.either(...y.map((_) => _.replace(/\s+/, "\\s+"))),
|
|
4891
4891
|
/\b/
|
|
4892
4892
|
);
|
|
4893
4893
|
}
|
|
4894
|
-
const
|
|
4894
|
+
const x = {
|
|
4895
4895
|
scope: "keyword",
|
|
4896
4896
|
match: N(p),
|
|
4897
4897
|
relevance: 0
|
|
4898
4898
|
};
|
|
4899
|
-
function T(
|
|
4900
|
-
exceptions:
|
|
4899
|
+
function T(y, {
|
|
4900
|
+
exceptions: _,
|
|
4901
4901
|
when: A
|
|
4902
4902
|
} = {}) {
|
|
4903
4903
|
const B = A;
|
|
4904
|
-
return
|
|
4904
|
+
return _ = _ || [], y.map((L) => L.match(/\|\d+$/) || _.includes(L) ? L : B(L) ? `${L}|0` : L);
|
|
4905
4905
|
}
|
|
4906
4906
|
return {
|
|
4907
4907
|
name: "SQL",
|
|
@@ -4910,7 +4910,7 @@ function li(t) {
|
|
|
4910
4910
|
illegal: /[{}]|<\//,
|
|
4911
4911
|
keywords: {
|
|
4912
4912
|
$pattern: /\b[\w\.]+/,
|
|
4913
|
-
keyword: T(b, { when: (
|
|
4913
|
+
keyword: T(b, { when: (y) => y.length < 3 }),
|
|
4914
4914
|
literal: o,
|
|
4915
4915
|
type: l,
|
|
4916
4916
|
built_in: f
|
|
@@ -4920,8 +4920,8 @@ function li(t) {
|
|
|
4920
4920
|
scope: "type",
|
|
4921
4921
|
match: N(a)
|
|
4922
4922
|
},
|
|
4923
|
-
|
|
4924
|
-
|
|
4923
|
+
x,
|
|
4924
|
+
S,
|
|
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 xr = co.create({
|
|
4936
4936
|
name: "codeBlockBg",
|
|
4937
4937
|
addOptions() {
|
|
4938
4938
|
return {
|
|
@@ -5007,7 +5007,7 @@ function ci({
|
|
|
5007
5007
|
updateAttributes: e,
|
|
5008
5008
|
editor: n
|
|
5009
5009
|
}) {
|
|
5010
|
-
const [r, s] = P(t.attrs?.open ?? !0), [o, a] = P(!1), [l, c] = P(t.attrs?.title || "Output"), d =
|
|
5010
|
+
const [r, s] = P(t.attrs?.open ?? !0), [o, a] = P(!1), [l, c] = P(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,27 +5022,27 @@ 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: S } = n.state, { $anchor: N } = S;
|
|
5026
5026
|
if (g.key === "Enter" && !g.shiftKey && N.nodeBefore?.type.name === "accordion") {
|
|
5027
5027
|
g.preventDefault(), g.stopPropagation();
|
|
5028
|
-
const
|
|
5029
|
-
if (
|
|
5030
|
-
const T =
|
|
5028
|
+
const x = N.nodeBefore;
|
|
5029
|
+
if (x && x.childCount > 0) {
|
|
5030
|
+
const T = x.lastChild;
|
|
5031
5031
|
if (T && T.content.size > 0) {
|
|
5032
|
-
let
|
|
5033
|
-
if (n.state.doc.descendants((
|
|
5034
|
-
if (
|
|
5035
|
-
return
|
|
5036
|
-
}),
|
|
5037
|
-
const
|
|
5038
|
-
n.chain().focus().setTextSelection(
|
|
5032
|
+
let y = -1;
|
|
5033
|
+
if (n.state.doc.descendants((_, A) => {
|
|
5034
|
+
if (_.type.name === "accordionItem")
|
|
5035
|
+
return y = A, !1;
|
|
5036
|
+
}), y !== -1) {
|
|
5037
|
+
const _ = y + T.nodeSize - 2;
|
|
5038
|
+
n.chain().focus().setTextSelection(_).run();
|
|
5039
5039
|
}
|
|
5040
5040
|
} else {
|
|
5041
|
-
let
|
|
5042
|
-
n.state.doc.descendants((
|
|
5043
|
-
if (
|
|
5044
|
-
return
|
|
5045
|
-
}),
|
|
5041
|
+
let y = -1;
|
|
5042
|
+
n.state.doc.descendants((_, A) => {
|
|
5043
|
+
if (_.type.name === "accordionItem")
|
|
5044
|
+
return y = A, !1;
|
|
5045
|
+
}), y !== -1 && n.chain().focus().setTextSelection(y + 1).run();
|
|
5046
5046
|
}
|
|
5047
5047
|
}
|
|
5048
5048
|
return;
|
|
@@ -5057,13 +5057,13 @@ function ci({
|
|
|
5057
5057
|
return;
|
|
5058
5058
|
}
|
|
5059
5059
|
if (N.parent.type.name === "accordionItem") {
|
|
5060
|
-
const
|
|
5061
|
-
if (T && !
|
|
5060
|
+
const x = N.parent, T = N.parentOffset === 0, y = x.content.content.some((_) => _.type.name === "paragraph" ? _.content.size > 0 : !0);
|
|
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((
|
|
5066
|
+
if (N.parent.type.name === "accordion" && !N.parent.content.content.some((y) => y.type.name === "accordionItem" ? y.content.content.some((_) => _.type.name === "paragraph" ? _.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 Sr = ke.create({
|
|
5146
5146
|
name: "accordion",
|
|
5147
5147
|
group: "block",
|
|
5148
5148
|
content: "accordionItem+",
|
|
@@ -5209,7 +5209,7 @@ const _r = ke.create({
|
|
|
5209
5209
|
})
|
|
5210
5210
|
};
|
|
5211
5211
|
}
|
|
5212
|
-
}),
|
|
5212
|
+
}), _r = ke.create({
|
|
5213
5213
|
name: "accordionItem",
|
|
5214
5214
|
group: "block",
|
|
5215
5215
|
content: "block+",
|
|
@@ -5249,30 +5249,30 @@ function di({
|
|
|
5249
5249
|
updateAttributes: e,
|
|
5250
5250
|
editor: n
|
|
5251
5251
|
}) {
|
|
5252
|
-
const [r, s] = P(t.attrs?.activeTab ?? 0), [o, a] = P(null), [l, c] = P(""), d =
|
|
5252
|
+
const [r, s] = P(t.attrs?.activeTab ?? 0), [o, a] = P(null), [l, c] = P(""), d = _e(null), u = t.content?.content || [], f = n?.isEditable ?? !1;
|
|
5253
5253
|
Y(() => {
|
|
5254
|
-
const
|
|
5255
|
-
|
|
5254
|
+
const x = t.attrs?.activeTab ?? 0;
|
|
5255
|
+
x !== r && s(x);
|
|
5256
5256
|
}, [t.attrs?.activeTab]), Y(() => {
|
|
5257
5257
|
o !== null && d.current && (d.current.focus(), d.current.select());
|
|
5258
5258
|
}, [o]);
|
|
5259
|
-
const p = (
|
|
5260
|
-
s(
|
|
5261
|
-
}, h = (
|
|
5262
|
-
f && (a(
|
|
5259
|
+
const p = (x) => {
|
|
5260
|
+
s(x), e({ ...t.attrs, activeTab: x });
|
|
5261
|
+
}, h = (x, T) => {
|
|
5262
|
+
f && (a(x), c(T));
|
|
5263
5263
|
}, b = () => {
|
|
5264
5264
|
f && n && confirm("Are you sure you want to delete this tabs component?") && n.chain().focus().deleteNode("tabs").run();
|
|
5265
5265
|
}, w = () => {
|
|
5266
5266
|
if (o !== null && u[o] && n) {
|
|
5267
|
-
let
|
|
5268
|
-
n.state.doc.descendants((T,
|
|
5267
|
+
let x = -1;
|
|
5268
|
+
n.state.doc.descendants((T, y) => {
|
|
5269
5269
|
if (T.type.name === "tabItem" && T.attrs.tabIndex === o)
|
|
5270
|
-
return
|
|
5271
|
-
}),
|
|
5272
|
-
if (
|
|
5273
|
-
const
|
|
5274
|
-
|
|
5275
|
-
...
|
|
5270
|
+
return x = y, !1;
|
|
5271
|
+
}), x !== -1 && n.chain().focus().command(({ tr: T, dispatch: y }) => {
|
|
5272
|
+
if (y) {
|
|
5273
|
+
const _ = T.doc.nodeAt(x);
|
|
5274
|
+
_ && T.setNodeMarkup(x, void 0, {
|
|
5275
|
+
..._.attrs,
|
|
5276
5276
|
title: l
|
|
5277
5277
|
});
|
|
5278
5278
|
}
|
|
@@ -5280,20 +5280,20 @@ function di({
|
|
|
5280
5280
|
}).run();
|
|
5281
5281
|
}
|
|
5282
5282
|
a(null), c("");
|
|
5283
|
-
}, g = (
|
|
5284
|
-
|
|
5285
|
-
},
|
|
5283
|
+
}, g = (x) => {
|
|
5284
|
+
x.key === "Enter" ? w() : x.key === "Escape" && (a(null), c(""));
|
|
5285
|
+
}, S = (x) => u[x]?.attrs?.title || `Tab ${x + 1}`, N = (x) => {
|
|
5286
5286
|
if (!f || !n) return;
|
|
5287
|
-
const { selection: T } = n.state, { $anchor:
|
|
5288
|
-
if (
|
|
5289
|
-
|
|
5290
|
-
const
|
|
5291
|
-
if (
|
|
5292
|
-
const A =
|
|
5287
|
+
const { selection: T } = n.state, { $anchor: y } = T;
|
|
5288
|
+
if (x.key === "Enter" && !x.shiftKey && y.nodeBefore?.type.name === "tabs") {
|
|
5289
|
+
x.preventDefault(), x.stopPropagation();
|
|
5290
|
+
const _ = y.nodeBefore;
|
|
5291
|
+
if (_ && _.childCount > 0) {
|
|
5292
|
+
const A = _.lastChild;
|
|
5293
5293
|
if (A && A.content.size > 0) {
|
|
5294
5294
|
let B = -1;
|
|
5295
5295
|
if (n.state.doc.descendants((L, C) => {
|
|
5296
|
-
if (L.type.name === "tabItem" && L.attrs.tabIndex ===
|
|
5296
|
+
if (L.type.name === "tabItem" && L.attrs.tabIndex === _.childCount - 1)
|
|
5297
5297
|
return B = C, !1;
|
|
5298
5298
|
}), B !== -1) {
|
|
5299
5299
|
const L = B + A.nodeSize - 2;
|
|
@@ -5303,13 +5303,13 @@ function di({
|
|
|
5303
5303
|
}
|
|
5304
5304
|
return;
|
|
5305
5305
|
}
|
|
5306
|
-
if ((
|
|
5307
|
-
if (
|
|
5308
|
-
|
|
5306
|
+
if ((x.key === "Backspace" || x.key === "Delete") && !x.shiftKey) {
|
|
5307
|
+
if (y.nodeBefore?.type.name === "tabs") {
|
|
5308
|
+
x.preventDefault(), x.stopPropagation();
|
|
5309
5309
|
return;
|
|
5310
5310
|
}
|
|
5311
|
-
if (
|
|
5312
|
-
|
|
5311
|
+
if (y.nodeAfter?.type.name === "tabs") {
|
|
5312
|
+
x.preventDefault(), x.stopPropagation();
|
|
5313
5313
|
return;
|
|
5314
5314
|
}
|
|
5315
5315
|
}
|
|
@@ -5322,7 +5322,7 @@ function di({
|
|
|
5322
5322
|
onKeyDown: N,
|
|
5323
5323
|
children: [
|
|
5324
5324
|
/* @__PURE__ */ i.jsx("div", { className: "tabs-header bg-gray-50 border-b border-gray-200", children: /* @__PURE__ */ i.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
5325
|
-
/* @__PURE__ */ i.jsx("div", { className: "flex flex-1", children: u.map((
|
|
5325
|
+
/* @__PURE__ */ i.jsx("div", { className: "flex flex-1", children: u.map((x, T) => /* @__PURE__ */ i.jsx(
|
|
5326
5326
|
"button",
|
|
5327
5327
|
{
|
|
5328
5328
|
type: "button",
|
|
@@ -5334,21 +5334,21 @@ function di({
|
|
|
5334
5334
|
ref: d,
|
|
5335
5335
|
type: "text",
|
|
5336
5336
|
value: l,
|
|
5337
|
-
onChange: (
|
|
5337
|
+
onChange: (y) => c(y.target.value),
|
|
5338
5338
|
onBlur: w,
|
|
5339
5339
|
onKeyDown: g,
|
|
5340
5340
|
className: "bg-transparent border-none outline-none text-center w-full",
|
|
5341
|
-
onClick: (
|
|
5341
|
+
onClick: (y) => y.stopPropagation()
|
|
5342
5342
|
}
|
|
5343
5343
|
) : /* @__PURE__ */ i.jsx(
|
|
5344
5344
|
"span",
|
|
5345
5345
|
{
|
|
5346
|
-
onClick: f ? (
|
|
5347
|
-
|
|
5346
|
+
onClick: f ? (y) => {
|
|
5347
|
+
y.stopPropagation(), h(T, S(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: S(T)
|
|
5352
5352
|
}
|
|
5353
5353
|
)
|
|
5354
5354
|
},
|
|
@@ -5536,7 +5536,7 @@ const kr = ke.create({
|
|
|
5536
5536
|
function fi(...t) {
|
|
5537
5537
|
return Eo(vo(t));
|
|
5538
5538
|
}
|
|
5539
|
-
const hi =
|
|
5539
|
+
const hi = xo(
|
|
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,7 +5568,7 @@ function F({
|
|
|
5568
5568
|
asChild: r = !1,
|
|
5569
5569
|
...s
|
|
5570
5570
|
}) {
|
|
5571
|
-
const o = r ?
|
|
5571
|
+
const o = r ? yo : "button";
|
|
5572
5572
|
return /* @__PURE__ */ i.jsx(
|
|
5573
5573
|
o,
|
|
5574
5574
|
{
|
|
@@ -5584,7 +5584,7 @@ const mi = ({
|
|
|
5584
5584
|
deleteNode: n,
|
|
5585
5585
|
editor: r
|
|
5586
5586
|
}) => {
|
|
5587
|
-
const [s, o] = P(!1), [a, l] = P("simple"), [c, d] = P(""), [u, f] = P(!1), p =
|
|
5587
|
+
const [s, o] = P(!1), [a, l] = P("simple"), [c, d] = P(""), [u, f] = P(!1), p = _e(null), [h, b] = P({
|
|
5588
5588
|
src: t.attrs.src || "",
|
|
5589
5589
|
width: t.attrs.width || "100%",
|
|
5590
5590
|
height: t.attrs.height || "500px",
|
|
@@ -5593,17 +5593,17 @@ const mi = ({
|
|
|
5593
5593
|
sandbox: t.attrs.sandbox || "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-presentation",
|
|
5594
5594
|
style: t.attrs.style || ""
|
|
5595
5595
|
}), w = (C) => {
|
|
5596
|
-
const
|
|
5597
|
-
return
|
|
5596
|
+
const M = C.toLowerCase();
|
|
5597
|
+
return M.includes("youtube.com") || M.includes("youtu.be") ? "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-presentation allow-popups-to-escape-sandbox" : M.includes("codesandbox.io") || M.includes("stackblitz.com") ? "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-presentation allow-popups-to-escape-sandbox allow-top-navigation" : "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-presentation";
|
|
5598
5598
|
}, g = (C) => {
|
|
5599
|
-
const
|
|
5599
|
+
const M = w(C);
|
|
5600
5600
|
b({
|
|
5601
5601
|
...h,
|
|
5602
5602
|
src: C,
|
|
5603
|
-
sandbox:
|
|
5603
|
+
sandbox: M
|
|
5604
5604
|
});
|
|
5605
|
-
},
|
|
5606
|
-
|
|
5605
|
+
}, S = () => {
|
|
5606
|
+
x && (e(h), o(!1));
|
|
5607
5607
|
}, N = () => {
|
|
5608
5608
|
b({
|
|
5609
5609
|
src: t.attrs.src || "",
|
|
@@ -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
|
-
}, [
|
|
5617
|
+
}, [x, T] = P(r?.isEditable ?? !1);
|
|
5618
5618
|
Y(() => {
|
|
5619
5619
|
if (r) {
|
|
5620
5620
|
const C = () => {
|
|
@@ -5625,9 +5625,9 @@ const mi = ({
|
|
|
5625
5625
|
};
|
|
5626
5626
|
}
|
|
5627
5627
|
}, [r]);
|
|
5628
|
-
const
|
|
5629
|
-
|
|
5630
|
-
},
|
|
5628
|
+
const y = () => {
|
|
5629
|
+
x && o(!0);
|
|
5630
|
+
}, _ = () => {
|
|
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 = () => {
|
|
@@ -5635,8 +5635,8 @@ const mi = ({
|
|
|
5635
5635
|
};
|
|
5636
5636
|
Y(() => {
|
|
5637
5637
|
const C = () => {
|
|
5638
|
-
const
|
|
5639
|
-
f(
|
|
5638
|
+
const M = !!(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement);
|
|
5639
|
+
f(M);
|
|
5640
5640
|
};
|
|
5641
5641
|
return document.addEventListener("fullscreenchange", C), document.addEventListener("webkitfullscreenchange", C), document.addEventListener("mozfullscreenchange", C), document.addEventListener("MSFullscreenChange", C), () => {
|
|
5642
5642
|
document.removeEventListener("fullscreenchange", C), document.removeEventListener(
|
|
@@ -5790,7 +5790,7 @@ const mi = ({
|
|
|
5790
5790
|
/* @__PURE__ */ i.jsx(
|
|
5791
5791
|
F,
|
|
5792
5792
|
{
|
|
5793
|
-
onClick:
|
|
5793
|
+
onClick: S,
|
|
5794
5794
|
size: "sm",
|
|
5795
5795
|
className: "bg-blue-600 hover:bg-blue-700",
|
|
5796
5796
|
children: "Save"
|
|
@@ -5820,11 +5820,11 @@ const mi = ({
|
|
|
5820
5820
|
className: u ? "rounded-lg iframe-fullscreen" : "rounded-lg"
|
|
5821
5821
|
}
|
|
5822
5822
|
),
|
|
5823
|
-
|
|
5823
|
+
x && /* @__PURE__ */ i.jsx("div", { className: "absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity duration-200 bg-white/90 backdrop-blur-sm rounded-lg p-1 shadow-lg border", children: /* @__PURE__ */ i.jsxs("div", { className: "flex gap-1", children: [
|
|
5824
5824
|
/* @__PURE__ */ i.jsx(
|
|
5825
5825
|
F,
|
|
5826
5826
|
{
|
|
5827
|
-
onClick:
|
|
5827
|
+
onClick: y,
|
|
5828
5828
|
size: "sm",
|
|
5829
5829
|
variant: "ghost",
|
|
5830
5830
|
className: "h-8 w-8 p-0",
|
|
@@ -5846,7 +5846,7 @@ const mi = ({
|
|
|
5846
5846
|
/* @__PURE__ */ i.jsx(
|
|
5847
5847
|
F,
|
|
5848
5848
|
{
|
|
5849
|
-
onClick:
|
|
5849
|
+
onClick: _,
|
|
5850
5850
|
size: "sm",
|
|
5851
5851
|
variant: "ghost",
|
|
5852
5852
|
className: "h-8 w-8 p-0",
|
|
@@ -5858,7 +5858,7 @@ const mi = ({
|
|
|
5858
5858
|
F,
|
|
5859
5859
|
{
|
|
5860
5860
|
onClick: () => {
|
|
5861
|
-
|
|
5861
|
+
x && n();
|
|
5862
5862
|
},
|
|
5863
5863
|
size: "sm",
|
|
5864
5864
|
variant: "ghost",
|
|
@@ -5879,7 +5879,7 @@ const mi = ({
|
|
|
5879
5879
|
children: u ? /* @__PURE__ */ i.jsx(Bs, { className: "h-4 w-4" }) : /* @__PURE__ */ i.jsx(zs, { 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: [
|
|
5883
5883
|
"Source: ",
|
|
5884
5884
|
t.attrs.src
|
|
5885
5885
|
] })
|
|
@@ -5983,7 +5983,7 @@ const mi = ({
|
|
|
5983
5983
|
})
|
|
5984
5984
|
};
|
|
5985
5985
|
}
|
|
5986
|
-
}),
|
|
5986
|
+
}), It = `<div class="demo">
|
|
5987
5987
|
<h1>Hello World</h1>
|
|
5988
5988
|
<p>Edit the HTML, CSS, and JS to see live output.</p>
|
|
5989
5989
|
</div>`, Lt = `.demo {
|
|
@@ -6034,7 +6034,24 @@ ${t}
|
|
|
6034
6034
|
ro.observe(document.documentElement);
|
|
6035
6035
|
if (document.body) ro.observe(document.body);
|
|
6036
6036
|
}
|
|
6037
|
-
|
|
6037
|
+
// The parent's message listener can attach late (SSR / hydration /
|
|
6038
|
+
// StrictMode double-mount), so a single post can be missed. Re-post a few
|
|
6039
|
+
// times so a late-attaching parent still receives the content height.
|
|
6040
|
+
[0, 50, 150, 300, 600, 1000].forEach(function (delay) {
|
|
6041
|
+
setTimeout(postHeight, delay);
|
|
6042
|
+
});
|
|
6043
|
+
if (typeof requestAnimationFrame !== "undefined") {
|
|
6044
|
+
requestAnimationFrame(postHeight);
|
|
6045
|
+
}
|
|
6046
|
+
// Re-report once web fonts settle, since they change content height.
|
|
6047
|
+
if (document.fonts && document.fonts.ready) {
|
|
6048
|
+
document.fonts.ready.then(postHeight).catch(function () {});
|
|
6049
|
+
}
|
|
6050
|
+
// Respond on demand: the parent requests the height after the iframe's
|
|
6051
|
+
// onLoad fires, which is race-proof even if the parent attached late.
|
|
6052
|
+
window.addEventListener("message", function (e) {
|
|
6053
|
+
if (e.data && e.data.type === "live-preview-request-height") postHeight();
|
|
6054
|
+
});
|
|
6038
6055
|
})();<\/script>
|
|
6039
6056
|
</body>
|
|
6040
6057
|
</html>`;
|
|
@@ -6052,24 +6069,24 @@ const gi = [
|
|
|
6052
6069
|
if (/^\d+(\.\d+)?$/.test(e)) return `${e}px`;
|
|
6053
6070
|
const n = e.toLowerCase();
|
|
6054
6071
|
return n === "min" || n === "min-content" ? "min-content" : (/^\d+(\.\d+)?(px|%|em|rem|vh|vw|vmin|vmax|ch|pt|pc|cm|mm|in)$/i.test(e), e);
|
|
6055
|
-
},
|
|
6072
|
+
}, yi = ({
|
|
6056
6073
|
node: t,
|
|
6057
6074
|
updateAttributes: e,
|
|
6058
6075
|
deleteNode: n,
|
|
6059
6076
|
editor: r
|
|
6060
6077
|
}) => {
|
|
6061
|
-
const [s, o] = P(!!t.attrs.pendingEdit), [a, l] = P("html"), [c, d] = P("code"), [u, f] = P(0), [p, h] = P(null), b = Ze.useRef(null), w = Ze.useRef(null), [g,
|
|
6078
|
+
const [s, o] = P(!!t.attrs.pendingEdit), [a, l] = P("html"), [c, d] = P("code"), [u, f] = P(0), [p, h] = P(null), b = Ze.useRef(null), w = Ze.useRef(null), [g, S] = P({
|
|
6062
6079
|
html: t.attrs.html || "",
|
|
6063
6080
|
css: t.attrs.css || "",
|
|
6064
6081
|
js: t.attrs.js || "",
|
|
6065
6082
|
height: t.attrs.height || pt,
|
|
6066
6083
|
title: t.attrs.title || Ge
|
|
6067
|
-
}), [N,
|
|
6084
|
+
}), [N, x] = P(r?.isEditable ?? !1);
|
|
6068
6085
|
Y(() => {
|
|
6069
6086
|
t.attrs.pendingEdit && N && (o(!0), e({ pendingEdit: !1 }));
|
|
6070
6087
|
}, [t.attrs.pendingEdit, N, e]), Y(() => {
|
|
6071
6088
|
if (!r) return;
|
|
6072
|
-
const v = () =>
|
|
6089
|
+
const v = () => x(r.isEditable);
|
|
6073
6090
|
return v(), r.on("update", v), r.on("selectionUpdate", v), () => {
|
|
6074
6091
|
r.off("update", v), r.off("selectionUpdate", v);
|
|
6075
6092
|
};
|
|
@@ -6077,11 +6094,11 @@ const gi = [
|
|
|
6077
6094
|
const T = ln(
|
|
6078
6095
|
() => pn(t.attrs.html, t.attrs.css, t.attrs.js),
|
|
6079
6096
|
[t.attrs.html, t.attrs.css, t.attrs.js]
|
|
6080
|
-
),
|
|
6097
|
+
), y = ln(
|
|
6081
6098
|
() => pn(g.html, g.css, g.js),
|
|
6082
6099
|
[g.html, g.css, g.js]
|
|
6083
|
-
),
|
|
6084
|
-
N && (
|
|
6100
|
+
), _ = () => {
|
|
6101
|
+
N && (S({
|
|
6085
6102
|
html: t.attrs.html || "",
|
|
6086
6103
|
css: t.attrs.css || "",
|
|
6087
6104
|
js: t.attrs.js || "",
|
|
@@ -6091,7 +6108,7 @@ const gi = [
|
|
|
6091
6108
|
}, A = () => {
|
|
6092
6109
|
N && (e(g), f((v) => v + 1), o(!1));
|
|
6093
6110
|
}, B = () => {
|
|
6094
|
-
|
|
6111
|
+
S({
|
|
6095
6112
|
html: t.attrs.html || "",
|
|
6096
6113
|
css: t.attrs.css || "",
|
|
6097
6114
|
js: t.attrs.js || "",
|
|
@@ -6101,7 +6118,7 @@ const gi = [
|
|
|
6101
6118
|
}, L = () => {
|
|
6102
6119
|
f((v) => v + 1), d("preview");
|
|
6103
6120
|
}, C = (v, z) => {
|
|
6104
|
-
|
|
6121
|
+
S((j) => ({ ...j, [v]: z }));
|
|
6105
6122
|
};
|
|
6106
6123
|
Y(() => {
|
|
6107
6124
|
const v = (z) => {
|
|
@@ -6112,7 +6129,7 @@ const gi = [
|
|
|
6112
6129
|
};
|
|
6113
6130
|
return window.addEventListener("message", v), () => window.removeEventListener("message", v);
|
|
6114
6131
|
}, []);
|
|
6115
|
-
const
|
|
6132
|
+
const M = (v, z, j) => {
|
|
6116
6133
|
const K = bi(z), J = K ? p != null ? `${p}px` : "auto" : wi(z);
|
|
6117
6134
|
return /* @__PURE__ */ i.jsx(
|
|
6118
6135
|
"iframe",
|
|
@@ -6123,6 +6140,12 @@ const gi = [
|
|
|
6123
6140
|
sandbox: "allow-scripts allow-modals",
|
|
6124
6141
|
className: "live-preview-iframe",
|
|
6125
6142
|
scrolling: K ? "no" : "auto",
|
|
6143
|
+
onLoad: (W) => {
|
|
6144
|
+
W.currentTarget.contentWindow?.postMessage(
|
|
6145
|
+
{ type: "live-preview-request-height" },
|
|
6146
|
+
"*"
|
|
6147
|
+
);
|
|
6148
|
+
},
|
|
6126
6149
|
style: {
|
|
6127
6150
|
width: "100%",
|
|
6128
6151
|
height: J,
|
|
@@ -6218,7 +6241,7 @@ const gi = [
|
|
|
6218
6241
|
)
|
|
6219
6242
|
] })
|
|
6220
6243
|
] })
|
|
6221
|
-
] }) : /* @__PURE__ */ i.jsx("div", { className: "live-preview-edit-preview", children:
|
|
6244
|
+
] }) : /* @__PURE__ */ i.jsx("div", { className: "live-preview-edit-preview", children: M(y, g.height, u) }),
|
|
6222
6245
|
/* @__PURE__ */ i.jsxs("div", { className: "live-preview-actions", children: [
|
|
6223
6246
|
/* @__PURE__ */ i.jsxs(
|
|
6224
6247
|
F,
|
|
@@ -6238,7 +6261,7 @@ const gi = [
|
|
|
6238
6261
|
/* @__PURE__ */ i.jsx(F, { type: "button", size: "sm", variant: "outline", onClick: B, children: "Cancel" })
|
|
6239
6262
|
] })
|
|
6240
6263
|
] }) }) : /* @__PURE__ */ i.jsx(ce, { className: "live-preview-extension", children: /* @__PURE__ */ i.jsxs("div", { ref: b, className: "live-preview-output group relative", children: [
|
|
6241
|
-
|
|
6264
|
+
M(T, t.attrs.height, u),
|
|
6242
6265
|
N && /* @__PURE__ */ i.jsxs("div", { className: "live-preview-controls", children: [
|
|
6243
6266
|
/* @__PURE__ */ i.jsx(
|
|
6244
6267
|
F,
|
|
@@ -6248,7 +6271,7 @@ const gi = [
|
|
|
6248
6271
|
variant: "ghost",
|
|
6249
6272
|
className: "h-8 w-8 p-0",
|
|
6250
6273
|
title: "Edit code",
|
|
6251
|
-
onClick:
|
|
6274
|
+
onClick: _,
|
|
6252
6275
|
children: /* @__PURE__ */ i.jsx(Jn, { className: "h-4 w-4" })
|
|
6253
6276
|
}
|
|
6254
6277
|
),
|
|
@@ -6278,8 +6301,8 @@ const Rr = ke.create({
|
|
|
6278
6301
|
addAttributes() {
|
|
6279
6302
|
return {
|
|
6280
6303
|
html: {
|
|
6281
|
-
default:
|
|
6282
|
-
parseHTML: (t) => Dt(t, "html") ||
|
|
6304
|
+
default: It,
|
|
6305
|
+
parseHTML: (t) => Dt(t, "html") || It
|
|
6283
6306
|
},
|
|
6284
6307
|
css: {
|
|
6285
6308
|
default: Lt,
|
|
@@ -6327,14 +6350,14 @@ const Rr = ke.create({
|
|
|
6327
6350
|
];
|
|
6328
6351
|
},
|
|
6329
6352
|
addNodeView() {
|
|
6330
|
-
return De(
|
|
6353
|
+
return De(yi);
|
|
6331
6354
|
},
|
|
6332
6355
|
addCommands() {
|
|
6333
6356
|
return {
|
|
6334
6357
|
insertLivePreview: (t = {}) => ({ commands: e }) => e.insertContent({
|
|
6335
6358
|
type: this.name,
|
|
6336
6359
|
attrs: {
|
|
6337
|
-
html: t.html ??
|
|
6360
|
+
html: t.html ?? It,
|
|
6338
6361
|
css: t.css ?? Lt,
|
|
6339
6362
|
js: t.js ?? jt,
|
|
6340
6363
|
height: t.height ?? "auto",
|
|
@@ -6362,7 +6385,7 @@ function Xe(t) {
|
|
|
6362
6385
|
}
|
|
6363
6386
|
return null;
|
|
6364
6387
|
}
|
|
6365
|
-
function
|
|
6388
|
+
function xi(t) {
|
|
6366
6389
|
return Xe(t) !== null;
|
|
6367
6390
|
}
|
|
6368
6391
|
const vi = ({ node: t }) => {
|
|
@@ -6394,7 +6417,7 @@ const vi = ({ node: t }) => {
|
|
|
6394
6417
|
] }),
|
|
6395
6418
|
r && /* @__PURE__ */ i.jsx("div", { className: "video-caption", children: /* @__PURE__ */ i.jsx("span", { className: "video-caption-text", children: r }) })
|
|
6396
6419
|
] }) });
|
|
6397
|
-
}, Ei = "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
|
|
6420
|
+
}, Ei = "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share", Mr = ke.create({
|
|
6398
6421
|
name: "video",
|
|
6399
6422
|
addOptions() {
|
|
6400
6423
|
return {
|
|
@@ -6508,7 +6531,7 @@ const vi = ({ node: t }) => {
|
|
|
6508
6531
|
type: "paragraph"
|
|
6509
6532
|
}
|
|
6510
6533
|
]
|
|
6511
|
-
}),
|
|
6534
|
+
}), Ir = ke.create({
|
|
6512
6535
|
name: "columnLayout",
|
|
6513
6536
|
group: "block",
|
|
6514
6537
|
content: "column+",
|
|
@@ -6621,8 +6644,8 @@ function Ci({
|
|
|
6621
6644
|
onOpenChange: d,
|
|
6622
6645
|
whileElementsMounted: Ao,
|
|
6623
6646
|
middleware: [
|
|
6624
|
-
|
|
6625
|
-
|
|
6647
|
+
So(4),
|
|
6648
|
+
_o({
|
|
6626
6649
|
crossAxis: e.includes("-"),
|
|
6627
6650
|
fallbackAxisSideDirection: "start",
|
|
6628
6651
|
padding: 4
|
|
@@ -6639,7 +6662,7 @@ function Ci({
|
|
|
6639
6662
|
}
|
|
6640
6663
|
}), h = Ro(f, {
|
|
6641
6664
|
enabled: n == null
|
|
6642
|
-
}), b =
|
|
6665
|
+
}), b = Mo(f), w = Io(f, { role: "tooltip" }), g = Lo([p, h, b, w]);
|
|
6643
6666
|
return ge.useMemo(
|
|
6644
6667
|
() => ({
|
|
6645
6668
|
open: c,
|
|
@@ -6668,7 +6691,7 @@ function Tt({ children: t, ...e }) {
|
|
|
6668
6691
|
}
|
|
6669
6692
|
) : /* @__PURE__ */ i.jsx(Jt.Provider, { value: n, children: t });
|
|
6670
6693
|
}
|
|
6671
|
-
const
|
|
6694
|
+
const St = ge.forwardRef(function({ children: e, asChild: n = !1, ...r }, s) {
|
|
6672
6695
|
const o = jr(), a = ge.isValidElement(e) ? parseInt(ge.version, 10) >= 19 ? (
|
|
6673
6696
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6674
6697
|
e.props.ref
|
|
@@ -6699,7 +6722,7 @@ const _t = ge.forwardRef(function({ children: e, asChild: n = !1, ...r }, s) {
|
|
|
6699
6722
|
children: e
|
|
6700
6723
|
}
|
|
6701
6724
|
);
|
|
6702
|
-
}),
|
|
6725
|
+
}), _t = ge.forwardRef(function({ style: e, children: n, portal: r = !0, portalProps: s = {}, ...o }, a) {
|
|
6703
6726
|
const l = jr(), c = tr([l.refs.setFloating, a]);
|
|
6704
6727
|
if (!l.open) return null;
|
|
6705
6728
|
const d = /* @__PURE__ */ i.jsx(
|
|
@@ -6718,9 +6741,9 @@ const _t = ge.forwardRef(function({ children: e, asChild: n = !1, ...r }, s) {
|
|
|
6718
6741
|
return r ? /* @__PURE__ */ i.jsx(No, { ...s, children: d }) : d;
|
|
6719
6742
|
});
|
|
6720
6743
|
Tt.displayName = "Tooltip";
|
|
6721
|
-
|
|
6722
|
-
|
|
6723
|
-
const
|
|
6744
|
+
St.displayName = "TooltipTrigger";
|
|
6745
|
+
_t.displayName = "TooltipContent";
|
|
6746
|
+
const I = ({
|
|
6724
6747
|
onClick: t,
|
|
6725
6748
|
isActive: e = !1,
|
|
6726
6749
|
children: n,
|
|
@@ -6739,8 +6762,8 @@ const M = ({
|
|
|
6739
6762
|
}
|
|
6740
6763
|
);
|
|
6741
6764
|
return r ? /* @__PURE__ */ i.jsxs(Tt, { delay: 500, closeDelay: 0, children: [
|
|
6742
|
-
/* @__PURE__ */ i.jsx(
|
|
6743
|
-
/* @__PURE__ */ i.jsx(
|
|
6765
|
+
/* @__PURE__ */ i.jsx(St, { asChild: !0, children: o }),
|
|
6766
|
+
/* @__PURE__ */ i.jsx(_t, { children: r })
|
|
6744
6767
|
] }) : o;
|
|
6745
6768
|
}, Ti = ({ onColorChange: t }) => {
|
|
6746
6769
|
const e = [
|
|
@@ -6757,7 +6780,7 @@ const M = ({
|
|
|
6757
6780
|
"#cf5148"
|
|
6758
6781
|
];
|
|
6759
6782
|
return /* @__PURE__ */ i.jsx("div", { className: "flex flex-wrap gap-1 w-32", children: e.map((n) => /* @__PURE__ */ i.jsxs(Tt, { delay: 300, closeDelay: 0, children: [
|
|
6760
|
-
/* @__PURE__ */ i.jsx(
|
|
6783
|
+
/* @__PURE__ */ i.jsx(St, { asChild: !0, children: /* @__PURE__ */ i.jsx(
|
|
6761
6784
|
"button",
|
|
6762
6785
|
{
|
|
6763
6786
|
type: "button",
|
|
@@ -6766,12 +6789,12 @@ const M = ({
|
|
|
6766
6789
|
onClick: () => t(n)
|
|
6767
6790
|
}
|
|
6768
6791
|
) }),
|
|
6769
|
-
/* @__PURE__ */ i.jsxs(
|
|
6792
|
+
/* @__PURE__ */ i.jsxs(_t, { children: [
|
|
6770
6793
|
"Set color to ",
|
|
6771
6794
|
n
|
|
6772
6795
|
] })
|
|
6773
6796
|
] }, n)) });
|
|
6774
|
-
},
|
|
6797
|
+
}, Si = ({ onColorChange: t }) => {
|
|
6775
6798
|
const e = [
|
|
6776
6799
|
"#B0B0B0",
|
|
6777
6800
|
"#F2F0EF",
|
|
@@ -6786,7 +6809,7 @@ const M = ({
|
|
|
6786
6809
|
"#f8d0cb"
|
|
6787
6810
|
];
|
|
6788
6811
|
return /* @__PURE__ */ i.jsx("div", { className: "flex flex-wrap gap-1 w-32", children: e.map((n) => /* @__PURE__ */ i.jsxs(Tt, { delay: 300, closeDelay: 0, children: [
|
|
6789
|
-
/* @__PURE__ */ i.jsx(
|
|
6812
|
+
/* @__PURE__ */ i.jsx(St, { asChild: !0, children: /* @__PURE__ */ i.jsx(
|
|
6790
6813
|
"button",
|
|
6791
6814
|
{
|
|
6792
6815
|
type: "button",
|
|
@@ -6795,12 +6818,12 @@ const M = ({
|
|
|
6795
6818
|
onClick: () => t(n)
|
|
6796
6819
|
}
|
|
6797
6820
|
) }),
|
|
6798
|
-
/* @__PURE__ */ i.jsxs(
|
|
6821
|
+
/* @__PURE__ */ i.jsxs(_t, { children: [
|
|
6799
6822
|
"Set background color to ",
|
|
6800
6823
|
n
|
|
6801
6824
|
] })
|
|
6802
6825
|
] }, n)) });
|
|
6803
|
-
},
|
|
6826
|
+
}, _i = ({
|
|
6804
6827
|
editor: t,
|
|
6805
6828
|
isReadOnly: e,
|
|
6806
6829
|
onImageUpload: n,
|
|
@@ -6818,20 +6841,20 @@ const M = ({
|
|
|
6818
6841
|
videoUrl: b,
|
|
6819
6842
|
setVideoUrl: w,
|
|
6820
6843
|
handleVideoUrlInsert: g,
|
|
6821
|
-
videoUploadFunction:
|
|
6844
|
+
videoUploadFunction: S
|
|
6822
6845
|
}) => {
|
|
6823
|
-
const [N,
|
|
6846
|
+
const [N, x] = P(!1), T = _e(null);
|
|
6824
6847
|
return Y(() => {
|
|
6825
|
-
const
|
|
6826
|
-
T.current && !T.current.contains(
|
|
6848
|
+
const y = (_) => {
|
|
6849
|
+
T.current && !T.current.contains(_.target) && x(!1);
|
|
6827
6850
|
};
|
|
6828
|
-
return N && document.addEventListener("mousedown",
|
|
6829
|
-
document.removeEventListener("mousedown",
|
|
6851
|
+
return N && document.addEventListener("mousedown", y), () => {
|
|
6852
|
+
document.removeEventListener("mousedown", y);
|
|
6830
6853
|
};
|
|
6831
6854
|
}, [N]), e ? null : /* @__PURE__ */ i.jsxs("div", { className: "sticky top-0 z-40 border border-gray-300 mb-10 p-4 bg-gray-50/95 flex flex-wrap gap-2 shadow-sm backdrop-blur-sm", children: [
|
|
6832
6855
|
/* @__PURE__ */ i.jsxs("div", { className: "flex gap-1 border-r border-gray-300 pr-2", children: [
|
|
6833
6856
|
/* @__PURE__ */ i.jsx(
|
|
6834
|
-
|
|
6857
|
+
I,
|
|
6835
6858
|
{
|
|
6836
6859
|
onClick: () => t.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
6837
6860
|
isActive: t.isActive("heading", { level: 1 }),
|
|
@@ -6840,7 +6863,7 @@ const M = ({
|
|
|
6840
6863
|
}
|
|
6841
6864
|
),
|
|
6842
6865
|
/* @__PURE__ */ i.jsx(
|
|
6843
|
-
|
|
6866
|
+
I,
|
|
6844
6867
|
{
|
|
6845
6868
|
onClick: () => t.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
6846
6869
|
isActive: t.isActive("heading", { level: 2 }),
|
|
@@ -6849,7 +6872,7 @@ const M = ({
|
|
|
6849
6872
|
}
|
|
6850
6873
|
),
|
|
6851
6874
|
/* @__PURE__ */ i.jsx(
|
|
6852
|
-
|
|
6875
|
+
I,
|
|
6853
6876
|
{
|
|
6854
6877
|
onClick: () => t.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
6855
6878
|
isActive: t.isActive("heading", { level: 3 }),
|
|
@@ -6858,7 +6881,7 @@ const M = ({
|
|
|
6858
6881
|
}
|
|
6859
6882
|
),
|
|
6860
6883
|
/* @__PURE__ */ i.jsx(
|
|
6861
|
-
|
|
6884
|
+
I,
|
|
6862
6885
|
{
|
|
6863
6886
|
onClick: () => t.chain().focus().toggleHeading({ level: 4 }).run(),
|
|
6864
6887
|
isActive: t.isActive("heading", { level: 4 }),
|
|
@@ -6867,7 +6890,7 @@ const M = ({
|
|
|
6867
6890
|
}
|
|
6868
6891
|
),
|
|
6869
6892
|
/* @__PURE__ */ i.jsx(
|
|
6870
|
-
|
|
6893
|
+
I,
|
|
6871
6894
|
{
|
|
6872
6895
|
onClick: () => t.chain().focus().setParagraph().run(),
|
|
6873
6896
|
isActive: t.isActive("paragraph"),
|
|
@@ -6878,7 +6901,7 @@ const M = ({
|
|
|
6878
6901
|
] }),
|
|
6879
6902
|
/* @__PURE__ */ i.jsxs("div", { className: "flex gap-1 border-r border-gray-300 pr-2", children: [
|
|
6880
6903
|
/* @__PURE__ */ i.jsx(
|
|
6881
|
-
|
|
6904
|
+
I,
|
|
6882
6905
|
{
|
|
6883
6906
|
onClick: () => t.chain().focus().toggleBulletList().run(),
|
|
6884
6907
|
isActive: t.isActive("bulletList"),
|
|
@@ -6887,7 +6910,7 @@ const M = ({
|
|
|
6887
6910
|
}
|
|
6888
6911
|
),
|
|
6889
6912
|
/* @__PURE__ */ i.jsx(
|
|
6890
|
-
|
|
6913
|
+
I,
|
|
6891
6914
|
{
|
|
6892
6915
|
onClick: () => t.chain().focus().toggleOrderedList().run(),
|
|
6893
6916
|
isActive: t.isActive("orderedList"),
|
|
@@ -6897,7 +6920,7 @@ const M = ({
|
|
|
6897
6920
|
)
|
|
6898
6921
|
] }),
|
|
6899
6922
|
/* @__PURE__ */ i.jsx("div", { className: "flex gap-1 border-r border-gray-300 pr-2", children: /* @__PURE__ */ i.jsx(
|
|
6900
|
-
|
|
6923
|
+
I,
|
|
6901
6924
|
{
|
|
6902
6925
|
onClick: () => t.chain().focus().insertTable({ rows: 3, cols: 3, withHeaderRow: !0 }).run(),
|
|
6903
6926
|
title: "Insert Table (3x3)",
|
|
@@ -6906,7 +6929,7 @@ const M = ({
|
|
|
6906
6929
|
) }),
|
|
6907
6930
|
/* @__PURE__ */ i.jsxs("div", { className: "flex gap-1 border-r border-gray-300 pr-2", children: [
|
|
6908
6931
|
/* @__PURE__ */ i.jsx(
|
|
6909
|
-
|
|
6932
|
+
I,
|
|
6910
6933
|
{
|
|
6911
6934
|
onClick: () => t.chain().focus().toggleBlockquote().run(),
|
|
6912
6935
|
isActive: t.isActive("blockquote"),
|
|
@@ -6915,7 +6938,7 @@ const M = ({
|
|
|
6915
6938
|
}
|
|
6916
6939
|
),
|
|
6917
6940
|
/* @__PURE__ */ i.jsx(
|
|
6918
|
-
|
|
6941
|
+
I,
|
|
6919
6942
|
{
|
|
6920
6943
|
onClick: () => t.chain().focus().setHorizontalRule().run(),
|
|
6921
6944
|
title: "Horizontal Rule",
|
|
@@ -6926,7 +6949,7 @@ const M = ({
|
|
|
6926
6949
|
/* @__PURE__ */ i.jsxs("div", { className: "flex gap-1 border-r border-gray-300 pr-2", children: [
|
|
6927
6950
|
/* @__PURE__ */ i.jsxs("div", { className: "relative", children: [
|
|
6928
6951
|
/* @__PURE__ */ i.jsx(
|
|
6929
|
-
|
|
6952
|
+
I,
|
|
6930
6953
|
{
|
|
6931
6954
|
onClick: () => l(!a),
|
|
6932
6955
|
title: "Insert Image",
|
|
@@ -6961,12 +6984,12 @@ const M = ({
|
|
|
6961
6984
|
{
|
|
6962
6985
|
type: "url",
|
|
6963
6986
|
value: c,
|
|
6964
|
-
onChange: (
|
|
6987
|
+
onChange: (y) => d(y.target.value),
|
|
6965
6988
|
placeholder: "https://example.com/image.jpg",
|
|
6966
6989
|
className: `flex-1 px-3 py-2 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 ${s ? "opacity-50 cursor-not-allowed" : ""}`,
|
|
6967
6990
|
disabled: s,
|
|
6968
|
-
onKeyDown: (
|
|
6969
|
-
|
|
6991
|
+
onKeyDown: (y) => {
|
|
6992
|
+
y.key === "Enter" && u();
|
|
6970
6993
|
}
|
|
6971
6994
|
}
|
|
6972
6995
|
),
|
|
@@ -6990,10 +7013,10 @@ const M = ({
|
|
|
6990
7013
|
src: c.trim(),
|
|
6991
7014
|
alt: "Preview",
|
|
6992
7015
|
className: "max-w-full h-auto max-h-32 rounded border",
|
|
6993
|
-
onError: (
|
|
6994
|
-
const
|
|
6995
|
-
|
|
6996
|
-
const A =
|
|
7016
|
+
onError: (y) => {
|
|
7017
|
+
const _ = y.currentTarget;
|
|
7018
|
+
_.style.display = "none";
|
|
7019
|
+
const A = _.nextElementSibling;
|
|
6997
7020
|
A && (A.style.display = "block");
|
|
6998
7021
|
}
|
|
6999
7022
|
}
|
|
@@ -7030,7 +7053,7 @@ const M = ({
|
|
|
7030
7053
|
] }),
|
|
7031
7054
|
/* @__PURE__ */ i.jsxs("div", { className: "relative", children: [
|
|
7032
7055
|
/* @__PURE__ */ i.jsx(
|
|
7033
|
-
|
|
7056
|
+
I,
|
|
7034
7057
|
{
|
|
7035
7058
|
onClick: () => h(!p),
|
|
7036
7059
|
title: "Insert Video",
|
|
@@ -7065,12 +7088,12 @@ const M = ({
|
|
|
7065
7088
|
{
|
|
7066
7089
|
type: "url",
|
|
7067
7090
|
value: b,
|
|
7068
|
-
onChange: (
|
|
7091
|
+
onChange: (y) => w(y.target.value),
|
|
7069
7092
|
placeholder: "https://youtube.com/watch?v=… or .mp4",
|
|
7070
7093
|
className: `flex-1 px-3 py-2 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 ${o ? "opacity-50 cursor-not-allowed" : ""}`,
|
|
7071
7094
|
disabled: o,
|
|
7072
|
-
onKeyDown: (
|
|
7073
|
-
|
|
7095
|
+
onKeyDown: (y) => {
|
|
7096
|
+
y.key === "Enter" && g();
|
|
7074
7097
|
}
|
|
7075
7098
|
}
|
|
7076
7099
|
),
|
|
@@ -7121,10 +7144,10 @@ const M = ({
|
|
|
7121
7144
|
children: o ? /* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7122
7145
|
/* @__PURE__ */ i.jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600" }),
|
|
7123
7146
|
/* @__PURE__ */ i.jsx("span", { children: "Uploading..." })
|
|
7124
|
-
] }) :
|
|
7147
|
+
] }) : S ? "Choose File" : "Choose File (Base64)"
|
|
7125
7148
|
}
|
|
7126
7149
|
),
|
|
7127
|
-
!
|
|
7150
|
+
!S && /* @__PURE__ */ i.jsx("p", { className: "text-xs text-gray-500 mt-1", children: "No upload service provided — files embed as Base64." })
|
|
7128
7151
|
] })
|
|
7129
7152
|
] })
|
|
7130
7153
|
}
|
|
@@ -7133,7 +7156,7 @@ const M = ({
|
|
|
7133
7156
|
] }),
|
|
7134
7157
|
/* @__PURE__ */ i.jsxs("div", { className: "flex gap-1 border-r border-gray-300 pr-2", children: [
|
|
7135
7158
|
/* @__PURE__ */ i.jsx(
|
|
7136
|
-
|
|
7159
|
+
I,
|
|
7137
7160
|
{
|
|
7138
7161
|
onClick: () => t.chain().focus().toggleCodeBlock().run(),
|
|
7139
7162
|
isActive: t.isActive("codeBlock"),
|
|
@@ -7142,7 +7165,7 @@ const M = ({
|
|
|
7142
7165
|
}
|
|
7143
7166
|
),
|
|
7144
7167
|
/* @__PURE__ */ i.jsx(
|
|
7145
|
-
|
|
7168
|
+
I,
|
|
7146
7169
|
{
|
|
7147
7170
|
onClick: () => t.chain().focus().insertAccordion().run(),
|
|
7148
7171
|
title: "Insert Accordion",
|
|
@@ -7152,7 +7175,7 @@ const M = ({
|
|
|
7152
7175
|
] }),
|
|
7153
7176
|
/* @__PURE__ */ i.jsxs("div", { className: "flex gap-1 border-r border-gray-300 pr-2", children: [
|
|
7154
7177
|
/* @__PURE__ */ i.jsx(
|
|
7155
|
-
|
|
7178
|
+
I,
|
|
7156
7179
|
{
|
|
7157
7180
|
onClick: () => t.chain().focus().insertTabs({ tabCount: 2 }).run(),
|
|
7158
7181
|
title: "Insert 2 Tabs",
|
|
@@ -7161,9 +7184,9 @@ const M = ({
|
|
|
7161
7184
|
),
|
|
7162
7185
|
/* @__PURE__ */ i.jsxs("div", { className: "relative w-full", ref: T, children: [
|
|
7163
7186
|
/* @__PURE__ */ i.jsx(
|
|
7164
|
-
|
|
7187
|
+
I,
|
|
7165
7188
|
{
|
|
7166
|
-
onClick: () =>
|
|
7189
|
+
onClick: () => x(!N),
|
|
7167
7190
|
title: "Insert Tabs",
|
|
7168
7191
|
className: "w-full px-2",
|
|
7169
7192
|
children: /* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-1 w-full justify-between", children: [
|
|
@@ -7180,7 +7203,7 @@ const M = ({
|
|
|
7180
7203
|
variant: "ghost",
|
|
7181
7204
|
size: "sm",
|
|
7182
7205
|
onClick: () => {
|
|
7183
|
-
t.chain().focus().insertTabs({ tabCount: 3 }).run(),
|
|
7206
|
+
t.chain().focus().insertTabs({ tabCount: 3 }).run(), x(!1);
|
|
7184
7207
|
},
|
|
7185
7208
|
className: "w-full justify-start text-xs font-mono hover:bg-gray-100",
|
|
7186
7209
|
children: "3 Tabs"
|
|
@@ -7193,7 +7216,7 @@ const M = ({
|
|
|
7193
7216
|
variant: "ghost",
|
|
7194
7217
|
size: "sm",
|
|
7195
7218
|
onClick: () => {
|
|
7196
|
-
t.chain().focus().insertTabs({ tabCount: 4 }).run(),
|
|
7219
|
+
t.chain().focus().insertTabs({ tabCount: 4 }).run(), x(!1);
|
|
7197
7220
|
},
|
|
7198
7221
|
className: "w-full justify-start text-xs font-mono hover:bg-gray-100",
|
|
7199
7222
|
children: "4 Tabs"
|
|
@@ -7206,7 +7229,7 @@ const M = ({
|
|
|
7206
7229
|
variant: "ghost",
|
|
7207
7230
|
size: "sm",
|
|
7208
7231
|
onClick: () => {
|
|
7209
|
-
t.chain().focus().insertTabs({ tabCount: 5 }).run(),
|
|
7232
|
+
t.chain().focus().insertTabs({ tabCount: 5 }).run(), x(!1);
|
|
7210
7233
|
},
|
|
7211
7234
|
className: "w-full justify-start text-xs font-mono hover:bg-gray-100",
|
|
7212
7235
|
children: "5 Tabs"
|
|
@@ -7219,7 +7242,7 @@ const M = ({
|
|
|
7219
7242
|
variant: "ghost",
|
|
7220
7243
|
size: "sm",
|
|
7221
7244
|
onClick: () => {
|
|
7222
|
-
t.chain().focus().insertTabs({ tabCount: 6 }).run(),
|
|
7245
|
+
t.chain().focus().insertTabs({ tabCount: 6 }).run(), x(!1);
|
|
7223
7246
|
},
|
|
7224
7247
|
className: "w-full justify-start text-xs font-mono hover:bg-gray-100",
|
|
7225
7248
|
children: "6 Tabs"
|
|
@@ -7230,15 +7253,15 @@ const M = ({
|
|
|
7230
7253
|
] }),
|
|
7231
7254
|
/* @__PURE__ */ i.jsxs("div", { className: "flex gap-1 border-r border-gray-300 pr-2", children: [
|
|
7232
7255
|
/* @__PURE__ */ i.jsx(
|
|
7233
|
-
|
|
7256
|
+
I,
|
|
7234
7257
|
{
|
|
7235
7258
|
onClick: () => {
|
|
7236
|
-
const
|
|
7259
|
+
const y = prompt(
|
|
7237
7260
|
"Enter the URL for your iframe:",
|
|
7238
7261
|
"https://example.com/embed"
|
|
7239
7262
|
);
|
|
7240
|
-
|
|
7241
|
-
src:
|
|
7263
|
+
y && t.chain().focus().insertIframe({
|
|
7264
|
+
src: y,
|
|
7242
7265
|
width: "100%",
|
|
7243
7266
|
height: "500px",
|
|
7244
7267
|
title: "Embedded Content"
|
|
@@ -7249,7 +7272,7 @@ const M = ({
|
|
|
7249
7272
|
}
|
|
7250
7273
|
),
|
|
7251
7274
|
/* @__PURE__ */ i.jsx(
|
|
7252
|
-
|
|
7275
|
+
I,
|
|
7253
7276
|
{
|
|
7254
7277
|
onClick: () => {
|
|
7255
7278
|
t.chain().focus().insertLivePreview({ pendingEdit: !0 }).run();
|
|
@@ -7260,7 +7283,7 @@ const M = ({
|
|
|
7260
7283
|
)
|
|
7261
7284
|
] }),
|
|
7262
7285
|
/* @__PURE__ */ i.jsx("div", { className: "flex gap-1 border-r border-gray-300 pr-2", children: /* @__PURE__ */ i.jsx(
|
|
7263
|
-
|
|
7286
|
+
I,
|
|
7264
7287
|
{
|
|
7265
7288
|
onClick: () => t.chain().focus().insertColumnLayout({ columns: 2 }).run(),
|
|
7266
7289
|
title: "Insert 2 Column Layout",
|
|
@@ -7268,7 +7291,7 @@ const M = ({
|
|
|
7268
7291
|
}
|
|
7269
7292
|
) })
|
|
7270
7293
|
] });
|
|
7271
|
-
}, Dr = ["top", "right", "bottom", "left"], gn = ["start", "end"], bn = /* @__PURE__ */ Dr.reduce((t, e) => t.concat(e, e + "-" + gn[0], e + "-" + gn[1]), []),
|
|
7294
|
+
}, Dr = ["top", "right", "bottom", "left"], gn = ["start", "end"], bn = /* @__PURE__ */ Dr.reduce((t, e) => t.concat(e, e + "-" + gn[0], e + "-" + gn[1]), []), xe = Math.min, ee = Math.max, yt = Math.round, we = (t) => ({
|
|
7272
7295
|
x: t,
|
|
7273
7296
|
y: t
|
|
7274
7297
|
}), ki = {
|
|
@@ -7281,7 +7304,7 @@ const M = ({
|
|
|
7281
7304
|
end: "start"
|
|
7282
7305
|
};
|
|
7283
7306
|
function Wt(t, e, n) {
|
|
7284
|
-
return ee(t,
|
|
7307
|
+
return ee(t, xe(e, n));
|
|
7285
7308
|
}
|
|
7286
7309
|
function Ae(t, e) {
|
|
7287
7310
|
return typeof t == "function" ? t(e) : t;
|
|
@@ -7313,20 +7336,20 @@ function Br(t, e, n) {
|
|
|
7313
7336
|
}
|
|
7314
7337
|
function Ri(t) {
|
|
7315
7338
|
const e = vt(t);
|
|
7316
|
-
return [
|
|
7339
|
+
return [xt(t), e, xt(e)];
|
|
7317
7340
|
}
|
|
7318
|
-
function
|
|
7341
|
+
function xt(t) {
|
|
7319
7342
|
return t.replace(/start|end/g, (e) => Ai[e]);
|
|
7320
7343
|
}
|
|
7321
|
-
const wn = ["left", "right"],
|
|
7344
|
+
const wn = ["left", "right"], yn = ["right", "left"], Mi = ["top", "bottom"], Ii = ["bottom", "top"];
|
|
7322
7345
|
function Li(t, e, n) {
|
|
7323
7346
|
switch (t) {
|
|
7324
7347
|
case "top":
|
|
7325
7348
|
case "bottom":
|
|
7326
|
-
return n ? e ?
|
|
7349
|
+
return n ? e ? yn : wn : e ? wn : yn;
|
|
7327
7350
|
case "left":
|
|
7328
7351
|
case "right":
|
|
7329
|
-
return e ?
|
|
7352
|
+
return e ? Mi : Ii;
|
|
7330
7353
|
default:
|
|
7331
7354
|
return [];
|
|
7332
7355
|
}
|
|
@@ -7334,7 +7357,7 @@ function Li(t, e, n) {
|
|
|
7334
7357
|
function ji(t, e, n, r) {
|
|
7335
7358
|
const s = ue(t);
|
|
7336
7359
|
let o = Li(le(t), n === "start", r);
|
|
7337
|
-
return s && (o = o.map((a) => a + "-" + s), e && (o = o.concat(o.map(
|
|
7360
|
+
return s && (o = o.map((a) => a + "-" + s), e && (o = o.concat(o.map(xt)))), o;
|
|
7338
7361
|
}
|
|
7339
7362
|
function vt(t) {
|
|
7340
7363
|
return t.replace(/left|right|bottom|top/g, (e) => ki[e]);
|
|
@@ -7374,7 +7397,7 @@ function He(t) {
|
|
|
7374
7397
|
y: n
|
|
7375
7398
|
};
|
|
7376
7399
|
}
|
|
7377
|
-
function
|
|
7400
|
+
function xn(t, e, n) {
|
|
7378
7401
|
let {
|
|
7379
7402
|
reference: r,
|
|
7380
7403
|
floating: s
|
|
@@ -7436,17 +7459,17 @@ const Pi = async (t, e, n) => {
|
|
|
7436
7459
|
}), {
|
|
7437
7460
|
x: u,
|
|
7438
7461
|
y: f
|
|
7439
|
-
} =
|
|
7462
|
+
} = xn(d, r, c), p = r, h = {}, b = 0;
|
|
7440
7463
|
for (let w = 0; w < l.length; w++) {
|
|
7441
7464
|
const {
|
|
7442
7465
|
name: g,
|
|
7443
|
-
fn:
|
|
7466
|
+
fn: S
|
|
7444
7467
|
} = l[w], {
|
|
7445
7468
|
x: N,
|
|
7446
|
-
y,
|
|
7469
|
+
y: x,
|
|
7447
7470
|
data: T,
|
|
7448
|
-
reset:
|
|
7449
|
-
} = await
|
|
7471
|
+
reset: y
|
|
7472
|
+
} = await S({
|
|
7450
7473
|
x: u,
|
|
7451
7474
|
y: f,
|
|
7452
7475
|
initialPlacement: r,
|
|
@@ -7460,20 +7483,20 @@ const Pi = async (t, e, n) => {
|
|
|
7460
7483
|
floating: e
|
|
7461
7484
|
}
|
|
7462
7485
|
});
|
|
7463
|
-
u = N ?? u, f =
|
|
7486
|
+
u = N ?? u, f = x ?? f, h = {
|
|
7464
7487
|
...h,
|
|
7465
7488
|
[g]: {
|
|
7466
7489
|
...h[g],
|
|
7467
7490
|
...T
|
|
7468
7491
|
}
|
|
7469
|
-
},
|
|
7492
|
+
}, y && b <= 50 && (b++, typeof y == "object" && (y.placement && (p = y.placement), y.rects && (d = y.rects === !0 ? await a.getElementRects({
|
|
7470
7493
|
reference: t,
|
|
7471
7494
|
floating: e,
|
|
7472
7495
|
strategy: s
|
|
7473
|
-
}) :
|
|
7496
|
+
}) : y.rects), {
|
|
7474
7497
|
x: u,
|
|
7475
7498
|
y: f
|
|
7476
|
-
} =
|
|
7499
|
+
} = xn(d, p, c)), w = -1);
|
|
7477
7500
|
}
|
|
7478
7501
|
return {
|
|
7479
7502
|
x: u,
|
|
@@ -7499,7 +7522,7 @@ async function $e(t, e) {
|
|
|
7499
7522
|
elementContext: f = "floating",
|
|
7500
7523
|
altBoundary: p = !1,
|
|
7501
7524
|
padding: h = 0
|
|
7502
|
-
} = Ae(e, t), b = en(h), g = l[p ? f === "floating" ? "reference" : "floating" : f],
|
|
7525
|
+
} = Ae(e, t), b = en(h), g = l[p ? f === "floating" ? "reference" : "floating" : f], S = He(await o.getClippingRect({
|
|
7503
7526
|
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)),
|
|
7504
7527
|
boundary: d,
|
|
7505
7528
|
rootBoundary: u,
|
|
@@ -7509,23 +7532,23 @@ async function $e(t, e) {
|
|
|
7509
7532
|
y: s,
|
|
7510
7533
|
width: a.floating.width,
|
|
7511
7534
|
height: a.floating.height
|
|
7512
|
-
} : a.reference,
|
|
7535
|
+
} : a.reference, x = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l.floating)), T = await (o.isElement == null ? void 0 : o.isElement(x)) ? await (o.getScale == null ? void 0 : o.getScale(x)) || {
|
|
7513
7536
|
x: 1,
|
|
7514
7537
|
y: 1
|
|
7515
7538
|
} : {
|
|
7516
7539
|
x: 1,
|
|
7517
7540
|
y: 1
|
|
7518
|
-
},
|
|
7541
|
+
}, y = He(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
7519
7542
|
elements: l,
|
|
7520
7543
|
rect: N,
|
|
7521
|
-
offsetParent:
|
|
7544
|
+
offsetParent: x,
|
|
7522
7545
|
strategy: c
|
|
7523
7546
|
}) : N);
|
|
7524
7547
|
return {
|
|
7525
|
-
top: (
|
|
7526
|
-
bottom: (
|
|
7527
|
-
left: (
|
|
7528
|
-
right: (
|
|
7548
|
+
top: (S.top - y.top + b.top) / T.y,
|
|
7549
|
+
bottom: (y.bottom - S.bottom + b.bottom) / T.y,
|
|
7550
|
+
left: (S.left - y.left + b.left) / T.x,
|
|
7551
|
+
right: (y.right - S.right + b.right) / T.x
|
|
7529
7552
|
};
|
|
7530
7553
|
}
|
|
7531
7554
|
const Bi = (t) => ({
|
|
@@ -7549,10 +7572,10 @@ const Bi = (t) => ({
|
|
|
7549
7572
|
const f = en(u), p = {
|
|
7550
7573
|
x: n,
|
|
7551
7574
|
y: r
|
|
7552
|
-
}, h = Qt(s), b = Xt(h), w = await a.getDimensions(d), g = h === "y",
|
|
7553
|
-
let A =
|
|
7554
|
-
(!A || !await (a.isElement == null ? void 0 : a.isElement(
|
|
7555
|
-
const B = T / 2 -
|
|
7575
|
+
}, h = Qt(s), b = Xt(h), w = await a.getDimensions(d), g = h === "y", S = 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], _ = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(d));
|
|
7576
|
+
let A = _ ? _[x] : 0;
|
|
7577
|
+
(!A || !await (a.isElement == null ? void 0 : a.isElement(_))) && (A = l.floating[x] || o.floating[b]);
|
|
7578
|
+
const B = T / 2 - y / 2, L = A / 2 - w[b] / 2 - 1, C = xe(f[S], L), M = xe(f[N], L), v = C, z = A - w[b] - M, j = A / 2 - w[b] / 2 + B, K = Wt(v, j, z), J = !c.arrow && ue(s) != null && j !== K && o.reference[b] / 2 - (j < v ? C : M) - w[b] / 2 < 0, W = J ? j < v ? j - v : j - z : 0;
|
|
7556
7579
|
return {
|
|
7557
7580
|
[h]: p[h] + W,
|
|
7558
7581
|
data: {
|
|
@@ -7567,7 +7590,7 @@ const Bi = (t) => ({
|
|
|
7567
7590
|
}
|
|
7568
7591
|
});
|
|
7569
7592
|
function zi(t, e, n) {
|
|
7570
|
-
return (t ? [...n.filter((s) => ue(s) === t), ...n.filter((s) => ue(s) !== t)] : n.filter((s) => le(s) === s)).filter((s) => t ? ue(s) === t || (e ?
|
|
7593
|
+
return (t ? [...n.filter((s) => ue(s) === t), ...n.filter((s) => ue(s) !== t)] : n.filter((s) => le(s) === s)).filter((s) => t ? ue(s) === t || (e ? xt(s) !== s : !1) : !0);
|
|
7571
7594
|
}
|
|
7572
7595
|
const Ui = function(t) {
|
|
7573
7596
|
return t === void 0 && (t = {}), {
|
|
@@ -7587,49 +7610,49 @@ const Ui = function(t) {
|
|
|
7587
7610
|
allowedPlacements: p = bn,
|
|
7588
7611
|
autoAlignment: h = !0,
|
|
7589
7612
|
...b
|
|
7590
|
-
} = Ae(t, e), w = f !== void 0 || p === bn ? zi(f || null, h, p) : p, g = await $e(e, b),
|
|
7613
|
+
} = Ae(t, e), w = f !== void 0 || p === bn ? zi(f || null, h, p) : p, g = await $e(e, b), S = ((n = a.autoPlacement) == null ? void 0 : n.index) || 0, N = w[S];
|
|
7591
7614
|
if (N == null)
|
|
7592
7615
|
return {};
|
|
7593
|
-
const
|
|
7616
|
+
const x = Br(N, o, await (c.isRTL == null ? void 0 : c.isRTL(d.floating)));
|
|
7594
7617
|
if (l !== N)
|
|
7595
7618
|
return {
|
|
7596
7619
|
reset: {
|
|
7597
7620
|
placement: w[0]
|
|
7598
7621
|
}
|
|
7599
7622
|
};
|
|
7600
|
-
const T = [g[le(N)], g[
|
|
7623
|
+
const T = [g[le(N)], g[x[0]], g[x[1]]], y = [...((r = a.autoPlacement) == null ? void 0 : r.overflows) || [], {
|
|
7601
7624
|
placement: N,
|
|
7602
7625
|
overflows: T
|
|
7603
|
-
}],
|
|
7604
|
-
if (
|
|
7626
|
+
}], _ = w[S + 1];
|
|
7627
|
+
if (_)
|
|
7605
7628
|
return {
|
|
7606
7629
|
data: {
|
|
7607
|
-
index:
|
|
7608
|
-
overflows:
|
|
7630
|
+
index: S + 1,
|
|
7631
|
+
overflows: y
|
|
7609
7632
|
},
|
|
7610
7633
|
reset: {
|
|
7611
|
-
placement:
|
|
7634
|
+
placement: _
|
|
7612
7635
|
}
|
|
7613
7636
|
};
|
|
7614
|
-
const A =
|
|
7615
|
-
const
|
|
7616
|
-
return [C.placement,
|
|
7637
|
+
const A = y.map((C) => {
|
|
7638
|
+
const M = ue(C.placement);
|
|
7639
|
+
return [C.placement, M && u ? (
|
|
7617
7640
|
// Check along the mainAxis and main crossAxis side.
|
|
7618
7641
|
C.overflows.slice(0, 2).reduce((v, z) => v + z, 0)
|
|
7619
7642
|
) : (
|
|
7620
7643
|
// Check only the mainAxis.
|
|
7621
7644
|
C.overflows[0]
|
|
7622
7645
|
), C.overflows];
|
|
7623
|
-
}).sort((C,
|
|
7646
|
+
}).sort((C, M) => C[1] - M[1]), L = ((s = A.filter((C) => C[2].slice(
|
|
7624
7647
|
0,
|
|
7625
7648
|
// Aligned placements should not check their opposite crossAxis
|
|
7626
7649
|
// side.
|
|
7627
7650
|
ue(C[0]) ? 2 : 3
|
|
7628
|
-
).every((
|
|
7651
|
+
).every((M) => M <= 0))[0]) == null ? void 0 : s[0]) || A[0][0];
|
|
7629
7652
|
return L !== l ? {
|
|
7630
7653
|
data: {
|
|
7631
|
-
index:
|
|
7632
|
-
overflows:
|
|
7654
|
+
index: S + 1,
|
|
7655
|
+
overflows: y
|
|
7633
7656
|
},
|
|
7634
7657
|
reset: {
|
|
7635
7658
|
placement: L
|
|
@@ -7661,11 +7684,11 @@ const Ui = function(t) {
|
|
|
7661
7684
|
} = Ae(t, e);
|
|
7662
7685
|
if ((n = o.arrow) != null && n.alignmentOffset)
|
|
7663
7686
|
return {};
|
|
7664
|
-
const
|
|
7665
|
-
!p &&
|
|
7666
|
-
const A = [l, ...
|
|
7687
|
+
const S = 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)), _ = b !== "none";
|
|
7688
|
+
!p && _ && y.push(...ji(l, w, b, T));
|
|
7689
|
+
const A = [l, ...y], B = await $e(e, g), L = [];
|
|
7667
7690
|
let C = ((r = o.flip) == null ? void 0 : r.overflows) || [];
|
|
7668
|
-
if (u && L.push(B[
|
|
7691
|
+
if (u && L.push(B[S]), f) {
|
|
7669
7692
|
const j = Br(s, a, T);
|
|
7670
7693
|
L.push(B[j[0]], B[j[1]]);
|
|
7671
7694
|
}
|
|
@@ -7673,8 +7696,8 @@ const Ui = function(t) {
|
|
|
7673
7696
|
placement: s,
|
|
7674
7697
|
overflows: L
|
|
7675
7698
|
}], !L.every((j) => j <= 0)) {
|
|
7676
|
-
var
|
|
7677
|
-
const j = (((
|
|
7699
|
+
var M, v;
|
|
7700
|
+
const j = (((M = o.flip) == null ? void 0 : M.index) || 0) + 1, K = A[j];
|
|
7678
7701
|
if (K && (!(f === "alignment" ? N !== be(K) : !1) || // We leave the current main axis only if every placement on that axis
|
|
7679
7702
|
// overflows the main axis.
|
|
7680
7703
|
C.every((k) => be(k.placement) === N ? k.overflows[0] > 0 : !0)))
|
|
@@ -7693,7 +7716,7 @@ const Ui = function(t) {
|
|
|
7693
7716
|
case "bestFit": {
|
|
7694
7717
|
var z;
|
|
7695
7718
|
const W = (z = C.filter((k) => {
|
|
7696
|
-
if (
|
|
7719
|
+
if (_) {
|
|
7697
7720
|
const O = be(k.placement);
|
|
7698
7721
|
return O === N || // Create a bias to the `y` side axis due to horizontal
|
|
7699
7722
|
// reading directions favoring greater width.
|
|
@@ -7773,7 +7796,7 @@ const Hi = function(t) {
|
|
|
7773
7796
|
};
|
|
7774
7797
|
};
|
|
7775
7798
|
function zr(t) {
|
|
7776
|
-
const e =
|
|
7799
|
+
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));
|
|
7777
7800
|
return {
|
|
7778
7801
|
x: e,
|
|
7779
7802
|
y: n,
|
|
@@ -7811,7 +7834,7 @@ const Ki = function(t) {
|
|
|
7811
7834
|
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;
|
|
7812
7835
|
if (f.length >= 2) {
|
|
7813
7836
|
if (be(n) === "y") {
|
|
7814
|
-
const C = f[0],
|
|
7837
|
+
const C = f[0], M = f[f.length - 1], v = le(n) === "top", z = C.top, j = M.bottom, K = v ? C.left : M.left, J = v ? C.right : M.right, W = J - K, k = j - z;
|
|
7815
7838
|
return {
|
|
7816
7839
|
top: z,
|
|
7817
7840
|
bottom: j,
|
|
@@ -7823,15 +7846,15 @@ const Ki = function(t) {
|
|
|
7823
7846
|
y: z
|
|
7824
7847
|
};
|
|
7825
7848
|
}
|
|
7826
|
-
const g = le(n) === "left",
|
|
7849
|
+
const g = le(n) === "left", S = ee(...f.map((C) => C.right)), N = xe(...f.map((C) => C.left)), x = f.filter((C) => g ? C.left === N : C.right === S), T = x[0].top, y = x[x.length - 1].bottom, _ = N, A = S, B = A - _, L = y - T;
|
|
7827
7850
|
return {
|
|
7828
7851
|
top: T,
|
|
7829
|
-
bottom:
|
|
7830
|
-
left:
|
|
7852
|
+
bottom: y,
|
|
7853
|
+
left: _,
|
|
7831
7854
|
right: A,
|
|
7832
7855
|
width: B,
|
|
7833
7856
|
height: L,
|
|
7834
|
-
x:
|
|
7857
|
+
x: _,
|
|
7835
7858
|
y: T
|
|
7836
7859
|
};
|
|
7837
7860
|
}
|
|
@@ -7916,11 +7939,11 @@ const qi = function(t) {
|
|
|
7916
7939
|
limiter: l = {
|
|
7917
7940
|
fn: (g) => {
|
|
7918
7941
|
let {
|
|
7919
|
-
x:
|
|
7942
|
+
x: S,
|
|
7920
7943
|
y: N
|
|
7921
7944
|
} = g;
|
|
7922
7945
|
return {
|
|
7923
|
-
x:
|
|
7946
|
+
x: S,
|
|
7924
7947
|
y: N
|
|
7925
7948
|
};
|
|
7926
7949
|
}
|
|
@@ -7932,12 +7955,12 @@ const qi = function(t) {
|
|
|
7932
7955
|
}, u = await $e(e, c), f = be(le(s)), p = Pr(f);
|
|
7933
7956
|
let h = d[p], b = d[f];
|
|
7934
7957
|
if (o) {
|
|
7935
|
-
const g = p === "y" ? "top" : "left",
|
|
7936
|
-
h = Wt(N, h,
|
|
7958
|
+
const g = p === "y" ? "top" : "left", S = p === "y" ? "bottom" : "right", N = h + u[g], x = h - u[S];
|
|
7959
|
+
h = Wt(N, h, x);
|
|
7937
7960
|
}
|
|
7938
7961
|
if (a) {
|
|
7939
|
-
const g = f === "y" ? "top" : "left",
|
|
7940
|
-
b = Wt(N, b,
|
|
7962
|
+
const g = f === "y" ? "top" : "left", S = f === "y" ? "bottom" : "right", N = b + u[g], x = b - u[S];
|
|
7963
|
+
b = Wt(N, b, x);
|
|
7941
7964
|
}
|
|
7942
7965
|
const w = l.fn({
|
|
7943
7966
|
...e,
|
|
@@ -7976,13 +7999,13 @@ const qi = function(t) {
|
|
|
7976
7999
|
width: b,
|
|
7977
8000
|
height: w
|
|
7978
8001
|
} = o.floating;
|
|
7979
|
-
let g,
|
|
7980
|
-
f === "top" || f === "bottom" ? (g = f,
|
|
7981
|
-
const N = w - u.top - u.bottom,
|
|
7982
|
-
let A = T, B =
|
|
7983
|
-
if ((n = e.middlewareData.shift) != null && n.enabled.x && (B =
|
|
7984
|
-
const C = ee(u.left, 0),
|
|
7985
|
-
h ? B = b - 2 * (C !== 0 ||
|
|
8002
|
+
let g, S;
|
|
8003
|
+
f === "top" || f === "bottom" ? (g = f, S = p === (await (a.isRTL == null ? void 0 : a.isRTL(l.floating)) ? "start" : "end") ? "left" : "right") : (S = f, g = p === "end" ? "top" : "bottom");
|
|
8004
|
+
const N = w - u.top - u.bottom, x = b - u.left - u.right, T = xe(w - u[g], N), y = xe(b - u[S], x), _ = !e.middlewareData.shift;
|
|
8005
|
+
let A = T, B = y;
|
|
8006
|
+
if ((n = e.middlewareData.shift) != null && n.enabled.x && (B = x), (r = e.middlewareData.shift) != null && r.enabled.y && (A = N), _ && !p) {
|
|
8007
|
+
const C = ee(u.left, 0), M = ee(u.right, 0), v = ee(u.top, 0), z = ee(u.bottom, 0);
|
|
8008
|
+
h ? B = b - 2 * (C !== 0 || M !== 0 ? C + M : ee(u.left, u.right)) : A = w - 2 * (v !== 0 || z !== 0 ? v + z : ee(u.top, u.bottom));
|
|
7986
8009
|
}
|
|
7987
8010
|
await c({
|
|
7988
8011
|
...e,
|
|
@@ -8111,7 +8134,7 @@ function qt(t) {
|
|
|
8111
8134
|
function $r(t) {
|
|
8112
8135
|
const e = he(t);
|
|
8113
8136
|
let n = parseFloat(e.width) || 0, r = parseFloat(e.height) || 0;
|
|
8114
|
-
const s = ve(t), o = s ? t.offsetWidth : n, a = s ? t.offsetHeight : r, l =
|
|
8137
|
+
const s = ve(t), o = s ? t.offsetWidth : n, a = s ? t.offsetHeight : r, l = yt(n) !== o || yt(r) !== a;
|
|
8115
8138
|
return l && (n = o, r = a), {
|
|
8116
8139
|
width: n,
|
|
8117
8140
|
height: r,
|
|
@@ -8130,7 +8153,7 @@ function Ue(t) {
|
|
|
8130
8153
|
height: s,
|
|
8131
8154
|
$: o
|
|
8132
8155
|
} = $r(e);
|
|
8133
|
-
let a = (o ?
|
|
8156
|
+
let a = (o ? yt(n.width) : n.width) / r, l = (o ? yt(n.height) : n.height) / s;
|
|
8134
8157
|
return (!a || !Number.isFinite(a)) && (a = 1), (!l || !Number.isFinite(l)) && (l = 1), {
|
|
8135
8158
|
x: a,
|
|
8136
8159
|
y: l
|
|
@@ -8158,8 +8181,8 @@ function Qe(t, e, n, r) {
|
|
|
8158
8181
|
const p = se(o), h = r && fe(r) ? se(r) : r;
|
|
8159
8182
|
let b = p, w = qt(b);
|
|
8160
8183
|
for (; w && r && h !== b; ) {
|
|
8161
|
-
const g = Ue(w),
|
|
8162
|
-
c *= g.x, d *= g.y, u *= g.x, f *= g.y, c +=
|
|
8184
|
+
const g = Ue(w), S = w.getBoundingClientRect(), N = he(w), x = S.left + (w.clientLeft + parseFloat(N.paddingLeft)) * g.x, T = S.top + (w.clientTop + parseFloat(N.paddingTop)) * g.y;
|
|
8185
|
+
c *= g.x, d *= g.y, u *= g.x, f *= g.y, c += x, d += T, b = se(w), w = qt(b);
|
|
8163
8186
|
}
|
|
8164
8187
|
}
|
|
8165
8188
|
return He({
|
|
@@ -8297,7 +8320,7 @@ function ma(t) {
|
|
|
8297
8320
|
} = t;
|
|
8298
8321
|
const a = [...n === "clippingAncestors" ? At(e) ? [] : ha(e, this._c) : [].concat(n), r], l = a[0], c = a.reduce((d, u) => {
|
|
8299
8322
|
const f = Tn(e, u, s);
|
|
8300
|
-
return d.top = ee(f.top, d.top), d.right =
|
|
8323
|
+
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;
|
|
8301
8324
|
}, Tn(e, l, s));
|
|
8302
8325
|
return {
|
|
8303
8326
|
width: c.right - c.left,
|
|
@@ -8343,7 +8366,7 @@ function ga(t, e, n) {
|
|
|
8343
8366
|
function Pt(t) {
|
|
8344
8367
|
return he(t).position === "static";
|
|
8345
8368
|
}
|
|
8346
|
-
function
|
|
8369
|
+
function Sn(t, e) {
|
|
8347
8370
|
if (!ve(t) || he(t).position === "fixed")
|
|
8348
8371
|
return null;
|
|
8349
8372
|
if (e)
|
|
@@ -8364,9 +8387,9 @@ function Vr(t, e) {
|
|
|
8364
8387
|
}
|
|
8365
8388
|
return n;
|
|
8366
8389
|
}
|
|
8367
|
-
let r =
|
|
8390
|
+
let r = Sn(t, e);
|
|
8368
8391
|
for (; r && Xi(r) && Pt(r); )
|
|
8369
|
-
r =
|
|
8392
|
+
r = Sn(r, e);
|
|
8370
8393
|
return r && Ke(r) && Pt(r) && !tn(r) ? n : r || ra(t) || n;
|
|
8371
8394
|
}
|
|
8372
8395
|
const ba = async function(t) {
|
|
@@ -8384,7 +8407,7 @@ const ba = async function(t) {
|
|
|
8384
8407
|
function wa(t) {
|
|
8385
8408
|
return he(t).direction === "rtl";
|
|
8386
8409
|
}
|
|
8387
|
-
const
|
|
8410
|
+
const ya = {
|
|
8388
8411
|
convertOffsetParentRelativeRectToViewportRelativeRect: aa,
|
|
8389
8412
|
getDocumentElement: Oe,
|
|
8390
8413
|
getClippingRect: ma,
|
|
@@ -8397,7 +8420,7 @@ const xa = {
|
|
|
8397
8420
|
isRTL: wa
|
|
8398
8421
|
}, Gr = qi, Yr = Ui, Zr = Vi, Xr = Fi, Qr = Gi, es = Hi, ts = Bi, ns = Ki, rs = (t, e, n) => {
|
|
8399
8422
|
const r = /* @__PURE__ */ new Map(), s = {
|
|
8400
|
-
platform:
|
|
8423
|
+
platform: ya,
|
|
8401
8424
|
...n
|
|
8402
8425
|
}, o = {
|
|
8403
8426
|
...s.platform,
|
|
@@ -8714,7 +8737,7 @@ const Bt = { index: 0, offset: 0 };
|
|
|
8714
8737
|
function dt(t, e) {
|
|
8715
8738
|
return Bt.index = t, Bt.offset = e, Bt;
|
|
8716
8739
|
}
|
|
8717
|
-
class
|
|
8740
|
+
class xa extends Error {
|
|
8718
8741
|
}
|
|
8719
8742
|
class U {
|
|
8720
8743
|
/**
|
|
@@ -8819,7 +8842,7 @@ const ls = 65535, cs = Math.pow(2, 16);
|
|
|
8819
8842
|
function va(t, e) {
|
|
8820
8843
|
return t + e * cs;
|
|
8821
8844
|
}
|
|
8822
|
-
function
|
|
8845
|
+
function _n(t) {
|
|
8823
8846
|
return t & ls;
|
|
8824
8847
|
}
|
|
8825
8848
|
function Ea(t) {
|
|
@@ -8876,7 +8899,7 @@ class re {
|
|
|
8876
8899
|
@internal
|
|
8877
8900
|
*/
|
|
8878
8901
|
recover(e) {
|
|
8879
|
-
let n = 0, r =
|
|
8902
|
+
let n = 0, r = _n(e);
|
|
8880
8903
|
if (!this.inverted)
|
|
8881
8904
|
for (let s = 0; s < r; s++)
|
|
8882
8905
|
n += this.ranges[s * 3 + 2] - this.ranges[s * 3 + 1];
|
|
@@ -8913,7 +8936,7 @@ class re {
|
|
|
8913
8936
|
@internal
|
|
8914
8937
|
*/
|
|
8915
8938
|
touches(e, n) {
|
|
8916
|
-
let r = 0, s =
|
|
8939
|
+
let r = 0, s = _n(n), o = this.inverted ? 2 : 1, a = this.inverted ? 1 : 2;
|
|
8917
8940
|
for (let l = 0; l < this.ranges.length; l += 3) {
|
|
8918
8941
|
let c = this.ranges[l] - (this.inverted ? r : 0);
|
|
8919
8942
|
if (c > e)
|
|
@@ -9029,7 +9052,7 @@ class Z {
|
|
|
9029
9052
|
try {
|
|
9030
9053
|
return Z.ok(e.replace(n, r, s));
|
|
9031
9054
|
} catch (o) {
|
|
9032
|
-
if (o instanceof
|
|
9055
|
+
if (o instanceof xa)
|
|
9033
9056
|
return Z.fail(o.message);
|
|
9034
9057
|
throw o;
|
|
9035
9058
|
}
|
|
@@ -9043,7 +9066,7 @@ function rn(t, e, n) {
|
|
|
9043
9066
|
}
|
|
9044
9067
|
return H.fromArray(r);
|
|
9045
9068
|
}
|
|
9046
|
-
class
|
|
9069
|
+
class Ie extends Q {
|
|
9047
9070
|
/**
|
|
9048
9071
|
Create a mark step.
|
|
9049
9072
|
*/
|
|
@@ -9059,10 +9082,10 @@ class Me extends Q {
|
|
|
9059
9082
|
}
|
|
9060
9083
|
map(e) {
|
|
9061
9084
|
let n = e.mapResult(this.from, 1), r = e.mapResult(this.to, -1);
|
|
9062
|
-
return n.deleted && r.deleted || n.pos >= r.pos ? null : new
|
|
9085
|
+
return n.deleted && r.deleted || n.pos >= r.pos ? null : new Ie(n.pos, r.pos, this.mark);
|
|
9063
9086
|
}
|
|
9064
9087
|
merge(e) {
|
|
9065
|
-
return e instanceof
|
|
9088
|
+
return e instanceof Ie && e.mark.eq(this.mark) && this.from <= e.to && this.to >= e.from ? new Ie(Math.min(this.from, e.from), Math.max(this.to, e.to), this.mark) : null;
|
|
9066
9089
|
}
|
|
9067
9090
|
toJSON() {
|
|
9068
9091
|
return {
|
|
@@ -9078,10 +9101,10 @@ class Me extends Q {
|
|
|
9078
9101
|
static fromJSON(e, n) {
|
|
9079
9102
|
if (typeof n.from != "number" || typeof n.to != "number")
|
|
9080
9103
|
throw new RangeError("Invalid input for AddMarkStep.fromJSON");
|
|
9081
|
-
return new
|
|
9104
|
+
return new Ie(n.from, n.to, e.markFromJSON(n.mark));
|
|
9082
9105
|
}
|
|
9083
9106
|
}
|
|
9084
|
-
Q.jsonID("addMark",
|
|
9107
|
+
Q.jsonID("addMark", Ie);
|
|
9085
9108
|
class Le extends Q {
|
|
9086
9109
|
/**
|
|
9087
9110
|
Create a mark-removing step.
|
|
@@ -9094,7 +9117,7 @@ class Le extends Q {
|
|
|
9094
9117
|
return Z.fromReplace(e, this.from, this.to, r);
|
|
9095
9118
|
}
|
|
9096
9119
|
invert() {
|
|
9097
|
-
return new
|
|
9120
|
+
return new Ie(this.from, this.to, this.mark);
|
|
9098
9121
|
}
|
|
9099
9122
|
map(e) {
|
|
9100
9123
|
let n = e.mapResult(this.from, 1), r = e.mapResult(this.to, -1);
|
|
@@ -9516,7 +9539,7 @@ class $ {
|
|
|
9516
9539
|
negative, it will search backwards first.
|
|
9517
9540
|
*/
|
|
9518
9541
|
static near(e, n = 1) {
|
|
9519
|
-
return this.findFrom(e, n) || this.findFrom(e, -n) || new
|
|
9542
|
+
return this.findFrom(e, n) || this.findFrom(e, -n) || new Se(e.node(0));
|
|
9520
9543
|
}
|
|
9521
9544
|
/**
|
|
9522
9545
|
Find the cursor or leaf node selection closest to the start of
|
|
@@ -9525,14 +9548,14 @@ class $ {
|
|
|
9525
9548
|
exists.
|
|
9526
9549
|
*/
|
|
9527
9550
|
static atStart(e) {
|
|
9528
|
-
return ze(e, e, 0, 0, 1) || new
|
|
9551
|
+
return ze(e, e, 0, 0, 1) || new Se(e);
|
|
9529
9552
|
}
|
|
9530
9553
|
/**
|
|
9531
9554
|
Find the cursor or leaf node selection closest to the end of the
|
|
9532
9555
|
given document.
|
|
9533
9556
|
*/
|
|
9534
9557
|
static atEnd(e) {
|
|
9535
|
-
return ze(e, e, e.content.size, e.childCount, -1) || new
|
|
9558
|
+
return ze(e, e, e.content.size, e.childCount, -1) || new Se(e);
|
|
9536
9559
|
}
|
|
9537
9560
|
/**
|
|
9538
9561
|
Deserialize the JSON representation of a selection. Must be
|
|
@@ -9614,7 +9637,7 @@ class ie extends $ {
|
|
|
9614
9637
|
return e instanceof ie && e.anchor == this.anchor && e.head == this.head;
|
|
9615
9638
|
}
|
|
9616
9639
|
getBookmark() {
|
|
9617
|
-
return new
|
|
9640
|
+
return new Mt(this.anchor, this.head);
|
|
9618
9641
|
}
|
|
9619
9642
|
toJSON() {
|
|
9620
9643
|
return { type: "text", anchor: this.anchor, head: this.head };
|
|
@@ -9655,12 +9678,12 @@ class ie extends $ {
|
|
|
9655
9678
|
}
|
|
9656
9679
|
}
|
|
9657
9680
|
$.jsonID("text", ie);
|
|
9658
|
-
class
|
|
9681
|
+
class Mt {
|
|
9659
9682
|
constructor(e, n) {
|
|
9660
9683
|
this.anchor = e, this.head = n;
|
|
9661
9684
|
}
|
|
9662
9685
|
map(e) {
|
|
9663
|
-
return new
|
|
9686
|
+
return new Mt(e.map(this.anchor), e.map(this.head));
|
|
9664
9687
|
}
|
|
9665
9688
|
resolve(e) {
|
|
9666
9689
|
return ie.between(e.resolve(this.anchor), e.resolve(this.head));
|
|
@@ -9721,14 +9744,14 @@ class sn {
|
|
|
9721
9744
|
}
|
|
9722
9745
|
map(e) {
|
|
9723
9746
|
let { deleted: n, pos: r } = e.mapResult(this.anchor);
|
|
9724
|
-
return n ? new
|
|
9747
|
+
return n ? new Mt(r, r) : new sn(r);
|
|
9725
9748
|
}
|
|
9726
9749
|
resolve(e) {
|
|
9727
9750
|
let n = e.resolve(this.anchor), r = n.nodeAfter;
|
|
9728
9751
|
return r && ae.isSelectable(r) ? new ae(n) : $.near(n);
|
|
9729
9752
|
}
|
|
9730
9753
|
}
|
|
9731
|
-
class
|
|
9754
|
+
class Se extends $ {
|
|
9732
9755
|
/**
|
|
9733
9756
|
Create an all-selection over the given document.
|
|
9734
9757
|
*/
|
|
@@ -9750,25 +9773,25 @@ class _e extends $ {
|
|
|
9750
9773
|
@internal
|
|
9751
9774
|
*/
|
|
9752
9775
|
static fromJSON(e) {
|
|
9753
|
-
return new
|
|
9776
|
+
return new Se(e);
|
|
9754
9777
|
}
|
|
9755
9778
|
map(e) {
|
|
9756
|
-
return new
|
|
9779
|
+
return new Se(e);
|
|
9757
9780
|
}
|
|
9758
9781
|
eq(e) {
|
|
9759
|
-
return e instanceof
|
|
9782
|
+
return e instanceof Se;
|
|
9760
9783
|
}
|
|
9761
9784
|
getBookmark() {
|
|
9762
9785
|
return Na;
|
|
9763
9786
|
}
|
|
9764
9787
|
}
|
|
9765
|
-
$.jsonID("all",
|
|
9788
|
+
$.jsonID("all", Se);
|
|
9766
9789
|
const Na = {
|
|
9767
9790
|
map() {
|
|
9768
9791
|
return this;
|
|
9769
9792
|
},
|
|
9770
9793
|
resolve(t) {
|
|
9771
|
-
return new
|
|
9794
|
+
return new Se(t);
|
|
9772
9795
|
}
|
|
9773
9796
|
};
|
|
9774
9797
|
function ze(t, e, n, r, s, o = !1) {
|
|
@@ -9800,12 +9823,12 @@ function Rn(t, e, n) {
|
|
|
9800
9823
|
a == null && (a = u);
|
|
9801
9824
|
}), t.setSelection($.near(t.doc.resolve(a), n));
|
|
9802
9825
|
}
|
|
9803
|
-
function
|
|
9826
|
+
function Mn(t, e) {
|
|
9804
9827
|
return !e || !t ? t : t.bind(e);
|
|
9805
9828
|
}
|
|
9806
9829
|
class ut {
|
|
9807
9830
|
constructor(e, n, r) {
|
|
9808
|
-
this.name = e, this.init =
|
|
9831
|
+
this.name = e, this.init = Mn(n.init, r), this.apply = Mn(n.apply, r);
|
|
9809
9832
|
}
|
|
9810
9833
|
}
|
|
9811
9834
|
new ut("doc", {
|
|
@@ -9883,7 +9906,7 @@ class st {
|
|
|
9883
9906
|
return e[this.key];
|
|
9884
9907
|
}
|
|
9885
9908
|
}
|
|
9886
|
-
var
|
|
9909
|
+
var Me = {
|
|
9887
9910
|
8: "Backspace",
|
|
9888
9911
|
9: "Tab",
|
|
9889
9912
|
10: "Enter",
|
|
@@ -9962,16 +9985,16 @@ var Ie = {
|
|
|
9962
9985
|
221: "}",
|
|
9963
9986
|
222: '"'
|
|
9964
9987
|
}, Ca = typeof navigator < "u" && /Mac/.test(navigator.platform), Ta = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
|
|
9965
|
-
for (var X = 0; X < 10; X++)
|
|
9966
|
-
for (var X = 1; X <= 24; X++)
|
|
9988
|
+
for (var X = 0; X < 10; X++) Me[48 + X] = Me[96 + X] = String(X);
|
|
9989
|
+
for (var X = 1; X <= 24; X++) Me[X + 111] = "F" + X;
|
|
9967
9990
|
for (var X = 65; X <= 90; X++)
|
|
9968
|
-
|
|
9969
|
-
for (var Ht in
|
|
9970
|
-
function
|
|
9971
|
-
var e = Ca && t.metaKey && t.shiftKey && !t.ctrlKey && !t.altKey || Ta && t.shiftKey && t.key && t.key.length == 1 || t.key == "Unidentified", n = !e && t.key || (t.shiftKey ? Nt :
|
|
9991
|
+
Me[X] = String.fromCharCode(X + 32), Nt[X] = String.fromCharCode(X);
|
|
9992
|
+
for (var Ht in Me) Nt.hasOwnProperty(Ht) || (Nt[Ht] = Me[Ht]);
|
|
9993
|
+
function Sa(t) {
|
|
9994
|
+
var e = Ca && t.metaKey && t.shiftKey && !t.ctrlKey && !t.altKey || Ta && t.shiftKey && t.key && t.key.length == 1 || t.key == "Unidentified", n = !e && t.key || (t.shiftKey ? Nt : Me)[t.keyCode] || t.key || "Unidentified";
|
|
9972
9995
|
return n == "Esc" && (n = "Escape"), n == "Del" && (n = "Delete"), n == "Left" && (n = "ArrowLeft"), n == "Up" && (n = "ArrowUp"), n == "Right" && (n = "ArrowRight"), n == "Down" && (n = "ArrowDown"), n;
|
|
9973
9996
|
}
|
|
9974
|
-
const
|
|
9997
|
+
const _a = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), ka = typeof navigator < "u" && /Win/.test(navigator.platform);
|
|
9975
9998
|
function Aa(t) {
|
|
9976
9999
|
let e = t.split(/-(?!$)/), n = e[e.length - 1];
|
|
9977
10000
|
n == "Space" && (n = " ");
|
|
@@ -9987,7 +10010,7 @@ function Aa(t) {
|
|
|
9987
10010
|
else if (/^s(hift)?$/i.test(c))
|
|
9988
10011
|
o = !0;
|
|
9989
10012
|
else if (/^mod$/i.test(c))
|
|
9990
|
-
|
|
10013
|
+
_a ? a = !0 : s = !0;
|
|
9991
10014
|
else
|
|
9992
10015
|
throw new Error("Unrecognized modifier name: " + c);
|
|
9993
10016
|
}
|
|
@@ -10005,7 +10028,7 @@ function $t(t, e, n = !0) {
|
|
|
10005
10028
|
function Ra(t) {
|
|
10006
10029
|
let e = Oa(t);
|
|
10007
10030
|
return function(n, r) {
|
|
10008
|
-
let s =
|
|
10031
|
+
let s = Sa(r), o, a = e[$t(s, r)];
|
|
10009
10032
|
if (a && a(n.state, n.dispatch, n))
|
|
10010
10033
|
return !0;
|
|
10011
10034
|
if (s.length == 1 && s != " ") {
|
|
@@ -10015,7 +10038,7 @@ function Ra(t) {
|
|
|
10015
10038
|
return !0;
|
|
10016
10039
|
}
|
|
10017
10040
|
if ((r.altKey || r.metaKey || r.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
|
|
10018
|
-
!(ka && r.ctrlKey && r.altKey) && (o =
|
|
10041
|
+
!(ka && r.ctrlKey && r.altKey) && (o = Me[r.keyCode]) && o != s) {
|
|
10019
10042
|
let l = e[$t(o, r)];
|
|
10020
10043
|
if (l && l(n.state, n.dispatch, n))
|
|
10021
10044
|
return !0;
|
|
@@ -10115,13 +10138,13 @@ var Te = class {
|
|
|
10115
10138
|
}
|
|
10116
10139
|
// Find the table map for the given table node.
|
|
10117
10140
|
static get(t) {
|
|
10118
|
-
return Gt(t) || Yt(t,
|
|
10141
|
+
return Gt(t) || Yt(t, Ma(t));
|
|
10119
10142
|
}
|
|
10120
10143
|
};
|
|
10121
|
-
function
|
|
10144
|
+
function Ma(t) {
|
|
10122
10145
|
if (t.type.spec.tableRole != "table")
|
|
10123
10146
|
throw new RangeError("Not a table node: " + t.type.name);
|
|
10124
|
-
const e =
|
|
10147
|
+
const e = Ia(t), n = t.childCount, r = [];
|
|
10125
10148
|
let s = 0, o = null;
|
|
10126
10149
|
const a = [];
|
|
10127
10150
|
for (let d = 0, u = e * n; d < u; d++) r[d] = 0;
|
|
@@ -10131,28 +10154,28 @@ function Ia(t) {
|
|
|
10131
10154
|
for (let b = 0; ; b++) {
|
|
10132
10155
|
for (; s < r.length && r[s] != 0; ) s++;
|
|
10133
10156
|
if (b == f.childCount) break;
|
|
10134
|
-
const w = f.child(b), { colspan: g, rowspan:
|
|
10135
|
-
for (let
|
|
10136
|
-
if (
|
|
10157
|
+
const w = f.child(b), { colspan: g, rowspan: S, colwidth: N } = w.attrs;
|
|
10158
|
+
for (let x = 0; x < S; x++) {
|
|
10159
|
+
if (x + d >= n) {
|
|
10137
10160
|
(o || (o = [])).push({
|
|
10138
10161
|
type: "overlong_rowspan",
|
|
10139
10162
|
pos: u,
|
|
10140
|
-
n:
|
|
10163
|
+
n: S - x
|
|
10141
10164
|
});
|
|
10142
10165
|
break;
|
|
10143
10166
|
}
|
|
10144
|
-
const T = s +
|
|
10145
|
-
for (let
|
|
10146
|
-
r[T +
|
|
10167
|
+
const T = s + x * e;
|
|
10168
|
+
for (let y = 0; y < g; y++) {
|
|
10169
|
+
r[T + y] == 0 ? r[T + y] = u : (o || (o = [])).push({
|
|
10147
10170
|
type: "collision",
|
|
10148
10171
|
row: d,
|
|
10149
10172
|
pos: u,
|
|
10150
|
-
n: g -
|
|
10173
|
+
n: g - y
|
|
10151
10174
|
});
|
|
10152
|
-
const
|
|
10153
|
-
if (
|
|
10154
|
-
const A = (T +
|
|
10155
|
-
B == null || B !=
|
|
10175
|
+
const _ = N && N[y];
|
|
10176
|
+
if (_) {
|
|
10177
|
+
const A = (T + y) % e * 2, B = a[A];
|
|
10178
|
+
B == null || B != _ && a[A + 1] == 1 ? (a[A] = _, a[A + 1] = 1) : B == _ && a[A + 1]++;
|
|
10156
10179
|
}
|
|
10157
10180
|
}
|
|
10158
10181
|
}
|
|
@@ -10170,7 +10193,7 @@ function Ia(t) {
|
|
|
10170
10193
|
a[d] != null && a[d + 1] < n && (c = !0);
|
|
10171
10194
|
return c && La(l, a, t), l;
|
|
10172
10195
|
}
|
|
10173
|
-
function
|
|
10196
|
+
function Ia(t) {
|
|
10174
10197
|
let e = -1, n = !1;
|
|
10175
10198
|
for (let r = 0; r < t.childCount; r++) {
|
|
10176
10199
|
const s = t.child(r);
|
|
@@ -10266,13 +10289,13 @@ function Ba(t) {
|
|
|
10266
10289
|
return t.doc.resolve(n - e.nodeSize);
|
|
10267
10290
|
}
|
|
10268
10291
|
}
|
|
10269
|
-
function
|
|
10292
|
+
function In(t) {
|
|
10270
10293
|
return t.parent.type.spec.tableRole == "row" && !!t.nodeAfter;
|
|
10271
10294
|
}
|
|
10272
10295
|
function ws(t, e) {
|
|
10273
10296
|
return t.depth == e.depth && t.pos >= e.start(-1) && t.pos <= e.end(-1);
|
|
10274
10297
|
}
|
|
10275
|
-
function
|
|
10298
|
+
function ys(t, e, n) {
|
|
10276
10299
|
const r = t.node(-1), s = Te.get(r), o = t.start(-1), a = s.nextCell(t.pos - o, e, n);
|
|
10277
10300
|
return a == null ? null : t.node(0).resolve(o + a);
|
|
10278
10301
|
}
|
|
@@ -10280,7 +10303,7 @@ function Ln(t, e, n = 1) {
|
|
|
10280
10303
|
const r = { ...t, colspan: t.colspan - n };
|
|
10281
10304
|
return r.colwidth && (r.colwidth = r.colwidth.slice(), r.colwidth.splice(e, n), r.colwidth.some((s) => s > 0) || (r.colwidth = null)), r;
|
|
10282
10305
|
}
|
|
10283
|
-
var
|
|
10306
|
+
var ye = class Ne extends $ {
|
|
10284
10307
|
// A table selection is identified by its anchor and head cells. The
|
|
10285
10308
|
// positions given to this constructor should point _before_ two
|
|
10286
10309
|
// cells in the same table. They may be the same, to select a single
|
|
@@ -10305,7 +10328,7 @@ var xe = class Ne extends $ {
|
|
|
10305
10328
|
}
|
|
10306
10329
|
map(e, n) {
|
|
10307
10330
|
const r = e.resolve(n.map(this.$anchorCell.pos)), s = e.resolve(n.map(this.$headCell.pos));
|
|
10308
|
-
if (
|
|
10331
|
+
if (In(r) && In(s) && ws(r, s)) {
|
|
10309
10332
|
const o = this.$anchorCell.node(-1) != r.node(-1);
|
|
10310
10333
|
return o && this.isRowSelection() ? Ne.rowSelection(r, s) : o && this.isColSelection() ? Ne.colSelection(r, s) : new Ne(r, s);
|
|
10311
10334
|
}
|
|
@@ -10330,25 +10353,25 @@ var xe = class Ne extends $ {
|
|
|
10330
10353
|
throw RangeError(`No cell with offset ${p} found`);
|
|
10331
10354
|
const w = s.left - h.left, g = h.right - s.right;
|
|
10332
10355
|
if (w > 0 || g > 0) {
|
|
10333
|
-
let
|
|
10334
|
-
if (w > 0 && (
|
|
10335
|
-
|
|
10336
|
-
|
|
10356
|
+
let S = b.attrs;
|
|
10357
|
+
if (w > 0 && (S = Ln(S, 0, w)), g > 0 && (S = Ln(
|
|
10358
|
+
S,
|
|
10359
|
+
S.colspan - g,
|
|
10337
10360
|
g
|
|
10338
10361
|
)), h.left < s.left) {
|
|
10339
|
-
if (b = b.type.createAndFill(
|
|
10362
|
+
if (b = b.type.createAndFill(S), !b)
|
|
10340
10363
|
throw RangeError(
|
|
10341
|
-
`Could not create cell with attrs ${JSON.stringify(
|
|
10364
|
+
`Could not create cell with attrs ${JSON.stringify(S)}`
|
|
10342
10365
|
);
|
|
10343
10366
|
} else
|
|
10344
|
-
b = b.type.create(
|
|
10367
|
+
b = b.type.create(S, b.content);
|
|
10345
10368
|
}
|
|
10346
10369
|
if (h.top < s.top || h.bottom > s.bottom) {
|
|
10347
|
-
const
|
|
10370
|
+
const S = {
|
|
10348
10371
|
...b.attrs,
|
|
10349
10372
|
rowspan: Math.min(h.bottom, s.bottom) - Math.max(h.top, s.top)
|
|
10350
10373
|
};
|
|
10351
|
-
h.top < s.top ? b = b.type.createAndFill(
|
|
10374
|
+
h.top < s.top ? b = b.type.createAndFill(S) : b = b.type.create(S, b.content);
|
|
10352
10375
|
}
|
|
10353
10376
|
d.push(b);
|
|
10354
10377
|
}
|
|
@@ -10444,24 +10467,24 @@ var xe = class Ne extends $ {
|
|
|
10444
10467
|
return new za(this.$anchorCell.pos, this.$headCell.pos);
|
|
10445
10468
|
}
|
|
10446
10469
|
};
|
|
10447
|
-
|
|
10448
|
-
$.jsonID("cell",
|
|
10449
|
-
var za = class
|
|
10470
|
+
ye.prototype.visible = !1;
|
|
10471
|
+
$.jsonID("cell", ye);
|
|
10472
|
+
var za = class xs {
|
|
10450
10473
|
constructor(e, n) {
|
|
10451
10474
|
this.anchor = e, this.head = n;
|
|
10452
10475
|
}
|
|
10453
10476
|
map(e) {
|
|
10454
|
-
return new
|
|
10477
|
+
return new xs(e.map(this.anchor), e.map(this.head));
|
|
10455
10478
|
}
|
|
10456
10479
|
resolve(e) {
|
|
10457
10480
|
const n = e.resolve(this.anchor), r = e.resolve(this.head);
|
|
10458
|
-
return n.parent.type.spec.tableRole == "row" && r.parent.type.spec.tableRole == "row" && n.index() < n.parent.childCount && r.index() < r.parent.childCount && ws(n, r) ? new
|
|
10481
|
+
return n.parent.type.spec.tableRole == "row" && r.parent.type.spec.tableRole == "row" && n.index() < n.parent.childCount && r.index() < r.parent.childCount && ws(n, r) ? new ye(n, r) : $.near(r, 1);
|
|
10459
10482
|
}
|
|
10460
10483
|
};
|
|
10461
10484
|
new st("fix-tables");
|
|
10462
10485
|
function vs(t) {
|
|
10463
10486
|
const e = t.selection, n = Pa(t), r = n.node(-1), s = n.start(-1), o = Te.get(r);
|
|
10464
|
-
return { ...e instanceof
|
|
10487
|
+
return { ...e instanceof ye ? o.rectBetween(
|
|
10465
10488
|
e.$anchorCell.pos - s,
|
|
10466
10489
|
e.$headCell.pos - s
|
|
10467
10490
|
) : o.findCell(n.pos - s), tableStart: s, map: o, table: r };
|
|
@@ -10553,7 +10576,7 @@ an("cell", {
|
|
|
10553
10576
|
});
|
|
10554
10577
|
function ft(t, e) {
|
|
10555
10578
|
const n = t.selection;
|
|
10556
|
-
if (!(n instanceof
|
|
10579
|
+
if (!(n instanceof ye)) return !1;
|
|
10557
10580
|
if (e) {
|
|
10558
10581
|
const r = t.tr, s = on(t.schema).cell.createAndFill().content;
|
|
10559
10582
|
n.forEachCell((o, a) => {
|
|
@@ -10587,7 +10610,7 @@ function ht(t, e) {
|
|
|
10587
10610
|
return (n, r, s) => {
|
|
10588
10611
|
if (!s) return !1;
|
|
10589
10612
|
const o = n.selection;
|
|
10590
|
-
if (o instanceof
|
|
10613
|
+
if (o instanceof ye)
|
|
10591
10614
|
return bt(
|
|
10592
10615
|
n,
|
|
10593
10616
|
r,
|
|
@@ -10603,7 +10626,7 @@ function ht(t, e) {
|
|
|
10603
10626
|
$.near(n.doc.resolve(o.head + e), e)
|
|
10604
10627
|
);
|
|
10605
10628
|
{
|
|
10606
|
-
const l = n.doc.resolve(a), c =
|
|
10629
|
+
const l = n.doc.resolve(a), c = ys(l, t, e);
|
|
10607
10630
|
let d;
|
|
10608
10631
|
return c ? d = $.near(c, 1) : e < 0 ? d = $.near(n.doc.resolve(l.before(-1)), -1) : d = $.near(n.doc.resolve(l.after(-1)), 1), bt(n, r, d);
|
|
10609
10632
|
}
|
|
@@ -10614,18 +10637,18 @@ function mt(t, e) {
|
|
|
10614
10637
|
if (!s) return !1;
|
|
10615
10638
|
const o = n.selection;
|
|
10616
10639
|
let a;
|
|
10617
|
-
if (o instanceof
|
|
10640
|
+
if (o instanceof ye)
|
|
10618
10641
|
a = o;
|
|
10619
10642
|
else {
|
|
10620
10643
|
const c = Es(s, t, e);
|
|
10621
10644
|
if (c == null) return !1;
|
|
10622
|
-
a = new
|
|
10645
|
+
a = new ye(n.doc.resolve(c));
|
|
10623
10646
|
}
|
|
10624
|
-
const l =
|
|
10647
|
+
const l = ys(a.$headCell, t, e);
|
|
10625
10648
|
return l ? bt(
|
|
10626
10649
|
n,
|
|
10627
10650
|
r,
|
|
10628
|
-
new
|
|
10651
|
+
new ye(a.$anchorCell, l)
|
|
10629
10652
|
) : !1;
|
|
10630
10653
|
};
|
|
10631
10654
|
}
|
|
@@ -10742,7 +10765,7 @@ var Ha = class {
|
|
|
10742
10765
|
getClientRects: () => [r.getBoundingClientRect()]
|
|
10743
10766
|
});
|
|
10744
10767
|
}
|
|
10745
|
-
if (t instanceof
|
|
10768
|
+
if (t instanceof ye) {
|
|
10746
10769
|
const { $anchorCell: r, $headCell: s } = t, o = r ? r.pos : s.pos, a = s ? s.pos : r.pos, l = this.view.nodeDOM(o), c = this.view.nodeDOM(a);
|
|
10747
10770
|
if (!l || !c)
|
|
10748
10771
|
return;
|
|
@@ -10949,7 +10972,7 @@ er.create({
|
|
|
10949
10972
|
});
|
|
10950
10973
|
var Ts = Ze.forwardRef(
|
|
10951
10974
|
({ pluginKey: t = "bubbleMenu", editor: e, updateDelay: n, resizeDelay: r, shouldShow: s = null, options: o, children: a, ...l }, c) => {
|
|
10952
|
-
const d =
|
|
10975
|
+
const d = _e(document.createElement("div"));
|
|
10953
10976
|
typeof c == "function" ? c(d.current) : c && (c.current = d.current);
|
|
10954
10977
|
const { editor: u } = Pn();
|
|
10955
10978
|
return Y(() => {
|
|
@@ -10979,7 +11002,7 @@ var Ts = Ze.forwardRef(
|
|
|
10979
11002
|
}
|
|
10980
11003
|
), Ka = Ze.forwardRef(
|
|
10981
11004
|
({ pluginKey: t = "floatingMenu", editor: e, shouldShow: n = null, options: r, children: s, ...o }, a) => {
|
|
10982
|
-
const l =
|
|
11005
|
+
const l = _e(document.createElement("div"));
|
|
10983
11006
|
typeof a == "function" ? a(l.current) : a && (a.current = l.current);
|
|
10984
11007
|
const { editor: c } = Pn();
|
|
10985
11008
|
return Y(() => {
|
|
@@ -11023,7 +11046,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11023
11046
|
className: "bubble-menu bg-white border border-gray-300 rounded-lg p-2 shadow-lg z-50",
|
|
11024
11047
|
children: /* @__PURE__ */ i.jsxs("div", { className: "flex gap-1 items-center", children: [
|
|
11025
11048
|
/* @__PURE__ */ i.jsx(
|
|
11026
|
-
|
|
11049
|
+
I,
|
|
11027
11050
|
{
|
|
11028
11051
|
onClick: () => t.chain().focus().toggleBold().run(),
|
|
11029
11052
|
isActive: t.isActive("bold"),
|
|
@@ -11032,7 +11055,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11032
11055
|
}
|
|
11033
11056
|
),
|
|
11034
11057
|
/* @__PURE__ */ i.jsx(
|
|
11035
|
-
|
|
11058
|
+
I,
|
|
11036
11059
|
{
|
|
11037
11060
|
onClick: () => t.chain().focus().toggleItalic().run(),
|
|
11038
11061
|
isActive: t.isActive("italic"),
|
|
@@ -11041,7 +11064,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11041
11064
|
}
|
|
11042
11065
|
),
|
|
11043
11066
|
/* @__PURE__ */ i.jsx(
|
|
11044
|
-
|
|
11067
|
+
I,
|
|
11045
11068
|
{
|
|
11046
11069
|
onClick: () => t.chain().focus().toggleUnderline().run(),
|
|
11047
11070
|
isActive: t.isActive("underline"),
|
|
@@ -11050,7 +11073,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11050
11073
|
}
|
|
11051
11074
|
),
|
|
11052
11075
|
/* @__PURE__ */ i.jsx(
|
|
11053
|
-
|
|
11076
|
+
I,
|
|
11054
11077
|
{
|
|
11055
11078
|
onClick: () => t.chain().focus().toggleStrike().run(),
|
|
11056
11079
|
isActive: t.isActive("strike"),
|
|
@@ -11059,7 +11082,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11059
11082
|
}
|
|
11060
11083
|
),
|
|
11061
11084
|
/* @__PURE__ */ i.jsx(
|
|
11062
|
-
|
|
11085
|
+
I,
|
|
11063
11086
|
{
|
|
11064
11087
|
onClick: () => t.chain().focus().toggleCode().run(),
|
|
11065
11088
|
isActive: t.isActive("code"),
|
|
@@ -11069,7 +11092,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11069
11092
|
),
|
|
11070
11093
|
/* @__PURE__ */ i.jsxs("div", { className: "relative", children: [
|
|
11071
11094
|
/* @__PURE__ */ i.jsx(
|
|
11072
|
-
|
|
11095
|
+
I,
|
|
11073
11096
|
{
|
|
11074
11097
|
onClick: () => r(!n),
|
|
11075
11098
|
title: "Text Color",
|
|
@@ -11087,7 +11110,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11087
11110
|
] }),
|
|
11088
11111
|
/* @__PURE__ */ i.jsxs("div", { className: "relative", children: [
|
|
11089
11112
|
/* @__PURE__ */ i.jsx(
|
|
11090
|
-
|
|
11113
|
+
I,
|
|
11091
11114
|
{
|
|
11092
11115
|
onClick: () => o(!s),
|
|
11093
11116
|
title: "Background Color",
|
|
@@ -11095,7 +11118,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11095
11118
|
}
|
|
11096
11119
|
),
|
|
11097
11120
|
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(
|
|
11098
|
-
|
|
11121
|
+
Si,
|
|
11099
11122
|
{
|
|
11100
11123
|
onColorChange: (f) => {
|
|
11101
11124
|
t.chain().focus().toggleHighlight({ color: f }).run(), o(!1);
|
|
@@ -11105,7 +11128,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11105
11128
|
] }),
|
|
11106
11129
|
/* @__PURE__ */ i.jsxs("div", { className: "relative", children: [
|
|
11107
11130
|
/* @__PURE__ */ i.jsx(
|
|
11108
|
-
|
|
11131
|
+
I,
|
|
11109
11132
|
{
|
|
11110
11133
|
onClick: () => d(!c),
|
|
11111
11134
|
isActive: t.isActive("link"),
|
|
@@ -11181,7 +11204,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11181
11204
|
editor: t,
|
|
11182
11205
|
isReadOnly: e
|
|
11183
11206
|
}) => {
|
|
11184
|
-
const [n, r] = P(!1), [s, o] = P(!1), a =
|
|
11207
|
+
const [n, r] = P(!1), [s, o] = P(!1), a = _e(null), l = t.getAttributes("codeBlock").language || "";
|
|
11185
11208
|
if (Y(() => {
|
|
11186
11209
|
const d = (u) => {
|
|
11187
11210
|
a.current && !a.current.contains(u.target) && o(!1);
|
|
@@ -11202,7 +11225,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11202
11225
|
children: /* @__PURE__ */ i.jsxs("div", { className: "flex gap-1 items-center", children: [
|
|
11203
11226
|
/* @__PURE__ */ i.jsxs("div", { className: "relative", ref: a, children: [
|
|
11204
11227
|
/* @__PURE__ */ i.jsx(
|
|
11205
|
-
|
|
11228
|
+
I,
|
|
11206
11229
|
{
|
|
11207
11230
|
onClick: () => {
|
|
11208
11231
|
o(!s), r(!1);
|
|
@@ -11233,7 +11256,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11233
11256
|
] }),
|
|
11234
11257
|
/* @__PURE__ */ i.jsxs("div", { className: "relative", children: [
|
|
11235
11258
|
/* @__PURE__ */ i.jsx(
|
|
11236
|
-
|
|
11259
|
+
I,
|
|
11237
11260
|
{
|
|
11238
11261
|
onClick: () => {
|
|
11239
11262
|
r(!n), o(!1);
|
|
@@ -11266,7 +11289,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11266
11289
|
className: "floating-menu bg-white border border-gray-300 rounded-lg p-2 shadow-lg flex gap-1 z-50",
|
|
11267
11290
|
children: [
|
|
11268
11291
|
/* @__PURE__ */ i.jsx(
|
|
11269
|
-
|
|
11292
|
+
I,
|
|
11270
11293
|
{
|
|
11271
11294
|
onClick: () => t.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
11272
11295
|
title: "Heading 1",
|
|
@@ -11274,7 +11297,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11274
11297
|
}
|
|
11275
11298
|
),
|
|
11276
11299
|
/* @__PURE__ */ i.jsx(
|
|
11277
|
-
|
|
11300
|
+
I,
|
|
11278
11301
|
{
|
|
11279
11302
|
onClick: () => t.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
11280
11303
|
title: "Heading 2",
|
|
@@ -11282,7 +11305,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11282
11305
|
}
|
|
11283
11306
|
),
|
|
11284
11307
|
/* @__PURE__ */ i.jsx(
|
|
11285
|
-
|
|
11308
|
+
I,
|
|
11286
11309
|
{
|
|
11287
11310
|
onClick: () => t.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
11288
11311
|
title: "Heading 3",
|
|
@@ -11290,14 +11313,14 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11290
11313
|
}
|
|
11291
11314
|
),
|
|
11292
11315
|
/* @__PURE__ */ i.jsx(
|
|
11293
|
-
|
|
11316
|
+
I,
|
|
11294
11317
|
{
|
|
11295
11318
|
onClick: () => t.chain().focus().setParagraph().run(),
|
|
11296
11319
|
title: "Paragraph",
|
|
11297
11320
|
children: /* @__PURE__ */ i.jsx(Gn, { className: "h-4 w-4" })
|
|
11298
11321
|
}
|
|
11299
11322
|
),
|
|
11300
|
-
/* @__PURE__ */ i.jsx(
|
|
11323
|
+
/* @__PURE__ */ i.jsx(I, { onClick: n, title: "Insert Image", children: /* @__PURE__ */ i.jsx(Yn, { className: "h-4 w-4" }) })
|
|
11301
11324
|
]
|
|
11302
11325
|
}
|
|
11303
11326
|
), Ya = ({
|
|
@@ -11319,7 +11342,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11319
11342
|
children: [
|
|
11320
11343
|
/* @__PURE__ */ i.jsxs("div", { className: "flex gap-1 items-center", children: [
|
|
11321
11344
|
/* @__PURE__ */ i.jsx(
|
|
11322
|
-
|
|
11345
|
+
I,
|
|
11323
11346
|
{
|
|
11324
11347
|
onClick: () => t.chain().focus().addRowBefore().run(),
|
|
11325
11348
|
title: "Add Row Before",
|
|
@@ -11331,7 +11354,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11331
11354
|
}
|
|
11332
11355
|
),
|
|
11333
11356
|
/* @__PURE__ */ i.jsx(
|
|
11334
|
-
|
|
11357
|
+
I,
|
|
11335
11358
|
{
|
|
11336
11359
|
onClick: () => t.chain().focus().addRowAfter().run(),
|
|
11337
11360
|
title: "Add Row After",
|
|
@@ -11344,7 +11367,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11344
11367
|
),
|
|
11345
11368
|
/* @__PURE__ */ i.jsx("div", { className: "h-6 w-px bg-gray-300 mx-1" }),
|
|
11346
11369
|
/* @__PURE__ */ i.jsx(
|
|
11347
|
-
|
|
11370
|
+
I,
|
|
11348
11371
|
{
|
|
11349
11372
|
onClick: () => t.chain().focus().addColumnBefore().run(),
|
|
11350
11373
|
title: "Add Column Before",
|
|
@@ -11357,7 +11380,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11357
11380
|
}
|
|
11358
11381
|
),
|
|
11359
11382
|
/* @__PURE__ */ i.jsx(
|
|
11360
|
-
|
|
11383
|
+
I,
|
|
11361
11384
|
{
|
|
11362
11385
|
onClick: () => t.chain().focus().addColumnAfter().run(),
|
|
11363
11386
|
title: "Add Column After",
|
|
@@ -11370,7 +11393,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11370
11393
|
),
|
|
11371
11394
|
/* @__PURE__ */ i.jsx("div", { className: "h-6 w-px bg-gray-300 mx-1" }),
|
|
11372
11395
|
/* @__PURE__ */ i.jsx(
|
|
11373
|
-
|
|
11396
|
+
I,
|
|
11374
11397
|
{
|
|
11375
11398
|
onClick: () => t.chain().focus().deleteColumn().run(),
|
|
11376
11399
|
title: "Delete Column",
|
|
@@ -11383,7 +11406,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11383
11406
|
),
|
|
11384
11407
|
/* @__PURE__ */ i.jsx("div", { className: "h-6 w-px bg-gray-300 mx-1" }),
|
|
11385
11408
|
/* @__PURE__ */ i.jsx(
|
|
11386
|
-
|
|
11409
|
+
I,
|
|
11387
11410
|
{
|
|
11388
11411
|
onClick: () => t.chain().focus().deleteRow().run(),
|
|
11389
11412
|
title: "Delete Row",
|
|
@@ -11395,7 +11418,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11395
11418
|
}
|
|
11396
11419
|
),
|
|
11397
11420
|
/* @__PURE__ */ i.jsx(
|
|
11398
|
-
|
|
11421
|
+
I,
|
|
11399
11422
|
{
|
|
11400
11423
|
onClick: () => t.chain().focus().deleteTable().run(),
|
|
11401
11424
|
title: "Delete Table",
|
|
@@ -11483,7 +11506,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11483
11506
|
words: e.wordCount,
|
|
11484
11507
|
timestamp: e.timestamp
|
|
11485
11508
|
}), console.log("================================================"), e;
|
|
11486
|
-
},
|
|
11509
|
+
}, Sl = ({
|
|
11487
11510
|
onImageUpload: t,
|
|
11488
11511
|
onVideoUpload: e,
|
|
11489
11512
|
onImageDelete: n,
|
|
@@ -11491,12 +11514,12 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11491
11514
|
content: s,
|
|
11492
11515
|
setEditorContent: o
|
|
11493
11516
|
}) => {
|
|
11494
|
-
const [a, l] = P(""), [c, d] = P(!1), [u, f] = P(""), [p, h] = P(!1), [, b] = P({}), [w, g] = P(!1), [
|
|
11517
|
+
const [a, l] = P(""), [c, d] = P(!1), [u, f] = P(""), [p, h] = P(!1), [, b] = P({}), [w, g] = P(!1), [S, N] = P(!1), [x, T] = P(!1), [y, _] = P(null), A = _e(null), [B, L] = P({ top: 0, left: 0, show: !1 }), C = (k) => {
|
|
11495
11518
|
const O = /* @__PURE__ */ new Set(), m = (E) => {
|
|
11496
11519
|
E.type === "image" && E.attrs?.src && O.add(E.attrs.src), E.content && Array.isArray(E.content) && E.content.forEach(m);
|
|
11497
11520
|
};
|
|
11498
11521
|
return m(k), O;
|
|
11499
|
-
},
|
|
11522
|
+
}, M = (k) => {
|
|
11500
11523
|
const O = /* @__PURE__ */ new Set(), m = (E) => {
|
|
11501
11524
|
E.type === "video" && E.attrs?.src && O.add(E.attrs.src), E.content && Array.isArray(E.content) && E.content.forEach(m);
|
|
11502
11525
|
};
|
|
@@ -11516,18 +11539,18 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11516
11539
|
ar,
|
|
11517
11540
|
lr,
|
|
11518
11541
|
vr,
|
|
11519
|
-
|
|
11542
|
+
xr,
|
|
11520
11543
|
Cr,
|
|
11521
11544
|
Tr,
|
|
11522
|
-
_r,
|
|
11523
11545
|
Sr,
|
|
11546
|
+
_r,
|
|
11524
11547
|
kr,
|
|
11525
11548
|
Ar,
|
|
11526
11549
|
Or,
|
|
11527
11550
|
Rr,
|
|
11528
|
-
|
|
11551
|
+
Ir,
|
|
11529
11552
|
Lr,
|
|
11530
|
-
|
|
11553
|
+
Mr.configure({
|
|
11531
11554
|
inline: !1,
|
|
11532
11555
|
allowBase64: !0,
|
|
11533
11556
|
HTMLAttributes: {
|
|
@@ -11571,11 +11594,11 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11571
11594
|
const G = oe.map((ne) => {
|
|
11572
11595
|
const me = ne.getAttribute("src");
|
|
11573
11596
|
if (!me) return Promise.resolve(null);
|
|
11574
|
-
const ot = (pe,
|
|
11575
|
-
const
|
|
11597
|
+
const ot = (pe, Ss) => {
|
|
11598
|
+
const _s = new File([pe], Ss, {
|
|
11576
11599
|
type: pe.type || "image/png"
|
|
11577
11600
|
});
|
|
11578
|
-
return t(
|
|
11601
|
+
return t(_s).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));
|
|
11579
11602
|
};
|
|
11580
11603
|
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);
|
|
11581
11604
|
});
|
|
@@ -11590,10 +11613,10 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11590
11613
|
},
|
|
11591
11614
|
onUpdate: () => {
|
|
11592
11615
|
const k = v.getJSON();
|
|
11593
|
-
if (
|
|
11594
|
-
const O = C(
|
|
11616
|
+
if (y) {
|
|
11617
|
+
const O = C(y), m = C(k), E = [...O].filter(
|
|
11595
11618
|
(V) => !m.has(V)
|
|
11596
|
-
), R =
|
|
11619
|
+
), R = M(y), D = M(k), q = [...R].filter(
|
|
11597
11620
|
(V) => !D.has(V)
|
|
11598
11621
|
);
|
|
11599
11622
|
E.forEach((V) => {
|
|
@@ -11606,18 +11629,18 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11606
11629
|
});
|
|
11607
11630
|
});
|
|
11608
11631
|
}
|
|
11609
|
-
|
|
11632
|
+
_(k), o?.({ html: v.getHTML(), json: k }), b({});
|
|
11610
11633
|
},
|
|
11611
11634
|
onSelectionUpdate: () => {
|
|
11612
11635
|
o?.({ html: v.getHTML(), json: v.getJSON() }), b({});
|
|
11613
11636
|
}
|
|
11614
11637
|
});
|
|
11615
11638
|
Y(() => {
|
|
11616
|
-
v && (A.current = v,
|
|
11639
|
+
v && (A.current = v, _(v.getJSON()));
|
|
11617
11640
|
}, [v]), Y(() => {
|
|
11618
11641
|
if (v && s !== void 0) {
|
|
11619
11642
|
const k = v.getJSON();
|
|
11620
|
-
|
|
11643
|
+
_(k);
|
|
11621
11644
|
}
|
|
11622
11645
|
}, [s, v]), Y(() => {
|
|
11623
11646
|
v && v.setEditable(!w);
|
|
@@ -11690,7 +11713,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11690
11713
|
const k = u.trim();
|
|
11691
11714
|
k && (v?.chain().focus().setVideo({
|
|
11692
11715
|
src: k,
|
|
11693
|
-
type:
|
|
11716
|
+
type: xi(k) ? "youtube" : "video/mp4",
|
|
11694
11717
|
title: ""
|
|
11695
11718
|
}).run(), f(""), h(!1));
|
|
11696
11719
|
}, [v, u]), J = Pe(async () => {
|
|
@@ -11769,14 +11792,14 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11769
11792
|
}
|
|
11770
11793
|
),
|
|
11771
11794
|
/* @__PURE__ */ i.jsx(
|
|
11772
|
-
|
|
11795
|
+
_i,
|
|
11773
11796
|
{
|
|
11774
11797
|
editor: v,
|
|
11775
11798
|
isReadOnly: w,
|
|
11776
11799
|
onImageUpload: z,
|
|
11777
11800
|
onVideoUpload: J,
|
|
11778
|
-
isImageUploading:
|
|
11779
|
-
isVideoUploading:
|
|
11801
|
+
isImageUploading: S,
|
|
11802
|
+
isVideoUploading: x,
|
|
11780
11803
|
showImageInput: c,
|
|
11781
11804
|
setShowImageInput: d,
|
|
11782
11805
|
imageUrl: a,
|
|
@@ -11793,7 +11816,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11793
11816
|
),
|
|
11794
11817
|
/* @__PURE__ */ i.jsxs("div", { className: "relative border border-gray-300 border-t-1 rounded-t-lg rounded-b-lg min-h-[400px]", children: [
|
|
11795
11818
|
/* @__PURE__ */ i.jsx(zn, { editor: v, className: "tiptap-editor" }),
|
|
11796
|
-
|
|
11819
|
+
S && /* @__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: [
|
|
11797
11820
|
/* @__PURE__ */ i.jsxs("div", { className: "relative", children: [
|
|
11798
11821
|
/* @__PURE__ */ i.jsx("div", { className: "animate-spin rounded-full h-12 w-12 border-4 border-gray-200 border-t-blue-600" }),
|
|
11799
11822
|
/* @__PURE__ */ i.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ i.jsx(
|
|
@@ -11837,7 +11860,7 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11837
11860
|
)
|
|
11838
11861
|
] })
|
|
11839
11862
|
] }) : null;
|
|
11840
|
-
},
|
|
11863
|
+
}, _l = ({
|
|
11841
11864
|
styles: t,
|
|
11842
11865
|
editorContent: e,
|
|
11843
11866
|
immediatelyRender: n = !1
|
|
@@ -11868,18 +11891,18 @@ const Ja = ({ editor: t, isReadOnly: e }) => {
|
|
|
11868
11891
|
multicolor: !0
|
|
11869
11892
|
}),
|
|
11870
11893
|
vr,
|
|
11871
|
-
|
|
11894
|
+
xr,
|
|
11872
11895
|
Cr,
|
|
11873
11896
|
Tr,
|
|
11874
|
-
_r,
|
|
11875
11897
|
Sr,
|
|
11898
|
+
_r,
|
|
11876
11899
|
kr,
|
|
11877
11900
|
Ar,
|
|
11878
11901
|
Or,
|
|
11879
11902
|
Rr,
|
|
11880
|
-
|
|
11903
|
+
Ir,
|
|
11881
11904
|
Lr,
|
|
11882
|
-
|
|
11905
|
+
Mr.configure({
|
|
11883
11906
|
inline: !1,
|
|
11884
11907
|
allowBase64: !0,
|
|
11885
11908
|
HTMLAttributes: {
|
|
@@ -11920,7 +11943,7 @@ function kl(t) {
|
|
|
11920
11943
|
};
|
|
11921
11944
|
}
|
|
11922
11945
|
export {
|
|
11923
|
-
|
|
11924
|
-
|
|
11946
|
+
Sl as TiptapEditor,
|
|
11947
|
+
_l as TiptapViewer,
|
|
11925
11948
|
kl as useEditorContent
|
|
11926
11949
|
};
|