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
package/lib/Video.d.ts
ADDED
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/react';
|
|
2
|
+
import { Extension } from '@tiptap/core';
|
|
3
|
+
import { Node as Node_2 } from '@tiptap/core';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Represents the ButtonView function.
|
|
7
|
+
*/
|
|
8
|
+
declare type ButtonView<T = any> = (options: ButtonViewParams<T>) => ButtonViewReturn | ButtonViewReturn[];
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents the parameters for the ButtonView function.
|
|
12
|
+
*/
|
|
13
|
+
declare interface ButtonViewParams<T = any> {
|
|
14
|
+
/** Editor object */
|
|
15
|
+
editor: Editor;
|
|
16
|
+
/** Extension object */
|
|
17
|
+
extension: Extension<T>;
|
|
18
|
+
/** Translation function */
|
|
19
|
+
t: (path: string) => string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Represents the return value for the ButtonView component.
|
|
24
|
+
*/
|
|
25
|
+
declare interface ButtonViewReturn {
|
|
26
|
+
/** Component */
|
|
27
|
+
component: unknown;
|
|
28
|
+
/** Component props */
|
|
29
|
+
componentProps: ButtonViewReturnComponentProps;
|
|
30
|
+
/** Component slots */
|
|
31
|
+
componentSlots?: ButtonViewReturnComponentSlots;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Represents the props for the ButtonView component.
|
|
36
|
+
*/
|
|
37
|
+
declare interface ButtonViewReturnComponentProps {
|
|
38
|
+
/** Method triggered when action is performed */
|
|
39
|
+
action?: (value?: any) => void;
|
|
40
|
+
/** Whether it is in the active state */
|
|
41
|
+
isActive?: () => boolean;
|
|
42
|
+
/** Button icon */
|
|
43
|
+
icon?: any;
|
|
44
|
+
/** Text displayed on hover */
|
|
45
|
+
tooltip?: string;
|
|
46
|
+
[x: string]: any;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Represents the slots for the ButtonView component.
|
|
51
|
+
*/
|
|
52
|
+
declare interface ButtonViewReturnComponentSlots {
|
|
53
|
+
/** Dialog slot */
|
|
54
|
+
dialog: () => any;
|
|
55
|
+
[x: string]: () => any;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Represents the general options for Tiptap extensions.
|
|
60
|
+
*/
|
|
61
|
+
declare interface GeneralOptions<T> {
|
|
62
|
+
/** Enabled divider */
|
|
63
|
+
divider: boolean;
|
|
64
|
+
/** Enabled spacer */
|
|
65
|
+
spacer: boolean;
|
|
66
|
+
/** Button view function */
|
|
67
|
+
button: ButtonView<T>;
|
|
68
|
+
/** Show on Toolbar */
|
|
69
|
+
toolbar?: boolean;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export declare const Video: Node_2<VideoOptions, any>;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Represents the interface for video options, extending GeneralOptions.
|
|
76
|
+
*/
|
|
77
|
+
export declare interface VideoOptions extends GeneralOptions<VideoOptions> {
|
|
78
|
+
/**
|
|
79
|
+
* Indicates whether fullscreen play is allowed
|
|
80
|
+
*
|
|
81
|
+
* @default true
|
|
82
|
+
*/
|
|
83
|
+
allowFullscreen: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Indicates whether to display the frameborder
|
|
86
|
+
*
|
|
87
|
+
* @default false
|
|
88
|
+
*/
|
|
89
|
+
frameborder: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Width of the video, can be a number or string
|
|
92
|
+
*
|
|
93
|
+
* @default VIDEO_SIZE['size-medium']
|
|
94
|
+
*/
|
|
95
|
+
width: number | string;
|
|
96
|
+
/** HTML attributes object for passing additional attributes */
|
|
97
|
+
HTMLAttributes: {
|
|
98
|
+
[key: string]: any;
|
|
99
|
+
};
|
|
100
|
+
/** Function for uploading files */
|
|
101
|
+
upload?: (file: File) => Promise<string>;
|
|
102
|
+
/** The source URL of the video */
|
|
103
|
+
resourceVideo: 'upload' | 'link' | 'both';
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export { }
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
declare module '@tiptap/core' {
|
|
110
|
+
interface Commands<ReturnType> {
|
|
111
|
+
attachment: {
|
|
112
|
+
setAttachment: (attrs?: unknown) => ReturnType;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
declare module '@tiptap/core' {
|
|
119
|
+
interface Commands<ReturnType> {
|
|
120
|
+
setCodeBlock: {
|
|
121
|
+
setCodeBlock: (options?: any) => ReturnType;
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
declare module '@tiptap/core' {
|
|
128
|
+
interface Commands<ReturnType> {
|
|
129
|
+
drawer: {
|
|
130
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
131
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
declare module '@tiptap/core' {
|
|
138
|
+
interface Commands<ReturnType> {
|
|
139
|
+
emoji: {
|
|
140
|
+
setEmoji: (emoji: {
|
|
141
|
+
name: string;
|
|
142
|
+
emoji: string;
|
|
143
|
+
}) => ReturnType;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
declare module '@tiptap/core' {
|
|
150
|
+
interface Commands<ReturnType> {
|
|
151
|
+
excalidraw: {
|
|
152
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
declare module '@tiptap/core' {
|
|
159
|
+
interface Commands<ReturnType> {
|
|
160
|
+
exportWord: {
|
|
161
|
+
exportToWord: () => ReturnType;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
declare module '@tiptap/core' {
|
|
168
|
+
interface Commands<ReturnType> {
|
|
169
|
+
fontSize: {
|
|
170
|
+
/**
|
|
171
|
+
* Set the text font size. ex: "12px", "2em", or "small". Must be a valid
|
|
172
|
+
* CSS font-size
|
|
173
|
+
* (https://developer.mozilla.org/en-US/docs/Web/CSS/font-size).
|
|
174
|
+
*/
|
|
175
|
+
setFontSize: (fontSize: string) => ReturnType;
|
|
176
|
+
/**
|
|
177
|
+
* Unset the font size
|
|
178
|
+
*/
|
|
179
|
+
unsetFontSize: () => ReturnType;
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
declare module '@tiptap/core' {
|
|
186
|
+
interface Commands<ReturnType> {
|
|
187
|
+
painter: {
|
|
188
|
+
setPainter: (marks: Mark[]) => ReturnType;
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
declare module '@tiptap/core' {
|
|
195
|
+
interface Commands<ReturnType> {
|
|
196
|
+
iframe: {
|
|
197
|
+
/**
|
|
198
|
+
* Add an iframe
|
|
199
|
+
*/
|
|
200
|
+
setIframe: (options: {
|
|
201
|
+
src: string;
|
|
202
|
+
service: string;
|
|
203
|
+
}) => ReturnType;
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
declare module '@tiptap/core' {
|
|
210
|
+
interface Commands<ReturnType> {
|
|
211
|
+
imageUpload: {
|
|
212
|
+
/**
|
|
213
|
+
* Add an image
|
|
214
|
+
*/
|
|
215
|
+
setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
216
|
+
/**
|
|
217
|
+
* Update an image
|
|
218
|
+
*/
|
|
219
|
+
updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
220
|
+
/**
|
|
221
|
+
* Set image alignment
|
|
222
|
+
*/
|
|
223
|
+
setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
declare module '@tiptap/core' {
|
|
230
|
+
interface Commands<ReturnType> {
|
|
231
|
+
imageGifUpload: {
|
|
232
|
+
/**
|
|
233
|
+
* Add an image gif
|
|
234
|
+
*/
|
|
235
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
236
|
+
/**
|
|
237
|
+
* Update an image gif
|
|
238
|
+
*/
|
|
239
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
240
|
+
/**
|
|
241
|
+
* Set image alignment
|
|
242
|
+
*/
|
|
243
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
declare module '@tiptap/core' {
|
|
250
|
+
interface Commands<ReturnType> {
|
|
251
|
+
indent: {
|
|
252
|
+
/**
|
|
253
|
+
* Set the indent attribute
|
|
254
|
+
*/
|
|
255
|
+
indent: () => ReturnType;
|
|
256
|
+
/**
|
|
257
|
+
* Set the outdent attribute
|
|
258
|
+
*/
|
|
259
|
+
outdent: () => ReturnType;
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
declare module '@tiptap/core' {
|
|
266
|
+
interface Commands<ReturnType> {
|
|
267
|
+
katex: {
|
|
268
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
declare module '@tiptap/core' {
|
|
275
|
+
interface Commands<ReturnType> {
|
|
276
|
+
lineHeight: {
|
|
277
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
278
|
+
unsetLineHeight: () => ReturnType;
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
declare module '@tiptap/core' {
|
|
285
|
+
interface Commands<ReturnType> {
|
|
286
|
+
mermaid: {
|
|
287
|
+
setMermaid: (options: any, replace?: any) => ReturnType;
|
|
288
|
+
setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
declare module '@tiptap/core' {
|
|
295
|
+
interface Commands<ReturnType> {
|
|
296
|
+
columns: {
|
|
297
|
+
insertColumns: (attrs?: {
|
|
298
|
+
cols: number;
|
|
299
|
+
}) => ReturnType;
|
|
300
|
+
addColBefore: () => ReturnType;
|
|
301
|
+
addColAfter: () => ReturnType;
|
|
302
|
+
deleteCol: () => ReturnType;
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
declare module '@tiptap/core' {
|
|
309
|
+
interface Commands<ReturnType> {
|
|
310
|
+
search: {
|
|
311
|
+
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
312
|
+
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
313
|
+
replace: () => ReturnType;
|
|
314
|
+
replaceAll: () => ReturnType;
|
|
315
|
+
goToPrevSearchResult: () => void;
|
|
316
|
+
goToNextSearchResult: () => void;
|
|
317
|
+
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
declare module '@tiptap/core' {
|
|
324
|
+
interface Commands<ReturnType> {
|
|
325
|
+
tableOfContents: {
|
|
326
|
+
setTableOfContents: () => ReturnType;
|
|
327
|
+
removeTableOfContents: () => ReturnType;
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
declare module '@tiptap/core' {
|
|
334
|
+
interface Commands<ReturnType> {
|
|
335
|
+
twitter: {
|
|
336
|
+
/**
|
|
337
|
+
* Insert a tweet
|
|
338
|
+
* @param options The tweet attributes
|
|
339
|
+
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
340
|
+
*/
|
|
341
|
+
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
342
|
+
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
declare module '@tiptap/core' {
|
|
349
|
+
interface Commands<ReturnType> {
|
|
350
|
+
video: {
|
|
351
|
+
/**
|
|
352
|
+
* Add an video
|
|
353
|
+
*/
|
|
354
|
+
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
355
|
+
/**
|
|
356
|
+
* Update an video
|
|
357
|
+
*/
|
|
358
|
+
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
declare module '@tiptap/core' {
|
|
365
|
+
interface Commands<ReturnType> {
|
|
366
|
+
tableCellBackground: {
|
|
367
|
+
setTableCellBackground: (color: string) => ReturnType;
|
|
368
|
+
unsetTableCellBackground: () => ReturnType;
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
}
|
package/lib/Video.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var V=Object.create;var q=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var Q=(e,n,s,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of G(n))!J.call(e,i)&&i!==s&&q(e,i,{get:()=>n[i],enumerable:!(c=_(n,i))||c.enumerable});return e};var X=(e,n,s)=>(s=e!=null?V(Z(e)):{},Q(n||!e||!e.__esModule?q(s,"default",{value:e,enumerable:!0}):s,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("react"),k=require("./dom-dataset-CAXnsjYE.cjs"),o=require("./RichTextEditor-CM-Xq9RS.cjs"),L=require("./Mermaid.cjs"),E=require("./shortId-Bfj8TyNr.cjs"),H=require("./textarea-CapyElEP.cjs"),I=require("./index-LbrE7K9i.cjs"),M=require("./Excalidraw-Cd01zFJl.cjs"),W=require("./Twitter-BuMkJKBq.cjs"),Y=require("katex"),F=require("lucide-react"),B=require("./Katex.cjs"),O=require("./Drawer-BBmEHEAp.cjs"),R=require("easydrawer"),$=`graph TB
|
|
2
|
+
a-->b`,ee=({editor:e,attrs:n,extension:s})=>{const{alt:c,align:i}=n,[r,l]=a.useState(decodeURIComponent(c??$)),[u,x]=a.useState(""),[f,b]=a.useState(!1),p=a.useRef(null),[g,y]=a.useState(null),S=s==null?void 0:s.options.upload,D=a.useCallback(w=>{w&&import("mermaid").then(j=>{y(j.default)})},[]),T=async w=>{try{const{svg:j}=await g.render("mermaid-svg",w);x(j)}catch{x("")}},N=()=>{g.initialize({darkMode:!1,startOnLoad:!1,fontSize:12,theme:"base"}),T(r)};a.useEffect(()=>{g&&f&&N()},[g,f]),a.useEffect(()=>{g&&f&&T(r)},[g,r]);const A=async()=>{if(r!==""){if(r){const w=p.current.querySelector("svg"),{width:j,height:z}=w.getBoundingClientRect(),m=`mermaid-${E.shortId()}.svg`;let d=E.i(w.outerHTML);if(S){const h=o.dataURLtoFile(d,m);d=await S(h)}e==null||e.chain().focus().setMermaid({type:"mermaid",src:d,alt:encodeURIComponent(r),width:j,height:z},!!r).run(),e==null||e.commands.setAlignImageMermaid(i)}b(!1)}};return t.jsxs(o.Dialog,{onOpenChange:b,open:f,children:[t.jsx(o.DialogTrigger,{asChild:!0,children:t.jsx(o.ActionButton,{action:()=>b(!0),icon:"Pencil",tooltip:"Edit Mermaid"})}),t.jsxs(o.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[t.jsx(o.DialogTitle,{children:"Edit Mermaid"}),t.jsx("div",{ref:D,style:{height:"100%",border:"1px solid hsl(var(--border))"},children:t.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[t.jsx(H.Textarea,{autoFocus:!0,className:"richtext-flex-1",defaultValue:$,onChange:w=>l(w.target.value),placeholder:"Text",required:!0,rows:10,value:r,style:{color:"hsl(var(--richtext-foreground))"}}),t.jsx("div",{className:"richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",dangerouslySetInnerHTML:{__html:u},ref:p,style:{height:"100%",border:"1px solid hsl(var(--border))",minHeight:500,background:"#fff"}})]})}),t.jsx(o.DialogFooter,{children:t.jsx(o.Button,{onClick:A,type:"button",children:"Save changes"})})]})]})};function K(e,n){const[s,c]=a.useState(void 0);return a.useEffect(()=>{const i=()=>{const r=e.extensionManager.extensions.find(l=>l.name===n);r&&c(r)};return e.on("selectionUpdate",i),e.on("transaction",i),()=>{e.off("selectionUpdate",i),e.off("transaction",i)}},[e,n]),s}const te={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function re({item:e,disabled:n,editor:s}){var i;const c=e.component;return c?t.jsx(a.Fragment,{children:e.type==="divider"?t.jsx(o.Separator,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}):t.jsx(c,{...e.componentProps,disabled:n||((i=e==null?void 0:e.componentProps)==null?void 0:i.disabled),editor:s})}):t.jsx(t.Fragment,{})}function ne(e){return e.type.name==="mermaid"}function ie(e){const{lang:n}=I.useLocale(),s=o.useAttributes(e.editor,L.Mermaid.name),c=K(e.editor,L.Mermaid.name),i=({editor:l})=>{const{selection:u}=l.view.state,{$from:x,to:f}=u;let b=!1;return l.view.state.doc.nodesBetween(x.pos,f,p=>{if(ne(p))return b=!0,!1}),b},r=a.useMemo(()=>e.disabled?[]:o.getBubbleMermaid(e.editor),[e.disabled,e.editor,n]);return t.jsx(t.Fragment,{children:t.jsx(k.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:i,tippyOptions:te,children:r!=null&&r.length?t.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:t.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:r==null?void 0:r.map((l,u)=>l.type==="edit"&&(s!=null&&s.src)?t.jsx(ee,{attrs:s,editor:e.editor,extension:c},`bubbleMenu-mermaid-${u}`):t.jsx(re,{disabled:e.disabled,editor:e.editor,item:l},`bubbleMenu-mermaid-${u}`))})}):t.jsx(t.Fragment,{})})})}const v=new Map;function se(e){const n=e.options.element;v.has("width")||v.set("width",n.clientWidth),v.has("width")&&v.get("width")<=0&&v.set("width",n.clientWidth);const s={attributes:!0,childList:!0,subtree:!0},c=function(){v.set("width",n.clientWidth)},i=new MutationObserver(c);return i.observe(n,s),e.on("destroy",()=>{i.disconnect()}),{width:v.get("width")}}function oe({editor:e}){const{t:n}=I.useLocale(),{width:s}=se(e),c=o.useAttributes(e,M.Excalidraw.name,{defaultShowPicker:!1,createUser:"",width:0,height:0}),{defaultShowPicker:i,createUser:r,width:l,height:u}=c,x=a.useCallback(g=>{e.chain().updateAttributes(M.Excalidraw.name,g).setNodeSelection(e.state.selection.from).focus().run()},[e]),f=a.useCallback(()=>{M.triggerOpenExcalidrawSettingModal(c)},[e,c]),b=a.useCallback(()=>e.isActive(M.Excalidraw.name),[e]),p=a.useCallback(()=>o.deleteNode(M.Excalidraw.name,e),[e]);return a.useEffect(()=>{i&&(f(),e.chain().updateAttributes(M.Excalidraw.name,{defaultShowPicker:!1}).focus().run())},[r,i,e,f]),t.jsx(k.BubbleMenu,{className:"bubble-menu",editor:e,pluginKey:"excalidraw-bubble-menu",shouldShow:b,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999},children:t.jsxs("div",{className:"richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background",children:[t.jsx(o.ActionButton,{icon:"Pencil",action:f,tooltip:n("editor.edit")}),t.jsx(o.SizeSetter,{width:l,maxWidth:s,height:u,onOk:x,children:t.jsx(o.ActionButton,{icon:"Settings",tooltip:n("editor.settings")})}),t.jsx(o.ActionButton,{icon:"Trash2",action:p,tooltip:n("editor.delete")})]})})}function ae({editor:e,disabled:n}){const[s,c]=a.useState(!1),{t:i}=I.useLocale(),r=a.useCallback(({editor:x})=>x.isActive(W.Twitter.name),[]),l=x=>{e.commands.updateTweet({src:x}),c(!1)},u=a.useCallback(()=>o.deleteNode(W.Twitter.name,e),[e]);return t.jsx(t.Fragment,{children:t.jsx(k.BubbleMenu,{editor:e,shouldShow:r,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999,onHidden:()=>{c(!1)}},children:n?t.jsx(t.Fragment,{}):t.jsx(t.Fragment,{children:s?t.jsx(W.FormEditLinkTwitter,{editor:e,onSetLink:l}):t.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-2 richtext-rounded-lg !richtext-border richtext-border-neutral-200 richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:t.jsxs("div",{className:"richtext-flex richtext-flex-nowrap",children:[t.jsx(o.ActionButton,{icon:"Pencil",tooltip:i("editor.link.edit.tooltip"),tooltipOptions:{sideOffset:15},action:()=>{c(!0)}}),t.jsx(o.ActionButton,{action:u,icon:"Trash",tooltip:i("editor.delete"),tooltipOptions:{sideOffset:15}})]})})})})})}function ce({editor:e,...n}){const s=o.useAttributes(e,B.Katex.name,{text:"",defaultShowPicker:!1}),{text:c,defaultShowPicker:i}=s,[r,l]=a.useState(""),[u,x]=a.useState(!1),f=a.useCallback(()=>e.isActive(B.Katex.name),[e]),b=a.useCallback(()=>o.deleteNode(B.Katex.name,e),[e]),p=a.useCallback(()=>{e.chain().focus().setKatex({text:r}).run(),x(!1)},[e,r]);a.useEffect(()=>{i&&(x(!0),e.chain().updateAttributes(B.Katex.name,{defaultShowPicker:!1}).focus().run())},[e,i,x]),a.useEffect(()=>{u&&l(c||"")},[u]);const g=a.useMemo(()=>{try{return Y.renderToString(`${r}`)}catch{return r}},[r]),y=a.useMemo(()=>`${r}`.trim()?t.jsx("span",{contentEditable:!1,dangerouslySetInnerHTML:{__html:g||""}}):null,[r,g]);return t.jsx(k.BubbleMenu,{editor:e,pluginKey:"Katex-bubble-menu",shouldShow:f,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999,onHidden:()=>{x(!1)}},children:n!=null&&n.disabled?t.jsx(t.Fragment,{}):t.jsx("div",{className:"richtext-rounded-lg !richtext-border richtext-border-neutral-200 richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:u?t.jsxs(t.Fragment,{children:[t.jsx(H.Textarea,{autoFocus:!0,defaultValue:c,onChange:S=>l(S.target.value),placeholder:"Formula text",rows:3,style:{marginBottom:8},value:r}),y&&t.jsx("div",{className:"richtext-my-[10px] richtext-overflow-auto richtext-whitespace-nowrap richtext-rounded-[6px] !richtext-border richtext-p-[10px]",children:y}),t.jsxs("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-gap-[6px]",children:[t.jsx(o.Button,{className:"richtext-flex-1",onClick:p,children:"Submit"}),t.jsx("a",{href:"https://katex.org/docs/supported",rel:"noreferrer noopener",target:"_blank",children:t.jsx(F.HelpCircle,{size:16})})]})]}):t.jsxs("div",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-gap-[6px]",children:[t.jsx(o.ActionButton,{action:()=>x(!u),tooltip:"Edit",children:t.jsx(F.Pencil,{size:16})}),t.jsx(o.ActionButton,{action:b,tooltip:"Delete",children:t.jsx(F.Trash2,{size:16})})]})})})}let C=!1;function le({editor:e,attrs:n,extension:s}){const[c,i]=a.useState(!1),r=a.useRef(null),l=a.useRef(null),{alt:u,align:x}=n,f=s==null?void 0:s.options.upload,b=()=>{(async()=>{const d=document.querySelector("#easydrawer");d&&(r.current=new R.Editor(d,{wheelEventsEnabled:!1,disableZoom:!0}),l.current=R.makeDropdownToolbar(r.current),l.current.addDefaultToolWidgets(),r.current.loadFromSVG(decodeURIComponent(u)))})()};a.useEffect(()=>{c&&setTimeout(()=>{b()},200)},[c]);const p=async()=>{if(r.current){const m=r.current.toSVG(),d=m.outerHTML,h=`drawer-${E.shortId()}.svg`;let P=E.i(m.outerHTML);if(f){const U=o.dataURLtoFile(P,h);P=await f(U)}e==null||e.chain().focus().setDrawer({type:"drawer",src:P,alt:encodeURIComponent(d),width:426,height:212},!!d).run(),e==null||e.commands.setAlignImageDrawer(x)}i(!1)},g=m=>{const d=r.current.toolController.getPrimaryTools()[2],h=l.current.getWidgetById("pen-1");d&&h&&(d.setColor(m),h.serializeState())},y=m=>{const d=r.current.toolController.getPrimaryTools()[2],h=l.current.getWidgetById("pen-1");d&&h&&(d.setThickness(m),h.serializeState())},S=m=>{const d=r.current.toolController.getPrimaryTools()[3],h=l.current.getWidgetById("pen-2");d&&h&&(d.setColor(m),h.serializeState())},D=m=>{const d=l.current.getWidgetById("shape");d&&d.setShapeType(m)},T=m=>{const d=r.current.toolController.getPrimaryTools()[5],h=l.current.getWidgetById("shape");d&&h&&(d.setColor(m),h.serializeState())},N=m=>{const d=r.current.toolController.getPrimaryTools()[5],h=l.current.getWidgetById("shape");d&&h&&(d.setThickness(m),h.serializeState())},A=m=>{const d=r.current.toolController.getPrimaryTools()[5],h=l.current.getWidgetById("shape");d&&h&&(d.setBorderColor(m),h.serializeState())},w=()=>{if(C){for(;r.current.history.redoStackSize>0;)r.current.history.redo();C=!1;return}r.current.history.undo()},j=()=>{C||r.current.history.redo()},z=()=>{if(!C){for(;r.current.history.undoStackSize>0;)w();C=!0}};return t.jsxs(o.Dialog,{onOpenChange:i,open:c,children:[t.jsx(o.DialogTrigger,{asChild:!0,children:t.jsx(o.ActionButton,{action:()=>i(!0),icon:"Pencil",tooltip:"Edit Drawer"})}),t.jsxs(o.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[t.jsx(o.DialogTitle,{children:"Edit Drawer"}),t.jsxs("div",{style:{height:"100%",borderWidth:1,background:"white",position:"relative"},children:[t.jsx("div",{className:"richtext-size-full",id:"easydrawer"}),t.jsx(O.ControlDrawer,{changeBorderColorShape:A,changeColorShape:T,changeShape:D,onClear:z,onRedo:j,onThicknessChange:N,onUndo:w,refEditor:r,setColorHighlight:S,setColorPen:g,setThicknessPen:y})]}),t.jsx(o.DialogFooter,{children:t.jsx(o.Button,{onClick:p,type:"button",children:"Save changes"})})]})]})}const de={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function ue({item:e,disabled:n,editor:s}){var i;const c=e.component;return c?t.jsx(a.Fragment,{children:e.type==="divider"?t.jsx(o.Separator,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}):t.jsx(c,{...e.componentProps,disabled:n||((i=e==null?void 0:e.componentProps)==null?void 0:i.disabled),editor:s})}):t.jsx(t.Fragment,{})}function he(e){return e.type.name==="drawer"}function xe(e){const{lang:n}=I.useLocale(),s=o.useAttributes(e.editor,O.Drawer.name),c=K(e.editor,O.Drawer.name),i=({editor:l})=>{const{selection:u}=l.view.state,{$from:x,to:f}=u;let b=!1;return l.view.state.doc.nodesBetween(x.pos,f,p=>{if(he(p))return b=!0,!1}),b},r=a.useMemo(()=>e.disabled?[]:o.getBubbleDrawer(e.editor),[e.disabled,e.editor,n]);return t.jsx(t.Fragment,{children:t.jsx(k.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:i,tippyOptions:de,children:r!=null&&r.length?t.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:t.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:r==null?void 0:r.map((l,u)=>l.type==="edit"&&(s!=null&&s.src)?t.jsx(le,{attrs:s,editor:e.editor,extension:c},`bubbleMenu-drawer-${u}`):t.jsx(ue,{disabled:e.disabled,editor:e.editor,item:l},`bubbleMenu-drawer-${u}`))})}):t.jsx(t.Fragment,{})})})}exports.BubbleMenuDrawer=xe;exports.BubbleMenuExcalidraw=oe;exports.BubbleMenuKatex=ce;exports.BubbleMenuMermaid=ie;exports.BubbleMenuTwitter=ae;
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/react';
|
|
2
|
+
import { JSX } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
export declare function BubbleMenuDrawer(props: IPropsBubbleMenu_2): JSX.Element;
|
|
5
|
+
|
|
6
|
+
export declare function BubbleMenuExcalidraw({ editor }: any): JSX.Element;
|
|
7
|
+
|
|
8
|
+
export declare function BubbleMenuKatex({ editor, ...props }: any): JSX.Element;
|
|
9
|
+
|
|
10
|
+
export declare function BubbleMenuMermaid(props: IPropsBubbleMenu): JSX.Element;
|
|
11
|
+
|
|
12
|
+
export declare function BubbleMenuTwitter({ editor, disabled }: BubbleMenuTwitterProps): JSX.Element;
|
|
13
|
+
|
|
14
|
+
export declare interface BubbleMenuTwitterProps {
|
|
15
|
+
editor: Editor;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare interface IPropsBubbleMenu {
|
|
20
|
+
editor: Editor;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare interface IPropsBubbleMenu_2 {
|
|
25
|
+
editor: Editor;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { }
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
declare module '@tiptap/core' {
|
|
33
|
+
interface Commands<ReturnType> {
|
|
34
|
+
attachment: {
|
|
35
|
+
setAttachment: (attrs?: unknown) => ReturnType;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
declare module '@tiptap/core' {
|
|
42
|
+
interface Commands<ReturnType> {
|
|
43
|
+
setCodeBlock: {
|
|
44
|
+
setCodeBlock: (options?: any) => ReturnType;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
declare module '@tiptap/core' {
|
|
51
|
+
interface Commands<ReturnType> {
|
|
52
|
+
drawer: {
|
|
53
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
54
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
declare module '@tiptap/core' {
|
|
61
|
+
interface Commands<ReturnType> {
|
|
62
|
+
emoji: {
|
|
63
|
+
setEmoji: (emoji: {
|
|
64
|
+
name: string;
|
|
65
|
+
emoji: string;
|
|
66
|
+
}) => ReturnType;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
declare module '@tiptap/core' {
|
|
73
|
+
interface Commands<ReturnType> {
|
|
74
|
+
excalidraw: {
|
|
75
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
declare module '@tiptap/core' {
|
|
82
|
+
interface Commands<ReturnType> {
|
|
83
|
+
exportWord: {
|
|
84
|
+
exportToWord: () => ReturnType;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
declare module '@tiptap/core' {
|
|
91
|
+
interface Commands<ReturnType> {
|
|
92
|
+
fontSize: {
|
|
93
|
+
/**
|
|
94
|
+
* Set the text font size. ex: "12px", "2em", or "small". Must be a valid
|
|
95
|
+
* CSS font-size
|
|
96
|
+
* (https://developer.mozilla.org/en-US/docs/Web/CSS/font-size).
|
|
97
|
+
*/
|
|
98
|
+
setFontSize: (fontSize: string) => ReturnType;
|
|
99
|
+
/**
|
|
100
|
+
* Unset the font size
|
|
101
|
+
*/
|
|
102
|
+
unsetFontSize: () => ReturnType;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
declare module '@tiptap/core' {
|
|
109
|
+
interface Commands<ReturnType> {
|
|
110
|
+
painter: {
|
|
111
|
+
setPainter: (marks: Mark[]) => ReturnType;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
declare module '@tiptap/core' {
|
|
118
|
+
interface Commands<ReturnType> {
|
|
119
|
+
iframe: {
|
|
120
|
+
/**
|
|
121
|
+
* Add an iframe
|
|
122
|
+
*/
|
|
123
|
+
setIframe: (options: {
|
|
124
|
+
src: string;
|
|
125
|
+
service: string;
|
|
126
|
+
}) => ReturnType;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
declare module '@tiptap/core' {
|
|
133
|
+
interface Commands<ReturnType> {
|
|
134
|
+
imageUpload: {
|
|
135
|
+
/**
|
|
136
|
+
* Add an image
|
|
137
|
+
*/
|
|
138
|
+
setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
139
|
+
/**
|
|
140
|
+
* Update an image
|
|
141
|
+
*/
|
|
142
|
+
updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
143
|
+
/**
|
|
144
|
+
* Set image alignment
|
|
145
|
+
*/
|
|
146
|
+
setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
declare module '@tiptap/core' {
|
|
153
|
+
interface Commands<ReturnType> {
|
|
154
|
+
imageGifUpload: {
|
|
155
|
+
/**
|
|
156
|
+
* Add an image gif
|
|
157
|
+
*/
|
|
158
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
159
|
+
/**
|
|
160
|
+
* Update an image gif
|
|
161
|
+
*/
|
|
162
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
163
|
+
/**
|
|
164
|
+
* Set image alignment
|
|
165
|
+
*/
|
|
166
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
declare module '@tiptap/core' {
|
|
173
|
+
interface Commands<ReturnType> {
|
|
174
|
+
indent: {
|
|
175
|
+
/**
|
|
176
|
+
* Set the indent attribute
|
|
177
|
+
*/
|
|
178
|
+
indent: () => ReturnType;
|
|
179
|
+
/**
|
|
180
|
+
* Set the outdent attribute
|
|
181
|
+
*/
|
|
182
|
+
outdent: () => ReturnType;
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
declare module '@tiptap/core' {
|
|
189
|
+
interface Commands<ReturnType> {
|
|
190
|
+
katex: {
|
|
191
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
declare module '@tiptap/core' {
|
|
198
|
+
interface Commands<ReturnType> {
|
|
199
|
+
lineHeight: {
|
|
200
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
201
|
+
unsetLineHeight: () => ReturnType;
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
declare module '@tiptap/core' {
|
|
208
|
+
interface Commands<ReturnType> {
|
|
209
|
+
mermaid: {
|
|
210
|
+
setMermaid: (options: any, replace?: any) => ReturnType;
|
|
211
|
+
setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
declare module '@tiptap/core' {
|
|
218
|
+
interface Commands<ReturnType> {
|
|
219
|
+
columns: {
|
|
220
|
+
insertColumns: (attrs?: {
|
|
221
|
+
cols: number;
|
|
222
|
+
}) => ReturnType;
|
|
223
|
+
addColBefore: () => ReturnType;
|
|
224
|
+
addColAfter: () => ReturnType;
|
|
225
|
+
deleteCol: () => ReturnType;
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
declare module '@tiptap/core' {
|
|
232
|
+
interface Commands<ReturnType> {
|
|
233
|
+
search: {
|
|
234
|
+
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
235
|
+
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
236
|
+
replace: () => ReturnType;
|
|
237
|
+
replaceAll: () => ReturnType;
|
|
238
|
+
goToPrevSearchResult: () => void;
|
|
239
|
+
goToNextSearchResult: () => void;
|
|
240
|
+
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
declare module '@tiptap/core' {
|
|
247
|
+
interface Commands<ReturnType> {
|
|
248
|
+
tableOfContents: {
|
|
249
|
+
setTableOfContents: () => ReturnType;
|
|
250
|
+
removeTableOfContents: () => ReturnType;
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
declare module '@tiptap/core' {
|
|
257
|
+
interface Commands<ReturnType> {
|
|
258
|
+
twitter: {
|
|
259
|
+
/**
|
|
260
|
+
* Insert a tweet
|
|
261
|
+
* @param options The tweet attributes
|
|
262
|
+
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
263
|
+
*/
|
|
264
|
+
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
265
|
+
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
declare module '@tiptap/core' {
|
|
272
|
+
interface Commands<ReturnType> {
|
|
273
|
+
video: {
|
|
274
|
+
/**
|
|
275
|
+
* Add an video
|
|
276
|
+
*/
|
|
277
|
+
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
278
|
+
/**
|
|
279
|
+
* Update an video
|
|
280
|
+
*/
|
|
281
|
+
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
declare module '@tiptap/core' {
|
|
288
|
+
interface Commands<ReturnType> {
|
|
289
|
+
tableCellBackground: {
|
|
290
|
+
setTableCellBackground: (color: string) => ReturnType;
|
|
291
|
+
unsetTableCellBackground: () => ReturnType;
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
}
|