lecodes-sdk 2.2.11 → 2.2.13
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 -0
- package/dist/host.d.ts +8 -2
- package/dist/types/core/Aspect.d.ts +5 -0
- package/dist/types/g2/Physics2D.d.ts +3 -2
- package/dist/types/g2/Scene2D.d.ts +6 -0
- package/dist/types/gl/Scene.d.ts +6 -0
- package/dist/types/gl/Texture.d.ts +2 -7
- package/dist/types/gl/animation/DynamicBone.d.ts +3 -0
- package/dist/types/gl/animation/Locomotion.d.ts +3 -0
- package/dist/types/gl/physics/Physics.d.ts +2 -1
- package/dist/types/gl/physics/Ragdoll.d.ts +4 -0
- package/dist/types/gl/vehicle/Vehicle.d.ts +4 -0
- package/dist/types/inject.d.ts +1 -1
- package/dist/types/runtime/app.d.ts +4 -2
- package/dist/types/runtime/fetch.d.ts +3 -0
- package/dist/types/runtime/storage.d.ts +6 -1
- package/dist/types/server/db/marci/query.d.ts +8 -2
- package/dist/types/ui/UIButton.d.ts +2 -2
- package/dist/types/ui/UIContainer.d.ts +4 -2
- package/dist/types/ui/UINode.d.ts +1 -1
- package/dist/types/ui/UIScreen.d.ts +2 -2
- package/dist/types/ui/UIVideo.d.ts +3 -2
- package/dist/types/ui/router.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types.json +1 -1
- package/package.json +2 -5
- package/src/compile/assetIconMacro.ts +2 -1
- package/src/compile/assetMacro.ts +2 -1
- package/src/compile/compileProject.ts +28 -4
- package/src/compile/header.ts +17 -0
- package/src/compile/index.ts +2 -0
- package/src/core/Aspect.ts +2 -1
- package/src/g2/Physics2D.ts +6 -3
- package/src/g2/Scene2D.ts +9 -1
- package/src/gl/Scene.ts +9 -1
- package/src/gl/Texture.ts +2 -1
- package/src/gl/animation/DynamicBone.ts +6 -2
- package/src/gl/animation/Locomotion.ts +11 -1
- package/src/gl/physics/Physics.ts +3 -2
- package/src/gl/physics/Ragdoll.ts +8 -3
- package/src/gl/vehicle/Vehicle.ts +7 -2
- package/src/host.d.ts +8 -2
- package/src/inject.ts +1 -1
- package/src/runtime/app.ts +4 -2
- package/src/runtime/fetch.ts +6 -0
- package/src/runtime/storage.ts +14 -4
- package/src/server/db/marci/query.ts +8 -2
- package/src/ui/UIButton.ts +2 -2
- package/src/ui/UIContainer.ts +4 -2
- package/src/ui/UINode.ts +1 -1
- package/src/ui/UIScreen.ts +2 -2
- package/src/ui/UIVideo.ts +3 -2
- package/src/ui/router.ts +4 -3
- package/src/version.ts +1 -1
- package/prompts/2d.md +0 -391
- package/prompts/3d-scene-files.md +0 -113
- package/prompts/3d-scene.md +0 -122
- package/prompts/3d.md +0 -299
- package/prompts/README.md +0 -142
- package/prompts/ar.md +0 -142
- package/prompts/canvas.md +0 -28
- package/prompts/compose.ts +0 -46
- package/prompts/concept.md +0 -49
- package/prompts/core-design.md +0 -98
- package/prompts/core.md +0 -294
- package/prompts/design.md +0 -218
- package/prompts/dist/2d-game.md +0 -1567
- package/prompts/dist/3d-app.md +0 -1712
- package/prompts/dist/ar-app.md +0 -1585
- package/prompts/dist/concept.md +0 -49
- package/prompts/dist/design.md +0 -521
- package/prompts/dist/ui-app.md +0 -1175
- package/prompts/index.md +0 -39
- package/prompts/intake-prompt.md +0 -33
- package/prompts/namer-prompt.md +0 -12
- package/prompts/router-prompt.md +0 -50
- package/prompts/select.ts +0 -126
- package/prompts/ui-design.md +0 -203
- package/prompts/ui.md +0 -813
package/dist/global.d.ts
CHANGED
|
@@ -651,7 +651,9 @@ declare global {
|
|
|
651
651
|
type UserLocationOptions = SDK.UserLocationOptions
|
|
652
652
|
type VRScene = SDK.VRScene
|
|
653
653
|
type Vec2 = SDK.Vec2
|
|
654
|
+
type Vec2Like = SDK.Vec2Like
|
|
654
655
|
type Vec3 = SDK.Vec3
|
|
656
|
+
type Vec3Like = SDK.Vec3Like
|
|
655
657
|
type Vehicle = SDK.Vehicle
|
|
656
658
|
type VideoPlayer = SDK.VideoPlayer
|
|
657
659
|
type Voice = SDK.Voice
|
package/dist/host.d.ts
CHANGED
|
@@ -6,8 +6,11 @@
|
|
|
6
6
|
import type { SvgSource } from "./types/runtime/misc"
|
|
7
7
|
|
|
8
8
|
declare global {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/** As in the browser, but the delay is REQUIRED (the native runtime throws without it) and no
|
|
10
|
+
* extra argument reaches the handler. Timers tick with the frame on every native host: one
|
|
11
|
+
* frame is the resolution. */
|
|
12
|
+
function setTimeout(handler: () => void, timeout: number): number
|
|
13
|
+
function setInterval(handler: () => void, timeout: number): number
|
|
11
14
|
function clearTimeout(id: number): void
|
|
12
15
|
function clearInterval(id: number): void
|
|
13
16
|
/** Per-frame loop, driven by the host (viewer RAF / desktop runTick). `dt` is **seconds** since
|
|
@@ -38,6 +41,9 @@ declare global {
|
|
|
38
41
|
/** Compile-time macro: `asset('./logo.svg')` yields the file as an SVG image source — for
|
|
39
42
|
* `UIImage(...)` and `bgImage`. */
|
|
40
43
|
function asset(path: `${string}.svg`): SvgSource
|
|
44
|
+
/** Compile-time macro: `asset('./levels.csv')` yields a text file's TEXT (.txt, .csv, .md, .css,
|
|
45
|
+
* .html, .xml, .yml — it ships inside the bundle). Parse it yourself. */
|
|
46
|
+
function asset(path: `${string}.${"txt" | "csv" | "md" | "css" | "html" | "xml" | "yml" | "yaml"}`): string
|
|
41
47
|
/** Compile-time macro: `asset('./hero.png')` is desugared by the bundler into the module import
|
|
42
48
|
* for that resource. The file must exist — a path that resolves to nothing fails the compile
|
|
43
49
|
* (`asset not found: ./hero.png (main.ts:3)`); there is no runtime fallback. Calls inside
|
|
@@ -36,6 +36,11 @@ export declare abstract class AspectHost<E extends EventMap = EventMap> extends
|
|
|
36
36
|
* child-management `add`/`remove` semantics some node kinds expose. */
|
|
37
37
|
removeAspect<A extends Aspect<any, any, any>>(ctor: AspectCtor<A>): this;
|
|
38
38
|
}
|
|
39
|
+
/** What a scene needs to carry systems: Scene and Scene2D implement it over the helpers below. Public
|
|
40
|
+
* (never stripped from the public types: the `System` type names it). */
|
|
41
|
+
export type SystemHost = {
|
|
42
|
+
readonly _systems: Map<Function, Aspect<any, any, any>>;
|
|
43
|
+
};
|
|
39
44
|
/**
|
|
40
45
|
* Base for everything you attach. `K` = accessor name (extracted by chisel for the runtime). `P` =
|
|
41
46
|
* the target node kind: `this.node` is typed to it, AND attaching to a wrong node is a compile error.
|
|
@@ -97,8 +97,9 @@ export declare class Physics2D extends Aspect<"physics", Node2D> {
|
|
|
97
97
|
static get gravity(): Vec2;
|
|
98
98
|
static set gravity(g: Vec2Like);
|
|
99
99
|
private static _gravity;
|
|
100
|
-
/** Whether this
|
|
101
|
-
*
|
|
100
|
+
/** Whether this host has 2D physics (a 2D engine built with CREATOR_2D_PHYSICS). False, never a
|
|
101
|
+
* throw, where there is no 2D engine at all (Web Lite, a 3d / core engine variant). It reports
|
|
102
|
+
* the build, not the world — there is nothing else to guard, since the world creates itself. */
|
|
102
103
|
static get supported(): boolean;
|
|
103
104
|
/** Render interpolation of body transforms between the fixed 60 Hz steps (global; default on). Turn
|
|
104
105
|
* off to save per-frame transform writes when you have many moving bodies / don't need >60 Hz
|
|
@@ -30,6 +30,9 @@ export declare class Scene2D implements Presentable {
|
|
|
30
30
|
readonly camera: Camera2D;
|
|
31
31
|
private static _active;
|
|
32
32
|
static get active(): Scene2D | null;
|
|
33
|
+
/** Whether this host has the 2D engine. False on Web Lite (UI and 3D only) and in a 3d / core
|
|
34
|
+
* engine variant of an app built with `lecodes app`; there `new Scene2D()` throws. */
|
|
35
|
+
static get supported(): boolean;
|
|
33
36
|
readonly _touchStartListeners: Array<(ev: TouchStartEvent<Node2D | null>) => void>;
|
|
34
37
|
/** Texture filter to (re)assert on open(); the sampler is global, so each scene reclaims it. */
|
|
35
38
|
private readonly _filter?;
|
|
@@ -47,6 +50,9 @@ export declare class Scene2D implements Presentable {
|
|
|
47
50
|
removeEventListener(channel: "click" | "touchstart", callback: (ev: any) => void): void;
|
|
48
51
|
add(...nodes: Node2D[]): this;
|
|
49
52
|
remove(...nodes: Node2D[]): this;
|
|
53
|
+
/** class → instance, the authoritative store (named accessors mirror this). Kept in the public
|
|
54
|
+
* types: it is what makes a Scene2D a `SystemHost` there. */
|
|
55
|
+
readonly _systems: Map<Function, Aspect<any, any, any>>;
|
|
50
56
|
/** Attach (and configure) a system, or reconfigure it if already present. Returns the scene typed
|
|
51
57
|
* as now-having it (`scene.system(Hud).hud`). A 3D `System<'x'>` (target Scene) is rejected here. */
|
|
52
58
|
system<Self extends TargetOf<A>, A extends Aspect<any, any, any>>(this: Self, ctor: AspectCtor<A>, opts?: Partial<A>): Self & FieldOf<A>;
|
package/dist/types/gl/Scene.d.ts
CHANGED
|
@@ -157,6 +157,9 @@ export declare class Scene implements Presentable {
|
|
|
157
157
|
set postProcessing(_: never);
|
|
158
158
|
private static _active;
|
|
159
159
|
static get active(): Scene | null;
|
|
160
|
+
/** Whether this host has the 3D engine. False where the bundle was marked `gl: disable` (no scene
|
|
161
|
+
* created anywhere in it) and in a 2d / core engine variant; there `new Scene()` throws. */
|
|
162
|
+
static get supported(): boolean;
|
|
160
163
|
constructor(options?: SceneOptions);
|
|
161
164
|
/** Runtime form of `renderScale` / `dynamicResolution` (a graphics-settings menu). `renderScale`
|
|
162
165
|
* 0.25–1; older hosts without the method ignore it. */
|
|
@@ -199,6 +202,9 @@ export declare class Scene implements Presentable {
|
|
|
199
202
|
setStencil(enabled: boolean): void;
|
|
200
203
|
add(...list: Node[]): this;
|
|
201
204
|
remove(...list: Node[]): this;
|
|
205
|
+
/** class → instance, the authoritative store (named accessors mirror this). Kept in the public
|
|
206
|
+
* types: it is what makes a Scene a `SystemHost` there. */
|
|
207
|
+
readonly _systems: Map<Function, Aspect<any, any, any>>;
|
|
202
208
|
/** Attach (and configure) a system, or reconfigure it if already present. Returns the scene typed
|
|
203
209
|
* as now-having it (`scene.system(Hud).hud`). A `System<'x', Scene2D>` is rejected here. */
|
|
204
210
|
system<Self extends TargetOf<A>, A extends Aspect<any, any, any>>(this: Self, ctor: AspectCtor<A>, opts?: Partial<A>): Self & FieldOf<A>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type FetchResponse, type File } from "../runtime/fetch";
|
|
2
|
+
import type { Canvas } from "../canvas/Canvas";
|
|
2
3
|
/** `Texture.load` options. */
|
|
3
4
|
export type TextureLoadOptions = {
|
|
4
5
|
/** `true` (default): colour, stored sRGB. `false`: data (normal map, mask, heightmap) — kept linear. */
|
|
@@ -30,13 +31,7 @@ export declare class Texture {
|
|
|
30
31
|
/** Vertical wrap mode (V). */
|
|
31
32
|
wrapT: number;
|
|
32
33
|
constructor(width: number, height: number, id: Handle | number);
|
|
33
|
-
static fromCanvas(canvas:
|
|
34
|
-
_bakeSurface(): number;
|
|
35
|
-
width: number;
|
|
36
|
-
height: number;
|
|
37
|
-
pixelRatio: number;
|
|
38
|
-
_tex3dId: number;
|
|
39
|
-
}): Texture;
|
|
34
|
+
static fromCanvas(canvas: Canvas): Texture;
|
|
40
35
|
/** A texture from raw pixels: `channels` (1–4, default 4) UBYTE per pixel, row-major, `width ×
|
|
41
36
|
* height × channels` bytes; `srgb` (default true for colour) picks the sRGB internal format —
|
|
42
37
|
* pass false for data (a heightmap, a mask). No mips. Throws on a host without the call. */
|
|
@@ -48,6 +48,9 @@ export declare class DynamicBoneCollider extends Aspect<"dynamicBoneCollider", N
|
|
|
48
48
|
}
|
|
49
49
|
export declare class DynamicBone extends Aspect<"dynamicBone", Node> {
|
|
50
50
|
static readonly aspect = "dynamicBone";
|
|
51
|
+
/** Whether this host simulates dynamic bones. False, never a throw, on Web Lite and in headless
|
|
52
|
+
* tests; there the aspect attaches, warns once, and `chain` stays empty. */
|
|
53
|
+
static get supported(): boolean;
|
|
51
54
|
/** Only these bones (by name) join the chain — the root always does, a bone left out takes its
|
|
52
55
|
* subtree with it. Default: the root's whole subtree. */
|
|
53
56
|
bones?: string[];
|
|
@@ -179,6 +179,9 @@ export type LocomotionEvents = {
|
|
|
179
179
|
};
|
|
180
180
|
export declare class Locomotion extends Aspect<"loco", Node, LocomotionEvents> {
|
|
181
181
|
static readonly aspect = "loco";
|
|
182
|
+
/** Whether this host runs the locomotion selector. False, never a throw, on Web Lite and in
|
|
183
|
+
* headless tests; there the aspect attaches, warns once, and the body stays `'idle'`. */
|
|
184
|
+
static get supported(): boolean;
|
|
182
185
|
/** The animator whose clips are shown. Default: the first one on this node or under it (a Model
|
|
183
186
|
* child), which is the usual character — a capsule node with the model inside. */
|
|
184
187
|
animator?: Animator;
|
|
@@ -85,7 +85,8 @@ export declare class Physics extends Aspect<"physics", Node> implements CompWrit
|
|
|
85
85
|
applyImpulseAt(v: Vec3Like, point: Vec3Like): this;
|
|
86
86
|
/** Configure gravity / limits. Call once before creating bodies. */
|
|
87
87
|
static configure(config?: PhysicsConfig): void;
|
|
88
|
-
/** Whether this
|
|
88
|
+
/** Whether this host has 3D physics (an engine built with CREATOR_GL_PHYSICS). False, never a
|
|
89
|
+
* throw, where there is no 3D engine at all. */
|
|
89
90
|
static get supported(): boolean;
|
|
90
91
|
/** Closest pickable body hit by the ray from `origin` along `dir` (up to `maxDist`), or null. */
|
|
91
92
|
static raycast(origin: Vec3Like, dir: Vec3Like, maxDist?: number): RayHit | null;
|
|
@@ -60,6 +60,10 @@ export interface RagdollHitOptions {
|
|
|
60
60
|
}
|
|
61
61
|
export declare class Ragdoll extends Aspect<"ragdoll", Node> {
|
|
62
62
|
static readonly aspect = "ragdoll";
|
|
63
|
+
/** Whether this host can drop a body: 3D physics with ragdoll parts. False, never a throw,
|
|
64
|
+
* without physics or on an older host. A host that has it can still refuse the parts
|
|
65
|
+
* (`activate()` returns false). */
|
|
66
|
+
static get supported(): boolean;
|
|
63
67
|
/** The parts: `'humanoid'` (default) finds the standard bones by name; a list places bodies on any
|
|
64
68
|
* bones — parents before children. */
|
|
65
69
|
parts: RagdollPart[] | "humanoid";
|
|
@@ -127,6 +127,10 @@ export interface AeroConfig {
|
|
|
127
127
|
}
|
|
128
128
|
export declare class Vehicle extends Aspect<"vehicle", Node> {
|
|
129
129
|
static readonly aspect = "vehicle";
|
|
130
|
+
/** Whether this host can drive a car: 3D physics with the vehicle model. False, never a throw,
|
|
131
|
+
* without physics or on an older host. A host that has it can still refuse a car's settings
|
|
132
|
+
* (`id` stays 0, with a warning). */
|
|
133
|
+
static get supported(): boolean;
|
|
130
134
|
/** Chassis mass in kg (default 1200). Wheels are massless in this model. */
|
|
131
135
|
mass: number;
|
|
132
136
|
/** Centre of mass height in chassis space (metres, negative = lower). Left out, it drops to halfway
|
package/dist/types/inject.d.ts
CHANGED
|
@@ -43,8 +43,10 @@ export declare const app: {
|
|
|
43
43
|
sdkVersion: string;
|
|
44
44
|
/** The INSTALLED app: the store build this bundle runs in. After an over-the-air update the code
|
|
45
45
|
* is newer than the binary, so a feature that needs native support added in a later store build
|
|
46
|
-
* (a plugin, an SDK method) branches on `app.host.sdk` / `app.host.build` — and on
|
|
47
|
-
*
|
|
46
|
+
* (a plugin, an SDK method) branches on `app.host.sdk` / `app.host.build` — and on the feature's
|
|
47
|
+
* own check (`Push.isSupported`, `Physics.supported`), which is the final word. Not `typeof` of
|
|
48
|
+
* the global: every SDK wrapper is compiled into the bundle, so `typeof Push` is "object" on a
|
|
49
|
+
* host without the plugin. Minor and patch of the SDK never gate anything. */
|
|
48
50
|
readonly host: AppHost;
|
|
49
51
|
/** The RUNNING code: what the compiler stamped into this bundle's header. `updatedAt` is the
|
|
50
52
|
* compile time — what the updater compares before replacing a bundle (an older one never
|
|
@@ -12,6 +12,9 @@ export interface FetchResponse {
|
|
|
12
12
|
readonly status: number;
|
|
13
13
|
json<T = any>(): T;
|
|
14
14
|
text(): string;
|
|
15
|
+
/** The body's bytes, a copy — a binary format of your own (`asset('./levels/1.bin')`), parsed in
|
|
16
|
+
* code with a DataView. Synchronous, like `text()`. */
|
|
17
|
+
bytes(): Uint8Array;
|
|
15
18
|
/** @deprecated A no-op: the body is freed with the response's handle (owned handles). Apps written
|
|
16
19
|
* against the pre-owned SDK still call it after `text()` / `json()`; remove the call. */
|
|
17
20
|
dispose(): void;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
declare const methods: {
|
|
2
2
|
getItem(key: string): string | null;
|
|
3
3
|
setItem(key: string, value: string): void;
|
|
4
4
|
removeItem(key: string): void;
|
|
5
5
|
};
|
|
6
|
+
export type LocalStorage = typeof methods & {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
export declare const localStorage: LocalStorage;
|
|
10
|
+
export {};
|
|
@@ -188,7 +188,13 @@ export type AggregateResult<TModel, T> = (T extends {
|
|
|
188
188
|
max: (F extends keyof TModel ? TModel[F] : never) | null;
|
|
189
189
|
} : {});
|
|
190
190
|
declare const __op: unique symbol;
|
|
191
|
-
|
|
191
|
+
/** What a query or an op offers of a promise: `then`, `catch`, `finally` — the runtime object has
|
|
192
|
+
* all three (`op()` / the collection builder below), so `db.x.insert(…).catch(…)` type-checks. */
|
|
193
|
+
export type Settles<T> = PromiseLike<T> & {
|
|
194
|
+
catch<R = never>(onRejected?: ((reason: any) => R | PromiseLike<R>) | null): Promise<T | R>;
|
|
195
|
+
finally(onFinally?: (() => void) | null): Promise<T>;
|
|
196
|
+
};
|
|
197
|
+
export type Op<T> = Settles<T> & {
|
|
192
198
|
readonly [__op]: T;
|
|
193
199
|
};
|
|
194
200
|
export type MarciOp = {
|
|
@@ -251,7 +257,7 @@ export type IdArg<I> = I | BareId<I>;
|
|
|
251
257
|
* it to `$transaction` batches it; placing it in another query's select makes it a sub-select. `Sel` is the
|
|
252
258
|
* projection: id + scalars until `select(...)` sets a shape.
|
|
253
259
|
*/
|
|
254
|
-
export interface Query<T extends ModelTypes, Sel = T["scalars"]> extends
|
|
260
|
+
export interface Query<T extends ModelTypes, Sel = T["scalars"]> extends Settles<Rows<T, Sel>[]> {
|
|
255
261
|
readonly [__op]: Rows<T, Sel>[];
|
|
256
262
|
readonly [__sub]: T["name"];
|
|
257
263
|
readonly [__sel]: Effective<T, Sel>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ClickEvent as ClickEventType, TouchStartEvent as TouchStartEventType, LongPressEvent as LongPressEventType, MouseEnterEvent as MouseEnterEventType } from "../runtime/touch";
|
|
2
|
-
import { type ElementStyle, type ContainerStyle, type DrawableStyle, type UIChildArg, type UIContainerBase, type UINodeChild, type ChildrenFn, type BaseStyle, type Color } from "./UINode";
|
|
3
|
-
export type UIButtonStyle = ElementStyle & DrawableStyle & ContainerStyle & {
|
|
2
|
+
import { type ElementStyle, type ContainerStyle, type DrawableStyle, type TextStyle, type UIChildArg, type UIContainerBase, type UINodeChild, type ChildrenFn, type BaseStyle, type Color } from "./UINode";
|
|
3
|
+
export type UIButtonStyle = ElementStyle & DrawableStyle & ContainerStyle & TextStyle & {
|
|
4
4
|
rippleColor?: Color | "default";
|
|
5
5
|
};
|
|
6
6
|
/** A tappable container — row + centered children by default. Press feedback via the `$pressed`
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { type ChildrenFn, type ContainerStyle, type DrawableStyle, type ElementStyle, type UIChildArg, type UIContainerBase, type UINodeChild } from "./UINode";
|
|
2
|
-
|
|
1
|
+
import { type ChildrenFn, type ContainerStyle, type DrawableStyle, type ElementStyle, type TextStyle, type UIChildArg, type UIContainerBase, type UINodeChild } from "./UINode";
|
|
2
|
+
/** A container's style: its box and layout, plus the text props (`color`, `fontSize`, `textWrap` …)
|
|
3
|
+
* the texts inside inherit from it. */
|
|
4
|
+
export type UIContainerStyle = ElementStyle & DrawableStyle & ContainerStyle & TextStyle;
|
|
3
5
|
/** A vertical flex container — children stack top to bottom. */
|
|
4
6
|
export interface UIColumn extends UIContainerBase<UIContainerStyle> {
|
|
5
7
|
readonly type: "column";
|
|
@@ -73,7 +73,7 @@ export type DrawableStyle = {
|
|
|
73
73
|
};
|
|
74
74
|
/** Flex-layout props of a container (how it lays out its children). */
|
|
75
75
|
export type ContainerStyle = {
|
|
76
|
-
flexDirection?: "row" | "column";
|
|
76
|
+
flexDirection?: "row" | "column" | "row-reverse" | "column-reverse";
|
|
77
77
|
justifyContent?: "flex-start" | "center" | "flex-end" | "space-between" | "space-evenly";
|
|
78
78
|
alignItems?: "flex-start" | "center" | "flex-end" | "stretch";
|
|
79
79
|
gap?: UIValue;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TouchStartEvent } from "../runtime/touch";
|
|
2
2
|
import { type DismissOptions, type PresentOptions } from "./presentable";
|
|
3
|
-
import { ContainerElement, type BaseStyle, type ContainerStyle, type DrawableStyle, type PaddingStyle, type UIChildArg, type UIContainerBase, type UINodeChild, type ChildrenFn } from "./UINode";
|
|
3
|
+
import { ContainerElement, type BaseStyle, type ContainerStyle, type DrawableStyle, type PaddingStyle, type TextStyle, type UIChildArg, type UIContainerBase, type UINodeChild, type ChildrenFn } from "./UINode";
|
|
4
4
|
import { type WidgetHost, type WidgetSet } from "./UILayer";
|
|
5
|
-
export type UIScreenStyle = ContainerStyle & DrawableStyle & PaddingStyle & BaseStyle;
|
|
5
|
+
export type UIScreenStyle = ContainerStyle & DrawableStyle & PaddingStyle & BaseStyle & TextStyle;
|
|
6
6
|
/** A screen — the root the router/host mounts, sized to its slot. A screen NEVER scrolls: it is
|
|
7
7
|
* fixed chrome (header, tab bar) plus, when the content overflows, one `UIScrollable` body child
|
|
8
8
|
* (`flexGrow: 1`). Scroll events and pull-to-refresh live on the scroll containers
|
|
@@ -9,8 +9,9 @@ export type UIVideoStyle = ElementStyle & DrawableStyle & {
|
|
|
9
9
|
* fullscreen-presentable (`open()`), with seamless promotion between the two. */
|
|
10
10
|
export interface UIVideo extends UIElementBase<UIVideoStyle, DrawableStyle & BaseStyle> {
|
|
11
11
|
readonly type: "video";
|
|
12
|
-
/** The player driving this surface (playback control lives on it).
|
|
13
|
-
|
|
12
|
+
/** The player driving this surface (playback control lives on it). Read-only: a surface is made
|
|
13
|
+
* for its player (`UIVideo(player)`). */
|
|
14
|
+
readonly player: VideoPlayer;
|
|
14
15
|
/** Show fullscreen as the current destination. Promotion: if this video is mounted in a screen,
|
|
15
16
|
* the SAME native player moves fullscreen — playback uninterrupted; a pop moves it back. */
|
|
16
17
|
open(options?: PresentOptions): void;
|
|
@@ -23,7 +23,7 @@ export type PopOptions = {
|
|
|
23
23
|
* the router until `restore()`. */
|
|
24
24
|
type Router = {
|
|
25
25
|
/** The top of the router stack (not necessarily what's on screen — see `Presentable.current`). */
|
|
26
|
-
get current(): Presentable;
|
|
26
|
+
get current(): Presentable | null;
|
|
27
27
|
/** Mount the router with `homePage` as the stack root — the app's navigation entry point. */
|
|
28
28
|
init(homePage: Presentable, opts?: RouterOptions): void;
|
|
29
29
|
/** Push a destination onto the stack — a `UIScreen`, a `Scene`, a `Scene2D`, a `NativeView`,
|
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.13";
|
|
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
|