lecodes-sdk 2.2.4 → 2.2.6

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.
Files changed (48) hide show
  1. package/dist/global.d.ts +2 -1
  2. package/dist/types/g2/Scene2D.d.ts +5 -4
  3. package/dist/types/gl/Scene.d.ts +5 -4
  4. package/dist/types/inject.d.ts +1 -1
  5. package/dist/types/ui/NativeView.d.ts +3 -3
  6. package/dist/types/ui/UI.d.ts +1 -1
  7. package/dist/types/ui/UILayer.d.ts +25 -18
  8. package/dist/types/ui/UINode.d.ts +13 -1
  9. package/dist/types/ui/UIScreen.d.ts +11 -1
  10. package/dist/types/ui/UIVideo.d.ts +3 -3
  11. package/dist/types/ui/UIWidget.d.ts +24 -15
  12. package/dist/types/ui/presentable.d.ts +7 -7
  13. package/dist/types/version.d.ts +1 -1
  14. package/dist/types.json +1 -1
  15. package/package.json +1 -1
  16. package/prompts/3d-scene-files.md +2 -2
  17. package/prompts/3d-scene.md +1 -1
  18. package/prompts/core.md +1 -1
  19. package/prompts/ui-design.md +6 -6
  20. package/src/animate/tween/Timeline.ts +175 -175
  21. package/src/chisel.ts +1 -1
  22. package/src/compile/assetMacro.ts +81 -13
  23. package/src/compile/resourceSlots.ts +45 -0
  24. package/src/g2/Scene2D.ts +9 -7
  25. package/src/gl/CameraPlace.ts +52 -52
  26. package/src/gl/Light.ts +257 -257
  27. package/src/gl/Mesh.ts +120 -120
  28. package/src/gl/Scene.ts +9 -7
  29. package/src/gl/animation/DynamicBone.ts +482 -482
  30. package/src/gl/scenarios.ts +291 -291
  31. package/src/inject.ts +1 -1
  32. package/src/ui/NativeView.ts +11 -9
  33. package/src/ui/UI.ts +1 -1
  34. package/src/ui/UILayer.ts +90 -42
  35. package/src/ui/UINode.ts +39 -12
  36. package/src/ui/UIPopover.ts +3 -3
  37. package/src/ui/UIScreen.ts +50 -2
  38. package/src/ui/UIVideo.ts +11 -9
  39. package/src/ui/UIWidget.ts +41 -18
  40. package/src/ui/presentable.ts +8 -8
  41. package/src/version.ts +1 -1
  42. package/tests/helpers/fakeTree.ts +6 -1
  43. package/prompts/dist/2d-game.md +0 -1567
  44. package/prompts/dist/3d-app.md +0 -1709
  45. package/prompts/dist/ar-app.md +0 -1585
  46. package/prompts/dist/concept.md +0 -49
  47. package/prompts/dist/design.md +0 -521
  48. package/prompts/dist/ui-app.md +0 -1175
