refactor: add prettier and format

This commit is contained in:
Hufe921
2023-07-18 20:33:59 +08:00
parent 9c2bd33b7a
commit d464c50435
158 changed files with 3749 additions and 2265 deletions
+1 -1
View File
@@ -7,4 +7,4 @@ export const defaultCheckboxOption: Readonly<Required<ICheckboxOption>> = {
lineWidth: 1,
fillStyle: '#5175f4',
fontStyle: '#ffffff'
}
}
+17 -2
View File
@@ -4,10 +4,25 @@ export const ZERO = '\u200B'
export const WRAP = '\n'
export const HORIZON_TAB = '\t'
export const NBSP = '\u0020'
export const PUNCTUATION_LIST = ['·', '、', ':', ':', ',', ',', '.', '。', ';', ';', '?', '?', '!', '!']
export const PUNCTUATION_LIST = [
'·',
'、',
':',
':',
',',
',',
'.',
'。',
';',
';',
'?',
'?',
'!',
'!'
]
export const maxHeightRadioMapping: Record<MaxHeightRatio, number> = {
[MaxHeightRatio.HALF]: 1 / 2,
[MaxHeightRatio.ONE_THIRD]: 1 / 3,
[MaxHeightRatio.QUARTER]: 1 / 4
}
}
+1 -1
View File
@@ -1,3 +1,3 @@
export const NAME_PLACEHOLDER = {
SELECTED_TEXT: '%s'
}
}
+1 -1
View File
@@ -5,4 +5,4 @@ export const defaultControlOption: Readonly<Required<IControlOption>> = {
bracketColor: '#000000',
prefix: '{',
postfix: '}'
}
}
+1 -1
View File
@@ -7,4 +7,4 @@ export const defaultCursorOption: Readonly<Required<ICursorOption>> = {
color: '#000000',
dragWidth: 2,
dragColor: '#0000FF'
}
}
+1 -1
View File
@@ -1,2 +1,2 @@
export const EDITOR_COMPONENT = 'editor-component'
export const EDITOR_PREFIX = 'ce'
export const EDITOR_PREFIX = 'ce'
+3 -11
View File
@@ -65,10 +65,7 @@ export const TABLE_CONTEXT_ATTR: Array<keyof IElement> = [
'tableId'
]
export const TITLE_CONTEXT_ATTR: Array<keyof IElement> = [
'level',
'titleId',
]
export const TITLE_CONTEXT_ATTR: Array<keyof IElement> = ['level', 'titleId']
export const LIST_CONTEXT_ATTR: Array<keyof IElement> = [
'listId',
@@ -98,14 +95,9 @@ export const INLINE_ELEMENT_TYPE: ElementType[] = [
ElementType.TABLE
]
export const INLINE_NODE_NAME: string[] = [
'HR',
'TABLE',
'UL',
'OL'
]
export const INLINE_NODE_NAME: string[] = ['HR', 'TABLE', 'UL', 'OL']
export const VIRTUAL_ELEMENT_TYPE: ElementType[] = [
ElementType.TITLE,
ElementType.LIST
]
]
+1 -1
View File
@@ -5,4 +5,4 @@ export const defaultFooterOption: Readonly<Required<IFooter>> = {
bottom: 30,
maxHeightRadio: MaxHeightRatio.HALF,
disabled: false
}
}
+1 -1
View File
@@ -5,4 +5,4 @@ export const defaultHeaderOption: Readonly<Required<IHeader>> = {
top: 30,
maxHeightRadio: MaxHeightRatio.HALF,
disabled: false
}
}
+1 -1
View File
@@ -16,4 +16,4 @@ export const listStyleCSSMapping: Record<ListStyle, string> = {
[ListStyle.CIRCLE]: 'circle',
[ListStyle.SQUARE]: 'square',
[ListStyle.DECIMAL]: 'decimal'
}
}
+1 -1
View File
@@ -18,4 +18,4 @@ export const defaultPageNumberOption: Readonly<Required<IPageNumber>> = {
disabled: false,
startPageNo: 1,
fromPageNo: 0
}
}
+1 -1
View File
@@ -6,4 +6,4 @@ export const defaultPlaceholderOption: Readonly<Required<IPlaceholder>> = {
opacity: 1,
size: 16,
font: 'Yahei'
}
}
+1 -1
View File
@@ -2,4 +2,4 @@ export const NUMBER_REG = /[0-9]/
export const LETTER_REG = /[a-zA-Z]/
export const NUMBER_LIKE_REG = /[0-9.]/
export const CHINESE_REG = /[\u4e00-\u9fa5]/
export const WORD_LIKE_REG = /[^a-zA-Z][a-zA-Z]/
export const WORD_LIKE_REG = /[^a-zA-Z][a-zA-Z]/
+7 -7
View File
@@ -29,10 +29,10 @@ export const titleOrderNumberMapping: Record<TitleLevel, number> = {
}
export const titleNodeNameMapping: Record<string, TitleLevel> = {
'H1': TitleLevel.FIRST,
'H2': TitleLevel.SECOND,
'H3': TitleLevel.THIRD,
'H4': TitleLevel.FOURTH,
'H5': TitleLevel.FIFTH,
'H6': TitleLevel.SIXTH
}
H1: TitleLevel.FIRST,
H2: TitleLevel.SECOND,
H3: TitleLevel.THIRD,
H4: TitleLevel.FOURTH,
H5: TitleLevel.FIFTH,
H6: TitleLevel.SIXTH
}
+1 -1
View File
@@ -6,4 +6,4 @@ export const defaultWatermarkOption: Readonly<Required<IWatermark>> = {
opacity: 0.3,
size: 200,
font: 'Yahei'
}
}