@leafer-ui/interface 1.0.0-rc.4 → 1.0.0-rc.6

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.4",
3
+ "version": "1.0.0-rc.6",
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.4"
25
+ "@leafer/interface": "1.0.0-rc.6"
26
26
  }
27
27
  }
@@ -1,4 +1,4 @@
1
- import { IPaint, IStrokeAlign, IStrokeCap, IStrokeJoin, IBlurEffect, IFontWeight, ITextCase, ITextDecoration, IShadowEffect, IGrayscaleEffect, ITextAlign, IVerticalAlign, IOverflow, IUnitData } from './type/IType'
1
+ import { IPaint, IStrokeAlign, IStrokeCap, IStrokeJoin, IBlurEffect, IFontWeight, ITextCase, ITextDecoration, IShadowEffect, IGrayscaleEffect, ITextAlign, IVerticalAlign, IOverflow, IUnitData, ITextWrap } from './type/IType'
2
2
  import { ILeafStrokePaint, ILeafShadowEffect, ILeafPaint } from './type/IComputedType'
3
3
  import { IPaintString, IDashPatternString, IShadowString, IColorString, IStrokeWidthString, ICornerRadiusString } from './type/IStringType'
4
4
 
@@ -86,6 +86,7 @@ export interface ITextStyleAttrData {
86
86
  textAlign: ITextAlign
87
87
  verticalAlign: IVerticalAlign
88
88
 
89
+ textWrap: ITextWrap
89
90
  textOverflow: IOverflow | string
90
91
  }