package/dist/global.d.ts CHANGED
@@ -124,7 +124,6 @@ declare global {
124
124
  const UIImage: typeof SDK.UIImage
125
125
  const UIInput: typeof SDK.UIInput
126
126
  const UIModal: typeof SDK.UIModal
127
- const UIOverlay: typeof SDK.UIOverlay
128
127
  const UIPager: typeof SDK.UIPager
129
128
  const UIPopover: typeof SDK.UIPopover
130
129
  const UIRow: typeof SDK.UIRow
@@ -566,6 +565,7 @@ declare global {
566
565
  type UIVideoStyle = SDK.UIVideoStyle
567
566
  type UIVirtualizedList<T = unknown> = SDK.UIVirtualizedList<T>
568
567
  type UIWidget = SDK.UIWidget
568
+ type UIWidgetChild = SDK.UIWidgetChild
569
569
  type UIWidgetContent = SDK.UIWidgetContent
570
570
  type UIWidgetStyle = SDK.UIWidgetStyle
571
571
  type Unit = SDK.Unit
@@ -583,6 +583,7 @@ declare global {
583
583
  type WebSocket = SDK.WebSocket
584
584
  type Wheel = SDK.Wheel
585
585
  type WheelSuspension = SDK.WheelSuspension
586
+ type WidgetSet<Owner> = SDK.WidgetSet<Owner>
586
587
  type With<N, A extends Aspect<any, any, any>> = SDK.With<N, A>
587
588
  // ---- server globals (available in *.server.ts; using them in client code is a build error) ----
588
589
  const ApiError: typeof SERVER.ApiError
@@ -1,7 +1,7 @@
1
1
  import { type ColorInput } from "../core/color";
2
2
  import { type Aspect, type AspectCtor, type FieldOf, type TargetOf } from "../core/Aspect";
3
3
  import { Presentable, type DismissOptions, type PresentOptions } from "../ui/presentable";
4
- import { type UIWidgetContent } from "../ui/UILayer";
4
+ import { type WidgetSet } from "../ui/UILayer";
5
5
  import { type Vec2Like } from "../math/vec";
6
6
  import type { ClickEvent, TouchStartEvent } from "../runtime/touch";
7
7
  import { Camera2D } from "./Camera2D";
@@ -68,9 +68,10 @@ export declare class Scene2D implements Presentable {
68
68
  /** @deprecated Renamed `onBack` (2026-09-26). An alias for the projects compiled before the
69
69
  * rename; removed with the release that recompiles them. */
70
70
  onBackPressed(callback: () => void): this;
71
- /** The UI over the scene — widgets (a HUD, a dialog), laid out over the scene while it is
72
- * presented; touches outside a widget's box reach the scene. */
73
- setContent(content: UIWidgetContent): this;
71
+ /** The widgets over the scene while it is presented — a HUD, a dialog, a sheet: `scene.widgets(hud)`
72
+ * sets them, `widgets.append` / `.remove` manage them, `widgets.list` reads them. Laid out
73
+ * over it; touches outside a widget's box reach the scene. */
74
+ get widgets(): WidgetSet<this>;
74
75
  /** Make this the active scene — shows it as the current destination (replaces a screen /
75
76
  * another scene; only the active scene renders). */
76
77
  open(options?: PresentOptions): this;
@@ -1,7 +1,7 @@
1
1
  import { type ColorInput } from "../core/color";
2
2
  import { type Aspect, type AspectCtor, type FieldOf, type TargetOf } from "../core/Aspect";
3
3
  import { Presentable, type DismissOptions, type PresentOptions } from "../ui/presentable";
4
- import { type UIWidgetContent } from "../ui/UILayer";
4
+ import { type WidgetSet } from "../ui/UILayer";
5
5
  import type { ClickEvent, TouchStartEvent } from "../runtime/touch";
6
6
  import type { FetchResponse } from "../runtime/fetch";
7
7
  import { Camera } from "./Camera";
@@ -233,9 +233,10 @@ export declare class Scene implements Presentable {
233
233
  /** @deprecated Renamed `onBack` (2026-09-26). An alias for the projects compiled before the
234
234
  * rename; removed with the release that recompiles them. */
235
235
  onBackPressed(callback: () => void): this;
236
- /** The UI over the scene — widgets (a HUD, a dialog), laid out over the scene while it is
237
- * presented; touches outside a widget's box reach the scene. `scene.setContent([hud])`. */
238
- setContent(content: UIWidgetContent): this;
236
+ /** The widgets over the scene while it is presented — a HUD, a dialog, a sheet: `scene.widgets(hud)`
237
+ * sets them, `widgets.append` / `.remove` manage them, `widgets.list` reads them. Laid out
238
+ * over it; touches outside a widget's box reach the scene. */
239
+ get widgets(): WidgetSet<this>;
239
240
  /** Make this the active scene — shows it as the current destination (replaces a screen /
240
241
  * another scene; only the active scene renders). The runtime activates the engine as part of
241
242
  * presenting the destination. */
@@ -56,7 +56,7 @@ export { defineScene2d, Scene2dHandle } from "./g2/defineScene2d";
56
56
  export type { Scene2dDef, Scene2dNodeDef, Scene2dEnv, SpriteSourceDef, TilemapSourceDef, Camera2dNodeDef, LoadedScene2d } from "./g2/defineScene2d";
57
57
  export { cells, encodeCells, type CellsData } from "./g2/cells";
58
58
  export { CameraFollow } from "./g2/scenarios2d";
59
- export { UIScreen, type UIScreenStyle, UIRow, UIColumn, UIBox, type UIContainerStyle, UIText, type UITextStyle, UIButton, type UIButtonStyle, UIImage, type UIImageStyle, UIVideo, type UIVideoStyle, UIInput, UITextArea, type UIInputStyle, UIScrollable, type UIScrollableStyle, UIPager, type UIPagerStyle, UITabs, type UITabDef, defineTabs, type TabDef, type TabsHandle, UIWidget, type UIWidgetStyle, UIOverlay, type UIWidgetContent, UIModal, type UIModalStyle, UIBottomSheet, type UIBottomSheetStyle, UIPopover, type UIPopoverStyle, UISpacer, type UISpacerStyle, UIVirtualizedList, Router, NativeView, type UINativeViewStyle, registerFont, __uiMap, __UIColumn, __UIRow, __UIBox, __UIButton, __UIScreen, __UIScrollable, __UIWidget, } from "./ui/UI";
59
+ export { UIScreen, type UIScreenStyle, UIRow, UIColumn, UIBox, type UIContainerStyle, UIText, type UITextStyle, UIButton, type UIButtonStyle, UIImage, type UIImageStyle, UIVideo, type UIVideoStyle, UIInput, UITextArea, type UIInputStyle, UIScrollable, type UIScrollableStyle, UIPager, type UIPagerStyle, UITabs, type UITabDef, defineTabs, type TabDef, type TabsHandle, UIWidget, type UIWidgetStyle, type WidgetSet, type UIWidgetContent, type UIWidgetChild, UIModal, type UIModalStyle, UIBottomSheet, type UIBottomSheetStyle, UIPopover, type UIPopoverStyle, UISpacer, type UISpacerStyle, UIVirtualizedList, Router, NativeView, type UINativeViewStyle, registerFont, __uiMap, __UIColumn, __UIRow, __UIBox, __UIButton, __UIScreen, __UIScrollable, __UIWidget, } from "./ui/UI";
60
60
  export { Presentable } from "./ui/UI";
61
61
  export type { DismissOptions, PresentOptions, Transition, TransitionName, TransitionPose, TransitionSpec } from "./ui/UI";
62
62
  export type { UINode, UINodeChild } from "./ui/UINode";
@@ -1,4 +1,4 @@
1
- import { type UIWidgetContent } from "./UILayer";
1
+ import { type WidgetSet } from "./UILayer";
2
2
  import { type DismissOptions, type PresentOptions } from "./presentable";
3
3
  import { type BaseStyle, type DrawableStyle, type ElementStyle, type UIElementBase } from "./UINode";
4
4
  export type UINativeViewStyle = ElementStyle & DrawableStyle;
@@ -27,8 +27,8 @@ export interface NativeView extends UIElementBase<UINativeViewStyle, DrawableSty
27
27
  /** Subscribe to an event the native view emits (`map.on("markerTap", cb)`). */
28
28
  on(event: string, callback: (data?: any) => void): this;
29
29
  off(event: string, callback: (data?: any) => void): this;
30
- /** The UI over the view when presented: widgets over it (`Presentable.setContent`). */
31
- setContent(content: UIWidgetContent): this;
30
+ /** The widgets over the view when it is presented (`Presentable.widgets`): `map.widgets(header, card)`. */
31
+ readonly widgets: WidgetSet<this>;
32
32
  }
33
33
  /**
34
34
  * Create an instance of a host-registered platform view. `NativeView.isSupported(name)` reports
@@ -7,7 +7,7 @@ export { UIImage, type UIImageStyle } from './UIImage';
7
7
  export { UIVideo, type UIVideoStyle } from './UIVideo';
8
8
  export { UIInput, UITextArea, type UIInputStyle } from './UIInput';
9
9
  export { UIWidget, type UIWidgetStyle } from './UIWidget';
10
- export { UIOverlay, type UIWidgetContent } from './UILayer';
10
+ export { type WidgetSet, type UIWidgetContent, type UIWidgetChild } from './UILayer';
11
11
  export { UIModal, type UIModalStyle } from './UIModal';
12
12
  export { UIBottomSheet, type UIBottomSheetStyle } from './UIBottomSheet';
13
13
  export { UIPopover, type UIPopoverStyle, type UIPopoverAnchor } from './UIPopover';
@@ -1,25 +1,32 @@
1
1
  import type { UIWidget } from "./UIWidget";
2
- export type UIWidgetContent = (UIWidget | null | undefined | false)[] | (() => (UIWidget | null | undefined | false)[]);
2
+ /** A widget slot: a widget, or a falsy value (skipped). */
3
+ export type UIWidgetChild = UIWidget | null | undefined | false;
4
+ /** The widgets of a destination as `widgets()` takes them: a list, or a function for reactive
5
+ * content (re-run when a signal read inside it changes, reconciled against the shown ones). */
6
+ export type UIWidgetContent = UIWidgetChild[] | (() => UIWidgetChild[]);
3
7
  /**
4
- * The app layer: the widgets above EVERY destination, always shown — a global loader, a mini-player
5
- * that follows the user across screens, a toast with actions. Widgets that belong to a place go in
6
- * that place instead: a dialog among its screen's children (`UIScreen(..., dialog)`), a HUD in
7
- * `scene.setContent([hud])`. A widget shown with `show()` while it has no parent lands here.
8
+ * The widgets of a destination — a dialog, a sheet, a HUD: what floats over it, laid out and
9
+ * painted in its box above everything else. Call it to set them (`screen.widgets(dialog)`, same
10
+ * argument forms as `UIColumn`: widgets, arrays of them, or ONE function for reactive content);
11
+ * `append` / `remove` manage them one at a time; `list` reads them. A widget shows with its
12
+ * destination unless its style says `display: "none"`; `show()` / `hide()` flip that, and
13
+ * `show()` puts it on top of the others.
8
14
  *
9
15
  * ```ts
10
- * UIOverlay.append(miniPlayer)
11
- * miniPlayer.hide() // display: none — still here, ready for show()
16
+ * const home = UIScreen(content).widgets(dialog, sheet)
17
+ * scene.widgets(hud)
18
+ * scene.widgets(() => [hud, paused() && pauseMenu])
19
+ * home.widgets.append(toast); home.widgets.remove(toast)
20
+ * home.widgets.list // [dialog, sheet] — never in `children`
12
21
  * ```
13
22
  */
14
- export declare const UIOverlay: Readonly<{
23
+ export interface WidgetSet<Owner> {
24
+ (...widgets: (UIWidgetChild | UIWidgetChild[])[]): Owner;
25
+ (widgets: UIWidgetContent): Owner;
15
26
  /** Add widgets at the end (on top). */
16
- append(...widgets: (UIWidget | null | undefined | false)[]): void;
17
- /** Insert widgets at `index` (0 = the bottom of the layer). */
18
- insert(index: number, ...widgets: (UIWidget | null | undefined | false)[]): void;
19
- /** Take widgets out of the layer (they stay valid; a dropped one is freed). */
20
- remove(...widgets: (UIWidget | null | undefined | false)[]): void;
21
- /** Replace the layer's widgets — a list, or a function for reactive content. */
22
- setContent(content: UIWidgetContent): void;
23
- /** The layer's widgets, bottom to top (a snapshot read from the runtime). */
24
- readonly children: UIWidget[];
25
- }>;
27
+ append(...widgets: UIWidgetChild[]): void;
28
+ /** Take widgets out (they stay valid while you hold them; a dropped one is freed). */
29
+ remove(...widgets: UIWidgetChild[]): void;
30
+ /** The widgets, bottom to top — a snapshot read from the runtime. */
31
+ readonly list: UIWidget[];
32
+ }
@@ -157,6 +157,14 @@ export type TextStyle = {
157
157
  lineClamp?: number;
158
158
  /** How a clamped line ends. Only meaningful together with `lineClamp`. Default "ellipsis". */
159
159
  textOverflow?: "ellipsis" | "clip";
160
+ /**
161
+ * How a paragraph breaks into lines (CSS `text-wrap`; a `\n` stays a hard break in every mode).
162
+ * "wrap" (default) = greedy; "nowrap" = never at a space — the box is measured to the whole line and
163
+ * a line wider than the box it gets is ended per `textOverflow`; "balance" = the lines are made even
164
+ * (the narrowest width that keeps the line count, paragraphs of 2–10 lines); "pretty" = no single
165
+ * word alone on the last line. Inherited.
166
+ */
167
+ textWrap?: "wrap" | "nowrap" | "balance" | "pretty";
160
168
  };
161
169
  /** Reactive style input: every primitive-valued prop also accepts a `() => value` binding that
162
170
  * re-applies when a signal it read changes. Nested `$class` blocks stay static — bindings are
@@ -376,11 +384,15 @@ export type ChildrenFn = () => UINodeChild[];
376
384
  * results it behaves exactly like Array.prototype.map — a wrong rewrite can't change behavior.
377
385
  */
378
386
  export declare function __uiMap(list: any, render: (item: any, index: number) => any, slot: string): any[];
387
+ /** A widget slot of `widgets(...)` takes a widget (falsy = conditional, skipped silently);
388
+ * anything else is reported and skipped. */
389
+ export declare const acceptWidget: (owner: {
390
+ type: string;
391
+ }, node: any) => boolean;
379
392
  export declare class ContainerElement<T extends string> extends Element<T> {
380
393
  constructor(type: T, style: any, children: any[] | ChildrenFn);
381
394
  /** The children — a snapshot read from the runtime (falsy entries were never mounted). */
382
395
  get children(): any[];
383
- private _insertAt;
384
396
  /** Append children (falsy entries are skipped). */
385
397
  append(...nodes: UINodeChild[]): this;
386
398
  /** Insert children at `index`. */
@@ -1,6 +1,7 @@
1
1
  import { TouchStartEvent } from "../runtime/touch";
2
2
  import { type DismissOptions, type PresentOptions } from "./presentable";
3
3
  import { ContainerElement, type BaseStyle, type ContainerStyle, type DrawableStyle, type PaddingStyle, type UIChildArg, type UIContainerBase, type UINodeChild, type ChildrenFn } from "./UINode";
4
+ import { type WidgetHost, type WidgetSet } from "./UILayer";
4
5
  export type UIScreenStyle = ContainerStyle & DrawableStyle & PaddingStyle & BaseStyle;
5
6
  /** A screen — the root the router/host mounts, sized to its slot. A screen NEVER scrolls: it is
6
7
  * fixed chrome (header, tab bar) plus, when the content overflows, one `UIScrollable` body child
@@ -46,9 +47,18 @@ export interface UIScreen extends UIContainerBase<UIScreenStyle, DrawableStyle &
46
47
  url(route: string | null): this;
47
48
  /** Touch began on the screen; `ev.track(...)` takes over the rest of the gesture. */
48
49
  onTouchStart(callback: (ev: TouchStartEvent<UIScreen>) => void): this;
50
+ /** The screen's widgets — a dialog, a sheet, a toast: `UIScreen(content).widgets(dialog)` sets
51
+ * them, `widgets.append` / `.remove` manage them, `widgets.list` reads them. Never among
52
+ * `children`: that is the content. A widget is laid out and painted over the whole screen (on a
53
+ * pager page: over the pager too) and shows with it unless its style says `display: "none"`. */
54
+ readonly widgets: WidgetSet<this>;
49
55
  }
50
- export declare class ScreenElement extends ContainerElement<"screen"> {
56
+ export declare class ScreenElement extends ContainerElement<"screen"> implements WidgetHost {
51
57
  constructor(type: "screen", style: any, children: any);
58
+ /** The content — the children read from the runtime without the widget tail. */
59
+ get children(): any[];
60
+ private _widgetSet?;
61
+ get widgets(): WidgetSet<this>;
52
62
  open(options?: PresentOptions): void;
53
63
  close(options?: DismissOptions): void;
54
64
  protected ol: (() => void)[];
@@ -1,5 +1,5 @@
1
1
  import type { VideoPlayer } from "../runtime/media";
2
- import { type UIWidgetContent } from "./UILayer";
2
+ import { type WidgetSet } from "./UILayer";
3
3
  import { type DismissOptions, type PresentOptions } from "./presentable";
4
4
  import { type BaseStyle, type DrawableStyle, type ElementStyle, type UIElementBase } from "./UINode";
5
5
  export type UIVideoStyle = ElementStyle & DrawableStyle & {
@@ -22,8 +22,8 @@ export interface UIVideo extends UIElementBase<UIVideoStyle, DrawableStyle & Bas
22
22
  onClose(callback: () => void): this;
23
23
  /** Hardware/system back while current. */
24
24
  onBack(callback: () => void): this;
25
- /** The UI over the video when presented: widgets over it (`Presentable.setContent`). */
26
- setContent(content: UIWidgetContent): this;
25
+ /** The widgets over the video when it is presented (`Presentable.widgets`): `video.widgets(controls)`. */
26
+ readonly widgets: WidgetSet<this>;
27
27
  }
28
28
  /** Create a video node showing `player`'s output. */
29
29
  export declare function UIVideo(player: VideoPlayer): UIVideo;
@@ -1,5 +1,6 @@
1
1
  import { TouchStartEvent } from "../runtime/touch";
2
2
  import { ContainerElement, type BaseStyle, type Color, type ContainerStyle, type DrawableStyle, type PaddingStyle, type PositionStyle, type UIChildArg, type UIContainerBase, type UINodeChild, type ChildrenFn } from "./UINode";
3
+ import type { Presentable } from "./presentable";
3
4
  export type UIWidgetStyle = ContainerStyle & DrawableStyle & PaddingStyle & BaseStyle & PositionStyle & {
4
5
  /** Shown (`"flex"`, the default) or not: what `show()` / `hide()` write, what a state block may
5
6
  * flip (`$open: { display: "flex" }`). */
@@ -8,13 +9,13 @@ export type UIWidgetStyle = ContainerStyle & DrawableStyle & PaddingStyle & Base
8
9
  * removes the layer. A tap on it fires `onOverlayTap`. */
9
10
  overlayColor?: Color | null;
10
11
  };
11
- /** A floating overlay that belongs to a WINDOW, not to a box (docs/plans/widgets-plan.md): a dialog,
12
- * a sheet, a HUD, a mini-player. A widget is a CHILD of the place it belongs to — a `UIScreen`
13
- * (among its children), a surface's content (`scene.setContent([hud])`) or the app layer
14
- * (`UIOverlay`) — and is laid out and painted in the box of the outermost presented destination
15
- * that contains it: absolutely positioned in that box, above everything else in it. A widget on a
16
- * tab page covers the tab bar and rides the shell's push and pop. A widget inside a `UIColumn` or
17
- * any other box is an error: a floating element of a box is an absolute child, not a widget.
12
+ /** A floating overlay that belongs to a DESTINATION, not to a box (docs/plans/widgets-plan.md): a
13
+ * dialog, a sheet, a HUD, a mini-player. A widget is one of the `widgets` of the place it belongs
14
+ * to — `UIScreen(content).widgets(dialog)`, `scene.widgets(hud)` — and is laid out and painted in
15
+ * the box of the outermost presented destination that contains it: absolutely positioned in that
16
+ * box, above everything else in it. A widget on a tab page covers the tab bar and rides the
17
+ * shell's push and pop. A widget among the children of a box is an error: a floating element of
18
+ * a box is an absolute child, not a widget.
18
19
  *
19
20
  * It shows with its place unless its style says `display: "none"`; `show()` / `hide()` flip that,
20
21
  * and so does a state block (`$class: { display: "flex" }`). `UIModal` / `UIPopover` /
@@ -23,18 +24,24 @@ export interface UIWidget extends UIContainerBase<UIWidgetStyle, DrawableStyle &
23
24
  overlayColor?: Color | null;
24
25
  }> {
25
26
  readonly type: "widget";
26
- /** Show the widget: `display: "flex"`, on top of its root — it moves to the end of its parent's
27
- * children, so a dialog opened later covers an earlier one and a HUD declared after it. A widget
28
- * with no parent is appended to the app layer first (`UIOverlay`) — a global overlay above every
29
- * destination, up until `hide()`. */
27
+ /** Show the widget: `display: "flex"`, on top of its root — it moves to the end of its
28
+ * destination's widgets, so a dialog opened later covers an earlier one and a HUD declared after
29
+ * it. A widget that belongs nowhere goes ABOVE EVERY destination — a global loader, a dialog
30
+ * opened from anywhere — and stays there, hidden by `hide()`, until it is given a place. */
30
31
  show(): void;
31
- /** Hide the widget: `display: "none"`. It stays where it is (its place, the app layer), ready
32
- * for the next `show()`. */
32
+ /** Hide the widget: `display: "none"`. It stays where it is, ready for the next `show()`. */
33
33
  hide(): void;
34
34
  /** Shown right now by its own display (`show()` ran, `hide()` hasn't, no state block hides
35
35
  * it). True for a widget hidden WITH its page or its covered screen: that is its place's
36
36
  * visibility, not the widget's. */
37
37
  readonly isShown: boolean;
38
+ /** @deprecated A widget is one of the `widgets` of the place it belongs to (2026-10-07): write
39
+ * `UIScreen(content).widgets(widget)` / `scene.widgets(widget)` instead. This alias is
40
+ * `owner.widgets.append(widget)` with the widget hidden, so the `show()` that follows flips it as
41
+ * on any placed widget; `attachTo(null)` takes it out, and the next `show()` puts it above every
42
+ * destination. For the projects compiled before the change; removed with the release that
43
+ * recompiles them. */
44
+ attachTo(owner: Presentable | null): this;
38
45
  /** Touch began on the widget; `ev.track(...)` takes over the rest of the gesture. */
39
46
  onTouchStart(callback: (ev: TouchStartEvent<UIWidget>) => void): this;
40
47
  /** Tap on the overlay layer (requires an `overlayColor`). */
@@ -51,6 +58,8 @@ export declare class WidgetElement extends ContainerElement<"widget"> {
51
58
  show(): void;
52
59
  hide(): void;
53
60
  get isShown(): boolean;
61
+ /** @deprecated see the interface */
62
+ attachTo(owner: Presentable | null): this;
54
63
  readonly touchStartListeners: any[];
55
64
  onTouchStart(callback: any): this;
56
65
  readonly otl: (() => void)[];
@@ -60,8 +69,8 @@ export declare class WidgetElement extends ContainerElement<"widget"> {
60
69
  /** @deprecated see the interface */
61
70
  onBackPressed(callback: any): this;
62
71
  }
63
- /** Create a widget (same argument forms as `UIColumn`). Put it where it belongs — among a screen's
64
- * children, in `scene.setContent([...])`, or `UIOverlay` — position it with absolute-style props
72
+ /** Create a widget (same argument forms as `UIColumn`). Give it to the destination it belongs to —
73
+ * `UIScreen(content).widgets(w)`, `scene.widgets(w)` — position it with absolute-style props
65
74
  * (`top`/`left`/`bottom`/`right`), then `show()`/`hide()`. */
66
75
  export declare function UIWidget(...children: UIChildArg[]): UIWidget;
67
76
  export declare function UIWidget(children: UINodeChild[] | ChildrenFn): UIWidget;
@@ -1,5 +1,5 @@
1
1
  import type { EasingInput } from "../animate/tween/easing";
2
- import type { UIWidget } from "./UIWidget";
2
+ import type { WidgetSet } from "./UILayer";
3
3
  /** The built-in transitions (ui/transitions.ts holds what each one is). `push` / `pop` are the
4
4
  * stacked-navigation pair — the incoming screen slides over the other one, which drifts and dims;
5
5
  * the rest are two-screen moves. */
@@ -74,12 +74,12 @@ export interface Presentable {
74
74
  onOpen(callback: () => void): this;
75
75
  onClose(callback: () => void): this;
76
76
  onBack(callback: () => void): this;
77
- /** The destination's widgets (docs/plans/widgets-plan.md): a dialog, a HUD, a sheet declared as
78
- * CONTENT of the place they belong to. A `UIScreen` takes them among its children; a surface — a
79
- * `Scene`, a `Scene2D`, a `NativeView`, a `UIVideo` — takes widgets alone, laid out over it while
80
- * it is presented (touches outside a widget's box reach the surface). A widget shows with its
81
- * destination unless its style says `display: "none"`; `show()` / `hide()` flip that. */
82
- setContent(content: (UIWidget | null | undefined | false)[] | (() => (UIWidget | null | undefined | false)[])): this;
77
+ /** The destination's widgets (docs/plans/widgets-plan.md): a dialog, a HUD, a sheet — what floats
78
+ * over it. `x.widgets(a, b)` sets them, `x.widgets.append` / `.remove` manage them, `x.widgets.list`
79
+ * reads them; the same on a `UIScreen` (apart from its `children`), a `Scene`, a `Scene2D`, a
80
+ * `NativeView`, a `UIVideo`. A widget shows with its destination unless its style says
81
+ * `display: "none"`; `show()` / `hide()` flip that. */
82
+ readonly widgets: WidgetSet<this>;
83
83
  }
84
84
  /** Runtime companion of the `Presentable` interface (declaration merging): the navigation
85
85
  * state that isn't tied to the Router. */
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "2.2.4";
1
+ export declare const SDK_VERSION = "2.2.6";
2
2
  /** The major of a semver string, or null when it is not one. */
3
3
  export declare const sdkMajor: (version: string | null | undefined) => number | null;
4
4
  /** The `// sdk: <version>` line of a compiled bundle's header (sdk/src/compile/header.ts), read from