@leafer-ui/interface 1.9.7 → 1.9.8
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/types/index.d.ts +8 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/interface",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.8",
|
|
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.8"
|
|
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
|
|
package/types/index.d.ts
CHANGED
|
@@ -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 {
|