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,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Slot as n } from "@radix-ui/react-slot";
|
|
3
3
|
import r from "react";
|
|
4
|
-
import { i as d, T as m, a as f, B as s, b as u, g } from "./index-
|
|
4
|
+
import { i as d, T as m, a as f, B as s, b as u, g } from "./index-DRcwHivm.js";
|
|
5
5
|
import "./theme.js";
|
|
6
6
|
const C = r.forwardRef(
|
|
7
7
|
({ asChild: x = !1, tooltip: i, ...t }, l) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),a=require("@radix-ui/react-slot"),d=require("react"),i=require("./index-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),a=require("@radix-ui/react-slot"),d=require("react"),i=require("./index-BO82_0q8.cjs");require("./theme.cjs");const s=d.forwardRef(({asChild:h=!1,tooltip:c,...t},l)=>{var n;const x=i.icons[t.icon],r=h?a.Slot:i.Button;return e.jsxs(i.Tooltip,{children:[e.jsx(i.TooltipTrigger,{asChild:!0,children:e.jsx(r,{className:"richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0","data-state":t!=null&&t.dataState?"on":"off",disabled:t==null?void 0:t.disabled,ref:l,variant:"ghost",...t,children:e.jsxs("div",{className:"richtext-flex richtext-h-full richtext-items-center richtext-font-normal",children:[(t==null?void 0:t.title)&&e.jsx("div",{className:"richtext-grow richtext-truncate richtext-text-left richtext-text-sm",children:t==null?void 0:t.title}),x&&e.jsx(x,{className:"richtext-ml-1 richtext-size-3 richtext-shrink-0 richtext-text-zinc-500"})]})})}),c&&e.jsx(i.TooltipContent,{children:e.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[c&&e.jsx("div",{children:c}),e.jsx("div",{className:"richtext-flex",children:!!((n=t==null?void 0:t.shortcutKeys)!=null&&n.length)&&e.jsx("span",{children:i.getShortcutKeys(t==null?void 0:t.shortcutKeys)})})]})})]})});exports.ActionMenuButton=s;
|
package/lib/Attachment.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index-EoGU7W4e.cjs"),u=require("./clsx-DJURdKPs.cjs"),s=require("./index-BO82_0q8.cjs"),e=require("react/jsx-runtime"),v=require("react");require("./theme.cjs");const x=require("lucide-react"),S=require("./index-CwbGrQFa.cjs"),d=require("./dom-dataset-BqoJhJXt.cjs"),B={audio:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-audio-lines"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></svg>',video:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-video"><path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"/><rect x="2" y="6" width="14" height="12" rx="2"/></svg>',file:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>',image:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>',pdf:`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32">
|
|
2
2
|
<path fill="currentColor" d="M30 18v-2h-6v10h2v-4h3v-2h-3v-2zm-11 8h-4V16h4a3.003 3.003 0 0 1 3 3v4a3.003 3.003 0 0 1-3 3m-2-2h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2zm-6-8H6v10h2v-3h3a2.003 2.003 0 0 0 2-2v-3a2 2 0 0 0-2-2m-3 5v-3h3l.001 3z"></path>
|
|
3
3
|
<path fill="currentColor" d="M22 14v-4a.91.91 0 0 0-.3-.7l-7-7A.9.9 0 0 0 14 2H4a2.006 2.006 0 0 0-2 2v24a2 2 0 0 0 2 2h16v-2H4V4h8v6a2.006 2.006 0 0 0 2 2h6v2Zm-8-4V4.4l5.6 5.6Z"></path>
|
|
4
4
|
</svg>`,word:`<svg
|
package/lib/Attachment.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { N as
|
|
2
|
-
import { N as x, c as y, a as D } from "./clsx-
|
|
3
|
-
import { P as R, Q as $, U as I,
|
|
1
|
+
import { N as _, m as P } from "./index-n4kM0Ll-.js";
|
|
2
|
+
import { N as x, c as y, a as D } from "./clsx-b_2OwHLk.js";
|
|
3
|
+
import { P as R, Q as $, U as I, j as O, V as W, W as Z, X as N, A as T, u as K, d as Q } from "./index-DRcwHivm.js";
|
|
4
4
|
import { jsx as e, Fragment as L, jsxs as f } from "react/jsx-runtime";
|
|
5
5
|
import { useRef as U, useState as X, useCallback as k, useEffect as q } from "react";
|
|
6
6
|
import "./theme.js";
|
|
7
7
|
import { LucideTableProperties as G, LucideSheet as J, LucideImage as Y, LucideFile as ee, LucideVideo as te, LucideAudioLines as re } from "lucide-react";
|
|
8
|
-
import { u as ie } from "./index-
|
|
8
|
+
import { u as ie } from "./index-DKruDABV.js";
|
|
9
9
|
import { g as c } from "./dom-dataset-CIEeltF6.js";
|
|
10
10
|
const oe = {
|
|
11
11
|
audio: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-audio-lines"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></svg>',
|
|
@@ -71,13 +71,13 @@ const se = "_wrap_15oj2_2", M = {
|
|
|
71
71
|
};
|
|
72
72
|
function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension: s }) {
|
|
73
73
|
var A;
|
|
74
|
-
const n = U(null), i = O(), { hasTrigger: a, fileName: d, fileSize: h, fileExt: z, fileType: E, url: u, error: H } = o.attrs, [
|
|
74
|
+
const n = U(null), i = O(), { hasTrigger: a, fileName: d, fileSize: h, fileExt: z, fileType: E, url: u, error: H } = o.attrs, [V, v] = X(!1), { t: w } = ie(), F = (A = s == null ? void 0 : s.options) == null ? void 0 : A.upload, m = k(() => {
|
|
75
75
|
!i || u || n.current.click();
|
|
76
|
-
}, [u, i]),
|
|
76
|
+
}, [u, i]), j = k(
|
|
77
77
|
async (C) => {
|
|
78
78
|
const p = C.target.files && C.target.files[0];
|
|
79
79
|
if (!p) return;
|
|
80
|
-
const
|
|
80
|
+
const S = {
|
|
81
81
|
fileName: Z(p.name),
|
|
82
82
|
fileSize: p.size,
|
|
83
83
|
fileType: p.type,
|
|
@@ -85,8 +85,8 @@ function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension:
|
|
|
85
85
|
};
|
|
86
86
|
v(!0);
|
|
87
87
|
try {
|
|
88
|
-
const g = await
|
|
89
|
-
r({ ...
|
|
88
|
+
const g = await F(p);
|
|
89
|
+
r({ ...S, url: g }), v(!1);
|
|
90
90
|
} catch (g) {
|
|
91
91
|
r({
|
|
92
92
|
error: `File upload fail: ${g && g.message}`
|
|
@@ -98,10 +98,10 @@ function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension:
|
|
|
98
98
|
q(() => {
|
|
99
99
|
!u && !a && (m(), r({ hasTrigger: !0 }));
|
|
100
100
|
}, [u, a, m, r]);
|
|
101
|
-
const
|
|
101
|
+
const B = k(() => l(), [t]);
|
|
102
102
|
return i && !u ? /* @__PURE__ */ e(x, { children: /* @__PURE__ */ f("div", { className: y(M.wrap, "render-wrapper"), children: [
|
|
103
|
-
/* @__PURE__ */ e("p", { onClick: m, style: { cursor: "pointer" }, children:
|
|
104
|
-
/* @__PURE__ */ e("input", { hidden: !0, onChange:
|
|
103
|
+
/* @__PURE__ */ e("p", { onClick: m, style: { cursor: "pointer" }, children: V ? /* @__PURE__ */ e("span", { children: w("editor.attachment.uploading") }) : /* @__PURE__ */ e("span", { children: w("editor.attachment.please_upload") }) }),
|
|
104
|
+
/* @__PURE__ */ e("input", { hidden: !0, onChange: j, ref: n, type: "file" })
|
|
105
105
|
] }) }) : u ? /* @__PURE__ */ e(x, { children: /* @__PURE__ */ f("div", { className: y(M.wrap, "render-wrapper"), onClick: m, children: [
|
|
106
106
|
/* @__PURE__ */ f("div", { className: "richtext-flex richtext-items-center richtext-gap-[4px]", children: [
|
|
107
107
|
/* @__PURE__ */ e("span", { children: b(E) }),
|
|
@@ -116,7 +116,7 @@ function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension:
|
|
|
116
116
|
")"
|
|
117
117
|
] })
|
|
118
118
|
] }),
|
|
119
|
-
/* @__PURE__ */ e(T, { action:
|
|
119
|
+
/* @__PURE__ */ e(T, { action: B, icon: "Trash2", tooltip: w("editor.delete") })
|
|
120
120
|
] }) }) : H !== "null" ? /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e("div", { className: y(M.wrap, "render-wrapper"), onClick: m, children: /* @__PURE__ */ e("p", { children: H }) }) }) : /* @__PURE__ */ e(L, {});
|
|
121
121
|
}
|
|
122
122
|
function xe() {
|
|
@@ -142,7 +142,7 @@ function xe() {
|
|
|
142
142
|
}
|
|
143
143
|
) : /* @__PURE__ */ e(L, {});
|
|
144
144
|
}
|
|
145
|
-
const ce = /* @__PURE__ */
|
|
145
|
+
const ce = /* @__PURE__ */ _.create({
|
|
146
146
|
name: "attachment",
|
|
147
147
|
content: "",
|
|
148
148
|
marks: "",
|
package/lib/Blockquote.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-Bcj8cyOO.cjs"),h=require("./jsx-runtime-C_NLcKys.cjs"),d=require("react/jsx-runtime"),p=require("./index-Gi752TMk.cjs");require("react");require("./theme.cjs");var m=/^\s*>\s$/,b=a.Node3.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return h.h("blockquote",{...a.mergeAttributes(this.options.HTMLAttributes,t),children:h.h("slot",{})})},parseMarkdown:(t,e)=>{var o;const n=(o=e.parseBlockChildren)!=null?o:e.parseChildren;return e.createNode("blockquote",void 0,n(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const o=">",n=[];return t.content.forEach((r,i)=>{var s,u;const l=((u=(s=e.renderChild)==null?void 0:s.call(e,r,i))!=null?u:e.renderChildren([r])).split(`
|
|
2
|
-
`).map(
|
|
3
|
-
`))}),
|
|
4
|
-
${
|
|
5
|
-
`)},addCommands(){return{setBlockquote:()=>({commands:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("./index-EoGU7W4e.cjs"),tt=require("./jsx-runtime-C_NLcKys.cjs"),K=require("react/jsx-runtime"),W=require("./index-BO82_0q8.cjs");require("react");require("./theme.cjs");function at(n,t,e){for(let r=0;;r++){if(r==n.childCount||r==t.childCount)return n.childCount==t.childCount?null:e;let i=n.child(r),s=t.child(r);if(i==s){e+=i.nodeSize;continue}if(!i.sameMarkup(s))return e;if(i.isText&&i.text!=s.text){let o=i.text,a=s.text,l=0;for(;o[l]==a[l];l++)e++;return l&&l<o.length&&l<a.length&&ht(o.charCodeAt(l-1))&&ut(o.charCodeAt(l))&&e--,e}if(i.content.size||s.content.size){let o=at(i.content,s.content,e+1);if(o!=null)return o}e+=i.nodeSize}}function lt(n,t,e,r){for(let i=n.childCount,s=t.childCount;;){if(i==0||s==0)return i==s?null:{a:e,b:r};let o=n.child(--i),a=t.child(--s),l=o.nodeSize;if(o==a){e-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:e,b:r};if(o.isText&&o.text!=a.text){let u=o.text,h=a.text,f=u.length,k=h.length;for(;f>0&&k>0&&u[f-1]==h[k-1];)f--,k--,e--,r--;return f&&k&&f<u.length&&ht(u.charCodeAt(f-1))&&ut(u.charCodeAt(f))&&(e++,r++),{a:e,b:r}}if(o.content.size||a.content.size){let u=lt(o.content,a.content,e-1,r-1);if(u)return u}e-=l,r-=l}}function ut(n){return n>=56320&&n<57344}function ht(n){return n>=55296&&n<56320}var g=class d{constructor(t,e){if(this.content=t,this.size=e||0,e==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,e,r,i=0,s){for(let o=0,a=0;a<e;o++){let l=this.content[o],u=a+l.nodeSize;if(u>t&&r(l,i+a,s||null,o)!==!1&&l.content.size){let h=a+1;l.nodesBetween(Math.max(0,t-h),Math.min(l.content.size,e-h),r,i+h)}a=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,r,i){let s="",o=!0;return this.nodesBetween(t,e,(a,l)=>{let u=a.isText?a.text.slice(Math.max(t,l)-l,e-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=u},0),s}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,r=t.firstChild,i=this.content.slice(),s=0;for(e.isText&&e.sameMarkup(r)&&(i[i.length-1]=e.withText(e.text+r.text),s=1);s<t.content.length;s++)i.push(t.content[s]);return new d(i,this.size+t.size)}cut(t,e=this.size){if(t==0&&e==this.size)return this;let r=[],i=0;if(e>t)for(let s=0,o=0;o<e;s++){let a=this.content[s],l=o+a.nodeSize;l>t&&((o<t||l>e)&&(a.isText?a=a.cut(Math.max(0,t-o),Math.min(a.text.length,e-o)):a=a.cut(Math.max(0,t-o-1),Math.min(a.content.size,e-o-1))),r.push(a),i+=a.nodeSize),o=l}return new d(r,i)}cutByIndex(t,e){return t==e?d.empty:t==0&&e==this.content.length?this:new d(this.content.slice(t,e))}replaceChild(t,e){let r=this.content[t];if(r==e)return this;let i=this.content.slice(),s=this.size+e.nodeSize-r.nodeSize;return i[t]=e,new d(i,s)}addToStart(t){return new d([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new d(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,r=0;e<this.content.length;e++){let i=this.content[e];t(i,r,e),r+=i.nodeSize}}findDiffStart(t,e=0){return at(this,t,e)}findDiffEnd(t,e=this.size,r=t.size){return lt(this,t,e,r)}findIndex(t){if(t==0)return F(0,t);if(t==this.size)return F(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let e=0,r=0;;e++){let i=this.child(e),s=r+i.nodeSize;if(s>=t)return s==t?F(e+1,s):F(e,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return d.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return d.fromArray(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return d.empty;let e,r=0;for(let i=0;i<t.length;i++){let s=t[i];r+=s.nodeSize,i&&s.isText&&t[i-1].sameMarkup(s)?(e||(e=t.slice(0,i)),e[e.length-1]=s.withText(e[e.length-1].text+s.text)):e&&e.push(s)}return new d(e||t,r)}static from(t){if(!t)return d.empty;if(t instanceof d)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new d([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};g.empty=new g([],0);var V={index:0,offset:0};function F(n,t){return V.index=n,V.offset=t,V}var Tt=class extends Error{},c=class x{constructor(t,e,r){this.content=t,this.openStart=e,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let r=ft(this.content,t+this.openStart,e,this.openStart+1,this.openEnd+1);return r&&new x(r,this.openStart,this.openEnd)}removeBetween(t,e){return new x(ct(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return x.empty;let r=e.openStart||0,i=e.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new x(g.fromJSON(t,e.content),r,i)}static maxOpen(t,e=!0){let r=0,i=0;for(let s=t.firstChild;s&&!s.isLeaf&&(e||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=t.lastChild;s&&!s.isLeaf&&(e||!s.type.spec.isolating);s=s.lastChild)i++;return new x(t,r,i)}};c.empty=new c(g.empty,0,0);function ct(n,t,e){let{index:r,offset:i}=n.findIndex(t),s=n.maybeChild(r),{index:o,offset:a}=n.findIndex(e);if(i==t||s.isText){if(a!=e&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,t).append(n.cut(e))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,s.copy(ct(s.content,t-i-1,e-i-1)))}function ft(n,t,e,r,i,s){let{index:o,offset:a}=n.findIndex(t),l=n.maybeChild(o);if(a==t||l.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,e)?null:n.cut(0,t).append(e).append(n.cut(t));let u=ft(l.content,t-a-1,e,o==0?r-1:0,o==n.childCount-1?i-1:0,l);return u&&n.replaceChild(o,l.copy(u))}var pt=65535,mt=Math.pow(2,16);function Et(n,t){return n+t*mt}function et(n){return n&pt}function It(n){return(n-(n&pt))/mt}var dt=1,St=2,D=4,gt=8,rt=class{constructor(n,t,e){this.pos=n,this.delInfo=t,this.recover=e}get deleted(){return(this.delInfo>)>0}get deletedBefore(){return(this.delInfo&(dt|D))>0}get deletedAfter(){return(this.delInfo&(St|D))>0}get deletedAcross(){return(this.delInfo&D)>0}},v=class N{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&N.empty)return N.empty}recover(t){let e=0,r=et(t);if(!this.inverted)for(let i=0;i<r;i++)e+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+e+It(t)}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>t)break;let u=this.ranges[a+s],h=this.ranges[a+o],f=l+u;if(t<=f){let k=u?t==l?-1:t==f?1:e:e,T=l+i+(k<0?0:h);if(r)return T;let y=t==(e<0?l:f)?null:Et(a/3,t-l),_=t==l?St:t==f?dt:D;return(e<0?t!=l:t!=f)&&(_|=gt),new rt(T,_,y)}i+=h-u}return r?t+i:new rt(t+i,0,null)}touches(t,e){let r=0,i=et(e),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>t)break;let u=this.ranges[a+s],h=l+u;if(t<=h&&a==i*3)return!0;r+=this.ranges[a+o]-u}return!1}forEach(t){let e=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),u=this.ranges[i+e],h=this.ranges[i+r];t(a,a+u,l,l+h),s+=h-u}}invert(){return new N(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?N.empty:new N(t<0?[0,-t,0]:[0,0,t])}};v.empty=new v([]);var G=Object.create(null),m=class{getMap(){return v.empty}merge(n){return null}static fromJSON(n,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let e=G[t.stepType];if(!e)throw new RangeError(`No step type ${t.stepType} defined`);return e.fromJSON(n,t)}static jsonID(n,t){if(n in G)throw new RangeError("Duplicate use of step JSON ID "+n);return G[n]=t,t.prototype.jsonID=n,t}},S=class E{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new E(t,null)}static fail(t){return new E(null,t)}static fromReplace(t,e,r,i){try{return E.ok(t.replace(e,r,i))}catch(s){if(s instanceof Tt)return E.fail(s.message);throw s}}};function Z(n,t,e){let r=[];for(let i=0;i<n.childCount;i++){let s=n.child(i);s.content.size&&(s=s.copy(Z(s.content,t,s))),s.isInline&&(s=t(s,e,i)),r.push(s)}return g.fromArray(r)}var wt=class I extends m{constructor(t,e,r){super(),this.from=t,this.to=e,this.mark=r}apply(t){let e=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new c(Z(e.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),e.openStart,e.openEnd);return S.fromReplace(t,this.from,this.to,s)}invert(){return new kt(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new I(e.pos,r.pos,this.mark)}merge(t){return t instanceof I&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new I(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new I(e.from,e.to,t.markFromJSON(e.mark))}};m.jsonID("addMark",wt);var kt=class z extends m{constructor(t,e,r){super(),this.from=t,this.to=e,this.mark=r}apply(t){let e=t.slice(this.from,this.to),r=new c(Z(e.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),e.openStart,e.openEnd);return S.fromReplace(t,this.from,this.to,r)}invert(){return new wt(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new z(e.pos,r.pos,this.mark)}merge(t){return t instanceof z&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new z(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new z(e.from,e.to,t.markFromJSON(e.mark))}};m.jsonID("removeMark",kt);var vt=class J extends m{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return S.fail("No node at mark step's position");let r=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return S.fromReplace(t,this.pos,this.pos+1,new c(g.from(r),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let r=this.mark.addToSet(e.marks);if(r.length==e.marks.length){for(let i=0;i<e.marks.length;i++)if(!e.marks[i].isInSet(r))return new J(this.pos,e.marks[i]);return new J(this.pos,this.mark)}}return new yt(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new J(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if(typeof e.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new J(e.pos,t.markFromJSON(e.mark))}};m.jsonID("addNodeMark",vt);var yt=class U extends m{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return S.fail("No node at mark step's position");let r=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return S.fromReplace(t,this.pos,this.pos+1,new c(g.from(r),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return!e||!this.mark.isInSet(e.marks)?this:new vt(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new U(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if(typeof e.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new U(e.pos,t.markFromJSON(e.mark))}};m.jsonID("removeNodeMark",yt);var j=class w extends m{constructor(t,e,r,i=!1){super(),this.from=t,this.to=e,this.slice=r,this.structure=i}apply(t){return this.structure&&X(t,this.from,this.to)?S.fail("Structure replace would overwrite content"):S.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new v([this.from,this.to-this.from,this.slice.size])}invert(t){return new w(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.to,-1),r=this.from==this.to&&w.MAP_BIAS<0?e:t.mapResult(this.from,1);return r.deletedAcross&&e.deletedAcross?null:new w(r.pos,Math.max(r.pos,e.pos),this.slice,this.structure)}merge(t){if(!(t instanceof w)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let e=this.slice.size+t.slice.size==0?c.empty:new c(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new w(this.from,this.to+(t.to-t.from),e,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let e=this.slice.size+t.slice.size==0?c.empty:new c(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new w(t.from,this.to,e,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new w(e.from,e.to,c.fromJSON(t,e.slice),!!e.structure)}};j.MAP_BIAS=1;m.jsonID("replace",j);var xt=class L extends m{constructor(t,e,r,i,s,o,a=!1){super(),this.from=t,this.to=e,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(t){if(this.structure&&(X(t,this.from,this.gapFrom)||X(t,this.gapTo,this.to)))return S.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return S.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,e.content);return r?S.fromReplace(t,this.from,this.to,r):S.fail("Content does not fit in gap")}getMap(){return new v([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new L(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return e.deletedAcross&&r.deletedAcross||i<e.pos||s>r.pos?null:new L(e.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number"||typeof e.gapFrom!="number"||typeof e.gapTo!="number"||typeof e.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new L(e.from,e.to,e.gapFrom,e.gapTo,c.fromJSON(t,e.slice),e.insert,!!e.structure)}};m.jsonID("replaceAround",xt);function X(n,t,e){let r=n.resolve(t),i=e-t,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}var zt=class P extends m{constructor(t,e,r){super(),this.pos=t,this.attr=e,this.value=r}apply(t){let e=t.nodeAt(this.pos);if(!e)return S.fail("No node at attribute step's position");let r=Object.create(null);for(let s in e.attrs)r[s]=e.attrs[s];r[this.attr]=this.value;let i=e.type.create(r,null,e.marks);return S.fromReplace(t,this.pos,this.pos+1,new c(g.from(i),0,e.isLeaf?0:1))}getMap(){return v.empty}invert(t){return new P(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new P(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if(typeof e.pos!="number"||typeof e.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new P(e.pos,e.attr,e.value)}};m.jsonID("attr",zt);var Jt=class Y extends m{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let i in t.attrs)e[i]=t.attrs[i];e[this.attr]=this.value;let r=t.type.create(e,t.content,t.marks);return S.ok(r)}getMap(){return v.empty}invert(t){return new Y(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if(typeof e.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Y(e.attr,e.value)}};m.jsonID("docAttr",Jt);var B=class extends Error{};B=function n(t){let e=Error.call(this,t);return e.__proto__=n.prototype,e};B.prototype=Object.create(Error.prototype);B.prototype.constructor=B;B.prototype.name="TransformError";var Q=Object.create(null),p=class{constructor(n,t,e){this.$anchor=n,this.$head=t,this.ranges=e||[new bt(n.min(t),n.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let n=this.ranges;for(let t=0;t<n.length;t++)if(n[t].$from.pos!=n[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(n,t=c.empty){let e=t.content.lastChild,r=null;for(let o=0;o<t.openEnd;o++)r=e,e=e.lastChild;let i=n.steps.length,s=this.ranges;for(let o=0;o<s.length;o++){let{$from:a,$to:l}=s[o],u=n.mapping.slice(i);n.replaceRange(u.map(a.pos),u.map(l.pos),o?c.empty:t),o==0&&st(n,i,(e?e.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(n,t){let e=n.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:s,$to:o}=r[i],a=n.mapping.slice(e),l=a.map(s.pos),u=a.map(o.pos);i?n.deleteRange(l,u):(n.replaceRangeWith(l,u,t),st(n,e,t.isInline?-1:1))}}static findFrom(n,t,e=!1){let r=n.parent.inlineContent?new A(n):R(n.node(0),n.parent,n.pos,n.index(),t,e);if(r)return r;for(let i=n.depth-1;i>=0;i--){let s=t<0?R(n.node(0),n.node(i),n.before(i+1),n.index(i),t,e):R(n.node(0),n.node(i),n.after(i+1),n.index(i)+1,t,e);if(s)return s}return null}static near(n,t=1){return this.findFrom(n,t)||this.findFrom(n,-t)||new C(n.node(0))}static atStart(n){return R(n,n,0,0,1)||new C(n)}static atEnd(n){return R(n,n,n.content.size,n.childCount,-1)||new C(n)}static fromJSON(n,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let e=Q[t.type];if(!e)throw new RangeError(`No selection type ${t.type} defined`);return e.fromJSON(n,t)}static jsonID(n,t){if(n in Q)throw new RangeError("Duplicate use of selection JSON ID "+n);return Q[n]=t,t.prototype.jsonID=n,t}getBookmark(){return A.between(this.$anchor,this.$head).getBookmark()}};p.prototype.visible=!0;var bt=class{constructor(n,t){this.$from=n,this.$to=t}},nt=!1;function it(n){!nt&&!n.parent.inlineContent&&(nt=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}var A=class b extends p{constructor(t,e=t){it(t),it(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let r=t.resolve(e.map(this.head));if(!r.parent.inlineContent)return p.near(r);let i=t.resolve(e.map(this.anchor));return new b(i.parent.inlineContent?i:r,r)}replace(t,e=c.empty){if(super.replace(t,e),e==c.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof b&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Nt(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if(typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new b(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,r=e){let i=t.resolve(e);return new this(i,r==e?i:t.resolve(r))}static between(t,e,r){let i=t.pos-e.pos;if((!r||i)&&(r=i>=0?1:-1),!e.parent.inlineContent){let s=p.findFrom(e,r,!0)||p.findFrom(e,-r,!0);if(s)e=s.$head;else return p.near(e,r)}return t.parent.inlineContent||(i==0?t=e:(t=(p.findFrom(t,-r,!0)||p.findFrom(t,r,!0)).$anchor,t.pos<e.pos!=i<0&&(t=e))),new b(t,e)}};p.jsonID("text",A);var Nt=class Rt{constructor(t,e){this.anchor=t,this.head=e}map(t){return new Rt(t.map(this.anchor),t.map(this.head))}resolve(t){return A.between(t.resolve(this.anchor),t.resolve(this.head))}},O=class M extends p{constructor(t){let e=t.nodeAfter,r=t.node(0).resolve(t.pos+e.nodeSize);super(t,r),this.node=e}map(t,e){let{deleted:r,pos:i}=e.mapResult(this.anchor),s=t.resolve(i);return r?p.near(s):new M(s)}content(){return new c(g.from(this.node),0,0)}eq(t){return t instanceof M&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Mt(this.anchor)}static fromJSON(t,e){if(typeof e.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new M(t.resolve(e.anchor))}static create(t,e){return new M(t.resolve(e))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}};O.prototype.visible=!1;p.jsonID("node",O);var Mt=class At{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:r}=t.mapResult(this.anchor);return e?new Nt(r,r):new At(r)}resolve(t){let e=t.resolve(this.anchor),r=e.nodeAfter;return r&&O.isSelectable(r)?new O(e):p.near(e)}},C=class H extends p{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=c.empty){if(e==c.empty){t.delete(0,t.doc.content.size);let r=p.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new H(t)}map(t){return new H(t)}eq(t){return t instanceof H}getBookmark(){return Ct}};p.jsonID("all",C);var Ct={map(){return this},resolve(n){return new C(n)}};function R(n,t,e,r,i,s=!1){if(t.inlineContent)return A.create(n,e);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let a=t.child(o);if(a.isAtom){if(!s&&O.isSelectable(a))return O.create(n,e-(i<0?a.nodeSize:0))}else{let l=R(n,a,e+i,i<0?a.childCount:0,i,s);if(l)return l}e+=a.nodeSize*i}return null}function st(n,t,e){let r=n.steps.length-1;if(r<t)return;let i=n.steps[r];if(!(i instanceof j||i instanceof xt))return;let s=n.mapping.maps[r],o;s.forEach((a,l,u,h)=>{o==null&&(o=h)}),n.setSelection(p.near(n.doc.resolve(o),e))}function ot(n,t){return!t||!n?n:n.bind(t)}var q=class{constructor(n,t,e){this.name=n,this.init=ot(t.init,e),this.apply=ot(t.apply,e)}};new q("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new q("selection",{init(n,t){return n.selection||p.atStart(t.doc)},apply(n){return n.selection}}),new q("storedMarks",{init(n){return n.storedMarks||null},apply(n,t,e,r){return r.selection.$cursor?n.storedMarks:null}}),new q("scrollToSelection",{init(){return 0},apply(n,t){return n.scrolledIntoView?t+1:t}});var Bt=(n,t)=>{var e;const{state:r,view:i}=n,{selection:s}=r;if(!s.empty)return!1;const{$from:o}=s;if(o.parentOffset!==0)return!1;const a=o.depth-1,l=o.node(a),u=o.index(a);if(u===0)return!1;if(l.type===t)return n.commands.lift(t.name);const h=l.child(u-1);if(h.type!==t||!((e=h.lastChild)!=null&&e.isTextblock))return!1;const f=o.before(),T=f-1-1,{tr:y}=r;return y.delete(f,o.after()).insert(T,o.parent.content),y.setSelection(A.create(y.doc,T)),i.dispatch(y.scrollIntoView()),!0},Ft=/^\s*>\s$/,qt=$.Node3.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return tt.h("blockquote",{...$.mergeAttributes(this.options.HTMLAttributes,n),children:tt.h("slot",{})})},parseMarkdown:(n,t)=>{var e;const r=(e=t.parseBlockChildren)!=null?e:t.parseChildren;return t.createNode("blockquote",void 0,r(n.tokens||[]))},renderMarkdown:(n,t)=>{if(!n.content)return"";const e=">",r=[];return n.content.forEach((i,s)=>{var o,a;const h=((a=(o=t.renderChild)==null?void 0:o.call(t,i,s))!=null?a:t.renderChildren([i])).split(`
|
|
2
|
+
`).map(f=>f.trim()===""?e:`${e} ${f}`);r.push(h.join(`
|
|
3
|
+
`))}),r.join(`
|
|
4
|
+
${e}
|
|
5
|
+
`)},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>Bt(this.editor,this.type)}},addInputRules(){return[$.wrappingInputRule({find:Ft,type:this.type})]}});function Dt(){const n=W.useButtonProps(Ot.name),{icon:t=void 0,tooltip:e=void 0,shortcutKeys:r=void 0,tooltipOptions:i={},action:s=void 0,isActive:o=void 0}=(n==null?void 0:n.componentProps)??{},{dataState:a,disabled:l,update:u}=W.useToggleActive(o),h=()=>{l||s&&(s(),u())};return n?K.jsx(W.ActionButton,{action:h,dataState:a,disabled:l,icon:t,shortcutKeys:r,tooltip:e,tooltipOptions:i}):K.jsx(K.Fragment,{})}const Ot=qt.extend({addOptions(){var n;return{...(n=this.parent)==null?void 0:n.call(this),HTMLAttributes:{class:"blockquote"},button:({editor:t,t:e,extension:r})=>({componentProps:{action:()=>t.commands.toggleBlockquote(),isActive:()=>t.isActive("blockquote"),disabled:!t.can().toggleBlockquote(),icon:"TextQuote",shortcutKeys:r.options.shortcutKeys??["shift","mod","B"],tooltip:e("editor.blockquote.tooltip")}})}}});exports.Blockquote=Ot;exports.RichTextBlockquote=Dt;
|