@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.
Files changed (212) hide show
  1. package/README.md +1 -18
  2. package/out/theme/constants/NumberConstants.d.ts +10 -0
  3. package/out/theme/constants/NumberConstants.luau +12 -0
  4. package/out/theme/interfaces/density/controlMetrics.luau +2 -2
  5. package/out/theme/interfaces/palette/Palette.d.ts +7 -0
  6. package/out/theme/interfaces/spacing/Shape.d.ts +6 -0
  7. package/out/theme/interfaces/theme/Theme.d.ts +6 -0
  8. package/out/theme/interfaces/typography/FontFamilies.luau +1 -0
  9. package/out/theme/interfaces/typography/FontFamilyOptions.d.ts +1 -1
  10. package/out/theme/interfaces/typography/FontSizeOptions.d.ts +1 -1
  11. package/out/theme/interfaces/typography/FontSizes.luau +2 -0
  12. package/out/theme/interfaces/typography/Variants.d.ts +3 -1
  13. package/out/theme/interfaces/typography/Variants.luau +25 -1
  14. package/out/theme/styles/utilities/focusRing.d.ts +2 -0
  15. package/out/theme/styles/utilities/focusRing.luau +3 -0
  16. package/out/theme/styles/utilities/index.d.ts +1 -1
  17. package/out/theme/styles/utilities/init.luau +3 -1
  18. package/out/theme/themes/DarkTheme.luau +4 -0
  19. package/out/theme/themes/LightTheme.luau +4 -0
  20. package/out/theme/themes/createPalette.luau +15 -0
  21. package/out/ui/packages/accordion/components/Accordion.luau +84 -40
  22. package/out/ui/packages/accordion/components/Accordion.styles.luau +35 -17
  23. package/out/ui/packages/alert/components/Alert.luau +15 -11
  24. package/out/ui/packages/alert/components/Alert.styles.luau +37 -26
  25. package/out/ui/packages/appBar/components/AppBar.luau +35 -13
  26. package/out/ui/packages/appBar/components/AppBar.styles.luau +41 -35
  27. package/out/ui/packages/autocomplete/components/Autocomplete.luau +4 -0
  28. package/out/ui/packages/avatar/components/Avatar.d.ts +2 -0
  29. package/out/ui/packages/avatar/components/Avatar.luau +9 -2
  30. package/out/ui/packages/avatar/components/Avatar.styles.luau +7 -0
  31. package/out/ui/packages/avatarGroup/components/AvatarGroup.luau +9 -4
  32. package/out/ui/packages/avatarGroup/components/AvatarGroup.styles.luau +6 -1
  33. package/out/ui/packages/badge/components/Badge.luau +14 -11
  34. package/out/ui/packages/badge/components/Badge.styles.luau +5 -1
  35. package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +4 -3
  36. package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +6 -2
  37. package/out/ui/packages/breadcrumbs/components/Breadcrumbs.styles.luau +4 -0
  38. package/out/ui/packages/brickColorPicker/components/BrickColorPicker.luau +20 -2
  39. package/out/ui/packages/brickColorPicker/components/BrickColorPicker.styles.luau +72 -66
  40. package/out/ui/packages/button/components/Button.luau +61 -34
  41. package/out/ui/packages/button/components/buttonPaint.d.ts +16 -0
  42. package/out/ui/packages/button/components/buttonPaint.luau +70 -0
  43. package/out/ui/packages/buttonGroup/components/ButtonGroup.d.ts +1 -0
  44. package/out/ui/packages/buttonGroup/components/ButtonGroup.luau +17 -2
  45. package/out/ui/packages/card/components/Card.styles.luau +4 -2
  46. package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +9 -1
  47. package/out/ui/packages/cframeEditor/components/CFrameEditor.styles.luau +50 -41
  48. package/out/ui/packages/checkbox/components/Checkbox.luau +5 -4
  49. package/out/ui/packages/checkbox/components/checkboxLook.d.ts +2 -2
  50. package/out/ui/packages/checkbox/components/checkboxLook.luau +2 -2
  51. package/out/ui/packages/chip/components/Chip.luau +16 -14
  52. package/out/ui/packages/chip/components/Chip.styles.luau +7 -4
  53. package/out/ui/packages/circularProgress/components/CircularProgress.luau +10 -3
  54. package/out/ui/packages/codeEditor/components/CodeEditor.d.ts +12 -0
  55. package/out/ui/packages/codeEditor/components/CodeEditor.luau +262 -0
  56. package/out/ui/packages/codeEditor/components/CodeEditor.styles.d.ts +6 -0
  57. package/out/ui/packages/codeEditor/components/CodeEditor.styles.luau +124 -0
  58. package/out/ui/packages/codeEditor/highlightCode.d.ts +11 -0
  59. package/out/ui/packages/codeEditor/highlightCode.luau +503 -0
  60. package/out/ui/packages/codeEditor/index.d.ts +2 -0
  61. package/out/ui/packages/codeEditor/init.luau +5 -0
  62. package/out/ui/packages/colorPicker/components/ColorPicker.luau +9 -1
  63. package/out/ui/packages/colorPicker/components/ColorPicker.styles.luau +74 -67
  64. package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +12 -4
  65. package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +12 -4
  66. package/out/ui/packages/dateRange/components/DateRangePicker.luau +31 -19
  67. package/out/ui/packages/dialog/components/Dialog.styles.luau +4 -2
  68. package/out/ui/packages/divider/components/Divider.luau +3 -1
  69. package/out/ui/packages/divider/components/Divider.styles.luau +1 -0
  70. package/out/ui/packages/drawer/components/Drawer.d.ts +1 -0
  71. package/out/ui/packages/drawer/components/Drawer.luau +43 -14
  72. package/out/ui/packages/drawer/components/Drawer.styles.luau +13 -5
  73. package/out/ui/packages/drawer/components/drawerPlacement.d.ts +2 -0
  74. package/out/ui/packages/drawer/components/drawerPlacement.luau +18 -0
  75. package/out/ui/packages/editorFace.d.ts +22 -0
  76. package/out/ui/packages/editorFace.luau +49 -0
  77. package/out/ui/packages/fab/components/Fab.luau +19 -6
  78. package/out/ui/packages/fab/components/Fab.styles.luau +4 -3
  79. package/out/ui/packages/fab/components/fabSize.d.ts +1 -1
  80. package/out/ui/packages/fontEditor/components/FontEditor.luau +13 -3
  81. package/out/ui/packages/fontEditor/components/FontEditor.styles.luau +36 -27
  82. package/out/ui/packages/gradientEditor/components/GradientEditor.luau +21 -13
  83. package/out/ui/packages/gradientEditor/components/GradientEditor.styles.luau +52 -44
  84. package/out/ui/packages/icon/components/DrawnGlyph.d.ts +11 -0
  85. package/out/ui/packages/icon/components/DrawnGlyph.luau +87 -0
  86. package/out/ui/packages/icon/components/Icon.d.ts +6 -2
  87. package/out/ui/packages/icon/components/Icon.luau +23 -3
  88. package/out/ui/packages/icon/components/Icon.styles.luau +3 -0
  89. package/out/ui/packages/icon/components/glyphs.d.ts +28 -0
  90. package/out/ui/packages/icon/components/glyphs.luau +64 -0
  91. package/out/ui/packages/icon/index.d.ts +1 -0
  92. package/out/ui/packages/iconButton/components/IconButton.d.ts +5 -2
  93. package/out/ui/packages/iconButton/components/IconButton.luau +83 -16
  94. package/out/ui/packages/iconButton/components/IconButton.styles.luau +4 -27
  95. package/out/ui/packages/iconButton/components/iconButtonBox.d.ts +11 -0
  96. package/out/ui/packages/iconButton/components/iconButtonBox.luau +48 -0
  97. package/out/ui/packages/iconButton/components/transportGlyph.d.ts +1 -0
  98. package/out/ui/packages/iconButton/components/transportGlyph.luau +4 -0
  99. package/out/ui/packages/imageList/components/ImageList.luau +11 -36
  100. package/out/ui/packages/imageList/components/ImageList.styles.luau +1 -0
  101. package/out/ui/packages/imageList/components/imageListLayout.d.ts +0 -2
  102. package/out/ui/packages/imageList/components/imageListLayout.luau +0 -8
  103. package/out/ui/packages/index.d.ts +1 -0
  104. package/out/ui/packages/init.luau +3 -0
  105. package/out/ui/packages/input/components/Input.luau +46 -29
  106. package/out/ui/packages/input/components/Input.styles.luau +8 -11
  107. package/out/ui/packages/input/components/fieldChrome.d.ts +5 -0
  108. package/out/ui/packages/input/components/fieldChrome.luau +11 -0
  109. package/out/ui/packages/layout/components/Box.luau +92 -13
  110. package/out/ui/packages/layout/components/Box.styles.d.ts +0 -2
  111. package/out/ui/packages/layout/components/Box.styles.luau +0 -9
  112. package/out/ui/packages/layout/components/Grid.luau +81 -16
  113. package/out/ui/packages/layout/components/Pad.d.ts +24 -0
  114. package/out/ui/packages/layout/components/Pad.luau +88 -0
  115. package/out/ui/packages/layout/components/Stack.luau +79 -13
  116. package/out/ui/packages/link/components/Link.luau +19 -13
  117. package/out/ui/packages/link/components/Link.styles.luau +10 -1
  118. package/out/ui/packages/listItem/components/ListItem.luau +61 -4
  119. package/out/ui/packages/listItem/components/ListItem.styles.d.ts +1 -0
  120. package/out/ui/packages/listItem/components/ListItem.styles.luau +28 -11
  121. package/out/ui/packages/listItem/components/listItemInk.d.ts +1 -1
  122. package/out/ui/packages/listItem/components/listItemLayout.d.ts +12 -2
  123. package/out/ui/packages/listItem/components/listItemLayout.luau +29 -2
  124. package/out/ui/packages/markdown/components/Markdown.luau +163 -50
  125. package/out/ui/packages/markdown/components/Markdown.styles.luau +125 -76
  126. package/out/ui/packages/markdown/components/MarkdownEditor.luau +215 -146
  127. package/out/ui/packages/markdown/components/MarkdownEditor.styles.d.ts +1 -0
  128. package/out/ui/packages/markdown/components/MarkdownEditor.styles.luau +153 -83
  129. package/out/ui/packages/markdown/index.d.ts +1 -1
  130. package/out/ui/packages/markdown/parseMarkdown.d.ts +9 -1
  131. package/out/ui/packages/markdown/parseMarkdown.luau +350 -29
  132. package/out/ui/packages/menu/components/Menu.d.ts +1 -1
  133. package/out/ui/packages/menu/components/Menu.luau +12 -11
  134. package/out/ui/packages/menu/components/Menu.styles.luau +6 -1
  135. package/out/ui/packages/menu/components/menuIcon.d.ts +1 -1
  136. package/out/ui/packages/numberInput/components/NumberInput.luau +19 -4
  137. package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.luau +9 -1
  138. package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.styles.luau +23 -16
  139. package/out/ui/packages/pager/components/Pager.luau +15 -13
  140. package/out/ui/packages/pager/components/Pager.styles.luau +5 -0
  141. package/out/ui/packages/pagination/components/Pagination.styles.luau +4 -1
  142. package/out/ui/packages/paper/components/Paper.luau +17 -11
  143. package/out/ui/packages/paper/components/Paper.styles.luau +12 -5
  144. package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +9 -1
  145. package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.styles.luau +24 -19
  146. package/out/ui/packages/popover/components/Popover.d.ts +1 -1
  147. package/out/ui/packages/popover/components/Popover.luau +6 -4
  148. package/out/ui/packages/popover/components/Popover.styles.luau +6 -0
  149. package/out/ui/packages/popup/components/Popup.d.ts +2 -0
  150. package/out/ui/packages/popup/components/Popup.luau +64 -2
  151. package/out/ui/packages/popup/components/placement.luau +6 -4
  152. package/out/ui/packages/progressBar/components/ProgressBar.luau +1 -1
  153. package/out/ui/packages/progressBar/components/ProgressBar.styles.luau +3 -2
  154. package/out/ui/packages/radioGroup/components/RadioGroup.luau +2 -1
  155. package/out/ui/packages/rating/components/Rating.luau +45 -3
  156. package/out/ui/packages/rating/components/Rating.styles.luau +1 -1
  157. package/out/ui/packages/rayEditor/components/RayEditor.luau +9 -1
  158. package/out/ui/packages/rayEditor/components/RayEditor.styles.luau +17 -11
  159. package/out/ui/packages/rectEditor/components/RectEditor.luau +9 -1
  160. package/out/ui/packages/rectEditor/components/RectEditor.styles.luau +49 -42
  161. package/out/ui/packages/select/components/Select.d.ts +2 -0
  162. package/out/ui/packages/select/components/Select.luau +148 -106
  163. package/out/ui/packages/select/components/Select.styles.d.ts +2 -0
  164. package/out/ui/packages/select/components/Select.styles.luau +29 -5
  165. package/out/ui/packages/shadow/components/Shadow.luau +188 -19
  166. package/out/ui/packages/sidebar/components/Sidebar.styles.luau +1 -0
  167. package/out/ui/packages/skeleton/components/Skeleton.luau +4 -0
  168. package/out/ui/packages/slider/components/RangeSlider.luau +6 -5
  169. package/out/ui/packages/slider/components/Slider.luau +11 -16
  170. package/out/ui/packages/sparkline/components/Sparkline.luau +7 -5
  171. package/out/ui/packages/speedDial/components/SpeedDial.luau +4 -1
  172. package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +5 -0
  173. package/out/ui/packages/speedDial/components/speedDialLabel.d.ts +1 -1
  174. package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
  175. package/out/ui/packages/stepper/components/Stepper.styles.luau +9 -6
  176. package/out/ui/packages/switch/components/Switch.luau +2 -2
  177. package/out/ui/packages/switch/components/switchLook.d.ts +3 -3
  178. package/out/ui/packages/switch/components/switchLook.luau +4 -10
  179. package/out/ui/packages/table/components/Table.d.ts +1 -0
  180. package/out/ui/packages/table/components/Table.luau +92 -53
  181. package/out/ui/packages/table/components/Table.styles.luau +23 -6
  182. package/out/ui/packages/table/components/tableColumns.d.ts +2 -0
  183. package/out/ui/packages/table/components/tableColumns.luau +2 -0
  184. package/out/ui/packages/tabs/components/Tabs.luau +7 -4
  185. package/out/ui/packages/tabs/components/Tabs.styles.luau +12 -11
  186. package/out/ui/packages/tabs/components/tabIndicator.d.ts +7 -0
  187. package/out/ui/packages/tabs/components/tabIndicator.luau +21 -0
  188. package/out/ui/packages/text/components/Text.d.ts +2 -0
  189. package/out/ui/packages/text/components/Text.luau +12 -2
  190. package/out/ui/packages/timeField/components/TimeField.luau +11 -7
  191. package/out/ui/packages/timeline/components/Timeline.luau +35 -32
  192. package/out/ui/packages/timeline/components/Timeline.styles.luau +19 -10
  193. package/out/ui/packages/toast/components/Toast.luau +168 -72
  194. package/out/ui/packages/toast/components/Toast.styles.luau +36 -19
  195. package/out/ui/packages/toast/components/toastPlace.d.ts +4 -0
  196. package/out/ui/packages/toast/components/toastPlace.luau +13 -0
  197. package/out/ui/packages/toast/enums/ToastVariants.d.ts +2 -1
  198. package/out/ui/packages/toast/enums/ToastVariants.luau +1 -0
  199. package/out/ui/packages/toggleButton/components/ToggleButton.luau +43 -4
  200. package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +1 -1
  201. package/out/ui/packages/tooltip/components/Tooltip.styles.luau +2 -2
  202. package/out/ui/packages/treeView/components/TreeView.luau +12 -13
  203. package/out/ui/packages/treeView/components/TreeView.styles.luau +6 -0
  204. package/out/ui/packages/typography/components/Typography.d.ts +2 -0
  205. package/out/ui/packages/typography/components/Typography.luau +8 -0
  206. package/out/ui/packages/typography/components/Typography.styles.luau +3 -1
  207. package/out/ui/packages/udimEditor/components/UDimEditor.luau +9 -1
  208. package/out/ui/packages/udimEditor/components/UDimEditor.styles.luau +25 -18
  209. package/out/ui/packages/vectorEditor/components/VectorEditor.luau +17 -3
  210. package/out/ui/packages/vectorEditor/components/VectorEditor.styles.luau +30 -16
  211. package/out/ui/packages/virtualList/components/VirtualList.styles.luau +1 -0
  212. package/package.json +69 -67
