@leafer-ui/interface 1.0.5 → 1.0.7

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.5",
3
+ "version": "1.0.7",
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.5"
25
+ "@leafer/interface": "1.0.7"
26
26
  }
27
27
  }
package/src/IUI.ts CHANGED
@@ -20,7 +20,7 @@ export interface ILine extends ILineAttrData, IUI {
20
20
 
21
21
  interface ILineAttrData {
22
22
  toPoint?: IPointData
23
- points?: number[]
23
+ points?: number[] | IPointData[]
24
24
  curve?: boolean | number
25
25
  }
26
26
  export interface ILineData extends ILineAttrData, IUIData { }
@@ -159,7 +159,7 @@ export interface IPolygon extends IPolygonAttrData, IUI {
159
159
  }
160
160
  interface IPolygonAttrData {
161
161
  sides?: number
162
- points?: number[]
162
+ points?: number[] | IPointData[]
163
163
  curve?: boolean | number
164
164
  }
165
165
  export interface IPolygonData extends IPolygonAttrData, IUIData { }
@@ -346,10 +346,10 @@ export interface IGroup extends IUI {
346
346
  __: IGroupData
347
347
  children: IUI[]
348
348
  pick(hitPoint: IPointData, options?: IPickOptions): IPickResult
349
- add(child: IUI | IUIInputData, index?: number): void
350
- addAt(child: IUI | IUIInputData, index: number): void
351
- addAfter(child: IUI | IUIInputData, after: IUI): void
352
- addBefore(child: IUI | IUIInputData, before: IUI): void
349
+ add(child: IUI | IUI[] | IUIInputData | IUIInputData[], index?: number): void
350
+ addAt(child: IUI | IUI[] | IUIInputData | IUIInputData[], index: number): void
351
+ addAfter(child: IUI | IUI[] | IUIInputData | IUIInputData[], after: IUI): void
352
+ addBefore(child: IUI | IUI[] | IUIInputData | IUIInputData[], before: IUI): void
353
353
  addMany(...children: ILeaf[] | IUIInputData[]): void
354
354
  remove(child?: IUI | number | string | IFindCondition | IFindUIMethod): void
355
355
  removeAll(): void
@@ -367,6 +367,7 @@ export interface IUI extends IUIAttrData, IFillAttrData, IStrokeAttrData, ICorne
367
367
  parent?: IGroup
368
368
  zoomLayer?: IGroup
369
369
  readonly isFrame?: boolean
370
+ isOverflow?: boolean
370
371
 
371
372
  proxyData?: IUIInputData
372
373
  __proxyData?: IUIInputData
@@ -405,6 +406,7 @@ export interface IUI extends IUIAttrData, IFillAttrData, IStrokeAttrData, ICorne
405
406
  __drawPathByData(drawer: IPathDrawer, data: IPathCommandData): void
406
407
  __drawPathByBox(drawer: IPathDrawer): void
407
408
  __drawAfterFill?(canvas: ILeaferCanvas, options: IRenderOptions): void
409
+ __drawContent?(canvas: ILeaferCanvas, options: IRenderOptions): void
408
410
 
409
411
  animate(keyframe?: IUIInputData | IKeyframe[] | IAnimation, options?: ITransition, type?: IAnimateType, isTemp?: boolean): IAnimate
410
412
  killAnimate(type?: IAnimateType): void
@@ -457,6 +459,8 @@ export interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
457
459
  __isStrokes?: boolean
458
460
 
459
461
  readonly __strokeWidth: number
462
+ readonly __hasStroke: boolean
463
+
460
464
 
461
465
  __pixelFill?: boolean // png / svg / webp
462
466
  __pixelStroke?: boolean
@@ -468,16 +472,18 @@ export interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
468
472
  __opacityStroke?: boolean
469
473
 
470
474
  __drawAfterFill?: boolean
475
+ readonly __clipAfterFill?: boolean
476
+
471
477
  __isOverflow?: boolean
472
478
  __blendLayer?: boolean
473
479
 
474
- __boxStroke?: boolean
480
+ __boxStroke?: boolean // box闭合描边,可不用计算miterLimit造成的渲染包围盒变化
475
481
 
476
482
  // text
477
483
  __font?: string
478
484
  __textDrawData?: ITextDrawData
479
485
 
480
- __needComputePaint: boolean
486
+ __needComputePaint?: boolean
481
487
  __computePaint(): void
482
488
  }
483
489
  export interface IUIComputedData extends IUIAttrData, IFillComputedData, IBorderComputedData, IStrokeComputedData, ITextStyleComputedData, ICornerRadiusComputedData, IEffectComputedData, ILeafComputedData {
@@ -6,6 +6,7 @@ export type IUIRenderModule = IUIRender & ThisType<IUI>
6
6
 
7
7
  export interface IUIRender extends ILeafRender {
8
8
  __drawAfterFill?(canvas: ILeaferCanvas, options: IRenderOptions): void
9
+ __drawContent?(canvas: ILeaferCanvas, options: IRenderOptions): void
9
10
  }
10
11
 
11
12
  export type IRectRenderModule = IRectRender & ThisType<IRect>
package/types/index.d.ts CHANGED
@@ -540,7 +540,7 @@ interface ILine extends ILineAttrData, IUI {
540
540
  }
541
541
  interface ILineAttrData {
542
542
  toPoint?: IPointData;
543
- points?: number[];
543
+ points?: number[] | IPointData[];
544
544
  curve?: boolean | number;
545
545
  }
546
546
  interface ILineData extends ILineAttrData, IUIData {
@@ -653,7 +653,7 @@ interface IPolygon extends IPolygonAttrData, IUI {
653
653
  }
654
654
  interface IPolygonAttrData {
655
655
  sides?: number;
656
- points?: number[];
656
+ points?: number[] | IPointData[];
657
657
  curve?: boolean | number;
658
658
  }
659
659
  interface IPolygonData extends IPolygonAttrData, IUIData {
@@ -807,10 +807,10 @@ interface IGroup extends IUI {
807
807
  __: IGroupData;
808
808
  children: IUI[];
809
809
  pick(hitPoint: IPointData, options?: IPickOptions): IPickResult;
810
- add(child: IUI | IUIInputData, index?: number): void;
811
- addAt(child: IUI | IUIInputData, index: number): void;
812
- addAfter(child: IUI | IUIInputData, after: IUI): void;
813
- addBefore(child: IUI | IUIInputData, before: IUI): void;
810
+ add(child: IUI | IUI[] | IUIInputData | IUIInputData[], index?: number): void;
811
+ addAt(child: IUI | IUI[] | IUIInputData | IUIInputData[], index: number): void;
812
+ addAfter(child: IUI | IUI[] | IUIInputData | IUIInputData[], after: IUI): void;
813
+ addBefore(child: IUI | IUI[] | IUIInputData | IUIInputData[], before: IUI): void;
814
814
  addMany(...children: ILeaf$1[] | IUIInputData[]): void;
815
815
  remove(child?: IUI | number | string | IFindCondition | IFindUIMethod): void;
816
816
  removeAll(): void;
@@ -827,6 +827,7 @@ interface IUI extends IUIAttrData, IFillAttrData, IStrokeAttrData, ICornerRadius
827
827
  parent?: IGroup;
828
828
  zoomLayer?: IGroup;
829
829
  readonly isFrame?: boolean;
830
+ isOverflow?: boolean;
830
831
  proxyData?: IUIInputData;
831
832
  __proxyData?: IUIInputData;
832
833
  animation?: IAnimation;
@@ -852,6 +853,7 @@ interface IUI extends IUIAttrData, IFillAttrData, IStrokeAttrData, ICornerRadius
852
853
  __drawPathByData(drawer: IPathDrawer, data: IPathCommandData): void;
853
854
  __drawPathByBox(drawer: IPathDrawer): void;
854
855
  __drawAfterFill?(canvas: ILeaferCanvas, options: IRenderOptions): void;
856
+ __drawContent?(canvas: ILeaferCanvas, options: IRenderOptions): void;
855
857
  animate(keyframe?: IUIInputData | IKeyframe[] | IAnimation, options?: ITransition, type?: IAnimateType, isTemp?: boolean): IAnimate;
856
858
  killAnimate(type?: IAnimateType): void;
857
859
  export(filename: string, options?: IExportOptions | number | boolean): Promise<IExportResult>;
@@ -884,6 +886,7 @@ interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
884
886
  __isFills?: boolean;
885
887
  __isStrokes?: boolean;
886
888
  readonly __strokeWidth: number;
889
+ readonly __hasStroke: boolean;
887
890
  __pixelFill?: boolean;
888
891
  __pixelStroke?: boolean;
889
892
  __isHitPixel?: boolean;
@@ -891,12 +894,13 @@ interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
891
894
  __opacityFill?: boolean;
892
895
  __opacityStroke?: boolean;
893
896
  __drawAfterFill?: boolean;
897
+ readonly __clipAfterFill?: boolean;
894
898
  __isOverflow?: boolean;
895
899
  __blendLayer?: boolean;
896
900
  __boxStroke?: boolean;
897
901
  __font?: string;
898
902
  __textDrawData?: ITextDrawData;
899
- __needComputePaint: boolean;
903
+ __needComputePaint?: boolean;
900
904
  __computePaint(): void;
901
905
  }
902
906
  interface IUIComputedData extends IUIAttrData, IFillComputedData, IBorderComputedData, IStrokeComputedData, ITextStyleComputedData, ICornerRadiusComputedData, IEffectComputedData, ILeafComputedData {
@@ -941,6 +945,7 @@ interface IAppConfig extends ILeaferConfig {
941
945
  type IUIRenderModule = IUIRender & ThisType<IUI>;
942
946
  interface IUIRender extends ILeafRender {
943
947
  __drawAfterFill?(canvas: ILeaferCanvas, options: IRenderOptions): void;
948
+ __drawContent?(canvas: ILeaferCanvas, options: IRenderOptions): void;
944
949
  }
945
950
  type IRectRenderModule = IRectRender & ThisType<IRect>;
946
951
  interface IRectRender extends IUIRender {