@hufe921/canvas-editor 0.9.89 → 0.9.90
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 +21 -0
- package/dist/canvas-editor.es.js +174 -44
- 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/CommandAdapt.d.ts +2 -2
- package/dist/src/editor/core/draw/Draw.d.ts +1 -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/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/Radio.d.ts +2 -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;
|
|
@@ -117,6 +117,7 @@ export declare class Draw {
|
|
|
117
117
|
getCanvasHeight(pageNo?: number): number;
|
|
118
118
|
getInnerWidth(): number;
|
|
119
119
|
getOriginalInnerWidth(): number;
|
|
120
|
+
getContextInnerWidth(): number;
|
|
120
121
|
getMargins(): IMargin;
|
|
121
122
|
getOriginalMargins(): number[];
|
|
122
123
|
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 {};
|
|
@@ -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
|
+
}
|
|
@@ -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
|
}
|