@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,55 @@
1
+ import { AreaMode } from '../dataset/enum/Area';
2
+ import { LocationPosition } from '../dataset/enum/Common';
3
+ import { IElement, IElementPosition } from './Element';
4
+ import { IPlaceholder } from './Placeholder';
5
+ import { IRange } from './Range';
6
+ export interface IAreaBasic {
7
+ extension?: unknown;
8
+ placeholder?: IPlaceholder;
9
+ }
10
+ export interface IAreaStyle {
11
+ top?: number;
12
+ borderColor?: string;
13
+ backgroundColor?: string;
14
+ }
15
+ export interface IAreaRule {
16
+ mode?: AreaMode;
17
+ hide?: boolean;
18
+ deletable?: boolean;
19
+ }
20
+ export type IArea = IAreaBasic & IAreaStyle & IAreaRule;
21
+ export interface IInsertAreaOption {
22
+ id?: string;
23
+ area: IArea;
24
+ value: IElement[];
25
+ position?: LocationPosition;
26
+ range?: Pick<IRange, 'startIndex' | 'endIndex'>;
27
+ }
28
+ export interface ISetAreaValueOption {
29
+ id?: string;
30
+ value: IElement[];
31
+ }
32
+ export interface ISetAreaPropertiesOption {
33
+ id?: string;
34
+ properties: IArea;
35
+ }
36
+ export interface IGetAreaValueOption {
37
+ id?: string;
38
+ }
39
+ export interface IGetAreaValueResult {
40
+ id?: string;
41
+ area: IArea;
42
+ startPageNo: number;
43
+ endPageNo: number;
44
+ value: IElement[];
45
+ }
46
+ export interface IAreaInfo {
47
+ id: string;
48
+ area: IArea;
49
+ elementList: IElement[];
50
+ positionList: IElementPosition[];
51
+ }
52
+ export interface ILocationAreaOption {
53
+ position: LocationPosition;
54
+ isAppendLastLineBreak?: boolean;
55
+ }
@@ -0,0 +1,8 @@
1
+ import { BackgroundRepeat, BackgroundSize } from '../dataset/enum/Background';
2
+ export interface IBackgroundOption {
3
+ color?: string;
4
+ image?: string;
5
+ size?: BackgroundSize;
6
+ repeat?: BackgroundRepeat;
7
+ applyPageNumbers?: number[];
8
+ }
@@ -0,0 +1,15 @@
1
+ export interface IBadge {
2
+ top?: number;
3
+ left?: number;
4
+ width: number;
5
+ height: number;
6
+ value: string;
7
+ }
8
+ export interface IBadgeOption {
9
+ top?: number;
10
+ left?: number;
11
+ }
12
+ export interface IAreaBadge {
13
+ areaId: string;
14
+ badge: IBadge;
15
+ }
@@ -0,0 +1,15 @@
1
+ import { BlockType } from '../dataset/enum/Block';
2
+ export interface IIFrameBlock {
3
+ src?: string;
4
+ srcdoc?: string;
5
+ sandbox?: string[];
6
+ allow?: string[];
7
+ }
8
+ export interface IVideoBlock {
9
+ src: string;
10
+ }
11
+ export interface IBlock {
12
+ type: BlockType;
13
+ iframeBlock?: IIFrameBlock;
14
+ videoBlock?: IVideoBlock;
15
+ }
@@ -0,0 +1,9 @@
1
+ import { TitleLevel } from '../dataset/enum/Title';
2
+ export interface ICatalogItem {
3
+ id: string;
4
+ name: string;
5
+ level: TitleLevel;
6
+ pageNo: number;
7
+ subCatalog: ICatalogItem[];
8
+ }
9
+ export type ICatalog = ICatalogItem[];
@@ -0,0 +1,15 @@
1
+ import { VerticalAlign } from '../dataset/enum/VerticalAlign';
2
+ export interface ICheckbox {
3
+ value: boolean | null;
4
+ code?: string;
5
+ disabled?: boolean;
6
+ }
7
+ export interface ICheckboxOption {
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,3 @@
1
+ export interface IRichtextOption {
2
+ isIgnoreDisabledRule: boolean;
3
+ }
@@ -0,0 +1,14 @@
1
+ export type Primitive = string | number | boolean | bigint | symbol | undefined | null;
2
+ export type Builtin = Primitive | Function | Date | Error | RegExp;
3
+ export type DeepRequired<T> = T extends Error ? Required<T> : T extends Builtin ? T : T extends Map<infer K, infer V> ? Map<DeepRequired<K>, DeepRequired<V>> : T extends ReadonlyMap<infer K, infer V> ? ReadonlyMap<DeepRequired<K>, DeepRequired<V>> : T extends WeakMap<infer K, infer V> ? WeakMap<DeepRequired<K>, DeepRequired<V>> : T extends Set<infer U> ? Set<DeepRequired<U>> : T extends ReadonlySet<infer U> ? ReadonlySet<DeepRequired<U>> : T extends WeakSet<infer U> ? WeakSet<DeepRequired<U>> : T extends Promise<infer U> ? Promise<DeepRequired<U>> : T extends {} ? {
4
+ [K in keyof T]-?: DeepRequired<T[K]>;
5
+ } : Required<T>;
6
+ export type DeepPartial<T> = {
7
+ [P in keyof T]?: DeepPartial<T[P]>;
8
+ };
9
+ export type IPadding = [
10
+ top: number,
11
+ right: number,
12
+ bottom: number,
13
+ left: number
14
+ ];
@@ -0,0 +1,198 @@
1
+ import { FlexDirection, LocationPosition } from '../dataset/enum/Common';
2
+ import { ControlType, ControlIndentation, ControlState } from '../dataset/enum/Control';
3
+ import { EditorZone } from '../dataset/enum/Editor';
4
+ import { MoveDirection } from '../dataset/enum/Observer';
5
+ import { RowFlex } from '../dataset/enum/Row';
6
+ import { IDrawOption } from './Draw';
7
+ import { IElement } from './Element';
8
+ import { IPositionContext } from './Position';
9
+ import { IRange } from './Range';
10
+ import { IRow, IRowElement } from './Row';
11
+ export interface IValueSet {
12
+ value: string;
13
+ code: string;
14
+ }
15
+ export interface IControlSelect {
16
+ code: string | null;
17
+ valueSets: IValueSet[];
18
+ isMultiSelect?: boolean;
19
+ multiSelectDelimiter?: string;
20
+ selectExclusiveOptions?: {
21
+ inputAble?: boolean;
22
+ };
23
+ }
24
+ export interface IControlCheckbox {
25
+ code: string | null;
26
+ min?: number;
27
+ max?: number;
28
+ flexDirection: FlexDirection;
29
+ valueSets: IValueSet[];
30
+ }
31
+ export interface IControlRadio {
32
+ code: string | null;
33
+ flexDirection: FlexDirection;
34
+ valueSets: IValueSet[];
35
+ }
36
+ export interface IControlDate {
37
+ dateFormat?: string;
38
+ }
39
+ export interface IControlNumber {
40
+ numberExclusiveOptions?: {
41
+ calculatorDisabled?: boolean;
42
+ };
43
+ }
44
+ export interface IControlHighlightRule {
45
+ keyword: string;
46
+ alpha?: number;
47
+ backgroundColor?: string;
48
+ }
49
+ export interface IControlHighlight {
50
+ ruleList: IControlHighlightRule[];
51
+ id?: string;
52
+ conceptId?: string;
53
+ }
54
+ export interface IControlRule {
55
+ deletable?: boolean;
56
+ disabled?: boolean;
57
+ pasteDisabled?: boolean;
58
+ hide?: boolean;
59
+ }
60
+ export interface IControlBasic {
61
+ type: ControlType;
62
+ value: IElement[] | null;
63
+ placeholder?: string;
64
+ conceptId?: string;
65
+ groupId?: string;
66
+ prefix?: string;
67
+ postfix?: string;
68
+ minWidth?: number;
69
+ underline?: boolean;
70
+ border?: boolean;
71
+ extension?: unknown;
72
+ indentation?: ControlIndentation;
73
+ rowFlex?: RowFlex;
74
+ preText?: string;
75
+ postText?: string;
76
+ }
77
+ export interface IControlStyle {
78
+ font?: string;
79
+ size?: number;
80
+ bold?: boolean;
81
+ highlight?: string;
82
+ italic?: boolean;
83
+ strikeout?: boolean;
84
+ }
85
+ export type IControl = IControlBasic & IControlRule & Partial<IControlStyle> & Partial<IControlSelect> & Partial<IControlCheckbox> & Partial<IControlRadio> & Partial<IControlDate> & Partial<IControlNumber>;
86
+ export interface IControlOption {
87
+ placeholderColor?: string;
88
+ bracketColor?: string;
89
+ prefix?: string;
90
+ postfix?: string;
91
+ borderWidth?: number;
92
+ borderColor?: string;
93
+ activeBackgroundColor?: string;
94
+ disabledBackgroundColor?: string;
95
+ existValueBackgroundColor?: string;
96
+ noValueBackgroundColor?: string;
97
+ }
98
+ export interface IControlInitOption {
99
+ index: number;
100
+ isTable?: boolean;
101
+ trIndex?: number;
102
+ tdIndex?: number;
103
+ tdValueIndex?: number;
104
+ }
105
+ export interface IControlInitResult {
106
+ newIndex: number;
107
+ }
108
+ export interface IControlInstance {
109
+ setElement(element: IElement): void;
110
+ getElement(): IElement;
111
+ getValue(context?: IControlContext): IElement[];
112
+ setValue(data: IElement[], context?: IControlContext, options?: IControlRuleOption): number;
113
+ keydown(evt: KeyboardEvent): number | null;
114
+ cut(): number;
115
+ }
116
+ export interface IControlContext {
117
+ range?: IRange;
118
+ elementList?: IElement[];
119
+ }
120
+ export interface IControlRuleOption {
121
+ isIgnoreDisabledRule?: boolean;
122
+ isIgnoreDeletedRule?: boolean;
123
+ isAddPlaceholder?: boolean;
124
+ }
125
+ export interface IGetControlValueOption {
126
+ id?: string;
127
+ groupId?: string;
128
+ conceptId?: string;
129
+ areaId?: string;
130
+ }
131
+ export type IGetControlValueResult = (Omit<IControl, 'value'> & {
132
+ value: string | null;
133
+ innerText: string | null;
134
+ zone: EditorZone;
135
+ elementList?: IElement[];
136
+ })[];
137
+ export interface ISetControlValueOption {
138
+ id?: string;
139
+ groupId?: string;
140
+ conceptId?: string;
141
+ areaId?: string;
142
+ value: string | IElement[] | null;
143
+ isSubmitHistory?: boolean;
144
+ }
145
+ export interface ISetControlExtensionOption {
146
+ id?: string;
147
+ groupId?: string;
148
+ conceptId?: string;
149
+ areaId?: string;
150
+ extension: unknown;
151
+ }
152
+ export type ISetControlHighlightOption = IControlHighlight[];
153
+ export type ISetControlProperties = {
154
+ id?: string;
155
+ groupId?: string;
156
+ conceptId?: string;
157
+ areaId?: string;
158
+ properties: Partial<Omit<IControl, 'value'>>;
159
+ isSubmitHistory?: boolean;
160
+ };
161
+ export type IRepaintControlOption = Pick<IDrawOption, 'curIndex' | 'isCompute' | 'isSubmitHistory' | 'isSetCursor'>;
162
+ export interface IControlChangeOption {
163
+ context?: IControlContext;
164
+ controlElement?: IElement;
165
+ controlValue?: IElement[];
166
+ }
167
+ export interface INextControlContext {
168
+ positionContext: IPositionContext;
169
+ nextIndex: number;
170
+ }
171
+ export interface IInitNextControlOption {
172
+ direction?: MoveDirection;
173
+ }
174
+ export interface ILocationControlOption {
175
+ position: LocationPosition;
176
+ }
177
+ export interface ISetControlRowFlexOption {
178
+ row: IRow;
179
+ rowElement: IRowElement;
180
+ availableWidth: number;
181
+ controlRealWidth: number;
182
+ }
183
+ export interface IControlChangeResult {
184
+ state: ControlState;
185
+ control: IControl;
186
+ controlId: string;
187
+ }
188
+ export interface IControlContentChangeResult {
189
+ control: IControl;
190
+ controlId: string;
191
+ }
192
+ export interface IDestroyControlOption {
193
+ isEmitEvent?: boolean;
194
+ }
195
+ export interface IRemoveControlOption {
196
+ id?: string;
197
+ conceptId?: string;
198
+ }
@@ -0,0 +1,7 @@
1
+ export interface ICursorOption {
2
+ width?: number;
3
+ color?: string;
4
+ dragWidth?: number;
5
+ dragColor?: string;
6
+ dragFloatImageDisabled?: boolean;
7
+ }
@@ -0,0 +1,74 @@
1
+ import { ImageDisplay } from '../dataset/enum/Common';
2
+ import { EditorMode, EditorZone } from '../dataset/enum/Editor';
3
+ import { IElement, IElementPosition } from './Element';
4
+ import { IRow } from './Row';
5
+ export interface IDrawOption {
6
+ curIndex?: number;
7
+ isSetCursor?: boolean;
8
+ isSubmitHistory?: boolean;
9
+ isCompute?: boolean;
10
+ isLazy?: boolean;
11
+ isInit?: boolean;
12
+ isSourceHistory?: boolean;
13
+ isFirstRender?: boolean;
14
+ }
15
+ export interface IForceUpdateOption {
16
+ isSubmitHistory?: boolean;
17
+ }
18
+ export interface IDrawImagePayload {
19
+ id?: string;
20
+ conceptId?: string;
21
+ width: number;
22
+ height: number;
23
+ value: string;
24
+ imgDisplay?: ImageDisplay;
25
+ extension?: unknown;
26
+ }
27
+ export interface IDrawRowPayload {
28
+ elementList: IElement[];
29
+ positionList: IElementPosition[];
30
+ rowList: IRow[];
31
+ pageNo: number;
32
+ startIndex: number;
33
+ innerWidth: number;
34
+ zone?: EditorZone;
35
+ isDrawLineBreak?: boolean;
36
+ isDrawWhiteSpace?: boolean;
37
+ }
38
+ export interface IDrawFloatPayload {
39
+ pageNo: number;
40
+ imgDisplays: ImageDisplay[];
41
+ }
42
+ export interface IDrawPagePayload {
43
+ elementList: IElement[];
44
+ positionList: IElementPosition[];
45
+ rowList: IRow[];
46
+ pageNo: number;
47
+ }
48
+ export interface IPainterOption {
49
+ isDblclick: boolean;
50
+ }
51
+ export interface IGetValueOption {
52
+ pageNo?: number;
53
+ extraPickAttrs?: Array<keyof IElement>;
54
+ }
55
+ export type IGetOriginValueOption = Omit<IGetValueOption, 'extraPickAttrs'>;
56
+ export interface IAppendElementListOption {
57
+ isPrepend?: boolean;
58
+ isSubmitHistory?: boolean;
59
+ }
60
+ export interface IGetImageOption {
61
+ pixelRatio?: number;
62
+ mode?: EditorMode;
63
+ }
64
+ export interface IComputeRowListPayload {
65
+ innerWidth: number;
66
+ elementList: IElement[];
67
+ startX?: number;
68
+ startY?: number;
69
+ isFromTable?: boolean;
70
+ isPagingMode?: boolean;
71
+ pageHeight?: number;
72
+ mainOuterHeight?: number;
73
+ surroundElementList?: IElement[];
74
+ }
@@ -0,0 +1,143 @@
1
+ import { EditorMode, PageMode, PaperDirection, RenderMode, WordBreak } from '../dataset/enum/Editor';
2
+ import { IBackgroundOption } from './Background';
3
+ import { ICheckboxOption } from './Checkbox';
4
+ import { IRadioOption } from './Radio';
5
+ import { IControlOption } from './Control';
6
+ import { ICursorOption } from './Cursor';
7
+ import { IFooter } from './Footer';
8
+ import { IGroup } from './Group';
9
+ import { IHeader } from './Header';
10
+ import { ILabelOption } from './Label';
11
+ import { IImgCaptionOption, IListOption } from './Element';
12
+ import { ILineBreakOption } from './LineBreak';
13
+ import { IMargin } from './Margin';
14
+ import { IPageBreak } from './PageBreak';
15
+ import { IPageNumber } from './PageNumber';
16
+ import { IPlaceholder } from './Placeholder';
17
+ import { ITitleOption } from './Title';
18
+ import { IWatermark } from './Watermark';
19
+ import { IZoneOption } from './Zone';
20
+ import { ISeparatorOption } from './Separator';
21
+ import { ITableOption } from './table/Table';
22
+ import { ILineNumberOption } from './LineNumber';
23
+ import { IPageBorderOption } from './PageBorder';
24
+ import { IBadgeOption } from './Badge';
25
+ import { IElement } from './Element';
26
+ import { LocationPosition } from '../dataset/enum/Common';
27
+ import { IRange } from './Range';
28
+ import { IGraffitiData, IGraffitiOption } from './Graffiti';
29
+ import { IWhiteSpaceOption } from './WhiteSpace';
30
+ export interface IEditorData {
31
+ header?: IElement[];
32
+ main: IElement[];
33
+ footer?: IElement[];
34
+ graffiti?: IGraffitiData[];
35
+ }
36
+ export interface IEditorOption {
37
+ mode?: EditorMode;
38
+ locale?: string;
39
+ defaultType?: string;
40
+ defaultColor?: string;
41
+ defaultFont?: string;
42
+ defaultSize?: number;
43
+ minSize?: number;
44
+ maxSize?: number;
45
+ defaultBasicRowMarginHeight?: number;
46
+ defaultRowMargin?: number;
47
+ defaultTabWidth?: number;
48
+ width?: number;
49
+ height?: number;
50
+ scale?: number;
51
+ pageGap?: number;
52
+ underlineColor?: string;
53
+ strikeoutColor?: string;
54
+ rangeColor?: string;
55
+ rangeAlpha?: number;
56
+ rangeMinWidth?: number;
57
+ searchMatchColor?: string;
58
+ searchNavigateMatchColor?: string;
59
+ searchMatchAlpha?: number;
60
+ highlightAlpha?: number;
61
+ highlightMarginHeight?: number;
62
+ resizerColor?: string;
63
+ resizerSize?: number;
64
+ marginIndicatorSize?: number;
65
+ marginIndicatorColor?: string;
66
+ margins?: IMargin;
67
+ pageMode?: PageMode;
68
+ renderMode?: RenderMode;
69
+ defaultHyperlinkColor?: string;
70
+ paperDirection?: PaperDirection;
71
+ inactiveAlpha?: number;
72
+ historyMaxRecordCount?: number;
73
+ printPixelRatio?: number;
74
+ maskMargin?: IMargin;
75
+ letterClass?: string[];
76
+ contextMenuDisableKeys?: string[];
77
+ shortcutDisableKeys?: string[];
78
+ scrollContainerSelector?: string;
79
+ pageOuterSelectionDisable?: boolean;
80
+ wordBreak?: WordBreak;
81
+ table?: ITableOption;
82
+ header?: IHeader;
83
+ footer?: IFooter;
84
+ pageNumber?: IPageNumber;
85
+ watermark?: IWatermark;
86
+ control?: IControlOption;
87
+ checkbox?: ICheckboxOption;
88
+ radio?: IRadioOption;
89
+ cursor?: ICursorOption;
90
+ title?: ITitleOption;
91
+ placeholder?: IPlaceholder;
92
+ group?: IGroup;
93
+ pageBreak?: IPageBreak;
94
+ zone?: IZoneOption;
95
+ background?: IBackgroundOption;
96
+ lineBreak?: ILineBreakOption;
97
+ whiteSpace?: IWhiteSpaceOption;
98
+ separator?: ISeparatorOption;
99
+ lineNumber?: ILineNumberOption;
100
+ pageBorder?: IPageBorderOption;
101
+ badge?: IBadgeOption;
102
+ modeRule?: IModeRule;
103
+ graffiti?: IGraffitiOption;
104
+ label?: ILabelOption;
105
+ imgCaption?: IImgCaptionOption;
106
+ list?: IListOption;
107
+ }
108
+ export interface IEditorResult {
109
+ version: string;
110
+ data: IEditorData;
111
+ options: IEditorOption;
112
+ }
113
+ export interface IEditorHTML {
114
+ header: string;
115
+ main: string;
116
+ footer: string;
117
+ }
118
+ export type IEditorText = IEditorHTML;
119
+ export type IUpdateOption = Omit<IEditorOption, 'mode' | 'width' | 'height' | 'scale' | 'pageGap' | 'pageMode' | 'paperDirection' | 'historyMaxRecordCount' | 'scrollContainerSelector'>;
120
+ export interface ISetValueOption {
121
+ isSetCursor?: boolean;
122
+ }
123
+ export interface IFocusOption {
124
+ rowNo?: number;
125
+ range?: IRange;
126
+ position?: LocationPosition;
127
+ isMoveCursorToVisible?: boolean;
128
+ }
129
+ export interface IPrintModeRule {
130
+ imagePreviewerDisabled?: boolean;
131
+ backgroundDisabled?: boolean;
132
+ }
133
+ export interface IReadonlyModeRule {
134
+ imagePreviewerDisabled?: boolean;
135
+ }
136
+ export interface IFormModeRule {
137
+ controlDeletableDisabled?: boolean;
138
+ }
139
+ export interface IModeRule {
140
+ [EditorMode.PRINT]?: IPrintModeRule;
141
+ [EditorMode.READONLY]?: IReadonlyModeRule;
142
+ [EditorMode.FORM]?: IFormModeRule;
143
+ }