@rbxts/uiblox 0.2.0-alpha.37 → 0.2.0-alpha.38
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 +1 -18
- package/out/theme/constants/NumberConstants.d.ts +10 -0
- package/out/theme/constants/NumberConstants.luau +12 -0
- package/out/theme/interfaces/density/controlMetrics.luau +2 -2
- package/out/theme/interfaces/palette/Palette.d.ts +7 -0
- package/out/theme/interfaces/spacing/Shape.d.ts +6 -0
- package/out/theme/interfaces/theme/Theme.d.ts +6 -0
- package/out/theme/interfaces/typography/FontFamilies.luau +1 -0
- package/out/theme/interfaces/typography/FontFamilyOptions.d.ts +1 -1
- package/out/theme/interfaces/typography/FontSizeOptions.d.ts +1 -1
- package/out/theme/interfaces/typography/FontSizes.luau +2 -0
- package/out/theme/interfaces/typography/Variants.d.ts +3 -1
- package/out/theme/interfaces/typography/Variants.luau +25 -1
- package/out/theme/styles/utilities/focusRing.d.ts +2 -0
- package/out/theme/styles/utilities/focusRing.luau +3 -0
- package/out/theme/styles/utilities/index.d.ts +1 -1
- package/out/theme/styles/utilities/init.luau +3 -1
- package/out/theme/themes/DarkTheme.luau +4 -0
- package/out/theme/themes/LightTheme.luau +4 -0
- package/out/theme/themes/createPalette.luau +15 -0
- package/out/ui/packages/accordion/components/Accordion.luau +84 -40
- package/out/ui/packages/accordion/components/Accordion.styles.luau +35 -17
- package/out/ui/packages/alert/components/Alert.luau +15 -11
- package/out/ui/packages/alert/components/Alert.styles.luau +37 -26
- package/out/ui/packages/appBar/components/AppBar.luau +35 -13
- package/out/ui/packages/appBar/components/AppBar.styles.luau +41 -35
- package/out/ui/packages/autocomplete/components/Autocomplete.luau +4 -0
- package/out/ui/packages/avatar/components/Avatar.d.ts +2 -0
- package/out/ui/packages/avatar/components/Avatar.luau +9 -2
- package/out/ui/packages/avatar/components/Avatar.styles.luau +7 -0
- package/out/ui/packages/avatarGroup/components/AvatarGroup.luau +9 -4
- package/out/ui/packages/avatarGroup/components/AvatarGroup.styles.luau +6 -1
- package/out/ui/packages/badge/components/Badge.luau +14 -11
- package/out/ui/packages/badge/components/Badge.styles.luau +5 -1
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +4 -3
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +6 -2
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.styles.luau +4 -0
- package/out/ui/packages/brickColorPicker/components/BrickColorPicker.luau +20 -2
- package/out/ui/packages/brickColorPicker/components/BrickColorPicker.styles.luau +72 -66
- package/out/ui/packages/button/components/Button.luau +61 -34
- package/out/ui/packages/button/components/buttonPaint.d.ts +16 -0
- package/out/ui/packages/button/components/buttonPaint.luau +70 -0
- package/out/ui/packages/buttonGroup/components/ButtonGroup.d.ts +1 -0
- package/out/ui/packages/buttonGroup/components/ButtonGroup.luau +17 -2
- package/out/ui/packages/card/components/Card.styles.luau +4 -2
- package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +9 -1
- package/out/ui/packages/cframeEditor/components/CFrameEditor.styles.luau +50 -41
- package/out/ui/packages/checkbox/components/Checkbox.luau +5 -4
- package/out/ui/packages/checkbox/components/checkboxLook.d.ts +2 -2
- package/out/ui/packages/checkbox/components/checkboxLook.luau +2 -2
- package/out/ui/packages/chip/components/Chip.luau +16 -14
- package/out/ui/packages/chip/components/Chip.styles.luau +7 -4
- package/out/ui/packages/circularProgress/components/CircularProgress.luau +10 -3
- package/out/ui/packages/codeEditor/components/CodeEditor.d.ts +12 -0
- package/out/ui/packages/codeEditor/components/CodeEditor.luau +262 -0
- package/out/ui/packages/codeEditor/components/CodeEditor.styles.d.ts +6 -0
- package/out/ui/packages/codeEditor/components/CodeEditor.styles.luau +124 -0
- package/out/ui/packages/codeEditor/highlightCode.d.ts +11 -0
- package/out/ui/packages/codeEditor/highlightCode.luau +503 -0
- package/out/ui/packages/codeEditor/index.d.ts +2 -0
- package/out/ui/packages/codeEditor/init.luau +5 -0
- package/out/ui/packages/colorPicker/components/ColorPicker.luau +9 -1
- package/out/ui/packages/colorPicker/components/ColorPicker.styles.luau +74 -67
- package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +12 -4
- package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +12 -4
- package/out/ui/packages/dateRange/components/DateRangePicker.luau +31 -19
- package/out/ui/packages/dialog/components/Dialog.styles.luau +4 -2
- package/out/ui/packages/divider/components/Divider.luau +3 -1
- package/out/ui/packages/divider/components/Divider.styles.luau +1 -0
- package/out/ui/packages/drawer/components/Drawer.d.ts +1 -0
- package/out/ui/packages/drawer/components/Drawer.luau +43 -14
- package/out/ui/packages/drawer/components/Drawer.styles.luau +13 -5
- package/out/ui/packages/drawer/components/drawerPlacement.d.ts +2 -0
- package/out/ui/packages/drawer/components/drawerPlacement.luau +18 -0
- package/out/ui/packages/editorFace.d.ts +22 -0
- package/out/ui/packages/editorFace.luau +49 -0
- package/out/ui/packages/fab/components/Fab.luau +19 -6
- package/out/ui/packages/fab/components/Fab.styles.luau +4 -3
- package/out/ui/packages/fab/components/fabSize.d.ts +1 -1
- package/out/ui/packages/fontEditor/components/FontEditor.luau +13 -3
- package/out/ui/packages/fontEditor/components/FontEditor.styles.luau +36 -27
- package/out/ui/packages/gradientEditor/components/GradientEditor.luau +21 -13
- package/out/ui/packages/gradientEditor/components/GradientEditor.styles.luau +52 -44
- package/out/ui/packages/icon/components/DrawnGlyph.d.ts +11 -0
- package/out/ui/packages/icon/components/DrawnGlyph.luau +87 -0
- package/out/ui/packages/icon/components/Icon.d.ts +6 -2
- package/out/ui/packages/icon/components/Icon.luau +23 -3
- package/out/ui/packages/icon/components/Icon.styles.luau +3 -0
- package/out/ui/packages/icon/components/glyphs.d.ts +28 -0
- package/out/ui/packages/icon/components/glyphs.luau +64 -0
- package/out/ui/packages/icon/index.d.ts +1 -0
- package/out/ui/packages/iconButton/components/IconButton.d.ts +5 -2
- package/out/ui/packages/iconButton/components/IconButton.luau +83 -16
- package/out/ui/packages/iconButton/components/IconButton.styles.luau +4 -27
- package/out/ui/packages/iconButton/components/iconButtonBox.d.ts +11 -0
- package/out/ui/packages/iconButton/components/iconButtonBox.luau +48 -0
- package/out/ui/packages/iconButton/components/transportGlyph.d.ts +1 -0
- package/out/ui/packages/iconButton/components/transportGlyph.luau +4 -0
- package/out/ui/packages/imageList/components/ImageList.luau +11 -36
- package/out/ui/packages/imageList/components/ImageList.styles.luau +1 -0
- package/out/ui/packages/imageList/components/imageListLayout.d.ts +0 -2
- package/out/ui/packages/imageList/components/imageListLayout.luau +0 -8
- package/out/ui/packages/index.d.ts +1 -0
- package/out/ui/packages/init.luau +3 -0
- package/out/ui/packages/input/components/Input.luau +46 -29
- package/out/ui/packages/input/components/Input.styles.luau +8 -11
- package/out/ui/packages/input/components/fieldChrome.d.ts +5 -0
- package/out/ui/packages/input/components/fieldChrome.luau +11 -0
- package/out/ui/packages/layout/components/Box.luau +92 -13
- package/out/ui/packages/layout/components/Box.styles.d.ts +0 -2
- package/out/ui/packages/layout/components/Box.styles.luau +0 -9
- package/out/ui/packages/layout/components/Grid.luau +81 -16
- package/out/ui/packages/layout/components/Pad.d.ts +24 -0
- package/out/ui/packages/layout/components/Pad.luau +88 -0
- package/out/ui/packages/layout/components/Stack.luau +79 -13
- package/out/ui/packages/link/components/Link.luau +19 -13
- package/out/ui/packages/link/components/Link.styles.luau +10 -1
- package/out/ui/packages/listItem/components/ListItem.luau +61 -4
- package/out/ui/packages/listItem/components/ListItem.styles.d.ts +1 -0
- package/out/ui/packages/listItem/components/ListItem.styles.luau +28 -11
- package/out/ui/packages/listItem/components/listItemInk.d.ts +1 -1
- package/out/ui/packages/listItem/components/listItemLayout.d.ts +12 -2
- package/out/ui/packages/listItem/components/listItemLayout.luau +29 -2
- package/out/ui/packages/markdown/components/Markdown.luau +163 -50
- package/out/ui/packages/markdown/components/Markdown.styles.luau +125 -76
- package/out/ui/packages/markdown/components/MarkdownEditor.luau +215 -146
- package/out/ui/packages/markdown/components/MarkdownEditor.styles.d.ts +1 -0
- package/out/ui/packages/markdown/components/MarkdownEditor.styles.luau +153 -83
- package/out/ui/packages/markdown/index.d.ts +1 -1
- package/out/ui/packages/markdown/parseMarkdown.d.ts +9 -1
- package/out/ui/packages/markdown/parseMarkdown.luau +350 -29
- package/out/ui/packages/menu/components/Menu.d.ts +1 -1
- package/out/ui/packages/menu/components/Menu.luau +12 -11
- package/out/ui/packages/menu/components/Menu.styles.luau +6 -1
- package/out/ui/packages/menu/components/menuIcon.d.ts +1 -1
- package/out/ui/packages/numberInput/components/NumberInput.luau +19 -4
- package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.luau +9 -1
- package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.styles.luau +23 -16
- package/out/ui/packages/pager/components/Pager.luau +15 -13
- package/out/ui/packages/pager/components/Pager.styles.luau +5 -0
- package/out/ui/packages/pagination/components/Pagination.styles.luau +4 -1
- package/out/ui/packages/paper/components/Paper.luau +17 -11
- package/out/ui/packages/paper/components/Paper.styles.luau +12 -5
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +9 -1
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.styles.luau +24 -19
- package/out/ui/packages/popover/components/Popover.d.ts +1 -1
- package/out/ui/packages/popover/components/Popover.luau +6 -4
- package/out/ui/packages/popover/components/Popover.styles.luau +6 -0
- package/out/ui/packages/popup/components/Popup.d.ts +2 -0
- package/out/ui/packages/popup/components/Popup.luau +64 -2
- package/out/ui/packages/popup/components/placement.luau +6 -4
- package/out/ui/packages/progressBar/components/ProgressBar.luau +1 -1
- package/out/ui/packages/progressBar/components/ProgressBar.styles.luau +3 -2
- package/out/ui/packages/radioGroup/components/RadioGroup.luau +2 -1
- package/out/ui/packages/rating/components/Rating.luau +45 -3
- package/out/ui/packages/rating/components/Rating.styles.luau +1 -1
- package/out/ui/packages/rayEditor/components/RayEditor.luau +9 -1
- package/out/ui/packages/rayEditor/components/RayEditor.styles.luau +17 -11
- package/out/ui/packages/rectEditor/components/RectEditor.luau +9 -1
- package/out/ui/packages/rectEditor/components/RectEditor.styles.luau +49 -42
- package/out/ui/packages/select/components/Select.d.ts +2 -0
- package/out/ui/packages/select/components/Select.luau +148 -106
- package/out/ui/packages/select/components/Select.styles.d.ts +2 -0
- package/out/ui/packages/select/components/Select.styles.luau +29 -5
- package/out/ui/packages/shadow/components/Shadow.luau +188 -19
- package/out/ui/packages/sidebar/components/Sidebar.styles.luau +1 -0
- package/out/ui/packages/skeleton/components/Skeleton.luau +4 -0
- package/out/ui/packages/slider/components/RangeSlider.luau +6 -5
- package/out/ui/packages/slider/components/Slider.luau +11 -16
- package/out/ui/packages/sparkline/components/Sparkline.luau +7 -5
- package/out/ui/packages/speedDial/components/SpeedDial.luau +4 -1
- package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +5 -0
- package/out/ui/packages/speedDial/components/speedDialLabel.d.ts +1 -1
- package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
- package/out/ui/packages/stepper/components/Stepper.styles.luau +9 -6
- package/out/ui/packages/switch/components/Switch.luau +2 -2
- package/out/ui/packages/switch/components/switchLook.d.ts +3 -3
- package/out/ui/packages/switch/components/switchLook.luau +4 -10
- package/out/ui/packages/table/components/Table.d.ts +1 -0
- package/out/ui/packages/table/components/Table.luau +92 -53
- package/out/ui/packages/table/components/Table.styles.luau +23 -6
- package/out/ui/packages/table/components/tableColumns.d.ts +2 -0
- package/out/ui/packages/table/components/tableColumns.luau +2 -0
- package/out/ui/packages/tabs/components/Tabs.luau +7 -4
- package/out/ui/packages/tabs/components/Tabs.styles.luau +12 -11
- package/out/ui/packages/tabs/components/tabIndicator.d.ts +7 -0
- package/out/ui/packages/tabs/components/tabIndicator.luau +21 -0
- package/out/ui/packages/text/components/Text.d.ts +2 -0
- package/out/ui/packages/text/components/Text.luau +12 -2
- package/out/ui/packages/timeField/components/TimeField.luau +11 -7
- package/out/ui/packages/timeline/components/Timeline.luau +35 -32
- package/out/ui/packages/timeline/components/Timeline.styles.luau +19 -10
- package/out/ui/packages/toast/components/Toast.luau +168 -72
- package/out/ui/packages/toast/components/Toast.styles.luau +36 -19
- package/out/ui/packages/toast/components/toastPlace.d.ts +4 -0
- package/out/ui/packages/toast/components/toastPlace.luau +13 -0
- package/out/ui/packages/toast/enums/ToastVariants.d.ts +2 -1
- package/out/ui/packages/toast/enums/ToastVariants.luau +1 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.luau +43 -4
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +1 -1
- package/out/ui/packages/tooltip/components/Tooltip.styles.luau +2 -2
- package/out/ui/packages/treeView/components/TreeView.luau +12 -13
- package/out/ui/packages/treeView/components/TreeView.styles.luau +6 -0
- package/out/ui/packages/typography/components/Typography.d.ts +2 -0
- package/out/ui/packages/typography/components/Typography.luau +8 -0
- package/out/ui/packages/typography/components/Typography.styles.luau +3 -1
- package/out/ui/packages/udimEditor/components/UDimEditor.luau +9 -1
- package/out/ui/packages/udimEditor/components/UDimEditor.styles.luau +25 -18
- package/out/ui/packages/vectorEditor/components/VectorEditor.luau +17 -3
- package/out/ui/packages/vectorEditor/components/VectorEditor.styles.luau +30 -16
- package/out/ui/packages/virtualList/components/VirtualList.styles.luau +1 -0
- package/package.json +69 -67
|
@@ -10,6 +10,7 @@ local useCardStyles = componentStyles("Card", function(theme, _param)
|
|
|
10
10
|
fullWidth = false
|
|
11
11
|
end
|
|
12
12
|
local width = cardColumnWidth(fullWidth, theme.padding.calc(32))
|
|
13
|
+
local heading = theme.typography.variants.h6
|
|
13
14
|
return createStyles({
|
|
14
15
|
column = {
|
|
15
16
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
@@ -29,8 +30,9 @@ local useCardStyles = componentStyles("Card", function(theme, _param)
|
|
|
29
30
|
TextWrapped = true,
|
|
30
31
|
BackgroundTransparency = 1,
|
|
31
32
|
BorderSizePixel = 0,
|
|
32
|
-
Font = theme.typography.fontFamilies.
|
|
33
|
-
TextSize =
|
|
33
|
+
Font = theme.typography.fontFamilies[heading.family],
|
|
34
|
+
TextSize = heading.size,
|
|
35
|
+
LineHeight = heading.leading,
|
|
34
36
|
TextColor3 = theme.palette.text.primary,
|
|
35
37
|
TextXAlignment = Enum.TextXAlignment.Left,
|
|
36
38
|
},
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local cx = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").cx
|
|
5
|
+
local useEditorHover = TS.import(script, script.Parent.Parent.Parent, "editorFace").useEditorHover
|
|
5
6
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
6
7
|
local NumberInput = TS.import(script, script.Parent.Parent.Parent, "numberInput").NumberInput
|
|
7
8
|
local useCFrameEditorStyles = TS.import(script, script.Parent, "CFrameEditor.styles").default
|
|
@@ -20,6 +21,7 @@ local function CFrameEditor(props)
|
|
|
20
21
|
local id = _binding.id
|
|
21
22
|
local ref = _binding.ref
|
|
22
23
|
local styles = useCFrameEditorStyles()
|
|
24
|
+
local hover = useEditorHover(disabled)
|
|
23
25
|
local rx, ry, rz = value:ToEulerAnglesXYZ()
|
|
24
26
|
local degrees = { math.deg(rx), math.deg(ry), math.deg(rz) }
|
|
25
27
|
local amounts = { value.X, value.Y, value.Z, degrees[1], degrees[2], degrees[3] }
|
|
@@ -100,12 +102,18 @@ local function CFrameEditor(props)
|
|
|
100
102
|
end
|
|
101
103
|
_attributes.key = _condition
|
|
102
104
|
_attributes.hostRef = ref
|
|
103
|
-
|
|
105
|
+
local _object = table.clone(styles.root)
|
|
106
|
+
setmetatable(_object, nil)
|
|
107
|
+
for _k, _v in hover.face do
|
|
108
|
+
_object[_k] = _v
|
|
109
|
+
end
|
|
110
|
+
_attributes.base = _object
|
|
104
111
|
_attributes.className = className
|
|
105
112
|
_attributes.sx = sx
|
|
106
113
|
_attributes.state = {
|
|
107
114
|
disabled = disabled,
|
|
108
115
|
}
|
|
116
|
+
_attributes.Event = hover.event
|
|
109
117
|
local _attributes_1 = table.clone(styles.wrap)
|
|
110
118
|
setmetatable(_attributes_1, nil)
|
|
111
119
|
return React.createElement(SxHost, _attributes, React.createElement("uilistlayout", _attributes_1), group("Position", POSITION, 1, 0), group("Rotation (degrees)", ORIENTATION, 2, 3))
|
|
@@ -3,8 +3,12 @@ local TS = _G[script]
|
|
|
3
3
|
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
4
|
local createStyles = _theme.createStyles
|
|
5
5
|
local componentStyles = _theme.componentStyles
|
|
6
|
+
local _editorFace = TS.import(script, script.Parent.Parent.Parent, "editorFace")
|
|
7
|
+
local editorPad = _editorFace.editorPad
|
|
8
|
+
local editorRowHeight = _editorFace.editorRowHeight
|
|
9
|
+
local editorText = _editorFace.editorText
|
|
6
10
|
local useCFrameEditorStyles = componentStyles("CFrameEditor", function(theme)
|
|
7
|
-
|
|
11
|
+
local _object = {
|
|
8
12
|
root = {
|
|
9
13
|
Size = UDim2.new(1, 0, 0, 0),
|
|
10
14
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
@@ -13,12 +17,12 @@ local useCFrameEditorStyles = componentStyles("CFrameEditor", function(theme)
|
|
|
13
17
|
},
|
|
14
18
|
wrap = {
|
|
15
19
|
FillDirection = Enum.FillDirection.Vertical,
|
|
16
|
-
Padding = UDim.new(0, theme
|
|
20
|
+
Padding = UDim.new(0, editorPad(theme)),
|
|
17
21
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
18
22
|
},
|
|
19
23
|
row = {
|
|
20
24
|
FillDirection = Enum.FillDirection.Horizontal,
|
|
21
|
-
Padding = UDim.new(0, theme
|
|
25
|
+
Padding = UDim.new(0, editorPad(theme)),
|
|
22
26
|
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
23
27
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
24
28
|
},
|
|
@@ -27,44 +31,49 @@ local useCFrameEditorStyles = componentStyles("CFrameEditor", function(theme)
|
|
|
27
31
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
28
32
|
BackgroundTransparency = 1,
|
|
29
33
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
34
|
+
}
|
|
35
|
+
local _left = "groupLabel"
|
|
36
|
+
local _object_1 = {
|
|
37
|
+
Size = UDim2.new(1, 0, 0, theme.spacing.calc(2)),
|
|
38
|
+
BackgroundTransparency = 1,
|
|
39
|
+
TextColor3 = theme.palette.text.secondary,
|
|
40
|
+
}
|
|
41
|
+
for _k, _v in editorText(theme) do
|
|
42
|
+
_object_1[_k] = _v
|
|
43
|
+
end
|
|
44
|
+
_object[_left] = _object_1
|
|
45
|
+
_object.axes = {
|
|
46
|
+
Size = UDim2.new(1, 0, 0, editorRowHeight(theme, "small")),
|
|
47
|
+
BackgroundTransparency = 1,
|
|
48
|
+
}
|
|
49
|
+
_object.axis = {
|
|
50
|
+
Size = UDim2.new(1 / 3, -editorPad(theme), 1, 0),
|
|
51
|
+
BackgroundTransparency = 1,
|
|
52
|
+
}
|
|
53
|
+
local _left_1 = "label"
|
|
54
|
+
local _object_2 = {
|
|
55
|
+
Size = UDim2.new(0, theme.spacing.calc(2.5), 1, 0),
|
|
56
|
+
BackgroundTransparency = 1,
|
|
57
|
+
TextColor3 = theme.palette.text.secondary,
|
|
58
|
+
}
|
|
59
|
+
for _k, _v in editorText(theme) do
|
|
60
|
+
_object_2[_k] = _v
|
|
61
|
+
end
|
|
62
|
+
_object[_left_1] = _object_2
|
|
63
|
+
_object.labelX = {
|
|
64
|
+
TextColor3 = theme.palette.status.error.main,
|
|
65
|
+
}
|
|
66
|
+
_object.labelY = {
|
|
67
|
+
TextColor3 = theme.palette.status.success.main,
|
|
68
|
+
}
|
|
69
|
+
_object.labelZ = {
|
|
70
|
+
TextColor3 = theme.palette.status.info.main,
|
|
71
|
+
}
|
|
72
|
+
_object.field = {
|
|
73
|
+
Size = UDim2.new(1, -theme.spacing.calc(2.5), 1, 0),
|
|
74
|
+
BackgroundTransparency = 1,
|
|
75
|
+
}
|
|
76
|
+
return createStyles(_object)
|
|
68
77
|
end)
|
|
69
78
|
local default = useCFrameEditorStyles
|
|
70
79
|
return {
|
|
@@ -3,7 +3,9 @@ local TS = _G[script]
|
|
|
3
3
|
local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local React = _react
|
|
5
5
|
local useState = _react.useState
|
|
6
|
-
local
|
|
6
|
+
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
7
|
+
local controlFade = _theme.controlFade
|
|
8
|
+
local cx = _theme.cx
|
|
7
9
|
local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
|
|
8
10
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
9
11
|
local useCheckboxStyles = TS.import(script, script.Parent, "Checkbox.styles").default
|
|
@@ -68,7 +70,6 @@ local function Checkbox(props)
|
|
|
68
70
|
}
|
|
69
71
|
_attributes.Active = active
|
|
70
72
|
_attributes.Selectable = not disabled
|
|
71
|
-
_attributes.BackgroundTransparency = if focused and active then 0.85 else 1
|
|
72
73
|
_attributes.Event = {
|
|
73
74
|
MouseButton1Click = function()
|
|
74
75
|
if active then
|
|
@@ -118,14 +119,14 @@ local function Checkbox(props)
|
|
|
118
119
|
local _attributes_5 = table.clone(mark)
|
|
119
120
|
setmetatable(_attributes_5, nil)
|
|
120
121
|
_attributes_5.Text = checkboxMark(value, mixed)
|
|
121
|
-
_attributes_5.TextTransparency = if disabled == true then
|
|
122
|
+
_attributes_5.TextTransparency = if disabled == true then controlFade else 0
|
|
122
123
|
local _exp_3 = React.createElement("frame", _attributes_2, _exp_1, _exp_2, React.createElement("textlabel", _attributes_5))
|
|
123
124
|
local _condition_1 = label ~= nil
|
|
124
125
|
if _condition_1 then
|
|
125
126
|
local _attributes_6 = table.clone(labelStyle)
|
|
126
127
|
setmetatable(_attributes_6, nil)
|
|
127
128
|
_attributes_6.Text = label
|
|
128
|
-
_attributes_6.TextTransparency = if disabled == true then
|
|
129
|
+
_attributes_6.TextTransparency = if disabled == true then controlFade else 0
|
|
129
130
|
_attributes_6.LayoutOrder = 2
|
|
130
131
|
_condition_1 = (React.createElement("textlabel", _attributes_6))
|
|
131
132
|
end
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type CheckboxPointer = "rest" | "hover" | "press" | "focus";
|
|
2
2
|
export declare function checkboxMark(value: boolean, mixed?: boolean): "" | "–" | "✓";
|
|
3
3
|
export declare function checkboxPointer(hovering: boolean, pressed: boolean, focused: boolean): CheckboxPointer;
|
|
4
|
-
export declare function checkboxBoxTransparency(filled: boolean, disabled: boolean, pointer: CheckboxPointer): 1 | 0 | 0.
|
|
5
|
-
export declare function checkboxStrokeTransparency(filled: boolean, disabled: boolean, pointer: CheckboxPointer): 0 | 0.
|
|
4
|
+
export declare function checkboxBoxTransparency(filled: boolean, disabled: boolean, pointer: CheckboxPointer): 1 | 0 | 0.5 | 0.7 | 0.85;
|
|
5
|
+
export declare function checkboxStrokeTransparency(filled: boolean, disabled: boolean, pointer: CheckboxPointer): 0 | 0.5 | 0.25 | 0.45 | 0.2;
|
|
@@ -19,7 +19,7 @@ local function checkboxPointer(hovering, pressed, focused)
|
|
|
19
19
|
end
|
|
20
20
|
local function checkboxBoxTransparency(filled, disabled, pointer)
|
|
21
21
|
if filled then
|
|
22
|
-
return if disabled then 0.
|
|
22
|
+
return if disabled then 0.5 else 0
|
|
23
23
|
end
|
|
24
24
|
if disabled then
|
|
25
25
|
return 1
|
|
@@ -34,7 +34,7 @@ local function checkboxBoxTransparency(filled, disabled, pointer)
|
|
|
34
34
|
end
|
|
35
35
|
local function checkboxStrokeTransparency(filled, disabled, pointer)
|
|
36
36
|
if disabled then
|
|
37
|
-
return 0.
|
|
37
|
+
return 0.5
|
|
38
38
|
end
|
|
39
39
|
if pointer == "focus" or pointer == "press" then
|
|
40
40
|
return 0
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
-
local Icons = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Icons
|
|
5
4
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
5
|
+
local IconButton = TS.import(script, script.Parent.Parent.Parent, "iconButton").IconButton
|
|
6
6
|
local useChipStyles = TS.import(script, script.Parent, "Chip.styles").default
|
|
7
7
|
local function Chip(props)
|
|
8
8
|
local _binding = props
|
|
@@ -83,21 +83,23 @@ local function Chip(props)
|
|
|
83
83
|
_attributes_5.Text = label
|
|
84
84
|
local _exp_4 = React.createElement("textlabel", _attributes_5)
|
|
85
85
|
local _attributes_6 = {
|
|
86
|
-
|
|
86
|
+
id = "Delete",
|
|
87
|
+
glyph = "close",
|
|
87
88
|
}
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
local _result = (styles.glyph).Size
|
|
90
|
+
if _result ~= nil then
|
|
91
|
+
_result = _result.X.Offset
|
|
90
92
|
end
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
_condition_1 = (React.createElement(React.Fragment, nil, _exp_3, _exp_4, React.createElement(
|
|
93
|
+
local _condition_2 = _result
|
|
94
|
+
if _condition_2 == nil then
|
|
95
|
+
_condition_2 = 16
|
|
96
|
+
end
|
|
97
|
+
_attributes_6.iconSize = _condition_2
|
|
98
|
+
_attributes_6.tint = (styles.glyph).ImageColor3
|
|
99
|
+
_attributes_6.disabled = disabled
|
|
100
|
+
_attributes_6.className = styles.delete
|
|
101
|
+
_attributes_6.onClick = onDelete
|
|
102
|
+
_condition_1 = (React.createElement(React.Fragment, nil, _exp_3, _exp_4, React.createElement(IconButton, _attributes_6)))
|
|
101
103
|
end
|
|
102
104
|
return React.createElement(SxHost, _attributes, _exp, _exp_1, _exp_2, _condition_1)
|
|
103
105
|
end
|
|
@@ -31,6 +31,7 @@ local useChipStyles = componentStyles("Chip", function(theme, _param)
|
|
|
31
31
|
local padY = if size == "small" then 0.25 elseif size == "large" then 0.75 else 0.5
|
|
32
32
|
local padX = if size == "small" then 1 elseif size == "large" then 2 else 1.5
|
|
33
33
|
local deletePx = metrics.icon
|
|
34
|
+
local glyphPx = math.round(metrics.font * 0.7)
|
|
34
35
|
local tone = chipTone(color)
|
|
35
36
|
local status = if tone == "success" then theme.palette.status.success elseif tone == "error" then theme.palette.status.error elseif tone == "primary" then theme.palette.primary else nil
|
|
36
37
|
local filledTone = status ~= nil and variant ~= "outlined"
|
|
@@ -48,6 +49,7 @@ local useChipStyles = componentStyles("Chip", function(theme, _param)
|
|
|
48
49
|
TextColor3 = ink,
|
|
49
50
|
Font = theme.typography.fontFamilies.default,
|
|
50
51
|
TextSize = metrics.font,
|
|
52
|
+
TextWrapped = true,
|
|
51
53
|
},
|
|
52
54
|
padding = {
|
|
53
55
|
PaddingTop = UDim.new(0, theme.padding.calc(padY)),
|
|
@@ -74,6 +76,7 @@ local useChipStyles = componentStyles("Chip", function(theme, _param)
|
|
|
74
76
|
Size = UDim2.fromScale(0, 0),
|
|
75
77
|
BackgroundTransparency = 1,
|
|
76
78
|
BorderSizePixel = 0,
|
|
79
|
+
TextWrapped = true,
|
|
77
80
|
TextColor3 = ink,
|
|
78
81
|
Font = theme.typography.fontFamilies.default,
|
|
79
82
|
TextSize = metrics.font,
|
|
@@ -81,12 +84,12 @@ local useChipStyles = componentStyles("Chip", function(theme, _param)
|
|
|
81
84
|
},
|
|
82
85
|
delete = {
|
|
83
86
|
Size = UDim2.fromOffset(deletePx, deletePx),
|
|
84
|
-
BackgroundTransparency = 1,
|
|
85
|
-
BorderSizePixel = 0,
|
|
86
|
-
AutoButtonColor = false,
|
|
87
|
-
ImageColor3 = if disabled then theme.palette.text.disabled elseif filledTone and status ~= nil then status.on else theme.palette.text.secondary,
|
|
88
87
|
LayoutOrder = 2,
|
|
89
88
|
},
|
|
89
|
+
glyph = {
|
|
90
|
+
Size = UDim2.fromOffset(glyphPx, glyphPx),
|
|
91
|
+
ImageColor3 = if disabled then theme.palette.text.disabled elseif filledTone and status ~= nil then status.on else theme.palette.text.secondary,
|
|
92
|
+
},
|
|
90
93
|
})
|
|
91
94
|
end)
|
|
92
95
|
local default = useChipStyles
|
|
@@ -99,14 +99,21 @@ local function CircularProgress(props)
|
|
|
99
99
|
}
|
|
100
100
|
return React.createElement(SxHost, _attributes, React.createElement("uicorner", {
|
|
101
101
|
CornerRadius = UDim.new(1, 0),
|
|
102
|
+
}), React.createElement("frame", {
|
|
103
|
+
key = "Track",
|
|
104
|
+
Size = UDim2.fromScale(1, 1),
|
|
105
|
+
BackgroundTransparency = 1,
|
|
106
|
+
BorderSizePixel = 0,
|
|
107
|
+
}, React.createElement("uicorner", {
|
|
108
|
+
CornerRadius = UDim.new(1, 0),
|
|
102
109
|
}), React.createElement("uistroke", {
|
|
103
110
|
Color = tint,
|
|
104
111
|
Thickness = thickness,
|
|
105
|
-
Transparency = if disabled then 0.
|
|
106
|
-
}), React.createElement("uistroke", {
|
|
112
|
+
Transparency = if disabled then 0.75 else 0.82,
|
|
113
|
+
})), React.createElement("uistroke", {
|
|
107
114
|
Color = tint,
|
|
108
115
|
Thickness = thickness,
|
|
109
|
-
Transparency = if disabled then 0.
|
|
116
|
+
Transparency = if disabled then 0.4 else 0,
|
|
110
117
|
}, React.createElement("uigradient", {
|
|
111
118
|
ref = gradientRef,
|
|
112
119
|
Rotation = -90,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
import { CodeLanguage } from "../../markdown/parseMarkdown";
|
|
3
|
+
export interface CodeEditorProps {
|
|
4
|
+
value?: string;
|
|
5
|
+
onChange?: (value: string) => void;
|
|
6
|
+
language?: CodeLanguage;
|
|
7
|
+
onLanguageChange?: (language: CodeLanguage) => void;
|
|
8
|
+
readOnly?: boolean;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
}
|
|
11
|
+
declare function CodeEditor(props: CustomizedProps<Frame, CodeEditorProps>): JSX.Element;
|
|
12
|
+
export default CodeEditor;
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
+
local React = _react
|
|
5
|
+
local useEffect = _react.useEffect
|
|
6
|
+
local useState = _react.useState
|
|
7
|
+
local TextService = TS.import(script, TS.getModule(script, "@rbxts", "services")).TextService
|
|
8
|
+
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
9
|
+
local controlMetrics = _theme.controlMetrics
|
|
10
|
+
local useTheme = _theme.useTheme
|
|
11
|
+
local Icons = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Icons
|
|
12
|
+
local Menu = TS.import(script, script.Parent.Parent.Parent, "menu").Menu
|
|
13
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
14
|
+
local _highlightCode = TS.import(script, script.Parent.Parent, "highlightCode")
|
|
15
|
+
local colorHex = _highlightCode.colorHex
|
|
16
|
+
local highlightCode = _highlightCode.highlightCode
|
|
17
|
+
local useCodeEditorStyles = TS.import(script, script.Parent, "CodeEditor.styles").default
|
|
18
|
+
local LANGUAGES = { "luau", "ts", "json", "text" }
|
|
19
|
+
local function CodeEditor(props)
|
|
20
|
+
local _binding = props
|
|
21
|
+
local value = _binding.value
|
|
22
|
+
local onChange = _binding.onChange
|
|
23
|
+
local language = _binding.language
|
|
24
|
+
local onLanguageChange = _binding.onLanguageChange
|
|
25
|
+
local readOnly = _binding.readOnly
|
|
26
|
+
if readOnly == nil then
|
|
27
|
+
readOnly = false
|
|
28
|
+
end
|
|
29
|
+
local placeholder = _binding.placeholder
|
|
30
|
+
if placeholder == nil then
|
|
31
|
+
placeholder = ""
|
|
32
|
+
end
|
|
33
|
+
local className = _binding.className
|
|
34
|
+
local sx = _binding.sx
|
|
35
|
+
local id = _binding.id
|
|
36
|
+
local ref = _binding.ref
|
|
37
|
+
local _binding_1 = useTheme()
|
|
38
|
+
local theme = _binding_1.theme
|
|
39
|
+
local _condition = value
|
|
40
|
+
if _condition == nil then
|
|
41
|
+
_condition = ""
|
|
42
|
+
end
|
|
43
|
+
local draft, setDraft = useState(_condition)
|
|
44
|
+
local picked, setPicked = useState(language or "text")
|
|
45
|
+
local focused, setFocused = useState(false)
|
|
46
|
+
local open, setOpen = useState(false)
|
|
47
|
+
local anchor, setAnchor = useState()
|
|
48
|
+
local boxHeight, setBoxHeight = useState(0)
|
|
49
|
+
local inkHeight, setInkHeight = useState(0)
|
|
50
|
+
local shown = language or picked
|
|
51
|
+
local editable = readOnly ~= true
|
|
52
|
+
-- TextBox has TextTransparency and no separate caret property, so a transparent field hides the caret.
|
|
53
|
+
local colored = not editable or not focused
|
|
54
|
+
local contentHeight = if colored then math.max(boxHeight, inkHeight) else boxHeight
|
|
55
|
+
local minHeight = if editable then theme.spacing.calc(8) else 0
|
|
56
|
+
local fieldHeight = math.max(minHeight, contentHeight)
|
|
57
|
+
local metrics = controlMetrics(theme.density, "small")
|
|
58
|
+
local _condition_1 = theme.typography.fontSizes.caption
|
|
59
|
+
if _condition_1 == nil then
|
|
60
|
+
_condition_1 = metrics.font
|
|
61
|
+
end
|
|
62
|
+
local mark = _condition_1
|
|
63
|
+
local pad = theme.padding.calc(1)
|
|
64
|
+
local font = theme.typography.fontFamilies.default or Enum.Font.SourceSans
|
|
65
|
+
local textWidth = TextService:GetTextSize(shown, metrics.font, font, Vector2.new(10000, 100)).X
|
|
66
|
+
local triggerWidth = pad + textWidth + pad + mark + pad
|
|
67
|
+
local styles = useCodeEditorStyles({
|
|
68
|
+
focused = focused and editable,
|
|
69
|
+
fieldHeight = fieldHeight,
|
|
70
|
+
triggerWidth = triggerWidth,
|
|
71
|
+
})
|
|
72
|
+
local colors = {
|
|
73
|
+
keyword = colorHex(theme.palette.code.keyword),
|
|
74
|
+
string = colorHex(theme.palette.code.string),
|
|
75
|
+
number = colorHex(theme.palette.code.number),
|
|
76
|
+
comment = colorHex(theme.palette.code.comment),
|
|
77
|
+
func = colorHex(theme.palette.code.func),
|
|
78
|
+
}
|
|
79
|
+
local highlighted = highlightCode(draft, shown, colors)
|
|
80
|
+
local empty = #draft == 0
|
|
81
|
+
useEffect(function()
|
|
82
|
+
local _condition_2 = value
|
|
83
|
+
if _condition_2 == nil then
|
|
84
|
+
_condition_2 = ""
|
|
85
|
+
end
|
|
86
|
+
return setDraft(_condition_2)
|
|
87
|
+
end, { value })
|
|
88
|
+
local pick = function(choice)
|
|
89
|
+
setOpen(false)
|
|
90
|
+
if language == nil then
|
|
91
|
+
setPicked(choice)
|
|
92
|
+
end
|
|
93
|
+
if onLanguageChange then
|
|
94
|
+
onLanguageChange(choice)
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
local _attributes = {
|
|
98
|
+
tag = "frame",
|
|
99
|
+
}
|
|
100
|
+
local _condition_2 = id
|
|
101
|
+
if not (_condition_2 ~= 0 and _condition_2 == _condition_2 and _condition_2 ~= "" and _condition_2) then
|
|
102
|
+
_condition_2 = "CodeEditor"
|
|
103
|
+
end
|
|
104
|
+
_attributes.key = _condition_2
|
|
105
|
+
_attributes.hostRef = ref
|
|
106
|
+
_attributes.base = styles.root
|
|
107
|
+
_attributes.className = className
|
|
108
|
+
_attributes.sx = sx
|
|
109
|
+
_attributes.state = {
|
|
110
|
+
focused = focused,
|
|
111
|
+
}
|
|
112
|
+
local _attributes_1 = table.clone(styles.stroke)
|
|
113
|
+
setmetatable(_attributes_1, nil)
|
|
114
|
+
local _exp = React.createElement("uistroke", _attributes_1)
|
|
115
|
+
local _attributes_2 = table.clone(styles.corner)
|
|
116
|
+
setmetatable(_attributes_2, nil)
|
|
117
|
+
local _exp_1 = React.createElement("uicorner", _attributes_2)
|
|
118
|
+
local _attributes_3 = table.clone(styles.padding)
|
|
119
|
+
setmetatable(_attributes_3, nil)
|
|
120
|
+
local _exp_2 = React.createElement("uipadding", _attributes_3)
|
|
121
|
+
local _attributes_4 = table.clone(styles.stack)
|
|
122
|
+
setmetatable(_attributes_4, nil)
|
|
123
|
+
local _exp_3 = React.createElement("uilistlayout", _attributes_4)
|
|
124
|
+
local _condition_3 = editable
|
|
125
|
+
if _condition_3 then
|
|
126
|
+
local _attributes_5 = {
|
|
127
|
+
key = "Bar",
|
|
128
|
+
}
|
|
129
|
+
for _k, _v in styles.bar do
|
|
130
|
+
_attributes_5[_k] = _v
|
|
131
|
+
end
|
|
132
|
+
local _attributes_6 = table.clone(styles.barRow)
|
|
133
|
+
setmetatable(_attributes_6, nil)
|
|
134
|
+
local _exp_4 = React.createElement("uilistlayout", _attributes_6)
|
|
135
|
+
local _attributes_7 = {
|
|
136
|
+
key = "Language",
|
|
137
|
+
ref = setAnchor,
|
|
138
|
+
}
|
|
139
|
+
for _k, _v in styles.trigger do
|
|
140
|
+
_attributes_7[_k] = _v
|
|
141
|
+
end
|
|
142
|
+
_attributes_7.Text = shown
|
|
143
|
+
_attributes_7.Event = {
|
|
144
|
+
Activated = function()
|
|
145
|
+
return setOpen(function(current)
|
|
146
|
+
return not current
|
|
147
|
+
end)
|
|
148
|
+
end,
|
|
149
|
+
}
|
|
150
|
+
local _exp_5 = React.createElement("uipadding", {
|
|
151
|
+
PaddingLeft = UDim.new(0, pad),
|
|
152
|
+
PaddingRight = UDim.new(0, pad + mark + pad),
|
|
153
|
+
})
|
|
154
|
+
local _attributes_8 = table.clone(styles.corner)
|
|
155
|
+
setmetatable(_attributes_8, nil)
|
|
156
|
+
local _exp_6 = React.createElement("uicorner", _attributes_8)
|
|
157
|
+
local _attributes_9 = table.clone(styles.triggerStroke)
|
|
158
|
+
setmetatable(_attributes_9, nil)
|
|
159
|
+
local _exp_7 = React.createElement("textbutton", _attributes_7, _exp_5, _exp_6, React.createElement("uistroke", _attributes_9), React.createElement("imagelabel", {
|
|
160
|
+
key = "Caret",
|
|
161
|
+
BackgroundTransparency = 1,
|
|
162
|
+
BorderSizePixel = 0,
|
|
163
|
+
AnchorPoint = Vector2.new(1, 0.5),
|
|
164
|
+
Position = UDim2.new(1, mark + pad, 0.5, 0),
|
|
165
|
+
Size = UDim2.fromOffset(mark, mark),
|
|
166
|
+
Image = Icons.Collapsed,
|
|
167
|
+
Rotation = 90,
|
|
168
|
+
ImageColor3 = theme.palette.text.secondary,
|
|
169
|
+
ScaleType = Enum.ScaleType.Fit,
|
|
170
|
+
}))
|
|
171
|
+
local _attributes_10 = {
|
|
172
|
+
anchor = anchor,
|
|
173
|
+
open = open,
|
|
174
|
+
dense = true,
|
|
175
|
+
selected = shown,
|
|
176
|
+
}
|
|
177
|
+
-- ▼ ReadonlyArray.map ▼
|
|
178
|
+
local _newValue = table.create(#LANGUAGES)
|
|
179
|
+
local _callback = function(choice)
|
|
180
|
+
return {
|
|
181
|
+
id = choice,
|
|
182
|
+
text = choice,
|
|
183
|
+
}
|
|
184
|
+
end
|
|
185
|
+
for _k, _v in LANGUAGES do
|
|
186
|
+
_newValue[_k] = _callback(_v, _k - 1, LANGUAGES)
|
|
187
|
+
end
|
|
188
|
+
-- ▲ ReadonlyArray.map ▲
|
|
189
|
+
_attributes_10.items = _newValue
|
|
190
|
+
_attributes_10.onSelect = function(choice)
|
|
191
|
+
return pick(choice)
|
|
192
|
+
end
|
|
193
|
+
_attributes_10.onClose = function()
|
|
194
|
+
return setOpen(false)
|
|
195
|
+
end
|
|
196
|
+
_condition_3 = (React.createElement("frame", _attributes_5, _exp_4, _exp_7, React.createElement(Menu, _attributes_10)))
|
|
197
|
+
end
|
|
198
|
+
local _attributes_5 = {
|
|
199
|
+
key = "Field",
|
|
200
|
+
}
|
|
201
|
+
for _k, _v in styles.fieldHost do
|
|
202
|
+
_attributes_5[_k] = _v
|
|
203
|
+
end
|
|
204
|
+
local _attributes_6 = {
|
|
205
|
+
key = "Ink",
|
|
206
|
+
}
|
|
207
|
+
for _k, _v in styles.highlight do
|
|
208
|
+
_attributes_6[_k] = _v
|
|
209
|
+
end
|
|
210
|
+
_attributes_6.Visible = colored
|
|
211
|
+
_attributes_6.Active = false
|
|
212
|
+
_attributes_6.Selectable = false
|
|
213
|
+
_attributes_6.RichText = not empty
|
|
214
|
+
_attributes_6.Text = if empty then placeholder else highlighted
|
|
215
|
+
_attributes_6.TextColor3 = if empty then theme.palette.text.secondary else theme.palette.text.primary
|
|
216
|
+
_attributes_6.Change = {
|
|
217
|
+
TextBounds = function(rbx)
|
|
218
|
+
return setInkHeight(rbx.TextBounds.Y)
|
|
219
|
+
end,
|
|
220
|
+
}
|
|
221
|
+
local _exp_4 = React.createElement("textlabel", _attributes_6)
|
|
222
|
+
local _attributes_7 = {
|
|
223
|
+
key = "Input",
|
|
224
|
+
}
|
|
225
|
+
for _k, _v in styles.field do
|
|
226
|
+
_attributes_7[_k] = _v
|
|
227
|
+
end
|
|
228
|
+
_attributes_7.Text = draft
|
|
229
|
+
_attributes_7.PlaceholderText = if colored then "" else placeholder
|
|
230
|
+
_attributes_7.TextTransparency = if colored then 1 else 0
|
|
231
|
+
_attributes_7.MultiLine = true
|
|
232
|
+
_attributes_7.TextEditable = editable
|
|
233
|
+
_attributes_7.Change = {
|
|
234
|
+
Text = function(rbx)
|
|
235
|
+
if not editable then
|
|
236
|
+
return nil
|
|
237
|
+
end
|
|
238
|
+
setDraft(rbx.Text)
|
|
239
|
+
if onChange then
|
|
240
|
+
onChange(rbx.Text)
|
|
241
|
+
end
|
|
242
|
+
end,
|
|
243
|
+
TextBounds = function(rbx)
|
|
244
|
+
return setBoxHeight(rbx.TextBounds.Y)
|
|
245
|
+
end,
|
|
246
|
+
}
|
|
247
|
+
_attributes_7.Event = {
|
|
248
|
+
Focused = function()
|
|
249
|
+
if editable then
|
|
250
|
+
setFocused(true)
|
|
251
|
+
end
|
|
252
|
+
end,
|
|
253
|
+
FocusLost = function()
|
|
254
|
+
return setFocused(false)
|
|
255
|
+
end,
|
|
256
|
+
}
|
|
257
|
+
return React.createElement(SxHost, _attributes, _exp, _exp_1, _exp_2, _exp_3, _condition_3, React.createElement("frame", _attributes_5, _exp_4, React.createElement("textbox", _attributes_7)))
|
|
258
|
+
end
|
|
259
|
+
local default = CodeEditor
|
|
260
|
+
return {
|
|
261
|
+
default = default,
|
|
262
|
+
}
|