@thestatic-tv/dcl-sdk 2.13.0 → 2.14.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 +13 -0
- package/dist/index.d.mts +16 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +510 -363
- package/dist/index.mjs +460 -313
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1272,7 +1272,7 @@ async function signedRequest(url, init = {}) {
|
|
|
1272
1272
|
}
|
|
1273
1273
|
|
|
1274
1274
|
// src/ui/guide-ui.tsx
|
|
1275
|
-
import
|
|
1275
|
+
import ReactEcs2, { UiEntity as UiEntity2, Input as Input2, Label as Label2 } from "@dcl/sdk/react-ecs";
|
|
1276
1276
|
import { Color4 as Color43 } from "@dcl/sdk/math";
|
|
1277
1277
|
import { openExternalUrl as openExternalUrl2 } from "~system/RestrictedActions";
|
|
1278
1278
|
|
|
@@ -1515,112 +1515,8 @@ function truncateText(text, maxLength) {
|
|
|
1515
1515
|
return text.substring(0, maxLength - 3) + "...";
|
|
1516
1516
|
}
|
|
1517
1517
|
|
|
1518
|
-
// src/
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
// src/ui/toolbar.ts
|
|
1522
|
-
var TOOLBAR = { edge: 20, gap: 10, buttonWidth: 100, buttonHeight: 45, bottom: 10 };
|
|
1523
|
-
var COLUMN_SLOTS = 5;
|
|
1524
|
-
var PHONE_EDGE = 0;
|
|
1525
|
-
function platformOf(answer) {
|
|
1526
|
-
const raw = answer?.platform;
|
|
1527
|
-
if (typeof raw !== "string") return "unknown";
|
|
1528
|
-
const p = raw.trim().toLowerCase();
|
|
1529
|
-
return p === "desktop" || p === "mobile" || p === "vr" || p === "web" ? p : "unknown";
|
|
1530
|
-
}
|
|
1531
|
-
function isPhonePlatform(platform) {
|
|
1532
|
-
return platform === "mobile";
|
|
1533
|
-
}
|
|
1534
|
-
var scaled = (value, uiScale) => Math.round(value * uiScale);
|
|
1535
|
-
function rowRight(slot, uiScale = 1) {
|
|
1536
|
-
return TOOLBAR.edge + slot * (scaled(TOOLBAR.buttonWidth, uiScale) + TOOLBAR.gap);
|
|
1537
|
-
}
|
|
1538
|
-
function columnSlot(slot, uiScale = 1) {
|
|
1539
|
-
const h = scaled(TOOLBAR.buttonHeight, uiScale);
|
|
1540
|
-
return {
|
|
1541
|
-
right: PHONE_EDGE,
|
|
1542
|
-
boxHeight: COLUMN_SLOTS * h + (COLUMN_SLOTS - 1) * TOOLBAR.gap,
|
|
1543
|
-
above: Math.max(0, slot) * (h + TOOLBAR.gap)
|
|
1544
|
-
};
|
|
1545
|
-
}
|
|
1546
|
-
function panelRight(phone, desktopRight, uiScale = 1) {
|
|
1547
|
-
return phone ? PHONE_EDGE + scaled(TOOLBAR.buttonWidth, uiScale) + TOOLBAR.gap : desktopRight;
|
|
1548
|
-
}
|
|
1549
|
-
var DESKTOP_CLOSES = { guide: ["admin"], admin: ["guide"] };
|
|
1550
|
-
var GUIDE_PLACE = ["guide", "admin"];
|
|
1551
|
-
function panelsToClose(opened, registered, phone, coversGuide = []) {
|
|
1552
|
-
if (phone) return registered.filter((name) => name !== opened);
|
|
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));
|
|
1557
|
-
}
|
|
1558
|
-
var PanelRules = class {
|
|
1559
|
-
constructor(phone) {
|
|
1560
|
-
this.hides = /* @__PURE__ */ new Map();
|
|
1561
|
-
this.coveringGuide = /* @__PURE__ */ new Set();
|
|
1562
|
-
this.phone = phone;
|
|
1563
|
-
}
|
|
1564
|
-
/** Register (or replace) a panel; its hide runs when another panel opens and the rule says so */
|
|
1565
|
-
register(name, hide, options = {}) {
|
|
1566
|
-
this.hides.set(name, hide);
|
|
1567
|
-
if (options.coversGuide === true) this.coveringGuide.add(name);
|
|
1568
|
-
else this.coveringGuide.delete(name);
|
|
1569
|
-
}
|
|
1570
|
-
/** A panel opened: close the ones the rule names. One failing hide does not stop the rest. */
|
|
1571
|
-
opened(name) {
|
|
1572
|
-
for (const other of panelsToClose(name, [...this.hides.keys()], this.phone(), [...this.coveringGuide])) {
|
|
1573
|
-
try {
|
|
1574
|
-
this.hides.get(other)?.();
|
|
1575
|
-
} catch {
|
|
1576
|
-
}
|
|
1577
|
-
}
|
|
1578
|
-
}
|
|
1579
|
-
get names() {
|
|
1580
|
-
return [...this.hides.keys()];
|
|
1581
|
-
}
|
|
1582
|
-
};
|
|
1583
|
-
|
|
1584
|
-
// src/ui/toolbar-button.ts
|
|
1585
|
-
function toolbarButton(slot, props, phone, uiScale = 1) {
|
|
1586
|
-
const width = Math.round(TOOLBAR.buttonWidth * uiScale);
|
|
1587
|
-
const height = Math.round(TOOLBAR.buttonHeight * uiScale);
|
|
1588
|
-
if (!phone) {
|
|
1589
|
-
return ReactEcs2.createElement(UiEntity2, {
|
|
1590
|
-
...props,
|
|
1591
|
-
uiTransform: {
|
|
1592
|
-
positionType: "absolute",
|
|
1593
|
-
position: { right: rowRight(slot, uiScale), bottom: TOOLBAR.bottom },
|
|
1594
|
-
width,
|
|
1595
|
-
height,
|
|
1596
|
-
...props.uiTransform
|
|
1597
|
-
}
|
|
1598
|
-
});
|
|
1599
|
-
}
|
|
1600
|
-
const place = columnSlot(slot, uiScale);
|
|
1601
|
-
return ReactEcs2.createElement(UiEntity2, {
|
|
1602
|
-
uiTransform: {
|
|
1603
|
-
positionType: "absolute",
|
|
1604
|
-
position: { right: place.right, top: 0 },
|
|
1605
|
-
width,
|
|
1606
|
-
height: "100%",
|
|
1607
|
-
flexDirection: "column",
|
|
1608
|
-
justifyContent: "center"
|
|
1609
|
-
},
|
|
1610
|
-
children: [
|
|
1611
|
-
ReactEcs2.createElement(UiEntity2, {
|
|
1612
|
-
uiTransform: { width, height: place.boxHeight, flexDirection: "column", flexShrink: 0 },
|
|
1613
|
-
children: [
|
|
1614
|
-
ReactEcs2.createElement(UiEntity2, { uiTransform: { width, height: place.above, flexShrink: 0 } }),
|
|
1615
|
-
ReactEcs2.createElement(UiEntity2, {
|
|
1616
|
-
...props,
|
|
1617
|
-
uiTransform: { width, height, flexShrink: 0, ...props.uiTransform }
|
|
1618
|
-
})
|
|
1619
|
-
]
|
|
1620
|
-
})
|
|
1621
|
-
]
|
|
1622
|
-
});
|
|
1623
|
-
}
|
|
1518
|
+
// src/version.ts
|
|
1519
|
+
var SDK_VERSION = true ? "2.14.0" : "unknown";
|
|
1624
1520
|
|
|
1625
1521
|
// src/ui/guide-ui.tsx
|
|
1626
1522
|
function withLock(mapped, v, fallback) {
|
|
@@ -1657,7 +1553,7 @@ var GuideUIModule = class {
|
|
|
1657
1553
|
if (this.client.isVisitorBlocked) return null;
|
|
1658
1554
|
const windowW = UI_DIMENSIONS.guide.width;
|
|
1659
1555
|
const windowH = UI_DIMENSIONS.guide.height;
|
|
1660
|
-
return
|
|
1556
|
+
return ReactEcs2.createElement(UiEntity2, {
|
|
1661
1557
|
key: `guide-root-${this.client.uiScale}`,
|
|
1662
1558
|
uiTransform: {
|
|
1663
1559
|
width: "100%",
|
|
@@ -1886,7 +1782,7 @@ var GuideUIModule = class {
|
|
|
1886
1782
|
const nodesPlaylist = this.featuredPlaylists.find((p) => p.name === "NODES");
|
|
1887
1783
|
const nodesCount = nodesPlaylist ? nodesPlaylist.videos.filter((v) => v.isCreator).length : 0;
|
|
1888
1784
|
const displayedPlaylists = this.featuredPlaylists.filter((p) => p.name !== "NODES").slice(0, 6);
|
|
1889
|
-
return
|
|
1785
|
+
return ReactEcs2.createElement(UiEntity2, {
|
|
1890
1786
|
uiTransform: {
|
|
1891
1787
|
width: sidebarW,
|
|
1892
1788
|
minWidth: sidebarW,
|
|
@@ -1900,11 +1796,11 @@ var GuideUIModule = class {
|
|
|
1900
1796
|
uiBackground: { color: Color43.create(0, 0, 0, 0.4) },
|
|
1901
1797
|
children: [
|
|
1902
1798
|
// Header & Search
|
|
1903
|
-
|
|
1799
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
1904
1800
|
uiTransform: { width: "100%", flexDirection: "column", padding: 10 },
|
|
1905
1801
|
children: [
|
|
1906
1802
|
// Title row
|
|
1907
|
-
|
|
1803
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
1908
1804
|
uiTransform: {
|
|
1909
1805
|
width: "100%",
|
|
1910
1806
|
height: this.s(40),
|
|
@@ -1914,7 +1810,7 @@ var GuideUIModule = class {
|
|
|
1914
1810
|
},
|
|
1915
1811
|
children: [
|
|
1916
1812
|
// Title
|
|
1917
|
-
|
|
1813
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
1918
1814
|
uiText: {
|
|
1919
1815
|
value: "THE STATIC TV",
|
|
1920
1816
|
fontSize: this.s(UI_DIMENSIONS.guide.sidebar.headerSize),
|
|
@@ -1925,7 +1821,7 @@ var GuideUIModule = class {
|
|
|
1925
1821
|
]
|
|
1926
1822
|
}),
|
|
1927
1823
|
// Random Signal button
|
|
1928
|
-
|
|
1824
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
1929
1825
|
uiTransform: {
|
|
1930
1826
|
width: "100%",
|
|
1931
1827
|
height: this.s(40),
|
|
@@ -1943,13 +1839,13 @@ var GuideUIModule = class {
|
|
|
1943
1839
|
}
|
|
1944
1840
|
},
|
|
1945
1841
|
children: [
|
|
1946
|
-
|
|
1842
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
1947
1843
|
uiText: { value: ">> RANDOM SIGNAL <<", fontSize: this.s(14), color: THEME.colors.cyan }
|
|
1948
1844
|
})
|
|
1949
1845
|
]
|
|
1950
1846
|
}),
|
|
1951
1847
|
// Search input
|
|
1952
|
-
|
|
1848
|
+
ReactEcs2.createElement(Input2, {
|
|
1953
1849
|
placeholder: "SCAN FREQ...",
|
|
1954
1850
|
fontSize: this.s(UI_DIMENSIONS.guide.sidebar.fontSize),
|
|
1955
1851
|
uiTransform: {
|
|
@@ -1969,11 +1865,11 @@ var GuideUIModule = class {
|
|
|
1969
1865
|
]
|
|
1970
1866
|
}),
|
|
1971
1867
|
// Menu items
|
|
1972
|
-
|
|
1868
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
1973
1869
|
uiTransform: { flexGrow: 1, flexDirection: "column", width: "100%", padding: { top: 5 } },
|
|
1974
1870
|
children: [
|
|
1975
1871
|
// Section header
|
|
1976
|
-
|
|
1872
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
1977
1873
|
uiTransform: { padding: { left: 10, bottom: 8, top: 5 } },
|
|
1978
1874
|
uiText: { value: "GLOBAL NETWORK", fontSize: this.s(12), color: THEME.colors.cyan }
|
|
1979
1875
|
}),
|
|
@@ -1982,12 +1878,12 @@ var GuideUIModule = class {
|
|
|
1982
1878
|
this.renderMenuButton("SIGNALS", signalCount, THEME.colors.white, void 0, "VODS & RECORDINGS"),
|
|
1983
1879
|
this.renderMenuButton("NODES", nodesCount, THEME.colors.magenta, void 0, "CHANNELS & CREATORS"),
|
|
1984
1880
|
// Divider
|
|
1985
|
-
|
|
1881
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
1986
1882
|
uiTransform: { height: 1, width: "90%", margin: { top: 12, bottom: 8, left: 5 } },
|
|
1987
1883
|
uiBackground: { color: THEME.colors.panelBorder }
|
|
1988
1884
|
}),
|
|
1989
1885
|
// Archives section
|
|
1990
|
-
|
|
1886
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
1991
1887
|
uiTransform: { padding: { left: 10, bottom: 8 } },
|
|
1992
1888
|
uiText: { value: "ARCHIVES", fontSize: this.s(12), color: THEME.colors.cyan }
|
|
1993
1889
|
}),
|
|
@@ -1996,6 +1892,11 @@ var GuideUIModule = class {
|
|
|
1996
1892
|
(pl) => this.renderMenuButton(pl.name.toUpperCase(), pl.videos.length, THEME.colors.white, void 0, "PLAYLIST")
|
|
1997
1893
|
)
|
|
1998
1894
|
]
|
|
1895
|
+
}),
|
|
1896
|
+
// The SDK's version, small and dim at the bottom, for a visitor reporting a problem (2.14.0)
|
|
1897
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
1898
|
+
uiTransform: { width: "100%", flexShrink: 0, padding: { left: 10, bottom: 6, top: 4 } },
|
|
1899
|
+
uiText: { value: `TheStatic SDK ${SDK_VERSION}`, fontSize: this.s(11), color: THEME.colors.grayText, textAlign: "bottom-left" }
|
|
1999
1900
|
})
|
|
2000
1901
|
]
|
|
2001
1902
|
});
|
|
@@ -2003,7 +1904,7 @@ var GuideUIModule = class {
|
|
|
2003
1904
|
renderMenuButton(label, count, color, badge, subtitle) {
|
|
2004
1905
|
const isActive = this.activeTab === label;
|
|
2005
1906
|
const buttonHeight = this.s(UI_DIMENSIONS.guide.sidebar.buttonHeight);
|
|
2006
|
-
return
|
|
1907
|
+
return ReactEcs2.createElement(UiEntity2, {
|
|
2007
1908
|
key: label,
|
|
2008
1909
|
uiTransform: {
|
|
2009
1910
|
width: "100%",
|
|
@@ -2022,10 +1923,10 @@ var GuideUIModule = class {
|
|
|
2022
1923
|
this.currentPage = 0;
|
|
2023
1924
|
},
|
|
2024
1925
|
children: [
|
|
2025
|
-
|
|
1926
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2026
1927
|
uiTransform: { flexDirection: "column", alignItems: "flex-start", justifyContent: "center", gap: 0 },
|
|
2027
1928
|
children: [
|
|
2028
|
-
|
|
1929
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2029
1930
|
uiTransform: { height: this.s(18) },
|
|
2030
1931
|
uiText: {
|
|
2031
1932
|
value: `${label} [${count}]`,
|
|
@@ -2035,7 +1936,7 @@ var GuideUIModule = class {
|
|
|
2035
1936
|
}
|
|
2036
1937
|
}),
|
|
2037
1938
|
...subtitle ? [
|
|
2038
|
-
|
|
1939
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2039
1940
|
key: "subtitle",
|
|
2040
1941
|
uiTransform: { height: this.s(12), marginTop: -2 },
|
|
2041
1942
|
uiText: {
|
|
@@ -2049,7 +1950,7 @@ var GuideUIModule = class {
|
|
|
2049
1950
|
]
|
|
2050
1951
|
}),
|
|
2051
1952
|
...badge ? [
|
|
2052
|
-
|
|
1953
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2053
1954
|
key: "badge",
|
|
2054
1955
|
uiText: { value: badge, fontSize: this.s(UI_DIMENSIONS.guide.sidebar.fontSize), color: THEME.colors.red }
|
|
2055
1956
|
})
|
|
@@ -2078,7 +1979,7 @@ var GuideUIModule = class {
|
|
|
2078
1979
|
const start = this.currentPage * this.itemsPerPage;
|
|
2079
1980
|
const paged = videosToShow.slice(start, start + this.itemsPerPage);
|
|
2080
1981
|
const totalPages = Math.ceil(videosToShow.length / this.itemsPerPage);
|
|
2081
|
-
return
|
|
1982
|
+
return ReactEcs2.createElement(UiEntity2, {
|
|
2082
1983
|
uiTransform: {
|
|
2083
1984
|
flexGrow: 1,
|
|
2084
1985
|
flexDirection: "column",
|
|
@@ -2089,7 +1990,7 @@ var GuideUIModule = class {
|
|
|
2089
1990
|
this.renderCardGrid(paged),
|
|
2090
1991
|
// Pagination
|
|
2091
1992
|
...totalPages > 1 ? [
|
|
2092
|
-
|
|
1993
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2093
1994
|
key: "pagination",
|
|
2094
1995
|
uiTransform: {
|
|
2095
1996
|
width: "100%",
|
|
@@ -2102,7 +2003,7 @@ var GuideUIModule = class {
|
|
|
2102
2003
|
},
|
|
2103
2004
|
children: [
|
|
2104
2005
|
...this.currentPage > 0 ? [
|
|
2105
|
-
|
|
2006
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2106
2007
|
key: "prev",
|
|
2107
2008
|
uiText: {
|
|
2108
2009
|
value: "< PREV",
|
|
@@ -2112,7 +2013,7 @@ var GuideUIModule = class {
|
|
|
2112
2013
|
onMouseDown: () => this.currentPage--
|
|
2113
2014
|
})
|
|
2114
2015
|
] : [],
|
|
2115
|
-
|
|
2016
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2116
2017
|
uiText: {
|
|
2117
2018
|
value: `${this.currentPage + 1}/${totalPages}`,
|
|
2118
2019
|
fontSize: this.s(UI_DIMENSIONS.guide.content.bodySize),
|
|
@@ -2120,7 +2021,7 @@ var GuideUIModule = class {
|
|
|
2120
2021
|
}
|
|
2121
2022
|
}),
|
|
2122
2023
|
...this.currentPage < totalPages - 1 ? [
|
|
2123
|
-
|
|
2024
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2124
2025
|
key: "next",
|
|
2125
2026
|
uiText: {
|
|
2126
2027
|
value: "NEXT >",
|
|
@@ -2138,7 +2039,7 @@ var GuideUIModule = class {
|
|
|
2138
2039
|
}
|
|
2139
2040
|
renderCardGrid(videos) {
|
|
2140
2041
|
if (videos.length === 0) {
|
|
2141
|
-
return
|
|
2042
|
+
return ReactEcs2.createElement(UiEntity2, {
|
|
2142
2043
|
uiTransform: { width: "100%", flexGrow: 1, justifyContent: "center", alignItems: "center" },
|
|
2143
2044
|
uiText: { value: "NO SIGNAL", fontSize: this.s(UI_DIMENSIONS.guide.content.bodySize), color: THEME.colors.gray }
|
|
2144
2045
|
});
|
|
@@ -2148,7 +2049,7 @@ var GuideUIModule = class {
|
|
|
2148
2049
|
rows.push(videos.slice(i, i + 2));
|
|
2149
2050
|
}
|
|
2150
2051
|
const cardH = this.s(UI_DIMENSIONS.guide.content.cardHeight);
|
|
2151
|
-
return
|
|
2052
|
+
return ReactEcs2.createElement(UiEntity2, {
|
|
2152
2053
|
uiTransform: {
|
|
2153
2054
|
width: "100%",
|
|
2154
2055
|
flexGrow: 1,
|
|
@@ -2157,7 +2058,7 @@ var GuideUIModule = class {
|
|
|
2157
2058
|
gap: 8
|
|
2158
2059
|
},
|
|
2159
2060
|
children: rows.map(
|
|
2160
|
-
(row, rowIndex) =>
|
|
2061
|
+
(row, rowIndex) => ReactEcs2.createElement(UiEntity2, {
|
|
2161
2062
|
key: `row-${rowIndex}`,
|
|
2162
2063
|
uiTransform: {
|
|
2163
2064
|
width: "100%",
|
|
@@ -2184,7 +2085,7 @@ var GuideUIModule = class {
|
|
|
2184
2085
|
} else if (isActive) {
|
|
2185
2086
|
cardBgColor = Color43.create(0, 0.4, 0, 0.5);
|
|
2186
2087
|
}
|
|
2187
|
-
return
|
|
2088
|
+
return ReactEcs2.createElement(UiEntity2, {
|
|
2188
2089
|
key: video.id,
|
|
2189
2090
|
uiTransform: {
|
|
2190
2091
|
width: cardW,
|
|
@@ -2199,7 +2100,7 @@ var GuideUIModule = class {
|
|
|
2199
2100
|
uiBackground: { color: cardBgColor },
|
|
2200
2101
|
children: [
|
|
2201
2102
|
// Main click area
|
|
2202
|
-
|
|
2103
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2203
2104
|
uiTransform: {
|
|
2204
2105
|
width: "100%",
|
|
2205
2106
|
height: "70%",
|
|
@@ -2209,7 +2110,7 @@ var GuideUIModule = class {
|
|
|
2209
2110
|
},
|
|
2210
2111
|
onMouseDown: () => this.handleVideoSelect(video),
|
|
2211
2112
|
children: [
|
|
2212
|
-
|
|
2113
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2213
2114
|
uiText: {
|
|
2214
2115
|
value: truncateText(video.name || "Unknown", 22),
|
|
2215
2116
|
fontSize: this.s(UI_DIMENSIONS.guide.content.headerSize),
|
|
@@ -2218,7 +2119,7 @@ var GuideUIModule = class {
|
|
|
2218
2119
|
}),
|
|
2219
2120
|
// Status indicator: OFFLINE > CONNECTING > PLAYING > LIVE
|
|
2220
2121
|
...isOffline ? [
|
|
2221
|
-
|
|
2122
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2222
2123
|
key: "offline",
|
|
2223
2124
|
uiText: {
|
|
2224
2125
|
value: "OFFLINE",
|
|
@@ -2227,7 +2128,7 @@ var GuideUIModule = class {
|
|
|
2227
2128
|
}
|
|
2228
2129
|
})
|
|
2229
2130
|
] : isConnecting ? [
|
|
2230
|
-
|
|
2131
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2231
2132
|
key: "connecting",
|
|
2232
2133
|
uiText: {
|
|
2233
2134
|
value: "CONNECTING...",
|
|
@@ -2236,7 +2137,7 @@ var GuideUIModule = class {
|
|
|
2236
2137
|
}
|
|
2237
2138
|
})
|
|
2238
2139
|
] : isActive ? [
|
|
2239
|
-
|
|
2140
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2240
2141
|
key: "playing",
|
|
2241
2142
|
uiText: {
|
|
2242
2143
|
value: "PLAYING",
|
|
@@ -2245,18 +2146,18 @@ var GuideUIModule = class {
|
|
|
2245
2146
|
}
|
|
2246
2147
|
})
|
|
2247
2148
|
] : video.isLive ? [
|
|
2248
|
-
|
|
2149
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2249
2150
|
key: "live",
|
|
2250
2151
|
uiTransform: { padding: { left: 4, right: 4, top: 2, bottom: 2 }, marginTop: 4 },
|
|
2251
2152
|
uiBackground: { color: THEME.colors.red },
|
|
2252
2153
|
children: [
|
|
2253
|
-
|
|
2154
|
+
ReactEcs2.createElement(Label2, { value: "LIVE", fontSize: this.s(10), color: THEME.colors.white })
|
|
2254
2155
|
]
|
|
2255
2156
|
})
|
|
2256
2157
|
] : [],
|
|
2257
2158
|
// A locked channel (2026-11-20): its badge, the words a refused pick shows - one line, 12px in the 260px card
|
|
2258
2159
|
...video.locked === true ? [
|
|
2259
|
-
|
|
2160
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2260
2161
|
key: "locked",
|
|
2261
2162
|
uiTransform: { height: this.s(16), marginTop: 4 },
|
|
2262
2163
|
uiText: { value: LOCKED_LINE, fontSize: this.s(12), color: THEME.colors.yellow }
|
|
@@ -2265,7 +2166,7 @@ var GuideUIModule = class {
|
|
|
2265
2166
|
]
|
|
2266
2167
|
}),
|
|
2267
2168
|
// Channel link
|
|
2268
|
-
|
|
2169
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2269
2170
|
uiTransform: {
|
|
2270
2171
|
width: "100%",
|
|
2271
2172
|
height: "30%",
|
|
@@ -2276,7 +2177,7 @@ var GuideUIModule = class {
|
|
|
2276
2177
|
uiBackground: { color: Color43.create(0, 0, 0, 0.3) },
|
|
2277
2178
|
onMouseDown: () => this.handleChannelClick(video),
|
|
2278
2179
|
children: [
|
|
2279
|
-
|
|
2180
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2280
2181
|
uiText: {
|
|
2281
2182
|
value: "CHANNEL",
|
|
2282
2183
|
fontSize: this.s(UI_DIMENSIONS.guide.content.bodySize),
|
|
@@ -2293,7 +2194,7 @@ var GuideUIModule = class {
|
|
|
2293
2194
|
const buttonW = this.s(170);
|
|
2294
2195
|
const buttonH = this.s(44);
|
|
2295
2196
|
const bodyH = this.s(UI_DIMENSIONS.guide.content.bodySize * 1.5 * 2);
|
|
2296
|
-
return
|
|
2197
|
+
return ReactEcs2.createElement(UiEntity2, {
|
|
2297
2198
|
key: "age-choice",
|
|
2298
2199
|
uiTransform: {
|
|
2299
2200
|
positionType: "absolute",
|
|
@@ -2307,7 +2208,7 @@ var GuideUIModule = class {
|
|
|
2307
2208
|
},
|
|
2308
2209
|
uiBackground: { color: Color43.create(0, 0, 0, 0.85) },
|
|
2309
2210
|
children: [
|
|
2310
|
-
|
|
2211
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2311
2212
|
uiTransform: {
|
|
2312
2213
|
width: this.s(480),
|
|
2313
2214
|
flexDirection: "column",
|
|
@@ -2318,15 +2219,15 @@ var GuideUIModule = class {
|
|
|
2318
2219
|
},
|
|
2319
2220
|
uiBackground: { color: THEME.colors.panel },
|
|
2320
2221
|
children: [
|
|
2321
|
-
|
|
2222
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2322
2223
|
uiTransform: { marginBottom: this.s(8) },
|
|
2323
2224
|
uiText: { value: "MATURE CONTENT", fontSize: this.s(24), color: THEME.colors.red }
|
|
2324
2225
|
}),
|
|
2325
|
-
|
|
2226
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2326
2227
|
uiTransform: { marginBottom: this.s(12) },
|
|
2327
2228
|
uiText: { value: truncateText(video.name || "Unknown", 40), fontSize: this.s(16), color: THEME.colors.cyan }
|
|
2328
2229
|
}),
|
|
2329
|
-
|
|
2230
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2330
2231
|
uiTransform: { width: "100%", minHeight: bodyH, marginBottom: this.s(20) },
|
|
2331
2232
|
uiText: {
|
|
2332
2233
|
value: "This channel is for viewers aged 18 and older. Are you 18 or older?",
|
|
@@ -2336,21 +2237,21 @@ var GuideUIModule = class {
|
|
|
2336
2237
|
textWrap: "wrap"
|
|
2337
2238
|
}
|
|
2338
2239
|
}),
|
|
2339
|
-
|
|
2240
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2340
2241
|
uiTransform: { flexDirection: "row", justifyContent: "center", gap: this.s(16) },
|
|
2341
2242
|
children: [
|
|
2342
|
-
|
|
2243
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2343
2244
|
key: "age-yes",
|
|
2344
2245
|
uiTransform: { width: buttonW, height: buttonH, justifyContent: "center", alignItems: "center" },
|
|
2345
2246
|
uiBackground: { color: THEME.colors.red },
|
|
2346
2247
|
onMouseDown: () => this.answerAge(true),
|
|
2347
2248
|
children: [
|
|
2348
|
-
|
|
2249
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2349
2250
|
uiText: { value: "YES, I AM 18+", fontSize: this.s(14), color: THEME.colors.white }
|
|
2350
2251
|
})
|
|
2351
2252
|
]
|
|
2352
2253
|
}),
|
|
2353
|
-
|
|
2254
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2354
2255
|
key: "age-no",
|
|
2355
2256
|
uiTransform: {
|
|
2356
2257
|
width: buttonW,
|
|
@@ -2363,7 +2264,7 @@ var GuideUIModule = class {
|
|
|
2363
2264
|
uiBackground: { color: THEME.colors.buttonBackground },
|
|
2364
2265
|
onMouseDown: () => this.answerAge(false),
|
|
2365
2266
|
children: [
|
|
2366
|
-
|
|
2267
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2367
2268
|
uiText: { value: "NO", fontSize: this.s(14), color: THEME.colors.white }
|
|
2368
2269
|
})
|
|
2369
2270
|
]
|
|
@@ -2377,7 +2278,7 @@ var GuideUIModule = class {
|
|
|
2377
2278
|
}
|
|
2378
2279
|
renderCloseButton() {
|
|
2379
2280
|
const closeSize = this.s(UI_DIMENSIONS.closeButton.size);
|
|
2380
|
-
return
|
|
2281
|
+
return ReactEcs2.createElement(UiEntity2, {
|
|
2381
2282
|
uiTransform: {
|
|
2382
2283
|
positionType: "absolute",
|
|
2383
2284
|
position: { top: -5, right: -5 },
|
|
@@ -2389,7 +2290,7 @@ var GuideUIModule = class {
|
|
|
2389
2290
|
uiBackground: { color: THEME.colors.panel },
|
|
2390
2291
|
onMouseDown: () => this.hide(),
|
|
2391
2292
|
children: [
|
|
2392
|
-
|
|
2293
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
2393
2294
|
uiText: { value: "X", fontSize: this.s(UI_DIMENSIONS.closeButton.fontSize), color: THEME.colors.red }
|
|
2394
2295
|
})
|
|
2395
2296
|
]
|
|
@@ -2398,7 +2299,7 @@ var GuideUIModule = class {
|
|
|
2398
2299
|
renderToggleButton() {
|
|
2399
2300
|
const buttonText = this._isVisible ? "CLOSE" : "GUIDE";
|
|
2400
2301
|
const buttonColor = this._isVisible ? Color43.create(0.2, 0.2, 0.28, 0.9) : Color43.create(0, 0.5, 0.5, 0.9);
|
|
2401
|
-
const label =
|
|
2302
|
+
const label = ReactEcs2.createElement(UiEntity2, {
|
|
2402
2303
|
uiText: {
|
|
2403
2304
|
value: buttonText,
|
|
2404
2305
|
fontSize: this.s(14),
|
|
@@ -2407,16 +2308,16 @@ var GuideUIModule = class {
|
|
|
2407
2308
|
}
|
|
2408
2309
|
});
|
|
2409
2310
|
const press = () => this._isVisible ? this.hide() : this.show();
|
|
2410
|
-
if (this.client.isPhone) {
|
|
2411
|
-
return toolbarButton(1, {
|
|
2311
|
+
if (this.client.isPhone || this.client.toolbarCollapsed) {
|
|
2312
|
+
return this.client.toolbarButton(1, {
|
|
2412
2313
|
uiTransform: { justifyContent: "center", alignItems: "center" },
|
|
2413
2314
|
uiBackground: { color: buttonColor },
|
|
2414
2315
|
onMouseDown: press,
|
|
2415
2316
|
children: [label]
|
|
2416
|
-
}
|
|
2317
|
+
});
|
|
2417
2318
|
}
|
|
2418
2319
|
const buttonPos = 20 + this.s(100) + 10;
|
|
2419
|
-
return
|
|
2320
|
+
return ReactEcs2.createElement(UiEntity2, {
|
|
2420
2321
|
uiTransform: {
|
|
2421
2322
|
positionType: "absolute",
|
|
2422
2323
|
position: { right: buttonPos, bottom: 10 },
|
|
@@ -2433,7 +2334,7 @@ var GuideUIModule = class {
|
|
|
2433
2334
|
};
|
|
2434
2335
|
|
|
2435
2336
|
// src/ui/chat-ui.tsx
|
|
2436
|
-
import
|
|
2337
|
+
import ReactEcs3, { UiEntity as UiEntity3, Label as Label3, Input as Input3, Button as Button2 } from "@dcl/sdk/react-ecs";
|
|
2437
2338
|
import { Color4 as Color44 } from "@dcl/sdk/math";
|
|
2438
2339
|
import { signedFetch as signedFetch3 } from "~system/SignedFetch";
|
|
2439
2340
|
import { getPlayer } from "@dcl/sdk/players";
|
|
@@ -2484,7 +2385,7 @@ var ChatUIModule = class {
|
|
|
2484
2385
|
if (this.client.isVisitorBlocked) return null;
|
|
2485
2386
|
const scaledTheme = scaleChatTheme(DEFAULT_CHAT_THEME, this.client.uiScale);
|
|
2486
2387
|
const positionStyle = this.getPositionStyle();
|
|
2487
|
-
return
|
|
2388
|
+
return ReactEcs3.createElement(UiEntity3, {
|
|
2488
2389
|
uiTransform: {
|
|
2489
2390
|
width: "100%",
|
|
2490
2391
|
height: "100%",
|
|
@@ -2493,6 +2394,8 @@ var ChatUIModule = class {
|
|
|
2493
2394
|
children: [
|
|
2494
2395
|
// Always render toggle button
|
|
2495
2396
|
this.renderToggleButton(),
|
|
2397
|
+
// The toolbar's collapse handle, drawn here once for the whole toolbar (2.14.0; nothing while collapsed)
|
|
2398
|
+
this.client.toolbarHandle(),
|
|
2496
2399
|
// Render panel when visible - scaled sizes, fixed position
|
|
2497
2400
|
// Key includes uiScale to force re-render when scale changes from other panels
|
|
2498
2401
|
// On a phone centered beside the toolbar's column (2.13.0, src/ui/toolbar-panel.ts); elsewhere as here
|
|
@@ -2512,7 +2415,7 @@ var ChatUIModule = class {
|
|
|
2512
2415
|
this.renderHeader(),
|
|
2513
2416
|
this.renderChannelButton(scaledTheme),
|
|
2514
2417
|
this.renderMessagesArea(scaledTheme),
|
|
2515
|
-
|
|
2418
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
2516
2419
|
uiTransform: { width: "100%", height: 1, flexShrink: 0 },
|
|
2517
2420
|
uiBackground: { color: THEME.colors.panelBorder }
|
|
2518
2421
|
}),
|
|
@@ -2854,7 +2757,7 @@ var ChatUIModule = class {
|
|
|
2854
2757
|
renderChannelButton(theme) {
|
|
2855
2758
|
const currentChannel = this.channels.find((c) => c.id === this.currentChannelId);
|
|
2856
2759
|
const displayName = currentChannel?.name || this.currentChannelId;
|
|
2857
|
-
return
|
|
2760
|
+
return ReactEcs3.createElement(UiEntity3, {
|
|
2858
2761
|
uiTransform: {
|
|
2859
2762
|
height: 40,
|
|
2860
2763
|
width: "100%",
|
|
@@ -2869,12 +2772,12 @@ var ChatUIModule = class {
|
|
|
2869
2772
|
this.showChannelDropdown = !this.showChannelDropdown;
|
|
2870
2773
|
},
|
|
2871
2774
|
children: [
|
|
2872
|
-
|
|
2775
|
+
ReactEcs3.createElement(Label3, {
|
|
2873
2776
|
value: `// ${truncateText(displayName, 24)}`,
|
|
2874
2777
|
fontSize: theme.channelButton,
|
|
2875
2778
|
color: THEME.colors.white
|
|
2876
2779
|
}),
|
|
2877
|
-
|
|
2780
|
+
ReactEcs3.createElement(Label3, {
|
|
2878
2781
|
value: this.showChannelDropdown ? "\u25B2" : "\u25BC",
|
|
2879
2782
|
fontSize: 10,
|
|
2880
2783
|
color: THEME.colors.cyan
|
|
@@ -2903,7 +2806,7 @@ var ChatUIModule = class {
|
|
|
2903
2806
|
const visibleMessages = allMessages.slice(startIdx, endIdx);
|
|
2904
2807
|
const canScrollUp = this.chatScrollOffset < maxOffset;
|
|
2905
2808
|
const canScrollDown = this.chatScrollOffset > 0;
|
|
2906
|
-
return
|
|
2809
|
+
return ReactEcs3.createElement(UiEntity3, {
|
|
2907
2810
|
uiTransform: { flexGrow: 1, width: "100%", flexDirection: "row", overflow: "hidden" },
|
|
2908
2811
|
children: [
|
|
2909
2812
|
// Messages - anchored at the bottom, so the newest stays in view now that a row grows with its text
|
|
@@ -2911,7 +2814,7 @@ var ChatUIModule = class {
|
|
|
2911
2814
|
// past it; now its oldest clips at the top, one scroll up away. The rows keep their height
|
|
2912
2815
|
// (flexShrink 0 - the protocol's default of 1 squeezes them onto each other) in one column
|
|
2913
2816
|
// (nowrap - the protocol documents wrap as its default).
|
|
2914
|
-
|
|
2817
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
2915
2818
|
uiTransform: {
|
|
2916
2819
|
flexGrow: 1,
|
|
2917
2820
|
flexDirection: "column",
|
|
@@ -2925,7 +2828,7 @@ var ChatUIModule = class {
|
|
|
2925
2828
|
)
|
|
2926
2829
|
}),
|
|
2927
2830
|
// Scroll controls
|
|
2928
|
-
|
|
2831
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
2929
2832
|
uiTransform: {
|
|
2930
2833
|
width: 28,
|
|
2931
2834
|
height: "100%",
|
|
@@ -2935,22 +2838,22 @@ var ChatUIModule = class {
|
|
|
2935
2838
|
gap: 8
|
|
2936
2839
|
},
|
|
2937
2840
|
children: [
|
|
2938
|
-
|
|
2841
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
2939
2842
|
uiTransform: { width: 26, height: 36, justifyContent: "center", alignItems: "center" },
|
|
2940
2843
|
uiBackground: { color: canScrollUp ? THEME.colors.buttonBackground : Color44.create(0.1, 0.1, 0.1, 0.3) },
|
|
2941
2844
|
onMouseDown: () => {
|
|
2942
2845
|
if (canScrollUp) this.chatScrollOffset += 1;
|
|
2943
2846
|
},
|
|
2944
2847
|
children: [
|
|
2945
|
-
|
|
2848
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
2946
2849
|
uiText: { value: "\u25B2", fontSize: 14, color: canScrollUp ? THEME.colors.cyan : THEME.colors.gray }
|
|
2947
2850
|
})
|
|
2948
2851
|
]
|
|
2949
2852
|
}),
|
|
2950
|
-
|
|
2853
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
2951
2854
|
uiTransform: { width: 26, height: 24, justifyContent: "center", alignItems: "center" },
|
|
2952
2855
|
children: [
|
|
2953
|
-
|
|
2856
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
2954
2857
|
uiText: {
|
|
2955
2858
|
value: totalMessages > UI_DIMENSIONS.chat.messagesPerPage ? `${this.chatScrollOffset}` : "-",
|
|
2956
2859
|
fontSize: 10,
|
|
@@ -2959,14 +2862,14 @@ var ChatUIModule = class {
|
|
|
2959
2862
|
})
|
|
2960
2863
|
]
|
|
2961
2864
|
}),
|
|
2962
|
-
|
|
2865
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
2963
2866
|
uiTransform: { width: 26, height: 36, justifyContent: "center", alignItems: "center" },
|
|
2964
2867
|
uiBackground: { color: canScrollDown ? THEME.colors.buttonBackground : Color44.create(0.1, 0.1, 0.1, 0.3) },
|
|
2965
2868
|
onMouseDown: () => {
|
|
2966
2869
|
if (canScrollDown) this.chatScrollOffset -= 1;
|
|
2967
2870
|
},
|
|
2968
2871
|
children: [
|
|
2969
|
-
|
|
2872
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
2970
2873
|
uiText: { value: "\u25BC", fontSize: 14, color: canScrollDown ? THEME.colors.cyan : THEME.colors.gray }
|
|
2971
2874
|
})
|
|
2972
2875
|
]
|
|
@@ -2977,7 +2880,7 @@ var ChatUIModule = class {
|
|
|
2977
2880
|
});
|
|
2978
2881
|
}
|
|
2979
2882
|
renderSystemMessage(msg, theme) {
|
|
2980
|
-
return
|
|
2883
|
+
return ReactEcs3.createElement(UiEntity3, {
|
|
2981
2884
|
key: msg.id,
|
|
2982
2885
|
uiTransform: { width: "100%", height: 24, marginBottom: 4, flexShrink: 0 },
|
|
2983
2886
|
uiText: {
|
|
@@ -2997,12 +2900,12 @@ var ChatUIModule = class {
|
|
|
2997
2900
|
if (displayName.toLowerCase().includes("admin")) accentColor = THEME.colors.magenta;
|
|
2998
2901
|
else if (isCurrentUser) accentColor = THEME.colors.green;
|
|
2999
2902
|
const textRoom = this.messageTextRoom(msg.text, theme.chatMessage);
|
|
3000
|
-
return
|
|
2903
|
+
return ReactEcs3.createElement(UiEntity3, {
|
|
3001
2904
|
key: msg.id,
|
|
3002
2905
|
uiTransform: { width: "100%", flexDirection: "column", marginBottom: 16, flexShrink: 0 },
|
|
3003
2906
|
children: [
|
|
3004
2907
|
// Header row
|
|
3005
|
-
|
|
2908
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
3006
2909
|
uiTransform: {
|
|
3007
2910
|
width: "100%",
|
|
3008
2911
|
height: 24,
|
|
@@ -3012,23 +2915,23 @@ var ChatUIModule = class {
|
|
|
3012
2915
|
marginBottom: 4
|
|
3013
2916
|
},
|
|
3014
2917
|
children: [
|
|
3015
|
-
|
|
2918
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
3016
2919
|
uiText: { value: displayName, fontSize: theme.chatUsername, color: accentColor, textAlign: "middle-left" }
|
|
3017
2920
|
}),
|
|
3018
|
-
|
|
2921
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
3019
2922
|
uiText: { value: time, fontSize: theme.chatTimestamp, color: THEME.colors.gray, textAlign: "middle-right" }
|
|
3020
2923
|
})
|
|
3021
2924
|
]
|
|
3022
2925
|
}),
|
|
3023
2926
|
// Message content
|
|
3024
|
-
|
|
2927
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
3025
2928
|
uiTransform: { width: "100%", flexDirection: "row", alignItems: "stretch", paddingLeft: 8 },
|
|
3026
2929
|
children: [
|
|
3027
|
-
|
|
2930
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
3028
2931
|
uiTransform: { width: 3, minHeight: textRoom },
|
|
3029
2932
|
uiBackground: { color: accentColor }
|
|
3030
2933
|
}),
|
|
3031
|
-
|
|
2934
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
3032
2935
|
uiTransform: { flexGrow: 1, minHeight: textRoom, paddingLeft: 12, paddingTop: 4, paddingBottom: 4 },
|
|
3033
2936
|
uiText: {
|
|
3034
2937
|
value: msg.text,
|
|
@@ -3044,7 +2947,7 @@ var ChatUIModule = class {
|
|
|
3044
2947
|
});
|
|
3045
2948
|
}
|
|
3046
2949
|
renderUserInfoBar(theme) {
|
|
3047
|
-
return
|
|
2950
|
+
return ReactEcs3.createElement(UiEntity3, {
|
|
3048
2951
|
uiTransform: {
|
|
3049
2952
|
width: "100%",
|
|
3050
2953
|
height: 34,
|
|
@@ -3056,12 +2959,12 @@ var ChatUIModule = class {
|
|
|
3056
2959
|
},
|
|
3057
2960
|
uiBackground: { color: Color44.create(0.03, 0.03, 0.05, 1) },
|
|
3058
2961
|
children: [
|
|
3059
|
-
|
|
2962
|
+
ReactEcs3.createElement(Label3, {
|
|
3060
2963
|
value: `// ${this.currentUsername || "Guest"}`,
|
|
3061
2964
|
fontSize: theme.userInfo,
|
|
3062
2965
|
color: THEME.colors.yellow
|
|
3063
2966
|
}),
|
|
3064
|
-
|
|
2967
|
+
ReactEcs3.createElement(Label3, {
|
|
3065
2968
|
value: this.isRegisteredUser ? "\u25CF CITIZEN" : "\u25CB GUEST",
|
|
3066
2969
|
fontSize: theme.authStatus,
|
|
3067
2970
|
color: this.isRegisteredUser ? THEME.colors.green : THEME.colors.gray
|
|
@@ -3072,7 +2975,7 @@ var ChatUIModule = class {
|
|
|
3072
2975
|
renderInputArea(theme) {
|
|
3073
2976
|
const baseUrl = this.getBaseUrl();
|
|
3074
2977
|
if (!this.isRegisteredUser) {
|
|
3075
|
-
return
|
|
2978
|
+
return ReactEcs3.createElement(UiEntity3, {
|
|
3076
2979
|
uiTransform: {
|
|
3077
2980
|
height: 75,
|
|
3078
2981
|
minHeight: 75,
|
|
@@ -3086,14 +2989,14 @@ var ChatUIModule = class {
|
|
|
3086
2989
|
},
|
|
3087
2990
|
uiBackground: { color: Color44.create(0.08, 0.08, 0.1, 1) },
|
|
3088
2991
|
children: [
|
|
3089
|
-
|
|
2992
|
+
ReactEcs3.createElement(Label3, {
|
|
3090
2993
|
value: "ACCESS RESTRICTED: CITIZENS ONLY",
|
|
3091
2994
|
fontSize: 12,
|
|
3092
2995
|
color: THEME.colors.red,
|
|
3093
2996
|
textAlign: "middle-center",
|
|
3094
2997
|
uiTransform: { marginBottom: 5 }
|
|
3095
2998
|
}),
|
|
3096
|
-
|
|
2999
|
+
ReactEcs3.createElement(Button2, {
|
|
3097
3000
|
value: "REGISTER IDENTITY",
|
|
3098
3001
|
fontSize: 14,
|
|
3099
3002
|
uiTransform: { width: 200, height: 30 },
|
|
@@ -3106,7 +3009,7 @@ var ChatUIModule = class {
|
|
|
3106
3009
|
]
|
|
3107
3010
|
});
|
|
3108
3011
|
}
|
|
3109
|
-
return
|
|
3012
|
+
return ReactEcs3.createElement(UiEntity3, {
|
|
3110
3013
|
uiTransform: {
|
|
3111
3014
|
height: 75,
|
|
3112
3015
|
minHeight: 75,
|
|
@@ -3118,7 +3021,7 @@ var ChatUIModule = class {
|
|
|
3118
3021
|
},
|
|
3119
3022
|
uiBackground: { color: Color44.create(0.08, 0.08, 0.1, 1) },
|
|
3120
3023
|
children: [
|
|
3121
|
-
|
|
3024
|
+
ReactEcs3.createElement(Input3, {
|
|
3122
3025
|
onChange: (v) => {
|
|
3123
3026
|
this.inputText = v;
|
|
3124
3027
|
},
|
|
@@ -3131,7 +3034,7 @@ var ChatUIModule = class {
|
|
|
3131
3034
|
uiBackground: { color: Color44.create(0.12, 0.12, 0.14, 1) },
|
|
3132
3035
|
uiTransform: { flexGrow: 1, height: "100%", margin: { right: 10 } }
|
|
3133
3036
|
}),
|
|
3134
|
-
|
|
3037
|
+
ReactEcs3.createElement(Button2, {
|
|
3135
3038
|
value: this.isSigningIn ? "..." : "SEND",
|
|
3136
3039
|
onMouseDown: () => this.handleSend(),
|
|
3137
3040
|
uiTransform: { width: 80, height: "100%" },
|
|
@@ -3148,7 +3051,7 @@ var ChatUIModule = class {
|
|
|
3148
3051
|
const endIdx = startIdx + UI_DIMENSIONS.chat.channelsPerPage;
|
|
3149
3052
|
const visibleChannels = this.channels.slice(startIdx, endIdx);
|
|
3150
3053
|
const totalPages = Math.ceil(this.channels.length / UI_DIMENSIONS.chat.channelsPerPage);
|
|
3151
|
-
return
|
|
3054
|
+
return ReactEcs3.createElement(UiEntity3, {
|
|
3152
3055
|
uiTransform: {
|
|
3153
3056
|
width: "100%",
|
|
3154
3057
|
height: 260,
|
|
@@ -3159,13 +3062,13 @@ var ChatUIModule = class {
|
|
|
3159
3062
|
uiBackground: { color: Color44.create(0.08, 0.1, 0.14, 1) },
|
|
3160
3063
|
children: [
|
|
3161
3064
|
// Top border
|
|
3162
|
-
|
|
3065
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
3163
3066
|
uiTransform: { width: "100%", height: 2, flexShrink: 0 },
|
|
3164
3067
|
uiBackground: { color: THEME.colors.cyan }
|
|
3165
3068
|
}),
|
|
3166
3069
|
// Channel list
|
|
3167
3070
|
...visibleChannels.map(
|
|
3168
|
-
(channel) =>
|
|
3071
|
+
(channel) => ReactEcs3.createElement(UiEntity3, {
|
|
3169
3072
|
key: channel.id,
|
|
3170
3073
|
uiTransform: {
|
|
3171
3074
|
height: 38,
|
|
@@ -3178,7 +3081,7 @@ var ChatUIModule = class {
|
|
|
3178
3081
|
},
|
|
3179
3082
|
onMouseDown: () => this.switchChannel(channel.id),
|
|
3180
3083
|
children: [
|
|
3181
|
-
|
|
3084
|
+
ReactEcs3.createElement(Label3, {
|
|
3182
3085
|
value: channel.id === this.currentChannelId ? `\u25B8 ${channel.name}` : channel.name,
|
|
3183
3086
|
fontSize: theme.channelDropdown,
|
|
3184
3087
|
color: channel.id === this.currentChannelId ? THEME.colors.cyan : THEME.colors.gray
|
|
@@ -3188,7 +3091,7 @@ var ChatUIModule = class {
|
|
|
3188
3091
|
),
|
|
3189
3092
|
// Pagination
|
|
3190
3093
|
...totalPages > 1 ? [
|
|
3191
|
-
|
|
3094
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
3192
3095
|
key: "pagination",
|
|
3193
3096
|
uiTransform: {
|
|
3194
3097
|
width: "100%",
|
|
@@ -3201,11 +3104,11 @@ var ChatUIModule = class {
|
|
|
3201
3104
|
},
|
|
3202
3105
|
children: [
|
|
3203
3106
|
...this.channelPage > 0 ? [
|
|
3204
|
-
|
|
3107
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
3205
3108
|
key: "prev",
|
|
3206
3109
|
onMouseDown: () => this.channelPage--,
|
|
3207
3110
|
children: [
|
|
3208
|
-
|
|
3111
|
+
ReactEcs3.createElement(Label3, {
|
|
3209
3112
|
value: "<< PREV",
|
|
3210
3113
|
fontSize: 10,
|
|
3211
3114
|
color: THEME.colors.cyan
|
|
@@ -3213,17 +3116,17 @@ var ChatUIModule = class {
|
|
|
3213
3116
|
]
|
|
3214
3117
|
})
|
|
3215
3118
|
] : [],
|
|
3216
|
-
|
|
3119
|
+
ReactEcs3.createElement(Label3, {
|
|
3217
3120
|
value: `${this.channelPage + 1}/${totalPages}`,
|
|
3218
3121
|
fontSize: 10,
|
|
3219
3122
|
color: THEME.colors.gray
|
|
3220
3123
|
}),
|
|
3221
3124
|
...this.channelPage < totalPages - 1 ? [
|
|
3222
|
-
|
|
3125
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
3223
3126
|
key: "next",
|
|
3224
3127
|
onMouseDown: () => this.channelPage++,
|
|
3225
3128
|
children: [
|
|
3226
|
-
|
|
3129
|
+
ReactEcs3.createElement(Label3, {
|
|
3227
3130
|
value: "NEXT >>",
|
|
3228
3131
|
fontSize: 10,
|
|
3229
3132
|
color: THEME.colors.cyan
|
|
@@ -3235,7 +3138,7 @@ var ChatUIModule = class {
|
|
|
3235
3138
|
})
|
|
3236
3139
|
] : [],
|
|
3237
3140
|
// Bottom border
|
|
3238
|
-
|
|
3141
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
3239
3142
|
uiTransform: { width: "100%", height: 1, flexShrink: 0 },
|
|
3240
3143
|
uiBackground: { color: THEME.colors.panelBorder }
|
|
3241
3144
|
})
|
|
@@ -3246,7 +3149,7 @@ var ChatUIModule = class {
|
|
|
3246
3149
|
const unreadBadge = this._unreadCount > 0 ? ` (${this._unreadCount})` : "";
|
|
3247
3150
|
const buttonText = this._isVisible ? "CLOSE" : `CHAT${unreadBadge}`;
|
|
3248
3151
|
const buttonColor = this._isVisible ? Color44.create(0.2, 0.2, 0.28, 0.9) : Color44.create(0.6, 0, 0.5, 0.9);
|
|
3249
|
-
const label =
|
|
3152
|
+
const label = ReactEcs3.createElement(UiEntity3, {
|
|
3250
3153
|
uiText: {
|
|
3251
3154
|
value: buttonText,
|
|
3252
3155
|
fontSize: this.s(14),
|
|
@@ -3255,15 +3158,15 @@ var ChatUIModule = class {
|
|
|
3255
3158
|
}
|
|
3256
3159
|
});
|
|
3257
3160
|
const press = () => this._isVisible ? this.hide() : this.show();
|
|
3258
|
-
if (this.client.isPhone) {
|
|
3259
|
-
return toolbarButton(0, {
|
|
3161
|
+
if (this.client.isPhone || this.client.toolbarCollapsed) {
|
|
3162
|
+
return this.client.toolbarButton(0, {
|
|
3260
3163
|
uiTransform: { justifyContent: "center", alignItems: "center" },
|
|
3261
3164
|
uiBackground: { color: buttonColor },
|
|
3262
3165
|
onMouseDown: press,
|
|
3263
3166
|
children: [label]
|
|
3264
|
-
}
|
|
3167
|
+
});
|
|
3265
3168
|
}
|
|
3266
|
-
return
|
|
3169
|
+
return ReactEcs3.createElement(UiEntity3, {
|
|
3267
3170
|
uiTransform: {
|
|
3268
3171
|
positionType: "absolute",
|
|
3269
3172
|
position: { right: 20, bottom: 10 },
|
|
@@ -3280,13 +3183,13 @@ var ChatUIModule = class {
|
|
|
3280
3183
|
};
|
|
3281
3184
|
|
|
3282
3185
|
// src/ui/admin-panel-ui.tsx
|
|
3283
|
-
import
|
|
3186
|
+
import ReactEcs6, { UiEntity as UiEntity6, Button as Button4, Label as Label6, Input as Input4 } from "@dcl/sdk/react-ecs";
|
|
3284
3187
|
import { Color4 as Color46 } from "@dcl/sdk/math";
|
|
3285
3188
|
import { getPlayer as getPlayer2 } from "@dcl/sdk/players";
|
|
3286
3189
|
import { openExternalUrl as openExternalUrl5 } from "~system/RestrictedActions";
|
|
3287
3190
|
|
|
3288
3191
|
// src/ui/ui-renderer.tsx
|
|
3289
|
-
import
|
|
3192
|
+
import ReactEcs4, { ReactEcsRenderer, UiEntity as UiEntity4, Label as Label4 } from "@dcl/sdk/react-ecs";
|
|
3290
3193
|
import { engine as engine3 } from "@dcl/sdk/ecs";
|
|
3291
3194
|
var notificationText = "";
|
|
3292
3195
|
var notificationVisible = false;
|
|
@@ -3319,8 +3222,8 @@ function NotificationBanner() {
|
|
|
3319
3222
|
if (!notificationVisible) return null;
|
|
3320
3223
|
return (
|
|
3321
3224
|
// Full-width container to center the notification
|
|
3322
|
-
/* @__PURE__ */
|
|
3323
|
-
|
|
3225
|
+
/* @__PURE__ */ ReactEcs4.createElement(
|
|
3226
|
+
UiEntity4,
|
|
3324
3227
|
{
|
|
3325
3228
|
uiTransform: {
|
|
3326
3229
|
positionType: "absolute",
|
|
@@ -3330,8 +3233,8 @@ function NotificationBanner() {
|
|
|
3330
3233
|
alignItems: "center"
|
|
3331
3234
|
}
|
|
3332
3235
|
},
|
|
3333
|
-
/* @__PURE__ */
|
|
3334
|
-
|
|
3236
|
+
/* @__PURE__ */ ReactEcs4.createElement(
|
|
3237
|
+
UiEntity4,
|
|
3335
3238
|
{
|
|
3336
3239
|
uiTransform: {
|
|
3337
3240
|
width: N.width,
|
|
@@ -3341,8 +3244,8 @@ function NotificationBanner() {
|
|
|
3341
3244
|
},
|
|
3342
3245
|
uiBackground: { color: C.panel }
|
|
3343
3246
|
},
|
|
3344
|
-
/* @__PURE__ */
|
|
3345
|
-
|
|
3247
|
+
/* @__PURE__ */ ReactEcs4.createElement(
|
|
3248
|
+
UiEntity4,
|
|
3346
3249
|
{
|
|
3347
3250
|
uiTransform: {
|
|
3348
3251
|
width: N.borderWidth,
|
|
@@ -3351,8 +3254,8 @@ function NotificationBanner() {
|
|
|
3351
3254
|
uiBackground: { color: C.cyan }
|
|
3352
3255
|
}
|
|
3353
3256
|
),
|
|
3354
|
-
/* @__PURE__ */
|
|
3355
|
-
|
|
3257
|
+
/* @__PURE__ */ ReactEcs4.createElement(
|
|
3258
|
+
UiEntity4,
|
|
3356
3259
|
{
|
|
3357
3260
|
uiTransform: {
|
|
3358
3261
|
flexGrow: 1,
|
|
@@ -3362,7 +3265,7 @@ function NotificationBanner() {
|
|
|
3362
3265
|
alignItems: "flex-start"
|
|
3363
3266
|
}
|
|
3364
3267
|
},
|
|
3365
|
-
/* @__PURE__ */
|
|
3268
|
+
/* @__PURE__ */ ReactEcs4.createElement(
|
|
3366
3269
|
Label4,
|
|
3367
3270
|
{
|
|
3368
3271
|
value: notificationText,
|
|
@@ -3372,8 +3275,8 @@ function NotificationBanner() {
|
|
|
3372
3275
|
}
|
|
3373
3276
|
)
|
|
3374
3277
|
),
|
|
3375
|
-
/* @__PURE__ */
|
|
3376
|
-
|
|
3278
|
+
/* @__PURE__ */ ReactEcs4.createElement(
|
|
3279
|
+
UiEntity4,
|
|
3377
3280
|
{
|
|
3378
3281
|
uiTransform: {
|
|
3379
3282
|
width: 5,
|
|
@@ -3395,8 +3298,8 @@ function createStaticUI(client) {
|
|
|
3395
3298
|
const guideComponent = client.guideUI?.getComponent() ?? null;
|
|
3396
3299
|
const chatComponent = client.chatUI?.getComponent() ?? null;
|
|
3397
3300
|
const adminComponent = client.adminPanel?.getComponent() ?? null;
|
|
3398
|
-
return /* @__PURE__ */
|
|
3399
|
-
|
|
3301
|
+
return /* @__PURE__ */ ReactEcs4.createElement(
|
|
3302
|
+
UiEntity4,
|
|
3400
3303
|
{
|
|
3401
3304
|
key: `static-ui-root-${currentScale}`,
|
|
3402
3305
|
uiTransform: {
|
|
@@ -3407,7 +3310,7 @@ function createStaticUI(client) {
|
|
|
3407
3310
|
alignItems: "center"
|
|
3408
3311
|
}
|
|
3409
3312
|
},
|
|
3410
|
-
blocked ? null : /* @__PURE__ */
|
|
3313
|
+
blocked ? null : /* @__PURE__ */ ReactEcs4.createElement(NotificationBanner, null),
|
|
3411
3314
|
guideComponent,
|
|
3412
3315
|
chatComponent,
|
|
3413
3316
|
adminComponent
|
|
@@ -3420,7 +3323,7 @@ function setupStaticUI(client) {
|
|
|
3420
3323
|
}
|
|
3421
3324
|
|
|
3422
3325
|
// src/ui/blocked-notice.tsx
|
|
3423
|
-
import
|
|
3326
|
+
import ReactEcs5, { UiEntity as UiEntity5, Label as Label5, Button as Button3 } from "@dcl/sdk/react-ecs";
|
|
3424
3327
|
import { Color4 as Color45 } from "@dcl/sdk/math";
|
|
3425
3328
|
import { openExternalUrl as openExternalUrl4 } from "~system/RestrictedActions";
|
|
3426
3329
|
var DEFAULT_SITE_URL = "https://thestatic.tv";
|
|
@@ -3447,8 +3350,8 @@ function BlockedNotice(props) {
|
|
|
3447
3350
|
const s = (v) => Math.round(v * props.scale);
|
|
3448
3351
|
const [title, ...body] = lines;
|
|
3449
3352
|
const action = blockedNoticeAction(props.standing, props.siteUrl || DEFAULT_SITE_URL);
|
|
3450
|
-
return /* @__PURE__ */
|
|
3451
|
-
|
|
3353
|
+
return /* @__PURE__ */ ReactEcs5.createElement(
|
|
3354
|
+
UiEntity5,
|
|
3452
3355
|
{
|
|
3453
3356
|
uiTransform: {
|
|
3454
3357
|
width: "100%",
|
|
@@ -3458,15 +3361,15 @@ function BlockedNotice(props) {
|
|
|
3458
3361
|
alignItems: "center"
|
|
3459
3362
|
}
|
|
3460
3363
|
},
|
|
3461
|
-
/* @__PURE__ */
|
|
3462
|
-
|
|
3364
|
+
/* @__PURE__ */ ReactEcs5.createElement(
|
|
3365
|
+
UiEntity5,
|
|
3463
3366
|
{
|
|
3464
3367
|
uiTransform: { width: s(460), flexDirection: "column", alignItems: "center", padding: s(20) },
|
|
3465
3368
|
uiBackground: { color: Color45.create(0.05, 0.05, 0.08, 0.95) }
|
|
3466
3369
|
},
|
|
3467
|
-
/* @__PURE__ */
|
|
3468
|
-
body.map((line, i) => /* @__PURE__ */
|
|
3469
|
-
action && /* @__PURE__ */
|
|
3370
|
+
/* @__PURE__ */ ReactEcs5.createElement(Label5, { value: title, fontSize: s(22), color: Color45.create(0.9, 0.2, 0.2, 1), uiTransform: { height: s(34) } }),
|
|
3371
|
+
body.map((line, i) => /* @__PURE__ */ ReactEcs5.createElement(Label5, { key: `blocked-line-${i}`, value: line, fontSize: s(16), color: Color45.White(), uiTransform: { height: s(26) } })),
|
|
3372
|
+
action && /* @__PURE__ */ ReactEcs5.createElement(
|
|
3470
3373
|
Button3,
|
|
3471
3374
|
{
|
|
3472
3375
|
uiTransform: { width: s(220), height: s(36), margin: { top: s(12) } },
|
|
@@ -3957,15 +3860,15 @@ var AdminPanelUIModule = class {
|
|
|
3957
3860
|
this.privateStatus = line;
|
|
3958
3861
|
} };
|
|
3959
3862
|
// --- UI Components ---
|
|
3960
|
-
this.SectionHead = ({ label, color }) => /* @__PURE__ */
|
|
3961
|
-
|
|
3863
|
+
this.SectionHead = ({ label, color }) => /* @__PURE__ */ ReactEcs6.createElement(
|
|
3864
|
+
UiEntity6,
|
|
3962
3865
|
{
|
|
3963
3866
|
uiTransform: { width: "100%", height: this.s(UI_DIMENSIONS.admin.sectionHeadHeight), margin: { bottom: 8 }, padding: { left: 10 }, alignItems: "center" },
|
|
3964
3867
|
uiBackground: { color: Color46.create(color.r * 0.3, color.g * 0.3, color.b * 0.3, 0.5) }
|
|
3965
3868
|
},
|
|
3966
|
-
/* @__PURE__ */
|
|
3869
|
+
/* @__PURE__ */ ReactEcs6.createElement(Label6, { value: label, fontSize: this.theme.sectionHead, color })
|
|
3967
3870
|
);
|
|
3968
|
-
this.TabBtn = ({ label, tab }) => /* @__PURE__ */
|
|
3871
|
+
this.TabBtn = ({ label, tab }) => /* @__PURE__ */ ReactEcs6.createElement(
|
|
3969
3872
|
Button4,
|
|
3970
3873
|
{
|
|
3971
3874
|
uiTransform: { flexGrow: 1, height: this.s(UI_DIMENSIONS.admin.tabHeight), justifyContent: "center", alignItems: "center" },
|
|
@@ -3984,7 +3887,7 @@ var AdminPanelUIModule = class {
|
|
|
3984
3887
|
*/
|
|
3985
3888
|
this.ControlsTab = () => {
|
|
3986
3889
|
const t = this.theme;
|
|
3987
|
-
return /* @__PURE__ */
|
|
3890
|
+
return /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "column", width: "100%", padding: 10 } }, this.controls.map((control) => /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { key: `control-${control.id}`, uiTransform: { flexDirection: "column", margin: { bottom: 14 } } }, /* @__PURE__ */ ReactEcs6.createElement(this.SectionHead, { label: control.label, color: C2.cyan }), /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "row", flexWrap: "wrap" } }, control.options.map((option) => this.controlButton(control, option.id, option.label)), control.off === true && this.controlButton(control, "off", "OFF")))), this.controlStatus && /* @__PURE__ */ ReactEcs6.createElement(
|
|
3988
3891
|
Label6,
|
|
3989
3892
|
{
|
|
3990
3893
|
value: this.controlStatus,
|
|
@@ -3999,7 +3902,7 @@ var AdminPanelUIModule = class {
|
|
|
3999
3902
|
this.fetchStreamData();
|
|
4000
3903
|
}
|
|
4001
3904
|
const t = this.theme;
|
|
4002
|
-
return /* @__PURE__ */
|
|
3905
|
+
return /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "column", width: "100%", padding: 10 } }, !this.streamData?.hasChannel && /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "column", margin: { bottom: 14 } } }, /* @__PURE__ */ ReactEcs6.createElement(this.SectionHead, { label: "LIVE STREAM", color: C2.btn }), /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: "No streaming channel linked", fontSize: t.labelSmall, color: C2.textDim, uiTransform: { margin: { bottom: 8 } } }), this.isOwner && /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "column" } }, this.streamData?.trialAvailable && /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "column", margin: { bottom: 10 } } }, /* @__PURE__ */ ReactEcs6.createElement(
|
|
4003
3906
|
Button4,
|
|
4004
3907
|
{
|
|
4005
3908
|
uiTransform: { width: this.s(200), height: this.s(UI_DIMENSIONS.admin.buttonHeight), margin: { bottom: 6 } },
|
|
@@ -4009,7 +3912,7 @@ var AdminPanelUIModule = class {
|
|
|
4009
3912
|
color: C2.text,
|
|
4010
3913
|
onMouseDown: () => this.claimTrial()
|
|
4011
3914
|
}
|
|
4012
|
-
), this.trialClaimError && /* @__PURE__ */
|
|
3915
|
+
), this.trialClaimError && /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: this.trialClaimError, fontSize: t.status, color: C2.red }), /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: trialNoteText(this.streamData?.trialSparks), fontSize: t.labelSmall, color: C2.textDim, uiTransform: { margin: { top: 4 } } })), !this.streamData?.trialAvailable && /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "column" } }, /* @__PURE__ */ ReactEcs6.createElement(
|
|
4013
3916
|
Button4,
|
|
4014
3917
|
{
|
|
4015
3918
|
uiTransform: { width: this.s(170), height: this.s(UI_DIMENSIONS.admin.buttonHeight), margin: { bottom: 6 } },
|
|
@@ -4019,14 +3922,14 @@ var AdminPanelUIModule = class {
|
|
|
4019
3922
|
color: C2.text,
|
|
4020
3923
|
onMouseDown: () => this.createChannel()
|
|
4021
3924
|
}
|
|
4022
|
-
), this.channelCreateError && /* @__PURE__ */
|
|
3925
|
+
), this.channelCreateError && /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: this.channelCreateError, fontSize: t.status, color: C2.red }), /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: "Relay tier \u2022 $25/mo \u2022 8 hours streaming", fontSize: t.labelSmall, color: C2.textDim, uiTransform: { margin: { top: 4 } } })))), this.streamData?.hasChannel && this.isOwner && /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "column", margin: { bottom: 14 } } }, /* @__PURE__ */ ReactEcs6.createElement(this.SectionHead, { label: this.streamData.isLive ? "LIVE STREAM" : "STREAM SETTINGS", color: this.streamData.isLive ? C2.red : C2.yellow }), /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "row", alignItems: "center", margin: { bottom: 8 } } }, /* @__PURE__ */ ReactEcs6.createElement(
|
|
4023
3926
|
Label6,
|
|
4024
3927
|
{
|
|
4025
3928
|
value: this.streamData.isLive ? `LIVE \u2022 ${this.streamData.currentViewers || 0} viewers` : "OFFLINE",
|
|
4026
3929
|
fontSize: t.label,
|
|
4027
3930
|
color: this.streamData.isLive ? C2.red : C2.textDim
|
|
4028
3931
|
}
|
|
4029
|
-
), /* @__PURE__ */
|
|
3932
|
+
), /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: ` \u2022 ${this.streamData.tier?.toUpperCase() || "RELAY"}`, fontSize: t.labelSmall, color: C2.cyan }), /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: ` \u2022 ${this.streamData.sparksBalance || 0} Sparks`, fontSize: t.labelSmall, color: C2.textDim })), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4030
3933
|
Label6,
|
|
4031
3934
|
{
|
|
4032
3935
|
value: `Channel: ${this.streamData.channelName || this.streamData.channelId}`,
|
|
@@ -4034,7 +3937,7 @@ var AdminPanelUIModule = class {
|
|
|
4034
3937
|
color: C2.textDim,
|
|
4035
3938
|
uiTransform: { margin: { bottom: 10 } }
|
|
4036
3939
|
}
|
|
4037
|
-
), /* @__PURE__ */
|
|
3940
|
+
), /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "column", margin: { bottom: 6 } } }, /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: "RTMP Server:", fontSize: t.labelSmall, color: C2.textDim }), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4038
3941
|
Label6,
|
|
4039
3942
|
{
|
|
4040
3943
|
value: this.streamData.rtmpUrl || "Loading...",
|
|
@@ -4042,7 +3945,7 @@ var AdminPanelUIModule = class {
|
|
|
4042
3945
|
color: this.streamData.rtmpUrl ? C2.text : C2.textDim,
|
|
4043
3946
|
uiTransform: { margin: { left: 6 } }
|
|
4044
3947
|
}
|
|
4045
|
-
)), /* @__PURE__ */
|
|
3948
|
+
)), /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "column", margin: { bottom: 6 } } }, /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: "Stream Key:", fontSize: t.labelSmall, color: C2.textDim }), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4046
3949
|
Label6,
|
|
4047
3950
|
{
|
|
4048
3951
|
value: this.streamData.streamKey || "Loading...",
|
|
@@ -4050,7 +3953,7 @@ var AdminPanelUIModule = class {
|
|
|
4050
3953
|
color: this.streamData.streamKey ? C2.cyan : C2.textDim,
|
|
4051
3954
|
uiTransform: { margin: { left: 6 } }
|
|
4052
3955
|
}
|
|
4053
|
-
)), /* @__PURE__ */
|
|
3956
|
+
)), /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "column", margin: { bottom: 10 } } }, /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: "HLS Playback:", fontSize: t.labelSmall, color: C2.textDim }), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4054
3957
|
Label6,
|
|
4055
3958
|
{
|
|
4056
3959
|
value: this.streamData.locked === true ? LOCKED_LINE : this.streamData.hlsUrl || "Not available",
|
|
@@ -4058,7 +3961,7 @@ var AdminPanelUIModule = class {
|
|
|
4058
3961
|
color: this.streamData.locked === true ? C2.yellow : this.streamData.hlsUrl ? C2.green : C2.textDim,
|
|
4059
3962
|
uiTransform: { margin: { left: 6 } }
|
|
4060
3963
|
}
|
|
4061
|
-
)), /* @__PURE__ */
|
|
3964
|
+
)), /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "row", flexWrap: "wrap", margin: { bottom: 6 } } }, !this.streamData.isLive && /* @__PURE__ */ ReactEcs6.createElement(
|
|
4062
3965
|
Button4,
|
|
4063
3966
|
{
|
|
4064
3967
|
uiTransform: { width: this.s(110), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4068,7 +3971,7 @@ var AdminPanelUIModule = class {
|
|
|
4068
3971
|
color: C2.text,
|
|
4069
3972
|
onMouseDown: () => this.startStream()
|
|
4070
3973
|
}
|
|
4071
|
-
), this.streamData.isLive && /* @__PURE__ */
|
|
3974
|
+
), this.streamData.isLive && /* @__PURE__ */ ReactEcs6.createElement(
|
|
4072
3975
|
Button4,
|
|
4073
3976
|
{
|
|
4074
3977
|
uiTransform: { width: this.s(110), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4078,7 +3981,7 @@ var AdminPanelUIModule = class {
|
|
|
4078
3981
|
color: C2.text,
|
|
4079
3982
|
onMouseDown: () => this.stopStream()
|
|
4080
3983
|
}
|
|
4081
|
-
), this.streamData.isLive && (this.streamData.hlsUrl || this.streamData.locked === true) && /* @__PURE__ */
|
|
3984
|
+
), this.streamData.isLive && (this.streamData.hlsUrl || this.streamData.locked === true) && /* @__PURE__ */ ReactEcs6.createElement(
|
|
4082
3985
|
Button4,
|
|
4083
3986
|
{
|
|
4084
3987
|
uiTransform: { width: this.s(100), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4088,7 +3991,7 @@ var AdminPanelUIModule = class {
|
|
|
4088
3991
|
color: C2.text,
|
|
4089
3992
|
onMouseDown: () => this.playStreamOnScreen()
|
|
4090
3993
|
}
|
|
4091
|
-
)), /* @__PURE__ */
|
|
3994
|
+
)), /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "row", flexWrap: "wrap", margin: { bottom: 6 } } }, /* @__PURE__ */ ReactEcs6.createElement(
|
|
4092
3995
|
Button4,
|
|
4093
3996
|
{
|
|
4094
3997
|
uiTransform: { width: this.s(80), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4098,7 +4001,7 @@ var AdminPanelUIModule = class {
|
|
|
4098
4001
|
color: C2.text,
|
|
4099
4002
|
onMouseDown: () => this.refreshStreamStatus()
|
|
4100
4003
|
}
|
|
4101
|
-
), /* @__PURE__ */
|
|
4004
|
+
), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4102
4005
|
Button4,
|
|
4103
4006
|
{
|
|
4104
4007
|
uiTransform: { width: this.s(95), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4108,7 +4011,7 @@ var AdminPanelUIModule = class {
|
|
|
4108
4011
|
color: C2.text,
|
|
4109
4012
|
onMouseDown: () => this.rotateStreamKey()
|
|
4110
4013
|
}
|
|
4111
|
-
), !this.streamData.isLive && !this.channelDeleteLook && /* @__PURE__ */
|
|
4014
|
+
), !this.streamData.isLive && !this.channelDeleteLook && /* @__PURE__ */ ReactEcs6.createElement(
|
|
4112
4015
|
Button4,
|
|
4113
4016
|
{
|
|
4114
4017
|
uiTransform: { width: this.s(70), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4118,7 +4021,7 @@ var AdminPanelUIModule = class {
|
|
|
4118
4021
|
color: C2.text,
|
|
4119
4022
|
onMouseDown: () => this.deleteChannel()
|
|
4120
4023
|
}
|
|
4121
|
-
)), !this.streamData.isLive && this.channelDeleteLook && /* @__PURE__ */
|
|
4024
|
+
)), !this.streamData.isLive && this.channelDeleteLook && /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "column", margin: { bottom: 6 }, padding: 6 }, uiBackground: { color: C2.section } }, /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: "DELETE THIS CHANNEL?", fontSize: t.labelSmall, color: C2.red, uiTransform: { height: this.s(18) } }), channelDeleteLines(this.channelDeleteLook, this.channelDeleteChanged).map((line, i) => /* @__PURE__ */ ReactEcs6.createElement(Label6, { key: `delete-line-${i}`, value: line, fontSize: t.status, color: line.startsWith("WHAT") ? C2.yellow : C2.text, uiTransform: { height: this.s(18) } })), /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "row", margin: { top: 4 } } }, /* @__PURE__ */ ReactEcs6.createElement(
|
|
4122
4025
|
Button4,
|
|
4123
4026
|
{
|
|
4124
4027
|
uiTransform: { width: this.s(120), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4128,7 +4031,7 @@ var AdminPanelUIModule = class {
|
|
|
4128
4031
|
color: C2.text,
|
|
4129
4032
|
onMouseDown: () => this.confirmDeleteChannel()
|
|
4130
4033
|
}
|
|
4131
|
-
), /* @__PURE__ */
|
|
4034
|
+
), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4132
4035
|
Button4,
|
|
4133
4036
|
{
|
|
4134
4037
|
uiTransform: { width: this.s(70), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4138,7 +4041,7 @@ var AdminPanelUIModule = class {
|
|
|
4138
4041
|
color: C2.text,
|
|
4139
4042
|
onMouseDown: () => this.cancelDeleteChannel()
|
|
4140
4043
|
}
|
|
4141
|
-
))), this.streamControlStatus === "started" && /* @__PURE__ */
|
|
4044
|
+
))), this.streamControlStatus === "started" && /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: "Stream started - begin broadcasting in OBS", fontSize: t.status, color: C2.green }), this.streamControlStatus === "stopped" && /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: "Stream stopped", fontSize: t.status, color: C2.textDim }), this.keyRotateStatus === "success" && /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: "Key rotated! Update OBS", fontSize: t.status, color: C2.green }), this.keyRotateStatus === "error" && /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: "Failed to rotate key", fontSize: t.status, color: C2.red }), this.channelDeleteError && /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: this.channelDeleteError, fontSize: t.status, color: C2.red }), this.streamControlStatus === "error" && /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: "Stream control failed", fontSize: t.status, color: C2.red })), /* @__PURE__ */ ReactEcs6.createElement(this.SectionHead, { label: "PLAY NOW", color: C2.orange }), /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "row", alignItems: "center", margin: { bottom: 14 } } }, /* @__PURE__ */ ReactEcs6.createElement(
|
|
4142
4045
|
Input4,
|
|
4143
4046
|
{
|
|
4144
4047
|
uiTransform: { width: this.s(230), height: this.s(UI_DIMENSIONS.admin.inputHeight) },
|
|
@@ -4152,7 +4055,7 @@ var AdminPanelUIModule = class {
|
|
|
4152
4055
|
this.customVideoUrl = val;
|
|
4153
4056
|
}
|
|
4154
4057
|
}
|
|
4155
|
-
), /* @__PURE__ */
|
|
4058
|
+
), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4156
4059
|
Button4,
|
|
4157
4060
|
{
|
|
4158
4061
|
uiTransform: { width: this.s(75), height: this.s(UI_DIMENSIONS.admin.inputHeight), margin: { left: 8 } },
|
|
@@ -4162,7 +4065,7 @@ var AdminPanelUIModule = class {
|
|
|
4162
4065
|
color: C2.text,
|
|
4163
4066
|
onMouseDown: () => this.playNow()
|
|
4164
4067
|
}
|
|
4165
|
-
), /* @__PURE__ */
|
|
4068
|
+
), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4166
4069
|
Button4,
|
|
4167
4070
|
{
|
|
4168
4071
|
uiTransform: { width: this.s(65), height: this.s(UI_DIMENSIONS.admin.inputHeight), margin: { left: 6 } },
|
|
@@ -4174,7 +4077,7 @@ var AdminPanelUIModule = class {
|
|
|
4174
4077
|
this.customVideoUrl = "";
|
|
4175
4078
|
}
|
|
4176
4079
|
}
|
|
4177
|
-
)), this.videoStatus && /* @__PURE__ */
|
|
4080
|
+
)), this.videoStatus && /* @__PURE__ */ ReactEcs6.createElement(
|
|
4178
4081
|
Label6,
|
|
4179
4082
|
{
|
|
4180
4083
|
value: this.videoStatus,
|
|
@@ -4182,7 +4085,7 @@ var AdminPanelUIModule = class {
|
|
|
4182
4085
|
color: this.videoStatus.startsWith("Not sent") || this.videoStatus === LOCKED_LINE || this.videoStatus === UNAVAILABLE_LINE ? C2.red : C2.green,
|
|
4183
4086
|
uiTransform: { height: this.s(18), margin: { bottom: 6 } }
|
|
4184
4087
|
}
|
|
4185
|
-
), /* @__PURE__ */
|
|
4088
|
+
), /* @__PURE__ */ ReactEcs6.createElement(this.SectionHead, { label: "PLAYBACK", color: C2.green }), /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "row", flexWrap: "wrap", margin: { bottom: 14 } } }, /* @__PURE__ */ ReactEcs6.createElement(
|
|
4186
4089
|
Button4,
|
|
4187
4090
|
{
|
|
4188
4091
|
uiTransform: { width: this.s(75), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4192,7 +4095,7 @@ var AdminPanelUIModule = class {
|
|
|
4192
4095
|
color: C2.text,
|
|
4193
4096
|
onMouseDown: () => this.playbackPlay()
|
|
4194
4097
|
}
|
|
4195
|
-
), /* @__PURE__ */
|
|
4098
|
+
), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4196
4099
|
Button4,
|
|
4197
4100
|
{
|
|
4198
4101
|
uiTransform: { width: this.s(75), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4202,7 +4105,7 @@ var AdminPanelUIModule = class {
|
|
|
4202
4105
|
color: C2.text,
|
|
4203
4106
|
onMouseDown: () => this.playbackStop()
|
|
4204
4107
|
}
|
|
4205
|
-
), /* @__PURE__ */
|
|
4108
|
+
), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4206
4109
|
Button4,
|
|
4207
4110
|
{
|
|
4208
4111
|
uiTransform: { width: this.s(100), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4212,7 +4115,7 @@ var AdminPanelUIModule = class {
|
|
|
4212
4115
|
color: C2.text,
|
|
4213
4116
|
onMouseDown: () => this.resetDefault()
|
|
4214
4117
|
}
|
|
4215
|
-
)), /* @__PURE__ */
|
|
4118
|
+
)), /* @__PURE__ */ ReactEcs6.createElement(this.SectionHead, { label: "VIDEO SLOTS", color: C2.cyan }), /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "row", flexWrap: "wrap", margin: { bottom: 10 } } }, ["slot1", "slot2", "slot3", "slot4", "slot5"].map((slot, i) => /* @__PURE__ */ ReactEcs6.createElement(
|
|
4216
4119
|
Button4,
|
|
4217
4120
|
{
|
|
4218
4121
|
key: `play-${slot}`,
|
|
@@ -4223,7 +4126,7 @@ var AdminPanelUIModule = class {
|
|
|
4223
4126
|
color: C2.text,
|
|
4224
4127
|
onMouseDown: () => this.pressSlot(slot)
|
|
4225
4128
|
}
|
|
4226
|
-
))), /* @__PURE__ */
|
|
4129
|
+
))), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4227
4130
|
Button4,
|
|
4228
4131
|
{
|
|
4229
4132
|
uiTransform: { height: this.s(24) },
|
|
@@ -4237,7 +4140,7 @@ var AdminPanelUIModule = class {
|
|
|
4237
4140
|
};
|
|
4238
4141
|
this.ModTab = () => {
|
|
4239
4142
|
const t = this.theme;
|
|
4240
|
-
return /* @__PURE__ */
|
|
4143
|
+
return /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "column", width: "100%", padding: 10 } }, this.modStatus === "loading" && /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: "Loading...", fontSize: t.status, color: C2.yellow }), this.modStatus === "saved" && /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: "Saved!", fontSize: t.status, color: C2.green }), this.modStatus === "error" && /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: "Error - check input", fontSize: t.status, color: C2.red }), this.kickStatus && /* @__PURE__ */ ReactEcs6.createElement(
|
|
4241
4144
|
Label6,
|
|
4242
4145
|
{
|
|
4243
4146
|
value: this.kickStatus,
|
|
@@ -4245,7 +4148,7 @@ var AdminPanelUIModule = class {
|
|
|
4245
4148
|
color: this.kickStatus.startsWith("Kick not sent") ? C2.red : C2.green,
|
|
4246
4149
|
uiTransform: { height: this.s(18) }
|
|
4247
4150
|
}
|
|
4248
|
-
), /* @__PURE__ */
|
|
4151
|
+
), /* @__PURE__ */ ReactEcs6.createElement(this.SectionHead, { label: "BROADCAST", color: C2.orange }), /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "row", alignItems: "center", margin: { bottom: 14 } } }, /* @__PURE__ */ ReactEcs6.createElement(
|
|
4249
4152
|
Input4,
|
|
4250
4153
|
{
|
|
4251
4154
|
uiTransform: { width: this.s(230), height: this.s(UI_DIMENSIONS.admin.inputHeight) },
|
|
@@ -4259,7 +4162,7 @@ var AdminPanelUIModule = class {
|
|
|
4259
4162
|
this.broadcastText = val;
|
|
4260
4163
|
}
|
|
4261
4164
|
}
|
|
4262
|
-
), /* @__PURE__ */
|
|
4165
|
+
), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4263
4166
|
Button4,
|
|
4264
4167
|
{
|
|
4265
4168
|
uiTransform: { width: this.s(65), height: this.s(UI_DIMENSIONS.admin.inputHeight), margin: { left: 8 } },
|
|
@@ -4269,7 +4172,7 @@ var AdminPanelUIModule = class {
|
|
|
4269
4172
|
color: C2.text,
|
|
4270
4173
|
onMouseDown: () => this.sendBroadcast()
|
|
4271
4174
|
}
|
|
4272
|
-
)), this.broadcastStatus && /* @__PURE__ */
|
|
4175
|
+
)), this.broadcastStatus && /* @__PURE__ */ ReactEcs6.createElement(
|
|
4273
4176
|
Label6,
|
|
4274
4177
|
{
|
|
4275
4178
|
value: this.broadcastStatus,
|
|
@@ -4277,7 +4180,7 @@ var AdminPanelUIModule = class {
|
|
|
4277
4180
|
color: this.broadcastStatus.startsWith("Not sent") ? C2.red : C2.green,
|
|
4278
4181
|
uiTransform: { height: this.s(18), margin: { bottom: 6 } }
|
|
4279
4182
|
}
|
|
4280
|
-
), /* @__PURE__ */
|
|
4183
|
+
), /* @__PURE__ */ ReactEcs6.createElement(this.SectionHead, { label: "CHAOS MODE", color: C2.red }), /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "row", flexWrap: "wrap", margin: { bottom: 14 } } }, /* @__PURE__ */ ReactEcs6.createElement(
|
|
4281
4184
|
Button4,
|
|
4282
4185
|
{
|
|
4283
4186
|
uiTransform: { width: this.s(130), height: this.s(UI_DIMENSIONS.admin.buttonHeight), margin: 4 },
|
|
@@ -4287,7 +4190,7 @@ var AdminPanelUIModule = class {
|
|
|
4287
4190
|
color: C2.text,
|
|
4288
4191
|
onMouseDown: () => this.kickAll()
|
|
4289
4192
|
}
|
|
4290
|
-
)), this.venue && /* @__PURE__ */
|
|
4193
|
+
)), this.venue && /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "column", margin: { bottom: 14 } } }, /* @__PURE__ */ ReactEcs6.createElement(this.SectionHead, { label: "PRIVATE MODE", color: C2.yellow }), /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: "While ON, only citizens get in", fontSize: t.labelSmall, color: C2.textDim, uiTransform: { height: this.s(18), margin: { bottom: 4 } } }), /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "row", flexWrap: "wrap" } }, [true, false].map((on) => /* @__PURE__ */ ReactEcs6.createElement(
|
|
4291
4194
|
Button4,
|
|
4292
4195
|
{
|
|
4293
4196
|
key: `private-${on ? "on" : "off"}`,
|
|
@@ -4298,7 +4201,7 @@ var AdminPanelUIModule = class {
|
|
|
4298
4201
|
color: this.privateModeOn === on ? Color46.Black() : C2.text,
|
|
4299
4202
|
onMouseDown: () => this.setPrivateMode(on)
|
|
4300
4203
|
}
|
|
4301
|
-
))), this.privateStatus && /* @__PURE__ */
|
|
4204
|
+
))), this.privateStatus && /* @__PURE__ */ ReactEcs6.createElement(
|
|
4302
4205
|
Label6,
|
|
4303
4206
|
{
|
|
4304
4207
|
value: this.privateStatus,
|
|
@@ -4306,13 +4209,13 @@ var AdminPanelUIModule = class {
|
|
|
4306
4209
|
color: this.privateStatus.startsWith("Not sent") ? C2.red : C2.green,
|
|
4307
4210
|
uiTransform: { height: this.s(18) }
|
|
4308
4211
|
}
|
|
4309
|
-
)), /* @__PURE__ */
|
|
4310
|
-
|
|
4212
|
+
)), /* @__PURE__ */ ReactEcs6.createElement(this.SectionHead, { label: "SCENE ADMINS", color: C2.purple }), /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "column", margin: { bottom: 6 } } }, this.sceneAdmins.length === 0 && this.modStatus !== "loading" && /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: "No scene admins", fontSize: t.labelSmall, color: C2.textDim }), this.sceneAdmins.map((wallet, i) => /* @__PURE__ */ ReactEcs6.createElement(
|
|
4213
|
+
UiEntity6,
|
|
4311
4214
|
{
|
|
4312
4215
|
key: `admin-${i}`,
|
|
4313
4216
|
uiTransform: { flexDirection: "row", alignItems: "center", margin: { bottom: 5 }, width: "100%" }
|
|
4314
4217
|
},
|
|
4315
|
-
/* @__PURE__ */
|
|
4218
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
4316
4219
|
Label6,
|
|
4317
4220
|
{
|
|
4318
4221
|
value: `${wallet.slice(0, 6)}...${wallet.slice(-4)}`,
|
|
@@ -4321,7 +4224,7 @@ var AdminPanelUIModule = class {
|
|
|
4321
4224
|
uiTransform: { width: this.s(130) }
|
|
4322
4225
|
}
|
|
4323
4226
|
),
|
|
4324
|
-
/* @__PURE__ */
|
|
4227
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
4325
4228
|
Button4,
|
|
4326
4229
|
{
|
|
4327
4230
|
uiTransform: { width: this.s(70), height: this.s(28), margin: { left: 8 } },
|
|
@@ -4332,7 +4235,7 @@ var AdminPanelUIModule = class {
|
|
|
4332
4235
|
onMouseDown: () => this.removeSceneAdmin(wallet)
|
|
4333
4236
|
}
|
|
4334
4237
|
)
|
|
4335
|
-
))), /* @__PURE__ */
|
|
4238
|
+
))), /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "row", alignItems: "center", margin: { bottom: 14 } } }, /* @__PURE__ */ ReactEcs6.createElement(
|
|
4336
4239
|
Input4,
|
|
4337
4240
|
{
|
|
4338
4241
|
uiTransform: { width: this.s(230), height: this.s(UI_DIMENSIONS.admin.inputHeight) },
|
|
@@ -4346,7 +4249,7 @@ var AdminPanelUIModule = class {
|
|
|
4346
4249
|
this.newAdminWallet = val;
|
|
4347
4250
|
}
|
|
4348
4251
|
}
|
|
4349
|
-
), /* @__PURE__ */
|
|
4252
|
+
), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4350
4253
|
Button4,
|
|
4351
4254
|
{
|
|
4352
4255
|
uiTransform: { width: this.s(60), height: this.s(UI_DIMENSIONS.admin.inputHeight), margin: { left: 8 } },
|
|
@@ -4358,13 +4261,13 @@ var AdminPanelUIModule = class {
|
|
|
4358
4261
|
if (this.newAdminWallet) this.addSceneAdmin(this.newAdminWallet);
|
|
4359
4262
|
}
|
|
4360
4263
|
}
|
|
4361
|
-
)), /* @__PURE__ */
|
|
4362
|
-
|
|
4264
|
+
)), /* @__PURE__ */ ReactEcs6.createElement(this.SectionHead, { label: "BANNED WALLETS", color: C2.red }), /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "column", margin: { bottom: 6 } } }, this.bannedWallets.length === 0 && this.modStatus !== "loading" && /* @__PURE__ */ ReactEcs6.createElement(Label6, { value: "No banned wallets", fontSize: t.labelSmall, color: C2.textDim }), this.bannedWallets.map((wallet, i) => /* @__PURE__ */ ReactEcs6.createElement(
|
|
4265
|
+
UiEntity6,
|
|
4363
4266
|
{
|
|
4364
4267
|
key: `ban-${i}`,
|
|
4365
4268
|
uiTransform: { flexDirection: "row", alignItems: "center", margin: { bottom: 5 }, width: "100%" }
|
|
4366
4269
|
},
|
|
4367
|
-
/* @__PURE__ */
|
|
4270
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
4368
4271
|
Label6,
|
|
4369
4272
|
{
|
|
4370
4273
|
value: `${wallet.slice(0, 6)}...${wallet.slice(-4)}`,
|
|
@@ -4373,7 +4276,7 @@ var AdminPanelUIModule = class {
|
|
|
4373
4276
|
uiTransform: { width: this.s(130) }
|
|
4374
4277
|
}
|
|
4375
4278
|
),
|
|
4376
|
-
/* @__PURE__ */
|
|
4279
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
4377
4280
|
Button4,
|
|
4378
4281
|
{
|
|
4379
4282
|
uiTransform: { width: this.s(70), height: this.s(28), margin: { left: 8 } },
|
|
@@ -4384,7 +4287,7 @@ var AdminPanelUIModule = class {
|
|
|
4384
4287
|
onMouseDown: () => this.unbanWallet(wallet)
|
|
4385
4288
|
}
|
|
4386
4289
|
)
|
|
4387
|
-
))), /* @__PURE__ */
|
|
4290
|
+
))), /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "row", alignItems: "center", margin: { bottom: 10 } } }, /* @__PURE__ */ ReactEcs6.createElement(
|
|
4388
4291
|
Input4,
|
|
4389
4292
|
{
|
|
4390
4293
|
uiTransform: { width: this.s(230), height: this.s(UI_DIMENSIONS.admin.inputHeight) },
|
|
@@ -4398,7 +4301,7 @@ var AdminPanelUIModule = class {
|
|
|
4398
4301
|
this.newBanWallet = val;
|
|
4399
4302
|
}
|
|
4400
4303
|
}
|
|
4401
|
-
), /* @__PURE__ */
|
|
4304
|
+
), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4402
4305
|
Button4,
|
|
4403
4306
|
{
|
|
4404
4307
|
uiTransform: { width: this.s(60), height: this.s(UI_DIMENSIONS.admin.inputHeight), margin: { left: 8 } },
|
|
@@ -4410,7 +4313,7 @@ var AdminPanelUIModule = class {
|
|
|
4410
4313
|
if (this.newBanWallet) this.banWallet(this.newBanWallet);
|
|
4411
4314
|
}
|
|
4412
4315
|
}
|
|
4413
|
-
)), /* @__PURE__ */
|
|
4316
|
+
)), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4414
4317
|
Button4,
|
|
4415
4318
|
{
|
|
4416
4319
|
uiTransform: { height: this.s(24) },
|
|
@@ -4457,8 +4360,8 @@ var AdminPanelUIModule = class {
|
|
|
4457
4360
|
if (!tabs.find((tab) => tab.id === this.activeTab) && tabs.length > 0) {
|
|
4458
4361
|
this.activeTab = tabs[0].id;
|
|
4459
4362
|
}
|
|
4460
|
-
return /* @__PURE__ */
|
|
4461
|
-
|
|
4363
|
+
return /* @__PURE__ */ ReactEcs6.createElement(
|
|
4364
|
+
UiEntity6,
|
|
4462
4365
|
{
|
|
4463
4366
|
uiTransform: {
|
|
4464
4367
|
width: "100%",
|
|
@@ -4467,8 +4370,11 @@ var AdminPanelUIModule = class {
|
|
|
4467
4370
|
}
|
|
4468
4371
|
},
|
|
4469
4372
|
this.renderScaledNotification(),
|
|
4470
|
-
this.client.isPhone
|
|
4471
|
-
|
|
4373
|
+
this.client.isPhone || this.client.toolbarCollapsed ? this.client.toolbarButton(2, {
|
|
4374
|
+
uiBackground: { color: this.panelOpen ? C2.btn : C2.header },
|
|
4375
|
+
children: [this.renderToggleFace()]
|
|
4376
|
+
}) : /* @__PURE__ */ ReactEcs6.createElement(
|
|
4377
|
+
UiEntity6,
|
|
4472
4378
|
{
|
|
4473
4379
|
uiTransform: {
|
|
4474
4380
|
position: { right: 20 + this.s(100) + 10 + this.s(100) + 10, bottom: 10 },
|
|
@@ -4490,8 +4396,8 @@ var AdminPanelUIModule = class {
|
|
|
4490
4396
|
uiBackground: { color: C2.bg },
|
|
4491
4397
|
children: [
|
|
4492
4398
|
// Header with font controls
|
|
4493
|
-
/* @__PURE__ */
|
|
4494
|
-
|
|
4399
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
4400
|
+
UiEntity6,
|
|
4495
4401
|
{
|
|
4496
4402
|
uiTransform: {
|
|
4497
4403
|
width: "100%",
|
|
@@ -4503,8 +4409,8 @@ var AdminPanelUIModule = class {
|
|
|
4503
4409
|
},
|
|
4504
4410
|
uiBackground: { color: C2.header }
|
|
4505
4411
|
},
|
|
4506
|
-
/* @__PURE__ */
|
|
4507
|
-
/* @__PURE__ */
|
|
4412
|
+
/* @__PURE__ */ ReactEcs6.createElement(Label6, { value: this.config.title || "ADMIN PANEL", fontSize: t.header, color: C2.text }),
|
|
4413
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
4508
4414
|
Button4,
|
|
4509
4415
|
{
|
|
4510
4416
|
uiTransform: { width: this.s(28), height: this.s(28) },
|
|
@@ -4517,10 +4423,10 @@ var AdminPanelUIModule = class {
|
|
|
4517
4423
|
)
|
|
4518
4424
|
),
|
|
4519
4425
|
// Tabs
|
|
4520
|
-
/* @__PURE__ */
|
|
4426
|
+
/* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { width: "100%", height: this.s(UI_DIMENSIONS.admin.tabHeight), flexDirection: "row" } }, tabs.map((tab) => /* @__PURE__ */ ReactEcs6.createElement(this.TabBtn, { label: tab.label, tab: tab.id }))),
|
|
4521
4427
|
// Content
|
|
4522
|
-
/* @__PURE__ */
|
|
4523
|
-
|
|
4428
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
4429
|
+
UiEntity6,
|
|
4524
4430
|
{
|
|
4525
4431
|
uiTransform: {
|
|
4526
4432
|
width: "100%",
|
|
@@ -4529,14 +4435,14 @@ var AdminPanelUIModule = class {
|
|
|
4529
4435
|
flexDirection: "column"
|
|
4530
4436
|
}
|
|
4531
4437
|
},
|
|
4532
|
-
this.activeTab === "controls" && this.venue && this.controls.length > 0 && /* @__PURE__ */
|
|
4533
|
-
this.activeTab === "video" && /* @__PURE__ */
|
|
4534
|
-
this.activeTab === "mod" && this.isOwner && /* @__PURE__ */
|
|
4438
|
+
this.activeTab === "controls" && this.venue && this.controls.length > 0 && /* @__PURE__ */ ReactEcs6.createElement(this.ControlsTab, null),
|
|
4439
|
+
this.activeTab === "video" && /* @__PURE__ */ ReactEcs6.createElement(this.VideoTab, null),
|
|
4440
|
+
this.activeTab === "mod" && this.isOwner && /* @__PURE__ */ ReactEcs6.createElement(this.ModTab, null),
|
|
4535
4441
|
this.config.sceneTabs?.map((tab) => this.activeTab === tab.id && tab.render())
|
|
4536
4442
|
),
|
|
4537
4443
|
// Footer
|
|
4538
|
-
/* @__PURE__ */
|
|
4539
|
-
|
|
4444
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
4445
|
+
UiEntity6,
|
|
4540
4446
|
{
|
|
4541
4447
|
uiTransform: {
|
|
4542
4448
|
width: "100%",
|
|
@@ -4546,7 +4452,7 @@ var AdminPanelUIModule = class {
|
|
|
4546
4452
|
},
|
|
4547
4453
|
uiBackground: { color: C2.section }
|
|
4548
4454
|
},
|
|
4549
|
-
/* @__PURE__ */
|
|
4455
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
4550
4456
|
Button4,
|
|
4551
4457
|
{
|
|
4552
4458
|
uiTransform: { height: this.s(24) },
|
|
@@ -5715,7 +5621,7 @@ var AdminPanelUIModule = class {
|
|
|
5715
5621
|
/** A control's button (2026-11-18): the option's label, highlighted while that option is current on this copy */
|
|
5716
5622
|
controlButton(control, option, label) {
|
|
5717
5623
|
const current = this.currentOption[control.id] === option;
|
|
5718
|
-
return /* @__PURE__ */
|
|
5624
|
+
return /* @__PURE__ */ ReactEcs6.createElement(
|
|
5719
5625
|
Button4,
|
|
5720
5626
|
{
|
|
5721
5627
|
key: `control-${control.id}-${option}`,
|
|
@@ -5738,8 +5644,8 @@ var AdminPanelUIModule = class {
|
|
|
5738
5644
|
if (!state.visible) return null;
|
|
5739
5645
|
const N2 = UI_DIMENSIONS.notification;
|
|
5740
5646
|
const colors = THEME.colors;
|
|
5741
|
-
return /* @__PURE__ */
|
|
5742
|
-
|
|
5647
|
+
return /* @__PURE__ */ ReactEcs6.createElement(
|
|
5648
|
+
UiEntity6,
|
|
5743
5649
|
{
|
|
5744
5650
|
uiTransform: {
|
|
5745
5651
|
positionType: "absolute",
|
|
@@ -5749,8 +5655,8 @@ var AdminPanelUIModule = class {
|
|
|
5749
5655
|
alignItems: "center"
|
|
5750
5656
|
}
|
|
5751
5657
|
},
|
|
5752
|
-
/* @__PURE__ */
|
|
5753
|
-
|
|
5658
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
5659
|
+
UiEntity6,
|
|
5754
5660
|
{
|
|
5755
5661
|
uiTransform: {
|
|
5756
5662
|
minWidth: this.s(200),
|
|
@@ -5762,15 +5668,15 @@ var AdminPanelUIModule = class {
|
|
|
5762
5668
|
},
|
|
5763
5669
|
uiBackground: { color: colors.panel }
|
|
5764
5670
|
},
|
|
5765
|
-
/* @__PURE__ */
|
|
5766
|
-
|
|
5671
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
5672
|
+
UiEntity6,
|
|
5767
5673
|
{
|
|
5768
5674
|
uiTransform: { width: N2.borderWidth, height: "100%" },
|
|
5769
5675
|
uiBackground: { color: colors.cyan }
|
|
5770
5676
|
}
|
|
5771
5677
|
),
|
|
5772
|
-
/* @__PURE__ */
|
|
5773
|
-
|
|
5678
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
5679
|
+
UiEntity6,
|
|
5774
5680
|
{
|
|
5775
5681
|
uiTransform: {
|
|
5776
5682
|
flexGrow: 1,
|
|
@@ -5780,7 +5686,7 @@ var AdminPanelUIModule = class {
|
|
|
5780
5686
|
alignItems: "center"
|
|
5781
5687
|
}
|
|
5782
5688
|
},
|
|
5783
|
-
/* @__PURE__ */
|
|
5689
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
5784
5690
|
Label6,
|
|
5785
5691
|
{
|
|
5786
5692
|
value: state.text,
|
|
@@ -5790,8 +5696,8 @@ var AdminPanelUIModule = class {
|
|
|
5790
5696
|
}
|
|
5791
5697
|
)
|
|
5792
5698
|
),
|
|
5793
|
-
/* @__PURE__ */
|
|
5794
|
-
|
|
5699
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
5700
|
+
UiEntity6,
|
|
5795
5701
|
{
|
|
5796
5702
|
uiTransform: { width: 5, height: 5, margin: { right: 10 } },
|
|
5797
5703
|
uiBackground: { color: colors.cyan }
|
|
@@ -5802,7 +5708,7 @@ var AdminPanelUIModule = class {
|
|
|
5802
5708
|
}
|
|
5803
5709
|
/** The ADMIN / CLOSE button itself; its place is the row's or, on a phone, the column's (2.12.0) */
|
|
5804
5710
|
renderToggleFace() {
|
|
5805
|
-
return /* @__PURE__ */
|
|
5711
|
+
return /* @__PURE__ */ ReactEcs6.createElement(
|
|
5806
5712
|
Button4,
|
|
5807
5713
|
{
|
|
5808
5714
|
uiTransform: { width: this.s(100), height: this.s(45) },
|
|
@@ -5819,6 +5725,222 @@ var AdminPanelUIModule = class {
|
|
|
5819
5725
|
// src/StaticTVClient.ts
|
|
5820
5726
|
import { getExplorerInformation } from "~system/Runtime";
|
|
5821
5727
|
|
|
5728
|
+
// src/ui/toolbar.ts
|
|
5729
|
+
var TOOLBAR = { edge: 20, gap: 10, buttonWidth: 100, buttonHeight: 45, bottom: 10 };
|
|
5730
|
+
var COLUMN_SLOTS = 5;
|
|
5731
|
+
var PHONE_EDGE = 0;
|
|
5732
|
+
var HANDLE = 24;
|
|
5733
|
+
var STRIP = { phone: 12, desktop: 10 };
|
|
5734
|
+
function platformOf(answer) {
|
|
5735
|
+
const raw = answer?.platform;
|
|
5736
|
+
if (typeof raw !== "string") return "unknown";
|
|
5737
|
+
const p = raw.trim().toLowerCase();
|
|
5738
|
+
return p === "desktop" || p === "mobile" || p === "vr" || p === "web" ? p : "unknown";
|
|
5739
|
+
}
|
|
5740
|
+
function isPhonePlatform(platform) {
|
|
5741
|
+
return platform === "mobile";
|
|
5742
|
+
}
|
|
5743
|
+
var scaled = (value, uiScale) => Math.round(value * uiScale);
|
|
5744
|
+
function rowRight(slot, uiScale = 1) {
|
|
5745
|
+
return TOOLBAR.edge + slot * (scaled(TOOLBAR.buttonWidth, uiScale) + TOOLBAR.gap);
|
|
5746
|
+
}
|
|
5747
|
+
function columnSlot(slot, uiScale = 1) {
|
|
5748
|
+
const h = scaled(TOOLBAR.buttonHeight, uiScale);
|
|
5749
|
+
const handle = scaled(HANDLE, uiScale) + TOOLBAR.gap;
|
|
5750
|
+
return {
|
|
5751
|
+
right: PHONE_EDGE,
|
|
5752
|
+
boxHeight: handle + COLUMN_SLOTS * h + (COLUMN_SLOTS - 1) * TOOLBAR.gap,
|
|
5753
|
+
above: handle + Math.max(0, slot) * (h + TOOLBAR.gap)
|
|
5754
|
+
};
|
|
5755
|
+
}
|
|
5756
|
+
function handlePlace(phone, lastSlot, uiScale = 1) {
|
|
5757
|
+
if (phone) {
|
|
5758
|
+
return {
|
|
5759
|
+
right: PHONE_EDGE,
|
|
5760
|
+
width: scaled(TOOLBAR.buttonWidth, uiScale),
|
|
5761
|
+
height: scaled(HANDLE, uiScale),
|
|
5762
|
+
boxHeight: columnSlot(0, uiScale).boxHeight,
|
|
5763
|
+
above: 0
|
|
5764
|
+
};
|
|
5765
|
+
}
|
|
5766
|
+
return {
|
|
5767
|
+
right: rowRight(Math.max(0, lastSlot) + 1, uiScale),
|
|
5768
|
+
bottom: TOOLBAR.bottom,
|
|
5769
|
+
width: scaled(HANDLE, uiScale),
|
|
5770
|
+
height: scaled(TOOLBAR.buttonHeight, uiScale)
|
|
5771
|
+
};
|
|
5772
|
+
}
|
|
5773
|
+
function stripPlace(slot, phone, uiScale = 1) {
|
|
5774
|
+
if (phone) return { right: PHONE_EDGE, width: scaled(STRIP.phone, uiScale), height: scaled(TOOLBAR.buttonHeight, uiScale) };
|
|
5775
|
+
return { right: rowRight(slot, uiScale), bottom: 0, width: scaled(TOOLBAR.buttonWidth, uiScale), height: scaled(STRIP.desktop, uiScale) };
|
|
5776
|
+
}
|
|
5777
|
+
var ToolbarFold = class {
|
|
5778
|
+
constructor(closeAll) {
|
|
5779
|
+
this._collapsed = false;
|
|
5780
|
+
this._sceneLast = -1;
|
|
5781
|
+
this.closeAll = closeAll;
|
|
5782
|
+
}
|
|
5783
|
+
get collapsed() {
|
|
5784
|
+
return this._collapsed;
|
|
5785
|
+
}
|
|
5786
|
+
collapse() {
|
|
5787
|
+
if (this._collapsed) return;
|
|
5788
|
+
this.closeAll();
|
|
5789
|
+
this._collapsed = true;
|
|
5790
|
+
}
|
|
5791
|
+
expand() {
|
|
5792
|
+
this._collapsed = false;
|
|
5793
|
+
}
|
|
5794
|
+
/** A button was drawn in `slot` */
|
|
5795
|
+
seen(slot) {
|
|
5796
|
+
if (slot > this._sceneLast) this._sceneLast = slot;
|
|
5797
|
+
}
|
|
5798
|
+
/** The row's last slot: the SDK's own last (ADMIN's 2 when drawn, else GUIDE's 1) or a scene's, whichever is higher */
|
|
5799
|
+
lastSlot(sdkLast) {
|
|
5800
|
+
return Math.max(sdkLast, this._sceneLast);
|
|
5801
|
+
}
|
|
5802
|
+
};
|
|
5803
|
+
function panelRight(phone, desktopRight, uiScale = 1) {
|
|
5804
|
+
return phone ? PHONE_EDGE + scaled(TOOLBAR.buttonWidth, uiScale) + TOOLBAR.gap : desktopRight;
|
|
5805
|
+
}
|
|
5806
|
+
var DESKTOP_CLOSES = { guide: ["admin"], admin: ["guide"] };
|
|
5807
|
+
var GUIDE_PLACE = ["guide", "admin"];
|
|
5808
|
+
function panelsToClose(opened, registered, phone, coversGuide = []) {
|
|
5809
|
+
if (phone) return registered.filter((name) => name !== opened);
|
|
5810
|
+
const closes = [...DESKTOP_CLOSES[opened] ?? []];
|
|
5811
|
+
if (GUIDE_PLACE.includes(opened)) closes.push(...coversGuide);
|
|
5812
|
+
if (coversGuide.includes(opened)) closes.push(...GUIDE_PLACE);
|
|
5813
|
+
return registered.filter((name) => name !== opened && closes.includes(name));
|
|
5814
|
+
}
|
|
5815
|
+
var PanelRules = class {
|
|
5816
|
+
constructor(phone) {
|
|
5817
|
+
this.hides = /* @__PURE__ */ new Map();
|
|
5818
|
+
this.coveringGuide = /* @__PURE__ */ new Set();
|
|
5819
|
+
this.phone = phone;
|
|
5820
|
+
}
|
|
5821
|
+
/** Register (or replace) a panel; its hide runs when another panel opens and the rule says so */
|
|
5822
|
+
register(name, hide, options = {}) {
|
|
5823
|
+
this.hides.set(name, hide);
|
|
5824
|
+
if (options.coversGuide === true) this.coveringGuide.add(name);
|
|
5825
|
+
else this.coveringGuide.delete(name);
|
|
5826
|
+
}
|
|
5827
|
+
/** Close every registered panel (2.14.0, the toolbar collapsing). One failing hide does not stop the rest. */
|
|
5828
|
+
closeAll() {
|
|
5829
|
+
for (const hide of this.hides.values()) {
|
|
5830
|
+
try {
|
|
5831
|
+
hide();
|
|
5832
|
+
} catch {
|
|
5833
|
+
}
|
|
5834
|
+
}
|
|
5835
|
+
}
|
|
5836
|
+
/** A panel opened: close the ones the rule names. One failing hide does not stop the rest. */
|
|
5837
|
+
opened(name) {
|
|
5838
|
+
for (const other of panelsToClose(name, [...this.hides.keys()], this.phone(), [...this.coveringGuide])) {
|
|
5839
|
+
try {
|
|
5840
|
+
this.hides.get(other)?.();
|
|
5841
|
+
} catch {
|
|
5842
|
+
}
|
|
5843
|
+
}
|
|
5844
|
+
}
|
|
5845
|
+
get names() {
|
|
5846
|
+
return [...this.hides.keys()];
|
|
5847
|
+
}
|
|
5848
|
+
};
|
|
5849
|
+
|
|
5850
|
+
// src/ui/toolbar-button.ts
|
|
5851
|
+
import ReactEcs7, { UiEntity as UiEntity7 } from "@dcl/sdk/react-ecs";
|
|
5852
|
+
function inColumn(width, boxHeight, above, right, entity) {
|
|
5853
|
+
return ReactEcs7.createElement(UiEntity7, {
|
|
5854
|
+
uiTransform: {
|
|
5855
|
+
positionType: "absolute",
|
|
5856
|
+
position: { right, top: 0 },
|
|
5857
|
+
width,
|
|
5858
|
+
height: "100%",
|
|
5859
|
+
flexDirection: "column",
|
|
5860
|
+
justifyContent: "center"
|
|
5861
|
+
},
|
|
5862
|
+
children: [
|
|
5863
|
+
ReactEcs7.createElement(UiEntity7, {
|
|
5864
|
+
uiTransform: { width, height: boxHeight, flexDirection: "column", flexShrink: 0 },
|
|
5865
|
+
children: [
|
|
5866
|
+
ReactEcs7.createElement(UiEntity7, { uiTransform: { width, height: above, flexShrink: 0 } }),
|
|
5867
|
+
entity
|
|
5868
|
+
]
|
|
5869
|
+
})
|
|
5870
|
+
]
|
|
5871
|
+
});
|
|
5872
|
+
}
|
|
5873
|
+
function toolbarButton(slot, props, phone, uiScale = 1, fold) {
|
|
5874
|
+
const width = Math.round(TOOLBAR.buttonWidth * uiScale);
|
|
5875
|
+
const height = Math.round(TOOLBAR.buttonHeight * uiScale);
|
|
5876
|
+
if (fold?.collapsed) {
|
|
5877
|
+
const strip = stripPlace(slot, phone, uiScale);
|
|
5878
|
+
const face = { uiBackground: props.uiBackground, onMouseDown: () => fold.expand() };
|
|
5879
|
+
if (!phone) {
|
|
5880
|
+
return ReactEcs7.createElement(UiEntity7, {
|
|
5881
|
+
...face,
|
|
5882
|
+
uiTransform: {
|
|
5883
|
+
positionType: "absolute",
|
|
5884
|
+
position: { right: strip.right, bottom: strip.bottom },
|
|
5885
|
+
width: strip.width,
|
|
5886
|
+
height: strip.height
|
|
5887
|
+
}
|
|
5888
|
+
});
|
|
5889
|
+
}
|
|
5890
|
+
const place2 = columnSlot(slot, uiScale);
|
|
5891
|
+
return inColumn(strip.width, place2.boxHeight, place2.above, strip.right, ReactEcs7.createElement(UiEntity7, {
|
|
5892
|
+
...face,
|
|
5893
|
+
uiTransform: { width: strip.width, height: strip.height, flexShrink: 0 }
|
|
5894
|
+
}));
|
|
5895
|
+
}
|
|
5896
|
+
if (!phone) {
|
|
5897
|
+
return ReactEcs7.createElement(UiEntity7, {
|
|
5898
|
+
...props,
|
|
5899
|
+
uiTransform: {
|
|
5900
|
+
positionType: "absolute",
|
|
5901
|
+
position: { right: rowRight(slot, uiScale), bottom: TOOLBAR.bottom },
|
|
5902
|
+
width,
|
|
5903
|
+
height,
|
|
5904
|
+
...props.uiTransform
|
|
5905
|
+
}
|
|
5906
|
+
});
|
|
5907
|
+
}
|
|
5908
|
+
const place = columnSlot(slot, uiScale);
|
|
5909
|
+
return inColumn(width, place.boxHeight, place.above, place.right, ReactEcs7.createElement(UiEntity7, {
|
|
5910
|
+
...props,
|
|
5911
|
+
uiTransform: { width, height, flexShrink: 0, ...props.uiTransform }
|
|
5912
|
+
}));
|
|
5913
|
+
}
|
|
5914
|
+
function toolbarHandle(phone, lastSlot, collapse, uiScale = 1) {
|
|
5915
|
+
const place = handlePlace(phone, lastSlot, uiScale);
|
|
5916
|
+
const face = {
|
|
5917
|
+
uiBackground: { color: THEME.colors.buttonBackground },
|
|
5918
|
+
onMouseDown: collapse,
|
|
5919
|
+
children: [
|
|
5920
|
+
ReactEcs7.createElement(UiEntity7, {
|
|
5921
|
+
uiText: { value: ">", fontSize: Math.round(14 * uiScale), color: THEME.colors.gray, textAlign: "middle-center" }
|
|
5922
|
+
})
|
|
5923
|
+
]
|
|
5924
|
+
};
|
|
5925
|
+
if (!phone) {
|
|
5926
|
+
return ReactEcs7.createElement(UiEntity7, {
|
|
5927
|
+
...face,
|
|
5928
|
+
uiTransform: {
|
|
5929
|
+
positionType: "absolute",
|
|
5930
|
+
position: { right: place.right, bottom: place.bottom },
|
|
5931
|
+
width: place.width,
|
|
5932
|
+
height: place.height,
|
|
5933
|
+
justifyContent: "center",
|
|
5934
|
+
alignItems: "center"
|
|
5935
|
+
}
|
|
5936
|
+
});
|
|
5937
|
+
}
|
|
5938
|
+
return inColumn(place.width, place.boxHeight, place.above, place.right, ReactEcs7.createElement(UiEntity7, {
|
|
5939
|
+
...face,
|
|
5940
|
+
uiTransform: { width: place.width, height: place.height, flexShrink: 0, justifyContent: "center", alignItems: "center" }
|
|
5941
|
+
}));
|
|
5942
|
+
}
|
|
5943
|
+
|
|
5822
5944
|
// src/ui/toolbar-panel.ts
|
|
5823
5945
|
import ReactEcs8, { UiEntity as UiEntity8 } from "@dcl/sdk/react-ecs";
|
|
5824
5946
|
function toolbarPanel(props, phone, uiScale = 1) {
|
|
@@ -5916,6 +6038,8 @@ var _StaticTVClient = class _StaticTVClient {
|
|
|
5916
6038
|
* scene's (registerPanel); elsewhere the guide and the admin panel close each other, as before.
|
|
5917
6039
|
*/
|
|
5918
6040
|
this.panelRules = new PanelRules(() => this.isPhone);
|
|
6041
|
+
/** The toolbar collapsed to strips or not, for the visit (2.14.0): collapsing closes every panel first */
|
|
6042
|
+
this.fold = new ToolbarFold(() => this.panelRules.closeAll());
|
|
5919
6043
|
// =============================================================================
|
|
5920
6044
|
// --- VIDEO PLAYBACK (Internal handler for videoScreen) ---
|
|
5921
6045
|
// =============================================================================
|
|
@@ -6849,7 +6973,8 @@ var _StaticTVClient = class _StaticTVClient {
|
|
|
6849
6973
|
* placed its own by hand before), the column on a phone. Slots count from the right (the row) or the top (the
|
|
6850
6974
|
* 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
|
|
6851
6975
|
* scene's. `props` is the button's face - its uiBackground, onMouseDown and children - the slot gives its place and
|
|
6852
|
-
* size (a width or height in props.uiTransform wins).
|
|
6976
|
+
* size (a width or height in props.uiTransform wins). Collapsed (2.14.0) it draws a strip in the face's uiBackground
|
|
6977
|
+
* color instead, flush on the edge, and a press on any strip expands the toolbar.
|
|
6853
6978
|
*
|
|
6854
6979
|
* @example
|
|
6855
6980
|
* ```typescript
|
|
@@ -6862,7 +6987,29 @@ var _StaticTVClient = class _StaticTVClient {
|
|
|
6862
6987
|
* ```
|
|
6863
6988
|
*/
|
|
6864
6989
|
toolbarButton(slot, props) {
|
|
6865
|
-
|
|
6990
|
+
this.fold.seen(slot);
|
|
6991
|
+
return toolbarButton(slot, props, this.isPhone, this.uiScale, {
|
|
6992
|
+
collapsed: this.fold.collapsed,
|
|
6993
|
+
expand: () => this.fold.expand()
|
|
6994
|
+
});
|
|
6995
|
+
}
|
|
6996
|
+
/**
|
|
6997
|
+
* The toolbar collapsed to strips (2.14.0, his ask: "small tabs out of users way"): the `>` handle collapses it and
|
|
6998
|
+
* closes every open panel, the scene's registered ones too; any strip expands it. For the visit only; it starts
|
|
6999
|
+
* expanded. A scene drawing its buttons through toolbarButton needs nothing more.
|
|
7000
|
+
*/
|
|
7001
|
+
get toolbarCollapsed() {
|
|
7002
|
+
return this.fold.collapsed;
|
|
7003
|
+
}
|
|
7004
|
+
/**
|
|
7005
|
+
* The `>` handle, drawn by the SDK's chat (2.14.0): on a phone a bar on top of the column, on desktop a tab one slot
|
|
7006
|
+
* past the row's last button (ADMIN's or a scene's), so no button moves. Nothing while collapsed.
|
|
7007
|
+
* @internal
|
|
7008
|
+
*/
|
|
7009
|
+
toolbarHandle() {
|
|
7010
|
+
if (this.fold.collapsed) return null;
|
|
7011
|
+
const sdkLast = this.adminPanel?.hasAccess === true ? 2 : 1;
|
|
7012
|
+
return toolbarHandle(this.isPhone, this.fold.lastSlot(sdkLast), () => this.fold.collapse(), this.uiScale);
|
|
6866
7013
|
}
|
|
6867
7014
|
/** Where a scene's own panel's right edge goes: on a phone one gap left of the column; elsewhere `desktopRight` */
|
|
6868
7015
|
panelRight(desktopRight) {
|