@hufe921/canvas-editor 0.9.80 → 0.9.81

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.
@@ -88,6 +88,7 @@ export declare class Command {
88
88
  executeSetControlExtension: CommandAdapt['setControlExtension'];
89
89
  executeSetControlProperties: CommandAdapt['setControlProperties'];
90
90
  executeSetControlHighlight: CommandAdapt['setControlHighlight'];
91
+ executeLocationControl: CommandAdapt['locationControl'];
91
92
  executeUpdateOptions: CommandAdapt['updateOptions'];
92
93
  executeInsertTitle: CommandAdapt['insertTitle'];
93
94
  getCatalog: CommandAdapt['getCatalog'];
@@ -141,6 +141,7 @@ export declare class CommandAdapt {
141
141
  setControlHighlight(payload: ISetControlHighlightOption): void;
142
142
  updateOptions(payload: IUpdateOption): void;
143
143
  getControlList(): IElement[];
144
+ locationControl(controlId: string): void;
144
145
  getContainer(): HTMLDivElement;
145
146
  getTitleValue(payload: IGetTitleValueOption): IGetTitleValueResult | null;
146
147
  insertTitle(payload: IElement): void;
@@ -1,6 +1,7 @@
1
1
  import { Draw } from '../draw/Draw';
2
2
  import { Zone } from './Zone';
3
3
  export declare class ZoneTip {
4
+ private draw;
4
5
  private zone;
5
6
  private i18n;
6
7
  private container;
@@ -83,11 +83,8 @@ export interface IEditorOption {
83
83
  }
84
84
  export interface IEditorResult {
85
85
  version: string;
86
- width: number;
87
- height: number;
88
- margins: IMargin;
89
- watermark?: IWatermark;
90
86
  data: IEditorData;
87
+ options: IEditorOption;
91
88
  }
92
89
  export interface IEditorHTML {
93
90
  header: string;
@@ -11,4 +11,5 @@ export interface IPageNumber {
11
11
  disabled?: boolean;
12
12
  startPageNo?: number;
13
13
  fromPageNo?: number;
14
+ maxPageNo?: number | null;
14
15
  }
@@ -1,4 +1,4 @@
1
- import { IElement, ImageDisplay } from '..';
1
+ import { IElement, ImageDisplay, IRange } from '..';
2
2
  import { EditorZone } from '../dataset/enum/Editor';
3
3
  import { IElementPosition } from './Element';
4
4
  import { IRow } from './Row';
@@ -85,3 +85,8 @@ export interface IFloatPosition {
85
85
  tdValueIndex?: number;
86
86
  zone?: EditorZone;
87
87
  }
88
+ export interface ILocationPosition {
89
+ zone: EditorZone;
90
+ range: IRange;
91
+ positionContext: IPositionContext;
92
+ }
@@ -26,6 +26,8 @@ export type RangeContext = {
26
26
  trIndex: number | null;
27
27
  tdIndex: number | null;
28
28
  tableElement: IElement | null;
29
+ selectionText: string | null;
30
+ selectionElementList: IElement[];
29
31
  };
30
32
  export interface IRangeParagraphInfo {
31
33
  elementList: IElement[];
@@ -7,8 +7,14 @@ interface IFormatElementListOption {
7
7
  }
8
8
  export declare function formatElementList(elementList: IElement[], options: IFormatElementListOption): void;
9
9
  export declare function isSameElementExceptValue(source: IElement, target: IElement): boolean;
10
- export declare function pickElementAttr(payload: IElement): IElement;
11
- export declare function zipElementList(payload: IElement[]): IElement[];
10
+ interface IPickElementOption {
11
+ extraPickAttrs?: Array<keyof IElement>;
12
+ }
13
+ export declare function pickElementAttr(payload: IElement, option?: IPickElementOption): IElement;
14
+ interface IZipElementListOption {
15
+ extraPickAttrs?: Array<keyof IElement>;
16
+ }
17
+ export declare function zipElementList(payload: IElement[], options?: IZipElementListOption): IElement[];
12
18
  export declare function convertTextAlignToRowFlex(node: HTMLElement): RowFlex;
13
19
  export declare function convertRowFlexToTextAlign(rowFlex: RowFlex): RowFlex.LEFT | RowFlex.CENTER | RowFlex.RIGHT | RowFlex.JUSTIFY | "justify";
14
20
  export declare function convertRowFlexToJustifyContent(rowFlex: RowFlex): "center" | "flex-start" | "flex-end" | "space-between";
@@ -34,4 +40,5 @@ export declare function getElementListByHTML(htmlText: string, options: IGetElem
34
40
  export declare function getTextFromElementList(elementList: IElement[]): string;
35
41
  export declare function getSlimCloneElementList(elementList: IElement[]): IElement[];
36
42
  export declare function getIsBlockElement(element?: IElement): boolean;
43
+ export declare function replaceHTMLElementTag(oldDom: HTMLElement, tagName: keyof HTMLElementTagNameMap): HTMLElement;
37
44
  export {};
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.80",
5
+ "version": "0.9.81",
6
6
  "description": "rich text editor by canvas/svg",
7
7
  "publishConfig": {
8
8
  "registry": "https://registry.npmjs.org/",