@leafer-ui/interface 2.0.0 → 2.0.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 +2 -2
- package/src/IUI.ts +94 -86
- package/src/index.ts +1 -1
- package/src/module/IPaint.ts +3 -0
- package/src/type/IComputedType.ts +8 -6
- package/src/type/IType.ts +5 -4
- package/types/index.d.ts +82 -75
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/interface",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.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": "2.0.
|
|
25
|
+
"@leafer/interface": "2.0.2"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/src/IUI.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ILeaf, ILeafComputedData, ILeafData, ILeafInputData, ILeaferCanvas, IRenderOptions, IExportOptions, IExportResult, IPathDrawer, IPointData, IPathCommandData, IBoundsData, IObject, IPathString, ILeaferImage, IPathCreator, IAnswer, IPickOptions, IPickResult, IValue, ICanvasContext2DSettings, IFourNumber, IFindCondition, IBoolean, ICanvasContext2D, IJSONOptions, IMatrixData, ISizeData, ITransition, IAround } from '@leafer/interface'
|
|
1
|
+
import { ILeaf, ILeafComputedData, ILeafData, ILeafInputData, ILeaferCanvas, IRenderOptions, IExportOptions, IExportResult, IPathDrawer, IPointData, IPathCommandData, IBoundsData, IObject, IPathString, ILeaferImage, IPathCreator, IAnswer, IPickOptions, IPickResult, IValue, ICanvasContext2DSettings, IFourNumber, IFindCondition, IBoolean, ICanvasContext2D, IJSONOptions, IMatrixData, ISizeData, ITransition, IAround, IMultimediaType } from '@leafer/interface'
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
IFillAttrData, IFillInputData, IFillComputedData,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
ITextStyleAttrData, ITextStyleInputData, ITextStyleComputedData,
|
|
10
10
|
IStrokeComputedStyle
|
|
11
11
|
} from './ICommonAttr'
|
|
12
|
-
import { IOverflow } from './type/IType'
|
|
12
|
+
import { IFill, IOverflow } from './type/IType'
|
|
13
13
|
import { IAnimation, IAnimate, IKeyframe, IKeyframeId, IAnimateType } from './IAnimation'
|
|
14
14
|
import { ILeafer } from './app/ILeafer'
|
|
15
15
|
import { IEditorConfig } from './editor/IEditor'
|
|
@@ -73,88 +73,6 @@ export interface IFlowData extends IFlowAttrData, IBoxData { }
|
|
|
73
73
|
export interface IFlowInputData extends IFlowAttrData, IBoxInputData { }
|
|
74
74
|
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
// Video
|
|
78
|
-
export interface IVideo extends IPlayerMethods, IRect {
|
|
79
|
-
__: IVideoData
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
interface IPlayerMethods {
|
|
83
|
-
play(): void
|
|
84
|
-
pause(): void
|
|
85
|
-
stop(): void
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
interface IVideoAttrData {
|
|
89
|
-
url?: string
|
|
90
|
-
}
|
|
91
|
-
export interface IVideoData extends IVideoAttrData, IRectData { }
|
|
92
|
-
export interface IVideoInputData extends IVideoAttrData, IRectInputData { }
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
// GIF
|
|
97
|
-
export interface IGIF extends IPlayerMethods, IRect {
|
|
98
|
-
__: IGIFData
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
interface IGIFAttrData {
|
|
102
|
-
url?: string
|
|
103
|
-
}
|
|
104
|
-
export interface IGIFData extends IGIFAttrData, IRectData { }
|
|
105
|
-
export interface IGIFInputData extends IGIFAttrData, IRectInputData { }
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
// Robot
|
|
110
|
-
export interface IRobot extends IRobotAttrData, IPlayerMethods, IRect {
|
|
111
|
-
__: IRobotData
|
|
112
|
-
readonly running: boolean
|
|
113
|
-
readonly nowFrame?: IRobotComputedKeyframe
|
|
114
|
-
readonly robotFrames?: IRobotComputedKeyframe[]
|
|
115
|
-
|
|
116
|
-
__updateRobot(): void
|
|
117
|
-
__updateAction(): void
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
interface IRobotAttrData {
|
|
121
|
-
robot?: IRobotKeyframe | IRobotKeyframe[]
|
|
122
|
-
actions?: IRobotActions
|
|
123
|
-
action?: IRobotActionName
|
|
124
|
-
now?: number
|
|
125
|
-
FPS?: number
|
|
126
|
-
loop?: boolean | number
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export interface IRobotActions {
|
|
130
|
-
[name: string]: IKeyframeId | IKeyframeId[] | IRobotAnimation
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export interface IRobotAnimation {
|
|
134
|
-
keyframes: IKeyframeId[]
|
|
135
|
-
loop?: boolean | number
|
|
136
|
-
FPS?: number
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export type IRobotActionName = string
|
|
140
|
-
|
|
141
|
-
export interface IRobotKeyframe {
|
|
142
|
-
mode?: 'normal' | 'clip'
|
|
143
|
-
url: string
|
|
144
|
-
|
|
145
|
-
offset?: IPointData
|
|
146
|
-
size?: number | ISizeData
|
|
147
|
-
total?: number
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export interface IRobotComputedKeyframe extends IBoundsData {
|
|
151
|
-
view: any
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export interface IRobotData extends IRobotAttrData, IRectData { }
|
|
155
|
-
export interface IRobotInputData extends IRobotAttrData, IRectInputData { }
|
|
156
|
-
|
|
157
|
-
|
|
158
76
|
// Rect
|
|
159
77
|
export interface IRect extends IUI {
|
|
160
78
|
__: IRectData
|
|
@@ -309,12 +227,17 @@ export interface IImage extends IImageAttrData, IRect {
|
|
|
309
227
|
}
|
|
310
228
|
interface IImageAttrData {
|
|
311
229
|
url?: string
|
|
230
|
+
foreground?: IFill
|
|
231
|
+
background?: IFill
|
|
312
232
|
}
|
|
313
233
|
export interface IImageData extends IImageAttrData, IRectData {
|
|
234
|
+
readonly __urlType: IMultimediaType
|
|
314
235
|
__setImageFill(value: string): void
|
|
315
236
|
}
|
|
316
237
|
export interface IImageInputData extends IImageAttrData, IUIBaseInputData { }
|
|
317
238
|
|
|
239
|
+
|
|
240
|
+
// Canvas
|
|
318
241
|
export interface ICanvas extends ICanvasAttrData, IRect {
|
|
319
242
|
__: ICanvasData
|
|
320
243
|
canvas?: ILeaferCanvas
|
|
@@ -331,6 +254,90 @@ export interface ICanvasData extends ICanvasAttrData, IRectData { }
|
|
|
331
254
|
export interface ICanvasInputData extends ICanvasAttrData, IUIBaseInputData { }
|
|
332
255
|
|
|
333
256
|
|
|
257
|
+
// Film
|
|
258
|
+
export interface IFilm extends IFilmAttrData, IPlayerMethods, IImage {
|
|
259
|
+
__: IFilmData
|
|
260
|
+
}
|
|
261
|
+
interface IFilmAttrData {
|
|
262
|
+
url?: string
|
|
263
|
+
}
|
|
264
|
+
export interface IFilmData extends IFilmAttrData, IImageData {
|
|
265
|
+
|
|
266
|
+
}
|
|
267
|
+
export interface IFilmInputData extends IFilmAttrData, IUIBaseInputData { }
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
// Video
|
|
272
|
+
export interface IVideo extends IVideoAttrData, IPlayerMethods, IImage {
|
|
273
|
+
__: IVideoData
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
interface IPlayerMethods {
|
|
277
|
+
togglePlay(): void
|
|
278
|
+
play(): void
|
|
279
|
+
pause(): void
|
|
280
|
+
stop(): void
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
interface IVideoAttrData {
|
|
284
|
+
url?: string
|
|
285
|
+
}
|
|
286
|
+
export interface IVideoData extends IVideoAttrData, IImageData { }
|
|
287
|
+
export interface IVideoInputData extends IVideoAttrData, IImageInputData { }
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
// Robot
|
|
292
|
+
export interface IRobot extends IRobotAttrData, IPlayerMethods, IRect {
|
|
293
|
+
__: IRobotData
|
|
294
|
+
readonly running: boolean
|
|
295
|
+
readonly nowFrame?: IRobotComputedKeyframe
|
|
296
|
+
readonly robotFrames?: IRobotComputedKeyframe[]
|
|
297
|
+
|
|
298
|
+
__updateRobot(): void
|
|
299
|
+
__updateAction(): void
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
interface IRobotAttrData {
|
|
303
|
+
robot?: IRobotKeyframe | IRobotKeyframe[]
|
|
304
|
+
actions?: IRobotActions
|
|
305
|
+
action?: IRobotActionName
|
|
306
|
+
now?: number
|
|
307
|
+
FPS?: number
|
|
308
|
+
loop?: boolean | number
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export interface IRobotActions {
|
|
312
|
+
[name: string]: IKeyframeId | IKeyframeId[] | IRobotAnimation
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export interface IRobotAnimation {
|
|
316
|
+
keyframes: IKeyframeId[]
|
|
317
|
+
loop?: boolean | number
|
|
318
|
+
FPS?: number
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export type IRobotActionName = string
|
|
322
|
+
|
|
323
|
+
export interface IRobotKeyframe {
|
|
324
|
+
mode?: 'normal' | 'clip'
|
|
325
|
+
url: string
|
|
326
|
+
|
|
327
|
+
offset?: IPointData
|
|
328
|
+
size?: number | ISizeData
|
|
329
|
+
total?: number
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export interface IRobotComputedKeyframe extends IBoundsData {
|
|
333
|
+
view: any
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export interface IRobotData extends IRobotAttrData, IRectData { }
|
|
337
|
+
export interface IRobotInputData extends IRobotAttrData, IRectInputData { }
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
334
341
|
// Leafer
|
|
335
342
|
export interface ILeaferData extends IGroupData {
|
|
336
343
|
|
|
@@ -569,11 +576,12 @@ export type IUITag =
|
|
|
569
576
|
| 'Box'
|
|
570
577
|
| 'Arrow'
|
|
571
578
|
| 'Robot'
|
|
572
|
-
| '
|
|
579
|
+
| 'Film'
|
|
573
580
|
| 'Video'
|
|
581
|
+
| (string & {})
|
|
574
582
|
|
|
575
583
|
|
|
576
|
-
export interface IUIInputData extends IRectInputData, IEllipseInputData, IPolygonInputData, IStarInputData, ILineInputData, IPathInputData, ITextInputData, IImageInputData, IGroupInputData, IBoxInputData, IFrameInputData, IFlowInputData, IArrowInputData,
|
|
584
|
+
export interface IUIInputData extends IRectInputData, IEllipseInputData, IPolygonInputData, IStarInputData, ILineInputData, IPathInputData, ITextInputData, IImageInputData, IGroupInputData, IBoxInputData, IFrameInputData, IFlowInputData, IArrowInputData, IVideoInputData, IRobotInputData, IUIBaseInputData, IObject {
|
|
577
585
|
children?: IUIInputData[]
|
|
578
586
|
}
|
|
579
587
|
|
package/src/index.ts
CHANGED
|
@@ -16,10 +16,10 @@ export {
|
|
|
16
16
|
IText, ITextInputData, ITextData, ITextRowData, ITextWordData, ITextCharData, ITextDrawData, IBackgroundBoxStyle,
|
|
17
17
|
IImage, IImageInputData, IImageData,
|
|
18
18
|
ICanvas, ICanvasInputData, ICanvasData,
|
|
19
|
+
IFilm, IFilmInputData, IFilmData,
|
|
19
20
|
IFrame, IFrameInputData, IFrameData,
|
|
20
21
|
IFlow, IFlowInputData, IFlowData,
|
|
21
22
|
IVideo, IVideoInputData, IVideoData,
|
|
22
|
-
IGIF, IGIFInputData, IGIFData,
|
|
23
23
|
IRobot, IRobotInputData, IRobotData, IRobotActions, IRobotActionName, IRobotKeyframe, IRobotComputedKeyframe, IRobotAnimation,
|
|
24
24
|
IBox, IBoxInputData, IBoxData,
|
|
25
25
|
IGroup, IGroupInputData, IGroupData,
|
package/src/module/IPaint.ts
CHANGED
|
@@ -30,6 +30,9 @@ export interface IPaintModule {
|
|
|
30
30
|
export interface IPaintImageModule {
|
|
31
31
|
image(ui: IUI, attrName: string, paint: IImagePaint, boxBounds: IBoundsData, firstUse: boolean): ILeafPaint
|
|
32
32
|
|
|
33
|
+
film?(paint: ILeafPaint): void
|
|
34
|
+
video?(paint: ILeafPaint): void
|
|
35
|
+
|
|
33
36
|
checkImage(paint: ILeafPaint, allowDraw: boolean, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): boolean // 返回true表示已进行了原生绘制
|
|
34
37
|
drawImage(paint: ILeafPaint, imageScaleX: number, imageScaleY: number, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void
|
|
35
38
|
getImageRenderScaleData(paint: ILeafPaint, ui: IUI, canvas?: ILeaferCanvas, renderOptions?: IRenderOptions): IScaleData // 当前图片渲染的比例数据,必须马上分解使用
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { IBlendMode, IDirection, IInterlace, ILeaferImage, IMatrixData, IPointData, IScaleFixed, ITaskItem } from '@leafer/interface'
|
|
1
|
+
import { IBlendMode, IDirection, IFilmPlayOptions, IInterlace, ILeaferImage, IMatrixData, IPointData, IScaleFixed, ITaskItem } from '@leafer/interface'
|
|
2
2
|
|
|
3
3
|
import { IColorString } from './IStringType'
|
|
4
|
-
import { IStrokeAlign, IStrokeJoin, IStrokeCap, IImagePaintMode,
|
|
4
|
+
import { IStrokeAlign, IStrokeJoin, IStrokeCap, IImagePaintMode, IPaint } from './IType'
|
|
5
5
|
import { IPaintType } from './IType'
|
|
6
6
|
import { IStrokeComputedStyle } from '../ICommonAttr'
|
|
7
7
|
|
|
8
8
|
export type ILeafPaintColor = IColorString | CanvasGradient | CanvasPattern
|
|
9
9
|
|
|
10
|
-
export interface ILeafPaint {
|
|
10
|
+
export interface ILeafPaint extends IFilmPlayOptions {
|
|
11
11
|
type?: IPaintType
|
|
12
12
|
style?: ILeafPaintColor
|
|
13
13
|
strokeStyle?: IStrokeComputedStyle // 子描边样式选项
|
|
@@ -18,22 +18,24 @@ export interface ILeafPaint {
|
|
|
18
18
|
drawLevel?: number // drawImage level
|
|
19
19
|
|
|
20
20
|
loadId?: number
|
|
21
|
-
patternId?: string
|
|
21
|
+
patternId?: string | number
|
|
22
22
|
patternTask?: ITaskItem
|
|
23
23
|
progressTimer?: any
|
|
24
24
|
|
|
25
|
+
complex?: boolean | 2 // 绘制原图时canvas需要save、restore, 为2表示需要clipUI
|
|
26
|
+
|
|
25
27
|
isTransparent?: boolean // 是否为透明色
|
|
26
28
|
data?: ILeafPaintPatternData
|
|
27
29
|
originPaint?: IPaint // 原始paint对象
|
|
30
|
+
|
|
31
|
+
film?: boolean // flim或video类型
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
export interface ILeafPaintPatternData {
|
|
31
35
|
scaleX?: number
|
|
32
36
|
scaleY?: number
|
|
33
37
|
gap?: IPointData
|
|
34
|
-
opacity?: number
|
|
35
38
|
transform?: IMatrixData
|
|
36
|
-
filters?: IImageFilters
|
|
37
39
|
mode?: IImagePaintMode
|
|
38
40
|
repeat?: 'repeat' | 'repeat-x' | 'repeat-y'
|
|
39
41
|
interlace?: IInterlace
|
package/src/type/IType.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IPointData, IPathCommandData, IWindingRule, IBlendMode, IExportFileType, IFourNumber, IAlign, IUnitPointData, IAxis, IAxisReverse, IInterlace, IFilter, IOptionSizeData, ISizeData, IGap, IPointGap, IScaleFixed, IDirection, IImageLOD, IPercentData } from '@leafer/interface'
|
|
1
|
+
import { IPointData, IPathCommandData, IWindingRule, IBlendMode, IExportFileType, IMultimediaType, IFourNumber, IAlign, IUnitPointData, IAxis, IAxisReverse, IInterlace, IFilter, IOptionSizeData, ISizeData, IGap, IPointGap, IScaleFixed, IDirection, IImageLOD, IPercentData, IFilmOptions } from '@leafer/interface'
|
|
2
2
|
import { IColorString, IPaintString } from './IStringType'
|
|
3
3
|
import { IStrokeStyle } from '../ICommonAttr'
|
|
4
4
|
|
|
@@ -24,9 +24,9 @@ export interface IPaintBase {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export type IPaintType =
|
|
27
|
-
| 'image'
|
|
28
27
|
| 'solid'
|
|
29
28
|
| IGradientType
|
|
29
|
+
| IMultimediaType
|
|
30
30
|
|
|
31
31
|
export type IGradientType =
|
|
32
32
|
| 'linear'
|
|
@@ -66,11 +66,12 @@ export interface IStrokeGradientPaint extends IGradientPaint { }
|
|
|
66
66
|
export interface IColorStop {
|
|
67
67
|
offset: number
|
|
68
68
|
color: IColor
|
|
69
|
+
selected?: boolean
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
// ---
|
|
72
|
-
export interface IImagePaint extends IPaintBase {
|
|
73
|
-
type:
|
|
73
|
+
export interface IImagePaint extends IPaintBase, IFilmOptions {
|
|
74
|
+
type: IMultimediaType
|
|
74
75
|
|
|
75
76
|
url: string
|
|
76
77
|
lod?: IImageLOD
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IBlendMode, IScaleFixed, IAlign, IUnitPointData, IImageLOD, IExportFileType, IFourNumber, IPointData, IOptionSizeData, ISizeData, IGap, IPointGap, IPercentData, IInterlace, IPathCommandData, IAxis, IAxisReverse, IDirection, IWindingRule, IFilter, IMatrixData, ILeaferImage, ITaskItem, INumber, IString, IBoolean, IUnitData, IAnimateOptions, IAnimateEasing, IEventer, IObject, IEventParamsMap, IAnimateEasingFunction, IAnimateEnding, ITransition, IBounds, ILeafInputData, ILeaf as ILeaf$1, ILeafComputedData, ILeafData, IBoundsData, IValue, IPathCreator, IJSONOptions, IFindCondition, IAnswer, IPathString, IPathDrawer, ILeaferCanvas, IRenderOptions, IExportOptions, IExportResult, IPickOptions, IPickResult, IAround, ICanvasContext2DSettings, ICanvasContext2D, ILeaferAttrData, IControl, ILeaferType, ILeaferConfig, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IScaleData as IScaleData$1, IBooleanMap, IFunction, IMatrixWithBoundsScaleData } from '@leafer/interface';
|
|
1
|
+
import { IMultimediaType, IBlendMode, IScaleFixed, IAlign, IUnitPointData, IFilmOptions, IImageLOD, IExportFileType, IFourNumber, IPointData, IOptionSizeData, ISizeData, IGap, IPointGap, IPercentData, IInterlace, IPathCommandData, IAxis, IAxisReverse, IDirection, IWindingRule, IFilter, IFilmPlayOptions, IMatrixData, ILeaferImage, ITaskItem, INumber, IString, IBoolean, IUnitData, IAnimateOptions, IAnimateEasing, IEventer, IObject, IEventParamsMap, IAnimateEasingFunction, IAnimateEnding, ITransition, IBounds, ILeafInputData, ILeaf as ILeaf$1, ILeafComputedData, ILeafData, IBoundsData, IValue, IPathCreator, IJSONOptions, IFindCondition, IAnswer, IPathString, IPathDrawer, ILeaferCanvas, IRenderOptions, IExportOptions, IExportResult, IPickOptions, IPickResult, IAround, ICanvasContext2DSettings, ICanvasContext2D, ILeaferAttrData, IControl, ILeaferType, ILeaferConfig, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IScaleData as IScaleData$1, IBooleanMap, IFunction, IMatrixWithBoundsScaleData } from '@leafer/interface';
|
|
2
2
|
export * from '@leafer/interface';
|
|
3
3
|
import { IObject as IObject$1, IEditSize, IStroke as IStroke$1, IFourNumber as IFourNumber$1, IFill as IFill$1, IBoxInputData as IBoxInputData$1, IRectInputData as IRectInputData$1, IColorString as IColorString$1, IDirection4, ICursorType, IImageCursor, IAlign as IAlign$1, IUnitPointData as IUnitPointData$1, IUIInputData as IUIInputData$1, IShortcutKeysCheck, IShortcutKeys, IUI as IUI$1, IPointData as IPointData$1, IScaleData, ISkewData, IGroup as IGroup$1, ISelectorProxy, IBox as IBox$1, ILayoutBoundsData, IKeyEvent, IUIEvent, IDragEvent, IMoveEvent, IZoomEvent, IRotateEvent, ITransition as ITransition$1, ILeafList, ILeafer as ILeafer$1, ILeaf, IGroupInputData as IGroupInputData$1, IStateName as IStateName$1, IString as IString$1, IBoolean as IBoolean$1, IStateStyle as IStateStyle$1 } from '@leafer-ui/interface';
|
|
4
4
|
|
|
@@ -27,7 +27,7 @@ interface IPaintBase {
|
|
|
27
27
|
editing?: boolean;
|
|
28
28
|
scaleFixed?: IScaleFixed;
|
|
29
29
|
}
|
|
30
|
-
type IPaintType = '
|
|
30
|
+
type IPaintType = 'solid' | IGradientType | IMultimediaType;
|
|
31
31
|
type IGradientType = 'linear' | 'radial' | 'angular';
|
|
32
32
|
interface ISolidPaint extends IPaintBase {
|
|
33
33
|
type: 'solid';
|
|
@@ -57,9 +57,10 @@ interface IStrokeGradientPaint extends IGradientPaint {
|
|
|
57
57
|
interface IColorStop {
|
|
58
58
|
offset: number;
|
|
59
59
|
color: IColor;
|
|
60
|
+
selected?: boolean;
|
|
60
61
|
}
|
|
61
|
-
interface IImagePaint extends IPaintBase {
|
|
62
|
-
type:
|
|
62
|
+
interface IImagePaint extends IPaintBase, IFilmOptions {
|
|
63
|
+
type: IMultimediaType;
|
|
63
64
|
url: string;
|
|
64
65
|
lod?: IImageLOD;
|
|
65
66
|
mode?: IImagePaintMode;
|
|
@@ -165,7 +166,7 @@ type IOverflow = 'show' | 'hide' | 'scroll' | 'x-scroll' | 'y-scroll';
|
|
|
165
166
|
type ITextOverflow = 'show' | 'hide' | 'ellipsis' | (string & {});
|
|
166
167
|
|
|
167
168
|
type ILeafPaintColor = IColorString | CanvasGradient | CanvasPattern;
|
|
168
|
-
interface ILeafPaint {
|
|
169
|
+
interface ILeafPaint extends IFilmPlayOptions {
|
|
169
170
|
type?: IPaintType;
|
|
170
171
|
style?: ILeafPaintColor;
|
|
171
172
|
strokeStyle?: IStrokeComputedStyle;
|
|
@@ -174,20 +175,20 @@ interface ILeafPaint {
|
|
|
174
175
|
level?: number;
|
|
175
176
|
drawLevel?: number;
|
|
176
177
|
loadId?: number;
|
|
177
|
-
patternId?: string;
|
|
178
|
+
patternId?: string | number;
|
|
178
179
|
patternTask?: ITaskItem;
|
|
179
180
|
progressTimer?: any;
|
|
181
|
+
complex?: boolean | 2;
|
|
180
182
|
isTransparent?: boolean;
|
|
181
183
|
data?: ILeafPaintPatternData;
|
|
182
184
|
originPaint?: IPaint;
|
|
185
|
+
film?: boolean;
|
|
183
186
|
}
|
|
184
187
|
interface ILeafPaintPatternData {
|
|
185
188
|
scaleX?: number;
|
|
186
189
|
scaleY?: number;
|
|
187
190
|
gap?: IPointData;
|
|
188
|
-
opacity?: number;
|
|
189
191
|
transform?: IMatrixData;
|
|
190
|
-
filters?: IImageFilters;
|
|
191
192
|
mode?: IImagePaintMode;
|
|
192
193
|
repeat?: 'repeat' | 'repeat-x' | 'repeat-y';
|
|
193
194
|
interlace?: IInterlace;
|
|
@@ -740,70 +741,6 @@ interface IFlowData extends IFlowAttrData, IBoxData {
|
|
|
740
741
|
}
|
|
741
742
|
interface IFlowInputData extends IFlowAttrData, IBoxInputData {
|
|
742
743
|
}
|
|
743
|
-
interface IVideo extends IPlayerMethods, IRect {
|
|
744
|
-
__: IVideoData;
|
|
745
|
-
}
|
|
746
|
-
interface IPlayerMethods {
|
|
747
|
-
play(): void;
|
|
748
|
-
pause(): void;
|
|
749
|
-
stop(): void;
|
|
750
|
-
}
|
|
751
|
-
interface IVideoAttrData {
|
|
752
|
-
url?: string;
|
|
753
|
-
}
|
|
754
|
-
interface IVideoData extends IVideoAttrData, IRectData {
|
|
755
|
-
}
|
|
756
|
-
interface IVideoInputData extends IVideoAttrData, IRectInputData {
|
|
757
|
-
}
|
|
758
|
-
interface IGIF extends IPlayerMethods, IRect {
|
|
759
|
-
__: IGIFData;
|
|
760
|
-
}
|
|
761
|
-
interface IGIFAttrData {
|
|
762
|
-
url?: string;
|
|
763
|
-
}
|
|
764
|
-
interface IGIFData extends IGIFAttrData, IRectData {
|
|
765
|
-
}
|
|
766
|
-
interface IGIFInputData extends IGIFAttrData, IRectInputData {
|
|
767
|
-
}
|
|
768
|
-
interface IRobot extends IRobotAttrData, IPlayerMethods, IRect {
|
|
769
|
-
__: IRobotData;
|
|
770
|
-
readonly running: boolean;
|
|
771
|
-
readonly nowFrame?: IRobotComputedKeyframe;
|
|
772
|
-
readonly robotFrames?: IRobotComputedKeyframe[];
|
|
773
|
-
__updateRobot(): void;
|
|
774
|
-
__updateAction(): void;
|
|
775
|
-
}
|
|
776
|
-
interface IRobotAttrData {
|
|
777
|
-
robot?: IRobotKeyframe | IRobotKeyframe[];
|
|
778
|
-
actions?: IRobotActions;
|
|
779
|
-
action?: IRobotActionName;
|
|
780
|
-
now?: number;
|
|
781
|
-
FPS?: number;
|
|
782
|
-
loop?: boolean | number;
|
|
783
|
-
}
|
|
784
|
-
interface IRobotActions {
|
|
785
|
-
[name: string]: IKeyframeId | IKeyframeId[] | IRobotAnimation;
|
|
786
|
-
}
|
|
787
|
-
interface IRobotAnimation {
|
|
788
|
-
keyframes: IKeyframeId[];
|
|
789
|
-
loop?: boolean | number;
|
|
790
|
-
FPS?: number;
|
|
791
|
-
}
|
|
792
|
-
type IRobotActionName = string;
|
|
793
|
-
interface IRobotKeyframe {
|
|
794
|
-
mode?: 'normal' | 'clip';
|
|
795
|
-
url: string;
|
|
796
|
-
offset?: IPointData;
|
|
797
|
-
size?: number | ISizeData;
|
|
798
|
-
total?: number;
|
|
799
|
-
}
|
|
800
|
-
interface IRobotComputedKeyframe extends IBoundsData {
|
|
801
|
-
view: any;
|
|
802
|
-
}
|
|
803
|
-
interface IRobotData extends IRobotAttrData, IRectData {
|
|
804
|
-
}
|
|
805
|
-
interface IRobotInputData extends IRobotAttrData, IRectInputData {
|
|
806
|
-
}
|
|
807
744
|
interface IRect extends IUI {
|
|
808
745
|
__: IRectData;
|
|
809
746
|
}
|
|
@@ -936,8 +873,11 @@ interface IImage extends IImageAttrData, IRect {
|
|
|
936
873
|
}
|
|
937
874
|
interface IImageAttrData {
|
|
938
875
|
url?: string;
|
|
876
|
+
foreground?: IFill;
|
|
877
|
+
background?: IFill;
|
|
939
878
|
}
|
|
940
879
|
interface IImageData extends IImageAttrData, IRectData {
|
|
880
|
+
readonly __urlType: IMultimediaType;
|
|
941
881
|
__setImageFill(value: string): void;
|
|
942
882
|
}
|
|
943
883
|
interface IImageInputData extends IImageAttrData, IUIBaseInputData {
|
|
@@ -958,6 +898,71 @@ interface ICanvasData extends ICanvasAttrData, IRectData {
|
|
|
958
898
|
}
|
|
959
899
|
interface ICanvasInputData extends ICanvasAttrData, IUIBaseInputData {
|
|
960
900
|
}
|
|
901
|
+
interface IFilm extends IFilmAttrData, IPlayerMethods, IImage {
|
|
902
|
+
__: IFilmData;
|
|
903
|
+
}
|
|
904
|
+
interface IFilmAttrData {
|
|
905
|
+
url?: string;
|
|
906
|
+
}
|
|
907
|
+
interface IFilmData extends IFilmAttrData, IImageData {
|
|
908
|
+
}
|
|
909
|
+
interface IFilmInputData extends IFilmAttrData, IUIBaseInputData {
|
|
910
|
+
}
|
|
911
|
+
interface IVideo extends IVideoAttrData, IPlayerMethods, IImage {
|
|
912
|
+
__: IVideoData;
|
|
913
|
+
}
|
|
914
|
+
interface IPlayerMethods {
|
|
915
|
+
togglePlay(): void;
|
|
916
|
+
play(): void;
|
|
917
|
+
pause(): void;
|
|
918
|
+
stop(): void;
|
|
919
|
+
}
|
|
920
|
+
interface IVideoAttrData {
|
|
921
|
+
url?: string;
|
|
922
|
+
}
|
|
923
|
+
interface IVideoData extends IVideoAttrData, IImageData {
|
|
924
|
+
}
|
|
925
|
+
interface IVideoInputData extends IVideoAttrData, IImageInputData {
|
|
926
|
+
}
|
|
927
|
+
interface IRobot extends IRobotAttrData, IPlayerMethods, IRect {
|
|
928
|
+
__: IRobotData;
|
|
929
|
+
readonly running: boolean;
|
|
930
|
+
readonly nowFrame?: IRobotComputedKeyframe;
|
|
931
|
+
readonly robotFrames?: IRobotComputedKeyframe[];
|
|
932
|
+
__updateRobot(): void;
|
|
933
|
+
__updateAction(): void;
|
|
934
|
+
}
|
|
935
|
+
interface IRobotAttrData {
|
|
936
|
+
robot?: IRobotKeyframe | IRobotKeyframe[];
|
|
937
|
+
actions?: IRobotActions;
|
|
938
|
+
action?: IRobotActionName;
|
|
939
|
+
now?: number;
|
|
940
|
+
FPS?: number;
|
|
941
|
+
loop?: boolean | number;
|
|
942
|
+
}
|
|
943
|
+
interface IRobotActions {
|
|
944
|
+
[name: string]: IKeyframeId | IKeyframeId[] | IRobotAnimation;
|
|
945
|
+
}
|
|
946
|
+
interface IRobotAnimation {
|
|
947
|
+
keyframes: IKeyframeId[];
|
|
948
|
+
loop?: boolean | number;
|
|
949
|
+
FPS?: number;
|
|
950
|
+
}
|
|
951
|
+
type IRobotActionName = string;
|
|
952
|
+
interface IRobotKeyframe {
|
|
953
|
+
mode?: 'normal' | 'clip';
|
|
954
|
+
url: string;
|
|
955
|
+
offset?: IPointData;
|
|
956
|
+
size?: number | ISizeData;
|
|
957
|
+
total?: number;
|
|
958
|
+
}
|
|
959
|
+
interface IRobotComputedKeyframe extends IBoundsData {
|
|
960
|
+
view: any;
|
|
961
|
+
}
|
|
962
|
+
interface IRobotData extends IRobotAttrData, IRectData {
|
|
963
|
+
}
|
|
964
|
+
interface IRobotInputData extends IRobotAttrData, IRectInputData {
|
|
965
|
+
}
|
|
961
966
|
interface ILeaferData extends IGroupData {
|
|
962
967
|
}
|
|
963
968
|
interface ILeaferInputData extends IGroupInputData {
|
|
@@ -1112,8 +1117,8 @@ interface IUIComputedData extends IUIAttrData, IFillComputedData, IBorderCompute
|
|
|
1112
1117
|
interface IUIBaseInputData extends IUIAttrData, IFillInputData, IStrokeInputData, ITextStyleInputData, ICornerRadiusInputData, IEffectInputData, ILeafInputData {
|
|
1113
1118
|
children?: IUIInputData[];
|
|
1114
1119
|
}
|
|
1115
|
-
type IUITag = 'App' | 'Leafer' | 'Rect' | 'Ellipse' | 'Polygon' | 'Star' | 'Line' | 'Path' | 'Pen' | 'Text' | 'Image' | 'Canvas' | 'Group' | 'Frame' | 'Box' | 'Arrow' | 'Robot' | '
|
|
1116
|
-
interface IUIInputData extends IRectInputData, IEllipseInputData, IPolygonInputData, IStarInputData, ILineInputData, IPathInputData, ITextInputData, IImageInputData, IGroupInputData, IBoxInputData, IFrameInputData, IFlowInputData, IArrowInputData,
|
|
1120
|
+
type IUITag = 'App' | 'Leafer' | 'Rect' | 'Ellipse' | 'Polygon' | 'Star' | 'Line' | 'Path' | 'Pen' | 'Text' | 'Image' | 'Canvas' | 'Group' | 'Frame' | 'Box' | 'Arrow' | 'Robot' | 'Film' | 'Video' | (string & {});
|
|
1121
|
+
interface IUIInputData extends IRectInputData, IEllipseInputData, IPolygonInputData, IStarInputData, ILineInputData, IPathInputData, ITextInputData, IImageInputData, IGroupInputData, IBoxInputData, IFrameInputData, IFlowInputData, IArrowInputData, IVideoInputData, IRobotInputData, IUIBaseInputData, IObject {
|
|
1117
1122
|
children?: IUIInputData[];
|
|
1118
1123
|
}
|
|
1119
1124
|
interface IUIJSONData extends IUIInputData {
|
|
@@ -1259,6 +1264,8 @@ interface IPaintModule {
|
|
|
1259
1264
|
}
|
|
1260
1265
|
interface IPaintImageModule {
|
|
1261
1266
|
image(ui: IUI, attrName: string, paint: IImagePaint, boxBounds: IBoundsData, firstUse: boolean): ILeafPaint;
|
|
1267
|
+
film?(paint: ILeafPaint): void;
|
|
1268
|
+
video?(paint: ILeafPaint): void;
|
|
1262
1269
|
checkImage(paint: ILeafPaint, allowDraw: boolean, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): boolean;
|
|
1263
1270
|
drawImage(paint: ILeafPaint, imageScaleX: number, imageScaleY: number, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
|
|
1264
1271
|
getImageRenderScaleData(paint: ILeafPaint, ui: IUI, canvas?: ILeaferCanvas, renderOptions?: IRenderOptions): IScaleData$1;
|
|
@@ -1308,4 +1315,4 @@ interface IFilterFunction {
|
|
|
1308
1315
|
(filter: IFilter, ui: IUI, bounds: IMatrixWithBoundsScaleData, currentCanvas: ILeaferCanvas, originCanvas: ILeaferCanvas, shape: ICachedShape): void;
|
|
1309
1316
|
}
|
|
1310
1317
|
|
|
1311
|
-
export type { IAnimate, IAnimateKeyframe, IAnimateList, IAnimateType, IAnimation, IApp, IAppConfig, IAppData, IAppForEachFunction, IAppInputData, IArrow, IArrowData, IArrowInputData, IArrowStyle, IArrowType, IArrowTypeData, IBackgroundBoxStyle, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, IColorString, IComputedKeyframe, ICornerRadiusString, IDashPatternString, IEditBoxBase, IEditPoint, IEditPointInputData, IEditPointType, IEditToolFunction, IEditorBase, IEditorBeforeEditInner, IEditorBeforeEditOuter, IEditorBeforeMove, IEditorBeforeRotate, IEditorBeforeScale, IEditorBeforeSelect, IEditorBeforeSkew, IEditorConfig, IEditorConfigFunction, IEditorDragStartData, IEditorEditInnerData, IEditorEditOuterData, 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,
|
|
1318
|
+
export type { IAnimate, IAnimateKeyframe, IAnimateList, IAnimateType, IAnimation, IApp, IAppConfig, IAppData, IAppForEachFunction, IAppInputData, IArrow, IArrowData, IArrowInputData, IArrowStyle, IArrowType, IArrowTypeData, IBackgroundBoxStyle, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, IColorString, IComputedKeyframe, ICornerRadiusString, IDashPatternString, IEditBoxBase, IEditPoint, IEditPointInputData, IEditPointType, IEditToolFunction, IEditorBase, IEditorBeforeEditInner, IEditorBeforeEditOuter, IEditorBeforeMove, IEditorBeforeRotate, IEditorBeforeScale, IEditorBeforeSelect, IEditorBeforeSkew, IEditorConfig, IEditorConfigFunction, IEditorDragStartData, IEditorEditInnerData, IEditorEditOuterData, IEditorMoveData, IEditorRotationData, IEditorScaleData, IEditorSelectData, IEditorSkewData, IEffect, IEffectAttrData, IEffectComputedData, IEffectInputData, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IFill, IFilm, IFilmData, IFilmInputData, IFilterFunction, IFilterModule, IFilterProcessor, IFindUIMethod, IFlow, IFlowData, IFlowInputData, IFontWeight, IFontWeightNumer, IFontWeightString, IFrame, IFrameData, IFrameInputData, IFrameRenderModule, 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, ILinker, ILinkerData, ILinkerInputData, ILinkerPointData, 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, IScrollConfig, IScrollTheme, IScroller, IShadowEffect, IShadowString, ISolidPaint, IStar, IStarData, IStarInputData, IStateModule, IStateName, IStateStyle, IStates, IStroke, IStrokeAlign, IStrokeAttrData, IStrokeCap, IStrokeComputedData, IStrokeComputedStyle, IStrokeGradientPaint, IStrokeImagePaint, IStrokeInputData, IStrokeJoin, IStrokePaint, IStrokeSolidPaint, IStrokeStyle, IStrokeWidthString, IStyleAnimation, IText, ITextAlign, ITextCase, ITextCharData, ITextConvertModule, ITextData, ITextDecoration, ITextDecorationData, ITextDecorationType, ITextDrawData, ITextInputData, ITextOverflow, ITextRenderModule, ITextRowData, ITextStyleAttrData, ITextStyleComputedData, ITextStyleInputData, ITextWordData, ITextWrap, ITransformTool, ITransitionFunction, ITransitionMap, ITransitionModule, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIJSONData, IUIRenderModule, IUITag, IVectorPath, IVerticalAlign, IVideo, IVideoData, IVideoInputData, IWritingMode };
|