@pixerate/editor 0.23.0 → 0.25.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.
Files changed (187) hide show
  1. package/README.md +167 -2
  2. package/THIRD_PARTY_NOTICES.md +80 -0
  3. package/dist/agent/index.cjs +10 -8
  4. package/dist/agent/index.cjs.map +1 -1
  5. package/dist/agent/index.d.cts +4 -3
  6. package/dist/agent/index.d.ts +4 -3
  7. package/dist/agent/index.js +4 -2
  8. package/dist/agent/index.js.map +1 -1
  9. package/dist/canvas/index.cjs +4437 -411
  10. package/dist/canvas/index.cjs.map +1 -1
  11. package/dist/canvas/index.d.cts +934 -4
  12. package/dist/canvas/index.d.ts +934 -4
  13. package/dist/canvas/index.js +4309 -283
  14. package/dist/canvas/index.js.map +1 -1
  15. package/dist/chunk-4BVP64JJ.cjs +1406 -0
  16. package/dist/chunk-4BVP64JJ.cjs.map +1 -0
  17. package/dist/chunk-664LQYFJ.js +115 -0
  18. package/dist/chunk-664LQYFJ.js.map +1 -0
  19. package/dist/chunk-7WISYZFO.cjs +740 -0
  20. package/dist/chunk-7WISYZFO.cjs.map +1 -0
  21. package/dist/chunk-AL6JMGWW.cjs +783 -0
  22. package/dist/chunk-AL6JMGWW.cjs.map +1 -0
  23. package/dist/chunk-BVP3TSLH.cjs +69 -0
  24. package/dist/chunk-BVP3TSLH.cjs.map +1 -0
  25. package/dist/{chunk-RIKBJLS2.cjs → chunk-C7P22VIP.cjs} +2001 -279
  26. package/dist/chunk-C7P22VIP.cjs.map +1 -0
  27. package/dist/chunk-D6FH2YAX.cjs +131 -0
  28. package/dist/chunk-D6FH2YAX.cjs.map +1 -0
  29. package/dist/chunk-ECCCYKGL.js +740 -0
  30. package/dist/chunk-ECCCYKGL.js.map +1 -0
  31. package/dist/{chunk-4SUNJZWB.cjs → chunk-FD4LPFAE.cjs} +48 -200
  32. package/dist/chunk-FD4LPFAE.cjs.map +1 -0
  33. package/dist/{chunk-QBJ22YZR.js → chunk-FH6F67DN.js} +1999 -277
  34. package/dist/chunk-FH6F67DN.js.map +1 -0
  35. package/dist/{chunk-OYXSKQFR.js → chunk-FPENXAEJ.js} +35 -187
  36. package/dist/chunk-FPENXAEJ.js.map +1 -0
  37. package/dist/chunk-HLIMTC6N.js +1 -0
  38. package/dist/chunk-HLIMTC6N.js.map +1 -0
  39. package/dist/chunk-HRMEDT2L.js +1406 -0
  40. package/dist/chunk-HRMEDT2L.js.map +1 -0
  41. package/dist/{chunk-QGHGJ56O.js → chunk-IXHSYOVY.js} +2518 -122
  42. package/dist/chunk-IXHSYOVY.js.map +1 -0
  43. package/dist/chunk-MKA3AHLV.cjs +256 -0
  44. package/dist/chunk-MKA3AHLV.cjs.map +1 -0
  45. package/dist/chunk-NAXVVS5I.js +783 -0
  46. package/dist/chunk-NAXVVS5I.js.map +1 -0
  47. package/dist/chunk-O5RYH2PG.js +69 -0
  48. package/dist/chunk-O5RYH2PG.js.map +1 -0
  49. package/dist/chunk-OXSV64JX.js +689 -0
  50. package/dist/chunk-OXSV64JX.js.map +1 -0
  51. package/dist/chunk-P3RQ5UJE.cjs +689 -0
  52. package/dist/chunk-P3RQ5UJE.cjs.map +1 -0
  53. package/dist/chunk-P6ODPZ4W.js +256 -0
  54. package/dist/chunk-P6ODPZ4W.js.map +1 -0
  55. package/dist/chunk-PL4JB3BF.cjs +1 -0
  56. package/dist/chunk-PL4JB3BF.cjs.map +1 -0
  57. package/dist/{chunk-GVSMRPHB.cjs → chunk-PO6A6QQH.cjs} +2607 -211
  58. package/dist/chunk-PO6A6QQH.cjs.map +1 -0
  59. package/dist/{chunk-JJDLPEWL.js → chunk-QGYDWPRM.js} +2 -2
  60. package/dist/chunk-RR7F5GUM.js +5726 -0
  61. package/dist/chunk-RR7F5GUM.js.map +1 -0
  62. package/dist/chunk-TNNJXF46.cjs +115 -0
  63. package/dist/chunk-TNNJXF46.cjs.map +1 -0
  64. package/dist/chunk-U5HZSFCS.js +131 -0
  65. package/dist/chunk-U5HZSFCS.js.map +1 -0
  66. package/dist/{chunk-MJZBNWG7.js → chunk-UAKDG62Z.js} +309 -581
  67. package/dist/chunk-UAKDG62Z.js.map +1 -0
  68. package/dist/{chunk-CL37JGFW.cjs → chunk-V3CHHWOE.cjs} +4 -4
  69. package/dist/{chunk-CL37JGFW.cjs.map → chunk-V3CHHWOE.cjs.map} +1 -1
  70. package/dist/chunk-WSQKHXW7.cjs +5726 -0
  71. package/dist/chunk-WSQKHXW7.cjs.map +1 -0
  72. package/dist/{chunk-AA4ZEVCC.cjs → chunk-X4N4WUKB.cjs} +336 -608
  73. package/dist/chunk-X4N4WUKB.cjs.map +1 -0
  74. package/dist/commands/index.cjs +74 -1
  75. package/dist/commands/index.cjs.map +1 -1
  76. package/dist/commands/index.d.cts +38 -353
  77. package/dist/commands/index.d.ts +38 -353
  78. package/dist/commands/index.js +73 -0
  79. package/dist/commands/index.js.map +1 -1
  80. package/dist/comment-store-BEMgVlAA.d.cts +135 -0
  81. package/dist/comment-store-BEMgVlAA.d.ts +135 -0
  82. package/dist/compare/index.cjs +15 -0
  83. package/dist/compare/index.cjs.map +1 -0
  84. package/dist/compare/index.d.cts +58 -0
  85. package/dist/compare/index.d.ts +58 -0
  86. package/dist/compare/index.js +15 -0
  87. package/dist/compare/index.js.map +1 -0
  88. package/dist/controller-BIJiNoVs.d.cts +1842 -0
  89. package/dist/controller-BIJiNoVs.d.ts +1842 -0
  90. package/dist/documents-CHT1U5Vs.d.ts +86 -0
  91. package/dist/documents-Gp7wb0Me.d.cts +86 -0
  92. package/dist/extensions/index.cjs +100 -5
  93. package/dist/extensions/index.cjs.map +1 -1
  94. package/dist/extensions/index.d.cts +16 -4
  95. package/dist/extensions/index.d.ts +16 -4
  96. package/dist/extensions/index.js +100 -5
  97. package/dist/generation/index.cjs +2317 -0
  98. package/dist/generation/index.cjs.map +1 -0
  99. package/dist/generation/index.d.cts +1015 -0
  100. package/dist/generation/index.d.ts +1015 -0
  101. package/dist/generation/index.js +2317 -0
  102. package/dist/generation/index.js.map +1 -0
  103. package/dist/grammar/index.cjs +48 -3
  104. package/dist/grammar/index.cjs.map +1 -1
  105. package/dist/grammar/index.d.cts +322 -100
  106. package/dist/grammar/index.d.ts +322 -100
  107. package/dist/grammar/index.js +54 -9
  108. package/dist/image-editor/index.cjs +4392 -481
  109. package/dist/image-editor/index.cjs.map +1 -1
  110. package/dist/image-editor/index.d.cts +1249 -97
  111. package/dist/image-editor/index.d.ts +1249 -97
  112. package/dist/image-editor/index.js +4281 -370
  113. package/dist/image-editor/index.js.map +1 -1
  114. package/dist/index-7a6bHTLy.d.ts +1754 -0
  115. package/dist/index-Csd5qI8u.d.cts +1754 -0
  116. package/dist/index.cjs +1682 -99
  117. package/dist/index.cjs.map +1 -1
  118. package/dist/index.d.cts +118 -21
  119. package/dist/index.d.ts +118 -21
  120. package/dist/index.js +1630 -47
  121. package/dist/index.js.map +1 -1
  122. package/dist/mention-text-CDnCFd3c.d.cts +53 -0
  123. package/dist/mention-text-CDnCFd3c.d.ts +53 -0
  124. package/dist/migrate-iTlm3a8h.d.cts +112 -0
  125. package/dist/migrate-iTlm3a8h.d.ts +112 -0
  126. package/dist/model-C1zApQM8.d.cts +219 -0
  127. package/dist/model-C1zApQM8.d.ts +219 -0
  128. package/dist/persistence/index.cjs +676 -0
  129. package/dist/persistence/index.cjs.map +1 -0
  130. package/dist/persistence/index.d.cts +230 -0
  131. package/dist/persistence/index.d.ts +230 -0
  132. package/dist/persistence/index.js +676 -0
  133. package/dist/persistence/index.js.map +1 -0
  134. package/dist/{registry-D5-R90p0.d.cts → registry-BDe-vlv3.d.ts} +2 -40
  135. package/dist/{registry-GJI4gToU.d.ts → registry-CEgwXED1.d.cts} +12 -1
  136. package/dist/{registry-GJI4gToU.d.cts → registry-CEgwXED1.d.ts} +12 -1
  137. package/dist/registry-D32LpIc4.d.cts +354 -0
  138. package/dist/{registry-D5-R90p0.d.ts → registry-DnzpgY27.d.cts} +2 -40
  139. package/dist/registry-evKTP4ls.d.ts +354 -0
  140. package/dist/schema-DYDGdYL9.d.cts +41 -0
  141. package/dist/schema-DYDGdYL9.d.ts +41 -0
  142. package/dist/serializers/index.cjs +12 -3
  143. package/dist/serializers/index.cjs.map +1 -1
  144. package/dist/serializers/index.d.cts +40 -12
  145. package/dist/serializers/index.d.ts +40 -12
  146. package/dist/serializers/index.js +12 -3
  147. package/dist/sourcemap-C8AH3MBQ.d.cts +91 -0
  148. package/dist/sourcemap-DA1Evhrv.d.ts +91 -0
  149. package/dist/spreadsheet/index.cjs +161 -3
  150. package/dist/spreadsheet/index.cjs.map +1 -1
  151. package/dist/spreadsheet/index.d.cts +611 -20
  152. package/dist/spreadsheet/index.d.ts +611 -20
  153. package/dist/spreadsheet/index.js +168 -10
  154. package/dist/storage-BpFfspHm.d.cts +120 -0
  155. package/dist/storage-BpFfspHm.d.ts +120 -0
  156. package/dist/tokens/index.cjs +115 -0
  157. package/dist/tokens/index.cjs.map +1 -0
  158. package/dist/tokens/index.d.cts +212 -0
  159. package/dist/tokens/index.d.ts +212 -0
  160. package/dist/tokens/index.js +115 -0
  161. package/dist/tokens/index.js.map +1 -0
  162. package/dist/{tokens-CyLZmIei.d.cts → tokens-D7yXvUU6.d.cts} +15 -2
  163. package/dist/{tokens-CyLZmIei.d.ts → tokens-D7yXvUU6.d.ts} +15 -2
  164. package/dist/{track-changes-BSF58RK0.d.cts → track-changes-D_VAPELi.d.cts} +110 -144
  165. package/dist/{track-changes-BSF58RK0.d.ts → track-changes-Db_fGEvx.d.ts} +110 -144
  166. package/package.json +21 -1
  167. package/dist/chunk-4SUNJZWB.cjs.map +0 -1
  168. package/dist/chunk-AA4ZEVCC.cjs.map +0 -1
  169. package/dist/chunk-AXV2ZW34.cjs +0 -118
  170. package/dist/chunk-AXV2ZW34.cjs.map +0 -1
  171. package/dist/chunk-B2ZRLN4S.js +0 -118
  172. package/dist/chunk-B2ZRLN4S.js.map +0 -1
  173. package/dist/chunk-GVSMRPHB.cjs.map +0 -1
  174. package/dist/chunk-K3R5NG2D.js +0 -3100
  175. package/dist/chunk-K3R5NG2D.js.map +0 -1
  176. package/dist/chunk-MJZBNWG7.js.map +0 -1
  177. package/dist/chunk-OYXSKQFR.js.map +0 -1
  178. package/dist/chunk-QBJ22YZR.js.map +0 -1
  179. package/dist/chunk-QGHGJ56O.js.map +0 -1
  180. package/dist/chunk-RIKBJLS2.cjs.map +0 -1
  181. package/dist/chunk-XDMXXC4Z.cjs +0 -3100
  182. package/dist/chunk-XDMXXC4Z.cjs.map +0 -1
  183. package/dist/controller-pePCJLT1.d.cts +0 -959
  184. package/dist/controller-pePCJLT1.d.ts +0 -959
  185. package/dist/index-CCr_z9kF.d.cts +0 -899
  186. package/dist/index-Ck6ajwXh.d.ts +0 -899
  187. /package/dist/{chunk-JJDLPEWL.js.map → chunk-QGYDWPRM.js.map} +0 -0
