code.pyi 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625
  1. """Stub file for reflex/components/datadisplay/code.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `reflex/utils/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. import dataclasses
  6. from typing import Any, ClassVar, Literal, Mapping, Optional, Sequence, overload
  7. from reflex.components.component import Component, ComponentNamespace
  8. from reflex.components.core.breakpoints import Breakpoints
  9. from reflex.components.markdown.markdown import MarkdownComponentMap
  10. from reflex.constants.colors import Color
  11. from reflex.event import EventType
  12. from reflex.vars.base import Var
  13. LiteralCodeLanguage = Literal[
  14. "abap",
  15. "abnf",
  16. "actionscript",
  17. "ada",
  18. "agda",
  19. "al",
  20. "antlr4",
  21. "apacheconf",
  22. "apex",
  23. "apl",
  24. "applescript",
  25. "aql",
  26. "arduino",
  27. "arff",
  28. "asciidoc",
  29. "asm6502",
  30. "asmatmel",
  31. "aspnet",
  32. "autohotkey",
  33. "autoit",
  34. "avisynth",
  35. "avro-idl",
  36. "bash",
  37. "basic",
  38. "batch",
  39. "bbcode",
  40. "bicep",
  41. "birb",
  42. "bison",
  43. "bnf",
  44. "brainfuck",
  45. "brightscript",
  46. "bro",
  47. "bsl",
  48. "c",
  49. "cfscript",
  50. "chaiscript",
  51. "cil",
  52. "clike",
  53. "clojure",
  54. "cmake",
  55. "cobol",
  56. "coffeescript",
  57. "concurnas",
  58. "coq",
  59. "core",
  60. "cpp",
  61. "crystal",
  62. "csharp",
  63. "cshtml",
  64. "csp",
  65. "css",
  66. "css-extras",
  67. "csv",
  68. "cypher",
  69. "d",
  70. "dart",
  71. "dataweave",
  72. "dax",
  73. "dhall",
  74. "diff",
  75. "django",
  76. "dns-zone-file",
  77. "docker",
  78. "dot",
  79. "ebnf",
  80. "editorconfig",
  81. "eiffel",
  82. "ejs",
  83. "elixir",
  84. "elm",
  85. "erb",
  86. "erlang",
  87. "etlua",
  88. "excel-formula",
  89. "factor",
  90. "false",
  91. "firestore-security-rules",
  92. "flow",
  93. "fortran",
  94. "fsharp",
  95. "ftl",
  96. "gap",
  97. "gcode",
  98. "gdscript",
  99. "gedcom",
  100. "gherkin",
  101. "git",
  102. "glsl",
  103. "gml",
  104. "gn",
  105. "go",
  106. "go-module",
  107. "graphql",
  108. "groovy",
  109. "haml",
  110. "handlebars",
  111. "haskell",
  112. "haxe",
  113. "hcl",
  114. "hlsl",
  115. "hoon",
  116. "hpkp",
  117. "hsts",
  118. "http",
  119. "ichigojam",
  120. "icon",
  121. "icu-message-format",
  122. "idris",
  123. "iecst",
  124. "ignore",
  125. "index",
  126. "inform7",
  127. "ini",
  128. "io",
  129. "j",
  130. "java",
  131. "javadoc",
  132. "javadoclike",
  133. "javascript",
  134. "javastacktrace",
  135. "jexl",
  136. "jolie",
  137. "jq",
  138. "js-extras",
  139. "js-templates",
  140. "jsdoc",
  141. "json",
  142. "json5",
  143. "jsonp",
  144. "jsstacktrace",
  145. "jsx",
  146. "julia",
  147. "keepalived",
  148. "keyman",
  149. "kotlin",
  150. "kumir",
  151. "kusto",
  152. "latex",
  153. "latte",
  154. "less",
  155. "lilypond",
  156. "liquid",
  157. "lisp",
  158. "livescript",
  159. "llvm",
  160. "log",
  161. "lolcode",
  162. "lua",
  163. "magma",
  164. "makefile",
  165. "markdown",
  166. "markup",
  167. "markup-templating",
  168. "matlab",
  169. "maxscript",
  170. "mel",
  171. "mermaid",
  172. "mizar",
  173. "mongodb",
  174. "monkey",
  175. "moonscript",
  176. "n1ql",
  177. "n4js",
  178. "nand2tetris-hdl",
  179. "naniscript",
  180. "nasm",
  181. "neon",
  182. "nevod",
  183. "nginx",
  184. "nim",
  185. "nix",
  186. "nsis",
  187. "objectivec",
  188. "ocaml",
  189. "opencl",
  190. "openqasm",
  191. "oz",
  192. "parigp",
  193. "parser",
  194. "pascal",
  195. "pascaligo",
  196. "pcaxis",
  197. "peoplecode",
  198. "perl",
  199. "php",
  200. "php-extras",
  201. "phpdoc",
  202. "plsql",
  203. "powerquery",
  204. "powershell",
  205. "processing",
  206. "prolog",
  207. "promql",
  208. "properties",
  209. "protobuf",
  210. "psl",
  211. "pug",
  212. "puppet",
  213. "pure",
  214. "purebasic",
  215. "purescript",
  216. "python",
  217. "q",
  218. "qml",
  219. "qore",
  220. "qsharp",
  221. "r",
  222. "racket",
  223. "reason",
  224. "regex",
  225. "rego",
  226. "renpy",
  227. "rest",
  228. "rip",
  229. "roboconf",
  230. "robotframework",
  231. "ruby",
  232. "rust",
  233. "sas",
  234. "sass",
  235. "scala",
  236. "scheme",
  237. "scss",
  238. "shell-session",
  239. "smali",
  240. "smalltalk",
  241. "smarty",
  242. "sml",
  243. "solidity",
  244. "solution-file",
  245. "soy",
  246. "sparql",
  247. "splunk-spl",
  248. "sqf",
  249. "sql",
  250. "squirrel",
  251. "stan",
  252. "stylus",
  253. "swift",
  254. "systemd",
  255. "t4-cs",
  256. "t4-templating",
  257. "t4-vb",
  258. "tap",
  259. "tcl",
  260. "textile",
  261. "toml",
  262. "tremor",
  263. "tsx",
  264. "tt2",
  265. "turtle",
  266. "twig",
  267. "typescript",
  268. "typoscript",
  269. "unrealscript",
  270. "uorazor",
  271. "uri",
  272. "v",
  273. "vala",
  274. "vbnet",
  275. "velocity",
  276. "verilog",
  277. "vhdl",
  278. "vim",
  279. "visual-basic",
  280. "warpscript",
  281. "wasm",
  282. "web-idl",
  283. "wiki",
  284. "wolfram",
  285. "wren",
  286. "xeora",
  287. "xml-doc",
  288. "xojo",
  289. "xquery",
  290. "yaml",
  291. "yang",
  292. "zig",
  293. ]
  294. def construct_theme_var(theme: str) -> Var[Theme]: ...
  295. @dataclasses.dataclass(init=False)
  296. class Theme:
  297. a11y_dark: ClassVar[Var[Theme]] = construct_theme_var("a11yDark")
  298. atom_dark: ClassVar[Var[Theme]] = construct_theme_var("atomDark")
  299. cb: ClassVar[Var[Theme]] = construct_theme_var("cb")
  300. coldark_cold: ClassVar[Var[Theme]] = construct_theme_var("coldarkCold")
  301. coldark_dark: ClassVar[Var[Theme]] = construct_theme_var("coldarkDark")
  302. coy: ClassVar[Var[Theme]] = construct_theme_var("coy")
  303. coy_without_shadows: ClassVar[Var[Theme]] = construct_theme_var("coyWithoutShadows")
  304. darcula: ClassVar[Var[Theme]] = construct_theme_var("darcula")
  305. dark: ClassVar[Var[Theme]] = construct_theme_var("oneDark")
  306. dracula: ClassVar[Var[Theme]] = construct_theme_var("dracula")
  307. duotone_dark: ClassVar[Var[Theme]] = construct_theme_var("duotoneDark")
  308. duotone_earth: ClassVar[Var[Theme]] = construct_theme_var("duotoneEarth")
  309. duotone_forest: ClassVar[Var[Theme]] = construct_theme_var("duotoneForest")
  310. duotone_light: ClassVar[Var[Theme]] = construct_theme_var("duotoneLight")
  311. duotone_sea: ClassVar[Var[Theme]] = construct_theme_var("duotoneSea")
  312. duotone_space: ClassVar[Var[Theme]] = construct_theme_var("duotoneSpace")
  313. funky: ClassVar[Var[Theme]] = construct_theme_var("funky")
  314. ghcolors: ClassVar[Var[Theme]] = construct_theme_var("ghcolors")
  315. gruvbox_dark: ClassVar[Var[Theme]] = construct_theme_var("gruvboxDark")
  316. gruvbox_light: ClassVar[Var[Theme]] = construct_theme_var("gruvboxLight")
  317. holi_theme: ClassVar[Var[Theme]] = construct_theme_var("holiTheme")
  318. hopscotch: ClassVar[Var[Theme]] = construct_theme_var("hopscotch")
  319. light: ClassVar[Var[Theme]] = construct_theme_var("oneLight")
  320. lucario: ClassVar[Var[Theme]] = construct_theme_var("lucario")
  321. material_dark: ClassVar[Var[Theme]] = construct_theme_var("materialDark")
  322. material_light: ClassVar[Var[Theme]] = construct_theme_var("materialLight")
  323. material_oceanic: ClassVar[Var[Theme]] = construct_theme_var("materialOceanic")
  324. night_owl: ClassVar[Var[Theme]] = construct_theme_var("nightOwl")
  325. nord: ClassVar[Var[Theme]] = construct_theme_var("nord")
  326. okaidia: ClassVar[Var[Theme]] = construct_theme_var("okaidia")
  327. one_dark: ClassVar[Var[Theme]] = construct_theme_var("oneDark")
  328. one_light: ClassVar[Var[Theme]] = construct_theme_var("oneLight")
  329. pojoaque: ClassVar[Var[Theme]] = construct_theme_var("pojoaque")
  330. prism: ClassVar[Var[Theme]] = construct_theme_var("prism")
  331. shades_of_purple: ClassVar[Var[Theme]] = construct_theme_var("shadesOfPurple")
  332. solarized_dark_atom: ClassVar[Var[Theme]] = construct_theme_var("solarizedDarkAtom")
  333. solarizedlight: ClassVar[Var[Theme]] = construct_theme_var("solarizedlight")
  334. synthwave84: ClassVar[Var[Theme]] = construct_theme_var("synthwave84")
  335. tomorrow: ClassVar[Var[Theme]] = construct_theme_var("tomorrow")
  336. twilight: ClassVar[Var[Theme]] = construct_theme_var("twilight")
  337. vs: ClassVar[Var[Theme]] = construct_theme_var("vs")
  338. vs_dark: ClassVar[Var[Theme]] = construct_theme_var("vsDark")
  339. vsc_dark_plus: ClassVar[Var[Theme]] = construct_theme_var("vscDarkPlus")
  340. xonokai: ClassVar[Var[Theme]] = construct_theme_var("xonokai")
  341. z_touch: ClassVar[Var[Theme]] = construct_theme_var("zTouch")
  342. for theme_name in dir(Theme):
  343. if theme_name.startswith("_"):
  344. continue
  345. setattr(Theme, theme_name, getattr(Theme, theme_name)._replace(_var_type=Theme))
  346. class CodeBlock(Component, MarkdownComponentMap):
  347. @overload
  348. @classmethod
  349. def create( # type: ignore
  350. cls,
  351. *children,
  352. theme: Theme | Var[Theme | str] | str | None = None,
  353. language: Literal[
  354. "abap",
  355. "abnf",
  356. "actionscript",
  357. "ada",
  358. "agda",
  359. "al",
  360. "antlr4",
  361. "apacheconf",
  362. "apex",
  363. "apl",
  364. "applescript",
  365. "aql",
  366. "arduino",
  367. "arff",
  368. "asciidoc",
  369. "asm6502",
  370. "asmatmel",
  371. "aspnet",
  372. "autohotkey",
  373. "autoit",
  374. "avisynth",
  375. "avro-idl",
  376. "bash",
  377. "basic",
  378. "batch",
  379. "bbcode",
  380. "bicep",
  381. "birb",
  382. "bison",
  383. "bnf",
  384. "brainfuck",
  385. "brightscript",
  386. "bro",
  387. "bsl",
  388. "c",
  389. "cfscript",
  390. "chaiscript",
  391. "cil",
  392. "clike",
  393. "clojure",
  394. "cmake",
  395. "cobol",
  396. "coffeescript",
  397. "concurnas",
  398. "coq",
  399. "core",
  400. "cpp",
  401. "crystal",
  402. "csharp",
  403. "cshtml",
  404. "csp",
  405. "css",
  406. "css-extras",
  407. "csv",
  408. "cypher",
  409. "d",
  410. "dart",
  411. "dataweave",
  412. "dax",
  413. "dhall",
  414. "diff",
  415. "django",
  416. "dns-zone-file",
  417. "docker",
  418. "dot",
  419. "ebnf",
  420. "editorconfig",
  421. "eiffel",
  422. "ejs",
  423. "elixir",
  424. "elm",
  425. "erb",
  426. "erlang",
  427. "etlua",
  428. "excel-formula",
  429. "factor",
  430. "false",
  431. "firestore-security-rules",
  432. "flow",
  433. "fortran",
  434. "fsharp",
  435. "ftl",
  436. "gap",
  437. "gcode",
  438. "gdscript",
  439. "gedcom",
  440. "gherkin",
  441. "git",
  442. "glsl",
  443. "gml",
  444. "gn",
  445. "go",
  446. "go-module",
  447. "graphql",
  448. "groovy",
  449. "haml",
  450. "handlebars",
  451. "haskell",
  452. "haxe",
  453. "hcl",
  454. "hlsl",
  455. "hoon",
  456. "hpkp",
  457. "hsts",
  458. "http",
  459. "ichigojam",
  460. "icon",
  461. "icu-message-format",
  462. "idris",
  463. "iecst",
  464. "ignore",
  465. "index",
  466. "inform7",
  467. "ini",
  468. "io",
  469. "j",
  470. "java",
  471. "javadoc",
  472. "javadoclike",
  473. "javascript",
  474. "javastacktrace",
  475. "jexl",
  476. "jolie",
  477. "jq",
  478. "js-extras",
  479. "js-templates",
  480. "jsdoc",
  481. "json",
  482. "json5",
  483. "jsonp",
  484. "jsstacktrace",
  485. "jsx",
  486. "julia",
  487. "keepalived",
  488. "keyman",
  489. "kotlin",
  490. "kumir",
  491. "kusto",
  492. "latex",
  493. "latte",
  494. "less",
  495. "lilypond",
  496. "liquid",
  497. "lisp",
  498. "livescript",
  499. "llvm",
  500. "log",
  501. "lolcode",
  502. "lua",
  503. "magma",
  504. "makefile",
  505. "markdown",
  506. "markup",
  507. "markup-templating",
  508. "matlab",
  509. "maxscript",
  510. "mel",
  511. "mermaid",
  512. "mizar",
  513. "mongodb",
  514. "monkey",
  515. "moonscript",
  516. "n1ql",
  517. "n4js",
  518. "nand2tetris-hdl",
  519. "naniscript",
  520. "nasm",
  521. "neon",
  522. "nevod",
  523. "nginx",
  524. "nim",
  525. "nix",
  526. "nsis",
  527. "objectivec",
  528. "ocaml",
  529. "opencl",
  530. "openqasm",
  531. "oz",
  532. "parigp",
  533. "parser",
  534. "pascal",
  535. "pascaligo",
  536. "pcaxis",
  537. "peoplecode",
  538. "perl",
  539. "php",
  540. "php-extras",
  541. "phpdoc",
  542. "plsql",
  543. "powerquery",
  544. "powershell",
  545. "processing",
  546. "prolog",
  547. "promql",
  548. "properties",
  549. "protobuf",
  550. "psl",
  551. "pug",
  552. "puppet",
  553. "pure",
  554. "purebasic",
  555. "purescript",
  556. "python",
  557. "q",
  558. "qml",
  559. "qore",
  560. "qsharp",
  561. "r",
  562. "racket",
  563. "reason",
  564. "regex",
  565. "rego",
  566. "renpy",
  567. "rest",
  568. "rip",
  569. "roboconf",
  570. "robotframework",
  571. "ruby",
  572. "rust",
  573. "sas",
  574. "sass",
  575. "scala",
  576. "scheme",
  577. "scss",
  578. "shell-session",
  579. "smali",
  580. "smalltalk",
  581. "smarty",
  582. "sml",
  583. "solidity",
  584. "solution-file",
  585. "soy",
  586. "sparql",
  587. "splunk-spl",
  588. "sqf",
  589. "sql",
  590. "squirrel",
  591. "stan",
  592. "stylus",
  593. "swift",
  594. "systemd",
  595. "t4-cs",
  596. "t4-templating",
  597. "t4-vb",
  598. "tap",
  599. "tcl",
  600. "textile",
  601. "toml",
  602. "tremor",
  603. "tsx",
  604. "tt2",
  605. "turtle",
  606. "twig",
  607. "typescript",
  608. "typoscript",
  609. "unrealscript",
  610. "uorazor",
  611. "uri",
  612. "v",
  613. "vala",
  614. "vbnet",
  615. "velocity",
  616. "verilog",
  617. "vhdl",
  618. "vim",
  619. "visual-basic",
  620. "warpscript",
  621. "wasm",
  622. "web-idl",
  623. "wiki",
  624. "wolfram",
  625. "wren",
  626. "xeora",
  627. "xml-doc",
  628. "xojo",
  629. "xquery",
  630. "yaml",
  631. "yang",
  632. "zig",
  633. ]
  634. | Var[
  635. Literal[
  636. "abap",
  637. "abnf",
  638. "actionscript",
  639. "ada",
  640. "agda",
  641. "al",
  642. "antlr4",
  643. "apacheconf",
  644. "apex",
  645. "apl",
  646. "applescript",
  647. "aql",
  648. "arduino",
  649. "arff",
  650. "asciidoc",
  651. "asm6502",
  652. "asmatmel",
  653. "aspnet",
  654. "autohotkey",
  655. "autoit",
  656. "avisynth",
  657. "avro-idl",
  658. "bash",
  659. "basic",
  660. "batch",
  661. "bbcode",
  662. "bicep",
  663. "birb",
  664. "bison",
  665. "bnf",
  666. "brainfuck",
  667. "brightscript",
  668. "bro",
  669. "bsl",
  670. "c",
  671. "cfscript",
  672. "chaiscript",
  673. "cil",
  674. "clike",
  675. "clojure",
  676. "cmake",
  677. "cobol",
  678. "coffeescript",
  679. "concurnas",
  680. "coq",
  681. "core",
  682. "cpp",
  683. "crystal",
  684. "csharp",
  685. "cshtml",
  686. "csp",
  687. "css",
  688. "css-extras",
  689. "csv",
  690. "cypher",
  691. "d",
  692. "dart",
  693. "dataweave",
  694. "dax",
  695. "dhall",
  696. "diff",
  697. "django",
  698. "dns-zone-file",
  699. "docker",
  700. "dot",
  701. "ebnf",
  702. "editorconfig",
  703. "eiffel",
  704. "ejs",
  705. "elixir",
  706. "elm",
  707. "erb",
  708. "erlang",
  709. "etlua",
  710. "excel-formula",
  711. "factor",
  712. "false",
  713. "firestore-security-rules",
  714. "flow",
  715. "fortran",
  716. "fsharp",
  717. "ftl",
  718. "gap",
  719. "gcode",
  720. "gdscript",
  721. "gedcom",
  722. "gherkin",
  723. "git",
  724. "glsl",
  725. "gml",
  726. "gn",
  727. "go",
  728. "go-module",
  729. "graphql",
  730. "groovy",
  731. "haml",
  732. "handlebars",
  733. "haskell",
  734. "haxe",
  735. "hcl",
  736. "hlsl",
  737. "hoon",
  738. "hpkp",
  739. "hsts",
  740. "http",
  741. "ichigojam",
  742. "icon",
  743. "icu-message-format",
  744. "idris",
  745. "iecst",
  746. "ignore",
  747. "index",
  748. "inform7",
  749. "ini",
  750. "io",
  751. "j",
  752. "java",
  753. "javadoc",
  754. "javadoclike",
  755. "javascript",
  756. "javastacktrace",
  757. "jexl",
  758. "jolie",
  759. "jq",
  760. "js-extras",
  761. "js-templates",
  762. "jsdoc",
  763. "json",
  764. "json5",
  765. "jsonp",
  766. "jsstacktrace",
  767. "jsx",
  768. "julia",
  769. "keepalived",
  770. "keyman",
  771. "kotlin",
  772. "kumir",
  773. "kusto",
  774. "latex",
  775. "latte",
  776. "less",
  777. "lilypond",
  778. "liquid",
  779. "lisp",
  780. "livescript",
  781. "llvm",
  782. "log",
  783. "lolcode",
  784. "lua",
  785. "magma",
  786. "makefile",
  787. "markdown",
  788. "markup",
  789. "markup-templating",
  790. "matlab",
  791. "maxscript",
  792. "mel",
  793. "mermaid",
  794. "mizar",
  795. "mongodb",
  796. "monkey",
  797. "moonscript",
  798. "n1ql",
  799. "n4js",
  800. "nand2tetris-hdl",
  801. "naniscript",
  802. "nasm",
  803. "neon",
  804. "nevod",
  805. "nginx",
  806. "nim",
  807. "nix",
  808. "nsis",
  809. "objectivec",
  810. "ocaml",
  811. "opencl",
  812. "openqasm",
  813. "oz",
  814. "parigp",
  815. "parser",
  816. "pascal",
  817. "pascaligo",
  818. "pcaxis",
  819. "peoplecode",
  820. "perl",
  821. "php",
  822. "php-extras",
  823. "phpdoc",
  824. "plsql",
  825. "powerquery",
  826. "powershell",
  827. "processing",
  828. "prolog",
  829. "promql",
  830. "properties",
  831. "protobuf",
  832. "psl",
  833. "pug",
  834. "puppet",
  835. "pure",
  836. "purebasic",
  837. "purescript",
  838. "python",
  839. "q",
  840. "qml",
  841. "qore",
  842. "qsharp",
  843. "r",
  844. "racket",
  845. "reason",
  846. "regex",
  847. "rego",
  848. "renpy",
  849. "rest",
  850. "rip",
  851. "roboconf",
  852. "robotframework",
  853. "ruby",
  854. "rust",
  855. "sas",
  856. "sass",
  857. "scala",
  858. "scheme",
  859. "scss",
  860. "shell-session",
  861. "smali",
  862. "smalltalk",
  863. "smarty",
  864. "sml",
  865. "solidity",
  866. "solution-file",
  867. "soy",
  868. "sparql",
  869. "splunk-spl",
  870. "sqf",
  871. "sql",
  872. "squirrel",
  873. "stan",
  874. "stylus",
  875. "swift",
  876. "systemd",
  877. "t4-cs",
  878. "t4-templating",
  879. "t4-vb",
  880. "tap",
  881. "tcl",
  882. "textile",
  883. "toml",
  884. "tremor",
  885. "tsx",
  886. "tt2",
  887. "turtle",
  888. "twig",
  889. "typescript",
  890. "typoscript",
  891. "unrealscript",
  892. "uorazor",
  893. "uri",
  894. "v",
  895. "vala",
  896. "vbnet",
  897. "velocity",
  898. "verilog",
  899. "vhdl",
  900. "vim",
  901. "visual-basic",
  902. "warpscript",
  903. "wasm",
  904. "web-idl",
  905. "wiki",
  906. "wolfram",
  907. "wren",
  908. "xeora",
  909. "xml-doc",
  910. "xojo",
  911. "xquery",
  912. "yaml",
  913. "yang",
  914. "zig",
  915. ]
  916. ]
  917. | None = None,
  918. code: Var[str] | str | None = None,
  919. show_line_numbers: Var[bool] | bool | None = None,
  920. starting_line_number: Var[int] | int | None = None,
  921. wrap_long_lines: Var[bool] | bool | None = None,
  922. custom_style: dict[str, str | Var | Color] | None = None,
  923. code_tag_props: Var[dict[str, str]] | dict[str, str] | None = None,
  924. can_copy: bool | None = None,
  925. copy_button: Component | bool | None = None,
  926. style: Sequence[Mapping[str, Any]]
  927. | Mapping[str, Any]
  928. | Var[Mapping[str, Any]]
  929. | Breakpoints
  930. | None = None,
  931. key: Any | None = None,
  932. id: Any | None = None,
  933. class_name: Any | None = None,
  934. autofocus: bool | None = None,
  935. custom_attrs: dict[str, Var | Any] | None = None,
  936. on_blur: Optional[EventType[()]] = None,
  937. on_click: Optional[EventType[()]] = None,
  938. on_context_menu: Optional[EventType[()]] = None,
  939. on_double_click: Optional[EventType[()]] = None,
  940. on_focus: Optional[EventType[()]] = None,
  941. on_mount: Optional[EventType[()]] = None,
  942. on_mouse_down: Optional[EventType[()]] = None,
  943. on_mouse_enter: Optional[EventType[()]] = None,
  944. on_mouse_leave: Optional[EventType[()]] = None,
  945. on_mouse_move: Optional[EventType[()]] = None,
  946. on_mouse_out: Optional[EventType[()]] = None,
  947. on_mouse_over: Optional[EventType[()]] = None,
  948. on_mouse_up: Optional[EventType[()]] = None,
  949. on_scroll: Optional[EventType[()]] = None,
  950. on_unmount: Optional[EventType[()]] = None,
  951. **props,
  952. ) -> "CodeBlock":
  953. """Create a text component.
  954. Args:
  955. *children: The children of the component.
  956. theme: The theme to use ("light" or "dark").
  957. language: The language to use.
  958. code: The code to display.
  959. show_line_numbers: If this is enabled line numbers will be shown next to the code block.
  960. starting_line_number: The starting line number to use.
  961. wrap_long_lines: Whether to wrap long lines.
  962. custom_style: A custom style for the code block.
  963. code_tag_props: Props passed down to the code tag.
  964. can_copy: Whether a copy button should appear.
  965. copy_button: A custom copy button to override the default one.
  966. style: The style of the component.
  967. key: A unique key for the component.
  968. id: The id for the component.
  969. class_name: The class name for the component.
  970. autofocus: Whether the component should take the focus once the page is loaded
  971. custom_attrs: custom attribute
  972. **props: The props to pass to the component.
  973. Returns:
  974. The text component.
  975. """
  976. ...
  977. def add_style(self): ...
  978. @classmethod
  979. def get_component_map_custom_code(cls) -> Var: ...
  980. def add_hooks(self) -> list[str | Var]: ...
  981. class CodeblockNamespace(ComponentNamespace):
  982. themes = Theme
  983. @staticmethod
  984. def __call__(
  985. *children,
  986. theme: Theme | Var[Theme | str] | str | None = None,
  987. language: Literal[
  988. "abap",
  989. "abnf",
  990. "actionscript",
  991. "ada",
  992. "agda",
  993. "al",
  994. "antlr4",
  995. "apacheconf",
  996. "apex",
  997. "apl",
  998. "applescript",
  999. "aql",
  1000. "arduino",
  1001. "arff",
  1002. "asciidoc",
  1003. "asm6502",
  1004. "asmatmel",
  1005. "aspnet",
  1006. "autohotkey",
  1007. "autoit",
  1008. "avisynth",
  1009. "avro-idl",
  1010. "bash",
  1011. "basic",
  1012. "batch",
  1013. "bbcode",
  1014. "bicep",
  1015. "birb",
  1016. "bison",
  1017. "bnf",
  1018. "brainfuck",
  1019. "brightscript",
  1020. "bro",
  1021. "bsl",
  1022. "c",
  1023. "cfscript",
  1024. "chaiscript",
  1025. "cil",
  1026. "clike",
  1027. "clojure",
  1028. "cmake",
  1029. "cobol",
  1030. "coffeescript",
  1031. "concurnas",
  1032. "coq",
  1033. "core",
  1034. "cpp",
  1035. "crystal",
  1036. "csharp",
  1037. "cshtml",
  1038. "csp",
  1039. "css",
  1040. "css-extras",
  1041. "csv",
  1042. "cypher",
  1043. "d",
  1044. "dart",
  1045. "dataweave",
  1046. "dax",
  1047. "dhall",
  1048. "diff",
  1049. "django",
  1050. "dns-zone-file",
  1051. "docker",
  1052. "dot",
  1053. "ebnf",
  1054. "editorconfig",
  1055. "eiffel",
  1056. "ejs",
  1057. "elixir",
  1058. "elm",
  1059. "erb",
  1060. "erlang",
  1061. "etlua",
  1062. "excel-formula",
  1063. "factor",
  1064. "false",
  1065. "firestore-security-rules",
  1066. "flow",
  1067. "fortran",
  1068. "fsharp",
  1069. "ftl",
  1070. "gap",
  1071. "gcode",
  1072. "gdscript",
  1073. "gedcom",
  1074. "gherkin",
  1075. "git",
  1076. "glsl",
  1077. "gml",
  1078. "gn",
  1079. "go",
  1080. "go-module",
  1081. "graphql",
  1082. "groovy",
  1083. "haml",
  1084. "handlebars",
  1085. "haskell",
  1086. "haxe",
  1087. "hcl",
  1088. "hlsl",
  1089. "hoon",
  1090. "hpkp",
  1091. "hsts",
  1092. "http",
  1093. "ichigojam",
  1094. "icon",
  1095. "icu-message-format",
  1096. "idris",
  1097. "iecst",
  1098. "ignore",
  1099. "index",
  1100. "inform7",
  1101. "ini",
  1102. "io",
  1103. "j",
  1104. "java",
  1105. "javadoc",
  1106. "javadoclike",
  1107. "javascript",
  1108. "javastacktrace",
  1109. "jexl",
  1110. "jolie",
  1111. "jq",
  1112. "js-extras",
  1113. "js-templates",
  1114. "jsdoc",
  1115. "json",
  1116. "json5",
  1117. "jsonp",
  1118. "jsstacktrace",
  1119. "jsx",
  1120. "julia",
  1121. "keepalived",
  1122. "keyman",
  1123. "kotlin",
  1124. "kumir",
  1125. "kusto",
  1126. "latex",
  1127. "latte",
  1128. "less",
  1129. "lilypond",
  1130. "liquid",
  1131. "lisp",
  1132. "livescript",
  1133. "llvm",
  1134. "log",
  1135. "lolcode",
  1136. "lua",
  1137. "magma",
  1138. "makefile",
  1139. "markdown",
  1140. "markup",
  1141. "markup-templating",
  1142. "matlab",
  1143. "maxscript",
  1144. "mel",
  1145. "mermaid",
  1146. "mizar",
  1147. "mongodb",
  1148. "monkey",
  1149. "moonscript",
  1150. "n1ql",
  1151. "n4js",
  1152. "nand2tetris-hdl",
  1153. "naniscript",
  1154. "nasm",
  1155. "neon",
  1156. "nevod",
  1157. "nginx",
  1158. "nim",
  1159. "nix",
  1160. "nsis",
  1161. "objectivec",
  1162. "ocaml",
  1163. "opencl",
  1164. "openqasm",
  1165. "oz",
  1166. "parigp",
  1167. "parser",
  1168. "pascal",
  1169. "pascaligo",
  1170. "pcaxis",
  1171. "peoplecode",
  1172. "perl",
  1173. "php",
  1174. "php-extras",
  1175. "phpdoc",
  1176. "plsql",
  1177. "powerquery",
  1178. "powershell",
  1179. "processing",
  1180. "prolog",
  1181. "promql",
  1182. "properties",
  1183. "protobuf",
  1184. "psl",
  1185. "pug",
  1186. "puppet",
  1187. "pure",
  1188. "purebasic",
  1189. "purescript",
  1190. "python",
  1191. "q",
  1192. "qml",
  1193. "qore",
  1194. "qsharp",
  1195. "r",
  1196. "racket",
  1197. "reason",
  1198. "regex",
  1199. "rego",
  1200. "renpy",
  1201. "rest",
  1202. "rip",
  1203. "roboconf",
  1204. "robotframework",
  1205. "ruby",
  1206. "rust",
  1207. "sas",
  1208. "sass",
  1209. "scala",
  1210. "scheme",
  1211. "scss",
  1212. "shell-session",
  1213. "smali",
  1214. "smalltalk",
  1215. "smarty",
  1216. "sml",
  1217. "solidity",
  1218. "solution-file",
  1219. "soy",
  1220. "sparql",
  1221. "splunk-spl",
  1222. "sqf",
  1223. "sql",
  1224. "squirrel",
  1225. "stan",
  1226. "stylus",
  1227. "swift",
  1228. "systemd",
  1229. "t4-cs",
  1230. "t4-templating",
  1231. "t4-vb",
  1232. "tap",
  1233. "tcl",
  1234. "textile",
  1235. "toml",
  1236. "tremor",
  1237. "tsx",
  1238. "tt2",
  1239. "turtle",
  1240. "twig",
  1241. "typescript",
  1242. "typoscript",
  1243. "unrealscript",
  1244. "uorazor",
  1245. "uri",
  1246. "v",
  1247. "vala",
  1248. "vbnet",
  1249. "velocity",
  1250. "verilog",
  1251. "vhdl",
  1252. "vim",
  1253. "visual-basic",
  1254. "warpscript",
  1255. "wasm",
  1256. "web-idl",
  1257. "wiki",
  1258. "wolfram",
  1259. "wren",
  1260. "xeora",
  1261. "xml-doc",
  1262. "xojo",
  1263. "xquery",
  1264. "yaml",
  1265. "yang",
  1266. "zig",
  1267. ]
  1268. | Var[
  1269. Literal[
  1270. "abap",
  1271. "abnf",
  1272. "actionscript",
  1273. "ada",
  1274. "agda",
  1275. "al",
  1276. "antlr4",
  1277. "apacheconf",
  1278. "apex",
  1279. "apl",
  1280. "applescript",
  1281. "aql",
  1282. "arduino",
  1283. "arff",
  1284. "asciidoc",
  1285. "asm6502",
  1286. "asmatmel",
  1287. "aspnet",
  1288. "autohotkey",
  1289. "autoit",
  1290. "avisynth",
  1291. "avro-idl",
  1292. "bash",
  1293. "basic",
  1294. "batch",
  1295. "bbcode",
  1296. "bicep",
  1297. "birb",
  1298. "bison",
  1299. "bnf",
  1300. "brainfuck",
  1301. "brightscript",
  1302. "bro",
  1303. "bsl",
  1304. "c",
  1305. "cfscript",
  1306. "chaiscript",
  1307. "cil",
  1308. "clike",
  1309. "clojure",
  1310. "cmake",
  1311. "cobol",
  1312. "coffeescript",
  1313. "concurnas",
  1314. "coq",
  1315. "core",
  1316. "cpp",
  1317. "crystal",
  1318. "csharp",
  1319. "cshtml",
  1320. "csp",
  1321. "css",
  1322. "css-extras",
  1323. "csv",
  1324. "cypher",
  1325. "d",
  1326. "dart",
  1327. "dataweave",
  1328. "dax",
  1329. "dhall",
  1330. "diff",
  1331. "django",
  1332. "dns-zone-file",
  1333. "docker",
  1334. "dot",
  1335. "ebnf",
  1336. "editorconfig",
  1337. "eiffel",
  1338. "ejs",
  1339. "elixir",
  1340. "elm",
  1341. "erb",
  1342. "erlang",
  1343. "etlua",
  1344. "excel-formula",
  1345. "factor",
  1346. "false",
  1347. "firestore-security-rules",
  1348. "flow",
  1349. "fortran",
  1350. "fsharp",
  1351. "ftl",
  1352. "gap",
  1353. "gcode",
  1354. "gdscript",
  1355. "gedcom",
  1356. "gherkin",
  1357. "git",
  1358. "glsl",
  1359. "gml",
  1360. "gn",
  1361. "go",
  1362. "go-module",
  1363. "graphql",
  1364. "groovy",
  1365. "haml",
  1366. "handlebars",
  1367. "haskell",
  1368. "haxe",
  1369. "hcl",
  1370. "hlsl",
  1371. "hoon",
  1372. "hpkp",
  1373. "hsts",
  1374. "http",
  1375. "ichigojam",
  1376. "icon",
  1377. "icu-message-format",
  1378. "idris",
  1379. "iecst",
  1380. "ignore",
  1381. "index",
  1382. "inform7",
  1383. "ini",
  1384. "io",
  1385. "j",
  1386. "java",
  1387. "javadoc",
  1388. "javadoclike",
  1389. "javascript",
  1390. "javastacktrace",
  1391. "jexl",
  1392. "jolie",
  1393. "jq",
  1394. "js-extras",
  1395. "js-templates",
  1396. "jsdoc",
  1397. "json",
  1398. "json5",
  1399. "jsonp",
  1400. "jsstacktrace",
  1401. "jsx",
  1402. "julia",
  1403. "keepalived",
  1404. "keyman",
  1405. "kotlin",
  1406. "kumir",
  1407. "kusto",
  1408. "latex",
  1409. "latte",
  1410. "less",
  1411. "lilypond",
  1412. "liquid",
  1413. "lisp",
  1414. "livescript",
  1415. "llvm",
  1416. "log",
  1417. "lolcode",
  1418. "lua",
  1419. "magma",
  1420. "makefile",
  1421. "markdown",
  1422. "markup",
  1423. "markup-templating",
  1424. "matlab",
  1425. "maxscript",
  1426. "mel",
  1427. "mermaid",
  1428. "mizar",
  1429. "mongodb",
  1430. "monkey",
  1431. "moonscript",
  1432. "n1ql",
  1433. "n4js",
  1434. "nand2tetris-hdl",
  1435. "naniscript",
  1436. "nasm",
  1437. "neon",
  1438. "nevod",
  1439. "nginx",
  1440. "nim",
  1441. "nix",
  1442. "nsis",
  1443. "objectivec",
  1444. "ocaml",
  1445. "opencl",
  1446. "openqasm",
  1447. "oz",
  1448. "parigp",
  1449. "parser",
  1450. "pascal",
  1451. "pascaligo",
  1452. "pcaxis",
  1453. "peoplecode",
  1454. "perl",
  1455. "php",
  1456. "php-extras",
  1457. "phpdoc",
  1458. "plsql",
  1459. "powerquery",
  1460. "powershell",
  1461. "processing",
  1462. "prolog",
  1463. "promql",
  1464. "properties",
  1465. "protobuf",
  1466. "psl",
  1467. "pug",
  1468. "puppet",
  1469. "pure",
  1470. "purebasic",
  1471. "purescript",
  1472. "python",
  1473. "q",
  1474. "qml",
  1475. "qore",
  1476. "qsharp",
  1477. "r",
  1478. "racket",
  1479. "reason",
  1480. "regex",
  1481. "rego",
  1482. "renpy",
  1483. "rest",
  1484. "rip",
  1485. "roboconf",
  1486. "robotframework",
  1487. "ruby",
  1488. "rust",
  1489. "sas",
  1490. "sass",
  1491. "scala",
  1492. "scheme",
  1493. "scss",
  1494. "shell-session",
  1495. "smali",
  1496. "smalltalk",
  1497. "smarty",
  1498. "sml",
  1499. "solidity",
  1500. "solution-file",
  1501. "soy",
  1502. "sparql",
  1503. "splunk-spl",
  1504. "sqf",
  1505. "sql",
  1506. "squirrel",
  1507. "stan",
  1508. "stylus",
  1509. "swift",
  1510. "systemd",
  1511. "t4-cs",
  1512. "t4-templating",
  1513. "t4-vb",
  1514. "tap",
  1515. "tcl",
  1516. "textile",
  1517. "toml",
  1518. "tremor",
  1519. "tsx",
  1520. "tt2",
  1521. "turtle",
  1522. "twig",
  1523. "typescript",
  1524. "typoscript",
  1525. "unrealscript",
  1526. "uorazor",
  1527. "uri",
  1528. "v",
  1529. "vala",
  1530. "vbnet",
  1531. "velocity",
  1532. "verilog",
  1533. "vhdl",
  1534. "vim",
  1535. "visual-basic",
  1536. "warpscript",
  1537. "wasm",
  1538. "web-idl",
  1539. "wiki",
  1540. "wolfram",
  1541. "wren",
  1542. "xeora",
  1543. "xml-doc",
  1544. "xojo",
  1545. "xquery",
  1546. "yaml",
  1547. "yang",
  1548. "zig",
  1549. ]
  1550. ]
  1551. | None = None,
  1552. code: Var[str] | str | None = None,
  1553. show_line_numbers: Var[bool] | bool | None = None,
  1554. starting_line_number: Var[int] | int | None = None,
  1555. wrap_long_lines: Var[bool] | bool | None = None,
  1556. custom_style: dict[str, str | Var | Color] | None = None,
  1557. code_tag_props: Var[dict[str, str]] | dict[str, str] | None = None,
  1558. can_copy: bool | None = None,
  1559. copy_button: Component | bool | None = None,
  1560. style: Sequence[Mapping[str, Any]]
  1561. | Mapping[str, Any]
  1562. | Var[Mapping[str, Any]]
  1563. | Breakpoints
  1564. | None = None,
  1565. key: Any | None = None,
  1566. id: Any | None = None,
  1567. class_name: Any | None = None,
  1568. autofocus: bool | None = None,
  1569. custom_attrs: dict[str, Var | Any] | None = None,
  1570. on_blur: Optional[EventType[()]] = None,
  1571. on_click: Optional[EventType[()]] = None,
  1572. on_context_menu: Optional[EventType[()]] = None,
  1573. on_double_click: Optional[EventType[()]] = None,
  1574. on_focus: Optional[EventType[()]] = None,
  1575. on_mount: Optional[EventType[()]] = None,
  1576. on_mouse_down: Optional[EventType[()]] = None,
  1577. on_mouse_enter: Optional[EventType[()]] = None,
  1578. on_mouse_leave: Optional[EventType[()]] = None,
  1579. on_mouse_move: Optional[EventType[()]] = None,
  1580. on_mouse_out: Optional[EventType[()]] = None,
  1581. on_mouse_over: Optional[EventType[()]] = None,
  1582. on_mouse_up: Optional[EventType[()]] = None,
  1583. on_scroll: Optional[EventType[()]] = None,
  1584. on_unmount: Optional[EventType[()]] = None,
  1585. **props,
  1586. ) -> "CodeBlock":
  1587. """Create a text component.
  1588. Args:
  1589. *children: The children of the component.
  1590. theme: The theme to use ("light" or "dark").
  1591. language: The language to use.
  1592. code: The code to display.
  1593. show_line_numbers: If this is enabled line numbers will be shown next to the code block.
  1594. starting_line_number: The starting line number to use.
  1595. wrap_long_lines: Whether to wrap long lines.
  1596. custom_style: A custom style for the code block.
  1597. code_tag_props: Props passed down to the code tag.
  1598. can_copy: Whether a copy button should appear.
  1599. copy_button: A custom copy button to override the default one.
  1600. style: The style of the component.
  1601. key: A unique key for the component.
  1602. id: The id for the component.
  1603. class_name: The class name for the component.
  1604. autofocus: Whether the component should take the focus once the page is loaded
  1605. custom_attrs: custom attribute
  1606. **props: The props to pass to the component.
  1607. Returns:
  1608. The text component.
  1609. """
  1610. ...
  1611. code_block = CodeblockNamespace()