@leafer-in/editor 1.7.0 → 1.8.0
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 +164 -111
- package/dist/editor.esm.js +164 -111
- package/dist/editor.esm.min.js +1 -1
- package/dist/editor.esm.min.js.map +1 -1
- package/dist/editor.js +164 -111
- 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 +6 -6
- package/src/Editor.ts +31 -23
- package/src/decorator/data.ts +4 -2
- package/src/display/EditBox.ts +103 -45
- package/src/display/EditSelect.ts +4 -4
- package/src/display/Stroker.ts +4 -3
- package/src/editor/cursor.ts +9 -6
- package/src/editor/target.ts +2 -1
- package/src/helper/EditDataHelper.ts +12 -8
- package/src/index.ts +1 -1
- package/src/tool/TransformTool.ts +12 -24
- package/types/index.d.ts +40 -26
package/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IBounds, ILeafList, IUI, IFunction, IEventListenerId, ILeaf, IPointerEvent, ILeaferCanvas, IRenderOptions, IGroup, IObject, IGroupInputData, IEditSize, IPointData, IAlign, IAxis, IMatrix, IApp, IBox, IEditorDragStartData, IEditorConfig as IEditorConfig$1, ITransformTool, IBoundsData, IBoxInputData, IKeyEvent, IRect, IRectInputData, IMatrixData, IDragEvent, IAround, IEvent, ILayoutBoundsData } from '@leafer-ui/interface';
|
|
2
|
-
import { Group, UI, Direction9,
|
|
2
|
+
import { Group, UI, Direction9, Box, Event } from '@leafer-ui/draw';
|
|
3
3
|
import { PointerEvent, DragEvent, MoveEvent, ZoomEvent, RotateEvent, KeyEvent } from '@leafer-ui/core';
|
|
4
|
-
import { IEditSelect, IEditor, IStroker, ISelectArea, IEditorConfig, IEditPoint, ISimulateElement, IEditBox, IEditTool, IInnerEditor, IEditorScaleEvent,
|
|
4
|
+
import { IEditSelect, IEditor, IStroker, ISelectArea, IEditorConfig, IEditPoint, ISimulateElement, IEditBox, IEditTool, IInnerEditor, IEditorScaleEvent, IEditPointType, IEditPointInputData, IEditorEvent, IEditorMoveEvent, IEditorRotateEvent, IEditorSkewEvent, IEditorGroupEvent, IInnerEditorEvent, IInnerEditorMode, 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,9 +63,13 @@ declare class Editor extends Group implements IEditor {
|
|
|
63
63
|
resizeDirection?: Direction9;
|
|
64
64
|
get multiple(): boolean;
|
|
65
65
|
get single(): boolean;
|
|
66
|
+
get dragPoint(): IEditPoint;
|
|
66
67
|
get dragging(): boolean;
|
|
68
|
+
get gesturing(): boolean;
|
|
67
69
|
get moving(): boolean;
|
|
68
|
-
get
|
|
70
|
+
get resizing(): boolean;
|
|
71
|
+
get rotating(): boolean;
|
|
72
|
+
get skewing(): boolean;
|
|
69
73
|
get element(): ISimulateElement;
|
|
70
74
|
simulateTarget: ISimulateElement;
|
|
71
75
|
editBox: IEditBox;
|
|
@@ -87,6 +91,7 @@ declare class Editor extends Group implements IEditor {
|
|
|
87
91
|
update(): void;
|
|
88
92
|
updateEditBox(): void;
|
|
89
93
|
updateEditTool(): void;
|
|
94
|
+
unloadEditTool(): void;
|
|
90
95
|
getEditSize(_ui: IUI): IEditSize;
|
|
91
96
|
onMove(_e: DragEvent | MoveEvent): void;
|
|
92
97
|
onScale(_e: DragEvent | ZoomEvent): void;
|
|
@@ -108,8 +113,8 @@ declare class Editor extends Group implements IEditor {
|
|
|
108
113
|
checkOpenedGroups(): void;
|
|
109
114
|
checkDeepSelect(): void;
|
|
110
115
|
emitGroupEvent(type: string, group?: IGroup): void;
|
|
111
|
-
openInnerEditor(target?: IUI, select?: boolean): void;
|
|
112
|
-
closeInnerEditor(): void;
|
|
116
|
+
openInnerEditor(target?: IUI, nameOrSelect?: string | boolean, select?: boolean): void;
|
|
117
|
+
closeInnerEditor(onlyInnerEditor?: boolean): void;
|
|
113
118
|
emitInnerEvent(type: string): void;
|
|
114
119
|
lock(): void;
|
|
115
120
|
unlock(): void;
|
|
@@ -122,27 +127,14 @@ declare class Editor extends Group implements IEditor {
|
|
|
122
127
|
destroy(): void;
|
|
123
128
|
}
|
|
124
129
|
|
|
125
|
-
declare class EditorEvent extends Event implements IEditorEvent {
|
|
126
|
-
static BEFORE_SELECT: string;
|
|
127
|
-
static SELECT: string;
|
|
128
|
-
static AFTER_SELECT: string;
|
|
129
|
-
static BEFORE_HOVER: string;
|
|
130
|
-
static HOVER: string;
|
|
131
|
-
readonly target: IUI;
|
|
132
|
-
readonly editor: IEditor;
|
|
133
|
-
readonly value: IUI | IUI[];
|
|
134
|
-
readonly oldValue: IUI | IUI[];
|
|
135
|
-
get list(): IUI[];
|
|
136
|
-
get oldList(): IUI[];
|
|
137
|
-
readonly worldOrigin: IPointData;
|
|
138
|
-
readonly origin: IPointData;
|
|
139
|
-
constructor(type: string, data?: IEditorEvent);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
130
|
declare class EditBox extends Group implements IEditBox {
|
|
143
131
|
editor: IEditor;
|
|
144
132
|
dragging: boolean;
|
|
133
|
+
gesturing: boolean;
|
|
145
134
|
moving: boolean;
|
|
135
|
+
resizing: boolean;
|
|
136
|
+
rotating: boolean;
|
|
137
|
+
skewing: boolean;
|
|
146
138
|
view: IGroup;
|
|
147
139
|
rect: IBox;
|
|
148
140
|
circle: IEditPoint;
|
|
@@ -167,23 +159,28 @@ declare class EditBox extends Group implements IEditBox {
|
|
|
167
159
|
get flippedX(): boolean;
|
|
168
160
|
get flippedY(): boolean;
|
|
169
161
|
get flippedOne(): boolean;
|
|
162
|
+
get canUse(): boolean;
|
|
163
|
+
get canGesture(): boolean;
|
|
170
164
|
protected __eventIds: IEventListenerId[];
|
|
171
165
|
constructor(editor: IEditor);
|
|
172
166
|
create(): void;
|
|
173
167
|
load(): void;
|
|
174
168
|
update(): void;
|
|
169
|
+
unload(): void;
|
|
175
170
|
updateBounds(bounds: IBoundsData): void;
|
|
176
171
|
protected layoutCircle(): void;
|
|
177
172
|
protected layoutButtons(): void;
|
|
178
173
|
protected setButtonPosition(buttons: IUI, direction: number, buttonsMargin: number, useMiddlePoint: boolean): void;
|
|
179
|
-
unload(): void;
|
|
180
174
|
getPointStyle(userStyle?: IBoxInputData): IBoxInputData;
|
|
181
175
|
getPointsStyle(): IBoxInputData[];
|
|
182
176
|
getMiddlePointsStyle(): IBoxInputData[];
|
|
183
|
-
protected onSelect(e: EditorEvent): void;
|
|
184
177
|
protected onDragStart(e: DragEvent): void;
|
|
185
178
|
protected onDragEnd(e: DragEvent): void;
|
|
186
179
|
protected onDrag(e: DragEvent): void;
|
|
180
|
+
protected resetDoing(): void;
|
|
181
|
+
onMove(e: MoveEvent): void;
|
|
182
|
+
onScale(e: ZoomEvent): void;
|
|
183
|
+
onRotate(e: RotateEvent): void;
|
|
187
184
|
protected onKey(e: KeyEvent): void;
|
|
188
185
|
onArrow(e: IKeyEvent): void;
|
|
189
186
|
protected onDoubleTap(e: PointerEvent): void;
|
|
@@ -213,12 +210,29 @@ declare class Stroker extends UI implements IStroker {
|
|
|
213
210
|
target: IUI | IUI[];
|
|
214
211
|
list: IUI[];
|
|
215
212
|
constructor();
|
|
216
|
-
setTarget(target: IUI | IUI[], style
|
|
217
|
-
update(): void;
|
|
213
|
+
setTarget(target: IUI | IUI[], style?: IRectInputData): void;
|
|
214
|
+
update(style?: IRectInputData): void;
|
|
218
215
|
__draw(canvas: ILeaferCanvas, options: IRenderOptions): void;
|
|
219
216
|
destroy(): void;
|
|
220
217
|
}
|
|
221
218
|
|
|
219
|
+
declare class EditorEvent extends Event implements IEditorEvent {
|
|
220
|
+
static BEFORE_SELECT: string;
|
|
221
|
+
static SELECT: string;
|
|
222
|
+
static AFTER_SELECT: string;
|
|
223
|
+
static BEFORE_HOVER: string;
|
|
224
|
+
static HOVER: string;
|
|
225
|
+
readonly target: IUI;
|
|
226
|
+
readonly editor: IEditor;
|
|
227
|
+
readonly value: IUI | IUI[];
|
|
228
|
+
readonly oldValue: IUI | IUI[];
|
|
229
|
+
get list(): IUI[];
|
|
230
|
+
get oldList(): IUI[];
|
|
231
|
+
readonly worldOrigin: IPointData;
|
|
232
|
+
readonly origin: IPointData;
|
|
233
|
+
constructor(type: string, data?: IEditorEvent);
|
|
234
|
+
}
|
|
235
|
+
|
|
222
236
|
declare class EditorMoveEvent extends EditorEvent implements IEditorMoveEvent {
|
|
223
237
|
static BEFORE_MOVE: string;
|
|
224
238
|
static MOVE: string;
|