@leafer-ui/interface 1.0.0-rc.3 → 1.0.0-rc.5

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.0-rc.3",
3
+ "version": "1.0.0-rc.5",
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.0-rc.3"
25
+ "@leafer/interface": "1.0.0-rc.5"
26
26
  }
27
27
  }
package/src/IUI.ts CHANGED
@@ -257,6 +257,8 @@ export interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrDa
257
257
  __: IUIData
258
258
  parent?: IGroup
259
259
 
260
+ reset(_data?: IUIInputData): void
261
+
260
262
  set(data: IUIInputData): void
261
263
  toJSON(): IUIInputData
262
264
 
@@ -279,13 +281,17 @@ export interface IUIData extends IUIComputedData, ILeafData {
279
281
  // 非数据属性, 自动计算的缓存数据
280
282
  __isFills?: boolean
281
283
  __isStrokes?: boolean
284
+
285
+ __pixelFill?: boolean // png / svg / webp
286
+ __pixelStroke?: boolean
287
+
288
+ __opacityFill?: boolean // 半透明的
289
+ __opacityStroke?: boolean
290
+
282
291
  __drawAfterFill?: boolean
283
292
  __isOverflow?: boolean
284
293
  __blendLayer?: boolean
285
294
 
286
- __isTranslucentFill?: boolean // 半透明的
287
- __isTranslucentStroke?: boolean
288
-
289
295
  __useEffect?: boolean
290
296
 
291
297
  // path
@@ -5,8 +5,8 @@ import { ICachedShape } from '../ICachedShape'
5
5
 
6
6
 
7
7
  export interface IEffectModule {
8
- shadow?(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, options: IRenderOptions): void
9
- innerShadow?(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, options: IRenderOptions): void
10
- blur?(ui: IUI, current: ILeaferCanvas, origin: ILeaferCanvas, options: IRenderOptions): void
11
- backgroundBlur?(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, options: IRenderOptions): void
8
+ shadow?(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, renderOptions: IRenderOptions): void
9
+ innerShadow?(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, renderOptions: IRenderOptions): void
10
+ blur?(ui: IUI, current: ILeaferCanvas, origin: ILeaferCanvas, renderOptions: IRenderOptions): void
11
+ backgroundBlur?(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, renderOptions: IRenderOptions): void
12
12
  }
@@ -5,22 +5,22 @@ import { IUI, IUIData } from '../IUI'
5
5
  import { ICachedShape } from '../ICachedShape'
6
6
 
7
7
  export interface IPaintModule {
8
- compute?(ui: IUI, attrName: 'fill' | 'stroke'): void
8
+ compute?(attrName: 'fill' | 'stroke', ui: IUI): void
9
9
 
10
- fill?(ui: IUI, canvas: ILeaferCanvas, fill: string): void
11
- fills?(ui: IUI, canvas: ILeaferCanvas, fills: ILeafPaint[]): void
10
+ fill?(fill: string, ui: IUI, canvas: ILeaferCanvas,): void
11
+ fills?(fills: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas): void
12
12
 
13
13
  fillText?(ui: IUI, canvas: ILeaferCanvas): void
14
14
 
15
- stroke?(ui: IUI, canvas: ILeaferCanvas, stroke: string): void
16
- strokes?(ui: IUI, canvas: ILeaferCanvas, strokes: ILeafPaint[]): void
15
+ stroke?(stroke: string, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void
16
+ strokes?(strokes: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void
17
17
 
18
- strokeText?(ui: IUI, canvas: ILeaferCanvas, stroke: string): void
19
- strokesText?(ui: IUI, canvas: ILeaferCanvas, strokes: ILeafPaint[]): void
18
+ strokeText?(stroke: string, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void
19
+ strokesText?(strokes: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void
20
20
 
21
21
  drawTextStroke?(ui: IUI, canvas: ILeaferCanvas): void
22
22
 
23
- shape?(ui: IUI, current: ILeaferCanvas, options: IRenderOptions): ICachedShape
23
+ shape?(ui: IUI, current: ILeaferCanvas, renderOptions: IRenderOptions): ICachedShape
24
24
 
25
- recycleImage?(data: IUIData, attrName: string): IBooleanMap
25
+ recycleImage?(attrName: 'fill' | 'stroke', data: IUIData): IBooleanMap
26
26
  }
@@ -1,4 +1,4 @@
1
- import { IBlendMode, ILeaferImage, IMatrixData } from '@leafer/interface'
1
+ import { IBlendMode, ILeaferImage, IMatrixData, ITaskItem } from '@leafer/interface'
2
2
 
3
3
  import { IColorString } from './IStringType'
4
4
  import { IStrokeAlign, IStrokeJoin, IStrokeCap, IImagePaintMode } from './IType'
@@ -15,6 +15,7 @@ export interface ILeafPaint {
15
15
  image?: ILeaferImage
16
16
  loadId?: number
17
17
  patternId?: string
18
+ patternTask?: ITaskItem
18
19
  data?: ILeafPaintPatternData
19
20
  }
20
21
 
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { IPointData, IExportFileType, IWindingRule, IPathCommandData, IBlendMode, IMatrixData, ILeaferImage, IBlob, ILeaf, IPathString, IPathCreator, IBoundsData, ILeaferImageConfig, ILeaferCanvas, IRenderOptions, IPathDrawer, ILeafData, IPath2D, ILeafComputedData, ILeafInputData, IObject, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IBooleanMap } from '@leafer/interface';
1
+ import { IPointData, IExportFileType, IWindingRule, IPathCommandData, IBlendMode, IMatrixData, ILeaferImage, ITaskItem, IBlob, ILeaf, IPathString, IPathCreator, IBoundsData, ILeaferImageConfig, ILeaferCanvas, IRenderOptions, IPathDrawer, ILeafData, IPath2D, ILeafComputedData, ILeafInputData, IObject, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IBooleanMap } from '@leafer/interface';
2
2
  export * from '@leafer/interface';
3
3
 
4
4
  type IPercent = string;
@@ -114,6 +114,7 @@ interface ILeafPaint {
114
114
  image?: ILeaferImage;
115
115
  loadId?: number;
116
116
  patternId?: string;
117
+ patternTask?: ITaskItem;
117
118
  data?: ILeafPaintPatternData;
118
119
  }
119
120
  interface ILeafPaintPatternData {
@@ -491,6 +492,7 @@ interface IGroupInputData extends IUIBaseInputData {
491
492
  interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrData, IEffectAttrData, ILeaf {
492
493
  __: IUIData;
493
494
  parent?: IGroup;
495
+ reset(_data?: IUIInputData): void;
494
496
  set(data: IUIInputData): void;
495
497
  toJSON(): IUIInputData;
496
498
  getPath(curve?: boolean): IPathCommandData;
@@ -505,11 +507,13 @@ interface IUIData extends IUIComputedData, ILeafData {
505
507
  locked?: boolean;
506
508
  __isFills?: boolean;
507
509
  __isStrokes?: boolean;
510
+ __pixelFill?: boolean;
511
+ __pixelStroke?: boolean;
512
+ __opacityFill?: boolean;
513
+ __opacityStroke?: boolean;
508
514
  __drawAfterFill?: boolean;
509
515
  __isOverflow?: boolean;
510
516
  __blendLayer?: boolean;
511
- __isTranslucentFill?: boolean;
512
- __isTranslucentStroke?: boolean;
513
517
  __useEffect?: boolean;
514
518
  path?: IPathCommandData;
515
519
  windingRule?: IWindingRule;
@@ -574,24 +578,24 @@ interface ICachedShape extends ICachedLeaf {
574
578
  }
575
579
 
576
580
  interface IPaintModule {
577
- compute?(ui: IUI, attrName: 'fill' | 'stroke'): void;
578
- fill?(ui: IUI, canvas: ILeaferCanvas, fill: string): void;
579
- fills?(ui: IUI, canvas: ILeaferCanvas, fills: ILeafPaint[]): void;
581
+ compute?(attrName: 'fill' | 'stroke', ui: IUI): void;
582
+ fill?(fill: string, ui: IUI, canvas: ILeaferCanvas): void;
583
+ fills?(fills: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas): void;
580
584
  fillText?(ui: IUI, canvas: ILeaferCanvas): void;
581
- stroke?(ui: IUI, canvas: ILeaferCanvas, stroke: string): void;
582
- strokes?(ui: IUI, canvas: ILeaferCanvas, strokes: ILeafPaint[]): void;
583
- strokeText?(ui: IUI, canvas: ILeaferCanvas, stroke: string): void;
584
- strokesText?(ui: IUI, canvas: ILeaferCanvas, strokes: ILeafPaint[]): void;
585
+ stroke?(stroke: string, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
586
+ strokes?(strokes: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
587
+ strokeText?(stroke: string, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
588
+ strokesText?(strokes: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
585
589
  drawTextStroke?(ui: IUI, canvas: ILeaferCanvas): void;
586
- shape?(ui: IUI, current: ILeaferCanvas, options: IRenderOptions): ICachedShape;
587
- recycleImage?(data: IUIData, attrName: string): IBooleanMap;
590
+ shape?(ui: IUI, current: ILeaferCanvas, renderOptions: IRenderOptions): ICachedShape;
591
+ recycleImage?(attrName: 'fill' | 'stroke', data: IUIData): IBooleanMap;
588
592
  }
589
593
 
590
594
  interface IEffectModule {
591
- shadow?(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, options: IRenderOptions): void;
592
- innerShadow?(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, options: IRenderOptions): void;
593
- blur?(ui: IUI, current: ILeaferCanvas, origin: ILeaferCanvas, options: IRenderOptions): void;
594
- backgroundBlur?(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, options: IRenderOptions): void;
595
+ shadow?(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, renderOptions: IRenderOptions): void;
596
+ innerShadow?(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, renderOptions: IRenderOptions): void;
597
+ blur?(ui: IUI, current: ILeaferCanvas, origin: ILeaferCanvas, renderOptions: IRenderOptions): void;
598
+ backgroundBlur?(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, renderOptions: IRenderOptions): void;
595
599
  }
596
600
 
597
601
  export type { IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, ICornerRadiusString, IDashPatternString, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IExportOptions, IExportResult, IExportResultFunction, IFontWeight, IFrame, IFrameData, IFrameInputData, IFrameRenderModule, IGradientPaint, IGrayscaleEffect, IGroup, IGroupData, IGroupInputData, IGroupRenderModule, IImage, IImageData, IImageInputData, IImagePaint, IImagePaintMode, IImageRenderModule, ILeafFill, ILeafPaint, ILeafPaintColor, ILeafPaintPatternData, ILeafShadowEffect, ILeafStrokePaint, ILeaferData, ILeaferInputData, ILine, ILineData, ILineInputData, IOverflow, IPaint, IPaintModule, IPaintString, IPath, IPathData, IPathInputData, IPen, IPenData, IPenInputData, IPercent, IPolygon, IPolygonData, IPolygonInputData, IRGB, IRGBA, IRect, IRectData, IRectInputData, IRectRenderModule, IShadowEffect, IShadowString, IStar, IStarData, IStarInputData, IColorString as IStringColor, IStrokeAlign, IStrokeCap, IStrokeJoin, IStrokeWidthString, IText, ITextAlign, ITextCase, ITextCharData, ITextConvertModule, ITextData, ITextDecoration, ITextDrawData, ITextInputData, ITextRenderModule, ITextRowData, ITextWordData, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIRenderModule, IUITag, IUnitData, IVectorPath, IVerticalAlign };