@hufe921/canvas-editor 0.9.15 → 0.9.16

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.
@@ -10,6 +10,8 @@ export declare class Cursor {
10
10
  constructor(draw: Draw, canvasEvent: CanvasEvent);
11
11
  getCursorDom(): HTMLDivElement;
12
12
  getAgentDom(): HTMLTextAreaElement;
13
+ getAgentDomValue(): string;
14
+ clearAgentDomValue(): string;
13
15
  drawCursor(): void;
14
16
  recoveryCursor(): void;
15
17
  }
@@ -124,6 +124,7 @@ export declare class Draw {
124
124
  setDefaultRange(): void;
125
125
  setPageMode(payload: PageMode): void;
126
126
  setPageScale(payload: number): void;
127
+ setPageDevicePixel(): void;
127
128
  setPaperSize(width: number, height: number): void;
128
129
  setPaperMargin(payload: IMargin): void;
129
130
  getValue(): IEditorResult;
@@ -2,9 +2,16 @@ import { IElement, IElementPosition } from '../../interface/Element';
2
2
  import { ICurrentPosition } from '../../interface/Position';
3
3
  import { Draw } from '../draw/Draw';
4
4
  import { IRange } from '../../interface/Range';
5
+ export interface ICompositionInfo {
6
+ elementList: IElement[];
7
+ startIndex: number;
8
+ endIndex: number;
9
+ value: string;
10
+ }
5
11
  export declare class CanvasEvent {
6
12
  isAllowSelection: boolean;
7
- isCompositing: boolean;
13
+ isComposing: boolean;
14
+ compositionInfo: ICompositionInfo | null;
8
15
  isAllowDrag: boolean;
9
16
  isAllowDrop: boolean;
10
17
  cacheRange: IRange | null;
@@ -35,7 +42,7 @@ export declare class CanvasEvent {
35
42
  cut(): void;
36
43
  copy(): void;
37
44
  compositionstart(): void;
38
- compositionend(): void;
45
+ compositionend(evt: CompositionEvent): void;
39
46
  drop(evt: DragEvent): void;
40
47
  dragover(evt: DragEvent | MouseEvent): void;
41
48
  }
@@ -12,6 +12,7 @@ export declare class GlobalEvent {
12
12
  private hyperlinkParticle;
13
13
  private control;
14
14
  private dateParticle;
15
+ private dprMediaQueryList;
15
16
  constructor(draw: Draw, canvasEvent: CanvasEvent);
16
17
  register(): void;
17
18
  private addEvent;
@@ -21,4 +22,5 @@ export declare class GlobalEvent {
21
22
  setRangeStyle: () => void;
22
23
  setPageScale: (evt: WheelEvent) => void;
23
24
  private _handleVisibilityChange;
25
+ private _handleDprChange;
24
26
  }
@@ -1,6 +1,6 @@
1
1
  import { CanvasEvent } from '../CanvasEvent';
2
2
  declare function compositionstart(host: CanvasEvent): void;
3
- declare function compositionend(host: CanvasEvent): void;
3
+ declare function compositionend(host: CanvasEvent, evt: CompositionEvent): void;
4
4
  declare const _default: {
5
5
  compositionstart: typeof compositionstart;
6
6
  compositionend: typeof compositionend;
@@ -1,2 +1,3 @@
1
1
  import { CanvasEvent } from '../CanvasEvent';
2
2
  export declare function input(data: string, host: CanvasEvent): void;
3
+ export declare function removeComposingInput(host: CanvasEvent): void;
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.15",
5
+ "version": "0.9.16",
6
6
  "description": "rich text editor by canvas/svg",
7
7
  "publishConfig": {
8
8
  "registry": "https://registry.npmjs.org/",