@marimo-team/islands 0.16.5 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (549) hide show
  1. package/dist/{ConnectedDataExplorerComponent-D96i9G-X.js → ConnectedDataExplorerComponent-DJEUH6Bb.js} +78 -100
  2. package/dist/{_baseIsEqual-oN7pRNcM.js → _baseIsEqual-CN4oFUZ4.js} +20 -20
  3. package/dist/{_basePickBy-CYvzhRjy.js → _basePickBy-CzSvE_-f.js} +3 -3
  4. package/dist/{_baseProperty-DGUdIBuu.js → _baseProperty-DbbUiyUD.js} +5 -5
  5. package/dist/{_baseUniq-B5gfSl8S.js → _baseUniq-DwoC-LVO.js} +4 -4
  6. package/dist/any-language-editor-CEXn1vFs.js +156 -0
  7. package/dist/apl-DuVfHsPc.js +4 -0
  8. package/dist/architecture-O4VJ6CD3-lp-opOaL.js +21 -0
  9. package/dist/{architectureDiagram-W76B3OCA-DkEhipkW.js → architectureDiagram-W76B3OCA-CoBORy6u.js} +34 -34
  10. package/dist/asciiarmor-qIVWsi4F.js +4 -0
  11. package/dist/asn1-BjPqARr7.js +4 -0
  12. package/dist/assets/__vite-browser-external-lX-sn9m2.js +1 -0
  13. package/dist/assets/worker-vPn7gxWj.js +54 -0
  14. package/dist/{blockDiagram-QIGZ2CNN-DZOqLMYa.js → blockDiagram-QIGZ2CNN-0yzoLIar.js} +75 -86
  15. package/dist/brainfuck-DPGTVfkE.js +4 -0
  16. package/dist/{button-CEcjneWG.js → button-DcnBVpVa.js} +11 -14
  17. package/dist/{c4Diagram-FPNF74CW-DVaR7c9q.js → c4Diagram-FPNF74CW-CKsIA_DD.js} +27 -51
  18. package/dist/{channel-Uh0KpgGW.js → channel-3LVvQZcD.js} +1 -1
  19. package/dist/{check-BK9zDfQk.js → check-D7ifz5op.js} +1 -1
  20. package/dist/{chunk-3AY6CYHV-Dk2R2-S1.js → chunk-3AY6CYHV-B2C-aVc3.js} +35 -35
  21. package/dist/{chunk-4BX2VUAB-CqO6zUIz.js → chunk-4BX2VUAB-DEd4VI9L.js} +1 -1
  22. package/dist/{chunk-4KMFLZZN-CloTfTwP.js → chunk-4KMFLZZN-DnvP3O4K.js} +216 -325
  23. package/dist/{chunk-55IACEB6-I0rmqTua.js → chunk-55IACEB6-BcCzwOOl.js} +1 -1
  24. package/dist/{chunk-6OXUPJBA-BuROSTmo.js → chunk-6OXUPJBA-eNAAfJ3Q.js} +7 -7
  25. package/dist/{chunk-7GE3RBXV-B1-tsIPP.js → chunk-7GE3RBXV-CSAeQvLz.js} +1 -1
  26. package/dist/{chunk-ABZYJK2D-CLlso8tj.js → chunk-ABZYJK2D-CZcb_1iM.js} +16 -20
  27. package/dist/{chunk-BN7GFLIU-Db2-FjLn.js → chunk-BN7GFLIU-pBc5O5Rh.js} +1 -1
  28. package/dist/{chunk-CVBHYZKI-BONeiloK.js → chunk-CVBHYZKI-CivHZg9P.js} +3 -3
  29. package/dist/{chunk-CXMOBAN2-U9GJSP1d.js → chunk-CXMOBAN2-Dd0E6qb0.js} +46 -54
  30. package/dist/chunk-EXTU4WIE-GQ2ZWfJo.js +10 -0
  31. package/dist/{chunk-FMBD7UC4-DyV3BR_I.js → chunk-FMBD7UC4-C6YcisV6.js} +1 -1
  32. package/dist/{chunk-JA3XYJ7Z-C9A1076P.js → chunk-JA3XYJ7Z-DYeQaT57.js} +21 -25
  33. package/dist/{chunk-JEIROHC2-BGnFkSVq.js → chunk-JEIROHC2-B-EZMP4V.js} +1 -1
  34. package/dist/{chunk-K7UQS3LO-033LOsjK.js → chunk-K7UQS3LO-DENzlS-M.js} +7 -7
  35. package/dist/{chunk-KMC2YHZD-DT4Sq4Ld.js → chunk-KMC2YHZD-SckhHdEh.js} +1 -1
  36. package/dist/{chunk-QN33PNHL-gs44MZla.js → chunk-QN33PNHL-Cjq5b604.js} +2 -2
  37. package/dist/{chunk-QYVHNE3D-B8BO1AnT.js → chunk-QYVHNE3D-CNUuivie.js} +3 -4
  38. package/dist/{chunk-QZHKN3VN-CeN_GkU6.js → chunk-QZHKN3VN-DugEU_bA.js} +1 -1
  39. package/dist/chunk-S3R3BYOJ-itCT6Vif.js +380 -0
  40. package/dist/{chunk-T44TD3VJ-BwzD6YE0.js → chunk-T44TD3VJ-BLdfTX8J.js} +1 -1
  41. package/dist/{chunk-TVAH2DTR-Bi6jpQJQ.js → chunk-TVAH2DTR-BOnwF9d8.js} +7 -8
  42. package/dist/{chunk-TZMSLE5B-D8klz2H_.js → chunk-TZMSLE5B-DGs66AlL.js} +4 -5
  43. package/dist/{chunk-WFRQ32O7-CzSwSlN0.js → chunk-WFRQ32O7-CPsipkmJ.js} +1 -1
  44. package/dist/{chunk-WFWHJNB7-DN_cavM6.js → chunk-WFWHJNB7-Cmed18Pk.js} +1 -1
  45. package/dist/{chunk-XRWGC2XP-Bb5eGNM2.js → chunk-XRWGC2XP-DH5GDaY8.js} +1 -1
  46. package/dist/{chunk-ZPAFE4SF-S5UYNb0V.js → chunk-ZPAFE4SF-DPDwaqZm.js} +22 -22
  47. package/dist/classDiagram-KNZD7YFC-azuS_99k.js +39 -0
  48. package/dist/classDiagram-v2-RKCZMP56-CQpyQQOR.js +39 -0
  49. package/dist/{click-outside-container-DE4e7p1p.js → click-outside-container-CL_FkgGY.js} +7 -12
  50. package/dist/{clike-CxAz4p9E.js → clike-DYfRWWXk.js} +1 -1
  51. package/dist/{clike-Cg_DBrJ0.js → clike-bzZTreP4.js} +1 -1
  52. package/dist/clojure-ATksAecl.js +4 -0
  53. package/dist/{clone-Dk4FkKH0.js → clone-Msbhmn2a.js} +1 -1
  54. package/dist/cmake-CWylaz2C.js +4 -0
  55. package/dist/cobol-BiLLCZIQ.js +4 -0
  56. package/dist/coffeescript-Ca4jipi8.js +4 -0
  57. package/dist/commonlisp-BwFjyEC7.js +4 -0
  58. package/dist/{constants-Cjd_3kwd.js → constants-BCOEQoEQ.js} +3 -3
  59. package/dist/{copy-C5RFg7ok.js → copy-BkZ8PkBM.js} +6 -2
  60. package/dist/{cose-bilkent-S5V4N54A-B3iOTGu5.js → cose-bilkent-S5V4N54A-BZnbwyVD.js} +20 -20
  61. package/dist/crystal-BhUsQHbh.js +4 -0
  62. package/dist/css-Cf4wlIyV.js +5 -0
  63. package/dist/cypher-Dj8Hzgxa.js +4 -0
  64. package/dist/{cytoscape.esm-DTDV0Nbj.js → cytoscape.esm-BTpRoPd2.js} +586 -661
  65. package/dist/d-DZI7tbTy.js +4 -0
  66. package/dist/{dagre-5GWH7T2D-KM4Z11yT.js → dagre-5GWH7T2D-BGaiSZZO.js} +32 -37
  67. package/dist/{dagre-B0u1urxE.js → dagre-pyfDIOWJ.js} +57 -76
  68. package/dist/data-grid-overlay-editor-867aBz0Y.js +133 -0
  69. package/dist/{diagram-N5W7TBWH-CtO7az4G.js → diagram-N5W7TBWH-CzLE0jZB.js} +35 -51
  70. package/dist/diagram-QEK2KX5R-AGS60xEZ.js +245 -0
  71. package/dist/{diagram-S2PKOQOG-CiXElLNQ.js → diagram-S2PKOQOG-BxRoG6yW.js} +28 -28
  72. package/dist/diff-WQISUHG5.js +4 -0
  73. package/dist/{dist-CdE2C2In.js → dist-2Ne-33Xy.js} +15 -20
  74. package/dist/{dist-DKFaZRVk.js → dist-B0YD1aXi.js} +2 -2
  75. package/dist/{dist-DBhzmFyH.js → dist-B1Dv8Sdk.js} +3 -3
  76. package/dist/{dist-CGIZPq3J.js → dist-BFkr6kAQ.js} +2 -2
  77. package/dist/{dist-DL_ci7Yc.js → dist-BL2DSY0P.js} +1 -1
  78. package/dist/dist-BawZu0ix.js +10 -0
  79. package/dist/{dist-Bar1QnNM.js → dist-BhVFggab.js} +3 -3
  80. package/dist/{textile-Cy55fYGC.js → dist-BiOF7987.js} +4 -2
  81. package/dist/{dist-BQmQQqFH.js → dist-BpzZrRd6.js} +1 -1
  82. package/dist/{dist-CxD5E6Sh.js → dist-C7zhQ7K0.js} +24 -22
  83. package/dist/{dist-BqgkUnEN.js → dist-CBhnQKQ4.js} +3 -3
  84. package/dist/{dist-Dzk1C8l5.js → dist-CId4IPXu.js} +10 -13
  85. package/dist/{dist-CUnh_3Ii.js → dist-CYhQCVru.js} +2 -2
  86. package/dist/{dist-BBlFk9ki.js → dist-CZq5-ZyD.js} +1 -1
  87. package/dist/{dist-elblfNXO.js → dist-Cacac5HV.js} +2 -2
  88. package/dist/{dist-CChOkSUg.js → dist-CfQHSIQC.js} +3 -3
  89. package/dist/{dist-JCAky9ND.js → dist-CkvGMBAS.js} +17 -22
  90. package/dist/dist-Cs3McXEj.js +6 -0
  91. package/dist/{dist-o7fhJC7U.js → dist-CvyfRaIr.js} +3 -3
  92. package/dist/{dist-CZfRM7pE.js → dist-D-3fICwh.js} +2 -2
  93. package/dist/dist-D3aaithT.js +6 -0
  94. package/dist/{dist-CutXTm8t.js → dist-DBhEu3-F.js} +1 -1
  95. package/dist/dist-DELcMSpJ.js +6 -0
  96. package/dist/{dist-C7ASiFxI.js → dist-DMxl6Qbu.js} +273 -263
  97. package/dist/{dist-CLvpViod.js → dist-DS6nuHYK.js} +2 -3
  98. package/dist/dist-Dgts3WXd.js +6 -0
  99. package/dist/{dist--I6Htnlv.js → dist-DlHkZUnY.js} +5 -5
  100. package/dist/dist-Doiq_KIP.js +15 -0
  101. package/dist/dist-DtpUiDG_.js +6 -0
  102. package/dist/{dist-DzOpMdwb.js → dist-NUdHX0XE.js} +4 -4
  103. package/dist/{dist-C3WYsf4K.js → dist-PGgOcwbF.js} +4 -10
  104. package/dist/{dist-DNnYAdRE.js → dist-RdxOJbBw.js} +2 -2
  105. package/dist/{dist-BEvIw5Nh.js → dist-RwqAqkpG.js} +1 -1
  106. package/dist/dist-ZjnJq_jD.js +10 -0
  107. package/dist/{dist-CbRkrKrP.js → dist-biZ846D9.js} +5 -5
  108. package/dist/{dist-DW9er3Zq.js → dist-d5NxvX2s.js} +44 -23
  109. package/dist/{dist-C3QUag__.js → dist-ivwkJchV.js} +3 -3
  110. package/dist/dist-mof3iuBu.js +12 -0
  111. package/dist/{dist-Cib4sGDA.js → dist-reo2kYlN.js} +2 -2
  112. package/dist/{dist-BZBitvuL.js → dist-wHVprCkn.js} +1 -1
  113. package/dist/{dist-C5zMs_n5.js → dist-y8uoXYaE.js} +3 -3
  114. package/dist/{dist-DPF5TTUg.js → dist-z_iuDES7.js} +126 -115
  115. package/dist/{dockerfile-Dum_1b-5.js → dockerfile-sZMPcXVY.js} +1 -1
  116. package/dist/dtd-B2M8dhfC.js +4 -0
  117. package/dist/dylan-CU3Vt8SC.js +4 -0
  118. package/dist/ecl-B8ESAVq4.js +4 -0
  119. package/dist/eiffel-DDfMIKeA.js +4 -0
  120. package/dist/elm-Bj6rj8jf.js +4 -0
  121. package/dist/{erDiagram-AWTI2OKA-ZTIl9iQO.js → erDiagram-AWTI2OKA-CTxzb-U8.js} +20 -20
  122. package/dist/erlang-BxyshZUq.js +4 -0
  123. package/dist/{error-banner-OQIGTqFR.js → error-banner-npbEfanI.js} +13 -13
  124. package/dist/{esm-DxFkg7a6.js → esm-BdiY4QsX.js} +1528 -1492
  125. package/dist/{esm-d0g2RsOH.js → esm-CAWW9sum.js} +6 -8
  126. package/dist/{esm-1_Mp6VD2.js → esm-YY5zh7KV.js} +324 -395
  127. package/dist/{esm-BO9n_s6u.js → esm-svAVli9f.js} +5 -5
  128. package/dist/{factor-CdgiDGiu.js → factor-CRFTmP_a.js} +1 -1
  129. package/dist/factor-CYk6XT8r.js +5 -0
  130. package/dist/{flowDiagram-PVAE7QVJ-DsbofOzu.js → flowDiagram-PVAE7QVJ-Dck2hiJe.js} +22 -22
  131. package/dist/{formats-ChrNdVdJ.js → formats-BnqXUb1V.js} +13 -17
  132. package/dist/forth-fcoJkd-f.js +4 -0
  133. package/dist/fortran-IxZHu4wc.js +4 -0
  134. package/dist/{fullscreen-D1yTiBlu.js → fullscreen-blsKUrtN.js} +741 -744
  135. package/dist/{ganttDiagram-OWAHRB6G-FnCH1Yj3.js → ganttDiagram-OWAHRB6G-AWzfzpup.js} +9 -9
  136. package/dist/gas-B8rmKcim.js +4 -0
  137. package/dist/gherkin-BTm-jIdJ.js +4 -0
  138. package/dist/gitGraph-ZV4HHKMB-DFg_OLQb.js +21 -0
  139. package/dist/{gitGraphDiagram-NY62KEGX-B0wvMNqU.js → gitGraphDiagram-NY62KEGX-GyNboWSV.js} +31 -34
  140. package/dist/{glide-data-editor-D_kEsT07.js → glide-data-editor-DHuN8kQ8.js} +1650 -1720
  141. package/dist/{graphlib-BGmr7CYF.js → graphlib-hb3zmtVD.js} +5 -5
  142. package/dist/groovy-01kRHFMD.js +4 -0
  143. package/dist/haskell-B3PhE05w.js +4 -0
  144. package/dist/haxe-DEoAm8oA.js +5 -0
  145. package/dist/{hotkeys-yFrUwyJK.js → hotkeys-Ct2T3e9O.js} +4 -7
  146. package/dist/idl-DsDJU9cV.js +4 -0
  147. package/dist/info-63CPKGFF-D3DZmDBa.js +21 -0
  148. package/dist/infoDiagram-STP46IZ2-ec08vi_U.js +44 -0
  149. package/dist/{isArrayLikeObject-DiDsNamC.js → isArrayLikeObject-BlvK28do.js} +3 -5
  150. package/dist/{isEmpty-BBG-u1GM.js → isEmpty--odfYjh1.js} +2 -2
  151. package/dist/{isSymbol-BxF-_8BA.js → isSymbol-Cb1f2HgO.js} +1 -1
  152. package/dist/{javascript-Dfq1qI35.js → javascript-BfCTmOnk.js} +2 -2
  153. package/dist/javascript-gwczVhuU.js +5 -0
  154. package/dist/jinja2-AkZRdFk3.js +4 -0
  155. package/dist/{journeyDiagram-BIP6EPQ6-B3PotfAW.js → journeyDiagram-BIP6EPQ6-TmXYCUbT.js} +23 -24
  156. package/dist/julia-_s6qe3bf.js +4 -0
  157. package/dist/{kanban-definition-6OIFK2YF-BTrQZ3LN.js → kanban-definition-6OIFK2YF-B6ozleHo.js} +15 -15
  158. package/dist/{katex-dN__NFdn.js → katex-mPzRsXEy.js} +1 -1
  159. package/dist/{katex-BE4xflfm.js → katex-mkWmhPUh.js} +149 -173
  160. package/dist/{label-BinTsX-u.js → label-VVRKZmrP.js} +21 -24
  161. package/dist/{linear-DyTdUIqX.js → linear-iebAbJVD.js} +1 -1
  162. package/dist/livescript-CwPHQdv5.js +4 -0
  163. package/dist/{loader-Dijti3y4.js → loader-CM0VALo9.js} +19 -26
  164. package/dist/lua-s7nRxkCP.js +4 -0
  165. package/dist/main.js +8161 -8431
  166. package/dist/{marked.esm-3RjvXPoO.js → marked.esm-DJM8la36.js} +5 -5
  167. package/dist/mathematica-Ci36yd1q.js +4 -0
  168. package/dist/mbox-DbOYMNCO.js +4 -0
  169. package/dist/{memoize-Dq87l1O_.js → memoize-DYoRBSLn.js} +1 -1
  170. package/dist/{merge-BPDCIm8P.js → merge-BjuR6j_w.js} +1 -1
  171. package/dist/{mermaid-MWiyXDcI.js → mermaid-YPPMBmhk.js} +58 -76
  172. package/dist/{mermaid-parser.core-CSFx6MQ7.js → mermaid-parser.core-BLkyTSZj.js} +8 -8
  173. package/dist/{mhchem-DZ68WS0G.js → mhchem-Dw7wvXtr.js} +1 -1
  174. package/dist/{min-BzhKOmZo.js → min-B_i2ahn4.js} +7 -7
  175. package/dist/{mindmap-definition-Q6HEUPPD-9hhnrO1k.js → mindmap-definition-Q6HEUPPD-F6-JnXwq.js} +17 -17
  176. package/dist/mirc-VmNe8AwF.js +4 -0
  177. package/dist/mllike-BdD7SJEa.js +6 -0
  178. package/dist/modelica-BA4VqzC3.js +4 -0
  179. package/dist/mscgen-DF-5WHJm.js +6 -0
  180. package/dist/mumps-c_Uia_QN.js +4 -0
  181. package/dist/{node-sql-parser-13oju30e.js → node-sql-parser-BqKV-TpL.js} +14343 -14351
  182. package/dist/{now-DVBcRCoE.js → now-CwRqw0nS.js} +1 -1
  183. package/dist/nsis-BAANGODV.js +5 -0
  184. package/dist/{nsis-BW6_XagK.js → nsis-BWJEeUyS.js} +1 -1
  185. package/dist/ntriples-Bslqh2Ki.js +4 -0
  186. package/dist/{number-overlay-editor-D1YdiOrm.js → number-overlay-editor-CeyruAX4.js} +17 -23
  187. package/dist/octave-DYn5ltia.js +4 -0
  188. package/dist/oz-B_N-StZq.js +4 -0
  189. package/dist/packet-HUATNLJX-CkqjFdAv.js +21 -0
  190. package/dist/pascal-DU4CtAUu.js +4 -0
  191. package/dist/perl-Bae6k32u.js +4 -0
  192. package/dist/pie-WTHONI2E-D0rWwX5P.js +21 -0
  193. package/dist/{pieDiagram-ADFJNKIX-CSBC0ZgF.js → pieDiagram-ADFJNKIX-C5dSQVCn.js} +28 -28
  194. package/dist/pig-DSIxUEgX.js +4 -0
  195. package/dist/powershell-31lcPgIF.js +4 -0
  196. package/dist/powershell-BZx53Ujw.js +236 -0
  197. package/dist/properties-lmYbntDG.js +4 -0
  198. package/dist/protobuf-BTYoCEpV.js +4 -0
  199. package/dist/pug-DMFM7zzO.js +5 -0
  200. package/dist/{pug-Bmups_z0.js → pug-PJh82u1M.js} +1 -1
  201. package/dist/puppet-B0ub07d-.js +4 -0
  202. package/dist/python-C4jT87Nt.js +5 -0
  203. package/dist/{q-BzWcnVri.js → q-CMoUHJ5Q.js} +3 -2
  204. package/dist/q-YbPYlqRI.js +4 -0
  205. package/dist/{quadrantDiagram-LMRXKWRM-h7nHf8xG.js → quadrantDiagram-LMRXKWRM-DlahxNiy.js} +7 -7
  206. package/dist/r-OfNu6HAI.js +4 -0
  207. package/dist/radar-NJJJXTRR-Bxqv4O5a.js +21 -0
  208. package/dist/{range-CgK0-PEw.js → range-DxfkexCE.js} +3 -3
  209. package/dist/{react-plotly-BZakcxdv.js → react-plotly-D_IAfR8f.js} +4364 -4705
  210. package/dist/{requirementDiagram-4UW4RH46-BGEurQYq.js → requirementDiagram-4UW4RH46-DTkinyvU.js} +17 -17
  211. package/dist/rpm-D_3b5peD.js +5 -0
  212. package/dist/ruby-CehsJy_T.js +4 -0
  213. package/dist/{sankeyDiagram-GR3RE2ED-CxeJ_jfl.js → sankeyDiagram-GR3RE2ED-CsLnEnnq.js} +3 -3
  214. package/dist/sas-DwQHzPoF.js +4 -0
  215. package/dist/scheme-B6ArxiQu.js +4 -0
  216. package/dist/{sequenceDiagram-C3RYC4MD-CbFxwyr_.js → sequenceDiagram-C3RYC4MD-BdEOR6SC.js} +20 -30
  217. package/dist/shell-AHmQgDfc.js +4 -0
  218. package/dist/sieve-CgodKOcx.js +4 -0
  219. package/dist/{simple-mode-Cgyya8F-.js → simple-mode-BP3Jd4vf.js} +1 -1
  220. package/dist/{slides-component-BEyG25AH.js → slides-component-2bbal1YJ.js} +24 -46
  221. package/dist/smalltalk-BeFzDkbo.js +4 -0
  222. package/dist/sparql-BWxq-Lnx.js +4 -0
  223. package/dist/{src-BNNJRxz3.js → src-DZkaBUmt.js} +6 -6
  224. package/dist/{stateDiagram-KXAO66HF-A61bMf29.js → stateDiagram-KXAO66HF-DQLH2jhP.js} +39 -41
  225. package/dist/stateDiagram-v2-UMBNRL4Z-D9v8fKjF.js +38 -0
  226. package/dist/stex-Dvaq0qsm.js +5 -0
  227. package/dist/style.css +1 -1
  228. package/dist/stylus-Ge0ofWlZ.js +4 -0
  229. package/dist/swift-CjQfbVxV.js +4 -0
  230. package/dist/tcl-CAGDF11K.js +4 -0
  231. package/dist/textile-CrXreJtf.js +4 -0
  232. package/dist/{time-D3tzCqJ6.js → time-CFkXkVrt.js} +1 -1
  233. package/dist/{timeline-definition-XQNQX7LJ-BwdsB7CR.js → timeline-definition-XQNQX7LJ-bToVq14i.js} +4 -5
  234. package/dist/{timer-D3Zlu9ow.js → timer-CzOhIJuk.js} +2 -2
  235. package/dist/{toNumber-efKT08hh.js → toNumber-EFF1Z9T1.js} +2 -2
  236. package/dist/{toString-BvCd3yJc.js → toString-C2mCkasT.js} +2 -2
  237. package/dist/toml-AdLXKwEi.js +4 -0
  238. package/dist/{toml-CIUkU1CP.js → toml-eSl4PUAH.js} +6 -2
  239. package/dist/treemap-75Q7IDZK-Da9Jv6a_.js +21 -0
  240. package/dist/troff-C-LaM2ex.js +4 -0
  241. package/dist/ttcn-DTclUi6T.js +4 -0
  242. package/dist/ttcn-cfg-BtBPbmLX.js +4 -0
  243. package/dist/turtle-BODDDg5O.js +4 -0
  244. package/dist/{types-1X1uZB4y.js → types-CRXV0KD5.js} +84 -95
  245. package/dist/{useAsyncData-C4IqQK0g.js → useAsyncData-uMVTsDI9.js} +1 -1
  246. package/dist/{useDateFormatter-BCsBqetx.js → useDateFormatter-Dcz7jstn.js} +6 -6
  247. package/dist/{useTheme-C2pgJzDH.js → useTheme-NbEx-ZNV.js} +13 -10
  248. package/dist/vb-Cb1HQHii.js +4 -0
  249. package/dist/vbscript-CpXOP4wZ.js +4 -0
  250. package/dist/{vega-component-Cv4J8CHz.js → vega-component-hegVmfuS.js} +21 -21
  251. package/dist/{vega-loader.browser.module-Bi3ttvdj.js → vega-loader.browser.module-DcW8jnKp.js} +1 -2
  252. package/dist/velocity-Dz0rBQIk.js +4 -0
  253. package/dist/verilog-6Di9aLKw.js +4 -0
  254. package/dist/vhdl-BRNesXYc.js +4 -0
  255. package/dist/webidl-BpRNYIYn.js +4 -0
  256. package/dist/xquery-DXWcJ7b6.js +4 -0
  257. package/dist/{xychartDiagram-6GGTOJPD-BJRRi5HC.js → xychartDiagram-6GGTOJPD-C7Bhm_yt.js} +12 -13
  258. package/dist/yacas-DbSARPz4.js +4 -0
  259. package/dist/z80-DzslPj_l.js +4 -0
  260. package/dist/{zod-UPQf9SGn.js → zod-ChY6miG5.js} +71 -81
  261. package/package.json +12 -12
  262. package/src/__mocks__/requests.ts +2 -0
  263. package/src/components/app-config/user-config-form.tsx +29 -25
  264. package/src/components/chat/chat-utils.ts +11 -4
  265. package/src/components/data-table/__tests__/header-items.test.tsx +117 -0
  266. package/src/components/data-table/column-header.tsx +4 -2
  267. package/src/components/data-table/columns.tsx +2 -1
  268. package/src/components/data-table/data-table.tsx +7 -2
  269. package/src/components/data-table/header-items.tsx +63 -10
  270. package/src/components/dependency-graph/custom-node.tsx +11 -11
  271. package/src/components/dependency-graph/elements.ts +9 -4
  272. package/src/components/dependency-graph/panels.tsx +6 -4
  273. package/src/components/editor/Output.tsx +6 -1
  274. package/src/components/editor/ai/ai-completion-editor.tsx +135 -5
  275. package/src/components/editor/ai/completion-handlers.tsx +106 -22
  276. package/src/components/editor/cell/code/cell-editor.tsx +5 -0
  277. package/src/components/editor/chrome/panels/cache-panel.tsx +216 -0
  278. package/src/components/editor/chrome/panels/empty-state.tsx +3 -1
  279. package/src/components/editor/chrome/types.ts +66 -22
  280. package/src/components/editor/chrome/wrapper/app-chrome.tsx +2 -0
  281. package/src/components/editor/errors/auto-fix.tsx +138 -32
  282. package/src/components/editor/errors/fix-mode.ts +15 -0
  283. package/src/components/editor/navigation/__tests__/clipboard.test.ts +0 -5
  284. package/src/components/editor/navigation/clipboard.ts +2 -1
  285. package/src/components/editor/notebook-cell.tsx +20 -7
  286. package/src/components/editor/output/ConsoleOutput.tsx +27 -33
  287. package/src/components/editor/output/JsonOutput.tsx +9 -0
  288. package/src/components/editor/output/MarimoTracebackOutput.tsx +10 -7
  289. package/src/components/editor/output/__tests__/json-output.test.ts +43 -0
  290. package/src/components/editor/package-alert.tsx +3 -0
  291. package/src/components/forms/__tests__/form-utils.test.ts +4 -2
  292. package/src/components/icons/copy-icon.tsx +11 -5
  293. package/src/components/shortcuts/renderShortcut.tsx +3 -1
  294. package/src/components/ui/button.tsx +2 -0
  295. package/src/components/ui/confirmation-button.tsx +85 -0
  296. package/src/components/ui/switch.tsx +2 -0
  297. package/src/core/ai/context/providers/__tests__/datasource.test.ts +9 -1
  298. package/src/core/ai/context/providers/datasource.ts +25 -1
  299. package/src/core/ai/state.ts +6 -3
  300. package/src/core/ai/tools/__tests__/registry.test.ts +33 -8
  301. package/src/core/ai/tools/base.ts +81 -1
  302. package/src/core/ai/tools/registry.ts +36 -10
  303. package/src/core/ai/tools/sample-tool.ts +44 -8
  304. package/src/core/cache/requests.ts +5 -0
  305. package/src/core/cells/cells.ts +1 -1
  306. package/src/core/codemirror/__tests__/__snapshots__/setup.test.ts.snap +2 -0
  307. package/src/core/codemirror/__tests__/replace-editor-content.test.ts +336 -0
  308. package/src/core/codemirror/find-replace/navigate.ts +2 -2
  309. package/src/core/codemirror/format.ts +2 -9
  310. package/src/core/codemirror/language/__tests__/sql.test.ts +24 -6
  311. package/src/core/codemirror/language/languages/python.ts +1 -3
  312. package/src/core/codemirror/language/languages/sql/sql.ts +23 -13
  313. package/src/core/codemirror/language/panel/panel.tsx +1 -6
  314. package/src/core/codemirror/language/utils.ts +3 -8
  315. package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +21 -14
  316. package/src/core/codemirror/lsp/federated-lsp.ts +20 -9
  317. package/src/core/codemirror/lsp/notebook-lsp.ts +35 -29
  318. package/src/core/codemirror/lsp/types.ts +0 -13
  319. package/src/core/codemirror/replace-editor-content.ts +87 -0
  320. package/src/core/config/__tests__/config-schema.test.ts +3 -0
  321. package/src/core/config/config-schema.ts +8 -0
  322. package/src/core/config/feature-flag.tsx +2 -4
  323. package/src/core/errors/__tests__/errors.test.ts +1 -0
  324. package/src/core/errors/errors.ts +20 -6
  325. package/src/core/islands/bridge.ts +2 -0
  326. package/src/core/islands/main.ts +4 -0
  327. package/src/core/kernel/messages.ts +1 -0
  328. package/src/core/network/requests-network.ts +14 -0
  329. package/src/core/network/requests-static.ts +2 -0
  330. package/src/core/network/requests-toasting.ts +2 -0
  331. package/src/core/network/types.ts +5 -0
  332. package/src/core/saving/save-component.tsx +43 -36
  333. package/src/core/wasm/bridge.ts +2 -0
  334. package/src/core/websocket/useMarimoWebSocket.tsx +8 -0
  335. package/src/css/app/codemirror-completions.css +1 -1
  336. package/src/custom.d.ts +2 -0
  337. package/src/plugins/core/registerReactComponent.tsx +5 -1
  338. package/src/plugins/impl/DataTablePlugin.tsx +19 -19
  339. package/src/plugins/impl/__tests__/DateTimePickerPlugin.test.tsx +32 -0
  340. package/src/plugins/impl/chat/ChatPlugin.tsx +1 -1
  341. package/src/plugins/impl/chat/chat-ui.tsx +17 -2
  342. package/src/plugins/impl/chat/types.ts +1 -1
  343. package/src/plugins/impl/data-frames/DataFramePlugin.tsx +7 -2
  344. package/src/plugins/impl/plotly/__tests__/parse-from-template.test.ts +17 -0
  345. package/src/plugins/impl/plotly/parse-from-template.ts +2 -1
  346. package/src/utils/__tests__/formatting.test.ts +107 -0
  347. package/src/utils/__tests__/json-parser.test.ts +13 -0
  348. package/src/utils/copy.ts +6 -0
  349. package/src/utils/formatting.ts +51 -0
  350. package/src/utils/json/json-parser.ts +28 -3
  351. package/dist/any-language-editor-CVFQlioK.js +0 -156
  352. package/dist/apl-ChlaBfxB.js +0 -4
  353. package/dist/architecture-O4VJ6CD3-BVeaxUcM.js +0 -21
  354. package/dist/asciiarmor-CcJmm3l_.js +0 -4
  355. package/dist/asn1-ThRYxoBE.js +0 -4
  356. package/dist/assets/__vite-browser-external-Dv_SHu1h.js +0 -1
  357. package/dist/assets/worker-DVOR9oZG.js +0 -54
  358. package/dist/brainfuck-CEM0JgDn.js +0 -4
  359. package/dist/chunk-EXTU4WIE-DECT9AAK.js +0 -14
  360. package/dist/chunk-S3R3BYOJ-DMQ1yeyq.js +0 -386
  361. package/dist/classDiagram-KNZD7YFC-BG53O6Jt.js +0 -39
  362. package/dist/classDiagram-v2-RKCZMP56-BmKILsGU.js +0 -39
  363. package/dist/clojure-B7RHyE9t.js +0 -4
  364. package/dist/cmake-TeTMP4I5.js +0 -4
  365. package/dist/cobol-DI-mxUER.js +0 -4
  366. package/dist/coffeescript-DHUFLqWp.js +0 -4
  367. package/dist/commonlisp-SLiUrh1m.js +0 -4
  368. package/dist/crystal-B4fY1ZfJ.js +0 -4
  369. package/dist/css-Bdoq3TzK.js +0 -5
  370. package/dist/cypher-CBU182fp.js +0 -4
  371. package/dist/d-D8myDZeH.js +0 -4
  372. package/dist/data-grid-overlay-editor-qNmJk2x0.js +0 -135
  373. package/dist/diagram-QEK2KX5R-fu8Noi3H.js +0 -245
  374. package/dist/diff-DJF_UB7H.js +0 -4
  375. package/dist/dist-52-_pKoy.js +0 -6
  376. package/dist/dist-6DOMStFn.js +0 -6
  377. package/dist/dist-B334aW7p.js +0 -10
  378. package/dist/dist-BOI9lUz-.js +0 -12
  379. package/dist/dist-C06uhBzF.js +0 -6
  380. package/dist/dist-CGkpguCB.js +0 -6
  381. package/dist/dist-CrApzUED.js +0 -6
  382. package/dist/dist-Dp2GLdCl.js +0 -14
  383. package/dist/dist-WHFsbMDr.js +0 -6
  384. package/dist/dist-hyKcTPG9.js +0 -10
  385. package/dist/dtd-DY8q65lC.js +0 -4
  386. package/dist/dylan-CBLcjWCi.js +0 -4
  387. package/dist/ecl-BSXPNfOw.js +0 -4
  388. package/dist/eiffel-BJf0PQX-.js +0 -4
  389. package/dist/elm-DWQwPCZS.js +0 -4
  390. package/dist/erlang-BWBaGZ5e.js +0 -4
  391. package/dist/factor-DT1-MBPl.js +0 -5
  392. package/dist/forth-D9GDt3FB.js +0 -4
  393. package/dist/fortran-DHkRhDWw.js +0 -4
  394. package/dist/gas-7lQEOM0H.js +0 -4
  395. package/dist/gherkin-BLLyroYi.js +0 -4
  396. package/dist/gitGraph-ZV4HHKMB-z2v_cInC.js +0 -21
  397. package/dist/groovy-C-wabwj0.js +0 -4
  398. package/dist/haskell-DaxVQ_d1.js +0 -4
  399. package/dist/haxe-C2yLoC7h.js +0 -5
  400. package/dist/idl-DQBP8i7k.js +0 -4
  401. package/dist/info-63CPKGFF-GS4w6pCB.js +0 -21
  402. package/dist/infoDiagram-STP46IZ2-DE9YYPFg.js +0 -44
  403. package/dist/javascript-DRwFV9r5.js +0 -5
  404. package/dist/jinja2-CNoIpVmN.js +0 -4
  405. package/dist/julia-DXDf-GhP.js +0 -4
  406. package/dist/livescript-S2uhJQx7.js +0 -4
  407. package/dist/lua-Bvgs0y2G.js +0 -4
  408. package/dist/mathematica-D2zqfwIg.js +0 -4
  409. package/dist/mbox-SBcPaDuZ.js +0 -4
  410. package/dist/mirc-hkQc7sVF.js +0 -4
  411. package/dist/mllike-DRWPBlr9.js +0 -6
  412. package/dist/modelica-CO2ROGlP.js +0 -4
  413. package/dist/mscgen-BpX61bO6.js +0 -6
  414. package/dist/mumps-BCnFeIn6.js +0 -4
  415. package/dist/nsis-BaTOxlD1.js +0 -5
  416. package/dist/ntriples-zEo5BWjr.js +0 -4
  417. package/dist/octave-BE0RnCM9.js +0 -4
  418. package/dist/oz-C4_2Ttul.js +0 -4
  419. package/dist/packet-HUATNLJX-CjHqJIqk.js +0 -21
  420. package/dist/pascal-Q3jJucpw.js +0 -4
  421. package/dist/perl-DkXZIWHF.js +0 -4
  422. package/dist/pie-WTHONI2E-D67gLWtR.js +0 -21
  423. package/dist/pig-DCgEHdsu.js +0 -4
  424. package/dist/powershell-3rK_nRRJ.js +0 -236
  425. package/dist/powershell-Eo2-7MoM.js +0 -4
  426. package/dist/properties-C0IOX8WR.js +0 -4
  427. package/dist/protobuf--lGQUSRO.js +0 -4
  428. package/dist/pug-Cf8AQHMJ.js +0 -5
  429. package/dist/puppet-D7Z3dTJn.js +0 -4
  430. package/dist/python-FHIx_i8Y.js +0 -5
  431. package/dist/q-B7UA1feM.js +0 -4
  432. package/dist/r-Cc9R2A7N.js +0 -4
  433. package/dist/radar-NJJJXTRR-C-AZP_Te.js +0 -21
  434. package/dist/rpm-vhJNlrQ6.js +0 -5
  435. package/dist/ruby-CVluPY0M.js +0 -4
  436. package/dist/sas-A8DL8oy3.js +0 -4
  437. package/dist/scheme-6xHHcSXC.js +0 -4
  438. package/dist/shell-DHN-e5rf.js +0 -4
  439. package/dist/sieve-BuQwLY02.js +0 -4
  440. package/dist/smalltalk-BA4HPg2H.js +0 -4
  441. package/dist/sparql-Bf4yCuy3.js +0 -4
  442. package/dist/stateDiagram-v2-UMBNRL4Z-C_0FUzzk.js +0 -38
  443. package/dist/stex-D-I1cYeE.js +0 -5
  444. package/dist/stylus-BMeped2l.js +0 -4
  445. package/dist/swift-lwEdlZoC.js +0 -4
  446. package/dist/tcl-B03ipeqv.js +0 -4
  447. package/dist/toml-BLgrVtfu.js +0 -4
  448. package/dist/treemap-75Q7IDZK-DTvwfpWt.js +0 -21
  449. package/dist/troff-g6EjN2O2.js +0 -4
  450. package/dist/ttcn-Dzvba8jK.js +0 -4
  451. package/dist/ttcn-cfg-CadG0p1K.js +0 -4
  452. package/dist/turtle-DkXAMWo9.js +0 -4
  453. package/dist/vb-C5dCiel8.js +0 -4
  454. package/dist/vbscript-I4bDEQln.js +0 -4
  455. package/dist/velocity-mt0fDwFH.js +0 -4
  456. package/dist/verilog-Dxq3KJkc.js +0 -4
  457. package/dist/vhdl-Km0QUlV-.js +0 -4
  458. package/dist/webidl-B3lJ2MRL.js +0 -4
  459. package/dist/xquery-CcIxNPEe.js +0 -4
  460. package/dist/yacas-oMa-f-tN.js +0 -4
  461. package/dist/z80-D03Nvn6l.js +0 -4
  462. /package/dist/{apl-DZqo8Elt.js → apl-CEHentF4.js} +0 -0
  463. /package/dist/{asciiarmor-DTzHAIeX.js → asciiarmor-DURYiCS0.js} +0 -0
  464. /package/dist/{asn1-DrAXKsZH.js → asn1-ETAiEoXY.js} +0 -0
  465. /package/dist/{asterisk-oF4U3h48.js → asterisk-DTpbbXPb.js} +0 -0
  466. /package/dist/{brainfuck-BYgLey30.js → brainfuck-BWQep-SA.js} +0 -0
  467. /package/dist/{clojure-Bs2M3OUY.js → clojure-BzFapDkA.js} +0 -0
  468. /package/dist/{cmake-DpI8vxJN.js → cmake-DvlbIC8x.js} +0 -0
  469. /package/dist/{cobol-BQyrWo72.js → cobol-BrEI4cPR.js} +0 -0
  470. /package/dist/{coffeescript-9ke9UHmw.js → coffeescript-B6cvu8mO.js} +0 -0
  471. /package/dist/{common-keywords-BzgeAvH1.js → common-keywords-WqQm7W8t.js} +0 -0
  472. /package/dist/{commonlisp-DghUdrUH.js → commonlisp-BIT8PQqi.js} +0 -0
  473. /package/dist/{crystal-DEf_SInh.js → crystal-B_UcPArT.js} +0 -0
  474. /package/dist/{css-BzTU9lNO.js → css-dHbnt_zl.js} +0 -0
  475. /package/dist/{cypher-a2v0c11S.js → cypher-Dh3FOpL7.js} +0 -0
  476. /package/dist/{d-SAswny-M.js → d-CQD1IHee.js} +0 -0
  477. /package/dist/{diff-OJ-xLXcG.js → diff-CpF_IDx0.js} +0 -0
  478. /package/dist/{dtd-BsUf-rer.js → dtd-DYoNpy6c.js} +0 -0
  479. /package/dist/{duckdb-keywords-B0NOra5o.js → duckdb-keywords-CdIsl9L0.js} +0 -0
  480. /package/dist/{dylan-C0ZYngjn.js → dylan-Bc_2G1E-.js} +0 -0
  481. /package/dist/{ebnf-DF1xx0b_.js → ebnf-jGVT_YpN.js} +0 -0
  482. /package/dist/{ecl-Bsuvoouq.js → ecl-UIU-P-Ar.js} +0 -0
  483. /package/dist/{eiffel-DgfSpLi-.js → eiffel-C90Oyuix.js} +0 -0
  484. /package/dist/{elm-GNxDj-5E.js → elm-B9fWSySj.js} +0 -0
  485. /package/dist/{erlang-Ds3uY1kL.js → erlang-Ccff0UAn.js} +0 -0
  486. /package/dist/{fcl-CqBgSioc.js → fcl-CGR8NxAg.js} +0 -0
  487. /package/dist/{forth-JCaLysGk.js → forth-U1ROGcBY.js} +0 -0
  488. /package/dist/{fortran-Dc2AoKAl.js → fortran-3nOkjDmc.js} +0 -0
  489. /package/dist/{gas-Q4Uz82YW.js → gas-B_4H5FzV.js} +0 -0
  490. /package/dist/{gherkin-Dpxe49sQ.js → gherkin-B0eru5Uz.js} +0 -0
  491. /package/dist/{groovy-D8mTRCu6.js → groovy-dqjtZUVf.js} +0 -0
  492. /package/dist/{haskell-2_8cC4wY.js → haskell-DFzCCQzo.js} +0 -0
  493. /package/dist/{haxe-Bl9zkZlz.js → haxe-Da8Pj5RT.js} +0 -0
  494. /package/dist/{http-DKCqY6yS.js → http-1HACL_9s.js} +0 -0
  495. /package/dist/{idl-Dn-HNfGW.js → idl-D3NXs5iM.js} +0 -0
  496. /package/dist/{jinja2-JjFiAGKk.js → jinja2-gBHAxUdF.js} +0 -0
  497. /package/dist/{julia-R5wne8eu.js → julia-bG-6nJ-_.js} +0 -0
  498. /package/dist/{livescript-DSwokrYj.js → livescript-BlsRC8UJ.js} +0 -0
  499. /package/dist/{lua-CgXfrp2-.js → lua-BbDC0_5w.js} +0 -0
  500. /package/dist/{mathematica-BVli92MR.js → mathematica-YZTe3-PF.js} +0 -0
  501. /package/dist/{mbox-CMFlocdS.js → mbox-CY5idp08.js} +0 -0
  502. /package/dist/{mirc-BkW04Zpc.js → mirc-CbQuFZKk.js} +0 -0
  503. /package/dist/{mllike-DEjvHvNV.js → mllike-DsbHMX-5.js} +0 -0
  504. /package/dist/{modelica-CxDn-oje.js → modelica-CQuvsOQk.js} +0 -0
  505. /package/dist/{mscgen-D78wmE-w.js → mscgen-LIpBP9VR.js} +0 -0
  506. /package/dist/{mumps-Bi0IvPOV.js → mumps-Ct5NXoaG.js} +0 -0
  507. /package/dist/{nginx-DErPZFhX.js → nginx-Dvc62C8z.js} +0 -0
  508. /package/dist/{ntriples-Btyp6wRL.js → ntriples-jVkxWUuv.js} +0 -0
  509. /package/dist/{octave-CZA6-2F8.js → octave-jGOImUB0.js} +0 -0
  510. /package/dist/{oz-Bm6LSNfE.js → oz-Y0FKDMS2.js} +0 -0
  511. /package/dist/{pascal-B4J6a9BH.js → pascal-BaLtPWWB.js} +0 -0
  512. /package/dist/{perl-CzVqxS08.js → perl-CjfE0JLo.js} +0 -0
  513. /package/dist/{pig-Clh03cnn.js → pig-DE4epV99.js} +0 -0
  514. /package/dist/{properties-D7ch1Wyb.js → properties-CLyCG5C-.js} +0 -0
  515. /package/dist/{protobuf-DrkdrMPK.js → protobuf-BjBBs_V4.js} +0 -0
  516. /package/dist/{puppet-BtZG8zdO.js → puppet-ZImLuomA.js} +0 -0
  517. /package/dist/{python-B6FKOVIv.js → python-C9YN71pR.js} +0 -0
  518. /package/dist/{r-Dnvo5-96.js → r-DILmKWWW.js} +0 -0
  519. /package/dist/{rpm-B1DrgfnX.js → rpm-fpIsm1Kr.js} +0 -0
  520. /package/dist/{ruby-CelfUg17.js → ruby-BuiQI41h.js} +0 -0
  521. /package/dist/{sas-DfSQFMWG.js → sas-C76sJ1zF.js} +0 -0
  522. /package/dist/{scheme-BplhaWuO.js → scheme-DHjM-txv.js} +0 -0
  523. /package/dist/{shell-DqU5OS2c.js → shell--7NmGJ9p.js} +0 -0
  524. /package/dist/{sieve-BE4_IyGa.js → sieve-DaPvBv1M.js} +0 -0
  525. /package/dist/{smalltalk-B_WPL8Nx.js → smalltalk-KPvwrjCs.js} +0 -0
  526. /package/dist/{solr-DlJFg7H5.js → solr-PvZUtEDb.js} +0 -0
  527. /package/dist/{sparql-7XIlcOgW.js → sparql-CXSUIQer.js} +0 -0
  528. /package/dist/{spreadsheet-BdZSVwVp.js → spreadsheet-DPJdGPkx.js} +0 -0
  529. /package/dist/{sql-CCrq7lfJ.js → sql-Dp4ZLSIa.js} +0 -0
  530. /package/dist/{stex-BiFc8QAu.js → stex-CeXW4zzk.js} +0 -0
  531. /package/dist/{stylus-DlSH9xpH.js → stylus-BXcmrg9w.js} +0 -0
  532. /package/dist/{swift-e3tMTZgJ.js → swift-DD8I7hKP.js} +0 -0
  533. /package/dist/{tcl-DfZMC20G.js → tcl-B9Lp4GtA.js} +0 -0
  534. /package/dist/{textile-DaSeca5U.js → textile-qdiY0teq.js} +0 -0
  535. /package/dist/{tiddlywiki-dfoiz8pS.js → tiddlywiki-t32lkubq.js} +0 -0
  536. /package/dist/{tiki-yJbQzhma.js → tiki-B0qKrSMl.js} +0 -0
  537. /package/dist/{troff-FN_FrCXR.js → troff-105XJOEu.js} +0 -0
  538. /package/dist/{ttcn-7_i4HlyB.js → ttcn-1_BxDcM8.js} +0 -0
  539. /package/dist/{ttcn-cfg-B46AlBUV.js → ttcn-cfg-Cn_XgXiw.js} +0 -0
  540. /package/dist/{turtle-QQfeFveR.js → turtle-BI6LyfEu.js} +0 -0
  541. /package/dist/{vb-DToPVnLa.js → vb-BecoBfmr.js} +0 -0
  542. /package/dist/{vbscript-CtsNaTz4.js → vbscript-De-zpA4i.js} +0 -0
  543. /package/dist/{velocity-CAoNe6ns.js → velocity-DhlYJTrD.js} +0 -0
  544. /package/dist/{verilog-DrDOMiJq.js → verilog-BDZgxDOW.js} +0 -0
  545. /package/dist/{vhdl-DnO0OEPh.js → vhdl-CV0OKTbp.js} +0 -0
  546. /package/dist/{webidl-Or6d1ZfA.js → webidl-BOM1Fs0O.js} +0 -0
  547. /package/dist/{xquery-CEp_Mcpr.js → xquery-CltP_CGh.js} +0 -0
  548. /package/dist/{yacas-DgnYrSlp.js → yacas-Dch4E2Dg.js} +0 -0
  549. /package/dist/{z80-DlG_kyeB.js → z80-B5Yly27o.js} +0 -0
