code.pyi 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617
  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, Optional, 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: 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: Style | None = None,
  927. key: Any | None = None,
  928. id: Any | None = None,
  929. class_name: Any | None = None,
  930. autofocus: bool | None = None,
  931. custom_attrs: dict[str, Var | Any] | None = None,
  932. on_blur: Optional[EventType[()]] = None,
  933. on_click: Optional[EventType[()]] = None,
  934. on_context_menu: Optional[EventType[()]] = None,
  935. on_double_click: Optional[EventType[()]] = None,
  936. on_focus: Optional[EventType[()]] = None,
  937. on_mount: Optional[EventType[()]] = None,
  938. on_mouse_down: Optional[EventType[()]] = None,
  939. on_mouse_enter: Optional[EventType[()]] = None,
  940. on_mouse_leave: Optional[EventType[()]] = None,
  941. on_mouse_move: Optional[EventType[()]] = None,
  942. on_mouse_out: Optional[EventType[()]] = None,
  943. on_mouse_over: Optional[EventType[()]] = None,
  944. on_mouse_up: Optional[EventType[()]] = None,
  945. on_scroll: Optional[EventType[()]] = None,
  946. on_unmount: Optional[EventType[()]] = None,
  947. **props,
  948. ) -> "CodeBlock":
  949. """Create a text component.
  950. Args:
  951. *children: The children of the component.
  952. theme: The theme to use ("light" or "dark").
  953. language: The language to use.
  954. code: The code to display.
  955. show_line_numbers: If this is enabled line numbers will be shown next to the code block.
  956. starting_line_number: The starting line number to use.
  957. wrap_long_lines: Whether to wrap long lines.
  958. custom_style: A custom style for the code block.
  959. code_tag_props: Props passed down to the code tag.
  960. can_copy: Whether a copy button should appear.
  961. copy_button: A custom copy button to override the default one.
  962. style: The style of the component.
  963. key: A unique key for the component.
  964. id: The id for the component.
  965. class_name: The class name for the component.
  966. autofocus: Whether the component should take the focus once the page is loaded
  967. custom_attrs: custom attribute
  968. **props: The props to pass to the component.
  969. Returns:
  970. The text component.
  971. """
  972. ...
  973. def add_style(self): ...
  974. @classmethod
  975. def get_component_map_custom_code(cls) -> Var: ...
  976. def add_hooks(self) -> list[str | Var]: ...
  977. class CodeblockNamespace(ComponentNamespace):
  978. themes = Theme
  979. @staticmethod
  980. def __call__(
  981. *children,
  982. theme: Theme | Var[Theme | str] | str | None = None,
  983. language: Literal[
  984. "abap",
  985. "abnf",
  986. "actionscript",
  987. "ada",
  988. "agda",
  989. "al",
  990. "antlr4",
  991. "apacheconf",
  992. "apex",
  993. "apl",
  994. "applescript",
  995. "aql",
  996. "arduino",
  997. "arff",
  998. "asciidoc",
  999. "asm6502",
  1000. "asmatmel",
  1001. "aspnet",
  1002. "autohotkey",
  1003. "autoit",
  1004. "avisynth",
  1005. "avro-idl",
  1006. "bash",
  1007. "basic",
  1008. "batch",
  1009. "bbcode",
  1010. "bicep",
  1011. "birb",
  1012. "bison",
  1013. "bnf",
  1014. "brainfuck",
  1015. "brightscript",
  1016. "bro",
  1017. "bsl",
  1018. "c",
  1019. "cfscript",
  1020. "chaiscript",
  1021. "cil",
  1022. "clike",
  1023. "clojure",
  1024. "cmake",
  1025. "cobol",
  1026. "coffeescript",
  1027. "concurnas",
  1028. "coq",
  1029. "core",
  1030. "cpp",
  1031. "crystal",
  1032. "csharp",
  1033. "cshtml",
  1034. "csp",
  1035. "css",
  1036. "css-extras",
  1037. "csv",
  1038. "cypher",
  1039. "d",
  1040. "dart",
  1041. "dataweave",
  1042. "dax",
  1043. "dhall",
  1044. "diff",
  1045. "django",
  1046. "dns-zone-file",
  1047. "docker",
  1048. "dot",
  1049. "ebnf",
  1050. "editorconfig",
  1051. "eiffel",
  1052. "ejs",
  1053. "elixir",
  1054. "elm",
  1055. "erb",
  1056. "erlang",
  1057. "etlua",
  1058. "excel-formula",
  1059. "factor",
  1060. "false",
  1061. "firestore-security-rules",
  1062. "flow",
  1063. "fortran",
  1064. "fsharp",
  1065. "ftl",
  1066. "gap",
  1067. "gcode",
  1068. "gdscript",
  1069. "gedcom",
  1070. "gherkin",
  1071. "git",
  1072. "glsl",
  1073. "gml",
  1074. "gn",
  1075. "go",
  1076. "go-module",
  1077. "graphql",
  1078. "groovy",
  1079. "haml",
  1080. "handlebars",
  1081. "haskell",
  1082. "haxe",
  1083. "hcl",
  1084. "hlsl",
  1085. "hoon",
  1086. "hpkp",
  1087. "hsts",
  1088. "http",
  1089. "ichigojam",
  1090. "icon",
  1091. "icu-message-format",
  1092. "idris",
  1093. "iecst",
  1094. "ignore",
  1095. "index",
  1096. "inform7",
  1097. "ini",
  1098. "io",
  1099. "j",
  1100. "java",
  1101. "javadoc",
  1102. "javadoclike",
  1103. "javascript",
  1104. "javastacktrace",
  1105. "jexl",
  1106. "jolie",
  1107. "jq",
  1108. "js-extras",
  1109. "js-templates",
  1110. "jsdoc",
  1111. "json",
  1112. "json5",
  1113. "jsonp",
  1114. "jsstacktrace",
  1115. "jsx",
  1116. "julia",
  1117. "keepalived",
  1118. "keyman",
  1119. "kotlin",
  1120. "kumir",
  1121. "kusto",
  1122. "latex",
  1123. "latte",
  1124. "less",
  1125. "lilypond",
  1126. "liquid",
  1127. "lisp",
  1128. "livescript",
  1129. "llvm",
  1130. "log",
  1131. "lolcode",
  1132. "lua",
  1133. "magma",
  1134. "makefile",
  1135. "markdown",
  1136. "markup",
  1137. "markup-templating",
  1138. "matlab",
  1139. "maxscript",
  1140. "mel",
  1141. "mermaid",
  1142. "mizar",
  1143. "mongodb",
  1144. "monkey",
  1145. "moonscript",
  1146. "n1ql",
  1147. "n4js",
  1148. "nand2tetris-hdl",
  1149. "naniscript",
  1150. "nasm",
  1151. "neon",
  1152. "nevod",
  1153. "nginx",
  1154. "nim",
  1155. "nix",
  1156. "nsis",
  1157. "objectivec",
  1158. "ocaml",
  1159. "opencl",
  1160. "openqasm",
  1161. "oz",
  1162. "parigp",
  1163. "parser",
  1164. "pascal",
  1165. "pascaligo",
  1166. "pcaxis",
  1167. "peoplecode",
  1168. "perl",
  1169. "php",
  1170. "php-extras",
  1171. "phpdoc",
  1172. "plsql",
  1173. "powerquery",
  1174. "powershell",
  1175. "processing",
  1176. "prolog",
  1177. "promql",
  1178. "properties",
  1179. "protobuf",
  1180. "psl",
  1181. "pug",
  1182. "puppet",
  1183. "pure",
  1184. "purebasic",
  1185. "purescript",
  1186. "python",
  1187. "q",
  1188. "qml",
  1189. "qore",
  1190. "qsharp",
  1191. "r",
  1192. "racket",
  1193. "reason",
  1194. "regex",
  1195. "rego",
  1196. "renpy",
  1197. "rest",
  1198. "rip",
  1199. "roboconf",
  1200. "robotframework",
  1201. "ruby",
  1202. "rust",
  1203. "sas",
  1204. "sass",
  1205. "scala",
  1206. "scheme",
  1207. "scss",
  1208. "shell-session",
  1209. "smali",
  1210. "smalltalk",
  1211. "smarty",
  1212. "sml",
  1213. "solidity",
  1214. "solution-file",
  1215. "soy",
  1216. "sparql",
  1217. "splunk-spl",
  1218. "sqf",
  1219. "sql",
  1220. "squirrel",
  1221. "stan",
  1222. "stylus",
  1223. "swift",
  1224. "systemd",
  1225. "t4-cs",
  1226. "t4-templating",
  1227. "t4-vb",
  1228. "tap",
  1229. "tcl",
  1230. "textile",
  1231. "toml",
  1232. "tremor",
  1233. "tsx",
  1234. "tt2",
  1235. "turtle",
  1236. "twig",
  1237. "typescript",
  1238. "typoscript",
  1239. "unrealscript",
  1240. "uorazor",
  1241. "uri",
  1242. "v",
  1243. "vala",
  1244. "vbnet",
  1245. "velocity",
  1246. "verilog",
  1247. "vhdl",
  1248. "vim",
  1249. "visual-basic",
  1250. "warpscript",
  1251. "wasm",
  1252. "web-idl",
  1253. "wiki",
  1254. "wolfram",
  1255. "wren",
  1256. "xeora",
  1257. "xml-doc",
  1258. "xojo",
  1259. "xquery",
  1260. "yaml",
  1261. "yang",
  1262. "zig",
  1263. ]
  1264. | Var[
  1265. Literal[
  1266. "abap",
  1267. "abnf",
  1268. "actionscript",
  1269. "ada",
  1270. "agda",
  1271. "al",
  1272. "antlr4",
  1273. "apacheconf",
  1274. "apex",
  1275. "apl",
  1276. "applescript",
  1277. "aql",
  1278. "arduino",
  1279. "arff",
  1280. "asciidoc",
  1281. "asm6502",
  1282. "asmatmel",
  1283. "aspnet",
  1284. "autohotkey",
  1285. "autoit",
  1286. "avisynth",
  1287. "avro-idl",
  1288. "bash",
  1289. "basic",
  1290. "batch",
  1291. "bbcode",
  1292. "bicep",
  1293. "birb",
  1294. "bison",
  1295. "bnf",
  1296. "brainfuck",
  1297. "brightscript",
  1298. "bro",
  1299. "bsl",
  1300. "c",
  1301. "cfscript",
  1302. "chaiscript",
  1303. "cil",
  1304. "clike",
  1305. "clojure",
  1306. "cmake",
  1307. "cobol",
  1308. "coffeescript",
  1309. "concurnas",
  1310. "coq",
  1311. "core",
  1312. "cpp",
  1313. "crystal",
  1314. "csharp",
  1315. "cshtml",
  1316. "csp",
  1317. "css",
  1318. "css-extras",
  1319. "csv",
  1320. "cypher",
  1321. "d",
  1322. "dart",
  1323. "dataweave",
  1324. "dax",
  1325. "dhall",
  1326. "diff",
  1327. "django",
  1328. "dns-zone-file",
  1329. "docker",
  1330. "dot",
  1331. "ebnf",
  1332. "editorconfig",
  1333. "eiffel",
  1334. "ejs",
  1335. "elixir",
  1336. "elm",
  1337. "erb",
  1338. "erlang",
  1339. "etlua",
  1340. "excel-formula",
  1341. "factor",
  1342. "false",
  1343. "firestore-security-rules",
  1344. "flow",
  1345. "fortran",
  1346. "fsharp",
  1347. "ftl",
  1348. "gap",
  1349. "gcode",
  1350. "gdscript",
  1351. "gedcom",
  1352. "gherkin",
  1353. "git",
  1354. "glsl",
  1355. "gml",
  1356. "gn",
  1357. "go",
  1358. "go-module",
  1359. "graphql",
  1360. "groovy",
  1361. "haml",
  1362. "handlebars",
  1363. "haskell",
  1364. "haxe",
  1365. "hcl",
  1366. "hlsl",
  1367. "hoon",
  1368. "hpkp",
  1369. "hsts",
  1370. "http",
  1371. "ichigojam",
  1372. "icon",
  1373. "icu-message-format",
  1374. "idris",
  1375. "iecst",
  1376. "ignore",
  1377. "index",
  1378. "inform7",
  1379. "ini",
  1380. "io",
  1381. "j",
  1382. "java",
  1383. "javadoc",
  1384. "javadoclike",
  1385. "javascript",
  1386. "javastacktrace",
  1387. "jexl",
  1388. "jolie",
  1389. "jq",
  1390. "js-extras",
  1391. "js-templates",
  1392. "jsdoc",
  1393. "json",
  1394. "json5",
  1395. "jsonp",
  1396. "jsstacktrace",
  1397. "jsx",
  1398. "julia",
  1399. "keepalived",
  1400. "keyman",
  1401. "kotlin",
  1402. "kumir",
  1403. "kusto",
  1404. "latex",
  1405. "latte",
  1406. "less",
  1407. "lilypond",
  1408. "liquid",
  1409. "lisp",
  1410. "livescript",
  1411. "llvm",
  1412. "log",
  1413. "lolcode",
  1414. "lua",
  1415. "magma",
  1416. "makefile",
  1417. "markdown",
  1418. "markup",
  1419. "markup-templating",
  1420. "matlab",
  1421. "maxscript",
  1422. "mel",
  1423. "mermaid",
  1424. "mizar",
  1425. "mongodb",
  1426. "monkey",
  1427. "moonscript",
  1428. "n1ql",
  1429. "n4js",
  1430. "nand2tetris-hdl",
  1431. "naniscript",
  1432. "nasm",
  1433. "neon",
  1434. "nevod",
  1435. "nginx",
  1436. "nim",
  1437. "nix",
  1438. "nsis",
  1439. "objectivec",
  1440. "ocaml",
  1441. "opencl",
  1442. "openqasm",
  1443. "oz",
  1444. "parigp",
  1445. "parser",
  1446. "pascal",
  1447. "pascaligo",
  1448. "pcaxis",
  1449. "peoplecode",
  1450. "perl",
  1451. "php",
  1452. "php-extras",
  1453. "phpdoc",
  1454. "plsql",
  1455. "powerquery",
  1456. "powershell",
  1457. "processing",
  1458. "prolog",
  1459. "promql",
  1460. "properties",
  1461. "protobuf",
  1462. "psl",
  1463. "pug",
  1464. "puppet",
  1465. "pure",
  1466. "purebasic",
  1467. "purescript",
  1468. "python",
  1469. "q",
  1470. "qml",
  1471. "qore",
  1472. "qsharp",
  1473. "r",
  1474. "racket",
  1475. "reason",
  1476. "regex",
  1477. "rego",
  1478. "renpy",
  1479. "rest",
  1480. "rip",
  1481. "roboconf",
  1482. "robotframework",
  1483. "ruby",
  1484. "rust",
  1485. "sas",
  1486. "sass",
  1487. "scala",
  1488. "scheme",
  1489. "scss",
  1490. "shell-session",
  1491. "smali",
  1492. "smalltalk",
  1493. "smarty",
  1494. "sml",
  1495. "solidity",
  1496. "solution-file",
  1497. "soy",
  1498. "sparql",
  1499. "splunk-spl",
  1500. "sqf",
  1501. "sql",
  1502. "squirrel",
  1503. "stan",
  1504. "stylus",
  1505. "swift",
  1506. "systemd",
  1507. "t4-cs",
  1508. "t4-templating",
  1509. "t4-vb",
  1510. "tap",
  1511. "tcl",
  1512. "textile",
  1513. "toml",
  1514. "tremor",
  1515. "tsx",
  1516. "tt2",
  1517. "turtle",
  1518. "twig",
  1519. "typescript",
  1520. "typoscript",
  1521. "unrealscript",
  1522. "uorazor",
  1523. "uri",
  1524. "v",
  1525. "vala",
  1526. "vbnet",
  1527. "velocity",
  1528. "verilog",
  1529. "vhdl",
  1530. "vim",
  1531. "visual-basic",
  1532. "warpscript",
  1533. "wasm",
  1534. "web-idl",
  1535. "wiki",
  1536. "wolfram",
  1537. "wren",
  1538. "xeora",
  1539. "xml-doc",
  1540. "xojo",
  1541. "xquery",
  1542. "yaml",
  1543. "yang",
  1544. "zig",
  1545. ]
  1546. ]
  1547. | None = None,
  1548. code: Var[str] | str | None = None,
  1549. show_line_numbers: Var[bool] | bool | None = None,
  1550. starting_line_number: Var[int] | int | None = None,
  1551. wrap_long_lines: Var[bool] | bool | None = None,
  1552. custom_style: dict[str, str | Var | Color] | None = None,
  1553. code_tag_props: Var[dict[str, str]] | dict[str, str] | None = None,
  1554. can_copy: bool | None = None,
  1555. copy_button: Component | bool | None = None,
  1556. style: Style | None = None,
  1557. key: Any | None = None,
  1558. id: Any | None = None,
  1559. class_name: Any | None = None,
  1560. autofocus: bool | None = None,
  1561. custom_attrs: dict[str, Var | Any] | None = None,
  1562. on_blur: Optional[EventType[()]] = None,
  1563. on_click: Optional[EventType[()]] = None,
  1564. on_context_menu: Optional[EventType[()]] = None,
  1565. on_double_click: Optional[EventType[()]] = None,
  1566. on_focus: Optional[EventType[()]] = None,
  1567. on_mount: Optional[EventType[()]] = None,
  1568. on_mouse_down: Optional[EventType[()]] = None,
  1569. on_mouse_enter: Optional[EventType[()]] = None,
  1570. on_mouse_leave: Optional[EventType[()]] = None,
  1571. on_mouse_move: Optional[EventType[()]] = None,
  1572. on_mouse_out: Optional[EventType[()]] = None,
  1573. on_mouse_over: Optional[EventType[()]] = None,
  1574. on_mouse_up: Optional[EventType[()]] = None,
  1575. on_scroll: Optional[EventType[()]] = None,
  1576. on_unmount: Optional[EventType[()]] = None,
  1577. **props,
  1578. ) -> "CodeBlock":
  1579. """Create a text component.
  1580. Args:
  1581. *children: The children of the component.
  1582. theme: The theme to use ("light" or "dark").
  1583. language: The language to use.
  1584. code: The code to display.
  1585. show_line_numbers: If this is enabled line numbers will be shown next to the code block.
  1586. starting_line_number: The starting line number to use.
  1587. wrap_long_lines: Whether to wrap long lines.
  1588. custom_style: A custom style for the code block.
  1589. code_tag_props: Props passed down to the code tag.
  1590. can_copy: Whether a copy button should appear.
  1591. copy_button: A custom copy button to override the default one.
  1592. style: The style of the component.
  1593. key: A unique key for the component.
  1594. id: The id for the component.
  1595. class_name: The class name for the component.
  1596. autofocus: Whether the component should take the focus once the page is loaded
  1597. custom_attrs: custom attribute
  1598. **props: The props to pass to the component.
  1599. Returns:
  1600. The text component.
  1601. """
  1602. ...
  1603. code_block = CodeblockNamespace()