@leafer-ui/interface 1.0.0-rc.7 → 1.0.0-rc.9

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.7",
3
+ "version": "1.0.0-rc.9",
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.7"
25
+ "@leafer/interface": "1.0.0-rc.9"
26
26
  }
27
27
  }
@@ -1,4 +1,4 @@
1
- import { IStrokeAlign, IStrokeCap, IStrokeJoin, IBlurEffect, IFontWeight, ITextCase, ITextDecoration, IShadowEffect, IGrayscaleEffect, ITextAlign, IVerticalAlign, IOverflow, IUnitData, ITextWrap, IStroke, IFill } from './type/IType'
1
+ import { IStrokeAlign, IStrokeCap, IStrokeJoin, IBlurEffect, IFontWeight, ITextCase, ITextDecoration, IShadowEffect, IGrayscaleEffect, ITextAlign, IVerticalAlign, IOverflow, IUnitData, ITextWrap, IStroke, IFill, IArrowType } from './type/IType'
2
2
  import { ILeafStrokePaint, ILeafShadowEffect, ILeafPaint } from './type/IComputedType'
3
3
  import { IDashPatternString, IShadowString, IColorString, IStrokeWidthString, ICornerRadiusString } from './type/IStringType'
4
4
 
@@ -44,6 +44,9 @@ export interface IStrokeAttrData {
44
44
  dashPattern: number[] | IDashPatternString
45
45
  dashOffset: number
46
46
  miterLimit: number
47
+
48
+ startArrow: IArrowType
49
+ endArrow: IArrowType
47
50
  }
