@leafer-ui/interface 1.7.0 → 1.9.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/ICachedShape.ts +1 -1
- package/src/ICommonAttr.ts +16 -19
- package/src/IUI.ts +10 -2
- package/src/editor/IEditor.ts +36 -10
- package/src/index.ts +2 -2
- package/src/module/IPaint.ts +3 -3
- package/src/type/IComputedType.ts +6 -1
- package/src/type/IType.ts +23 -5
- package/types/index.d.ts +72 -31
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/interface",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.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.9.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/ICachedShape.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ILeaferCanvas, IBoundsData, ICachedLeaf } from '@leafer/interface'
|
|
2
2
|
|
|
3
3
|
export interface ICachedShape extends ICachedLeaf {
|
|
4
|
-
worldCanvas?: ILeaferCanvas
|
|
4
|
+
worldCanvas?: ILeaferCanvas // 元素太大放不下,经过裁剪后的元素区域缓存画布
|
|
5
5
|
shapeBounds: IBoundsData
|
|
6
6
|
scaleX: number
|
|
7
7
|
scaleY: number
|
package/src/ICommonAttr.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { INumber, IBoolean, IString, IFourNumber, IUnitData } from '@leafer/interface'
|
|
1
|
+
import { INumber, IBoolean, IString, IFourNumber, IUnitData, IScaleFixed } from '@leafer/interface'
|
|
2
2
|
import { IStrokeAlign, IStrokeCap, IStrokeJoin, IBlurEffect, IFontWeight, ITextCase, ITextDecoration, IShadowEffect, IGrayscaleEffect, ITextAlign, IVerticalAlign, IOverflow, ITextWrap, IStroke, IFill, IArrowType, IWritingMode } from './type/IType'
|
|
3
3
|
import { ILeafStrokePaint, ILeafShadowEffect, ILeafPaint } from './type/IComputedType'
|
|
4
4
|
import { IDashPatternString, IShadowString, IColorString, IStrokeWidthString, ICornerRadiusString } from './type/IStringType'
|
|
@@ -36,51 +36,48 @@ 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
|
-
strokeWidthFixed?:
|
|
56
|
+
strokeWidthFixed?: IScaleFixed
|
|
60
57
|
strokeCap?: IStrokeCap
|
|
61
58
|
strokeJoin?: IStrokeJoin
|
|
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[]
|
|
75
|
-
strokeWidthFixed?:
|
|
75
|
+
strokeWidthFixed?: IScaleFixed
|
|
76
76
|
strokeCap?: IStrokeCap
|
|
77
77
|
strokeJoin?: IStrokeJoin
|
|
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,7 +481,10 @@ export interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
|
|
|
477
481
|
__isFills?: boolean
|
|
478
482
|
__isStrokes?: boolean
|
|
479
483
|
|
|
480
|
-
readonly __strokeWidth: number
|
|
484
|
+
readonly __strokeWidth: number // 会受 strokeWidthFixed 影响
|
|
485
|
+
readonly __maxStrokeWidth: number
|
|
486
|
+
__hasMultiStrokeStyle?: number // 是否存在多个不同的描述样式(同时存储多个描边样式中的最大宽度用于运算)
|
|
487
|
+
readonly __hasMultiPaint?: boolean
|
|
481
488
|
|
|
482
489
|
__isAlphaPixelFill?: boolean // png / svg / webp
|
|
483
490
|
__isAlphaPixelStroke?: boolean
|
|
@@ -504,6 +511,7 @@ export interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
|
|
|
504
511
|
|
|
505
512
|
__needComputePaint?: boolean
|
|
506
513
|
__computePaint(): void
|
|
514
|
+
__getRealStrokeWidth(childStyle?: IStrokeComputedStyle): number
|
|
507
515
|
|
|
508
516
|
__setPaint(attrName: 'fill' | 'stroke', value: IValue): void
|
|
509
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, IMoveEvent, IRotateEvent, IStroke, IFill, ILeaf, ILeafList, IObject, IBoxInputData, IGroupInputData, IImageCursor, IRect, IKeyEvent, IUIInputData, IZoomEvent, IColorString, IDirection4, IPointData, IScaleData, ISkewData, ILayoutBoundsData, ITransition } from '@leafer-ui/interface'
|
|
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, IShortcutKeys, IShortcutKeysCheck, IUIEvent } from '@leafer-ui/interface'
|
|
2
2
|
|
|
3
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, ITransformTool {
|
|
|
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,6 +49,7 @@ export interface IEditorBase extends IGroup, ISelectorProxy, ITransformTool {
|
|
|
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
|
|
|
@@ -51,8 +58,8 @@ export interface IEditorBase extends IGroup, ISelectorProxy, ITransformTool {
|
|
|
51
58
|
openGroup(group: IGroup): void
|
|
52
59
|
closeGroup(group: IGroup): void
|
|
53
60
|
|
|
54
|
-
openInnerEditor(target?: IUI, select?: boolean): void
|
|
55
|
-
closeInnerEditor(): void
|
|
61
|
+
openInnerEditor(target?: IUI, nameOrSelect?: string | boolean, select?: boolean): void
|
|
62
|
+
closeInnerEditor(onlyInnerEditor?: boolean): void
|
|
56
63
|
|
|
57
64
|
lock(): void
|
|
58
65
|
unlock(): void
|
|
@@ -84,6 +91,8 @@ export interface IEditorConfig extends IObject {
|
|
|
84
91
|
stroke?: IStroke
|
|
85
92
|
strokeWidth?: number
|
|
86
93
|
|
|
94
|
+
spread?: IFourNumber // 扩张编辑框的大小,与实际元素之间产生一定的间隙
|
|
95
|
+
|
|
87
96
|
pointFill?: IFill
|
|
88
97
|
pointSize?: number
|
|
89
98
|
pointRadius?: number
|
|
@@ -106,15 +115,19 @@ export interface IEditorConfig extends IObject {
|
|
|
106
115
|
|
|
107
116
|
hideOnMove?: boolean
|
|
108
117
|
hideOnSmall?: boolean | number
|
|
118
|
+
hideRotatePoints?: boolean // 是否隐藏透明的旋转控制点
|
|
119
|
+
hideResizeLines?: boolean // 是否隐藏透明的resize线条
|
|
109
120
|
|
|
110
121
|
moveCursor?: ICursorType
|
|
111
122
|
resizeCursor?: IImageCursor
|
|
112
123
|
rotateCursor?: IImageCursor
|
|
113
124
|
skewCursor?: IImageCursor
|
|
114
125
|
|
|
115
|
-
around?: IAlign | IUnitPointData
|
|
116
|
-
|
|
126
|
+
around?: IAlign | IUnitPointData // 缩放、旋转、倾斜时围绕的中心点
|
|
127
|
+
rotateAround?: IAlign | IUnitPointData // 单独设置旋转围绕的中心点,比 around 优先级高
|
|
117
128
|
rotateGap?: number
|
|
129
|
+
lockRatio?: boolean | 'corner'
|
|
130
|
+
dragLimitAnimate?: boolean | number // 限制拖动范围的元素,可在拖拽结束时进行动画归位,默认采用 app.config.pointer.dragLimitAnimate 的值
|
|
118
131
|
|
|
119
132
|
selector?: boolean
|
|
120
133
|
editBox?: boolean
|
|
@@ -123,16 +136,20 @@ export interface IEditorConfig extends IObject {
|
|
|
123
136
|
select?: 'press' | 'tap'
|
|
124
137
|
selectedStyle?: IUIInputData
|
|
125
138
|
multipleSelect?: boolean
|
|
139
|
+
|
|
126
140
|
boxSelect?: boolean
|
|
127
141
|
continuousSelect?: boolean // 点击可以连续选择
|
|
128
142
|
openInner?: 'double' | 'long' // 双击/长按打开内部
|
|
129
143
|
|
|
130
|
-
moveable?: boolean | 'move'
|
|
131
|
-
resizeable?: boolean | 'zoom'
|
|
144
|
+
moveable?: boolean | 'gesture' | 'move'
|
|
145
|
+
resizeable?: boolean | 'gesture' | 'zoom'
|
|
132
146
|
flipable?: boolean
|
|
133
|
-
rotateable?: boolean | 'rotate'
|
|
147
|
+
rotateable?: boolean | 'gesture' | 'rotate'
|
|
134
148
|
skewable?: boolean
|
|
135
149
|
|
|
150
|
+
multipleSelectKey?: IShortcutKeysCheck | IShortcutKeys
|
|
151
|
+
rotateKey?: IShortcutKeysCheck | IShortcutKeys
|
|
152
|
+
|
|
136
153
|
beforeSelect?: IEditorBeforeSelect
|
|
137
154
|
beforeMove?: IEditorBeforeMove
|
|
138
155
|
beforeScale?: IEditorBeforeScale
|
|
@@ -206,7 +223,12 @@ export interface IEditBoxBase extends IGroup {
|
|
|
206
223
|
editor: IEditorBase
|
|
207
224
|
|
|
208
225
|
dragging: boolean
|
|
226
|
+
gesturing: boolean // 手势操作元素中
|
|
227
|
+
|
|
209
228
|
moving: boolean
|
|
229
|
+
resizing: boolean
|
|
230
|
+
rotating: boolean
|
|
231
|
+
skewing: boolean
|
|
210
232
|
|
|
211
233
|
view: IGroup // 放置默认编辑工具控制点
|
|
212
234
|
|
|
@@ -238,6 +260,9 @@ export interface IEditBoxBase extends IGroup {
|
|
|
238
260
|
readonly flippedY: boolean
|
|
239
261
|
readonly flippedOne: boolean
|
|
240
262
|
|
|
263
|
+
readonly canUse: boolean // 编辑框是否处于激活状态
|
|
264
|
+
readonly canGesture: boolean // 是否支持手势
|
|
265
|
+
|
|
241
266
|
getPointStyle(userStyle?: IBoxInputData): IBoxInputData
|
|
242
267
|
getPointsStyle(): IBoxInputData[]
|
|
243
268
|
getMiddlePointsStyle(): IBoxInputData[]
|
|
@@ -247,6 +272,7 @@ export interface IEditBoxBase extends IGroup {
|
|
|
247
272
|
unload(): void
|
|
248
273
|
|
|
249
274
|
onArrow(e: IKeyEvent): void
|
|
275
|
+
isHoldRotateKey(e: IUIEvent): boolean
|
|
250
276
|
|
|
251
277
|
}
|
|
252
278
|
|
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
|
|
package/src/module/IPaint.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ILeaferCanvas, IRenderOptions, IBooleanMap, IBoundsData, ILeaferImage,
|
|
1
|
+
import { ILeaferCanvas, IRenderOptions, IBooleanMap, IBoundsData, ILeaferImage, IAlign, IPointData, IMatrixData, ISizeData } from '@leafer/interface'
|
|
2
2
|
|
|
3
3
|
import { ILeafPaint, ILeafPaintPatternData } from '../type/IComputedType'
|
|
4
4
|
import { IUI, IUIData } from '../IUI'
|
|
@@ -35,8 +35,8 @@ 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, skew: IPointData): void
|
|
39
|
-
repeatMode(data: ILeafPaintPatternData, box: IBoundsData, width: number, height: number, x: number, y: number, scaleX: number, scaleY: number, rotation: number,
|
|
38
|
+
clipMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number, skew: IPointData, clipSize?: ISizeData): void
|
|
39
|
+
repeatMode(data: ILeafPaintPatternData, box: IBoundsData, width: number, height: number, x: number, y: number, scaleX: number, scaleY: number, rotation: number, skew: IPointData, align: IAlign, freeTransform?: boolean): void
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
export interface IPaintGradientModule {
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { IBlendMode, ILeaferImage, IMatrixData, ITaskItem } from '@leafer/interface'
|
|
1
|
+
import { IBlendMode, ILeaferImage, IMatrixData, IPointData, IScaleFixed, ITaskItem } from '@leafer/interface'
|
|
2
2
|
|
|
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
|
|
13
|
+
strokeStyle?: IStrokeComputedStyle // 子描边样式选项
|
|
12
14
|
transform?: IMatrixData // 存在时表示pattern自身不能应用transform
|
|
13
15
|
blendMode?: IBlendMode
|
|
14
16
|
image?: ILeaferImage
|
|
@@ -20,6 +22,7 @@ export interface ILeafPaint {
|
|
|
20
22
|
isTransparent?: boolean // 是否为透明色
|
|
21
23
|
data?: ILeafPaintPatternData
|
|
22
24
|
editing?: boolean // 标记编辑中
|
|
25
|
+
scaleFixed?: IScaleFixed // 平铺图片不跟随画布缩放
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
export interface ILeafPaintPatternData {
|
|
@@ -27,6 +30,7 @@ export interface ILeafPaintPatternData {
|
|
|
27
30
|
height?: number
|
|
28
31
|
scaleX?: number
|
|
29
32
|
scaleY?: number
|
|
33
|
+
gap?: IPointData
|
|
30
34
|
opacity?: number
|
|
31
35
|
transform?: IMatrixData
|
|
32
36
|
filters?: IImageFilters
|
|
@@ -53,4 +57,5 @@ export interface ILeafShadowEffect {
|
|
|
53
57
|
color: IColorString
|
|
54
58
|
blendMode?: IBlendMode
|
|
55
59
|
box?: boolean
|
|
60
|
+
scaleFixed?: IScaleFixed
|
|
56
61
|
}
|
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, IGap, IPointGap, IScaleFixed } 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
|
|
@@ -77,14 +88,20 @@ export interface IImagePaint extends IPaintBase {
|
|
|
77
88
|
rotation?: number
|
|
78
89
|
skew?: | IPointData
|
|
79
90
|
|
|
91
|
+
freeTransform?: boolean // 平铺模式下是否进行自由变换,默认90度、缩放会进行特殊处理
|
|
92
|
+
|
|
93
|
+
clipSize?: ISizeData
|
|
94
|
+
|
|
80
95
|
repeat?: IRepeat
|
|
96
|
+
gap?: IGap | IPointGap
|
|
97
|
+
scaleFixed?: IScaleFixed // 平铺图片不跟随画布缩放
|
|
81
98
|
|
|
82
99
|
changeful?: boolean // 会频繁变化,不生成图案(有特殊性能优化,一般用于游戏精灵、动图场景)
|
|
83
100
|
sync?: boolean // 同步显示,不走任务列表生成图案
|
|
84
101
|
showProgress?: boolean // 是否显示进度
|
|
85
|
-
|
|
86
|
-
editing?: boolean // 标记编辑中
|
|
87
102
|
}
|
|
103
|
+
|
|
104
|
+
export interface IStrokeImagePaint extends IImagePaint { }
|
|
88
105
|
export interface IImageFilters {
|
|
89
106
|
exposure?: number // 曝光
|
|
90
107
|
contrast?: number // 对比度
|
|
@@ -95,7 +112,7 @@ export interface IImageFilters {
|
|
|
95
112
|
shadows?: number // 阴影
|
|
96
113
|
}
|
|
97
114
|
export type IImagePaintMode = 'normal' | 'cover' | 'fit' | 'stretch' | 'clip' | 'repeat'
|
|
98
|
-
export type IRepeat = boolean | 'x' | 'y'
|
|
115
|
+
export type IRepeat = boolean | 'x' | 'y' | IPointData
|
|
99
116
|
|
|
100
117
|
// 描边
|
|
101
118
|
export type IStrokeAlign = 'inside' | 'outside' | 'center'
|
|
@@ -165,6 +182,7 @@ export interface IShadowEffect {
|
|
|
165
182
|
blendMode?: IBlendMode
|
|
166
183
|
visible?: boolean
|
|
167
184
|
box?: boolean
|
|
185
|
+
scaleFixed?: IScaleFixed
|
|
168
186
|
}
|
|
169
187
|
|
|
170
188
|
export interface IBlurEffect {
|
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,
|
|
1
|
+
import { IBlendMode, IAlign, IUnitPointData, IExportFileType, IFourNumber, IPointData, IOptionSizeData, ISizeData, IGap, IPointGap, IScaleFixed, IPathCommandData, IAxis, IAxisReverse, IWindingRule, IFilter, IMatrixData, ILeaferImage, ITaskItem, INumber, IString, IBoolean, 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, 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, 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';
|
|
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, IShortcutKeysCheck, IShortcutKeys, 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, IUIEvent, 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;
|
|
@@ -63,11 +70,16 @@ interface IImagePaint extends IPaintBase {
|
|
|
63
70
|
scale?: number | IPointData;
|
|
64
71
|
rotation?: number;
|
|
65
72
|
skew?: IPointData;
|
|
73
|
+
freeTransform?: boolean;
|
|
74
|
+
clipSize?: ISizeData;
|
|
66
75
|
repeat?: IRepeat;
|
|
76
|
+
gap?: IGap | IPointGap;
|
|
77
|
+
scaleFixed?: IScaleFixed;
|
|
67
78
|
changeful?: boolean;
|
|
68
79
|
sync?: boolean;
|
|
69
80
|
showProgress?: boolean;
|
|
70
|
-
|
|
81
|
+
}
|
|
82
|
+
interface IStrokeImagePaint extends IImagePaint {
|
|
71
83
|
}
|
|
72
84
|
interface IImageFilters {
|
|
73
85
|
exposure?: number;
|
|
@@ -79,7 +91,7 @@ interface IImageFilters {
|
|
|
79
91
|
shadows?: number;
|
|
80
92
|
}
|
|
81
93
|
type IImagePaintMode = 'normal' | 'cover' | 'fit' | 'stretch' | 'clip' | 'repeat';
|
|
82
|
-
type IRepeat = boolean | 'x' | 'y';
|
|
94
|
+
type IRepeat = boolean | 'x' | 'y' | IPointData;
|
|
83
95
|
type IStrokeAlign = 'inside' | 'outside' | 'center';
|
|
84
96
|
type IStrokeCap = 'none' | 'round' | 'square';
|
|
85
97
|
type IStrokeJoin = 'bevel' | 'round' | 'miter';
|
|
@@ -125,6 +137,7 @@ interface IShadowEffect {
|
|
|
125
137
|
blendMode?: IBlendMode;
|
|
126
138
|
visible?: boolean;
|
|
127
139
|
box?: boolean;
|
|
140
|
+
scaleFixed?: IScaleFixed;
|
|
128
141
|
}
|
|
129
142
|
interface IBlurEffect {
|
|
130
143
|
blur: number;
|
|
@@ -142,6 +155,7 @@ type ILeafPaintColor = IColorString | CanvasGradient | CanvasPattern;
|
|
|
142
155
|
interface ILeafPaint {
|
|
143
156
|
type?: IPaintType;
|
|
144
157
|
style?: ILeafPaintColor;
|
|
158
|
+
strokeStyle?: IStrokeComputedStyle;
|
|
145
159
|
transform?: IMatrixData;
|
|
146
160
|
blendMode?: IBlendMode;
|
|
147
161
|
image?: ILeaferImage;
|
|
@@ -153,12 +167,14 @@ interface ILeafPaint {
|
|
|
153
167
|
isTransparent?: boolean;
|
|
154
168
|
data?: ILeafPaintPatternData;
|
|
155
169
|
editing?: boolean;
|
|
170
|
+
scaleFixed?: IScaleFixed;
|
|
156
171
|
}
|
|
157
172
|
interface ILeafPaintPatternData {
|
|
158
173
|
width?: number;
|
|
159
174
|
height?: number;
|
|
160
175
|
scaleX?: number;
|
|
161
176
|
scaleY?: number;
|
|
177
|
+
gap?: IPointData;
|
|
162
178
|
opacity?: number;
|
|
163
179
|
transform?: IMatrixData;
|
|
164
180
|
filters?: IImageFilters;
|
|
@@ -182,6 +198,7 @@ interface ILeafShadowEffect {
|
|
|
182
198
|
color: IColorString;
|
|
183
199
|
blendMode?: IBlendMode;
|
|
184
200
|
box?: boolean;
|
|
201
|
+
scaleFixed?: IScaleFixed;
|
|
185
202
|
}
|
|
186
203
|
|
|
187
204
|
interface ICornerRadiusAttrData {
|
|
@@ -209,45 +226,41 @@ interface IBorderComputedData {
|
|
|
209
226
|
borderWidth?: number | number[];
|
|
210
227
|
borderRadius?: number | number[];
|
|
211
228
|
}
|
|
212
|
-
interface IStrokeAttrData {
|
|
229
|
+
interface IStrokeAttrData extends IStrokeStyle {
|
|
213
230
|
stroke?: IStroke;
|
|
214
|
-
strokeAlign?: IStrokeAlign;
|
|
215
|
-
strokeWidth?: IFourNumber | IStrokeWidthString;
|
|
216
|
-
strokeWidthFixed?: IBoolean;
|
|
217
|
-
strokeCap?: IStrokeCap;
|
|
218
|
-
strokeJoin?: IStrokeJoin;
|
|
219
|
-
dashPattern?: INumber[] | IDashPatternString;
|
|
220
|
-
dashOffset?: INumber;
|
|
221
|
-
miterLimit?: INumber;
|
|
222
231
|
startArrow?: IArrowType;
|
|
223
232
|
endArrow?: IArrowType;
|
|
224
233
|
}
|
|
225
|
-
interface IStrokeInputData {
|
|
234
|
+
interface IStrokeInputData extends IStrokeStyle {
|
|
226
235
|
stroke?: IStroke;
|
|
236
|
+
startArrow?: IArrowType;
|
|
237
|
+
endArrow?: IArrowType;
|
|
238
|
+
}
|
|
239
|
+
interface IStrokeStyle {
|
|
227
240
|
strokeAlign?: IStrokeAlign;
|
|
228
241
|
strokeWidth?: IFourNumber | IStrokeWidthString;
|
|
229
|
-
strokeWidthFixed?:
|
|
242
|
+
strokeWidthFixed?: IScaleFixed;
|
|
230
243
|
strokeCap?: IStrokeCap;
|
|
231
244
|
strokeJoin?: IStrokeJoin;
|
|
232
245
|
dashPattern?: INumber[] | IDashPatternString;
|
|
233
246
|
dashOffset?: INumber;
|
|
234
247
|
miterLimit?: INumber;
|
|
248
|
+
}
|
|
249
|
+
interface IStrokeComputedData extends IStrokeComputedStyle {
|
|
250
|
+
stroke?: IColorString | ILeafStrokePaint[];
|
|
235
251
|
startArrow?: IArrowType;
|
|
236
252
|
endArrow?: IArrowType;
|
|
237
253
|
}
|
|
238
|
-
interface
|
|
239
|
-
stroke?: IColorString | ILeafStrokePaint[];
|
|
254
|
+
interface IStrokeComputedStyle {
|
|
240
255
|
strokeAlign?: IStrokeAlign;
|
|
241
256
|
strokeWidth?: number;
|
|
242
257
|
strokeWidths?: number[];
|
|
243
|
-
strokeWidthFixed?:
|
|
258
|
+
strokeWidthFixed?: IScaleFixed;
|
|
244
259
|
strokeCap?: IStrokeCap;
|
|
245
260
|
strokeJoin?: IStrokeJoin;
|
|
246
261
|
dashPattern?: number[];
|
|
247
262
|
dashOffset?: number;
|
|
248
263
|
miterLimit?: number;
|
|
249
|
-
startArrow?: IArrowType;
|
|
250
|
-
endArrow?: IArrowType;
|
|
251
264
|
}
|
|
252
265
|
interface ITextStyleAttrData {
|
|
253
266
|
fontFamily?: IString;
|
|
@@ -360,6 +373,7 @@ interface IComputedKeyframe {
|
|
|
360
373
|
}
|
|
361
374
|
interface IAnimate extends IAnimateOptions, IEventer {
|
|
362
375
|
target: IUI | IObject;
|
|
376
|
+
parent?: IAnimateList;
|
|
363
377
|
keyframes: IKeyframe[];
|
|
364
378
|
config?: IAnimateOptions;
|
|
365
379
|
event?: IEventParamsMap;
|
|
@@ -386,6 +400,7 @@ interface IAnimate extends IAnimateOptions, IEventer {
|
|
|
386
400
|
interface IAnimateList extends IAnimate {
|
|
387
401
|
list: IAnimate[];
|
|
388
402
|
updateList(animation?: IAnimation[] | IAnimate[], isTemp?: boolean): void;
|
|
403
|
+
onChildEvent(type: string, _animate: IAnimate): void;
|
|
389
404
|
}
|
|
390
405
|
|
|
391
406
|
interface IEditorBase extends IGroup$1, ISelectorProxy, ITransformTool {
|
|
@@ -402,9 +417,13 @@ interface IEditorBase extends IGroup$1, ISelectorProxy, ITransformTool {
|
|
|
402
417
|
readonly groupOpening: boolean;
|
|
403
418
|
readonly multiple: boolean;
|
|
404
419
|
readonly single: boolean;
|
|
420
|
+
readonly dragPoint: IEditPoint;
|
|
405
421
|
readonly dragging: boolean;
|
|
422
|
+
readonly gesturing: boolean;
|
|
406
423
|
readonly moving: boolean;
|
|
407
|
-
readonly
|
|
424
|
+
readonly resizing: boolean;
|
|
425
|
+
readonly rotating: boolean;
|
|
426
|
+
readonly skewing: boolean;
|
|
408
427
|
element?: IUI$1;
|
|
409
428
|
buttons: IGroup$1;
|
|
410
429
|
selector: IGroup$1;
|
|
@@ -421,13 +440,14 @@ interface IEditorBase extends IGroup$1, ISelectorProxy, ITransformTool {
|
|
|
421
440
|
update(): void;
|
|
422
441
|
updateEditBox(): void;
|
|
423
442
|
updateEditTool(): void;
|
|
443
|
+
unloadEditTool(): void;
|
|
424
444
|
getEditSize(ui: ILeaf): IEditSize;
|
|
425
445
|
group(group?: IGroup$1 | IGroupInputData$1): IGroup$1;
|
|
426
446
|
ungroup(): IUI$1[];
|
|
427
447
|
openGroup(group: IGroup$1): void;
|
|
428
448
|
closeGroup(group: IGroup$1): void;
|
|
429
|
-
openInnerEditor(target?: IUI$1, select?: boolean): void;
|
|
430
|
-
closeInnerEditor(): void;
|
|
449
|
+
openInnerEditor(target?: IUI$1, nameOrSelect?: string | boolean, select?: boolean): void;
|
|
450
|
+
closeInnerEditor(onlyInnerEditor?: boolean): void;
|
|
431
451
|
lock(): void;
|
|
432
452
|
unlock(): void;
|
|
433
453
|
toTop(): void;
|
|
@@ -450,6 +470,7 @@ interface IEditorConfig extends IObject$1 {
|
|
|
450
470
|
keyEvent?: boolean;
|
|
451
471
|
stroke?: IStroke$1;
|
|
452
472
|
strokeWidth?: number;
|
|
473
|
+
spread?: IFourNumber$1;
|
|
453
474
|
pointFill?: IFill$1;
|
|
454
475
|
pointSize?: number;
|
|
455
476
|
pointRadius?: number;
|
|
@@ -467,13 +488,17 @@ interface IEditorConfig extends IObject$1 {
|
|
|
467
488
|
buttonsMargin?: number;
|
|
468
489
|
hideOnMove?: boolean;
|
|
469
490
|
hideOnSmall?: boolean | number;
|
|
491
|
+
hideRotatePoints?: boolean;
|
|
492
|
+
hideResizeLines?: boolean;
|
|
470
493
|
moveCursor?: ICursorType;
|
|
471
494
|
resizeCursor?: IImageCursor;
|
|
472
495
|
rotateCursor?: IImageCursor;
|
|
473
496
|
skewCursor?: IImageCursor;
|
|
474
497
|
around?: IAlign$1 | IUnitPointData$1;
|
|
475
|
-
|
|
498
|
+
rotateAround?: IAlign$1 | IUnitPointData$1;
|
|
476
499
|
rotateGap?: number;
|
|
500
|
+
lockRatio?: boolean | 'corner';
|
|
501
|
+
dragLimitAnimate?: boolean | number;
|
|
477
502
|
selector?: boolean;
|
|
478
503
|
editBox?: boolean;
|
|
479
504
|
hover?: boolean;
|
|
@@ -484,11 +509,13 @@ interface IEditorConfig extends IObject$1 {
|
|
|
484
509
|
boxSelect?: boolean;
|
|
485
510
|
continuousSelect?: boolean;
|
|
486
511
|
openInner?: 'double' | 'long';
|
|
487
|
-
moveable?: boolean | 'move';
|
|
488
|
-
resizeable?: boolean | 'zoom';
|
|
512
|
+
moveable?: boolean | 'gesture' | 'move';
|
|
513
|
+
resizeable?: boolean | 'gesture' | 'zoom';
|
|
489
514
|
flipable?: boolean;
|
|
490
|
-
rotateable?: boolean | 'rotate';
|
|
515
|
+
rotateable?: boolean | 'gesture' | 'rotate';
|
|
491
516
|
skewable?: boolean;
|
|
517
|
+
multipleSelectKey?: IShortcutKeysCheck | IShortcutKeys;
|
|
518
|
+
rotateKey?: IShortcutKeysCheck | IShortcutKeys;
|
|
492
519
|
beforeSelect?: IEditorBeforeSelect;
|
|
493
520
|
beforeMove?: IEditorBeforeMove;
|
|
494
521
|
beforeScale?: IEditorBeforeScale;
|
|
@@ -544,7 +571,11 @@ type IEditPointType = 'resize' | 'rotate' | 'skew' | 'resize-rotate' | 'button';
|
|
|
544
571
|
interface IEditBoxBase extends IGroup$1 {
|
|
545
572
|
editor: IEditorBase;
|
|
546
573
|
dragging: boolean;
|
|
574
|
+
gesturing: boolean;
|
|
547
575
|
moving: boolean;
|
|
576
|
+
resizing: boolean;
|
|
577
|
+
rotating: boolean;
|
|
578
|
+
skewing: boolean;
|
|
548
579
|
view: IGroup$1;
|
|
549
580
|
circle: IEditPoint;
|
|
550
581
|
rect: IRect$1;
|
|
@@ -565,6 +596,8 @@ interface IEditBoxBase extends IGroup$1 {
|
|
|
565
596
|
readonly flippedX: boolean;
|
|
566
597
|
readonly flippedY: boolean;
|
|
567
598
|
readonly flippedOne: boolean;
|
|
599
|
+
readonly canUse: boolean;
|
|
600
|
+
readonly canGesture: boolean;
|
|
568
601
|
getPointStyle(userStyle?: IBoxInputData$1): IBoxInputData$1;
|
|
569
602
|
getPointsStyle(): IBoxInputData$1[];
|
|
570
603
|
getMiddlePointsStyle(): IBoxInputData$1[];
|
|
@@ -572,6 +605,7 @@ interface IEditBoxBase extends IGroup$1 {
|
|
|
572
605
|
update(): void;
|
|
573
606
|
unload(): void;
|
|
574
607
|
onArrow(e: IKeyEvent): void;
|
|
608
|
+
isHoldRotateKey(e: IUIEvent): boolean;
|
|
575
609
|
}
|
|
576
610
|
interface IEditorDragStartData {
|
|
577
611
|
x: number;
|
|
@@ -851,6 +885,8 @@ interface IFrameInputData extends IBoxInputData {
|
|
|
851
885
|
}
|
|
852
886
|
interface IBox extends IBoxAttrData, IGroup {
|
|
853
887
|
__: IBoxData;
|
|
888
|
+
scrollBar?: IGroup;
|
|
889
|
+
__updateScrollBar(): void;
|
|
854
890
|
__updateRectRenderBounds(): void;
|
|
855
891
|
__renderGroup(canvas: ILeaferCanvas, options: IRenderOptions): void;
|
|
856
892
|
}
|
|
@@ -866,6 +902,7 @@ interface IBoxInputData extends IBoxAttrData, IGroupInputData {
|
|
|
866
902
|
interface IGroup extends IUI {
|
|
867
903
|
__: IGroupData;
|
|
868
904
|
children: IUI[];
|
|
905
|
+
childlessJSON?: boolean;
|
|
869
906
|
pick(hitPoint: IPointData, options?: IPickOptions): IPickResult;
|
|
870
907
|
add(child: IUI | IUI[] | IUIInputData | IUIInputData[], index?: number): void;
|
|
871
908
|
addAt(child: IUI | IUI[] | IUIInputData | IUIInputData[], index: number): void;
|
|
@@ -953,6 +990,9 @@ interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
|
|
|
953
990
|
__isFills?: boolean;
|
|
954
991
|
__isStrokes?: boolean;
|
|
955
992
|
readonly __strokeWidth: number;
|
|
993
|
+
readonly __maxStrokeWidth: number;
|
|
994
|
+
__hasMultiStrokeStyle?: number;
|
|
995
|
+
readonly __hasMultiPaint?: boolean;
|
|
956
996
|
__isAlphaPixelFill?: boolean;
|
|
957
997
|
__isAlphaPixelStroke?: boolean;
|
|
958
998
|
__isTransparentFill?: boolean;
|
|
@@ -970,6 +1010,7 @@ interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
|
|
|
970
1010
|
__textDrawData?: ITextDrawData;
|
|
971
1011
|
__needComputePaint?: boolean;
|
|
972
1012
|
__computePaint(): void;
|
|
1013
|
+
__getRealStrokeWidth(childStyle?: IStrokeComputedStyle): number;
|
|
973
1014
|
__setPaint(attrName: 'fill' | 'stroke', value: IValue): void;
|
|
974
1015
|
__removePaint(attrName: 'fill' | 'stroke', removeInput?: boolean): void;
|
|
975
1016
|
}
|
|
@@ -1127,8 +1168,8 @@ interface IPaintImageModule {
|
|
|
1127
1168
|
createData(leafPaint: ILeafPaint, image: ILeaferImage, paint: IImagePaint, box: IBoundsData): void;
|
|
1128
1169
|
getPatternData(paint: IImagePaint, box: IBoundsData, image: ILeaferImage): ILeafPaintPatternData;
|
|
1129
1170
|
fillOrFitMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number): void;
|
|
1130
|
-
clipMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number, skew: IPointData): void;
|
|
1131
|
-
repeatMode(data: ILeafPaintPatternData, box: IBoundsData, width: number, height: number, x: number, y: number, scaleX: number, scaleY: number, rotation: number,
|
|
1171
|
+
clipMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number, skew: IPointData, clipSize?: ISizeData): void;
|
|
1172
|
+
repeatMode(data: ILeafPaintPatternData, box: IBoundsData, width: number, height: number, x: number, y: number, scaleX: number, scaleY: number, rotation: number, skew: IPointData, align: IAlign, freeTransform?: boolean): void;
|
|
1132
1173
|
}
|
|
1133
1174
|
interface IPaintGradientModule {
|
|
1134
1175
|
linearGradient(paint: IGradientPaint, box: IBoundsData): ILeafPaint;
|
|
@@ -1161,4 +1202,4 @@ interface IFilterFunction {
|
|
|
1161
1202
|
(filter: IFilter, ui: IUI, bounds: IMatrixWithBoundsScaleData, currentCanvas: ILeaferCanvas, originCanvas: ILeaferCanvas, shape: ICachedShape): void;
|
|
1162
1203
|
}
|
|
1163
1204
|
|
|
1164
|
-
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, ITransformTool, ITransitionFunction, ITransitionMap, ITransitionModule, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIJSONData, IUIRenderModule, IUITag, IVectorPath, IVerticalAlign, IVideo, IVideoData, IVideoInputData, IWritingMode };
|
|
1205
|
+
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 };
|