@rbxts/app-forge 0.4.7 → 0.4.9

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.
@@ -1,3 +1,4 @@
1
1
  import "@rbxts/vide";
2
+ import Vide from "@rbxts/vide";
2
3
  import type Types from "./types";
3
- export default function AppContainer(props: Types.NameProps & Types.MainProps): void;
4
+ export default function AppContainer(props: Types.NameProps & Types.MainProps): Vide.Node;
@@ -4,11 +4,12 @@ TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
4
4
  -- Services
5
5
  local RunService = TS.import(script, TS.getModule(script, "@rbxts", "services")).RunService
6
6
  -- Packages
7
- local source = TS.import(script, TS.getModule(script, "@rbxts", "vide").src).source
7
+ local _vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
8
+ local Vide = _vide
9
+ local source = _vide.source
8
10
  -- Types
9
11
  -- Components
10
12
  local AppRegistry = TS.import(script, script.Parent, "decorator").AppRegistry
11
- -- Utility
12
13
  local function createSource(name, manager)
13
14
  local _name = name
14
15
  local app = AppRegistry[_name]
@@ -57,18 +58,17 @@ local function AppContainer(props)
57
58
  error(`Failed to create instance for app "{name}"`)
58
59
  end
59
60
  if RunService:IsRunning() then
60
- return nil
61
- -- return (
62
- -- <screengui key={name} ZIndexBehavior="Sibling" ResetOnSpawn={false}>
63
- -- {element}
64
- -- </screengui>
65
- -- );
61
+ return Vide.jsx("screengui", {
62
+ Name = name,
63
+ ZIndexBehavior = "Sibling",
64
+ ResetOnSpawn = false,
65
+ }, element)
66
66
  else
67
- -- return (
68
- -- <frame key={name} BackgroundTransparency={1} Size={UDim2.fromScale(1, 1)}>
69
- -- {element}
70
- -- </frame>
71
- -- );
67
+ return Vide.jsx("frame", {
68
+ Name = name,
69
+ BackgroundTransparency = 1,
70
+ Size = UDim2.fromScale(1, 1),
71
+ }, element)
72
72
  end
73
73
  end
74
74
  return {
@@ -3,7 +3,7 @@ local TS = _G[script]
3
3
  -- Services
4
4
  local RunService = TS.import(script, TS.getModule(script, "@rbxts", "services")).RunService
5
5
  -- Packages
6
- local usePx = TS.import(script, TS.getModule(script, "@rbxts", "loners-pretty-vide-utils").out).usePx
6
+ local pxScale = TS.import(script, TS.getModule(script, "@rbxts", "loners-pretty-vide-utils").out).px
7
7
  -- Types
8
8
  local AppRegistry = {}
9
9
  local function App(props)
@@ -27,7 +27,6 @@ do
27
27
  Args = {}
28
28
  function Args:constructor(props)
29
29
  local _binding = props
30
- local target = _binding.target
31
30
  local forge = _binding.forge
32
31
  local name = _binding.name
33
32
  if not (name ~= "" and name) then
@@ -37,7 +36,7 @@ do
37
36
  if not source and RunService:IsRunning() then
38
37
  error("FAILED TO GET BIND FOR APP!")
39
38
  end
40
- local px = usePx(target)
39
+ local px = pxScale
41
40
  self.forge = forge
42
41
  local _object = table.clone(props.props)
43
42
  setmetatable(_object, nil)
package/out/helpers.luau CHANGED
@@ -1,9 +1,18 @@
1
1
  -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ -- Packages
4
+ local usePx = TS.import(script, TS.getModule(script, "@rbxts", "loners-pretty-vide-utils").out).usePx
2
5
  -- Types
6
+ local __px = false
3
7
  local function Render(props)
4
8
  local names = props.names
5
9
  local name = props.name
6
10
  local forge = props.forge
11
+ if not __px then
12
+ local _exp = usePx(props.target)
13
+ __px = true
14
+ local _ = __px
15
+ end
7
16
  if name ~= "" and name then
8
17
  return forge:renderApp(props)
9
18
  elseif names then
package/out/types.d.ts CHANGED
@@ -20,7 +20,7 @@ declare namespace Types {
20
20
  };
21
21
 
22
22
  type ClassProps = AppProps & {
23
- px: ReturnType<typeof import("@rbxts/loners-pretty-vide-utils").usePx>;
23
+ px: typeof import("@rbxts/loners-pretty-vide-utils").px;
24
24
  };
25
25
 
26
26
  type AppRegistry = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/app-forge",
3
- "version": "0.4.7",
3
+ "version": "0.4.9",
4
4
  "description": "An App Manager for react",
5
5
  "main": "out/init.lua",
6
6
  "packageManager": "bun@1.3.1",