@nrbx/topbar-components 1.0.2 → 1.0.3
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/out/components/provider.luau +7 -1
- package/out/style.d.ts +5 -0
- package/out/style.luau +1 -0
- package/out/utilities/debug.d.ts +5 -0
- package/out/utilities/debug.luau +17 -0
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ local LocationContext = _context.LocationContext
|
|
|
8
8
|
local useStylesheet = _context.useStylesheet
|
|
9
9
|
local useGuiInset = TS.import(script, script.Parent.Parent, "hooks", "use-gui-inset").useGuiInset
|
|
10
10
|
local useVoicechatEnabled = TS.import(script, script.Parent.Parent, "hooks", "use-voicechat-enabled").useVoicechatEnabled
|
|
11
|
+
local debugLog = TS.import(script, script.Parent.Parent, "utilities", "debug").debugLog
|
|
11
12
|
local function sortByDock(children)
|
|
12
13
|
local left = {}
|
|
13
14
|
local center = {}
|
|
@@ -51,7 +52,9 @@ local function TopbarProvider(_param)
|
|
|
51
52
|
local stylesheet = useStylesheet().provider
|
|
52
53
|
local hasBetaLabel = gameVoiceChatEnabled and voiceChatEnabled
|
|
53
54
|
local leftPadding = if hasBetaLabel then stylesheet.paddingLeft + 16 else stylesheet.paddingLeft
|
|
54
|
-
local
|
|
55
|
+
local rawHeight = inset.Height - stylesheet.insetHeightOffset
|
|
56
|
+
local frameHeight = if stylesheet.forceFrameHeight ~= nil then stylesheet.forceFrameHeight else rawHeight
|
|
57
|
+
debugLog(`TopbarProvider frame: inset.Height={inset.Height}, inset.Width={inset.Width}`, `insetHeightOffset={stylesheet.insetHeightOffset}`, `rawHeight={rawHeight}`, `forceFrameHeight={stylesheet.forceFrameHeight}`, `finalHeight={frameHeight}`, `sizeScale=({stylesheet.sizeScale.X}, {stylesheet.sizeScale.Y})`)
|
|
55
58
|
local _binding = sortByDock(children)
|
|
56
59
|
local leftChildren = _binding[1]
|
|
57
60
|
local centerChildren = _binding[2]
|
|
@@ -127,6 +130,7 @@ local function TopbarProvider(_param)
|
|
|
127
130
|
FillDirection = Enum.FillDirection.Horizontal,
|
|
128
131
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
129
132
|
Padding = UDim.new(0, stylesheet.iconSpacing),
|
|
133
|
+
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
130
134
|
}), leftChildren), hasCenter and (React.createElement("frame", {
|
|
131
135
|
key = "CenterDock",
|
|
132
136
|
BackgroundTransparency = 1,
|
|
@@ -141,6 +145,7 @@ local function TopbarProvider(_param)
|
|
|
141
145
|
FillDirection = Enum.FillDirection.Horizontal,
|
|
142
146
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
143
147
|
Padding = UDim.new(0, stylesheet.iconSpacing),
|
|
148
|
+
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
144
149
|
}), centerChildren)), hasRight and (React.createElement("frame", {
|
|
145
150
|
key = "RightDock",
|
|
146
151
|
BackgroundTransparency = 1,
|
|
@@ -154,6 +159,7 @@ local function TopbarProvider(_param)
|
|
|
154
159
|
FillDirection = Enum.FillDirection.Horizontal,
|
|
155
160
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
156
161
|
Padding = UDim.new(0, stylesheet.iconSpacing),
|
|
162
|
+
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
157
163
|
}), rightChildren))))
|
|
158
164
|
end
|
|
159
165
|
return {
|
package/out/style.d.ts
CHANGED
|
@@ -23,6 +23,11 @@ export interface Stylesheet {
|
|
|
23
23
|
insetHeightOffset: number;
|
|
24
24
|
/** Extra gap between left, center, and right icon groups (default 0) */
|
|
25
25
|
iconGroupSpacing: number;
|
|
26
|
+
/**
|
|
27
|
+
* Explicit override for the provider frame Y size (in pixels).
|
|
28
|
+
* When set, this replaces the automatic `(inset.Height - insetHeightOffset) * sizeScale.Y` calculation.
|
|
29
|
+
*/
|
|
30
|
+
forceFrameHeight: number | undefined;
|
|
26
31
|
};
|
|
27
32
|
/**
|
|
28
33
|
* Fine-grained sizing & layout overrides for icon internals.
|
package/out/style.luau
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
--[[
|
|
3
|
+
*
|
|
4
|
+
* Logs a debug message to the console only when `_G.__DEBUG__` is truthy.
|
|
5
|
+
* No-op in production — stripped at the call site when debug is off.
|
|
6
|
+
|
|
7
|
+
]]
|
|
8
|
+
local function debugLog(...)
|
|
9
|
+
local messages = { ... }
|
|
10
|
+
local _value = _G.__DEBUG__
|
|
11
|
+
if _value ~= 0 and _value == _value and _value ~= "" and _value then
|
|
12
|
+
print(`[DEBUG]`, unpack(messages))
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
return {
|
|
16
|
+
debugLog = debugLog,
|
|
17
|
+
}
|