@rbxts/app-forge 0.7.2-prototype.27 → 0.7.2-prototype.28
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/renders.d.ts +2 -1
- package/out/renders.luau +61 -35
- package/package.json +1 -1
package/out/renders.d.ts
CHANGED
|
@@ -4,12 +4,13 @@ import Rules from "./ruleEngine";
|
|
|
4
4
|
type Render = {
|
|
5
5
|
instance: Instance;
|
|
6
6
|
container: Instance;
|
|
7
|
+
entry: Types.AppRegistry.Static;
|
|
7
8
|
};
|
|
8
9
|
export default class Renders extends Rules {
|
|
9
10
|
private __px;
|
|
10
11
|
protected Loaded: Map<string, Map<string, Render>>;
|
|
11
12
|
constructor();
|
|
12
|
-
|
|
13
|
+
Load: (props: Types.Props.Main) => Instance[];
|
|
13
14
|
private resolveGroupEntries;
|
|
14
15
|
private getGroupEntries;
|
|
15
16
|
private createInstance;
|
package/out/renders.luau
CHANGED
|
@@ -31,11 +31,10 @@ do
|
|
|
31
31
|
super.constructor(self)
|
|
32
32
|
self.__px = false
|
|
33
33
|
self.Loaded = {}
|
|
34
|
-
self.
|
|
34
|
+
self.Load = function(props)
|
|
35
35
|
local _binding = props
|
|
36
|
-
local forge = _binding.forge
|
|
37
36
|
local renders = _binding.renders
|
|
38
|
-
local
|
|
37
|
+
local toLoad = {}
|
|
39
38
|
if not renders then
|
|
40
39
|
return {}
|
|
41
40
|
end
|
|
@@ -45,7 +44,7 @@ do
|
|
|
45
44
|
local _callback = function(group)
|
|
46
45
|
local entries = self:resolveGroupEntries(group, renders.names, renders.name)
|
|
47
46
|
for _, entry in entries do
|
|
48
|
-
table.insert(
|
|
47
|
+
table.insert(toLoad, entry)
|
|
49
48
|
end
|
|
50
49
|
end
|
|
51
50
|
for _k, _v in _exp do
|
|
@@ -57,7 +56,7 @@ do
|
|
|
57
56
|
if _value ~= "" and _value then
|
|
58
57
|
local entries = self:resolveGroupEntries(renders.group, renders.names, renders.name)
|
|
59
58
|
for _, entry in entries do
|
|
60
|
-
table.insert(
|
|
59
|
+
table.insert(toLoad, entry)
|
|
61
60
|
end
|
|
62
61
|
end
|
|
63
62
|
-- ▼ ReadonlyArray.forEach ▼
|
|
@@ -84,7 +83,7 @@ do
|
|
|
84
83
|
return nil
|
|
85
84
|
end
|
|
86
85
|
local _childEntry = childEntry
|
|
87
|
-
table.insert(
|
|
86
|
+
table.insert(toLoad, _childEntry)
|
|
88
87
|
end
|
|
89
88
|
for _k, _v in groupEntries do
|
|
90
89
|
_callback_2(_v, _k, groupEntries)
|
|
@@ -96,44 +95,46 @@ do
|
|
|
96
95
|
end
|
|
97
96
|
-- ▲ ReadonlyMap.forEach ▲
|
|
98
97
|
end
|
|
99
|
-
for _k, _v in
|
|
100
|
-
_callback(_v, _k - 1,
|
|
98
|
+
for _k, _v in toLoad do
|
|
99
|
+
_callback(_v, _k - 1, toLoad)
|
|
101
100
|
end
|
|
102
101
|
-- ▲ ReadonlyArray.forEach ▲
|
|
103
|
-
local
|
|
102
|
+
local load = {}
|
|
104
103
|
-- ▼ ReadonlyArray.forEach ▼
|
|
105
104
|
local _callback_1 = function(entry)
|
|
106
105
|
local name = tostring(entry.constructor)
|
|
107
106
|
local group = entry.group
|
|
108
|
-
|
|
109
|
-
local
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
local _condition = entry.rules.parentGroup
|
|
115
|
-
if not (_condition ~= "" and _condition) then
|
|
116
|
-
_condition = "None"
|
|
107
|
+
self:createInstance(props, name, group)
|
|
108
|
+
local _exp = self.Loaded
|
|
109
|
+
-- ▼ ReadonlyMap.forEach ▼
|
|
110
|
+
local _callback_2 = function(renderGroup, loadedName)
|
|
111
|
+
if name ~= loadedName then
|
|
112
|
+
return nil
|
|
117
113
|
end
|
|
118
|
-
|
|
119
|
-
local
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
if parentMap then
|
|
123
|
-
local parentEntry = parentMap[group]
|
|
124
|
-
if parentEntry then
|
|
125
|
-
parent = parentEntry.container
|
|
114
|
+
-- ▼ ReadonlyMap.forEach ▼
|
|
115
|
+
local _callback_3 = function(render, group)
|
|
116
|
+
if group ~= group then
|
|
117
|
+
return nil
|
|
126
118
|
end
|
|
119
|
+
local _container = render.container
|
|
120
|
+
table.insert(load, _container)
|
|
127
121
|
end
|
|
122
|
+
for _k, _v in renderGroup do
|
|
123
|
+
_callback_3(_v, _k, renderGroup)
|
|
124
|
+
end
|
|
125
|
+
-- ▲ ReadonlyMap.forEach ▲
|
|
126
|
+
end
|
|
127
|
+
for _k, _v in _exp do
|
|
128
|
+
_callback_2(_v, _k, _exp)
|
|
128
129
|
end
|
|
129
|
-
|
|
130
|
+
-- ▲ ReadonlyMap.forEach ▲
|
|
130
131
|
end
|
|
131
|
-
for _k, _v in
|
|
132
|
-
_callback_1(_v, _k - 1,
|
|
132
|
+
for _k, _v in toLoad do
|
|
133
|
+
_callback_1(_v, _k - 1, toLoad)
|
|
133
134
|
end
|
|
134
135
|
-- ▲ ReadonlyArray.forEach ▲
|
|
135
|
-
print(
|
|
136
|
-
return
|
|
136
|
+
print(load)
|
|
137
|
+
return load
|
|
137
138
|
end
|
|
138
139
|
end
|
|
139
140
|
function Renders:resolveGroupEntries(group, names, name)
|
|
@@ -197,11 +198,35 @@ do
|
|
|
197
198
|
-- ▲ ReadonlyMap.forEach ▲
|
|
198
199
|
return entries
|
|
199
200
|
end
|
|
200
|
-
function Renders:createInstance(props, name, group
|
|
201
|
+
function Renders:createInstance(props, name, group)
|
|
201
202
|
local entry = getAppEntry(name, group)
|
|
202
203
|
if not entry then
|
|
203
204
|
return nil
|
|
204
205
|
end
|
|
206
|
+
local parentContainer
|
|
207
|
+
local _result = entry.rules
|
|
208
|
+
if _result ~= nil then
|
|
209
|
+
_result = _result.parent
|
|
210
|
+
end
|
|
211
|
+
if _result ~= "" and _result then
|
|
212
|
+
local _value = entry.rules.parent
|
|
213
|
+
if _value ~= "" and _value then
|
|
214
|
+
local _condition = entry.rules.parentGroup
|
|
215
|
+
if not (_condition ~= "" and _condition) then
|
|
216
|
+
_condition = "None"
|
|
217
|
+
end
|
|
218
|
+
local group = _condition
|
|
219
|
+
local _loaded = self.Loaded
|
|
220
|
+
local _parent = entry.rules.parent
|
|
221
|
+
local parentMap = _loaded[_parent]
|
|
222
|
+
if parentMap then
|
|
223
|
+
local parentEntry = parentMap[group]
|
|
224
|
+
if parentEntry then
|
|
225
|
+
parentContainer = parentEntry.container
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
end
|
|
205
230
|
local instance = entry.constructor.new(props, name, group):render()
|
|
206
231
|
instance.Name = "Render"
|
|
207
232
|
local container = (Vide.jsx("frame", {
|
|
@@ -210,13 +235,14 @@ do
|
|
|
210
235
|
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
211
236
|
Position = UDim2.fromScale(0.5, 0.5),
|
|
212
237
|
Size = UDim2.fromScale(1, 1),
|
|
213
|
-
Parent =
|
|
238
|
+
Parent = parentContainer,
|
|
214
239
|
}, instance))
|
|
215
240
|
local newMap = {}
|
|
216
241
|
local _group = group
|
|
217
242
|
local _arg1 = {
|
|
218
243
|
container = container,
|
|
219
244
|
instance = instance,
|
|
245
|
+
entry = entry,
|
|
220
246
|
}
|
|
221
247
|
newMap[_group] = _arg1
|
|
222
248
|
local _loaded = self.Loaded
|
|
@@ -252,14 +278,14 @@ do
|
|
|
252
278
|
Name = "App Tree",
|
|
253
279
|
ZIndexBehavior = "Sibling",
|
|
254
280
|
ResetOnSpawn = false,
|
|
255
|
-
}, Vide.jsx(self.
|
|
281
|
+
}, Vide.jsx(self.Load, _attributes)))
|
|
256
282
|
end
|
|
257
283
|
return _result
|
|
258
284
|
end)
|
|
259
285
|
else
|
|
260
286
|
local _attributes = table.clone(props)
|
|
261
287
|
setmetatable(_attributes, nil)
|
|
262
|
-
return Vide.jsx(self.
|
|
288
|
+
return Vide.jsx(self.Load, _attributes)
|
|
263
289
|
end
|
|
264
290
|
end
|
|
265
291
|
end
|