@hailin-zheng/editor-core 2.1.5 → 2.1.7

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.
@@ -65,5 +65,8 @@ export declare class CommonUtil {
65
65
  static removeChild(ele: HTMLElement): void;
66
66
  static findParent(curr: HTMLElement | null, predicate: (parent: HTMLElement) => boolean): HTMLElement | null;
67
67
  static isIntersect(rect1: Rect, rect2: Rect): boolean;
68
+ static debounce<F extends AnyFunction>(fn: F, wait: number): (...args: Parameters<F>) => void;
69
+ static btoa(str: string): string;
68
70
  }
71
+ declare type AnyFunction = (...args: any[]) => any;
69
72
  export {};
@@ -35,6 +35,7 @@ export declare abstract class DocumentPrintOffscreenBase {
35
35
  startDocIndex: number;
36
36
  }): Promise<void>;
37
37
  getPrintNodes(data: any | DocumentElement, ranges?: Array<number> | null): Promise<Array<string>>;
38
+ Encode64(str: any): string;
38
39
  /**
39
40
  * 读取数据,排版
40
41
  * @param data
@@ -1,6 +1,6 @@
1
1
  import { EditorContext } from "./document-context";
2
2
  import { SelectionState } from "./document-selection";
3
- import { OrientType, PageOptions, ViewOptions } from "./element-define";
3
+ import { OrientType, ViewOptions } from "./element-define";
4
4
  export declare class documentPrint {
5
5
  static print(ss: SelectionState, viewOptions: ViewOptions, docCtx: EditorContext, printRanges?: Array<number> | null): void;
6
6
  /**
@@ -28,7 +28,7 @@ export declare class documentPrint {
28
28
  */
29
29
  static printCurrPage(ss: SelectionState, viewOptions: ViewOptions, docCtx: EditorContext): void;
30
30
  }
31
- export declare function createPrintTemplate({ width, height, orient }: PageOptions): string;
31
+ export declare function createPrintTemplate({ width, height, orient }: PrintPaperOptions): string;
32
32
  declare type PrintPaperOptions = {
33
33
  width: number;
34
34
  height: number;
@@ -14,8 +14,8 @@ export declare class DocumentSvg {
14
14
  getHTMLVNode(docRenders: Array<DocumentRenderObject>): Array<EditorVNodeObject>;
15
15
  /**
16
16
  * 判断当前元素是否在视窗内
17
- * @param rect
18
17
  * @private
18
+ * @param item
19
19
  */
20
20
  private checkInViewBox;
21
21
  getPageSvgVNode(item: DocumentRenderObject): EditorVNodeObject;
@@ -34,6 +34,7 @@ export interface OnChangeEventProps {
34
34
  export declare type ElementHandler<E extends ElementEvent = ElementEvent> = (e: E) => void;
35
35
  interface RegisterTypeHandlerProps<T extends Element> {
36
36
  elementType: any;
37
+ elementTypeCategory?: 'function' | 'constructor';
37
38
  eventName: EventTypes;
38
39
  handler: ElementHandler;
39
40
  useCapture: boolean;
@@ -77,6 +78,7 @@ export declare abstract class Element<P extends object = any> {
77
78
  get props(): P;
78
79
  set props(value: P);
79
80
  private notifyChanged;
81
+ key: string;
80
82
  constructor(type: string);
81
83
  abstract createRenderObject(data: ICreateRenderData): RenderObject | null;
82
84
  abstract serialize(viewOptions: ViewOptions): SerializeProps | null;
@@ -254,6 +256,8 @@ export declare class ViewOptions {
254
256
  trackDelColor: string;
255
257
  showLineRect: boolean;
256
258
  showCharRect: boolean;
259
+ dataEleDecoratorMode: 'none' | 'outline' | 'overlay';
260
+ dataEleDecoratorColor: string;
257
261
  showTabChar: boolean;
258
262
  showSpaceChar: boolean;
259
263
  showLineBreak: boolean;
@@ -256,6 +256,7 @@ export declare class DataEleDateProps extends DataEleBaseTextProps {
256
256
  minValue?: Date;
257
257
  maxValue?: Date;
258
258
  format?: string;
259
+ value: string;
259
260
  clone(dest: DataEleDateProps | null): DataEleDateProps;
260
261
  getSerializeProps(options: ViewOptions): any;
261
262
  updateProps(props: DataEleDateProps): void;
@@ -8,7 +8,7 @@ export declare class DataElementDate extends DataElementInlineGroup<DataEleDateP
8
8
  serialize(viewOptions: ViewOptions): SerializeProps & any;
9
9
  clone(data: boolean): DataElementDate;
10
10
  setValue(val: Date | string | null): void;
11
- isValid(val: any): boolean;
11
+ isValid(val: any, format?: string): boolean;
12
12
  getValue(): string;
13
13
  validate(): string;
14
14
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "author": "hailin-zheng",
5
5
  "private": false,
6
6
  "license": "ISC",
7
- "version": "2.1.5",
7
+ "version": "2.1.7",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "moment": "^2.29.3",