@leafer-ui/interface 1.0.0 → 1.0.1
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 +19 -10
- package/src/index.ts +1 -1
- package/types/index.d.ts +19 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/interface",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
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.
|
|
25
|
+
"@leafer/interface": "1.0.1"
|
|
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, IRotateEvent, IStroke, IFill, ILeaf, ILeafList, IObject, IBoxInputData, IGroupInputData, IImageCursor, IRect, IBoundsData, IKeyEvent, IUIInputData, IZoomEvent, IColorString } from '@leafer-ui/interface'
|
|
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, IZoomEvent, IColorString, IDirection4 } from '@leafer-ui/interface'
|
|
2
2
|
|
|
3
3
|
export interface IEditorBase extends IGroup, ISelectorProxy {
|
|
4
4
|
config: IEditorConfig
|
|
@@ -74,16 +74,20 @@ export interface IEditorConfig {
|
|
|
74
74
|
pointSize?: number
|
|
75
75
|
pointRadius?: number
|
|
76
76
|
|
|
77
|
-
point?:
|
|
78
|
-
middlePoint?:
|
|
79
|
-
rotatePoint?: IBoxInputData
|
|
77
|
+
point?: IEditPointInputData | IEditPointInputData[]
|
|
78
|
+
middlePoint?: IEditPointInputData | IEditPointInputData[]
|
|
80
79
|
|
|
81
80
|
rect?: IBoxInputData
|
|
82
81
|
area?: IRectInputData
|
|
83
|
-
mask?: IColorString
|
|
82
|
+
mask?: boolean | IColorString
|
|
84
83
|
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
circle?: IEditPointInputData
|
|
85
|
+
circleDirection?: IDirection4
|
|
86
|
+
circleMargin?: number
|
|
87
|
+
rotatePoint?: IEditPointInputData // 改用circle代替,后期可移除
|
|
88
|
+
|
|
89
|
+
buttonsDirection?: IDirection4
|
|
90
|
+
buttonsFixed?: boolean | 'AABB' | 'OBB'
|
|
87
91
|
buttonsMargin?: number
|
|
88
92
|
|
|
89
93
|
hideOnMove?: boolean
|
|
@@ -106,18 +110,23 @@ export interface IEditorConfig {
|
|
|
106
110
|
continuousSelect?: boolean // 点击可以连续选择
|
|
107
111
|
openInner?: 'double' | 'long' // 双击/长按打开内部
|
|
108
112
|
|
|
109
|
-
moveable?: boolean
|
|
110
|
-
rotateable?: boolean | 'rotate'
|
|
113
|
+
moveable?: boolean | 'move'
|
|
111
114
|
resizeable?: boolean | 'zoom'
|
|
115
|
+
flipable?: boolean
|
|
116
|
+
rotateable?: boolean | 'rotate'
|
|
112
117
|
skewable?: boolean
|
|
113
118
|
}
|
|
114
119
|
|
|
120
|
+
export interface IEditPointInputData extends IBoxInputData {
|
|
121
|
+
direction?: number
|
|
122
|
+
pointType?: IEditPointType
|
|
123
|
+
}
|
|
115
124
|
export interface IEditPoint extends IBox {
|
|
116
125
|
direction: number
|
|
117
126
|
pointType: IEditPointType
|
|
118
127
|
}
|
|
119
128
|
|
|
120
|
-
export type IEditPointType = 'rotate' | 'resize'
|
|
129
|
+
export type IEditPointType = 'rotate' | 'resize' | 'button'
|
|
121
130
|
|
|
122
131
|
export interface IEditBoxBase extends IGroup {
|
|
123
132
|
editor: IEditorBase
|
package/src/index.ts
CHANGED
|
@@ -43,4 +43,4 @@ export { IPaintModule, IPaintImageModule, IPaintGradientModule } from './module/
|
|
|
43
43
|
export { IEffectModule } from './module/IEffect'
|
|
44
44
|
export { ICachedShape } from './ICachedShape'
|
|
45
45
|
|
|
46
|
-
export { IEditorBase, IEditorConfig, IEditBoxBase, IEditPoint, IEditPointType, IEditToolFunction, IEditorConfigFunction } from './editor/IEditor'
|
|
46
|
+
export { IEditorBase, IEditorConfig, IEditBoxBase, IEditPoint, IEditPointInputData, IEditPointType, IEditToolFunction, IEditorConfigFunction } from './editor/IEditor'
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IAlign, IUnitPointData, IExportFileType, IFourNumber, IPointData, ISizeData, IPathCommandData, IWindingRule, IBlendMode, IMatrixData, ILeaferImage, ITaskItem, IBoolean, INumber, IString, IUnitData, IPathCreator, IBoundsData as IBoundsData$1, ILeaferImageConfig, ICanvasContext2DSettings, ILeaferCanvas, ICanvasContext2D, IRenderOptions, IPickOptions, IPickResult, ILeaf as ILeaf$1, IJSONOptions, 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, IZoomEvent, IRotateEvent, IGroupInputData as IGroupInputData$1, IStroke as IStroke$1, IFill as IFill$1, IBoxInputData as IBoxInputData$1, IRectInputData as IRectInputData$1, IColorString as IColorString$1, ICursorType, IImageCursor, IAlign as IAlign$1, IUnitPointData as IUnitPointData$1, IUIInputData as IUIInputData$1, IBox as IBox$1, IRect as IRect$1, IBoundsData, IKeyEvent } from '@leafer-ui/interface';
|
|
3
|
+
import { IGroup as IGroup$1, ISelectorProxy, IUI as IUI$1, ILeafList, IObject, ILeaf, IEditSize, IDragEvent, IZoomEvent, IRotateEvent, IGroupInputData as IGroupInputData$1, IStroke as IStroke$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, 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;
|
|
@@ -355,14 +355,17 @@ interface IEditorConfig {
|
|
|
355
355
|
pointFill?: IFill$1;
|
|
356
356
|
pointSize?: number;
|
|
357
357
|
pointRadius?: number;
|
|
358
|
-
point?:
|
|
359
|
-
middlePoint?:
|
|
360
|
-
rotatePoint?: IBoxInputData$1;
|
|
358
|
+
point?: IEditPointInputData | IEditPointInputData[];
|
|
359
|
+
middlePoint?: IEditPointInputData | IEditPointInputData[];
|
|
361
360
|
rect?: IBoxInputData$1;
|
|
362
361
|
area?: IRectInputData$1;
|
|
363
|
-
mask?: IColorString$1;
|
|
364
|
-
|
|
365
|
-
|
|
362
|
+
mask?: boolean | IColorString$1;
|
|
363
|
+
circle?: IEditPointInputData;
|
|
364
|
+
circleDirection?: IDirection4;
|
|
365
|
+
circleMargin?: number;
|
|
366
|
+
rotatePoint?: IEditPointInputData;
|
|
367
|
+
buttonsDirection?: IDirection4;
|
|
368
|
+
buttonsFixed?: boolean | 'AABB' | 'OBB';
|
|
366
369
|
buttonsMargin?: number;
|
|
367
370
|
hideOnMove?: boolean;
|
|
368
371
|
hideOnSmall?: boolean | number;
|
|
@@ -380,16 +383,21 @@ interface IEditorConfig {
|
|
|
380
383
|
boxSelect?: boolean;
|
|
381
384
|
continuousSelect?: boolean;
|
|
382
385
|
openInner?: 'double' | 'long';
|
|
383
|
-
moveable?: boolean;
|
|
384
|
-
rotateable?: boolean | 'rotate';
|
|
386
|
+
moveable?: boolean | 'move';
|
|
385
387
|
resizeable?: boolean | 'zoom';
|
|
388
|
+
flipable?: boolean;
|
|
389
|
+
rotateable?: boolean | 'rotate';
|
|
386
390
|
skewable?: boolean;
|
|
387
391
|
}
|
|
392
|
+
interface IEditPointInputData extends IBoxInputData$1 {
|
|
393
|
+
direction?: number;
|
|
394
|
+
pointType?: IEditPointType;
|
|
395
|
+
}
|
|
388
396
|
interface IEditPoint extends IBox$1 {
|
|
389
397
|
direction: number;
|
|
390
398
|
pointType: IEditPointType;
|
|
391
399
|
}
|
|
392
|
-
type IEditPointType = 'rotate' | 'resize';
|
|
400
|
+
type IEditPointType = 'rotate' | 'resize' | 'button';
|
|
393
401
|
interface IEditBoxBase extends IGroup$1 {
|
|
394
402
|
editor: IEditorBase;
|
|
395
403
|
dragging: boolean;
|
|
@@ -868,4 +876,4 @@ interface IEffectModule {
|
|
|
868
876
|
backgroundBlur(ui: IUI, current: ILeaferCanvas, shape: ICachedShape): void;
|
|
869
877
|
}
|
|
870
878
|
|
|
871
|
-
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, IEffectAttrData, IEffectComputedData, IEffectInputData, 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, IStrokeAttrData, IStrokeCap, IStrokeComputedData, IStrokeInputData, IStrokeJoin, IStrokeWidthString, IText, ITextAlign, ITextCase, ITextCharData, ITextConvertModule, ITextData, ITextDecoration, ITextDrawData, ITextInputData, ITextRenderModule, ITextRowData, ITextStyleAttrData, ITextStyleComputedData, ITextStyleInputData, ITextWordData, ITextWrap, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIJSONData, IUIRenderModule, IUITag, IVectorPath, IVerticalAlign };
|
|
879
|
+
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, IEditPointInputData, IEditPointType, IEditToolFunction, IEditorBase, IEditorConfig, IEditorConfigFunction, IEffectAttrData, IEffectComputedData, IEffectInputData, 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, IStrokeAttrData, IStrokeCap, IStrokeComputedData, IStrokeInputData, IStrokeJoin, IStrokeWidthString, IText, ITextAlign, ITextCase, ITextCharData, ITextConvertModule, ITextData, ITextDecoration, ITextDrawData, ITextInputData, ITextRenderModule, ITextRowData, ITextStyleAttrData, ITextStyleComputedData, ITextStyleInputData, ITextWordData, ITextWrap, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIJSONData, IUIRenderModule, IUITag, IVectorPath, IVerticalAlign };
|