reactjs-tiptap-editor 0.2.29 → 0.3.1
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-BllDdN2-.js +33 -0
- package/lib/ActionMenuButton-tLPdHfCT.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 +44 -0
- package/lib/CodeBlock.d.cts +352 -0
- package/lib/CodeBlock.d.ts +352 -0
- package/lib/CodeBlock.js +4189 -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-BBmEHEAp.cjs +1 -0
- package/lib/Drawer-hyBIiEP6.js +1367 -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-BQ2PeAoa.js +651 -0
- package/lib/Excalidraw-Cd01zFJl.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-CM-Xq9RS.cjs +137 -0
- package/lib/RichTextEditor-DvrUVNK2.js +11417 -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-BuMkJKBq.cjs +17 -0
- package/lib/Twitter-BvdxYuDK.js +1743 -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-B172kMgC.js +20 -0
- package/lib/textarea-CapyElEP.cjs +1 -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,61 @@
|
|
|
1
|
+
import { M as r, m as o } from "./index-Drmyqk9P.js";
|
|
2
|
+
import { A as i } from "./RichTextEditor-DvrUVNK2.js";
|
|
3
|
+
const s = r.create({
|
|
4
|
+
name: "underline",
|
|
5
|
+
addOptions() {
|
|
6
|
+
return {
|
|
7
|
+
HTMLAttributes: {}
|
|
8
|
+
};
|
|
9
|
+
},
|
|
10
|
+
parseHTML() {
|
|
11
|
+
return [
|
|
12
|
+
{
|
|
13
|
+
tag: "u"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
style: "text-decoration",
|
|
17
|
+
consuming: !1,
|
|
18
|
+
getAttrs: (e) => e.includes("underline") ? {} : !1
|
|
19
|
+
}
|
|
20
|
+
];
|
|
21
|
+
},
|
|
22
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
23
|
+
return ["u", o(this.options.HTMLAttributes, e), 0];
|
|
24
|
+
},
|
|
25
|
+
addCommands() {
|
|
26
|
+
return {
|
|
27
|
+
setUnderline: () => ({ commands: e }) => e.setMark(this.name),
|
|
28
|
+
toggleUnderline: () => ({ commands: e }) => e.toggleMark(this.name),
|
|
29
|
+
unsetUnderline: () => ({ commands: e }) => e.unsetMark(this.name)
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
addKeyboardShortcuts() {
|
|
33
|
+
return {
|
|
34
|
+
"Mod-u": () => this.editor.commands.toggleUnderline(),
|
|
35
|
+
"Mod-U": () => this.editor.commands.toggleUnderline()
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}), u = /* @__PURE__ */ s.extend({
|
|
39
|
+
addOptions() {
|
|
40
|
+
var e;
|
|
41
|
+
return {
|
|
42
|
+
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
43
|
+
button({ editor: t, t: n }) {
|
|
44
|
+
return {
|
|
45
|
+
component: i,
|
|
46
|
+
componentProps: {
|
|
47
|
+
action: () => t.commands.toggleUnderline(),
|
|
48
|
+
isActive: () => t.isActive("underline") || !1,
|
|
49
|
+
disabled: !1,
|
|
50
|
+
icon: "Underline",
|
|
51
|
+
shortcutKeys: ["mod", "U"],
|
|
52
|
+
tooltip: n("editor.underline.tooltip")
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
export {
|
|
60
|
+
u as TextUnderline
|
|
61
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-COecBbaE.cjs");function s({types:n,node:o}){return Array.isArray(n)&&n.includes(o.type)||o.type===n}const g=i.Extension.create({name:"trailingNode",addOptions(){return{node:"paragraph",notAfter:["paragraph"]}},addProseMirrorPlugins(){const n=new i.PluginKey(this.name),o=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>this.options.notAfter.includes(e.name));return[new i.Plugin({key:n,appendTransaction:(e,r,t)=>{const{doc:d,tr:a,schema:c}=t,l=n.getState(t),u=d.content.size,p=c.nodes[this.options.node];if(l)return a.insert(u,p.create())},state:{init:(e,r)=>{const t=r.tr.doc.lastChild;return!s({node:t,types:o})},apply:(e,r)=>{if(!e.docChanged)return r;const t=e.doc.lastChild;return!s({node:t,types:o})}}})]}});exports.TrailingNode=g;
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
|
|
3
|
+
export declare const TrailingNode: Extension<TrailingNodeOptions, any>;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Extension based on:
|
|
7
|
+
* - https://github.com/ueberdosis/tiptap/blob/v1/packages/tiptap-extensions/src/extensions/TrailingNode.js
|
|
8
|
+
* - https://github.com/remirror/remirror/blob/e0f1bec4a1e8073ce8f5500d62193e52321155b9/packages/prosemirror-trailing-node/src/trailing-node-plugin.ts
|
|
9
|
+
*/
|
|
10
|
+
export declare interface TrailingNodeOptions {
|
|
11
|
+
node: string;
|
|
12
|
+
notAfter: string[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { }
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
declare module '@tiptap/core' {
|
|
19
|
+
interface Commands<ReturnType> {
|
|
20
|
+
attachment: {
|
|
21
|
+
setAttachment: (attrs?: unknown) => ReturnType;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
declare module '@tiptap/core' {
|
|
28
|
+
interface Commands<ReturnType> {
|
|
29
|
+
setCodeBlock: {
|
|
30
|
+
setCodeBlock: (options?: any) => ReturnType;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
declare module '@tiptap/core' {
|
|
37
|
+
interface Commands<ReturnType> {
|
|
38
|
+
drawer: {
|
|
39
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
40
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
declare module '@tiptap/core' {
|
|
47
|
+
interface Commands<ReturnType> {
|
|
48
|
+
emoji: {
|
|
49
|
+
setEmoji: (emoji: {
|
|
50
|
+
name: string;
|
|
51
|
+
emoji: string;
|
|
52
|
+
}) => ReturnType;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
declare module '@tiptap/core' {
|
|
59
|
+
interface Commands<ReturnType> {
|
|
60
|
+
excalidraw: {
|
|
61
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
declare module '@tiptap/core' {
|
|
68
|
+
interface Commands<ReturnType> {
|
|
69
|
+
exportWord: {
|
|
70
|
+
exportToWord: () => ReturnType;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
declare module '@tiptap/core' {
|
|
77
|
+
interface Commands<ReturnType> {
|
|
78
|
+
fontSize: {
|
|
79
|
+
/**
|
|
80
|
+
* Set the text font size. ex: "12px", "2em", or "small". Must be a valid
|
|
81
|
+
* CSS font-size
|
|
82
|
+
* (https://developer.mozilla.org/en-US/docs/Web/CSS/font-size).
|
|
83
|
+
*/
|
|
84
|
+
setFontSize: (fontSize: string) => ReturnType;
|
|
85
|
+
/**
|
|
86
|
+
* Unset the font size
|
|
87
|
+
*/
|
|
88
|
+
unsetFontSize: () => ReturnType;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
declare module '@tiptap/core' {
|
|
95
|
+
interface Commands<ReturnType> {
|
|
96
|
+
painter: {
|
|
97
|
+
setPainter: (marks: Mark[]) => ReturnType;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
declare module '@tiptap/core' {
|
|
104
|
+
interface Commands<ReturnType> {
|
|
105
|
+
iframe: {
|
|
106
|
+
/**
|
|
107
|
+
* Add an iframe
|
|
108
|
+
*/
|
|
109
|
+
setIframe: (options: {
|
|
110
|
+
src: string;
|
|
111
|
+
service: string;
|
|
112
|
+
}) => ReturnType;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
declare module '@tiptap/core' {
|
|
119
|
+
interface Commands<ReturnType> {
|
|
120
|
+
imageUpload: {
|
|
121
|
+
/**
|
|
122
|
+
* Add an image
|
|
123
|
+
*/
|
|
124
|
+
setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
125
|
+
/**
|
|
126
|
+
* Update an image
|
|
127
|
+
*/
|
|
128
|
+
updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
129
|
+
/**
|
|
130
|
+
* Set image alignment
|
|
131
|
+
*/
|
|
132
|
+
setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
declare module '@tiptap/core' {
|
|
139
|
+
interface Commands<ReturnType> {
|
|
140
|
+
imageGifUpload: {
|
|
141
|
+
/**
|
|
142
|
+
* Add an image gif
|
|
143
|
+
*/
|
|
144
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
145
|
+
/**
|
|
146
|
+
* Update an image gif
|
|
147
|
+
*/
|
|
148
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
149
|
+
/**
|
|
150
|
+
* Set image alignment
|
|
151
|
+
*/
|
|
152
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
declare module '@tiptap/core' {
|
|
159
|
+
interface Commands<ReturnType> {
|
|
160
|
+
indent: {
|
|
161
|
+
/**
|
|
162
|
+
* Set the indent attribute
|
|
163
|
+
*/
|
|
164
|
+
indent: () => ReturnType;
|
|
165
|
+
/**
|
|
166
|
+
* Set the outdent attribute
|
|
167
|
+
*/
|
|
168
|
+
outdent: () => ReturnType;
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
declare module '@tiptap/core' {
|
|
175
|
+
interface Commands<ReturnType> {
|
|
176
|
+
katex: {
|
|
177
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
declare module '@tiptap/core' {
|
|
184
|
+
interface Commands<ReturnType> {
|
|
185
|
+
lineHeight: {
|
|
186
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
187
|
+
unsetLineHeight: () => ReturnType;
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
declare module '@tiptap/core' {
|
|
194
|
+
interface Commands<ReturnType> {
|
|
195
|
+
mermaid: {
|
|
196
|
+
setMermaid: (options: any, replace?: any) => ReturnType;
|
|
197
|
+
setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
declare module '@tiptap/core' {
|
|
204
|
+
interface Commands<ReturnType> {
|
|
205
|
+
columns: {
|
|
206
|
+
insertColumns: (attrs?: {
|
|
207
|
+
cols: number;
|
|
208
|
+
}) => ReturnType;
|
|
209
|
+
addColBefore: () => ReturnType;
|
|
210
|
+
addColAfter: () => ReturnType;
|
|
211
|
+
deleteCol: () => ReturnType;
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
declare module '@tiptap/core' {
|
|
218
|
+
interface Commands<ReturnType> {
|
|
219
|
+
search: {
|
|
220
|
+
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
221
|
+
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
222
|
+
replace: () => ReturnType;
|
|
223
|
+
replaceAll: () => ReturnType;
|
|
224
|
+
goToPrevSearchResult: () => void;
|
|
225
|
+
goToNextSearchResult: () => void;
|
|
226
|
+
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
declare module '@tiptap/core' {
|
|
233
|
+
interface Commands<ReturnType> {
|
|
234
|
+
tableOfContents: {
|
|
235
|
+
setTableOfContents: () => ReturnType;
|
|
236
|
+
removeTableOfContents: () => ReturnType;
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
declare module '@tiptap/core' {
|
|
243
|
+
interface Commands<ReturnType> {
|
|
244
|
+
twitter: {
|
|
245
|
+
/**
|
|
246
|
+
* Insert a tweet
|
|
247
|
+
* @param options The tweet attributes
|
|
248
|
+
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
249
|
+
*/
|
|
250
|
+
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
251
|
+
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
declare module '@tiptap/core' {
|
|
258
|
+
interface Commands<ReturnType> {
|
|
259
|
+
video: {
|
|
260
|
+
/**
|
|
261
|
+
* Add an video
|
|
262
|
+
*/
|
|
263
|
+
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
264
|
+
/**
|
|
265
|
+
* Update an video
|
|
266
|
+
*/
|
|
267
|
+
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
declare module '@tiptap/core' {
|
|
274
|
+
interface Commands<ReturnType> {
|
|
275
|
+
tableCellBackground: {
|
|
276
|
+
setTableCellBackground: (color: string) => ReturnType;
|
|
277
|
+
unsetTableCellBackground: () => ReturnType;
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
}
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
|
|
3
|
+
export declare const TrailingNode: Extension<TrailingNodeOptions, any>;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Extension based on:
|
|
7
|
+
* - https://github.com/ueberdosis/tiptap/blob/v1/packages/tiptap-extensions/src/extensions/TrailingNode.js
|
|
8
|
+
* - https://github.com/remirror/remirror/blob/e0f1bec4a1e8073ce8f5500d62193e52321155b9/packages/prosemirror-trailing-node/src/trailing-node-plugin.ts
|
|
9
|
+
*/
|
|
10
|
+
export declare interface TrailingNodeOptions {
|
|
11
|
+
node: string;
|
|
12
|
+
notAfter: string[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { }
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
declare module '@tiptap/core' {
|
|
19
|
+
interface Commands<ReturnType> {
|
|
20
|
+
attachment: {
|
|
21
|
+
setAttachment: (attrs?: unknown) => ReturnType;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
declare module '@tiptap/core' {
|
|
28
|
+
interface Commands<ReturnType> {
|
|
29
|
+
setCodeBlock: {
|
|
30
|
+
setCodeBlock: (options?: any) => ReturnType;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
declare module '@tiptap/core' {
|
|
37
|
+
interface Commands<ReturnType> {
|
|
38
|
+
drawer: {
|
|
39
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
40
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
declare module '@tiptap/core' {
|
|
47
|
+
interface Commands<ReturnType> {
|
|
48
|
+
emoji: {
|
|
49
|
+
setEmoji: (emoji: {
|
|
50
|
+
name: string;
|
|
51
|
+
emoji: string;
|
|
52
|
+
}) => ReturnType;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
declare module '@tiptap/core' {
|
|
59
|
+
interface Commands<ReturnType> {
|
|
60
|
+
excalidraw: {
|
|
61
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
declare module '@tiptap/core' {
|
|
68
|
+
interface Commands<ReturnType> {
|
|
69
|
+
exportWord: {
|
|
70
|
+
exportToWord: () => ReturnType;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
declare module '@tiptap/core' {
|
|
77
|
+
interface Commands<ReturnType> {
|
|
78
|
+
fontSize: {
|
|
79
|
+
/**
|
|
80
|
+
* Set the text font size. ex: "12px", "2em", or "small". Must be a valid
|
|
81
|
+
* CSS font-size
|
|
82
|
+
* (https://developer.mozilla.org/en-US/docs/Web/CSS/font-size).
|
|
83
|
+
*/
|
|
84
|
+
setFontSize: (fontSize: string) => ReturnType;
|
|
85
|
+
/**
|
|
86
|
+
* Unset the font size
|
|
87
|
+
*/
|
|
88
|
+
unsetFontSize: () => ReturnType;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
declare module '@tiptap/core' {
|
|
95
|
+
interface Commands<ReturnType> {
|
|
96
|
+
painter: {
|
|
97
|
+
setPainter: (marks: Mark[]) => ReturnType;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
declare module '@tiptap/core' {
|
|
104
|
+
interface Commands<ReturnType> {
|
|
105
|
+
iframe: {
|
|
106
|
+
/**
|
|
107
|
+
* Add an iframe
|
|
108
|
+
*/
|
|
109
|
+
setIframe: (options: {
|
|
110
|
+
src: string;
|
|
111
|
+
service: string;
|
|
112
|
+
}) => ReturnType;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
declare module '@tiptap/core' {
|
|
119
|
+
interface Commands<ReturnType> {
|
|
120
|
+
imageUpload: {
|
|
121
|
+
/**
|
|
122
|
+
* Add an image
|
|
123
|
+
*/
|
|
124
|
+
setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
125
|
+
/**
|
|
126
|
+
* Update an image
|
|
127
|
+
*/
|
|
128
|
+
updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
129
|
+
/**
|
|
130
|
+
* Set image alignment
|
|
131
|
+
*/
|
|
132
|
+
setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
declare module '@tiptap/core' {
|
|
139
|
+
interface Commands<ReturnType> {
|
|
140
|
+
imageGifUpload: {
|
|
141
|
+
/**
|
|
142
|
+
* Add an image gif
|
|
143
|
+
*/
|
|
144
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
145
|
+
/**
|
|
146
|
+
* Update an image gif
|
|
147
|
+
*/
|
|
148
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
149
|
+
/**
|
|
150
|
+
* Set image alignment
|
|
151
|
+
*/
|
|
152
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
declare module '@tiptap/core' {
|
|
159
|
+
interface Commands<ReturnType> {
|
|
160
|
+
indent: {
|
|
161
|
+
/**
|
|
162
|
+
* Set the indent attribute
|
|
163
|
+
*/
|
|
164
|
+
indent: () => ReturnType;
|
|
165
|
+
/**
|
|
166
|
+
* Set the outdent attribute
|
|
167
|
+
*/
|
|
168
|
+
outdent: () => ReturnType;
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
declare module '@tiptap/core' {
|
|
175
|
+
interface Commands<ReturnType> {
|
|
176
|
+
katex: {
|
|
177
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
declare module '@tiptap/core' {
|
|
184
|
+
interface Commands<ReturnType> {
|
|
185
|
+
lineHeight: {
|
|
186
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
187
|
+
unsetLineHeight: () => ReturnType;
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
declare module '@tiptap/core' {
|
|
194
|
+
interface Commands<ReturnType> {
|
|
195
|
+
mermaid: {
|
|
196
|
+
setMermaid: (options: any, replace?: any) => ReturnType;
|
|
197
|
+
setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
declare module '@tiptap/core' {
|
|
204
|
+
interface Commands<ReturnType> {
|
|
205
|
+
columns: {
|
|
206
|
+
insertColumns: (attrs?: {
|
|
207
|
+
cols: number;
|
|
208
|
+
}) => ReturnType;
|
|
209
|
+
addColBefore: () => ReturnType;
|
|
210
|
+
addColAfter: () => ReturnType;
|
|
211
|
+
deleteCol: () => ReturnType;
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
declare module '@tiptap/core' {
|
|
218
|
+
interface Commands<ReturnType> {
|
|
219
|
+
search: {
|
|
220
|
+
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
221
|
+
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
222
|
+
replace: () => ReturnType;
|
|
223
|
+
replaceAll: () => ReturnType;
|
|
224
|
+
goToPrevSearchResult: () => void;
|
|
225
|
+
goToNextSearchResult: () => void;
|
|
226
|
+
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
declare module '@tiptap/core' {
|
|
233
|
+
interface Commands<ReturnType> {
|
|
234
|
+
tableOfContents: {
|
|
235
|
+
setTableOfContents: () => ReturnType;
|
|
236
|
+
removeTableOfContents: () => ReturnType;
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
declare module '@tiptap/core' {
|
|
243
|
+
interface Commands<ReturnType> {
|
|
244
|
+
twitter: {
|
|
245
|
+
/**
|
|
246
|
+
* Insert a tweet
|
|
247
|
+
* @param options The tweet attributes
|
|
248
|
+
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
249
|
+
*/
|
|
250
|
+
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
251
|
+
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
declare module '@tiptap/core' {
|
|
258
|
+
interface Commands<ReturnType> {
|
|
259
|
+
video: {
|
|
260
|
+
/**
|
|
261
|
+
* Add an video
|
|
262
|
+
*/
|
|
263
|
+
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
264
|
+
/**
|
|
265
|
+
* Update an video
|
|
266
|
+
*/
|
|
267
|
+
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
declare module '@tiptap/core' {
|
|
274
|
+
interface Commands<ReturnType> {
|
|
275
|
+
tableCellBackground: {
|
|
276
|
+
setTableCellBackground: (color: string) => ReturnType;
|
|
277
|
+
unsetTableCellBackground: () => ReturnType;
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { E as u, a as h, P as g } from "./index-Drmyqk9P.js";
|
|
2
|
+
function s({ types: n, node: o }) {
|
|
3
|
+
return Array.isArray(n) && n.includes(o.type) || o.type === n;
|
|
4
|
+
}
|
|
5
|
+
const m = /* @__PURE__ */ u.create({
|
|
6
|
+
name: "trailingNode",
|
|
7
|
+
addOptions() {
|
|
8
|
+
return {
|
|
9
|
+
node: "paragraph",
|
|
10
|
+
notAfter: ["paragraph"]
|
|
11
|
+
};
|
|
12
|
+
},
|
|
13
|
+
addProseMirrorPlugins() {
|
|
14
|
+
const n = new h(this.name), o = Object.entries(this.editor.schema.nodes).map(([, e]) => e).filter((e) => this.options.notAfter.includes(e.name));
|
|
15
|
+
return [
|
|
16
|
+
new g({
|
|
17
|
+
key: n,
|
|
18
|
+
appendTransaction: (e, r, t) => {
|
|
19
|
+
const { doc: i, tr: a, schema: d } = t, c = n.getState(t), l = i.content.size, p = d.nodes[this.options.node];
|
|
20
|
+
if (c)
|
|
21
|
+
return a.insert(l, p.create());
|
|
22
|
+
},
|
|
23
|
+
state: {
|
|
24
|
+
init: (e, r) => {
|
|
25
|
+
const t = r.tr.doc.lastChild;
|
|
26
|
+
return !s({ node: t, types: o });
|
|
27
|
+
},
|
|
28
|
+
apply: (e, r) => {
|
|
29
|
+
if (!e.docChanged)
|
|
30
|
+
return r;
|
|
31
|
+
const t = e.doc.lastChild;
|
|
32
|
+
return !s({ node: t, types: o });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
export {
|
|
40
|
+
m as TrailingNode
|
|
41
|
+
};
|