@@ -7,6 +7,7 @@ from typing import Any, Dict, Literal, Optional, Union, overload
7
7
8
8
from reflex .base import Base
9
9
from reflex .components .component import Component , ComponentNamespace
10
+ from reflex .components .props import NoExtrasAllowedProps
10
11
from reflex .event import EventType
11
12
from reflex .style import Style
12
13
from reflex .vars .base import Var
@@ -192,6 +193,7 @@ LiteralCodeLanguage = Literal[
192
193
"pascal" ,
193
194
"perl" ,
194
195
"php" ,
196
+ "plain" ,
195
197
"plsql" ,
196
198
"po" ,
197
199
"postcss" ,
@@ -308,7 +310,6 @@ LiteralCodeTheme = Literal[
308
310
"nord" ,
309
311
"one-dark-pro" ,
310
312
"one-light" ,
311
- "plain" ,
312
313
"plastic" ,
313
314
"poimandres" ,
314
315
"red" ,
@@ -328,6 +329,17 @@ LiteralCodeTheme = Literal[
328
329
"vitesse-light" ,
329
330
]
330
331
332
+ class Position (NoExtrasAllowedProps ):
333
+ line : int
334
+ character : int
335
+
336
+ class ShikiDecorations (NoExtrasAllowedProps ):
337
+ start : Union [int , Position ]
338
+ end : Union [int , Position ]
339
+ tag_name : str
340
+ properties : dict [str , Any ]
341
+ always_wrap : bool
342
+
331
343
class ShikiBaseTransformers (Base ):
332
344
library : str
333
345
fns : list [FunctionStringVar ]
@@ -479,6 +491,7 @@ class ShikiCodeBlock(Component):
479
491
"pascal" ,
480
492
"perl" ,
481
493
"php" ,
494
+ "plain" ,
482
495
"plsql" ,
483
496
"po" ,
484
497
"postcss" ,
@@ -694,6 +707,7 @@ class ShikiCodeBlock(Component):
694
707
"pascal" ,
695
708
"perl" ,
696
709
"php" ,
710
+ "plain" ,
697
711
"plsql" ,
698
712
"po" ,
699
713
"postcss" ,
@@ -815,7 +829,6 @@ class ShikiCodeBlock(Component):
815
829
"nord" ,
816
830
"one-dark-pro" ,
817
831
"one-light" ,
818
- "plain" ,
819
832
"plastic" ,
820
833
"poimandres" ,
821
834
"red" ,
@@ -870,7 +883,6 @@ class ShikiCodeBlock(Component):
870
883
"nord" ,
871
884
"one-dark-pro" ,
872
885
"one-light" ,
873
- "plain" ,
874
886
"plastic" ,
875
887
"poimandres" ,
876
888
"red" ,
@@ -906,6 +918,9 @@ class ShikiCodeBlock(Component):
906
918
list [Union [ShikiBaseTransformers , dict [str , Any ]]],
907
919
]
908
920
] = None ,
921
+ decorations : Optional [
922
+ Union [Var [list [ShikiDecorations ]], list [ShikiDecorations ]]
923
+ ] = None ,
909
924
style : Optional [Style ] = None ,
910
925
key : Optional [Any ] = None ,
911
926
id : Optional [Any ] = None ,
@@ -938,6 +953,7 @@ class ShikiCodeBlock(Component):
938
953
themes: The set of themes to use for different modes.
939
954
code: The code to display.
940
955
transformers: The transformers to use for the syntax highlighter.
956
+ decorations: The decorations to use for the syntax highlighter.
941
957
style: The style of the component.
942
958
key: A unique key for the component.
943
959
id: The id for the component.
@@ -965,10 +981,8 @@ class ShikiHighLevelCodeBlock(ShikiCodeBlock):
965
981
* children ,
966
982
use_transformers : Optional [Union [Var [bool ], bool ]] = None ,
967
983
show_line_numbers : Optional [Union [Var [bool ], bool ]] = None ,
968
- can_copy : Optional [Union [Var [bool ], bool ]] = None ,
969
- copy_button : Optional [
970
- Union [Component , Var [Optional [Union [Component , bool ]]], bool ]
971
- ] = None ,
984
+ can_copy : Optional [bool ] = None ,
985
+ copy_button : Optional [Union [Component , bool ]] = None ,
972
986
language : Optional [
973
987
Union [
974
988
Literal [
@@ -1104,6 +1118,7 @@ class ShikiHighLevelCodeBlock(ShikiCodeBlock):
1104
1118
"pascal" ,
1105
1119
"perl" ,
1106
1120
"php" ,
1121
+ "plain" ,
1107
1122
"plsql" ,
1108
1123
"po" ,
1109
1124
"postcss" ,
@@ -1319,6 +1334,7 @@ class ShikiHighLevelCodeBlock(ShikiCodeBlock):
1319
1334
"pascal" ,
1320
1335
"perl" ,
1321
1336
"php" ,
1337
+ "plain" ,
1322
1338
"plsql" ,
1323
1339
"po" ,
1324
1340
"postcss" ,
@@ -1440,7 +1456,6 @@ class ShikiHighLevelCodeBlock(ShikiCodeBlock):
1440
1456
"nord" ,
1441
1457
"one-dark-pro" ,
1442
1458
"one-light" ,
1443
- "plain" ,
1444
1459
"plastic" ,
1445
1460
"poimandres" ,
1446
1461
"red" ,
@@ -1495,7 +1510,6 @@ class ShikiHighLevelCodeBlock(ShikiCodeBlock):
1495
1510
"nord" ,
1496
1511
"one-dark-pro" ,
1497
1512
"one-light" ,
1498
- "plain" ,
1499
1513
"plastic" ,
1500
1514
"poimandres" ,
1501
1515
"red" ,
@@ -1531,6 +1545,9 @@ class ShikiHighLevelCodeBlock(ShikiCodeBlock):
1531
1545
list [Union [ShikiBaseTransformers , dict [str , Any ]]],
1532
1546
]
1533
1547
] = None ,
1548
+ decorations : Optional [
1549
+ Union [Var [list [ShikiDecorations ]], list [ShikiDecorations ]]
1550
+ ] = None ,
1534
1551
style : Optional [Style ] = None ,
1535
1552
key : Optional [Any ] = None ,
1536
1553
id : Optional [Any ] = None ,
@@ -1567,6 +1584,7 @@ class ShikiHighLevelCodeBlock(ShikiCodeBlock):
1567
1584
themes: The set of themes to use for different modes.
1568
1585
code: The code to display.
1569
1586
transformers: The transformers to use for the syntax highlighter.
1587
+ decorations: The decorations to use for the syntax highlighter.
1570
1588
style: The style of the component.
1571
1589
key: A unique key for the component.
1572
1590
id: The id for the component.
@@ -1593,10 +1611,8 @@ class CodeblockNamespace(ComponentNamespace):
1593
1611
* children ,
1594
1612
use_transformers : Optional [Union [Var [bool ], bool ]] = None ,
1595
1613
show_line_numbers : Optional [Union [Var [bool ], bool ]] = None ,
1596
- can_copy : Optional [Union [Var [bool ], bool ]] = None ,
1597
- copy_button : Optional [
1598
- Union [Component , Var [Optional [Union [Component , bool ]]], bool ]
1599
- ] = None ,
1614
+ can_copy : Optional [bool ] = None ,
1615
+ copy_button : Optional [Union [Component , bool ]] = None ,
1600
1616
language : Optional [
1601
1617
Union [
1602
1618
Literal [
@@ -1732,6 +1748,7 @@ class CodeblockNamespace(ComponentNamespace):
1732
1748
"pascal" ,
1733
1749
"perl" ,
1734
1750
"php" ,
1751
+ "plain" ,
1735
1752
"plsql" ,
1736
1753
"po" ,
1737
1754
"postcss" ,
@@ -1947,6 +1964,7 @@ class CodeblockNamespace(ComponentNamespace):
1947
1964
"pascal" ,
1948
1965
"perl" ,
1949
1966
"php" ,
1967
+ "plain" ,
1950
1968
"plsql" ,
1951
1969
"po" ,
1952
1970
"postcss" ,
@@ -2068,7 +2086,6 @@ class CodeblockNamespace(ComponentNamespace):
2068
2086
"nord" ,
2069
2087
"one-dark-pro" ,
2070
2088
"one-light" ,
2071
- "plain" ,
2072
2089
"plastic" ,
2073
2090
"poimandres" ,
2074
2091
"red" ,
@@ -2123,7 +2140,6 @@ class CodeblockNamespace(ComponentNamespace):
2123
2140
"nord" ,
2124
2141
"one-dark-pro" ,
2125
2142
"one-light" ,
2126
- "plain" ,
2127
2143
"plastic" ,
2128
2144
"poimandres" ,
2129
2145
"red" ,
@@ -2159,6 +2175,9 @@ class CodeblockNamespace(ComponentNamespace):
2159
2175
list [Union [ShikiBaseTransformers , dict [str , Any ]]],
2160
2176
]
2161
2177
] = None ,
2178
+ decorations : Optional [
2179
+ Union [Var [list [ShikiDecorations ]], list [ShikiDecorations ]]
2180
+ ] = None ,
2162
2181
style : Optional [Style ] = None ,
2163
2182
key : Optional [Any ] = None ,
2164
2183
id : Optional [Any ] = None ,
@@ -2195,6 +2214,7 @@ class CodeblockNamespace(ComponentNamespace):
2195
2214
themes: The set of themes to use for different modes.
2196
2215
code: The code to display.
2197
2216
transformers: The transformers to use for the syntax highlighter.
2217
+ decorations: The decorations to use for the syntax highlighter.
2198
2218
style: The style of the component.
2199
2219
key: A unique key for the component.
2200
2220
id: The id for the component.
0 commit comments