@univerjs-pro/docs-table 1.0.0-alpha.2 → 1.0.0-alpha.3

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.
@@ -1,8 +1,9 @@
1
- import type { ICommand } from '@univerjs/core';
1
+ import type { ICommand, TableRowHeightRule } from '@univerjs/core';
2
2
  import type { IDocsTableSegmentOptions } from '../common/type';
3
3
  export interface IDocsTableResizeRowCommandParams extends IDocsTableSegmentOptions {
4
4
  tableId?: string;
5
5
  row?: number;
6
6
  height: number;
7
+ hRule?: TableRowHeightRule;
7
8
  }
8
9
  export declare const DocsTableResizeRowCommand: ICommand<IDocsTableResizeRowCommandParams>;
@@ -1,4 +1,4 @@
1
- import type { ICommand } from '@univerjs/core';
1
+ import type { ICommand, IDocumentData, JSONXActions } from '@univerjs/core';
2
2
  import type { IDocsTableCellRange, IDocsTableSegmentOptions } from '../common/type';
3
3
  import { DocsTableSelectionService } from '../services/docs-table-selection.service';
4
4
  export interface IDocsTableSetTableBackgroundCommandParams extends Partial<IDocsTableCellRange>, IDocsTableSegmentOptions {
@@ -8,3 +8,7 @@ export interface IDocsTableSetTableBackgroundCommandParams extends Partial<IDocs
8
8
  }
9
9
  export declare const DocsTableSetTableBackgroundCommand: ICommand<IDocsTableSetTableBackgroundCommandParams>;
10
10
  export declare function getStableTableStyleSelection(selectionService: DocsTableSelectionService): import("@univerjs/core").Nullable<import("..").IDocsTableSelection>;
11
+ export declare function buildSetTableBackgroundMutationActions(documentData: IDocumentData, params: Partial<IDocsTableCellRange> & {
12
+ tableId: string;
13
+ value: string | null;
14
+ }): JSONXActions | null;
@@ -1,7 +1,11 @@
1
- import type { ICommand, VerticalAlignmentType } from '@univerjs/core';
1
+ import type { ICommand, IDocumentData, JSONXActions, VerticalAlignmentType } from '@univerjs/core';
2
2
  import type { IDocsTableCellRange, IDocsTableSegmentOptions } from '../common/type';
3
3
  export interface IDocsTableSetTableVerticalAlignCommandParams extends Partial<IDocsTableCellRange>, IDocsTableSegmentOptions {
4
4
  tableId?: string;
5
5
  value: VerticalAlignmentType;
6
6
  }
7
7
  export declare const DocsTableSetTableVerticalAlignCommand: ICommand<IDocsTableSetTableVerticalAlignCommandParams>;
8
+ export declare function buildSetTableVerticalAlignMutationActions(documentData: IDocumentData, params: IDocsTableCellRange & {
9
+ tableId: string;
10
+ value: VerticalAlignmentType;
11
+ }): JSONXActions | null;
@@ -1,6 +1,9 @@
1
- import type { DocumentDataModel, ICommandService, IDocumentData, JSONXActions } from '@univerjs/core';
1
+ import type { DocumentDataModel, ICommandService, IDocumentData, ITableRow, JSONXActions } from '@univerjs/core';
2
2
  import type { IRectRangeWithStyle } from '@univerjs/engine-render';