@@ -1,899 +0,0 @@
1
- import { Mark, Extension, Node, Editor, Extensions } from '@tiptap/core';
2
- import { C as ColorGradient, f as Template } from './tokens-CyLZmIei.cjs';
3
- import { EditorState, PluginKey, Transaction } from '@tiptap/pm/state';
4
- import { DecorationSet, EditorView } from '@tiptap/pm/view';
5
- import { Node as Node$1 } from '@tiptap/pm/model';
6
- import { R as ReviewAuthor, b as CommentStore, C as CommentAnchor, i as MentionOptions, k as TrackChangesOptions } from './track-changes-BSF58RK0.cjs';
7
- import { MarkdownOptions } from 'tiptap-markdown';
8
- import { ImageOptions as ImageOptions$1 } from '@tiptap/extension-image';
9
- import { c as ImportAdapter, I as ImportAdapterRegistry, b as FindImportAdapterQuery, i as ImportTarget, h as ImportInput, g as ImportFileOptions, a as ImportOutcome, R as RegisterImportAdapterOptions, F as FileLike } from './registry-GJI4gToU.cjs';
10
-
11
- interface GradientTextOptions {
12
- templateColorMap: Map<string, ColorGradient>;
13
- speed?: number;
14
- jsonVariables?: string[] | Set<string>;
15
- onTemplateClick?: (templateName: string, event: MouseEvent) => void;
16
- }
17
- declare const GradientText: Mark<GradientTextOptions, any>;
18
-
19
- interface SlashCommandMatchData {
20
- match: RegExpMatchArray;
21
- query: string;
22
- from: number;
23
- to: number;
24
- coords: {
25
- top: number;
26
- left: number;
27
- bottom: number;
28
- right: number;
29
- };
30
- }
31
- interface SlashCommandsOptions {
32
- trigger?: string;
33
- onMatch?: (data: SlashCommandMatchData) => void;
34
- onClear?: () => void;
35
- containerId?: string;
36
- }
37
- declare const SlashCommands: Extension<SlashCommandsOptions, any>;
38
-
39
- interface TemplateSuggestionsOptions {
40
- templates: Template[];
41
- char?: string;
42
- onSuggestion?: (props: {
43
- query: string;
44
- range: {
45
- from: number;
46
- to: number;
47
- };
48
- clientRect?: (() => DOMRect | null) | null;
49
- items: Template[];
50
- command: (props: {
51
- name: string;
52
- }) => void;
53
- }) => void;
54
- }
55
- declare const TemplateSuggestions: Extension<TemplateSuggestionsOptions, any>;
56
-
57
- declare const LoadingNode: Node<any, any>;
58
-
59
- /**
60
- * Context passed to function replacements.
61
- */
62
- interface AutocorrectContext {
63
- /** Text of the current block before the caret, including the typed text. */
64
- textBefore: string;
65
- /** Returns true if `text` is in the exceptions list (case-insensitive). */
66
- isException: (text: string) => boolean;
67
- /** Editor state before the typed text was inserted. */
68
- state: EditorState;
69
- }
70
- /**
71
- * An autocorrect rule. Rules are checked in order after every typed character
72
- * against the text before the caret; the first one that produces a
73
- * replacement wins.
74
- *
75
- * - `find: string` matches when the text before the caret ends with it.
76
- * With `wholeWord: true` it must also be a whole word followed by a space or
77
- * punctuation (Word's AutoCorrect entries, e.g. `teh ` -> `the `); the
78
- * delimiter is kept.
79
- * - `find: RegExp` must match at the end of the text (anchor it with `$`).
80
- *
81
- * `replace` replaces the whole match. A string is inserted literally (no `$1`
82
- * patterns); use a function to reuse capture groups. Return `null` from a
83
- * function to skip the correction.
84
- */
85
- interface AutocorrectRule {
86
- id: string;
87
- find: string | RegExp;
88
- replace: string | ((match: RegExpMatchArray, context: AutocorrectContext) => string | null | undefined);
89
- wholeWord?: boolean;
90
- }
91
- /**
92
- * A correction that was applied.
93
- */
94
- interface AutocorrectCorrection {
95
- ruleId: string;
96
- /** Document range of the replacement text after the correction. */
97
- from: number;
98
- to: number;
99
- original: string;
100
- replacement: string;
101
- }
102
- interface AutocorrectOptions {
103
- /** Rules in priority order. Defaults to `defaultAutocorrectRules`. */
104
- rules: AutocorrectRule[];
105
- /**
106
- * Exceptions (Word's AutoCorrect exceptions). Matched case-insensitively.
107
- * - Abbreviations ending in `.` (e.g. `e.g.`) do not end a sentence, so the
108
- * next word is not capitalized.
109
- * - Words like `IDs` are not "fixed" by the two-initial-capitals rule.
110
- * - Any other entry is text that should never be corrected (the matched
111
- * text, e.g. `(c)` or `teh`).
112
- */
113
- exceptions: string[];
114
- /** Node types in which nothing is corrected (plus any node with `code: true`). */
115
- ignoreNodes: string[];
116
- /** Mark types in which nothing is corrected (plus any mark with `code: true`). */
117
- ignoreMarks: string[];
118
- /** Skip corrections inside `{{template}}`, `{variable}` and `__instruction__` tokens. */
119
- ignorePromptTokens: boolean;
120
- /** Called after each correction. */
121
- onCorrection?: (correction: AutocorrectCorrection) => void;
122
- }
123
- interface AutocorrectStorage {
124
- /** Whether corrections are applied. Toggle with `setAutocorrectEnabled`. */
125
- enabled: boolean;
126
- /** Live exceptions set (lowercased). Edit with the exception commands. */
127
- exceptions: Set<string>;
128
- }
129
- declare module "@tiptap/core" {
130
- interface Commands<ReturnType> {
131
- autocorrect: {
132
- /** Reverts the last correction if nothing else has changed since. */
133
- undoAutocorrect: () => ReturnType;
134
- /** Enables or disables autocorrect. */
135
- setAutocorrectEnabled: (enabled: boolean) => ReturnType;
136
- /** Adds an entry to the exceptions list. */
137
- addAutocorrectException: (text: string) => ReturnType;
138
- /** Removes an entry from the exceptions list. */
139
- removeAutocorrectException: (text: string) => ReturnType;
140
- };
141
- }
142
- }
143
- /** Smart (curly) quotes and apostrophes. */
144
- declare const smartQuoteRules: AutocorrectRule[];
145
- /** Symbols: em dash, ellipsis, arrows, copyright, registered, trademark. */
146
- declare const symbolRules: AutocorrectRule[];
147
- /** Fractions (`1/2`, `1/4`, `3/4`), corrected once the number is complete. */
148
- declare const fractionRules: AutocorrectRule[];
149
- /**
150
- * Capitalizes the first letter of a sentence when the word is completed.
151
- * Abbreviations in the exceptions list (and single-letter initials such as
152
- * `J.`) do not end a sentence.
153
- */
154
- declare const capitalizeSentenceRules: AutocorrectRule[];
155
- /** Fixes TWo INitial CApitals (`THe ` -> `The `), unless the word is an exception. */
156
- declare const twoInitialCapitalsRules: AutocorrectRule[];
157
- /**
158
- * The default rule set: smart quotes, symbols, fractions, sentence
159
- * capitalization and two-initial-capitals.
160
- */
161
- declare const defaultAutocorrectRules: AutocorrectRule[];
162
- /** Default exceptions: common abbreviations and two-capital words. */
163
- declare const DEFAULT_AUTOCORRECT_EXCEPTIONS: string[];
164
- declare const autocorrectPluginKey: PluginKey<AutocorrectPluginState>;
165
- interface AutocorrectPluginState {
166
- last: AutocorrectCorrection | null;
167
- /** The next typed text should start a new undo group. */
168
- closePending: boolean;
169
- }
170
- /**
171
- * Finds the first matching rule for `textBefore`. Exported for testing and for
172
- * custom input pipelines.
173
- */
174
- declare function findAutocorrection(textBefore: string, rules: readonly AutocorrectRule[], context: Omit<AutocorrectContext, "textBefore">): {
175
- ruleId: string;
176
- start: number;
177
- original: string;
178
- replacement: string;
179
- } | null;
180
- /**
181
- * True when the end of `textBefore` is inside an unclosed prompt token:
182
- * `{{template`, `{variable` or `__instruction`.
183
- */
184
- declare function isInsidePromptToken(textBefore: string): boolean;
185
- /**
186
- * Word-style AutoCorrect with a configurable rule registry and exceptions
187
- * list. Each correction is its own undo step: undo (Mod-z) right after a
188
- * correction restores exactly what was typed. Corrections never apply inside
189
- * code blocks, inline code or (by default) prompt tokens.
190
- *
191
- * Do not combine with `@tiptap/extension-typography`: TipTap's input rules
192
- * run first and would pre-empt the overlapping rules. `createRichTextPreset`
193
- * drops Typography when `autocorrect` is enabled.
194
- */
195
- declare const Autocorrect: Extension<AutocorrectOptions, AutocorrectStorage>;
196
-
197
- /**
198
- * Smilie patterns (each ending in a typed space) and their replacements.
199
- * Longer patterns come first so they win over their prefixes.
200
- */
201
- declare const SMILIE_REPLACEMENTS: ReadonlyArray<readonly [RegExp, string]>;
202
- /**
203
- * The smilies as `Autocorrect` rules. Straight apostrophes in the patterns
204
- * also match curly `‘` and `’`, because the smart-quote rule converts `'` as soon as
205
- * it is typed.
206
- */
207
- declare const smilieAutocorrectRules: AutocorrectRule[];
208
- declare const SmilieReplacer: Extension<any, any>;
209
-
210
- declare function findHexColors(doc: Node$1): DecorationSet;
211
- declare const ColorHighlighter: Extension<any, any>;
212
-
213
- declare module "@tiptap/core" {
214
- interface Commands<ReturnType> {
215
- fontSize: {
216
- setFontSize: (size: string) => ReturnType;
217
- unsetFontSize: () => ReturnType;
218
- };
219
- }
220
- }
221
- declare const FontSize: Extension<any, any>;
222
-
223
- /**
224
- * Built-in native Markdown extension for @pixerate/editor based on tiptap-markdown.
225
- * Enables automatic markdown parsing, serialization, and clipboard handling.
226
- */
227
- declare const Markdown: any;
228
-
229
- interface ImageOptions extends Partial<ImageOptions$1> {
230
- /**
231
- * Custom upload handler called when an image is pasted or dropped.
232
- * Resolves to the uploaded image URL string.
233
- */
234
- upload?: (file: File) => Promise<string> | string;
235
- /**
236
- * Callback invoked if the upload handler throws or rejects, or if an image
237
- * exceeds maxBase64Size when no upload handler is configured.
238
- */
239
- onUploadError?: (error: Error, file: File) => void;
240
- /**
241
- * Maximum allowed file size (in bytes) when embedding images as base64 data URLs
242
- * without an upload handler. Defaults to 65536 (64 KB).
243
- * Files larger than this will be rejected to avoid memory bloat and prompt/stream saturation.
244
- */
245
- maxBase64Size?: number;
246
- /**
247
- * Whether to enable automatic image pasting from clipboard. Defaults to true.
248
- */
249
- enablePaste?: boolean;
250
- /**
251
- * Whether to enable automatic image drop. Defaults to true.
252
- */
253
- enableDrop?: boolean;
254
- }
255
- declare const imagePastePluginKey: PluginKey<any>;
256
- /**
257
- * Inserts an image node into the editor view at the current selection.
258
- */
259
- declare function insertImageNode(view: any, src: string, alt?: string): void;
260
- /**
261
- * Updates an existing image node's src attribute across document positions.
262
- */
263
- declare function updateImageSrc(view: any, oldSrc: string, newSrc: string): void;
264
- /**
265
- * Removes an existing image node matching src attribute across document positions.
266
- */
267
- declare function removeImageNode(view: any, src: string): void;
268
- /**
269
- * Handles inserting a pasted or dropped image file, supporting both async upload
270
- * handlers and direct base64/object-URL fallbacks.
271
- */
272
- declare function handleImageInsertion(view: any, file: File, options: ImageOptions): void;
273
- declare const Image: any;
274
-
275
- interface CommentsOptions {
276
- /**
277
- * The store holding the threads. Pass your own to share it with UI or to
278
- * persist it; otherwise one is created and exposed as
279
- * `editor.storage.comment.store`.
280
- */
281
- store: CommentStore | null;
282
- /** The current user, used as author of new comments. */
283
- author: ReviewAuthor | (() => ReviewAuthor);
284
- HTMLAttributes: Record<string, any>;
285
- /** Class for unresolved comment ranges (applied as a decoration). */
286
- commentClass: string;
287
- /** Extra class for the active thread's range. */
288
- activeClass: string;
289
- /** Class for resolved comment ranges. Empty hides them. */
290
- resolvedClass: string;
291
- /** Make the thread under the caret active when the selection moves. */
292
- activateOnSelection: boolean;
293
- }
294
- interface CommentsStorage {
295
- store: CommentStore;
296
- }
297
- interface AddCommentOptions {
298
- body?: string;
299
- id?: string;
300
- author?: ReviewAuthor;
301
- }
302
- interface CommentRange {
303
- from: number;
304
- to: number;
305
- }
306
- declare module "@tiptap/core" {
307
- interface Commands<ReturnType> {
308
- comment: {
309
- /**
310
- * Adds a comment thread on the current (non-empty) selection. The new
311
- * thread becomes active. An empty `body` creates a draft for the UI to
312
- * fill in.
313
- */
314
- addComment: (options?: AddCommentOptions) => ReturnType;
315
- /** Resolves (or re-opens with `false`) a thread. */
316
- resolveComment: (id: string, resolved?: boolean) => ReturnType;
317
- /** Removes the thread's mark from the document and deletes the thread. */
318
- deleteComment: (id: string) => ReturnType;
319
- setActiveComment: (id: string | null) => ReturnType;
320
- /** Selects the thread's text, scrolls to it and makes it active. */
321
- focusComment: (id: string) => ReturnType;
322
- };
323
- }
324
- }
325
- declare const commentsPluginKey: PluginKey<any>;
326
- declare const COMMENT_MARK_NAME = "comment";
327
- /**
328
- * Returns every range covered by a `comment` mark, grouped by thread id and
329
- * merged where contiguous, in document order.
330
- */
331
- declare function findCommentRanges(doc: Node$1): Map<string, CommentRange[]>;
332
- /**
333
- * Computes one anchor per thread (spanning all of its ranges) from the document.
334
- */
335
- declare function getCommentAnchors(doc: Node$1): Map<string, CommentAnchor>;
336
- /** Thread ids of the comment marks at a position (caret or selection start). */
337
- declare function getCommentIdsAt(state: EditorState, pos?: number): string[];
338
- /** Returns the comment store of an editor using the `Comments` extension. */
339
- declare function getCommentStore(editor: Editor | null | undefined): CommentStore | null;
340
- /**
341
- * Comment threads anchored to text with a `comment` mark. Thread content
342
- * (bodies, replies, resolved state) lives in a headless `CommentStore`; the
343
- * document only stores thread ids, so overlapping comments are allowed.
344
- *
345
- * Threads whose text is deleted are flagged `orphaned` (not removed), so
346
- * undoing the deletion re-attaches them.
347
- */
348
- declare const Comments: Mark<CommentsOptions, CommentsStorage>;
349
- /** The current author configured on an editor's `Comments` extension. */
350
- declare function getCommentAuthor(editor: Editor | null | undefined): ReviewAuthor | null;
351
-
352
- /** Result of every `document` adapter: sanitized TipTap HTML plus plain text. */
353
- interface DocumentImport {
354
- /** Sanitized HTML ready for `setContent` / `insertContent`. */
355
- html: string;
356
- /** Plain-text version, used by plain-text (prompt) editors. */
357
- text: string;
358
- }
359
- type DocumentImportAdapter = ImportAdapter<DocumentImport>;
360
- /**
361
- * Markdown files. Rendered with the same sanitizing pipeline as
362
- * `markdownToTipTapHtml`. `.txt` is deliberately left to the plain-text
363
- * adapter so ordinary text files are not reinterpreted as markdown; `.md.txt`
364
- * still matches here because the longest extension wins.
365
- */
366
- declare const markdownImportAdapter: DocumentImportAdapter;
367
- /** HTML files and fragments, sanitized with `sanitizeImportedHtml`. */
368
- declare const htmlImportAdapter: DocumentImportAdapter;
369
- /** Plain text: one paragraph per line, always escaped. */
370
- declare const plainTextImportAdapter: DocumentImportAdapter;
371
- /**
372
- * RTF: best-effort text extraction with `rtfToPlainText` (paragraphs and
373
- * characters only; formatting, tables and images are dropped).
374
- */
375
- declare const rtfImportAdapter: DocumentImportAdapter;
376
- declare const BUILT_IN_IMPORT_ADAPTERS: readonly DocumentImportAdapter[];
377
- interface CreateImportAdapterRegistryOptions {
378
- /** Register the built-in document adapters (default `true`). */
379
- builtIns?: boolean;
380
- }
381
- declare function createImportAdapterRegistry(options?: CreateImportAdapterRegistryOptions): ImportAdapterRegistry;
382
- /** Shared registry used by the module-level helpers and editor integrations. */
383
- declare const defaultImportRegistry: ImportAdapterRegistry;
384
- /** Registers an adapter on the default registry; returns an unregister function. */
385
- declare function registerImportAdapter<TResult>(adapter: ImportAdapter<TResult>, options?: RegisterImportAdapterOptions): () => void;
386
- declare function unregisterImportAdapter(adapterOrId: string | ImportAdapter<any>): boolean;
387
- declare function findImportAdapter(query: FindImportAdapterQuery): ImportAdapter | undefined;
388
- /** Imports a file with the default registry. */
389
- declare function importFile<TResult = unknown>(input: ImportInput, options?: ImportFileOptions): Promise<ImportOutcome<TResult>>;
390
- /** `accept` attribute value for the default registry. */
391
- declare function getImportAccept(target?: ImportTarget): string;
392
-
393
- interface FileImportOptions {
394
- /** Registry used to match files (default: the shared default registry). */
395
- registry?: ImportAdapterRegistry;
396
- /** Insert extracted plain text instead of HTML (plain-text / prompt editors). */
397
- asPlainText?: boolean;
398
- /** Import files dropped onto the editor (default `true`). */
399
- enableDrop?: boolean;
400
- /** Import files pasted into the editor, e.g. copied in a file manager (default `true`). */
401
- enablePaste?: boolean;
402
- /** Called after each imported file has been inserted. */
403
- onImport?: (outcome: ImportOutcome<DocumentImport>, file: FileLike) => void;
404
- /** Called when a file fails to import. */
405
- onImportError?: (error: Error, file: FileLike) => void;
406
- }
407
- declare const fileImportPluginKey: PluginKey<any>;
408
- /**
409
- * Imports files dropped or pasted into the editor through the import adapter
410
- * registry (markdown, HTML, plain text and RTF by default) and inserts the
411
- * converted content at the drop position or selection.
412
- *
413
- * Opt-in: add it to `extensions` or pass `fileImport: true` to
414
- * `createRichTextPreset`. Only drops where every file has a `document`
415
- * adapter are handled; anything else (e.g. images) falls through.
416
- */
417
- declare const FileImport: Extension<FileImportOptions, any>;
418
-
419
- interface RichClipboardOptions {
420
- /** MIME type for the slice JSON (default `application/x.pixerate.document+json`). */
421
- mimeType?: string;
422
- /**
423
- * Never paste the rich payload; leave paste to the existing plain-text
424
- * handling. `EditorController` sets this automatically in `plainTextMode`.
425
- */
426
- plainTextMode?: boolean;
427
- }
428
- interface RichClipboardStorage {
429
- plainTextMode: boolean;
430
- }
431
- declare const richClipboardPluginKey: PluginKey<any>;
432
- /**
433
- * Writes the selection to the clipboard event as HTML, plain text and the
434
- * custom slice JSON. Mirrors ProseMirror's own copy handler (which would
435
- * otherwise clear the extra MIME type) and returns `false` when the event has
436
- * no writable clipboard data, so ProseMirror's handler runs instead.
437
- */
438
- declare function writeRichClipboard(view: EditorView, event: ClipboardEvent, options?: {
439
- cut?: boolean;
440
- mimeType?: string;
441
- }): boolean;
442
- /**
443
- * Internal rich-text clipboard. On copy/cut it also writes the selection as a
444
- * ProseMirror slice under `application/x.pixerate.document+json` together
445
- * with the schema signature; on paste it prefers that payload when the
446
- * signature matches the target editor and otherwise falls back to the normal
447
- * HTML / plain-text handling.
448
- *
449
- * Opt-in: add it to `extensions` or pass `richClipboard: true` to
450
- * `createRichTextPreset`.
451
- */
452
- declare const RichClipboard: Extension<RichClipboardOptions, RichClipboardStorage>;
453
-
454
- /**
455
- * A heading in the document outline, in document order.
456
- */
457
- interface OutlineHeading {
458
- /** Stable id stored on the heading node (`id` attribute). */
459
- id: string;
460
- /** Heading level (1-6). */
461
- level: number;
462
- /** Plain text of the heading. */
463
- text: string;
464
- /** Position of the heading node in the current document. */
465
- pos: number;
466
- /** Index of the heading in the outline. */
467
- index: number;
468
- /**
469
- * Nesting depth (0-based) relative to the enclosing headings, so skipped
470
- * levels (an h1 followed directly by an h3) only indent one step.
471
- */
472
- depth: number;
473
- }
474
- /**
475
- * A heading with its nested sub-headings.
476
- */
477
- interface OutlineTreeItem extends OutlineHeading {
478
- children: OutlineTreeItem[];
479
- }
480
- interface OutlineOptions {
481
- /** Node types treated as headings. Defaults to `["heading"]`. */
482
- types: string[];
483
- /** Generates ids for headings that have none. */
484
- generateId: () => string;
485
- /** Called with the new outline whenever it changes. */
486
- onUpdate?: (headings: OutlineHeading[]) => void;
487
- }
488
- interface OutlineStorage {
489
- /** The latest outline. Prefer `getOutline(editor)` for a fresh read. */
490
- headings: OutlineHeading[];
491
- }
492
- interface FocusHeadingOptions {
493
- /** Scroll behaviour for the heading's DOM node. Defaults to `"smooth"`. */
494
- behavior?: ScrollBehavior;
495
- /** Whether to focus the editor and place the caret in the heading. Defaults to `true`. */
496
- focus?: boolean;
497
- }
498
- declare module "@tiptap/core" {
499
- interface Commands<ReturnType> {
500
- outline: {
501
- /** Places the caret at the start of a heading, focuses and scrolls to it. */
502
- focusHeading: (id: string, options?: FocusHeadingOptions) => ReturnType;
503
- /** Scrolls a heading into view without moving the selection. */
504
- scrollToHeading: (id: string, options?: Omit<FocusHeadingOptions, "focus">) => ReturnType;
505
- };
506
- }
507
- }
508
- declare const outlinePluginKey: PluginKey<OutlineHeading[]>;
509
- /**
510
- * Derives the heading outline from a document. Only block nodes are visited
511
- * (headings cannot nest inside text), so the cost is proportional to the number
512
- * of blocks, not characters.
513
- */
514
- declare function computeOutline(doc: Node$1, types?: readonly string[]): OutlineHeading[];
515
- /**
516
- * Nests a flat outline into a tree by heading level.
517
- */
518
- declare function buildOutlineTree(headings: readonly OutlineHeading[]): OutlineTreeItem[];
519
- /**
520
- * Returns the outline of an editor state. Uses the Outline plugin's cached
521
- * outline when the extension is installed, otherwise computes it.
522
- */
523
- declare function getOutline(editorOrState: Editor | EditorState): OutlineHeading[];
524
- /**
525
- * Returns the heading whose section contains the selection head: the last
526
- * heading starting at or before it.
527
- */
528
- declare function getActiveHeading(editorOrState: Editor | EditorState, headings?: readonly OutlineHeading[]): OutlineHeading | null;
529
- /**
530
- * Snapshot of the outline for UI bindings. Snapshots are immutable and only
531
- * replaced when the outline or the active heading changes, so they can be used
532
- * directly with `useSyncExternalStore` or Svelte state.
533
- */
534
- interface OutlineSnapshot {
535
- headings: OutlineHeading[];
536
- tree: OutlineTreeItem[];
537
- activeId: string | null;
538
- }
539
- interface OutlineStore {
540
- getSnapshot: () => OutlineSnapshot;
541
- subscribe: (listener: () => void) => () => void;
542
- destroy: () => void;
543
- }
544
- /**
545
- * Creates an observable outline store for an editor, shared by the React and
546
- * Svelte outline panels.
547
- */
548
- declare function createOutlineStore(editor: Editor | null | undefined): OutlineStore;
549
- /**
550
- * Moves the caret to the start of a heading, focuses the editor and scrolls the
551
- * heading into view. Works with or without the Outline extension installed.
552
- */
553
- declare function navigateToHeading(editor: Editor, heading: Pick<OutlineHeading, "id" | "pos">, options?: FocusHeadingOptions): boolean;
554
- /**
555
- * Headless document outline. Gives every heading a stable `id` attribute
556
- * (rendered as the HTML `id`, so `#id` links work in exported HTML) and keeps
557
- * an up-to-date outline in plugin state. Read it with `getOutline(editor)` or
558
- * observe it with `createOutlineStore(editor)`.
559
- */
560
- declare const Outline: Extension<OutlineOptions, OutlineStorage>;
561
-
562
- /**
563
- * An entry rendered by a table of contents node.
564
- */
565
- interface TableOfContentsEntry {
566
- id: string | null;
567
- level: number;
568
- text: string;
569
- depth: number;
570
- }
571
- interface TableOfContentsOptions {
572
- HTMLAttributes: Record<string, any>;
573
- /** Heading node types to list. Defaults to `["heading"]`. */
574
- headingTypes: string[];
575
- /** Default title for newly inserted tables of contents. */
576
- defaultTitle: string;
577
- /** Text shown when the document has no headings. */
578
- emptyText: string;
579
- }
580
- interface InsertTableOfContentsOptions {
581
- title?: string;
582
- minLevel?: number;
583
- maxLevel?: number;
584
- }
585
- declare module "@tiptap/core" {
586
- interface Commands<ReturnType> {
587
- tableOfContents: {
588
- /** Inserts a table of contents block at the selection. */
589
- insertTableOfContents: (options?: InsertTableOfContentsOptions) => ReturnType;
590
- };
591
- }
592
- }
593
- declare const tableOfContentsPluginKey: PluginKey<boolean>;
594
- /**
595
- * Builds table of contents entries from an outline, limited to a level range.
596
- * Depth is recomputed within the range so the shallowest listed level is 0.
597
- */
598
- declare function getTableOfContentsEntries(headings: readonly OutlineHeading[], minLevel?: number, maxLevel?: number): TableOfContentsEntry[];
599
- /**
600
- * Table of contents block. An atom node whose entries mirror the document's
601
- * headings; they are refreshed on every document change, so exported HTML
602
- * always contains the current, linked list. Install the `Outline` extension
603
- * alongside it so headings get stable ids to link to.
604
- *
605
- * Markdown: serialized as a `[[toc]]` line and parsed back from `[[toc]]` or
606
- * `[TOC]`.
607
- */
608
- declare const TableOfContents: Node<TableOfContentsOptions, any>;
609
-
610
- /**
611
- * A footnote as listed by `getFootnotes`.
612
- */
613
- interface FootnoteInfo {
614
- id: string;
615
- /** 1-based number, in document order of the references. */
616
- number: number;
617
- /** Plain text of the footnote content (paragraphs joined by blank lines). */
618
- text: string;
619
- /** Position of the reference node. */
620
- referencePos: number;
621
- /** Position of the footnote node in the footnotes list, if present. */
622
- footnotePos: number | null;
623
- }
624
- interface FootnotesOptions {
625
- HTMLAttributes: Record<string, any>;
626
- /** Generates ids for new footnotes. */
627
- generateId: () => string;
628
- }
629
- interface InsertFootnoteOptions {
630
- /** Plain-text content. Blank lines separate paragraphs. */
631
- content?: string;
632
- /** Explicit id; generated when omitted. */
633
- id?: string;
634
- /**
635
- * Move the caret into the new footnote (Word's behaviour). Defaults to `true`
636
- * when no `content` is given.
637
- */
638
- focusContent?: boolean;
639
- }
640
- declare module "@tiptap/core" {
641
- interface Commands<ReturnType> {
642
- footnotes: {
643
- /** Inserts a footnote reference at the selection, plus its footnote. */
644
- insertFootnote: (options?: InsertFootnoteOptions) => ReturnType;
645
- /** Replaces a footnote's content with plain text. */
646
- updateFootnote: (id: string, content: string) => ReturnType;
647
- /** Removes a footnote and its reference. */
648
- deleteFootnote: (id: string) => ReturnType;
649
- /** Moves the caret into a footnote's content. */
650
- goToFootnote: (id: string) => ReturnType;
651
- /** Selects a footnote's reference in the body text. */
652
- goToFootnoteReference: (id: string) => ReturnType;
653
- };
654
- }
655
- }
656
- declare const footnotesPluginKey: PluginKey<boolean>;
657
- /**
658
- * Lists the footnotes of a document in reference order.
659
- */
660
- declare function getFootnotes(doc: Node$1): FootnoteInfo[];
661
- /**
662
- * Brings the footnotes list in line with the references: one footnote per
663
- * reference, in reference order, numbered 1..n, in a single list that is the
664
- * last child of the document. Orphaned footnotes are dropped, missing ones are
665
- * created (empty, or with `contents[id]`), and duplicated references (from
666
- * copy/paste) get a new id with a copy of the original footnote.
667
- *
668
- * Returns true if the transaction was modified.
669
- */
670
- declare function syncFootnotes(tr: Transaction, options?: {
671
- generateId?: () => string;
672
- contents?: Record<string, string>;
673
- }): boolean;
674
- /**
675
- * Inline footnote reference, auto-numbered in document order. Its content
676
- * lives in a `footnote` item of the `footnotes` list at the end of the
677
- * document, which is created, renumbered, reordered and pruned automatically.
678
- *
679
- * Markdown: serialized as `[^n]` with `[^n]: text` definitions, and parsed
680
- * back when the Markdown extension is installed.
681
- */
682
- declare const FootnoteReference: Node<FootnotesOptions, any>;
683
- /**
684
- * The footnotes list at the end of the document. Managed automatically by
685
- * `FootnoteReference`; you rarely create it directly.
686
- */
687
- declare const Footnotes: Node<any, any>;
688
- /**
689
- * A single footnote's content inside the `footnotes` list.
690
- */
691
- declare const Footnote: Node<any, any>;
692
-
693
- /**
694
- * A bookmark as listed by `getBookmarks`.
695
- */
696
- interface BookmarkInfo {
697
- id: string;
698
- name: string;
699
- /** Bookmarked text (all ranges carrying the bookmark, in document order). */
700
- text: string;
701
- /** Start of the first bookmarked range. */
702
- from: number;
703
- /** End of the last bookmarked range. */
704
- to: number;
705
- }
706
- interface BookmarkOptions {
707
- HTMLAttributes: Record<string, any>;
708
- /** Generates ids for new bookmarks. */
709
- generateId: () => string;
710
- }
711
- interface SetBookmarkOptions {
712
- /** Display name. Setting a name that already exists moves that bookmark. */
713
- name: string;
714
- /** Explicit id; generated (or reused from a same-named bookmark) when omitted. */
715
- id?: string;
716
- }
717
- declare module "@tiptap/core" {
718
- interface Commands<ReturnType> {
719
- bookmark: {
720
- /**
721
- * Bookmarks the selected text (or the word at the caret when the
722
- * selection is empty).
723
- */
724
- setBookmark: (options: SetBookmarkOptions) => ReturnType;
725
- /** Removes a bookmark (the text stays). */
726
- removeBookmark: (id: string) => ReturnType;
727
- /** Renames a bookmark. */
728
- renameBookmark: (id: string, name: string) => ReturnType;
729
- /** Selects a bookmark's text and scrolls to it. */
730
- goToBookmark: (id: string) => ReturnType;
731
- };
732
- }
733
- }
734
- /**
735
- * Lists the bookmarks in a document, merging the text nodes that carry each
736
- * bookmark into one entry.
737
- */
738
- declare function getBookmarks(doc: Node$1): BookmarkInfo[];
739
- /**
740
- * Word-style bookmark: a named, non-inclusive mark over a text range. Several
741
- * bookmarks may overlap. Cross-references (`CrossReference`) can point to a
742
- * bookmark by id and display its current text.
743
- */
744
- declare const Bookmark: Mark<BookmarkOptions, any>;
745
-
746
- type CrossReferenceTargetType = "heading" | "bookmark";
747
- /**
748
- * Something a cross-reference can point to.
749
- */
750
- interface CrossReferenceTarget {
751
- type: CrossReferenceTargetType;
752
- id: string;
753
- /** Current text of the target (heading text or bookmarked text). */
754
- text: string;
755
- /** Bookmark name, or heading text. */
756
- name: string;
757
- /** Heading level (headings only). */
758
- level?: number;
759
- }
760
- interface CrossReferenceOptions {
761
- HTMLAttributes: Record<string, any>;
762
- /** Heading node types that can be referenced. Defaults to `["heading"]`. */
763
- headingTypes: string[];
764
- /** Text shown while the target no longer exists (Word: "Error! Reference source not found."). */
765
- brokenText: string;
766
- }
767
- declare module "@tiptap/core" {
768
- interface Commands<ReturnType> {
769
- crossReference: {
770
- /** Inserts a cross-reference to a heading or bookmark at the selection. */
771
- insertCrossReference: (target: {
772
- targetType: CrossReferenceTargetType;
773
- targetId: string;
774
- }) => ReturnType;
775
- /**
776
- * Moves the caret to the target of the cross-reference at `pos` (or the
777
- * selected cross-reference).
778
- */
779
- followCrossReference: (pos?: number) => ReturnType;
780
- };
781
- }
782
- }
783
- declare const crossReferencePluginKey: PluginKey<boolean>;
784
- /**
785
- * Lists the headings (with stable ids, see `Outline`) and bookmarks in a
786
- * document, for building a cross-reference picker.
787
- */
788
- declare function getCrossReferenceTargets(doc: Node$1, headingTypes?: readonly string[]): CrossReferenceTarget[];
789
- /**
790
- * Inline cross-reference to a heading or bookmark. It displays the target's
791
- * current text, follows renames, and switches to a broken-reference state
792
- * (class `is-broken`, `brokenText`) when the target is removed. Undoing the
793
- * removal restores it. Heading targets need the `Outline` extension, which
794
- * gives headings stable ids.
795
- */
796
- declare const CrossReference: Node<CrossReferenceOptions, any>;
797
-
798
- interface DocumentStructureCommandArgs {
799
- /** Range to delete first, e.g. the `/toc` text matched by `SlashCommands`. */
800
- range?: {
801
- from: number;
802
- to: number;
803
- };
804
- /** Bookmark name (bookmark item). */
805
- name?: string;
806
- /** Footnote text (footnote item). */
807
- content?: string;
808
- /** Cross-reference target (cross-reference item). */
809
- targetType?: CrossReferenceTargetType;
810
- targetId?: string;
811
- }
812
- /**
813
- * A framework-agnostic menu entry for slash menus and toolbars.
814
- */
815
- interface DocumentStructureCommandItem {
816
- id: "table-of-contents" | "footnote" | "bookmark" | "cross-reference";
817
- title: string;
818
- description: string;
819
- keywords: string[];
820
- /** Name of the extension that must be installed for the item to work. */
821
- extension: string;
822
- /**
823
- * Input the host UI must collect before calling `run`: a bookmark name, or
824
- * a cross-reference target (see `getCrossReferenceTargets`).
825
- */
826
- requires?: "name" | "target";
827
- run: (editor: Editor, args?: DocumentStructureCommandArgs) => boolean;
828
- }
829
- /**
830
- * Menu entries for the document-structure commands.
831
- */
832
- declare const documentStructureCommandItems: DocumentStructureCommandItem[];
833
- /**
834
- * Returns the document-structure items whose extension is installed in the
835
- * editor, optionally filtered by a slash-command query.
836
- */
837
- declare function getDocumentStructureCommandItems(editor: Editor | null | undefined, query?: string): DocumentStructureCommandItem[];
838
-
839
- /**
840
- * markdown-it plugins used by the document-structure extensions' markdown
841
- * parse hooks (tiptap-markdown). tiptap-markdown calls every extension's
842
- * `parse.setup` before *each* parse on the same markdown-it instance, so the
843
- * plugins guard against registering their rules twice.
844
- */
845
- /**
846
- * Parses a line containing only `[[toc]]` (or `[TOC]`) into a table of
847
- * contents placeholder that the `TableOfContents` node parses.
848
- */
849
- declare function tableOfContentsMarkdownIt(md: any): void;
850
- /**
851
- * Minimal footnote syntax: `[^label]` references and `[^label]: text`
852
- * definitions (continuation paragraphs indented by four spaces). Renders the
853
- * HTML the `FootnoteReference`, `Footnotes` and `Footnote` nodes parse.
854
- */
855
- declare function footnotesMarkdownIt(md: any): void;
856
-
857
- interface RichTextPresetOptions {
858
- placeholder?: string | ((props: {
859
- node: any;
860
- }) => string);
861
- characterLimit?: number;
862
- openLinksOnClick?: boolean;
863
- enableSmilies?: boolean;
864
- enableColorHighlighter?: boolean;
865
- headingLevels?: (1 | 2 | 3 | 4 | 5 | 6)[];
866
- mention?: MentionOptions | boolean;
867
- markdown?: MarkdownOptions | boolean;
868
- image?: ImageOptions | boolean;
869
- /** Adds the `Comments` extension (off by default). */
870
- comments?: Partial<CommentsOptions> | boolean;
871
- /** Adds the `TrackChanges` extension (off by default). */
872
- trackChanges?: Partial<TrackChangesOptions> | boolean;
873
- /** Import dropped/pasted .md, .html, .txt and .rtf files (opt-in). */
874
- fileImport?: FileImportOptions | boolean;
875
- /** Copy/paste lossless ProseMirror slices between editors (opt-in). */
876
- richClipboard?: RichClipboardOptions | boolean;
877
- /**
878
- * Word-style AutoCorrect (smart quotes, symbols, fractions, sentence
879
- * capitalization, ...). Off by default. Replaces the Typography extension
880
- * when enabled, since both handle quotes and dashes.
881
- */
882
- autocorrect?: Partial<AutocorrectOptions> | boolean;
883
- /** Heading outline with stable heading ids. Off by default. */
884
- outline?: Partial<OutlineOptions> | boolean;
885
- /** Table of contents block (also enables `outline`). Off by default. */
886
- tableOfContents?: Partial<TableOfContentsOptions> | boolean;
887
- /** Footnote references and the footnotes list. Off by default. */
888
- footnotes?: Partial<FootnotesOptions> | boolean;
889
- /** Named bookmarks. Off by default. */
890
- bookmarks?: Partial<BookmarkOptions> | boolean;
891
- /** Cross-references to headings and bookmarks (also enables `outline`). Off by default. */
892
- crossReferences?: Partial<CrossReferenceOptions> | boolean;
893
- }
894
- /**
895
- * Creates a standard rich-text extensions bundle with full formatting support.
896
- */
897
- declare function createRichTextPreset(options?: RichTextPresetOptions): Extensions;
898
-
899
- export { type RichClipboardStorage as $, type AddCommentOptions as A, BUILT_IN_IMPORT_ADAPTERS as B, COMMENT_MARK_NAME as C, type DocumentImport as D, Footnote as E, FileImport as F, type FootnoteInfo as G, FootnoteReference as H, Footnotes as I, type FootnotesOptions as J, GradientText as K, type GradientTextOptions as L, Image as M, type ImageOptions as N, type InsertFootnoteOptions as O, type InsertTableOfContentsOptions as P, LoadingNode as Q, Markdown as R, Outline as S, type OutlineHeading as T, type OutlineOptions as U, type OutlineSnapshot as V, type OutlineStorage as W, type OutlineStore as X, type OutlineTreeItem as Y, RichClipboard as Z, type RichClipboardOptions as _, type DocumentImportAdapter as a, tableOfContentsPluginKey as a$, type RichTextPresetOptions as a0, SMILIE_REPLACEMENTS as a1, type SetBookmarkOptions as a2, type SlashCommandMatchData as a3, SlashCommands as a4, type SlashCommandsOptions as a5, SmilieReplacer as a6, TableOfContents as a7, type TableOfContentsEntry as a8, type TableOfContentsOptions as a9, getCommentIdsAt as aA, getCommentStore as aB, getCrossReferenceTargets as aC, getDocumentStructureCommandItems as aD, getFootnotes as aE, getImportAccept as aF, getOutline as aG, getTableOfContentsEntries as aH, handleImageInsertion as aI, htmlImportAdapter as aJ, imagePastePluginKey as aK, importFile as aL, insertImageNode as aM, isInsidePromptToken as aN, markdownImportAdapter as aO, navigateToHeading as aP, outlinePluginKey as aQ, plainTextImportAdapter as aR, registerImportAdapter as aS, removeImageNode as aT, richClipboardPluginKey as aU, rtfImportAdapter as aV, smartQuoteRules as aW, smilieAutocorrectRules as aX, symbolRules as aY, syncFootnotes as aZ, tableOfContentsMarkdownIt as a_, TemplateSuggestions as aa, type TemplateSuggestionsOptions as ab, autocorrectPluginKey as ac, buildOutlineTree as ad, capitalizeSentenceRules as ae, commentsPluginKey as af, computeOutline as ag, createImportAdapterRegistry as ah, createOutlineStore as ai, createRichTextPreset as aj, crossReferencePluginKey as ak, defaultAutocorrectRules as al, defaultImportRegistry as am, documentStructureCommandItems as an, fileImportPluginKey as ao, findAutocorrection as ap, findCommentRanges as aq, findHexColors as ar, findImportAdapter as as, footnotesMarkdownIt as at, footnotesPluginKey as au, fractionRules as av, getActiveHeading as aw, getBookmarks as ax, getCommentAnchors as ay, getCommentAuthor as az, Autocorrect as b, twoInitialCapitalsRules as b0, unregisterImportAdapter as b1, updateImageSrc as b2, writeRichClipboard as b3, type AutocorrectContext as c, type AutocorrectCorrection as d, type AutocorrectOptions as e, type AutocorrectRule as f, type AutocorrectStorage as g, Bookmark as h, type BookmarkInfo as i, type BookmarkOptions as j, ColorHighlighter as k, type CommentRange as l, Comments as m, type CommentsOptions as n, type CommentsStorage as o, type CreateImportAdapterRegistryOptions as p, CrossReference as q, type CrossReferenceOptions as r, type CrossReferenceTarget as s, type CrossReferenceTargetType as t, DEFAULT_AUTOCORRECT_EXCEPTIONS as u, type DocumentStructureCommandArgs as v, type DocumentStructureCommandItem as w, type FileImportOptions as x, type FocusHeadingOptions as y, FontSize as z };