@leafer-ui/interface 2.1.3 → 2.1.5
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/IUI.ts +3 -3
- package/src/editor/IEditor.ts +5 -3
- package/src/module/IPaint.ts +3 -3
- package/src/type/IComputedType.ts +2 -1
- package/types/index.d.ts +11 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/interface",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.5",
|
|
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.5"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/src/IUI.ts
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
ITextStyleAttrData, ITextStyleInputData, ITextStyleComputedData,
|
|
10
10
|
IStrokeComputedStyle
|
|
11
11
|
} from './ICommonAttr'
|
|
12
|
-
import { IFill, IOverflow } from './type/IType'
|
|
12
|
+
import { IFill, IOverflow, IPaintAttr } from './type/IType'
|
|
13
13
|
import { IAnimation, IAnimate, IKeyframe, IKeyframeId, IAnimateType } from './IAnimation'
|
|
14
14
|
import { ILeafer } from './app/ILeafer'
|
|
15
15
|
import { IEditorConfig } from './editor/IEditor'
|
|
@@ -634,8 +634,8 @@ export interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
|
|
|
634
634
|
|
|
635
635
|
__checkComplex(): void
|
|
636
636
|
|
|
637
|
-
__setPaint(attrName:
|
|
638
|
-
__removePaint(attrName:
|
|
637
|
+
__setPaint(attrName: IPaintAttr, value: IValue): void
|
|
638
|
+
__removePaint(attrName: IPaintAttr, removeInput?: boolean): void
|
|
639
639
|
}
|
|
640
640
|
export interface IUIComputedData extends IUIAttrData, IFillComputedData, IBorderComputedData, IStrokeComputedData, ITextStyleComputedData, ICornerRadiusComputedData, IEffectComputedData, ILeafComputedData {
|
|
641
641
|
|
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
|
@@ -15,7 +15,7 @@ export interface IPaintModule {
|
|
|
15
15
|
fillPathOrText(ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void
|
|
16
16
|
fillText(ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void
|
|
17
17
|
|
|
18
|
-
stroke(stroke: string, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void
|
|
18
|
+
stroke(stroke: string | ILeafPaint[], ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void
|
|
19
19
|
strokes(strokes: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void
|
|
20
20
|
|
|
21
21
|
fillStroke?(stroke: string | ILeafPaint[], ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void
|
|
@@ -29,7 +29,7 @@ export interface IPaintModule {
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
export interface IPaintImageModule {
|
|
32
|
-
image(ui: IUI, attrName:
|
|
32
|
+
image(ui: IUI, attrName: IPaintAttr, paint: IImagePaint, boxBounds: IBoundsData, firstUse: boolean): ILeafPaint
|
|
33
33
|
|
|
34
34
|
film?(paint: ILeafPaint): void
|
|
35
35
|
video?(paint: ILeafPaint): void
|
|
@@ -55,7 +55,7 @@ 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, ui: IUI): void
|
|
58
|
+
brush?(paint: ILeafPaint, ui: IUI, attrName: IPaintAttr): void
|
|
59
59
|
addBrushScale?(scaleData: IScaleData, paint: ILeafPaint, ui: IUI): void
|
|
60
60
|
getBrushScale?(paint: ILeafPaint, ui: IUI): number
|
|
61
61
|
cacheBrush?(paint: ILeafPaint, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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
|
-
import { IStrokeAlign, IStrokeJoin, IStrokeCap, IImagePaintMode, IPaint } from './IType'
|
|
4
|
+
import { IStrokeAlign, IStrokeJoin, IStrokeCap, IImagePaintMode, IPaint, IPaintAttr } from './IType'
|
|
5
5
|
import { IPaintType } from './IType'
|
|
6
6
|
import { IStrokeComputedStyle } from '../ICommonAttr'
|
|
7
7
|
|
|
@@ -33,6 +33,7 @@ export interface ILeafPaint extends IFilmPlayOptions {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export interface ILeafPaintBrush {
|
|
36
|
+
attrName: IPaintAttr
|
|
36
37
|
cache?: ILeaferCanvas
|
|
37
38
|
render(canvas: any, x: number, y: number, width: number, height: number, leaf: ILeaf, paint: any, imageScaleX: number, imageScaleY: number): void
|
|
38
39
|
destroy(): void
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
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
|
+
attrName: IPaintAttr;
|
|
189
190
|
cache?: ILeaferCanvas;
|
|
190
191
|
render(canvas: any, x: number, y: number, width: number, height: number, leaf: ILeaf, paint: any, imageScaleX: number, imageScaleY: number): void;
|
|
191
192
|
destroy(): void;
|
|
@@ -492,7 +493,7 @@ interface ITransformTool {
|
|
|
492
493
|
onRotate(e: IDragEvent | IRotateEvent): void;
|
|
493
494
|
onSkew(e: IDragEvent): void;
|
|
494
495
|
move(x: number | IPointData$1, y?: number, transition?: ITransition$1): void;
|
|
495
|
-
scaleOf(origin: IPointData$1 | IAlign$1, scaleX: number, scaleY?: number | ITransition$1, resize?: boolean, transition?: ITransition$1): void;
|
|
496
|
+
scaleOf(origin: IPointData$1 | IAlign$1, scaleX: number, scaleY?: number | ITransition$1, resize?: boolean, transition?: ITransition$1, boundsType?: IBoundsType): void;
|
|
496
497
|
rotateOf(origin: IPointData$1 | IAlign$1, rotation: number, transition?: ITransition$1): void;
|
|
497
498
|
skewOf(origin: IPointData$1 | IAlign$1, skewX: number, skewY?: number, resize?: boolean, transition?: ITransition$1): void;
|
|
498
499
|
}
|
|
@@ -539,12 +540,14 @@ interface IEditorConfig extends IObject$1 {
|
|
|
539
540
|
ignorePixelSnap?: boolean;
|
|
540
541
|
selector?: boolean;
|
|
541
542
|
editBox?: boolean;
|
|
543
|
+
editBoxType?: IBoundsType;
|
|
542
544
|
hover?: boolean;
|
|
543
545
|
hoverStyle?: IUIInputData$1;
|
|
546
|
+
hoverPathType?: 'path' | 'render-path' | 'box' | 'stroke';
|
|
544
547
|
select?: 'press' | 'tap';
|
|
545
548
|
selectKeep?: boolean;
|
|
546
549
|
selectedStyle?: IUIInputData$1;
|
|
547
|
-
selectedPathType?: 'path' | 'render-path';
|
|
550
|
+
selectedPathType?: 'path' | 'render-path' | 'box' | 'stroke';
|
|
548
551
|
multipleSelect?: boolean;
|
|
549
552
|
boxSelect?: boolean;
|
|
550
553
|
continuousSelect?: boolean;
|
|
@@ -1192,8 +1195,8 @@ interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
|
|
|
1192
1195
|
__computePaint(): void;
|
|
1193
1196
|
__getRealStrokeWidth(childStyle?: IStrokeComputedStyle): number;
|
|
1194
1197
|
__checkComplex(): void;
|
|
1195
|
-
__setPaint(attrName:
|
|
1196
|
-
__removePaint(attrName:
|
|
1198
|
+
__setPaint(attrName: IPaintAttr, value: IValue): void;
|
|
1199
|
+
__removePaint(attrName: IPaintAttr, removeInput?: boolean): void;
|
|
1197
1200
|
}
|
|
1198
1201
|
interface IUIComputedData extends IUIAttrData, IFillComputedData, IBorderComputedData, IStrokeComputedData, ITextStyleComputedData, ICornerRadiusComputedData, IEffectComputedData, ILeafComputedData {
|
|
1199
1202
|
}
|
|
@@ -1339,7 +1342,7 @@ interface IPaintModule {
|
|
|
1339
1342
|
fills(fills: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
|
|
1340
1343
|
fillPathOrText(ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
|
|
1341
1344
|
fillText(ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
|
|
1342
|
-
stroke(stroke: string, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
|
|
1345
|
+
stroke(stroke: string | ILeafPaint[], ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
|
|
1343
1346
|
strokes(strokes: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
|
|
1344
1347
|
fillStroke?(stroke: string | ILeafPaint[], ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
|
|
1345
1348
|
strokeText(stroke: string | ILeafPaint[], ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
|
|
@@ -1349,7 +1352,7 @@ interface IPaintModule {
|
|
|
1349
1352
|
shape(ui: IUI, current: ILeaferCanvas, renderOptions: IRenderOptions): ICachedShape;
|
|
1350
1353
|
}
|
|
1351
1354
|
interface IPaintImageModule {
|
|
1352
|
-
image(ui: IUI, attrName:
|
|
1355
|
+
image(ui: IUI, attrName: IPaintAttr, paint: IImagePaint, boxBounds: IBoundsData, firstUse: boolean): ILeafPaint;
|
|
1353
1356
|
film?(paint: ILeafPaint): void;
|
|
1354
1357
|
video?(paint: ILeafPaint): void;
|
|
1355
1358
|
checkImage(paint: ILeafPaint, allowDraw: boolean, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): boolean;
|
|
@@ -1367,7 +1370,7 @@ interface IPaintImageModule {
|
|
|
1367
1370
|
fillOrFitMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number): void;
|
|
1368
1371
|
clipMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number, skew: IPointData, clipScaleX?: number, clipScaleY?: number): void;
|
|
1369
1372
|
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;
|
|
1370
|
-
brush?(paint: ILeafPaint, ui: IUI): void;
|
|
1373
|
+
brush?(paint: ILeafPaint, ui: IUI, attrName: IPaintAttr): void;
|
|
1371
1374
|
addBrushScale?(scaleData: IScaleData$1, paint: ILeafPaint, ui: IUI): void;
|
|
1372
1375
|
getBrushScale?(paint: ILeafPaint, ui: IUI): number;
|
|
1373
1376
|
cacheBrush?(paint: ILeafPaint, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
|