reactjs-tiptap-editor 1.0.12 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{ActionMenuButton-CPPHERbq.cjs → ActionMenuButton-DNj0f_A4.cjs} +1 -1
- package/lib/{ActionMenuButton-BKqin6Kz.js → ActionMenuButton-l5rSmAO_.js} +11 -11
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.js +6 -6
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.js +4 -4
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +4 -4
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +4 -4
- package/lib/Callout.cjs +1 -0
- package/lib/Callout.js +230 -0
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +3 -3
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +4 -4
- package/lib/CodeBlock.cjs +20 -20
- package/lib/CodeBlock.js +90 -89
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +4 -4
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +6 -6
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +4 -4
- package/lib/{Drawer-DUPsBE0H.js → Drawer-Cbi_MURj.js} +16 -16
- package/lib/{Drawer-fplzqNI6.cjs → Drawer-DKU32YW_.cjs} +1 -1
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +3 -3
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +16 -16
- package/lib/{Excalidraw-BEzpvRLx.js → Excalidraw-CWrVL5hs.js} +30 -30
- package/lib/{Excalidraw-qjnQspLq.cjs → Excalidraw-Kb-TRcWY.cjs} +1 -1
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +2 -2
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.js +4 -4
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +4 -4
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +6 -6
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +6 -6
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +14 -14
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +6 -6
- package/lib/History.cjs +1 -1
- package/lib/History.js +13 -13
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +4 -4
- package/lib/{Icon-ONE1AwKo.js → Icon-Ctva8VeB.js} +2 -2
- package/lib/{Icon-CiR8RqdQ.cjs → Icon-yqCglrdK.cjs} +1 -1
- package/lib/{Iframe-DsUNJ2n2.cjs → Iframe-BczF8Hex.cjs} +1 -1
- package/lib/{Iframe-CBTnv2mk.js → Iframe-C942bNjs.js} +12 -12
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +2 -2
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +48 -48
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +15 -15
- package/lib/ImportWord.cjs +2 -2
- package/lib/ImportWord.js +9 -9
- package/lib/{Indent-B00o0P0M.js → Indent-C_O5WdyR.js} +4 -4
- package/lib/{Indent-CaGP0qTp.cjs → Indent-CkEC7x36.cjs} +1 -1
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +4 -4
- package/lib/{Katex-x370CSXZ.js → Katex-D3PEWimM.js} +24 -24
- package/lib/{Katex-XsfpKgJU.cjs → Katex-DW_HjgNM.cjs} +2 -2
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +2 -2
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +14 -14
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/{LinkEditBlock-xt88G5fb.cjs → LinkEditBlock-DL1e2ILk.cjs} +2 -2
- package/lib/{LinkEditBlock-C_ipl3EA.js → LinkEditBlock-h5054QDo.js} +31 -31
- package/lib/Mention.js +3 -3
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.js +28 -29
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +14 -14
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +4 -4
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +17 -17
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +6 -6
- package/lib/{SlashCommandNodeView-BT5ystah.cjs → SlashCommandNodeView-BqrmHCpu.cjs} +1 -1
- package/lib/{SlashCommandNodeView-DX6axvLs.js → SlashCommandNodeView-DXUqkx82.js} +12 -12
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +4 -4
- package/lib/{Table-DidusYID.js → Table-DdrY4jcM.js} +7 -7
- package/lib/{Table-DSRSwtXx.cjs → Table-kY0nbqJo.cjs} +1 -1
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +4 -4
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +16 -16
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +16 -16
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +4 -4
- package/lib/{Twitter-D58T0Zt3.js → Twitter-B-JQ3ZJ1.js} +18 -18
- package/lib/{Twitter-CBuVBQM1.cjs → Twitter-DjZcVa3l.cjs} +1 -1
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +2 -2
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +24 -24
- package/lib/bubble.cjs +4 -4
- package/lib/bubble.js +2083 -1950
- package/lib/button-BS3n6_Aq.cjs +1 -0
- package/lib/{button-9_8t7ca7.js → button-Uv01FNnd.js} +7 -7
- package/lib/{checkbox-BQRKTXXr.cjs → checkbox-C8ByRi7-.cjs} +1 -1
- package/lib/{checkbox-DnkkV6qo.js → checkbox-DEFNwGwb.js} +1 -1
- package/lib/{clsx-DmuN0U_8.js → clsx-BWSGDJNJ.js} +13 -13
- package/lib/components/Bubble/RichTextBubbleCallout.d.ts +1 -0
- package/lib/components/Bubble/index.d.ts +1 -0
- package/lib/components/ui/index.d.ts +1 -0
- package/lib/{dialog-BS3zm-T9.cjs → dialog-Bt5zwGYB.cjs} +1 -1
- package/lib/{dialog-DhayAPvV.js → dialog-DwTMZSt6.js} +1 -1
- package/lib/{dropdown-menu-DQqKeZcx.js → dropdown-menu-BetI14G6.js} +1 -1
- package/lib/{dropdown-menu-CxwWX0yj.cjs → dropdown-menu-Bo68IEOT.cjs} +1 -1
- package/lib/extensions/Callout/Callout.d.ts +18 -0
- package/lib/extensions/Callout/components/NodeViewCallout/NodeViewCallout.d.ts +1 -0
- package/lib/extensions/Callout/components/RichTextCallout.d.ts +1 -0
- package/lib/extensions/Callout/index.d.ts +1 -0
- package/lib/{index-D1jd7elj.js → index-BDKHXe7R.js} +1 -1
- package/lib/{index-CKmT9KAQ.js → index-CHKWG6E8.js} +1 -1
- package/lib/{index-EAK64CCA.js → index-CcoWj0mF.js} +131 -130
- package/lib/index-D3RLYf-J.cjs +1 -0
- package/lib/{index-D9JOHlso.js → index-DF5ZPtWM.js} +369 -482
- package/lib/{index-DdEmgiAA.js → index-DJbmnBzK.js} +1 -1
- package/lib/index-Doks9cbR.cjs +1 -0
- package/lib/{index-BDX1uE62.js → index-Dujzr6bY.js} +135 -39
- package/lib/{index-CBFmXCcU.cjs → index-VhKd73hZ.cjs} +1 -1
- package/lib/{index-DvvwJvau.js → index-mR8PNv5P.js} +23 -23
- package/lib/index.cjs +1 -1
- package/lib/index.js +3 -3
- package/lib/{input-YoheBL2D.js → input-DUBdJD3L.js} +5 -5
- package/lib/{input-BJ7ihMq-.cjs → input-Dt_BA_9B.cjs} +1 -1
- package/lib/{isNumber-DmQXlKp3.js → isNumber-CIgubz2e.js} +1 -1
- package/lib/{label-Y7_hvqf2.cjs → label-JNOksCA-.cjs} +1 -1
- package/lib/{label-C8PLcjFI.js → label-topD46-u.js} +2 -2
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.js +1 -1
- package/lib/locales/en.d.ts +16 -0
- package/lib/locales/fi.d.ts +16 -0
- package/lib/locales/hu.d.ts +16 -0
- package/lib/locales/index.d.ts +96 -0
- package/lib/locales/pt-br.d.ts +16 -0
- package/lib/locales/vi.d.ts +16 -0
- package/lib/locales/zh-cn.d.ts +16 -0
- package/lib/{popover-CWmTzHSy.js → popover-LfNBhRyz.js} +1 -1
- package/lib/{popover-BiSrlM4j.cjs → popover-mL-2sX5r.cjs} +1 -1
- package/lib/select-CwGYPsPq.cjs +1 -0
- package/lib/select-DctYuHLH.js +117 -0
- package/lib/{separator-C-DKMYmg.js → separator-Ddfrhn4D.js} +18 -18
- package/lib/{separator-CJ_adziN.cjs → separator-NoH_SLRW.cjs} +1 -1
- package/lib/{store-BKMaw1AW.cjs → store-CkjKIgjQ.cjs} +1 -1
- package/lib/{store-DG7cMfET.js → store-DNpS8vXA.js} +1 -1
- package/lib/style.css +1 -1
- package/lib/{tabs-DxlKKM-N.js → tabs-BT3AeqQQ.js} +1 -1
- package/lib/{tabs-DpHSMyF_.cjs → tabs-DRSwUeKP.cjs} +1 -1
- package/lib/{textarea-DU9RMi6u.cjs → textarea-BDO6XQoF.cjs} +1 -1
- package/lib/{textarea-D7m-apUh.js → textarea-DZzMEDfZ.js} +1 -1
- package/lib/{throttle-BRtichEP.js → throttle-IERhwcLa.js} +1 -1
- package/lib/{toggle-BYvLnjCL.cjs → toggle-BQHMh_Q-.cjs} +1 -1
- package/lib/{toggle-Bxwwb_Kp.js → toggle-DKHg5sLm.js} +10 -10
- package/lib/{tooltip-COvf4_R-.cjs → tooltip-BYtGp6FM.cjs} +1 -1
- package/lib/{tooltip-BTy5CRrN.js → tooltip-DNKq7zgN.js} +1 -1
- package/lib/{updatePosition-CUukgu-Q.js → updatePosition-Bie75EFq.js} +2 -2
- package/lib/{useButtonProps-CydzndG1.cjs → useButtonProps-DBJkNDS2.cjs} +1 -1
- package/lib/{useButtonProps-CfYtuEnd.js → useButtonProps-DVP4s_ER.js} +3 -3
- package/package.json +1 -1
- package/lib/button-Cs9TroWr.cjs +0 -1
- package/lib/index-CVFzP1Dc.cjs +0 -1
- package/lib/index-CX4pNJlH.cjs +0 -1
package/lib/CodeBlock.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as ta, j as Te, N as na, t as Pt, k as aa, m as ra } from "./clsx-BWSGDJNJ.js";
|
|
2
2
|
import { jsx as C, Fragment as ia, jsxs as tt } from "react/jsx-runtime";
|
|
3
|
-
import { A as sa } from "./toggle-
|
|
3
|
+
import { A as sa } from "./toggle-DKHg5sLm.js";
|
|
4
4
|
import { useRef as $t, useCallback as nt, useEffect as Dt } from "react";
|
|
5
|
-
import { a as oa
|
|
5
|
+
import { a as oa } from "./index-DF5ZPtWM.js";
|
|
6
6
|
import "./theme.js";
|
|
7
|
+
import { S as Ft, a as Ut, b as la, c as Bt, d as Gt } from "./select-DctYuHLH.js";
|
|
7
8
|
import { d as ca } from "./delete-node-IyVmiRbI.js";
|
|
8
|
-
import { I as Ee } from "./Icon-
|
|
9
|
-
import { u as da, a as ua } from "./useButtonProps-
|
|
10
|
-
function
|
|
9
|
+
import { I as Ee } from "./Icon-Ctva8VeB.js";
|
|
10
|
+
import { u as da, a as ua } from "./useButtonProps-DVP4s_ER.js";
|
|
11
|
+
function mr() {
|
|
11
12
|
const e = da(ea.name), {
|
|
12
13
|
icon: t = void 0,
|
|
13
14
|
tooltip: n = void 0,
|
|
@@ -29,17 +30,17 @@ function gr() {
|
|
|
29
30
|
}
|
|
30
31
|
) : /* @__PURE__ */ C(ia, {});
|
|
31
32
|
}
|
|
32
|
-
var xe = {}, j = Symbol(), J = Symbol(),
|
|
33
|
+
var xe = {}, j = Symbol(), J = Symbol(), St = (e) => typeof e == "string" ? _[e] : e, _ = {
|
|
33
34
|
plain: xe,
|
|
34
35
|
plaintext: xe,
|
|
35
36
|
text: xe,
|
|
36
37
|
txt: xe
|
|
37
|
-
},
|
|
38
|
-
for (var n = [e], s, l = [], u = 0; s =
|
|
38
|
+
}, ke = (e, t) => (t[J] || Se)(e, t), Se = (e, t) => {
|
|
39
|
+
for (var n = [e], s, l = [], u = 0; s = St(t[j]); )
|
|
39
40
|
delete t[j], Object.assign(t, s);
|
|
40
41
|
for (xn(e, t, n, 0); l[u++] = n[0], n = n[1]; ) ;
|
|
41
42
|
return l;
|
|
42
|
-
}, zt = "</span>", Oe = "", ye = "",
|
|
43
|
+
}, zt = "</span>", Oe = "", ye = "", Sn = (e) => {
|
|
43
44
|
for (var t = "", n = e.length, s = 0; s < n; ) t += Tn(e[s++]);
|
|
44
45
|
return t;
|
|
45
46
|
}, Tn = (e) => {
|
|
@@ -49,7 +50,7 @@ var xe = {}, j = Symbol(), J = Symbol(), kt = (e) => typeof e == "string" ? _[e]
|
|
|
49
50
|
var E = Tn(s);
|
|
50
51
|
return Oe = l, ye = u, f + E + zt;
|
|
51
52
|
}
|
|
52
|
-
return typeof e != "string" ?
|
|
53
|
+
return typeof e != "string" ? Sn(e) : (e = e.replace(/&/g, "&").replace(/</g, "<"), ye && e.includes(`
|
|
53
54
|
`) ? e.replace(/\n/g, ye + `
|
|
54
55
|
` + Oe) : e);
|
|
55
56
|
}, xn = (e, t, n, s, l) => {
|
|
@@ -57,23 +58,23 @@ var xe = {}, j = Symbol(), J = Symbol(), kt = (e) => typeof e == "string" ? _[e]
|
|
|
57
58
|
if (t[u]) for (var f = 0, E = t[u], y = Array.isArray(E) ? E : [E]; f < y.length; ++f) {
|
|
58
59
|
if (l && l[0] == u && l[1] == f)
|
|
59
60
|
return;
|
|
60
|
-
for (var v = y[f], m = v.pattern || v, p =
|
|
61
|
+
for (var v = y[f], m = v.pattern || v, p = St(v.inside), c = v.lookbehind, b = v.greedy && m.global, g = v.alias, a = n, r = s; a && (!l || r < l[2]); r += a[0].length, a = a[1]) {
|
|
61
62
|
var d = a[0], o = 0, i, h;
|
|
62
63
|
if (!(d instanceof ue)) {
|
|
63
64
|
if (m.lastIndex = b ? r : 0, i = m.exec(b ? e : d), i && c && i[1] && (h = i[1].length, i.index += h, i[0] = i[0].slice(h)), b) {
|
|
64
65
|
if (!i)
|
|
65
66
|
break;
|
|
66
67
|
if (i[0]) {
|
|
67
|
-
for (var
|
|
68
|
+
for (var S = i.index, k = S + i[0].length, I; S >= r + (I = a[0].length); a = a[1], r += I) ;
|
|
68
69
|
if (a[0] instanceof ue)
|
|
69
70
|
continue;
|
|
70
|
-
for (var w = a, E = r; (E += w[0].length) <
|
|
71
|
+
for (var w = a, E = r; (E += w[0].length) < k; w = w[1], o++) ;
|
|
71
72
|
d = e.slice(r, E), i.index -= r;
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
75
|
if (i && i[0]) {
|
|
75
|
-
for (var
|
|
76
|
-
T && (!M || M[0] instanceof ue ? M = [T, M] : M[0] = T + M[0]), r +=
|
|
76
|
+
for (var S = i.index, x = i[0], T = d.slice(S + x.length), N = r + d.length, P = new ue(u, p ? ke(x, p) : x, x, g), M = a, V = 0, z; M = M[1], V++ < o; ) ;
|
|
77
|
+
T && (!M || M[0] instanceof ue ? M = [T, M] : M[0] = T + M[0]), r += S, a[0] = S ? d.slice(0, S) : P, S ? a = a[1] = [P, M] : a[1] = M, o && (xn(e, t, a, r, z = [u, f, N]), N = z[2]), l && N > l[2] && (l[2] = N);
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
80
|
}
|
|
@@ -1509,7 +1510,7 @@ _.js = _.javascript = Object.assign(lt, {
|
|
|
1509
1510
|
punctuation: /\?\.|[()[\]{}.,:;]/
|
|
1510
1511
|
});
|
|
1511
1512
|
var Dn = (e) => (t, n) => {
|
|
1512
|
-
for (var s =
|
|
1513
|
+
for (var s = St(e), l = "", u = [], f = 0, E = Se(t, n), y = 0, v = E.length, g = 0; y < v; ) {
|
|
1513
1514
|
var m = E[y++], p = m.length, c = m.type;
|
|
1514
1515
|
c && c.slice(0, 6) != "ignore" ? (u[f++] = [g, m], l += " ".repeat(p)) : l += t.slice(g, g + p), g += p;
|
|
1515
1516
|
}
|
|
@@ -1519,12 +1520,12 @@ var Dn = (e) => (t, n) => {
|
|
|
1519
1520
|
if (Array.isArray(h))
|
|
1520
1521
|
a(h);
|
|
1521
1522
|
else {
|
|
1522
|
-
for (var
|
|
1523
|
+
for (var k = i.length, I = [], w, S, x = 0, T = g; ([w, S] = u[b], w >= g && w < g + k) && (T < w && (I[x++] = l.slice(T, w)), T = w + S.length, I[x++] = S, ++b != f); )
|
|
1523
1524
|
;
|
|
1524
|
-
g +=
|
|
1525
|
+
g += k, x && (T < g && (I[x++] = l.slice(T, g)), h ? i.content = I : (d.splice(o, 1, ...I), o += x - 1));
|
|
1525
1526
|
}
|
|
1526
1527
|
}
|
|
1527
|
-
}, r = s ?
|
|
1528
|
+
}, r = s ? ke(l, s) : [l];
|
|
1528
1529
|
return a(r), r;
|
|
1529
1530
|
}, Fn = _.js, xt = Fn["template-string"], ma = xt.pattern.source, ha = xt.inside.interpolation.pattern, de = (e, t) => ({
|
|
1530
1531
|
pattern: RegExp("((?:" + t + ")\\s*)" + ma, "g"),
|
|
@@ -1628,7 +1629,7 @@ var De = "\\s|//.*(?!.)|/\\*(?:[^*]|\\*(?!/))*\\*/", _t = "\\{(?:[^{}]|\\{(?:[^{
|
|
|
1628
1629
|
}
|
|
1629
1630
|
}
|
|
1630
1631
|
}
|
|
1631
|
-
}), e[J] = (n, s) => _a(
|
|
1632
|
+
}), e[J] = (n, s) => _a(Se(n, s), n, 0);
|
|
1632
1633
|
};
|
|
1633
1634
|
Un(_.js, "jsx");
|
|
1634
1635
|
_.lua = {
|
|
@@ -2179,7 +2180,7 @@ $(ne, "class-name", {
|
|
|
2179
2180
|
});
|
|
2180
2181
|
var Zn = Vn + "|" + Hn, qn = F(`/(?![*/])|//[^
|
|
2181
2182
|
]*
|
|
2182
|
-
|/\\*(?:[^*]|\\*(?!/))*\\*/|<0>`, [Zn]), Kn = me(F(`[^()"'/]|<0>|\\(<self>*\\)`, [qn]), 2), ln = "\\b(?:assembly|event|field|method|module|param|property|return|type)\\b",
|
|
2183
|
+
|/\\*(?:[^*]|\\*(?!/))*\\*/|<0>`, [Zn]), Kn = me(F(`[^()"'/]|<0>|\\(<self>*\\)`, [qn]), 2), ln = "\\b(?:assembly|event|field|method|module|param|property|return|type)\\b", ka = F("<0>(?:\\s*\\(<1>*\\))?", [le, Kn]), Lt = `:[^
|
|
2183
2184
|
}]+`, Wn = me(F(`[^()"'/]|<0>|\\(<self>*\\)`, [qn]), 2), cn = F("\\{(?!\\{)(?:(?![}:])<0>)*<1>?\\}", [Wn, Lt]), jn = me(F(`[^()"'/]|/(?!\\*)|/\\*(?:[^*]|\\*(?!/))*\\*/|<0>|\\(<self>*\\)`, [Zn]), 2), dn = F("\\{(?!\\{)(?:(?![}:])<0>)*<1>?\\}", [jn, Lt]), un = (e, t) => ({
|
|
2184
2185
|
interpolation: {
|
|
2185
2186
|
pattern: O("((?:^|[^{])(?:\\{\\{)*)<0>", [e]),
|
|
@@ -2206,7 +2207,7 @@ $(ne, "class-name", {
|
|
|
2206
2207
|
attribute: {
|
|
2207
2208
|
// Attributes
|
|
2208
2209
|
// [Foo], [Foo(1), Bar(2, Prop = "foo")], [return: Foo(1), Bar(2)], [assembly: Foo(Bar)]
|
|
2209
|
-
pattern: O("((?:^|[^\\s\\w>)?])\\s*\\[\\s*)(?:<0>\\s*:\\s*)?<1>(?:\\s*,\\s*<1>)*(?=\\s*\\])", [ln,
|
|
2210
|
+
pattern: O("((?:^|[^\\s\\w>)?])\\s*\\[\\s*)(?:<0>\\s*:\\s*)?<1>(?:\\s*,\\s*<1>)*(?=\\s*\\])", [ln, ka], "g"),
|
|
2210
2211
|
lookbehind: !0,
|
|
2211
2212
|
greedy: !0,
|
|
2212
2213
|
inside: {
|
|
@@ -2309,7 +2310,7 @@ _.graphql = {
|
|
|
2309
2310
|
punctuation: /[()[\]{},:!=]/,
|
|
2310
2311
|
property: /\w+/,
|
|
2311
2312
|
[J](e, t) {
|
|
2312
|
-
for (var n =
|
|
2313
|
+
for (var n = Se(e, t), s = n.filter(({ type: a }) => a && a != "comment" && a != "scalar"), l = s.length, u = 0, f = (a) => {
|
|
2313
2314
|
for (var r = 0; r < a.length; r++)
|
|
2314
2315
|
if (u + r == l || s[u + r].type != a[r])
|
|
2315
2316
|
return !0;
|
|
@@ -2517,7 +2518,7 @@ try {
|
|
|
2517
2518
|
Et.lookbehind = !0;
|
|
2518
2519
|
}
|
|
2519
2520
|
Et.pattern = RegExp(Xn + `[^\\w$])|(?=</))${Et.pattern.source}`, "g");
|
|
2520
|
-
var yt = /[*&][^\s[\]{},]+/, vt = /!(?:<[\w%#;/?:@&=$,.!~*'()[\]+-]+>|(?:[a-zA-Z\d-]*!)?[\w%#;/?:@&=$.~*'()+-]+)?/, wt = `(?:${vt.source}(?:[ ]+${yt.source})?|${yt.source}(?:[ ]+${vt.source})?)`,
|
|
2521
|
+
var yt = /[*&][^\s[\]{},]+/, vt = /!(?:<[\w%#;/?:@&=$,.!~*'()[\]+-]+>|(?:[a-zA-Z\d-]*!)?[\w%#;/?:@&=$.~*'()+-]+)?/, wt = `(?:${vt.source}(?:[ ]+${yt.source})?|${yt.source}(?:[ ]+${vt.source})?)`, Sa = F(
|
|
2521
2522
|
"(?:[^\\s\0-\\x08\\x0e-\\x1f!\"#%&'*,:>?@[\\]{}`|\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff-]|[?:-]<0>)(?:[ ]*(?:(?![#:])<0>|:<0>))*",
|
|
2522
2523
|
["[^\\s\0-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]"]
|
|
2523
2524
|
), pn = `"(?:\\\\.|[^\\\\
|
|
@@ -2540,7 +2541,7 @@ _.yml = _.yaml = {
|
|
|
2540
2541
|
pattern: O(
|
|
2541
2542
|
`((?:^|[:,[{
|
|
2542
2543
|
?-])[ ]*(?:<0>[ ]+)?)<1>(?=\\s*:\\s)`,
|
|
2543
|
-
[wt, "(?:" +
|
|
2544
|
+
[wt, "(?:" + Sa + "|" + pn + ")"],
|
|
2544
2545
|
"g"
|
|
2545
2546
|
),
|
|
2546
2547
|
lookbehind: !0,
|
|
@@ -2983,7 +2984,7 @@ _.php = {
|
|
|
2983
2984
|
alias: "language-php",
|
|
2984
2985
|
inside: vn
|
|
2985
2986
|
},
|
|
2986
|
-
[J]: (e, t) => e.includes("<?") ? Na(e, t) :
|
|
2987
|
+
[J]: (e, t) => e.includes("<?") ? Na(e, t) : ke(e, vn)
|
|
2987
2988
|
};
|
|
2988
2989
|
var La = [`(?:\\\\.|[^\\\\
|
|
2989
2990
|
]|
|
|
@@ -3061,10 +3062,10 @@ $(be, "prolog", {
|
|
|
3061
3062
|
"code-language": /^.+/,
|
|
3062
3063
|
"code-block": /(?!^)[^]+(?=\n)/,
|
|
3063
3064
|
[J](e, t) {
|
|
3064
|
-
var n =
|
|
3065
|
+
var n = Se(e, t), s;
|
|
3065
3066
|
return n[5] && (s = (/[a-z][\w-]*/i.exec(
|
|
3066
3067
|
n[1].content.replace(/\b#/g, "sharp").replace(/\b\+\+/g, "pp")
|
|
3067
|
-
) || [""])[0].toLowerCase(), n[3].alias = "language-" + s, (t = _[s]) && (n[3].content =
|
|
3068
|
+
) || [""])[0].toLowerCase(), n[3].alias = "language-" + s, (t = _[s]) && (n[3].content = ke(n[3].content, t))), n;
|
|
3068
3069
|
}
|
|
3069
3070
|
}
|
|
3070
3071
|
}
|
|
@@ -3222,12 +3223,12 @@ $(be, "prolog", {
|
|
|
3222
3223
|
const Ma = (e, t, ...n) => {
|
|
3223
3224
|
var Y;
|
|
3224
3225
|
let s, l, u = [], f, E = "", y, v = !1, m = !1, p = !0, c = [], b, g = 0;
|
|
3225
|
-
const a = $a(), r = a.firstChild, d = r.children, o = d[0], i = o.firstChild, h = { language: "text", value: E },
|
|
3226
|
+
const a = $a(), r = a.firstChild, d = r.children, o = d[0], i = o.firstChild, h = { language: "text", value: E }, k = new Set(n), I = {}, w = (A) => {
|
|
3226
3227
|
if (Object.assign(h, A), E = A.value ?? E, s = h.language, !_[s]) throw Error(`Language '${s}' has no grammar.`);
|
|
3227
|
-
b = !!h.readOnly, a.style.tabSize = h.tabSize || 2, i.inputMode = b ? "none" : "", i.setAttribute("aria-readonly", b), T(), x(), (l != (l = _[s]) || E != i.value) && (V(), i.value = E, i.selectionEnd = 0,
|
|
3228
|
-
},
|
|
3229
|
-
c =
|
|
3230
|
-
let A =
|
|
3228
|
+
b = !!h.readOnly, a.style.tabSize = h.tabSize || 2, i.inputMode = b ? "none" : "", i.setAttribute("aria-readonly", b), T(), x(), (l != (l = _[s]) || E != i.value) && (V(), i.value = E, i.selectionEnd = 0, S());
|
|
3229
|
+
}, S = () => {
|
|
3230
|
+
c = ke(E = i.value, l), z("tokenize", c, s, E);
|
|
3231
|
+
let A = Sn(c).split(`
|
|
3231
3232
|
`), R = 0, L = g, Z = g = A.length;
|
|
3232
3233
|
for (; A[R] == u[R] && R < Z; ) ++R;
|
|
3233
3234
|
for (; Z && A[--Z] == u[--L]; ) ;
|
|
@@ -3246,8 +3247,8 @@ const Ma = (e, t, ...n) => {
|
|
|
3246
3247
|
}
|
|
3247
3248
|
z("update", E), U(!0), p && setTimeout(setTimeout, 0, () => p = !0), u = A, p = !1;
|
|
3248
3249
|
}, x = (A) => {
|
|
3249
|
-
(A ||
|
|
3250
|
-
typeof R == "object" ? (R.update(D, h), A &&
|
|
3250
|
+
(A || k).forEach((R) => {
|
|
3251
|
+
typeof R == "object" ? (R.update(D, h), A && k.add(R)) : (R(D, h), A || k.delete(R));
|
|
3251
3252
|
});
|
|
3252
3253
|
}, T = ([A, R] = N()) => {
|
|
3253
3254
|
a.className = `prism-code-editor language-${s}${h.lineNumbers == !1 ? "" : " show-line-numbers"} pce-${h.wordWrap ? "" : "no"}wrap${h.rtl ? " pce-rtl" : ""} pce-${A < R ? "has" : "no"}-selection${m ? " pce-focus" : ""}${b ? " pce-readonly" : ""}`;
|
|
@@ -3303,7 +3304,7 @@ const Ma = (e, t, ...n) => {
|
|
|
3303
3304
|
keyCommandMap: P,
|
|
3304
3305
|
extensions: {},
|
|
3305
3306
|
setOptions: w,
|
|
3306
|
-
update:
|
|
3307
|
+
update: S,
|
|
3307
3308
|
getSelection: N,
|
|
3308
3309
|
setSelection(A, R = A, L) {
|
|
3309
3310
|
V(), i.setSelectionRange(A, R, L), U(!0);
|
|
@@ -3328,7 +3329,7 @@ const Ma = (e, t, ...n) => {
|
|
|
3328
3329
|
}), G(D, "beforeinput", (A) => {
|
|
3329
3330
|
var R;
|
|
3330
3331
|
(b || A.inputType == "insertText" && ((R = M[A.data]) != null && R.call(M, A, N(), E))) && B(A);
|
|
3331
|
-
}), G(D, "input",
|
|
3332
|
+
}), G(D, "input", S), G(D, "blur", () => {
|
|
3332
3333
|
Re = null, m = !1, T();
|
|
3333
3334
|
}), G(D, "focus", () => {
|
|
3334
3335
|
Re = U, m = !0, T();
|
|
@@ -3394,32 +3395,32 @@ const we = (e) => e.replace(/[$+?|.^*()[\]{}\\]/g, "\\$&"), Rt = (e, t) => e.sli
|
|
|
3394
3395
|
t.replace(/&/g, "&").replace(/</g, "<")
|
|
3395
3396
|
), y && f.selectionStart++) : document.execCommand(t ? "insertText" : "delete", !1, t), fe = 0;
|
|
3396
3397
|
}, Ie = (e) => e.altKey + e.ctrlKey * 2 + e.metaKey * 4 + e.shiftKey * 8;
|
|
3397
|
-
let
|
|
3398
|
-
const In = navigator.clipboard, oe = qe ? 4 : 2, Ba = (e) =>
|
|
3398
|
+
let kt = !1;
|
|
3399
|
+
const In = navigator.clipboard, oe = qe ? 4 : 2, Ba = (e) => kt = e, se = (e) => e.search(/\S|$/), Ga = (e = ['""', "''", "``", "()", "[]", "{}"], t = /([^$\w'"`]["'`]|.[[({])[.,:;\])}>\s]|.[[({]`/s) => (n, s) => {
|
|
3399
3400
|
let l;
|
|
3400
3401
|
const { keyCommandMap: u, inputCommandMap: f, getSelection: E, scrollContainer: y } = n, v = ({ insertSpaces: a = !0, tabSize: r } = s) => [a ? " " : " ", a ? r || 2 : 1], m = () => {
|
|
3401
3402
|
var a;
|
|
3402
3403
|
return !s.readOnly && !((a = n.extensions.cursor) != null && a.scrollIntoView());
|
|
3403
3404
|
}, p = ([a, r], [d, o], i, h) => (a < r || !h && t.test((i[r - 1] || " ") + d + (i[r] || " "))) && !H(n, d + i.slice(a, r) + o, null, null, a + 1, r + 1), c = ([a, r], d, o) => a == r && o[r] == d && !n.setSelection(a + 1), b = (a, r, d, o, i, h) => {
|
|
3404
|
-
let
|
|
3405
|
+
let k = r.join(`
|
|
3405
3406
|
`);
|
|
3406
|
-
if (
|
|
3407
|
+
if (k != a.join(`
|
|
3407
3408
|
`)) {
|
|
3408
|
-
const I = a.length - 1, w = r[I],
|
|
3409
|
+
const I = a.length - 1, w = r[I], S = a[I], x = S.length - w.length, T = r[0].length - a[0].length, N = d + se((T < 0 ? r : a)[0]), P = o - S.length + se(x > 0 ? w : S), M = d - o + k.length + x, V = N > i ? i : Math.max(N, i + T), z = h + d - o + k.length;
|
|
3409
3410
|
H(
|
|
3410
3411
|
n,
|
|
3411
|
-
|
|
3412
|
+
k,
|
|
3412
3413
|
d,
|
|
3413
3414
|
o,
|
|
3414
3415
|
V,
|
|
3415
3416
|
h < P ? z + x : Math.max(P + M, z)
|
|
3416
3417
|
);
|
|
3417
3418
|
}
|
|
3418
|
-
}, g = (a, r, d, o, i, h,
|
|
3419
|
+
}, g = (a, r, d, o, i, h, k, I) => {
|
|
3419
3420
|
b(
|
|
3420
3421
|
r,
|
|
3421
3422
|
r.map(
|
|
3422
|
-
a ? (w) => w.slice(se(w) ? I - se(w) % I : 0) : (w) => w &&
|
|
3423
|
+
a ? (w) => w.slice(se(w) ? I - se(w) % I : 0) : (w) => w && k.repeat(I - se(w) % I) + w
|
|
3423
3424
|
),
|
|
3424
3425
|
d,
|
|
3425
3426
|
o,
|
|
@@ -3435,56 +3436,56 @@ const In = navigator.clipboard, oe = qe ? 4 : 2, Ba = (e) => St = e, se = (e) =>
|
|
|
3435
3436
|
const o = (h = (i = ct[dt(n)]) == null ? void 0 : i.autoCloseTags) == null ? void 0 : h.call(i, r, d, n);
|
|
3436
3437
|
o && (H(n, ">" + o, null, null, r[0] + 1), B(a));
|
|
3437
3438
|
}, u.Tab = (a, [r, d], o) => {
|
|
3438
|
-
if (
|
|
3439
|
-
const [i, h] = v(s),
|
|
3440
|
-
return r < d ||
|
|
3439
|
+
if (kt || s.readOnly || Ie(a) & 6) return;
|
|
3440
|
+
const [i, h] = v(s), k = a.shiftKey, [I, w, S] = ee(o, r, d);
|
|
3441
|
+
return r < d || k ? g(k, I, w, S, r, d, i, h) : H(n, i.repeat(h - (r - w) % h)), m();
|
|
3441
3442
|
}, u.Enter = (a, r, d) => {
|
|
3442
|
-
var i, h,
|
|
3443
|
+
var i, h, k;
|
|
3443
3444
|
const o = Ie(a) & 7;
|
|
3444
3445
|
if (!o || o == oe) {
|
|
3445
3446
|
o && (r[0] = r[1] = ee(d, r[1])[2]);
|
|
3446
|
-
const [I, w] = v(), [
|
|
3447
|
+
const [I, w] = v(), [S, x] = r, T = (i = ct[dt(n)]) == null ? void 0 : i.autoIndent, N = Math.floor(se(Rt(d, S)) / w) * w, P = (h = T == null ? void 0 : T[0]) != null && h.call(T, r, d, n) ? w : 0, M = (k = T == null ? void 0 : T[1]) == null ? void 0 : k.call(T, r, d, n), V = `
|
|
3447
3448
|
` + I.repeat(N + P) + (M ? `
|
|
3448
3449
|
` + I.repeat(N) : "");
|
|
3449
3450
|
if (V[1] || d[x])
|
|
3450
|
-
return H(n, V,
|
|
3451
|
+
return H(n, V, S, x, S + N + P + 1), m();
|
|
3451
3452
|
}
|
|
3452
3453
|
}, u.Backspace = (a, [r, d], o) => {
|
|
3453
3454
|
if (r == d) {
|
|
3454
|
-
const i = Rt(o, r), h = s.tabSize || 2,
|
|
3455
|
-
if (
|
|
3456
|
-
return H(n, "", r - (
|
|
3455
|
+
const i = Rt(o, r), h = s.tabSize || 2, k = e.includes(o.slice(r - 1, r + 1)), I = /[^ ]/.test(i) ? 0 : (i.length - 1) % h + 1;
|
|
3456
|
+
if (k || I > 1)
|
|
3457
|
+
return H(n, "", r - (k ? 1 : I), r + k), m();
|
|
3457
3458
|
}
|
|
3458
3459
|
};
|
|
3459
3460
|
for (let a = 0; a < 2; a++)
|
|
3460
3461
|
u[a ? "ArrowDown" : "ArrowUp"] = (r, [d, o], i) => {
|
|
3461
3462
|
const h = Ie(r);
|
|
3462
3463
|
if (h == 1) {
|
|
3463
|
-
const
|
|
3464
|
+
const k = a ? d : We(i, d) - 1, I = a ? i.indexOf(`
|
|
3464
3465
|
`, o) + 1 : o;
|
|
3465
|
-
if (
|
|
3466
|
-
const [w,
|
|
3466
|
+
if (k > -1 && I > 0) {
|
|
3467
|
+
const [w, S, x] = ee(i, k, I), T = w[a ? "pop" : "shift"](), N = (T.length + 1) * (a ? 1 : -1);
|
|
3467
3468
|
w[a ? "unshift" : "push"](T), H(n, w.join(`
|
|
3468
|
-
`),
|
|
3469
|
+
`), S, x, d + N, o + N);
|
|
3469
3470
|
}
|
|
3470
3471
|
return m();
|
|
3471
3472
|
} else if (h == 9) {
|
|
3472
|
-
const [
|
|
3473
|
-
`), x = a ?
|
|
3474
|
-
return H(n,
|
|
3475
|
-
` +
|
|
3473
|
+
const [k, I, w] = ee(i, d, o), S = k.join(`
|
|
3474
|
+
`), x = a ? S.length + 1 : 0;
|
|
3475
|
+
return H(n, S + `
|
|
3476
|
+
` + S, I, w, d + x, o + x), m();
|
|
3476
3477
|
} else if (h == 2 && !qe)
|
|
3477
3478
|
return y.scrollBy(0, Ua(y, "lineHeight") * (a ? 1 : -1)), !0;
|
|
3478
3479
|
};
|
|
3479
3480
|
G(n, "keydown", (a) => {
|
|
3480
|
-
var
|
|
3481
|
+
var k;
|
|
3481
3482
|
const r = Ie(a), d = a.keyCode, [o, i, h] = E();
|
|
3482
3483
|
if (r == oe && (d == 221 || d == 219))
|
|
3483
3484
|
g(d == 219, ...ee(n.value, o, i), o, i, ...v()), m(), B(a);
|
|
3484
3485
|
else if (r == (qe ? 10 : 2) && d == 77)
|
|
3485
|
-
Ba(!
|
|
3486
|
+
Ba(!kt), B(a);
|
|
3486
3487
|
else if (d == 191 && r == oe || d == 65 && r == 9) {
|
|
3487
|
-
const I = n.value, w = r == 9,
|
|
3488
|
+
const I = n.value, w = r == 9, S = w ? o : We(I, o), x = ct[dt(n, S)] || {}, { line: T, block: N } = ((k = x.getComments) == null ? void 0 : k.call(x, n, S, I)) || x.comments || {}, [P, M, V] = ee(I, o, i), z = P.length - 1;
|
|
3488
3489
|
if (w) {
|
|
3489
3490
|
if (N) {
|
|
3490
3491
|
const [U, D] = N, Y = I.slice(o, i), A = I.slice(0, o).search(we(U) + " ?$"), R = RegExp("^ ?" + we(D)).test(I.slice(i));
|
|
@@ -3522,22 +3523,22 @@ const In = navigator.clipboard, oe = qe ? 4 : 2, Ba = (e) => St = e, se = (e) =>
|
|
|
3522
3523
|
H(n, Z, M, V, K, Math.max(K, _e)), m(), B(a);
|
|
3523
3524
|
}
|
|
3524
3525
|
} else if (r == 8 + oe && d == 75) {
|
|
3525
|
-
const I = n.value, [w,
|
|
3526
|
+
const I = n.value, [w, S, x] = ee(I, o, i), T = h > "f" ? i - x + w.pop().length : o - S, N = et(I, x + 1) - x - 1;
|
|
3526
3527
|
H(
|
|
3527
3528
|
n,
|
|
3528
3529
|
"",
|
|
3529
|
-
|
|
3530
|
-
x + !
|
|
3531
|
-
|
|
3530
|
+
S - !!S,
|
|
3531
|
+
x + !S,
|
|
3532
|
+
S + Math.min(T, N)
|
|
3532
3533
|
), m(), B(a);
|
|
3533
3534
|
}
|
|
3534
3535
|
}), ["copy", "cut", "paste"].forEach(
|
|
3535
3536
|
(a) => G(n, a, (r) => {
|
|
3536
3537
|
const [d, o] = E();
|
|
3537
3538
|
if (d == o && In) {
|
|
3538
|
-
const [[i], h,
|
|
3539
|
+
const [[i], h, k] = ee(n.value, d, o);
|
|
3539
3540
|
a == "paste" ? r.clipboardData.getData("text/plain") == l && (H(n, l + `
|
|
3540
|
-
`, h, h, d + l.length + 1), m(), B(r)) : (In.writeText(l = i), a == "cut" && (H(n, "", h,
|
|
3541
|
+
`, h, h, d + l.length + 1), m(), B(r)) : (In.writeText(l = i), a == "cut" && (H(n, "", h, k + 1), m()), B(r));
|
|
3541
3542
|
}
|
|
3542
3543
|
})
|
|
3543
3544
|
);
|
|
@@ -3556,8 +3557,8 @@ const In = navigator.clipboard, oe = qe ? 4 : 2, Ba = (e) => St = e, se = (e) =>
|
|
|
3556
3557
|
/history/.test(i) ? (b(t + (i[7] == "U" ? -1 : 1)), B(d)) : (y = s && (u == i || h - E < 99 && i.slice(-4) == "Drop") && !fe && (o != " " || f == o)) || (p[t][2] = fe || m()), l = !0, f = o, E = h, u = i;
|
|
3557
3558
|
}), G(a, "input", () => c(t + !y)), G(a, "keydown", (d) => {
|
|
3558
3559
|
if (!r.readOnly) {
|
|
3559
|
-
const o = Ie(d), i = d.keyCode, h = o == oe && i == 90,
|
|
3560
|
-
h ? (b(t - 1), B(d)) :
|
|
3560
|
+
const o = Ie(d), i = d.keyCode, h = o == oe && i == 90, k = o == oe + 8 && i == 90 || !qe && o == oe && i == 89;
|
|
3561
|
+
h ? (b(t - 1), B(d)) : k && (b(t + 1), B(d));
|
|
3561
3562
|
}
|
|
3562
3563
|
});
|
|
3563
3564
|
};
|
|
@@ -3597,10 +3598,10 @@ const In = navigator.clipboard, oe = qe ? 4 : 2, Ba = (e) => St = e, se = (e) =>
|
|
|
3597
3598
|
const g = p(b.split(`
|
|
3598
3599
|
`)), a = g.length;
|
|
3599
3600
|
for (let r = 0, d = [], o = g[0]; o; r++) {
|
|
3600
|
-
const i = (u[r] || (u[r] = qa())).style, [h,
|
|
3601
|
-
o = g[r + 1], h != (w == null ? void 0 : w[0]) && (i.top = h + "00%"),
|
|
3602
|
-
const
|
|
3603
|
-
for (let T = -
|
|
3601
|
+
const i = (u[r] || (u[r] = qa())).style, [h, k, I] = o, w = f[r];
|
|
3602
|
+
o = g[r + 1], h != (w == null ? void 0 : w[0]) && (i.top = h + "00%"), k != (w == null ? void 0 : w[1]) && (i.height = k + "00%"), I != (w == null ? void 0 : w[2]) && (i.left = I * 100 + "%");
|
|
3603
|
+
const S = d[0] != h && (o == null ? void 0 : o[0]) != h, x = d[0] + d[1] != h + k && (o == null ? void 0 : o[0]) + (o == null ? void 0 : o[1]) != h + k;
|
|
3604
|
+
for (let T = -S, N = k + x; T < N; T++)
|
|
3604
3605
|
n[T + h] = r;
|
|
3605
3606
|
d = f[r] = g[r];
|
|
3606
3607
|
}
|
|
@@ -3612,12 +3613,12 @@ const In = navigator.clipboard, oe = qe ? 4 : 2, Ba = (e) => St = e, se = (e) =>
|
|
|
3612
3613
|
}, p = (b) => {
|
|
3613
3614
|
const g = b.length, a = [], r = [];
|
|
3614
3615
|
for (let d = 0, o = -1, i = 0, h = 0; ; i++) {
|
|
3615
|
-
const
|
|
3616
|
+
const k = i == g, I = k ? 0 : y[i] = c(b[i]);
|
|
3616
3617
|
if (I < 0)
|
|
3617
3618
|
o < 0 && (o = i);
|
|
3618
3619
|
else {
|
|
3619
3620
|
for (let w = I; w < d; w++)
|
|
3620
|
-
a[w][1] = (o < 0 || w == I && !
|
|
3621
|
+
a[w][1] = (o < 0 || w == I && !k ? i : o) - a[w][0];
|
|
3621
3622
|
for (let w = d; w < I; )
|
|
3622
3623
|
r[h++] = a[w] = [
|
|
3623
3624
|
o < 0 || w > d ? i : o,
|
|
@@ -3626,7 +3627,7 @@ const In = navigator.clipboard, oe = qe ? 4 : 2, Ba = (e) => St = e, se = (e) =>
|
|
|
3626
3627
|
];
|
|
3627
3628
|
o = -1, d = I;
|
|
3628
3629
|
}
|
|
3629
|
-
if (
|
|
3630
|
+
if (k) break;
|
|
3630
3631
|
}
|
|
3631
3632
|
return y.length = g, r;
|
|
3632
3633
|
}, c = (b) => {
|
|
@@ -3690,8 +3691,8 @@ const In = navigator.clipboard, oe = qe ? 4 : 2, Ba = (e) => St = e, se = (e) =>
|
|
|
3690
3691
|
if (E[s] = [b, c, 0, r, !!d, c + a], d) u[l++] = [s, d];
|
|
3691
3692
|
else
|
|
3692
3693
|
for (let i = l; i; ) {
|
|
3693
|
-
let [h,
|
|
3694
|
-
o ==
|
|
3694
|
+
let [h, k] = u[--i];
|
|
3695
|
+
o == k && (y[y[s] = h] = s, E[s][2] = E[h][2] = l = i, i = 0);
|
|
3695
3696
|
}
|
|
3696
3697
|
s++;
|
|
3697
3698
|
}
|
|
@@ -3713,8 +3714,8 @@ const In = navigator.clipboard, oe = qe ? 4 : 2, Ba = (e) => St = e, se = (e) =>
|
|
|
3713
3714
|
const o = r[0].length, i = r[2] ? n.substr(p + o, r[1].length) : "", h = r[r.length - 1].length < 2 && (c || !Xa.test(i));
|
|
3714
3715
|
if (r[2] && c && y(r, m, p), h)
|
|
3715
3716
|
if (o > 1)
|
|
3716
|
-
for (let
|
|
3717
|
-
i == f[--
|
|
3717
|
+
for (let k = u; k; )
|
|
3718
|
+
i == f[--k][1] && (t[t[l] = f[u = k][0]] = l, k = 0);
|
|
3718
3719
|
else
|
|
3719
3720
|
f[u++] = [l, i];
|
|
3720
3721
|
s[l++] = [
|
|
@@ -3752,7 +3753,7 @@ const In = navigator.clipboard, oe = qe ? 4 : 2, Ba = (e) => St = e, se = (e) =>
|
|
|
3752
3753
|
let v, m, p;
|
|
3753
3754
|
E == y && e.focused && (p = Ja(E, l), p + 1 && (p = u[p], p + 1 && (v = je(e, ".tag>.tag")) && (m = je(e, ".tag>.tag", 2, 0, l[p][1])))), n != v && (f(!0), n = v, s = m, f());
|
|
3754
3755
|
});
|
|
3755
|
-
}, tr = "_wrap_1x3wi_1", nr = "_blockInfoEditable_1x3wi_30",
|
|
3756
|
+
}, tr = "_wrap_1x3wi_1", nr = "_blockInfoEditable_1x3wi_30", kn = {
|
|
3756
3757
|
wrap: tr,
|
|
3757
3758
|
blockInfoEditable: nr
|
|
3758
3759
|
}, Pe = [
|
|
@@ -3849,13 +3850,13 @@ function ar(e) {
|
|
|
3849
3850
|
const g = m(e.node.attrs);
|
|
3850
3851
|
(b = l.current) == null || b.setOptions(g);
|
|
3851
3852
|
}
|
|
3852
|
-
}, [l, e.node.attrs]), /* @__PURE__ */ C(ta, { className: Te(
|
|
3853
|
+
}, [l, e.node.attrs]), /* @__PURE__ */ C(ta, { className: Te(kn.wrap, "render-wrapper"), children: /* @__PURE__ */ C(
|
|
3853
3854
|
"div",
|
|
3854
3855
|
{
|
|
3855
3856
|
onClick: p,
|
|
3856
3857
|
ref: n,
|
|
3857
3858
|
className: Te("richtext-node-container richtext-hover-shadow richtext-select-outline richtext-node-code-block !richtext-my-[10px]", {
|
|
3858
|
-
[
|
|
3859
|
+
[kn.blockInfoEditable]: !t
|
|
3859
3860
|
}),
|
|
3860
3861
|
children: /* @__PURE__ */ tt("div", { className: "richtext-code-block-toolbar", children: [
|
|
3861
3862
|
/* @__PURE__ */ C("div", { children: /* @__PURE__ */ tt(
|
|
@@ -4106,7 +4107,7 @@ const rr = /^`{3}([a-z]+)?\s$/, ir = /^~{3}([a-z]+)?\s$/, ea = /* @__PURE__ */ n
|
|
|
4106
4107
|
});
|
|
4107
4108
|
export {
|
|
4108
4109
|
ea as CodeBlock,
|
|
4109
|
-
|
|
4110
|
+
mr as RichTextCodeBlock,
|
|
4110
4111
|
rr as backtickInputRegex,
|
|
4111
4112
|
ir as tildeInputRegex
|
|
4112
4113
|
};
|
package/lib/CodeView.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./clsx-CXbNJWDD.cjs"),n=require("react/jsx-runtime"),v=require("./toggle-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./clsx-CXbNJWDD.cjs"),n=require("react/jsx-runtime"),v=require("./toggle-BQHMh_Q-.cjs");require("react");require("./index-D3RLYf-J.cjs");require("./theme.cjs");const r=require("./useButtonProps-DBJkNDS2.cjs");function w(){const e=r.useButtonProps(a.name),{icon:t=void 0,tooltip:o=void 0,shortcutKeys:i=void 0,tooltipOptions:d={},action:s=void 0,isActive:u=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:l,disabled:c,update:p}=r.useToggleActive(u),g=()=>{c||s&&(s(),p())};return e?n.jsx(v.ActionButton,{action:g,dataState:l,disabled:c,icon:t,shortcutKeys:i,tooltip:o,tooltipOptions:d}):n.jsx(n.Fragment,{})}const a=m.Extension.create({name:"codeView",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button({editor:t,t:o}){return{componentProps:{action:()=>{t.commands.toggleCodeView()},isActive:()=>t.storage.codeView.isActive,disabled:!1,icon:"Html",tooltip:o("editor.codeView.tooltip")||"View HTML Code",customClass:"tiptap-code-view-button"}}}}},addStorage(){return{isActive:!1,originalContent:""}},addCommands(){return{toggleCodeView:()=>({editor:e})=>{const t=e.storage.codeView.isActive;if(t)e.commands.setContent(e.getText());else{const o=e.getHTML();e.storage.codeView.originalContent=o;const i=o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");e.commands.setContent(`<div class="tiptap-code-view-wrapper">${i}</div>`)}return e.storage.codeView.isActive=!t,!0}}}});exports.CodeView=a;exports.RichTextCodeView=w;
|
package/lib/CodeView.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { E as l } from "./clsx-
|
|
1
|
+
import { E as l } from "./clsx-BWSGDJNJ.js";
|
|
2
2
|
import { jsx as c, Fragment as g } from "react/jsx-runtime";
|
|
3
|
-
import { A as u } from "./toggle-
|
|
3
|
+
import { A as u } from "./toggle-DKHg5sLm.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./index-
|
|
5
|
+
import "./index-DF5ZPtWM.js";
|
|
6
6
|
import "./theme.js";
|
|
7
|
-
import { u as v, a as w } from "./useButtonProps-
|
|
7
|
+
import { u as v, a as w } from "./useButtonProps-DVP4s_ER.js";
|
|
8
8
|
function b() {
|
|
9
9
|
const t = v(C.name), {
|
|
10
10
|
icon: e = void 0,
|
package/lib/Color.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index-CjhjjJsN.cjs"),t=require("react/jsx-runtime"),d=require("react"),g=require("./toggle-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index-CjhjjJsN.cjs"),t=require("react/jsx-runtime"),d=require("react"),g=require("./toggle-BQHMh_Q-.cjs"),v=require("./separator-NoH_SLRW.cjs");require("./index-D3RLYf-J.cjs");require("./theme.cjs");const h=require("./useButtonProps-DBJkNDS2.cjs"),j=require("./Icon-yqCglrdK.cjs");function m({fill:e}){return t.jsx("svg",{height:"18px",version:"1.1",viewBox:"0 0 240 240",width:"18px",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:1,children:t.jsx("g",{transform:"translate(0.000000, 0.500000)",children:t.jsxs("g",{transform:"translate(39.000000, 17.353553)",children:[t.jsx("path",{d:"M11,201.146447 L167,201.146447 C173.075132,201.146447 178,206.071314 178,212.146447 C178,218.221579 173.075132,223.146447 167,223.146447 L11,223.146447 C4.92486775,223.146447 7.43989126e-16,218.221579 0,212.146447 C-7.43989126e-16,206.071314 4.92486775,201.146447 11,201.146447 Z",fill:typeof e=="string"?e:"#000",fillRule:"evenodd"}),t.jsx("path",{d:"M72.3425855,16.8295583 C75.799482,7.50883712 86.1577877,2.75526801 95.4785089,6.21216449 C100.284516,7.99463061 104.096358,11.7387855 105.968745,16.4968188 L106.112518,16.8745422 L159.385152,161.694068 C161.291848,166.877345 158.635655,172.624903 153.452378,174.531599 C148.358469,176.405421 142.719567,173.872338 140.716873,168.864661 L140.614848,168.598825 L89.211,28.86 L37.3759214,168.623816 C35.4885354,173.712715 29.8981043,176.351047 24.7909589,174.617647 L24.5226307,174.522368 C19.4337312,172.634982 16.7953993,167.044551 18.5287999,161.937406 L18.6240786,161.669077 L72.3425855,16.8295583 Z",fill:"currentColor",fillRule:"nonzero"}),t.jsx("path",{d:"M121,103.146447 C126.522847,103.146447 131,107.623599 131,113.146447 C131,118.575687 126.673329,122.994378 121.279905,123.142605 L121,123.146447 L55,123.146447 C49.4771525,123.146447 45,118.669294 45,113.146447 C45,107.717207 49.3266708,103.298515 54.7200952,103.150288 L55,103.146447 L121,103.146447 Z",fill:"currentColor",fillRule:"nonzero"})]})})})})}function L(){const e=h.useButtonProps(C.name),{tooltip:o=void 0,isActive:s=void 0,defaultColor:r=void 0,colors:n,action:i}=(e==null?void 0:e.componentProps)??{},{disabled:l,dataState:c}=h.useActive(s),[f,u]=d.useState(r);d.useEffect(()=>{u(c)},[c]);function x(a){l||i&&(i==null||i(a),u(a))}return e?t.jsx(v.ColorPicker,{colors:n,disabled:l,onChange:x,value:f,children:t.jsx(g.ActionButton,{disabled:l,tooltip:o,children:t.jsxs("span",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-gap-[4px] richtext-text-sm",children:[t.jsx(m,{fill:c}),t.jsx(j.IconComponent,{className:"!richtext-h-3 !richtext-w-3 richtext-text-zinc-500",name:"MenuDown"})]})})}):t.jsx(t.Fragment,{})}const C=p.Color.extend({addStorage(){return{currentColor:this.options.defaultColor||void 0}},addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button({editor:o,t:s,extension:r}){return{componentProps:{colors:r.options.colors,defaultColor:r.options.defaultColor,action:n=>{if(typeof n=="string"){o.storage.color.currentColor=n,o.chain().focus().setColor(n).run();return}o.chain().focus().unsetColor().run()},isActive:()=>{const{color:n}=o.getAttributes("textStyle");return n},disabled:!1,shortcutKeys:r.options.shortcutKeys??["⇧","alt","C"],tooltip:s("editor.color.tooltip")}}}}},addKeyboardShortcuts(){var e;return{...(e=this.parent)==null?void 0:e.call(this),"Alt-Shift-c":()=>{const o=this.storage.currentColor||this.options.defaultColor;if(!o){const{color:r}=this.editor.getAttributes("textStyle");return r?this.editor.chain().focus().unsetColor().run():!1}return this.editor.isActive("textStyle",{color:o})?this.editor.chain().focus().unsetColor().run():this.editor.chain().focus().setColor(o).run()}}}});exports.Color=C;exports.RichTextColor=L;
|
package/lib/Color.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { C as d } from "./index-
|
|
1
|
+
import { C as d } from "./index-CHKWG6E8.js";
|
|
2
2
|
import { jsx as o, jsxs as f, Fragment as p } from "react/jsx-runtime";
|
|
3
3
|
import { useState as m, useEffect as x } from "react";
|
|
4
|
-
import { A as g } from "./toggle-
|
|
5
|
-
import { C as v } from "./separator-
|
|
6
|
-
import "./index-
|
|
4
|
+
import { A as g } from "./toggle-DKHg5sLm.js";
|
|
5
|
+
import { C as v } from "./separator-Ddfrhn4D.js";
|
|
6
|
+
import "./index-DF5ZPtWM.js";
|
|
7
7
|
import "./theme.js";
|
|
8
|
-
import { u as L, b as A } from "./useButtonProps-
|
|
9
|
-
import { I as y } from "./Icon-
|
|
8
|
+
import { u as L, b as A } from "./useButtonProps-DVP4s_ER.js";
|
|
9
|
+
import { I as y } from "./Icon-Ctva8VeB.js";
|
|
10
10
|
function S({ fill: t }) {
|
|
11
11
|
return /* @__PURE__ */ o(
|
|
12
12
|
"svg",
|
package/lib/Column.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./clsx-CXbNJWDD.cjs"),C=require("@tiptap/pm/state"),A=require("@tiptap/pm/model"),f=require("react/jsx-runtime"),v=require("./toggle-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./clsx-CXbNJWDD.cjs"),C=require("@tiptap/pm/state"),A=require("@tiptap/pm/model"),f=require("react/jsx-runtime"),v=require("./toggle-BQHMh_Q-.cjs");require("react");require("./index-D3RLYf-J.cjs");require("./theme.cjs");const y=require("./useButtonProps-DBJkNDS2.cjs");function M(e,t,r=null){return r?e.createChecked({index:t},r):e.createAndFill({index:t})}function H(e){if(e.cached.columnsNodeTypes)return e.cached.columnsNodeTypes;const t={columns:e.nodes.columns,column:e.nodes.column};return e.cached.columnsNodeTypes=t,t}function O(e,t,r=null){const n=H(e),c=[];for(let o=0;o<t;o+=1){const s=M(n.column,o,r);s&&c.push(s)}return n.columns.createChecked({cols:t},c)}function h({state:e,dispatch:t,type:r}){const n=u.findParentNode(o=>o.type.name===T.name)(e.selection),c=u.findParentNode(o=>o.type.name===x.name)(e.selection);if(t&&n&&c){const o=n.node,s=c.node.attrs.index,i=o.toJSON();let l=s;r==="delete"?(l=s-1,i.content.splice(s,1)):(l=r==="addBefore"?s:s+1,i.content.splice(l,0,{type:"column",attrs:{index:s},content:[{type:"paragraph"}]})),i.attrs.cols=i.content.length,i.content.forEach((m,b)=>{m.attrs.index=b});const d=A.Node.fromJSON(e.schema,i);let a=n.pos;d.content.forEach((m,b,N)=>{N<l&&(a+=m.nodeSize)});const p=e.tr.setTime(Date.now());p.replaceWith(n.pos,n.pos+n.node.nodeSize,d).setSelection(C.TextSelection.near(p.doc.resolve(a))),t(p)}return!0}function g({state:e,dispatch:t,type:r}){const n=u.findParentNode(o=>o.type.name===T.name)(e.selection),c=u.findParentNode(o=>o.type.name===x.name)(e.selection);if(t&&n&&c){const o=n.node,s=c.node.attrs.index;let i=0;r==="before"?i=(s-1+o.attrs.cols)%o.attrs.cols:i=(s+1)%o.attrs.cols;let l=n.pos;o.content.forEach((a,p,m)=>{m<i&&(l+=a.nodeSize)});const d=e.tr.setTime(Date.now());return d.setSelection(C.TextSelection.near(d.doc.resolve(l))),t(d),!0}return!1}function P(){const e=y.useButtonProps(S.name),{icon:t=void 0,tooltip:r=void 0,shortcutKeys:n=void 0,tooltipOptions:c={},action:o=void 0,isActive:s=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:i,disabled:l,update:d}=y.useToggleActive(s),a=()=>{l||o&&(o(),d())};return e?f.jsx(v.ActionButton,{action:a,dataState:i,disabled:l,icon:t,shortcutKeys:n,tooltip:r,tooltipOptions:c}):f.jsx(f.Fragment,{})}const L=200,S=u.Extension.create({name:"richtextColumnExtension",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:r})=>({componentProps:{action:()=>{t.chain().focus().insertColumns({cols:2}).run()},icon:"Columns",tooltip:r("editor.columns.tooltip")}})}}}),x=u.Node3.create({name:"column",content:"block+",isolating:!0,addOptions(){return{HTMLAttributes:{class:"column"}}},addAttributes(){return{index:{default:0,parseHTML:e=>e.getAttribute("index")}}},parseHTML(){return[{tag:"div[class=column]"}]},renderHTML({HTMLAttributes:e}){return["div",u.mergeAttributes(this.options.HTMLAttributes,e),0]}}),T=u.Node3.create({name:"columns",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,content:"column{1,}",priority:L,addOptions(){return{HTMLAttributes:{class:"columns"}}},addAttributes(){return{cols:{default:2,parseHTML:e=>e.getAttribute("cols")}}},parseHTML(){return[{tag:"div[class=grid]"}]},renderHTML({HTMLAttributes:e}){return["div",u.mergeAttributes(this.options.HTMLAttributes,e),0]},addCommands(){return{insertColumns:e=>({tr:t,dispatch:r,editor:n})=>{const c=O(n.schema,e&&e.cols||3);if(r){const o=t.selection.anchor+1;t.replaceSelectionWith(c).scrollIntoView().setSelection(C.TextSelection.near(t.doc.resolve(o)))}return!0},addColBefore:()=>({dispatch:e,state:t})=>h({dispatch:e,state:t,type:"addBefore"}),addColAfter:()=>({dispatch:e,state:t})=>h({dispatch:e,state:t,type:"addAfter"}),deleteCol:()=>({dispatch:e,state:t})=>h({dispatch:e,state:t,type:"delete"})}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertColumns(),Tab:()=>g({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"after"}),"Shift-Tab":()=>g({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"before"})}}});exports.Column=S;exports.ColumnNode=x;exports.MultipleColumnNode=T;exports.RichTextColumn=P;
|
package/lib/Column.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as p, E as v, N as b, m as y } from "./clsx-BWSGDJNJ.js";
|
|
2
2
|
import { TextSelection as h } from "@tiptap/pm/state";
|
|
3
3
|
import { Node as N } from "@tiptap/pm/model";
|
|
4
4
|
import { jsx as T, Fragment as H } from "react/jsx-runtime";
|
|
5
|
-
import { A as M } from "./toggle-
|
|
5
|
+
import { A as M } from "./toggle-DKHg5sLm.js";
|
|
6
6
|
import "react";
|
|
7
|
-
import "./index-
|
|
7
|
+
import "./index-DF5ZPtWM.js";
|
|
8
8
|
import "./theme.js";
|
|
9
|
-
import { u as L, a as O } from "./useButtonProps-
|
|
9
|
+
import { u as L, a as O } from "./useButtonProps-DVP4s_ER.js";
|
|
10
10
|
function E(e, t, r = null) {
|
|
11
11
|
return r ? e.createChecked({ index: t }, r) : e.createAndFill({ index: t });
|
|
12
12
|
}
|