@pixerate/editor 0.25.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/THIRD_PARTY_NOTICES.md +11 -0
- package/dist/agent/index.cjs +174 -11
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.d.cts +18 -4
- package/dist/agent/index.d.ts +18 -4
- package/dist/agent/index.js +167 -4
- package/dist/agent/index.js.map +1 -1
- package/dist/{arrangeShortcuts-B8O3f8-P.d.cts → arrange-BICutYPk.d.cts} +243 -29
- package/dist/{arrangeShortcuts-sLlD2rSX.d.ts → arrange-BICutYPk.d.ts} +243 -29
- package/dist/builtins-CdPcLwwF.d.cts +176 -0
- package/dist/builtins-Chj6zv_O.d.ts +176 -0
- package/dist/canvas/index.cjs +3917 -19
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +1232 -7
- package/dist/canvas/index.d.ts +1232 -7
- package/dist/canvas/index.js +3916 -18
- package/dist/canvas/index.js.map +1 -1
- package/dist/chunk-3CC7OPUQ.cjs +831 -0
- package/dist/chunk-3CC7OPUQ.cjs.map +1 -0
- package/dist/{chunk-AL6JMGWW.cjs → chunk-CS6NZWWA.cjs} +24 -24
- package/dist/{chunk-AL6JMGWW.cjs.map → chunk-CS6NZWWA.cjs.map} +1 -1
- package/dist/{chunk-C7P22VIP.cjs → chunk-EWCOFSCQ.cjs} +17 -6
- package/dist/chunk-EWCOFSCQ.cjs.map +1 -0
- package/dist/chunk-HDYMLS3X.cjs +409 -0
- package/dist/chunk-HDYMLS3X.cjs.map +1 -0
- package/dist/{chunk-X4N4WUKB.cjs → chunk-IFHKKVXH.cjs} +150 -38
- package/dist/chunk-IFHKKVXH.cjs.map +1 -0
- package/dist/{chunk-ECCCYKGL.js → chunk-JOIREKL7.js} +63 -39
- package/dist/chunk-JOIREKL7.js.map +1 -0
- package/dist/chunk-KRGXUQ2Y.js +1696 -0
- package/dist/chunk-KRGXUQ2Y.js.map +1 -0
- package/dist/{chunk-QGYDWPRM.js → chunk-MHEPLBFB.js} +2 -2
- package/dist/chunk-MR2764X2.js +831 -0
- package/dist/chunk-MR2764X2.js.map +1 -0
- package/dist/{chunk-7WISYZFO.cjs → chunk-NFVBT3UZ.cjs} +67 -43
- package/dist/chunk-NFVBT3UZ.cjs.map +1 -0
- package/dist/{chunk-WSQKHXW7.cjs → chunk-NQF32I6Z.cjs} +1209 -457
- package/dist/chunk-NQF32I6Z.cjs.map +1 -0
- package/dist/{chunk-IXHSYOVY.js → chunk-Q2OHWD2A.js} +638 -866
- package/dist/chunk-Q2OHWD2A.js.map +1 -0
- package/dist/{chunk-NAXVVS5I.js → chunk-QJSOZFCZ.js} +2 -2
- package/dist/{chunk-V3CHHWOE.cjs → chunk-RRREAOVM.cjs} +4 -4
- package/dist/{chunk-V3CHHWOE.cjs.map → chunk-RRREAOVM.cjs.map} +1 -1
- package/dist/{chunk-UAKDG62Z.js → chunk-SWE3NPOU.js} +116 -4
- package/dist/chunk-SWE3NPOU.js.map +1 -0
- package/dist/chunk-TXXNBDQX.cjs +1696 -0
- package/dist/chunk-TXXNBDQX.cjs.map +1 -0
- package/dist/chunk-UBCFIABU.js +409 -0
- package/dist/chunk-UBCFIABU.js.map +1 -0
- package/dist/{chunk-RR7F5GUM.js → chunk-X7HXL2SB.js} +941 -189
- package/dist/chunk-X7HXL2SB.js.map +1 -0
- package/dist/{chunk-PO6A6QQH.cjs → chunk-YOMYSFJU.cjs} +742 -970
- package/dist/chunk-YOMYSFJU.cjs.map +1 -0
- package/dist/{chunk-FH6F67DN.js → chunk-ZRNHGAQT.js} +17 -6
- package/dist/{chunk-FH6F67DN.js.map → chunk-ZRNHGAQT.js.map} +1 -1
- package/dist/commands/index.cjs +352 -4
- package/dist/commands/index.cjs.map +1 -1
- package/dist/commands/index.d.cts +37 -108
- package/dist/commands/index.d.ts +37 -108
- package/dist/commands/index.js +351 -3
- package/dist/commands/index.js.map +1 -1
- package/dist/compare/index.cjs +3 -3
- package/dist/compare/index.js +2 -2
- package/dist/{controller-BIJiNoVs.d.cts → controller-CxXGOEmy.d.cts} +209 -13
- package/dist/{controller-BIJiNoVs.d.ts → controller-CxXGOEmy.d.ts} +209 -13
- package/dist/export/index.cjs +36 -0
- package/dist/export/index.cjs.map +1 -0
- package/dist/export/index.d.cts +243 -0
- package/dist/export/index.d.ts +243 -0
- package/dist/export/index.js +36 -0
- package/dist/export/index.js.map +1 -0
- package/dist/extensions/index.cjs +54 -6
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.d.cts +7 -2
- package/dist/extensions/index.d.ts +7 -2
- package/dist/extensions/index.js +59 -11
- package/dist/{index-7a6bHTLy.d.ts → index-B273Zllk.d.ts} +211 -207
- package/dist/{index-Csd5qI8u.d.cts → index-jcJwmBYt.d.cts} +211 -207
- package/dist/index.cjs +144 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +49 -13
- package/dist/index.d.ts +49 -13
- package/dist/index.js +136 -24
- package/dist/index.js.map +1 -1
- package/dist/registry-CED5C0lA.d.cts +204 -0
- package/dist/registry-CED5C0lA.d.ts +204 -0
- package/dist/{registry-D32LpIc4.d.cts → registry-D0GADKc7.d.cts} +1 -1
- package/dist/{registry-evKTP4ls.d.ts → registry-DhVUZioj.d.ts} +1 -1
- package/dist/serializers/index.cjs +4 -4
- package/dist/serializers/index.d.cts +2 -1
- package/dist/serializers/index.d.ts +2 -1
- package/dist/serializers/index.js +3 -3
- package/dist/spreadsheet/index.cjs +33 -3
- package/dist/spreadsheet/index.cjs.map +1 -1
- package/dist/spreadsheet/index.d.cts +106 -3
- package/dist/spreadsheet/index.d.ts +106 -3
- package/dist/spreadsheet/index.js +32 -2
- package/package.json +10 -1
- package/dist/chunk-7WISYZFO.cjs.map +0 -1
- package/dist/chunk-C7P22VIP.cjs.map +0 -1
- package/dist/chunk-ECCCYKGL.js.map +0 -1
- package/dist/chunk-IXHSYOVY.js.map +0 -1
- package/dist/chunk-PO6A6QQH.cjs.map +0 -1
- package/dist/chunk-RR7F5GUM.js.map +0 -1
- package/dist/chunk-UAKDG62Z.js.map +0 -1
- package/dist/chunk-WSQKHXW7.cjs.map +0 -1
- package/dist/chunk-X4N4WUKB.cjs.map +0 -1
- package/dist/types-DX4Mh4SL.d.cts +0 -217
- package/dist/types-DX4Mh4SL.d.ts +0 -217
- /package/dist/{chunk-QGYDWPRM.js.map → chunk-MHEPLBFB.js.map} +0 -0
- /package/dist/{chunk-NAXVVS5I.js.map → chunk-QJSOZFCZ.js.map} +0 -0
package/dist/extensions/index.js
CHANGED
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
Comments,
|
|
9
9
|
CrossReference,
|
|
10
10
|
DEFAULT_AUTOCORRECT_EXCEPTIONS,
|
|
11
|
-
DEFAULT_STYLES,
|
|
12
11
|
DocumentCompare,
|
|
13
12
|
EMPTY_FIND_REPLACE_SNAPSHOT,
|
|
14
13
|
FIND_OPTION_TOGGLES,
|
|
@@ -26,7 +25,6 @@ import {
|
|
|
26
25
|
MAX_FIND_PATTERN_LENGTH,
|
|
27
26
|
Markdown,
|
|
28
27
|
Mention,
|
|
29
|
-
NORMAL_STYLE_ID,
|
|
30
28
|
Outline,
|
|
31
29
|
ParagraphStyles,
|
|
32
30
|
RichClipboard,
|
|
@@ -34,7 +32,6 @@ import {
|
|
|
34
32
|
STYLE_ID_ATTRIBUTE,
|
|
35
33
|
SlashCommands,
|
|
36
34
|
SmilieReplacer,
|
|
37
|
-
StyleRegistry,
|
|
38
35
|
TableOfContents,
|
|
39
36
|
TemplateSuggestions,
|
|
40
37
|
applyDocumentComparison,
|
|
@@ -53,7 +50,7 @@ import {
|
|
|
53
50
|
createParagraphStylesStore,
|
|
54
51
|
createRichTextPreset,
|
|
55
52
|
createSearchBudget,
|
|
56
|
-
|
|
53
|
+
createTableCommands,
|
|
57
54
|
crossReferencePluginKey,
|
|
58
55
|
defaultAutocorrectRules,
|
|
59
56
|
documentStructureCommandItems,
|
|
@@ -90,14 +87,12 @@ import {
|
|
|
90
87
|
insertImageNode,
|
|
91
88
|
isInsidePromptToken,
|
|
92
89
|
isParagraphStyleAvailable,
|
|
93
|
-
isValidStyleId,
|
|
94
90
|
navigateToHeading,
|
|
95
91
|
outlinePluginKey,
|
|
96
92
|
paragraphStylesPluginKey,
|
|
97
93
|
parseReplacement,
|
|
98
94
|
removeImageNode,
|
|
99
95
|
richClipboardPluginKey,
|
|
100
|
-
safeCSSValue,
|
|
101
96
|
searchDocument,
|
|
102
97
|
setMentionRoleAt,
|
|
103
98
|
smartQuoteRules,
|
|
@@ -110,11 +105,42 @@ import {
|
|
|
110
105
|
updateImageSrc,
|
|
111
106
|
validateFindPattern,
|
|
112
107
|
writeRichClipboard
|
|
113
|
-
} from "../chunk-
|
|
114
|
-
import "../chunk-
|
|
108
|
+
} from "../chunk-Q2OHWD2A.js";
|
|
109
|
+
import "../chunk-QJSOZFCZ.js";
|
|
110
|
+
import {
|
|
111
|
+
DEFAULT_STYLES,
|
|
112
|
+
NORMAL_STYLE_ID,
|
|
113
|
+
StyleRegistry,
|
|
114
|
+
createStyleRegistry,
|
|
115
|
+
isValidStyleId,
|
|
116
|
+
safeCSSValue
|
|
117
|
+
} from "../chunk-MR2764X2.js";
|
|
115
118
|
import "../chunk-P6ODPZ4W.js";
|
|
116
|
-
import "../chunk-
|
|
117
|
-
import
|
|
119
|
+
import "../chunk-MHEPLBFB.js";
|
|
120
|
+
import {
|
|
121
|
+
DEFAULT_TABLE_OPTIONS,
|
|
122
|
+
DEFAULT_TABLE_TOOLBAR,
|
|
123
|
+
EMPTY_TABLE_STATE,
|
|
124
|
+
MAX_TABLE_COLUMNS,
|
|
125
|
+
MAX_TABLE_ROWS,
|
|
126
|
+
TABLE_ACTIONS,
|
|
127
|
+
Table,
|
|
128
|
+
TableCell,
|
|
129
|
+
TableHeader,
|
|
130
|
+
TableRow,
|
|
131
|
+
createTableExtensions,
|
|
132
|
+
createTableStore,
|
|
133
|
+
getTableActionState,
|
|
134
|
+
getTableState,
|
|
135
|
+
isGfmTable,
|
|
136
|
+
isSelectionInTable,
|
|
137
|
+
isTableEnabled,
|
|
138
|
+
normalizeTableCellAlignment,
|
|
139
|
+
normalizeTableCellColor,
|
|
140
|
+
runTableAction,
|
|
141
|
+
shouldShowTableBubbleMenu
|
|
142
|
+
} from "../chunk-UBCFIABU.js";
|
|
143
|
+
import "../chunk-JOIREKL7.js";
|
|
118
144
|
import "../chunk-O5RYH2PG.js";
|
|
119
145
|
import {
|
|
120
146
|
BLOCK_CHANGE_ATTRIBUTE,
|
|
@@ -144,7 +170,7 @@ import {
|
|
|
144
170
|
resolveTrackedChanges,
|
|
145
171
|
trackChangesPluginKey,
|
|
146
172
|
trackedChangeLabel
|
|
147
|
-
} from "../chunk-
|
|
173
|
+
} from "../chunk-SWE3NPOU.js";
|
|
148
174
|
export {
|
|
149
175
|
Autocorrect,
|
|
150
176
|
BLOCK_CHANGE_ATTRIBUTE,
|
|
@@ -158,9 +184,12 @@ export {
|
|
|
158
184
|
CrossReference,
|
|
159
185
|
DEFAULT_AUTOCORRECT_EXCEPTIONS,
|
|
160
186
|
DEFAULT_STYLES,
|
|
187
|
+
DEFAULT_TABLE_OPTIONS,
|
|
188
|
+
DEFAULT_TABLE_TOOLBAR,
|
|
161
189
|
DELETION_MARK_NAME,
|
|
162
190
|
DocumentCompare,
|
|
163
191
|
EMPTY_FIND_REPLACE_SNAPSHOT,
|
|
192
|
+
EMPTY_TABLE_STATE,
|
|
164
193
|
FIND_OPTION_TOGGLES,
|
|
165
194
|
FIND_PARAGRAPH_MARK,
|
|
166
195
|
FORMAT_CHANGE_MARK_NAME,
|
|
@@ -176,6 +205,8 @@ export {
|
|
|
176
205
|
Image,
|
|
177
206
|
LoadingNode,
|
|
178
207
|
MAX_FIND_PATTERN_LENGTH,
|
|
208
|
+
MAX_TABLE_COLUMNS,
|
|
209
|
+
MAX_TABLE_ROWS,
|
|
179
210
|
MOVE_FROM_CLASS,
|
|
180
211
|
MOVE_ID_ATTRIBUTE,
|
|
181
212
|
MOVE_TO_CLASS,
|
|
@@ -190,8 +221,13 @@ export {
|
|
|
190
221
|
SlashCommands,
|
|
191
222
|
SmilieReplacer,
|
|
192
223
|
StyleRegistry,
|
|
224
|
+
TABLE_ACTIONS,
|
|
193
225
|
TRACK_CHANGES_SKIP_META,
|
|
226
|
+
Table,
|
|
227
|
+
TableCell,
|
|
228
|
+
TableHeader,
|
|
194
229
|
TableOfContents,
|
|
230
|
+
TableRow,
|
|
195
231
|
TemplateSuggestions,
|
|
196
232
|
TrackChanges,
|
|
197
233
|
TrackChangesStore,
|
|
@@ -217,6 +253,9 @@ export {
|
|
|
217
253
|
createRichTextPreset,
|
|
218
254
|
createSearchBudget,
|
|
219
255
|
createStyleRegistry,
|
|
256
|
+
createTableCommands,
|
|
257
|
+
createTableExtensions,
|
|
258
|
+
createTableStore,
|
|
220
259
|
crossReferencePluginKey,
|
|
221
260
|
defaultAutocorrectRules,
|
|
222
261
|
describeBlockChange,
|
|
@@ -250,28 +289,37 @@ export {
|
|
|
250
289
|
getOutline,
|
|
251
290
|
getParagraphStyleAt,
|
|
252
291
|
getStyleRegistry,
|
|
292
|
+
getTableActionState,
|
|
253
293
|
getTableOfContentsEntries,
|
|
294
|
+
getTableState,
|
|
254
295
|
getTrackChangesStore,
|
|
255
296
|
getTrackedChangeAt,
|
|
256
297
|
getTrackedChanges,
|
|
257
298
|
handleImageInsertion,
|
|
258
299
|
imagePastePluginKey,
|
|
259
300
|
insertImageNode,
|
|
301
|
+
isGfmTable,
|
|
260
302
|
isInsidePromptToken,
|
|
261
303
|
isMoveSized,
|
|
262
304
|
isParagraphStyleAvailable,
|
|
305
|
+
isSelectionInTable,
|
|
306
|
+
isTableEnabled,
|
|
263
307
|
isTrackChangesEnabled,
|
|
264
308
|
isValidStyleId,
|
|
265
309
|
navigateToHeading,
|
|
310
|
+
normalizeTableCellAlignment,
|
|
311
|
+
normalizeTableCellColor,
|
|
266
312
|
outlinePluginKey,
|
|
267
313
|
paragraphStylesPluginKey,
|
|
268
314
|
parseReplacement,
|
|
269
315
|
removeImageNode,
|
|
270
316
|
resolveTrackedChanges,
|
|
271
317
|
richClipboardPluginKey,
|
|
318
|
+
runTableAction,
|
|
272
319
|
safeCSSValue,
|
|
273
320
|
searchDocument,
|
|
274
321
|
setMentionRoleAt,
|
|
322
|
+
shouldShowTableBubbleMenu,
|
|
275
323
|
smartQuoteRules,
|
|
276
324
|
smilieAutocorrectRules,
|
|
277
325
|
symbolRules,
|
|
@@ -3,6 +3,10 @@ import { C as ColorGradient, T as Template } from './tokens-D7yXvUU6.js';
|
|
|
3
3
|
import { EditorState, PluginKey, Transaction } from '@tiptap/pm/state';
|
|
4
4
|
import { DecorationSet, EditorView } from '@tiptap/pm/view';
|
|
5
5
|
import { Node as Node$1 } from '@tiptap/pm/model';
|
|
6
|
+
import * as _tiptap_extension_table_cell from '@tiptap/extension-table-cell';
|
|
7
|
+
import * as _tiptap_extension_table_header from '@tiptap/extension-table-header';
|
|
8
|
+
import * as _tiptap_extension_table_row from '@tiptap/extension-table-row';
|
|
9
|
+
import * as _tiptap_extension_table from '@tiptap/extension-table';
|
|
6
10
|
import * as _tiptap_extension_underline from '@tiptap/extension-underline';
|
|
7
11
|
import * as _tiptap_extension_text_style from '@tiptap/extension-text-style';
|
|
8
12
|
import * as _tiptap_extension_text_align from '@tiptap/extension-text-align';
|
|
@@ -15,10 +19,11 @@ import * as _tiptap_extension_color from '@tiptap/extension-color';
|
|
|
15
19
|
import * as _tiptap_starter_kit from '@tiptap/starter-kit';
|
|
16
20
|
import { f as MentionOptions, h as TrackChangesOptions } from './track-changes-Db_fGEvx.js';
|
|
17
21
|
import { MarkdownOptions } from 'tiptap-markdown';
|
|
18
|
-
import { R as ReviewAuthor, b as CommentStore, C as CommentAnchor } from './comment-store-BEMgVlAA.js';
|
|
22
|
+
import { R as ReviewAuthor, b as CommentStore, C as CommentAnchor, S as SerializedComments } from './comment-store-BEMgVlAA.js';
|
|
23
|
+
import { e as StyleRegistry, c as StyleDefinition, P as ParagraphFormat, C as CharacterFormat } from './registry-CED5C0lA.js';
|
|
19
24
|
import { b as ImportAdapter, I as ImportAdapterRegistry, c as FindImportAdapterQuery, i as ImportTarget, h as ImportInput, g as ImportFileOptions, a as ImportOutcome, R as RegisterImportAdapterOptions, F as FileLike } from './registry-CEgwXED1.js';
|
|
20
25
|
import { b as CompareSource, C as CompareDocumentsOptions, a as CompareDocumentsResult } from './documents-CHT1U5Vs.js';
|
|
21
|
-
import {
|
|
26
|
+
import { C as CommandSpec } from './registry-DhVUZioj.js';
|
|
22
27
|
|
|
23
28
|
interface GradientTextOptions {
|
|
24
29
|
templateColorMap: Map<string, ColorGradient>;
|
|
@@ -509,6 +514,14 @@ interface DocumentImport {
|
|
|
509
514
|
* columns) with confidences; set by the PDF adapter.
|
|
510
515
|
*/
|
|
511
516
|
structure?: ImportStructureReport;
|
|
517
|
+
/**
|
|
518
|
+
* Comment threads (with replies and resolved state) whose ranges the HTML
|
|
519
|
+
* marks with `data-comment-id`; set by the DOCX adapter. Load them into the
|
|
520
|
+
* editor's comment store, e.g. with `applyImportedReviewData`.
|
|
521
|
+
*/
|
|
522
|
+
comments?: SerializedComments;
|
|
523
|
+
/** Paragraph and character styles the file defines; set by the DOCX adapter. */
|
|
524
|
+
styles?: StyleRegistry;
|
|
512
525
|
}
|
|
513
526
|
type DocumentImportAdapter = ImportAdapter<DocumentImport>;
|
|
514
527
|
/**
|
|
@@ -1314,209 +1327,6 @@ declare function formatFindStatus(s: Pick<FindReplaceSnapshot, "query" | "matche
|
|
|
1314
1327
|
*/
|
|
1315
1328
|
declare const FindReplace: Extension<FindReplaceOptions, FindReplaceStorage>;
|
|
1316
1329
|
|
|
1317
|
-
/** Paragraph styles format whole blocks; character styles format runs of text. */
|
|
1318
|
-
type StyleKind = "paragraph" | "character";
|
|
1319
|
-
/** Character formatting of a style (CSS values). */
|
|
1320
|
-
interface CharacterFormat {
|
|
1321
|
-
fontFamily?: string;
|
|
1322
|
-
/** CSS length, e.g. `"1.5em"` or `"18px"`. */
|
|
1323
|
-
fontSize?: string;
|
|
1324
|
-
bold?: boolean;
|
|
1325
|
-
italic?: boolean;
|
|
1326
|
-
underline?: boolean;
|
|
1327
|
-
strike?: boolean;
|
|
1328
|
-
color?: string;
|
|
1329
|
-
backgroundColor?: string;
|
|
1330
|
-
letterSpacing?: string;
|
|
1331
|
-
textTransform?: "none" | "uppercase" | "lowercase" | "capitalize";
|
|
1332
|
-
smallCaps?: boolean;
|
|
1333
|
-
}
|
|
1334
|
-
/** Paragraph formatting of a style (CSS values). */
|
|
1335
|
-
interface ParagraphFormat {
|
|
1336
|
-
textAlign?: "left" | "center" | "right" | "justify";
|
|
1337
|
-
lineHeight?: string;
|
|
1338
|
-
spaceBefore?: string;
|
|
1339
|
-
spaceAfter?: string;
|
|
1340
|
-
indentLeft?: string;
|
|
1341
|
-
indentRight?: string;
|
|
1342
|
-
indentFirstLine?: string;
|
|
1343
|
-
/** CSS border shorthand, e.g. `"3px solid currentColor"`. */
|
|
1344
|
-
borderLeft?: string;
|
|
1345
|
-
paddingLeft?: string;
|
|
1346
|
-
backgroundColor?: string;
|
|
1347
|
-
}
|
|
1348
|
-
/** The block node a paragraph style uses (`heading` with `level` for Heading N). */
|
|
1349
|
-
interface StyleBlock {
|
|
1350
|
-
type: string;
|
|
1351
|
-
attrs?: Record<string, any>;
|
|
1352
|
-
}
|
|
1353
|
-
interface StyleDefinition {
|
|
1354
|
-
/** Stable id (`Heading1`): letters, digits, `_` and `-`, starting with a letter. */
|
|
1355
|
-
id: string;
|
|
1356
|
-
/** Display name (`Heading 1`). */
|
|
1357
|
-
name: string;
|
|
1358
|
-
kind: StyleKind;
|
|
1359
|
-
/** Style this one inherits from; what it sets wins over its base. */
|
|
1360
|
-
basedOn?: string | null;
|
|
1361
|
-
/** Style of the paragraph after this one when Enter is pressed at its end (paragraph styles). */
|
|
1362
|
-
next?: string | null;
|
|
1363
|
-
/** Linked style: a paragraph style's character style, or a character style's paragraph style. */
|
|
1364
|
-
linked?: string | null;
|
|
1365
|
-
paragraph?: ParagraphFormat;
|
|
1366
|
-
character?: CharacterFormat;
|
|
1367
|
-
/** Block node of a paragraph style. Inherited along `basedOn`; `paragraph` by default. */
|
|
1368
|
-
block?: StyleBlock | null;
|
|
1369
|
-
/** Gallery order (lower first). */
|
|
1370
|
-
priority?: number;
|
|
1371
|
-
/** Shown in the styles gallery. */
|
|
1372
|
-
quick?: boolean;
|
|
1373
|
-
hidden?: boolean;
|
|
1374
|
-
/** Built in (cannot be removed). */
|
|
1375
|
-
builtin?: boolean;
|
|
1376
|
-
}
|
|
1377
|
-
/** A style with its `basedOn` chain and the defaults merged. */
|
|
1378
|
-
interface ResolvedStyle {
|
|
1379
|
-
id: string;
|
|
1380
|
-
paragraph: ParagraphFormat;
|
|
1381
|
-
character: CharacterFormat;
|
|
1382
|
-
block: StyleBlock;
|
|
1383
|
-
/** Id of the style after Enter at the end of a paragraph. */
|
|
1384
|
-
next: string;
|
|
1385
|
-
}
|
|
1386
|
-
interface StyleDefaults {
|
|
1387
|
-
paragraph?: ParagraphFormat;
|
|
1388
|
-
character?: CharacterFormat;
|
|
1389
|
-
}
|
|
1390
|
-
interface StyleRegistryOptions {
|
|
1391
|
-
/** Styles added to (or replacing) the built-in ones. */
|
|
1392
|
-
styles?: readonly StyleDefinition[];
|
|
1393
|
-
/** Include the built-in styles. Default `true`. */
|
|
1394
|
-
builtins?: boolean;
|
|
1395
|
-
/** Document defaults, applied below every style. */
|
|
1396
|
-
defaults?: StyleDefaults;
|
|
1397
|
-
}
|
|
1398
|
-
interface StyleRegistrySnapshot {
|
|
1399
|
-
styles: readonly StyleDefinition[];
|
|
1400
|
-
defaults: StyleDefaults;
|
|
1401
|
-
/** Increases on every change. */
|
|
1402
|
-
version: number;
|
|
1403
|
-
}
|
|
1404
|
-
/** Serializable registry content (`registry.toJSON()`). */
|
|
1405
|
-
interface StyleRegistryJSON {
|
|
1406
|
-
styles: StyleDefinition[];
|
|
1407
|
-
defaults: StyleDefaults;
|
|
1408
|
-
}
|
|
1409
|
-
interface StyleCSSOptions {
|
|
1410
|
-
/** Selector the rules are scoped to. Default `.ProseMirror`. */
|
|
1411
|
-
scope?: string;
|
|
1412
|
-
/**
|
|
1413
|
-
* Element selector of blocks that use a style without naming it
|
|
1414
|
-
* (`data-style` absent), e.g. `h2` for Heading 2. Return `null` for none.
|
|
1415
|
-
*/
|
|
1416
|
-
tagFor?: (block: StyleBlock) => string | null;
|
|
1417
|
-
}
|
|
1418
|
-
declare const NORMAL_STYLE_ID = "Normal";
|
|
1419
|
-
/** Whether `id` is a valid style id. */
|
|
1420
|
-
declare function isValidStyleId(id: unknown): id is string;
|
|
1421
|
-
/** The built-in styles: Normal, Title, Subtitle, Heading 1–6, Quote, Code, List Paragraph and character styles. */
|
|
1422
|
-
declare const DEFAULT_STYLES: readonly StyleDefinition[];
|
|
1423
|
-
/**
|
|
1424
|
-
* Style definitions with `basedOn` inheritance, next-style and linked
|
|
1425
|
-
* character/paragraph styles, resolved in cascade order: document defaults →
|
|
1426
|
-
* style chain (base first) → direct formatting. Chains are cycle-safe.
|
|
1427
|
-
*
|
|
1428
|
-
* `subscribe` calls the listener immediately and on every change (Svelte
|
|
1429
|
-
* store contract); `getSnapshot` is stable between changes.
|
|
1430
|
-
*/
|
|
1431
|
-
declare class StyleRegistry {
|
|
1432
|
-
private styles;
|
|
1433
|
-
private defaults;
|
|
1434
|
-
private version;
|
|
1435
|
-
private snapshot;
|
|
1436
|
-
private listeners;
|
|
1437
|
-
constructor(options?: StyleRegistryOptions);
|
|
1438
|
-
get(id: string | null | undefined): StyleDefinition | undefined;
|
|
1439
|
-
/** Finds a style by id or display name (case-insensitive). */
|
|
1440
|
-
find(nameOrId: string): StyleDefinition | undefined;
|
|
1441
|
-
/** All styles (optionally of one kind) in gallery order. */
|
|
1442
|
-
list(kind?: StyleKind): StyleDefinition[];
|
|
1443
|
-
/** Styles shown in the gallery (`quick`, not hidden), paragraph styles by default. */
|
|
1444
|
-
gallery(kind?: StyleKind): StyleDefinition[];
|
|
1445
|
-
/** The `basedOn` chain from the root style down to `id` (cycle-safe, bounded). */
|
|
1446
|
-
chain(id: string): StyleDefinition[];
|
|
1447
|
-
/**
|
|
1448
|
-
* Resolves a paragraph style: defaults, then each style of the chain (base
|
|
1449
|
-
* first). Unknown ids resolve to the defaults in a `paragraph` block.
|
|
1450
|
-
*/
|
|
1451
|
-
resolve(id: string): ResolvedStyle;
|
|
1452
|
-
/** Character formatting a paragraph style's chain sets (without defaults). */
|
|
1453
|
-
private paragraphCharacter;
|
|
1454
|
-
/**
|
|
1455
|
-
* Character formatting of a character style's chain. A style linked to a
|
|
1456
|
-
* paragraph style takes that style's character formatting first.
|
|
1457
|
-
*/
|
|
1458
|
-
resolveCharacterStyle(id: string): CharacterFormat;
|
|
1459
|
-
/**
|
|
1460
|
-
* Character formatting of text: defaults → paragraph style chain →
|
|
1461
|
-
* character style chain → direct formatting.
|
|
1462
|
-
*/
|
|
1463
|
-
resolveText(input: {
|
|
1464
|
-
paragraphStyle?: string | null;
|
|
1465
|
-
characterStyle?: string | null;
|
|
1466
|
-
direct?: CharacterFormat;
|
|
1467
|
-
}): CharacterFormat;
|
|
1468
|
-
/** The style after Enter at the end of a paragraph of `id` (itself when unset or unknown). */
|
|
1469
|
-
nextStyleId(id: string): string;
|
|
1470
|
-
/** The linked character style of a paragraph style, if any. */
|
|
1471
|
-
linkedCharacterStyle(id: string): StyleDefinition | undefined;
|
|
1472
|
-
/**
|
|
1473
|
-
* The style a block uses when it names none: Normal for paragraphs,
|
|
1474
|
-
* Heading N for headings of level N, Code for code blocks (the built-in
|
|
1475
|
-
* style whose own `block` matches).
|
|
1476
|
-
*/
|
|
1477
|
-
defaultStyleFor(type: string, attrs?: Record<string, any>): string | null;
|
|
1478
|
-
/** The style of a block: its `styleId` when known, otherwise the block's default style. */
|
|
1479
|
-
styleOfBlock(type: string, attrs?: Record<string, any>): string | null;
|
|
1480
|
-
getSnapshot: () => StyleRegistrySnapshot;
|
|
1481
|
-
subscribe: (listener: (snapshot: StyleRegistrySnapshot) => void) => (() => void);
|
|
1482
|
-
toJSON(): StyleRegistryJSON;
|
|
1483
|
-
/** Adds or replaces a style. Throws on an invalid id. */
|
|
1484
|
-
upsert(style: StyleDefinition): StyleDefinition;
|
|
1485
|
-
/** Merges `patch` into a style (formats are merged key by key). Returns `undefined` for unknown ids. */
|
|
1486
|
-
update(id: string, patch: Partial<Omit<StyleDefinition, "id">>): StyleDefinition | undefined;
|
|
1487
|
-
/**
|
|
1488
|
-
* Removes a style and returns it. Built-in styles cannot be removed. Styles
|
|
1489
|
-
* based on it are rebased onto its own base, and `next`/`linked`
|
|
1490
|
-
* references to it are dropped.
|
|
1491
|
-
*/
|
|
1492
|
-
remove(id: string): StyleDefinition | undefined;
|
|
1493
|
-
/** Replaces the document defaults. */
|
|
1494
|
-
setDefaults(defaults: StyleDefaults): void;
|
|
1495
|
-
/** An unused id derived from a display name (`My Style` → `MyStyle`, then `MyStyle1`, …). */
|
|
1496
|
-
newId(name: string): string;
|
|
1497
|
-
/** CSS declarations (`property: value`) of a resolved paragraph or character style. */
|
|
1498
|
-
cssDeclarations(id: string): Record<string, string>;
|
|
1499
|
-
/**
|
|
1500
|
-
* Declarations for previewing a style in a menu or gallery: font family,
|
|
1501
|
-
* weight, style, color, decoration, case and letter spacing (no sizes,
|
|
1502
|
-
* margins or borders).
|
|
1503
|
-
*/
|
|
1504
|
-
previewDeclarations(id: string): Record<string, string>;
|
|
1505
|
-
/**
|
|
1506
|
-
* A stylesheet for the styles: `[data-style="Id"]` rules for paragraph
|
|
1507
|
-
* styles (plus the plain element of blocks that use their default style,
|
|
1508
|
-
* e.g. `h2:not([data-style])`), `[data-char-style="Id"]` for character
|
|
1509
|
-
* styles and the defaults on the scope element.
|
|
1510
|
-
*/
|
|
1511
|
-
toCSS(options?: StyleCSSOptions): string;
|
|
1512
|
-
private put;
|
|
1513
|
-
private changed;
|
|
1514
|
-
}
|
|
1515
|
-
/** A CSS value, or `undefined` when it is unsafe or empty. */
|
|
1516
|
-
declare function safeCSSValue(value: unknown): string | undefined;
|
|
1517
|
-
/** Creates a style registry with the built-in styles (unless `builtins: false`) and `styles`. */
|
|
1518
|
-
declare function createStyleRegistry(options?: StyleRegistryOptions | StyleRegistryJSON): StyleRegistry;
|
|
1519
|
-
|
|
1520
1330
|
/** Node attribute naming a block's paragraph style (`data-style` in HTML). */
|
|
1521
1331
|
declare const STYLE_ID_ATTRIBUTE = "styleId";
|
|
1522
1332
|
/** Mark applying a character style (`<span data-char-style>`). */
|
|
@@ -1626,6 +1436,55 @@ interface ParagraphStylesStore {
|
|
|
1626
1436
|
*/
|
|
1627
1437
|
declare function createParagraphStylesStore(editor: Editor | null | undefined): ParagraphStylesStore;
|
|
1628
1438
|
|
|
1439
|
+
/** Horizontal alignment of a table cell (`align` attribute). */
|
|
1440
|
+
type TableCellAlignment = "left" | "center" | "right" | "justify";
|
|
1441
|
+
/** Returns a valid cell alignment, or `null`. */
|
|
1442
|
+
declare function normalizeTableCellAlignment(value: unknown): TableCellAlignment | null;
|
|
1443
|
+
/** Returns a safe CSS color for a cell background, or `null`. */
|
|
1444
|
+
declare function normalizeTableCellColor(value: unknown): string | null;
|
|
1445
|
+
/**
|
|
1446
|
+
* Whether a table can be written as a GFM pipe table: the first row is all
|
|
1447
|
+
* header cells, the other rows have none, no cell spans rows or columns, and
|
|
1448
|
+
* every cell holds a single paragraph.
|
|
1449
|
+
*/
|
|
1450
|
+
declare function isGfmTable(node: Node$1): boolean;
|
|
1451
|
+
interface RichTextTableOptions {
|
|
1452
|
+
/** Drag column borders to resize columns (stored as `colwidth`). Default `true`. */
|
|
1453
|
+
resizable: boolean;
|
|
1454
|
+
/** Width of the resize handle in pixels. Default 5. */
|
|
1455
|
+
handleWidth: number;
|
|
1456
|
+
/** Minimum cell width in pixels. Default 25. */
|
|
1457
|
+
cellMinWidth: number;
|
|
1458
|
+
/** Whether the last column can be resized. Default `true`. */
|
|
1459
|
+
lastColumnResizable: boolean;
|
|
1460
|
+
/** Allow selecting the whole table as a node (click its border, Esc from a cell selection). Default `true`. */
|
|
1461
|
+
allowTableNodeSelection: boolean;
|
|
1462
|
+
/** HTML attributes of the `<table>` element. */
|
|
1463
|
+
HTMLAttributes: Record<string, any>;
|
|
1464
|
+
/** HTML attributes of `<td>` elements. */
|
|
1465
|
+
cellHTMLAttributes: Record<string, any>;
|
|
1466
|
+
/** HTML attributes of `<th>` elements. */
|
|
1467
|
+
headerHTMLAttributes: Record<string, any>;
|
|
1468
|
+
/** HTML attributes of `<tr>` elements. */
|
|
1469
|
+
rowHTMLAttributes: Record<string, any>;
|
|
1470
|
+
}
|
|
1471
|
+
declare const DEFAULT_TABLE_OPTIONS: RichTextTableOptions;
|
|
1472
|
+
/** TipTap's `Table` with the GFM-aware markdown serializer. */
|
|
1473
|
+
declare const Table: any;
|
|
1474
|
+
declare const TableRow: any;
|
|
1475
|
+
/** TipTap's `TableCell` plus `align` and `backgroundColor` attributes. */
|
|
1476
|
+
declare const TableCell: any;
|
|
1477
|
+
/** TipTap's `TableHeader` plus `align` and `backgroundColor` attributes. */
|
|
1478
|
+
declare const TableHeader: any;
|
|
1479
|
+
/**
|
|
1480
|
+
* The table extensions (`table`, `tableRow`, `tableHeader`, `tableCell`)
|
|
1481
|
+
* configured for rich documents: resizable columns, header rows, columns and
|
|
1482
|
+
* cells, `colspan` / `rowspan` from imported HTML, cell alignment and
|
|
1483
|
+
* background, table node selection and GFM markdown. `createRichTextPreset`
|
|
1484
|
+
* adds them unless `table: false`.
|
|
1485
|
+
*/
|
|
1486
|
+
declare function createTableExtensions(options?: Partial<RichTextTableOptions>): Extensions;
|
|
1487
|
+
|
|
1629
1488
|
/**
|
|
1630
1489
|
* The TipTap packages whose commands the preset installs. Exported only so the
|
|
1631
1490
|
* published declarations import them: each package augments `@tiptap/core`'s
|
|
@@ -1643,7 +1502,11 @@ type RichTextPresetCommandPackages = [
|
|
|
1643
1502
|
typeof _tiptap_extension_task_list,
|
|
1644
1503
|
typeof _tiptap_extension_text_align,
|
|
1645
1504
|
typeof _tiptap_extension_text_style,
|
|
1646
|
-
typeof _tiptap_extension_underline
|
|
1505
|
+
typeof _tiptap_extension_underline,
|
|
1506
|
+
typeof _tiptap_extension_table,
|
|
1507
|
+
typeof _tiptap_extension_table_row,
|
|
1508
|
+
typeof _tiptap_extension_table_header,
|
|
1509
|
+
typeof _tiptap_extension_table_cell
|
|
1647
1510
|
];
|
|
1648
1511
|
interface RichTextPresetOptions {
|
|
1649
1512
|
placeholder?: string | ((props: {
|
|
@@ -1688,6 +1551,14 @@ interface RichTextPresetOptions {
|
|
|
1688
1551
|
* registry, `data-style` attributes and next-style on Enter. Off by default.
|
|
1689
1552
|
*/
|
|
1690
1553
|
paragraphStyles?: Partial<ParagraphStylesOptions> | boolean;
|
|
1554
|
+
/**
|
|
1555
|
+
* Tables (`table`, `tableRow`, `tableHeader`, `tableCell`): resizable
|
|
1556
|
+
* columns, header rows/columns/cells, `colspan`/`rowspan` (e.g. from PDF
|
|
1557
|
+
* and DOCX import), cell alignment and background, GFM markdown. **On by
|
|
1558
|
+
* default**; `table: false` leaves tables out of the schema, so pasted or
|
|
1559
|
+
* imported tables are flattened into paragraphs as before.
|
|
1560
|
+
*/
|
|
1561
|
+
table?: Partial<RichTextTableOptions> | boolean;
|
|
1691
1562
|
}
|
|
1692
1563
|
/**
|
|
1693
1564
|
* Creates a standard rich-text extensions bundle with full formatting support.
|
|
@@ -1751,4 +1622,137 @@ declare function createFindReplaceCommands(editor: Editor, options?: FindReplace
|
|
|
1751
1622
|
/** Validates Find text without an editor (e.g. to show an error while typing). */
|
|
1752
1623
|
declare function validateFindPattern(query: string, options?: FindOptions): FindPatternError | null;
|
|
1753
1624
|
|
|
1754
|
-
|
|
1625
|
+
/** Table operations shared by the command registry, the toolbars and agent tools. */
|
|
1626
|
+
type TableAction = "insertTable" | "addRowBefore" | "addRowAfter" | "deleteRow" | "addColumnBefore" | "addColumnAfter" | "deleteColumn" | "deleteTable" | "mergeCells" | "splitCell" | "toggleHeaderRow" | "toggleHeaderColumn" | "toggleHeaderCell" | "goToNextCell" | "goToPreviousCell" | "setCellAlignment" | "setCellBackground";
|
|
1627
|
+
/** Parameters of `insertTable`, `setCellAlignment` and `setCellBackground`. */
|
|
1628
|
+
interface TableActionParams {
|
|
1629
|
+
/** `insertTable`: number of rows (1–100, default 3). */
|
|
1630
|
+
rows?: number;
|
|
1631
|
+
/** `insertTable`: number of columns (1–50, default 3). */
|
|
1632
|
+
cols?: number;
|
|
1633
|
+
/** `insertTable`: make the first row a header row (default `true`). */
|
|
1634
|
+
withHeaderRow?: boolean;
|
|
1635
|
+
/** `setCellAlignment`: `left`, `center`, `right`, `justify`, or `null` to clear. */
|
|
1636
|
+
align?: TableCellAlignment | null;
|
|
1637
|
+
/** `setCellBackground`: a CSS color, or `null` to clear. */
|
|
1638
|
+
color?: string | null;
|
|
1639
|
+
}
|
|
1640
|
+
interface TableActionInfo {
|
|
1641
|
+
action: TableAction;
|
|
1642
|
+
label: string;
|
|
1643
|
+
description: string;
|
|
1644
|
+
keywords: readonly string[];
|
|
1645
|
+
}
|
|
1646
|
+
/** Every table action with its label, in toolbar order. */
|
|
1647
|
+
declare const TABLE_ACTIONS: readonly TableActionInfo[];
|
|
1648
|
+
/** A button of the table toolbars (`TableToolbar` in React and Svelte). */
|
|
1649
|
+
interface TableToolbarItem {
|
|
1650
|
+
/** Unique id (also the button's `data-action`). */
|
|
1651
|
+
id: string;
|
|
1652
|
+
action: TableAction;
|
|
1653
|
+
params?: TableActionParams;
|
|
1654
|
+
/** Short button text. */
|
|
1655
|
+
label: string;
|
|
1656
|
+
/** Accessible name and tooltip. */
|
|
1657
|
+
title: string;
|
|
1658
|
+
/** Items of one group are separated from the next group. */
|
|
1659
|
+
group: string;
|
|
1660
|
+
/** Toggle buttons: whether the button shows as pressed. */
|
|
1661
|
+
active?: (state: TableState) => boolean;
|
|
1662
|
+
}
|
|
1663
|
+
/** The default table toolbar: rows, columns, cells, headers, alignment, delete. */
|
|
1664
|
+
declare const DEFAULT_TABLE_TOOLBAR: readonly TableToolbarItem[];
|
|
1665
|
+
declare const MAX_TABLE_ROWS = 100;
|
|
1666
|
+
declare const MAX_TABLE_COLUMNS = 50;
|
|
1667
|
+
/** Whether the editor's schema has the table nodes (`createRichTextPreset({ table })`). */
|
|
1668
|
+
declare function isTableEnabled(editor: Editor | null | undefined): boolean;
|
|
1669
|
+
/** Whether the selection (cursor, text or cell selection) is inside a table. */
|
|
1670
|
+
declare function isSelectionInTable(state: EditorState): boolean;
|
|
1671
|
+
/**
|
|
1672
|
+
* `shouldShow` for a table bubble menu (TipTap's `BubbleMenuPlugin`): shown
|
|
1673
|
+
* while an editable editor's selection is in a table, even a collapsed cursor.
|
|
1674
|
+
*/
|
|
1675
|
+
declare function shouldShowTableBubbleMenu({ editor, state }: {
|
|
1676
|
+
editor: Editor;
|
|
1677
|
+
state: EditorState;
|
|
1678
|
+
}): boolean;
|
|
1679
|
+
/**
|
|
1680
|
+
* Whether a table action can run: `true`, or the reason it cannot (e.g.
|
|
1681
|
+
* "Place the cursor in a table first.").
|
|
1682
|
+
*/
|
|
1683
|
+
declare function getTableActionState(editor: Editor | null | undefined, action: TableAction, params?: TableActionParams): true | string;
|
|
1684
|
+
interface RunTableActionOptions {
|
|
1685
|
+
/** Focus the editor (toolbars). Default `false`. */
|
|
1686
|
+
focus?: boolean;
|
|
1687
|
+
}
|
|
1688
|
+
/**
|
|
1689
|
+
* Runs a table action. Returns `false` (and changes nothing) when it cannot
|
|
1690
|
+
* run; check `getTableActionState` for the reason.
|
|
1691
|
+
*/
|
|
1692
|
+
declare function runTableAction(editor: Editor | null | undefined, action: TableAction, params?: TableActionParams, options?: RunTableActionOptions): boolean;
|
|
1693
|
+
interface TableActionStatus {
|
|
1694
|
+
enabled: boolean;
|
|
1695
|
+
/** Why the action cannot run (only when `enabled` is false). */
|
|
1696
|
+
reason?: string;
|
|
1697
|
+
}
|
|
1698
|
+
/** The table at the selection and what can be done there. */
|
|
1699
|
+
interface TableState {
|
|
1700
|
+
/** The schema has tables. */
|
|
1701
|
+
enabled: boolean;
|
|
1702
|
+
/** The selection is inside a table. */
|
|
1703
|
+
inTable: boolean;
|
|
1704
|
+
/** Cells are selected (a `CellSelection`). */
|
|
1705
|
+
cellSelection: boolean;
|
|
1706
|
+
/** Size of the table (0 outside a table). */
|
|
1707
|
+
rows: number;
|
|
1708
|
+
columns: number;
|
|
1709
|
+
/** Row and column (0-based) of the selection's first cell, or -1. */
|
|
1710
|
+
row: number;
|
|
1711
|
+
column: number;
|
|
1712
|
+
/** The first row / first column are all header cells. */
|
|
1713
|
+
headerRow: boolean;
|
|
1714
|
+
headerColumn: boolean;
|
|
1715
|
+
/** The cell at the selection is a header cell. */
|
|
1716
|
+
headerCell: boolean;
|
|
1717
|
+
/** Alignment / background of the cell at the selection. */
|
|
1718
|
+
cellAlignment: TableCellAlignment | null;
|
|
1719
|
+
cellBackground: string | null;
|
|
1720
|
+
/** Enablement of every action (with the default params). */
|
|
1721
|
+
actions: Record<TableAction, TableActionStatus>;
|
|
1722
|
+
}
|
|
1723
|
+
declare const EMPTY_TABLE_STATE: TableState;
|
|
1724
|
+
/** Computes the table state at the editor's selection. */
|
|
1725
|
+
declare function getTableState(editor: Editor | null | undefined): TableState;
|
|
1726
|
+
interface TableStore {
|
|
1727
|
+
getSnapshot(): TableState;
|
|
1728
|
+
subscribe(listener: () => void): () => void;
|
|
1729
|
+
destroy(): void;
|
|
1730
|
+
}
|
|
1731
|
+
/**
|
|
1732
|
+
* An external store of `getTableState(editor)` for UI bindings (React's
|
|
1733
|
+
* `useSyncExternalStore`, Svelte runes). The snapshot object only changes
|
|
1734
|
+
* when the state does, and the store listens to the editor only while it
|
|
1735
|
+
* has subscribers.
|
|
1736
|
+
*/
|
|
1737
|
+
declare function createTableStore(editor: Editor | null | undefined): TableStore;
|
|
1738
|
+
|
|
1739
|
+
interface TableCommandOptions {
|
|
1740
|
+
/** Id prefix (default `table.`). */
|
|
1741
|
+
prefix?: string;
|
|
1742
|
+
group?: string;
|
|
1743
|
+
scope?: string;
|
|
1744
|
+
/** Focus the editor when a command runs (default `true`, for menus and the palette). */
|
|
1745
|
+
focus?: boolean;
|
|
1746
|
+
}
|
|
1747
|
+
/**
|
|
1748
|
+
* Table commands for the command registry (`@pixerate/editor/commands`):
|
|
1749
|
+
* `table.insertTable` (`{ rows, cols, withHeaderRow }`), row and column
|
|
1750
|
+
* insertion/deletion, `table.deleteTable`, `table.mergeCells` /
|
|
1751
|
+
* `table.splitCell`, header toggles, cell navigation and
|
|
1752
|
+
* `table.setCellAlignment` / `table.setCellBackground`. Disabled commands
|
|
1753
|
+
* explain why ("Place the cursor in a table first."). Requires the table
|
|
1754
|
+
* extensions (`createRichTextPreset`'s default `table` option).
|
|
1755
|
+
*/
|
|
1756
|
+
declare function createTableCommands(editor: Editor, options?: TableCommandOptions): CommandSpec[];
|
|
1757
|
+
|
|
1758
|
+
export { type FindOptionToggle as $, type AddCommentOptions as A, BUILT_IN_IMPORT_ADAPTERS as B, CHARACTER_STYLE_MARK_NAME as C, type DocumentImport as D, type CrossReferenceTarget as E, type CrossReferenceTargetType as F, DEFAULT_AUTOCORRECT_EXCEPTIONS as G, DEFAULT_TABLE_OPTIONS as H, DEFAULT_TABLE_TOOLBAR as I, DocumentCompare as J, type DocumentCompareOptions as K, type DocumentCompareStorage as L, type DocumentSearchOptions as M, type DocumentSearchResult as N, type DocumentStructureCommandArgs as O, type PdfStructureReport as P, type DocumentStructureCommandItem as Q, EMPTY_FIND_REPLACE_SNAPSHOT as R, EMPTY_TABLE_STATE as S, type EditorCompareOptions as T, FIND_OPTION_TOGGLES as U, FIND_PARAGRAPH_MARK as V, FileImport as W, type FileImportOptions as X, type FindAllOptions as Y, type FindAllResult as Z, type FindMatch as _, type DocumentImportAdapter as a, SlashCommands as a$, type FindOptions as a0, type FindPatternError as a1, type FindPatternErrorCode as a2, FindReplace as a3, type FindReplaceCommandOptions as a4, type FindReplaceMode as a5, type FindReplaceOptions as a6, type FindReplaceSnapshot as a7, type FindReplaceStorage as a8, FindReplaceStore as a9, type OutlineStore as aA, type OutlineTreeItem as aB, ParagraphStyles as aC, type ParagraphStylesOptions as aD, type ParagraphStylesSnapshot as aE, type ParagraphStylesStorage as aF, type ParagraphStylesStore as aG, type PatternMatch as aH, type PdfLayoutBlock as aI, type PdfLayoutPage as aJ, type PdfLayoutResult as aK, type PdfTableCell as aL, type ReplacePiece as aM, RichClipboard as aN, type RichClipboardOptions as aO, type RichClipboardStorage as aP, type RichTextPresetCommandPackages as aQ, type RichTextPresetOptions as aR, type RichTextTableOptions as aS, type RunTableActionOptions as aT, SMILIE_REPLACEMENTS as aU, STYLE_ID_ATTRIBUTE as aV, type SearchBudget as aW, type SearchBudgetOptions as aX, type SetBookmarkOptions as aY, type SetSearchParams as aZ, type SlashCommandMatchData as a_, type FocusHeadingOptions as aa, FontSize as ab, Footnote as ac, type FootnoteInfo as ad, FootnoteReference as ae, Footnotes as af, type FootnotesOptions as ag, GradientText as ah, type GradientTextOptions as ai, Image as aj, type ImageOptions as ak, type ImportStructureItem as al, type ImportStructureReport as am, type InsertFootnoteOptions as an, type InsertTableOfContentsOptions as ao, LoadingNode as ap, MAX_FIND_PATTERN_LENGTH as aq, MAX_TABLE_COLUMNS as ar, MAX_TABLE_ROWS as as, Markdown as at, type OpenFindReplaceParams as au, Outline as av, type OutlineHeading as aw, type OutlineOptions as ax, type OutlineSnapshot as ay, type OutlineStorage as az, type PdfLayoutOptions as b, getCommentStore as b$, type SlashCommandsOptions as b0, SmilieReplacer as b1, TABLE_ACTIONS as b2, Table as b3, type TableAction as b4, type TableActionInfo as b5, type TableActionParams as b6, type TableActionStatus as b7, TableCell as b8, type TableCellAlignment as b9, createRichTextPreset as bA, createSearchBudget as bB, createTableCommands as bC, createTableExtensions as bD, createTableStore as bE, crossReferencePluginKey as bF, defaultAutocorrectRules as bG, defaultImportRegistry as bH, documentStructureCommandItems as bI, expandReplacement as bJ, fileImportPluginKey as bK, findAllMatches as bL, findAutocorrection as bM, findCommentRanges as bN, findHexColors as bO, findImportAdapter as bP, findReplacePluginKey as bQ, foldCodePoint as bR, footnotesMarkdownIt as bS, footnotesPluginKey as bT, formatFindStatus as bU, fractionRules as bV, getActiveHeading as bW, getBookmarks as bX, getCommentAnchors as bY, getCommentAuthor as bZ, getCommentIdsAt as b_, type TableCommandOptions as ba, TableHeader as bb, TableOfContents as bc, type TableOfContentsEntry as bd, type TableOfContentsOptions as be, TableRow as bf, type TableState as bg, type TableStore as bh, type TableToolbarItem as bi, TemplateSuggestions as bj, type TemplateSuggestionsOptions as bk, analyzePdfLayout as bl, applyDocumentComparison as bm, applyReplacements as bn, autocorrectPluginKey as bo, buildOutlineTree as bp, capitalizeSentenceRules as bq, captureSelectionFormat as br, commentsPluginKey as bs, compareInEditor as bt, compileFindPattern as bu, computeOutline as bv, createFindReplaceCommands as bw, createImportAdapterRegistry as bx, createOutlineStore as by, createParagraphStylesStore as bz, type PdfRuleLine as c, getCrossReferenceTargets as c0, getDocumentStructureCommandItems as c1, getFindReplaceState as c2, getFindReplaceStore as c3, getFootnotes as c4, getImportAccept as c5, getOutline as c6, getParagraphStyleAt as c7, getStyleRegistry as c8, getTableActionState as c9, searchDocument as cA, shouldShowTableBubbleMenu as cB, smartQuoteRules as cC, smilieAutocorrectRules as cD, symbolRules as cE, syncFootnotes as cF, tableOfContentsMarkdownIt as cG, tableOfContentsPluginKey as cH, twoInitialCapitalsRules as cI, unregisterImportAdapter as cJ, updateImageSrc as cK, validateFindPattern as cL, writeRichClipboard as cM, getTableOfContentsEntries as ca, getTableState as cb, handleImageInsertion as cc, htmlImportAdapter as cd, imagePastePluginKey as ce, importFile as cf, insertImageNode as cg, isGfmTable as ch, isInsidePromptToken as ci, isParagraphStyleAvailable as cj, isSelectionInTable as ck, isTableEnabled as cl, markdownImportAdapter as cm, navigateToHeading as cn, normalizeTableCellAlignment as co, normalizeTableCellColor as cp, outlinePluginKey as cq, paragraphStylesPluginKey as cr, parseReplacement as cs, pdfLayoutBlocksToHtml as ct, plainTextImportAdapter as cu, registerImportAdapter as cv, removeImageNode as cw, richClipboardPluginKey as cx, rtfImportAdapter as cy, runTableAction as cz, type PdfTextRun as d, Autocorrect as e, type AutocorrectContext as f, type AutocorrectCorrection as g, type AutocorrectOptions as h, type AutocorrectRule as i, type AutocorrectStorage as j, Bookmark as k, type BookmarkInfo as l, type BookmarkOptions as m, COMMENT_MARK_NAME as n, CharacterStyle as o, ColorHighlighter as p, type CommentRange as q, Comments as r, type CommentsOptions as s, type CommentsStorage as t, type CompileFindPatternResult as u, type CompiledFindPattern as v, type CreateImportAdapterRegistryOptions as w, type CreateStyleFromSelectionOptions as x, CrossReference as y, type CrossReferenceOptions as z };
|