@hufe921/canvas-editor 0.9.33 → 0.9.34
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 +22 -0
- package/README.md +1 -1
- package/dist/canvas-editor.es.js +86 -9
- package/dist/canvas-editor.es.js.map +1 -1
- package/dist/canvas-editor.umd.js +16 -16
- package/dist/canvas-editor.umd.js.map +1 -1
- package/dist/src/editor/core/command/Command.d.ts +5 -0
- package/dist/src/editor/core/command/CommandAdapt.d.ts +3 -0
- package/dist/src/editor/core/cursor/Cursor.d.ts +6 -0
- package/dist/src/editor/core/worker/WorkerManager.d.ts +3 -0
- package/dist/src/editor/core/worker/works/catalog.d.ts +1 -0
- package/dist/src/editor/dataset/enum/Editor.d.ts +2 -1
- package/dist/src/editor/index.d.ts +2 -1
- package/dist/src/editor/interface/Catalog.d.ts +8 -0
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IElement, ImageDisplay, INavigateInfo, ListStyle, ListType, TableBorder, TitleLevel, VerticalAlign } from '../..';
|
|
2
2
|
import { EditorMode, PageMode, PaperDirection } from '../../dataset/enum/Editor';
|
|
3
|
+
import { ICatalog } from '../../interface/Catalog';
|
|
3
4
|
import { IDrawImagePayload, IPainterOptions } from '../../interface/Draw';
|
|
4
5
|
import { IEditorResult } from '../../interface/Editor';
|
|
5
6
|
import { IMargin } from '../../interface/Margin';
|
|
@@ -82,6 +83,8 @@ export declare class Command {
|
|
|
82
83
|
private static insertElementList;
|
|
83
84
|
private static removeControl;
|
|
84
85
|
private static setLocale;
|
|
86
|
+
private static getCatalog;
|
|
87
|
+
private static locationCatalog;
|
|
85
88
|
constructor(adapt: CommandAdapt);
|
|
86
89
|
executeMode(payload: EditorMode): void;
|
|
87
90
|
executeCut(): void;
|
|
@@ -159,4 +162,6 @@ export declare class Command {
|
|
|
159
162
|
executeInsertElementList(payload: IElement[]): void;
|
|
160
163
|
executeRemoveControl(): void;
|
|
161
164
|
executeSetLocale(payload: string): void;
|
|
165
|
+
getCatalog(): Promise<ICatalog | null>;
|
|
166
|
+
executeLocationCatalog(titleId: string): void;
|
|
162
167
|
}
|
|
@@ -5,6 +5,7 @@ import { RowFlex } from '../../dataset/enum/Row';
|
|
|
5
5
|
import { TableBorder } from '../../dataset/enum/table/Table';
|
|
6
6
|
import { TitleLevel } from '../../dataset/enum/Title';
|
|
7
7
|
import { VerticalAlign } from '../../dataset/enum/VerticalAlign';
|
|
8
|
+
import { ICatalog } from '../../interface/Catalog';
|
|
8
9
|
import { IDrawImagePayload, IPainterOptions } from '../../interface/Draw';
|
|
9
10
|
import { IEditorResult } from '../../interface/Editor';
|
|
10
11
|
import { IElement } from '../../interface/Element';
|
|
@@ -100,4 +101,6 @@ export declare class CommandAdapt {
|
|
|
100
101
|
insertElementList(payload: IElement[]): void;
|
|
101
102
|
removeControl(): void;
|
|
102
103
|
setLocale(payload: string): void;
|
|
104
|
+
getCatalog(): Promise<ICatalog | null>;
|
|
105
|
+
locationCatalog(titleId: string): void;
|
|
103
106
|
}
|
|
@@ -6,17 +6,23 @@ export declare type IDrawCursorOption = ICursorOption & {
|
|
|
6
6
|
isBlink?: boolean;
|
|
7
7
|
};
|
|
8
8
|
export declare class Cursor {
|
|
9
|
+
private readonly ANIMATION_CLASS;
|
|
9
10
|
private draw;
|
|
10
11
|
private container;
|
|
11
12
|
private options;
|
|
12
13
|
private position;
|
|
13
14
|
private cursorDom;
|
|
14
15
|
private cursorAgent;
|
|
16
|
+
private blinkTimeout;
|
|
15
17
|
constructor(draw: Draw, canvasEvent: CanvasEvent);
|
|
16
18
|
getCursorDom(): HTMLDivElement;
|
|
17
19
|
getAgentDom(): HTMLTextAreaElement;
|
|
18
20
|
getAgentDomValue(): string;
|
|
19
21
|
clearAgentDomValue(): string;
|
|
22
|
+
private _blinkStart;
|
|
23
|
+
private _blinkStop;
|
|
24
|
+
private _setBlinkTimeout;
|
|
25
|
+
private _clearBlinkTimeout;
|
|
20
26
|
drawCursor(payload?: IDrawCursorOption): void;
|
|
21
27
|
recoveryCursor(): void;
|
|
22
28
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Draw } from '../draw/Draw';
|
|
2
|
+
import { ICatalog } from '../../interface/Catalog';
|
|
2
3
|
export declare class WorkerManager {
|
|
3
4
|
private draw;
|
|
4
5
|
private wordCountWorker;
|
|
6
|
+
private catalogWorker;
|
|
5
7
|
constructor(draw: Draw);
|
|
6
8
|
getWordCount(): Promise<number>;
|
|
9
|
+
getCatalog(): Promise<ICatalog | null>;
|
|
7
10
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -21,6 +21,7 @@ import { TableBorder } from './dataset/enum/table/Table';
|
|
|
21
21
|
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
|
+
import { ICatalog, ICatalogItem } from './interface/Catalog';
|
|
24
25
|
export default class Editor {
|
|
25
26
|
command: Command;
|
|
26
27
|
listener: Listener;
|
|
@@ -29,4 +30,4 @@ export default class Editor {
|
|
|
29
30
|
constructor(container: HTMLDivElement, data: IEditorData | IElement[], options?: IEditorOption);
|
|
30
31
|
}
|
|
31
32
|
export { Editor, RowFlex, VerticalAlign, EditorZone, EditorMode, ElementType, ControlType, EditorComponent, EDITOR_COMPONENT, PageMode, ImageDisplay, Command, KeyMap, BlockType, PaperDirection, TableBorder, MaxHeightRatio, NumberType, TitleLevel, ListType, ListStyle };
|
|
32
|
-
export type { IElement, IEditorData, IEditorOption, IEditorResult, IContextMenuContext, IRegisterContextMenu, IWatermark, INavigateInfo, IBlock, ILang };
|
|
33
|
+
export type { IElement, IEditorData, IEditorOption, IEditorResult, IContextMenuContext, IRegisterContextMenu, IWatermark, INavigateInfo, IBlock, ILang, ICatalog, ICatalogItem };
|