@hufe921/canvas-editor 0.9.14 → 0.9.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +54 -54
  3. package/dist/canvas-editor.es.js +155 -50
  4. package/dist/canvas-editor.es.js.map +1 -1
  5. package/dist/canvas-editor.umd.js +9 -9
  6. package/dist/canvas-editor.umd.js.map +1 -1
  7. package/dist/src/editor/core/command/Command.d.ts +150 -150
  8. package/dist/src/editor/core/command/CommandAdapt.d.ts +93 -93
  9. package/dist/src/editor/core/contextmenu/ContextMenu.d.ts +28 -28
  10. package/dist/src/editor/core/contextmenu/menus/controlMenus.d.ts +2 -2
  11. package/dist/src/editor/core/contextmenu/menus/globalMenus.d.ts +2 -2
  12. package/dist/src/editor/core/contextmenu/menus/hyperlinkMenus.d.ts +2 -2
  13. package/dist/src/editor/core/contextmenu/menus/imageMenus.d.ts +2 -2
  14. package/dist/src/editor/core/contextmenu/menus/tableMenus.d.ts +2 -2
  15. package/dist/src/editor/core/cursor/Cursor.d.ts +17 -15
  16. package/dist/src/editor/core/cursor/CursorAgent.d.ts +15 -15
  17. package/dist/src/editor/core/draw/Draw.d.ts +143 -142
  18. package/dist/src/editor/core/draw/control/Control.d.ts +35 -35
  19. package/dist/src/editor/core/draw/control/checkbox/CheckboxControl.d.ts +15 -15
  20. package/dist/src/editor/core/draw/control/select/SelectControl.d.ts +21 -21
  21. package/dist/src/editor/core/draw/control/text/TextControl.d.ts +13 -13
  22. package/dist/src/editor/core/draw/frame/Background.d.ts +6 -6
  23. package/dist/src/editor/core/draw/frame/Header.d.ts +7 -7
  24. package/dist/src/editor/core/draw/frame/Margin.d.ts +7 -7
  25. package/dist/src/editor/core/draw/frame/PageNumber.d.ts +7 -7
  26. package/dist/src/editor/core/draw/frame/Watermark.d.ts +7 -7
  27. package/dist/src/editor/core/draw/interactive/Search.d.ts +26 -26
  28. package/dist/src/editor/core/draw/particle/CheckboxParticle.d.ts +7 -7
  29. package/dist/src/editor/core/draw/particle/HyperlinkParticle.d.ts +16 -16
  30. package/dist/src/editor/core/draw/particle/ImageParticle.d.ts +9 -9
  31. package/dist/src/editor/core/draw/particle/PageBreak.d.ts +12 -12
  32. package/dist/src/editor/core/draw/particle/Separator.d.ts +4 -4
  33. package/dist/src/editor/core/draw/particle/Subscript.d.ts +4 -4
  34. package/dist/src/editor/core/draw/particle/Superscript.d.ts +4 -4
  35. package/dist/src/editor/core/draw/particle/TextParticle.d.ts +18 -18
  36. package/dist/src/editor/core/draw/particle/block/BlockParticle.d.ts +14 -14
  37. package/dist/src/editor/core/draw/particle/block/modules/BaseBlock.d.ts +15 -15
  38. package/dist/src/editor/core/draw/particle/block/modules/IFrameBlock.d.ts +7 -7
  39. package/dist/src/editor/core/draw/particle/block/modules/VideoBlock.d.ts +6 -6
  40. package/dist/src/editor/core/draw/particle/date/DateParticle.d.ts +14 -14
  41. package/dist/src/editor/core/draw/particle/date/DatePicker.d.ts +64 -64
  42. package/dist/src/editor/core/draw/particle/latex/LaTexParticle.d.ts +7 -7
  43. package/dist/src/editor/core/draw/particle/latex/utils/LaTexUtils.d.ts +47 -47
  44. package/dist/src/editor/core/draw/particle/latex/utils/hershey.d.ts +10 -10
  45. package/dist/src/editor/core/draw/particle/latex/utils/symbols.d.ts +8 -8
  46. package/dist/src/editor/core/draw/particle/previewer/Previewer.d.ts +34 -34
  47. package/dist/src/editor/core/draw/particle/table/TableParticle.d.ts +11 -11
  48. package/dist/src/editor/core/draw/particle/table/TableTool.d.ts +22 -22
  49. package/dist/src/editor/core/draw/richtext/AbstractRichText.d.ts +14 -14
  50. package/dist/src/editor/core/draw/richtext/Highlight.d.ts +7 -7
  51. package/dist/src/editor/core/draw/richtext/Strikeout.d.ts +7 -7
  52. package/dist/src/editor/core/draw/richtext/Underline.d.ts +7 -7
  53. package/dist/src/editor/core/event/CanvasEvent.d.ts +48 -41
  54. package/dist/src/editor/core/event/GlobalEvent.d.ts +26 -24
  55. package/dist/src/editor/core/event/handlers/click.d.ts +8 -8
  56. package/dist/src/editor/core/event/handlers/composition.d.ts +8 -8
  57. package/dist/src/editor/core/event/handlers/copy.d.ts +2 -2
  58. package/dist/src/editor/core/event/handlers/cut.d.ts +2 -2
  59. package/dist/src/editor/core/event/handlers/drag.d.ts +6 -6
  60. package/dist/src/editor/core/event/handlers/drop.d.ts +2 -2
  61. package/dist/src/editor/core/event/handlers/input.d.ts +3 -2
  62. package/dist/src/editor/core/event/handlers/keydown.d.ts +2 -2
  63. package/dist/src/editor/core/event/handlers/mousedown.d.ts +2 -2
  64. package/dist/src/editor/core/event/handlers/mouseleave.d.ts +2 -2
  65. package/dist/src/editor/core/event/handlers/mousemove.d.ts +2 -2
  66. package/dist/src/editor/core/event/handlers/mouseup.d.ts +2 -2
  67. package/dist/src/editor/core/history/HistoryManager.d.ts +10 -10
  68. package/dist/src/editor/core/i18n/I18n.d.ts +10 -9
  69. package/dist/src/editor/core/listener/Listener.d.ts +13 -13
  70. package/dist/src/editor/core/observer/ScrollObserver.d.ts +11 -11
  71. package/dist/src/editor/core/observer/SelectionObserver.d.ts +18 -18
  72. package/dist/src/editor/core/position/Position.d.ts +20 -20
  73. package/dist/src/editor/core/range/RangeManager.d.ts +22 -22
  74. package/dist/src/editor/core/register/Register.d.ts +19 -18
  75. package/dist/src/editor/core/shortcut/Shortcut.d.ts +16 -16
  76. package/dist/src/editor/core/shortcut/keys/richtextKeys.d.ts +2 -2
  77. package/dist/src/editor/core/worker/WorkerManager.d.ts +7 -7
  78. package/dist/src/editor/core/worker/works/wordCount.d.ts +1 -1
  79. package/dist/src/editor/dataset/constant/Checkbox.d.ts +2 -2
  80. package/dist/src/editor/dataset/constant/Common.d.ts +4 -4
  81. package/dist/src/editor/dataset/constant/ContextMenu.d.ts +3 -3
  82. package/dist/src/editor/dataset/constant/Control.d.ts +2 -2
  83. package/dist/src/editor/dataset/constant/Cursor.d.ts +1 -1
  84. package/dist/src/editor/dataset/constant/Editor.d.ts +2 -2
  85. package/dist/src/editor/dataset/constant/Element.d.ts +6 -6
  86. package/dist/src/editor/dataset/constant/Header.d.ts +2 -2
  87. package/dist/src/editor/dataset/constant/Regular.d.ts +4 -4
  88. package/dist/src/editor/dataset/constant/Watermark.d.ts +2 -2
  89. package/dist/src/editor/dataset/enum/Block.d.ts +4 -4
  90. package/dist/src/editor/dataset/enum/Control.d.ts +16 -16
  91. package/dist/src/editor/dataset/enum/Editor.d.ts +21 -21
  92. package/dist/src/editor/dataset/enum/Element.d.ts +16 -16
  93. package/dist/src/editor/dataset/enum/ElementStyle.d.ts +12 -12
  94. package/dist/src/editor/dataset/enum/Event.d.ts +5 -5
  95. package/dist/src/editor/dataset/enum/KeyMap.d.ts +83 -82
  96. package/dist/src/editor/dataset/enum/Observer.d.ts +6 -6
  97. package/dist/src/editor/dataset/enum/Row.d.ts +6 -6
  98. package/dist/src/editor/dataset/enum/table/TableTool.d.ts +4 -4
  99. package/dist/src/editor/index.d.ts +27 -27
  100. package/dist/src/editor/interface/Block.d.ts +12 -12
  101. package/dist/src/editor/interface/Checkbox.d.ts +13 -13
  102. package/dist/src/editor/interface/Common.d.ts +8 -5
  103. package/dist/src/editor/interface/Control.d.ts +50 -50
  104. package/dist/src/editor/interface/Draw.d.ts +30 -30
  105. package/dist/src/editor/interface/Editor.d.ts +55 -55
  106. package/dist/src/editor/interface/Element.d.ts +99 -99
  107. package/dist/src/editor/interface/Header.d.ts +6 -6
  108. package/dist/src/editor/interface/Listener.d.ts +29 -29
  109. package/dist/src/editor/interface/Margin.d.ts +1 -1
  110. package/dist/src/editor/interface/Position.d.ts +37 -37
  111. package/dist/src/editor/interface/Previewer.d.ts +11 -11
  112. package/dist/src/editor/interface/Range.d.ts +11 -11
  113. package/dist/src/editor/interface/Row.d.ts +14 -14
  114. package/dist/src/editor/interface/Search.d.ts +14 -14
  115. package/dist/src/editor/interface/Watermark.d.ts +7 -7
  116. package/dist/src/editor/interface/contextmenu/ContextMenu.d.ts +60 -60
  117. package/dist/src/editor/interface/i18n/I18n.d.ts +6 -6
  118. package/dist/src/editor/interface/shortcut/Shortcut.d.ts +12 -10
  119. package/dist/src/editor/interface/table/Colgroup.d.ts +4 -4
  120. package/dist/src/editor/interface/table/Td.d.ts +19 -19
  121. package/dist/src/editor/interface/table/Tr.d.ts +6 -6
  122. package/dist/src/editor/utils/clipboard.d.ts +9 -9
  123. package/dist/src/editor/utils/element.d.ts +11 -11
  124. package/dist/src/editor/utils/hotkey.d.ts +1 -0
  125. package/dist/src/editor/utils/index.d.ts +11 -8
  126. package/dist/src/editor/utils/print.d.ts +1 -1
  127. package/dist/src/editor/utils/ua.d.ts +1 -0
  128. package/package.json +64 -64
