@hufe921/canvas-editor 0.9.81 → 0.9.83
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 +33 -0
- package/dist/canvas-editor.es.js +247 -40
- package/dist/canvas-editor.es.js.map +1 -1
- package/dist/canvas-editor.umd.js +38 -38
- 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/control/Control.d.ts +1 -0
- package/dist/src/editor/core/observer/MouseObserver.d.ts +10 -0
- package/dist/src/editor/core/override/Override.d.ts +1 -0
- package/dist/src/editor/core/range/RangeManager.d.ts +1 -0
- package/dist/src/editor/interface/Element.d.ts +4 -0
- package/dist/src/editor/interface/Event.d.ts +7 -0
- package/dist/src/editor/interface/EventBus.d.ts +4 -1
- package/dist/src/editor/interface/Listener.d.ts +1 -0
- package/dist/src/editor/interface/table/Td.d.ts +1 -0
- package/dist/src/editor/utils/index.d.ts +2 -2
- package/package.json +1 -1
|
@@ -74,6 +74,7 @@ export declare class Command {
|
|
|
74
74
|
executeSetPaperMargin: CommandAdapt['setPaperMargin'];
|
|
75
75
|
executeInsertElementList: CommandAdapt['insertElementList'];
|
|
76
76
|
executeAppendElementList: CommandAdapt['appendElementList'];
|
|
77
|
+
executeUpdateElementById: CommandAdapt['updateElementById'];
|
|
77
78
|
executeSetValue: CommandAdapt['setValue'];
|
|
78
79
|
executeRemoveControl: CommandAdapt['removeControl'];
|
|
79
80
|
executeSetLocale: CommandAdapt['setLocale'];
|
|
@@ -112,5 +113,6 @@ export declare class Command {
|
|
|
112
113
|
getControlList: CommandAdapt['getControlList'];
|
|
113
114
|
getContainer: CommandAdapt['getContainer'];
|
|
114
115
|
getTitleValue: CommandAdapt['getTitleValue'];
|
|
116
|
+
getPositionContextByEvent: CommandAdapt['getPositionContextByEvent'];
|
|
115
117
|
constructor(adapt: CommandAdapt);
|
|
116
118
|
}
|
|
@@ -10,8 +10,8 @@ import { DeepRequired } from '../../interface/Common';
|
|
|
10
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, IUpdateOption } from '../../interface/Editor';
|
|
13
|
-
import { IElement } from '../../interface/Element';
|
|
14
|
-
import { IPasteOption } from '../../interface/Event';
|
|
13
|
+
import { IElement, IUpdateElementByIdOption } from '../../interface/Element';
|
|
14
|
+
import { IPasteOption, IPositionContextByEvent } from '../../interface/Event';
|
|
15
15
|
import { IMargin } from '../../interface/Margin';
|
|
16
16
|
import { IRange, RangeContext } from '../../interface/Range';
|
|
17
17
|
import { ITextDecoration } from '../../interface/Text';
|
|
@@ -31,6 +31,7 @@ export declare class CommandAdapt {
|
|
|
31
31
|
private workerManager;
|
|
32
32
|
private searchManager;
|
|
33
33
|
private i18n;
|
|
34
|
+
private zone;
|
|
34
35
|
constructor(draw: Draw);
|
|
35
36
|
mode(payload: EditorMode): void;
|
|
36
37
|
cut(): void;
|
|
@@ -121,6 +122,7 @@ export declare class CommandAdapt {
|
|
|
121
122
|
setPaperMargin(payload: IMargin): void;
|
|
122
123
|
insertElementList(payload: IElement[]): void;
|
|
123
124
|
appendElementList(elementList: IElement[], options?: IAppendElementListOption): void;
|
|
125
|
+
updateElementById(payload: IUpdateElementByIdOption): void;
|
|
124
126
|
setValue(payload: Partial<IEditorData>): void;
|
|
125
127
|
removeControl(): void;
|
|
126
128
|
setLocale(payload: string): void;
|
|
@@ -144,5 +146,6 @@ export declare class CommandAdapt {
|
|
|
144
146
|
locationControl(controlId: string): void;
|
|
145
147
|
getContainer(): HTMLDivElement;
|
|
146
148
|
getTitleValue(payload: IGetTitleValueOption): IGetTitleValueResult | null;
|
|
149
|
+
getPositionContextByEvent(evt: MouseEvent): IPositionContextByEvent | null;
|
|
147
150
|
insertTitle(payload: IElement): void;
|
|
148
151
|
}
|
|
@@ -25,6 +25,7 @@ export declare class Control {
|
|
|
25
25
|
getIsRangeCanCaptureEvent(): boolean;
|
|
26
26
|
getIsRangeInPostfix(): boolean;
|
|
27
27
|
getIsRangeWithinControl(): boolean;
|
|
28
|
+
getIsElementListContainFullControl(elementList: IElement[]): boolean;
|
|
28
29
|
getIsDisabledControl(): boolean;
|
|
29
30
|
getContainer(): HTMLDivElement;
|
|
30
31
|
getElementList(): IElement[];
|
|
@@ -23,6 +23,7 @@ export declare class RangeManager {
|
|
|
23
23
|
getRangeParagraph(): RangeRowArray | null;
|
|
24
24
|
getRangeParagraphInfo(): IRangeParagraphInfo | null;
|
|
25
25
|
getRangeParagraphElementList(): IElement[] | null;
|
|
26
|
+
getRangeTableElement(): IElement | null;
|
|
26
27
|
getIsSelectAll(): boolean;
|
|
27
28
|
getIsPointInRange(x: number, y: number): boolean;
|
|
28
29
|
getKeywordRangeList(payload: string): IRange[];
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import { IElement } from './Element';
|
|
2
|
+
import { RangeRect } from './Range';
|
|
1
3
|
export interface IPasteOption {
|
|
2
4
|
isPlainText: boolean;
|
|
3
5
|
}
|
|
6
|
+
export interface IPositionContextByEvent {
|
|
7
|
+
pageNo: number;
|
|
8
|
+
element: IElement | null;
|
|
9
|
+
rangeRect: RangeRect | null;
|
|
10
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IContentChange, IControlChange, IIntersectionPageNoChange, IPageModeChange, IPageScaleChange, IPageSizeChange, IRangeStyleChange, ISaved, IVisiblePageNoListChange, IZoneChange } from './Listener';
|
|
1
|
+
import { IContentChange, IControlChange, IIntersectionPageNoChange, IMouseEventChange, IPageModeChange, IPageScaleChange, IPageSizeChange, IRangeStyleChange, ISaved, IVisiblePageNoListChange, IZoneChange } from './Listener';
|
|
2
2
|
export interface EventBusMap {
|
|
3
3
|
rangeStyleChange: IRangeStyleChange;
|
|
4
4
|
visiblePageNoListChange: IVisiblePageNoListChange;
|
|
@@ -10,4 +10,7 @@ export interface EventBusMap {
|
|
|
10
10
|
controlChange: IControlChange;
|
|
11
11
|
pageModeChange: IPageModeChange;
|
|
12
12
|
zoneChange: IZoneChange;
|
|
13
|
+
mousemove: IMouseEventChange;
|
|
14
|
+
mouseleave: IMouseEventChange;
|
|
15
|
+
mouseenter: IMouseEventChange;
|
|
13
16
|
}
|
|
@@ -36,3 +36,4 @@ export type IContentChange = () => void;
|
|
|
36
36
|
export type IControlChange = (payload: IControl | null) => void;
|
|
37
37
|
export type IPageModeChange = (payload: PageMode) => void;
|
|
38
38
|
export type IZoneChange = (payload: EditorZone) => void;
|
|
39
|
+
export type IMouseEventChange = (evt: MouseEvent) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare function debounce(func:
|
|
2
|
-
export declare function throttle(func:
|
|
1
|
+
export declare function debounce<T extends unknown[]>(func: (...arg: T) => unknown, delay: number): (this: unknown, ...args: T) => void;
|
|
2
|
+
export declare function throttle<T extends unknown[]>(func: (...arg: T) => unknown, delay: number): (this: unknown, ...args: T) => void;
|
|
3
3
|
export declare function deepCloneOmitKeys<T, K>(obj: T, omitKeys: (keyof K)[]): T;
|
|
4
4
|
export declare function deepClone<T>(obj: T): T;
|
|
5
5
|
export declare function isBody(node: Element): boolean;
|