@agile_jy/word-editor 0.0.1

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 (230) hide show
  1. package/CHANGELOG.md +2543 -0
  2. package/LICENSE +21 -0
  3. package/README.md +110 -0
  4. package/dist/canvas-editor.es.js +25197 -0
  5. package/dist/canvas-editor.es.js.map +1 -0
  6. package/dist/canvas-editor.umd.js +97 -0
  7. package/dist/canvas-editor.umd.js.map +1 -0
  8. package/dist/src/editor/core/actuator/Actuator.d.ts +7 -0
  9. package/dist/src/editor/core/actuator/handlers/positionContextChange.d.ts +3 -0
  10. package/dist/src/editor/core/command/Command.d.ts +147 -0
  11. package/dist/src/editor/core/command/CommandAdapt.d.ts +190 -0
  12. package/dist/src/editor/core/contextmenu/ContextMenu.d.ts +31 -0
  13. package/dist/src/editor/core/contextmenu/menus/controlMenus.d.ts +2 -0
  14. package/dist/src/editor/core/contextmenu/menus/globalMenus.d.ts +2 -0
  15. package/dist/src/editor/core/contextmenu/menus/hyperlinkMenus.d.ts +2 -0
  16. package/dist/src/editor/core/contextmenu/menus/imageMenus.d.ts +2 -0
  17. package/dist/src/editor/core/contextmenu/menus/tableMenus.d.ts +2 -0
  18. package/dist/src/editor/core/cursor/Cursor.d.ts +41 -0
  19. package/dist/src/editor/core/cursor/CursorAgent.d.ts +16 -0
  20. package/dist/src/editor/core/draw/Draw.d.ts +252 -0
  21. package/dist/src/editor/core/draw/control/Control.d.ts +73 -0
  22. package/dist/src/editor/core/draw/control/checkbox/CheckboxControl.d.ts +16 -0
  23. package/dist/src/editor/core/draw/control/date/DateControl.d.ts +24 -0
  24. package/dist/src/editor/core/draw/control/interactive/ControlSearch.d.ts +20 -0
  25. package/dist/src/editor/core/draw/control/number/Calculator.d.ts +16 -0
  26. package/dist/src/editor/core/draw/control/number/NumberControl.d.ts +13 -0
  27. package/dist/src/editor/core/draw/control/radio/RadioControl.d.ts +5 -0
  28. package/dist/src/editor/core/draw/control/richtext/Border.d.ts +10 -0
  29. package/dist/src/editor/core/draw/control/select/SelectControl.d.ts +28 -0
  30. package/dist/src/editor/core/draw/control/text/TextControl.d.ts +18 -0
  31. package/dist/src/editor/core/draw/frame/Background.d.ts +11 -0
  32. package/dist/src/editor/core/draw/frame/Badge.d.ts +14 -0
  33. package/dist/src/editor/core/draw/frame/Footer.d.ts +27 -0
  34. package/dist/src/editor/core/draw/frame/Header.d.ts +27 -0
  35. package/dist/src/editor/core/draw/frame/LineNumber.d.ts +7 -0
  36. package/dist/src/editor/core/draw/frame/Margin.d.ts +7 -0
  37. package/dist/src/editor/core/draw/frame/PageBorder.d.ts +9 -0
  38. package/dist/src/editor/core/draw/frame/PageNumber.d.ts +9 -0
  39. package/dist/src/editor/core/draw/frame/Placeholder.d.ts +20 -0
  40. package/dist/src/editor/core/draw/frame/Watermark.d.ts +10 -0
  41. package/dist/src/editor/core/draw/graffiti/Graffiti.d.ts +19 -0
  42. package/dist/src/editor/core/draw/interactive/Area.d.ts +27 -0
  43. package/dist/src/editor/core/draw/interactive/Group.d.ts +18 -0
  44. package/dist/src/editor/core/draw/interactive/Search.d.ts +30 -0
  45. package/dist/src/editor/core/draw/particle/CheckboxParticle.d.ts +18 -0
  46. package/dist/src/editor/core/draw/particle/HyperlinkParticle.d.ts +17 -0
  47. package/dist/src/editor/core/draw/particle/ImageParticle.d.ts +23 -0
  48. package/dist/src/editor/core/draw/particle/LabelParticle.d.ts +8 -0
  49. package/dist/src/editor/core/draw/particle/LineBreakParticle.d.ts +10 -0
  50. package/dist/src/editor/core/draw/particle/ListParticle.d.ts +20 -0
  51. package/dist/src/editor/core/draw/particle/PageBreakParticle.d.ts +9 -0
  52. package/dist/src/editor/core/draw/particle/RadioParticle.d.ts +18 -0
  53. package/dist/src/editor/core/draw/particle/SeparatorParticle.d.ts +7 -0
  54. package/dist/src/editor/core/draw/particle/SubscriptParticle.d.ts +5 -0
  55. package/dist/src/editor/core/draw/particle/SuperscriptParticle.d.ts +5 -0
  56. package/dist/src/editor/core/draw/particle/TextParticle.d.ts +29 -0
  57. package/dist/src/editor/core/draw/particle/WhiteSpaceParticle.d.ts +7 -0
  58. package/dist/src/editor/core/draw/particle/block/BlockParticle.d.ts +14 -0
  59. package/dist/src/editor/core/draw/particle/block/modules/BaseBlock.d.ts +33 -0
  60. package/dist/src/editor/core/draw/particle/block/modules/IFrameBlock.d.ts +9 -0
  61. package/dist/src/editor/core/draw/particle/block/modules/VideoBlock.d.ts +8 -0
  62. package/dist/src/editor/core/draw/particle/date/DateParticle.d.ts +13 -0
  63. package/dist/src/editor/core/draw/particle/date/DatePicker.d.ts +64 -0
  64. package/dist/src/editor/core/draw/particle/latex/LaTexParticle.d.ts +7 -0
  65. package/dist/src/editor/core/draw/particle/latex/utils/LaTexUtils.d.ts +47 -0
  66. package/dist/src/editor/core/draw/particle/latex/utils/hershey.d.ts +10 -0
  67. package/dist/src/editor/core/draw/particle/latex/utils/symbols.d.ts +8 -0
  68. package/dist/src/editor/core/draw/particle/previewer/Previewer.d.ts +47 -0
  69. package/dist/src/editor/core/draw/particle/table/TableOperate.d.ts +32 -0
  70. package/dist/src/editor/core/draw/particle/table/TableParticle.d.ts +24 -0
  71. package/dist/src/editor/core/draw/particle/table/TableTool.d.ts +31 -0
  72. package/dist/src/editor/core/draw/richtext/AbstractRichText.d.ts +11 -0
  73. package/dist/src/editor/core/draw/richtext/Highlight.d.ts +7 -0
  74. package/dist/src/editor/core/draw/richtext/Strikeout.d.ts +7 -0
  75. package/dist/src/editor/core/draw/richtext/Underline.d.ts +10 -0
  76. package/dist/src/editor/core/event/CanvasEvent.d.ts +52 -0
  77. package/dist/src/editor/core/event/GlobalEvent.d.ts +26 -0
  78. package/dist/src/editor/core/event/eventbus/EventBus.d.ts +9 -0
  79. package/dist/src/editor/core/event/handlers/click.d.ts +11 -0
  80. package/dist/src/editor/core/event/handlers/composition.d.ts +8 -0
  81. package/dist/src/editor/core/event/handlers/copy.d.ts +3 -0
  82. package/dist/src/editor/core/event/handlers/cut.d.ts +2 -0
  83. package/dist/src/editor/core/event/handlers/drag.d.ts +6 -0
  84. package/dist/src/editor/core/event/handlers/drop.d.ts +2 -0
  85. package/dist/src/editor/core/event/handlers/input.d.ts +3 -0
  86. package/dist/src/editor/core/event/handlers/keydown/backspace.d.ts +2 -0
  87. package/dist/src/editor/core/event/handlers/keydown/delete.d.ts +2 -0
  88. package/dist/src/editor/core/event/handlers/keydown/enter.d.ts +2 -0
  89. package/dist/src/editor/core/event/handlers/keydown/index.d.ts +2 -0
  90. package/dist/src/editor/core/event/handlers/keydown/left.d.ts +2 -0
  91. package/dist/src/editor/core/event/handlers/keydown/right.d.ts +2 -0
  92. package/dist/src/editor/core/event/handlers/keydown/tab.d.ts +2 -0
  93. package/dist/src/editor/core/event/handlers/keydown/updown.d.ts +2 -0
  94. package/dist/src/editor/core/event/handlers/mousedown.d.ts +7 -0
  95. package/dist/src/editor/core/event/handlers/mouseleave.d.ts +2 -0
  96. package/dist/src/editor/core/event/handlers/mousemove.d.ts +2 -0
  97. package/dist/src/editor/core/event/handlers/mouseup.d.ts +2 -0
  98. package/dist/src/editor/core/event/handlers/paste.d.ts +8 -0
  99. package/dist/src/editor/core/history/HistoryManager.d.ts +15 -0
  100. package/dist/src/editor/core/i18n/I18n.d.ts +12 -0
  101. package/dist/src/editor/core/listener/Listener.d.ts +15 -0
  102. package/dist/src/editor/core/observer/ImageObserver.d.ts +7 -0
  103. package/dist/src/editor/core/observer/MouseObserver.d.ts +13 -0
  104. package/dist/src/editor/core/observer/ScrollObserver.d.ts +20 -0
  105. package/dist/src/editor/core/observer/SelectionObserver.d.ts +22 -0
  106. package/dist/src/editor/core/override/Override.d.ts +8 -0
  107. package/dist/src/editor/core/plugin/Plugin.d.ts +7 -0
  108. package/dist/src/editor/core/position/Position.d.ts +37 -0
  109. package/dist/src/editor/core/range/RangeManager.d.ts +45 -0
  110. package/dist/src/editor/core/register/Register.d.ts +20 -0
  111. package/dist/src/editor/core/shortcut/Shortcut.d.ts +16 -0
  112. package/dist/src/editor/core/shortcut/keys/listKeys.d.ts +2 -0
  113. package/dist/src/editor/core/shortcut/keys/richtextKeys.d.ts +2 -0
  114. package/dist/src/editor/core/shortcut/keys/titleKeys.d.ts +2 -0
  115. package/dist/src/editor/core/worker/WorkerManager.d.ts +16 -0
  116. package/dist/src/editor/core/worker/works/catalog.d.ts +1 -0
  117. package/dist/src/editor/core/worker/works/group.d.ts +1 -0
  118. package/dist/src/editor/core/worker/works/value.d.ts +1 -0
  119. package/dist/src/editor/core/worker/works/wordCount.d.ts +1 -0
  120. package/dist/src/editor/core/zone/Zone.d.ts +21 -0
  121. package/dist/src/editor/core/zone/ZoneTip.d.ts +17 -0
  122. package/dist/src/editor/dataset/constant/Background.d.ts +2 -0
  123. package/dist/src/editor/dataset/constant/Badge.d.ts +2 -0
  124. package/dist/src/editor/dataset/constant/Checkbox.d.ts +2 -0
  125. package/dist/src/editor/dataset/constant/Common.d.ts +21 -0
  126. package/dist/src/editor/dataset/constant/ContextMenu.d.ts +60 -0
  127. package/dist/src/editor/dataset/constant/Control.d.ts +2 -0
  128. package/dist/src/editor/dataset/constant/Cursor.d.ts +3 -0
  129. package/dist/src/editor/dataset/constant/Editor.d.ts +6 -0
  130. package/dist/src/editor/dataset/constant/Element.d.ts +21 -0
  131. package/dist/src/editor/dataset/constant/Footer.d.ts +2 -0
  132. package/dist/src/editor/dataset/constant/Graffiti.d.ts +2 -0
  133. package/dist/src/editor/dataset/constant/Group.d.ts +2 -0
  134. package/dist/src/editor/dataset/constant/Header.d.ts +2 -0
  135. package/dist/src/editor/dataset/constant/ImgCaption.d.ts +2 -0
  136. package/dist/src/editor/dataset/constant/Label.d.ts +2 -0
  137. package/dist/src/editor/dataset/constant/LineBreak.d.ts +2 -0
  138. package/dist/src/editor/dataset/constant/LineNumber.d.ts +2 -0
  139. package/dist/src/editor/dataset/constant/List.d.ts +6 -0
  140. package/dist/src/editor/dataset/constant/PageBorder.d.ts +2 -0
  141. package/dist/src/editor/dataset/constant/PageBreak.d.ts +2 -0
  142. package/dist/src/editor/dataset/constant/PageNumber.d.ts +6 -0
  143. package/dist/src/editor/dataset/constant/Placeholder.d.ts +2 -0
  144. package/dist/src/editor/dataset/constant/Radio.d.ts +2 -0
  145. package/dist/src/editor/dataset/constant/Regular.d.ts +10 -0
  146. package/dist/src/editor/dataset/constant/Separator.d.ts +2 -0
  147. package/dist/src/editor/dataset/constant/Shortcut.d.ts +3 -0
  148. package/dist/src/editor/dataset/constant/Table.d.ts +2 -0
  149. package/dist/src/editor/dataset/constant/Title.d.ts +6 -0
  150. package/dist/src/editor/dataset/constant/Watermark.d.ts +2 -0
  151. package/dist/src/editor/dataset/constant/WhiteSpace.d.ts +2 -0
  152. package/dist/src/editor/dataset/constant/Zone.d.ts +2 -0
  153. package/dist/src/editor/dataset/enum/Area.d.ts +5 -0
  154. package/dist/src/editor/dataset/enum/Background.d.ts +10 -0
  155. package/dist/src/editor/dataset/enum/Block.d.ts +4 -0
  156. package/dist/src/editor/dataset/enum/Common.d.ts +26 -0
  157. package/dist/src/editor/dataset/enum/Control.d.ts +32 -0
  158. package/dist/src/editor/dataset/enum/Editor.d.ts +44 -0
  159. package/dist/src/editor/dataset/enum/Element.d.ts +21 -0
  160. package/dist/src/editor/dataset/enum/ElementStyle.d.ts +12 -0
  161. package/dist/src/editor/dataset/enum/Event.d.ts +5 -0
  162. package/dist/src/editor/dataset/enum/KeyMap.d.ts +83 -0
  163. package/dist/src/editor/dataset/enum/LineNumber.d.ts +4 -0
  164. package/dist/src/editor/dataset/enum/List.d.ts +20 -0
  165. package/dist/src/editor/dataset/enum/Observer.d.ts +6 -0
  166. package/dist/src/editor/dataset/enum/Row.d.ts +7 -0
  167. package/dist/src/editor/dataset/enum/Text.d.ts +12 -0
  168. package/dist/src/editor/dataset/enum/Title.d.ts +8 -0
  169. package/dist/src/editor/dataset/enum/VerticalAlign.d.ts +5 -0
  170. package/dist/src/editor/dataset/enum/Watermark.d.ts +4 -0
  171. package/dist/src/editor/dataset/enum/table/Table.d.ts +17 -0
  172. package/dist/src/editor/dataset/enum/table/TableTool.d.ts +4 -0
  173. package/dist/src/editor/index.d.ts +59 -0
  174. package/dist/src/editor/interface/Area.d.ts +55 -0
  175. package/dist/src/editor/interface/Background.d.ts +8 -0
  176. package/dist/src/editor/interface/Badge.d.ts +15 -0
  177. package/dist/src/editor/interface/Block.d.ts +15 -0
  178. package/dist/src/editor/interface/Catalog.d.ts +9 -0
  179. package/dist/src/editor/interface/Checkbox.d.ts +15 -0
  180. package/dist/src/editor/interface/Command.d.ts +3 -0
  181. package/dist/src/editor/interface/Common.d.ts +14 -0
  182. package/dist/src/editor/interface/Control.d.ts +198 -0
  183. package/dist/src/editor/interface/Cursor.d.ts +7 -0
  184. package/dist/src/editor/interface/Draw.d.ts +74 -0
  185. package/dist/src/editor/interface/Editor.d.ts +143 -0
  186. package/dist/src/editor/interface/Element.d.ts +234 -0
  187. package/dist/src/editor/interface/Event.d.ts +22 -0
  188. package/dist/src/editor/interface/EventBus.d.ts +26 -0
  189. package/dist/src/editor/interface/Footer.d.ts +8 -0
  190. package/dist/src/editor/interface/Graffiti.d.ts +13 -0
  191. package/dist/src/editor/interface/Group.d.ts +8 -0
  192. package/dist/src/editor/interface/Header.d.ts +8 -0
  193. package/dist/src/editor/interface/Label.d.ts +7 -0
  194. package/dist/src/editor/interface/LineBreak.d.ts +5 -0
  195. package/dist/src/editor/interface/LineNumber.d.ts +9 -0
  196. package/dist/src/editor/interface/Listener.d.ts +66 -0
  197. package/dist/src/editor/interface/Margin.d.ts +1 -0
  198. package/dist/src/editor/interface/PageBorder.d.ts +7 -0
  199. package/dist/src/editor/interface/PageBreak.d.ts +5 -0
  200. package/dist/src/editor/interface/PageNumber.d.ts +15 -0
  201. package/dist/src/editor/interface/Placeholder.d.ts +7 -0
  202. package/dist/src/editor/interface/Plugin.d.ts +3 -0
  203. package/dist/src/editor/interface/Position.d.ts +103 -0
  204. package/dist/src/editor/interface/Previewer.d.ts +13 -0
  205. package/dist/src/editor/interface/Radio.d.ts +15 -0
  206. package/dist/src/editor/interface/Range.d.ts +44 -0
  207. package/dist/src/editor/interface/Row.d.ts +23 -0
  208. package/dist/src/editor/interface/Search.d.ts +30 -0
  209. package/dist/src/editor/interface/Separator.d.ts +4 -0
  210. package/dist/src/editor/interface/Text.d.ts +13 -0
  211. package/dist/src/editor/interface/Title.d.ts +26 -0
  212. package/dist/src/editor/interface/Watermark.d.ts +15 -0
  213. package/dist/src/editor/interface/WhiteSpace.d.ts +5 -0
  214. package/dist/src/editor/interface/Zone.d.ts +3 -0
  215. package/dist/src/editor/interface/contextmenu/ContextMenu.d.ts +73 -0
  216. package/dist/src/editor/interface/i18n/I18n.d.ts +6 -0
  217. package/dist/src/editor/interface/shortcut/Shortcut.d.ts +13 -0
  218. package/dist/src/editor/interface/table/Colgroup.d.ts +4 -0
  219. package/dist/src/editor/interface/table/Table.d.ts +8 -0
  220. package/dist/src/editor/interface/table/Td.d.ts +35 -0
  221. package/dist/src/editor/interface/table/Tr.d.ts +10 -0
  222. package/dist/src/editor/utils/clipboard.d.ts +13 -0
  223. package/dist/src/editor/utils/element.d.ts +57 -0
  224. package/dist/src/editor/utils/hotkey.d.ts +1 -0
  225. package/dist/src/editor/utils/index.d.ts +34 -0
  226. package/dist/src/editor/utils/option.d.ts +3 -0
  227. package/dist/src/editor/utils/paragraph.d.ts +8 -0
  228. package/dist/src/editor/utils/print.d.ts +7 -0
  229. package/dist/src/editor/utils/ua.d.ts +4 -0
  230. package/package.json +77 -0
