@leafer-ui/interface 1.6.0 → 1.6.2

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.6.0",
3
+ "version": "1.6.2",
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.6.0"
25
+ "@leafer/interface": "1.6.2"
26
26
  }
27
27
  }
package/src/IUI.ts CHANGED
@@ -12,6 +12,7 @@ import { IOverflow } from './type/IType'
12
12
  import { IAnimation, IAnimate, IKeyframe, IKeyframeId, IAnimateType } from './IAnimation'
13
13
  import { ILeafer } from './app/ILeafer'
14
14
  import { IEditorConfig } from './editor/IEditor'
15
+ import { IColorString } from './type/IStringType'
15
16
 
16
17
  // Line
17
18
  export interface ILine extends ILineAttrData, IUI {
@@ -207,6 +208,7 @@ export interface IText extends ITextAttrData, ITextStyleAttrData, IUI {
207
208
  }
208
209
  interface ITextAttrData {
209
210
  text?: string | number
211
+ placeholder?: string
210
212
  padding?: IFourNumber
211
213
  resizeFontSize?: boolean
212
214
  boxStyle?: IBackgroundBoxStyle
@@ -223,6 +225,7 @@ export interface ITextData extends ITextAttrData, ITextStyleComputedData, IUIDat
223
225
  __letterSpacing?: number
224
226
  __padding?: number[]
225
227
  __clipText?: boolean
228
+ __isPlacehold?: boolean
226
229
  __textBoxBounds?: IBoundsData
227
230
  }
228
231
  export interface ITextInputData extends ITextAttrData, ITextStyleInputData, IUIBaseInputData {
@@ -413,6 +416,8 @@ export interface IUI extends IUIAttrData, IFillAttrData, IStrokeAttrData, ICorne
413
416
  __drawAfterFill?(canvas: ILeaferCanvas, options: IRenderOptions): void
414
417
  __drawContent?(canvas: ILeaferCanvas, options: IRenderOptions): void
415
418
 
419
+ drawImagePlaceholder(canvas: ILeaferCanvas, image: ILeaferImage): void
420
+
416
421
  animate(keyframe?: IUIInputData | IKeyframe[] | IAnimation | IAnimation[], options?: ITransition, type?: IAnimateType, isTemp?: boolean): IAnimate
417
422
  killAnimate(type?: IAnimateType, nextStyle?: IUIInputData): void
418
423
 
@@ -451,6 +456,7 @@ interface IUIAttrData {
451
456
  selectedStyle?: IStateStyle
452
457
  disabledStyle?: IStateStyle
453
458
  placeholderStyle?: IStateStyle
459
+ placeholderColor?: IColorString
454
460
 
455
461
  editConfig?: IEditorConfig
456
462
  editOuter?: string
package/src/app/IApp.ts CHANGED
@@ -6,7 +6,7 @@ import { IEditorConfig } from '../editor/IEditor'
6
6
  export interface IApp extends ILeafer {
7
7
  children: ILeafer[]
8
8
  realCanvas: boolean
9
- forEach(fn: IAppForEachFn): void
9
+ forEach(fn: IAppForEachFunction): void
10
10
  }
11
11
 
12
12
  export interface IAppConfig extends ILeaferConfig {
@@ -16,6 +16,6 @@ export interface IAppConfig extends ILeaferConfig {
16
16
  editor?: IEditorConfig
17
17
  }
18
18
 
19
- export interface IAppForEachFn {
19
+ export interface IAppForEachFunction {
20
20
  (value: ILeafer, index: number, array: ILeafer[]): void
21
21
  }
package/src/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from '@leafer/interface'
2
2
 
3
- export { IApp, IAppConfig, IAppForEachFn } from './app/IApp'
3
+ export { IApp, IAppConfig, IAppForEachFunction } from './app/IApp'
4
4
  export { ILeafer } from './app/ILeafer'
5
5
 
6
6
  export {
@@ -12,6 +12,7 @@ export interface IPaintModule {
12
12
  fill(fill: string, ui: IUI, canvas: ILeaferCanvas,): void
13
13
  fills(fills: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas): void
14
14
 
15
+ fillPathOrText(ui: IUI, canvas: ILeaferCanvas): void
15
16
  fillText(ui: IUI, canvas: ILeaferCanvas): void
16
17
 
17
18
  stroke(stroke: string, ui: IUI, canvas: ILeaferCanvas): void
@@ -26,7 +27,7 @@ export interface IPaintModule {
26
27
 
27
28
  export interface IPaintImageModule {
28
29
  image(ui: IUI, attrName: string, paint: IImagePaint, boxBounds: IBoundsData, firstUse: boolean): ILeafPaint
29
- checkImage(ui: IUI, canvas: ILeaferCanvas, paint: ILeafPaint, allowPaint?: boolean): boolean
30
+ checkImage(ui: IUI, canvas: ILeaferCanvas, paint: ILeafPaint, allowPaint?: boolean): boolean // 返回true表示已进行了原生绘制
30
31
  createPattern(ui: IUI, paint: ILeafPaint, pixelRatio: number): boolean
31
32
  recycleImage(attrName: IPaintAttr, data: IUIData): IBooleanMap
32
33
 
@@ -12,6 +12,7 @@ export interface IStateModule {
12
12
  isFocus(leaf: ILeaf, button?: ILeaf | boolean): boolean
13
13
  isHover(leaf: ILeaf, button?: ILeaf | boolean): boolean
14
14
  isPress(leaf: ILeaf, button?: ILeaf | boolean): boolean
15
+ isPlacehold(leaf: ILeaf, button?: ILeaf | boolean): boolean
15
16
 
16
17
  isDrag(leaf: ILeaf, button?: boolean | ILeaf): boolean
17
18
 
package/src/type/IType.ts CHANGED
@@ -80,6 +80,7 @@ export interface IImagePaint extends IPaintBase {
80
80
 
81
81
  changeful?: boolean // 会频繁变化,不生成图案(有特殊性能优化,一般用于游戏精灵、动图场景)
82
82
  sync?: boolean // 同步显示,不走任务列表生成图案
83
+ showProgress?: boolean // 是否显示进度
83
84
  }
84
85
  export interface IImageFilters {
85
86
  exposure?: number // 曝光
package/types/index.d.ts CHANGED
@@ -65,6 +65,7 @@ interface IImagePaint extends IPaintBase {
65
65
  repeat?: IRepeat;
66
66
  changeful?: boolean;
67
67
  sync?: boolean;
68
+ showProgress?: boolean;
68
69
  }
69
70
  interface IImageFilters {
70
71
  exposure?: number;
@@ -726,6 +727,7 @@ interface IText extends ITextAttrData, ITextStyleAttrData, IUI {
726
727
  }
727
728
  interface ITextAttrData {
728
729
  text?: string | number;
730
+ placeholder?: string;
729
731
  padding?: IFourNumber;
730
732
  resizeFontSize?: boolean;
731
733
  boxStyle?: IBackgroundBoxStyle;
@@ -739,6 +741,7 @@ interface ITextData extends ITextAttrData, ITextStyleComputedData, IUIData {
739
741
  __letterSpacing?: number;
740
742
  __padding?: number[];
741
743
  __clipText?: boolean;
744
+ __isPlacehold?: boolean;
742
745
  __textBoxBounds?: IBoundsData$1;
743
746
  }
744
747
  interface ITextInputData extends ITextAttrData, ITextStyleInputData, IUIBaseInputData {
@@ -890,6 +893,7 @@ interface IUI extends IUIAttrData, IFillAttrData, IStrokeAttrData, ICornerRadius
890
893
  __drawPathByBox(drawer: IPathDrawer): void;
891
894
  __drawAfterFill?(canvas: ILeaferCanvas, options: IRenderOptions): void;
892
895
  __drawContent?(canvas: ILeaferCanvas, options: IRenderOptions): void;
896
+ drawImagePlaceholder(canvas: ILeaferCanvas, image: ILeaferImage): void;
893
897
  animate(keyframe?: IUIInputData | IKeyframe[] | IAnimation | IAnimation[], options?: ITransition, type?: IAnimateType, isTemp?: boolean): IAnimate;
894
898
  killAnimate(type?: IAnimateType, nextStyle?: IUIInputData): void;
895
899
  export(filename: string, options?: IExportOptions | number | boolean): Promise<IExportResult>;
@@ -915,6 +919,7 @@ interface IUIAttrData {
915
919
  selectedStyle?: IStateStyle;
916
920
  disabledStyle?: IStateStyle;
917
921
  placeholderStyle?: IStateStyle;
922
+ placeholderColor?: IColorString;
918
923
  editConfig?: IEditorConfig;
919
924
  editOuter?: string;
920
925
  editInner?: string;
@@ -976,7 +981,7 @@ interface ILeafer extends IGroup, ILeaferAttrData, IControl {
976
981
  interface IApp extends ILeafer {
977
982
  children: ILeafer[];
978
983
  realCanvas: boolean;
979
- forEach(fn: IAppForEachFn): void;
984
+ forEach(fn: IAppForEachFunction): void;
980
985
  }
981
986
  interface IAppConfig extends ILeaferConfig {
982
987
  ground?: ILeaferConfig;
@@ -984,7 +989,7 @@ interface IAppConfig extends ILeaferConfig {
984
989
  sky?: ILeaferConfig;
985
990
  editor?: IEditorConfig;
986
991
  }
987
- interface IAppForEachFn {
992
+ interface IAppForEachFunction {
988
993
  (value: ILeafer, index: number, array: ILeafer[]): void;
989
994
  }
990
995
 
@@ -1061,6 +1066,7 @@ interface IStateModule {
1061
1066
  isFocus(leaf: ILeaf, button?: ILeaf | boolean): boolean;
1062
1067
  isHover(leaf: ILeaf, button?: ILeaf | boolean): boolean;
1063
1068
  isPress(leaf: ILeaf, button?: ILeaf | boolean): boolean;
1069
+ isPlacehold(leaf: ILeaf, button?: ILeaf | boolean): boolean;
1064
1070
  isDrag(leaf: ILeaf, button?: boolean | ILeaf): boolean;
1065
1071
  setStyleName(leaf: ILeaf, styleName: IString$1, value: IBoolean$1): void;
1066
1072
  set(leaf: ILeaf, stateName: IString$1): void;
@@ -1080,6 +1086,7 @@ interface IPaintModule {
1080
1086
  compute(attrName: IPaintAttr, ui: IUI): void;
1081
1087
  fill(fill: string, ui: IUI, canvas: ILeaferCanvas): void;
1082
1088
  fills(fills: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas): void;
1089
+ fillPathOrText(ui: IUI, canvas: ILeaferCanvas): void;
1083
1090
  fillText(ui: IUI, canvas: ILeaferCanvas): void;
1084
1091
  stroke(stroke: string, ui: IUI, canvas: ILeaferCanvas): void;
1085
1092
  strokes(strokes: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas): void;
@@ -1129,4 +1136,4 @@ interface IFilterFunction {
1129
1136
  (filter: IFilter, ui: IUI, bounds: IMatrixWithBoundsScaleData, currentCanvas: ILeaferCanvas, originCanvas: ILeaferCanvas, shape: ICachedShape): void;
1130
1137
  }
1131
1138
 
1132
- export type { IAnimate, IAnimateKeyframe, IAnimateList, IAnimateType, IAnimation, IApp, IAppConfig, IAppData, IAppForEachFn, IAppInputData, IArrow, IArrowData, IArrowInputData, IArrowType, IBackgroundBoxStyle, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, IColorString, IComputedKeyframe, ICornerRadiusString, IDashPatternString, IEditBoxBase, IEditPoint, IEditPointInputData, IEditPointType, IEditToolFunction, IEditorBase, IEditorBeforeMove, IEditorBeforeRotate, IEditorBeforeScale, IEditorBeforeSelect, IEditorBeforeSkew, IEditorConfig, IEditorConfigFunction, IEditorDragStartData, IEditorMoveData, IEditorRotationData, IEditorScaleData, IEditorSelectData, IEditorSkewData, IEffect, IEffectAttrData, IEffectComputedData, IEffectInputData, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IFill, IFilterFunction, IFilterModule, IFilterProcessor, IFindUIMethod, IFlow, IFlowData, IFlowInputData, IFontWeight, IFontWeightNumer, IFontWeightString, IFrame, IFrameData, IFrameInputData, IFrameRenderModule, IGIF, IGIFData, IGIFInputData, IGradientPaint, IGradientType, IGrayscaleEffect, IGroup, IGroupData, IGroupInputData, IGroupRenderModule, IImage, IImageData, IImageFilters, IImageInputData, IImagePaint, IImagePaintMode, IImageRenderModule, IKeyframe, IKeyframeId, IKeyframesAnimation, ILeafFill, ILeafPaint, ILeafPaintColor, ILeafPaintPatternData, ILeafShadowEffect, ILeafStrokePaint, ILeafer, ILeaferData, ILeaferInputData, ILine, ILineData, ILineInputData, IOverflow, IPaint, IPaintAttr, IPaintBase, IPaintGradientModule, IPaintImageModule, IPaintModule, IPaintString, IPaintType, IPath, IPathArrowModule, IPathData, IPathDataArrow, IPathDataArrowMap, IPathDataArrowOffset, IPathInputData, IPen, IPenData, IPenInputData, IPercent, IPolygon, IPolygonData, IPolygonInputData, IRGB, IRGBA, IRect, IRectData, IRectInputData, IRectRenderModule, IRepeat, IRobot, IRobotActionName, IRobotActions, IRobotAnimation, IRobotComputedKeyframe, IRobotData, IRobotInputData, IRobotKeyframe, IShadowEffect, IShadowString, ISolidPaint, IStar, IStarData, IStarInputData, IStateModule, IStateName, IStateStyle, IStates, IStroke, IStrokeAlign, IStrokeAttrData, IStrokeCap, IStrokeComputedData, IStrokeInputData, IStrokeJoin, IStrokeWidthString, IStyleAnimation, IText, ITextAlign, ITextCase, ITextCharData, ITextConvertModule, ITextData, ITextDecoration, ITextDecorationData, ITextDecorationType, ITextDrawData, ITextInputData, ITextRenderModule, ITextRowData, ITextStyleAttrData, ITextStyleComputedData, ITextStyleInputData, ITextWordData, ITextWrap, ITransitionFunction, ITransitionMap, ITransitionModule, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIJSONData, IUIRenderModule, IUITag, IVectorPath, IVerticalAlign, IVideo, IVideoData, IVideoInputData, IWritingMode };
1139
+ export type { IAnimate, IAnimateKeyframe, IAnimateList, IAnimateType, IAnimation, IApp, IAppConfig, IAppData, IAppForEachFunction, IAppInputData, IArrow, IArrowData, IArrowInputData, IArrowType, IBackgroundBoxStyle, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, IColorString, IComputedKeyframe, ICornerRadiusString, IDashPatternString, IEditBoxBase, IEditPoint, IEditPointInputData, IEditPointType, IEditToolFunction, IEditorBase, IEditorBeforeMove, IEditorBeforeRotate, IEditorBeforeScale, IEditorBeforeSelect, IEditorBeforeSkew, IEditorConfig, IEditorConfigFunction, IEditorDragStartData, IEditorMoveData, IEditorRotationData, IEditorScaleData, IEditorSelectData, IEditorSkewData, IEffect, IEffectAttrData, IEffectComputedData, IEffectInputData, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IFill, IFilterFunction, IFilterModule, IFilterProcessor, IFindUIMethod, IFlow, IFlowData, IFlowInputData, IFontWeight, IFontWeightNumer, IFontWeightString, IFrame, IFrameData, IFrameInputData, IFrameRenderModule, IGIF, IGIFData, IGIFInputData, IGradientPaint, IGradientType, IGrayscaleEffect, IGroup, IGroupData, IGroupInputData, IGroupRenderModule, IImage, IImageData, IImageFilters, IImageInputData, IImagePaint, IImagePaintMode, IImageRenderModule, IKeyframe, IKeyframeId, IKeyframesAnimation, ILeafFill, ILeafPaint, ILeafPaintColor, ILeafPaintPatternData, ILeafShadowEffect, ILeafStrokePaint, ILeafer, ILeaferData, ILeaferInputData, ILine, ILineData, ILineInputData, IOverflow, IPaint, IPaintAttr, IPaintBase, IPaintGradientModule, IPaintImageModule, IPaintModule, IPaintString, IPaintType, IPath, IPathArrowModule, IPathData, IPathDataArrow, IPathDataArrowMap, IPathDataArrowOffset, IPathInputData, IPen, IPenData, IPenInputData, IPercent, IPolygon, IPolygonData, IPolygonInputData, IRGB, IRGBA, IRect, IRectData, IRectInputData, IRectRenderModule, IRepeat, IRobot, IRobotActionName, IRobotActions, IRobotAnimation, IRobotComputedKeyframe, IRobotData, IRobotInputData, IRobotKeyframe, IShadowEffect, IShadowString, ISolidPaint, IStar, IStarData, IStarInputData, IStateModule, IStateName, IStateStyle, IStates, IStroke, IStrokeAlign, IStrokeAttrData, IStrokeCap, IStrokeComputedData, IStrokeInputData, IStrokeJoin, IStrokeWidthString, IStyleAnimation, IText, ITextAlign, ITextCase, ITextCharData, ITextConvertModule, ITextData, ITextDecoration, ITextDecorationData, ITextDecorationType, ITextDrawData, ITextInputData, ITextRenderModule, ITextRowData, ITextStyleAttrData, ITextStyleComputedData, ITextStyleInputData, ITextWordData, ITextWrap, ITransitionFunction, ITransitionMap, ITransitionModule, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIJSONData, IUIRenderModule, IUITag, IVectorPath, IVerticalAlign, IVideo, IVideoData, IVideoInputData, IWritingMode };