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.
- package/dist/global.d.ts +3 -1
- package/dist/types/animate/tween/spec.d.ts +4 -5
- package/dist/types/g2/Scene2D.d.ts +5 -4
- package/dist/types/gl/Scene.d.ts +5 -4
- package/dist/types/inject.d.ts +1 -1
- package/dist/types/server/db/fields.d.ts +6 -3
- package/dist/types/server/db/marci/query.d.ts +21 -2
- package/dist/types/server/db/types.d.ts +26 -12
- package/dist/types/server/errors.d.ts +4 -1
- package/dist/types/server/files/models.d.ts +4 -0
- package/dist/types/server/inject.d.ts +6 -0
- package/dist/types/ui/NativeView.d.ts +3 -3
- package/dist/types/ui/UI.d.ts +1 -1
- package/dist/types/ui/UILayer.d.ts +25 -18
- package/dist/types/ui/UINode.d.ts +8 -1
- package/dist/types/ui/UIScreen.d.ts +11 -1
- package/dist/types/ui/UIVideo.d.ts +3 -3
- package/dist/types/ui/UIVirtualizedList.d.ts +64 -18
- package/dist/types/ui/UIWidget.d.ts +24 -15
- package/dist/types/ui/presentable.d.ts +7 -7
- package/dist/types/version.d.ts +1 -1
- package/dist/types.json +1 -1
- package/package.json +2 -2
- package/prompts/3d-scene-files.md +2 -2
- package/prompts/3d-scene.md +1 -1
- package/prompts/dist/2d-game.md +13 -13
- package/prompts/dist/3d-app.md +21 -18
- package/prompts/dist/ar-app.md +13 -13
- package/prompts/dist/ui-app.md +13 -13
- package/prompts/ui.md +3 -1
- package/src/animate/tween/spec.ts +8 -13
- package/src/chisel.ts +3 -3
- package/src/compile/serverSplit.ts +5 -3
- package/src/g2/Scene2D.ts +9 -7
- package/src/gl/Scene.ts +9 -7
- package/src/inject.ts +1 -1
- package/src/server/db/defineDb.ts +17 -21
- package/src/server/db/fields.ts +7 -4
- package/src/server/db/httpTransport.ts +19 -3
- package/src/server/db/marci/query.ts +34 -8
- package/src/server/db/types.ts +33 -14
- package/src/server/errors.ts +4 -1
- package/src/server/files/db.ts +26 -7
- package/src/server/files/host.ts +45 -17
- package/src/server/files/models.ts +4 -0
- package/src/server/host.ts +3 -3
- package/src/server/inject.ts +3 -0
- package/src/server/runtime.ts +65 -4
- package/src/ui/NativeView.ts +11 -9
- package/src/ui/UI.ts +1 -1
- package/src/ui/UILayer.ts +90 -42
- package/src/ui/UINode.ts +33 -11
- package/src/ui/UIPopover.ts +3 -3
- package/src/ui/UIScreen.ts +50 -2
- package/src/ui/UIVideo.ts +11 -9
- package/src/ui/UIVirtualizedList.ts +159 -31
- package/src/ui/UIWidget.ts +41 -18
- package/src/ui/presentable.ts +8 -8
- package/src/ui/transitions.ts +1 -1
- package/src/version.ts +1 -1
- 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
|
|
12
|
-
* a sheet, a HUD, a mini-player. A widget is
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
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
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
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
|
|
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`).
|
|
64
|
-
*
|
|
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 {
|
|
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
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
|
|
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. */
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.2.
|
|
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
|