@leafer-ui/interface 1.0.0-rc.17 → 1.0.0-rc.19
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 +24 -5
- package/src/editor/IEditor.ts +3 -0
- package/src/index.ts +1 -0
- package/src/module/IState.ts +11 -0
- package/types/index.d.ts +34 -6
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.19",
|
|
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.19"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/src/IUI.ts
CHANGED
|
@@ -278,11 +278,19 @@ export interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrDa
|
|
|
278
278
|
readonly app: ILeafer
|
|
279
279
|
leafer?: ILeafer
|
|
280
280
|
parent?: IGroup
|
|
281
|
+
zoomLayer?: IGroup
|
|
281
282
|
readonly isFrame?: boolean
|
|
282
283
|
|
|
283
284
|
proxyData: IUIInputData
|
|
284
285
|
__proxyData?: IUIInputData
|
|
285
286
|
|
|
287
|
+
normalStyle: IUIInputData
|
|
288
|
+
hoverStyle: IUIInputData
|
|
289
|
+
pressStyle: IUIInputData
|
|
290
|
+
focusStyle: IUIInputData
|
|
291
|
+
selectedStyle: IUIInputData
|
|
292
|
+
disabledStyle: IUIInputData
|
|
293
|
+
|
|
286
294
|
children?: IUI[]
|
|
287
295
|
|
|
288
296
|
reset(data?: IUIInputData): void
|
|
@@ -290,7 +298,7 @@ export interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrDa
|
|
|
290
298
|
set(data: IUIInputData): void
|
|
291
299
|
toJSON(): IUIInputData
|
|
292
300
|
|
|
293
|
-
get(name?: string): IUIInputData | IValue
|
|
301
|
+
get(name?: string | string[] | IUIInputData): IUIInputData | IValue
|
|
294
302
|
createProxyData(): IUIInputData
|
|
295
303
|
|
|
296
304
|
find(condition: number | string | IFindUIMethod, options?: any): IUI[]
|
|
@@ -314,7 +322,13 @@ export interface IFindUIMethod {
|
|
|
314
322
|
export interface IUIData extends IUIComputedData, ILeafData {
|
|
315
323
|
|
|
316
324
|
padding?: number | number[]
|
|
317
|
-
|
|
325
|
+
|
|
326
|
+
normalStyle?: IUIInputData
|
|
327
|
+
hoverStyle?: IUIInputData
|
|
328
|
+
pressStyle?: IUIInputData
|
|
329
|
+
focusStyle?: IUIInputData
|
|
330
|
+
selectedStyle?: IUIInputData
|
|
331
|
+
disabledStyle?: IUIInputData
|
|
318
332
|
|
|
319
333
|
// 非数据属性, 自动计算的缓存数据
|
|
320
334
|
__isFills?: boolean
|
|
@@ -349,13 +363,18 @@ export interface IUIData extends IUIComputedData, ILeafData {
|
|
|
349
363
|
}
|
|
350
364
|
export interface IUIComputedData extends IFillComputedData, IBorderComputedData, IStrokeComputedData, ITextStyleComputedData, ICornerRadiusComputedData, IEffectComputedData, ILeafComputedData {
|
|
351
365
|
padding?: number | number[]
|
|
352
|
-
|
|
353
|
-
locked?: boolean
|
|
354
366
|
}
|
|
355
367
|
|
|
356
368
|
export interface IUIBaseInputData extends IFillInputData, IStrokeInputData, ITextStyleInputData, ICornerRadiusInputData, IEffectInputData, ILeafInputData {
|
|
357
369
|
padding?: number | number[]
|
|
358
|
-
|
|
370
|
+
|
|
371
|
+
normalStyle?: IUIInputData
|
|
372
|
+
hoverStyle?: IUIInputData
|
|
373
|
+
pressStyle?: IUIInputData
|
|
374
|
+
focusStyle?: IUIInputData
|
|
375
|
+
selectedStyle?: IUIInputData
|
|
376
|
+
disabledStyle?: IUIInputData
|
|
377
|
+
|
|
359
378
|
children?: IUIInputData[]
|
|
360
379
|
}
|
|
361
380
|
|
package/src/editor/IEditor.ts
CHANGED
|
@@ -48,6 +48,8 @@ export interface IEditorBase extends IGroup, ISelectorProxy {
|
|
|
48
48
|
|
|
49
49
|
export interface IEditorConfig {
|
|
50
50
|
editSize?: 'auto' | IEditSize
|
|
51
|
+
dualEvent?: boolean
|
|
52
|
+
keyEvent?: boolean
|
|
51
53
|
|
|
52
54
|
stroke?: IStroke
|
|
53
55
|
strokeWidth?: number
|
|
@@ -82,6 +84,7 @@ export interface IEditorConfig {
|
|
|
82
84
|
hover?: boolean
|
|
83
85
|
boxSelect?: boolean
|
|
84
86
|
|
|
87
|
+
moveable?: boolean
|
|
85
88
|
rotateable?: boolean
|
|
86
89
|
resizeable?: boolean
|
|
87
90
|
skewable?: boolean
|
package/src/index.ts
CHANGED
|
@@ -35,6 +35,7 @@ export { IPathArrowModule } from './module/IPathArrow'
|
|
|
35
35
|
export { ITextConvertModule } from './module/ITextConvert'
|
|
36
36
|
export { IColorConvertModule } from './module/IColorConvert'
|
|
37
37
|
export { IExportModule } from './module/IExport'
|
|
38
|
+
export { IStateModule } from './module/IState'
|
|
38
39
|
|
|
39
40
|
export { IPaintModule, IPaintImageModule, IPaintGradientModule } from './module/IPaint'
|
|
40
41
|
export { IEffectModule } from './module/IEffect'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ILeaf, IStateStyleType } from '@leafer/interface'
|
|
2
|
+
|
|
3
|
+
export interface IStateModule {
|
|
4
|
+
isHover(leaf: ILeaf): boolean
|
|
5
|
+
isPress(leaf: ILeaf): boolean
|
|
6
|
+
isFocus(leaf: ILeaf): boolean
|
|
7
|
+
isDrag(leaf: ILeaf): boolean
|
|
8
|
+
|
|
9
|
+
setStyle(leaf: ILeaf, stateType: IStateStyleType, value: boolean): void
|
|
10
|
+
updateEventStyle(leaf: ILeaf, eventType: string): void
|
|
11
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IPointData, IExportFileType, ISizeData, IPathCommandData, IWindingRule, IBlendMode, IMatrixData, ILeaferImage, ITaskItem, INumber, IBoolean, IString, IPathCreator, IBoundsData, ILeaferImageConfig, ILeaferCanvas, IRenderOptions, IPickOptions, IPickResult, ILeaf, IValue, IPathString, IPathDrawer, IExportOptions, IExportResult, IAnswer, ILeafData, ILeafComputedData, ILeafInputData, IObject, ILeaferAttrData, IControl, ILeaferConfig, ILeaferType, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IBooleanMap } from '@leafer/interface';
|
|
1
|
+
import { IPointData, IExportFileType, ISizeData, IPathCommandData, IWindingRule, IBlendMode, IMatrixData, ILeaferImage, ITaskItem, INumber, IBoolean, IString, IPathCreator, IBoundsData, ILeaferImageConfig, ILeaferCanvas, IRenderOptions, IPickOptions, IPickResult, ILeaf, IValue, IPathString, IPathDrawer, IExportOptions, IExportResult, IAnswer, ILeafData, ILeafComputedData, ILeafInputData, IObject, ILeaferAttrData, IControl, ILeaferConfig, ILeaferType, ILeafRender, ILeafBounds, ILeafHit, IStateStyleType, ICachedLeaf, IBooleanMap } from '@leafer/interface';
|
|
2
2
|
export * from '@leafer/interface';
|
|
3
3
|
import { IGroup as IGroup$1, ISelectorProxy, IUI as IUI$1, IObject as IObject$1, ILeaf as ILeaf$1, IEditSize, IDragEvent, IRotateEvent, IGroupInputData as IGroupInputData$1, IStroke as IStroke$1, IFill as IFill$1, IBoxInputData as IBoxInputData$1, IRectInputData as IRectInputData$1, ICursorType, IImageCursor, IAround } from '@leafer-ui/interface';
|
|
4
4
|
|
|
@@ -527,14 +527,21 @@ interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrData, IEf
|
|
|
527
527
|
readonly app: ILeafer;
|
|
528
528
|
leafer?: ILeafer;
|
|
529
529
|
parent?: IGroup;
|
|
530
|
+
zoomLayer?: IGroup;
|
|
530
531
|
readonly isFrame?: boolean;
|
|
531
532
|
proxyData: IUIInputData;
|
|
532
533
|
__proxyData?: IUIInputData;
|
|
534
|
+
normalStyle: IUIInputData;
|
|
535
|
+
hoverStyle: IUIInputData;
|
|
536
|
+
pressStyle: IUIInputData;
|
|
537
|
+
focusStyle: IUIInputData;
|
|
538
|
+
selectedStyle: IUIInputData;
|
|
539
|
+
disabledStyle: IUIInputData;
|
|
533
540
|
children?: IUI[];
|
|
534
541
|
reset(data?: IUIInputData): void;
|
|
535
542
|
set(data: IUIInputData): void;
|
|
536
543
|
toJSON(): IUIInputData;
|
|
537
|
-
get(name?: string): IUIInputData | IValue;
|
|
544
|
+
get(name?: string | string[] | IUIInputData): IUIInputData | IValue;
|
|
538
545
|
createProxyData(): IUIInputData;
|
|
539
546
|
find(condition: number | string | IFindUIMethod, options?: any): IUI[];
|
|
540
547
|
findOne(condition: number | string | IFindUIMethod, options?: any): IUI;
|
|
@@ -551,7 +558,12 @@ interface IFindUIMethod {
|
|
|
551
558
|
}
|
|
552
559
|
interface IUIData extends IUIComputedData, ILeafData {
|
|
553
560
|
padding?: number | number[];
|
|
554
|
-
|
|
561
|
+
normalStyle?: IUIInputData;
|
|
562
|
+
hoverStyle?: IUIInputData;
|
|
563
|
+
pressStyle?: IUIInputData;
|
|
564
|
+
focusStyle?: IUIInputData;
|
|
565
|
+
selectedStyle?: IUIInputData;
|
|
566
|
+
disabledStyle?: IUIInputData;
|
|
555
567
|
__isFills?: boolean;
|
|
556
568
|
__isStrokes?: boolean;
|
|
557
569
|
readonly __strokeWidth: number;
|
|
@@ -574,11 +586,15 @@ interface IUIData extends IUIComputedData, ILeafData {
|
|
|
574
586
|
}
|
|
575
587
|
interface IUIComputedData extends IFillComputedData, IBorderComputedData, IStrokeComputedData, ITextStyleComputedData, ICornerRadiusComputedData, IEffectComputedData, ILeafComputedData {
|
|
576
588
|
padding?: number | number[];
|
|
577
|
-
locked?: boolean;
|
|
578
589
|
}
|
|
579
590
|
interface IUIBaseInputData extends IFillInputData, IStrokeInputData, ITextStyleInputData, ICornerRadiusInputData, IEffectInputData, ILeafInputData {
|
|
580
591
|
padding?: number | number[];
|
|
581
|
-
|
|
592
|
+
normalStyle?: IUIInputData;
|
|
593
|
+
hoverStyle?: IUIInputData;
|
|
594
|
+
pressStyle?: IUIInputData;
|
|
595
|
+
focusStyle?: IUIInputData;
|
|
596
|
+
selectedStyle?: IUIInputData;
|
|
597
|
+
disabledStyle?: IUIInputData;
|
|
582
598
|
children?: IUIInputData[];
|
|
583
599
|
}
|
|
584
600
|
type IUITag = 'App' | 'Leafer' | 'Rect' | 'Ellipse' | 'Polygon' | 'Star' | 'Line' | 'Path' | 'Pen' | 'Text' | 'Image' | 'Canvas' | 'Group' | 'Frame' | 'Box';
|
|
@@ -620,6 +636,8 @@ interface IEditorBase extends IGroup$1, ISelectorProxy {
|
|
|
620
636
|
}
|
|
621
637
|
interface IEditorConfig {
|
|
622
638
|
editSize?: 'auto' | IEditSize;
|
|
639
|
+
dualEvent?: boolean;
|
|
640
|
+
keyEvent?: boolean;
|
|
623
641
|
stroke?: IStroke$1;
|
|
624
642
|
strokeWidth?: number;
|
|
625
643
|
pointFill?: IFill$1;
|
|
@@ -644,6 +662,7 @@ interface IEditorConfig {
|
|
|
644
662
|
selector?: boolean;
|
|
645
663
|
hover?: boolean;
|
|
646
664
|
boxSelect?: boolean;
|
|
665
|
+
moveable?: boolean;
|
|
647
666
|
rotateable?: boolean;
|
|
648
667
|
resizeable?: boolean;
|
|
649
668
|
skewable?: boolean;
|
|
@@ -718,6 +737,15 @@ interface IExportModule {
|
|
|
718
737
|
export(leaf: ILeaf, filename: IExportFileType | string, options?: IExportOptions | number | boolean): Promise<IExportResult>;
|
|
719
738
|
}
|
|
720
739
|
|
|
740
|
+
interface IStateModule {
|
|
741
|
+
isHover(leaf: ILeaf): boolean;
|
|
742
|
+
isPress(leaf: ILeaf): boolean;
|
|
743
|
+
isFocus(leaf: ILeaf): boolean;
|
|
744
|
+
isDrag(leaf: ILeaf): boolean;
|
|
745
|
+
setStyle(leaf: ILeaf, stateType: IStateStyleType, value: boolean): void;
|
|
746
|
+
updateEventStyle(leaf: ILeaf, eventType: string): void;
|
|
747
|
+
}
|
|
748
|
+
|
|
721
749
|
interface ICachedShape extends ICachedLeaf {
|
|
722
750
|
worldCanvas?: ILeaferCanvas;
|
|
723
751
|
shapeBounds: IBoundsData;
|
|
@@ -759,4 +787,4 @@ interface IEffectModule {
|
|
|
759
787
|
backgroundBlur(ui: IUI, current: ILeaferCanvas, shape: ICachedShape): void;
|
|
760
788
|
}
|
|
761
789
|
|
|
762
|
-
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, 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, IPaintAttr, IPaintGradientModule, IPaintImageModule, IPaintModule, IPaintString, IPath, IPathArrowModule, IPathData, IPathDataArrow, IPathDataArrowMap, 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 };
|
|
790
|
+
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, 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, IPaintAttr, IPaintGradientModule, IPaintImageModule, IPaintModule, IPaintString, IPath, IPathArrowModule, IPathData, IPathDataArrow, IPathDataArrowMap, IPathInputData, IPen, IPenData, IPenInputData, IPercent, IPolygon, IPolygonData, IPolygonInputData, IRGB, IRGBA, IRect, IRectData, IRectInputData, IRectRenderModule, IRepeat, IShadowEffect, IShadowString, IStar, IStarData, IStarInputData, IStateModule, 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 };
|