@@ -0,0 +1,234 @@
1
+ import { ImageDisplay } from '../dataset/enum/Common';
2
+ import { ControlComponent } from '../dataset/enum/Control';
3
+ import { ElementType } from '../dataset/enum/Element';
4
+ import { ListStyle, ListType } from '../dataset/enum/List';
5
+ import { RowFlex } from '../dataset/enum/Row';
6
+ import { TitleLevel } from '../dataset/enum/Title';
7
+ import { TableBorder } from '../dataset/enum/table/Table';
8
+ import { IArea } from './Area';
9
+ import { IBlock } from './Block';
10
+ import { ICheckbox } from './Checkbox';
11
+ import { IPadding } from './Common';
12
+ import { IControl } from './Control';
13
+ import { IRadio } from './Radio';
14
+ import { ITextDecoration } from './Text';
15
+ import { ITitle } from './Title';
16
+ import { IColgroup } from './table/Colgroup';
17
+ import { ITr } from './table/Tr';
18
+ export interface IElementBasic {
19
+ id?: string;
20
+ type?: ElementType;
21
+ value: string;
22
+ extension?: unknown;
23
+ externalId?: string;
24
+ }
25
+ export interface IElementStyle {
26
+ font?: string;
27
+ size?: number;
28
+ width?: number;
29
+ height?: number;
30
+ bold?: boolean;
31
+ color?: string;
32
+ highlight?: string;
33
+ italic?: boolean;
34
+ underline?: boolean;
35
+ strikeout?: boolean;
36
+ rowFlex?: RowFlex;
37
+ rowMargin?: number;
38
+ letterSpacing?: number;
39
+ textDecoration?: ITextDecoration;
40
+ }
41
+ export interface IElementRule {
42
+ hide?: boolean;
43
+ }
44
+ export interface IElementGroup {
45
+ groupIds?: string[];
46
+ }
47
+ export interface ITitleElement {
48
+ valueList?: IElement[];
49
+ level?: TitleLevel;
50
+ titleId?: string;
51
+ title?: ITitle;
52
+ }
53
+ export interface IListElement {
54
+ valueList?: IElement[];
55
+ listType?: ListType;
56
+ listStyle?: ListStyle;
57
+ listId?: string;
58
+ listWrap?: boolean;
59
+ }
60
+ export interface ITableAttr {
61
+ colgroup?: IColgroup[];
62
+ trList?: ITr[];
63
+ borderType?: TableBorder;
64
+ borderColor?: string;
65
+ borderWidth?: number;
66
+ borderExternalWidth?: number;
67
+ translateX?: number;
68
+ }
69
+ export interface ITableRule {
70
+ tableToolDisabled?: boolean;
71
+ }
72
+ export interface ITableElement {
73
+ tdId?: string;
74
+ trId?: string;
75
+ tableId?: string;
76
+ conceptId?: string;
77
+ pagingId?: string;
78
+ pagingIndex?: number;
79
+ }
80
+ export type ITable = ITableAttr & ITableRule & ITableElement;
81
+ export interface IHyperlinkElement {
82
+ valueList?: IElement[];
83
+ url?: string;
84
+ hyperlinkId?: string;
85
+ }
86
+ export interface ISuperscriptSubscript {
87
+ actualSize?: number;
88
+ }
89
+ export interface ISeparator {
90
+ dashArray?: number[];
91
+ lineWidth?: number;
92
+ }
93
+ export interface IControlElement {
94
+ control?: IControl;
95
+ controlId?: string;
96
+ controlComponent?: ControlComponent;
97
+ }
98
+ export interface ICheckboxElement {
99
+ checkbox?: ICheckbox;
100
+ }
101
+ export interface IRadioElement {
102
+ radio?: IRadio;
103
+ }
104
+ export interface ILaTexElement {
105
+ laTexSVG?: string;
106
+ }
107
+ export interface IDateElement {
108
+ dateFormat?: string;
109
+ dateId?: string;
110
+ }
111
+ export interface IImageRule {
112
+ imgToolDisabled?: boolean;
113
+ imgPreviewDisabled?: boolean;
114
+ }
115
+ export interface IImageCrop {
116
+ x: number;
117
+ y: number;
118
+ width: number;
119
+ height: number;
120
+ }
121
+ export interface IImageCaption {
122
+ value: string;
123
+ color?: string;
124
+ font?: string;
125
+ size?: number;
126
+ top?: number;
127
+ }
128
+ export interface IImgCaptionOption {
129
+ color?: string;
130
+ font?: string;
131
+ size?: number;
132
+ top?: number;
133
+ }
134
+ export interface IListOption {
135
+ inheritStyle?: boolean;
136
+ }
137
+ export interface IImageBasic {
138
+ imgDisplay?: ImageDisplay;
139
+ imgFloatPosition?: {
140
+ x: number;
141
+ y: number;
142
+ pageNo?: number;
143
+ };
144
+ imgCrop?: IImageCrop;
145
+ imgCaption?: IImageCaption;
146
+ }
147
+ export interface IFormImage {
148
+ formInput?: IFormInputImage;
149
+ }
150
+ export interface IFormInputImage {
151
+ key?: string;
152
+ width?: string;
153
+ height?: string;
154
+ fontSize?: string;
155
+ bold?: boolean;
156
+ italic?: boolean;
157
+ color?: string;
158
+ fontFamily?: string;
159
+ type?: string;
160
+ checked?: boolean;
161
+ label?: string;
162
+ }
163
+ export type IImageElement = IImageBasic & IImageRule & IFormImage;
164
+ export interface IBlockElement {
165
+ block?: IBlock;
166
+ }
167
+ export interface IAreaElement {
168
+ valueList?: IElement[];
169
+ areaId?: string;
170
+ areaIndex?: number;
171
+ area?: IArea;
172
+ }
173
+ export interface ILabelElement {
174
+ labelId?: string;
175
+ label?: {
176
+ color?: string;
177
+ backgroundColor?: string;
178
+ borderRadius?: number;
179
+ padding?: IPadding;
180
+ };
181
+ }
182
+ export type IElement = IElementBasic & IElementStyle & IElementRule & IElementGroup & ITable & IHyperlinkElement & ISuperscriptSubscript & ISeparator & IControlElement & ICheckboxElement & IRadioElement & ILaTexElement & IDateElement & IImageElement & IBlockElement & ITitleElement & IListElement & IAreaElement & ILabelElement;
183
+ export interface IElementMetrics {
184
+ width: number;
185
+ height: number;
186
+ boundingBoxAscent: number;
187
+ boundingBoxDescent: number;
188
+ }
189
+ export interface IElementPosition {
190
+ pageNo: number;
191
+ index: number;
192
+ value: string;
193
+ rowIndex: number;
194
+ rowNo: number;
195
+ ascent: number;
196
+ lineHeight: number;
197
+ left: number;
198
+ metrics: IElementMetrics;
199
+ isFirstLetter: boolean;
200
+ isLastLetter: boolean;
201
+ coordinate: {
202
+ leftTop: number[];
203
+ leftBottom: number[];
204
+ rightTop: number[];
205
+ rightBottom: number[];
206
+ };
207
+ }
208
+ export interface IElementFillRect {
209
+ x: number;
210
+ y: number;
211
+ width: number;
212
+ height: number;
213
+ }
214
+ export interface IUpdateElementByIdOption {
215
+ id?: string;
216
+ conceptId?: string;
217
+ properties: Omit<Partial<IElement>, 'id'>;
218
+ }
219
+ export interface IDeleteElementByIdOption {
220
+ id?: string;
221
+ conceptId?: string;
222
+ }
223
+ export interface IGetElementByIdOption {
224
+ id?: string;
225
+ conceptId?: string;
226
+ }
227
+ export interface IInsertElementListOption {
228
+ isReplace?: boolean;
229
+ isSubmitHistory?: boolean;
230
+ ignoreContextKeys?: Array<keyof IElement>;
231
+ }
232
+ export interface ISpliceElementListOption {
233
+ isIgnoreDeletedRule?: boolean;
234
+ }
@@ -0,0 +1,22 @@
1
+ import { IElement } from './Element';
2
+ import { RangeRect } from './Range';
3
+ export interface IPasteOption {
4
+ isPlainText: boolean;
5
+ }
6
+ export interface ITableInfoByEvent {
7
+ element: IElement;
8
+ trIndex: number;
9
+ tdIndex: number;
10
+ }
11
+ export interface IPositionContextByEventResult {
12
+ pageNo: number;
13
+ element: IElement | null;
14
+ rangeRect: RangeRect | null;
15
+ tableInfo: ITableInfoByEvent | null;
16
+ }
17
+ export interface IPositionContextByEventOption {
18
+ isMustDirectHit?: boolean;
19
+ }
20
+ export interface ICopyOption {
21
+ isPlainText: boolean;
22
+ }
@@ -0,0 +1,26 @@
1
+ import { IContentChange, IControlChange, IControlContentChange, IImageDblclick, IImageMousedown, IImageSizeChange, IInputEventChange, IIntersectionPageNoChange, ILabelMousedown, IMouseEventChange, IPageModeChange, IPageScaleChange, IPageSizeChange, IPositionContextChange, IRangeStyleChange, ISaved, IVisiblePageNoListChange, IZoneChange } from './Listener';
2
+ export interface EventBusMap {
3
+ rangeStyleChange: IRangeStyleChange;
4
+ visiblePageNoListChange: IVisiblePageNoListChange;
5
+ intersectionPageNoChange: IIntersectionPageNoChange;
6
+ pageSizeChange: IPageSizeChange;
7
+ pageScaleChange: IPageScaleChange;
8
+ saved: ISaved;
9
+ contentChange: IContentChange;
10
+ controlChange: IControlChange;
11
+ controlContentChange: IControlContentChange;
12
+ pageModeChange: IPageModeChange;
13
+ zoneChange: IZoneChange;
14
+ mousemove: IMouseEventChange;
15
+ mouseleave: IMouseEventChange;
16
+ mouseenter: IMouseEventChange;
17
+ mousedown: IMouseEventChange;
18
+ mouseup: IMouseEventChange;
19
+ click: IMouseEventChange;
20
+ input: IInputEventChange;
21
+ positionContextChange: IPositionContextChange;
22
+ imageSizeChange: IImageSizeChange;
23
+ imageMousedown: IImageMousedown;
24
+ imageDblclick: IImageDblclick;
25
+ labelMousedown: ILabelMousedown;
26
+ }
@@ -0,0 +1,8 @@
1
+ import { MaxHeightRatio } from '../dataset/enum/Common';
2
+ export interface IFooter {
3
+ bottom?: number;
4
+ inactiveAlpha?: number;
5
+ maxHeightRadio?: MaxHeightRatio;
6
+ disabled?: boolean;
7
+ editable?: boolean;
8
+ }
@@ -0,0 +1,13 @@
1
+ export interface IGraffitiStroke {
2
+ lineWidth?: number;
3
+ lineColor?: string;
4
+ points: number[];
5
+ }
6
+ export interface IGraffitiData {
7
+ pageNo: number;
8
+ strokes: IGraffitiStroke[];
9
+ }
10
+ export interface IGraffitiOption {
11
+ defaultLineWidth?: number;
12
+ defaultLineColor?: string;
13
+ }
@@ -0,0 +1,8 @@
1
+ export interface IGroup {
2
+ opacity?: number;
3
+ backgroundColor?: string;
4
+ activeOpacity?: number;
5
+ activeBackgroundColor?: string;
6
+ disabled?: boolean;
7
+ deletable?: boolean;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { MaxHeightRatio } from '../dataset/enum/Common';
2
+ export interface IHeader {
3
+ top?: number;
4
+ inactiveAlpha?: number;
5
+ maxHeightRadio?: MaxHeightRatio;
6
+ disabled?: boolean;
7
+ editable?: boolean;
8
+ }
@@ -0,0 +1,7 @@
1
+ import { IPadding } from './Common';
2
+ export interface ILabelOption {
3
+ defaultColor?: string;
4
+ defaultBackgroundColor?: string;
5
+ defaultBorderRadius?: number;
6
+ defaultPadding?: IPadding;
7
+ }
@@ -0,0 +1,5 @@
1
+ export interface ILineBreakOption {
2
+ disabled?: boolean;
3
+ color?: string;
4
+ lineWidth?: number;
5
+ }
@@ -0,0 +1,9 @@
1
+ import { LineNumberType } from '../dataset/enum/LineNumber';
2
+ export interface ILineNumberOption {
3
+ size?: number;
4
+ font?: string;
5
+ color?: string;
6
+ disabled?: boolean;
7
+ right?: number;
8
+ type?: LineNumberType;
9
+ }
@@ -0,0 +1,66 @@
1
+ import { EditorZone, PageMode } from '../dataset/enum/Editor';
2
+ import { ElementType } from '../dataset/enum/Element';
3
+ import { ListStyle, ListType } from '../dataset/enum/List';
4
+ import { RowFlex } from '../dataset/enum/Row';
5
+ import { TitleLevel } from '../dataset/enum/Title';
6
+ import { IControlChangeResult, IControlContentChangeResult } from './Control';
7
+ import { IEditorResult } from './Editor';
8
+ import { IElement } from './Element';
9
+ import { IPositionContext } from './Position';
10
+ import { ITextDecoration } from './Text';
11
+ export interface IRangeStyle {
12
+ type: ElementType | null;
13
+ undo: boolean;
14
+ redo: boolean;
15
+ painter: boolean;
16
+ font: string;
17
+ size: number;
18
+ bold: boolean;
19
+ italic: boolean;
20
+ underline: boolean;
21
+ strikeout: boolean;
22
+ color: string | null;
23
+ highlight: string | null;
24
+ rowFlex: RowFlex | null;
25
+ rowMargin: number;
26
+ dashArray: number[];
27
+ level: TitleLevel | null;
28
+ listType: ListType | null;
29
+ listStyle: ListStyle | null;
30
+ groupIds: string[] | null;
31
+ textDecoration: ITextDecoration | null;
32
+ extension?: unknown | null;
33
+ }
34
+ export type IRangeStyleChange = (payload: IRangeStyle) => void;
35
+ export type IVisiblePageNoListChange = (payload: number[]) => void;
36
+ export type IIntersectionPageNoChange = (payload: number) => void;
37
+ export type IPageSizeChange = (payload: number) => void;
38
+ export type IPageScaleChange = (payload: number) => void;
39
+ export type ISaved = (payload: IEditorResult) => void;
40
+ export type IContentChange = () => void;
41
+ export type IControlChange = (payload: IControlChangeResult) => void;
42
+ export type IControlContentChange = (payload: IControlContentChangeResult) => void;
43
+ export type IPageModeChange = (payload: PageMode) => void;
44
+ export type IZoneChange = (payload: EditorZone) => void;
45
+ export type IMouseEventChange = (evt: MouseEvent) => void;
46
+ export type IInputEventChange = (evt: Event) => void;
47
+ export interface IPositionContextChangePayload {
48
+ value: IPositionContext;
49
+ oldValue: IPositionContext;
50
+ }
51
+ export type IPositionContextChange = (payload: IPositionContextChangePayload) => void;
52
+ export type IImageSizeChange = (payload: {
53
+ element: IElement;
54
+ }) => void;
55
+ export type IImageMousedown = (payload: {
56
+ evt: MouseEvent;
57
+ element: IElement;
58
+ }) => void;
59
+ export type IImageDblclick = (payload: {
60
+ evt: MouseEvent;
61
+ element: IElement;
62
+ }) => void;
63
+ export type ILabelMousedown = (payload: {
64
+ evt: MouseEvent;
65
+ element: IElement;
66
+ }) => void;
@@ -0,0 +1 @@
1
+ export type IMargin = [top: number, right: number, bottom: number, left: number];
@@ -0,0 +1,7 @@
1
+ import { IPadding } from './Common';
2
+ export interface IPageBorderOption {
3
+ color?: string;
4
+ lineWidth?: number;
5
+ padding?: IPadding;
6
+ disabled?: boolean;
7
+ }
@@ -0,0 +1,5 @@
1
+ export interface IPageBreak {
2
+ font?: string;
3
+ fontSize?: number;
4
+ lineDash?: number[];
5
+ }
@@ -0,0 +1,15 @@
1
+ import { NumberType } from '../dataset/enum/Common';
2
+ import { RowFlex } from '../dataset/enum/Row';
3
+ export interface IPageNumber {
4
+ bottom?: number;
5
+ size?: number;
6
+ font?: string;
7
+ color?: string;
8
+ rowFlex?: RowFlex;
9
+ format?: string;
10
+ numberType?: NumberType;
11
+ disabled?: boolean;
12
+ startPageNo?: number;
13
+ fromPageNo?: number;
14
+ maxPageNo?: number | null;
15
+ }
@@ -0,0 +1,7 @@
1
+ export interface IPlaceholder {
2
+ data: string;
3
+ color?: string;
4
+ opacity?: number;
5
+ size?: number;
6
+ font?: string;
7
+ }
@@ -0,0 +1,3 @@
1
+ import Editor from '..';
2
+ export type PluginFunction<Options> = (editor: Editor, options?: Options) => void;
3
+ export type UsePlugin = <Options>(pluginFunction: PluginFunction<Options>, options?: Options) => void;
@@ -0,0 +1,103 @@
1
+ import { ImageDisplay } from '../dataset/enum/Common';
2
+ import { EditorZone } from '../dataset/enum/Editor';
3
+ import { IElement, IElementFillRect, IElementPosition } from './Element';
4
+ import { IRange } from './Range';
5
+ import { IRow, IRowElement } from './Row';
6
+ import { ITd } from './table/Td';
7
+ export interface ICurrentPosition {
8
+ index: number;
9
+ x?: number;
10
+ y?: number;
11
+ isCheckbox?: boolean;
12
+ isRadio?: boolean;
13
+ isControl?: boolean;
14
+ isImage?: boolean;
15
+ isLabel?: boolean;
16
+ isTable?: boolean;
17
+ isDirectHit?: boolean;
18
+ trIndex?: number;
19
+ tdIndex?: number;
20
+ tdValueIndex?: number;
21
+ tdId?: string;
22
+ trId?: string;
23
+ tableId?: string;
24
+ zone?: EditorZone;
25
+ hitLineStartIndex?: number;
26
+ }
27
+ export interface IGetPositionByXYPayload {
28
+ x: number;
29
+ y: number;
30
+ pageNo?: number;
31
+ isTable?: boolean;
32
+ td?: ITd;
33
+ tablePosition?: IElementPosition;
34
+ elementList?: IElement[];
35
+ positionList?: IElementPosition[];
36
+ }
37
+ export type IGetFloatPositionByXYPayload = IGetPositionByXYPayload & {
38
+ imgDisplays: ImageDisplay[];
39
+ };
40
+ export interface IPositionContext {
41
+ isTable: boolean;
42
+ isCheckbox?: boolean;
43
+ isRadio?: boolean;
44
+ isControl?: boolean;
45
+ isImage?: boolean;
46
+ isLabel?: boolean;
47
+ isDirectHit?: boolean;
48
+ index?: number;
49
+ trIndex?: number;
50
+ tdIndex?: number;
51
+ tdId?: string;
52
+ trId?: string;
53
+ tableId?: string;
54
+ }
55
+ export interface IComputeRowPositionPayload {
56
+ row: IRow;
57
+ innerWidth: number;
58
+ }
59
+ export interface IComputePageRowPositionPayload {
60
+ positionList: IElementPosition[];
61
+ rowList: IRow[];
62
+ pageNo: number;
63
+ startRowIndex: number;
64
+ startIndex: number;
65
+ startX: number;
66
+ startY: number;
67
+ innerWidth: number;
68
+ isTable?: boolean;
69
+ index?: number;
70
+ tdIndex?: number;
71
+ trIndex?: number;
72
+ tdValueIndex?: number;
73
+ zone?: EditorZone;
74
+ }
75
+ export interface IComputePageRowPositionResult {
76
+ x: number;
77
+ y: number;
78
+ index: number;
79
+ }
80
+ export interface IFloatPosition {
81
+ pageNo: number;
82
+ element: IElement;
83
+ position: IElementPosition;
84
+ isTable?: boolean;
85
+ index?: number;
86
+ tdIndex?: number;
87
+ trIndex?: number;
88
+ tdValueIndex?: number;
89
+ zone?: EditorZone;
90
+ }
91
+ export interface ILocationPosition {
92
+ zone: EditorZone;
93
+ range: IRange;
94
+ positionContext: IPositionContext;
95
+ }
96
+ export interface ISetSurroundPositionPayload {
97
+ row: IRow;
98
+ rowElement: IRowElement;
99
+ rowElementRect: IElementFillRect;
100
+ pageNo: number;
101
+ availableWidth: number;
102
+ surroundElementList: IElement[];
103
+ }
@@ -0,0 +1,13 @@
1
+ import { IElement } from './Element';
2
+ export interface IPreviewerCreateResult {
3
+ resizerSelection: HTMLDivElement;
4
+ resizerHandleList: HTMLDivElement[];
5
+ resizerImageContainer: HTMLDivElement;
6
+ resizerImage: HTMLImageElement;
7
+ resizerSize: HTMLSpanElement;
8
+ }
9
+ export interface IPreviewerDrawOption {
10
+ mime?: 'png' | 'jpg' | 'jpeg' | 'svg';
11
+ srcKey?: keyof Pick<IElement, 'value' | 'laTexSVG'>;
12
+ dragDisable?: boolean;
13
+ }
@@ -0,0 +1,15 @@
1
+ import { VerticalAlign } from '../dataset/enum/VerticalAlign';
2
+ export interface IRadio {
3
+ value: boolean | null;
4
+ code?: string;
5
+ disabled?: boolean;
6
+ }
7
+ export interface IRadioOption {
8
+ width?: number;
9
+ height?: number;
10
+ gap?: number;
11
+ lineWidth?: number;
12
+ fillStyle?: string;
13
+ strokeStyle?: string;
14
+ verticalAlign?: VerticalAlign;
15
+ }
@@ -0,0 +1,44 @@
1
+ import { EditorZone } from '../dataset/enum/Editor';
2
+ import { IElement, IElementFillRect, IElementStyle } from './Element';
3
+ export interface IRange {
4
+ startIndex: number;
5
+ endIndex: number;
6
+ isCrossRowCol?: boolean;
7
+ tableId?: string;
8
+ startTdIndex?: number;
9
+ endTdIndex?: number;
10
+ startTrIndex?: number;
11
+ endTrIndex?: number;
12
+ zone?: EditorZone;
13
+ }
14
+ export type RangeRowArray = Map<number, number[]>;
15
+ export type RangeRowMap = Map<number, Set<number>>;
16
+ export type RangeRect = IElementFillRect;
17
+ export type RangeContext = {
18
+ isCollapsed: boolean;
19
+ startElement: IElement;
20
+ endElement: IElement;
21
+ startPageNo: number;
22
+ endPageNo: number;
23
+ startRowNo: number;
24
+ endRowNo: number;
25
+ startColNo: number;
26
+ endColNo: number;
27
+ rangeRects: RangeRect[];
28
+ zone: EditorZone;
29
+ isTable: boolean;
30
+ trIndex: number | null;
31
+ tdIndex: number | null;
32
+ tableElement: IElement | null;
33
+ selectionText: string | null;
34
+ selectionElementList: IElement[];
35
+ titleId: string | null;
36
+ titleStartPageNo: number | null;
37
+ startParagraphNo: number;
38
+ endParagraphNo: number;
39
+ };
40
+ export interface IRangeParagraphInfo {
41
+ elementList: IElement[];
42
+ startIndex: number;
43
+ }
44
+ export type IRangeElementStyle = Pick<IElementStyle, 'bold' | 'color' | 'highlight' | 'font' | 'size' | 'italic' | 'underline' | 'strikeout'>;
@@ -0,0 +1,23 @@
1
+ import { RowFlex } from '../dataset/enum/Row';
2
+ import { IElement, IElementMetrics } from './Element';
3
+ export type IRowElement = IElement & {
4
+ metrics: IElementMetrics;
5
+ style: string;
6
+ left?: number;
7
+ };
8
+ export interface IRow {
9
+ width: number;
10
+ height: number;
11
+ ascent: number;
12
+ rowFlex?: RowFlex;
13
+ startIndex: number;
14
+ isPageBreak?: boolean;
15
+ isList?: boolean;
16
+ listIndex?: number;
17
+ offsetX?: number;
18
+ offsetY?: number;
19
+ elementList: IRowElement[];
20
+ isWidthNotEnough?: boolean;
21
+ rowIndex: number;
22
+ isSurround?: boolean;
23
+ }