@hufe921/canvas-editor 0.9.23 → 0.9.24

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,4 @@
1
- import { IElement, ImageDisplay, INavigateInfo } from '../..';
1
+ import { IElement, ImageDisplay, INavigateInfo, VerticalAlign } from '../..';
2
2
  import { EditorMode, PageMode, PaperDirection } from '../../dataset/enum/Editor';
3
3
  import { IDrawImagePayload, IPainterOptions } from '../../interface/Draw';
4
4
  import { IEditorResult } from '../../interface/Editor';
@@ -19,6 +19,7 @@ export declare class Command {
19
19
  private static applyPainterStyle;
20
20
  private static format;
21
21
  private static font;
22
+ private static size;
22
23
  private static sizeAdd;
23
24
  private static sizeMinus;
24
25
  private static bold;
@@ -44,6 +45,7 @@ export declare class Command {
44
45
  private static deleteTable;
45
46
  private static mergeTableCell;
46
47
  private static cancelMergeTableCell;
48
+ private static tableTdVerticalAlign;
47
49
  private static image;
48
50
  private static hyperlink;
49
51
  private static deleteHyperlink;
@@ -91,6 +93,7 @@ export declare class Command {
91
93
  executeApplyPainterStyle(): void;
92
94
  executeFormat(): void;
93
95
  executeFont(payload: string): void;
96
+ executeSize(payload: number): void;
94
97
  executeSizeAdd(): void;
95
98
  executeSizeMinus(): void;
96
99
  executeBold(): void;
@@ -116,6 +119,7 @@ export declare class Command {
116
119
  executeDeleteTable(): void;
117
120
  executeMergeTableCell(): void;
118
121
  executeCancelMergeTableCell(): void;
122
+ executeTableTdVerticalAlign(payload: VerticalAlign): void;
119
123
  executeHyperlink(payload: IElement): void;
120
124
  executeDeleteHyperlink(): void;
121
125
  executeCancelHyperlink(): void;
@@ -1,6 +1,7 @@
1
1
  import { ImageDisplay } from '../../dataset/enum/Control';
2
2
  import { EditorMode, PageMode, PaperDirection } from '../../dataset/enum/Editor';
3
3
  import { RowFlex } from '../../dataset/enum/Row';
4
+ import { VerticalAlign } from '../../dataset/enum/VerticalAlign';
4
5
  import { IDrawImagePayload, IPainterOptions } from '../../interface/Draw';
5
6
  import { IEditorResult } from '../../interface/Editor';
6
7
  import { IElement } from '../../interface/Element';
@@ -35,6 +36,7 @@ export declare class CommandAdapt {
35
36
  applyPainterStyle(): void;
36
37
  format(): void;
37
38
  font(payload: string): void;
39
+ size(payload: number): void;
38
40
  sizeAdd(): void;
39
41
  sizeMinus(): void;
40
42
  bold(): void;
@@ -57,6 +59,7 @@ export declare class CommandAdapt {
57
59
  deleteTable(): void;
58
60
  mergeTableCell(): void;
59
61
  cancelMergeTableCell(): void;
62
+ tableTdVerticalAlign(payload: VerticalAlign): void;
60
63
  hyperlink(payload: IElement): void;
61
64
  getHyperlinkRange(): [number, number] | null;
62
65
  deleteHyperlink(): void;
@@ -12,6 +12,7 @@ export declare class RangeManager {
12
12
  getRange(): IRange;
13
13
  clearRange(): void;
14
14
  getSelection(): IElement[] | null;
15
+ getTextLikeSelection(): IElement[] | null;
15
16
  getRangeRow(): RangeRowMap | null;
16
17
  getIsPointInRange(x: number, y: number): boolean;
17
18
  setRange(startIndex: number, endIndex: number, tableId?: string, startTdIndex?: number, endTdIndex?: number, startTrIndex?: number, endTrIndex?: number): void;
@@ -0,0 +1,2 @@
1
+ import { IPageNumber } from '../../interface/PageNumber';
2
+ export declare const defaultPageNumberOption: Readonly<Required<IPageNumber>>;
@@ -0,0 +1,5 @@
1
+ export declare enum VerticalAlign {
2
+ TOP = "top",
3
+ MIDDLE = "middle",
4
+ BOTTOM = "bottom"
5
+ }
@@ -16,6 +16,7 @@ import { KeyMap } from './dataset/enum/KeyMap';
16
16
  import { BlockType } from './dataset/enum/Block';
17
17
  import { IBlock } from './interface/Block';
18
18
  import { ILang } from './interface/i18n/I18n';
19
+ import { VerticalAlign } from './dataset/enum/VerticalAlign';
19
20
  export default class Editor {
20
21
  command: Command;
21
22
  listener: Listener;
@@ -23,5 +24,5 @@ export default class Editor {
23
24
  destroy: Function;
24
25
  constructor(container: HTMLDivElement, data: IEditorData | IElement[], options?: IEditorOption);
25
26
  }
26
- export { Editor, RowFlex, EditorZone, EditorMode, ElementType, ControlType, EditorComponent, EDITOR_COMPONENT, PageMode, ImageDisplay, Command, KeyMap, BlockType, PaperDirection };
27
+ export { Editor, RowFlex, VerticalAlign, EditorZone, EditorMode, ElementType, ControlType, EditorComponent, EDITOR_COMPONENT, PageMode, ImageDisplay, Command, KeyMap, BlockType, PaperDirection };
27
28
  export type { IElement, IEditorData, IEditorOption, IEditorResult, IContextMenuContext, IRegisterContextMenu, IWatermark, INavigateInfo, IBlock, ILang };
@@ -5,6 +5,7 @@ import { IControlOption } from './Control';
5
5
  import { ICursorOption } from './Cursor';
6
6
  import { IHeader } from './Header';
7
7
  import { IMargin } from './Margin';
8
+ import { IPageNumber } from './PageNumber';
8
9
  import { IWatermark } from './Watermark';
9
10
  export interface IEditorData {
10
11
  header?: IElement[];
@@ -16,6 +17,8 @@ export interface IEditorOption {
16
17
  defaultType?: string;
17
18
  defaultFont?: string;
18
19
  defaultSize?: number;
20
+ minSize?: number;
21
+ maxSize?: number;
19
22
  defaultBasicRowMarginHeight?: number;
20
23
  defaultRowMargin?: number;
21
24
  defaultTabWidth?: number;
@@ -23,9 +26,6 @@ export interface IEditorOption {
23
26
  height?: number;
24
27
  scale?: number;
25
28
  pageGap?: number;
26
- pageNumberBottom?: number;
27
- pageNumberSize?: number;
28
- pageNumberFont?: string;
29
29
  underlineColor?: string;
30
30
  strikeoutColor?: string;
31
31
  rangeColor?: string;
@@ -48,6 +48,7 @@ export interface IEditorOption {
48
48
  paperDirection?: PaperDirection;
49
49
  inactiveAlpha?: number;
50
50
  header?: IHeader;
51
+ pageNumber?: IPageNumber;
51
52
  watermark?: IWatermark;
52
53
  control?: IControlOption;
53
54
  checkbox?: ICheckboxOption;
@@ -8,6 +8,7 @@ export interface IRangeStyle {
8
8
  redo: boolean;
9
9
  painter: boolean;
10
10
  font: string;
11
+ size: number;
11
12
  bold: boolean;
12
13
  italic: boolean;
13
14
  underline: boolean;
@@ -0,0 +1,8 @@
1
+ import { RowFlex } from '../dataset/enum/Row';
2
+ export interface IPageNumber {
3
+ bottom?: number;
4
+ size?: number;
5
+ font?: string;
6
+ color?: string;
7
+ rowFlex?: RowFlex;
8
+ }
@@ -1,3 +1,4 @@
1
+ import { VerticalAlign } from '../../dataset/enum/VerticalAlign';
1
2
  import { IElement, IElementPosition } from '../Element';
2
3
  import { IRow } from '../Row';
3
4
  export interface ITd {
@@ -16,4 +17,5 @@ export interface ITd {
16
17
  colIndex?: number;
17
18
  rowList?: IRow[];
18
19
  positionList?: IElementPosition[];
20
+ verticalAlign?: VerticalAlign;
19
21
  }
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.23",
5
+ "version": "0.9.24",
6
6
  "description": "rich text editor by canvas/svg",
7
7
  "publishConfig": {
8
8
  "registry": "https://registry.npmjs.org/",