@@ -1,50 +1,50 @@
1
- import { ControlType } from '../dataset/enum/Control';
2
- import { ICheckbox } from './Checkbox';
3
- import { IElement } from './Element';
4
- export interface IValueSet {
5
- value: string;
6
- code: string;
7
- }
8
- export interface IControlSelect {
9
- code: string | null;
10
- valueSets: IValueSet[];
11
- }
12
- export interface IControlCheckbox {
13
- code: string | null;
14
- min?: number;
15
- max?: number;
16
- valueSets: IValueSet[];
17
- checkbox?: ICheckbox;
18
- }
19
- export interface IControlBasic {
20
- type: ControlType;
21
- value: IElement[] | null;
22
- placeholder?: string;
23
- conceptId?: string;
24
- prefix?: string;
25
- postfix?: string;
26
- }
27
- export declare type IControl = IControlBasic & Partial<IControlSelect> & Partial<IControlCheckbox>;
28
- export interface IControlOption {
29
- placeholderColor?: string;
30
- bracketColor?: string;
31
- prefix?: string;
32
- postfix?: string;
33
- }
34
- export interface IControlInitOption {
35
- index: number;
36
- isTable?: boolean;
37
- trIndex?: number;
38
- tdIndex?: number;
39
- tdValueIndex?: number;
40
- }
41
- export interface IControlInitResult {
42
- newIndex: number;
43
- }
44
- export interface IControlInstance {
45
- getElement(): IElement;
46
- getValue(): IElement[];
47
- setValue(data: IElement[]): number;
48
- keydown(evt: KeyboardEvent): number;
49
- cut(): number;
50
- }
1
+ import { ControlType } from '../dataset/enum/Control';
2
+ import { ICheckbox } from './Checkbox';
3
+ import { IElement } from './Element';
4
+ export interface IValueSet {
5
+ value: string;
6
+ code: string;
7
+ }
8
+ export interface IControlSelect {
9
+ code: string | null;
10
+ valueSets: IValueSet[];
11
+ }
12
+ export interface IControlCheckbox {
13
+ code: string | null;
14
+ min?: number;
15
+ max?: number;
16
+ valueSets: IValueSet[];
17
+ checkbox?: ICheckbox;
18
+ }
19
+ export interface IControlBasic {
20
+ type: ControlType;
21
+ value: IElement[] | null;
22
+ placeholder?: string;
23
+ conceptId?: string;
24
+ prefix?: string;
25
+ postfix?: string;
26
+ }
27
+ export declare type IControl = IControlBasic & Partial<IControlSelect> & Partial<IControlCheckbox>;
28
+ export interface IControlOption {
29
+ placeholderColor?: string;
30
+ bracketColor?: string;
31
+ prefix?: string;
32
+ postfix?: string;
33
+ }
34
+ export interface IControlInitOption {
35
+ index: number;
36
+ isTable?: boolean;
37
+ trIndex?: number;
38
+ tdIndex?: number;
39
+ tdValueIndex?: number;
40
+ }
41
+ export interface IControlInitResult {
42
+ newIndex: number;
43
+ }
44
+ export interface IControlInstance {
45
+ getElement(): IElement;
46
+ getValue(): IElement[];
47
+ setValue(data: IElement[]): number;
48
+ keydown(evt: KeyboardEvent): number;
49
+ cut(): number;
50
+ }
@@ -1,30 +1,30 @@
1
- import { IElementPosition } from './Element';
2
- import { IRow } from './Row';
3
- export interface IDrawOption {
4
- curIndex?: number;
5
- isSetCursor?: boolean;
6
- isSubmitHistory?: boolean;
7
- isComputeRowList?: boolean;
8
- }
9
- export interface IDrawImagePayload {
10
- width: number;
11
- height: number;
12
- value: string;
13
- }
14
- export interface IDrawRowPayload {
15
- positionList: IElementPosition[];
16
- rowList: IRow[];
17
- pageNo: number;
18
- startIndex: number;
19
- startX: number;
20
- startY: number;
21
- innerWidth: number;
22
- }
23
- export interface IDrawRowResult {
24
- x: number;
25
- y: number;
26
- index: number;
27
- }
28
- export interface IPainterOptions {
29
- isDblclick: boolean;
30
- }
1
+ import { IElementPosition } from './Element';
2
+ import { IRow } from './Row';
3
+ export interface IDrawOption {
4
+ curIndex?: number;
5
+ isSetCursor?: boolean;
6
+ isSubmitHistory?: boolean;
7
+ isComputeRowList?: boolean;
8
+ }
9
+ export interface IDrawImagePayload {
10
+ width: number;
11
+ height: number;
12
+ value: string;
13
+ }
14
+ export interface IDrawRowPayload {
15
+ positionList: IElementPosition[];
16
+ rowList: IRow[];
17
+ pageNo: number;
18
+ startIndex: number;
19
+ startX: number;
20
+ startY: number;
21
+ innerWidth: number;
22
+ }
23
+ export interface IDrawRowResult {
24
+ x: number;
25
+ y: number;
26
+ index: number;
27
+ }
28
+ export interface IPainterOptions {
29
+ isDblclick: boolean;
30
+ }
@@ -1,55 +1,55 @@
1
- import { IElement } from '..';
2
- import { EditorMode, PageMode } from '../dataset/enum/Editor';
3
- import { ICheckboxOption } from './Checkbox';
4
- import { IControlOption } from './Control';
5
- import { IHeader } from './Header';
6
- import { IMargin } from './Margin';
7
- import { IWatermark } from './Watermark';
8
- export interface IEditorOption {
9
- mode?: EditorMode;
10
- defaultType?: string;
11
- defaultFont?: string;
12
- defaultSize?: number;
13
- defaultBasicRowMarginHeight?: number;
14
- defaultRowMargin?: number;
15
- defaultTabWidth?: number;
16
- width?: number;
17
- height?: number;
18
- scale?: number;
19
- pageGap?: number;
20
- pageNumberBottom?: number;
21
- pageNumberSize?: number;
22
- pageNumberFont?: string;
23
- underlineColor?: string;
24
- strikeoutColor?: string;
25
- rangeColor?: string;
26
- rangeAlpha?: number;
27
- rangeMinWidth?: number;
28
- searchMatchColor?: string;
29
- searchNavigateMatchColor?: string;
30
- searchMatchAlpha?: number;
31
- highlightAlpha?: number;
32
- resizerColor?: string;
33
- resizerSize?: number;
34
- marginIndicatorSize?: number;
35
- marginIndicatorColor?: string;
36
- margins?: IMargin;
37
- pageMode?: PageMode;
38
- tdPadding?: number;
39
- defaultTdHeight?: number;
40
- defaultHyperlinkColor?: string;
41
- headerTop?: number;
42
- header?: IHeader;
43
- watermark?: IWatermark;
44
- control?: IControlOption;
45
- checkbox?: ICheckboxOption;
46
- }
47
- export interface IEditorResult {
48
- version: string;
49
- width: number;
50
- height: number;
51
- margins: IMargin;
52
- header?: IHeader;
53
- watermark?: IWatermark;
54
- data: IElement[];
55
- }
1
+ import { IElement } from '..';
2
+ import { EditorMode, PageMode } from '../dataset/enum/Editor';
3
+ import { ICheckboxOption } from './Checkbox';
4
+ import { IControlOption } from './Control';
5
+ import { IHeader } from './Header';
6
+ import { IMargin } from './Margin';
7
+ import { IWatermark } from './Watermark';
8
+ export interface IEditorOption {
9
+ mode?: EditorMode;
10
+ defaultType?: string;
11
+ defaultFont?: string;
12
+ defaultSize?: number;
13
+ defaultBasicRowMarginHeight?: number;
14
+ defaultRowMargin?: number;
15
+ defaultTabWidth?: number;
16
+ width?: number;
17
+ height?: number;
18
+ scale?: number;
19
+ pageGap?: number;
20
+ pageNumberBottom?: number;
21
+ pageNumberSize?: number;
22
+ pageNumberFont?: string;
23
+ underlineColor?: string;
24
+ strikeoutColor?: string;
25
+ rangeColor?: string;
26
+ rangeAlpha?: number;
27
+ rangeMinWidth?: number;
28
+ searchMatchColor?: string;
29
+ searchNavigateMatchColor?: string;
30
+ searchMatchAlpha?: number;
31
+ highlightAlpha?: number;
32
+ resizerColor?: string;
33
+ resizerSize?: number;
34
+ marginIndicatorSize?: number;
35
+ marginIndicatorColor?: string;
36
+ margins?: IMargin;
37
+ pageMode?: PageMode;
38
+ tdPadding?: number;
39
+ defaultTdHeight?: number;
40
+ defaultHyperlinkColor?: string;
41
+ headerTop?: number;
42
+ header?: IHeader;
43
+ watermark?: IWatermark;
44
+ control?: IControlOption;
45
+ checkbox?: ICheckboxOption;
46
+ }
47
+ export interface IEditorResult {
48
+ version: string;
49
+ width: number;
50
+ height: number;
51
+ margins: IMargin;
52
+ header?: IHeader;
53
+ watermark?: IWatermark;
54
+ data: IElement[];
55
+ }
@@ -1,99 +1,99 @@
1
- import { ControlComponent, ImageDisplay } from '../dataset/enum/Control';
2
- import { ElementType } from '../dataset/enum/Element';
3
- import { RowFlex } from '../dataset/enum/Row';
4
- import { IBlock } from './Block';
5
- import { ICheckbox } from './Checkbox';
6
- import { IControl } from './Control';
7
- import { IColgroup } from './table/Colgroup';
8
- import { ITr } from './table/Tr';
9
- export interface IElementBasic {
10
- id?: string;
11
- type?: ElementType;
12
- value: string;
13
- }
14
- export interface IElementStyle {
15
- font?: string;
16
- size?: number;
17
- width?: number;
18
- height?: number;
19
- bold?: boolean;
20
- color?: string;
21
- highlight?: string;
22
- italic?: boolean;
23
- underline?: boolean;
24
- strikeout?: boolean;
25
- rowFlex?: RowFlex;
26
- rowMargin?: number;
27
- letterSpacing?: number;
28
- }
29
- export interface ITableAttr {
30
- colgroup?: IColgroup[];
31
- trList?: ITr[];
32
- }
33
- export interface ITableElement {
34
- tdId?: string;
35
- trId?: string;
36
- tableId?: string;
37
- }
38
- export interface IHyperlinkElement {
39
- valueList?: IElement[];
40
- url?: string;
41
- hyperlinkId?: string;
42
- }
43
- export declare type ITable = ITableAttr & ITableElement;
44
- export interface ISuperscriptSubscript {
45
- actualSize?: number;
46
- }
47
- export interface ISeparator {
48
- dashArray?: number[];
49
- }
50
- export interface IControlElement {
51
- control?: IControl;
52
- controlId?: string;
53
- controlComponent?: ControlComponent;
54
- }
55
- export interface ICheckboxElement {
56
- checkbox?: ICheckbox;
57
- }
58
- export interface ILaTexElement {
59
- laTexSVG?: string;
60
- }
61
- export interface IDateElement {
62
- dateFormat?: string;
63
- dateId?: string;
64
- }
65
- export interface IImageElement {
66
- imgDisplay?: ImageDisplay;
67
- }
68
- export interface IBlockElement {
69
- block?: IBlock;
70
- }
71
- export declare type IElement = IElementBasic & IElementStyle & ITable & IHyperlinkElement & ISuperscriptSubscript & ISeparator & IControlElement & ICheckboxElement & ILaTexElement & IDateElement & IImageElement & IBlockElement;
72
- export interface IElementMetrics {
73
- width: number;
74
- height: number;
75
- boundingBoxAscent: number;
76
- boundingBoxDescent: number;
77
- }
78
- export interface IElementPosition {
79
- pageNo: number;
80
- index: number;
81
- value: string;
82
- rowNo: number;
83
- ascent: number;
84
- lineHeight: number;
85
- metrics: IElementMetrics;
86
- isLastLetter: boolean;
87
- coordinate: {
88
- leftTop: number[];
89
- leftBottom: number[];
90
- rightTop: number[];
91
- rightBottom: number[];
92
- };
93
- }
94
- export interface IElementFillRect {
95
- x: number;
96
- y: number;
97
- width: number;
98
- height: number;
99
- }
1
+ import { ControlComponent, ImageDisplay } from '../dataset/enum/Control';
2
+ import { ElementType } from '../dataset/enum/Element';
3
+ import { RowFlex } from '../dataset/enum/Row';
4
+ import { IBlock } from './Block';
5
+ import { ICheckbox } from './Checkbox';
6
+ import { IControl } from './Control';
7
+ import { IColgroup } from './table/Colgroup';
8
+ import { ITr } from './table/Tr';
9
+ export interface IElementBasic {
10
+ id?: string;
11
+ type?: ElementType;
12
+ value: string;
13
+ }
14
+ export interface IElementStyle {
15
+ font?: string;
16
+ size?: number;
17
+ width?: number;
18
+ height?: number;
19
+ bold?: boolean;
20
+ color?: string;
21
+ highlight?: string;
22
+ italic?: boolean;
23
+ underline?: boolean;
24
+ strikeout?: boolean;
25
+ rowFlex?: RowFlex;
26
+ rowMargin?: number;
27
+ letterSpacing?: number;
28
+ }
29
+ export interface ITableAttr {
30
+ colgroup?: IColgroup[];
31
+ trList?: ITr[];
32
+ }
33
+ export interface ITableElement {
34
+ tdId?: string;
35
+ trId?: string;
36
+ tableId?: string;
37
+ }
38
+ export interface IHyperlinkElement {
39
+ valueList?: IElement[];
40
+ url?: string;
41
+ hyperlinkId?: string;
42
+ }
43
+ export declare type ITable = ITableAttr & ITableElement;
44
+ export interface ISuperscriptSubscript {
45
+ actualSize?: number;
46
+ }
47
+ export interface ISeparator {
48
+ dashArray?: number[];
49
+ }
50
+ export interface IControlElement {
51
+ control?: IControl;
52
+ controlId?: string;
53
+ controlComponent?: ControlComponent;
54
+ }
55
+ export interface ICheckboxElement {
56
+ checkbox?: ICheckbox;
57
+ }
58
+ export interface ILaTexElement {
59
+ laTexSVG?: string;
60
+ }
61
+ export interface IDateElement {
62
+ dateFormat?: string;
63
+ dateId?: string;
64
+ }
65
+ export interface IImageElement {
66
+ imgDisplay?: ImageDisplay;
67
+ }
68
+ export interface IBlockElement {
69
+ block?: IBlock;
70
+ }
71
+ export declare type IElement = IElementBasic & IElementStyle & ITable & IHyperlinkElement & ISuperscriptSubscript & ISeparator & IControlElement & ICheckboxElement & ILaTexElement & IDateElement & IImageElement & IBlockElement;
72
+ export interface IElementMetrics {
73
+ width: number;
74
+ height: number;
75
+ boundingBoxAscent: number;
76
+ boundingBoxDescent: number;
77
+ }
78
+ export interface IElementPosition {
79
+ pageNo: number;
80
+ index: number;
81
+ value: string;
82
+ rowNo: number;
83
+ ascent: number;
84
+ lineHeight: number;
85
+ metrics: IElementMetrics;
86
+ isLastLetter: boolean;
87
+ coordinate: {
88
+ leftTop: number[];
89
+ leftBottom: number[];
90
+ rightTop: number[];
91
+ rightBottom: number[];
92
+ };
93
+ }
94
+ export interface IElementFillRect {
95
+ x: number;
96
+ y: number;
97
+ width: number;
98
+ height: number;
99
+ }
@@ -1,6 +1,6 @@
1
- export interface IHeader {
2
- data: string;
3
- color?: string;
4
- size?: number;
5
- font?: string;
6
- }
1
+ export interface IHeader {
2
+ data: string;
3
+ color?: string;
4
+ size?: number;
5
+ font?: string;
6
+ }
@@ -1,29 +1,29 @@
1
- import { ElementType, PageMode } from '..';
2
- import { RowFlex } from '../dataset/enum/Row';
3
- import { IControl } from './Control';
4
- import { IEditorResult } from './Editor';
5
- export interface IRangeStyle {
6
- type: ElementType | null;
7
- undo: boolean;
8
- redo: boolean;
9
- painter: boolean;
10
- font: string;
11
- bold: boolean;
12
- italic: boolean;
13
- underline: boolean;
14
- strikeout: boolean;
15
- color: string | null;
16
- highlight: string | null;
17
- rowFlex: RowFlex | null;
18
- rowMargin: number;
19
- dashArray: number[];
20
- }
21
- export declare type IRangeStyleChange = (payload: IRangeStyle) => void;
22
- export declare type IVisiblePageNoListChange = (payload: number[]) => void;
23
- export declare type IIntersectionPageNoChange = (payload: number) => void;
24
- export declare type IPageSizeChange = (payload: number) => void;
25
- export declare type IPageScaleChange = (payload: number) => void;
26
- export declare type ISaved = (payload: IEditorResult) => void;
27
- export declare type IContentChange = () => void;
28
- export declare type IControlChange = (payload: IControl | null) => void;
29
- export declare type IPageModeChange = (payload: PageMode) => void;
1
+ import { ElementType, PageMode } from '..';
2
+ import { RowFlex } from '../dataset/enum/Row';
3
+ import { IControl } from './Control';
4
+ import { IEditorResult } from './Editor';
5
+ export interface IRangeStyle {
6
+ type: ElementType | null;
7
+ undo: boolean;
8
+ redo: boolean;
9
+ painter: boolean;
10
+ font: string;
11
+ bold: boolean;
12
+ italic: boolean;
13
+ underline: boolean;
14
+ strikeout: boolean;
15
+ color: string | null;
16
+ highlight: string | null;
17
+ rowFlex: RowFlex | null;
18
+ rowMargin: number;
19
+ dashArray: number[];
20
+ }
21
+ export declare type IRangeStyleChange = (payload: IRangeStyle) => void;
22
+ export declare type IVisiblePageNoListChange = (payload: number[]) => void;
23
+ export declare type IIntersectionPageNoChange = (payload: number) => void;
24
+ export declare type IPageSizeChange = (payload: number) => void;
25
+ export declare type IPageScaleChange = (payload: number) => void;
26
+ export declare type ISaved = (payload: IEditorResult) => void;
27
+ export declare type IContentChange = () => void;
28
+ export declare type IControlChange = (payload: IControl | null) => void;
29
+ export declare type IPageModeChange = (payload: PageMode) => void;
@@ -1 +1 @@
1
- export declare type IMargin = [top: number, right: number, bottom: number, left: number];
1
+ export declare type IMargin = [top: number, right: number, bottom: number, left: number];
@@ -1,37 +1,37 @@
1
- import { IElement } from '..';
2
- import { IElementPosition } from './Element';
3
- import { ITd } from './table/Td';
4
- export interface ICurrentPosition {
5
- index: number;
6
- isCheckbox?: boolean;
7
- isControl?: boolean;
8
- isImage?: boolean;
9
- isTable?: boolean;
10
- isDirectHit?: boolean;
11
- trIndex?: number;
12
- tdIndex?: number;
13
- tdValueIndex?: number;
14
- tdId?: string;
15
- trId?: string;
16
- tableId?: string;
17
- }
18
- export interface IGetPositionByXYPayload {
19
- x: number;
20
- y: number;
21
- isTable?: boolean;
22
- td?: ITd;
23
- tablePosition?: IElementPosition;
24
- elementList?: IElement[];
25
- positionList?: IElementPosition[];
26
- }
27
- export interface IPositionContext {
28
- isTable: boolean;
29
- isCheckbox?: boolean;
30
- isControl?: boolean;
31
- index?: number;
32
- trIndex?: number;
33
- tdIndex?: number;
34
- tdId?: string;
35
- trId?: string;
36
- tableId?: string;
37
- }
1
+ import { IElement } from '..';
2
+ import { IElementPosition } from './Element';
3
+ import { ITd } from './table/Td';
4
+ export interface ICurrentPosition {
5
+ index: number;
6
+ isCheckbox?: boolean;
7
+ isControl?: boolean;
8
+ isImage?: boolean;
9
+ isTable?: boolean;
10
+ isDirectHit?: boolean;
11
+ trIndex?: number;
12
+ tdIndex?: number;
13
+ tdValueIndex?: number;
14
+ tdId?: string;
15
+ trId?: string;
16
+ tableId?: string;
17
+ }
18
+ export interface IGetPositionByXYPayload {
19
+ x: number;
20
+ y: number;
21
+ isTable?: boolean;
22
+ td?: ITd;
23
+ tablePosition?: IElementPosition;
24
+ elementList?: IElement[];
25
+ positionList?: IElementPosition[];
26
+ }
27
+ export interface IPositionContext {
28
+ isTable: boolean;
29
+ isCheckbox?: boolean;
30
+ isControl?: boolean;
31
+ index?: number;
32
+ trIndex?: number;
33
+ tdIndex?: number;
34
+ tdId?: string;
35
+ trId?: string;
36
+ tableId?: string;
37
+ }
@@ -1,11 +1,11 @@
1
- import { IElement } from './Element';
2
- export interface IPreviewerCreateResult {
3
- resizerSelection: HTMLDivElement;
4
- resizerHandleList: HTMLDivElement[];
5
- resizerImageContainer: HTMLDivElement;
6
- resizerImage: HTMLImageElement;
7
- }
8
- export interface IPreviewerDrawOption {
9
- mime?: 'png' | 'jpg' | 'jpeg' | 'svg';
10
- srcKey?: keyof Pick<IElement, 'value' | 'laTexSVG'>;
11
- }
1
+ import { IElement } from './Element';
2
+ export interface IPreviewerCreateResult {
3
+ resizerSelection: HTMLDivElement;
4
+ resizerHandleList: HTMLDivElement[];
5
+ resizerImageContainer: HTMLDivElement;
6
+ resizerImage: HTMLImageElement;
7
+ }
8
+ export interface IPreviewerDrawOption {
9
+ mime?: 'png' | 'jpg' | 'jpeg' | 'svg';
10
+ srcKey?: keyof Pick<IElement, 'value' | 'laTexSVG'>;
11
+ }
@@ -1,11 +1,11 @@
1
- export interface IRange {
2
- startIndex: number;
3
- endIndex: number;
4
- isCrossRowCol?: boolean;
5
- tableId?: string;
6
- startTdIndex?: number;
7
- endTdIndex?: number;
8
- startTrIndex?: number;
9
- endTrIndex?: number;
10
- }
11
- export declare type RangeRowMap = Map<number, Set<number>>;
1
+ export interface IRange {
2
+ startIndex: number;
3
+ endIndex: number;
4
+ isCrossRowCol?: boolean;
5
+ tableId?: string;
6
+ startTdIndex?: number;
7
+ endTdIndex?: number;
8
+ startTrIndex?: number;
9
+ endTrIndex?: number;
10
+ }
11
+ export declare type RangeRowMap = Map<number, Set<number>>;