@rbxts/app-forge 0.7.2-alpha.3 → 0.7.2-alpha.30

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.
Files changed (53) hide show
  1. package/README.md +86 -372
  2. package/out/{vide/decorator.d.ts → appRegistry.d.ts} +1 -1
  3. package/out/{vide/decorator.luau → appRegistry.luau} +1 -7
  4. package/out/{vide/context.d.ts → context.d.ts} +1 -1
  5. package/out/global.d.ts +1 -1
  6. package/out/{vide/hooks → hooks}/useAppContext.d.ts +1 -1
  7. package/out/{vide/hooks → hooks}/useAppContext.luau +1 -1
  8. package/out/{vide/hooks → hooks}/useEventListener.luau +1 -1
  9. package/out/{vide/hooks → hooks}/usePx.luau +2 -2
  10. package/out/index.d.ts +5 -11
  11. package/out/init.luau +6 -14
  12. package/out/{vide/index.d.ts → mount.d.ts} +8 -4
  13. package/out/{vide/init.luau → mount.luau} +63 -19
  14. package/out/renderManager.d.ts +32 -0
  15. package/out/{vide/classes/renders.luau → renderManager.luau} +107 -39
  16. package/out/{vide/classes/rules → ruleEngine}/exclusiveGroup.d.ts +1 -1
  17. package/out/{vide/classes/rules → ruleEngine}/exclusiveGroup.luau +1 -1
  18. package/out/ruleEngine/index.d.ts +7 -0
  19. package/out/{vide/classes/rules → ruleEngine}/init.luau +12 -12
  20. package/out/{react/rules → ruleEngine}/parent.d.ts +1 -1
  21. package/out/{vide/classes/rules → ruleEngine}/parent.luau +2 -1
  22. package/out/{vide/types.d.ts → types.d.ts} +12 -12
  23. package/package.json +4 -10
  24. package/out/react/container.d.ts +0 -10
  25. package/out/react/container.luau +0 -60
  26. package/out/react/context.d.ts +0 -7
  27. package/out/react/context.luau +0 -12
  28. package/out/react/decorator.d.ts +0 -14
  29. package/out/react/decorator.luau +0 -51
  30. package/out/react/helpers.d.ts +0 -6
  31. package/out/react/helpers.luau +0 -74
  32. package/out/react/hooks/useAppContext.d.ts +0 -5
  33. package/out/react/hooks/useAppContext.luau +0 -16
  34. package/out/react/hooks/usePx.d.ts +0 -15
  35. package/out/react/hooks/usePx.luau +0 -117
  36. package/out/react/index.d.ts +0 -44
  37. package/out/react/init.luau +0 -123
  38. package/out/react/rules/index.d.ts +0 -6
  39. package/out/react/rules/init.luau +0 -27
  40. package/out/react/rules/parent.luau +0 -42
  41. package/out/react/types.d.ts +0 -44
  42. package/out/vide/classes/renders.d.ts +0 -25
  43. package/out/vide/classes/rules/index.d.ts +0 -7
  44. package/out/vide/classes/rules/parent.d.ts +0 -2
  45. package/out/vide/debug/index.d.ts +0 -3
  46. package/out/vide/debug/init.luau +0 -8
  47. /package/out/{vide/context.luau → context.luau} +0 -0
  48. /package/out/{vide/debug/debugger.d.ts → debugger.d.ts} +0 -0
  49. /package/out/{vide/debug/debugger.luau → debugger.luau} +0 -0
  50. /package/out/{vide/hooks → hooks}/useEventListener.d.ts +0 -0
  51. /package/out/{vide/hooks → hooks}/usePx.d.ts +0 -0
  52. /package/out/{vide/debug/logger.d.ts → logger.d.ts} +0 -0
  53. /package/out/{vide/debug/logger.luau → logger.luau} +0 -0
