@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.
@@ -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 {};
@@ -4,7 +4,8 @@ export declare enum EditorComponent {
4
4
  MAIN = "main",
5
5
  FOOTER = "footer",
6
6
  CONTEXTMENU = "contextmenu",
7
- POPUP = "popup"
7
+ POPUP = "popup",
8
+ CATALOG = "catalog"
8
9
  }
9
10
  export declare enum EditorContext {
10
11
  PAGE = "page",
@@ -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 };
@@ -0,0 +1,8 @@
1
+ import { TitleLevel } from '../dataset/enum/Title';
2
+ export interface ICatalogItem {
3
+ id: string;
4
+ name: string;
5
+ level: TitleLevel;
6
+ subCatalog: ICatalogItem[];
7
+ }
8
+ export declare type ICatalog = ICatalogItem[];
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@hufe921/canvas-editor",
3
3
  "author": "Hufe",
4
4
  "license": "MIT",
5
- "version": "0.9.33",
5
+ "version": "0.9.34",
6
6
  "description": "rich text editor by canvas/svg",
7
7
  "publishConfig": {
8
8
  "registry": "https://registry.npmjs.org/",