code.pyi 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623
  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, Dict, Literal, Optional, Union, overload
  7. from reflex.components.component import Component, ComponentNamespace
  8. from reflex.components.markdown.markdown import MarkdownComponentMap
  9. from reflex.constants.colors import Color
  10. from reflex.event import EventType
  11. from reflex.style import Style
  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: Optional[Union[Theme, Var[Union[Theme, str]], str]] = None,
  353. language: Optional[
  354. Union[
  355. Literal[
  356. "abap",
  357. "abnf",
  358. "actionscript",
  359. "ada",
  360. "agda",
  361. "al",
  362. "antlr4",
  363. "apacheconf",
  364. "apex",
  365. "apl",
  366. "applescript",
  367. "aql",
  368. "arduino",
  369. "arff",
  370. "asciidoc",
  371. "asm6502",
  372. "asmatmel",
  373. "aspnet",
  374. "autohotkey",
  375. "autoit",
  376. "avisynth",
  377. "avro-idl",
  378. "bash",
  379. "basic",
  380. "batch",
  381. "bbcode",
  382. "bicep",
  383. "birb",
  384. "bison",
  385. "bnf",
  386. "brainfuck",
  387. "brightscript",
  388. "bro",
  389. "bsl",
  390. "c",
  391. "cfscript",
  392. "chaiscript",
  393. "cil",
  394. "clike",
  395. "clojure",
  396. "cmake",
  397. "cobol",
  398. "coffeescript",
  399. "concurnas",
  400. "coq",
  401. "core",
  402. "cpp",
  403. "crystal",
  404. "csharp",
  405. "cshtml",
  406. "csp",
  407. "css",
  408. "css-extras",
  409. "csv",
  410. "cypher",
  411. "d",
  412. "dart",
  413. "dataweave",
  414. "dax",
  415. "dhall",
  416. "diff",
  417. "django",
  418. "dns-zone-file",
  419. "docker",
  420. "dot",
  421. "ebnf",
  422. "editorconfig",
  423. "eiffel",
  424. "ejs",
  425. "elixir",
  426. "elm",
  427. "erb",
  428. "erlang",
  429. "etlua",
  430. "excel-formula",
  431. "factor",
  432. "false",
  433. "firestore-security-rules",
  434. "flow",
  435. "fortran",
  436. "fsharp",
  437. "ftl",
  438. "gap",
  439. "gcode",
  440. "gdscript",
  441. "gedcom",
  442. "gherkin",
  443. "git",
  444. "glsl",
  445. "gml",
  446. "gn",
  447. "go",
  448. "go-module",
  449. "graphql",
  450. "groovy",
  451. "haml",
  452. "handlebars",
  453. "haskell",
  454. "haxe",
  455. "hcl",
  456. "hlsl",
  457. "hoon",
  458. "hpkp",
  459. "hsts",
  460. "http",
  461. "ichigojam",
  462. "icon",
  463. "icu-message-format",
  464. "idris",
  465. "iecst",
  466. "ignore",
  467. "index",
  468. "inform7",
  469. "ini",
  470. "io",
  471. "j",
  472. "java",
  473. "javadoc",
  474. "javadoclike",
  475. "javascript",
  476. "javastacktrace",
  477. "jexl",
  478. "jolie",
  479. "jq",
  480. "js-extras",
  481. "js-templates",
  482. "jsdoc",
  483. "json",
  484. "json5",
  485. "jsonp",
  486. "jsstacktrace",
  487. "jsx",
  488. "julia",
  489. "keepalived",
  490. "keyman",
  491. "kotlin",
  492. "kumir",
  493. "kusto",
  494. "latex",
  495. "latte",
  496. "less",
  497. "lilypond",
  498. "liquid",
  499. "lisp",
  500. "livescript",
  501. "llvm",
  502. "log",
  503. "lolcode",
  504. "lua",
  505. "magma",
  506. "makefile",
  507. "markdown",
  508. "markup",
  509. "markup-templating",
  510. "matlab",
  511. "maxscript",
  512. "mel",
  513. "mermaid",
  514. "mizar",
  515. "mongodb",
  516. "monkey",
  517. "moonscript",
  518. "n1ql",
  519. "n4js",
  520. "nand2tetris-hdl",
  521. "naniscript",
  522. "nasm",
  523. "neon",
  524. "nevod",
  525. "nginx",
  526. "nim",
  527. "nix",
  528. "nsis",
  529. "objectivec",
  530. "ocaml",
  531. "opencl",
  532. "openqasm",
  533. "oz",
  534. "parigp",
  535. "parser",
  536. "pascal",
  537. "pascaligo",
  538. "pcaxis",
  539. "peoplecode",
  540. "perl",
  541. "php",
  542. "php-extras",
  543. "phpdoc",
  544. "plsql",
  545. "powerquery",
  546. "powershell",
  547. "processing",
  548. "prolog",
  549. "promql",
  550. "properties",
  551. "protobuf",
  552. "psl",
  553. "pug",
  554. "puppet",
  555. "pure",
  556. "purebasic",
  557. "purescript",
  558. "python",
  559. "q",
  560. "qml",
  561. "qore",
  562. "qsharp",
  563. "r",
  564. "racket",
  565. "reason",
  566. "regex",
  567. "rego",
  568. "renpy",
  569. "rest",
  570. "rip",
  571. "roboconf",
  572. "robotframework",
  573. "ruby",
  574. "rust",
  575. "sas",
  576. "sass",
  577. "scala",
  578. "scheme",
  579. "scss",
  580. "shell-session",
  581. "smali",
  582. "smalltalk",
  583. "smarty",
  584. "sml",
  585. "solidity",
  586. "solution-file",
  587. "soy",
  588. "sparql",
  589. "splunk-spl",
  590. "sqf",
  591. "sql",
  592. "squirrel",
  593. "stan",
  594. "stylus",
  595. "swift",
  596. "systemd",
  597. "t4-cs",
  598. "t4-templating",
  599. "t4-vb",
  600. "tap",
  601. "tcl",
  602. "textile",
  603. "toml",
  604. "tremor",
  605. "tsx",
  606. "tt2",
  607. "turtle",
  608. "twig",
  609. "typescript",
  610. "typoscript",
  611. "unrealscript",
  612. "uorazor",
  613. "uri",
  614. "v",
  615. "vala",
  616. "vbnet",
  617. "velocity",
  618. "verilog",
  619. "vhdl",
  620. "vim",
  621. "visual-basic",
  622. "warpscript",
  623. "wasm",
  624. "web-idl",
  625. "wiki",
  626. "wolfram",
  627. "wren",
  628. "xeora",
  629. "xml-doc",
  630. "xojo",
  631. "xquery",
  632. "yaml",
  633. "yang",
  634. "zig",
  635. ],
  636. Var[
  637. Literal[
  638. "abap",
  639. "abnf",
  640. "actionscript",
  641. "ada",
  642. "agda",
  643. "al",
  644. "antlr4",
  645. "apacheconf",
  646. "apex",
  647. "apl",
  648. "applescript",
  649. "aql",
  650. "arduino",
  651. "arff",
  652. "asciidoc",
  653. "asm6502",
  654. "asmatmel",
  655. "aspnet",
  656. "autohotkey",
  657. "autoit",
  658. "avisynth",
  659. "avro-idl",
  660. "bash",
  661. "basic",
  662. "batch",
  663. "bbcode",
  664. "bicep",
  665. "birb",
  666. "bison",
  667. "bnf",
  668. "brainfuck",
  669. "brightscript",
  670. "bro",
  671. "bsl",
  672. "c",
  673. "cfscript",
  674. "chaiscript",
  675. "cil",
  676. "clike",
  677. "clojure",
  678. "cmake",
  679. "cobol",
  680. "coffeescript",
  681. "concurnas",
  682. "coq",
  683. "core",
  684. "cpp",
  685. "crystal",
  686. "csharp",
  687. "cshtml",
  688. "csp",
  689. "css",
  690. "css-extras",
  691. "csv",
  692. "cypher",
  693. "d",
  694. "dart",
  695. "dataweave",
  696. "dax",
  697. "dhall",
  698. "diff",
  699. "django",
  700. "dns-zone-file",
  701. "docker",
  702. "dot",
  703. "ebnf",
  704. "editorconfig",
  705. "eiffel",
  706. "ejs",
  707. "elixir",
  708. "elm",
  709. "erb",
  710. "erlang",
  711. "etlua",
  712. "excel-formula",
  713. "factor",
  714. "false",
  715. "firestore-security-rules",
  716. "flow",
  717. "fortran",
  718. "fsharp",
  719. "ftl",
  720. "gap",
  721. "gcode",
  722. "gdscript",
  723. "gedcom",
  724. "gherkin",
  725. "git",
  726. "glsl",
  727. "gml",
  728. "gn",
  729. "go",
  730. "go-module",
  731. "graphql",
  732. "groovy",
  733. "haml",
  734. "handlebars",
  735. "haskell",
  736. "haxe",
  737. "hcl",
  738. "hlsl",
  739. "hoon",
  740. "hpkp",
  741. "hsts",
  742. "http",
  743. "ichigojam",
  744. "icon",
  745. "icu-message-format",
  746. "idris",
  747. "iecst",
  748. "ignore",
  749. "index",
  750. "inform7",
  751. "ini",
  752. "io",
  753. "j",
  754. "java",
  755. "javadoc",
  756. "javadoclike",
  757. "javascript",
  758. "javastacktrace",
  759. "jexl",
  760. "jolie",
  761. "jq",
  762. "js-extras",
  763. "js-templates",
  764. "jsdoc",
  765. "json",
  766. "json5",
  767. "jsonp",
  768. "jsstacktrace",
  769. "jsx",
  770. "julia",
  771. "keepalived",
  772. "keyman",
  773. "kotlin",
  774. "kumir",
  775. "kusto",
  776. "latex",
  777. "latte",
  778. "less",
  779. "lilypond",
  780. "liquid",
  781. "lisp",
  782. "livescript",
  783. "llvm",
  784. "log",
  785. "lolcode",
  786. "lua",
  787. "magma",
  788. "makefile",
  789. "markdown",
  790. "markup",
  791. "markup-templating",
  792. "matlab",
  793. "maxscript",
  794. "mel",
  795. "mermaid",
  796. "mizar",
  797. "mongodb",
  798. "monkey",
  799. "moonscript",
  800. "n1ql",
  801. "n4js",
  802. "nand2tetris-hdl",
  803. "naniscript",
  804. "nasm",
  805. "neon",
  806. "nevod",
  807. "nginx",
  808. "nim",
  809. "nix",
  810. "nsis",
  811. "objectivec",
  812. "ocaml",
  813. "opencl",
  814. "openqasm",
  815. "oz",
  816. "parigp",
  817. "parser",
  818. "pascal",
  819. "pascaligo",
  820. "pcaxis",
  821. "peoplecode",
  822. "perl",
  823. "php",
  824. "php-extras",
  825. "phpdoc",
  826. "plsql",
  827. "powerquery",
  828. "powershell",
  829. "processing",
  830. "prolog",
  831. "promql",
  832. "properties",
  833. "protobuf",
  834. "psl",
  835. "pug",
  836. "puppet",
  837. "pure",
  838. "purebasic",
  839. "purescript",
  840. "python",
  841. "q",
  842. "qml",
  843. "qore",
  844. "qsharp",
  845. "r",
  846. "racket",
  847. "reason",
  848. "regex",
  849. "rego",
  850. "renpy",
  851. "rest",
  852. "rip",
  853. "roboconf",
  854. "robotframework",
  855. "ruby",
  856. "rust",
  857. "sas",
  858. "sass",
  859. "scala",
  860. "scheme",
  861. "scss",
  862. "shell-session",
  863. "smali",
  864. "smalltalk",
  865. "smarty",
  866. "sml",
  867. "solidity",
  868. "solution-file",
  869. "soy",
  870. "sparql",
  871. "splunk-spl",
  872. "sqf",
  873. "sql",
  874. "squirrel",
  875. "stan",
  876. "stylus",
  877. "swift",
  878. "systemd",
  879. "t4-cs",
  880. "t4-templating",
  881. "t4-vb",
  882. "tap",
  883. "tcl",
  884. "textile",
  885. "toml",
  886. "tremor",
  887. "tsx",
  888. "tt2",
  889. "turtle",
  890. "twig",
  891. "typescript",
  892. "typoscript",
  893. "unrealscript",
  894. "uorazor",
  895. "uri",
  896. "v",
  897. "vala",
  898. "vbnet",
  899. "velocity",
  900. "verilog",
  901. "vhdl",
  902. "vim",
  903. "visual-basic",
  904. "warpscript",
  905. "wasm",
  906. "web-idl",
  907. "wiki",
  908. "wolfram",
  909. "wren",
  910. "xeora",
  911. "xml-doc",
  912. "xojo",
  913. "xquery",
  914. "yaml",
  915. "yang",
  916. "zig",
  917. ]
  918. ],
  919. ]
  920. ] = None,
  921. code: Optional[Union[Var[str], str]] = None,
  922. show_line_numbers: Optional[Union[Var[bool], bool]] = None,
  923. starting_line_number: Optional[Union[Var[int], int]] = None,
  924. wrap_long_lines: Optional[Union[Var[bool], bool]] = None,
  925. custom_style: Optional[Dict[str, Union[str, Var, Color]]] = None,
  926. code_tag_props: Optional[Union[Dict[str, str], Var[Dict[str, str]]]] = None,
  927. can_copy: Optional[bool] = None,
  928. copy_button: Optional[Union[Component, bool]] = None,
  929. style: Optional[Style] = None,
  930. key: Optional[Any] = None,
  931. id: Optional[Any] = None,
  932. class_name: Optional[Any] = None,
  933. autofocus: Optional[bool] = None,
  934. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  935. on_blur: Optional[EventType[()]] = None,
  936. on_click: Optional[EventType[()]] = None,
  937. on_context_menu: Optional[EventType[()]] = None,
  938. on_double_click: Optional[EventType[()]] = None,
  939. on_focus: Optional[EventType[()]] = None,
  940. on_mount: Optional[EventType[()]] = None,
  941. on_mouse_down: Optional[EventType[()]] = None,
  942. on_mouse_enter: Optional[EventType[()]] = None,
  943. on_mouse_leave: Optional[EventType[()]] = None,
  944. on_mouse_move: Optional[EventType[()]] = None,
  945. on_mouse_out: Optional[EventType[()]] = None,
  946. on_mouse_over: Optional[EventType[()]] = None,
  947. on_mouse_up: Optional[EventType[()]] = None,
  948. on_scroll: Optional[EventType[()]] = None,
  949. on_unmount: Optional[EventType[()]] = None,
  950. **props,
  951. ) -> "CodeBlock":
  952. """Create a text component.
  953. Args:
  954. *children: The children of the component.
  955. theme: The theme to use ("light" or "dark").
  956. language: The language to use.
  957. code: The code to display.
  958. show_line_numbers: If this is enabled line numbers will be shown next to the code block.
  959. starting_line_number: The starting line number to use.
  960. wrap_long_lines: Whether to wrap long lines.
  961. custom_style: A custom style for the code block.
  962. code_tag_props: Props passed down to the code tag.
  963. can_copy: Whether a copy button should appear.
  964. copy_button: A custom copy button to override the default one.
  965. style: The style of the component.
  966. key: A unique key for the component.
  967. id: The id for the component.
  968. class_name: The class name for the component.
  969. autofocus: Whether the component should take the focus once the page is loaded
  970. custom_attrs: custom attribute
  971. **props: The props to pass to the component.
  972. Returns:
  973. The text component.
  974. """
  975. ...
  976. def add_style(self): ...
  977. @classmethod
  978. def get_component_map_custom_code(cls) -> Var: ...
  979. def add_hooks(self) -> list[str | Var]: ...
  980. class CodeblockNamespace(ComponentNamespace):
  981. themes = Theme
  982. @staticmethod
  983. def __call__(
  984. *children,
  985. theme: Optional[Union[Theme, Var[Union[Theme, str]], str]] = None,
  986. language: Optional[
  987. Union[
  988. Literal[
  989. "abap",
  990. "abnf",
  991. "actionscript",
  992. "ada",
  993. "agda",
  994. "al",
  995. "antlr4",
  996. "apacheconf",
  997. "apex",
  998. "apl",
  999. "applescript",
  1000. "aql",
  1001. "arduino",
  1002. "arff",
  1003. "asciidoc",
  1004. "asm6502",
  1005. "asmatmel",
  1006. "aspnet",
  1007. "autohotkey",
  1008. "autoit",
  1009. "avisynth",
  1010. "avro-idl",
  1011. "bash",
  1012. "basic",
  1013. "batch",
  1014. "bbcode",
  1015. "bicep",
  1016. "birb",
  1017. "bison",
  1018. "bnf",
  1019. "brainfuck",
  1020. "brightscript",
  1021. "bro",
  1022. "bsl",
  1023. "c",
  1024. "cfscript",
  1025. "chaiscript",
  1026. "cil",
  1027. "clike",
  1028. "clojure",
  1029. "cmake",
  1030. "cobol",
  1031. "coffeescript",
  1032. "concurnas",
  1033. "coq",
  1034. "core",
  1035. "cpp",
  1036. "crystal",
  1037. "csharp",
  1038. "cshtml",
  1039. "csp",
  1040. "css",
  1041. "css-extras",
  1042. "csv",
  1043. "cypher",
  1044. "d",
  1045. "dart",
  1046. "dataweave",
  1047. "dax",
  1048. "dhall",
  1049. "diff",
  1050. "django",
  1051. "dns-zone-file",
  1052. "docker",
  1053. "dot",
  1054. "ebnf",
  1055. "editorconfig",
  1056. "eiffel",
  1057. "ejs",
  1058. "elixir",
  1059. "elm",
  1060. "erb",
  1061. "erlang",
  1062. "etlua",
  1063. "excel-formula",
  1064. "factor",
  1065. "false",
  1066. "firestore-security-rules",
  1067. "flow",
  1068. "fortran",
  1069. "fsharp",
  1070. "ftl",
  1071. "gap",
  1072. "gcode",
  1073. "gdscript",
  1074. "gedcom",
  1075. "gherkin",
  1076. "git",
  1077. "glsl",
  1078. "gml",
  1079. "gn",
  1080. "go",
  1081. "go-module",
  1082. "graphql",
  1083. "groovy",
  1084. "haml",
  1085. "handlebars",
  1086. "haskell",
  1087. "haxe",
  1088. "hcl",
  1089. "hlsl",
  1090. "hoon",
  1091. "hpkp",
  1092. "hsts",
  1093. "http",
  1094. "ichigojam",
  1095. "icon",
  1096. "icu-message-format",
  1097. "idris",
  1098. "iecst",
  1099. "ignore",
  1100. "index",
  1101. "inform7",
  1102. "ini",
  1103. "io",
  1104. "j",
  1105. "java",
  1106. "javadoc",
  1107. "javadoclike",
  1108. "javascript",
  1109. "javastacktrace",
  1110. "jexl",
  1111. "jolie",
  1112. "jq",
  1113. "js-extras",
  1114. "js-templates",
  1115. "jsdoc",
  1116. "json",
  1117. "json5",
  1118. "jsonp",
  1119. "jsstacktrace",
  1120. "jsx",
  1121. "julia",
  1122. "keepalived",
  1123. "keyman",
  1124. "kotlin",
  1125. "kumir",
  1126. "kusto",
  1127. "latex",
  1128. "latte",
  1129. "less",
  1130. "lilypond",
  1131. "liquid",
  1132. "lisp",
  1133. "livescript",
  1134. "llvm",
  1135. "log",
  1136. "lolcode",
  1137. "lua",
  1138. "magma",
  1139. "makefile",
  1140. "markdown",
  1141. "markup",
  1142. "markup-templating",
  1143. "matlab",
  1144. "maxscript",
  1145. "mel",
  1146. "mermaid",
  1147. "mizar",
  1148. "mongodb",
  1149. "monkey",
  1150. "moonscript",
  1151. "n1ql",
  1152. "n4js",
  1153. "nand2tetris-hdl",
  1154. "naniscript",
  1155. "nasm",
  1156. "neon",
  1157. "nevod",
  1158. "nginx",
  1159. "nim",
  1160. "nix",
  1161. "nsis",
  1162. "objectivec",
  1163. "ocaml",
  1164. "opencl",
  1165. "openqasm",
  1166. "oz",
  1167. "parigp",
  1168. "parser",
  1169. "pascal",
  1170. "pascaligo",
  1171. "pcaxis",
  1172. "peoplecode",
  1173. "perl",
  1174. "php",
  1175. "php-extras",
  1176. "phpdoc",
  1177. "plsql",
  1178. "powerquery",
  1179. "powershell",
  1180. "processing",
  1181. "prolog",
  1182. "promql",
  1183. "properties",
  1184. "protobuf",
  1185. "psl",
  1186. "pug",
  1187. "puppet",
  1188. "pure",
  1189. "purebasic",
  1190. "purescript",
  1191. "python",
  1192. "q",
  1193. "qml",
  1194. "qore",
  1195. "qsharp",
  1196. "r",
  1197. "racket",
  1198. "reason",
  1199. "regex",
  1200. "rego",
  1201. "renpy",
  1202. "rest",
  1203. "rip",
  1204. "roboconf",
  1205. "robotframework",
  1206. "ruby",
  1207. "rust",
  1208. "sas",
  1209. "sass",
  1210. "scala",
  1211. "scheme",
  1212. "scss",
  1213. "shell-session",
  1214. "smali",
  1215. "smalltalk",
  1216. "smarty",
  1217. "sml",
  1218. "solidity",
  1219. "solution-file",
  1220. "soy",
  1221. "sparql",
  1222. "splunk-spl",
  1223. "sqf",
  1224. "sql",
  1225. "squirrel",
  1226. "stan",
  1227. "stylus",
  1228. "swift",
  1229. "systemd",
  1230. "t4-cs",
  1231. "t4-templating",
  1232. "t4-vb",
  1233. "tap",
  1234. "tcl",
  1235. "textile",
  1236. "toml",
  1237. "tremor",
  1238. "tsx",
  1239. "tt2",
  1240. "turtle",
  1241. "twig",
  1242. "typescript",
  1243. "typoscript",
  1244. "unrealscript",
  1245. "uorazor",
  1246. "uri",
  1247. "v",
  1248. "vala",
  1249. "vbnet",
  1250. "velocity",
  1251. "verilog",
  1252. "vhdl",
  1253. "vim",
  1254. "visual-basic",
  1255. "warpscript",
  1256. "wasm",
  1257. "web-idl",
  1258. "wiki",
  1259. "wolfram",
  1260. "wren",
  1261. "xeora",
  1262. "xml-doc",
  1263. "xojo",
  1264. "xquery",
  1265. "yaml",
  1266. "yang",
  1267. "zig",
  1268. ],
  1269. Var[
  1270. Literal[
  1271. "abap",
  1272. "abnf",
  1273. "actionscript",
  1274. "ada",
  1275. "agda",
  1276. "al",
  1277. "antlr4",
  1278. "apacheconf",
  1279. "apex",
  1280. "apl",
  1281. "applescript",
  1282. "aql",
  1283. "arduino",
  1284. "arff",
  1285. "asciidoc",
  1286. "asm6502",
  1287. "asmatmel",
  1288. "aspnet",
  1289. "autohotkey",
  1290. "autoit",
  1291. "avisynth",
  1292. "avro-idl",
  1293. "bash",
  1294. "basic",
  1295. "batch",
  1296. "bbcode",
  1297. "bicep",
  1298. "birb",
  1299. "bison",
  1300. "bnf",
  1301. "brainfuck",
  1302. "brightscript",
  1303. "bro",
  1304. "bsl",
  1305. "c",
  1306. "cfscript",
  1307. "chaiscript",
  1308. "cil",
  1309. "clike",
  1310. "clojure",
  1311. "cmake",
  1312. "cobol",
  1313. "coffeescript",
  1314. "concurnas",
  1315. "coq",
  1316. "core",
  1317. "cpp",
  1318. "crystal",
  1319. "csharp",
  1320. "cshtml",
  1321. "csp",
  1322. "css",
  1323. "css-extras",
  1324. "csv",
  1325. "cypher",
  1326. "d",
  1327. "dart",
  1328. "dataweave",
  1329. "dax",
  1330. "dhall",
  1331. "diff",
  1332. "django",
  1333. "dns-zone-file",
  1334. "docker",
  1335. "dot",
  1336. "ebnf",
  1337. "editorconfig",
  1338. "eiffel",
  1339. "ejs",
  1340. "elixir",
  1341. "elm",
  1342. "erb",
  1343. "erlang",
  1344. "etlua",
  1345. "excel-formula",
  1346. "factor",
  1347. "false",
  1348. "firestore-security-rules",
  1349. "flow",
  1350. "fortran",
  1351. "fsharp",
  1352. "ftl",
  1353. "gap",
  1354. "gcode",
  1355. "gdscript",
  1356. "gedcom",
  1357. "gherkin",
  1358. "git",
  1359. "glsl",
  1360. "gml",
  1361. "gn",
  1362. "go",
  1363. "go-module",
  1364. "graphql",
  1365. "groovy",
  1366. "haml",
  1367. "handlebars",
  1368. "haskell",
  1369. "haxe",
  1370. "hcl",
  1371. "hlsl",
  1372. "hoon",
  1373. "hpkp",
  1374. "hsts",
  1375. "http",
  1376. "ichigojam",
  1377. "icon",
  1378. "icu-message-format",
  1379. "idris",
  1380. "iecst",
  1381. "ignore",
  1382. "index",
  1383. "inform7",
  1384. "ini",
  1385. "io",
  1386. "j",
  1387. "java",
  1388. "javadoc",
  1389. "javadoclike",
  1390. "javascript",
  1391. "javastacktrace",
  1392. "jexl",
  1393. "jolie",
  1394. "jq",
  1395. "js-extras",
  1396. "js-templates",
  1397. "jsdoc",
  1398. "json",
  1399. "json5",
  1400. "jsonp",
  1401. "jsstacktrace",
  1402. "jsx",
  1403. "julia",
  1404. "keepalived",
  1405. "keyman",
  1406. "kotlin",
  1407. "kumir",
  1408. "kusto",
  1409. "latex",
  1410. "latte",
  1411. "less",
  1412. "lilypond",
  1413. "liquid",
  1414. "lisp",
  1415. "livescript",
  1416. "llvm",
  1417. "log",
  1418. "lolcode",
  1419. "lua",
  1420. "magma",
  1421. "makefile",
  1422. "markdown",
  1423. "markup",
  1424. "markup-templating",
  1425. "matlab",
  1426. "maxscript",
  1427. "mel",
  1428. "mermaid",
  1429. "mizar",
  1430. "mongodb",
  1431. "monkey",
  1432. "moonscript",
  1433. "n1ql",
  1434. "n4js",
  1435. "nand2tetris-hdl",
  1436. "naniscript",
  1437. "nasm",
  1438. "neon",
  1439. "nevod",
  1440. "nginx",
  1441. "nim",
  1442. "nix",
  1443. "nsis",
  1444. "objectivec",
  1445. "ocaml",
  1446. "opencl",
  1447. "openqasm",
  1448. "oz",
  1449. "parigp",
  1450. "parser",
  1451. "pascal",
  1452. "pascaligo",
  1453. "pcaxis",
  1454. "peoplecode",
  1455. "perl",
  1456. "php",
  1457. "php-extras",
  1458. "phpdoc",
  1459. "plsql",
  1460. "powerquery",
  1461. "powershell",
  1462. "processing",
  1463. "prolog",
  1464. "promql",
  1465. "properties",
  1466. "protobuf",
  1467. "psl",
  1468. "pug",
  1469. "puppet",
  1470. "pure",
  1471. "purebasic",
  1472. "purescript",
  1473. "python",
  1474. "q",
  1475. "qml",
  1476. "qore",
  1477. "qsharp",
  1478. "r",
  1479. "racket",
  1480. "reason",
  1481. "regex",
  1482. "rego",
  1483. "renpy",
  1484. "rest",
  1485. "rip",
  1486. "roboconf",
  1487. "robotframework",
  1488. "ruby",
  1489. "rust",
  1490. "sas",
  1491. "sass",
  1492. "scala",
  1493. "scheme",
  1494. "scss",
  1495. "shell-session",
  1496. "smali",
  1497. "smalltalk",
  1498. "smarty",
  1499. "sml",
  1500. "solidity",
  1501. "solution-file",
  1502. "soy",
  1503. "sparql",
  1504. "splunk-spl",
  1505. "sqf",
  1506. "sql",
  1507. "squirrel",
  1508. "stan",
  1509. "stylus",
  1510. "swift",
  1511. "systemd",
  1512. "t4-cs",
  1513. "t4-templating",
  1514. "t4-vb",
  1515. "tap",
  1516. "tcl",
  1517. "textile",
  1518. "toml",
  1519. "tremor",
  1520. "tsx",
  1521. "tt2",
  1522. "turtle",
  1523. "twig",
  1524. "typescript",
  1525. "typoscript",
  1526. "unrealscript",
  1527. "uorazor",
  1528. "uri",
  1529. "v",
  1530. "vala",
  1531. "vbnet",
  1532. "velocity",
  1533. "verilog",
  1534. "vhdl",
  1535. "vim",
  1536. "visual-basic",
  1537. "warpscript",
  1538. "wasm",
  1539. "web-idl",
  1540. "wiki",
  1541. "wolfram",
  1542. "wren",
  1543. "xeora",
  1544. "xml-doc",
  1545. "xojo",
  1546. "xquery",
  1547. "yaml",
  1548. "yang",
  1549. "zig",
  1550. ]
  1551. ],
  1552. ]
  1553. ] = None,
  1554. code: Optional[Union[Var[str], str]] = None,
  1555. show_line_numbers: Optional[Union[Var[bool], bool]] = None,
  1556. starting_line_number: Optional[Union[Var[int], int]] = None,
  1557. wrap_long_lines: Optional[Union[Var[bool], bool]] = None,
  1558. custom_style: Optional[Dict[str, Union[str, Var, Color]]] = None,
  1559. code_tag_props: Optional[Union[Dict[str, str], Var[Dict[str, str]]]] = None,
  1560. can_copy: Optional[bool] = None,
  1561. copy_button: Optional[Union[Component, bool]] = None,
  1562. style: Optional[Style] = None,
  1563. key: Optional[Any] = None,
  1564. id: Optional[Any] = None,
  1565. class_name: Optional[Any] = None,
  1566. autofocus: Optional[bool] = None,
  1567. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  1568. on_blur: Optional[EventType[()]] = None,
  1569. on_click: Optional[EventType[()]] = None,
  1570. on_context_menu: Optional[EventType[()]] = None,
  1571. on_double_click: Optional[EventType[()]] = None,
  1572. on_focus: Optional[EventType[()]] = None,
  1573. on_mount: Optional[EventType[()]] = None,
  1574. on_mouse_down: Optional[EventType[()]] = None,
  1575. on_mouse_enter: Optional[EventType[()]] = None,
  1576. on_mouse_leave: Optional[EventType[()]] = None,
  1577. on_mouse_move: Optional[EventType[()]] = None,
  1578. on_mouse_out: Optional[EventType[()]] = None,
  1579. on_mouse_over: Optional[EventType[()]] = None,
  1580. on_mouse_up: Optional[EventType[()]] = None,
  1581. on_scroll: Optional[EventType[()]] = None,
  1582. on_unmount: Optional[EventType[()]] = None,
  1583. **props,
  1584. ) -> "CodeBlock":
  1585. """Create a text component.
  1586. Args:
  1587. *children: The children of the component.
  1588. theme: The theme to use ("light" or "dark").
  1589. language: The language to use.
  1590. code: The code to display.
  1591. show_line_numbers: If this is enabled line numbers will be shown next to the code block.
  1592. starting_line_number: The starting line number to use.
  1593. wrap_long_lines: Whether to wrap long lines.
  1594. custom_style: A custom style for the code block.
  1595. code_tag_props: Props passed down to the code tag.
  1596. can_copy: Whether a copy button should appear.
  1597. copy_button: A custom copy button to override the default one.
  1598. style: The style of the component.
  1599. key: A unique key for the component.
  1600. id: The id for the component.
  1601. class_name: The class name for the component.
  1602. autofocus: Whether the component should take the focus once the page is loaded
  1603. custom_attrs: custom attribute
  1604. **props: The props to pass to the component.
  1605. Returns:
  1606. The text component.
  1607. """
  1608. ...
  1609. code_block = CodeblockNamespace()