@thestatic-tv/dcl-sdk 2.13.0 → 2.15.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 +31 -0
- package/dist/index.d.mts +39 -8
- package/dist/index.d.ts +39 -8
- package/dist/index.js +608 -441
- package/dist/index.mjs +559 -392
- 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.15.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,51 +2290,25 @@ 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
|
]
|
|
2396
2297
|
});
|
|
2397
2298
|
}
|
|
2398
2299
|
renderToggleButton() {
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
color: THEME.colors.white,
|
|
2406
|
-
textAlign: "middle-center"
|
|
2407
|
-
}
|
|
2408
|
-
});
|
|
2409
|
-
const press = () => this._isVisible ? this.hide() : this.show();
|
|
2410
|
-
if (this.client.isPhone) {
|
|
2411
|
-
return toolbarButton(1, {
|
|
2412
|
-
uiTransform: { justifyContent: "center", alignItems: "center" },
|
|
2413
|
-
uiBackground: { color: buttonColor },
|
|
2414
|
-
onMouseDown: press,
|
|
2415
|
-
children: [label]
|
|
2416
|
-
}, true, this.client.uiScale);
|
|
2417
|
-
}
|
|
2418
|
-
const buttonPos = 20 + this.s(100) + 10;
|
|
2419
|
-
return ReactEcs3.createElement(UiEntity3, {
|
|
2420
|
-
uiTransform: {
|
|
2421
|
-
positionType: "absolute",
|
|
2422
|
-
position: { right: buttonPos, bottom: 10 },
|
|
2423
|
-
width: this.s(100),
|
|
2424
|
-
height: this.s(45),
|
|
2425
|
-
justifyContent: "center",
|
|
2426
|
-
alignItems: "center"
|
|
2427
|
-
},
|
|
2428
|
-
uiBackground: { color: buttonColor },
|
|
2429
|
-
onMouseDown: press,
|
|
2430
|
-
children: [label]
|
|
2300
|
+
return this.client.toolbarButton(1, {
|
|
2301
|
+
uiBackground: { color: Color43.create(0, 0.5, 0.5, 0.9) },
|
|
2302
|
+
icon: "guide",
|
|
2303
|
+
tag: "GUIDE",
|
|
2304
|
+
open: this._isVisible,
|
|
2305
|
+
onMouseDown: () => this._isVisible ? this.hide() : this.show()
|
|
2431
2306
|
});
|
|
2432
2307
|
}
|
|
2433
2308
|
};
|
|
2434
2309
|
|
|
2435
2310
|
// src/ui/chat-ui.tsx
|
|
2436
|
-
import
|
|
2311
|
+
import ReactEcs3, { UiEntity as UiEntity3, Label as Label3, Input as Input3, Button as Button2 } from "@dcl/sdk/react-ecs";
|
|
2437
2312
|
import { Color4 as Color44 } from "@dcl/sdk/math";
|
|
2438
2313
|
import { signedFetch as signedFetch3 } from "~system/SignedFetch";
|
|
2439
2314
|
import { getPlayer } from "@dcl/sdk/players";
|
|
@@ -2484,7 +2359,7 @@ var ChatUIModule = class {
|
|
|
2484
2359
|
if (this.client.isVisitorBlocked) return null;
|
|
2485
2360
|
const scaledTheme = scaleChatTheme(DEFAULT_CHAT_THEME, this.client.uiScale);
|
|
2486
2361
|
const positionStyle = this.getPositionStyle();
|
|
2487
|
-
return
|
|
2362
|
+
return ReactEcs3.createElement(UiEntity3, {
|
|
2488
2363
|
uiTransform: {
|
|
2489
2364
|
width: "100%",
|
|
2490
2365
|
height: "100%",
|
|
@@ -2493,6 +2368,8 @@ var ChatUIModule = class {
|
|
|
2493
2368
|
children: [
|
|
2494
2369
|
// Always render toggle button
|
|
2495
2370
|
this.renderToggleButton(),
|
|
2371
|
+
// The toolbar's collapse handle, drawn here once for the whole toolbar (2.14.0; nothing while collapsed)
|
|
2372
|
+
this.client.toolbarHandle(),
|
|
2496
2373
|
// Render panel when visible - scaled sizes, fixed position
|
|
2497
2374
|
// Key includes uiScale to force re-render when scale changes from other panels
|
|
2498
2375
|
// On a phone centered beside the toolbar's column (2.13.0, src/ui/toolbar-panel.ts); elsewhere as here
|
|
@@ -2512,7 +2389,7 @@ var ChatUIModule = class {
|
|
|
2512
2389
|
this.renderHeader(),
|
|
2513
2390
|
this.renderChannelButton(scaledTheme),
|
|
2514
2391
|
this.renderMessagesArea(scaledTheme),
|
|
2515
|
-
|
|
2392
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
2516
2393
|
uiTransform: { width: "100%", height: 1, flexShrink: 0 },
|
|
2517
2394
|
uiBackground: { color: THEME.colors.panelBorder }
|
|
2518
2395
|
}),
|
|
@@ -2854,7 +2731,7 @@ var ChatUIModule = class {
|
|
|
2854
2731
|
renderChannelButton(theme) {
|
|
2855
2732
|
const currentChannel = this.channels.find((c) => c.id === this.currentChannelId);
|
|
2856
2733
|
const displayName = currentChannel?.name || this.currentChannelId;
|
|
2857
|
-
return
|
|
2734
|
+
return ReactEcs3.createElement(UiEntity3, {
|
|
2858
2735
|
uiTransform: {
|
|
2859
2736
|
height: 40,
|
|
2860
2737
|
width: "100%",
|
|
@@ -2869,12 +2746,12 @@ var ChatUIModule = class {
|
|
|
2869
2746
|
this.showChannelDropdown = !this.showChannelDropdown;
|
|
2870
2747
|
},
|
|
2871
2748
|
children: [
|
|
2872
|
-
|
|
2749
|
+
ReactEcs3.createElement(Label3, {
|
|
2873
2750
|
value: `// ${truncateText(displayName, 24)}`,
|
|
2874
2751
|
fontSize: theme.channelButton,
|
|
2875
2752
|
color: THEME.colors.white
|
|
2876
2753
|
}),
|
|
2877
|
-
|
|
2754
|
+
ReactEcs3.createElement(Label3, {
|
|
2878
2755
|
value: this.showChannelDropdown ? "\u25B2" : "\u25BC",
|
|
2879
2756
|
fontSize: 10,
|
|
2880
2757
|
color: THEME.colors.cyan
|
|
@@ -2903,7 +2780,7 @@ var ChatUIModule = class {
|
|
|
2903
2780
|
const visibleMessages = allMessages.slice(startIdx, endIdx);
|
|
2904
2781
|
const canScrollUp = this.chatScrollOffset < maxOffset;
|
|
2905
2782
|
const canScrollDown = this.chatScrollOffset > 0;
|
|
2906
|
-
return
|
|
2783
|
+
return ReactEcs3.createElement(UiEntity3, {
|
|
2907
2784
|
uiTransform: { flexGrow: 1, width: "100%", flexDirection: "row", overflow: "hidden" },
|
|
2908
2785
|
children: [
|
|
2909
2786
|
// Messages - anchored at the bottom, so the newest stays in view now that a row grows with its text
|
|
@@ -2911,7 +2788,7 @@ var ChatUIModule = class {
|
|
|
2911
2788
|
// past it; now its oldest clips at the top, one scroll up away. The rows keep their height
|
|
2912
2789
|
// (flexShrink 0 - the protocol's default of 1 squeezes them onto each other) in one column
|
|
2913
2790
|
// (nowrap - the protocol documents wrap as its default).
|
|
2914
|
-
|
|
2791
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
2915
2792
|
uiTransform: {
|
|
2916
2793
|
flexGrow: 1,
|
|
2917
2794
|
flexDirection: "column",
|
|
@@ -2925,7 +2802,7 @@ var ChatUIModule = class {
|
|
|
2925
2802
|
)
|
|
2926
2803
|
}),
|
|
2927
2804
|
// Scroll controls
|
|
2928
|
-
|
|
2805
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
2929
2806
|
uiTransform: {
|
|
2930
2807
|
width: 28,
|
|
2931
2808
|
height: "100%",
|
|
@@ -2935,22 +2812,22 @@ var ChatUIModule = class {
|
|
|
2935
2812
|
gap: 8
|
|
2936
2813
|
},
|
|
2937
2814
|
children: [
|
|
2938
|
-
|
|
2815
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
2939
2816
|
uiTransform: { width: 26, height: 36, justifyContent: "center", alignItems: "center" },
|
|
2940
2817
|
uiBackground: { color: canScrollUp ? THEME.colors.buttonBackground : Color44.create(0.1, 0.1, 0.1, 0.3) },
|
|
2941
2818
|
onMouseDown: () => {
|
|
2942
2819
|
if (canScrollUp) this.chatScrollOffset += 1;
|
|
2943
2820
|
},
|
|
2944
2821
|
children: [
|
|
2945
|
-
|
|
2822
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
2946
2823
|
uiText: { value: "\u25B2", fontSize: 14, color: canScrollUp ? THEME.colors.cyan : THEME.colors.gray }
|
|
2947
2824
|
})
|
|
2948
2825
|
]
|
|
2949
2826
|
}),
|
|
2950
|
-
|
|
2827
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
2951
2828
|
uiTransform: { width: 26, height: 24, justifyContent: "center", alignItems: "center" },
|
|
2952
2829
|
children: [
|
|
2953
|
-
|
|
2830
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
2954
2831
|
uiText: {
|
|
2955
2832
|
value: totalMessages > UI_DIMENSIONS.chat.messagesPerPage ? `${this.chatScrollOffset}` : "-",
|
|
2956
2833
|
fontSize: 10,
|
|
@@ -2959,14 +2836,14 @@ var ChatUIModule = class {
|
|
|
2959
2836
|
})
|
|
2960
2837
|
]
|
|
2961
2838
|
}),
|
|
2962
|
-
|
|
2839
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
2963
2840
|
uiTransform: { width: 26, height: 36, justifyContent: "center", alignItems: "center" },
|
|
2964
2841
|
uiBackground: { color: canScrollDown ? THEME.colors.buttonBackground : Color44.create(0.1, 0.1, 0.1, 0.3) },
|
|
2965
2842
|
onMouseDown: () => {
|
|
2966
2843
|
if (canScrollDown) this.chatScrollOffset -= 1;
|
|
2967
2844
|
},
|
|
2968
2845
|
children: [
|
|
2969
|
-
|
|
2846
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
2970
2847
|
uiText: { value: "\u25BC", fontSize: 14, color: canScrollDown ? THEME.colors.cyan : THEME.colors.gray }
|
|
2971
2848
|
})
|
|
2972
2849
|
]
|
|
@@ -2977,7 +2854,7 @@ var ChatUIModule = class {
|
|
|
2977
2854
|
});
|
|
2978
2855
|
}
|
|
2979
2856
|
renderSystemMessage(msg, theme) {
|
|
2980
|
-
return
|
|
2857
|
+
return ReactEcs3.createElement(UiEntity3, {
|
|
2981
2858
|
key: msg.id,
|
|
2982
2859
|
uiTransform: { width: "100%", height: 24, marginBottom: 4, flexShrink: 0 },
|
|
2983
2860
|
uiText: {
|
|
@@ -2997,12 +2874,12 @@ var ChatUIModule = class {
|
|
|
2997
2874
|
if (displayName.toLowerCase().includes("admin")) accentColor = THEME.colors.magenta;
|
|
2998
2875
|
else if (isCurrentUser) accentColor = THEME.colors.green;
|
|
2999
2876
|
const textRoom = this.messageTextRoom(msg.text, theme.chatMessage);
|
|
3000
|
-
return
|
|
2877
|
+
return ReactEcs3.createElement(UiEntity3, {
|
|
3001
2878
|
key: msg.id,
|
|
3002
2879
|
uiTransform: { width: "100%", flexDirection: "column", marginBottom: 16, flexShrink: 0 },
|
|
3003
2880
|
children: [
|
|
3004
2881
|
// Header row
|
|
3005
|
-
|
|
2882
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
3006
2883
|
uiTransform: {
|
|
3007
2884
|
width: "100%",
|
|
3008
2885
|
height: 24,
|
|
@@ -3012,23 +2889,23 @@ var ChatUIModule = class {
|
|
|
3012
2889
|
marginBottom: 4
|
|
3013
2890
|
},
|
|
3014
2891
|
children: [
|
|
3015
|
-
|
|
2892
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
3016
2893
|
uiText: { value: displayName, fontSize: theme.chatUsername, color: accentColor, textAlign: "middle-left" }
|
|
3017
2894
|
}),
|
|
3018
|
-
|
|
2895
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
3019
2896
|
uiText: { value: time, fontSize: theme.chatTimestamp, color: THEME.colors.gray, textAlign: "middle-right" }
|
|
3020
2897
|
})
|
|
3021
2898
|
]
|
|
3022
2899
|
}),
|
|
3023
2900
|
// Message content
|
|
3024
|
-
|
|
2901
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
3025
2902
|
uiTransform: { width: "100%", flexDirection: "row", alignItems: "stretch", paddingLeft: 8 },
|
|
3026
2903
|
children: [
|
|
3027
|
-
|
|
2904
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
3028
2905
|
uiTransform: { width: 3, minHeight: textRoom },
|
|
3029
2906
|
uiBackground: { color: accentColor }
|
|
3030
2907
|
}),
|
|
3031
|
-
|
|
2908
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
3032
2909
|
uiTransform: { flexGrow: 1, minHeight: textRoom, paddingLeft: 12, paddingTop: 4, paddingBottom: 4 },
|
|
3033
2910
|
uiText: {
|
|
3034
2911
|
value: msg.text,
|
|
@@ -3044,7 +2921,7 @@ var ChatUIModule = class {
|
|
|
3044
2921
|
});
|
|
3045
2922
|
}
|
|
3046
2923
|
renderUserInfoBar(theme) {
|
|
3047
|
-
return
|
|
2924
|
+
return ReactEcs3.createElement(UiEntity3, {
|
|
3048
2925
|
uiTransform: {
|
|
3049
2926
|
width: "100%",
|
|
3050
2927
|
height: 34,
|
|
@@ -3056,12 +2933,12 @@ var ChatUIModule = class {
|
|
|
3056
2933
|
},
|
|
3057
2934
|
uiBackground: { color: Color44.create(0.03, 0.03, 0.05, 1) },
|
|
3058
2935
|
children: [
|
|
3059
|
-
|
|
2936
|
+
ReactEcs3.createElement(Label3, {
|
|
3060
2937
|
value: `// ${this.currentUsername || "Guest"}`,
|
|
3061
2938
|
fontSize: theme.userInfo,
|
|
3062
2939
|
color: THEME.colors.yellow
|
|
3063
2940
|
}),
|
|
3064
|
-
|
|
2941
|
+
ReactEcs3.createElement(Label3, {
|
|
3065
2942
|
value: this.isRegisteredUser ? "\u25CF CITIZEN" : "\u25CB GUEST",
|
|
3066
2943
|
fontSize: theme.authStatus,
|
|
3067
2944
|
color: this.isRegisteredUser ? THEME.colors.green : THEME.colors.gray
|
|
@@ -3072,7 +2949,7 @@ var ChatUIModule = class {
|
|
|
3072
2949
|
renderInputArea(theme) {
|
|
3073
2950
|
const baseUrl = this.getBaseUrl();
|
|
3074
2951
|
if (!this.isRegisteredUser) {
|
|
3075
|
-
return
|
|
2952
|
+
return ReactEcs3.createElement(UiEntity3, {
|
|
3076
2953
|
uiTransform: {
|
|
3077
2954
|
height: 75,
|
|
3078
2955
|
minHeight: 75,
|
|
@@ -3086,14 +2963,14 @@ var ChatUIModule = class {
|
|
|
3086
2963
|
},
|
|
3087
2964
|
uiBackground: { color: Color44.create(0.08, 0.08, 0.1, 1) },
|
|
3088
2965
|
children: [
|
|
3089
|
-
|
|
2966
|
+
ReactEcs3.createElement(Label3, {
|
|
3090
2967
|
value: "ACCESS RESTRICTED: CITIZENS ONLY",
|
|
3091
2968
|
fontSize: 12,
|
|
3092
2969
|
color: THEME.colors.red,
|
|
3093
2970
|
textAlign: "middle-center",
|
|
3094
2971
|
uiTransform: { marginBottom: 5 }
|
|
3095
2972
|
}),
|
|
3096
|
-
|
|
2973
|
+
ReactEcs3.createElement(Button2, {
|
|
3097
2974
|
value: "REGISTER IDENTITY",
|
|
3098
2975
|
fontSize: 14,
|
|
3099
2976
|
uiTransform: { width: 200, height: 30 },
|
|
@@ -3106,7 +2983,7 @@ var ChatUIModule = class {
|
|
|
3106
2983
|
]
|
|
3107
2984
|
});
|
|
3108
2985
|
}
|
|
3109
|
-
return
|
|
2986
|
+
return ReactEcs3.createElement(UiEntity3, {
|
|
3110
2987
|
uiTransform: {
|
|
3111
2988
|
height: 75,
|
|
3112
2989
|
minHeight: 75,
|
|
@@ -3118,7 +2995,7 @@ var ChatUIModule = class {
|
|
|
3118
2995
|
},
|
|
3119
2996
|
uiBackground: { color: Color44.create(0.08, 0.08, 0.1, 1) },
|
|
3120
2997
|
children: [
|
|
3121
|
-
|
|
2998
|
+
ReactEcs3.createElement(Input3, {
|
|
3122
2999
|
onChange: (v) => {
|
|
3123
3000
|
this.inputText = v;
|
|
3124
3001
|
},
|
|
@@ -3131,7 +3008,7 @@ var ChatUIModule = class {
|
|
|
3131
3008
|
uiBackground: { color: Color44.create(0.12, 0.12, 0.14, 1) },
|
|
3132
3009
|
uiTransform: { flexGrow: 1, height: "100%", margin: { right: 10 } }
|
|
3133
3010
|
}),
|
|
3134
|
-
|
|
3011
|
+
ReactEcs3.createElement(Button2, {
|
|
3135
3012
|
value: this.isSigningIn ? "..." : "SEND",
|
|
3136
3013
|
onMouseDown: () => this.handleSend(),
|
|
3137
3014
|
uiTransform: { width: 80, height: "100%" },
|
|
@@ -3148,7 +3025,7 @@ var ChatUIModule = class {
|
|
|
3148
3025
|
const endIdx = startIdx + UI_DIMENSIONS.chat.channelsPerPage;
|
|
3149
3026
|
const visibleChannels = this.channels.slice(startIdx, endIdx);
|
|
3150
3027
|
const totalPages = Math.ceil(this.channels.length / UI_DIMENSIONS.chat.channelsPerPage);
|
|
3151
|
-
return
|
|
3028
|
+
return ReactEcs3.createElement(UiEntity3, {
|
|
3152
3029
|
uiTransform: {
|
|
3153
3030
|
width: "100%",
|
|
3154
3031
|
height: 260,
|
|
@@ -3159,13 +3036,13 @@ var ChatUIModule = class {
|
|
|
3159
3036
|
uiBackground: { color: Color44.create(0.08, 0.1, 0.14, 1) },
|
|
3160
3037
|
children: [
|
|
3161
3038
|
// Top border
|
|
3162
|
-
|
|
3039
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
3163
3040
|
uiTransform: { width: "100%", height: 2, flexShrink: 0 },
|
|
3164
3041
|
uiBackground: { color: THEME.colors.cyan }
|
|
3165
3042
|
}),
|
|
3166
3043
|
// Channel list
|
|
3167
3044
|
...visibleChannels.map(
|
|
3168
|
-
(channel) =>
|
|
3045
|
+
(channel) => ReactEcs3.createElement(UiEntity3, {
|
|
3169
3046
|
key: channel.id,
|
|
3170
3047
|
uiTransform: {
|
|
3171
3048
|
height: 38,
|
|
@@ -3178,7 +3055,7 @@ var ChatUIModule = class {
|
|
|
3178
3055
|
},
|
|
3179
3056
|
onMouseDown: () => this.switchChannel(channel.id),
|
|
3180
3057
|
children: [
|
|
3181
|
-
|
|
3058
|
+
ReactEcs3.createElement(Label3, {
|
|
3182
3059
|
value: channel.id === this.currentChannelId ? `\u25B8 ${channel.name}` : channel.name,
|
|
3183
3060
|
fontSize: theme.channelDropdown,
|
|
3184
3061
|
color: channel.id === this.currentChannelId ? THEME.colors.cyan : THEME.colors.gray
|
|
@@ -3188,7 +3065,7 @@ var ChatUIModule = class {
|
|
|
3188
3065
|
),
|
|
3189
3066
|
// Pagination
|
|
3190
3067
|
...totalPages > 1 ? [
|
|
3191
|
-
|
|
3068
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
3192
3069
|
key: "pagination",
|
|
3193
3070
|
uiTransform: {
|
|
3194
3071
|
width: "100%",
|
|
@@ -3201,11 +3078,11 @@ var ChatUIModule = class {
|
|
|
3201
3078
|
},
|
|
3202
3079
|
children: [
|
|
3203
3080
|
...this.channelPage > 0 ? [
|
|
3204
|
-
|
|
3081
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
3205
3082
|
key: "prev",
|
|
3206
3083
|
onMouseDown: () => this.channelPage--,
|
|
3207
3084
|
children: [
|
|
3208
|
-
|
|
3085
|
+
ReactEcs3.createElement(Label3, {
|
|
3209
3086
|
value: "<< PREV",
|
|
3210
3087
|
fontSize: 10,
|
|
3211
3088
|
color: THEME.colors.cyan
|
|
@@ -3213,17 +3090,17 @@ var ChatUIModule = class {
|
|
|
3213
3090
|
]
|
|
3214
3091
|
})
|
|
3215
3092
|
] : [],
|
|
3216
|
-
|
|
3093
|
+
ReactEcs3.createElement(Label3, {
|
|
3217
3094
|
value: `${this.channelPage + 1}/${totalPages}`,
|
|
3218
3095
|
fontSize: 10,
|
|
3219
3096
|
color: THEME.colors.gray
|
|
3220
3097
|
}),
|
|
3221
3098
|
...this.channelPage < totalPages - 1 ? [
|
|
3222
|
-
|
|
3099
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
3223
3100
|
key: "next",
|
|
3224
3101
|
onMouseDown: () => this.channelPage++,
|
|
3225
3102
|
children: [
|
|
3226
|
-
|
|
3103
|
+
ReactEcs3.createElement(Label3, {
|
|
3227
3104
|
value: "NEXT >>",
|
|
3228
3105
|
fontSize: 10,
|
|
3229
3106
|
color: THEME.colors.cyan
|
|
@@ -3235,7 +3112,7 @@ var ChatUIModule = class {
|
|
|
3235
3112
|
})
|
|
3236
3113
|
] : [],
|
|
3237
3114
|
// Bottom border
|
|
3238
|
-
|
|
3115
|
+
ReactEcs3.createElement(UiEntity3, {
|
|
3239
3116
|
uiTransform: { width: "100%", height: 1, flexShrink: 0 },
|
|
3240
3117
|
uiBackground: { color: THEME.colors.panelBorder }
|
|
3241
3118
|
})
|
|
@@ -3243,50 +3120,25 @@ var ChatUIModule = class {
|
|
|
3243
3120
|
});
|
|
3244
3121
|
}
|
|
3245
3122
|
renderToggleButton() {
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
color: THEME.colors.white,
|
|
3254
|
-
textAlign: "middle-center"
|
|
3255
|
-
}
|
|
3256
|
-
});
|
|
3257
|
-
const press = () => this._isVisible ? this.hide() : this.show();
|
|
3258
|
-
if (this.client.isPhone) {
|
|
3259
|
-
return toolbarButton(0, {
|
|
3260
|
-
uiTransform: { justifyContent: "center", alignItems: "center" },
|
|
3261
|
-
uiBackground: { color: buttonColor },
|
|
3262
|
-
onMouseDown: press,
|
|
3263
|
-
children: [label]
|
|
3264
|
-
}, true, this.client.uiScale);
|
|
3265
|
-
}
|
|
3266
|
-
return ReactEcs4.createElement(UiEntity4, {
|
|
3267
|
-
uiTransform: {
|
|
3268
|
-
positionType: "absolute",
|
|
3269
|
-
position: { right: 20, bottom: 10 },
|
|
3270
|
-
width: this.s(100),
|
|
3271
|
-
height: this.s(45),
|
|
3272
|
-
justifyContent: "center",
|
|
3273
|
-
alignItems: "center"
|
|
3274
|
-
},
|
|
3275
|
-
uiBackground: { color: buttonColor },
|
|
3276
|
-
onMouseDown: press,
|
|
3277
|
-
children: [label]
|
|
3123
|
+
return this.client.toolbarButton(0, {
|
|
3124
|
+
uiBackground: { color: Color44.create(0.6, 0, 0.5, 0.9) },
|
|
3125
|
+
icon: "chat",
|
|
3126
|
+
tag: "CHAT",
|
|
3127
|
+
badge: this._unreadCount > 0 ? this._unreadCount : void 0,
|
|
3128
|
+
open: this._isVisible,
|
|
3129
|
+
onMouseDown: () => this._isVisible ? this.hide() : this.show()
|
|
3278
3130
|
});
|
|
3279
3131
|
}
|
|
3280
3132
|
};
|
|
3281
3133
|
|
|
3282
3134
|
// src/ui/admin-panel-ui.tsx
|
|
3283
|
-
import
|
|
3135
|
+
import ReactEcs6, { UiEntity as UiEntity6, Button as Button4, Label as Label6, Input as Input4 } from "@dcl/sdk/react-ecs";
|
|
3284
3136
|
import { Color4 as Color46 } from "@dcl/sdk/math";
|
|
3285
3137
|
import { getPlayer as getPlayer2 } from "@dcl/sdk/players";
|
|
3286
3138
|
import { openExternalUrl as openExternalUrl5 } from "~system/RestrictedActions";
|
|
3287
3139
|
|
|
3288
3140
|
// src/ui/ui-renderer.tsx
|
|
3289
|
-
import
|
|
3141
|
+
import ReactEcs4, { ReactEcsRenderer, UiEntity as UiEntity4, Label as Label4 } from "@dcl/sdk/react-ecs";
|
|
3290
3142
|
import { engine as engine3 } from "@dcl/sdk/ecs";
|
|
3291
3143
|
var notificationText = "";
|
|
3292
3144
|
var notificationVisible = false;
|
|
@@ -3319,8 +3171,8 @@ function NotificationBanner() {
|
|
|
3319
3171
|
if (!notificationVisible) return null;
|
|
3320
3172
|
return (
|
|
3321
3173
|
// Full-width container to center the notification
|
|
3322
|
-
/* @__PURE__ */
|
|
3323
|
-
|
|
3174
|
+
/* @__PURE__ */ ReactEcs4.createElement(
|
|
3175
|
+
UiEntity4,
|
|
3324
3176
|
{
|
|
3325
3177
|
uiTransform: {
|
|
3326
3178
|
positionType: "absolute",
|
|
@@ -3330,8 +3182,8 @@ function NotificationBanner() {
|
|
|
3330
3182
|
alignItems: "center"
|
|
3331
3183
|
}
|
|
3332
3184
|
},
|
|
3333
|
-
/* @__PURE__ */
|
|
3334
|
-
|
|
3185
|
+
/* @__PURE__ */ ReactEcs4.createElement(
|
|
3186
|
+
UiEntity4,
|
|
3335
3187
|
{
|
|
3336
3188
|
uiTransform: {
|
|
3337
3189
|
width: N.width,
|
|
@@ -3341,8 +3193,8 @@ function NotificationBanner() {
|
|
|
3341
3193
|
},
|
|
3342
3194
|
uiBackground: { color: C.panel }
|
|
3343
3195
|
},
|
|
3344
|
-
/* @__PURE__ */
|
|
3345
|
-
|
|
3196
|
+
/* @__PURE__ */ ReactEcs4.createElement(
|
|
3197
|
+
UiEntity4,
|
|
3346
3198
|
{
|
|
3347
3199
|
uiTransform: {
|
|
3348
3200
|
width: N.borderWidth,
|
|
@@ -3351,8 +3203,8 @@ function NotificationBanner() {
|
|
|
3351
3203
|
uiBackground: { color: C.cyan }
|
|
3352
3204
|
}
|
|
3353
3205
|
),
|
|
3354
|
-
/* @__PURE__ */
|
|
3355
|
-
|
|
3206
|
+
/* @__PURE__ */ ReactEcs4.createElement(
|
|
3207
|
+
UiEntity4,
|
|
3356
3208
|
{
|
|
3357
3209
|
uiTransform: {
|
|
3358
3210
|
flexGrow: 1,
|
|
@@ -3362,7 +3214,7 @@ function NotificationBanner() {
|
|
|
3362
3214
|
alignItems: "flex-start"
|
|
3363
3215
|
}
|
|
3364
3216
|
},
|
|
3365
|
-
/* @__PURE__ */
|
|
3217
|
+
/* @__PURE__ */ ReactEcs4.createElement(
|
|
3366
3218
|
Label4,
|
|
3367
3219
|
{
|
|
3368
3220
|
value: notificationText,
|
|
@@ -3372,8 +3224,8 @@ function NotificationBanner() {
|
|
|
3372
3224
|
}
|
|
3373
3225
|
)
|
|
3374
3226
|
),
|
|
3375
|
-
/* @__PURE__ */
|
|
3376
|
-
|
|
3227
|
+
/* @__PURE__ */ ReactEcs4.createElement(
|
|
3228
|
+
UiEntity4,
|
|
3377
3229
|
{
|
|
3378
3230
|
uiTransform: {
|
|
3379
3231
|
width: 5,
|
|
@@ -3395,8 +3247,8 @@ function createStaticUI(client) {
|
|
|
3395
3247
|
const guideComponent = client.guideUI?.getComponent() ?? null;
|
|
3396
3248
|
const chatComponent = client.chatUI?.getComponent() ?? null;
|
|
3397
3249
|
const adminComponent = client.adminPanel?.getComponent() ?? null;
|
|
3398
|
-
return /* @__PURE__ */
|
|
3399
|
-
|
|
3250
|
+
return /* @__PURE__ */ ReactEcs4.createElement(
|
|
3251
|
+
UiEntity4,
|
|
3400
3252
|
{
|
|
3401
3253
|
key: `static-ui-root-${currentScale}`,
|
|
3402
3254
|
uiTransform: {
|
|
@@ -3407,7 +3259,7 @@ function createStaticUI(client) {
|
|
|
3407
3259
|
alignItems: "center"
|
|
3408
3260
|
}
|
|
3409
3261
|
},
|
|
3410
|
-
blocked ? null : /* @__PURE__ */
|
|
3262
|
+
blocked ? null : /* @__PURE__ */ ReactEcs4.createElement(NotificationBanner, null),
|
|
3411
3263
|
guideComponent,
|
|
3412
3264
|
chatComponent,
|
|
3413
3265
|
adminComponent
|
|
@@ -3420,7 +3272,7 @@ function setupStaticUI(client) {
|
|
|
3420
3272
|
}
|
|
3421
3273
|
|
|
3422
3274
|
// src/ui/blocked-notice.tsx
|
|
3423
|
-
import
|
|
3275
|
+
import ReactEcs5, { UiEntity as UiEntity5, Label as Label5, Button as Button3 } from "@dcl/sdk/react-ecs";
|
|
3424
3276
|
import { Color4 as Color45 } from "@dcl/sdk/math";
|
|
3425
3277
|
import { openExternalUrl as openExternalUrl4 } from "~system/RestrictedActions";
|
|
3426
3278
|
var DEFAULT_SITE_URL = "https://thestatic.tv";
|
|
@@ -3447,8 +3299,8 @@ function BlockedNotice(props) {
|
|
|
3447
3299
|
const s = (v) => Math.round(v * props.scale);
|
|
3448
3300
|
const [title, ...body] = lines;
|
|
3449
3301
|
const action = blockedNoticeAction(props.standing, props.siteUrl || DEFAULT_SITE_URL);
|
|
3450
|
-
return /* @__PURE__ */
|
|
3451
|
-
|
|
3302
|
+
return /* @__PURE__ */ ReactEcs5.createElement(
|
|
3303
|
+
UiEntity5,
|
|
3452
3304
|
{
|
|
3453
3305
|
uiTransform: {
|
|
3454
3306
|
width: "100%",
|
|
@@ -3458,15 +3310,15 @@ function BlockedNotice(props) {
|
|
|
3458
3310
|
alignItems: "center"
|
|
3459
3311
|
}
|
|
3460
3312
|
},
|
|
3461
|
-
/* @__PURE__ */
|
|
3462
|
-
|
|
3313
|
+
/* @__PURE__ */ ReactEcs5.createElement(
|
|
3314
|
+
UiEntity5,
|
|
3463
3315
|
{
|
|
3464
3316
|
uiTransform: { width: s(460), flexDirection: "column", alignItems: "center", padding: s(20) },
|
|
3465
3317
|
uiBackground: { color: Color45.create(0.05, 0.05, 0.08, 0.95) }
|
|
3466
3318
|
},
|
|
3467
|
-
/* @__PURE__ */
|
|
3468
|
-
body.map((line, i) => /* @__PURE__ */
|
|
3469
|
-
action && /* @__PURE__ */
|
|
3319
|
+
/* @__PURE__ */ ReactEcs5.createElement(Label5, { value: title, fontSize: s(22), color: Color45.create(0.9, 0.2, 0.2, 1), uiTransform: { height: s(34) } }),
|
|
3320
|
+
body.map((line, i) => /* @__PURE__ */ ReactEcs5.createElement(Label5, { key: `blocked-line-${i}`, value: line, fontSize: s(16), color: Color45.White(), uiTransform: { height: s(26) } })),
|
|
3321
|
+
action && /* @__PURE__ */ ReactEcs5.createElement(
|
|
3470
3322
|
Button3,
|
|
3471
3323
|
{
|
|
3472
3324
|
uiTransform: { width: s(220), height: s(36), margin: { top: s(12) } },
|
|
@@ -3957,15 +3809,15 @@ var AdminPanelUIModule = class {
|
|
|
3957
3809
|
this.privateStatus = line;
|
|
3958
3810
|
} };
|
|
3959
3811
|
// --- UI Components ---
|
|
3960
|
-
this.SectionHead = ({ label, color }) => /* @__PURE__ */
|
|
3961
|
-
|
|
3812
|
+
this.SectionHead = ({ label, color }) => /* @__PURE__ */ ReactEcs6.createElement(
|
|
3813
|
+
UiEntity6,
|
|
3962
3814
|
{
|
|
3963
3815
|
uiTransform: { width: "100%", height: this.s(UI_DIMENSIONS.admin.sectionHeadHeight), margin: { bottom: 8 }, padding: { left: 10 }, alignItems: "center" },
|
|
3964
3816
|
uiBackground: { color: Color46.create(color.r * 0.3, color.g * 0.3, color.b * 0.3, 0.5) }
|
|
3965
3817
|
},
|
|
3966
|
-
/* @__PURE__ */
|
|
3818
|
+
/* @__PURE__ */ ReactEcs6.createElement(Label6, { value: label, fontSize: this.theme.sectionHead, color })
|
|
3967
3819
|
);
|
|
3968
|
-
this.TabBtn = ({ label, tab }) => /* @__PURE__ */
|
|
3820
|
+
this.TabBtn = ({ label, tab }) => /* @__PURE__ */ ReactEcs6.createElement(
|
|
3969
3821
|
Button4,
|
|
3970
3822
|
{
|
|
3971
3823
|
uiTransform: { flexGrow: 1, height: this.s(UI_DIMENSIONS.admin.tabHeight), justifyContent: "center", alignItems: "center" },
|
|
@@ -3984,7 +3836,7 @@ var AdminPanelUIModule = class {
|
|
|
3984
3836
|
*/
|
|
3985
3837
|
this.ControlsTab = () => {
|
|
3986
3838
|
const t = this.theme;
|
|
3987
|
-
return /* @__PURE__ */
|
|
3839
|
+
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
3840
|
Label6,
|
|
3989
3841
|
{
|
|
3990
3842
|
value: this.controlStatus,
|
|
@@ -3999,7 +3851,7 @@ var AdminPanelUIModule = class {
|
|
|
3999
3851
|
this.fetchStreamData();
|
|
4000
3852
|
}
|
|
4001
3853
|
const t = this.theme;
|
|
4002
|
-
return /* @__PURE__ */
|
|
3854
|
+
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
3855
|
Button4,
|
|
4004
3856
|
{
|
|
4005
3857
|
uiTransform: { width: this.s(200), height: this.s(UI_DIMENSIONS.admin.buttonHeight), margin: { bottom: 6 } },
|
|
@@ -4009,7 +3861,7 @@ var AdminPanelUIModule = class {
|
|
|
4009
3861
|
color: C2.text,
|
|
4010
3862
|
onMouseDown: () => this.claimTrial()
|
|
4011
3863
|
}
|
|
4012
|
-
), this.trialClaimError && /* @__PURE__ */
|
|
3864
|
+
), 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
3865
|
Button4,
|
|
4014
3866
|
{
|
|
4015
3867
|
uiTransform: { width: this.s(170), height: this.s(UI_DIMENSIONS.admin.buttonHeight), margin: { bottom: 6 } },
|
|
@@ -4019,14 +3871,14 @@ var AdminPanelUIModule = class {
|
|
|
4019
3871
|
color: C2.text,
|
|
4020
3872
|
onMouseDown: () => this.createChannel()
|
|
4021
3873
|
}
|
|
4022
|
-
), this.channelCreateError && /* @__PURE__ */
|
|
3874
|
+
), 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
3875
|
Label6,
|
|
4024
3876
|
{
|
|
4025
3877
|
value: this.streamData.isLive ? `LIVE \u2022 ${this.streamData.currentViewers || 0} viewers` : "OFFLINE",
|
|
4026
3878
|
fontSize: t.label,
|
|
4027
3879
|
color: this.streamData.isLive ? C2.red : C2.textDim
|
|
4028
3880
|
}
|
|
4029
|
-
), /* @__PURE__ */
|
|
3881
|
+
), /* @__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
3882
|
Label6,
|
|
4031
3883
|
{
|
|
4032
3884
|
value: `Channel: ${this.streamData.channelName || this.streamData.channelId}`,
|
|
@@ -4034,7 +3886,7 @@ var AdminPanelUIModule = class {
|
|
|
4034
3886
|
color: C2.textDim,
|
|
4035
3887
|
uiTransform: { margin: { bottom: 10 } }
|
|
4036
3888
|
}
|
|
4037
|
-
), /* @__PURE__ */
|
|
3889
|
+
), /* @__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
3890
|
Label6,
|
|
4039
3891
|
{
|
|
4040
3892
|
value: this.streamData.rtmpUrl || "Loading...",
|
|
@@ -4042,7 +3894,7 @@ var AdminPanelUIModule = class {
|
|
|
4042
3894
|
color: this.streamData.rtmpUrl ? C2.text : C2.textDim,
|
|
4043
3895
|
uiTransform: { margin: { left: 6 } }
|
|
4044
3896
|
}
|
|
4045
|
-
)), /* @__PURE__ */
|
|
3897
|
+
)), /* @__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
3898
|
Label6,
|
|
4047
3899
|
{
|
|
4048
3900
|
value: this.streamData.streamKey || "Loading...",
|
|
@@ -4050,7 +3902,7 @@ var AdminPanelUIModule = class {
|
|
|
4050
3902
|
color: this.streamData.streamKey ? C2.cyan : C2.textDim,
|
|
4051
3903
|
uiTransform: { margin: { left: 6 } }
|
|
4052
3904
|
}
|
|
4053
|
-
)), /* @__PURE__ */
|
|
3905
|
+
)), /* @__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
3906
|
Label6,
|
|
4055
3907
|
{
|
|
4056
3908
|
value: this.streamData.locked === true ? LOCKED_LINE : this.streamData.hlsUrl || "Not available",
|
|
@@ -4058,7 +3910,7 @@ var AdminPanelUIModule = class {
|
|
|
4058
3910
|
color: this.streamData.locked === true ? C2.yellow : this.streamData.hlsUrl ? C2.green : C2.textDim,
|
|
4059
3911
|
uiTransform: { margin: { left: 6 } }
|
|
4060
3912
|
}
|
|
4061
|
-
)), /* @__PURE__ */
|
|
3913
|
+
)), /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "row", flexWrap: "wrap", margin: { bottom: 6 } } }, !this.streamData.isLive && /* @__PURE__ */ ReactEcs6.createElement(
|
|
4062
3914
|
Button4,
|
|
4063
3915
|
{
|
|
4064
3916
|
uiTransform: { width: this.s(110), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4068,7 +3920,7 @@ var AdminPanelUIModule = class {
|
|
|
4068
3920
|
color: C2.text,
|
|
4069
3921
|
onMouseDown: () => this.startStream()
|
|
4070
3922
|
}
|
|
4071
|
-
), this.streamData.isLive && /* @__PURE__ */
|
|
3923
|
+
), this.streamData.isLive && /* @__PURE__ */ ReactEcs6.createElement(
|
|
4072
3924
|
Button4,
|
|
4073
3925
|
{
|
|
4074
3926
|
uiTransform: { width: this.s(110), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4078,7 +3930,7 @@ var AdminPanelUIModule = class {
|
|
|
4078
3930
|
color: C2.text,
|
|
4079
3931
|
onMouseDown: () => this.stopStream()
|
|
4080
3932
|
}
|
|
4081
|
-
), this.streamData.isLive && (this.streamData.hlsUrl || this.streamData.locked === true) && /* @__PURE__ */
|
|
3933
|
+
), this.streamData.isLive && (this.streamData.hlsUrl || this.streamData.locked === true) && /* @__PURE__ */ ReactEcs6.createElement(
|
|
4082
3934
|
Button4,
|
|
4083
3935
|
{
|
|
4084
3936
|
uiTransform: { width: this.s(100), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4088,7 +3940,7 @@ var AdminPanelUIModule = class {
|
|
|
4088
3940
|
color: C2.text,
|
|
4089
3941
|
onMouseDown: () => this.playStreamOnScreen()
|
|
4090
3942
|
}
|
|
4091
|
-
)), /* @__PURE__ */
|
|
3943
|
+
)), /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "row", flexWrap: "wrap", margin: { bottom: 6 } } }, /* @__PURE__ */ ReactEcs6.createElement(
|
|
4092
3944
|
Button4,
|
|
4093
3945
|
{
|
|
4094
3946
|
uiTransform: { width: this.s(80), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4098,7 +3950,7 @@ var AdminPanelUIModule = class {
|
|
|
4098
3950
|
color: C2.text,
|
|
4099
3951
|
onMouseDown: () => this.refreshStreamStatus()
|
|
4100
3952
|
}
|
|
4101
|
-
), /* @__PURE__ */
|
|
3953
|
+
), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4102
3954
|
Button4,
|
|
4103
3955
|
{
|
|
4104
3956
|
uiTransform: { width: this.s(95), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4108,7 +3960,7 @@ var AdminPanelUIModule = class {
|
|
|
4108
3960
|
color: C2.text,
|
|
4109
3961
|
onMouseDown: () => this.rotateStreamKey()
|
|
4110
3962
|
}
|
|
4111
|
-
), !this.streamData.isLive && !this.channelDeleteLook && /* @__PURE__ */
|
|
3963
|
+
), !this.streamData.isLive && !this.channelDeleteLook && /* @__PURE__ */ ReactEcs6.createElement(
|
|
4112
3964
|
Button4,
|
|
4113
3965
|
{
|
|
4114
3966
|
uiTransform: { width: this.s(70), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4118,7 +3970,7 @@ var AdminPanelUIModule = class {
|
|
|
4118
3970
|
color: C2.text,
|
|
4119
3971
|
onMouseDown: () => this.deleteChannel()
|
|
4120
3972
|
}
|
|
4121
|
-
)), !this.streamData.isLive && this.channelDeleteLook && /* @__PURE__ */
|
|
3973
|
+
)), !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
3974
|
Button4,
|
|
4123
3975
|
{
|
|
4124
3976
|
uiTransform: { width: this.s(120), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4128,7 +3980,7 @@ var AdminPanelUIModule = class {
|
|
|
4128
3980
|
color: C2.text,
|
|
4129
3981
|
onMouseDown: () => this.confirmDeleteChannel()
|
|
4130
3982
|
}
|
|
4131
|
-
), /* @__PURE__ */
|
|
3983
|
+
), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4132
3984
|
Button4,
|
|
4133
3985
|
{
|
|
4134
3986
|
uiTransform: { width: this.s(70), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4138,7 +3990,7 @@ var AdminPanelUIModule = class {
|
|
|
4138
3990
|
color: C2.text,
|
|
4139
3991
|
onMouseDown: () => this.cancelDeleteChannel()
|
|
4140
3992
|
}
|
|
4141
|
-
))), this.streamControlStatus === "started" && /* @__PURE__ */
|
|
3993
|
+
))), 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
3994
|
Input4,
|
|
4143
3995
|
{
|
|
4144
3996
|
uiTransform: { width: this.s(230), height: this.s(UI_DIMENSIONS.admin.inputHeight) },
|
|
@@ -4152,7 +4004,7 @@ var AdminPanelUIModule = class {
|
|
|
4152
4004
|
this.customVideoUrl = val;
|
|
4153
4005
|
}
|
|
4154
4006
|
}
|
|
4155
|
-
), /* @__PURE__ */
|
|
4007
|
+
), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4156
4008
|
Button4,
|
|
4157
4009
|
{
|
|
4158
4010
|
uiTransform: { width: this.s(75), height: this.s(UI_DIMENSIONS.admin.inputHeight), margin: { left: 8 } },
|
|
@@ -4162,7 +4014,7 @@ var AdminPanelUIModule = class {
|
|
|
4162
4014
|
color: C2.text,
|
|
4163
4015
|
onMouseDown: () => this.playNow()
|
|
4164
4016
|
}
|
|
4165
|
-
), /* @__PURE__ */
|
|
4017
|
+
), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4166
4018
|
Button4,
|
|
4167
4019
|
{
|
|
4168
4020
|
uiTransform: { width: this.s(65), height: this.s(UI_DIMENSIONS.admin.inputHeight), margin: { left: 6 } },
|
|
@@ -4174,7 +4026,7 @@ var AdminPanelUIModule = class {
|
|
|
4174
4026
|
this.customVideoUrl = "";
|
|
4175
4027
|
}
|
|
4176
4028
|
}
|
|
4177
|
-
)), this.videoStatus && /* @__PURE__ */
|
|
4029
|
+
)), this.videoStatus && /* @__PURE__ */ ReactEcs6.createElement(
|
|
4178
4030
|
Label6,
|
|
4179
4031
|
{
|
|
4180
4032
|
value: this.videoStatus,
|
|
@@ -4182,7 +4034,7 @@ var AdminPanelUIModule = class {
|
|
|
4182
4034
|
color: this.videoStatus.startsWith("Not sent") || this.videoStatus === LOCKED_LINE || this.videoStatus === UNAVAILABLE_LINE ? C2.red : C2.green,
|
|
4183
4035
|
uiTransform: { height: this.s(18), margin: { bottom: 6 } }
|
|
4184
4036
|
}
|
|
4185
|
-
), /* @__PURE__ */
|
|
4037
|
+
), /* @__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
4038
|
Button4,
|
|
4187
4039
|
{
|
|
4188
4040
|
uiTransform: { width: this.s(75), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4192,7 +4044,7 @@ var AdminPanelUIModule = class {
|
|
|
4192
4044
|
color: C2.text,
|
|
4193
4045
|
onMouseDown: () => this.playbackPlay()
|
|
4194
4046
|
}
|
|
4195
|
-
), /* @__PURE__ */
|
|
4047
|
+
), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4196
4048
|
Button4,
|
|
4197
4049
|
{
|
|
4198
4050
|
uiTransform: { width: this.s(75), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4202,7 +4054,7 @@ var AdminPanelUIModule = class {
|
|
|
4202
4054
|
color: C2.text,
|
|
4203
4055
|
onMouseDown: () => this.playbackStop()
|
|
4204
4056
|
}
|
|
4205
|
-
), /* @__PURE__ */
|
|
4057
|
+
), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4206
4058
|
Button4,
|
|
4207
4059
|
{
|
|
4208
4060
|
uiTransform: { width: this.s(100), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4212,7 +4064,7 @@ var AdminPanelUIModule = class {
|
|
|
4212
4064
|
color: C2.text,
|
|
4213
4065
|
onMouseDown: () => this.resetDefault()
|
|
4214
4066
|
}
|
|
4215
|
-
)), /* @__PURE__ */
|
|
4067
|
+
)), /* @__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
4068
|
Button4,
|
|
4217
4069
|
{
|
|
4218
4070
|
key: `play-${slot}`,
|
|
@@ -4223,7 +4075,7 @@ var AdminPanelUIModule = class {
|
|
|
4223
4075
|
color: C2.text,
|
|
4224
4076
|
onMouseDown: () => this.pressSlot(slot)
|
|
4225
4077
|
}
|
|
4226
|
-
))), /* @__PURE__ */
|
|
4078
|
+
))), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4227
4079
|
Button4,
|
|
4228
4080
|
{
|
|
4229
4081
|
uiTransform: { height: this.s(24) },
|
|
@@ -4237,7 +4089,7 @@ var AdminPanelUIModule = class {
|
|
|
4237
4089
|
};
|
|
4238
4090
|
this.ModTab = () => {
|
|
4239
4091
|
const t = this.theme;
|
|
4240
|
-
return /* @__PURE__ */
|
|
4092
|
+
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
4093
|
Label6,
|
|
4242
4094
|
{
|
|
4243
4095
|
value: this.kickStatus,
|
|
@@ -4245,7 +4097,7 @@ var AdminPanelUIModule = class {
|
|
|
4245
4097
|
color: this.kickStatus.startsWith("Kick not sent") ? C2.red : C2.green,
|
|
4246
4098
|
uiTransform: { height: this.s(18) }
|
|
4247
4099
|
}
|
|
4248
|
-
), /* @__PURE__ */
|
|
4100
|
+
), /* @__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
4101
|
Input4,
|
|
4250
4102
|
{
|
|
4251
4103
|
uiTransform: { width: this.s(230), height: this.s(UI_DIMENSIONS.admin.inputHeight) },
|
|
@@ -4259,7 +4111,7 @@ var AdminPanelUIModule = class {
|
|
|
4259
4111
|
this.broadcastText = val;
|
|
4260
4112
|
}
|
|
4261
4113
|
}
|
|
4262
|
-
), /* @__PURE__ */
|
|
4114
|
+
), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4263
4115
|
Button4,
|
|
4264
4116
|
{
|
|
4265
4117
|
uiTransform: { width: this.s(65), height: this.s(UI_DIMENSIONS.admin.inputHeight), margin: { left: 8 } },
|
|
@@ -4269,7 +4121,7 @@ var AdminPanelUIModule = class {
|
|
|
4269
4121
|
color: C2.text,
|
|
4270
4122
|
onMouseDown: () => this.sendBroadcast()
|
|
4271
4123
|
}
|
|
4272
|
-
)), this.broadcastStatus && /* @__PURE__ */
|
|
4124
|
+
)), this.broadcastStatus && /* @__PURE__ */ ReactEcs6.createElement(
|
|
4273
4125
|
Label6,
|
|
4274
4126
|
{
|
|
4275
4127
|
value: this.broadcastStatus,
|
|
@@ -4277,7 +4129,7 @@ var AdminPanelUIModule = class {
|
|
|
4277
4129
|
color: this.broadcastStatus.startsWith("Not sent") ? C2.red : C2.green,
|
|
4278
4130
|
uiTransform: { height: this.s(18), margin: { bottom: 6 } }
|
|
4279
4131
|
}
|
|
4280
|
-
), /* @__PURE__ */
|
|
4132
|
+
), /* @__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
4133
|
Button4,
|
|
4282
4134
|
{
|
|
4283
4135
|
uiTransform: { width: this.s(130), height: this.s(UI_DIMENSIONS.admin.buttonHeight), margin: 4 },
|
|
@@ -4287,7 +4139,7 @@ var AdminPanelUIModule = class {
|
|
|
4287
4139
|
color: C2.text,
|
|
4288
4140
|
onMouseDown: () => this.kickAll()
|
|
4289
4141
|
}
|
|
4290
|
-
)), this.venue && /* @__PURE__ */
|
|
4142
|
+
)), 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
4143
|
Button4,
|
|
4292
4144
|
{
|
|
4293
4145
|
key: `private-${on ? "on" : "off"}`,
|
|
@@ -4298,7 +4150,7 @@ var AdminPanelUIModule = class {
|
|
|
4298
4150
|
color: this.privateModeOn === on ? Color46.Black() : C2.text,
|
|
4299
4151
|
onMouseDown: () => this.setPrivateMode(on)
|
|
4300
4152
|
}
|
|
4301
|
-
))), this.privateStatus && /* @__PURE__ */
|
|
4153
|
+
))), this.privateStatus && /* @__PURE__ */ ReactEcs6.createElement(
|
|
4302
4154
|
Label6,
|
|
4303
4155
|
{
|
|
4304
4156
|
value: this.privateStatus,
|
|
@@ -4306,13 +4158,13 @@ var AdminPanelUIModule = class {
|
|
|
4306
4158
|
color: this.privateStatus.startsWith("Not sent") ? C2.red : C2.green,
|
|
4307
4159
|
uiTransform: { height: this.s(18) }
|
|
4308
4160
|
}
|
|
4309
|
-
)), /* @__PURE__ */
|
|
4310
|
-
|
|
4161
|
+
)), /* @__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(
|
|
4162
|
+
UiEntity6,
|
|
4311
4163
|
{
|
|
4312
4164
|
key: `admin-${i}`,
|
|
4313
4165
|
uiTransform: { flexDirection: "row", alignItems: "center", margin: { bottom: 5 }, width: "100%" }
|
|
4314
4166
|
},
|
|
4315
|
-
/* @__PURE__ */
|
|
4167
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
4316
4168
|
Label6,
|
|
4317
4169
|
{
|
|
4318
4170
|
value: `${wallet.slice(0, 6)}...${wallet.slice(-4)}`,
|
|
@@ -4321,7 +4173,7 @@ var AdminPanelUIModule = class {
|
|
|
4321
4173
|
uiTransform: { width: this.s(130) }
|
|
4322
4174
|
}
|
|
4323
4175
|
),
|
|
4324
|
-
/* @__PURE__ */
|
|
4176
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
4325
4177
|
Button4,
|
|
4326
4178
|
{
|
|
4327
4179
|
uiTransform: { width: this.s(70), height: this.s(28), margin: { left: 8 } },
|
|
@@ -4332,7 +4184,7 @@ var AdminPanelUIModule = class {
|
|
|
4332
4184
|
onMouseDown: () => this.removeSceneAdmin(wallet)
|
|
4333
4185
|
}
|
|
4334
4186
|
)
|
|
4335
|
-
))), /* @__PURE__ */
|
|
4187
|
+
))), /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "row", alignItems: "center", margin: { bottom: 14 } } }, /* @__PURE__ */ ReactEcs6.createElement(
|
|
4336
4188
|
Input4,
|
|
4337
4189
|
{
|
|
4338
4190
|
uiTransform: { width: this.s(230), height: this.s(UI_DIMENSIONS.admin.inputHeight) },
|
|
@@ -4346,7 +4198,7 @@ var AdminPanelUIModule = class {
|
|
|
4346
4198
|
this.newAdminWallet = val;
|
|
4347
4199
|
}
|
|
4348
4200
|
}
|
|
4349
|
-
), /* @__PURE__ */
|
|
4201
|
+
), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4350
4202
|
Button4,
|
|
4351
4203
|
{
|
|
4352
4204
|
uiTransform: { width: this.s(60), height: this.s(UI_DIMENSIONS.admin.inputHeight), margin: { left: 8 } },
|
|
@@ -4358,13 +4210,13 @@ var AdminPanelUIModule = class {
|
|
|
4358
4210
|
if (this.newAdminWallet) this.addSceneAdmin(this.newAdminWallet);
|
|
4359
4211
|
}
|
|
4360
4212
|
}
|
|
4361
|
-
)), /* @__PURE__ */
|
|
4362
|
-
|
|
4213
|
+
)), /* @__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(
|
|
4214
|
+
UiEntity6,
|
|
4363
4215
|
{
|
|
4364
4216
|
key: `ban-${i}`,
|
|
4365
4217
|
uiTransform: { flexDirection: "row", alignItems: "center", margin: { bottom: 5 }, width: "100%" }
|
|
4366
4218
|
},
|
|
4367
|
-
/* @__PURE__ */
|
|
4219
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
4368
4220
|
Label6,
|
|
4369
4221
|
{
|
|
4370
4222
|
value: `${wallet.slice(0, 6)}...${wallet.slice(-4)}`,
|
|
@@ -4373,7 +4225,7 @@ var AdminPanelUIModule = class {
|
|
|
4373
4225
|
uiTransform: { width: this.s(130) }
|
|
4374
4226
|
}
|
|
4375
4227
|
),
|
|
4376
|
-
/* @__PURE__ */
|
|
4228
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
4377
4229
|
Button4,
|
|
4378
4230
|
{
|
|
4379
4231
|
uiTransform: { width: this.s(70), height: this.s(28), margin: { left: 8 } },
|
|
@@ -4384,7 +4236,7 @@ var AdminPanelUIModule = class {
|
|
|
4384
4236
|
onMouseDown: () => this.unbanWallet(wallet)
|
|
4385
4237
|
}
|
|
4386
4238
|
)
|
|
4387
|
-
))), /* @__PURE__ */
|
|
4239
|
+
))), /* @__PURE__ */ ReactEcs6.createElement(UiEntity6, { uiTransform: { flexDirection: "row", alignItems: "center", margin: { bottom: 10 } } }, /* @__PURE__ */ ReactEcs6.createElement(
|
|
4388
4240
|
Input4,
|
|
4389
4241
|
{
|
|
4390
4242
|
uiTransform: { width: this.s(230), height: this.s(UI_DIMENSIONS.admin.inputHeight) },
|
|
@@ -4398,7 +4250,7 @@ var AdminPanelUIModule = class {
|
|
|
4398
4250
|
this.newBanWallet = val;
|
|
4399
4251
|
}
|
|
4400
4252
|
}
|
|
4401
|
-
), /* @__PURE__ */
|
|
4253
|
+
), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4402
4254
|
Button4,
|
|
4403
4255
|
{
|
|
4404
4256
|
uiTransform: { width: this.s(60), height: this.s(UI_DIMENSIONS.admin.inputHeight), margin: { left: 8 } },
|
|
@@ -4410,7 +4262,7 @@ var AdminPanelUIModule = class {
|
|
|
4410
4262
|
if (this.newBanWallet) this.banWallet(this.newBanWallet);
|
|
4411
4263
|
}
|
|
4412
4264
|
}
|
|
4413
|
-
)), /* @__PURE__ */
|
|
4265
|
+
)), /* @__PURE__ */ ReactEcs6.createElement(
|
|
4414
4266
|
Button4,
|
|
4415
4267
|
{
|
|
4416
4268
|
uiTransform: { height: this.s(24) },
|
|
@@ -4457,8 +4309,8 @@ var AdminPanelUIModule = class {
|
|
|
4457
4309
|
if (!tabs.find((tab) => tab.id === this.activeTab) && tabs.length > 0) {
|
|
4458
4310
|
this.activeTab = tabs[0].id;
|
|
4459
4311
|
}
|
|
4460
|
-
return /* @__PURE__ */
|
|
4461
|
-
|
|
4312
|
+
return /* @__PURE__ */ ReactEcs6.createElement(
|
|
4313
|
+
UiEntity6,
|
|
4462
4314
|
{
|
|
4463
4315
|
uiTransform: {
|
|
4464
4316
|
width: "100%",
|
|
@@ -4467,16 +4319,13 @@ var AdminPanelUIModule = class {
|
|
|
4467
4319
|
}
|
|
4468
4320
|
},
|
|
4469
4321
|
this.renderScaledNotification(),
|
|
4470
|
-
this.client.
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
},
|
|
4478
|
-
this.renderToggleFace()
|
|
4479
|
-
),
|
|
4322
|
+
this.client.toolbarButton(2, {
|
|
4323
|
+
uiBackground: { color: C2.header },
|
|
4324
|
+
icon: "admin",
|
|
4325
|
+
tag: "ADMIN",
|
|
4326
|
+
open: this.panelOpen,
|
|
4327
|
+
onMouseDown: () => this.toggle()
|
|
4328
|
+
}),
|
|
4480
4329
|
this.panelOpen && this.client.toolbarPanel({
|
|
4481
4330
|
key: `admin-panel-${this.client.uiScale}`,
|
|
4482
4331
|
uiTransform: {
|
|
@@ -4490,8 +4339,8 @@ var AdminPanelUIModule = class {
|
|
|
4490
4339
|
uiBackground: { color: C2.bg },
|
|
4491
4340
|
children: [
|
|
4492
4341
|
// Header with font controls
|
|
4493
|
-
/* @__PURE__ */
|
|
4494
|
-
|
|
4342
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
4343
|
+
UiEntity6,
|
|
4495
4344
|
{
|
|
4496
4345
|
uiTransform: {
|
|
4497
4346
|
width: "100%",
|
|
@@ -4503,8 +4352,8 @@ var AdminPanelUIModule = class {
|
|
|
4503
4352
|
},
|
|
4504
4353
|
uiBackground: { color: C2.header }
|
|
4505
4354
|
},
|
|
4506
|
-
/* @__PURE__ */
|
|
4507
|
-
/* @__PURE__ */
|
|
4355
|
+
/* @__PURE__ */ ReactEcs6.createElement(Label6, { value: this.config.title || "ADMIN PANEL", fontSize: t.header, color: C2.text }),
|
|
4356
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
4508
4357
|
Button4,
|
|
4509
4358
|
{
|
|
4510
4359
|
uiTransform: { width: this.s(28), height: this.s(28) },
|
|
@@ -4517,10 +4366,10 @@ var AdminPanelUIModule = class {
|
|
|
4517
4366
|
)
|
|
4518
4367
|
),
|
|
4519
4368
|
// Tabs
|
|
4520
|
-
/* @__PURE__ */
|
|
4369
|
+
/* @__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
4370
|
// Content
|
|
4522
|
-
/* @__PURE__ */
|
|
4523
|
-
|
|
4371
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
4372
|
+
UiEntity6,
|
|
4524
4373
|
{
|
|
4525
4374
|
uiTransform: {
|
|
4526
4375
|
width: "100%",
|
|
@@ -4529,14 +4378,14 @@ var AdminPanelUIModule = class {
|
|
|
4529
4378
|
flexDirection: "column"
|
|
4530
4379
|
}
|
|
4531
4380
|
},
|
|
4532
|
-
this.activeTab === "controls" && this.venue && this.controls.length > 0 && /* @__PURE__ */
|
|
4533
|
-
this.activeTab === "video" && /* @__PURE__ */
|
|
4534
|
-
this.activeTab === "mod" && this.isOwner && /* @__PURE__ */
|
|
4381
|
+
this.activeTab === "controls" && this.venue && this.controls.length > 0 && /* @__PURE__ */ ReactEcs6.createElement(this.ControlsTab, null),
|
|
4382
|
+
this.activeTab === "video" && /* @__PURE__ */ ReactEcs6.createElement(this.VideoTab, null),
|
|
4383
|
+
this.activeTab === "mod" && this.isOwner && /* @__PURE__ */ ReactEcs6.createElement(this.ModTab, null),
|
|
4535
4384
|
this.config.sceneTabs?.map((tab) => this.activeTab === tab.id && tab.render())
|
|
4536
4385
|
),
|
|
4537
4386
|
// Footer
|
|
4538
|
-
/* @__PURE__ */
|
|
4539
|
-
|
|
4387
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
4388
|
+
UiEntity6,
|
|
4540
4389
|
{
|
|
4541
4390
|
uiTransform: {
|
|
4542
4391
|
width: "100%",
|
|
@@ -4546,7 +4395,7 @@ var AdminPanelUIModule = class {
|
|
|
4546
4395
|
},
|
|
4547
4396
|
uiBackground: { color: C2.section }
|
|
4548
4397
|
},
|
|
4549
|
-
/* @__PURE__ */
|
|
4398
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
4550
4399
|
Button4,
|
|
4551
4400
|
{
|
|
4552
4401
|
uiTransform: { height: this.s(24) },
|
|
@@ -5715,7 +5564,7 @@ var AdminPanelUIModule = class {
|
|
|
5715
5564
|
/** A control's button (2026-11-18): the option's label, highlighted while that option is current on this copy */
|
|
5716
5565
|
controlButton(control, option, label) {
|
|
5717
5566
|
const current = this.currentOption[control.id] === option;
|
|
5718
|
-
return /* @__PURE__ */
|
|
5567
|
+
return /* @__PURE__ */ ReactEcs6.createElement(
|
|
5719
5568
|
Button4,
|
|
5720
5569
|
{
|
|
5721
5570
|
key: `control-${control.id}-${option}`,
|
|
@@ -5738,8 +5587,8 @@ var AdminPanelUIModule = class {
|
|
|
5738
5587
|
if (!state.visible) return null;
|
|
5739
5588
|
const N2 = UI_DIMENSIONS.notification;
|
|
5740
5589
|
const colors = THEME.colors;
|
|
5741
|
-
return /* @__PURE__ */
|
|
5742
|
-
|
|
5590
|
+
return /* @__PURE__ */ ReactEcs6.createElement(
|
|
5591
|
+
UiEntity6,
|
|
5743
5592
|
{
|
|
5744
5593
|
uiTransform: {
|
|
5745
5594
|
positionType: "absolute",
|
|
@@ -5749,8 +5598,8 @@ var AdminPanelUIModule = class {
|
|
|
5749
5598
|
alignItems: "center"
|
|
5750
5599
|
}
|
|
5751
5600
|
},
|
|
5752
|
-
/* @__PURE__ */
|
|
5753
|
-
|
|
5601
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
5602
|
+
UiEntity6,
|
|
5754
5603
|
{
|
|
5755
5604
|
uiTransform: {
|
|
5756
5605
|
minWidth: this.s(200),
|
|
@@ -5762,15 +5611,15 @@ var AdminPanelUIModule = class {
|
|
|
5762
5611
|
},
|
|
5763
5612
|
uiBackground: { color: colors.panel }
|
|
5764
5613
|
},
|
|
5765
|
-
/* @__PURE__ */
|
|
5766
|
-
|
|
5614
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
5615
|
+
UiEntity6,
|
|
5767
5616
|
{
|
|
5768
5617
|
uiTransform: { width: N2.borderWidth, height: "100%" },
|
|
5769
5618
|
uiBackground: { color: colors.cyan }
|
|
5770
5619
|
}
|
|
5771
5620
|
),
|
|
5772
|
-
/* @__PURE__ */
|
|
5773
|
-
|
|
5621
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
5622
|
+
UiEntity6,
|
|
5774
5623
|
{
|
|
5775
5624
|
uiTransform: {
|
|
5776
5625
|
flexGrow: 1,
|
|
@@ -5780,7 +5629,7 @@ var AdminPanelUIModule = class {
|
|
|
5780
5629
|
alignItems: "center"
|
|
5781
5630
|
}
|
|
5782
5631
|
},
|
|
5783
|
-
/* @__PURE__ */
|
|
5632
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
5784
5633
|
Label6,
|
|
5785
5634
|
{
|
|
5786
5635
|
value: state.text,
|
|
@@ -5790,8 +5639,8 @@ var AdminPanelUIModule = class {
|
|
|
5790
5639
|
}
|
|
5791
5640
|
)
|
|
5792
5641
|
),
|
|
5793
|
-
/* @__PURE__ */
|
|
5794
|
-
|
|
5642
|
+
/* @__PURE__ */ ReactEcs6.createElement(
|
|
5643
|
+
UiEntity6,
|
|
5795
5644
|
{
|
|
5796
5645
|
uiTransform: { width: 5, height: 5, margin: { right: 10 } },
|
|
5797
5646
|
uiBackground: { color: colors.cyan }
|
|
@@ -5800,29 +5649,313 @@ var AdminPanelUIModule = class {
|
|
|
5800
5649
|
)
|
|
5801
5650
|
);
|
|
5802
5651
|
}
|
|
5803
|
-
/** The ADMIN / CLOSE button itself; its place is the row's or, on a phone, the column's (2.12.0) */
|
|
5804
|
-
renderToggleFace() {
|
|
5805
|
-
return /* @__PURE__ */ ReactEcs7.createElement(
|
|
5806
|
-
Button4,
|
|
5807
|
-
{
|
|
5808
|
-
uiTransform: { width: this.s(100), height: this.s(45) },
|
|
5809
|
-
uiBackground: { color: this.panelOpen ? C2.btn : C2.header },
|
|
5810
|
-
value: this.panelOpen ? "CLOSE" : "ADMIN",
|
|
5811
|
-
fontSize: this.s(14),
|
|
5812
|
-
color: C2.text,
|
|
5813
|
-
onMouseDown: () => this.toggle()
|
|
5814
|
-
}
|
|
5815
|
-
);
|
|
5816
|
-
}
|
|
5817
5652
|
};
|
|
5818
5653
|
|
|
5819
5654
|
// src/StaticTVClient.ts
|
|
5820
5655
|
import { getExplorerInformation } from "~system/Runtime";
|
|
5821
5656
|
|
|
5657
|
+
// src/ui/toolbar.ts
|
|
5658
|
+
var CIRCLE = {
|
|
5659
|
+
phone: { diameter: 72, ring: 4, icon: 36, tagFont: 12, tag: 16, gap: 12, badge: 22 },
|
|
5660
|
+
desktop: { diameter: 52, ring: 3, icon: 26, tagFont: 11, tag: 14, gap: 12, badge: 18 }
|
|
5661
|
+
};
|
|
5662
|
+
var PHONE_EDGE = 0;
|
|
5663
|
+
var DESK_EDGE = 20;
|
|
5664
|
+
var DESK_BOTTOM = 10;
|
|
5665
|
+
var PANEL_GAP = 10;
|
|
5666
|
+
function platformOf(answer) {
|
|
5667
|
+
const raw = answer?.platform;
|
|
5668
|
+
if (typeof raw !== "string") return "unknown";
|
|
5669
|
+
const p = raw.trim().toLowerCase();
|
|
5670
|
+
return p === "desktop" || p === "mobile" || p === "vr" || p === "web" ? p : "unknown";
|
|
5671
|
+
}
|
|
5672
|
+
function isPhonePlatform(platform) {
|
|
5673
|
+
return platform === "mobile";
|
|
5674
|
+
}
|
|
5675
|
+
var scaled = (value, uiScale) => Math.round(value * uiScale);
|
|
5676
|
+
function circleSize(phone, uiScale = 1) {
|
|
5677
|
+
const c = phone ? CIRCLE.phone : CIRCLE.desktop;
|
|
5678
|
+
return {
|
|
5679
|
+
diameter: scaled(c.diameter, uiScale),
|
|
5680
|
+
ring: Math.max(1, scaled(c.ring, uiScale)),
|
|
5681
|
+
icon: scaled(c.icon, uiScale),
|
|
5682
|
+
tagFont: scaled(c.tagFont, uiScale),
|
|
5683
|
+
tag: scaled(c.tag, uiScale),
|
|
5684
|
+
gap: c.gap,
|
|
5685
|
+
badge: scaled(c.badge, uiScale)
|
|
5686
|
+
};
|
|
5687
|
+
}
|
|
5688
|
+
function rowRight(slot, uiScale = 1) {
|
|
5689
|
+
const c = circleSize(false, uiScale);
|
|
5690
|
+
return DESK_EDGE + slot * (c.diameter + c.gap);
|
|
5691
|
+
}
|
|
5692
|
+
function columnSlot(slot, lastSlot, uiScale = 1) {
|
|
5693
|
+
const c = circleSize(true, uiScale);
|
|
5694
|
+
const step = c.diameter + c.tag + c.gap;
|
|
5695
|
+
const rows = Math.max(lastSlot, slot, 0) + 2;
|
|
5696
|
+
return { right: PHONE_EDGE, width: c.diameter, boxHeight: rows * step - c.gap, above: (Math.max(0, slot) + 1) * step };
|
|
5697
|
+
}
|
|
5698
|
+
function handlePlace(phone, lastSlot, uiScale = 1) {
|
|
5699
|
+
const c = circleSize(phone, uiScale);
|
|
5700
|
+
if (phone) {
|
|
5701
|
+
return { right: PHONE_EDGE, width: c.diameter, height: c.diameter, boxHeight: columnSlot(0, lastSlot, uiScale).boxHeight, above: 0 };
|
|
5702
|
+
}
|
|
5703
|
+
return { right: rowRight(Math.max(0, lastSlot) + 1, uiScale), bottom: DESK_BOTTOM, width: c.diameter, height: c.diameter + c.tag };
|
|
5704
|
+
}
|
|
5705
|
+
function foldedPlace(phone, uiScale = 1) {
|
|
5706
|
+
const c = circleSize(phone, uiScale);
|
|
5707
|
+
if (phone) return { right: PHONE_EDGE, width: c.diameter, height: c.diameter };
|
|
5708
|
+
return { right: DESK_EDGE, bottom: DESK_BOTTOM, width: c.diameter, height: c.diameter + c.tag };
|
|
5709
|
+
}
|
|
5710
|
+
function chevronOf(phone, collapsed) {
|
|
5711
|
+
if (phone) return collapsed ? "chevron-left" : "chevron-right";
|
|
5712
|
+
return collapsed ? "chevron-up" : "chevron-down";
|
|
5713
|
+
}
|
|
5714
|
+
function deskPanelBottom(uiScale = 1) {
|
|
5715
|
+
const c = circleSize(false, uiScale);
|
|
5716
|
+
return DESK_BOTTOM + c.diameter + c.tag + PANEL_GAP;
|
|
5717
|
+
}
|
|
5718
|
+
function iconUrl(icon, baseUrl) {
|
|
5719
|
+
if (icon.includes("://")) return icon;
|
|
5720
|
+
const at = baseUrl.indexOf("/api/");
|
|
5721
|
+
const site = (at > 0 ? baseUrl.slice(0, at) : baseUrl).replace(/\/+$/, "");
|
|
5722
|
+
return `${site}/sdk/icons/${icon}.png`;
|
|
5723
|
+
}
|
|
5724
|
+
var ToolbarFold = class {
|
|
5725
|
+
constructor(closeAll) {
|
|
5726
|
+
this._collapsed = false;
|
|
5727
|
+
this._sceneLast = -1;
|
|
5728
|
+
this.closeAll = closeAll;
|
|
5729
|
+
}
|
|
5730
|
+
get collapsed() {
|
|
5731
|
+
return this._collapsed;
|
|
5732
|
+
}
|
|
5733
|
+
collapse() {
|
|
5734
|
+
if (this._collapsed) return;
|
|
5735
|
+
this.closeAll();
|
|
5736
|
+
this._collapsed = true;
|
|
5737
|
+
}
|
|
5738
|
+
expand() {
|
|
5739
|
+
this._collapsed = false;
|
|
5740
|
+
}
|
|
5741
|
+
/** A button was drawn in `slot` */
|
|
5742
|
+
seen(slot) {
|
|
5743
|
+
if (slot > this._sceneLast) this._sceneLast = slot;
|
|
5744
|
+
}
|
|
5745
|
+
/** 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 */
|
|
5746
|
+
lastSlot(sdkLast) {
|
|
5747
|
+
return Math.max(sdkLast, this._sceneLast);
|
|
5748
|
+
}
|
|
5749
|
+
};
|
|
5750
|
+
function panelRight(phone, desktopRight, uiScale = 1) {
|
|
5751
|
+
return phone ? PHONE_EDGE + circleSize(true, uiScale).diameter + PANEL_GAP : desktopRight;
|
|
5752
|
+
}
|
|
5753
|
+
var DESKTOP_CLOSES = { guide: ["admin"], admin: ["guide"] };
|
|
5754
|
+
var GUIDE_PLACE = ["guide", "admin"];
|
|
5755
|
+
function panelsToClose(opened, registered, phone, coversGuide = []) {
|
|
5756
|
+
if (phone) return registered.filter((name) => name !== opened);
|
|
5757
|
+
const closes = [...DESKTOP_CLOSES[opened] ?? []];
|
|
5758
|
+
if (GUIDE_PLACE.includes(opened)) closes.push(...coversGuide);
|
|
5759
|
+
if (coversGuide.includes(opened)) closes.push(...GUIDE_PLACE);
|
|
5760
|
+
return registered.filter((name) => name !== opened && closes.includes(name));
|
|
5761
|
+
}
|
|
5762
|
+
var PanelRules = class {
|
|
5763
|
+
constructor(phone) {
|
|
5764
|
+
this.hides = /* @__PURE__ */ new Map();
|
|
5765
|
+
this.coveringGuide = /* @__PURE__ */ new Set();
|
|
5766
|
+
this.phone = phone;
|
|
5767
|
+
}
|
|
5768
|
+
/** Register (or replace) a panel; its hide runs when another panel opens and the rule says so */
|
|
5769
|
+
register(name, hide, options = {}) {
|
|
5770
|
+
this.hides.set(name, hide);
|
|
5771
|
+
if (options.coversGuide === true) this.coveringGuide.add(name);
|
|
5772
|
+
else this.coveringGuide.delete(name);
|
|
5773
|
+
}
|
|
5774
|
+
/** Close every registered panel (2.14.0, the toolbar collapsing). One failing hide does not stop the rest. */
|
|
5775
|
+
closeAll() {
|
|
5776
|
+
for (const hide of this.hides.values()) {
|
|
5777
|
+
try {
|
|
5778
|
+
hide();
|
|
5779
|
+
} catch {
|
|
5780
|
+
}
|
|
5781
|
+
}
|
|
5782
|
+
}
|
|
5783
|
+
/** A panel opened: close the ones the rule names. One failing hide does not stop the rest. */
|
|
5784
|
+
opened(name) {
|
|
5785
|
+
for (const other of panelsToClose(name, [...this.hides.keys()], this.phone(), [...this.coveringGuide])) {
|
|
5786
|
+
try {
|
|
5787
|
+
this.hides.get(other)?.();
|
|
5788
|
+
} catch {
|
|
5789
|
+
}
|
|
5790
|
+
}
|
|
5791
|
+
}
|
|
5792
|
+
get names() {
|
|
5793
|
+
return [...this.hides.keys()];
|
|
5794
|
+
}
|
|
5795
|
+
};
|
|
5796
|
+
|
|
5797
|
+
// src/ui/toolbar-button.ts
|
|
5798
|
+
import ReactEcs7, { UiEntity as UiEntity7 } from "@dcl/sdk/react-ecs";
|
|
5799
|
+
import { Color4 as Color47 } from "@dcl/sdk/math";
|
|
5800
|
+
var GLASS = Color47.create(18 / 255, 20 / 255, 34 / 255, 0.55);
|
|
5801
|
+
var FOLD_RING = Color47.create(1, 1, 1, 0.45);
|
|
5802
|
+
var BADGE = Color47.create(0.86, 0.15, 0.2, 1);
|
|
5803
|
+
var WHITE = Color47.create(1, 1, 1, 1);
|
|
5804
|
+
function circleUnit(phone, uiScale, spec, place) {
|
|
5805
|
+
const c = circleSize(phone, uiScale);
|
|
5806
|
+
const inner = [];
|
|
5807
|
+
if (spec.icon) {
|
|
5808
|
+
inner.push(ReactEcs7.createElement(UiEntity7, {
|
|
5809
|
+
uiTransform: { width: c.icon, height: c.icon },
|
|
5810
|
+
uiBackground: { texture: { src: spec.icon, filterMode: "bi-linear" }, textureMode: "stretch" }
|
|
5811
|
+
}));
|
|
5812
|
+
} else if (spec.content) {
|
|
5813
|
+
inner.push(...spec.content);
|
|
5814
|
+
}
|
|
5815
|
+
const badgeText = spec.badge === void 0 || spec.badge === null || spec.badge === 0 || spec.badge === "" ? null : String(spec.badge);
|
|
5816
|
+
if (badgeText) {
|
|
5817
|
+
inner.push(ReactEcs7.createElement(UiEntity7, {
|
|
5818
|
+
uiTransform: {
|
|
5819
|
+
positionType: "absolute",
|
|
5820
|
+
position: { top: 0, right: 0 },
|
|
5821
|
+
width: c.badge,
|
|
5822
|
+
height: c.badge,
|
|
5823
|
+
borderRadius: c.badge / 2,
|
|
5824
|
+
justifyContent: "center",
|
|
5825
|
+
alignItems: "center"
|
|
5826
|
+
},
|
|
5827
|
+
uiBackground: { color: BADGE },
|
|
5828
|
+
uiText: { value: badgeText, fontSize: Math.round(c.badge * 0.6), color: WHITE, textAlign: "middle-center" }
|
|
5829
|
+
}));
|
|
5830
|
+
}
|
|
5831
|
+
const circle = ReactEcs7.createElement(UiEntity7, {
|
|
5832
|
+
uiTransform: {
|
|
5833
|
+
width: c.diameter,
|
|
5834
|
+
height: c.diameter,
|
|
5835
|
+
flexShrink: 0,
|
|
5836
|
+
borderRadius: c.diameter / 2,
|
|
5837
|
+
borderWidth: c.ring,
|
|
5838
|
+
borderColor: spec.ring,
|
|
5839
|
+
justifyContent: "center",
|
|
5840
|
+
alignItems: "center",
|
|
5841
|
+
...spec.contentLayout || {}
|
|
5842
|
+
},
|
|
5843
|
+
uiBackground: { color: spec.fill },
|
|
5844
|
+
children: inner
|
|
5845
|
+
});
|
|
5846
|
+
const children = [circle];
|
|
5847
|
+
if (spec.tagRow) {
|
|
5848
|
+
children.push(ReactEcs7.createElement(UiEntity7, {
|
|
5849
|
+
uiTransform: { width: c.diameter, height: c.tag, flexShrink: 0 },
|
|
5850
|
+
uiText: spec.tag ? { value: spec.tag, fontSize: c.tagFont, color: spec.tagColor ?? WHITE, textAlign: "middle-center" } : void 0
|
|
5851
|
+
}));
|
|
5852
|
+
}
|
|
5853
|
+
return ReactEcs7.createElement(UiEntity7, {
|
|
5854
|
+
uiTransform: {
|
|
5855
|
+
...place,
|
|
5856
|
+
width: c.diameter,
|
|
5857
|
+
height: c.diameter + (spec.tagRow ? c.tag : 0),
|
|
5858
|
+
flexDirection: "column",
|
|
5859
|
+
alignItems: "center",
|
|
5860
|
+
flexShrink: 0
|
|
5861
|
+
},
|
|
5862
|
+
onMouseDown: spec.onMouseDown,
|
|
5863
|
+
children
|
|
5864
|
+
});
|
|
5865
|
+
}
|
|
5866
|
+
function inColumn(width, boxHeight, above, right, entity) {
|
|
5867
|
+
return ReactEcs7.createElement(UiEntity7, {
|
|
5868
|
+
uiTransform: {
|
|
5869
|
+
positionType: "absolute",
|
|
5870
|
+
position: { right, top: 0 },
|
|
5871
|
+
width,
|
|
5872
|
+
height: "100%",
|
|
5873
|
+
flexDirection: "column",
|
|
5874
|
+
justifyContent: "center"
|
|
5875
|
+
},
|
|
5876
|
+
children: [
|
|
5877
|
+
ReactEcs7.createElement(UiEntity7, {
|
|
5878
|
+
uiTransform: { width, height: boxHeight, flexDirection: "column", flexShrink: 0 },
|
|
5879
|
+
children: [
|
|
5880
|
+
ReactEcs7.createElement(UiEntity7, { uiTransform: { width, height: above, flexShrink: 0 } }),
|
|
5881
|
+
entity
|
|
5882
|
+
]
|
|
5883
|
+
})
|
|
5884
|
+
]
|
|
5885
|
+
});
|
|
5886
|
+
}
|
|
5887
|
+
function ringOf(props) {
|
|
5888
|
+
return props.uiBackground?.color ?? WHITE;
|
|
5889
|
+
}
|
|
5890
|
+
function toolbarButton(slot, props, phone, uiScale = 1, fold = { collapsed: false, expand: () => {
|
|
5891
|
+
}, lastSlot: slot }, baseUrl = "https://thestatic.tv/api/v1/dcl") {
|
|
5892
|
+
if (fold.collapsed) return null;
|
|
5893
|
+
const ring = ringOf(props);
|
|
5894
|
+
const r = ring;
|
|
5895
|
+
const spec = {
|
|
5896
|
+
ring,
|
|
5897
|
+
fill: props.open === true && typeof r.r === "number" ? Color47.create(r.r, r.g ?? 0, r.b ?? 0, 0.55) : GLASS,
|
|
5898
|
+
icon: props.icon ? iconUrl(props.icon, baseUrl) : void 0,
|
|
5899
|
+
content: props.icon ? void 0 : props.children,
|
|
5900
|
+
contentLayout: props.icon ? void 0 : props.uiTransform,
|
|
5901
|
+
tag: props.tag,
|
|
5902
|
+
tagColor: props.tagColor,
|
|
5903
|
+
badge: props.badge,
|
|
5904
|
+
tagRow: true,
|
|
5905
|
+
onMouseDown: props.onMouseDown
|
|
5906
|
+
};
|
|
5907
|
+
if (!phone) {
|
|
5908
|
+
return circleUnit(false, uiScale, spec, { positionType: "absolute", position: { right: rowRight(slot, uiScale), bottom: DESK_BOTTOM } });
|
|
5909
|
+
}
|
|
5910
|
+
const place = columnSlot(slot, fold.lastSlot, uiScale);
|
|
5911
|
+
return inColumn(place.width, place.boxHeight, place.above, place.right, circleUnit(true, uiScale, spec, {}));
|
|
5912
|
+
}
|
|
5913
|
+
function toolbarHandle(phone, lastSlot, collapsed, toggle, uiScale = 1, baseUrl = "https://thestatic.tv/api/v1/dcl") {
|
|
5914
|
+
const spec = {
|
|
5915
|
+
ring: FOLD_RING,
|
|
5916
|
+
fill: GLASS,
|
|
5917
|
+
icon: iconUrl(chevronOf(phone, collapsed), baseUrl),
|
|
5918
|
+
tagRow: !phone,
|
|
5919
|
+
onMouseDown: toggle
|
|
5920
|
+
};
|
|
5921
|
+
if (collapsed) {
|
|
5922
|
+
const place2 = foldedPlace(phone, uiScale);
|
|
5923
|
+
if (!phone) {
|
|
5924
|
+
return circleUnit(false, uiScale, spec, { positionType: "absolute", position: { right: place2.right, bottom: place2.bottom } });
|
|
5925
|
+
}
|
|
5926
|
+
return ReactEcs7.createElement(UiEntity7, {
|
|
5927
|
+
uiTransform: {
|
|
5928
|
+
positionType: "absolute",
|
|
5929
|
+
position: { right: place2.right, top: 0 },
|
|
5930
|
+
width: place2.width,
|
|
5931
|
+
height: "100%",
|
|
5932
|
+
flexDirection: "column",
|
|
5933
|
+
justifyContent: "center"
|
|
5934
|
+
},
|
|
5935
|
+
children: [circleUnit(true, uiScale, spec, {})]
|
|
5936
|
+
});
|
|
5937
|
+
}
|
|
5938
|
+
const place = handlePlace(phone, lastSlot, uiScale);
|
|
5939
|
+
if (!phone) {
|
|
5940
|
+
return circleUnit(false, uiScale, spec, { positionType: "absolute", position: { right: place.right, bottom: place.bottom } });
|
|
5941
|
+
}
|
|
5942
|
+
return inColumn(place.width, place.boxHeight, place.above, place.right, circleUnit(true, uiScale, spec, {}));
|
|
5943
|
+
}
|
|
5944
|
+
|
|
5822
5945
|
// src/ui/toolbar-panel.ts
|
|
5823
5946
|
import ReactEcs8, { UiEntity as UiEntity8 } from "@dcl/sdk/react-ecs";
|
|
5824
5947
|
function toolbarPanel(props, phone, uiScale = 1) {
|
|
5825
|
-
if (!phone)
|
|
5948
|
+
if (!phone) {
|
|
5949
|
+
const position = props.uiTransform?.position ?? {};
|
|
5950
|
+
const floor = deskPanelBottom(uiScale);
|
|
5951
|
+
if (typeof position.bottom === "number" && position.bottom < floor) {
|
|
5952
|
+
return ReactEcs8.createElement(UiEntity8, {
|
|
5953
|
+
...props,
|
|
5954
|
+
uiTransform: { ...props.uiTransform, position: { ...position, bottom: floor } }
|
|
5955
|
+
});
|
|
5956
|
+
}
|
|
5957
|
+
return ReactEcs8.createElement(UiEntity8, props);
|
|
5958
|
+
}
|
|
5826
5959
|
const { key, uiTransform = {}, ...rest } = props;
|
|
5827
5960
|
const { position: _position, positionType: _positionType, ...ownLayout } = uiTransform;
|
|
5828
5961
|
const spacer = () => ReactEcs8.createElement(UiEntity8, { uiTransform: { height: 0, flexGrow: 1 } });
|
|
@@ -5916,6 +6049,8 @@ var _StaticTVClient = class _StaticTVClient {
|
|
|
5916
6049
|
* scene's (registerPanel); elsewhere the guide and the admin panel close each other, as before.
|
|
5917
6050
|
*/
|
|
5918
6051
|
this.panelRules = new PanelRules(() => this.isPhone);
|
|
6052
|
+
/** The toolbar collapsed to strips or not, for the visit (2.14.0): collapsing closes every panel first */
|
|
6053
|
+
this.fold = new ToolbarFold(() => this.panelRules.closeAll());
|
|
5919
6054
|
// =============================================================================
|
|
5920
6055
|
// --- VIDEO PLAYBACK (Internal handler for videoScreen) ---
|
|
5921
6056
|
// =============================================================================
|
|
@@ -6848,21 +6983,53 @@ var _StaticTVClient = class _StaticTVClient {
|
|
|
6848
6983
|
* Draw one of the scene's own toolbar buttons in its slot: the row along the bottom right on desktop (where a scene
|
|
6849
6984
|
* placed its own by hand before), the column on a phone. Slots count from the right (the row) or the top (the
|
|
6850
6985
|
* 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
|
-
* scene's. `props` is the button's face
|
|
6852
|
-
*
|
|
6986
|
+
* scene's. `props` is the button's face. Since 2.15.0 every button is a circle: its uiBackground color is the ring,
|
|
6987
|
+
* `icon` the white icon in the middle (a name on the SDK's icon host - chat, guide, sparkle, radio, admin - or a full
|
|
6988
|
+
* https URL), `tag` the short name under it, `tagColor`, `badge` (a small count) and `open` (its panel is open) are
|
|
6989
|
+
* optional; a face with no icon shows its children inside the circle. Folded (2.14.0), the buttons draw nothing:
|
|
6990
|
+
* the toolbar is one circle (toolbarHandle).
|
|
6853
6991
|
*
|
|
6854
6992
|
* @example
|
|
6855
6993
|
* ```typescript
|
|
6856
6994
|
* staticTV.toolbarButton(3, {
|
|
6857
|
-
* uiTransform: { justifyContent: 'center', alignItems: 'center' },
|
|
6858
6995
|
* uiBackground: { color: Color4.create(0.2, 0.4, 0.2, 0.9) },
|
|
6996
|
+
* icon: 'radio',
|
|
6997
|
+
* tag: 'MAP',
|
|
6998
|
+
* open: myPanel.isOpen,
|
|
6859
6999
|
* onMouseDown: () => myPanel.toggle(),
|
|
6860
|
-
* children: [ReactEcs.createElement(UiEntity, { uiText: { value: 'MAP', fontSize: 14 } })],
|
|
6861
7000
|
* })
|
|
6862
7001
|
* ```
|
|
6863
7002
|
*/
|
|
6864
7003
|
toolbarButton(slot, props) {
|
|
6865
|
-
|
|
7004
|
+
this.fold.seen(slot);
|
|
7005
|
+
return toolbarButton(slot, props, this.isPhone, this.uiScale, {
|
|
7006
|
+
collapsed: this.fold.collapsed,
|
|
7007
|
+
expand: () => this.fold.expand(),
|
|
7008
|
+
lastSlot: this.toolbarLastSlot()
|
|
7009
|
+
}, this.baseUrl);
|
|
7010
|
+
}
|
|
7011
|
+
/** The toolbar's last slot: ADMIN's (2) when it is drawn, else GUIDE's (1), or a scene button's past them */
|
|
7012
|
+
toolbarLastSlot() {
|
|
7013
|
+
return this.fold.lastSlot(this.adminPanel?.hasAccess === true ? 2 : 1);
|
|
7014
|
+
}
|
|
7015
|
+
/**
|
|
7016
|
+
* The toolbar folded (2.14.0, his ask: "small tabs out of users way"; one circle since 2.15.0): the fold circle
|
|
7017
|
+
* folds it and closes every open panel, the scene's registered ones too; the one folded circle opens it. For the
|
|
7018
|
+
* visit only; it starts open. A scene drawing its buttons through toolbarButton needs nothing more.
|
|
7019
|
+
*/
|
|
7020
|
+
get toolbarCollapsed() {
|
|
7021
|
+
return this.fold.collapsed;
|
|
7022
|
+
}
|
|
7023
|
+
/**
|
|
7024
|
+
* The fold circle, drawn by the SDK's chat (2.15.0): open, on top of a phone's column (chevron right) or past the
|
|
7025
|
+
* desktop row's last button (chevron down); folded, the toolbar's one circle, on a phone's edge at mid-height
|
|
7026
|
+
* (chevron left) or in the desktop's bottom-right corner (chevron up). A press folds or opens.
|
|
7027
|
+
* @internal
|
|
7028
|
+
*/
|
|
7029
|
+
toolbarHandle() {
|
|
7030
|
+
const collapsed = this.fold.collapsed;
|
|
7031
|
+
const toggle = () => collapsed ? this.fold.expand() : this.fold.collapse();
|
|
7032
|
+
return toolbarHandle(this.isPhone, this.toolbarLastSlot(), collapsed, toggle, this.uiScale, this.baseUrl);
|
|
6866
7033
|
}
|
|
6867
7034
|
/** Where a scene's own panel's right edge goes: on a phone one gap left of the column; elsewhere `desktopRight` */
|
|
6868
7035
|
panelRight(desktopRight) {
|