reactjs-tiptap-editor 1.0.25 → 1.0.28
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-8cTG45Ft.js → ActionMenuButton-BhiGvRJ7.js} +1 -1
- package/lib/{ActionMenuButton-CXeFhner.cjs → ActionMenuButton-qUxkZlQg.cjs} +1 -1
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.js +14 -14
- package/lib/Blockquote.cjs +5 -5
- package/lib/Blockquote.js +1497 -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-ZlPQrMEt.js → Callout-B9uXfbP3.js} +20 -20
- package/lib/{Callout-DWOMZPiP.cjs → Callout-C_TXsss3.cjs} +1 -1
- package/lib/Callout.cjs +1 -1
- package/lib/Callout.js +4 -4
- 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-TJY4NuHx.cjs → Drawer-D3B4lQJF.cjs} +1 -1
- package/lib/{Drawer-C-EO1uoK.js → Drawer-h401Yy6Y.js} +4 -4
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +4 -4
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +1797 -268
- 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 +3 -3
- package/lib/History.cjs +7 -1
- package/lib/History.js +663 -569
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +2 -2
- package/lib/{Iframe-CGb6-2LD.js → Iframe-Dhn40BXx.js} +7 -7
- package/lib/{Iframe-5zx43DL4.cjs → Iframe-bvGuzYwC.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 +9 -6
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +33 -33
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.js +5 -5
- package/lib/{Indent-CdMYsDNS.js → Indent-BK9DvCL7.js} +2 -2
- package/lib/{Indent-DuwV8s1t.cjs → Indent-IOByomps.cjs} +1 -1
- 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-CCP_ZQz2.js → Katex-C_Ah9G9w.js} +5 -5
- package/lib/{Katex-D9FP7EUE.cjs → Katex-oLGrtLTf.cjs} +1 -1
- 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-DQ8-iufJ.cjs → LinkEditBlock-BojxdGTm.cjs} +2 -2
- package/lib/{LinkEditBlock-B1m-TVMu.js → LinkEditBlock-DRdKXffy.js} +88 -57
- 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 +1 -1
- package/lib/Mermaid.js +14 -14
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +3 -3
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +2 -2
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +10 -10
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +7 -7
- package/lib/{SlashCommandNodeView-DNixmQGa.cjs → SlashCommandNodeView-Dai-O3aD.cjs} +1 -1
- package/lib/{SlashCommandNodeView-Dt6n1SP9.js → SlashCommandNodeView-qwW9cuYt.js} +10 -10
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +2 -2
- package/lib/{Table-DdEgaUwa.js → Table-BKM8SvVj.js} +115 -97
- package/lib/{Table-C5JxBXef.cjs → Table-CWI7tKme.cjs} +5 -5
- 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-BfsPzA8_.cjs +1 -0
- package/lib/{Twitter-Dnz9qyW0.js → Twitter-CofLQ-zj.js} +191 -191
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +3 -3
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +3 -3
- package/lib/bubble.cjs +6 -6
- package/lib/bubble.js +2504 -2152
- package/lib/{clsx-D6gYQn3o.cjs → clsx-DJURdKPs.cjs} +2 -2
- package/lib/{clsx-0OU6n9va.js → clsx-b_2OwHLk.js} +28 -18
- 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-yQ-sQ1k4.cjs → dropdown-menu-CEMxzgnU.cjs} +1 -1
- package/lib/{dropdown-menu-ROihzXsP.js → dropdown-menu-CKAKsyqu.js} +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/Column.d.ts +10 -2
- 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/Image.d.ts +13 -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-BJQ1G8B1.js +311 -0
- package/lib/index-BO82_0q8.cjs +1 -0
- package/lib/{index-D-Ouz0vF.js → index-Bn_WPziX.js} +1 -1
- package/lib/index-CwbGrQFa.cjs +1 -0
- package/lib/{index-oj858lQO.js → index-DKruDABV.js} +209 -209
- package/lib/{index-BAb_UADw.cjs → index-DN-IR-K0.cjs} +1 -1
- package/lib/{index-X6WZUM9O.js → index-DRcwHivm.js} +1702 -1486
- package/lib/index-DUeBQoIA.cjs +1 -0
- package/lib/index-DeoYYWEA.js +1756 -0
- package/lib/{index-CUvjYuRp.cjs → index-Dgs2thVL.cjs} +1 -1
- package/lib/index-DjB2kNdz.js +1120 -0
- package/lib/{index-zw-Kd38i.js → index-DuWMq-Qs.js} +1 -1
- package/lib/index-EoGU7W4e.cjs +26 -0
- package/lib/index-MDz4NZcT.cjs +12 -0
- package/lib/{index-BblvcbTH.js → index-n4kM0Ll-.js} +1527 -1406
- package/lib/index-qZURFC5Q.cjs +2 -0
- package/lib/index.cjs +1 -1
- package/lib/index.js +2 -2
- 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-BfWFqCIs.js → popover-Beieacfy.js} +1 -1
- package/lib/{popover-BPzkMuyi.cjs → popover-Bl1kxRJX.cjs} +1 -1
- package/lib/{renderNodeView-D--fDFov.cjs → renderNodeView-BIgT6Ghg.cjs} +1 -1
- package/lib/{renderNodeView-CfWJK4rG.js → renderNodeView-Bi58v3DZ.js} +2 -2
- package/lib/{separator-DpaS43Gt.cjs → separator-DMLtkcoo.cjs} +1 -1
- package/lib/{separator-CBPrZizK.js → separator-DfvK668q.js} +11 -11
- package/lib/store/EditorEditableReactive.d.ts +1 -1
- package/lib/store/ThemeColorReactive.d.ts +1 -1
- package/lib/style.css +1 -1
- package/lib/{textarea-wvARZKyA.cjs → textarea-DV9Fw3y1.cjs} +1 -1
- package/lib/{textarea-Bl64keav.js → textarea-GXaWJbm9.js} +1 -1
- package/lib/theme.cjs +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.d.ts +2 -2
- package/lib/{updatePosition-BwzAsiY0.js → updatePosition-DY1jI7qb.js} +2 -2
- package/lib/{updatePosition-DGPtRfWN.cjs → updatePosition-D_D-TbEu.cjs} +1 -1
- package/package.json +86 -72
- package/lib/Twitter--tfifMt1.cjs +0 -1
- package/lib/index-BF3EVCB1.cjs +0 -2
- package/lib/index-BG0kQamI.js +0 -285
- 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-Gi752TMk.cjs +0 -1
- package/lib/index-NsYff_Ni.cjs +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { R as ue, S as z, Z as Xe, T as W, F as v, v as L, Q as Ee, u as Ge, _ as Ue, N as Y, m as I, V as qe, W as Ze, E as ze, $ as Je } from "./index-n4kM0Ll-.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-Bn_WPziX.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-DRcwHivm.js";
|
|
6
|
+
import { useState as O } from "react";
|
|
7
7
|
import "./theme.js";
|
|
8
|
-
import { T as
|
|
9
|
-
import { P as rt, a as st, b as it } from "./popover-
|
|
8
|
+
import { T as F, m as j, n as V } from "./index-DKruDABV.js";
|
|
9
|
+
import { P as rt, a as st, b as it } from "./popover-Beieacfy.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);
|
|
@@ -421,7 +421,7 @@ function Ct({ $from: t, $to: e }) {
|
|
|
421
421
|
function yt(t, e, n) {
|
|
422
422
|
const o = (e || t).selection, l = (e || t).doc;
|
|
423
423
|
let r, s;
|
|
424
|
-
if (o instanceof
|
|
424
|
+
if (o instanceof Ge && (s = o.node.type.spec.tableRole)) {
|
|
425
425
|
if (s == "cell" || s == "header_cell") r = w.create(l, o.from);
|
|
426
426
|
else if (s == "row") {
|
|
427
427
|
const i = l.resolve(o.from + 1);
|
|
@@ -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) {
|
|
@@ -920,7 +920,7 @@ function Pt(t, e) {
|
|
|
920
920
|
}
|
|
921
921
|
function ce(t, e) {
|
|
922
922
|
const n = t.createAndFill();
|
|
923
|
-
return new
|
|
923
|
+
return new Ue(n).replace(0, n.content.size, e).doc;
|
|
924
924
|
}
|
|
925
925
|
function Ot({ width: t, height: e, rows: n }, o, l) {
|
|
926
926
|
if (t != o) {
|
|
@@ -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": G("horiz", -1),
|
|
1039
|
+
"Shift-ArrowRight": G("horiz", 1),
|
|
1040
|
+
"Shift-ArrowUp": G("vert", -1),
|
|
1041
|
+
"Shift-ArrowDown": G("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 G(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) {
|
|
@@ -1159,7 +1159,7 @@ function ne(t, e) {
|
|
|
1159
1159
|
let { inside: o, pos: l } = n;
|
|
1160
1160
|
return o >= 0 && D(t.state.doc.resolve(o)) || D(t.state.doc.resolve(l));
|
|
1161
1161
|
}
|
|
1162
|
-
var
|
|
1162
|
+
var Gt = class {
|
|
1163
1163
|
constructor(e, n) {
|
|
1164
1164
|
this.node = e, this.defaultCellMinWidth = n, this.dom = document.createElement("div"), this.dom.className = "tableWrapper", this.table = this.dom.appendChild(document.createElement("table")), this.table.style.setProperty("--default-cell-min-width", `${n}px`), this.colgroup = this.table.appendChild(document.createElement("colgroup")), ae(e, this.colgroup, this.table, n), this.contentDOM = this.table.appendChild(document.createElement("tbody"));
|
|
1165
1165
|
}
|
|
@@ -1195,8 +1195,8 @@ function ae(t, e, n, o, l, r) {
|
|
|
1195
1195
|
}
|
|
1196
1196
|
}
|
|
1197
1197
|
const x = new ue("tableColumnResizing");
|
|
1198
|
-
function
|
|
1199
|
-
const r = new
|
|
1198
|
+
function Ut({ handleWidth: t = 5, cellMinWidth: e = 25, defaultCellMinWidth: n = 100, View: o = Gt, lastColumnResizable: l = !0 } = {}) {
|
|
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);
|
|
@@ -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),
|
|
@@ -1766,7 +1781,7 @@ var gn = mn, Ke = J.create({
|
|
|
1766
1781
|
addProseMirrorPlugins() {
|
|
1767
1782
|
return [
|
|
1768
1783
|
...this.options.resizable && this.editor.isEditable ? [
|
|
1769
|
-
|
|
1784
|
+
Ut({
|
|
1770
1785
|
handleWidth: this.options.handleWidth,
|
|
1771
1786
|
cellMinWidth: this.options.cellMinWidth,
|
|
1772
1787
|
defaultCellMinWidth: this.options.cellMinWidth,
|
|
@@ -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,
|