48
51
  export interface IStrokeInputData {
49
52
  stroke?: IStroke
@@ -55,6 +58,9 @@ export interface IStrokeInputData {
55
58
  dashPattern?: number[] | IDashPatternString
56
59
  dashOffset?: number
57
60
  miterLimit?: number
61
+
62
+ startArrow?: IArrowType
63
+ endArrow?: IArrowType
58
64
  }
59
65
  export interface IStrokeComputedData {
60
66
  stroke?: IColorString | ILeafStrokePaint[]
package/src/IUI.ts CHANGED
@@ -30,6 +30,18 @@ export interface ILineData extends ILineAttrData, IUIData { }
30
30
  export interface ILineInputData extends ILineAttrData, IUIBaseInputData { }
31
31
 
32
32
 
33
+ // Arrow
34
+ export interface IArrow extends ILine {
35
+ __: IArrowData
36
+ }
37
+
38
+ interface IArrowAttrData {
39
+
40
+ }
41
+ export interface IArrowData extends IArrowAttrData, ILineData { }
42
+ export interface IArrowInputData extends IArrowAttrData, IUIBaseInputData { }
43
+
44
+
33
45
  // Rect
34
46
  export interface IRect extends IUI {
35
47
  __: IRectData
@@ -127,6 +139,7 @@ export interface ITextData extends ITextAttrData, ITextStyleComputedData, IUIDat
127
139
  __baseLine?: number
128
140
  __lineHeight?: number
129
141
  __letterSpacing?: number
142
+ __padding?: number[]
130
143
  __clipText?: boolean
131
144
  __textBoxBounds?: IBoundsData
132
145
  }
@@ -188,7 +201,9 @@ export interface IImage extends IRect, ILeaferImageConfig {
188
201
  interface IImageAttrData {
189
202
  url?: string
190
203
  }
191
- export interface IImageData extends IImageAttrData, IRectData { }
204
+ export interface IImageData extends IImageAttrData, IRectData {
205
+ __setImageFill(value: string): void
206
+ }
192
207
  export interface IImageInputData extends IImageAttrData, IUIBaseInputData { }
193
208
 
194
209
  export interface ICanvas extends IRect {
@@ -274,7 +289,7 @@ export interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrDa
274
289
  parent?: IGroup
275
290
  isFrame?: boolean
276
291
 
277
- proxyData?: IUIInputData
292
+ proxyData: IUIInputData
278
293
  __proxyData?: IUIInputData
279
294
 
280
295
  children?: IUI[]
@@ -290,8 +305,8 @@ export interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrDa
290
305
  find(condition: number | string | IFindUIMethod, options?: any): IUI[]
291
306
  findOne(condition: number | string | IFindUIMethod, options?: any): IUI
292
307
 
293
- getPath(curve?: boolean): IPathCommandData
294
- getPathString(curve?: boolean): IPathString
308
+ getPath(curve?: boolean, pathForRender?: boolean): IPathCommandData
309
+ getPathString(curve?: boolean, pathForRender?: boolean): IPathString
295
310
 
296
311
  __drawPathByData(drawer: IPathDrawer, data: IPathCommandData): void
297
312
  __drawPathByBox(drawer: IPathDrawer): void
@@ -7,8 +7,8 @@ export interface ILeafer extends IGroup, ILeaferAttrData, IControl {
7
7
  readonly isApp: boolean
8
8
  readonly app: ILeafer
9
9
  parent?: IApp
10
- zoomLayer?: IGroup
11
- editor?: IEditorBase
10
+ zoomLayer: IGroup
11
+ editor: IEditorBase
12
12
 
13
13
  ground?: ILeafer
14
14
  tree?: ILeafer
@@ -1,10 +1,10 @@
1
- import { IGroup, IUI, IRectInputData, ISelectorProxy, IEditSize, ICursorType, IAround, IDragEvent, IRotateEvent, IStroke, IFill, ILeafList, ILeaf, IObject, IBoxInputData } from '@leafer-ui/interface'
1
+ import { IGroup, IUI, IRectInputData, ISelectorProxy, IEditSize, ICursorType, IAround, IDragEvent, IRotateEvent, IStroke, IFill, ILeaf, IObject, IBoxInputData } from '@leafer-ui/interface'
2
2
 
3
3
  export interface IEditorBase extends IGroup, ISelectorProxy {
4
4
  config: IEditorConfig
5
5
 
6
6
  hoverTarget: IUI
7
- target: IUI | IUI[] | ILeafList
7
+ target: IUI | IUI[]
8
8
 
9
9
  readonly list: IUI[]
10
10
 
package/src/index.ts CHANGED
@@ -5,6 +5,7 @@ export { ILeafer } from './app/ILeafer'
5
5
 
6
6
  export {
7
7
  ILine, ILineInputData, ILineData,
8
+ IArrow, IArrowInputData, IArrowData,
8
9
  IRect, IRectInputData, IRectData,
9
10
  IEllipse, IEllipseInputData, IEllipseData,
10
11
  IPolygon, IPolygonInputData, IPolygonData,
@@ -23,8 +24,8 @@ export {
23
24
  IUITag, IUIInputData
24
25
  } from './IUI'
25
26
 
26
- export { IUnitData, IVectorPath, IShadowEffect, IBlurEffect, IGrayscaleEffect, IFill, IStroke, IStrokeAlign, IStrokeJoin, IStrokeCap, IRGB, IRGBA, IColor, IColorStop, IPaint, IGradientPaint, IImagePaint, IImagePaintMode, IFontWeight, ITextCase, ITextDecoration, ITextAlign, IVerticalAlign, IOverflow, ITextWrap } from './type/IType'
27
- export { ICornerRadiusString, IStrokeWidthString, IPaintString, IShadowString, IPercent, IDashPatternString, IColorString as IStringColor } from './type/IStringType'
27
+ export { IUnitData, IVectorPath, IShadowEffect, IBlurEffect, IGrayscaleEffect, IFill, IStroke, IStrokeAlign, IStrokeJoin, IStrokeCap, IArrowType, IRGB, IRGBA, IColor, IColorStop, IPaint, IGradientPaint, IImagePaint, IImagePaintMode, IFontWeight, ITextCase, ITextDecoration, ITextAlign, IVerticalAlign, IOverflow, ITextWrap, IRepeat } from './type/IType'
28
+ export { ICornerRadiusString, IStrokeWidthString, IPaintString, IShadowString, IPercent, IDashPatternString, IColorString } from './type/IStringType'
28
29
  export { ILeafFill, ILeafPaint, ILeafPaintPatternData, ILeafPaintColor, ILeafStrokePaint, ILeafShadowEffect } from './type/IComputedType'
29
30
 
30
31
  export { IUIRenderModule, IRectRenderModule, IImageRenderModule, ITextRenderModule, IGroupRenderModule, IFrameRenderModule } from './module/IUIRender'
@@ -27,6 +27,7 @@ export interface ILeafPaintPatternData {
27
27
  opacity?: number
28
28
  transform?: IMatrixData
29
29
  mode?: IImagePaintMode
30
+ repeat?: 'repeat' | 'repeat-x' | 'repeat-y'
30
31
  }
31
32
 
32
33
  export type ILeafFill = ILeafPaint
package/src/type/IType.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { IPointData, IPathCommandData, IWindingRule, IBlendMode, IExportFileType } from '@leafer/interface'
1
+ import { IPointData, IPathCommandData, IWindingRule, IBlendMode, IExportFileType, ISizeData } from '@leafer/interface'
2
2
  import { IColorString, IPaintString } from './IStringType'
3
3
 
4
4
  export interface IUnitData {
@@ -70,8 +70,11 @@ export interface IImagePaint extends IPaintBase {
70
70
  filters?: IImageFilters
71
71
 
72
72
  offset?: IPointData
73
+ size?: number | ISizeData
73
74
  scale?: number | IPointData
74
75
  rotation?: number
76
+
77
+ repeat?: IRepeat
75
78
  }
76
79
  export interface IImageFilters {
77
80
  exposure?: number // 曝光
@@ -83,12 +86,16 @@ export interface IImageFilters {
83
86
  shadows?: number // 阴影
84
87
  }
85
88
  export type IImagePaintMode = 'cover' | 'fit' | 'strench' | 'clip' | 'repeat'
89
+ export type IRepeat = boolean | 'x' | 'y'
86
90
 
87
91
  // 描边
88
92
  export type IStrokeAlign = 'inside' | 'outside' | 'center'
89
93
  export type IStrokeCap = 'none' | 'round' | 'square' | 'arrow-lines' | 'arrow-equilateral'
90
94
  export type IStrokeJoin = 'bevel' | 'round' | 'miter'
91
95
 
96
+ // 箭头
97
+ export type IArrowType = 'none' | 'line' | 'triangle' | 'circle'
98
+
92
99
  // 文本
93
100
  export type ITextAlign = 'left' | 'center' | 'right' | 'justify'
94
101
  export type IVerticalAlign = 'top' | 'middle' | 'bottom'
package/types/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { IPointData, IExportFileType, IWindingRule, IPathCommandData, IBlendMode, IMatrixData, ILeaferImage, ITaskItem, IBlob, ILeaf, IPathString, IPathCreator, IBoundsData, ILeaferImageConfig, ILeaferCanvas, IRenderOptions, IPathDrawer, AnswerType, ILeafData, IPath2D, ILeafComputedData, ILeafInputData, IObject, ILeaferAttrData, IControl, ILeaferConfig, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IBooleanMap } from '@leafer/interface';
1
+ import { IPointData, IExportFileType, ISizeData, IWindingRule, IPathCommandData, IBlendMode, IMatrixData, ILeaferImage, ITaskItem, IBlob, ILeaf, IPathString, IPathCreator, IBoundsData, ILeaferImageConfig, ILeaferCanvas, IRenderOptions, IPathDrawer, AnswerType, ILeafData, IPath2D, ILeafComputedData, ILeafInputData, IObject, ILeaferAttrData, IControl, ILeaferConfig, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IBooleanMap } from '@leafer/interface';
2
2
  export * from '@leafer/interface';
3
- import { IGroup as IGroup$1, ISelectorProxy, IUI as IUI$1, ILeafList, IObject as IObject$1, ILeaf as ILeaf$1, IEditSize, IDragEvent, IRotateEvent, IStroke as IStroke$1, IFill as IFill$1, IBoxInputData as IBoxInputData$1, IRectInputData as IRectInputData$1, ICursorType, IAround } from '@leafer-ui/interface';
3
+ import { IGroup as IGroup$1, ISelectorProxy, IUI as IUI$1, IObject as IObject$1, ILeaf as ILeaf$1, IEditSize, IDragEvent, IRotateEvent, IStroke as IStroke$1, IFill as IFill$1, IBoxInputData as IBoxInputData$1, IRectInputData as IRectInputData$1, ICursorType, IAround } from '@leafer-ui/interface';
4
4
 
5
5
  type IPercent = string;
6
6
  type IColorString = string;
@@ -60,8 +60,10 @@ interface IImagePaint extends IPaintBase {
60
60
  format?: IExportFileType;
61
61
  filters?: IImageFilters;
62
62
  offset?: IPointData;
63
+ size?: number | ISizeData;
63
64
  scale?: number | IPointData;
64
65
  rotation?: number;
66
+ repeat?: IRepeat;
65
67
  }
66
68
  interface IImageFilters {
67
69
  exposure?: number;
@@ -73,9 +75,11 @@ interface IImageFilters {
73
75
  shadows?: number;
74
76
  }
75
77
  type IImagePaintMode = 'cover' | 'fit' | 'strench' | 'clip' | 'repeat';
78
+ type IRepeat = boolean | 'x' | 'y';
76
79
  type IStrokeAlign = 'inside' | 'outside' | 'center';
77
80
  type IStrokeCap = 'none' | 'round' | 'square' | 'arrow-lines' | 'arrow-equilateral';
78
81
  type IStrokeJoin = 'bevel' | 'round' | 'miter';
82
+ type IArrowType = 'none' | 'line' | 'triangle' | 'circle';
79
83
  type ITextAlign = 'left' | 'center' | 'right' | 'justify';
80
84
  type IVerticalAlign = 'top' | 'middle' | 'bottom';
81
85
  type ITextCase = 'upper' | 'lower' | 'title' | 'none' | 'small-caps';
@@ -129,6 +133,7 @@ interface ILeafPaintPatternData {
129
133
  opacity?: number;
130
134
  transform?: IMatrixData;
131
135
  mode?: IImagePaintMode;
136
+ repeat?: 'repeat' | 'repeat-x' | 'repeat-y';
132
137
  }
133
138
  type ILeafFill = ILeafPaint;
134
139
  interface ILeafStrokePaint extends ILeafPaint {
@@ -183,6 +188,8 @@ interface IStrokeAttrData {
183
188
  dashPattern: number[] | IDashPatternString;
184
189
  dashOffset: number;
185
190
  miterLimit: number;
191
+ startArrow: IArrowType;
192
+ endArrow: IArrowType;
186
193
  }
187
194
  interface IStrokeInputData {
188
195
  stroke?: IStroke;
@@ -193,6 +200,8 @@ interface IStrokeInputData {
193
200
  dashPattern?: number[] | IDashPatternString;
194
201
  dashOffset?: number;
195
202
  miterLimit?: number;
203
+ startArrow?: IArrowType;
204
+ endArrow?: IArrowType;
196
205
  }
197
206
  interface IStrokeComputedData {
198
207
  stroke?: IColorString | ILeafStrokePaint[];
@@ -305,6 +314,15 @@ interface ILineData extends ILineAttrData, IUIData {
305
314
  }
306
315
  interface ILineInputData extends ILineAttrData, IUIBaseInputData {
307
316
  }
317
+ interface IArrow extends ILine {
318
+ __: IArrowData;
319
+ }
320
+ interface IArrowAttrData {
321
+ }
322
+ interface IArrowData extends IArrowAttrData, ILineData {
323
+ }
324
+ interface IArrowInputData extends IArrowAttrData, IUIBaseInputData {
325
+ }
308
326
  interface IRect extends IUI {
309
327
  __: IRectData;
310
328
  }
@@ -391,6 +409,7 @@ interface ITextData extends ITextAttrData, ITextStyleComputedData, IUIData {
391
409
  __baseLine?: number;
392
410
  __lineHeight?: number;
393
411
  __letterSpacing?: number;
412
+ __padding?: number[];
394
413
  __clipText?: boolean;
395
414
  __textBoxBounds?: IBoundsData;
396
415
  }
@@ -444,6 +463,7 @@ interface IImageAttrData {
444
463
  url?: string;
445
464
  }
446
465
  interface IImageData extends IImageAttrData, IRectData {
466
+ __setImageFill(value: string): void;
447
467
  }
448
468
  interface IImageInputData extends IImageAttrData, IUIBaseInputData {
449
469
  }
@@ -513,7 +533,7 @@ interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrData, IEf
513
533
  leafer?: ILeafer;
514
534
  parent?: IGroup;
515
535
  isFrame?: boolean;
516
- proxyData?: IUIInputData;
536
+ proxyData: IUIInputData;
517
537
  __proxyData?: IUIInputData;
518
538
  children?: IUI[];
519
539
  reset(data?: IUIInputData): void;
@@ -523,8 +543,8 @@ interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrData, IEf
523
543
  createProxyData(): IUIInputData;
524
544
  find(condition: number | string | IFindUIMethod, options?: any): IUI[];
525
545
  findOne(condition: number | string | IFindUIMethod, options?: any): IUI;
526
- getPath(curve?: boolean): IPathCommandData;
527
- getPathString(curve?: boolean): IPathString;
546
+ getPath(curve?: boolean, pathForRender?: boolean): IPathCommandData;
547
+ getPathString(curve?: boolean, pathForRender?: boolean): IPathString;
528
548
  __drawPathByData(drawer: IPathDrawer, data: IPathCommandData): void;
529
549
  __drawPathByBox(drawer: IPathDrawer): void;
530
550
  __drawAfterFill?(canvas: ILeaferCanvas, options: IRenderOptions): void;
@@ -575,7 +595,7 @@ interface IUIInputData extends IRectInputData, IEllipseInputData, IPolygonInputD
575
595
  interface IEditorBase extends IGroup$1, ISelectorProxy {
576
596
  config: IEditorConfig;
577
597
  hoverTarget: IUI$1;
578
- target: IUI$1 | IUI$1[] | ILeafList;
598
+ target: IUI$1 | IUI$1[];
579
599
  readonly list: IUI$1[];
580
600
  readonly hasTarget: boolean;
581
601
  readonly multiple: boolean;
@@ -638,8 +658,8 @@ interface ILeafer extends IGroup, ILeaferAttrData, IControl {
638
658
  readonly isApp: boolean;
639
659
  readonly app: ILeafer;
640
660
  parent?: IApp;
641
- zoomLayer?: IGroup;
642
- editor?: IEditorBase;
661
+ zoomLayer: IGroup;
662
+ editor: IEditorBase;
643
663
  ground?: ILeafer;
644
664
  tree?: ILeafer;
645
665
  sky?: ILeafer;
@@ -719,4 +739,4 @@ interface IEffectModule {
719
739
  backgroundBlur?(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, renderOptions: IRenderOptions): void;
720
740
  }
721
741
 
722
- export type { IApp, IAppConfig, IAppData, IAppInputData, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, ICornerRadiusString, IDashPatternString, IEditorBase, IEditorConfig, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IExportOptions, IExportResult, IExportResultFunction, IFill, IFindUIMethod, IFontWeight, IFrame, IFrameData, IFrameInputData, IFrameRenderModule, IGradientPaint, IGrayscaleEffect, IGroup, IGroupData, IGroupInputData, IGroupRenderModule, IImage, IImageData, IImageInputData, IImagePaint, IImagePaintMode, IImageRenderModule, ILeafFill, ILeafPaint, ILeafPaintColor, ILeafPaintPatternData, ILeafShadowEffect, ILeafStrokePaint, ILeafer, 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, IStroke, 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 };
742
+ export type { IApp, IAppConfig, IAppData, IAppInputData, IArrow, IArrowData, IArrowInputData, IArrowType, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, IColorString, ICornerRadiusString, IDashPatternString, IEditorBase, IEditorConfig, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IExportOptions, IExportResult, IExportResultFunction, IFill, IFindUIMethod, IFontWeight, IFrame, IFrameData, IFrameInputData, IFrameRenderModule, IGradientPaint, IGrayscaleEffect, IGroup, IGroupData, IGroupInputData, IGroupRenderModule, IImage, IImageData, IImageInputData, IImagePaint, IImagePaintMode, IImageRenderModule, ILeafFill, ILeafPaint, ILeafPaintColor, ILeafPaintPatternData, ILeafShadowEffect, ILeafStrokePaint, ILeafer, 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, IRepeat, IShadowEffect, IShadowString, IStar, IStarData, IStarInputData, IStroke, 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 };