@rbxts/app-forge 0.6.0-alpha.86 → 0.6.0-alpha.87

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/README.md CHANGED
@@ -13,7 +13,9 @@ AppForge is a UI/app orchestration system for Vide/React in Roblox, enabling:
13
13
 
14
14
  # VIDE is working and functional in the latest build
15
15
 
16
- # REACT is PLANNED to be worked on but is NOT recommended ATM
16
+ # REACT is PLANNED to be worked on but is NOT recommended ATM | If you plan to use React I believe version 0.6.0 works
17
+
18
+ # I decided to make this package when I was learning React and mid way through decided to switch back to Vide mainly cause of how Reacts rerenders so I plan to work on Vide version more rn and work on React later on when I feel up for the task
17
19
 
18
20
  # 📦 Installation
19
21
 
@@ -175,22 +175,12 @@ do
175
175
  render = render,
176
176
  }
177
177
  _loaded[name] = _arg1
178
- local _result = appClass.rules
179
- if _result ~= nil then
180
- _result = _result.parent
181
- end
182
- local _condition = _result
183
- if _condition ~= "" and _condition then
184
- _condition = not appClass.rules.detach
185
- end
186
- if _condition ~= "" and _condition then
187
- self:anchor(name, appClass.rules.parent, props)
188
- end
189
178
  end
190
179
  local element = forge.loaded[name]
191
180
  if not element then
192
181
  error(`Failed to create instance for app "{name}"`)
193
182
  end
183
+ self:renderRules(name, props)
194
184
  return element.container
195
185
  end
196
186
  function Renders:renderApps(props)
@@ -1,5 +1,7 @@
1
+ import type Types from "../../types";
1
2
  import type AppForge from "../..";
2
3
  export default class Rules {
3
4
  protected processing: Set<string>;
5
+ protected renderRules(this: AppForge, name: AppNames, props: Types.Props.Main): void;
4
6
  protected checkRules(this: AppForge, name: AppNames): void;
5
7
  }
@@ -1,6 +1,8 @@
1
1
  -- Compiled with roblox-ts v3.0.0
2
2
  local TS = _G[script]
3
3
  -- Types
4
+ -- Components
5
+ local AppRegistry = TS.import(script, script.Parent.Parent, "decorator").AppRegistry
4
6
  -- Rules
5
7
  local ExclusiveGroupRule = TS.import(script, script, "exclusiveGroup").default
6
8
  local ParentRule = TS.import(script, script, "parent").default
@@ -19,6 +21,31 @@ do
19
21
  function Rules:constructor()
20
22
  self.processing = {}
21
23
  end
24
+ function Rules:renderRules(name, props)
25
+ local _name = name
26
+ local appClass = AppRegistry[_name]
27
+ if not appClass then
28
+ error(`Failed to get class for app: {name} for renderRules`)
29
+ end
30
+ local _result = appClass.rules
31
+ if _result ~= nil then
32
+ _result = _result.parent
33
+ end
34
+ local _condition = _result
35
+ if _condition ~= "" and _condition then
36
+ _condition = not appClass.rules.detach
37
+ end
38
+ if _condition ~= "" and _condition then
39
+ self:anchor(name, appClass.rules.parent, props)
40
+ end
41
+ local _result_1 = appClass.rules
42
+ if _result_1 ~= nil then
43
+ _result_1 = _result_1.index
44
+ end
45
+ if _result_1 ~= 0 and _result_1 == _result_1 and _result_1 then
46
+ self:index(name, appClass.rules.index)
47
+ end
48
+ end
22
49
  function Rules:checkRules(name)
23
50
  local _processing = self.processing
24
51
  local _name = name
@@ -17,6 +17,7 @@ export default class AppForge extends Renders {
17
17
  isLoaded(name: AppNames): boolean;
18
18
  bind(name: AppNames, value: Vide.Source<boolean>): void;
19
19
  anchor(name: AppNames, anchorName: AppNames, props: Types.Props.Main): void;
20
+ index(name: AppNames, index: number): void;
20
21
  getSource(name: AppNames): Vide.Source<boolean>;
21
22
  set(name: AppNames, value: boolean, rules?: boolean): void;
22
23
  open(name: AppNames, rules?: boolean): void;
@@ -128,6 +128,17 @@ do
128
128
  _object.anchor = anchor
129
129
  _loaded_2[_exp] = _object
130
130
  end
131
+ function AppForge:index(name, index)
132
+ local _loaded = self.loaded
133
+ local _name = name
134
+ local loaded = _loaded[_name]
135
+ if not loaded then
136
+ error(`Failed to retreive loaded data for app: {name}`)
137
+ end
138
+ apply(loaded.container)({
139
+ ZIndex = index,
140
+ })
141
+ end
131
142
  function AppForge:getSource(name)
132
143
  local _sources = self.sources
133
144
  local _name = name
@@ -71,7 +71,7 @@ declare namespace Types {
71
71
  type Static = {
72
72
  parent?: string;
73
73
  exclusiveGroup?: string;
74
- layer?: number;
74
+ index?: number;
75
75
  } & ParentStatic;
76
76
 
77
77
  type ParentGeneric<N extends AppNames = AppNames> =
@@ -83,7 +83,7 @@ declare namespace Types {
83
83
 
84
84
  type Generic<N extends AppNames = AppNames> = {
85
85
  exclusiveGroup?: GroupNames;
86
- layer?: number;
86
+ index?: number;
87
87
  } & ParentGeneric<N>;
88
88
  }
89
89
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/app-forge",
3
- "version": "0.6.0-alpha.86",
3
+ "version": "0.6.0-alpha.87",
4
4
  "description": "An App Manager for Vide",
5
5
  "main": "out/init.lua",
6
6
  "types": "out/index.d.ts",