@@ -0,0 +1,124 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
4
+ local componentStyles = _theme.componentStyles
5
+ local controlMetrics = _theme.controlMetrics
6
+ local createStyles = _theme.createStyles
7
+ local focusRing = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme", "styles", "utilities", "focusRing").focusRing
8
+ local useCodeEditorStyles = componentStyles("CodeEditor", function(theme, _param)
9
+ local focused = _param.focused
10
+ if focused == nil then
11
+ focused = false
12
+ end
13
+ local fieldHeight = _param.fieldHeight
14
+ local triggerWidth = _param.triggerWidth
15
+ local pad = theme.padding.calc(2)
16
+ local _condition = theme.typography.fontSizes.caption
17
+ if _condition == nil then
18
+ _condition = theme.typography.fontSizes.body
19
+ end
20
+ local textSize = _condition
21
+ local metrics = controlMetrics(theme.density, "small")
22
+ local ink = {
23
+ Font = Enum.Font.RobotoMono,
24
+ TextSize = textSize,
25
+ TextColor3 = theme.palette.text.primary,
26
+ TextXAlignment = Enum.TextXAlignment.Left,
27
+ TextYAlignment = Enum.TextYAlignment.Top,
28
+ TextWrapped = true,
29
+ LineHeight = 1,
30
+ }
31
+ local _object = {
32
+ root = {
33
+ AutomaticSize = Enum.AutomaticSize.Y,
34
+ Size = UDim2.new(1, 0, 0, 0),
35
+ BackgroundColor3 = theme.palette.surface.paper,
36
+ BorderSizePixel = 0,
37
+ },
38
+ }
39
+ local _left = "stroke"
40
+ local _object_1 = {
41
+ Color = theme.palette.divider,
42
+ ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
43
+ Thickness = 1,
44
+ Transparency = 0,
45
+ }
46
+ for _k, _v in (if focused then focusRing(theme.palette.focus) else {}) do
47
+ _object_1[_k] = _v
48
+ end
49
+ _object[_left] = _object_1
50
+ _object.corner = {
51
+ CornerRadius = UDim.new(0, theme.shape.borderRadius),
52
+ }
53
+ _object.padding = {
54
+ PaddingTop = UDim.new(0, pad),
55
+ PaddingBottom = UDim.new(0, pad),
56
+ PaddingLeft = UDim.new(0, pad),
57
+ PaddingRight = UDim.new(0, pad),
58
+ }
59
+ _object.stack = {
60
+ FillDirection = Enum.FillDirection.Vertical,
61
+ HorizontalAlignment = Enum.HorizontalAlignment.Left,
62
+ SortOrder = Enum.SortOrder.LayoutOrder,
63
+ Padding = UDim.new(0, theme.padding.calc(1)),
64
+ }
65
+ _object.bar = {
66
+ AutomaticSize = Enum.AutomaticSize.Y,
67
+ Size = UDim2.new(1, 0, 0, 0),
68
+ BackgroundTransparency = 1,
69
+ BorderSizePixel = 0,
70
+ LayoutOrder = 0,
71
+ }
72
+ _object.barRow = {
73
+ FillDirection = Enum.FillDirection.Horizontal,
74
+ HorizontalAlignment = Enum.HorizontalAlignment.Right,
75
+ VerticalAlignment = Enum.VerticalAlignment.Center,
76
+ SortOrder = Enum.SortOrder.LayoutOrder,
77
+ }
78
+ _object.trigger = {
79
+ Size = UDim2.fromOffset(triggerWidth, metrics.height),
80
+ BackgroundColor3 = theme.palette.surface.input,
81
+ BorderSizePixel = 0,
82
+ AutoButtonColor = false,
83
+ Font = theme.typography.fontFamilies.default,
84
+ TextSize = metrics.font,
85
+ TextColor3 = theme.palette.text.primary,
86
+ TextXAlignment = Enum.TextXAlignment.Left,
87
+ }
88
+ _object.triggerStroke = {
89
+ Color = theme.palette.border,
90
+ ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
91
+ Thickness = 1,
92
+ Transparency = 0,
93
+ }
94
+ _object.fieldHost = {
95
+ Size = UDim2.new(1, 0, 0, fieldHeight),
96
+ BackgroundTransparency = 1,
97
+ BorderSizePixel = 0,
98
+ LayoutOrder = 1,
99
+ }
100
+ local _left_1 = "highlight"
101
+ local _object_2 = table.clone(ink)
102
+ setmetatable(_object_2, nil)
103
+ _object_2.Size = UDim2.fromScale(1, 1)
104
+ _object_2.BackgroundTransparency = 1
105
+ _object_2.BorderSizePixel = 0
106
+ _object_2.RichText = true
107
+ _object_2.ZIndex = 1
108
+ _object[_left_1] = _object_2
109
+ local _left_2 = "field"
110
+ local _object_3 = table.clone(ink)
111
+ setmetatable(_object_3, nil)
112
+ _object_3.Size = UDim2.fromScale(1, 1)
113
+ _object_3.BackgroundTransparency = 1
114
+ _object_3.BorderSizePixel = 0
115
+ _object_3.PlaceholderColor3 = theme.palette.text.secondary
116
+ _object_3.ClearTextOnFocus = false
117
+ _object_3.ZIndex = 2
118
+ _object[_left_2] = _object_3
119
+ return createStyles(_object)
120
+ end)
121
+ local default = useCodeEditorStyles
122
+ return {
123
+ default = default,
124
+ }
@@ -0,0 +1,11 @@
1
+ import type { CodeLanguage } from "../markdown/parseMarkdown";
2
+ export interface CodeColors {
3
+ keyword: string;
4
+ string: string;
5
+ number: string;
6
+ comment: string;
7
+ func: string;
8
+ }
9
+ export declare function escapeRich(text: string): string;
10
+ export declare function highlightCode(source: string, language: CodeLanguage, colors: CodeColors): string;
11
+ export declare function colorHex(color: Color3): string;
@@ -0,0 +1,503 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ -- ponytail: lines over 2000 chars stay one plain run. A real lexer if a minified file shows up.
3
+ local MAX_LINE = 2000
4
+ local LUAU = {
5
+ ["and"] = true,
6
+ ["break"] = true,
7
+ continue = true,
8
+ ["do"] = true,
9
+ ["else"] = true,
10
+ ["elseif"] = true,
11
+ ["end"] = true,
12
+ ["false"] = true,
13
+ ["for"] = true,
14
+ ["function"] = true,
15
+ ["if"] = true,
16
+ ["in"] = true,
17
+ ["local"] = true,
18
+ ["nil"] = true,
19
+ ["not"] = true,
20
+ ["or"] = true,
21
+ ["repeat"] = true,
22
+ ["return"] = true,
23
+ ["then"] = true,
24
+ ["true"] = true,
25
+ ["until"] = true,
26
+ ["while"] = true,
27
+ }
28
+ local SCRIPT = {
29
+ as = true,
30
+ async = true,
31
+ await = true,
32
+ ["break"] = true,
33
+ case = true,
34
+ catch = true,
35
+ class = true,
36
+ const = true,
37
+ continue = true,
38
+ default = true,
39
+ ["do"] = true,
40
+ ["else"] = true,
41
+ export = true,
42
+ extends = true,
43
+ ["false"] = true,
44
+ finally = true,
45
+ ["for"] = true,
46
+ from = true,
47
+ ["function"] = true,
48
+ ["if"] = true,
49
+ import = true,
50
+ ["in"] = true,
51
+ interface = true,
52
+ let = true,
53
+ new = true,
54
+ null = true,
55
+ of = true,
56
+ ["return"] = true,
57
+ static = true,
58
+ super = true,
59
+ switch = true,
60
+ this = true,
61
+ throw = true,
62
+ ["true"] = true,
63
+ try = true,
64
+ type = true,
65
+ typeof = true,
66
+ undefined = true,
67
+ var = true,
68
+ void = true,
69
+ ["while"] = true,
70
+ yield = true,
71
+ }
72
+ local JSON_WORD = {
73
+ ["false"] = true,
74
+ null = true,
75
+ ["true"] = true,
76
+ }
77
+ local function words(language)
78
+ if language == "luau" then
79
+ return LUAU
80
+ end
81
+ if language == "ts" then
82
+ return SCRIPT
83
+ end
84
+ if language == "json" then
85
+ return JSON_WORD
86
+ end
87
+ return nil
88
+ end
89
+ local function escapeRich(text)
90
+ local out = ""
91
+ for i = 1, #text do
92
+ local _text = text
93
+ local _i = i
94
+ local _i_1 = i
95
+ local ch = string.sub(_text, _i, _i_1)
96
+ if ch == "&" then
97
+ out ..= "&"
98
+ elseif ch == "<" then
99
+ out ..= "&lt;"
100
+ elseif ch == ">" then
101
+ out ..= "&gt;"
102
+ elseif ch == '"' then
103
+ out ..= "&quot;"
104
+ elseif ch == "'" then
105
+ out ..= "&apos;"
106
+ else
107
+ out ..= ch
108
+ end
109
+ end
110
+ return out
111
+ end
112
+ local function paint(text, kind, colors)
113
+ local safe = escapeRich(text)
114
+ if kind == "plain" or #safe == 0 then
115
+ return safe
116
+ end
117
+ local color = colors[kind]
118
+ if kind == "keyword" then
119
+ return `<font color="{color}"><b>{safe}</b></font>`
120
+ end
121
+ return `<font color="{color}">{safe}</font>`
122
+ end
123
+ local function isDigit(ch)
124
+ return ch >= "0" and ch <= "9"
125
+ end
126
+ local function isIdentStart(ch)
127
+ return (ch >= "A" and ch <= "Z") or (ch >= "a" and ch <= "z") or ch == "_"
128
+ end
129
+ local function isIdent(ch)
130
+ return isIdentStart(ch) or isDigit(ch)
131
+ end
132
+ local function isHex(ch)
133
+ return isDigit(ch) or (ch >= "a" and ch <= "f") or (ch >= "A" and ch <= "F")
134
+ end
135
+ local function findPair(text, a, b, from)
136
+ local last = #text - 1
137
+ do
138
+ local i = from
139
+ local _shouldIncrement = false
140
+ while true do
141
+ if _shouldIncrement then
142
+ i += 1
143
+ else
144
+ _shouldIncrement = true
145
+ end
146
+ if not (i <= last) then
147
+ break
148
+ end
149
+ local _text = text
150
+ local _i = i
151
+ local _i_1 = i
152
+ local _condition = string.sub(_text, _i, _i_1) == a
153
+ if _condition then
154
+ local _text_1 = text
155
+ local _arg0 = i + 1
156
+ local _arg1 = i + 1
157
+ _condition = string.sub(_text_1, _arg0, _arg1) == b
158
+ end
159
+ if _condition then
160
+ return i
161
+ end
162
+ end
163
+ end
164
+ return nil
165
+ end
166
+ local function scanLine(line, language, state, colors)
167
+ local dict = words(language)
168
+ if dict == nil then
169
+ return {
170
+ text = escapeRich(line),
171
+ state = state,
172
+ }
173
+ end
174
+ if #line > MAX_LINE and state.block == nil then
175
+ return {
176
+ text = escapeRich(line),
177
+ state = {
178
+ wantName = false,
179
+ },
180
+ }
181
+ end
182
+ local i = 1
183
+ local limit = math.min(#line, MAX_LINE)
184
+ local out = ""
185
+ local block = state.block
186
+ local wantName = state.wantName
187
+ while i <= limit do
188
+ if block ~= nil then
189
+ local closer = if block == "luau" then "]]" else "*/"
190
+ local at = findPair(line, string.sub(closer, 1, 1), string.sub(closer, 2, 2), i)
191
+ if at == nil or at > limit then
192
+ local _line = line
193
+ local _i = i
194
+ out ..= paint(string.sub(_line, _i), "comment", colors)
195
+ i = #line + 1
196
+ break
197
+ end
198
+ local _line = line
199
+ local _i = i
200
+ local _arg1 = at + 1
201
+ out ..= paint(string.sub(_line, _i, _arg1), "comment", colors)
202
+ i = at + 2
203
+ block = nil
204
+ wantName = false
205
+ continue
206
+ end
207
+ local _line = line
208
+ local _i = i
209
+ local _i_1 = i
210
+ local ch = string.sub(_line, _i, _i_1)
211
+ local _result
212
+ if i < #line then
213
+ local _line_1 = line
214
+ local _arg0 = i + 1
215
+ local _arg1 = i + 1
216
+ _result = string.sub(_line_1, _arg0, _arg1)
217
+ else
218
+ _result = ""
219
+ end
220
+ local ahead = _result
221
+ if language == "luau" and ch == "-" and ahead == "-" then
222
+ local _line_1 = line
223
+ local _arg0 = i + 2
224
+ local _arg1 = i + 3
225
+ if string.sub(_line_1, _arg0, _arg1) == "[[" then
226
+ block = "luau"
227
+ i += 4
228
+ wantName = false
229
+ continue
230
+ end
231
+ local _line_2 = line
232
+ local _i_2 = i
233
+ out ..= paint(string.sub(_line_2, _i_2), "comment", colors)
234
+ wantName = false
235
+ i = #line + 1
236
+ break
237
+ end
238
+ if language ~= "luau" and ch == "/" and ahead == "/" then
239
+ local _line_1 = line
240
+ local _i_2 = i
241
+ out ..= paint(string.sub(_line_1, _i_2), "comment", colors)
242
+ wantName = false
243
+ i = #line + 1
244
+ break
245
+ end
246
+ if language ~= "luau" and ch == "/" and ahead == "*" then
247
+ block = "ts"
248
+ i += 2
249
+ wantName = false
250
+ continue
251
+ end
252
+ if ch == '"' or ch == "'" then
253
+ local j = i + 1
254
+ while j <= #line do
255
+ local _line_1 = line
256
+ local _j = j
257
+ local _j_1 = j
258
+ local c = string.sub(_line_1, _j, _j_1)
259
+ if c == "\\" then
260
+ j += 2
261
+ continue
262
+ end
263
+ if c == ch then
264
+ j += 1
265
+ break
266
+ end
267
+ j += 1
268
+ end
269
+ local _line_1 = line
270
+ local _i_2 = i
271
+ local _arg1 = j - 1
272
+ out ..= paint(string.sub(_line_1, _i_2, _arg1), "string", colors)
273
+ i = j
274
+ wantName = false
275
+ continue
276
+ end
277
+ if language == "luau" and ch == "[" and ahead == "[" then
278
+ local at = findPair(line, "]", "]", i + 2)
279
+ local stop = if at == nil then #line else at + 1
280
+ local _line_1 = line
281
+ local _i_2 = i
282
+ out ..= paint(string.sub(_line_1, _i_2, stop), "string", colors)
283
+ i = stop + 1
284
+ wantName = false
285
+ continue
286
+ end
287
+ if isDigit(ch) then
288
+ local j = i
289
+ if ch == "0" and (ahead == "x" or ahead == "X") and language ~= "json" then
290
+ j = i + 2
291
+ while true do
292
+ local _condition = j <= #line
293
+ if _condition then
294
+ local _line_1 = line
295
+ local _j = j
296
+ local _j_1 = j
297
+ _condition = isHex(string.sub(_line_1, _j, _j_1))
298
+ end
299
+ if not _condition then
300
+ break
301
+ end
302
+ j += 1
303
+ end
304
+ else
305
+ while true do
306
+ local _condition = j <= #line
307
+ if _condition then
308
+ local _line_1 = line
309
+ local _j = j
310
+ local _j_1 = j
311
+ _condition = isDigit(string.sub(_line_1, _j, _j_1))
312
+ end
313
+ if not _condition then
314
+ break
315
+ end
316
+ j += 1
317
+ end
318
+ local _line_1 = line
319
+ local _j = j
320
+ local _j_1 = j
321
+ local _condition = string.sub(_line_1, _j, _j_1) == "."
322
+ if _condition then
323
+ local _line_2 = line
324
+ local _arg0 = j + 1
325
+ local _arg1 = j + 1
326
+ _condition = isDigit(string.sub(_line_2, _arg0, _arg1))
327
+ end
328
+ if _condition then
329
+ j += 1
330
+ while true do
331
+ local _condition_1 = j <= #line
332
+ if _condition_1 then
333
+ local _line_2 = line
334
+ local _j_2 = j
335
+ local _j_3 = j
336
+ _condition_1 = isDigit(string.sub(_line_2, _j_2, _j_3))
337
+ end
338
+ if not _condition_1 then
339
+ break
340
+ end
341
+ j += 1
342
+ end
343
+ end
344
+ local _line_2 = line
345
+ local _j_2 = j
346
+ local _j_3 = j
347
+ local exp = string.sub(_line_2, _j_2, _j_3)
348
+ if exp == "e" or exp == "E" then
349
+ local k = j + 1
350
+ local _line_3 = line
351
+ local _k = k
352
+ local _k_1 = k
353
+ local sign = string.sub(_line_3, _k, _k_1)
354
+ if sign == "+" or sign == "-" then
355
+ k += 1
356
+ end
357
+ local _line_4 = line
358
+ local _k_2 = k
359
+ local _k_3 = k
360
+ if isDigit(string.sub(_line_4, _k_2, _k_3)) then
361
+ j = k
362
+ while true do
363
+ local _condition_1 = j <= #line
364
+ if _condition_1 then
365
+ local _line_5 = line
366
+ local _j_4 = j
367
+ local _j_5 = j
368
+ _condition_1 = isDigit(string.sub(_line_5, _j_4, _j_5))
369
+ end
370
+ if not _condition_1 then
371
+ break
372
+ end
373
+ j += 1
374
+ end
375
+ end
376
+ end
377
+ end
378
+ local _line_1 = line
379
+ local _i_2 = i
380
+ local _arg1 = j - 1
381
+ out ..= paint(string.sub(_line_1, _i_2, _arg1), "number", colors)
382
+ i = j
383
+ wantName = false
384
+ continue
385
+ end
386
+ if isIdentStart(ch) then
387
+ local j = i + 1
388
+ while true do
389
+ local _condition = j <= #line
390
+ if _condition then
391
+ local _line_1 = line
392
+ local _j = j
393
+ local _j_1 = j
394
+ _condition = isIdent(string.sub(_line_1, _j, _j_1))
395
+ end
396
+ if not _condition then
397
+ break
398
+ end
399
+ j += 1
400
+ end
401
+ local _line_1 = line
402
+ local _i_2 = i
403
+ local _arg1 = j - 1
404
+ local word = string.sub(_line_1, _i_2, _arg1)
405
+ if dict[word] == true then
406
+ out ..= paint(word, "keyword", colors)
407
+ wantName = word == "function"
408
+ elseif wantName then
409
+ out ..= paint(word, "func", colors)
410
+ wantName = false
411
+ else
412
+ out ..= paint(word, "plain", colors)
413
+ end
414
+ i = j
415
+ continue
416
+ end
417
+ if ch ~= " " and ch ~= "\t" then
418
+ wantName = false
419
+ end
420
+ out ..= escapeRich(ch)
421
+ i += 1
422
+ end
423
+ if i <= #line then
424
+ local _line = line
425
+ local _i = i
426
+ out ..= escapeRich(string.sub(_line, _i))
427
+ end
428
+ return {
429
+ text = out,
430
+ state = {
431
+ block = block,
432
+ wantName = wantName,
433
+ },
434
+ }
435
+ end
436
+ local function highlightCode(source, language, colors)
437
+ if language == "text" then
438
+ return escapeRich(source)
439
+ end
440
+ local out = ""
441
+ local state = {
442
+ wantName = false,
443
+ }
444
+ local start = 1
445
+ local first = true
446
+ local n = #source
447
+ local emit = function(line)
448
+ local step = scanLine(line, language, state, colors)
449
+ if not first then
450
+ out ..= "\n"
451
+ end
452
+ first = false
453
+ out ..= step.text
454
+ state = step.state
455
+ end
456
+ do
457
+ local i = 1
458
+ local _shouldIncrement = false
459
+ while true do
460
+ if _shouldIncrement then
461
+ i += 1
462
+ else
463
+ _shouldIncrement = true
464
+ end
465
+ if not (i <= n) then
466
+ break
467
+ end
468
+ local _source = source
469
+ local _i = i
470
+ local _i_1 = i
471
+ if string.sub(_source, _i, _i_1) == "\n" then
472
+ local _source_1 = source
473
+ local _start = start
474
+ local _arg1 = i - 1
475
+ emit(string.sub(_source_1, _start, _arg1))
476
+ start = i + 1
477
+ end
478
+ end
479
+ end
480
+ local _source = source
481
+ local _start = start
482
+ emit(string.sub(_source, _start, n))
483
+ return out
484
+ end
485
+ local HEX = "0123456789ABCDEF"
486
+ local function colorHex(color)
487
+ local byte = function(channel)
488
+ local value = math.clamp(math.floor(channel * 255 + 0.5), 0, 255)
489
+ local hi = math.floor(value / 16)
490
+ local _arg0 = hi + 1
491
+ local _arg1 = hi + 1
492
+ local _exp = string.sub(HEX, _arg0, _arg1)
493
+ local _arg0_1 = (value % 16) + 1
494
+ local _arg1_1 = (value % 16) + 1
495
+ return _exp .. string.sub(HEX, _arg0_1, _arg1_1)
496
+ end
497
+ return `#{byte(color.R)}{byte(color.G)}{byte(color.B)}`
498
+ end
499
+ return {
500
+ escapeRich = escapeRich,
501
+ highlightCode = highlightCode,
502
+ colorHex = colorHex,
503
+ }
@@ -0,0 +1,2 @@
1
+ export { default as CodeEditor } from "./components/CodeEditor";
2
+ export type { CodeEditorProps } from "./components/CodeEditor";
@@ -0,0 +1,5 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local exports = {}
4
+ exports.CodeEditor = TS.import(script, script, "components", "CodeEditor").default
5
+ return exports
@@ -7,6 +7,7 @@ local useRef = _react.useRef
7
7
  local useState = _react.useState
8
8
  local UserInputService = TS.import(script, TS.getModule(script, "@rbxts", "services")).UserInputService
9
9
  local useTheme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").useTheme
10
+ local useEditorHover = TS.import(script, script.Parent.Parent.Parent, "editorFace").useEditorHover
10
11
  local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
11
12
  local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
12
13
  local Input = TS.import(script, script.Parent.Parent.Parent, "input").Input
@@ -363,6 +364,7 @@ local function ColorPicker(props)
363
364
  local id = _binding.id
364
365
  local ref = _binding.ref
365
366
  local styles = useColorPickerStyles()
367
+ local hover = useEditorHover(disabled)
366
368
  local _binding_1 = useTheme()
367
369
  local theme = _binding_1.theme
368
370
  local active = canActivate(disabled)
@@ -401,12 +403,18 @@ local function ColorPicker(props)
401
403
  end
402
404
  _attributes.key = _condition
403
405
  _attributes.hostRef = ref
404
- _attributes.base = styles.field
406
+ local _object = table.clone(styles.field)
407
+ setmetatable(_object, nil)
408
+ for _k, _v in hover.face do
409
+ _object[_k] = _v
410
+ end
411
+ _attributes.base = _object
405
412
  _attributes.className = className
406
413
  _attributes.sx = sx
407
414
  _attributes.state = {
408
415
  disabled = disabled,
409
416
  }
417
+ _attributes.Event = hover.event
410
418
  local _attributes_1 = table.clone(styles.rowLayout)
411
419
  setmetatable(_attributes_1, nil)
412
420
  local _exp = React.createElement("uilistlayout", _attributes_1)