@rbxts/app-forge 0.7.2-prototype.32 → 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 +148 -157
- 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
|
@@ -3,6 +3,7 @@ local TS = _G[script]
|
|
|
3
3
|
-- Packages
|
|
4
4
|
local _vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
|
|
5
5
|
local Vide = _vide
|
|
6
|
+
local apply = _vide.apply
|
|
6
7
|
local mount = _vide.mount
|
|
7
8
|
-- Types
|
|
8
9
|
-- Components
|
|
@@ -32,177 +33,171 @@ do
|
|
|
32
33
|
self.__px = false
|
|
33
34
|
self.Loaded = {}
|
|
34
35
|
self.Load = function(props)
|
|
35
|
-
local
|
|
36
|
-
local
|
|
37
|
-
local
|
|
38
|
-
if not renders then
|
|
39
|
-
return {}
|
|
40
|
-
end
|
|
41
|
-
if renders.groups then
|
|
42
|
-
local _exp = renders.groups
|
|
43
|
-
-- ▼ ReadonlyArray.forEach ▼
|
|
44
|
-
local _callback = function(group)
|
|
45
|
-
local entries = self:resolveGroupEntries(group, renders.names, renders.name)
|
|
46
|
-
for _, entry in entries do
|
|
47
|
-
table.insert(toLoad, entry)
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
for _k, _v in _exp do
|
|
51
|
-
_callback(_v, _k - 1, _exp)
|
|
52
|
-
end
|
|
53
|
-
-- ▲ ReadonlyArray.forEach ▲
|
|
54
|
-
end
|
|
55
|
-
local _value = renders.group
|
|
56
|
-
if _value ~= "" and _value then
|
|
57
|
-
local entries = self:resolveGroupEntries(renders.group, renders.names, renders.name)
|
|
58
|
-
for _, entry in entries do
|
|
59
|
-
table.insert(toLoad, entry)
|
|
60
|
-
end
|
|
61
|
-
end
|
|
36
|
+
local baseEntries = self:collectEntries(props.renders)
|
|
37
|
+
local toLoad = self:expandWithChildren(baseEntries)
|
|
38
|
+
local load = {}
|
|
62
39
|
-- ▼ ReadonlyArray.forEach ▼
|
|
63
40
|
local _callback = function(entry)
|
|
64
41
|
local name = tostring(entry.constructor)
|
|
65
42
|
local group = entry.group
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
local _callback_2 = function(childEntry)
|
|
70
|
-
local _result = childEntry.rules
|
|
71
|
-
if _result ~= nil then
|
|
72
|
-
_result = _result.parent
|
|
73
|
-
end
|
|
74
|
-
local _condition = _result ~= name
|
|
75
|
-
if not _condition then
|
|
76
|
-
local _result_1 = childEntry.rules
|
|
77
|
-
if _result_1 ~= nil then
|
|
78
|
-
_result_1 = _result_1.parentGroup
|
|
79
|
-
end
|
|
80
|
-
_condition = _result_1 ~= group
|
|
81
|
-
end
|
|
82
|
-
if _condition then
|
|
83
|
-
return nil
|
|
84
|
-
end
|
|
85
|
-
local _childEntry = childEntry
|
|
86
|
-
table.insert(toLoad, _childEntry)
|
|
87
|
-
end
|
|
88
|
-
for _k, _v in groupEntries do
|
|
89
|
-
_callback_2(_v, _k, groupEntries)
|
|
90
|
-
end
|
|
91
|
-
-- ▲ ReadonlyMap.forEach ▲
|
|
92
|
-
end
|
|
93
|
-
for _k, _v in AppRegistry do
|
|
94
|
-
_callback_1(_v, _k, AppRegistry)
|
|
43
|
+
local render = self:createInstance(props, name, group)
|
|
44
|
+
if not render then
|
|
45
|
+
return nil
|
|
95
46
|
end
|
|
96
|
-
--
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
end
|
|
101
|
-
-- ▲ ReadonlyArray.forEach ▲
|
|
102
|
-
local load = {}
|
|
103
|
-
-- ▼ ReadonlyArray.forEach ▼
|
|
104
|
-
local _callback_1 = function(entry)
|
|
105
|
-
local name = tostring(entry.constructor)
|
|
106
|
-
local group = entry.group
|
|
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
|
|
113
|
-
end
|
|
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
|
-
end
|
|
127
|
-
end
|
|
128
|
-
for _k, _v in renderGroup do
|
|
129
|
-
_callback_3(_v, _k, renderGroup)
|
|
130
|
-
end
|
|
131
|
-
-- ▲ ReadonlyMap.forEach ▲
|
|
47
|
+
-- only ROOT apps are returned
|
|
48
|
+
local _result = render.entry.rules
|
|
49
|
+
if _result ~= nil then
|
|
50
|
+
_result = _result.parent
|
|
132
51
|
end
|
|
133
|
-
|
|
134
|
-
|
|
52
|
+
if not (_result ~= "" and _result) then
|
|
53
|
+
local _container = render.container
|
|
54
|
+
table.insert(load, _container)
|
|
135
55
|
end
|
|
136
|
-
-- ▲ ReadonlyMap.forEach ▲
|
|
137
56
|
end
|
|
138
57
|
for _k, _v in toLoad do
|
|
139
|
-
|
|
58
|
+
_callback(_v, _k - 1, toLoad)
|
|
140
59
|
end
|
|
141
60
|
-- ▲ ReadonlyArray.forEach ▲
|
|
142
|
-
print(load)
|
|
143
61
|
return load
|
|
144
62
|
end
|
|
145
63
|
end
|
|
146
|
-
function Renders:
|
|
147
|
-
local groupEntries = self:getGroupEntries(group)
|
|
64
|
+
function Renders:collectEntries(renders)
|
|
148
65
|
local result = {}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
|
155
79
|
end
|
|
156
|
-
local
|
|
157
|
-
if
|
|
158
|
-
|
|
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
|
|
159
89
|
end
|
|
90
|
+
_result_1 = _result_3
|
|
160
91
|
end
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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
|
|
167
134
|
local _group = group
|
|
168
|
-
|
|
135
|
+
_condition_1 = not (groups[_group] ~= nil)
|
|
169
136
|
end
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
table.insert(result, entry)
|
|
137
|
+
if _condition_1 then
|
|
138
|
+
return nil
|
|
173
139
|
end
|
|
140
|
+
local _entry = entry
|
|
141
|
+
table.insert(result, _entry)
|
|
174
142
|
end
|
|
175
|
-
for _k, _v in
|
|
176
|
-
|
|
143
|
+
for _k, _v in groupEntries do
|
|
144
|
+
_callback_1(_v, _k, groupEntries)
|
|
177
145
|
end
|
|
178
|
-
-- ▲
|
|
146
|
+
-- ▲ ReadonlyMap.forEach ▲
|
|
179
147
|
end
|
|
148
|
+
for _k, _v in AppRegistry do
|
|
149
|
+
_callback(_v, _k, AppRegistry)
|
|
150
|
+
end
|
|
151
|
+
-- ▲ ReadonlyMap.forEach ▲
|
|
180
152
|
return result
|
|
181
153
|
end
|
|
182
|
-
function Renders:
|
|
183
|
-
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
|
|
184
173
|
-- ▼ ReadonlyMap.forEach ▼
|
|
185
|
-
local
|
|
174
|
+
local _callback_1 = function(groupEntries)
|
|
186
175
|
-- ▼ ReadonlyMap.forEach ▼
|
|
187
|
-
local
|
|
188
|
-
|
|
189
|
-
|
|
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)
|
|
190
189
|
end
|
|
191
|
-
local _entries = entries
|
|
192
|
-
local _name = name
|
|
193
|
-
local _regGroupEntries = regGroupEntries
|
|
194
|
-
_entries[_name] = _regGroupEntries
|
|
195
190
|
end
|
|
196
|
-
for _k, _v in
|
|
197
|
-
|
|
191
|
+
for _k, _v in groupEntries do
|
|
192
|
+
_callback_2(_v, _k, groupEntries)
|
|
198
193
|
end
|
|
199
194
|
-- ▲ ReadonlyMap.forEach ▲
|
|
200
195
|
end
|
|
201
196
|
for _k, _v in AppRegistry do
|
|
202
|
-
|
|
197
|
+
_callback_1(_v, _k, AppRegistry)
|
|
203
198
|
end
|
|
204
199
|
-- ▲ ReadonlyMap.forEach ▲
|
|
205
|
-
return
|
|
200
|
+
return result
|
|
206
201
|
end
|
|
207
202
|
function Renders:createInstance(props, name, group)
|
|
208
203
|
local entry = getAppEntry(name, group)
|
|
@@ -244,22 +239,23 @@ do
|
|
|
244
239
|
Parent = parentContainer,
|
|
245
240
|
}, instance))
|
|
246
241
|
local newMap = {}
|
|
247
|
-
local
|
|
248
|
-
local _arg1 = {
|
|
242
|
+
local render = {
|
|
249
243
|
container = container,
|
|
250
244
|
instance = instance,
|
|
251
245
|
entry = entry,
|
|
252
246
|
}
|
|
253
|
-
|
|
247
|
+
local _group = group
|
|
248
|
+
newMap[_group] = render
|
|
254
249
|
local _loaded = self.Loaded
|
|
255
250
|
local _name = name
|
|
256
251
|
_loaded[_name] = newMap
|
|
252
|
+
return render
|
|
257
253
|
end
|
|
258
254
|
function Renders:initalize(props, target, root)
|
|
255
|
+
local _attributes = table.clone(props)
|
|
256
|
+
setmetatable(_attributes, nil)
|
|
257
|
+
local renders = Vide.jsx(self.Load, _attributes)
|
|
259
258
|
if target then
|
|
260
|
-
local Root = function()
|
|
261
|
-
return root
|
|
262
|
-
end
|
|
263
259
|
mount(function()
|
|
264
260
|
if not self.__px then
|
|
265
261
|
local _result = props.config
|
|
@@ -277,21 +273,18 @@ do
|
|
|
277
273
|
usePx(_result, _result_1, _result_2)
|
|
278
274
|
self.__px = true
|
|
279
275
|
end
|
|
280
|
-
local _result
|
|
281
276
|
if root then
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
setmetatable(_attributes, nil)
|
|
288
|
-
_result = (Vide.jsx("screengui", {
|
|
289
|
-
Name = "App Tree",
|
|
290
|
-
ZIndexBehavior = "Sibling",
|
|
291
|
-
ResetOnSpawn = false,
|
|
292
|
-
}, Vide.jsx(self.Load, _attributes)))
|
|
277
|
+
root.Name = "App Tree"
|
|
278
|
+
apply(root)({
|
|
279
|
+
[0] = renders,
|
|
280
|
+
})
|
|
281
|
+
return root
|
|
293
282
|
end
|
|
294
|
-
return
|
|
283
|
+
return Vide.jsx("screengui", {
|
|
284
|
+
Name = "App Tree",
|
|
285
|
+
ZIndexBehavior = "Sibling",
|
|
286
|
+
ResetOnSpawn = false,
|
|
287
|
+
}, renders)
|
|
295
288
|
end, target)
|
|
296
289
|
else
|
|
297
290
|
if not self.__px then
|
|
@@ -310,9 +303,7 @@ do
|
|
|
310
303
|
usePx(_result, _result_1, _result_2)
|
|
311
304
|
self.__px = true
|
|
312
305
|
end
|
|
313
|
-
|
|
314
|
-
setmetatable(_attributes, nil)
|
|
315
|
-
return Vide.jsx(self.Load, _attributes)
|
|
306
|
+
return renders
|
|
316
307
|
end
|
|
317
308
|
end
|
|
318
309
|
end
|
|
@@ -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
|