@rbxts/app-forge 0.7.2-prototype.33 → 0.7.2-prototype.35
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 +138 -142
- 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,170 @@ 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
|
-
_callback(_v, _k - 1, toLoad)
|
|
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
|
+
local _result = render.entry.rules
|
|
48
|
+
if _result ~= nil then
|
|
49
|
+
_result = _result.parent
|
|
133
50
|
end
|
|
134
|
-
|
|
135
|
-
|
|
51
|
+
if not (_result ~= "" and _result) then
|
|
52
|
+
local _container = render.container
|
|
53
|
+
table.insert(load, _container)
|
|
136
54
|
end
|
|
137
|
-
-- ▲ ReadonlyMap.forEach ▲
|
|
138
55
|
end
|
|
139
56
|
for _k, _v in toLoad do
|
|
140
|
-
|
|
57
|
+
_callback(_v, _k - 1, toLoad)
|
|
141
58
|
end
|
|
142
59
|
-- ▲ ReadonlyArray.forEach ▲
|
|
143
|
-
print(load)
|
|
144
60
|
return load
|
|
145
61
|
end
|
|
146
62
|
end
|
|
147
|
-
function Renders:
|
|
148
|
-
local groupEntries = self:getGroupEntries(group)
|
|
63
|
+
function Renders:collectEntries(renders)
|
|
149
64
|
local result = {}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
65
|
+
local _result = renders
|
|
66
|
+
if _result ~= nil then
|
|
67
|
+
_result = _result.name
|
|
68
|
+
end
|
|
69
|
+
local _result_1
|
|
70
|
+
if _result ~= nil then
|
|
71
|
+
_result_1 = {
|
|
72
|
+
[renders.name] = true,
|
|
73
|
+
}
|
|
74
|
+
else
|
|
75
|
+
local _result_2 = renders
|
|
76
|
+
if _result_2 ~= nil then
|
|
77
|
+
_result_2 = _result_2.names
|
|
156
78
|
end
|
|
157
|
-
local
|
|
158
|
-
if
|
|
159
|
-
|
|
79
|
+
local _result_3
|
|
80
|
+
if _result_2 then
|
|
81
|
+
local _set = {}
|
|
82
|
+
for _, _v in renders.names do
|
|
83
|
+
_set[_v] = true
|
|
84
|
+
end
|
|
85
|
+
_result_3 = _set
|
|
86
|
+
else
|
|
87
|
+
_result_3 = nil
|
|
160
88
|
end
|
|
89
|
+
_result_1 = _result_3
|
|
161
90
|
end
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
91
|
+
local names = _result_1
|
|
92
|
+
local _result_2 = renders
|
|
93
|
+
if _result_2 ~= nil then
|
|
94
|
+
_result_2 = _result_2.group
|
|
95
|
+
end
|
|
96
|
+
local _result_3
|
|
97
|
+
if _result_2 ~= nil then
|
|
98
|
+
_result_3 = {
|
|
99
|
+
[renders.group] = true,
|
|
100
|
+
}
|
|
101
|
+
else
|
|
102
|
+
local _result_4 = renders
|
|
103
|
+
if _result_4 ~= nil then
|
|
104
|
+
_result_4 = _result_4.groups
|
|
105
|
+
end
|
|
106
|
+
local _result_5
|
|
107
|
+
if _result_4 then
|
|
108
|
+
local _set = {}
|
|
109
|
+
for _, _v in renders.groups do
|
|
110
|
+
_set[_v] = true
|
|
111
|
+
end
|
|
112
|
+
_result_5 = _set
|
|
113
|
+
else
|
|
114
|
+
_result_5 = nil
|
|
115
|
+
end
|
|
116
|
+
_result_3 = _result_5
|
|
117
|
+
end
|
|
118
|
+
local groups = _result_3
|
|
119
|
+
-- ▼ ReadonlyMap.forEach ▼
|
|
120
|
+
local _callback = function(groupEntries, appName)
|
|
121
|
+
local _condition = names
|
|
122
|
+
if _condition then
|
|
123
|
+
local _appName = appName
|
|
124
|
+
_condition = not (names[_appName] ~= nil)
|
|
125
|
+
end
|
|
126
|
+
if _condition then
|
|
127
|
+
return nil
|
|
128
|
+
end
|
|
129
|
+
-- ▼ ReadonlyMap.forEach ▼
|
|
130
|
+
local _callback_1 = function(entry, group)
|
|
131
|
+
local _condition_1 = groups
|
|
132
|
+
if _condition_1 then
|
|
168
133
|
local _group = group
|
|
169
|
-
|
|
134
|
+
_condition_1 = not (groups[_group] ~= nil)
|
|
170
135
|
end
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
table.insert(result, entry)
|
|
136
|
+
if _condition_1 then
|
|
137
|
+
return nil
|
|
174
138
|
end
|
|
139
|
+
local _entry = entry
|
|
140
|
+
table.insert(result, _entry)
|
|
175
141
|
end
|
|
176
|
-
for _k, _v in
|
|
177
|
-
|
|
142
|
+
for _k, _v in groupEntries do
|
|
143
|
+
_callback_1(_v, _k, groupEntries)
|
|
178
144
|
end
|
|
179
|
-
-- ▲
|
|
145
|
+
-- ▲ ReadonlyMap.forEach ▲
|
|
146
|
+
end
|
|
147
|
+
for _k, _v in AppRegistry do
|
|
148
|
+
_callback(_v, _k, AppRegistry)
|
|
180
149
|
end
|
|
150
|
+
-- ▲ ReadonlyMap.forEach ▲
|
|
181
151
|
return result
|
|
182
152
|
end
|
|
183
|
-
function Renders:
|
|
184
|
-
local
|
|
153
|
+
function Renders:expandWithChildren(entries)
|
|
154
|
+
local _array = {}
|
|
155
|
+
local _length = #_array
|
|
156
|
+
table.move(entries, 1, #entries, _length + 1, _array)
|
|
157
|
+
local result = _array
|
|
158
|
+
local _set = {}
|
|
159
|
+
-- ▼ ReadonlyArray.map ▼
|
|
160
|
+
local _newValue = table.create(#entries)
|
|
161
|
+
local _callback = function(e)
|
|
162
|
+
return tostring(e.constructor)
|
|
163
|
+
end
|
|
164
|
+
for _k, _v in entries do
|
|
165
|
+
_newValue[_k] = _callback(_v, _k - 1, entries)
|
|
166
|
+
end
|
|
167
|
+
-- ▲ ReadonlyArray.map ▲
|
|
168
|
+
for _, _v in _newValue do
|
|
169
|
+
_set[_v] = true
|
|
170
|
+
end
|
|
171
|
+
local selected = _set
|
|
185
172
|
-- ▼ ReadonlyMap.forEach ▼
|
|
186
|
-
local
|
|
173
|
+
local _callback_1 = function(groupEntries)
|
|
187
174
|
-- ▼ ReadonlyMap.forEach ▼
|
|
188
|
-
local
|
|
189
|
-
|
|
190
|
-
|
|
175
|
+
local _callback_2 = function(entry)
|
|
176
|
+
local _parent = entry.rules
|
|
177
|
+
if _parent ~= nil then
|
|
178
|
+
_parent = _parent.parent
|
|
179
|
+
end
|
|
180
|
+
local parent = _parent
|
|
181
|
+
local _condition = parent
|
|
182
|
+
if _condition ~= "" and _condition then
|
|
183
|
+
_condition = selected[parent] ~= nil
|
|
184
|
+
end
|
|
185
|
+
if _condition ~= "" and _condition then
|
|
186
|
+
local _entry = entry
|
|
187
|
+
table.insert(result, _entry)
|
|
191
188
|
end
|
|
192
|
-
local _entries = entries
|
|
193
|
-
local _name = name
|
|
194
|
-
local _regGroupEntries = regGroupEntries
|
|
195
|
-
_entries[_name] = _regGroupEntries
|
|
196
189
|
end
|
|
197
|
-
for _k, _v in
|
|
198
|
-
|
|
190
|
+
for _k, _v in groupEntries do
|
|
191
|
+
_callback_2(_v, _k, groupEntries)
|
|
199
192
|
end
|
|
200
193
|
-- ▲ ReadonlyMap.forEach ▲
|
|
201
194
|
end
|
|
202
195
|
for _k, _v in AppRegistry do
|
|
203
|
-
|
|
196
|
+
_callback_1(_v, _k, AppRegistry)
|
|
204
197
|
end
|
|
205
198
|
-- ▲ ReadonlyMap.forEach ▲
|
|
206
|
-
return
|
|
199
|
+
return result
|
|
207
200
|
end
|
|
208
201
|
function Renders:createInstance(props, name, group)
|
|
209
202
|
local entry = getAppEntry(name, group)
|
|
@@ -245,21 +238,19 @@ do
|
|
|
245
238
|
Parent = parentContainer,
|
|
246
239
|
}, instance))
|
|
247
240
|
local newMap = {}
|
|
248
|
-
local
|
|
249
|
-
local _arg1 = {
|
|
241
|
+
local render = {
|
|
250
242
|
container = container,
|
|
251
243
|
instance = instance,
|
|
252
244
|
entry = entry,
|
|
253
245
|
}
|
|
254
|
-
|
|
246
|
+
local _group = group
|
|
247
|
+
newMap[_group] = render
|
|
255
248
|
local _loaded = self.Loaded
|
|
256
249
|
local _name = name
|
|
257
250
|
_loaded[_name] = newMap
|
|
251
|
+
return render
|
|
258
252
|
end
|
|
259
253
|
function Renders:initalize(props, target, root)
|
|
260
|
-
local _attributes = table.clone(props)
|
|
261
|
-
setmetatable(_attributes, nil)
|
|
262
|
-
local renders = Vide.jsx(self.Load, _attributes)
|
|
263
254
|
if target then
|
|
264
255
|
mount(function()
|
|
265
256
|
if not self.__px then
|
|
@@ -278,6 +269,9 @@ do
|
|
|
278
269
|
usePx(_result, _result_1, _result_2)
|
|
279
270
|
self.__px = true
|
|
280
271
|
end
|
|
272
|
+
local _attributes = table.clone(props)
|
|
273
|
+
setmetatable(_attributes, nil)
|
|
274
|
+
local renders = Vide.jsx(self.Load, _attributes)
|
|
281
275
|
if root then
|
|
282
276
|
root.Name = "App Tree"
|
|
283
277
|
apply(root)({
|
|
@@ -308,7 +302,9 @@ do
|
|
|
308
302
|
usePx(_result, _result_1, _result_2)
|
|
309
303
|
self.__px = true
|
|
310
304
|
end
|
|
311
|
-
|
|
305
|
+
local _attributes = table.clone(props)
|
|
306
|
+
setmetatable(_attributes, nil)
|
|
307
|
+
return Vide.jsx(self.Load, _attributes)
|
|
312
308
|
end
|
|
313
309
|
end
|
|
314
310
|
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
|