@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.
- package/README.md +29 -0
- package/out/app/centurion-app.d.ts +3 -0
- package/out/app/centurion-app.lua +92 -0
- package/out/app/index.d.ts +6 -1
- package/out/app/init.lua +57 -4
- package/out/components/history/history-line.d.ts +5 -5
- package/out/components/history/history-line.lua +51 -27
- package/out/components/history/history-list.d.ts +8 -12
- package/out/components/history/history-list.lua +41 -41
- package/out/components/index.d.ts +1 -0
- package/out/components/init.lua +3 -0
- package/out/components/suggestions/badge.d.ts +11 -11
- package/out/components/suggestions/badge.lua +14 -20
- package/out/components/suggestions/main-suggestion.d.ts +6 -8
- package/out/components/suggestions/main-suggestion.lua +153 -143
- package/out/components/suggestions/suggestion-list.d.ts +5 -5
- package/out/components/suggestions/suggestion-list.lua +70 -49
- package/out/components/suggestions/suggestions.d.ts +2 -1
- package/out/components/suggestions/suggestions.lua +41 -50
- package/out/components/suggestions/util.d.ts +2 -2
- package/out/components/suggestions/util.lua +1 -0
- package/out/components/terminal/index.d.ts +1 -0
- package/out/{store/history → components/terminal}/init.lua +1 -1
- package/out/components/terminal/terminal-text-field.d.ts +11 -0
- package/out/components/terminal/terminal-text-field.lua +319 -0
- package/out/components/terminal/terminal.d.ts +2 -0
- package/out/components/terminal/terminal.lua +240 -0
- package/out/components/ui/frame.d.ts +17 -18
- package/out/components/ui/frame.lua +8 -10
- package/out/components/ui/group.d.ts +13 -15
- package/out/components/ui/group.lua +6 -9
- package/out/components/ui/layer.d.ts +5 -5
- package/out/components/ui/layer.lua +3 -3
- package/out/components/ui/outline.d.ts +13 -12
- package/out/components/ui/outline.lua +64 -54
- package/out/components/ui/padding.d.ts +7 -7
- package/out/components/ui/padding.lua +2 -2
- package/out/components/ui/scrolling-frame.d.ts +11 -12
- package/out/components/ui/scrolling-frame.lua +4 -9
- package/out/components/ui/text-field.d.ts +10 -9
- package/out/components/ui/text-field.lua +15 -13
- package/out/components/ui/text.d.ts +16 -16
- package/out/components/ui/text.lua +39 -38
- package/out/constants/springs.lua +1 -1
- package/out/hooks/use-api.d.ts +3 -0
- package/out/hooks/use-api.lua +18 -0
- package/out/hooks/use-atom.d.ts +2 -0
- package/out/hooks/use-atom.lua +17 -0
- package/out/hooks/use-debounce-source.d.ts +11 -0
- package/out/hooks/use-debounce-source.lua +27 -0
- package/out/hooks/use-event.d.ts +14 -0
- package/out/hooks/use-event.lua +58 -0
- package/out/hooks/use-history.d.ts +2 -0
- package/out/hooks/use-history.lua +56 -0
- package/out/hooks/use-motion.d.ts +4 -4
- package/out/hooks/use-motion.lua +11 -16
- package/out/hooks/use-px.d.ts +13 -1
- package/out/hooks/use-px.lua +52 -39
- package/out/store.d.ts +14 -0
- package/out/store.lua +44 -0
- package/out/types.d.ts +7 -4
- package/out/util/argument.d.ts +2 -1
- package/out/util/argument.lua +25 -0
- package/out/util/suggestion.d.ts +2 -2
- package/out/util/suggestion.lua +9 -14
- package/package.json +14 -14
- package/out/app/app.d.ts +0 -6
- package/out/app/app.lua +0 -83
- package/out/app/terminal-app.d.ts +0 -1
- package/out/app/terminal-app.lua +0 -61
- package/out/components/terminal-text-field.d.ts +0 -11
- package/out/components/terminal-text-field.lua +0 -289
- package/out/components/terminal-window.d.ts +0 -1
- package/out/components/terminal-window.lua +0 -265
- package/out/components/terminal.d.ts +0 -1
- package/out/components/terminal.lua +0 -26
- package/out/components/ui/shortcut-group.d.ts +0 -6
- package/out/components/ui/shortcut-group.lua +0 -100
- package/out/hooks/use-store.d.ts +0 -3
- package/out/hooks/use-store.lua +0 -7
- package/out/providers/api-provider.d.ts +0 -8
- package/out/providers/api-provider.lua +0 -17
- package/out/providers/options-provider.d.ts +0 -13
- package/out/providers/options-provider.lua +0 -39
- package/out/providers/root-provider.d.ts +0 -11
- package/out/providers/root-provider.lua +0 -24
- package/out/store/app/app-selectors.d.ts +0 -2
- package/out/store/app/app-selectors.lua +0 -7
- package/out/store/app/app-slice.d.ts +0 -8
- package/out/store/app/app-slice.lua +0 -17
- package/out/store/app/index.d.ts +0 -2
- package/out/store/app/init.lua +0 -10
- package/out/store/command/command-selectors.d.ts +0 -2
- package/out/store/command/command-selectors.lua +0 -7
- package/out/store/command/command-slice.d.ts +0 -15
- package/out/store/command/command-slice.lua +0 -21
- package/out/store/command/index.d.ts +0 -2
- package/out/store/command/init.lua +0 -10
- package/out/store/history/history-slice.d.ts +0 -11
- package/out/store/history/history-slice.lua +0 -52
- package/out/store/history/index.d.ts +0 -1
- package/out/store/index.d.ts +0 -46
- package/out/store/init.lua +0 -18
- package/out/store/suggestion/index.d.ts +0 -2
- package/out/store/suggestion/init.lua +0 -10
- package/out/store/suggestion/suggestion-selectors.d.ts +0 -2
- package/out/store/suggestion/suggestion-selectors.lua +0 -7
- package/out/store/suggestion/suggestion-slice.d.ts +0 -9
- package/out/store/suggestion/suggestion-slice.lua +0 -15
- package/out/store/text/index.d.ts +0 -2
- package/out/store/text/init.lua +0 -10
- package/out/store/text/text-selectors.d.ts +0 -3
- package/out/store/text/text-selectors.lua +0 -11
- package/out/store/text/text-slice.d.ts +0 -20
- 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
|
|
4
|
-
local
|
|
5
|
-
|
|
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
|
-
|
|
19
|
-
|
|
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
|
|
2
|
-
interface LayerProps extends
|
|
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):
|
|
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
|
|
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 (
|
|
10
|
+
return if IS_EDIT then (Vide.jsx(Group, {
|
|
11
11
|
visible = visible,
|
|
12
12
|
zIndex = displayOrder,
|
|
13
|
-
}, children)) else (
|
|
13
|
+
}, children)) else (Vide.jsx("screengui", {
|
|
14
14
|
Enabled = visible,
|
|
15
15
|
ResetOnSpawn = false,
|
|
16
16
|
DisplayOrder = displayOrder,
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
|
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
|
|
4
|
-
local
|
|
5
|
-
local
|
|
6
|
-
local
|
|
7
|
-
local
|
|
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
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
local
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
local
|
|
65
|
-
|
|
66
|
-
|
|
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
|
|
79
|
-
local outerStyle =
|
|
80
|
-
local transparency =
|
|
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
|
|
87
|
-
return
|
|
88
|
-
size =
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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 =
|
|
99
|
+
Transparency = function()
|
|
100
|
+
return innerStyle().transparency
|
|
101
|
+
end,
|
|
95
102
|
Thickness = innerThickness,
|
|
96
|
-
}, children)),
|
|
103
|
+
}, children)), Vide.jsx(Group, nil, Vide.jsx("uicorner", {
|
|
97
104
|
CornerRadius = cornerRadius,
|
|
98
|
-
}),
|
|
105
|
+
}), Vide.jsx("uistroke", {
|
|
99
106
|
Color = outerColor,
|
|
100
|
-
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 {
|
|
1
|
+
import Vide, { Derivable } from "@rbxts/vide";
|
|
2
2
|
interface Props {
|
|
3
|
-
all?:
|
|
4
|
-
left?:
|
|
5
|
-
right?:
|
|
6
|
-
top?:
|
|
7
|
-
bottom?:
|
|
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):
|
|
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
|
|
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
|
|
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 {
|
|
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?:
|
|
6
|
-
automaticCanvasSize?:
|
|
7
|
-
scrollingDirection?:
|
|
8
|
-
scrollBarThickness?:
|
|
9
|
-
scrollBarColor?:
|
|
10
|
-
scrollBarTransparency?:
|
|
11
|
-
scrollingEnabled?:
|
|
12
|
-
canvasSize?:
|
|
13
|
-
canvasPosition?:
|
|
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
|
|
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
|
|
4
|
-
local
|
|
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
|
-
|
|
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 {
|
|
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?:
|
|
6
|
-
placeholderText?:
|
|
7
|
-
placeholderColor?:
|
|
8
|
-
clearTextOnFocus?:
|
|
9
|
-
multiLine?:
|
|
10
|
-
textEditable?:
|
|
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
|
|
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
|
|
4
|
-
local
|
|
5
|
-
local
|
|
6
|
-
local
|
|
7
|
-
local
|
|
8
|
-
local TextField
|
|
9
|
-
local options =
|
|
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 =
|
|
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.
|
|
46
|
-
_attributes.
|
|
47
|
-
|
|
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 {
|
|
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?:
|
|
7
|
-
textColor?:
|
|
8
|
-
textSize?:
|
|
9
|
-
textTransparency?:
|
|
10
|
-
textWrapped?:
|
|
11
|
-
textXAlignment?:
|
|
12
|
-
textYAlignment?:
|
|
13
|
-
textTruncate?:
|
|
14
|
-
textScaled?:
|
|
15
|
-
textHeight?:
|
|
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?:
|
|
18
|
-
maxVisibleGraphemes?:
|
|
16
|
+
richText?: Derivable<boolean>;
|
|
17
|
+
maxVisibleGraphemes?: Derivable<number>;
|
|
18
|
+
textBoundsChanged?: (textBounds: Vector2) => void;
|
|
19
19
|
}
|
|
20
|
-
export declare
|
|
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
|
|
4
|
-
local
|
|
5
|
-
local
|
|
6
|
-
local
|
|
7
|
-
local
|
|
8
|
-
local
|
|
9
|
-
local Text
|
|
10
|
-
local
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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.
|
|
39
|
+
local _condition = props.backgroundTransparency
|
|
20
40
|
if _condition == nil then
|
|
21
|
-
_condition =
|
|
41
|
+
_condition = 1
|
|
22
42
|
end
|
|
23
|
-
_attributes.
|
|
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.
|
|
48
|
-
_attributes.
|
|
49
|
-
return
|
|
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,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,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
|
+
}
|