@hufe921/canvas-editor 0.9.130 → 0.9.132

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.
@@ -41,6 +41,7 @@ import { TableOperate } from './particle/table/TableOperate';
41
41
  import { Area } from './interactive/Area';
42
42
  import { Badge } from './frame/Badge';
43
43
  import { Graffiti } from './graffiti/Graffiti';
44
+ import { Magnifier } from './interactive/Magnifier';
44
45
  export declare class Draw {
45
46
  private container;
46
47
  private pageContainer;
@@ -65,6 +66,7 @@ export declare class Draw {
65
66
  private margin;
66
67
  private background;
67
68
  private badge;
69
+ private magnifier;
68
70
  private search;
69
71
  private group;
70
72
  private area;
@@ -168,6 +170,7 @@ export declare class Draw {
168
170
  getGroup(): Group;
169
171
  getArea(): Area;
170
172
  getBadge(): Badge;
173
+ getMagnifier(): Magnifier;
171
174
  getHistoryManager(): HistoryManager;
172
175
  getPosition(): Position;
173
176
  getZone(): Zone;
@@ -0,0 +1,19 @@
1
+ import { Draw } from '../Draw';
2
+ export declare class Magnifier {
3
+ private draw;
4
+ private options;
5
+ private canvas;
6
+ private isActive;
7
+ private container;
8
+ constructor(draw: Draw);
9
+ private _createMagnifierCanvas;
10
+ private _addEvent;
11
+ private _removeEvent;
12
+ private _handleKeyDown;
13
+ private _handleKeyUp;
14
+ private _mousemove;
15
+ show(): void;
16
+ hide(): void;
17
+ private _update;
18
+ destroy(): void;
19
+ }
@@ -10,6 +10,7 @@ export declare class GlobalEvent {
10
10
  private tableTool;
11
11
  private hyperlinkParticle;
12
12
  private control;
13
+ private magnifier;
13
14
  private dateParticle;
14
15
  private imageParticle;
15
16
  private dprMediaQueryList;
@@ -10,6 +10,7 @@ export declare class SelectionObserver {
10
10
  private clientWidth;
11
11
  private clientHeight;
12
12
  private containerRect;
13
+ private pageContainer;
13
14
  constructor(draw: Draw);
14
15
  private _addEvent;
15
16
  removeEvent(): void;
@@ -13,4 +13,5 @@ export declare class WorkerManager {
13
13
  getCatalog(): Promise<ICatalog | null>;
14
14
  getGroupIds(): Promise<string[]>;
15
15
  getValue(options?: IGetValueOption): Promise<IEditorResult>;
16
+ destroy(): void;
16
17
  }
@@ -0,0 +1,2 @@
1
+ import { IMagnifierOption } from '../../interface/Magnifier';
2
+ export declare const defaultMagnifierOption: Readonly<Required<IMagnifierOption>>;
@@ -1,6 +1,7 @@
1
1
  export declare enum KeyMap {
2
2
  Delete = "Delete",
3
3
  Backspace = "Backspace",
4
+ ALT = "Alt",
4
5
  Enter = "Enter",
5
6
  Left = "ArrowLeft",
6
7
  Right = "ArrowRight",
@@ -2,3 +2,7 @@ export declare enum WatermarkType {
2
2
  TEXT = "text",
3
3
  IMAGE = "image"
4
4
  }
5
+ export declare enum WatermarkLayer {
6
+ BOTTOM = "bottom",
7
+ TOP = "top"
8
+ }
@@ -38,7 +38,7 @@ import { TextDecorationStyle } from './dataset/enum/Text';
38
38
  import { LineNumberType } from './dataset/enum/LineNumber';
39
39
  import { AreaMode } from './dataset/enum/Area';
40
40
  import { IBadge } from './interface/Badge';
41
- import { WatermarkType } from './dataset/enum/Watermark';
41
+ import { WatermarkType, WatermarkLayer } from './dataset/enum/Watermark';
42
42
  import { INTERNAL_SHORTCUT_KEY } from './dataset/constant/Shortcut';
43
43
  export default class Editor {
44
44
  command: Command;
@@ -53,5 +53,5 @@ export default class Editor {
53
53
  }
54
54
  export { splitText, createDomFromElementList, getElementListByHTML, getTextFromElementList };
55
55
  export { EDITOR_COMPONENT, LETTER_CLASS, INTERNAL_CONTEXT_MENU_KEY, INTERNAL_SHORTCUT_KEY, EDITOR_CLIPBOARD };
56
- 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, ControlComponent, BackgroundRepeat, BackgroundSize, TextDecorationStyle, LineNumberType, LocationPosition, AreaMode, ControlState, FlexDirection, WatermarkType };
56
+ 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, ControlComponent, BackgroundRepeat, BackgroundSize, TextDecorationStyle, LineNumberType, LocationPosition, AreaMode, ControlState, FlexDirection, WatermarkType, WatermarkLayer };
57
57
  export type { IElement, IEditorData, IEditorOption, IEditorResult, IContextMenuContext, IRegisterContextMenu, IWatermark, INavigateInfo, IBlock, ILang, ICatalog, ICatalogItem, IRange, IRangeStyle, IBadge, IGetElementListByHTMLOption };
@@ -27,6 +27,7 @@ import { LocationPosition } from '../dataset/enum/Common';
27
27
  import { IRange } from './Range';
28
28
  import { IGraffitiData, IGraffitiOption } from './Graffiti';
29
29
  import { IWhiteSpaceOption } from './WhiteSpace';
30
+ import { IMagnifierOption } from './Magnifier';
30
31
  export interface IEditorData {
31
32
  header?: IElement[];
32
33
  main: IElement[];
@@ -104,6 +105,7 @@ export interface IEditorOption {
104
105
  label?: ILabelOption;
105
106
  imgCaption?: IImgCaptionOption;
106
107
  list?: IListOption;
108
+ magnifier?: IMagnifierOption;
107
109
  }
108
110
  export interface IEditorResult {
109
111
  version: string;
@@ -129,6 +131,7 @@ export interface IFocusOption {
129
131
  export interface IPrintModeRule {
130
132
  imagePreviewerDisabled?: boolean;
131
133
  backgroundDisabled?: boolean;
134
+ filterEmptyControl?: boolean;
132
135
  }
133
136
  export interface IReadonlyModeRule {
134
137
  imagePreviewerDisabled?: boolean;
@@ -0,0 +1,6 @@
1
+ export interface IMagnifierOption {
2
+ disabled?: boolean;
3
+ size?: number;
4
+ zoom?: number;
5
+ borderColor?: string;
6
+ }
@@ -1,5 +1,5 @@
1
1
  import { NumberType } from '../dataset/enum/Common';
2
- import { WatermarkType } from '../dataset/enum/Watermark';
2
+ import { WatermarkLayer, WatermarkType } from '../dataset/enum/Watermark';
3
3
  export interface IWatermark {
4
4
  data: string;
5
5
  type?: WatermarkType;
@@ -12,4 +12,5 @@ export interface IWatermark {
12
12
  repeat?: boolean;
13
13
  numberType?: NumberType;
14
14
  gap?: [horizontal: number, vertical: number];
15
+ layer?: WatermarkLayer;
15
16
  }
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.130",
5
+ "version": "0.9.132",
6
6
  "description": "rich text editor by canvas/svg",
7
7
  "publishConfig": {
8
8
  "registry": "https://registry.npmjs.org/",