@hufe921/canvas-editor 0.9.21 → 0.9.22

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,5 @@
1
1
  import { IElement, ImageDisplay, INavigateInfo } from '../..';
2
- import { EditorMode, PageMode } from '../../dataset/enum/Editor';
2
+ import { EditorMode, PageMode, PaperDirection } from '../../dataset/enum/Editor';
3
3
  import { IDrawImagePayload, IPainterOptions } from '../../interface/Draw';
4
4
  import { IEditorResult } from '../../interface/Editor';
5
5
  import { IMargin } from '../../interface/Margin';
@@ -71,6 +71,7 @@ export declare class Command {
71
71
  private static pageScaleMinus;
72
72
  private static pageScaleAdd;
73
73
  private static paperSize;
74
+ private static paperDirection;
74
75
  private static getPaperMargin;
75
76
  private static setPaperMargin;
76
77
  private static insertElementList;
@@ -142,6 +143,7 @@ export declare class Command {
142
143
  executePageScaleMinus(): void;
143
144
  executePageScaleAdd(): void;
144
145
  executePaperSize(width: number, height: number): void;
146
+ executePaperDirection(payload: PaperDirection): void;
145
147
  getPaperMargin(): number[];
146
148
  executeSetPaperMargin(payload: IMargin): void;
147
149
  executeInsertElementList(payload: IElement[]): void;
@@ -1,5 +1,5 @@
1
1
  import { ImageDisplay } from '../../dataset/enum/Control';
2
- import { EditorMode, PageMode } from '../../dataset/enum/Editor';
2
+ import { EditorMode, PageMode, PaperDirection } from '../../dataset/enum/Editor';
3
3
  import { RowFlex } from '../../dataset/enum/Row';
4
4
  import { IDrawImagePayload, IPainterOptions } from '../../interface/Draw';
5
5
  import { IEditorResult } from '../../interface/Editor';
@@ -85,6 +85,7 @@ export declare class CommandAdapt {
85
85
  pageScaleMinus(): void;
86
86
  pageScaleAdd(): void;
87
87
  paperSize(width: number, height: number): void;
88
+ paperDirection(payload: PaperDirection): void;
88
89
  getPaperMargin(): number[];
89
90
  setPaperMargin(payload: IMargin): void;
90
91
  insertElementList(payload: IElement[]): void;
@@ -12,7 +12,7 @@ import { Search } from './interactive/Search';
12
12
  import { ImageParticle } from './particle/ImageParticle';
13
13
  import { TableTool } from './particle/table/TableTool';
14
14
  import { HyperlinkParticle } from './particle/HyperlinkParticle';
15
- import { EditorMode, PageMode } from '../../dataset/enum/Editor';
15
+ import { EditorMode, PageMode, PaperDirection } from '../../dataset/enum/Editor';
16
16
  import { Control } from './control/Control';
17
17
  import { DeepRequired } from '../../interface/Common';
18
18
  import { WorkerManager } from '../worker/WorkerManager';
@@ -77,6 +77,8 @@ export declare class Draw {
77
77
  getMode(): EditorMode;
78
78
  setMode(payload: EditorMode): void;
79
79
  isReadonly(): boolean;
80
+ getOriginalWidth(): number;
81
+ getOriginalHeight(): number;
80
82
  getWidth(): number;
81
83
  getHeight(): number;
82
84
  getCanvasWidth(pageNo?: number): number;
@@ -134,6 +136,7 @@ export declare class Draw {
134
136
  setPageScale(payload: number): void;
135
137
  setPageDevicePixel(): void;
136
138
  setPaperSize(width: number, height: number): void;
139
+ setPaperDirection(payload: PaperDirection): void;
137
140
  setPaperMargin(payload: IMargin): void;
138
141
  getValue(): IEditorResult;
139
142
  private _wrapContainer;
@@ -1,6 +1,6 @@
1
1
  import { Draw } from '../Draw';
2
2
  export declare class Background {
3
- private options;
3
+ private draw;
4
4
  constructor(draw: Draw);
5
5
  render(ctx: CanvasRenderingContext2D): void;
6
6
  }
@@ -19,3 +19,7 @@ export declare enum PageMode {
19
19
  PAGING = "paging",
20
20
  CONTINUITY = "continuity"
21
21
  }
22
+ export declare enum PaperDirection {
23
+ VERTICAL = "vertical",
24
+ HORIZONTAL = "horizontal"
25
+ }
@@ -7,7 +7,7 @@ import { RowFlex } from './dataset/enum/Row';
7
7
  import { ElementType } from './dataset/enum/Element';
8
8
  import { Register } from './core/register/Register';
9
9
  import { IContextMenuContext, IRegisterContextMenu } from './interface/contextmenu/ContextMenu';
10
- import { EditorComponent, EditorMode, PageMode } from './dataset/enum/Editor';
10
+ import { EditorComponent, EditorMode, PageMode, PaperDirection } from './dataset/enum/Editor';
11
11
  import { EDITOR_COMPONENT } from './dataset/constant/Editor';
12
12
  import { IWatermark } from './interface/Watermark';
13
13
  import { ControlType, ImageDisplay } from './dataset/enum/Control';
@@ -23,5 +23,5 @@ export default class Editor {
23
23
  destroy: Function;
24
24
  constructor(container: HTMLDivElement, elementList: IElement[], options?: IEditorOption);
25
25
  }
26
- export { Editor, RowFlex, EditorMode, ElementType, ControlType, EditorComponent, EDITOR_COMPONENT, PageMode, ImageDisplay, Command, KeyMap, BlockType };
26
+ export { Editor, RowFlex, EditorMode, ElementType, ControlType, EditorComponent, EDITOR_COMPONENT, PageMode, ImageDisplay, Command, KeyMap, BlockType, PaperDirection };
27
27
  export type { IElement, IEditorOption, IEditorResult, IContextMenuContext, IRegisterContextMenu, IWatermark, INavigateInfo, IBlock, ILang };
@@ -1,5 +1,5 @@
1
1
  import { IElement } from '..';
2
- import { EditorMode, PageMode } from '../dataset/enum/Editor';
2
+ import { EditorMode, PageMode, PaperDirection } from '../dataset/enum/Editor';
3
3
  import { ICheckboxOption } from './Checkbox';
4
4
  import { IControlOption } from './Control';
5
5
  import { ICursorOption } from './Cursor';
@@ -40,6 +40,7 @@ export interface IEditorOption {
40
40
  defaultTdHeight?: number;
41
41
  defaultHyperlinkColor?: string;
42
42
  headerTop?: number;
43
+ paperDirection?: PaperDirection;
43
44
  header?: IHeader;
44
45
  watermark?: IWatermark;
45
46
  control?: IControlOption;
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.21",
5
+ "version": "0.9.22",
6
6
  "description": "rich text editor by canvas/svg",
7
7
  "publishConfig": {
8
8
  "registry": "https://registry.npmjs.org/",