@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.
@@ -130,8 +130,6 @@ export const EditDataHelper = {
130
130
 
131
131
  toPoint(around || align, boxBounds, origin, true)
132
132
 
133
- console.log({ origin, scaleX, scaleY, direction, lockRatio, around })
134
-
135
133
  return { origin, scaleX, scaleY, direction, lockRatio, around }
136
134
  },
137
135
 
@@ -40,7 +40,7 @@ export const EditorHelper = {
40
40
 
41
41
  app.lockLayout()
42
42
  list.forEach(leaf => {
43
- if (leaf.isBranch) {
43
+ if (leaf.isBranch && !leaf.isBranchLeaf) {
44
44
  const { parent, children } = leaf
45
45
  while (children.length) {
46
46
  ungroupList.push(children[0])
@@ -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, Matrix, Event, Box, Answer } from '@leafer-ui/draw';
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 element(): IUI;
66
- simulateTarget: IUI;
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): Matrix;
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;