@rbxts/app-forge 0.7.2-prototype.20 → 0.7.2-prototype.22
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.luau +1 -1
- package/out/renders.d.ts +1 -0
- package/out/renders.luau +93 -95
- package/out/types.d.ts +6 -1
- package/package.json +1 -1
package/out/appRegistry.luau
CHANGED
package/out/renders.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export default class Renders extends Rules {
|
|
|
10
10
|
protected Rendered: Map<string, Map<string, Render>>;
|
|
11
11
|
constructor();
|
|
12
12
|
Render: (props: Types.Props.Main) => Instance[];
|
|
13
|
+
private resolveGroupEntries;
|
|
13
14
|
private getGroupEntries;
|
|
14
15
|
private createRender;
|
|
15
16
|
private getChildren;
|
package/out/renders.luau
CHANGED
|
@@ -34,55 +34,18 @@ do
|
|
|
34
34
|
self.Render = function(props)
|
|
35
35
|
local _binding = props
|
|
36
36
|
local forge = _binding.forge
|
|
37
|
-
local
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
local renders = _binding.renders
|
|
38
|
+
local loaded = {}
|
|
39
|
+
if not renders then
|
|
40
|
+
return {}
|
|
40
41
|
end
|
|
41
|
-
if
|
|
42
|
-
local _exp =
|
|
42
|
+
if renders.groups then
|
|
43
|
+
local _exp = renders.groups
|
|
43
44
|
-- ▼ ReadonlyArray.forEach ▼
|
|
44
45
|
local _callback = function(group)
|
|
45
|
-
local
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
_result_1 = _result_1.name
|
|
49
|
-
end
|
|
50
|
-
if _result_1 ~= "" and _result_1 then
|
|
51
|
-
local _name = props.renders.name
|
|
52
|
-
local _test = groupEntries[_name]
|
|
53
|
-
if _test ~= nil then
|
|
54
|
-
local _group = group
|
|
55
|
-
_test = _test[_group]
|
|
56
|
-
end
|
|
57
|
-
local test = _test
|
|
58
|
-
print("props.renders.name", test)
|
|
59
|
-
end
|
|
60
|
-
local _result_2 = props.renders
|
|
61
|
-
if _result_2 ~= nil then
|
|
62
|
-
_result_2 = _result_2.names
|
|
63
|
-
end
|
|
64
|
-
if _result_2 then
|
|
65
|
-
local test = {}
|
|
66
|
-
local _exp_1 = props.renders.names
|
|
67
|
-
-- ▼ ReadonlyArray.forEach ▼
|
|
68
|
-
local _callback_1 = function(name)
|
|
69
|
-
local _name = name
|
|
70
|
-
local _entry = groupEntries[_name]
|
|
71
|
-
if _entry ~= nil then
|
|
72
|
-
local _group = group
|
|
73
|
-
_entry = _entry[_group]
|
|
74
|
-
end
|
|
75
|
-
local entry = _entry
|
|
76
|
-
if not entry then
|
|
77
|
-
return forge.logger:log("INFO", `Failed to find a Name of {name} searching through group {group}`)
|
|
78
|
-
end
|
|
79
|
-
table.insert(test, entry)
|
|
80
|
-
end
|
|
81
|
-
for _k, _v in _exp_1 do
|
|
82
|
-
_callback_1(_v, _k - 1, _exp_1)
|
|
83
|
-
end
|
|
84
|
-
-- ▲ ReadonlyArray.forEach ▲
|
|
85
|
-
print("props.renders.names", test)
|
|
46
|
+
local entries = self:resolveGroupEntries(forge, group, renders.names, renders.name)
|
|
47
|
+
for _, entry in entries do
|
|
48
|
+
table.insert(loaded, entry)
|
|
86
49
|
end
|
|
87
50
|
end
|
|
88
51
|
for _k, _v in _exp do
|
|
@@ -90,79 +53,114 @@ do
|
|
|
90
53
|
end
|
|
91
54
|
-- ▲ ReadonlyArray.forEach ▲
|
|
92
55
|
end
|
|
93
|
-
local
|
|
94
|
-
if
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
local _group = props.renders
|
|
99
|
-
if _group ~= nil then
|
|
100
|
-
_group = _group.group
|
|
101
|
-
end
|
|
102
|
-
local group = _group
|
|
103
|
-
local groupEntries = self:getGroupEntries(group)
|
|
104
|
-
local _result_2 = props.renders
|
|
105
|
-
if _result_2 ~= nil then
|
|
106
|
-
_result_2 = _result_2.name
|
|
56
|
+
local _value = renders.group
|
|
57
|
+
if _value ~= "" and _value then
|
|
58
|
+
local entries = self:resolveGroupEntries(forge, renders.group, renders.names, renders.name)
|
|
59
|
+
for _, entry in entries do
|
|
60
|
+
table.insert(loaded, entry)
|
|
107
61
|
end
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
_entry = _entry[group]
|
|
62
|
+
end
|
|
63
|
+
-- ▼ ReadonlyArray.forEach ▼
|
|
64
|
+
local _callback = function(entry)
|
|
65
|
+
local parentName = tostring(entry.constructor)
|
|
66
|
+
local parentGroup = entry.group
|
|
67
|
+
print(parentName, parentGroup)
|
|
68
|
+
-- ▼ ReadonlyMap.forEach ▼
|
|
69
|
+
local _callback_1 = function(groupEntries, childName)
|
|
70
|
+
-- ▼ ReadonlyMap.forEach ▼
|
|
71
|
+
local _callback_2 = function(childEntry, childGroup)
|
|
72
|
+
local _result = childEntry.rules
|
|
73
|
+
if _result ~= nil then
|
|
74
|
+
_result = _result.parent
|
|
75
|
+
end
|
|
76
|
+
local _condition = _result ~= parentName
|
|
77
|
+
if _condition then
|
|
78
|
+
local _result_1 = childEntry.rules
|
|
79
|
+
if _result_1 ~= nil then
|
|
80
|
+
_result_1 = _result_1.parentGroup
|
|
81
|
+
end
|
|
82
|
+
_condition = _result_1 ~= parentGroup
|
|
130
83
|
end
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
return forge.logger:log("INFO", `Failed to find a Name of {name} searching through group {group}`)
|
|
84
|
+
if _condition then
|
|
85
|
+
return nil
|
|
134
86
|
end
|
|
135
|
-
|
|
87
|
+
print(childName, childGroup, childEntry)
|
|
136
88
|
end
|
|
137
|
-
for _k, _v in
|
|
138
|
-
|
|
89
|
+
for _k, _v in groupEntries do
|
|
90
|
+
_callback_2(_v, _k, groupEntries)
|
|
139
91
|
end
|
|
140
|
-
-- ▲
|
|
141
|
-
|
|
92
|
+
-- ▲ ReadonlyMap.forEach ▲
|
|
93
|
+
end
|
|
94
|
+
for _k, _v in AppRegistry do
|
|
95
|
+
_callback_1(_v, _k, AppRegistry)
|
|
142
96
|
end
|
|
97
|
+
-- ▲ ReadonlyMap.forEach ▲
|
|
98
|
+
end
|
|
99
|
+
for _k, _v in loaded do
|
|
100
|
+
_callback(_v, _k - 1, loaded)
|
|
143
101
|
end
|
|
102
|
+
-- ▲ ReadonlyArray.forEach ▲
|
|
144
103
|
local rendered = {}
|
|
145
104
|
local _exp = self.Rendered
|
|
146
105
|
-- ▼ ReadonlyMap.forEach ▼
|
|
147
|
-
local
|
|
106
|
+
local _callback_1 = function(entries)
|
|
148
107
|
-- ▼ ReadonlyMap.forEach ▼
|
|
149
|
-
local
|
|
150
|
-
print("Rendering Entry", entry)
|
|
108
|
+
local _callback_2 = function(entry)
|
|
151
109
|
local _container = entry.container
|
|
152
110
|
table.insert(rendered, _container)
|
|
153
111
|
end
|
|
154
112
|
for _k, _v in entries do
|
|
155
|
-
|
|
113
|
+
_callback_2(_v, _k, entries)
|
|
156
114
|
end
|
|
157
115
|
-- ▲ ReadonlyMap.forEach ▲
|
|
158
116
|
end
|
|
159
117
|
for _k, _v in _exp do
|
|
160
|
-
|
|
118
|
+
_callback_1(_v, _k, _exp)
|
|
161
119
|
end
|
|
162
120
|
-- ▲ ReadonlyMap.forEach ▲
|
|
163
121
|
return rendered
|
|
164
122
|
end
|
|
165
123
|
end
|
|
124
|
+
function Renders:resolveGroupEntries(forge, group, names, name)
|
|
125
|
+
local groupEntries = self:getGroupEntries(group)
|
|
126
|
+
local result = {}
|
|
127
|
+
if name ~= "" and name then
|
|
128
|
+
local _name = name
|
|
129
|
+
local _entry = groupEntries[_name]
|
|
130
|
+
if _entry ~= nil then
|
|
131
|
+
local _group = group
|
|
132
|
+
_entry = _entry[_group]
|
|
133
|
+
end
|
|
134
|
+
local entry = _entry
|
|
135
|
+
if not entry then
|
|
136
|
+
forge.logger:log("INFO", `Failed to find a Name of {name} in group {group}`)
|
|
137
|
+
else
|
|
138
|
+
table.insert(result, entry)
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
if names then
|
|
142
|
+
-- ▼ ReadonlyArray.forEach ▼
|
|
143
|
+
local _callback = function(n)
|
|
144
|
+
local _n = n
|
|
145
|
+
local _entry = groupEntries[_n]
|
|
146
|
+
if _entry ~= nil then
|
|
147
|
+
local _group = group
|
|
148
|
+
_entry = _entry[_group]
|
|
149
|
+
end
|
|
150
|
+
local entry = _entry
|
|
151
|
+
if not entry then
|
|
152
|
+
forge.logger:log("INFO", `Failed to find a Name of {n} in group {group}`)
|
|
153
|
+
else
|
|
154
|
+
table.insert(result, entry)
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
for _k, _v in names do
|
|
158
|
+
_callback(_v, _k - 1, names)
|
|
159
|
+
end
|
|
160
|
+
-- ▲ ReadonlyArray.forEach ▲
|
|
161
|
+
end
|
|
162
|
+
return result
|
|
163
|
+
end
|
|
166
164
|
function Renders:getGroupEntries(group)
|
|
167
165
|
local entries = {}
|
|
168
166
|
-- ▼ ReadonlyMap.forEach ▼
|
package/out/types.d.ts
CHANGED
|
@@ -4,7 +4,12 @@ import type AppForge from "./mount";
|
|
|
4
4
|
|
|
5
5
|
declare namespace Types {
|
|
6
6
|
namespace Props {
|
|
7
|
-
type
|
|
7
|
+
type NameSelector = { name: AppNames; names?: never } | { names: AppNames[]; name?: never };
|
|
8
|
+
type GroupSelector =
|
|
9
|
+
| { group: AppGroups; groups?: never }
|
|
10
|
+
| { groups: AppGroups[]; group?: never };
|
|
11
|
+
|
|
12
|
+
export type Render = NameSelector & GroupSelector;
|
|
8
13
|
|
|
9
14
|
type Main = {
|
|
10
15
|
props: AppProps;
|