@thestatic-tv/dcl-sdk 2.12.0 → 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 CHANGED
@@ -105,13 +105,14 @@ staticTV.guideUI.toggle()
105
105
  staticTV.chatUI.toggle()
106
106
  ```
107
107
 
108
- ## The toolbar on a phone (2.12.0)
108
+ ## The toolbar on a phone (2.12.0; 2.13.0 places it)
109
109
 
110
110
  On a phone the explorer draws its own controls over the bottom right, where the toolbar sits. So
111
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.
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.
115
116
 
116
117
  `staticTV.platform` is `'desktop'`, `'mobile'`, `'vr'`, `'web'`, or `'unknown'` until the explorer
117
118
  answers (and if it cannot); `staticTV.isPhone` is true on a phone only.
@@ -128,16 +129,26 @@ staticTV.toolbarButton(3, {
128
129
  children: [ReactEcs.createElement(UiEntity, { uiText: { value: 'MAP', fontSize: 14 } })],
129
130
  })
130
131
 
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())
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 })
136
145
  myPanel.onOpen = () => staticTV.panelOpened('map')
137
146
  ```
138
147
 
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.
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.
141
152
 
142
153
  ## 18+ channels (2.8.0)
143
154
 
package/dist/index.d.mts CHANGED
@@ -1513,8 +1513,25 @@ declare class AdminPanelUIModule {
1513
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
1514
  * everyone else), then a scene's own. In the column, slot 0 is on top and the column's middle slot
1515
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."
1516
1525
  */
1517
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
+ }
1518
1535
 
1519
1536
  /** A toolbar button's face: what a UiEntity takes, its place and size left to the slot */
