@lax-wp/editor 0.4.4 → 0.4.7
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/dist/components/redline/RedlineItem.d.ts +31 -3
- package/dist/config/EditorConfig.d.ts +1 -0
- package/dist/constants/Extensions.d.ts +1 -0
- package/dist/constants/Fonts.d.ts +1 -0
- package/dist/editor.css +1 -1
- package/dist/extensions/DividerRedline.d.ts +2 -0
- package/dist/extensions/ImageRedline.d.ts +2 -0
- package/dist/extensions/marks/AIDeletion.d.ts +3 -0
- package/dist/extensions/marks/AIInsertion.d.ts +3 -0
- package/dist/extensions/marks/UserDeletion.d.ts +3 -0
- package/dist/extensions/marks/UserInsertion.d.ts +3 -0
- package/dist/extensions/marks/shared.d.ts +3 -0
- package/dist/extensions/plugins/CellFormatTrackingPlugin.d.ts +2 -0
- package/dist/extensions/plugins/DividerTrackingPlugin.d.ts +2 -0
- package/dist/extensions/plugins/ImageTrackingPlugin.d.ts +2 -0
- package/dist/extensions/plugins/MarkHighlightPlugin.d.ts +2 -3
- package/dist/extensions/plugins/TableTrackingPlugin.d.ts +11 -0
- package/dist/extensions/plugins/redlineSharedMeta.d.ts +7 -0
- package/dist/hooks/useRedline.d.ts +3 -3
- package/dist/hooks/useRedlinePanel.d.ts +2 -2
- package/dist/index.es.js +14252 -13022
- package/dist/index.umd.js +103 -102
- package/dist/utils/tableRedlineHelpers.d.ts +59 -0
- package/package.json +1 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared guard/helper functions for table redline tracking.
|
|
3
|
+
* Imported by useTableMethods, TableTrackingPlugin, CellFormatTrackingPlugin,
|
|
4
|
+
* and RedlinePlugin.
|
|
5
|
+
*/
|
|
6
|
+
import type { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
7
|
+
import type { Transaction } from '@tiptap/pm/state';
|
|
8
|
+
export declare function createRedlineId(): string;
|
|
9
|
+
export declare function shouldTrackTableChange(editor: {
|
|
10
|
+
storage?: any;
|
|
11
|
+
}, tr: Transaction, options?: {
|
|
12
|
+
allowPaste?: boolean;
|
|
13
|
+
}): boolean;
|
|
14
|
+
export declare function shouldTrackFromTransactions(editor: {
|
|
15
|
+
storage?: any;
|
|
16
|
+
}, transactions: readonly Transaction[]): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Returns true if the position is inside a table that is itself pending
|
|
19
|
+
* (has data-redline-type set, meaning the whole table is a tracked change).
|
|
20
|
+
* When the parent table is pending, no child changes should be tracked separately.
|
|
21
|
+
*/
|
|
22
|
+
export declare function isInsidePendingTable(doc: ProseMirrorNode, pos: number): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Returns true if the position is inside a pending-insertion row
|
|
25
|
+
* (data-redline-row-action = 'add'). Used to suppress cell content tracking
|
|
26
|
+
* inside newly added pending rows.
|
|
27
|
+
*/
|
|
28
|
+
export declare function isInsidePendingRow(doc: ProseMirrorNode, pos: number): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Returns true if the position is inside a pending-insertion or
|
|
31
|
+
* pending-deletion column cell (data-redline-column-action set).
|
|
32
|
+
* Used to suppress cell content tracking inside pending column cells.
|
|
33
|
+
*/
|
|
34
|
+
export declare function isInsidePendingColumn(doc: ProseMirrorNode, pos: number): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Returns the 0-based row index of rowPos within the table at tablePos.
|
|
37
|
+
* Returns -1 if not found.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getRowIndex(doc: ProseMirrorNode, tablePos: number, rowPos: number): number;
|
|
40
|
+
/**
|
|
41
|
+
* Collects all table nodes from the document as a map of pos → node.
|
|
42
|
+
*/
|
|
43
|
+
export declare function collectTables(doc: ProseMirrorNode): Map<number, ProseMirrorNode>;
|
|
44
|
+
/**
|
|
45
|
+
* Collects all tableRow nodes from the document, mapped by pos.
|
|
46
|
+
*/
|
|
47
|
+
export declare function collectRows(doc: ProseMirrorNode): Map<number, {
|
|
48
|
+
node: ProseMirrorNode;
|
|
49
|
+
tablePos: number;
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* Sorts table-level changes for safe processing order (no position drift).
|
|
53
|
+
* Order: table → column → row → cell, reverse document order within each group.
|
|
54
|
+
*/
|
|
55
|
+
export declare function sortTableChangesForProcessing<T extends {
|
|
56
|
+
nodeType?: string;
|
|
57
|
+
action?: string;
|
|
58
|
+
from?: number;
|
|
59
|
+
}>(changes: T[]): T[];
|