@hufe921/canvas-editor 0.9.98 → 0.9.100
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 +44 -0
- package/dist/canvas-editor.es.js +311 -76
- package/dist/canvas-editor.es.js.map +1 -1
- package/dist/canvas-editor.umd.js +31 -31
- package/dist/canvas-editor.umd.js.map +1 -1
- package/dist/src/editor/core/command/Command.d.ts +2 -0
- package/dist/src/editor/core/command/CommandAdapt.d.ts +5 -2
- package/dist/src/editor/core/draw/Draw.d.ts +3 -0
- package/dist/src/editor/core/draw/control/Control.d.ts +1 -0
- package/dist/src/editor/core/draw/control/number/NumberControl.d.ts +3 -0
- package/dist/src/editor/core/draw/frame/Badge.d.ts +14 -0
- package/dist/src/editor/core/draw/interactive/Area.d.ts +1 -0
- package/dist/src/editor/core/event/CanvasEvent.d.ts +2 -1
- package/dist/src/editor/dataset/constant/Badge.d.ts +2 -0
- package/dist/src/editor/dataset/enum/Common.d.ts +4 -0
- package/dist/src/editor/dataset/enum/Control.d.ts +2 -1
- package/dist/src/editor/index.d.ts +4 -3
- package/dist/src/editor/interface/Badge.d.ts +15 -0
- package/dist/src/editor/interface/Control.d.ts +7 -1
- package/dist/src/editor/interface/Editor.d.ts +2 -0
- package/dist/src/editor/interface/Element.d.ts +4 -1
- package/dist/src/editor/utils/ua.d.ts +1 -0
- package/package.json +1 -1
- /package/dist/src/editor/core/draw/particle/{PageBreak.d.ts → PageBreakParticle.d.ts} +0 -0
- /package/dist/src/editor/core/draw/particle/{Separator.d.ts → SeparatorParticle.d.ts} +0 -0
- /package/dist/src/editor/core/draw/particle/{Subscript.d.ts → SubscriptParticle.d.ts} +0 -0
- /package/dist/src/editor/core/draw/particle/{Superscript.d.ts → SuperscriptParticle.d.ts} +0 -0
|
@@ -74,6 +74,8 @@ export declare class Command {
|
|
|
74
74
|
executePaperSize: CommandAdapt['paperSize'];
|
|
75
75
|
executePaperDirection: CommandAdapt['paperDirection'];
|
|
76
76
|
executeSetPaperMargin: CommandAdapt['setPaperMargin'];
|
|
77
|
+
executeSetMainBadge: CommandAdapt['setMainBadge'];
|
|
78
|
+
executeSetAreaBadge: CommandAdapt['setAreaBadge'];
|
|
77
79
|
executeInsertElementList: CommandAdapt['insertElementList'];
|
|
78
80
|
executeInsertArea: CommandAdapt['insertArea'];
|
|
79
81
|
executeSetAreaProperties: CommandAdapt['setAreaProperties'];
|
|
@@ -7,7 +7,7 @@ import { TitleLevel } from '../../dataset/enum/Title';
|
|
|
7
7
|
import { VerticalAlign } from '../../dataset/enum/VerticalAlign';
|
|
8
8
|
import { ICatalog } from '../../interface/Catalog';
|
|
9
9
|
import { DeepRequired } from '../../interface/Common';
|
|
10
|
-
import { IGetControlValueOption, IGetControlValueResult, ILocationControlOption, ISetControlExtensionOption, ISetControlHighlightOption, ISetControlProperties, ISetControlValueOption } from '../../interface/Control';
|
|
10
|
+
import { IGetControlValueOption, IGetControlValueResult, ILocationControlOption, IRemoveControlOption, ISetControlExtensionOption, ISetControlHighlightOption, ISetControlProperties, ISetControlValueOption } from '../../interface/Control';
|
|
11
11
|
import { IAppendElementListOption, IDrawImagePayload, IForceUpdateOption, IGetImageOption, IGetValueOption, IPainterOption } from '../../interface/Draw';
|
|
12
12
|
import { IEditorData, IEditorHTML, IEditorOption, IEditorResult, IEditorText, IFocusOption, ISetValueOption, IUpdateOption } from '../../interface/Editor';
|
|
13
13
|
import { IElement, IElementPosition, IGetElementByIdOption, IUpdateElementByIdOption } from '../../interface/Element';
|
|
@@ -21,6 +21,7 @@ import { IWatermark } from '../../interface/Watermark';
|
|
|
21
21
|
import { Draw } from '../draw/Draw';
|
|
22
22
|
import { INavigateInfo } from '../draw/interactive/Search';
|
|
23
23
|
import { IGetAreaValueOption, IGetAreaValueResult, IInsertAreaOption, ISetAreaPropertiesOption } from '../../interface/Area';
|
|
24
|
+
import { IAreaBadge, IBadge } from '../../interface/Badge';
|
|
24
25
|
export declare class CommandAdapt {
|
|
25
26
|
private draw;
|
|
26
27
|
private range;
|
|
@@ -127,12 +128,14 @@ export declare class CommandAdapt {
|
|
|
127
128
|
paperDirection(payload: PaperDirection): void;
|
|
128
129
|
getPaperMargin(): number[];
|
|
129
130
|
setPaperMargin(payload: IMargin): void;
|
|
131
|
+
setMainBadge(payload: IBadge | null): void;
|
|
132
|
+
setAreaBadge(payload: IAreaBadge[]): void;
|
|
130
133
|
insertElementList(payload: IElement[]): void;
|
|
131
134
|
appendElementList(elementList: IElement[], options?: IAppendElementListOption): void;
|
|
132
135
|
updateElementById(payload: IUpdateElementByIdOption): void;
|
|
133
136
|
getElementById(payload: IGetElementByIdOption): IElement[];
|
|
134
137
|
setValue(payload: Partial<IEditorData>, options?: ISetValueOption): void;
|
|
135
|
-
removeControl(): void;
|
|
138
|
+
removeControl(payload?: IRemoveControlOption): void;
|
|
136
139
|
setLocale(payload: string): void;
|
|
137
140
|
getLocale(): string;
|
|
138
141
|
getCatalog(): Promise<ICatalog | null>;
|
|
@@ -38,6 +38,7 @@ import { LineBreakParticle } from './particle/LineBreakParticle';
|
|
|
38
38
|
import { ITd } from '../../interface/table/Td';
|
|
39
39
|
import { TableOperate } from './particle/table/TableOperate';
|
|
40
40
|
import { Area } from './interactive/Area';
|
|
41
|
+
import { Badge } from './frame/Badge';
|
|
41
42
|
export declare class Draw {
|
|
42
43
|
private container;
|
|
43
44
|
private pageContainer;
|
|
@@ -60,6 +61,7 @@ export declare class Draw {
|
|
|
60
61
|
private range;
|
|
61
62
|
private margin;
|
|
62
63
|
private background;
|
|
64
|
+
private badge;
|
|
63
65
|
private search;
|
|
64
66
|
private group;
|
|
65
67
|
private area;
|
|
@@ -153,6 +155,7 @@ export declare class Draw {
|
|
|
153
155
|
getSearch(): Search;
|
|
154
156
|
getGroup(): Group;
|
|
155
157
|
getArea(): Area;
|
|
158
|
+
getBadge(): Badge;
|
|
156
159
|
getHistoryManager(): HistoryManager;
|
|
157
160
|
getPosition(): Position;
|
|
158
161
|
getZone(): Zone;
|
|
@@ -36,6 +36,7 @@ export declare class Control {
|
|
|
36
36
|
getRange(): IRange;
|
|
37
37
|
shrinkBoundary(context?: IControlContext): void;
|
|
38
38
|
getActiveControl(): IControlInstance | null;
|
|
39
|
+
getControlElementList(context?: IControlContext): IElement[];
|
|
39
40
|
updateActiveControlValue(): void;
|
|
40
41
|
initControl(): void;
|
|
41
42
|
destroyControl(options?: IDestroyControlOption): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IAreaBadge, IBadge } from '../../../interface/Badge';
|
|
2
|
+
import { Draw } from '../Draw';
|
|
3
|
+
export declare class Badge {
|
|
4
|
+
private draw;
|
|
5
|
+
private options;
|
|
6
|
+
private imageCache;
|
|
7
|
+
private mainBadge;
|
|
8
|
+
private areaBadgeMap;
|
|
9
|
+
constructor(draw: Draw);
|
|
10
|
+
setMainBadge(payload: IBadge | null): void;
|
|
11
|
+
setAreaBadgeMap(payload: IAreaBadge[]): void;
|
|
12
|
+
private _drawImage;
|
|
13
|
+
render(ctx: CanvasRenderingContext2D, pageNo: number): void;
|
|
14
|
+
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { IElement, IElementPosition } from '../../interface/Element';
|
|
2
2
|
import { ICurrentPosition, IPositionContext } from '../../interface/Position';
|
|
3
3
|
import { Draw } from '../draw/Draw';
|
|
4
|
-
import { IRange } from '../../interface/Range';
|
|
4
|
+
import { IRange, IRangeElementStyle } from '../../interface/Range';
|
|
5
5
|
import { ICopyOption } from '../../interface/Event';
|
|
6
6
|
export interface ICompositionInfo {
|
|
7
7
|
elementList: IElement[];
|
|
8
8
|
startIndex: number;
|
|
9
9
|
endIndex: number;
|
|
10
10
|
value: string;
|
|
11
|
+
defaultStyle: IRangeElementStyle | null;
|
|
11
12
|
}
|
|
12
13
|
export declare class CanvasEvent {
|
|
13
14
|
isAllowSelection: boolean;
|
|
@@ -4,7 +4,7 @@ import { IElement } from './interface/Element';
|
|
|
4
4
|
import { Command } from './core/command/Command';
|
|
5
5
|
import { Listener } from './core/listener/Listener';
|
|
6
6
|
import { RowFlex } from './dataset/enum/Row';
|
|
7
|
-
import { ImageDisplay, LocationPosition } from './dataset/enum/Common';
|
|
7
|
+
import { FlexDirection, ImageDisplay, LocationPosition } from './dataset/enum/Common';
|
|
8
8
|
import { ElementType } from './dataset/enum/Element';
|
|
9
9
|
import { Register } from './core/register/Register';
|
|
10
10
|
import { IContextMenuContext, IRegisterContextMenu } from './interface/contextmenu/ContextMenu';
|
|
@@ -37,6 +37,7 @@ import { BackgroundRepeat, BackgroundSize } from './dataset/enum/Background';
|
|
|
37
37
|
import { TextDecorationStyle } from './dataset/enum/Text';
|
|
38
38
|
import { LineNumberType } from './dataset/enum/LineNumber';
|
|
39
39
|
import { AreaMode } from './dataset/enum/Area';
|
|
40
|
+
import { IBadge } from './interface/Badge';
|
|
40
41
|
export default class Editor {
|
|
41
42
|
command: Command;
|
|
42
43
|
listener: Listener;
|
|
@@ -49,5 +50,5 @@ export default class Editor {
|
|
|
49
50
|
}
|
|
50
51
|
export { splitText, createDomFromElementList, getElementListByHTML, getTextFromElementList };
|
|
51
52
|
export { EDITOR_COMPONENT, LETTER_CLASS, INTERNAL_CONTEXT_MENU_KEY, EDITOR_CLIPBOARD };
|
|
52
|
-
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, LocationPosition, AreaMode, ControlState };
|
|
53
|
-
export type { IElement, IEditorData, IEditorOption, IEditorResult, IContextMenuContext, IRegisterContextMenu, IWatermark, INavigateInfo, IBlock, ILang, ICatalog, ICatalogItem, IRange, IRangeStyle, IGetElementListByHTMLOption };
|
|
53
|
+
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, LocationPosition, AreaMode, ControlState, FlexDirection };
|
|
54
|
+
export type { IElement, IEditorData, IEditorOption, IEditorResult, IContextMenuContext, IRegisterContextMenu, IWatermark, INavigateInfo, IBlock, ILang, ICatalog, ICatalogItem, IRange, IRangeStyle, IBadge, IGetElementListByHTMLOption };
|
|
@@ -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
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LocationPosition } from '../dataset/enum/Common';
|
|
1
|
+
import { FlexDirection, LocationPosition } from '../dataset/enum/Common';
|
|
2
2
|
import { ControlType, ControlIndentation, ControlState } from '../dataset/enum/Control';
|
|
3
3
|
import { EditorZone } from '../dataset/enum/Editor';
|
|
4
4
|
import { MoveDirection } from '../dataset/enum/Observer';
|
|
@@ -25,10 +25,12 @@ export interface IControlCheckbox {
|
|
|
25
25
|
code: string | null;
|
|
26
26
|
min?: number;
|
|
27
27
|
max?: number;
|
|
28
|
+
flexDirection: FlexDirection;
|
|
28
29
|
valueSets: IValueSet[];
|
|
29
30
|
}
|
|
30
31
|
export interface IControlRadio {
|
|
31
32
|
code: string | null;
|
|
33
|
+
flexDirection: FlexDirection;
|
|
32
34
|
valueSets: IValueSet[];
|
|
33
35
|
}
|
|
34
36
|
export interface IControlDate {
|
|
@@ -164,3 +166,7 @@ export interface IControlChangeResult {
|
|
|
164
166
|
export interface IDestroyControlOption {
|
|
165
167
|
isEmitEvent?: boolean;
|
|
166
168
|
}
|
|
169
|
+
export interface IRemoveControlOption {
|
|
170
|
+
id?: string;
|
|
171
|
+
conceptId?: string;
|
|
172
|
+
}
|
|
@@ -20,6 +20,7 @@ import { ISeparatorOption } from './Separator';
|
|
|
20
20
|
import { ITableOption } from './table/Table';
|
|
21
21
|
import { ILineNumberOption } from './LineNumber';
|
|
22
22
|
import { IPageBorderOption } from './PageBorder';
|
|
23
|
+
import { IBadgeOption } from './Badge';
|
|
23
24
|
export interface IEditorData {
|
|
24
25
|
header?: IElement[];
|
|
25
26
|
main: IElement[];
|
|
@@ -85,6 +86,7 @@ export interface IEditorOption {
|
|
|
85
86
|
separator?: ISeparatorOption;
|
|
86
87
|
lineNumber?: ILineNumberOption;
|
|
87
88
|
pageBorder?: IPageBorderOption;
|
|
89
|
+
badge?: IBadgeOption;
|
|
88
90
|
}
|
|
89
91
|
export interface IEditorResult {
|
|
90
92
|
version: string;
|
|
@@ -59,6 +59,9 @@ export interface ITableAttr {
|
|
|
59
59
|
borderType?: TableBorder;
|
|
60
60
|
borderColor?: string;
|
|
61
61
|
}
|
|
62
|
+
export interface ITableRule {
|
|
63
|
+
tableToolDisabled?: boolean;
|
|
64
|
+
}
|
|
62
65
|
export interface ITableElement {
|
|
63
66
|
tdId?: string;
|
|
64
67
|
trId?: string;
|
|
@@ -67,7 +70,7 @@ export interface ITableElement {
|
|
|
67
70
|
pagingId?: string;
|
|
68
71
|
pagingIndex?: number;
|
|
69
72
|
}
|
|
70
|
-
export type ITable = ITableAttr & ITableElement;
|
|
73
|
+
export type ITable = ITableAttr & ITableRule & ITableElement;
|
|
71
74
|
export interface IHyperlinkElement {
|
|
72
75
|
valueList?: IElement[];
|
|
73
76
|
url?: string;
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|