@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
|
@@ -2,19 +2,23 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
4
|
local componentStyles = _theme.componentStyles
|
|
5
|
+
local controlMetrics = _theme.controlMetrics
|
|
5
6
|
local createStyles = _theme.createStyles
|
|
7
|
+
local grip = 22
|
|
6
8
|
local useMarkdownEditorStyles = componentStyles("MarkdownEditor", function(theme, _param)
|
|
7
9
|
local fullscreen = _param.fullscreen
|
|
8
10
|
local compact = _param.compact
|
|
11
|
+
local gripped = _param.gripped
|
|
9
12
|
local pad = if compact == true or theme.density == "compact" then theme.padding.calc(1) else theme.padding.calc(1.5)
|
|
10
|
-
local
|
|
13
|
+
local glyph = controlMetrics(theme.density, if compact == true then "small" else nil).icon
|
|
14
|
+
return createStyles({
|
|
11
15
|
root = {
|
|
12
16
|
Size = if fullscreen == true then UDim2.fromScale(1, 1) else UDim2.new(1, 0, 1, 0),
|
|
13
17
|
BackgroundColor3 = theme.palette.surface.paper,
|
|
14
18
|
BorderSizePixel = 0,
|
|
15
19
|
},
|
|
16
20
|
content = {
|
|
17
|
-
Size = UDim2.
|
|
21
|
+
Size = UDim2.new(1, 0, 1, if gripped == true then -grip else 0),
|
|
18
22
|
BackgroundTransparency = 1,
|
|
19
23
|
BorderSizePixel = 0,
|
|
20
24
|
},
|
|
@@ -50,7 +54,80 @@ local useMarkdownEditorStyles = componentStyles("MarkdownEditor", function(theme
|
|
|
50
54
|
HorizontalAlignment = Enum.HorizontalAlignment.Left,
|
|
51
55
|
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
52
56
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
53
|
-
Padding = UDim.new(0, theme.
|
|
57
|
+
Padding = UDim.new(0, theme.spacing.calc(1)),
|
|
58
|
+
},
|
|
59
|
+
toolbarIcon = {
|
|
60
|
+
Size = UDim2.fromOffset(glyph + theme.padding.calc(2), glyph + theme.padding.calc(2)),
|
|
61
|
+
LayoutOrder = 3,
|
|
62
|
+
},
|
|
63
|
+
toolbarGlyph = {
|
|
64
|
+
Size = UDim2.fromOffset(glyph, glyph),
|
|
65
|
+
ImageColor3 = theme.palette.text.secondary,
|
|
66
|
+
},
|
|
67
|
+
htmlWrap = {
|
|
68
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
69
|
+
Size = UDim2.new(1, 0, 0, 0),
|
|
70
|
+
BackgroundTransparency = 1,
|
|
71
|
+
BorderSizePixel = 0,
|
|
72
|
+
LayoutOrder = 2,
|
|
73
|
+
},
|
|
74
|
+
htmlGap = {
|
|
75
|
+
PaddingTop = UDim.new(0, theme.spacing.calc(1)),
|
|
76
|
+
PaddingLeft = UDim.new(0, theme.spacing.calc(1)),
|
|
77
|
+
PaddingRight = UDim.new(0, theme.spacing.calc(1)),
|
|
78
|
+
},
|
|
79
|
+
htmlSurface = {
|
|
80
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
81
|
+
Size = UDim2.new(1, 0, 0, 0),
|
|
82
|
+
BackgroundColor3 = theme.palette.surface.elevated,
|
|
83
|
+
BorderSizePixel = 0,
|
|
84
|
+
},
|
|
85
|
+
htmlStroke = {
|
|
86
|
+
Color = theme.palette.divider,
|
|
87
|
+
Thickness = 1,
|
|
88
|
+
Transparency = 0,
|
|
89
|
+
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
|
|
90
|
+
},
|
|
91
|
+
htmlCorner = {
|
|
92
|
+
CornerRadius = UDim.new(0, theme.shape.borderRadius),
|
|
93
|
+
},
|
|
94
|
+
htmlPad = {
|
|
95
|
+
PaddingTop = UDim.new(0, theme.padding.calc(2)),
|
|
96
|
+
PaddingBottom = UDim.new(0, theme.padding.calc(2)),
|
|
97
|
+
PaddingLeft = UDim.new(0, theme.padding.calc(2)),
|
|
98
|
+
PaddingRight = UDim.new(0, theme.padding.calc(2)),
|
|
99
|
+
},
|
|
100
|
+
htmlStack = {
|
|
101
|
+
FillDirection = Enum.FillDirection.Vertical,
|
|
102
|
+
HorizontalAlignment = Enum.HorizontalAlignment.Left,
|
|
103
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
104
|
+
Padding = UDim.new(0, theme.spacing.calc(1)),
|
|
105
|
+
},
|
|
106
|
+
htmlHint = {
|
|
107
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
108
|
+
Size = UDim2.new(1, 0, 0, 0),
|
|
109
|
+
BackgroundTransparency = 1,
|
|
110
|
+
BorderSizePixel = 0,
|
|
111
|
+
Font = theme.typography.fontFamilies.default,
|
|
112
|
+
TextSize = theme.typography.fontSizes.body,
|
|
113
|
+
TextColor3 = theme.palette.text.primary,
|
|
114
|
+
TextXAlignment = Enum.TextXAlignment.Left,
|
|
115
|
+
TextWrapped = true,
|
|
116
|
+
LayoutOrder = 1,
|
|
117
|
+
},
|
|
118
|
+
htmlActions = {
|
|
119
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
120
|
+
Size = UDim2.new(1, 0, 0, 0),
|
|
121
|
+
BackgroundTransparency = 1,
|
|
122
|
+
BorderSizePixel = 0,
|
|
123
|
+
LayoutOrder = 3,
|
|
124
|
+
},
|
|
125
|
+
htmlActionsRow = {
|
|
126
|
+
FillDirection = Enum.FillDirection.Horizontal,
|
|
127
|
+
HorizontalAlignment = Enum.HorizontalAlignment.Right,
|
|
128
|
+
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
129
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
130
|
+
Padding = UDim.new(0, theme.spacing.calc(1)),
|
|
54
131
|
},
|
|
55
132
|
spacer = {
|
|
56
133
|
Size = UDim2.new(1, 0, 1, 0),
|
|
@@ -74,86 +151,79 @@ local useMarkdownEditorStyles = componentStyles("MarkdownEditor", function(theme
|
|
|
74
151
|
BackgroundTransparency = 1,
|
|
75
152
|
BorderSizePixel = 0,
|
|
76
153
|
},
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
Size = UDim2.fromScale(1, 1),
|
|
151
|
-
BackgroundTransparency = 1,
|
|
152
|
-
BorderSizePixel = 0,
|
|
153
|
-
Active = true,
|
|
154
|
-
ZIndex = 30,
|
|
155
|
-
}
|
|
156
|
-
return createStyles(_object)
|
|
154
|
+
editor = {
|
|
155
|
+
Size = UDim2.fromScale(1, 1),
|
|
156
|
+
BackgroundColor3 = theme.palette.surface.input,
|
|
157
|
+
BorderSizePixel = 0,
|
|
158
|
+
ClearTextOnFocus = false,
|
|
159
|
+
MultiLine = true,
|
|
160
|
+
TextXAlignment = Enum.TextXAlignment.Left,
|
|
161
|
+
TextYAlignment = Enum.TextYAlignment.Top,
|
|
162
|
+
TextWrapped = true,
|
|
163
|
+
Font = Enum.Font.RobotoMono,
|
|
164
|
+
TextSize = theme.typography.fontSizes.body,
|
|
165
|
+
TextColor3 = theme.palette.text.primary,
|
|
166
|
+
PlaceholderColor3 = theme.palette.text.secondary,
|
|
167
|
+
},
|
|
168
|
+
editorPad = {
|
|
169
|
+
PaddingTop = UDim.new(0, pad),
|
|
170
|
+
PaddingBottom = UDim.new(0, pad),
|
|
171
|
+
PaddingLeft = UDim.new(0, pad),
|
|
172
|
+
PaddingRight = UDim.new(0, pad),
|
|
173
|
+
},
|
|
174
|
+
previewScroll = {
|
|
175
|
+
Size = UDim2.fromScale(1, 1),
|
|
176
|
+
BackgroundTransparency = 1,
|
|
177
|
+
BorderSizePixel = 0,
|
|
178
|
+
ScrollBarThickness = 4,
|
|
179
|
+
ScrollingDirection = Enum.ScrollingDirection.XY,
|
|
180
|
+
CanvasSize = UDim2.new(0, 0, 0, 0),
|
|
181
|
+
AutomaticCanvasSize = Enum.AutomaticSize.XY,
|
|
182
|
+
},
|
|
183
|
+
previewPad = {
|
|
184
|
+
PaddingTop = UDim.new(0, pad),
|
|
185
|
+
PaddingBottom = UDim.new(0, pad),
|
|
186
|
+
PaddingLeft = UDim.new(0, pad),
|
|
187
|
+
PaddingRight = UDim.new(0, pad),
|
|
188
|
+
},
|
|
189
|
+
split = {
|
|
190
|
+
FillDirection = Enum.FillDirection.Horizontal,
|
|
191
|
+
HorizontalAlignment = Enum.HorizontalAlignment.Left,
|
|
192
|
+
VerticalAlignment = Enum.VerticalAlignment.Top,
|
|
193
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
194
|
+
Padding = UDim.new(0, 0),
|
|
195
|
+
},
|
|
196
|
+
divider = {
|
|
197
|
+
Size = UDim2.new(0, 1, 1, 0),
|
|
198
|
+
BackgroundColor3 = theme.palette.divider,
|
|
199
|
+
BorderSizePixel = 0,
|
|
200
|
+
LayoutOrder = 2,
|
|
201
|
+
},
|
|
202
|
+
resizeGrip = {
|
|
203
|
+
AnchorPoint = Vector2.new(1, 1),
|
|
204
|
+
Position = UDim2.fromScale(1, 1),
|
|
205
|
+
Size = UDim2.fromOffset(grip, grip),
|
|
206
|
+
BackgroundColor3 = theme.palette.surface.elevated,
|
|
207
|
+
BackgroundTransparency = 0.15,
|
|
208
|
+
BorderSizePixel = 0,
|
|
209
|
+
AutoButtonColor = false,
|
|
210
|
+
ZIndex = 20,
|
|
211
|
+
},
|
|
212
|
+
resizeMark = {
|
|
213
|
+
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
214
|
+
BackgroundColor3 = theme.palette.text.secondary,
|
|
215
|
+
BorderSizePixel = 0,
|
|
216
|
+
Rotation = -45,
|
|
217
|
+
ZIndex = 21,
|
|
218
|
+
},
|
|
219
|
+
resizeOverlay = {
|
|
220
|
+
Size = UDim2.fromScale(1, 1),
|
|
221
|
+
BackgroundTransparency = 1,
|
|
222
|
+
BorderSizePixel = 0,
|
|
223
|
+
Active = true,
|
|
224
|
+
ZIndex = 30,
|
|
225
|
+
},
|
|
226
|
+
})
|
|
157
227
|
end)
|
|
158
228
|
local default = useMarkdownEditorStyles
|
|
159
229
|
return {
|
|
@@ -4,5 +4,5 @@ export { default as MarkdownEditor } from "./components/MarkdownEditor";
|
|
|
4
4
|
export type { MarkdownEditorProps } from "./components/MarkdownEditor";
|
|
5
5
|
export type { MarkdownEditorMode } from "./components/MarkdownEditor.styles";
|
|
6
6
|
export { parseMarkdown, inlinesToPlain, inlinesToRichText, inlinePieces, markdownLinkPayload } from "./parseMarkdown";
|
|
7
|
-
export type { MdBlock, MdInline, MdPiece, MarkdownLinkPayload } from "./parseMarkdown";
|
|
7
|
+
export type { MdBlock, MdInline, MdPiece, MarkdownLinkPayload, CodeLanguage } from "./parseMarkdown";
|
|
8
8
|
export { htmlToMarkdown } from "./htmlToMarkdown";
|
|
@@ -15,6 +15,8 @@ export type MdInline = {
|
|
|
15
15
|
text: string;
|
|
16
16
|
href: string;
|
|
17
17
|
};
|
|
18
|
+
export type MdAlign = "left" | "center" | "right";
|
|
19
|
+
export type CodeLanguage = "luau" | "ts" | "json" | "text";
|
|
18
20
|
export type MdBlock = {
|
|
19
21
|
kind: "heading";
|
|
20
22
|
level: number;
|
|
@@ -25,13 +27,19 @@ export type MdBlock = {
|
|
|
25
27
|
} | {
|
|
26
28
|
kind: "code";
|
|
27
29
|
text: string;
|
|
30
|
+
language: CodeLanguage;
|
|
28
31
|
} | {
|
|
29
32
|
kind: "list";
|
|
30
33
|
ordered: boolean;
|
|
31
34
|
items: MdInline[][];
|
|
32
35
|
} | {
|
|
33
36
|
kind: "blockquote";
|
|
34
|
-
|
|
37
|
+
paragraphs: MdInline[][];
|
|
38
|
+
} | {
|
|
39
|
+
kind: "table";
|
|
40
|
+
align: MdAlign[];
|
|
41
|
+
header: MdInline[][];
|
|
42
|
+
rows: MdInline[][][];
|
|
35
43
|
} | {
|
|
36
44
|
kind: "hr";
|
|
37
45
|
};
|