@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.js
CHANGED
|
@@ -1323,7 +1323,7 @@ async function signedRequest(url, init = {}) {
|
|
|
1323
1323
|
}
|
|
1324
1324
|
|
|
1325
1325
|
// src/ui/guide-ui.tsx
|
|
1326
|
-
var
|
|
1326
|
+
var import_react_ecs2 = __toESM(require("@dcl/sdk/react-ecs"));
|
|
1327
1327
|
var import_math3 = require("@dcl/sdk/math");
|
|
1328
1328
|
var import_RestrictedActions2 = require("~system/RestrictedActions");
|
|
1329
1329
|
|
|
@@ -1566,112 +1566,8 @@ function truncateText(text, maxLength) {
|
|
|
1566
1566
|
return text.substring(0, maxLength - 3) + "...";
|
|
1567
1567
|
}
|
|
1568
1568
|
|
|
1569
|
-
// src/
|
|
1570
|
-
var
|
|
1571
|
-
|
|
1572
|
-
// src/ui/toolbar.ts
|
|
1573
|
-
var TOOLBAR = { edge: 20, gap: 10, buttonWidth: 100, buttonHeight: 45, bottom: 10 };
|
|
1574
|
-
var COLUMN_SLOTS = 5;
|
|
1575
|
-
var PHONE_EDGE = 0;
|
|
1576
|
-
function platformOf(answer) {
|
|
1577
|
-
const raw = answer?.platform;
|
|
1578
|
-
if (typeof raw !== "string") return "unknown";
|
|
1579
|
-
const p = raw.trim().toLowerCase();
|
|
1580
|
-
return p === "desktop" || p === "mobile" || p === "vr" || p === "web" ? p : "unknown";
|
|
1581
|
-
}
|
|
1582
|
-
function isPhonePlatform(platform) {
|
|
1583
|
-
return platform === "mobile";
|
|
1584
|
-
}
|
|
1585
|
-
var scaled = (value, uiScale) => Math.round(value * uiScale);
|
|
1586
|
-
function rowRight(slot, uiScale = 1) {
|
|
1587
|
-
return TOOLBAR.edge + slot * (scaled(TOOLBAR.buttonWidth, uiScale) + TOOLBAR.gap);
|
|
1588
|
-
}
|
|
1589
|
-
function columnSlot(slot, uiScale = 1) {
|
|
1590
|
-
const h = scaled(TOOLBAR.buttonHeight, uiScale);
|
|
1591
|
-
return {
|
|
1592
|
-
right: PHONE_EDGE,
|
|
1593
|
-
boxHeight: COLUMN_SLOTS * h + (COLUMN_SLOTS - 1) * TOOLBAR.gap,
|
|
1594
|
-
above: Math.max(0, slot) * (h + TOOLBAR.gap)
|
|
1595
|
-
};
|
|
1596
|
-
}
|
|
1597
|
-
function panelRight(phone, desktopRight, uiScale = 1) {
|
|
1598
|
-
return phone ? PHONE_EDGE + scaled(TOOLBAR.buttonWidth, uiScale) + TOOLBAR.gap : desktopRight;
|
|
1599
|
-
}
|
|
1600
|
-
var DESKTOP_CLOSES = { guide: ["admin"], admin: ["guide"] };
|
|
1601
|
-
var GUIDE_PLACE = ["guide", "admin"];
|
|
1602
|
-
function panelsToClose(opened, registered, phone, coversGuide = []) {
|
|
1603
|
-
if (phone) return registered.filter((name) => name !== opened);
|
|
1604
|
-
const closes = [...DESKTOP_CLOSES[opened] ?? []];
|
|
1605
|
-
if (GUIDE_PLACE.includes(opened)) closes.push(...coversGuide);
|
|
1606
|
-
if (coversGuide.includes(opened)) closes.push(...GUIDE_PLACE);
|
|
1607
|
-
return registered.filter((name) => name !== opened && closes.includes(name));
|
|
1608
|
-
}
|
|
1609
|
-
var PanelRules = class {
|
|
1610
|
-
constructor(phone) {
|
|
1611
|
-
this.hides = /* @__PURE__ */ new Map();
|
|
1612
|
-
this.coveringGuide = /* @__PURE__ */ new Set();
|
|
1613
|
-
this.phone = phone;
|
|
1614
|
-
}
|
|
1615
|
-
/** Register (or replace) a panel; its hide runs when another panel opens and the rule says so */
|
|
1616
|
-
register(name, hide, options = {}) {
|
|
1617
|
-
this.hides.set(name, hide);
|
|
1618
|
-
if (options.coversGuide === true) this.coveringGuide.add(name);
|
|
1619
|
-
else this.coveringGuide.delete(name);
|
|
1620
|
-
}
|
|
1621
|
-
/** A panel opened: close the ones the rule names. One failing hide does not stop the rest. */
|
|
1622
|
-
opened(name) {
|
|
1623
|
-
for (const other of panelsToClose(name, [...this.hides.keys()], this.phone(), [...this.coveringGuide])) {
|
|
1624
|
-
try {
|
|
1625
|
-
this.hides.get(other)?.();
|
|
1626
|
-
} catch {
|
|
1627
|
-
}
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
get names() {
|
|
1631
|
-
return [...this.hides.keys()];
|
|
1632
|
-
}
|
|
1633
|
-
};
|
|
1634
|
-
|
|
1635
|
-
// src/ui/toolbar-button.ts
|
|
1636
|
-
function toolbarButton(slot, props, phone, uiScale = 1) {
|
|
1637
|
-
const width = Math.round(TOOLBAR.buttonWidth * uiScale);
|
|
1638
|
-
const height = Math.round(TOOLBAR.buttonHeight * uiScale);
|
|
1639
|
-
if (!phone) {
|
|
1640
|
-
return import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1641
|
-
...props,
|
|
1642
|
-
uiTransform: {
|
|
1643
|
-
positionType: "absolute",
|
|
1644
|
-
position: { right: rowRight(slot, uiScale), bottom: TOOLBAR.bottom },
|
|
1645
|
-
width,
|
|
1646
|
-
height,
|
|
1647
|
-
...props.uiTransform
|
|
1648
|
-
}
|
|
1649
|
-
});
|
|
1650
|
-
}
|
|
1651
|
-
const place = columnSlot(slot, uiScale);
|
|
1652
|
-
return import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1653
|
-
uiTransform: {
|
|
1654
|
-
positionType: "absolute",
|
|
1655
|
-
position: { right: place.right, top: 0 },
|
|
1656
|
-
width,
|
|
1657
|
-
height: "100%",
|
|
1658
|
-
flexDirection: "column",
|
|
1659
|
-
justifyContent: "center"
|
|
1660
|
-
},
|
|
1661
|
-
children: [
|
|
1662
|
-
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1663
|
-
uiTransform: { width, height: place.boxHeight, flexDirection: "column", flexShrink: 0 },
|
|
1664
|
-
children: [
|
|
1665
|
-
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, { uiTransform: { width, height: place.above, flexShrink: 0 } }),
|
|
1666
|
-
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1667
|
-
...props,
|
|
1668
|
-
uiTransform: { width, height, flexShrink: 0, ...props.uiTransform }
|
|
1669
|
-
})
|
|
1670
|
-
]
|
|
1671
|
-
})
|
|
1672
|
-
]
|
|
1673
|
-
});
|
|
1674
|
-
}
|
|
1569
|
+
// src/version.ts
|
|
1570
|
+
var SDK_VERSION = true ? "2.15.0" : "unknown";
|
|
1675
1571
|
|
|
1676
1572
|
// src/ui/guide-ui.tsx
|
|
1677
1573
|
function withLock(mapped, v, fallback) {
|
|
@@ -1708,7 +1604,7 @@ var GuideUIModule = class {
|
|
|
1708
1604
|
if (this.client.isVisitorBlocked) return null;
|
|
1709
1605
|
const windowW = UI_DIMENSIONS.guide.width;
|
|
1710
1606
|
const windowH = UI_DIMENSIONS.guide.height;
|
|
1711
|
-
return
|
|
1607
|
+
return import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1712
1608
|
key: `guide-root-${this.client.uiScale}`,
|
|
1713
1609
|
uiTransform: {
|
|
1714
1610
|
width: "100%",
|
|
@@ -1937,7 +1833,7 @@ var GuideUIModule = class {
|
|
|
1937
1833
|
const nodesPlaylist = this.featuredPlaylists.find((p) => p.name === "NODES");
|
|
1938
1834
|
const nodesCount = nodesPlaylist ? nodesPlaylist.videos.filter((v) => v.isCreator).length : 0;
|
|
1939
1835
|
const displayedPlaylists = this.featuredPlaylists.filter((p) => p.name !== "NODES").slice(0, 6);
|
|
1940
|
-
return
|
|
1836
|
+
return import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1941
1837
|
uiTransform: {
|
|
1942
1838
|
width: sidebarW,
|
|
1943
1839
|
minWidth: sidebarW,
|
|
@@ -1951,11 +1847,11 @@ var GuideUIModule = class {
|
|
|
1951
1847
|
uiBackground: { color: import_math3.Color4.create(0, 0, 0, 0.4) },
|
|
1952
1848
|
children: [
|
|
1953
1849
|
// Header & Search
|
|
1954
|
-
|
|
1850
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1955
1851
|
uiTransform: { width: "100%", flexDirection: "column", padding: 10 },
|
|
1956
1852
|
children: [
|
|
1957
1853
|
// Title row
|
|
1958
|
-
|
|
1854
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1959
1855
|
uiTransform: {
|
|
1960
1856
|
width: "100%",
|
|
1961
1857
|
height: this.s(40),
|
|
@@ -1965,7 +1861,7 @@ var GuideUIModule = class {
|
|
|
1965
1861
|
},
|
|
1966
1862
|
children: [
|
|
1967
1863
|
// Title
|
|
1968
|
-
|
|
1864
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1969
1865
|
uiText: {
|
|
1970
1866
|
value: "THE STATIC TV",
|
|
1971
1867
|
fontSize: this.s(UI_DIMENSIONS.guide.sidebar.headerSize),
|
|
@@ -1976,7 +1872,7 @@ var GuideUIModule = class {
|
|
|
1976
1872
|
]
|
|
1977
1873
|
}),
|
|
1978
1874
|
// Random Signal button
|
|
1979
|
-
|
|
1875
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1980
1876
|
uiTransform: {
|
|
1981
1877
|
width: "100%",
|
|
1982
1878
|
height: this.s(40),
|
|
@@ -1994,13 +1890,13 @@ var GuideUIModule = class {
|
|
|
1994
1890
|
}
|
|
1995
1891
|
},
|
|
1996
1892
|
children: [
|
|
1997
|
-
|
|
1893
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1998
1894
|
uiText: { value: ">> RANDOM SIGNAL <<", fontSize: this.s(14), color: THEME.colors.cyan }
|
|
1999
1895
|
})
|
|
2000
1896
|
]
|
|
2001
1897
|
}),
|
|
2002
1898
|
// Search input
|
|
2003
|
-
|
|
1899
|
+
import_react_ecs2.default.createElement(import_react_ecs2.Input, {
|
|
2004
1900
|
placeholder: "SCAN FREQ...",
|
|
2005
1901
|
fontSize: this.s(UI_DIMENSIONS.guide.sidebar.fontSize),
|
|
2006
1902
|
uiTransform: {
|
|
@@ -2020,11 +1916,11 @@ var GuideUIModule = class {
|
|
|
2020
1916
|
]
|
|
2021
1917
|
}),
|
|
2022
1918
|
// Menu items
|
|
2023
|
-
|
|
1919
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2024
1920
|
uiTransform: { flexGrow: 1, flexDirection: "column", width: "100%", padding: { top: 5 } },
|
|
2025
1921
|
children: [
|
|
2026
1922
|
// Section header
|
|
2027
|
-
|
|
1923
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2028
1924
|
uiTransform: { padding: { left: 10, bottom: 8, top: 5 } },
|
|
2029
1925
|
uiText: { value: "GLOBAL NETWORK", fontSize: this.s(12), color: THEME.colors.cyan }
|
|
2030
1926
|
}),
|
|
@@ -2033,12 +1929,12 @@ var GuideUIModule = class {
|
|
|
2033
1929
|
this.renderMenuButton("SIGNALS", signalCount, THEME.colors.white, void 0, "VODS & RECORDINGS"),
|
|
2034
1930
|
this.renderMenuButton("NODES", nodesCount, THEME.colors.magenta, void 0, "CHANNELS & CREATORS"),
|
|
2035
1931
|
// Divider
|
|
2036
|
-
|
|
1932
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2037
1933
|
uiTransform: { height: 1, width: "90%", margin: { top: 12, bottom: 8, left: 5 } },
|
|
2038
1934
|
uiBackground: { color: THEME.colors.panelBorder }
|
|
2039
1935
|
}),
|
|
2040
1936
|
// Archives section
|
|
2041
|
-
|
|
1937
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2042
1938
|
uiTransform: { padding: { left: 10, bottom: 8 } },
|
|
2043
1939
|
uiText: { value: "ARCHIVES", fontSize: this.s(12), color: THEME.colors.cyan }
|
|
2044
1940
|
}),
|
|
@@ -2047,6 +1943,11 @@ var GuideUIModule = class {
|
|
|
2047
1943
|
(pl) => this.renderMenuButton(pl.name.toUpperCase(), pl.videos.length, THEME.colors.white, void 0, "PLAYLIST")
|
|
2048
1944
|
)
|
|
2049
1945
|
]
|
|
1946
|
+
}),
|
|
1947
|
+
// The SDK's version, small and dim at the bottom, for a visitor reporting a problem (2.14.0)
|
|
1948
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1949
|
+
uiTransform: { width: "100%", flexShrink: 0, padding: { left: 10, bottom: 6, top: 4 } },
|
|
1950
|
+
uiText: { value: `TheStatic SDK ${SDK_VERSION}`, fontSize: this.s(11), color: THEME.colors.grayText, textAlign: "bottom-left" }
|
|
2050
1951
|
})
|
|
2051
1952
|
]
|
|
2052
1953
|
});
|
|
@@ -2054,7 +1955,7 @@ var GuideUIModule = class {
|
|
|
2054
1955
|
renderMenuButton(label, count, color, badge, subtitle) {
|
|
2055
1956
|
const isActive = this.activeTab === label;
|
|
2056
1957
|
const buttonHeight = this.s(UI_DIMENSIONS.guide.sidebar.buttonHeight);
|
|
2057
|
-
return
|
|
1958
|
+
return import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2058
1959
|
key: label,
|
|
2059
1960
|
uiTransform: {
|
|
2060
1961
|
width: "100%",
|
|
@@ -2073,10 +1974,10 @@ var GuideUIModule = class {
|
|
|
2073
1974
|
this.currentPage = 0;
|
|
2074
1975
|
},
|
|
2075
1976
|
children: [
|
|
2076
|
-
|
|
1977
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2077
1978
|
uiTransform: { flexDirection: "column", alignItems: "flex-start", justifyContent: "center", gap: 0 },
|
|
2078
1979
|
children: [
|
|
2079
|
-
|
|
1980
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2080
1981
|
uiTransform: { height: this.s(18) },
|
|
2081
1982
|
uiText: {
|
|
2082
1983
|
value: `${label} [${count}]`,
|
|
@@ -2086,7 +1987,7 @@ var GuideUIModule = class {
|
|
|
2086
1987
|
}
|
|
2087
1988
|
}),
|
|
2088
1989
|
...subtitle ? [
|
|
2089
|
-
|
|
1990
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2090
1991
|
key: "subtitle",
|
|
2091
1992
|
uiTransform: { height: this.s(12), marginTop: -2 },
|
|
2092
1993
|
uiText: {
|
|
@@ -2100,7 +2001,7 @@ var GuideUIModule = class {
|
|
|
2100
2001
|
]
|
|
2101
2002
|
}),
|
|
2102
2003
|
...badge ? [
|
|
2103
|
-
|
|
2004
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2104
2005
|
key: "badge",
|
|
2105
2006
|
uiText: { value: badge, fontSize: this.s(UI_DIMENSIONS.guide.sidebar.fontSize), color: THEME.colors.red }
|
|
2106
2007
|
})
|
|
@@ -2129,7 +2030,7 @@ var GuideUIModule = class {
|
|
|
2129
2030
|
const start = this.currentPage * this.itemsPerPage;
|
|
2130
2031
|
const paged = videosToShow.slice(start, start + this.itemsPerPage);
|
|
2131
2032
|
const totalPages = Math.ceil(videosToShow.length / this.itemsPerPage);
|
|
2132
|
-
return
|
|
2033
|
+
return import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2133
2034
|
uiTransform: {
|
|
2134
2035
|
flexGrow: 1,
|
|
2135
2036
|
flexDirection: "column",
|
|
@@ -2140,7 +2041,7 @@ var GuideUIModule = class {
|
|
|
2140
2041
|
this.renderCardGrid(paged),
|
|
2141
2042
|
// Pagination
|
|
2142
2043
|
...totalPages > 1 ? [
|
|
2143
|
-
|
|
2044
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2144
2045
|
key: "pagination",
|
|
2145
2046
|
uiTransform: {
|
|
2146
2047
|
width: "100%",
|
|
@@ -2153,7 +2054,7 @@ var GuideUIModule = class {
|
|
|
2153
2054
|
},
|
|
2154
2055
|
children: [
|
|
2155
2056
|
...this.currentPage > 0 ? [
|
|
2156
|
-
|
|
2057
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2157
2058
|
key: "prev",
|
|
2158
2059
|
uiText: {
|
|
2159
2060
|
value: "< PREV",
|
|
@@ -2163,7 +2064,7 @@ var GuideUIModule = class {
|
|
|
2163
2064
|
onMouseDown: () => this.currentPage--
|
|
2164
2065
|
})
|
|
2165
2066
|
] : [],
|
|
2166
|
-
|
|
2067
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2167
2068
|
uiText: {
|
|
2168
2069
|
value: `${this.currentPage + 1}/${totalPages}`,
|
|
2169
2070
|
fontSize: this.s(UI_DIMENSIONS.guide.content.bodySize),
|
|
@@ -2171,7 +2072,7 @@ var GuideUIModule = class {
|
|
|
2171
2072
|
}
|
|
2172
2073
|
}),
|
|
2173
2074
|
...this.currentPage < totalPages - 1 ? [
|
|
2174
|
-
|
|
2075
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2175
2076
|
key: "next",
|
|
2176
2077
|
uiText: {
|
|
2177
2078
|
value: "NEXT >",
|
|
@@ -2189,7 +2090,7 @@ var GuideUIModule = class {
|
|
|
2189
2090
|
}
|
|
2190
2091
|
renderCardGrid(videos) {
|
|
2191
2092
|
if (videos.length === 0) {
|
|
2192
|
-
return
|
|
2093
|
+
return import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2193
2094
|
uiTransform: { width: "100%", flexGrow: 1, justifyContent: "center", alignItems: "center" },
|
|
2194
2095
|
uiText: { value: "NO SIGNAL", fontSize: this.s(UI_DIMENSIONS.guide.content.bodySize), color: THEME.colors.gray }
|
|
2195
2096
|
});
|
|
@@ -2199,7 +2100,7 @@ var GuideUIModule = class {
|
|
|
2199
2100
|
rows.push(videos.slice(i, i + 2));
|
|
2200
2101
|
}
|
|
2201
2102
|
const cardH = this.s(UI_DIMENSIONS.guide.content.cardHeight);
|
|
2202
|
-
return
|
|
2103
|
+
return import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2203
2104
|
uiTransform: {
|
|
2204
2105
|
width: "100%",
|
|
2205
2106
|
flexGrow: 1,
|
|
@@ -2208,7 +2109,7 @@ var GuideUIModule = class {
|
|
|
2208
2109
|
gap: 8
|
|
2209
2110
|
},
|
|
2210
2111
|
children: rows.map(
|
|
2211
|
-
(row, rowIndex) =>
|
|
2112
|
+
(row, rowIndex) => import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2212
2113
|
key: `row-${rowIndex}`,
|
|
2213
2114
|
uiTransform: {
|
|
2214
2115
|
width: "100%",
|
|
@@ -2235,7 +2136,7 @@ var GuideUIModule = class {
|
|
|
2235
2136
|
} else if (isActive) {
|
|
2236
2137
|
cardBgColor = import_math3.Color4.create(0, 0.4, 0, 0.5);
|
|
2237
2138
|
}
|
|
2238
|
-
return
|
|
2139
|
+
return import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2239
2140
|
key: video.id,
|
|
2240
2141
|
uiTransform: {
|
|
2241
2142
|
width: cardW,
|
|
@@ -2250,7 +2151,7 @@ var GuideUIModule = class {
|
|
|
2250
2151
|
uiBackground: { color: cardBgColor },
|
|
2251
2152
|
children: [
|
|
2252
2153
|
// Main click area
|
|
2253
|
-
|
|
2154
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2254
2155
|
uiTransform: {
|
|
2255
2156
|
width: "100%",
|
|
2256
2157
|
height: "70%",
|
|
@@ -2260,7 +2161,7 @@ var GuideUIModule = class {
|
|
|
2260
2161
|
},
|
|
2261
2162
|
onMouseDown: () => this.handleVideoSelect(video),
|
|
2262
2163
|
children: [
|
|
2263
|
-
|
|
2164
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2264
2165
|
uiText: {
|
|
2265
2166
|
value: truncateText(video.name || "Unknown", 22),
|
|
2266
2167
|
fontSize: this.s(UI_DIMENSIONS.guide.content.headerSize),
|
|
@@ -2269,7 +2170,7 @@ var GuideUIModule = class {
|
|
|
2269
2170
|
}),
|
|
2270
2171
|
// Status indicator: OFFLINE > CONNECTING > PLAYING > LIVE
|
|
2271
2172
|
...isOffline ? [
|
|
2272
|
-
|
|
2173
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2273
2174
|
key: "offline",
|
|
2274
2175
|
uiText: {
|
|
2275
2176
|
value: "OFFLINE",
|
|
@@ -2278,7 +2179,7 @@ var GuideUIModule = class {
|
|
|
2278
2179
|
}
|
|
2279
2180
|
})
|
|
2280
2181
|
] : isConnecting ? [
|
|
2281
|
-
|
|
2182
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2282
2183
|
key: "connecting",
|
|
2283
2184
|
uiText: {
|
|
2284
2185
|
value: "CONNECTING...",
|
|
@@ -2287,7 +2188,7 @@ var GuideUIModule = class {
|
|
|
2287
2188
|
}
|
|
2288
2189
|
})
|
|
2289
2190
|
] : isActive ? [
|
|
2290
|
-
|
|
2191
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2291
2192
|
key: "playing",
|
|
2292
2193
|
uiText: {
|
|
2293
2194
|
value: "PLAYING",
|
|
@@ -2296,18 +2197,18 @@ var GuideUIModule = class {
|
|
|
2296
2197
|
}
|
|
2297
2198
|
})
|
|
2298
2199
|
] : video.isLive ? [
|
|
2299
|
-
|
|
2200
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2300
2201
|
key: "live",
|
|
2301
2202
|
uiTransform: { padding: { left: 4, right: 4, top: 2, bottom: 2 }, marginTop: 4 },
|
|
2302
2203
|
uiBackground: { color: THEME.colors.red },
|
|
2303
2204
|
children: [
|
|
2304
|
-
|
|
2205
|
+
import_react_ecs2.default.createElement(import_react_ecs2.Label, { value: "LIVE", fontSize: this.s(10), color: THEME.colors.white })
|
|
2305
2206
|
]
|
|
2306
2207
|
})
|
|
2307
2208
|
] : [],
|
|
2308
2209
|
// A locked channel (2026-11-20): its badge, the words a refused pick shows - one line, 12px in the 260px card
|
|
2309
2210
|
...video.locked === true ? [
|
|
2310
|
-
|
|
2211
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2311
2212
|
key: "locked",
|
|
2312
2213
|
uiTransform: { height: this.s(16), marginTop: 4 },
|
|
2313
2214
|
uiText: { value: LOCKED_LINE, fontSize: this.s(12), color: THEME.colors.yellow }
|
|
@@ -2316,7 +2217,7 @@ var GuideUIModule = class {
|
|
|
2316
2217
|
]
|
|
2317
2218
|
}),
|
|
2318
2219
|
// Channel link
|
|
2319
|
-
|
|
2220
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2320
2221
|
uiTransform: {
|
|
2321
2222
|
width: "100%",
|
|
2322
2223
|
height: "30%",
|
|
@@ -2327,7 +2228,7 @@ var GuideUIModule = class {
|
|
|
2327
2228
|
uiBackground: { color: import_math3.Color4.create(0, 0, 0, 0.3) },
|
|
2328
2229
|
onMouseDown: () => this.handleChannelClick(video),
|
|
2329
2230
|
children: [
|
|
2330
|
-
|
|
2231
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2331
2232
|
uiText: {
|
|
2332
2233
|
value: "CHANNEL",
|
|
2333
2234
|
fontSize: this.s(UI_DIMENSIONS.guide.content.bodySize),
|
|
@@ -2344,7 +2245,7 @@ var GuideUIModule = class {
|
|
|
2344
2245
|
const buttonW = this.s(170);
|
|
2345
2246
|
const buttonH = this.s(44);
|
|
2346
2247
|
const bodyH = this.s(UI_DIMENSIONS.guide.content.bodySize * 1.5 * 2);
|
|
2347
|
-
return
|
|
2248
|
+
return import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2348
2249
|
key: "age-choice",
|
|
2349
2250
|
uiTransform: {
|
|
2350
2251
|
positionType: "absolute",
|
|
@@ -2358,7 +2259,7 @@ var GuideUIModule = class {
|
|
|
2358
2259
|
},
|
|
2359
2260
|
uiBackground: { color: import_math3.Color4.create(0, 0, 0, 0.85) },
|
|
2360
2261
|
children: [
|
|
2361
|
-
|
|
2262
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2362
2263
|
uiTransform: {
|
|
2363
2264
|
width: this.s(480),
|
|
2364
2265
|
flexDirection: "column",
|
|
@@ -2369,15 +2270,15 @@ var GuideUIModule = class {
|
|
|
2369
2270
|
},
|
|
2370
2271
|
uiBackground: { color: THEME.colors.panel },
|
|
2371
2272
|
children: [
|
|
2372
|
-
|
|
2273
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2373
2274
|
uiTransform: { marginBottom: this.s(8) },
|
|
2374
2275
|
uiText: { value: "MATURE CONTENT", fontSize: this.s(24), color: THEME.colors.red }
|
|
2375
2276
|
}),
|
|
2376
|
-
|
|
2277
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2377
2278
|
uiTransform: { marginBottom: this.s(12) },
|
|
2378
2279
|
uiText: { value: truncateText(video.name || "Unknown", 40), fontSize: this.s(16), color: THEME.colors.cyan }
|
|
2379
2280
|
}),
|
|
2380
|
-
|
|
2281
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2381
2282
|
uiTransform: { width: "100%", minHeight: bodyH, marginBottom: this.s(20) },
|
|
2382
2283
|
uiText: {
|
|
2383
2284
|
value: "This channel is for viewers aged 18 and older. Are you 18 or older?",
|
|
@@ -2387,21 +2288,21 @@ var GuideUIModule = class {
|
|
|
2387
2288
|
textWrap: "wrap"
|
|
2388
2289
|
}
|
|
2389
2290
|
}),
|
|
2390
|
-
|
|
2291
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2391
2292
|
uiTransform: { flexDirection: "row", justifyContent: "center", gap: this.s(16) },
|
|
2392
2293
|
children: [
|
|
2393
|
-
|
|
2294
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2394
2295
|
key: "age-yes",
|
|
2395
2296
|
uiTransform: { width: buttonW, height: buttonH, justifyContent: "center", alignItems: "center" },
|
|
2396
2297
|
uiBackground: { color: THEME.colors.red },
|
|
2397
2298
|
onMouseDown: () => this.answerAge(true),
|
|
2398
2299
|
children: [
|
|
2399
|
-
|
|
2300
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2400
2301
|
uiText: { value: "YES, I AM 18+", fontSize: this.s(14), color: THEME.colors.white }
|
|
2401
2302
|
})
|
|
2402
2303
|
]
|
|
2403
2304
|
}),
|
|
2404
|
-
|
|
2305
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2405
2306
|
key: "age-no",
|
|
2406
2307
|
uiTransform: {
|
|
2407
2308
|
width: buttonW,
|
|
@@ -2414,7 +2315,7 @@ var GuideUIModule = class {
|
|
|
2414
2315
|
uiBackground: { color: THEME.colors.buttonBackground },
|
|
2415
2316
|
onMouseDown: () => this.answerAge(false),
|
|
2416
2317
|
children: [
|
|
2417
|
-
|
|
2318
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2418
2319
|
uiText: { value: "NO", fontSize: this.s(14), color: THEME.colors.white }
|
|
2419
2320
|
})
|
|
2420
2321
|
]
|
|
@@ -2428,7 +2329,7 @@ var GuideUIModule = class {
|
|
|
2428
2329
|
}
|
|
2429
2330
|
renderCloseButton() {
|
|
2430
2331
|
const closeSize = this.s(UI_DIMENSIONS.closeButton.size);
|
|
2431
|
-
return
|
|
2332
|
+
return import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2432
2333
|
uiTransform: {
|
|
2433
2334
|
positionType: "absolute",
|
|
2434
2335
|
position: { top: -5, right: -5 },
|
|
@@ -2440,51 +2341,25 @@ var GuideUIModule = class {
|
|
|
2440
2341
|
uiBackground: { color: THEME.colors.panel },
|
|
2441
2342
|
onMouseDown: () => this.hide(),
|
|
2442
2343
|
children: [
|
|
2443
|
-
|
|
2344
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
2444
2345
|
uiText: { value: "X", fontSize: this.s(UI_DIMENSIONS.closeButton.fontSize), color: THEME.colors.red }
|
|
2445
2346
|
})
|
|
2446
2347
|
]
|
|
2447
2348
|
});
|
|
2448
2349
|
}
|
|
2449
2350
|
renderToggleButton() {
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
color: THEME.colors.white,
|
|
2457
|
-
textAlign: "middle-center"
|
|
2458
|
-
}
|
|
2459
|
-
});
|
|
2460
|
-
const press = () => this._isVisible ? this.hide() : this.show();
|
|
2461
|
-
if (this.client.isPhone) {
|
|
2462
|
-
return toolbarButton(1, {
|
|
2463
|
-
uiTransform: { justifyContent: "center", alignItems: "center" },
|
|
2464
|
-
uiBackground: { color: buttonColor },
|
|
2465
|
-
onMouseDown: press,
|
|
2466
|
-
children: [label]
|
|
2467
|
-
}, true, this.client.uiScale);
|
|
2468
|
-
}
|
|
2469
|
-
const buttonPos = 20 + this.s(100) + 10;
|
|
2470
|
-
return import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
2471
|
-
uiTransform: {
|
|
2472
|
-
positionType: "absolute",
|
|
2473
|
-
position: { right: buttonPos, bottom: 10 },
|
|
2474
|
-
width: this.s(100),
|
|
2475
|
-
height: this.s(45),
|
|
2476
|
-
justifyContent: "center",
|
|
2477
|
-
alignItems: "center"
|
|
2478
|
-
},
|
|
2479
|
-
uiBackground: { color: buttonColor },
|
|
2480
|
-
onMouseDown: press,
|
|
2481
|
-
children: [label]
|
|
2351
|
+
return this.client.toolbarButton(1, {
|
|
2352
|
+
uiBackground: { color: import_math3.Color4.create(0, 0.5, 0.5, 0.9) },
|
|
2353
|
+
icon: "guide",
|
|
2354
|
+
tag: "GUIDE",
|
|
2355
|
+
open: this._isVisible,
|
|
2356
|
+
onMouseDown: () => this._isVisible ? this.hide() : this.show()
|
|
2482
2357
|
});
|
|
2483
2358
|
}
|
|
2484
2359
|
};
|
|
2485
2360
|
|
|
2486
2361
|
// src/ui/chat-ui.tsx
|
|
2487
|
-
var
|
|
2362
|
+
var import_react_ecs3 = __toESM(require("@dcl/sdk/react-ecs"));
|
|
2488
2363
|
var import_math4 = require("@dcl/sdk/math");
|
|
2489
2364
|
var import_SignedFetch3 = require("~system/SignedFetch");
|
|
2490
2365
|
var import_players = require("@dcl/sdk/players");
|
|
@@ -2535,7 +2410,7 @@ var ChatUIModule = class {
|
|
|
2535
2410
|
if (this.client.isVisitorBlocked) return null;
|
|
2536
2411
|
const scaledTheme = scaleChatTheme(DEFAULT_CHAT_THEME, this.client.uiScale);
|
|
2537
2412
|
const positionStyle = this.getPositionStyle();
|
|
2538
|
-
return
|
|
2413
|
+
return import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
2539
2414
|
uiTransform: {
|
|
2540
2415
|
width: "100%",
|
|
2541
2416
|
height: "100%",
|
|
@@ -2544,6 +2419,8 @@ var ChatUIModule = class {
|
|
|
2544
2419
|
children: [
|
|
2545
2420
|
// Always render toggle button
|
|
2546
2421
|
this.renderToggleButton(),
|
|
2422
|
+
// The toolbar's collapse handle, drawn here once for the whole toolbar (2.14.0; nothing while collapsed)
|
|
2423
|
+
this.client.toolbarHandle(),
|
|
2547
2424
|
// Render panel when visible - scaled sizes, fixed position
|
|
2548
2425
|
// Key includes uiScale to force re-render when scale changes from other panels
|
|
2549
2426
|
// On a phone centered beside the toolbar's column (2.13.0, src/ui/toolbar-panel.ts); elsewhere as here
|
|
@@ -2563,7 +2440,7 @@ var ChatUIModule = class {
|
|
|
2563
2440
|
this.renderHeader(),
|
|
2564
2441
|
this.renderChannelButton(scaledTheme),
|
|
2565
2442
|
this.renderMessagesArea(scaledTheme),
|
|
2566
|
-
|
|
2443
|
+
import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
2567
2444
|
uiTransform: { width: "100%", height: 1, flexShrink: 0 },
|
|
2568
2445
|
uiBackground: { color: THEME.colors.panelBorder }
|
|
2569
2446
|
}),
|
|
@@ -2905,7 +2782,7 @@ var ChatUIModule = class {
|
|
|
2905
2782
|
renderChannelButton(theme) {
|
|
2906
2783
|
const currentChannel = this.channels.find((c) => c.id === this.currentChannelId);
|
|
2907
2784
|
const displayName = currentChannel?.name || this.currentChannelId;
|
|
2908
|
-
return
|
|
2785
|
+
return import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
2909
2786
|
uiTransform: {
|
|
2910
2787
|
height: 40,
|
|
2911
2788
|
width: "100%",
|
|
@@ -2920,12 +2797,12 @@ var ChatUIModule = class {
|
|
|
2920
2797
|
this.showChannelDropdown = !this.showChannelDropdown;
|
|
2921
2798
|
},
|
|
2922
2799
|
children: [
|
|
2923
|
-
|
|
2800
|
+
import_react_ecs3.default.createElement(import_react_ecs3.Label, {
|
|
2924
2801
|
value: `// ${truncateText(displayName, 24)}`,
|
|
2925
2802
|
fontSize: theme.channelButton,
|
|
2926
2803
|
color: THEME.colors.white
|
|
2927
2804
|
}),
|
|
2928
|
-
|
|
2805
|
+
import_react_ecs3.default.createElement(import_react_ecs3.Label, {
|
|
2929
2806
|
value: this.showChannelDropdown ? "\u25B2" : "\u25BC",
|
|
2930
2807
|
fontSize: 10,
|
|
2931
2808
|
color: THEME.colors.cyan
|
|
@@ -2954,7 +2831,7 @@ var ChatUIModule = class {
|
|
|
2954
2831
|
const visibleMessages = allMessages.slice(startIdx, endIdx);
|
|
2955
2832
|
const canScrollUp = this.chatScrollOffset < maxOffset;
|
|
2956
2833
|
const canScrollDown = this.chatScrollOffset > 0;
|
|
2957
|
-
return
|
|
2834
|
+
return import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
2958
2835
|
uiTransform: { flexGrow: 1, width: "100%", flexDirection: "row", overflow: "hidden" },
|
|
2959
2836
|
children: [
|
|
2960
2837
|
// Messages - anchored at the bottom, so the newest stays in view now that a row grows with its text
|
|
@@ -2962,7 +2839,7 @@ var ChatUIModule = class {
|
|
|
2962
2839
|
// past it; now its oldest clips at the top, one scroll up away. The rows keep their height
|
|
2963
2840
|
// (flexShrink 0 - the protocol's default of 1 squeezes them onto each other) in one column
|
|
2964
2841
|
// (nowrap - the protocol documents wrap as its default).
|
|
2965
|
-
|
|
2842
|
+
import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
2966
2843
|
uiTransform: {
|
|
2967
2844
|
flexGrow: 1,
|
|
2968
2845
|
flexDirection: "column",
|
|
@@ -2976,7 +2853,7 @@ var ChatUIModule = class {
|
|
|
2976
2853
|
)
|
|
2977
2854
|
}),
|
|
2978
2855
|
// Scroll controls
|
|
2979
|
-
|
|
2856
|
+
import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
2980
2857
|
uiTransform: {
|
|
2981
2858
|
width: 28,
|
|
2982
2859
|
height: "100%",
|
|
@@ -2986,22 +2863,22 @@ var ChatUIModule = class {
|
|
|
2986
2863
|
gap: 8
|
|
2987
2864
|
},
|
|
2988
2865
|
children: [
|
|
2989
|
-
|
|
2866
|
+
import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
2990
2867
|
uiTransform: { width: 26, height: 36, justifyContent: "center", alignItems: "center" },
|
|
2991
2868
|
uiBackground: { color: canScrollUp ? THEME.colors.buttonBackground : import_math4.Color4.create(0.1, 0.1, 0.1, 0.3) },
|
|
2992
2869
|
onMouseDown: () => {
|
|
2993
2870
|
if (canScrollUp) this.chatScrollOffset += 1;
|
|
2994
2871
|
},
|
|
2995
2872
|
children: [
|
|
2996
|
-
|
|
2873
|
+
import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
2997
2874
|
uiText: { value: "\u25B2", fontSize: 14, color: canScrollUp ? THEME.colors.cyan : THEME.colors.gray }
|
|
2998
2875
|
})
|
|
2999
2876
|
]
|
|
3000
2877
|
}),
|
|
3001
|
-
|
|
2878
|
+
import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
3002
2879
|
uiTransform: { width: 26, height: 24, justifyContent: "center", alignItems: "center" },
|
|
3003
2880
|
children: [
|
|
3004
|
-
|
|
2881
|
+
import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
3005
2882
|
uiText: {
|
|
3006
2883
|
value: totalMessages > UI_DIMENSIONS.chat.messagesPerPage ? `${this.chatScrollOffset}` : "-",
|
|
3007
2884
|
fontSize: 10,
|
|
@@ -3010,14 +2887,14 @@ var ChatUIModule = class {
|
|
|
3010
2887
|
})
|
|
3011
2888
|
]
|
|
3012
2889
|
}),
|
|
3013
|
-
|
|
2890
|
+
import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
3014
2891
|
uiTransform: { width: 26, height: 36, justifyContent: "center", alignItems: "center" },
|
|
3015
2892
|
uiBackground: { color: canScrollDown ? THEME.colors.buttonBackground : import_math4.Color4.create(0.1, 0.1, 0.1, 0.3) },
|
|
3016
2893
|
onMouseDown: () => {
|
|
3017
2894
|
if (canScrollDown) this.chatScrollOffset -= 1;
|
|
3018
2895
|
},
|
|
3019
2896
|
children: [
|
|
3020
|
-
|
|
2897
|
+
import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
3021
2898
|
uiText: { value: "\u25BC", fontSize: 14, color: canScrollDown ? THEME.colors.cyan : THEME.colors.gray }
|
|
3022
2899
|
})
|
|
3023
2900
|
]
|
|
@@ -3028,7 +2905,7 @@ var ChatUIModule = class {
|
|
|
3028
2905
|
});
|
|
3029
2906
|
}
|
|
3030
2907
|
renderSystemMessage(msg, theme) {
|
|
3031
|
-
return
|
|
2908
|
+
return import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
3032
2909
|
key: msg.id,
|
|
3033
2910
|
uiTransform: { width: "100%", height: 24, marginBottom: 4, flexShrink: 0 },
|
|
3034
2911
|
uiText: {
|
|
@@ -3048,12 +2925,12 @@ var ChatUIModule = class {
|
|
|
3048
2925
|
if (displayName.toLowerCase().includes("admin")) accentColor = THEME.colors.magenta;
|
|
3049
2926
|
else if (isCurrentUser) accentColor = THEME.colors.green;
|
|
3050
2927
|
const textRoom = this.messageTextRoom(msg.text, theme.chatMessage);
|
|
3051
|
-
return
|
|
2928
|
+
return import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
3052
2929
|
key: msg.id,
|
|
3053
2930
|
uiTransform: { width: "100%", flexDirection: "column", marginBottom: 16, flexShrink: 0 },
|
|
3054
2931
|
children: [
|
|
3055
2932
|
// Header row
|
|
3056
|
-
|
|
2933
|
+
import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
3057
2934
|
uiTransform: {
|
|
3058
2935
|
width: "100%",
|
|
3059
2936
|
height: 24,
|
|
@@ -3063,23 +2940,23 @@ var ChatUIModule = class {
|
|
|
3063
2940
|
marginBottom: 4
|
|
3064
2941
|
},
|
|
3065
2942
|
children: [
|
|
3066
|
-
|
|
2943
|
+
import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
3067
2944
|
uiText: { value: displayName, fontSize: theme.chatUsername, color: accentColor, textAlign: "middle-left" }
|
|
3068
2945
|
}),
|
|
3069
|
-
|
|
2946
|
+
import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
3070
2947
|
uiText: { value: time, fontSize: theme.chatTimestamp, color: THEME.colors.gray, textAlign: "middle-right" }
|
|
3071
2948
|
})
|
|
3072
2949
|
]
|
|
3073
2950
|
}),
|
|
3074
2951
|
// Message content
|
|
3075
|
-
|
|
2952
|
+
import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
3076
2953
|
uiTransform: { width: "100%", flexDirection: "row", alignItems: "stretch", paddingLeft: 8 },
|
|
3077
2954
|
children: [
|
|
3078
|
-
|
|
2955
|
+
import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
3079
2956
|
uiTransform: { width: 3, minHeight: textRoom },
|
|
3080
2957
|
uiBackground: { color: accentColor }
|
|
3081
2958
|
}),
|
|
3082
|
-
|
|
2959
|
+
import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
3083
2960
|
uiTransform: { flexGrow: 1, minHeight: textRoom, paddingLeft: 12, paddingTop: 4, paddingBottom: 4 },
|
|
3084
2961
|
uiText: {
|
|
3085
2962
|
value: msg.text,
|
|
@@ -3095,7 +2972,7 @@ var ChatUIModule = class {
|
|
|
3095
2972
|
});
|
|
3096
2973
|
}
|
|
3097
2974
|
renderUserInfoBar(theme) {
|
|
3098
|
-
return
|
|
2975
|
+
return import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
3099
2976
|
uiTransform: {
|
|
3100
2977
|
width: "100%",
|
|
3101
2978
|
height: 34,
|
|
@@ -3107,12 +2984,12 @@ var ChatUIModule = class {
|
|
|
3107
2984
|
},
|
|
3108
2985
|
uiBackground: { color: import_math4.Color4.create(0.03, 0.03, 0.05, 1) },
|
|
3109
2986
|
children: [
|
|
3110
|
-
|
|
2987
|
+
import_react_ecs3.default.createElement(import_react_ecs3.Label, {
|
|
3111
2988
|
value: `// ${this.currentUsername || "Guest"}`,
|
|
3112
2989
|
fontSize: theme.userInfo,
|
|
3113
2990
|
color: THEME.colors.yellow
|
|
3114
2991
|
}),
|
|
3115
|
-
|
|
2992
|
+
import_react_ecs3.default.createElement(import_react_ecs3.Label, {
|
|
3116
2993
|
value: this.isRegisteredUser ? "\u25CF CITIZEN" : "\u25CB GUEST",
|
|
3117
2994
|
fontSize: theme.authStatus,
|
|
3118
2995
|
color: this.isRegisteredUser ? THEME.colors.green : THEME.colors.gray
|
|
@@ -3123,7 +3000,7 @@ var ChatUIModule = class {
|
|
|
3123
3000
|
renderInputArea(theme) {
|
|
3124
3001
|
const baseUrl = this.getBaseUrl();
|
|
3125
3002
|
if (!this.isRegisteredUser) {
|
|
3126
|
-
return
|
|
3003
|
+
return import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
3127
3004
|
uiTransform: {
|
|
3128
3005
|
height: 75,
|
|
3129
3006
|
minHeight: 75,
|
|
@@ -3137,14 +3014,14 @@ var ChatUIModule = class {
|
|
|
3137
3014
|
},
|
|
3138
3015
|
uiBackground: { color: import_math4.Color4.create(0.08, 0.08, 0.1, 1) },
|
|
3139
3016
|
children: [
|
|
3140
|
-
|
|
3017
|
+
import_react_ecs3.default.createElement(import_react_ecs3.Label, {
|
|
3141
3018
|
value: "ACCESS RESTRICTED: CITIZENS ONLY",
|
|
3142
3019
|
fontSize: 12,
|
|
3143
3020
|
color: THEME.colors.red,
|
|
3144
3021
|
textAlign: "middle-center",
|
|
3145
3022
|
uiTransform: { marginBottom: 5 }
|
|
3146
3023
|
}),
|
|
3147
|
-
|
|
3024
|
+
import_react_ecs3.default.createElement(import_react_ecs3.Button, {
|
|
3148
3025
|
value: "REGISTER IDENTITY",
|
|
3149
3026
|
fontSize: 14,
|
|
3150
3027
|
uiTransform: { width: 200, height: 30 },
|
|
@@ -3157,7 +3034,7 @@ var ChatUIModule = class {
|
|
|
3157
3034
|
]
|
|
3158
3035
|
});
|
|
3159
3036
|
}
|
|
3160
|
-
return
|
|
3037
|
+
return import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
3161
3038
|
uiTransform: {
|
|
3162
3039
|
height: 75,
|
|
3163
3040
|
minHeight: 75,
|
|
@@ -3169,7 +3046,7 @@ var ChatUIModule = class {
|
|
|
3169
3046
|
},
|
|
3170
3047
|
uiBackground: { color: import_math4.Color4.create(0.08, 0.08, 0.1, 1) },
|
|
3171
3048
|
children: [
|
|
3172
|
-
|
|
3049
|
+
import_react_ecs3.default.createElement(import_react_ecs3.Input, {
|
|
3173
3050
|
onChange: (v) => {
|
|
3174
3051
|
this.inputText = v;
|
|
3175
3052
|
},
|
|
@@ -3182,7 +3059,7 @@ var ChatUIModule = class {
|
|
|
3182
3059
|
uiBackground: { color: import_math4.Color4.create(0.12, 0.12, 0.14, 1) },
|
|
3183
3060
|
uiTransform: { flexGrow: 1, height: "100%", margin: { right: 10 } }
|
|
3184
3061
|
}),
|
|
3185
|
-
|
|
3062
|
+
import_react_ecs3.default.createElement(import_react_ecs3.Button, {
|
|
3186
3063
|
value: this.isSigningIn ? "..." : "SEND",
|
|
3187
3064
|
onMouseDown: () => this.handleSend(),
|
|
3188
3065
|
uiTransform: { width: 80, height: "100%" },
|
|
@@ -3199,7 +3076,7 @@ var ChatUIModule = class {
|
|
|
3199
3076
|
const endIdx = startIdx + UI_DIMENSIONS.chat.channelsPerPage;
|
|
3200
3077
|
const visibleChannels = this.channels.slice(startIdx, endIdx);
|
|
3201
3078
|
const totalPages = Math.ceil(this.channels.length / UI_DIMENSIONS.chat.channelsPerPage);
|
|
3202
|
-
return
|
|
3079
|
+
return import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
3203
3080
|
uiTransform: {
|
|
3204
3081
|
width: "100%",
|
|
3205
3082
|
height: 260,
|
|
@@ -3210,13 +3087,13 @@ var ChatUIModule = class {
|
|
|
3210
3087
|
uiBackground: { color: import_math4.Color4.create(0.08, 0.1, 0.14, 1) },
|
|
3211
3088
|
children: [
|
|
3212
3089
|
// Top border
|
|
3213
|
-
|
|
3090
|
+
import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
3214
3091
|
uiTransform: { width: "100%", height: 2, flexShrink: 0 },
|
|
3215
3092
|
uiBackground: { color: THEME.colors.cyan }
|
|
3216
3093
|
}),
|
|
3217
3094
|
// Channel list
|
|
3218
3095
|
...visibleChannels.map(
|
|
3219
|
-
(channel) =>
|
|
3096
|
+
(channel) => import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
3220
3097
|
key: channel.id,
|
|
3221
3098
|
uiTransform: {
|
|
3222
3099
|
height: 38,
|
|
@@ -3229,7 +3106,7 @@ var ChatUIModule = class {
|
|
|
3229
3106
|
},
|
|
3230
3107
|
onMouseDown: () => this.switchChannel(channel.id),
|
|
3231
3108
|
children: [
|
|
3232
|
-
|
|
3109
|
+
import_react_ecs3.default.createElement(import_react_ecs3.Label, {
|
|
3233
3110
|
value: channel.id === this.currentChannelId ? `\u25B8 ${channel.name}` : channel.name,
|
|
3234
3111
|
fontSize: theme.channelDropdown,
|
|
3235
3112
|
color: channel.id === this.currentChannelId ? THEME.colors.cyan : THEME.colors.gray
|
|
@@ -3239,7 +3116,7 @@ var ChatUIModule = class {
|
|
|
3239
3116
|
),
|
|
3240
3117
|
// Pagination
|
|
3241
3118
|
...totalPages > 1 ? [
|
|
3242
|
-
|
|
3119
|
+
import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
3243
3120
|
key: "pagination",
|
|
3244
3121
|
uiTransform: {
|
|
3245
3122
|
width: "100%",
|
|
@@ -3252,11 +3129,11 @@ var ChatUIModule = class {
|
|
|
3252
3129
|
},
|
|
3253
3130
|
children: [
|
|
3254
3131
|
...this.channelPage > 0 ? [
|
|
3255
|
-
|
|
3132
|
+
import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
3256
3133
|
key: "prev",
|
|
3257
3134
|
onMouseDown: () => this.channelPage--,
|
|
3258
3135
|
children: [
|
|
3259
|
-
|
|
3136
|
+
import_react_ecs3.default.createElement(import_react_ecs3.Label, {
|
|
3260
3137
|
value: "<< PREV",
|
|
3261
3138
|
fontSize: 10,
|
|
3262
3139
|
color: THEME.colors.cyan
|
|
@@ -3264,17 +3141,17 @@ var ChatUIModule = class {
|
|
|
3264
3141
|
]
|
|
3265
3142
|
})
|
|
3266
3143
|
] : [],
|
|
3267
|
-
|
|
3144
|
+
import_react_ecs3.default.createElement(import_react_ecs3.Label, {
|
|
3268
3145
|
value: `${this.channelPage + 1}/${totalPages}`,
|
|
3269
3146
|
fontSize: 10,
|
|
3270
3147
|
color: THEME.colors.gray
|
|
3271
3148
|
}),
|
|
3272
3149
|
...this.channelPage < totalPages - 1 ? [
|
|
3273
|
-
|
|
3150
|
+
import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
3274
3151
|
key: "next",
|
|
3275
3152
|
onMouseDown: () => this.channelPage++,
|
|
3276
3153
|
children: [
|
|
3277
|
-
|
|
3154
|
+
import_react_ecs3.default.createElement(import_react_ecs3.Label, {
|
|
3278
3155
|
value: "NEXT >>",
|
|
3279
3156
|
fontSize: 10,
|
|
3280
3157
|
color: THEME.colors.cyan
|
|
@@ -3286,7 +3163,7 @@ var ChatUIModule = class {
|
|
|
3286
3163
|
})
|
|
3287
3164
|
] : [],
|
|
3288
3165
|
// Bottom border
|
|
3289
|
-
|
|
3166
|
+
import_react_ecs3.default.createElement(import_react_ecs3.UiEntity, {
|
|
3290
3167
|
uiTransform: { width: "100%", height: 1, flexShrink: 0 },
|
|
3291
3168
|
uiBackground: { color: THEME.colors.panelBorder }
|
|
3292
3169
|
})
|
|
@@ -3294,50 +3171,25 @@ var ChatUIModule = class {
|
|
|
3294
3171
|
});
|
|
3295
3172
|
}
|
|
3296
3173
|
renderToggleButton() {
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
color: THEME.colors.white,
|
|
3305
|
-
textAlign: "middle-center"
|
|
3306
|
-
}
|
|
3307
|
-
});
|
|
3308
|
-
const press = () => this._isVisible ? this.hide() : this.show();
|
|
3309
|
-
if (this.client.isPhone) {
|
|
3310
|
-
return toolbarButton(0, {
|
|
3311
|
-
uiTransform: { justifyContent: "center", alignItems: "center" },
|
|
3312
|
-
uiBackground: { color: buttonColor },
|
|
3313
|
-
onMouseDown: press,
|
|
3314
|
-
children: [label]
|
|
3315
|
-
}, true, this.client.uiScale);
|
|
3316
|
-
}
|
|
3317
|
-
return import_react_ecs4.default.createElement(import_react_ecs4.UiEntity, {
|
|
3318
|
-
uiTransform: {
|
|
3319
|
-
positionType: "absolute",
|
|
3320
|
-
position: { right: 20, bottom: 10 },
|
|
3321
|
-
width: this.s(100),
|
|
3322
|
-
height: this.s(45),
|
|
3323
|
-
justifyContent: "center",
|
|
3324
|
-
alignItems: "center"
|
|
3325
|
-
},
|
|
3326
|
-
uiBackground: { color: buttonColor },
|
|
3327
|
-
onMouseDown: press,
|
|
3328
|
-
children: [label]
|
|
3174
|
+
return this.client.toolbarButton(0, {
|
|
3175
|
+
uiBackground: { color: import_math4.Color4.create(0.6, 0, 0.5, 0.9) },
|
|
3176
|
+
icon: "chat",
|
|
3177
|
+
tag: "CHAT",
|
|
3178
|
+
badge: this._unreadCount > 0 ? this._unreadCount : void 0,
|
|
3179
|
+
open: this._isVisible,
|
|
3180
|
+
onMouseDown: () => this._isVisible ? this.hide() : this.show()
|
|
3329
3181
|
});
|
|
3330
3182
|
}
|
|
3331
3183
|
};
|
|
3332
3184
|
|
|
3333
3185
|
// src/ui/admin-panel-ui.tsx
|
|
3334
|
-
var
|
|
3186
|
+
var import_react_ecs6 = __toESM(require("@dcl/sdk/react-ecs"));
|
|
3335
3187
|
var import_math7 = require("@dcl/sdk/math");
|
|
3336
3188
|
var import_players2 = require("@dcl/sdk/players");
|
|
3337
3189
|
var import_RestrictedActions6 = require("~system/RestrictedActions");
|
|
3338
3190
|
|
|
3339
3191
|
// src/ui/ui-renderer.tsx
|
|
3340
|
-
var
|
|
3192
|
+
var import_react_ecs4 = __toESM(require("@dcl/sdk/react-ecs"));
|
|
3341
3193
|
var import_ecs3 = require("@dcl/sdk/ecs");
|
|
3342
3194
|
var notificationText = "";
|
|
3343
3195
|
var notificationVisible = false;
|
|
@@ -3370,8 +3222,8 @@ function NotificationBanner() {
|
|
|
3370
3222
|
if (!notificationVisible) return null;
|
|
3371
3223
|
return (
|
|
3372
3224
|
// Full-width container to center the notification
|
|
3373
|
-
/* @__PURE__ */
|
|
3374
|
-
|
|
3225
|
+
/* @__PURE__ */ import_react_ecs4.default.createElement(
|
|
3226
|
+
import_react_ecs4.UiEntity,
|
|
3375
3227
|
{
|
|
3376
3228
|
uiTransform: {
|
|
3377
3229
|
positionType: "absolute",
|
|
@@ -3381,8 +3233,8 @@ function NotificationBanner() {
|
|
|
3381
3233
|
alignItems: "center"
|
|
3382
3234
|
}
|
|
3383
3235
|
},
|
|
3384
|
-
/* @__PURE__ */
|
|
3385
|
-
|
|
3236
|
+
/* @__PURE__ */ import_react_ecs4.default.createElement(
|
|
3237
|
+
import_react_ecs4.UiEntity,
|
|
3386
3238
|
{
|
|
3387
3239
|
uiTransform: {
|
|
3388
3240
|
width: N.width,
|
|
@@ -3392,8 +3244,8 @@ function NotificationBanner() {
|
|
|
3392
3244
|
},
|
|
3393
3245
|
uiBackground: { color: C.panel }
|
|
3394
3246
|
},
|
|
3395
|
-
/* @__PURE__ */
|
|
3396
|
-
|
|
3247
|
+
/* @__PURE__ */ import_react_ecs4.default.createElement(
|
|
3248
|
+
import_react_ecs4.UiEntity,
|
|
3397
3249
|
{
|
|
3398
3250
|
uiTransform: {
|
|
3399
3251
|
width: N.borderWidth,
|
|
@@ -3402,8 +3254,8 @@ function NotificationBanner() {
|
|
|
3402
3254
|
uiBackground: { color: C.cyan }
|
|
3403
3255
|
}
|
|
3404
3256
|
),
|
|
3405
|
-
/* @__PURE__ */
|
|
3406
|
-
|
|
3257
|
+
/* @__PURE__ */ import_react_ecs4.default.createElement(
|
|
3258
|
+
import_react_ecs4.UiEntity,
|
|
3407
3259
|
{
|
|
3408
3260
|
uiTransform: {
|
|
3409
3261
|
flexGrow: 1,
|
|
@@ -3413,8 +3265,8 @@ function NotificationBanner() {
|
|
|
3413
3265
|
alignItems: "flex-start"
|
|
3414
3266
|
}
|
|
3415
3267
|
},
|
|
3416
|
-
/* @__PURE__ */
|
|
3417
|
-
|
|
3268
|
+
/* @__PURE__ */ import_react_ecs4.default.createElement(
|
|
3269
|
+
import_react_ecs4.Label,
|
|
3418
3270
|
{
|
|
3419
3271
|
value: notificationText,
|
|
3420
3272
|
fontSize: N.fontSize,
|
|
@@ -3423,8 +3275,8 @@ function NotificationBanner() {
|
|
|
3423
3275
|
}
|
|
3424
3276
|
)
|
|
3425
3277
|
),
|
|
3426
|
-
/* @__PURE__ */
|
|
3427
|
-
|
|
3278
|
+
/* @__PURE__ */ import_react_ecs4.default.createElement(
|
|
3279
|
+
import_react_ecs4.UiEntity,
|
|
3428
3280
|
{
|
|
3429
3281
|
uiTransform: {
|
|
3430
3282
|
width: 5,
|
|
@@ -3446,8 +3298,8 @@ function createStaticUI(client) {
|
|
|
3446
3298
|
const guideComponent = client.guideUI?.getComponent() ?? null;
|
|
3447
3299
|
const chatComponent = client.chatUI?.getComponent() ?? null;
|
|
3448
3300
|
const adminComponent = client.adminPanel?.getComponent() ?? null;
|
|
3449
|
-
return /* @__PURE__ */
|
|
3450
|
-
|
|
3301
|
+
return /* @__PURE__ */ import_react_ecs4.default.createElement(
|
|
3302
|
+
import_react_ecs4.UiEntity,
|
|
3451
3303
|
{
|
|
3452
3304
|
key: `static-ui-root-${currentScale}`,
|
|
3453
3305
|
uiTransform: {
|
|
@@ -3458,7 +3310,7 @@ function createStaticUI(client) {
|
|
|
3458
3310
|
alignItems: "center"
|
|
3459
3311
|
}
|
|
3460
3312
|
},
|
|
3461
|
-
blocked ? null : /* @__PURE__ */
|
|
3313
|
+
blocked ? null : /* @__PURE__ */ import_react_ecs4.default.createElement(NotificationBanner, null),
|
|
3462
3314
|
guideComponent,
|
|
3463
3315
|
chatComponent,
|
|
3464
3316
|
adminComponent
|
|
@@ -3467,11 +3319,11 @@ function createStaticUI(client) {
|
|
|
3467
3319
|
}
|
|
3468
3320
|
function setupStaticUI(client) {
|
|
3469
3321
|
const StaticUI = createStaticUI(client);
|
|
3470
|
-
|
|
3322
|
+
import_react_ecs4.ReactEcsRenderer.setUiRenderer(StaticUI);
|
|
3471
3323
|
}
|
|
3472
3324
|
|
|
3473
3325
|
// src/ui/blocked-notice.tsx
|
|
3474
|
-
var
|
|
3326
|
+
var import_react_ecs5 = __toESM(require("@dcl/sdk/react-ecs"));
|
|
3475
3327
|
var import_math5 = require("@dcl/sdk/math");
|
|
3476
3328
|
var import_RestrictedActions4 = require("~system/RestrictedActions");
|
|
3477
3329
|
var DEFAULT_SITE_URL = "https://thestatic.tv";
|
|
@@ -3498,8 +3350,8 @@ function BlockedNotice(props) {
|
|
|
3498
3350
|
const s = (v) => Math.round(v * props.scale);
|
|
3499
3351
|
const [title, ...body] = lines;
|
|
3500
3352
|
const action = blockedNoticeAction(props.standing, props.siteUrl || DEFAULT_SITE_URL);
|
|
3501
|
-
return /* @__PURE__ */
|
|
3502
|
-
|
|
3353
|
+
return /* @__PURE__ */ import_react_ecs5.default.createElement(
|
|
3354
|
+
import_react_ecs5.UiEntity,
|
|
3503
3355
|
{
|
|
3504
3356
|
uiTransform: {
|
|
3505
3357
|
width: "100%",
|
|
@@ -3509,16 +3361,16 @@ function BlockedNotice(props) {
|
|
|
3509
3361
|
alignItems: "center"
|
|
3510
3362
|
}
|
|
3511
3363
|
},
|
|
3512
|
-
/* @__PURE__ */
|
|
3513
|
-
|
|
3364
|
+
/* @__PURE__ */ import_react_ecs5.default.createElement(
|
|
3365
|
+
import_react_ecs5.UiEntity,
|
|
3514
3366
|
{
|
|
3515
3367
|
uiTransform: { width: s(460), flexDirection: "column", alignItems: "center", padding: s(20) },
|
|
3516
3368
|
uiBackground: { color: import_math5.Color4.create(0.05, 0.05, 0.08, 0.95) }
|
|
3517
3369
|
},
|
|
3518
|
-
/* @__PURE__ */
|
|
3519
|
-
body.map((line, i) => /* @__PURE__ */
|
|
3520
|
-
action && /* @__PURE__ */
|
|
3521
|
-
|
|
3370
|
+
/* @__PURE__ */ import_react_ecs5.default.createElement(import_react_ecs5.Label, { value: title, fontSize: s(22), color: import_math5.Color4.create(0.9, 0.2, 0.2, 1), uiTransform: { height: s(34) } }),
|
|
3371
|
+
body.map((line, i) => /* @__PURE__ */ import_react_ecs5.default.createElement(import_react_ecs5.Label, { key: `blocked-line-${i}`, value: line, fontSize: s(16), color: import_math5.Color4.White(), uiTransform: { height: s(26) } })),
|
|
3372
|
+
action && /* @__PURE__ */ import_react_ecs5.default.createElement(
|
|
3373
|
+
import_react_ecs5.Button,
|
|
3522
3374
|
{
|
|
3523
3375
|
uiTransform: { width: s(220), height: s(36), margin: { top: s(12) } },
|
|
3524
3376
|
uiBackground: { color: import_math5.Color4.create(0, 0.8, 0.8, 1) },
|
|
@@ -4008,16 +3860,16 @@ var AdminPanelUIModule = class {
|
|
|
4008
3860
|
this.privateStatus = line;
|
|
4009
3861
|
} };
|
|
4010
3862
|
// --- UI Components ---
|
|
4011
|
-
this.SectionHead = ({ label, color }) => /* @__PURE__ */
|
|
4012
|
-
|
|
3863
|
+
this.SectionHead = ({ label, color }) => /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
3864
|
+
import_react_ecs6.UiEntity,
|
|
4013
3865
|
{
|
|
4014
3866
|
uiTransform: { width: "100%", height: this.s(UI_DIMENSIONS.admin.sectionHeadHeight), margin: { bottom: 8 }, padding: { left: 10 }, alignItems: "center" },
|
|
4015
3867
|
uiBackground: { color: import_math7.Color4.create(color.r * 0.3, color.g * 0.3, color.b * 0.3, 0.5) }
|
|
4016
3868
|
},
|
|
4017
|
-
/* @__PURE__ */
|
|
3869
|
+
/* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: label, fontSize: this.theme.sectionHead, color })
|
|
4018
3870
|
);
|
|
4019
|
-
this.TabBtn = ({ label, tab }) => /* @__PURE__ */
|
|
4020
|
-
|
|
3871
|
+
this.TabBtn = ({ label, tab }) => /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
3872
|
+
import_react_ecs6.Button,
|
|
4021
3873
|
{
|
|
4022
3874
|
uiTransform: { flexGrow: 1, height: this.s(UI_DIMENSIONS.admin.tabHeight), justifyContent: "center", alignItems: "center" },
|
|
4023
3875
|
uiBackground: { color: this.activeTab === tab ? C2.tabActive : C2.tabInactive },
|
|
@@ -4035,8 +3887,8 @@ var AdminPanelUIModule = class {
|
|
|
4035
3887
|
*/
|
|
4036
3888
|
this.ControlsTab = () => {
|
|
4037
3889
|
const t = this.theme;
|
|
4038
|
-
return /* @__PURE__ */
|
|
4039
|
-
|
|
3890
|
+
return /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "column", width: "100%", padding: 10 } }, this.controls.map((control) => /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { key: `control-${control.id}`, uiTransform: { flexDirection: "column", margin: { bottom: 14 } } }, /* @__PURE__ */ import_react_ecs6.default.createElement(this.SectionHead, { label: control.label, color: C2.cyan }), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { 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__ */ import_react_ecs6.default.createElement(
|
|
3891
|
+
import_react_ecs6.Label,
|
|
4040
3892
|
{
|
|
4041
3893
|
value: this.controlStatus,
|
|
4042
3894
|
fontSize: t.status,
|
|
@@ -4050,8 +3902,8 @@ var AdminPanelUIModule = class {
|
|
|
4050
3902
|
this.fetchStreamData();
|
|
4051
3903
|
}
|
|
4052
3904
|
const t = this.theme;
|
|
4053
|
-
return /* @__PURE__ */
|
|
4054
|
-
|
|
3905
|
+
return /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "column", width: "100%", padding: 10 } }, !this.streamData?.hasChannel && /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "column", margin: { bottom: 14 } } }, /* @__PURE__ */ import_react_ecs6.default.createElement(this.SectionHead, { label: "LIVE STREAM", color: C2.btn }), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: "No streaming channel linked", fontSize: t.labelSmall, color: C2.textDim, uiTransform: { margin: { bottom: 8 } } }), this.isOwner && /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "column" } }, this.streamData?.trialAvailable && /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "column", margin: { bottom: 10 } } }, /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
3906
|
+
import_react_ecs6.Button,
|
|
4055
3907
|
{
|
|
4056
3908
|
uiTransform: { width: this.s(200), height: this.s(UI_DIMENSIONS.admin.buttonHeight), margin: { bottom: 6 } },
|
|
4057
3909
|
uiBackground: { color: this.trialClaiming ? C2.btn : C2.green },
|
|
@@ -4060,8 +3912,8 @@ var AdminPanelUIModule = class {
|
|
|
4060
3912
|
color: C2.text,
|
|
4061
3913
|
onMouseDown: () => this.claimTrial()
|
|
4062
3914
|
}
|
|
4063
|
-
), this.trialClaimError && /* @__PURE__ */
|
|
4064
|
-
|
|
3915
|
+
), this.trialClaimError && /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: this.trialClaimError, fontSize: t.status, color: C2.red }), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: trialNoteText(this.streamData?.trialSparks), fontSize: t.labelSmall, color: C2.textDim, uiTransform: { margin: { top: 4 } } })), !this.streamData?.trialAvailable && /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "column" } }, /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
3916
|
+
import_react_ecs6.Button,
|
|
4065
3917
|
{
|
|
4066
3918
|
uiTransform: { width: this.s(170), height: this.s(UI_DIMENSIONS.admin.buttonHeight), margin: { bottom: 6 } },
|
|
4067
3919
|
uiBackground: { color: this.channelCreating ? C2.btn : C2.cyan },
|
|
@@ -4070,47 +3922,47 @@ var AdminPanelUIModule = class {
|
|
|
4070
3922
|
color: C2.text,
|
|
4071
3923
|
onMouseDown: () => this.createChannel()
|
|
4072
3924
|
}
|
|
4073
|
-
), this.channelCreateError && /* @__PURE__ */
|
|
4074
|
-
|
|
3925
|
+
), this.channelCreateError && /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: this.channelCreateError, fontSize: t.status, color: C2.red }), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { 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__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "column", margin: { bottom: 14 } } }, /* @__PURE__ */ import_react_ecs6.default.createElement(this.SectionHead, { label: this.streamData.isLive ? "LIVE STREAM" : "STREAM SETTINGS", color: this.streamData.isLive ? C2.red : C2.yellow }), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "row", alignItems: "center", margin: { bottom: 8 } } }, /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
3926
|
+
import_react_ecs6.Label,
|
|
4075
3927
|
{
|
|
4076
3928
|
value: this.streamData.isLive ? `LIVE \u2022 ${this.streamData.currentViewers || 0} viewers` : "OFFLINE",
|
|
4077
3929
|
fontSize: t.label,
|
|
4078
3930
|
color: this.streamData.isLive ? C2.red : C2.textDim
|
|
4079
3931
|
}
|
|
4080
|
-
), /* @__PURE__ */
|
|
4081
|
-
|
|
3932
|
+
), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: ` \u2022 ${this.streamData.tier?.toUpperCase() || "RELAY"}`, fontSize: t.labelSmall, color: C2.cyan }), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: ` \u2022 ${this.streamData.sparksBalance || 0} Sparks`, fontSize: t.labelSmall, color: C2.textDim })), /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
3933
|
+
import_react_ecs6.Label,
|
|
4082
3934
|
{
|
|
4083
3935
|
value: `Channel: ${this.streamData.channelName || this.streamData.channelId}`,
|
|
4084
3936
|
fontSize: t.labelSmall,
|
|
4085
3937
|
color: C2.textDim,
|
|
4086
3938
|
uiTransform: { margin: { bottom: 10 } }
|
|
4087
3939
|
}
|
|
4088
|
-
), /* @__PURE__ */
|
|
4089
|
-
|
|
3940
|
+
), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "column", margin: { bottom: 6 } } }, /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: "RTMP Server:", fontSize: t.labelSmall, color: C2.textDim }), /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
3941
|
+
import_react_ecs6.Label,
|
|
4090
3942
|
{
|
|
4091
3943
|
value: this.streamData.rtmpUrl || "Loading...",
|
|
4092
3944
|
fontSize: t.label,
|
|
4093
3945
|
color: this.streamData.rtmpUrl ? C2.text : C2.textDim,
|
|
4094
3946
|
uiTransform: { margin: { left: 6 } }
|
|
4095
3947
|
}
|
|
4096
|
-
)), /* @__PURE__ */
|
|
4097
|
-
|
|
3948
|
+
)), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "column", margin: { bottom: 6 } } }, /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: "Stream Key:", fontSize: t.labelSmall, color: C2.textDim }), /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
3949
|
+
import_react_ecs6.Label,
|
|
4098
3950
|
{
|
|
4099
3951
|
value: this.streamData.streamKey || "Loading...",
|
|
4100
3952
|
fontSize: t.label,
|
|
4101
3953
|
color: this.streamData.streamKey ? C2.cyan : C2.textDim,
|
|
4102
3954
|
uiTransform: { margin: { left: 6 } }
|
|
4103
3955
|
}
|
|
4104
|
-
)), /* @__PURE__ */
|
|
4105
|
-
|
|
3956
|
+
)), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "column", margin: { bottom: 10 } } }, /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: "HLS Playback:", fontSize: t.labelSmall, color: C2.textDim }), /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
3957
|
+
import_react_ecs6.Label,
|
|
4106
3958
|
{
|
|
4107
3959
|
value: this.streamData.locked === true ? LOCKED_LINE : this.streamData.hlsUrl || "Not available",
|
|
4108
3960
|
fontSize: t.label,
|
|
4109
3961
|
color: this.streamData.locked === true ? C2.yellow : this.streamData.hlsUrl ? C2.green : C2.textDim,
|
|
4110
3962
|
uiTransform: { margin: { left: 6 } }
|
|
4111
3963
|
}
|
|
4112
|
-
)), /* @__PURE__ */
|
|
4113
|
-
|
|
3964
|
+
)), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "row", flexWrap: "wrap", margin: { bottom: 6 } } }, !this.streamData.isLive && /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
3965
|
+
import_react_ecs6.Button,
|
|
4114
3966
|
{
|
|
4115
3967
|
uiTransform: { width: this.s(110), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
4116
3968
|
uiBackground: { color: this.streamControlling ? C2.btn : C2.green },
|
|
@@ -4119,8 +3971,8 @@ var AdminPanelUIModule = class {
|
|
|
4119
3971
|
color: C2.text,
|
|
4120
3972
|
onMouseDown: () => this.startStream()
|
|
4121
3973
|
}
|
|
4122
|
-
), this.streamData.isLive && /* @__PURE__ */
|
|
4123
|
-
|
|
3974
|
+
), this.streamData.isLive && /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
3975
|
+
import_react_ecs6.Button,
|
|
4124
3976
|
{
|
|
4125
3977
|
uiTransform: { width: this.s(110), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
4126
3978
|
uiBackground: { color: this.streamControlling ? C2.btn : C2.red },
|
|
@@ -4129,8 +3981,8 @@ var AdminPanelUIModule = class {
|
|
|
4129
3981
|
color: C2.text,
|
|
4130
3982
|
onMouseDown: () => this.stopStream()
|
|
4131
3983
|
}
|
|
4132
|
-
), this.streamData.isLive && (this.streamData.hlsUrl || this.streamData.locked === true) && /* @__PURE__ */
|
|
4133
|
-
|
|
3984
|
+
), this.streamData.isLive && (this.streamData.hlsUrl || this.streamData.locked === true) && /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
3985
|
+
import_react_ecs6.Button,
|
|
4134
3986
|
{
|
|
4135
3987
|
uiTransform: { width: this.s(100), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
4136
3988
|
uiBackground: { color: C2.cyan },
|
|
@@ -4139,8 +3991,8 @@ var AdminPanelUIModule = class {
|
|
|
4139
3991
|
color: C2.text,
|
|
4140
3992
|
onMouseDown: () => this.playStreamOnScreen()
|
|
4141
3993
|
}
|
|
4142
|
-
)), /* @__PURE__ */
|
|
4143
|
-
|
|
3994
|
+
)), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "row", flexWrap: "wrap", margin: { bottom: 6 } } }, /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
3995
|
+
import_react_ecs6.Button,
|
|
4144
3996
|
{
|
|
4145
3997
|
uiTransform: { width: this.s(80), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
4146
3998
|
uiBackground: { color: C2.btn },
|
|
@@ -4149,8 +4001,8 @@ var AdminPanelUIModule = class {
|
|
|
4149
4001
|
color: C2.text,
|
|
4150
4002
|
onMouseDown: () => this.refreshStreamStatus()
|
|
4151
4003
|
}
|
|
4152
|
-
), /* @__PURE__ */
|
|
4153
|
-
|
|
4004
|
+
), /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4005
|
+
import_react_ecs6.Button,
|
|
4154
4006
|
{
|
|
4155
4007
|
uiTransform: { width: this.s(95), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
4156
4008
|
uiBackground: { color: this.keyRotating ? C2.btn : C2.yellow },
|
|
@@ -4159,8 +4011,8 @@ var AdminPanelUIModule = class {
|
|
|
4159
4011
|
color: C2.text,
|
|
4160
4012
|
onMouseDown: () => this.rotateStreamKey()
|
|
4161
4013
|
}
|
|
4162
|
-
), !this.streamData.isLive && !this.channelDeleteLook && /* @__PURE__ */
|
|
4163
|
-
|
|
4014
|
+
), !this.streamData.isLive && !this.channelDeleteLook && /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4015
|
+
import_react_ecs6.Button,
|
|
4164
4016
|
{
|
|
4165
4017
|
uiTransform: { width: this.s(70), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
4166
4018
|
uiBackground: { color: this.channelDeleting ? C2.btn : C2.red },
|
|
@@ -4169,8 +4021,8 @@ var AdminPanelUIModule = class {
|
|
|
4169
4021
|
color: C2.text,
|
|
4170
4022
|
onMouseDown: () => this.deleteChannel()
|
|
4171
4023
|
}
|
|
4172
|
-
)), !this.streamData.isLive && this.channelDeleteLook && /* @__PURE__ */
|
|
4173
|
-
|
|
4024
|
+
)), !this.streamData.isLive && this.channelDeleteLook && /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "column", margin: { bottom: 6 }, padding: 6 }, uiBackground: { color: C2.section } }, /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: "DELETE THIS CHANNEL?", fontSize: t.labelSmall, color: C2.red, uiTransform: { height: this.s(18) } }), channelDeleteLines(this.channelDeleteLook, this.channelDeleteChanged).map((line, i) => /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { key: `delete-line-${i}`, value: line, fontSize: t.status, color: line.startsWith("WHAT") ? C2.yellow : C2.text, uiTransform: { height: this.s(18) } })), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "row", margin: { top: 4 } } }, /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4025
|
+
import_react_ecs6.Button,
|
|
4174
4026
|
{
|
|
4175
4027
|
uiTransform: { width: this.s(120), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
4176
4028
|
uiBackground: { color: this.channelDeleting ? C2.btn : C2.red },
|
|
@@ -4179,8 +4031,8 @@ var AdminPanelUIModule = class {
|
|
|
4179
4031
|
color: C2.text,
|
|
4180
4032
|
onMouseDown: () => this.confirmDeleteChannel()
|
|
4181
4033
|
}
|
|
4182
|
-
), /* @__PURE__ */
|
|
4183
|
-
|
|
4034
|
+
), /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4035
|
+
import_react_ecs6.Button,
|
|
4184
4036
|
{
|
|
4185
4037
|
uiTransform: { width: this.s(70), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
4186
4038
|
uiBackground: { color: C2.btn },
|
|
@@ -4189,8 +4041,8 @@ var AdminPanelUIModule = class {
|
|
|
4189
4041
|
color: C2.text,
|
|
4190
4042
|
onMouseDown: () => this.cancelDeleteChannel()
|
|
4191
4043
|
}
|
|
4192
|
-
))), this.streamControlStatus === "started" && /* @__PURE__ */
|
|
4193
|
-
|
|
4044
|
+
))), this.streamControlStatus === "started" && /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: "Stream started - begin broadcasting in OBS", fontSize: t.status, color: C2.green }), this.streamControlStatus === "stopped" && /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: "Stream stopped", fontSize: t.status, color: C2.textDim }), this.keyRotateStatus === "success" && /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: "Key rotated! Update OBS", fontSize: t.status, color: C2.green }), this.keyRotateStatus === "error" && /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: "Failed to rotate key", fontSize: t.status, color: C2.red }), this.channelDeleteError && /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: this.channelDeleteError, fontSize: t.status, color: C2.red }), this.streamControlStatus === "error" && /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: "Stream control failed", fontSize: t.status, color: C2.red })), /* @__PURE__ */ import_react_ecs6.default.createElement(this.SectionHead, { label: "PLAY NOW", color: C2.orange }), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "row", alignItems: "center", margin: { bottom: 14 } } }, /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4045
|
+
import_react_ecs6.Input,
|
|
4194
4046
|
{
|
|
4195
4047
|
uiTransform: { width: this.s(230), height: this.s(UI_DIMENSIONS.admin.inputHeight) },
|
|
4196
4048
|
uiBackground: { color: import_math7.Color4.create(0.15, 0.15, 0.2, 1) },
|
|
@@ -4203,8 +4055,8 @@ var AdminPanelUIModule = class {
|
|
|
4203
4055
|
this.customVideoUrl = val;
|
|
4204
4056
|
}
|
|
4205
4057
|
}
|
|
4206
|
-
), /* @__PURE__ */
|
|
4207
|
-
|
|
4058
|
+
), /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4059
|
+
import_react_ecs6.Button,
|
|
4208
4060
|
{
|
|
4209
4061
|
uiTransform: { width: this.s(75), height: this.s(UI_DIMENSIONS.admin.inputHeight), margin: { left: 8 } },
|
|
4210
4062
|
uiBackground: { color: C2.green },
|
|
@@ -4213,8 +4065,8 @@ var AdminPanelUIModule = class {
|
|
|
4213
4065
|
color: C2.text,
|
|
4214
4066
|
onMouseDown: () => this.playNow()
|
|
4215
4067
|
}
|
|
4216
|
-
), /* @__PURE__ */
|
|
4217
|
-
|
|
4068
|
+
), /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4069
|
+
import_react_ecs6.Button,
|
|
4218
4070
|
{
|
|
4219
4071
|
uiTransform: { width: this.s(65), height: this.s(UI_DIMENSIONS.admin.inputHeight), margin: { left: 6 } },
|
|
4220
4072
|
uiBackground: { color: C2.btn },
|
|
@@ -4225,16 +4077,16 @@ var AdminPanelUIModule = class {
|
|
|
4225
4077
|
this.customVideoUrl = "";
|
|
4226
4078
|
}
|
|
4227
4079
|
}
|
|
4228
|
-
)), this.videoStatus && /* @__PURE__ */
|
|
4229
|
-
|
|
4080
|
+
)), this.videoStatus && /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4081
|
+
import_react_ecs6.Label,
|
|
4230
4082
|
{
|
|
4231
4083
|
value: this.videoStatus,
|
|
4232
4084
|
fontSize: t.status,
|
|
4233
4085
|
color: this.videoStatus.startsWith("Not sent") || this.videoStatus === LOCKED_LINE || this.videoStatus === UNAVAILABLE_LINE ? C2.red : C2.green,
|
|
4234
4086
|
uiTransform: { height: this.s(18), margin: { bottom: 6 } }
|
|
4235
4087
|
}
|
|
4236
|
-
), /* @__PURE__ */
|
|
4237
|
-
|
|
4088
|
+
), /* @__PURE__ */ import_react_ecs6.default.createElement(this.SectionHead, { label: "PLAYBACK", color: C2.green }), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "row", flexWrap: "wrap", margin: { bottom: 14 } } }, /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4089
|
+
import_react_ecs6.Button,
|
|
4238
4090
|
{
|
|
4239
4091
|
uiTransform: { width: this.s(75), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
4240
4092
|
uiBackground: { color: C2.green },
|
|
@@ -4243,8 +4095,8 @@ var AdminPanelUIModule = class {
|
|
|
4243
4095
|
color: C2.text,
|
|
4244
4096
|
onMouseDown: () => this.playbackPlay()
|
|
4245
4097
|
}
|
|
4246
|
-
), /* @__PURE__ */
|
|
4247
|
-
|
|
4098
|
+
), /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4099
|
+
import_react_ecs6.Button,
|
|
4248
4100
|
{
|
|
4249
4101
|
uiTransform: { width: this.s(75), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
4250
4102
|
uiBackground: { color: C2.red },
|
|
@@ -4253,8 +4105,8 @@ var AdminPanelUIModule = class {
|
|
|
4253
4105
|
color: C2.text,
|
|
4254
4106
|
onMouseDown: () => this.playbackStop()
|
|
4255
4107
|
}
|
|
4256
|
-
), /* @__PURE__ */
|
|
4257
|
-
|
|
4108
|
+
), /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4109
|
+
import_react_ecs6.Button,
|
|
4258
4110
|
{
|
|
4259
4111
|
uiTransform: { width: this.s(100), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
4260
4112
|
uiBackground: { color: C2.btn },
|
|
@@ -4263,8 +4115,8 @@ var AdminPanelUIModule = class {
|
|
|
4263
4115
|
color: C2.text,
|
|
4264
4116
|
onMouseDown: () => this.resetDefault()
|
|
4265
4117
|
}
|
|
4266
|
-
)), /* @__PURE__ */
|
|
4267
|
-
|
|
4118
|
+
)), /* @__PURE__ */ import_react_ecs6.default.createElement(this.SectionHead, { label: "VIDEO SLOTS", color: C2.cyan }), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "row", flexWrap: "wrap", margin: { bottom: 10 } } }, ["slot1", "slot2", "slot3", "slot4", "slot5"].map((slot, i) => /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4119
|
+
import_react_ecs6.Button,
|
|
4268
4120
|
{
|
|
4269
4121
|
key: `play-${slot}`,
|
|
4270
4122
|
uiTransform: { width: this.s(70), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4274,8 +4126,8 @@ var AdminPanelUIModule = class {
|
|
|
4274
4126
|
color: C2.text,
|
|
4275
4127
|
onMouseDown: () => this.pressSlot(slot)
|
|
4276
4128
|
}
|
|
4277
|
-
))), /* @__PURE__ */
|
|
4278
|
-
|
|
4129
|
+
))), /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4130
|
+
import_react_ecs6.Button,
|
|
4279
4131
|
{
|
|
4280
4132
|
uiTransform: { height: this.s(24) },
|
|
4281
4133
|
uiBackground: { color: import_math7.Color4.create(0, 0, 0, 0) },
|
|
@@ -4288,16 +4140,16 @@ var AdminPanelUIModule = class {
|
|
|
4288
4140
|
};
|
|
4289
4141
|
this.ModTab = () => {
|
|
4290
4142
|
const t = this.theme;
|
|
4291
|
-
return /* @__PURE__ */
|
|
4292
|
-
|
|
4143
|
+
return /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "column", width: "100%", padding: 10 } }, this.modStatus === "loading" && /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: "Loading...", fontSize: t.status, color: C2.yellow }), this.modStatus === "saved" && /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: "Saved!", fontSize: t.status, color: C2.green }), this.modStatus === "error" && /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: "Error - check input", fontSize: t.status, color: C2.red }), this.kickStatus && /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4144
|
+
import_react_ecs6.Label,
|
|
4293
4145
|
{
|
|
4294
4146
|
value: this.kickStatus,
|
|
4295
4147
|
fontSize: t.status,
|
|
4296
4148
|
color: this.kickStatus.startsWith("Kick not sent") ? C2.red : C2.green,
|
|
4297
4149
|
uiTransform: { height: this.s(18) }
|
|
4298
4150
|
}
|
|
4299
|
-
), /* @__PURE__ */
|
|
4300
|
-
|
|
4151
|
+
), /* @__PURE__ */ import_react_ecs6.default.createElement(this.SectionHead, { label: "BROADCAST", color: C2.orange }), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "row", alignItems: "center", margin: { bottom: 14 } } }, /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4152
|
+
import_react_ecs6.Input,
|
|
4301
4153
|
{
|
|
4302
4154
|
uiTransform: { width: this.s(230), height: this.s(UI_DIMENSIONS.admin.inputHeight) },
|
|
4303
4155
|
uiBackground: { color: import_math7.Color4.create(0.15, 0.15, 0.2, 1) },
|
|
@@ -4310,8 +4162,8 @@ var AdminPanelUIModule = class {
|
|
|
4310
4162
|
this.broadcastText = val;
|
|
4311
4163
|
}
|
|
4312
4164
|
}
|
|
4313
|
-
), /* @__PURE__ */
|
|
4314
|
-
|
|
4165
|
+
), /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4166
|
+
import_react_ecs6.Button,
|
|
4315
4167
|
{
|
|
4316
4168
|
uiTransform: { width: this.s(65), height: this.s(UI_DIMENSIONS.admin.inputHeight), margin: { left: 8 } },
|
|
4317
4169
|
uiBackground: { color: C2.orange },
|
|
@@ -4320,16 +4172,16 @@ var AdminPanelUIModule = class {
|
|
|
4320
4172
|
color: C2.text,
|
|
4321
4173
|
onMouseDown: () => this.sendBroadcast()
|
|
4322
4174
|
}
|
|
4323
|
-
)), this.broadcastStatus && /* @__PURE__ */
|
|
4324
|
-
|
|
4175
|
+
)), this.broadcastStatus && /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4176
|
+
import_react_ecs6.Label,
|
|
4325
4177
|
{
|
|
4326
4178
|
value: this.broadcastStatus,
|
|
4327
4179
|
fontSize: t.status,
|
|
4328
4180
|
color: this.broadcastStatus.startsWith("Not sent") ? C2.red : C2.green,
|
|
4329
4181
|
uiTransform: { height: this.s(18), margin: { bottom: 6 } }
|
|
4330
4182
|
}
|
|
4331
|
-
), /* @__PURE__ */
|
|
4332
|
-
|
|
4183
|
+
), /* @__PURE__ */ import_react_ecs6.default.createElement(this.SectionHead, { label: "CHAOS MODE", color: C2.red }), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "row", flexWrap: "wrap", margin: { bottom: 14 } } }, /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4184
|
+
import_react_ecs6.Button,
|
|
4333
4185
|
{
|
|
4334
4186
|
uiTransform: { width: this.s(130), height: this.s(UI_DIMENSIONS.admin.buttonHeight), margin: 4 },
|
|
4335
4187
|
uiBackground: { color: C2.red },
|
|
@@ -4338,8 +4190,8 @@ var AdminPanelUIModule = class {
|
|
|
4338
4190
|
color: C2.text,
|
|
4339
4191
|
onMouseDown: () => this.kickAll()
|
|
4340
4192
|
}
|
|
4341
|
-
)), this.venue && /* @__PURE__ */
|
|
4342
|
-
|
|
4193
|
+
)), this.venue && /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "column", margin: { bottom: 14 } } }, /* @__PURE__ */ import_react_ecs6.default.createElement(this.SectionHead, { label: "PRIVATE MODE", color: C2.yellow }), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: "While ON, only citizens get in", fontSize: t.labelSmall, color: C2.textDim, uiTransform: { height: this.s(18), margin: { bottom: 4 } } }), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "row", flexWrap: "wrap" } }, [true, false].map((on) => /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4194
|
+
import_react_ecs6.Button,
|
|
4343
4195
|
{
|
|
4344
4196
|
key: `private-${on ? "on" : "off"}`,
|
|
4345
4197
|
uiTransform: { width: this.s(70), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4 },
|
|
@@ -4349,22 +4201,22 @@ var AdminPanelUIModule = class {
|
|
|
4349
4201
|
color: this.privateModeOn === on ? import_math7.Color4.Black() : C2.text,
|
|
4350
4202
|
onMouseDown: () => this.setPrivateMode(on)
|
|
4351
4203
|
}
|
|
4352
|
-
))), this.privateStatus && /* @__PURE__ */
|
|
4353
|
-
|
|
4204
|
+
))), this.privateStatus && /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4205
|
+
import_react_ecs6.Label,
|
|
4354
4206
|
{
|
|
4355
4207
|
value: this.privateStatus,
|
|
4356
4208
|
fontSize: t.status,
|
|
4357
4209
|
color: this.privateStatus.startsWith("Not sent") ? C2.red : C2.green,
|
|
4358
4210
|
uiTransform: { height: this.s(18) }
|
|
4359
4211
|
}
|
|
4360
|
-
)), /* @__PURE__ */
|
|
4361
|
-
|
|
4212
|
+
)), /* @__PURE__ */ import_react_ecs6.default.createElement(this.SectionHead, { label: "SCENE ADMINS", color: C2.purple }), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "column", margin: { bottom: 6 } } }, this.sceneAdmins.length === 0 && this.modStatus !== "loading" && /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: "No scene admins", fontSize: t.labelSmall, color: C2.textDim }), this.sceneAdmins.map((wallet, i) => /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4213
|
+
import_react_ecs6.UiEntity,
|
|
4362
4214
|
{
|
|
4363
4215
|
key: `admin-${i}`,
|
|
4364
4216
|
uiTransform: { flexDirection: "row", alignItems: "center", margin: { bottom: 5 }, width: "100%" }
|
|
4365
4217
|
},
|
|
4366
|
-
/* @__PURE__ */
|
|
4367
|
-
|
|
4218
|
+
/* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4219
|
+
import_react_ecs6.Label,
|
|
4368
4220
|
{
|
|
4369
4221
|
value: `${wallet.slice(0, 6)}...${wallet.slice(-4)}`,
|
|
4370
4222
|
fontSize: t.label,
|
|
@@ -4372,8 +4224,8 @@ var AdminPanelUIModule = class {
|
|
|
4372
4224
|
uiTransform: { width: this.s(130) }
|
|
4373
4225
|
}
|
|
4374
4226
|
),
|
|
4375
|
-
/* @__PURE__ */
|
|
4376
|
-
|
|
4227
|
+
/* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4228
|
+
import_react_ecs6.Button,
|
|
4377
4229
|
{
|
|
4378
4230
|
uiTransform: { width: this.s(70), height: this.s(28), margin: { left: 8 } },
|
|
4379
4231
|
uiBackground: { color: C2.btn },
|
|
@@ -4383,8 +4235,8 @@ var AdminPanelUIModule = class {
|
|
|
4383
4235
|
onMouseDown: () => this.removeSceneAdmin(wallet)
|
|
4384
4236
|
}
|
|
4385
4237
|
)
|
|
4386
|
-
))), /* @__PURE__ */
|
|
4387
|
-
|
|
4238
|
+
))), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "row", alignItems: "center", margin: { bottom: 14 } } }, /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4239
|
+
import_react_ecs6.Input,
|
|
4388
4240
|
{
|
|
4389
4241
|
uiTransform: { width: this.s(230), height: this.s(UI_DIMENSIONS.admin.inputHeight) },
|
|
4390
4242
|
uiBackground: { color: import_math7.Color4.create(0.15, 0.15, 0.2, 1) },
|
|
@@ -4397,8 +4249,8 @@ var AdminPanelUIModule = class {
|
|
|
4397
4249
|
this.newAdminWallet = val;
|
|
4398
4250
|
}
|
|
4399
4251
|
}
|
|
4400
|
-
), /* @__PURE__ */
|
|
4401
|
-
|
|
4252
|
+
), /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4253
|
+
import_react_ecs6.Button,
|
|
4402
4254
|
{
|
|
4403
4255
|
uiTransform: { width: this.s(60), height: this.s(UI_DIMENSIONS.admin.inputHeight), margin: { left: 8 } },
|
|
4404
4256
|
uiBackground: { color: C2.purple },
|
|
@@ -4409,14 +4261,14 @@ var AdminPanelUIModule = class {
|
|
|
4409
4261
|
if (this.newAdminWallet) this.addSceneAdmin(this.newAdminWallet);
|
|
4410
4262
|
}
|
|
4411
4263
|
}
|
|
4412
|
-
)), /* @__PURE__ */
|
|
4413
|
-
|
|
4264
|
+
)), /* @__PURE__ */ import_react_ecs6.default.createElement(this.SectionHead, { label: "BANNED WALLETS", color: C2.red }), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "column", margin: { bottom: 6 } } }, this.bannedWallets.length === 0 && this.modStatus !== "loading" && /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: "No banned wallets", fontSize: t.labelSmall, color: C2.textDim }), this.bannedWallets.map((wallet, i) => /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4265
|
+
import_react_ecs6.UiEntity,
|
|
4414
4266
|
{
|
|
4415
4267
|
key: `ban-${i}`,
|
|
4416
4268
|
uiTransform: { flexDirection: "row", alignItems: "center", margin: { bottom: 5 }, width: "100%" }
|
|
4417
4269
|
},
|
|
4418
|
-
/* @__PURE__ */
|
|
4419
|
-
|
|
4270
|
+
/* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4271
|
+
import_react_ecs6.Label,
|
|
4420
4272
|
{
|
|
4421
4273
|
value: `${wallet.slice(0, 6)}...${wallet.slice(-4)}`,
|
|
4422
4274
|
fontSize: t.label,
|
|
@@ -4424,8 +4276,8 @@ var AdminPanelUIModule = class {
|
|
|
4424
4276
|
uiTransform: { width: this.s(130) }
|
|
4425
4277
|
}
|
|
4426
4278
|
),
|
|
4427
|
-
/* @__PURE__ */
|
|
4428
|
-
|
|
4279
|
+
/* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4280
|
+
import_react_ecs6.Button,
|
|
4429
4281
|
{
|
|
4430
4282
|
uiTransform: { width: this.s(70), height: this.s(28), margin: { left: 8 } },
|
|
4431
4283
|
uiBackground: { color: C2.green },
|
|
@@ -4435,8 +4287,8 @@ var AdminPanelUIModule = class {
|
|
|
4435
4287
|
onMouseDown: () => this.unbanWallet(wallet)
|
|
4436
4288
|
}
|
|
4437
4289
|
)
|
|
4438
|
-
))), /* @__PURE__ */
|
|
4439
|
-
|
|
4290
|
+
))), /* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { flexDirection: "row", alignItems: "center", margin: { bottom: 10 } } }, /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4291
|
+
import_react_ecs6.Input,
|
|
4440
4292
|
{
|
|
4441
4293
|
uiTransform: { width: this.s(230), height: this.s(UI_DIMENSIONS.admin.inputHeight) },
|
|
4442
4294
|
uiBackground: { color: import_math7.Color4.create(0.15, 0.15, 0.2, 1) },
|
|
@@ -4449,8 +4301,8 @@ var AdminPanelUIModule = class {
|
|
|
4449
4301
|
this.newBanWallet = val;
|
|
4450
4302
|
}
|
|
4451
4303
|
}
|
|
4452
|
-
), /* @__PURE__ */
|
|
4453
|
-
|
|
4304
|
+
), /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4305
|
+
import_react_ecs6.Button,
|
|
4454
4306
|
{
|
|
4455
4307
|
uiTransform: { width: this.s(60), height: this.s(UI_DIMENSIONS.admin.inputHeight), margin: { left: 8 } },
|
|
4456
4308
|
uiBackground: { color: C2.red },
|
|
@@ -4461,8 +4313,8 @@ var AdminPanelUIModule = class {
|
|
|
4461
4313
|
if (this.newBanWallet) this.banWallet(this.newBanWallet);
|
|
4462
4314
|
}
|
|
4463
4315
|
}
|
|
4464
|
-
)), /* @__PURE__ */
|
|
4465
|
-
|
|
4316
|
+
)), /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4317
|
+
import_react_ecs6.Button,
|
|
4466
4318
|
{
|
|
4467
4319
|
uiTransform: { height: this.s(24) },
|
|
4468
4320
|
uiBackground: { color: import_math7.Color4.create(0, 0, 0, 0) },
|
|
@@ -4508,8 +4360,8 @@ var AdminPanelUIModule = class {
|
|
|
4508
4360
|
if (!tabs.find((tab) => tab.id === this.activeTab) && tabs.length > 0) {
|
|
4509
4361
|
this.activeTab = tabs[0].id;
|
|
4510
4362
|
}
|
|
4511
|
-
return /* @__PURE__ */
|
|
4512
|
-
|
|
4363
|
+
return /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4364
|
+
import_react_ecs6.UiEntity,
|
|
4513
4365
|
{
|
|
4514
4366
|
uiTransform: {
|
|
4515
4367
|
width: "100%",
|
|
@@ -4518,16 +4370,13 @@ var AdminPanelUIModule = class {
|
|
|
4518
4370
|
}
|
|
4519
4371
|
},
|
|
4520
4372
|
this.renderScaledNotification(),
|
|
4521
|
-
this.client.
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
},
|
|
4529
|
-
this.renderToggleFace()
|
|
4530
|
-
),
|
|
4373
|
+
this.client.toolbarButton(2, {
|
|
4374
|
+
uiBackground: { color: C2.header },
|
|
4375
|
+
icon: "admin",
|
|
4376
|
+
tag: "ADMIN",
|
|
4377
|
+
open: this.panelOpen,
|
|
4378
|
+
onMouseDown: () => this.toggle()
|
|
4379
|
+
}),
|
|
4531
4380
|
this.panelOpen && this.client.toolbarPanel({
|
|
4532
4381
|
key: `admin-panel-${this.client.uiScale}`,
|
|
4533
4382
|
uiTransform: {
|
|
@@ -4541,8 +4390,8 @@ var AdminPanelUIModule = class {
|
|
|
4541
4390
|
uiBackground: { color: C2.bg },
|
|
4542
4391
|
children: [
|
|
4543
4392
|
// Header with font controls
|
|
4544
|
-
/* @__PURE__ */
|
|
4545
|
-
|
|
4393
|
+
/* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4394
|
+
import_react_ecs6.UiEntity,
|
|
4546
4395
|
{
|
|
4547
4396
|
uiTransform: {
|
|
4548
4397
|
width: "100%",
|
|
@@ -4554,9 +4403,9 @@ var AdminPanelUIModule = class {
|
|
|
4554
4403
|
},
|
|
4555
4404
|
uiBackground: { color: C2.header }
|
|
4556
4405
|
},
|
|
4557
|
-
/* @__PURE__ */
|
|
4558
|
-
/* @__PURE__ */
|
|
4559
|
-
|
|
4406
|
+
/* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.Label, { value: this.config.title || "ADMIN PANEL", fontSize: t.header, color: C2.text }),
|
|
4407
|
+
/* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4408
|
+
import_react_ecs6.Button,
|
|
4560
4409
|
{
|
|
4561
4410
|
uiTransform: { width: this.s(28), height: this.s(28) },
|
|
4562
4411
|
uiBackground: { color: import_math7.Color4.create(0, 0, 0, 0.3) },
|
|
@@ -4568,10 +4417,10 @@ var AdminPanelUIModule = class {
|
|
|
4568
4417
|
)
|
|
4569
4418
|
),
|
|
4570
4419
|
// Tabs
|
|
4571
|
-
/* @__PURE__ */
|
|
4420
|
+
/* @__PURE__ */ import_react_ecs6.default.createElement(import_react_ecs6.UiEntity, { uiTransform: { width: "100%", height: this.s(UI_DIMENSIONS.admin.tabHeight), flexDirection: "row" } }, tabs.map((tab) => /* @__PURE__ */ import_react_ecs6.default.createElement(this.TabBtn, { label: tab.label, tab: tab.id }))),
|
|
4572
4421
|
// Content
|
|
4573
|
-
/* @__PURE__ */
|
|
4574
|
-
|
|
4422
|
+
/* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4423
|
+
import_react_ecs6.UiEntity,
|
|
4575
4424
|
{
|
|
4576
4425
|
uiTransform: {
|
|
4577
4426
|
width: "100%",
|
|
@@ -4580,14 +4429,14 @@ var AdminPanelUIModule = class {
|
|
|
4580
4429
|
flexDirection: "column"
|
|
4581
4430
|
}
|
|
4582
4431
|
},
|
|
4583
|
-
this.activeTab === "controls" && this.venue && this.controls.length > 0 && /* @__PURE__ */
|
|
4584
|
-
this.activeTab === "video" && /* @__PURE__ */
|
|
4585
|
-
this.activeTab === "mod" && this.isOwner && /* @__PURE__ */
|
|
4432
|
+
this.activeTab === "controls" && this.venue && this.controls.length > 0 && /* @__PURE__ */ import_react_ecs6.default.createElement(this.ControlsTab, null),
|
|
4433
|
+
this.activeTab === "video" && /* @__PURE__ */ import_react_ecs6.default.createElement(this.VideoTab, null),
|
|
4434
|
+
this.activeTab === "mod" && this.isOwner && /* @__PURE__ */ import_react_ecs6.default.createElement(this.ModTab, null),
|
|
4586
4435
|
this.config.sceneTabs?.map((tab) => this.activeTab === tab.id && tab.render())
|
|
4587
4436
|
),
|
|
4588
4437
|
// Footer
|
|
4589
|
-
/* @__PURE__ */
|
|
4590
|
-
|
|
4438
|
+
/* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4439
|
+
import_react_ecs6.UiEntity,
|
|
4591
4440
|
{
|
|
4592
4441
|
uiTransform: {
|
|
4593
4442
|
width: "100%",
|
|
@@ -4597,8 +4446,8 @@ var AdminPanelUIModule = class {
|
|
|
4597
4446
|
},
|
|
4598
4447
|
uiBackground: { color: C2.section }
|
|
4599
4448
|
},
|
|
4600
|
-
/* @__PURE__ */
|
|
4601
|
-
|
|
4449
|
+
/* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
4450
|
+
import_react_ecs6.Button,
|
|
4602
4451
|
{
|
|
4603
4452
|
uiTransform: { height: this.s(24) },
|
|
4604
4453
|
uiBackground: { color: import_math7.Color4.create(0, 0, 0, 0) },
|
|
@@ -5766,8 +5615,8 @@ var AdminPanelUIModule = class {
|
|
|
5766
5615
|
/** A control's button (2026-11-18): the option's label, highlighted while that option is current on this copy */
|
|
5767
5616
|
controlButton(control, option, label) {
|
|
5768
5617
|
const current = this.currentOption[control.id] === option;
|
|
5769
|
-
return /* @__PURE__ */
|
|
5770
|
-
|
|
5618
|
+
return /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
5619
|
+
import_react_ecs6.Button,
|
|
5771
5620
|
{
|
|
5772
5621
|
key: `control-${control.id}-${option}`,
|
|
5773
5622
|
uiTransform: { minWidth: this.s(70), height: this.s(UI_DIMENSIONS.admin.buttonHeightSmall), margin: 4, padding: { left: 10, right: 10 } },
|
|
@@ -5789,8 +5638,8 @@ var AdminPanelUIModule = class {
|
|
|
5789
5638
|
if (!state.visible) return null;
|
|
5790
5639
|
const N2 = UI_DIMENSIONS.notification;
|
|
5791
5640
|
const colors = THEME.colors;
|
|
5792
|
-
return /* @__PURE__ */
|
|
5793
|
-
|
|
5641
|
+
return /* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
5642
|
+
import_react_ecs6.UiEntity,
|
|
5794
5643
|
{
|
|
5795
5644
|
uiTransform: {
|
|
5796
5645
|
positionType: "absolute",
|
|
@@ -5800,8 +5649,8 @@ var AdminPanelUIModule = class {
|
|
|
5800
5649
|
alignItems: "center"
|
|
5801
5650
|
}
|
|
5802
5651
|
},
|
|
5803
|
-
/* @__PURE__ */
|
|
5804
|
-
|
|
5652
|
+
/* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
5653
|
+
import_react_ecs6.UiEntity,
|
|
5805
5654
|
{
|
|
5806
5655
|
uiTransform: {
|
|
5807
5656
|
minWidth: this.s(200),
|
|
@@ -5813,15 +5662,15 @@ var AdminPanelUIModule = class {
|
|
|
5813
5662
|
},
|
|
5814
5663
|
uiBackground: { color: colors.panel }
|
|
5815
5664
|
},
|
|
5816
|
-
/* @__PURE__ */
|
|
5817
|
-
|
|
5665
|
+
/* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
5666
|
+
import_react_ecs6.UiEntity,
|
|
5818
5667
|
{
|
|
5819
5668
|
uiTransform: { width: N2.borderWidth, height: "100%" },
|
|
5820
5669
|
uiBackground: { color: colors.cyan }
|
|
5821
5670
|
}
|
|
5822
5671
|
),
|
|
5823
|
-
/* @__PURE__ */
|
|
5824
|
-
|
|
5672
|
+
/* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
5673
|
+
import_react_ecs6.UiEntity,
|
|
5825
5674
|
{
|
|
5826
5675
|
uiTransform: {
|
|
5827
5676
|
flexGrow: 1,
|
|
@@ -5831,8 +5680,8 @@ var AdminPanelUIModule = class {
|
|
|
5831
5680
|
alignItems: "center"
|
|
5832
5681
|
}
|
|
5833
5682
|
},
|
|
5834
|
-
/* @__PURE__ */
|
|
5835
|
-
|
|
5683
|
+
/* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
5684
|
+
import_react_ecs6.Label,
|
|
5836
5685
|
{
|
|
5837
5686
|
value: state.text,
|
|
5838
5687
|
fontSize: this.s(N2.fontSize),
|
|
@@ -5841,8 +5690,8 @@ var AdminPanelUIModule = class {
|
|
|
5841
5690
|
}
|
|
5842
5691
|
)
|
|
5843
5692
|
),
|
|
5844
|
-
/* @__PURE__ */
|
|
5845
|
-
|
|
5693
|
+
/* @__PURE__ */ import_react_ecs6.default.createElement(
|
|
5694
|
+
import_react_ecs6.UiEntity,
|
|
5846
5695
|
{
|
|
5847
5696
|
uiTransform: { width: 5, height: 5, margin: { right: 10 } },
|
|
5848
5697
|
uiBackground: { color: colors.cyan }
|
|
@@ -5851,29 +5700,313 @@ var AdminPanelUIModule = class {
|
|
|
5851
5700
|
)
|
|
5852
5701
|
);
|
|
5853
5702
|
}
|
|
5854
|
-
/** The ADMIN / CLOSE button itself; its place is the row's or, on a phone, the column's (2.12.0) */
|
|
5855
|
-
renderToggleFace() {
|
|
5856
|
-
return /* @__PURE__ */ import_react_ecs7.default.createElement(
|
|
5857
|
-
import_react_ecs7.Button,
|
|
5858
|
-
{
|
|
5859
|
-
uiTransform: { width: this.s(100), height: this.s(45) },
|
|
5860
|
-
uiBackground: { color: this.panelOpen ? C2.btn : C2.header },
|
|
5861
|
-
value: this.panelOpen ? "CLOSE" : "ADMIN",
|
|
5862
|
-
fontSize: this.s(14),
|
|
5863
|
-
color: C2.text,
|
|
5864
|
-
onMouseDown: () => this.toggle()
|
|
5865
|
-
}
|
|
5866
|
-
);
|
|
5867
|
-
}
|
|
5868
5703
|
};
|
|
5869
5704
|
|
|
5870
5705
|
// src/StaticTVClient.ts
|
|
5871
5706
|
var import_Runtime2 = require("~system/Runtime");
|
|
5872
5707
|
|
|
5708
|
+
// src/ui/toolbar.ts
|
|
5709
|
+
var CIRCLE = {
|
|
5710
|
+
phone: { diameter: 72, ring: 4, icon: 36, tagFont: 12, tag: 16, gap: 12, badge: 22 },
|
|
5711
|
+
desktop: { diameter: 52, ring: 3, icon: 26, tagFont: 11, tag: 14, gap: 12, badge: 18 }
|
|
5712
|
+
};
|
|
5713
|
+
var PHONE_EDGE = 0;
|
|
5714
|
+
var DESK_EDGE = 20;
|
|
5715
|
+
var DESK_BOTTOM = 10;
|
|
5716
|
+
var PANEL_GAP = 10;
|
|
5717
|
+
function platformOf(answer) {
|
|
5718
|
+
const raw = answer?.platform;
|
|
5719
|
+
if (typeof raw !== "string") return "unknown";
|
|
5720
|
+
const p = raw.trim().toLowerCase();
|
|
5721
|
+
return p === "desktop" || p === "mobile" || p === "vr" || p === "web" ? p : "unknown";
|
|
5722
|
+
}
|
|
5723
|
+
function isPhonePlatform(platform) {
|
|
5724
|
+
return platform === "mobile";
|
|
5725
|
+
}
|
|
5726
|
+
var scaled = (value, uiScale) => Math.round(value * uiScale);
|
|
5727
|
+
function circleSize(phone, uiScale = 1) {
|
|
5728
|
+
const c = phone ? CIRCLE.phone : CIRCLE.desktop;
|
|
5729
|
+
return {
|
|
5730
|
+
diameter: scaled(c.diameter, uiScale),
|
|
5731
|
+
ring: Math.max(1, scaled(c.ring, uiScale)),
|
|
5732
|
+
icon: scaled(c.icon, uiScale),
|
|
5733
|
+
tagFont: scaled(c.tagFont, uiScale),
|
|
5734
|
+
tag: scaled(c.tag, uiScale),
|
|
5735
|
+
gap: c.gap,
|
|
5736
|
+
badge: scaled(c.badge, uiScale)
|
|
5737
|
+
};
|
|
5738
|
+
}
|
|
5739
|
+
function rowRight(slot, uiScale = 1) {
|
|
5740
|
+
const c = circleSize(false, uiScale);
|
|
5741
|
+
return DESK_EDGE + slot * (c.diameter + c.gap);
|
|
5742
|
+
}
|
|
5743
|
+
function columnSlot(slot, lastSlot, uiScale = 1) {
|
|
5744
|
+
const c = circleSize(true, uiScale);
|
|
5745
|
+
const step = c.diameter + c.tag + c.gap;
|
|
5746
|
+
const rows = Math.max(lastSlot, slot, 0) + 2;
|
|
5747
|
+
return { right: PHONE_EDGE, width: c.diameter, boxHeight: rows * step - c.gap, above: (Math.max(0, slot) + 1) * step };
|
|
5748
|
+
}
|
|
5749
|
+
function handlePlace(phone, lastSlot, uiScale = 1) {
|
|
5750
|
+
const c = circleSize(phone, uiScale);
|
|
5751
|
+
if (phone) {
|
|
5752
|
+
return { right: PHONE_EDGE, width: c.diameter, height: c.diameter, boxHeight: columnSlot(0, lastSlot, uiScale).boxHeight, above: 0 };
|
|
5753
|
+
}
|
|
5754
|
+
return { right: rowRight(Math.max(0, lastSlot) + 1, uiScale), bottom: DESK_BOTTOM, width: c.diameter, height: c.diameter + c.tag };
|
|
5755
|
+
}
|
|
5756
|
+
function foldedPlace(phone, uiScale = 1) {
|
|
5757
|
+
const c = circleSize(phone, uiScale);
|
|
5758
|
+
if (phone) return { right: PHONE_EDGE, width: c.diameter, height: c.diameter };
|
|
5759
|
+
return { right: DESK_EDGE, bottom: DESK_BOTTOM, width: c.diameter, height: c.diameter + c.tag };
|
|
5760
|
+
}
|
|
5761
|
+
function chevronOf(phone, collapsed) {
|
|
5762
|
+
if (phone) return collapsed ? "chevron-left" : "chevron-right";
|
|
5763
|
+
return collapsed ? "chevron-up" : "chevron-down";
|
|
5764
|
+
}
|
|
5765
|
+
function deskPanelBottom(uiScale = 1) {
|
|
5766
|
+
const c = circleSize(false, uiScale);
|
|
5767
|
+
return DESK_BOTTOM + c.diameter + c.tag + PANEL_GAP;
|
|
5768
|
+
}
|
|
5769
|
+
function iconUrl(icon, baseUrl) {
|
|
5770
|
+
if (icon.includes("://")) return icon;
|
|
5771
|
+
const at = baseUrl.indexOf("/api/");
|
|
5772
|
+
const site = (at > 0 ? baseUrl.slice(0, at) : baseUrl).replace(/\/+$/, "");
|
|
5773
|
+
return `${site}/sdk/icons/${icon}.png`;
|
|
5774
|
+
}
|
|
5775
|
+
var ToolbarFold = class {
|
|
5776
|
+
constructor(closeAll) {
|
|
5777
|
+
this._collapsed = false;
|
|
5778
|
+
this._sceneLast = -1;
|
|
5779
|
+
this.closeAll = closeAll;
|
|
5780
|
+
}
|
|
5781
|
+
get collapsed() {
|
|
5782
|
+
return this._collapsed;
|
|
5783
|
+
}
|
|
5784
|
+
collapse() {
|
|
5785
|
+
if (this._collapsed) return;
|
|
5786
|
+
this.closeAll();
|
|
5787
|
+
this._collapsed = true;
|
|
5788
|
+
}
|
|
5789
|
+
expand() {
|
|
5790
|
+
this._collapsed = false;
|
|
5791
|
+
}
|
|
5792
|
+
/** A button was drawn in `slot` */
|
|
5793
|
+
seen(slot) {
|
|
5794
|
+
if (slot > this._sceneLast) this._sceneLast = slot;
|
|
5795
|
+
}
|
|
5796
|
+
/** 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 */
|
|
5797
|
+
lastSlot(sdkLast) {
|
|
5798
|
+
return Math.max(sdkLast, this._sceneLast);
|
|
5799
|
+
}
|
|
5800
|
+
};
|
|
5801
|
+
function panelRight(phone, desktopRight, uiScale = 1) {
|
|
5802
|
+
return phone ? PHONE_EDGE + circleSize(true, uiScale).diameter + PANEL_GAP : desktopRight;
|
|
5803
|
+
}
|
|
5804
|
+
var DESKTOP_CLOSES = { guide: ["admin"], admin: ["guide"] };
|
|
5805
|
+
var GUIDE_PLACE = ["guide", "admin"];
|
|
5806
|
+
function panelsToClose(opened, registered, phone, coversGuide = []) {
|
|
5807
|
+
if (phone) return registered.filter((name) => name !== opened);
|
|
5808
|
+
const closes = [...DESKTOP_CLOSES[opened] ?? []];
|
|
5809
|
+
if (GUIDE_PLACE.includes(opened)) closes.push(...coversGuide);
|
|
5810
|
+
if (coversGuide.includes(opened)) closes.push(...GUIDE_PLACE);
|
|
5811
|
+
return registered.filter((name) => name !== opened && closes.includes(name));
|
|
5812
|
+
}
|
|
5813
|
+
var PanelRules = class {
|
|
5814
|
+
constructor(phone) {
|
|
5815
|
+
this.hides = /* @__PURE__ */ new Map();
|
|
5816
|
+
this.coveringGuide = /* @__PURE__ */ new Set();
|
|
5817
|
+
this.phone = phone;
|
|
5818
|
+
}
|
|
5819
|
+
/** Register (or replace) a panel; its hide runs when another panel opens and the rule says so */
|
|
5820
|
+
register(name, hide, options = {}) {
|
|
5821
|
+
this.hides.set(name, hide);
|
|
5822
|
+
if (options.coversGuide === true) this.coveringGuide.add(name);
|
|
5823
|
+
else this.coveringGuide.delete(name);
|
|
5824
|
+
}
|
|
5825
|
+
/** Close every registered panel (2.14.0, the toolbar collapsing). One failing hide does not stop the rest. */
|
|
5826
|
+
closeAll() {
|
|
5827
|
+
for (const hide of this.hides.values()) {
|
|
5828
|
+
try {
|
|
5829
|
+
hide();
|
|
5830
|
+
} catch {
|
|
5831
|
+
}
|
|
5832
|
+
}
|
|
5833
|
+
}
|
|
5834
|
+
/** A panel opened: close the ones the rule names. One failing hide does not stop the rest. */
|
|
5835
|
+
opened(name) {
|
|
5836
|
+
for (const other of panelsToClose(name, [...this.hides.keys()], this.phone(), [...this.coveringGuide])) {
|
|
5837
|
+
try {
|
|
5838
|
+
this.hides.get(other)?.();
|
|
5839
|
+
} catch {
|
|
5840
|
+
}
|
|
5841
|
+
}
|
|
5842
|
+
}
|
|
5843
|
+
get names() {
|
|
5844
|
+
return [...this.hides.keys()];
|
|
5845
|
+
}
|
|
5846
|
+
};
|
|
5847
|
+
|
|
5848
|
+
// src/ui/toolbar-button.ts
|
|
5849
|
+
var import_react_ecs7 = __toESM(require("@dcl/sdk/react-ecs"));
|
|
5850
|
+
var import_math8 = require("@dcl/sdk/math");
|
|
5851
|
+
var GLASS = import_math8.Color4.create(18 / 255, 20 / 255, 34 / 255, 0.55);
|
|
5852
|
+
var FOLD_RING = import_math8.Color4.create(1, 1, 1, 0.45);
|
|
5853
|
+
var BADGE = import_math8.Color4.create(0.86, 0.15, 0.2, 1);
|
|
5854
|
+
var WHITE = import_math8.Color4.create(1, 1, 1, 1);
|
|
5855
|
+
function circleUnit(phone, uiScale, spec, place) {
|
|
5856
|
+
const c = circleSize(phone, uiScale);
|
|
5857
|
+
const inner = [];
|
|
5858
|
+
if (spec.icon) {
|
|
5859
|
+
inner.push(import_react_ecs7.default.createElement(import_react_ecs7.UiEntity, {
|
|
5860
|
+
uiTransform: { width: c.icon, height: c.icon },
|
|
5861
|
+
uiBackground: { texture: { src: spec.icon, filterMode: "bi-linear" }, textureMode: "stretch" }
|
|
5862
|
+
}));
|
|
5863
|
+
} else if (spec.content) {
|
|
5864
|
+
inner.push(...spec.content);
|
|
5865
|
+
}
|
|
5866
|
+
const badgeText = spec.badge === void 0 || spec.badge === null || spec.badge === 0 || spec.badge === "" ? null : String(spec.badge);
|
|
5867
|
+
if (badgeText) {
|
|
5868
|
+
inner.push(import_react_ecs7.default.createElement(import_react_ecs7.UiEntity, {
|
|
5869
|
+
uiTransform: {
|
|
5870
|
+
positionType: "absolute",
|
|
5871
|
+
position: { top: 0, right: 0 },
|
|
5872
|
+
width: c.badge,
|
|
5873
|
+
height: c.badge,
|
|
5874
|
+
borderRadius: c.badge / 2,
|
|
5875
|
+
justifyContent: "center",
|
|
5876
|
+
alignItems: "center"
|
|
5877
|
+
},
|
|
5878
|
+
uiBackground: { color: BADGE },
|
|
5879
|
+
uiText: { value: badgeText, fontSize: Math.round(c.badge * 0.6), color: WHITE, textAlign: "middle-center" }
|
|
5880
|
+
}));
|
|
5881
|
+
}
|
|
5882
|
+
const circle = import_react_ecs7.default.createElement(import_react_ecs7.UiEntity, {
|
|
5883
|
+
uiTransform: {
|
|
5884
|
+
width: c.diameter,
|
|
5885
|
+
height: c.diameter,
|
|
5886
|
+
flexShrink: 0,
|
|
5887
|
+
borderRadius: c.diameter / 2,
|
|
5888
|
+
borderWidth: c.ring,
|
|
5889
|
+
borderColor: spec.ring,
|
|
5890
|
+
justifyContent: "center",
|
|
5891
|
+
alignItems: "center",
|
|
5892
|
+
...spec.contentLayout || {}
|
|
5893
|
+
},
|
|
5894
|
+
uiBackground: { color: spec.fill },
|
|
5895
|
+
children: inner
|
|
5896
|
+
});
|
|
5897
|
+
const children = [circle];
|
|
5898
|
+
if (spec.tagRow) {
|
|
5899
|
+
children.push(import_react_ecs7.default.createElement(import_react_ecs7.UiEntity, {
|
|
5900
|
+
uiTransform: { width: c.diameter, height: c.tag, flexShrink: 0 },
|
|
5901
|
+
uiText: spec.tag ? { value: spec.tag, fontSize: c.tagFont, color: spec.tagColor ?? WHITE, textAlign: "middle-center" } : void 0
|
|
5902
|
+
}));
|
|
5903
|
+
}
|
|
5904
|
+
return import_react_ecs7.default.createElement(import_react_ecs7.UiEntity, {
|
|
5905
|
+
uiTransform: {
|
|
5906
|
+
...place,
|
|
5907
|
+
width: c.diameter,
|
|
5908
|
+
height: c.diameter + (spec.tagRow ? c.tag : 0),
|
|
5909
|
+
flexDirection: "column",
|
|
5910
|
+
alignItems: "center",
|
|
5911
|
+
flexShrink: 0
|
|
5912
|
+
},
|
|
5913
|
+
onMouseDown: spec.onMouseDown,
|
|
5914
|
+
children
|
|
5915
|
+
});
|
|
5916
|
+
}
|
|
5917
|
+
function inColumn(width, boxHeight, above, right, entity) {
|
|
5918
|
+
return import_react_ecs7.default.createElement(import_react_ecs7.UiEntity, {
|
|
5919
|
+
uiTransform: {
|
|
5920
|
+
positionType: "absolute",
|
|
5921
|
+
position: { right, top: 0 },
|
|
5922
|
+
width,
|
|
5923
|
+
height: "100%",
|
|
5924
|
+
flexDirection: "column",
|
|
5925
|
+
justifyContent: "center"
|
|
5926
|
+
},
|
|
5927
|
+
children: [
|
|
5928
|
+
import_react_ecs7.default.createElement(import_react_ecs7.UiEntity, {
|
|
5929
|
+
uiTransform: { width, height: boxHeight, flexDirection: "column", flexShrink: 0 },
|
|
5930
|
+
children: [
|
|
5931
|
+
import_react_ecs7.default.createElement(import_react_ecs7.UiEntity, { uiTransform: { width, height: above, flexShrink: 0 } }),
|
|
5932
|
+
entity
|
|
5933
|
+
]
|
|
5934
|
+
})
|
|
5935
|
+
]
|
|
5936
|
+
});
|
|
5937
|
+
}
|
|
5938
|
+
function ringOf(props) {
|
|
5939
|
+
return props.uiBackground?.color ?? WHITE;
|
|
5940
|
+
}
|
|
5941
|
+
function toolbarButton(slot, props, phone, uiScale = 1, fold = { collapsed: false, expand: () => {
|
|
5942
|
+
}, lastSlot: slot }, baseUrl = "https://thestatic.tv/api/v1/dcl") {
|
|
5943
|
+
if (fold.collapsed) return null;
|
|
5944
|
+
const ring = ringOf(props);
|
|
5945
|
+
const r = ring;
|
|
5946
|
+
const spec = {
|
|
5947
|
+
ring,
|
|
5948
|
+
fill: props.open === true && typeof r.r === "number" ? import_math8.Color4.create(r.r, r.g ?? 0, r.b ?? 0, 0.55) : GLASS,
|
|
5949
|
+
icon: props.icon ? iconUrl(props.icon, baseUrl) : void 0,
|
|
5950
|
+
content: props.icon ? void 0 : props.children,
|
|
5951
|
+
contentLayout: props.icon ? void 0 : props.uiTransform,
|
|
5952
|
+
tag: props.tag,
|
|
5953
|
+
tagColor: props.tagColor,
|
|
5954
|
+
badge: props.badge,
|
|
5955
|
+
tagRow: true,
|
|
5956
|
+
onMouseDown: props.onMouseDown
|
|
5957
|
+
};
|
|
5958
|
+
if (!phone) {
|
|
5959
|
+
return circleUnit(false, uiScale, spec, { positionType: "absolute", position: { right: rowRight(slot, uiScale), bottom: DESK_BOTTOM } });
|
|
5960
|
+
}
|
|
5961
|
+
const place = columnSlot(slot, fold.lastSlot, uiScale);
|
|
5962
|
+
return inColumn(place.width, place.boxHeight, place.above, place.right, circleUnit(true, uiScale, spec, {}));
|
|
5963
|
+
}
|
|
5964
|
+
function toolbarHandle(phone, lastSlot, collapsed, toggle, uiScale = 1, baseUrl = "https://thestatic.tv/api/v1/dcl") {
|
|
5965
|
+
const spec = {
|
|
5966
|
+
ring: FOLD_RING,
|
|
5967
|
+
fill: GLASS,
|
|
5968
|
+
icon: iconUrl(chevronOf(phone, collapsed), baseUrl),
|
|
5969
|
+
tagRow: !phone,
|
|
5970
|
+
onMouseDown: toggle
|
|
5971
|
+
};
|
|
5972
|
+
if (collapsed) {
|
|
5973
|
+
const place2 = foldedPlace(phone, uiScale);
|
|
5974
|
+
if (!phone) {
|
|
5975
|
+
return circleUnit(false, uiScale, spec, { positionType: "absolute", position: { right: place2.right, bottom: place2.bottom } });
|
|
5976
|
+
}
|
|
5977
|
+
return import_react_ecs7.default.createElement(import_react_ecs7.UiEntity, {
|
|
5978
|
+
uiTransform: {
|
|
5979
|
+
positionType: "absolute",
|
|
5980
|
+
position: { right: place2.right, top: 0 },
|
|
5981
|
+
width: place2.width,
|
|
5982
|
+
height: "100%",
|
|
5983
|
+
flexDirection: "column",
|
|
5984
|
+
justifyContent: "center"
|
|
5985
|
+
},
|
|
5986
|
+
children: [circleUnit(true, uiScale, spec, {})]
|
|
5987
|
+
});
|
|
5988
|
+
}
|
|
5989
|
+
const place = handlePlace(phone, lastSlot, uiScale);
|
|
5990
|
+
if (!phone) {
|
|
5991
|
+
return circleUnit(false, uiScale, spec, { positionType: "absolute", position: { right: place.right, bottom: place.bottom } });
|
|
5992
|
+
}
|
|
5993
|
+
return inColumn(place.width, place.boxHeight, place.above, place.right, circleUnit(true, uiScale, spec, {}));
|
|
5994
|
+
}
|
|
5995
|
+
|
|
5873
5996
|
// src/ui/toolbar-panel.ts
|
|
5874
5997
|
var import_react_ecs8 = __toESM(require("@dcl/sdk/react-ecs"));
|
|
5875
5998
|
function toolbarPanel(props, phone, uiScale = 1) {
|
|
5876
|
-
if (!phone)
|
|
5999
|
+
if (!phone) {
|
|
6000
|
+
const position = props.uiTransform?.position ?? {};
|
|
6001
|
+
const floor = deskPanelBottom(uiScale);
|
|
6002
|
+
if (typeof position.bottom === "number" && position.bottom < floor) {
|
|
6003
|
+
return import_react_ecs8.default.createElement(import_react_ecs8.UiEntity, {
|
|
6004
|
+
...props,
|
|
6005
|
+
uiTransform: { ...props.uiTransform, position: { ...position, bottom: floor } }
|
|
6006
|
+
});
|
|
6007
|
+
}
|
|
6008
|
+
return import_react_ecs8.default.createElement(import_react_ecs8.UiEntity, props);
|
|
6009
|
+
}
|
|
5877
6010
|
const { key, uiTransform = {}, ...rest } = props;
|
|
5878
6011
|
const { position: _position, positionType: _positionType, ...ownLayout } = uiTransform;
|
|
5879
6012
|
const spacer = () => import_react_ecs8.default.createElement(import_react_ecs8.UiEntity, { uiTransform: { height: 0, flexGrow: 1 } });
|
|
@@ -5967,6 +6100,8 @@ var _StaticTVClient = class _StaticTVClient {
|
|
|
5967
6100
|
* scene's (registerPanel); elsewhere the guide and the admin panel close each other, as before.
|
|
5968
6101
|
*/
|
|
5969
6102
|
this.panelRules = new PanelRules(() => this.isPhone);
|
|
6103
|
+
/** The toolbar collapsed to strips or not, for the visit (2.14.0): collapsing closes every panel first */
|
|
6104
|
+
this.fold = new ToolbarFold(() => this.panelRules.closeAll());
|
|
5970
6105
|
// =============================================================================
|
|
5971
6106
|
// --- VIDEO PLAYBACK (Internal handler for videoScreen) ---
|
|
5972
6107
|
// =============================================================================
|
|
@@ -6899,21 +7034,53 @@ var _StaticTVClient = class _StaticTVClient {
|
|
|
6899
7034
|
* Draw one of the scene's own toolbar buttons in its slot: the row along the bottom right on desktop (where a scene
|
|
6900
7035
|
* placed its own by hand before), the column on a phone. Slots count from the right (the row) or the top (the
|
|
6901
7036
|
* 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
|
|
6902
|
-
* scene's. `props` is the button's face
|
|
6903
|
-
*
|
|
7037
|
+
* scene's. `props` is the button's face. Since 2.15.0 every button is a circle: its uiBackground color is the ring,
|
|
7038
|
+
* `icon` the white icon in the middle (a name on the SDK's icon host - chat, guide, sparkle, radio, admin - or a full
|
|
7039
|
+
* https URL), `tag` the short name under it, `tagColor`, `badge` (a small count) and `open` (its panel is open) are
|
|
7040
|
+
* optional; a face with no icon shows its children inside the circle. Folded (2.14.0), the buttons draw nothing:
|
|
7041
|
+
* the toolbar is one circle (toolbarHandle).
|
|
6904
7042
|
*
|
|
6905
7043
|
* @example
|
|
6906
7044
|
* ```typescript
|
|
6907
7045
|
* staticTV.toolbarButton(3, {
|
|
6908
|
-
* uiTransform: { justifyContent: 'center', alignItems: 'center' },
|
|
6909
7046
|
* uiBackground: { color: Color4.create(0.2, 0.4, 0.2, 0.9) },
|
|
7047
|
+
* icon: 'radio',
|
|
7048
|
+
* tag: 'MAP',
|
|
7049
|
+
* open: myPanel.isOpen,
|
|
6910
7050
|
* onMouseDown: () => myPanel.toggle(),
|
|
6911
|
-
* children: [ReactEcs.createElement(UiEntity, { uiText: { value: 'MAP', fontSize: 14 } })],
|
|
6912
7051
|
* })
|
|
6913
7052
|
* ```
|
|
6914
7053
|
*/
|
|
6915
7054
|
toolbarButton(slot, props) {
|
|
6916
|
-
|
|
7055
|
+
this.fold.seen(slot);
|
|
7056
|
+
return toolbarButton(slot, props, this.isPhone, this.uiScale, {
|
|
7057
|
+
collapsed: this.fold.collapsed,
|
|
7058
|
+
expand: () => this.fold.expand(),
|
|
7059
|
+
lastSlot: this.toolbarLastSlot()
|
|
7060
|
+
}, this.baseUrl);
|
|
7061
|
+
}
|
|
7062
|
+
/** The toolbar's last slot: ADMIN's (2) when it is drawn, else GUIDE's (1), or a scene button's past them */
|
|
7063
|
+
toolbarLastSlot() {
|
|
7064
|
+
return this.fold.lastSlot(this.adminPanel?.hasAccess === true ? 2 : 1);
|
|
7065
|
+
}
|
|
7066
|
+
/**
|
|
7067
|
+
* The toolbar folded (2.14.0, his ask: "small tabs out of users way"; one circle since 2.15.0): the fold circle
|
|
7068
|
+
* folds it and closes every open panel, the scene's registered ones too; the one folded circle opens it. For the
|
|
7069
|
+
* visit only; it starts open. A scene drawing its buttons through toolbarButton needs nothing more.
|
|
7070
|
+
*/
|
|
7071
|
+
get toolbarCollapsed() {
|
|
7072
|
+
return this.fold.collapsed;
|
|
7073
|
+
}
|
|
7074
|
+
/**
|
|
7075
|
+
* 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
|
|
7076
|
+
* desktop row's last button (chevron down); folded, the toolbar's one circle, on a phone's edge at mid-height
|
|
7077
|
+
* (chevron left) or in the desktop's bottom-right corner (chevron up). A press folds or opens.
|
|
7078
|
+
* @internal
|
|
7079
|
+
*/
|
|
7080
|
+
toolbarHandle() {
|
|
7081
|
+
const collapsed = this.fold.collapsed;
|
|
7082
|
+
const toggle = () => collapsed ? this.fold.expand() : this.fold.collapse();
|
|
7083
|
+
return toolbarHandle(this.isPhone, this.toolbarLastSlot(), collapsed, toggle, this.uiScale, this.baseUrl);
|
|
6917
7084
|
}
|
|
6918
7085
|
/** Where a scene's own panel's right edge goes: on a phone one gap left of the column; elsewhere `desktopRight` */
|
|
6919
7086
|
panelRight(desktopRight) {
|