-- Compiled with roblox-ts v3.0.0 local TS = _G[script] local TextService = TS.import(script, TS.getModule(script, "@rbxts", "services")).TextService local _vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src) local Vide = _vide local cleanup = _vide.cleanup local derive = _vide.derive local source = _vide.source local spring = _vide.spring local SUGGESTION_TEXT_SIZE = TS.import(script, script.Parent.Parent.Parent, "constants", "text").SUGGESTION_TEXT_SIZE local px = TS.import(script, script.Parent.Parent.Parent, "hooks", "use-px").px local _store = TS.import(script, script.Parent.Parent.Parent, "store") local currentSuggestion = _store.currentSuggestion local currentTextPart = _store.currentTextPart local Group = TS.import(script, script.Parent.Parent, "ui", "group").Group local MainSuggestion = TS.import(script, script.Parent, "main-suggestion").MainSuggestion local SuggestionList = TS.import(script, script.Parent, "suggestion-list").SuggestionList local PADDING = 8 local function Suggestions() local mainSize = source(UDim2.new()) local listBoundsParams = Instance.new("GetTextBoundsParams") listBoundsParams.RichText = true cleanup(listBoundsParams) local listBounds = derive(function() local width = 0 local _result = currentSuggestion() if _result ~= nil then _result = _result.others end local _condition = _result if _condition == nil then _condition = {} end local suggestions = _condition for _, value in suggestions do listBoundsParams.Text = value local suggestionBounds = TextService:GetTextBoundsAsync(listBoundsParams) width = math.max(width, suggestionBounds.X) end local height = #suggestions * px(SUGGESTION_TEXT_SIZE + 6) + (#suggestions - 1) * px(4) + px(8) return Vector2.new(width, height) end) return Vide.jsx(Group, { automaticSize = "XY", size = UDim2.fromOffset(0, 0), }, Vide.jsx(MainSuggestion, { suggestion = currentSuggestion, currentText = currentTextPart, onSizeChanged = mainSize, }), Vide.jsx(SuggestionList, { suggestion = currentSuggestion, currentText = currentTextPart, size = spring(function() return UDim2.new(0, math.max(listBounds().X, mainSize().X.Offset), 0, listBounds().Y) end, 0.3), }), Vide.jsx("uilistlayout", { Padding = function() return UDim.new(0, px(PADDING)) end, })) end return { Suggestions = Suggestions, }