@hufe921/canvas-editor 0.9.43 → 0.9.44
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 +11 -0
- package/dist/canvas-editor.es.js +279 -105
- package/dist/canvas-editor.es.js.map +1 -1
- package/dist/canvas-editor.umd.js +27 -22
- 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 -3
- package/dist/src/editor/core/draw/Draw.d.ts +4 -2
- package/dist/src/editor/core/draw/control/Control.d.ts +2 -0
- package/dist/src/editor/core/range/RangeManager.d.ts +3 -0
- package/dist/src/editor/dataset/enum/Editor.d.ts +2 -1
- package/dist/src/editor/interface/Draw.d.ts +5 -1
- package/dist/src/editor/interface/Editor.d.ts +1 -0
- package/dist/src/editor/utils/element.d.ts +2 -0
- package/package.json +1 -1
|
@@ -41,6 +41,7 @@ export declare class Command {
|
|
|
41
41
|
executeTableTdVerticalAlign: CommandAdapt['tableTdVerticalAlign'];
|
|
42
42
|
executeTableBorderType: CommandAdapt['tableBorderType'];
|
|
43
43
|
executeTableTdBackgroundColor: CommandAdapt['tableTdBackgroundColor'];
|
|
44
|
+
executeTableSelectAll: CommandAdapt['tableSelectAll'];
|
|
44
45
|
executeImage: CommandAdapt['image'];
|
|
45
46
|
executeHyperlink: CommandAdapt['hyperlink'];
|
|
46
47
|
executeDeleteHyperlink: CommandAdapt['deleteHyperlink'];
|
|
@@ -77,6 +78,7 @@ export declare class Command {
|
|
|
77
78
|
getImage: CommandAdapt['getImage'];
|
|
78
79
|
getValue: CommandAdapt['getValue'];
|
|
79
80
|
getHTML: CommandAdapt['getHTML'];
|
|
81
|
+
getText: CommandAdapt['getText'];
|
|
80
82
|
getWordCount: CommandAdapt['getWordCount'];
|
|
81
83
|
getRangeText: CommandAdapt['getRangeText'];
|
|
82
84
|
getRangeContext: CommandAdapt['getRangeContext'];
|
|
@@ -6,8 +6,8 @@ import { TableBorder } from '../../dataset/enum/table/Table';
|
|
|
6
6
|
import { TitleLevel } from '../../dataset/enum/Title';
|
|
7
7
|
import { VerticalAlign } from '../../dataset/enum/VerticalAlign';
|
|
8
8
|
import { ICatalog } from '../../interface/Catalog';
|
|
9
|
-
import { IAppendElementListOption, IDrawImagePayload, IGetValueOption, IPainterOption } from '../../interface/Draw';
|
|
10
|
-
import { IEditorData, IEditorHTML, IEditorResult } from '../../interface/Editor';
|
|
9
|
+
import { IAppendElementListOption, IDrawImagePayload, IGetImageOption, IGetValueOption, IPainterOption } from '../../interface/Draw';
|
|
10
|
+
import { IEditorData, IEditorHTML, IEditorResult, IEditorText } from '../../interface/Editor';
|
|
11
11
|
import { IElement } from '../../interface/Element';
|
|
12
12
|
import { IMargin } from '../../interface/Margin';
|
|
13
13
|
import { RangeContext } from '../../interface/Range';
|
|
@@ -68,6 +68,7 @@ export declare class CommandAdapt {
|
|
|
68
68
|
tableTdVerticalAlign(payload: VerticalAlign): void;
|
|
69
69
|
tableBorderType(payload: TableBorder): void;
|
|
70
70
|
tableTdBackgroundColor(payload: string): void;
|
|
71
|
+
tableSelectAll(): void;
|
|
71
72
|
hyperlink(payload: IElement): void;
|
|
72
73
|
getHyperlinkRange(): [number, number] | null;
|
|
73
74
|
deleteHyperlink(): void;
|
|
@@ -87,9 +88,10 @@ export declare class CommandAdapt {
|
|
|
87
88
|
replaceImageElement(payload: string): void;
|
|
88
89
|
saveAsImageElement(): void;
|
|
89
90
|
changeImageDisplay(element: IElement, display: ImageDisplay): void;
|
|
90
|
-
getImage(
|
|
91
|
+
getImage(payload?: IGetImageOption): Promise<string[]>;
|
|
91
92
|
getValue(options?: IGetValueOption): IEditorResult;
|
|
92
93
|
getHTML(): IEditorHTML;
|
|
94
|
+
getText(): IEditorText;
|
|
93
95
|
getWordCount(): Promise<number>;
|
|
94
96
|
getRangeText(): string;
|
|
95
97
|
getRangeContext(): RangeContext | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IAppendElementListOption, IDrawOption, IDrawRowPayload, IGetValueOption, IPainterOption } from '../../interface/Draw';
|
|
1
|
+
import { IAppendElementListOption, IDrawOption, IDrawRowPayload, IGetImageOption, IGetValueOption, IPainterOption } from '../../interface/Draw';
|
|
2
2
|
import { IEditorData, IEditorOption, IEditorResult } from '../../interface/Editor';
|
|
3
3
|
import { IElement, IElementStyle } from '../../interface/Element';
|
|
4
4
|
import { IRow } from '../../interface/Row';
|
|
@@ -86,6 +86,7 @@ export declare class Draw {
|
|
|
86
86
|
private visiblePageNoList;
|
|
87
87
|
private intersectionPageNo;
|
|
88
88
|
private lazyRenderIntersectionObserver;
|
|
89
|
+
private printModeData;
|
|
89
90
|
constructor(rootContainer: HTMLElement, options: DeepRequired<IEditorOption>, data: IEditorData, listener: Listener, eventBus: EventBus<EventBusMap>);
|
|
90
91
|
getMode(): EditorMode;
|
|
91
92
|
setMode(payload: EditorMode): void;
|
|
@@ -157,7 +158,7 @@ export declare class Draw {
|
|
|
157
158
|
getImageObserver(): ImageObserver;
|
|
158
159
|
getI18n(): I18n;
|
|
159
160
|
getRowCount(): number;
|
|
160
|
-
getDataURL(
|
|
161
|
+
getDataURL(payload?: IGetImageOption): Promise<string[]>;
|
|
161
162
|
getPainterStyle(): IElementStyle | null;
|
|
162
163
|
getPainterOptions(): IPainterOption | null;
|
|
163
164
|
setPainterStyle(payload: IElementStyle | null, options?: IPainterOption): void;
|
|
@@ -173,6 +174,7 @@ export declare class Draw {
|
|
|
173
174
|
setPaperMargin(payload: IMargin): void;
|
|
174
175
|
getValue(options?: IGetValueOption): IEditorResult;
|
|
175
176
|
setValue(payload: Partial<IEditorData>): void;
|
|
177
|
+
setEditorData(payload: Partial<IEditorData>): void;
|
|
176
178
|
private _wrapContainer;
|
|
177
179
|
private _formatContainer;
|
|
178
180
|
private _createPageContainer;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IControlInitOption, IControlInstance } from '../../../interface/Control';
|
|
2
|
+
import { IEditorData } from '../../../interface/Editor';
|
|
2
3
|
import { IElement, IElementPosition } from '../../../interface/Element';
|
|
3
4
|
import { IRange } from '../../../interface/Range';
|
|
4
5
|
import { Draw } from '../Draw';
|
|
@@ -15,6 +16,7 @@ export declare class Control {
|
|
|
15
16
|
private activeControl;
|
|
16
17
|
constructor(draw: Draw);
|
|
17
18
|
getDraw(): Draw;
|
|
19
|
+
filterAssistElement(payload: Required<IEditorData>): Required<IEditorData>;
|
|
18
20
|
isPartRangeInControlOutside(): boolean;
|
|
19
21
|
isRangInPostfix(): boolean;
|
|
20
22
|
isRangeWithinControl(): boolean;
|
|
@@ -14,8 +14,11 @@ export declare class RangeManager {
|
|
|
14
14
|
clearRange(): void;
|
|
15
15
|
getIsCollapsed(): boolean;
|
|
16
16
|
getSelection(): IElement[] | null;
|
|
17
|
+
getSelectionElementList(): IElement[] | null;
|
|
17
18
|
getTextLikeSelection(): IElement[] | null;
|
|
19
|
+
getTextLikeSelectionElementList(): IElement[] | null;
|
|
18
20
|
getRangeRow(): RangeRowMap | null;
|
|
21
|
+
getRangeRowElementList(): IElement[] | null;
|
|
19
22
|
getRangeParagraph(): RangeRowArray | null;
|
|
20
23
|
getRangeElementList(): IElement[] | null;
|
|
21
24
|
getIsSelectAll(): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EditorZone } from '../dataset/enum/Editor';
|
|
1
|
+
import { EditorMode, EditorZone } from '../dataset/enum/Editor';
|
|
2
2
|
import { IElement, IElementPosition } from './Element';
|
|
3
3
|
import { IRow } from './Row';
|
|
4
4
|
export interface IDrawOption {
|
|
@@ -38,3 +38,7 @@ export interface IGetValueOption {
|
|
|
38
38
|
export interface IAppendElementListOption {
|
|
39
39
|
isPrepend?: boolean;
|
|
40
40
|
}
|
|
41
|
+
export interface IGetImageOption {
|
|
42
|
+
pixelRatio?: number;
|
|
43
|
+
mode?: EditorMode;
|
|
44
|
+
}
|
|
@@ -17,10 +17,12 @@ export interface IFormatElementContextOption {
|
|
|
17
17
|
}
|
|
18
18
|
export declare function formatElementContext(sourceElementList: IElement[], formatElementList: IElement[], anchorIndex: number, options?: IFormatElementContextOption): void;
|
|
19
19
|
export declare function convertElementToDom(element: IElement, options: DeepRequired<IEditorOption>): HTMLElement;
|
|
20
|
+
export declare function splitListElement(elementList: IElement[]): Map<number, IElement[]>;
|
|
20
21
|
export declare function createDomFromElementList(elementList: IElement[], options: DeepRequired<IEditorOption>): HTMLDivElement;
|
|
21
22
|
export declare function convertTextNodeToElement(textNode: Element | Node): IElement | null;
|
|
22
23
|
interface IGetElementListByHTMLOption {
|
|
23
24
|
innerWidth: number;
|
|
24
25
|
}
|
|
25
26
|
export declare function getElementListByHTML(htmlText: string, options: IGetElementListByHTMLOption): IElement[];
|
|
27
|
+
export declare function getTextFromElementList(elementList: IElement[]): string;
|
|
26
28
|
export {};
|