@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.
Files changed (112) hide show
  1. package/README.md +30 -0
  2. package/THIRD_PARTY_NOTICES.md +11 -0
  3. package/dist/agent/index.cjs +174 -11
  4. package/dist/agent/index.cjs.map +1 -1
  5. package/dist/agent/index.d.cts +18 -4
  6. package/dist/agent/index.d.ts +18 -4
  7. package/dist/agent/index.js +167 -4
  8. package/dist/agent/index.js.map +1 -1
  9. package/dist/{arrangeShortcuts-B8O3f8-P.d.cts → arrange-BICutYPk.d.cts} +243 -29
  10. package/dist/{arrangeShortcuts-sLlD2rSX.d.ts → arrange-BICutYPk.d.ts} +243 -29
  11. package/dist/builtins-CdPcLwwF.d.cts +176 -0
  12. package/dist/builtins-Chj6zv_O.d.ts +176 -0
  13. package/dist/canvas/index.cjs +3917 -19
  14. package/dist/canvas/index.cjs.map +1 -1
  15. package/dist/canvas/index.d.cts +1232 -7
  16. package/dist/canvas/index.d.ts +1232 -7
  17. package/dist/canvas/index.js +3916 -18
  18. package/dist/canvas/index.js.map +1 -1
  19. package/dist/chunk-3CC7OPUQ.cjs +831 -0
  20. package/dist/chunk-3CC7OPUQ.cjs.map +1 -0
  21. package/dist/{chunk-AL6JMGWW.cjs → chunk-CS6NZWWA.cjs} +24 -24
  22. package/dist/{chunk-AL6JMGWW.cjs.map → chunk-CS6NZWWA.cjs.map} +1 -1
  23. package/dist/{chunk-C7P22VIP.cjs → chunk-EWCOFSCQ.cjs} +17 -6
  24. package/dist/chunk-EWCOFSCQ.cjs.map +1 -0
  25. package/dist/chunk-HDYMLS3X.cjs +409 -0
  26. package/dist/chunk-HDYMLS3X.cjs.map +1 -0
  27. package/dist/{chunk-X4N4WUKB.cjs → chunk-IFHKKVXH.cjs} +150 -38
  28. package/dist/chunk-IFHKKVXH.cjs.map +1 -0
  29. package/dist/{chunk-ECCCYKGL.js → chunk-JOIREKL7.js} +63 -39
  30. package/dist/chunk-JOIREKL7.js.map +1 -0
  31. package/dist/chunk-KRGXUQ2Y.js +1696 -0
  32. package/dist/chunk-KRGXUQ2Y.js.map +1 -0
  33. package/dist/{chunk-QGYDWPRM.js → chunk-MHEPLBFB.js} +2 -2
  34. package/dist/chunk-MR2764X2.js +831 -0
  35. package/dist/chunk-MR2764X2.js.map +1 -0
  36. package/dist/{chunk-7WISYZFO.cjs → chunk-NFVBT3UZ.cjs} +67 -43
  37. package/dist/chunk-NFVBT3UZ.cjs.map +1 -0
  38. package/dist/{chunk-WSQKHXW7.cjs → chunk-NQF32I6Z.cjs} +1209 -457
  39. package/dist/chunk-NQF32I6Z.cjs.map +1 -0
  40. package/dist/{chunk-IXHSYOVY.js → chunk-Q2OHWD2A.js} +638 -866
  41. package/dist/chunk-Q2OHWD2A.js.map +1 -0
  42. package/dist/{chunk-NAXVVS5I.js → chunk-QJSOZFCZ.js} +2 -2
  43. package/dist/{chunk-V3CHHWOE.cjs → chunk-RRREAOVM.cjs} +4 -4
  44. package/dist/{chunk-V3CHHWOE.cjs.map → chunk-RRREAOVM.cjs.map} +1 -1
  45. package/dist/{chunk-UAKDG62Z.js → chunk-SWE3NPOU.js} +116 -4
  46. package/dist/chunk-SWE3NPOU.js.map +1 -0
  47. package/dist/chunk-TXXNBDQX.cjs +1696 -0
  48. package/dist/chunk-TXXNBDQX.cjs.map +1 -0
  49. package/dist/chunk-UBCFIABU.js +409 -0
  50. package/dist/chunk-UBCFIABU.js.map +1 -0
  51. package/dist/{chunk-RR7F5GUM.js → chunk-X7HXL2SB.js} +941 -189
  52. package/dist/chunk-X7HXL2SB.js.map +1 -0
  53. package/dist/{chunk-PO6A6QQH.cjs → chunk-YOMYSFJU.cjs} +742 -970
  54. package/dist/chunk-YOMYSFJU.cjs.map +1 -0
  55. package/dist/{chunk-FH6F67DN.js → chunk-ZRNHGAQT.js} +17 -6
  56. package/dist/{chunk-FH6F67DN.js.map → chunk-ZRNHGAQT.js.map} +1 -1
  57. package/dist/commands/index.cjs +352 -4
  58. package/dist/commands/index.cjs.map +1 -1
  59. package/dist/commands/index.d.cts +37 -108
  60. package/dist/commands/index.d.ts +37 -108
  61. package/dist/commands/index.js +351 -3
  62. package/dist/commands/index.js.map +1 -1
  63. package/dist/compare/index.cjs +3 -3
  64. package/dist/compare/index.js +2 -2
  65. package/dist/{controller-BIJiNoVs.d.cts → controller-CxXGOEmy.d.cts} +209 -13
  66. package/dist/{controller-BIJiNoVs.d.ts → controller-CxXGOEmy.d.ts} +209 -13
  67. package/dist/export/index.cjs +36 -0
  68. package/dist/export/index.cjs.map +1 -0
  69. package/dist/export/index.d.cts +243 -0
  70. package/dist/export/index.d.ts +243 -0
  71. package/dist/export/index.js +36 -0
  72. package/dist/export/index.js.map +1 -0
  73. package/dist/extensions/index.cjs +54 -6
  74. package/dist/extensions/index.cjs.map +1 -1
  75. package/dist/extensions/index.d.cts +7 -2
  76. package/dist/extensions/index.d.ts +7 -2
  77. package/dist/extensions/index.js +59 -11
  78. package/dist/{index-7a6bHTLy.d.ts → index-B273Zllk.d.ts} +211 -207
  79. package/dist/{index-Csd5qI8u.d.cts → index-jcJwmBYt.d.cts} +211 -207
  80. package/dist/index.cjs +144 -32
  81. package/dist/index.cjs.map +1 -1
  82. package/dist/index.d.cts +49 -13
  83. package/dist/index.d.ts +49 -13
  84. package/dist/index.js +136 -24
  85. package/dist/index.js.map +1 -1
  86. package/dist/registry-CED5C0lA.d.cts +204 -0
  87. package/dist/registry-CED5C0lA.d.ts +204 -0
  88. package/dist/{registry-D32LpIc4.d.cts → registry-D0GADKc7.d.cts} +1 -1
  89. package/dist/{registry-evKTP4ls.d.ts → registry-DhVUZioj.d.ts} +1 -1
  90. package/dist/serializers/index.cjs +4 -4
  91. package/dist/serializers/index.d.cts +2 -1
  92. package/dist/serializers/index.d.ts +2 -1
  93. package/dist/serializers/index.js +3 -3
  94. package/dist/spreadsheet/index.cjs +33 -3
  95. package/dist/spreadsheet/index.cjs.map +1 -1
  96. package/dist/spreadsheet/index.d.cts +106 -3
  97. package/dist/spreadsheet/index.d.ts +106 -3
  98. package/dist/spreadsheet/index.js +32 -2
  99. package/package.json +10 -1
  100. package/dist/chunk-7WISYZFO.cjs.map +0 -1
  101. package/dist/chunk-C7P22VIP.cjs.map +0 -1
  102. package/dist/chunk-ECCCYKGL.js.map +0 -1
  103. package/dist/chunk-IXHSYOVY.js.map +0 -1
  104. package/dist/chunk-PO6A6QQH.cjs.map +0 -1
  105. package/dist/chunk-RR7F5GUM.js.map +0 -1
  106. package/dist/chunk-UAKDG62Z.js.map +0 -1
  107. package/dist/chunk-WSQKHXW7.cjs.map +0 -1
  108. package/dist/chunk-X4N4WUKB.cjs.map +0 -1
  109. package/dist/types-DX4Mh4SL.d.cts +0 -217
  110. package/dist/types-DX4Mh4SL.d.ts +0 -217
  111. /package/dist/{chunk-QGYDWPRM.js.map → chunk-MHEPLBFB.js.map} +0 -0
  112. /package/dist/{chunk-NAXVVS5I.js.map → chunk-QJSOZFCZ.js.map} +0 -0
