reactjs-tiptap-editor-pro 0.2.37 → 0.2.38
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/extension-bundle.d.cts +90 -90
- package/lib/extension-bundle.d.ts +90 -90
- package/lib/index.cjs +3 -3
- package/lib/index.d.cts +90 -90
- package/lib/index.d.ts +90 -90
- package/lib/index.js +65 -64
- package/lib/locale-bundle.d.cts +90 -90
- package/lib/locale-bundle.d.ts +90 -90
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import { Editor as si, makeDropdownToolbar as li } from "easydrawer";
|
|
|
12
12
|
import ci from "katex";
|
|
13
13
|
import $t from "mermaid";
|
|
14
14
|
import di, { sticky as ui } from "tippy.js";
|
|
15
|
-
function
|
|
15
|
+
function Uc() {
|
|
16
16
|
var o;
|
|
17
17
|
const e = ne({ editor: null }), [t, n] = I(!1), [r, i] = I(null);
|
|
18
18
|
return R(() => {
|
|
@@ -1596,14 +1596,14 @@ function Hl({ editor: e, disabled: t, bubbleMenu: n }) {
|
|
|
1596
1596
|
var o, s, c, l, d, f, u, h, m, g, y, x, A, _, E, b, v, T;
|
|
1597
1597
|
return [
|
|
1598
1598
|
r.includes("columns") && !((o = n == null ? void 0 : n.columnConfig) != null && o.hidden) ? /* @__PURE__ */ a(
|
|
1599
|
-
|
|
1599
|
+
xc,
|
|
1600
1600
|
{
|
|
1601
1601
|
editor: e
|
|
1602
1602
|
},
|
|
1603
1603
|
"columns"
|
|
1604
1604
|
) : null,
|
|
1605
1605
|
r.includes("table") && !((s = n == null ? void 0 : n.tableConfig) != null && s.hidden) ? /* @__PURE__ */ a(
|
|
1606
|
-
|
|
1606
|
+
uc,
|
|
1607
1607
|
{
|
|
1608
1608
|
editor: e,
|
|
1609
1609
|
items: (c = n == null ? void 0 : n.tableConfig) == null ? void 0 : c.items,
|
|
@@ -1612,7 +1612,7 @@ function Hl({ editor: e, disabled: t, bubbleMenu: n }) {
|
|
|
1612
1612
|
"table"
|
|
1613
1613
|
) : null,
|
|
1614
1614
|
r.includes("link") && !((d = n == null ? void 0 : n.linkConfig) != null && d.hidden) ? /* @__PURE__ */ a(
|
|
1615
|
-
|
|
1615
|
+
hc,
|
|
1616
1616
|
{
|
|
1617
1617
|
disabled: t,
|
|
1618
1618
|
editor: e
|
|
@@ -1620,7 +1620,7 @@ function Hl({ editor: e, disabled: t, bubbleMenu: n }) {
|
|
|
1620
1620
|
"link"
|
|
1621
1621
|
) : null,
|
|
1622
1622
|
r.includes(hn.name) && !((f = n == null ? void 0 : n.imageConfig) != null && f.hidden) ? /* @__PURE__ */ a(
|
|
1623
|
-
|
|
1623
|
+
vc,
|
|
1624
1624
|
{
|
|
1625
1625
|
disabled: t,
|
|
1626
1626
|
editor: e
|
|
@@ -1628,7 +1628,7 @@ function Hl({ editor: e, disabled: t, bubbleMenu: n }) {
|
|
|
1628
1628
|
"image"
|
|
1629
1629
|
) : null,
|
|
1630
1630
|
r.includes(mn.name) && !((u = n == null ? void 0 : n.imageGifConfig) != null && u.hidden) ? /* @__PURE__ */ a(
|
|
1631
|
-
|
|
1631
|
+
yc,
|
|
1632
1632
|
{
|
|
1633
1633
|
disabled: t,
|
|
1634
1634
|
editor: e
|
|
@@ -1636,7 +1636,7 @@ function Hl({ editor: e, disabled: t, bubbleMenu: n }) {
|
|
|
1636
1636
|
"imageGif"
|
|
1637
1637
|
) : null,
|
|
1638
1638
|
r.includes("video") && !((h = n == null ? void 0 : n.videoConfig) != null && h.hidden) ? /* @__PURE__ */ a(
|
|
1639
|
-
|
|
1639
|
+
wc,
|
|
1640
1640
|
{
|
|
1641
1641
|
disabled: t,
|
|
1642
1642
|
editor: e
|
|
@@ -1684,7 +1684,7 @@ function Hl({ editor: e, disabled: t, bubbleMenu: n }) {
|
|
|
1684
1684
|
"content"
|
|
1685
1685
|
),
|
|
1686
1686
|
(_ = n == null ? void 0 : n.textConfig) != null && _.hidden ? null : /* @__PURE__ */ a(
|
|
1687
|
-
|
|
1687
|
+
sc,
|
|
1688
1688
|
{
|
|
1689
1689
|
disabled: t,
|
|
1690
1690
|
editor: e,
|
|
@@ -2663,11 +2663,6 @@ function ac(e) {
|
|
|
2663
2663
|
}
|
|
2664
2664
|
);
|
|
2665
2665
|
}
|
|
2666
|
-
const sc = {
|
|
2667
|
-
maxWidth: "auto",
|
|
2668
|
-
zIndex: 20,
|
|
2669
|
-
moveTransition: "transform 0.1s ease-out"
|
|
2670
|
-
};
|
|
2671
2666
|
function ir({ item: e, disabled: t, editor: n }) {
|
|
2672
2667
|
var i;
|
|
2673
2668
|
const r = e.component;
|
|
@@ -2680,17 +2675,23 @@ function ir({ item: e, disabled: t, editor: n }) {
|
|
|
2680
2675
|
}
|
|
2681
2676
|
) : /* @__PURE__ */ a(N, {});
|
|
2682
2677
|
}
|
|
2683
|
-
function
|
|
2684
|
-
const { t, lang: n } = D(), r = (
|
|
2685
|
-
|
|
2686
|
-
|
|
2678
|
+
function sc(e) {
|
|
2679
|
+
const { t, lang: n } = D(), r = (o) => {
|
|
2680
|
+
var f;
|
|
2681
|
+
const { editor: s } = o, { selection: c } = s.view.state, { $from: l, to: d } = c;
|
|
2682
|
+
return l.pos === d ? !1 : c instanceof pn || (((f = e.showShow) == null ? void 0 : f.call(e, o)) ?? !1);
|
|
2687
2683
|
}, i = F(() => e.disabled || !(e != null && e.editor) ? [] : tr(e.editor, t, e.items).filter((o) => e.filterItem ? e.filterItem(o, e.editor) : !0), [e.disabled, e.editor, e.items, e.filterItem, n, t]);
|
|
2688
2684
|
return /* @__PURE__ */ a(
|
|
2689
2685
|
L,
|
|
2690
2686
|
{
|
|
2691
2687
|
editor: e == null ? void 0 : e.editor,
|
|
2692
|
-
shouldShow:
|
|
2693
|
-
tippyOptions:
|
|
2688
|
+
shouldShow: r,
|
|
2689
|
+
tippyOptions: {
|
|
2690
|
+
maxWidth: "auto",
|
|
2691
|
+
zIndex: 20,
|
|
2692
|
+
moveTransition: "transform 0.1s ease-out",
|
|
2693
|
+
placement: "bottom"
|
|
2694
|
+
},
|
|
2694
2695
|
children: i != null && i.length ? /* @__PURE__ */ a("div", { className: "pointer-events-auto w-auto select-none rounded-sm !border border-neutral-200 bg-background px-3 py-2 shadow-sm transition-all dark:border-neutral-800", children: /* @__PURE__ */ a("div", { className: "relative flex h-[26px] flex-nowrap items-center justify-start gap-[4px] whitespace-nowrap", children: i == null ? void 0 : i.map((o, s) => (o == null ? void 0 : o.type) === "divider" ? /* @__PURE__ */ a(
|
|
2695
2696
|
U,
|
|
2696
2697
|
{
|
|
@@ -2719,7 +2720,7 @@ function ct({ children: e, vertical: t }) {
|
|
|
2719
2720
|
}
|
|
2720
2721
|
) });
|
|
2721
2722
|
}
|
|
2722
|
-
function
|
|
2723
|
+
function lc({ editor: e, disabled: t }) {
|
|
2723
2724
|
var c, l, d, f, u, h;
|
|
2724
2725
|
const { t: n } = D(), r = O(
|
|
2725
2726
|
({ view: m, state: g, from: y }) => !g || !y ? !1 : vn({ editor: e, view: m, state: g, from: y }),
|
|
@@ -2789,7 +2790,7 @@ function cc({ editor: e, disabled: t }) {
|
|
|
2789
2790
|
}
|
|
2790
2791
|
);
|
|
2791
2792
|
}
|
|
2792
|
-
function
|
|
2793
|
+
function cc({ editor: e, disabled: t }) {
|
|
2793
2794
|
var c, l, d, f, u, h;
|
|
2794
2795
|
const { t: n } = D(), r = O(
|
|
2795
2796
|
({ view: m, state: g, from: y }) => g ? yn({ editor: e, view: m, state: g, from: y || 0 }) : !1,
|
|
@@ -2858,7 +2859,7 @@ function dc({ editor: e, disabled: t }) {
|
|
|
2858
2859
|
}
|
|
2859
2860
|
);
|
|
2860
2861
|
}
|
|
2861
|
-
function
|
|
2862
|
+
function dc({ editor: e, disabled: t, actions: n, ...r }) {
|
|
2862
2863
|
var y, x, A, _, E, b;
|
|
2863
2864
|
const i = ({ editor: v, view: T, state: w, from: P }) => {
|
|
2864
2865
|
const { selection: M } = v.view.state, { $from: k, to: S } = M;
|
|
@@ -2987,14 +2988,14 @@ function uc({ editor: e, disabled: t, actions: n, ...r }) {
|
|
|
2987
2988
|
}
|
|
2988
2989
|
);
|
|
2989
2990
|
}
|
|
2990
|
-
function
|
|
2991
|
+
function uc(e) {
|
|
2991
2992
|
return /* @__PURE__ */ p(N, { children: [
|
|
2992
|
-
/* @__PURE__ */ a(
|
|
2993
|
-
/* @__PURE__ */ a(
|
|
2994
|
-
/* @__PURE__ */ a(
|
|
2993
|
+
/* @__PURE__ */ a(dc, { ...e }),
|
|
2994
|
+
/* @__PURE__ */ a(lc, { ...e }),
|
|
2995
|
+
/* @__PURE__ */ a(cc, { ...e })
|
|
2995
2996
|
] });
|
|
2996
2997
|
}
|
|
2997
|
-
function
|
|
2998
|
+
function fc(e) {
|
|
2998
2999
|
const { t } = D();
|
|
2999
3000
|
return /* @__PURE__ */ p("div", { className: "flex items-center gap-2 p-2 bg-white !border rounded-lg shadow-sm dark:bg-black border-neutral-200 dark:border-neutral-800", children: [
|
|
3000
3001
|
/* @__PURE__ */ a(
|
|
@@ -3037,7 +3038,7 @@ function hc(e) {
|
|
|
3037
3038
|
] })
|
|
3038
3039
|
] });
|
|
3039
3040
|
}
|
|
3040
|
-
function
|
|
3041
|
+
function hc({ editor: e, disabled: t }) {
|
|
3041
3042
|
const [n, r] = I(!1), i = F(() => {
|
|
3042
3043
|
const { href: l } = e.getAttributes("link");
|
|
3043
3044
|
return l;
|
|
@@ -3075,7 +3076,7 @@ function mc({ editor: e, disabled: t }) {
|
|
|
3075
3076
|
}
|
|
3076
3077
|
},
|
|
3077
3078
|
children: t ? /* @__PURE__ */ a(N, {}) : /* @__PURE__ */ a(N, { children: n ? /* @__PURE__ */ a(jr, { onSetLink: s, editor: e }) : /* @__PURE__ */ a(
|
|
3078
|
-
|
|
3079
|
+
fc,
|
|
3079
3080
|
{
|
|
3080
3081
|
editor: e,
|
|
3081
3082
|
onClear: c,
|
|
@@ -3112,21 +3113,21 @@ function ut({ item: e, disabled: t, editor: n }) {
|
|
|
3112
3113
|
}
|
|
3113
3114
|
) }) : /* @__PURE__ */ a(N, {});
|
|
3114
3115
|
}
|
|
3115
|
-
function
|
|
3116
|
+
function mc(e) {
|
|
3116
3117
|
return e.type.name === hn.name;
|
|
3117
3118
|
}
|
|
3118
|
-
function
|
|
3119
|
+
function gc(e) {
|
|
3119
3120
|
return e.type.name === mn.name;
|
|
3120
3121
|
}
|
|
3121
|
-
function
|
|
3122
|
+
function pc(e) {
|
|
3122
3123
|
return e.type.name === Hr.name;
|
|
3123
3124
|
}
|
|
3124
|
-
function
|
|
3125
|
+
function vc(e) {
|
|
3125
3126
|
const { lang: t } = D(), n = ({ editor: i }) => {
|
|
3126
3127
|
const { selection: o } = i.view.state, { $from: s, to: c } = o;
|
|
3127
3128
|
let l = !1;
|
|
3128
3129
|
return i.view.state.doc.nodesBetween(s.pos, c, (d) => {
|
|
3129
|
-
if (
|
|
3130
|
+
if (mc(d))
|
|
3130
3131
|
return l = !0, !1;
|
|
3131
3132
|
}), l;
|
|
3132
3133
|
}, r = F(() => e.disabled ? [] : Jl(e.editor), [e.disabled, e.editor, t]);
|
|
@@ -3148,12 +3149,12 @@ function yc(e) {
|
|
|
3148
3149
|
}
|
|
3149
3150
|
) });
|
|
3150
3151
|
}
|
|
3151
|
-
function
|
|
3152
|
+
function yc(e) {
|
|
3152
3153
|
const { lang: t } = D(), n = ({ editor: i }) => {
|
|
3153
3154
|
const { selection: o } = i.view.state, { $from: s, to: c } = o;
|
|
3154
3155
|
let l = !1;
|
|
3155
3156
|
return i.view.state.doc.nodesBetween(s.pos, c, (d) => {
|
|
3156
|
-
if (
|
|
3157
|
+
if (gc(d))
|
|
3157
3158
|
return l = !0, !1;
|
|
3158
3159
|
}), l;
|
|
3159
3160
|
}, r = F(() => e.disabled ? [] : Zl(e.editor), [e.disabled, e.editor, t]);
|
|
@@ -3175,12 +3176,12 @@ function wc(e) {
|
|
|
3175
3176
|
}
|
|
3176
3177
|
) });
|
|
3177
3178
|
}
|
|
3178
|
-
function
|
|
3179
|
+
function wc(e) {
|
|
3179
3180
|
const { lang: t } = D(), n = ({ editor: i }) => {
|
|
3180
3181
|
const { selection: o } = i.view.state, { $from: s, to: c } = o;
|
|
3181
3182
|
let l = !1;
|
|
3182
3183
|
return i.view.state.doc.nodesBetween(s.pos, c, (d) => {
|
|
3183
|
-
if (
|
|
3184
|
+
if (pc(d))
|
|
3184
3185
|
return l = !0, !1;
|
|
3185
3186
|
}), l;
|
|
3186
3187
|
}, r = F(() => e.disabled ? [] : tc(e.editor), [e.editor, e.disabled, t]);
|
|
@@ -3202,7 +3203,7 @@ function xc(e) {
|
|
|
3202
3203
|
}
|
|
3203
3204
|
) });
|
|
3204
3205
|
}
|
|
3205
|
-
function
|
|
3206
|
+
function xc({ editor: e }) {
|
|
3206
3207
|
const { t } = D(), n = O(() => e.isActive(Pt.name), [e]), r = O(() => Ae(Pt.name, e), [e]), i = O(() => e.chain().focus().addColBefore().run(), [e]), o = O(() => e.chain().focus().addColAfter().run(), [e]), s = O(() => e.chain().focus().deleteCol().run(), [e]);
|
|
3207
3208
|
return /* @__PURE__ */ a(
|
|
3208
3209
|
L,
|
|
@@ -3258,7 +3259,7 @@ function bc({ editor: e }) {
|
|
|
3258
3259
|
}
|
|
3259
3260
|
);
|
|
3260
3261
|
}
|
|
3261
|
-
function
|
|
3262
|
+
function bc({ editor: e, extensions: t }) {
|
|
3262
3263
|
const { t: n } = D(), r = F(() => {
|
|
3263
3264
|
var i, o, s;
|
|
3264
3265
|
return (s = (o = (i = t == null ? void 0 : t.find((c) => c.name === "base-kit")) == null ? void 0 : i.options) == null ? void 0 : o.characterCount) == null ? void 0 : s.limit;
|
|
@@ -3275,7 +3276,7 @@ function Cc({ editor: e, extensions: t }) {
|
|
|
3275
3276
|
n("editor.characters")
|
|
3276
3277
|
] }) }) }) });
|
|
3277
3278
|
}
|
|
3278
|
-
function
|
|
3279
|
+
function Cc() {
|
|
3279
3280
|
const { toasts: e } = Ur();
|
|
3280
3281
|
return /* @__PURE__ */ p(Al, { children: [
|
|
3281
3282
|
e.map(({ id: t, title: n, description: r, action: i, ...o }) => /* @__PURE__ */ p(
|
|
@@ -3296,7 +3297,7 @@ function Tc() {
|
|
|
3296
3297
|
/* @__PURE__ */ a(qn, {})
|
|
3297
3298
|
] });
|
|
3298
3299
|
}
|
|
3299
|
-
const
|
|
3300
|
+
const Tc = `
|
|
3300
3301
|
.reactjs-tiptap-editor,
|
|
3301
3302
|
.dialog-content {
|
|
3302
3303
|
button,
|
|
@@ -3434,7 +3435,7 @@ div[data-tippy-root] {
|
|
|
3434
3435
|
color: inherit;
|
|
3435
3436
|
}
|
|
3436
3437
|
}
|
|
3437
|
-
`,
|
|
3438
|
+
`, Ac = fr(({ children: e, id: t }) => {
|
|
3438
3439
|
const [, n] = Vr((s) => s.value), [, r] = Kr((s) => s.value), i = (s) => {
|
|
3439
3440
|
n({
|
|
3440
3441
|
value: s.detail
|
|
@@ -3451,11 +3452,11 @@ div[data-tippy-root] {
|
|
|
3451
3452
|
};
|
|
3452
3453
|
}, []), /* @__PURE__ */ a(N, { children: e });
|
|
3453
3454
|
});
|
|
3454
|
-
function
|
|
3455
|
-
return /* @__PURE__ */ a(Gr, { children: /* @__PURE__ */ a(Wr, { children: /* @__PURE__ */ a(
|
|
3455
|
+
function Sc({ children: e, id: t }) {
|
|
3456
|
+
return /* @__PURE__ */ a(Gr, { children: /* @__PURE__ */ a(Wr, { children: /* @__PURE__ */ a(Ac, { id: t, children: e }) }) });
|
|
3456
3457
|
}
|
|
3457
|
-
const sn = "data-rc-order", ln = "data-rc-priority",
|
|
3458
|
-
function
|
|
3458
|
+
const sn = "data-rc-order", ln = "data-rc-priority", Pc = "rc-util-key", We = /* @__PURE__ */ new Map();
|
|
3459
|
+
function _c(e, t) {
|
|
3459
3460
|
if (!e)
|
|
3460
3461
|
return !1;
|
|
3461
3462
|
if (e.contains)
|
|
@@ -3469,12 +3470,12 @@ function Nc(e, t) {
|
|
|
3469
3470
|
return !1;
|
|
3470
3471
|
}
|
|
3471
3472
|
function or({ mark: e } = {}) {
|
|
3472
|
-
return e ? e.startsWith("data-") ? e : `data-${e}` :
|
|
3473
|
+
return e ? e.startsWith("data-") ? e : `data-${e}` : Pc;
|
|
3473
3474
|
}
|
|
3474
3475
|
function ft(e) {
|
|
3475
3476
|
return e.attachTo ? e.attachTo : document.querySelector("head") || document.body;
|
|
3476
3477
|
}
|
|
3477
|
-
function
|
|
3478
|
+
function Nc(e) {
|
|
3478
3479
|
return e === "queue" ? "prependQueue" : e ? "prepend" : "append";
|
|
3479
3480
|
}
|
|
3480
3481
|
function ar(e) {
|
|
@@ -3483,7 +3484,7 @@ function ar(e) {
|
|
|
3483
3484
|
);
|
|
3484
3485
|
}
|
|
3485
3486
|
function sr(e, t = {}) {
|
|
3486
|
-
const { csp: n, prepend: r, priority: i = 0 } = t, o =
|
|
3487
|
+
const { csp: n, prepend: r, priority: i = 0 } = t, o = Nc(r), s = o === "prependQueue", c = document.createElement("style");
|
|
3487
3488
|
c.setAttribute(sn, o), s && i && c.setAttribute(ln, `${i}`), n != null && n.nonce && (c.nonce = n == null ? void 0 : n.nonce), c.innerHTML = e;
|
|
3488
3489
|
const l = ft(t), { firstChild: d } = l;
|
|
3489
3490
|
if (r) {
|
|
@@ -3506,28 +3507,28 @@ function lr(e, t = {}) {
|
|
|
3506
3507
|
const n = ft(t);
|
|
3507
3508
|
return ar(n).find((r) => r.getAttribute(or(t)) === e);
|
|
3508
3509
|
}
|
|
3509
|
-
function
|
|
3510
|
+
function Ec(e, t = {}) {
|
|
3510
3511
|
const n = lr(e, t);
|
|
3511
3512
|
n && n.remove();
|
|
3512
3513
|
}
|
|
3513
|
-
function
|
|
3514
|
+
function $c(e, t) {
|
|
3514
3515
|
const n = We.get(e);
|
|
3515
|
-
if (!n || !
|
|
3516
|
+
if (!n || !_c(document, n)) {
|
|
3516
3517
|
const r = sr("", t), { parentNode: i } = r;
|
|
3517
3518
|
We.set(e, i), r.remove();
|
|
3518
3519
|
}
|
|
3519
3520
|
}
|
|
3520
|
-
function
|
|
3521
|
+
function Oc(e, t, n = {}) {
|
|
3521
3522
|
var s, c, l;
|
|
3522
3523
|
const r = ft(n);
|
|
3523
|
-
|
|
3524
|
+
$c(r, n);
|
|
3524
3525
|
const i = lr(t, n);
|
|
3525
3526
|
if (i)
|
|
3526
3527
|
return (s = n.csp) != null && s.nonce && i.nonce !== ((c = n.csp) == null ? void 0 : c.nonce) && (i.nonce = (l = n.csp) == null ? void 0 : l.nonce), i.innerHTML !== e && (i.innerHTML = e), i;
|
|
3527
3528
|
const o = sr(e, n);
|
|
3528
3529
|
return o.setAttribute(or(n), t), o;
|
|
3529
3530
|
}
|
|
3530
|
-
function
|
|
3531
|
+
function Rc(e, t) {
|
|
3531
3532
|
const { content: n, extensions: r, useEditorOptions: i = {} } = e, o = mr(), s = F(() => {
|
|
3532
3533
|
const u = nl(r, r, "name");
|
|
3533
3534
|
return [...r.map((m) => {
|
|
@@ -3552,8 +3553,8 @@ function Ic(e, t) {
|
|
|
3552
3553
|
document.documentElement.classList.toggle("dark", e.dark), Yr.setTheme(o, e.dark ? "dark" : "light");
|
|
3553
3554
|
}, [e.dark]), R(() => {
|
|
3554
3555
|
l == null || l.setEditable(!(e != null && e.disabled)), Jr.setDisable(o, !(e != null && e.disabled));
|
|
3555
|
-
}, [l, e == null ? void 0 : e.disabled]), R(() => ((e == null ? void 0 : e.resetCSS) !== !1 &&
|
|
3556
|
-
|
|
3556
|
+
}, [l, e == null ? void 0 : e.disabled]), R(() => ((e == null ? void 0 : e.resetCSS) !== !1 && Oc(Tc, "react-tiptap-reset"), () => {
|
|
3557
|
+
Ec("react-tiptap-reset");
|
|
3557
3558
|
}), [e == null ? void 0 : e.resetCSS]);
|
|
3558
3559
|
function d(u, h) {
|
|
3559
3560
|
return e != null && e.removeDefaultWrapper ? h === "html" ? u.isEmpty ? "" : u.getHTML() : h === "json" ? u.isEmpty ? {} : u.getJSON() : h === "text" ? u.isEmpty ? "" : u.getText() : "" : h === "html" ? u.getHTML() : h === "json" ? u.getJSON() : h === "text" ? u.getText() : "";
|
|
@@ -3567,7 +3568,7 @@ function Ic(e, t) {
|
|
|
3567
3568
|
const f = Zr(l, "characterCount");
|
|
3568
3569
|
return l ? /* @__PURE__ */ p("div", { className: "reactjs-tiptap-editor", children: [
|
|
3569
3570
|
/* @__PURE__ */ a(
|
|
3570
|
-
|
|
3571
|
+
Sc,
|
|
3571
3572
|
{
|
|
3572
3573
|
id: o,
|
|
3573
3574
|
children: /* @__PURE__ */ a(
|
|
@@ -3592,7 +3593,7 @@ function Ic(e, t) {
|
|
|
3592
3593
|
}
|
|
3593
3594
|
),
|
|
3594
3595
|
f && /* @__PURE__ */ a(
|
|
3595
|
-
|
|
3596
|
+
bc,
|
|
3596
3597
|
{
|
|
3597
3598
|
editor: l,
|
|
3598
3599
|
extensions: r
|
|
@@ -3611,13 +3612,13 @@ function Ic(e, t) {
|
|
|
3611
3612
|
)
|
|
3612
3613
|
}
|
|
3613
3614
|
),
|
|
3614
|
-
/* @__PURE__ */ a(
|
|
3615
|
+
/* @__PURE__ */ a(Cc, {})
|
|
3615
3616
|
] }) : /* @__PURE__ */ a(N, {});
|
|
3616
3617
|
}
|
|
3617
|
-
const
|
|
3618
|
+
const Gc = hr(Rc);
|
|
3618
3619
|
export {
|
|
3619
3620
|
C as ActionButton,
|
|
3620
3621
|
L as BubbleMenu,
|
|
3621
|
-
|
|
3622
|
-
|
|
3622
|
+
Gc as default,
|
|
3623
|
+
Uc as useEditorState
|
|
3623
3624
|
};
|
package/lib/locale-bundle.d.cts
CHANGED
|
@@ -902,34 +902,17 @@ declare module '@tiptap/core' {
|
|
|
902
902
|
|
|
903
903
|
declare module '@tiptap/core' {
|
|
904
904
|
interface Commands<ReturnType> {
|
|
905
|
-
|
|
906
|
-
/**
|
|
907
|
-
* Add an image
|
|
908
|
-
*/
|
|
909
|
-
setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
910
|
-
/**
|
|
911
|
-
* Update an image
|
|
912
|
-
*/
|
|
913
|
-
updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
905
|
+
fontSize: {
|
|
914
906
|
/**
|
|
915
|
-
* Set
|
|
907
|
+
* Set the text font size. ex: "12px", "2em", or "small". Must be a valid
|
|
908
|
+
* CSS font-size
|
|
909
|
+
* (https://developer.mozilla.org/en-US/docs/Web/CSS/font-size).
|
|
916
910
|
*/
|
|
917
|
-
|
|
918
|
-
};
|
|
919
|
-
}
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
declare module '@tiptap/core' {
|
|
924
|
-
interface Commands<ReturnType> {
|
|
925
|
-
iframe: {
|
|
911
|
+
setFontSize: (fontSize: string) => ReturnType;
|
|
926
912
|
/**
|
|
927
|
-
*
|
|
913
|
+
* Unset the font size
|
|
928
914
|
*/
|
|
929
|
-
|
|
930
|
-
src: string;
|
|
931
|
-
service: string;
|
|
932
|
-
}) => ReturnType;
|
|
915
|
+
unsetFontSize: () => ReturnType;
|
|
933
916
|
};
|
|
934
917
|
}
|
|
935
918
|
}
|
|
@@ -951,6 +934,20 @@ declare module '@tiptap/core' {
|
|
|
951
934
|
}
|
|
952
935
|
|
|
953
936
|
|
|
937
|
+
declare module '@tiptap/core' {
|
|
938
|
+
interface Commands<ReturnType> {
|
|
939
|
+
columns: {
|
|
940
|
+
insertColumns: (attrs?: {
|
|
941
|
+
cols: number;
|
|
942
|
+
}) => ReturnType;
|
|
943
|
+
addColBefore: () => ReturnType;
|
|
944
|
+
addColAfter: () => ReturnType;
|
|
945
|
+
deleteCol: () => ReturnType;
|
|
946
|
+
};
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
|
|
954
951
|
declare module '@tiptap/core' {
|
|
955
952
|
interface Commands<ReturnType> {
|
|
956
953
|
lineHeight: {
|
|
@@ -963,11 +960,8 @@ declare module '@tiptap/core' {
|
|
|
963
960
|
|
|
964
961
|
declare module '@tiptap/core' {
|
|
965
962
|
interface Commands<ReturnType> {
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
name: string;
|
|
969
|
-
emoji: string;
|
|
970
|
-
}) => ReturnType;
|
|
963
|
+
painter: {
|
|
964
|
+
setPainter: (marks: Mark[]) => ReturnType;
|
|
971
965
|
};
|
|
972
966
|
}
|
|
973
967
|
}
|
|
@@ -975,17 +969,34 @@ declare module '@tiptap/core' {
|
|
|
975
969
|
|
|
976
970
|
declare module '@tiptap/core' {
|
|
977
971
|
interface Commands<ReturnType> {
|
|
978
|
-
|
|
972
|
+
search: {
|
|
973
|
+
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
974
|
+
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
975
|
+
replace: () => ReturnType;
|
|
976
|
+
replaceAll: () => ReturnType;
|
|
977
|
+
goToPrevSearchResult: () => void;
|
|
978
|
+
goToNextSearchResult: () => void;
|
|
979
|
+
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
980
|
+
};
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
|
|
985
|
+
declare module '@tiptap/core' {
|
|
986
|
+
interface Commands<ReturnType> {
|
|
987
|
+
imageUpload: {
|
|
979
988
|
/**
|
|
980
|
-
*
|
|
981
|
-
* CSS font-size
|
|
982
|
-
* (https://developer.mozilla.org/en-US/docs/Web/CSS/font-size).
|
|
989
|
+
* Add an image
|
|
983
990
|
*/
|
|
984
|
-
|
|
991
|
+
setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
985
992
|
/**
|
|
986
|
-
*
|
|
993
|
+
* Update an image
|
|
987
994
|
*/
|
|
988
|
-
|
|
995
|
+
updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
996
|
+
/**
|
|
997
|
+
* Set image alignment
|
|
998
|
+
*/
|
|
999
|
+
setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
989
1000
|
};
|
|
990
1001
|
}
|
|
991
1002
|
}
|
|
@@ -993,9 +1004,14 @@ declare module '@tiptap/core' {
|
|
|
993
1004
|
|
|
994
1005
|
declare module '@tiptap/core' {
|
|
995
1006
|
interface Commands<ReturnType> {
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
1007
|
+
iframe: {
|
|
1008
|
+
/**
|
|
1009
|
+
* Add an iframe
|
|
1010
|
+
*/
|
|
1011
|
+
setIframe: (options: {
|
|
1012
|
+
src: string;
|
|
1013
|
+
service: string;
|
|
1014
|
+
}) => ReturnType;
|
|
999
1015
|
};
|
|
1000
1016
|
}
|
|
1001
1017
|
}
|
|
@@ -1003,9 +1019,11 @@ declare module '@tiptap/core' {
|
|
|
1003
1019
|
|
|
1004
1020
|
declare module '@tiptap/core' {
|
|
1005
1021
|
interface Commands<ReturnType> {
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1022
|
+
emoji: {
|
|
1023
|
+
setEmoji: (emoji: {
|
|
1024
|
+
name: string;
|
|
1025
|
+
emoji: string;
|
|
1026
|
+
}) => ReturnType;
|
|
1009
1027
|
};
|
|
1010
1028
|
}
|
|
1011
1029
|
}
|
|
@@ -1013,8 +1031,9 @@ declare module '@tiptap/core' {
|
|
|
1013
1031
|
|
|
1014
1032
|
declare module '@tiptap/core' {
|
|
1015
1033
|
interface Commands<ReturnType> {
|
|
1016
|
-
|
|
1017
|
-
|
|
1034
|
+
tableCellBackground: {
|
|
1035
|
+
setTableCellBackground: (color: string) => ReturnType;
|
|
1036
|
+
unsetTableCellBackground: () => ReturnType;
|
|
1018
1037
|
};
|
|
1019
1038
|
}
|
|
1020
1039
|
}
|
|
@@ -1022,8 +1041,8 @@ declare module '@tiptap/core' {
|
|
|
1022
1041
|
|
|
1023
1042
|
declare module '@tiptap/core' {
|
|
1024
1043
|
interface Commands<ReturnType> {
|
|
1025
|
-
|
|
1026
|
-
|
|
1044
|
+
katex: {
|
|
1045
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
1027
1046
|
};
|
|
1028
1047
|
}
|
|
1029
1048
|
}
|
|
@@ -1031,14 +1050,9 @@ declare module '@tiptap/core' {
|
|
|
1031
1050
|
|
|
1032
1051
|
declare module '@tiptap/core' {
|
|
1033
1052
|
interface Commands<ReturnType> {
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
replace: () => ReturnType;
|
|
1038
|
-
replaceAll: () => ReturnType;
|
|
1039
|
-
goToPrevSearchResult: () => void;
|
|
1040
|
-
goToNextSearchResult: () => void;
|
|
1041
|
-
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
1053
|
+
tableOfContents: {
|
|
1054
|
+
setTableOfContents: () => ReturnType;
|
|
1055
|
+
removeTableOfContents: () => ReturnType;
|
|
1042
1056
|
};
|
|
1043
1057
|
}
|
|
1044
1058
|
}
|
|
@@ -1046,13 +1060,8 @@ declare module '@tiptap/core' {
|
|
|
1046
1060
|
|
|
1047
1061
|
declare module '@tiptap/core' {
|
|
1048
1062
|
interface Commands<ReturnType> {
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
cols: number;
|
|
1052
|
-
}) => ReturnType;
|
|
1053
|
-
addColBefore: () => ReturnType;
|
|
1054
|
-
addColAfter: () => ReturnType;
|
|
1055
|
-
deleteCol: () => ReturnType;
|
|
1063
|
+
exportWord: {
|
|
1064
|
+
exportToWord: () => ReturnType;
|
|
1056
1065
|
};
|
|
1057
1066
|
}
|
|
1058
1067
|
}
|
|
@@ -1060,8 +1069,23 @@ declare module '@tiptap/core' {
|
|
|
1060
1069
|
|
|
1061
1070
|
declare module '@tiptap/core' {
|
|
1062
1071
|
interface Commands<ReturnType> {
|
|
1063
|
-
|
|
1064
|
-
|
|
1072
|
+
attachment: {
|
|
1073
|
+
setAttachment: (attrs?: unknown) => ReturnType;
|
|
1074
|
+
};
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
|
|
1079
|
+
declare module '@tiptap/core' {
|
|
1080
|
+
interface Commands<ReturnType> {
|
|
1081
|
+
twitter: {
|
|
1082
|
+
/**
|
|
1083
|
+
* Insert a tweet
|
|
1084
|
+
* @param options The tweet attributes
|
|
1085
|
+
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
1086
|
+
*/
|
|
1087
|
+
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
1088
|
+
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
1065
1089
|
};
|
|
1066
1090
|
}
|
|
1067
1091
|
}
|
|
@@ -1079,8 +1103,9 @@ declare module '@tiptap/core' {
|
|
|
1079
1103
|
|
|
1080
1104
|
declare module '@tiptap/core' {
|
|
1081
1105
|
interface Commands<ReturnType> {
|
|
1082
|
-
|
|
1083
|
-
|
|
1106
|
+
drawer: {
|
|
1107
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
1108
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
1084
1109
|
};
|
|
1085
1110
|
}
|
|
1086
1111
|
}
|
|
@@ -1104,28 +1129,3 @@ declare module '@tiptap/core' {
|
|
|
1104
1129
|
};
|
|
1105
1130
|
}
|
|
1106
1131
|
}
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
declare module '@tiptap/core' {
|
|
1110
|
-
interface Commands<ReturnType> {
|
|
1111
|
-
twitter: {
|
|
1112
|
-
/**
|
|
1113
|
-
* Insert a tweet
|
|
1114
|
-
* @param options The tweet attributes
|
|
1115
|
-
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
1116
|
-
*/
|
|
1117
|
-
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
1118
|
-
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
1119
|
-
};
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
declare module '@tiptap/core' {
|
|
1125
|
-
interface Commands<ReturnType> {
|
|
1126
|
-
drawer: {
|
|
1127
|
-
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
1128
|
-
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
1129
|
-
};
|
|
1130
|
-
}
|
|
1131
|
-
}
|