@leafer-ui/app 1.0.0-beta.7 → 1.0.0-beta.9

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/app",
3
- "version": "1.0.0-beta.7",
3
+ "version": "1.0.0-beta.9",
4
4
  "description": "@leafer-ui/app",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -19,13 +19,13 @@
19
19
  "leaferjs"
20
20
  ],
21
21
  "dependencies": {
22
- "@leafer/core": "1.0.0-beta.7",
23
- "@leafer-ui/display": "1.0.0-beta.7",
24
- "@leafer-ui/type": "1.0.0-beta.7",
25
- "@leafer-ui/data": "1.0.0-beta.7"
22
+ "@leafer/core": "1.0.0-beta.9",
23
+ "@leafer-ui/display": "1.0.0-beta.9",
24
+ "@leafer-ui/type": "1.0.0-beta.9",
25
+ "@leafer-ui/data": "1.0.0-beta.9"
26
26
  },
27
27
  "devDependencies": {
28
- "@leafer/interface": "1.0.0-beta.7",
29
- "@leafer-ui/interface": "1.0.0-beta.7"
28
+ "@leafer/interface": "1.0.0-beta.9",
29
+ "@leafer-ui/interface": "1.0.0-beta.9"
30
30
  }
31
31
  }
package/src/App.ts CHANGED
@@ -106,10 +106,10 @@ export class App extends Leafer implements IApp {
106
106
  return config
107
107
  }
108
108
 
109
- public destory(): void {
110
- this.children.forEach(leafer => { leafer.destory() })
109
+ public destroy(): void {
110
+ this.children.forEach(leafer => { leafer.destroy() })
111
111
  this.children.length = 0
112
- super.destory()
112
+ super.destroy()
113
113
  }
114
114
 
115
115
  }
package/src/Leafer.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { IApp, ILeafer, ILeaferCanvas, IRenderer, ILayouter, ISelector, IWatcher, IInteraction, ILeaferConfig, ICanvasManager, IHitCanvasManager, IImageManager, IAutoBounds, IScreenSizeData, IResizeEvent, ILeaf, IEventListenerId, ITransformEventData, ITimer, __Value, IObject, IControl } from '@leafer/interface'
2
- import { AutoBounds, LayoutEvent, ResizeEvent, LeaferEvent, CanvasManager, HitCanvasManager, ImageManager, DataHelper, Creator, Run, Debug, RenderEvent, registerUI, boundsType, canvasSizeAttrs, dataProcessor, Platform } from '@leafer/core'
2
+ import { AutoBounds, LayoutEvent, ResizeEvent, LeaferEvent, CanvasManager, HitCanvasManager, ImageManager, DataHelper, Creator, Run, Debug, RenderEvent, registerUI, boundsType, canvasSizeAttrs, dataProcessor, Platform, PluginManager } from '@leafer/core'
3
3
 
4
4
  import { ILeaferInputData, ILeaferData, IFunction } from '@leafer-ui/interface'
5
5
  import { LeaferTypeCreator } from '@leafer-ui/type'
@@ -56,6 +56,7 @@ export class Leafer extends Group implements ILeafer {
56
56
  type: 'design',
57
57
  start: true,
58
58
  hittable: true,
59
+ smooth: true,
59
60
  zoom: {
60
61
  min: 0.02,
61
62
  max: 256
@@ -122,6 +123,8 @@ export class Leafer extends Group implements ILeafer {
122
123
  this.__listenEvents()
123
124
 
124
125
  if (start) this.__startTimer = setTimeout(this.start.bind(this))
126
+
127
+ PluginManager.onLeafer(this)
125
128
  }
126
129
 
127
130
  public start(): void {
@@ -202,7 +205,7 @@ export class Leafer extends Group implements ILeafer {
202
205
  }
203
206
  if (!this.running) this.start()
204
207
  check()
205
- if (!this.viewLoaded) id = this.on_('render.after', check)
208
+ if (!this.viewLoaded) id = this.on_(RenderEvent.AFTER, check)
206
209
  }
207
210
 
208
211
  protected __checkAutoLayout(config: ILeaferConfig): void {
@@ -280,7 +283,7 @@ export class Leafer extends Group implements ILeafer {
280
283
  this.off_(this.__eventIds)
281
284
  }
282
285
 
283
- public destory(): void {
286
+ public destroy(): void {
284
287
  if (this.canvas) {
285
288
  try {
286
289
  this.stop()
@@ -291,9 +294,9 @@ export class Leafer extends Group implements ILeafer {
291
294
  this.__controllers.length = 0
292
295
 
293
296
  this.selector.destroy()
294
- this.canvasManager.destory()
295
- this.hitCanvasManager.destory()
296
- this.imageManager.destory()
297
+ this.canvasManager.destroy()
298
+ this.hitCanvasManager.destroy()
299
+ this.imageManager.destroy()
297
300
 
298
301
  this.canvas.destroy()
299
302
  this.canvas = null