@leafer-ui/interface 1.0.0-rc.22 → 1.0.0-rc.23
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 +2 -2
- package/src/IUI.ts +16 -3
- package/src/editor/IEditor.ts +6 -4
- package/src/index.ts +2 -1
- package/src/type/IType.ts +2 -7
- package/types/index.d.ts +22 -14
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.23",
|
|
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.23"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/src/ICommonAttr.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { INumber, IBoolean, IString, IFourNumber } from '@leafer/interface'
|
|
2
|
-
import { IStrokeAlign, IStrokeCap, IStrokeJoin, IBlurEffect, IFontWeight, ITextCase, ITextDecoration, IShadowEffect, IGrayscaleEffect, ITextAlign, IVerticalAlign, IOverflow,
|
|
1
|
+
import { INumber, IBoolean, IString, IFourNumber, IUnitData } from '@leafer/interface'
|
|
2
|
+
import { IStrokeAlign, IStrokeCap, IStrokeJoin, IBlurEffect, IFontWeight, ITextCase, ITextDecoration, IShadowEffect, IGrayscaleEffect, ITextAlign, IVerticalAlign, IOverflow, ITextWrap, IStroke, IFill, IArrowType } from './type/IType'
|
|
3
3
|
import { ILeafStrokePaint, ILeafShadowEffect, ILeafPaint } from './type/IComputedType'
|
|
4
4
|
import { IDashPatternString, IShadowString, IColorString, IStrokeWidthString, ICornerRadiusString } from './type/IStringType'
|
|
5
5
|
|
package/src/IUI.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ILeaf, ILeafComputedData, ILeafData, ILeafInputData, ILeaferCanvas, IRenderOptions, IExportOptions, IExportResult, IPathDrawer, IPointData, IPathCommandData, ILeaferImageConfig, IBoundsData, IObject, IPathString, ILeaferImage, IPathCreator, IAnswer, IPickOptions, IPickResult, IValue, ICanvasContext2DSettings, IFourNumber } from '@leafer/interface'
|
|
1
|
+
import { ILeaf, ILeafComputedData, ILeafData, ILeafInputData, ILeaferCanvas, IRenderOptions, IExportOptions, IExportResult, IPathDrawer, IPointData, IPathCommandData, ILeaferImageConfig, IBoundsData, IObject, IPathString, ILeaferImage, IPathCreator, IAnswer, IPickOptions, IPickResult, IValue, ICanvasContext2DSettings, IFourNumber, IFindCondition } from '@leafer/interface'
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
IFillAttrData, IFillInputData, IFillComputedData,
|
|
@@ -40,6 +40,17 @@ interface IArrowAttrData {
|
|
|
40
40
|
export interface IArrowData extends IArrowAttrData, ILineData { }
|
|
41
41
|
export interface IArrowInputData extends IArrowAttrData, ILineInputData { }
|
|
42
42
|
|
|
43
|
+
// Flow
|
|
44
|
+
export interface IFlow extends IBox {
|
|
45
|
+
__: IFlowData
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
interface IFlowAttrData {
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
export interface IFlowData extends IFlowAttrData, IBoxData { }
|
|
52
|
+
export interface IFlowInputData extends IFlowAttrData, IBoxInputData { }
|
|
53
|
+
|
|
43
54
|
|
|
44
55
|
// Rect
|
|
45
56
|
export interface IRect extends IUI {
|
|
@@ -309,8 +320,10 @@ export interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrDa
|
|
|
309
320
|
get(name?: string | string[] | IUIInputData): IUIInputData | IValue
|
|
310
321
|
createProxyData(): IUIInputData
|
|
311
322
|
|
|
312
|
-
find(condition: number | string | IFindUIMethod, options?: any): IUI[]
|
|
313
|
-
|
|
323
|
+
find(condition: number | string | IFindCondition | IFindUIMethod, options?: any): IUI[]
|
|
324
|
+
findTag(tag: string | string[]): IUI[]
|
|
325
|
+
findOne(condition: number | string | IFindCondition | IFindUIMethod, options?: any): IUI
|
|
326
|
+
findId(id: number | string): IUI
|
|
314
327
|
|
|
315
328
|
getPath(curve?: boolean, pathForRender?: boolean): IPathCommandData
|
|
316
329
|
getPathString(curve?: boolean, pathForRender?: boolean): IPathString
|
package/src/editor/IEditor.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IGroup, IUI, IBox, IRectInputData, ISelectorProxy, IEditSize, ICursorType,
|
|
1
|
+
import { IGroup, IUI, IBox, IRectInputData, ISelectorProxy, IEditSize, ICursorType, IAlign, IUnitPointData, IDragEvent, IRotateEvent, IStroke, IFill, ILeaf, ILeafList, IObject, IBoxInputData, IGroupInputData, IImageCursor, IRect, IBoundsData, IKeyEvent, IUIInputData } from '@leafer-ui/interface'
|
|
2
2
|
|
|
3
3
|
export interface IEditorBase extends IGroup, ISelectorProxy {
|
|
4
4
|
config: IEditorConfig
|
|
@@ -28,6 +28,9 @@ export interface IEditorBase extends IGroup, ISelectorProxy {
|
|
|
28
28
|
editTool: IObject
|
|
29
29
|
innerEditor: IObject
|
|
30
30
|
|
|
31
|
+
select(target: IUI | IUI[]): void
|
|
32
|
+
cancel(): void
|
|
33
|
+
|
|
31
34
|
hasItem(item: IUI): boolean
|
|
32
35
|
shiftItem(item: IUI): void
|
|
33
36
|
addItem(item: IUI): void
|
|
@@ -59,7 +62,7 @@ export interface IEditorBase extends IGroup, ISelectorProxy {
|
|
|
59
62
|
}
|
|
60
63
|
|
|
61
64
|
export interface IEditorConfig {
|
|
62
|
-
editSize?:
|
|
65
|
+
editSize?: IEditSize
|
|
63
66
|
dualEvent?: boolean
|
|
64
67
|
keyEvent?: boolean
|
|
65
68
|
|
|
@@ -89,9 +92,8 @@ export interface IEditorConfig {
|
|
|
89
92
|
rotateCursor?: IImageCursor
|
|
90
93
|
skewCursor?: IImageCursor
|
|
91
94
|
|
|
92
|
-
around?:
|
|
95
|
+
around?: IAlign | IUnitPointData
|
|
93
96
|
lockRatio?: boolean | 'corner'
|
|
94
|
-
lockMove?: boolean | 'x' | 'y'
|
|
95
97
|
rotateGap?: number
|
|
96
98
|
|
|
97
99
|
selector?: boolean
|
package/src/index.ts
CHANGED
|
@@ -16,6 +16,7 @@ export {
|
|
|
16
16
|
IImage, IImageInputData, IImageData,
|
|
17
17
|
ICanvas, ICanvasInputData, ICanvasData,
|
|
18
18
|
IFrame, IFrameInputData, IFrameData,
|
|
19
|
+
IFlow, IFlowInputData, IFlowData,
|
|
19
20
|
IBox, IBoxInputData, IBoxData,
|
|
20
21
|
IGroup, IGroupInputData, IGroupData,
|
|
21
22
|
ILeaferInputData, ILeaferData,
|
|
@@ -24,7 +25,7 @@ export {
|
|
|
24
25
|
IUITag, IUIInputData
|
|
25
26
|
} from './IUI'
|
|
26
27
|
|
|
27
|
-
export {
|
|
28
|
+
export { IVectorPath, IShadowEffect, IBlurEffect, IGrayscaleEffect, IFill, IStroke, IPaintAttr, IStrokeAlign, IStrokeJoin, IStrokeCap, IArrowType, IPathDataArrow, IPathDataArrowMap, IRGB, IRGBA, IColor, IColorStop, IPaint, IGradientPaint, IImagePaint, IImagePaintMode, IFontWeight, ITextCase, ITextDecoration, ITextAlign, IVerticalAlign, IOverflow, ITextWrap, IRepeat } from './type/IType'
|
|
28
29
|
export { ICornerRadiusString, IStrokeWidthString, IPaintString, IShadowString, IPercent, IDashPatternString, IColorString } from './type/IStringType'
|
|
29
30
|
export { ILeafFill, ILeafPaint, ILeafPaintPatternData, ILeafPaintColor, ILeafStrokePaint, ILeafShadowEffect } from './type/IComputedType'
|
|
30
31
|
|
package/src/type/IType.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import { IPointData, IPathCommandData, IWindingRule, IBlendMode, IExportFileType, ISizeData, IFourNumber,
|
|
1
|
+
import { IPointData, IPathCommandData, IWindingRule, IBlendMode, IExportFileType, ISizeData, IFourNumber, IAlign } from '@leafer/interface'
|
|
2
2
|
import { IColorString, IPaintString } from './IStringType'
|
|
3
3
|
|
|
4
|
-
export interface IUnitData {
|
|
5
|
-
type: 'percent' | 'px'
|
|
6
|
-
value: number
|
|
7
|
-
}
|
|
8
|
-
|
|
9
4
|
export type IPaint = ISolidPaint | IGradientPaint | IImagePaint
|
|
10
5
|
|
|
11
6
|
export type IFill = IPaint | IPaint[] | IPaintString
|
|
@@ -73,7 +68,7 @@ export interface IImagePaint extends IPaintBase {
|
|
|
73
68
|
|
|
74
69
|
padding?: IFourNumber
|
|
75
70
|
|
|
76
|
-
|
|
71
|
+
align?: IAlign
|
|
77
72
|
offset?: IPointData
|
|
78
73
|
|
|
79
74
|
size?: number | ISizeData
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IPointData, IExportFileType, IFourNumber,
|
|
1
|
+
import { IPointData, IExportFileType, IFourNumber, IAlign, ISizeData, IPathCommandData, IWindingRule, IBlendMode, IMatrixData, ILeaferImage, ITaskItem, INumber, IBoolean, IString, IUnitData, IPathCreator, IBoundsData as IBoundsData$1, ILeaferImageConfig, ICanvasContext2DSettings, ILeaferCanvas, IRenderOptions, IPickOptions, IPickResult, ILeaf as ILeaf$1, IValue, IFindCondition, IPathString, IPathDrawer, IExportOptions, IExportResult, IAnswer, ILeafData, ILeafComputedData, ILeafInputData, IObject as IObject$1, ILeaferAttrData, IControl, ILeaferConfig, ILeaferType, ILeafRender, ILeafBounds, ILeafHit, IStateStyleType, ICachedLeaf, IBooleanMap, IAround } from '@leafer/interface';
|
|
2
2
|
export * from '@leafer/interface';
|
|
3
|
-
import { IGroup as IGroup$1, ISelectorProxy, IUI as IUI$1, ILeafList, IObject, ILeaf, IEditSize, IDragEvent, IRotateEvent, IGroupInputData as IGroupInputData$1, IStroke as IStroke$1, IFill as IFill$1, IBoxInputData as IBoxInputData$1, IRectInputData as IRectInputData$1, ICursorType, IImageCursor,
|
|
3
|
+
import { IGroup as IGroup$1, ISelectorProxy, IUI as IUI$1, ILeafList, IObject, ILeaf, IEditSize, IDragEvent, IRotateEvent, IGroupInputData as IGroupInputData$1, IStroke as IStroke$1, IFill as IFill$1, IBoxInputData as IBoxInputData$1, IRectInputData as IRectInputData$1, ICursorType, IImageCursor, IAlign as IAlign$1, IUnitPointData, IUIInputData as IUIInputData$1, IBox as IBox$1, IRect as IRect$1, IBoundsData, IKeyEvent } from '@leafer-ui/interface';
|
|
4
4
|
|
|
5
5
|
type IPercent = string;
|
|
6
6
|
type IColorString = string;
|
|
@@ -13,10 +13,6 @@ type IGradientPaintString = string;
|
|
|
13
13
|
type IImagePaintString = string;
|
|
14
14
|
type IShadowString = string;
|
|
15
15
|
|
|
16
|
-
interface IUnitData {
|
|
17
|
-
type: 'percent' | 'px';
|
|
18
|
-
value: number;
|
|
19
|
-
}
|
|
20
16
|
type IPaint = ISolidPaint | IGradientPaint | IImagePaint;
|
|
21
17
|
type IFill = IPaint | IPaint[] | IPaintString;
|
|
22
18
|
type IStroke = IPaint | IPaint[] | IPaintString;
|
|
@@ -61,7 +57,7 @@ interface IImagePaint extends IPaintBase {
|
|
|
61
57
|
format?: IExportFileType;
|
|
62
58
|
filters?: IImageFilters;
|
|
63
59
|
padding?: IFourNumber;
|
|
64
|
-
|
|
60
|
+
align?: IAlign;
|
|
65
61
|
offset?: IPointData;
|
|
66
62
|
size?: number | ISizeData;
|
|
67
63
|
scale?: number | IPointData;
|
|
@@ -325,6 +321,8 @@ interface IEditorBase extends IGroup$1, ISelectorProxy {
|
|
|
325
321
|
editBox: IEditBoxBase;
|
|
326
322
|
editTool: IObject;
|
|
327
323
|
innerEditor: IObject;
|
|
324
|
+
select(target: IUI$1 | IUI$1[]): void;
|
|
325
|
+
cancel(): void;
|
|
328
326
|
hasItem(item: IUI$1): boolean;
|
|
329
327
|
shiftItem(item: IUI$1): void;
|
|
330
328
|
addItem(item: IUI$1): void;
|
|
@@ -348,7 +346,7 @@ interface IEditorBase extends IGroup$1, ISelectorProxy {
|
|
|
348
346
|
toBottom(): void;
|
|
349
347
|
}
|
|
350
348
|
interface IEditorConfig {
|
|
351
|
-
editSize?:
|
|
349
|
+
editSize?: IEditSize;
|
|
352
350
|
dualEvent?: boolean;
|
|
353
351
|
keyEvent?: boolean;
|
|
354
352
|
stroke?: IStroke$1;
|
|
@@ -370,9 +368,8 @@ interface IEditorConfig {
|
|
|
370
368
|
resizeCursor?: IImageCursor;
|
|
371
369
|
rotateCursor?: IImageCursor;
|
|
372
370
|
skewCursor?: IImageCursor;
|
|
373
|
-
around?:
|
|
371
|
+
around?: IAlign$1 | IUnitPointData;
|
|
374
372
|
lockRatio?: boolean | 'corner';
|
|
375
|
-
lockMove?: boolean | 'x' | 'y';
|
|
376
373
|
rotateGap?: number;
|
|
377
374
|
selector?: boolean;
|
|
378
375
|
hover?: boolean;
|
|
@@ -446,6 +443,15 @@ interface IArrowData extends IArrowAttrData, ILineData {
|
|
|
446
443
|
}
|
|
447
444
|
interface IArrowInputData extends IArrowAttrData, ILineInputData {
|
|
448
445
|
}
|
|
446
|
+
interface IFlow extends IBox {
|
|
447
|
+
__: IFlowData;
|
|
448
|
+
}
|
|
449
|
+
interface IFlowAttrData {
|
|
450
|
+
}
|
|
451
|
+
interface IFlowData extends IFlowAttrData, IBoxData {
|
|
452
|
+
}
|
|
453
|
+
interface IFlowInputData extends IFlowAttrData, IBoxInputData {
|
|
454
|
+
}
|
|
449
455
|
interface IRect extends IUI {
|
|
450
456
|
__: IRectData;
|
|
451
457
|
}
|
|
@@ -668,8 +674,10 @@ interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrData, IEf
|
|
|
668
674
|
toJSON(): IUIInputData;
|
|
669
675
|
get(name?: string | string[] | IUIInputData): IUIInputData | IValue;
|
|
670
676
|
createProxyData(): IUIInputData;
|
|
671
|
-
find(condition: number | string | IFindUIMethod, options?: any): IUI[];
|
|
672
|
-
|
|
677
|
+
find(condition: number | string | IFindCondition | IFindUIMethod, options?: any): IUI[];
|
|
678
|
+
findTag(tag: string | string[]): IUI[];
|
|
679
|
+
findOne(condition: number | string | IFindCondition | IFindUIMethod, options?: any): IUI;
|
|
680
|
+
findId(id: number | string): IUI;
|
|
673
681
|
getPath(curve?: boolean, pathForRender?: boolean): IPathCommandData;
|
|
674
682
|
getPathString(curve?: boolean, pathForRender?: boolean): IPathString;
|
|
675
683
|
__drawPathByData(drawer: IPathDrawer, data: IPathCommandData): void;
|
|
@@ -833,7 +841,7 @@ interface IPaintImageModule {
|
|
|
833
841
|
createData(leafPaint: ILeafPaint, image: ILeaferImage, paint: IImagePaint, box: IBoundsData$1): void;
|
|
834
842
|
fillOrFitMode(data: ILeafPaintPatternData, box: IBoundsData$1, x: number, y: number, scaleX: number, scaleY: number, rotation: number): void;
|
|
835
843
|
clipMode(data: ILeafPaintPatternData, box: IBoundsData$1, x: number, y: number, scaleX: number, scaleY: number, rotation: number): void;
|
|
836
|
-
repeatMode(data: ILeafPaintPatternData, box: IBoundsData$1, width: number, height: number, x: number, y: number, scaleX: number, scaleY: number, rotation: number, around: IAround
|
|
844
|
+
repeatMode(data: ILeafPaintPatternData, box: IBoundsData$1, width: number, height: number, x: number, y: number, scaleX: number, scaleY: number, rotation: number, around: IAround): void;
|
|
837
845
|
}
|
|
838
846
|
interface IPaintGradientModule {
|
|
839
847
|
linearGradient(paint: IGradientPaint, box: IBoundsData$1): ILeafPaint;
|
|
@@ -848,4 +856,4 @@ interface IEffectModule {
|
|
|
848
856
|
backgroundBlur(ui: IUI, current: ILeaferCanvas, shape: ICachedShape): void;
|
|
849
857
|
}
|
|
850
858
|
|
|
851
|
-
export type { IApp, IAppConfig, IAppData, IAppInputData, IArrow, IArrowData, IArrowInputData, IArrowType, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, IColorString, ICornerRadiusString, IDashPatternString, IEditBoxBase, IEditPoint, IEditPointType, IEditToolFunction, IEditorBase, IEditorConfig, IEditorConfigFunction, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, 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, IPaintAttr, IPaintGradientModule, IPaintImageModule, IPaintModule, IPaintString, IPath, IPathArrowModule, IPathData, IPathDataArrow, IPathDataArrowMap, IPathInputData, IPen, IPenData, IPenInputData, IPercent, IPolygon, IPolygonData, IPolygonInputData, IRGB, IRGBA, IRect, IRectData, IRectInputData, IRectRenderModule, IRepeat, IShadowEffect, IShadowString, IStar, IStarData, IStarInputData, IStateModule, 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,
|
|
859
|
+
export type { IApp, IAppConfig, IAppData, IAppInputData, IArrow, IArrowData, IArrowInputData, IArrowType, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, IColorString, ICornerRadiusString, IDashPatternString, IEditBoxBase, IEditPoint, IEditPointType, IEditToolFunction, IEditorBase, IEditorConfig, IEditorConfigFunction, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IFill, IFindUIMethod, IFlow, IFlowData, IFlowInputData, 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, IPaintAttr, IPaintGradientModule, IPaintImageModule, IPaintModule, IPaintString, IPath, IPathArrowModule, IPathData, IPathDataArrow, IPathDataArrowMap, IPathInputData, IPen, IPenData, IPenInputData, IPercent, IPolygon, IPolygonData, IPolygonInputData, IRGB, IRGBA, IRect, IRectData, IRectInputData, IRectRenderModule, IRepeat, IShadowEffect, IShadowString, IStar, IStarData, IStarInputData, IStateModule, 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, IVectorPath, IVerticalAlign };
|