@remarkablejames/editor 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/ActionMenuButton-D9o3Kwmv.cjs +1 -0
- package/lib/{ActionMenuButton-DBZjUu-F.js → ActionMenuButton-nxV91Fqo.js} +10 -9
- package/lib/Attachment.cjs +19 -1
- package/lib/Attachment.js +270 -7
- package/lib/Blockquote.cjs +2 -2
- package/lib/Blockquote.js +12 -13
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +10 -11
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +8 -9
- package/lib/Callout.cjs +1 -1
- package/lib/Callout.js +45 -41
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +14 -13
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +5 -6
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.js +31 -30
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +8 -9
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +19 -18
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +8 -9
- package/lib/Drawer-Bh-y5bs8.cjs +2 -0
- package/lib/{Drawer-DTCwtJEs.js → Drawer-CF6Z_IA2.js} +24 -18
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +3 -3
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +15 -14
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +33 -28
- package/lib/ExportPdf.cjs +3 -3
- package/lib/ExportPdf.js +13 -14
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +6 -6
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +6 -7
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +14 -15
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +26 -26
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +23 -22
- package/lib/History.cjs +1 -1
- package/lib/History.js +11 -11
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +9 -10
- package/lib/Icon-BvGyfX2j.js +15 -0
- package/lib/Icon-wjwoRc9F.cjs +1 -0
- package/lib/Iframe-BbfZKbPY.cjs +1 -0
- package/lib/{Iframe-D-UYBxiv.js → Iframe-Dfd3LI7b.js} +18 -15
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +3 -3
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +5 -4
- package/lib/ImageCropper-CY1ETEjC.cjs +10 -0
- package/lib/ImageCropper-DrSdjo9x.js +979 -0
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +80 -77
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.js +28 -26
- package/lib/{Indent-Bvt-Qwar.js → Indent-CDVF9DWN.js} +30 -31
- package/lib/Indent-Q1VuhSM2.cjs +1 -0
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +11 -12
- package/lib/{Katex-CJDtvu-v.js → Katex-DqhWWAA-.js} +22 -19
- package/lib/Katex-K1QU2SB2.cjs +4 -0
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +2 -2
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +20 -19
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/LinkEditBlock-CBYGLs3J.cjs +5 -0
- package/lib/{LinkEditBlock-Cdqwj_NU.js → LinkEditBlock-xP0pGVhB.js} +24 -19
- package/lib/Mention.js +3 -3
- package/lib/{Mermaid-CnMYVX1P.js → Mermaid-BJ6ryVdY.js} +48 -45
- package/lib/Mermaid-D3_nLeOW.cjs +2 -0
- package/lib/Mermaid.cjs +1 -1
- package/lib/Mermaid.js +2 -2
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +28 -26
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +10 -11
- package/lib/PaywallSeparator.cjs +1 -0
- package/lib/PaywallSeparator.js +140 -0
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +42 -37
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +5 -5
- package/lib/SlashCommandNodeView-CUJrDQS7.cjs +1 -0
- package/lib/{SlashCommandNodeView-DcoLvt_6.js → SlashCommandNodeView-DS9FqMiY.js} +80 -62
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +11 -12
- package/lib/Table-CV6pUoVf.cjs +5 -0
- package/lib/{Table-Cu12PvQ_.js → Table-CcG-JNtV.js} +46 -46
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +11 -12
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +27 -26
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +19 -18
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +8 -9
- package/lib/{Twitter-CrX4XY1j.js → Twitter-BIL3o833.js} +22 -18
- package/lib/Twitter-BfSTqPDh.cjs +1 -0
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +2 -2
- package/lib/Video-DAKr90QL.js +231 -0
- package/lib/Video-HAinT0w6.cjs +1 -0
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +5 -4
- package/lib/bubble.cjs +3 -3
- package/lib/bubble.js +86 -77
- package/lib/button-090-I3tp.js +35 -0
- package/lib/button-B4Sz2ZhW.cjs +1 -0
- package/lib/checkbox-BCPsu7yR.cjs +1 -0
- package/lib/checkbox-DiXWHAI0.js +29 -0
- package/lib/{clsx-BUPZHhq3.js → clsx-m_C5j3RU.js} +24 -24
- package/lib/components/RichTextProvider.d.ts +1 -1
- package/lib/dialog-C8J59d2J.cjs +1 -0
- package/lib/dialog-bDkDW-C_.js +95 -0
- package/lib/dom-dataset-BqoJhJXt.cjs +1 -0
- package/lib/dom-dataset-CIEeltF6.js +47 -0
- package/lib/{dropdown-menu-CVwXaR3Z.js → dropdown-menu-DWt_xj4h.js} +1 -1
- package/lib/{dropdown-menu-XIrQk3jr.cjs → dropdown-menu-tUP872Zv.cjs} +1 -1
- package/lib/events.constant-Bke62qxm.cjs +1 -0
- package/lib/events.constant-CSWD3-ho.js +72 -0
- package/lib/extensions/PaywallSeparator/PaywallSeparator.d.ts +35 -0
- package/lib/extensions/PaywallSeparator/components/PaywallIcon.d.ts +2 -0
- package/lib/extensions/PaywallSeparator/components/PaywallSeparatorView.d.ts +17 -0
- package/lib/extensions/PaywallSeparator/components/RichTextPaywallSeparator.d.ts +1 -0
- package/lib/extensions/PaywallSeparator/components/index.d.ts +2 -0
- package/lib/extensions/PaywallSeparator/index.d.ts +1 -0
- package/lib/file-i7e4nQY2.cjs +1 -0
- package/lib/file-jDdkhyj7.js +43 -0
- package/lib/{index-RkKGy5oa.js → index-B3Ijnbxs.js} +1 -1
- package/lib/index-BXh8X1ch.cjs +1 -0
- package/lib/{index-Dl3OjzmR.js → index-C1KQsOcg.js} +1 -1
- package/lib/{index-D4M4hrH4.js → index-C8FjP66D.js} +1 -1
- package/lib/index-jMN4V2hr.js +2763 -0
- package/lib/{index-DZj2z9_1.js → index-s3l5RdyW.js} +1 -1
- package/lib/index.cjs +4 -4
- package/lib/index.js +464 -149
- package/lib/input-C_J-pfTx.js +21 -0
- package/lib/input-DwLo4r7V.cjs +1 -0
- package/lib/isNumber-BTYSVlKo.cjs +1 -0
- package/lib/isNumber-WaBzl_0s.js +15 -0
- package/lib/label-BgIVynq3.cjs +1 -0
- package/lib/label-ClsOg9Hr.js +11 -0
- package/lib/{popover-DDT8YRht.js → popover-BC7FRr8B.js} +1 -1
- package/lib/{popover-0syCfWYi.cjs → popover-C3A6zzNV.cjs} +1 -1
- package/lib/{renderNodeView-dj6AaFSX.js → renderNodeView-C_hPIdEs.js} +2 -2
- package/lib/{select-DTNz0ZeE.cjs → select-B8HIWDXf.cjs} +1 -1
- package/lib/{select-D9wQw2qB.js → select-DSKqhVGR.js} +1 -1
- package/lib/{separator-DRGTEiX4.js → separator-BJWSNjvr.js} +13 -12
- package/lib/separator-D6ruF682.cjs +1 -0
- package/lib/style.css +1 -1
- package/lib/tabs-D1J1iB7B.js +46 -0
- package/lib/tabs-IEbMQmNX.cjs +1 -0
- package/lib/{textarea-DfVzbMr5.js → textarea-Ch5w3PiI.js} +1 -1
- package/lib/{textarea-DpkwluT0.cjs → textarea-CtVdqwSM.cjs} +1 -1
- package/lib/theme.cjs +1 -1
- package/lib/theme.js +18 -18
- package/lib/throttle-CRNq0z-O.js +249 -0
- package/lib/throttle-gTTvqDTW.cjs +1 -0
- package/lib/toggle-C9tcMm1r.cjs +1 -0
- package/lib/toggle-CaSwYCk4.js +89 -0
- package/lib/types.d.ts +5 -5
- package/lib/{updatePosition-C294Pixi.js → updatePosition-DvfTZHcH.js} +2 -2
- package/lib/use-toast-C6zPo25l.cjs +1 -0
- package/lib/use-toast-CEOqhXfx.js +97 -0
- package/lib/useButtonProps-D-ruygH7.js +165 -0
- package/lib/useButtonProps-D9ndBdmA.cjs +1 -0
- package/package.json +34 -32
- package/lib/ActionMenuButton-C6jGtl3k.cjs +0 -1
- package/lib/Drawer-B031ezmA.cjs +0 -2
- package/lib/Iframe-BUK2pkOL.cjs +0 -1
- package/lib/Indent-_y6N8MIQ.cjs +0 -1
- package/lib/Katex-bJXkt-VP.cjs +0 -4
- package/lib/LinkEditBlock-ewTApx0K.cjs +0 -5
- package/lib/Mermaid-Dwz9o-yM.cjs +0 -2
- package/lib/SlashCommandNodeView-BMgQJ4xT.cjs +0 -1
- package/lib/Table-B8CHl8jK.cjs +0 -5
- package/lib/Twitter-6HYP_upt.cjs +0 -1
- package/lib/index-B0d-u29p.js +0 -5425
- package/lib/index-De9MZVWQ.cjs +0 -28
- package/lib/separator-D8lOAf8f.cjs +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { O as de, S as E, X as Ve, T as $, F as v, v as L, L as ke, u as Ke, Y as Xe, N as Z, m as J, U as Ue, V as Ge, E as Ee, Z as qe } from "./clsx-m_C5j3RU.js";
|
|
2
2
|
import { TextSelection as Ze } from "@tiptap/pm/state";
|
|
3
|
-
import { k as Je, D as oe, a as ne } from "./index-
|
|
3
|
+
import { k as Je, D as oe, a as ne } from "./index-B3Ijnbxs.js";
|
|
4
4
|
import { jsxs as ee, jsx as k, Fragment as Ye } from "react/jsx-runtime";
|
|
5
|
-
import {
|
|
5
|
+
import { A as Qe } from "./toggle-CaSwYCk4.js";
|
|
6
6
|
import { useState as _ } from "react";
|
|
7
|
-
import "./theme.js";
|
|
8
7
|
import { T as O, k as F, m as j } from "./index-BGd2HiwP.js";
|
|
9
|
-
import { P as
|
|
8
|
+
import { P as et, a as tt, b as ot } from "./popover-BC7FRr8B.js";
|
|
9
|
+
import { f as nt, u as lt, c as rt } from "./useButtonProps-D-ruygH7.js";
|
|
10
10
|
let le, re;
|
|
11
11
|
if (typeof WeakMap < "u") {
|
|
12
12
|
let t = /* @__PURE__ */ new WeakMap();
|
|
@@ -241,7 +241,7 @@ function ze(t, e, o) {
|
|
|
241
241
|
const n = t.node(-1), l = C.get(n), r = t.start(-1), s = l.nextCell(t.pos - r, e, o);
|
|
242
242
|
return s == null ? null : t.node(0).resolve(r + s);
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function W(t, e, o = 1) {
|
|
245
245
|
const n = {
|
|
246
246
|
...t,
|
|
247
247
|
colspan: t.colspan - o
|
|
@@ -282,7 +282,7 @@ var b = class N extends E {
|
|
|
282
282
|
const r = this.$anchorCell.node(-1) != n.node(-1);
|
|
283
283
|
return r && this.isRowSelection() ? N.rowSelection(n, l) : r && this.isColSelection() ? N.colSelection(n, l) : new N(n, l);
|
|
284
284
|
}
|
|
285
|
-
return
|
|
285
|
+
return $.between(n, l);
|
|
286
286
|
}
|
|
287
287
|
content() {
|
|
288
288
|
const e = this.$anchorCell.node(-1), o = C.get(e), n = this.$anchorCell.start(-1), l = o.rectBetween(this.$anchorCell.pos - n, this.$headCell.pos - n), r = {}, s = [];
|
|
@@ -298,7 +298,7 @@ var b = class N extends E {
|
|
|
298
298
|
const m = l.left - h.left, g = h.right - l.right;
|
|
299
299
|
if (m > 0 || g > 0) {
|
|
300
300
|
let w = p.attrs;
|
|
301
|
-
if (m > 0 && (w =
|
|
301
|
+
if (m > 0 && (w = W(w, 0, m)), g > 0 && (w = W(w, w.colspan - g, g)), h.left < l.left) {
|
|
302
302
|
if (p = p.type.createAndFill(w), !p) throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`);
|
|
303
303
|
} else p = p.type.create(w, p.content);
|
|
304
304
|
}
|
|
@@ -430,11 +430,11 @@ function bt(t, e, o) {
|
|
|
430
430
|
const i = C.get(n.node), c = n.from + 1, a = c + i.map[i.width * i.height - 1];
|
|
431
431
|
r = b.create(l, c + 1, a);
|
|
432
432
|
}
|
|
433
|
-
} else n instanceof
|
|
433
|
+
} else n instanceof $ && gt(n) ? r = $.create(l, n.from) : n instanceof $ && wt(n) && (r = $.create(l, n.$from.start(), n.$from.end()));
|
|
434
434
|
return r && (e || (e = t.tr)).setSelection(r), e;
|
|
435
435
|
}
|
|
436
436
|
const Ct = new de("fix-tables");
|
|
437
|
-
function
|
|
437
|
+
function $e(t, e, o, n) {
|
|
438
438
|
const l = t.childCount, r = e.childCount;
|
|
439
439
|
e: for (let s = 0, i = 0; s < r; s++) {
|
|
440
440
|
const c = e.child(s);
|
|
@@ -442,15 +442,15 @@ function We(t, e, o, n) {
|
|
|
442
442
|
i = a + 1, o += c.nodeSize;
|
|
443
443
|
continue e;
|
|
444
444
|
}
|
|
445
|
-
n(c, o), i < l && t.child(i).sameMarkup(c) ?
|
|
445
|
+
n(c, o), i < l && t.child(i).sameMarkup(c) ? $e(t.child(i), c, o + 1, n) : c.nodesBetween(0, c.content.size, n, o + 1), o += c.nodeSize;
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
|
-
function
|
|
448
|
+
function We(t, e) {
|
|
449
449
|
let o;
|
|
450
450
|
const n = (l, r) => {
|
|
451
451
|
l.type.spec.tableRole == "table" && (o = yt(t, l, r, o));
|
|
452
452
|
};
|
|
453
|
-
return e ? e.doc != t.doc &&
|
|
453
|
+
return e ? e.doc != t.doc && $e(e.doc, t.doc, 0, n) : t.doc.descendants(n), o;
|
|
454
454
|
}
|
|
455
455
|
function yt(t, e, o, n) {
|
|
456
456
|
const l = C.get(e);
|
|
@@ -465,7 +465,7 @@ function yt(t, e, o, n) {
|
|
|
465
465
|
if (!d) continue;
|
|
466
466
|
const u = d.attrs;
|
|
467
467
|
for (let f = 0; f < u.rowspan; f++) r[a.row + f] += a.n;
|
|
468
|
-
n.setNodeMarkup(n.mapping.map(o + 1 + a.pos), null,
|
|
468
|
+
n.setNodeMarkup(n.mapping.map(o + 1 + a.pos), null, W(u, u.colspan - a.n, a.n));
|
|
469
469
|
} else if (a.type == "missing") r[a.row] += a.n;
|
|
470
470
|
else if (a.type == "overlong_rowspan") {
|
|
471
471
|
const d = e.nodeAt(a.pos);
|
|
@@ -549,7 +549,7 @@ function xt(t, { map: e, table: o, tableStart: n }, l) {
|
|
|
549
549
|
const r = t.mapping.maps.length;
|
|
550
550
|
for (let s = 0; s < e.height; ) {
|
|
551
551
|
const i = s * e.width + l, c = e.map[i], a = o.nodeAt(c), d = a.attrs;
|
|
552
|
-
if (l > 0 && e.map[i - 1] == c || l < e.width - 1 && e.map[i + 1] == c) t.setNodeMarkup(t.mapping.slice(r).map(n + c), null,
|
|
552
|
+
if (l > 0 && e.map[i - 1] == c || l < e.width - 1 && e.map[i + 1] == c) t.setNodeMarkup(t.mapping.slice(r).map(n + c), null, W(d, l - e.colCount(c)));
|
|
553
553
|
else {
|
|
554
554
|
const u = t.mapping.slice(r).map(n + c);
|
|
555
555
|
t.delete(u, u + a.nodeSize);
|
|
@@ -830,8 +830,8 @@ function I(t, e) {
|
|
|
830
830
|
}
|
|
831
831
|
I("row", { useDeprecatedLogic: !0 });
|
|
832
832
|
I("column", { useDeprecatedLogic: !0 });
|
|
833
|
-
const
|
|
834
|
-
function
|
|
833
|
+
const $t = I("cell", { useDeprecatedLogic: !0 });
|
|
834
|
+
function Wt(t, e) {
|
|
835
835
|
if (e < 0) {
|
|
836
836
|
const o = t.nodeBefore;
|
|
837
837
|
if (o) return t.pos - o.nodeSize;
|
|
@@ -854,11 +854,11 @@ function $t(t, e) {
|
|
|
854
854
|
function ge(t) {
|
|
855
855
|
return function(e, o) {
|
|
856
856
|
if (!R(e)) return !1;
|
|
857
|
-
const n =
|
|
857
|
+
const n = Wt(Y(e), t);
|
|
858
858
|
if (n == null) return !1;
|
|
859
859
|
if (o) {
|
|
860
860
|
const l = e.doc.resolve(n);
|
|
861
|
-
o(e.tr.setSelection(
|
|
861
|
+
o(e.tr.setSelection($.between(l, ft(l))).scrollIntoView());
|
|
862
862
|
}
|
|
863
863
|
return !0;
|
|
864
864
|
};
|
|
@@ -929,7 +929,7 @@ function Pt({ width: t, height: e, rows: o }, n, l) {
|
|
|
929
929
|
const c = o[i], a = [];
|
|
930
930
|
for (let d = r[i] || 0, u = 0; d < n; u++) {
|
|
931
931
|
let f = c.child(u % c.childCount);
|
|
932
|
-
d + f.attrs.colspan > n && (f = f.type.createChecked(
|
|
932
|
+
d + f.attrs.colspan > n && (f = f.type.createChecked(W(f.attrs, f.attrs.colspan, d + f.attrs.colspan - n), f.content)), a.push(f), d += f.attrs.colspan;
|
|
933
933
|
for (let h = 1; h < f.attrs.rowspan; h++) r[i + h] = (r[i + h] || 0) + f.attrs.colspan;
|
|
934
934
|
}
|
|
935
935
|
s.push(v.from(a));
|
|
@@ -1008,7 +1008,7 @@ function be(t, e, o, n, l, r, s, i) {
|
|
|
1008
1008
|
if (e.map[d - 1] == u) {
|
|
1009
1009
|
c = !0;
|
|
1010
1010
|
const f = o.nodeAt(u), h = e.colCount(u), p = t.mapping.slice(i).map(u + n);
|
|
1011
|
-
t.setNodeMarkup(p, null,
|
|
1011
|
+
t.setNodeMarkup(p, null, W(f.attrs, s - h, f.attrs.colspan - (s - h))), t.insert(p + f.nodeSize, f.type.createAndFill(W(f.attrs, 0, s - h))), a += f.attrs.rowspan - 1;
|
|
1012
1012
|
}
|
|
1013
1013
|
}
|
|
1014
1014
|
return c;
|
|
@@ -1044,22 +1044,22 @@ const Ot = Je({
|
|
|
1044
1044
|
Delete: V,
|
|
1045
1045
|
"Mod-Delete": V
|
|
1046
1046
|
});
|
|
1047
|
-
function
|
|
1047
|
+
function G(t, e, o) {
|
|
1048
1048
|
return o.eq(t.selection) ? !1 : (e && e(t.tr.setSelection(o).scrollIntoView()), !0);
|
|
1049
1049
|
}
|
|
1050
1050
|
function K(t, e) {
|
|
1051
1051
|
return (o, n, l) => {
|
|
1052
1052
|
if (!l) return !1;
|
|
1053
1053
|
const r = o.selection;
|
|
1054
|
-
if (r instanceof b) return
|
|
1054
|
+
if (r instanceof b) return G(o, n, E.near(r.$headCell, e));
|
|
1055
1055
|
if (t != "horiz" && !r.empty) return !1;
|
|
1056
1056
|
const s = Ie(l, t, e);
|
|
1057
1057
|
if (s == null) return !1;
|
|
1058
|
-
if (t == "horiz") return
|
|
1058
|
+
if (t == "horiz") return G(o, n, E.near(o.doc.resolve(r.head + e), e));
|
|
1059
1059
|
{
|
|
1060
1060
|
const i = o.doc.resolve(s), c = ze(i, t, e);
|
|
1061
1061
|
let a;
|
|
1062
|
-
return c ? a = E.near(c, 1) : e < 0 ? a = E.near(o.doc.resolve(i.before(-1)), -1) : a = E.near(o.doc.resolve(i.after(-1)), 1),
|
|
1062
|
+
return c ? a = E.near(c, 1) : e < 0 ? a = E.near(o.doc.resolve(i.before(-1)), -1) : a = E.near(o.doc.resolve(i.after(-1)), 1), G(o, n, a);
|
|
1063
1063
|
}
|
|
1064
1064
|
};
|
|
1065
1065
|
}
|
|
@@ -1075,7 +1075,7 @@ function X(t, e) {
|
|
|
1075
1075
|
s = new b(o.doc.resolve(c));
|
|
1076
1076
|
}
|
|
1077
1077
|
const i = ze(s.$headCell, t, e);
|
|
1078
|
-
return i ?
|
|
1078
|
+
return i ? G(o, n, new b(s.$anchorCell, i)) : !1;
|
|
1079
1079
|
};
|
|
1080
1080
|
}
|
|
1081
1081
|
function Ft(t, e) {
|
|
@@ -1134,7 +1134,7 @@ function Vt(t, e) {
|
|
|
1134
1134
|
t.root.addEventListener("mouseup", s), t.root.addEventListener("dragstart", s), t.root.addEventListener("mousemove", i);
|
|
1135
1135
|
}
|
|
1136
1136
|
function Ie(t, e, o) {
|
|
1137
|
-
if (!(t.state.selection instanceof
|
|
1137
|
+
if (!(t.state.selection instanceof $)) return null;
|
|
1138
1138
|
const { $head: n } = t.state.selection;
|
|
1139
1139
|
for (let l = n.depth - 1; l >= 0; l--) {
|
|
1140
1140
|
const r = n.node(l);
|
|
@@ -1202,7 +1202,7 @@ function Xt({ handleWidth: t = 5, cellMinWidth: e = 25, defaultCellMinWidth: o =
|
|
|
1202
1202
|
init(s, i) {
|
|
1203
1203
|
var c;
|
|
1204
1204
|
const a = (c = r.spec) === null || c === void 0 || (c = c.props) === null || c === void 0 ? void 0 : c.nodeViews, d = y(i.schema).table.name;
|
|
1205
|
-
return n && a && (a[d] = (u, f) => new n(u, o, f)), new
|
|
1205
|
+
return n && a && (a[d] = (u, f) => new n(u, o, f)), new Ut(-1, !1);
|
|
1206
1206
|
},
|
|
1207
1207
|
apply(s, i) {
|
|
1208
1208
|
return i.apply(s);
|
|
@@ -1215,7 +1215,7 @@ function Xt({ handleWidth: t = 5, cellMinWidth: e = 25, defaultCellMinWidth: o =
|
|
|
1215
1215
|
},
|
|
1216
1216
|
handleDOMEvents: {
|
|
1217
1217
|
mousemove: (s, i) => {
|
|
1218
|
-
|
|
1218
|
+
Gt(s, i, t, l);
|
|
1219
1219
|
},
|
|
1220
1220
|
mouseleave: (s) => {
|
|
1221
1221
|
qt(s);
|
|
@@ -1233,7 +1233,7 @@ function Xt({ handleWidth: t = 5, cellMinWidth: e = 25, defaultCellMinWidth: o =
|
|
|
1233
1233
|
});
|
|
1234
1234
|
return r;
|
|
1235
1235
|
}
|
|
1236
|
-
var
|
|
1236
|
+
var Ut = class q {
|
|
1237
1237
|
constructor(e, o) {
|
|
1238
1238
|
this.activeHandle = e, this.dragging = o;
|
|
1239
1239
|
}
|
|
@@ -1248,7 +1248,7 @@ var Gt = class q {
|
|
|
1248
1248
|
return o;
|
|
1249
1249
|
}
|
|
1250
1250
|
};
|
|
1251
|
-
function
|
|
1251
|
+
function Gt(t, e, o, n) {
|
|
1252
1252
|
if (!t.editable) return;
|
|
1253
1253
|
const l = A.getState(t.state);
|
|
1254
1254
|
if (l && !l.dragging) {
|
|
@@ -1393,7 +1393,7 @@ function oo({ allowTableNodeSelection: t = !1 } = {}) {
|
|
|
1393
1393
|
handlePaste: jt
|
|
1394
1394
|
},
|
|
1395
1395
|
appendTransaction(e, o, n) {
|
|
1396
|
-
return bt(n,
|
|
1396
|
+
return bt(n, We(n, o), t);
|
|
1397
1397
|
}
|
|
1398
1398
|
});
|
|
1399
1399
|
}
|
|
@@ -1576,7 +1576,7 @@ function so(t, e, o, n, l) {
|
|
|
1576
1576
|
function io(t) {
|
|
1577
1577
|
return t instanceof b;
|
|
1578
1578
|
}
|
|
1579
|
-
var
|
|
1579
|
+
var U = ({ editor: t }) => {
|
|
1580
1580
|
const { selection: e } = t.state;
|
|
1581
1581
|
if (!io(e))
|
|
1582
1582
|
return !1;
|
|
@@ -1703,12 +1703,12 @@ var fo = uo, je = Z.create({
|
|
|
1703
1703
|
splitCell: () => ({ state: t, dispatch: e }) => pe(t, e),
|
|
1704
1704
|
toggleHeaderColumn: () => ({ state: t, dispatch: e }) => I("column")(t, e),
|
|
1705
1705
|
toggleHeaderRow: () => ({ state: t, dispatch: e }) => I("row")(t, e),
|
|
1706
|
-
toggleHeaderCell: () => ({ state: t, dispatch: e }) =>
|
|
1706
|
+
toggleHeaderCell: () => ({ state: t, dispatch: e }) => $t(t, e),
|
|
1707
1707
|
mergeOrSplit: () => ({ state: t, dispatch: e }) => he(t, e) ? !0 : pe(t, e),
|
|
1708
1708
|
setCellAttribute: (t, e) => ({ state: o, dispatch: n }) => Ht(t, e)(o, n),
|
|
1709
1709
|
goToNextCell: () => ({ state: t, dispatch: e }) => ge(1)(t, e),
|
|
1710
1710
|
goToPreviousCell: () => ({ state: t, dispatch: e }) => ge(-1)(t, e),
|
|
1711
|
-
fixTables: () => ({ state: t, dispatch: e }) => (e &&
|
|
1711
|
+
fixTables: () => ({ state: t, dispatch: e }) => (e && We(t), !0),
|
|
1712
1712
|
setCellSelection: (t) => ({ tr: e, dispatch: o }) => {
|
|
1713
1713
|
if (o) {
|
|
1714
1714
|
const n = b.create(e.doc, t.anchorCell, t.headCell);
|
|
@@ -1722,10 +1722,10 @@ var fo = uo, je = Z.create({
|
|
|
1722
1722
|
return {
|
|
1723
1723
|
Tab: () => this.editor.commands.goToNextCell() ? !0 : this.editor.can().addRowAfter() ? this.editor.chain().addRowAfter().goToNextCell().run() : !1,
|
|
1724
1724
|
"Shift-Tab": () => this.editor.commands.goToPreviousCell(),
|
|
1725
|
-
Backspace:
|
|
1726
|
-
"Mod-Backspace":
|
|
1727
|
-
Delete:
|
|
1728
|
-
"Mod-Delete":
|
|
1725
|
+
Backspace: U,
|
|
1726
|
+
"Mod-Backspace": U,
|
|
1727
|
+
Delete: U,
|
|
1728
|
+
"Mod-Delete": U
|
|
1729
1729
|
};
|
|
1730
1730
|
},
|
|
1731
1731
|
addProseMirrorPlugins() {
|
|
@@ -1751,7 +1751,7 @@ var fo = uo, je = Z.create({
|
|
|
1751
1751
|
storage: t.storage
|
|
1752
1752
|
};
|
|
1753
1753
|
return {
|
|
1754
|
-
tableRole: Ge(
|
|
1754
|
+
tableRole: Ue(Ge(t, "tableRole", e))
|
|
1755
1755
|
};
|
|
1756
1756
|
}
|
|
1757
1757
|
});
|
|
@@ -1854,9 +1854,9 @@ function Co(t) {
|
|
|
1854
1854
|
cols: j
|
|
1855
1855
|
});
|
|
1856
1856
|
}
|
|
1857
|
-
return /* @__PURE__ */ ee(
|
|
1858
|
-
/* @__PURE__ */ k(
|
|
1859
|
-
/* @__PURE__ */ k(
|
|
1857
|
+
return /* @__PURE__ */ ee(et, { modal: !0, onOpenChange: o, open: e, children: [
|
|
1858
|
+
/* @__PURE__ */ k(tt, { asChild: !0, "data-state": t != null && t.dataState ? "on" : "off", children: t == null ? void 0 : t.children }),
|
|
1859
|
+
/* @__PURE__ */ k(ot, { align: "start", className: "richtext-w-full !richtext-p-2", side: "bottom", children: /* @__PURE__ */ ee("div", { className: "table-grid-size-editor richtext-p-0", children: [
|
|
1860
1860
|
/* @__PURE__ */ k("div", { className: "richtext-flex richtext-flex-col richtext-flex-wrap richtext-justify-between richtext-gap-1", children: (f = Ne(r == null ? void 0 : r.rows)) == null ? void 0 : f.map((h) => {
|
|
1861
1861
|
var p;
|
|
1862
1862
|
return /* @__PURE__ */ k("div", { className: "richtext-flex richtext-gap-1", children: (p = Ne(r == null ? void 0 : r.cols)) == null ? void 0 : p.map((m) => /* @__PURE__ */ k(
|
|
@@ -1879,20 +1879,20 @@ function Co(t) {
|
|
|
1879
1879
|
] });
|
|
1880
1880
|
}
|
|
1881
1881
|
function zo() {
|
|
1882
|
-
const t =
|
|
1882
|
+
const t = nt(), e = lt(yo.name), {
|
|
1883
1883
|
icon: o = void 0,
|
|
1884
1884
|
tooltip: n = void 0,
|
|
1885
1885
|
action: l = void 0,
|
|
1886
1886
|
isActive: r = void 0,
|
|
1887
1887
|
color: s
|
|
1888
|
-
} = (e == null ? void 0 : e.componentProps) ?? {}, { dataState: i, disabled: c } =
|
|
1888
|
+
} = (e == null ? void 0 : e.componentProps) ?? {}, { dataState: i, disabled: c } = rt(r);
|
|
1889
1889
|
if (!e)
|
|
1890
1890
|
return /* @__PURE__ */ k(Ye, {});
|
|
1891
1891
|
function a(d) {
|
|
1892
1892
|
t.chain().focus().insertTable({ ...d, withHeaderRow: !1 }).run();
|
|
1893
1893
|
}
|
|
1894
1894
|
return /* @__PURE__ */ k(Co, { createTable: a, dataState: i, children: /* @__PURE__ */ k(
|
|
1895
|
-
|
|
1895
|
+
Qe,
|
|
1896
1896
|
{
|
|
1897
1897
|
action: l,
|
|
1898
1898
|
color: s,
|
package/lib/Table.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Table-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Table-CV6pUoVf.cjs");exports.RichTextTable=e.RichTextTable;exports.Table=e.Table;
|
package/lib/Table.js
CHANGED
package/lib/TaskList.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-BCzvbrf5.cjs"),e=require("react/jsx-runtime"),m=require("./toggle-C9tcMm1r.cjs"),r=require("./useButtonProps-D9ndBdmA.cjs");function g(){const t=r.useButtonProps(u.name),{icon:s=void 0,tooltip:i=void 0,shortcutKeys:o=void 0,tooltipOptions:d={},action:n=void 0,isActive:l=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:p,disabled:c,update:T}=r.useToggleActive(l),k=()=>{c||n&&(n(),T())};return t?e.jsx(m.ActionButton,{action:k,dataState:p,disabled:c,icon:s,shortcutKeys:o,tooltip:i,tooltipOptions:d}):e.jsx(e.Fragment,{})}const u=a.TaskList.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"task-list"},taskItem:{HTMLAttributes:{class:"task-list-item"}},button:({editor:s,t:i,extension:o})=>({componentProps:{action:()=>s.commands.toggleTaskList(),isActive:()=>s.isActive("taskList"),disabled:!1,icon:"ListTodo",shortcutKeys:o.options.shortcutKeys??["shift","mod","9"],tooltip:i("editor.tasklist.tooltip")}})}},addExtensions(){return[a.TaskItem.configure(this.options.taskItem)]}});exports.RichTextTaskList=g;exports.TaskList=u;
|
package/lib/TaskList.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { T as u, a as l } from "./index-
|
|
2
|
-
import { jsx as a, Fragment as
|
|
3
|
-
import {
|
|
4
|
-
import "
|
|
5
|
-
|
|
6
|
-
function y() {
|
|
1
|
+
import { T as u, a as l } from "./index-s3l5RdyW.js";
|
|
2
|
+
import { jsx as a, Fragment as f } from "react/jsx-runtime";
|
|
3
|
+
import { A as k } from "./toggle-CaSwYCk4.js";
|
|
4
|
+
import { u as T, c as v } from "./useButtonProps-D-ruygH7.js";
|
|
5
|
+
function b() {
|
|
7
6
|
const t = T(A.name), {
|
|
8
7
|
icon: s = void 0,
|
|
9
8
|
tooltip: o = void 0,
|
|
@@ -11,13 +10,13 @@ function y() {
|
|
|
11
10
|
tooltipOptions: r = {},
|
|
12
11
|
action: e = void 0,
|
|
13
12
|
isActive: c = void 0
|
|
14
|
-
} = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: d, disabled: n, update:
|
|
15
|
-
n || e && (e(),
|
|
13
|
+
} = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: d, disabled: n, update: m } = v(c), p = () => {
|
|
14
|
+
n || e && (e(), m());
|
|
16
15
|
};
|
|
17
16
|
return t ? /* @__PURE__ */ a(
|
|
18
|
-
|
|
17
|
+
k,
|
|
19
18
|
{
|
|
20
|
-
action:
|
|
19
|
+
action: p,
|
|
21
20
|
dataState: d,
|
|
22
21
|
disabled: n,
|
|
23
22
|
icon: s,
|
|
@@ -25,7 +24,7 @@ function y() {
|
|
|
25
24
|
tooltip: o,
|
|
26
25
|
tooltipOptions: r
|
|
27
26
|
}
|
|
28
|
-
) : /* @__PURE__ */ a(
|
|
27
|
+
) : /* @__PURE__ */ a(f, {});
|
|
29
28
|
}
|
|
30
29
|
const A = /* @__PURE__ */ u.extend({
|
|
31
30
|
//@ts-expect-error
|
|
@@ -58,6 +57,6 @@ const A = /* @__PURE__ */ u.extend({
|
|
|
58
57
|
}
|
|
59
58
|
});
|
|
60
59
|
export {
|
|
61
|
-
|
|
60
|
+
b as RichTextTaskList,
|
|
62
61
|
A as TaskList
|
|
63
62
|
};
|
package/lib/TextAlign.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./clsx-CXbNJWDD.cjs"),s=require("react/jsx-runtime"),y=require("react"),b=require("./toggle-C9tcMm1r.cjs"),g=require("./useButtonProps-D9ndBdmA.cjs"),T=require("./popover-C3A6zzNV.cjs"),M=require("./Icon-wjwoRc9F.cjs");var K=C.Extension.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{const t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).some(n=>n):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,"textAlign")).some(t=>t),toggleTextAlign:e=>({editor:t,commands:n})=>this.options.alignments.includes(e)?t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),q=K;function P(){const[e,t]=y.useState(!1),n=g.useButtonProps(S.name),{icon:x=void 0,tooltip:A=void 0,items:r=[],isActive:m=void 0}=(n==null?void 0:n.componentProps)??{},{disabled:l,dataState:c}=g.useActive(m),u=y.useMemo(()=>(c==null?void 0:c.title)||"",[c]),p=y.useMemo(()=>r==null?void 0:r.some(i=>i.title===u),[r,u]);return n?s.jsxs(T.Popover,{modal:!0,onOpenChange:t,open:e,children:[s.jsx(T.PopoverTrigger,{asChild:!0,className:"hover:richtext-bg-accent data-[state=on]:richtext-bg-accent","data-state":p?"on":"off",disabled:l,children:s.jsx(b.ActionButton,{customClass:"!richtext-w-12 richtext-h-12",disabled:l,icon:x,tooltip:A,children:s.jsx(M.IconComponent,{className:"richtext-ml-1 richtext-size-3 richtext-text-zinc-500",name:"MenuDown"})})}),s.jsx(T.PopoverContent,{align:"start",className:"richtext-flex richtext-w-full richtext-min-w-4 richtext-flex-row richtext-gap-1 !richtext-p-[4px]",side:"bottom",children:r==null?void 0:r.map((i,d)=>{var o,a;return s.jsxs(g.Tooltip,{children:[s.jsx(g.TooltipTrigger,{asChild:!0,children:s.jsx(b.Toggle,{className:"richtext-size-7 richtext-p-1","data-state":u===i.title?"on":"off",size:"sm",onClick:()=>{i==null||i.action(),t(!1)},children:(i==null?void 0:i.icon)&&s.jsx(M.IconComponent,{name:i.icon})})}),s.jsxs(g.TooltipContent,{className:"richtext-flex richtext-flex-col richtext-items-center",children:[s.jsx("span",{children:i.title}),!!((o=i.shortcutKeys)!=null&&o.length)&&s.jsx("span",{children:(a=i.shortcutKeys)==null?void 0:a.map(h=>g.getShortcutKey(h)).join(" ")})]})]},`text-align-${d}`)})})]}):s.jsx(s.Fragment,{})}const S=q.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),types:["heading","paragraph","list_item","title"],button({editor:t,extension:n,t:x}){var c,u,p,i,d;const A=((c=n.options)==null?void 0:c.alignments)||[],r={left:((u=n.options.shortcutKeys)==null?void 0:u[0])??["mod","Shift","L"],center:((p=n.options.shortcutKeys)==null?void 0:p[1])??["mod","Shift","E"],right:((i=n.options.shortcutKeys)==null?void 0:i[2])??["mod","Shift","R"],justify:((d=n.options.shortcutKeys)==null?void 0:d[3])??["mod","Shift","J"]},m={left:"AlignLeft",center:"AlignCenter",right:"AlignRight",justify:"AlignJustify"},l=A.map(o=>{var a,h,j;return{title:x(`editor.textalign.${o}.tooltip`),icon:m[o],shortcutKeys:r[o],isActive:()=>t.isActive({textAlign:o})||!1,action:()=>{var f,v;return(v=(f=t.commands)==null?void 0:f.setTextAlign)==null?void 0:v.call(f,o)},disabled:!((j=(h=(a=t==null?void 0:t.can)==null?void 0:a.call(t))==null?void 0:h.setTextAlign)!=null&&j.call(h,o))}});return{componentProps:{icon:"AlignJustify",tooltip:x("editor.textalign.tooltip"),items:l,isActive:()=>l==null?void 0:l.find(a=>a.isActive())}}}}}});exports.RichTextAlign=P;exports.TextAlign=S;
|
package/lib/TextAlign.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { E as C } from "./clsx-
|
|
2
|
-
import { jsx as o, Fragment as K, jsxs as
|
|
1
|
+
import { E as C } from "./clsx-m_C5j3RU.js";
|
|
2
|
+
import { jsx as o, Fragment as K, jsxs as A } from "react/jsx-runtime";
|
|
3
3
|
import M, { useMemo as v } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import "./
|
|
6
|
-
import { P as R, a as _, b as $ } from "./popover-
|
|
4
|
+
import { A as S, T as j } from "./toggle-CaSwYCk4.js";
|
|
5
|
+
import { u as P, d as w, T as N, a as z, b as L, h as O } from "./useButtonProps-D-ruygH7.js";
|
|
6
|
+
import { P as R, a as _, b as $ } from "./popover-BC7FRr8B.js";
|
|
7
|
+
import { I as b } from "./Icon-BvGyfX2j.js";
|
|
7
8
|
var E = C.create({
|
|
8
9
|
name: "textAlign",
|
|
9
10
|
addOptions() {
|
|
@@ -46,27 +47,27 @@ var E = C.create({
|
|
|
46
47
|
};
|
|
47
48
|
}
|
|
48
49
|
}), J = E;
|
|
49
|
-
function
|
|
50
|
-
const [e, t] = M.useState(!1), n =
|
|
51
|
-
icon:
|
|
50
|
+
function U() {
|
|
51
|
+
const [e, t] = M.useState(!1), n = P(B.name), {
|
|
52
|
+
icon: p = void 0,
|
|
52
53
|
tooltip: x = void 0,
|
|
53
54
|
items: r = [],
|
|
54
|
-
isActive:
|
|
55
|
-
} = (n == null ? void 0 : n.componentProps) ?? {}, { disabled: l, dataState: a } =
|
|
56
|
-
return n ? /* @__PURE__ */
|
|
55
|
+
isActive: m = void 0
|
|
56
|
+
} = (n == null ? void 0 : n.componentProps) ?? {}, { disabled: l, dataState: a } = w(m), h = v(() => (a == null ? void 0 : a.title) || "", [a]), g = v(() => r == null ? void 0 : r.some((i) => i.title === h), [r, h]);
|
|
57
|
+
return n ? /* @__PURE__ */ A(R, { modal: !0, onOpenChange: t, open: e, children: [
|
|
57
58
|
/* @__PURE__ */ o(
|
|
58
59
|
_,
|
|
59
60
|
{
|
|
60
61
|
asChild: !0,
|
|
61
62
|
className: "hover:richtext-bg-accent data-[state=on]:richtext-bg-accent",
|
|
62
|
-
"data-state":
|
|
63
|
+
"data-state": g ? "on" : "off",
|
|
63
64
|
disabled: l,
|
|
64
65
|
children: /* @__PURE__ */ o(
|
|
65
|
-
|
|
66
|
+
S,
|
|
66
67
|
{
|
|
67
68
|
customClass: "!richtext-w-12 richtext-h-12",
|
|
68
69
|
disabled: l,
|
|
69
|
-
icon:
|
|
70
|
+
icon: p,
|
|
70
71
|
tooltip: x,
|
|
71
72
|
children: /* @__PURE__ */ o(
|
|
72
73
|
b,
|
|
@@ -87,9 +88,9 @@ function Q() {
|
|
|
87
88
|
side: "bottom",
|
|
88
89
|
children: r == null ? void 0 : r.map((i, d) => {
|
|
89
90
|
var s, c;
|
|
90
|
-
return /* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */ o(
|
|
92
|
-
|
|
91
|
+
return /* @__PURE__ */ A(N, { children: [
|
|
92
|
+
/* @__PURE__ */ o(z, { asChild: !0, children: /* @__PURE__ */ o(
|
|
93
|
+
j,
|
|
93
94
|
{
|
|
94
95
|
className: "richtext-size-7 richtext-p-1",
|
|
95
96
|
"data-state": h === i.title ? "on" : "off",
|
|
@@ -100,7 +101,7 @@ function Q() {
|
|
|
100
101
|
children: (i == null ? void 0 : i.icon) && /* @__PURE__ */ o(b, { name: i.icon })
|
|
101
102
|
}
|
|
102
103
|
) }),
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ A(L, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
|
|
104
105
|
/* @__PURE__ */ o("span", { children: i.title }),
|
|
105
106
|
!!((s = i.shortcutKeys) != null && s.length) && /* @__PURE__ */ o("span", { children: (c = i.shortcutKeys) == null ? void 0 : c.map((u) => O(u)).join(" ") })
|
|
106
107
|
] })
|
|
@@ -120,15 +121,15 @@ const B = /* @__PURE__ */ J.extend({
|
|
|
120
121
|
button({
|
|
121
122
|
editor: t,
|
|
122
123
|
extension: n,
|
|
123
|
-
t:
|
|
124
|
+
t: p
|
|
124
125
|
}) {
|
|
125
|
-
var a, h,
|
|
126
|
+
var a, h, g, i, d;
|
|
126
127
|
const x = ((a = n.options) == null ? void 0 : a.alignments) || [], r = {
|
|
127
128
|
left: ((h = n.options.shortcutKeys) == null ? void 0 : h[0]) ?? ["mod", "Shift", "L"],
|
|
128
|
-
center: ((
|
|
129
|
+
center: ((g = n.options.shortcutKeys) == null ? void 0 : g[1]) ?? ["mod", "Shift", "E"],
|
|
129
130
|
right: ((i = n.options.shortcutKeys) == null ? void 0 : i[2]) ?? ["mod", "Shift", "R"],
|
|
130
131
|
justify: ((d = n.options.shortcutKeys) == null ? void 0 : d[3]) ?? ["mod", "Shift", "J"]
|
|
131
|
-
},
|
|
132
|
+
}, m = {
|
|
132
133
|
left: "AlignLeft",
|
|
133
134
|
center: "AlignCenter",
|
|
134
135
|
right: "AlignRight",
|
|
@@ -136,8 +137,8 @@ const B = /* @__PURE__ */ J.extend({
|
|
|
136
137
|
}, l = x.map((s) => {
|
|
137
138
|
var c, u, y;
|
|
138
139
|
return {
|
|
139
|
-
title:
|
|
140
|
-
icon:
|
|
140
|
+
title: p(`editor.textalign.${s}.tooltip`),
|
|
141
|
+
icon: m[s],
|
|
141
142
|
shortcutKeys: r[s],
|
|
142
143
|
isActive: () => t.isActive({ textAlign: s }) || !1,
|
|
143
144
|
action: () => {
|
|
@@ -150,7 +151,7 @@ const B = /* @__PURE__ */ J.extend({
|
|
|
150
151
|
return {
|
|
151
152
|
componentProps: {
|
|
152
153
|
icon: "AlignJustify",
|
|
153
|
-
tooltip:
|
|
154
|
+
tooltip: p("editor.textalign.tooltip"),
|
|
154
155
|
items: l,
|
|
155
156
|
isActive: () => l == null ? void 0 : l.find((c) => c.isActive())
|
|
156
157
|
}
|
|
@@ -160,6 +161,6 @@ const B = /* @__PURE__ */ J.extend({
|
|
|
160
161
|
}
|
|
161
162
|
});
|
|
162
163
|
export {
|
|
163
|
-
|
|
164
|
+
U as RichTextAlign,
|
|
164
165
|
B as TextAlign
|
|
165
166
|
};
|
package/lib/TextDirection.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./clsx-CXbNJWDD.cjs"),e=require("react/jsx-runtime"),f=require("react"),j=require("./toggle-C9tcMm1r.cjs"),c=require("./useButtonProps-D9ndBdmA.cjs"),T=require("./popover-C3A6zzNV.cjs"),m=require("./Icon-wjwoRc9F.cjs");function b(){const n=c.useButtonProps(D.name),[s,u]=f.useState(!1),{icon:h=void 0,tooltip:d=void 0,items:l=[],isActive:p=void 0}=(n==null?void 0:n.componentProps)??{},{editorDisabled:a,dataState:o}=c.useActive(p),i=f.useMemo(()=>(o==null?void 0:o.dir)||"unset",[o]);return n?e.jsxs(T.Popover,{open:s,onOpenChange:u,modal:!0,children:[e.jsx(T.PopoverTrigger,{asChild:!0,disabled:a,children:e.jsx(j.ActionButton,{customClass:"!richtext-w-12 richtext-h-12",disabled:a,icon:h,tooltip:d,children:e.jsx(m.IconComponent,{className:"richtext-ml-1 richtext-size-3 richtext-text-zinc-500",name:"MenuDown"})})}),e.jsx(T.PopoverContent,{align:"start",className:"richtext-flex richtext-w-full richtext-min-w-4 richtext-flex-row richtext-gap-1 !richtext-p-[4px]",side:"bottom",hideWhenDetached:!0,children:l==null?void 0:l.map((t,r)=>{var x,g;return e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{"data-state":i===t.value?"on":"off",asChild:!0,children:e.jsx(j.Toggle,{className:"richtext-size-7 richtext-p-1",onClick:()=>{t==null||t.action(),u(!1)},size:"sm",children:(t==null?void 0:t.icon)&&e.jsx(m.IconComponent,{name:t.icon})})}),e.jsxs(c.TooltipContent,{className:"richtext-flex richtext-flex-col richtext-items-center",children:[e.jsx("span",{children:t.title}),!!((x=t.shortcutKeys)!=null&&x.length)&&e.jsx("span",{children:(g=t.shortcutKeys)==null?void 0:g.map(v=>c.getShortcutKey(v)).join(" ")})]})]},`text-direction-${r}`)})})]}):e.jsx(e.Fragment,{})}const D=C.Extension.create({name:"richTextTextDirection",addOptions(){var n;return{...(n=this.parent)==null?void 0:n.call(this),directions:["auto","ltr","rtl","unset"],defaultDirection:"auto",button({editor:s,extension:u,t:h}){var a;const d=((a=u.options)==null?void 0:a.directions)||[],l={auto:"TextDirection",ltr:"LeftToRight",rtl:"RightToLeft",unset:"X"},p=d.map(o=>({title:h(`editor.textDirection.${o}.tooltip`),value:o,icon:l[o],action:()=>{var i,t,r,x;if(o==="unset"){(t=(i=s.commands)==null?void 0:i.unsetTextDirection)==null||t.call(i);return}(x=(r=s.commands)==null?void 0:r.setTextDirection)==null||x.call(r,o)},disabled:!1}));return{componentProps:{icon:"TextDirection",tooltip:h("editor.textDirection.tooltip"),items:p,isActive:()=>s.getAttributes("paragraph")}}}}}});exports.RichTextTextDirection=b;exports.TextDirection=D;
|
package/lib/TextDirection.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { E as g } from "./clsx-
|
|
1
|
+
import { E as g } from "./clsx-m_C5j3RU.js";
|
|
2
2
|
import { jsx as o, Fragment as D, jsxs as x } from "react/jsx-runtime";
|
|
3
3
|
import v, { useMemo as b } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import "./
|
|
6
|
-
import { P as y, a as K, b as M } from "./popover-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { A as C, T as A } from "./toggle-CaSwYCk4.js";
|
|
5
|
+
import { u as P, d as w, T as z, a as N, b as R, h as j } from "./useButtonProps-D-ruygH7.js";
|
|
6
|
+
import { P as y, a as K, b as M } from "./popover-BC7FRr8B.js";
|
|
7
|
+
import { I as f } from "./Icon-BvGyfX2j.js";
|
|
8
|
+
function S() {
|
|
9
|
+
const i = P(O.name), [c, h] = v.useState(!1), {
|
|
9
10
|
icon: p = void 0,
|
|
10
|
-
tooltip:
|
|
11
|
+
tooltip: d = void 0,
|
|
11
12
|
items: s = [],
|
|
12
|
-
isActive:
|
|
13
|
-
} = (i == null ? void 0 : i.componentProps) ?? {}, { editorDisabled: a, dataState: e } =
|
|
13
|
+
isActive: u = void 0
|
|
14
|
+
} = (i == null ? void 0 : i.componentProps) ?? {}, { editorDisabled: a, dataState: e } = w(u), r = b(() => (e == null ? void 0 : e.dir) || "unset", [e]);
|
|
14
15
|
return i ? /* @__PURE__ */ x(y, { open: c, onOpenChange: h, modal: !0, children: [
|
|
15
16
|
/* @__PURE__ */ o(K, { asChild: !0, disabled: a, children: /* @__PURE__ */ o(
|
|
16
|
-
|
|
17
|
+
C,
|
|
17
18
|
{
|
|
18
19
|
customClass: "!richtext-w-12 richtext-h-12",
|
|
19
20
|
disabled: a,
|
|
20
21
|
icon: p,
|
|
21
|
-
tooltip:
|
|
22
|
+
tooltip: d,
|
|
22
23
|
children: /* @__PURE__ */ o(
|
|
23
24
|
f,
|
|
24
25
|
{
|
|
@@ -37,9 +38,9 @@ function F() {
|
|
|
37
38
|
hideWhenDetached: !0,
|
|
38
39
|
children: s == null ? void 0 : s.map((t, n) => {
|
|
39
40
|
var l, m;
|
|
40
|
-
return /* @__PURE__ */ x(
|
|
41
|
-
/* @__PURE__ */ o(
|
|
42
|
-
|
|
41
|
+
return /* @__PURE__ */ x(z, { children: [
|
|
42
|
+
/* @__PURE__ */ o(N, { "data-state": r === t.value ? "on" : "off", asChild: !0, children: /* @__PURE__ */ o(
|
|
43
|
+
A,
|
|
43
44
|
{
|
|
44
45
|
className: "richtext-size-7 richtext-p-1",
|
|
45
46
|
onClick: () => {
|
|
@@ -73,12 +74,12 @@ const O = /* @__PURE__ */ g.create({
|
|
|
73
74
|
t: p
|
|
74
75
|
}) {
|
|
75
76
|
var a;
|
|
76
|
-
const
|
|
77
|
+
const d = ((a = h.options) == null ? void 0 : a.directions) || [], s = {
|
|
77
78
|
auto: "TextDirection",
|
|
78
79
|
ltr: "LeftToRight",
|
|
79
80
|
rtl: "RightToLeft",
|
|
80
81
|
unset: "X"
|
|
81
|
-
},
|
|
82
|
+
}, u = d.map((e) => ({
|
|
82
83
|
title: p(`editor.textDirection.${e}.tooltip`),
|
|
83
84
|
value: e,
|
|
84
85
|
icon: s[e],
|
|
@@ -96,7 +97,7 @@ const O = /* @__PURE__ */ g.create({
|
|
|
96
97
|
componentProps: {
|
|
97
98
|
icon: "TextDirection",
|
|
98
99
|
tooltip: p("editor.textDirection.tooltip"),
|
|
99
|
-
items:
|
|
100
|
+
items: u,
|
|
100
101
|
isActive: () => c.getAttributes("paragraph")
|
|
101
102
|
}
|
|
102
103
|
};
|
|
@@ -105,6 +106,6 @@ const O = /* @__PURE__ */ g.create({
|
|
|
105
106
|
}
|
|
106
107
|
});
|
|
107
108
|
export {
|
|
108
|
-
|
|
109
|
+
S as RichTextTextDirection,
|
|
109
110
|
O as TextDirection
|
|
110
111
|
};
|
package/lib/TextUnderline.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./clsx-CXbNJWDD.cjs"),s=require("react/jsx-runtime"),h=require("./toggle-C9tcMm1r.cjs"),a=require("./useButtonProps-D9ndBdmA.cjs");var k=u.Mark.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",u.mergeAttributes(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:"underline",level:"inline",start(e){return e.indexOf("++")},tokenize(e,t,n){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;const i=r[2].trim();return{type:"underline",raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),v=k;function x(){const e=a.useButtonProps(l.name),{icon:t=void 0,tooltip:n=void 0,shortcutKeys:o=void 0,tooltipOptions:r={},action:i=void 0,isActive:c=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:m,disabled:d,update:p}=a.useToggleActive(c),g=()=>{d||i&&(i(),p())};return e?s.jsx(h.ActionButton,{action:g,dataState:m,disabled:d,icon:t,shortcutKeys:o,tooltip:n,tooltipOptions:r}):s.jsx(s.Fragment,{})}const l=v.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button({editor:t,t:n,extension:o}){return{componentProps:{action:()=>t.commands.toggleUnderline(),isActive:()=>t.isActive("underline")||!1,disabled:!1,icon:"Underline",shortcutKeys:o.options.shortcutKeys??["mod","U"],tooltip:n("editor.underline.tooltip")}}}}}});exports.RichTextUnderline=x;exports.TextUnderline=l;
|