@hufe921/canvas-editor 1.0.6 → 1.1.0
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 +32 -0
- package/README.md +9 -8
- package/dist/assets/catalog-ezAM0r6o.js.map +1 -0
- package/dist/assets/group-BZtj1M7o.js.map +1 -1
- package/dist/assets/value-DKLIEqC1.js.map +1 -0
- package/dist/assets/wordCount-xSvDqE7d.js.map +1 -0
- package/dist/canvas-editor.js +4446 -2824
- package/dist/canvas-editor.js.map +1 -1
- package/dist/canvas-editor.umd.cjs +42 -42
- package/dist/canvas-editor.umd.cjs.map +1 -1
- package/dist/src/editor/core/command/Command.d.ts +5 -0
- package/dist/src/editor/core/command/CommandAdapt.d.ts +7 -2
- package/dist/src/editor/core/contextmenu/ContextMenu.d.ts +7 -0
- package/dist/src/editor/core/draw/Draw.d.ts +17 -10
- package/dist/src/editor/core/draw/column/ColumnManager.d.ts +2 -1
- package/dist/src/editor/core/draw/control/Control.d.ts +3 -2
- package/dist/src/editor/core/draw/control/interactive/ControlSearch.d.ts +2 -1
- package/dist/src/editor/core/draw/control/richtext/Border.d.ts +2 -1
- package/dist/src/editor/core/draw/frame/Background.d.ts +2 -1
- package/dist/src/editor/core/draw/frame/Badge.d.ts +3 -1
- package/dist/src/editor/core/draw/frame/Footer.d.ts +2 -1
- package/dist/src/editor/core/draw/frame/Header.d.ts +2 -1
- package/dist/src/editor/core/draw/frame/LineNumber.d.ts +2 -1
- package/dist/src/editor/core/draw/frame/Margin.d.ts +2 -1
- package/dist/src/editor/core/draw/frame/PageBorder.d.ts +2 -1
- package/dist/src/editor/core/draw/frame/PageNumber.d.ts +2 -1
- package/dist/src/editor/core/draw/frame/Placeholder.d.ts +2 -1
- package/dist/src/editor/core/draw/frame/Watermark.d.ts +4 -3
- package/dist/src/editor/core/draw/graffiti/Graffiti.d.ts +2 -1
- package/dist/src/editor/core/draw/interactive/Area.d.ts +2 -1
- package/dist/src/editor/core/draw/interactive/Group.d.ts +2 -1
- package/dist/src/editor/core/draw/interactive/Search.d.ts +2 -1
- package/dist/src/editor/core/draw/interactive/Spellcheck.d.ts +2 -1
- package/dist/src/editor/core/draw/particle/CheckboxParticle.d.ts +2 -1
- package/dist/src/editor/core/draw/particle/HyperlinkParticle.d.ts +2 -1
- package/dist/src/editor/core/draw/particle/ImageParticle.d.ts +3 -1
- package/dist/src/editor/core/draw/particle/LabelParticle.d.ts +2 -1
- package/dist/src/editor/core/draw/particle/LineBreakParticle.d.ts +2 -1
- package/dist/src/editor/core/draw/particle/ListParticle.d.ts +2 -1
- package/dist/src/editor/core/draw/particle/PageBreakParticle.d.ts +2 -1
- package/dist/src/editor/core/draw/particle/RadioParticle.d.ts +2 -1
- package/dist/src/editor/core/draw/particle/SeparatorParticle.d.ts +2 -1
- package/dist/src/editor/core/draw/particle/SubscriptParticle.d.ts +2 -1
- package/dist/src/editor/core/draw/particle/SuperscriptParticle.d.ts +2 -1
- package/dist/src/editor/core/draw/particle/TextParticle.d.ts +8 -2
- package/dist/src/editor/core/draw/particle/TraceParticle.d.ts +3 -2
- package/dist/src/editor/core/draw/particle/WhiteSpaceParticle.d.ts +2 -1
- package/dist/src/editor/core/draw/particle/block/BlockParticle.d.ts +3 -1
- package/dist/src/editor/core/draw/particle/block/modules/BaseBlock.d.ts +2 -1
- package/dist/src/editor/core/draw/particle/block/modules/VideoBlock.d.ts +2 -1
- package/dist/src/editor/core/draw/particle/latex/LaTexParticle.d.ts +6 -1
- package/dist/src/editor/core/draw/particle/table/TableParticle.d.ts +3 -2
- package/dist/src/editor/core/draw/richtext/AbstractRichText.d.ts +3 -2
- package/dist/src/editor/core/draw/richtext/Highlight.d.ts +2 -1
- package/dist/src/editor/core/draw/richtext/Strikeout.d.ts +2 -1
- package/dist/src/editor/core/draw/richtext/Underline.d.ts +2 -1
- package/dist/src/editor/core/draw/ruler/Ruler.d.ts +31 -2
- package/dist/src/editor/core/event/pagePointer.d.ts +8 -0
- package/dist/src/editor/core/layout/LayoutEngine.d.ts +31 -0
- package/dist/src/editor/core/layout/TextMeasurer.d.ts +10 -0
- package/dist/src/editor/core/range/RangeManager.d.ts +2 -1
- package/dist/src/editor/core/render/BackendFactory.d.ts +3 -0
- package/dist/src/editor/core/render/RenderBackend.d.ts +24 -0
- package/dist/src/editor/core/render/canvas/CanvasBackend.d.ts +19 -0
- package/dist/src/editor/core/render/canvas/CanvasRenderer.d.ts +5 -0
- package/dist/src/editor/core/render/canvas/CanvasSurface.d.ts +17 -0
- package/dist/src/editor/core/render/model/DisplayList.d.ts +62 -0
- package/dist/src/editor/core/render/model/RenderContext.d.ts +48 -0
- package/dist/src/editor/core/render/svg/SvgBackend.d.ts +22 -0
- package/dist/src/editor/core/render/svg/SvgRenderer.d.ts +9 -0
- package/dist/src/editor/core/render/svg/SvgSurface.d.ts +13 -0
- package/dist/src/editor/core/render/svg/scene/PathCompiler.d.ts +16 -0
- package/dist/src/editor/core/render/svg/scene/ResourceKey.d.ts +7 -0
- package/dist/src/editor/core/render/svg/scene/SceneCompiler.d.ts +9 -0
- package/dist/src/editor/core/render/svg/scene/SceneKey.d.ts +28 -0
- package/dist/src/editor/core/render/svg/scene/SceneNode.d.ts +20 -0
- package/dist/src/editor/core/render/svg/scene/SceneReconciler.d.ts +12 -0
- package/dist/src/editor/core/render/svg/scene/SvgNodeFactory.d.ts +14 -0
- package/dist/src/editor/dataset/constant/Common.d.ts +1 -0
- package/dist/src/editor/dataset/enum/Editor.d.ts +4 -0
- package/dist/src/editor/dataset/enum/TabStop.d.ts +11 -0
- package/dist/src/editor/index.d.ts +5 -4
- package/dist/src/editor/interface/Draw.d.ts +4 -0
- package/dist/src/editor/interface/Editor.d.ts +6 -0
- package/dist/src/editor/interface/Element.d.ts +10 -0
- package/dist/src/editor/interface/Listener.d.ts +5 -1
- package/dist/src/editor/interface/Row.d.ts +3 -0
- package/dist/src/editor/utils/element.d.ts +1 -0
- package/dist/src/editor/utils/print.d.ts +1 -0
- package/package.json +10 -10
- package/dist/assets/catalog-B-cbxN0s.js.map +0 -1
- package/dist/assets/value-93HzxRrf.js.map +0 -1
- package/dist/assets/wordCount-BWZRHbSB.js.map +0 -1
|
@@ -35,6 +35,10 @@ export declare class Command {
|
|
|
35
35
|
executeRowMargin: CommandAdapt['rowMargin'];
|
|
36
36
|
executeSpacingBefore: CommandAdapt['spacingBefore'];
|
|
37
37
|
executeSpacingAfter: CommandAdapt['spacingAfter'];
|
|
38
|
+
executeIndentLeft: CommandAdapt['indentLeft'];
|
|
39
|
+
executeIndentRight: CommandAdapt['indentRight'];
|
|
40
|
+
executeIndentFirstLine: CommandAdapt['indentFirstLine'];
|
|
41
|
+
executeSetTabStops: CommandAdapt['setTabStops'];
|
|
38
42
|
executeInsertTable: CommandAdapt['insertTable'];
|
|
39
43
|
executeInsertTableTopRow: CommandAdapt['insertTableTopRow'];
|
|
40
44
|
executeInsertTableBottomRow: CommandAdapt['insertTableBottomRow'];
|
|
@@ -127,6 +131,7 @@ export declare class Command {
|
|
|
127
131
|
executeInsertControl: CommandAdapt['insertControl'];
|
|
128
132
|
executeJumpControl: CommandAdapt['jumpControl'];
|
|
129
133
|
executeUpdateOptions: CommandAdapt['updateOptions'];
|
|
134
|
+
executeSetBackend: CommandAdapt['setBackend'];
|
|
130
135
|
executeInsertTitle: CommandAdapt['insertTitle'];
|
|
131
136
|
executeFocus: CommandAdapt['focus'];
|
|
132
137
|
executeComputeElementListHeight: CommandAdapt['computeElementListHeight'];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ImageDisplay } from '../../dataset/enum/Common';
|
|
2
|
-
import { EditorMode, EditorZone, PageMode, PaperDirection } from '../../dataset/enum/Editor';
|
|
2
|
+
import { BackendType, EditorMode, EditorZone, PageMode, PaperDirection } from '../../dataset/enum/Editor';
|
|
3
3
|
import { ListStyle, ListType } from '../../dataset/enum/List';
|
|
4
4
|
import { MoveDirection } from '../../dataset/enum/Observer';
|
|
5
5
|
import { RowFlex } from '../../dataset/enum/Row';
|
|
@@ -13,7 +13,7 @@ import { IControlValidateResult, IGetControlValueOption, IGetControlValueResult,
|
|
|
13
13
|
import { IAppendElementListOption, IDrawImagePayload, IForceUpdateOption, IGetImageOption, IGetValueOption, IPainterOption } from '../../interface/Draw';
|
|
14
14
|
import { IEditorData, IEditorHTML, IEditorOption, IEditorResult, IEditorText, IFocusOption, ISetValueOption, IUpdateOption } from '../../interface/Editor';
|
|
15
15
|
import { IColumnOption } from '../../interface/Column';
|
|
16
|
-
import { IDeleteElementByIdOption, IElement, IElementPosition, IGetElementByIdOption, IImageCaption, IImageCrop, IInsertElementListOption, IUpdateElementByIdOption } from '../../interface/Element';
|
|
16
|
+
import { IDeleteElementByIdOption, IElement, IElementPosition, IGetElementByIdOption, IImageCaption, IImageCrop, IInsertElementListOption, ITabStop, IUpdateElementByIdOption } from '../../interface/Element';
|
|
17
17
|
import { ICopyOption, IPasteOption, IPositionContextByEventOption, IPositionContextByEventResult } from '../../interface/Event';
|
|
18
18
|
import { IMargin } from '../../interface/Margin';
|
|
19
19
|
import { IGetSurroundElementListOption, IRange, RangeContext, RangeRect } from '../../interface/Range';
|
|
@@ -77,6 +77,10 @@ export declare class CommandAdapt {
|
|
|
77
77
|
rowMargin(payload: number): void;
|
|
78
78
|
spacingBefore(payload: number): void;
|
|
79
79
|
spacingAfter(payload: number): void;
|
|
80
|
+
indentLeft(payload: number): void;
|
|
81
|
+
indentRight(payload: number): void;
|
|
82
|
+
indentFirstLine(payload: number): void;
|
|
83
|
+
setTabStops(payload: ITabStop[]): void;
|
|
80
84
|
insertTable(row: number, col: number): void;
|
|
81
85
|
insertTableTopRow(): void;
|
|
82
86
|
insertTableBottomRow(): void;
|
|
@@ -189,6 +193,7 @@ export declare class CommandAdapt {
|
|
|
189
193
|
validate(payload?: IValidateOption): IControlValidateResult[];
|
|
190
194
|
clearValidate(): void;
|
|
191
195
|
setControlHighlight(payload: ISetControlHighlightOption): void;
|
|
196
|
+
setBackend(payload: BackendType): void;
|
|
192
197
|
updateOptions(payload: IUpdateOption): void;
|
|
193
198
|
getControlList(): IElement[];
|
|
194
199
|
locationControl(controlId: string, options?: ILocationControlOption): void;
|
|
@@ -23,6 +23,13 @@ export declare class ContextMenu {
|
|
|
23
23
|
private _getContext;
|
|
24
24
|
private _createContextMenuContainer;
|
|
25
25
|
private _render;
|
|
26
|
+
/**
|
|
27
|
+
* 按点击位置摆放菜单(left/top 为视口坐标):
|
|
28
|
+
* 纵向优先往下展开;下方放不下而上方放得下则往上展开;
|
|
29
|
+
* 两侧都放不下时取空间大的一侧,并把菜单限高为该侧可用空间(容器自带纵向滚动)。
|
|
30
|
+
* 横向同理,右侧放不下往左,仍放不下贴视口边。
|
|
31
|
+
*/
|
|
32
|
+
private _placeContextMenu;
|
|
26
33
|
private _removeSubMenu;
|
|
27
34
|
private _setHoverStatus;
|
|
28
35
|
private _formatName;
|
|
@@ -6,6 +6,9 @@ import { IRow } from '../../interface/Row';
|
|
|
6
6
|
import { IColumnLayout, IColumnOption } from '../../interface/Column';
|
|
7
7
|
import { ColumnManager } from './column/ColumnManager';
|
|
8
8
|
import { IncrementalRowComputer } from './IncrementalRowComputer';
|
|
9
|
+
import { TextMeasurer } from '../layout/TextMeasurer';
|
|
10
|
+
import type { RenderPage } from '../render/RenderBackend';
|
|
11
|
+
import { IRenderContext } from '../render/model/RenderContext';
|
|
9
12
|
import { Cursor } from '../cursor/Cursor';
|
|
10
13
|
import { CanvasEvent } from '../event/CanvasEvent';
|
|
11
14
|
import { GlobalEvent } from '../event/GlobalEvent';
|
|
@@ -20,6 +23,7 @@ import { Underline } from './richtext/Underline';
|
|
|
20
23
|
import { ImageParticle } from './particle/ImageParticle';
|
|
21
24
|
import { TextParticle } from './particle/TextParticle';
|
|
22
25
|
import { TableParticle } from './particle/table/TableParticle';
|
|
26
|
+
import { TablePaging } from './particle/table/TablePaging';
|
|
23
27
|
import { TableTool } from './particle/table/TableTool';
|
|
24
28
|
import { Ruler } from './ruler/Ruler';
|
|
25
29
|
import { HyperlinkParticle } from './particle/HyperlinkParticle';
|
|
@@ -28,7 +32,7 @@ import { TraceParticle } from './particle/TraceParticle';
|
|
|
28
32
|
import { Header } from './frame/Header';
|
|
29
33
|
import { SuperscriptParticle } from './particle/SuperscriptParticle';
|
|
30
34
|
import { SubscriptParticle } from './particle/SubscriptParticle';
|
|
31
|
-
import { EditorMode, PageMode, PaperDirection } from '../../dataset/enum/Editor';
|
|
35
|
+
import { BackendType, EditorMode, PageMode, PaperDirection } from '../../dataset/enum/Editor';
|
|
32
36
|
import { Control } from './control/Control';
|
|
33
37
|
import { CascadeManager } from '../cascade/CascadeManager';
|
|
34
38
|
import { Validate } from '../validate/Validate';
|
|
@@ -61,8 +65,7 @@ import { Accessibility } from '../accessibility/Accessibility';
|
|
|
61
65
|
export declare class Draw {
|
|
62
66
|
private container;
|
|
63
67
|
private pageContainer;
|
|
64
|
-
private
|
|
65
|
-
private ctxList;
|
|
68
|
+
private backend;
|
|
66
69
|
private pageNo;
|
|
67
70
|
private renderCount;
|
|
68
71
|
private pagePixelRatio;
|
|
@@ -95,6 +98,7 @@ export declare class Draw {
|
|
|
95
98
|
private previewer;
|
|
96
99
|
private imageParticle;
|
|
97
100
|
private laTexParticle;
|
|
101
|
+
private textMeasurer;
|
|
98
102
|
private textParticle;
|
|
99
103
|
private tableParticle;
|
|
100
104
|
private tablePaging;
|
|
@@ -136,6 +140,7 @@ export declare class Draw {
|
|
|
136
140
|
private rowList;
|
|
137
141
|
private rawRowList;
|
|
138
142
|
private incrementalRowComputer;
|
|
143
|
+
private layoutEngine;
|
|
139
144
|
private isElementListTruncated;
|
|
140
145
|
private pageRowList;
|
|
141
146
|
private pageDirectionList;
|
|
@@ -143,15 +148,14 @@ export declare class Draw {
|
|
|
143
148
|
private painterOptions;
|
|
144
149
|
private visiblePageNoList;
|
|
145
150
|
private intersectionPageNo;
|
|
146
|
-
private lazyRenderIntersectionObserver;
|
|
147
151
|
private printModeData;
|
|
148
|
-
private controlMinWidthPlaceholderElementListSet;
|
|
149
152
|
private columnManager;
|
|
150
153
|
private ruler;
|
|
151
154
|
constructor(rootContainer: HTMLElement, options: DeepRequired<IEditorOption>, data: IEditorData, listener: Listener, eventBus: EventBus<EventBusMap>, override: Override);
|
|
152
155
|
setPrintData(): void;
|
|
153
156
|
clearPrintData(): void;
|
|
154
157
|
getLetterReg(): RegExp;
|
|
158
|
+
isWordLike(word: string): boolean;
|
|
155
159
|
getMode(): EditorMode;
|
|
156
160
|
setMode(payload: EditorMode): void;
|
|
157
161
|
isReadonly(): boolean;
|
|
@@ -208,14 +212,13 @@ export declare class Draw {
|
|
|
208
212
|
getPageNo(): number;
|
|
209
213
|
setPageNo(payload: number): void;
|
|
210
214
|
getRenderCount(): number;
|
|
211
|
-
getPage(pageNo?: number):
|
|
212
|
-
getPageList():
|
|
215
|
+
getPage(pageNo?: number): RenderPage;
|
|
216
|
+
getPageList(): RenderPage[];
|
|
213
217
|
getPageCount(): number;
|
|
214
218
|
getTableRowList(sourceElementList: IElement[]): IRow[];
|
|
215
219
|
getOriginalRowList(): IRow[];
|
|
216
220
|
getRowList(): IRow[];
|
|
217
221
|
getPageRowList(): IRow[][];
|
|
218
|
-
getCtx(): CanvasRenderingContext2D;
|
|
219
222
|
getOptions(): DeepRequired<IEditorOption>;
|
|
220
223
|
getSearch(): Search;
|
|
221
224
|
getSpellcheck(): Spellcheck;
|
|
@@ -230,6 +233,7 @@ export declare class Draw {
|
|
|
230
233
|
getColumnManager(): ColumnManager;
|
|
231
234
|
getRange(): RangeManager;
|
|
232
235
|
getLineBreakParticle(): LineBreakParticle;
|
|
236
|
+
getTextMeasurer(): TextMeasurer;
|
|
233
237
|
getTextParticle(): TextParticle;
|
|
234
238
|
getStrikeout(): Strikeout;
|
|
235
239
|
getUnderline(): Underline;
|
|
@@ -239,6 +243,7 @@ export declare class Draw {
|
|
|
239
243
|
getTableElementList(sourceElementList: IElement[]): IElement[];
|
|
240
244
|
getElementList(): IElement[];
|
|
241
245
|
getMainElementList(): IElement[];
|
|
246
|
+
isMainElementList(elementList: IElement[]): boolean;
|
|
242
247
|
getRawRowList(): IRow[];
|
|
243
248
|
getMainRowList(): IRow[];
|
|
244
249
|
getIncrementalRowComputer(): IncrementalRowComputer;
|
|
@@ -265,6 +270,7 @@ export declare class Draw {
|
|
|
265
270
|
getRuler(): Ruler;
|
|
266
271
|
getTableOperate(): TableOperate;
|
|
267
272
|
getTableParticle(): TableParticle;
|
|
273
|
+
getTablePaging(): TablePaging;
|
|
268
274
|
getBlockParticle(): BlockParticle;
|
|
269
275
|
getHeader(): Header;
|
|
270
276
|
getFooter(): Footer;
|
|
@@ -285,11 +291,13 @@ export declare class Draw {
|
|
|
285
291
|
getAccessibility(): Accessibility;
|
|
286
292
|
getRowCount(): number;
|
|
287
293
|
getDataURL(payload?: IGetImageOption): Promise<string[]>;
|
|
294
|
+
getSvgPageList(mode: EditorMode): Promise<SVGSVGElement[]>;
|
|
288
295
|
getPainterStyle(): IElementStyle | null;
|
|
289
296
|
getPainterOptions(): IPainterOption | null;
|
|
290
297
|
setPainterStyle(payload: IElementStyle | null, options?: IPainterOption): void;
|
|
291
298
|
setDefaultRange(): void;
|
|
292
299
|
getIsPagingMode(): boolean;
|
|
300
|
+
setBackend(payload: BackendType): void;
|
|
293
301
|
setPageMode(payload: PageMode): void;
|
|
294
302
|
setPageScale(payload: number): void;
|
|
295
303
|
getPagePixelRatio(): number;
|
|
@@ -308,14 +316,13 @@ export declare class Draw {
|
|
|
308
316
|
private _createPageContainer;
|
|
309
317
|
private _createPage;
|
|
310
318
|
private _updatePageSizes;
|
|
311
|
-
private _initPageContext;
|
|
312
319
|
getElementFont(el: IElement, scale?: number): string;
|
|
313
320
|
getElementSize(el: IElement): number;
|
|
314
321
|
getElementRowMargin(el: IElement): number;
|
|
315
322
|
computeRowList(payload: IComputeRowListPayload): IRow[];
|
|
316
323
|
private _computePageList;
|
|
317
324
|
private _drawHighlight;
|
|
318
|
-
drawRow(ctx:
|
|
325
|
+
drawRow(ctx: IRenderContext, payload: IDrawRowPayload): void;
|
|
319
326
|
private _drawFloat;
|
|
320
327
|
private _clearPage;
|
|
321
328
|
private _drawPage;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IColumnLayout, IColumnOption } from '../../../interface/Column';
|
|
2
2
|
import { PaperDirection } from '../../../dataset/enum/Editor';
|
|
3
|
+
import type { IRenderContext } from '../../render/model/RenderContext';
|
|
3
4
|
import { Draw } from '../Draw';
|
|
4
5
|
export declare class ColumnManager {
|
|
5
6
|
private draw;
|
|
@@ -11,5 +12,5 @@ export declare class ColumnManager {
|
|
|
11
12
|
getLayout(direction?: PaperDirection): IColumnLayout | null;
|
|
12
13
|
setConfig(config: IColumnOption | null | undefined): void;
|
|
13
14
|
getOffset(columnIndex: number | undefined, direction?: PaperDirection): number;
|
|
14
|
-
drawSeparator(ctx:
|
|
15
|
+
drawSeparator(ctx: IRenderContext, pageNo: number): void;
|
|
15
16
|
}
|
|
@@ -2,6 +2,7 @@ import { ControlState } from '../../../dataset/enum/Control';
|
|
|
2
2
|
import { IControl, IControlChangeOption, IControlContext, IControlHighlight, IControlInitOption, IControlInstance, IDestroyControlOption, IGetControlValueOption, IGetControlValueResult, IInitNextControlOption, INextControlContext, IRepaintControlOption, ISetControlExtensionOption, ISetControlProperties, ISetControlRowFlexOption, ISetControlValueOption } from '../../../interface/Control';
|
|
3
3
|
import { IElement, IElementPosition } from '../../../interface/Element';
|
|
4
4
|
import { IRange } from '../../../interface/Range';
|
|
5
|
+
import type { IRenderContext } from '../../render/model/RenderContext';
|
|
5
6
|
import { Draw } from '../Draw';
|
|
6
7
|
interface IMoveCursorResult {
|
|
7
8
|
newIndex: number;
|
|
@@ -22,7 +23,7 @@ export declare class Control {
|
|
|
22
23
|
constructor(draw: Draw);
|
|
23
24
|
setHighlightList(payload: IControlHighlight[]): void;
|
|
24
25
|
computeHighlightList(): void;
|
|
25
|
-
renderHighlightList(ctx:
|
|
26
|
+
renderHighlightList(ctx: IRenderContext, pageNo: number): void;
|
|
26
27
|
getDraw(): Draw;
|
|
27
28
|
filterAssistElement(elementList: IElement[]): IElement[];
|
|
28
29
|
getIsRangeCanCaptureEvent(): boolean;
|
|
@@ -68,7 +69,7 @@ export declare class Control {
|
|
|
68
69
|
setPropertiesListById(payload: ISetControlProperties[]): void;
|
|
69
70
|
getList(): IElement[];
|
|
70
71
|
recordBorderInfo(x: number, y: number, width: number, height: number): void;
|
|
71
|
-
drawBorder(ctx:
|
|
72
|
+
drawBorder(ctx: IRenderContext): void;
|
|
72
73
|
getPreControlContext(): INextControlContext | null;
|
|
73
74
|
getNextControlContext(): INextControlContext | null;
|
|
74
75
|
initNextControl(option?: IInitNextControlOption): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IControlHighlight, IControlHighlightRule } from '../../../../interface/Control';
|
|
2
2
|
import { IElement } from '../../../../interface/Element';
|
|
3
3
|
import { ISearchResult } from '../../../../interface/Search';
|
|
4
|
+
import type { IRenderContext } from '../../../render/model/RenderContext';
|
|
4
5
|
import { Control } from '../Control';
|
|
5
6
|
type IHighlightMatchResult = (ISearchResult & IControlHighlightRule)[];
|
|
6
7
|
export declare class ControlSearch {
|
|
@@ -15,6 +16,6 @@ export declare class ControlSearch {
|
|
|
15
16
|
getHighlightList(): IControlHighlight[];
|
|
16
17
|
setHighlightList(payload: IControlHighlight[]): void;
|
|
17
18
|
computeHighlightList(): void;
|
|
18
|
-
renderHighlightList(ctx:
|
|
19
|
+
renderHighlightList(ctx: IRenderContext, pageIndex: number): void;
|
|
19
20
|
}
|
|
20
21
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IElementFillRect } from '../../../../interface/Element';
|
|
2
|
+
import type { IRenderContext } from '../../../render/model/RenderContext';
|
|
2
3
|
import { Draw } from '../../Draw';
|
|
3
4
|
export declare class ControlBorder {
|
|
4
5
|
protected borderRect: IElementFillRect;
|
|
@@ -6,5 +7,5 @@ export declare class ControlBorder {
|
|
|
6
7
|
constructor(draw: Draw);
|
|
7
8
|
clearBorderInfo(): IElementFillRect;
|
|
8
9
|
recordBorderInfo(x: number, y: number, width: number, height: number): void;
|
|
9
|
-
render(ctx:
|
|
10
|
+
render(ctx: IRenderContext): void;
|
|
10
11
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IRenderContext } from '../../render/model/RenderContext';
|
|
1
2
|
import { Draw } from '../Draw';
|
|
2
3
|
export declare class Background {
|
|
3
4
|
private draw;
|
|
@@ -7,5 +8,5 @@ export declare class Background {
|
|
|
7
8
|
private _renderBackgroundColor;
|
|
8
9
|
private _drawImage;
|
|
9
10
|
private _renderBackgroundImage;
|
|
10
|
-
render(ctx:
|
|
11
|
+
render(ctx: IRenderContext, pageNo: number): void;
|
|
11
12
|
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { IAreaBadge, IBadge } from '../../../interface/Badge';
|
|
2
|
+
import type { IRenderContext } from '../../render/model/RenderContext';
|
|
2
3
|
import { Draw } from '../Draw';
|
|
3
4
|
export declare class Badge {
|
|
4
5
|
private draw;
|
|
5
6
|
private options;
|
|
6
7
|
private imageCache;
|
|
8
|
+
private pendingImageMap;
|
|
7
9
|
private mainBadge;
|
|
8
10
|
private areaBadgeMap;
|
|
9
11
|
constructor(draw: Draw);
|
|
10
12
|
setMainBadge(payload: IBadge | null): void;
|
|
11
13
|
setAreaBadgeMap(payload: IAreaBadge[]): void;
|
|
12
14
|
private _drawImage;
|
|
13
|
-
render(ctx:
|
|
15
|
+
render(ctx: IRenderContext, pageNo: number): void;
|
|
14
16
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PaperDirection } from '../../../dataset/enum/Editor';
|
|
2
2
|
import { IElement, IElementPosition } from '../../../interface/Element';
|
|
3
3
|
import { IRow } from '../../../interface/Row';
|
|
4
|
+
import type { IRenderContext } from '../../render/model/RenderContext';
|
|
4
5
|
import { Draw } from '../Draw';
|
|
5
6
|
export declare class Footer {
|
|
6
7
|
private draw;
|
|
@@ -26,5 +27,5 @@ export declare class Footer {
|
|
|
26
27
|
getExtraHeight(pageNo?: number, direction?: PaperDirection): number;
|
|
27
28
|
private _resolveDirection;
|
|
28
29
|
isDisabled(pageNo?: number): boolean;
|
|
29
|
-
render(ctx:
|
|
30
|
+
render(ctx: IRenderContext, pageNo: number): void;
|
|
30
31
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PaperDirection } from '../../../dataset/enum/Editor';
|
|
2
2
|
import { IElement, IElementPosition } from '../../../interface/Element';
|
|
3
3
|
import { IRow } from '../../../interface/Row';
|
|
4
|
+
import type { IRenderContext } from '../../render/model/RenderContext';
|
|
4
5
|
import { Draw } from '../Draw';
|
|
5
6
|
export declare class Header {
|
|
6
7
|
private draw;
|
|
@@ -26,5 +27,5 @@ export declare class Header {
|
|
|
26
27
|
getExtraHeight(pageNo?: number, direction?: PaperDirection): number;
|
|
27
28
|
private _resolveDirection;
|
|
28
29
|
isDisabled(pageNo?: number): boolean;
|
|
29
|
-
render(ctx:
|
|
30
|
+
render(ctx: IRenderContext, pageNo: number): void;
|
|
30
31
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { IRenderContext } from '../../render/model/RenderContext';
|
|
1
2
|
import { Draw } from '../Draw';
|
|
2
3
|
export declare class LineNumber {
|
|
3
4
|
private draw;
|
|
4
5
|
private options;
|
|
5
6
|
constructor(draw: Draw);
|
|
6
|
-
render(ctx:
|
|
7
|
+
render(ctx: IRenderContext, pageNo: number): void;
|
|
7
8
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { IRenderContext } from '../../render/model/RenderContext';
|
|
1
2
|
import { Draw } from '../Draw';
|
|
2
3
|
export declare class Margin {
|
|
3
4
|
private draw;
|
|
4
5
|
private options;
|
|
5
6
|
constructor(draw: Draw);
|
|
6
|
-
render(ctx:
|
|
7
|
+
render(ctx: IRenderContext, pageNo: number): void;
|
|
7
8
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IRenderContext } from '../../render/model/RenderContext';
|
|
1
2
|
import { Draw } from '../Draw';
|
|
2
3
|
export declare class PageBorder {
|
|
3
4
|
private draw;
|
|
@@ -5,5 +6,5 @@ export declare class PageBorder {
|
|
|
5
6
|
private footer;
|
|
6
7
|
private options;
|
|
7
8
|
constructor(draw: Draw);
|
|
8
|
-
render(ctx:
|
|
9
|
+
render(ctx: IRenderContext, pageNo: number): void;
|
|
9
10
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { NumberType } from '../../../dataset/enum/Common';
|
|
2
|
+
import type { IRenderContext } from '../../render/model/RenderContext';
|
|
2
3
|
import { Draw } from '../Draw';
|
|
3
4
|
export declare class PageNumber {
|
|
4
5
|
private draw;
|
|
5
6
|
private options;
|
|
6
7
|
constructor(draw: Draw);
|
|
7
8
|
static formatNumberPlaceholder(text: string, pageNo: number, replaceReg: RegExp, numberType: NumberType): string;
|
|
8
|
-
render(ctx:
|
|
9
|
+
render(ctx: IRenderContext, pageNo: number): void;
|
|
9
10
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IPlaceholder } from '../../../interface/Placeholder';
|
|
2
|
+
import type { IRenderContext } from '../../render/model/RenderContext';
|
|
2
3
|
import { Draw } from '../Draw';
|
|
3
4
|
export interface IPlaceholderRenderOption {
|
|
4
5
|
placeholder: Required<IPlaceholder>;
|
|
@@ -16,5 +17,5 @@ export declare class Placeholder {
|
|
|
16
17
|
_compute(options?: IPlaceholderRenderOption): void;
|
|
17
18
|
private _computeRowList;
|
|
18
19
|
private _computePositionList;
|
|
19
|
-
render(ctx:
|
|
20
|
+
render(ctx: IRenderContext, options?: IPlaceholderRenderOption): void;
|
|
20
21
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { IRenderContext } from '../../render/model/RenderContext';
|
|
1
2
|
import { Draw } from '../Draw';
|
|
2
3
|
export declare class Watermark {
|
|
3
4
|
private draw;
|
|
4
5
|
private options;
|
|
5
6
|
private imageCache;
|
|
6
7
|
constructor(draw: Draw);
|
|
7
|
-
renderText(ctx:
|
|
8
|
-
renderImage(ctx:
|
|
9
|
-
render(ctx:
|
|
8
|
+
renderText(ctx: IRenderContext, pageNo: number): void;
|
|
9
|
+
renderImage(ctx: IRenderContext, pageNo: number): void;
|
|
10
|
+
render(ctx: IRenderContext, pageNo: number): void;
|
|
10
11
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IGraffitiData } from '../../../interface/Graffiti';
|
|
2
|
+
import type { IRenderContext } from '../../render/model/RenderContext';
|
|
2
3
|
import { Draw } from '../Draw';
|
|
3
4
|
export declare class Graffiti {
|
|
4
5
|
private draw;
|
|
@@ -15,5 +16,5 @@ export declare class Graffiti {
|
|
|
15
16
|
getValue(): IGraffitiData[];
|
|
16
17
|
compute(): void;
|
|
17
18
|
clear(): void;
|
|
18
|
-
render(ctx:
|
|
19
|
+
render(ctx: IRenderContext, pageNo: number): void;
|
|
19
20
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Draw } from '../Draw';
|
|
2
2
|
import { IAreaInfo, IDeleteAreaOption, IGetAreaValueOption, IGetAreaValueResult, IInsertAreaOption, ILocationAreaOption, ISetAreaPropertiesOption, ISetAreaValueOption } from '../../../interface/Area';
|
|
3
|
+
import type { IRenderContext } from '../../render/model/RenderContext';
|
|
3
4
|
import { IRange } from '../../../interface/Range';
|
|
4
5
|
import { IRow } from '../../../interface/Row';
|
|
5
6
|
import { IElementPosition } from '../../../interface/Element';
|
|
@@ -16,7 +17,7 @@ export declare class Area {
|
|
|
16
17
|
getActiveAreaInfo(): IAreaInfo | null;
|
|
17
18
|
isReadonly(): boolean;
|
|
18
19
|
insertArea(payload: IInsertAreaOption): string | null;
|
|
19
|
-
render(ctx:
|
|
20
|
+
render(ctx: IRenderContext, pageNo: number): void;
|
|
20
21
|
compute(): void;
|
|
21
22
|
/**
|
|
22
23
|
* 收集区域补高的跨页延续段:
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IElement } from '../../../interface/Element';
|
|
2
2
|
import { IPositionContext } from '../../../interface/Position';
|
|
3
3
|
import { IRange } from '../../../interface/Range';
|
|
4
|
+
import type { IRenderContext } from '../../render/model/RenderContext';
|
|
4
5
|
import { Draw } from '../Draw';
|
|
5
6
|
export declare class Group {
|
|
6
7
|
private draw;
|
|
@@ -14,5 +15,5 @@ export declare class Group {
|
|
|
14
15
|
getContextByGroupId(elementList: IElement[], groupId: string): (IRange & IPositionContext) | null;
|
|
15
16
|
clearFillInfo(): void;
|
|
16
17
|
recordFillInfo(element: IElement, x: number, y: number, width: number, height: number): void;
|
|
17
|
-
render(ctx:
|
|
18
|
+
render(ctx: IRenderContext): void;
|
|
18
19
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IElement, IElementPosition } from '../../../interface/Element';
|
|
2
2
|
import { IReplaceOption, ISearchOption, ISearchResult } from '../../../interface/Search';
|
|
3
|
+
import type { IRenderContext } from '../../render/model/RenderContext';
|
|
3
4
|
import { Draw } from '../Draw';
|
|
4
5
|
export interface INavigateInfo {
|
|
5
6
|
index: number;
|
|
@@ -26,7 +27,7 @@ export declare class Search {
|
|
|
26
27
|
getSearchNavigateInfo(): null | INavigateInfo;
|
|
27
28
|
getMatchList(payload: string, originalElementList: IElement[]): ISearchResult[];
|
|
28
29
|
compute(payload: string): void;
|
|
29
|
-
render(ctx:
|
|
30
|
+
render(ctx: IRenderContext, pageIndex: number): void;
|
|
30
31
|
replace(payload: string, option?: IReplaceOption): void;
|
|
31
32
|
private replaceWithTrace;
|
|
32
33
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ISpellcheckContext, ISpellcheckRange, ISpellcheckWord } from '../../../interface/Spellcheck';
|
|
2
|
+
import type { IRenderContext } from '../../render/model/RenderContext';
|
|
2
3
|
import type { Draw } from '../Draw';
|
|
3
4
|
export declare class Spellcheck {
|
|
4
5
|
private options;
|
|
@@ -16,5 +17,5 @@ export declare class Spellcheck {
|
|
|
16
17
|
private _isSameTablePath;
|
|
17
18
|
getRangeByIndex(index: number, context?: ISpellcheckContext): ISpellcheckRange | null;
|
|
18
19
|
private _drawWave;
|
|
19
|
-
render(ctx:
|
|
20
|
+
render(ctx: IRenderContext, pageIndex: number): void;
|
|
20
21
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { IElement } from '../../../interface/Element';
|
|
2
2
|
import { IRow } from '../../../interface/Row';
|
|
3
|
+
import { IRenderContext } from '../../render/model/RenderContext';
|
|
3
4
|
import { Draw } from '../Draw';
|
|
4
5
|
interface ICheckboxRenderOption {
|
|
5
|
-
ctx:
|
|
6
|
+
ctx: IRenderContext;
|
|
6
7
|
x: number;
|
|
7
8
|
y: number;
|
|
8
9
|
row: IRow;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IElement } from '../../..';
|
|
2
2
|
import { IElementPosition } from '../../../interface/Element';
|
|
3
3
|
import { IRowElement } from '../../../interface/Row';
|
|
4
|
+
import { IRenderContext } from '../../render/model/RenderContext';
|
|
4
5
|
import { Draw } from '../Draw';
|
|
5
6
|
export declare class HyperlinkParticle {
|
|
6
7
|
private draw;
|
|
@@ -13,5 +14,5 @@ export declare class HyperlinkParticle {
|
|
|
13
14
|
drawHyperlinkPopup(element: IElement, position: IElementPosition): void;
|
|
14
15
|
clearHyperlinkPopup(): void;
|
|
15
16
|
openHyperlink(element: IElement): void;
|
|
16
|
-
render(ctx:
|
|
17
|
+
render(ctx: IRenderContext, element: IRowElement, x: number, y: number): void;
|
|
17
18
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { DeepRequired } from '../../../interface/Common';
|
|
2
2
|
import { IEditorOption } from '../../../interface/Editor';
|
|
3
3
|
import { IElement } from '../../../interface/Element';
|
|
4
|
+
import type { IRenderContext } from '../../render/model/RenderContext';
|
|
4
5
|
import { Draw } from '../Draw';
|
|
5
6
|
export declare class ImageParticle {
|
|
6
7
|
private draw;
|
|
7
8
|
protected options: DeepRequired<IEditorOption>;
|
|
8
9
|
protected imageCache: Map<string, HTMLImageElement>;
|
|
10
|
+
private pendingImageMap;
|
|
9
11
|
private container;
|
|
10
12
|
private floatImageContainer;
|
|
11
13
|
private floatImage;
|
|
@@ -19,5 +21,5 @@ export declare class ImageParticle {
|
|
|
19
21
|
protected getFallbackImage(width: number, height: number): HTMLImageElement;
|
|
20
22
|
private _drawImageWithCrop;
|
|
21
23
|
private _renderCaption;
|
|
22
|
-
render(ctx:
|
|
24
|
+
render(ctx: IRenderContext, element: IElement, x: number, y: number): void;
|
|
23
25
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { IRowElement } from '../../../interface/Row';
|
|
2
|
+
import { IRenderContext } from '../../render/model/RenderContext';
|
|
2
3
|
import { Draw } from '../Draw';
|
|
3
4
|
export declare class LabelParticle {
|
|
4
5
|
private options;
|
|
5
6
|
constructor(draw: Draw);
|
|
6
|
-
render(ctx:
|
|
7
|
+
render(ctx: IRenderContext, element: IRowElement, x: number, y: number): void;
|
|
7
8
|
private _drawRoundedRect;
|
|
8
9
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IRowElement } from '../../../interface/Row';
|
|
2
|
+
import { IRenderContext } from '../../render/model/RenderContext';
|
|
2
3
|
import { Draw } from '../Draw';
|
|
3
4
|
export declare class LineBreakParticle {
|
|
4
5
|
private options;
|
|
@@ -6,5 +7,5 @@ export declare class LineBreakParticle {
|
|
|
6
7
|
static readonly HEIGHT = 9;
|
|
7
8
|
static readonly GAP = 3;
|
|
8
9
|
constructor(draw: Draw);
|
|
9
|
-
render(ctx:
|
|
10
|
+
render(ctx: IRenderContext, element: IRowElement, x: number, y: number): void;
|
|
10
11
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ListStyle, ListType } from '../../../dataset/enum/List';
|
|
2
2
|
import { IElement, IElementPosition } from '../../../interface/Element';
|
|
3
3
|
import { IRow } from '../../../interface/Row';
|
|
4
|
+
import type { IRenderContext } from '../../render/model/RenderContext';
|
|
4
5
|
import { Draw } from '../Draw';
|
|
5
6
|
export declare class ListParticle {
|
|
6
7
|
private draw;
|
|
@@ -26,5 +27,5 @@ export declare class ListParticle {
|
|
|
26
27
|
private findStyledElement;
|
|
27
28
|
private getListFontStyle;
|
|
28
29
|
getListStyleWidth(ctx: CanvasRenderingContext2D, listElementList: IElement[]): number;
|
|
29
|
-
drawListStyle(ctx:
|
|
30
|
+
drawListStyle(ctx: IRenderContext, row: IRow, position: IElementPosition): void;
|
|
30
31
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { IRowElement } from '../../../interface/Row';
|
|
2
|
+
import type { IRenderContext } from '../../render/model/RenderContext';
|
|
2
3
|
import { Draw } from '../Draw';
|
|
3
4
|
export declare class PageBreakParticle {
|
|
4
5
|
private draw;
|
|
5
6
|
private options;
|
|
6
7
|
private i18n;
|
|
7
8
|
constructor(draw: Draw);
|
|
8
|
-
render(ctx:
|
|
9
|
+
render(ctx: IRenderContext, element: IRowElement, x: number, y: number): void;
|
|
9
10
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { IElement } from '../../../interface/Element';
|
|
2
2
|
import { IRow } from '../../../interface/Row';
|
|
3
|
+
import { IRenderContext } from '../../render/model/RenderContext';
|
|
3
4
|
import { Draw } from '../Draw';
|
|
4
5
|
interface IRadioRenderOption {
|
|
5
|
-
ctx:
|
|
6
|
+
ctx: IRenderContext;
|
|
6
7
|
x: number;
|
|
7
8
|
y: number;
|
|
8
9
|
row: IRow;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { IRowElement } from '../../../interface/Row';
|
|
2
|
+
import { IRenderContext } from '../../render/model/RenderContext';
|
|
2
3
|
import { Draw } from '../Draw';
|
|
3
4
|
export declare class SeparatorParticle {
|
|
4
5
|
private options;
|
|
5
6
|
constructor(draw: Draw);
|
|
6
|
-
render(ctx:
|
|
7
|
+
render(ctx: IRenderContext, element: IRowElement, x: number, y: number): void;
|
|
7
8
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IRowElement } from '../../../interface/Row';
|
|
2
|
+
import { IRenderContext } from '../../render/model/RenderContext';
|
|
2
3
|
export declare class SubscriptParticle {
|
|
3
4
|
getOffsetY(element: IRowElement): number;
|
|
4
|
-
render(ctx:
|
|
5
|
+
render(ctx: IRenderContext, element: IRowElement, x: number, y: number): void;
|
|
5
6
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IRowElement } from '../../../interface/Row';
|
|
2
|
+
import { IRenderContext } from '../../render/model/RenderContext';
|
|
2
3
|
export declare class SuperscriptParticle {
|
|
3
4
|
getOffsetY(element: IRowElement): number;
|
|
4
|
-
render(ctx:
|
|
5
|
+
render(ctx: IRenderContext, element: IRowElement, x: number, y: number): void;
|
|
5
6
|
}
|