@leafer-ui/display 1.1.2 → 1.2.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/display",
3
- "version": "1.1.2",
3
+ "version": "1.2.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.1.2",
26
- "@leafer-ui/data": "1.1.2",
27
- "@leafer-ui/display-module": "1.1.2",
28
- "@leafer-ui/decorator": "1.1.2",
29
- "@leafer-ui/external": "1.1.2"
25
+ "@leafer/core": "1.2.1",
26
+ "@leafer-ui/data": "1.2.1",
27
+ "@leafer-ui/display-module": "1.2.1",
28
+ "@leafer-ui/decorator": "1.2.1",
29
+ "@leafer-ui/external": "1.2.1"
30
30
  },
31
31
  "devDependencies": {
32
- "@leafer/interface": "1.1.2",
33
- "@leafer-ui/interface": "1.1.2"
32
+ "@leafer/interface": "1.2.1",
33
+ "@leafer-ui/interface": "1.2.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 } from '@leafer/interface'
2
- import { AutoBounds, LayoutEvent, ResizeEvent, LeaferEvent, CanvasManager, ImageManager, DataHelper, Creator, Run, Debug, RenderEvent, registerUI, boundsType, canvasSizeAttrs, dataProcessor, WaitHelper, WatchEvent, Bounds, LeafList, needPlugin } from '@leafer/core'
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'
3
3
 
4
4
  import { ILeaferInputData, ILeaferData, IFunction, IUIInputData, ITransition, ILeafer, IApp, IEditorBase } from '@leafer-ui/interface'
5
5
  import { LeaferData } from '@leafer-ui/data'
@@ -195,9 +195,12 @@ export class Leafer extends Group implements ILeafer {
195
195
  Object.keys(data).forEach(key => (this as any)[key] = data[key])
196
196
  }
197
197
 
198
- override forceRender(bounds?: IBoundsData): void {
199
- this.renderer.addBlock(bounds ? new Bounds(bounds) : this.canvas.bounds)
200
- if (this.viewReady) this.renderer.render()
198
+ override forceRender(bounds?: IBoundsData, sync?: boolean): void {
199
+ const { renderer } = this
200
+ if (renderer) {
201
+ renderer.addBlock(bounds ? new Bounds(bounds) : this.canvas.bounds)
202
+ if (this.viewReady) sync ? renderer.render() : renderer.update()
203
+ }
201
204
  }
202
205
 
203
206
  public requestRender(change = false): void {
@@ -370,7 +373,7 @@ export class Leafer extends Group implements ILeafer {
370
373
 
371
374
  // need view plugin
372
375
  public zoom(_zoomType: IZoomType, _padding?: IFourNumber, _fixedScale?: boolean): IBoundsData {
373
- return needPlugin('view')
376
+ return Plugin.need('view')
374
377
  }
375
378
 
376
379
 
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 } from '@leafer/interface'
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, needPlugin } from '@leafer/core'
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
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, ITransition, IAnimateType, IEffect } from '@leafer-ui/interface'
5
5
  import { effectType, zoomLayerType } from '@leafer-ui/decorator'
@@ -466,7 +466,7 @@ export class UI extends Leaf implements IUI { // tip: rewrited Box
466
466
  // @leafer-in/animate rewrite
467
467
 
468
468
  public animate(_keyframe?: IUIInputData | IKeyframe[] | IAnimation, _options?: ITransition, _type?: IAnimateType, _isTemp?: boolean): IAnimate {
469
- return needPlugin('animate')
469
+ return Plugin.need('animate')
470
470
  }
471
471
 
472
472
  public killAnimate(_type?: IAnimateType): void { }
package/types/index.d.ts CHANGED
@@ -219,7 +219,7 @@ declare class Leafer extends Group implements ILeafer {
219
219
  unlockLayout(): void;
220
220
  lockLayout(): void;
221
221
  resize(size: IScreenSizeData): void;
222
- forceRender(bounds?: IBoundsData): void;
222
+ forceRender(bounds?: IBoundsData, sync?: boolean): void;
223
223
  requestRender(change?: boolean): void;
224
224
  updateCursor(cursor?: ICursorType): void;
225
225
  updateLazyBounds(): void;