@leafer-ui/app 1.0.0-rc.26 → 1.0.0-rc.28

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-rc.26",
3
+ "version": "1.0.0-rc.28",
4
4
  "description": "@leafer-ui/app",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,13 +22,13 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/core": "1.0.0-rc.26",
26
- "@leafer-ui/display": "1.0.0-rc.26",
27
- "@leafer-ui/type": "1.0.0-rc.26",
28
- "@leafer-ui/data": "1.0.0-rc.26"
25
+ "@leafer/core": "1.0.0-rc.28",
26
+ "@leafer-ui/display": "1.0.0-rc.28",
27
+ "@leafer-ui/type": "1.0.0-rc.28",
28
+ "@leafer-ui/data": "1.0.0-rc.28"
29
29
  },
30
30
  "devDependencies": {
31
- "@leafer/interface": "1.0.0-rc.26",
32
- "@leafer-ui/interface": "1.0.0-rc.26"
31
+ "@leafer/interface": "1.0.0-rc.28",
32
+ "@leafer-ui/interface": "1.0.0-rc.28"
33
33
  }
34
34
  }
package/src/App.ts CHANGED
@@ -25,7 +25,7 @@ export class App extends Leafer implements IApp {
25
25
  super(userConfig, data)
26
26
  }
27
27
 
28
- public init(userConfig?: IAppConfig, parentApp?: IApp): void {
28
+ override init(userConfig?: IAppConfig, parentApp?: IApp): void {
29
29
  super.init(userConfig, parentApp)
30
30
  if (userConfig) {
31
31
  const { ground, tree, sky, editor } = userConfig
@@ -55,27 +55,27 @@ export class App extends Leafer implements IApp {
55
55
  this.__eventIds.push(this.on_(PropertyEvent.CHANGE, this.__onPropertyChange, this))
56
56
  }
57
57
 
58
- public start(): void {
58
+ override start(): void {
59
59
  super.start()
60
60
  this.children.forEach(leafer => leafer.start())
61
61
  }
62
62
 
63
- public stop(): void {
63
+ override stop(): void {
64
64
  this.children.forEach(leafer => leafer.stop())
65
65
  super.stop()
66
66
  }
67
67
 
68
- public unlockLayout(): void {
68
+ override unlockLayout(): void {
69
69
  super.unlockLayout()
70
70
  this.children.forEach(leafer => leafer.unlockLayout())
71
71
  }
72
72
 
73
- public lockLayout(): void {
73
+ override lockLayout(): void {
74
74
  super.lockLayout()
75
75
  this.children.forEach(leafer => leafer.lockLayout())
76
76
  }
77
77
 
78
- public forceRender(bounds?: IBoundsData): void {
78
+ override forceRender(bounds?: IBoundsData): void {
79
79
  this.children.forEach(leafer => leafer.forceRender(bounds))
80
80
  }
81
81
 
@@ -85,16 +85,17 @@ export class App extends Leafer implements IApp {
85
85
  return leafer
86
86
  }
87
87
 
88
- public add(leafer: ILeafer): void {
88
+ override add(leafer: ILeafer, index?: number): void {
89
89
  if (!leafer.view) {
90
90
  if (this.realCanvas && !this.canvas.bounds) { // wait miniapp select canvas
91
- setTimeout(() => this.add(leafer), 10)
91
+ setTimeout(() => this.add(leafer, index), 10)
92
92
  return
93
93
  }
94
94
  leafer.init(this.__getChildConfig(leafer.userConfig), this)
95
95
  }
96
96
 
97
- super.add(leafer)
97
+ super.add(leafer, index)
98
+ if (index !== undefined) leafer.canvas.childIndex = index
98
99
  this.__listenChildEvents(leafer)
99
100
  }
100
101
 
@@ -119,7 +120,7 @@ export class App extends Leafer implements IApp {
119
120
  if (this.viewReady) this.renderer.update()
120
121
  }
121
122
 
122
- public __render(canvas: ILeaferCanvas, options: IRenderOptions): void {
123
+ override __render(canvas: ILeaferCanvas, options: IRenderOptions): void {
123
124
  if (options.matrix) {
124
125
  const { a, b, c, d, e, f } = options.matrix
125
126
  canvas.setTransform(a, b, c, d, e, f) // screenshot
package/types/index.d.ts CHANGED
@@ -20,7 +20,7 @@ declare class App extends Leafer implements IApp {
20
20
  lockLayout(): void;
21
21
  forceRender(bounds?: IBoundsData): void;
22
22
  addLeafer(merge?: ILeaferConfig): Leafer;
23
- add(leafer: ILeafer): void;
23
+ add(leafer: ILeafer, index?: number): void;
24
24
  protected __onPropertyChange(): void;
25
25
  protected __onCreated(): void;
26
26
  protected __onReady(): void;