@leafer-ui/interface 2.1.2 → 2.1.4
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/editor/IEditor.ts +5 -3
- package/src/module/IPaint.ts +2 -2
- package/src/type/IComputedType.ts +2 -1
- package/types/index.d.ts +9 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/interface",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.4",
|
|
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": "2.1.
|
|
25
|
+
"@leafer/interface": "2.1.4"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/src/editor/IEditor.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IGroup, IUI, IBox, IRectInputData, ISelectorProxy, IEditSize, ICursorType, IAlign, IUnitPointData, IDragEvent, IMoveEvent, IRotateEvent, IStroke, IFill, ILeaf, ILeafList, IObject, IBoxInputData, IGroupInputData, IImageCursor, IKeyEvent, IUIInputData, IZoomEvent, IColorString, IDirection4, IPointData, IScaleData, ISkewData, ILayoutBoundsData, ITransition, IFourNumber, IShortcutKeys, IShortcutKeysCheck, IUIEvent, ILeafer } 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, IKeyEvent, IUIInputData, IZoomEvent, IColorString, IDirection4, IPointData, IScaleData, ISkewData, ILayoutBoundsData, ITransition, IFourNumber, IShortcutKeys, IShortcutKeysCheck, IUIEvent, ILeafer, IBoundsType } from '@leafer-ui/interface'
|
|
2
2
|
|
|
3
3
|
export interface IEditorBase extends IGroup, ISelectorProxy, ITransformTool {
|
|
4
4
|
config: IEditorConfig
|
|
@@ -91,7 +91,7 @@ export interface ITransformTool {
|
|
|
91
91
|
onSkew(e: IDragEvent): void
|
|
92
92
|
|
|
93
93
|
move(x: number | IPointData, y?: number, transition?: ITransition): void
|
|
94
|
-
scaleOf(origin: IPointData | IAlign, scaleX: number, scaleY?: number | ITransition, resize?: boolean, transition?: ITransition): void
|
|
94
|
+
scaleOf(origin: IPointData | IAlign, scaleX: number, scaleY?: number | ITransition, resize?: boolean, transition?: ITransition, boundsType?: IBoundsType): void
|
|
95
95
|
rotateOf(origin: IPointData | IAlign, rotation: number, transition?: ITransition): void
|
|
96
96
|
skewOf(origin: IPointData | IAlign, skewX: number, skewY?: number, resize?: boolean, transition?: ITransition): void
|
|
97
97
|
}
|
|
@@ -153,12 +153,14 @@ export interface IEditorConfig extends IObject {
|
|
|
153
153
|
|
|
154
154
|
selector?: boolean
|
|
155
155
|
editBox?: boolean
|
|
156
|
+
editBoxType?: IBoundsType
|
|
156
157
|
hover?: boolean
|
|
157
158
|
hoverStyle?: IUIInputData
|
|
159
|
+
hoverPathType?: 'path' | 'render-path' | 'box' | 'stroke'
|
|
158
160
|
select?: 'press' | 'tap'
|
|
159
161
|
selectKeep?: boolean
|
|
160
162
|
selectedStyle?: IUIInputData
|
|
161
|
-
selectedPathType?: 'path' | 'render-path'
|
|
163
|
+
selectedPathType?: 'path' | 'render-path' | 'box' | 'stroke'
|
|
162
164
|
multipleSelect?: boolean
|
|
163
165
|
|
|
164
166
|
boxSelect?: boolean
|
package/src/module/IPaint.ts
CHANGED
|
@@ -55,11 +55,11 @@ export interface IPaintImageModule {
|
|
|
55
55
|
clipMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number, skew: IPointData, clipScaleX?: number, clipScaleY?: number): void
|
|
56
56
|
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
|
|
57
57
|
|
|
58
|
-
brush?(paint: ILeafPaint): void
|
|
58
|
+
brush?(paint: ILeafPaint, ui: IUI): void
|
|
59
59
|
addBrushScale?(scaleData: IScaleData, paint: ILeafPaint, ui: IUI): void
|
|
60
60
|
getBrushScale?(paint: ILeafPaint, ui: IUI): number
|
|
61
|
+
cacheBrush?(paint: ILeafPaint, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void
|
|
61
62
|
recycleBrush?(paint: ILeafPaint, ui: IUI): void
|
|
62
|
-
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
export interface IPaintGradientModule {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IBlendMode, IDirection, IFilmPlayOptions, IInterlace, ILeaferImage, IMatrixData, IPointData, IScaleFixed, ITaskItem, ILeaf } from '@leafer/interface'
|
|
1
|
+
import { IBlendMode, IDirection, IFilmPlayOptions, IInterlace, ILeaferImage, IMatrixData, IPointData, IScaleFixed, ITaskItem, ILeaf, ILeaferCanvas } from '@leafer/interface'
|
|
2
2
|
|
|
3
3
|
import { IColorString } from './IStringType'
|
|
4
4
|
import { IStrokeAlign, IStrokeJoin, IStrokeCap, IImagePaintMode, IPaint } from './IType'
|
|
@@ -33,6 +33,7 @@ export interface ILeafPaint extends IFilmPlayOptions {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export interface ILeafPaintBrush {
|
|
36
|
+
cache?: ILeaferCanvas
|
|
36
37
|
render(canvas: any, x: number, y: number, width: number, height: number, leaf: ILeaf, paint: any, imageScaleX: number, imageScaleY: number): void
|
|
37
38
|
destroy(): void
|
|
38
39
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IMultimediaType, IBlendMode, IScaleFixed, IAlign, IUnitPointData, IFilmOptions, IImageLOD, IExportFileType, IFourNumber, IPointData, IOptionSizeData, ISizeData, IGap, IPointGap, IPercentData, IInterlace, IPathCommandData, IAxis, IAxisReverse, IDirection, IWindingRule, IFilter, IFilmPlayOptions, IMatrixData, ILeaferImage, ITaskItem, ILeaf, INumber, IString, IBoolean, IUnitData, IAnimateOptions, IAnimateEasing, IEventer, IObject, IEventParamsMap, IAnimateEasingFunction, IAnimateEnding, ITransition, IBounds, ILeafInputData, ILeafComputedData, ILeafData, IPathCommandDataWithWindingRule, IBoundsData, IValue, IDirection4 as IDirection4$1, IAround, IOptionPointData, IPathCreator, IJSONOptions, IFindCondition, IAnswer, IPathString, IPathDrawer,
|
|
1
|
+
import { IMultimediaType, IBlendMode, IScaleFixed, IAlign, IUnitPointData, IFilmOptions, IImageLOD, IExportFileType, IFourNumber, IPointData, IOptionSizeData, ISizeData, IGap, IPointGap, IPercentData, IInterlace, IPathCommandData, IAxis, IAxisReverse, IDirection, IWindingRule, IFilter, IFilmPlayOptions, IMatrixData, ILeaferImage, ITaskItem, ILeaferCanvas, ILeaf, INumber, IString, IBoolean, IUnitData, IAnimateOptions, IAnimateEasing, IEventer, IObject, IEventParamsMap, IAnimateEasingFunction, IAnimateEnding, ITransition, IBounds, ILeafInputData, ILeafComputedData, ILeafData, IPathCommandDataWithWindingRule, IBoundsData, IValue, IDirection4 as IDirection4$1, IAround, IOptionPointData, IPathCreator, IJSONOptions, IFindCondition, IAnswer, IPathString, IPathDrawer, IRenderOptions, IExportOptions, IExportResult, IPickOptions, IPickResult, ICanvasContext2DSettings, ICanvasContext2D, ILeaferAttrData, IControl, ILeaferType, ILeaferConfig, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IScaleData as IScaleData$1, IBooleanMap, IFunction, IMatrixWithBoundsScaleData } from '@leafer/interface';
|
|
2
2
|
export * from '@leafer/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, ILayoutBoundsData, IKeyEvent, IUIEvent, IDragEvent, IMoveEvent, IZoomEvent, IRotateEvent, ITransition as ITransition$1, ILeafList, ILeafer as ILeafer$1, ILeaf as ILeaf$1, 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, IBoundsType, 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, ILayoutBoundsData, IKeyEvent, IUIEvent, IDragEvent, IMoveEvent, IZoomEvent, IRotateEvent, ITransition as ITransition$1, ILeafList, ILeafer as ILeafer$1, ILeaf as ILeaf$1, 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;
|
|
@@ -186,6 +186,7 @@ interface ILeafPaint extends IFilmPlayOptions {
|
|
|
186
186
|
brush?: ILeafPaintBrush;
|
|
187
187
|
}
|
|
188
188
|
interface ILeafPaintBrush {
|
|
189
|
+
cache?: ILeaferCanvas;
|
|
189
190
|
render(canvas: any, x: number, y: number, width: number, height: number, leaf: ILeaf, paint: any, imageScaleX: number, imageScaleY: number): void;
|
|
190
191
|
destroy(): void;
|
|
191
192
|
}
|
|
@@ -491,7 +492,7 @@ interface ITransformTool {
|
|
|
491
492
|
onRotate(e: IDragEvent | IRotateEvent): void;
|
|
492
493
|
onSkew(e: IDragEvent): void;
|
|
493
494
|
move(x: number | IPointData$1, y?: number, transition?: ITransition$1): void;
|
|
494
|
-
scaleOf(origin: IPointData$1 | IAlign$1, scaleX: number, scaleY?: number | ITransition$1, resize?: boolean, transition?: ITransition$1): void;
|
|
495
|
+
scaleOf(origin: IPointData$1 | IAlign$1, scaleX: number, scaleY?: number | ITransition$1, resize?: boolean, transition?: ITransition$1, boundsType?: IBoundsType): void;
|
|
495
496
|
rotateOf(origin: IPointData$1 | IAlign$1, rotation: number, transition?: ITransition$1): void;
|
|
496
497
|
skewOf(origin: IPointData$1 | IAlign$1, skewX: number, skewY?: number, resize?: boolean, transition?: ITransition$1): void;
|
|
497
498
|
}
|
|
@@ -538,12 +539,14 @@ interface IEditorConfig extends IObject$1 {
|
|
|
538
539
|
ignorePixelSnap?: boolean;
|
|
539
540
|
selector?: boolean;
|
|
540
541
|
editBox?: boolean;
|
|
542
|
+
editBoxType?: IBoundsType;
|
|
541
543
|
hover?: boolean;
|
|
542
544
|
hoverStyle?: IUIInputData$1;
|
|
545
|
+
hoverPathType?: 'path' | 'render-path' | 'box' | 'stroke';
|
|
543
546
|
select?: 'press' | 'tap';
|
|
544
547
|
selectKeep?: boolean;
|
|
545
548
|
selectedStyle?: IUIInputData$1;
|
|
546
|
-
selectedPathType?: 'path' | 'render-path';
|
|
549
|
+
selectedPathType?: 'path' | 'render-path' | 'box' | 'stroke';
|
|
547
550
|
multipleSelect?: boolean;
|
|
548
551
|
boxSelect?: boolean;
|
|
549
552
|
continuousSelect?: boolean;
|
|
@@ -1366,9 +1369,10 @@ interface IPaintImageModule {
|
|
|
1366
1369
|
fillOrFitMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number): void;
|
|
1367
1370
|
clipMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number, skew: IPointData, clipScaleX?: number, clipScaleY?: number): void;
|
|
1368
1371
|
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;
|
|
1369
|
-
brush?(paint: ILeafPaint): void;
|
|
1372
|
+
brush?(paint: ILeafPaint, ui: IUI): void;
|
|
1370
1373
|
addBrushScale?(scaleData: IScaleData$1, paint: ILeafPaint, ui: IUI): void;
|
|
1371
1374
|
getBrushScale?(paint: ILeafPaint, ui: IUI): number;
|
|
1375
|
+
cacheBrush?(paint: ILeafPaint, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
|
|
1372
1376
|
recycleBrush?(paint: ILeafPaint, ui: IUI): void;
|
|
1373
1377
|
}
|
|
1374
1378
|
interface IPaintGradientModule {
|