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
package/lib/Mermaid.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { s as G, m as U } from "./index-
|
|
2
|
-
import { t as q,
|
|
3
|
-
import { N as ot, a as lt } from "./clsx-
|
|
1
|
+
import { s as G, m as U } from "./index-n4kM0Ll-.js";
|
|
2
|
+
import { t as q, r as X, h as Z, u as Y, d as J, D as K, s as Q, A as tt, v as et, w as rt, x as it, B as st, y as at, z as nt } from "./index-DRcwHivm.js";
|
|
3
|
+
import { N as ot, a as lt } from "./clsx-b_2OwHLk.js";
|
|
4
4
|
import { jsx as n, jsxs as H, Fragment as ct } from "react/jsx-runtime";
|
|
5
5
|
import { useState as m, useMemo as P, useCallback as A, useEffect as R, useRef as dt } from "react";
|
|
6
|
-
import { I as V, j as W, k as ut } from "./index-
|
|
6
|
+
import { I as V, j as W, k as ut } from "./index-DKruDABV.js";
|
|
7
7
|
import { s as ht, i as mt } from "./shortId-WJVkrvml.js";
|
|
8
|
-
import { T as gt } from "./textarea-
|
|
8
|
+
import { T as gt } from "./textarea-GXaWJbm9.js";
|
|
9
9
|
const C = {
|
|
10
10
|
TOP_LEFT: "tl",
|
|
11
11
|
TOP_RIGHT: "tr",
|
|
@@ -55,7 +55,7 @@ function pt({ editor: e, node: t, updateAttributes: i, getPos: a, selected: w })
|
|
|
55
55
|
function I() {
|
|
56
56
|
e.commands.setNodeSelection(a());
|
|
57
57
|
}
|
|
58
|
-
const
|
|
58
|
+
const z = A(
|
|
59
59
|
q(() => {
|
|
60
60
|
const { width: r } = getComputedStyle(e.view.dom);
|
|
61
61
|
c((p) => ({
|
|
@@ -100,15 +100,15 @@ function pt({ editor: e, node: t, updateAttributes: i, getPos: a, selected: w })
|
|
|
100
100
|
}), _(!1), I());
|
|
101
101
|
},
|
|
102
102
|
[o, I]
|
|
103
|
-
),
|
|
103
|
+
), E = A(() => {
|
|
104
104
|
document == null || document.addEventListener("mousemove", l, !0), document == null || document.addEventListener("mouseup", u, !0);
|
|
105
105
|
}, [l, u]), N = A(() => {
|
|
106
106
|
document == null || document.removeEventListener("mousemove", l, !0), document == null || document.removeEventListener("mouseup", u, !0);
|
|
107
107
|
}, [l, u]);
|
|
108
|
-
R(() => (o ?
|
|
108
|
+
R(() => (o ? E() : N(), () => {
|
|
109
109
|
N();
|
|
110
|
-
}), [o,
|
|
111
|
-
const M = P(() => new ResizeObserver(() =>
|
|
110
|
+
}), [o, E, N]);
|
|
111
|
+
const M = P(() => new ResizeObserver(() => z()), [z]);
|
|
112
112
|
return R(() => (M.observe(e.view.dom), () => {
|
|
113
113
|
M.disconnect();
|
|
114
114
|
}), [e.view.dom, M]), /* @__PURE__ */ n(
|
|
@@ -164,7 +164,7 @@ function At() {
|
|
|
164
164
|
} catch {
|
|
165
165
|
y("");
|
|
166
166
|
}
|
|
167
|
-
},
|
|
167
|
+
}, z = () => {
|
|
168
168
|
d.initialize({
|
|
169
169
|
darkMode: !1,
|
|
170
170
|
startOnLoad: !1,
|
|
@@ -174,7 +174,7 @@ function At() {
|
|
|
174
174
|
}), I(c);
|
|
175
175
|
};
|
|
176
176
|
return R(() => {
|
|
177
|
-
!g && d && o &&
|
|
177
|
+
!g && d && o && z();
|
|
178
178
|
}, [d, o]), R(() => {
|
|
179
179
|
!g && d && o && I(c);
|
|
180
180
|
}, [d && c]), /* @__PURE__ */ H(K, { onOpenChange: _, open: o, children: [
|
|
@@ -226,7 +226,7 @@ function At() {
|
|
|
226
226
|
/* @__PURE__ */ n(it, { children: /* @__PURE__ */ n(st, { disabled: !d, onClick: async () => {
|
|
227
227
|
if (c !== "") {
|
|
228
228
|
if (c) {
|
|
229
|
-
const l = L.current.querySelector("svg"), { width: u, height:
|
|
229
|
+
const l = L.current.querySelector("svg"), { width: u, height: E } = l.getBoundingClientRect(), N = `mermaid-${ht()}.svg`;
|
|
230
230
|
let M = mt(l.outerHTML);
|
|
231
231
|
if (w) {
|
|
232
232
|
const r = at(M, N);
|
|
@@ -238,7 +238,7 @@ function At() {
|
|
|
238
238
|
src: M,
|
|
239
239
|
alt: encodeURIComponent(c),
|
|
240
240
|
width: u,
|
|
241
|
-
height:
|
|
241
|
+
height: E
|
|
242
242
|
},
|
|
243
243
|
!!c
|
|
244
244
|
).run();
|
package/lib/MoreMark.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index-EoGU7W4e.cjs"),r=require("react/jsx-runtime"),M=require("react"),c=require("./index-BO82_0q8.cjs");require("./theme.cjs");const l=require("./dropdown-menu-CEMxzgnU.cjs");var x=u.Mark.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",u.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),f=u.Mark.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",u.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}});function S(){const t=c.useButtonProps(m.name),{icon:s=void 0,tooltip:n=void 0,items:i=[],isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{disabled:a,dataState:o}=c.useActive(d),h=M.useMemo(()=>(o==null?void 0:o.title)||"",[o]);return t?r.jsxs(l.DropdownMenu,{children:[r.jsx(l.DropdownMenuTrigger,{asChild:!0,disabled:a,children:r.jsx(c.ActionButton,{customClass:"!richtext-w-12 richtext-h-12",disabled:a,icon:s,tooltip:n,children:r.jsx(c.MenuDown,{className:"richtext-size-3 richtext-text-gray-500"})})}),r.jsx(l.DropdownMenuContent,{className:"w-full",children:i==null?void 0:i.map((e,p)=>r.jsxs(l.DropdownMenuCheckboxItem,{checked:h===e.title,className:"richtext-flex richtext-items-center richtext-gap-3",onClick:e.action,children:[r.jsx(c.IconComponent,{name:e==null?void 0:e.icon}),r.jsx("span",{className:"richtext-ml-1",children:e.title}),!!(e!=null&&e.shortcutKeys)&&r.jsx("span",{className:"richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60",children:c.getShortcutKeys(e.shortcutKeys)})]},`more-mark-${p}`))})]}):r.jsx(r.Fragment,{})}const m=u.Extension.create({name:"moreMark",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:s,extension:n,t:i}){var p,g;const d=n.options.subscript,a=n.options.superscript,o={action:()=>s.commands.toggleSubscript(),isActive:()=>s.isActive("subscript")||!1,disabled:!s.can().toggleSubscript(),icon:"Subscript",title:i("editor.subscript.tooltip"),shortcutKeys:((p=n.options.shortcutKeys)==null?void 0:p[0])??["mod","."]},h={action:()=>s.commands.toggleSuperscript(),isActive:()=>s.isActive("superscript")||!1,disabled:!s.can().toggleSuperscript(),icon:"Superscript",title:i("editor.superscript.tooltip"),shortcutKeys:((g=n.options.shortcutKeys)==null?void 0:g[1])??["mod",","]},e=[];return d!==!1&&e.push(o),a!==!1&&e.push(h),{componentProps:{icon:"Type",tooltip:i("editor.moremark"),disabled:!s.isEditable,items:e,isActive:()=>e==null?void 0:e.find(b=>b.isActive())}}}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(x.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(f.configure(this.options.superscript)),t}});exports.MoreMark=m;exports.RichTextMoreMark=S;
|
package/lib/MoreMark.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { M as h, m, E as b } from "./index-
|
|
1
|
+
import { M as h, m, E as b } from "./index-n4kM0Ll-.js";
|
|
2
2
|
import { jsx as e, Fragment as M, jsxs as d } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo as f } from "react";
|
|
4
|
-
import { u as x, e as A, A as S, M as k, I as v, g as y } from "./index-
|
|
4
|
+
import { u as x, e as A, A as S, M as k, I as v, g as y } from "./index-DRcwHivm.js";
|
|
5
5
|
import "./theme.js";
|
|
6
|
-
import { D as T, a as K, b as w, c as C } from "./dropdown-menu-
|
|
6
|
+
import { D as T, a as K, b as w, c as C } from "./dropdown-menu-CKAKsyqu.js";
|
|
7
7
|
var H = h.create({
|
|
8
8
|
name: "subscript",
|
|
9
9
|
addOptions() {
|
package/lib/OrderedList.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index-MDz4NZcT.cjs"),r=require("react/jsx-runtime"),s=require("./index-BO82_0q8.cjs");require("react");require("./theme.cjs");function O(){const t=s.useButtonProps(c.name),{icon:e=void 0,tooltip:i=void 0,shortcutKeys:o=void 0,tooltipOptions:u={},action:n=void 0,isActive:a=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:p,disabled:d,update:l}=s.useToggleActive(a),m=()=>{d||n&&(n(),l())};return t?r.jsx(s.ActionButton,{action:m,dataState:p,disabled:d,icon:e,shortcutKeys:o,tooltip:i,tooltipOptions:u}):r.jsx(r.Fragment,{})}const c=v.OrderedList.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:i,extension:o})=>({componentProps:{action:()=>e.commands.toggleOrderedList(),isActive:()=>e.isActive("orderedList"),disabled:!1,icon:"ListOrdered",shortcutKeys:o.options.shortcutKeys??["mod","shift","7"],tooltip:i("editor.orderedlist.tooltip")}})}}});exports.OrderedList=c;exports.RichTextOrderedList=O;
|
package/lib/OrderedList.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { O as u } from "./index-
|
|
1
|
+
import { O as u } from "./index-DjB2kNdz.js";
|
|
2
2
|
import { jsx as n, Fragment as l } from "react/jsx-runtime";
|
|
3
|
-
import { u as f, d as v, A as O } from "./index-
|
|
3
|
+
import { u as f, d as v, A as O } from "./index-DRcwHivm.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "./theme.js";
|
|
6
6
|
function K() {
|
package/lib/SearchAndReplace.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("./index-EoGU7W4e.cjs"),D=require("@tiptap/pm/state"),b=require("@tiptap/pm/view"),a=require("react/jsx-runtime"),g=require("react"),h=require("./index-BO82_0q8.cjs");require("./theme.cjs");const J=require("./index-CwbGrQFa.cjs"),q=require("./popover-Bl1kxRJX.cjs");function Q(){const{t}=J.useLocale(),e=h.useEditorInstance(),s=h.useButtonProps(F.name),{icon:n=void 0,tooltip:u=void 0,shortcutKeys:o=void 0,tooltipOptions:c={},action:x=void 0,isActive:m=void 0}=(s==null?void 0:s.componentProps)??{},{disabled:i}=h.useActive(m),[R,f]=g.useState(!1),[p,T]=g.useState(""),[C,N]=g.useState(""),[j,M]=g.useState(!1),[V,$]=g.useState(""),w=()=>{var r,l,v,d;$(`${((l=(r=e==null?void 0:e.storage)==null?void 0:r.searchAndReplace)==null?void 0:l.resultIndex)+1}/${(d=(v=e==null?void 0:e.storage)==null?void 0:v.searchAndReplace)==null?void 0:d.results.length}`)};g.useEffect(()=>{e&&w()},[e]);const K=()=>{i||x&&x()},P=(r=!1)=>{var l,v,d,S,A,E,y,L;e&&(r&&((v=(l=e==null?void 0:e.commands)==null?void 0:l.resetIndex)==null||v.call(l)),(S=(d=e==null?void 0:e.commands)==null?void 0:d.setSearchTerm)==null||S.call(d,p),(E=(A=e==null?void 0:e.commands)==null?void 0:A.setReplaceTerm)==null||E.call(A,C),(L=(y=e==null?void 0:e.commands)==null?void 0:y.setCaseSensitive)==null||L.call(y,j),w())},k=()=>{var S,A;if(!e)return;const{results:r,resultIndex:l}=e.storage.searchAndReplace,v=r[l];if(!v)return;(A=(S=e==null?void 0:e.commands)==null?void 0:S.setTextSelection)==null||A.call(S,v);const{node:d}=e.view.domAtPos(e.state.selection.anchor);d instanceof HTMLElement&&d.scrollIntoView({behavior:"smooth",block:"center"}),w()};g.useEffect(()=>{p.trim()||B(),p.trim()&&P(!0)},[p]),g.useEffect(()=>{C.trim()&&P()},[C]),g.useEffect(()=>{P(!0)},[j]);const W=()=>{var r,l;(l=(r=e==null?void 0:e.commands)==null?void 0:r.replace)==null||l.call(r),k()},H=()=>{var r,l;(l=(r=e==null?void 0:e.commands)==null?void 0:r.nextSearchResult)==null||l.call(r),k()},U=()=>{var r,l;(l=(r=e==null?void 0:e.commands)==null?void 0:r.previousSearchResult)==null||l.call(r),k()},B=()=>{var r,l;T(""),N(""),(l=(r=e==null?void 0:e.commands)==null?void 0:r.resetIndex)==null||l.call(r),w()},z=()=>{var r,l;(l=(r=e==null?void 0:e.commands)==null?void 0:r.replaceAll)==null||l.call(r),$("0/0")};return s?a.jsxs(q.Popover,{onOpenChange:f,open:R,children:[a.jsx(q.PopoverTrigger,{asChild:!0,disabled:i,children:a.jsx(h.ActionButton,{action:K,disabled:i,icon:n,shortcutKeys:o,tooltip:u,tooltipOptions:c})}),a.jsxs(q.PopoverContent,{align:"start",className:"richtext-w-full",hideWhenDetached:!0,side:"bottom",children:[a.jsxs("div",{className:"richtext-mb-[6px] richtext-flex richtext-items-center richtext-justify-between",children:[a.jsx(h.Label,{children:t("editor.search.dialog.text")}),a.jsx("span",{className:"richtext-font-semibold",children:V})]}),a.jsxs("div",{className:"richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:[a.jsx(h.Input,{autoFocus:!0,className:"richtext-w-full",onChange:r=>T(r.target.value),placeholder:"Text",required:!0,type:"text",value:p}),a.jsx(h.Button,{className:"richtext-flex-1",onClick:U,children:a.jsx(h.IconComponent,{name:"ChevronUp"})}),a.jsx(h.Button,{className:"richtext-flex-1",onClick:H,children:a.jsx(h.IconComponent,{name:"ChevronDown"})}),a.jsx(h.Button,{className:"richtext-flex-1",onClick:B,children:"Clear"})]}),a.jsx(h.Label,{className:"richtext-mb-[6px]",children:t("editor.replace.dialog.text")}),a.jsx("div",{className:"richtext-mb-[5px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:a.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:a.jsx(h.Input,{className:"richtext-w-80",onChange:r=>N(r.target.value),placeholder:"Text",required:!0,type:"text",value:C})})}),a.jsxs("div",{className:"richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-1",children:[a.jsx(h.Checkbox,{checked:j,onCheckedChange:r=>{M(r),e.commands.setCaseSensitive(r)}}),a.jsx(h.Label,{children:t("editor.replace.caseSensitive")})]}),a.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[a.jsx(h.Button,{className:"richtext-flex-1",onClick:W,children:t("editor.replace.dialog.text")}),a.jsx(h.Button,{className:"richtext-flex-1",onClick:z,children:t("editor.replaceAll.dialog.text")})]})]})]}):a.jsx(a.Fragment,{})}const I=(t,e)=>e(t.tr);function X(t,e,s){return RegExp(e?t.replace(/[$()*+.?[\\\]^{|}]/g,String.raw`\$&`):t,s?"gu":"gui")}function Y(t,e,s,n){const u=[],o=[];let c=[],x=0;if(!e)return{decorationsToReturn:b.DecorationSet.empty,results:[]};t==null||t.descendants((m,i)=>{m.isText?c[x]?c[x]={text:c[x].text+m.text,pos:c[x].pos}:c[x]={text:`${m.text}`,pos:i}:x+=1}),c=c.filter(Boolean);for(const m of c){const{text:i,pos:R}=m,f=Array.from(i.matchAll(e)).filter(([p])=>p.trim());for(const p of f){if(p[0]==="")break;p.index!==void 0&&o.push({from:R+p.index,to:R+p.index+p[0].length})}}for(const[m,i]of o.entries()){const R=m===n?`${s} ${s}-current`:s,f=b.Decoration.inline(i.from,i.to,{class:R});u.push(f)}return{decorationsToReturn:b.DecorationSet.create(t,u),results:o}}function O(t,e,{state:s,dispatch:n}){if(!e[0])return;const{from:o,to:c}=e[0];n&&n(s.tr.insertText(t,o,c))}function Z(t,e,s,n){const u=e+1;if(!n[u])return null;const{from:o,to:c}=n[e],x=c-o-t.length+s,{from:m,to:i}=n[u];return n[u]={to:i-x,from:m-x},[x,n]}function _(t,e,{tr:s,dispatch:n}){let u=0,o=e.slice();if(o.length!==0){for(let c=0;c<o.length;c+=1){const{from:x,to:m}=o[c];s.insertText(t,x,m);const i=Z(t,c,u,o);i&&(u=i[0],o=i[1])}n(s)}}const F=G.Extension.create({name:"searchAndReplace",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),searchTerm:"",replaceTerm:"",results:[],searchResultClass:"search-result",searchResultCurrentClass:"search-result-current",caseSensitive:!1,disableRegex:!0,onChange:()=>{},button:({editor:e,t:s})=>({componentProps:{action:()=>{},icon:"SearchAndReplace",tooltip:s("editor.searchAndReplace.tooltip"),isActive:()=>!0,editor:e}})}},addStorage(){return{searchTerm:"",replaceTerm:"",results:[],lastSearchTerm:"",caseSensitive:!1,lastCaseSensitive:!1,resultIndex:0,lastResultIndex:0}},addCommands(){return{setSearchTerm:t=>({editor:e,state:s,dispatch:n})=>(e.storage.searchAndReplace.searchTerm=t,I(s,n),!1),setReplaceTerm:t=>({editor:e,state:s,dispatch:n})=>(e.storage.searchAndReplace.replaceTerm=t,I(s,n),!1),setCaseSensitive:t=>({editor:e,state:s,dispatch:n})=>(e.storage.searchAndReplace.caseSensitive=t,I(s,n),!1),resetIndex:()=>({editor:t,state:e,dispatch:s})=>(t.storage.searchAndReplace.resultIndex=0,I(e,s),!1),nextSearchResult:()=>({editor:t})=>{const{results:e,resultIndex:s}=t.storage.searchAndReplace,n=s+1;return e[n]?t.storage.searchAndReplace.resultIndex=n:t.storage.searchAndReplace.resultIndex=0,!1},previousSearchResult:()=>({editor:t})=>{const{results:e,resultIndex:s}=t.storage.searchAndReplace,n=s-1;return e[n]?t.storage.searchAndReplace.resultIndex=n:t.storage.searchAndReplace.resultIndex=e.length-1,!1},replace:()=>({editor:t,state:e,dispatch:s})=>{const{replaceTerm:n,results:u,resultIndex:o}=t.storage.searchAndReplace,c=u[o];return c?(O(n,[c],{state:e,dispatch:s}),t.storage.searchAndReplace.results.splice(o,1)):(O(n,u,{state:e,dispatch:s}),t.storage.searchAndReplace.results.shift()),I(e,s),!1},replaceAll:()=>({editor:t,tr:e,state:s,dispatch:n})=>{const{replaceTerm:u,results:o}=t.storage.searchAndReplace;return _(u,o,{tr:e,dispatch:n}),t.storage.searchAndReplace.resultIndex=0,t.storage.searchAndReplace.results=[],I(s,n),!1}}},addProseMirrorPlugins(){const t=this.editor,{searchResultClass:e,disableRegex:s}=this.options,n=c=>t.storage.searchAndReplace.lastSearchTerm=c,u=c=>t.storage.searchAndReplace.lastCaseSensitive=c,o=c=>t.storage.searchAndReplace.lastResultIndex=c;return[new D.Plugin({key:new D.PluginKey(`richtextCustomPlugin${this.name}`),state:{init:()=>b.DecorationSet.empty,apply({doc:c,docChanged:x},m){const{searchTerm:i,lastSearchTerm:R,caseSensitive:f,lastCaseSensitive:p,resultIndex:T,lastResultIndex:C}=t.storage.searchAndReplace;if(!x&&R===i&&p===f&&C===T)return m;if(n(i),u(f),o(T),!i)return t.storage.searchAndReplace.results=[],b.DecorationSet.empty;const{decorationsToReturn:N,results:j}=Y(c,X(i,s,f),e,T);return t.storage.searchAndReplace.results=j,N}},props:{decorations(c){return this.getState(c)}}})]}});exports.RichTextSearchAndReplace=Q;exports.SearchAndReplace=F;
|
package/lib/SearchAndReplace.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { E as Q } from "./index-
|
|
1
|
+
import { E as Q } from "./index-n4kM0Ll-.js";
|
|
2
2
|
import { Plugin as X, PluginKey as Y } from "@tiptap/pm/state";
|
|
3
3
|
import { DecorationSet as $, Decoration as Z } from "@tiptap/pm/view";
|
|
4
4
|
import { jsx as u, Fragment as _, jsxs as T } from "react/jsx-runtime";
|
|
5
5
|
import { useState as b, useEffect as k } from "react";
|
|
6
|
-
import { h as ee, u as te, e as se, A as re, L as B,
|
|
6
|
+
import { h as ee, u as te, e as se, A as re, L as B, k as V, B as N, I as q, C as ne } from "./index-DRcwHivm.js";
|
|
7
7
|
import "./theme.js";
|
|
8
|
-
import { u as ce } from "./index-
|
|
9
|
-
import { P as ae, a as le, b as oe } from "./popover-
|
|
8
|
+
import { u as ce } from "./index-DKruDABV.js";
|
|
9
|
+
import { P as ae, a as le, b as oe } from "./popover-Beieacfy.js";
|
|
10
10
|
function Ce() {
|
|
11
11
|
const { t } = ce(), e = ee(), s = te(xe.name), {
|
|
12
12
|
icon: n = void 0,
|
|
@@ -15,9 +15,9 @@ function Ce() {
|
|
|
15
15
|
tooltipOptions: c = {},
|
|
16
16
|
action: h = void 0,
|
|
17
17
|
isActive: m = void 0
|
|
18
|
-
} = (s == null ? void 0 : s.componentProps) ?? {}, { disabled: o } = se(m), [f, d] = b(!1), [x, A] = b(""), [S, w] = b(""), [I, M] = b(!1), [W,
|
|
18
|
+
} = (s == null ? void 0 : s.componentProps) ?? {}, { disabled: o } = se(m), [f, d] = b(!1), [x, A] = b(""), [S, w] = b(""), [I, M] = b(!1), [W, D] = b(""), y = () => {
|
|
19
19
|
var r, a, g, p;
|
|
20
|
-
|
|
20
|
+
D(
|
|
21
21
|
`${((a = (r = e == null ? void 0 : e.storage) == null ? void 0 : r.searchAndReplace) == null ? void 0 : a.resultIndex) + 1}/${(p = (g = e == null ? void 0 : e.storage) == null ? void 0 : g.searchAndReplace) == null ? void 0 : p.results.length}`
|
|
22
22
|
);
|
|
23
23
|
};
|
|
@@ -39,7 +39,7 @@ function Ce() {
|
|
|
39
39
|
p instanceof HTMLElement && p.scrollIntoView({ behavior: "smooth", block: "center" }), y();
|
|
40
40
|
};
|
|
41
41
|
k(() => {
|
|
42
|
-
x.trim() ||
|
|
42
|
+
x.trim() || j(), x.trim() && L(!0);
|
|
43
43
|
}, [x]), k(() => {
|
|
44
44
|
S.trim() && L();
|
|
45
45
|
}, [S]), k(() => {
|
|
@@ -54,12 +54,12 @@ function Ce() {
|
|
|
54
54
|
}, G = () => {
|
|
55
55
|
var r, a;
|
|
56
56
|
(a = (r = e == null ? void 0 : e.commands) == null ? void 0 : r.previousSearchResult) == null || a.call(r), E();
|
|
57
|
-
},
|
|
57
|
+
}, j = () => {
|
|
58
58
|
var r, a;
|
|
59
59
|
A(""), w(""), (a = (r = e == null ? void 0 : e.commands) == null ? void 0 : r.resetIndex) == null || a.call(r), y();
|
|
60
60
|
}, J = () => {
|
|
61
61
|
var r, a;
|
|
62
|
-
(a = (r = e == null ? void 0 : e.commands) == null ? void 0 : r.replaceAll) == null || a.call(r),
|
|
62
|
+
(a = (r = e == null ? void 0 : e.commands) == null ? void 0 : r.replaceAll) == null || a.call(r), D("0/0");
|
|
63
63
|
};
|
|
64
64
|
return s ? /* @__PURE__ */ T(ae, { onOpenChange: d, open: f, children: [
|
|
65
65
|
/* @__PURE__ */ u(le, { asChild: !0, disabled: o, children: /* @__PURE__ */ u(
|
|
@@ -93,7 +93,7 @@ function Ce() {
|
|
|
93
93
|
),
|
|
94
94
|
/* @__PURE__ */ u(N, { className: "richtext-flex-1", onClick: G, children: /* @__PURE__ */ u(q, { name: "ChevronUp" }) }),
|
|
95
95
|
/* @__PURE__ */ u(N, { className: "richtext-flex-1", onClick: z, children: /* @__PURE__ */ u(q, { name: "ChevronDown" }) }),
|
|
96
|
-
/* @__PURE__ */ u(N, { className: "richtext-flex-1", onClick:
|
|
96
|
+
/* @__PURE__ */ u(N, { className: "richtext-flex-1", onClick: j, children: "Clear" })
|
|
97
97
|
] }),
|
|
98
98
|
/* @__PURE__ */ u(B, { className: "richtext-mb-[6px]", children: t("editor.replace.dialog.text") }),
|
|
99
99
|
/* @__PURE__ */ u("div", { className: "richtext-mb-[5px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ u("div", { className: "richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center", children: /* @__PURE__ */ u(
|
package/lib/SlashCommand.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-EoGU7W4e.cjs"),u=require("@tiptap/pm/state"),d=require("./clsx-DJURdKPs.cjs"),l=require("./index-qZURFC5Q.cjs"),r=require("./SlashCommandNodeView-Dai-O3aD.cjs"),o=require("./updatePosition-D_D-TbEu.cjs"),a=require("react/jsx-runtime"),m=require("react"),c=require("./index-CwbGrQFa.cjs");function C({commandList:e}){const[,t]=r.useSignalCommandList(),{t:n}=c.useLocale();return m.useEffect(()=>{if(!(e!=null&&e.length)){const i=r.renderCommandListDefault({t:n});t(i);return}t(e)},[n,e]),a.jsx(a.Fragment,{})}const f=s.Extension.create({name:"richtextSlashCommand",priority:200,addProseMirrorPlugins(){return[l.Suggestion({pluginKey:new u.PluginKey("richtextSlashCommandPlugin"),editor:this.editor,char:"/",command:({editor:e,range:t,props:n})=>{const{view:i}=e;n.action({editor:e,range:t}),i.focus()},render:()=>{let e;return{onStart:t=>{t.clientRect&&(e=new d.ReactRenderer(r.SlashCommandNodeView,{props:t,editor:t.editor}),e.element.style.position="absolute",document.body.appendChild(e.element),o.updatePosition(t.editor,e.element))},onUpdate(t){e.updateProps(t),t.clientRect&&o.updatePosition(t.editor,e.element)},onKeyDown(t){var n;return t.event.key==="Escape"?(e.destroy(),e.element.remove(),!0):(n=e.ref)==null?void 0:n.onKeyDown(t)},onExit(){e&&(e.destroy(),e.element.remove())}}}})]}});exports.renderCommandListDefault=r.renderCommandListDefault;exports.useFilterCommandList=r.useFilterCommandList;exports.SlashCommand=f;exports.SlashCommandList=C;
|
package/lib/SlashCommand.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { E as i } from "./index-
|
|
1
|
+
import { E as i } from "./index-n4kM0Ll-.js";
|
|
2
2
|
import { PluginKey as a } from "@tiptap/pm/state";
|
|
3
|
-
import { R as m } from "./clsx-
|
|
4
|
-
import { S as s } from "./index-
|
|
5
|
-
import { u, r as l, S as d } from "./SlashCommandNodeView-
|
|
6
|
-
import { a as F } from "./SlashCommandNodeView-
|
|
7
|
-
import { u as o } from "./updatePosition-
|
|
3
|
+
import { R as m } from "./clsx-b_2OwHLk.js";
|
|
4
|
+
import { S as s } from "./index-DeoYYWEA.js";
|
|
5
|
+
import { u, r as l, S as d } from "./SlashCommandNodeView-qwW9cuYt.js";
|
|
6
|
+
import { a as F } from "./SlashCommandNodeView-qwW9cuYt.js";
|
|
7
|
+
import { u as o } from "./updatePosition-DY1jI7qb.js";
|
|
8
8
|
import { jsx as f, Fragment as c } from "react/jsx-runtime";
|
|
9
9
|
import { useEffect as h } from "react";
|
|
10
|
-
import { u as C } from "./index-
|
|
10
|
+
import { u as C } from "./index-DKruDABV.js";
|
|
11
11
|
function v({ commandList: e }) {
|
|
12
12
|
const [, t] = u(), { t: r } = C();
|
|
13
13
|
return h(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const d=require("react/jsx-runtime"),m=require("react"),h=require("./index-
|
|
1
|
+
"use strict";const d=require("react/jsx-runtime"),m=require("react"),h=require("./index-BO82_0q8.cjs");require("./theme.cjs");const w=require("./index-CwbGrQFa.cjs"),v=require("./index-DUeBQoIA.cjs");function S({t:i}){const s=[{name:"format",title:i("editor.slash.format"),commands:[]},{name:"insert",title:i("editor.slash.insert"),commands:[]}];return w.HEADINGS.forEach(e=>{s[0].commands.push({name:`heading${e}`,label:i(e==="Paragraph"?"editor.paragraph.tooltip":`editor.heading.h${e}.tooltip`),aliases:[`h${e}`,"bt",`bt${e}`],iconName:`Heading${e}`,isActive:t=>e==="Paragraph"?!1:t.isActive("heading",{level:e})||!1,action:({editor:t,range:l})=>{const a=w.HEADINGS.find(u=>t.isActive("heading",{level:u}));if(e==="Paragraph"){a!==void 0&&a!=="Paragraph"&&t.commands.toggleHeading({level:a}),t.chain().focus().deleteRange(l).run();return}if(e){t.chain().focus().deleteRange(l).setHeading({level:e}).run();return}t.chain().focus().deleteRange(l).run()}})}),s[0].commands.push({name:"bulletList",label:i("editor.bulletlist.tooltip"),aliases:["ul","yxlb"],iconName:"List",isActive:e=>e.isActive("bulletList"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleBulletList().run()}}),s[0].commands.push({name:"orderedlist",label:i("editor.orderedlist.tooltip"),aliases:["ol","yxlb"],iconName:"ListOrdered",isActive:e=>e.isActive("orderedList"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleOrderedList().run()}}),s[0].commands.push({name:"taskList",label:i("editor.tasklist.tooltip"),iconName:"ListTodo",description:"Task list with todo items",aliases:["todo"],isActive:e=>e.isActive("taskList"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleTaskList().run()}}),s[0].commands.push({name:"blockquote",label:i("editor.blockquote.tooltip"),description:"插入引入格式",aliases:["yr"],iconName:"TextQuote",isActive:e=>e.isActive("blockquote"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setBlockquote().run()}}),s[0].commands.push({name:"codeBlock",label:i("editor.codeblock.tooltip"),iconName:"Code2",description:"Code block with syntax highlighting",shouldBeHidden:e=>e.isActive("columns"),isActive:e=>e.isActive("codeBlock"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setCodeBlock().run()}}),s[1].commands.push({name:"image",label:i("editor.image.tooltip"),iconName:"ImageUp",description:"Insert a image",aliases:["image","tp","tupian"],shouldBeHidden:e=>e.isActive("columns"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).run();const l=h.EVENTS.UPLOAD_IMAGE(e.id);h.emit(l,!0)}}),s[1].commands.push({name:"video",label:i("editor.video.tooltip"),iconName:"Video",description:"Insert a video",aliases:["video","sp","shipin"],shouldBeHidden:e=>e.isActive("columns"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).run();const l=h.EVENTS.UPLOAD_VIDEO(e.id);h.emit(l,!0)}}),s[1].commands.push({name:"table",label:i("editor.table.tooltip"),iconName:"Table",description:"Insert a table",aliases:["table","bg","biaoge","biao"],shouldBeHidden:e=>e.isActive("columns"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).insertTable({rows:3,cols:3,withHeaderRow:!1}).run()}}),s[1].commands.push({name:"horizontalRule",label:i("editor.horizontalrule.tooltip"),iconName:"Minus",description:"Insert a horizontal divider",aliases:["hr","fgx","fg"],action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setHorizontalRule().run()}}),s[1].commands.push({name:"columns",label:i("editor.columns.tooltip"),iconName:"Columns2",description:"Add two column content",action:({editor:e})=>{e.chain().focus().insertColumns({cols:2}).run()}}),s}function C(i,s){return i.map(l=>({...l,commands:l.commands.filter(a=>{const u=a.label.toLowerCase().trim(),x=s.toLowerCase().trim();if(a.aliases){const b=a.aliases.map(f=>f.toLowerCase().trim()),r=u.match(x),g=b.some(f=>f.match(x));return r||g}return u.match(x)})})).filter(l=>l.commands.length>0)}const y=v.y([]);function L(){const[i,s]=v.V(y);return[i,s]}function q(i,s){const[e]=L(),[t,l]=m.useState(0),[a,u]=m.useState(0),x=m.useRef(null),{t:b}=w.useLocale(),r=C(e,i.query),g=m.useRef([]);m.useImperativeHandle(s,()=>({onKeyDown:f})),m.useEffect(()=>{if(!x.current)return;const o=a*1e3+t,n=g.current[o];n&&n.scrollIntoView({behavior:"smooth",block:"nearest"})},[t,a]);function f({event:o}){return o.key==="ArrowUp"?(A(),!0):o.key==="ArrowDown"?(I(),!0):o.key==="Enter"?(R(),!0):!1}function A(){var c;if(r.length===0)return!1;let o=t-1,n=a;o<0&&(n=a-1,o=((c=r[n])==null?void 0:c.commands.length)-1||0),n<0&&(n=r.length-1,o=r[n].commands.length-1),l(o),u(n)}function I(){if(r.length===0)return!1;const o=r[a].commands;let n=t+1,c=a;o.length-1<n&&(n=0,c=a+1),r.length-1<c&&(c=0),l(n),u(c)}function R(){if(r.length===0||a===-1||t===-1)return!1;N(a,t)}function N(o,n){const c=r[o].commands[n];i==null||i.command(c)}function k(o,n){N(o,n)}function E(o,n,c){g.current[o*1e3+n]=c}return d.jsx("div",{className:"richtext-max-h-[min(80vh,24rem)] richtext-flex-wrap richtext-overflow-y-auto richtext-overflow-x-hidden richtext-rounded-md !richtext-border !richtext-border-solid !richtext-border-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none","data-richtext-portal":!0,ref:x,children:r!=null&&r.length?d.jsx("div",{className:"richtext-grid richtext-min-w-48 richtext-grid-cols-1 richtext-gap-0.5",children:r==null?void 0:r.map((o,n)=>d.jsxs(m.Fragment,{children:[d.jsx(h.Label,{className:"richtext-mx-[4px] richtext-mb-[4px] richtext-mt-[8px] !richtext-text-[0.65rem] richtext-uppercase",children:o.title}),o.commands.map((c,p)=>d.jsxs("button",{onClick:()=>k(n,p),ref:H=>E(n,p,H),className:h.cn("richtext-flex richtext-w-full richtext-items-center richtext-gap-3 richtext-rounded-sm !richtext-border-none !richtext-bg-transparent richtext-px-2 richtext-py-1.5 richtext-text-left richtext-text-sm richtext-text-foreground !richtext-outline-none richtext-transition-colors hover:!richtext-bg-accent",{"bg-item-active":a===n&&t===p}),children:[c.iconUrl&&d.jsx("img",{alt:"",className:"richtext-size-6",src:c.iconUrl}),c.iconName&&d.jsx(h.IconComponent,{className:"!richtext-mr-1 !richtext-text-lg",name:c.iconName}),c.label]},`command-${p}`))]},`slash-${o.title}`))}):d.jsx("div",{className:"richtext-p-3",children:d.jsx("span",{className:"richtext-text-xs richtext-text-foreground",children:b("editor.slash.empty")})})})}const D=m.forwardRef(q);exports.SlashCommandNodeView=D;exports.renderCommandListDefault=S;exports.useFilterCommandList=C;exports.useSignalCommandList=L;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as d, jsxs as b } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as y, useState as w, useRef as v, useImperativeHandle as S, useEffect as B, Fragment as D } from "react";
|
|
3
|
-
import { E as N,
|
|
3
|
+
import { E as N, F as L, L as T, I as V, c as G } from "./index-DRcwHivm.js";
|
|
4
4
|
import "./theme.js";
|
|
5
|
-
import { H as A, u as
|
|
6
|
-
import { y as
|
|
5
|
+
import { H as A, u as $ } from "./index-DKruDABV.js";
|
|
6
|
+
import { y as z, V as q } from "./index-BJQ1G8B1.js";
|
|
7
7
|
function X({ t: i }) {
|
|
8
8
|
const a = [
|
|
9
9
|
{
|
|
@@ -153,13 +153,13 @@ function P(i, a) {
|
|
|
153
153
|
})
|
|
154
154
|
})).filter((l) => l.commands.length > 0);
|
|
155
155
|
}
|
|
156
|
-
const U =
|
|
157
|
-
function
|
|
156
|
+
const U = z([]);
|
|
157
|
+
function F() {
|
|
158
158
|
const [i, a] = q(U);
|
|
159
159
|
return [i, a];
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
const [e] =
|
|
161
|
+
function O(i, a) {
|
|
162
|
+
const [e] = F(), [t, l] = w(0), [s, m] = w(0), u = v(null), { t: p } = $(), r = P(e, i.query), f = v([]);
|
|
163
163
|
S(a, () => ({
|
|
164
164
|
onKeyDown: h
|
|
165
165
|
})), B(() => {
|
|
@@ -216,7 +216,7 @@ function F(i, a) {
|
|
|
216
216
|
{
|
|
217
217
|
onClick: () => R(n, x),
|
|
218
218
|
ref: (E) => H(n, x, E),
|
|
219
|
-
className:
|
|
219
|
+
className: G(
|
|
220
220
|
"richtext-flex richtext-w-full richtext-items-center richtext-gap-3 richtext-rounded-sm !richtext-border-none !richtext-bg-transparent richtext-px-2 richtext-py-1.5 richtext-text-left richtext-text-sm richtext-text-foreground !richtext-outline-none richtext-transition-colors hover:!richtext-bg-accent",
|
|
221
221
|
{
|
|
222
222
|
"bg-item-active": s === n && t === x
|
|
@@ -240,10 +240,10 @@ function F(i, a) {
|
|
|
240
240
|
}
|
|
241
241
|
);
|
|
242
242
|
}
|
|
243
|
-
const Y = y(
|
|
243
|
+
const Y = y(O);
|
|
244
244
|
export {
|
|
245
245
|
Y as S,
|
|
246
246
|
P as a,
|
|
247
247
|
X as r,
|
|
248
|
-
|
|
248
|
+
F as u
|
|
249
249
|
};
|
package/lib/Strike.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-EoGU7W4e.cjs"),s=require("react/jsx-runtime"),o=require("./index-BO82_0q8.cjs");require("react");require("./theme.cjs");var m=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,h=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,S=r.Mark.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",r.mergeAttributes(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[r.markInputRule({find:m,type:this.type})]},addPasteRules(){return[r.markPasteRule({find:h,type:this.type})]}});function f(){const t=o.useButtonProps(d.name),{icon:e=void 0,tooltip:i=void 0,shortcutKeys:n=void 0,tooltipOptions:c={},action:a=void 0,isActive:l=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:k,disabled:u,update:p}=o.useToggleActive(l),g=()=>{u||a&&(a(),p())};return t?s.jsx(o.ActionButton,{action:g,dataState:k,disabled:u,icon:e,shortcutKeys:n,tooltip:i,tooltipOptions:c}):s.jsx(s.Fragment,{})}const d=S.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:i,extension:n})=>({componentProps:{action:()=>e.commands.toggleStrike(),isActive:()=>e.isActive("strike")||!1,disabled:!1,icon:"Strikethrough",shortcutKeys:n.options.shortcutKeys??["shift","mod","S"],tooltip:i("editor.strike.tooltip")}})}}});exports.RichTextStrike=f;exports.Strike=d;
|
package/lib/Strike.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as m, h as k, j as l, m as g } from "./index-
|
|
1
|
+
import { M as m, h as k, j as l, m as g } from "./index-n4kM0Ll-.js";
|
|
2
2
|
import { jsx as n, Fragment as h } from "react/jsx-runtime";
|
|
3
|
-
import { u as f, d as M, A as S } from "./index-
|
|
3
|
+
import { u as f, d as M, A as S } from "./index-DRcwHivm.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "./theme.js";
|
|
6
6
|
var v = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, A = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, y = m.create({
|