reactjs-tiptap-editor 0.2.29 → 0.3.0
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-Bycn676n.js +33 -0
- package/lib/ActionMenuButton-CpFNwSUZ.cjs +1 -0
- package/lib/Attachment.cjs +19 -0
- package/lib/Attachment.d.cts +344 -0
- package/lib/Attachment.d.ts +344 -0
- package/lib/Attachment.js +259 -0
- package/lib/Blockquote.cjs +1 -0
- package/lib/Blockquote.d.cts +343 -0
- package/lib/Blockquote.d.ts +343 -0
- package/lib/Blockquote.js +65 -0
- package/lib/Bold.cjs +1 -0
- package/lib/Bold.d.cts +343 -0
- package/lib/Bold.d.ts +343 -0
- package/lib/Bold.js +90 -0
- package/lib/BulletList.cjs +1 -0
- package/lib/BulletList.d.cts +343 -0
- package/lib/BulletList.d.ts +343 -0
- package/lib/BulletList.js +72 -0
- package/lib/Clear.cjs +1 -0
- package/lib/Clear.d.cts +342 -0
- package/lib/Clear.d.ts +342 -0
- package/lib/Clear.js +23 -0
- package/lib/Code.cjs +1 -0
- package/lib/Code.d.cts +343 -0
- package/lib/Code.d.ts +343 -0
- package/lib/Code.js +70 -0
- package/lib/CodeBlock.cjs +39 -0
- package/lib/CodeBlock.d.cts +352 -0
- package/lib/CodeBlock.d.ts +352 -0
- package/lib/CodeBlock.js +3639 -0
- package/lib/Color.cjs +1 -0
- package/lib/Color.d.cts +350 -0
- package/lib/Color.d.ts +350 -0
- package/lib/Color.js +141 -0
- package/lib/Document.cjs +1 -0
- package/lib/Document.d.cts +272 -0
- package/lib/Document.d.ts +272 -0
- package/lib/Document.js +13 -0
- package/lib/Drawer-BZadE1gM.js +1367 -0
- package/lib/Drawer-rwnFvgZR.cjs +1 -0
- package/lib/Drawer.cjs +1 -0
- package/lib/Drawer.d.cts +344 -0
- package/lib/Drawer.d.ts +344 -0
- package/lib/Drawer.js +7 -0
- package/lib/Emoji.cjs +1 -0
- package/lib/Emoji.d.cts +277 -0
- package/lib/Emoji.d.ts +277 -0
- package/lib/Emoji.js +2168 -0
- package/lib/Excalidraw-B2414Smc.js +651 -0
- package/lib/Excalidraw-D21vMFe0.cjs +1 -0
- package/lib/Excalidraw.cjs +1 -0
- package/lib/Excalidraw.d.cts +278 -0
- package/lib/Excalidraw.d.ts +278 -0
- package/lib/Excalidraw.js +6 -0
- package/lib/ExportPdf.cjs +15 -0
- package/lib/ExportPdf.d.cts +270 -0
- package/lib/ExportPdf.d.ts +270 -0
- package/lib/ExportPdf.js +67 -0
- package/lib/ExportWord.cjs +1 -0
- package/lib/ExportWord.d.cts +341 -0
- package/lib/ExportWord.d.ts +341 -0
- package/lib/ExportWord.js +72 -0
- package/lib/FontFamily.cjs +1 -0
- package/lib/FontFamily.d.cts +354 -0
- package/lib/FontFamily.d.ts +354 -0
- package/lib/FontFamily.js +136 -0
- package/lib/FontSize.cjs +1 -0
- package/lib/FontSize.d.cts +359 -0
- package/lib/FontSize.d.ts +359 -0
- package/lib/FontSize.js +110 -0
- package/lib/FormatPainter.cjs +1 -0
- package/lib/FormatPainter.d.cts +353 -0
- package/lib/FormatPainter.d.ts +353 -0
- package/lib/FormatPainter.js +74 -0
- package/lib/Heading.cjs +1 -0
- package/lib/Heading.d.cts +343 -0
- package/lib/Heading.d.ts +343 -0
- package/lib/Heading.js +147 -0
- package/lib/Highlight.cjs +1 -0
- package/lib/Highlight.d.cts +344 -0
- package/lib/Highlight.d.ts +344 -0
- package/lib/Highlight.js +85 -0
- package/lib/History.cjs +1 -0
- package/lib/History.d.cts +343 -0
- package/lib/History.d.ts +343 -0
- package/lib/History.js +431 -0
- package/lib/HorizontalRule.cjs +1 -0
- package/lib/HorizontalRule.d.cts +343 -0
- package/lib/HorizontalRule.d.ts +343 -0
- package/lib/HorizontalRule.js +87 -0
- package/lib/Iframe.cjs +1 -0
- package/lib/Iframe.d.cts +277 -0
- package/lib/Iframe.d.ts +277 -0
- package/lib/Iframe.js +6 -0
- package/lib/Image.cjs +1 -0
- package/lib/Image.d.cts +370 -0
- package/lib/Image.d.ts +370 -0
- package/lib/Image.js +7 -0
- package/lib/ImageGif.cjs +1 -0
- package/lib/ImageGif.d.cts +292 -0
- package/lib/ImageGif.d.ts +292 -0
- package/lib/ImageGif.js +7 -0
- package/lib/ImportWord.cjs +231 -0
- package/lib/ImportWord.d.cts +353 -0
- package/lib/ImportWord.d.ts +353 -0
- package/lib/ImportWord.js +16620 -0
- package/lib/Indent.cjs +1 -0
- package/lib/Indent.d.cts +344 -0
- package/lib/Indent.d.ts +344 -0
- package/lib/Indent.js +78 -0
- package/lib/Italic.cjs +1 -0
- package/lib/Italic.d.cts +343 -0
- package/lib/Italic.d.ts +343 -0
- package/lib/Italic.js +91 -0
- package/lib/Katex.cjs +1 -0
- package/lib/Katex.d.cts +279 -0
- package/lib/Katex.d.ts +279 -0
- package/lib/Katex.js +197 -0
- package/lib/LineHeight.cjs +1 -0
- package/lib/LineHeight.d.cts +347 -0
- package/lib/LineHeight.d.ts +347 -0
- package/lib/LineHeight.js +137 -0
- package/lib/Link.cjs +5 -0
- package/lib/Link.d.cts +343 -0
- package/lib/Link.d.ts +343 -0
- package/lib/Link.js +1048 -0
- package/lib/ListItem.cjs +1 -0
- package/lib/ListItem.d.cts +269 -0
- package/lib/ListItem.d.ts +269 -0
- package/lib/ListItem.js +33 -0
- package/lib/Mention.cjs +1 -0
- package/lib/Mention.d.cts +272 -0
- package/lib/Mention.d.ts +272 -0
- package/lib/Mention.js +233 -0
- package/lib/Mermaid.cjs +2 -0
- package/lib/Mermaid.d.cts +344 -0
- package/lib/Mermaid.d.ts +344 -0
- package/lib/Mermaid.js +390 -0
- package/lib/MoreMark.cjs +1 -0
- package/lib/MoreMark.d.cts +355 -0
- package/lib/MoreMark.d.ts +355 -0
- package/lib/MoreMark.js +95 -0
- package/lib/MultiColumn.cjs +1 -0
- package/lib/MultiColumn.d.cts +277 -0
- package/lib/MultiColumn.d.ts +277 -0
- package/lib/MultiColumn.js +8 -0
- package/lib/OrderedList.cjs +1 -0
- package/lib/OrderedList.d.cts +343 -0
- package/lib/OrderedList.d.ts +343 -0
- package/lib/OrderedList.js +90 -0
- package/lib/RichTextEditor-Cy9XKEI5.js +11178 -0
- package/lib/RichTextEditor-DkpDEr5U.cjs +137 -0
- package/lib/SearchAndReplace.cjs +1 -0
- package/lib/SearchAndReplace.d.cts +358 -0
- package/lib/SearchAndReplace.d.ts +358 -0
- package/lib/SearchAndReplace.js +339 -0
- package/lib/Selection.cjs +1 -0
- package/lib/Selection.d.cts +272 -0
- package/lib/Selection.d.ts +272 -0
- package/lib/Selection.js +25 -0
- package/lib/SlashCommand.cjs +1 -0
- package/lib/SlashCommand.d.cts +299 -0
- package/lib/SlashCommand.d.ts +299 -0
- package/lib/SlashCommand.js +369 -0
- package/lib/Strike.cjs +1 -0
- package/lib/Strike.d.cts +343 -0
- package/lib/Strike.d.ts +343 -0
- package/lib/Strike.js +80 -0
- package/lib/SubAndSuperScript.cjs +1 -0
- package/lib/SubAndSuperScript.d.cts +358 -0
- package/lib/SubAndSuperScript.d.ts +358 -0
- package/lib/SubAndSuperScript.js +41 -0
- package/lib/Table.cjs +1 -0
- package/lib/Table.d.cts +366 -0
- package/lib/Table.d.ts +366 -0
- package/lib/Table.js +2165 -0
- package/lib/TableOfContent.cjs +1 -0
- package/lib/TableOfContent.d.cts +274 -0
- package/lib/TableOfContent.d.ts +274 -0
- package/lib/TableOfContent.js +184 -0
- package/lib/TaskList.cjs +1 -0
- package/lib/TaskList.d.cts +349 -0
- package/lib/TaskList.d.ts +349 -0
- package/lib/TaskList.js +175 -0
- package/lib/TextAlign.cjs +1 -0
- package/lib/TextAlign.d.cts +353 -0
- package/lib/TextAlign.d.ts +353 -0
- package/lib/TextAlign.js +165 -0
- package/lib/TextBubble.cjs +1 -0
- package/lib/TextBubble.d.cts +343 -0
- package/lib/TextBubble.d.ts +343 -0
- package/lib/TextBubble.js +131 -0
- package/lib/TextDirection.cjs +1 -0
- package/lib/TextDirection.d.cts +270 -0
- package/lib/TextDirection.d.ts +270 -0
- package/lib/TextDirection.js +142 -0
- package/lib/TextUnderline.cjs +1 -0
- package/lib/TextUnderline.d.cts +343 -0
- package/lib/TextUnderline.d.ts +343 -0
- package/lib/TextUnderline.js +61 -0
- package/lib/TrailingNode.cjs +1 -0
- package/lib/TrailingNode.d.cts +280 -0
- package/lib/TrailingNode.d.ts +280 -0
- package/lib/TrailingNode.js +41 -0
- package/lib/Twitter-B_tSItrW.js +1743 -0
- package/lib/Twitter-CfDC4bFV.cjs +17 -0
- package/lib/Twitter.cjs +1 -0
- package/lib/Twitter.d.cts +295 -0
- package/lib/Twitter.d.ts +295 -0
- package/lib/Twitter.js +6 -0
- package/lib/Video.cjs +1 -0
- package/lib/Video.d.cts +371 -0
- package/lib/Video.d.ts +371 -0
- package/lib/Video.js +6 -0
- package/lib/bubble-extra.cjs +2 -0
- package/lib/bubble-extra.d.cts +294 -0
- package/lib/bubble-extra.d.ts +294 -0
- package/lib/bubble-extra.js +623 -0
- package/lib/dom-dataset-CAXnsjYE.cjs +33 -0
- package/lib/dom-dataset-CJ7GyQ2E.js +999 -0
- package/lib/index-COecBbaE.cjs +89 -0
- package/lib/index-ClFtfQ0J.cjs +1 -0
- package/lib/index-CvYIX2-x.js +129 -0
- package/lib/index-CySbCeQd.cjs +1 -0
- package/lib/{index-CO-iymkb.js → index-D9llIWB5.js} +442 -101
- package/lib/index-DXBa3JBo.js +46 -0
- package/lib/index-DjP7Onch.cjs +1 -0
- package/lib/index-Drmyqk9P.js +12322 -0
- package/lib/index-DuhDIOel.js +76 -0
- package/lib/index-LbrE7K9i.cjs +1 -0
- package/lib/index.cjs +2 -1
- package/lib/index.d.cts +290 -108
- package/lib/index.d.ts +290 -108
- package/lib/index.js +587 -13
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.d.cts +108 -108
- package/lib/locale-bundle.d.ts +108 -108
- package/lib/locale-bundle.js +1 -1
- package/lib/shortId-Bfj8TyNr.cjs +2 -0
- package/lib/shortId-WJVkrvml.js +30 -0
- package/lib/style.css +1 -1
- package/lib/textarea-B45fP3gP.cjs +1 -0
- package/lib/textarea-DXTdXr2y.js +20 -0
- package/package.json +678 -15
- package/lib/RichTextEditor-Ce2IeNE6.js +0 -8265
- package/lib/RichTextEditor-hDDApaDD.cjs +0 -136
- package/lib/extension-bundle.cjs +0 -33
- package/lib/extension-bundle.d.cts +0 -951
- package/lib/extension-bundle.d.ts +0 -951
- package/lib/extension-bundle.js +0 -5982
- package/lib/index-CJ6Hb9MN.cjs +0 -1
- package/lib/tiptap-DOP8lVCQ.js +0 -5950
- package/lib/tiptap-Dq62HiQ9.cjs +0 -113
- package/lib/vendor-BbgkyoD-.js +0 -40297
- package/lib/vendor-DdwtMmSr.cjs +0 -302
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./index-COecBbaE.cjs"),p=require("./dom-dataset-CAXnsjYE.cjs"),r=require("react/jsx-runtime"),c=require("react"),C=require("./index-LbrE7K9i.cjs"),b=require("./RichTextEditor-DkpDEr5U.cjs"),g="_toc_aag8a_1",x="_visible_aag8a_7",T="_list_aag8a_11",O="_item_aag8a_16",f={toc:g,visible:x,list:T,item:O};function y(e){const o=[],a=[o];return e.forEach(n=>{let t=-1,s=a[n.level+t];for(;!s;)t-=1,s=a[n.level+t];s.push({...n,children:a[n.level]=[]})}),o}function N({editor:e}){const o=b.useEditableEditor(),[a,n]=c.useState([]),{t}=C.useLocale(),s=c.useCallback(()=>{const i=[],l=e.state.tr;e.state.doc.descendants((u,v)=>{if(u.type.name==="heading"){const d=`heading-${i.length+1}`;u.attrs.id!==d&&l.setNodeMarkup(v,void 0,{...u.attrs,id:d}),i.push({level:u.attrs.level,text:u.textContent,id:d})}}),l.setMeta("addToHistory",!1),l.setMeta("preventUpdate",!0),e.view.dispatch(l),n(i),e.eventEmitter&&e.eventEmitter.emit("TableOfContents",y(i))},[e]);return c.useEffect(()=>{if(e){if(!e.options.editable){s();return}return e.on("update",s),()=>{e.off("update",s)}}},[e,s]),c.useEffect(()=>{s()},[]),r.jsx(p.NodeViewWrapper,{className:p.clsx("tableOfContent",f.toc,o&&f.visible),children:o?r.jsxs("div",{style:{position:"relative"},children:[r.jsx("p",{className:"text-[20px] richtext-mb-[8px] richtext-font-semibold",children:t("editor.table_of_content")}),r.jsx("ul",{className:f.list,children:a.map((i,l)=>r.jsx("li",{className:f.item,style:{paddingLeft:`${i.level-1}rem`},children:r.jsx("a",{href:`#${i.id}`,children:i.text})},`table-of-content-${l}`))})]}):null})}function _(e,...o){const[a,n]=c.useState(!1);return c.useEffect(()=>{const t=()=>{n(e.isActive.apply(e,o))};return e.on("selectionUpdate",t),e.on("transaction",t),()=>{e.off("selectionUpdate",t),e.off("transaction",t)}},[e,o,n]),a}function A({editor:e,icon:o,tooltip:a}){const n=_(e,m.name),t=c.useCallback(()=>{if(n){e.chain().focus().removeTableOfContents().run();return}e.chain().focus().setTableOfContents().run()},[e,n]);return r.jsx(b.ActionButton,{action:t,isActive:()=>n||!1,icon:o,tooltip:a})}function j(e){return e&&e.type.name==="title"}function E(e,o){const n=[e.getJSON()],t=[];for(;n.length>0;){const s=n.shift();s.type===o&&t.push(s),s.content&&s.content.length>0&&n.push(...s.content)}return t}const m=h.Node.create({name:"tableOfContents",group:"block",atom:!0,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),onHasOneBeforeInsert:()=>{},resizable:!0,lastColumnResizable:!0,allowTableNodeSelection:!1,button:({editor:o,t:a})=>({component:A,componentProps:{disabled:!1,icon:"BookMarked",tooltip:a("editor.table.tooltip"),editor:o}})}},parseHTML(){return[{tag:"toc"}]},renderHTML({HTMLAttributes:e}){return["toc",h.mergeAttributes(e)]},addNodeView(){return p.ReactNodeViewRenderer(N)},addCommands(){return{setTableOfContents:()=>({commands:e,editor:o,view:a})=>{if(E(o,this.name).length>0){this.options.onHasOneBeforeInsert();return}const t=a.props.state.doc.content.firstChild;if(j(t)){const s=(t.firstChild&&t.firstChild.nodeSize||0)+1;return e.insertContentAt(s,{type:this.name})}return e.insertContent({type:this.name})},removeTableOfContents:()=>({state:e,dispatch:o})=>{const{tr:a}=e,n=e.schema.nodes.tableOfContents;return e.doc.descendants((t,s)=>{if(t.type===n){const i=s,l=s+t.nodeSize;a.delete(i,l)}}),a.docChanged?(o(a),!0):!1}}},addGlobalAttributes(){return[{types:["heading"],attributes:{id:{default:null}}}]}});exports.TableOfContents=m;
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { Node as Node_2 } from '@tiptap/core';
|
|
2
|
+
|
|
3
|
+
declare interface Options {
|
|
4
|
+
onHasOneBeforeInsert?: () => void;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export declare const TableOfContents: Node_2<Options, any>;
|
|
8
|
+
|
|
9
|
+
export { }
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
declare module '@tiptap/core' {
|
|
13
|
+
interface Commands<ReturnType> {
|
|
14
|
+
attachment: {
|
|
15
|
+
setAttachment: (attrs?: unknown) => ReturnType;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
declare module '@tiptap/core' {
|
|
22
|
+
interface Commands<ReturnType> {
|
|
23
|
+
setCodeBlock: {
|
|
24
|
+
setCodeBlock: (options?: any) => ReturnType;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
declare module '@tiptap/core' {
|
|
31
|
+
interface Commands<ReturnType> {
|
|
32
|
+
excalidraw: {
|
|
33
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
declare module '@tiptap/core' {
|
|
40
|
+
interface Commands<ReturnType> {
|
|
41
|
+
emoji: {
|
|
42
|
+
setEmoji: (emoji: {
|
|
43
|
+
name: string;
|
|
44
|
+
emoji: string;
|
|
45
|
+
}) => ReturnType;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
declare module '@tiptap/core' {
|
|
52
|
+
interface Commands<ReturnType> {
|
|
53
|
+
drawer: {
|
|
54
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
55
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
declare module '@tiptap/core' {
|
|
62
|
+
interface Commands<ReturnType> {
|
|
63
|
+
exportWord: {
|
|
64
|
+
exportToWord: () => ReturnType;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
declare module '@tiptap/core' {
|
|
71
|
+
interface Commands<ReturnType> {
|
|
72
|
+
fontSize: {
|
|
73
|
+
/**
|
|
74
|
+
* Set the text font size. ex: "12px", "2em", or "small". Must be a valid
|
|
75
|
+
* CSS font-size
|
|
76
|
+
* (https://developer.mozilla.org/en-US/docs/Web/CSS/font-size).
|
|
77
|
+
*/
|
|
78
|
+
setFontSize: (fontSize: string) => ReturnType;
|
|
79
|
+
/**
|
|
80
|
+
* Unset the font size
|
|
81
|
+
*/
|
|
82
|
+
unsetFontSize: () => ReturnType;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
declare module '@tiptap/core' {
|
|
89
|
+
interface Commands<ReturnType> {
|
|
90
|
+
painter: {
|
|
91
|
+
setPainter: (marks: Mark[]) => ReturnType;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
declare module '@tiptap/core' {
|
|
98
|
+
interface Commands<ReturnType> {
|
|
99
|
+
iframe: {
|
|
100
|
+
/**
|
|
101
|
+
* Add an iframe
|
|
102
|
+
*/
|
|
103
|
+
setIframe: (options: {
|
|
104
|
+
src: string;
|
|
105
|
+
service: string;
|
|
106
|
+
}) => ReturnType;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
declare module '@tiptap/core' {
|
|
113
|
+
interface Commands<ReturnType> {
|
|
114
|
+
imageUpload: {
|
|
115
|
+
/**
|
|
116
|
+
* Add an image
|
|
117
|
+
*/
|
|
118
|
+
setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
119
|
+
/**
|
|
120
|
+
* Update an image
|
|
121
|
+
*/
|
|
122
|
+
updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
123
|
+
/**
|
|
124
|
+
* Set image alignment
|
|
125
|
+
*/
|
|
126
|
+
setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
declare module '@tiptap/core' {
|
|
133
|
+
interface Commands<ReturnType> {
|
|
134
|
+
imageGifUpload: {
|
|
135
|
+
/**
|
|
136
|
+
* Add an image gif
|
|
137
|
+
*/
|
|
138
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
139
|
+
/**
|
|
140
|
+
* Update an image gif
|
|
141
|
+
*/
|
|
142
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
143
|
+
/**
|
|
144
|
+
* Set image alignment
|
|
145
|
+
*/
|
|
146
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
declare module '@tiptap/core' {
|
|
153
|
+
interface Commands<ReturnType> {
|
|
154
|
+
indent: {
|
|
155
|
+
/**
|
|
156
|
+
* Set the indent attribute
|
|
157
|
+
*/
|
|
158
|
+
indent: () => ReturnType;
|
|
159
|
+
/**
|
|
160
|
+
* Set the outdent attribute
|
|
161
|
+
*/
|
|
162
|
+
outdent: () => ReturnType;
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
declare module '@tiptap/core' {
|
|
169
|
+
interface Commands<ReturnType> {
|
|
170
|
+
katex: {
|
|
171
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
declare module '@tiptap/core' {
|
|
178
|
+
interface Commands<ReturnType> {
|
|
179
|
+
lineHeight: {
|
|
180
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
181
|
+
unsetLineHeight: () => ReturnType;
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
declare module '@tiptap/core' {
|
|
188
|
+
interface Commands<ReturnType> {
|
|
189
|
+
mermaid: {
|
|
190
|
+
setMermaid: (options: any, replace?: any) => ReturnType;
|
|
191
|
+
setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
declare module '@tiptap/core' {
|
|
198
|
+
interface Commands<ReturnType> {
|
|
199
|
+
columns: {
|
|
200
|
+
insertColumns: (attrs?: {
|
|
201
|
+
cols: number;
|
|
202
|
+
}) => ReturnType;
|
|
203
|
+
addColBefore: () => ReturnType;
|
|
204
|
+
addColAfter: () => ReturnType;
|
|
205
|
+
deleteCol: () => ReturnType;
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
declare module '@tiptap/core' {
|
|
212
|
+
interface Commands<ReturnType> {
|
|
213
|
+
search: {
|
|
214
|
+
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
215
|
+
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
216
|
+
replace: () => ReturnType;
|
|
217
|
+
replaceAll: () => ReturnType;
|
|
218
|
+
goToPrevSearchResult: () => void;
|
|
219
|
+
goToNextSearchResult: () => void;
|
|
220
|
+
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
declare module '@tiptap/core' {
|
|
227
|
+
interface Commands<ReturnType> {
|
|
228
|
+
tableOfContents: {
|
|
229
|
+
setTableOfContents: () => ReturnType;
|
|
230
|
+
removeTableOfContents: () => ReturnType;
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
declare module '@tiptap/core' {
|
|
237
|
+
interface Commands<ReturnType> {
|
|
238
|
+
twitter: {
|
|
239
|
+
/**
|
|
240
|
+
* Insert a tweet
|
|
241
|
+
* @param options The tweet attributes
|
|
242
|
+
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
243
|
+
*/
|
|
244
|
+
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
245
|
+
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
declare module '@tiptap/core' {
|
|
252
|
+
interface Commands<ReturnType> {
|
|
253
|
+
video: {
|
|
254
|
+
/**
|
|
255
|
+
* Add an video
|
|
256
|
+
*/
|
|
257
|
+
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
258
|
+
/**
|
|
259
|
+
* Update an video
|
|
260
|
+
*/
|
|
261
|
+
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
declare module '@tiptap/core' {
|
|
268
|
+
interface Commands<ReturnType> {
|
|
269
|
+
tableCellBackground: {
|
|
270
|
+
setTableCellBackground: (color: string) => ReturnType;
|
|
271
|
+
unsetTableCellBackground: () => ReturnType;
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { Node as Node_2 } from '@tiptap/core';
|
|
2
|
+
|
|
3
|
+
declare interface Options {
|
|
4
|
+
onHasOneBeforeInsert?: () => void;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export declare const TableOfContents: Node_2<Options, any>;
|
|
8
|
+
|
|
9
|
+
export { }
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
declare module '@tiptap/core' {
|
|
13
|
+
interface Commands<ReturnType> {
|
|
14
|
+
attachment: {
|
|
15
|
+
setAttachment: (attrs?: unknown) => ReturnType;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
declare module '@tiptap/core' {
|
|
22
|
+
interface Commands<ReturnType> {
|
|
23
|
+
setCodeBlock: {
|
|
24
|
+
setCodeBlock: (options?: any) => ReturnType;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
declare module '@tiptap/core' {
|
|
31
|
+
interface Commands<ReturnType> {
|
|
32
|
+
excalidraw: {
|
|
33
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
declare module '@tiptap/core' {
|
|
40
|
+
interface Commands<ReturnType> {
|
|
41
|
+
emoji: {
|
|
42
|
+
setEmoji: (emoji: {
|
|
43
|
+
name: string;
|
|
44
|
+
emoji: string;
|
|
45
|
+
}) => ReturnType;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
declare module '@tiptap/core' {
|
|
52
|
+
interface Commands<ReturnType> {
|
|
53
|
+
drawer: {
|
|
54
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
55
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
declare module '@tiptap/core' {
|
|
62
|
+
interface Commands<ReturnType> {
|
|
63
|
+
exportWord: {
|
|
64
|
+
exportToWord: () => ReturnType;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
declare module '@tiptap/core' {
|
|
71
|
+
interface Commands<ReturnType> {
|
|
72
|
+
fontSize: {
|
|
73
|
+
/**
|
|
74
|
+
* Set the text font size. ex: "12px", "2em", or "small". Must be a valid
|
|
75
|
+
* CSS font-size
|
|
76
|
+
* (https://developer.mozilla.org/en-US/docs/Web/CSS/font-size).
|
|
77
|
+
*/
|
|
78
|
+
setFontSize: (fontSize: string) => ReturnType;
|
|
79
|
+
/**
|
|
80
|
+
* Unset the font size
|
|
81
|
+
*/
|
|
82
|
+
unsetFontSize: () => ReturnType;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
declare module '@tiptap/core' {
|
|
89
|
+
interface Commands<ReturnType> {
|
|
90
|
+
painter: {
|
|
91
|
+
setPainter: (marks: Mark[]) => ReturnType;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
declare module '@tiptap/core' {
|
|
98
|
+
interface Commands<ReturnType> {
|
|
99
|
+
iframe: {
|
|
100
|
+
/**
|
|
101
|
+
* Add an iframe
|
|
102
|
+
*/
|
|
103
|
+
setIframe: (options: {
|
|
104
|
+
src: string;
|
|
105
|
+
service: string;
|
|
106
|
+
}) => ReturnType;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
declare module '@tiptap/core' {
|
|
113
|
+
interface Commands<ReturnType> {
|
|
114
|
+
imageUpload: {
|
|
115
|
+
/**
|
|
116
|
+
* Add an image
|
|
117
|
+
*/
|
|
118
|
+
setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
119
|
+
/**
|
|
120
|
+
* Update an image
|
|
121
|
+
*/
|
|
122
|
+
updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
123
|
+
/**
|
|
124
|
+
* Set image alignment
|
|
125
|
+
*/
|
|
126
|
+
setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
declare module '@tiptap/core' {
|
|
133
|
+
interface Commands<ReturnType> {
|
|
134
|
+
imageGifUpload: {
|
|
135
|
+
/**
|
|
136
|
+
* Add an image gif
|
|
137
|
+
*/
|
|
138
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
139
|
+
/**
|
|
140
|
+
* Update an image gif
|
|
141
|
+
*/
|
|
142
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
143
|
+
/**
|
|
144
|
+
* Set image alignment
|
|
145
|
+
*/
|
|
146
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
declare module '@tiptap/core' {
|
|
153
|
+
interface Commands<ReturnType> {
|
|
154
|
+
indent: {
|
|
155
|
+
/**
|
|
156
|
+
* Set the indent attribute
|
|
157
|
+
*/
|
|
158
|
+
indent: () => ReturnType;
|
|
159
|
+
/**
|
|
160
|
+
* Set the outdent attribute
|
|
161
|
+
*/
|
|
162
|
+
outdent: () => ReturnType;
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
declare module '@tiptap/core' {
|
|
169
|
+
interface Commands<ReturnType> {
|
|
170
|
+
katex: {
|
|
171
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
declare module '@tiptap/core' {
|
|
178
|
+
interface Commands<ReturnType> {
|
|
179
|
+
lineHeight: {
|
|
180
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
181
|
+
unsetLineHeight: () => ReturnType;
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
declare module '@tiptap/core' {
|
|
188
|
+
interface Commands<ReturnType> {
|
|
189
|
+
mermaid: {
|
|
190
|
+
setMermaid: (options: any, replace?: any) => ReturnType;
|
|
191
|
+
setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
declare module '@tiptap/core' {
|
|
198
|
+
interface Commands<ReturnType> {
|
|
199
|
+
columns: {
|
|
200
|
+
insertColumns: (attrs?: {
|
|
201
|
+
cols: number;
|
|
202
|
+
}) => ReturnType;
|
|
203
|
+
addColBefore: () => ReturnType;
|
|
204
|
+
addColAfter: () => ReturnType;
|
|
205
|
+
deleteCol: () => ReturnType;
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
declare module '@tiptap/core' {
|
|
212
|
+
interface Commands<ReturnType> {
|
|
213
|
+
search: {
|
|
214
|
+
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
215
|
+
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
216
|
+
replace: () => ReturnType;
|
|
217
|
+
replaceAll: () => ReturnType;
|
|
218
|
+
goToPrevSearchResult: () => void;
|
|
219
|
+
goToNextSearchResult: () => void;
|
|
220
|
+
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
declare module '@tiptap/core' {
|
|
227
|
+
interface Commands<ReturnType> {
|
|
228
|
+
tableOfContents: {
|
|
229
|
+
setTableOfContents: () => ReturnType;
|
|
230
|
+
removeTableOfContents: () => ReturnType;
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
declare module '@tiptap/core' {
|
|
237
|
+
interface Commands<ReturnType> {
|
|
238
|
+
twitter: {
|
|
239
|
+
/**
|
|
240
|
+
* Insert a tweet
|
|
241
|
+
* @param options The tweet attributes
|
|
242
|
+
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
243
|
+
*/
|
|
244
|
+
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
245
|
+
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
declare module '@tiptap/core' {
|
|
252
|
+
interface Commands<ReturnType> {
|
|
253
|
+
video: {
|
|
254
|
+
/**
|
|
255
|
+
* Add an video
|
|
256
|
+
*/
|
|
257
|
+
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
258
|
+
/**
|
|
259
|
+
* Update an video
|
|
260
|
+
*/
|
|
261
|
+
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
declare module '@tiptap/core' {
|
|
268
|
+
interface Commands<ReturnType> {
|
|
269
|
+
tableCellBackground: {
|
|
270
|
+
setTableCellBackground: (color: string) => ReturnType;
|
|
271
|
+
unsetTableCellBackground: () => ReturnType;
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
}
|