@leafer-ui/interface 1.9.7 → 1.9.9
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/ICachedShape.ts +3 -1
- package/src/editor/IEditor.ts +6 -3
- package/src/module/IEffect.ts +5 -3
- package/src/module/IPaint.ts +2 -2
- package/src/type/IComputedType.ts +7 -7
- package/src/type/IType.ts +7 -7
- package/types/index.d.ts +20 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/interface",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.9",
|
|
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.9.
|
|
25
|
+
"@leafer/interface": "1.9.9"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/src/ICachedShape.ts
CHANGED
|
@@ -2,7 +2,9 @@ import { ILeaferCanvas, IBoundsData, ICachedLeaf } from '@leafer/interface'
|
|
|
2
2
|
|
|
3
3
|
export interface ICachedShape extends ICachedLeaf {
|
|
4
4
|
worldCanvas?: ILeaferCanvas // 元素太大放不下,经过裁剪后的元素区域缓存画布
|
|
5
|
-
shapeBounds: IBoundsData
|
|
5
|
+
shapeBounds: IBoundsData // 形状内容的包围盒,可能缩小了,但未进行偏移
|
|
6
|
+
// bounds: IBoundsData // 形状内容的包围盒,可能会缩小、偏移至原点
|
|
7
|
+
renderBounds: IBoundsData // 渲染内容的包围盒,可能会缩小、偏移至原点
|
|
6
8
|
scaleX: number
|
|
7
9
|
scaleY: number
|
|
8
10
|
}
|
package/src/editor/IEditor.ts
CHANGED
|
@@ -144,6 +144,7 @@ export interface IEditorConfig extends IObject {
|
|
|
144
144
|
hover?: boolean
|
|
145
145
|
hoverStyle?: IUIInputData
|
|
146
146
|
select?: 'press' | 'tap'
|
|
147
|
+
selectKeep?: boolean
|
|
147
148
|
selectedStyle?: IUIInputData
|
|
148
149
|
multipleSelect?: boolean
|
|
149
150
|
|
|
@@ -159,6 +160,7 @@ export interface IEditorConfig extends IObject {
|
|
|
159
160
|
|
|
160
161
|
multipleSelectKey?: IShortcutKeysCheck | IShortcutKeys
|
|
161
162
|
rotateKey?: IShortcutKeysCheck | IShortcutKeys
|
|
163
|
+
diagonalRotateKey?: IShortcutKeysCheck | IShortcutKeys // 对角旋转的快捷键
|
|
162
164
|
|
|
163
165
|
beforeSelect?: IEditorBeforeSelect
|
|
164
166
|
beforeEditOuter?: IEditorBeforeEditOuter
|
|
@@ -308,9 +310,10 @@ export interface IEditBoxBase extends IGroup {
|
|
|
308
310
|
export interface IEditorDragStartData {
|
|
309
311
|
x: number
|
|
310
312
|
y: number
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
313
|
+
totalOffset: IPointData // 缩放、旋转造成的总偏移量,一般用于手势操作的move纠正
|
|
314
|
+
point: IPointData // 用于移动
|
|
315
|
+
bounds: ILayoutBoundsData // 用于resize
|
|
316
|
+
rotation: number // 用于旋转
|
|
314
317
|
}
|
|
315
318
|
|
|
316
319
|
export interface IEditorConfigFunction {
|
package/src/module/IEffect.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ILeaferCanvas, IBoundsData } from '@leafer/interface'
|
|
1
|
+
import { ILeaferCanvas, IFourNumber, IBoundsData, IMatrixData } from '@leafer/interface'
|
|
2
2
|
|
|
3
3
|
import { IUI } from '../IUI'
|
|
4
4
|
import { ICachedShape } from '../ICachedShape'
|
|
@@ -12,7 +12,9 @@ export interface IEffectModule {
|
|
|
12
12
|
backgroundBlur(ui: IUI, current: ILeaferCanvas, shape: ICachedShape): void
|
|
13
13
|
|
|
14
14
|
// shadow
|
|
15
|
-
|
|
15
|
+
getShadowRenderSpread(ui: IUI, shadow: ILeafShadowEffect[], spreadSign?: 1 | -1): IFourNumber
|
|
16
|
+
getShadowTransform(ui: IUI, canvas: ILeaferCanvas, shape: ICachedShape, shadow: ILeafShadowEffect, outBounds: IBoundsData, otherScale: number, isInnerShaodw?: boolean): IMatrixData
|
|
16
17
|
isTransformShadow(shadow: ILeafShadowEffect): boolean
|
|
17
|
-
|
|
18
|
+
|
|
19
|
+
getInnerShadowSpread(ui: IUI, innerShadow: ILeafShadowEffect[]): IFourNumber
|
|
18
20
|
}
|
package/src/module/IPaint.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ILeaferCanvas, IRenderOptions, IBooleanMap, IBoundsData, ILeaferImage, IAlign, IPointData, IMatrixData
|
|
1
|
+
import { ILeaferCanvas, IRenderOptions, IBooleanMap, IBoundsData, ILeaferImage, IAlign, IPointData, IMatrixData } 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, skew: IPointData,
|
|
38
|
+
clipMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number, skew: IPointData, clipScaleX?: number, clipScaleY?: number): void
|
|
39
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
|
|
|
@@ -50,18 +50,18 @@ export interface ILeafStrokePaint extends ILeafPaint {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export interface ILeafShadowEffect {
|
|
53
|
-
x
|
|
54
|
-
y
|
|
55
|
-
blur
|
|
53
|
+
x?: number
|
|
54
|
+
y?: number
|
|
55
|
+
blur?: number
|
|
56
56
|
spread?: number
|
|
57
|
-
color
|
|
57
|
+
color?: IColorString
|
|
58
58
|
blendMode?: IBlendMode
|
|
59
59
|
box?: boolean
|
|
60
60
|
scaleFixed?: IScaleFixed
|
|
61
61
|
|
|
62
|
-
//
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
// 斜切、缩放、旋转阴影
|
|
63
|
+
skew?: IPointData
|
|
64
|
+
scale?: IPointData
|
|
65
65
|
rotation?: number
|
|
66
66
|
origin?: IDirection // 斜切、旋转原点方位,相对元素的box包围盒,默认为 bottom
|
|
67
67
|
}
|
package/src/type/IType.ts
CHANGED
|
@@ -181,19 +181,19 @@ export interface IVectorPath {
|
|
|
181
181
|
|
|
182
182
|
// 特效
|
|
183
183
|
export interface IShadowEffect {
|
|
184
|
-
x
|
|
185
|
-
y
|
|
186
|
-
blur
|
|
184
|
+
x?: number
|
|
185
|
+
y?: number
|
|
186
|
+
blur?: number
|
|
187
187
|
spread?: number
|
|
188
|
-
color
|
|
188
|
+
color?: IColorString | IColor
|
|
189
189
|
blendMode?: IBlendMode
|
|
190
190
|
visible?: boolean
|
|
191
191
|
box?: boolean
|
|
192
192
|
scaleFixed?: IScaleFixed
|
|
193
193
|
|
|
194
|
-
//
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
// 斜切、缩放、旋转阴影
|
|
195
|
+
skew?: IPointData
|
|
196
|
+
scale?: IPointData
|
|
197
197
|
rotation?: number
|
|
198
198
|
origin?: IDirection // 斜切、旋转原点方位,相对元素的box包围盒,默认为 bottom
|
|
199
199
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -135,17 +135,17 @@ interface IVectorPath {
|
|
|
135
135
|
data: string | IPathCommandData;
|
|
136
136
|
}
|
|
137
137
|
interface IShadowEffect {
|
|
138
|
-
x
|
|
139
|
-
y
|
|
140
|
-
blur
|
|
138
|
+
x?: number;
|
|
139
|
+
y?: number;
|
|
140
|
+
blur?: number;
|
|
141
141
|
spread?: number;
|
|
142
|
-
color
|
|
142
|
+
color?: IColorString | IColor;
|
|
143
143
|
blendMode?: IBlendMode;
|
|
144
144
|
visible?: boolean;
|
|
145
145
|
box?: boolean;
|
|
146
146
|
scaleFixed?: IScaleFixed;
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
skew?: IPointData;
|
|
148
|
+
scale?: IPointData;
|
|
149
149
|
rotation?: number;
|
|
150
150
|
origin?: IDirection;
|
|
151
151
|
}
|
|
@@ -202,16 +202,16 @@ interface ILeafStrokePaint extends ILeafPaint {
|
|
|
202
202
|
miterLimit?: number;
|
|
203
203
|
}
|
|
204
204
|
interface ILeafShadowEffect {
|
|
205
|
-
x
|
|
206
|
-
y
|
|
207
|
-
blur
|
|
205
|
+
x?: number;
|
|
206
|
+
y?: number;
|
|
207
|
+
blur?: number;
|
|
208
208
|
spread?: number;
|
|
209
|
-
color
|
|
209
|
+
color?: IColorString;
|
|
210
210
|
blendMode?: IBlendMode;
|
|
211
211
|
box?: boolean;
|
|
212
212
|
scaleFixed?: IScaleFixed;
|
|
213
|
-
|
|
214
|
-
|
|
213
|
+
skew?: IPointData;
|
|
214
|
+
scale?: IPointData;
|
|
215
215
|
rotation?: number;
|
|
216
216
|
origin?: IDirection;
|
|
217
217
|
}
|
|
@@ -526,6 +526,7 @@ interface IEditorConfig extends IObject$1 {
|
|
|
526
526
|
hover?: boolean;
|
|
527
527
|
hoverStyle?: IUIInputData$1;
|
|
528
528
|
select?: 'press' | 'tap';
|
|
529
|
+
selectKeep?: boolean;
|
|
529
530
|
selectedStyle?: IUIInputData$1;
|
|
530
531
|
multipleSelect?: boolean;
|
|
531
532
|
boxSelect?: boolean;
|
|
@@ -538,6 +539,7 @@ interface IEditorConfig extends IObject$1 {
|
|
|
538
539
|
skewable?: boolean;
|
|
539
540
|
multipleSelectKey?: IShortcutKeysCheck | IShortcutKeys;
|
|
540
541
|
rotateKey?: IShortcutKeysCheck | IShortcutKeys;
|
|
542
|
+
diagonalRotateKey?: IShortcutKeysCheck | IShortcutKeys;
|
|
541
543
|
beforeSelect?: IEditorBeforeSelect;
|
|
542
544
|
beforeEditOuter?: IEditorBeforeEditOuter;
|
|
543
545
|
beforeEditInner?: IEditorBeforeEditInner;
|
|
@@ -645,6 +647,7 @@ interface IEditBoxBase extends IGroup$1 {
|
|
|
645
647
|
interface IEditorDragStartData {
|
|
646
648
|
x: number;
|
|
647
649
|
y: number;
|
|
650
|
+
totalOffset: IPointData$1;
|
|
648
651
|
point: IPointData$1;
|
|
649
652
|
bounds: ILayoutBoundsData;
|
|
650
653
|
rotation: number;
|
|
@@ -1212,6 +1215,7 @@ interface IStateModule {
|
|
|
1212
1215
|
interface ICachedShape extends ICachedLeaf {
|
|
1213
1216
|
worldCanvas?: ILeaferCanvas;
|
|
1214
1217
|
shapeBounds: IBoundsData;
|
|
1218
|
+
renderBounds: IBoundsData;
|
|
1215
1219
|
scaleX: number;
|
|
1216
1220
|
scaleY: number;
|
|
1217
1221
|
}
|
|
@@ -1237,7 +1241,7 @@ interface IPaintImageModule {
|
|
|
1237
1241
|
createData(leafPaint: ILeafPaint, image: ILeaferImage, paint: IImagePaint, box: IBoundsData): void;
|
|
1238
1242
|
getPatternData(paint: IImagePaint, box: IBoundsData, image: ILeaferImage): ILeafPaintPatternData;
|
|
1239
1243
|
fillOrFitMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number): void;
|
|
1240
|
-
clipMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number, skew: IPointData,
|
|
1244
|
+
clipMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number, skew: IPointData, clipScaleX?: number, clipScaleY?: number): void;
|
|
1241
1245
|
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;
|
|
1242
1246
|
}
|
|
1243
1247
|
interface IPaintGradientModule {
|
|
@@ -1252,9 +1256,10 @@ interface IEffectModule {
|
|
|
1252
1256
|
innerShadow(ui: IUI, current: ILeaferCanvas, shape: ICachedShape): void;
|
|
1253
1257
|
blur(ui: IUI, current: ILeaferCanvas, origin: ILeaferCanvas): void;
|
|
1254
1258
|
backgroundBlur(ui: IUI, current: ILeaferCanvas, shape: ICachedShape): void;
|
|
1255
|
-
|
|
1259
|
+
getShadowRenderSpread(ui: IUI, shadow: ILeafShadowEffect[], spreadSign?: 1 | -1): IFourNumber;
|
|
1260
|
+
getShadowTransform(ui: IUI, canvas: ILeaferCanvas, shape: ICachedShape, shadow: ILeafShadowEffect, outBounds: IBoundsData, otherScale: number, isInnerShaodw?: boolean): IMatrixData;
|
|
1256
1261
|
isTransformShadow(shadow: ILeafShadowEffect): boolean;
|
|
1257
|
-
|
|
1262
|
+
getInnerShadowSpread(ui: IUI, innerShadow: ILeafShadowEffect[]): IFourNumber;
|
|
1258
1263
|
}
|
|
1259
1264
|
|
|
1260
1265
|
interface IFilterModule {
|