reactjs-tiptap-editor 1.0.24 → 1.0.26
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-HYlhmRvw.js → ActionMenuButton-B4KDkZ0z.js} +1 -1
- package/lib/{ActionMenuButton-B8NhVw5m.cjs → ActionMenuButton-C3Cfeza9.cjs} +1 -1
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.js +25 -25
- package/lib/Blockquote.cjs +5 -5
- package/lib/Blockquote.js +1490 -53
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +3 -3
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +2 -2
- package/lib/Callout.cjs +1 -1
- package/lib/Callout.js +222 -8
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +2 -2
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +56 -39
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.js +8 -4
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +2 -2
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +3 -3
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +2 -2
- package/lib/{Drawer-Was4hxYH.cjs → Drawer-D7E9kTca.cjs} +1 -1
- package/lib/{Drawer-CaXVhxo4.js → Drawer-DA0FLHs9.js} +20 -20
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +4 -4
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +1644 -148
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +10 -10
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.js +2 -2
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +2 -2
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +5 -5
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +5 -5
- package/lib/FormatPainter.cjs +1 -0
- package/lib/FormatPainter.js +133 -0
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +15 -11
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +38 -32
- package/lib/History.cjs +7 -1
- package/lib/History.js +519 -478
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +2 -2
- package/lib/{Iframe-Bp986fj0.js → Iframe-DZ3r3QzK.js} +7 -7
- package/lib/{Iframe-BI0sq6pd.cjs → Iframe-OMVd0xa_.cjs} +1 -1
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +3 -3
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +6 -6
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +35 -35
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.js +15 -15
- package/lib/{Indent-FvM52kjA.cjs → Indent-QgCoonRk.cjs} +1 -1
- package/lib/{Indent-E6B8DkyN.js → Indent-kI4G-clX.js} +2 -2
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +2 -2
- package/lib/{Katex-pzwyyiFJ.js → Katex-BPbXjcZQ.js} +6 -7
- package/lib/Katex-CUofhjB5.cjs +4 -0
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +3 -3
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +4 -4
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/{LinkEditBlock-OjN4F2rM.js → LinkEditBlock-BYWwH2_x.js} +59 -32
- package/lib/{LinkEditBlock-Cmkmp2fW.cjs → LinkEditBlock-Z7RRurvx.cjs} +2 -2
- package/lib/MarkdownPaste.cjs +1 -1
- package/lib/MarkdownPaste.js +1 -1
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.js +9 -5
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.js +61 -62
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +5 -5
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +2 -2
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +14 -14
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +7 -7
- package/lib/{SlashCommandNodeView-o323V8li.js → SlashCommandNodeView-C0l3Fb_3.js} +10 -10
- package/lib/{SlashCommandNodeView-DarAytvt.cjs → SlashCommandNodeView-DPPmYEjC.cjs} +1 -1
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +2 -2
- package/lib/{Table-Clnz-i4l.cjs → Table-D5G3rfwb.cjs} +5 -5
- package/lib/{Table-CC9uNHPL.js → Table-DwseaFSD.js} +115 -97
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +2 -2
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +11 -11
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +3 -3
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +2 -2
- package/lib/{Twitter-BVnXL8we.js → Twitter-DP26Lkn8.js} +195 -195
- package/lib/Twitter-q4ZGZL0i.cjs +1 -0
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +3 -3
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +5 -5
- package/lib/bubble.cjs +6 -6
- package/lib/bubble.js +2783 -2137
- package/lib/{clsx-D6gYQn3o.cjs → clsx-DRbkQ4T7.cjs} +1 -1
- package/lib/{clsx-0OU6n9va.js → clsx-_bq4MQQ7.js} +14 -4
- package/lib/components/Bubble/RichTextBubbleCallout.d.ts +1 -1
- package/lib/components/Bubble/RichTextBubbleCodeBlock.d.ts +1 -1
- package/lib/components/Bubble/RichTextBubbleColumns.d.ts +1 -1
- package/lib/components/Bubble/RichTextBubbleDrawer.d.ts +1 -1
- package/lib/components/Bubble/RichTextBubbleExcalidraw.d.ts +1 -1
- package/lib/components/Bubble/RichTextBubbleIframe.d.ts +1 -1
- package/lib/components/Bubble/RichTextBubbleKatex.d.ts +2 -1
- package/lib/components/Bubble/RichTextBubbleLink.d.ts +1 -1
- package/lib/components/Bubble/RichTextBubbleMedia.d.ts +3 -3
- package/lib/components/Bubble/RichTextBubbleMenuDragHandle.d.ts +2 -1
- package/lib/components/Bubble/RichTextBubbleMermaid.d.ts +1 -1
- package/lib/components/Bubble/RichTextBubbleTable.d.ts +1 -1
- package/lib/components/Bubble/RichTextBubbleText.d.ts +1 -1
- package/lib/components/Bubble/RichTextBubbleTwitter.d.ts +1 -1
- package/lib/components/ColorPicker.d.ts +1 -1
- package/lib/components/ReactBus.d.ts +1 -1
- package/lib/components/RichTextProvider.d.ts +1 -1
- package/lib/components/SlashDialogTrigger/RenderDialogUploadImage.d.ts +1 -1
- package/lib/components/SlashDialogTrigger/RenderDialogUploadVideo.d.ts +1 -1
- package/lib/components/SlashDialogTrigger/SlashDialogTrigger.d.ts +2 -1
- package/lib/components/icons/Activity.d.ts +2 -1
- package/lib/components/icons/Animas.d.ts +2 -1
- package/lib/components/icons/AspectRatio.d.ts +1 -1
- package/lib/components/icons/Blockquote.d.ts +1 -1
- package/lib/components/icons/CodeView.d.ts +1 -1
- package/lib/components/icons/ColumnAddLeft.d.ts +1 -1
- package/lib/components/icons/ColumnAddRight.d.ts +1 -1
- package/lib/components/icons/DeleteColumn.d.ts +1 -1
- package/lib/components/icons/DeleteRow.d.ts +1 -1
- package/lib/components/icons/Direction.d.ts +1 -1
- package/lib/components/icons/Excalidraw.d.ts +1 -1
- package/lib/components/icons/ExportPdf.d.ts +1 -1
- package/lib/components/icons/ExportWord.d.ts +2 -1
- package/lib/components/icons/FileWordOutline.d.ts +1 -1
- package/lib/components/icons/Flag.d.ts +2 -1
- package/lib/components/icons/Food.d.ts +2 -1
- package/lib/components/icons/GIfIcon.d.ts +1 -1
- package/lib/components/icons/Html.d.ts +1 -1
- package/lib/components/icons/Icon.d.ts +1 -1
- package/lib/components/icons/IconColorFill.d.ts +1 -1
- package/lib/components/icons/IconHighlightFill.d.ts +1 -1
- package/lib/components/icons/ImportWord.d.ts +2 -1
- package/lib/components/icons/LeftToRight.d.ts +1 -1
- package/lib/components/icons/LineHeight.d.ts +1 -1
- package/lib/components/icons/MenuDown.d.ts +1 -1
- package/lib/components/icons/Mermaid.d.ts +1 -1
- package/lib/components/icons/NoFill.d.ts +1 -1
- package/lib/components/icons/Object.d.ts +2 -1
- package/lib/components/icons/RightToLeft.d.ts +1 -1
- package/lib/components/icons/SizeL.d.ts +1 -1
- package/lib/components/icons/SizeM.d.ts +1 -1
- package/lib/components/icons/SizeS.d.ts +1 -1
- package/lib/components/icons/Symbol.d.ts +2 -1
- package/lib/components/icons/Travel.d.ts +2 -1
- package/lib/components/icons/Twitter.d.ts +1 -1
- package/lib/components/ui/dialog.d.ts +2 -2
- package/lib/components/ui/dropdown-menu.d.ts +1 -1
- package/lib/components/ui/emoji-picker.d.ts +4 -4
- package/lib/components/ui/toaster.d.ts +1 -1
- package/lib/{dropdown-menu-BW2M6saA.js → dropdown-menu-BKSX4gvT.js} +1 -1
- package/lib/{dropdown-menu-BIGvxqiu.cjs → dropdown-menu-CURWpB9o.cjs} +1 -1
- package/lib/extensions/Attachment/components/NodeViewAttachment/FileIcon.d.ts +1 -1
- package/lib/extensions/Attachment/components/NodeViewAttachment/NodeViewAttachment.d.ts +1 -1
- package/lib/extensions/Attachment/components/RichTextAttachment.d.ts +1 -1
- package/lib/extensions/Blockquote/components/RichTextBlockquote.d.ts +1 -1
- package/lib/extensions/Bold/components/RichTextBold.d.ts +1 -1
- package/lib/extensions/BulletList/components/RichTextBulletList.d.ts +1 -1
- package/lib/extensions/Callout/components/NodeViewCallout/NodeViewCallout.d.ts +1 -1
- package/lib/extensions/Callout/components/RichTextCallout.d.ts +1 -1
- package/lib/extensions/Clear/components/RichTextClear.d.ts +1 -1
- package/lib/extensions/Code/components/RichTextCode.d.ts +1 -1
- package/lib/extensions/CodeBlock/components/RichTextCodeBlock.d.ts +2 -1
- package/lib/extensions/CodeView/components/RichTextCodeView.d.ts +1 -1
- package/lib/extensions/Color/components/RichTextColor.d.ts +1 -1
- package/lib/extensions/Column/components/RichTextColumn.d.ts +1 -1
- package/lib/extensions/Drawer/components/ControlDrawer/ControlDrawer.d.ts +2 -1
- package/lib/extensions/Drawer/components/ControlDrawer/icon.d.ts +27 -27
- package/lib/extensions/Drawer/components/EditDrawerBlock.d.ts +1 -1
- package/lib/extensions/Drawer/components/NodeViewDrawer/NodeViewDrawer.d.ts +2 -1
- package/lib/extensions/Drawer/components/RichTextDrawer.d.ts +1 -1
- package/lib/extensions/Emoji/components/RichTextEmoji.d.ts +2 -1
- package/lib/extensions/Excalidraw/components/NodeViewExcalidraw/NodeViewExcalidraw.d.ts +2 -1
- package/lib/extensions/Excalidraw/components/RichTextExcalidraw.d.ts +1 -1
- package/lib/extensions/ExportPdf/components/RichTextExportPdf.d.ts +1 -1
- package/lib/extensions/ExportWord/components/RichTextExportWord.d.ts +1 -1
- package/lib/extensions/FontFamily/components/RichTextFontFamily.d.ts +1 -1
- package/lib/extensions/FontSize/components/RichTextFontSize.d.ts +1 -1
- package/lib/extensions/FormatPainter/FormatPainter.d.ts +17 -0
- package/lib/extensions/FormatPainter/components/RichTextFormatPainter.d.ts +1 -0
- package/lib/extensions/FormatPainter/index.d.ts +1 -0
- package/lib/extensions/Heading/components/RichTextHeading.d.ts +1 -1
- package/lib/extensions/Highlight/components/RichTextHighlight.d.ts +2 -1
- package/lib/extensions/History/components/RichTextHistory.d.ts +3 -2
- package/lib/extensions/HorizontalRule/components/RichTextHorizontalRule.d.ts +1 -1
- package/lib/extensions/Iframe/components/IframeNodeView.d.ts +1 -1
- package/lib/extensions/Iframe/components/RichTextIframe.d.ts +1 -1
- package/lib/extensions/Image/components/ImageCropper.d.ts +2 -1
- package/lib/extensions/Image/components/ImageView.d.ts +2 -1
- package/lib/extensions/Image/components/RichTextImage.d.ts +1 -1
- package/lib/extensions/ImageGif/components/ImageGifView.d.ts +2 -1
- package/lib/extensions/ImageGif/components/RichTextImageGif.d.ts +2 -1
- package/lib/extensions/ImportWord/components/RichTextImportWord.d.ts +1 -1
- package/lib/extensions/Indent/components/RichTextIndent.d.ts +1 -1
- package/lib/extensions/Italic/components/RichTextItalic.d.ts +1 -1
- package/lib/extensions/Katex/components/KatexWrapper.d.ts +1 -1
- package/lib/extensions/Katex/components/RichTextKatex.d.ts +1 -1
- package/lib/extensions/LineHeight/components/RichTextLightHeight.d.ts +1 -1
- package/lib/extensions/Link/components/LinkEditBlock.d.ts +1 -1
- package/lib/extensions/Link/components/LinkViewBlock.d.ts +2 -1
- package/lib/extensions/Link/components/RichTextLink.d.ts +1 -1
- package/lib/extensions/Mermaid/components/NodeViewMermaid/NodeViewMermaid.d.ts +2 -1
- package/lib/extensions/Mermaid/components/RichTextMermaid.d.ts +1 -1
- package/lib/extensions/MoreMark/components/RichTextMoreMark.d.ts +1 -1
- package/lib/extensions/OrderedList/components/RichTextOrderedList.d.ts +1 -1
- package/lib/extensions/SearchAndReplace/components/RichTextSearchAndReplace.d.ts +1 -1
- package/lib/extensions/SlashCommand/components/SlashCommandList.d.ts +1 -1
- package/lib/extensions/Strike/components/RichTextStrike.d.ts +1 -1
- package/lib/extensions/Table/components/CreateTablePopover.d.ts +2 -1
- package/lib/extensions/Table/components/RichTextTable.d.ts +2 -1
- package/lib/extensions/TaskList/components/RichTextTaskList.d.ts +1 -1
- package/lib/extensions/TextAlign/components/RichTextAlign.d.ts +1 -1
- package/lib/extensions/TextDirection/components/RichTextTextDirection.d.ts +1 -1
- package/lib/extensions/TextUnderline/components/RichTextUnderline.d.ts +1 -1
- package/lib/extensions/Twitter/components/FormEditLinkTwitter.d.ts +1 -1
- package/lib/extensions/Twitter/components/NodeViewTweet.d.ts +1 -1
- package/lib/extensions/Twitter/components/RichTextTwitter.d.ts +1 -1
- package/lib/extensions/Video/components/RichTextVideo.d.ts +1 -1
- package/lib/index-BGfIcDCQ.cjs +26 -0
- package/lib/index-BaR0Brts.js +1115 -0
- package/lib/index-BgNKVyMW.cjs +2 -0
- package/lib/index-BpLw6ebr.cjs +1 -0
- package/lib/{index-BrsJsbds.js → index-C52cuQ_Y.js} +1503 -1352
- package/lib/index-CDw4Eszh.cjs +12 -0
- package/lib/{index-CUvjYuRp.cjs → index-CHVV5iY-.cjs} +1 -1
- package/lib/{index-zw-Kd38i.js → index-CJMI7Fjf.js} +1 -1
- package/lib/{index-D-Ouz0vF.js → index-DQy9iBzV.js} +1 -1
- package/lib/index-Dbm_Mans.js +1756 -0
- package/lib/{index-oj858lQO.js → index-DtyAGMbq.js} +208 -208
- package/lib/{index-BblvcbTH.js → index-Dx-Dh7KS.js} +1464 -1348
- package/lib/{index-BAb_UADw.cjs → index-SEMQrdk2.cjs} +1 -1
- package/lib/index-aujjnfSJ.cjs +1 -0
- package/lib/index.cjs +1 -1
- package/lib/index.js +12 -12
- package/lib/{jsx-runtime-CT7Pcg-t.js → jsx-runtime-DE8oVoME.js} +3 -1
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.js +1 -1
- package/lib/locales/index.d.ts +1 -1
- package/lib/{popover-BIVHT1W9.js → popover-BB-ZDnqk.js} +1 -1
- package/lib/{popover-DoSfJsFS.cjs → popover-CrywEkBR.cjs} +1 -1
- package/lib/{renderNodeView-D--fDFov.cjs → renderNodeView-5h3-p80E.cjs} +1 -1
- package/lib/{renderNodeView-CfWJK4rG.js → renderNodeView-DoKZ4GYy.js} +2 -2
- package/lib/{separator-SRbPfmGa.cjs → separator-BGO9AZp4.cjs} +1 -1
- package/lib/{separator-b-qOPJmp.js → separator-DuuOJRQd.js} +21 -21
- package/lib/store/EditorEditableReactive.d.ts +1 -1
- package/lib/store/ThemeColorReactive.d.ts +1 -1
- package/lib/style.css +1 -1
- package/lib/types.d.ts +2 -2
- package/lib/{updatePosition-DGPtRfWN.cjs → updatePosition-B1oRJE1x.cjs} +1 -1
- package/lib/{updatePosition-BwzAsiY0.js → updatePosition-CFTYKYNJ.js} +2 -2
- package/package.json +79 -66
- package/lib/Callout-B-S2f0Qo.cjs +0 -1
- package/lib/Callout-CF7Y9yJ7.js +0 -340
- package/lib/Katex-DP6EjdKz.cjs +0 -4
- package/lib/Twitter-0kmrijjL.cjs +0 -1
- package/lib/index-BF3EVCB1.cjs +0 -2
- package/lib/index-Bcj8cyOO.cjs +0 -24
- package/lib/index-CGjT-a9h.js +0 -1377
- package/lib/index-CPTpXLfX.cjs +0 -11
- package/lib/index-CWw4s87s.cjs +0 -1
- package/lib/index-Cal5SPfB.js +0 -779
- package/lib/index-deubsx3z.cjs +0 -1
- package/lib/textarea-CpxXPky_.js +0 -20
- package/lib/textarea-DbGw9oCU.cjs +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Q as ue, S as z,
|
|
1
|
+
import { Q as ue, S as z, Y as Xe, T as W, F as v, v as L, O as Ee, u as Ue, Z as Ge, N as Y, m as I, U as qe, V as Ze, E as ze, _ as Je } from "./index-Dx-Dh7KS.js";
|
|
2
2
|
import { TextSelection as Ye } from "@tiptap/pm/state";
|
|
3
|
-
import { k as Qe, D as oe, a as le } from "./index-
|
|
4
|
-
import { jsxs as te, jsx as
|
|
5
|
-
import { h as tt, u as nt, d as ot, A as lt } from "./index-
|
|
6
|
-
import { useState as
|
|
3
|
+
import { k as Qe, D as oe, a as le } from "./index-DQy9iBzV.js";
|
|
4
|
+
import { jsxs as te, jsx as E, Fragment as et } from "react/jsx-runtime";
|
|
5
|
+
import { h as tt, u as nt, d as ot, A as lt } from "./index-C52cuQ_Y.js";
|
|
6
|
+
import { useState as O } from "react";
|
|
7
7
|
import "./theme.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { P as rt, a as st, b as it } from "./popover-BB-ZDnqk.js";
|
|
9
|
+
import { T as F, m as j, n as V } from "./index-DtyAGMbq.js";
|
|
10
10
|
let re, se;
|
|
11
11
|
if (typeof WeakMap < "u") {
|
|
12
12
|
let t = /* @__PURE__ */ new WeakMap();
|
|
@@ -264,7 +264,7 @@ function mt(t, e, n) {
|
|
|
264
264
|
for (let l = 0; l < t.height; l++) if (e.nodeAt(t.map[n + l * t.width]).type != o) return !1;
|
|
265
265
|
return !0;
|
|
266
266
|
}
|
|
267
|
-
var w = class
|
|
267
|
+
var w = class k extends z {
|
|
268
268
|
constructor(e, n = e) {
|
|
269
269
|
const o = e.node(-1), l = C.get(o), r = e.start(-1), s = l.rectBetween(e.pos - r, n.pos - r), i = e.node(0), c = l.cellsInRect(s).filter((d) => d != n.pos - r);
|
|
270
270
|
c.unshift(n.pos - r);
|
|
@@ -280,7 +280,7 @@ var w = class E extends z {
|
|
|
280
280
|
const o = e.resolve(n.map(this.$anchorCell.pos)), l = e.resolve(n.map(this.$headCell.pos));
|
|
281
281
|
if (ie(o) && ie(l) && fe(o, l)) {
|
|
282
282
|
const r = this.$anchorCell.node(-1) != o.node(-1);
|
|
283
|
-
return r && this.isRowSelection() ?
|
|
283
|
+
return r && this.isRowSelection() ? k.rowSelection(o, l) : r && this.isColSelection() ? k.colSelection(o, l) : new k(o, l);
|
|
284
284
|
}
|
|
285
285
|
return W.between(o, l);
|
|
286
286
|
}
|
|
@@ -340,7 +340,7 @@ var w = class E extends z {
|
|
|
340
340
|
}
|
|
341
341
|
static colSelection(e, n = e) {
|
|
342
342
|
const o = e.node(-1), l = C.get(o), r = e.start(-1), s = l.findCell(e.pos - r), i = l.findCell(n.pos - r), c = e.node(0);
|
|
343
|
-
return s.top <= i.top ? (s.top > 0 && (e = c.resolve(r + l.map[s.left])), i.bottom < l.height && (n = c.resolve(r + l.map[l.width * (l.height - 1) + i.right - 1]))) : (i.top > 0 && (n = c.resolve(r + l.map[i.left])), s.bottom < l.height && (e = c.resolve(r + l.map[l.width * (l.height - 1) + s.right - 1]))), new
|
|
343
|
+
return s.top <= i.top ? (s.top > 0 && (e = c.resolve(r + l.map[s.left])), i.bottom < l.height && (n = c.resolve(r + l.map[l.width * (l.height - 1) + i.right - 1]))) : (i.top > 0 && (n = c.resolve(r + l.map[i.left])), s.bottom < l.height && (e = c.resolve(r + l.map[l.width * (l.height - 1) + s.right - 1]))), new k(e, n);
|
|
344
344
|
}
|
|
345
345
|
isRowSelection() {
|
|
346
346
|
const e = this.$anchorCell.node(-1), n = C.get(e), o = this.$anchorCell.start(-1), l = n.colCount(this.$anchorCell.pos - o), r = n.colCount(this.$headCell.pos - o);
|
|
@@ -349,11 +349,11 @@ var w = class E extends z {
|
|
|
349
349
|
return Math.max(s, i) == n.width;
|
|
350
350
|
}
|
|
351
351
|
eq(e) {
|
|
352
|
-
return e instanceof
|
|
352
|
+
return e instanceof k && e.$anchorCell.pos == this.$anchorCell.pos && e.$headCell.pos == this.$headCell.pos;
|
|
353
353
|
}
|
|
354
354
|
static rowSelection(e, n = e) {
|
|
355
355
|
const o = e.node(-1), l = C.get(o), r = e.start(-1), s = l.findCell(e.pos - r), i = l.findCell(n.pos - r), c = e.node(0);
|
|
356
|
-
return s.left <= i.left ? (s.left > 0 && (e = c.resolve(r + l.map[s.top * l.width])), i.right < l.width && (n = c.resolve(r + l.map[l.width * (i.top + 1) - 1]))) : (i.left > 0 && (n = c.resolve(r + l.map[i.top * l.width])), s.right < l.width && (e = c.resolve(r + l.map[l.width * (s.top + 1) - 1]))), new
|
|
356
|
+
return s.left <= i.left ? (s.left > 0 && (e = c.resolve(r + l.map[s.top * l.width])), i.right < l.width && (n = c.resolve(r + l.map[l.width * (i.top + 1) - 1]))) : (i.left > 0 && (n = c.resolve(r + l.map[i.top * l.width])), s.right < l.width && (e = c.resolve(r + l.map[l.width * (s.top + 1) - 1]))), new k(e, n);
|
|
357
357
|
}
|
|
358
358
|
toJSON() {
|
|
359
359
|
return {
|
|
@@ -363,10 +363,10 @@ var w = class E extends z {
|
|
|
363
363
|
};
|
|
364
364
|
}
|
|
365
365
|
static fromJSON(e, n) {
|
|
366
|
-
return new
|
|
366
|
+
return new k(e.resolve(n.anchor), e.resolve(n.head));
|
|
367
367
|
}
|
|
368
368
|
static create(e, n, o = n) {
|
|
369
|
-
return new
|
|
369
|
+
return new k(e.resolve(n), e.resolve(o));
|
|
370
370
|
}
|
|
371
371
|
getBookmark() {
|
|
372
372
|
return new gt(this.$anchorCell.pos, this.$headCell.pos);
|
|
@@ -604,7 +604,7 @@ function Nt(t, e) {
|
|
|
604
604
|
}
|
|
605
605
|
return !0;
|
|
606
606
|
}
|
|
607
|
-
function
|
|
607
|
+
function kt(t, e) {
|
|
608
608
|
if (!R(t)) return !1;
|
|
609
609
|
if (e) {
|
|
610
610
|
const n = M(t);
|
|
@@ -612,7 +612,7 @@ function Et(t, e) {
|
|
|
612
612
|
}
|
|
613
613
|
return !0;
|
|
614
614
|
}
|
|
615
|
-
function
|
|
615
|
+
function Et(t, { map: e, table: n, tableStart: o }, l) {
|
|
616
616
|
let r = 0;
|
|
617
617
|
for (let a = 0; a < l; a++) r += n.child(a).nodeSize;
|
|
618
618
|
const s = r + n.child(l).nodeSize, i = t.mapping.maps.length;
|
|
@@ -642,7 +642,7 @@ function zt(t, e) {
|
|
|
642
642
|
if (e) {
|
|
643
643
|
const n = M(t), o = t.tr;
|
|
644
644
|
if (n.top == 0 && n.bottom == n.map.height) return !1;
|
|
645
|
-
for (let l = n.bottom - 1;
|
|
645
|
+
for (let l = n.bottom - 1; Et(o, n, l), l != n.top; l--) {
|
|
646
646
|
const r = n.tableStart ? o.doc.nodeAt(n.tableStart - 1) : o.doc;
|
|
647
647
|
if (!r) throw new RangeError("No table found");
|
|
648
648
|
n.table = r, n.map = C.get(n.table);
|
|
@@ -805,7 +805,7 @@ function ge(t, e, n) {
|
|
|
805
805
|
}
|
|
806
806
|
return !0;
|
|
807
807
|
}
|
|
808
|
-
function
|
|
808
|
+
function P(t, e) {
|
|
809
809
|
return e = e || { useDeprecatedLogic: !1 }, e.useDeprecatedLogic ? Wt(t) : function(n, o) {
|
|
810
810
|
if (!R(n)) return !1;
|
|
811
811
|
if (o) {
|
|
@@ -828,9 +828,9 @@ function I(t, e) {
|
|
|
828
828
|
return !0;
|
|
829
829
|
};
|
|
830
830
|
}
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
const Dt =
|
|
831
|
+
P("row", { useDeprecatedLogic: !0 });
|
|
832
|
+
P("column", { useDeprecatedLogic: !0 });
|
|
833
|
+
const Dt = P("cell", { useDeprecatedLogic: !0 });
|
|
834
834
|
function Bt(t, e) {
|
|
835
835
|
if (e < 0) {
|
|
836
836
|
const n = t.nodeBefore;
|
|
@@ -869,7 +869,7 @@ function _t(t, e) {
|
|
|
869
869
|
return e && e(t.tr.delete(n.before(o), n.after(o)).scrollIntoView()), !0;
|
|
870
870
|
return !1;
|
|
871
871
|
}
|
|
872
|
-
function
|
|
872
|
+
function K(t, e) {
|
|
873
873
|
const n = t.selection;
|
|
874
874
|
if (!(n instanceof w)) return !1;
|
|
875
875
|
if (e) {
|
|
@@ -1031,39 +1031,39 @@ function ye(t, e, n, o, l) {
|
|
|
1031
1031
|
h(), u.setSelection(new w(u.doc.resolve(n + s.positionAt(i, c, r)), u.doc.resolve(n + s.positionAt(d - 1, a - 1, r)))), e(u);
|
|
1032
1032
|
}
|
|
1033
1033
|
const jt = Qe({
|
|
1034
|
-
ArrowLeft:
|
|
1035
|
-
ArrowRight:
|
|
1036
|
-
ArrowUp:
|
|
1037
|
-
ArrowDown:
|
|
1038
|
-
"Shift-ArrowLeft":
|
|
1039
|
-
"Shift-ArrowRight":
|
|
1040
|
-
"Shift-ArrowUp":
|
|
1041
|
-
"Shift-ArrowDown":
|
|
1042
|
-
Backspace:
|
|
1043
|
-
"Mod-Backspace":
|
|
1044
|
-
Delete:
|
|
1045
|
-
"Mod-Delete":
|
|
1034
|
+
ArrowLeft: X("horiz", -1),
|
|
1035
|
+
ArrowRight: X("horiz", 1),
|
|
1036
|
+
ArrowUp: X("vert", -1),
|
|
1037
|
+
ArrowDown: X("vert", 1),
|
|
1038
|
+
"Shift-ArrowLeft": U("horiz", -1),
|
|
1039
|
+
"Shift-ArrowRight": U("horiz", 1),
|
|
1040
|
+
"Shift-ArrowUp": U("vert", -1),
|
|
1041
|
+
"Shift-ArrowDown": U("vert", 1),
|
|
1042
|
+
Backspace: K,
|
|
1043
|
+
"Mod-Backspace": K,
|
|
1044
|
+
Delete: K,
|
|
1045
|
+
"Mod-Delete": K
|
|
1046
1046
|
});
|
|
1047
|
-
function
|
|
1047
|
+
function q(t, e, n) {
|
|
1048
1048
|
return n.eq(t.selection) ? !1 : (e && e(t.tr.setSelection(n).scrollIntoView()), !0);
|
|
1049
1049
|
}
|
|
1050
|
-
function
|
|
1050
|
+
function X(t, e) {
|
|
1051
1051
|
return (n, o, l) => {
|
|
1052
1052
|
if (!l) return !1;
|
|
1053
1053
|
const r = n.selection;
|
|
1054
|
-
if (r instanceof w) return
|
|
1054
|
+
if (r instanceof w) return q(n, o, z.near(r.$headCell, e));
|
|
1055
1055
|
if (t != "horiz" && !r.empty) return !1;
|
|
1056
1056
|
const s = Ie(l, t, e);
|
|
1057
1057
|
if (s == null) return !1;
|
|
1058
|
-
if (t == "horiz") return
|
|
1058
|
+
if (t == "horiz") return q(n, o, z.near(n.doc.resolve(r.head + e), e));
|
|
1059
1059
|
{
|
|
1060
1060
|
const i = n.doc.resolve(s), c = He(i, t, e);
|
|
1061
1061
|
let a;
|
|
1062
|
-
return c ? a = z.near(c, 1) : e < 0 ? a = z.near(n.doc.resolve(i.before(-1)), -1) : a = z.near(n.doc.resolve(i.after(-1)), 1),
|
|
1062
|
+
return c ? a = z.near(c, 1) : e < 0 ? a = z.near(n.doc.resolve(i.before(-1)), -1) : a = z.near(n.doc.resolve(i.after(-1)), 1), q(n, o, a);
|
|
1063
1063
|
}
|
|
1064
1064
|
};
|
|
1065
1065
|
}
|
|
1066
|
-
function
|
|
1066
|
+
function U(t, e) {
|
|
1067
1067
|
return (n, o, l) => {
|
|
1068
1068
|
if (!l) return !1;
|
|
1069
1069
|
const r = n.selection;
|
|
@@ -1075,7 +1075,7 @@ function X(t, e) {
|
|
|
1075
1075
|
s = new w(n.doc.resolve(c));
|
|
1076
1076
|
}
|
|
1077
1077
|
const i = He(s.$headCell, t, e);
|
|
1078
|
-
return i ?
|
|
1078
|
+
return i ? q(n, o, new w(s.$anchorCell, i)) : !1;
|
|
1079
1079
|
};
|
|
1080
1080
|
}
|
|
1081
1081
|
function Vt(t, e) {
|
|
@@ -1196,7 +1196,7 @@ function ae(t, e, n, o, l, r) {
|
|
|
1196
1196
|
}
|
|
1197
1197
|
const x = new ue("tableColumnResizing");
|
|
1198
1198
|
function Gt({ handleWidth: t = 5, cellMinWidth: e = 25, defaultCellMinWidth: n = 100, View: o = Ut, lastColumnResizable: l = !0 } = {}) {
|
|
1199
|
-
const r = new
|
|
1199
|
+
const r = new Ee({
|
|
1200
1200
|
key: x,
|
|
1201
1201
|
state: {
|
|
1202
1202
|
init(s, i) {
|
|
@@ -1233,17 +1233,17 @@ function Gt({ handleWidth: t = 5, cellMinWidth: e = 25, defaultCellMinWidth: n =
|
|
|
1233
1233
|
});
|
|
1234
1234
|
return r;
|
|
1235
1235
|
}
|
|
1236
|
-
var qt = class
|
|
1236
|
+
var qt = class Z {
|
|
1237
1237
|
constructor(e, n) {
|
|
1238
1238
|
this.activeHandle = e, this.dragging = n;
|
|
1239
1239
|
}
|
|
1240
1240
|
apply(e) {
|
|
1241
1241
|
const n = this, o = e.getMeta(x);
|
|
1242
|
-
if (o && o.setHandle != null) return new
|
|
1243
|
-
if (o && o.setDragging !== void 0) return new
|
|
1242
|
+
if (o && o.setHandle != null) return new Z(o.setHandle, !1);
|
|
1243
|
+
if (o && o.setDragging !== void 0) return new Z(n.activeHandle, o.setDragging);
|
|
1244
1244
|
if (n.activeHandle > -1 && e.docChanged) {
|
|
1245
1245
|
let l = e.mapping.map(n.activeHandle, -1);
|
|
1246
|
-
return ie(e.doc.resolve(l)) || (l = -1), new
|
|
1246
|
+
return ie(e.doc.resolve(l)) || (l = -1), new Z(l, n.dragging);
|
|
1247
1247
|
}
|
|
1248
1248
|
return n;
|
|
1249
1249
|
}
|
|
@@ -1368,7 +1368,7 @@ function on(t, e) {
|
|
|
1368
1368
|
return oe.create(t.doc, n);
|
|
1369
1369
|
}
|
|
1370
1370
|
function ln({ allowTableNodeSelection: t = !1 } = {}) {
|
|
1371
|
-
return new
|
|
1371
|
+
return new Ee({
|
|
1372
1372
|
key: H,
|
|
1373
1373
|
state: {
|
|
1374
1374
|
init() {
|
|
@@ -1397,15 +1397,15 @@ function ln({ allowTableNodeSelection: t = !1 } = {}) {
|
|
|
1397
1397
|
}
|
|
1398
1398
|
});
|
|
1399
1399
|
}
|
|
1400
|
-
function
|
|
1400
|
+
function J(t) {
|
|
1401
1401
|
return t === "left" || t === "right" || t === "center" ? t : null;
|
|
1402
1402
|
}
|
|
1403
1403
|
function rn(t) {
|
|
1404
1404
|
const e = (t.style.textAlign || "").trim().toLowerCase(), n = (t.getAttribute("align") || "").trim().toLowerCase();
|
|
1405
|
-
return
|
|
1405
|
+
return J(e || n);
|
|
1406
1406
|
}
|
|
1407
1407
|
function sn(t) {
|
|
1408
|
-
return
|
|
1408
|
+
return J(t == null ? void 0 : t.align);
|
|
1409
1409
|
}
|
|
1410
1410
|
function Oe() {
|
|
1411
1411
|
return {
|
|
@@ -1416,7 +1416,7 @@ function Oe() {
|
|
|
1416
1416
|
} : {}
|
|
1417
1417
|
};
|
|
1418
1418
|
}
|
|
1419
|
-
var Fe =
|
|
1419
|
+
var Fe = Y.create({
|
|
1420
1420
|
name: "tableCell",
|
|
1421
1421
|
addOptions() {
|
|
1422
1422
|
return {
|
|
@@ -1456,9 +1456,9 @@ var Fe = J.create({
|
|
|
1456
1456
|
return [{ tag: "td" }];
|
|
1457
1457
|
},
|
|
1458
1458
|
renderHTML({ HTMLAttributes: t }) {
|
|
1459
|
-
return ["td",
|
|
1459
|
+
return ["td", I(this.options.HTMLAttributes, t), 0];
|
|
1460
1460
|
}
|
|
1461
|
-
}), je =
|
|
1461
|
+
}), je = Y.create({
|
|
1462
1462
|
name: "tableHeader",
|
|
1463
1463
|
addOptions() {
|
|
1464
1464
|
return {
|
|
@@ -1490,9 +1490,9 @@ var Fe = J.create({
|
|
|
1490
1490
|
return [{ tag: "th" }];
|
|
1491
1491
|
},
|
|
1492
1492
|
renderHTML({ HTMLAttributes: t }) {
|
|
1493
|
-
return ["th",
|
|
1493
|
+
return ["th", I(this.options.HTMLAttributes, t), 0];
|
|
1494
1494
|
}
|
|
1495
|
-
}), Ve =
|
|
1495
|
+
}), Ve = Y.create({
|
|
1496
1496
|
name: "tableRow",
|
|
1497
1497
|
addOptions() {
|
|
1498
1498
|
return {
|
|
@@ -1505,7 +1505,7 @@ var Fe = J.create({
|
|
|
1505
1505
|
return [{ tag: "tr" }];
|
|
1506
1506
|
},
|
|
1507
1507
|
renderHTML({ HTMLAttributes: t }) {
|
|
1508
|
-
return ["tr",
|
|
1508
|
+
return ["tr", I(this.options.HTMLAttributes, t), 0];
|
|
1509
1509
|
}
|
|
1510
1510
|
});
|
|
1511
1511
|
function de(t, e) {
|
|
@@ -1540,8 +1540,11 @@ function Re(t, e, n, o, l, r) {
|
|
|
1540
1540
|
c && !u ? (n.style.width = `${i}px`, n.style.minWidth = "") : (n.style.width = "", n.style.minWidth = `${i}px`);
|
|
1541
1541
|
}
|
|
1542
1542
|
var cn = class {
|
|
1543
|
-
constructor(t, e) {
|
|
1544
|
-
this.node = t, this.cellMinWidth = e, this.dom = document.createElement("div"), this.dom.className = "tableWrapper", this.table = this.dom.appendChild(document.createElement("table"))
|
|
1543
|
+
constructor(t, e, n, o = {}) {
|
|
1544
|
+
this.node = t, this.cellMinWidth = e, this.dom = document.createElement("div"), this.dom.className = "tableWrapper", this.table = this.dom.appendChild(document.createElement("table"));
|
|
1545
|
+
for (const [l, r] of Object.entries(o))
|
|
1546
|
+
r != null && (l === "style" ? this.table.style.cssText = String(r) : this.table.setAttribute(l, String(r)));
|
|
1547
|
+
t.attrs.style && (this.table.style.cssText = t.attrs.style), this.colgroup = this.table.appendChild(document.createElement("colgroup")), Re(t, this.colgroup, this.table, e), this.contentDOM = this.table.appendChild(document.createElement("tbody"));
|
|
1545
1548
|
}
|
|
1546
1549
|
update(t) {
|
|
1547
1550
|
return t.type !== this.node.type ? !1 : (this.node = t, Re(t, this.colgroup, this.table, this.cellMinWidth), !0);
|
|
@@ -1597,7 +1600,7 @@ function un(t, e, n, o, l) {
|
|
|
1597
1600
|
function fn(t) {
|
|
1598
1601
|
return t instanceof w;
|
|
1599
1602
|
}
|
|
1600
|
-
var
|
|
1603
|
+
var G = ({ editor: t }) => {
|
|
1601
1604
|
const { selection: e } = t.state;
|
|
1602
1605
|
if (!fn(e))
|
|
1603
1606
|
return !1;
|
|
@@ -1622,7 +1625,9 @@ function mn(t, e, n = {}) {
|
|
|
1622
1625
|
const b = [];
|
|
1623
1626
|
m.content && m.content.forEach((g) => {
|
|
1624
1627
|
let y = "";
|
|
1625
|
-
g.content && Array.isArray(g.content) && g.content.length > 1 ? y = g.content.map(
|
|
1628
|
+
g.content && Array.isArray(g.content) && g.content.length > 1 ? y = g.content.map(
|
|
1629
|
+
($) => e.renderChildren($)
|
|
1630
|
+
).join(l) : y = g.content ? e.renderChildren(g.content) : "";
|
|
1626
1631
|
const S = pn(y), N = g.type === "tableHeader", T = sn(g.attrs);
|
|
1627
1632
|
b.push({ text: S, isHeader: N, align: T });
|
|
1628
1633
|
}), r.push(b);
|
|
@@ -1630,7 +1635,7 @@ function mn(t, e, n = {}) {
|
|
|
1630
1635
|
const s = r.reduce((m, b) => Math.max(m, b.length), 0);
|
|
1631
1636
|
if (s === 0)
|
|
1632
1637
|
return "";
|
|
1633
|
-
const i =
|
|
1638
|
+
const i = Array.from({ length: s }).fill(0);
|
|
1634
1639
|
r.forEach((m) => {
|
|
1635
1640
|
var b;
|
|
1636
1641
|
for (let g = 0; g < s; g += 1) {
|
|
@@ -1638,7 +1643,9 @@ function mn(t, e, n = {}) {
|
|
|
1638
1643
|
S > i[g] && (i[g] = S), i[g] < 3 && (i[g] = 3);
|
|
1639
1644
|
}
|
|
1640
1645
|
});
|
|
1641
|
-
const c = (m, b) => m + " ".repeat(Math.max(0, b - m.length)), a = r[0], d = a.some((m) => m.isHeader), u =
|
|
1646
|
+
const c = (m, b) => m + " ".repeat(Math.max(0, b - m.length)), a = r[0], d = a.some((m) => m.isHeader), u = Array.from({
|
|
1647
|
+
length: s
|
|
1648
|
+
}).fill(null);
|
|
1642
1649
|
r.forEach((m) => {
|
|
1643
1650
|
var b;
|
|
1644
1651
|
for (let g = 0; g < s; g += 1)
|
|
@@ -1646,18 +1653,20 @@ function mn(t, e, n = {}) {
|
|
|
1646
1653
|
});
|
|
1647
1654
|
let f = `
|
|
1648
1655
|
`;
|
|
1649
|
-
const h =
|
|
1656
|
+
const h = Array.from({ length: s }).map(
|
|
1657
|
+
(m, b) => d && a[b] && a[b].text || ""
|
|
1658
|
+
);
|
|
1650
1659
|
return f += `| ${h.map((m, b) => c(m, i[b])).join(" | ")} |
|
|
1651
1660
|
`, f += `| ${i.map((m, b) => {
|
|
1652
1661
|
const g = Math.max(3, m), y = u[b];
|
|
1653
1662
|
return y === "left" ? `:${"-".repeat(g)}` : y === "right" ? `${"-".repeat(g)}:` : y === "center" ? `:${"-".repeat(g)}:` : "-".repeat(g);
|
|
1654
1663
|
}).join(" | ")} |
|
|
1655
1664
|
`, (d ? r.slice(1) : r).forEach((m) => {
|
|
1656
|
-
f += `| ${
|
|
1665
|
+
f += `| ${Array.from({ length: s }).fill(0).map((b, g) => c(m[g] && m[g].text || "", i[g])).join(" | ")} |
|
|
1657
1666
|
`;
|
|
1658
1667
|
}), f;
|
|
1659
1668
|
}
|
|
1660
|
-
var gn = mn, Ke =
|
|
1669
|
+
var gn = mn, Ke = Y.create({
|
|
1661
1670
|
name: "table",
|
|
1662
1671
|
// @ts-ignore
|
|
1663
1672
|
addOptions() {
|
|
@@ -1687,7 +1696,7 @@ var gn = mn, Ke = J.create({
|
|
|
1687
1696
|
}
|
|
1688
1697
|
const i = [
|
|
1689
1698
|
"table",
|
|
1690
|
-
|
|
1699
|
+
I(this.options.HTMLAttributes, e, {
|
|
1691
1700
|
style: s()
|
|
1692
1701
|
}),
|
|
1693
1702
|
n,
|
|
@@ -1701,9 +1710,11 @@ var gn = mn, Ke = J.create({
|
|
|
1701
1710
|
const l = [];
|
|
1702
1711
|
t.header.forEach((r, s) => {
|
|
1703
1712
|
var i;
|
|
1704
|
-
const c =
|
|
1713
|
+
const c = J((i = o[s]) != null ? i : r.align), a = c ? { align: c } : {};
|
|
1705
1714
|
l.push(
|
|
1706
|
-
e.createNode("tableHeader", a, [
|
|
1715
|
+
e.createNode("tableHeader", a, [
|
|
1716
|
+
{ type: "paragraph", content: e.parseInline(r.tokens) }
|
|
1717
|
+
])
|
|
1707
1718
|
);
|
|
1708
1719
|
}), n.push(e.createNode("tableRow", {}, l));
|
|
1709
1720
|
}
|
|
@@ -1711,8 +1722,12 @@ var gn = mn, Ke = J.create({
|
|
|
1711
1722
|
const r = [];
|
|
1712
1723
|
l.forEach((s, i) => {
|
|
1713
1724
|
var c;
|
|
1714
|
-
const a =
|
|
1715
|
-
r.push(
|
|
1725
|
+
const a = J((c = o[i]) != null ? c : s.align), d = a ? { align: a } : {};
|
|
1726
|
+
r.push(
|
|
1727
|
+
e.createNode("tableCell", d, [
|
|
1728
|
+
{ type: "paragraph", content: e.parseInline(s.tokens) }
|
|
1729
|
+
])
|
|
1730
|
+
);
|
|
1716
1731
|
}), n.push(e.createNode("tableRow", {}, r));
|
|
1717
1732
|
}), e.createNode("table", void 0, n);
|
|
1718
1733
|
},
|
|
@@ -1731,13 +1746,13 @@ var gn = mn, Ke = J.create({
|
|
|
1731
1746
|
addColumnAfter: () => ({ state: t, dispatch: e }) => Tt(t, e),
|
|
1732
1747
|
deleteColumn: () => ({ state: t, dispatch: e }) => vt(t, e),
|
|
1733
1748
|
addRowBefore: () => ({ state: t, dispatch: e }) => Nt(t, e),
|
|
1734
|
-
addRowAfter: () => ({ state: t, dispatch: e }) =>
|
|
1749
|
+
addRowAfter: () => ({ state: t, dispatch: e }) => kt(t, e),
|
|
1735
1750
|
deleteRow: () => ({ state: t, dispatch: e }) => zt(t, e),
|
|
1736
1751
|
deleteTable: () => ({ state: t, dispatch: e }) => _t(t, e),
|
|
1737
1752
|
mergeCells: () => ({ state: t, dispatch: e }) => pe(t, e),
|
|
1738
1753
|
splitCell: () => ({ state: t, dispatch: e }) => me(t, e),
|
|
1739
|
-
toggleHeaderColumn: () => ({ state: t, dispatch: e }) =>
|
|
1740
|
-
toggleHeaderRow: () => ({ state: t, dispatch: e }) =>
|
|
1754
|
+
toggleHeaderColumn: () => ({ state: t, dispatch: e }) => P("column")(t, e),
|
|
1755
|
+
toggleHeaderRow: () => ({ state: t, dispatch: e }) => P("row")(t, e),
|
|
1741
1756
|
toggleHeaderCell: () => ({ state: t, dispatch: e }) => Dt(t, e),
|
|
1742
1757
|
mergeOrSplit: () => ({ state: t, dispatch: e }) => pe(t, e) ? !0 : me(t, e),
|
|
1743
1758
|
setCellAttribute: (t, e) => ({ state: n, dispatch: o }) => $t(t, e)(n, o),
|
|
@@ -1757,10 +1772,10 @@ var gn = mn, Ke = J.create({
|
|
|
1757
1772
|
return {
|
|
1758
1773
|
Tab: () => this.editor.commands.goToNextCell() ? !0 : this.editor.can().addRowAfter() ? this.editor.chain().addRowAfter().goToNextCell().run() : !1,
|
|
1759
1774
|
"Shift-Tab": () => this.editor.commands.goToPreviousCell(),
|
|
1760
|
-
Backspace:
|
|
1761
|
-
"Mod-Backspace":
|
|
1762
|
-
Delete:
|
|
1763
|
-
"Mod-Delete":
|
|
1775
|
+
Backspace: G,
|
|
1776
|
+
"Mod-Backspace": G,
|
|
1777
|
+
Delete: G,
|
|
1778
|
+
"Mod-Delete": G
|
|
1764
1779
|
};
|
|
1765
1780
|
},
|
|
1766
1781
|
addProseMirrorPlugins() {
|
|
@@ -1781,7 +1796,10 @@ var gn = mn, Ke = J.create({
|
|
|
1781
1796
|
},
|
|
1782
1797
|
addNodeView() {
|
|
1783
1798
|
const t = this.options.resizable && this.editor.isEditable, e = this.options.View;
|
|
1784
|
-
return t || !e ? null : ({ node: n, view: o }) =>
|
|
1799
|
+
return t || !e ? null : ({ node: n, view: o, HTMLAttributes: l }) => {
|
|
1800
|
+
const r = I(this.options.HTMLAttributes, l);
|
|
1801
|
+
return new e(n, this.options.cellMinWidth, o, r);
|
|
1802
|
+
};
|
|
1785
1803
|
},
|
|
1786
1804
|
extendNodeSchema(t) {
|
|
1787
1805
|
const e = {
|
|
@@ -1859,23 +1877,23 @@ function Ne(t = {}) {
|
|
|
1859
1877
|
let e = t.ua || typeof navigator < "u" && navigator.userAgent;
|
|
1860
1878
|
return e && typeof e == "object" && e.headers && typeof e.headers["user-agent"] == "string" && (e = e.headers["user-agent"]), typeof e != "string" ? !1 : !!(yn.test(e) && !An.test(e) || t.tablet && Sn.test(e) || t.tablet && t.featureDetect && navigator && navigator.maxTouchPoints > 1 && e.includes("Macintosh") && e.includes("Safari"));
|
|
1861
1879
|
}
|
|
1862
|
-
const
|
|
1880
|
+
const ke = (t) => Array.from({ length: t }).map((e, n) => n + 1);
|
|
1863
1881
|
function xn(t) {
|
|
1864
1882
|
var f;
|
|
1865
|
-
const [e, n] =
|
|
1866
|
-
rows: Ne() ?
|
|
1867
|
-
cols: Ne() ?
|
|
1868
|
-
}), [i, c] =
|
|
1869
|
-
rows:
|
|
1870
|
-
cols:
|
|
1883
|
+
const [e, n] = O(!1), [o, l] = O(!0), [r, s] = O({
|
|
1884
|
+
rows: Ne() ? F : j,
|
|
1885
|
+
cols: Ne() ? F : j
|
|
1886
|
+
}), [i, c] = O({
|
|
1887
|
+
rows: V,
|
|
1888
|
+
cols: V
|
|
1871
1889
|
});
|
|
1872
1890
|
function a(h, p) {
|
|
1873
1891
|
h === r.rows && s((m) => ({
|
|
1874
1892
|
...m,
|
|
1875
|
-
rows: Math.min(h + 1,
|
|
1893
|
+
rows: Math.min(h + 1, F)
|
|
1876
1894
|
})), p === r.cols && s((m) => ({
|
|
1877
1895
|
...m,
|
|
1878
|
-
cols: Math.min(p + 1,
|
|
1896
|
+
cols: Math.min(p + 1, F)
|
|
1879
1897
|
})), c({
|
|
1880
1898
|
rows: h,
|
|
1881
1899
|
cols: p
|
|
@@ -1886,25 +1904,25 @@ function xn(t) {
|
|
|
1886
1904
|
}
|
|
1887
1905
|
function u() {
|
|
1888
1906
|
l(!1), s({
|
|
1889
|
-
rows: F,
|
|
1890
|
-
cols: F
|
|
1891
|
-
}), c({
|
|
1892
1907
|
rows: j,
|
|
1893
1908
|
cols: j
|
|
1909
|
+
}), c({
|
|
1910
|
+
rows: V,
|
|
1911
|
+
cols: V
|
|
1894
1912
|
});
|
|
1895
1913
|
}
|
|
1896
1914
|
return /* @__PURE__ */ te(rt, { modal: !0, onOpenChange: n, open: e, children: [
|
|
1897
|
-
/* @__PURE__ */
|
|
1898
|
-
/* @__PURE__ */
|
|
1899
|
-
/* @__PURE__ */
|
|
1915
|
+
/* @__PURE__ */ E(st, { asChild: !0, "data-state": t != null && t.dataState ? "on" : "off", children: t == null ? void 0 : t.children }),
|
|
1916
|
+
/* @__PURE__ */ E(it, { align: "start", className: "richtext-w-full !richtext-p-2", side: "bottom", children: /* @__PURE__ */ te("div", { className: "table-grid-size-editor richtext-p-0", children: [
|
|
1917
|
+
/* @__PURE__ */ E("div", { className: "richtext-flex richtext-flex-col richtext-flex-wrap richtext-justify-between richtext-gap-1", children: (f = ke(r == null ? void 0 : r.rows)) == null ? void 0 : f.map((h) => {
|
|
1900
1918
|
var p;
|
|
1901
|
-
return /* @__PURE__ */
|
|
1919
|
+
return /* @__PURE__ */ E("div", { className: "richtext-flex richtext-gap-1", children: (p = ke(r == null ? void 0 : r.cols)) == null ? void 0 : p.map((m) => /* @__PURE__ */ E(
|
|
1902
1920
|
"div",
|
|
1903
1921
|
{
|
|
1904
1922
|
onMouseDown: () => d(h, m),
|
|
1905
1923
|
onMouseOver: () => a(h, m),
|
|
1906
1924
|
className: `richtext-cursor-pointer richtext-border-border ${m <= i.cols && h <= i.rows && "tableCellActive !richtext-bg-foreground"}`,
|
|
1907
|
-
children: /* @__PURE__ */
|
|
1925
|
+
children: /* @__PURE__ */ E("div", { className: "richtext-box-border richtext-size-4 richtext-rounded-[2px] !richtext-border richtext-border-solid !richtext-border-border richtext-p-1" })
|
|
1908
1926
|
},
|
|
1909
1927
|
`richtext-table-col-${m}`
|
|
1910
1928
|
)) }, `richtext-table-row-${h}`);
|
|
@@ -1926,11 +1944,11 @@ function Wn() {
|
|
|
1926
1944
|
color: s
|
|
1927
1945
|
} = (e == null ? void 0 : e.componentProps) ?? {}, { dataState: i, disabled: c } = ot(r);
|
|
1928
1946
|
if (!e)
|
|
1929
|
-
return /* @__PURE__ */
|
|
1947
|
+
return /* @__PURE__ */ E(et, {});
|
|
1930
1948
|
function a(d) {
|
|
1931
1949
|
t.chain().focus().insertTable({ ...d, withHeaderRow: !1 }).run();
|
|
1932
1950
|
}
|
|
1933
|
-
return /* @__PURE__ */
|
|
1951
|
+
return /* @__PURE__ */ E(xn, { createTable: a, dataState: i, children: /* @__PURE__ */ E(
|
|
1934
1952
|
lt,
|
|
1935
1953
|
{
|
|
1936
1954
|
action: l,
|
package/lib/Table.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Table-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Table-D5G3rfwb.cjs");exports.RichTextTable=e.RichTextTable;exports.Table=e.Table;
|
package/lib/Table.js
CHANGED
package/lib/TaskList.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-CDw4Eszh.cjs"),e=require("react/jsx-runtime"),n=require("./index-aujjnfSJ.cjs");require("react");require("./theme.cjs");function k(){const t=n.useButtonProps(u.name),{icon:s=void 0,tooltip:i=void 0,shortcutKeys:o=void 0,tooltipOptions:d={},action:a=void 0,isActive:l=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:p,disabled:r,update:m}=n.useToggleActive(l),T=()=>{r||a&&(a(),m())};return t?e.jsx(n.ActionButton,{action:T,dataState:p,disabled:r,icon:s,shortcutKeys:o,tooltip:i,tooltipOptions:d}):e.jsx(e.Fragment,{})}const u=c.TaskList.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"task-list"},taskItem:{HTMLAttributes:{class:"task-list-item"}},button:({editor:s,t:i,extension:o})=>({componentProps:{action:()=>s.commands.toggleTaskList(),isActive:()=>s.isActive("taskList"),disabled:!1,icon:"ListTodo",shortcutKeys:o.options.shortcutKeys??["shift","mod","9"],tooltip:i("editor.tasklist.tooltip")}})}},addExtensions(){return[c.TaskItem.configure(this.options.taskItem)]}});exports.RichTextTaskList=k;exports.TaskList=u;
|
package/lib/TaskList.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { T as u, a as l } from "./index-
|
|
1
|
+
import { T as u, a as l } from "./index-BaR0Brts.js";
|
|
2
2
|
import { jsx as a, Fragment as k } from "react/jsx-runtime";
|
|
3
|
-
import { u as T, d as f, A as v } from "./index-
|
|
3
|
+
import { u as T, d as f, A as v } from "./index-C52cuQ_Y.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "./theme.js";
|
|
6
6
|
function y() {
|
package/lib/TextAlign.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./index-BGfIcDCQ.cjs"),s=require("react/jsx-runtime"),y=require("react"),r=require("./index-aujjnfSJ.cjs");require("./theme.cjs");const T=require("./popover-CrywEkBR.cjs");var S=M.Extension.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{const t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).some(n=>n):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,"textAlign")).some(t=>t),toggleTextAlign:e=>({editor:t,commands:n})=>this.options.alignments.includes(e)?t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),C=S;function K(){const[e,t]=y.useState(!1),n=r.useButtonProps(b.name),{icon:x=void 0,tooltip:A=void 0,items:l=[],isActive:m=void 0}=(n==null?void 0:n.componentProps)??{},{disabled:c,dataState:a}=r.useActive(m),h=y.useMemo(()=>(a==null?void 0:a.title)||"",[a]),d=y.useMemo(()=>l==null?void 0:l.some(i=>i.title===h),[l,h]);return n?s.jsxs(T.Popover,{modal:!0,onOpenChange:t,open:e,children:[s.jsx(T.PopoverTrigger,{asChild:!0,className:"hover:richtext-bg-accent data-[state=on]:richtext-bg-accent","data-state":d?"on":"off",disabled:c,children:s.jsx(r.ActionButton,{customClass:"!richtext-w-12 richtext-h-12",disabled:c,icon:x,tooltip:A,children:s.jsx(r.IconComponent,{className:"richtext-ml-1 richtext-size-3 richtext-text-zinc-500",name:"MenuDown"})})}),s.jsx(T.PopoverContent,{align:"start",className:"richtext-flex richtext-w-full richtext-min-w-4 richtext-flex-row richtext-gap-1 !richtext-p-[4px]",side:"bottom",children:l==null?void 0:l.map((i,p)=>{var o,u;return s.jsxs(r.Tooltip,{children:[s.jsx(r.TooltipTrigger,{asChild:!0,children:s.jsx(r.Toggle,{className:"richtext-size-7 richtext-p-1","data-state":h===i.title?"on":"off",size:"sm",onClick:()=>{i==null||i.action(),t(!1)},children:(i==null?void 0:i.icon)&&s.jsx(r.IconComponent,{name:i.icon})})}),s.jsxs(r.TooltipContent,{className:"richtext-flex richtext-flex-col richtext-items-center",children:[s.jsx("span",{children:i.title}),!!((o=i.shortcutKeys)!=null&&o.length)&&s.jsx("span",{children:(u=i.shortcutKeys)==null?void 0:u.map(g=>r.getShortcutKey(g)).join(" ")})]})]},`text-align-${p}`)})})]}):s.jsx(s.Fragment,{})}const b=C.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),types:["heading","paragraph","list_item","title"],button({editor:t,extension:n,t:x}){var a,h,d,i,p;const A=((a=n.options)==null?void 0:a.alignments)||[],l={left:((h=n.options.shortcutKeys)==null?void 0:h[0])??["mod","Shift","L"],center:((d=n.options.shortcutKeys)==null?void 0:d[1])??["mod","Shift","E"],right:((i=n.options.shortcutKeys)==null?void 0:i[2])??["mod","Shift","R"],justify:((p=n.options.shortcutKeys)==null?void 0:p[3])??["mod","Shift","J"]},m={left:"AlignLeft",center:"AlignCenter",right:"AlignRight",justify:"AlignJustify"},c=A.map(o=>{var u,g,j;return{title:x(`editor.textalign.${o}.tooltip`),icon:m[o],shortcutKeys:l[o],isActive:()=>t.isActive({textAlign:o})||!1,action:()=>{var f,v;return(v=(f=t.commands)==null?void 0:f.setTextAlign)==null?void 0:v.call(f,o)},disabled:!((j=(g=(u=t==null?void 0:t.can)==null?void 0:u.call(t))==null?void 0:g.setTextAlign)!=null&&j.call(g,o))}});return{componentProps:{icon:"AlignJustify",tooltip:x("editor.textalign.tooltip"),items:c,isActive:()=>c==null?void 0:c.find(u=>u.isActive())}}}}}});exports.RichTextAlign=K;exports.TextAlign=b;
|
package/lib/TextAlign.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { E as C } from "./index-
|
|
2
|
-
import { jsx as o, Fragment as K, jsxs as
|
|
1
|
+
import { E as C } from "./index-Dx-Dh7KS.js";
|
|
2
|
+
import { jsx as o, Fragment as K, jsxs as A } from "react/jsx-runtime";
|
|
3
3
|
import M, { useMemo as v } from "react";
|
|
4
|
-
import { u as S, e as j, A as P, I as b, T as w, a as N,
|
|
4
|
+
import { u as S, e as j, A as P, I as b, T as w, a as N, l as z, b as L, m as O } from "./index-C52cuQ_Y.js";
|
|
5
5
|
import "./theme.js";
|
|
6
|
-
import { P as R, a as _, b as $ } from "./popover-
|
|
6
|
+
import { P as R, a as _, b as $ } from "./popover-BB-ZDnqk.js";
|
|
7
7
|
var E = C.create({
|
|
8
8
|
name: "textAlign",
|
|
9
9
|
addOptions() {
|
|
@@ -51,9 +51,9 @@ function Q() {
|
|
|
51
51
|
icon: g = void 0,
|
|
52
52
|
tooltip: x = void 0,
|
|
53
53
|
items: r = [],
|
|
54
|
-
isActive:
|
|
55
|
-
} = (n == null ? void 0 : n.componentProps) ?? {}, { disabled: l, dataState: a } = j(
|
|
56
|
-
return n ? /* @__PURE__ */
|
|
54
|
+
isActive: m = void 0
|
|
55
|
+
} = (n == null ? void 0 : n.componentProps) ?? {}, { disabled: l, dataState: a } = j(m), h = v(() => (a == null ? void 0 : a.title) || "", [a]), p = v(() => r == null ? void 0 : r.some((i) => i.title === h), [r, h]);
|
|
56
|
+
return n ? /* @__PURE__ */ A(R, { modal: !0, onOpenChange: t, open: e, children: [
|
|
57
57
|
/* @__PURE__ */ o(
|
|
58
58
|
_,
|
|
59
59
|
{
|
|
@@ -87,7 +87,7 @@ function Q() {
|
|
|
87
87
|
side: "bottom",
|
|
88
88
|
children: r == null ? void 0 : r.map((i, d) => {
|
|
89
89
|
var s, c;
|
|
90
|
-
return /* @__PURE__ */
|
|
90
|
+
return /* @__PURE__ */ A(w, { children: [
|
|
91
91
|
/* @__PURE__ */ o(N, { asChild: !0, children: /* @__PURE__ */ o(
|
|
92
92
|
z,
|
|
93
93
|
{
|
|
@@ -100,7 +100,7 @@ function Q() {
|
|
|
100
100
|
children: (i == null ? void 0 : i.icon) && /* @__PURE__ */ o(b, { name: i.icon })
|
|
101
101
|
}
|
|
102
102
|
) }),
|
|
103
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ A(L, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
|
|
104
104
|
/* @__PURE__ */ o("span", { children: i.title }),
|
|
105
105
|
!!((s = i.shortcutKeys) != null && s.length) && /* @__PURE__ */ o("span", { children: (c = i.shortcutKeys) == null ? void 0 : c.map((u) => O(u)).join(" ") })
|
|
106
106
|
] })
|
|
@@ -128,7 +128,7 @@ const B = /* @__PURE__ */ J.extend({
|
|
|
128
128
|
center: ((p = n.options.shortcutKeys) == null ? void 0 : p[1]) ?? ["mod", "Shift", "E"],
|
|
129
129
|
right: ((i = n.options.shortcutKeys) == null ? void 0 : i[2]) ?? ["mod", "Shift", "R"],
|
|
130
130
|
justify: ((d = n.options.shortcutKeys) == null ? void 0 : d[3]) ?? ["mod", "Shift", "J"]
|
|
131
|
-
},
|
|
131
|
+
}, m = {
|
|
132
132
|
left: "AlignLeft",
|
|
133
133
|
center: "AlignCenter",
|
|
134
134
|
right: "AlignRight",
|
|
@@ -137,7 +137,7 @@ const B = /* @__PURE__ */ J.extend({
|
|
|
137
137
|
var c, u, y;
|
|
138
138
|
return {
|
|
139
139
|
title: g(`editor.textalign.${s}.tooltip`),
|
|
140
|
-
icon:
|
|
140
|
+
icon: m[s],
|
|
141
141
|
shortcutKeys: r[s],
|
|
142
142
|
isActive: () => t.isActive({ textAlign: s }) || !1,
|
|
143
143
|
action: () => {
|