feat: handle list boundary

This commit is contained in:
Hufe921
2023-04-20 20:17:34 +08:00
committed by Hufe
parent c2330a8c11
commit 406fca3590
15 changed files with 214 additions and 70 deletions
+11 -4
View File
@@ -26,9 +26,7 @@ export const EDITOR_ELEMENT_COPY_ATTR: Array<keyof IElement> = [
'url',
'hyperlinkId',
'dateId',
'dateFormat',
'level',
'titleId'
'dateFormat'
]
export const EDITOR_ELEMENT_ZIP_ATTR: Array<keyof IElement> = [
@@ -64,6 +62,8 @@ export const EDITOR_ELEMENT_CONTEXT_ATTR: Array<keyof IElement> = [
'tdId',
'trId',
'tableId',
'level',
'titleId',
'listId',
'listType',
'listStyle'
@@ -87,5 +87,12 @@ export const INLINE_ELEMENT_TYPE: ElementType[] = [
export const INLINE_NODE_NAME: string[] = [
'HR',
'TABLE'
'TABLE',
'UL',
'OL'
]
export const VIRTUAL_ELEMENT_TYPE: ElementType[] = [
ElementType.TITLE,
ElementType.LIST
]
+13 -1
View File
@@ -1,7 +1,19 @@
import { UlStyle } from '../enum/List'
import { ListStyle, ListType, UlStyle } from '../enum/List'
export const ulStyleMapping: Record<UlStyle, string> = {
[UlStyle.DISC]: '•',
[UlStyle.CIRCLE]: '◦',
[UlStyle.SQUARE]: '▫︎'
}
export const listTypeElementMapping: Record<ListType, string> = {
[ListType.OL]: 'ol',
[ListType.UL]: 'ul'
}
export const listStyleCSSMapping: Record<ListStyle, string> = {
[ListStyle.DISC]: 'disc',
[ListStyle.CIRCLE]: 'circle',
[ListStyle.SQUARE]: 'square',
[ListStyle.DECIMAL]: 'decimal'
}