@leafer-ui/interface 1.4.2 → 1.5.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/interface",
3
- "version": "1.4.2",
3
+ "version": "1.5.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.4.2"
25
+ "@leafer/interface": "1.5.1"
26
26
  }
27
27
  }
package/src/IUI.ts CHANGED
@@ -376,10 +376,6 @@ export interface IUI extends IUIAttrData, IFillAttrData, IStrokeAttrData, ICorne
376
376
  animation?: IAnimation | IAnimation[]
377
377
  animationOut?: IAnimation | IAnimation[]
378
378
 
379
- editConfig?: IEditorConfig
380
- editOuter: string
381
- editInner: string
382
-
383
379
  children?: IUI[]
384
380
 
385
381
  __animate?: IAnimate
@@ -413,6 +409,7 @@ export interface IUI extends IUIAttrData, IFillAttrData, IStrokeAttrData, ICorne
413
409
  killAnimate(type?: IAnimateType, nextStyle?: IUIInputData): void
414
410
 
415
411
  export(filename: string, options?: IExportOptions | number | boolean): Promise<IExportResult>
412
+ syncExport(filename: string, options?: IExportOptions | number | boolean): IExportResult
416
413
  clone(data?: IUIInputData): IUI
417
414
  }
418
415
 
@@ -446,6 +443,10 @@ interface IUIAttrData {
446
443
  selectedStyle?: IStateStyle
447
444
  disabledStyle?: IStateStyle
448
445
  placeholderStyle?: IStateStyle
446
+
447
+ editConfig?: IEditorConfig
448
+ editOuter?: string
449
+ editInner?: string
449
450
  }
450
451
 
451
452
  export interface IFindUIMethod {
@@ -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, IDirection4 } 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, IPointData, ILayoutBoundsData } from '@leafer-ui/interface'
2
2
 
