@rbxts/app-forge 0.7.2-prototype.27 → 0.7.2-prototype.29
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 +67 -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,52 @@ 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
|
-
|
|
123
|
-
local
|
|
124
|
-
if
|
|
125
|
-
|
|
114
|
+
-- ▼ ReadonlyMap.forEach ▼
|
|
115
|
+
local _callback_3 = function(render, group)
|
|
116
|
+
if group ~= group then
|
|
117
|
+
return nil
|
|
118
|
+
end
|
|
119
|
+
local _result = render.entry.rules
|
|
120
|
+
if _result ~= nil then
|
|
121
|
+
_result = _result.parent
|
|
122
|
+
end
|
|
123
|
+
if not (_result ~= "" and _result) then
|
|
124
|
+
local _container = render.container
|
|
125
|
+
table.insert(load, _container)
|
|
126
126
|
end
|
|
127
127
|
end
|
|
128
|
+
for _k, _v in renderGroup do
|
|
129
|
+
_callback_3(_v, _k, renderGroup)
|
|
130
|
+
end
|
|
131
|
+
-- ▲ ReadonlyMap.forEach ▲
|
|
128
132
|
end
|
|
129
|
-
|
|
133
|
+
for _k, _v in _exp do
|
|
134
|
+
_callback_2(_v, _k, _exp)
|
|
135
|
+
end
|
|
136
|
+
-- ▲ ReadonlyMap.forEach ▲
|
|
130
137
|
end
|
|
131
|
-
for _k, _v in
|
|
132
|
-
_callback_1(_v, _k - 1,
|
|
138
|
+
for _k, _v in toLoad do
|
|
139
|
+
_callback_1(_v, _k - 1, toLoad)
|
|
133
140
|
end
|
|
134
141
|
-- ▲ ReadonlyArray.forEach ▲
|
|
135
|
-
print(
|
|
136
|
-
return
|
|
142
|
+
print(load)
|
|
143
|
+
return load
|
|
137
144
|
end
|
|
138
145
|
end
|
|
139
146
|
function Renders:resolveGroupEntries(group, names, name)
|
|
@@ -197,11 +204,35 @@ do
|
|
|
197
204
|
-- ▲ ReadonlyMap.forEach ▲
|
|
198
205
|
return entries
|
|
199
206
|
end
|
|
200
|
-
function Renders:createInstance(props, name, group
|
|
207
|
+
function Renders:createInstance(props, name, group)
|
|
201
208
|
local entry = getAppEntry(name, group)
|
|
202
209
|
if not entry then
|
|
203
210
|
return nil
|
|
204
211
|
end
|
|
212
|
+
local parentContainer
|
|
213
|
+
local _result = entry.rules
|
|
214
|
+
if _result ~= nil then
|
|
215
|
+
_result = _result.parent
|
|
216
|
+
end
|
|
217
|
+
if _result ~= "" and _result then
|
|
218
|
+
local _value = entry.rules.parent
|
|
219
|
+
if _value ~= "" and _value then
|
|
220
|
+
local _condition = entry.rules.parentGroup
|
|
221
|
+
if not (_condition ~= "" and _condition) then
|
|
222
|
+
_condition = "None"
|
|
223
|
+
end
|
|
224
|
+
local group = _condition
|
|
225
|
+
local _loaded = self.Loaded
|
|
226
|
+
local _parent = entry.rules.parent
|
|
227
|
+
local parentMap = _loaded[_parent]
|
|
228
|
+
if parentMap then
|
|
229
|
+
local parentEntry = parentMap[group]
|
|
230
|
+
if parentEntry then
|
|
231
|
+
parentContainer = parentEntry.container
|
|
232
|
+
end
|
|
233
|
+
end
|
|
234
|
+
end
|
|
235
|
+
end
|
|
205
236
|
local instance = entry.constructor.new(props, name, group):render()
|
|
206
237
|
instance.Name = "Render"
|
|
207
238
|
local container = (Vide.jsx("frame", {
|
|
@@ -210,13 +241,14 @@ do
|
|
|
210
241
|
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
211
242
|
Position = UDim2.fromScale(0.5, 0.5),
|
|
212
243
|
Size = UDim2.fromScale(1, 1),
|
|
213
|
-
Parent =
|
|
244
|
+
Parent = parentContainer,
|
|
214
245
|
}, instance))
|
|
215
246
|
local newMap = {}
|
|
216
247
|
local _group = group
|
|
217
248
|
local _arg1 = {
|
|
218
249
|
container = container,
|
|
219
250
|
instance = instance,
|
|
251
|
+
entry = entry,
|
|
220
252
|
}
|
|
221
253
|
newMap[_group] = _arg1
|
|
222
254
|
local _loaded = self.Loaded
|
|
@@ -252,14 +284,14 @@ do
|
|
|
252
284
|
Name = "App Tree",
|
|
253
285
|
ZIndexBehavior = "Sibling",
|
|
254
286
|
ResetOnSpawn = false,
|
|
255
|
-
}, Vide.jsx(self.
|
|
287
|
+
}, Vide.jsx(self.Load, _attributes)))
|
|
256
288
|
end
|
|
257
289
|
return _result
|
|
258
290
|
end)
|
|
259
291
|
else
|
|
260
292
|
local _attributes = table.clone(props)
|
|
261
293
|
setmetatable(_attributes, nil)
|
|
262
|
-
return Vide.jsx(self.
|
|
294
|
+
return Vide.jsx(self.Load, _attributes)
|
|
263
295
|
end
|
|
264
296
|
end
|
|
265
297
|
end
|