@leafer-ui/interface 1.0.0-rc.8 → 1.0.0-rc.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/ICommonAttr.ts +7 -1
- package/src/IUI.ts +17 -3
- package/src/index.ts +2 -1
- package/src/type/IType.ts +5 -1
- package/types/index.d.ts +20 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/interface",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.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.0.0-rc.
|
|
25
|
+
"@leafer/interface": "1.0.0-rc.9"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/src/ICommonAttr.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IStrokeAlign, IStrokeCap, IStrokeJoin, IBlurEffect, IFontWeight, ITextCase, ITextDecoration, IShadowEffect, IGrayscaleEffect, ITextAlign, IVerticalAlign, IOverflow, IUnitData, ITextWrap, IStroke, IFill } from './type/IType'
|
|
1
|
+
import { IStrokeAlign, IStrokeCap, IStrokeJoin, IBlurEffect, IFontWeight, ITextCase, ITextDecoration, IShadowEffect, IGrayscaleEffect, ITextAlign, IVerticalAlign, IOverflow, IUnitData, ITextWrap, IStroke, IFill, IArrowType } from './type/IType'
|
|
2
2
|
import { ILeafStrokePaint, ILeafShadowEffect, ILeafPaint } from './type/IComputedType'
|
|
3
3
|
import { IDashPatternString, IShadowString, IColorString, IStrokeWidthString, ICornerRadiusString } from './type/IStringType'
|
|
4
4
|
|
|
@@ -44,6 +44,9 @@ export interface IStrokeAttrData {
|
|
|
44
44
|
dashPattern: number[] | IDashPatternString
|
|
45
45
|
dashOffset: number
|
|
46
46
|
miterLimit: number
|
|
47
|
+
|
|
48
|
+
startArrow: IArrowType
|
|
49
|
+
endArrow: IArrowType
|
|
47
50
|
}
|
|
48
51
|
export interface IStrokeInputData {
|
|
49
52
|
stroke?: IStroke
|
|
@@ -55,6 +58,9 @@ export interface IStrokeInputData {
|
|
|
55
58
|
dashPattern?: number[] | IDashPatternString
|
|
56
59
|
dashOffset?: number
|
|
57
60
|
miterLimit?: number
|
|
61
|
+
|
|
62
|
+
startArrow?: IArrowType
|
|
63
|
+
endArrow?: IArrowType
|
|
58
64
|
}
|
|
59
65
|
export interface IStrokeComputedData {
|
|
60
66
|
stroke?: IColorString | ILeafStrokePaint[]
|
package/src/IUI.ts
CHANGED
|
@@ -30,6 +30,18 @@ export interface ILineData extends ILineAttrData, IUIData { }
|
|
|
30
30
|
export interface ILineInputData extends ILineAttrData, IUIBaseInputData { }
|
|
31
31
|
|
|
32
32
|
|
|
33
|
+
// Arrow
|
|
34
|
+
export interface IArrow extends ILine {
|
|
35
|
+
__: IArrowData
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface IArrowAttrData {
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
export interface IArrowData extends IArrowAttrData, ILineData { }
|
|
42
|
+
export interface IArrowInputData extends IArrowAttrData, IUIBaseInputData { }
|
|
43
|
+
|
|
44
|
+
|
|
33
45
|
// Rect
|
|
34
46
|
export interface IRect extends IUI {
|
|
35
47
|
__: IRectData
|
|
@@ -189,7 +201,9 @@ export interface IImage extends IRect, ILeaferImageConfig {
|
|
|
189
201
|
interface IImageAttrData {
|
|
190
202
|
url?: string
|
|
191
203
|
}
|
|
192
|
-
export interface IImageData extends IImageAttrData, IRectData {
|
|
204
|
+
export interface IImageData extends IImageAttrData, IRectData {
|
|
205
|
+
__setImageFill(value: string): void
|
|
206
|
+
}
|
|
193
207
|
export interface IImageInputData extends IImageAttrData, IUIBaseInputData { }
|
|
194
208
|
|
|
195
209
|
export interface ICanvas extends IRect {
|
|
@@ -291,8 +305,8 @@ export interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrDa
|
|
|
291
305
|
find(condition: number | string | IFindUIMethod, options?: any): IUI[]
|
|
292
306
|
findOne(condition: number | string | IFindUIMethod, options?: any): IUI
|
|
293
307
|
|
|
294
|
-
getPath(curve?: boolean): IPathCommandData
|
|
295
|
-
getPathString(curve?: boolean): IPathString
|
|
308
|
+
getPath(curve?: boolean, pathForRender?: boolean): IPathCommandData
|
|
309
|
+
getPathString(curve?: boolean, pathForRender?: boolean): IPathString
|
|
296
310
|
|
|
297
311
|
__drawPathByData(drawer: IPathDrawer, data: IPathCommandData): void
|
|
298
312
|
__drawPathByBox(drawer: IPathDrawer): void
|
package/src/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { ILeafer } from './app/ILeafer'
|
|
|
5
5
|
|
|
6
6
|
export {
|
|
7
7
|
ILine, ILineInputData, ILineData,
|
|
8
|
+
IArrow, IArrowInputData, IArrowData,
|
|
8
9
|
IRect, IRectInputData, IRectData,
|
|
9
10
|
IEllipse, IEllipseInputData, IEllipseData,
|
|
10
11
|
IPolygon, IPolygonInputData, IPolygonData,
|
|
@@ -23,7 +24,7 @@ export {
|
|
|
23
24
|
IUITag, IUIInputData
|
|
24
25
|
} from './IUI'
|
|
25
26
|
|
|
26
|
-
export { IUnitData, IVectorPath, IShadowEffect, IBlurEffect, IGrayscaleEffect, IFill, IStroke, IStrokeAlign, IStrokeJoin, IStrokeCap, IRGB, IRGBA, IColor, IColorStop, IPaint, IGradientPaint, IImagePaint, IImagePaintMode, IFontWeight, ITextCase, ITextDecoration, ITextAlign, IVerticalAlign, IOverflow, ITextWrap, IRepeat } from './type/IType'
|
|
27
|
+
export { IUnitData, IVectorPath, IShadowEffect, IBlurEffect, IGrayscaleEffect, IFill, IStroke, IStrokeAlign, IStrokeJoin, IStrokeCap, IArrowType, IRGB, IRGBA, IColor, IColorStop, IPaint, IGradientPaint, IImagePaint, IImagePaintMode, IFontWeight, ITextCase, ITextDecoration, ITextAlign, IVerticalAlign, IOverflow, ITextWrap, IRepeat } from './type/IType'
|
|
27
28
|
export { ICornerRadiusString, IStrokeWidthString, IPaintString, IShadowString, IPercent, IDashPatternString, IColorString } from './type/IStringType'
|
|
28
29
|
export { ILeafFill, ILeafPaint, ILeafPaintPatternData, ILeafPaintColor, ILeafStrokePaint, ILeafShadowEffect } from './type/IComputedType'
|
|
29
30
|
|
package/src/type/IType.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IPointData, IPathCommandData, IWindingRule, IBlendMode, IExportFileType } from '@leafer/interface'
|
|
1
|
+
import { IPointData, IPathCommandData, IWindingRule, IBlendMode, IExportFileType, ISizeData } from '@leafer/interface'
|
|
2
2
|
import { IColorString, IPaintString } from './IStringType'
|
|
3
3
|
|
|
4
4
|
export interface IUnitData {
|
|
@@ -70,6 +70,7 @@ export interface IImagePaint extends IPaintBase {
|
|
|
70
70
|
filters?: IImageFilters
|
|
71
71
|
|
|
72
72
|
offset?: IPointData
|
|
73
|
+
size?: number | ISizeData
|
|
73
74
|
scale?: number | IPointData
|
|
74
75
|
rotation?: number
|
|
75
76
|
|
|
@@ -92,6 +93,9 @@ export type IStrokeAlign = 'inside' | 'outside' | 'center'
|
|
|
92
93
|
export type IStrokeCap = 'none' | 'round' | 'square' | 'arrow-lines' | 'arrow-equilateral'
|
|
93
94
|
export type IStrokeJoin = 'bevel' | 'round' | 'miter'
|
|
94
95
|
|
|
96
|
+
// 箭头
|
|
97
|
+
export type IArrowType = 'none' | 'line' | 'triangle' | 'circle'
|
|
98
|
+
|
|
95
99
|
// 文本
|
|
96
100
|
export type ITextAlign = 'left' | 'center' | 'right' | 'justify'
|
|
97
101
|
export type IVerticalAlign = 'top' | 'middle' | 'bottom'
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IPointData, IExportFileType, IWindingRule, IPathCommandData, IBlendMode, IMatrixData, ILeaferImage, ITaskItem, IBlob, ILeaf, IPathString, IPathCreator, IBoundsData, ILeaferImageConfig, ILeaferCanvas, IRenderOptions, IPathDrawer, AnswerType, ILeafData, IPath2D, ILeafComputedData, ILeafInputData, IObject, ILeaferAttrData, IControl, ILeaferConfig, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IBooleanMap } from '@leafer/interface';
|
|
1
|
+
import { IPointData, IExportFileType, ISizeData, IWindingRule, IPathCommandData, IBlendMode, IMatrixData, ILeaferImage, ITaskItem, IBlob, ILeaf, IPathString, IPathCreator, IBoundsData, ILeaferImageConfig, ILeaferCanvas, IRenderOptions, IPathDrawer, AnswerType, ILeafData, IPath2D, ILeafComputedData, ILeafInputData, IObject, ILeaferAttrData, IControl, ILeaferConfig, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IBooleanMap } from '@leafer/interface';
|
|
2
2
|
export * from '@leafer/interface';
|
|
3
3
|
import { IGroup as IGroup$1, ISelectorProxy, IUI as IUI$1, IObject as IObject$1, ILeaf as ILeaf$1, IEditSize, IDragEvent, IRotateEvent, IStroke as IStroke$1, IFill as IFill$1, IBoxInputData as IBoxInputData$1, IRectInputData as IRectInputData$1, ICursorType, IAround } from '@leafer-ui/interface';
|
|
4
4
|
|
|
@@ -60,6 +60,7 @@ interface IImagePaint extends IPaintBase {
|
|
|
60
60
|
format?: IExportFileType;
|
|
61
61
|
filters?: IImageFilters;
|
|
62
62
|
offset?: IPointData;
|
|
63
|
+
size?: number | ISizeData;
|
|
63
64
|
scale?: number | IPointData;
|
|
64
65
|
rotation?: number;
|
|
65
66
|
repeat?: IRepeat;
|
|
@@ -78,6 +79,7 @@ type IRepeat = boolean | 'x' | 'y';
|
|
|
78
79
|
type IStrokeAlign = 'inside' | 'outside' | 'center';
|
|
79
80
|
type IStrokeCap = 'none' | 'round' | 'square' | 'arrow-lines' | 'arrow-equilateral';
|
|
80
81
|
type IStrokeJoin = 'bevel' | 'round' | 'miter';
|
|
82
|
+
type IArrowType = 'none' | 'line' | 'triangle' | 'circle';
|
|
81
83
|
type ITextAlign = 'left' | 'center' | 'right' | 'justify';
|
|
82
84
|
type IVerticalAlign = 'top' | 'middle' | 'bottom';
|
|
83
85
|
type ITextCase = 'upper' | 'lower' | 'title' | 'none' | 'small-caps';
|
|
@@ -186,6 +188,8 @@ interface IStrokeAttrData {
|
|
|
186
188
|
dashPattern: number[] | IDashPatternString;
|
|
187
189
|
dashOffset: number;
|
|
188
190
|
miterLimit: number;
|
|
191
|
+
startArrow: IArrowType;
|
|
192
|
+
endArrow: IArrowType;
|
|
189
193
|
}
|
|
190
194
|
interface IStrokeInputData {
|
|
191
195
|
stroke?: IStroke;
|
|
@@ -196,6 +200,8 @@ interface IStrokeInputData {
|
|
|
196
200
|
dashPattern?: number[] | IDashPatternString;
|
|
197
201
|
dashOffset?: number;
|
|
198
202
|
miterLimit?: number;
|
|
203
|
+
startArrow?: IArrowType;
|
|
204
|
+
endArrow?: IArrowType;
|
|
199
205
|
}
|
|
200
206
|
interface IStrokeComputedData {
|
|
201
207
|
stroke?: IColorString | ILeafStrokePaint[];
|
|
@@ -308,6 +314,15 @@ interface ILineData extends ILineAttrData, IUIData {
|
|
|
308
314
|
}
|
|
309
315
|
interface ILineInputData extends ILineAttrData, IUIBaseInputData {
|
|
310
316
|
}
|
|
317
|
+
interface IArrow extends ILine {
|
|
318
|
+
__: IArrowData;
|
|
319
|
+
}
|
|
320
|
+
interface IArrowAttrData {
|
|
321
|
+
}
|
|
322
|
+
interface IArrowData extends IArrowAttrData, ILineData {
|
|
323
|
+
}
|
|
324
|
+
interface IArrowInputData extends IArrowAttrData, IUIBaseInputData {
|
|
325
|
+
}
|
|
311
326
|
interface IRect extends IUI {
|
|
312
327
|
__: IRectData;
|
|
313
328
|
}
|
|
@@ -448,6 +463,7 @@ interface IImageAttrData {
|
|
|
448
463
|
url?: string;
|
|
449
464
|
}
|
|
450
465
|
interface IImageData extends IImageAttrData, IRectData {
|
|
466
|
+
__setImageFill(value: string): void;
|
|
451
467
|
}
|
|
452
468
|
interface IImageInputData extends IImageAttrData, IUIBaseInputData {
|
|
453
469
|
}
|
|
@@ -527,8 +543,8 @@ interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrData, IEf
|
|
|
527
543
|
createProxyData(): IUIInputData;
|
|
528
544
|
find(condition: number | string | IFindUIMethod, options?: any): IUI[];
|
|
529
545
|
findOne(condition: number | string | IFindUIMethod, options?: any): IUI;
|
|
530
|
-
getPath(curve?: boolean): IPathCommandData;
|
|
531
|
-
getPathString(curve?: boolean): IPathString;
|
|
546
|
+
getPath(curve?: boolean, pathForRender?: boolean): IPathCommandData;
|
|
547
|
+
getPathString(curve?: boolean, pathForRender?: boolean): IPathString;
|
|
532
548
|
__drawPathByData(drawer: IPathDrawer, data: IPathCommandData): void;
|
|
533
549
|
__drawPathByBox(drawer: IPathDrawer): void;
|
|
534
550
|
__drawAfterFill?(canvas: ILeaferCanvas, options: IRenderOptions): void;
|
|
@@ -723,4 +739,4 @@ interface IEffectModule {
|
|
|
723
739
|
backgroundBlur?(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, renderOptions: IRenderOptions): void;
|
|
724
740
|
}
|
|
725
741
|
|
|
726
|
-
export type { IApp, IAppConfig, IAppData, IAppInputData, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, IColorString, ICornerRadiusString, IDashPatternString, IEditorBase, IEditorConfig, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IExportOptions, IExportResult, IExportResultFunction, IFill, IFindUIMethod, IFontWeight, IFrame, IFrameData, IFrameInputData, IFrameRenderModule, IGradientPaint, IGrayscaleEffect, IGroup, IGroupData, IGroupInputData, IGroupRenderModule, IImage, IImageData, IImageInputData, IImagePaint, IImagePaintMode, IImageRenderModule, ILeafFill, ILeafPaint, ILeafPaintColor, ILeafPaintPatternData, ILeafShadowEffect, ILeafStrokePaint, ILeafer, ILeaferData, ILeaferInputData, ILine, ILineData, ILineInputData, IOverflow, IPaint, IPaintModule, IPaintString, IPath, IPathData, IPathInputData, IPen, IPenData, IPenInputData, IPercent, IPolygon, IPolygonData, IPolygonInputData, IRGB, IRGBA, IRect, IRectData, IRectInputData, IRectRenderModule, IRepeat, IShadowEffect, IShadowString, IStar, IStarData, IStarInputData, IStroke, IStrokeAlign, IStrokeCap, IStrokeJoin, IStrokeWidthString, IText, ITextAlign, ITextCase, ITextCharData, ITextConvertModule, ITextData, ITextDecoration, ITextDrawData, ITextInputData, ITextRenderModule, ITextRowData, ITextWordData, ITextWrap, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIRenderModule, IUITag, IUnitData, IVectorPath, IVerticalAlign };
|
|
742
|
+
export type { IApp, IAppConfig, IAppData, IAppInputData, IArrow, IArrowData, IArrowInputData, IArrowType, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, IColorString, ICornerRadiusString, IDashPatternString, IEditorBase, IEditorConfig, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IExportOptions, IExportResult, IExportResultFunction, IFill, IFindUIMethod, IFontWeight, IFrame, IFrameData, IFrameInputData, IFrameRenderModule, IGradientPaint, IGrayscaleEffect, IGroup, IGroupData, IGroupInputData, IGroupRenderModule, IImage, IImageData, IImageInputData, IImagePaint, IImagePaintMode, IImageRenderModule, ILeafFill, ILeafPaint, ILeafPaintColor, ILeafPaintPatternData, ILeafShadowEffect, ILeafStrokePaint, ILeafer, ILeaferData, ILeaferInputData, ILine, ILineData, ILineInputData, IOverflow, IPaint, IPaintModule, IPaintString, IPath, IPathData, IPathInputData, IPen, IPenData, IPenInputData, IPercent, IPolygon, IPolygonData, IPolygonInputData, IRGB, IRGBA, IRect, IRectData, IRectInputData, IRectRenderModule, IRepeat, IShadowEffect, IShadowString, IStar, IStarData, IStarInputData, IStroke, IStrokeAlign, IStrokeCap, IStrokeJoin, IStrokeWidthString, IText, ITextAlign, ITextCase, ITextCharData, ITextConvertModule, ITextData, ITextDecoration, ITextDrawData, ITextInputData, ITextRenderModule, ITextRowData, ITextWordData, ITextWrap, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIRenderModule, IUITag, IUnitData, IVectorPath, IVerticalAlign };
|