@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.
@@ -51,7 +51,7 @@ local function App(props)
51
51
  local _object = {
52
52
  constructor = constructor,
53
53
  }
54
- local _left = "renderGroup"
54
+ local _left = "group"
55
55
  local _condition_1 = props.group
56
56
  if not (_condition_1 ~= "" and _condition_1) then
57
57
  _condition_1 = "None"
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 _result = props.renders
38
- if _result ~= nil then
39
- _result = _result.groups
37
+ local renders = _binding.renders
38
+ local loaded = {}
39
+ if not renders then
40
+ return {}
40
41
  end
41
- if _result then
42
- local _exp = props.renders.groups
42
+ if renders.groups then
43
+ local _exp = renders.groups
43
44
  -- ▼ ReadonlyArray.forEach ▼
44
45
  local _callback = function(group)
45
- local groupEntries = self:getGroupEntries(group)
46
- local _result_1 = props.renders
47
- if _result_1 ~= nil then
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 _result_1 = props.renders
94
- if _result_1 ~= nil then
95
- _result_1 = _result_1.group
96
- end
97
- if _result_1 ~= "" and _result_1 then
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
- 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]
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
- 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}`)
84
+ if _condition then
85
+ return nil
134
86
  end
135
- table.insert(test, entry)
87
+ print(childName, childGroup, childEntry)
136
88
  end
137
- for _k, _v in _exp do
138
- _callback(_v, _k - 1, _exp)
89
+ for _k, _v in groupEntries do
90
+ _callback_2(_v, _k, groupEntries)
139
91
  end
140
- -- ▲ ReadonlyArray.forEach ▲
141
- print("props.renders.names", test)
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 _callback = function(entries)
106
+ local _callback_1 = function(entries)
148
107
  -- ▼ ReadonlyMap.forEach ▼
149
- local _callback_1 = function(entry)
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
- _callback_1(_v, _k, entries)
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
- _callback(_v, _k, _exp)
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 Render = { name?: AppNames; names?: AppNames[]; group?: AppGroups; groups?: AppGroups[] };
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/app-forge",
3
- "version": "0.7.2-prototype.20",
3
+ "version": "0.7.2-prototype.22",
4
4
  "description": "An App Manager for Vide",
5
5
  "main": "out/init.lua",
6
6
  "types": "out/index.d.ts",