@hufe921/canvas-editor 0.9.36 → 0.9.37
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 +23 -0
- package/README.md +1 -1
- package/dist/canvas-editor.es.js +78 -1
- package/dist/canvas-editor.es.js.map +1 -1
- package/dist/canvas-editor.umd.js +28 -20
- package/dist/canvas-editor.umd.js.map +1 -1
- package/dist/src/editor/core/command/Command.d.ts +1 -0
- package/dist/src/editor/core/command/CommandAdapt.d.ts +2 -1
- package/dist/src/editor/core/draw/Draw.d.ts +1 -0
- package/dist/src/editor/core/draw/particle/ImageParticle.d.ts +1 -0
- package/dist/src/editor/core/history/HistoryManager.d.ts +1 -0
- package/dist/src/editor/core/plugin/Plugin.d.ts +7 -0
- package/dist/src/editor/index.d.ts +3 -1
- package/dist/src/editor/interface/Plugin.d.ts +3 -0
- package/dist/src/editor/utils/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -66,6 +66,7 @@ export declare class Command {
|
|
|
66
66
|
executePaperDirection: CommandAdapt['paperDirection'];
|
|
67
67
|
executeSetPaperMargin: CommandAdapt['setPaperMargin'];
|
|
68
68
|
executeInsertElementList: CommandAdapt['insertElementList'];
|
|
69
|
+
executeSetValue: CommandAdapt['setValue'];
|
|
69
70
|
executeRemoveControl: CommandAdapt['removeControl'];
|
|
70
71
|
executeSetLocale: CommandAdapt['setLocale'];
|
|
71
72
|
executeLocationCatalog: CommandAdapt['locationCatalog'];
|
|
@@ -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 { IDrawImagePayload, IPainterOptions } from '../../interface/Draw';
|
|
10
|
-
import { IEditorResult } from '../../interface/Editor';
|
|
10
|
+
import { IEditorData, IEditorResult } from '../../interface/Editor';
|
|
11
11
|
import { IElement } from '../../interface/Element';
|
|
12
12
|
import { IMargin } from '../../interface/Margin';
|
|
13
13
|
import { IWatermark } from '../../interface/Watermark';
|
|
@@ -100,6 +100,7 @@ export declare class CommandAdapt {
|
|
|
100
100
|
getPaperMargin(): number[];
|
|
101
101
|
setPaperMargin(payload: IMargin): void;
|
|
102
102
|
insertElementList(payload: IElement[]): void;
|
|
103
|
+
setValue(payload: Partial<IEditorData>): void;
|
|
103
104
|
removeControl(): void;
|
|
104
105
|
setLocale(payload: string): void;
|
|
105
106
|
getCatalog(): Promise<ICatalog | null>;
|
|
@@ -166,6 +166,7 @@ export declare class Draw {
|
|
|
166
166
|
setPaperDirection(payload: PaperDirection): void;
|
|
167
167
|
setPaperMargin(payload: IMargin): void;
|
|
168
168
|
getValue(): IEditorResult;
|
|
169
|
+
setValue(payload: Partial<IEditorData>): void;
|
|
169
170
|
private _wrapContainer;
|
|
170
171
|
private _formatContainer;
|
|
171
172
|
private _createPageContainer;
|
|
@@ -7,5 +7,6 @@ export declare class ImageParticle {
|
|
|
7
7
|
protected imageCache: Map<string, HTMLImageElement>;
|
|
8
8
|
constructor(draw: Draw);
|
|
9
9
|
protected addImageObserver(promise: Promise<unknown>): void;
|
|
10
|
+
protected getFallbackImage(width: number, height: number): HTMLImageElement;
|
|
10
11
|
render(ctx: CanvasRenderingContext2D, element: IElement, x: number, y: number): void;
|
|
11
12
|
}
|
|
@@ -22,11 +22,13 @@ import { MaxHeightRatio, NumberType } from './dataset/enum/Common';
|
|
|
22
22
|
import { TitleLevel } from './dataset/enum/Title';
|
|
23
23
|
import { ListStyle, ListType } from './dataset/enum/List';
|
|
24
24
|
import { ICatalog, ICatalogItem } from './interface/Catalog';
|
|
25
|
+
import { UsePlugin } from './interface/Plugin';
|
|
25
26
|
export default class Editor {
|
|
26
27
|
command: Command;
|
|
27
28
|
listener: Listener;
|
|
28
29
|
register: Register;
|
|
29
|
-
destroy:
|
|
30
|
+
destroy: () => void;
|
|
31
|
+
use: UsePlugin;
|
|
30
32
|
constructor(container: HTMLDivElement, data: IEditorData | IElement[], options?: IEditorOption);
|
|
31
33
|
}
|
|
32
34
|
export { Editor, RowFlex, VerticalAlign, EditorZone, EditorMode, ElementType, ControlType, EditorComponent, EDITOR_COMPONENT, PageMode, ImageDisplay, Command, KeyMap, BlockType, PaperDirection, TableBorder, MaxHeightRatio, NumberType, TitleLevel, ListType, ListStyle };
|
|
@@ -12,3 +12,4 @@ export declare function mergeObject<T>(source: T, target: T): T;
|
|
|
12
12
|
export declare function nextTick(fn: Function): void;
|
|
13
13
|
export declare function convertNumberToChinese(num: number): string;
|
|
14
14
|
export declare function cloneProperty<T>(properties: (keyof T)[], sourceElement: T, targetElement: T): void;
|
|
15
|
+
export declare function convertStringToBase64(input: string): string;
|