@rbxts/app-forge 0.7.2-prototype.1 → 0.7.2-prototype.11
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.
- package/out/appRegistry.d.ts +7 -5
- package/out/appRegistry.luau +39 -26
- package/out/helpers/bindAppSource.d.ts +2 -0
- package/out/helpers/bindAppSource.luau +22 -0
- package/out/helpers/getAppEntry.d.ts +2 -0
- package/out/helpers/getAppEntry.luau +22 -0
- package/out/helpers/getAppSource.d.ts +2 -0
- package/out/helpers/getAppSource.luau +25 -0
- package/out/helpers/hasAppSource.d.ts +1 -0
- package/out/helpers/hasAppSource.luau +24 -0
- package/out/helpers/setAppSource.d.ts +1 -0
- package/out/helpers/setAppSource.luau +34 -0
- package/out/mount.d.ts +12 -24
- package/out/mount.luau +80 -155
- package/out/renders.d.ts +9 -0
- package/out/renders.luau +76 -0
- package/out/ruleEngine/check/exclusiveGroup.d.ts +2 -0
- package/out/ruleEngine/check/exclusiveGroup.luau +54 -0
- package/out/ruleEngine/check/parent.d.ts +2 -0
- package/out/ruleEngine/check/parent.luau +38 -0
- package/out/ruleEngine/index.d.ts +2 -2
- package/out/ruleEngine/init.luau +20 -15
- package/out/ruleEngine/render/anchor.d.ts +2 -0
- package/out/ruleEngine/render/anchor.luau +11 -0
- package/out/types.d.ts +12 -8
- package/package.json +1 -1
- package/out/renderManager.d.ts +0 -32
- package/out/renderManager.luau +0 -326
- package/out/ruleEngine/exclusiveGroup.d.ts +0 -2
- package/out/ruleEngine/exclusiveGroup.luau +0 -54
- package/out/ruleEngine/parent.d.ts +0 -2
- package/out/ruleEngine/parent.luau +0 -34
package/out/types.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ declare namespace Types {
|
|
|
21
21
|
minScale?: number;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
renders?: Render;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
type Class = AppProps & {
|
|
@@ -34,23 +34,23 @@ declare namespace Types {
|
|
|
34
34
|
type Props<N extends AppNames> = {
|
|
35
35
|
name: N;
|
|
36
36
|
visible?: boolean;
|
|
37
|
-
|
|
37
|
+
group?: AppGroups;
|
|
38
38
|
rules?: Rules.Generic<N>;
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
type Static = {
|
|
42
|
-
constructor: new (props: Types.Props.Main, name: AppNames) => Args;
|
|
42
|
+
constructor: new (props: Types.Props.Main, name: AppNames, group?: AppGroups) => Args;
|
|
43
43
|
|
|
44
44
|
visible?: boolean;
|
|
45
|
-
|
|
45
|
+
group?: AppGroups;
|
|
46
46
|
rules?: Rules.Static;
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
type Generic<N extends AppNames = AppNames> = {
|
|
50
|
-
constructor: new (props: Types.Props.Main, name: AppNames) => Args;
|
|
50
|
+
constructor: new (props: Types.Props.Main, name: AppNames, group?: AppGroups) => Args;
|
|
51
51
|
|
|
52
52
|
visible?: boolean;
|
|
53
|
-
|
|
53
|
+
group?: AppGroups;
|
|
54
54
|
rules?: Rules.Generic<N>;
|
|
55
55
|
};
|
|
56
56
|
}
|
|
@@ -58,12 +58,16 @@ declare namespace Types {
|
|
|
58
58
|
namespace Rules {
|
|
59
59
|
type WithParent<P> = {
|
|
60
60
|
parent: P;
|
|
61
|
-
|
|
61
|
+
|
|
62
|
+
parentGroup?: AppGroups;
|
|
63
|
+
anchor?: boolean;
|
|
62
64
|
};
|
|
63
65
|
|
|
64
66
|
type WithoutParent = {
|
|
65
67
|
parent?: never;
|
|
66
|
-
|
|
68
|
+
|
|
69
|
+
parentGroup?: never;
|
|
70
|
+
anchor?: never;
|
|
67
71
|
};
|
|
68
72
|
|
|
69
73
|
export type Static = {
|
package/package.json
CHANGED
package/out/renderManager.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import Vide from "@rbxts/vide";
|
|
2
|
-
import type Types from "./types";
|
|
3
|
-
import type AppForge from "./mount";
|
|
4
|
-
import Rules from "./ruleEngine";
|
|
5
|
-
export default class Renders extends Rules {
|
|
6
|
-
protected anchored: Map<string, {
|
|
7
|
-
id: AppNames;
|
|
8
|
-
render: Vide.Node;
|
|
9
|
-
}>;
|
|
10
|
-
constructor();
|
|
11
|
-
/**
|
|
12
|
-
* Entry point for mounting renders.
|
|
13
|
-
* Decides render strategy based on props.
|
|
14
|
-
*/
|
|
15
|
-
protected renderMount(this: AppForge, props: Types.Props.Main): Vide.Node;
|
|
16
|
-
/**
|
|
17
|
-
* Render multiple apps by name, avoiding duplicates.
|
|
18
|
-
*/
|
|
19
|
-
private renderNames;
|
|
20
|
-
/**
|
|
21
|
-
* Render children of a parent app recursively inside parent container
|
|
22
|
-
*/
|
|
23
|
-
private renderChildren;
|
|
24
|
-
private collectByGroup;
|
|
25
|
-
private normalizeGroups;
|
|
26
|
-
protected renderApp(this: AppForge, props: Types.Props.Main, renderedSet?: Set<AppNames>, parentContainer?: Instance): Vide.Node;
|
|
27
|
-
protected renderApps(this: AppForge, props: Types.Props.Main, renderedSet?: Set<AppNames>): Instance[];
|
|
28
|
-
protected renderGroup(this: AppForge, props: Types.Props.Main, renderedSet?: Set<AppNames>): Instance[];
|
|
29
|
-
protected renderGroupByName(this: AppForge, props: Types.Props.Main, renderedSet?: Set<AppNames>): Instance[];
|
|
30
|
-
protected renderGroupByNames(this: AppForge, props: Types.Props.Main, renderedSet?: Set<AppNames>): Instance[];
|
|
31
|
-
protected renderAll(this: AppForge, props: Types.Props.Main, renderedSet?: Set<AppNames>): Instance[];
|
|
32
|
-
}
|
package/out/renderManager.luau
DELETED
|
@@ -1,326 +0,0 @@
|
|
|
1
|
-
-- Compiled with roblox-ts v3.0.0
|
|
2
|
-
local TS = _G[script]
|
|
3
|
-
-- Packages
|
|
4
|
-
local _vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
|
|
5
|
-
local apply = _vide.apply
|
|
6
|
-
local create = _vide.create
|
|
7
|
-
local mount = _vide.mount
|
|
8
|
-
-- Types
|
|
9
|
-
-- Components
|
|
10
|
-
local AppRegistry = TS.import(script, script.Parent, "appRegistry").AppRegistry
|
|
11
|
-
-- Hooks
|
|
12
|
-
local usePx = TS.import(script, script.Parent, "hooks", "usePx").usePx
|
|
13
|
-
-- Classes
|
|
14
|
-
local Rules = TS.import(script, script.Parent, "ruleEngine").default
|
|
15
|
-
local Renders
|
|
16
|
-
do
|
|
17
|
-
local super = Rules
|
|
18
|
-
Renders = setmetatable({}, {
|
|
19
|
-
__tostring = function()
|
|
20
|
-
return "Renders"
|
|
21
|
-
end,
|
|
22
|
-
__index = super,
|
|
23
|
-
})
|
|
24
|
-
Renders.__index = Renders
|
|
25
|
-
function Renders.new(...)
|
|
26
|
-
local self = setmetatable({}, Renders)
|
|
27
|
-
return self:constructor(...) or self
|
|
28
|
-
end
|
|
29
|
-
function Renders:constructor()
|
|
30
|
-
super.constructor(self)
|
|
31
|
-
self.anchored = {}
|
|
32
|
-
end
|
|
33
|
-
function Renders:renderMount(props)
|
|
34
|
-
local _binding = props
|
|
35
|
-
local config = _binding.config
|
|
36
|
-
local render = _binding.render
|
|
37
|
-
local forge = _binding.forge
|
|
38
|
-
if not forge.__px then
|
|
39
|
-
local _debug = forge.debug
|
|
40
|
-
local _result = config
|
|
41
|
-
if _result ~= nil then
|
|
42
|
-
_result = _result.px
|
|
43
|
-
end
|
|
44
|
-
_debug:logTag("px", "global", "Initializing px scaling", _result)
|
|
45
|
-
local _result_1 = config
|
|
46
|
-
if _result_1 ~= nil then
|
|
47
|
-
_result_1 = _result_1.px.target
|
|
48
|
-
end
|
|
49
|
-
local _result_2 = config
|
|
50
|
-
if _result_2 ~= nil then
|
|
51
|
-
_result_2 = _result_2.px.resolution
|
|
52
|
-
end
|
|
53
|
-
local _result_3 = config
|
|
54
|
-
if _result_3 ~= nil then
|
|
55
|
-
_result_3 = _result_3.px.minScale
|
|
56
|
-
end
|
|
57
|
-
usePx(_result_1, _result_2, _result_3)
|
|
58
|
-
forge.__px = true
|
|
59
|
-
else
|
|
60
|
-
forge.debug:logTag("px", "global", "Skipped duplicate px initialization")
|
|
61
|
-
end
|
|
62
|
-
local renderedSet = {}
|
|
63
|
-
if render then
|
|
64
|
-
local _condition = render.name
|
|
65
|
-
if _condition ~= "" and _condition then
|
|
66
|
-
_condition = render.group
|
|
67
|
-
end
|
|
68
|
-
if _condition ~= "" and _condition then
|
|
69
|
-
return self:renderGroupByName(props, renderedSet)
|
|
70
|
-
end
|
|
71
|
-
local _value = render.names and render.group
|
|
72
|
-
if _value ~= "" and _value then
|
|
73
|
-
return self:renderGroupByNames(props, renderedSet)
|
|
74
|
-
end
|
|
75
|
-
local _value_1 = render.name
|
|
76
|
-
if _value_1 ~= "" and _value_1 then
|
|
77
|
-
return self:renderApp(props, renderedSet)
|
|
78
|
-
end
|
|
79
|
-
if render.names then
|
|
80
|
-
return self:renderApps(props, renderedSet)
|
|
81
|
-
end
|
|
82
|
-
local _value_2 = render.group
|
|
83
|
-
if _value_2 ~= "" and _value_2 then
|
|
84
|
-
return self:renderGroup(props, renderedSet)
|
|
85
|
-
end
|
|
86
|
-
end
|
|
87
|
-
return self:renderAll(props, renderedSet)
|
|
88
|
-
end
|
|
89
|
-
function Renders:renderNames(props, names, forge, context, renderedSet, details, parentContainer)
|
|
90
|
-
if not names then
|
|
91
|
-
local _logger = forge.logger
|
|
92
|
-
local _exp = `Renderer resolved 0 apps ({context})`
|
|
93
|
-
local _condition = details
|
|
94
|
-
if _condition == nil then
|
|
95
|
-
_condition = props.render
|
|
96
|
-
end
|
|
97
|
-
_logger:log("WARN", _exp, _condition)
|
|
98
|
-
return {}
|
|
99
|
-
end
|
|
100
|
-
local rendered = {}
|
|
101
|
-
for _, name in names do
|
|
102
|
-
if renderedSet[name] ~= nil then
|
|
103
|
-
continue
|
|
104
|
-
end
|
|
105
|
-
renderedSet[name] = true
|
|
106
|
-
local _forge = forge
|
|
107
|
-
local _object = table.clone(props)
|
|
108
|
-
setmetatable(_object, nil)
|
|
109
|
-
_object.render = {
|
|
110
|
-
name = name,
|
|
111
|
-
}
|
|
112
|
-
local appRender = _forge:renderApp(_object, renderedSet, parentContainer)
|
|
113
|
-
table.insert(rendered, appRender)
|
|
114
|
-
self:renderChildren(props, name, forge, renderedSet, rendered, appRender)
|
|
115
|
-
end
|
|
116
|
-
return rendered
|
|
117
|
-
end
|
|
118
|
-
function Renders:renderChildren(props, parentName, forge, renderedSet, accumulated, parentContainer)
|
|
119
|
-
-- ▼ ReadonlyMap.forEach ▼
|
|
120
|
-
local _callback = function(app, childName)
|
|
121
|
-
local _result = app.rules
|
|
122
|
-
if _result ~= nil then
|
|
123
|
-
_result = _result.parent
|
|
124
|
-
end
|
|
125
|
-
local _condition = _result == parentName
|
|
126
|
-
if _condition then
|
|
127
|
-
local _renderedSet = renderedSet
|
|
128
|
-
local _childName = childName
|
|
129
|
-
_condition = not (_renderedSet[_childName] ~= nil)
|
|
130
|
-
end
|
|
131
|
-
if _condition then
|
|
132
|
-
local _renderedSet = renderedSet
|
|
133
|
-
local _childName = childName
|
|
134
|
-
_renderedSet[_childName] = true
|
|
135
|
-
local _forge = forge
|
|
136
|
-
local _object = table.clone(props)
|
|
137
|
-
setmetatable(_object, nil)
|
|
138
|
-
_object.render = {
|
|
139
|
-
name = childName,
|
|
140
|
-
}
|
|
141
|
-
local childRender = _forge:renderApp(_object, renderedSet, parentContainer)
|
|
142
|
-
table.insert(accumulated, childRender)
|
|
143
|
-
mount(function()
|
|
144
|
-
return childRender
|
|
145
|
-
end, parentContainer)
|
|
146
|
-
self:renderChildren(props, childName, forge, renderedSet, accumulated, childRender)
|
|
147
|
-
end
|
|
148
|
-
end
|
|
149
|
-
for _k, _v in AppRegistry do
|
|
150
|
-
_callback(_v, _k, AppRegistry)
|
|
151
|
-
end
|
|
152
|
-
-- ▲ ReadonlyMap.forEach ▲
|
|
153
|
-
end
|
|
154
|
-
function Renders:collectByGroup(groups, filter)
|
|
155
|
-
local result = {}
|
|
156
|
-
-- ▼ ReadonlyMap.forEach ▼
|
|
157
|
-
local _callback = function(app, name)
|
|
158
|
-
local appGroup = app.renderGroup
|
|
159
|
-
if not (appGroup ~= "" and appGroup) then
|
|
160
|
-
return nil
|
|
161
|
-
end
|
|
162
|
-
if not (table.find(groups, appGroup) ~= nil) then
|
|
163
|
-
return nil
|
|
164
|
-
end
|
|
165
|
-
if filter and not filter(name) then
|
|
166
|
-
return nil
|
|
167
|
-
end
|
|
168
|
-
local _name = name
|
|
169
|
-
table.insert(result, _name)
|
|
170
|
-
end
|
|
171
|
-
for _k, _v in AppRegistry do
|
|
172
|
-
_callback(_v, _k, AppRegistry)
|
|
173
|
-
end
|
|
174
|
-
-- ▲ ReadonlyMap.forEach ▲
|
|
175
|
-
return result
|
|
176
|
-
end
|
|
177
|
-
function Renders:normalizeGroups(group)
|
|
178
|
-
local _group = group
|
|
179
|
-
local _result
|
|
180
|
-
if type(_group) == "table" then
|
|
181
|
-
local _array = {}
|
|
182
|
-
local _length = #_array
|
|
183
|
-
table.move(group, 1, #group, _length + 1, _array)
|
|
184
|
-
_result = _array
|
|
185
|
-
else
|
|
186
|
-
_result = { group }
|
|
187
|
-
end
|
|
188
|
-
return _result
|
|
189
|
-
end
|
|
190
|
-
function Renders:renderApp(props, renderedSet, parentContainer)
|
|
191
|
-
local _name = props.render
|
|
192
|
-
if _name ~= nil then
|
|
193
|
-
_name = _name.name
|
|
194
|
-
end
|
|
195
|
-
local name = _name
|
|
196
|
-
if not (name ~= "" and name) then
|
|
197
|
-
error("renderApp requires an app name", 2)
|
|
198
|
-
end
|
|
199
|
-
local appClass = AppRegistry[name]
|
|
200
|
-
if not appClass then
|
|
201
|
-
error(`App "{name}" not registered`, 2)
|
|
202
|
-
end
|
|
203
|
-
self.debug:time("render", name)
|
|
204
|
-
if not (self.loaded[name] ~= nil) then
|
|
205
|
-
local render = appClass.constructor.new(props, name):render()
|
|
206
|
-
if not render then
|
|
207
|
-
error(`App "{name}" returned undefined from render()`, 2)
|
|
208
|
-
end
|
|
209
|
-
apply(render)({
|
|
210
|
-
Name = "Render",
|
|
211
|
-
})
|
|
212
|
-
local container = create("Frame")({
|
|
213
|
-
Name = name,
|
|
214
|
-
BackgroundTransparency = 1,
|
|
215
|
-
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
216
|
-
Position = UDim2.fromScale(0.5, 0.5),
|
|
217
|
-
Size = UDim2.fromScale(1, 1),
|
|
218
|
-
[0] = render,
|
|
219
|
-
})
|
|
220
|
-
if parentContainer then
|
|
221
|
-
container.Parent = parentContainer
|
|
222
|
-
end
|
|
223
|
-
local _loaded = self.loaded
|
|
224
|
-
local _arg1 = {
|
|
225
|
-
container = container,
|
|
226
|
-
render = render,
|
|
227
|
-
}
|
|
228
|
-
_loaded[name] = _arg1
|
|
229
|
-
else
|
|
230
|
-
self.debug:logTag("render", name, "Reusing existing render instance")
|
|
231
|
-
end
|
|
232
|
-
local _result = renderedSet
|
|
233
|
-
if _result ~= nil then
|
|
234
|
-
_result[name] = true
|
|
235
|
-
end
|
|
236
|
-
self:renderRules(self, name, props)
|
|
237
|
-
self.debug:timeEnd("render", name)
|
|
238
|
-
return self.loaded[name].container
|
|
239
|
-
end
|
|
240
|
-
function Renders:renderApps(props, renderedSet)
|
|
241
|
-
if renderedSet == nil then
|
|
242
|
-
renderedSet = {}
|
|
243
|
-
end
|
|
244
|
-
local _names = props.render
|
|
245
|
-
if _names ~= nil then
|
|
246
|
-
_names = _names.names
|
|
247
|
-
end
|
|
248
|
-
local names = _names
|
|
249
|
-
if not names then
|
|
250
|
-
error("renderApps requires app names", 2)
|
|
251
|
-
end
|
|
252
|
-
return self:renderNames(props, names, self, "renderApps", renderedSet, names)
|
|
253
|
-
end
|
|
254
|
-
function Renders:renderGroup(props, renderedSet)
|
|
255
|
-
if renderedSet == nil then
|
|
256
|
-
renderedSet = {}
|
|
257
|
-
end
|
|
258
|
-
local _group = props.render
|
|
259
|
-
if _group ~= nil then
|
|
260
|
-
_group = _group.group
|
|
261
|
-
end
|
|
262
|
-
local group = _group
|
|
263
|
-
if not (group ~= "" and group) then
|
|
264
|
-
error("renderGroup requires a group", 2)
|
|
265
|
-
end
|
|
266
|
-
local groups = self:normalizeGroups(group)
|
|
267
|
-
return self:renderNames(props, self:collectByGroup(groups), self, "renderGroup", renderedSet, group)
|
|
268
|
-
end
|
|
269
|
-
function Renders:renderGroupByName(props, renderedSet)
|
|
270
|
-
if renderedSet == nil then
|
|
271
|
-
renderedSet = {}
|
|
272
|
-
end
|
|
273
|
-
local _binding = props.render or {}
|
|
274
|
-
local group = _binding.group
|
|
275
|
-
local name = _binding.name
|
|
276
|
-
if not (group ~= "" and group) or not (name ~= "" and name) then
|
|
277
|
-
error("Invalid renderGroupByName call", 2)
|
|
278
|
-
end
|
|
279
|
-
local groups = self:normalizeGroups(group)
|
|
280
|
-
return self:renderNames(props, self:collectByGroup(groups, function(n)
|
|
281
|
-
return n == name
|
|
282
|
-
end), self, "renderGroupByName", renderedSet, {
|
|
283
|
-
group = group,
|
|
284
|
-
name = name,
|
|
285
|
-
})
|
|
286
|
-
end
|
|
287
|
-
function Renders:renderGroupByNames(props, renderedSet)
|
|
288
|
-
if renderedSet == nil then
|
|
289
|
-
renderedSet = {}
|
|
290
|
-
end
|
|
291
|
-
local _binding = props.render or {}
|
|
292
|
-
local group = _binding.group
|
|
293
|
-
local names = _binding.names
|
|
294
|
-
if not (group ~= "" and group) or not names then
|
|
295
|
-
error("Invalid renderGroupByNames call", 2)
|
|
296
|
-
end
|
|
297
|
-
local groups = self:normalizeGroups(group)
|
|
298
|
-
return self:renderNames(props, self:collectByGroup(groups, function(n)
|
|
299
|
-
local _n = n
|
|
300
|
-
return table.find(names, _n) ~= nil
|
|
301
|
-
end), self, "renderGroupByNames", renderedSet, {
|
|
302
|
-
group = group,
|
|
303
|
-
names = names,
|
|
304
|
-
})
|
|
305
|
-
end
|
|
306
|
-
function Renders:renderAll(props, renderedSet)
|
|
307
|
-
if renderedSet == nil then
|
|
308
|
-
renderedSet = {}
|
|
309
|
-
end
|
|
310
|
-
local names = {}
|
|
311
|
-
-- ▼ ReadonlyMap.forEach ▼
|
|
312
|
-
local _callback = function(_, name)
|
|
313
|
-
local _name = name
|
|
314
|
-
table.insert(names, _name)
|
|
315
|
-
return #names
|
|
316
|
-
end
|
|
317
|
-
for _k, _v in AppRegistry do
|
|
318
|
-
_callback(_v, _k, AppRegistry)
|
|
319
|
-
end
|
|
320
|
-
-- ▲ ReadonlyMap.forEach ▲
|
|
321
|
-
return self:renderNames(props, names, self, "renderAll", renderedSet)
|
|
322
|
-
end
|
|
323
|
-
end
|
|
324
|
-
return {
|
|
325
|
-
default = Renders,
|
|
326
|
-
}
|
|
@@ -1,54 +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, "appRegistry").AppRegistry
|
|
6
|
-
local function ExclusiveGroupRule(entry, forge)
|
|
7
|
-
local _entry = entry
|
|
8
|
-
local entryApp = AppRegistry[_entry]
|
|
9
|
-
local _group = entryApp
|
|
10
|
-
if _group ~= nil then
|
|
11
|
-
_group = _group.rules
|
|
12
|
-
if _group ~= nil then
|
|
13
|
-
_group = _group.exclusiveGroup
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
local group = _group
|
|
17
|
-
if not (group ~= "" and group) then
|
|
18
|
-
return nil
|
|
19
|
-
end
|
|
20
|
-
local entryVisible = forge:getSource(entry)()
|
|
21
|
-
if not entryVisible then
|
|
22
|
-
return nil
|
|
23
|
-
end
|
|
24
|
-
forge.debug:logTag("rules", entry, "Exclusive group activated", group)
|
|
25
|
-
-- ▼ ReadonlyMap.forEach ▼
|
|
26
|
-
local _callback = function(app, name)
|
|
27
|
-
if name == entry then
|
|
28
|
-
return nil
|
|
29
|
-
end
|
|
30
|
-
local _result = app.rules
|
|
31
|
-
if _result ~= nil then
|
|
32
|
-
_result = _result.exclusiveGroup
|
|
33
|
-
end
|
|
34
|
-
if _result ~= group then
|
|
35
|
-
return nil
|
|
36
|
-
end
|
|
37
|
-
local visible = forge:getSource(name)()
|
|
38
|
-
if not visible then
|
|
39
|
-
return nil
|
|
40
|
-
end
|
|
41
|
-
forge.debug:logTag("rules", entry, "Closing app due to exclusive group", {
|
|
42
|
-
closed = name,
|
|
43
|
-
group = group,
|
|
44
|
-
})
|
|
45
|
-
forge:close(name, false)
|
|
46
|
-
end
|
|
47
|
-
for _k, _v in AppRegistry do
|
|
48
|
-
_callback(_v, _k, AppRegistry)
|
|
49
|
-
end
|
|
50
|
-
-- ▲ ReadonlyMap.forEach ▲
|
|
51
|
-
end
|
|
52
|
-
return {
|
|
53
|
-
default = ExclusiveGroupRule,
|
|
54
|
-
}
|
|
@@ -1,34 +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, "appRegistry").AppRegistry
|
|
6
|
-
local function ParentRule(entry, forge)
|
|
7
|
-
local entryVisible = forge:getSource(entry)()
|
|
8
|
-
-- ▼ ReadonlyMap.forEach ▼
|
|
9
|
-
local _callback = function(app, name)
|
|
10
|
-
local rules = app.rules
|
|
11
|
-
if not rules or rules.parent ~= entry then
|
|
12
|
-
return nil
|
|
13
|
-
end
|
|
14
|
-
if name == entry then
|
|
15
|
-
return nil
|
|
16
|
-
end
|
|
17
|
-
local childVisible = forge:getSource(name)()
|
|
18
|
-
if entryVisible or not childVisible then
|
|
19
|
-
return nil
|
|
20
|
-
end
|
|
21
|
-
forge.debug:logTag("rules", entry, "Closing child app (parent closed)", {
|
|
22
|
-
parent = entry,
|
|
23
|
-
child = name,
|
|
24
|
-
})
|
|
25
|
-
forge:close(name, false)
|
|
26
|
-
end
|
|
27
|
-
for _k, _v in AppRegistry do
|
|
28
|
-
_callback(_v, _k, AppRegistry)
|
|
29
|
-
end
|
|
30
|
-
-- ▲ ReadonlyMap.forEach ▲
|
|
31
|
-
end
|
|
32
|
-
return {
|
|
33
|
-
default = ParentRule,
|
|
34
|
-
}
|