@leafer-ui/display 1.0.0 → 1.0.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.0.0",
3
+ "version": "1.0.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.0.0",
26
- "@leafer-ui/data": "1.0.0",
27
- "@leafer-ui/display-module": "1.0.0",
28
- "@leafer-ui/decorator": "1.0.0",
29
- "@leafer-ui/external": "1.0.0"
25
+ "@leafer/core": "1.0.1",
26
+ "@leafer-ui/data": "1.0.1",
27
+ "@leafer-ui/display-module": "1.0.1",
28
+ "@leafer-ui/decorator": "1.0.1",
29
+ "@leafer-ui/external": "1.0.1"
30
30
  },
31
31
  "devDependencies": {
32
- "@leafer/interface": "1.0.0",
33
- "@leafer-ui/interface": "1.0.0"
32
+ "@leafer/interface": "1.0.1",
33
+ "@leafer-ui/interface": "1.0.1"
34
34
  }
35
35
  }
package/src/Canvas.ts CHANGED
@@ -86,8 +86,7 @@ export class Canvas extends Rect implements ICanvas {
86
86
  public destroy(): void {
87
87
  if (this.canvas) {
88
88
  this.canvas.destroy()
89
- this.canvas = null
90
- this.context = null
89
+ this.canvas = this.context = null
91
90
  }
92
91
  super.destroy()
93
92
  }
package/src/Leafer.ts CHANGED
@@ -120,7 +120,7 @@ export class Leafer extends Group implements ILeafer {
120
120
  )
121
121
 
122
122
  if (this.isApp) this.__setApp()
123
- this.__checkAutoLayout(config)
123
+ this.__checkAutoLayout(config, parentApp)
124
124
  this.view = canvas.view
125
125
 
126
126
  // interaction / manager
@@ -241,9 +241,9 @@ export class Leafer extends Group implements ILeafer {
241
241
  this.__level = 1
242
242
  }
243
243
 
244
- protected __checkAutoLayout(config: ILeaferConfig): void {
245
- if (!config.width || !config.height) {
246
- this.autoLayout = new AutoBounds(config)
244
+ protected __checkAutoLayout(config: ILeaferConfig, parentApp?: IApp): void {
245
+ if (!parentApp) {
246
+ if (!config.width || !config.height) this.autoLayout = new AutoBounds(config)
247
247
  this.canvas.startAutoLayout(this.autoLayout, this.__onResize.bind(this))
248
248
  }
249
249
  }
@@ -371,7 +371,9 @@ export class Leafer extends Group implements ILeafer {
371
371
  }
372
372
 
373
373
  // need view plugin
374
- public zoom(_zoomType: IZoomType, _padding?: IFourNumber, _fixedScale?: boolean): IBoundsData { return undefined }
374
+ public zoom(_zoomType: IZoomType, _padding?: IFourNumber, _fixedScale?: boolean): IBoundsData {
375
+ return debug.error('need @leafer-in/view') as undefined
376
+ }
375
377
 
376
378
  // interaction window rewrite
377
379
  public getValidMove(moveX: number, moveY: number): IPointData { return { x: moveX, y: moveY } }
package/types/index.d.ts CHANGED
@@ -211,7 +211,7 @@ declare class Leafer extends Group implements ILeafer {
211
211
  protected __setApp(): void;
212
212
  protected __bindApp(app: IApp): void;
213
213
  __setLeafer(leafer: ILeafer): void;
214
- protected __checkAutoLayout(config: ILeaferConfig): void;
214
+ protected __checkAutoLayout(config: ILeaferConfig, parentApp?: IApp): void;
215
215
  __setAttr(attrName: string, newValue: IValue): boolean;
216
216
  __getAttr(attrName: string): IValue;
217
217
  protected __changeCanvasSize(attrName: string, newValue: number): void;