@leafer-ui/interface 1.6.7 → 1.8.0
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 +2 -2
- package/src/IAnimation.ts +2 -0
- package/src/ICommonAttr.ts +13 -16
- package/src/IUI.ts +10 -5
- package/src/editor/IEditor.ts +60 -17
- package/src/index.ts +3 -3
- package/src/module/IPaint.ts +2 -2
- package/src/type/IComputedType.ts +5 -1
- package/src/type/IType.ts +20 -3
- package/types/index.d.ts +94 -48
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/interface",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "@leafer-ui/interface",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/interface": "1.
|
|
25
|
+
"@leafer/interface": "1.8.0"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/src/IAnimation.ts
CHANGED
|
@@ -56,6 +56,7 @@ export interface IComputedKeyframe {
|
|
|
56
56
|
|
|
57
57
|
export interface IAnimate extends IAnimateOptions, IEventer {
|
|
58
58
|
target: IUI | IObject
|
|
59
|
+
parent?: IAnimateList
|
|
59
60
|
|
|
60
61
|
keyframes: IKeyframe[]
|
|
61
62
|
config?: IAnimateOptions
|
|
@@ -92,4 +93,5 @@ export interface IAnimate extends IAnimateOptions, IEventer {
|
|
|
92
93
|
export interface IAnimateList extends IAnimate {
|
|
93
94
|
list: IAnimate[]
|
|
94
95
|
updateList(animation?: IAnimation[] | IAnimate[], isTemp?: boolean): void
|
|
96
|
+
onChildEvent(type: string, _animate: IAnimate): void
|
|
95
97
|
}
|
package/src/ICommonAttr.ts
CHANGED
|
@@ -36,24 +36,21 @@ export interface IBorderComputedData {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
// stroke---
|
|
39
|
-
export interface IStrokeAttrData {
|
|
39
|
+
export interface IStrokeAttrData extends IStrokeStyle {
|
|
40
40
|
stroke?: IStroke
|
|
41
41
|
|
|
42
|
-
strokeAlign?: IStrokeAlign
|
|
43
|
-
strokeWidth?: IFourNumber | IStrokeWidthString
|
|
44
|
-
strokeWidthFixed?: IBoolean
|
|
45
|
-
strokeCap?: IStrokeCap
|
|
46
|
-
strokeJoin?: IStrokeJoin
|
|
47
|
-
dashPattern?: INumber[] | IDashPatternString
|
|
48
|
-
dashOffset?: INumber
|
|
49
|
-
miterLimit?: INumber
|
|
50
|
-
|
|
51
42
|
startArrow?: IArrowType
|
|
52
43
|
endArrow?: IArrowType
|
|
53
44
|
}
|
|
54
|
-
|
|
45
|
+
|
|
46
|
+
export interface IStrokeInputData extends IStrokeStyle {
|
|
55
47
|
stroke?: IStroke
|
|
56
48
|
|
|
49
|
+
startArrow?: IArrowType
|
|
50
|
+
endArrow?: IArrowType
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface IStrokeStyle {
|
|
57
54
|
strokeAlign?: IStrokeAlign
|
|
58
55
|
strokeWidth?: IFourNumber | IStrokeWidthString
|
|
59
56
|
strokeWidthFixed?: IBoolean
|
|
@@ -62,13 +59,16 @@ export interface IStrokeInputData {
|
|
|
62
59
|
dashPattern?: INumber[] | IDashPatternString
|
|
63
60
|
dashOffset?: INumber
|
|
64
61
|
miterLimit?: INumber
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface IStrokeComputedData extends IStrokeComputedStyle {
|
|
65
|
+
stroke?: IColorString | ILeafStrokePaint[]
|
|
65
66
|
|
|
66
67
|
startArrow?: IArrowType
|
|
67
68
|
endArrow?: IArrowType
|
|
68
69
|
}
|
|
69
|
-
export interface IStrokeComputedData {
|
|
70
|
-
stroke?: IColorString | ILeafStrokePaint[]
|
|
71
70
|
|
|
71
|
+
export interface IStrokeComputedStyle {
|
|
72
72
|
strokeAlign?: IStrokeAlign
|
|
73
73
|
strokeWidth?: number
|
|
74
74
|
strokeWidths?: number[]
|
|
@@ -78,9 +78,6 @@ export interface IStrokeComputedData {
|
|
|
78
78
|
dashPattern?: number[]
|
|
79
79
|
dashOffset?: number
|
|
80
80
|
miterLimit?: number
|
|
81
|
-
|
|
82
|
-
startArrow?: IArrowType
|
|
83
|
-
endArrow?: IArrowType
|
|
84
81
|
}
|
|
85
82
|
|
|
86
83
|
// text---
|
package/src/IUI.ts
CHANGED
|
@@ -6,7 +6,8 @@ import {
|
|
|
6
6
|
ICornerRadiusAttrData, ICornerRadiusInputData, ICornerRadiusComputedData,
|
|
7
7
|
IStrokeAttrData, IStrokeComputedData, IStrokeInputData,
|
|
8
8
|
IEffectAttrData, IEffectInputData, IEffectComputedData,
|
|
9
|
-
ITextStyleAttrData, ITextStyleInputData, ITextStyleComputedData
|
|
9
|
+
ITextStyleAttrData, ITextStyleInputData, ITextStyleComputedData,
|
|
10
|
+
IStrokeComputedStyle
|
|
10
11
|
} from './ICommonAttr'
|
|
11
12
|
import { IOverflow } from './type/IType'
|
|
12
13
|
import { IAnimation, IAnimate, IKeyframe, IKeyframeId, IAnimateType } from './IAnimation'
|
|
@@ -339,6 +340,8 @@ export interface IFrameInputData extends IBoxInputData {
|
|
|
339
340
|
// Box
|
|
340
341
|
export interface IBox extends IBoxAttrData, IGroup {
|
|
341
342
|
__: IBoxData
|
|
343
|
+
scrollBar?: IGroup
|
|
344
|
+
__updateScrollBar(): void
|
|
342
345
|
__updateRectRenderBounds(): void
|
|
343
346
|
__renderGroup(canvas: ILeaferCanvas, options: IRenderOptions): void
|
|
344
347
|
}
|
|
@@ -356,6 +359,7 @@ export interface IBoxInputData extends IBoxAttrData, IGroupInputData { }
|
|
|
356
359
|
export interface IGroup extends IUI {
|
|
357
360
|
__: IGroupData
|
|
358
361
|
children: IUI[]
|
|
362
|
+
childlessJSON?: boolean // 子级 JSON 不导出
|
|
359
363
|
pick(hitPoint: IPointData, options?: IPickOptions): IPickResult
|
|
360
364
|
add(child: IUI | IUI[] | IUIInputData | IUIInputData[], index?: number): void
|
|
361
365
|
addAt(child: IUI | IUI[] | IUIInputData | IUIInputData[], index: number): void
|
|
@@ -477,10 +481,10 @@ export interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
|
|
|
477
481
|
__isFills?: boolean
|
|
478
482
|
__isStrokes?: boolean
|
|
479
483
|
|
|
480
|
-
readonly __strokeWidth: number
|
|
481
|
-
readonly
|
|
482
|
-
|
|
483
|
-
|
|
484
|
+
readonly __strokeWidth: number // 会受 strokeWidthFixed 影响
|
|
485
|
+
readonly __maxStrokeWidth: number
|
|
486
|
+
__hasMultiStrokeStyle?: number // 是否存在多个不同的描述样式(同时存储多个描边样式中的最大宽度用于运算)
|
|
487
|
+
readonly __hasMultiPaint?: boolean
|
|
484
488
|
|
|
485
489
|
__isAlphaPixelFill?: boolean // png / svg / webp
|
|
486
490
|
__isAlphaPixelStroke?: boolean
|
|
@@ -507,6 +511,7 @@ export interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
|
|
|
507
511
|
|
|
508
512
|
__needComputePaint?: boolean
|
|
509
513
|
__computePaint(): void
|
|
514
|
+
__getRealStrokeWidth(childStyle?: IStrokeComputedStyle): number
|
|
510
515
|
|
|
511
516
|
__setPaint(attrName: 'fill' | 'stroke', value: IValue): void
|
|
512
517
|
__removePaint(attrName: 'fill' | 'stroke', removeInput?: boolean): void
|
package/src/editor/IEditor.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IGroup, IUI, IBox, IRectInputData, ISelectorProxy, IEditSize, ICursorType, IAlign, IUnitPointData, IDragEvent, IRotateEvent, IStroke, IFill, ILeaf, ILeafList, IObject, IBoxInputData, IGroupInputData, IImageCursor, IRect,
|
|
1
|
+
import { IGroup, IUI, IBox, IRectInputData, ISelectorProxy, IEditSize, ICursorType, IAlign, IUnitPointData, IDragEvent, IMoveEvent, IRotateEvent, IStroke, IFill, ILeaf, ILeafList, IObject, IBoxInputData, IGroupInputData, IImageCursor, IRect, IKeyEvent, IUIInputData, IZoomEvent, IColorString, IDirection4, IPointData, IScaleData, ISkewData, ILayoutBoundsData, ITransition, IFourNumber } from '@leafer-ui/interface'
|
|
2
2
|
|
|
3
|
-
export interface IEditorBase extends IGroup, ISelectorProxy {
|
|
3
|
+
export interface IEditorBase extends IGroup, ISelectorProxy, ITransformTool {
|
|
4
4
|
config: IEditorConfig
|
|
5
|
-
readonly mergeConfig: IEditorConfig //
|
|
5
|
+
readonly mergeConfig: IEditorConfig // 实际使用,合并了选中元素、默认editBox上的editConfig,频繁访问会消耗性能
|
|
6
6
|
readonly mergedConfig: IEditorConfig // 合并之后的缓存配置
|
|
7
7
|
|
|
8
8
|
hoverTarget?: IUI
|
|
@@ -19,9 +19,15 @@ export interface IEditorBase extends IGroup, ISelectorProxy {
|
|
|
19
19
|
readonly multiple: boolean
|
|
20
20
|
readonly single: boolean
|
|
21
21
|
|
|
22
|
+
readonly dragPoint: IEditPoint // 正在拖拽的控制点
|
|
23
|
+
|
|
22
24
|
readonly dragging: boolean
|
|
25
|
+
readonly gesturing: boolean // 手势操作元素中
|
|
26
|
+
|
|
23
27
|
readonly moving: boolean
|
|
24
|
-
readonly
|
|
28
|
+
readonly resizing: boolean
|
|
29
|
+
readonly rotating: boolean
|
|
30
|
+
readonly skewing: boolean
|
|
25
31
|
|
|
26
32
|
element?: IUI
|
|
27
33
|
buttons: IGroup
|
|
@@ -43,21 +49,17 @@ export interface IEditorBase extends IGroup, ISelectorProxy {
|
|
|
43
49
|
update(): void
|
|
44
50
|
updateEditBox(): void
|
|
45
51
|
updateEditTool(): void
|
|
52
|
+
unloadEditTool(): void
|
|
46
53
|
|
|
47
54
|
getEditSize(ui: ILeaf): IEditSize
|
|
48
55
|
|
|
49
|
-
onMove(e: IDragEvent): void
|
|
50
|
-
onScale(e: IDragEvent | IZoomEvent): void
|
|
51
|
-
onRotate(e: IDragEvent | IRotateEvent): void
|
|
52
|
-
onSkew(e: IDragEvent): void
|
|
53
|
-
|
|
54
56
|
group(group?: IGroup | IGroupInputData): IGroup
|
|
55
57
|
ungroup(): IUI[]
|
|
56
58
|
openGroup(group: IGroup): void
|
|
57
59
|
closeGroup(group: IGroup): void
|
|
58
60
|
|
|
59
|
-
openInnerEditor(target?: IUI, select?: boolean): void
|
|
60
|
-
closeInnerEditor(): void
|
|
61
|
+
openInnerEditor(target?: IUI, nameOrSelect?: string | boolean, select?: boolean): void
|
|
62
|
+
closeInnerEditor(onlyInnerEditor?: boolean): void
|
|
61
63
|
|
|
62
64
|
lock(): void
|
|
63
65
|
unlock(): void
|
|
@@ -66,6 +68,22 @@ export interface IEditorBase extends IGroup, ISelectorProxy {
|
|
|
66
68
|
toBottom(): void
|
|
67
69
|
}
|
|
68
70
|
|
|
71
|
+
export interface ITransformTool {
|
|
72
|
+
editBox: IEditBoxBase
|
|
73
|
+
editTool?: IObject
|
|
74
|
+
|
|
75
|
+
onMove(e: IDragEvent | IMoveEvent): void
|
|
76
|
+
onScale(e: IDragEvent | IZoomEvent): void
|
|
77
|
+
onRotate(e: IDragEvent | IRotateEvent): void
|
|
78
|
+
onSkew(e: IDragEvent): void
|
|
79
|
+
|
|
80
|
+
move(x: number | IPointData, y?: number, transition?: ITransition): void
|
|
81
|
+
scaleOf(origin: IPointData | IAlign, scaleX: number, scaleY?: number | ITransition, resize?: boolean, transition?: ITransition): void
|
|
82
|
+
rotateOf(origin: IPointData | IAlign, rotation: number, transition?: ITransition): void
|
|
83
|
+
skewOf(origin: IPointData | IAlign, skewX: number, skewY?: number, resize?: boolean, transition?: ITransition): void
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
69
87
|
export interface IEditorConfig extends IObject {
|
|
70
88
|
editSize?: IEditSize
|
|
71
89
|
keyEvent?: boolean
|
|
@@ -73,6 +91,8 @@ export interface IEditorConfig extends IObject {
|
|
|
73
91
|
stroke?: IStroke
|
|
74
92
|
strokeWidth?: number
|
|
75
93
|
|
|
94
|
+
spread?: IFourNumber // 扩张编辑框的大小,与实际元素之间产生一定的间隙
|
|
95
|
+
|
|
76
96
|
pointFill?: IFill
|
|
77
97
|
pointSize?: number
|
|
78
98
|
pointRadius?: number
|
|
@@ -101,9 +121,10 @@ export interface IEditorConfig extends IObject {
|
|
|
101
121
|
rotateCursor?: IImageCursor
|
|
102
122
|
skewCursor?: IImageCursor
|
|
103
123
|
|
|
104
|
-
around?: IAlign | IUnitPointData
|
|
105
|
-
|
|
124
|
+
around?: IAlign | IUnitPointData // 缩放、旋转、倾斜时围绕的中心点
|
|
125
|
+
rotateAround?: IAlign | IUnitPointData // 单独设置旋转围绕的中心点,比 around 优先级高
|
|
106
126
|
rotateGap?: number
|
|
127
|
+
lockRatio?: boolean | 'corner'
|
|
107
128
|
|
|
108
129
|
selector?: boolean
|
|
109
130
|
editBox?: boolean
|
|
@@ -116,10 +137,10 @@ export interface IEditorConfig extends IObject {
|
|
|
116
137
|
continuousSelect?: boolean // 点击可以连续选择
|
|
117
138
|
openInner?: 'double' | 'long' // 双击/长按打开内部
|
|
118
139
|
|
|
119
|
-
moveable?: boolean | 'move'
|
|
120
|
-
resizeable?: boolean | 'zoom'
|
|
140
|
+
moveable?: boolean | 'gesture' | 'move'
|
|
141
|
+
resizeable?: boolean | 'gesture' | 'zoom'
|
|
121
142
|
flipable?: boolean
|
|
122
|
-
rotateable?: boolean | 'rotate'
|
|
143
|
+
rotateable?: boolean | 'gesture' | 'rotate'
|
|
123
144
|
skewable?: boolean
|
|
124
145
|
|
|
125
146
|
beforeSelect?: IEditorBeforeSelect
|
|
@@ -128,6 +149,8 @@ export interface IEditorConfig extends IObject {
|
|
|
128
149
|
beforeRotate?: IEditorBeforeRotate
|
|
129
150
|
beforeSkew?: IEditorBeforeSkew
|
|
130
151
|
|
|
152
|
+
preventEditInner?: boolean // 仅阻止交互事件触发内部编辑
|
|
153
|
+
|
|
131
154
|
textEditor?: IObject
|
|
132
155
|
pathEditor?: IObject
|
|
133
156
|
}
|
|
@@ -189,9 +212,16 @@ export interface IEditPoint extends IBox {
|
|
|
189
212
|
export type IEditPointType = 'resize' | 'rotate' | 'skew' | 'resize-rotate' | 'button'
|
|
190
213
|
|
|
191
214
|
export interface IEditBoxBase extends IGroup {
|
|
215
|
+
|
|
192
216
|
editor: IEditorBase
|
|
217
|
+
|
|
193
218
|
dragging: boolean
|
|
219
|
+
gesturing: boolean // 手势操作元素中
|
|
220
|
+
|
|
194
221
|
moving: boolean
|
|
222
|
+
resizing: boolean
|
|
223
|
+
rotating: boolean
|
|
224
|
+
skewing: boolean
|
|
195
225
|
|
|
196
226
|
view: IGroup // 放置默认编辑工具控制点
|
|
197
227
|
|
|
@@ -209,23 +239,36 @@ export interface IEditBoxBase extends IGroup {
|
|
|
209
239
|
|
|
210
240
|
dragStartData: IEditorDragStartData
|
|
211
241
|
|
|
242
|
+
config: IEditorConfig
|
|
243
|
+
readonly mergeConfig: IEditorConfig // 合并了config与编辑器的mergeConfig,频繁访问会消耗性能
|
|
244
|
+
readonly mergedConfig: IEditorConfig // 实际使用,合并之后的缓存配置
|
|
245
|
+
|
|
246
|
+
target: IUI // 操作的元素,默认为editor.element
|
|
247
|
+
single: boolean // 是否单选元素
|
|
248
|
+
|
|
249
|
+
transformTool: ITransformTool
|
|
250
|
+
|
|
212
251
|
readonly flipped: boolean
|
|
213
252
|
readonly flippedX: boolean
|
|
214
253
|
readonly flippedY: boolean
|
|
215
254
|
readonly flippedOne: boolean
|
|
216
255
|
|
|
256
|
+
readonly canUse: boolean // 编辑框是否处于激活状态
|
|
257
|
+
readonly canGesture: boolean // 是否支持手势
|
|
258
|
+
|
|
217
259
|
getPointStyle(userStyle?: IBoxInputData): IBoxInputData
|
|
218
260
|
getPointsStyle(): IBoxInputData[]
|
|
219
261
|
getMiddlePointsStyle(): IBoxInputData[]
|
|
220
262
|
|
|
221
263
|
load(): void
|
|
222
|
-
update(
|
|
264
|
+
update(): void
|
|
223
265
|
unload(): void
|
|
224
266
|
|
|
225
267
|
onArrow(e: IKeyEvent): void
|
|
226
268
|
|
|
227
269
|
}
|
|
228
270
|
|
|
271
|
+
|
|
229
272
|
export interface IEditorDragStartData {
|
|
230
273
|
x: number
|
|
231
274
|
y: number
|
package/src/index.ts
CHANGED
|
@@ -28,10 +28,10 @@ export {
|
|
|
28
28
|
IUITag, IUIInputData, IUIJSONData, IStateStyle, IStates, IStateName
|
|
29
29
|
} from './IUI'
|
|
30
30
|
|
|
31
|
-
export { IVectorPath, IShadowEffect, IBlurEffect, IGrayscaleEffect, IEffect, IFill, IStroke, IPaintAttr, IStrokeAlign, IStrokeJoin, IStrokeCap, IArrowType, IPathDataArrow, IPathDataArrowMap, IRGB, IRGBA, IColor, IColorStop, IPaint, IGradientPaint, IImagePaint, IImagePaintMode, IFontWeight, IFontWeightNumer, IFontWeightString, ITextCase, ITextDecoration, ITextDecorationType, ITextDecorationData, IWritingMode, ITextAlign, IVerticalAlign, IOverflow, ITextWrap, IRepeat, IGradientType, IPaintType, IImageFilters, IPathDataArrowOffset, ISolidPaint, IPaintBase } from './type/IType'
|
|
31
|
+
export { IVectorPath, IShadowEffect, IBlurEffect, IGrayscaleEffect, IEffect, IFill, IStroke, IPaintAttr, IStrokeAlign, IStrokeJoin, IStrokeCap, IArrowType, IPathDataArrow, IPathDataArrowMap, IRGB, IRGBA, IColor, IColorStop, IPaint, IStrokePaint, IStrokeSolidPaint, IGradientPaint, IStrokeGradientPaint, IImagePaint, IStrokeImagePaint, IImagePaintMode, IFontWeight, IFontWeightNumer, IFontWeightString, ITextCase, ITextDecoration, ITextDecorationType, ITextDecorationData, IWritingMode, ITextAlign, IVerticalAlign, IOverflow, ITextWrap, IRepeat, IGradientType, IPaintType, IImageFilters, IPathDataArrowOffset, ISolidPaint, IPaintBase } from './type/IType'
|
|
32
32
|
export { ICornerRadiusString, IStrokeWidthString, IPaintString, IShadowString, IPercent, IDashPatternString, IColorString } from './type/IStringType'
|
|
33
33
|
export { ILeafFill, ILeafPaint, ILeafPaintPatternData, ILeafPaintColor, ILeafStrokePaint, ILeafShadowEffect } from './type/IComputedType'
|
|
34
|
-
export { IStrokeAttrData, IStrokeInputData, IStrokeComputedData, ITextStyleAttrData, ITextStyleInputData, ITextStyleComputedData, IEffectAttrData, IEffectInputData, IEffectComputedData } from './ICommonAttr'
|
|
34
|
+
export { IStrokeAttrData, IStrokeInputData, IStrokeComputedData, IStrokeComputedStyle, IStrokeStyle, ITextStyleAttrData, ITextStyleInputData, ITextStyleComputedData, IEffectAttrData, IEffectInputData, IEffectComputedData } from './ICommonAttr'
|
|
35
35
|
|
|
36
36
|
export { IAnimation, IAnimate, IAnimateList, IAnimateType, IKeyframe, IKeyframeId, IAnimateKeyframe, IComputedKeyframe, IStyleAnimation, IKeyframesAnimation } from './IAnimation'
|
|
37
37
|
|
|
@@ -50,4 +50,4 @@ export { IEffectModule } from './module/IEffect'
|
|
|
50
50
|
export { IFilterModule, IFilterProcessor, IFilterFunction } from './module/IFilter'
|
|
51
51
|
export { ICachedShape } from './ICachedShape'
|
|
52
52
|
|
|
53
|
-
export { IEditorBase, IEditorConfig, IEditBoxBase, IEditPoint, IEditPointInputData, IEditPointType, IEditorDragStartData, IEditToolFunction, IEditorConfigFunction, IEditorBeforeSelect, IEditorBeforeMove, IEditorBeforeScale, IEditorBeforeRotate, IEditorBeforeSkew, IEditorSelectData, IEditorMoveData, IEditorScaleData, IEditorRotationData, IEditorSkewData } from './editor/IEditor'
|
|
53
|
+
export { IEditorBase, IEditorConfig, ITransformTool, IEditBoxBase, IEditPoint, IEditPointInputData, IEditPointType, IEditorDragStartData, IEditToolFunction, IEditorConfigFunction, IEditorBeforeSelect, IEditorBeforeMove, IEditorBeforeScale, IEditorBeforeRotate, IEditorBeforeSkew, IEditorSelectData, IEditorMoveData, IEditorScaleData, IEditorRotationData, IEditorSkewData } from './editor/IEditor'
|
package/src/module/IPaint.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ILeaferCanvas, IRenderOptions, IBooleanMap, IBoundsData, ILeaferImage, IAround, IPointData, IMatrixData } from '@leafer/interface'
|
|
1
|
+
import { ILeaferCanvas, IRenderOptions, IBooleanMap, IBoundsData, ILeaferImage, IAround, IPointData, IMatrixData, ISizeData } from '@leafer/interface'
|
|
2
2
|
|
|
3
3
|
import { ILeafPaint, ILeafPaintPatternData } from '../type/IComputedType'
|
|
4
4
|
import { IUI, IUIData } from '../IUI'
|
|
@@ -35,7 +35,7 @@ export interface IPaintImageModule {
|
|
|
35
35
|
createData(leafPaint: ILeafPaint, image: ILeaferImage, paint: IImagePaint, box: IBoundsData): void
|
|
36
36
|
getPatternData(paint: IImagePaint, box: IBoundsData, image: ILeaferImage): ILeafPaintPatternData
|
|
37
37
|
fillOrFitMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number): void
|
|
38
|
-
clipMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number): void
|
|
38
|
+
clipMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number, skew: IPointData, clipSize?: ISizeData): void
|
|
39
39
|
repeatMode(data: ILeafPaintPatternData, box: IBoundsData, width: number, height: number, x: number, y: number, scaleX: number, scaleY: number, rotation: number, around: IAround): void
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -3,13 +3,15 @@ import { IBlendMode, ILeaferImage, IMatrixData, ITaskItem } from '@leafer/interf
|
|
|
3
3
|
import { IColorString } from './IStringType'
|
|
4
4
|
import { IStrokeAlign, IStrokeJoin, IStrokeCap, IImagePaintMode, IImageFilters } from './IType'
|
|
5
5
|
import { IPaintType } from './IType'
|
|
6
|
+
import { IStrokeComputedStyle } from '../ICommonAttr'
|
|
6
7
|
|
|
7
8
|
export type ILeafPaintColor = IColorString | CanvasGradient | CanvasPattern
|
|
8
9
|
|
|
9
10
|
export interface ILeafPaint {
|
|
10
11
|
type?: IPaintType
|
|
11
12
|
style?: ILeafPaintColor
|
|
12
|
-
|
|
13
|
+
strokeStyle?: IStrokeComputedStyle // 子描边样式选项
|
|
14
|
+
transform?: IMatrixData // 存在时表示pattern自身不能应用transform
|
|
13
15
|
blendMode?: IBlendMode
|
|
14
16
|
image?: ILeaferImage
|
|
15
17
|
loadId?: number
|
|
@@ -19,6 +21,8 @@ export interface ILeafPaint {
|
|
|
19
21
|
sync?: boolean // 同步显示图片,不走任务列表生成图案
|
|
20
22
|
isTransparent?: boolean // 是否为透明色
|
|
21
23
|
data?: ILeafPaintPatternData
|
|
24
|
+
editing?: boolean // 标记编辑中
|
|
25
|
+
scaleFixed?: boolean // 平铺图片不跟随画布缩放
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
export interface ILeafPaintPatternData {
|
package/src/type/IType.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { IPointData, IPathCommandData, IWindingRule, IBlendMode, IExportFileType, IFourNumber, IAlign, IUnitPointData, IAxis, IAxisReverse, IFilter, IOptionSizeData } from '@leafer/interface'
|
|
1
|
+
import { IPointData, IPathCommandData, IWindingRule, IBlendMode, IExportFileType, IFourNumber, IAlign, IUnitPointData, IAxis, IAxisReverse, IFilter, IOptionSizeData, ISizeData } from '@leafer/interface'
|
|
2
2
|
import { IColorString, IPaintString } from './IStringType'
|
|
3
|
+
import { IStrokeStyle } from '../ICommonAttr'
|
|
3
4
|
|
|
4
5
|
export type IPaint = ISolidPaint | IGradientPaint | IImagePaint
|
|
5
6
|
|
|
7
|
+
export type IStrokePaint = IStrokeSolidPaint | IStrokeGradientPaint | IStrokeImagePaint
|
|
8
|
+
|
|
6
9
|
export type IFill = IPaint | IPaint[] | IPaintString
|
|
7
10
|
|
|
8
|
-
export type IStroke =
|
|
11
|
+
export type IStroke = IStrokePaint | IStrokePaint[] | IPaintString
|
|
9
12
|
|
|
10
13
|
export type IPaintAttr = 'fill' | 'stroke'
|
|
11
14
|
|
|
@@ -14,6 +17,9 @@ export interface IPaintBase {
|
|
|
14
17
|
blendMode?: IBlendMode
|
|
15
18
|
visible?: boolean
|
|
16
19
|
opacity?: number
|
|
20
|
+
|
|
21
|
+
style?: IStrokeStyle
|
|
22
|
+
editing?: boolean // 标记编辑中
|
|
17
23
|
}
|
|
18
24
|
|
|
19
25
|
export type IPaintType =
|
|
@@ -32,6 +38,8 @@ export interface ISolidPaint extends IPaintBase {
|
|
|
32
38
|
color: IColor
|
|
33
39
|
}
|
|
34
40
|
|
|
41
|
+
export interface IStrokeSolidPaint extends ISolidPaint { }
|
|
42
|
+
|
|
35
43
|
export type IColor = IColorString | IRGB | IRGBA
|
|
36
44
|
export interface IRGB {
|
|
37
45
|
r: number
|
|
@@ -51,6 +59,9 @@ export interface IGradientPaint extends IPaintBase {
|
|
|
51
59
|
stretch?: number
|
|
52
60
|
stops: IColorStop[] | IColorString[]
|
|
53
61
|
}
|
|
62
|
+
|
|
63
|
+
export interface IStrokeGradientPaint extends IGradientPaint { }
|
|
64
|
+
|
|
54
65
|
export interface IColorStop {
|
|
55
66
|
offset: number
|
|
56
67
|
color: IColor
|
|
@@ -75,13 +86,19 @@ export interface IImagePaint extends IPaintBase {
|
|
|
75
86
|
size?: number | IOptionSizeData
|
|
76
87
|
scale?: number | IPointData
|
|
77
88
|
rotation?: number
|
|
89
|
+
skew?: | IPointData
|
|
90
|
+
|
|
91
|
+
clipSize?: ISizeData
|
|
78
92
|
|
|
79
93
|
repeat?: IRepeat
|
|
94
|
+
scaleFixed?: boolean // 平铺图片不跟随画布缩放
|
|
80
95
|
|
|
81
96
|
changeful?: boolean // 会频繁变化,不生成图案(有特殊性能优化,一般用于游戏精灵、动图场景)
|
|
82
97
|
sync?: boolean // 同步显示,不走任务列表生成图案
|
|
83
98
|
showProgress?: boolean // 是否显示进度
|
|
84
99
|
}
|
|
100
|
+
|
|
101
|
+
export interface IStrokeImagePaint extends IImagePaint { }
|
|
85
102
|
export interface IImageFilters {
|
|
86
103
|
exposure?: number // 曝光
|
|
87
104
|
contrast?: number // 对比度
|
|
@@ -178,4 +195,4 @@ export interface IEffect extends IFilter {
|
|
|
178
195
|
|
|
179
196
|
}
|
|
180
197
|
|
|
181
|
-
export type IOverflow = 'show' | 'hide' | 'scroll'
|
|
198
|
+
export type IOverflow = 'show' | 'hide' | 'scroll'
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IBlendMode, IAlign, IUnitPointData, IExportFileType, IFourNumber, IPointData, IOptionSizeData, IPathCommandData, IAxis, IAxisReverse, IWindingRule, IFilter, IMatrixData, ILeaferImage, ITaskItem, IBoolean, INumber, IString, IUnitData, IAnimateOptions, IAnimateEasing, IEventer, IObject, IEventParamsMap, IAnimateEasingFunction, IAnimateEnding, ITransition, IPercentData, ILeafInputData,
|
|
1
|
+
import { IBlendMode, IAlign, IUnitPointData, IExportFileType, IFourNumber, IPointData, IOptionSizeData, ISizeData, IPathCommandData, IAxis, IAxisReverse, IWindingRule, IFilter, IMatrixData, ILeaferImage, ITaskItem, IBoolean, INumber, IString, IUnitData, IAnimateOptions, IAnimateEasing, IEventer, IObject, IEventParamsMap, IAnimateEasingFunction, IAnimateEnding, ITransition, IPercentData, ILeafInputData, ILeaf as ILeaf$1, ILeafComputedData, ILeafData, IBoundsData, IValue, IPathCreator, IJSONOptions, IFindCondition, IAnswer, IPathString, IPathDrawer, ILeaferCanvas, IRenderOptions, IExportOptions, IExportResult, IPickOptions, IPickResult, ICanvasContext2DSettings, ICanvasContext2D, ILeaferAttrData, IControl, ILeaferType, ILeaferConfig, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IBooleanMap, IAround, IMatrixWithBoundsScaleData } from '@leafer/interface';
|
|
2
2
|
export * from '@leafer/interface';
|
|
3
|
-
import { IObject as IObject$1, IEditSize, IStroke as IStroke$1, IFill as IFill$1, IBoxInputData as IBoxInputData$1, IRectInputData as IRectInputData$1, IColorString as IColorString$1, IDirection4, ICursorType, IImageCursor, IAlign as IAlign$1, IUnitPointData as IUnitPointData$1, IUIInputData as IUIInputData$1, IUI as IUI$1, IPointData as IPointData$1, IScaleData, ISkewData, IGroup as IGroup$1, ISelectorProxy,
|
|
3
|
+
import { IObject as IObject$1, IEditSize, IStroke as IStroke$1, IFourNumber as IFourNumber$1, IFill as IFill$1, IBoxInputData as IBoxInputData$1, IRectInputData as IRectInputData$1, IColorString as IColorString$1, IDirection4, ICursorType, IImageCursor, IAlign as IAlign$1, IUnitPointData as IUnitPointData$1, IUIInputData as IUIInputData$1, IUI as IUI$1, IPointData as IPointData$1, IScaleData, ISkewData, IGroup as IGroup$1, ISelectorProxy, IBox as IBox$1, IRect as IRect$1, ILayoutBoundsData, IKeyEvent, IDragEvent, IMoveEvent, IZoomEvent, IRotateEvent, ITransition as ITransition$1, ILeafList, ILeaf, IGroupInputData as IGroupInputData$1, IStateName as IStateName$1, IString as IString$1, IBoolean as IBoolean$1, IStateStyle as IStateStyle$1 } from '@leafer-ui/interface';
|
|
4
4
|
|
|
5
5
|
type IPercent = string;
|
|
6
6
|
type IColorString = string;
|
|
@@ -14,14 +14,17 @@ type IImagePaintString = string;
|
|
|
14
14
|
type IShadowString = string;
|
|
15
15
|
|
|
16
16
|
type IPaint = ISolidPaint | IGradientPaint | IImagePaint;
|
|
17
|
+
type IStrokePaint = IStrokeSolidPaint | IStrokeGradientPaint | IStrokeImagePaint;
|
|
17
18
|
type IFill = IPaint | IPaint[] | IPaintString;
|
|
18
|
-
type IStroke =
|
|
19
|
+
type IStroke = IStrokePaint | IStrokePaint[] | IPaintString;
|
|
19
20
|
type IPaintAttr = 'fill' | 'stroke';
|
|
20
21
|
interface IPaintBase {
|
|
21
22
|
type: IPaintType;
|
|
22
23
|
blendMode?: IBlendMode;
|
|
23
24
|
visible?: boolean;
|
|
24
25
|
opacity?: number;
|
|
26
|
+
style?: IStrokeStyle;
|
|
27
|
+
editing?: boolean;
|
|
25
28
|
}
|
|
26
29
|
type IPaintType = 'image' | 'solid' | IGradientType;
|
|
27
30
|
type IGradientType = 'linear' | 'radial' | 'angular';
|
|
@@ -29,6 +32,8 @@ interface ISolidPaint extends IPaintBase {
|
|
|
29
32
|
type: 'solid';
|
|
30
33
|
color: IColor;
|
|
31
34
|
}
|
|
35
|
+
interface IStrokeSolidPaint extends ISolidPaint {
|
|
36
|
+
}
|
|
32
37
|
type IColor = IColorString | IRGB | IRGBA;
|
|
33
38
|
interface IRGB {
|
|
34
39
|
r: number;
|
|
@@ -46,6 +51,8 @@ interface IGradientPaint extends IPaintBase {
|
|
|
46
51
|
stretch?: number;
|
|
47
52
|
stops: IColorStop[] | IColorString[];
|
|
48
53
|
}
|
|
54
|
+
interface IStrokeGradientPaint extends IGradientPaint {
|
|
55
|
+
}
|
|
49
56
|
interface IColorStop {
|
|
50
57
|
offset: number;
|
|
51
58
|
color: IColor;
|
|
@@ -62,11 +69,16 @@ interface IImagePaint extends IPaintBase {
|
|
|
62
69
|
size?: number | IOptionSizeData;
|
|
63
70
|
scale?: number | IPointData;
|
|
64
71
|
rotation?: number;
|
|
72
|
+
skew?: IPointData;
|
|
73
|
+
clipSize?: ISizeData;
|
|
65
74
|
repeat?: IRepeat;
|
|
75
|
+
scaleFixed?: boolean;
|
|
66
76
|
changeful?: boolean;
|
|
67
77
|
sync?: boolean;
|
|
68
78
|
showProgress?: boolean;
|
|
69
79
|
}
|
|
80
|
+
interface IStrokeImagePaint extends IImagePaint {
|
|
81
|
+
}
|
|
70
82
|
interface IImageFilters {
|
|
71
83
|
exposure?: number;
|
|
72
84
|
contrast?: number;
|
|
@@ -134,12 +146,13 @@ interface IGrayscaleEffect {
|
|
|
134
146
|
}
|
|
135
147
|
interface IEffect extends IFilter {
|
|
136
148
|
}
|
|
137
|
-
type IOverflow = 'show' | 'hide' | 'scroll'
|
|
149
|
+
type IOverflow = 'show' | 'hide' | 'scroll';
|
|
138
150
|
|
|
139
151
|
type ILeafPaintColor = IColorString | CanvasGradient | CanvasPattern;
|
|
140
152
|
interface ILeafPaint {
|
|
141
153
|
type?: IPaintType;
|
|
142
154
|
style?: ILeafPaintColor;
|
|
155
|
+
strokeStyle?: IStrokeComputedStyle;
|
|
143
156
|
transform?: IMatrixData;
|
|
144
157
|
blendMode?: IBlendMode;
|
|
145
158
|
image?: ILeaferImage;
|
|
@@ -150,6 +163,8 @@ interface ILeafPaint {
|
|
|
150
163
|
sync?: boolean;
|
|
151
164
|
isTransparent?: boolean;
|
|
152
165
|
data?: ILeafPaintPatternData;
|
|
166
|
+
editing?: boolean;
|
|
167
|
+
scaleFixed?: boolean;
|
|
153
168
|
}
|
|
154
169
|
interface ILeafPaintPatternData {
|
|
155
170
|
width?: number;
|
|
@@ -206,21 +221,17 @@ interface IBorderComputedData {
|
|
|
206
221
|
borderWidth?: number | number[];
|
|
207
222
|
borderRadius?: number | number[];
|
|
208
223
|
}
|
|
209
|
-
interface IStrokeAttrData {
|
|
224
|
+
interface IStrokeAttrData extends IStrokeStyle {
|
|
210
225
|
stroke?: IStroke;
|
|
211
|
-
strokeAlign?: IStrokeAlign;
|
|
212
|
-
strokeWidth?: IFourNumber | IStrokeWidthString;
|
|
213
|
-
strokeWidthFixed?: IBoolean;
|
|
214
|
-
strokeCap?: IStrokeCap;
|
|
215
|
-
strokeJoin?: IStrokeJoin;
|
|
216
|
-
dashPattern?: INumber[] | IDashPatternString;
|
|
217
|
-
dashOffset?: INumber;
|
|
218
|
-
miterLimit?: INumber;
|
|
219
226
|
startArrow?: IArrowType;
|
|
220
227
|
endArrow?: IArrowType;
|
|
221
228
|
}
|
|
222
|
-
interface IStrokeInputData {
|
|
229
|
+
interface IStrokeInputData extends IStrokeStyle {
|
|
223
230
|
stroke?: IStroke;
|
|
231
|
+
startArrow?: IArrowType;
|
|
232
|
+
endArrow?: IArrowType;
|
|
233
|
+
}
|
|
234
|
+
interface IStrokeStyle {
|
|
224
235
|
strokeAlign?: IStrokeAlign;
|
|
225
236
|
strokeWidth?: IFourNumber | IStrokeWidthString;
|
|
226
237
|
strokeWidthFixed?: IBoolean;
|
|
@@ -229,11 +240,13 @@ interface IStrokeInputData {
|
|
|
229
240
|
dashPattern?: INumber[] | IDashPatternString;
|
|
230
241
|
dashOffset?: INumber;
|
|
231
242
|
miterLimit?: INumber;
|
|
243
|
+
}
|
|
244
|
+
interface IStrokeComputedData extends IStrokeComputedStyle {
|
|
245
|
+
stroke?: IColorString | ILeafStrokePaint[];
|
|
232
246
|
startArrow?: IArrowType;
|
|
233
247
|
endArrow?: IArrowType;
|
|
234
248
|
}
|
|
235
|
-
interface
|
|
236
|
-
stroke?: IColorString | ILeafStrokePaint[];
|
|
249
|
+
interface IStrokeComputedStyle {
|
|
237
250
|
strokeAlign?: IStrokeAlign;
|
|
238
251
|
strokeWidth?: number;
|
|
239
252
|
strokeWidths?: number[];
|
|
@@ -243,8 +256,6 @@ interface IStrokeComputedData {
|
|
|
243
256
|
dashPattern?: number[];
|
|
244
257
|
dashOffset?: number;
|
|
245
258
|
miterLimit?: number;
|
|
246
|
-
startArrow?: IArrowType;
|
|
247
|
-
endArrow?: IArrowType;
|
|
248
259
|
}
|
|
249
260
|
interface ITextStyleAttrData {
|
|
250
261
|
fontFamily?: IString;
|
|
@@ -357,6 +368,7 @@ interface IComputedKeyframe {
|
|
|
357
368
|
}
|
|
358
369
|
interface IAnimate extends IAnimateOptions, IEventer {
|
|
359
370
|
target: IUI | IObject;
|
|
371
|
+
parent?: IAnimateList;
|
|
360
372
|
keyframes: IKeyframe[];
|
|
361
373
|
config?: IAnimateOptions;
|
|
362
374
|
event?: IEventParamsMap;
|
|
@@ -383,9 +395,10 @@ interface IAnimate extends IAnimateOptions, IEventer {
|
|
|
383
395
|
interface IAnimateList extends IAnimate {
|
|
384
396
|
list: IAnimate[];
|
|
385
397
|
updateList(animation?: IAnimation[] | IAnimate[], isTemp?: boolean): void;
|
|
398
|
+
onChildEvent(type: string, _animate: IAnimate): void;
|
|
386
399
|
}
|
|
387
400
|
|
|
388
|
-
interface IEditorBase extends IGroup$1, ISelectorProxy {
|
|
401
|
+
interface IEditorBase extends IGroup$1, ISelectorProxy, ITransformTool {
|
|
389
402
|
config: IEditorConfig;
|
|
390
403
|
readonly mergeConfig: IEditorConfig;
|
|
391
404
|
readonly mergedConfig: IEditorConfig;
|
|
@@ -399,9 +412,13 @@ interface IEditorBase extends IGroup$1, ISelectorProxy {
|
|
|
399
412
|
readonly groupOpening: boolean;
|
|
400
413
|
readonly multiple: boolean;
|
|
401
414
|
readonly single: boolean;
|
|
415
|
+
readonly dragPoint: IEditPoint;
|
|
402
416
|
readonly dragging: boolean;
|
|
417
|
+
readonly gesturing: boolean;
|
|
403
418
|
readonly moving: boolean;
|
|
404
|
-
readonly
|
|
419
|
+
readonly resizing: boolean;
|
|
420
|
+
readonly rotating: boolean;
|
|
421
|
+
readonly skewing: boolean;
|
|
405
422
|
element?: IUI$1;
|
|
406
423
|
buttons: IGroup$1;
|
|
407
424
|
selector: IGroup$1;
|
|
@@ -418,27 +435,37 @@ interface IEditorBase extends IGroup$1, ISelectorProxy {
|
|
|
418
435
|
update(): void;
|
|
419
436
|
updateEditBox(): void;
|
|
420
437
|
updateEditTool(): void;
|
|
438
|
+
unloadEditTool(): void;
|
|
421
439
|
getEditSize(ui: ILeaf): IEditSize;
|
|
422
|
-
onMove(e: IDragEvent): void;
|
|
423
|
-
onScale(e: IDragEvent | IZoomEvent): void;
|
|
424
|
-
onRotate(e: IDragEvent | IRotateEvent): void;
|
|
425
|
-
onSkew(e: IDragEvent): void;
|
|
426
440
|
group(group?: IGroup$1 | IGroupInputData$1): IGroup$1;
|
|
427
441
|
ungroup(): IUI$1[];
|
|
428
442
|
openGroup(group: IGroup$1): void;
|
|
429
443
|
closeGroup(group: IGroup$1): void;
|
|
430
|
-
openInnerEditor(target?: IUI$1, select?: boolean): void;
|
|
431
|
-
closeInnerEditor(): void;
|
|
444
|
+
openInnerEditor(target?: IUI$1, nameOrSelect?: string | boolean, select?: boolean): void;
|
|
445
|
+
closeInnerEditor(onlyInnerEditor?: boolean): void;
|
|
432
446
|
lock(): void;
|
|
433
447
|
unlock(): void;
|
|
434
448
|
toTop(): void;
|
|
435
449
|
toBottom(): void;
|
|
436
450
|
}
|
|
451
|
+
interface ITransformTool {
|
|
452
|
+
editBox: IEditBoxBase;
|
|
453
|
+
editTool?: IObject$1;
|
|
454
|
+
onMove(e: IDragEvent | IMoveEvent): void;
|
|
455
|
+
onScale(e: IDragEvent | IZoomEvent): void;
|
|
456
|
+
onRotate(e: IDragEvent | IRotateEvent): void;
|
|
457
|
+
onSkew(e: IDragEvent): void;
|
|
458
|
+
move(x: number | IPointData$1, y?: number, transition?: ITransition$1): void;
|
|
459
|
+
scaleOf(origin: IPointData$1 | IAlign$1, scaleX: number, scaleY?: number | ITransition$1, resize?: boolean, transition?: ITransition$1): void;
|
|
460
|
+
rotateOf(origin: IPointData$1 | IAlign$1, rotation: number, transition?: ITransition$1): void;
|
|
461
|
+
skewOf(origin: IPointData$1 | IAlign$1, skewX: number, skewY?: number, resize?: boolean, transition?: ITransition$1): void;
|
|
462
|
+
}
|
|
437
463
|
interface IEditorConfig extends IObject$1 {
|
|
438
464
|
editSize?: IEditSize;
|
|
439
465
|
keyEvent?: boolean;
|
|
440
466
|
stroke?: IStroke$1;
|
|
441
467
|
strokeWidth?: number;
|
|
468
|
+
spread?: IFourNumber$1;
|
|
442
469
|
pointFill?: IFill$1;
|
|
443
470
|
pointSize?: number;
|
|
444
471
|
pointRadius?: number;
|
|
@@ -461,8 +488,9 @@ interface IEditorConfig extends IObject$1 {
|
|
|
461
488
|
rotateCursor?: IImageCursor;
|
|
462
489
|
skewCursor?: IImageCursor;
|
|
463
490
|
around?: IAlign$1 | IUnitPointData$1;
|
|
464
|
-
|
|
491
|
+
rotateAround?: IAlign$1 | IUnitPointData$1;
|
|
465
492
|
rotateGap?: number;
|
|
493
|
+
lockRatio?: boolean | 'corner';
|
|
466
494
|
selector?: boolean;
|
|
467
495
|
editBox?: boolean;
|
|
468
496
|
hover?: boolean;
|
|
@@ -473,16 +501,17 @@ interface IEditorConfig extends IObject$1 {
|
|
|
473
501
|
boxSelect?: boolean;
|
|
474
502
|
continuousSelect?: boolean;
|
|
475
503
|
openInner?: 'double' | 'long';
|
|
476
|
-
moveable?: boolean | 'move';
|
|
477
|
-
resizeable?: boolean | 'zoom';
|
|
504
|
+
moveable?: boolean | 'gesture' | 'move';
|
|
505
|
+
resizeable?: boolean | 'gesture' | 'zoom';
|
|
478
506
|
flipable?: boolean;
|
|
479
|
-
rotateable?: boolean | 'rotate';
|
|
507
|
+
rotateable?: boolean | 'gesture' | 'rotate';
|
|
480
508
|
skewable?: boolean;
|
|
481
509
|
beforeSelect?: IEditorBeforeSelect;
|
|
482
510
|
beforeMove?: IEditorBeforeMove;
|
|
483
511
|
beforeScale?: IEditorBeforeScale;
|
|
484
512
|
beforeRotate?: IEditorBeforeRotate;
|
|
485
513
|
beforeSkew?: IEditorBeforeSkew;
|
|
514
|
+
preventEditInner?: boolean;
|
|
486
515
|
textEditor?: IObject$1;
|
|
487
516
|
pathEditor?: IObject$1;
|
|
488
517
|
}
|
|
@@ -532,7 +561,11 @@ type IEditPointType = 'resize' | 'rotate' | 'skew' | 'resize-rotate' | 'button';
|
|
|
532
561
|
interface IEditBoxBase extends IGroup$1 {
|
|
533
562
|
editor: IEditorBase;
|
|
534
563
|
dragging: boolean;
|
|
564
|
+
gesturing: boolean;
|
|
535
565
|
moving: boolean;
|
|
566
|
+
resizing: boolean;
|
|
567
|
+
rotating: boolean;
|
|
568
|
+
skewing: boolean;
|
|
536
569
|
view: IGroup$1;
|
|
537
570
|
circle: IEditPoint;
|
|
538
571
|
rect: IRect$1;
|
|
@@ -543,15 +576,23 @@ interface IEditBoxBase extends IGroup$1 {
|
|
|
543
576
|
enterPoint: IEditPoint;
|
|
544
577
|
dragPoint: IEditPoint;
|
|
545
578
|
dragStartData: IEditorDragStartData;
|
|
579
|
+
config: IEditorConfig;
|
|
580
|
+
readonly mergeConfig: IEditorConfig;
|
|
581
|
+
readonly mergedConfig: IEditorConfig;
|
|
582
|
+
target: IUI$1;
|
|
583
|
+
single: boolean;
|
|
584
|
+
transformTool: ITransformTool;
|
|
546
585
|
readonly flipped: boolean;
|
|
547
586
|
readonly flippedX: boolean;
|
|
548
587
|
readonly flippedY: boolean;
|
|
549
588
|
readonly flippedOne: boolean;
|
|
589
|
+
readonly canUse: boolean;
|
|
590
|
+
readonly canGesture: boolean;
|
|
550
591
|
getPointStyle(userStyle?: IBoxInputData$1): IBoxInputData$1;
|
|
551
592
|
getPointsStyle(): IBoxInputData$1[];
|
|
552
593
|
getMiddlePointsStyle(): IBoxInputData$1[];
|
|
553
594
|
load(): void;
|
|
554
|
-
update(
|
|
595
|
+
update(): void;
|
|
555
596
|
unload(): void;
|
|
556
597
|
onArrow(e: IKeyEvent): void;
|
|
557
598
|
}
|
|
@@ -656,7 +697,7 @@ interface IRobotKeyframe {
|
|
|
656
697
|
size?: number | ISizeData;
|
|
657
698
|
total?: number;
|
|
658
699
|
}
|
|
659
|
-
interface IRobotComputedKeyframe extends IBoundsData
|
|
700
|
+
interface IRobotComputedKeyframe extends IBoundsData {
|
|
660
701
|
view: any;
|
|
661
702
|
}
|
|
662
703
|
interface IRobotData extends IRobotAttrData, IRectData {
|
|
@@ -743,7 +784,7 @@ interface ITextData extends ITextAttrData, ITextStyleComputedData, IUIData {
|
|
|
743
784
|
__padding?: number[];
|
|
744
785
|
__clipText?: boolean;
|
|
745
786
|
__isPlacehold?: boolean;
|
|
746
|
-
__textBoxBounds?: IBoundsData
|
|
787
|
+
__textBoxBounds?: IBoundsData;
|
|
747
788
|
}
|
|
748
789
|
interface ITextInputData extends ITextAttrData, ITextStyleInputData, IUIBaseInputData {
|
|
749
790
|
}
|
|
@@ -777,7 +818,7 @@ interface ITextCharData {
|
|
|
777
818
|
char?: string;
|
|
778
819
|
}
|
|
779
820
|
interface ITextDrawData {
|
|
780
|
-
bounds: IBoundsData
|
|
821
|
+
bounds: IBoundsData;
|
|
781
822
|
rows: ITextRowData[];
|
|
782
823
|
paraNumber: number;
|
|
783
824
|
font: string;
|
|
@@ -833,6 +874,8 @@ interface IFrameInputData extends IBoxInputData {
|
|
|
833
874
|
}
|
|
834
875
|
interface IBox extends IBoxAttrData, IGroup {
|
|
835
876
|
__: IBoxData;
|
|
877
|
+
scrollBar?: IGroup;
|
|
878
|
+
__updateScrollBar(): void;
|
|
836
879
|
__updateRectRenderBounds(): void;
|
|
837
880
|
__renderGroup(canvas: ILeaferCanvas, options: IRenderOptions): void;
|
|
838
881
|
}
|
|
@@ -848,6 +891,7 @@ interface IBoxInputData extends IBoxAttrData, IGroupInputData {
|
|
|
848
891
|
interface IGroup extends IUI {
|
|
849
892
|
__: IGroupData;
|
|
850
893
|
children: IUI[];
|
|
894
|
+
childlessJSON?: boolean;
|
|
851
895
|
pick(hitPoint: IPointData, options?: IPickOptions): IPickResult;
|
|
852
896
|
add(child: IUI | IUI[] | IUIInputData | IUIInputData[], index?: number): void;
|
|
853
897
|
addAt(child: IUI | IUI[] | IUIInputData | IUIInputData[], index: number): void;
|
|
@@ -935,8 +979,9 @@ interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
|
|
|
935
979
|
__isFills?: boolean;
|
|
936
980
|
__isStrokes?: boolean;
|
|
937
981
|
readonly __strokeWidth: number;
|
|
938
|
-
readonly
|
|
939
|
-
|
|
982
|
+
readonly __maxStrokeWidth: number;
|
|
983
|
+
__hasMultiStrokeStyle?: number;
|
|
984
|
+
readonly __hasMultiPaint?: boolean;
|
|
940
985
|
__isAlphaPixelFill?: boolean;
|
|
941
986
|
__isAlphaPixelStroke?: boolean;
|
|
942
987
|
__isTransparentFill?: boolean;
|
|
@@ -954,6 +999,7 @@ interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
|
|
|
954
999
|
__textDrawData?: ITextDrawData;
|
|
955
1000
|
__needComputePaint?: boolean;
|
|
956
1001
|
__computePaint(): void;
|
|
1002
|
+
__getRealStrokeWidth(childStyle?: IStrokeComputedStyle): number;
|
|
957
1003
|
__setPaint(attrName: 'fill' | 'stroke', value: IValue): void;
|
|
958
1004
|
__removePaint(attrName: 'fill' | 'stroke', removeInput?: boolean): void;
|
|
959
1005
|
}
|
|
@@ -1085,7 +1131,7 @@ interface IStateModule {
|
|
|
1085
1131
|
|
|
1086
1132
|
interface ICachedShape extends ICachedLeaf {
|
|
1087
1133
|
worldCanvas?: ILeaferCanvas;
|
|
1088
|
-
shapeBounds: IBoundsData
|
|
1134
|
+
shapeBounds: IBoundsData;
|
|
1089
1135
|
scaleX: number;
|
|
1090
1136
|
scaleY: number;
|
|
1091
1137
|
}
|
|
@@ -1104,21 +1150,21 @@ interface IPaintModule {
|
|
|
1104
1150
|
shape(ui: IUI, current: ILeaferCanvas, renderOptions: IRenderOptions): ICachedShape;
|
|
1105
1151
|
}
|
|
1106
1152
|
interface IPaintImageModule {
|
|
1107
|
-
image(ui: IUI, attrName: string, paint: IImagePaint, boxBounds: IBoundsData
|
|
1153
|
+
image(ui: IUI, attrName: string, paint: IImagePaint, boxBounds: IBoundsData, firstUse: boolean): ILeafPaint;
|
|
1108
1154
|
checkImage(ui: IUI, canvas: ILeaferCanvas, paint: ILeafPaint, allowPaint?: boolean): boolean;
|
|
1109
1155
|
createPattern(ui: IUI, paint: ILeafPaint, pixelRatio: number): boolean;
|
|
1110
1156
|
recycleImage(attrName: IPaintAttr, data: IUIData): IBooleanMap;
|
|
1111
|
-
createData(leafPaint: ILeafPaint, image: ILeaferImage, paint: IImagePaint, box: IBoundsData
|
|
1112
|
-
getPatternData(paint: IImagePaint, box: IBoundsData
|
|
1113
|
-
fillOrFitMode(data: ILeafPaintPatternData, box: IBoundsData
|
|
1114
|
-
clipMode(data: ILeafPaintPatternData, box: IBoundsData
|
|
1115
|
-
repeatMode(data: ILeafPaintPatternData, box: IBoundsData
|
|
1157
|
+
createData(leafPaint: ILeafPaint, image: ILeaferImage, paint: IImagePaint, box: IBoundsData): void;
|
|
1158
|
+
getPatternData(paint: IImagePaint, box: IBoundsData, image: ILeaferImage): ILeafPaintPatternData;
|
|
1159
|
+
fillOrFitMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number): void;
|
|
1160
|
+
clipMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number, skew: IPointData, clipSize?: ISizeData): void;
|
|
1161
|
+
repeatMode(data: ILeafPaintPatternData, box: IBoundsData, width: number, height: number, x: number, y: number, scaleX: number, scaleY: number, rotation: number, around: IAround): void;
|
|
1116
1162
|
}
|
|
1117
1163
|
interface IPaintGradientModule {
|
|
1118
|
-
linearGradient(paint: IGradientPaint, box: IBoundsData
|
|
1119
|
-
radialGradient(paint: IGradientPaint, box: IBoundsData
|
|
1120
|
-
conicGradient(paint: IGradientPaint, box: IBoundsData
|
|
1121
|
-
getTransform(box: IBoundsData
|
|
1164
|
+
linearGradient(paint: IGradientPaint, box: IBoundsData): ILeafPaint;
|
|
1165
|
+
radialGradient(paint: IGradientPaint, box: IBoundsData): ILeafPaint;
|
|
1166
|
+
conicGradient(paint: IGradientPaint, box: IBoundsData): ILeafPaint;
|
|
1167
|
+
getTransform(box: IBoundsData, from: IPointData, to: IPointData, stretch: number, rotate90: boolean): IMatrixData;
|
|
1122
1168
|
}
|
|
1123
1169
|
|
|
1124
1170
|
interface IEffectModule {
|
|
@@ -1145,4 +1191,4 @@ interface IFilterFunction {
|
|
|
1145
1191
|
(filter: IFilter, ui: IUI, bounds: IMatrixWithBoundsScaleData, currentCanvas: ILeaferCanvas, originCanvas: ILeaferCanvas, shape: ICachedShape): void;
|
|
1146
1192
|
}
|
|
1147
1193
|
|
|
1148
|
-
export type { IAnimate, IAnimateKeyframe, IAnimateList, IAnimateType, IAnimation, IApp, IAppConfig, IAppData, IAppForEachFunction, IAppInputData, IArrow, IArrowData, IArrowInputData, IArrowType, IBackgroundBoxStyle, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, IColorString, IComputedKeyframe, ICornerRadiusString, IDashPatternString, IEditBoxBase, IEditPoint, IEditPointInputData, IEditPointType, IEditToolFunction, IEditorBase, IEditorBeforeMove, IEditorBeforeRotate, IEditorBeforeScale, IEditorBeforeSelect, IEditorBeforeSkew, IEditorConfig, IEditorConfigFunction, IEditorDragStartData, IEditorMoveData, IEditorRotationData, IEditorScaleData, IEditorSelectData, IEditorSkewData, IEffect, IEffectAttrData, IEffectComputedData, IEffectInputData, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IFill, IFilterFunction, IFilterModule, IFilterProcessor, IFindUIMethod, IFlow, IFlowData, IFlowInputData, IFontWeight, IFontWeightNumer, IFontWeightString, IFrame, IFrameData, IFrameInputData, IFrameRenderModule, IGIF, IGIFData, IGIFInputData, IGradientPaint, IGradientType, IGrayscaleEffect, IGroup, IGroupData, IGroupInputData, IGroupRenderModule, IImage, IImageData, IImageFilters, IImageInputData, IImagePaint, IImagePaintMode, IImageRenderModule, IKeyframe, IKeyframeId, IKeyframesAnimation, ILeafFill, ILeafPaint, ILeafPaintColor, ILeafPaintPatternData, ILeafShadowEffect, ILeafStrokePaint, ILeafer, ILeaferData, ILeaferInputData, ILine, ILineData, ILineInputData, IOverflow, IPaint, IPaintAttr, IPaintBase, IPaintGradientModule, IPaintImageModule, IPaintModule, IPaintString, IPaintType, IPath, IPathArrowModule, IPathData, IPathDataArrow, IPathDataArrowMap, IPathDataArrowOffset, IPathInputData, IPen, IPenData, IPenInputData, IPercent, IPolygon, IPolygonData, IPolygonInputData, IRGB, IRGBA, IRect, IRectData, IRectInputData, IRectRenderModule, IRepeat, IRobot, IRobotActionName, IRobotActions, IRobotAnimation, IRobotComputedKeyframe, IRobotData, IRobotInputData, IRobotKeyframe, IShadowEffect, IShadowString, ISolidPaint, IStar, IStarData, IStarInputData, IStateModule, IStateName, IStateStyle, IStates, IStroke, IStrokeAlign, IStrokeAttrData, IStrokeCap, IStrokeComputedData, IStrokeInputData, IStrokeJoin, IStrokeWidthString, IStyleAnimation, IText, ITextAlign, ITextCase, ITextCharData, ITextConvertModule, ITextData, ITextDecoration, ITextDecorationData, ITextDecorationType, ITextDrawData, ITextInputData, ITextRenderModule, ITextRowData, ITextStyleAttrData, ITextStyleComputedData, ITextStyleInputData, ITextWordData, ITextWrap, ITransitionFunction, ITransitionMap, ITransitionModule, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIJSONData, IUIRenderModule, IUITag, IVectorPath, IVerticalAlign, IVideo, IVideoData, IVideoInputData, IWritingMode };
|
|
1194
|
+
export type { IAnimate, IAnimateKeyframe, IAnimateList, IAnimateType, IAnimation, IApp, IAppConfig, IAppData, IAppForEachFunction, IAppInputData, IArrow, IArrowData, IArrowInputData, IArrowType, IBackgroundBoxStyle, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, IColorString, IComputedKeyframe, ICornerRadiusString, IDashPatternString, IEditBoxBase, IEditPoint, IEditPointInputData, IEditPointType, IEditToolFunction, IEditorBase, IEditorBeforeMove, IEditorBeforeRotate, IEditorBeforeScale, IEditorBeforeSelect, IEditorBeforeSkew, IEditorConfig, IEditorConfigFunction, IEditorDragStartData, IEditorMoveData, IEditorRotationData, IEditorScaleData, IEditorSelectData, IEditorSkewData, IEffect, IEffectAttrData, IEffectComputedData, IEffectInputData, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IFill, IFilterFunction, IFilterModule, IFilterProcessor, IFindUIMethod, IFlow, IFlowData, IFlowInputData, IFontWeight, IFontWeightNumer, IFontWeightString, IFrame, IFrameData, IFrameInputData, IFrameRenderModule, IGIF, IGIFData, IGIFInputData, IGradientPaint, IGradientType, IGrayscaleEffect, IGroup, IGroupData, IGroupInputData, IGroupRenderModule, IImage, IImageData, IImageFilters, IImageInputData, IImagePaint, IImagePaintMode, IImageRenderModule, IKeyframe, IKeyframeId, IKeyframesAnimation, ILeafFill, ILeafPaint, ILeafPaintColor, ILeafPaintPatternData, ILeafShadowEffect, ILeafStrokePaint, ILeafer, ILeaferData, ILeaferInputData, ILine, ILineData, ILineInputData, IOverflow, IPaint, IPaintAttr, IPaintBase, IPaintGradientModule, IPaintImageModule, IPaintModule, IPaintString, IPaintType, IPath, IPathArrowModule, IPathData, IPathDataArrow, IPathDataArrowMap, IPathDataArrowOffset, IPathInputData, IPen, IPenData, IPenInputData, IPercent, IPolygon, IPolygonData, IPolygonInputData, IRGB, IRGBA, IRect, IRectData, IRectInputData, IRectRenderModule, IRepeat, IRobot, IRobotActionName, IRobotActions, IRobotAnimation, IRobotComputedKeyframe, IRobotData, IRobotInputData, IRobotKeyframe, IShadowEffect, IShadowString, ISolidPaint, IStar, IStarData, IStarInputData, IStateModule, IStateName, IStateStyle, IStates, IStroke, IStrokeAlign, IStrokeAttrData, IStrokeCap, IStrokeComputedData, IStrokeComputedStyle, IStrokeGradientPaint, IStrokeImagePaint, IStrokeInputData, IStrokeJoin, IStrokePaint, IStrokeSolidPaint, IStrokeStyle, IStrokeWidthString, IStyleAnimation, IText, ITextAlign, ITextCase, ITextCharData, ITextConvertModule, ITextData, ITextDecoration, ITextDecorationData, ITextDecorationType, ITextDrawData, ITextInputData, ITextRenderModule, ITextRowData, ITextStyleAttrData, ITextStyleComputedData, ITextStyleInputData, ITextWordData, ITextWrap, ITransformTool, ITransitionFunction, ITransitionMap, ITransitionModule, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIJSONData, IUIRenderModule, IUITag, IVectorPath, IVerticalAlign, IVideo, IVideoData, IVideoInputData, IWritingMode };
|