@thestatic-tv/dcl-sdk 2.11.1 → 2.12.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 -5
- package/dist/index.d.mts +90 -2
- package/dist/index.d.ts +90 -2
- package/dist/index.js +522 -294
- package/dist/index.mjs +473 -245
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -79,10 +79,14 @@ The SDK includes pre-built UI for channel browsing and chat:
|
|
|
79
79
|
```typescript
|
|
80
80
|
staticTV = new StaticTVClient({
|
|
81
81
|
apiKey: 'your_api_key',
|
|
82
|
+
// The screen a pick plays on (or videoScreen): without one a Standard scene plays nowhere,
|
|
83
|
+
// and a Pro scene gets no Admin Panel
|
|
84
|
+
onVideoPlay: (url) => playOnYourScreen(url),
|
|
82
85
|
guideUI: {
|
|
83
86
|
onVideoSelect: (video) => {
|
|
84
|
-
//
|
|
85
|
-
|
|
87
|
+
// The SDK plays the pick through onVideoPlay; the scene starts its watch time, and
|
|
88
|
+
// staticTV.stopVideo() (every stop, an admin's included) ends it
|
|
89
|
+
if (video.channelId) staticTV.heartbeat?.startWatching(video.channelId)
|
|
86
90
|
}
|
|
87
91
|
},
|
|
88
92
|
chatUI: {
|
|
@@ -90,15 +94,51 @@ staticTV = new StaticTVClient({
|
|
|
90
94
|
}
|
|
91
95
|
})
|
|
92
96
|
|
|
93
|
-
//
|
|
94
|
-
staticTV.
|
|
95
|
-
staticTV.
|
|
97
|
+
// The guide and chat exist once the session's answer names the tier
|
|
98
|
+
staticTV.onFeaturesReady().then(() => {
|
|
99
|
+
staticTV.guideUI?.init()
|
|
100
|
+
staticTV.chatUI?.init()
|
|
101
|
+
})
|
|
96
102
|
|
|
97
103
|
// Show/hide
|
|
98
104
|
staticTV.guideUI.toggle()
|
|
99
105
|
staticTV.chatUI.toggle()
|
|
100
106
|
```
|
|
101
107
|
|
|
108
|
+
## The toolbar on a phone (2.12.0)
|
|
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 on the right edge at mid-height, the panels open to its left, and only one panel is open
|
|
113
|
+
at a time. On desktop, VR and the web nothing changes: the row along the bottom right, and the
|
|
114
|
+
guide and the admin panel still the only two that close each other.
|
|
115
|
+
|
|
116
|
+
`staticTV.platform` is `'desktop'`, `'mobile'`, `'vr'`, `'web'`, or `'unknown'` until the explorer
|
|
117
|
+
answers (and if it cannot); `staticTV.isPhone` is true on a phone only.
|
|
118
|
+
|
|
119
|
+
A scene's own buttons and panels join the same layout and the same rule:
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
// The button: slot 0 is CHAT's, 1 GUIDE's, 2 ADMIN's (a non-admin has none, so a scene button
|
|
123
|
+
// may take it), then the scene's own. The row on desktop, the column on a phone.
|
|
124
|
+
staticTV.toolbarButton(3, {
|
|
125
|
+
uiTransform: { justifyContent: 'center', alignItems: 'center' },
|
|
126
|
+
uiBackground: { color: Color4.create(0.2, 0.4, 0.2, 0.9) },
|
|
127
|
+
onMouseDown: () => myPanel.toggle(),
|
|
128
|
+
children: [ReactEcs.createElement(UiEntity, { uiText: { value: 'MAP', fontSize: 14 } })],
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
// The panel: its right edge (left of the column on a phone, yours elsewhere)
|
|
132
|
+
const right = staticTV.panelRight(20)
|
|
133
|
+
|
|
134
|
+
// One panel at a time on a phone: register how yours hides, and say when it opens
|
|
135
|
+
staticTV.registerPanel('map', () => myPanel.hide())
|
|
136
|
+
myPanel.onOpen = () => staticTV.panelOpened('map')
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
On desktop your `panelOpened` closes nothing, and the SDK's panels never close yours: a scene
|
|
140
|
+
keeps its own rules there. The names `guide`, `chat` and `admin` are the SDK's.
|
|
141
|
+
|
|
102
142
|
## 18+ channels (2.8.0)
|
|
103
143
|
|
|
104
144
|
18+ channels are in the lineup with the rest: each 18+ channel and each of its VODs carries
|
package/dist/index.d.mts
CHANGED
|
@@ -1374,6 +1374,14 @@ declare class AdminPanelUIModule {
|
|
|
1374
1374
|
* Play a video slot by ID - looks up URL and calls onVideoPlay
|
|
1375
1375
|
*/
|
|
1376
1376
|
playSlot(slotId: string): void;
|
|
1377
|
+
/**
|
|
1378
|
+
* A late arrival's first play (2026-11-30, his find): the scene's kept current video when thestatic.tv keeps one - an
|
|
1379
|
+
* admin's PLAY NOW or Play on Screen (videoSetUrl), kept until Reset Default - a url played as the queue plays one,
|
|
1380
|
+
* a locked channel asked for through the door as every locked play is (a refused visitor gets the LOCKED line and
|
|
1381
|
+
* nothing plays). With none kept, the default slot, as before. Until then only the default slot played at load, so
|
|
1382
|
+
* a copy that loaded more than 30 s after a PLAY NOW (the queue's window) never saw it.
|
|
1383
|
+
*/
|
|
1384
|
+
private playAtLoad;
|
|
1377
1385
|
/**
|
|
1378
1386
|
* Auto-play the default slot if configured
|
|
1379
1387
|
*/
|
|
@@ -1479,6 +1487,8 @@ declare class AdminPanelUIModule {
|
|
|
1479
1487
|
* Uses same layout as NotificationBanner but with scaled font size
|
|
1480
1488
|
*/
|
|
1481
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;
|
|
1482
1492
|
/**
|
|
1483
1493
|
* Get the React-ECS component for the admin panel
|
|
1484
1494
|
* Always renders notification (scaled), admin panel only for admins
|
|
@@ -1486,6 +1496,36 @@ declare class AdminPanelUIModule {
|
|
|
1486
1496
|
getComponent: () => ReactEcs.JSX.Element | null;
|
|
1487
1497
|
}
|
|
1488
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
|
+
type Platform = 'desktop' | 'mobile' | 'vr' | 'web' | 'unknown';
|
|
1518
|
+
|
|
1519
|
+
/** A toolbar button's face: what a UiEntity takes, its place and size left to the slot */
|
|
1520
|
+
interface ToolbarButtonProps {
|
|
1521
|
+
/** Extra layout for the face (justifyContent, alignItems...); a width or height here wins */
|
|
1522
|
+
uiTransform?: Record<string, unknown>;
|
|
1523
|
+
uiBackground?: unknown;
|
|
1524
|
+
onMouseDown?: () => void;
|
|
1525
|
+
children?: unknown[];
|
|
1526
|
+
[prop: string]: unknown;
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1489
1529
|
/**
|
|
1490
1530
|
* StaticTVClient - Main client for connecting DCL scenes to thestatic.tv
|
|
1491
1531
|
*
|
|
@@ -1543,6 +1583,15 @@ declare class StaticTVClient {
|
|
|
1543
1583
|
private readonly streamLink;
|
|
1544
1584
|
/** UI scale - fixed at 1.0. DCL's UI system auto-scales based on viewport. */
|
|
1545
1585
|
readonly uiScale: number;
|
|
1586
|
+
/** The explorer's platform, read once at construction (2.12.0); unknown until it answers, and if it cannot */
|
|
1587
|
+
private _platform;
|
|
1588
|
+
/**
|
|
1589
|
+
* Which panels close when one opens (2.12.0, src/ui/toolbar.ts): on a phone every other one, the SDK's and a
|
|
1590
|
+
* scene's (registerPanel); elsewhere the guide and the admin panel close each other, as before.
|
|
1591
|
+
*/
|
|
1592
|
+
private readonly panelRules;
|
|
1593
|
+
/** The SDK's own panels, which a scene cannot register over */
|
|
1594
|
+
private static readonly OWN_PANELS;
|
|
1546
1595
|
/** Get the API base URL (for internal module use) */
|
|
1547
1596
|
getBaseUrl(): string;
|
|
1548
1597
|
/**
|
|
@@ -1677,6 +1726,9 @@ declare class StaticTVClient {
|
|
|
1677
1726
|
* Stop video playback on the configured videoScreen entity.
|
|
1678
1727
|
* If fallbackVideoUrl is configured (default), plays the fallback loop.
|
|
1679
1728
|
* Called by Admin Panel.
|
|
1729
|
+
* The watch heartbeat ends with it (2026-11-30): nothing is on the screen to watch, so no minute (and no Sparks) is
|
|
1730
|
+
* credited after a stop - an admin's Stop or Reset Default, a queued stop or clear, a locked re-ask refused, a dead
|
|
1731
|
+
* stream, or a scene's own call (TheStatic.tv HQ's radio pick). Until then it ran on until the next pick.
|
|
1680
1732
|
*/
|
|
1681
1733
|
stopVideo(): void;
|
|
1682
1734
|
/**
|
|
@@ -1958,10 +2010,46 @@ declare class StaticTVClient {
|
|
|
1958
2010
|
openFrame(id: string): void;
|
|
1959
2011
|
/**
|
|
1960
2012
|
* Close Admin/Guide panels (they share the same screen space)
|
|
1961
|
-
* Chat is independent and stays open.
|
|
2013
|
+
* Chat is independent and stays open. On a phone (2.12.0) every other panel closes: the same as panelOpened().
|
|
1962
2014
|
* @param except The panel that should stay open: 'admin' | 'guide'
|
|
1963
2015
|
*/
|
|
1964
2016
|
closeOtherPanels(except: 'admin' | 'guide'): void;
|
|
2017
|
+
/** Ask the explorer which platform this is, once; a failed or missing call leaves it unknown (the desktop layout) */
|
|
2018
|
+
private readPlatform;
|
|
2019
|
+
/** The explorer's platform: 'desktop', 'mobile', 'vr', 'web', or 'unknown' until it answers (and if it cannot) */
|
|
2020
|
+
get platform(): Platform;
|
|
2021
|
+
/** A phone: the toolbar stands in a column on the right edge, panels open to its left, one at a time */
|
|
2022
|
+
get isPhone(): boolean;
|
|
2023
|
+
/**
|
|
2024
|
+
* Draw one of the scene's own toolbar buttons in its slot: the row along the bottom right on desktop (where a scene
|
|
2025
|
+
* placed its own by hand before), the column on a phone. Slots count from the right (the row) or the top (the
|
|
2026
|
+
* 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
|
|
2027
|
+
* scene's. `props` is the button's face - its uiBackground, onMouseDown and children - the slot gives its place and
|
|
2028
|
+
* size (a width or height in props.uiTransform wins).
|
|
2029
|
+
*
|
|
2030
|
+
* @example
|
|
2031
|
+
* ```typescript
|
|
2032
|
+
* staticTV.toolbarButton(3, {
|
|
2033
|
+
* uiTransform: { justifyContent: 'center', alignItems: 'center' },
|
|
2034
|
+
* uiBackground: { color: Color4.create(0.2, 0.4, 0.2, 0.9) },
|
|
2035
|
+
* onMouseDown: () => myPanel.toggle(),
|
|
2036
|
+
* children: [ReactEcs.createElement(UiEntity, { uiText: { value: 'MAP', fontSize: 14 } })],
|
|
2037
|
+
* })
|
|
2038
|
+
* ```
|
|
2039
|
+
*/
|
|
2040
|
+
toolbarButton(slot: number, props: ToolbarButtonProps): any;
|
|
2041
|
+
/** Where a scene's own panel's right edge goes: on a phone just left of the column; elsewhere `desktopRight` */
|
|
2042
|
+
panelRight(desktopRight: number): number;
|
|
2043
|
+
/**
|
|
2044
|
+
* Put one of the scene's own panels under the one-panel rule: on a phone, when another panel opens (the SDK's or the
|
|
2045
|
+
* scene's), `hide` runs. The SDK's own names (guide, chat, admin) are taken. Call panelOpened(name) when it opens.
|
|
2046
|
+
*/
|
|
2047
|
+
registerPanel(name: string, hide: () => void): void;
|
|
2048
|
+
/**
|
|
2049
|
+
* A panel opened: on a phone every other one closes, the SDK's and the scene's registered ones; elsewhere the guide
|
|
2050
|
+
* and the admin panel close each other, as before, and a scene's own panel closes nothing here.
|
|
2051
|
+
*/
|
|
2052
|
+
panelOpened(name: string): void;
|
|
1965
2053
|
/**
|
|
1966
2054
|
* Set up the UI renderer for all SDK panels
|
|
1967
2055
|
* Call this in your scene's main() function to render Guide, Chat, Admin panels.
|
|
@@ -2109,4 +2197,4 @@ declare function getPlayerPosition(): {
|
|
|
2109
2197
|
z: number;
|
|
2110
2198
|
} | null;
|
|
2111
2199
|
|
|
2112
|
-
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 };
|
|
2200
|
+
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 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 VideoSlot, type Vod, fetchUserData, getParcelRects, getPlayerDisplayName, getPlayerPosition, getPlayerWallet, getSceneBounds, hideNotification, isPlayerInBounds, setupStaticUI, showNotification };
|
package/dist/index.d.ts
CHANGED
|
@@ -1374,6 +1374,14 @@ declare class AdminPanelUIModule {
|
|
|
1374
1374
|
* Play a video slot by ID - looks up URL and calls onVideoPlay
|
|
1375
1375
|
*/
|
|
1376
1376
|
playSlot(slotId: string): void;
|
|
1377
|
+
/**
|
|
1378
|
+
* A late arrival's first play (2026-11-30, his find): the scene's kept current video when thestatic.tv keeps one - an
|
|
1379
|
+
* admin's PLAY NOW or Play on Screen (videoSetUrl), kept until Reset Default - a url played as the queue plays one,
|
|
1380
|
+
* a locked channel asked for through the door as every locked play is (a refused visitor gets the LOCKED line and
|
|
1381
|
+
* nothing plays). With none kept, the default slot, as before. Until then only the default slot played at load, so
|
|
1382
|
+
* a copy that loaded more than 30 s after a PLAY NOW (the queue's window) never saw it.
|
|
1383
|
+
*/
|
|
1384
|
+
private playAtLoad;
|
|
1377
1385
|
/**
|
|
1378
1386
|
* Auto-play the default slot if configured
|
|
1379
1387
|
*/
|
|
@@ -1479,6 +1487,8 @@ declare class AdminPanelUIModule {
|
|
|
1479
1487
|
* Uses same layout as NotificationBanner but with scaled font size
|
|
1480
1488
|
*/
|
|
1481
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;
|
|
1482
1492
|
/**
|
|
1483
1493
|
* Get the React-ECS component for the admin panel
|
|
1484
1494
|
* Always renders notification (scaled), admin panel only for admins
|
|
@@ -1486,6 +1496,36 @@ declare class AdminPanelUIModule {
|
|
|
1486
1496
|
getComponent: () => ReactEcs.JSX.Element | null;
|
|
1487
1497
|
}
|
|
1488
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
|
+
type Platform = 'desktop' | 'mobile' | 'vr' | 'web' | 'unknown';
|
|
1518
|
+
|
|
1519
|
+
/** A toolbar button's face: what a UiEntity takes, its place and size left to the slot */
|
|
1520
|
+
interface ToolbarButtonProps {
|
|
1521
|
+
/** Extra layout for the face (justifyContent, alignItems...); a width or height here wins */
|
|
1522
|
+
uiTransform?: Record<string, unknown>;
|
|
1523
|
+
uiBackground?: unknown;
|
|
1524
|
+
onMouseDown?: () => void;
|
|
1525
|
+
children?: unknown[];
|
|
1526
|
+
[prop: string]: unknown;
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1489
1529
|
/**
|
|
1490
1530
|
* StaticTVClient - Main client for connecting DCL scenes to thestatic.tv
|
|
1491
1531
|
*
|
|
@@ -1543,6 +1583,15 @@ declare class StaticTVClient {
|
|
|
1543
1583
|
private readonly streamLink;
|
|
1544
1584
|
/** UI scale - fixed at 1.0. DCL's UI system auto-scales based on viewport. */
|
|
1545
1585
|
readonly uiScale: number;
|
|
1586
|
+
/** The explorer's platform, read once at construction (2.12.0); unknown until it answers, and if it cannot */
|
|
1587
|
+
private _platform;
|
|
1588
|
+
/**
|
|
1589
|
+
* Which panels close when one opens (2.12.0, src/ui/toolbar.ts): on a phone every other one, the SDK's and a
|
|
1590
|
+
* scene's (registerPanel); elsewhere the guide and the admin panel close each other, as before.
|
|
1591
|
+
*/
|
|
1592
|
+
private readonly panelRules;
|
|
1593
|
+
/** The SDK's own panels, which a scene cannot register over */
|
|
1594
|
+
private static readonly OWN_PANELS;
|
|
1546
1595
|
/** Get the API base URL (for internal module use) */
|
|
1547
1596
|
getBaseUrl(): string;
|
|
1548
1597
|
/**
|
|
@@ -1677,6 +1726,9 @@ declare class StaticTVClient {
|
|
|
1677
1726
|
* Stop video playback on the configured videoScreen entity.
|
|
1678
1727
|
* If fallbackVideoUrl is configured (default), plays the fallback loop.
|
|
1679
1728
|
* Called by Admin Panel.
|
|
1729
|
+
* The watch heartbeat ends with it (2026-11-30): nothing is on the screen to watch, so no minute (and no Sparks) is
|
|
1730
|
+
* credited after a stop - an admin's Stop or Reset Default, a queued stop or clear, a locked re-ask refused, a dead
|
|
1731
|
+
* stream, or a scene's own call (TheStatic.tv HQ's radio pick). Until then it ran on until the next pick.
|
|
1680
1732
|
*/
|
|
1681
1733
|
stopVideo(): void;
|
|
1682
1734
|
/**
|
|
@@ -1958,10 +2010,46 @@ declare class StaticTVClient {
|
|
|
1958
2010
|
openFrame(id: string): void;
|
|
1959
2011
|
/**
|
|
1960
2012
|
* Close Admin/Guide panels (they share the same screen space)
|
|
1961
|
-
* Chat is independent and stays open.
|
|
2013
|
+
* Chat is independent and stays open. On a phone (2.12.0) every other panel closes: the same as panelOpened().
|
|
1962
2014
|
* @param except The panel that should stay open: 'admin' | 'guide'
|
|
1963
2015
|
*/
|
|
1964
2016
|
closeOtherPanels(except: 'admin' | 'guide'): void;
|
|
2017
|
+
/** Ask the explorer which platform this is, once; a failed or missing call leaves it unknown (the desktop layout) */
|
|
2018
|
+
private readPlatform;
|
|
2019
|
+
/** The explorer's platform: 'desktop', 'mobile', 'vr', 'web', or 'unknown' until it answers (and if it cannot) */
|
|
2020
|
+
get platform(): Platform;
|
|
2021
|
+
/** A phone: the toolbar stands in a column on the right edge, panels open to its left, one at a time */
|
|
2022
|
+
get isPhone(): boolean;
|
|
2023
|
+
/**
|
|
2024
|
+
* Draw one of the scene's own toolbar buttons in its slot: the row along the bottom right on desktop (where a scene
|
|
2025
|
+
* placed its own by hand before), the column on a phone. Slots count from the right (the row) or the top (the
|
|
2026
|
+
* 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
|
|
2027
|
+
* scene's. `props` is the button's face - its uiBackground, onMouseDown and children - the slot gives its place and
|
|
2028
|
+
* size (a width or height in props.uiTransform wins).
|
|
2029
|
+
*
|
|
2030
|
+
* @example
|
|
2031
|
+
* ```typescript
|
|
2032
|
+
* staticTV.toolbarButton(3, {
|
|
2033
|
+
* uiTransform: { justifyContent: 'center', alignItems: 'center' },
|
|
2034
|
+
* uiBackground: { color: Color4.create(0.2, 0.4, 0.2, 0.9) },
|
|
2035
|
+
* onMouseDown: () => myPanel.toggle(),
|
|
2036
|
+
* children: [ReactEcs.createElement(UiEntity, { uiText: { value: 'MAP', fontSize: 14 } })],
|
|
2037
|
+
* })
|
|
2038
|
+
* ```
|
|
2039
|
+
*/
|
|
2040
|
+
toolbarButton(slot: number, props: ToolbarButtonProps): any;
|
|
2041
|
+
/** Where a scene's own panel's right edge goes: on a phone just left of the column; elsewhere `desktopRight` */
|
|
2042
|
+
panelRight(desktopRight: number): number;
|
|
2043
|
+
/**
|
|
2044
|
+
* Put one of the scene's own panels under the one-panel rule: on a phone, when another panel opens (the SDK's or the
|
|
2045
|
+
* scene's), `hide` runs. The SDK's own names (guide, chat, admin) are taken. Call panelOpened(name) when it opens.
|
|
2046
|
+
*/
|
|
2047
|
+
registerPanel(name: string, hide: () => void): void;
|
|
2048
|
+
/**
|
|
2049
|
+
* A panel opened: on a phone every other one closes, the SDK's and the scene's registered ones; elsewhere the guide
|
|
2050
|
+
* and the admin panel close each other, as before, and a scene's own panel closes nothing here.
|
|
2051
|
+
*/
|
|
2052
|
+
panelOpened(name: string): void;
|
|
1965
2053
|
/**
|
|
1966
2054
|
* Set up the UI renderer for all SDK panels
|
|
1967
2055
|
* Call this in your scene's main() function to render Guide, Chat, Admin panels.
|
|
@@ -2109,4 +2197,4 @@ declare function getPlayerPosition(): {
|
|
|
2109
2197
|
z: number;
|
|
2110
2198
|
} | null;
|
|
2111
2199
|
|
|
2112
|
-
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 };
|
|
2200
|
+
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 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 VideoSlot, type Vod, fetchUserData, getParcelRects, getPlayerDisplayName, getPlayerPosition, getPlayerWallet, getSceneBounds, hideNotification, isPlayerInBounds, setupStaticUI, showNotification };
|