@leafer-ui/display 1.4.0 → 1.4.1
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 +8 -8
- package/src/Leafer.ts +6 -6
- package/src/UI.ts +4 -3
- package/types/index.d.ts +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/display",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "@leafer-ui/display",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/core": "1.4.
|
|
26
|
-
"@leafer-ui/data": "1.4.
|
|
27
|
-
"@leafer-ui/display-module": "1.4.
|
|
28
|
-
"@leafer-ui/decorator": "1.4.
|
|
29
|
-
"@leafer-ui/external": "1.4.
|
|
25
|
+
"@leafer/core": "1.4.1",
|
|
26
|
+
"@leafer-ui/data": "1.4.1",
|
|
27
|
+
"@leafer-ui/display-module": "1.4.1",
|
|
28
|
+
"@leafer-ui/decorator": "1.4.1",
|
|
29
|
+
"@leafer-ui/external": "1.4.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@leafer/interface": "1.4.
|
|
33
|
-
"@leafer-ui/interface": "1.4.
|
|
32
|
+
"@leafer/interface": "1.4.1",
|
|
33
|
+
"@leafer-ui/interface": "1.4.1"
|
|
34
34
|
}
|
|
35
35
|
}
|
package/src/Leafer.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ILeaferCanvas, IRenderer, ILayouter, ISelector, IWatcher, IInteraction, ILeaferConfig, ICanvasManager, IHitCanvasManager, IAutoBounds, IScreenSizeData, IResizeEvent, IEventListenerId, ITimer, IValue, IObject, IControl, IPointData, ILeaferType, ICursorType, IBoundsData, INumber, IZoomType, IFourNumber, IBounds, IClientPointData, ITransition } from '@leafer/interface'
|
|
2
|
-
import { AutoBounds, LayoutEvent, ResizeEvent, LeaferEvent, CanvasManager, ImageManager, DataHelper, Creator, Run, Debug, RenderEvent, registerUI, boundsType, canvasSizeAttrs, dataProcessor, WaitHelper, WatchEvent, Bounds, LeafList, Plugin } from '@leafer/core'
|
|
2
|
+
import { AutoBounds, LayoutEvent, ResizeEvent, LeaferEvent, CanvasManager, ImageManager, Resource, DataHelper, Creator, Run, Debug, RenderEvent, registerUI, boundsType, canvasSizeAttrs, dataProcessor, WaitHelper, WatchEvent, Bounds, LeafList, Plugin } from '@leafer/core'
|
|
3
3
|
|
|
4
4
|
import { ILeaferInputData, ILeaferData, IFunction, IUIInputData, ILeafer, IApp, IEditorBase } from '@leafer-ui/interface'
|
|
5
5
|
import { LeaferData } from '@leafer-ui/data'
|
|
@@ -36,7 +36,7 @@ export class Leafer extends Group implements ILeafer {
|
|
|
36
36
|
public ready: boolean
|
|
37
37
|
public viewReady: boolean
|
|
38
38
|
public viewCompleted: boolean
|
|
39
|
-
public get imageReady(): boolean { return this.viewReady &&
|
|
39
|
+
public get imageReady(): boolean { return this.viewReady && Resource.isComplete }
|
|
40
40
|
public get layoutLocked() { return !this.layouter.running }
|
|
41
41
|
|
|
42
42
|
public transforming: boolean
|
|
@@ -308,12 +308,12 @@ export class Leafer extends Group implements ILeafer {
|
|
|
308
308
|
}
|
|
309
309
|
|
|
310
310
|
protected __onLayoutEnd(): void {
|
|
311
|
-
const { grow,
|
|
311
|
+
const { grow, width: fixedWidth, height: fixedHeight } = this.config
|
|
312
312
|
if (grow) {
|
|
313
313
|
let { width, height, pixelRatio } = this
|
|
314
314
|
const bounds = grow === 'box' ? this.worldBoxBounds : this.__world
|
|
315
|
-
if (
|
|
316
|
-
if (
|
|
315
|
+
if (!fixedWidth) width = Math.max(1, bounds.x + bounds.width)
|
|
316
|
+
if (!fixedHeight) height = Math.max(1, bounds.y + bounds.height)
|
|
317
317
|
this.__doResize({ width, height, pixelRatio })
|
|
318
318
|
}
|
|
319
319
|
|
|
@@ -384,7 +384,7 @@ export class Leafer extends Group implements ILeafer {
|
|
|
384
384
|
}
|
|
385
385
|
|
|
386
386
|
// need view plugin
|
|
387
|
-
public zoom(_zoomType: IZoomType, _padding?: IFourNumber, _fixedScale?: boolean): IBoundsData {
|
|
387
|
+
public zoom(_zoomType: IZoomType, _padding?: IFourNumber, _fixedScale?: boolean, _transition?: ITransition): IBoundsData {
|
|
388
388
|
return Plugin.need('view')
|
|
389
389
|
}
|
|
390
390
|
|
package/src/UI.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ILeaferCanvas, IPathDrawer, IPathCommandData, IHitType, INumber, IBoolean, IString, IPathString, IExportFileType, IPointData, ICursorType, IMaskType, IEraserType, IValue, IWindingRule, IPathCreator, IFourNumber, IBoundsData, IFlowType, IGap, IFlowWrap, IAxis, IConstraint, IAutoBoxData, IFlowBoxType, IPointGap, IFlowAlign, IFlowAxisAlign, IFindCondition, IAutoSize, IRangeSize, IAlign, IUnitPointData, IObject, IScaleData, IUnitData, IPathCommandObject, ITransition } from '@leafer/interface'
|
|
1
|
+
import { ILeaferCanvas, IPathDrawer, IPathCommandData, IHitType, INumber, IBoolean, IString, IPathString, IExportFileType, IPointData, ICursorType, IMaskType, IEraserType, IValue, IWindingRule, IPathCreator, IFourNumber, IBoundsData, IFlowType, IGap, IFlowWrap, IAxis, IConstraint, IAutoBoxData, IFlowBoxType, IPointGap, IFlowAlign, IFlowAxisAlign, IFindCondition, IAutoSize, IRangeSize, IAlign, IUnitPointData, IObject, IScaleData, IUnitData, IPathCommandObject, ITransition, IFilter } from '@leafer/interface'
|
|
2
2
|
import { Leaf, PathDrawer, surfaceType, dataType, positionType, boundsType, pathType, scaleType, rotationType, opacityType, visibleType, sortType, maskType, dataProcessor, registerUI, useModule, rewrite, rewriteAble, UICreator, PathCorner, hitType, strokeType, PathConvert, eraserType, cursorType, autoLayoutType, pen, naturalBoundsType, pathInputType, MathHelper, Plugin } from '@leafer/core'
|
|
3
3
|
|
|
4
|
-
import { IUI, IShadowEffect, IBlurEffect, IStrokeAlign, IStrokeJoin, IStrokeCap, IBlendMode, IDashPatternString, IShadowString, IGrayscaleEffect, IUIData, IGroup, IStrokeWidthString, ICornerRadiusString, IUIInputData, IExportOptions, IExportResult, IFill, IStroke, IArrowType, IFindUIMethod, ILeafer, IEditorConfig, IEditorConfigFunction, IEditToolFunction, IKeyframe, IAnimation, IAnimate, IStates, IStateName, IAnimateType,
|
|
4
|
+
import { IUI, IShadowEffect, IBlurEffect, IStrokeAlign, IStrokeJoin, IStrokeCap, IBlendMode, IDashPatternString, IShadowString, IGrayscaleEffect, IUIData, IGroup, IStrokeWidthString, ICornerRadiusString, IUIInputData, IExportOptions, IExportResult, IFill, IStroke, IArrowType, IFindUIMethod, ILeafer, IEditorConfig, IEditorConfigFunction, IEditToolFunction, IKeyframe, IAnimation, IAnimate, IStates, IStateName, IAnimateType, IStateStyle } from '@leafer-ui/interface'
|
|
5
5
|
import { effectType, zoomLayerType } from '@leafer-ui/decorator'
|
|
6
6
|
|
|
7
7
|
import { UIData } from '@leafer-ui/data'
|
|
@@ -287,7 +287,8 @@ export class UI extends Leaf implements IUI { // tip: rewrited Box
|
|
|
287
287
|
@effectType()
|
|
288
288
|
public grayscale?: INumber | IGrayscaleEffect
|
|
289
289
|
|
|
290
|
-
|
|
290
|
+
@effectType()
|
|
291
|
+
public filter?: IFilter | IFilter[]
|
|
291
292
|
|
|
292
293
|
|
|
293
294
|
// @leafer-in/animate rewrite
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IString, INumber, IBoolean, IMaskType, IEraserType, IAlign, IUnitPointData, IPathCommandData, IPathCommandObject, IPathString, IWindingRule, IFlowType, IFourNumber, IGap, IPointGap, IFlowAlign, IFlowAxisAlign, IFlowWrap, IFlowBoxType, IAutoSize, IAutoBoxData, IConstraint, IRangeSize, IAxis, IBoundsData, IHitType, ICursorType, ITransition, IUnitData, IObject, IPointData, IPathCreator, IValue, IFindCondition, ILeaferCanvas, IPathDrawer, IExportFileType, IJSONOptions, IPickOptions, IPickResult, IRenderer, IWatcher, ILayouter, ISelector, IInteraction, ICanvasManager, IHitCanvasManager, ILeaferConfig, IAutoBounds, IBounds, IEventListenerId, ITimer, IControl, ILeaferType, IScreenSizeData, IResizeEvent, IZoomType, IClientPointData, IRenderOptions, ILeaferImage, ICanvasContext2DSettings, ICanvasContext2D } from '@leafer/interface';
|
|
1
|
+
import { IString, INumber, IBoolean, IMaskType, IEraserType, IAlign, IUnitPointData, IPathCommandData, IPathCommandObject, IPathString, IWindingRule, IFlowType, IFourNumber, IGap, IPointGap, IFlowAlign, IFlowAxisAlign, IFlowWrap, IFlowBoxType, IAutoSize, IAutoBoxData, IConstraint, IRangeSize, IAxis, IBoundsData, IHitType, ICursorType, IFilter, ITransition, IUnitData, IObject, IPointData, IPathCreator, IValue, IFindCondition, ILeaferCanvas, IPathDrawer, IExportFileType, IJSONOptions, IPickOptions, IPickResult, IRenderer, IWatcher, ILayouter, ISelector, IInteraction, ICanvasManager, IHitCanvasManager, ILeaferConfig, IAutoBounds, IBounds, IEventListenerId, ITimer, IControl, ILeaferType, IScreenSizeData, IResizeEvent, IZoomType, IClientPointData, IRenderOptions, ILeaferImage, ICanvasContext2DSettings, ICanvasContext2D } from '@leafer/interface';
|
|
2
2
|
import { Leaf, LeafList } from '@leafer/core';
|
|
3
|
-
import { IUI, IUIData, IUIInputData, ILeafer, IGroup, IBlendMode, IFill, IStroke, IStrokeAlign, IStrokeWidthString, IStrokeCap, IStrokeJoin, IDashPatternString, IArrowType, ICornerRadiusString, IShadowEffect, IShadowString, IBlurEffect, IGrayscaleEffect,
|
|
3
|
+
import { IUI, IUIData, IUIInputData, ILeafer, IGroup, IBlendMode, IFill, IStroke, IStrokeAlign, IStrokeWidthString, IStrokeCap, IStrokeJoin, IDashPatternString, IArrowType, ICornerRadiusString, IShadowEffect, IShadowString, IBlurEffect, IGrayscaleEffect, IAnimation, IStates, IStateName, IStateStyle, IAnimate, IEditorConfig, IFindUIMethod, IKeyframe, IAnimateType, IExportOptions, IExportResult, IEditorConfigFunction, IEditToolFunction, IGroupData, IGroupInputData, IUIJSONData, IFindCondition as IFindCondition$1, ILeaferData, IApp, IEditorBase, IFunction, ILeaferInputData, IBox, IBoxData, IOverflow, IBoxInputData, IFrame, IFrameData, IFrameInputData, IRect, IRectData, IRectInputData, IEllipse, IEllipseData, IEllipseInputData, IPolygon, IPolygonData, IPolygonInputData, IStar, IStarData, IStarInputData, ILine, ILineData, ILineInputData, IImage, IImageData, IImageInputData, ICanvas, ICanvasData, ICanvasInputData, IText, ITextData, IHitType as IHitType$1, IFontWeight, ITextCase, ITextDecoration, IWritingMode, ITextAlign, IVerticalAlign, ITextWrap, ITextDrawData, ITextInputData, IPath, IPathData, IPathInputData, IPen, IPenData, IPathCommandData as IPathCommandData$1, IPenInputData } from '@leafer-ui/interface';
|
|
4
4
|
|
|
5
5
|
declare class UI extends Leaf implements IUI {
|
|
6
6
|
__: IUIData;
|
|
@@ -85,7 +85,7 @@ declare class UI extends Leaf implements IUI {
|
|
|
85
85
|
blur?: INumber | IBlurEffect;
|
|
86
86
|
backgroundBlur?: INumber | IBlurEffect;
|
|
87
87
|
grayscale?: INumber | IGrayscaleEffect;
|
|
88
|
-
filter?:
|
|
88
|
+
filter?: IFilter | IFilter[];
|
|
89
89
|
animation?: IAnimation | IAnimation[];
|
|
90
90
|
animationOut?: IAnimation | IAnimation[];
|
|
91
91
|
transition?: ITransition;
|
|
@@ -246,7 +246,7 @@ declare class Leafer extends Group implements ILeafer {
|
|
|
246
246
|
waitViewReady(item: IFunction, bind?: IObject): void;
|
|
247
247
|
waitViewCompleted(item: IFunction, bind?: IObject): void;
|
|
248
248
|
nextRender(item: IFunction, bind?: IObject, off?: 'off'): void;
|
|
249
|
-
zoom(_zoomType: IZoomType, _padding?: IFourNumber, _fixedScale?: boolean): IBoundsData;
|
|
249
|
+
zoom(_zoomType: IZoomType, _padding?: IFourNumber, _fixedScale?: boolean, _transition?: ITransition): IBoundsData;
|
|
250
250
|
getValidMove(moveX: number, moveY: number): IPointData;
|
|
251
251
|
getValidScale(changeScale: number): number;
|
|
252
252
|
getWorldPointByClient(clientPoint: IClientPointData, updateClient?: boolean): IPointData;
|