reactjs-tiptap-editor-pro 0.2.28 → 0.2.29

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.
@@ -2,26 +2,26 @@ import { a as ft, I as gt, U as bt, S as pt, C as wt, f as oe, N as se, b as yt,
2
2
  import { P as te, b as Z, $ as re, a0 as le, al as P, am as Gt, T as Xe, A as Zt, an as Jt, ao as Yt } from "./vendor-Cpa6z-M0.js";
3
3
  import { jsxs as m, jsx as s, Fragment as pe } from "react/jsx-runtime";
4
4
  import * as J from "react";
5
- import Qt, { useMemo as R, useState as C, useRef as G, useCallback as F, Fragment as Ee, forwardRef as He, useImperativeHandle as ze, useEffect as z } from "react";
5
+ import Qt, { useMemo as R, useState as C, useRef as U, useCallback as F, Fragment as Ee, forwardRef as He, useImperativeHandle as ze, useEffect as z } from "react";
6
6
  import { ChevronDown as Me, Check as Xt, ChevronUp as en, Copy as tn, CopyCheck as nn, SearchIcon as an, LoaderIcon as on, LucideTableProperties as sn, LucideSheet as rn, LucideImage as ln, LucideFile as cn, LucideVideo as dn, LucideAudioLines as un } from "lucide-react";
7
- import { i as Pe, T as we, a as ye, B as V, b as ke, g as Re, A as p, D as Y, c as Q, d as X, e as mn, f as T, u as Ie, h as hn, I as M, j as ne, k as et, l as Ae, m as _n, n as je, P as ce, o as de, p as ue, q as Be, C as fn, H as gn, L as bn, r as pn, M as wn, s as yn, t as Fe, v as he, w as K, E as D, x as kn, y as vn, V as xn, z as Ue, F as ve, G as qe, S as Cn, J as Nn, K as An, N as B, O as Ln, Q as Sn, U as Tn, W as En, X as Hn, Y as tt } from "./RichTextEditor-BC85Dn21.js";
8
- import { a4 as Ao, a0 as Lo, _ as So, a1 as To, $ as Eo, a2 as Ho, Z as zo, a3 as Mo } from "./RichTextEditor-BC85Dn21.js";
7
+ import { i as Pe, T as we, a as ye, B as W, b as ke, g as Re, A as p, D as Y, c as Q, d as X, e as mn, f as T, u as Ie, h as hn, I as M, j as ne, k as et, l as Ae, m as _n, n as je, P as ce, o as de, p as ue, q as Be, C as fn, H as gn, L as bn, r as pn, M as wn, s as yn, t as Fe, v as he, w as V, E as D, x as kn, y as vn, V as xn, z as Ue, F as ve, G as qe, S as Cn, J as Nn, K as An, N as B, O as Ln, Q as Sn, U as Tn, W as En, X as Hn, Y as tt } from "./RichTextEditor-iGJ6-rbq.js";
8
+ import { a4 as Ao, a0 as Lo, _ as So, a1 as To, $ as Eo, a2 as Ho, Z as zo, a3 as Mo } from "./RichTextEditor-iGJ6-rbq.js";
9
9
  import { M as zn, D as nt, u as j, f as Mn, g as Pn, h as Ke, i as N, j as at, k as Rn } from "./index-M6H3FoBi.js";
10
10
  import { bundledThemes as it, bundledLanguages as ot, createHighlighter as In } from "shiki";
11
11
  import * as x from "@radix-ui/react-select";
12
12
  import { Slot as jn } from "@radix-ui/react-slot";
13
13
  import De from "tippy.js";
14
14
  import Oe from "scroll-into-view-if-needed";
15
- import { EmojiPicker as W } from "frimousse";
15
+ import { EmojiPicker as G } from "frimousse";
16
16
  import { Packer as Bn, WidthType as Dn } from "docx";
17
- import { DocxSerializer as On, defaultNodes as U, defaultMarks as $n } from "prosemirror-docx";
17
+ import { DocxSerializer as On, defaultNodes as q, defaultMarks as $n } from "prosemirror-docx";
18
18
  const $e = Qt.forwardRef(
19
19
  ({ asChild: e, ...t }, n) => {
20
20
  var o;
21
21
  const a = Pe[t.icon];
22
22
  return /* @__PURE__ */ m(we, { children: [
23
23
  /* @__PURE__ */ s(ye, { asChild: !0, children: /* @__PURE__ */ s(
24
- e ? jn : V,
24
+ e ? jn : W,
25
25
  {
26
26
  className: "h-[32px] min-w-24 overflow-hidden px-[5px] py-0",
27
27
  disabled: t == null ? void 0 : t.disabled,
@@ -431,7 +431,7 @@ function sa({ editor: e, node: { attrs: t }, updateAttributes: n, extension: a }
431
431
  const { isCopied: i, copyToClipboard: o } = Yn(), r = R(() => {
432
432
  var w;
433
433
  return (w = a.options.languages) != null && w.length ? a.options.languages : nt;
434
- }, [a.options.languages]), l = Ie(), u = (f = (_ = e == null ? void 0 : e.options) == null ? void 0 : _.editorProps) == null ? void 0 : f.print, { language: d } = t, c = G(null), h = F(() => hn(ra.name, e), [e]);
434
+ }, [a.options.languages]), l = Ie(), u = (f = (_ = e == null ? void 0 : e.options) == null ? void 0 : _.editorProps) == null ? void 0 : f.print, { language: d } = t, c = U(null), h = F(() => hn(ra.name, e), [e]);
435
435
  return /* @__PURE__ */ m(se, { className: P($.wrap, !u && $.maxHeight, "render-wrapper"), children: [
436
436
  /* @__PURE__ */ m(
437
437
  "div",
@@ -831,40 +831,40 @@ const Ji = Ct.extend({
831
831
  }
832
832
  });
833
833
  function ua(e) {
834
- var a;
835
- const { t } = j(), n = R(() => {
836
- const i = (e.items || []).find((r) => r.isActive());
837
- return i || {
834
+ var i;
835
+ const { t } = j(), n = U(null), a = R(() => {
836
+ const o = (e.items || []).find((l) => l.isActive());
837
+ return o || {
838
838
  title: t("editor.fontSize.default.tooltip"),
839
839
  isActive: () => !1
840
840
  };
841
841
  }, [e]);
842
842
  return /* @__PURE__ */ m(Y, { children: [
843
- /* @__PURE__ */ s(
844
- Q,
843
+ /* @__PURE__ */ s(Q, { asChild: !0, disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ s("div", { ref: n, children: /* @__PURE__ */ s(
844
+ $e,
845
845
  {
846
- asChild: !0,
847
846
  disabled: e == null ? void 0 : e.disabled,
848
- children: /* @__PURE__ */ s(
849
- $e,
850
- {
851
- disabled: e == null ? void 0 : e.disabled,
852
- icon: "MenuDown",
853
- title: n == null ? void 0 : n.title,
854
- tooltip: `${e == null ? void 0 : e.tooltip}`
855
- }
856
- )
847
+ icon: "MenuDown",
848
+ title: a == null ? void 0 : a.title,
849
+ tooltip: `${e == null ? void 0 : e.tooltip}`
857
850
  }
858
- ),
859
- /* @__PURE__ */ s(X, { className: "max-h-96 w-32 overflow-y-auto", children: (a = e == null ? void 0 : e.items) == null ? void 0 : a.map((i, o) => /* @__PURE__ */ s(
860
- ne,
851
+ ) }) }),
852
+ /* @__PURE__ */ s(
853
+ X,
861
854
  {
862
- checked: n.title === i.title,
863
- onClick: i.action,
864
- children: /* @__PURE__ */ s("div", { className: "ml-1 h-full", children: i.title })
865
- },
866
- `font-size-${o}`
867
- )) })
855
+ container: n.current,
856
+ className: "max-h-[40vh] w-32 overflow-y-auto",
857
+ children: (i = e == null ? void 0 : e.items) == null ? void 0 : i.map((o, r) => /* @__PURE__ */ s(
858
+ ne,
859
+ {
860
+ checked: a.title === o.title,
861
+ onClick: o.action,
862
+ children: /* @__PURE__ */ s("div", { className: "ml-1 h-full", children: o.title })
863
+ },
864
+ `font-size-${r}`
865
+ ))
866
+ }
867
+ )
868
868
  ] });
869
869
  }
870
870
  const Yi = A.create({
@@ -998,7 +998,7 @@ function ha(e) {
998
998
  disabled: e == null ? void 0 : e.disabled,
999
999
  colors: e == null ? void 0 : e.colors,
1000
1000
  defaultColor: e == null ? void 0 : e.defaultColor,
1001
- children: /* @__PURE__ */ s(V, { variant: "ghost", size: "icon", className: "r!ichtext-h-[32px] !w-3", disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ s(M, { className: "!w-3 !h-3 text-zinc-500", name: "MenuDown" }) })
1001
+ children: /* @__PURE__ */ s(W, { variant: "ghost", size: "icon", className: "r!ichtext-h-[32px] !w-3", disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ s(M, { className: "!w-3 !h-3 text-zinc-500", name: "MenuDown" }) })
1002
1002
  }
1003
1003
  )
1004
1004
  ] });
@@ -1440,7 +1440,7 @@ function wa(e) {
1440
1440
  }, [n]);
1441
1441
  return /* @__PURE__ */ m(Y, { children: [
1442
1442
  /* @__PURE__ */ s(Q, { asChild: !0, children: /* @__PURE__ */ m(
1443
- V,
1443
+ W,
1444
1444
  {
1445
1445
  className: "flex h-[32px] gap-1 px-1.5",
1446
1446
  variant: "ghost",
@@ -1883,7 +1883,7 @@ const _o = A.create({
1883
1883
  });
1884
1884
  function Sa(e, t) {
1885
1885
  var L, E;
1886
- const [n, a] = C(0), [i, o] = C(0), r = G(null), { t: l } = j(), u = G([]);
1886
+ const [n, a] = C(0), [i, o] = C(0), r = U(null), { t: l } = j(), u = U([]);
1887
1887
  ze(t, () => ({
1888
1888
  onKeyDown: d
1889
1889
  })), z(() => {
@@ -1969,7 +1969,7 @@ function Sa(e, t) {
1969
1969
  }
1970
1970
  const Ta = He(Sa), Ea = {
1971
1971
  setOpen: (e, t) => {
1972
- K(D.UPLOAD_VIDEO(e), t);
1972
+ V(D.UPLOAD_VIDEO(e), t);
1973
1973
  }
1974
1974
  };
1975
1975
  function Ha(e, t) {
@@ -2089,10 +2089,10 @@ function Ha(e, t) {
2089
2089
  }), t == null || t(a, n);
2090
2090
  }), n;
2091
2091
  }
2092
- const q = "slashCommand";
2092
+ const K = "slashCommand";
2093
2093
  let k;
2094
2094
  const fo = A.create({
2095
- name: q,
2095
+ name: K,
2096
2096
  priority: 200,
2097
2097
  onCreate() {
2098
2098
  k = De("body", {
@@ -2120,7 +2120,7 @@ const fo = A.create({
2120
2120
  char: "/",
2121
2121
  allowSpaces: !0,
2122
2122
  startOfLine: !0,
2123
- pluginKey: new Z(q),
2123
+ pluginKey: new Z(K),
2124
2124
  allow: ({ state: e, range: t }) => {
2125
2125
  var d, c, h;
2126
2126
  const n = e.doc.resolve(t.from), a = n.depth === 1, i = n.parent.type.name === "paragraph", o = ((d = n.parent.textContent) == null ? void 0 : d.charAt(0)) === "/", r = this.editor.isActive("column"), l = (h = n.parent.textContent) == null ? void 0 : h.slice(
@@ -2162,10 +2162,10 @@ const fo = A.create({
2162
2162
  });
2163
2163
  const { view: a } = n.editor, i = () => {
2164
2164
  if (!n.clientRect)
2165
- return n.editor.storage[q].rect;
2165
+ return n.editor.storage[K].rect;
2166
2166
  const r = n.clientRect();
2167
2167
  if (!r)
2168
- return n.editor.storage[q].rect;
2168
+ return n.editor.storage[K].rect;
2169
2169
  let l = r.y;
2170
2170
  if (r.top + e.element.offsetHeight + 40 > window.innerHeight) {
2171
2171
  const u = r.top + e.element.offsetHeight - window.innerHeight + 40;
@@ -2188,15 +2188,15 @@ const fo = A.create({
2188
2188
  e.updateProps(n);
2189
2189
  const { view: a } = n.editor, i = () => {
2190
2190
  if (!n.clientRect)
2191
- return n.editor.storage[q].rect;
2191
+ return n.editor.storage[K].rect;
2192
2192
  const l = n.clientRect();
2193
- return l ? new DOMRect(l.x, l.y, l.width, l.height) : n.editor.storage[q].rect;
2193
+ return l ? new DOMRect(l.x, l.y, l.width, l.height) : n.editor.storage[K].rect;
2194
2194
  }, o = () => {
2195
2195
  k == null || k[0].setProps({
2196
2196
  getReferenceClientRect: i
2197
2197
  });
2198
2198
  };
2199
- (r = a.dom.parentElement) == null || r.addEventListener("scroll", o), n.editor.storage[q].rect = n.clientRect ? i() : {
2199
+ (r = a.dom.parentElement) == null || r.addEventListener("scroll", o), n.editor.storage[K].rect = n.clientRect ? i() : {
2200
2200
  width: 0,
2201
2201
  height: 0,
2202
2202
  left: 0,
@@ -2376,7 +2376,7 @@ function za({ editor: e, ...t }) {
2376
2376
  }
2377
2377
  ),
2378
2378
  /* @__PURE__ */ s(
2379
- V,
2379
+ W,
2380
2380
  {
2381
2381
  className: "flex-1",
2382
2382
  disabled: o.length === 0,
@@ -2385,7 +2385,7 @@ function za({ editor: e, ...t }) {
2385
2385
  }
2386
2386
  ),
2387
2387
  /* @__PURE__ */ s(
2388
- V,
2388
+ W,
2389
2389
  {
2390
2390
  className: "flex-1",
2391
2391
  disabled: o.length === 0,
@@ -2420,7 +2420,7 @@ function za({ editor: e, ...t }) {
2420
2420
  ] }),
2421
2421
  /* @__PURE__ */ m("div", { className: "flex items-center gap-[10px]", children: [
2422
2422
  /* @__PURE__ */ s(
2423
- V,
2423
+ W,
2424
2424
  {
2425
2425
  className: "flex-1",
2426
2426
  disabled: o.length === 0,
@@ -2429,7 +2429,7 @@ function za({ editor: e, ...t }) {
2429
2429
  }
2430
2430
  ),
2431
2431
  /* @__PURE__ */ s(
2432
- V,
2432
+ W,
2433
2433
  {
2434
2434
  className: "flex-1",
2435
2435
  disabled: o.length === 0,
@@ -2564,20 +2564,20 @@ const ja = A.create({
2564
2564
  },
2565
2565
  addCommands() {
2566
2566
  return {
2567
- setSearchTerm: (e) => ({ state: t, dispatch: n }) => (this.options.searchTerm = e, this.storage.results = [], this.storage.currentIndex = 0, K(D.SEARCH_REPLCE), ie(t, n), !1),
2567
+ setSearchTerm: (e) => ({ state: t, dispatch: n }) => (this.options.searchTerm = e, this.storage.results = [], this.storage.currentIndex = 0, V(D.SEARCH_REPLCE), ie(t, n), !1),
2568
2568
  setReplaceTerm: (e) => ({ state: t, dispatch: n }) => (this.options.replaceTerm = e, ie(t, n), !1),
2569
2569
  setCaseSensitive: (e) => ({ state: t, dispatch: n }) => (this.options.caseSensitive = e, ie(t, n), !1),
2570
2570
  replace: () => ({ state: e, dispatch: t }) => {
2571
2571
  const { replaceTerm: n } = this.options, { currentIndex: a, results: i } = this.storage, o = i[a];
2572
- return o ? (Ge(n, [o], { state: e, dispatch: t }), this.storage.results.splice(a, 1)) : (Ge(n, i, { state: e, dispatch: t }), this.storage.results.shift()), K(D.SEARCH_REPLCE), ie(e, t), !1;
2572
+ return o ? (Ge(n, [o], { state: e, dispatch: t }), this.storage.results.splice(a, 1)) : (Ge(n, i, { state: e, dispatch: t }), this.storage.results.shift()), V(D.SEARCH_REPLCE), ie(e, t), !1;
2573
2573
  },
2574
2574
  replaceAll: () => ({ state: e, tr: t, dispatch: n }) => {
2575
2575
  const { replaceTerm: a } = this.options, { results: i } = this.storage;
2576
- return Ia(a, i, { tr: t, dispatch: n }), this.storage.currentIndex = -1, this.storage.results = [], K(D.SEARCH_REPLCE), ie(e, n), !1;
2576
+ return Ia(a, i, { tr: t, dispatch: n }), this.storage.currentIndex = -1, this.storage.results = [], V(D.SEARCH_REPLCE), ie(e, n), !1;
2577
2577
  },
2578
2578
  goToPrevSearchResult: () => ({ view: e, tr: t }) => {
2579
2579
  const { searchResultCurrentClass: n } = this.options, { currentIndex: a, results: i } = this.storage, o = (a + i.length - 1) % i.length;
2580
- return this.storage.currentIndex = o, K(D.SEARCH_REPLCE), Ze({
2580
+ return this.storage.currentIndex = o, V(D.SEARCH_REPLCE), Ze({
2581
2581
  view: e,
2582
2582
  tr: t,
2583
2583
  searchResults: i,
@@ -2587,7 +2587,7 @@ const ja = A.create({
2587
2587
  },
2588
2588
  goToNextSearchResult: () => ({ view: e, tr: t }) => {
2589
2589
  const { searchResultCurrentClass: n } = this.options, { currentIndex: a, results: i } = this.storage, o = (a + 1) % i.length;
2590
- return this.storage.currentIndex = o, this.options.onChange && this.options.onChange(), K(D.SEARCH_REPLCE), Ze({
2590
+ return this.storage.currentIndex = o, this.options.onChange && this.options.onChange(), V(D.SEARCH_REPLCE), Ze({
2591
2591
  view: e,
2592
2592
  tr: t,
2593
2593
  searchResults: i,
@@ -2614,7 +2614,7 @@ const ja = A.create({
2614
2614
  Ma(i, l, u),
2615
2615
  o
2616
2616
  );
2617
- if (e.storage.results = c, e.storage.currentIndex > c.length - 1 && (e.storage.currentIndex = 0), K(D.SEARCH_REPLCE), t.getMeta("directDecoration")) {
2617
+ if (e.storage.results = c, e.storage.currentIndex > c.length - 1 && (e.storage.currentIndex = 0), V(D.SEARCH_REPLCE), t.getMeta("directDecoration")) {
2618
2618
  const { fromPos: h, toPos: _, attrs: f } = t.getMeta("directDecoration");
2619
2619
  d.push(le.inline(h, _, f));
2620
2620
  } else
@@ -2640,7 +2640,7 @@ function Ba({
2640
2640
  ...t
2641
2641
  }) {
2642
2642
  return /* @__PURE__ */ s(
2643
- W.Root,
2643
+ G.Root,
2644
2644
  {
2645
2645
  className: T(
2646
2646
  "bg-popover text-popover-foreground isolate flex h-full w-fit flex-col overflow-hidden rounded-md",
@@ -2663,7 +2663,7 @@ function Da({
2663
2663
  children: [
2664
2664
  /* @__PURE__ */ s(an, { className: "size-4 shrink-0 opacity-50" }),
2665
2665
  /* @__PURE__ */ s(
2666
- W.Search,
2666
+ G.Search,
2667
2667
  {
2668
2668
  className: "outline-hidden placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm disabled:cursor-not-allowed disabled:opacity-50",
2669
2669
  "data-slot": "emoji-picker-search",
@@ -2714,14 +2714,14 @@ function Ua({
2714
2714
  ...t
2715
2715
  }) {
2716
2716
  return /* @__PURE__ */ m(
2717
- W.Viewport,
2717
+ G.Viewport,
2718
2718
  {
2719
2719
  className: T("outline-hidden relative flex-1", e),
2720
2720
  "data-slot": "emoji-picker-viewport",
2721
2721
  ...t,
2722
2722
  children: [
2723
2723
  /* @__PURE__ */ s(
2724
- W.Loading,
2724
+ G.Loading,
2725
2725
  {
2726
2726
  className: "absolute inset-0 flex items-center justify-center text-muted-foreground",
2727
2727
  "data-slot": "emoji-picker-loading",
@@ -2729,7 +2729,7 @@ function Ua({
2729
2729
  }
2730
2730
  ),
2731
2731
  /* @__PURE__ */ s(
2732
- W.Empty,
2732
+ G.Empty,
2733
2733
  {
2734
2734
  className: "absolute inset-0 flex items-center justify-center text-muted-foreground text-sm",
2735
2735
  "data-slot": "emoji-picker-empty",
@@ -2737,7 +2737,7 @@ function Ua({
2737
2737
  }
2738
2738
  ),
2739
2739
  /* @__PURE__ */ s(
2740
- W.List,
2740
+ G.List,
2741
2741
  {
2742
2742
  className: "select-none pb-1",
2743
2743
  components: {
@@ -2765,7 +2765,7 @@ function qa({
2765
2765
  ),
2766
2766
  "data-slot": "emoji-picker-footer",
2767
2767
  ...t,
2768
- children: /* @__PURE__ */ s(W.ActiveEmoji, { children: ({ emoji: n }) => n ? /* @__PURE__ */ m(pe, { children: [
2768
+ children: /* @__PURE__ */ s(G.ActiveEmoji, { children: ({ emoji: n }) => n ? /* @__PURE__ */ m(pe, { children: [
2769
2769
  /* @__PURE__ */ s("div", { className: "flex size-7 flex-none items-center justify-center text-lg", children: n.emoji }),
2770
2770
  /* @__PURE__ */ s("span", { className: "text-secondary-foreground truncate text-xs", children: n.label })
2771
2771
  ] }) : /* @__PURE__ */ s("span", { className: "text-muted-foreground ml-1.5 flex h-7 items-center truncate text-xs", children: "Select an emoji…" }) })
@@ -2817,7 +2817,7 @@ function Va({ editor: e, icon: t, ...n }) {
2817
2817
  ) });
2818
2818
  }
2819
2819
  const mt = He((e, t) => {
2820
- const n = G(null), [a, i] = C(0), { t: o } = j(), r = (c) => {
2820
+ const n = U(null), [a, i] = C(0), { t: o } = j(), r = (c) => {
2821
2821
  const h = e.items[c];
2822
2822
  h && e.command(h);
2823
2823
  }, l = () => {
@@ -4861,7 +4861,7 @@ function ei(e, t) {
4861
4861
  return new File([e], t, { type: e.type });
4862
4862
  }
4863
4863
  function ti(e) {
4864
- const { toast: t } = Nn(), { t: n } = j(), [a, i] = C(!1), o = G(null);
4864
+ const { toast: t } = Nn(), { t: n } = j(), [a, i] = C(!1), o = U(null);
4865
4865
  function r() {
4866
4866
  var h;
4867
4867
  (h = o.current) == null || h.click();
@@ -4990,13 +4990,13 @@ function ai(e, t) {
4990
4990
  return console.error("Download is not supported in Node.js"), Promise.resolve();
4991
4991
  }
4992
4992
  const ii = {
4993
- ...U,
4994
- hardBreak: U.hard_break,
4995
- codeBlock: U.code_block,
4996
- orderedList: U.ordered_list,
4997
- listItem: U.list_item,
4998
- bulletList: U.bullet_list,
4999
- horizontalRule: U.horizontal_rule,
4993
+ ...q,
4994
+ hardBreak: q.hard_break,
4995
+ codeBlock: q.code_block,
4996
+ orderedList: q.ordered_list,
4997
+ listItem: q.list_item,
4998
+ bulletList: q.bullet_list,
4999
+ horizontalRule: q.horizontal_rule,
5000
5000
  // Requirement Buffer on browser
5001
5001
  image(e, t) {
5002
5002
  e.renderInline(t), e.closeBlock(t);
@@ -5359,7 +5359,7 @@ const ko = A.create({
5359
5359
  itemUser: wi,
5360
5360
  selectedUser: yi
5361
5361
  }, ki = He((e, t) => {
5362
- const n = G(null), [a, i] = C(0), o = (d) => {
5362
+ const n = U(null), [a, i] = C(0), o = (d) => {
5363
5363
  const c = e.items[d];
5364
5364
  c && e.command({ id: c, label: c });
5365
5365
  }, r = () => {
@@ -5517,7 +5517,7 @@ const Li = "_wrap_1x1ms_2", Ne = {
5517
5517
  };
5518
5518
  function Si({ editor: e, node: t, updateAttributes: n, deleteNode: a, extension: i }) {
5519
5519
  var H;
5520
- const o = G(null), r = Ie(), { hasTrigger: l, fileName: u, fileSize: d, fileExt: c, fileType: h, url: _, error: f } = t.attrs, [w, y] = C(!1), { t: L } = j(), E = (H = i == null ? void 0 : i.options) == null ? void 0 : H.upload, g = F(() => {
5520
+ const o = U(null), r = Ie(), { hasTrigger: l, fileName: u, fileSize: d, fileExt: c, fileType: h, url: _, error: f } = t.attrs, [w, y] = C(!1), { t: L } = j(), E = (H = i == null ? void 0 : i.options) == null ? void 0 : H.upload, g = F(() => {
5521
5521
  !r || _ || r && o.current.click();
5522
5522
  }, [r, _]), b = F(
5523
5523
  async (S) => {
package/lib/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react"),d=require("./RichTextEditor-Cxm0yJdr.cjs"),c=require("./tiptap-gBG-1T-V.cjs");function a(){var r;const e=t.useRef({editor:null}),[i,o]=t.useState(!1),[s,n]=t.useState(null);return t.useEffect(()=>{var u;(u=e.current)!=null&&u.editor&&(o(!0),n(e.current.editor))},[e,(r=e.current)==null?void 0:r.editor]),{isReady:i,editor:s,editorRef:e}}exports.default=d.RichTextEditor;exports.BubbleMenu=c.BubbleMenu;exports.useEditorState=a;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react"),d=require("./RichTextEditor-BwbqJLnA.cjs"),c=require("./tiptap-gBG-1T-V.cjs");function a(){var r;const e=t.useRef({editor:null}),[i,o]=t.useState(!1),[s,n]=t.useState(null);return t.useEffect(()=>{var u;(u=e.current)!=null&&u.editor&&(o(!0),n(e.current.editor))},[e,(r=e.current)==null?void 0:r.editor]),{isReady:i,editor:s,editorRef:e}}exports.default=d.RichTextEditor;exports.BubbleMenu=c.BubbleMenu;exports.useEditorState=a;
package/lib/index.d.cts CHANGED
@@ -37,6 +37,7 @@ declare interface BubbleMenuConfig {
37
37
  * custom menu actions
38
38
  */
39
39
  actions?: ActionButtonProps[];
40
+ items?: string[];
40
41
  }
41
42
 
42
43
  /**
@@ -71,6 +72,7 @@ declare interface BubbleMenuProps {
71
72
  * @default false
72
73
  */
73
74
  hidden?: boolean;
75
+ items?: string[];
74
76
  };
75
77
  imageConfig?: {
76
78
  /**
@@ -291,9 +293,24 @@ declare module '@tiptap/core' {
291
293
 
292
294
  declare module '@tiptap/core' {
293
295
  interface Commands<ReturnType> {
294
- lineHeight: {
295
- setLineHeight: (lineHeight: string) => ReturnType;
296
- unsetLineHeight: () => ReturnType;
296
+ painter: {
297
+ setPainter: (marks: Mark[]) => ReturnType;
298
+ };
299
+ }
300
+ }
301
+
302
+
303
+ declare module '@tiptap/core' {
304
+ interface Commands<ReturnType> {
305
+ indent: {
306
+ /**
307
+ * Set the indent attribute
308
+ */
309
+ indent: () => ReturnType;
310
+ /**
311
+ * Set the outdent attribute
312
+ */
313
+ outdent: () => ReturnType;
297
314
  };
298
315
  }
299
316
  }
@@ -335,20 +352,9 @@ declare module '@tiptap/core' {
335
352
 
336
353
  declare module '@tiptap/core' {
337
354
  interface Commands<ReturnType> {
338
- painter: {
339
- setPainter: (marks: Mark[]) => ReturnType;
340
- };
341
- }
342
- }
343
-
344
-
345
- declare module '@tiptap/core' {
346
- interface Commands<ReturnType> {
347
- emoji: {
348
- setEmoji: (emoji: {
349
- name: string;
350
- emoji: string;
351
- }) => ReturnType;
355
+ lineHeight: {
356
+ setLineHeight: (lineHeight: string) => ReturnType;
357
+ unsetLineHeight: () => ReturnType;
352
358
  };
353
359
  }
354
360
  }
@@ -364,22 +370,6 @@ declare module '@tiptap/core' {
364
370
  }
365
371
 
366
372
 
367
- declare module '@tiptap/core' {
368
- interface Commands<ReturnType> {
369
- indent: {
370
- /**
371
- * Set the indent attribute
372
- */
373
- indent: () => ReturnType;
374
- /**
375
- * Set the outdent attribute
376
- */
377
- outdent: () => ReturnType;
378
- };
379
- }
380
- }
381
-
382
-
383
373
  declare module '@tiptap/core' {
384
374
  interface Commands<ReturnType> {
385
375
  iframe: {
@@ -412,8 +402,9 @@ declare module '@tiptap/core' {
412
402
 
413
403
  declare module '@tiptap/core' {
414
404
  interface Commands<ReturnType> {
415
- exportWord: {
416
- exportToWord: () => ReturnType;
405
+ tableOfContents: {
406
+ setTableOfContents: () => ReturnType;
407
+ removeTableOfContents: () => ReturnType;
417
408
  };
418
409
  }
419
410
  }
@@ -421,8 +412,11 @@ declare module '@tiptap/core' {
421
412
 
422
413
  declare module '@tiptap/core' {
423
414
  interface Commands<ReturnType> {
424
- excalidraw: {
425
- setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
415
+ emoji: {
416
+ setEmoji: (emoji: {
417
+ name: string;
418
+ emoji: string;
419
+ }) => ReturnType;
426
420
  };
427
421
  }
428
422
  }
@@ -430,9 +424,8 @@ declare module '@tiptap/core' {
430
424
 
431
425
  declare module '@tiptap/core' {
432
426
  interface Commands<ReturnType> {
433
- tableOfContents: {
434
- setTableOfContents: () => ReturnType;
435
- removeTableOfContents: () => ReturnType;
427
+ exportWord: {
428
+ exportToWord: () => ReturnType;
436
429
  };
437
430
  }
438
431
  }
@@ -440,8 +433,8 @@ declare module '@tiptap/core' {
440
433
 
441
434
  declare module '@tiptap/core' {
442
435
  interface Commands<ReturnType> {
443
- katex: {
444
- setKatex: (arg?: IKatexAttrs) => ReturnType;
436
+ excalidraw: {
437
+ setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
445
438
  };
446
439
  }
447
440
  }
@@ -449,19 +442,8 @@ declare module '@tiptap/core' {
449
442
 
450
443
  declare module '@tiptap/core' {
451
444
  interface Commands<ReturnType> {
452
- imageGifUpload: {
453
- /**
454
- * Add an image gif
455
- */
456
- setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
457
- /**
458
- * Update an image gif
459
- */
460
- updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
461
- /**
462
- * Set image alignment
463
- */
464
- setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
445
+ katex: {
446
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
465
447
  };
466
448
  }
467
449
  }
@@ -486,6 +468,16 @@ declare module '@tiptap/core' {
486
468
  }
487
469
 
488
470
 
471
+ declare module '@tiptap/core' {
472
+ interface Commands<ReturnType> {
473
+ drawer: {
474
+ setDrawer: (options: any, replace?: any) => ReturnType;
475
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
476
+ };
477
+ }
478
+ }
479
+
480
+
489
481
  declare module '@tiptap/core' {
490
482
  interface Commands<ReturnType> {
491
483
  twitter: {
@@ -503,9 +495,19 @@ declare module '@tiptap/core' {
503
495
 
504
496
  declare module '@tiptap/core' {
505
497
  interface Commands<ReturnType> {
506
- drawer: {
507
- setDrawer: (options: any, replace?: any) => ReturnType;
508
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
498
+ imageGifUpload: {
499
+ /**
500
+ * Add an image gif
501
+ */
502
+ setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
503
+ /**
504
+ * Update an image gif
505
+ */
506
+ updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
507
+ /**
508
+ * Set image alignment
509
+ */
510
+ setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
509
511
  };
510
512
  }
511
513
  }