@leafer-ui/interface 1.6.2 → 1.6.4

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.6.2",
3
+ "version": "1.6.4",
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.6.2"
25
+ "@leafer/interface": "1.6.4"
26
26
  }
27
27
  }
package/src/IAnimation.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { IEventer, IEventMap, IObject, IPercentData, ITransition, IAnimateEasing, IAnimateEasingFunction, IAnimateEnding, IAnimateOptions } from '@leafer/interface'
1
+ import { IEventer, IEventParamsMap, IObject, IPercentData, ITransition, IAnimateEasing, IAnimateEasingFunction, IAnimateEnding, IAnimateOptions } from '@leafer/interface'
2
2
 
3
3
  import { IUIInputData, IUI } from './IUI'
4
4
 
@@ -59,7 +59,7 @@ export interface IAnimate extends IAnimateOptions, IEventer {
59
59
 
60
60
  keyframes: IKeyframe[]
61
61
  config?: IAnimateOptions
62
- event?: IEventMap
62
+ event?: IEventParamsMap
63
63
 
64
64
  readonly frames: IComputedKeyframe[]
65
65
 
package/src/IUI.ts CHANGED
@@ -281,8 +281,8 @@ export interface ITextDrawData {
281
281
  // Image
282
282
  export interface IImage extends IImageAttrData, IRect {
283
283
  __: IImageData
284
- ready: boolean
285
- image?: ILeaferImage
284
+ readonly ready: boolean
285
+ readonly image?: ILeaferImage
286
286
  }
287
287
  interface IImageAttrData {
288
288
  url?: string
@@ -295,7 +295,7 @@ export interface IImageInputData extends IImageAttrData, IUIBaseInputData { }
295
295
  export interface ICanvas extends ICanvasAttrData, IRect {
296
296
  __: ICanvasData
297
297
  canvas?: ILeaferCanvas
298
- context?: ICanvasContext2D
298
+ readonly context?: ICanvasContext2D
299
299
  __updateSize(): void
300
300
  }
301
301
  interface ICanvasAttrData {
@@ -379,6 +379,7 @@ export interface IUI extends IUIAttrData, IFillAttrData, IStrokeAttrData, ICorne
379
379
  zoomLayer?: IGroup
380
380
  readonly isFrame?: boolean
381
381
  isOverflow?: boolean
382
+ useFastShadow?: boolean // 将忽略 stroke 产生的阴影,只对单个 fill 有效
382
383
 
383
384
  proxyData?: IUIInputData
384
385
  __proxyData?: IUIInputData
@@ -457,6 +458,7 @@ interface IUIAttrData {
457
458
  disabledStyle?: IStateStyle
458
459
  placeholderStyle?: IStateStyle
459
460
  placeholderColor?: IColorString
461
+ placeholderDelay?: number
460
462
 
461
463
  editConfig?: IEditorConfig
462
464
  editOuter?: string
@@ -480,15 +482,17 @@ export interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
480
482
  readonly __hasHalf: number // 是否存在半逻辑像素渲染(奇数线宽的居中线条),可以半像素为起点绘制,防止模糊
481
483
 
482
484
 
483
- __pixelFill?: boolean // png / svg / webp
484
- __pixelStroke?: boolean
485
+ __isAlphaPixelFill?: boolean // png / svg / webp
486
+ __isAlphaPixelStroke?: boolean
487
+
488
+ __isTransparentFill?: boolean // 半透明的填充色
489
+ __isTransparentStroke?: boolean
485
490
 
486
491
  __isHitPixel?: boolean
487
492
  __isCanvas?: boolean // canvas 等需单独绘制的元素
493
+ __isFastShadow?: boolean // 高性能绘制阴影,需满足一定的条件
488
494
 
489
- __opacityFill?: boolean // 半透明的
490
- __opacityStroke?: boolean
491
-
495
+ __fillAfterStroke?: boolean // 填充在描边之后绘制,一般用于高性能的外描边场景
492
496
  __drawAfterFill?: boolean
493
497
  readonly __clipAfterFill?: boolean
494
498
  readonly __hasSurface?: boolean
@@ -503,6 +507,9 @@ export interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
503
507
 
504
508
  __needComputePaint?: boolean
505
509
  __computePaint(): void
510
+
511
+ __setPaint(attrName: 'fill' | 'stroke', value: IValue): void
512
+ __removePaint(attrName: 'fill' | 'stroke', removeInput?: boolean): void
506
513
  }
507
514
  export interface IUIComputedData extends IUIAttrData, IFillComputedData, IBorderComputedData, IStrokeComputedData, ITextStyleComputedData, ICornerRadiusComputedData, IEffectComputedData, ILeafComputedData {
508
515
 
@@ -3,4 +3,5 @@ import { IColor, IRGBA } from '../type/IType'
3
3
  export interface IColorConvertModule {
4
4
  string(color: IColor, opacity?: number): string
5
5
  object(color: IColor, opacity?: number): IRGBA
6
+ hasTransparent(color: string): boolean
6
7
  }
@@ -19,6 +19,7 @@ export interface IPaintModule {
19
19
  strokes(strokes: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas): void
20
20
 
21
21
  strokeText(stroke: string | ILeafPaint[], ui: IUI, canvas: ILeaferCanvas): void
22
+ strokeArrow?(stroke: string | ILeafPaint[], ui: IUI, canvas: ILeaferCanvas): void
22
23
  drawTextStroke(ui: IUI, canvas: ILeaferCanvas): void
23
24
 
24
25
  shape(ui: IUI, current: ILeaferCanvas, renderOptions: IRenderOptions): ICachedShape
@@ -17,6 +17,7 @@ export interface ILeafPaint {
17
17
  patternTask?: ITaskItem
18
18
  changeful?: boolean // 会频繁变化,不生成图案(有特殊性能优化,一般用于游戏精灵、动图场景)
19
19
  sync?: boolean // 同步显示图片,不走任务列表生成图案
20
+ isTransparent?: boolean // 是否为透明色
20
21
  data?: ILeafPaintPatternData
21
22
  }
22
23
 
package/src/type/IType.ts CHANGED
@@ -178,4 +178,4 @@ export interface IEffect extends IFilter {
178
178
 
179
179
  }
180
180
 
181
- export type IOverflow = 'show' | 'hide'
181
+ export type IOverflow = 'show' | 'hide' | 'scroll' | 'auto'
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { IBlendMode, IAlign, IUnitPointData, IExportFileType, IFourNumber, IPointData, IOptionSizeData, IPathCommandData, IAxis, IAxisReverse, IWindingRule, IFilter, IMatrixData, ILeaferImage, ITaskItem, IBoolean, INumber, IString, IUnitData, IAnimateOptions, IAnimateEasing, IEventer, IObject, IEventMap, IAnimateEasingFunction, IAnimateEnding, ITransition, IPercentData, ILeafInputData, ISizeData, 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';
1
+ import { IBlendMode, IAlign, IUnitPointData, IExportFileType, IFourNumber, IPointData, IOptionSizeData, IPathCommandData, IAxis, IAxisReverse, IWindingRule, IFilter, IMatrixData, ILeaferImage, ITaskItem, IBoolean, INumber, IString, IUnitData, IAnimateOptions, IAnimateEasing, IEventer, IObject, IEventParamsMap, IAnimateEasingFunction, IAnimateEnding, ITransition, IPercentData, ILeafInputData, ISizeData, ILeaf as ILeaf$1, ILeafComputedData, ILeafData, IBoundsData as IBoundsData$1, IValue, IPathCreator, IJSONOptions, 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
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, IUI as IUI$1, IPointData as IPointData$1, IScaleData, ISkewData, IGroup as IGroup$1, ISelectorProxy, ILeafList, IBox as IBox$1, IRect as IRect$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
 
@@ -134,7 +134,7 @@ interface IGrayscaleEffect {
134
134
  }
135
135
  interface IEffect extends IFilter {
136
136
  }
137
- type IOverflow = 'show' | 'hide';
137
+ type IOverflow = 'show' | 'hide' | 'scroll' | 'auto';
138
138
 
139
139
  type ILeafPaintColor = IColorString | CanvasGradient | CanvasPattern;
140
140
  interface ILeafPaint {
@@ -148,6 +148,7 @@ interface ILeafPaint {
148
148
  patternTask?: ITaskItem;
149
149
  changeful?: boolean;
150
150
  sync?: boolean;
151
+ isTransparent?: boolean;
151
152
  data?: ILeafPaintPatternData;
152
153
  }
153
154
  interface ILeafPaintPatternData {
@@ -358,7 +359,7 @@ interface IAnimate extends IAnimateOptions, IEventer {
358
359
  target: IUI | IObject;
359
360
  keyframes: IKeyframe[];
360
361
  config?: IAnimateOptions;
361
- event?: IEventMap;
362
+ event?: IEventParamsMap;
362
363
  readonly frames: IComputedKeyframe[];
363
364
  readonly style: IUIInputData;
364
365
  readonly fromStyle: IUIInputData;
@@ -788,8 +789,8 @@ interface ITextDrawData {
788
789
  }
789
790
  interface IImage extends IImageAttrData, IRect {
790
791
  __: IImageData;
791
- ready: boolean;
792
- image?: ILeaferImage;
792
+ readonly ready: boolean;
793
+ readonly image?: ILeaferImage;
793
794
  }
794
795
  interface IImageAttrData {
795
796
  url?: string;
@@ -802,7 +803,7 @@ interface IImageInputData extends IImageAttrData, IUIBaseInputData {
802
803
  interface ICanvas extends ICanvasAttrData, IRect {
803
804
  __: ICanvasData;
804
805
  canvas?: ILeaferCanvas;
805
- context?: ICanvasContext2D;
806
+ readonly context?: ICanvasContext2D;
806
807
  __updateSize(): void;
807
808
  }
808
809
  interface ICanvasAttrData {
@@ -869,6 +870,7 @@ interface IUI extends IUIAttrData, IFillAttrData, IStrokeAttrData, ICornerRadius
869
870
  zoomLayer?: IGroup;
870
871
  readonly isFrame?: boolean;
871
872
  isOverflow?: boolean;
873
+ useFastShadow?: boolean;
872
874
  proxyData?: IUIInputData;
873
875
  __proxyData?: IUIInputData;
874
876
  animation?: IAnimation | IAnimation[];
@@ -920,6 +922,7 @@ interface IUIAttrData {
920
922
  disabledStyle?: IStateStyle;
921
923
  placeholderStyle?: IStateStyle;
922
924
  placeholderColor?: IColorString;
925
+ placeholderDelay?: number;
923
926
  editConfig?: IEditorConfig;
924
927
  editOuter?: string;
925
928
  editInner?: string;
@@ -934,12 +937,14 @@ interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
934
937
  readonly __strokeWidth: number;
935
938
  readonly __hasStroke: boolean;
936
939
  readonly __hasHalf: number;
937
- __pixelFill?: boolean;
938
- __pixelStroke?: boolean;
940
+ __isAlphaPixelFill?: boolean;
941
+ __isAlphaPixelStroke?: boolean;
942
+ __isTransparentFill?: boolean;
943
+ __isTransparentStroke?: boolean;
939
944
  __isHitPixel?: boolean;
940
945
  __isCanvas?: boolean;
941
- __opacityFill?: boolean;
942
- __opacityStroke?: boolean;
946
+ __isFastShadow?: boolean;
947
+ __fillAfterStroke?: boolean;
943
948
  __drawAfterFill?: boolean;
944
949
  readonly __clipAfterFill?: boolean;
945
950
  readonly __hasSurface?: boolean;
@@ -949,6 +954,8 @@ interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
949
954
  __textDrawData?: ITextDrawData;
950
955
  __needComputePaint?: boolean;
951
956
  __computePaint(): void;
957
+ __setPaint(attrName: 'fill' | 'stroke', value: IValue): void;
958
+ __removePaint(attrName: 'fill' | 'stroke', removeInput?: boolean): void;
952
959
  }
953
960
  interface IUIComputedData extends IUIAttrData, IFillComputedData, IBorderComputedData, IStrokeComputedData, ITextStyleComputedData, ICornerRadiusComputedData, IEffectComputedData, ILeafComputedData {
954
961
  }
@@ -1049,6 +1056,7 @@ interface ITextConvertModule {
1049
1056
  interface IColorConvertModule {
1050
1057
  string(color: IColor, opacity?: number): string;
1051
1058
  object(color: IColor, opacity?: number): IRGBA;
1059
+ hasTransparent(color: string): boolean;
1052
1060
  }
1053
1061
 
1054
1062
  interface IExportModule {
@@ -1091,6 +1099,7 @@ interface IPaintModule {
1091
1099
  stroke(stroke: string, ui: IUI, canvas: ILeaferCanvas): void;
1092
1100
  strokes(strokes: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas): void;
1093
1101
  strokeText(stroke: string | ILeafPaint[], ui: IUI, canvas: ILeaferCanvas): void;
1102
+ strokeArrow?(stroke: string | ILeafPaint[], ui: IUI, canvas: ILeaferCanvas): void;
1094
1103
  drawTextStroke(ui: IUI, canvas: ILeaferCanvas): void;
1095
1104
  shape(ui: IUI, current: ILeaferCanvas, renderOptions: IRenderOptions): ICachedShape;
1096
1105
  }