@hufe921/canvas-editor 0.9.42 → 0.9.43

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,4 +1,6 @@
1
+ import { MoveDirection } from '../../dataset/enum/Observer';
1
2
  import { ICursorOption } from '../../interface/Cursor';
3
+ import { IElementPosition } from '../../interface/Element';
2
4
  import { Draw } from '../draw/Draw';
3
5
  import { CanvasEvent } from '../event/CanvasEvent';
4
6
  export declare type IDrawCursorOption = ICursorOption & {
@@ -7,6 +9,10 @@ export declare type IDrawCursorOption = ICursorOption & {
7
9
  isFocus?: boolean;
8
10
  hitLineStartIndex?: number;
9
11
  };
12
+ export interface IMoveCursorToVisibleOption {
13
+ direction: MoveDirection;
14
+ cursorPosition: IElementPosition;
15
+ }
10
16
  export declare class Cursor {
11
17
  private readonly ANIMATION_CLASS;
12
18
  private draw;
@@ -28,4 +34,5 @@ export declare class Cursor {
28
34
  private _clearBlinkTimeout;
29
35
  drawCursor(payload?: IDrawCursorOption): void;
30
36
  recoveryCursor(): void;
37
+ moveCursorToVisible(payload: IMoveCursorToVisibleOption): void;
31
38
  }
@@ -17,6 +17,7 @@ export declare class Control {
17
17
  getDraw(): Draw;
18
18
  isPartRangeInControlOutside(): boolean;
19
19
  isRangInPostfix(): boolean;
20
+ isRangeWithinControl(): boolean;
20
21
  getContainer(): HTMLDivElement;
21
22
  getElementList(): IElement[];
22
23
  getPosition(): IElementPosition | null;
@@ -14,7 +14,8 @@ export declare enum EditorContext {
14
14
  export declare enum EditorMode {
15
15
  EDIT = "edit",
16
16
  CLEAN = "clean",
17
- READONLY = "readonly"
17
+ READONLY = "readonly",
18
+ FORM = "form"
18
19
  }
19
20
  export declare enum EditorZone {
20
21
  HEADER = "header",
@@ -52,6 +52,7 @@ export interface IEditorOption {
52
52
  inactiveAlpha?: number;
53
53
  historyMaxRecordCount?: number;
54
54
  printPixelRatio?: number;
55
+ maskMargin?: IMargin;
55
56
  wordBreak?: WordBreak;
56
57
  header?: IHeader;
57
58
  footer?: IFooter;
@@ -14,3 +14,4 @@ export declare function convertNumberToChinese(num: number): string;
14
14
  export declare function cloneProperty<T>(properties: (keyof T)[], sourceElement: T, targetElement: T): void;
15
15
  export declare function omitObject<T>(object: T, keys: (keyof T)[]): T;
16
16
  export declare function convertStringToBase64(input: string): string;
17
+ export declare function findScrollContainer(element: HTMLElement): HTMLElement;
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.42",
5
+ "version": "0.9.43",
6
6
  "description": "rich text editor by canvas/svg",
7
7
  "publishConfig": {
8
8
  "registry": "https://registry.npmjs.org/",