@leafer-in/editor 1.0.3 → 1.0.5
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 +115 -49
- package/dist/editor.esm.js +116 -50
- package/dist/editor.esm.min.js +1 -1
- package/dist/editor.js +115 -49
- package/dist/editor.min.cjs +1 -1
- package/dist/editor.min.js +1 -1
- package/package.json +8 -8
- package/src/Editor.ts +34 -28
- package/src/display/EditBox.ts +11 -5
- package/src/display/SimulateElement.ts +87 -0
- package/src/display/Stroker.ts +12 -14
- package/src/editor/simulate.ts +6 -6
- package/src/editor/target.ts +1 -0
- package/src/helper/EditDataHelper.ts +0 -2
- package/src/helper/EditorHelper.ts +1 -1
- package/src/tool/EditTool.ts +1 -5
- package/types/index.d.ts +11 -8
package/src/tool/EditTool.ts
CHANGED
|
@@ -81,11 +81,7 @@ export class EditTool extends InnerEditor implements IEditTool {
|
|
|
81
81
|
|
|
82
82
|
public update(): void {
|
|
83
83
|
const { editor, editBox } = this
|
|
84
|
-
|
|
85
|
-
const { simulateTarget, element } = editor
|
|
86
|
-
if (editor.multiple) simulateTarget.parent.updateLayout()
|
|
87
|
-
|
|
88
|
-
const { x, y, scaleX, scaleY, rotation, skewX, skewY, width, height } = element.getLayoutBounds('box', editor, true)
|
|
84
|
+
const { x, y, scaleX, scaleY, rotation, skewX, skewY, width, height } = editor.element.getLayoutBounds('box', editor, true)
|
|
89
85
|
editBox.set({ x, y, scaleX, scaleY, rotation, skewX, skewY })
|
|
90
86
|
editBox.update({ x: 0, y: 0, width, height })
|
|
91
87
|
this.onUpdate()
|
package/types/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * from '@leafer-in/resize';
|
|
2
|
-
import { IBounds, ILeafList, IUI, IFunction, IEventListenerId, ILeaf, IPointerEvent, ILeaferCanvas, IRenderOptions, IObject, IGroup, IPointData, ILayoutBoundsData, IGroupInputData, IEditSize, IAlign, IAxis, IBox, IBoundsData, IEditorConfig as IEditorConfig$1, IBoxInputData, IKeyEvent, IRect, IRectInputData, IMatrixData, IDragEvent, IAround } from '@leafer-ui/interface';
|
|
3
|
-
import { Group, UI, Direction9,
|
|
2
|
+
import { IBounds, ILeafList, IUI, IFunction, IEventListenerId, ILeaf, IPointerEvent, ILeaferCanvas, IRenderOptions, IObject, IGroup, IPointData, ILayoutBoundsData, IGroupInputData, IEditSize, IAlign, IAxis, IMatrix, IBox, IBoundsData, IEditorConfig as IEditorConfig$1, IBoxInputData, IKeyEvent, IRect, IRectInputData, IMatrixData, IDragEvent, IAround } from '@leafer-ui/interface';
|
|
3
|
+
import { Group, UI, Direction9, Event, Box, Answer } from '@leafer-ui/draw';
|
|
4
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';
|
|
5
|
+
import { IEditSelect, IEditor, IStroker, ISelectArea, IEditorConfig, ISimulateElement, 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;
|
|
@@ -52,8 +52,9 @@ declare class Editor extends Group implements IEditor {
|
|
|
52
52
|
get mergeConfig(): IEditorConfig;
|
|
53
53
|
hoverTarget?: IUI;
|
|
54
54
|
target?: IUI | IUI[];
|
|
55
|
-
get list(): IUI[];
|
|
56
55
|
leafList: ILeafList;
|
|
56
|
+
get list(): IUI[];
|
|
57
|
+
get dragHoverExclude(): IUI[];
|
|
57
58
|
openedGroupList: ILeafList;
|
|
58
59
|
get editing(): boolean;
|
|
59
60
|
innerEditing: boolean;
|
|
@@ -62,8 +63,9 @@ declare class Editor extends Group implements IEditor {
|
|
|
62
63
|
get multiple(): boolean;
|
|
63
64
|
get single(): boolean;
|
|
64
65
|
get dragging(): boolean;
|
|
65
|
-
get
|
|
66
|
-
|
|
66
|
+
get moving(): boolean;
|
|
67
|
+
get element(): ISimulateElement;
|
|
68
|
+
simulateTarget: ISimulateElement;
|
|
67
69
|
editBox: IEditBox;
|
|
68
70
|
get buttons(): IGroup;
|
|
69
71
|
editTool?: IEditTool;
|
|
@@ -95,8 +97,9 @@ declare class Editor extends Group implements IEditor {
|
|
|
95
97
|
flip(axis: IAxis): void;
|
|
96
98
|
rotateOf(origin: IPointData | IAlign, rotation: number): void;
|
|
97
99
|
skewOf(origin: IPointData | IAlign, skewX: number, skewY?: number, _resize?: boolean): void;
|
|
100
|
+
checkTransform(type: 'moveable' | 'resizeable' | 'rotateable' | 'skewable'): boolean;
|
|
98
101
|
protected getWorldOrigin(origin: IPointData | IAlign): IPointData;
|
|
99
|
-
protected getChangedTransform(func: IFunction):
|
|
102
|
+
protected getChangedTransform(func: IFunction): IMatrix;
|
|
100
103
|
group(userGroup?: IGroup | IGroupInputData): IGroup;
|
|
101
104
|
ungroup(): IUI[];
|
|
102
105
|
openGroup(group: IGroup): void;
|
|
@@ -104,7 +107,7 @@ declare class Editor extends Group implements IEditor {
|
|
|
104
107
|
checkOpenedGroups(): void;
|
|
105
108
|
checkDeepSelect(): void;
|
|
106
109
|
emitGroupEvent(type: string, group: IGroup): void;
|
|
107
|
-
openInnerEditor(target?: IUI): void;
|
|
110
|
+
openInnerEditor(target?: IUI, select?: boolean): void;
|
|
108
111
|
closeInnerEditor(): void;
|
|
109
112
|
emitInnerEvent(type: string): void;
|
|
110
113
|
lock(): void;
|