1520
1537
  interface ToolbarButtonProps {
@@ -1526,6 +1543,15 @@ interface ToolbarButtonProps {
1526
1543
  [prop: string]: unknown;
1527
1544
  }
1528
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
+
1529
1555
  /**
1530
1556
  * StaticTVClient - Main client for connecting DCL scenes to thestatic.tv
1531
1557
  *
@@ -2038,16 +2064,38 @@ declare class StaticTVClient {
2038
2064
  * ```
2039
2065
  */
2040
2066
  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` */
2067
+ /** Where a scene's own panel's right edge goes: on a phone one gap left of the column; elsewhere `desktopRight` */
2042
2068
  panelRight(desktopRight: number): number;
2043
2069
  /**
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.
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.
2046
2092
  */
2047
- registerPanel(name: string, hide: () => void): void;
2093
+ registerPanel(name: string, hide: () => void, options?: PanelOptions): void;
2048
2094
  /**
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.
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.
2051
2099
  */
2052
2100
  panelOpened(name: string): void;
2053
2101
  /**
@@ -2197,4 +2245,4 @@ declare function getPlayerPosition(): {
2197
2245
  z: number;
2198
2246
  } | null;
2199
2247
 
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 };
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
@@ -1513,8 +1513,25 @@ declare class AdminPanelUIModule {
1513
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
1514
  * everyone else), then a scene's own. In the column, slot 0 is on top and the column's middle slot
1515
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."
1516
1525
  */
1517
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
+ }
1518
1535
 
1519
1536
  /** A toolbar button's face: what a UiEntity takes, its place and size left to the slot */
1520
1537
  interface ToolbarButtonProps {
@@ -1526,6 +1543,15 @@ interface ToolbarButtonProps {
1526
1543
  [prop: string]: unknown;
1527
1544
  }
1528
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
+
1529
1555
  /**
1530
1556
  * StaticTVClient - Main client for connecting DCL scenes to thestatic.tv
1531
1557
  *
@@ -2038,16 +2064,38 @@ declare class StaticTVClient {
2038
2064
  * ```
2039
2065
  */
2040
2066
  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` */
2067
+ /** Where a scene's own panel's right edge goes: on a phone one gap left of the column; elsewhere `desktopRight` */
2042
2068
  panelRight(desktopRight: number): number;
2043
2069
  /**
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.
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.
2046
2092
  */
2047
- registerPanel(name: string, hide: () => void): void;
2093
+ registerPanel(name: string, hide: () => void, options?: PanelOptions): void;
2048
2094
  /**
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.
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.
2051
2099
  */
2052
2100
  panelOpened(name: string): void;
2053
2101
  /**
@@ -2197,4 +2245,4 @@ declare function getPlayerPosition(): {
2197
2245
  z: number;
2198
2246
  } | null;
2199
2247
 
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 };
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.js CHANGED
@@ -1572,6 +1572,7 @@ var import_react_ecs2 = __toESM(require("@dcl/sdk/react-ecs"));
1572
1572
  // src/ui/toolbar.ts
1573
1573
  var TOOLBAR = { edge: 20, gap: 10, buttonWidth: 100, buttonHeight: 45, bottom: 10 };
1574
1574
  var COLUMN_SLOTS = 5;
1575
+ var PHONE_EDGE = 0;
1575
1576
  function platformOf(answer) {
1576
1577
  const raw = answer?.platform;
1577
1578
  if (typeof raw !== "string") return "unknown";
@@ -1588,32 +1589,38 @@ function rowRight(slot, uiScale = 1) {
1588
1589
  function columnSlot(slot, uiScale = 1) {
1589
1590
  const h = scaled(TOOLBAR.buttonHeight, uiScale);
1590
1591
  return {
1591
- right: TOOLBAR.edge,
1592
+ right: PHONE_EDGE,
1592
1593
  boxHeight: COLUMN_SLOTS * h + (COLUMN_SLOTS - 1) * TOOLBAR.gap,
1593
1594
  above: Math.max(0, slot) * (h + TOOLBAR.gap)
1594
1595
  };
1595
1596
  }
1596
1597
  function panelRight(phone, desktopRight, uiScale = 1) {
1597
- return phone ? TOOLBAR.edge + scaled(TOOLBAR.buttonWidth, uiScale) + TOOLBAR.gap : desktopRight;
1598
+ return phone ? PHONE_EDGE + scaled(TOOLBAR.buttonWidth, uiScale) + TOOLBAR.gap : desktopRight;
1598
1599
  }
1599
1600
  var DESKTOP_CLOSES = { guide: ["admin"], admin: ["guide"] };
1600
- function panelsToClose(opened, registered, phone) {
1601
+ var GUIDE_PLACE = ["guide", "admin"];
1602
+ function panelsToClose(opened, registered, phone, coversGuide = []) {
1601
1603
  if (phone) return registered.filter((name) => name !== opened);
1602
- const closes = DESKTOP_CLOSES[opened] ?? [];
1603
- return registered.filter((name) => closes.includes(name));
1604
+ const closes = [...DESKTOP_CLOSES[opened] ?? []];
1605
+ if (GUIDE_PLACE.includes(opened)) closes.push(...coversGuide);
1606
+ if (coversGuide.includes(opened)) closes.push(...GUIDE_PLACE);
1607
+ return registered.filter((name) => name !== opened && closes.includes(name));
1604
1608
  }
1605
1609
  var PanelRules = class {
1606
1610
  constructor(phone) {
1607
1611
  this.hides = /* @__PURE__ */ new Map();
1612
+ this.coveringGuide = /* @__PURE__ */ new Set();
1608
1613
  this.phone = phone;
1609
1614
  }
1610
1615
  /** Register (or replace) a panel; its hide runs when another panel opens and the rule says so */
1611
- register(name, hide) {
1616
+ register(name, hide, options = {}) {
1612
1617
  this.hides.set(name, hide);
1618
+ if (options.coversGuide === true) this.coveringGuide.add(name);
1619
+ else this.coveringGuide.delete(name);
1613
1620
  }
1614
1621
  /** A panel opened: close the ones the rule names. One failing hide does not stop the rest. */
1615
1622
  opened(name) {
1616
- for (const other of panelsToClose(name, [...this.hides.keys()], this.phone())) {
1623
+ for (const other of panelsToClose(name, [...this.hides.keys()], this.phone(), [...this.coveringGuide])) {
1617
1624
  try {
1618
1625
  this.hides.get(other)?.();
1619
1626
  } catch {
@@ -1713,14 +1720,14 @@ var GuideUIModule = class {
1713
1720
  this.renderToggleButton(),
1714
1721
  // Render panel when visible - Guide positioned relative to Chat's scaled width
1715
1722
  // Guide.right = Chat.right + Chat.scaledWidth + gap (10px)
1716
- this._isVisible ? import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
1723
+ // On a phone centered beside the toolbar's column (2.13.0, src/ui/toolbar-panel.ts); elsewhere as here
1724
+ this._isVisible ? this.client.toolbarPanel({
1717
1725
  key: `guide-panel-${this.client.uiScale}`,
1718
1726
  uiTransform: {
1719
1727
  width: windowW,
1720
1728
  height: windowH,
1721
1729
  positionType: "absolute",
1722
- // On a phone, left of the toolbar's column (2.12.0); elsewhere left of the chat panel, as before
1723
- position: { bottom: UI_DIMENSIONS.guide.bottom, right: this.client.panelRight(UI_DIMENSIONS.chat.right + this.s(UI_DIMENSIONS.chat.width) + 10) },
1730
+ position: { bottom: UI_DIMENSIONS.guide.bottom, right: UI_DIMENSIONS.chat.right + this.s(UI_DIMENSIONS.chat.width) + 10 },
1724
1731
  flexDirection: "row",
1725
1732
  border: { top: 2, bottom: 2, left: 2, right: 2 },
1726
1733
  borderColor: THEME.colors.panelBorder
@@ -2539,14 +2546,14 @@ var ChatUIModule = class {
2539
2546
  this.renderToggleButton(),
2540
2547
  // Render panel when visible - scaled sizes, fixed position
2541
2548
  // Key includes uiScale to force re-render when scale changes from other panels
2542
- this._isVisible ? import_react_ecs4.default.createElement(import_react_ecs4.UiEntity, {
2549
+ // On a phone centered beside the toolbar's column (2.13.0, src/ui/toolbar-panel.ts); elsewhere as here
2550
+ this._isVisible ? this.client.toolbarPanel({
2543
2551
  key: `chat-panel-${this.client.uiScale}`,
2544
2552
  uiTransform: {
2545
2553
  width: this.s(UI_DIMENSIONS.chat.width),
2546
2554
  height: this.s(UI_DIMENSIONS.chat.height),
2547
2555
  positionType: "absolute",
2548
- // On a phone, left of the toolbar's column (2.12.0); elsewhere at the right edge, as before
2549
- position: { bottom: UI_DIMENSIONS.chat.bottom, right: this.client.panelRight(UI_DIMENSIONS.chat.right) },
2556
+ position: { bottom: UI_DIMENSIONS.chat.bottom, right: UI_DIMENSIONS.chat.right },
2550
2557
  flexDirection: "column",
2551
2558
  border: { top: 2, bottom: 2, left: 2, right: 2 },
2552
2559
  borderColor: THEME.colors.panelBorder
@@ -4521,87 +4528,89 @@ var AdminPanelUIModule = class {
4521
4528
  },
4522
4529
  this.renderToggleFace()
4523
4530
  ),
4524
- this.panelOpen && /* @__PURE__ */ import_react_ecs7.default.createElement(
4525
- import_react_ecs7.UiEntity,
4526
- {
4527
- key: `admin-panel-${this.client.uiScale}`,
4528
- uiTransform: {
4529
- width: this.s(UI_DIMENSIONS.admin.width),
4530
- height: this.s(UI_DIMENSIONS.admin.height),
4531
- maxHeight: this.s(UI_DIMENSIONS.admin.maxHeight),
4532
- // On a phone, left of the toolbar's column (2.12.0); elsewhere left of the chat panel, as before
4533
- position: { right: this.client.panelRight(UI_DIMENSIONS.chat.right + this.s(UI_DIMENSIONS.chat.width) + 10), bottom: UI_DIMENSIONS.admin.bottom },
4534
- positionType: "absolute",
4535
- flexDirection: "column"
4536
- },
4537
- uiBackground: { color: C2.bg }
4531
+ this.panelOpen && this.client.toolbarPanel({
4532
+ key: `admin-panel-${this.client.uiScale}`,
4533
+ uiTransform: {
4534
+ width: this.s(UI_DIMENSIONS.admin.width),
4535
+ height: this.s(UI_DIMENSIONS.admin.height),
4536
+ maxHeight: this.s(UI_DIMENSIONS.admin.maxHeight),
4537
+ position: { right: UI_DIMENSIONS.chat.right + this.s(UI_DIMENSIONS.chat.width) + 10, bottom: UI_DIMENSIONS.admin.bottom },
4538
+ positionType: "absolute",
4539
+ flexDirection: "column"
4538
4540
  },
4539
- /* @__PURE__ */ import_react_ecs7.default.createElement(
4540
- import_react_ecs7.UiEntity,
4541
- {
4542
- uiTransform: {
4543
- width: "100%",
4544
- height: this.s(UI_DIMENSIONS.admin.headerHeight),
4545
- justifyContent: "space-between",
4546
- alignItems: "center",
4547
- flexDirection: "row",
4548
- padding: { left: 12, right: 8 }
4541
+ uiBackground: { color: C2.bg },
4542
+ children: [
4543
+ // Header with font controls
4544
+ /* @__PURE__ */ import_react_ecs7.default.createElement(
4545
+ import_react_ecs7.UiEntity,
4546
+ {
4547
+ uiTransform: {
4548
+ width: "100%",
4549
+ height: this.s(UI_DIMENSIONS.admin.headerHeight),
4550
+ justifyContent: "space-between",
4551
+ alignItems: "center",
4552
+ flexDirection: "row",
4553
+ padding: { left: 12, right: 8 }
4554
+ },
4555
+ uiBackground: { color: C2.header }
4549
4556
  },
4550
- uiBackground: { color: C2.header }
4551
- },
4552
- /* @__PURE__ */ import_react_ecs7.default.createElement(import_react_ecs7.Label, { value: this.config.title || "ADMIN PANEL", fontSize: t.header, color: C2.text }),
4557
+ /* @__PURE__ */ import_react_ecs7.default.createElement(import_react_ecs7.Label, { value: this.config.title || "ADMIN PANEL", fontSize: t.header, color: C2.text }),
4558
+ /* @__PURE__ */ import_react_ecs7.default.createElement(
4559
+ import_react_ecs7.Button,
4560
+ {
4561
+ uiTransform: { width: this.s(28), height: this.s(28) },
4562
+ uiBackground: { color: import_math7.Color4.create(0, 0, 0, 0.3) },
4563
+ value: "X",
4564
+ fontSize: t.header,
4565
+ color: THEME.colors.red,
4566
+ onMouseDown: () => this.hide()
4567
+ }
4568
+ )
4569
+ ),
4570
+ // Tabs
4571
+ /* @__PURE__ */ import_react_ecs7.default.createElement(import_react_ecs7.UiEntity, { uiTransform: { width: "100%", height: this.s(UI_DIMENSIONS.admin.tabHeight), flexDirection: "row" } }, tabs.map((tab) => /* @__PURE__ */ import_react_ecs7.default.createElement(this.TabBtn, { label: tab.label, tab: tab.id }))),
4572
+ // Content
4553
4573
  /* @__PURE__ */ import_react_ecs7.default.createElement(
4554
- import_react_ecs7.Button,
4574
+ import_react_ecs7.UiEntity,
4555
4575
  {
4556
- uiTransform: { width: this.s(28), height: this.s(28) },
4557
- uiBackground: { color: import_math7.Color4.create(0, 0, 0, 0.3) },
4558
- value: "X",
4559
- fontSize: t.header,
4560
- color: THEME.colors.red,
4561
- onMouseDown: () => this.hide()
4562
- }
4563
- )
4564
- ),
4565
- /* @__PURE__ */ import_react_ecs7.default.createElement(import_react_ecs7.UiEntity, { uiTransform: { width: "100%", height: this.s(UI_DIMENSIONS.admin.tabHeight), flexDirection: "row" } }, tabs.map((tab) => /* @__PURE__ */ import_react_ecs7.default.createElement(this.TabBtn, { label: tab.label, tab: tab.id }))),
4566
- /* @__PURE__ */ import_react_ecs7.default.createElement(
4567
- import_react_ecs7.UiEntity,
4568
- {
4569
- uiTransform: {
4570
- width: "100%",
4571
- flexGrow: 1,
4572
- overflow: "scroll",
4573
- flexDirection: "column"
4574
- }
4575
- },
4576
- this.activeTab === "controls" && this.venue && this.controls.length > 0 && /* @__PURE__ */ import_react_ecs7.default.createElement(this.ControlsTab, null),
4577
- this.activeTab === "video" && /* @__PURE__ */ import_react_ecs7.default.createElement(this.VideoTab, null),
4578
- this.activeTab === "mod" && this.isOwner && /* @__PURE__ */ import_react_ecs7.default.createElement(this.ModTab, null),
4579
- this.config.sceneTabs?.map((tab) => this.activeTab === tab.id && tab.render())
4580
- ),
4581
- /* @__PURE__ */ import_react_ecs7.default.createElement(
4582
- import_react_ecs7.UiEntity,
4583
- {
4584
- uiTransform: {
4585
- width: "100%",
4586
- height: this.s(UI_DIMENSIONS.admin.footerHeight),
4587
- justifyContent: "center",
4588
- alignItems: "center"
4576
+ uiTransform: {
4577
+ width: "100%",
4578
+ flexGrow: 1,
4579
+ overflow: "scroll",
4580
+ flexDirection: "column"
4581
+ }
4589
4582
  },
4590
- uiBackground: { color: C2.section }
4591
- },
4583
+ this.activeTab === "controls" && this.venue && this.controls.length > 0 && /* @__PURE__ */ import_react_ecs7.default.createElement(this.ControlsTab, null),
4584
+ this.activeTab === "video" && /* @__PURE__ */ import_react_ecs7.default.createElement(this.VideoTab, null),
4585
+ this.activeTab === "mod" && this.isOwner && /* @__PURE__ */ import_react_ecs7.default.createElement(this.ModTab, null),
4586
+ this.config.sceneTabs?.map((tab) => this.activeTab === tab.id && tab.render())
4587
+ ),
4588
+ // Footer
4592
4589
  /* @__PURE__ */ import_react_ecs7.default.createElement(
4593
- import_react_ecs7.Button,
4590
+ import_react_ecs7.UiEntity,
4594
4591
  {
4595
- uiTransform: { height: this.s(24) },
4596
- uiBackground: { color: import_math7.Color4.create(0, 0, 0, 0) },
4597
- value: `thestatic.tv/scene/${this.config.sceneId}`,
4598
- fontSize: t.labelSmall,
4599
- color: C2.cyan,
4600
- onMouseDown: () => (0, import_RestrictedActions6.openExternalUrl)({ url: this.config.footerLink || `https://thestatic.tv/scene/${this.config.sceneId}` })
4601
- }
4592
+ uiTransform: {
4593
+ width: "100%",
4594
+ height: this.s(UI_DIMENSIONS.admin.footerHeight),
4595
+ justifyContent: "center",
4596
+ alignItems: "center"
4597
+ },
4598
+ uiBackground: { color: C2.section }
4599
+ },
4600
+ /* @__PURE__ */ import_react_ecs7.default.createElement(
4601
+ import_react_ecs7.Button,
4602
+ {
4603
+ uiTransform: { height: this.s(24) },
4604
+ uiBackground: { color: import_math7.Color4.create(0, 0, 0, 0) },
4605
+ value: `thestatic.tv/scene/${this.config.sceneId}`,
4606
+ fontSize: t.labelSmall,
4607
+ color: C2.cyan,
4608
+ onMouseDown: () => (0, import_RestrictedActions6.openExternalUrl)({ url: this.config.footerLink || `https://thestatic.tv/scene/${this.config.sceneId}` })
4609
+ }
4610
+ )
4602
4611
  )
