@rbxts/app-forge 0.7.2-prototype.33 → 0.7.2-prototype.34
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.d.ts +1 -1
- package/out/context.d.ts +1 -1
- package/out/index.d.ts +1 -1
- package/out/init.luau +1 -1
- package/out/renders.d.ts +2 -2
- package/out/renders.luau +133 -138
- package/out/ruleEngine/check/exclusiveGroup.d.ts +1 -1
- package/out/ruleEngine/check/parent.d.ts +1 -1
- package/out/ruleEngine/index.d.ts +1 -1
- package/out/types.d.ts +8 -3
- package/package.json +1 -1
- /package/out/{mount.d.ts → forge.d.ts} +0 -0
- /package/out/{mount.luau → forge.luau} +0 -0
package/out/appRegistry.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Vide from "@rbxts/vide";
|
|
2
2
|
import type Types from "./types";
|
|
3
|
-
import type AppForge from "./
|
|
3
|
+
import type AppForge from "./forge";
|
|
4
4
|
export declare const AppRegistry: Map<string, Map<string, Types.AppRegistry.Static>>;
|
|
5
5
|
export declare const AppSources: Map<string, Map<string, Vide.Source<boolean>>>;
|
|
6
6
|
/**
|
package/out/context.d.ts
CHANGED
package/out/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { App, Args } from "./appRegistry";
|
|
2
|
-
export { default as CreateForge } from "./
|
|
2
|
+
export { default as CreateForge } from "./forge";
|
|
3
3
|
export type { ForgeProps, ClassProps, RenderProps, } from "./types";
|
|
4
4
|
export { default as useAppContext } from "./hooks/useAppContext";
|
|
5
5
|
export { default as Contexts } from "./context";
|
package/out/init.luau
CHANGED
|
@@ -6,7 +6,7 @@ local _appRegistry = TS.import(script, script, "appRegistry")
|
|
|
6
6
|
exports.App = _appRegistry.App
|
|
7
7
|
exports.Args = _appRegistry.Args
|
|
8
8
|
-- Creators
|
|
9
|
-
exports.CreateForge = TS.import(script, script, "
|
|
9
|
+
exports.CreateForge = TS.import(script, script, "forge").default
|
|
10
10
|
-- Types
|
|
11
11
|
exports.useAppContext = TS.import(script, script, "hooks", "useAppContext").default
|
|
12
12
|
exports.Contexts = TS.import(script, script, "context").default
|
package/out/renders.d.ts
CHANGED
|
@@ -11,8 +11,8 @@ export default class Renders extends Rules {
|
|
|
11
11
|
protected Loaded: Map<string, Map<string, Render>>;
|
|
12
12
|
constructor();
|
|
13
13
|
Load: (props: Types.Props.Main) => Instance[];
|
|
14
|
-
private
|
|
15
|
-
private
|
|
14
|
+
private collectEntries;
|
|
15
|
+
private expandWithChildren;
|
|
16
16
|
private createInstance;
|
|
17
17
|
protected initalize(props: Types.Props.Main, target?: GuiObject | Instance, root?: GuiObject | Instance): Vide.Node;
|
|
18
18
|
}
|
package/out/renders.luau
CHANGED
|
@@ -33,177 +33,171 @@ do
|
|
|
33
33
|
self.__px = false
|
|
34
34
|
self.Loaded = {}
|
|
35
35
|
self.Load = function(props)
|
|
36
|
-
local
|
|
37
|
-
local
|
|
38
|
-
local
|
|
39
|
-
if not renders then
|
|
40
|
-
return {}
|
|
41
|
-
end
|
|
42
|
-
if renders.groups then
|
|
43
|
-
local _exp = renders.groups
|
|
44
|
-
-- ▼ ReadonlyArray.forEach ▼
|
|
45
|
-
local _callback = function(group)
|
|
46
|
-
local entries = self:resolveGroupEntries(group, renders.names, renders.name)
|
|
47
|
-
for _, entry in entries do
|
|
48
|
-
table.insert(toLoad, entry)
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
for _k, _v in _exp do
|
|
52
|
-
_callback(_v, _k - 1, _exp)
|
|
53
|
-
end
|
|
54
|
-
-- ▲ ReadonlyArray.forEach ▲
|
|
55
|
-
end
|
|
56
|
-
local _value = renders.group
|
|
57
|
-
if _value ~= "" and _value then
|
|
58
|
-
local entries = self:resolveGroupEntries(renders.group, renders.names, renders.name)
|
|
59
|
-
for _, entry in entries do
|
|
60
|
-
table.insert(toLoad, entry)
|
|
61
|
-
end
|
|
62
|
-
end
|
|
36
|
+
local baseEntries = self:collectEntries(props.renders)
|
|
37
|
+
local toLoad = self:expandWithChildren(baseEntries)
|
|
38
|
+
local load = {}
|
|
63
39
|
-- ▼ ReadonlyArray.forEach ▼
|
|
64
40
|
local _callback = function(entry)
|
|
65
41
|
local name = tostring(entry.constructor)
|
|
66
42
|
local group = entry.group
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
local _callback_2 = function(childEntry)
|
|
71
|
-
local _result = childEntry.rules
|
|
72
|
-
if _result ~= nil then
|
|
73
|
-
_result = _result.parent
|
|
74
|
-
end
|
|
75
|
-
local _condition = _result ~= name
|
|
76
|
-
if not _condition then
|
|
77
|
-
local _result_1 = childEntry.rules
|
|
78
|
-
if _result_1 ~= nil then
|
|
79
|
-
_result_1 = _result_1.parentGroup
|
|
80
|
-
end
|
|
81
|
-
_condition = _result_1 ~= group
|
|
82
|
-
end
|
|
83
|
-
if _condition then
|
|
84
|
-
return nil
|
|
85
|
-
end
|
|
86
|
-
local _childEntry = childEntry
|
|
87
|
-
table.insert(toLoad, _childEntry)
|
|
88
|
-
end
|
|
89
|
-
for _k, _v in groupEntries do
|
|
90
|
-
_callback_2(_v, _k, groupEntries)
|
|
91
|
-
end
|
|
92
|
-
-- ▲ ReadonlyMap.forEach ▲
|
|
93
|
-
end
|
|
94
|
-
for _k, _v in AppRegistry do
|
|
95
|
-
_callback_1(_v, _k, AppRegistry)
|
|
43
|
+
local render = self:createInstance(props, name, group)
|
|
44
|
+
if not render then
|
|
45
|
+
return nil
|
|
96
46
|
end
|
|
97
|
-
--
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
end
|
|
102
|
-
-- ▲ ReadonlyArray.forEach ▲
|
|
103
|
-
local load = {}
|
|
104
|
-
-- ▼ ReadonlyArray.forEach ▼
|
|
105
|
-
local _callback_1 = function(entry)
|
|
106
|
-
local name = tostring(entry.constructor)
|
|
107
|
-
local group = entry.group
|
|
108
|
-
self:createInstance(props, name, group)
|
|
109
|
-
local _exp = self.Loaded
|
|
110
|
-
-- ▼ ReadonlyMap.forEach ▼
|
|
111
|
-
local _callback_2 = function(renderGroup, loadedName)
|
|
112
|
-
if name ~= loadedName then
|
|
113
|
-
return nil
|
|
114
|
-
end
|
|
115
|
-
-- ▼ ReadonlyMap.forEach ▼
|
|
116
|
-
local _callback_3 = function(render, group)
|
|
117
|
-
if group ~= group then
|
|
118
|
-
return nil
|
|
119
|
-
end
|
|
120
|
-
local _result = render.entry.rules
|
|
121
|
-
if _result ~= nil then
|
|
122
|
-
_result = _result.parent
|
|
123
|
-
end
|
|
124
|
-
if not (_result ~= "" and _result) then
|
|
125
|
-
local _container = render.container
|
|
126
|
-
table.insert(load, _container)
|
|
127
|
-
end
|
|
128
|
-
end
|
|
129
|
-
for _k, _v in renderGroup do
|
|
130
|
-
_callback_3(_v, _k, renderGroup)
|
|
131
|
-
end
|
|
132
|
-
-- ▲ ReadonlyMap.forEach ▲
|
|
47
|
+
-- only ROOT apps are returned
|
|
48
|
+
local _result = render.entry.rules
|
|
49
|
+
if _result ~= nil then
|
|
50
|
+
_result = _result.parent
|
|
133
51
|
end
|
|
134
|
-
|
|
135
|
-
|
|
52
|
+
if not (_result ~= "" and _result) then
|
|
53
|
+
local _container = render.container
|
|
54
|
+
table.insert(load, _container)
|
|
136
55
|
end
|
|
137
|
-
-- ▲ ReadonlyMap.forEach ▲
|
|
138
56
|
end
|
|
139
57
|
for _k, _v in toLoad do
|
|
140
|
-
|
|
58
|
+
_callback(_v, _k - 1, toLoad)
|
|
141
59
|
end
|
|
142
60
|
-- ▲ ReadonlyArray.forEach ▲
|
|
143
|
-
print(load)
|
|
144
61
|
return load
|
|
145
62
|
end
|
|
146
63
|
end
|
|
147
|
-
function Renders:
|
|
148
|
-
local groupEntries = self:getGroupEntries(group)
|
|
64
|
+
function Renders:collectEntries(renders)
|
|
149
65
|
local result = {}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
66
|
+
local _result = renders
|
|
67
|
+
if _result ~= nil then
|
|
68
|
+
_result = _result.name
|
|
69
|
+
end
|
|
70
|
+
local _result_1
|
|
71
|
+
if _result ~= nil then
|
|
72
|
+
_result_1 = {
|
|
73
|
+
[renders.name] = true,
|
|
74
|
+
}
|
|
75
|
+
else
|
|
76
|
+
local _result_2 = renders
|
|
77
|
+
if _result_2 ~= nil then
|
|
78
|
+
_result_2 = _result_2.names
|
|
156
79
|
end
|
|
157
|
-
local
|
|
158
|
-
if
|
|
159
|
-
|
|
80
|
+
local _result_3
|
|
81
|
+
if _result_2 then
|
|
82
|
+
local _set = {}
|
|
83
|
+
for _, _v in renders.names do
|
|
84
|
+
_set[_v] = true
|
|
85
|
+
end
|
|
86
|
+
_result_3 = _set
|
|
87
|
+
else
|
|
88
|
+
_result_3 = nil
|
|
160
89
|
end
|
|
90
|
+
_result_1 = _result_3
|
|
161
91
|
end
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
92
|
+
local names = _result_1
|
|
93
|
+
local _result_2 = renders
|
|
94
|
+
if _result_2 ~= nil then
|
|
95
|
+
_result_2 = _result_2.group
|
|
96
|
+
end
|
|
97
|
+
local _result_3
|
|
98
|
+
if _result_2 ~= nil then
|
|
99
|
+
_result_3 = {
|
|
100
|
+
[renders.group] = true,
|
|
101
|
+
}
|
|
102
|
+
else
|
|
103
|
+
local _result_4 = renders
|
|
104
|
+
if _result_4 ~= nil then
|
|
105
|
+
_result_4 = _result_4.groups
|
|
106
|
+
end
|
|
107
|
+
local _result_5
|
|
108
|
+
if _result_4 then
|
|
109
|
+
local _set = {}
|
|
110
|
+
for _, _v in renders.groups do
|
|
111
|
+
_set[_v] = true
|
|
112
|
+
end
|
|
113
|
+
_result_5 = _set
|
|
114
|
+
else
|
|
115
|
+
_result_5 = nil
|
|
116
|
+
end
|
|
117
|
+
_result_3 = _result_5
|
|
118
|
+
end
|
|
119
|
+
local groups = _result_3
|
|
120
|
+
-- ▼ ReadonlyMap.forEach ▼
|
|
121
|
+
local _callback = function(groupEntries, appName)
|
|
122
|
+
local _condition = names
|
|
123
|
+
if _condition then
|
|
124
|
+
local _appName = appName
|
|
125
|
+
_condition = not (names[_appName] ~= nil)
|
|
126
|
+
end
|
|
127
|
+
if _condition then
|
|
128
|
+
return nil
|
|
129
|
+
end
|
|
130
|
+
-- ▼ ReadonlyMap.forEach ▼
|
|
131
|
+
local _callback_1 = function(entry, group)
|
|
132
|
+
local _condition_1 = groups
|
|
133
|
+
if _condition_1 then
|
|
168
134
|
local _group = group
|
|
169
|
-
|
|
135
|
+
_condition_1 = not (groups[_group] ~= nil)
|
|
170
136
|
end
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
table.insert(result, entry)
|
|
137
|
+
if _condition_1 then
|
|
138
|
+
return nil
|
|
174
139
|
end
|
|
140
|
+
local _entry = entry
|
|
141
|
+
table.insert(result, _entry)
|
|
175
142
|
end
|
|
176
|
-
for _k, _v in
|
|
177
|
-
|
|
143
|
+
for _k, _v in groupEntries do
|
|
144
|
+
_callback_1(_v, _k, groupEntries)
|
|
178
145
|
end
|
|
179
|
-
-- ▲
|
|
146
|
+
-- ▲ ReadonlyMap.forEach ▲
|
|
147
|
+
end
|
|
148
|
+
for _k, _v in AppRegistry do
|
|
149
|
+
_callback(_v, _k, AppRegistry)
|
|
180
150
|
end
|
|
151
|
+
-- ▲ ReadonlyMap.forEach ▲
|
|
181
152
|
return result
|
|
182
153
|
end
|
|
183
|
-
function Renders:
|
|
184
|
-
local
|
|
154
|
+
function Renders:expandWithChildren(entries)
|
|
155
|
+
local _array = {}
|
|
156
|
+
local _length = #_array
|
|
157
|
+
table.move(entries, 1, #entries, _length + 1, _array)
|
|
158
|
+
local result = _array
|
|
159
|
+
local _set = {}
|
|
160
|
+
-- ▼ ReadonlyArray.map ▼
|
|
161
|
+
local _newValue = table.create(#entries)
|
|
162
|
+
local _callback = function(e)
|
|
163
|
+
return tostring(e.constructor)
|
|
164
|
+
end
|
|
165
|
+
for _k, _v in entries do
|
|
166
|
+
_newValue[_k] = _callback(_v, _k - 1, entries)
|
|
167
|
+
end
|
|
168
|
+
-- ▲ ReadonlyArray.map ▲
|
|
169
|
+
for _, _v in _newValue do
|
|
170
|
+
_set[_v] = true
|
|
171
|
+
end
|
|
172
|
+
local selected = _set
|
|
185
173
|
-- ▼ ReadonlyMap.forEach ▼
|
|
186
|
-
local
|
|
174
|
+
local _callback_1 = function(groupEntries)
|
|
187
175
|
-- ▼ ReadonlyMap.forEach ▼
|
|
188
|
-
local
|
|
189
|
-
|
|
190
|
-
|
|
176
|
+
local _callback_2 = function(entry)
|
|
177
|
+
local _parent = entry.rules
|
|
178
|
+
if _parent ~= nil then
|
|
179
|
+
_parent = _parent.parent
|
|
180
|
+
end
|
|
181
|
+
local parent = _parent
|
|
182
|
+
local _condition = parent
|
|
183
|
+
if _condition ~= "" and _condition then
|
|
184
|
+
_condition = selected[parent] ~= nil
|
|
185
|
+
end
|
|
186
|
+
if _condition ~= "" and _condition then
|
|
187
|
+
local _entry = entry
|
|
188
|
+
table.insert(result, _entry)
|
|
191
189
|
end
|
|
192
|
-
local _entries = entries
|
|
193
|
-
local _name = name
|
|
194
|
-
local _regGroupEntries = regGroupEntries
|
|
195
|
-
_entries[_name] = _regGroupEntries
|
|
196
190
|
end
|
|
197
|
-
for _k, _v in
|
|
198
|
-
|
|
191
|
+
for _k, _v in groupEntries do
|
|
192
|
+
_callback_2(_v, _k, groupEntries)
|
|
199
193
|
end
|
|
200
194
|
-- ▲ ReadonlyMap.forEach ▲
|
|
201
195
|
end
|
|
202
196
|
for _k, _v in AppRegistry do
|
|
203
|
-
|
|
197
|
+
_callback_1(_v, _k, AppRegistry)
|
|
204
198
|
end
|
|
205
199
|
-- ▲ ReadonlyMap.forEach ▲
|
|
206
|
-
return
|
|
200
|
+
return result
|
|
207
201
|
end
|
|
208
202
|
function Renders:createInstance(props, name, group)
|
|
209
203
|
local entry = getAppEntry(name, group)
|
|
@@ -245,16 +239,17 @@ do
|
|
|
245
239
|
Parent = parentContainer,
|
|
246
240
|
}, instance))
|
|
247
241
|
local newMap = {}
|
|
248
|
-
local
|
|
249
|
-
local _arg1 = {
|
|
242
|
+
local render = {
|
|
250
243
|
container = container,
|
|
251
244
|
instance = instance,
|
|
252
245
|
entry = entry,
|
|
253
246
|
}
|
|
254
|
-
|
|
247
|
+
local _group = group
|
|
248
|
+
newMap[_group] = render
|
|
255
249
|
local _loaded = self.Loaded
|
|
256
250
|
local _name = name
|
|
257
251
|
_loaded[_name] = newMap
|
|
252
|
+
return render
|
|
258
253
|
end
|
|
259
254
|
function Renders:initalize(props, target, root)
|
|
260
255
|
local _attributes = table.clone(props)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type AppForge from "../../
|
|
1
|
+
import type AppForge from "../../forge";
|
|
2
2
|
export default function ExclusiveGroupRule(forge: AppForge, name: AppNames, group: AppGroups): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type AppForge from "../../
|
|
1
|
+
import type AppForge from "../../forge";
|
|
2
2
|
export default function ParentRule(forge: AppForge, name: AppNames, group: AppGroups): void;
|
package/out/types.d.ts
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
// Types
|
|
2
2
|
import type { Args } from "./appRegistry";
|
|
3
|
-
import type AppForge from "./
|
|
3
|
+
import type AppForge from "./forge";
|
|
4
4
|
|
|
5
5
|
declare namespace Types {
|
|
6
6
|
namespace Props {
|
|
7
|
-
type NameSelector =
|
|
7
|
+
type NameSelector =
|
|
8
|
+
| { name: AppNames; names?: never }
|
|
9
|
+
| { names: AppNames[]; name?: never }
|
|
10
|
+
| { name?: undefined; names?: undefined };
|
|
11
|
+
|
|
8
12
|
type GroupSelector =
|
|
9
13
|
| { group: AppGroups; groups?: never }
|
|
10
|
-
| { groups: AppGroups[]; group?: never }
|
|
14
|
+
| { groups: AppGroups[]; group?: never }
|
|
15
|
+
| { group?: undefined; groups?: undefined };
|
|
11
16
|
|
|
12
17
|
export type Render = NameSelector & GroupSelector;
|
|
13
18
|
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|