@@ -96,54 +96,61 @@ export function useSaveNotebook() {
96
96
  const store = useStore();
97
97
 
98
98
  // Save the notebook with the given filename
99
- const saveNotebook = useEvent((filename: string, userInitiated: boolean) => {
100
- const notebook = getNotebook();
101
- const cells = notebookCells(notebook);
102
- const cellIds = cells.map((cell) => cell.id);
103
- const codes = cells.map((cell) => cell.code);
104
- const cellNames = cells.map((cell) => cell.name);
105
- const configs = getCellConfigs(notebook);
106
- const connection = store.get(connectionAtom);
107
- const autoSaveConfig = store.get(autoSaveConfigAtom);
108
- const layout = store.get(layoutStateAtom);
109
- const kioskMode = store.get(kioskModeAtom);
99
+ const saveNotebook = useEvent(
100
+ async (filename: string, userInitiated: boolean) => {
101
+ const connection = store.get(connectionAtom);
102
+ const autoSaveConfig = store.get(autoSaveConfigAtom);
103
+ const kioskMode = store.get(kioskModeAtom);
110
104
 
111
- if (kioskMode) {
112
- return;
113
- }
105
+ if (kioskMode) {
106
+ return;
107
+ }
114
108
 
115
- // Don't save if there are no cells
116
- if (codes.length === 0) {
117
- return;
118
- }
109
+ // Don't save if we are not connected to a kernel
110
+ if (connection.state !== WebSocketState.OPEN) {
111
+ openAlert("Failed to save notebook: not connected to a kernel.");
112
+ return;
113
+ }
119
114
 
120
- // Don't save if we are not connected to a kernel
121
- if (connection.state !== WebSocketState.OPEN) {
122
- openAlert("Failed to save notebook: not connected to a kernel.");
123
- return;
124
- }
115
+ Logger.log("saving to ", filename);
125
116
 
126
- Logger.log("saving to ", filename);
127
- sendSave({
128
- cellIds: cellIds,
129
- codes,
130
- names: cellNames,
131
- filename,
132
- configs,
133
- layout: getSerializedLayout(),
134
- persist: true,
135
- }).then(() => {
136
117
  if (userInitiated && autoSaveConfig.format_on_save) {
137
- formatAll();
118
+ Logger.log("formatting notebook (onSave)");
119
+ await formatAll();
120
+ }
121
+
122
+ // Grab the latest notebook state, after formatting
123
+ const notebook = getNotebook();
124
+ const cells = notebookCells(notebook);
125
+ const cellIds = cells.map((cell) => cell.id);
126
+ const codes = cells.map((cell) => cell.code);
127
+ const cellNames = cells.map((cell) => cell.name);
128
+ const configs = getCellConfigs(notebook);
129
+ const layout = store.get(layoutStateAtom);
130
+
131
+ // Don't save if there are no cells
132
+ if (codes.length === 0) {
133
+ return;
138
134
  }
135
+
136
+ await sendSave({
137
+ cellIds: cellIds,
138
+ codes,
139
+ names: cellNames,
140
+ filename,
141
+ configs,
142
+ layout: getSerializedLayout(),
143
+ persist: true,
144
+ });
145
+
139
146
  setLastSavedNotebook({
140
147
  names: cellNames,
141
148
  codes,
142
149
  configs,
143
150
  layout,
144
151
  });
145
- });
146
- });
152
+ },
153
+ );
147
154
 
148
155
  // Save the notebook with the current filename, only if the filename exists
149
156
  const saveIfNotebookIsPersistent = useEvent((userInitiated = false) => {
@@ -551,6 +551,8 @@ export class PyodideBridge implements RunRequests, EditRequests {
551
551
  };
552
552
 
553
553
  invokeAiTool = throwNotImplemented;
554
+ clearCache = throwNotImplemented;
555
+ getCacheInfo = throwNotImplemented;
554
556
 
555
557
  private async putControlRequest(operation: object) {
556
558
  await this.rpc.proxy.request.bridge({
@@ -24,6 +24,7 @@ import { jsonParseWithSpecialChar } from "@/utils/json/json-parser";
24
24
  import { Logger } from "@/utils/Logger";
25
25
  import { reloadSafe } from "@/utils/reload-safe";
26
26
  import { useAlertActions } from "../alerts/state";
27
+ import { cacheInfoAtom } from "../cache/requests";
27
28
  import type { CellId, UIElementId } from "../cells/ids";
28
29
  import { useRunsActions } from "../cells/runs";
29
30
  import { focusAndScrollCellOutputIntoView } from "../cells/scrollCellIntoView";
@@ -87,6 +88,7 @@ export function useMarimoWebSocket(opts: {
87
88
  const setKioskMode = useSetAtom(kioskModeAtom);
88
89
  const setCapabilities = useSetAtom(capabilitiesAtom);
89
90
  const runtimeManager = useRuntimeManager();
91
+ const setCacheInfo = useSetAtom(cacheInfoAtom);
90
92
 
91
93
  const handleMessage = (e: MessageEvent<JsonString<OperationMessage>>) => {
92
94
  const msg = jsonParseWithSpecialChar(e.data);
@@ -248,6 +250,12 @@ export function useMarimoWebSocket(opts: {
248
250
  case "secret-keys-result":
249
251
  SECRETS_REGISTRY.resolve(msg.data.request_id as RequestId, msg.data);
250
252
  return;
253
+ case "cache-info-fetched":
254
+ setCacheInfo(msg.data);
255
+ return;
256
+ case "cache-cleared":
257
+ // Cache cleared, could refresh cache info if needed
258
+ return;
251
259
  case "data-source-connections":
252
260
  addDataSourceConnection({
253
261
  connections: msg.data.connections.map((conn) => ({
@@ -247,7 +247,7 @@
247
247
 
248
248
  .cm-completionInfo.cm-completionInfo-right-narrow {
249
249
  /* CodeMirror's default makes the completionInfo overlap with the
250
- * compeletion symbol */
250
+ * completion symbol */
251
251
  left: 100%;
252
252
  }
253
253
 
package/src/custom.d.ts CHANGED
@@ -16,6 +16,8 @@ interface JSON {
16
16
  text: string,
17
17
  reviver?: (this: any, key: string, value: any) => any,
18
18
  ): unknown;
19
+
20
+ rawJSON(value: string): unknown;
19
21
  }
20
22
 
21
23
  // Improve type inference for Array.filter with BooleanConstructor
@@ -32,6 +32,7 @@ import { UIElementRegistry } from "@/core/dom/uiregistry";
32
32
  import { FUNCTIONS_REGISTRY } from "@/core/functions/FunctionRegistry";
33
33
  import { LocaleProvider } from "@/core/i18n/locale-provider";
34
34
  import { store } from "@/core/state/jotai";
35
+ import { isStaticNotebook } from "@/core/static/static-state";
35
36
  import {
36
37
  type HTMLElementNotDerivedFromRef,
37
38
  useEventListener,
@@ -182,10 +183,13 @@ function PluginSlotInternal<T>(
182
183
  const objectId = getUIElementObjectId(hostElement);
183
184
  invariant(objectId, "Object ID should exist");
184
185
 
186
+ const isStatic = isStaticNotebook();
187
+
185
188
  const htmlId = HTMLCellId.findElementThroughShadowDOMs(hostElement)?.id;
186
189
  const cellId = htmlId ? HTMLCellId.parse(htmlId) : null;
187
- if (cellId) {
190
+ if (cellId && !isStatic) {
188
191
  // If the cell is not initialized, throw an error
192
+ // Continue if the cell is static, so we can propagate a clearer error message.
189
193
  const notebookState = store.get(notebookAtom);
190
194
  const cellRuntime = notebookState.cellRuntime[cellId];
191
195
  const cellData = notebookState.cellData[cellId];
@@ -205,7 +205,7 @@ type DataTableFunctions = {
205
205
  sort?: {
206
206
  by: string;
207
207
  descending: boolean;
208
- };
208
+ }[];
209
209
  query?: string;
210
210
  filters?: ConditionType[];
211
211
  page_number: number;
@@ -298,7 +298,12 @@ export const DataTablePlugin = createPlugin<S>("marimo-table")
298
298
  .input(
299
299
  z.object({
300
300
  sort: z
301
- .object({ by: z.string(), descending: z.boolean() })
301
+ .array(
302
+ z.object({
303
+ by: z.string(),
304
+ descending: z.boolean(),
305
+ }),
306
+ )
302
307
  .optional(),
303
308
  query: z.string().optional(),
304
309
  filters: z.array(ConditionSchema).optional(),
@@ -501,19 +506,15 @@ export const LoadingDataTableComponent = memo(
501
506
  !props.lazy &&
502
507
  !pageSizeChanged;
503
508
 
504
- if (sorting.length > 1) {
505
- Logger.warn("Multiple sort columns are not supported");
506
- }
509
+ // Convert sorting state to API format
510
+ const sortArgs =
511
+ sorting.length > 0
512
+ ? sorting.map((s) => ({ by: s.id, descending: s.desc }))
513
+ : undefined;
507
514
 
508
515
  // If we have sort/search/filter, use the search function
509
516
  const searchResultsPromise = search<T>({
510
- sort:
511
- sorting.length > 0
512
- ? {
513
- by: sorting[0].id,
514
- descending: sorting[0].desc,
515
- }
516
- : undefined,
517
+ sort: sortArgs,
517
518
  query: searchQuery,
518
519
  page_number: paginationState.pageIndex,
519
520
  page_size: paginationState.pageSize,
@@ -563,16 +564,15 @@ export const LoadingDataTableComponent = memo(
563
564
 
564
565
  const getRow = useCallback(
565
566
  async (rowId: number) => {
567
+ const sortArgs =
568
+ sorting.length > 0
569
+ ? sorting.map((s) => ({ by: s.id, descending: s.desc }))
570
+ : undefined;
571
+
566
572
  const result = await search<T>({
567
573
  page_number: rowId,
568
574
  page_size: 1,
569
- sort:
570
- sorting.length > 0
571
- ? {
572
- by: sorting[0].id,
573
- descending: sorting[0].desc,
574
- }
575
- : undefined,
575
+ sort: sortArgs,
576
576
  query: searchQuery,
577
577
  filters: filters.flatMap((filter) => {
578
578
  return filterToFilterCondition(
@@ -42,4 +42,36 @@ describe("DateTimePickerPlugin", () => {
42
42
  const datePicker = container.querySelector('[class*="group"]');
43
43
  expect(datePicker).not.toBeNull();
44
44
  });
45
+
46
+ it("should render with datetime.min and datetime.max edge cases", () => {
47
+ // Regression test for issue #6700
48
+ // Ensure the component can handle edge case dates like datetime.min
49
+ const plugin = new DateTimePickerPlugin();
50
+ const host = document.createElement("div");
51
+ const props: IPluginProps<string, DateTimeData> = {
52
+ host,
53
+ value: "2024-01-01T12:00:00",
54
+ setValue: (valueOrFn) => {
55
+ if (typeof valueOrFn === "function") {
56
+ valueOrFn("2024-01-01T12:00:00");
57
+ }
58
+ },
59
+ data: {
60
+ label: null,
61
+ // These are the exact values that datetime.min and datetime.max produce
62
+ start: "0001-01-01T00:00:00",
63
+ stop: "9999-12-31T23:59:59",
64
+ fullWidth: false,
65
+ },
66
+ functions: {},
67
+ };
68
+
69
+ // This should not throw an error
70
+ const { container } = render(plugin.render(props));
71
+
72
+ // Check if the component renders successfully
73
+ expect(container.innerHTML).not.toBe("");
74
+ const datePicker = container.querySelector('[class*="group"]');
75
+ expect(datePicker).not.toBeNull();
76
+ });
45
77
  });
@@ -41,7 +41,7 @@ export const ChatPlugin = createPlugin<{ messages: ChatMessage[] }>(
41
41
  z.object({
42
42
  role: z.enum(["system", "user", "assistant"]),
43
43
  content: z.string(),
44
- parts: z.array(z.any()),
44
+ parts: z.array(z.any()).nullable(),
45
45
  }),
46
46
  ),
47
47
  }),
@@ -253,6 +253,20 @@ export const Chatbot: React.FC<Props> = (props) => {
253
253
  });
254
254
  }, [messages.length, scrollContainerRef]);
255
255
 
256
+ const codemirrorView = codeMirrorInputRef.current?.view;
257
+
258
+ const resetInput = () => {
259
+ // Clear input immediately by directly manipulating the editor
260
+ // There is some delay if we use setInput("") only
261
+ if (codemirrorView) {
262
+ const docLength = codemirrorView.state.doc.length;
263
+ codemirrorView.dispatch({
264
+ changes: { from: 0, to: docLength, insert: "" },
265
+ });
266
+ }
267
+ setInput("");
268
+ };
269
+
256
270
  return (
257
271
  <div
258
272
  className="flex flex-col h-full bg-(--slate-1) rounded-lg shadow border border-(--slate-6) overflow-hidden relative"
@@ -367,6 +381,7 @@ export const Chatbot: React.FC<Props> = (props) => {
367
381
  role: "user",
368
382
  parts: [{ type: "text", text: input }, ...(fileParts ?? [])],
369
383
  });
384
+ resetInput();
370
385
  }}
371
386
  ref={formRef}
372
387
  className="flex w-full border-t border-(--slate-6) px-2 py-1 items-center"
@@ -380,8 +395,8 @@ export const Chatbot: React.FC<Props> = (props) => {
380
395
  onSelect={(prompt) => {
381
396
  setInput(prompt);
382
397
  requestAnimationFrame(() => {
383
- codeMirrorInputRef.current?.view?.focus();
384
- moveToEndOfEditor(codeMirrorInputRef.current?.view);
398
+ codemirrorView?.focus();
399
+ moveToEndOfEditor(codemirrorView);
385
400
  });
386
401
  }}
387
402
  />
@@ -7,7 +7,7 @@ export type ChatRole = "system" | "user" | "assistant";
7
7
  export interface ChatMessage {
8
8
  role: ChatRole;
9
9
  content: string; // TODO: Deprecate content
10
- parts: UIMessage["parts"];
10
+ parts: UIMessage["parts"] | null;
11
11
  }
12
12
 
13
13
  export interface SendMessageRequest {
@@ -63,7 +63,7 @@ type PluginFunctions = {
63
63
  sort?: {
64
64
  by: string;
65
65
  descending: boolean;
66
- };
66
+ }[];
67
67
  query?: string;
68
68
  filters?: ConditionType[];
69
69
  page_number: number;
@@ -117,7 +117,12 @@ export const DataFramePlugin = createPlugin<S>("marimo-dataframe")
117
117
  .input(
118
118
  z.object({
119
119
  sort: z
120
- .object({ by: z.string(), descending: z.boolean() })
120
+ .array(
121
+ z.object({
122
+ by: z.string(),
123
+ descending: z.boolean(),
124
+ }),
125
+ )
121
126
  .optional(),
122
127
  query: z.string().optional(),
123
128
  filters: z.array(ConditionSchema).optional(),
@@ -70,4 +70,21 @@ describe("createParser", () => {
70
70
  Year: "1964",
71
71
  });
72
72
  });
73
+
74
+ it("should handle labels with special characters (brackets, parentheses, spaces)", () => {
75
+ const hovertemplate =
76
+ "Horsepower [ps]=%{x}<br>Miles per Gallon=%{y}<br>Weight (lbs)=%{marker.size}<extra></extra>";
77
+ const parser = createParser(hovertemplate);
78
+ const data = {
79
+ x: "110",
80
+ y: "20.6",
81
+ "marker.size": "3000",
82
+ } as unknown as Plotly.PlotDatum;
83
+ const result = parser.parse(data);
84
+ expect(result).toEqual({
85
+ "Horsepower [ps]": "110",
86
+ "Miles per Gallon": "20.6",
87
+ "Weight (lbs)": "3000",
88
+ });
89
+ });
73
90
  });
@@ -24,7 +24,8 @@ export interface PlotlyTemplateParser {
24
24
  */
25
25
  export function createParser(hovertemplate: string): PlotlyTemplateParser {
26
26
  // Regular expression to match the pattern key=%{selector}
27
- const regex = /(\w+)=%{([^}]+)}/g;
27
+ // Match any characters except = for the key (non-greedy to avoid capturing previous content)
28
+ const regex = /([^=<>]+)=%{([^}]+)}/g;
28
29
 
29
30
  // Create an object to hold the key-selector pairs
30
31
  const keySelectorPairs: Record<string, string> = {};
@@ -0,0 +1,107 @@
1
+ /* Copyright 2024 Marimo. All rights reserved. */
2
+
3
+ import { describe, expect, it } from "vitest";
4
+ import { formatBytes, formatTime } from "../formatting";
5
+
6
+ const locale = "en-US";
7
+
8
+ describe("formatBytes", () => {
9
+ it("should format 0 bytes", () => {
10
+ expect(formatBytes(0, locale)).toBe("0 B");
11
+ expect(formatBytes(-1, locale)).toBe("0 B");
12
+ });
13
+
14
+ it("should format bytes", () => {
15
+ expect(formatBytes(100, locale)).toBe("100 B");
16
+ expect(formatBytes(512, locale)).toBe("512 B");
17
+ expect(formatBytes(1023, locale)).toBe("1,023 B");
18
+ });
19
+
20
+ it("should format kilobytes", () => {
21
+ expect(formatBytes(1024, locale)).toBe("1 KB");
22
+ expect(formatBytes(1536, locale)).toBe("1.5 KB");
23
+ expect(formatBytes(10240, locale)).toBe("10 KB");
24
+ });
25
+
26
+ it("should format megabytes", () => {
27
+ expect(formatBytes(1048576, locale)).toBe("1 MB"); // 1024^2
28
+ expect(formatBytes(1572864, locale)).toBe("1.5 MB"); // 1.5 * 1024^2
29
+ expect(formatBytes(10485760, locale)).toBe("10 MB");
30
+ });
31
+
32
+ it("should format gigabytes", () => {
33
+ expect(formatBytes(1073741824, locale)).toBe("1 GB"); // 1024^3
34
+ expect(formatBytes(1610612736, locale)).toBe("1.5 GB"); // 1.5 * 1024^3
35
+ expect(formatBytes(10737418240, locale)).toBe("10 GB");
36
+ });
37
+
38
+ it("should format terabytes", () => {
39
+ expect(formatBytes(1099511627776, locale)).toBe("1 TB"); // 1024^4
40
+ expect(formatBytes(1649267441664, locale)).toBe("1.5 TB"); // 1.5 * 1024^4
41
+ });
42
+
43
+ it("should respect locale parameter", () => {
44
+ // German locale uses different separators
45
+ const bytes = 1536; // 1.5 KB
46
+ expect(formatBytes(bytes, "de-DE")).toContain("1,5");
47
+ // US locale uses dot
48
+ expect(formatBytes(bytes, "en-US")).toContain("1.5");
49
+ });
50
+ });
51
+
52
+ describe("formatTime", () => {
53
+ it("should format 0 seconds", () => {
54
+ expect(formatTime(0, locale)).toBe("0s");
55
+ });
56
+
57
+ it("should format microseconds", () => {
58
+ expect(formatTime(0.0000001, locale)).toBe("0.1µs");
59
+ expect(formatTime(0.0000005, locale)).toBe("0.5µs");
60
+ expect(formatTime(0.000000999, locale)).toBe("1µs"); // rounded by prettyNumber
61
+ });
62
+
63
+ it("should format milliseconds", () => {
64
+ expect(formatTime(0.001, locale)).toBe("1ms");
65
+ expect(formatTime(0.0015, locale)).toBe("1.5ms");
66
+ expect(formatTime(0.1, locale)).toBe("100ms");
67
+ expect(formatTime(0.5, locale)).toBe("500ms");
68
+ expect(formatTime(0.999, locale)).toBe("999ms");
69
+ });
70
+
71
+ it("should format seconds", () => {
72
+ expect(formatTime(1, locale)).toBe("1s");
73
+ expect(formatTime(1.5, locale)).toBe("1.5s");
74
+ expect(formatTime(30, locale)).toBe("30s");
75
+ expect(formatTime(59.9, locale)).toBe("59.9s");
76
+ });
77
+
78
+ it("should format minutes and seconds", () => {
79
+ expect(formatTime(60, locale)).toBe("1m");
80
+ expect(formatTime(90, locale)).toBe("1m 30s");
81
+ expect(formatTime(150, locale)).toBe("2m 30s");
82
+ expect(formatTime(3540, locale)).toBe("59m");
83
+ expect(formatTime(3599, locale)).toBe("59m 59s");
84
+ });
85
+
86
+ it("should format hours and minutes", () => {
87
+ expect(formatTime(3600, locale)).toBe("1h");
88
+ expect(formatTime(3660, locale)).toBe("1h 1m");
89
+ expect(formatTime(5400, locale)).toBe("1h 30m");
90
+ expect(formatTime(7200, locale)).toBe("2h");
91
+ expect(formatTime(9000, locale)).toBe("2h 30m");
92
+ });
93
+
94
+ it("should respect locale parameter", () => {
95
+ // German locale uses comma for decimal separator
96
+ const time = 1.5;
97
+ expect(formatTime(time, "de-DE")).toContain("1,5");
98
+ // US locale uses dot
99
+ expect(formatTime(time, "en-US")).toContain("1.5");
100
+ });
101
+
102
+ it("should handle edge cases", () => {
103
+ expect(formatTime(0.0009999, locale)).toBe("999.9µs");
104
+ expect(formatTime(59.999, locale)).toBe("60s"); // rounded by prettyNumber
105
+ expect(formatTime(3599.999, locale)).toBe("59m 60s"); // rounded by prettyNumber
106
+ });
107
+ });
@@ -55,6 +55,19 @@ it("can fail to jsonParseWithSpecialChar", () => {
55
55
  expect(jsonParseWithSpecialChar("[nan]")).toMatchInlineSnapshot("{}");
56
56
  });
57
57
 
58
+ it("can parse bigInts", () => {
59
+ const bigint = JSON.stringify({ bigint: { $bigint: "123456" } });
60
+ expect(jsonParseWithSpecialChar(bigint)).toEqual({ bigint: BigInt(123_456) });
61
+
62
+ const arrayOfBigInts = JSON.stringify([{ $bigint: "123456" }]);
63
+ expect(jsonParseWithSpecialChar(arrayOfBigInts)).toEqual([BigInt(123_456)]);
64
+
65
+ const nestedBigInt = JSON.stringify({ bigint: [{ $bigint: "123456" }] });
66
+ expect(jsonParseWithSpecialChar(nestedBigInt)).toEqual({
67
+ bigint: [BigInt(123_456)],
68
+ });
69
+ });
70
+
58
71
  it("can convert json to tsv", () => {
59
72
  expect(jsonToTSV([])).toEqual("");
60
73
 
package/src/utils/copy.ts CHANGED
@@ -9,6 +9,12 @@ import { Logger } from "./Logger";
9
9
  * when running localhost http.
10
10
  */
11
11
  export async function copyToClipboard(text: string) {
12
+ if (navigator.clipboard === undefined) {
13
+ Logger.warn("navigator.clipboard is not supported");
14
+ window.prompt("Copy to clipboard: Ctrl+C, Enter", text);
15
+ return;
16
+ }
17
+
12
18
  await navigator.clipboard.writeText(text).catch(async () => {
13
19
  // Fallback to prompt
14
20
  Logger.warn("Failed to copy to clipboard using navigator.clipboard");
@@ -0,0 +1,51 @@
1
+ /* Copyright 2024 Marimo. All rights reserved. */
2
+
3
+ import { prettyNumber } from "./numbers";
4
+
5
+ /**
6
+ * Format bytes to human-readable format
7
+ * @param bytes - Number of bytes to format
8
+ * @param locale - Optional locale for number formatting
9
+ * @returns Formatted string (e.g., "1.5 MB")
10
+ */
11
+ export function formatBytes(bytes: number, locale: string): string {
12
+ if (bytes === 0 || bytes === -1) {
13
+ return "0 B";
14
+ }
15
+ const k = 1024;
16
+ const sizes = ["B", "KB", "MB", "GB", "TB"];
17
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
18
+ const value = bytes / k ** i;
19
+ return `${prettyNumber(value, locale)} ${sizes[i]}`;
20
+ }
21
+
22
+ /**
23
+ * Format seconds to human-readable time format
24
+ * @param seconds - Number of seconds to format
25
+ * @param locale - Optional locale for number formatting
26
+ * @returns Formatted string (e.g., "1m 30s", "2h 15m", "500ms", "100µs")
27
+ */
28
+ export function formatTime(seconds: number, locale: string): string {
29
+ if (seconds === 0) {
30
+ return "0s";
31
+ }
32
+ if (seconds < 0.001) {
33
+ return `${prettyNumber(seconds * 1_000_000, locale)}µs`;
34
+ }
35
+ if (seconds < 1) {
36
+ return `${prettyNumber(seconds * 1000, locale)}ms`;
37
+ }
38
+ if (seconds < 60) {
39
+ return `${prettyNumber(seconds, locale)}s`;
40
+ }
41
+ const minutes = Math.floor(seconds / 60);
42
+ const secs = seconds % 60;
43
+ if (minutes < 60) {
44
+ return secs > 0
45
+ ? `${minutes}m ${prettyNumber(secs, locale)}s`
46
+ : `${minutes}m`;
47
+ }
48
+ const hours = Math.floor(minutes / 60);
49
+ const remainingMins = minutes % 60;
50
+ return remainingMins > 0 ? `${hours}h ${remainingMins}m` : `${hours}h`;
51
+ }
@@ -2,6 +2,18 @@
2
2
 
3
3
  import type { JsonString } from "./base64";
4
4
 
5
+ declare global {
6
+ interface BigInt {
7
+ toJSON(): unknown;
8
+ }
9
+ }
10
+
11
+ // Treat BigInts as numbers
12
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON#using_json_numbers
13
+ BigInt.prototype.toJSON = function () {
14
+ return JSON.rawJSON(this.toString());
15
+ };
16
+
5
17
  /**
6
18
  * Parse an attribute value as JSON.
7
19
  * This also handles NaN, Infinity, and -Infinity.
@@ -12,7 +24,7 @@ export function jsonParseWithSpecialChar<T = unknown>(
12
24
  // This regex handling is expensive and often not needed.
13
25
  // We try to parse with JSON.parse first, and if that fails, we use the regex.
14
26
  try {
15
- return JSON.parse(value) as T;
27
+ return JSON.parse(value, (_key, value) => sanitizeBigInt(value)) as T;
16
28
  } catch {
17
29
  // Do nothing
18
30
  }
@@ -36,7 +48,7 @@ export function jsonParseWithSpecialChar<T = unknown>(
36
48
  );
37
49
  return JSON.parse(value, (_key, v) => {
38
50
  if (typeof v !== "string") {
39
- return v;
51
+ return sanitizeBigInt(v);
40
52
  }
41
53
  if (v === `${CHAR}NaN${CHAR}`) {
42
54
  return Number.NaN;
@@ -47,7 +59,7 @@ export function jsonParseWithSpecialChar<T = unknown>(
47
59
  if (v === `${CHAR}-Infinity${CHAR}`) {
48
60
  return Number.NEGATIVE_INFINITY;
49
61
  }
50
- return v;
62
+ return sanitizeBigInt(v);
51
63
  }) as T;
52
64
  } catch {
53
65
  return {} as T;
@@ -63,3 +75,16 @@ export function jsonToTSV(json: Record<string, unknown>[]) {
63
75
  const values = json.map((row) => keys.map((key) => row[key]).join("\t"));
64
76
  return `${keys.join("\t")}\n${values.join("\n")}`;
65
77
  }
78
+
79
+ /** Adapted from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt#use_within_json */
80
+ function sanitizeBigInt(value: unknown): unknown {
81
+ if (
82
+ value !== null &&
83
+ typeof value === "object" &&
84
+ "$bigint" in value &&
85
+ typeof value.$bigint === "string"
86
+ ) {
87
+ return BigInt(value.$bigint);
88
+ }
89
+ return value;
90
+ }