lecodes-sdk 2.2.4 → 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 +2 -1
- 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/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 +5 -1
- package/dist/types/ui/UIScreen.d.ts +11 -1
- package/dist/types/ui/UIVideo.d.ts +3 -3
- 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 +1 -1
- 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/src/chisel.ts +1 -1
- package/src/g2/Scene2D.ts +9 -7
- package/src/gl/Scene.ts +9 -7
- package/src/inject.ts +1 -1
- 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 +30 -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/UIWidget.ts +41 -18
- package/src/ui/presentable.ts +8 -8
- package/src/version.ts +1 -1
- package/tests/helpers/fakeTree.ts +6 -1
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
|
|
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
|
|
72
|
-
*
|
|
73
|
-
|
|
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;
|
package/dist/types/gl/Scene.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
237
|
-
*
|
|
238
|
-
|
|
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. */
|
package/dist/types/inject.d.ts
CHANGED
|
@@ -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,
|
|
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
|
|
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
|
|
31
|
-
|
|
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
|
package/dist/types/ui/UI.d.ts
CHANGED
|
@@ -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 {
|
|
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
|
-
|
|
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
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `
|
|
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
|
-
*
|
|
11
|
-
*
|
|
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
|
|
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:
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
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
|
+
}
|
|
@@ -376,11 +376,15 @@ export type ChildrenFn = () => UINodeChild[];
|
|
|
376
376
|
* results it behaves exactly like Array.prototype.map — a wrong rewrite can't change behavior.
|
|
377
377
|
*/
|
|
378
378
|
export declare function __uiMap(list: any, render: (item: any, index: number) => any, slot: string): any[];
|
|
379
|
+
/** A widget slot of `widgets(...)` takes a widget (falsy = conditional, skipped silently);
|
|
380
|
+
* anything else is reported and skipped. */
|
|
381
|
+
export declare const acceptWidget: (owner: {
|
|
382
|
+
type: string;
|
|
383
|
+
}, node: any) => boolean;
|
|
379
384
|
export declare class ContainerElement<T extends string> extends Element<T> {
|
|
380
385
|
constructor(type: T, style: any, children: any[] | ChildrenFn);
|
|
381
386
|
/** The children — a snapshot read from the runtime (falsy entries were never mounted). */
|
|
382
387
|
get children(): any[];
|
|
383
|
-
private _insertAt;
|
|
384
388
|
/** Append children (falsy entries are skipped). */
|
|
385
389
|
append(...nodes: UINodeChild[]): this;
|
|
386
390
|
/** 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
|
|
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
|
|
26
|
-
|
|
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
|
|
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
|