@hufe921/canvas-editor 0.9.88 → 0.9.89
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 +22 -0
- package/dist/canvas-editor.es.js +127 -46
- package/dist/canvas-editor.es.js.map +1 -1
- package/dist/canvas-editor.umd.js +14 -14
- package/dist/canvas-editor.umd.js.map +1 -1
- package/dist/src/editor/core/draw/Draw.d.ts +3 -0
- package/dist/src/editor/core/draw/control/Control.d.ts +5 -5
- package/dist/src/editor/core/draw/frame/LineNumber.d.ts +7 -0
- package/dist/src/editor/dataset/constant/LineNumber.d.ts +2 -0
- package/dist/src/editor/dataset/enum/LineNumber.d.ts +4 -0
- package/dist/src/editor/index.d.ts +2 -1
- package/dist/src/editor/interface/Control.d.ts +10 -5
- package/dist/src/editor/interface/Editor.d.ts +2 -0
- package/dist/src/editor/interface/Element.d.ts +1 -1
- package/dist/src/editor/interface/LineNumber.d.ts +9 -0
- package/dist/src/editor/interface/Row.d.ts +1 -0
- package/package.json +1 -1
|
@@ -11,6 +11,7 @@ import { Position } from '../position/Position';
|
|
|
11
11
|
import { RangeManager } from '../range/RangeManager';
|
|
12
12
|
import { Search } from './interactive/Search';
|
|
13
13
|
import { ImageParticle } from './particle/ImageParticle';
|
|
14
|
+
import { TextParticle } from './particle/TextParticle';
|
|
14
15
|
import { TableParticle } from './particle/table/TableParticle';
|
|
15
16
|
import { TableTool } from './particle/table/TableTool';
|
|
16
17
|
import { HyperlinkParticle } from './particle/HyperlinkParticle';
|
|
@@ -69,6 +70,7 @@ export declare class Draw {
|
|
|
69
70
|
private tableParticle;
|
|
70
71
|
private tableTool;
|
|
71
72
|
private pageNumber;
|
|
73
|
+
private lineNumber;
|
|
72
74
|
private waterMark;
|
|
73
75
|
private placeholder;
|
|
74
76
|
private header;
|
|
@@ -147,6 +149,7 @@ export declare class Draw {
|
|
|
147
149
|
getZone(): Zone;
|
|
148
150
|
getRange(): RangeManager;
|
|
149
151
|
getLineBreakParticle(): LineBreakParticle;
|
|
152
|
+
getTextParticle(): TextParticle;
|
|
150
153
|
getHeaderElementList(): IElement[];
|
|
151
154
|
getTableElementList(sourceElementList: IElement[]): IElement[];
|
|
152
155
|
getElementList(): IElement[];
|
|
@@ -26,7 +26,7 @@ export declare class Control {
|
|
|
26
26
|
getIsRangeInPostfix(): boolean;
|
|
27
27
|
getIsRangeWithinControl(): boolean;
|
|
28
28
|
getIsElementListContainFullControl(elementList: IElement[]): boolean;
|
|
29
|
-
getIsDisabledControl(): boolean;
|
|
29
|
+
getIsDisabledControl(context?: IControlContext): boolean;
|
|
30
30
|
getContainer(): HTMLDivElement;
|
|
31
31
|
getElementList(): IElement[];
|
|
32
32
|
getPosition(): IElementPosition | null;
|
|
@@ -45,10 +45,10 @@ export declare class Control {
|
|
|
45
45
|
setValue(data: IElement[]): number;
|
|
46
46
|
keydown(evt: KeyboardEvent): number | null;
|
|
47
47
|
cut(): number;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
getValueById(payload: IGetControlValueOption): IGetControlValueResult;
|
|
49
|
+
setValueById(payload: ISetControlValueOption): void;
|
|
50
|
+
setExtensionById(payload: ISetControlExtensionOption): void;
|
|
51
|
+
setPropertiesById(payload: ISetControlProperties): void;
|
|
52
52
|
getList(): IElement[];
|
|
53
53
|
recordBorderInfo(x: number, y: number, width: number, height: number): void;
|
|
54
54
|
drawBorder(ctx: CanvasRenderingContext2D): void;
|
|
@@ -34,6 +34,7 @@ import { IRange } from './interface/Range';
|
|
|
34
34
|
import { splitText } from './utils';
|
|
35
35
|
import { BackgroundRepeat, BackgroundSize } from './dataset/enum/Background';
|
|
36
36
|
import { TextDecorationStyle } from './dataset/enum/Text';
|
|
37
|
+
import { LineNumberType } from './dataset/enum/LineNumber';
|
|
37
38
|
export default class Editor {
|
|
38
39
|
command: Command;
|
|
39
40
|
listener: Listener;
|
|
@@ -46,5 +47,5 @@ export default class Editor {
|
|
|
46
47
|
}
|
|
47
48
|
export { splitText };
|
|
48
49
|
export { EDITOR_COMPONENT, LETTER_CLASS, INTERNAL_CONTEXT_MENU_KEY };
|
|
49
|
-
export { Editor, RowFlex, VerticalAlign, EditorZone, EditorMode, ElementType, ControlType, EditorComponent, PageMode, RenderMode, ImageDisplay, Command, KeyMap, BlockType, PaperDirection, TableBorder, TdBorder, TdSlash, MaxHeightRatio, NumberType, TitleLevel, ListType, ListStyle, WordBreak, ControlIndentation, BackgroundRepeat, BackgroundSize, TextDecorationStyle };
|
|
50
|
+
export { Editor, RowFlex, VerticalAlign, EditorZone, EditorMode, ElementType, ControlType, EditorComponent, PageMode, RenderMode, ImageDisplay, Command, KeyMap, BlockType, PaperDirection, TableBorder, TdBorder, TdSlash, MaxHeightRatio, NumberType, TitleLevel, ListType, ListStyle, WordBreak, ControlIndentation, BackgroundRepeat, BackgroundSize, TextDecorationStyle, LineNumberType };
|
|
50
51
|
export type { IElement, IEditorData, IEditorOption, IEditorResult, IContextMenuContext, IRegisterContextMenu, IWatermark, INavigateInfo, IBlock, ILang, ICatalog, ICatalogItem, IRange, IRangeStyle };
|
|
@@ -33,7 +33,8 @@ export interface IControlHighlightRule {
|
|
|
33
33
|
}
|
|
34
34
|
export interface IControlHighlight {
|
|
35
35
|
ruleList: IControlHighlightRule[];
|
|
36
|
-
|
|
36
|
+
id?: string;
|
|
37
|
+
conceptId?: string;
|
|
37
38
|
}
|
|
38
39
|
export interface IControlRule {
|
|
39
40
|
deletable?: boolean;
|
|
@@ -96,7 +97,8 @@ export interface IControlRuleOption {
|
|
|
96
97
|
isAddPlaceholder?: boolean;
|
|
97
98
|
}
|
|
98
99
|
export interface IGetControlValueOption {
|
|
99
|
-
|
|
100
|
+
id?: string;
|
|
101
|
+
conceptId?: string;
|
|
100
102
|
}
|
|
101
103
|
export type IGetControlValueResult = (Omit<IControl, 'value'> & {
|
|
102
104
|
value: string | null;
|
|
@@ -104,16 +106,19 @@ export type IGetControlValueResult = (Omit<IControl, 'value'> & {
|
|
|
104
106
|
zone: EditorZone;
|
|
105
107
|
})[];
|
|
106
108
|
export interface ISetControlValueOption {
|
|
107
|
-
|
|
109
|
+
id?: string;
|
|
110
|
+
conceptId?: string;
|
|
108
111
|
value: string;
|
|
109
112
|
}
|
|
110
113
|
export interface ISetControlExtensionOption {
|
|
111
|
-
|
|
114
|
+
id?: string;
|
|
115
|
+
conceptId?: string;
|
|
112
116
|
extension: unknown;
|
|
113
117
|
}
|
|
114
118
|
export type ISetControlHighlightOption = IControlHighlight[];
|
|
115
119
|
export type ISetControlProperties = {
|
|
116
|
-
|
|
120
|
+
id?: string;
|
|
121
|
+
conceptId?: string;
|
|
117
122
|
properties: Partial<Omit<IControl, 'value'>>;
|
|
118
123
|
};
|
|
119
124
|
export type IRepaintControlOption = Pick<IDrawOption, 'curIndex' | 'isCompute' | 'isSubmitHistory'>;
|
|
@@ -18,6 +18,7 @@ import { IWatermark } from './Watermark';
|
|
|
18
18
|
import { IZoneOption } from './Zone';
|
|
19
19
|
import { ISeparatorOption } from './Separator';
|
|
20
20
|
import { ITableOption } from './table/Table';
|
|
21
|
+
import { ILineNumberOption } from './LineNumber';
|
|
21
22
|
export interface IEditorData {
|
|
22
23
|
header?: IElement[];
|
|
23
24
|
main: IElement[];
|
|
@@ -81,6 +82,7 @@ export interface IEditorOption {
|
|
|
81
82
|
background?: IBackgroundOption;
|
|
82
83
|
lineBreak?: ILineBreakOption;
|
|
83
84
|
separator?: ISeparatorOption;
|
|
85
|
+
lineNumber?: ILineNumberOption;
|
|
84
86
|
}
|
|
85
87
|
export interface IEditorResult {
|
|
86
88
|
version: string;
|