@hufe921/canvas-editor 0.9.93 → 0.9.94
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 +24 -0
- package/dist/canvas-editor.es.js +379 -309
- package/dist/canvas-editor.es.js.map +1 -1
- package/dist/canvas-editor.umd.js +27 -27
- 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/particle/table/TableTool.d.ts +2 -0
- package/dist/src/editor/index.d.ts +2 -1
- package/dist/src/editor/interface/Control.d.ts +2 -1
- package/dist/src/editor/interface/Footer.d.ts +1 -0
- package/dist/src/editor/interface/Header.d.ts +1 -0
- package/dist/src/editor/interface/Watermark.d.ts +2 -0
- package/dist/src/editor/utils/element.d.ts +1 -1
- package/package.json +1 -1
|
@@ -101,6 +101,7 @@ export declare class Command {
|
|
|
101
101
|
getHTML: CommandAdapt['getHTML'];
|
|
102
102
|
getText: CommandAdapt['getText'];
|
|
103
103
|
getWordCount: CommandAdapt['getWordCount'];
|
|
104
|
+
getCursorPosition: CommandAdapt['getCursorPosition'];
|
|
104
105
|
getRange: CommandAdapt['getRange'];
|
|
105
106
|
getRangeText: CommandAdapt['getRangeText'];
|
|
106
107
|
getRangeContext: CommandAdapt['getRangeContext'];
|
|
@@ -10,7 +10,7 @@ import { DeepRequired } from '../../interface/Common';
|
|
|
10
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, IFocusOption, ISetValueOption, IUpdateOption } from '../../interface/Editor';
|
|
13
|
-
import { IElement, IUpdateElementByIdOption } from '../../interface/Element';
|
|
13
|
+
import { IElement, IElementPosition, IUpdateElementByIdOption } from '../../interface/Element';
|
|
14
14
|
import { IPasteOption, IPositionContextByEvent } from '../../interface/Event';
|
|
15
15
|
import { IMargin } from '../../interface/Margin';
|
|
16
16
|
import { IRange, RangeContext } from '../../interface/Range';
|
|
@@ -106,6 +106,7 @@ export declare class CommandAdapt {
|
|
|
106
106
|
getHTML(): IEditorHTML;
|
|
107
107
|
getText(): IEditorText;
|
|
108
108
|
getWordCount(): Promise<number>;
|
|
109
|
+
getCursorPosition(): IElementPosition | null;
|
|
109
110
|
getRange(): IRange;
|
|
110
111
|
getRangeText(): string;
|
|
111
112
|
getRangeContext(): RangeContext | null;
|
|
@@ -6,6 +6,7 @@ export declare class TableTool {
|
|
|
6
6
|
private readonly ROW_COL_QUICK_OFFSET;
|
|
7
7
|
private readonly ROW_COL_QUICK_POSITION;
|
|
8
8
|
private readonly BORDER_VALUE;
|
|
9
|
+
private readonly TABLE_SELECT_OFFSET;
|
|
9
10
|
private draw;
|
|
10
11
|
private canvas;
|
|
11
12
|
private options;
|
|
@@ -14,6 +15,7 @@ export declare class TableTool {
|
|
|
14
15
|
private toolRowContainer;
|
|
15
16
|
private toolRowAddBtn;
|
|
16
17
|
private toolColAddBtn;
|
|
18
|
+
private toolTableSelectBtn;
|
|
17
19
|
private toolColContainer;
|
|
18
20
|
private toolBorderContainer;
|
|
19
21
|
private anchorLine;
|
|
@@ -32,6 +32,7 @@ import { LETTER_CLASS } from './dataset/constant/Common';
|
|
|
32
32
|
import { INTERNAL_CONTEXT_MENU_KEY } from './dataset/constant/ContextMenu';
|
|
33
33
|
import { IRange } from './interface/Range';
|
|
34
34
|
import { splitText } from './utils';
|
|
35
|
+
import { createDomFromElementList } from './utils/element';
|
|
35
36
|
import { BackgroundRepeat, BackgroundSize } from './dataset/enum/Background';
|
|
36
37
|
import { TextDecorationStyle } from './dataset/enum/Text';
|
|
37
38
|
import { LineNumberType } from './dataset/enum/LineNumber';
|
|
@@ -45,7 +46,7 @@ export default class Editor {
|
|
|
45
46
|
use: UsePlugin;
|
|
46
47
|
constructor(container: HTMLDivElement, data: IEditorData | IElement[], options?: IEditorOption);
|
|
47
48
|
}
|
|
48
|
-
export { splitText };
|
|
49
|
+
export { splitText, createDomFromElementList };
|
|
49
50
|
export { EDITOR_COMPONENT, LETTER_CLASS, INTERNAL_CONTEXT_MENU_KEY };
|
|
50
51
|
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
52
|
export type { IElement, IEditorData, IEditorOption, IEditorResult, IContextMenuContext, IRegisterContextMenu, IWatermark, INavigateInfo, IBlock, ILang, ICatalog, ICatalogItem, IRange, IRangeStyle };
|
|
@@ -106,11 +106,12 @@ export type IGetControlValueResult = (Omit<IControl, 'value'> & {
|
|
|
106
106
|
value: string | null;
|
|
107
107
|
innerText: string | null;
|
|
108
108
|
zone: EditorZone;
|
|
109
|
+
elementList?: IElement[];
|
|
109
110
|
})[];
|
|
110
111
|
export interface ISetControlValueOption {
|
|
111
112
|
id?: string;
|
|
112
113
|
conceptId?: string;
|
|
113
|
-
value: string;
|
|
114
|
+
value: string | IElement[];
|
|
114
115
|
}
|
|
115
116
|
export interface ISetControlExtensionOption {
|
|
116
117
|
id?: string;
|
|
@@ -33,7 +33,7 @@ export interface IElementListGroupRowFlex {
|
|
|
33
33
|
data: IElement[];
|
|
34
34
|
}
|
|
35
35
|
export declare function groupElementListByRowFlex(elementList: IElement[]): IElementListGroupRowFlex[];
|
|
36
|
-
export declare function createDomFromElementList(elementList: IElement[], options
|
|
36
|
+
export declare function createDomFromElementList(elementList: IElement[], options?: IEditorOption): HTMLDivElement;
|
|
37
37
|
export declare function convertTextNodeToElement(textNode: Element | Node): IElement | null;
|
|
38
38
|
interface IGetElementListByHTMLOption {
|
|
39
39
|
innerWidth: number;
|