@hufe921/canvas-editor 0.9.89 → 0.9.91
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 +38 -0
- package/dist/canvas-editor.es.js +298 -103
- package/dist/canvas-editor.es.js.map +1 -1
- package/dist/canvas-editor.umd.js +33 -32
- package/dist/canvas-editor.umd.js.map +1 -1
- package/dist/src/editor/core/command/CommandAdapt.d.ts +2 -2
- package/dist/src/editor/core/draw/Draw.d.ts +2 -0
- package/dist/src/editor/core/draw/frame/PageBorder.d.ts +9 -0
- package/dist/src/editor/core/draw/particle/CheckboxParticle.d.ts +10 -2
- package/dist/src/editor/core/draw/particle/RadioParticle.d.ts +10 -2
- package/dist/src/editor/core/event/handlers/mousedown.d.ts +4 -0
- package/dist/src/editor/dataset/constant/PageBorder.d.ts +2 -0
- package/dist/src/editor/dataset/enum/Common.d.ts +4 -0
- package/dist/src/editor/index.d.ts +2 -2
- package/dist/src/editor/interface/Checkbox.d.ts +2 -0
- package/dist/src/editor/interface/Control.d.ts +4 -0
- package/dist/src/editor/interface/Editor.d.ts +2 -0
- package/dist/src/editor/interface/PageBorder.d.ts +7 -0
- package/dist/src/editor/interface/Radio.d.ts +2 -0
- package/dist/src/editor/utils/element.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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, ISetControlExtensionOption, ISetControlHighlightOption, ISetControlProperties, ISetControlValueOption } from '../../interface/Control';
|
|
10
|
+
import { IGetControlValueOption, IGetControlValueResult, ILocationControlOption, 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, ISetValueOption, IUpdateOption } from '../../interface/Editor';
|
|
13
13
|
import { IElement, IUpdateElementByIdOption } from '../../interface/Element';
|
|
@@ -143,7 +143,7 @@ export declare class CommandAdapt {
|
|
|
143
143
|
setControlHighlight(payload: ISetControlHighlightOption): void;
|
|
144
144
|
updateOptions(payload: IUpdateOption): void;
|
|
145
145
|
getControlList(): IElement[];
|
|
146
|
-
locationControl(controlId: string): void;
|
|
146
|
+
locationControl(controlId: string, options?: ILocationControlOption): void;
|
|
147
147
|
insertControl(payload: IElement): void;
|
|
148
148
|
getContainer(): HTMLDivElement;
|
|
149
149
|
getTitleValue(payload: IGetTitleValueOption): IGetTitleValueResult | null;
|
|
@@ -87,6 +87,7 @@ export declare class Draw {
|
|
|
87
87
|
private listParticle;
|
|
88
88
|
private lineBreakParticle;
|
|
89
89
|
private control;
|
|
90
|
+
private pageBorder;
|
|
90
91
|
private workerManager;
|
|
91
92
|
private scrollObserver;
|
|
92
93
|
private selectionObserver;
|
|
@@ -117,6 +118,7 @@ export declare class Draw {
|
|
|
117
118
|
getCanvasHeight(pageNo?: number): number;
|
|
118
119
|
getInnerWidth(): number;
|
|
119
120
|
getOriginalInnerWidth(): number;
|
|
121
|
+
getContextInnerWidth(): number;
|
|
120
122
|
getMargins(): IMargin;
|
|
121
123
|
getOriginalMargins(): number[];
|
|
122
124
|
getPageGap(): number;
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { IElement } from '../../../interface/Element';
|
|
2
|
-
import {
|
|
2
|
+
import { IRow } from '../../../interface/Row';
|
|
3
3
|
import { Draw } from '../Draw';
|
|
4
|
+
interface ICheckboxRenderOption {
|
|
5
|
+
ctx: CanvasRenderingContext2D;
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
row: IRow;
|
|
9
|
+
index: number;
|
|
10
|
+
}
|
|
4
11
|
export declare class CheckboxParticle {
|
|
5
12
|
private draw;
|
|
6
13
|
private options;
|
|
7
14
|
constructor(draw: Draw);
|
|
8
15
|
setSelect(element: IElement): void;
|
|
9
|
-
render(
|
|
16
|
+
render(payload: ICheckboxRenderOption): void;
|
|
10
17
|
}
|
|
18
|
+
export {};
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { IElement } from '../../../interface/Element';
|
|
2
|
-
import {
|
|
2
|
+
import { IRow } from '../../../interface/Row';
|
|
3
3
|
import { Draw } from '../Draw';
|
|
4
|
+
interface IRadioRenderOption {
|
|
5
|
+
ctx: CanvasRenderingContext2D;
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
row: IRow;
|
|
9
|
+
index: number;
|
|
10
|
+
}
|
|
4
11
|
export declare class RadioParticle {
|
|
5
12
|
private draw;
|
|
6
13
|
private options;
|
|
7
14
|
constructor(draw: Draw);
|
|
8
15
|
setSelect(element: IElement): void;
|
|
9
|
-
render(
|
|
16
|
+
render(payload: IRadioRenderOption): void;
|
|
10
17
|
}
|
|
18
|
+
export {};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { CanvasEvent } from '../CanvasEvent';
|
|
2
|
+
import { IElement } from '../../../interface/Element';
|
|
3
|
+
import { Draw } from '../../draw/Draw';
|
|
2
4
|
export declare function setRangeCache(host: CanvasEvent): void;
|
|
5
|
+
export declare function hitCheckbox(element: IElement, draw: Draw): void;
|
|
6
|
+
export declare function hitRadio(element: IElement, draw: Draw): void;
|
|
3
7
|
export declare function mousedown(evt: MouseEvent, host: CanvasEvent): void;
|
|
@@ -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 } from './dataset/enum/Common';
|
|
7
|
+
import { 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';
|
|
@@ -47,5 +47,5 @@ export default class Editor {
|
|
|
47
47
|
}
|
|
48
48
|
export { splitText };
|
|
49
49
|
export { EDITOR_COMPONENT, LETTER_CLASS, INTERNAL_CONTEXT_MENU_KEY };
|
|
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
|
+
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 };
|
|
51
51
|
export type { IElement, IEditorData, IEditorOption, IEditorResult, IContextMenuContext, IRegisterContextMenu, IWatermark, INavigateInfo, IBlock, ILang, ICatalog, ICatalogItem, IRange, IRangeStyle };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { VerticalAlign } from '../dataset/enum/VerticalAlign';
|
|
1
2
|
export interface ICheckbox {
|
|
2
3
|
value: boolean | null;
|
|
3
4
|
code?: string;
|
|
@@ -10,4 +11,5 @@ export interface ICheckboxOption {
|
|
|
10
11
|
lineWidth?: number;
|
|
11
12
|
fillStyle?: string;
|
|
12
13
|
strokeStyle?: string;
|
|
14
|
+
verticalAlign?: VerticalAlign;
|
|
13
15
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LocationPosition } from '../dataset/enum/Common';
|
|
1
2
|
import { ControlType, ControlIndentation } from '../dataset/enum/Control';
|
|
2
3
|
import { EditorZone } from '../dataset/enum/Editor';
|
|
3
4
|
import { MoveDirection } from '../dataset/enum/Observer';
|
|
@@ -129,3 +130,6 @@ export interface INextControlContext {
|
|
|
129
130
|
export interface IInitNextControlOption {
|
|
130
131
|
direction?: MoveDirection;
|
|
131
132
|
}
|
|
133
|
+
export interface ILocationControlOption {
|
|
134
|
+
position: LocationPosition;
|
|
135
|
+
}
|
|
@@ -19,6 +19,7 @@ import { IZoneOption } from './Zone';
|
|
|
19
19
|
import { ISeparatorOption } from './Separator';
|
|
20
20
|
import { ITableOption } from './table/Table';
|
|
21
21
|
import { ILineNumberOption } from './LineNumber';
|
|
22
|
+
import { IPageBorderOption } from './PageBorder';
|
|
22
23
|
export interface IEditorData {
|
|
23
24
|
header?: IElement[];
|
|
24
25
|
main: IElement[];
|
|
@@ -83,6 +84,7 @@ export interface IEditorOption {
|
|
|
83
84
|
lineBreak?: ILineBreakOption;
|
|
84
85
|
separator?: ISeparatorOption;
|
|
85
86
|
lineNumber?: ILineNumberOption;
|
|
87
|
+
pageBorder?: IPageBorderOption;
|
|
86
88
|
}
|
|
87
89
|
export interface IEditorResult {
|
|
88
90
|
version: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { VerticalAlign } from '../dataset/enum/VerticalAlign';
|
|
1
2
|
export interface IRadio {
|
|
2
3
|
value: boolean | null;
|
|
3
4
|
code?: string;
|
|
@@ -10,4 +11,5 @@ export interface IRadioOption {
|
|
|
10
11
|
lineWidth?: number;
|
|
11
12
|
fillStyle?: string;
|
|
12
13
|
strokeStyle?: string;
|
|
14
|
+
verticalAlign?: VerticalAlign;
|
|
13
15
|
}
|
|
@@ -3,6 +3,7 @@ import { DeepRequired } from '../interface/Common';
|
|
|
3
3
|
export declare function unzipElementList(elementList: IElement[]): IElement[];
|
|
4
4
|
interface IFormatElementListOption {
|
|
5
5
|
isHandleFirstElement?: boolean;
|
|
6
|
+
isForceCompensation?: boolean;
|
|
6
7
|
editorOptions: DeepRequired<IEditorOption>;
|
|
7
8
|
}
|
|
8
9
|
export declare function formatElementList(elementList: IElement[], options: IFormatElementListOption): void;
|