@leafer-in/editor 1.4.2 → 1.5.1
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.
- package/dist/editor.cjs +116 -83
- package/dist/editor.cjs.map +1 -1
- package/dist/editor.esm.js +117 -84
- package/dist/editor.esm.js.map +1 -1
- package/dist/editor.esm.min.js +1 -1
- package/dist/editor.esm.min.js.map +1 -1
- package/dist/editor.js +116 -83
- package/dist/editor.js.map +1 -1
- package/dist/editor.min.cjs +1 -1
- package/dist/editor.min.cjs.map +1 -1
- package/dist/editor.min.js +1 -1
- package/dist/editor.min.js.map +1 -1
- package/package.json +5 -5
- package/src/Editor.ts +49 -26
- package/src/config.ts +1 -0
- package/src/decorator/data.ts +10 -2
- package/src/display/EditBox.ts +28 -27
- package/src/display/EditSelect.ts +3 -3
- package/src/display/Stroker.ts +1 -1
- package/src/editor/cursor.ts +1 -1
- package/src/editor/target.ts +10 -2
- package/src/event/EditorEvent.ts +3 -0
- package/src/event/EditorGroupEvent.ts +6 -0
- package/src/event/EditorMoveEvent.ts +1 -0
- package/src/event/EditorRotateEvent.ts +1 -0
- package/src/event/EditorScaleEvent.ts +1 -0
- package/src/event/EditorSkewEvent.ts +1 -0
- package/src/helper/EditDataHelper.ts +5 -7
- package/src/index.ts +10 -36
- package/types/index.d.ts +16 -6
package/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IBounds, ILeafList, IUI, IFunction, IEventListenerId, ILeaf, IPointerEvent, ILeaferCanvas, IRenderOptions, IGroup, IObject,
|
|
1
|
+
import { IBounds, ILeafList, IUI, IFunction, IEventListenerId, ILeaf, IPointerEvent, ILeaferCanvas, IRenderOptions, IGroup, IObject, IGroupInputData, IEditSize, IPointData, IAlign, IAxis, IMatrix, IBox, IEditorDragStartData, IBoundsData, IEditorConfig as IEditorConfig$1, IBoxInputData, IKeyEvent, IRect, IRectInputData, IMatrixData, IDragEvent, IAround, ILayoutBoundsData } from '@leafer-ui/interface';
|
|
2
2
|
import { Group, UI, Direction9, Event, Box } from '@leafer-ui/draw';
|
|
3
3
|
import { PointerEvent, DragEvent, MoveEvent, ZoomEvent, RotateEvent } from '@leafer-ui/core';
|
|
4
|
-
import { IEditSelect, IEditor, IStroker, ISelectArea, IEditorConfig, ISimulateElement, IEditBox, IEditTool, IInnerEditor, IEditorScaleEvent, IEditorEvent,
|
|
4
|
+
import { IEditSelect, IEditor, IStroker, ISelectArea, IEditorConfig, IEditPoint, ISimulateElement, IEditBox, IEditTool, IInnerEditor, IEditorScaleEvent, IEditorEvent, IEditPointType, IEditorMoveEvent, IEditorRotateEvent, IEditorSkewEvent, IEditorGroupEvent, IInnerEditorEvent, IUI as IUI$1, IDragEvent as IDragEvent$1, IPointData as IPointData$1, IPathCommandData, IFromToData, IAround as IAround$1 } from '@leafer-in/interface';
|
|
5
5
|
|
|
6
6
|
declare class EditSelect extends Group implements IEditSelect {
|
|
7
7
|
editor: IEditor;
|
|
@@ -63,6 +63,7 @@ declare class Editor extends Group implements IEditor {
|
|
|
63
63
|
get single(): boolean;
|
|
64
64
|
get dragging(): boolean;
|
|
65
65
|
get moving(): boolean;
|
|
66
|
+
get dragPoint(): IEditPoint;
|
|
66
67
|
get element(): ISimulateElement;
|
|
67
68
|
simulateTarget: ISimulateElement;
|
|
68
69
|
editBox: IEditBox;
|
|
@@ -72,8 +73,6 @@ declare class Editor extends Group implements IEditor {
|
|
|
72
73
|
editToolList: IObject;
|
|
73
74
|
selector: EditSelect;
|
|
74
75
|
editMask: EditMask;
|
|
75
|
-
dragStartPoint: IPointData;
|
|
76
|
-
dragStartBounds: ILayoutBoundsData;
|
|
77
76
|
targetEventIds: IEventListenerId[];
|
|
78
77
|
constructor(userConfig?: IEditorConfig, data?: IGroupInputData);
|
|
79
78
|
select(target: IUI | IUI[]): void;
|
|
@@ -105,7 +104,7 @@ declare class Editor extends Group implements IEditor {
|
|
|
105
104
|
closeGroup(group: IGroup): void;
|
|
106
105
|
checkOpenedGroups(): void;
|
|
107
106
|
checkDeepSelect(): void;
|
|
108
|
-
emitGroupEvent(type: string, group
|
|
107
|
+
emitGroupEvent(type: string, group?: IGroup): void;
|
|
109
108
|
openInnerEditor(target?: IUI, select?: boolean): void;
|
|
110
109
|
closeInnerEditor(): void;
|
|
111
110
|
emitInnerEvent(type: string): void;
|
|
@@ -119,7 +118,9 @@ declare class Editor extends Group implements IEditor {
|
|
|
119
118
|
}
|
|
120
119
|
|
|
121
120
|
declare class EditorEvent extends Event implements IEditorEvent {
|
|
121
|
+
static BEFORE_SELECT: string;
|
|
122
122
|
static SELECT: string;
|
|
123
|
+
static BEFORE_HOVER: string;
|
|
123
124
|
static HOVER: string;
|
|
124
125
|
readonly target: IUI;
|
|
125
126
|
readonly editor: IEditor;
|
|
@@ -143,11 +144,13 @@ declare class EditBox extends Group implements IEditBox {
|
|
|
143
144
|
resizePoints: IEditPoint[];
|
|
144
145
|
rotatePoints: IEditPoint[];
|
|
145
146
|
resizeLines: IEditPoint[];
|
|
147
|
+
enterPoint: IEditPoint;
|
|
148
|
+
dragPoint: IEditPoint;
|
|
149
|
+
dragStartData: IEditorDragStartData;
|
|
146
150
|
get flipped(): boolean;
|
|
147
151
|
get flippedX(): boolean;
|
|
148
152
|
get flippedY(): boolean;
|
|
149
153
|
get flippedOne(): boolean;
|
|
150
|
-
enterPoint: IEditPoint;
|
|
151
154
|
protected __eventIds: IEventListenerId[];
|
|
152
155
|
constructor(editor: IEditor);
|
|
153
156
|
create(): void;
|
|
@@ -198,6 +201,7 @@ declare class Stroker extends UI implements IStroker {
|
|
|
198
201
|
}
|
|
199
202
|
|
|
200
203
|
declare class EditorMoveEvent extends EditorEvent implements IEditorMoveEvent {
|
|
204
|
+
static BEFORE_MOVE: string;
|
|
201
205
|
static MOVE: string;
|
|
202
206
|
readonly moveX: number;
|
|
203
207
|
readonly moveY: number;
|
|
@@ -205,6 +209,7 @@ declare class EditorMoveEvent extends EditorEvent implements IEditorMoveEvent {
|
|
|
205
209
|
}
|
|
206
210
|
|
|
207
211
|
declare class EditorScaleEvent extends EditorEvent implements IEditorScaleEvent {
|
|
212
|
+
static BEFORE_SCALE: string;
|
|
208
213
|
static SCALE: string;
|
|
209
214
|
readonly scaleX: number;
|
|
210
215
|
readonly scaleY: number;
|
|
@@ -217,12 +222,14 @@ declare class EditorScaleEvent extends EditorEvent implements IEditorScaleEvent
|
|
|
217
222
|
}
|
|
218
223
|
|
|
219
224
|
declare class EditorRotateEvent extends EditorEvent implements IEditorRotateEvent {
|
|
225
|
+
static BEFORE_ROTATE: string;
|
|
220
226
|
static ROTATE: string;
|
|
221
227
|
readonly rotation: number;
|
|
222
228
|
constructor(type: string, data?: IEditorRotateEvent);
|
|
223
229
|
}
|
|
224
230
|
|
|
225
231
|
declare class EditorSkewEvent extends EditorEvent implements IEditorSkewEvent {
|
|
232
|
+
static BEFORE_SKEW: string;
|
|
226
233
|
static SKEW: string;
|
|
227
234
|
readonly skewX: number;
|
|
228
235
|
readonly skewY: number;
|
|
@@ -230,10 +237,13 @@ declare class EditorSkewEvent extends EditorEvent implements IEditorSkewEvent {
|
|
|
230
237
|
}
|
|
231
238
|
|
|
232
239
|
declare class EditorGroupEvent extends EditorEvent implements IEditorGroupEvent {
|
|
240
|
+
static BEFORE_GROUP: string;
|
|
233
241
|
static GROUP: string;
|
|
234
242
|
static BEFORE_UNGROUP: string;
|
|
235
243
|
static UNGROUP: string;
|
|
244
|
+
static BEFORE_OPEN: string;
|
|
236
245
|
static OPEN: string;
|
|
246
|
+
static BEFORE_CLOSE: string;
|
|
237
247
|
static CLOSE: string;
|
|
238
248
|
readonly editTarget: IGroup;
|
|
239
249
|
constructor(type: string, data?: IEditorGroupEvent);
|