@leafer-ui/interface 1.0.0-rc.5 → 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 +2 -2
- package/src/ICommonAttr.ts +6 -2
- package/src/IUI.ts +12 -1
- package/src/index.ts +1 -1
- package/src/type/IType.ts +1 -0
- package/types/index.d.ts +15 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/interface",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
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.
|
|
25
|
+
"@leafer/interface": "1.0.0-rc.6"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/src/ICommonAttr.ts
CHANGED
|
@@ -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
|
-
|
|
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,11 +260,19 @@ export interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrDa
|
|
|
257
260
|
__: IUIData
|
|
258
261
|
parent?: IGroup
|
|
259
262
|
|
|
263
|
+
proxyData?: IUIInputData
|
|
264
|
+
|
|
260
265
|
reset(_data?: IUIInputData): void
|
|
261
266
|
|
|
262
267
|
set(data: IUIInputData): void
|
|
263
268
|
toJSON(): IUIInputData
|
|
264
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
|
+
|
|
265
276
|
getPath(curve?: boolean): IPathCommandData
|
|
266
277
|
getPathString(curve?: boolean): IPathString
|
|
267
278
|
|
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
|
|
package/src/type/IType.ts
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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';
|
|
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;
|
|
@@ -214,6 +215,7 @@ interface ITextStyleAttrData {
|
|
|
214
215
|
paraSpacing: number;
|
|
215
216
|
textAlign: ITextAlign;
|
|
216
217
|
verticalAlign: IVerticalAlign;
|
|
218
|
+
textWrap: ITextWrap;
|
|
217
219
|
textOverflow: IOverflow | string;
|
|
218
220
|
}
|
|
219
221
|
interface ITextStyleInputData {
|
|
@@ -229,6 +231,7 @@ interface ITextStyleInputData {
|
|
|
229
231
|
paraSpacing?: number;
|
|
230
232
|
textAlign?: ITextAlign;
|
|
231
233
|
verticalAlign?: IVerticalAlign;
|
|
234
|
+
textWrap?: ITextWrap;
|
|
232
235
|
textOverflow?: IOverflow | string;
|
|
233
236
|
}
|
|
234
237
|
interface ITextStyleComputedData {
|
|
@@ -244,7 +247,8 @@ interface ITextStyleComputedData {
|
|
|
244
247
|
paraSpacing?: number;
|
|
245
248
|
textAlign?: ITextAlign;
|
|
246
249
|
verticalAlign?: IVerticalAlign;
|
|
247
|
-
|
|
250
|
+
textWrap?: ITextWrap;
|
|
251
|
+
textOverflow?: IOverflow | string;
|
|
248
252
|
}
|
|
249
253
|
interface IEffectAttrData {
|
|
250
254
|
shadow: IShadowEffect | IShadowEffect[] | IShadowString;
|
|
@@ -381,6 +385,8 @@ interface ITextData extends ITextAttrData, ITextStyleComputedData, IUIData {
|
|
|
381
385
|
__baseLine?: number;
|
|
382
386
|
__lineHeight?: number;
|
|
383
387
|
__letterSpacing?: number;
|
|
388
|
+
__clipText?: boolean;
|
|
389
|
+
__textBoxBounds?: IBoundsData;
|
|
384
390
|
}
|
|
385
391
|
interface ITextInputData extends ITextAttrData, ITextStyleInputData, IUIBaseInputData {
|
|
386
392
|
}
|
|
@@ -397,6 +403,7 @@ interface ITextRowData {
|
|
|
397
403
|
paraStart?: boolean;
|
|
398
404
|
paraEnd?: boolean;
|
|
399
405
|
isOverflow?: boolean;
|
|
406
|
+
textMode?: boolean;
|
|
400
407
|
}
|
|
401
408
|
interface ITextWordData {
|
|
402
409
|
x?: number;
|
|
@@ -492,9 +499,14 @@ interface IGroupInputData extends IUIBaseInputData {
|
|
|
492
499
|
interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrData, IEffectAttrData, ILeaf {
|
|
493
500
|
__: IUIData;
|
|
494
501
|
parent?: IGroup;
|
|
502
|
+
proxyData?: IUIInputData;
|
|
495
503
|
reset(_data?: IUIInputData): void;
|
|
496
504
|
set(data: IUIInputData): void;
|
|
497
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;
|
|
498
510
|
getPath(curve?: boolean): IPathCommandData;
|
|
499
511
|
getPathString(curve?: boolean): IPathString;
|
|
500
512
|
__drawPathByData(drawer: IPathDrawer, data: IPathCommandData): void;
|
|
@@ -598,4 +610,4 @@ interface IEffectModule {
|
|
|
598
610
|
backgroundBlur?(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, renderOptions: IRenderOptions): void;
|
|
599
611
|
}
|
|
600
612
|
|
|
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 };
|
|
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 };
|