@rbxts/centurion-ui 1.0.0-dev-284510d → 1.0.0-dev-a7b777e

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.
Files changed (115) hide show
  1. package/README.md +29 -0
  2. package/out/app/centurion-app.d.ts +3 -0
  3. package/out/app/centurion-app.lua +92 -0
  4. package/out/app/index.d.ts +6 -1
  5. package/out/app/init.lua +57 -4
  6. package/out/components/history/history-line.d.ts +5 -5
  7. package/out/components/history/history-line.lua +51 -27
  8. package/out/components/history/history-list.d.ts +8 -12
  9. package/out/components/history/history-list.lua +41 -41
  10. package/out/components/index.d.ts +1 -0
  11. package/out/components/init.lua +3 -0
  12. package/out/components/suggestions/badge.d.ts +11 -11
  13. package/out/components/suggestions/badge.lua +14 -20
  14. package/out/components/suggestions/main-suggestion.d.ts +6 -8
  15. package/out/components/suggestions/main-suggestion.lua +153 -143
  16. package/out/components/suggestions/suggestion-list.d.ts +5 -5
  17. package/out/components/suggestions/suggestion-list.lua +70 -49
  18. package/out/components/suggestions/suggestions.d.ts +2 -1
  19. package/out/components/suggestions/suggestions.lua +41 -50
  20. package/out/components/suggestions/util.d.ts +2 -2
  21. package/out/components/suggestions/util.lua +1 -0
  22. package/out/components/terminal/index.d.ts +1 -0
  23. package/out/{store/history → components/terminal}/init.lua +1 -1
  24. package/out/components/terminal/terminal-text-field.d.ts +11 -0
  25. package/out/components/terminal/terminal-text-field.lua +319 -0
  26. package/out/components/terminal/terminal.d.ts +2 -0
  27. package/out/components/terminal/terminal.lua +240 -0
  28. package/out/components/ui/frame.d.ts +17 -18
  29. package/out/components/ui/frame.lua +8 -10
  30. package/out/components/ui/group.d.ts +13 -15
  31. package/out/components/ui/group.lua +6 -9
  32. package/out/components/ui/layer.d.ts +5 -5
  33. package/out/components/ui/layer.lua +3 -3
  34. package/out/components/ui/outline.d.ts +13 -12
  35. package/out/components/ui/outline.lua +64 -54
  36. package/out/components/ui/padding.d.ts +7 -7
  37. package/out/components/ui/padding.lua +2 -2
  38. package/out/components/ui/scrolling-frame.d.ts +11 -12
  39. package/out/components/ui/scrolling-frame.lua +4 -9
  40. package/out/components/ui/text-field.d.ts +10 -9
  41. package/out/components/ui/text-field.lua +15 -13
  42. package/out/components/ui/text.d.ts +16 -16
  43. package/out/components/ui/text.lua +39 -38
  44. package/out/constants/springs.lua +1 -1
  45. package/out/hooks/use-api.d.ts +3 -0
  46. package/out/hooks/use-api.lua +18 -0
  47. package/out/hooks/use-atom.d.ts +2 -0
  48. package/out/hooks/use-atom.lua +17 -0
  49. package/out/hooks/use-debounce-source.d.ts +11 -0
  50. package/out/hooks/use-debounce-source.lua +27 -0
  51. package/out/hooks/use-event.d.ts +14 -0
  52. package/out/hooks/use-event.lua +58 -0
  53. package/out/hooks/use-history.d.ts +2 -0
  54. package/out/hooks/use-history.lua +56 -0
  55. package/out/hooks/use-motion.d.ts +4 -4
  56. package/out/hooks/use-motion.lua +11 -16
  57. package/out/hooks/use-px.d.ts +13 -1
  58. package/out/hooks/use-px.lua +52 -39
  59. package/out/store.d.ts +14 -0
  60. package/out/store.lua +44 -0
  61. package/out/types.d.ts +7 -4
  62. package/out/util/argument.d.ts +2 -1
  63. package/out/util/argument.lua +25 -0
  64. package/out/util/suggestion.d.ts +2 -2
  65. package/out/util/suggestion.lua +9 -14
  66. package/package.json +14 -14
  67. package/out/app/app.d.ts +0 -6
  68. package/out/app/app.lua +0 -83
  69. package/out/app/terminal-app.d.ts +0 -1
  70. package/out/app/terminal-app.lua +0 -61
  71. package/out/components/terminal-text-field.d.ts +0 -11
  72. package/out/components/terminal-text-field.lua +0 -289
  73. package/out/components/terminal-window.d.ts +0 -1
  74. package/out/components/terminal-window.lua +0 -265
  75. package/out/components/terminal.d.ts +0 -1
  76. package/out/components/terminal.lua +0 -26
  77. package/out/components/ui/shortcut-group.d.ts +0 -6
  78. package/out/components/ui/shortcut-group.lua +0 -100
  79. package/out/hooks/use-store.d.ts +0 -3
  80. package/out/hooks/use-store.lua +0 -7
  81. package/out/providers/api-provider.d.ts +0 -8
  82. package/out/providers/api-provider.lua +0 -17
  83. package/out/providers/options-provider.d.ts +0 -13
  84. package/out/providers/options-provider.lua +0 -39
  85. package/out/providers/root-provider.d.ts +0 -11
  86. package/out/providers/root-provider.lua +0 -24
  87. package/out/store/app/app-selectors.d.ts +0 -2
  88. package/out/store/app/app-selectors.lua +0 -7
  89. package/out/store/app/app-slice.d.ts +0 -8
  90. package/out/store/app/app-slice.lua +0 -17
  91. package/out/store/app/index.d.ts +0 -2
  92. package/out/store/app/init.lua +0 -10
  93. package/out/store/command/command-selectors.d.ts +0 -2
  94. package/out/store/command/command-selectors.lua +0 -7
  95. package/out/store/command/command-slice.d.ts +0 -15
  96. package/out/store/command/command-slice.lua +0 -21
  97. package/out/store/command/index.d.ts +0 -2
  98. package/out/store/command/init.lua +0 -10
  99. package/out/store/history/history-slice.d.ts +0 -11
  100. package/out/store/history/history-slice.lua +0 -52
  101. package/out/store/history/index.d.ts +0 -1
  102. package/out/store/index.d.ts +0 -46
  103. package/out/store/init.lua +0 -18
  104. package/out/store/suggestion/index.d.ts +0 -2
  105. package/out/store/suggestion/init.lua +0 -10
  106. package/out/store/suggestion/suggestion-selectors.d.ts +0 -2
  107. package/out/store/suggestion/suggestion-selectors.lua +0 -7
  108. package/out/store/suggestion/suggestion-slice.d.ts +0 -9
  109. package/out/store/suggestion/suggestion-slice.lua +0 -15
  110. package/out/store/text/index.d.ts +0 -2
  111. package/out/store/text/init.lua +0 -10
  112. package/out/store/text/text-selectors.d.ts +0 -3
  113. package/out/store/text/text-selectors.lua +0 -11
  114. package/out/store/text/text-slice.d.ts +0 -20
  115. package/out/store/text/text-slice.lua +0 -29
