@rbxts/uiblox 0.1.48 → 0.1.50
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/theme/hooks/useTheme.luau +12 -7
- package/out/ui/packages/layout/components/Grid.d.ts +2 -2
- package/out/ui/packages/layout/components/Grid.luau +6 -6
- package/out/ui/packages/layout/components/List.d.ts +1 -1
- package/out/ui/packages/layout/components/List.luau +5 -5
- package/package.json +1 -1
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
-
local
|
|
4
|
+
local useEffect = _react.useEffect
|
|
5
5
|
local useMemo = _react.useMemo
|
|
6
6
|
local useState = _react.useState
|
|
7
7
|
local themeProducer = TS.import(script, script.Parent.Parent, "context", "ThemeProducer").themeProducer
|
|
8
8
|
local useTheme = function()
|
|
9
9
|
local theme, setTheme = useState(themeProducer:getState())
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
useEffect(function()
|
|
11
|
+
local unsubscribeFn = themeProducer:subscribe(function(state, _previousState)
|
|
12
|
+
setTheme(state)
|
|
13
|
+
end)
|
|
14
|
+
return function()
|
|
15
|
+
unsubscribeFn()
|
|
16
|
+
end
|
|
12
17
|
end)
|
|
13
|
-
local
|
|
14
|
-
themeProducer.setTheme
|
|
15
|
-
end, { setTheme })
|
|
18
|
+
local memoizedSetTheme = useMemo(function()
|
|
19
|
+
return themeProducer.setTheme
|
|
20
|
+
end, { themeProducer.setTheme })
|
|
16
21
|
return useMemo(function()
|
|
17
22
|
return {
|
|
18
23
|
theme = theme,
|
|
19
|
-
setTheme =
|
|
24
|
+
setTheme = memoizedSetTheme,
|
|
20
25
|
}
|
|
21
26
|
end, { theme, setTheme })
|
|
22
27
|
end
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { CustomizedProps } from "../../../../theme/index";
|
|
2
2
|
export interface GridProps {
|
|
3
|
-
cellPadding?:
|
|
3
|
+
cellPadding?: UDim2;
|
|
4
4
|
cellSize?: UDim2;
|
|
5
5
|
fillDirection?: Enum.FillDirection;
|
|
6
6
|
fillDirectionMaxCells?: number;
|
|
7
7
|
sortOrder?: Enum.SortOrder;
|
|
8
8
|
startCorner: Enum.StartCorner;
|
|
9
9
|
horizontalAlignment?: Enum.HorizontalAlignment;
|
|
10
|
-
|
|
10
|
+
verticalAlignment?: Enum.VerticalAlignment;
|
|
11
11
|
}
|
|
12
12
|
declare function Grid(props: CustomizedProps<Frame, GridProps>): JSX.Element;
|
|
13
13
|
export default Grid;
|
|
@@ -20,7 +20,7 @@ local useGridStyles = makeStyles(function(_, props)
|
|
|
20
20
|
SortOrder = props.sortOrder,
|
|
21
21
|
StartCorner = props.startCorner,
|
|
22
22
|
HorizontalAlignment = props.horizontalAlignment,
|
|
23
|
-
VerticalAlignment = props.
|
|
23
|
+
VerticalAlignment = props.verticalAlignment,
|
|
24
24
|
},
|
|
25
25
|
})
|
|
26
26
|
end)
|
|
@@ -28,7 +28,7 @@ local function Grid(props)
|
|
|
28
28
|
local _binding = props
|
|
29
29
|
local cellPadding = _binding.cellPadding
|
|
30
30
|
if cellPadding == nil then
|
|
31
|
-
cellPadding =
|
|
31
|
+
cellPadding = UDim2.fromScale(0, 0)
|
|
32
32
|
end
|
|
33
33
|
local cellSize = _binding.cellSize
|
|
34
34
|
if cellSize == nil then
|
|
@@ -54,9 +54,9 @@ local function Grid(props)
|
|
|
54
54
|
if horizontalAlignment == nil then
|
|
55
55
|
horizontalAlignment = Enum.HorizontalAlignment.Left
|
|
56
56
|
end
|
|
57
|
-
local
|
|
58
|
-
if
|
|
59
|
-
|
|
57
|
+
local verticalAlignment = _binding.verticalAlignment
|
|
58
|
+
if verticalAlignment == nil then
|
|
59
|
+
verticalAlignment = Enum.VerticalAlignment.Top
|
|
60
60
|
end
|
|
61
61
|
local className = _binding.className
|
|
62
62
|
local children = _binding.children
|
|
@@ -70,7 +70,7 @@ local function Grid(props)
|
|
|
70
70
|
sortOrder = sortOrder,
|
|
71
71
|
startCorner = startCorner,
|
|
72
72
|
horizontalAlignment = horizontalAlignment,
|
|
73
|
-
|
|
73
|
+
verticalAlignment = verticalAlignment,
|
|
74
74
|
})
|
|
75
75
|
local baseGrid = _binding_1.baseGrid
|
|
76
76
|
local baseLayout = _binding_1.baseLayout
|
|
@@ -6,7 +6,7 @@ export interface ListProps {
|
|
|
6
6
|
wrap?: "wrap" | "no-wrap";
|
|
7
7
|
horizontalAlignment?: Enum.HorizontalAlignment;
|
|
8
8
|
horizontalFlex?: Enum.UIFlexAlignment;
|
|
9
|
-
|
|
9
|
+
verticalAlignment?: Enum.VerticalAlignment;
|
|
10
10
|
verticalFlex?: Enum.UIFlexAlignment;
|
|
11
11
|
}
|
|
12
12
|
declare function List(props: CustomizedProps<Frame, ListProps>): JSX.Element;
|
|
@@ -19,7 +19,7 @@ local useListStyles = makeStyles(function(_, props)
|
|
|
19
19
|
Wraps = props.wrap == "wrap",
|
|
20
20
|
HorizontalAlignment = props.horizontalAlignment,
|
|
21
21
|
HorizontalFlex = props.horizontalFlex,
|
|
22
|
-
VerticalAlignment = props.
|
|
22
|
+
VerticalAlignment = props.verticalAlignment,
|
|
23
23
|
VerticalFlex = props.verticalFlex,
|
|
24
24
|
},
|
|
25
25
|
})
|
|
@@ -50,9 +50,9 @@ local function List(props)
|
|
|
50
50
|
if horizontalFlex == nil then
|
|
51
51
|
horizontalFlex = Enum.UIFlexAlignment.None
|
|
52
52
|
end
|
|
53
|
-
local
|
|
54
|
-
if
|
|
55
|
-
|
|
53
|
+
local verticalAlignment = _binding.verticalAlignment
|
|
54
|
+
if verticalAlignment == nil then
|
|
55
|
+
verticalAlignment = Enum.VerticalAlignment.Top
|
|
56
56
|
end
|
|
57
57
|
local verticalFlex = _binding.verticalFlex
|
|
58
58
|
if verticalFlex == nil then
|
|
@@ -69,7 +69,7 @@ local function List(props)
|
|
|
69
69
|
wrap = wrap,
|
|
70
70
|
horizontalAlignment = horizontalAlignment,
|
|
71
71
|
horizontalFlex = horizontalFlex,
|
|
72
|
-
|
|
72
|
+
verticalAlignment = verticalAlignment,
|
|
73
73
|
verticalFlex = verticalFlex,
|
|
74
74
|
})
|
|
75
75
|
local baseList = _binding_1.baseList
|