@leafer/interface 1.0.0-rc.6 → 1.0.0-rc.7
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 +1 -1
- package/src/app/IApp.ts +3 -3
- package/src/app/ILeafer.ts +21 -10
- package/src/canvas/ILeaferCanvas.ts +1 -1
- package/src/data/IData.ts +4 -5
- package/src/data/ILeafData.ts +3 -2
- package/src/data/IList.ts +9 -6
- package/src/display/ILeaf.ts +113 -78
- package/src/display/module/ILeafBounds.ts +2 -0
- package/src/display/module/ILeafDataProxy.ts +5 -5
- package/src/event/IEventer.ts +6 -1
- package/src/function/IFunction.ts +9 -0
- package/src/index.ts +8 -8
- package/src/interaction/IInteraction.ts +2 -0
- package/src/layout/ILeafLayout.ts +20 -8
- package/src/layouter/ILayouter.ts +3 -0
- package/src/math/IMath.ts +46 -31
- package/src/platform/IPlatform.ts +5 -2
- package/src/plugin/IPlugin.ts +2 -2
- package/src/selector/ISelector.ts +13 -2
- package/types/index.d.ts +228 -152
package/package.json
CHANGED
package/src/app/IApp.ts
CHANGED
package/src/app/ILeafer.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { IHitCanvasManager } from '../canvas/IHitCanvasManager'
|
|
|
11
11
|
import { IEventListenerId } from '../event/IEventer'
|
|
12
12
|
import { IObject } from '../data/IData'
|
|
13
13
|
import { IZoomView } from '../display/IView'
|
|
14
|
-
import {
|
|
14
|
+
import { IAppBase } from './IApp'
|
|
15
15
|
import { ILeaferImage, ILeaferImageConfig } from '../image/ILeaferImage'
|
|
16
16
|
import { IControl } from '../control/IControl'
|
|
17
17
|
import { IFunction } from '../function/IFunction'
|
|
@@ -24,17 +24,13 @@ export interface ILeaferConfig extends IRendererConfig, ILeaferCanvasConfig, IIn
|
|
|
24
24
|
realCanvas?: boolean
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export interface
|
|
28
|
-
|
|
29
|
-
readonly isApp: boolean
|
|
30
|
-
readonly app: ILeafer
|
|
31
|
-
parent?: IApp
|
|
32
|
-
|
|
27
|
+
export interface ILeaferAttrData {
|
|
33
28
|
running: boolean
|
|
34
29
|
created: boolean
|
|
35
30
|
ready: boolean
|
|
36
31
|
viewReady: boolean
|
|
37
32
|
viewCompleted: boolean
|
|
33
|
+
layoutLocked: boolean
|
|
38
34
|
|
|
39
35
|
pixelRatio: number
|
|
40
36
|
|
|
@@ -62,7 +58,14 @@ export interface ILeafer extends IZoomView, IControl {
|
|
|
62
58
|
__eventIds: IEventListenerId[]
|
|
63
59
|
__nextRenderWait: IFunction[]
|
|
64
60
|
|
|
65
|
-
init(userConfig?: ILeaferConfig, parentApp?:
|
|
61
|
+
init(userConfig?: ILeaferConfig, parentApp?: IAppBase): void
|
|
62
|
+
|
|
63
|
+
start(): void
|
|
64
|
+
stop(): void
|
|
65
|
+
|
|
66
|
+
unlockLayout(): void
|
|
67
|
+
lockLayout(): void
|
|
68
|
+
|
|
66
69
|
setZoomLayer(zoomLayer: ILeaf): void
|
|
67
70
|
forceFullRender(): void
|
|
68
71
|
updateCursor(): void
|
|
@@ -73,14 +76,20 @@ export interface ILeafer extends IZoomView, IControl {
|
|
|
73
76
|
waitViewCompleted(item: IFunction): void
|
|
74
77
|
}
|
|
75
78
|
|
|
79
|
+
export interface ILeaferBase extends IZoomView, IControl, ILeaferAttrData {
|
|
80
|
+
readonly isApp: boolean
|
|
81
|
+
readonly app: ILeaferBase
|
|
82
|
+
parent?: IAppBase
|
|
83
|
+
}
|
|
84
|
+
|
|
76
85
|
export interface ILeaferTypeCreator {
|
|
77
86
|
list: ILeaferTypeList
|
|
78
87
|
register(name: string, fn: ILeaferTypeFunction): void
|
|
79
|
-
run(name: string, leafer:
|
|
88
|
+
run(name: string, leafer: ILeaferBase): void
|
|
80
89
|
}
|
|
81
90
|
|
|
82
91
|
export interface ILeaferTypeFunction {
|
|
83
|
-
(leafer:
|
|
92
|
+
(leafer: ILeaferBase): void
|
|
84
93
|
}
|
|
85
94
|
|
|
86
95
|
export interface ILeaferTypeList {
|
|
@@ -98,6 +107,8 @@ export interface ICreator {
|
|
|
98
107
|
selector?(target: ILeaf, options?: ISelectorConfig): ISelector
|
|
99
108
|
|
|
100
109
|
interaction?(target: ILeaf, canvas: IInteractionCanvas, selector: ISelector, options?: IInteractionConfig): IInteraction
|
|
110
|
+
|
|
111
|
+
editor?(options?: IObject): ILeaf
|
|
101
112
|
}
|
|
102
113
|
|
|
103
114
|
export interface IUICreator {
|
|
@@ -183,7 +183,7 @@ export interface ILeaferCanvas extends ICanvasAttr, ICanvasMethod, IPathDrawer {
|
|
|
183
183
|
|
|
184
184
|
// other
|
|
185
185
|
isSameSize(options: ILeaferCanvasConfig): boolean
|
|
186
|
-
getSameCanvas(useSameWorldTransform?: boolean): ILeaferCanvas
|
|
186
|
+
getSameCanvas(useSameWorldTransform?: boolean, useSameSmooth?: boolean): ILeaferCanvas
|
|
187
187
|
getBiggerCanvas(addWidth: number, addHeight: number): ILeaferCanvas
|
|
188
188
|
recycle(): void
|
|
189
189
|
|
package/src/data/IData.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export type
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
5
|
-
export type __Value = __Number | __Boolean | __String | __Object //
|
|
1
|
+
export type INumber = number // number | string will convert to number
|
|
2
|
+
export type IBoolean = boolean // boolean | string will convert to boolean
|
|
3
|
+
export type IString = string // string | other will convert to string
|
|
4
|
+
export type IValue = INumber | IBoolean | IString | IObject //
|
|
6
5
|
export type ITimer = any
|
|
7
6
|
|
|
8
7
|
export type IPathString = string
|
package/src/data/ILeafData.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ILeaf, ILeafComputedData } from '../display/ILeaf'
|
|
2
2
|
import { IObject } from './IData'
|
|
3
3
|
|
|
4
|
-
export interface IDataProcessor
|
|
4
|
+
export interface IDataProcessor {
|
|
5
5
|
__leaf: ILeaf
|
|
6
6
|
__input: IObject
|
|
7
7
|
__middle: IObject
|
|
@@ -10,11 +10,12 @@ export interface IDataProcessor extends IObject {
|
|
|
10
10
|
__checkSingle(): void
|
|
11
11
|
|
|
12
12
|
__get(name: string): any
|
|
13
|
+
__getData(): IObject
|
|
13
14
|
|
|
14
15
|
__setInput(name: string, value: any): void
|
|
15
16
|
__getInput(name: string): any
|
|
16
17
|
__removeInput(name: string): void
|
|
17
|
-
__getInputData(
|
|
18
|
+
__getInputData(): IObject
|
|
18
19
|
|
|
19
20
|
__setMiddle(name: string, value: any): void
|
|
20
21
|
__getMiddle(name: string): any
|
package/src/data/IList.ts
CHANGED
|
@@ -18,13 +18,16 @@ export interface ILeafList {
|
|
|
18
18
|
has(leaf: ILeaf): boolean
|
|
19
19
|
indexAt(index: number): ILeaf
|
|
20
20
|
indexOf(leaf: ILeaf): number
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
|
|
22
|
+
add(leaf: ILeaf): void
|
|
23
|
+
addAt(leaf: ILeaf, index: number): void
|
|
24
|
+
addList(list: ILeaf[]): void
|
|
25
25
|
remove(leaf: ILeaf): void
|
|
26
|
+
|
|
26
27
|
forEach(itemCallback: ILeafListItemCallback): void
|
|
28
|
+
sort(reverse?: boolean): void
|
|
27
29
|
clone(): ILeafList
|
|
30
|
+
update(): void
|
|
28
31
|
reset(): void
|
|
29
32
|
destroy(): void
|
|
30
33
|
}
|
|
@@ -37,8 +40,8 @@ export interface ILeafLevelList {
|
|
|
37
40
|
has(leaf: ILeaf): boolean
|
|
38
41
|
without(leaf: ILeaf): boolean
|
|
39
42
|
sort(reverse?: boolean): void
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
addList(list: ILeaf[]): void
|
|
44
|
+
add(leaf: ILeaf): void
|
|
42
45
|
forEach(itemCallback: ILeafListItemCallback): void
|
|
43
46
|
reset(): void
|
|
44
47
|
destroy(): void
|
package/src/display/ILeaf.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ILeaferBase } from '../app/ILeafer'
|
|
2
2
|
import { IEventer } from '../event/IEventer'
|
|
3
3
|
|
|
4
4
|
import { ILeaferCanvas, IHitCanvas } from '../canvas/ILeaferCanvas'
|
|
5
5
|
import { IRenderOptions } from '../renderer/IRenderer'
|
|
6
6
|
|
|
7
|
-
import { IObject,
|
|
8
|
-
import { IMatrixWithBoundsData, IMatrix, IPointData, IBoundsData, IRadiusPointData,
|
|
7
|
+
import { IObject, INumber, IBoolean, IValue, IString } from '../data/IData'
|
|
8
|
+
import { IMatrixWithBoundsData, IMatrix, IPointData, IBoundsData, IRadiusPointData, ILayoutAttr, IMatrixWithLayoutData, ILayoutBoundsData, IMatrixData } from '../math/IMath'
|
|
9
9
|
import { IFunction } from '../function/IFunction'
|
|
10
10
|
|
|
11
11
|
import { ILeafDataProxy } from './module/ILeafDataProxy'
|
|
12
12
|
import { ILeafMatrix } from './module/ILeafMatrix'
|
|
13
13
|
import { ILeafBounds } from './module/ILeafBounds'
|
|
14
|
-
import { ILeafLayout,
|
|
14
|
+
import { ILeafLayout, IBoundsType, ILocationType } from '../layout/ILeafLayout'
|
|
15
15
|
import { ILeafHit } from './module/ILeafHit'
|
|
16
16
|
import { ILeafRender } from './module/ILeafRender'
|
|
17
17
|
import { ILeafMask } from './module/ILeafMask'
|
|
18
|
-
import { ILeafData
|
|
18
|
+
import { ILeafData } from '../data/ILeafData'
|
|
19
19
|
import { IFindMethod } from '../selector/ISelector'
|
|
20
20
|
|
|
21
21
|
|
|
@@ -28,40 +28,44 @@ export interface ICachedLeaf {
|
|
|
28
28
|
|
|
29
29
|
export interface ILeafAttrData {
|
|
30
30
|
// layer data
|
|
31
|
-
id:
|
|
32
|
-
name:
|
|
33
|
-
className:
|
|
31
|
+
id: IString
|
|
32
|
+
name: IString
|
|
33
|
+
className: IString
|
|
34
34
|
|
|
35
35
|
blendMode: IBlendMode
|
|
36
|
-
opacity:
|
|
37
|
-
visible:
|
|
38
|
-
isMask:
|
|
39
|
-
isEraser:
|
|
40
|
-
|
|
36
|
+
opacity: INumber
|
|
37
|
+
visible: IBoolean
|
|
38
|
+
isMask: IBoolean
|
|
39
|
+
isEraser: IBoolean
|
|
40
|
+
locked: IBoolean
|
|
41
|
+
zIndex: INumber
|
|
41
42
|
|
|
42
43
|
// layout data
|
|
43
|
-
x:
|
|
44
|
-
y:
|
|
45
|
-
width:
|
|
46
|
-
height:
|
|
47
|
-
scaleX:
|
|
48
|
-
scaleY:
|
|
49
|
-
rotation:
|
|
50
|
-
skewX:
|
|
51
|
-
skewY:
|
|
52
|
-
|
|
53
|
-
scale:
|
|
54
|
-
around:
|
|
55
|
-
|
|
56
|
-
draggable:
|
|
57
|
-
|
|
58
|
-
|
|
44
|
+
x: INumber
|
|
45
|
+
y: INumber
|
|
46
|
+
width: INumber
|
|
47
|
+
height: INumber
|
|
48
|
+
scaleX: INumber
|
|
49
|
+
scaleY: INumber
|
|
50
|
+
rotation: INumber
|
|
51
|
+
skewX: INumber
|
|
52
|
+
skewY: INumber
|
|
53
|
+
|
|
54
|
+
scale: INumber | IPointData // helper
|
|
55
|
+
around: IAround
|
|
56
|
+
|
|
57
|
+
draggable: IBoolean
|
|
58
|
+
|
|
59
|
+
editable: IBoolean
|
|
60
|
+
editSize?: IEditSize
|
|
61
|
+
|
|
62
|
+
hittable: IBoolean
|
|
59
63
|
hitFill: IHitType
|
|
60
64
|
hitStroke: IHitType
|
|
61
|
-
hitBox:
|
|
62
|
-
hitChildren:
|
|
63
|
-
hitSelf:
|
|
64
|
-
hitRadius:
|
|
65
|
+
hitBox: IBoolean
|
|
66
|
+
hitChildren: IBoolean
|
|
67
|
+
hitSelf: IBoolean
|
|
68
|
+
hitRadius: INumber
|
|
65
69
|
|
|
66
70
|
cursor: ICursorType | ICursorType[]
|
|
67
71
|
}
|
|
@@ -100,14 +104,16 @@ export type IBlendMode =
|
|
|
100
104
|
| 'destination-atop'
|
|
101
105
|
| 'xor'
|
|
102
106
|
|
|
103
|
-
export type
|
|
107
|
+
export type IEditSize = 'size' | 'scale'
|
|
104
108
|
export interface IImageCursor {
|
|
105
109
|
url: string
|
|
106
110
|
x?: number
|
|
107
111
|
y?: number
|
|
108
112
|
}
|
|
109
113
|
|
|
110
|
-
export type IAround =
|
|
114
|
+
export type IAround =
|
|
115
|
+
| 'center'
|
|
116
|
+
| IPointData
|
|
111
117
|
|
|
112
118
|
export type ICursorType =
|
|
113
119
|
| IImageCursor
|
|
@@ -152,48 +158,55 @@ export type ICursorType =
|
|
|
152
158
|
export interface ICursorTypeMap {
|
|
153
159
|
[name: string]: ICursorType | ICursorType[]
|
|
154
160
|
}
|
|
155
|
-
export interface ILeafInputData
|
|
161
|
+
export interface ILeafInputData {
|
|
156
162
|
tag?: string
|
|
157
163
|
|
|
158
164
|
// layer data
|
|
159
|
-
id?:
|
|
160
|
-
name?:
|
|
161
|
-
className?:
|
|
165
|
+
id?: IString
|
|
166
|
+
name?: IString
|
|
167
|
+
className?: IString
|
|
162
168
|
|
|
163
169
|
blendMode?: IBlendMode
|
|
164
|
-
opacity?:
|
|
165
|
-
visible?:
|
|
166
|
-
isMask?:
|
|
167
|
-
isEraser?:
|
|
168
|
-
|
|
170
|
+
opacity?: INumber
|
|
171
|
+
visible?: IBoolean
|
|
172
|
+
isMask?: IBoolean
|
|
173
|
+
isEraser?: IBoolean
|
|
174
|
+
locked?: IBoolean
|
|
175
|
+
zIndex?: INumber
|
|
169
176
|
|
|
170
177
|
// layout data
|
|
171
|
-
x?:
|
|
172
|
-
y?:
|
|
173
|
-
width?:
|
|
174
|
-
height?:
|
|
175
|
-
scaleX?:
|
|
176
|
-
scaleY?:
|
|
177
|
-
rotation?:
|
|
178
|
-
skewX?:
|
|
179
|
-
skewY?:
|
|
180
|
-
|
|
181
|
-
scale?:
|
|
178
|
+
x?: INumber
|
|
179
|
+
y?: INumber
|
|
180
|
+
width?: INumber
|
|
181
|
+
height?: INumber
|
|
182
|
+
scaleX?: INumber
|
|
183
|
+
scaleY?: INumber
|
|
184
|
+
rotation?: INumber
|
|
185
|
+
skewX?: INumber
|
|
186
|
+
skewY?: INumber
|
|
187
|
+
|
|
188
|
+
scale?: INumber | IPointData // helper
|
|
182
189
|
around?: IAround
|
|
183
190
|
|
|
184
|
-
draggable?:
|
|
191
|
+
draggable?: IBoolean
|
|
185
192
|
|
|
186
|
-
|
|
193
|
+
editable?: IBoolean
|
|
194
|
+
editSize?: IEditSize
|
|
195
|
+
|
|
196
|
+
hittable?: IBoolean
|
|
187
197
|
hitFill?: IHitType
|
|
188
198
|
hitStroke?: IHitType
|
|
189
|
-
hitBox?:
|
|
190
|
-
hitChildren?:
|
|
191
|
-
hitSelf?:
|
|
192
|
-
hitRadius?:
|
|
199
|
+
hitBox?: IBoolean
|
|
200
|
+
hitChildren?: IBoolean
|
|
201
|
+
hitSelf?: IBoolean
|
|
202
|
+
hitRadius?: INumber
|
|
193
203
|
|
|
194
204
|
cursor?: ICursorType | ICursorType[]
|
|
195
205
|
|
|
196
206
|
children?: ILeafInputData[]
|
|
207
|
+
|
|
208
|
+
// other
|
|
209
|
+
noBounds?: boolean
|
|
197
210
|
}
|
|
198
211
|
export interface ILeafComputedData {
|
|
199
212
|
// layer data
|
|
@@ -206,6 +219,7 @@ export interface ILeafComputedData {
|
|
|
206
219
|
visible?: boolean
|
|
207
220
|
isMask?: boolean
|
|
208
221
|
isEraser?: boolean
|
|
222
|
+
locked?: boolean
|
|
209
223
|
zIndex?: number
|
|
210
224
|
|
|
211
225
|
// layout data
|
|
@@ -223,6 +237,9 @@ export interface ILeafComputedData {
|
|
|
223
237
|
|
|
224
238
|
draggable?: boolean
|
|
225
239
|
|
|
240
|
+
editable?: boolean
|
|
241
|
+
editSize?: IEditSize
|
|
242
|
+
|
|
226
243
|
hittable?: boolean
|
|
227
244
|
hitFill?: IHitType
|
|
228
245
|
hitStroke?: IHitType
|
|
@@ -248,7 +265,8 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
|
|
|
248
265
|
readonly __DataProcessor: IObject // IDataProcessor
|
|
249
266
|
readonly __LayoutProcessor: IObject // ILeafLayout
|
|
250
267
|
|
|
251
|
-
|
|
268
|
+
readonly app?: ILeaferBase
|
|
269
|
+
leafer?: ILeaferBase
|
|
252
270
|
parent?: ILeaf
|
|
253
271
|
|
|
254
272
|
readonly isApp?: boolean
|
|
@@ -257,12 +275,17 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
|
|
|
257
275
|
isBranchLeaf?: boolean
|
|
258
276
|
|
|
259
277
|
__: ILeafData
|
|
278
|
+
|
|
260
279
|
proxyData?: ILeafInputData
|
|
280
|
+
__proxyData?: ILeafInputData
|
|
261
281
|
|
|
262
282
|
__layout: ILeafLayout
|
|
263
283
|
|
|
264
284
|
__world: IMatrixWithLayoutData
|
|
265
|
-
__local
|
|
285
|
+
__local?: IMatrixWithBoundsData
|
|
286
|
+
|
|
287
|
+
readonly __localMatrix: IMatrixData
|
|
288
|
+
readonly __localBounds: IBoundsData
|
|
266
289
|
|
|
267
290
|
__worldOpacity: number
|
|
268
291
|
|
|
@@ -279,10 +302,9 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
|
|
|
279
302
|
__level: number // 图层级别 root(1) -> hight
|
|
280
303
|
__tempNumber?: number // 用于临时运算储存状态
|
|
281
304
|
|
|
282
|
-
readonly
|
|
283
|
-
|
|
284
|
-
readonly __hasMirror: boolean
|
|
305
|
+
readonly __worldFlipped: boolean
|
|
285
306
|
|
|
307
|
+
__hasAutoLayout?: boolean
|
|
286
308
|
__hasMask?: boolean
|
|
287
309
|
__hasEraser?: boolean
|
|
288
310
|
__hitCanvas?: IHitCanvas
|
|
@@ -302,31 +324,34 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
|
|
|
302
324
|
waitLeafer(item: IFunction): void
|
|
303
325
|
nextRender(item: IFunction): void
|
|
304
326
|
|
|
305
|
-
__bindLeafer(leafer:
|
|
327
|
+
__bindLeafer(leafer: ILeaferBase | null): void
|
|
306
328
|
|
|
307
329
|
set(data: IObject): void
|
|
308
|
-
get(
|
|
330
|
+
get(): ILeafInputData
|
|
309
331
|
toJSON(): IObject
|
|
310
332
|
toString(): string
|
|
311
333
|
|
|
312
334
|
// ILeafData ->
|
|
313
|
-
__setAttr(attrName: string, newValue:
|
|
314
|
-
__getAttr(attrName: string):
|
|
315
|
-
setProxyAttr(name: string, newValue:
|
|
316
|
-
getProxyAttr(name: string):
|
|
335
|
+
__setAttr(attrName: string, newValue: IValue): void
|
|
336
|
+
__getAttr(attrName: string): IValue
|
|
337
|
+
setProxyAttr(name: string, newValue: IValue): void
|
|
338
|
+
getProxyAttr(name: string): IValue
|
|
317
339
|
|
|
318
340
|
// find
|
|
319
|
-
find(condition: number | string | IFindMethod): ILeaf[]
|
|
320
|
-
findOne(condition: number | string | IFindMethod): ILeaf
|
|
341
|
+
find(condition: number | string | IFindMethod, options?: any): ILeaf[]
|
|
342
|
+
findOne(condition: number | string | IFindMethod, options?: any): ILeaf
|
|
321
343
|
|
|
322
344
|
forceUpdate(attrName?: string): void
|
|
323
345
|
|
|
346
|
+
updateLayout(): void
|
|
347
|
+
|
|
324
348
|
// ILeafMatrix ->
|
|
325
349
|
__updateWorldMatrix(): void
|
|
326
350
|
__updateLocalMatrix(): void
|
|
327
351
|
|
|
328
352
|
// ILeafBounds ->
|
|
329
353
|
__updateWorldBounds(): void
|
|
354
|
+
__updateLocalBounds(): void
|
|
330
355
|
|
|
331
356
|
__updateLocalBoxBounds(): void
|
|
332
357
|
__updateLocalStrokeBounds(): void
|
|
@@ -336,6 +361,7 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
|
|
|
336
361
|
__updateStrokeBounds(): void
|
|
337
362
|
__updateRenderBounds(): void
|
|
338
363
|
|
|
364
|
+
__updateAutoLayout(): void
|
|
339
365
|
__updateNaturalSize(): void
|
|
340
366
|
|
|
341
367
|
__updateStrokeSpread(): number
|
|
@@ -350,8 +376,9 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
|
|
|
350
376
|
__removeMask(child?: ILeaf): void
|
|
351
377
|
|
|
352
378
|
// convert
|
|
353
|
-
getWorld(attrName:
|
|
354
|
-
getBounds(type
|
|
379
|
+
getWorld(attrName: ILayoutAttr): number
|
|
380
|
+
getBounds(type?: IBoundsType, relative?: ILocationType | ILeaf): IBoundsData
|
|
381
|
+
getLayoutBounds(type?: IBoundsType, relative?: ILocationType | ILeaf, unscale?: boolean): ILayoutBoundsData
|
|
355
382
|
|
|
356
383
|
worldToLocal(world: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void
|
|
357
384
|
localToWorld(local: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void
|
|
@@ -365,10 +392,17 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
|
|
|
365
392
|
getWorldPoint(inner: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData
|
|
366
393
|
getWorldPointByLocal(local: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData
|
|
367
394
|
|
|
395
|
+
// transform
|
|
396
|
+
setTransform(transform?: IMatrixData, resize?: boolean): void
|
|
397
|
+
transform(transform?: IMatrixData, resize?: boolean): void
|
|
398
|
+
|
|
368
399
|
move(x: number, y?: number): void
|
|
369
|
-
scaleOf(origin: IPointData,
|
|
400
|
+
scaleOf(origin: IPointData, scaleX: number, scaleY?: number, resize?: boolean): void
|
|
370
401
|
rotateOf(origin: IPointData, rotation: number): void
|
|
371
|
-
skewOf(origin: IPointData,
|
|
402
|
+
skewOf(origin: IPointData, skewX: number, skewY?: number, resize?: boolean): void
|
|
403
|
+
|
|
404
|
+
scaleResize(scaleX: number, scaleY: number, noResize?: boolean): void
|
|
405
|
+
__scaleResize(scaleX: number, scaleY: number): void
|
|
372
406
|
|
|
373
407
|
// ILeafHit ->
|
|
374
408
|
__hitWorld(point: IRadiusPointData): boolean
|
|
@@ -398,4 +432,5 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
|
|
|
398
432
|
__updateSortChildren(): void
|
|
399
433
|
add(child: ILeaf, index?: number): void
|
|
400
434
|
remove(child?: ILeaf, destroy?: boolean): void
|
|
435
|
+
dropTo(parent: ILeaf, index?: number, resize?: boolean): void
|
|
401
436
|
}
|
|
@@ -4,6 +4,7 @@ export type ILeafBoundsModule = ILeafBounds & ThisType<ILeaf>
|
|
|
4
4
|
|
|
5
5
|
export interface ILeafBounds {
|
|
6
6
|
__updateWorldBounds?(): void
|
|
7
|
+
__updateLocalBounds?(): void
|
|
7
8
|
|
|
8
9
|
__updateLocalBoxBounds?(): void
|
|
9
10
|
__updateLocalStrokeBounds?(): void
|
|
@@ -13,6 +14,7 @@ export interface ILeafBounds {
|
|
|
13
14
|
__updateStrokeBounds?(): void
|
|
14
15
|
__updateRenderBounds?(): void
|
|
15
16
|
|
|
17
|
+
__updateAutoLayout?(): void
|
|
16
18
|
__updateNaturalSize?(): void
|
|
17
19
|
|
|
18
20
|
__updateStrokeSpread?(): number
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ILeaf } from '../ILeaf'
|
|
2
|
-
import {
|
|
2
|
+
import { IValue } from '../../data/IData'
|
|
3
3
|
|
|
4
4
|
export type ILeafDataProxyModule = ILeafDataProxy & ThisType<ILeaf>
|
|
5
5
|
|
|
6
6
|
export interface ILeafDataProxy {
|
|
7
|
-
__setAttr?(name: string, newValue:
|
|
8
|
-
__getAttr?(name: string):
|
|
9
|
-
setProxyAttr?(name: string, newValue:
|
|
10
|
-
getProxyAttr?(name: string):
|
|
7
|
+
__setAttr?(name: string, newValue: IValue): void
|
|
8
|
+
__getAttr?(name: string): IValue
|
|
9
|
+
setProxyAttr?(name: string, newValue: IValue): void
|
|
10
|
+
getProxyAttr?(name: string): IValue
|
|
11
11
|
}
|
|
12
12
|
|
package/src/event/IEventer.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { IEvent, IFunction, IObject } from '@leafer/interface'
|
|
2
1
|
import { ILeafEventer } from '../display/module/ILeafEventer'
|
|
2
|
+
import { ILeaf } from '../display/ILeaf'
|
|
3
|
+
import { IFunction } from '../function/IFunction'
|
|
4
|
+
import { IEvent } from './IEvent'
|
|
5
|
+
import { IObject } from '../data/IData'
|
|
6
|
+
|
|
3
7
|
|
|
4
8
|
export type IEventListener = IFunction
|
|
5
9
|
|
|
@@ -18,6 +22,7 @@ export interface IEventListenerMap {
|
|
|
18
22
|
|
|
19
23
|
export interface IEventListenerId {
|
|
20
24
|
type: string | string[]
|
|
25
|
+
current: ILeaf
|
|
21
26
|
listener: IEventListener
|
|
22
27
|
options?: IEventListenerOptions | boolean
|
|
23
28
|
}
|
|
@@ -10,4 +10,13 @@ export interface INumberFunction {
|
|
|
10
10
|
|
|
11
11
|
export interface IPointDataFunction {
|
|
12
12
|
(...arg: any): IPointData
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
export interface IAttrDecorator {
|
|
17
|
+
(...arg: any): IAttrDecoratorInner
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface IAttrDecoratorInner {
|
|
21
|
+
(target: any, key: string): any
|
|
13
22
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export { ILeaf, ILeafAttrData, ILeafComputedData, ILeafInputData, ICachedLeaf, IHitType, IBlendMode,
|
|
1
|
+
export { IAppBase } from './app/IApp'
|
|
2
|
+
export { ILeaferBase, ILeaferAttrData, ILeaferType, ILeaferTypeCreator, ILeaferTypeFunction, ILeaferTypeList, ILeaferConfig, ICreator, IUICreator } from './app/ILeafer'
|
|
3
|
+
export { ILeaf, ILeafAttrData, ILeafComputedData, ILeafInputData, ICachedLeaf, IHitType, IBlendMode, IEditSize, ICursorType, ICursorTypeMap, IAround } from './display/ILeaf'
|
|
4
4
|
export { IBranch } from './display/IBranch'
|
|
5
5
|
export { IZoomView } from './display/IView'
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
export { ILeafData, IDataProcessor, ILeafDataOptions } from './data/ILeafData'
|
|
9
|
-
export { ILeafLayout,
|
|
9
|
+
export { ILeafLayout, ILocationType, IBoundsType } from './layout/ILeafLayout'
|
|
10
10
|
|
|
11
11
|
export { ILeafDataProxy, ILeafDataProxyModule } from './display/module/ILeafDataProxy'
|
|
12
12
|
export { ILeafMatrix, ILeafMatrixModule } from './display/module/ILeafMatrix'
|
|
@@ -20,7 +20,7 @@ export { IBranchRender, IBranchRenderModule } from './display/module/IBranchRend
|
|
|
20
20
|
export { IRenderer, IRendererConfig, IRenderOptions } from './renderer/IRenderer'
|
|
21
21
|
export { IWatcher, IWatchEventData, IWatcherConfig } from './watcher/IWatcher'
|
|
22
22
|
export { ILayouter, ILayoutChangedData, ILayoutBlockData, ILayouterConfig, IPartLayoutConfig } from './layouter/ILayouter'
|
|
23
|
-
export { ISelector, ISelectorConfig, IFindMethod, ISelectPathResult, ISelectPathOptions } from './selector/ISelector'
|
|
23
|
+
export { ISelector, ISelectorConfig, ISelectorProxy, IFindMethod, ISelectPathResult, ISelectPathOptions, AnswerType } from './selector/ISelector'
|
|
24
24
|
|
|
25
25
|
export { ICanvasManager } from './canvas/ICanvasManager'
|
|
26
26
|
export { IHitCanvasManager } from './canvas/IHitCanvasManager'
|
|
@@ -49,7 +49,7 @@ export { IUIEvent, IPointerEvent, PointerType, IDragEvent, IDropEvent, ISwipeEve
|
|
|
49
49
|
export { IInteraction, IInteractionCanvas, IInteractionConfig, IWheelConfig, IPointerConfig } from './interaction/IInteraction'
|
|
50
50
|
|
|
51
51
|
|
|
52
|
-
export {
|
|
52
|
+
export { INumber, IBoolean, IString, IValue, IPathString, ITimer, IObject, INumberMap, IStringMap, IBooleanMap, IDataTypeHandle } from './data/IData'
|
|
53
53
|
export { ILeafList, ILeafArrayMap, ILeafMap, ILeafLevelList, ILeafListItemCallback } from './data/IList'
|
|
54
|
-
export { IPoint, IPointData, IRadiusPointData, ISize, ISizeData, IScreenSizeData, IBounds, IBoundsData,
|
|
55
|
-
export { IFunction } from './function/IFunction'
|
|
54
|
+
export { IPoint, IPointData, IRadiusPointData, ISize, ISizeData, IScreenSizeData, IBounds, IBoundsData, IBoundsDataFn, IOffsetBoundsData, ITwoPointBoundsData, IAutoBounds, IAutoBoundsData, IMatrix, IMatrixData, IMatrixWithBoundsData, IMatrixWithScaleData, IMatrixWithLayoutData, IScaleRotationData, IScaleData, ISkewData, ILayoutBoundsData, ILayoutData, ILayoutAttr } from './math/IMath'
|
|
55
|
+
export { IFunction, IAttrDecorator } from './function/IFunction'
|
|
@@ -17,6 +17,7 @@ export interface IInteraction extends IControl {
|
|
|
17
17
|
|
|
18
18
|
running: boolean
|
|
19
19
|
readonly dragging: boolean
|
|
20
|
+
readonly isDragEmpty: boolean
|
|
20
21
|
readonly moveMode: boolean
|
|
21
22
|
|
|
22
23
|
config: IInteractionConfig
|
|
@@ -77,6 +78,7 @@ export interface IZoomConfig {
|
|
|
77
78
|
|
|
78
79
|
export interface IMoveConfig {
|
|
79
80
|
holdSpaceKey?: boolean
|
|
81
|
+
drag?: boolean
|
|
80
82
|
dragEmpty?: boolean
|
|
81
83
|
dragOut?: boolean
|
|
82
84
|
autoDistance?: number
|