@leafer-ui/interface 1.0.0 → 1.0.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/interface",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
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"
25
+ "@leafer/interface": "1.0.2"
26
26
  }
27
27
  }
package/src/IUI.ts CHANGED
@@ -224,6 +224,7 @@ export interface ICanvas extends IRect {
224
224
  interface ICanvasAttrData {
225
225
  smooth?: boolean
226
226
  contextSettings?: ICanvasContext2DSettings
227
+ url?: string
227
228
  }
228
229
  export interface ICanvasData extends ICanvasAttrData, IRectData { }
229
230
  export interface ICanvasInputData extends ICanvasAttrData, IUIBaseInputData { }
@@ -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
@@ -14,6 +14,7 @@ export interface IEditorBase extends IGroup, ISelectorProxy {
14
14
  readonly editing: boolean
15
15
  innerEditing: boolean
16
16
  readonly groupOpening: boolean
17
+ resizeDirection?: number
17
18
 
18
19
  readonly multiple: boolean
19
20
  readonly single: boolean
@@ -74,16 +75,20 @@ export interface IEditorConfig {
74
75
  pointSize?: number
75
76
  pointRadius?: number
76
77
 
77
- point?: IBoxInputData | IBoxInputData[]
78
- middlePoint?: IBoxInputData | IBoxInputData[]
79
- rotatePoint?: IBoxInputData
78
+ point?: IEditPointInputData | IEditPointInputData[]
79
+ middlePoint?: IEditPointInputData | IEditPointInputData[]
80
80
 
81
81
  rect?: IBoxInputData
82
82
  area?: IRectInputData
83
- mask?: IColorString
83
+ mask?: boolean | IColorString
84
84
 
85
- buttonsDirection?: 'top' | 'right' | 'bottom' | 'left'
86
- buttonsFixed?: boolean
85
+ circle?: IEditPointInputData
86
+ circleDirection?: IDirection4
87
+ circleMargin?: number
88
+ rotatePoint?: IEditPointInputData // 改用circle代替,后期可移除
89
+
90
+ buttonsDirection?: IDirection4
91
+ buttonsFixed?: boolean | 'AABB' | 'OBB'
87
92
  buttonsMargin?: number
88
93
 
89
94
  hideOnMove?: boolean
@@ -106,18 +111,23 @@ export interface IEditorConfig {
106
111
  continuousSelect?: boolean // 点击可以连续选择
107
112
  openInner?: 'double' | 'long' // 双击/长按打开内部
108
113
 
109
- moveable?: boolean
110
- rotateable?: boolean | 'rotate'
114
+ moveable?: boolean | 'move'
111
115
  resizeable?: boolean | 'zoom'
116
+ flipable?: boolean
117
+ rotateable?: boolean | 'rotate'
112
118
  skewable?: boolean
113
119
  }
114
120
 
121
+ export interface IEditPointInputData extends IBoxInputData {
122
+ direction?: number
123
+ pointType?: IEditPointType
124
+ }
115
125
  export interface IEditPoint extends IBox {
116
126
  direction: number
117
127
  pointType: IEditPointType
118
128
  }
119
129
 
120
- export type IEditPointType = 'rotate' | 'resize'
130
+ export type IEditPointType = 'rotate' | 'resize' | 'button'
121
131
 
122
132
  export interface IEditBoxBase extends IGroup {
123
133
  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'
@@ -16,6 +16,7 @@ export interface ILeafPaint {
16
16
  loadId?: number
17
17
  patternId?: string
18
18
  patternTask?: ITaskItem
19
+ sync?: boolean // 同步显示图片,不走任务列表生成图案
19
20
  data?: ILeafPaintPatternData
20
21
  }
21
22
 
package/src/type/IType.ts CHANGED
@@ -14,7 +14,6 @@ export interface IPaintBase {
14
14
  blendMode?: IBlendMode
15
15
  visible?: boolean
16
16
  opacity?: number
17
-
18
17
  }
19
18
 
20
19
  export type IPaintType =
@@ -76,6 +75,7 @@ export interface IImagePaint extends IPaintBase {
76
75
  rotation?: number
77
76
 
78
77
  repeat?: IRepeat
78
+ sync?: boolean // 同步显示,不走任务列表生成图案
79
79
  }
80
80
  export interface IImageFilters {
81
81
  exposure?: number // 曝光
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;
@@ -63,6 +63,7 @@ interface IImagePaint extends IPaintBase {
63
63
  scale?: number | IPointData;
64
64
  rotation?: number;
65
65
  repeat?: IRepeat;
66
+ sync?: boolean;
66
67
  }
67
68
  interface IImageFilters {
68
69
  exposure?: number;
@@ -135,6 +136,7 @@ interface ILeafPaint {
135
136
  loadId?: number;
136
137
  patternId?: string;
137
138
  patternTask?: ITaskItem;
139
+ sync?: boolean;
138
140
  data?: ILeafPaintPatternData;
139
141
  }
140
142
  interface ILeafPaintPatternData {
@@ -312,6 +314,7 @@ interface IEditorBase extends IGroup$1, ISelectorProxy {
312
314
  readonly editing: boolean;
313
315
  innerEditing: boolean;
314
316
  readonly groupOpening: boolean;
317
+ resizeDirection?: number;
315
318
  readonly multiple: boolean;
316
319
  readonly single: boolean;
317
320
  readonly dragging: boolean;
@@ -355,14 +358,17 @@ interface IEditorConfig {
355
358
  pointFill?: IFill$1;
356
359
  pointSize?: number;
357
360
  pointRadius?: number;
358
- point?: IBoxInputData$1 | IBoxInputData$1[];
359
- middlePoint?: IBoxInputData$1 | IBoxInputData$1[];
360
- rotatePoint?: IBoxInputData$1;
361
+ point?: IEditPointInputData | IEditPointInputData[];
362
+ middlePoint?: IEditPointInputData | IEditPointInputData[];
361
363
  rect?: IBoxInputData$1;
362
364
  area?: IRectInputData$1;
363
- mask?: IColorString$1;
364
- buttonsDirection?: 'top' | 'right' | 'bottom' | 'left';
365
- buttonsFixed?: boolean;
365
+ mask?: boolean | IColorString$1;
366
+ circle?: IEditPointInputData;
367
+ circleDirection?: IDirection4;
368
+ circleMargin?: number;
369
+ rotatePoint?: IEditPointInputData;
370
+ buttonsDirection?: IDirection4;
371
+ buttonsFixed?: boolean | 'AABB' | 'OBB';
366
372
  buttonsMargin?: number;
367
373
  hideOnMove?: boolean;
368
374
  hideOnSmall?: boolean | number;
@@ -380,16 +386,21 @@ interface IEditorConfig {
380
386
  boxSelect?: boolean;
381
387
  continuousSelect?: boolean;
382
388
  openInner?: 'double' | 'long';
383
- moveable?: boolean;
384
- rotateable?: boolean | 'rotate';
389
+ moveable?: boolean | 'move';
385
390
  resizeable?: boolean | 'zoom';
391
+ flipable?: boolean;
392
+ rotateable?: boolean | 'rotate';
386
393
  skewable?: boolean;
387
394
  }
395
+ interface IEditPointInputData extends IBoxInputData$1 {
396
+ direction?: number;
397
+ pointType?: IEditPointType;
398
+ }
388
399
  interface IEditPoint extends IBox$1 {
389
400
  direction: number;
390
401
  pointType: IEditPointType;
391
402
  }
392
- type IEditPointType = 'rotate' | 'resize';
403
+ type IEditPointType = 'rotate' | 'resize' | 'button';
393
404
  interface IEditBoxBase extends IGroup$1 {
394
405
  editor: IEditorBase;
395
406
  dragging: boolean;
@@ -606,6 +617,7 @@ interface ICanvas extends IRect {
606
617
  interface ICanvasAttrData {
607
618
  smooth?: boolean;
608
619
  contextSettings?: ICanvasContext2DSettings;
620
+ url?: string;
609
621
  }
610
622
  interface ICanvasData extends ICanvasAttrData, IRectData {
611
623
  }
@@ -868,4 +880,4 @@ interface IEffectModule {
868
880
  backgroundBlur(ui: IUI, current: ILeaferCanvas, shape: ICachedShape): void;
869
881
  }
870
882
 
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 };
883
+ 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 };