@thestatic-tv/dcl-sdk 2.11.2 → 2.13.0
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/README.md +45 -0
- package/dist/index.d.mts +127 -2
- package/dist/index.d.ts +127 -2
- package/dist/index.js +609 -347
- package/dist/index.mjs +562 -300
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -105,6 +105,51 @@ staticTV.guideUI.toggle()
|
|
|
105
105
|
staticTV.chatUI.toggle()
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
+
## The toolbar on a phone (2.12.0; 2.13.0 places it)
|
|
109
|
+
|
|
110
|
+
On a phone the explorer draws its own controls over the bottom right, where the toolbar sits. So
|
|
111
|
+
on a phone (the explorer says `mobile`, read once at start) CHAT, GUIDE and ADMIN stand in a
|
|
112
|
+
column flush on the right edge at mid-height, every panel opens centered on the screen's height
|
|
113
|
+
just left of the column, and only one panel is open at a time. On desktop, VR and the web nothing
|
|
114
|
+
changes: the row along the bottom right, the panels where they were, and the guide and the admin
|
|
115
|
+
panel still the only two that close each other.
|
|
116
|
+
|
|
117
|
+
`staticTV.platform` is `'desktop'`, `'mobile'`, `'vr'`, `'web'`, or `'unknown'` until the explorer
|
|
118
|
+
answers (and if it cannot); `staticTV.isPhone` is true on a phone only.
|
|
119
|
+
|
|
120
|
+
A scene's own buttons and panels join the same layout and the same rule:
|
|
121
|
+
|
|
122
|
+
```typescript
|
|
123
|
+
// The button: slot 0 is CHAT's, 1 GUIDE's, 2 ADMIN's (a non-admin has none, so a scene button
|
|
124
|
+
// may take it), then the scene's own. The row on desktop, the column on a phone.
|
|
125
|
+
staticTV.toolbarButton(3, {
|
|
126
|
+
uiTransform: { justifyContent: 'center', alignItems: 'center' },
|
|
127
|
+
uiBackground: { color: Color4.create(0.2, 0.4, 0.2, 0.9) },
|
|
128
|
+
onMouseDown: () => myPanel.toggle(),
|
|
129
|
+
children: [ReactEcs.createElement(UiEntity, { uiText: { value: 'MAP', fontSize: 14 } })],
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
// The panel (2.13.0): its props as on desktop, place included. On desktop it is drawn as they say;
|
|
133
|
+
// on a phone it opens centered on the screen's height just left of the column, and a panel taller
|
|
134
|
+
// than the screen starts at the top, so its header and its close button stay on screen.
|
|
135
|
+
myPanel.isOpen ? staticTV.toolbarPanel({
|
|
136
|
+
uiTransform: { positionType: 'absolute', position: { right: 20, bottom: 55 }, width: 380, height: 580 },
|
|
137
|
+
uiBackground: { color: Color4.create(0.05, 0.05, 0.08, 0.98) },
|
|
138
|
+
children: [header, body],
|
|
139
|
+
}) : null
|
|
140
|
+
|
|
141
|
+
// One panel at a time on a phone: register how yours hides, and say when it opens. On desktop
|
|
142
|
+
// (2.13.0) coversGuide says your panel sits over the guide's place: opening it closes the guide
|
|
143
|
+
// and the admin panel, and opening either closes yours.
|
|
144
|
+
staticTV.registerPanel('map', () => myPanel.hide(), { coversGuide: true })
|
|
145
|
+
myPanel.onOpen = () => staticTV.panelOpened('map')
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
On desktop a panel closes any panel it would cover: the guide and the admin panel close each
|
|
149
|
+
other, a `coversGuide` panel and those two close each other, and the chat stays open beside the
|
|
150
|
+
guide or the admin panel. A panel registered without the option is left to the scene there. The
|
|
151
|
+
names `guide`, `chat` and `admin` are the SDK's.
|
|
152
|
+
|
|
108
153
|
## 18+ channels (2.8.0)
|
|
109
154
|
|
|
110
155
|
18+ channels are in the lineup with the rest: each 18+ channel and each of its VODs carries
|
package/dist/index.d.mts
CHANGED
|
@@ -1487,6 +1487,8 @@ declare class AdminPanelUIModule {
|
|
|
1487
1487
|
* Uses same layout as NotificationBanner but with scaled font size
|
|
1488
1488
|
*/
|
|
1489
1489
|
private renderScaledNotification;
|
|
1490
|
+
/** The ADMIN / CLOSE button itself; its place is the row's or, on a phone, the column's (2.12.0) */
|
|
1491
|
+
private renderToggleFace;
|
|
1490
1492
|
/**
|
|
1491
1493
|
* Get the React-ECS component for the admin panel
|
|
1492
1494
|
* Always renders notification (scaled), admin panel only for admins
|
|
@@ -1494,6 +1496,62 @@ declare class AdminPanelUIModule {
|
|
|
1494
1496
|
getComponent: () => ReactEcs.JSX.Element | null;
|
|
1495
1497
|
}
|
|
1496
1498
|
|
|
1499
|
+
/**
|
|
1500
|
+
* The toolbar and the panels on a phone (2.12.0, 2026-12-01). Pure: no Decentraland import, so the
|
|
1501
|
+
* suite reads it directly (tests/phone-toolbar.test.ts).
|
|
1502
|
+
*
|
|
1503
|
+
* WHY. On a phone the explorer draws its own controls over the bottom right, where the SDK's
|
|
1504
|
+
* buttons sit (CHAT, GUIDE, ADMIN, and a scene's own beside them): Joseph's find on his phone,
|
|
1505
|
+
* 2026-11-30. His call: on a phone the buttons stand in a column on the right edge at mid-height,
|
|
1506
|
+
* clear of the joystick and dance bottom left, E, the hand and jump bottom right, the profile and
|
|
1507
|
+
* chat top left; the panels open to the column's left, and one panel is open at a time.
|
|
1508
|
+
*
|
|
1509
|
+
* Desktop, VR, the web and an unknown platform keep the row every version drew, unchanged: slot 0
|
|
1510
|
+
* at right 20, bottom 10, each next slot one scaled button width plus 10 further left. Only a
|
|
1511
|
+
* phone ("mobile", from ~system/Runtime getExplorerInformation) gets the column.
|
|
1512
|
+
*
|
|
1513
|
+
* Slots: 0 is CHAT's, 1 GUIDE's, 2 ADMIN's (an admin's only; a scene's own button takes it for
|
|
1514
|
+
* everyone else), then a scene's own. In the column, slot 0 is on top and the column's middle slot
|
|
1515
|
+
* (2) sits at mid-height, so the SDK's three and two of a scene's center on the screen.
|
|
1516
|
+
*
|
|
1517
|
+
* 2.13.0 (his look on his phone, 2026-12-01, Decentraland mobile 1.16.3): the column stood about 160
|
|
1518
|
+
* px in from the glass while the explorer's own jump button ends about 135 px in, so the scene's
|
|
1519
|
+
* canvas already ends at the device's safe edge and the 2.12.0 edge of 20 only added a gap. On a
|
|
1520
|
+
* phone the column now sits flush on the canvas's right edge (PHONE_EDGE, 0); nothing is drawn
|
|
1521
|
+
* outside the canvas. And a panel on a phone opens centered on the screen's height, one gap left of
|
|
1522
|
+
* the column (src/ui/toolbar-panel.ts), where 2.12.0 kept the desktop's bottom 55 and covered the
|
|
1523
|
+
* phone's E, hand and jump buttons. His words: "Buttons should be in the edge and windows should
|
|
1524
|
+
* open middle of screen next to buttons."
|
|
1525
|
+
*/
|
|
1526
|
+
type Platform = 'desktop' | 'mobile' | 'vr' | 'web' | 'unknown';
|
|
1527
|
+
/** How a scene's panel sits among the SDK's on desktop (registerPanel's options, 2.13.0) */
|
|
1528
|
+
interface PanelOptions {
|
|
1529
|
+
/**
|
|
1530
|
+
* The panel covers the guide's place (the guide's and the admin panel's): on desktop opening it closes them, and
|
|
1531
|
+
* opening either closes it. On a phone every panel closes every other one anyway.
|
|
1532
|
+
*/
|
|
1533
|
+
coversGuide?: boolean;
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
/** A toolbar button's face: what a UiEntity takes, its place and size left to the slot */
|
|
1537
|
+
interface ToolbarButtonProps {
|
|
1538
|
+
/** Extra layout for the face (justifyContent, alignItems...); a width or height here wins */
|
|
1539
|
+
uiTransform?: Record<string, unknown>;
|
|
1540
|
+
uiBackground?: unknown;
|
|
1541
|
+
onMouseDown?: () => void;
|
|
1542
|
+
children?: unknown[];
|
|
1543
|
+
[prop: string]: unknown;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
/** A panel's props, as its desktop UiEntity takes them (key, uiTransform with its place, uiBackground, children) */
|
|
1547
|
+
interface ToolbarPanelProps {
|
|
1548
|
+
key?: string | number;
|
|
1549
|
+
uiTransform?: Record<string, unknown>;
|
|
1550
|
+
uiBackground?: unknown;
|
|
1551
|
+
children?: unknown[];
|
|
1552
|
+
[prop: string]: unknown;
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1497
1555
|
/**
|
|
1498
1556
|
* StaticTVClient - Main client for connecting DCL scenes to thestatic.tv
|
|
1499
1557
|
*
|
|
@@ -1551,6 +1609,15 @@ declare class StaticTVClient {
|
|
|
1551
1609
|
private readonly streamLink;
|
|
1552
1610
|
/** UI scale - fixed at 1.0. DCL's UI system auto-scales based on viewport. */
|
|
1553
1611
|
readonly uiScale: number;
|
|
1612
|
+
/** The explorer's platform, read once at construction (2.12.0); unknown until it answers, and if it cannot */
|
|
1613
|
+
private _platform;
|
|
1614
|
+
/**
|
|
1615
|
+
* Which panels close when one opens (2.12.0, src/ui/toolbar.ts): on a phone every other one, the SDK's and a
|
|
1616
|
+
* scene's (registerPanel); elsewhere the guide and the admin panel close each other, as before.
|
|
1617
|
+
*/
|
|
1618
|
+
private readonly panelRules;
|
|
1619
|
+
/** The SDK's own panels, which a scene cannot register over */
|
|
1620
|
+
private static readonly OWN_PANELS;
|
|
1554
1621
|
/** Get the API base URL (for internal module use) */
|
|
1555
1622
|
getBaseUrl(): string;
|
|
1556
1623
|
/**
|
|
@@ -1969,10 +2036,68 @@ declare class StaticTVClient {
|
|
|
1969
2036
|
openFrame(id: string): void;
|
|
1970
2037
|
/**
|
|
1971
2038
|
* Close Admin/Guide panels (they share the same screen space)
|
|
1972
|
-
* Chat is independent and stays open.
|
|
2039
|
+
* Chat is independent and stays open. On a phone (2.12.0) every other panel closes: the same as panelOpened().
|
|
1973
2040
|
* @param except The panel that should stay open: 'admin' | 'guide'
|
|
1974
2041
|
*/
|
|
1975
2042
|
closeOtherPanels(except: 'admin' | 'guide'): void;
|
|
2043
|
+
/** Ask the explorer which platform this is, once; a failed or missing call leaves it unknown (the desktop layout) */
|
|
2044
|
+
private readPlatform;
|
|
2045
|
+
/** The explorer's platform: 'desktop', 'mobile', 'vr', 'web', or 'unknown' until it answers (and if it cannot) */
|
|
2046
|
+
get platform(): Platform;
|
|
2047
|
+
/** A phone: the toolbar stands in a column on the right edge, panels open to its left, one at a time */
|
|
2048
|
+
get isPhone(): boolean;
|
|
2049
|
+
/**
|
|
2050
|
+
* Draw one of the scene's own toolbar buttons in its slot: the row along the bottom right on desktop (where a scene
|
|
2051
|
+
* placed its own by hand before), the column on a phone. Slots count from the right (the row) or the top (the
|
|
2052
|
+
* column): 0 is CHAT's, 1 GUIDE's, 2 ADMIN's (for a non-admin the scene's first button may take it), then the
|
|
2053
|
+
* scene's. `props` is the button's face - its uiBackground, onMouseDown and children - the slot gives its place and
|
|
2054
|
+
* size (a width or height in props.uiTransform wins).
|
|
2055
|
+
*
|
|
2056
|
+
* @example
|
|
2057
|
+
* ```typescript
|
|
2058
|
+
* staticTV.toolbarButton(3, {
|
|
2059
|
+
* uiTransform: { justifyContent: 'center', alignItems: 'center' },
|
|
2060
|
+
* uiBackground: { color: Color4.create(0.2, 0.4, 0.2, 0.9) },
|
|
2061
|
+
* onMouseDown: () => myPanel.toggle(),
|
|
2062
|
+
* children: [ReactEcs.createElement(UiEntity, { uiText: { value: 'MAP', fontSize: 14 } })],
|
|
2063
|
+
* })
|
|
2064
|
+
* ```
|
|
2065
|
+
*/
|
|
2066
|
+
toolbarButton(slot: number, props: ToolbarButtonProps): any;
|
|
2067
|
+
/** Where a scene's own panel's right edge goes: on a phone one gap left of the column; elsewhere `desktopRight` */
|
|
2068
|
+
panelRight(desktopRight: number): number;
|
|
2069
|
+
/**
|
|
2070
|
+
* Draw one of the scene's own panels in its place (2.13.0): on desktop exactly as `props` say (their absolute
|
|
2071
|
+
* position included), on a phone centered on the screen's height one gap left of the toolbar's column, its top at
|
|
2072
|
+
* (canvas height - panel height) / 2 - or at the canvas's top when the panel is taller, so its header and close
|
|
2073
|
+
* button stay on screen. `props` is the panel's UiEntity props as on desktop: key, uiTransform, uiBackground,
|
|
2074
|
+
* children. The SDK's own chat, guide and admin panel draw through it.
|
|
2075
|
+
*
|
|
2076
|
+
* @example
|
|
2077
|
+
* ```typescript
|
|
2078
|
+
* myPanel.isOpen ? staticTV.toolbarPanel({
|
|
2079
|
+
* uiTransform: { positionType: 'absolute', position: { right: 20, bottom: 55 }, width: 380, height: 580 },
|
|
2080
|
+
* uiBackground: { color: Color4.create(0.05, 0.05, 0.08, 0.98) },
|
|
2081
|
+
* children: [header, body],
|
|
2082
|
+
* }) : null
|
|
2083
|
+
* ```
|
|
2084
|
+
*/
|
|
2085
|
+
toolbarPanel(props: ToolbarPanelProps): any;
|
|
2086
|
+
/**
|
|
2087
|
+
* Put one of the scene's own panels under the panel rule: on a phone, when another panel opens (the SDK's or the
|
|
2088
|
+
* scene's), `hide` runs. On desktop (2.13.0), with `{ coversGuide: true }`, the panel and the guide's place close
|
|
2089
|
+
* each other: opening it closes the guide and the admin panel, and opening either runs `hide`; without it, the SDK
|
|
2090
|
+
* leaves the panel to the scene there. The SDK's own names (guide, chat, admin) are taken. Call panelOpened(name)
|
|
2091
|
+
* when it opens.
|
|
2092
|
+
*/
|
|
2093
|
+
registerPanel(name: string, hide: () => void, options?: PanelOptions): void;
|
|
2094
|
+
/**
|
|
2095
|
+
* A panel opened: on a phone every other one closes, the SDK's and the scene's registered ones. Elsewhere a panel
|
|
2096
|
+
* closes any panel it would cover: the guide and the admin panel close each other, and each closes a scene's panel
|
|
2097
|
+
* registered with coversGuide, as that panel closes them (2.13.0); the chat stays open beside the guide or the admin
|
|
2098
|
+
* panel, and a scene's other panels are left to the scene.
|
|
2099
|
+
*/
|
|
2100
|
+
panelOpened(name: string): void;
|
|
1976
2101
|
/**
|
|
1977
2102
|
* Set up the UI renderer for all SDK panels
|
|
1978
2103
|
* Call this in your scene's main() function to render Guide, Chat, Admin panels.
|
|
@@ -2120,4 +2245,4 @@ declare function getPlayerPosition(): {
|
|
|
2120
2245
|
z: number;
|
|
2121
2246
|
} | null;
|
|
2122
2247
|
|
|
2123
|
-
export { type AdminPanelConfig, AdminPanelUIModule, type Channel, type ChatChannel, type ChatMessage, type ChatUIConfig, ChatUIModule, type CommandHandler, type FrameContent, FramesModule, type GuideFeaturedPlaylist, GuideModule, type GuideResponse, type GuideUIConfig, GuideUIModule, type GuideVideo, HeartbeatModule, type HeartbeatResponse, type InteractionResponse, InteractionsModule, KEY_TYPE_CHANNEL, KEY_TYPE_SCENE, ModerationModule, NotificationBanner, type PlayerData, type SDKTier, type SceneBounds$1 as SceneBounds, type SceneControl, type SceneControlOption, type SceneFrame, type SceneStats, type SceneStatsResponse, type SceneTabDefinition, SessionModule, type SessionResponse, type Standing, StaticTVClient, type StaticTVConfig, type StreamData, type VideoSlot, type Vod, fetchUserData, getParcelRects, getPlayerDisplayName, getPlayerPosition, getPlayerWallet, getSceneBounds, hideNotification, isPlayerInBounds, setupStaticUI, showNotification };
|
|
2248
|
+
export { type AdminPanelConfig, AdminPanelUIModule, type Channel, type ChatChannel, type ChatMessage, type ChatUIConfig, ChatUIModule, type CommandHandler, type FrameContent, FramesModule, type GuideFeaturedPlaylist, GuideModule, type GuideResponse, type GuideUIConfig, GuideUIModule, type GuideVideo, HeartbeatModule, type HeartbeatResponse, type InteractionResponse, InteractionsModule, KEY_TYPE_CHANNEL, KEY_TYPE_SCENE, ModerationModule, NotificationBanner, type PanelOptions, type Platform, type PlayerData, type SDKTier, type SceneBounds$1 as SceneBounds, type SceneControl, type SceneControlOption, type SceneFrame, type SceneStats, type SceneStatsResponse, type SceneTabDefinition, SessionModule, type SessionResponse, type Standing, StaticTVClient, type StaticTVConfig, type StreamData, type ToolbarButtonProps, type ToolbarPanelProps, type VideoSlot, type Vod, fetchUserData, getParcelRects, getPlayerDisplayName, getPlayerPosition, getPlayerWallet, getSceneBounds, hideNotification, isPlayerInBounds, setupStaticUI, showNotification };
|
package/dist/index.d.ts
CHANGED
|
@@ -1487,6 +1487,8 @@ declare class AdminPanelUIModule {
|
|
|
1487
1487
|
* Uses same layout as NotificationBanner but with scaled font size
|
|
1488
1488
|
*/
|
|
1489
1489
|
private renderScaledNotification;
|
|
1490
|
+
/** The ADMIN / CLOSE button itself; its place is the row's or, on a phone, the column's (2.12.0) */
|
|
1491
|
+
private renderToggleFace;
|
|
1490
1492
|
/**
|
|
1491
1493
|
* Get the React-ECS component for the admin panel
|
|
1492
1494
|
* Always renders notification (scaled), admin panel only for admins
|
|
@@ -1494,6 +1496,62 @@ declare class AdminPanelUIModule {
|
|
|
1494
1496
|
getComponent: () => ReactEcs.JSX.Element | null;
|
|
1495
1497
|
}
|
|
1496
1498
|
|
|
1499
|
+
/**
|
|
1500
|
+
* The toolbar and the panels on a phone (2.12.0, 2026-12-01). Pure: no Decentraland import, so the
|
|
1501
|
+
* suite reads it directly (tests/phone-toolbar.test.ts).
|
|
1502
|
+
*
|
|
1503
|
+
* WHY. On a phone the explorer draws its own controls over the bottom right, where the SDK's
|
|
1504
|
+
* buttons sit (CHAT, GUIDE, ADMIN, and a scene's own beside them): Joseph's find on his phone,
|
|
1505
|
+
* 2026-11-30. His call: on a phone the buttons stand in a column on the right edge at mid-height,
|
|
1506
|
+
* clear of the joystick and dance bottom left, E, the hand and jump bottom right, the profile and
|
|
1507
|
+
* chat top left; the panels open to the column's left, and one panel is open at a time.
|
|
1508
|
+
*
|
|
1509
|
+
* Desktop, VR, the web and an unknown platform keep the row every version drew, unchanged: slot 0
|
|
1510
|
+
* at right 20, bottom 10, each next slot one scaled button width plus 10 further left. Only a
|
|
1511
|
+
* phone ("mobile", from ~system/Runtime getExplorerInformation) gets the column.
|
|
1512
|
+
*
|
|
1513
|
+
* Slots: 0 is CHAT's, 1 GUIDE's, 2 ADMIN's (an admin's only; a scene's own button takes it for
|
|
1514
|
+
* everyone else), then a scene's own. In the column, slot 0 is on top and the column's middle slot
|
|
1515
|
+
* (2) sits at mid-height, so the SDK's three and two of a scene's center on the screen.
|
|
1516
|
+
*
|
|
1517
|
+
* 2.13.0 (his look on his phone, 2026-12-01, Decentraland mobile 1.16.3): the column stood about 160
|
|
1518
|
+
* px in from the glass while the explorer's own jump button ends about 135 px in, so the scene's
|
|
1519
|
+
* canvas already ends at the device's safe edge and the 2.12.0 edge of 20 only added a gap. On a
|
|
1520
|
+
* phone the column now sits flush on the canvas's right edge (PHONE_EDGE, 0); nothing is drawn
|
|
1521
|
+
* outside the canvas. And a panel on a phone opens centered on the screen's height, one gap left of
|
|
1522
|
+
* the column (src/ui/toolbar-panel.ts), where 2.12.0 kept the desktop's bottom 55 and covered the
|
|
1523
|
+
* phone's E, hand and jump buttons. His words: "Buttons should be in the edge and windows should
|
|
1524
|
+
* open middle of screen next to buttons."
|
|
1525
|
+
*/
|
|
1526
|
+
type Platform = 'desktop' | 'mobile' | 'vr' | 'web' | 'unknown';
|
|
1527
|
+
/** How a scene's panel sits among the SDK's on desktop (registerPanel's options, 2.13.0) */
|
|
1528
|
+
interface PanelOptions {
|
|
1529
|
+
/**
|
|
1530
|
+
* The panel covers the guide's place (the guide's and the admin panel's): on desktop opening it closes them, and
|
|
1531
|
+
* opening either closes it. On a phone every panel closes every other one anyway.
|
|
1532
|
+
*/
|
|
1533
|
+
coversGuide?: boolean;
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
/** A toolbar button's face: what a UiEntity takes, its place and size left to the slot */
|
|
1537
|
+
interface ToolbarButtonProps {
|
|
1538
|
+
/** Extra layout for the face (justifyContent, alignItems...); a width or height here wins */
|
|
1539
|
+
uiTransform?: Record<string, unknown>;
|
|
1540
|
+
uiBackground?: unknown;
|
|
1541
|
+
onMouseDown?: () => void;
|
|
1542
|
+
children?: unknown[];
|
|
1543
|
+
[prop: string]: unknown;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
/** A panel's props, as its desktop UiEntity takes them (key, uiTransform with its place, uiBackground, children) */
|
|
1547
|
+
interface ToolbarPanelProps {
|
|
1548
|
+
key?: string | number;
|
|
1549
|
+
uiTransform?: Record<string, unknown>;
|
|
1550
|
+
uiBackground?: unknown;
|
|
1551
|
+
children?: unknown[];
|
|
1552
|
+
[prop: string]: unknown;
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1497
1555
|
/**
|
|
1498
1556
|
* StaticTVClient - Main client for connecting DCL scenes to thestatic.tv
|
|
1499
1557
|
*
|
|
@@ -1551,6 +1609,15 @@ declare class StaticTVClient {
|
|
|
1551
1609
|
private readonly streamLink;
|
|
1552
1610
|
/** UI scale - fixed at 1.0. DCL's UI system auto-scales based on viewport. */
|
|
1553
1611
|
readonly uiScale: number;
|
|
1612
|
+
/** The explorer's platform, read once at construction (2.12.0); unknown until it answers, and if it cannot */
|
|
1613
|
+
private _platform;
|
|
1614
|
+
/**
|
|
1615
|
+
* Which panels close when one opens (2.12.0, src/ui/toolbar.ts): on a phone every other one, the SDK's and a
|
|
1616
|
+
* scene's (registerPanel); elsewhere the guide and the admin panel close each other, as before.
|
|
1617
|
+
*/
|
|
1618
|
+
private readonly panelRules;
|
|
1619
|
+
/** The SDK's own panels, which a scene cannot register over */
|
|
1620
|
+
private static readonly OWN_PANELS;
|
|
1554
1621
|
/** Get the API base URL (for internal module use) */
|
|
1555
1622
|
getBaseUrl(): string;
|
|
1556
1623
|
/**
|
|
@@ -1969,10 +2036,68 @@ declare class StaticTVClient {
|
|
|
1969
2036
|
openFrame(id: string): void;
|
|
1970
2037
|
/**
|
|
1971
2038
|
* Close Admin/Guide panels (they share the same screen space)
|
|
1972
|
-
* Chat is independent and stays open.
|
|
2039
|
+
* Chat is independent and stays open. On a phone (2.12.0) every other panel closes: the same as panelOpened().
|
|
1973
2040
|
* @param except The panel that should stay open: 'admin' | 'guide'
|
|
1974
2041
|
*/
|
|
1975
2042
|
closeOtherPanels(except: 'admin' | 'guide'): void;
|
|
2043
|
+
/** Ask the explorer which platform this is, once; a failed or missing call leaves it unknown (the desktop layout) */
|
|
2044
|
+
private readPlatform;
|
|
2045
|
+
/** The explorer's platform: 'desktop', 'mobile', 'vr', 'web', or 'unknown' until it answers (and if it cannot) */
|
|
2046
|
+
get platform(): Platform;
|
|
2047
|
+
/** A phone: the toolbar stands in a column on the right edge, panels open to its left, one at a time */
|
|
2048
|
+
get isPhone(): boolean;
|
|
2049
|
+
/**
|
|
2050
|
+
* Draw one of the scene's own toolbar buttons in its slot: the row along the bottom right on desktop (where a scene
|
|
2051
|
+
* placed its own by hand before), the column on a phone. Slots count from the right (the row) or the top (the
|
|
2052
|
+
* column): 0 is CHAT's, 1 GUIDE's, 2 ADMIN's (for a non-admin the scene's first button may take it), then the
|
|
2053
|
+
* scene's. `props` is the button's face - its uiBackground, onMouseDown and children - the slot gives its place and
|
|
2054
|
+
* size (a width or height in props.uiTransform wins).
|
|
2055
|
+
*
|
|
2056
|
+
* @example
|
|
2057
|
+
* ```typescript
|
|
2058
|
+
* staticTV.toolbarButton(3, {
|
|
2059
|
+
* uiTransform: { justifyContent: 'center', alignItems: 'center' },
|
|
2060
|
+
* uiBackground: { color: Color4.create(0.2, 0.4, 0.2, 0.9) },
|
|
2061
|
+
* onMouseDown: () => myPanel.toggle(),
|
|
2062
|
+
* children: [ReactEcs.createElement(UiEntity, { uiText: { value: 'MAP', fontSize: 14 } })],
|
|
2063
|
+
* })
|
|
2064
|
+
* ```
|
|
2065
|
+
*/
|
|
2066
|
+
toolbarButton(slot: number, props: ToolbarButtonProps): any;
|
|
2067
|
+
/** Where a scene's own panel's right edge goes: on a phone one gap left of the column; elsewhere `desktopRight` */
|
|
2068
|
+
panelRight(desktopRight: number): number;
|
|
2069
|
+
/**
|
|
2070
|
+
* Draw one of the scene's own panels in its place (2.13.0): on desktop exactly as `props` say (their absolute
|
|
2071
|
+
* position included), on a phone centered on the screen's height one gap left of the toolbar's column, its top at
|
|
2072
|
+
* (canvas height - panel height) / 2 - or at the canvas's top when the panel is taller, so its header and close
|
|
2073
|
+
* button stay on screen. `props` is the panel's UiEntity props as on desktop: key, uiTransform, uiBackground,
|
|
2074
|
+
* children. The SDK's own chat, guide and admin panel draw through it.
|
|
2075
|
+
*
|
|
2076
|
+
* @example
|
|
2077
|
+
* ```typescript
|
|
2078
|
+
* myPanel.isOpen ? staticTV.toolbarPanel({
|
|
2079
|
+
* uiTransform: { positionType: 'absolute', position: { right: 20, bottom: 55 }, width: 380, height: 580 },
|
|
2080
|
+
* uiBackground: { color: Color4.create(0.05, 0.05, 0.08, 0.98) },
|
|
2081
|
+
* children: [header, body],
|
|
2082
|
+
* }) : null
|
|
2083
|
+
* ```
|
|
2084
|
+
*/
|
|
2085
|
+
toolbarPanel(props: ToolbarPanelProps): any;
|
|
2086
|
+
/**
|
|
2087
|
+
* Put one of the scene's own panels under the panel rule: on a phone, when another panel opens (the SDK's or the
|
|
2088
|
+
* scene's), `hide` runs. On desktop (2.13.0), with `{ coversGuide: true }`, the panel and the guide's place close
|
|
2089
|
+
* each other: opening it closes the guide and the admin panel, and opening either runs `hide`; without it, the SDK
|
|
2090
|
+
* leaves the panel to the scene there. The SDK's own names (guide, chat, admin) are taken. Call panelOpened(name)
|
|
2091
|
+
* when it opens.
|
|
2092
|
+
*/
|
|
2093
|
+
registerPanel(name: string, hide: () => void, options?: PanelOptions): void;
|
|
2094
|
+
/**
|
|
2095
|
+
* A panel opened: on a phone every other one closes, the SDK's and the scene's registered ones. Elsewhere a panel
|
|
2096
|
+
* closes any panel it would cover: the guide and the admin panel close each other, and each closes a scene's panel
|
|
2097
|
+
* registered with coversGuide, as that panel closes them (2.13.0); the chat stays open beside the guide or the admin
|
|
2098
|
+
* panel, and a scene's other panels are left to the scene.
|
|
2099
|
+
*/
|
|
2100
|
+
panelOpened(name: string): void;
|
|
1976
2101
|
/**
|
|
1977
2102
|
* Set up the UI renderer for all SDK panels
|
|
1978
2103
|
* Call this in your scene's main() function to render Guide, Chat, Admin panels.
|
|
@@ -2120,4 +2245,4 @@ declare function getPlayerPosition(): {
|
|
|
2120
2245
|
z: number;
|
|
2121
2246
|
} | null;
|
|
2122
2247
|
|
|
2123
|
-
export { type AdminPanelConfig, AdminPanelUIModule, type Channel, type ChatChannel, type ChatMessage, type ChatUIConfig, ChatUIModule, type CommandHandler, type FrameContent, FramesModule, type GuideFeaturedPlaylist, GuideModule, type GuideResponse, type GuideUIConfig, GuideUIModule, type GuideVideo, HeartbeatModule, type HeartbeatResponse, type InteractionResponse, InteractionsModule, KEY_TYPE_CHANNEL, KEY_TYPE_SCENE, ModerationModule, NotificationBanner, type PlayerData, type SDKTier, type SceneBounds$1 as SceneBounds, type SceneControl, type SceneControlOption, type SceneFrame, type SceneStats, type SceneStatsResponse, type SceneTabDefinition, SessionModule, type SessionResponse, type Standing, StaticTVClient, type StaticTVConfig, type StreamData, type VideoSlot, type Vod, fetchUserData, getParcelRects, getPlayerDisplayName, getPlayerPosition, getPlayerWallet, getSceneBounds, hideNotification, isPlayerInBounds, setupStaticUI, showNotification };
|
|
2248
|
+
export { type AdminPanelConfig, AdminPanelUIModule, type Channel, type ChatChannel, type ChatMessage, type ChatUIConfig, ChatUIModule, type CommandHandler, type FrameContent, FramesModule, type GuideFeaturedPlaylist, GuideModule, type GuideResponse, type GuideUIConfig, GuideUIModule, type GuideVideo, HeartbeatModule, type HeartbeatResponse, type InteractionResponse, InteractionsModule, KEY_TYPE_CHANNEL, KEY_TYPE_SCENE, ModerationModule, NotificationBanner, type PanelOptions, type Platform, type PlayerData, type SDKTier, type SceneBounds$1 as SceneBounds, type SceneControl, type SceneControlOption, type SceneFrame, type SceneStats, type SceneStatsResponse, type SceneTabDefinition, SessionModule, type SessionResponse, type Standing, StaticTVClient, type StaticTVConfig, type StreamData, type ToolbarButtonProps, type ToolbarPanelProps, type VideoSlot, type Vod, fetchUserData, getParcelRects, getPlayerDisplayName, getPlayerPosition, getPlayerWallet, getSceneBounds, hideNotification, isPlayerInBounds, setupStaticUI, showNotification };
|