@rbxts/app-forge 0.7.2-prototype.1 → 0.7.2-prototype.11
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 +7 -5
- package/out/appRegistry.luau +39 -26
- package/out/helpers/bindAppSource.d.ts +2 -0
- package/out/helpers/bindAppSource.luau +22 -0
- package/out/helpers/getAppEntry.d.ts +2 -0
- package/out/helpers/getAppEntry.luau +22 -0
- package/out/helpers/getAppSource.d.ts +2 -0
- package/out/helpers/getAppSource.luau +25 -0
- package/out/helpers/hasAppSource.d.ts +1 -0
- package/out/helpers/hasAppSource.luau +24 -0
- package/out/helpers/setAppSource.d.ts +1 -0
- package/out/helpers/setAppSource.luau +34 -0
- package/out/mount.d.ts +12 -24
- package/out/mount.luau +80 -155
- package/out/renders.d.ts +9 -0
- package/out/renders.luau +76 -0
- package/out/ruleEngine/check/exclusiveGroup.d.ts +2 -0
- package/out/ruleEngine/check/exclusiveGroup.luau +54 -0
- package/out/ruleEngine/check/parent.d.ts +2 -0
- package/out/ruleEngine/check/parent.luau +38 -0
- package/out/ruleEngine/index.d.ts +2 -2
- package/out/ruleEngine/init.luau +20 -15
- package/out/ruleEngine/render/anchor.d.ts +2 -0
- package/out/ruleEngine/render/anchor.luau +11 -0
- package/out/types.d.ts +12 -8
- package/package.json +1 -1
- package/out/renderManager.d.ts +0 -32
- package/out/renderManager.luau +0 -326
- package/out/ruleEngine/exclusiveGroup.d.ts +0 -2
- package/out/ruleEngine/exclusiveGroup.luau +0 -54
- package/out/ruleEngine/parent.d.ts +0 -2
- package/out/ruleEngine/parent.luau +0 -34
package/out/appRegistry.d.ts
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import Vide from "@rbxts/vide";
|
|
2
2
|
import type Types from "./types";
|
|
3
3
|
import type AppForge from "./mount";
|
|
4
|
-
export declare const AppRegistry: Map<string, Types.AppRegistry.Static
|
|
4
|
+
export declare const AppRegistry: Map<string, Map<string, Types.AppRegistry.Static>>;
|
|
5
|
+
export declare const AppSources: Map<string, Map<string, Vide.Source<boolean>>>;
|
|
5
6
|
/**
|
|
6
7
|
* Registers a Vide App with AppForge.
|
|
7
8
|
*
|
|
8
9
|
* This runs at definition time and validates static configuration.
|
|
9
10
|
*/
|
|
10
|
-
export declare function App<N extends AppNames>(props: Types.AppRegistry.Props<N>): <T extends new (props: Types.Props.Main, name: AppNames) => Args>(constructor: T) => T;
|
|
11
|
+
export declare function App<N extends AppNames>(props: Types.AppRegistry.Props<N>): <T extends new (props: Types.Props.Main, name: AppNames, group?: AppGroups) => Args>(constructor: T) => T;
|
|
11
12
|
/**
|
|
12
13
|
* Base class for all AppForge Apps.
|
|
13
14
|
*/
|
|
14
15
|
export declare abstract class Args {
|
|
15
|
-
readonly
|
|
16
|
+
readonly source: Vide.Source<boolean>;
|
|
16
17
|
readonly props: Types.Props.Class;
|
|
18
|
+
readonly forge: AppForge;
|
|
19
|
+
readonly group: AppGroups;
|
|
17
20
|
readonly name: AppNames;
|
|
18
|
-
|
|
19
|
-
constructor(props: Types.Props.Main, name: AppNames);
|
|
21
|
+
constructor(props: Types.Props.Main, name: AppNames, group?: AppGroups);
|
|
20
22
|
abstract render(): Vide.Node;
|
|
21
23
|
}
|
package/out/appRegistry.luau
CHANGED
|
@@ -4,10 +4,8 @@ local TS = _G[script]
|
|
|
4
4
|
-- Types
|
|
5
5
|
-- Hooks
|
|
6
6
|
local px = TS.import(script, script.Parent, "hooks", "usePx").px
|
|
7
|
-
-- Debug
|
|
8
|
-
local Logger = TS.import(script, script.Parent, "logger").default
|
|
9
|
-
local logger = Logger.new("AppRegistry")
|
|
10
7
|
local AppRegistry = {}
|
|
8
|
+
local AppSources = {}
|
|
11
9
|
--[[
|
|
12
10
|
*
|
|
13
11
|
* Registers a Vide App with AppForge.
|
|
@@ -18,25 +16,41 @@ local AppRegistry = {}
|
|
|
18
16
|
local function App(props)
|
|
19
17
|
return function(constructor)
|
|
20
18
|
local _name = props.name
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
local _result = AppRegistry[_name]
|
|
20
|
+
if _result ~= nil then
|
|
21
|
+
local _condition = props.group
|
|
22
|
+
if not (_condition ~= "" and _condition) then
|
|
23
|
+
_condition = "None"
|
|
24
|
+
end
|
|
25
|
+
_result = _result[_condition] ~= nil
|
|
26
|
+
end
|
|
27
|
+
if _result then
|
|
28
|
+
error(`Duplicate registered App name "{props.name} in same Group name {props.group}". ` .. `App names must be globally unique.`, 2)
|
|
26
29
|
end
|
|
27
30
|
local _value = props.name
|
|
28
31
|
if not (_value ~= "" and _value) then
|
|
29
|
-
logger:log("ERROR", "Attempted to register App without a name", props)
|
|
30
32
|
error("App registration failed: missing app name", 2)
|
|
31
33
|
end
|
|
32
34
|
local _name_1 = props.name
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
if not AppRegistry[_name_1] then
|
|
36
|
+
local _name_2 = props.name
|
|
37
|
+
AppRegistry[_name_2] = {}
|
|
38
|
+
end
|
|
39
|
+
local _name_2 = props.name
|
|
40
|
+
local _result_1 = AppRegistry[_name_2]
|
|
41
|
+
if _result_1 ~= nil then
|
|
42
|
+
local _condition = props.group
|
|
43
|
+
if not (_condition ~= "" and _condition) then
|
|
44
|
+
_condition = "None"
|
|
45
|
+
end
|
|
46
|
+
local _arg1 = {
|
|
47
|
+
constructor = constructor,
|
|
48
|
+
renderGroup = props.group,
|
|
49
|
+
visible = props.visible,
|
|
50
|
+
rules = props.rules,
|
|
51
|
+
}
|
|
52
|
+
_result_1[_condition] = _arg1
|
|
53
|
+
end
|
|
40
54
|
return constructor
|
|
41
55
|
end
|
|
42
56
|
end
|
|
@@ -48,28 +62,27 @@ end
|
|
|
48
62
|
local Args
|
|
49
63
|
do
|
|
50
64
|
Args = {}
|
|
51
|
-
function Args:constructor(props, name)
|
|
65
|
+
function Args:constructor(props, name, group)
|
|
52
66
|
local _binding = props
|
|
53
67
|
local forge = _binding.forge
|
|
54
68
|
self.forge = forge
|
|
69
|
+
local _condition = group
|
|
70
|
+
if not (_condition ~= "" and _condition) then
|
|
71
|
+
_condition = "None"
|
|
72
|
+
end
|
|
73
|
+
self.group = _condition
|
|
55
74
|
self.name = name
|
|
56
75
|
local _object = table.clone(props.props)
|
|
57
76
|
setmetatable(_object, nil)
|
|
58
|
-
_object.px = px
|
|
59
77
|
_object.forge = forge
|
|
78
|
+
_object.px = px
|
|
60
79
|
self.props = _object
|
|
61
|
-
|
|
62
|
-
if not src then
|
|
63
|
-
logger:log("ERROR", "Missing visibility source for App", {
|
|
64
|
-
name = name,
|
|
65
|
-
})
|
|
66
|
-
error(`Failed to retrieve visibility source for app "{name}"`, 2)
|
|
67
|
-
end
|
|
68
|
-
self.source = src
|
|
80
|
+
self.source = forge:getSource(name, group)
|
|
69
81
|
end
|
|
70
82
|
end
|
|
71
83
|
return {
|
|
72
84
|
App = App,
|
|
73
85
|
AppRegistry = AppRegistry,
|
|
86
|
+
AppSources = AppSources,
|
|
74
87
|
Args = Args,
|
|
75
88
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
-- Packages
|
|
4
|
+
-- Components
|
|
5
|
+
local AppSources = TS.import(script, script.Parent.Parent, "appRegistry").AppSources
|
|
6
|
+
local function bindAppSource(name, group, value)
|
|
7
|
+
local _name = name
|
|
8
|
+
if not AppSources[_name] then
|
|
9
|
+
local _name_1 = name
|
|
10
|
+
AppSources[_name_1] = {}
|
|
11
|
+
end
|
|
12
|
+
local _name_1 = name
|
|
13
|
+
local _result = AppSources[_name_1]
|
|
14
|
+
if _result ~= nil then
|
|
15
|
+
local _group = group
|
|
16
|
+
local _value = value
|
|
17
|
+
_result[_group] = _value
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
return {
|
|
21
|
+
default = bindAppSource,
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
-- Types
|
|
4
|
+
-- Components
|
|
5
|
+
local AppRegistry = TS.import(script, script.Parent.Parent, "appRegistry").AppRegistry
|
|
6
|
+
local function getAppEntry(forge, name, group)
|
|
7
|
+
local _name = name
|
|
8
|
+
local entryMap = AppRegistry[_name]
|
|
9
|
+
local _entry = entryMap
|
|
10
|
+
if _entry ~= nil then
|
|
11
|
+
local _group = group
|
|
12
|
+
_entry = _entry[_group]
|
|
13
|
+
end
|
|
14
|
+
local entry = _entry
|
|
15
|
+
if not entry then
|
|
16
|
+
forge.logger:log("WARN", `Failed to get entry for name {name} and group {group}`)
|
|
17
|
+
end
|
|
18
|
+
return entry
|
|
19
|
+
end
|
|
20
|
+
return {
|
|
21
|
+
default = getAppEntry,
|
|
22
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
-- Types
|
|
4
|
+
-- Components
|
|
5
|
+
local AppSources = TS.import(script, script.Parent.Parent, "appRegistry").AppSources
|
|
6
|
+
local function getAppSource(forge, name, group)
|
|
7
|
+
local _name = name
|
|
8
|
+
local sourceMap = AppSources[_name]
|
|
9
|
+
if not sourceMap then
|
|
10
|
+
forge.logger:log("WARN", `Failed to get source map for name {name} and group {group}`)
|
|
11
|
+
end
|
|
12
|
+
local _source = sourceMap
|
|
13
|
+
if _source ~= nil then
|
|
14
|
+
local _group = group
|
|
15
|
+
_source = _source[_group]
|
|
16
|
+
end
|
|
17
|
+
local source = _source
|
|
18
|
+
if not source then
|
|
19
|
+
forge.logger:log("WARN", `Failed to get source for name {name} and group {group}`)
|
|
20
|
+
end
|
|
21
|
+
return source
|
|
22
|
+
end
|
|
23
|
+
return {
|
|
24
|
+
default = getAppSource,
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function hasAppSource(name: AppNames, group: AppGroups): boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
-- Components
|
|
4
|
+
local AppSources = TS.import(script, script.Parent.Parent, "appRegistry").AppSources
|
|
5
|
+
local function hasAppSource(name, group)
|
|
6
|
+
local _name = name
|
|
7
|
+
local sourceMap = AppSources[_name]
|
|
8
|
+
if not sourceMap then
|
|
9
|
+
local _ = false
|
|
10
|
+
end
|
|
11
|
+
local _source = sourceMap
|
|
12
|
+
if _source ~= nil then
|
|
13
|
+
local _group = group
|
|
14
|
+
_source = _source[_group]
|
|
15
|
+
end
|
|
16
|
+
local source = _source
|
|
17
|
+
if not source then
|
|
18
|
+
local _ = false
|
|
19
|
+
end
|
|
20
|
+
return true
|
|
21
|
+
end
|
|
22
|
+
return {
|
|
23
|
+
default = hasAppSource,
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function setAppSource(name: AppNames, group: AppGroups, value: boolean): void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
-- Packages
|
|
4
|
+
local source = TS.import(script, TS.getModule(script, "@rbxts", "vide").src).source
|
|
5
|
+
-- Components
|
|
6
|
+
local AppSources = TS.import(script, script.Parent.Parent, "appRegistry").AppSources
|
|
7
|
+
local function setAppSource(name, group, value)
|
|
8
|
+
local _name = name
|
|
9
|
+
if not AppSources[_name] then
|
|
10
|
+
local _name_1 = name
|
|
11
|
+
AppSources[_name_1] = {}
|
|
12
|
+
end
|
|
13
|
+
local _name_1 = name
|
|
14
|
+
local _src = AppSources[_name_1]
|
|
15
|
+
if _src ~= nil then
|
|
16
|
+
local _group = group
|
|
17
|
+
_src = _src[_group]
|
|
18
|
+
end
|
|
19
|
+
local src = _src
|
|
20
|
+
if not src then
|
|
21
|
+
local newSource = source(value)
|
|
22
|
+
local _name_2 = name
|
|
23
|
+
local _result = AppSources[_name_2]
|
|
24
|
+
if _result ~= nil then
|
|
25
|
+
local _group = group
|
|
26
|
+
_result[_group] = newSource
|
|
27
|
+
end
|
|
28
|
+
else
|
|
29
|
+
src(false)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
return {
|
|
33
|
+
default = setAppSource,
|
|
34
|
+
}
|
package/out/mount.d.ts
CHANGED
|
@@ -1,37 +1,25 @@
|
|
|
1
1
|
import Vide from "@rbxts/vide";
|
|
2
|
-
import
|
|
2
|
+
import type Types from "./types";
|
|
3
|
+
import Renders from "./renders";
|
|
3
4
|
import Debugger from "./debugger";
|
|
4
5
|
import Logger from "./logger";
|
|
5
|
-
import Types from "./types";
|
|
6
6
|
type Destructor = () => void;
|
|
7
|
-
type Loaded = {
|
|
8
|
-
container: Vide.Node;
|
|
9
|
-
render: Vide.Node;
|
|
10
|
-
anchor?: Vide.Node;
|
|
11
|
-
};
|
|
12
7
|
export default class AppForge extends Renders {
|
|
13
8
|
readonly logger: Logger;
|
|
14
9
|
readonly debug: Debugger;
|
|
15
|
-
|
|
16
|
-
protected loaded: Map<string, Loaded>;
|
|
17
|
-
protected innerMount?: Destructor;
|
|
18
|
-
protected __px: boolean;
|
|
10
|
+
private innerMount?;
|
|
19
11
|
constructor();
|
|
20
|
-
|
|
21
|
-
getSource(name: AppNames): Vide.Source<boolean>;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
close(name: AppNames, rules?: boolean): void;
|
|
29
|
-
toggle(name: AppNames, rules?: boolean): void;
|
|
30
|
-
story(props: AppProps, target: GuiObject, conf?: {
|
|
12
|
+
private createSource;
|
|
13
|
+
getSource(name: AppNames, group?: AppGroups): Vide.Source<boolean>;
|
|
14
|
+
bind(name: AppNames, group: AppGroups | undefined, value: Vide.Source<boolean>): void;
|
|
15
|
+
set(name: AppNames, group: AppGroups | undefined, value: boolean, rules?: boolean): void;
|
|
16
|
+
open(name: AppNames, group?: AppGroups, rules?: boolean): void;
|
|
17
|
+
close(name: AppNames, group?: AppGroups, rules?: boolean): void;
|
|
18
|
+
toggle(name: AppNames, group?: AppGroups, rules?: boolean): void;
|
|
19
|
+
story(props: AppProps, target: GuiObject, config?: {
|
|
31
20
|
render?: Types.Props.Render;
|
|
32
21
|
minScale?: number;
|
|
33
22
|
}): Frame;
|
|
34
|
-
mount(
|
|
35
|
-
unMount(): void;
|
|
23
|
+
mount(props: Omit<Types.Props.Main, "forge">, target: Instance, root?: GuiObject | Instance): Destructor | undefined;
|
|
36
24
|
}
|
|
37
25
|
export {};
|