-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove comment highlight when pasting Content from Word Online (#2272)
* init * fix build
- Loading branch information
1 parent
dd6f645
commit a562a7c
Showing
7 changed files
with
212 additions
and
47 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
83 changes: 83 additions & 0 deletions
83
packages-content-model/roosterjs-content-model-plugins/lib/paste/WacComponents/constants.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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/** | ||
* @internal | ||
**/ | ||
export const WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES: string[] = [ | ||
'TableInsertRowGapBlank', | ||
'TableColumnResizeHandle', | ||
'TableCellTopBorderHandle', | ||
'TableCellLeftBorderHandle', | ||
'TableHoverColumnHandle', | ||
'TableHoverRowHandle', | ||
]; | ||
/** | ||
* @internal | ||
**/ | ||
export const BULLET_LIST_STYLE: string = 'BulletListStyle'; | ||
/** | ||
* @internal | ||
**/ | ||
export const NUMBER_LIST_STYLE: string = 'NumberListStyle'; | ||
/** | ||
* @internal | ||
**/ | ||
export const IMAGE_BORDER: string = 'WACImageBorder'; | ||
/** | ||
* @internal | ||
**/ | ||
export const IMAGE_CONTAINER: string = 'WACImageContainer'; | ||
/** | ||
* @internal | ||
**/ | ||
export const OUTLINE_ELEMENT: string = 'OutlineElement'; | ||
/** | ||
* @internal | ||
**/ | ||
export const PARAGRAPH: string = 'Paragraph'; | ||
/** | ||
* @internal | ||
**/ | ||
export const LIST_CONTAINER_ELEMENT_CLASS_NAME: string = 'ListContainerWrapper'; | ||
/** | ||
* @internal | ||
**/ | ||
export const TABLE_CONTAINER: string = 'TableContainer'; | ||
/** | ||
* @internal | ||
**/ | ||
export const COMMENT_HIGHLIGHT_CLASS: string = 'CommentHighlightRest'; | ||
/** | ||
* @internal | ||
**/ | ||
export const COMMENT_HIGHLIGHT_CLICKED_CLASS: string = 'CommentHighlightClicked'; | ||
/** | ||
* @internal | ||
**/ | ||
export const TEMP_ELEMENTS_CLASSES: string[] = [ | ||
...WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES, | ||
'ListMarkerWrappingSpan', | ||
]; | ||
/** | ||
* @internal | ||
**/ | ||
export const WAC_IDENTIFY_SELECTOR: string = | ||
`ul[class^="${BULLET_LIST_STYLE}"]>.${OUTLINE_ELEMENT},ol[class^="${NUMBER_LIST_STYLE}"]>.${OUTLINE_ELEMENT},span.${IMAGE_CONTAINER},span.${IMAGE_BORDER},.${COMMENT_HIGHLIGHT_CLASS},.${COMMENT_HIGHLIGHT_CLICKED_CLASS},` + | ||
WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES.map(c => `table div[class^="${c}"]`).join(','); | ||
/** | ||
* @internal | ||
**/ | ||
export const CLASSES_TO_KEEP: string[] = [ | ||
OUTLINE_ELEMENT, | ||
IMAGE_CONTAINER, | ||
...TEMP_ELEMENTS_CLASSES, | ||
PARAGRAPH, | ||
IMAGE_BORDER, | ||
TABLE_CONTAINER, | ||
COMMENT_HIGHLIGHT_CLASS, | ||
COMMENT_HIGHLIGHT_CLICKED_CLASS, | ||
'NumberListStyle', | ||
'ListContainerWrapper', | ||
'BulletListStyle', | ||
'TableCellContent', | ||
'WACImageContainer', | ||
'LineBreakBlob', | ||
]; |
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: 1 addition & 13 deletions
14
...erjs-content-model-plugins/lib/paste/pasteSourceValidations/documentContainWacElements.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
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