@@ -1,11 +1,8 @@
1
1
  -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
2
  local TS = _G[script]
3
- local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
- local React = _react
5
- local forwardRef = _react.forwardRef
6
- local Group = forwardRef(function(props, ref)
7
- return React.createElement("frame", {
8
- ref = ref,
3
+ local Vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
4
+ local function Group(props)
5
+ return Vide.jsx("frame", {
9
6
  Size = props.size or UDim2.fromScale(1, 1),
10
7
  Position = props.position,
11
8
  AnchorPoint = props.anchorPoint,
@@ -15,10 +12,10 @@ local Group = forwardRef(function(props, ref)
15
12
  Visible = props.visible,
16
13
  ZIndex = props.zIndex,
17
14
  BackgroundTransparency = 1,
18
- Event = props.event or {},
19
- Change = props.change or {},
15
+ MouseEnter = props.mouseEnter,
16
+ MouseLeave = props.mouseLeave,
20
17
  }, props.children)
21
- end)
18
+ end
22
19
  return {
23
20
  Group = Group,
24
21
  }
@@ -1,7 +1,7 @@
1
- import React from "@rbxts/react";
2
- interface LayerProps extends React.PropsWithChildren {
3
- visible?: boolean;
4
- displayOrder?: number;
1
+ import Vide, { Derivable } from "@rbxts/vide";
2
+ interface LayerProps extends Vide.PropsWithChildren {
3
+ visible?: Derivable<boolean>;
4
+ displayOrder?: Derivable<number>;
5
5
  }
6
- export declare function Layer({ visible, displayOrder, children }: LayerProps): JSX.Element;
6
+ export declare function Layer({ visible, displayOrder, children }: LayerProps): Vide.Node;
7
7
  export {};
@@ -1,16 +1,16 @@
1
1
  -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
2
  local TS = _G[script]
3
- local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
3
+ local Vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
4
4
  local IS_EDIT = TS.import(script, script.Parent.Parent.Parent, "constants", "util").IS_EDIT
5
5
  local Group = TS.import(script, script.Parent, "group").Group
6
6
  local function Layer(_param)
7
7
  local visible = _param.visible
8
8
  local displayOrder = _param.displayOrder
9
9
  local children = _param.children
10
- return if IS_EDIT then (React.createElement(Group, {
10
+ return if IS_EDIT then (Vide.jsx(Group, {
11
11
  visible = visible,
12
12
  zIndex = displayOrder,
13
- }, children)) else (React.createElement("screengui", {
13
+ }, children)) else (Vide.jsx("screengui", {
14
14
  Enabled = visible,
15
15
  ResetOnSpawn = false,
16
16
  DisplayOrder = displayOrder,
@@ -1,14 +1,15 @@
1
- import { BindingOrValue } from "@rbxts/pretty-react-hooks";
2
- import React from "@rbxts/react";
3
- interface OutlineProps extends React.PropsWithChildren {
4
- readonly outlineTransparency?: BindingOrValue<number>;
5
- readonly innerColor?: BindingOrValue<Color3>;
6
- readonly outerColor?: BindingOrValue<Color3>;
7
- readonly innerTransparency?: BindingOrValue<number>;
8
- readonly outerTransparency?: BindingOrValue<number>;
9
- readonly innerThickness?: BindingOrValue<number>;
10
- readonly outerThickness?: BindingOrValue<number>;
11
- readonly cornerRadius?: BindingOrValue<UDim>;
1
+ import Vide, { Derivable } from "@rbxts/vide";
2
+ interface OutlineProps {
3
+ outlineTransparency?: Derivable<number>;
4
+ innerColor?: Derivable<Color3>;
5
+ outerColor?: Derivable<Color3>;
6
+ innerTransparency?: Derivable<number>;
7
+ outerTransparency?: Derivable<number>;
8
+ innerThickness?: Derivable<number>;
9
+ outerThickness?: Derivable<number>;
10
+ cornerRadius?: Derivable<UDim>;
11
+ children?: Vide.Node;
12
12
  }
13
- export declare function Outline({ outlineTransparency, innerColor, outerColor, innerTransparency, outerTransparency, innerThickness, outerThickness, cornerRadius, children, }: OutlineProps): JSX.Element;
13
+ export declare function blend(...transparencies: number[]): number;
14
+ export declare function Outline({ outlineTransparency, innerColor, outerColor, innerTransparency, outerTransparency, innerThickness, outerThickness, cornerRadius, children, }: OutlineProps): Vide.Node;
14
15
  export {};
@@ -1,16 +1,22 @@
1
1
  -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
2
  local TS = _G[script]
3
- local _pretty_react_hooks = TS.import(script, TS.getModule(script, "@rbxts", "pretty-react-hooks").out)
4
- local blend = _pretty_react_hooks.blend
5
- local composeBindings = _pretty_react_hooks.composeBindings
6
- local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
7
- local React = _react
8
- local useMemo = _react.useMemo
9
- local usePx = TS.import(script, script.Parent.Parent.Parent, "hooks", "use-px").usePx
3
+ local _vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
4
+ local Vide = _vide
5
+ local derive = _vide.derive
6
+ local read = _vide.read
7
+ local px = TS.import(script, script.Parent.Parent.Parent, "hooks", "use-px").px
10
8
  local Group = TS.import(script, script.Parent, "group").Group
11
9
  local function ceilEven(n)
12
10
  return math.ceil(n / 2) * 2
13
11
  end
12
+ local function blend(...)
13
+ local transparencies = { ... }
14
+ local result = 1
15
+ for _, transparency in transparencies do
16
+ result *= 1 - transparency
17
+ end
18
+ return 1 - result
19
+ end
14
20
  local DEFAULT_INNER_COLOR = Color3.new(1, 1, 1)
15
21
  local DEFAULT_OUTER_COLOR = Color3.new(0, 0, 0)
16
22
  local function Outline(_param)
@@ -38,69 +44,73 @@ local function Outline(_param)
38
44
  local outerThickness = _param.outerThickness
39
45
  local cornerRadius = _param.cornerRadius
40
46
  local children = _param.children
41
- local px = usePx()
42
- local _object = {}
43
- local _left = "innerThickness"
44
- local _condition = innerThickness
45
- if _condition == nil then
46
- _condition = px(3)
47
- end
48
- _object[_left] = _condition
49
- local _left_1 = "outerThickness"
50
- local _condition_1 = outerThickness
51
- if _condition_1 == nil then
52
- _condition_1 = px(1.5)
53
- end
54
- _object[_left_1] = _condition_1
55
- _object.cornerRadius = cornerRadius or UDim.new(0, px(8))
56
- local properties = _object
57
- local innerStyle = useMemo(function()
58
- local size = composeBindings(properties.innerThickness, function(thickness)
59
- return UDim2.new(1, ceilEven(-2 * thickness), 1, ceilEven(-2 * thickness))
60
- end)
61
- local position = composeBindings(properties.innerThickness, function(thickness)
62
- return UDim2.new(0, thickness, 0, thickness)
63
- end)
64
- local radius = composeBindings(properties.cornerRadius, properties.innerThickness, function(radius, thickness)
65
- local _radius = radius
66
- local _uDim = UDim.new(0, thickness)
67
- return _radius - _uDim
68
- end)
69
- local transparency = composeBindings(outlineTransparency, innerTransparency, function(a, b)
70
- return math.clamp(blend(a, b), 0, 1)
71
- end)
47
+ local properties = derive(function()
48
+ local _object = {}
49
+ local _left = "innerThickness"
50
+ local _condition = innerThickness
51
+ if _condition == nil then
52
+ _condition = px(3)
53
+ end
54
+ _object[_left] = _condition
55
+ local _left_1 = "outerThickness"
56
+ local _condition_1 = outerThickness
57
+ if _condition_1 == nil then
58
+ _condition_1 = px(1.5)
59
+ end
60
+ _object[_left_1] = _condition_1
61
+ _object.cornerRadius = cornerRadius or UDim.new(0, px(8))
62
+ return _object
63
+ end)
64
+ local innerStyle = derive(function()
65
+ local outlineProps = properties()
66
+ local thickness = read(outlineProps.innerThickness)
67
+ local size = UDim2.new(1, ceilEven(-2 * thickness), 1, ceilEven(-2 * thickness))
68
+ local position = UDim2.new(0, thickness, 0, thickness)
69
+ local _exp = read(outlineProps.cornerRadius)
70
+ local _uDim = UDim.new(0, thickness)
71
+ local radius = _exp - _uDim
72
+ local transparency = math.clamp(blend(read(outlineTransparency), read(innerTransparency)), 0, 1)
72
73
  return {
73
74
  size = size,
74
75
  position = position,
75
76
  radius = radius,
76
77
  transparency = transparency,
77
78
  }
78
- end, { properties.innerThickness, innerTransparency, properties.cornerRadius, outlineTransparency, px })
79
- local outerStyle = useMemo(function()
80
- local transparency = composeBindings(outlineTransparency, outerTransparency, function(a, b)
81
- return math.clamp(blend(a, b), 0, 1)
82
- end)
79
+ end)
80
+ local outerStyle = derive(function()
81
+ local transparency = math.clamp(blend(read(outlineTransparency), read(outerTransparency)), 0, 1)
83
82
  return {
84
83
  transparency = transparency,
85
84
  }
86
- end, { outlineTransparency, outerTransparency })
87
- return React.createElement(React.Fragment, nil, React.createElement(Group, {
88
- size = innerStyle.size,
89
- position = innerStyle.position,
90
- }, React.createElement("uicorner", {
91
- CornerRadius = innerStyle.radius,
92
- }), React.createElement("uistroke", {
85
+ end)
86
+ return Vide.jsx(Vide.Fragment, nil, Vide.jsx(Group, {
87
+ size = function()
88
+ return innerStyle().size
89
+ end,
90
+ position = function()
91
+ return innerStyle().position
92
+ end,
93
+ }, Vide.jsx("uicorner", {
94
+ CornerRadius = function()
95
+ return innerStyle().radius
96
+ end,
97
+ }), Vide.jsx("uistroke", {
93
98
  Color = innerColor,
94
- Transparency = innerStyle.transparency,
99
+ Transparency = function()
100
+ return innerStyle().transparency
101
+ end,
95
102
  Thickness = innerThickness,
96
- }, children)), React.createElement(Group, nil, React.createElement("uicorner", {
103
+ }, children)), Vide.jsx(Group, nil, Vide.jsx("uicorner", {
97
104
  CornerRadius = cornerRadius,
98
- }), React.createElement("uistroke", {
105
+ }), Vide.jsx("uistroke", {
99
106
  Color = outerColor,
100
- Transparency = outerStyle.transparency,
107
+ Transparency = function()
108
+ return outerStyle().transparency
109
+ end,
101
110
  Thickness = outerThickness,
102
111
  }, children)))
103
112
  end
104
113
  return {
114
+ blend = blend,
105
115
  Outline = Outline,
106
116
  }
@@ -1,10 +1,10 @@
1
- import { BindingOrValue } from "@rbxts/pretty-react-hooks";
1
+ import Vide, { Derivable } from "@rbxts/vide";
2
2
  interface Props {
3
- all?: BindingOrValue<UDim>;
4
- left?: BindingOrValue<UDim>;
5
- right?: BindingOrValue<UDim>;
6
- top?: BindingOrValue<UDim>;
7
- bottom?: BindingOrValue<UDim>;
3
+ all?: Derivable<UDim>;
4
+ left?: Derivable<UDim>;
5
+ right?: Derivable<UDim>;
6
+ top?: Derivable<UDim>;
7
+ bottom?: Derivable<UDim>;
8
8
  }
9
- export declare function Padding({ all, left, right, top, bottom }: Props): JSX.Element;
9
+ export declare function Padding({ all, left, right, top, bottom }: Props): Vide.Node;
10
10
  export {};
@@ -1,13 +1,13 @@
1
1
  -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
2
  local TS = _G[script]
3
- local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
3
+ local Vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
4
4
  local function Padding(_param)
5
5
  local all = _param.all
6
6
  local left = _param.left
7
7
  local right = _param.right
8
8
  local top = _param.top
9
9
  local bottom = _param.bottom
10
- return React.createElement("uipadding", {
10
+ return Vide.jsx("uipadding", {
11
11
  PaddingLeft = left or all,
12
12
  PaddingRight = right or all,
13
13
  PaddingTop = top or all,
@@ -1,15 +1,14 @@
1
- import { BindingOrValue } from "@rbxts/pretty-react-hooks";
2
- import React from "@rbxts/react";
1
+ import Vide, { Derivable, InferEnumNames } from "@rbxts/vide";
3
2
  import { FrameProps } from "./frame";
4
3
  export interface ScrollingFrameProps extends FrameProps<ScrollingFrame> {
5
- automaticSize?: React.InferEnumNames<Enum.AutomaticSize>;
6
- automaticCanvasSize?: React.InferEnumNames<Enum.AutomaticSize>;
7
- scrollingDirection?: React.InferEnumNames<Enum.ScrollingDirection>;
8
- scrollBarThickness?: BindingOrValue<number>;
9
- scrollBarColor?: BindingOrValue<Color3>;
10
- scrollBarTransparency?: BindingOrValue<number>;
11
- scrollingEnabled?: BindingOrValue<boolean>;
12
- canvasSize?: BindingOrValue<UDim2>;
13
- canvasPosition?: BindingOrValue<Vector2>;
4
+ automaticSize?: InferEnumNames<Enum.AutomaticSize>;
5
+ automaticCanvasSize?: InferEnumNames<Enum.AutomaticSize>;
6
+ scrollingDirection?: InferEnumNames<Enum.ScrollingDirection>;
7
+ scrollBarThickness?: Derivable<number>;
8
+ scrollBarColor?: Derivable<Color3>;
9
+ scrollBarTransparency?: Derivable<number>;
10
+ scrollingEnabled?: Derivable<boolean>;
11
+ canvasSize?: Derivable<UDim2>;
12
+ canvasPosition?: Derivable<Vector2>;
14
13
  }
15
- export declare const ScrollingFrame: React.ForwardRefExoticComponent<Omit<ScrollingFrameProps, "ref"> & React.RefAttributes<ScrollingFrame>>;
14
+ export declare function ScrollingFrame(props: ScrollingFrameProps): Vide.Node;
@@ -1,11 +1,8 @@
1
1
  -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
2
  local TS = _G[script]
3
- local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
- local React = _react
5
- local forwardRef = _react.forwardRef
6
- local ScrollingFrame = forwardRef(function(props, ref)
3
+ local Vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
4
+ local function ScrollingFrame(props)
7
5
  local _attributes = {
8
- ref = ref,
9
6
  AutomaticSize = props.automaticSize,
10
7
  AutomaticCanvasSize = props.automaticCanvasSize,
11
8
  ScrollingDirection = props.scrollingDirection,
@@ -31,12 +28,10 @@ local ScrollingFrame = forwardRef(function(props, ref)
31
28
  _attributes.ZIndex = props.zIndex
32
29
  _attributes.LayoutOrder = props.layoutOrder
33
30
  _attributes.BorderSizePixel = 0
34
- _attributes.Event = props.event or {}
35
- _attributes.Change = props.change or {}
36
- return React.createElement("scrollingframe", _attributes, props.cornerRadius and React.createElement("uicorner", {
31
+ return Vide.jsx("scrollingframe", _attributes, props.cornerRadius and Vide.jsx("uicorner", {
37
32
  CornerRadius = props.cornerRadius,
38
33
  }), props.children)
39
- end)
34
+ end
40
35
  return {
41
36
  ScrollingFrame = ScrollingFrame,
42
37
  }
@@ -1,13 +1,14 @@
1
- import { BindingOrValue } from "@rbxts/pretty-react-hooks";
2
- import React from "@rbxts/react";
1
+ import Vide, { Derivable } from "@rbxts/vide";
3
2
  import { TextProps } from "./text";
4
3
  interface TextFieldProps extends TextProps<TextBox> {
5
- text?: BindingOrValue<string>;
6
- placeholderText?: BindingOrValue<string>;
7
- placeholderColor?: BindingOrValue<Color3>;
8
- clearTextOnFocus?: BindingOrValue<boolean>;
9
- multiLine?: BindingOrValue<boolean>;
10
- textEditable?: BindingOrValue<boolean>;
4
+ text?: Derivable<string>;
5
+ placeholderText?: Derivable<string>;
6
+ placeholderColor?: Derivable<Color3>;
7
+ clearTextOnFocus?: Derivable<boolean>;
8
+ multiLine?: Derivable<boolean>;
9
+ textEditable?: Derivable<boolean>;
10
+ focusLost?: (enterPressed: boolean) => void;
11
+ textChanged?: (text: string) => void;
11
12
  }
12
- export declare const TextField: React.ForwardRefExoticComponent<Omit<TextFieldProps, "ref"> & React.RefAttributes<TextBox>>;
13
+ export declare function TextField(props: TextFieldProps): Vide.Node;
13
14
  export {};
@@ -1,21 +1,22 @@
1
1
  -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
2
  local TS = _G[script]
3
- local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
- local forwardRef = _react.forwardRef
5
- local useContext = _react.useContext
6
- local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
7
- local OptionsContext = TS.import(script, script.Parent.Parent.Parent, "providers", "options-provider").OptionsContext
8
- local TextField = forwardRef(function(props, ref)
9
- local options = useContext(OptionsContext)
3
+ local _vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
4
+ local Vide = _vide
5
+ local read = _vide.read
6
+ local useAtom = TS.import(script, script.Parent.Parent.Parent, "hooks", "use-atom").useAtom
7
+ local interfaceOptions = TS.import(script, script.Parent.Parent.Parent, "store").interfaceOptions
8
+ local function TextField(props)
9
+ local options = useAtom(interfaceOptions)
10
10
  local _attributes = {
11
- ref = ref,
12
11
  PlaceholderText = props.placeholderText,
13
12
  PlaceholderColor3 = props.placeholderColor,
14
13
  ClearTextOnFocus = props.clearTextOnFocus,
15
14
  MultiLine = props.multiLine,
16
15
  TextEditable = props.textEditable,
17
16
  Font = Enum.Font.Unknown,
18
- FontFace = props.font or options.font.regular,
17
+ FontFace = function()
18
+ return read(props.font) or options().font.regular
19
+ end,
19
20
  Text = props.text,
20
21
  TextColor3 = props.textColor,
21
22
  TextSize = props.textSize,
@@ -42,12 +43,13 @@ local TextField = forwardRef(function(props, ref)
42
43
  _attributes.ZIndex = props.zIndex
43
44
  _attributes.LayoutOrder = props.layoutOrder
44
45
  _attributes.BorderSizePixel = 0
45
- _attributes.Event = props.event or {}
46
- _attributes.Change = props.change or {}
47
- return React.createElement("textbox", _attributes, props.cornerRadius and React.createElement("uicorner", {
46
+ _attributes.FocusLost = props.focusLost
47
+ _attributes.TextChanged = props.textChanged
48
+ _attributes.action = props.action
49
+ return Vide.jsx("textbox", _attributes, props.cornerRadius and Vide.jsx("uicorner", {
48
50
  CornerRadius = props.cornerRadius,
49
51
  }), props.children)
50
- end)
52
+ end
51
53
  return {
52
54
  TextField = TextField,
53
55
  }
@@ -1,20 +1,20 @@
1
- import { BindingOrValue } from "@rbxts/pretty-react-hooks";
2
- import React from "@rbxts/react";
1
+ import Vide, { Derivable, InferEnumNames } from "@rbxts/vide";
3
2
  import { FrameProps } from "./frame";
4
3
  export interface TextProps<T extends Instance = TextLabel> extends FrameProps<T> {
5
- font?: Font;
6
- text?: BindingOrValue<string>;
7
- textColor?: BindingOrValue<Color3>;
8
- textSize?: BindingOrValue<number>;
9
- textTransparency?: BindingOrValue<number>;
10
- textWrapped?: BindingOrValue<boolean>;
11
- textXAlignment?: React.InferEnumNames<Enum.TextXAlignment>;
12
- textYAlignment?: React.InferEnumNames<Enum.TextYAlignment>;
13
- textTruncate?: React.InferEnumNames<Enum.TextTruncate>;
14
- textScaled?: BindingOrValue<boolean>;
15
- textHeight?: BindingOrValue<number>;
4
+ font?: Derivable<Font>;
5
+ text?: Derivable<string>;
6
+ textColor?: Derivable<Color3>;
7
+ textSize?: Derivable<number>;
8
+ textTransparency?: Derivable<number>;
9
+ textWrapped?: Derivable<boolean>;
10
+ textXAlignment?: InferEnumNames<Enum.TextXAlignment>;
11
+ textYAlignment?: InferEnumNames<Enum.TextYAlignment>;
12
+ textTruncate?: InferEnumNames<Enum.TextTruncate>;
13
+ textScaled?: Derivable<boolean>;
14
+ textHeight?: Derivable<number>;
16
15
  textAutoResize?: "X" | "Y" | "XY";
17
- richText?: BindingOrValue<boolean>;
18
- maxVisibleGraphemes?: BindingOrValue<number>;
16
+ richText?: Derivable<boolean>;
17
+ maxVisibleGraphemes?: Derivable<number>;
18
+ textBoundsChanged?: (textBounds: Vector2) => void;
19
19
  }
20
- export declare const Text: React.ForwardRefExoticComponent<Omit<TextProps<TextLabel>, "ref"> & React.RefAttributes<TextLabel>>;
20
+ export declare function Text(props: TextProps): Vide.Node;
@@ -1,55 +1,56 @@
1
1
  -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
2
  local TS = _G[script]
3
- local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
- local React = _react
5
- local forwardRef = _react.forwardRef
6
- local useContext = _react.useContext
7
- local usePx = TS.import(script, script.Parent.Parent.Parent, "hooks", "use-px").usePx
8
- local OptionsContext = TS.import(script, script.Parent.Parent.Parent, "providers", "options-provider").OptionsContext
9
- local Text = forwardRef(function(props, ref)
10
- local px = usePx()
11
- local options = useContext(OptionsContext)
3
+ local _vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
4
+ local Vide = _vide
5
+ local read = _vide.read
6
+ local useAtom = TS.import(script, script.Parent.Parent.Parent, "hooks", "use-atom").useAtom
7
+ local px = TS.import(script, script.Parent.Parent.Parent, "hooks", "use-px").px
8
+ local interfaceOptions = TS.import(script, script.Parent.Parent.Parent, "store").interfaceOptions
9
+ local function Text(props)
10
+ local options = useAtom(interfaceOptions)
12
11
  local _attributes = {
13
- ref = ref,
14
- Font = Enum.Font.Unknown,
15
- FontFace = props.font or options.font.regular,
12
+ FontFace = function()
13
+ return read(props.font) or options().font.regular
14
+ end,
16
15
  Text = props.text,
17
16
  TextColor3 = props.textColor,
17
+ TextSize = function()
18
+ local _condition = read(props.textSize)
19
+ if _condition == nil then
20
+ _condition = px(16)
21
+ end
22
+ return _condition
23
+ end,
24
+ TextTransparency = props.textTransparency,
25
+ TextWrapped = props.textWrapped,
26
+ TextXAlignment = props.textXAlignment,
27
+ TextYAlignment = props.textYAlignment,
28
+ TextTruncate = props.textTruncate,
29
+ TextScaled = props.textScaled,
30
+ LineHeight = props.textHeight,
31
+ RichText = props.richText,
32
+ MaxVisibleGraphemes = props.maxVisibleGraphemes,
33
+ Size = props.size,
34
+ AutomaticSize = props.textAutoResize,
35
+ Position = props.position,
36
+ AnchorPoint = props.anchorPoint,
37
+ BackgroundColor3 = props.backgroundColor,
18
38
  }
19
- local _condition = props.textSize
39
+ local _condition = props.backgroundTransparency
20
40
  if _condition == nil then
21
- _condition = px(16)
41
+ _condition = 1
22
42
  end
23
- _attributes.TextSize = _condition
24
- _attributes.TextTransparency = props.textTransparency
25
- _attributes.TextWrapped = props.textWrapped
26
- _attributes.TextXAlignment = props.textXAlignment
27
- _attributes.TextYAlignment = props.textYAlignment
28
- _attributes.TextTruncate = props.textTruncate
29
- _attributes.TextScaled = props.textScaled
30
- _attributes.LineHeight = props.textHeight
31
- _attributes.RichText = props.richText
32
- _attributes.MaxVisibleGraphemes = props.maxVisibleGraphemes
33
- _attributes.Size = props.size
34
- _attributes.AutomaticSize = props.textAutoResize
35
- _attributes.Position = props.position
36
- _attributes.AnchorPoint = props.anchorPoint
37
- _attributes.BackgroundColor3 = props.backgroundColor
38
- local _condition_1 = props.backgroundTransparency
39
- if _condition_1 == nil then
40
- _condition_1 = 1
41
- end
42
- _attributes.BackgroundTransparency = _condition_1
43
+ _attributes.BackgroundTransparency = _condition
43
44
  _attributes.ClipsDescendants = props.clipsDescendants
44
45
  _attributes.Visible = props.visible
45
46
  _attributes.ZIndex = props.zIndex
46
47
  _attributes.LayoutOrder = props.layoutOrder
47
- _attributes.Change = props.change or {}
48
- _attributes.Event = props.event or {}
49
- return React.createElement("textlabel", _attributes, props.cornerRadius and React.createElement("uicorner", {
48
+ _attributes.action = props.action
49
+ _attributes.TextBoundsChanged = props.textBoundsChanged
50
+ return Vide.jsx("textlabel", _attributes, props.cornerRadius and Vide.jsx("uicorner", {
50
51
  CornerRadius = props.cornerRadius,
51
52
  }), props.children)
52
- end)
53
+ end
53
54
  return {
54
55
  Text = Text,
55
56
  }
@@ -1,6 +1,6 @@
1
1
  -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
2
  local TS = _G[script]
3
- local config = TS.import(script, TS.getModule(script, "@rbxts", "ripple")).config
3
+ local config = TS.import(script, TS.getModule(script, "@rbxts", "ripple").src).config
4
4
  local _object = table.clone(config.spring)
5
5
  setmetatable(_object, nil)
6
6
  _object.bubbly = {
@@ -0,0 +1,3 @@
1
+ import { ClientAPI } from "@rbxts/centurion";
2
+ export declare function getAPI(): ClientAPI;
3
+ export declare function useAPI(clientAPI: ClientAPI): import("@rbxts/vide").Source<ClientAPI | undefined>;
@@ -0,0 +1,18 @@
1
+ -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
+ local TS = _G[script]
3
+ local source = TS.import(script, TS.getModule(script, "@rbxts", "vide").src).source
4
+ local api = source()
5
+ local function getAPI()
6
+ local value = api()
7
+ local _arg0 = value ~= nil
8
+ assert(_arg0, "Client API has not been set")
9
+ return value
10
+ end
11
+ local function useAPI(clientAPI)
12
+ api(clientAPI)
13
+ return api
14
+ end
15
+ return {
16
+ getAPI = getAPI,
17
+ useAPI = useAPI,
18
+ }
@@ -0,0 +1,2 @@
1
+ import { Molecule } from "@rbxts/charm";
2
+ export declare function useAtom<T>(atom: Molecule<T>): import("@rbxts/vide").Source<T>;
@@ -0,0 +1,17 @@
1
+ -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
+ local TS = _G[script]
3
+ local subscribe = TS.import(script, TS.getModule(script, "@rbxts", "charm").src).subscribe
4
+ local _vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
5
+ local cleanup = _vide.cleanup
6
+ local source = _vide.source
7
+ local function useAtom(atom)
8
+ local state = source(atom())
9
+ local disconnect = subscribe(atom, state)
10
+ cleanup(function()
11
+ disconnect()
12
+ end)
13
+ return state
14
+ end
15
+ return {
16
+ useAtom = useAtom,
17
+ }
@@ -0,0 +1,11 @@
1
+ import { DebounceOptions } from "@rbxts/set-timeout";
2
+ export interface UseDebounceOptions extends DebounceOptions {
3
+ /**
4
+ * The amount of time to wait before the first call.
5
+ */
6
+ wait?: number;
7
+ }
8
+ export declare function useDebounceSource<T>(initialValue: T, options?: UseDebounceOptions): {
9
+ get: () => T;
10
+ set: (value: T) => T;
11
+ };
@@ -0,0 +1,27 @@
1
+ -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
+ local TS = _G[script]
3
+ local debounce = TS.import(script, TS.getModule(script, "@rbxts", "set-timeout").out).debounce
4
+ local _vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
5
+ local cleanup = _vide.cleanup
6
+ local source = _vide.source
7
+ local function useDebounceSource(initialValue, options)
8
+ if options == nil then
9
+ options = {}
10
+ end
11
+ local state = source(initialValue)
12
+ local update = debounce(state, options.wait, options)
13
+ cleanup(function()
14
+ update.cancel()
15
+ end)
16
+ return {
17
+ get = function()
18
+ return state()
19
+ end,
20
+ set = function(value)
21
+ return update(value)
22
+ end,
23
+ }
24
+ end
25
+ return {
26
+ useDebounceSource = useDebounceSource,
27
+ }