91
92
  export interface ITextStyleInputData {
@@ -104,6 +105,7 @@ export interface ITextStyleInputData {
104
105
  textAlign?: ITextAlign
105
106
  verticalAlign?: IVerticalAlign
106
107
 
108
+ textWrap?: ITextWrap
107
109
  textOverflow?: IOverflow | string
108
110
  }
109
111
  export interface ITextStyleComputedData {
@@ -121,7 +123,9 @@ export interface ITextStyleComputedData {
121
123
 
122
124
  textAlign?: ITextAlign
123
125
  verticalAlign?: IVerticalAlign
124
- textOverflow?: IOverflow
126
+
127
+ textWrap?: ITextWrap
128
+ textOverflow?: IOverflow | string
125
129
  }
126
130
 
127
131
  // effect---
package/src/IUI.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ILeaf, ILeafComputedData, ILeafData, ILeafInputData, ILeaferCanvas, IRenderOptions, IPathDrawer, IPointData, IPath2D, IPathCommandData, IWindingRule, ILeaferImageConfig, IBoundsData, IObject, __Number, IPathString, ILeaferImage, IBlob, IPathCreator } from '@leafer/interface'
1
+ import { ILeaf, ILeafComputedData, ILeafData, ILeafDataOptions, ILeafInputData, ILeaferCanvas, IRenderOptions, IPathDrawer, IPointData, IPath2D, IPathCommandData, IWindingRule, ILeaferImageConfig, IBoundsData, IObject, __Number, IPathString, ILeaferImage, IBlob, IPathCreator, IFindMethod } from '@leafer/interface'
2
2
 
3
3
  import {
4
4
  IFillAttrData, IFillInputData, IFillComputedData,
@@ -124,6 +124,8 @@ export interface ITextData extends ITextAttrData, ITextStyleComputedData, IUIDat
124
124
  __baseLine?: number
125
125
  __lineHeight?: number
126
126
  __letterSpacing?: number
127
+ __clipText?: boolean
128
+ __textBoxBounds?: IBoundsData
127
129
  }
128
130
  export interface ITextInputData extends ITextAttrData, ITextStyleInputData, IUIBaseInputData {
129
131
 
@@ -144,6 +146,7 @@ export interface ITextRowData {
144
146
  paraStart?: boolean // paragraph start
145
147
  paraEnd?: boolean // paragraph end
146
148
  isOverflow?: boolean
149
+ textMode?: boolean
147
150
  }
148
151
 
149
152
  export interface ITextWordData {
@@ -257,9 +260,19 @@ export interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrDa
257
260
  __: IUIData
258
261
  parent?: IGroup
259
262
 
263
+ proxyData?: IUIInputData
264
+
265
+ reset(_data?: IUIInputData): void
266
+
260
267
  set(data: IUIInputData): void
261
268
  toJSON(): IUIInputData
262
269
 
270
+ get(options?: ILeafDataOptions): IUIInputData
271
+ getProxyData(): IUIInputData
272
+
273
+ find(condition: number | string | IFindMethod): IUI[]
274
+ findOne(condition: number | string | IFindMethod): IUI
275
+
263
276
  getPath(curve?: boolean): IPathCommandData
264
277
  getPathString(curve?: boolean): IPathString
265
278
 
@@ -279,13 +292,17 @@ export interface IUIData extends IUIComputedData, ILeafData {
279
292
  // 非数据属性, 自动计算的缓存数据
280
293
  __isFills?: boolean
281
294
  __isStrokes?: boolean
295
+
296
+ __pixelFill?: boolean // png / svg / webp
297
+ __pixelStroke?: boolean
298
+
299
+ __opacityFill?: boolean // 半透明的
300
+ __opacityStroke?: boolean
301
+
282
302
  __drawAfterFill?: boolean
283
303
  __isOverflow?: boolean
284
304
  __blendLayer?: boolean
285
305
 
286
- __isTranslucentFill?: boolean // 半透明的
287
- __isTranslucentStroke?: boolean
288
-
289
306
  __useEffect?: boolean
290
307
 
291
308
  // path
package/src/index.ts CHANGED
@@ -18,7 +18,7 @@ export {
18
18
  IUI, IUIBaseInputData, IUIData,
19
19
  IUITag, IUIInputData
20
20
  } from './IUI'
21
- export { IUnitData, IVectorPath, IShadowEffect, IBlurEffect, IGrayscaleEffect, IStrokeAlign, IStrokeJoin, IStrokeCap, IRGB, IRGBA, IColor, IColorStop, IPaint, IGradientPaint, IImagePaint, IImagePaintMode, IFontWeight, ITextCase, ITextDecoration, ITextAlign, IVerticalAlign, IOverflow } from './type/IType'
21
+ export { IUnitData, IVectorPath, IShadowEffect, IBlurEffect, IGrayscaleEffect, IStrokeAlign, IStrokeJoin, IStrokeCap, IRGB, IRGBA, IColor, IColorStop, IPaint, IGradientPaint, IImagePaint, IImagePaintMode, IFontWeight, ITextCase, ITextDecoration, ITextAlign, IVerticalAlign, IOverflow, ITextWrap } from './type/IType'
22
22
  export { ICornerRadiusString, IStrokeWidthString, IPaintString, IShadowString, IPercent, IDashPatternString, IColorString as IStringColor } from './type/IStringType'
23
23
  export { ILeafFill, ILeafPaint, ILeafPaintPatternData, ILeafPaintColor, ILeafStrokePaint, ILeafShadowEffect } from './type/IComputedType'
24
24
 
@@ -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/src/type/IType.ts CHANGED
@@ -102,6 +102,7 @@ export type IFontWeightString =
102
102
  | 'extra-bold'
103
103
  | 'black'
104
104
  export type ITextDecoration = 'none' | 'under' | 'delete'
105
+ export type ITextWrap = 'normal' | 'none' | 'break'
105
106
 
106
107
  // 路径
107
108
  export interface IVectorPath {
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, ILeafDataOptions, IFindMethod, 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;
@@ -80,6 +80,7 @@ type IFontWeight = IFontWeightNumer | IFontWeightString;
80
80
  type IFontWeightNumer = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
81
81
  type IFontWeightString = 'thin' | 'extra-light' | 'light' | 'normal' | 'medium' | 'semi-bold' | 'bold' | 'extra-bold' | 'black';
82
82
  type ITextDecoration = 'none' | 'under' | 'delete';
83
+ type ITextWrap = 'normal' | 'none' | 'break';
83
84
  interface IVectorPath {
84
85
  rule?: IWindingRule;
85
86
  data: string | IPathCommandData;
@@ -114,6 +115,7 @@ interface ILeafPaint {
114
115
  image?: ILeaferImage;
115
116
  loadId?: number;
116
117
  patternId?: string;
118
+ patternTask?: ITaskItem;
117
119
  data?: ILeafPaintPatternData;
118
120
  }
119
121
  interface ILeafPaintPatternData {
@@ -213,6 +215,7 @@ interface ITextStyleAttrData {
213
215
  paraSpacing: number;
214
216
  textAlign: ITextAlign;
215
217
  verticalAlign: IVerticalAlign;
218
+ textWrap: ITextWrap;
216
219
  textOverflow: IOverflow | string;
217
220
  }
218
221
  interface ITextStyleInputData {
@@ -228,6 +231,7 @@ interface ITextStyleInputData {
228
231
  paraSpacing?: number;
229
232
  textAlign?: ITextAlign;
230
233
  verticalAlign?: IVerticalAlign;
234
+ textWrap?: ITextWrap;
231
235
  textOverflow?: IOverflow | string;
232
236
  }
233
237
  interface ITextStyleComputedData {
@@ -243,7 +247,8 @@ interface ITextStyleComputedData {
243
247
  paraSpacing?: number;
244
248
  textAlign?: ITextAlign;
245
249
  verticalAlign?: IVerticalAlign;
246
- textOverflow?: IOverflow;
250
+ textWrap?: ITextWrap;
251
+ textOverflow?: IOverflow | string;
247
252
  }
248
253
  interface IEffectAttrData {
249
254
  shadow: IShadowEffect | IShadowEffect[] | IShadowString;
@@ -380,6 +385,8 @@ interface ITextData extends ITextAttrData, ITextStyleComputedData, IUIData {
380
385
  __baseLine?: number;
381
386
  __lineHeight?: number;
382
387
  __letterSpacing?: number;
388
+ __clipText?: boolean;
389
+ __textBoxBounds?: IBoundsData;
383
390
  }
384
391
  interface ITextInputData extends ITextAttrData, ITextStyleInputData, IUIBaseInputData {
385
392
  }
@@ -396,6 +403,7 @@ interface ITextRowData {
396
403
  paraStart?: boolean;
397
404
  paraEnd?: boolean;
398
405
  isOverflow?: boolean;
406
+ textMode?: boolean;
399
407
  }
400
408
  interface ITextWordData {
401
409
  x?: number;
@@ -491,8 +499,14 @@ interface IGroupInputData extends IUIBaseInputData {
491
499
  interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrData, IEffectAttrData, ILeaf {
492
500
  __: IUIData;
493
501
  parent?: IGroup;
502
+ proxyData?: IUIInputData;
503
+ reset(_data?: IUIInputData): void;
494
504
  set(data: IUIInputData): void;
495
505
  toJSON(): IUIInputData;
506
+ get(options?: ILeafDataOptions): IUIInputData;
507
+ getProxyData(): IUIInputData;
508
+ find(condition: number | string | IFindMethod): IUI[];
509
+ findOne(condition: number | string | IFindMethod): IUI;
496
510
  getPath(curve?: boolean): IPathCommandData;
497
511
  getPathString(curve?: boolean): IPathString;
498
512
  __drawPathByData(drawer: IPathDrawer, data: IPathCommandData): void;
@@ -505,11 +519,13 @@ interface IUIData extends IUIComputedData, ILeafData {
505
519
  locked?: boolean;
506
520
  __isFills?: boolean;
507
521
  __isStrokes?: boolean;
522
+ __pixelFill?: boolean;
523
+ __pixelStroke?: boolean;
524
+ __opacityFill?: boolean;
525
+ __opacityStroke?: boolean;
508
526
  __drawAfterFill?: boolean;
509
527
  __isOverflow?: boolean;
510
528
  __blendLayer?: boolean;
511
- __isTranslucentFill?: boolean;
512
- __isTranslucentStroke?: boolean;
513
529
  __useEffect?: boolean;
514
530
  path?: IPathCommandData;
515
531
  windingRule?: IWindingRule;
@@ -594,4 +610,4 @@ interface IEffectModule {
594
610
  backgroundBlur?(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, renderOptions: IRenderOptions): void;
595
611
  }
596
612
 
597
- 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 };
613
+ 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, ITextWrap, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIRenderModule, IUITag, IUnitData, IVectorPath, IVerticalAlign };