@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.
- package/CHANGELOG.md +2543 -0
- package/LICENSE +21 -0
- package/README.md +110 -0
- package/dist/canvas-editor.es.js +25197 -0
- package/dist/canvas-editor.es.js.map +1 -0
- package/dist/canvas-editor.umd.js +97 -0
- package/dist/canvas-editor.umd.js.map +1 -0
- package/dist/src/editor/core/actuator/Actuator.d.ts +7 -0
- package/dist/src/editor/core/actuator/handlers/positionContextChange.d.ts +3 -0
- package/dist/src/editor/core/command/Command.d.ts +147 -0
- package/dist/src/editor/core/command/CommandAdapt.d.ts +190 -0
- package/dist/src/editor/core/contextmenu/ContextMenu.d.ts +31 -0
- package/dist/src/editor/core/contextmenu/menus/controlMenus.d.ts +2 -0
- package/dist/src/editor/core/contextmenu/menus/globalMenus.d.ts +2 -0
- package/dist/src/editor/core/contextmenu/menus/hyperlinkMenus.d.ts +2 -0
- package/dist/src/editor/core/contextmenu/menus/imageMenus.d.ts +2 -0
- package/dist/src/editor/core/contextmenu/menus/tableMenus.d.ts +2 -0
- package/dist/src/editor/core/cursor/Cursor.d.ts +41 -0
- package/dist/src/editor/core/cursor/CursorAgent.d.ts +16 -0
- package/dist/src/editor/core/draw/Draw.d.ts +252 -0
- package/dist/src/editor/core/draw/control/Control.d.ts +73 -0
- package/dist/src/editor/core/draw/control/checkbox/CheckboxControl.d.ts +16 -0
- package/dist/src/editor/core/draw/control/date/DateControl.d.ts +24 -0
- package/dist/src/editor/core/draw/control/interactive/ControlSearch.d.ts +20 -0
- package/dist/src/editor/core/draw/control/number/Calculator.d.ts +16 -0
- package/dist/src/editor/core/draw/control/number/NumberControl.d.ts +13 -0
- package/dist/src/editor/core/draw/control/radio/RadioControl.d.ts +5 -0
- package/dist/src/editor/core/draw/control/richtext/Border.d.ts +10 -0
- package/dist/src/editor/core/draw/control/select/SelectControl.d.ts +28 -0
- package/dist/src/editor/core/draw/control/text/TextControl.d.ts +18 -0
- package/dist/src/editor/core/draw/frame/Background.d.ts +11 -0
- package/dist/src/editor/core/draw/frame/Badge.d.ts +14 -0
- package/dist/src/editor/core/draw/frame/Footer.d.ts +27 -0
- package/dist/src/editor/core/draw/frame/Header.d.ts +27 -0
- package/dist/src/editor/core/draw/frame/LineNumber.d.ts +7 -0
- package/dist/src/editor/core/draw/frame/Margin.d.ts +7 -0
- package/dist/src/editor/core/draw/frame/PageBorder.d.ts +9 -0
- package/dist/src/editor/core/draw/frame/PageNumber.d.ts +9 -0
- package/dist/src/editor/core/draw/frame/Placeholder.d.ts +20 -0
- package/dist/src/editor/core/draw/frame/Watermark.d.ts +10 -0
- package/dist/src/editor/core/draw/graffiti/Graffiti.d.ts +19 -0
- package/dist/src/editor/core/draw/interactive/Area.d.ts +27 -0
- package/dist/src/editor/core/draw/interactive/Group.d.ts +18 -0
- package/dist/src/editor/core/draw/interactive/Search.d.ts +30 -0
- package/dist/src/editor/core/draw/particle/CheckboxParticle.d.ts +18 -0
- package/dist/src/editor/core/draw/particle/HyperlinkParticle.d.ts +17 -0
- package/dist/src/editor/core/draw/particle/ImageParticle.d.ts +23 -0
- package/dist/src/editor/core/draw/particle/LabelParticle.d.ts +8 -0
- package/dist/src/editor/core/draw/particle/LineBreakParticle.d.ts +10 -0
- package/dist/src/editor/core/draw/particle/ListParticle.d.ts +20 -0
- package/dist/src/editor/core/draw/particle/PageBreakParticle.d.ts +9 -0
- package/dist/src/editor/core/draw/particle/RadioParticle.d.ts +18 -0
- package/dist/src/editor/core/draw/particle/SeparatorParticle.d.ts +7 -0
- package/dist/src/editor/core/draw/particle/SubscriptParticle.d.ts +5 -0
- package/dist/src/editor/core/draw/particle/SuperscriptParticle.d.ts +5 -0
- package/dist/src/editor/core/draw/particle/TextParticle.d.ts +29 -0
- package/dist/src/editor/core/draw/particle/WhiteSpaceParticle.d.ts +7 -0
- package/dist/src/editor/core/draw/particle/block/BlockParticle.d.ts +14 -0
- package/dist/src/editor/core/draw/particle/block/modules/BaseBlock.d.ts +33 -0
- package/dist/src/editor/core/draw/particle/block/modules/IFrameBlock.d.ts +9 -0
- package/dist/src/editor/core/draw/particle/block/modules/VideoBlock.d.ts +8 -0
- package/dist/src/editor/core/draw/particle/date/DateParticle.d.ts +13 -0
- package/dist/src/editor/core/draw/particle/date/DatePicker.d.ts +64 -0
- package/dist/src/editor/core/draw/particle/latex/LaTexParticle.d.ts +7 -0
- package/dist/src/editor/core/draw/particle/latex/utils/LaTexUtils.d.ts +47 -0
- package/dist/src/editor/core/draw/particle/latex/utils/hershey.d.ts +10 -0
- package/dist/src/editor/core/draw/particle/latex/utils/symbols.d.ts +8 -0
- package/dist/src/editor/core/draw/particle/previewer/Previewer.d.ts +47 -0
- package/dist/src/editor/core/draw/particle/table/TableOperate.d.ts +32 -0
- package/dist/src/editor/core/draw/particle/table/TableParticle.d.ts +24 -0
- package/dist/src/editor/core/draw/particle/table/TableTool.d.ts +31 -0
- package/dist/src/editor/core/draw/richtext/AbstractRichText.d.ts +11 -0
- package/dist/src/editor/core/draw/richtext/Highlight.d.ts +7 -0
- package/dist/src/editor/core/draw/richtext/Strikeout.d.ts +7 -0
- package/dist/src/editor/core/draw/richtext/Underline.d.ts +10 -0
- package/dist/src/editor/core/event/CanvasEvent.d.ts +52 -0
- package/dist/src/editor/core/event/GlobalEvent.d.ts +26 -0
- package/dist/src/editor/core/event/eventbus/EventBus.d.ts +9 -0
- package/dist/src/editor/core/event/handlers/click.d.ts +11 -0
- package/dist/src/editor/core/event/handlers/composition.d.ts +8 -0
- package/dist/src/editor/core/event/handlers/copy.d.ts +3 -0
- package/dist/src/editor/core/event/handlers/cut.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/drag.d.ts +6 -0
- package/dist/src/editor/core/event/handlers/drop.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/input.d.ts +3 -0
- package/dist/src/editor/core/event/handlers/keydown/backspace.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/keydown/delete.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/keydown/enter.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/keydown/index.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/keydown/left.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/keydown/right.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/keydown/tab.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/keydown/updown.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/mousedown.d.ts +7 -0
- package/dist/src/editor/core/event/handlers/mouseleave.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/mousemove.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/mouseup.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/paste.d.ts +8 -0
- package/dist/src/editor/core/history/HistoryManager.d.ts +15 -0
- package/dist/src/editor/core/i18n/I18n.d.ts +12 -0
- package/dist/src/editor/core/listener/Listener.d.ts +15 -0
- package/dist/src/editor/core/observer/ImageObserver.d.ts +7 -0
- package/dist/src/editor/core/observer/MouseObserver.d.ts +13 -0
- package/dist/src/editor/core/observer/ScrollObserver.d.ts +20 -0
- package/dist/src/editor/core/observer/SelectionObserver.d.ts +22 -0
- package/dist/src/editor/core/override/Override.d.ts +8 -0
- package/dist/src/editor/core/plugin/Plugin.d.ts +7 -0
- package/dist/src/editor/core/position/Position.d.ts +37 -0
- package/dist/src/editor/core/range/RangeManager.d.ts +45 -0
- package/dist/src/editor/core/register/Register.d.ts +20 -0
- package/dist/src/editor/core/shortcut/Shortcut.d.ts +16 -0
- package/dist/src/editor/core/shortcut/keys/listKeys.d.ts +2 -0
- package/dist/src/editor/core/shortcut/keys/richtextKeys.d.ts +2 -0
- package/dist/src/editor/core/shortcut/keys/titleKeys.d.ts +2 -0
- package/dist/src/editor/core/worker/WorkerManager.d.ts +16 -0
- package/dist/src/editor/core/worker/works/catalog.d.ts +1 -0
- package/dist/src/editor/core/worker/works/group.d.ts +1 -0
- package/dist/src/editor/core/worker/works/value.d.ts +1 -0
- package/dist/src/editor/core/worker/works/wordCount.d.ts +1 -0
- package/dist/src/editor/core/zone/Zone.d.ts +21 -0
- package/dist/src/editor/core/zone/ZoneTip.d.ts +17 -0
- package/dist/src/editor/dataset/constant/Background.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Badge.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Checkbox.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Common.d.ts +21 -0
- package/dist/src/editor/dataset/constant/ContextMenu.d.ts +60 -0
- package/dist/src/editor/dataset/constant/Control.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Cursor.d.ts +3 -0
- package/dist/src/editor/dataset/constant/Editor.d.ts +6 -0
- package/dist/src/editor/dataset/constant/Element.d.ts +21 -0
- package/dist/src/editor/dataset/constant/Footer.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Graffiti.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Group.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Header.d.ts +2 -0
- package/dist/src/editor/dataset/constant/ImgCaption.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Label.d.ts +2 -0
- package/dist/src/editor/dataset/constant/LineBreak.d.ts +2 -0
- package/dist/src/editor/dataset/constant/LineNumber.d.ts +2 -0
- package/dist/src/editor/dataset/constant/List.d.ts +6 -0
- package/dist/src/editor/dataset/constant/PageBorder.d.ts +2 -0
- package/dist/src/editor/dataset/constant/PageBreak.d.ts +2 -0
- package/dist/src/editor/dataset/constant/PageNumber.d.ts +6 -0
- package/dist/src/editor/dataset/constant/Placeholder.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Radio.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Regular.d.ts +10 -0
- package/dist/src/editor/dataset/constant/Separator.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Shortcut.d.ts +3 -0
- package/dist/src/editor/dataset/constant/Table.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Title.d.ts +6 -0
- package/dist/src/editor/dataset/constant/Watermark.d.ts +2 -0
- package/dist/src/editor/dataset/constant/WhiteSpace.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Zone.d.ts +2 -0
- package/dist/src/editor/dataset/enum/Area.d.ts +5 -0
- package/dist/src/editor/dataset/enum/Background.d.ts +10 -0
- package/dist/src/editor/dataset/enum/Block.d.ts +4 -0
- package/dist/src/editor/dataset/enum/Common.d.ts +26 -0
- package/dist/src/editor/dataset/enum/Control.d.ts +32 -0
- package/dist/src/editor/dataset/enum/Editor.d.ts +44 -0
- package/dist/src/editor/dataset/enum/Element.d.ts +21 -0
- package/dist/src/editor/dataset/enum/ElementStyle.d.ts +12 -0
- package/dist/src/editor/dataset/enum/Event.d.ts +5 -0
- package/dist/src/editor/dataset/enum/KeyMap.d.ts +83 -0
- package/dist/src/editor/dataset/enum/LineNumber.d.ts +4 -0
- package/dist/src/editor/dataset/enum/List.d.ts +20 -0
- package/dist/src/editor/dataset/enum/Observer.d.ts +6 -0
- package/dist/src/editor/dataset/enum/Row.d.ts +7 -0
- package/dist/src/editor/dataset/enum/Text.d.ts +12 -0
- package/dist/src/editor/dataset/enum/Title.d.ts +8 -0
- package/dist/src/editor/dataset/enum/VerticalAlign.d.ts +5 -0
- package/dist/src/editor/dataset/enum/Watermark.d.ts +4 -0
- package/dist/src/editor/dataset/enum/table/Table.d.ts +17 -0
- package/dist/src/editor/dataset/enum/table/TableTool.d.ts +4 -0
- package/dist/src/editor/index.d.ts +59 -0
- package/dist/src/editor/interface/Area.d.ts +55 -0
- package/dist/src/editor/interface/Background.d.ts +8 -0
- package/dist/src/editor/interface/Badge.d.ts +15 -0
- package/dist/src/editor/interface/Block.d.ts +15 -0
- package/dist/src/editor/interface/Catalog.d.ts +9 -0
- package/dist/src/editor/interface/Checkbox.d.ts +15 -0
- package/dist/src/editor/interface/Command.d.ts +3 -0
- package/dist/src/editor/interface/Common.d.ts +14 -0
- package/dist/src/editor/interface/Control.d.ts +198 -0
- package/dist/src/editor/interface/Cursor.d.ts +7 -0
- package/dist/src/editor/interface/Draw.d.ts +74 -0
- package/dist/src/editor/interface/Editor.d.ts +143 -0
- package/dist/src/editor/interface/Element.d.ts +234 -0
- package/dist/src/editor/interface/Event.d.ts +22 -0
- package/dist/src/editor/interface/EventBus.d.ts +26 -0
- package/dist/src/editor/interface/Footer.d.ts +8 -0
- package/dist/src/editor/interface/Graffiti.d.ts +13 -0
- package/dist/src/editor/interface/Group.d.ts +8 -0
- package/dist/src/editor/interface/Header.d.ts +8 -0
- package/dist/src/editor/interface/Label.d.ts +7 -0
- package/dist/src/editor/interface/LineBreak.d.ts +5 -0
- package/dist/src/editor/interface/LineNumber.d.ts +9 -0
- package/dist/src/editor/interface/Listener.d.ts +66 -0
- package/dist/src/editor/interface/Margin.d.ts +1 -0
- package/dist/src/editor/interface/PageBorder.d.ts +7 -0
- package/dist/src/editor/interface/PageBreak.d.ts +5 -0
- package/dist/src/editor/interface/PageNumber.d.ts +15 -0
- package/dist/src/editor/interface/Placeholder.d.ts +7 -0
- package/dist/src/editor/interface/Plugin.d.ts +3 -0
- package/dist/src/editor/interface/Position.d.ts +103 -0
- package/dist/src/editor/interface/Previewer.d.ts +13 -0
- package/dist/src/editor/interface/Radio.d.ts +15 -0
- package/dist/src/editor/interface/Range.d.ts +44 -0
- package/dist/src/editor/interface/Row.d.ts +23 -0
- package/dist/src/editor/interface/Search.d.ts +30 -0
- package/dist/src/editor/interface/Separator.d.ts +4 -0
- package/dist/src/editor/interface/Text.d.ts +13 -0
- package/dist/src/editor/interface/Title.d.ts +26 -0
- package/dist/src/editor/interface/Watermark.d.ts +15 -0
- package/dist/src/editor/interface/WhiteSpace.d.ts +5 -0
- package/dist/src/editor/interface/Zone.d.ts +3 -0
- package/dist/src/editor/interface/contextmenu/ContextMenu.d.ts +73 -0
- package/dist/src/editor/interface/i18n/I18n.d.ts +6 -0
- package/dist/src/editor/interface/shortcut/Shortcut.d.ts +13 -0
- package/dist/src/editor/interface/table/Colgroup.d.ts +4 -0
- package/dist/src/editor/interface/table/Table.d.ts +8 -0
- package/dist/src/editor/interface/table/Td.d.ts +35 -0
- package/dist/src/editor/interface/table/Tr.d.ts +10 -0
- package/dist/src/editor/utils/clipboard.d.ts +13 -0
- package/dist/src/editor/utils/element.d.ts +57 -0
- package/dist/src/editor/utils/hotkey.d.ts +1 -0
- package/dist/src/editor/utils/index.d.ts +34 -0
- package/dist/src/editor/utils/option.d.ts +3 -0
- package/dist/src/editor/utils/paragraph.d.ts +8 -0
- package/dist/src/editor/utils/print.d.ts +7 -0
- package/dist/src/editor/utils/ua.d.ts +4 -0
- 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,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,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,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,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
|
+
}
|