lecodes-sdk 2.2.3 → 2.2.5

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 (61) hide show
  1. package/dist/global.d.ts +3 -1
  2. package/dist/types/animate/tween/spec.d.ts +4 -5
  3. package/dist/types/g2/Scene2D.d.ts +5 -4
  4. package/dist/types/gl/Scene.d.ts +5 -4
  5. package/dist/types/inject.d.ts +1 -1
  6. package/dist/types/server/db/fields.d.ts +6 -3
  7. package/dist/types/server/db/marci/query.d.ts +21 -2
  8. package/dist/types/server/db/types.d.ts +26 -12
  9. package/dist/types/server/errors.d.ts +4 -1
  10. package/dist/types/server/files/models.d.ts +4 -0
  11. package/dist/types/server/inject.d.ts +6 -0
  12. package/dist/types/ui/NativeView.d.ts +3 -3
  13. package/dist/types/ui/UI.d.ts +1 -1
  14. package/dist/types/ui/UILayer.d.ts +25 -18
  15. package/dist/types/ui/UINode.d.ts +8 -1
  16. package/dist/types/ui/UIScreen.d.ts +11 -1
  17. package/dist/types/ui/UIVideo.d.ts +3 -3
  18. package/dist/types/ui/UIVirtualizedList.d.ts +64 -18
  19. package/dist/types/ui/UIWidget.d.ts +24 -15
  20. package/dist/types/ui/presentable.d.ts +7 -7
  21. package/dist/types/version.d.ts +1 -1
  22. package/dist/types.json +1 -1
  23. package/package.json +2 -2
  24. package/prompts/3d-scene-files.md +2 -2
  25. package/prompts/3d-scene.md +1 -1
  26. package/prompts/dist/2d-game.md +13 -13
  27. package/prompts/dist/3d-app.md +21 -18
  28. package/prompts/dist/ar-app.md +13 -13
  29. package/prompts/dist/ui-app.md +13 -13
  30. package/prompts/ui.md +3 -1
  31. package/src/animate/tween/spec.ts +8 -13
  32. package/src/chisel.ts +3 -3
  33. package/src/compile/serverSplit.ts +5 -3
  34. package/src/g2/Scene2D.ts +9 -7
  35. package/src/gl/Scene.ts +9 -7
  36. package/src/inject.ts +1 -1
  37. package/src/server/db/defineDb.ts +17 -21
  38. package/src/server/db/fields.ts +7 -4
  39. package/src/server/db/httpTransport.ts +19 -3
  40. package/src/server/db/marci/query.ts +34 -8
  41. package/src/server/db/types.ts +33 -14
  42. package/src/server/errors.ts +4 -1
  43. package/src/server/files/db.ts +26 -7
  44. package/src/server/files/host.ts +45 -17
  45. package/src/server/files/models.ts +4 -0
  46. package/src/server/host.ts +3 -3
  47. package/src/server/inject.ts +3 -0
  48. package/src/server/runtime.ts +65 -4
  49. package/src/ui/NativeView.ts +11 -9
  50. package/src/ui/UI.ts +1 -1
  51. package/src/ui/UILayer.ts +90 -42
  52. package/src/ui/UINode.ts +33 -11
  53. package/src/ui/UIPopover.ts +3 -3
  54. package/src/ui/UIScreen.ts +50 -2
  55. package/src/ui/UIVideo.ts +11 -9
  56. package/src/ui/UIVirtualizedList.ts +159 -31
  57. package/src/ui/UIWidget.ts +41 -18
  58. package/src/ui/presentable.ts +8 -8
  59. package/src/ui/transitions.ts +1 -1
  60. package/src/version.ts +1 -1
  61. package/tests/helpers/fakeTree.ts +6 -1
@@ -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.3";
1
+ export declare const SDK_VERSION = "2.2.5";
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