-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Standalone editor: TableOperation (#2149)
* Standalone editor: TableOperation * fix build
- Loading branch information
1 parent
573f78a
commit c0f5953
Showing
17 changed files
with
438 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 4 additions & 14 deletions
18
packages-content-model/roosterjs-content-model-editor/lib/modelApi/table/alignTable.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,12 @@ | ||
import { TableOperation } from 'roosterjs-editor-types'; | ||
import type { TableAlignOperation } from '../../publicTypes/parameter/TableOperation'; | ||
import type { ContentModelTable } from 'roosterjs-content-model-types'; | ||
import type { CompatibleTableOperation } from 'roosterjs-editor-types/lib/compatibleTypes'; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export function alignTable( | ||
table: ContentModelTable, | ||
operation: | ||
| TableOperation.AlignCenter | ||
| TableOperation.AlignLeft | ||
| TableOperation.AlignRight | ||
| CompatibleTableOperation.AlignCenter | ||
| CompatibleTableOperation.AlignLeft | ||
| CompatibleTableOperation.AlignRight | ||
) { | ||
table.format.marginLeft = operation == TableOperation.AlignLeft ? '' : 'auto'; | ||
table.format.marginRight = operation == TableOperation.AlignRight ? '' : 'auto'; | ||
export function alignTable(table: ContentModelTable, operation: TableAlignOperation) { | ||
table.format.marginLeft = operation == 'alignLeft' ? '' : 'auto'; | ||
table.format.marginRight = operation == 'alignRight' ? '' : 'auto'; | ||
|
||
delete table.cachedElement; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 3 additions & 8 deletions
11
...ages-content-model/roosterjs-content-model-editor/lib/modelApi/table/insertTableColumn.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 3 additions & 11 deletions
14
packages-content-model/roosterjs-content-model-editor/lib/modelApi/table/insertTableRow.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 3 additions & 8 deletions
11
packages-content-model/roosterjs-content-model-editor/lib/modelApi/table/mergeTableColumn.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 3 additions & 11 deletions
14
packages-content-model/roosterjs-content-model-editor/lib/modelApi/table/mergeTableRow.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.