repo
stringclasses
350 values
file_path
stringlengths
29
200
language
stringclasses
2 values
file_type
stringclasses
4 values
code
stringlengths
2
1.01M
tokens
int64
2
598k
evaera/Cmdr
evaera-Cmdr-3d7db3f/Cmdr/BuiltInTypes/Team.luau
luau
.luau
const Teams = game:GetService("Teams") return function(registry: any) const teamType = { Transform = function(text: string): { Team } const findTeam = registry.Cmdr.Util.MakeFuzzyFinder(Teams:GetTeams()) return findTeam(text) end, Validate = function(teams: { Team }): (boolean, string?) return #teams ...
350
evaera/Cmdr
evaera-Cmdr-3d7db3f/Cmdr/BuiltInTypes/Type.luau
luau
.luau
return function(registry: any) const typeType = { Transform = function(text: string): { string } const findType = registry.Cmdr.Util.MakeFuzzyFinder(registry:GetTypeNames()) return findType(text) end, Validate = function(types: { string }): (boolean, string?) return #types > 0, "No type with that name ...
161
evaera/Cmdr
evaera-Cmdr-3d7db3f/Cmdr/BuiltInTypes/URL.luau
luau
.luau
return function(registry: any) const urlType = { Validate = function(text: string): (boolean, string?) if text:match("^https?://.+$") then return true end return false, "URLs must begin with http:// or https://" end, Parse = function(text: string): string return text end, } registry:Regist...
116
evaera/Cmdr
evaera-Cmdr-3d7db3f/Cmdr/BuiltInTypes/UserInput.luau
luau
.luau
const combinedInputEnums: { EnumItem } = {} for _, enum: Enum.UserInputType in ipairs(Enum.UserInputType:GetEnumItems()) do combinedInputEnums[#combinedInputEnums + 1] = enum end for _, enum: Enum.KeyCode in ipairs(Enum.KeyCode:GetEnumItems()) do combinedInputEnums[#combinedInputEnums + 1] = enum end return functio...
249
evaera/Cmdr
evaera-Cmdr-3d7db3f/Cmdr/CmdrClient/CmdrInterface/AutoComplete.luau
luau
.luau
const VALID_TEXT_COLOR = Color3.fromRGB(255, 255, 255) const INVALID_TEXT_COLOR = Color3.fromRGB(255, 73, 73) const TEXT_MEASUREMENT_SIZE = Vector2.new(1000, 1000) --[=[ @class AutoComplete @ignore Handles the Cmdr suggestions interface. ]=] return function(CmdrClient) const autoCompleteFrame = CmdrClient.Gui:Wai...
1,809
evaera/Cmdr
evaera-Cmdr-3d7db3f/Cmdr/CmdrClient/CmdrInterface/CreateGui.luau
luau
.luau
const Players = game:GetService("Players") const StarterGui = game:GetService("StarterGui") const Player = Players.LocalPlayer const PlayerGui = Player:WaitForChild("PlayerGui") return function(): ScreenGui if StarterGui:FindFirstChild("Cmdr") then return PlayerGui:WaitForChild("Cmdr") end const Cmdr = Instance...
2,216
evaera/Cmdr
evaera-Cmdr-3d7db3f/Cmdr/CmdrClient/CmdrInterface/Window.luau
luau
.luau
const GuiService = game:GetService("GuiService") const Players = game:GetService("Players") const TextChatService = game:GetService("TextChatService") const UserInputService = game:GetService("UserInputService") const WINDOW_MAX_HEIGHT = 300 const MOUSE_TOUCH_INPUTS = { Enum.UserInputType.MouseButton1, Enum.UserInput...
4,734
evaera/Cmdr
evaera-Cmdr-3d7db3f/Cmdr/CmdrClient/CmdrInterface/init.luau
luau
.luau
const CreateGui = require("@self/CreateGui") const WindowModule = require("@self/Window") const AutoCompleteModule = require("@self/AutoComplete") return function(CmdrClient) CmdrClient.Gui = CreateGui() const AutoComplete = AutoCompleteModule(CmdrClient) const Window = WindowModule(CmdrClient, AutoComplete) Win...
107
evaera/Cmdr
evaera-Cmdr-3d7db3f/Cmdr/CmdrClient/DefaultEventHandlers.luau
luau
.luau
const TextChatService = game:GetService("TextChatService") const TEXT_CHANNELS = TextChatService:WaitForChild("TextChannels") const RBXSYSTEM_CHANNEL: TextChannel = TEXT_CHANNELS:WaitForChild("RBXSystem") return function(CmdrClient) CmdrClient:HandleEvent("Message", function(text: string) RBXSYSTEM_CHANNEL:Display...
167
evaera/Cmdr
evaera-Cmdr-3d7db3f/Cmdr/CmdrClient/Shared/BuiltInGuards/IsDataStoreAvailable.luau
luau
.luau
const RunService = game:GetService("RunService") return function(index: number) return function(context: any): string? const argContext = context:GetArgument(index) local key = if argContext then argContext:GetValue() else nil if type(key) ~= "string" then return nil end local saved = true if key:su...
217
evaera/Cmdr
evaera-Cmdr-3d7db3f/Cmdr/CmdrClient/Shared/BuiltInGuards/MaxArrayLength.luau
luau
.luau
return function(index: number, maxCount: number) return function(context: any): string? const argContext = context:GetArgument(index) const value = argContext and argContext:GetValue() return if typeof(value) == "table" and #value > maxCount then `Argument #{index} exceeds the maximum allowed limit of {maxCo...
86
evaera/Cmdr
evaera-Cmdr-3d7db3f/Cmdr/CmdrClient/Shared/BuiltInGuards/MaxStringLength.luau
luau
.luau
return function(index: number, maxLength: number) return function(context: any): string? const argContext = context:GetArgument(index) const value = argContext and argContext:GetValue() return if typeof(value) == "string" and #value > maxLength then `Argument #{index} exceeds the maximum character limit of {...
80
evaera/Cmdr
evaera-Cmdr-3d7db3f/Cmdr/CmdrClient/Shared/BuiltInGuards/NonEmptyString.luau
luau
.luau
return function(index: number) return function(context: any): string? const argContext = context:GetArgument(index) const value = argContext and argContext:GetValue() return if typeof(value) ~= "string" or value:match("^%s*$") then `Argument #{index} cannot be empty or blank.` else nil end end
77
evaera/Cmdr
evaera-Cmdr-3d7db3f/Cmdr/CmdrClient/Shared/BuiltInGuards/NotEquals.luau
luau
.luau
return function(index: number, forbiddenValue: any) return function(context: any): string? const argContext = context:GetArgument(index) const value = argContext and argContext:GetValue() return if value == forbiddenValue then `Argument #{index} cannot be "{forbiddenValue}".` else nil end end
69
evaera/Cmdr
evaera-Cmdr-3d7db3f/Cmdr/CmdrClient/Shared/Registry.luau
luau
.luau
const RunService = game:GetService("RunService") const Util = require("./Util") const IS_SERVER = RunService:IsServer() const IS_CLIENT = RunService:IsClient() const TYPE_METHODS = Util.MakeDictionary({ "Transform", "Validate", "Autocomplete", "Parse", "DisplayName", "Listable", "ValidateOnce", "Prefixes", ...
5,792
evaera/Cmdr
evaera-Cmdr-3d7db3f/Cmdr/CmdrClient/init.luau
luau
.luau
const RunService = game:GetService("RunService") const IS_CLIENT = RunService:IsClient() assert( IS_CLIENT, "[Cmdr] The Cmdr client library cannot be required by the server. Please require the server libary instead." ) const Dispatcher = require("@self/Shared/Dispatcher") const Registry = require("@self/Shared/Regi...
2,164
evaera/Cmdr
evaera-Cmdr-3d7db3f/Cmdr/init.luau
luau
.luau
const ReplicatedStorage = game:GetService("ReplicatedStorage") const RunService = game:GetService("RunService") const IS_SERVER_CONTAINER = script:FindFirstAncestorWhichIsA("ServerScriptService") or script:FindFirstAncestorWhichIsA("ServerStorage") const IS_SERVER = RunService:IsServer() if not IS_SERVER_CONTAINER t...
1,005
centau/vide
centau-vide-f3bfc65/init.luau
luau
.luau
local vide = require "@self/src/lib" export type source<T> = vide.source<T> export type Source<T> = vide.Source<T> export type context<T> = vide.context<T> export type Context<T> = vide.Context<T> export type Instances = vide.Instances export type Properties<T> = vide.Properties<T> return vide
70
centau/vide
centau-vide-f3bfc65/src/action.luau
luau
.luau
type Action = { priority: number, callback: (Instance) -> () } local ActionMT = table.freeze {} local function is_action(v: any) return getmetatable(v) == ActionMT end local function action(callback: (Instance) -> (), priority: number?): Action local a = { priority = priority or 1, ca...
111
centau/vide
centau-vide-f3bfc65/src/apply.luau
luau
.luau
local typeof = game and typeof or require "../test/mock".typeof :: never local flags = require "./flags" local implicit_effect = require "./implicit_effect" local _, is_action = require "./action"() local graph = require "./graph" type Node<T> = graph.Node<T> type Array<V> = { V } type ArrayOrV<V> = {ArrayOrV<V>} | V...
1,226
centau/vide
centau-vide-f3bfc65/src/batch.luau
luau
.luau
local flags = require "./flags" local graph = require "./graph" local function batch(setter: () -> ()) local already_batching = flags.batch local from if not already_batching then flags.batch = true from = graph.get_update_queue_length() end local ok, err: string? = xpcall(setter,...
131
centau/vide
centau-vide-f3bfc65/src/branch.luau
luau
.luau
local graph = require "./graph" type Node<T> = graph.Node<T> local create_node = graph.create_node local push_scope = graph.push_scope local pop_scope = graph.pop_scope local destroy = graph.destroy local get_scope = graph.get_scope local function branch<T>(fn: () -> T): (() -> (), T) local current = get_scope() ...
223
centau/vide
centau-vide-f3bfc65/src/changed.luau
luau
.luau
local action = require "./action"() local cleanup = require "./cleanup" local function changed<T>(property: string, callback: (T) -> ()) return action(function(instance) local con = instance:GetPropertyChangedSignal(property):Connect(function() callback((instance :: any)[property]) end)...
91
centau/vide
centau-vide-f3bfc65/src/cleanup.luau
luau
.luau
local typeof = game and typeof or require "../test/mock".typeof :: never local graph = require "./graph" local get_scope = graph.get_scope local push_cleanup = graph.push_cleanup local function helper(obj: any) return if typeof(obj) == "RBXScriptConnection" then function() obj:Disconnect() end els...
365
centau/vide
centau-vide-f3bfc65/src/context.luau
luau
.luau
local graph = require "./graph" type Node<T> = graph.Node<T> local create_node = graph.create_node local get_scope = graph.get_scope local push_scope = graph.push_scope local pop_scope = graph.pop_scope local set_context = graph.set_context export type Context<T> = (() -> T) & (<U>(T, () -> U) -> U) local nil_symbol ...
456
centau/vide
centau-vide-f3bfc65/src/create.luau
luau
.luau
local typeof = game and typeof or require "../test/mock".typeof :: never local Instance = game and Instance or require "../test/mock".Instance :: never local defaults = require "./defaults" local apply = require "./apply" local flags = require "./flags" local function create_constructor_for_class(class: string): ({ [...
878
centau/vide
centau-vide-f3bfc65/src/defaults.luau
luau
.luau
local Enum = game and Enum or require "../test/mock".Enum :: never local Color3 = game and Color3 or require "../test/mock".Color3 :: never return { Part = { Material = Enum.Material.SmoothPlastic, Size = vector.create(1, 1, 1), Anchored = true }, BillboardGui = { ResetOnSp...
843
centau/vide
centau-vide-f3bfc65/src/derive.luau
luau
.luau
local graph = require "./graph" local create_node = graph.create_node local push_scope_as_child_of = graph.push_scope_as_child_of local assert_stable_scope = graph.assert_stable_scope local evaluate_node = graph.evaluate_node local function derive<T>(source: () -> T): () -> T local node = create_node(assert_stable...
111
centau/vide
centau-vide-f3bfc65/src/effect.luau
luau
.luau
local graph = require "./graph" local create_node = graph.create_node local assert_stable_scope = graph.assert_stable_scope local evaluate_node = graph.evaluate_node local function effect<T>(callback: (T) -> T, initial_value: T) local node = create_node(assert_stable_scope(), callback, initial_value) evaluate...
106
centau/vide
centau-vide-f3bfc65/src/flags.luau
luau
.luau
local function inline_test(): string return debug.info(1, "n") end local is_O2 = inline_test() ~= "inline_test" return { strict = not is_O2, defaults = true, defer_nested_properties = true, batch = false, }
60
centau/vide
centau-vide-f3bfc65/src/graph.luau
luau
.luau
local flags = require "./flags" export type SourceNode<T> = { cache: T, [number]: Node<T> } export type Node<T> = { cache: T, effect: ((T) -> T) | false, cleanups: { () -> () } | false, context: { [number]: unknown } | false, owned: { Node<T> } | false, owner: Node<T> | false, ...
2,028
centau/vide
centau-vide-f3bfc65/src/implicit_effect.luau
luau
.luau
local graph = require "./graph" type Node<T> = graph.Node<T> local create_node = graph.create_node local assert_stable_scope = graph.assert_stable_scope local get_scope = graph.get_scope local evaluate_node = graph.evaluate_node local push_cleanup = graph.push_cleanup local function update_property_effect(p: { ins...
794
centau/vide
centau-vide-f3bfc65/src/indexes.luau
luau
.luau
local flags = require "./flags" local branch = require "./branch" local source = require "./source" local effect = require "./effect" local timeout = require "./timeout" () type Array<T> = { T } type Map<K, V> = { [K]: V } type Source<T> = () -> T local function indexes<K, V, Obj>( input: Source<Map<K, V>>, c...
690
centau/vide
centau-vide-f3bfc65/src/init.luau
luau
.luau
assert(game, "when using vide outside of Roblox, require lib.luau instead") local vide = require("@self/lib") export type source<T> = vide.source<T> export type Source<T> = vide.Source<T> export type context<T> = vide.context<T> export type Context<T> = vide.Context<T> export type Instances = vide.Instances export ty...
87
centau/vide
centau-vide-f3bfc65/src/lib.luau
luau
.luau
local version = { major = 0, minor = 4, patch = 1 } local root = require "./root" local branch = require "./branch" local mount = require "./mount" local create = require "./create" local apply = require "./apply" local source = require "./source" local effect = require "./effect" local derive = require "./derive" loc...
733
centau/vide
centau-vide-f3bfc65/src/mount.luau
luau
.luau
local root = require "./root" local apply = require "./apply" local function mount<T>(component: () -> T, target: Instance?): () -> () return root(function() local result = component() if target then apply(target, { result }) end end) end return mount :: (<T>(component: () -> T, target: Instan...
91
centau/vide
centau-vide-f3bfc65/src/read.luau
luau
.luau
local function read<T>(value: T | () -> T): T return if type(value) == "function" then value() else value end return read
36
centau/vide
centau-vide-f3bfc65/src/root.luau
luau
.luau
local graph = require "./graph" type Node<T> = graph.Node<T> local create_node = graph.create_node local push_scope = graph.push_scope local pop_scope = graph.pop_scope local destroy = graph.destroy local refs = {} local function root<T...>(fn: (destroy: () -> ()) -> T...): (() -> (), T...) local node = create_no...
232
centau/vide
centau-vide-f3bfc65/src/show.luau
luau
.luau
local source = require "./source" local derive = require "./derive" local effect = require "./effect" local untrack = require "./untrack" local switch = require "./switch" type Array<T> = { T } type Source<T> = () -> T local function show<T, Obj>( input: Source<T?>, component: (Source<T>, Source<boolean>) -> ...
207
centau/vide
centau-vide-f3bfc65/src/source.luau
luau
.luau
local graph = require "./graph" type Node<T> = graph.Node<T> local create_source_node = graph.create_source_node local push_scope_as_child_of = graph.push_scope_as_child_of local update_descendants = graph.update_descendants export type Source<T> = (() -> T) & ((value: T) -> T) local function source<T>(initial_value:...
221
centau/vide
centau-vide-f3bfc65/src/switch.luau
luau
.luau
local branch = require "./branch" local source = require "./source" local effect = require "./effect" local timeout = require "./timeout" () type Array<T> = { T } type Map<K, V> = { [K]: V } type Source<T> = () -> T type Component<T> = (Source<boolean>) -> (T, ...number) local function switch_map<K, Obj>( input: ...
624
centau/vide
centau-vide-f3bfc65/src/timeout.luau
luau
.luau
local queue = {} :: { { t: number, fn: () -> (), cancel: boolean } } local function timeout(t: number, fn: () -> ()) local handle = { t = t, fn = fn, cancel = false } table.insert(queue, handle) return handle end local function update_timeouts(dt: number) for i = #queue, 1, -1 do local han...
162
centau/vide
centau-vide-f3bfc65/src/untrack.luau
luau
.luau
local graph = require "./graph" type Node<T> = graph.Node<T> local get_scope = graph.get_scope local function untrack<T>(source: () -> T): T local scope = get_scope() if scope then -- sources are only tracked if the node in scope has an effect local effect = scope.effect scope.effe...
162
centau/vide
centau-vide-f3bfc65/src/values.luau
luau
.luau
local flags = require "./flags" local branch = require "./branch" local source = require "./source" local effect = require "./effect" local timeout = require "./timeout" () type Array<T> = { T } type Map<K, V> = { [K]: V } type Source<T> = () -> T local function values<K, V, Obj>( input: Source<Map<K, V>>, co...
754
SirMallard/Iris
SirMallard-Iris-801973f/lib/API.lua
luau
.lua
local Types = require(script.Parent.Types) return function(Iris: Types.Iris) -- basic wrapper for nearly every widget, saves space. local function wrapper(name) return function(arguments, states) return Iris.Internal._Insert(name, arguments, states) end end --[[ ...
15,272
SirMallard/Iris
SirMallard-Iris-801973f/lib/Internal.lua
luau
.lua
local Types = require(script.Parent.Types) return function(Iris: Types.Iris): Types.Internal --[=[ @class Internal An internal class within Iris containing all the backend data and functions for Iris to operate. It is recommended that you don't generally interact with Internal unless ...
7,080
SirMallard/Iris
SirMallard-Iris-801973f/lib/PubTypes.lua
luau
.lua
local Types = require(script.Parent.Types) export type ID = Types.ID export type State<T> = Types.State<T> export type Widget = Types.Widget export type Root = Types.Root export type Window = Types.Window export type Tooltip = Types.Tooltip export type MenuBar = Types.MenuBar export type Menu = Types.Menu ...
322
SirMallard/Iris
SirMallard-Iris-801973f/lib/Types.lua
luau
.lua
local WidgetTypes = require(script.Parent.WidgetTypes) export type ID = WidgetTypes.ID export type State<T> = WidgetTypes.State<T> export type Hovered = WidgetTypes.Hovered export type Clicked = WidgetTypes.Clicked export type RightClicked = WidgetTypes.RightClicked export type DoubleClicked = WidgetTypes.Dou...
5,429
SirMallard/Iris
SirMallard-Iris-801973f/lib/WidgetTypes.lua
luau
.lua
--[=[ @within Iris @type ID string ]=] export type ID = string --[=[ @within State @type State<T> { ID: ID, value: T, get: (self) -> T, set: (self, newValue: T) -> T, onChange: (self, callback: (newValue: T) -> ()) -> (), ConnectedWidgets: { [ID]: Widget }, ConnectedFunctions: { (newValue: T) -...
2,630
SirMallard/Iris
SirMallard-Iris-801973f/lib/config.lua
luau
.lua
local TemplateConfig = { colorDark = { -- Dear, ImGui default dark TextColor = Color3.fromRGB(255, 255, 255), TextTransparency = 0, TextDisabledColor = Color3.fromRGB(128, 128, 128), TextDisabledTransparency = 0, -- Dear ImGui uses 110, 110, 125 -- The Roblox...
3,445
SirMallard/Iris
SirMallard-Iris-801973f/lib/widgets/Button.lua
luau
.lua
local Types = require(script.Parent.Parent.Types) return function(Iris: Types.Internal, widgets: Types.WidgetUtility) local abstractButton = { hasState = false, hasChildren = false, Args = { ["Text"] = 1, ["Size"] = 2, }, Events = { ...
707
SirMallard/Iris
SirMallard-Iris-801973f/lib/widgets/Checkbox.lua
luau
.lua
local Types = require(script.Parent.Parent.Types) return function(Iris: Types.Internal, widgets: Types.WidgetUtility) --stylua: ignore Iris.WidgetConstructor("Checkbox", { hasState = true, hasChildren = false, Args = { ["Text"] = 1, }, Events = { ...
994
SirMallard/Iris
SirMallard-Iris-801973f/lib/widgets/Combo.lua
luau
.lua
local Types = require(script.Parent.Parent.Types) return function(Iris: Types.Internal, widgets: Types.WidgetUtility) --stylua: ignore Iris.WidgetConstructor("Selectable", { hasState = true, hasChildren = false, Args = { ["Text"] = 1, ["Index"] = 2, ...
4,577
SirMallard/Iris
SirMallard-Iris-801973f/lib/widgets/Format.lua
luau
.lua
local Types = require(script.Parent.Parent.Types) return function(Iris: Types.Internal, widgets: Types.WidgetUtility) --stylua: ignore Iris.WidgetConstructor("Separator", { hasState = false, hasChildren = false, Args = {}, Events = {}, Generate = function(thisWi...
1,200
SirMallard/Iris
SirMallard-Iris-801973f/lib/widgets/Image.lua
luau
.lua
local Types = require(script.Parent.Parent.Types) return function(Iris: Types.Internal, widgets: Types.WidgetUtility) local abstractImage = { hasState = false, hasChildren = false, Args = { ["Image"] = 1, ["Size"] = 2, ["Rect"] = 3, ...
1,249
SirMallard/Iris
SirMallard-Iris-801973f/lib/widgets/Input.lua
luau
.lua
local Types = require(script.Parent.Parent.Types) type InputDataTypes = "Num" | "Vector2" | "Vector3" | "UDim" | "UDim2" | "Color3" | "Color4" | "Rect" | "Enum" | "" | string type InputType = "Input" | "Drag" | "Slider" return function(Iris: Types.Internal, widgets: Types.WidgetUtility) local numberChanged ...
12,590
SirMallard/Iris
SirMallard-Iris-801973f/lib/widgets/Menu.lua
luau
.lua
local Types = require(script.Parent.Parent.Types) return function(Iris: Types.Internal, widgets: Types.WidgetUtility) local AnyMenuOpen = false local ActiveMenu: Types.Menu? = nil local MenuStack: { Types.Menu } = {} local function EmptyMenuStack(menuIndex: number?) for index = #MenuSt...
4,927
SirMallard/Iris
SirMallard-Iris-801973f/lib/widgets/Plot.lua
luau
.lua
local Types = require(script.Parent.Parent.Types) return function(Iris: Types.Internal, widgets: Types.WidgetUtility) -- stylua: ignore Iris.WidgetConstructor("ProgressBar", { hasState = true, hasChildren = false, Args = { ["Text"] = 1, ["Format"] = 2, ...
5,541
SirMallard/Iris
SirMallard-Iris-801973f/lib/widgets/RadioButton.lua
luau
.lua
local Types = require(script.Parent.Parent.Types) return function(Iris: Types.Internal, widgets: Types.WidgetUtility) --stylua: ignore Iris.WidgetConstructor("RadioButton", { hasState = true, hasChildren = false, Args = { ["Text"] = 1, ["Index"] = 2, ...
1,087
SirMallard/Iris
SirMallard-Iris-801973f/lib/widgets/Root.lua
luau
.lua
local Types = require(script.Parent.Parent.Types) return function(Iris: Types.Internal, widgets: Types.WidgetUtility) local NumNonWindowChildren: number = 0 --stylua: ignore Iris.WidgetConstructor("Root", { hasState = false, hasChildren = true, Args = {}, Events =...
1,437
SirMallard/Iris
SirMallard-Iris-801973f/lib/widgets/Tab.lua
luau
.lua
local Types = require(script.Parent.Parent.Types) return function(Iris: Types.Internal, widgets: Types.WidgetUtility) local function openTab(TabBar: Types.TabBar, Index: number) if TabBar.state.index.value > 0 then return end TabBar.state.index:set(Index) end ...
2,889
SirMallard/Iris
SirMallard-Iris-801973f/lib/widgets/Table.lua
luau
.lua
local Types = require(script.Parent.Parent.Types) -- Tables need an overhaul. --[[ Iris.Table( { NumColumns, Header, RowBackground, OuterBorders, InnerBorders } ) Config = { CellPadding: Vector2, CellSize: UDim2, } Iris.NextColumn() Iris.NextRow() Iris.SetColumnIn...
5,548
SirMallard/Iris
SirMallard-Iris-801973f/lib/widgets/Text.lua
luau
.lua
local Types = require(script.Parent.Parent.Types) return function(Iris: Types.Internal, widgets: Types.WidgetUtility) --stylua: ignore Iris.WidgetConstructor("Text", { hasState = false, hasChildren = false, Args = { ["Text"] = 1, ["Wrapped"] = 2, ...
1,082
SirMallard/Iris
SirMallard-Iris-801973f/lib/widgets/Tree.lua
luau
.lua
local Types = require(script.Parent.Parent.Types) return function(Iris: Types.Internal, widgets: Types.WidgetUtility) local abstractTree = { hasState = true, hasChildren = true, Events = { ["collapsed"] = { ["Init"] = function(_thisWidget: Types.Collapsin...
2,614
SirMallard/Iris
SirMallard-Iris-801973f/lib/widgets/Window.lua
luau
.lua
local Types = require(script.Parent.Parent.Types) return function(Iris: Types.Internal, widgets: Types.WidgetUtility) local function relocateTooltips() if Iris._rootInstance == nil then return end local PopupScreenGui = Iris._rootInstance:FindFirstChild("PopupScreenGui") ...
10,433
SirMallard/Iris
SirMallard-Iris-801973f/lib/widgets/init.lua
luau
.lua
local Types = require(script.Parent.Types) local widgets = {} :: Types.WidgetUtility return function(Iris: Types.Internal) widgets.GuiService = game:GetService("GuiService") widgets.RunService = game:GetService("RunService") widgets.UserInputService = game:GetService("UserInputService") widget...
4,284
SirMallard/Iris
SirMallard-Iris-801973f/src/client/helloIris.client.lua
luau
.lua
local ReplicatedStorage = game:GetService("ReplicatedStorage") local Iris = require(ReplicatedStorage.Iris).Init() Iris:Connect(Iris.ShowDemoWindow)
36
SirMallard/Iris
SirMallard-Iris-801973f/src/libraries/UserInputService/Signal.lua
luau
.lua
-------------------------------------------------------------------------------- -- Batched Yield-Safe Signal Implementation -- -- This is a Signal class which has effectively identical behavior to a -- -- normal RBXScriptSignal, with the only difference being a couple extra ...
1,419
SirMallard/Iris
SirMallard-Iris-801973f/src/libraries/UserInputService/init.lua
luau
.lua
local Signal = require(script.Signal) local UserInputService: UserInputService = game:GetService("UserInputService") local Input = {} Input.X = 0 Input.Y = 0 Input.KeyDown = {} Input._connections = {} -- This frame will act as our UserInputService detector. Most events should go through it. -- it's not ...
480
SirMallard/Iris
SirMallard-Iris-801973f/src/plugins/examplePlugin.client.lua
luau
.lua
local Iris = require(script.Parent.Iris) local Input = require(script.Parent.UserInputService) -- Create the plugin toolbar, button and dockwidget for Iris to work in. local widgetInfo = DockWidgetPluginGuiInfo.new(Enum.InitialDockState.Float, false, false, 200, 300) local Toolbar = plugin:CreateToolbar("Iris")...
493
SirMallard/Iris
SirMallard-Iris-801973f/stories/exampleStory.story.lua
luau
.lua
local ReplicatedStorage = game:GetService("ReplicatedStorage") local Types = require(ReplicatedStorage.Iris.PubTypes) return function(parent: GuiObject) local Iris: Types.Iris = require(ReplicatedStorage.Iris) local Input = require(script.Parent.UserInputService) Input.SinkFrame.Parent = parent ...
239
littensy/charm
littensy-charm-b05f3a9/.lute/build.luau
luau
.luau
local fs = require("@std/fs") local process = require("@lute/process") fs.createDirectory("build") process.run({ "rojo", "build", "--output=build/charm.rbxm", "build.project.json" }, { stdio = "inherit" })
57
littensy/charm
littensy-charm-b05f3a9/.lute/check.luau
luau
.luau
local fs = require("@std/fs") local net = require("@std/net") local process = require("@lute/process") process.run({ "rojo", "sourcemap", "--output=sourcemap.json" }, { stdio = "inherit" }) fs.writeStringToFile( "roblox.d.luau", net.request("https://luau-lsp.pages.dev/globalTypes.None.d.luau", { method = "GET" }).b...
278
littensy/charm
littensy-charm-b05f3a9/.lute/test.luau
luau
.luau
(require)("../tests/run.server")
7
littensy/charm
littensy-charm-b05f3a9/benches/bench.luau
luau
.luau
local profiles: { [string]: number } = {} local times: { [string]: number } = {} local stack: { string } = {} local function run(name: string, test: () -> ()) local start = os.clock() local iter = 0 table.clear(profiles) table.clear(times) table.clear(stack) while os.clock() - start < 2 do iter += 1 test()...
283
littensy/charm
littensy-charm-b05f3a9/benches/mapped.luau
luau
.luau
local Charm = require("../packages/charm/src") local bench = require("./bench") local computed = Charm.computed local mapped = Charm.mapped local signal = Charm.signal type Key = number type Value = number local count = 512 local initialState: { [Key]: Value } = table.create(count, 0) local function expensiveOperat...
488
littensy/charm
littensy-charm-b05f3a9/benches/multi.luau
luau
.luau
local Charm = require("../packages/charm/src") local bench = require("./bench") type Atom<T> = Charm.Atom<T> local signal = Charm.atom local computed = Charm.computed local effect = Charm.effect local function busy(): number local a = 0 for i = 1, 100 do a += 1 end return a end do local head = signal(0) loc...
999
littensy/charm
littensy-charm-b05f3a9/benches/propagate.luau
luau
.luau
local Charm = require("../packages/charm/src") local bench = require("./bench") local computed = Charm.computed local effect = Charm.effect local listen = Charm.listen local signal = Charm.signal for _, w in { 10, 100 } do for _, h in { 10, 100 } do bench.run(`propagate {w}*{h}`, function() local src, setSrc = ...
310
littensy/charm
littensy-charm-b05f3a9/benches/reactive.luau
luau
.luau
local Charm = require("../packages/charm/src") local DeepCharm = require("../packages/deep-charm/src") local bench = require("./bench") local effect = Charm.effect local reactive = DeepCharm.reactive do local value = reactive({ a = 1 }) bench.run("track reactive property", function() effect(function() local _ ...
473
littensy/charm
littensy-charm-b05f3a9/packages/charm-sync/Charm.luau
luau
.luau
if not script then return require("../charm/src") end local Charm = require(script.Parent.Parent.charm.src) export type Atom<T> = Charm.Atom<T> return Charm
38
littensy/charm
littensy-charm-b05f3a9/packages/charm-sync/src/config.luau
luau
.luau
return { --[[ The interval at which to send patches to the client, in seconds. Defaults to `0` (patches are sent up to once per frame). Set to a negative value to disable automatic syncing. ]] interval = 0, --[[ Whether the history of state changes since the client's last update should be preserved. This ...
288
littensy/charm
littensy-charm-b05f3a9/packages/charm-sync/src/init.luau
luau
.luau
local client = require("@self/client") local config = require("@self/config") local patch = require("@self/patch") local server = require("@self/server") local types = require("@self/types") local utils = require("@self/utils") export type None = types.None export type SyncPayload = types.SyncPayload return { config...
108
littensy/charm
littensy-charm-b05f3a9/packages/charm-sync/src/patch.luau
luau
.luau
local Charm = require("../Charm") local config = require("./config") local types = require("./types") local validate = require("./validate") local flags = Charm.flags export type None = types.None local None: None = { __none = "__none" } --[[ Checks whether a value is `None`. If `true`, the value is scheduled to b...
934
littensy/charm
littensy-charm-b05f3a9/packages/charm-sync/src/server.luau
luau
.luau
local Charm = require("../Charm") local config = require("./config") local patch = require("./patch") local types = require("./types") local utils = require("./utils") type SyncPayload = types.SyncPayload type SyncStatus = number type ClientKeys = { [string]: SyncStatus } type TrackedState<T = any> = { identifier:...
2,565
littensy/charm
littensy-charm-b05f3a9/packages/charm-sync/src/types.luau
luau
.luau
--[[ A payload that can be sent from the server to the client to synchronize the states of the client's atoms with the server. ]] export type SyncPayload = | { type: "init", data: { [string]: any }, } | { type: "patch", data: { [string]: any }, } --[[ A special type that represents a removed value in a ...
183
littensy/charm
littensy-charm-b05f3a9/packages/charm-sync/src/utils.luau
luau
.luau
local Charm = require("../Charm") type Atom<T> = Charm.Atom<T> --[[ Flattens a nested table into a single table with slash-separated keys. Useful for recursively collecting atoms returned by modules. @param input A nested table. @return A flattened table with slash-separated keys. ]] local function flatten<Flatt...
443
littensy/charm
littensy-charm-b05f3a9/packages/charm-sync/src/validate.luau
luau
.luau
local function isTableUnsafe(object: { [any]: any }) local firstKey = next(object) if firstKey == nil then return false end local keyType = type(firstKey) local maxKey = 0 -- Keys must all be the same type for key in object do if type(key) ~= keyType then return true elseif type(key) == "number" and ...
320
littensy/charm
littensy-charm-b05f3a9/packages/deep-charm/Charm.luau
luau
.luau
if not script then return require("../charm/src") end return require(script.Parent.Parent.charm.src)
22
littensy/charm
littensy-charm-b05f3a9/packages/react-charm/Charm.luau
luau
.luau
return require(script.Parent.Parent.charm.src)
9
littensy/charm
littensy-charm-b05f3a9/packages/react-charm/React.luau
luau
.luau
return require(script.Parent.Parent.Parent:WaitForChild("@rbxts-js").React)
18
littensy/charm
littensy-charm-b05f3a9/packages/react-charm/ReactRoblox.luau
luau
.luau
return require(script.Parent.Parent.Parent:WaitForChild("@rbxts-js").ReactRoblox)
20
littensy/charm
littensy-charm-b05f3a9/packages/react-charm/src/init.luau
luau
.luau
local Charm = require("./Charm") local React = require("./React") --[[ Returns a React state that updates when the getter function updates. Re-renders the component when the value changes. If the `dependencies` array is provided, a new effect is created for the current `getter` when the dependencies change. Other...
386
littensy/charm
littensy-charm-b05f3a9/packages/vide-charm/Vide.luau
luau
.luau
return require(script.Parent.Parent.vide.src)
9
littensy/charm
littensy-charm-b05f3a9/packages/vide-charm/src/init.luau
luau
.luau
local Charm = require("./Charm") local Vide = require("./Vide") --[[ Returns a reactive source that subscribes to the current value of the given signal or getter function. @param getter The getter function to subscribe to. @return The reactive source. ]] local function useSignalState<State>(getter: () -> State): ...
123
littensy/charm
littensy-charm-b05f3a9/tests/run.server.luau
luau
.luau
local Charm = require("../packages/charm/src") local test = require("./test") Charm.flags.strict = true Charm.flags.frozen = true local describeInRoblox = test.describeIf(function() return not not game end) test.describe("charm", function() require("../packages/charm/test") end) test.describe("charm-sync", functi...
152
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Animation/ExternalTime.luau
luau
.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Outputs the current external time as a state object. ]] local Package = script.Parent.Parent local Types = require(Package.Types) local External = require(Package.External) -- Graph local change = ...
545
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Animation/Stopwatch.luau
luau
.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ State object for measuring time since an event using a reference timer. TODO: this should not be exposed to users until it has a proper reactive API surface ]] local Package = script.Parent.Pare...
743
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Animation/Tween.luau
luau
.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ A specialised state object for following a goal state smoothly over time, using a TweenInfo to shape the motion. https://elttob.uk/Fusion/0.3/api-reference/animation/types/tween/ ]] local Packag...
1,344
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Animation/getTweenDuration.luau
luau
.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Given a `tweenInfo`, returns how many seconds it will take before the tween finishes moving. The result may be infinite if the tween repeats forever. ]] local TweenService = game:GetService("Tween...
174
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Animation/getTweenRatio.luau
luau
.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Given a `tweenInfo` and `currentTime`, returns a ratio which can be used to tween between two values over time. ]] local TweenService = game:GetService("TweenService") local function getTweenRati...
336