@rbxts/app-forge 0.7.2-prototype.20 → 0.7.2-prototype.21
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 +1 -0
- package/out/renders.luau +55 -96
- package/out/types.d.ts +6 -1
- package/package.json +1 -1
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 selected = {}
|
|
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(selected, entry)
|
|
86
49
|
end
|
|
87
50
|
end
|
|
88
51
|
for _k, _v in _exp do
|
|
@@ -90,64 +53,20 @@ 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
|
|
107
|
-
end
|
|
108
|
-
if _result_2 ~= "" and _result_2 then
|
|
109
|
-
local _name = props.renders.name
|
|
110
|
-
local _test = groupEntries[_name]
|
|
111
|
-
if _test ~= nil then
|
|
112
|
-
_test = _test[group]
|
|
113
|
-
end
|
|
114
|
-
local test = _test
|
|
115
|
-
print("props.renders.name", test)
|
|
116
|
-
end
|
|
117
|
-
local _result_3 = props.renders
|
|
118
|
-
if _result_3 ~= nil then
|
|
119
|
-
_result_3 = _result_3.names
|
|
120
|
-
end
|
|
121
|
-
if _result_3 then
|
|
122
|
-
local test = {}
|
|
123
|
-
local _exp = props.renders.names
|
|
124
|
-
-- ▼ ReadonlyArray.forEach ▼
|
|
125
|
-
local _callback = function(name)
|
|
126
|
-
local _name = name
|
|
127
|
-
local _entry = groupEntries[_name]
|
|
128
|
-
if _entry ~= nil then
|
|
129
|
-
_entry = _entry[group]
|
|
130
|
-
end
|
|
131
|
-
local entry = _entry
|
|
132
|
-
if not entry then
|
|
133
|
-
return forge.logger:log("INFO", `Failed to find a Name of {name} searching through group {group}`)
|
|
134
|
-
end
|
|
135
|
-
table.insert(test, entry)
|
|
136
|
-
end
|
|
137
|
-
for _k, _v in _exp do
|
|
138
|
-
_callback(_v, _k - 1, _exp)
|
|
139
|
-
end
|
|
140
|
-
-- ▲ ReadonlyArray.forEach ▲
|
|
141
|
-
print("props.renders.names", test)
|
|
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(selected, entry)
|
|
142
61
|
end
|
|
143
62
|
end
|
|
63
|
+
print(selected)
|
|
144
64
|
local rendered = {}
|
|
145
65
|
local _exp = self.Rendered
|
|
146
66
|
-- ▼ ReadonlyMap.forEach ▼
|
|
147
67
|
local _callback = function(entries)
|
|
148
68
|
-- ▼ ReadonlyMap.forEach ▼
|
|
149
69
|
local _callback_1 = function(entry)
|
|
150
|
-
print("Rendering Entry", entry)
|
|
151
70
|
local _container = entry.container
|
|
152
71
|
table.insert(rendered, _container)
|
|
153
72
|
end
|
|
@@ -163,6 +82,46 @@ do
|
|
|
163
82
|
return rendered
|
|
164
83
|
end
|
|
165
84
|
end
|
|
85
|
+
function Renders:resolveGroupEntries(forge, group, names, name)
|
|
86
|
+
local groupEntries = self:getGroupEntries(group)
|
|
87
|
+
local result = {}
|
|
88
|
+
if name ~= "" and name then
|
|
89
|
+
local _name = name
|
|
90
|
+
local _entry = groupEntries[_name]
|
|
91
|
+
if _entry ~= nil then
|
|
92
|
+
local _group = group
|
|
93
|
+
_entry = _entry[_group]
|
|
94
|
+
end
|
|
95
|
+
local entry = _entry
|
|
96
|
+
if not entry then
|
|
97
|
+
forge.logger:log("INFO", `Failed to find a Name of {name} in group {group}`)
|
|
98
|
+
else
|
|
99
|
+
table.insert(result, entry)
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
if names then
|
|
103
|
+
-- ▼ ReadonlyArray.forEach ▼
|
|
104
|
+
local _callback = function(n)
|
|
105
|
+
local _n = n
|
|
106
|
+
local _entry = groupEntries[_n]
|
|
107
|
+
if _entry ~= nil then
|
|
108
|
+
local _group = group
|
|
109
|
+
_entry = _entry[_group]
|
|
110
|
+
end
|
|
111
|
+
local entry = _entry
|
|
112
|
+
if not entry then
|
|
113
|
+
forge.logger:log("INFO", `Failed to find a Name of {n} in group {group}`)
|
|
114
|
+
else
|
|
115
|
+
table.insert(result, entry)
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
for _k, _v in names do
|
|
119
|
+
_callback(_v, _k - 1, names)
|
|
120
|
+
end
|
|
121
|
+
-- ▲ ReadonlyArray.forEach ▲
|
|
122
|
+
end
|
|
123
|
+
return result
|
|
124
|
+
end
|
|
166
125
|
function Renders:getGroupEntries(group)
|
|
167
126
|
local entries = {}
|
|
168
127
|
-- ▼ 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;
|