@leafer-ui/interface 2.0.8 → 2.1.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": "2.0.8",
3
+ "version": "2.1.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": "2.0.8"
25
+ "@leafer/interface": "2.1.0"
26
26
  }
27
27
  }
@@ -130,8 +130,8 @@ export interface ITextStyleComputedData {
130
130
  italic?: boolean
131
131
  textCase?: ITextCase
132
132
  textDecoration?: ITextDecoration
133
- letterSpacing?: number
134
- lineHeight?: number
133
+ letterSpacing?: number | IUnitData
134
+ lineHeight?: number | IUnitData
135
135
 
136
136
  paraIndent?: number
137
137
  paraSpacing?: number
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, ITransition, IAround, IMultimediaType, IDirection4, IOptionPointData, IDirection } 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, IAround, IMultimediaType, IDirection4, IOptionPointData, IDirection, IPathCommandDataWithWindingRule } from '@leafer/interface'
2
2
 
3
3
  import {
4
4
  IFillAttrData, IFillInputData, IFillComputedData,
@@ -129,6 +129,7 @@ export interface IPolygon extends IPolygonAttrData, IUI {
129
129
  }
130
130
  interface IPolygonAttrData {
131
131
  sides?: number
132
+ startAngle?: number
132
133
  points?: number[] | IPointData[]
133
134
  curve?: boolean | number
134
135
  }
@@ -143,6 +144,7 @@ export interface IStar extends IStarAttrData, IUI {
143
144
  interface IStarAttrData {
144
145
  corners?: number
145
146
  innerRadius?: number
147
+ startAngle?: number
146
148
  }
147
149
 
148
150
  export interface IStarData extends IStarAttrData, IUIData { }
@@ -600,6 +602,7 @@ export interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
600
602
  __strokeWidthCache?: number // 一般用于固定线宽的箭头做缓存对比
601
603
  __hasMultiStrokeStyle?: number // 是否存在多个不同的描述样式(同时存储多个描边样式中的最大宽度用于运算)
602
604
  readonly __hasMultiPaint?: boolean
605
+ __hasStrokeSides?: number // 是否存在多边,存在时存储最大值
603
606
 
604
607
  __isAlphaPixelFill?: boolean // png / svg / webp
605
608
  __isAlphaPixelStroke?: boolean
@@ -619,6 +622,7 @@ export interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
619
622
  __blendLayer?: boolean
620
623
 
621
624
  __boxStroke?: boolean // box闭合描边,可不用计算miterLimit造成的渲染包围盒变化
625
+ __pathForStroke?: IPathCommandDataWithWindingRule // 笔触的填充路径,一般用于多个strokeWidth的矩形
622
626
 
623
627
  // text
624
628
  __font?: string
@@ -628,6 +632,8 @@ export interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
628
632
  __computePaint(): void
629
633
  __getRealStrokeWidth(childStyle?: IStrokeComputedStyle): number
630
634
 
635
+ __checkComplex(): void
636
+
631
637
  __setPaint(attrName: 'fill' | 'stroke', value: IValue): void
632
638
  __removePaint(attrName: 'fill' | 'stroke', removeInput?: boolean): void
633
639
  }
@@ -18,6 +18,7 @@ export interface IPaintModule {
18
18
  stroke(stroke: string, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void
19
19
  strokes(strokes: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void
20
20
 
21
+ fillStroke?(stroke: string | ILeafPaint[], ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void
21
22
  strokeText(stroke: string | ILeafPaint[], ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void
22
23
  strokeArrow?(stroke: string | ILeafPaint[], ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void
23
24
  drawStrokesStyle(strokes: ILeafStrokePaint[], strokeWidthScale: number, isText: boolean, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { IMultimediaType, IBlendMode, IScaleFixed, IAlign, IUnitPointData, IFilmOptions, IImageLOD, IExportFileType, IFourNumber, IPointData, IOptionSizeData, ISizeData, IGap, IPointGap, IPercentData, IInterlace, IPathCommandData, IAxis, IAxisReverse, IDirection, IWindingRule, IFilter, IFilmPlayOptions, IMatrixData, ILeaferImage, ITaskItem, INumber, IString, IBoolean, IUnitData, IAnimateOptions, IAnimateEasing, IEventer, IObject, IEventParamsMap, IAnimateEasingFunction, IAnimateEnding, ITransition, IBounds, ILeafInputData, ILeaf as ILeaf$1, ILeafComputedData, ILeafData, IBoundsData, IValue, IDirection4 as IDirection4$1, IAround, IOptionPointData, IPathCreator, IJSONOptions, IFindCondition, IAnswer, IPathString, IPathDrawer, ILeaferCanvas, IRenderOptions, IExportOptions, IExportResult, IPickOptions, IPickResult, ICanvasContext2DSettings, ICanvasContext2D, ILeaferAttrData, IControl, ILeaferType, ILeaferConfig, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IScaleData as IScaleData$1, IBooleanMap, IFunction, IMatrixWithBoundsScaleData } from '@leafer/interface';
1
+ import { IMultimediaType, IBlendMode, IScaleFixed, IAlign, IUnitPointData, IFilmOptions, IImageLOD, IExportFileType, IFourNumber, IPointData, IOptionSizeData, ISizeData, IGap, IPointGap, IPercentData, IInterlace, IPathCommandData, IAxis, IAxisReverse, IDirection, IWindingRule, IFilter, IFilmPlayOptions, IMatrixData, ILeaferImage, ITaskItem, INumber, IString, IBoolean, IUnitData, IAnimateOptions, IAnimateEasing, IEventer, IObject, IEventParamsMap, IAnimateEasingFunction, IAnimateEnding, ITransition, IBounds, ILeafInputData, ILeaf as ILeaf$1, ILeafComputedData, ILeafData, IPathCommandDataWithWindingRule, IBoundsData, IValue, IDirection4 as IDirection4$1, IAround, IOptionPointData, IPathCreator, IJSONOptions, IFindCondition, IAnswer, IPathString, IPathDrawer, ILeaferCanvas, IRenderOptions, IExportOptions, IExportResult, IPickOptions, IPickResult, ICanvasContext2DSettings, ICanvasContext2D, ILeaferAttrData, IControl, ILeaferType, ILeaferConfig, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IScaleData as IScaleData$1, IBooleanMap, IFunction, IMatrixWithBoundsScaleData } from '@leafer/interface';
2
2
  export * from '@leafer/interface';
3
3
  import { IObject as IObject$1, IEditSize, IStroke as IStroke$1, IFourNumber as IFourNumber$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, IShortcutKeysCheck, IShortcutKeys, IUI as IUI$1, IPointData as IPointData$1, IScaleData, ISkewData, IGroup as IGroup$1, ISelectorProxy, IBox as IBox$1, ILayoutBoundsData, IKeyEvent, IUIEvent, IDragEvent, IMoveEvent, IZoomEvent, IRotateEvent, ITransition as ITransition$1, ILeafList, ILeafer as ILeafer$1, ILeaf, 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
 
@@ -321,8 +321,8 @@ interface ITextStyleComputedData {
321
321
  italic?: boolean;
322
322
  textCase?: ITextCase;
323
323
  textDecoration?: ITextDecoration;
324
- letterSpacing?: number;
325
- lineHeight?: number;
324
+ letterSpacing?: number | IUnitData;
325
+ lineHeight?: number | IUnitData;
326
326
  paraIndent?: number;
327
327
  paraSpacing?: number;
328
328
  writingMode?: IWritingMode;
@@ -792,6 +792,7 @@ interface IPolygon extends IPolygonAttrData, IUI {
792
792
  }
793
793
  interface IPolygonAttrData {
794
794
  sides?: number;
795
+ startAngle?: number;
795
796
  points?: number[] | IPointData[];
796
797
  curve?: boolean | number;
797
798
  }
@@ -805,6 +806,7 @@ interface IStar extends IStarAttrData, IUI {
805
806
  interface IStarAttrData {
806
807
  corners?: number;
807
808
  innerRadius?: number;
809
+ startAngle?: number;
808
810
  }
809
811
  interface IStarData extends IStarAttrData, IUIData {
810
812
  }
@@ -1163,6 +1165,7 @@ interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
1163
1165
  __strokeWidthCache?: number;
1164
1166
  __hasMultiStrokeStyle?: number;
1165
1167
  readonly __hasMultiPaint?: boolean;
1168
+ __hasStrokeSides?: number;
1166
1169
  __isAlphaPixelFill?: boolean;
1167
1170
  __isAlphaPixelStroke?: boolean;
1168
1171
  __isTransparentFill?: boolean;
@@ -1176,11 +1179,13 @@ interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
1176
1179
  readonly __hasSurface?: boolean;
1177
1180
  __blendLayer?: boolean;
1178
1181
  __boxStroke?: boolean;
1182
+ __pathForStroke?: IPathCommandDataWithWindingRule;
1179
1183
  __font?: string;
1180
1184
  __textDrawData?: ITextDrawData;
1181
1185
  __needComputePaint?: boolean;
1182
1186
  __computePaint(): void;
1183
1187
  __getRealStrokeWidth(childStyle?: IStrokeComputedStyle): number;
1188
+ __checkComplex(): void;
1184
1189
  __setPaint(attrName: 'fill' | 'stroke', value: IValue): void;
1185
1190
  __removePaint(attrName: 'fill' | 'stroke', removeInput?: boolean): void;
1186
1191
  }
@@ -1330,6 +1335,7 @@ interface IPaintModule {
1330
1335
  fillText(ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
1331
1336
  stroke(stroke: string, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
1332
1337
  strokes(strokes: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
1338
+ fillStroke?(stroke: string | ILeafPaint[], ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
1333
1339
  strokeText(stroke: string | ILeafPaint[], ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
1334
1340
  strokeArrow?(stroke: string | ILeafPaint[], ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
1335
1341
  drawStrokesStyle(strokes: ILeafStrokePaint[], strokeWidthScale: number, isText: boolean, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;