@hufe921/canvas-editor 0.9.59 → 0.9.61

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.
@@ -17,6 +17,7 @@ import { HyperlinkParticle } from './particle/HyperlinkParticle';
17
17
  import { Header } from './frame/Header';
18
18
  import { EditorMode, PageMode, PaperDirection } from '../../dataset/enum/Editor';
19
19
  import { Control } from './control/Control';
20
+ import { CheckboxParticle } from './particle/CheckboxParticle';
20
21
  import { DeepRequired, IPadding } from '../../interface/Common';
21
22
  import { WorkerManager } from '../worker/WorkerManager';
22
23
  import { Previewer } from './particle/previewer/Previewer';
@@ -165,6 +166,7 @@ export declare class Draw {
165
166
  getHyperlinkParticle(): HyperlinkParticle;
166
167
  getDateParticle(): DateParticle;
167
168
  getListParticle(): ListParticle;
169
+ getCheckboxParticle(): CheckboxParticle;
168
170
  getControl(): Control;
169
171
  getWorkerManager(): WorkerManager;
170
172
  getImageObserver(): ImageObserver;
@@ -1,7 +1,10 @@
1
+ import { IElement } from '../../../interface/Element';
1
2
  import { IRowElement } from '../../../interface/Row';
2
3
  import { Draw } from '../Draw';
3
4
  export declare class CheckboxParticle {
5
+ private draw;
4
6
  private options;
5
7
  constructor(draw: Draw);
8
+ setSelect(element: IElement): void;
6
9
  render(ctx: CanvasRenderingContext2D, element: IRowElement, x: number, y: number): void;
7
10
  }
@@ -1,12 +1,17 @@
1
+ import { ListStyle, ListType } from '../../../dataset/enum/List';
1
2
  import { IElement, IElementPosition } from '../../../interface/Element';
2
3
  import { IRow } from '../../../interface/Row';
3
4
  import { Draw } from '../Draw';
4
5
  export declare class ListParticle {
6
+ private draw;
7
+ private range;
5
8
  private options;
6
9
  private readonly UN_COUNT_STYLE_WIDTH;
7
10
  private readonly MEASURE_BASE_TEXT;
8
11
  private readonly LIST_GAP;
9
12
  constructor(draw: Draw);
13
+ setList(listType: ListType | null, listStyle?: ListStyle): void;
14
+ unsetList(): void;
10
15
  computeListStyle(ctx: CanvasRenderingContext2D, elementList: IElement[]): Map<string, number>;
11
16
  getListStyleWidth(ctx: CanvasRenderingContext2D, listElementList: IElement[]): number;
12
17
  drawListStyle(ctx: CanvasRenderingContext2D, row: IRow, position: IElementPosition): void;
@@ -0,0 +1,2 @@
1
+ import { CanvasEvent } from '../../CanvasEvent';
2
+ export declare function enter(evt: KeyboardEvent, host: CanvasEvent): void;
@@ -1,2 +1,2 @@
1
- import { CanvasEvent } from '../CanvasEvent';
1
+ import { CanvasEvent } from '../../CanvasEvent';
2
2
  export declare function keydown(evt: KeyboardEvent, host: CanvasEvent): void;
@@ -15,6 +15,7 @@ export declare class Zone {
15
15
  isFooterActive(): boolean;
16
16
  getZone(): EditorZone;
17
17
  setZone(payload: EditorZone): void;
18
+ getZoneByY(y: number): EditorZone;
18
19
  drawZoneIndicator(): void;
19
20
  private _clearZoneIndicator;
20
21
  }
@@ -0,0 +1,16 @@
1
+ import { Draw } from '../draw/Draw';
2
+ import { Zone } from './Zone';
3
+ export declare class ZoneTip {
4
+ private zone;
5
+ private i18n;
6
+ private container;
7
+ private pageContainer;
8
+ private isDisableMouseMove;
9
+ private tipContainer;
10
+ private tipContent;
11
+ private currentMoveZone;
12
+ constructor(draw: Draw, zone: Zone);
13
+ private _watchMouseMoveZoneChange;
14
+ private _drawZoneTip;
15
+ private _updateZoneTip;
16
+ }
@@ -0,0 +1,2 @@
1
+ import { IZoneOption } from '../../interface/Zone';
2
+ export declare const defaultZoneOption: Readonly<Required<IZoneOption>>;
@@ -13,6 +13,7 @@ import { IPageNumber } from './PageNumber';
13
13
  import { IPlaceholder } from './Placeholder';
14
14
  import { ITitleOption } from './Title';
15
15
  import { IWatermark } from './Watermark';
16
+ import { IZoneOption } from './Zone';
16
17
  export interface IEditorData {
17
18
  header?: IElement[];
18
19
  main: IElement[];
@@ -72,6 +73,7 @@ export interface IEditorOption {
72
73
  placeholder?: IPlaceholder;
73
74
  group?: IGroup;
74
75
  pageBreak?: IPageBreak;
76
+ zone?: IZoneOption;
75
77
  }
76
78
  export interface IEditorResult {
77
79
  version: string;
@@ -53,6 +53,7 @@ export interface ITableElement {
53
53
  tdId?: string;
54
54
  trId?: string;
55
55
  tableId?: string;
56
+ conceptId?: string;
56
57
  }
57
58
  export declare type ITable = ITableAttr & ITableElement;
58
59
  export interface IHyperlinkElement {
@@ -22,6 +22,7 @@ export interface ICurrentPosition {
22
22
  export interface IGetPositionByXYPayload {
23
23
  x: number;
24
24
  y: number;
25
+ pageNo?: number;
25
26
  isTable?: boolean;
26
27
  td?: ITd;
27
28
  tablePosition?: IElementPosition;
@@ -21,4 +21,5 @@ export declare type RangeContext = {
21
21
  startPageNo: number;
22
22
  endPageNo: number;
23
23
  rangeRects: RangeRect[];
24
+ zone: EditorZone;
24
25
  };
@@ -0,0 +1,3 @@
1
+ export interface IZoneOption {
2
+ tipDisabled?: boolean;
3
+ }
@@ -1,4 +1,5 @@
1
1
  export declare function debounce(func: Function, delay: number): (this: any, ...args: any[]) => void;
2
+ export declare function throttle(func: Function, delay: number): (this: any, ...args: any[]) => void;
2
3
  export declare function deepClone<T>(obj: T): T;
3
4
  export declare function isBody(node: Element): boolean;
4
5
  export declare function findParent(node: Element, filterFn: Function, includeSelf: boolean): Element | null;
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.59",
5
+ "version": "0.9.61",
6
6
  "description": "rich text editor by canvas/svg",
7
7
  "publishConfig": {
8
8
  "registry": "https://registry.npmjs.org/",