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/Bold.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-EoGU7W4e.cjs"),u=require("./jsx-runtime-C_NLcKys.cjs"),n=require("./index-BO82_0q8.cjs"),i=require("react/jsx-runtime");require("react");require("./theme.cjs");var y=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,_=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,B=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,k=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,v=o.Mark.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return u.h("strong",{...o.mergeAttributes(this.options.HTMLAttributes,t),children:u.h("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[o.markInputRule({find:y,type:this.type}),o.markInputRule({find:B,type:this.type})]},addPasteRules(){return[o.markPasteRule({find:_,type:this.type}),o.markPasteRule({find:k,type:this.type})]}});function M(){const t=n.useButtonProps(l.name),{icon:e=void 0,tooltip:r=void 0,shortcutKeys:s=void 0,tooltipOptions:c={},action:d=void 0,isActive:p=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:g,disabled:a,update:m}=n.useToggleActive(p),h=()=>{a||d&&(d(),m())};return t?i.jsx(n.ActionButton,{action:h,dataState:g,disabled:a,icon:e,shortcutKeys:s,tooltip:r,tooltipOptions:c}):i.jsx(i.Fragment,{})}const l=v.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:r,extension:s})=>({component:n.ActionButton,componentProps:{action:()=>e.commands.toggleBold(),isActive:()=>e.isActive("bold"),icon:"Bold",shortcutKeys:s.options.shortcutKeys??["mod","B"],tooltip:r("editor.bold.tooltip")}})}}});exports.Bold=l;exports.RichTextBold=M;
|
package/lib/Bold.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as _, h as a, j as i, m as y } from "./index-
|
|
2
|
-
import { h as d } from "./jsx-runtime-
|
|
3
|
-
import { u as f, d as M, A as u } from "./index-
|
|
1
|
+
import { M as _, h as a, j as i, m as y } from "./index-n4kM0Ll-.js";
|
|
2
|
+
import { h as d } from "./jsx-runtime-DE8oVoME.js";
|
|
3
|
+
import { u as f, d as M, A as u } from "./index-DRcwHivm.js";
|
|
4
4
|
import { jsx as l, Fragment as k } from "react/jsx-runtime";
|
|
5
5
|
import "react";
|
|
6
6
|
import "./theme.js";
|
package/lib/BulletList.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"),s=require("react/jsx-runtime"),n=require("./index-BO82_0q8.cjs");require("react");require("./theme.cjs");function g(){const t=n.useButtonProps(l.name),{icon:e=void 0,tooltip:i=void 0,shortcutKeys:o=void 0,tooltipOptions:r={},action:c=void 0,isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:a,disabled:u,update:p}=n.useToggleActive(d),m=()=>{u||c&&(c(),p())};return t?s.jsx(n.ActionButton,{action:m,dataState:a,disabled:u,icon:e,shortcutKeys:o,tooltip:i,tooltipOptions:r}):s.jsx(s.Fragment,{})}const l=v.BulletList.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.toggleBulletList(),isActive:()=>e.isActive("bulletList"),disabled:!1,shortcutKeys:o.options.shortcutKeys??["shift","mod","8"],icon:"List",tooltip:i("editor.bulletlist.tooltip")}})}}});exports.BulletList=l;exports.RichTextBulletList=g;
|
package/lib/BulletList.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as d } from "./index-
|
|
1
|
+
import { B as d } from "./index-DjB2kNdz.js";
|
|
2
2
|
import { jsx as c, Fragment as m } from "react/jsx-runtime";
|
|
3
|
-
import { u as f, d as v, A } from "./index-
|
|
3
|
+
import { u as f, d as v, A } from "./index-DRcwHivm.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "./theme.js";
|
|
6
6
|
function y() {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { N as U, m as E } from "./index-
|
|
2
|
-
import { N as W, c as N, a as F } from "./clsx-
|
|
3
|
-
import { c as l, h as Y, u as _, d as $, D as K,
|
|
1
|
+
import { N as U, m as E } from "./index-n4kM0Ll-.js";
|
|
2
|
+
import { N as W, c as N, a as F } from "./clsx-b_2OwHLk.js";
|
|
3
|
+
import { c as l, h as Y, u as _, d as $, D as K, s as q, A as S, v as G, w as J, L as p, k as C, x as Q, B as w } from "./index-DRcwHivm.js";
|
|
4
4
|
import { jsxs as c, jsx as e, Fragment as X } from "react/jsx-runtime";
|
|
5
5
|
import * as d from "react";
|
|
6
6
|
import { useState as x } from "react";
|
|
7
7
|
import "./theme.js";
|
|
8
8
|
import { ChevronDown as A, Check as Z, ChevronUp as tt, Info as et, Lightbulb as rt, AlertCircle as it, TriangleAlert as at, OctagonAlert as ct } from "lucide-react";
|
|
9
9
|
import * as a from "@radix-ui/react-select";
|
|
10
|
-
import { u as ot } from "./index-
|
|
10
|
+
import { u as ot } from "./index-DKruDABV.js";
|
|
11
11
|
const lt = a.Root, nt = a.Value, L = d.forwardRef(({ className: t, children: r, ...i }, o) => /* @__PURE__ */ c(
|
|
12
12
|
a.Trigger,
|
|
13
13
|
{
|
|
@@ -50,7 +50,7 @@ const R = d.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ e(
|
|
|
50
50
|
}
|
|
51
51
|
));
|
|
52
52
|
R.displayName = a.ScrollDownButton.displayName;
|
|
53
|
-
const
|
|
53
|
+
const k = d.forwardRef(({ className: t, children: r, position: i = "popper", ...o }, n) => /* @__PURE__ */ e(a.Portal, { children: /* @__PURE__ */ c(
|
|
54
54
|
a.Content,
|
|
55
55
|
{
|
|
56
56
|
"data-richtext-portal": !0,
|
|
@@ -78,7 +78,7 @@ const B = d.forwardRef(({ className: t, children: r, position: i = "popper", ...
|
|
|
78
78
|
]
|
|
79
79
|
}
|
|
80
80
|
) }));
|
|
81
|
-
|
|
81
|
+
k.displayName = a.Content.displayName;
|
|
82
82
|
const st = d.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ e(
|
|
83
83
|
a.Label,
|
|
84
84
|
{
|
|
@@ -91,7 +91,7 @@ const st = d.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ e(
|
|
|
91
91
|
}
|
|
92
92
|
));
|
|
93
93
|
st.displayName = a.Label.displayName;
|
|
94
|
-
const
|
|
94
|
+
const B = d.forwardRef(({ className: t, children: r, ...i }, o) => /* @__PURE__ */ c(
|
|
95
95
|
a.Item,
|
|
96
96
|
{
|
|
97
97
|
ref: o,
|
|
@@ -106,7 +106,7 @@ const k = d.forwardRef(({ className: t, children: r, ...i }, o) => /* @__PURE__
|
|
|
106
106
|
]
|
|
107
107
|
}
|
|
108
108
|
));
|
|
109
|
-
|
|
109
|
+
B.displayName = a.Item.displayName;
|
|
110
110
|
const dt = d.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ e(
|
|
111
111
|
a.Separator,
|
|
112
112
|
{
|
|
@@ -161,11 +161,11 @@ function ht({ node: t }) {
|
|
|
161
161
|
className: N(
|
|
162
162
|
"richtext-relative richtext-my-4 richtext-rounded-lg richtext-border richtext-p-4",
|
|
163
163
|
{
|
|
164
|
-
"richtext-
|
|
165
|
-
"richtext-
|
|
166
|
-
"richtext-
|
|
167
|
-
"richtext-
|
|
168
|
-
"richtext-
|
|
164
|
+
"richtext-border-[#1f6feb] richtext-bg-[#1f6feb1f]": r === "note",
|
|
165
|
+
"richtext-border-[#238636] richtext-bg-[#2386361f]": r === "tip",
|
|
166
|
+
"richtext-border-[#ab7df8] richtext-bg-[#ab7df81f]": r === "important",
|
|
167
|
+
"richtext-border-[#d29922] richtext-bg-[#d299221f]": r === "warning",
|
|
168
|
+
"richtext-border-[#f85149] richtext-bg-[#f851491f]": r === "caution"
|
|
169
169
|
}
|
|
170
170
|
),
|
|
171
171
|
children: [
|
|
@@ -203,8 +203,8 @@ function Ct() {
|
|
|
203
203
|
tooltip: z = void 0,
|
|
204
204
|
shortcutKeys: O = void 0,
|
|
205
205
|
tooltipOptions: V = {},
|
|
206
|
-
isActive:
|
|
207
|
-
} = (i == null ? void 0 : i.componentProps) ?? {}, { dataState:
|
|
206
|
+
isActive: H = void 0
|
|
207
|
+
} = (i == null ? void 0 : i.componentProps) ?? {}, { dataState: M, disabled: v } = $(H), j = () => {
|
|
208
208
|
r && (r.chain().focus().setCallout({ type: h, title: f, body: g }).run(), n(!1), u("note"), b(""), y(""));
|
|
209
209
|
}, P = () => {
|
|
210
210
|
v || n(!0);
|
|
@@ -214,7 +214,7 @@ function Ct() {
|
|
|
214
214
|
S,
|
|
215
215
|
{
|
|
216
216
|
action: P,
|
|
217
|
-
dataState:
|
|
217
|
+
dataState: M,
|
|
218
218
|
disabled: v,
|
|
219
219
|
icon: D,
|
|
220
220
|
shortcutKeys: O,
|
|
@@ -229,7 +229,7 @@ function Ct() {
|
|
|
229
229
|
/* @__PURE__ */ e(p, { children: t("editor.callout.dialog.type") }),
|
|
230
230
|
/* @__PURE__ */ c(lt, { onValueChange: u, value: h, children: [
|
|
231
231
|
/* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(nt, { placeholder: t("editor.callout.dialog.type.placeholder") }) }),
|
|
232
|
-
/* @__PURE__ */ e(
|
|
232
|
+
/* @__PURE__ */ e(k, { children: ut.map((s) => /* @__PURE__ */ e(B, { value: s.value, children: t(`editor.callout.type.${s.value}`) }, s.value)) })
|
|
233
233
|
] })
|
|
234
234
|
] }),
|
|
235
235
|
/* @__PURE__ */ c("div", { className: "richtext-space-y-2", children: [
|
|
@@ -257,7 +257,7 @@ function Ct() {
|
|
|
257
257
|
] }),
|
|
258
258
|
/* @__PURE__ */ c(Q, { children: [
|
|
259
259
|
/* @__PURE__ */ e(w, { onClick: () => n(!1), variant: "outline", children: t("editor.callout.dialog.button.cancel") }),
|
|
260
|
-
/* @__PURE__ */ e(w, { onClick:
|
|
260
|
+
/* @__PURE__ */ e(w, { onClick: j, children: t("editor.callout.dialog.button.apply") })
|
|
261
261
|
] })
|
|
262
262
|
] })
|
|
263
263
|
] }) : /* @__PURE__ */ e(X, {});
|
|
@@ -335,6 +335,6 @@ export {
|
|
|
335
335
|
lt as S,
|
|
336
336
|
L as a,
|
|
337
337
|
nt as b,
|
|
338
|
-
|
|
339
|
-
|
|
338
|
+
k as c,
|
|
339
|
+
B as d
|
|
340
340
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const S=require("./index-
|
|
1
|
+
"use strict";const S=require("./index-EoGU7W4e.cjs"),p=require("./clsx-DJURdKPs.cjs"),c=require("./index-BO82_0q8.cjs"),t=require("react/jsx-runtime"),x=require("react");require("./theme.cjs");const l=require("lucide-react"),H=require("@radix-ui/react-select"),_=require("./index-CwbGrQFa.cjs");function T(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const o=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(r,i,o.get?o:{enumerable:!0,get:()=>e[i]})}}return r.default=e,Object.freeze(r)}const d=T(x),a=T(H),A=a.Root,L=a.Value,m=d.forwardRef(({className:e,children:r,...i},o)=>t.jsxs(a.Trigger,{ref:o,className:c.cn("richtext-flex richtext-h-10 richtext-w-full richtext-items-center richtext-justify-between richtext-rounded-md richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-text-foreground richtext-ring-offset-background placeholder:richtext-text-muted-foreground focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-1 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 [&>span]:richtext-line-clamp-1",e),...i,children:[r,t.jsx(a.Icon,{asChild:!0,children:t.jsx(l.ChevronDown,{className:"richtext-size-4 richtext-opacity-50"})})]}));m.displayName=a.Trigger.displayName;const I=d.forwardRef(({className:e,...r},i)=>t.jsx(a.ScrollUpButton,{ref:i,className:c.cn("richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",e),...r,children:t.jsx(l.ChevronUp,{className:"richtext-size-4"})}));I.displayName=a.ScrollUpButton.displayName;const R=d.forwardRef(({className:e,...r},i)=>t.jsx(a.ScrollDownButton,{ref:i,className:c.cn("richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",e),...r,children:t.jsx(l.ChevronDown,{className:"richtext-size-4"})}));R.displayName=a.ScrollDownButton.displayName;const b=d.forwardRef(({className:e,children:r,position:i="popper",...o},n)=>t.jsx(a.Portal,{children:t.jsxs(a.Content,{"data-richtext-portal":!0,position:i,ref:n,className:c.cn("richtext-relative richtext-z-50 richtext-max-h-60 richtext-min-w-[8rem] richtext-overflow-hidden richtext-overflow-y-auto richtext-rounded-md richtext-border !richtext-border-border richtext-bg-popover richtext-text-popover-foreground richtext-shadow-md data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",i==="popper"&&"data-[side=bottom]:richtext-translate-y-1 data-[side=left]:richtext--translate-x-1 data-[side=right]:richtext-translate-x-1 data-[side=top]:richtext--translate-y-1",e),...o,children:[t.jsx(I,{}),t.jsx(a.Viewport,{className:c.cn("richtext-p-1",i==="popper"&&"richtext-h-[var(--radix-select-trigger-height)] richtext-w-full richtext-min-w-[var(--radix-select-trigger-width)]"),children:r}),t.jsx(R,{})]})}));b.displayName=a.Content.displayName;const U=d.forwardRef(({className:e,...r},i)=>t.jsx(a.Label,{className:c.cn("richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-font-semibold",e),ref:i,...r}));U.displayName=a.Label.displayName;const g=d.forwardRef(({className:e,children:r,...i},o)=>t.jsxs(a.Item,{ref:o,className:c.cn("richtext-relative richtext-flex richtext-w-full richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",e),...i,children:[t.jsx("span",{className:"richtext-absolute richtext-left-2 richtext-flex richtext-size-3.5 richtext-items-center richtext-justify-center",children:t.jsx(a.ItemIndicator,{children:t.jsx(l.Check,{className:"richtext-size-4"})})}),t.jsx(a.ItemText,{children:r})]}));g.displayName=a.Item.displayName;const E=d.forwardRef(({className:e,...r},i)=>t.jsx(a.Separator,{className:c.cn("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted",e),ref:i,...r}));E.displayName=a.Separator.displayName;const w=[{value:"note",label:"Note",icon:l.Info,color:"#1f6feb",background:"#1f6feb1f"},{value:"tip",label:"Tip",icon:l.Lightbulb,color:"#238636",background:"#2386361f"},{value:"important",label:"Important",icon:l.AlertCircle,color:"#ab7df8",background:"#ab7df81f"},{value:"warning",label:"Warning",icon:l.TriangleAlert,color:"#d29922",background:"#d299221f"},{value:"caution",label:"Caution",icon:l.OctagonAlert,color:"#f85149",background:"#f851491f"}];function W({node:e}){const{type:r="note",title:i="",body:o=""}=e.attrs,h=(w.find(u=>u.value===r)||w[0]).icon;return t.jsx(p.NodeViewWrapper,{children:t.jsxs("div",{className:p.clsx("richtext-relative richtext-my-4 richtext-rounded-lg richtext-border richtext-p-4",{"richtext-border-[#1f6feb] richtext-bg-[#1f6feb1f]":r==="note","richtext-border-[#238636] richtext-bg-[#2386361f]":r==="tip","richtext-border-[#ab7df8] richtext-bg-[#ab7df81f]":r==="important","richtext-border-[#d29922] richtext-bg-[#d299221f]":r==="warning","richtext-border-[#f85149] richtext-bg-[#f851491f]":r==="caution"}),children:[t.jsxs("div",{className:p.clsx("richtext-mb-2 richtext-flex richtext-items-center richtext-gap-2",{"richtext-text-[#1f6feb]":r==="note","richtext-text-[#238636]":r==="tip","richtext-text-[#ab7df8]":r==="important","richtext-text-[#d29922]":r==="warning","richtext-text-[#f85149]":r==="caution"}),children:[t.jsx(h,{className:"richtext-size-5"}),t.jsx("span",{className:"richtext-font-semibold",children:i})]}),o&&t.jsx("p",{className:"richtext-pl-[28px]",children:o})]})})}const $=[{value:"note",label:"Note",icon:"Info"},{value:"tip",label:"Tip",icon:"Lightbulb"},{value:"important",label:"Important",icon:"AlertCircle"},{value:"warning",label:"Warning",icon:"TriangleAlert"},{value:"caution",label:"Caution",icon:"OctagonAlert"}];function F(){const{t:e}=_.useLocale(),r=c.useEditorInstance(),i=c.useButtonProps(B.name),[o,n]=x.useState(!1),[h,u]=x.useState("note"),[y,j]=x.useState(""),[v,N]=x.useState(""),{icon:D=void 0,tooltip:O=void 0,shortcutKeys:k=void 0,tooltipOptions:z={},isActive:q=void 0}=(i==null?void 0:i.componentProps)??{},{dataState:P,disabled:C}=c.useToggleActive(q),V=()=>{r&&(r.chain().focus().setCallout({type:h,title:y,body:v}).run(),n(!1),u("note"),j(""),N(""))},M=()=>{C||n(!0)};return i?t.jsxs(c.Dialog,{onOpenChange:n,open:o,children:[t.jsx(c.DialogTrigger,{asChild:!0,children:t.jsx(c.ActionButton,{action:M,dataState:P,disabled:C,icon:D,shortcutKeys:k,tooltip:O,tooltipOptions:z})}),t.jsxs(c.DialogContent,{children:[t.jsx(c.DialogTitle,{children:e("editor.callout.dialog.title")}),t.jsxs("div",{className:"richtext-space-y-4 richtext-py-4",children:[t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(c.Label,{children:e("editor.callout.dialog.type")}),t.jsxs(A,{onValueChange:u,value:h,children:[t.jsx(m,{children:t.jsx(L,{placeholder:e("editor.callout.dialog.type.placeholder")})}),t.jsx(b,{children:$.map(s=>t.jsx(g,{value:s.value,children:e(`editor.callout.type.${s.value}`)},s.value))})]})]}),t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(c.Label,{children:e("editor.callout.dialog.title.label")}),t.jsx(c.Input,{onChange:s=>j(s.target.value),placeholder:e("editor.callout.dialog.title.placeholder"),value:y})]}),t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(c.Label,{children:e("editor.callout.dialog.body.label")}),t.jsx(c.Input,{onChange:s=>N(s.target.value),placeholder:e("editor.callout.dialog.body.placeholder"),value:v})]})]}),t.jsxs(c.DialogFooter,{children:[t.jsx(c.Button,{onClick:()=>n(!1),variant:"outline",children:e("editor.callout.dialog.button.cancel")}),t.jsx(c.Button,{onClick:V,children:e("editor.callout.dialog.button.apply")})]})]})]}):t.jsx(t.Fragment,{})}function f(e){return r=>r.getAttribute(e)}const B=S.Node3.create({name:"callout",group:"block",selectable:!0,atom:!0,draggable:!0,inline:!1,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{class:"callout"},button:({editor:r,t:i})=>({component:c.ActionButton,componentProps:{action:()=>!0,isActive:()=>r.isActive("callout"),disabled:!1,icon:"Callout",tooltip:i("editor.callout.tooltip")}})}},parseHTML(){return[{tag:"div.callout"}]},renderHTML({HTMLAttributes:e}){return["div",S.mergeAttributes(this.options&&this.options.HTMLAttributes||{},e)]},addAttributes(){return{type:{default:"",parseHTML:f("type")},title:{default:"",parseHTML:f("title")},body:{default:"",parseHTML:f("body")}}},addCommands(){return{setCallout:e=>({chain:r})=>r().insertContent({type:this.name,attrs:e}).run()}},addNodeView(){return p.ReactNodeViewRenderer(W)}});exports.Callout=B;exports.RichTextCallout=F;exports.Select=A;exports.SelectContent=b;exports.SelectItem=g;exports.SelectTrigger=m;exports.SelectValue=L;
|
package/lib/Callout.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-EoGU7W4e.cjs");require("./clsx-DJURdKPs.cjs");require("./index-BO82_0q8.cjs");require("react/jsx-runtime");require("react");require("./theme.cjs");const e=require("./Callout-C_TXsss3.cjs");exports.Callout=e.Callout;exports.RichTextCallout=e.RichTextCallout;
|
package/lib/Callout.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import "./clsx-
|
|
3
|
-
import "./index-
|
|
1
|
+
import "./index-n4kM0Ll-.js";
|
|
2
|
+
import "./clsx-b_2OwHLk.js";
|
|
3
|
+
import "./index-DRcwHivm.js";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "react";
|
|
6
6
|
import "./theme.js";
|
|
7
|
-
import { C, R as e } from "./Callout-
|
|
7
|
+
import { C, R as e } from "./Callout-B9uXfbP3.js";
|
|
8
8
|
export {
|
|
9
9
|
C as Callout,
|
|
10
10
|
e as RichTextCallout
|
package/lib/Clear.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index-EoGU7W4e.cjs"),n=require("react/jsx-runtime"),i=require("./index-BO82_0q8.cjs");function v(){const t=i.useButtonProps(s.name),{icon:e=void 0,tooltip:o=void 0,shortcutKeys:a=void 0,tooltipOptions:u={},action:r=void 0,isActive:l=void 0}=(t==null?void 0:t.componentProps)??{},{disabled:c}=i.useActive(l),d=()=>{c||r&&r()};return t?n.jsx(i.ActionButton,{action:d,disabled:c,icon:e,shortcutKeys:a,tooltip:o,tooltipOptions:u}):n.jsx(n.Fragment,{})}const s=p.Node3.create({name:"clear",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:o})=>({componentProps:{action:()=>e.chain().focus().clearNodes().unsetAllMarks().run(),isActive:()=>e.can().chain().focus().clearNodes().unsetAllMarks().run(),icon:"Eraser",tooltip:o("editor.clear.tooltip")}})}}});exports.Clear=s;exports.RichTextClear=v;
|
package/lib/Clear.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { N as l } from "./index-
|
|
1
|
+
import { N as l } from "./index-n4kM0Ll-.js";
|
|
2
2
|
import { jsx as r, Fragment as p } from "react/jsx-runtime";
|
|
3
|
-
import { u as d, e as m, A as f } from "./index-
|
|
3
|
+
import { u as d, e as m, A as f } from "./index-DRcwHivm.js";
|
|
4
4
|
function x() {
|
|
5
5
|
const o = d(v.name), {
|
|
6
6
|
icon: t = void 0,
|
package/lib/Code.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-EoGU7W4e.cjs"),i=require("react/jsx-runtime"),d=require("./index-BO82_0q8.cjs");require("react");require("./theme.cjs");var h=e=>{const t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&e[t.index-1]==="`"?null:{index:t.index,text:t[0],replaceWith:t[1]}},g=e=>{const t=/`([^`]+)`(?!`)/g,r=[];let n;for(;(n=t.exec(e))!==null;)n.index>0&&e[n.index-1]==="`"||r.push({index:n.index,text:n[0],replaceWith:n[1]});return r},M=o.Mark.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",o.mergeAttributes(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[o.markInputRule({find:h,type:this.type})]},addPasteRules(){return[o.markPasteRule({find:g,type:this.type})]}});function C(){const e=d.useButtonProps(u.name),{icon:t=void 0,tooltip:r=void 0,shortcutKeys:n=void 0,tooltipOptions:c={},action:s=void 0,isActive:l=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:p,disabled:a,update:m}=d.useToggleActive(l),x=()=>{a||s&&(s(),m())};return e?i.jsx(d.ActionButton,{action:x,dataState:p,disabled:a,icon:t,shortcutKeys:n,tooltip:r,tooltipOptions:c}):i.jsx(i.Fragment,{})}const u=M.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:r,extension:n})=>({componentProps:{action:()=>t.commands.toggleCode(),isActive:()=>t.isActive("code"),disabled:!t.can().toggleCode(),icon:"Code",shortcutKeys:n.options.shortcutKeys??["mod","E"],tooltip:r("editor.code.tooltip")}})}}});exports.Code=u;exports.RichTextCode=C;
|
package/lib/Code.js
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
1
|
-
import { M as m, h as l, j as
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { u as
|
|
1
|
+
import { M as m, h as l, j as h, m as x } from "./index-n4kM0Ll-.js";
|
|
2
|
+
import { jsx as d, Fragment as g } from "react/jsx-runtime";
|
|
3
|
+
import { u as M, d as f, A as v } from "./index-DRcwHivm.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "./theme.js";
|
|
6
|
-
var
|
|
6
|
+
var C = (e) => {
|
|
7
|
+
const t = /`([^`]+)`(?!`)$/.exec(e);
|
|
8
|
+
return !t || t.index > 0 && e[t.index - 1] === "`" ? null : {
|
|
9
|
+
index: t.index,
|
|
10
|
+
text: t[0],
|
|
11
|
+
replaceWith: t[1]
|
|
12
|
+
};
|
|
13
|
+
}, k = (e) => {
|
|
14
|
+
const t = /`([^`]+)`(?!`)/g, o = [];
|
|
15
|
+
let n;
|
|
16
|
+
for (; (n = t.exec(e)) !== null; )
|
|
17
|
+
n.index > 0 && e[n.index - 1] === "`" || o.push({
|
|
18
|
+
index: n.index,
|
|
19
|
+
text: n[0],
|
|
20
|
+
replaceWith: n[1]
|
|
21
|
+
});
|
|
22
|
+
return o;
|
|
23
|
+
}, y = m.create({
|
|
7
24
|
name: "code",
|
|
8
25
|
addOptions() {
|
|
9
26
|
return {
|
|
@@ -16,17 +33,17 @@ var x = /(^|[^`])`([^`]+)`(?!`)$/, f = /(^|[^`])`([^`]+)`(?!`)/g, y = m.create({
|
|
|
16
33
|
parseHTML() {
|
|
17
34
|
return [{ tag: "code" }];
|
|
18
35
|
},
|
|
19
|
-
renderHTML({ HTMLAttributes:
|
|
20
|
-
return ["code",
|
|
36
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
37
|
+
return ["code", x(this.options.HTMLAttributes, e), 0];
|
|
21
38
|
},
|
|
22
39
|
markdownTokenName: "codespan",
|
|
23
|
-
parseMarkdown: (
|
|
24
|
-
renderMarkdown: (
|
|
40
|
+
parseMarkdown: (e, t) => t.applyMark("code", [{ type: "text", text: e.text || "" }]),
|
|
41
|
+
renderMarkdown: (e, t) => e.content ? `\`${t.renderChildren(e.content)}\`` : "",
|
|
25
42
|
addCommands() {
|
|
26
43
|
return {
|
|
27
|
-
setCode: () => ({ commands:
|
|
28
|
-
toggleCode: () => ({ commands:
|
|
29
|
-
unsetCode: () => ({ commands:
|
|
44
|
+
setCode: () => ({ commands: e }) => e.setMark(this.name),
|
|
45
|
+
toggleCode: () => ({ commands: e }) => e.toggleMark(this.name),
|
|
46
|
+
unsetCode: () => ({ commands: e }) => e.unsetMark(this.name)
|
|
30
47
|
};
|
|
31
48
|
},
|
|
32
49
|
addKeyboardShortcuts() {
|
|
@@ -36,8 +53,8 @@ var x = /(^|[^`])`([^`]+)`(?!`)$/, f = /(^|[^`])`([^`]+)`(?!`)/g, y = m.create({
|
|
|
36
53
|
},
|
|
37
54
|
addInputRules() {
|
|
38
55
|
return [
|
|
39
|
-
|
|
40
|
-
find:
|
|
56
|
+
h({
|
|
57
|
+
find: C,
|
|
41
58
|
type: this.type
|
|
42
59
|
})
|
|
43
60
|
];
|
|
@@ -45,49 +62,49 @@ var x = /(^|[^`])`([^`]+)`(?!`)$/, f = /(^|[^`])`([^`]+)`(?!`)/g, y = m.create({
|
|
|
45
62
|
addPasteRules() {
|
|
46
63
|
return [
|
|
47
64
|
l({
|
|
48
|
-
find:
|
|
65
|
+
find: k,
|
|
49
66
|
type: this.type
|
|
50
67
|
})
|
|
51
68
|
];
|
|
52
69
|
}
|
|
53
70
|
});
|
|
54
|
-
function
|
|
55
|
-
const
|
|
56
|
-
icon:
|
|
71
|
+
function K() {
|
|
72
|
+
const e = M(A.name), {
|
|
73
|
+
icon: t = void 0,
|
|
57
74
|
tooltip: o = void 0,
|
|
58
|
-
shortcutKeys:
|
|
59
|
-
tooltipOptions:
|
|
60
|
-
action:
|
|
61
|
-
isActive:
|
|
62
|
-
} = (
|
|
63
|
-
|
|
75
|
+
shortcutKeys: n = void 0,
|
|
76
|
+
tooltipOptions: s = {},
|
|
77
|
+
action: r = void 0,
|
|
78
|
+
isActive: a = void 0
|
|
79
|
+
} = (e == null ? void 0 : e.componentProps) ?? {}, { dataState: c, disabled: i, update: u } = f(a), p = () => {
|
|
80
|
+
i || r && (r(), u());
|
|
64
81
|
};
|
|
65
|
-
return
|
|
66
|
-
|
|
82
|
+
return e ? /* @__PURE__ */ d(
|
|
83
|
+
v,
|
|
67
84
|
{
|
|
68
85
|
action: p,
|
|
69
|
-
dataState:
|
|
70
|
-
disabled:
|
|
71
|
-
icon:
|
|
72
|
-
shortcutKeys:
|
|
86
|
+
dataState: c,
|
|
87
|
+
disabled: i,
|
|
88
|
+
icon: t,
|
|
89
|
+
shortcutKeys: n,
|
|
73
90
|
tooltip: o,
|
|
74
|
-
tooltipOptions:
|
|
91
|
+
tooltipOptions: s
|
|
75
92
|
}
|
|
76
|
-
) : /* @__PURE__ */
|
|
93
|
+
) : /* @__PURE__ */ d(g, {});
|
|
77
94
|
}
|
|
78
95
|
const A = /* @__PURE__ */ y.extend({
|
|
79
96
|
//@ts-expect-error
|
|
80
97
|
addOptions() {
|
|
81
|
-
var
|
|
98
|
+
var e;
|
|
82
99
|
return {
|
|
83
|
-
...(
|
|
84
|
-
button: ({ editor:
|
|
100
|
+
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
101
|
+
button: ({ editor: t, t: o, extension: n }) => ({
|
|
85
102
|
componentProps: {
|
|
86
|
-
action: () =>
|
|
87
|
-
isActive: () =>
|
|
88
|
-
disabled: !
|
|
103
|
+
action: () => t.commands.toggleCode(),
|
|
104
|
+
isActive: () => t.isActive("code"),
|
|
105
|
+
disabled: !t.can().toggleCode(),
|
|
89
106
|
icon: "Code",
|
|
90
|
-
shortcutKeys:
|
|
107
|
+
shortcutKeys: n.options.shortcutKeys ?? ["mod", "E"],
|
|
91
108
|
tooltip: o("editor.code.tooltip")
|
|
92
109
|
}
|
|
93
110
|
})
|
|
@@ -96,5 +113,5 @@ const A = /* @__PURE__ */ y.extend({
|
|
|
96
113
|
});
|
|
97
114
|
export {
|
|
98
115
|
A as Code,
|
|
99
|
-
|
|
116
|
+
K as RichTextCode
|
|
100
117
|
};
|
package/lib/CodeBlock.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-EoGU7W4e.cjs"),J=require("@tiptap/pm/state"),qe=require("@tiptap/pm/view"),Qt=require("./_commonjsHelpers-BTDuMlIz.cjs"),Oe=require("react/jsx-runtime"),Ae=require("./index-BO82_0q8.cjs");require("react");require("./theme.cjs");var Ne=4,en=/^```([a-z]+)?[\s\n]$/,tn=/^~~~([a-z]+)?[\s\n]$/,nn=V.Node3.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Ne,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:i=>{var f;const{languageClassPrefix:h}=this.options;if(!h)return null;const _=[...((f=i.firstElementChild)==null?void 0:f.classList)||[]].filter(y=>y.startsWith(h)).map(y=>y.replace(h,""))[0];return _||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:i,HTMLAttributes:f}){return["pre",V.mergeAttributes(this.options.HTMLAttributes,f),["code",{class:i.attrs.language?this.options.languageClassPrefix+i.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(i,f)=>{var h,u;return((h=i.raw)==null?void 0:h.startsWith("```"))===!1&&((u=i.raw)==null?void 0:u.startsWith("~~~"))===!1&&i.codeBlockStyle!=="indented"?[]:f.createNode("codeBlock",{language:i.lang||null},i.text?[f.createTextNode(i.text)]:[])},renderMarkdown:(i,f)=>{var h;let u="";const E=((h=i.attrs)==null?void 0:h.language)||"";return i.content?u=[`\`\`\`${E}`,f.renderChildren(i.content),"```"].join(`
|
|
2
2
|
`):u=`\`\`\`${E}
|
|
3
3
|
|
|
4
4
|
\`\`\``,u},addCommands(){return{setCodeBlock:i=>({commands:f})=>f.setNode(this.name,i),toggleCodeBlock:i=>({commands:f})=>f.toggleNode(this.name,"paragraph",i)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:i,$anchor:f}=this.editor.state.selection,h=f.pos===1;return!i||f.parent.type.name!==this.name?!1:h||!f.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:i})=>{var f;if(!this.options.enableTabIndentation)return!1;const h=(f=this.options.tabSize)!=null?f:Ne,{state:u}=i,{selection:E}=u,{$from:_,empty:y}=E;if(_.parent.type!==this.type)return!1;const M=" ".repeat(h);return y?i.commands.insertContent(M):i.commands.command(({tr:A})=>{const{from:v,to:P}=E,B=u.doc.textBetween(v,P,`
|
package/lib/CodeBlock.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { N as Qt, t as Ke, m as en, K as Oe } from "./index-
|
|
1
|
+
import { N as Qt, t as Ke, m as en, K as Oe } from "./index-n4kM0Ll-.js";
|
|
2
2
|
import { Plugin as Ve, PluginKey as qe, TextSelection as Fe, Selection as tn } from "@tiptap/pm/state";
|
|
3
3
|
import { Decoration as nn, DecorationSet as rn } from "@tiptap/pm/view";
|
|
4
4
|
import { g as sn } from "./_commonjsHelpers-B4e78b8K.js";
|
|
5
5
|
import { jsx as Xe, Fragment as on } from "react/jsx-runtime";
|
|
6
|
-
import { u as an, d as cn, A as ln } from "./index-
|
|
6
|
+
import { u as an, d as cn, A as ln } from "./index-DRcwHivm.js";
|
|
7
7
|
import "react";
|
|
8
8
|
import "./theme.js";
|
|
9
9
|
var ye = 4, un = /^```([a-z]+)?[\s\n]$/, fn = /^~~~([a-z]+)?[\s\n]$/, gn = Qt.create({
|
|
@@ -209,7 +209,9 @@ var ye = 4, un = /^```([a-z]+)?[\s\n]$/, fn = /^~~~([a-z]+)?[\s\n]$/, gn = Qt.cr
|
|
|
209
209
|
return !1;
|
|
210
210
|
const { tr: M, schema: y } = i.state, A = y.text(h.replace(/\r\n?/g, `
|
|
211
211
|
`));
|
|
212
|
-
return M.replaceSelectionWith(this.type.create({ language: x }, A)), M.selection.$from.parent.type !== this.type && M.setSelection(
|
|
212
|
+
return M.replaceSelectionWith(this.type.create({ language: x }, A)), M.selection.$from.parent.type !== this.type && M.setSelection(
|
|
213
|
+
Fe.near(M.doc.resolve(Math.max(0, M.selection.from - 2)))
|
|
214
|
+
), M.setMeta("paste", !0), i.dispatch(M), !0;
|
|
213
215
|
}
|
|
214
216
|
}
|
|
215
217
|
})
|
|
@@ -1324,7 +1326,9 @@ function _n({
|
|
|
1324
1326
|
defaultLanguage: h
|
|
1325
1327
|
}) {
|
|
1326
1328
|
if (!["highlight", "highlightAuto", "listLanguages"].every((E) => En(f[E])))
|
|
1327
|
-
throw Error(
|
|
1329
|
+
throw Error(
|
|
1330
|
+
"You should provide an instance of lowlight to use the code-block-lowlight extension"
|
|
1331
|
+
);
|
|
1328
1332
|
const u = new Ve({
|
|
1329
1333
|
key: new qe("lowlight"),
|
|
1330
1334
|
state: {
|
package/lib/CodeView.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index-EoGU7W4e.cjs"),n=require("react/jsx-runtime"),c=require("./index-BO82_0q8.cjs");require("react");require("./theme.cjs");function v(){const e=c.useButtonProps(a.name),{icon:t=void 0,tooltip:o=void 0,shortcutKeys:i=void 0,tooltipOptions:d={},action:s=void 0,isActive:u=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:l,disabled:r,update:p}=c.useToggleActive(u),g=()=>{r||s&&(s(),p())};return e?n.jsx(c.ActionButton,{action:g,dataState:l,disabled:r,icon:t,shortcutKeys:i,tooltip:o,tooltipOptions:d}):n.jsx(n.Fragment,{})}const a=m.Extension.create({name:"codeView",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button({editor:t,t:o}){return{componentProps:{action:()=>{t.commands.toggleCodeView()},isActive:()=>t.storage.codeView.isActive,disabled:!1,icon:"Html",tooltip:o("editor.codeView.tooltip")||"View HTML Code",customClass:"tiptap-code-view-button"}}}}},addStorage(){return{isActive:!1,originalContent:""}},addCommands(){return{toggleCodeView:()=>({editor:e})=>{const t=e.storage.codeView.isActive;if(t)e.commands.setContent(e.getText());else{const o=e.getHTML();e.storage.codeView.originalContent=o;const i=o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");e.commands.setContent(`<div class="tiptap-code-view-wrapper">${i}</div>`)}return e.storage.codeView.isActive=!t,!0}}}});exports.CodeView=a;exports.RichTextCodeView=v;
|
package/lib/CodeView.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as l } from "./index-
|
|
1
|
+
import { E as l } from "./index-n4kM0Ll-.js";
|
|
2
2
|
import { jsx as c, Fragment as g } from "react/jsx-runtime";
|
|
3
|
-
import { u, d as v, A as w } from "./index-
|
|
3
|
+
import { u, d as v, A as w } from "./index-DRcwHivm.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "./theme.js";
|
|
6
6
|
function h() {
|
package/lib/Color.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index-DN-IR-K0.cjs"),t=require("react/jsx-runtime"),h=require("react"),l=require("./index-BO82_0q8.cjs"),g=require("./separator-DMLtkcoo.cjs");require("./theme.cjs");function v({fill:e}){return t.jsx("svg",{height:"18px",version:"1.1",viewBox:"0 0 240 240",width:"18px",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:1,children:t.jsx("g",{transform:"translate(0.000000, 0.500000)",children:t.jsxs("g",{transform:"translate(39.000000, 17.353553)",children:[t.jsx("path",{d:"M11,201.146447 L167,201.146447 C173.075132,201.146447 178,206.071314 178,212.146447 C178,218.221579 173.075132,223.146447 167,223.146447 L11,223.146447 C4.92486775,223.146447 7.43989126e-16,218.221579 0,212.146447 C-7.43989126e-16,206.071314 4.92486775,201.146447 11,201.146447 Z",fill:typeof e=="string"?e:"#000",fillRule:"evenodd"}),t.jsx("path",{d:"M72.3425855,16.8295583 C75.799482,7.50883712 86.1577877,2.75526801 95.4785089,6.21216449 C100.284516,7.99463061 104.096358,11.7387855 105.968745,16.4968188 L106.112518,16.8745422 L159.385152,161.694068 C161.291848,166.877345 158.635655,172.624903 153.452378,174.531599 C148.358469,176.405421 142.719567,173.872338 140.716873,168.864661 L140.614848,168.598825 L89.211,28.86 L37.3759214,168.623816 C35.4885354,173.712715 29.8981043,176.351047 24.7909589,174.617647 L24.5226307,174.522368 C19.4337312,172.634982 16.7953993,167.044551 18.5287999,161.937406 L18.6240786,161.669077 L72.3425855,16.8295583 Z",fill:"currentColor",fillRule:"nonzero"}),t.jsx("path",{d:"M121,103.146447 C126.522847,103.146447 131,107.623599 131,113.146447 C131,118.575687 126.673329,122.994378 121.279905,123.142605 L121,123.146447 L55,123.146447 C49.4771525,123.146447 45,118.669294 45,113.146447 C45,107.717207 49.3266708,103.298515 54.7200952,103.150288 L55,103.146447 L121,103.146447 Z",fill:"currentColor",fillRule:"nonzero"})]})})})})}function j(){const e=l.useButtonProps(C.name),{tooltip:o=void 0,isActive:s=void 0,defaultColor:r=void 0,colors:n,action:i}=(e==null?void 0:e.componentProps)??{},{disabled:c,dataState:u}=l.useActive(s),[f,a]=h.useState(r);h.useEffect(()=>{a(u)},[u]);function x(d){c||i&&(i==null||i(d),a(d))}return e?t.jsx(g.ColorPicker,{colors:n,disabled:c,onChange:x,value:f,children:t.jsx(l.ActionButton,{disabled:c,tooltip:o,children:t.jsxs("span",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-gap-[4px] richtext-text-sm",children:[t.jsx(v,{fill:u}),t.jsx(l.IconComponent,{className:"!richtext-h-3 !richtext-w-3 richtext-text-zinc-500",name:"MenuDown"})]})})}):t.jsx(t.Fragment,{})}const C=p.Color.extend({addStorage(){return{currentColor:this.options.defaultColor||void 0}},addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button({editor:o,t:s,extension:r}){return{componentProps:{colors:r.options.colors,defaultColor:r.options.defaultColor,action:n=>{if(typeof n=="string"){o.storage.color.currentColor=n,o.chain().focus().setColor(n).run();return}o.chain().focus().unsetColor().run()},isActive:()=>{const{color:n}=o.getAttributes("textStyle");return n},disabled:!1,shortcutKeys:r.options.shortcutKeys??["⇧","alt","C"],tooltip:s("editor.color.tooltip")}}}}},addKeyboardShortcuts(){var e;return{...(e=this.parent)==null?void 0:e.call(this),"Alt-Shift-c":()=>{const o=this.storage.currentColor||this.options.defaultColor;if(!o){const{color:r}=this.editor.getAttributes("textStyle");return r?this.editor.chain().focus().unsetColor().run():!1}return this.editor.isActive("textStyle",{color:o})?this.editor.chain().focus().unsetColor().run():this.editor.chain().focus().setColor(o).run()}}}});exports.Color=C;exports.RichTextColor=j;
|
package/lib/Color.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as d } from "./index-
|
|
1
|
+
import { C as d } from "./index-DuWMq-Qs.js";
|
|
2
2
|
import { jsx as o, jsxs as h, Fragment as p } from "react/jsx-runtime";
|
|
3
3
|
import { useState as x, useEffect as m } from "react";
|
|
4
|
-
import { u as g, e as v, A as L, I as A } from "./index-
|
|
5
|
-
import { C as y } from "./separator-
|
|
4
|
+
import { u as g, e as v, A as L, I as A } from "./index-DRcwHivm.js";
|
|
5
|
+
import { C as y } from "./separator-DfvK668q.js";
|
|
6
6
|
import "./theme.js";
|
|
7
7
|
function S({ fill: t }) {
|
|
8
8
|
return /* @__PURE__ */ o(
|
package/lib/Column.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"),x=require("@tiptap/pm/state"),A=require("@tiptap/pm/model"),f=require("react/jsx-runtime"),h=require("./index-BO82_0q8.cjs");require("react");require("./theme.cjs");function v(e,t,r=null){return r?e.createChecked({index:t},r):e.createAndFill({index:t})}function M(e){if(e.cached.columnsNodeTypes)return e.cached.columnsNodeTypes;const t={columns:e.nodes.columns,column:e.nodes.column};return e.cached.columnsNodeTypes=t,t}function H(e,t,r=null){const n=M(e),c=[];for(let o=0;o<t;o+=1){const s=v(n.column,o,r);s&&c.push(s)}return n.columns.createChecked({cols:t},c)}function C({state:e,dispatch:t,type:r}){const n=u.findParentNode(o=>o.type.name===b.name)(e.selection),c=u.findParentNode(o=>o.type.name===T.name)(e.selection);if(t&&n&&c){const o=n.node,s=c.node.attrs.index,i=o.toJSON();let l=s;r==="delete"?(l=s-1,i.content.splice(s,1)):(l=r==="addBefore"?s:s+1,i.content.splice(l,0,{type:"column",attrs:{index:s},content:[{type:"paragraph"}]})),i.attrs.cols=i.content.length,i.content.forEach((m,y)=>{m.attrs.index=y});const d=A.Node.fromJSON(e.schema,i);let a=n.pos;d.content.forEach((m,y,N)=>{N<l&&(a+=m.nodeSize)});const p=e.tr.setTime(Date.now());p.replaceWith(n.pos,n.pos+n.node.nodeSize,d).setSelection(x.TextSelection.near(p.doc.resolve(a))),t(p)}return!0}function S({state:e,dispatch:t,type:r}){const n=u.findParentNode(o=>o.type.name===b.name)(e.selection),c=u.findParentNode(o=>o.type.name===T.name)(e.selection);if(t&&n&&c){const o=n.node,s=c.node.attrs.index;let i=0;r==="before"?i=(s-1+o.attrs.cols)%o.attrs.cols:i=(s+1)%o.attrs.cols;let l=n.pos;o.content.forEach((a,p,m)=>{m<i&&(l+=a.nodeSize)});const d=e.tr.setTime(Date.now());return d.setSelection(x.TextSelection.near(d.doc.resolve(l))),t(d),!0}return!1}function O(){const e=h.useButtonProps(g.name),{icon:t=void 0,tooltip:r=void 0,shortcutKeys:n=void 0,tooltipOptions:c={},action:o=void 0,isActive:s=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:i,disabled:l,update:d}=h.useToggleActive(s),a=()=>{l||o&&(o(),d())};return e?f.jsx(h.ActionButton,{action:a,dataState:i,disabled:l,icon:t,shortcutKeys:n,tooltip:r,tooltipOptions:c}):f.jsx(f.Fragment,{})}const I=200,g=u.Extension.create({name:"richtextColumnExtension",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:r})=>({componentProps:{action:()=>{t.chain().focus().insertColumns({cols:2}).run()},icon:"Columns",tooltip:r("editor.columns.tooltip")}})}}}),T=u.Node3.create({name:"column",content:"block+",isolating:!0,addOptions(){return{HTMLAttributes:{class:"column"}}},addAttributes(){return{index:{default:0,parseHTML:e=>e.getAttribute("index")}}},parseHTML(){return[{tag:"div[class=column]"}]},renderHTML({HTMLAttributes:e}){return["div",u.mergeAttributes(this.options.HTMLAttributes,e),0]}}),b=u.Node3.create({name:"columns",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,content:"column{1,}",priority:I,addOptions(){return{HTMLAttributes:{class:"columns"}}},addAttributes(){return{cols:{default:2,parseHTML:e=>e.getAttribute("cols")}}},parseHTML(){return[{tag:"div[class=grid]"}]},renderHTML({HTMLAttributes:e}){return["div",u.mergeAttributes(this.options.HTMLAttributes,e),0]},addCommands(){return{insertColumns:e=>({tr:t,dispatch:r,editor:n})=>{const c=H(n.schema,e&&e.cols||3);if(r){const o=t.selection.anchor+1;t.replaceSelectionWith(c).scrollIntoView().setSelection(x.TextSelection.near(t.doc.resolve(o)))}return!0},addColBefore:()=>({dispatch:e,state:t})=>C({dispatch:e,state:t,type:"addBefore"}),addColAfter:()=>({dispatch:e,state:t})=>C({dispatch:e,state:t,type:"addAfter"}),deleteCol:()=>({dispatch:e,state:t})=>C({dispatch:e,state:t,type:"delete"})}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertColumns(),Tab:()=>S({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"after"}),"Shift-Tab":()=>S({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"before"})}}});exports.Column=g;exports.ColumnNode=T;exports.MultipleColumnNode=b;exports.RichTextColumn=O;
|
package/lib/Column.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { k as p, E as v, N as b, m as y } from "./index-
|
|
1
|
+
import { k as p, E as v, N as b, m as y } from "./index-n4kM0Ll-.js";
|
|
2
2
|
import { TextSelection as h } from "@tiptap/pm/state";
|
|
3
3
|
import { Node as N } from "@tiptap/pm/model";
|
|
4
4
|
import { jsx as T, Fragment as H } from "react/jsx-runtime";
|
|
5
|
-
import { u as M, d as L, A as O } from "./index-
|
|
5
|
+
import { u as M, d as L, A as O } from "./index-DRcwHivm.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import "./theme.js";
|
|
8
8
|
function E(e, t, r = null) {
|