@hufe921/canvas-editor 0.9.63 → 0.9.64
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 +17 -0
- package/dist/canvas-editor.es.js +179 -78
- package/dist/canvas-editor.es.js.map +1 -1
- package/dist/canvas-editor.umd.js +32 -32
- 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/control/Control.d.ts +3 -1
- package/dist/src/editor/core/event/handlers/paste.d.ts +3 -1
- package/dist/src/editor/dataset/constant/Editor.d.ts +1 -0
- package/dist/src/editor/interface/Control.d.ts +4 -0
- package/dist/src/editor/utils/clipboard.d.ts +8 -1
- package/package.json +1 -1
|
@@ -86,6 +86,7 @@ export declare class Command {
|
|
|
86
86
|
executeSetZone: CommandAdapt['setZone'];
|
|
87
87
|
executeSetControlValue: CommandAdapt['setControlValue'];
|
|
88
88
|
executeSetControlExtension: CommandAdapt['setControlExtension'];
|
|
89
|
+
executeSetControlProperties: CommandAdapt['setControlProperties'];
|
|
89
90
|
executeSetControlHighlight: CommandAdapt['setControlHighlight'];
|
|
90
91
|
getCatalog: CommandAdapt['getCatalog'];
|
|
91
92
|
getImage: CommandAdapt['getImage'];
|
|
@@ -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, ISetControlValueOption } from '../../interface/Control';
|
|
10
|
+
import { IGetControlValueOption, IGetControlValueResult, 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 } from '../../interface/Editor';
|
|
13
13
|
import { IElement } from '../../interface/Element';
|
|
@@ -134,6 +134,7 @@ export declare class CommandAdapt {
|
|
|
134
134
|
getControlValue(payload: IGetControlValueOption): IGetControlValueResult | null;
|
|
135
135
|
setControlValue(payload: ISetControlValueOption): void;
|
|
136
136
|
setControlExtension(payload: ISetControlExtensionOption): void;
|
|
137
|
+
setControlProperties(payload: ISetControlProperties): void;
|
|
137
138
|
setControlHighlight(payload: ISetControlHighlightOption): void;
|
|
138
139
|
getContainer(): HTMLDivElement;
|
|
139
140
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IControlContext, IControlHighlight, IControlInitOption, IControlInstance, IGetControlValueOption, IGetControlValueResult, ISetControlExtensionOption, ISetControlValueOption } from '../../../interface/Control';
|
|
1
|
+
import { IControlContext, IControlHighlight, IControlInitOption, IControlInstance, IGetControlValueOption, IGetControlValueResult, ISetControlExtensionOption, ISetControlProperties, ISetControlValueOption } from '../../../interface/Control';
|
|
2
2
|
import { IElement, IElementPosition } from '../../../interface/Element';
|
|
3
3
|
import { IRange } from '../../../interface/Range';
|
|
4
4
|
import { Draw } from '../Draw';
|
|
@@ -24,6 +24,7 @@ export declare class Control {
|
|
|
24
24
|
isPartRangeInControlOutside(): boolean;
|
|
25
25
|
isRangInPostfix(): boolean;
|
|
26
26
|
isRangeWithinControl(): boolean;
|
|
27
|
+
isRangeCanInput(): boolean;
|
|
27
28
|
isDisabledControl(): boolean;
|
|
28
29
|
getContainer(): HTMLDivElement;
|
|
29
30
|
getElementList(): IElement[];
|
|
@@ -45,5 +46,6 @@ export declare class Control {
|
|
|
45
46
|
getValueByConceptId(payload: IGetControlValueOption): IGetControlValueResult;
|
|
46
47
|
setValueByConceptId(payload: ISetControlValueOption): void;
|
|
47
48
|
setExtensionByConceptId(payload: ISetControlExtensionOption): void;
|
|
49
|
+
setPropertiesByConceptId(payload: ISetControlProperties): void;
|
|
48
50
|
}
|
|
49
51
|
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { IElement } from '../../../interface/Element';
|
|
1
2
|
import { IPasteOption } from '../../../interface/Event';
|
|
2
3
|
import { CanvasEvent } from '../CanvasEvent';
|
|
3
|
-
export declare function
|
|
4
|
+
export declare function pasteElement(host: CanvasEvent, elementList: IElement[]): void;
|
|
5
|
+
export declare function pasteHTML(host: CanvasEvent, htmlText: string): void;
|
|
4
6
|
export declare function pasteImage(host: CanvasEvent, file: File | Blob): void;
|
|
5
7
|
export declare function pasteByEvent(host: CanvasEvent, evt: ClipboardEvent): void;
|
|
6
8
|
export declare function pasteByApi(host: CanvasEvent, options?: IPasteOption): Promise<void>;
|
|
@@ -91,3 +91,7 @@ export interface ISetControlExtensionOption {
|
|
|
91
91
|
extension: unknown;
|
|
92
92
|
}
|
|
93
93
|
export declare type ISetControlHighlightOption = IControlHighlight[];
|
|
94
|
+
export declare type ISetControlProperties = {
|
|
95
|
+
conceptId: string;
|
|
96
|
+
properties: Partial<Omit<IControl, 'value'>>;
|
|
97
|
+
};
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { IEditorOption, IElement } from '..';
|
|
2
2
|
import { DeepRequired } from '../interface/Common';
|
|
3
|
-
export
|
|
3
|
+
export interface IClipboardData {
|
|
4
|
+
text: string;
|
|
5
|
+
elementList: IElement[];
|
|
6
|
+
}
|
|
7
|
+
export declare function setClipboardData(data: IClipboardData): void;
|
|
8
|
+
export declare function getClipboardData(): IClipboardData | null;
|
|
9
|
+
export declare function removeClipboardData(): void;
|
|
10
|
+
export declare function writeClipboardItem(text: string, html: string, elementList: IElement[]): void;
|
|
4
11
|
export declare function writeElementList(elementList: IElement[], options: DeepRequired<IEditorOption>): void;
|