@rbxts/centurion-ui 1.0.7 → 2.0.0-rc.1
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 +60 -15
- package/centurion.luau +10 -0
- package/package.json +13 -23
- package/src/analyse/cursor.luau +25 -0
- package/src/analyse/highlight.luau +91 -0
- package/src/analyse/init.luau +318 -0
- package/src/analyse/leventine.luau +298 -0
- package/src/analyse/match.luau +39 -0
- package/src/analyse/suggest.luau +41 -0
- package/src/app/header.luau +128 -0
- package/src/app/history.luau +258 -0
- package/src/app/init.luau +699 -0
- package/src/app/suggestions.luau +419 -0
- package/src/button.luau +13 -0
- package/src/components/background.luau +37 -0
- package/src/components/container.luau +33 -0
- package/src/components/corner.luau +11 -0
- package/src/components/divider.luau +28 -0
- package/src/components/flex.luau +108 -0
- package/src/components/gap.luau +25 -0
- package/src/components/image.luau +33 -0
- package/src/components/padding.luau +59 -0
- package/src/components/stroke.luau +20 -0
- package/src/components/text.luau +57 -0
- package/src/components/textbox.luau +186 -0
- package/src/fade.luau +23 -0
- package/src/init.luau +142 -0
- package/src/input.luau +16 -0
- package/src/px.luau +68 -0
- package/src/rich.luau +14 -0
- package/src/state.luau +33 -0
- package/src/theme.luau +70 -0
- package/src/ts/index.d.ts +60 -0
- package/src/ts/init.luau +5 -0
- package/src/types.luau +85 -0
- package/vide/init.luau +8 -0
- package/vide/src/action.luau +25 -0
- package/vide/src/apply.luau +162 -0
- package/vide/src/batch.luau +23 -0
- package/vide/src/branch.luau +40 -0
- package/vide/src/changed.luau +18 -0
- package/vide/src/cleanup.luau +43 -0
- package/vide/src/context.luau +74 -0
- package/vide/src/create.luau +107 -0
- package/vide/src/defaults.luau +113 -0
- package/vide/src/derive.luau +18 -0
- package/vide/src/effect.luau +12 -0
- package/vide/src/flags.luau +12 -0
- package/vide/src/graph.luau +321 -0
- package/vide/src/implicit_effect.luau +125 -0
- package/vide/src/indexes.luau +121 -0
- package/vide/src/init.luau +10 -0
- package/vide/src/lib.luau +120 -0
- package/vide/src/mount.luau +11 -0
- package/vide/src/read.luau +5 -0
- package/vide/src/root.luau +35 -0
- package/vide/src/show.luau +36 -0
- package/vide/src/source.luau +31 -0
- package/vide/src/spring.luau +328 -0
- package/vide/src/switch.luau +114 -0
- package/vide/src/timeout.luau +27 -0
- package/vide/src/untrack.luau +25 -0
- package/vide/src/values.luau +131 -0
- package/out/app/centurion-app.d.ts +0 -3
- package/out/app/centurion-app.luau +0 -86
- package/out/app/index.d.ts +0 -32
- package/out/app/init.luau +0 -105
- package/out/components/history/history-line.d.ts +0 -9
- package/out/components/history/history-line.luau +0 -88
- package/out/components/history/history-list.d.ts +0 -11
- package/out/components/history/history-list.luau +0 -67
- package/out/components/history/index.d.ts +0 -1
- package/out/components/history/init.luau +0 -7
- package/out/components/index.d.ts +0 -2
- package/out/components/init.luau +0 -10
- package/out/components/suggestions/badge.d.ts +0 -16
- package/out/components/suggestions/badge.luau +0 -40
- package/out/components/suggestions/index.d.ts +0 -1
- package/out/components/suggestions/init.luau +0 -7
- package/out/components/suggestions/main-suggestion.d.ts +0 -9
- package/out/components/suggestions/main-suggestion.luau +0 -232
- package/out/components/suggestions/suggestion-list.d.ts +0 -8
- package/out/components/suggestions/suggestion-list.luau +0 -96
- package/out/components/suggestions/suggestions.d.ts +0 -2
- package/out/components/suggestions/suggestions.luau +0 -64
- package/out/components/suggestions/types.d.ts +0 -6
- package/out/components/suggestions/types.luau +0 -2
- package/out/components/suggestions/util.d.ts +0 -1
- package/out/components/suggestions/util.luau +0 -22
- package/out/components/terminal/command.d.ts +0 -6
- package/out/components/terminal/command.luau +0 -74
- package/out/components/terminal/index.d.ts +0 -1
- package/out/components/terminal/init.luau +0 -7
- package/out/components/terminal/suggestion.d.ts +0 -26
- package/out/components/terminal/suggestion.luau +0 -205
- package/out/components/terminal/terminal-text-field/index.d.ts +0 -1
- package/out/components/terminal/terminal-text-field/init.luau +0 -7
- package/out/components/terminal/terminal-text-field/suggestion.d.ts +0 -5
- package/out/components/terminal/terminal-text-field/suggestion.luau +0 -124
- package/out/components/terminal/terminal-text-field/terminal-text-field.d.ts +0 -13
- package/out/components/terminal/terminal-text-field/terminal-text-field.luau +0 -273
- package/out/components/terminal/terminal.d.ts +0 -2
- package/out/components/terminal/terminal.luau +0 -304
- package/out/components/ui/frame.d.ts +0 -17
- package/out/components/ui/frame.luau +0 -32
- package/out/components/ui/group.d.ts +0 -15
- package/out/components/ui/group.luau +0 -29
- package/out/components/ui/layer.d.ts +0 -8
- package/out/components/ui/layer.luau +0 -26
- package/out/components/ui/outline.d.ts +0 -15
- package/out/components/ui/outline.luau +0 -116
- package/out/components/ui/padding.d.ts +0 -10
- package/out/components/ui/padding.luau +0 -19
- package/out/components/ui/scrolling-frame.d.ts +0 -14
- package/out/components/ui/scrolling-frame.luau +0 -44
- package/out/components/ui/text-field.d.ts +0 -12
- package/out/components/ui/text-field.luau +0 -60
- package/out/components/ui/text.d.ts +0 -17
- package/out/components/ui/text.luau +0 -61
- package/out/constants/options.d.ts +0 -2
- package/out/constants/options.luau +0 -27
- package/out/constants/text.d.ts +0 -3
- package/out/constants/text.luau +0 -9
- package/out/constants/util.d.ts +0 -1
- package/out/constants/util.luau +0 -7
- package/out/hooks/use-client.d.ts +0 -2
- package/out/hooks/use-client.luau +0 -17
- package/out/hooks/use-event.d.ts +0 -14
- package/out/hooks/use-event.luau +0 -58
- package/out/hooks/use-px.d.ts +0 -19
- package/out/hooks/use-px.luau +0 -78
- package/out/index.d.ts +0 -2
- package/out/init.luau +0 -10
- package/out/palette.d.ts +0 -47
- package/out/palette.luau +0 -42
- package/out/store.d.ts +0 -12
- package/out/store.luau +0 -26
- package/out/types.d.ts +0 -44
- package/out/types.luau +0 -2
- package/out/utils/string.d.ts +0 -5
- package/out/utils/string.luau +0 -25
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
-- Compiled with roblox-ts v3.0.0
|
|
2
|
-
local TS = _G[script]
|
|
3
|
-
local Vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
|
|
4
|
-
local IS_EDIT = TS.import(script, script.Parent.Parent.Parent, "constants", "util").IS_EDIT
|
|
5
|
-
local Group = TS.import(script, script.Parent, "group").Group
|
|
6
|
-
local function Layer(_param)
|
|
7
|
-
local name = _param.name
|
|
8
|
-
local visible = _param.visible
|
|
9
|
-
local displayOrder = _param.displayOrder
|
|
10
|
-
local children = _param.children
|
|
11
|
-
return if IS_EDIT then (Vide.jsx(Group, {
|
|
12
|
-
name = name,
|
|
13
|
-
visible = visible,
|
|
14
|
-
zIndex = displayOrder,
|
|
15
|
-
}, children)) else (Vide.jsx("screengui", {
|
|
16
|
-
Enabled = visible,
|
|
17
|
-
ResetOnSpawn = false,
|
|
18
|
-
DisplayOrder = displayOrder,
|
|
19
|
-
IgnoreGuiInset = true,
|
|
20
|
-
ZIndexBehavior = "Sibling",
|
|
21
|
-
Name = name,
|
|
22
|
-
}, children))
|
|
23
|
-
end
|
|
24
|
-
return {
|
|
25
|
-
Layer = Layer,
|
|
26
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
}
|
|
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;
|
|
15
|
-
export {};
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
-- Compiled with roblox-ts v3.0.0
|
|
2
|
-
local TS = _G[script]
|
|
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
|
|
8
|
-
local Group = TS.import(script, script.Parent, "group").Group
|
|
9
|
-
local function ceilEven(n)
|
|
10
|
-
return math.ceil(n / 2) * 2
|
|
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
|
|
20
|
-
local DEFAULT_INNER_COLOR = Color3.new(1, 1, 1)
|
|
21
|
-
local DEFAULT_OUTER_COLOR = Color3.new(0, 0, 0)
|
|
22
|
-
local function Outline(_param)
|
|
23
|
-
local outlineTransparency = _param.outlineTransparency
|
|
24
|
-
if outlineTransparency == nil then
|
|
25
|
-
outlineTransparency = 0
|
|
26
|
-
end
|
|
27
|
-
local innerColor = _param.innerColor
|
|
28
|
-
if innerColor == nil then
|
|
29
|
-
innerColor = DEFAULT_INNER_COLOR
|
|
30
|
-
end
|
|
31
|
-
local outerColor = _param.outerColor
|
|
32
|
-
if outerColor == nil then
|
|
33
|
-
outerColor = DEFAULT_OUTER_COLOR
|
|
34
|
-
end
|
|
35
|
-
local innerTransparency = _param.innerTransparency
|
|
36
|
-
if innerTransparency == nil then
|
|
37
|
-
innerTransparency = 0.9
|
|
38
|
-
end
|
|
39
|
-
local outerTransparency = _param.outerTransparency
|
|
40
|
-
if outerTransparency == nil then
|
|
41
|
-
outerTransparency = 0.85
|
|
42
|
-
end
|
|
43
|
-
local innerThickness = _param.innerThickness
|
|
44
|
-
local outerThickness = _param.outerThickness
|
|
45
|
-
local cornerRadius = _param.cornerRadius
|
|
46
|
-
local children = _param.children
|
|
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)
|
|
73
|
-
return {
|
|
74
|
-
size = size,
|
|
75
|
-
position = position,
|
|
76
|
-
radius = radius,
|
|
77
|
-
transparency = transparency,
|
|
78
|
-
}
|
|
79
|
-
end)
|
|
80
|
-
local outerStyle = derive(function()
|
|
81
|
-
local transparency = math.clamp(blend(read(outlineTransparency), read(outerTransparency)), 0, 1)
|
|
82
|
-
return {
|
|
83
|
-
transparency = transparency,
|
|
84
|
-
}
|
|
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", {
|
|
98
|
-
Color = innerColor,
|
|
99
|
-
Transparency = function()
|
|
100
|
-
return innerStyle().transparency
|
|
101
|
-
end,
|
|
102
|
-
Thickness = innerThickness,
|
|
103
|
-
}, children)), Vide.jsx(Group, nil, Vide.jsx("uicorner", {
|
|
104
|
-
CornerRadius = cornerRadius,
|
|
105
|
-
}), Vide.jsx("uistroke", {
|
|
106
|
-
Color = outerColor,
|
|
107
|
-
Transparency = function()
|
|
108
|
-
return outerStyle().transparency
|
|
109
|
-
end,
|
|
110
|
-
Thickness = outerThickness,
|
|
111
|
-
}, children)))
|
|
112
|
-
end
|
|
113
|
-
return {
|
|
114
|
-
blend = blend,
|
|
115
|
-
Outline = Outline,
|
|
116
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import Vide, { Derivable } from "@rbxts/vide";
|
|
2
|
-
interface Props {
|
|
3
|
-
all?: Derivable<UDim>;
|
|
4
|
-
left?: Derivable<UDim>;
|
|
5
|
-
right?: Derivable<UDim>;
|
|
6
|
-
top?: Derivable<UDim>;
|
|
7
|
-
bottom?: Derivable<UDim>;
|
|
8
|
-
}
|
|
9
|
-
export declare function Padding({ all, left, right, top, bottom }: Props): Vide.Node;
|
|
10
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
-- Compiled with roblox-ts v3.0.0
|
|
2
|
-
local TS = _G[script]
|
|
3
|
-
local Vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
|
|
4
|
-
local function Padding(_param)
|
|
5
|
-
local all = _param.all
|
|
6
|
-
local left = _param.left
|
|
7
|
-
local right = _param.right
|
|
8
|
-
local top = _param.top
|
|
9
|
-
local bottom = _param.bottom
|
|
10
|
-
return Vide.jsx("uipadding", {
|
|
11
|
-
PaddingLeft = left or all,
|
|
12
|
-
PaddingRight = right or all,
|
|
13
|
-
PaddingTop = top or all,
|
|
14
|
-
PaddingBottom = bottom or all,
|
|
15
|
-
})
|
|
16
|
-
end
|
|
17
|
-
return {
|
|
18
|
-
Padding = Padding,
|
|
19
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import Vide, { Derivable, InferEnumNames } from "@rbxts/vide";
|
|
2
|
-
import { FrameProps } from "./frame";
|
|
3
|
-
export interface ScrollingFrameProps extends FrameProps<ScrollingFrame> {
|
|
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>;
|
|
13
|
-
}
|
|
14
|
-
export declare function ScrollingFrame(props: ScrollingFrameProps): Vide.Node;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
-- Compiled with roblox-ts v3.0.0
|
|
2
|
-
local TS = _G[script]
|
|
3
|
-
local Vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
|
|
4
|
-
local function ScrollingFrame(props)
|
|
5
|
-
local _attributes = {
|
|
6
|
-
AutomaticSize = props.automaticSize,
|
|
7
|
-
AutomaticCanvasSize = props.automaticCanvasSize,
|
|
8
|
-
ScrollingDirection = props.scrollingDirection,
|
|
9
|
-
ScrollBarThickness = props.scrollBarThickness,
|
|
10
|
-
ScrollBarImageColor3 = props.scrollBarColor,
|
|
11
|
-
ScrollBarImageTransparency = props.scrollBarTransparency,
|
|
12
|
-
ScrollingEnabled = props.scrollingEnabled,
|
|
13
|
-
CanvasSize = props.canvasSize,
|
|
14
|
-
CanvasPosition = props.canvasPosition,
|
|
15
|
-
Size = props.size,
|
|
16
|
-
Position = props.position,
|
|
17
|
-
AnchorPoint = props.anchor,
|
|
18
|
-
Rotation = props.rotation,
|
|
19
|
-
BackgroundColor3 = props.backgroundColor,
|
|
20
|
-
}
|
|
21
|
-
local _condition = props.backgroundTransparency
|
|
22
|
-
if _condition == nil then
|
|
23
|
-
_condition = 1
|
|
24
|
-
end
|
|
25
|
-
_attributes.BackgroundTransparency = _condition
|
|
26
|
-
_attributes.ClipsDescendants = props.clipsDescendants
|
|
27
|
-
_attributes.Visible = props.visible
|
|
28
|
-
_attributes.ZIndex = props.zIndex
|
|
29
|
-
_attributes.LayoutOrder = props.layoutOrder
|
|
30
|
-
_attributes.BorderSizePixel = 0
|
|
31
|
-
_attributes.action = props.action
|
|
32
|
-
local _attribute = props.native
|
|
33
|
-
if _attribute then
|
|
34
|
-
for _k, _v in _attribute do
|
|
35
|
-
_attributes[_k] = _v
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
return Vide.jsx("scrollingframe", _attributes, props.cornerRadius and Vide.jsx("uicorner", {
|
|
39
|
-
CornerRadius = props.cornerRadius,
|
|
40
|
-
}), props.children)
|
|
41
|
-
end
|
|
42
|
-
return {
|
|
43
|
-
ScrollingFrame = ScrollingFrame,
|
|
44
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import Vide, { Derivable } from "@rbxts/vide";
|
|
2
|
-
import { TextProps } from "./text";
|
|
3
|
-
interface TextFieldProps extends TextProps<TextBox> {
|
|
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
|
-
}
|
|
11
|
-
export declare function TextField(props: TextFieldProps): Vide.Node;
|
|
12
|
-
export {};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
-- Compiled with roblox-ts v3.0.0
|
|
2
|
-
local TS = _G[script]
|
|
3
|
-
local _vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
|
|
4
|
-
local Vide = _vide
|
|
5
|
-
local read = _vide.read
|
|
6
|
-
local options = TS.import(script, script.Parent.Parent.Parent, "store").options
|
|
7
|
-
local function TextField(props)
|
|
8
|
-
local _attributes = {
|
|
9
|
-
PlaceholderText = props.placeholderText,
|
|
10
|
-
PlaceholderColor3 = props.placeholderColor,
|
|
11
|
-
ClearTextOnFocus = props.clearTextOnFocus,
|
|
12
|
-
MultiLine = props.multiLine,
|
|
13
|
-
TextEditable = props.textEditable,
|
|
14
|
-
Font = Enum.Font.Unknown,
|
|
15
|
-
FontFace = function()
|
|
16
|
-
return read(props.font) or options().font.regular
|
|
17
|
-
end,
|
|
18
|
-
Text = props.text,
|
|
19
|
-
TextColor3 = props.textColor,
|
|
20
|
-
TextSize = props.textSize,
|
|
21
|
-
TextTransparency = props.textTransparency,
|
|
22
|
-
TextTruncate = props.textTruncate,
|
|
23
|
-
TextWrapped = props.textWrapped,
|
|
24
|
-
TextXAlignment = props.textXAlignment,
|
|
25
|
-
TextYAlignment = props.textYAlignment,
|
|
26
|
-
TextScaled = props.textScaled,
|
|
27
|
-
RichText = props.richText,
|
|
28
|
-
AutomaticSize = props.automaticSize,
|
|
29
|
-
AutoLocalize = function()
|
|
30
|
-
return options().autoLocalize
|
|
31
|
-
end,
|
|
32
|
-
Size = props.size,
|
|
33
|
-
Position = props.position,
|
|
34
|
-
AnchorPoint = props.anchor,
|
|
35
|
-
BackgroundColor3 = props.backgroundColor,
|
|
36
|
-
}
|
|
37
|
-
local _condition = props.backgroundTransparency
|
|
38
|
-
if _condition == nil then
|
|
39
|
-
_condition = 1
|
|
40
|
-
end
|
|
41
|
-
_attributes.BackgroundTransparency = _condition
|
|
42
|
-
_attributes.ClipsDescendants = props.clipsDescendants
|
|
43
|
-
_attributes.Visible = props.visible
|
|
44
|
-
_attributes.ZIndex = props.zIndex
|
|
45
|
-
_attributes.LayoutOrder = props.layoutOrder
|
|
46
|
-
_attributes.BorderSizePixel = 0
|
|
47
|
-
_attributes.action = props.action
|
|
48
|
-
local _attribute = props.native
|
|
49
|
-
if _attribute then
|
|
50
|
-
for _k, _v in _attribute do
|
|
51
|
-
_attributes[_k] = _v
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
return Vide.jsx("textbox", _attributes, props.cornerRadius and Vide.jsx("uicorner", {
|
|
55
|
-
CornerRadius = props.cornerRadius,
|
|
56
|
-
}), props.children)
|
|
57
|
-
end
|
|
58
|
-
return {
|
|
59
|
-
TextField = TextField,
|
|
60
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import Vide, { Derivable, InferEnumNames } from "@rbxts/vide";
|
|
2
|
-
import { FrameProps } from "./frame";
|
|
3
|
-
export interface TextProps<T extends Instance = TextLabel> extends FrameProps<T> {
|
|
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>;
|
|
15
|
-
richText?: Derivable<boolean>;
|
|
16
|
-
}
|
|
17
|
-
export declare function Text(props: TextProps): Vide.Node;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
-- Compiled with roblox-ts v3.0.0
|
|
2
|
-
local TS = _G[script]
|
|
3
|
-
local _vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
|
|
4
|
-
local Vide = _vide
|
|
5
|
-
local read = _vide.read
|
|
6
|
-
local px = TS.import(script, script.Parent.Parent.Parent, "hooks", "use-px").px
|
|
7
|
-
local options = TS.import(script, script.Parent.Parent.Parent, "store").options
|
|
8
|
-
local function Text(props)
|
|
9
|
-
local _attributes = {
|
|
10
|
-
FontFace = function()
|
|
11
|
-
return read(props.font) or options().font.regular
|
|
12
|
-
end,
|
|
13
|
-
Text = props.text,
|
|
14
|
-
TextColor3 = props.textColor,
|
|
15
|
-
TextSize = function()
|
|
16
|
-
local _condition = read(props.textSize)
|
|
17
|
-
if _condition == nil then
|
|
18
|
-
_condition = px(16)
|
|
19
|
-
end
|
|
20
|
-
return _condition
|
|
21
|
-
end,
|
|
22
|
-
TextTransparency = props.textTransparency,
|
|
23
|
-
TextWrapped = props.textWrapped,
|
|
24
|
-
TextXAlignment = props.textXAlignment,
|
|
25
|
-
TextYAlignment = props.textYAlignment,
|
|
26
|
-
TextTruncate = props.textTruncate,
|
|
27
|
-
TextScaled = props.textScaled,
|
|
28
|
-
LineHeight = props.textHeight,
|
|
29
|
-
RichText = props.richText,
|
|
30
|
-
Size = props.size,
|
|
31
|
-
AutomaticSize = props.automaticSize,
|
|
32
|
-
AutoLocalize = function()
|
|
33
|
-
return options().autoLocalize
|
|
34
|
-
end,
|
|
35
|
-
Position = props.position,
|
|
36
|
-
AnchorPoint = props.anchor,
|
|
37
|
-
BackgroundColor3 = props.backgroundColor,
|
|
38
|
-
}
|
|
39
|
-
local _condition = props.backgroundTransparency
|
|
40
|
-
if _condition == nil then
|
|
41
|
-
_condition = 1
|
|
42
|
-
end
|
|
43
|
-
_attributes.BackgroundTransparency = _condition
|
|
44
|
-
_attributes.ClipsDescendants = props.clipsDescendants
|
|
45
|
-
_attributes.Visible = props.visible
|
|
46
|
-
_attributes.ZIndex = props.zIndex
|
|
47
|
-
_attributes.LayoutOrder = props.layoutOrder
|
|
48
|
-
_attributes.action = props.action
|
|
49
|
-
local _attribute = props.native
|
|
50
|
-
if _attribute then
|
|
51
|
-
for _k, _v in _attribute do
|
|
52
|
-
_attributes[_k] = _v
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
return Vide.jsx("textlabel", _attributes, props.cornerRadius and Vide.jsx("uicorner", {
|
|
56
|
-
CornerRadius = props.cornerRadius,
|
|
57
|
-
}), props.children)
|
|
58
|
-
end
|
|
59
|
-
return {
|
|
60
|
-
Text = Text,
|
|
61
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
-- Compiled with roblox-ts v3.0.0
|
|
2
|
-
local TS = _G[script]
|
|
3
|
-
local GuiService = TS.import(script, TS.getModule(script, "@rbxts", "services")).GuiService
|
|
4
|
-
local DefaultPalette = TS.import(script, script.Parent.Parent, "palette").DefaultPalette
|
|
5
|
-
local DEFAULT_INTERFACE_OPTIONS = {
|
|
6
|
-
anchor = Vector2.new(),
|
|
7
|
-
position = function(px)
|
|
8
|
-
return UDim2.fromOffset(px(16), px(8) + (GuiService:GetGuiInset()).Y)
|
|
9
|
-
end,
|
|
10
|
-
size = function(px)
|
|
11
|
-
return UDim2.new(0, px(1024), 1, 0)
|
|
12
|
-
end,
|
|
13
|
-
displayOrder = 1000,
|
|
14
|
-
backgroundTransparency = 0.2,
|
|
15
|
-
hideOnLostFocus = true,
|
|
16
|
-
activationKeys = { Enum.KeyCode.F2 },
|
|
17
|
-
font = {
|
|
18
|
-
regular = Font.new("rbxassetid://16658221428"),
|
|
19
|
-
medium = Font.new("rbxassetid://16658221428", Enum.FontWeight.Medium),
|
|
20
|
-
bold = Font.new("rbxassetid://16658221428", Enum.FontWeight.Bold),
|
|
21
|
-
},
|
|
22
|
-
palette = DefaultPalette.mocha,
|
|
23
|
-
autoLocalize = false,
|
|
24
|
-
}
|
|
25
|
-
return {
|
|
26
|
-
DEFAULT_INTERFACE_OPTIONS = DEFAULT_INTERFACE_OPTIONS,
|
|
27
|
-
}
|
package/out/constants/text.d.ts
DELETED
package/out/constants/text.luau
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
-- Compiled with roblox-ts v3.0.0
|
|
2
|
-
local HISTORY_TEXT_SIZE = 18
|
|
3
|
-
local SUGGESTION_TITLE_TEXT_SIZE = 26
|
|
4
|
-
local SUGGESTION_TEXT_SIZE = 20
|
|
5
|
-
return {
|
|
6
|
-
HISTORY_TEXT_SIZE = HISTORY_TEXT_SIZE,
|
|
7
|
-
SUGGESTION_TITLE_TEXT_SIZE = SUGGESTION_TITLE_TEXT_SIZE,
|
|
8
|
-
SUGGESTION_TEXT_SIZE = SUGGESTION_TEXT_SIZE,
|
|
9
|
-
}
|
package/out/constants/util.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const IS_EDIT: boolean;
|
package/out/constants/util.luau
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
-- Compiled with roblox-ts v3.0.0
|
|
2
|
-
local TS = _G[script]
|
|
3
|
-
local source = TS.import(script, TS.getModule(script, "@rbxts", "vide").src).source
|
|
4
|
-
local clientState = source()
|
|
5
|
-
local function useClient(client)
|
|
6
|
-
local value = clientState()
|
|
7
|
-
if value ~= nil then
|
|
8
|
-
return value
|
|
9
|
-
end
|
|
10
|
-
local _arg0 = client ~= nil
|
|
11
|
-
assert(_arg0, "No client has been set.")
|
|
12
|
-
clientState(client)
|
|
13
|
-
return client
|
|
14
|
-
end
|
|
15
|
-
return {
|
|
16
|
-
useClient = useClient,
|
|
17
|
-
}
|
package/out/hooks/use-event.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
type EventLike<T extends Callback = Callback> = {
|
|
2
|
-
Connect(callback: T): ConnectionLike;
|
|
3
|
-
} | {
|
|
4
|
-
connect(callback: T): ConnectionLike;
|
|
5
|
-
} | {
|
|
6
|
-
subscribe(callback: T): ConnectionLike;
|
|
7
|
-
};
|
|
8
|
-
type ConnectionLike = {
|
|
9
|
-
Disconnect(): void;
|
|
10
|
-
} | {
|
|
11
|
-
disconnect(): void;
|
|
12
|
-
} | (() => void);
|
|
13
|
-
export declare function useEvent<T extends EventLike>(event: T, listener: T extends EventLike<infer U> ? U : never): void;
|
|
14
|
-
export {};
|
package/out/hooks/use-event.luau
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
-- Compiled with roblox-ts v3.0.0
|
|
2
|
-
local TS = _G[script]
|
|
3
|
-
local cleanup = TS.import(script, TS.getModule(script, "@rbxts", "vide").src).cleanup
|
|
4
|
-
local connect = function(event, callback)
|
|
5
|
-
local _event = event
|
|
6
|
-
if typeof(_event) == "RBXScriptSignal" then
|
|
7
|
-
-- With deferred events, a "hard disconnect" is necessary to avoid causing
|
|
8
|
-
-- state updates after a component unmounts. Use 'Connected' to check if
|
|
9
|
-
-- the connection is still valid before invoking the callback.
|
|
10
|
-
-- https://devforum.roblox.com/t/deferred-engine-events/2276564/99
|
|
11
|
-
local connection
|
|
12
|
-
connection = event:Connect(function(...)
|
|
13
|
-
local args = { ... }
|
|
14
|
-
if connection.Connected then
|
|
15
|
-
return callback(unpack(args))
|
|
16
|
-
end
|
|
17
|
-
end)
|
|
18
|
-
return connection
|
|
19
|
-
end
|
|
20
|
-
if event.Connect ~= nil then
|
|
21
|
-
return event:Connect(callback)
|
|
22
|
-
end
|
|
23
|
-
if event.connect ~= nil then
|
|
24
|
-
return event:connect(callback)
|
|
25
|
-
end
|
|
26
|
-
if event.subscribe ~= nil then
|
|
27
|
-
return event:subscribe(callback)
|
|
28
|
-
end
|
|
29
|
-
error("Event-like object does not have a supported connect method.")
|
|
30
|
-
end
|
|
31
|
-
local disconnect = function(connection)
|
|
32
|
-
local _connection = connection
|
|
33
|
-
if type(_connection) == "function" then
|
|
34
|
-
connection()
|
|
35
|
-
else
|
|
36
|
-
local _connection_1 = connection
|
|
37
|
-
local _condition = typeof(_connection_1) == "RBXScriptConnection"
|
|
38
|
-
if not _condition then
|
|
39
|
-
_condition = connection.Disconnect ~= nil
|
|
40
|
-
end
|
|
41
|
-
if _condition then
|
|
42
|
-
connection:Disconnect()
|
|
43
|
-
elseif connection.disconnect ~= nil then
|
|
44
|
-
connection:disconnect()
|
|
45
|
-
else
|
|
46
|
-
error("Connection-like object does not have a supported disconnect method.")
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
local function useEvent(event, listener)
|
|
51
|
-
local connection = connect(event, listener)
|
|
52
|
-
cleanup(function()
|
|
53
|
-
disconnect(connection)
|
|
54
|
-
end)
|
|
55
|
-
end
|
|
56
|
-
return {
|
|
57
|
-
useEvent = useEvent,
|
|
58
|
-
}
|
package/out/hooks/use-px.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Rounds and scales a number to the current `px` unit. Includes additional
|
|
3
|
-
* methods for edge cases.
|
|
4
|
-
*
|
|
5
|
-
* @param value The number to scale.
|
|
6
|
-
* @returns A number in scaled `px` units.
|
|
7
|
-
*/
|
|
8
|
-
export declare const px: ((value: number) => number) & {
|
|
9
|
-
even: (value: number) => number;
|
|
10
|
-
scale: (value: number) => number;
|
|
11
|
-
floor: (value: number) => number;
|
|
12
|
-
ceil: (value: number) => number;
|
|
13
|
-
};
|
|
14
|
-
export type ScaleFunction = typeof px;
|
|
15
|
-
/**
|
|
16
|
-
* Scales the current `px` unit based on the current viewport size. Should be
|
|
17
|
-
* called once when mounting the app.
|
|
18
|
-
*/
|
|
19
|
-
export declare function usePx(): void;
|
package/out/hooks/use-px.luau
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
-- Compiled with roblox-ts v3.0.0
|
|
2
|
-
local TS = _G[script]
|
|
3
|
-
local Workspace = TS.import(script, TS.getModule(script, "@rbxts", "services")).Workspace
|
|
4
|
-
local _vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
|
|
5
|
-
local cleanup = _vide.cleanup
|
|
6
|
-
local source = _vide.source
|
|
7
|
-
local BASE_RESOLUTION = Vector2.new(1280, 832)
|
|
8
|
-
local MIN_SCALE = 0.5
|
|
9
|
-
local DOMINANT_AXIS = 0.5
|
|
10
|
-
local scale = source(1)
|
|
11
|
-
--[[
|
|
12
|
-
*
|
|
13
|
-
* Assigns a call signature to an object.
|
|
14
|
-
*
|
|
15
|
-
* @param callback The function to assign.
|
|
16
|
-
* @param object The object to assign the function to.
|
|
17
|
-
* @returns A callable object.
|
|
18
|
-
|
|
19
|
-
]]
|
|
20
|
-
local function callable(callback, object)
|
|
21
|
-
return setmetatable(object, {
|
|
22
|
-
__call = function(_, ...)
|
|
23
|
-
local args = { ... }
|
|
24
|
-
return callback(unpack(args))
|
|
25
|
-
end,
|
|
26
|
-
})
|
|
27
|
-
end
|
|
28
|
-
--[[
|
|
29
|
-
*
|
|
30
|
-
* Rounds and scales a number to the current `px` unit. Includes additional
|
|
31
|
-
* methods for edge cases.
|
|
32
|
-
*
|
|
33
|
-
* @param value The number to scale.
|
|
34
|
-
* @returns A number in scaled `px` units.
|
|
35
|
-
|
|
36
|
-
]]
|
|
37
|
-
local px = callable(function(value)
|
|
38
|
-
return math.round(value * scale())
|
|
39
|
-
end, {
|
|
40
|
-
even = function(value)
|
|
41
|
-
return math.round(value * scale() * 0.5) * 2
|
|
42
|
-
end,
|
|
43
|
-
scale = function(value)
|
|
44
|
-
return value * scale()
|
|
45
|
-
end,
|
|
46
|
-
floor = function(value)
|
|
47
|
-
return math.floor(value * scale())
|
|
48
|
-
end,
|
|
49
|
-
ceil = function(value)
|
|
50
|
-
return math.ceil(value * scale())
|
|
51
|
-
end,
|
|
52
|
-
})
|
|
53
|
-
--[[
|
|
54
|
-
*
|
|
55
|
-
* Scales the current `px` unit based on the current viewport size. Should be
|
|
56
|
-
* called once when mounting the app.
|
|
57
|
-
|
|
58
|
-
]]
|
|
59
|
-
local function usePx()
|
|
60
|
-
local camera = Workspace.CurrentCamera
|
|
61
|
-
local _arg0 = camera ~= nil
|
|
62
|
-
assert(_arg0, "CurrentCamera is not set")
|
|
63
|
-
local updateScale = function()
|
|
64
|
-
local width = math.log(camera.ViewportSize.X / BASE_RESOLUTION.X, 2)
|
|
65
|
-
local height = math.log(camera.ViewportSize.Y / BASE_RESOLUTION.Y, 2)
|
|
66
|
-
local centered = width + (height - width) * DOMINANT_AXIS
|
|
67
|
-
scale(math.max(2 ^ centered, MIN_SCALE))
|
|
68
|
-
end
|
|
69
|
-
local connection = camera:GetPropertyChangedSignal("ViewportSize"):Connect(function()
|
|
70
|
-
updateScale()
|
|
71
|
-
end)
|
|
72
|
-
cleanup(connection)
|
|
73
|
-
updateScale()
|
|
74
|
-
end
|
|
75
|
-
return {
|
|
76
|
-
usePx = usePx,
|
|
77
|
-
px = px,
|
|
78
|
-
}
|
package/out/index.d.ts
DELETED
package/out/init.luau
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
-- Compiled with roblox-ts v3.0.0
|
|
2
|
-
local TS = _G[script]
|
|
3
|
-
local exports = {}
|
|
4
|
-
for _k, _v in TS.import(script, script, "app") or {} do
|
|
5
|
-
exports[_k] = _v
|
|
6
|
-
end
|
|
7
|
-
for _k, _v in TS.import(script, script, "palette") or {} do
|
|
8
|
-
exports[_k] = _v
|
|
9
|
-
end
|
|
10
|
-
return exports
|