3
- import type { IDocsTableCellRange } from '../common/type';
3
+ import type { DocsTableColumnInsertPosition, DocsTableRowInsertPosition } from '../common/actions';
4
+ import type { DocsTableSortDirection } from '../common/sort';
5
+ import type { IDocsTableCellRange, IDocsTableMetadataResource } from '../common/type';
6
+ import { TableRowHeightRule } from '@univerjs/core';
4
7
  export interface IDocsTableMutationSelection extends IDocsTableCellRange {
5
8
  tableId: string;
6
9
  segmentId?: string;
@@ -12,6 +15,42 @@ export declare function getTableCommandSegmentId(params?: {
12
15
  } | null | void): string;
13
16
  export declare function getTableCommandRange(params?: Partial<IDocsTableCellRange> | null | void, selection?: Partial<IDocsTableCellRange> | null | void): IDocsTableCellRange | null;
14
17
  export declare function getTableActionDocumentData(doc: DocumentDataModel, segmentId?: string): IDocumentData | null;
15
- export declare function buildReplaceDocumentTableActions(previousDocumentData: IDocumentData, nextDocumentData: IDocumentData, segmentId?: string): JSONXActions | null;
16
- export declare function executeRichTextTableMutation(commandService: ICommandService, unitId: string, previousDocumentData: IDocumentData, nextDocumentData: IDocumentData, selection?: IDocsTableMutationSelection, segmentId?: string): boolean;
18
+ export declare function buildMoveFloatingTableActions(previousDocumentData: IDocumentData, nextDocumentData: IDocumentData, tableId: string): JSONXActions | null;
19
+ export declare function buildResizeTableColumnActions(previousDocumentData: IDocumentData, nextDocumentData: IDocumentData, tableId: string, column: number): JSONXActions | null;
20
+ export declare function buildResizeTableColumnActionsFromWidth(documentData: IDocumentData, tableId: string, column: number, width: number): JSONXActions | null;
21
+ export declare function buildResizeTableRowActions(previousDocumentData: IDocumentData, nextDocumentData: IDocumentData, tableId: string, row: number): JSONXActions | null;
22
+ export declare function buildMoveFloatingTableMutationActions(documentData: IDocumentData, tableId: string, deltaX: number, deltaY: number): JSONXActions | null;
23
+ export declare function buildMoveTableToOffsetMutationActions(documentData: IDocumentData, tableId: string, requestedTargetOffset: number, bodyPath?: string[]): JSONXActions | null;
24
+ export declare function buildResizeTableRowActionsFromHeight(documentData: IDocumentData, tableId: string, row: number, height: number, hRule?: TableRowHeightRule): JSONXActions | null;
25
+ export declare function buildDistributeTableRowsMutationActions(documentData: IDocumentData, tableId: string, startRow: number, endRow: number): JSONXActions | null;
26
+ export declare function buildDistributeTableColumnsMutationActions(documentData: IDocumentData, tableId: string, startColumn: number, endColumn: number): JSONXActions | null;
27
+ export declare function buildSetTableHeaderRowCountMutationActions(documentData: IDocumentData, tableId: string, requestedHeaderRowCount: number): {
28
+ actions: JSONXActions | null;
29
+ headerRowCount: number;
30
+ } | null;
31
+ export interface IDocsTableRowsMutationActionResult {
32
+ actions: JSONXActions | null;
33
+ cursorRow: number;
34
+ deleteTable?: boolean;
35
+ }
36
+ export interface IDocsTableColumnsMutationActionResult {
37
+ actions: JSONXActions | null;
38
+ cursorColumn: number;
39
+ deleteTable?: boolean;
40
+ }
41
+ export declare function buildInsertTableColumnsMutationActions(documentData: IDocumentData, tableId: string, column: number, count: number, position: DocsTableColumnInsertPosition, options?: {
42
+ bodyPath?: string[];
43
+ insertedColumnWidth?: number;
44
+ preserveTotalWidth?: boolean;
45
+ }): IDocsTableColumnsMutationActionResult | null;
46
+ export declare function buildDeleteTableColumnsMutationActions(documentData: IDocumentData, tableId: string, startColumn: number, endColumn: number, bodyPath?: string[]): IDocsTableColumnsMutationActionResult | null;
47
+ export declare function buildMoveTableRowsMutationActions(documentData: IDocumentData, tableId: string, fromRow: number, toRow: number, count: number, position: DocsTableRowInsertPosition, bodyPath?: string[]): IDocsTableRowsMutationActionResult | null;
48
+ export declare function buildMoveTableColumnsMutationActions(documentData: IDocumentData, tableId: string, fromColumn: number, toColumn: number, count: number, position: DocsTableColumnInsertPosition, bodyPath?: string[]): IDocsTableColumnsMutationActionResult | null;
49
+ export declare function buildSortTableMutationActions(documentData: IDocumentData, metadata: IDocsTableMetadataResource | undefined, tableId: string, column: number, direction: DocsTableSortDirection, bodyPath?: string[]): JSONXActions | null;
50
+ export declare function buildInsertTableRowsMutationActions(documentData: IDocumentData, tableId: string, row: number, count: number, position: DocsTableRowInsertPosition, bodyPath?: string[], configureInsertedRow?: (row: ITableRow, index: number) => void): IDocsTableRowsMutationActionResult | null;
51
+ export declare function buildInsertTableTitleRowMutationActions(documentData: IDocumentData, tableId: string, bodyPath?: string[]): IDocsTableRowsMutationActionResult | null;
52
+ export declare function buildDeleteTableRowsMutationActions(documentData: IDocumentData, tableId: string, startRow: number, endRow: number, bodyPath?: string[]): IDocsTableRowsMutationActionResult | null;
53
+ export declare function buildDeleteTableMutationActions(documentData: IDocumentData, tableId: string, bodyPath: string[]): IDocsTableRowsMutationActionResult | null;
54
+ export declare function executeRichTextTableActions(commandService: ICommandService, unitId: string, documentData: IDocumentData, actions: JSONXActions | null, selection?: IDocsTableMutationSelection, cursorOffset?: number, trigger?: string): boolean;
55
+ export declare function getTableActionBodyPath(documentData: IDocumentData, segmentId?: string): string[];
17
56
  export declare function buildTableRectMutationRanges(documentData: IDocumentData, selection: IDocsTableMutationSelection): IRectRangeWithStyle[];
@@ -1,4 +1,4 @@
1
- import type { IDocumentData, ITableCellBorder } from '@univerjs/core';
1
+ import type { IDocumentData, ITableCellBorder, JSONXActions } from '@univerjs/core';
2
2
  import type { IDocsTableCellRange } from './type';
3
3
  export declare enum DocsTableBorderPreset {
4
4
  All = "all",
@@ -35,5 +35,7 @@ export interface IUpdateTableBorderStyleActionParams extends IDocsTableCellRange
35
35
  border: TTableBorderStylePatch;
36
36
  }
37
37
  export declare function buildSetTableBorderActions(params: ISetTableBorderActionParams): ISetTableBorderActionResult;
38
+ export declare function buildSetTableBorderMutationActions(params: ISetTableBorderActionParams): JSONXActions | null;
38
39
  export declare function buildSetTableCellBackgroundActions(params: ISetTableCellBackgroundActionParams): ISetTableBorderActionResult;
39
40
  export declare function buildUpdateTableBorderStyleActions(params: IUpdateTableBorderStyleActionParams): ISetTableBorderActionResult;
41
+ export declare function buildUpdateTableBorderStyleMutationActions(params: IUpdateTableBorderStyleActionParams): JSONXActions | null;
@@ -1,4 +1,4 @@
1
- import type { IDocumentData } from '@univerjs/core';
1
+ import type { IDocumentData, JSONXActions } from '@univerjs/core';
2
2
  export interface ISetTableCellTextActionParams {
3
3
  documentData: IDocumentData;
4
4
  tableId: string;
@@ -9,4 +9,11 @@ export interface ISetTableCellTextActionParams {
9
9
  export interface ISetTableCellTextActionResult {
10
10
  nextDocumentData: IDocumentData;
11
11
  }
12
+ export interface ITableTextReplacement {
13
+ endOffset: number;
14
+ startOffset: number;
15
+ text: string;
16
+ }
17
+ export declare function buildSetTableCellTextMutationActions(params: ISetTableCellTextActionParams, bodyPath?: string[]): JSONXActions | null;
18
+ export declare function buildTableTextReplacementMutationActions(documentData: IDocumentData, replacements: ITableTextReplacement[], bodyPath?: string[]): JSONXActions | null;
12
19
  export declare function buildSetTableCellTextActions(params: ISetTableCellTextActionParams): ISetTableCellTextActionResult;
@@ -1,4 +1,4 @@
1
- import type { IDocumentData } from '@univerjs/core';
1
+ import type { IDocumentData, JSONXActions } from '@univerjs/core';
2
2
  import type { IDocsTableCellRange } from './type';
3
3
  export interface ITableClipboardParams extends IDocsTableCellRange {
4
4
  documentData: IDocumentData;
@@ -36,5 +36,6 @@ export declare function parseHtmlTablesClipboard(html: string): IParsedHtmlTable
36
36
  export declare function serializeTableSelectionAsPlainText(params: ITableClipboardParams): string;
37
37
  export declare function serializeTableSelectionAsHtml(params: ITableClipboardParams): string;
38
38
  export declare function buildPastePlainTextTableActions(params: IPastePlainTextTableParams): IPastePlainTextTableResult;
39
+ export declare function buildPastePlainTextTableMutationActions(params: IPastePlainTextTableParams, bodyPath?: string[]): JSONXActions | null;
39
40
  export declare function buildPasteHtmlTableActions(params: IPasteHtmlTableParams): IPasteHtmlTableResult;
40
41
  export declare function parseHtmlTableClipboard(html: string): IParsedHtmlTableClipboard;
@@ -0,0 +1,7 @@
1
+ import type { IDocumentData } from '@univerjs/core';
2
+ interface IEditableDocumentCopyOptions {
3
+ cloneBody?: boolean;
4
+ tableIds?: string[];
5
+ }
6
+ export declare function createEditableDocumentDataCopy(documentData: IDocumentData, options?: IEditableDocumentCopyOptions): IDocumentData;
7
+ export {};
@@ -1,4 +1,4 @@
1
- import type { IDocumentData } from '@univerjs/core';
1
+ import type { IDocumentData, ITableCellMargin, JSONXActions } from '@univerjs/core';
2
2
  import type { IDocsTableColumnTypeConfig, IDocsTableMetadataResource } from './type';
3
3
  export declare enum DocsTableInsertTablePosition {
4
4
  Selection = "selection",
@@ -46,6 +46,10 @@ export interface IDocsTableInsertOptions {
46
46
  * and rows use the `AT_LEAST` height rule.
47
47
  */
48
48
  rowHeights?: number[];
49
+ /**
50
+ * Default margin inherited by cells that do not define their own margin override.
51
+ */
52
+ cellMargin?: ITableCellMargin;
49
53
  /**
50
54
  * Whether the first row is a title row. A title row spans the first cell across
51
55
  * all columns and stores the flag in docs table metadata.
@@ -79,4 +83,11 @@ export interface IDocsTableInsertActionResult {
79
83
  nextMetadata: IDocsTableMetadataResource;
80
84
  tableId: string;
81
85
  }
86
+ export interface IDocsTableInsertMutationActionResult {
87
+ actions: JSONXActions;
88
+ cursorOffset: number;
89
+ nextMetadata: IDocsTableMetadataResource;
90
+ tableId: string;
91
+ }
82
92
  export declare function buildInsertTableActions(params: IDocsTableInsertActionParams): IDocsTableInsertActionResult;
93
+ export declare function buildInsertTableMutationActionsDirect(params: IDocsTableInsertActionParams, bodyPath?: string[]): IDocsTableInsertMutationActionResult;
@@ -0,0 +1,10 @@
1
+ import type { IDocumentData, ITableCellMargin, JSONXActions, Nullable } from '@univerjs/core';
2
+ import type { IDocsTableCellRange } from './type';
3
+ export declare const DEFAULT_DOCS_TABLE_CELL_MARGIN: ITableCellMargin;
4
+ export interface ISetTableCellMarginMutationParams extends IDocsTableCellRange {
5
+ documentData: IDocumentData;
6
+ tableId: string;
7
+ margin: Nullable<ITableCellMargin>;
8
+ }
9
+ export declare function buildSetTableCellMarginMutationActions(params: ISetTableCellMarginMutationParams): JSONXActions | null;
10
+ export declare function buildSetTableDefaultCellMarginMutationActions(documentData: IDocumentData, tableId: string, margin: Nullable<ITableCellMargin>): JSONXActions | null;
@@ -1,4 +1,4 @@
1
- import type { IDocumentData, ITable } from '@univerjs/core';
1
+ import type { IDocumentData, ITable, JSONXActions } from '@univerjs/core';
2
2
  import type { IDocsTableCellRange } from './type';
3
3
  export interface IDocsTableMergeActionParams extends IDocsTableCellRange {
4
4
  documentData: IDocumentData;
@@ -8,10 +8,16 @@ export interface IDocsTableMergeActionResult {
8
8
  nextDocumentData: IDocumentData;
9
9
  range: IDocsTableCellRange;
10
10
  }
11
+ export interface IDocsTableMergeMutationActionResult {
12
+ actions: JSONXActions | null;
13
+ range: IDocsTableCellRange;
14
+ }
11
15
  export declare function canMergeCells(documentData: IDocumentData, tableId: string, range: IDocsTableCellRange): boolean;
12
16
  export declare function canUnmergeCells(documentData: IDocumentData, tableId: string, range: IDocsTableCellRange): boolean;
13
17
  export declare function buildMergeCellsActions(params: IDocsTableMergeActionParams): IDocsTableMergeActionResult;
18
+ export declare function buildMergeCellsMutationActions(params: IDocsTableMergeActionParams): IDocsTableMergeMutationActionResult | null;
14
19
  export declare function buildUnmergeCellsActions(params: IDocsTableMergeActionParams): IDocsTableMergeActionResult;
20
+ export declare function buildUnmergeCellsMutationActions(params: IDocsTableMergeActionParams): IDocsTableMergeMutationActionResult | null;
15
21
  export declare function findMergeRange(table: ITable, row: number, column: number): IDocsTableCellRange | null;
16
22
  export declare function expandRangeByMergedCells(table: ITable, range: IDocsTableCellRange): IDocsTableCellRange;
17
23
  export declare function updateMergedCellsForInsertRows(table: ITable, insertIndex: number, count: number, ranges?: IDocsTableCellRange[]): void;
@@ -14,4 +14,9 @@ export interface ISortTableActionParams {
14
14
  export interface ISortTableActionResult {
15
15
  nextDocumentData: IDocumentData;
16
16
  }
17
+ export interface IDocsTableSortPlan {
18
+ sortStartRow: number;
19
+ sortedRowIndexes: number[];
20
+ }
17
21
  export declare function buildSortTableActions(params: ISortTableActionParams): ISortTableActionResult;
22
+ export declare function buildTableSortPlan(params: ISortTableActionParams): IDocsTableSortPlan;
@@ -1,3 +1,2 @@
1
1
  import type { IDocumentData } from '@univerjs/core';
2
- export declare function createThreeByThreeTableDocument(): IDocumentData;
3
2
  export declare function createThreeByThreeTableDocumentWithValues(values?: string[][]): IDocumentData;
@@ -2,12 +2,16 @@ import type { IDocumentData, ITable } from '@univerjs/core';
2
2
  export interface IDocsTableCellOffsetRange {
3
3
  row: number;
4
4
  column: number;
5
+ /** Inclusive offset of `TABLE_CELL_START`. */
5
6
  startOffset: number;
7
+ /** Inclusive offset of the matching `TABLE_CELL_END`. */
6
8
  endOffset: number;
7
9
  }
8
10
  export interface IDocsTableRowOffsetRange {
9
11
  row: number;
12
+ /** Inclusive offset of `TABLE_ROW_START`. */
10
13
  startOffset: number;
14
+ /** Inclusive offset of the matching `TABLE_ROW_END`. */
11
15
  endOffset: number;
12
16
  cells: IDocsTableCellOffsetRange[];
13
17
  }
@@ -19,7 +23,9 @@ export interface IDocsTableColumnOffsetRange {
19
23
  }
20
24
  export interface IDocsTableOffsetRange {
21
25
  tableId: string;
26
+ /** Inclusive offset of `TABLE_START`. */
22
27
  startOffset: number;
28
+ /** Exclusive offset immediately after `TABLE_END`. */
23
29
  endOffset: number;
24
30
  rowCount: number;
25
31
  columnCount: number;
@@ -1,3 +1,4 @@
1
+ import type { ITableCellMargin } from '@univerjs/core';
1
2
  import type { FDocumentTable } from './f-document-table';
2
3
  import type { IDocsTableBorderOptions, IDocsTableCellContentRange } from './types';
3
4
  /**
@@ -88,6 +89,17 @@ export declare class FDocumentTableCell {
88
89
  * ```
89
90
  */
90
91
  getInsertOffset(): number | null;
92
+ /**
93
+ * Returns the effective margin used to lay out this cell.
94
+ * Cell overrides take precedence over the table default and the built-in fallback.
95
+ */
96
+ getMargin(): ITableCellMargin | null;
97
+ /** Returns this cell's explicit margin override, or `null` when it inherits. */
98
+ getMarginOverride(): ITableCellMargin | null;
99
+ /** Sets this cell's explicit margin override. */
100
+ setMargin(margin: ITableCellMargin): boolean;
101
+ /** Removes this cell's explicit margin override so it inherits from the table. */
102
+ clearMarginOverride(): boolean;
91
103
  /**
92
104
  * Replaces the cell text.
93
105
  * @param {string} text The new cell text.
@@ -1,8 +1,9 @@
1
1
  import type { DocsTableColumnInsertPosition, DocsTableRowInsertPosition, DocsTableSortDirection, IDocsTableCellRange, IDocsTableColumnTypeConfig, IDocsTableMetadata, IDocsTableOffsetRange } from '@univerjs-pro/docs-table';
2
- import type { Injector, ITable } from '@univerjs/core';
2
+ import type { Injector, ITable, ITableCellMargin, ITableRowSize, Nullable } from '@univerjs/core';
3
3
  import type { FDocument } from '@univerjs/docs/facade';
4
4
  import type { IDocsTableBorderOptions, IDocsTableCellContentRange, IDocsTableDescription, IDocsTableInfo, IDocsTableStyle } from './types';
5
5
  import { DocsTableSelectionKind } from '@univerjs-pro/docs-table';
6
+ import { TableRowHeightRule } from '@univerjs/core';
6
7
  import { FDocumentTableCell } from './f-document-table-cell';
7
8
  /**
8
9
  * Facade object for a single enhanced docs table.
@@ -123,6 +124,25 @@ export declare class FDocumentTable {
123
124
  * ```
124
125
  */
125
126
  getCellText(row: number, column: number): string;
127
+ /**
128
+ * Returns the effective margin used to lay out a cell.
129
+ * The cell override takes precedence over the table default and the built-in fallback.
130
+ * @param {number} row The zero-based row index.
131
+ * @param {number} column The zero-based column index.
132
+ * @returns {ITableCellMargin | null} The effective margin, or `null` if the cell does not exist.
133
+ */
134
+ getCellMargin(row: number, column: number): ITableCellMargin | null;
135
+ /**
136
+ * Returns a cell's explicit margin override.
137
+ * @param {number} row The zero-based row index.
138
+ * @param {number} column The zero-based column index.
139
+ * @returns {ITableCellMargin | null} The explicit override, or `null` if the cell inherits its margin.
140
+ */
141
+ getCellMarginOverride(row: number, column: number): ITableCellMargin | null;
142
+ /** Returns the effective table-level default cell margin. */
143
+ getDefaultCellMargin(): ITableCellMargin;
144
+ /** Returns the explicit table-level default cell margin, or `null` when the built-in fallback is used. */
145
+ getDefaultCellMarginOverride(): ITableCellMargin | null;
126
146
  /**
127
147
  * Gets the table metadata stored in the document snapshot, including header row count, title row, and column type configs.
128
148
  * @returns {IDocsTableMetadata | undefined} The table metadata, or `undefined` if the table source is not found in the document snapshot.
@@ -147,7 +167,7 @@ export declare class FDocumentTable {
147
167
  getSource(): ITable | undefined;
148
168
  /**
149
169
  * Gets the table range with offsets for all cells in the table.
150
- * @returns {IDocsTableOffsetRange} The table range with offsets, or `null` if the table source is not found in the document snapshot.
170
+ * @returns {IDocsTableOffsetRange | null} The table range with offsets, or `null` if the table source is not found in the document snapshot.
151
171
  * @example
152
172
  * ```ts
153
173
  * const fDocument = univerAPI.getActiveDocument();
@@ -698,6 +718,21 @@ export declare class FDocumentTable {
698
718
  * ```
699
719
  */
700
720
  setCellBackground(range: IDocsTableCellRange, color: string): boolean;
721
+ /**
722
+ * Sets or clears the explicit margin override for a range of cells.
723
+ * Pass `null` to make the cells inherit the table default.
724
+ * @param {IDocsTableCellRange} range The target cell range.
725
+ * @param {ITableCellMargin | null} margin The margin override, or `null` to clear it.
726
+ * @returns {boolean} Whether the mutation succeeded.
727
+ */
728
+ setCellMargin(range: IDocsTableCellRange, margin: Nullable<ITableCellMargin>): boolean;
729
+ /**
730
+ * Sets or clears the table-level default cell margin.
731
+ * Pass `null` to restore the built-in fallback.
732
+ * @param {ITableCellMargin | null} margin The table default, or `null` to clear it.
733
+ * @returns {boolean} Whether the mutation succeeded.
734
+ */
735
+ setDefaultCellMargin(margin: Nullable<ITableCellMargin>): boolean;
701
736
  /**
702
737
  * Sets the border properties for a range of cells in the table.
703
738
  * @param {IDocsTableCellRange} range The range of cells to set the border for.
@@ -810,7 +845,9 @@ export declare class FDocumentTable {
810
845
  * table?.setRowHeight(1, 30); // Sets the height of row 1 to 30 units
811
846
  * ```
812
847
  */
813
- setRowHeight(row: number, height: number): boolean;
848
+ setRowHeight(row: number, height: number, hRule?: TableRowHeightRule): boolean;
849
+ /** Returns the row height value and its OOXML height rule. */
850
+ getRowHeight(row: number): ITableRowSize | null;
814
851
  /**
815
852
  * Sets the width of a specific column in the table.
816
853
  * @param {number} column The zero-based column index to set the width for.
@@ -943,5 +980,6 @@ export declare class FDocumentTable {
943
980
  sortByColumn(column: number, direction: DocsTableSortDirection): boolean;
944
981
  private _getDocumentData;
945
982
  private _serializeModel;
946
- private _mutate;
983
+ private _getBodyPath;
984
+ private _mutateActions;
947
985
  }
@@ -1,86 +1,46 @@
1
- export { DocsTableCopySelectionCommand } from './commands/copy-selection.command';
2
- export type { IDocsTableCopySelectionCommandParams } from './commands/copy-selection.command';
3
1
  export { DocsTableDeleteColumnsCommand } from './commands/delete-columns.command';
4
- export type { IDocsTableDeleteColumnsCommandParams } from './commands/delete-columns.command';
5
2
  export { DocsTableDeleteRowsCommand } from './commands/delete-rows.command';
6
- export type { IDocsTableDeleteRowsCommandParams } from './commands/delete-rows.command';
7
3
  export { DocsTableDeleteTableCommand } from './commands/delete-table.command';
8
- export type { IDocsTableDeleteTableCommandParams } from './commands/delete-table.command';
9
4
  export { DocsTableDistributeColumnsCommand } from './commands/distribute-columns.command';
10
- export type { IDocsTableDistributeColumnsCommandParams } from './commands/distribute-columns.command';
11
5
  export { DocsTableDistributeRowsCommand } from './commands/distribute-rows.command';
12
- export type { IDocsTableDistributeRowsCommandParams } from './commands/distribute-rows.command';
13
6
  export { DocsTableInsertColumnsCommand } from './commands/insert-columns.command';
14
- export type { IDocsTableInsertColumnsCommandParams } from './commands/insert-columns.command';
15
7
  export { DocsTableInsertRowsCommand } from './commands/insert-rows.command';
16
- export type { IDocsTableInsertRowsCommandParams } from './commands/insert-rows.command';
17
8
  export { DocsTableInsertTableCommand } from './commands/insert-table.command';
18
9
  export type { IDocsTableInsertTableCommandParams } from './commands/insert-table.command';
19
10
  export { DocsTableInsertTitleRowCommand } from './commands/insert-title-row.command';
20
- export type { IDocsTableInsertTitleRowCommandParams } from './commands/insert-title-row.command';
21
11
  export { DocsTableMergeCellsCommand } from './commands/merge-cells.command';
22
- export type { IDocsTableMergeCellsCommandParams } from './commands/merge-cells.command';
23
12
  export { DocsTableMoveColumnsCommand } from './commands/move-columns.command';
24
- export type { IDocsTableMoveColumnsCommandParams } from './commands/move-columns.command';
25
13
  export { DocsTableMoveRowsCommand } from './commands/move-rows.command';
26
- export type { IDocsTableMoveRowsCommandParams } from './commands/move-rows.command';
27
14
  export { DocsTableMoveTableCommand } from './commands/move-table.command';
28
- export type { IDocsTableMoveTableCommandParams } from './commands/move-table.command';
29
- export { DocsTablePasteWithoutFormattingCommand } from './commands/paste-without-formatting.command';
30
- export type { IDocsTablePasteWithoutFormattingCommandParams } from './commands/paste-without-formatting.command';
31
15
  export { DocsTableResizeColumnCommand } from './commands/resize-column.command';
32
- export type { IDocsTableResizeColumnCommandParams } from './commands/resize-column.command';
33
16
  export { DocsTableResizeRowCommand } from './commands/resize-row.command';
34
- export type { IDocsTableResizeRowCommandParams } from './commands/resize-row.command';
35
17
  export { DocsTableSetColumnTypeCommand } from './commands/set-column-type.command';
36
- export type { IDocsTableSetColumnTypeCommandParams } from './commands/set-column-type.command';
37
18
  export { DocsTableSetHeaderRowCountCommand } from './commands/set-header-row-count.command';
38
- export type { IDocsTableSetHeaderRowCountCommandParams } from './commands/set-header-row-count.command';
39
- export { DocsTableSetTableBackgroundCommand } from './commands/set-table-background.command';
40
- export type { IDocsTableSetTableBackgroundCommandParams } from './commands/set-table-background.command';
19
+ export { buildSetTableBackgroundMutationActions, DocsTableSetTableBackgroundCommand } from './commands/set-table-background.command';
41
20
  export { DocsTableSetTableBorderColorCommand } from './commands/set-table-border-color.command';
42
- export type { IDocsTableSetTableBorderColorCommandParams } from './commands/set-table-border-color.command';
43
21
  export { DocsTableSetTableBorderStyleCommand } from './commands/set-table-border-style.command';
44
- export type { IDocsTableSetTableBorderStyleCommandParams } from './commands/set-table-border-style.command';
45
22
  export { DocsTableSetTableBorderWidthCommand } from './commands/set-table-border-width.command';
46
- export type { IDocsTableSetTableBorderWidthCommandParams } from './commands/set-table-border-width.command';
47
23
  export { DocsTableSetTableBorderCommand } from './commands/set-table-border.command';
48
- export type { IDocsTableSetTableBorderCommandParams } from './commands/set-table-border.command';
49
24
  export { DocsTableSetTableVerticalAlignCommand } from './commands/set-table-vertical-align.command';
50
- export type { IDocsTableSetTableVerticalAlignCommandParams } from './commands/set-table-vertical-align.command';
51
25
  export { DocsTableSortTableCommand } from './commands/sort-table.command';
52
- export type { IDocsTableSortTableCommandParams } from './commands/sort-table.command';
53
26
  export { DocsTableUnmergeCellsCommand } from './commands/unmerge-cells.command';
54
- export type { IDocsTableUnmergeCellsCommandParams } from './commands/unmerge-cells.command';
55
- export { executeRichTextTableMutation } from './commands/utils';
27
+ export { buildDeleteTableColumnsMutationActions, buildDeleteTableMutationActions, buildDeleteTableRowsMutationActions, buildDistributeTableColumnsMutationActions, buildDistributeTableRowsMutationActions, buildInsertTableColumnsMutationActions, buildInsertTableRowsMutationActions, buildInsertTableTitleRowMutationActions, buildMoveFloatingTableMutationActions, buildMoveTableColumnsMutationActions, buildMoveTableRowsMutationActions, buildMoveTableToOffsetMutationActions, buildResizeTableColumnActionsFromWidth, buildResizeTableRowActionsFromHeight, buildSetTableHeaderRowCountMutationActions, buildSortTableMutationActions, executeRichTextTableActions, getTableActionBodyPath, } from './commands/utils';
56
28
  export { buildDeleteColumnsActions, buildDeleteRowsActions, buildDeleteTableActions, buildInsertColumnsActions, buildInsertRowsActions, buildMoveColumnsActions, buildMoveRowsActions, DocsTableColumnInsertPosition, DocsTableInsertPosition, DocsTableRowInsertPosition, } from './common/actions';
57
- export type { IDeleteColumnsActionParams, IDeleteRowsActionParams, IDeleteTableActionParams, IDocsTableActionBuildResult, IDocsTableActionCursor, IInsertColumnsActionParams, IInsertRowsActionParams, IMoveColumnsActionParams, IMoveRowsActionParams, } from './common/actions';
58
- export { buildSetTableBorderActions, buildSetTableCellBackgroundActions, buildUpdateTableBorderStyleActions, DocsTableBorderPreset, } from './common/border';
59
- export type { ISetTableBorderActionParams, ISetTableBorderActionResult, ISetTableCellBackgroundActionParams, IUpdateTableBorderStyleActionParams, } from './common/border';
60
- export { buildSetTableCellTextActions } from './common/cell-text';
61
- export type { ISetTableCellTextActionParams, ISetTableCellTextActionResult } from './common/cell-text';
62
- export { buildPasteHtmlTableActions, buildPastePlainTextTableActions, parseHtmlTableClipboard, parseHtmlTablesClipboard, serializeTableSelectionAsHtml, serializeTableSelectionAsPlainText, } from './common/clipboard';
63
- export type { IParsedHtmlTableCell, IParsedHtmlTableClipboard, IParsedHtmlTableRow, IPasteHtmlTableParams, IPasteHtmlTableResult, IPastePlainTextTableParams, IPastePlainTextTableResult, ITableClipboardParams, } from './common/clipboard';
64
- export { DOCS_TABLE_PLUGIN, DOCS_TABLE_RESOURCE_NAME } from './common/const';
65
- export { buildInsertTableActions, DocsTableInsertTablePosition } from './common/insert-table';
66
- export type { IDocsTableInsertActionParams, IDocsTableInsertActionResult, IDocsTableInsertOptions, } from './common/insert-table';
67
- export { buildDistributeColumnsActions, buildDistributeRowsActions, buildInsertTitleRowActions, buildResizeColumnActions, buildResizeRowActions, buildSetHeaderRowCountActions, getPinnedHeaderRowCount, } from './common/layout';
68
- export type { IDistributeColumnsActionParams, IDistributeRowsActionParams, IDocsTableLayoutActionResult, IInsertTitleRowActionParams, IResizeColumnActionParams, IResizeRowActionParams, ISetHeaderRowCountActionParams, } from './common/layout';
69
- export { buildMoveTableActions } from './common/layout';
70
- export type { IMoveTableActionParams } from './common/layout';
71
- export { buildMergeCellsActions, buildUnmergeCellsActions, canMergeCells, canUnmergeCells, findMergeRange, } from './common/merge';
72
- export type { IDocsTableMergeActionParams, IDocsTableMergeActionResult } from './common/merge';
73
- export { normalizeDocsTableMetadataResource, setColumnTypeInMetadata, setHeaderRowCountInMetadata, setTitleRowInMetadata, } from './common/metadata';
74
- export { remapDocsTableSelection } from './common/selection-remap';
75
- export type { DocsTableSelectionRemapOperation } from './common/selection-remap';
76
- export { buildSortTableActions, DocsTableSortDirection } from './common/sort';
77
- export type { ISortTableActionParams, ISortTableActionResult } from './common/sort';
78
- export { getColumnRange, getRowRange, getTableRangeById } from './common/table-range';
79
- export type { IDocsTableCellOffsetRange, IDocsTableColumnOffsetRange, IDocsTableOffsetRange, IDocsTableRowOffsetRange, } from './common/table-range';
80
- export { DocsTableColumnType, DocsTableSelectionKind, DocsTableSelectionSource } from './common/type';
81
- export type { IDocsTableCellRange, IDocsTableColumnTypeConfig, IDocsTableDropdownOption, IDocsTableMetadata, IDocsTableMetadataResource, IDocsTableSelection, } from './common/type';
82
- export type { IUniverDocsTableConfig } from './config/config';
83
- export { DocsTableResourceController } from './controllers/docs-table-resource.controller';
29
+ export { buildSetTableBorderActions, buildSetTableBorderMutationActions, buildSetTableCellBackgroundActions, DocsTableBorderPreset, } from './common/border';
30
+ export { buildSetTableCellTextActions, buildSetTableCellTextMutationActions } from './common/cell-text';
31
+ export { buildPastePlainTextTableMutationActions } from './common/clipboard';
32
+ export { DOCS_TABLE_PLUGIN } from './common/const';
33
+ export { DocsTableInsertTablePosition } from './common/insert-table';
34
+ export type { IDocsTableInsertOptions } from './common/insert-table';
35
+ export { buildDistributeColumnsActions, buildDistributeRowsActions, buildInsertTitleRowActions, buildMoveTableActions, buildResizeColumnActions, buildResizeRowActions, buildSetHeaderRowCountActions, } from './common/layout';
36
+ export { buildSetTableCellMarginMutationActions, buildSetTableDefaultCellMarginMutationActions, DEFAULT_DOCS_TABLE_CELL_MARGIN, } from './common/margin';
37
+ export type { ISetTableCellMarginMutationParams } from './common/margin';
38
+ export { buildMergeCellsActions, buildMergeCellsMutationActions, buildUnmergeCellsActions, buildUnmergeCellsMutationActions, canMergeCells, canUnmergeCells, } from './common/merge';
39
+ export { buildSortTableActions, DocsTableSortDirection, } from './common/sort';
40
+ export { getTableRangeById } from './common/table-range';
41
+ export type { IDocsTableCellOffsetRange, IDocsTableOffsetRange, } from './common/table-range';
42
+ export { DocsTableColumnType, DocsTableSelectionKind, DocsTableSelectionSource, } from './common/type';
43
+ export type { IDocsTableCellRange, IDocsTableColumnTypeConfig, IDocsTableMetadata, IDocsTableMetadataResource, IDocsTableSelection, } from './common/type';
84
44
  export { DocsTableModel } from './models/docs-table-model';
85
45
  export { UniverDocsTablePlugin } from './plugin';
86
46
  export { DocsTableSelectionService } from './services/docs-table-selection.service';