@leafer-in/interface 1.0.0-rc.20 → 1.0.0-rc.22
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/package.json +3 -3
- package/src/editor/IEditBox.ts +2 -25
- package/src/editor/IEditSelect.ts +3 -1
- package/src/editor/IEditor.ts +33 -16
- package/src/index.ts +1 -2
- package/types/index.d.ts +27 -39
- package/src/editor/IEditPoint.ts +0 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-in/interface",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.22",
|
|
4
4
|
"description": "@leafer-in/interface",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"leaferjs"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@leafer-ui/interface": "1.0.0-rc.
|
|
29
|
-
"@leafer/interface": "1.0.0-rc.
|
|
28
|
+
"@leafer-ui/interface": "1.0.0-rc.22",
|
|
29
|
+
"@leafer/interface": "1.0.0-rc.22"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/editor/IEditBox.ts
CHANGED
|
@@ -1,30 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IEditBoxBase } from '@leafer-ui/interface'
|
|
2
2
|
import { IEditor } from './IEditor'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export interface IEditBox extends IGroup {
|
|
3
|
+
export interface IEditBox extends IEditBoxBase {
|
|
6
4
|
|
|
7
5
|
editor: IEditor
|
|
8
|
-
dragging: boolean
|
|
9
|
-
moving: boolean
|
|
10
|
-
|
|
11
|
-
circle: IEditPoint
|
|
12
|
-
rect: IRect
|
|
13
|
-
|
|
14
|
-
buttons: IGroup
|
|
15
|
-
|
|
16
|
-
resizePoints: IEditPoint[]
|
|
17
|
-
rotatePoints: IEditPoint[]
|
|
18
|
-
resizeLines: IEditPoint[]
|
|
19
|
-
|
|
20
|
-
readonly flipped: boolean
|
|
21
|
-
readonly flippedX: boolean
|
|
22
|
-
readonly flippedY: boolean
|
|
23
|
-
readonly flippedOne: boolean
|
|
24
|
-
|
|
25
|
-
enterPoint: IEditPoint
|
|
26
|
-
|
|
27
|
-
update(bounds: IBoundsData): void
|
|
28
|
-
onArrow(e: IKeyEvent): void
|
|
29
6
|
|
|
30
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IGroup, IBounds } from '@leafer-ui/interface'
|
|
1
|
+
import { IGroup, IUI, IBounds, IPointerEvent } from '@leafer-ui/interface'
|
|
2
2
|
|
|
3
3
|
import { IStroker } from './IStroker'
|
|
4
4
|
import { ISelectArea } from './ISelectArea'
|
|
@@ -16,5 +16,7 @@ export interface IEditSelect extends IGroup {
|
|
|
16
16
|
selectArea: ISelectArea
|
|
17
17
|
bounds: IBounds
|
|
18
18
|
|
|
19
|
+
findUI(e: IPointerEvent): IUI
|
|
20
|
+
findDeepOne(e: IPointerEvent): IUI
|
|
19
21
|
update(): void
|
|
20
22
|
}
|
package/src/editor/IEditor.ts
CHANGED
|
@@ -1,42 +1,59 @@
|
|
|
1
|
-
import { IUI, IPointData, IAround, IDragEvent, IEvent, IEventListenerId,
|
|
1
|
+
import { IUI, IPointData, IAround, IDragEvent, IEvent, IEventListenerId, IMatrixData, IEditorBase, IGroup } from '@leafer-ui/interface'
|
|
2
|
+
|
|
2
3
|
import { IEditBox } from './IEditBox'
|
|
3
4
|
import { IEditSelect } from './IEditSelect'
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
export interface IEditor extends IEditorBase {
|
|
7
|
-
leafList: ILeafList
|
|
8
|
-
|
|
9
8
|
simulateTarget: IUI
|
|
10
9
|
|
|
11
10
|
selector: IEditSelect
|
|
12
11
|
editBox: IEditBox
|
|
13
12
|
editTool: IEditTool
|
|
13
|
+
innerEditor: IInnerEditor
|
|
14
14
|
|
|
15
|
+
dragStartPoint: IPointData
|
|
15
16
|
targetEventIds: IEventListenerId[]
|
|
16
17
|
|
|
18
|
+
checkOpenedGroups(): void
|
|
19
|
+
|
|
17
20
|
listenTargetEvents(): void
|
|
18
21
|
removeTargetEvents(): void
|
|
19
22
|
}
|
|
20
23
|
|
|
21
|
-
export interface IEditTool {
|
|
22
|
-
|
|
24
|
+
export interface IEditTool extends IInnerEditor {
|
|
25
|
+
// 操作
|
|
23
26
|
onMove(e: IEditorMoveEvent): void
|
|
24
27
|
onScale(e: IEditorScaleEvent): void
|
|
25
28
|
onScaleWithDrag?(e: IEditorScaleEvent): void
|
|
26
29
|
onRotate(e: IEditorRotateEvent): void
|
|
27
30
|
onSkew(e: IEditorSkewEvent): void
|
|
28
|
-
update(editor: IEditor): void
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
export
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
export interface IInnerEditor {
|
|
34
|
+
tag: string
|
|
35
|
+
|
|
36
|
+
editor: IEditor
|
|
37
|
+
editBox: IEditBox
|
|
38
|
+
view: IGroup
|
|
39
|
+
|
|
40
|
+
eventIds: IEventListenerId[]
|
|
41
|
+
|
|
42
|
+
onCreate(): void
|
|
43
|
+
create(): void
|
|
44
|
+
|
|
45
|
+
// 状态
|
|
46
|
+
onLoad(): void
|
|
47
|
+
load(): void
|
|
48
|
+
|
|
49
|
+
onLoad(): void
|
|
50
|
+
unload(): void
|
|
51
|
+
|
|
52
|
+
onUpdate(): void
|
|
53
|
+
update(): void
|
|
54
|
+
|
|
55
|
+
onDestroy(): void
|
|
56
|
+
destroy(): void
|
|
40
57
|
}
|
|
41
58
|
|
|
42
59
|
export interface IEditorEvent extends IEvent {
|
|
@@ -62,7 +79,7 @@ export interface IEditorScaleEvent extends IEditorEvent {
|
|
|
62
79
|
readonly scaleY?: number
|
|
63
80
|
transform?: IMatrixData
|
|
64
81
|
|
|
65
|
-
readonly direction?:
|
|
82
|
+
readonly direction?: number
|
|
66
83
|
readonly lockRatio?: boolean | 'corner'
|
|
67
84
|
readonly around?: IAround
|
|
68
85
|
|
package/src/index.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
export * from '@leafer-ui/interface'
|
|
2
2
|
|
|
3
3
|
// editor
|
|
4
|
-
export { IEditor, IEditTool,
|
|
4
|
+
export { IEditor, IEditTool, IInnerEditor, IEditorScaleEvent, IEditorRotateEvent, IEditorSkewEvent, IEditorEvent, IEditorMoveEvent } from './editor/IEditor'
|
|
5
5
|
export { IStroker } from './editor/IStroker'
|
|
6
6
|
export { IEditBox } from './editor/IEditBox'
|
|
7
7
|
export { ISelectArea } from './editor/ISelectArea'
|
|
8
8
|
export { IEditSelect } from './editor/IEditSelect'
|
|
9
|
-
export { IEditPoint, IEditPointType } from './editor/IEditPoint'
|
|
10
9
|
|
|
11
10
|
// html
|
|
12
11
|
|
package/types/index.d.ts
CHANGED
|
@@ -1,29 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IEditBoxBase, IUI, IRectInputData, IGroup, IBoundsData, IBounds, IPointerEvent, IEditorBase, IPointData, IEventListenerId, IEvent, IMatrixData, IAround, IDragEvent, IImageData, IImageInputData, IFourNumber, IBoxInputData } from '@leafer-ui/interface';
|
|
2
2
|
export * from '@leafer-ui/interface';
|
|
3
3
|
|
|
4
|
-
interface
|
|
5
|
-
direction: IDirection8;
|
|
6
|
-
pointType: IEditPointType;
|
|
7
|
-
}
|
|
8
|
-
type IEditPointType = 'rotate' | 'resize';
|
|
9
|
-
|
|
10
|
-
interface IEditBox extends IGroup {
|
|
4
|
+
interface IEditBox extends IEditBoxBase {
|
|
11
5
|
editor: IEditor;
|
|
12
|
-
dragging: boolean;
|
|
13
|
-
moving: boolean;
|
|
14
|
-
circle: IEditPoint;
|
|
15
|
-
rect: IRect;
|
|
16
|
-
buttons: IGroup;
|
|
17
|
-
resizePoints: IEditPoint[];
|
|
18
|
-
rotatePoints: IEditPoint[];
|
|
19
|
-
resizeLines: IEditPoint[];
|
|
20
|
-
readonly flipped: boolean;
|
|
21
|
-
readonly flippedX: boolean;
|
|
22
|
-
readonly flippedY: boolean;
|
|
23
|
-
readonly flippedOne: boolean;
|
|
24
|
-
enterPoint: IEditPoint;
|
|
25
|
-
update(bounds: IBoundsData): void;
|
|
26
|
-
onArrow(e: IKeyEvent): void;
|
|
27
6
|
}
|
|
28
7
|
|
|
29
8
|
interface IStroker extends IUI {
|
|
@@ -44,37 +23,46 @@ interface IEditSelect extends IGroup {
|
|
|
44
23
|
targetStroker: IStroker;
|
|
45
24
|
selectArea: ISelectArea;
|
|
46
25
|
bounds: IBounds;
|
|
26
|
+
findUI(e: IPointerEvent): IUI;
|
|
27
|
+
findDeepOne(e: IPointerEvent): IUI;
|
|
47
28
|
update(): void;
|
|
48
29
|
}
|
|
49
30
|
|
|
50
31
|
interface IEditor extends IEditorBase {
|
|
51
|
-
leafList: ILeafList;
|
|
52
32
|
simulateTarget: IUI;
|
|
53
33
|
selector: IEditSelect;
|
|
54
34
|
editBox: IEditBox;
|
|
55
35
|
editTool: IEditTool;
|
|
36
|
+
innerEditor: IInnerEditor;
|
|
37
|
+
dragStartPoint: IPointData;
|
|
56
38
|
targetEventIds: IEventListenerId[];
|
|
39
|
+
checkOpenedGroups(): void;
|
|
57
40
|
listenTargetEvents(): void;
|
|
58
41
|
removeTargetEvents(): void;
|
|
59
42
|
}
|
|
60
|
-
interface IEditTool {
|
|
61
|
-
tag: string;
|
|
43
|
+
interface IEditTool extends IInnerEditor {
|
|
62
44
|
onMove(e: IEditorMoveEvent): void;
|
|
63
45
|
onScale(e: IEditorScaleEvent): void;
|
|
64
46
|
onScaleWithDrag?(e: IEditorScaleEvent): void;
|
|
65
47
|
onRotate(e: IEditorRotateEvent): void;
|
|
66
48
|
onSkew(e: IEditorSkewEvent): void;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
49
|
+
}
|
|
50
|
+
interface IInnerEditor {
|
|
51
|
+
tag: string;
|
|
52
|
+
editor: IEditor;
|
|
53
|
+
editBox: IEditBox;
|
|
54
|
+
view: IGroup;
|
|
55
|
+
eventIds: IEventListenerId[];
|
|
56
|
+
onCreate(): void;
|
|
57
|
+
create(): void;
|
|
58
|
+
onLoad(): void;
|
|
59
|
+
load(): void;
|
|
60
|
+
onLoad(): void;
|
|
61
|
+
unload(): void;
|
|
62
|
+
onUpdate(): void;
|
|
63
|
+
update(): void;
|
|
64
|
+
onDestroy(): void;
|
|
65
|
+
destroy(): void;
|
|
78
66
|
}
|
|
79
67
|
interface IEditorEvent extends IEvent {
|
|
80
68
|
readonly target?: IUI;
|
|
@@ -94,7 +82,7 @@ interface IEditorScaleEvent extends IEditorEvent {
|
|
|
94
82
|
readonly scaleX?: number;
|
|
95
83
|
readonly scaleY?: number;
|
|
96
84
|
transform?: IMatrixData;
|
|
97
|
-
readonly direction?:
|
|
85
|
+
readonly direction?: number;
|
|
98
86
|
readonly lockRatio?: boolean | 'corner';
|
|
99
87
|
readonly around?: IAround;
|
|
100
88
|
drag?: IDragEvent;
|
|
@@ -130,4 +118,4 @@ interface IScrollBar extends IGroup {
|
|
|
130
118
|
update(check: boolean): void;
|
|
131
119
|
}
|
|
132
120
|
|
|
133
|
-
export {
|
|
121
|
+
export type { IEditBox, IEditSelect, IEditTool, IEditor, IEditorEvent, IEditorMoveEvent, IEditorRotateEvent, IEditorScaleEvent, IEditorSkewEvent, IHTMLTextData, IHTMLTextInputData, IInnerEditor, IScrollBar, IScrollBarConfig, IScrollBarTheme, ISelectArea, IStroker };
|
package/src/editor/IEditPoint.ts
DELETED