@leafer-in/editor 1.0.0-rc.25 → 1.0.0-rc.27
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 +119 -210
- package/dist/editor.esm.js +113 -206
- package/dist/editor.esm.min.js +1 -1
- package/dist/editor.js +120 -212
- package/dist/editor.min.cjs +1 -1
- package/dist/editor.min.js +1 -1
- package/package.json +5 -5
- package/src/Editor.ts +96 -30
- package/src/display/EditBox.ts +10 -3
- package/src/event/EditorGroupEvent.ts +23 -0
- package/src/event/InnerEditorEvent.ts +23 -0
- package/src/index.ts +4 -1
- package/src/tool/InnerEditor.ts +5 -1
- package/src/tool/LineEditTool.ts +1 -0
- package/types/index.d.ts +35 -10
package/types/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from '@leafer-
|
|
2
|
-
import { IBounds, ILeafList, IUI, IEventListenerId, ILeaf, IPointerEvent, IGroup, IObject, IPointData, IGroupInputData, IEditSize, IBox, IBoundsData, IBoxInputData, IKeyEvent, IRect, IRectInputData, ILeaferCanvas, IRenderOptions, IMatrixData, IDragEvent, IAround } from '@leafer-ui/interface';
|
|
1
|
+
export * from '@leafer-in/resize';
|
|
2
|
+
import { IBounds, ILeafList, IUI, IEventListenerId, ILeaf, IPointerEvent, IGroup, IObject, IPointData, IGroupInputData, IEditSize, IAlign, IBox, IBoundsData, IBoxInputData, IKeyEvent, IRect, IRectInputData, ILeaferCanvas, IRenderOptions, IMatrixData, IDragEvent, IAround } from '@leafer-ui/interface';
|
|
3
3
|
import { Group, Event, Direction9, Box, UI, Answer } from '@leafer-ui/draw';
|
|
4
|
-
import { PointerEvent, DragEvent, MoveEvent, RotateEvent } from '@leafer-ui/core';
|
|
5
|
-
import { IEditSelect, IEditor, IStroker, ISelectArea, IEditorConfig, IEditBox, IEditTool, IInnerEditor, IEditorScaleEvent, IEditorEvent, IEditPoint, IEditPointType, IEditorMoveEvent, IEditorRotateEvent, IEditorSkewEvent, IUI as IUI$1, IDragEvent as IDragEvent$1, IPointData as IPointData$1, IPathCommandData, IFromToData, IAround as IAround$1 } from '@leafer-in/interface';
|
|
4
|
+
import { PointerEvent, DragEvent, MoveEvent, ZoomEvent, RotateEvent } from '@leafer-ui/core';
|
|
5
|
+
import { IEditSelect, IEditor, IStroker, ISelectArea, IEditorConfig, IEditBox, IEditTool, IInnerEditor, IEditorScaleEvent, IEditorEvent, IEditPoint, 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';
|
|
6
6
|
|
|
7
7
|
declare class EditSelect extends Group implements IEditSelect {
|
|
8
8
|
editor: IEditor;
|
|
@@ -74,21 +74,24 @@ declare class Editor extends Group implements IEditor {
|
|
|
74
74
|
updateEditTool(): void;
|
|
75
75
|
getEditSize(_ui: IUI): IEditSize;
|
|
76
76
|
onMove(e: DragEvent): void;
|
|
77
|
-
onScale(e: DragEvent): void;
|
|
77
|
+
onScale(e: DragEvent | ZoomEvent): void;
|
|
78
78
|
onRotate(e: DragEvent | RotateEvent): void;
|
|
79
79
|
onSkew(e: DragEvent): void;
|
|
80
80
|
move(x: number | IPointData, y?: number): void;
|
|
81
81
|
scaleWithDrag(data: IEditorScaleEvent): void;
|
|
82
|
-
scaleOf(origin: IPointData, scaleX: number, scaleY?: number, _resize?: boolean): void;
|
|
83
|
-
rotateOf(origin: IPointData, rotation: number): void;
|
|
84
|
-
skewOf(origin: IPointData, skewX: number, skewY?: number, _resize?: boolean): void;
|
|
82
|
+
scaleOf(origin: IPointData | IAlign, scaleX: number, scaleY?: number, _resize?: boolean): void;
|
|
83
|
+
rotateOf(origin: IPointData | IAlign, rotation: number): void;
|
|
84
|
+
skewOf(origin: IPointData | IAlign, skewX: number, skewY?: number, _resize?: boolean): void;
|
|
85
85
|
group(userGroup?: IGroup | IGroupInputData): IGroup;
|
|
86
86
|
ungroup(): IUI[];
|
|
87
87
|
openGroup(group: IGroup): void;
|
|
88
88
|
closeGroup(group: IGroup): void;
|
|
89
89
|
checkOpenedGroups(): void;
|
|
90
|
-
|
|
90
|
+
checkDeepSelect(): void;
|
|
91
|
+
emitGroupEvent(type: string, group: IGroup): void;
|
|
92
|
+
openInnerEditor(target?: IUI): void;
|
|
91
93
|
closeInnerEditor(): void;
|
|
94
|
+
emitInnerEvent(type: string): void;
|
|
92
95
|
lock(): void;
|
|
93
96
|
unlock(): void;
|
|
94
97
|
toTop(): void;
|
|
@@ -206,6 +209,26 @@ declare class EditorSkewEvent extends EditorEvent implements IEditorSkewEvent {
|
|
|
206
209
|
constructor(type: string, data?: IEditorSkewEvent);
|
|
207
210
|
}
|
|
208
211
|
|
|
212
|
+
declare class EditorGroupEvent extends EditorEvent implements IEditorGroupEvent {
|
|
213
|
+
static GROUP: string;
|
|
214
|
+
static BEFORE_UNGROUP: string;
|
|
215
|
+
static UNGROUP: string;
|
|
216
|
+
static OPEN: string;
|
|
217
|
+
static CLOSE: string;
|
|
218
|
+
readonly editTarget: IGroup;
|
|
219
|
+
constructor(type: string, data?: IEditorGroupEvent);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
declare class InnerEditorEvent extends EditorEvent implements IInnerEditorEvent {
|
|
223
|
+
static BEFORE_OPEN: string;
|
|
224
|
+
static OPEN: string;
|
|
225
|
+
static BEFORE_CLOSE: string;
|
|
226
|
+
static CLOSE: string;
|
|
227
|
+
readonly editTarget: IUI;
|
|
228
|
+
readonly innerEditor: IInnerEditor;
|
|
229
|
+
constructor(type: string, data?: IInnerEditorEvent);
|
|
230
|
+
}
|
|
231
|
+
|
|
209
232
|
declare function registerEditTool(): (target: IObject) => void;
|
|
210
233
|
declare const registerInnerEditor: typeof registerEditTool;
|
|
211
234
|
declare const EditToolCreator: {
|
|
@@ -217,6 +240,8 @@ declare const EditToolCreator: {
|
|
|
217
240
|
declare class InnerEditor implements IInnerEditor {
|
|
218
241
|
static registerInnerEditor(): void;
|
|
219
242
|
get tag(): string;
|
|
243
|
+
editTarget: IUI;
|
|
244
|
+
config: IObject;
|
|
220
245
|
editor: IEditor;
|
|
221
246
|
get editBox(): IEditBox;
|
|
222
247
|
view: IGroup;
|
|
@@ -279,4 +304,4 @@ declare const EditSelectHelper: {
|
|
|
279
304
|
findBounds(leaf: IUI, bounds: IBounds): Answer;
|
|
280
305
|
};
|
|
281
306
|
|
|
282
|
-
export { EditBox, EditDataHelper, EditPoint, EditSelect, EditSelectHelper, EditTool, EditToolCreator, Editor, EditorEvent, EditorHelper, EditorMoveEvent, EditorRotateEvent, EditorScaleEvent, EditorSkewEvent, InnerEditor, LineEditTool, SelectArea, Stroker, registerEditTool, registerInnerEditor };
|
|
307
|
+
export { EditBox, EditDataHelper, EditPoint, EditSelect, EditSelectHelper, EditTool, EditToolCreator, Editor, EditorEvent, EditorGroupEvent, EditorHelper, EditorMoveEvent, EditorRotateEvent, EditorScaleEvent, EditorSkewEvent, InnerEditor, InnerEditorEvent, LineEditTool, SelectArea, Stroker, registerEditTool, registerInnerEditor };
|