@leafer-ui/display 1.9.5 → 1.9.7
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 -3
- package/src/Polygon.ts +1 -9
- package/src/Text.ts +6 -5
- package/src/UI.ts +7 -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.9.
|
|
3
|
+
"version": "1.9.7",
|
|
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.9.
|
|
26
|
-
"@leafer-ui/data": "1.9.
|
|
27
|
-
"@leafer-ui/display-module": "1.9.
|
|
28
|
-
"@leafer-ui/decorator": "1.9.
|
|
29
|
-
"@leafer-ui/external": "1.9.
|
|
25
|
+
"@leafer/core": "1.9.7",
|
|
26
|
+
"@leafer-ui/data": "1.9.7",
|
|
27
|
+
"@leafer-ui/display-module": "1.9.7",
|
|
28
|
+
"@leafer-ui/decorator": "1.9.7",
|
|
29
|
+
"@leafer-ui/external": "1.9.7"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@leafer/interface": "1.9.
|
|
33
|
-
"@leafer-ui/interface": "1.9.
|
|
32
|
+
"@leafer/interface": "1.9.7",
|
|
33
|
+
"@leafer-ui/interface": "1.9.7"
|
|
34
34
|
}
|
|
35
35
|
}
|
package/src/Leafer.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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, IZoomOptions, IFourNumber, IBounds, IClientPointData, ITransition, ICanvasSizeAttr } from '@leafer/interface'
|
|
2
|
-
import { AutoBounds, LayoutEvent, ResizeEvent, LeaferEvent, CanvasManager, ImageManager, Resource, DataHelper, Creator, Run, Debug, RenderEvent, registerUI, boundsType, canvasSizeAttrs, dataProcessor, WaitHelper, WatchEvent, Bounds, LeafList, Plugin, getBoundsData } from '@leafer/core'
|
|
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, IZoomOptions, IFourNumber, IBounds, IClientPointData, ITransition, ICanvasSizeAttr, ILeaferMode } from '@leafer/interface'
|
|
2
|
+
import { AutoBounds, LayoutEvent, ResizeEvent, LeaferEvent, CanvasManager, ImageManager, Resource, DataHelper, Creator, Run, Debug, RenderEvent, registerUI, boundsType, canvasSizeAttrs, dataProcessor, WaitHelper, WatchEvent, Bounds, LeafList, Plugin, getBoundsData, dataType } 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'
|
|
@@ -23,6 +23,9 @@ export class Leafer extends Group implements ILeafer {
|
|
|
23
23
|
@boundsType()
|
|
24
24
|
declare public pixelRatio?: INumber
|
|
25
25
|
|
|
26
|
+
@dataType('normal')
|
|
27
|
+
public mode: ILeaferMode
|
|
28
|
+
|
|
26
29
|
public get isApp(): boolean { return false }
|
|
27
30
|
public get app(): ILeafer { return this.parent || this }
|
|
28
31
|
|
|
@@ -268,7 +271,7 @@ export class Leafer extends Group implements ILeafer {
|
|
|
268
271
|
} else if (attrName === 'zIndex') {
|
|
269
272
|
this.canvas.zIndex = newValue as any
|
|
270
273
|
setTimeout(() => this.parent && this.parent.__updateSortChildren())
|
|
271
|
-
}
|
|
274
|
+
} else if (attrName === 'mode') this.emit(LeaferEvent.UPDATE_MODE, { mode: newValue })
|
|
272
275
|
}
|
|
273
276
|
return super.__setAttr(attrName, newValue)
|
|
274
277
|
}
|
package/src/Polygon.ts
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { INumber, IPointData } from '@leafer/interface'
|
|
2
|
-
import { PathCommandDataHelper, dataProcessor, pathType, registerUI,
|
|
2
|
+
import { PathCommandDataHelper, dataProcessor, pathType, registerUI, rewriteAble } from '@leafer/core'
|
|
3
3
|
|
|
4
4
|
import { IPolygon, IPolygonData, IPolygonInputData } from '@leafer-ui/interface'
|
|
5
5
|
import { PolygonData } from '@leafer-ui/data'
|
|
6
6
|
|
|
7
7
|
import { UI } from './UI'
|
|
8
|
-
import { Line } from './Line'
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
const { sin, cos, PI } = Math
|
|
12
11
|
const { moveTo, lineTo, closePath, drawPoints } = PathCommandDataHelper
|
|
13
|
-
const line = Line.prototype
|
|
14
12
|
|
|
15
13
|
@rewriteAble()
|
|
16
14
|
@registerUI()
|
|
@@ -57,10 +55,4 @@ export class Polygon<TInputData = IPolygonInputData> extends UI<TInputData> impl
|
|
|
57
55
|
|
|
58
56
|
}
|
|
59
57
|
|
|
60
|
-
@rewrite(line.__updateRenderPath)
|
|
61
|
-
public __updateRenderPath(): void { }
|
|
62
|
-
|
|
63
|
-
@rewrite(line.__updateBoxBounds)
|
|
64
|
-
public __updateBoxBounds(): void { }
|
|
65
|
-
|
|
66
58
|
}
|
package/src/Text.ts
CHANGED
|
@@ -154,11 +154,6 @@ export class Text<TConstructorData = ITextInputData> extends UI<TConstructorData
|
|
|
154
154
|
else data.__textBoxBounds = b
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
override __onUpdateSize(): void {
|
|
158
|
-
if (this.__box) this.__box.__onUpdateSize()
|
|
159
|
-
super.__onUpdateSize()
|
|
160
|
-
}
|
|
161
|
-
|
|
162
157
|
override __updateRenderSpread(): number {
|
|
163
158
|
let width = super.__updateRenderSpread()
|
|
164
159
|
if (!width) width = this.isOverflow ? 1 : 0
|
|
@@ -171,6 +166,12 @@ export class Text<TConstructorData = ITextInputData> extends UI<TConstructorData
|
|
|
171
166
|
if (this.__box) this.__box.__layout.renderBounds = renderBounds
|
|
172
167
|
}
|
|
173
168
|
|
|
169
|
+
override __updateChange(): void {
|
|
170
|
+
super.__updateChange()
|
|
171
|
+
const box = this.__box
|
|
172
|
+
if (box) box.__onUpdateSize(), box.__updateChange()
|
|
173
|
+
}
|
|
174
|
+
|
|
174
175
|
override __drawRenderPath(canvas: ILeaferCanvas): void {
|
|
175
176
|
canvas.font = this.__.__font
|
|
176
177
|
}
|
package/src/UI.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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, ILeaferImage, IScaleFixed, IDragBoundsType } from '@leafer/interface'
|
|
2
|
-
import { Leaf, PathDrawer, surfaceType, dataType, positionType, scrollType, 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, DataHelper, affectRenderBoundsType, isString, isNumber } from '@leafer/core'
|
|
2
|
+
import { Leaf, PathDrawer, surfaceType, dimType, dataType, positionType, scrollType, 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, DataHelper, affectRenderBoundsType, isString, isNumber } from '@leafer/core'
|
|
3
3
|
|
|
4
4
|
import { IUI, IShadowEffect, IBlurEffect, IStrokeAlign, IStrokeJoin, IStrokeCap, IBlendMode, IDashPatternString, IShadowString, IGrayscaleEffect, IUIData, IGroup, IStrokeWidthString, ICornerRadiusString, IUIInputData, IExportOptions, IExportResult, IFill, IStroke, IArrowStyle, IFindUIMethod, ILeafer, IEditorConfig, IEditorConfigFunction, IEditToolFunction, IKeyframe, IAnimation, IAnimate, IStates, IStateName, IAnimateType, IStateStyle, IColorString, IAnimateList } from '@leafer-ui/interface'
|
|
5
5
|
import { effectType, zoomLayerType } from '@leafer-ui/decorator'
|
|
@@ -61,12 +61,16 @@ export class UI<TInputData = IUIInputData> extends Leaf<TInputData> implements I
|
|
|
61
61
|
public locked?: IBoolean
|
|
62
62
|
|
|
63
63
|
|
|
64
|
-
@
|
|
64
|
+
// @leafer-in/bright will rewrite
|
|
65
|
+
|
|
66
|
+
@dimType(false)
|
|
65
67
|
public dim?: IBoolean | INumber // 是否弱化内容,可设置具体透明度
|
|
66
68
|
|
|
67
|
-
@
|
|
69
|
+
@dimType(false)
|
|
68
70
|
public dimskip?: IBoolean // 跳过弱化,突出显示内容,不受dim影响
|
|
69
71
|
|
|
72
|
+
public bright?: IBoolean // 突出显示内容,并置顶渲染,不受dim影响
|
|
73
|
+
|
|
70
74
|
|
|
71
75
|
@sortType(0)
|
|
72
76
|
public zIndex?: INumber
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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, IDragBoundsType, IHitType, ICursorType, IScaleFixed, IFilter, ITransition, IUnitData, IObject, IPointData, IPathCreator, IValue, IFindCondition, ILeaferCanvas, IPathDrawer, ILeaferImage, IExportFileType, IJSONOptions, IPickOptions, IPickResult, IRenderer, IWatcher, ILayouter, ISelector, IInteraction, ICanvasManager, IHitCanvasManager, ILeaferConfig, IAutoBounds, IBounds, IEventListenerId, ITimer, IControl, ILeaferType, IScreenSizeData, IResizeEvent, ICanvasSizeAttr, IZoomType, IZoomOptions, IClientPointData, IRenderOptions, 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, IDragBoundsType, IHitType, ICursorType, IScaleFixed, IFilter, ITransition, IUnitData, IObject, IPointData, IPathCreator, IValue, IFindCondition, ILeaferCanvas, IPathDrawer, ILeaferImage, IExportFileType, IJSONOptions, IPickOptions, IPickResult, ILeaferMode, IRenderer, IWatcher, ILayouter, ISelector, IInteraction, ICanvasManager, IHitCanvasManager, ILeaferConfig, IAutoBounds, IBounds, IEventListenerId, ITimer, IControl, ILeaferType, IScreenSizeData, IResizeEvent, ICanvasSizeAttr, IZoomType, IZoomOptions, IClientPointData, IRenderOptions, ICanvasContext2DSettings, ICanvasContext2D } from '@leafer/interface';
|
|
2
2
|
import { Leaf, LeafList } from '@leafer/core';
|
|
3
3
|
import { IUIInputData, IUI, IUIData, ILeafer, IGroup, IBlendMode, IFill, IStroke, IStrokeAlign, IStrokeWidthString, IStrokeCap, IStrokeJoin, IDashPatternString, IArrowStyle, ICornerRadiusString, IShadowEffect, IShadowString, IBlurEffect, IGrayscaleEffect, IAnimation, IStates, IStateName, IStateStyle, IColorString, IEditorConfig, IAnimate, IAnimateList, IFindUIMethod, IKeyframe, IAnimateType, IExportOptions, IExportResult, IEditorConfigFunction, IEditToolFunction, IGroupInputData, IGroupData, IUIJSONData, IFindCondition as IFindCondition$1, ILeaferData, IApp, IEditorBase, IFunction, ILeaferInputData, IBoxInputData, IBox, IBoxData, IOverflow, IScrollConfig, IScroller, IFrameInputData, IFrame, IFrameData, IRectInputData, IRect, IRectData, IEllipseInputData, IEllipse, IEllipseData, IPolygonInputData, IPolygon, IPolygonData, IStarInputData, IStar, IStarData, ILineInputData, ILine, ILineData, IImageInputData, IImage, IImageData, ICanvasInputData, ICanvas, ICanvasData, ITextInputData, IText, ITextData, IBackgroundBoxStyle, IHitType as IHitType$1, IFontWeight, ITextCase, ITextDecoration, IWritingMode, ITextAlign, IVerticalAlign, ITextWrap, ITextOverflow, ITextDrawData, IPathInputData, IPath, IPathData, IPenInputData, IPen, IPenData, IPathCommandData as IPathCommandData$1, IPointData as IPointData$1 } from '@leafer-ui/interface';
|
|
4
4
|
|
|
@@ -21,6 +21,7 @@ declare class UI<TInputData = IUIInputData> extends Leaf<TInputData> implements
|
|
|
21
21
|
locked?: IBoolean;
|
|
22
22
|
dim?: IBoolean | INumber;
|
|
23
23
|
dimskip?: IBoolean;
|
|
24
|
+
bright?: IBoolean;
|
|
24
25
|
zIndex?: INumber;
|
|
25
26
|
mask?: IBoolean | IMaskType;
|
|
26
27
|
eraser?: IBoolean | IEraserType;
|
|
@@ -185,6 +186,7 @@ declare class Leafer extends Group implements ILeafer {
|
|
|
185
186
|
get __tag(): string;
|
|
186
187
|
__: ILeaferData;
|
|
187
188
|
pixelRatio?: INumber;
|
|
189
|
+
mode: ILeaferMode;
|
|
188
190
|
get isApp(): boolean;
|
|
189
191
|
get app(): ILeafer;
|
|
190
192
|
get isLeafer(): boolean;
|
|
@@ -334,8 +336,6 @@ declare class Polygon<TInputData = IPolygonInputData> extends UI<TInputData> imp
|
|
|
334
336
|
points?: number[] | IPointData[];
|
|
335
337
|
curve?: boolean | number;
|
|
336
338
|
__updatePath(): void;
|
|
337
|
-
__updateRenderPath(): void;
|
|
338
|
-
__updateBoxBounds(): void;
|
|
339
339
|
}
|
|
340
340
|
|
|
341
341
|
declare class Star<TInputData = IStarInputData> extends UI<TInputData> implements IStar {
|
|
@@ -423,9 +423,9 @@ declare class Text<TConstructorData = ITextInputData> extends UI<TConstructorDat
|
|
|
423
423
|
get textDrawData(): ITextDrawData;
|
|
424
424
|
__updateTextDrawData(): void;
|
|
425
425
|
__updateBoxBounds(): void;
|
|
426
|
-
__onUpdateSize(): void;
|
|
427
426
|
__updateRenderSpread(): number;
|
|
428
427
|
__updateRenderBounds(): void;
|
|
428
|
+
__updateChange(): void;
|
|
429
429
|
__drawRenderPath(canvas: ILeaferCanvas): void;
|
|
430
430
|
__draw(canvas: ILeaferCanvas, options: IRenderOptions, originCanvas?: ILeaferCanvas): void;
|
|
431
431
|
__drawShape(canvas: ILeaferCanvas, options: IRenderOptions): void;
|