@nrbx/topbar-components 1.1.3 → 1.1.5

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.
@@ -3,7 +3,6 @@ local TS = _G[script]
3
3
  local deepEquals = TS.import(script, TS.getModule(script, "@rbxts", "object-utils")).deepEquals
4
4
  local _pretty_react_hooks = TS.import(script, TS.getModule(script, "@rbxts", "pretty-react-hooks").out)
5
5
  local mapBinding = _pretty_react_hooks.mapBinding
6
- local useAsyncEffect = _pretty_react_hooks.useAsyncEffect
7
6
  local useMotion = _pretty_react_hooks.useMotion
8
7
  local useMountEffect = _pretty_react_hooks.useMountEffect
9
8
  local useUnmountEffect = _pretty_react_hooks.useUnmountEffect
@@ -149,7 +148,7 @@ local function Icon(componentProps)
149
148
  local currentImage = stateful(props.imageId, currentState)
150
149
  local currentText = stateful(props.text, currentState)
151
150
  local previousQueryRef = useRef()
152
- useAsyncEffect(TS.async(function()
151
+ useEffect(function()
153
152
  local currentQuery = {
154
153
  Font = stateful(props.fontFace, currentState),
155
154
  Size = stateful(props.textSize, currentState),
@@ -170,9 +169,10 @@ local function Icon(componentProps)
170
169
  params.Font = stateful(props.fontFace, currentState)
171
170
  params.Size = stateful(props.textSize, currentState)
172
171
  params.Width = sizing.textMeasurementWidth
173
- setTextBounds(TS.await(TextService:GetTextBoundsAsync(params)))
172
+ local bounds = TextService:GetTextBoundsAsync(params)
173
+ setTextBounds(bounds)
174
174
  previousQueryRef.current = currentQuery
175
- end), { currentText, props.fontFace, props.textSize, currentState })
175
+ end, { currentText, props.fontFace, props.textSize, currentState })
176
176
  local imageSizeOff = stateful(props.imageSizeOffset, currentState)
177
177
  local forceHeight = if location.type == "dropdown" then stylesheet.dropdown.forceHeight else nil
178
178
  local _condition = sizing.iconHeight
@@ -21,11 +21,11 @@ local function useAnimateableProps(state, props, ...)
21
21
  for i = 0, #keys - 1 do
22
22
  local key = keys[i + 1]
23
23
  local value = stateful(props[key], state)
24
- local previousValue = stateful(previousProps, state)
24
+ local previousValue = if previousProps then stateful(previousProps[key], state) else nil
25
25
  if value == previousValue then
26
26
  continue
27
27
  end
28
- motionControls[i + 1].spring(value, springs.responsive)
28
+ motionControls[i + 1]:spring(value, springs.responsive)
29
29
  end
30
30
  end, { props })
31
31
  -- ▼ ReadonlyArray.map ▼
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nrbx/topbar-components",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "main": "out/init.luau",
5
5
  "scripts": {
6
6
  "build": "rbxtsc",
@@ -42,7 +42,7 @@
42
42
  "dependencies": {
43
43
  "@rbxts/object-utils": "^1.0.4",
44
44
  "@rbxts/pretty-react-hooks": "^0.6.4",
45
- "@rbxts/ripple": "^0.9.3",
45
+ "@rbxts/ripple": "^0.9.1",
46
46
  "@rbxts/services": "^1.6.0",
47
47
  "@rbxts/t": "^3.2.1"
48
48
  },