@hufe921/canvas-editor 0.9.81 → 0.9.83

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.
@@ -74,6 +74,7 @@ export declare class Command {
74
74
  executeSetPaperMargin: CommandAdapt['setPaperMargin'];
75
75
  executeInsertElementList: CommandAdapt['insertElementList'];
76
76
  executeAppendElementList: CommandAdapt['appendElementList'];
77
+ executeUpdateElementById: CommandAdapt['updateElementById'];
77
78
  executeSetValue: CommandAdapt['setValue'];
78
79
  executeRemoveControl: CommandAdapt['removeControl'];
79
80
  executeSetLocale: CommandAdapt['setLocale'];
@@ -112,5 +113,6 @@ export declare class Command {
112
113
  getControlList: CommandAdapt['getControlList'];
113
114
  getContainer: CommandAdapt['getContainer'];
114
115
  getTitleValue: CommandAdapt['getTitleValue'];
116
+ getPositionContextByEvent: CommandAdapt['getPositionContextByEvent'];
115
117
  constructor(adapt: CommandAdapt);
116
118
  }
@@ -10,8 +10,8 @@ import { DeepRequired } from '../../interface/Common';
10
10
  import { IGetControlValueOption, IGetControlValueResult, ISetControlExtensionOption, ISetControlHighlightOption, ISetControlProperties, ISetControlValueOption } from '../../interface/Control';
11
11
  import { IAppendElementListOption, IDrawImagePayload, IForceUpdateOption, IGetImageOption, IGetValueOption, IPainterOption } from '../../interface/Draw';
12
12
  import { IEditorData, IEditorHTML, IEditorOption, IEditorResult, IEditorText, IUpdateOption } from '../../interface/Editor';
13
- import { IElement } from '../../interface/Element';
14
- import { IPasteOption } from '../../interface/Event';
13
+ import { IElement, IUpdateElementByIdOption } from '../../interface/Element';
14
+ import { IPasteOption, IPositionContextByEvent } from '../../interface/Event';
15
15
  import { IMargin } from '../../interface/Margin';
16
16
  import { IRange, RangeContext } from '../../interface/Range';
17
17
  import { ITextDecoration } from '../../interface/Text';
@@ -31,6 +31,7 @@ export declare class CommandAdapt {
31
31
  private workerManager;
32
32
  private searchManager;
33
33
  private i18n;
34
+ private zone;
34
35
  constructor(draw: Draw);
35
36
  mode(payload: EditorMode): void;
36
37
  cut(): void;
@@ -121,6 +122,7 @@ export declare class CommandAdapt {
121
122
  setPaperMargin(payload: IMargin): void;
122
123
  insertElementList(payload: IElement[]): void;
123
124
  appendElementList(elementList: IElement[], options?: IAppendElementListOption): void;
125
+ updateElementById(payload: IUpdateElementByIdOption): void;
124
126
  setValue(payload: Partial<IEditorData>): void;
125
127
  removeControl(): void;
126
128
  setLocale(payload: string): void;
@@ -144,5 +146,6 @@ export declare class CommandAdapt {
144
146
  locationControl(controlId: string): void;
145
147
  getContainer(): HTMLDivElement;
146
148
  getTitleValue(payload: IGetTitleValueOption): IGetTitleValueResult | null;
149
+ getPositionContextByEvent(evt: MouseEvent): IPositionContextByEvent | null;
147
150
  insertTitle(payload: IElement): void;
148
151
  }
@@ -25,6 +25,7 @@ export declare class Control {
25
25
  getIsRangeCanCaptureEvent(): boolean;
26
26
  getIsRangeInPostfix(): boolean;
27
27
  getIsRangeWithinControl(): boolean;
28
+ getIsElementListContainFullControl(elementList: IElement[]): boolean;
28
29
  getIsDisabledControl(): boolean;
29
30
  getContainer(): HTMLDivElement;
30
31
  getElementList(): IElement[];
@@ -0,0 +1,10 @@
1
+ import { Draw } from '../draw/Draw';
2
+ export declare class MouseObserver {
3
+ private draw;
4
+ private eventBus;
5
+ private pageContainer;
6
+ constructor(draw: Draw);
7
+ private _mousemove;
8
+ private _mouseenter;
9
+ private _mouseleave;
10
+ }
@@ -1,4 +1,5 @@
1
1
  export declare class Override {
2
2
  paste: ((evt?: ClipboardEvent) => void) | undefined;
3
3
  copy: (() => void) | undefined;
4
+ drop: ((evt: DragEvent) => void) | undefined;
4
5
  }
@@ -23,6 +23,7 @@ export declare class RangeManager {
23
23
  getRangeParagraph(): RangeRowArray | null;
24
24
  getRangeParagraphInfo(): IRangeParagraphInfo | null;
25
25
  getRangeParagraphElementList(): IElement[] | null;
26
+ getRangeTableElement(): IElement | null;
26
27
  getIsSelectAll(): boolean;
27
28
  getIsPointInRange(x: number, y: number): boolean;
28
29
  getKeywordRangeList(payload: string): IRange[];
@@ -137,3 +137,7 @@ export interface IElementFillRect {
137
137
  width: number;
138
138
  height: number;
139
139
  }
140
+ export interface IUpdateElementByIdOption {
141
+ id: string;
142
+ properties: Omit<IElement, 'id'>;
143
+ }
@@ -1,3 +1,10 @@
1
+ import { IElement } from './Element';
2
+ import { RangeRect } from './Range';
1
3
  export interface IPasteOption {
2
4
  isPlainText: boolean;
3
5
  }
6
+ export interface IPositionContextByEvent {
7
+ pageNo: number;
8
+ element: IElement | null;
9
+ rangeRect: RangeRect | null;
10
+ }
@@ -1,4 +1,4 @@
1
- import { IContentChange, IControlChange, IIntersectionPageNoChange, IPageModeChange, IPageScaleChange, IPageSizeChange, IRangeStyleChange, ISaved, IVisiblePageNoListChange, IZoneChange } from './Listener';
1
+ import { IContentChange, IControlChange, IIntersectionPageNoChange, IMouseEventChange, IPageModeChange, IPageScaleChange, IPageSizeChange, IRangeStyleChange, ISaved, IVisiblePageNoListChange, IZoneChange } from './Listener';
2
2
  export interface EventBusMap {
3
3
  rangeStyleChange: IRangeStyleChange;
4
4
  visiblePageNoListChange: IVisiblePageNoListChange;
@@ -10,4 +10,7 @@ export interface EventBusMap {
10
10
  controlChange: IControlChange;
11
11
  pageModeChange: IPageModeChange;
12
12
  zoneChange: IZoneChange;
13
+ mousemove: IMouseEventChange;
14
+ mouseleave: IMouseEventChange;
15
+ mouseenter: IMouseEventChange;
13
16
  }
@@ -36,3 +36,4 @@ export type IContentChange = () => void;
36
36
  export type IControlChange = (payload: IControl | null) => void;
37
37
  export type IPageModeChange = (payload: PageMode) => void;
38
38
  export type IZoneChange = (payload: EditorZone) => void;
39
+ export type IMouseEventChange = (evt: MouseEvent) => void;
@@ -3,6 +3,7 @@ import { TdBorder, TdSlash } from '../../dataset/enum/table/Table';
3
3
  import { IElement, IElementPosition } from '../Element';
4
4
  import { IRow } from '../Row';
5
5
  export interface ITd {
6
+ conceptId?: string;
6
7
  id?: string;
7
8
  x?: number;
8
9
  y?: number;
@@ -1,5 +1,5 @@
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;
1
+ export declare function debounce<T extends unknown[]>(func: (...arg: T) => unknown, delay: number): (this: unknown, ...args: T) => void;
2
+ export declare function throttle<T extends unknown[]>(func: (...arg: T) => unknown, delay: number): (this: unknown, ...args: T) => void;
3
3
  export declare function deepCloneOmitKeys<T, K>(obj: T, omitKeys: (keyof K)[]): T;
4
4
  export declare function deepClone<T>(obj: T): T;
5
5
  export declare function isBody(node: Element): boolean;
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.81",
5
+ "version": "0.9.83",
6
6
  "description": "rich text editor by canvas/svg",
7
7
  "publishConfig": {
8
8
  "registry": "https://registry.npmjs.org/",