-
-
Notifications
You must be signed in to change notification settings - Fork 232
/
node-constants.ts
63 lines (52 loc) 路 1.37 KB
/
node-constants.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
export type IndentLevels = [number, number];
/**
* The size of the default indentation size (in pt).
*/
export const INDENT_MARGIN_PT_SIZE = 36;
/**
* The levels of indentation supported by default. Can be overridden.
*/
export const INDENT_LEVELS: IndentLevels = [0, 7];
/**
* The min indentation level.
*/
export const MIN_INDENT_LEVEL = 0;
/**
* The default maximum level of indentation allowed.
*/
export const MAX_INDENT_LEVEL = 7;
/**
* The attribute to use for storing the indent value.
*/
export const INDENT_ATTRIBUTE = 'data-indent';
/**
* The default line spacing values.
*/
export const LINE_SPACING_VALUES = [
'100%',
'115%',
'150%', // Default value.
'200%',
];
/**
* Regex for accepting a value as a valid alignment name.
*/
export const ALIGN_PATTERN = /(left|right|center|justify)/;
/**
* Regex for matching sizes in the DOM.
*/
export const SIZE_PATTERN = /([\d.]+)(px|pt)/i;
/**
* The default pixel to pt font size ratio.
*
* @see https://github.com/chanzuckerberg/czi-prosemirror/blob/52e34840d73fccc46637314bf4b4be71147112d4/src/convertToCSSPTValue.js#L7
*/
export const PIXEL_TO_PT_RATIO = 0.7518796992481203; // 1 / 1.33.
/**
* The default pt to pixel ratio.
*/
export const PT_TO_PIXEL_RATIO = 1.33;
/**
* The default font sizes for the editor.
*/
export const FONT_PT_SIZES = [8, 9, 10, 11, 12, 14, 18, 24, 30, 36, 48, 60, 72, 90];