-- Compiled with roblox-ts v1.2.7 local TS = _G[script] local Roact = TS.import(script, TS.getModule(script, "@rbxts", "roact").src) local connect = TS.import(script, TS.getModule(script, "@rbxts", "roact-rodux").src).connect local _Types = TS.import(script, script.Parent.Parent, "Types") local isContextMessage = _Types.isContextMessage local getMessageText = _Types.getMessageText local getLogLevel = _Types.getLogLevel local ThemeContext = TS.import(script, script.Parent.Parent, "UIKit", "ThemeContext").default local ScrollView = TS.import(script, script.Parent, "ScrollView").default local ZrRichTextHighlighter = TS.import(script, TS.getModule(script, "@rbxts", "zirconium").out.Ast).ZrRichTextHighlighter local ZirconIcon = TS.import(script, script.Parent, "Icon").default local ZirconOutputMessage = TS.import(script, script.Parent, "OutputMessage").default local last = TS.import(script, script.Parent.Parent.Parent, "Shared", "Collections").last local StringUtils = TS.import(script, TS.getModule(script, "@rbxts", "string-utils")) local function OutputPlain(props) local message = props.Message if message.type == "zr:execute" then return Roact.createElement(ThemeContext.Consumer, { render = function(theme) return Roact.createElement("Frame", { Size = UDim2.new(1, 0, 0, 25), BackgroundTransparency = 1, }, { Roact.createElement(ZirconIcon, { Icon = "RightArrow", Position = UDim2.new(0, -3, 0, 6), }), Roact.createElement("TextLabel", { RichText = true, Position = UDim2.new(0, 20, 0, 0), Size = UDim2.new(1, -20, 1, 0), Text = ZrRichTextHighlighter.new(message.source):parse(), BackgroundTransparency = 1, Font = theme.ConsoleFont, TextColor3 = theme.PrimaryTextColor3, TextXAlignment = "Left", TextSize = 20, }), }) end, }) else return Roact.createElement(ThemeContext.Consumer, { render = function(theme) return Roact.createElement("TextLabel", { RichText = true, Size = UDim2.new(1, 0, 0, 25), Text = message.message, BackgroundTransparency = 1, Font = theme.ConsoleFont, TextColor3 = theme.PrimaryTextColor3, TextXAlignment = "Left", TextSize = 20, }) end, }) end end local OutputComponent do OutputComponent = Roact.Component:extend("OutputComponent") function OutputComponent:init(props) self.state = { output = props.output, } end function OutputComponent:didUpdate(prevProps) if prevProps.output ~= self.props.output then self:setState({ output = self.props.output, }) end end function OutputComponent:render() return Roact.createElement(ThemeContext.Consumer, { render = function() local _output = self.state.output local _arg0 = function(output) if output.type == "zr:error" or (output.type == "luau:error" or (output.type == "zirclog:error" or (output.type == "zirclog:message" or (output.type == "zr:output" or output.type == "slog:output")))) then return Roact.createElement(ZirconOutputMessage, { ShowTags = self.props.showTags, Message = output, }) else return Roact.createElement(OutputPlain, { Message = output, }) end end -- ▼ ReadonlyArray.map ▼ local _newValue = table.create(#_output) for _k, _v in ipairs(_output) do _newValue[_k] = _arg0(_v, _k - 1, _output) end -- ▲ ReadonlyArray.map ▲ local _attributes = { AutoScrollToEnd = true, Padding = { PaddingHorizontal = 5, PaddingVertical = 5, }, ItemPadding = UDim.new(0, 5), } local _children = {} local _length = #_children for _k, _v in ipairs(_newValue) do _children[_length + _k] = _v end return Roact.createElement(ScrollView, _attributes, _children) end, }) end end local mapStateToProps = function(state) local _binding = state local filter = _binding.filter local output = state.output if filter then if filter.Context ~= nil then local _output = output local _arg0 = function(message) return isContextMessage(message) and message.context == filter.Context end -- ▼ ReadonlyArray.filter ▼ local _newValue = {} local _length = 0 for _k, _v in ipairs(_output) do if _arg0(_v, _k - 1, _output) == true then _length += 1 _newValue[_length] = _v end end -- ▲ ReadonlyArray.filter ▲ output = _newValue end local _searchQuery = filter.SearchQuery if type(_searchQuery) == "string" then local _binding_1 = filter local SearchQuery = _binding_1.SearchQuery local _output = output local _arg0 = function(message) return StringUtils.includes(getMessageText(message), SearchQuery) end -- ▼ ReadonlyArray.filter ▼ local _newValue = {} local _length = 0 for _k, _v in ipairs(_output) do if _arg0(_v, _k - 1, _output) == true then _length += 1 _newValue[_length] = _v end end -- ▲ ReadonlyArray.filter ▲ output = _newValue end local _output = output local _arg0 = function(message) local _levels = filter.Levels local _arg0_1 = getLogLevel(message) return _levels[_arg0_1] ~= nil end -- ▼ ReadonlyArray.filter ▼ local _newValue = {} local _length = 0 for _k, _v in ipairs(_output) do if _arg0(_v, _k - 1, _output) == true then _length += 1 _newValue[_length] = _v end end -- ▲ ReadonlyArray.filter ▲ output = _newValue end local _object = {} local _left = "output" local _result = filter if _result ~= nil then _result = _result.Tail end _object[_left] = _result and last(output, 25) or last(output, 100) _object.showTags = state.showTagsInOutput return _object end --[[ * * A docked console ]] local ZirconOutput = connect(mapStateToProps)(OutputComponent) local default = ZirconOutput return { default = default, }