@leafer-ui/interface
Advanced tools
+2
-2
| { | ||
| "name": "@leafer-ui/interface", | ||
| "version": "1.0.0-alpha.21", | ||
| "version": "1.0.0-alpha.23", | ||
| "description": "@leafer-ui/interface", | ||
@@ -22,4 +22,4 @@ "author": "Chao (Leafer) Wan", | ||
| "dependencies": { | ||
| "@leafer/interface": "1.0.0-alpha.21" | ||
| "@leafer/interface": "1.0.0-alpha.23" | ||
| } | ||
| } |
+12
-1
@@ -1,2 +0,2 @@ | ||
| import { IPaint, IStrokeAlign, IStrokeCap, IStrokeJoin, IBlurEffect, IFontWeight, ITextCase, ITextDecoration, IShadowEffect, IGrayscaleEffect } from './type/IType' | ||
| import { IPaint, IStrokeAlign, IStrokeCap, IStrokeJoin, IBlurEffect, IFontWeight, ITextCase, ITextDecoration, IShadowEffect, IGrayscaleEffect, ITextAlign, IVerticalAlign } from './type/IType' | ||
| import { ILeafStrokePaint, ILeafShadowEffect, ILeafPaint } from './type/IComputedType' | ||
@@ -82,4 +82,8 @@ import { IPaintString, IDashPatternString, IPercent, IShadowString, IStringColor, IStrokeWidthString, ICornerRadiusString } from './type/IStringType' | ||
| lineHeight: number | IPercent | ||
| paragraphIndent: number | ||
| paragraphSpacing: number | ||
| textAlign: ITextAlign | ||
| verticalAlign: IVerticalAlign | ||
| } | ||
@@ -95,4 +99,8 @@ export interface ITextStyleInputData { | ||
| lineHeight?: number | IPercent | ||
| paragraphIndent?: number | ||
| paragraphSpacing?: number | ||
| textAlign?: ITextAlign | ||
| verticalAlign?: IVerticalAlign | ||
| } | ||
@@ -111,2 +119,5 @@ export interface ITextStyleComputedData { | ||
| paragraphSpacing?: number | ||
| textAlign?: ITextAlign | ||
| verticalAlign?: IVerticalAlign | ||
| } | ||
@@ -113,0 +124,0 @@ |
+5
-4
@@ -11,13 +11,14 @@ export * from '@leafer/interface' | ||
| IVector, IVectorInputData, IVectorData, | ||
| IText, ITextInputData, ITextData, | ||
| IText, ITextInputData, ITextData, ITextRowData, ITextDrawData, | ||
| IImage, IImageInputData, IImageData, | ||
| IFrame, IFrameInputData, IFrameData, | ||
| IGroup, IGroupInputData, IGroupData, | ||
| IUI, IUIInputData, IUIData | ||
| IUI, IUIInputData, IUIData, | ||
| IUITag, IUITagInputData | ||
| } from './IUI' | ||
| export { IBlendMode, IVectorPath, IShadowEffect, IBlurEffect, IGrayscaleEffect, IStrokeAlign, IStrokeJoin, IStrokeCap, IColor, IPaint, IGradientPaint, IImagePaint, IImagePaintMode, IFontWeight, ITextCase, ITextDecoration } from './type/IType' | ||
| export { IVectorPath, IShadowEffect, IBlurEffect, IGrayscaleEffect, IStrokeAlign, IStrokeJoin, IStrokeCap, IColor, IColorStop, IPaint, IGradientPaint, IImagePaint, IImagePaintMode, IFontWeight, ITextCase, ITextDecoration, ITextAlign, IVerticalAlign } from './type/IType' | ||
| export { ICornerRadiusString, IStrokeWidthString, IPaintString, IShadowString, IPercent, IDashPatternString, IPathString, IVectorPathString, IStringColor } from './type/IStringType' | ||
| export { ILeafFill, ILeafPaint, ILeafPaintColor, ILeafStrokePaint, ILeafShadowEffect } from './type/IComputedType' | ||
| export { IUIRenderModule, IRectRenderModule, IImageRenderModule, IGroupRenderModule, IFrameRenderModule } from './module/IUIRender' | ||
| export { IUIRenderModule, IRectRenderModule, IImageRenderModule, ITextRenderModule, IGroupRenderModule, IFrameRenderModule } from './module/IUIRender' | ||
| export { IUIBoundsModule } from './module/IUIBounds' | ||
@@ -24,0 +25,0 @@ export { IUIHitModule } from './module/IUIHit' |
+51
-19
@@ -1,5 +0,4 @@ | ||
| import { ILeaf, ILeafComputedData, ILeafData, ILeafInputData, ILeaferCanvas, IRenderOptions, IPathDrawer, IPointData, IPath2D, IPathCommandData, IWindingRule, IBranch, ILeaferImageConfig, IMatrixData, IBoundsData, __Number } from '@leafer/interface' | ||
| import { ILeaf, ILeafComputedData, ILeafData, ILeafInputData, ILeaferCanvas, IRenderOptions, IPathDrawer, IPointData, IPath2D, IPathCommandData, IWindingRule, ILeaferImageConfig, IBoundsData, IObject, __Number, ILeaferImage } from '@leafer/interface' | ||
| import { IPathString, IVectorPathString } from './type/IStringType' | ||
| import { IBlendMode } from './type/IType' | ||
| import { IVectorPath } from './type/IType' | ||
@@ -23,3 +22,5 @@ | ||
| export interface ILineData extends IUIData { } | ||
| export interface ILineInputData extends IUIInputData { } | ||
| export interface ILineInputData extends IUIInputData { | ||
| toPoint?: IPointData | ||
| } | ||
@@ -114,4 +115,18 @@ | ||
| } | ||
| export interface ITextRowData { | ||
| x?: number | ||
| y?: number | ||
| width?: number | ||
| height?: number | ||
| text: string | ||
| } | ||
| export interface ITextDrawData extends IBoundsData { | ||
| list: ITextRowData[] | ||
| font: string | ||
| decorationY?: number | ||
| decorationHeight?: number | ||
| } | ||
| export interface ITextData extends ITextAttrData, ITextStyleComputedData, IUIData { | ||
| __font?: string | ||
| } | ||
@@ -123,2 +138,4 @@ export interface ITextInputData extends ITextAttrData, ITextStyleInputData, IUIInputData { | ||
| // Image | ||
@@ -128,7 +145,7 @@ export interface IImage extends IRect, ILeaferImageConfig { | ||
| url: string | ||
| thumb: string | ||
| ready: boolean | ||
| image?: ILeaferImage | ||
| } | ||
| interface IImageAttrData { | ||
| url?: string | ||
| thumb?: string | ||
| } | ||
@@ -143,3 +160,3 @@ export interface IImageData extends IImageAttrData, IRectData { } | ||
| __updateRectBoxBounds(): void | ||
| __updateRectEventBounds(): void | ||
| __updateRectStrokeBounds(): void | ||
| __updateRectRenderBounds(): void | ||
@@ -158,7 +175,6 @@ __renderRect(canvas: ILeaferCanvas, options: IRenderOptions): void | ||
| // Group | ||
| export interface IGroup extends IBranch, IUI { | ||
| export interface IGroup extends IUI { | ||
| __: IGroupData | ||
| root?: IGroup | ||
| parent?: IGroup | ||
| children: IUI[] | ||
| mask?: IUI | ||
| add(child: IUI, index?: number): void | ||
@@ -176,8 +192,7 @@ remove(child?: IUI): void | ||
| __: IUIData | ||
| root?: IGroup | ||
| parent?: IGroup | ||
| readonly worldTransform: IMatrixData | ||
| readonly relativeTransform: IMatrixData | ||
| readonly worldBoxBounds: IBoundsData | ||
| readonly worldRenderBounds: IBoundsData | ||
| set(data: IUITagInputData): void | ||
| get(): IUITagInputData | ||
| __drawPathByData(drawer: IPathDrawer, data: IPathCommandData): void | ||
@@ -204,6 +219,7 @@ } | ||
| __strokeOuterWidth?: number // boxBounds外面的笔触宽度 | ||
| // text | ||
| __textDrawData?: ITextDrawData | ||
| } | ||
| export interface IUIComputedData extends IFillComputedData, IBorderComputedData, IStrokeComputedData, ICornerRadiusComputedData, IEffectComputedData, ILeafComputedData { | ||
| blendMode?: IBlendMode | ||
| mask?: boolean | ||
| locked?: boolean | ||
@@ -213,5 +229,21 @@ } | ||
| export interface IUIInputData extends IFillInputData, IStrokeInputData, ICornerRadiusInputData, IEffectInputData, ILeafInputData { | ||
| blendMode?: IBlendMode | ||
| mask?: boolean | ||
| locked?: boolean | ||
| } | ||
| export type IUITag = | ||
| | 'Rect' | ||
| | 'Ellipse' | ||
| | 'Polygon' | ||
| | 'Star' | ||
| | 'Line' | ||
| | 'Path' | ||
| | 'Text' | ||
| | 'Image' | ||
| | 'Group' | ||
| | 'Frame' | ||
| export interface IUITagInputData extends IRectInputData, IEllipseInputData, IPolygonInputData, IStarInputData, ILineInputData, IPathInputData, ITextInputData, IImageInputData, IGroupInputData, IFrameInputData, IObject { | ||
| tagName?: IUITag | ||
| } |
@@ -1,7 +0,11 @@ | ||
| import { ILeaferCanvas } from '@leafer/interface' | ||
| import { ILeaferCanvas, IRenderOptions } from '@leafer/interface' | ||
| import { ILeafPaint } from '../type/IComputedType' | ||
| import { IUI } from '../IUI' | ||
| import { ICachedShape } from '../ICachedShape' | ||
| export interface IPaintModule { | ||
| computeFill?(ui: IUI): void | ||
| computeStroke?(ui: IUI): void | ||
| fill?(ui: IUI, canvas: ILeaferCanvas, fill: string | object): void | ||
@@ -12,2 +16,4 @@ fills?(ui: IUI, canvas: ILeaferCanvas, fills: ILeafPaint[]): void | ||
| strokes?(ui: IUI, canvas: ILeaferCanvas, strokes: ILeafPaint[]): void | ||
| shape?(ui: IUI, current: ILeaferCanvas, options: IRenderOptions): ICachedShape | ||
| } |
@@ -1,9 +0,8 @@ | ||
| import { ILeafRender, ILeaferCanvas, IRenderOptions, } from '@leafer/interface' | ||
| import { ILeafRender } from '@leafer/interface' | ||
| import { IUI, IRect, IImage, IFrame, IGroup } from '../IUI' | ||
| import { IUI, IRect, IImage, IText, IFrame, IGroup } from '../IUI' | ||
| export type IUIRenderModule = IUIRender & ThisType<IUI> | ||
| interface IUIRender extends ILeafRender { | ||
| __renderShape?(canvas: ILeaferCanvas, options: IRenderOptions): void | ||
| export interface IUIRender extends ILeafRender { | ||
| } | ||
@@ -13,3 +12,3 @@ | ||
| interface IRectRender extends IUIRender { | ||
| export interface IRectRender extends IUIRender { | ||
@@ -20,9 +19,15 @@ } | ||
| interface IImageRender extends IUIRender { | ||
| export interface IImageRender extends IUIRender { | ||
| } | ||
| export type ITextRenderModule = ITextRender & ThisType<IText> | ||
| export interface ITextRender extends IUIRender { | ||
| } | ||
| export type IGroupRenderModule = IGroupRender & ThisType<IGroup> | ||
| interface IGroupRender extends IUIRender { | ||
| export interface IGroupRender extends IUIRender { | ||
@@ -33,5 +38,5 @@ } | ||
| interface IFrameRender extends IGroupRender { | ||
| export interface IFrameRender extends IGroupRender { | ||
| } | ||
@@ -1,5 +0,5 @@ | ||
| import { IPointData } from '@leafer/interface' | ||
| import { IBlendMode, IMatrixData } from '@leafer/interface' | ||
| import { IStringColor } from './IStringType' | ||
| import { IBlendMode, IStrokeAlign, IStrokeJoin, IStrokeCap } from './IType' | ||
| import { IStrokeAlign, IStrokeJoin, IStrokeCap } from './IType' | ||
| import { IPaintType } from './IType' | ||
@@ -12,3 +12,3 @@ | ||
| style: ILeafPaintColor | ||
| scale?: IPointData | ||
| transform?: IMatrixData | ||
| blendMode?: IBlendMode | ||
@@ -15,0 +15,0 @@ opacity?: number |
+18
-33
@@ -1,24 +0,5 @@ | ||
| import { IMatrixData, IPointData, IPathCommandData, IWindingRule } from '@leafer/interface' | ||
| import { IMatrixData, IPointData, IPathCommandData, IWindingRule, IBlendMode } from '@leafer/interface' | ||
| import { IStringColor } from './IStringType' | ||
| export type IBlendMode = | ||
| | 'pass-through' | ||
| | 'normal' | ||
| | 'multiply' | ||
| | 'screen' | ||
| | 'overlay' | ||
| | 'darken' | ||
| | 'lighten' | ||
| | 'color-dodge' | ||
| | 'color-burn' | ||
| | 'hard-light' | ||
| | 'soft-light' | ||
| | 'difference' | ||
| | 'exclusion' | ||
| | 'hue' | ||
| | 'saturation' | ||
| | 'color' | ||
| | 'luminosity' | ||
| export type IPaint = ISolidPaint | IGradientPaint | IImagePaint | ||
@@ -40,6 +21,5 @@ | ||
| export type IGradientType = | ||
| | 'gradient-linear' | ||
| | 'gradient-radial' | ||
| | 'gradient-angular' | ||
| | 'gradient-diamond' | ||
| | 'linear' | ||
| | 'radial' | ||
| | 'angular' | ||
@@ -52,3 +32,3 @@ // --- | ||
| export type IColor = IStringColor // | RGB | RGBA | ||
| export type IColor = IStringColor | IRGB | IRGBA | ||
| export interface IRGB { | ||
@@ -58,2 +38,3 @@ r: number | ||
| b: number | ||
| a?: number | ||
| } | ||
@@ -67,4 +48,4 @@ export interface IRGBA extends IRGB { | ||
| type: IGradientType | ||
| from: IPointData | ||
| to: IPointData | ||
| from?: IPointData | ||
| to?: IPointData | ||
| stretch?: number | ||
@@ -82,7 +63,9 @@ stops: IColorStop[] | ||
| url: string | ||
| mode: IImagePaintMode | ||
| transform?: IMatrixData | ||
| scale?: number | ||
| mode?: IImagePaintMode | ||
| filters?: IImageFilters | ||
| offset?: IPointData | ||
| scale?: number | IPointData | ||
| rotation?: number | ||
| filters?: IImageFilters | ||
| } | ||
@@ -98,3 +81,3 @@ export interface IImageFilters { | ||
| } | ||
| export type IImagePaintMode = 'fill' | 'fit' | 'tile' | 'crop' | ||
| export type IImagePaintMode = 'cover' | 'fit' | 'strench' | 'clip' | 'repeat' | ||
@@ -107,3 +90,5 @@ // 描边 | ||
| // 文本 | ||
| export type ITextCase = 'upper' | 'lower' | 'title' | 'original' | 'small-caps' | 'small-caps-forced' | ||
| export type ITextAlign = 'left' | 'center' | 'right' | 'justify' | ||
| export type IVerticalAlign = 'top' | 'middle' | 'bottom' | ||
| export type ITextCase = | 'upper' | 'lower' | 'title' | 'original' | 'small-caps' | 'small-caps-forced' | ||
| export type IFontWeight = IFontWeightNumerical | IFontWeightString | ||
@@ -110,0 +95,0 @@ export type IFontWeightNumerical = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 |
20371
4.4%551
3.18%+ Added
- Removed