4603
- )
4604
- )
4612
+ ]
4613
+ })
4605
4614
  );
4606
4615
  };
4607
4616
  this.client = client;
@@ -5860,6 +5869,31 @@ var AdminPanelUIModule = class {
5860
5869
 
5861
5870
  // src/StaticTVClient.ts
5862
5871
  var import_Runtime2 = require("~system/Runtime");
5872
+
5873
+ // src/ui/toolbar-panel.ts
5874
+ var import_react_ecs8 = __toESM(require("@dcl/sdk/react-ecs"));
5875
+ function toolbarPanel(props, phone, uiScale = 1) {
5876
+ if (!phone) return import_react_ecs8.default.createElement(import_react_ecs8.UiEntity, props);
5877
+ const { key, uiTransform = {}, ...rest } = props;
5878
+ const { position: _position, positionType: _positionType, ...ownLayout } = uiTransform;
5879
+ const spacer = () => import_react_ecs8.default.createElement(import_react_ecs8.UiEntity, { uiTransform: { height: 0, flexGrow: 1 } });
5880
+ return import_react_ecs8.default.createElement(import_react_ecs8.UiEntity, {
5881
+ key,
5882
+ uiTransform: {
5883
+ positionType: "absolute",
5884
+ position: { right: panelRight(true, 0, uiScale), top: 0 },
5885
+ height: "100%",
5886
+ flexDirection: "column"
5887
+ },
5888
+ children: [
5889
+ spacer(),
5890
+ import_react_ecs8.default.createElement(import_react_ecs8.UiEntity, { ...rest, uiTransform: { ...ownLayout, flexShrink: 0 } }),
5891
+ spacer()
5892
+ ]
5893
+ });
5894
+ }
5895
+
5896
+ // src/StaticTVClient.ts
5863
5897
  var import_ecs5 = require("@dcl/sdk/ecs");
5864
5898
  var utils = __toESM(require("@dcl-sdk/utils"));
5865
5899
  var DEFAULT_BASE_URL = "https://thestatic.tv/api/v1/dcl";
@@ -6881,24 +6915,48 @@ var _StaticTVClient = class _StaticTVClient {
6881
6915
  toolbarButton(slot, props) {
6882
6916
  return toolbarButton(slot, props, this.isPhone, this.uiScale);
6883
6917
  }
6884
- /** Where a scene's own panel's right edge goes: on a phone just left of the column; elsewhere `desktopRight` */
6918
+ /** Where a scene's own panel's right edge goes: on a phone one gap left of the column; elsewhere `desktopRight` */
6885
6919
  panelRight(desktopRight) {
6886
6920
  return panelRight(this.isPhone, desktopRight, this.uiScale);
6887
6921
  }
6888
6922
  /**
6889
- * 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
6890
- * scene's), `hide` runs. The SDK's own names (guide, chat, admin) are taken. Call panelOpened(name) when it opens.
6923
+ * Draw one of the scene's own panels in its place (2.13.0): on desktop exactly as `props` say (their absolute
6924
+ * position included), on a phone centered on the screen's height one gap left of the toolbar's column, its top at
6925
+ * (canvas height - panel height) / 2 - or at the canvas's top when the panel is taller, so its header and close
6926
+ * button stay on screen. `props` is the panel's UiEntity props as on desktop: key, uiTransform, uiBackground,
6927
+ * children. The SDK's own chat, guide and admin panel draw through it.
6928
+ *
6929
+ * @example
6930
+ * ```typescript
6931
+ * myPanel.isOpen ? staticTV.toolbarPanel({
6932
+ * uiTransform: { positionType: 'absolute', position: { right: 20, bottom: 55 }, width: 380, height: 580 },
6933
+ * uiBackground: { color: Color4.create(0.05, 0.05, 0.08, 0.98) },
6934
+ * children: [header, body],
6935
+ * }) : null
6936
+ * ```
6937
+ */
6938
+ toolbarPanel(props) {
6939
+ return toolbarPanel(props, this.isPhone, this.uiScale);
6940
+ }
6941
+ /**
6942
+ * Put one of the scene's own panels under the panel rule: on a phone, when another panel opens (the SDK's or the
6943
+ * scene's), `hide` runs. On desktop (2.13.0), with `{ coversGuide: true }`, the panel and the guide's place close
6944
+ * each other: opening it closes the guide and the admin panel, and opening either runs `hide`; without it, the SDK
6945
+ * leaves the panel to the scene there. The SDK's own names (guide, chat, admin) are taken. Call panelOpened(name)
6946
+ * when it opens.
6891
6947
  */
6892
- registerPanel(name, hide) {
6948
+ registerPanel(name, hide, options = {}) {
6893
6949
  if (_StaticTVClient.OWN_PANELS.includes(name)) {
6894
6950
  this.log(`registerPanel: '${name}' is one of the SDK's own panels - pick another name`);
6895
6951
  return;
6896
6952
  }
6897
- this.panelRules.register(name, hide);
6953
+ this.panelRules.register(name, hide, options);
6898
6954
  }
6899
6955
  /**
6900
- * A panel opened: on a phone every other one closes, the SDK's and the scene's registered ones; elsewhere the guide
6901
- * and the admin panel close each other, as before, and a scene's own panel closes nothing here.
6956
+ * A panel opened: on a phone every other one closes, the SDK's and the scene's registered ones. Elsewhere a panel
6957
+ * closes any panel it would cover: the guide and the admin panel close each other, and each closes a scene's panel
6958
+ * registered with coversGuide, as that panel closes them (2.13.0); the chat stays open beside the guide or the admin
6959
+ * panel, and a scene's other panels are left to the scene.
6902
6960
  */
6903
6961
  panelOpened(name) {
6904
6962
  this.panelRules.opened(name);
package/dist/index.mjs CHANGED
@@ -1521,6 +1521,7 @@ import ReactEcs2, { UiEntity as UiEntity2 } from "@dcl/sdk/react-ecs";
1521
1521
  // src/ui/toolbar.ts
1522
1522
  var TOOLBAR = { edge: 20, gap: 10, buttonWidth: 100, buttonHeight: 45, bottom: 10 };
1523
1523
  var COLUMN_SLOTS = 5;
1524
+ var PHONE_EDGE = 0;
1524
1525
  function platformOf(answer) {
1525
1526
  const raw = answer?.platform;
1526
1527
  if (typeof raw !== "string") return "unknown";
@@ -1537,32 +1538,38 @@ function rowRight(slot, uiScale = 1) {
1537
1538
  function columnSlot(slot, uiScale = 1) {
1538
1539
  const h = scaled(TOOLBAR.buttonHeight, uiScale);
1539
1540
  return {
1540
- right: TOOLBAR.edge,
1541
+ right: PHONE_EDGE,
1541
1542
  boxHeight: COLUMN_SLOTS * h + (COLUMN_SLOTS - 1) * TOOLBAR.gap,
1542
1543
  above: Math.max(0, slot) * (h + TOOLBAR.gap)
1543
1544
  };
1544
1545
  }
1545
1546
  function panelRight(phone, desktopRight, uiScale = 1) {
1546
- return phone ? TOOLBAR.edge + scaled(TOOLBAR.buttonWidth, uiScale) + TOOLBAR.gap : desktopRight;
1547
+ return phone ? PHONE_EDGE + scaled(TOOLBAR.buttonWidth, uiScale) + TOOLBAR.gap : desktopRight;
1547
1548
  }
1548
1549
  var DESKTOP_CLOSES = { guide: ["admin"], admin: ["guide"] };
1549
- function panelsToClose(opened, registered, phone) {
1550
+ var GUIDE_PLACE = ["guide", "admin"];
1551
+ function panelsToClose(opened, registered, phone, coversGuide = []) {
1550
1552
  if (phone) return registered.filter((name) => name !== opened);
1551
- const closes = DESKTOP_CLOSES[opened] ?? [];
1552
- return registered.filter((name) => closes.includes(name));
1553
+ const closes = [...DESKTOP_CLOSES[opened] ?? []];
1554
+ if (GUIDE_PLACE.includes(opened)) closes.push(...coversGuide);
1555
+ if (coversGuide.includes(opened)) closes.push(...GUIDE_PLACE);
1556
+ return registered.filter((name) => name !== opened && closes.includes(name));
1553
1557
  }
1554
1558
  var PanelRules = class {
1555
1559
  constructor(phone) {
1556
1560
  this.hides = /* @__PURE__ */ new Map();
1561
+ this.coveringGuide = /* @__PURE__ */ new Set();
1557
1562
  this.phone = phone;
1558
1563
  }
1559
1564
  /** Register (or replace) a panel; its hide runs when another panel opens and the rule says so */
1560
- register(name, hide) {
1565
+ register(name, hide, options = {}) {
1561
1566
  this.hides.set(name, hide);
1567
+ if (options.coversGuide === true) this.coveringGuide.add(name);
1568
+ else this.coveringGuide.delete(name);
1562
1569
  }
1563
1570
  /** A panel opened: close the ones the rule names. One failing hide does not stop the rest. */
1564
1571
  opened(name) {
1565
- for (const other of panelsToClose(name, [...this.hides.keys()], this.phone())) {
1572
+ for (const other of panelsToClose(name, [...this.hides.keys()], this.phone(), [...this.coveringGuide])) {
1566
1573
  try {
1567
1574
  this.hides.get(other)?.();
1568
1575
  } catch {
@@ -1662,14 +1669,14 @@ var GuideUIModule = class {
1662
1669
  this.renderToggleButton(),
1663
1670
  // Render panel when visible - Guide positioned relative to Chat's scaled width
1664
1671
  // Guide.right = Chat.right + Chat.scaledWidth + gap (10px)
1665
- this._isVisible ? ReactEcs3.createElement(UiEntity3, {
1672
+ // On a phone centered beside the toolbar's column (2.13.0, src/ui/toolbar-panel.ts); elsewhere as here
1673
+ this._isVisible ? this.client.toolbarPanel({
1666
1674
  key: `guide-panel-${this.client.uiScale}`,
1667
1675
  uiTransform: {
1668
1676
  width: windowW,
1669
1677
  height: windowH,
1670
1678
  positionType: "absolute",
1671
- // On a phone, left of the toolbar's column (2.12.0); elsewhere left of the chat panel, as before
1672
- position: { bottom: UI_DIMENSIONS.guide.bottom, right: this.client.panelRight(UI_DIMENSIONS.chat.right + this.s(UI_DIMENSIONS.chat.width) + 10) },
1679
+ position: { bottom: UI_DIMENSIONS.guide.bottom, right: UI_DIMENSIONS.chat.right + this.s(UI_DIMENSIONS.chat.width) + 10 },
1673
1680
  flexDirection: "row",
1674
1681
  border: { top: 2, bottom: 2, left: 2, right: 2 },
1675
1682
  borderColor: THEME.colors.panelBorder
@@ -2488,14 +2495,14 @@ var ChatUIModule = class {
2488
2495
  this.renderToggleButton(),
2489
2496
  // Render panel when visible - scaled sizes, fixed position
2490
2497
  // Key includes uiScale to force re-render when scale changes from other panels
2491
- this._isVisible ? ReactEcs4.createElement(UiEntity4, {
2498
+ // On a phone centered beside the toolbar's column (2.13.0, src/ui/toolbar-panel.ts); elsewhere as here
2499
+ this._isVisible ? this.client.toolbarPanel({
2492
2500
  key: `chat-panel-${this.client.uiScale}`,
2493
2501
  uiTransform: {
2494
2502
  width: this.s(UI_DIMENSIONS.chat.width),
2495
2503
  height: this.s(UI_DIMENSIONS.chat.height),
2496
2504
  positionType: "absolute",
2497
- // On a phone, left of the toolbar's column (2.12.0); elsewhere at the right edge, as before
2498
- position: { bottom: UI_DIMENSIONS.chat.bottom, right: this.client.panelRight(UI_DIMENSIONS.chat.right) },
2505
+ position: { bottom: UI_DIMENSIONS.chat.bottom, right: UI_DIMENSIONS.chat.right },
2499
2506
  flexDirection: "column",
2500
2507
  border: { top: 2, bottom: 2, left: 2, right: 2 },
2501
2508
  borderColor: THEME.colors.panelBorder
@@ -4470,87 +4477,89 @@ var AdminPanelUIModule = class {
4470
4477
  },
4471
4478
  this.renderToggleFace()
4472
4479
  ),
4473
- this.panelOpen && /* @__PURE__ */ ReactEcs7.createElement(
4474
- UiEntity7,
4475
- {
4476
- key: `admin-panel-${this.client.uiScale}`,
4477
- uiTransform: {
4478
- width: this.s(UI_DIMENSIONS.admin.width),
4479
- height: this.s(UI_DIMENSIONS.admin.height),
4480
- maxHeight: this.s(UI_DIMENSIONS.admin.maxHeight),
4481
- // On a phone, left of the toolbar's column (2.12.0); elsewhere left of the chat panel, as before
4482
- position: { right: this.client.panelRight(UI_DIMENSIONS.chat.right + this.s(UI_DIMENSIONS.chat.width) + 10), bottom: UI_DIMENSIONS.admin.bottom },
4483
- positionType: "absolute",
4484
- flexDirection: "column"
4485
- },
4486
- uiBackground: { color: C2.bg }
4480
+ this.panelOpen && this.client.toolbarPanel({
4481
+ key: `admin-panel-${this.client.uiScale}`,
4482
+ uiTransform: {
4483
+ width: this.s(UI_DIMENSIONS.admin.width),
4484
+ height: this.s(UI_DIMENSIONS.admin.height),
4485
+ maxHeight: this.s(UI_DIMENSIONS.admin.maxHeight),
4486
+ position: { right: UI_DIMENSIONS.chat.right + this.s(UI_DIMENSIONS.chat.width) + 10, bottom: UI_DIMENSIONS.admin.bottom },
4487
+ positionType: "absolute",
4488
+ flexDirection: "column"
4487
4489
  },
4488
- /* @__PURE__ */ ReactEcs7.createElement(
4489
- UiEntity7,
4490
- {
4491
- uiTransform: {
4492
- width: "100%",
4493
- height: this.s(UI_DIMENSIONS.admin.headerHeight),
4494
- justifyContent: "space-between",
4495
- alignItems: "center",
4496
- flexDirection: "row",
4497
- padding: { left: 12, right: 8 }
4490
+ uiBackground: { color: C2.bg },
4491
+ children: [
4492
+ // Header with font controls
4493
+ /* @__PURE__ */ ReactEcs7.createElement(
4494
+ UiEntity7,
4495
+ {
4496
+ uiTransform: {
4497
+ width: "100%",
4498
+ height: this.s(UI_DIMENSIONS.admin.headerHeight),
4499
+ justifyContent: "space-between",
4500
+ alignItems: "center",
4501
+ flexDirection: "row",
4502
+ padding: { left: 12, right: 8 }
4503
+ },
4504
+ uiBackground: { color: C2.header }
4498
4505
  },
4499
- uiBackground: { color: C2.header }
4500
- },
4501
- /* @__PURE__ */ ReactEcs7.createElement(Label6, { value: this.config.title || "ADMIN PANEL", fontSize: t.header, color: C2.text }),
4506
+ /* @__PURE__ */ ReactEcs7.createElement(Label6, { value: this.config.title || "ADMIN PANEL", fontSize: t.header, color: C2.text }),
4507
+ /* @__PURE__ */ ReactEcs7.createElement(
4508
+ Button4,
4509
+ {
4510
+ uiTransform: { width: this.s(28), height: this.s(28) },
4511
+ uiBackground: { color: Color46.create(0, 0, 0, 0.3) },
4512
+ value: "X",
4513
+ fontSize: t.header,
4514
+ color: THEME.colors.red,
4515
+ onMouseDown: () => this.hide()
4516
+ }
4517
+ )
4518
+ ),
4519
+ // Tabs
4520
+ /* @__PURE__ */ ReactEcs7.createElement(UiEntity7, { uiTransform: { width: "100%", height: this.s(UI_DIMENSIONS.admin.tabHeight), flexDirection: "row" } }, tabs.map((tab) => /* @__PURE__ */ ReactEcs7.createElement(this.TabBtn, { label: tab.label, tab: tab.id }))),
4521
+ // Content
4502
4522
  /* @__PURE__ */ ReactEcs7.createElement(
4503
- Button4,
4523
+ UiEntity7,
4504
4524
  {
4505
- uiTransform: { width: this.s(28), height: this.s(28) },
4506
- uiBackground: { color: Color46.create(0, 0, 0, 0.3) },
4507
- value: "X",
4508
- fontSize: t.header,
4509
- color: THEME.colors.red,
4510
- onMouseDown: () => this.hide()
4511
- }
4512
- )
4513
- ),
4514
- /* @__PURE__ */ ReactEcs7.createElement(UiEntity7, { uiTransform: { width: "100%", height: this.s(UI_DIMENSIONS.admin.tabHeight), flexDirection: "row" } }, tabs.map((tab) => /* @__PURE__ */ ReactEcs7.createElement(this.TabBtn, { label: tab.label, tab: tab.id }))),
4515
- /* @__PURE__ */ ReactEcs7.createElement(
4516
- UiEntity7,
4517
- {
4518
- uiTransform: {
4519
- width: "100%",
4520
- flexGrow: 1,
4521
- overflow: "scroll",
4522
- flexDirection: "column"
4523
- }
4524
- },
4525
- this.activeTab === "controls" && this.venue && this.controls.length > 0 && /* @__PURE__ */ ReactEcs7.createElement(this.ControlsTab, null),
4526
- this.activeTab === "video" && /* @__PURE__ */ ReactEcs7.createElement(this.VideoTab, null),
4527
- this.activeTab === "mod" && this.isOwner && /* @__PURE__ */ ReactEcs7.createElement(this.ModTab, null),
4528
- this.config.sceneTabs?.map((tab) => this.activeTab === tab.id && tab.render())
4529
- ),
4530
- /* @__PURE__ */ ReactEcs7.createElement(
4531
- UiEntity7,
4532
- {
4533
- uiTransform: {
4534
- width: "100%",
4535
- height: this.s(UI_DIMENSIONS.admin.footerHeight),
4536
- justifyContent: "center",
4537
- alignItems: "center"
4525
+ uiTransform: {
4526
+ width: "100%",
4527
+ flexGrow: 1,
4528
+ overflow: "scroll",
4529
+ flexDirection: "column"
4530
+ }
4538
4531
  },
4539
- uiBackground: { color: C2.section }
4540
- },
4532
+ this.activeTab === "controls" && this.venue && this.controls.length > 0 && /* @__PURE__ */ ReactEcs7.createElement(this.ControlsTab, null),
4533
+ this.activeTab === "video" && /* @__PURE__ */ ReactEcs7.createElement(this.VideoTab, null),
4534
+ this.activeTab === "mod" && this.isOwner && /* @__PURE__ */ ReactEcs7.createElement(this.ModTab, null),
4535
+ this.config.sceneTabs?.map((tab) => this.activeTab === tab.id && tab.render())
4536
+ ),
4537
+ // Footer
4541
4538
  /* @__PURE__ */ ReactEcs7.createElement(
4542
- Button4,
4539
+ UiEntity7,
4543
4540
  {
4544
- uiTransform: { height: this.s(24) },
4545
- uiBackground: { color: Color46.create(0, 0, 0, 0) },
4546
- value: `thestatic.tv/scene/${this.config.sceneId}`,
4547
- fontSize: t.labelSmall,
4548
- color: C2.cyan,
4549
- onMouseDown: () => openExternalUrl5({ url: this.config.footerLink || `https://thestatic.tv/scene/${this.config.sceneId}` })
4550
- }
4541
+ uiTransform: {
4542
+ width: "100%",
4543
+ height: this.s(UI_DIMENSIONS.admin.footerHeight),
4544
+ justifyContent: "center",
4545
+ alignItems: "center"
4546
+ },
4547
+ uiBackground: { color: C2.section }
4548
+ },
4549
+ /* @__PURE__ */ ReactEcs7.createElement(
4550
+ Button4,
4551
+ {
4552
+ uiTransform: { height: this.s(24) },
4553
+ uiBackground: { color: Color46.create(0, 0, 0, 0) },
4554
+ value: `thestatic.tv/scene/${this.config.sceneId}`,
4555
+ fontSize: t.labelSmall,
4556
+ color: C2.cyan,
4557
+ onMouseDown: () => openExternalUrl5({ url: this.config.footerLink || `https://thestatic.tv/scene/${this.config.sceneId}` })
4558
+ }
4559
+ )
4551
4560
  )
4552
- )
4553
- )
4561
+ ]
4562
+ })
4554
4563
  );
4555
4564
  };
4556
4565
  this.client = client;
@@ -5809,6 +5818,31 @@ var AdminPanelUIModule = class {
5809
5818
 
5810
5819
  // src/StaticTVClient.ts
5811
5820
  import { getExplorerInformation } from "~system/Runtime";
5821
+
5822
+ // src/ui/toolbar-panel.ts
5823
+ import ReactEcs8, { UiEntity as UiEntity8 } from "@dcl/sdk/react-ecs";
5824
+ function toolbarPanel(props, phone, uiScale = 1) {
5825
+ if (!phone) return ReactEcs8.createElement(UiEntity8, props);
5826
+ const { key, uiTransform = {}, ...rest } = props;
5827
+ const { position: _position, positionType: _positionType, ...ownLayout } = uiTransform;
5828
+ const spacer = () => ReactEcs8.createElement(UiEntity8, { uiTransform: { height: 0, flexGrow: 1 } });
5829
+ return ReactEcs8.createElement(UiEntity8, {
5830
+ key,
5831
+ uiTransform: {
5832
+ positionType: "absolute",
5833
+ position: { right: panelRight(true, 0, uiScale), top: 0 },
5834
+ height: "100%",
5835
+ flexDirection: "column"
5836
+ },
5837
+ children: [
5838
+ spacer(),
5839
+ ReactEcs8.createElement(UiEntity8, { ...rest, uiTransform: { ...ownLayout, flexShrink: 0 } }),
5840
+ spacer()
5841
+ ]
5842
+ });
5843
+ }
5844
+
5845
+ // src/StaticTVClient.ts
5812
5846
  import { VideoPlayer, videoEventsSystem, VideoState } from "@dcl/sdk/ecs";
5813
5847
  import * as utils from "@dcl-sdk/utils";
5814
5848
  var DEFAULT_BASE_URL = "https://thestatic.tv/api/v1/dcl";
@@ -6830,24 +6864,48 @@ var _StaticTVClient = class _StaticTVClient {
6830
6864
  toolbarButton(slot, props) {
6831
6865
  return toolbarButton(slot, props, this.isPhone, this.uiScale);
6832
6866
  }
6833
- /** Where a scene's own panel's right edge goes: on a phone just left of the column; elsewhere `desktopRight` */
6867
+ /** Where a scene's own panel's right edge goes: on a phone one gap left of the column; elsewhere `desktopRight` */
6834
6868
  panelRight(desktopRight) {
6835
6869
  return panelRight(this.isPhone, desktopRight, this.uiScale);
6836
6870
  }
6837
6871
  /**
6838
- * 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
6839
- * scene's), `hide` runs. The SDK's own names (guide, chat, admin) are taken. Call panelOpened(name) when it opens.
6872
+ * Draw one of the scene's own panels in its place (2.13.0): on desktop exactly as `props` say (their absolute
6873
+ * position included), on a phone centered on the screen's height one gap left of the toolbar's column, its top at
6874
+ * (canvas height - panel height) / 2 - or at the canvas's top when the panel is taller, so its header and close
6875
+ * button stay on screen. `props` is the panel's UiEntity props as on desktop: key, uiTransform, uiBackground,
6876
+ * children. The SDK's own chat, guide and admin panel draw through it.
6877
+ *
6878
+ * @example
6879
+ * ```typescript
6880
+ * myPanel.isOpen ? staticTV.toolbarPanel({
6881
+ * uiTransform: { positionType: 'absolute', position: { right: 20, bottom: 55 }, width: 380, height: 580 },
6882
+ * uiBackground: { color: Color4.create(0.05, 0.05, 0.08, 0.98) },
6883
+ * children: [header, body],
6884
+ * }) : null
6885
+ * ```
6886
+ */
6887
+ toolbarPanel(props) {
6888
+ return toolbarPanel(props, this.isPhone, this.uiScale);
6889
+ }
6890
+ /**
6891
+ * Put one of the scene's own panels under the panel rule: on a phone, when another panel opens (the SDK's or the
6892
+ * scene's), `hide` runs. On desktop (2.13.0), with `{ coversGuide: true }`, the panel and the guide's place close
6893
+ * each other: opening it closes the guide and the admin panel, and opening either runs `hide`; without it, the SDK
6894
+ * leaves the panel to the scene there. The SDK's own names (guide, chat, admin) are taken. Call panelOpened(name)
6895
+ * when it opens.
6840
6896
  */
6841
- registerPanel(name, hide) {
6897
+ registerPanel(name, hide, options = {}) {
6842
6898
  if (_StaticTVClient.OWN_PANELS.includes(name)) {
6843
6899
  this.log(`registerPanel: '${name}' is one of the SDK's own panels - pick another name`);
6844
6900
  return;
6845
6901
  }
6846
- this.panelRules.register(name, hide);
6902
+ this.panelRules.register(name, hide, options);
6847
6903
  }
6848
6904
  /**
6849
- * A panel opened: on a phone every other one closes, the SDK's and the scene's registered ones; elsewhere the guide
6850
- * and the admin panel close each other, as before, and a scene's own panel closes nothing here.
6905
+ * A panel opened: on a phone every other one closes, the SDK's and the scene's registered ones. Elsewhere a panel
6906
+ * closes any panel it would cover: the guide and the admin panel close each other, and each closes a scene's panel
6907
+ * registered with coversGuide, as that panel closes them (2.13.0); the chat stays open beside the guide or the admin
6908
+ * panel, and a scene's other panels are left to the scene.
6851
6909
  */
6852
6910
  panelOpened(name) {
6853
6911
  this.panelRules.opened(name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thestatic-tv/dcl-sdk",
3
- "version": "2.12.0",
3
+ "version": "2.13.0",
4
4
  "description": "Connect your Decentraland scene to thestatic.tv - full channel lineup, metrics tracking, and interactions",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",