@@ -3,6 +3,10 @@ import { C as ColorGradient, T as Template } from './tokens-D7yXvUU6.cjs';
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-D_VAPELi.cjs';
17
21
  import { MarkdownOptions } from 'tiptap-markdown';
18
- import { R as ReviewAuthor, b as CommentStore, C as CommentAnchor } from './comment-store-BEMgVlAA.cjs';
22
+ import { R as ReviewAuthor, b as CommentStore, C as CommentAnchor, S as SerializedComments } from './comment-store-BEMgVlAA.cjs';
23
+ import { e as StyleRegistry, c as StyleDefinition, P as ParagraphFormat, C as CharacterFormat } from './registry-CED5C0lA.cjs';
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.cjs';
20
25
  import { b as CompareSource, C as CompareDocumentsOptions, a as CompareDocumentsResult } from './documents-Gp7wb0Me.cjs';
21
- import { c as CommandSpec } from './registry-D32LpIc4.cjs';
26
+ import { C as CommandSpec } from './registry-D0GADKc7.cjs';
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
- export { type FindOptions as $, type AddCommentOptions as A, BUILT_IN_IMPORT_ADAPTERS as B, CHARACTER_STYLE_MARK_NAME as C, type DocumentImport as D, type CrossReferenceOptions as E, type CrossReferenceTarget as F, type CrossReferenceTargetType as G, DEFAULT_AUTOCORRECT_EXCEPTIONS as H, DEFAULT_STYLES 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, type EditorCompareOptions as S, FIND_OPTION_TOGGLES as T, FIND_PARAGRAPH_MARK as U, FileImport as V, type FileImportOptions as W, type FindAllOptions as X, type FindAllResult as Y, type FindMatch as Z, type FindOptionToggle as _, type DocumentImportAdapter as a, SmilieReplacer as a$, type FindPatternError as a0, type FindPatternErrorCode as a1, FindReplace as a2, type FindReplaceCommandOptions as a3, type FindReplaceMode as a4, type FindReplaceOptions as a5, type FindReplaceSnapshot as a6, type FindReplaceStorage as a7, FindReplaceStore as a8, type FocusHeadingOptions as a9, type ParagraphFormat as aA, ParagraphStyles as aB, type ParagraphStylesOptions as aC, type ParagraphStylesSnapshot as aD, type ParagraphStylesStorage as aE, type ParagraphStylesStore as aF, type PatternMatch as aG, type PdfLayoutBlock as aH, type PdfLayoutPage as aI, type PdfLayoutResult as aJ, type PdfTableCell as aK, type ReplacePiece as aL, type ResolvedStyle as aM, RichClipboard as aN, type RichClipboardOptions as aO, type RichClipboardStorage as aP, type RichTextPresetCommandPackages as aQ, type RichTextPresetOptions as aR, SMILIE_REPLACEMENTS as aS, STYLE_ID_ATTRIBUTE as aT, type SearchBudget as aU, type SearchBudgetOptions as aV, type SetBookmarkOptions as aW, type SetSearchParams as aX, type SlashCommandMatchData as aY, SlashCommands as aZ, type SlashCommandsOptions as a_, FontSize as aa, Footnote as ab, type FootnoteInfo as ac, FootnoteReference as ad, Footnotes as ae, type FootnotesOptions as af, GradientText as ag, type GradientTextOptions as ah, Image as ai, type ImageOptions as aj, type ImportStructureItem as ak, type ImportStructureReport as al, type InsertFootnoteOptions as am, type InsertTableOfContentsOptions as an, LoadingNode as ao, MAX_FIND_PATTERN_LENGTH as ap, Markdown as aq, NORMAL_STYLE_ID as ar, type OpenFindReplaceParams as as, Outline as at, type OutlineHeading as au, type OutlineOptions as av, type OutlineSnapshot as aw, type OutlineStorage as ax, type OutlineStore as ay, type OutlineTreeItem as az, type PdfLayoutOptions as b, getStyleRegistry as b$, type StyleBlock as b0, type StyleCSSOptions as b1, type StyleDefaults as b2, type StyleDefinition as b3, type StyleKind as b4, StyleRegistry as b5, type StyleRegistryJSON as b6, type StyleRegistryOptions as b7, type StyleRegistrySnapshot as b8, TableOfContents as b9, expandReplacement as bA, fileImportPluginKey as bB, findAllMatches as bC, findAutocorrection as bD, findCommentRanges as bE, findHexColors as bF, findImportAdapter as bG, findReplacePluginKey as bH, foldCodePoint as bI, footnotesMarkdownIt as bJ, footnotesPluginKey as bK, formatFindStatus as bL, fractionRules as bM, getActiveHeading as bN, getBookmarks as bO, getCommentAnchors as bP, getCommentAuthor as bQ, getCommentIdsAt as bR, getCommentStore as bS, getCrossReferenceTargets as bT, getDocumentStructureCommandItems as bU, getFindReplaceState as bV, getFindReplaceStore as bW, getFootnotes as bX, getImportAccept as bY, getOutline as bZ, getParagraphStyleAt as b_, type TableOfContentsEntry as ba, type TableOfContentsOptions as bb, TemplateSuggestions as bc, type TemplateSuggestionsOptions as bd, analyzePdfLayout as be, applyDocumentComparison as bf, applyReplacements as bg, autocorrectPluginKey as bh, buildOutlineTree as bi, capitalizeSentenceRules as bj, captureSelectionFormat as bk, commentsPluginKey as bl, compareInEditor as bm, compileFindPattern as bn, computeOutline as bo, createFindReplaceCommands as bp, createImportAdapterRegistry as bq, createOutlineStore as br, createParagraphStylesStore as bs, createRichTextPreset as bt, createSearchBudget as bu, createStyleRegistry as bv, crossReferencePluginKey as bw, defaultAutocorrectRules as bx, defaultImportRegistry as by, documentStructureCommandItems as bz, type PdfRuleLine as c, getTableOfContentsEntries as c0, handleImageInsertion as c1, htmlImportAdapter as c2, imagePastePluginKey as c3, importFile as c4, insertImageNode as c5, isInsidePromptToken as c6, isParagraphStyleAvailable as c7, isValidStyleId as c8, markdownImportAdapter as c9, navigateToHeading as ca, outlinePluginKey as cb, paragraphStylesPluginKey as cc, parseReplacement as cd, pdfLayoutBlocksToHtml as ce, plainTextImportAdapter as cf, registerImportAdapter as cg, removeImageNode as ch, richClipboardPluginKey as ci, rtfImportAdapter as cj, safeCSSValue as ck, searchDocument as cl, smartQuoteRules as cm, smilieAutocorrectRules as cn, symbolRules as co, syncFootnotes as cp, tableOfContentsMarkdownIt as cq, tableOfContentsPluginKey as cr, twoInitialCapitalsRules as cs, unregisterImportAdapter as ct, updateImageSrc as cu, validateFindPattern as cv, writeRichClipboard as cw, 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, type CharacterFormat as o, CharacterStyle as p, ColorHighlighter as q, type CommentRange as r, Comments as s, type CommentsOptions as t, type CommentsStorage as u, type CompileFindPatternResult as v, type CompiledFindPattern as w, type CreateImportAdapterRegistryOptions as x, type CreateStyleFromSelectionOptions as y, CrossReference as z };
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 };