reactjs-tiptap-editor 0.1.1 → 0.1.3
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/index.d.cts +67 -50
- package/lib/index.d.ts +67 -50
- package/lib/{locales-CkhqbcAn.cjs → locales-B-SPhNOP.cjs} +1 -1
- package/lib/{locales-DuFGEqOz.js → locales-wpNI1Q-s.js} +1 -1
- package/lib/reactjs-tiptap-editor.cjs +1 -1
- package/lib/reactjs-tiptap-editor.js +67 -55
- package/lib/{tiptap-BJGfDJRT.js → tiptap-CNfb0vua.js} +5 -5
- package/lib/{utils-M9grDwY0.js → utils-B9ynNSHY.js} +10 -9
- package/lib/{utils-D_RkV34t.cjs → utils-CQJAsbzc.cjs} +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./utils-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./utils-CQJAsbzc.cjs"),o=require("./locales-B-SPhNOP.cjs"),i=require("react"),s=require("./tiptap-Dge4kUnh.cjs");function c(){var r;const t=i.useRef({editor:null}),[l,a]=i.useState(!1),[d,u]=i.useState(null);return i.useEffect(()=>{var n;(n=t.current)!=null&&n.editor&&(a(!0),u(t.current.editor))},[t,(r=t.current)==null?void 0:r.editor]),{isReady:l,editor:d,editorRef:t}}exports.Attachment=e.Attachment;exports.BaseKit=e.BaseKit;exports.Blockquote=e.Blockquote;exports.Bold=e.Bold;exports.BulletList=e.BulletList;exports.Clear=e.Clear;exports.Code=e.Code;exports.CodeBlock=e.CodeBlock;exports.Color=e.Color;exports.Column=e.Column;exports.ColumnActionButton=e.ColumnActionButton;exports.Emoji=e.Emoji;exports.Excalidraw=e.Excalidraw;exports.ExportPdf=e.ExportPdf;exports.ExportWord=e.ExportWord;exports.FontFamily=e.FontFamily;exports.FontSize=e.FontSize;exports.FormatPainter=e.FormatPainter;exports.Heading=e.Heading;exports.Highlight=e.Highlight;exports.History=e.History;exports.HorizontalRule=e.HorizontalRule;exports.Iframe=e.Iframe;exports.Image=e.Image;exports.ImageGif=e.ImageGif;exports.ImportWord=e.ImportWord;exports.Indent=e.Indent;exports.Italic=e.Italic;exports.Katex=e.Katex;exports.LineHeight=e.LineHeight;exports.Link=e.Link;exports.Mention=e.Mention;exports.Mermaid=e.Mermaid;exports.MoreMark=e.MoreMark;exports.MultiColumn=e.MultiColumn;exports.OrderedList=e.OrderedList;exports.SearchAndReplace=e.SearchAndReplace;exports.SlashCommand=e.SlashCommand;exports.Strike=e.Strike;exports.SubAndSuperScript=e.SubAndSuperScript;exports.Table=e.Table;exports.TableOfContents=e.TableOfContents;exports.TaskList=e.TaskList;exports.TextAlign=e.TextAlign;exports.TextDirection=e.TextDirection;exports.Underline=e.Underline;exports.Video=e.Video;exports.default=e.RichTextEditor;exports.en=o.en;exports.locale=o.locale;exports.pt_BR=o.pt_BR;exports.vi=o.vi;exports.zh_CN=o.zh_CN;exports.BubbleMenu=s.BubbleMenu;exports.useEditorState=c;
|
|
@@ -1,57 +1,69 @@
|
|
|
1
|
-
import { P as
|
|
2
|
-
import { m as
|
|
1
|
+
import { P as p, k as x, h as C, B, e as S, f as g, C as h, a as k, c as E, t as I, v as R, E as M, G as b, y as A, A as H, F as L, b as T, s as y, H as z, d as F, j as v, i as K, w as O, q as P, Q as W, z as j, n as q, I as w, K as D, o as G, L as N, N as U, W as V, M as _, u as J, O as Q, x as X, p as Y, S as Z, l as $, r as aa, D as sa, g as ea, T as ta, J as oa, U as ra, V as ia, R as na } from "./utils-B9ynNSHY.js";
|
|
2
|
+
import { m as da, k as ua, p as ca, v as ma, z as fa } from "./locales-wpNI1Q-s.js";
|
|
3
|
+
import { useRef as l, useState as t, useEffect as d } from "react";
|
|
4
|
+
import { B as xa } from "./tiptap-CNfb0vua.js";
|
|
5
|
+
function c() {
|
|
6
|
+
var s;
|
|
7
|
+
const a = l({ editor: null }), [o, r] = t(!1), [i, n] = t(null);
|
|
8
|
+
return d(() => {
|
|
9
|
+
var e;
|
|
10
|
+
(e = a.current) != null && e.editor && (r(!0), n(a.current.editor));
|
|
11
|
+
}, [a, (s = a.current) == null ? void 0 : s.editor]), { isReady: o, editor: i, editorRef: a };
|
|
12
|
+
}
|
|
3
13
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
14
|
+
p as Attachment,
|
|
15
|
+
x as BaseKit,
|
|
16
|
+
C as Blockquote,
|
|
17
|
+
B as Bold,
|
|
18
|
+
xa as BubbleMenu,
|
|
19
|
+
S as BulletList,
|
|
20
|
+
g as Clear,
|
|
21
|
+
h as Code,
|
|
22
|
+
k as CodeBlock,
|
|
23
|
+
E as Color,
|
|
24
|
+
I as Column,
|
|
25
|
+
R as ColumnActionButton,
|
|
26
|
+
M as Emoji,
|
|
27
|
+
b as Excalidraw,
|
|
28
|
+
A as ExportPdf,
|
|
29
|
+
H as ExportWord,
|
|
30
|
+
L as FontFamily,
|
|
31
|
+
T as FontSize,
|
|
32
|
+
y as FormatPainter,
|
|
33
|
+
z as Heading,
|
|
34
|
+
F as Highlight,
|
|
35
|
+
v as History,
|
|
36
|
+
K as HorizontalRule,
|
|
37
|
+
O as Iframe,
|
|
38
|
+
P as Image,
|
|
39
|
+
W as ImageGif,
|
|
40
|
+
j as ImportWord,
|
|
41
|
+
q as Indent,
|
|
42
|
+
w as Italic,
|
|
43
|
+
D as Katex,
|
|
44
|
+
G as LineHeight,
|
|
45
|
+
N as Link,
|
|
46
|
+
U as Mention,
|
|
47
|
+
V as Mermaid,
|
|
48
|
+
_ as MoreMark,
|
|
49
|
+
J as MultiColumn,
|
|
50
|
+
Q as OrderedList,
|
|
51
|
+
X as SearchAndReplace,
|
|
52
|
+
Y as SlashCommand,
|
|
53
|
+
Z as Strike,
|
|
54
|
+
$ as SubAndSuperScript,
|
|
55
|
+
aa as Table,
|
|
56
|
+
sa as TableOfContents,
|
|
57
|
+
ea as TaskList,
|
|
58
|
+
ta as TextAlign,
|
|
59
|
+
oa as TextDirection,
|
|
60
|
+
ra as Underline,
|
|
61
|
+
ia as Video,
|
|
62
|
+
na as default,
|
|
63
|
+
da as en,
|
|
64
|
+
ua as locale,
|
|
65
|
+
ca as pt_BR,
|
|
66
|
+
c as useEditorState,
|
|
67
|
+
ma as vi,
|
|
68
|
+
fa as zh_CN
|
|
57
69
|
};
|
|
@@ -3,7 +3,7 @@ var nn = (e, t, n) => t in e ? en(e, t, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var st = (e, t, n) => nn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import Le from "tippy.js";
|
|
5
5
|
import { P as H, a as _, N as tt, S as W, f as rn, c as Wt, T as sn, l as on, b as an, d as I, e as ln, g as cn, j as dn, h as un, i as pn, k as hn, m as Re, n as fn, o as mn, p as gn, q as yn, r as vn, s as bn, t as Mn, u as Sn, v as kn, w as wn, x as En, y as ne, z as Tn, A as dt, F as ut, B as Cn, C as xn, D as An, E as On, G as Ln, H as Rn, I as Pe, J as xt, R as Pn, K as Hn, L as _n, M as $n, O as In, Q as Dn, U as Nn, V as re, W as He, X as Bn, Y as jn, Z as Fn, _ as zn, $ as Wn, a0 as Vn, a1 as ht, a2 as Vt, a3 as Kn, a4 as qn, a5 as Un, a6 as Gn, a7 as Jn, a8 as Yn, a9 as Xn, aa as Qn, ab as se, ac as oe, ad as ie, ae as Zn, af as tr, ag as ae, ah as er, ai as _e, aj as nr, ak as rr } from "./vendor-BeapTPDe.js";
|
|
6
|
-
import L, { forwardRef as sr,
|
|
6
|
+
import L, { forwardRef as sr, createContext as $e, useState as Kt, useEffect as qt, useRef as or, useDebugValue as Ie, useContext as De } from "react";
|
|
7
7
|
import ir, { flushSync as ar } from "react-dom";
|
|
8
8
|
function yt(e) {
|
|
9
9
|
const { state: t, transaction: n } = e;
|
|
@@ -3389,7 +3389,7 @@ class wo {
|
|
|
3389
3389
|
function Eo(e) {
|
|
3390
3390
|
var t;
|
|
3391
3391
|
const [n] = Kt(() => new wo(e.editor)), r = ko.useSyncExternalStoreWithSelector(n.subscribe, n.getSnapshot, n.getServerSnapshot, e.selector, (t = e.equalityFn) !== null && t !== void 0 ? t : bo);
|
|
3392
|
-
return qt(() => n.watch(e.editor), [e.editor, n]),
|
|
3392
|
+
return qt(() => n.watch(e.editor), [e.editor, n]), Ie(r), r;
|
|
3393
3393
|
}
|
|
3394
3394
|
const ve = process.env.NODE_ENV !== "production", zt = typeof window > "u", To = zt || !!(typeof window < "u" && window.next);
|
|
3395
3395
|
class Co {
|
|
@@ -3527,12 +3527,12 @@ function Si(e = {}, t = []) {
|
|
|
3527
3527
|
const n = or(e);
|
|
3528
3528
|
n.current = e;
|
|
3529
3529
|
const [r] = Kt(() => new Co(n)), s = Tt.useSyncExternalStore(r.subscribe, r.getEditor, r.getServerSnapshot);
|
|
3530
|
-
return
|
|
3530
|
+
return Ie(s), qt(r.onRender(t)), Eo({
|
|
3531
3531
|
editor: s,
|
|
3532
3532
|
selector: ({ transactionNumber: o }) => e.shouldRerenderOnTransaction === !1 ? null : e.immediatelyRender && o === 0 ? 0 : o + 1
|
|
3533
3533
|
}), s;
|
|
3534
3534
|
}
|
|
3535
|
-
const Ye =
|
|
3535
|
+
const Ye = $e({
|
|
3536
3536
|
editor: null
|
|
3537
3537
|
});
|
|
3538
3538
|
Ye.Consumer;
|
|
@@ -3559,7 +3559,7 @@ const xo = () => De(Ye), ki = (e) => {
|
|
|
3559
3559
|
u.unregisterPlugin(o);
|
|
3560
3560
|
};
|
|
3561
3561
|
}, [e.editor, r, t]), L.createElement("div", { ref: n, className: e.className, style: { visibility: "hidden" } }, e.children);
|
|
3562
|
-
}, Xe =
|
|
3562
|
+
}, Xe = $e({
|
|
3563
3563
|
onDragStart: void 0
|
|
3564
3564
|
}), Qe = () => De(Xe), wi = (e) => {
|
|
3565
3565
|
const t = e.as || "div", { nodeViewContentRef: n } = Qe();
|
|
@@ -6,10 +6,10 @@ import * as D from "react";
|
|
|
6
6
|
import je, { useState as p, useRef as Y, useEffect as E, useCallback as L, useMemo as B, Fragment as ct, forwardRef as At, useImperativeHandle as Lt } from "react";
|
|
7
7
|
import "@radix-ui/react-toast";
|
|
8
8
|
import { ChevronRight as Xn, Check as ni, Circle as Yn, ChevronDown as St, ChevronUp as Yi, HelpCircle as Qi, Pencil as en, Trash2 as tn, X as Qn, Plus as nn, Bold as er, LoaderCircle as tr, Italic as ir, Underline as nr, Quote as rr, Strikethrough as ar, Minus as or, Eraser as cr, PaintRoller as sr, Redo2 as lr, Undo2 as dr, Subscript as hr, Superscript as ur, Code as mr, CodeXml as fr, Type as gr, IndentIncrease as xr, IndentDecrease as br, List as pr, ListOrdered as wr, ListTodo as _r, Link as vr, ImageUp as yr, Video as kr, Maximize as Cr, Minimize as Nr, Table as Tr, Sparkles as Ar, Unlink as Lr, BetweenHorizonalEnd as Sr, BetweenHorizonalStart as Mr, BetweenVerticalStart as Ir, BetweenVerticalEnd as zr, TableCellsMerge as Hr, TableCellsSplit as Er, Trash as Rr, Replace as Ti, ChevronsUpDown as Or, Heading1 as Pr, Heading2 as Br, Heading3 as $r, Heading4 as Dr, Heading5 as jr, Heading6 as Fr, Columns2 as Ai, Columns3 as Vr, Columns4 as Ur, GripVertical as Wr, Copy as rn, Clipboard as qr, PanelLeft as Kr, PanelRight as Gr, Frame as Zr, SmilePlus as Jr, SmilePlusIcon as Xr, Sigma as Yr, BookMarked as Qr, ZoomIn as ea, ZoomOut as ta, Settings as ia, Eye as na, Paperclip as ra, CropIcon as aa, CopyCheck as oa, Clock3 as ca, Laugh as sa, LucideTableProperties as la, LucideSheet as da, LucideImage as ha, LucideFile as ua, LucideVideo as ma, LucideAudioLines as fa } from "lucide-react";
|
|
9
|
-
import { B as le, N as ce, a as fe, m as re, R as ge, n as ri, u as ga, E as xa, i as ba, D as pa, d as wa, b as _a, c as va, I as ya, U as ka, S as Ca, C as Na, f as it, e as Ta, g as Aa, F as La, H as Sa, T as Ma, h as X, j as Ia, k as za, l as Ha, O as Ea, o as Ra, p as Oa, q as Pa, L as Ba, r as $a, s as Da, t as ja, v as Fa, w as kt, P as Va, x as Ua, y as Wa, G as qa, z as Ka, A as Ga, J as Za, K as Ja, M as Xa, Q as Ya, V as an, W as on, X as cn, Y as ai, Z as oi, _ as Qa, $ as eo, a0 as to, a1 as io, a2 as no, a3 as Li } from "./tiptap-
|
|
9
|
+
import { B as le, N as ce, a as fe, m as re, R as ge, n as ri, u as ga, E as xa, i as ba, D as pa, d as wa, b as _a, c as va, I as ya, U as ka, S as Ca, C as Na, f as it, e as Ta, g as Aa, F as La, H as Sa, T as Ma, h as X, j as Ia, k as za, l as Ha, O as Ea, o as Ra, p as Oa, q as Pa, L as Ba, r as $a, s as Da, t as ja, v as Fa, w as kt, P as Va, x as Ua, y as Wa, G as qa, z as Ka, A as Ga, J as Za, K as Ja, M as Xa, Q as Ya, V as an, W as on, X as cn, Y as ai, Z as oi, _ as Qa, $ as eo, a0 as to, a1 as io, a2 as no, a3 as Li } from "./tiptap-CNfb0vua.js";
|
|
10
10
|
import { al as ro, am as ee, an as ci, ao as si, ap as ao, aq as sn, ar as oo, as as Te, e as Mt, d as Ae, at as ln, au as li, av as co, P as Ge, a as Le, a1 as nt, a2 as rt, aw as so, ax as Ct, ay as dn, ai as lo } from "./vendor-BeapTPDe.js";
|
|
11
11
|
import { bundledThemes as hn, bundledLanguages as un, createHighlighter as ho } from "shiki";
|
|
12
|
-
import { u as j, C as uo, E as mo, l as W, B as fo, I as Nt, V as qt, M as go, D as mn, a as xo, b as bo, c as Si, d as fn, e as po, f as Fe, g as Ve, h as di, T as gt, i as xt, j as bt } from "./locales-
|
|
12
|
+
import { u as j, C as uo, E as mo, l as W, B as fo, I as Nt, V as qt, M as go, D as mn, a as xo, b as bo, c as Si, d as fn, e as po, f as Fe, g as Ve, h as di, T as gt, i as xt, j as bt } from "./locales-wpNI1Q-s.js";
|
|
13
13
|
import * as Z from "@radix-ui/react-select";
|
|
14
14
|
import { Slot as hi } from "@radix-ui/react-slot";
|
|
15
15
|
import ui, { sticky as wo } from "tippy.js";
|
|
@@ -6301,16 +6301,17 @@ const eu = oi.extend({
|
|
|
6301
6301
|
parseHTML() {
|
|
6302
6302
|
return [
|
|
6303
6303
|
{
|
|
6304
|
-
tag: "span
|
|
6304
|
+
tag: "span.image img",
|
|
6305
6305
|
getAttrs: (e) => {
|
|
6306
|
-
|
|
6306
|
+
var n;
|
|
6307
|
+
const t = e == null ? void 0 : e.parentElement, i = e == null ? void 0 : e.getAttribute("width");
|
|
6307
6308
|
return {
|
|
6308
|
-
src:
|
|
6309
|
-
alt:
|
|
6310
|
-
caption:
|
|
6309
|
+
src: e == null ? void 0 : e.getAttribute("src"),
|
|
6310
|
+
alt: e == null ? void 0 : e.getAttribute("alt"),
|
|
6311
|
+
caption: e == null ? void 0 : e.getAttribute("caption"),
|
|
6311
6312
|
width: i ? Number.parseInt(i, 10) : null,
|
|
6312
|
-
align: (
|
|
6313
|
-
inline: (
|
|
6313
|
+
align: (e == null ? void 0 : e.getAttribute("align")) || ((n = t == null ? void 0 : t.style) == null ? void 0 : n.textAlign) || null,
|
|
6314
|
+
inline: (e == null ? void 0 : e.getAttribute("inline")) || !1
|
|
6314
6315
|
};
|
|
6315
6316
|
}
|
|
6316
6317
|
},
|