@@ -1,10 +0,0 @@
1
- import type Types from "./types";
2
- export declare function AppContainer(props: Types.NameProps & Types.MainProps): import("@rbxts/react").ReactElement<{
3
- key: string;
4
- ZIndexBehavior: Enum.ZIndexBehavior.Sibling;
5
- ResetOnSpawn: boolean;
6
- }, string | import("@rbxts/react").JSXElementConstructor<any>> | import("@rbxts/react").ReactElement<{
7
- key: string;
8
- BackgroundTransparency: number;
9
- Size: UDim2;
10
- }, string | import("@rbxts/react").JSXElementConstructor<any>>;
@@ -1,60 +0,0 @@
1
- -- Compiled with roblox-ts v3.0.0
2
- local TS = _G[script]
3
- -- Services
4
- local RunService = TS.import(script, TS.getModule(script, "@rbxts", "services")).RunService
5
- -- Packages
6
- local createElement = TS.import(script, TS.getModule(script, "@rbxts", "react")).createElement
7
- -- Types
8
- -- Components
9
- local AppRegistry = TS.import(script, script.Parent, "decorator").AppRegistry
10
- local function createInstance(props)
11
- local _binding = props
12
- local name = _binding.name
13
- local forge = _binding.forge
14
- if not (name ~= "" and name) then
15
- error("App name is required to create instance")
16
- end
17
- local appClass = AppRegistry[name]
18
- if not appClass then
19
- error(`App "{name}" not registered`)
20
- end
21
- if not (forge.loaded[name] ~= nil) then
22
- local instance = appClass.constructor.new(props)
23
- local Render = function()
24
- return instance:render()
25
- end
26
- local _loaded = forge.loaded
27
- local _arg1 = createElement(Render, {
28
- key = "Main",
29
- })
30
- _loaded[name] = _arg1
31
- end
32
- return forge.loaded[name]
33
- end
34
- local function AppContainer(props)
35
- local _binding = props
36
- local name = _binding.name
37
- if not (name ~= "" and name) then
38
- error("App name is required in AppContainer")
39
- end
40
- local element = createInstance(props)
41
- if not element then
42
- error(`Failed to create instance for app "{name}"`)
43
- end
44
- if RunService:IsRunning() then
45
- return createElement("ScreenGui", {
46
- key = name,
47
- ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
48
- ResetOnSpawn = false,
49
- }, element)
50
- else
51
- return createElement("Frame", {
52
- key = name,
53
- BackgroundTransparency = 1,
54
- Size = UDim2.fromScale(1, 1),
55
- }, element)
56
- end
57
- end
58
- return {
59
- AppContainer = AppContainer,
60
- }
@@ -1,7 +0,0 @@
1
- declare const Contexts: {
2
- readonly App: import("@rbxts/react").Context<{
3
- forge: import(".").default;
4
- px: ReturnType<typeof import("@rbxts/loners-pretty-react-hooks").usePx>;
5
- } | undefined>;
6
- };
7
- export default Contexts;
@@ -1,12 +0,0 @@
1
- -- Compiled with roblox-ts v3.0.0
2
- local TS = _G[script]
3
- -- Packages
4
- local createContext = TS.import(script, TS.getModule(script, "@rbxts", "react")).createContext
5
- -- Types
6
- local Contexts = {
7
- App = createContext(nil),
8
- }
9
- local default = Contexts
10
- return {
11
- default = default,
12
- }
@@ -1,14 +0,0 @@
1
- import React from "@rbxts/react";
2
- import type Types from "./types";
3
- import type AppForge from ".";
4
- export declare const AppRegistry: Map<string, Types.AppRegistry>;
5
- export declare function App(props: Types.AppRegistryProps): <T extends new (props: Types.MainProps) => Args>(constructor: T) => T;
6
- export declare abstract class Args {
7
- readonly forge: AppForge;
8
- readonly props: Types.ClassProps;
9
- readonly name: AppNames;
10
- readonly bind: React.Binding<boolean>;
11
- readonly state: Boolean;
12
- constructor(props: Types.NameProps & Types.MainProps);
13
- abstract render(): React.ReactNode;
14
- }
@@ -1,51 +0,0 @@
1
- -- Compiled with roblox-ts v3.0.0
2
- local TS = _G[script]
3
- -- Services
4
- -- Packages
5
- local usePx = TS.import(script, TS.getModule(script, "@rbxts", "loners-pretty-react-hooks").out).usePx
6
- -- Types
7
- local AppRegistry = {}
8
- local function App(props)
9
- return function(constructor)
10
- local _name = props.name
11
- if AppRegistry[_name] ~= nil then
12
- error(`Duplicate registered App name "{props.name}"`)
13
- end
14
- local _name_1 = props.name
15
- local _arg1 = {
16
- constructor = constructor,
17
- visible = props.visible,
18
- rules = props.rules,
19
- }
20
- AppRegistry[_name_1] = _arg1
21
- return constructor
22
- end
23
- end
24
- local Args
25
- do
26
- Args = {}
27
- function Args:constructor(props)
28
- local _binding = props
29
- local target = _binding.target
30
- local forge = _binding.forge
31
- local name = _binding.name
32
- if not (name ~= "" and name) then
33
- error("App name is required in Args constructor")
34
- end
35
- local px = usePx(target)
36
- self.forge = forge
37
- local _object = table.clone(props.props)
38
- setmetatable(_object, nil)
39
- _object.px = px
40
- _object.forge = forge
41
- self.props = _object
42
- self.name = name
43
- self.bind = forge:getBind(name)
44
- self.state = forge:getState(name)
45
- end
46
- end
47
- return {
48
- App = App,
49
- AppRegistry = AppRegistry,
50
- Args = Args,
51
- }
@@ -1,6 +0,0 @@
1
- import React from "@rbxts/react";
2
- import type Types from "./types";
3
- import type AppForge from ".";
4
- export declare function createBinding(name: AppNames, forge: AppForge): void;
5
- export declare function createState(name: AppNames, forge: AppForge): void;
6
- export declare function Render(props: Types.NameProps & Types.MainProps): React.ReactNode;
@@ -1,74 +0,0 @@
1
- -- Compiled with roblox-ts v3.0.0
2
- local TS = _G[script]
3
- -- Packages
4
- local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
5
- local useBinding = _react.useBinding
6
- local useState = _react.useState
7
- -- Types
8
- -- Components
9
- local AppRegistry = TS.import(script, script.Parent, "decorator").AppRegistry
10
- local function createBinding(name, forge)
11
- local _name = name
12
- local app = AppRegistry[_name]
13
- if not app then
14
- error(`App "{name}" not registered`)
15
- end
16
- local _binds = forge.binds
17
- local _name_1 = name
18
- if _binds[_name_1] ~= nil then
19
- return nil
20
- end
21
- local _condition = app.visible
22
- if _condition == nil then
23
- _condition = false
24
- end
25
- local binding = { useBinding(_condition) }
26
- local _binds_1 = forge.binds
27
- local _name_2 = name
28
- _binds_1[_name_2] = binding
29
- end
30
- local function createState(name, forge)
31
- local _name = name
32
- local app = AppRegistry[_name]
33
- if not app then
34
- error(`App "{name}" not registered`)
35
- end
36
- local _states = forge.states
37
- local _name_1 = name
38
- if _states[_name_1] ~= nil then
39
- return nil
40
- end
41
- local _condition = app.visible
42
- if _condition == nil then
43
- _condition = false
44
- end
45
- local state = { useState(_condition) }
46
- local _states_1 = forge.states
47
- local _name_2 = name
48
- _states_1[_name_2] = state
49
- end
50
- local function Render(props)
51
- local names = props.names
52
- local name = props.name
53
- local forge = props.forge
54
- -- ▼ ReadonlyMap.forEach ▼
55
- local _callback = function(_, name)
56
- createBinding(name, forge)
57
- createState(name, forge)
58
- end
59
- for _k, _v in AppRegistry do
60
- _callback(_v, _k, AppRegistry)
61
- end
62
- -- ▲ ReadonlyMap.forEach ▲
63
- if name ~= "" and name then
64
- return forge:renderApp(props)
65
- elseif names then
66
- return forge:renderApps(props)
67
- end
68
- return forge:renderAll(props)
69
- end
70
- return {
71
- createBinding = createBinding,
72
- createState = createState,
73
- Render = Render,
74
- }
@@ -1,5 +0,0 @@
1
- declare const _default: () => {
2
- forge: import("..").default;
3
- px: ReturnType<typeof import("@rbxts/loners-pretty-react-hooks").usePx>;
4
- };
5
- export default _default;
@@ -1,16 +0,0 @@
1
- -- Compiled with roblox-ts v3.0.0
2
- local TS = _G[script]
3
- -- Packages
4
- local useContext = TS.import(script, TS.getModule(script, "@rbxts", "react")).useContext
5
- -- Components
6
- local Contexts = TS.import(script, script.Parent.Parent, "context").default
7
- local default = function()
8
- local context = useContext(Contexts.App)
9
- if not context then
10
- error(`Failed to retrieve App Props for React {debug.traceback()}`)
11
- end
12
- return context
13
- end
14
- return {
15
- default = default,
16
- }
@@ -1,15 +0,0 @@
1
- /**
2
- * Scaled pixel unit helper.
3
- */
4
- export declare const px: ((value: number) => number) & {
5
- scale: (value: number) => number;
6
- even: (value: number) => number;
7
- floor: (value: number) => number;
8
- ceil: (value: number) => number;
9
- };
10
- /**
11
- * Initializes global px scaling.
12
- *
13
- * Should be called exactly once at app mount.
14
- */
15
- export declare function usePx(target?: GuiObject | Camera, baseResolution?: Vector2, minScale?: number): void;
@@ -1,117 +0,0 @@
1
- -- Compiled with roblox-ts v3.0.0
2
- local TS = _G[script]
3
- -- Services
4
- local Workspace = TS.import(script, TS.getModule(script, "@rbxts", "services")).Workspace
5
- -- React
6
- local useEffect = TS.import(script, TS.getModule(script, "@rbxts", "react")).useEffect
7
- --* Default reference resolution for px calculations
8
- local BASE_RESOLUTION = Vector2.new(1920, 1080)
9
- --* Minimum allowed scale to prevent unreadable UI
10
- local MIN_SCALE = 0.5
11
- --[[
12
- *
13
- * Interpolates between width- and height-based scaling.
14
- * 0 = width-driven, 1 = height-driven
15
-
16
- ]]
17
- local DOMINANT_AXIS = 0.5
18
- local TARGET = Workspace.CurrentCamera
19
- local SCALE = 1
20
- local GLOBAL_INITIALIZED = false
21
- --[[
22
- *
23
- * Assigns a call signature to an object.
24
-
25
- ]]
26
- local function callable(callback, object)
27
- return setmetatable(object, {
28
- __call = function(_, ...)
29
- local args = { ... }
30
- return callback(unpack(args))
31
- end,
32
- })
33
- end
34
- --[[
35
- *
36
- * Scaled pixel unit helper.
37
-
38
- ]]
39
- local px = callable(function(value)
40
- return math.round(value * SCALE)
41
- end, {
42
- scale = function(value)
43
- return value * SCALE
44
- end,
45
- even = function(value)
46
- return math.round(value * SCALE * 0.5) * 2
47
- end,
48
- floor = function(value)
49
- return math.floor(value * SCALE)
50
- end,
51
- ceil = function(value)
52
- return math.ceil(value * SCALE)
53
- end,
54
- })
55
- --[[
56
- *
57
- * Recalculates the current scale factor.
58
-
59
- ]]
60
- local function calculateScale()
61
- local target = TARGET
62
- if not target then
63
- return nil
64
- end
65
- local size = if target:IsA("Camera") then target.ViewportSize elseif target:IsA("GuiObject") then target.AbsoluteSize else nil
66
- if not size then
67
- return nil
68
- end
69
- if BASE_RESOLUTION.X <= 0 or BASE_RESOLUTION.Y <= 0 then
70
- return nil
71
- end
72
- local width = math.log(size.X / BASE_RESOLUTION.X, 2)
73
- local height = math.log(size.Y / BASE_RESOLUTION.Y, 2)
74
- local centered = width + (height - width) * DOMINANT_AXIS
75
- local scale = 2 ^ centered
76
- SCALE = math.max(scale, MIN_SCALE)
77
- end
78
- --[[
79
- *
80
- * Initializes global px scaling.
81
- *
82
- * Should be called exactly once at app mount.
83
-
84
- ]]
85
- local function usePx(target, baseResolution, minScale)
86
- useEffect(function()
87
- if GLOBAL_INITIALIZED then
88
- warn("usePx() may only be called once globally")
89
- return nil
90
- end
91
- GLOBAL_INITIALIZED = true
92
- if baseResolution then
93
- BASE_RESOLUTION = baseResolution
94
- end
95
- if minScale ~= nil then
96
- MIN_SCALE = minScale
97
- end
98
- if target then
99
- TARGET = target
100
- end
101
- local resolvedTarget = TARGET
102
- if not resolvedTarget then
103
- warn("usePx(): no valid target to observe")
104
- return nil
105
- end
106
- local signal = if resolvedTarget:IsA("Camera") then resolvedTarget:GetPropertyChangedSignal("ViewportSize") else resolvedTarget:GetPropertyChangedSignal("AbsoluteSize")
107
- local connection = signal:Connect(calculateScale)
108
- calculateScale()
109
- return function()
110
- connection:Disconnect()
111
- end
112
- end, {})
113
- end
114
- return {
115
- usePx = usePx,
116
- px = px,
117
- }
@@ -1,44 +0,0 @@
1
- import React from "@rbxts/react";
2
- import type Types from "./types";
3
- type Binding = [React.Binding<boolean>, (T: boolean) => void];
4
- type State = [boolean, React.Dispatch<React.SetStateAction<boolean>>];
5
- export default class AppForge {
6
- loaded: Map<string, React.Element<any, string | React.JSXElementConstructor<any>>>;
7
- binds: Map<string, Binding>;
8
- states: Map<string, State>;
9
- private rulesManager;
10
- getBind(name: AppNames): React.Binding<boolean>;
11
- getState(name: AppNames): boolean;
12
- set(name: AppNames, value: boolean): void;
13
- open(name: AppNames): void;
14
- close(name: AppNames): void;
15
- toggle(name: AppNames): void;
16
- renderApp(props: Types.NameProps & Types.MainProps): React.ReactElement<{
17
- key: string;
18
- ZIndexBehavior: Enum.ZIndexBehavior.Sibling;
19
- ResetOnSpawn: boolean;
20
- }, string | React.JSXElementConstructor<any>> | React.ReactElement<{
21
- key: string;
22
- BackgroundTransparency: number;
23
- Size: UDim2;
24
- }, string | React.JSXElementConstructor<any>>;
25
- renderApps(props: Types.NameProps & Types.MainProps): (React.ReactElement<{
26
- key: string;
27
- ZIndexBehavior: Enum.ZIndexBehavior.Sibling;
28
- ResetOnSpawn: boolean;
29
- }, string | React.JSXElementConstructor<any>> | React.ReactElement<{
30
- key: string;
31
- BackgroundTransparency: number;
32
- Size: UDim2;
33
- }, string | React.JSXElementConstructor<any>>)[];
34
- renderAll(props: Types.MainProps): (React.ReactElement<{
35
- key: string;
36
- ZIndexBehavior: Enum.ZIndexBehavior.Sibling;
37
- ResetOnSpawn: boolean;
38
- }, string | React.JSXElementConstructor<any>> | React.ReactElement<{
39
- key: string;
40
- BackgroundTransparency: number;
41
- Size: UDim2;
42
- }, string | React.JSXElementConstructor<any>>)[];
43
- }
44
- export {};
@@ -1,123 +0,0 @@
1
- -- Compiled with roblox-ts v3.0.0
2
- local TS = _G[script]
3
- -- Packages
4
- -- Types
5
- -- Components
6
- local AppContainer = TS.import(script, script, "container").AppContainer
7
- local AppRegistry = TS.import(script, script, "decorator").AppRegistry
8
- -- Classes
9
- local RulesManager = TS.import(script, script, "rules").default
10
- -- Helpers
11
- local _helpers = TS.import(script, script, "helpers")
12
- local createBinding = _helpers.createBinding
13
- local createState = _helpers.createState
14
- local AppForge
15
- do
16
- AppForge = setmetatable({}, {
17
- __tostring = function()
18
- return "AppForge"
19
- end,
20
- })
21
- AppForge.__index = AppForge
22
- function AppForge.new(...)
23
- local self = setmetatable({}, AppForge)
24
- return self:constructor(...) or self
25
- end
26
- function AppForge:constructor()
27
- self.loaded = {}
28
- self.binds = {}
29
- self.states = {}
30
- self.rulesManager = RulesManager.new(self)
31
- end
32
- function AppForge:getBind(name)
33
- local _binds = self.binds
34
- local _name = name
35
- if not (_binds[_name] ~= nil) then
36
- createBinding(name, self)
37
- end
38
- local _binds_1 = self.binds
39
- local _name_1 = name
40
- return _binds_1[_name_1][1]
41
- end
42
- function AppForge:getState(name)
43
- local _states = self.states
44
- local _name = name
45
- if not (_states[_name] ~= nil) then
46
- createState(name, self)
47
- end
48
- local _states_1 = self.states
49
- local _name_1 = name
50
- return _states_1[_name_1][1]
51
- end
52
- function AppForge:set(name, value)
53
- self.rulesManager:applyRules(name)
54
- local _binds = self.binds
55
- local _name = name
56
- local _binding = _binds[_name]
57
- local _b = _binding[1]
58
- local setBinding = _binding[2]
59
- local _states = self.states
60
- local _name_1 = name
61
- local _binding_1 = _states[_name_1]
62
- local _s = _binding_1[1]
63
- local setState = _binding_1[2]
64
- if not setBinding then
65
- createBinding(name, self)
66
- end
67
- setBinding(value)
68
- setState(value)
69
- end
70
- function AppForge:open(name)
71
- self:set(name, true)
72
- end
73
- function AppForge:close(name)
74
- self:set(name, false)
75
- end
76
- function AppForge:toggle(name)
77
- self:set(name, not self:getState(name))
78
- end
79
- function AppForge:renderApp(props)
80
- return AppContainer(props)
81
- end
82
- function AppForge:renderApps(props)
83
- local names = props.names
84
- if names then
85
- -- ▼ ReadonlyArray.map ▼
86
- local _newValue = table.create(#names)
87
- local _callback = function(name)
88
- local _self = self
89
- local _object = table.clone(props)
90
- setmetatable(_object, nil)
91
- _object.name = name
92
- _object.names = nil
93
- return _self:renderApp(_object)
94
- end
95
- for _k, _v in names do
96
- _newValue[_k] = _callback(_v, _k - 1, names)
97
- end
98
- -- ▲ ReadonlyArray.map ▲
99
- return _newValue
100
- end
101
- error("No app names provided to renderApps")
102
- end
103
- function AppForge:renderAll(props)
104
- local names = {}
105
- -- ▼ ReadonlyMap.forEach ▼
106
- local _callback = function(_, name)
107
- local _name = name
108
- table.insert(names, _name)
109
- end
110
- for _k, _v in AppRegistry do
111
- _callback(_v, _k, AppRegistry)
112
- end
113
- -- ▲ ReadonlyMap.forEach ▲
114
- local _self = self
115
- local _object = table.clone(props)
116
- setmetatable(_object, nil)
117
- _object.names = names
118
- return _self:renderApps(_object)
119
- end
120
- end
121
- return {
122
- default = AppForge,
123
- }
@@ -1,6 +0,0 @@
1
- import type AppForge from "..";
2
- export default class RulesManager {
3
- private forge;
4
- constructor(forge: AppForge);
5
- applyRules(name: AppNames): void;
6
- }
@@ -1,27 +0,0 @@
1
- -- Compiled with roblox-ts v3.0.0
2
- local TS = _G[script]
3
- -- Types
4
- -- Rules
5
- local ParentRule = TS.import(script, script, "parent").default
6
- local RulesManager
7
- do
8
- RulesManager = setmetatable({}, {
9
- __tostring = function()
10
- return "RulesManager"
11
- end,
12
- })
13
- RulesManager.__index = RulesManager
14
- function RulesManager.new(...)
15
- local self = setmetatable({}, RulesManager)
16
- return self:constructor(...) or self
17
- end
18
- function RulesManager:constructor(forge)
19
- self.forge = forge
20
- end
21
- function RulesManager:applyRules(name)
22
- ParentRule(name, self.forge)
23
- end
24
- end
25
- return {
26
- default = RulesManager,
27
- }
@@ -1,42 +0,0 @@
1
- -- Compiled with roblox-ts v3.0.0
2
- local TS = _G[script]
3
- -- Types
4
- -- Components
5
- local AppRegistry = TS.import(script, script.Parent.Parent, "decorator").AppRegistry
6
- local function ParentRule(entry, forge)
7
- local children = {}
8
- -- ▼ ReadonlyMap.forEach ▼
9
- local _callback = function(app, name)
10
- local rules = app.rules
11
- if not rules then
12
- return nil
13
- end
14
- local _condition = rules.parent
15
- if _condition ~= "" and _condition then
16
- _condition = rules.parent == entry
17
- end
18
- if _condition ~= "" and _condition then
19
- local _binds = forge.binds
20
- local _entry = entry
21
- if not _binds[_entry] then
22
- local _name = name
23
- table.insert(children, _name)
24
- end
25
- end
26
- end
27
- for _k, _v in AppRegistry do
28
- _callback(_v, _k, AppRegistry)
29
- end
30
- -- ▲ ReadonlyMap.forEach ▲
31
- -- ▼ ReadonlyArray.forEach ▼
32
- local _callback_1 = function(name)
33
- return forge:close(name)
34
- end
35
- for _k, _v in children do
36
- _callback_1(_v, _k - 1, children)
37
- end
38
- -- ▲ ReadonlyArray.forEach ▲
39
- end
40
- return {
41
- default = ParentRule,
42
- }
@@ -1,44 +0,0 @@
1
- // Types
2
- import type { Args } from "./decorator";
3
- import type AppForge from ".";
4
-
5
- declare namespace Types {
6
- type AppRegistryProps = {
7
- name: AppNames;
8
- visible?: boolean;
9
- rules?: Rules.All;
10
- };
11
-
12
- type NameProps =
13
- | { name?: AppNames; names?: undefined }
14
- | { names?: AppNames[]; name?: undefined };
15
-
16
- type MainProps = {
17
- props: AppProps;
18
- forge: AppForge;
19
- target?: GuiObject | Camera;
20
- };
21
-
22
- type ClassProps = AppProps & {
23
- forge: AppForge;
24
- px: ReturnType<typeof import("@rbxts/loners-pretty-react-hooks").usePx>;
25
- };
26
-
27
- type AppRegistry = {
28
- constructor: new (props: MainProps) => Args;
29
- visible?: boolean;
30
- rules?: Rules.All;
31
- };
32
-
33
- namespace Rules {
34
- type All = {
35
- parent?: AppNames;
36
- };
37
- }
38
- }
39
-
40
- export type MainProps = Types.MainProps;
41
- export type NameProps = Types.NameProps;
42
- export type ClassProps = Types.ClassProps;
43
-
44
- export default Types;