lecodes-sdk 2.8.2 → 2.8.3

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
@@ -43,7 +43,7 @@
43
43
  "marcidb-embedded": "^0.18.0",
44
44
  "sharp": "^0.35.2"
45
45
  },
46
- "version": "2.8.2",
46
+ "version": "2.8.3",
47
47
  "files": [
48
48
  "src",
49
49
  "dist",
@@ -267,14 +267,16 @@ export interface HostUI {
267
267
  * dispatch bridge — `onComplete` with the result as ONE value, or with none.
268
268
  * @immediate its callbacks and the borrowed `args` cannot wait for a commit */
269
269
  viewCall?(viewId: i32, method: string, args: value, onComplete: (result?: value) => void, onReject: (message: string) => void): void
270
- /** A LAYER root is shown: a pass-through root the runtime lays out at the frame, above every
271
- * destination (the app layer) or over the presented surface (a scene's / a native view's / a
272
- * video's content layer). Its own box is never hit — only its children are — so a touch outside
273
- * them reaches what is under the layer; it is painted after the destination, layers in open
274
- * order. Its children are widgets (the runtime inserts them with insertNode, as under a screen
275
- * root): a widget child with an overlay layer (`overlayColor`, any color — "transparent" too)
276
- * intercepts every touch outside its own box within its root and reports it as the overlay tap. */
277
- layerOpen(node: nodeid): void
270
+ /** A LAYER root is shown: a pass-through root the runtime lays out at the frame. `surface` false =
271
+ * the app layer, above everything, screens included; true = the content layer of the presented
272
+ * surface (a scene's / a native view's / a video's widgets): right over the surface and UNDER
273
+ * every screen — a screen that covers the surface covers its widgets, the screen that leaves
274
+ * when the surface is pushed stays over them until its drop. Its own box is never hit — only its
275
+ * children are — so a touch outside them reaches what is under the layer; layers of a kind paint
276
+ * in open order. Its children are widgets (the runtime inserts them with insertNode, as under a
277
+ * screen root): a widget child with an overlay layer (`overlayColor`, any color — "transparent"
278
+ * too) intercepts every touch outside its own box within its root and reports it as the overlay tap. */
279
+ layerOpen(node: nodeid, surface: boolean): void
278
280
  /** The layer root is hidden (its view stays; releaseNode says when it is gone). */
279
281
  layerClose(node: nodeid): void
280
282
  /** Load a font face for `fontFamily` (weight 100–900, style 0 normal / 2 italic) from `url`; settle
package/src/g2/Scene2D.ts CHANGED
@@ -203,9 +203,12 @@ export class Scene2D implements Presentable {
203
203
  return _surfaceWidgets(this)
204
204
  }
205
205
  /** @internal presentation lifecycle from the runtime */
206
- _emitOpen(): void { for (const cb of this.ol.slice()) cb() }
206
+ // The ACTIVE scene — what the pointer dispatch (g2/touch.ts) routes to — follows the runtime's
207
+ // presentation, not only open(): a Router.push / pop presents a scene without it, and the first
208
+ // push of a world had no active scene at all (every touch was dropped until an open() set one).
209
+ _emitOpen(): void { Scene2D._active = this; for (const cb of this.ol.slice()) cb() }
207
210
  /** @internal */
208
- _emitClose(): void { for (const cb of this.cl.slice()) cb() }
211
+ _emitClose(): void { if (Scene2D._active === this) Scene2D._active = null; for (const cb of this.cl.slice()) cb() }
209
212
  /** @internal */
210
213
  _emitBack(): boolean {
211
214
  if (!this._backButtonCallback) return false
package/src/gl/Scene.ts CHANGED
@@ -526,9 +526,15 @@ export class Scene implements Presentable {
526
526
  return _surfaceWidgets(this)
527
527
  }
528
528
  /** @internal presentation lifecycle from the runtime */
529
- _emitOpen(): void { for (const cb of this.ol.slice()) cb() }
529
+ // The ACTIVE scene follows the runtime's presentation, not only open(): a Router.push / pop
530
+ // presents a scene without it (the 2D twin: Scene2D._emitOpen).
531
+ _emitOpen(): void { Scene._active = this; glState.activeScene = this; for (const cb of this.ol.slice()) cb() }
530
532
  /** @internal */
531
- _emitClose(): void { for (const cb of this.cl.slice()) cb() }
533
+ _emitClose(): void {
534
+ if (Scene._active === this) Scene._active = null
535
+ if (glState.activeScene === this) glState.activeScene = null
536
+ for (const cb of this.cl.slice()) cb()
537
+ }
532
538
  /** @internal */
533
539
  _emitBack(): boolean {
534
540
  if (!this._backButtonCallback) return false
package/src/version.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  // same manifest). Its MAJOR is the bundle ↔ runtime contract: a bundle's `// sdk:` header line
5
5
  // and a host's embedded version must agree on the major for the host to run the bundle; minor
6
6
  // and patch never gate anything (features are detected, never versioned).
7
- export const SDK_VERSION = "2.8.2"
7
+ export const SDK_VERSION = "2.8.3"
8
8
 
9
9
  /** The major of a semver string, or null when it is not one. */
10
10
  export const sdkMajor = (version: string | null | undefined): number | null => {