diff --git a/README.md b/README.md index 4c4e76e..1f09e3f 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ Ignite is a UI library for developing Roblox plugins. It includes 10+ goregeous ## Getting Started -1. Install Ignite via [Wally](https://wally.run/package/cameronpcampbell/ignite?version=1.0.0) or via [github releases](https://github.com/cameronpcampbell/Ignite/releases). +1. Install Ignite via [Wally](https://wally.run/package/cameronpcampbell/ignite?version=1.2.6) or via [github releases](https://github.com/cameronpcampbell/Ignite/releases). ``` -ignite = "mightypart/ignite@1.0.0" +ignite = "mightypart/ignite@1.2.6" ``` 2. Setup your `default.project.json` (if using rojo). diff --git a/aftman.toml b/aftman.toml deleted file mode 100644 index b6a4a63..0000000 --- a/aftman.toml +++ /dev/null @@ -1,8 +0,0 @@ -# This file lists tools managed by Aftman, a cross-platform toolchain manager. -# For more information, see https://github.com/LPGhatguy/aftman - -# To add a new tool, add an entry to this table. -[tools] -rojo = "rojo-rbx/rojo@7.4.3" -wally = "UpliftGames/wally@0.3.2" -# rojo = "rojo-rbx/rojo@6.2.0" \ No newline at end of file diff --git a/ignite-test.rbxl b/ignite-test.rbxl new file mode 100644 index 0000000..ce48ee7 Binary files /dev/null and b/ignite-test.rbxl differ diff --git a/rokit.toml b/rokit.toml new file mode 100644 index 0000000..6c948b7 --- /dev/null +++ b/rokit.toml @@ -0,0 +1,8 @@ +# This file lists tools managed by Rokit, a toolchain manager for Roblox projects. +# For more information, see https://github.com/rojo-rbx/rokit + +# New tools can be added by running `rokit add ` in a terminal. + +[tools] +rojo = "rojo-rbx/rojo@7.4.3" +wally = "UpliftGames/wally@0.3.2" diff --git a/sourcemap.json b/sourcemap.json index 15d243a..ce44fc0 100644 --- a/sourcemap.json +++ b/sourcemap.json @@ -1 +1 @@ -{"name":"Ignite","className":"DataModel","filePaths":["test_datamodel.project.json"],"children":[{"name":"ServerStorage","className":"ServerStorage","children":[{"name":"Plugin","className":"Folder","children":[{"name":"Main","className":"Script","filePaths":["test/Main.server.luau"]},{"name":"Packages","className":"Folder","children":[{"name":"Fusion","className":"ModuleScript","filePaths":["Packages/Fusion.lua"]},{"name":"Highlighter","className":"ModuleScript","filePaths":["Packages/Highlighter.lua"]},{"name":"_Index","className":"Folder","children":[{"name":"boatbomber_highlighter@0.8.3","className":"Folder","children":[{"name":"highlighter","className":"ModuleScript","filePaths":["Packages/_Index/boatbomber_highlighter@0.8.3/highlighter/src/init.lua","Packages/_Index/boatbomber_highlighter@0.8.3/highlighter/default.project.json"],"children":[{"name":"lexer","className":"ModuleScript","filePaths":["Packages/_Index/boatbomber_highlighter@0.8.3/highlighter/src/lexer/init.lua"],"children":[{"name":"language","className":"ModuleScript","filePaths":["Packages/_Index/boatbomber_highlighter@0.8.3/highlighter/src/lexer/language.lua"]}]},{"name":"theme","className":"ModuleScript","filePaths":["Packages/_Index/boatbomber_highlighter@0.8.3/highlighter/src/theme.lua"]},{"name":"types","className":"ModuleScript","filePaths":["Packages/_Index/boatbomber_highlighter@0.8.3/highlighter/src/types.lua"]},{"name":"utility","className":"ModuleScript","filePaths":["Packages/_Index/boatbomber_highlighter@0.8.3/highlighter/src/utility.lua"]}]}]},{"name":"elttob_fusion@0.3.0","className":"Folder","children":[{"name":"fusion","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/init.luau","Packages/_Index/elttob_fusion@0.3.0/fusion/default.project.json"],"children":[{"name":"Animation","className":"Folder","children":[{"name":"ExternalTime","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Animation/ExternalTime.luau"]},{"name":"Spring","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Animation/Spring.luau"]},{"name":"Stopwatch","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Animation/Stopwatch.luau"]},{"name":"Tween","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Animation/Tween.luau"]},{"name":"getTweenDuration","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Animation/getTweenDuration.luau"]},{"name":"getTweenRatio","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Animation/getTweenRatio.luau"]},{"name":"lerpType","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Animation/lerpType.luau"]},{"name":"packType","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Animation/packType.luau"]},{"name":"springCoefficients","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Animation/springCoefficients.luau"]},{"name":"unpackType","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Animation/unpackType.luau"]}]},{"name":"Colour","className":"Folder","children":[{"name":"Oklab","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Colour/Oklab.luau"]},{"name":"sRGB","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Colour/sRGB.luau"]}]},{"name":"External","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/External.luau"]},{"name":"ExternalDebug","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/ExternalDebug.luau"]},{"name":"Graph","className":"Folder","children":[{"name":"Observer","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Graph/Observer.luau"]},{"name":"castToGraph","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Graph/castToGraph.luau"]},{"name":"change","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Graph/change.luau"]},{"name":"depend","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Graph/depend.luau"]},{"name":"evaluate","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Graph/evaluate.luau"]}]},{"name":"Instances","className":"Folder","children":[{"name":"Attribute","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Instances/Attribute.luau"]},{"name":"AttributeChange","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Instances/AttributeChange.luau"]},{"name":"AttributeOut","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Instances/AttributeOut.luau"]},{"name":"Child","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Instances/Child.luau"]},{"name":"Children","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Instances/Children.luau"]},{"name":"Hydrate","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Instances/Hydrate.luau"]},{"name":"New","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Instances/New.luau"]},{"name":"OnChange","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Instances/OnChange.luau"]},{"name":"OnEvent","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Instances/OnEvent.luau"]},{"name":"Out","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Instances/Out.luau"]},{"name":"applyInstanceProps","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Instances/applyInstanceProps.luau"]},{"name":"defaultProps","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Instances/defaultProps.luau"]}]},{"name":"Logging","className":"Folder","children":[{"name":"formatError","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Logging/formatError.luau"]},{"name":"messages","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Logging/messages.luau"]},{"name":"parseError","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Logging/parseError.luau"]}]},{"name":"Memory","className":"Folder","children":[{"name":"checkLifetime","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Memory/checkLifetime.luau"]},{"name":"deriveScope","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Memory/deriveScope.luau"]},{"name":"deriveScopeImpl","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Memory/deriveScopeImpl.luau"]},{"name":"doCleanup","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Memory/doCleanup.luau"]},{"name":"innerScope","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Memory/innerScope.luau"]},{"name":"legacyCleanup","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Memory/legacyCleanup.luau"]},{"name":"needsDestruction","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Memory/needsDestruction.luau"]},{"name":"poisonScope","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Memory/poisonScope.luau"]},{"name":"scopePool","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Memory/scopePool.luau"]},{"name":"scoped","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Memory/scoped.luau"]},{"name":"whichLivesLonger","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Memory/whichLivesLonger.luau"]}]},{"name":"RobloxExternal","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/RobloxExternal.luau"]},{"name":"State","className":"Folder","children":[{"name":"Computed","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/State/Computed.luau"]},{"name":"For","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/State/For/init.luau"],"children":[{"name":"Disassembly","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/State/For/Disassembly.luau"]},{"name":"ForTypes","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/State/For/ForTypes.luau"]}]},{"name":"ForKeys","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/State/ForKeys.luau"]},{"name":"ForPairs","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/State/ForPairs.luau"]},{"name":"ForValues","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/State/ForValues.luau"]},{"name":"Value","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/State/Value.luau"]},{"name":"castToState","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/State/castToState.luau"]},{"name":"peek","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/State/peek.luau"]},{"name":"updateAll","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/State/updateAll.luau"]}]},{"name":"Types","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Types.luau"]},{"name":"Utility","className":"Folder","children":[{"name":"Contextual","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Utility/Contextual.luau"]},{"name":"Safe","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Utility/Safe.luau"]},{"name":"isSimilar","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Utility/isSimilar.luau"]},{"name":"merge","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Utility/merge.luau"]},{"name":"nameOf","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Utility/nameOf.luau"]},{"name":"never","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Utility/never.luau"]},{"name":"nicknames","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Utility/nicknames.luau"]},{"name":"xtypeof","className":"ModuleScript","filePaths":["Packages/_Index/elttob_fusion@0.3.0/fusion/src/Utility/xtypeof.luau"]}]}]}]}]},{"name":"Ignite","className":"ModuleScript","filePaths":["src/init.luau"],"children":[{"name":"Components","className":"Folder","children":[{"name":"Accordion","className":"ModuleScript","filePaths":["src/Components/Accordion.luau"]},{"name":"Background","className":"ModuleScript","filePaths":["src/Components/Background.luau"]},{"name":"Button","className":"ModuleScript","filePaths":["src/Components/Button.luau"]},{"name":"Checkbox","className":"ModuleScript","filePaths":["src/Components/Checkbox.luau"]},{"name":"Container","className":"ModuleScript","filePaths":["src/Components/Container.luau"]},{"name":"Core","className":"Folder","children":[{"name":"Arrow","className":"ModuleScript","filePaths":["src/Components/Core/Arrow.luau"]},{"name":"CodeLabel","className":"ModuleScript","filePaths":["src/Components/Core/CodeLabel.luau"]},{"name":"FocusVisual","className":"ModuleScript","filePaths":["src/Components/Core/FocusVisual.luau"]},{"name":"Squircle","className":"ModuleScript","filePaths":["src/Components/Core/Squircle.luau"]},{"name":"TextLabel","className":"ModuleScript","filePaths":["src/Components/Core/TextLabel.luau"]}]},{"name":"EmbeddedContainer","className":"ModuleScript","filePaths":["src/Components/EmbeddedContainer.luau"]},{"name":"ImageBackground","className":"ModuleScript","filePaths":["src/Components/ImageBackground.luau"]},{"name":"Map","className":"ModuleScript","filePaths":["src/Components/Map.luau"]},{"name":"Navigation","className":"ModuleScript","filePaths":["src/Components/Navigation.luau"]},{"name":"Padding","className":"Folder","children":[{"name":"PaddingLarge","className":"ModuleScript","filePaths":["src/Components/Padding/PaddingLarge.luau"]},{"name":"PaddingSmall","className":"ModuleScript","filePaths":["src/Components/Padding/PaddingSmall.luau"]}]},{"name":"Progress","className":"ModuleScript","filePaths":["src/Components/Progress.luau"]},{"name":"Scrollable","className":"ModuleScript","filePaths":["src/Components/Scrollable.luau"]},{"name":"Slider","className":"ModuleScript","filePaths":["src/Components/Slider.luau"]},{"name":"Switch","className":"ModuleScript","filePaths":["src/Components/Switch.luau"]},{"name":"Tabs","className":"ModuleScript","filePaths":["src/Components/Tabs.luau"]},{"name":"TextInput","className":"ModuleScript","filePaths":["src/Components/TextInput.luau"]},{"name":"Widget","className":"ModuleScript","filePaths":["src/Components/Widget.luau"]}]},{"name":"LICENSE","className":"ModuleScript","filePaths":["src/LICENSE.luau"]},{"name":"Modules","className":"Folder","children":[{"name":"CachelessOnEvent","className":"ModuleScript","filePaths":["src/Modules/CachelessOnEvent.luau"]},{"name":"CombineProps","className":"ModuleScript","filePaths":["src/Modules/CombineProps.luau"]},{"name":"Component","className":"ModuleScript","filePaths":["src/Modules/Component/init.luau"],"children":[{"name":"Component.Types","className":"ModuleScript","filePaths":["src/Modules/Component/Component.Types.luau"]}]},{"name":"ComputeMath","className":"ModuleScript","filePaths":["src/Modules/ComputeMath.luau"]},{"name":"ComputeTransforms","className":"ModuleScript","filePaths":["src/Modules/ComputeTransforms.luau"]},{"name":"ForceToState","className":"ModuleScript","filePaths":["src/Modules/ForceToState.luau"]},{"name":"RootEventHandlersUtils","className":"ModuleScript","filePaths":["src/Modules/RootEventHandlersUtils.luau"]},{"name":"TableUtils","className":"ModuleScript","filePaths":["src/Modules/TableUtils.luau"]},{"name":"ThemeHandler","className":"ModuleScript","filePaths":["src/Modules/ThemeHandler/init.luau"],"children":[{"name":"DefaultThemes","className":"ModuleScript","filePaths":["src/Modules/ThemeHandler/DefaultThemes.luau"]},{"name":"ThemeHandler.Types","className":"ModuleScript","filePaths":["src/Modules/ThemeHandler/ThemeHandler.Types.luau"]}]},{"name":"ThemeHandlerOld","className":"ModuleScript","filePaths":["src/Modules/ThemeHandlerOld.luau"]},{"name":"TrackProperty","className":"ModuleScript","filePaths":["src/Modules/TrackProperty.luau"]}]},{"name":"Packages","className":"Folder","children":[{"name":"Fusion","className":"ModuleScript","filePaths":["PackageLinks/test/Fusion.luau"]},{"name":"Highlighter","className":"ModuleScript","filePaths":["PackageLinks/test/Highlighter.luau"]}]}]}]}]}]}]} \ No newline at end of file +{"name":"ignite","className":"ModuleScript","filePaths":["src\\init.luau","default.project.json"],"children":[{"name":"Components","className":"Folder","children":[{"name":"Accordion","className":"ModuleScript","filePaths":["src\\Components\\Accordion.luau"]},{"name":"Background","className":"ModuleScript","filePaths":["src\\Components\\Background.luau"]},{"name":"Button","className":"ModuleScript","filePaths":["src\\Components\\Button.luau"]},{"name":"Checkbox","className":"ModuleScript","filePaths":["src\\Components\\Checkbox.luau"]},{"name":"Container","className":"ModuleScript","filePaths":["src\\Components\\Container.luau"]},{"name":"Core","className":"Folder","children":[{"name":"Arrow","className":"ModuleScript","filePaths":["src\\Components\\Core\\Arrow.luau"]},{"name":"CodeLabel","className":"ModuleScript","filePaths":["src\\Components\\Core\\CodeLabel.luau"]},{"name":"FocusVisual","className":"ModuleScript","filePaths":["src\\Components\\Core\\FocusVisual.luau"]},{"name":"Squircle","className":"ModuleScript","filePaths":["src\\Components\\Core\\Squircle.luau"]},{"name":"TextLabel","className":"ModuleScript","filePaths":["src\\Components\\Core\\TextLabel.luau"]}]},{"name":"EmbeddedContainer","className":"ModuleScript","filePaths":["src\\Components\\EmbeddedContainer.luau"]},{"name":"ImageBackground","className":"ModuleScript","filePaths":["src\\Components\\ImageBackground.luau"]},{"name":"Map","className":"ModuleScript","filePaths":["src\\Components\\Map.luau"]},{"name":"Navigation","className":"ModuleScript","filePaths":["src\\Components\\Navigation.luau"]},{"name":"Padding","className":"Folder","children":[{"name":"PaddingLarge","className":"ModuleScript","filePaths":["src\\Components\\Padding\\PaddingLarge.luau"]},{"name":"PaddingSmall","className":"ModuleScript","filePaths":["src\\Components\\Padding\\PaddingSmall.luau"]}]},{"name":"Progress","className":"ModuleScript","filePaths":["src\\Components\\Progress.luau"]},{"name":"Scrollable","className":"ModuleScript","filePaths":["src\\Components\\Scrollable.luau"]},{"name":"Slider","className":"ModuleScript","filePaths":["src\\Components\\Slider.luau"]},{"name":"Switch","className":"ModuleScript","filePaths":["src\\Components\\Switch.luau"]},{"name":"Tabs","className":"ModuleScript","filePaths":["src\\Components\\Tabs.luau"]},{"name":"TextInput","className":"ModuleScript","filePaths":["src\\Components\\TextInput.luau"]},{"name":"Widget","className":"ModuleScript","filePaths":["src\\Components\\Widget.luau"]}]},{"name":"LICENSE","className":"ModuleScript","filePaths":["src\\LICENSE.luau"]},{"name":"Modules","className":"Folder","children":[{"name":"CachelessOnEvent","className":"ModuleScript","filePaths":["src\\Modules\\CachelessOnEvent.luau"]},{"name":"CombineProps","className":"ModuleScript","filePaths":["src\\Modules\\CombineProps.luau"]},{"name":"Component","className":"ModuleScript","filePaths":["src\\Modules\\Component\\init.luau"],"children":[{"name":"Component.Types","className":"ModuleScript","filePaths":["src\\Modules\\Component\\Component.Types.luau"]}]},{"name":"ComputeMath","className":"ModuleScript","filePaths":["src\\Modules\\ComputeMath.luau"]},{"name":"ComputeTransforms","className":"ModuleScript","filePaths":["src\\Modules\\ComputeTransforms.luau"]},{"name":"ForceToState","className":"ModuleScript","filePaths":["src\\Modules\\ForceToState.luau"]},{"name":"RootEventHandlersUtils","className":"ModuleScript","filePaths":["src\\Modules\\RootEventHandlersUtils.luau"]},{"name":"TableUtils","className":"ModuleScript","filePaths":["src\\Modules\\TableUtils.luau"]},{"name":"ThemeHandler","className":"ModuleScript","filePaths":["src\\Modules\\ThemeHandler\\init.luau"],"children":[{"name":"DefaultThemes","className":"ModuleScript","filePaths":["src\\Modules\\ThemeHandler\\DefaultThemes.luau"]},{"name":"ThemeHandler.Types","className":"ModuleScript","filePaths":["src\\Modules\\ThemeHandler\\ThemeHandler.Types.luau"]}]},{"name":"ThemeHandlerOld","className":"ModuleScript","filePaths":["src\\Modules\\ThemeHandlerOld.luau"]},{"name":"TrackProperty","className":"ModuleScript","filePaths":["src\\Modules\\TrackProperty.luau"]}]},{"name":"Packages","className":"Folder","children":[{"name":"Fusion","className":"ModuleScript","filePaths":["PackageLinks/default\\Fusion.luau"]},{"name":"Highlighter","className":"ModuleScript","filePaths":["PackageLinks/default\\Highlighter.luau"]}]}]} \ No newline at end of file diff --git a/src/Components/Button.luau b/src/Components/Button.luau index 5c39471..4d634d5 100644 --- a/src/Components/Button.luau +++ b/src/Components/Button.luau @@ -1,10 +1,8 @@ --!strict - --> Services ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------- - --> Modules ------------------------------------------------------------------------------------------- local Modules = script.Parent.Parent.Modules local Component = require(Modules.Component) @@ -13,6 +11,7 @@ local TableUtils = require(Modules.TableUtils) local Packages = script.Parent.Parent.Packages local Fusion = require(Packages.Fusion) +local Peek = Fusion.peek local Components = Modules.Parent.Components local CoreComponents = Components.Core @@ -20,16 +19,29 @@ local Squircle = require(CoreComponents.Squircle) local TextLabel = require(CoreComponents.TextLabel) ------------------------------------------------------------------------------------------------------- - --> Types --------------------------------------------------------------------------------------------- + +type IconProperties = Fusion.UsedAs<{ + AnchorPoint: Vector2?, + Image: string?, + Size: UDim2?, + Position: UDim2?, + ImageColor3: Color3?, + ImageTransparency: number?, + ImageRectOffset: Vector2?, + ImageRectSize: Vector2?, + ScaleType: Enum.ScaleType?, + ResampleMode: Enum.ResamplerMode?, +}>? + type ButtonProps = { - Width: Fusion.UsedAs?, - Content: Fusion.UsedAs<{ string } | string>?, - Variant: ("Primary" | "Secondary" | "Destructive")? + Width: Fusion.UsedAs?, + Content: Fusion.UsedAs<{ string } | string>?, + Variant: ("Primary" | "Secondary" | "Destructive")?, + IconProperties: IconProperties, } ------------------------------------------------------------------------------------------------------- - --> Variables ----------------------------------------------------------------------------------------- local ComputeUDim2 = ComputeTransforms.UDim2 @@ -38,104 +50,182 @@ local TableTake = TableUtils.Take local Children, OnEvent = Fusion.Children, Fusion.OnEvent ------------------------------------------------------------------------------------------------------- - --> Private Functions --------------------------------------------------------------------------------- -local function ParseContentItem(scope: Component.Scope, item: string) - local imageId = string.match(item, "rbxassetid://%d+") - - if imageId then - return scope:New "ImageLabel" { - Size = UDim2.fromOffset(9, 9), - BackgroundTransparency = 1, - ImageColor3 = scope:GetThemeItem("Text/Title"), - Image = imageId - } - end - - return TextLabel (scope, { - Text = item, - Focus = "Title" :: "Title", - Weight = Enum.FontWeight.SemiBold, - Size = UDim2.fromScale(0, 1), - AutomaticSize = Enum.AutomaticSize.X, - TextXAlignment = Enum.TextXAlignment.Center - }) + +local function setProperty_unsafe(instance: Instance, property: string, value: unknown) + (instance :: any)[property] = value end -------------------------------------------------------------------------------------------------------- +local function ParseContentItem(scope: Component.Scope, item: string, IconProperties: IconProperties) + local imageId = string.match(item, "rbxassetid://%d+") + + local peekProperties = Peek(IconProperties) + + if not peekProperties then + peekProperties = {} :: {} + end + + local amount = 0 + + for _, value in peekProperties do + amount += 1 + end + + if amount ~= 0 or imageId then + if not peekProperties.Image and not imageId then + imageId = nil + end + + local imageLabel = scope:New("ImageLabel")({ + BackgroundTransparency = 1, + ImageColor3 = scope:GetThemeItem("Text/Title"), + Size = UDim2.fromOffset(9, 9), + Image = imageId, + }) + + if peekProperties == {} then + return imageLabel + end + + for Key, Property in peekProperties do + local success, err = pcall(function() + setProperty_unsafe(imageLabel, Key, Property) + end) + + if success then + continue + end + warn(err) + end + + return imageLabel + end + + return TextLabel(scope, { + Text = item, + Focus = "Title" :: "Title", + Weight = Enum.FontWeight.SemiBold, + Size = UDim2.fromScale(0, 1), + AutomaticSize = Enum.AutomaticSize.X, + TextXAlignment = Enum.TextXAlignment.Center, + }) :: any +end +------------------------------------------------------------------------------------------------------- return Component(function(scope, props: ButtonProps) - local width = TableTake(props, "Width", UDim.new(1,0)) :: Fusion.UsedAs - local content = TableTake(props, "Content", "Button") :: Fusion.UsedAs<{ string } | string> - local variant = TableTake(props, "Variant", "Primary") :: Fusion.UsedAs<"Primary" | "Secondary" | "Destructive"> - - local isHoverState, isFocusState = scope:Value(false), scope:Value(false) - - -- We need to ensure that `content` is an array so it can be used with `ForPairs` - local computeContentArray = scope:Computed(function(use) - local usedContent = use(content) - return if type(usedContent) == "table" then usedContent else { usedContent } - end) - - -- Width may be "Auto" therefore we need to make the width of the button `UDim.new()` when this is the case. - local computeUDimWidth = scope:Computed(function(use) - local usedWidth = use(width) - return if usedWidth == "Auto" then UDim.new() else usedWidth - end) - - local computeAutoSize = scope:Computed(function(use) - return if use(width) == "Auto" then Enum.AutomaticSize.X else Enum.AutomaticSize.None - end) - - local computeBackgroundColor = scope:GetThemeItem( - scope:Computed(function(use) return `Accent/{use(variant) or "Primary"}` :: any end), - scope:Computed(function(use) return if use(isFocusState) then "Focus" elseif use(isHoverState) then "Hover" else nil :: any end) - ) - - -- Handles the edge case of the user dragging the cursor off of the button and then releasing the mouse button. - scope:AddRootEvent("InputEnded", function() isFocusState:set(false) end) - - return Squircle (scope, { - As = "ImageButton" :: "ImageButton", - Size = ComputeUDim2(scope, computeUDimWidth, UDim.new(0, 25)), - AutomaticSize = computeAutoSize, - BackgroundColor3 = computeBackgroundColor, - ClipsDescendants = true, - Name = "Button", - - [OnEvent "MouseEnter"] = function() isHoverState:set(true) end :: any, - [OnEvent "MouseLeave"] = function() isHoverState:set(false) end :: any, - - [OnEvent "MouseButton1Down"] = function() isFocusState:set(true) end :: any, - [OnEvent "MouseButton1Up"] = function() isFocusState:set(false) end :: any, - - [Children] = { - Squircle (scope, { - Size = UDim2.fromScale(1, 1), - Image = "rbxassetid://108824901287727", - Name = "Button:Highlight" - }), - - scope:New "Frame" { - Size = UDim2.fromScale(1, 1), - BackgroundTransparency = 1, - Name = "Button:ContentWrapper", - - [Children] = { - scope:ForPairs(computeContentArray, function(use, scope, idx, item) - return idx, ParseContentItem(scope, item) - end) :: any, - - scope:New "UIListLayout" { - FillDirection = Enum.FillDirection.Horizontal, - HorizontalAlignment = Enum.HorizontalAlignment.Center, - VerticalAlignment = Enum.VerticalAlignment.Center, - Padding = UDim.new(0, 8) - }, - - scope:New "UIPadding" { PaddingLeft = UDim.new(0, 8), PaddingRight = UDim.new(0, 8) }, - } - } - } - }, props :: any) -end) \ No newline at end of file + local width = TableTake(props, "Width", UDim.new(1, 0)) :: Fusion.UsedAs + local content = TableTake(props, "Content", "Button") :: Fusion.UsedAs<{ string } | string> + local variant = TableTake(props, "Variant", "Primary") :: Fusion.UsedAs<"Primary" | "Secondary" | "Destructive"> + local iconProperties = TableTake(props, "IconProperties", {}) :: IconProperties + + local isHoverState = scope:Value(false) + local isFocusState = scope:Value(false) + + -- We need to ensure that `content` is an array so it can be used with `ForPairs` + + local computeContentArray = scope:Computed(function(use) + local usedContent = use(content) + return if type(usedContent) == "table" then usedContent else { usedContent } + end) + + -- Width may be "Auto" therefore we need to make the width of the button `UDim.new()` when this is the case. + local computeUDimWidth = scope:Computed(function(use) + local usedWidth = use(width) + return if usedWidth == "Auto" then UDim.new() else usedWidth + end) + + local computeAutoSize = scope:Computed(function(use) + return if use(width) == "Auto" then Enum.AutomaticSize.X else Enum.AutomaticSize.None + end) + + local computeProperties = scope:Computed(function(use) + return use(iconProperties) or {} + end) + + local computeBackgroundColor = scope:GetThemeItem( + scope:Computed(function(use) + return `Accent/{use(variant) or "Primary"}` :: any + end), + scope:Computed(function(use) + return if use(isFocusState) then "Focus" elseif use(isHoverState) then "Hover" else nil :: any + end) + ) + + local computeChildren = scope:Computed(function(Use) + local text = "" + local image = "" + + local children = {} + + for _, content in Use(computeContentArray) do + if not string.find(content, "rbxassetid://") then + text = content + else + image = content + end + end + + if image or computeProperties["Image"] then + table.insert(children, ParseContentItem(scope, image :: string, computeProperties)) + end + + table.insert(children, ParseContentItem(scope, text, {})) + + return children + end) + + -- Handles the edge case of the user dragging the cursor off of the button and then releasing the mouse button. + scope:AddRootEvent("InputEnded", function() + isFocusState:set(false) + end) + + return Squircle(scope, { + As = "ImageButton" :: "ImageButton", + Size = ComputeUDim2(scope, computeUDimWidth, UDim.new(0, 25)), + AutomaticSize = computeAutoSize, + BackgroundColor3 = computeBackgroundColor, + ClipsDescendants = true, + Name = "Button", + + [OnEvent("MouseEnter")] = function() + isHoverState:set(true) + end :: any, + [OnEvent("MouseLeave")] = function() + isHoverState:set(false) + end :: any, + + [OnEvent("MouseButton1Down")] = function() + isFocusState:set(true) + end :: any, + [OnEvent("MouseButton1Up")] = function() + isFocusState:set(false) + end :: any, + + [Children] = { + Squircle(scope, { + Size = UDim2.fromScale(1, 1), + Image = "rbxassetid://108824901287727", + Name = "Button:Highlight", + }), + + scope:New("Frame")({ + Size = UDim2.fromScale(1, 1), + BackgroundTransparency = 1, + Name = "Button:ContentWrapper", + + [Children] = { + computeChildren, + + scope:New("UIListLayout")({ + FillDirection = Enum.FillDirection.Horizontal, + HorizontalAlignment = Enum.HorizontalAlignment.Center, + VerticalAlignment = Enum.VerticalAlignment.Center, + Padding = UDim.new(0, 8), + }), + + scope:New("UIPadding")({ PaddingLeft = UDim.new(0, 8), PaddingRight = UDim.new(0, 8) }), + }, + }), + }, + }, props :: any) +end) diff --git a/src/Modules/TableUtils.luau b/src/Modules/TableUtils.luau index fe541c7..a8832c2 100644 --- a/src/Modules/TableUtils.luau +++ b/src/Modules/TableUtils.luau @@ -1,12 +1,16 @@ return { CountKeys = function(tble: { [any]: any }): number local length = 0 - for _ in tble do length += 1 end + for _ in tble do + length += 1 + end return length end, HasItems = function(tble: { [any]: any }): boolean - for _ in tble do return true end + for _ in tble do + return true + end return false end, @@ -14,13 +18,17 @@ return { local value = tble[keyOrIndex] tble[keyOrIndex] = nil - if value == nil then return default end + if value == nil then + return default + end return value end, ContainsInst = function(tble: { [any]: any }, className: string) - for _,value in tble do - if not (typeof(value) == "Instance" and value.ClassName == className) then continue end + for _, value in tble do + if not (typeof(value) == "Instance" and value.ClassName == className) then + continue + end return true end @@ -28,8 +36,8 @@ return { end, InsertMany = function(tble: { [any]: any }, ...: any) - for i = 1, select("#", ...) do table.insert(tble, select(i, ...)) end - end + for i = 1, select("#", ...) do + table.insert(tble, select(i, ...)) + end + end, } - - diff --git a/src/init.luau b/src/init.luau index 73a26ea..d53b0ca 100644 --- a/src/init.luau +++ b/src/init.luau @@ -1,10 +1,8 @@ --!strict - --> Services ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------- - --> Modules ------------------------------------------------------------------------------------------- local Modules = script.Modules local RootEventHandlersUtils = require(Modules.RootEventHandlersUtils) @@ -14,57 +12,52 @@ local Components = script.Components local CoreComponents = Components.Core local PaddingComponents = Components.Padding -local Packages = script.Packages -local Fusion = require(Packages.Fusion) ------------------------------------------------------------------------------------------------------- - --> Variables ----------------------------------------------------------------------------------------- local AddRootEvent = RootEventHandlersUtils.AddRootEvent -local innerScope = Fusion.innerScope ------------------------------------------------------------------------------------------------------- - return { - SetTheme = ThemeHandler.SetThemeForScope, - GetThemeItem = ThemeHandler.GetThemeItemForScope, - - AddRootEvent = AddRootEvent, - - -- Plugins. - Widget = require(Components.Widget), - - -- Wrappers. - Accordion = require(Components.Accordion), - Background = require(Components.Background), - Container = require(Components.Container), - EmbeddedContainer = require(Components.EmbeddedContainer), - ImageBackground = require(Components.ImageBackground), - Map = require(Components.Map), - - -- ...ables - Scrollable = require(Components.Scrollable), - - -- Labels. - TextLabel = require(CoreComponents.TextLabel), - CodeLabel = require(CoreComponents.CodeLabel), - - -- Inputs. - TextInput = require(Components.TextInput), - - -- Buttons. - Button = require(Components.Button), - Checkbox = require(Components.Checkbox), - Slider = require(Components.Slider), - Switch = require(Components.Switch), - Navigation = require(Components.Navigation), - Tabs = require(Components.Tabs), - - -- Other - Progress = require(Components.Progress), - - -- Padding. - PaddingSmall = require(PaddingComponents.PaddingSmall), - PaddingLarge = require(PaddingComponents.PaddingLarge), -} \ No newline at end of file + SetTheme = ThemeHandler.SetThemeForScope, + GetThemeItem = ThemeHandler.GetThemeItemForScope, + + AddRootEvent = AddRootEvent, + + -- Plugins. + Widget = require(Components.Widget), + + -- Wrappers. + Accordion = require(Components.Accordion), + Background = require(Components.Background), + Container = require(Components.Container), + EmbeddedContainer = require(Components.EmbeddedContainer), + ImageBackground = require(Components.ImageBackground), + Map = require(Components.Map), + + -- ...ables + Scrollable = require(Components.Scrollable), + + -- Labels. + TextLabel = require(CoreComponents.TextLabel), + CodeLabel = require(CoreComponents.CodeLabel), + + -- Inputs. + TextInput = require(Components.TextInput), + + -- Buttons. + Button = require(Components.Button), + Checkbox = require(Components.Checkbox), + Slider = require(Components.Slider), + Switch = require(Components.Switch), + Navigation = require(Components.Navigation), + Tabs = require(Components.Tabs), + + -- Other + Progress = require(Components.Progress), + + -- Padding. + PaddingSmall = require(PaddingComponents.PaddingSmall), + PaddingLarge = require(PaddingComponents.PaddingLarge), +} diff --git a/test.project.json b/test.project.json index 3708d67..6ce0f11 100644 --- a/test.project.json +++ b/test.project.json @@ -1,8 +1,18 @@ { - "name": "ignite", + "name": "Ignite", "tree": { - "$path": "src", + "$path": "test", - "Packages": { "$path": "PackageLinks/test" } + "Packages": { + "$path": "Packages", + + "Ignite": { + "$path": "src", + "Packages": { "$path": "PackageLinks/test" } + } + } } -} \ No newline at end of file +} + + + diff --git a/test/Main.server.luau b/test/Main.server.luau index c4c8993..af016ea 100644 --- a/test/Main.server.luau +++ b/test/Main.server.luau @@ -1,55 +1,61 @@ --!strict - --> Modules ------------------------------------------------------------------------------------------- local Packages = script.Parent.Packages -local Fusion = require(Packages.Fusion) -local Ignite = require(Packages.Ignite) +local Fusion = require(Packages.Fusion) :: any +local Ignite = require(Packages.Ignite) :: any ------------------------------------------------------------------------------------------------------- - --> Variables ----------------------------------------------------------------------------------------- local Scope = Fusion.scoped(Fusion, Ignite) -local Children, OnEvent, peek = Fusion.Children, Fusion.OnEvent, Fusion.peek -------------------------------------------------------------------------------------------------------- - - +local Children = Fusion.Children +------------------------------------------------------------------------------------------------------- local MyTable = {} MyTable.__index = MyTable -function MyTable:FooBar() return true end - -table.insert(MyTable, function() return true end) - - - -local CounterState = Scope:Value(0) -local ComputeLabelText = Scope:Computed(function(use) return `Counter is: {use(CounterState)}` end) - -Scope:Widget { - Id = "IgnitePlugin", - Title = "My First Ignite Plugin 🚀", - InitDockState = Enum.InitialDockState.Left, - FloatXSize = 300, FloatYSize = 800, - - [Children] = { - Scope:Tabs { - Sections = { - { Text = "Hello" }, - { Text = "World" } - } - }, - - Scope:New "UIListLayout" { - SortOrder = Enum.SortOrder.LayoutOrder, - Padding = UDim.new(0, 8) - }, - - --[[Scope:New "UIPadding" { +function MyTable:FooBar() + return true +end + +table.insert(MyTable, function() + return true +end) + +Scope:Widget({ + Id = "IgnitePlugin", + Title = "My First Ignite Plugin 🚀", + InitDockState = Enum.InitialDockState.Left, + FloatXSize = 300, + FloatYSize = 800, + + [Children] = { + Scope:Tabs({ + Sections = { + { Text = "Hello" }, + { Text = "World" }, + }, + }), + + Scope:New("UIListLayout")({ + SortOrder = Enum.SortOrder.LayoutOrder, + Padding = UDim.new(0, 8), + }), + + Scope:Button({ + + Content = { "Test Button!" }, + + IconProperties = { + BackgroundTransparency = 0, + Size = UDim2.fromOffset(4, 4), + }, + }), + + --[[Scope:New "UIPadding" { PaddingLeft = UDim.new(0, 8), PaddingRight = UDim.new(0, 8), PaddingTop = UDim.new(0, 8), PaddingBottom = UDim.new(0, 8) }]] - } -} \ No newline at end of file + }, +}) diff --git a/test_datamodel.project.json b/test_datamodel.project.json index 828754d..d02111c 100644 --- a/test_datamodel.project.json +++ b/test_datamodel.project.json @@ -20,7 +20,4 @@ } } } -} - - - +} \ No newline at end of file diff --git a/wally.lock b/wally.lock index d6f63d6..e502069 100644 --- a/wally.lock +++ b/wally.lock @@ -8,8 +8,8 @@ version = "0.8.3" dependencies = [] [[package]] -name = "cameronpcampbell/ignite-x7dha2gai02" -version = "0.1.17" +name = "cameronpcampbell/ignite" +version = "1.2.1" dependencies = [["Fusion", "elttob/fusion@0.3.0"], ["Highlighter", "boatbomber/highlighter@0.8.3"]] [[package]] diff --git a/wally.toml b/wally.toml index f8581f8..f417172 100644 --- a/wally.toml +++ b/wally.toml @@ -1,7 +1,7 @@ [package] name = "cameronpcampbell/ignite" description="⚡ A beautiful component system for Roblox plugin development." -version = "1.2.1" +version = "1.2.6" registry = "https://github.com/UpliftGames/wally-index" realm = "shared" license = "MIT"