reactjs-tiptap-editor 0.4.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ActionMenuButton-BKOg7hkq.js +38 -0
- package/lib/ActionMenuButton-DLQyd_gx.cjs +1 -0
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.d.cts +32 -44
- package/lib/Attachment.d.ts +32 -44
- package/lib/Attachment.js +129 -99
- package/lib/Blockquote.cjs +3 -3
- package/lib/Blockquote.d.cts +32 -44
- package/lib/Blockquote.d.ts +32 -44
- package/lib/Blockquote.js +50 -22
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.d.cts +32 -44
- package/lib/Bold.d.ts +32 -44
- package/lib/Bold.js +48 -20
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.d.cts +32 -44
- package/lib/BulletList.d.ts +32 -44
- package/lib/BulletList.js +38 -9
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.d.cts +32 -44
- package/lib/Clear.d.ts +32 -44
- package/lib/Clear.js +32 -6
- package/lib/Code.cjs +1 -1
- package/lib/Code.d.cts +32 -44
- package/lib/Code.d.ts +32 -44
- package/lib/Code.js +53 -25
- package/lib/CodeBlock.cjs +35 -35
- package/lib/CodeBlock.d.cts +32 -44
- package/lib/CodeBlock.d.ts +32 -44
- package/lib/CodeBlock.js +605 -590
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.d.cts +33 -45
- package/lib/CodeView.d.ts +33 -45
- package/lib/CodeView.js +49 -21
- package/lib/Color.cjs +1 -1
- package/lib/Color.d.cts +36 -44
- package/lib/Color.d.ts +36 -44
- package/lib/Color.js +123 -79
- package/lib/Column.cjs +1 -0
- package/lib/{Document.d.cts → Column.d.cts} +38 -47
- package/lib/{Document.d.ts → Column.d.ts} +38 -47
- package/lib/Column.js +217 -0
- package/lib/{Drawer-CaAfmqNo.js → Drawer-DZ5jvmrX.js} +404 -394
- package/lib/Drawer-SRhwOc6T.cjs +1 -0
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.d.cts +32 -44
- package/lib/Drawer.d.ts +32 -44
- package/lib/Drawer.js +6 -5
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.d.cts +32 -49
- package/lib/Emoji.d.ts +32 -49
- package/lib/Emoji.js +377 -392
- package/lib/Excalidraw-DwBRXEtC.js +345 -0
- package/lib/Excalidraw-ZN3DQvDC.cjs +1 -0
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.d.cts +32 -44
- package/lib/Excalidraw.d.ts +32 -44
- package/lib/Excalidraw.js +6 -4
- package/lib/ExportPdf.cjs +5 -5
- package/lib/ExportPdf.d.cts +32 -44
- package/lib/ExportPdf.d.ts +32 -44
- package/lib/ExportPdf.js +60 -32
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.d.cts +33 -45
- package/lib/ExportWord.d.ts +33 -45
- package/lib/ExportWord.js +84 -21
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.d.cts +46 -47
- package/lib/FontFamily.d.ts +46 -47
- package/lib/FontFamily.js +72 -74
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.d.cts +43 -47
- package/lib/FontSize.d.ts +43 -47
- package/lib/FontSize.js +72 -64
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.d.cts +46 -44
- package/lib/Heading.d.ts +46 -44
- package/lib/Heading.js +91 -73
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.d.cts +36 -44
- package/lib/Highlight.d.ts +36 -44
- package/lib/Highlight.js +152 -21
- package/lib/History.cjs +1 -1
- package/lib/History.d.cts +34 -44
- package/lib/History.d.ts +34 -44
- package/lib/History.js +976 -53
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.d.cts +32 -44
- package/lib/HorizontalRule.d.ts +32 -44
- package/lib/HorizontalRule.js +97 -17
- package/lib/Icon-DUpv2cI6.cjs +1 -0
- package/lib/Icon-jKs8Hr6p.js +11 -0
- package/lib/Iframe-CmXkEqOd.js +431 -0
- package/lib/Iframe-Cvca2G7X.cjs +1 -0
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.d.cts +31 -50
- package/lib/Iframe.d.ts +31 -50
- package/lib/Iframe.js +6 -4
- package/lib/Image.cjs +1 -1
- package/lib/Image.d.cts +32 -45
- package/lib/Image.d.ts +32 -45
- package/lib/Image.js +848 -5
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.d.cts +33 -47
- package/lib/ImageGif.d.ts +33 -47
- package/lib/ImageGif.js +424 -5
- package/lib/ImportWord.cjs +48 -48
- package/lib/ImportWord.d.cts +33 -45
- package/lib/ImportWord.d.ts +33 -45
- package/lib/ImportWord.js +2596 -2588
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.d.cts +32 -44
- package/lib/Indent.d.ts +32 -44
- package/lib/Indent.js +97 -27
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.d.cts +32 -44
- package/lib/Italic.d.ts +32 -44
- package/lib/Italic.js +47 -19
- package/lib/Katex-DsYXsjSS.js +2740 -0
- package/lib/Katex-XfrNne6U.cjs +4 -0
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.d.cts +32 -44
- package/lib/Katex.d.ts +32 -44
- package/lib/Katex.js +5 -196
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.d.cts +34 -50
- package/lib/LineHeight.d.ts +34 -50
- package/lib/LineHeight.js +71 -112
- package/lib/Link.cjs +1 -1
- package/lib/Link.d.cts +33 -47
- package/lib/Link.d.ts +33 -47
- package/lib/Link.js +3 -3
- package/lib/LinkEditBlock-BZenZq-Z.cjs +5 -0
- package/lib/LinkEditBlock-CB8yIffE.js +1241 -0
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.d.cts +29 -44
- package/lib/Mention.d.ts +29 -44
- package/lib/Mention.js +112 -124
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.d.cts +32 -44
- package/lib/Mermaid.d.ts +32 -44
- package/lib/Mermaid.js +177 -165
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.d.cts +47 -46
- package/lib/MoreMark.d.ts +47 -46
- package/lib/MoreMark.js +125 -55
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.d.cts +32 -44
- package/lib/OrderedList.d.ts +32 -44
- package/lib/OrderedList.js +37 -9
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.d.cts +32 -47
- package/lib/SearchAndReplace.d.ts +32 -47
- package/lib/SearchAndReplace.js +221 -197
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.d.cts +44 -51
- package/lib/SlashCommand.d.ts +44 -51
- package/lib/SlashCommand.js +235 -249
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.d.cts +32 -44
- package/lib/Strike.d.ts +32 -44
- package/lib/Strike.js +39 -11
- package/lib/Table-B1j1Ebmh.cjs +9 -0
- package/lib/Table-Db8TcQX8.js +1984 -0
- package/lib/Table.cjs +1 -9
- package/lib/Table.d.cts +33 -47
- package/lib/Table.d.ts +33 -47
- package/lib/Table.js +3 -558
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.d.cts +32 -44
- package/lib/TaskList.d.ts +32 -44
- package/lib/TaskList.js +38 -10
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.d.cts +45 -44
- package/lib/TextAlign.d.ts +45 -44
- package/lib/TextAlign.js +108 -101
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.d.cts +61 -44
- package/lib/TextDirection.d.ts +61 -44
- package/lib/TextDirection.js +105 -112
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.d.cts +32 -44
- package/lib/TextUnderline.d.ts +32 -44
- package/lib/TextUnderline.js +46 -18
- package/lib/{Twitter-BFULyqdR.js → Twitter-CXmmjz9R.js} +536 -498
- package/lib/Twitter-CtVTIWJW.cjs +1 -0
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.d.cts +32 -44
- package/lib/Twitter.d.ts +32 -44
- package/lib/Twitter.js +5 -4
- package/lib/Video.cjs +1 -1
- package/lib/Video.d.cts +32 -44
- package/lib/Video.d.ts +32 -44
- package/lib/Video.js +261 -4
- package/lib/_commonjsHelpers-BItOPCY9.js +28 -0
- package/lib/_commonjsHelpers-BTDuMlIz.cjs +1 -0
- package/lib/bubble.cjs +2 -0
- package/lib/{bubble-extra.d.cts → bubble.d.cts} +58 -59
- package/lib/{bubble-extra.d.ts → bubble.d.ts} +58 -59
- package/lib/bubble.js +1925 -0
- package/lib/button-B12K7BJ4.cjs +1 -0
- package/lib/button-DXMsXUEn.js +43 -0
- package/lib/clsx-C11secjj.cjs +1 -0
- package/lib/clsx-OuTLNxxd.js +16 -0
- package/lib/delete-node-CosiBes5.cjs +1 -0
- package/lib/delete-node-IyVmiRbI.js +22 -0
- package/lib/dialog-CaCS-W5S.cjs +1 -0
- package/lib/dialog-PtQivpHS.js +100 -0
- package/lib/dom-dataset-BqoJhJXt.cjs +1 -0
- package/lib/dom-dataset-CIEeltF6.js +47 -0
- package/lib/dropdown-menu-BPp2Z_U-.js +136 -0
- package/lib/dropdown-menu-CdSm4emp.cjs +1 -0
- package/lib/file-BLas99n7.js +43 -0
- package/lib/file-i7e4nQY2.cjs +1 -0
- package/lib/floating-ui.dom-U1vPFQ5f.js +1151 -0
- package/lib/floating-ui.dom-VCrc58uF.cjs +1 -0
- package/lib/icons-Cllpys39.js +362 -0
- package/lib/icons-CqHjeW5T.cjs +1 -0
- package/lib/index-BH4bc3jN.cjs +33 -0
- package/lib/index-BPfVXs5_.js +2380 -0
- package/lib/index-Bnmd0WvY.js +1631 -0
- package/lib/{index-Ch6dBBad.js → index-CBce_TWY.js} +40 -42
- package/lib/{index-5iBZLua9.cjs → index-D-5U8dY8.cjs} +8 -8
- package/lib/{index-ByurDDMv.js → index-D2TUfKkC.js} +2 -2
- package/lib/index-DV5kbgRU.cjs +1 -0
- package/lib/{index-LmrOdnen.js → index-DYkucCoF.js} +396 -495
- package/lib/index-Dfmm6FTT.cjs +1 -0
- package/lib/index-DnWWK9F_.js +6374 -0
- package/lib/index-DzcKxutn.js +632 -0
- package/lib/index-DzvuNTxo.cjs +4 -0
- package/lib/{index-BeCTd5v2.cjs → index-N--9MohJ.cjs} +1 -1
- package/lib/index-RfTlOzIr.cjs +22 -0
- package/lib/index.cjs +132 -1
- package/lib/index.d.cts +34 -285
- package/lib/index.d.ts +34 -285
- package/lib/index.js +243 -2
- package/lib/input-_ECRfn3Y.cjs +1 -0
- package/lib/input-wJ9PDEzZ.js +21 -0
- package/lib/isNumber-ClPupm7P.cjs +1 -0
- package/lib/isNumber-fpLGS0AZ.js +15 -0
- package/lib/label-BkgAe7IY.cjs +1 -0
- package/lib/label-CGdLYWv7.js +19 -0
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.d.cts +5410 -62
- package/lib/locale-bundle.d.ts +5410 -62
- package/lib/locale-bundle.js +9 -7
- package/lib/popover-BgmUNMHj.cjs +1 -0
- package/lib/popover-CAuEW0Mr.js +23 -0
- package/lib/separator-CuBW_w98.js +328 -0
- package/lib/separator-DRIrVZ2N.cjs +1 -0
- package/lib/store-DX599H5W.js +10 -0
- package/lib/store-WStcMOiW.cjs +1 -0
- package/lib/style.css +1 -1
- package/lib/switch-CnLJ7Y-b.cjs +1 -0
- package/lib/switch-Coix_FA1.js +27 -0
- package/lib/tabs-B5mVSN1I.js +46 -0
- package/lib/tabs-BoLCMcCI.cjs +1 -0
- package/lib/textarea-B-6zTKQz.cjs +1 -0
- package/lib/{textarea-aPtytkDx.js → textarea-DUUM1jZd.js} +1 -1
- package/lib/theme-B7aAsK_T.js +15 -0
- package/lib/theme-D8_cxGqB.cjs +1 -0
- package/lib/throttle-CdwDrFpn.js +249 -0
- package/lib/throttle-qX7Yjtsg.cjs +1 -0
- package/lib/toggle-Cdp4IT2U.js +85 -0
- package/lib/toggle-D41PzQLJ.cjs +1 -0
- package/lib/tooltip-BuEiE96N.cjs +1 -0
- package/lib/tooltip-CopwsU8q.js +23 -0
- package/lib/updatePosition-8Sdem5jb.cjs +1 -0
- package/lib/updatePosition-BPmcE0YD.js +215 -0
- package/lib/use-toast-Bz3QCOtE.cjs +1 -0
- package/lib/use-toast-Crf7-q5H.js +98 -0
- package/lib/useButtonProps-BsEd4zYM.js +141 -0
- package/lib/useButtonProps-C6Vpn190.cjs +1 -0
- package/package.json +22 -105
- package/lib/ActionMenuButton-CYdM1xx5.cjs +0 -1
- package/lib/ActionMenuButton-DKRF6oa0.js +0 -33
- package/lib/BaseKit.cjs +0 -3
- package/lib/BaseKit.d.cts +0 -481
- package/lib/BaseKit.d.ts +0 -481
- package/lib/BaseKit.js +0 -132
- package/lib/Document.cjs +0 -1
- package/lib/Document.js +0 -9
- package/lib/Drawer-CdvCMSzN.cjs +0 -1
- package/lib/Excalidraw-BbMQhNvs.cjs +0 -1
- package/lib/Excalidraw-CVWz2Vyn.js +0 -290
- package/lib/FormatPainter.cjs +0 -1
- package/lib/FormatPainter.d.cts +0 -372
- package/lib/FormatPainter.d.ts +0 -372
- package/lib/FormatPainter.js +0 -76
- package/lib/ListItem.cjs +0 -1
- package/lib/ListItem.d.cts +0 -290
- package/lib/ListItem.d.ts +0 -290
- package/lib/ListItem.js +0 -7
- package/lib/MultiColumn.cjs +0 -1
- package/lib/MultiColumn.d.cts +0 -294
- package/lib/MultiColumn.d.ts +0 -294
- package/lib/MultiColumn.js +0 -8
- package/lib/RichTextEditor-CxvwGvQG.cjs +0 -142
- package/lib/RichTextEditor-DGcKEUGr.js +0 -22166
- package/lib/Selection.cjs +0 -1
- package/lib/Selection.d.cts +0 -289
- package/lib/Selection.d.ts +0 -289
- package/lib/Selection.js +0 -25
- package/lib/SubAndSuperScript.cjs +0 -1
- package/lib/SubAndSuperScript.d.cts +0 -377
- package/lib/SubAndSuperScript.d.ts +0 -377
- package/lib/SubAndSuperScript.js +0 -43
- package/lib/TableOfContent.cjs +0 -1
- package/lib/TableOfContent.d.cts +0 -291
- package/lib/TableOfContent.d.ts +0 -291
- package/lib/TableOfContent.js +0 -185
- package/lib/TextBubble.cjs +0 -1
- package/lib/TextBubble.d.cts +0 -362
- package/lib/TextBubble.d.ts +0 -362
- package/lib/TextBubble.js +0 -133
- package/lib/TrailingNode.cjs +0 -1
- package/lib/TrailingNode.d.cts +0 -297
- package/lib/TrailingNode.d.ts +0 -297
- package/lib/TrailingNode.js +0 -41
- package/lib/Twitter-Cutpkh3h.cjs +0 -1
- package/lib/bubble-extra.cjs +0 -2
- package/lib/bubble-extra.js +0 -631
- package/lib/dom-dataset-_6-diIRQ.cjs +0 -33
- package/lib/dom-dataset-lYeH6gfI.js +0 -2361
- package/lib/index-6D1J-A-o.cjs +0 -1
- package/lib/index-B96Cclrj.cjs +0 -3
- package/lib/index-BBz7Nmv9.js +0 -55
- package/lib/index-CUogRI7j.cjs +0 -1
- package/lib/index-DF2Lp4HZ.cjs +0 -100
- package/lib/index-D_L6n8O8.js +0 -76
- package/lib/index-Dbvi-Bvh.cjs +0 -1
- package/lib/index-DpCrt7xs.cjs +0 -1
- package/lib/index-DsAX1Vq8.cjs +0 -1
- package/lib/index-Dy4DlW9o.js +0 -12
- package/lib/index-J3jHHZ4d.js +0 -200
- package/lib/index-VvXaaKe3.js +0 -898
- package/lib/index-kbO3iWqL.js +0 -13432
- package/lib/textarea-DFo_aXnj.cjs +0 -1
package/lib/FontSize.js
CHANGED
|
@@ -1,84 +1,92 @@
|
|
|
1
|
-
import { E as m } from "./index-
|
|
2
|
-
import { u as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { useMemo as A } from "react";
|
|
6
|
-
import { A as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}, [t]);
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
|
|
1
|
+
import { E as m } from "./index-DnWWK9F_.js";
|
|
2
|
+
import { u as p, i as S } from "./index-DYkucCoF.js";
|
|
3
|
+
import { u as z, b as h, e as v } from "./useButtonProps-BsEd4zYM.js";
|
|
4
|
+
import { jsx as r, Fragment as x, jsxs as d } from "react/jsx-runtime";
|
|
5
|
+
import { useMemo as A, Fragment as D } from "react";
|
|
6
|
+
import { A as y } from "./ActionMenuButton-BKOg7hkq.js";
|
|
7
|
+
import "./index-BPfVXs5_.js";
|
|
8
|
+
import { D as F, a as M, b as g, c as b, d as w } from "./dropdown-menu-BPp2Z_U-.js";
|
|
9
|
+
function $() {
|
|
10
|
+
const { t: e } = p(), n = z(T.name), {
|
|
11
|
+
icon: c = void 0,
|
|
12
|
+
tooltip: s = void 0,
|
|
13
|
+
items: a = [],
|
|
14
|
+
isActive: u = void 0
|
|
15
|
+
} = (n == null ? void 0 : n.componentProps) ?? {}, { disabled: l, dataState: t } = h(u), i = A(() => (t == null ? void 0 : t.title) || e("editor.fontSize.default.tooltip"), [t]);
|
|
16
|
+
return n ? /* @__PURE__ */ d(F, { children: [
|
|
17
|
+
/* @__PURE__ */ r(
|
|
18
|
+
M,
|
|
19
19
|
{
|
|
20
20
|
asChild: !0,
|
|
21
|
-
disabled:
|
|
22
|
-
children: /* @__PURE__ */
|
|
23
|
-
|
|
21
|
+
disabled: l,
|
|
22
|
+
children: /* @__PURE__ */ r(
|
|
23
|
+
y,
|
|
24
24
|
{
|
|
25
|
-
disabled:
|
|
26
|
-
icon:
|
|
27
|
-
title:
|
|
28
|
-
tooltip:
|
|
29
|
-
tooltipOptions: t == null ? void 0 : t.tooltipOptions
|
|
25
|
+
disabled: l,
|
|
26
|
+
icon: c,
|
|
27
|
+
title: i,
|
|
28
|
+
tooltip: s
|
|
30
29
|
}
|
|
31
30
|
)
|
|
32
31
|
}
|
|
33
32
|
),
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
/* @__PURE__ */ r(g, { className: "richtext-max-h-96 richtext-w-32 richtext-overflow-y-auto", children: a == null ? void 0 : a.map((o, f) => /* @__PURE__ */ d(D, { children: [
|
|
34
|
+
/* @__PURE__ */ r(
|
|
35
|
+
b,
|
|
36
|
+
{
|
|
37
|
+
checked: i === o.title,
|
|
38
|
+
onClick: o.action,
|
|
39
|
+
children: /* @__PURE__ */ r("div", { className: "richtext-ml-1 richtext-h-full", children: o.title })
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
o.title === e("editor.fontSize.default.tooltip") && /* @__PURE__ */ r(w, {})
|
|
43
|
+
] }, `font-size-${f}`)) })
|
|
44
|
+
] }) : /* @__PURE__ */ r(x, {});
|
|
44
45
|
}
|
|
45
|
-
const
|
|
46
|
+
const T = /* @__PURE__ */ m.create({
|
|
46
47
|
name: "fontSize",
|
|
47
48
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
48
49
|
//@ts-expect-error
|
|
49
50
|
addOptions() {
|
|
50
|
-
var
|
|
51
|
+
var e;
|
|
51
52
|
return {
|
|
52
|
-
...(
|
|
53
|
+
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
53
54
|
types: ["textStyle"],
|
|
54
|
-
fontSizes:
|
|
55
|
-
button({ editor:
|
|
56
|
-
var
|
|
57
|
-
const
|
|
58
|
-
title:
|
|
55
|
+
fontSizes: S,
|
|
56
|
+
button({ editor: n, extension: c, t: s }) {
|
|
57
|
+
var l;
|
|
58
|
+
const u = v((l = c.options) == null ? void 0 : l.fontSizes).map((t) => ({
|
|
59
|
+
title: t.value === "Default" ? s("editor.fontSize.default.tooltip") : String(t.name),
|
|
59
60
|
isActive: () => {
|
|
60
|
-
const { fontSize:
|
|
61
|
-
return
|
|
61
|
+
const { fontSize: i } = n.getAttributes("textStyle"), o = t.value === "Default", f = i == null || i === "";
|
|
62
|
+
return o && f ? !0 : n.isActive({ fontSize: String(t.value) }) || !1;
|
|
62
63
|
},
|
|
63
64
|
action: () => {
|
|
64
|
-
if (
|
|
65
|
-
|
|
65
|
+
if (t.value === "Default") {
|
|
66
|
+
n.commands.unsetFontSize();
|
|
66
67
|
return;
|
|
67
68
|
}
|
|
68
|
-
|
|
69
|
+
n.commands.setFontSize(String(t.value));
|
|
69
70
|
},
|
|
70
|
-
disabled: !
|
|
71
|
-
|
|
72
|
-
default: n.value === o.value || !1
|
|
71
|
+
// disabled: !editor.can().setFontSize(String(k.value)),
|
|
72
|
+
default: t.value === "Default" || !1
|
|
73
73
|
}));
|
|
74
74
|
return {
|
|
75
|
-
component:
|
|
75
|
+
// component: FontSizeMenuButton,
|
|
76
76
|
componentProps: {
|
|
77
|
-
editor:
|
|
78
|
-
tooltip:
|
|
77
|
+
editor: n,
|
|
78
|
+
tooltip: s("editor.fontSize.tooltip"),
|
|
79
79
|
disabled: !1,
|
|
80
|
-
items:
|
|
81
|
-
maxHeight: 280
|
|
80
|
+
items: u,
|
|
81
|
+
maxHeight: 280,
|
|
82
|
+
icon: "MenuDown",
|
|
83
|
+
isActive: () => {
|
|
84
|
+
const t = (u || []).find((o) => o.isActive());
|
|
85
|
+
return t && !t.default ? t : {
|
|
86
|
+
title: s("editor.fontSize.default.tooltip"),
|
|
87
|
+
isActive: () => !1
|
|
88
|
+
};
|
|
89
|
+
}
|
|
82
90
|
}
|
|
83
91
|
};
|
|
84
92
|
}
|
|
@@ -91,9 +99,9 @@ const C = /* @__PURE__ */ m.create({
|
|
|
91
99
|
attributes: {
|
|
92
100
|
fontSize: {
|
|
93
101
|
default: null,
|
|
94
|
-
parseHTML: (
|
|
95
|
-
renderHTML: (
|
|
96
|
-
style: `font-size: ${
|
|
102
|
+
parseHTML: (e) => e.style.fontSize.replaceAll(/["']+/g, ""),
|
|
103
|
+
renderHTML: (e) => e.fontSize ? {
|
|
104
|
+
style: `font-size: ${e.fontSize}`
|
|
97
105
|
} : {}
|
|
98
106
|
}
|
|
99
107
|
}
|
|
@@ -102,12 +110,12 @@ const C = /* @__PURE__ */ m.create({
|
|
|
102
110
|
},
|
|
103
111
|
addCommands() {
|
|
104
112
|
return {
|
|
105
|
-
setFontSize: (
|
|
106
|
-
unsetFontSize: () => ({ chain:
|
|
113
|
+
setFontSize: (e) => ({ chain: n }) => n().setMark("textStyle", { fontSize: e }).run(),
|
|
114
|
+
unsetFontSize: () => ({ chain: e }) => e().setMark("textStyle", { fontSize: null }).removeEmptyTextStyle().run()
|
|
107
115
|
};
|
|
108
116
|
}
|
|
109
117
|
});
|
|
110
118
|
export {
|
|
111
|
-
|
|
112
|
-
|
|
119
|
+
T as FontSize,
|
|
120
|
+
$ as RichTextFontSize
|
|
113
121
|
};
|
package/lib/Heading.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 v=require("./index-RfTlOzIr.cjs"),M=require("./index-Dfmm6FTT.cjs"),s=require("react/jsx-runtime"),x=require("react"),$=require("./ActionMenuButton-DLQyd_gx.cjs"),b=require("./index-DV5kbgRU.cjs"),f=require("./useButtonProps-C6Vpn190.cjs"),h=require("./dropdown-menu-CdSm4emp.cjs");var j=v.Node3.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,v.mergeAttributes(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var l;const i=(l=e.attrs)!=null&&l.level?parseInt(e.attrs.level,10):1,a="#".repeat(i);return e.content?`${a} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>v.textblockTypeInputRule({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});function m(){const{t:e}=M.useLocale(),t=f.useButtonProps(A.name),{icon:l=void 0,tooltip:i=void 0,isActive:a=void 0,items:o=[]}=(t==null?void 0:t.componentProps)??{},{disabled:p,dataState:d}=f.useActive(a),r=x.useMemo(()=>(d==null?void 0:d.title)||e("editor.paragraph.tooltip"),[d]);return t?s.jsxs(h.DropdownMenu,{children:[s.jsx(h.DropdownMenuTrigger,{asChild:!0,disabled:p,children:s.jsx($.ActionMenuButton,{disabled:p,icon:l,title:r,tooltip:i})}),s.jsx(h.DropdownMenuContent,{className:"richtext-w-full",children:o==null?void 0:o.map((n,c)=>{var u,g;return s.jsxs(x.Fragment,{children:[s.jsxs(h.DropdownMenuCheckboxItem,{checked:r===n.title,onClick:n.action,children:[s.jsx("div",{className:b.cn("richtext-ml-1 richtext-h-full",{"":n.level==="Paragraph","heading-1":n.level===1,"heading-2":n.level===2,"heading-3":n.level===3,"heading-4":n.level===4,"heading-5":n.level===5,"heading-6":n.level===6}),children:n.title}),!!((u=n==null?void 0:n.shortcutKeys)!=null&&u.length)&&s.jsx(h.DropdownMenuShortcut,{className:"richtext-pl-4",children:(g=n==null?void 0:n.shortcutKeys)==null?void 0:g.map(H=>f.getShortcutKey(H)).join(" ")})]}),n.level==="Paragraph"&&s.jsx(h.DropdownMenuSeparator,{})]},`heading-k-${c}`)})})]}):s.jsx(s.Fragment,{})}const A=j.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),levels:M.HEADINGS,button({editor:t,extension:l,t:i}){var d;const a=((d=l.options)==null?void 0:d.levels)||[],o=a.map(r=>{var c;const n=r==="Paragraph";return{action:()=>{if(n){const u=a.find(g=>t.isActive("heading",{level:g}));u&&u!=="Paragraph"&&t.commands.toggleHeading({level:u});return}t.commands.toggleHeading({level:r})},isActive:()=>n?!1:t.isActive("heading",{level:r})||!1,disabled:!t.can().toggleHeading({level:r}),title:i(n?"editor.paragraph.tooltip":`editor.heading.h${r}.tooltip`),level:r,shortcutKeys:((c=l.options.shortcutKeys)==null?void 0:c[r])??["alt","mod",`${r}`],default:n}}),p=o.filter(r=>r.disabled).length===o.length;return{componentProps:{tooltip:i("editor.heading.tooltip"),disabled:p,items:o,icon:"MenuDown",isActive:()=>{const r=o==null?void 0:o.find(c=>c.isActive());return r&&!r.default?r:{title:i("editor.paragraph.tooltip"),level:0,isActive:()=>!1}},levels:a}}}}}});exports.Heading=A;exports.RichTextHeading=m;
|
package/lib/Heading.d.cts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
1
2
|
import { Editor } from '@tiptap/react';
|
|
2
3
|
import { Extension } from '@tiptap/core';
|
|
3
4
|
import { HeadingOptions as HeadingOptions_2 } from '@tiptap/extension-heading';
|
|
5
|
+
import { JSX } from 'react/jsx-runtime';
|
|
4
6
|
import { Node as Node_2 } from '@tiptap/core';
|
|
5
7
|
|
|
6
8
|
/**
|
|
@@ -77,6 +79,21 @@ export declare const Heading: Node_2<HeadingOptions, any>;
|
|
|
77
79
|
export declare interface HeadingOptions extends HeadingOptions_2, GeneralOptions<HeadingOptions> {
|
|
78
80
|
}
|
|
79
81
|
|
|
82
|
+
export declare interface Item {
|
|
83
|
+
title: string;
|
|
84
|
+
icon?: any;
|
|
85
|
+
level?: number;
|
|
86
|
+
isActive: NonNullable<ButtonViewReturnComponentProps['isActive']>;
|
|
87
|
+
action?: ButtonViewReturnComponentProps['action'];
|
|
88
|
+
style?: default_2.CSSProperties;
|
|
89
|
+
shortcutKeys?: string[];
|
|
90
|
+
disabled?: boolean;
|
|
91
|
+
divider?: boolean;
|
|
92
|
+
default?: boolean;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export declare function RichTextHeading(): JSX.Element;
|
|
96
|
+
|
|
80
97
|
export { }
|
|
81
98
|
|
|
82
99
|
|
|
@@ -110,11 +127,22 @@ declare module '@tiptap/core' {
|
|
|
110
127
|
}
|
|
111
128
|
|
|
112
129
|
|
|
130
|
+
declare module '@tiptap/core' {
|
|
131
|
+
interface Storage {
|
|
132
|
+
color: ColorStorage;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
|
|
113
137
|
declare module '@tiptap/core' {
|
|
114
138
|
interface Commands<ReturnType> {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
139
|
+
columns: {
|
|
140
|
+
insertColumns: (attrs?: {
|
|
141
|
+
cols: number;
|
|
142
|
+
}) => ReturnType;
|
|
143
|
+
addColBefore: () => ReturnType;
|
|
144
|
+
addColAfter: () => ReturnType;
|
|
145
|
+
deleteCol: () => ReturnType;
|
|
118
146
|
};
|
|
119
147
|
}
|
|
120
148
|
}
|
|
@@ -122,8 +150,9 @@ declare module '@tiptap/core' {
|
|
|
122
150
|
|
|
123
151
|
declare module '@tiptap/core' {
|
|
124
152
|
interface Commands<ReturnType> {
|
|
125
|
-
|
|
126
|
-
|
|
153
|
+
drawer: {
|
|
154
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
155
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
127
156
|
};
|
|
128
157
|
}
|
|
129
158
|
}
|
|
@@ -141,7 +170,16 @@ declare module '@tiptap/core' {
|
|
|
141
170
|
declare module '@tiptap/core' {
|
|
142
171
|
interface Commands<ReturnType> {
|
|
143
172
|
exportWord: {
|
|
144
|
-
exportToWord: () => ReturnType;
|
|
173
|
+
exportToWord: (docState: any) => ReturnType;
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
declare module '@tiptap/core' {
|
|
180
|
+
interface Commands<ReturnType> {
|
|
181
|
+
excalidraw: {
|
|
182
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
145
183
|
};
|
|
146
184
|
}
|
|
147
185
|
}
|
|
@@ -166,10 +204,8 @@ declare module '@tiptap/core' {
|
|
|
166
204
|
|
|
167
205
|
|
|
168
206
|
declare module '@tiptap/core' {
|
|
169
|
-
interface
|
|
170
|
-
|
|
171
|
-
setPainter: (marks: Mark[]) => ReturnType;
|
|
172
|
-
};
|
|
207
|
+
interface Storage {
|
|
208
|
+
highlight: HighlightStorage;
|
|
173
209
|
}
|
|
174
210
|
}
|
|
175
211
|
|
|
@@ -254,16 +290,6 @@ declare module '@tiptap/core' {
|
|
|
254
290
|
}
|
|
255
291
|
|
|
256
292
|
|
|
257
|
-
declare module '@tiptap/core' {
|
|
258
|
-
interface Commands<ReturnType> {
|
|
259
|
-
lineHeight: {
|
|
260
|
-
setLineHeight: (lineHeight: string) => ReturnType;
|
|
261
|
-
unsetLineHeight: () => ReturnType;
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
|
|
267
293
|
declare module '@tiptap/core' {
|
|
268
294
|
interface Commands<ReturnType> {
|
|
269
295
|
mermaid: {
|
|
@@ -274,20 +300,6 @@ declare module '@tiptap/core' {
|
|
|
274
300
|
}
|
|
275
301
|
|
|
276
302
|
|
|
277
|
-
declare module '@tiptap/core' {
|
|
278
|
-
interface Commands<ReturnType> {
|
|
279
|
-
columns: {
|
|
280
|
-
insertColumns: (attrs?: {
|
|
281
|
-
cols: number;
|
|
282
|
-
}) => ReturnType;
|
|
283
|
-
addColBefore: () => ReturnType;
|
|
284
|
-
addColAfter: () => ReturnType;
|
|
285
|
-
deleteCol: () => ReturnType;
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
|
|
291
303
|
declare module '@tiptap/core' {
|
|
292
304
|
interface Commands<ReturnType> {
|
|
293
305
|
search: {
|
|
@@ -311,16 +323,6 @@ declare module '@tiptap/core' {
|
|
|
311
323
|
}
|
|
312
324
|
|
|
313
325
|
|
|
314
|
-
declare module '@tiptap/core' {
|
|
315
|
-
interface Commands<ReturnType> {
|
|
316
|
-
tableOfContents: {
|
|
317
|
-
setTableOfContents: () => ReturnType;
|
|
318
|
-
removeTableOfContents: () => ReturnType;
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
|
|
324
326
|
declare module '@tiptap/core' {
|
|
325
327
|
interface Commands<ReturnType> {
|
|
326
328
|
twitter: {
|
package/lib/Heading.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
1
2
|
import { Editor } from '@tiptap/react';
|
|
2
3
|
import { Extension } from '@tiptap/core';
|
|
3
4
|
import { HeadingOptions as HeadingOptions_2 } from '@tiptap/extension-heading';
|
|
5
|
+
import { JSX } from 'react/jsx-runtime';
|
|
4
6
|
import { Node as Node_2 } from '@tiptap/core';
|
|
5
7
|
|
|
6
8
|
/**
|
|
@@ -77,6 +79,21 @@ export declare const Heading: Node_2<HeadingOptions, any>;
|
|
|
77
79
|
export declare interface HeadingOptions extends HeadingOptions_2, GeneralOptions<HeadingOptions> {
|
|
78
80
|
}
|
|
79
81
|
|
|
82
|
+
export declare interface Item {
|
|
83
|
+
title: string;
|
|
84
|
+
icon?: any;
|
|
85
|
+
level?: number;
|
|
86
|
+
isActive: NonNullable<ButtonViewReturnComponentProps['isActive']>;
|
|
87
|
+
action?: ButtonViewReturnComponentProps['action'];
|
|
88
|
+
style?: default_2.CSSProperties;
|
|
89
|
+
shortcutKeys?: string[];
|
|
90
|
+
disabled?: boolean;
|
|
91
|
+
divider?: boolean;
|
|
92
|
+
default?: boolean;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export declare function RichTextHeading(): JSX.Element;
|
|
96
|
+
|
|
80
97
|
export { }
|
|
81
98
|
|
|
82
99
|
|
|
@@ -110,11 +127,22 @@ declare module '@tiptap/core' {
|
|
|
110
127
|
}
|
|
111
128
|
|
|
112
129
|
|
|
130
|
+
declare module '@tiptap/core' {
|
|
131
|
+
interface Storage {
|
|
132
|
+
color: ColorStorage;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
|
|
113
137
|
declare module '@tiptap/core' {
|
|
114
138
|
interface Commands<ReturnType> {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
139
|
+
columns: {
|
|
140
|
+
insertColumns: (attrs?: {
|
|
141
|
+
cols: number;
|
|
142
|
+
}) => ReturnType;
|
|
143
|
+
addColBefore: () => ReturnType;
|
|
144
|
+
addColAfter: () => ReturnType;
|
|
145
|
+
deleteCol: () => ReturnType;
|
|
118
146
|
};
|
|
119
147
|
}
|
|
120
148
|
}
|
|
@@ -122,8 +150,9 @@ declare module '@tiptap/core' {
|
|
|
122
150
|
|
|
123
151
|
declare module '@tiptap/core' {
|
|
124
152
|
interface Commands<ReturnType> {
|
|
125
|
-
|
|
126
|
-
|
|
153
|
+
drawer: {
|
|
154
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
155
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
127
156
|
};
|
|
128
157
|
}
|
|
129
158
|
}
|
|
@@ -141,7 +170,16 @@ declare module '@tiptap/core' {
|
|
|
141
170
|
declare module '@tiptap/core' {
|
|
142
171
|
interface Commands<ReturnType> {
|
|
143
172
|
exportWord: {
|
|
144
|
-
exportToWord: () => ReturnType;
|
|
173
|
+
exportToWord: (docState: any) => ReturnType;
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
declare module '@tiptap/core' {
|
|
180
|
+
interface Commands<ReturnType> {
|
|
181
|
+
excalidraw: {
|
|
182
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
145
183
|
};
|
|
146
184
|
}
|
|
147
185
|
}
|
|
@@ -166,10 +204,8 @@ declare module '@tiptap/core' {
|
|
|
166
204
|
|
|
167
205
|
|
|
168
206
|
declare module '@tiptap/core' {
|
|
169
|
-
interface
|
|
170
|
-
|
|
171
|
-
setPainter: (marks: Mark[]) => ReturnType;
|
|
172
|
-
};
|
|
207
|
+
interface Storage {
|
|
208
|
+
highlight: HighlightStorage;
|
|
173
209
|
}
|
|
174
210
|
}
|
|
175
211
|
|
|
@@ -254,16 +290,6 @@ declare module '@tiptap/core' {
|
|
|
254
290
|
}
|
|
255
291
|
|
|
256
292
|
|
|
257
|
-
declare module '@tiptap/core' {
|
|
258
|
-
interface Commands<ReturnType> {
|
|
259
|
-
lineHeight: {
|
|
260
|
-
setLineHeight: (lineHeight: string) => ReturnType;
|
|
261
|
-
unsetLineHeight: () => ReturnType;
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
|
|
267
293
|
declare module '@tiptap/core' {
|
|
268
294
|
interface Commands<ReturnType> {
|
|
269
295
|
mermaid: {
|
|
@@ -274,20 +300,6 @@ declare module '@tiptap/core' {
|
|
|
274
300
|
}
|
|
275
301
|
|
|
276
302
|
|
|
277
|
-
declare module '@tiptap/core' {
|
|
278
|
-
interface Commands<ReturnType> {
|
|
279
|
-
columns: {
|
|
280
|
-
insertColumns: (attrs?: {
|
|
281
|
-
cols: number;
|
|
282
|
-
}) => ReturnType;
|
|
283
|
-
addColBefore: () => ReturnType;
|
|
284
|
-
addColAfter: () => ReturnType;
|
|
285
|
-
deleteCol: () => ReturnType;
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
|
|
291
303
|
declare module '@tiptap/core' {
|
|
292
304
|
interface Commands<ReturnType> {
|
|
293
305
|
search: {
|
|
@@ -311,16 +323,6 @@ declare module '@tiptap/core' {
|
|
|
311
323
|
}
|
|
312
324
|
|
|
313
325
|
|
|
314
|
-
declare module '@tiptap/core' {
|
|
315
|
-
interface Commands<ReturnType> {
|
|
316
|
-
tableOfContents: {
|
|
317
|
-
setTableOfContents: () => ReturnType;
|
|
318
|
-
removeTableOfContents: () => ReturnType;
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
|
|
324
326
|
declare module '@tiptap/core' {
|
|
325
327
|
interface Commands<ReturnType> {
|
|
326
328
|
twitter: {
|