3
3
  export interface IEditorBase extends IGroup, ISelectorProxy {
4
4
  config: IEditorConfig
@@ -14,13 +14,13 @@ export interface IEditorBase extends IGroup, ISelectorProxy {
14
14
  readonly editing: boolean
15
15
  innerEditing: boolean
16
16
  readonly groupOpening: boolean
17
- resizeDirection?: number
18
17
 
19
18
  readonly multiple: boolean
20
19
  readonly single: boolean
21
20
 
22
21
  readonly dragging: boolean
23
22
  readonly moving: boolean
23
+ readonly dragPoint: IEditPoint // 正在拖拽的控制点
24
24
 
25
25
  element?: IUI
26
26
  buttons: IGroup
@@ -105,9 +105,11 @@ export interface IEditorConfig extends IObject {
105
105
  rotateGap?: number
106
106
 
107
107
  selector?: boolean
108
+ editBox?: boolean
108
109
  hover?: boolean
109
110
  hoverStyle?: IUIInputData
110
111
  select?: 'press' | 'tap'
112
+ selectedStyle?: IUIInputData
111
113
  boxSelect?: boolean
112
114
  continuousSelect?: boolean // 点击可以连续选择
113
115
  openInner?: 'double' | 'long' // 双击/长按打开内部
@@ -131,7 +133,7 @@ export interface IEditPoint extends IBox {
131
133
  pointType: IEditPointType
132
134
  }
133
135
 
134
- export type IEditPointType = 'rotate' | 'resize' | 'button'
136
+ export type IEditPointType = 'rotate' | 'resize' | 'resize-rotate' | 'button'
135
137
 
136
138
  export interface IEditBoxBase extends IGroup {
137
139
  editor: IEditorBase
@@ -149,13 +151,16 @@ export interface IEditBoxBase extends IGroup {
149
151
  rotatePoints: IEditPoint[]
150
152
  resizeLines: IEditPoint[]
151
153
 
154
+ enterPoint: IEditPoint
155
+ dragPoint: IEditPoint // 正在拖拽的控制点
156
+
157
+ dragStartData: IEditorDragStartData
158
+
152
159
  readonly flipped: boolean
153
160
  readonly flippedX: boolean
154
161
  readonly flippedY: boolean
155
162
  readonly flippedOne: boolean
156
163
 
157
- enterPoint: IEditPoint
158
-
159
164
  getPointStyle(userStyle?: IBoxInputData): IBoxInputData
160
165
  getPointsStyle(): IBoxInputData[]
161
166
  getMiddlePointsStyle(): IBoxInputData[]
@@ -168,6 +173,14 @@ export interface IEditBoxBase extends IGroup {
168
173
 
169
174
  }
170
175
 
176
+ export interface IEditorDragStartData {
177
+ x: number
178
+ y: number
179
+ point: IPointData
180
+ bounds: ILayoutBoundsData
181
+ rotation: number
182
+ }
183
+
171
184
  export interface IEditorConfigFunction {
172
185
  (ui: any): IEditorConfig
173
186
  }
package/src/index.ts CHANGED
@@ -50,4 +50,4 @@ export { IEffectModule } from './module/IEffect'
50
50
  export { IFilterModule, IFilterProcessor, IFilterFunction } from './module/IFilter'
51
51
  export { ICachedShape } from './ICachedShape'
52
52
 
53
- export { IEditorBase, IEditorConfig, IEditBoxBase, IEditPoint, IEditPointInputData, IEditPointType, IEditToolFunction, IEditorConfigFunction } from './editor/IEditor'
53
+ export { IEditorBase, IEditorConfig, IEditBoxBase, IEditPoint, IEditPointInputData, IEditPointType, IEditorDragStartData, IEditToolFunction, IEditorConfigFunction } from './editor/IEditor'
@@ -4,4 +4,5 @@ import { ILeaf, IExportFileType, IExportOptions, IExportResult } from '@leafer/i
4
4
  export interface IExportModule {
5
5
  running?: boolean
6
6
  export(leaf: ILeaf, filename: IExportFileType | string, options?: IExportOptions | number | boolean): Promise<IExportResult>
7
+ syncExport(leaf: ILeaf, filename: string, options?: IExportOptions | number | boolean): IExportResult
7
8
  }
package/src/type/IType.ts CHANGED
@@ -77,6 +77,8 @@ export interface IImagePaint extends IPaintBase {
77
77
  rotation?: number
78
78
 
79
79
  repeat?: IRepeat
80
+
81
+ changeful?: boolean // 会频繁变化 url(有特殊性能优化,一般用于游戏精灵、动图场景)
80
82
  sync?: boolean // 同步显示,不走任务列表生成图案
81
83
  }
82
84
  export interface IImageFilters {
package/types/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { IBlendMode, IAlign, IUnitPointData, IExportFileType, IFourNumber, IPointData, ISizeData, IPathCommandData, IAxis, IAxisReverse, IWindingRule, IFilter, IMatrixData, ILeaferImage, ITaskItem, IBoolean, INumber, IString, IUnitData, IAnimateOptions, IAnimateEasing, IEventer, IObject, IEventMap, IAnimateEasingFunction, IAnimateEnding, ITransition, IPercentData, ILeafInputData, ILeaf as ILeaf$1, ILeafComputedData, ILeafData, IBoundsData as IBoundsData$1, IPathCreator, IJSONOptions, IValue, IFindCondition, IAnswer, IPathString, IPathDrawer, ILeaferCanvas, IRenderOptions, IExportOptions, IExportResult, IPickOptions, IPickResult, ICanvasContext2DSettings, ICanvasContext2D, ILeaferAttrData, IControl, ILeaferType, ILeaferConfig, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IBooleanMap, IAround, IMatrixWithBoundsScaleData } from '@leafer/interface';
2
2
  export * from '@leafer/interface';
3
- import { IObject as IObject$1, IEditSize, 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, IGroup as IGroup$1, ISelectorProxy, IUI as IUI$1, ILeafList, IBox as IBox$1, IRect as IRect$1, IBoundsData, IKeyEvent, ILeaf, IDragEvent, IZoomEvent, IRotateEvent, 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, 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, IGroup as IGroup$1, ISelectorProxy, IUI as IUI$1, ILeafList, IBox as IBox$1, IRect as IRect$1, IPointData as IPointData$1, ILayoutBoundsData, IBoundsData, IKeyEvent, ILeaf, IDragEvent, IZoomEvent, IRotateEvent, 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;
@@ -63,6 +63,7 @@ interface IImagePaint extends IPaintBase {
63
63
  scale?: number | IPointData;
64
64
  rotation?: number;
65
65
  repeat?: IRepeat;
66
+ changeful?: boolean;
66
67
  sync?: boolean;
67
68
  }
68
69
  interface IImageFilters {
@@ -387,11 +388,11 @@ interface IEditorBase extends IGroup$1, ISelectorProxy {
387
388
  readonly editing: boolean;
388
389
  innerEditing: boolean;
389
390
  readonly groupOpening: boolean;
390
- resizeDirection?: number;
391
391
  readonly multiple: boolean;
392
392
  readonly single: boolean;
393
393
  readonly dragging: boolean;
394
394
  readonly moving: boolean;
395
+ readonly dragPoint: IEditPoint;
395
396
  element?: IUI$1;
396
397
  buttons: IGroup$1;
397
398
  selector: IGroup$1;
@@ -454,9 +455,11 @@ interface IEditorConfig extends IObject$1 {
454
455
  lockRatio?: boolean | 'corner';
455
456
  rotateGap?: number;
456
457
  selector?: boolean;
458
+ editBox?: boolean;
457
459
  hover?: boolean;
458
460
  hoverStyle?: IUIInputData$1;
459
461
  select?: 'press' | 'tap';
462
+ selectedStyle?: IUIInputData$1;
460
463
  boxSelect?: boolean;
461
464
  continuousSelect?: boolean;
462
465
  openInner?: 'double' | 'long';
@@ -476,7 +479,7 @@ interface IEditPoint extends IBox$1 {
476
479
  direction: number;
477
480
  pointType: IEditPointType;
478
481
  }
479
- type IEditPointType = 'rotate' | 'resize' | 'button';
482
+ type IEditPointType = 'rotate' | 'resize' | 'resize-rotate' | 'button';
480
483
  interface IEditBoxBase extends IGroup$1 {
481
484
  editor: IEditorBase;
482
485
  dragging: boolean;
@@ -488,11 +491,13 @@ interface IEditBoxBase extends IGroup$1 {
488
491
  resizePoints: IEditPoint[];
489
492
  rotatePoints: IEditPoint[];
490
493
  resizeLines: IEditPoint[];
494
+ enterPoint: IEditPoint;
495
+ dragPoint: IEditPoint;
496
+ dragStartData: IEditorDragStartData;
491
497
  readonly flipped: boolean;
492
498
  readonly flippedX: boolean;
493
499
  readonly flippedY: boolean;
494
500
  readonly flippedOne: boolean;
495
- enterPoint: IEditPoint;
496
501
  getPointStyle(userStyle?: IBoxInputData$1): IBoxInputData$1;
497
502
  getPointsStyle(): IBoxInputData$1[];
498
503
  getMiddlePointsStyle(): IBoxInputData$1[];
@@ -501,6 +506,13 @@ interface IEditBoxBase extends IGroup$1 {
501
506
  unload(): void;
502
507
  onArrow(e: IKeyEvent): void;
503
508
  }
509
+ interface IEditorDragStartData {
510
+ x: number;
511
+ y: number;
512
+ point: IPointData$1;
513
+ bounds: ILayoutBoundsData;
514
+ rotation: number;
515
+ }
504
516
  interface IEditorConfigFunction {
505
517
  (ui: any): IEditorConfig;
506
518
  }
@@ -806,9 +818,6 @@ interface IUI extends IUIAttrData, IFillAttrData, IStrokeAttrData, ICornerRadius
806
818
  __proxyData?: IUIInputData;
807
819
  animation?: IAnimation | IAnimation[];
808
820
  animationOut?: IAnimation | IAnimation[];
809
- editConfig?: IEditorConfig;
810
- editOuter: string;
811
- editInner: string;
812
821
  children?: IUI[];
813
822
  __animate?: IAnimate;
814
823
  readonly pen: IPathCreator;
@@ -831,6 +840,7 @@ interface IUI extends IUIAttrData, IFillAttrData, IStrokeAttrData, ICornerRadius
831
840
  animate(keyframe?: IUIInputData | IKeyframe[] | IAnimation | IAnimation[], options?: ITransition, type?: IAnimateType, isTemp?: boolean): IAnimate;
832
841
  killAnimate(type?: IAnimateType, nextStyle?: IUIInputData): void;
833
842
  export(filename: string, options?: IExportOptions | number | boolean): Promise<IExportResult>;
843
+ syncExport(filename: string, options?: IExportOptions | number | boolean): IExportResult;
834
844
  clone(data?: IUIInputData): IUI;
835
845
  }
836
846
  interface IStateStyle extends IUIInputData {
@@ -852,6 +862,9 @@ interface IUIAttrData {
852
862
  selectedStyle?: IStateStyle;
853
863
  disabledStyle?: IStateStyle;
854
864
  placeholderStyle?: IStateStyle;
865
+ editConfig?: IEditorConfig;
866
+ editOuter?: string;
867
+ editInner?: string;
855
868
  }
856
869
  interface IFindUIMethod {
857
870
  (leaf: IUI, options?: any): IAnswer;
@@ -978,6 +991,7 @@ interface IColorConvertModule {
978
991
  interface IExportModule {
979
992
  running?: boolean;
980
993
  export(leaf: ILeaf$1, filename: IExportFileType | string, options?: IExportOptions | number | boolean): Promise<IExportResult>;
994
+ syncExport(leaf: ILeaf$1, filename: string, options?: IExportOptions | number | boolean): IExportResult;
981
995
  }
982
996
 
983
997
  interface IStateModule {
@@ -1057,4 +1071,4 @@ interface IFilterFunction {
1057
1071
  (filter: IFilter, ui: IUI, bounds: IMatrixWithBoundsScaleData, currentCanvas: ILeaferCanvas, originCanvas: ILeaferCanvas, shape: ICachedShape): void;
1058
1072
  }
1059
1073
 
1060
- export type { IAnimate, IAnimateKeyframe, IAnimateList, IAnimateType, IAnimation, IApp, IAppConfig, IAppData, IAppInputData, IArrow, IArrowData, IArrowInputData, IArrowType, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, IColorString, IComputedKeyframe, ICornerRadiusString, IDashPatternString, IEditBoxBase, IEditPoint, IEditPointInputData, IEditPointType, IEditToolFunction, IEditorBase, IEditorConfig, IEditorConfigFunction, IEffect, IEffectAttrData, IEffectComputedData, IEffectInputData, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IFill, IFilterFunction, IFilterModule, IFilterProcessor, IFindUIMethod, IFlow, IFlowData, IFlowInputData, IFontWeight, IFontWeightNumer, IFontWeightString, IFrame, IFrameData, IFrameInputData, IFrameRenderModule, IGIF, IGIFData, IGIFInputData, IGradientPaint, IGradientType, IGrayscaleEffect, IGroup, IGroupData, IGroupInputData, IGroupRenderModule, IImage, IImageData, IImageFilters, IImageInputData, IImagePaint, IImagePaintMode, IImageRenderModule, IKeyframe, IKeyframeId, IKeyframesAnimation, ILeafFill, ILeafPaint, ILeafPaintColor, ILeafPaintPatternData, ILeafShadowEffect, ILeafStrokePaint, ILeafer, ILeaferData, ILeaferInputData, ILine, ILineData, ILineInputData, IOverflow, IPaint, IPaintAttr, IPaintBase, IPaintGradientModule, IPaintImageModule, IPaintModule, IPaintString, IPaintType, IPath, IPathArrowModule, IPathData, IPathDataArrow, IPathDataArrowMap, IPathDataArrowOffset, IPathInputData, IPen, IPenData, IPenInputData, IPercent, IPolygon, IPolygonData, IPolygonInputData, IRGB, IRGBA, IRect, IRectData, IRectInputData, IRectRenderModule, IRepeat, IRobot, IRobotActionName, IRobotActions, IRobotAnimation, IRobotComputedKeyframe, IRobotData, IRobotInputData, IRobotKeyframe, IShadowEffect, IShadowString, ISolidPaint, IStar, IStarData, IStarInputData, IStateModule, IStateName, IStateStyle, IStates, IStroke, IStrokeAlign, IStrokeAttrData, IStrokeCap, IStrokeComputedData, IStrokeInputData, IStrokeJoin, IStrokeWidthString, IStyleAnimation, IText, ITextAlign, ITextCase, ITextCharData, ITextConvertModule, ITextData, ITextDecoration, ITextDrawData, ITextInputData, ITextRenderModule, ITextRowData, ITextStyleAttrData, ITextStyleComputedData, ITextStyleInputData, ITextWordData, ITextWrap, ITransitionFunction, ITransitionMap, ITransitionModule, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIJSONData, IUIRenderModule, IUITag, IVectorPath, IVerticalAlign, IVideo, IVideoData, IVideoInputData, IWritingMode };
1074
+ export type { IAnimate, IAnimateKeyframe, IAnimateList, IAnimateType, IAnimation, IApp, IAppConfig, IAppData, IAppInputData, IArrow, IArrowData, IArrowInputData, IArrowType, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, IColorString, IComputedKeyframe, ICornerRadiusString, IDashPatternString, IEditBoxBase, IEditPoint, IEditPointInputData, IEditPointType, IEditToolFunction, IEditorBase, IEditorConfig, IEditorConfigFunction, IEditorDragStartData, IEffect, IEffectAttrData, IEffectComputedData, IEffectInputData, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IFill, IFilterFunction, IFilterModule, IFilterProcessor, IFindUIMethod, IFlow, IFlowData, IFlowInputData, IFontWeight, IFontWeightNumer, IFontWeightString, IFrame, IFrameData, IFrameInputData, IFrameRenderModule, IGIF, IGIFData, IGIFInputData, IGradientPaint, IGradientType, IGrayscaleEffect, IGroup, IGroupData, IGroupInputData, IGroupRenderModule, IImage, IImageData, IImageFilters, IImageInputData, IImagePaint, IImagePaintMode, IImageRenderModule, IKeyframe, IKeyframeId, IKeyframesAnimation, ILeafFill, ILeafPaint, ILeafPaintColor, ILeafPaintPatternData, ILeafShadowEffect, ILeafStrokePaint, ILeafer, ILeaferData, ILeaferInputData, ILine, ILineData, ILineInputData, IOverflow, IPaint, IPaintAttr, IPaintBase, IPaintGradientModule, IPaintImageModule, IPaintModule, IPaintString, IPaintType, IPath, IPathArrowModule, IPathData, IPathDataArrow, IPathDataArrowMap, IPathDataArrowOffset, IPathInputData, IPen, IPenData, IPenInputData, IPercent, IPolygon, IPolygonData, IPolygonInputData, IRGB, IRGBA, IRect, IRectData, IRectInputData, IRectRenderModule, IRepeat, IRobot, IRobotActionName, IRobotActions, IRobotAnimation, IRobotComputedKeyframe, IRobotData, IRobotInputData, IRobotKeyframe, IShadowEffect, IShadowString, ISolidPaint, IStar, IStarData, IStarInputData, IStateModule, IStateName, IStateStyle, IStates, IStroke, IStrokeAlign, IStrokeAttrData, IStrokeCap, IStrokeComputedData, IStrokeInputData, IStrokeJoin, IStrokeWidthString, IStyleAnimation, IText, ITextAlign, ITextCase, ITextCharData, ITextConvertModule, ITextData, ITextDecoration, ITextDrawData, ITextInputData, ITextRenderModule, ITextRowData, ITextStyleAttrData, ITextStyleComputedData, ITextStyleInputData, ITextWordData, ITextWrap, ITransitionFunction, ITransitionMap, ITransitionModule, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIJSONData, IUIRenderModule, IUITag, IVectorPath, IVerticalAlign, IVideo, IVideoData, IVideoInputData, IWritingMode };