@leafer-ui/interface 1.3.3 → 1.4.0

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.3.3",
3
+ "version": "1.4.0",
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.3.3"
25
+ "@leafer/interface": "1.4.0"
26
26
  }
27
27
  }
package/src/IAnimation.ts CHANGED
@@ -1,12 +1,10 @@
1
- import { IEventer, IEventMap, IObject, IPercentData } from '@leafer/interface'
1
+ import { IEventer, IEventMap, IObject, IPercentData, ITransition, IAnimateEasing, IAnimateEasingFunction, IAnimateEnding, IAnimateOptions } from '@leafer/interface'
2
2
 
3
3
  import { IUIInputData, IUI } from './IUI'
4
4
 
5
5
 
6
6
  export type IAnimation = IStyleAnimation | IKeyframesAnimation
7
7
 
8
- export type ITransition = IAnimateOptions | IAnimateEasingName | number | boolean
9
-
10
8
  export type IAnimateType = 'all' | 'animation' | 'transition' | 'animate'
11
9
 
12
10
  export interface IStyleAnimation extends IAnimateOptions {
@@ -17,28 +15,6 @@ export interface IKeyframesAnimation extends IAnimateOptions {
17
15
  keyframes: IKeyframe[]
18
16
  }
19
17
 
20
- export interface IAnimateOptions {
21
- easing?: IAnimateEasing
22
-
23
- delay?: number
24
- duration?: number
25
- ending?: IAnimateEnding
26
-
27
- reverse?: boolean
28
- swing?: boolean | number
29
-
30
- loop?: boolean | number
31
- loopDelay?: number
32
-
33
- speed?: number
34
-
35
- join?: boolean
36
- autoplay?: boolean
37
-
38
- attrs?: string[]
39
- event?: IAnimateEvents
40
- }
41
-
42
18
 
43
19
  export type IKeyframe = IUIInputData | IAnimateKeyframe
44
20
 
@@ -77,67 +53,6 @@ export interface IComputedKeyframe {
77
53
  totalTime?: number // 存在delay 时, 才会有这个属性
78
54
  }
79
55
 
80
- export interface IAnimateEasingFunction {
81
- (t: number): number
82
- }
83
-
84
- export interface ICustomEasingFunction {
85
- (...arg: any): IAnimateEasingFunction
86
- }
87
-
88
-
89
- export type IAnimateEasing =
90
- | IAnimateEasingName
91
- | ICubicBezierEasing
92
- | IStepsEasing
93
- | IObject
94
-
95
- export interface ICubicBezierEasing {
96
- name: 'cubic-bezier',
97
- value: [number, number, number, number]
98
- }
99
-
100
- export interface IStepsEasing {
101
- name: 'steps',
102
- value: number | [number, 'floor' | 'round' | 'ceil']
103
- }
104
-
105
-
106
- export type IAnimateEasingName =
107
- | 'linear'
108
- | 'ease'
109
- | 'ease-in' | 'ease-out' | 'ease-in-out'
110
- | 'sine-in' | 'sine-out' | 'sine-in-out'
111
- | 'quad-in' | 'quad-out' | 'quad-in-out'
112
- | 'cubic-in' | 'cubic-out' | 'cubic-in-out'
113
- | 'quart-in' | 'quart-out' | 'quart-in-out'
114
- | 'quint-in' | 'quint-out' | 'quint-in-out'
115
- | 'expo-in' | 'expo-out' | 'expo-in-out'
116
- | 'circ-in' | 'circ-out' | 'circ-in-out'
117
- | 'back-in' | 'back-out' | 'back-in-out'
118
- | 'elastic-in' | 'elastic-out' | 'elastic-in-out'
119
- | 'bounce-in' | 'bounce-out' | 'bounce-in-out'
120
-
121
-
122
- export type IAnimateEnding = 'auto' | 'from' | 'to'
123
-
124
- export interface IAnimateEvents {
125
- created?: IAnimateEventFunction
126
-
127
- play?: IAnimateEventFunction
128
- pause?: IAnimateEventFunction
129
- stop?: IAnimateEventFunction
130
- seek?: IAnimateEventFunction
131
-
132
- update?: IAnimateEventFunction
133
- completed?: IAnimateEventFunction
134
- }
135
-
136
- export interface IAnimateEventFunction {
137
- (animate?: IAnimate): any
138
- }
139
-
140
-
141
56
 
142
57
  export interface IAnimate extends IAnimateOptions, IEventer {
143
58
  target: IUI | IObject
@@ -171,8 +86,6 @@ export interface IAnimate extends IAnimateOptions, IEventer {
171
86
  seek(time: number | IPercentData): void
172
87
  kill(complete?: boolean, killStyle?: IUIInputData): void
173
88
 
174
-
175
-
176
89
  destroy(complete?: boolean): void
177
90
  }
178
91
 
package/src/IUI.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ILeaf, ILeafComputedData, ILeafData, ILeafInputData, ILeaferCanvas, IRenderOptions, IExportOptions, IExportResult, IPathDrawer, IPointData, IPathCommandData, IBoundsData, IObject, IPathString, ILeaferImage, IPathCreator, IAnswer, IPickOptions, IPickResult, IValue, ICanvasContext2DSettings, IFourNumber, IFindCondition, IBoolean, ICanvasContext2D, IJSONOptions, IMatrixData, ISizeData } from '@leafer/interface'
1
+ import { ILeaf, ILeafComputedData, ILeafData, ILeafInputData, ILeaferCanvas, IRenderOptions, IExportOptions, IExportResult, IPathDrawer, IPointData, IPathCommandData, IBoundsData, IObject, IPathString, ILeaferImage, IPathCreator, IAnswer, IPickOptions, IPickResult, IValue, ICanvasContext2DSettings, IFourNumber, IFindCondition, IBoolean, ICanvasContext2D, IJSONOptions, IMatrixData, ISizeData, ITransition } from '@leafer/interface'
2
2
 
3
3
  import {
4
4
  IFillAttrData, IFillInputData, IFillComputedData,
@@ -9,7 +9,7 @@ import {
9
9
  ITextStyleAttrData, ITextStyleInputData, ITextStyleComputedData
10
10
  } from './ICommonAttr'
11
11
  import { IOverflow } from './type/IType'
12
- import { IAnimation, IAnimate, IKeyframe, IKeyframeId, ITransition, IAnimateType } from './IAnimation'
12
+ import { IAnimation, IAnimate, IKeyframe, IKeyframeId, IAnimateType } from './IAnimation'
13
13
  import { ILeafer } from './app/ILeafer'
14
14
  import { IEditorConfig } from './editor/IEditor'
15
15
 
package/src/index.ts CHANGED
@@ -33,7 +33,7 @@ export { ICornerRadiusString, IStrokeWidthString, IPaintString, IShadowString, I
33
33
  export { ILeafFill, ILeafPaint, ILeafPaintPatternData, ILeafPaintColor, ILeafStrokePaint, ILeafShadowEffect } from './type/IComputedType'
34
34
  export { IStrokeAttrData, IStrokeInputData, IStrokeComputedData, ITextStyleAttrData, ITextStyleInputData, ITextStyleComputedData, IEffectAttrData, IEffectInputData, IEffectComputedData } from './ICommonAttr'
35
35
 
36
- export { IAnimation, ITransition, IAnimate, IAnimateList, IAnimateType, IKeyframe, IKeyframeId, IAnimateEasing, ICubicBezierEasing, IStepsEasing, IAnimateEasingFunction, IAnimateEasingName, IAnimateEnding, IAnimateEvents, IAnimateEventFunction, ICustomEasingFunction, IAnimateKeyframe, IComputedKeyframe, IStyleAnimation, IKeyframesAnimation, IAnimateOptions } from './IAnimation'
36
+ export { IAnimation, IAnimate, IAnimateList, IAnimateType, IKeyframe, IKeyframeId, IAnimateKeyframe, IComputedKeyframe, IStyleAnimation, IKeyframesAnimation } from './IAnimation'
37
37
 
38
38
  export { IUIRenderModule, IRectRenderModule, IImageRenderModule, ITextRenderModule, IGroupRenderModule, IFrameRenderModule } from './module/IUIRender'
39
39
  export { IUIBoundsModule } from './module/IUIBounds'
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { IBlendMode, IAlign, IUnitPointData, IExportFileType, IFourNumber, IPointData, ISizeData, IPathCommandData, IAxis, IAxisReverse, IWindingRule, IObject, IMatrixData, ILeaferImage, ITaskItem, IBoolean, INumber, IString, IUnitData, IEventer, IEventMap, IPercentData, IBoundsData as IBoundsData$1, IPathCreator, ILeaferCanvas, ICanvasContext2D, ICanvasContext2DSettings, IRenderOptions, IPickOptions, IPickResult, ILeaf as ILeaf$1, IFindCondition, IJSONOptions, IValue, IPathString, IPathDrawer, IExportOptions, IExportResult, IAnswer, ILeafData, ILeafComputedData, ILeafInputData, ILeaferAttrData, IControl, ILeaferType, ILeaferConfig, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IBooleanMap, IAround } from '@leafer/interface';
1
+ import { IBlendMode, IAlign, IUnitPointData, IExportFileType, IFourNumber, IPointData, ISizeData, IPathCommandData, IAxis, IAxisReverse, IWindingRule, IObject, IMatrixData, ILeaferImage, ITaskItem, IBoolean, INumber, IString, IUnitData, IAnimateOptions, IAnimateEasing, IAnimateEasingFunction, IEventer, IEventMap, IAnimateEnding, ITransition, IPercentData, IBoundsData as IBoundsData$1, IPathCreator, ILeaferCanvas, ICanvasContext2D, ICanvasContext2DSettings, IRenderOptions, IPickOptions, IPickResult, ILeaf as ILeaf$1, IFindCondition, IJSONOptions, IValue, IPathString, IPathDrawer, IExportOptions, IExportResult, IAnswer, ILeafData, ILeafComputedData, ILeafInputData, ILeaferAttrData, IControl, ILeaferType, ILeaferConfig, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IBooleanMap, IAround } from '@leafer/interface';
2
2
  export * from '@leafer/interface';
3
3
  import { IGroup as IGroup$1, ISelectorProxy, IUI as IUI$1, ILeafList, IObject as IObject$1, 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, IStateName as IStateName$1, IString as IString$1, IBoolean as IBoolean$1, IStateStyle as IStateStyle$1 } from '@leafer-ui/interface';
4
4
 
@@ -313,7 +313,6 @@ interface IEffectComputedData {
313
313
  }
314
314
 
315
315
  type IAnimation = IStyleAnimation | IKeyframesAnimation;
316
- type ITransition = IAnimateOptions | IAnimateEasingName | number | boolean;
317
316
  type IAnimateType = 'all' | 'animation' | 'transition' | 'animate';
318
317
  interface IStyleAnimation extends IAnimateOptions {
319
318
  style: IUIInputData;
@@ -321,21 +320,6 @@ interface IStyleAnimation extends IAnimateOptions {
321
320
  interface IKeyframesAnimation extends IAnimateOptions {
322
321
  keyframes: IKeyframe[];
323
322
  }
324
- interface IAnimateOptions {
325
- easing?: IAnimateEasing;
326
- delay?: number;
327
- duration?: number;
328
- ending?: IAnimateEnding;
329
- reverse?: boolean;
330
- swing?: boolean | number;
331
- loop?: boolean | number;
332
- loopDelay?: number;
333
- speed?: number;
334
- join?: boolean;
335
- autoplay?: boolean;
336
- attrs?: string[];
337
- event?: IAnimateEvents;
338
- }
339
323
  type IKeyframe = IUIInputData | IAnimateKeyframe;
340
324
  type IKeyframeId = number;
341
325
  interface IAnimateKeyframe {
@@ -361,35 +345,6 @@ interface IComputedKeyframe {
361
345
  autoDuration?: number;
362
346
  totalTime?: number;
363
347
  }
364
- interface IAnimateEasingFunction {
365
- (t: number): number;
366
- }
367
- interface ICustomEasingFunction {
368
- (...arg: any): IAnimateEasingFunction;
369
- }
370
- type IAnimateEasing = IAnimateEasingName | ICubicBezierEasing | IStepsEasing | IObject;
371
- interface ICubicBezierEasing {
372
- name: 'cubic-bezier';
373
- value: [number, number, number, number];
374
- }
375
- interface IStepsEasing {
376
- name: 'steps';
377
- value: number | [number, 'floor' | 'round' | 'ceil'];
378
- }
379
- type IAnimateEasingName = 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'sine-in' | 'sine-out' | 'sine-in-out' | 'quad-in' | 'quad-out' | 'quad-in-out' | 'cubic-in' | 'cubic-out' | 'cubic-in-out' | 'quart-in' | 'quart-out' | 'quart-in-out' | 'quint-in' | 'quint-out' | 'quint-in-out' | 'expo-in' | 'expo-out' | 'expo-in-out' | 'circ-in' | 'circ-out' | 'circ-in-out' | 'back-in' | 'back-out' | 'back-in-out' | 'elastic-in' | 'elastic-out' | 'elastic-in-out' | 'bounce-in' | 'bounce-out' | 'bounce-in-out';
380
- type IAnimateEnding = 'auto' | 'from' | 'to';
381
- interface IAnimateEvents {
382
- created?: IAnimateEventFunction;
383
- play?: IAnimateEventFunction;
384
- pause?: IAnimateEventFunction;
385
- stop?: IAnimateEventFunction;
386
- seek?: IAnimateEventFunction;
387
- update?: IAnimateEventFunction;
388
- completed?: IAnimateEventFunction;
389
- }
390
- interface IAnimateEventFunction {
391
- (animate?: IAnimate): any;
392
- }
393
348
  interface IAnimate extends IAnimateOptions, IEventer {
394
349
  target: IUI | IObject;
395
350
  keyframes: IKeyframe[];
@@ -1084,4 +1039,4 @@ interface IEffectModule {
1084
1039
  backgroundBlur(ui: IUI, current: ILeaferCanvas, shape: ICachedShape): void;
1085
1040
  }
1086
1041
 
1087
- export type { IAnimate, IAnimateEasing, IAnimateEasingFunction, IAnimateEasingName, IAnimateEnding, IAnimateEventFunction, IAnimateEvents, IAnimateKeyframe, IAnimateList, IAnimateOptions, IAnimateType, IAnimation, IApp, IAppConfig, IAppData, IAppInputData, IArrow, IArrowData, IArrowInputData, IArrowType, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, IColorString, IComputedKeyframe, ICornerRadiusString, ICubicBezierEasing, ICustomEasingFunction, IDashPatternString, IEditBoxBase, IEditPoint, IEditPointInputData, IEditPointType, IEditToolFunction, IEditorBase, IEditorConfig, IEditorConfigFunction, IEffect, IEffectAttrData, IEffectComputedData, IEffectInputData, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IFill, 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, IStepsEasing, 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, ITransition, ITransitionFunction, ITransitionMap, ITransitionModule, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIJSONData, IUIRenderModule, IUITag, IVectorPath, IVerticalAlign, IVideo, IVideoData, IVideoInputData, IWritingMode };
1042
+ 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, 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 };