@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.
- package/dist/{ConnectedDataExplorerComponent-D96i9G-X.js → ConnectedDataExplorerComponent-DJEUH6Bb.js} +78 -100
- package/dist/{_baseIsEqual-oN7pRNcM.js → _baseIsEqual-CN4oFUZ4.js} +20 -20
- package/dist/{_basePickBy-CYvzhRjy.js → _basePickBy-CzSvE_-f.js} +3 -3
- package/dist/{_baseProperty-DGUdIBuu.js → _baseProperty-DbbUiyUD.js} +5 -5
- package/dist/{_baseUniq-B5gfSl8S.js → _baseUniq-DwoC-LVO.js} +4 -4
- package/dist/any-language-editor-CEXn1vFs.js +156 -0
- package/dist/apl-DuVfHsPc.js +4 -0
- package/dist/architecture-O4VJ6CD3-lp-opOaL.js +21 -0
- package/dist/{architectureDiagram-W76B3OCA-DkEhipkW.js → architectureDiagram-W76B3OCA-CoBORy6u.js} +34 -34
- package/dist/asciiarmor-qIVWsi4F.js +4 -0
- package/dist/asn1-BjPqARr7.js +4 -0
- package/dist/assets/__vite-browser-external-lX-sn9m2.js +1 -0
- package/dist/assets/worker-vPn7gxWj.js +54 -0
- package/dist/{blockDiagram-QIGZ2CNN-DZOqLMYa.js → blockDiagram-QIGZ2CNN-0yzoLIar.js} +75 -86
- package/dist/brainfuck-DPGTVfkE.js +4 -0
- package/dist/{button-CEcjneWG.js → button-DcnBVpVa.js} +11 -14
- package/dist/{c4Diagram-FPNF74CW-DVaR7c9q.js → c4Diagram-FPNF74CW-CKsIA_DD.js} +27 -51
- package/dist/{channel-Uh0KpgGW.js → channel-3LVvQZcD.js} +1 -1
- package/dist/{check-BK9zDfQk.js → check-D7ifz5op.js} +1 -1
- package/dist/{chunk-3AY6CYHV-Dk2R2-S1.js → chunk-3AY6CYHV-B2C-aVc3.js} +35 -35
- package/dist/{chunk-4BX2VUAB-CqO6zUIz.js → chunk-4BX2VUAB-DEd4VI9L.js} +1 -1
- package/dist/{chunk-4KMFLZZN-CloTfTwP.js → chunk-4KMFLZZN-DnvP3O4K.js} +216 -325
- package/dist/{chunk-55IACEB6-I0rmqTua.js → chunk-55IACEB6-BcCzwOOl.js} +1 -1
- package/dist/{chunk-6OXUPJBA-BuROSTmo.js → chunk-6OXUPJBA-eNAAfJ3Q.js} +7 -7
- package/dist/{chunk-7GE3RBXV-B1-tsIPP.js → chunk-7GE3RBXV-CSAeQvLz.js} +1 -1
- package/dist/{chunk-ABZYJK2D-CLlso8tj.js → chunk-ABZYJK2D-CZcb_1iM.js} +16 -20
- package/dist/{chunk-BN7GFLIU-Db2-FjLn.js → chunk-BN7GFLIU-pBc5O5Rh.js} +1 -1
- package/dist/{chunk-CVBHYZKI-BONeiloK.js → chunk-CVBHYZKI-CivHZg9P.js} +3 -3
- package/dist/{chunk-CXMOBAN2-U9GJSP1d.js → chunk-CXMOBAN2-Dd0E6qb0.js} +46 -54
- package/dist/chunk-EXTU4WIE-GQ2ZWfJo.js +10 -0
- package/dist/{chunk-FMBD7UC4-DyV3BR_I.js → chunk-FMBD7UC4-C6YcisV6.js} +1 -1
- package/dist/{chunk-JA3XYJ7Z-C9A1076P.js → chunk-JA3XYJ7Z-DYeQaT57.js} +21 -25
- package/dist/{chunk-JEIROHC2-BGnFkSVq.js → chunk-JEIROHC2-B-EZMP4V.js} +1 -1
- package/dist/{chunk-K7UQS3LO-033LOsjK.js → chunk-K7UQS3LO-DENzlS-M.js} +7 -7
- package/dist/{chunk-KMC2YHZD-DT4Sq4Ld.js → chunk-KMC2YHZD-SckhHdEh.js} +1 -1
- package/dist/{chunk-QN33PNHL-gs44MZla.js → chunk-QN33PNHL-Cjq5b604.js} +2 -2
- package/dist/{chunk-QYVHNE3D-B8BO1AnT.js → chunk-QYVHNE3D-CNUuivie.js} +3 -4
- package/dist/{chunk-QZHKN3VN-CeN_GkU6.js → chunk-QZHKN3VN-DugEU_bA.js} +1 -1
- package/dist/chunk-S3R3BYOJ-itCT6Vif.js +380 -0
- package/dist/{chunk-T44TD3VJ-BwzD6YE0.js → chunk-T44TD3VJ-BLdfTX8J.js} +1 -1
- package/dist/{chunk-TVAH2DTR-Bi6jpQJQ.js → chunk-TVAH2DTR-BOnwF9d8.js} +7 -8
- package/dist/{chunk-TZMSLE5B-D8klz2H_.js → chunk-TZMSLE5B-DGs66AlL.js} +4 -5
- package/dist/{chunk-WFRQ32O7-CzSwSlN0.js → chunk-WFRQ32O7-CPsipkmJ.js} +1 -1
- package/dist/{chunk-WFWHJNB7-DN_cavM6.js → chunk-WFWHJNB7-Cmed18Pk.js} +1 -1
- package/dist/{chunk-XRWGC2XP-Bb5eGNM2.js → chunk-XRWGC2XP-DH5GDaY8.js} +1 -1
- package/dist/{chunk-ZPAFE4SF-S5UYNb0V.js → chunk-ZPAFE4SF-DPDwaqZm.js} +22 -22
- package/dist/classDiagram-KNZD7YFC-azuS_99k.js +39 -0
- package/dist/classDiagram-v2-RKCZMP56-CQpyQQOR.js +39 -0
- package/dist/{click-outside-container-DE4e7p1p.js → click-outside-container-CL_FkgGY.js} +7 -12
- package/dist/{clike-CxAz4p9E.js → clike-DYfRWWXk.js} +1 -1
- package/dist/{clike-Cg_DBrJ0.js → clike-bzZTreP4.js} +1 -1
- package/dist/clojure-ATksAecl.js +4 -0
- package/dist/{clone-Dk4FkKH0.js → clone-Msbhmn2a.js} +1 -1
- package/dist/cmake-CWylaz2C.js +4 -0
- package/dist/cobol-BiLLCZIQ.js +4 -0
- package/dist/coffeescript-Ca4jipi8.js +4 -0
- package/dist/commonlisp-BwFjyEC7.js +4 -0
- package/dist/{constants-Cjd_3kwd.js → constants-BCOEQoEQ.js} +3 -3
- package/dist/{copy-C5RFg7ok.js → copy-BkZ8PkBM.js} +6 -2
- package/dist/{cose-bilkent-S5V4N54A-B3iOTGu5.js → cose-bilkent-S5V4N54A-BZnbwyVD.js} +20 -20
- package/dist/crystal-BhUsQHbh.js +4 -0
- package/dist/css-Cf4wlIyV.js +5 -0
- package/dist/cypher-Dj8Hzgxa.js +4 -0
- package/dist/{cytoscape.esm-DTDV0Nbj.js → cytoscape.esm-BTpRoPd2.js} +586 -661
- package/dist/d-DZI7tbTy.js +4 -0
- package/dist/{dagre-5GWH7T2D-KM4Z11yT.js → dagre-5GWH7T2D-BGaiSZZO.js} +32 -37
- package/dist/{dagre-B0u1urxE.js → dagre-pyfDIOWJ.js} +57 -76
- package/dist/data-grid-overlay-editor-867aBz0Y.js +133 -0
- package/dist/{diagram-N5W7TBWH-CtO7az4G.js → diagram-N5W7TBWH-CzLE0jZB.js} +35 -51
- package/dist/diagram-QEK2KX5R-AGS60xEZ.js +245 -0
- package/dist/{diagram-S2PKOQOG-CiXElLNQ.js → diagram-S2PKOQOG-BxRoG6yW.js} +28 -28
- package/dist/diff-WQISUHG5.js +4 -0
- package/dist/{dist-CdE2C2In.js → dist-2Ne-33Xy.js} +15 -20
- package/dist/{dist-DKFaZRVk.js → dist-B0YD1aXi.js} +2 -2
- package/dist/{dist-DBhzmFyH.js → dist-B1Dv8Sdk.js} +3 -3
- package/dist/{dist-CGIZPq3J.js → dist-BFkr6kAQ.js} +2 -2
- package/dist/{dist-DL_ci7Yc.js → dist-BL2DSY0P.js} +1 -1
- package/dist/dist-BawZu0ix.js +10 -0
- package/dist/{dist-Bar1QnNM.js → dist-BhVFggab.js} +3 -3
- package/dist/{textile-Cy55fYGC.js → dist-BiOF7987.js} +4 -2
- package/dist/{dist-BQmQQqFH.js → dist-BpzZrRd6.js} +1 -1
- package/dist/{dist-CxD5E6Sh.js → dist-C7zhQ7K0.js} +24 -22
- package/dist/{dist-BqgkUnEN.js → dist-CBhnQKQ4.js} +3 -3
- package/dist/{dist-Dzk1C8l5.js → dist-CId4IPXu.js} +10 -13
- package/dist/{dist-CUnh_3Ii.js → dist-CYhQCVru.js} +2 -2
- package/dist/{dist-BBlFk9ki.js → dist-CZq5-ZyD.js} +1 -1
- package/dist/{dist-elblfNXO.js → dist-Cacac5HV.js} +2 -2
- package/dist/{dist-CChOkSUg.js → dist-CfQHSIQC.js} +3 -3
- package/dist/{dist-JCAky9ND.js → dist-CkvGMBAS.js} +17 -22
- package/dist/dist-Cs3McXEj.js +6 -0
- package/dist/{dist-o7fhJC7U.js → dist-CvyfRaIr.js} +3 -3
- package/dist/{dist-CZfRM7pE.js → dist-D-3fICwh.js} +2 -2
- package/dist/dist-D3aaithT.js +6 -0
- package/dist/{dist-CutXTm8t.js → dist-DBhEu3-F.js} +1 -1
- package/dist/dist-DELcMSpJ.js +6 -0
- package/dist/{dist-C7ASiFxI.js → dist-DMxl6Qbu.js} +273 -263
- package/dist/{dist-CLvpViod.js → dist-DS6nuHYK.js} +2 -3
- package/dist/dist-Dgts3WXd.js +6 -0
- package/dist/{dist--I6Htnlv.js → dist-DlHkZUnY.js} +5 -5
- package/dist/dist-Doiq_KIP.js +15 -0
- package/dist/dist-DtpUiDG_.js +6 -0
- package/dist/{dist-DzOpMdwb.js → dist-NUdHX0XE.js} +4 -4
- package/dist/{dist-C3WYsf4K.js → dist-PGgOcwbF.js} +4 -10
- package/dist/{dist-DNnYAdRE.js → dist-RdxOJbBw.js} +2 -2
- package/dist/{dist-BEvIw5Nh.js → dist-RwqAqkpG.js} +1 -1
- package/dist/dist-ZjnJq_jD.js +10 -0
- package/dist/{dist-CbRkrKrP.js → dist-biZ846D9.js} +5 -5
- package/dist/{dist-DW9er3Zq.js → dist-d5NxvX2s.js} +44 -23
- package/dist/{dist-C3QUag__.js → dist-ivwkJchV.js} +3 -3
- package/dist/dist-mof3iuBu.js +12 -0
- package/dist/{dist-Cib4sGDA.js → dist-reo2kYlN.js} +2 -2
- package/dist/{dist-BZBitvuL.js → dist-wHVprCkn.js} +1 -1
- package/dist/{dist-C5zMs_n5.js → dist-y8uoXYaE.js} +3 -3
- package/dist/{dist-DPF5TTUg.js → dist-z_iuDES7.js} +126 -115
- package/dist/{dockerfile-Dum_1b-5.js → dockerfile-sZMPcXVY.js} +1 -1
- package/dist/dtd-B2M8dhfC.js +4 -0
- package/dist/dylan-CU3Vt8SC.js +4 -0
- package/dist/ecl-B8ESAVq4.js +4 -0
- package/dist/eiffel-DDfMIKeA.js +4 -0
- package/dist/elm-Bj6rj8jf.js +4 -0
- package/dist/{erDiagram-AWTI2OKA-ZTIl9iQO.js → erDiagram-AWTI2OKA-CTxzb-U8.js} +20 -20
- package/dist/erlang-BxyshZUq.js +4 -0
- package/dist/{error-banner-OQIGTqFR.js → error-banner-npbEfanI.js} +13 -13
- package/dist/{esm-DxFkg7a6.js → esm-BdiY4QsX.js} +1528 -1492
- package/dist/{esm-d0g2RsOH.js → esm-CAWW9sum.js} +6 -8
- package/dist/{esm-1_Mp6VD2.js → esm-YY5zh7KV.js} +324 -395
- package/dist/{esm-BO9n_s6u.js → esm-svAVli9f.js} +5 -5
- package/dist/{factor-CdgiDGiu.js → factor-CRFTmP_a.js} +1 -1
- package/dist/factor-CYk6XT8r.js +5 -0
- package/dist/{flowDiagram-PVAE7QVJ-DsbofOzu.js → flowDiagram-PVAE7QVJ-Dck2hiJe.js} +22 -22
- package/dist/{formats-ChrNdVdJ.js → formats-BnqXUb1V.js} +13 -17
- package/dist/forth-fcoJkd-f.js +4 -0
- package/dist/fortran-IxZHu4wc.js +4 -0
- package/dist/{fullscreen-D1yTiBlu.js → fullscreen-blsKUrtN.js} +741 -744
- package/dist/{ganttDiagram-OWAHRB6G-FnCH1Yj3.js → ganttDiagram-OWAHRB6G-AWzfzpup.js} +9 -9
- package/dist/gas-B8rmKcim.js +4 -0
- package/dist/gherkin-BTm-jIdJ.js +4 -0
- package/dist/gitGraph-ZV4HHKMB-DFg_OLQb.js +21 -0
- package/dist/{gitGraphDiagram-NY62KEGX-B0wvMNqU.js → gitGraphDiagram-NY62KEGX-GyNboWSV.js} +31 -34
- package/dist/{glide-data-editor-D_kEsT07.js → glide-data-editor-DHuN8kQ8.js} +1650 -1720
- package/dist/{graphlib-BGmr7CYF.js → graphlib-hb3zmtVD.js} +5 -5
- package/dist/groovy-01kRHFMD.js +4 -0
- package/dist/haskell-B3PhE05w.js +4 -0
- package/dist/haxe-DEoAm8oA.js +5 -0
- package/dist/{hotkeys-yFrUwyJK.js → hotkeys-Ct2T3e9O.js} +4 -7
- package/dist/idl-DsDJU9cV.js +4 -0
- package/dist/info-63CPKGFF-D3DZmDBa.js +21 -0
- package/dist/infoDiagram-STP46IZ2-ec08vi_U.js +44 -0
- package/dist/{isArrayLikeObject-DiDsNamC.js → isArrayLikeObject-BlvK28do.js} +3 -5
- package/dist/{isEmpty-BBG-u1GM.js → isEmpty--odfYjh1.js} +2 -2
- package/dist/{isSymbol-BxF-_8BA.js → isSymbol-Cb1f2HgO.js} +1 -1
- package/dist/{javascript-Dfq1qI35.js → javascript-BfCTmOnk.js} +2 -2
- package/dist/javascript-gwczVhuU.js +5 -0
- package/dist/jinja2-AkZRdFk3.js +4 -0
- package/dist/{journeyDiagram-BIP6EPQ6-B3PotfAW.js → journeyDiagram-BIP6EPQ6-TmXYCUbT.js} +23 -24
- package/dist/julia-_s6qe3bf.js +4 -0
- package/dist/{kanban-definition-6OIFK2YF-BTrQZ3LN.js → kanban-definition-6OIFK2YF-B6ozleHo.js} +15 -15
- package/dist/{katex-dN__NFdn.js → katex-mPzRsXEy.js} +1 -1
- package/dist/{katex-BE4xflfm.js → katex-mkWmhPUh.js} +149 -173
- package/dist/{label-BinTsX-u.js → label-VVRKZmrP.js} +21 -24
- package/dist/{linear-DyTdUIqX.js → linear-iebAbJVD.js} +1 -1
- package/dist/livescript-CwPHQdv5.js +4 -0
- package/dist/{loader-Dijti3y4.js → loader-CM0VALo9.js} +19 -26
- package/dist/lua-s7nRxkCP.js +4 -0
- package/dist/main.js +8161 -8431
- package/dist/{marked.esm-3RjvXPoO.js → marked.esm-DJM8la36.js} +5 -5
- package/dist/mathematica-Ci36yd1q.js +4 -0
- package/dist/mbox-DbOYMNCO.js +4 -0
- package/dist/{memoize-Dq87l1O_.js → memoize-DYoRBSLn.js} +1 -1
- package/dist/{merge-BPDCIm8P.js → merge-BjuR6j_w.js} +1 -1
- package/dist/{mermaid-MWiyXDcI.js → mermaid-YPPMBmhk.js} +58 -76
- package/dist/{mermaid-parser.core-CSFx6MQ7.js → mermaid-parser.core-BLkyTSZj.js} +8 -8
- package/dist/{mhchem-DZ68WS0G.js → mhchem-Dw7wvXtr.js} +1 -1
- package/dist/{min-BzhKOmZo.js → min-B_i2ahn4.js} +7 -7
- package/dist/{mindmap-definition-Q6HEUPPD-9hhnrO1k.js → mindmap-definition-Q6HEUPPD-F6-JnXwq.js} +17 -17
- package/dist/mirc-VmNe8AwF.js +4 -0
- package/dist/mllike-BdD7SJEa.js +6 -0
- package/dist/modelica-BA4VqzC3.js +4 -0
- package/dist/mscgen-DF-5WHJm.js +6 -0
- package/dist/mumps-c_Uia_QN.js +4 -0
- package/dist/{node-sql-parser-13oju30e.js → node-sql-parser-BqKV-TpL.js} +14343 -14351
- package/dist/{now-DVBcRCoE.js → now-CwRqw0nS.js} +1 -1
- package/dist/nsis-BAANGODV.js +5 -0
- package/dist/{nsis-BW6_XagK.js → nsis-BWJEeUyS.js} +1 -1
- package/dist/ntriples-Bslqh2Ki.js +4 -0
- package/dist/{number-overlay-editor-D1YdiOrm.js → number-overlay-editor-CeyruAX4.js} +17 -23
- package/dist/octave-DYn5ltia.js +4 -0
- package/dist/oz-B_N-StZq.js +4 -0
- package/dist/packet-HUATNLJX-CkqjFdAv.js +21 -0
- package/dist/pascal-DU4CtAUu.js +4 -0
- package/dist/perl-Bae6k32u.js +4 -0
- package/dist/pie-WTHONI2E-D0rWwX5P.js +21 -0
- package/dist/{pieDiagram-ADFJNKIX-CSBC0ZgF.js → pieDiagram-ADFJNKIX-C5dSQVCn.js} +28 -28
- package/dist/pig-DSIxUEgX.js +4 -0
- package/dist/powershell-31lcPgIF.js +4 -0
- package/dist/powershell-BZx53Ujw.js +236 -0
- package/dist/properties-lmYbntDG.js +4 -0
- package/dist/protobuf-BTYoCEpV.js +4 -0
- package/dist/pug-DMFM7zzO.js +5 -0
- package/dist/{pug-Bmups_z0.js → pug-PJh82u1M.js} +1 -1
- package/dist/puppet-B0ub07d-.js +4 -0
- package/dist/python-C4jT87Nt.js +5 -0
- package/dist/{q-BzWcnVri.js → q-CMoUHJ5Q.js} +3 -2
- package/dist/q-YbPYlqRI.js +4 -0
- package/dist/{quadrantDiagram-LMRXKWRM-h7nHf8xG.js → quadrantDiagram-LMRXKWRM-DlahxNiy.js} +7 -7
- package/dist/r-OfNu6HAI.js +4 -0
- package/dist/radar-NJJJXTRR-Bxqv4O5a.js +21 -0
- package/dist/{range-CgK0-PEw.js → range-DxfkexCE.js} +3 -3
- package/dist/{react-plotly-BZakcxdv.js → react-plotly-D_IAfR8f.js} +4364 -4705
- package/dist/{requirementDiagram-4UW4RH46-BGEurQYq.js → requirementDiagram-4UW4RH46-DTkinyvU.js} +17 -17
- package/dist/rpm-D_3b5peD.js +5 -0
- package/dist/ruby-CehsJy_T.js +4 -0
- package/dist/{sankeyDiagram-GR3RE2ED-CxeJ_jfl.js → sankeyDiagram-GR3RE2ED-CsLnEnnq.js} +3 -3
- package/dist/sas-DwQHzPoF.js +4 -0
- package/dist/scheme-B6ArxiQu.js +4 -0
- package/dist/{sequenceDiagram-C3RYC4MD-CbFxwyr_.js → sequenceDiagram-C3RYC4MD-BdEOR6SC.js} +20 -30
- package/dist/shell-AHmQgDfc.js +4 -0
- package/dist/sieve-CgodKOcx.js +4 -0
- package/dist/{simple-mode-Cgyya8F-.js → simple-mode-BP3Jd4vf.js} +1 -1
- package/dist/{slides-component-BEyG25AH.js → slides-component-2bbal1YJ.js} +24 -46
- package/dist/smalltalk-BeFzDkbo.js +4 -0
- package/dist/sparql-BWxq-Lnx.js +4 -0
- package/dist/{src-BNNJRxz3.js → src-DZkaBUmt.js} +6 -6
- package/dist/{stateDiagram-KXAO66HF-A61bMf29.js → stateDiagram-KXAO66HF-DQLH2jhP.js} +39 -41
- package/dist/stateDiagram-v2-UMBNRL4Z-D9v8fKjF.js +38 -0
- package/dist/stex-Dvaq0qsm.js +5 -0
- package/dist/style.css +1 -1
- package/dist/stylus-Ge0ofWlZ.js +4 -0
- package/dist/swift-CjQfbVxV.js +4 -0
- package/dist/tcl-CAGDF11K.js +4 -0
- package/dist/textile-CrXreJtf.js +4 -0
- package/dist/{time-D3tzCqJ6.js → time-CFkXkVrt.js} +1 -1
- package/dist/{timeline-definition-XQNQX7LJ-BwdsB7CR.js → timeline-definition-XQNQX7LJ-bToVq14i.js} +4 -5
- package/dist/{timer-D3Zlu9ow.js → timer-CzOhIJuk.js} +2 -2
- package/dist/{toNumber-efKT08hh.js → toNumber-EFF1Z9T1.js} +2 -2
- package/dist/{toString-BvCd3yJc.js → toString-C2mCkasT.js} +2 -2
- package/dist/toml-AdLXKwEi.js +4 -0
- package/dist/{toml-CIUkU1CP.js → toml-eSl4PUAH.js} +6 -2
- package/dist/treemap-75Q7IDZK-Da9Jv6a_.js +21 -0
- package/dist/troff-C-LaM2ex.js +4 -0
- package/dist/ttcn-DTclUi6T.js +4 -0
- package/dist/ttcn-cfg-BtBPbmLX.js +4 -0
- package/dist/turtle-BODDDg5O.js +4 -0
- package/dist/{types-1X1uZB4y.js → types-CRXV0KD5.js} +84 -95
- package/dist/{useAsyncData-C4IqQK0g.js → useAsyncData-uMVTsDI9.js} +1 -1
- package/dist/{useDateFormatter-BCsBqetx.js → useDateFormatter-Dcz7jstn.js} +6 -6
- package/dist/{useTheme-C2pgJzDH.js → useTheme-NbEx-ZNV.js} +13 -10
- package/dist/vb-Cb1HQHii.js +4 -0
- package/dist/vbscript-CpXOP4wZ.js +4 -0
- package/dist/{vega-component-Cv4J8CHz.js → vega-component-hegVmfuS.js} +21 -21
- package/dist/{vega-loader.browser.module-Bi3ttvdj.js → vega-loader.browser.module-DcW8jnKp.js} +1 -2
- package/dist/velocity-Dz0rBQIk.js +4 -0
- package/dist/verilog-6Di9aLKw.js +4 -0
- package/dist/vhdl-BRNesXYc.js +4 -0
- package/dist/webidl-BpRNYIYn.js +4 -0
- package/dist/xquery-DXWcJ7b6.js +4 -0
- package/dist/{xychartDiagram-6GGTOJPD-BJRRi5HC.js → xychartDiagram-6GGTOJPD-C7Bhm_yt.js} +12 -13
- package/dist/yacas-DbSARPz4.js +4 -0
- package/dist/z80-DzslPj_l.js +4 -0
- package/dist/{zod-UPQf9SGn.js → zod-ChY6miG5.js} +71 -81
- package/package.json +12 -12
- package/src/__mocks__/requests.ts +2 -0
- package/src/components/app-config/user-config-form.tsx +29 -25
- package/src/components/chat/chat-utils.ts +11 -4
- package/src/components/data-table/__tests__/header-items.test.tsx +117 -0
- package/src/components/data-table/column-header.tsx +4 -2
- package/src/components/data-table/columns.tsx +2 -1
- package/src/components/data-table/data-table.tsx +7 -2
- package/src/components/data-table/header-items.tsx +63 -10
- package/src/components/dependency-graph/custom-node.tsx +11 -11
- package/src/components/dependency-graph/elements.ts +9 -4
- package/src/components/dependency-graph/panels.tsx +6 -4
- package/src/components/editor/Output.tsx +6 -1
- package/src/components/editor/ai/ai-completion-editor.tsx +135 -5
- package/src/components/editor/ai/completion-handlers.tsx +106 -22
- package/src/components/editor/cell/code/cell-editor.tsx +5 -0
- package/src/components/editor/chrome/panels/cache-panel.tsx +216 -0
- package/src/components/editor/chrome/panels/empty-state.tsx +3 -1
- package/src/components/editor/chrome/types.ts +66 -22
- package/src/components/editor/chrome/wrapper/app-chrome.tsx +2 -0
- package/src/components/editor/errors/auto-fix.tsx +138 -32
- package/src/components/editor/errors/fix-mode.ts +15 -0
- package/src/components/editor/navigation/__tests__/clipboard.test.ts +0 -5
- package/src/components/editor/navigation/clipboard.ts +2 -1
- package/src/components/editor/notebook-cell.tsx +20 -7
- package/src/components/editor/output/ConsoleOutput.tsx +27 -33
- package/src/components/editor/output/JsonOutput.tsx +9 -0
- package/src/components/editor/output/MarimoTracebackOutput.tsx +10 -7
- package/src/components/editor/output/__tests__/json-output.test.ts +43 -0
- package/src/components/editor/package-alert.tsx +3 -0
- package/src/components/forms/__tests__/form-utils.test.ts +4 -2
- package/src/components/icons/copy-icon.tsx +11 -5
- package/src/components/shortcuts/renderShortcut.tsx +3 -1
- package/src/components/ui/button.tsx +2 -0
- package/src/components/ui/confirmation-button.tsx +85 -0
- package/src/components/ui/switch.tsx +2 -0
- package/src/core/ai/context/providers/__tests__/datasource.test.ts +9 -1
- package/src/core/ai/context/providers/datasource.ts +25 -1
- package/src/core/ai/state.ts +6 -3
- package/src/core/ai/tools/__tests__/registry.test.ts +33 -8
- package/src/core/ai/tools/base.ts +81 -1
- package/src/core/ai/tools/registry.ts +36 -10
- package/src/core/ai/tools/sample-tool.ts +44 -8
- package/src/core/cache/requests.ts +5 -0
- package/src/core/cells/cells.ts +1 -1
- package/src/core/codemirror/__tests__/__snapshots__/setup.test.ts.snap +2 -0
- package/src/core/codemirror/__tests__/replace-editor-content.test.ts +336 -0
- package/src/core/codemirror/find-replace/navigate.ts +2 -2
- package/src/core/codemirror/format.ts +2 -9
- package/src/core/codemirror/language/__tests__/sql.test.ts +24 -6
- package/src/core/codemirror/language/languages/python.ts +1 -3
- package/src/core/codemirror/language/languages/sql/sql.ts +23 -13
- package/src/core/codemirror/language/panel/panel.tsx +1 -6
- package/src/core/codemirror/language/utils.ts +3 -8
- package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +21 -14
- package/src/core/codemirror/lsp/federated-lsp.ts +20 -9
- package/src/core/codemirror/lsp/notebook-lsp.ts +35 -29
- package/src/core/codemirror/lsp/types.ts +0 -13
- package/src/core/codemirror/replace-editor-content.ts +87 -0
- package/src/core/config/__tests__/config-schema.test.ts +3 -0
- package/src/core/config/config-schema.ts +8 -0
- package/src/core/config/feature-flag.tsx +2 -4
- package/src/core/errors/__tests__/errors.test.ts +1 -0
- package/src/core/errors/errors.ts +20 -6
- package/src/core/islands/bridge.ts +2 -0
- package/src/core/islands/main.ts +4 -0
- package/src/core/kernel/messages.ts +1 -0
- package/src/core/network/requests-network.ts +14 -0
- package/src/core/network/requests-static.ts +2 -0
- package/src/core/network/requests-toasting.ts +2 -0
- package/src/core/network/types.ts +5 -0
- package/src/core/saving/save-component.tsx +43 -36
- package/src/core/wasm/bridge.ts +2 -0
- package/src/core/websocket/useMarimoWebSocket.tsx +8 -0
- package/src/css/app/codemirror-completions.css +1 -1
- package/src/custom.d.ts +2 -0
- package/src/plugins/core/registerReactComponent.tsx +5 -1
- package/src/plugins/impl/DataTablePlugin.tsx +19 -19
- package/src/plugins/impl/__tests__/DateTimePickerPlugin.test.tsx +32 -0
- package/src/plugins/impl/chat/ChatPlugin.tsx +1 -1
- package/src/plugins/impl/chat/chat-ui.tsx +17 -2
- package/src/plugins/impl/chat/types.ts +1 -1
- package/src/plugins/impl/data-frames/DataFramePlugin.tsx +7 -2
- package/src/plugins/impl/plotly/__tests__/parse-from-template.test.ts +17 -0
- package/src/plugins/impl/plotly/parse-from-template.ts +2 -1
- package/src/utils/__tests__/formatting.test.ts +107 -0
- package/src/utils/__tests__/json-parser.test.ts +13 -0
- package/src/utils/copy.ts +6 -0
- package/src/utils/formatting.ts +51 -0
- package/src/utils/json/json-parser.ts +28 -3
- package/dist/any-language-editor-CVFQlioK.js +0 -156
- package/dist/apl-ChlaBfxB.js +0 -4
- package/dist/architecture-O4VJ6CD3-BVeaxUcM.js +0 -21
- package/dist/asciiarmor-CcJmm3l_.js +0 -4
- package/dist/asn1-ThRYxoBE.js +0 -4
- package/dist/assets/__vite-browser-external-Dv_SHu1h.js +0 -1
- package/dist/assets/worker-DVOR9oZG.js +0 -54
- package/dist/brainfuck-CEM0JgDn.js +0 -4
- package/dist/chunk-EXTU4WIE-DECT9AAK.js +0 -14
- package/dist/chunk-S3R3BYOJ-DMQ1yeyq.js +0 -386
- package/dist/classDiagram-KNZD7YFC-BG53O6Jt.js +0 -39
- package/dist/classDiagram-v2-RKCZMP56-BmKILsGU.js +0 -39
- package/dist/clojure-B7RHyE9t.js +0 -4
- package/dist/cmake-TeTMP4I5.js +0 -4
- package/dist/cobol-DI-mxUER.js +0 -4
- package/dist/coffeescript-DHUFLqWp.js +0 -4
- package/dist/commonlisp-SLiUrh1m.js +0 -4
- package/dist/crystal-B4fY1ZfJ.js +0 -4
- package/dist/css-Bdoq3TzK.js +0 -5
- package/dist/cypher-CBU182fp.js +0 -4
- package/dist/d-D8myDZeH.js +0 -4
- package/dist/data-grid-overlay-editor-qNmJk2x0.js +0 -135
- package/dist/diagram-QEK2KX5R-fu8Noi3H.js +0 -245
- package/dist/diff-DJF_UB7H.js +0 -4
- package/dist/dist-52-_pKoy.js +0 -6
- package/dist/dist-6DOMStFn.js +0 -6
- package/dist/dist-B334aW7p.js +0 -10
- package/dist/dist-BOI9lUz-.js +0 -12
- package/dist/dist-C06uhBzF.js +0 -6
- package/dist/dist-CGkpguCB.js +0 -6
- package/dist/dist-CrApzUED.js +0 -6
- package/dist/dist-Dp2GLdCl.js +0 -14
- package/dist/dist-WHFsbMDr.js +0 -6
- package/dist/dist-hyKcTPG9.js +0 -10
- package/dist/dtd-DY8q65lC.js +0 -4
- package/dist/dylan-CBLcjWCi.js +0 -4
- package/dist/ecl-BSXPNfOw.js +0 -4
- package/dist/eiffel-BJf0PQX-.js +0 -4
- package/dist/elm-DWQwPCZS.js +0 -4
- package/dist/erlang-BWBaGZ5e.js +0 -4
- package/dist/factor-DT1-MBPl.js +0 -5
- package/dist/forth-D9GDt3FB.js +0 -4
- package/dist/fortran-DHkRhDWw.js +0 -4
- package/dist/gas-7lQEOM0H.js +0 -4
- package/dist/gherkin-BLLyroYi.js +0 -4
- package/dist/gitGraph-ZV4HHKMB-z2v_cInC.js +0 -21
- package/dist/groovy-C-wabwj0.js +0 -4
- package/dist/haskell-DaxVQ_d1.js +0 -4
- package/dist/haxe-C2yLoC7h.js +0 -5
- package/dist/idl-DQBP8i7k.js +0 -4
- package/dist/info-63CPKGFF-GS4w6pCB.js +0 -21
- package/dist/infoDiagram-STP46IZ2-DE9YYPFg.js +0 -44
- package/dist/javascript-DRwFV9r5.js +0 -5
- package/dist/jinja2-CNoIpVmN.js +0 -4
- package/dist/julia-DXDf-GhP.js +0 -4
- package/dist/livescript-S2uhJQx7.js +0 -4
- package/dist/lua-Bvgs0y2G.js +0 -4
- package/dist/mathematica-D2zqfwIg.js +0 -4
- package/dist/mbox-SBcPaDuZ.js +0 -4
- package/dist/mirc-hkQc7sVF.js +0 -4
- package/dist/mllike-DRWPBlr9.js +0 -6
- package/dist/modelica-CO2ROGlP.js +0 -4
- package/dist/mscgen-BpX61bO6.js +0 -6
- package/dist/mumps-BCnFeIn6.js +0 -4
- package/dist/nsis-BaTOxlD1.js +0 -5
- package/dist/ntriples-zEo5BWjr.js +0 -4
- package/dist/octave-BE0RnCM9.js +0 -4
- package/dist/oz-C4_2Ttul.js +0 -4
- package/dist/packet-HUATNLJX-CjHqJIqk.js +0 -21
- package/dist/pascal-Q3jJucpw.js +0 -4
- package/dist/perl-DkXZIWHF.js +0 -4
- package/dist/pie-WTHONI2E-D67gLWtR.js +0 -21
- package/dist/pig-DCgEHdsu.js +0 -4
- package/dist/powershell-3rK_nRRJ.js +0 -236
- package/dist/powershell-Eo2-7MoM.js +0 -4
- package/dist/properties-C0IOX8WR.js +0 -4
- package/dist/protobuf--lGQUSRO.js +0 -4
- package/dist/pug-Cf8AQHMJ.js +0 -5
- package/dist/puppet-D7Z3dTJn.js +0 -4
- package/dist/python-FHIx_i8Y.js +0 -5
- package/dist/q-B7UA1feM.js +0 -4
- package/dist/r-Cc9R2A7N.js +0 -4
- package/dist/radar-NJJJXTRR-C-AZP_Te.js +0 -21
- package/dist/rpm-vhJNlrQ6.js +0 -5
- package/dist/ruby-CVluPY0M.js +0 -4
- package/dist/sas-A8DL8oy3.js +0 -4
- package/dist/scheme-6xHHcSXC.js +0 -4
- package/dist/shell-DHN-e5rf.js +0 -4
- package/dist/sieve-BuQwLY02.js +0 -4
- package/dist/smalltalk-BA4HPg2H.js +0 -4
- package/dist/sparql-Bf4yCuy3.js +0 -4
- package/dist/stateDiagram-v2-UMBNRL4Z-C_0FUzzk.js +0 -38
- package/dist/stex-D-I1cYeE.js +0 -5
- package/dist/stylus-BMeped2l.js +0 -4
- package/dist/swift-lwEdlZoC.js +0 -4
- package/dist/tcl-B03ipeqv.js +0 -4
- package/dist/toml-BLgrVtfu.js +0 -4
- package/dist/treemap-75Q7IDZK-DTvwfpWt.js +0 -21
- package/dist/troff-g6EjN2O2.js +0 -4
- package/dist/ttcn-Dzvba8jK.js +0 -4
- package/dist/ttcn-cfg-CadG0p1K.js +0 -4
- package/dist/turtle-DkXAMWo9.js +0 -4
- package/dist/vb-C5dCiel8.js +0 -4
- package/dist/vbscript-I4bDEQln.js +0 -4
- package/dist/velocity-mt0fDwFH.js +0 -4
- package/dist/verilog-Dxq3KJkc.js +0 -4
- package/dist/vhdl-Km0QUlV-.js +0 -4
- package/dist/webidl-B3lJ2MRL.js +0 -4
- package/dist/xquery-CcIxNPEe.js +0 -4
- package/dist/yacas-oMa-f-tN.js +0 -4
- package/dist/z80-D03Nvn6l.js +0 -4
- /package/dist/{apl-DZqo8Elt.js → apl-CEHentF4.js} +0 -0
- /package/dist/{asciiarmor-DTzHAIeX.js → asciiarmor-DURYiCS0.js} +0 -0
- /package/dist/{asn1-DrAXKsZH.js → asn1-ETAiEoXY.js} +0 -0
- /package/dist/{asterisk-oF4U3h48.js → asterisk-DTpbbXPb.js} +0 -0
- /package/dist/{brainfuck-BYgLey30.js → brainfuck-BWQep-SA.js} +0 -0
- /package/dist/{clojure-Bs2M3OUY.js → clojure-BzFapDkA.js} +0 -0
- /package/dist/{cmake-DpI8vxJN.js → cmake-DvlbIC8x.js} +0 -0
- /package/dist/{cobol-BQyrWo72.js → cobol-BrEI4cPR.js} +0 -0
- /package/dist/{coffeescript-9ke9UHmw.js → coffeescript-B6cvu8mO.js} +0 -0
- /package/dist/{common-keywords-BzgeAvH1.js → common-keywords-WqQm7W8t.js} +0 -0
- /package/dist/{commonlisp-DghUdrUH.js → commonlisp-BIT8PQqi.js} +0 -0
- /package/dist/{crystal-DEf_SInh.js → crystal-B_UcPArT.js} +0 -0
- /package/dist/{css-BzTU9lNO.js → css-dHbnt_zl.js} +0 -0
- /package/dist/{cypher-a2v0c11S.js → cypher-Dh3FOpL7.js} +0 -0
- /package/dist/{d-SAswny-M.js → d-CQD1IHee.js} +0 -0
- /package/dist/{diff-OJ-xLXcG.js → diff-CpF_IDx0.js} +0 -0
- /package/dist/{dtd-BsUf-rer.js → dtd-DYoNpy6c.js} +0 -0
- /package/dist/{duckdb-keywords-B0NOra5o.js → duckdb-keywords-CdIsl9L0.js} +0 -0
- /package/dist/{dylan-C0ZYngjn.js → dylan-Bc_2G1E-.js} +0 -0
- /package/dist/{ebnf-DF1xx0b_.js → ebnf-jGVT_YpN.js} +0 -0
- /package/dist/{ecl-Bsuvoouq.js → ecl-UIU-P-Ar.js} +0 -0
- /package/dist/{eiffel-DgfSpLi-.js → eiffel-C90Oyuix.js} +0 -0
- /package/dist/{elm-GNxDj-5E.js → elm-B9fWSySj.js} +0 -0
- /package/dist/{erlang-Ds3uY1kL.js → erlang-Ccff0UAn.js} +0 -0
- /package/dist/{fcl-CqBgSioc.js → fcl-CGR8NxAg.js} +0 -0
- /package/dist/{forth-JCaLysGk.js → forth-U1ROGcBY.js} +0 -0
- /package/dist/{fortran-Dc2AoKAl.js → fortran-3nOkjDmc.js} +0 -0
- /package/dist/{gas-Q4Uz82YW.js → gas-B_4H5FzV.js} +0 -0
- /package/dist/{gherkin-Dpxe49sQ.js → gherkin-B0eru5Uz.js} +0 -0
- /package/dist/{groovy-D8mTRCu6.js → groovy-dqjtZUVf.js} +0 -0
- /package/dist/{haskell-2_8cC4wY.js → haskell-DFzCCQzo.js} +0 -0
- /package/dist/{haxe-Bl9zkZlz.js → haxe-Da8Pj5RT.js} +0 -0
- /package/dist/{http-DKCqY6yS.js → http-1HACL_9s.js} +0 -0
- /package/dist/{idl-Dn-HNfGW.js → idl-D3NXs5iM.js} +0 -0
- /package/dist/{jinja2-JjFiAGKk.js → jinja2-gBHAxUdF.js} +0 -0
- /package/dist/{julia-R5wne8eu.js → julia-bG-6nJ-_.js} +0 -0
- /package/dist/{livescript-DSwokrYj.js → livescript-BlsRC8UJ.js} +0 -0
- /package/dist/{lua-CgXfrp2-.js → lua-BbDC0_5w.js} +0 -0
- /package/dist/{mathematica-BVli92MR.js → mathematica-YZTe3-PF.js} +0 -0
- /package/dist/{mbox-CMFlocdS.js → mbox-CY5idp08.js} +0 -0
- /package/dist/{mirc-BkW04Zpc.js → mirc-CbQuFZKk.js} +0 -0
- /package/dist/{mllike-DEjvHvNV.js → mllike-DsbHMX-5.js} +0 -0
- /package/dist/{modelica-CxDn-oje.js → modelica-CQuvsOQk.js} +0 -0
- /package/dist/{mscgen-D78wmE-w.js → mscgen-LIpBP9VR.js} +0 -0
- /package/dist/{mumps-Bi0IvPOV.js → mumps-Ct5NXoaG.js} +0 -0
- /package/dist/{nginx-DErPZFhX.js → nginx-Dvc62C8z.js} +0 -0
- /package/dist/{ntriples-Btyp6wRL.js → ntriples-jVkxWUuv.js} +0 -0
- /package/dist/{octave-CZA6-2F8.js → octave-jGOImUB0.js} +0 -0
- /package/dist/{oz-Bm6LSNfE.js → oz-Y0FKDMS2.js} +0 -0
- /package/dist/{pascal-B4J6a9BH.js → pascal-BaLtPWWB.js} +0 -0
- /package/dist/{perl-CzVqxS08.js → perl-CjfE0JLo.js} +0 -0
- /package/dist/{pig-Clh03cnn.js → pig-DE4epV99.js} +0 -0
- /package/dist/{properties-D7ch1Wyb.js → properties-CLyCG5C-.js} +0 -0
- /package/dist/{protobuf-DrkdrMPK.js → protobuf-BjBBs_V4.js} +0 -0
- /package/dist/{puppet-BtZG8zdO.js → puppet-ZImLuomA.js} +0 -0
- /package/dist/{python-B6FKOVIv.js → python-C9YN71pR.js} +0 -0
- /package/dist/{r-Dnvo5-96.js → r-DILmKWWW.js} +0 -0
- /package/dist/{rpm-B1DrgfnX.js → rpm-fpIsm1Kr.js} +0 -0
- /package/dist/{ruby-CelfUg17.js → ruby-BuiQI41h.js} +0 -0
- /package/dist/{sas-DfSQFMWG.js → sas-C76sJ1zF.js} +0 -0
- /package/dist/{scheme-BplhaWuO.js → scheme-DHjM-txv.js} +0 -0
- /package/dist/{shell-DqU5OS2c.js → shell--7NmGJ9p.js} +0 -0
- /package/dist/{sieve-BE4_IyGa.js → sieve-DaPvBv1M.js} +0 -0
- /package/dist/{smalltalk-B_WPL8Nx.js → smalltalk-KPvwrjCs.js} +0 -0
- /package/dist/{solr-DlJFg7H5.js → solr-PvZUtEDb.js} +0 -0
- /package/dist/{sparql-7XIlcOgW.js → sparql-CXSUIQer.js} +0 -0
- /package/dist/{spreadsheet-BdZSVwVp.js → spreadsheet-DPJdGPkx.js} +0 -0
- /package/dist/{sql-CCrq7lfJ.js → sql-Dp4ZLSIa.js} +0 -0
- /package/dist/{stex-BiFc8QAu.js → stex-CeXW4zzk.js} +0 -0
- /package/dist/{stylus-DlSH9xpH.js → stylus-BXcmrg9w.js} +0 -0
- /package/dist/{swift-e3tMTZgJ.js → swift-DD8I7hKP.js} +0 -0
- /package/dist/{tcl-DfZMC20G.js → tcl-B9Lp4GtA.js} +0 -0
- /package/dist/{textile-DaSeca5U.js → textile-qdiY0teq.js} +0 -0
- /package/dist/{tiddlywiki-dfoiz8pS.js → tiddlywiki-t32lkubq.js} +0 -0
- /package/dist/{tiki-yJbQzhma.js → tiki-B0qKrSMl.js} +0 -0
- /package/dist/{troff-FN_FrCXR.js → troff-105XJOEu.js} +0 -0
- /package/dist/{ttcn-7_i4HlyB.js → ttcn-1_BxDcM8.js} +0 -0
- /package/dist/{ttcn-cfg-B46AlBUV.js → ttcn-cfg-Cn_XgXiw.js} +0 -0
- /package/dist/{turtle-QQfeFveR.js → turtle-BI6LyfEu.js} +0 -0
- /package/dist/{vb-DToPVnLa.js → vb-BecoBfmr.js} +0 -0
- /package/dist/{vbscript-CtsNaTz4.js → vbscript-De-zpA4i.js} +0 -0
- /package/dist/{velocity-CAoNe6ns.js → velocity-DhlYJTrD.js} +0 -0
- /package/dist/{verilog-DrDOMiJq.js → verilog-BDZgxDOW.js} +0 -0
- /package/dist/{vhdl-DnO0OEPh.js → vhdl-CV0OKTbp.js} +0 -0
- /package/dist/{webidl-Or6d1ZfA.js → webidl-BOM1Fs0O.js} +0 -0
- /package/dist/{xquery-CEp_Mcpr.js → xquery-CltP_CGh.js} +0 -0
- /package/dist/{yacas-DgnYrSlp.js → yacas-Dch4E2Dg.js} +0 -0
- /package/dist/{z80-DlG_kyeB.js → z80-B5Yly27o.js} +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { useCompletion } from "@ai-sdk/react";
|
|
4
4
|
import { EditorView } from "@codemirror/view";
|
|
5
5
|
import { AtSignIcon, Loader2Icon, SparklesIcon, XIcon } from "lucide-react";
|
|
6
|
-
import React, { useEffect, useId, useState } from "react";
|
|
6
|
+
import React, { useCallback, useEffect, useId, useState } from "react";
|
|
7
7
|
import CodeMirrorMerge from "react-codemirror-merge";
|
|
8
8
|
import { Button } from "@/components/ui/button";
|
|
9
9
|
import { customPythonLanguageSupport } from "@/core/codemirror/language/languages/python";
|
|
@@ -15,6 +15,7 @@ import { useAtom } from "jotai";
|
|
|
15
15
|
import { AIModelDropdown } from "@/components/ai/ai-model-dropdown";
|
|
16
16
|
import { Checkbox } from "@/components/ui/checkbox";
|
|
17
17
|
import { Label } from "@/components/ui/label";
|
|
18
|
+
import { Switch } from "@/components/ui/switch";
|
|
18
19
|
import { Tooltip } from "@/components/ui/tooltip";
|
|
19
20
|
import { toast } from "@/components/ui/use-toast";
|
|
20
21
|
import { includeOtherCellsAtom } from "@/core/ai/state";
|
|
@@ -28,8 +29,10 @@ import { prettyError } from "@/utils/errors";
|
|
|
28
29
|
import { retryWithTimeout } from "@/utils/timeout";
|
|
29
30
|
import { PromptInput } from "./add-cell-with-ai";
|
|
30
31
|
import {
|
|
32
|
+
AcceptCompletionButton,
|
|
31
33
|
CompletionActions,
|
|
32
34
|
createAiCompletionOnKeydown,
|
|
35
|
+
RejectCompletionButton,
|
|
33
36
|
} from "./completion-handlers";
|
|
34
37
|
import { addContextCompletion, getAICompletionBody } from "./completion-utils";
|
|
35
38
|
|
|
@@ -45,6 +48,9 @@ interface Props {
|
|
|
45
48
|
declineChange: () => void;
|
|
46
49
|
acceptChange: (rightHandCode: string) => void;
|
|
47
50
|
enabled: boolean;
|
|
51
|
+
triggerImmediately?: boolean;
|
|
52
|
+
runCell: () => void;
|
|
53
|
+
outputArea?: "above" | "below";
|
|
48
54
|
/**
|
|
49
55
|
* Children shown when there is no completion
|
|
50
56
|
*/
|
|
@@ -67,8 +73,12 @@ export const AiCompletionEditor: React.FC<Props> = ({
|
|
|
67
73
|
declineChange,
|
|
68
74
|
acceptChange,
|
|
69
75
|
enabled,
|
|
76
|
+
triggerImmediately,
|
|
77
|
+
runCell,
|
|
78
|
+
outputArea,
|
|
70
79
|
children,
|
|
71
80
|
}) => {
|
|
81
|
+
const [showInputPrompt, setShowInputPrompt] = useState(false);
|
|
72
82
|
const [completionBody, setCompletionBody] = useState<object>({});
|
|
73
83
|
|
|
74
84
|
const [includeOtherCells, setIncludeOtherCells] = useAtom(
|
|
@@ -86,6 +96,7 @@ export const AiCompletionEditor: React.FC<Props> = ({
|
|
|
86
96
|
setCompletion,
|
|
87
97
|
setInput,
|
|
88
98
|
handleSubmit,
|
|
99
|
+
complete,
|
|
89
100
|
} = useCompletion({
|
|
90
101
|
api: runtimeManager.getAiURL("completion").toString(),
|
|
91
102
|
headers: runtimeManager.headers(),
|
|
@@ -94,7 +105,11 @@ export const AiCompletionEditor: React.FC<Props> = ({
|
|
|
94
105
|
// Throttle the messages and data updates to 100ms
|
|
95
106
|
experimental_throttle: 100,
|
|
96
107
|
body: {
|
|
97
|
-
...completionBody
|
|
108
|
+
...(Object.keys(completionBody).length > 0
|
|
109
|
+
? completionBody
|
|
110
|
+
: initialPrompt
|
|
111
|
+
? getAICompletionBody({ input: initialPrompt })
|
|
112
|
+
: {}),
|
|
98
113
|
includeOtherCode: includeOtherCells ? getCodes(currentCode) : "",
|
|
99
114
|
code: currentCode,
|
|
100
115
|
language: currentLanguageAdapter,
|
|
@@ -114,6 +129,14 @@ export const AiCompletionEditor: React.FC<Props> = ({
|
|
|
114
129
|
const inputRef = React.useRef<ReactCodeMirrorRef>(null);
|
|
115
130
|
const completion = untrimmedCompletion.trimEnd();
|
|
116
131
|
|
|
132
|
+
const initialSubmit = useCallback(() => {
|
|
133
|
+
if (triggerImmediately && !isLoading && initialPrompt) {
|
|
134
|
+
// Use complete to pass the prompt directly, else input might be empty
|
|
135
|
+
complete(initialPrompt);
|
|
136
|
+
}
|
|
137
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
138
|
+
}, [triggerImmediately]);
|
|
139
|
+
|
|
117
140
|
// Focus the input
|
|
118
141
|
useEffect(() => {
|
|
119
142
|
if (enabled) {
|
|
@@ -122,6 +145,7 @@ export const AiCompletionEditor: React.FC<Props> = ({
|
|
|
122
145
|
const input = inputRef.current;
|
|
123
146
|
if (input?.view) {
|
|
124
147
|
input.view.focus();
|
|
148
|
+
initialSubmit();
|
|
125
149
|
return true;
|
|
126
150
|
}
|
|
127
151
|
return false;
|
|
@@ -131,7 +155,7 @@ export const AiCompletionEditor: React.FC<Props> = ({
|
|
|
131
155
|
|
|
132
156
|
selectAllText(inputRef.current?.view);
|
|
133
157
|
}
|
|
134
|
-
}, [enabled]);
|
|
158
|
+
}, [enabled, initialSubmit]);
|
|
135
159
|
|
|
136
160
|
// Reset the input when the prompt changes
|
|
137
161
|
useEffect(() => {
|
|
@@ -148,16 +172,43 @@ export const AiCompletionEditor: React.FC<Props> = ({
|
|
|
148
172
|
};
|
|
149
173
|
|
|
150
174
|
const handleDeclineCompletion = () => {
|
|
175
|
+
declineChange();
|
|
151
176
|
setCompletion("");
|
|
152
177
|
};
|
|
153
178
|
|
|
179
|
+
const showCompletionBanner =
|
|
180
|
+
enabled && triggerImmediately && (completion || isLoading);
|
|
181
|
+
|
|
182
|
+
const showInput = enabled && (!triggerImmediately || showInputPrompt);
|
|
183
|
+
|
|
184
|
+
const completionBanner = (
|
|
185
|
+
<div
|
|
186
|
+
className={cn(
|
|
187
|
+
"w-full bg-(--cm-background) flex justify-center transition-all duration-300 ease-in-out overflow-hidden",
|
|
188
|
+
showCompletionBanner
|
|
189
|
+
? "max-h-20 opacity-100 translate-y-0"
|
|
190
|
+
: "max-h-0 opacity-0 -translate-y-2",
|
|
191
|
+
)}
|
|
192
|
+
>
|
|
193
|
+
<CompletionBanner
|
|
194
|
+
status={isLoading ? "loading" : "generated"}
|
|
195
|
+
onAccept={handleAcceptCompletion}
|
|
196
|
+
onReject={handleDeclineCompletion}
|
|
197
|
+
showInputPrompt={showInputPrompt}
|
|
198
|
+
setShowInputPrompt={setShowInputPrompt}
|
|
199
|
+
runCell={runCell}
|
|
200
|
+
className="mt-4 mb-3 w-128"
|
|
201
|
+
/>
|
|
202
|
+
</div>
|
|
203
|
+
);
|
|
204
|
+
|
|
154
205
|
return (
|
|
155
206
|
<div className={cn("flex flex-col w-full rounded-[inherit]", className)}>
|
|
156
207
|
<div
|
|
157
208
|
className={cn(
|
|
158
209
|
"flex items-center gap-2 border-b px-3 transition-all rounded-[inherit] rounded-b-none duration-300",
|
|
159
|
-
|
|
160
|
-
!
|
|
210
|
+
showInput && "max-h-[400px] min-h-11 visible",
|
|
211
|
+
!showInput && "max-h-0 min-h-0 invisible",
|
|
161
212
|
)}
|
|
162
213
|
>
|
|
163
214
|
{enabled && (
|
|
@@ -266,6 +317,7 @@ export const AiCompletionEditor: React.FC<Props> = ({
|
|
|
266
317
|
</>
|
|
267
318
|
)}
|
|
268
319
|
</div>
|
|
320
|
+
{outputArea === "above" && completionBanner}
|
|
269
321
|
{completion && enabled && (
|
|
270
322
|
<CodeMirrorMerge className="cm" theme={theme}>
|
|
271
323
|
<Original
|
|
@@ -282,6 +334,84 @@ export const AiCompletionEditor: React.FC<Props> = ({
|
|
|
282
334
|
</CodeMirrorMerge>
|
|
283
335
|
)}
|
|
284
336
|
{(!completion || !enabled) && children}
|
|
337
|
+
{/* By default, show the completion banner below the code */}
|
|
338
|
+
{(outputArea === "below" || !outputArea) && completionBanner}
|
|
339
|
+
</div>
|
|
340
|
+
);
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
interface CompletionBannerProps {
|
|
344
|
+
status: "loading" | "generated";
|
|
345
|
+
onAccept: () => void;
|
|
346
|
+
onReject: () => void;
|
|
347
|
+
showInputPrompt: boolean;
|
|
348
|
+
setShowInputPrompt: (show: boolean) => void;
|
|
349
|
+
runCell: () => void;
|
|
350
|
+
className?: string;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
const CompletionBanner: React.FC<CompletionBannerProps> = ({
|
|
354
|
+
status,
|
|
355
|
+
onAccept,
|
|
356
|
+
onReject,
|
|
357
|
+
className,
|
|
358
|
+
showInputPrompt,
|
|
359
|
+
setShowInputPrompt,
|
|
360
|
+
runCell,
|
|
361
|
+
}) => {
|
|
362
|
+
const isLoading = status === "loading";
|
|
363
|
+
|
|
364
|
+
return (
|
|
365
|
+
<div
|
|
366
|
+
className={cn(
|
|
367
|
+
"flex flex-row items-center gap-6 rounded-md py-2 px-2.5 text-sm border border-border",
|
|
368
|
+
"shadow-[0_0_6px_1px_rgba(34,197,94,0.15)]",
|
|
369
|
+
className,
|
|
370
|
+
)}
|
|
371
|
+
>
|
|
372
|
+
<div className="flex flex-row items-center gap-2">
|
|
373
|
+
<div
|
|
374
|
+
className={cn(
|
|
375
|
+
"w-2 h-2 rounded-full",
|
|
376
|
+
status === "loading" ? "bg-blue-500 animate-pulse" : "bg-green-500",
|
|
377
|
+
)}
|
|
378
|
+
/>
|
|
379
|
+
<p className="transition-opacity duration-200 text-muted-foreground">
|
|
380
|
+
{isLoading ? "Generating fix..." : "Showing fix"}
|
|
381
|
+
</p>
|
|
382
|
+
</div>
|
|
383
|
+
|
|
384
|
+
<div className="flex flex-row items-center gap-1">
|
|
385
|
+
<Label
|
|
386
|
+
htmlFor="show-input-prompt"
|
|
387
|
+
className="text-muted-foreground text-xs whitespace-nowrap ellipsis"
|
|
388
|
+
>
|
|
389
|
+
Show prompt
|
|
390
|
+
</Label>
|
|
391
|
+
<Switch
|
|
392
|
+
checked={showInputPrompt}
|
|
393
|
+
onCheckedChange={setShowInputPrompt}
|
|
394
|
+
size="xs"
|
|
395
|
+
/>
|
|
396
|
+
</div>
|
|
397
|
+
|
|
398
|
+
<div className="flex flex-row items-center gap-2 ml-auto">
|
|
399
|
+
<AcceptCompletionButton
|
|
400
|
+
isLoading={isLoading}
|
|
401
|
+
onAccept={onAccept}
|
|
402
|
+
size="xs"
|
|
403
|
+
buttonStyles="border-none rounded-md rounded-r-none"
|
|
404
|
+
playButtonStyles="border-0 border-l-1 rounded-md rounded-l-none"
|
|
405
|
+
runCell={runCell}
|
|
406
|
+
// acceptShortcut="Mod-↵"
|
|
407
|
+
/>
|
|
408
|
+
<RejectCompletionButton
|
|
409
|
+
onDecline={onReject}
|
|
410
|
+
size="xs"
|
|
411
|
+
className="border-none rounded-md"
|
|
412
|
+
// declineShortcut="Shift-Mod-Delete"
|
|
413
|
+
/>
|
|
414
|
+
</div>
|
|
285
415
|
</div>
|
|
286
416
|
);
|
|
287
417
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/* Copyright 2024 Marimo. All rights reserved. */
|
|
2
2
|
|
|
3
|
+
import { PlayIcon } from "lucide-react";
|
|
3
4
|
import React from "react";
|
|
4
5
|
import { MinimalHotkeys } from "@/components/shortcuts/renderShortcut";
|
|
5
6
|
import { Button } from "@/components/ui/button";
|
|
7
|
+
import { Tooltip } from "@/components/ui/tooltip";
|
|
6
8
|
import { isPlatformMac } from "@/core/hotkeys/shortcuts";
|
|
7
9
|
|
|
8
10
|
/**
|
|
@@ -99,29 +101,111 @@ export const CompletionActionsCellFooter: React.FC<{
|
|
|
99
101
|
}> = ({ isLoading, onAccept, onDecline }) => {
|
|
100
102
|
return (
|
|
101
103
|
<>
|
|
102
|
-
<
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
disabled={isLoading}
|
|
106
|
-
onClick={onAccept}
|
|
107
|
-
className="h-6 text-(--grass-11) border-(--grass-7) bg-(--grass-3)/60
|
|
108
|
-
hover:bg-(--grass-3) dark:bg-(--grass-4)/80 dark:hover:bg-(--grass-3) rounded px-3 font-semibold
|
|
109
|
-
active:bg-(--grass-5) dark:active:bg-(--grass-4)
|
|
110
|
-
border-(--green-6) border hover:shadow-xs"
|
|
111
|
-
>
|
|
112
|
-
Accept
|
|
113
|
-
</Button>
|
|
114
|
-
<Button
|
|
115
|
-
variant="text"
|
|
104
|
+
<AcceptCompletionButton
|
|
105
|
+
isLoading={isLoading}
|
|
106
|
+
onAccept={onAccept}
|
|
116
107
|
size="xs"
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
dark:bg-(--red-4)/80 dark:hover:bg-(--red-3) rounded px-3 font-semibold
|
|
120
|
-
active:bg-(--red-5) dark:active:bg-(--red-4)
|
|
121
|
-
border-(--red-6) border hover:shadow-xs"
|
|
122
|
-
>
|
|
123
|
-
Reject
|
|
124
|
-
</Button>
|
|
108
|
+
/>
|
|
109
|
+
<RejectCompletionButton onDecline={onDecline} size="xs" />
|
|
125
110
|
</>
|
|
126
111
|
);
|
|
127
112
|
};
|
|
113
|
+
|
|
114
|
+
export const AcceptCompletionButton: React.FC<{
|
|
115
|
+
isLoading: boolean;
|
|
116
|
+
onAccept: () => void;
|
|
117
|
+
size?: "xs" | "sm";
|
|
118
|
+
buttonStyles?: string;
|
|
119
|
+
playButtonStyles?: string;
|
|
120
|
+
acceptShortcut?: string;
|
|
121
|
+
runCell?: () => void;
|
|
122
|
+
}> = ({
|
|
123
|
+
isLoading,
|
|
124
|
+
onAccept,
|
|
125
|
+
size = "sm",
|
|
126
|
+
buttonStyles,
|
|
127
|
+
acceptShortcut,
|
|
128
|
+
runCell,
|
|
129
|
+
playButtonStyles,
|
|
130
|
+
}) => {
|
|
131
|
+
const handleAcceptAndRun = () => {
|
|
132
|
+
onAccept();
|
|
133
|
+
if (runCell) {
|
|
134
|
+
runCell();
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const baseClasses = `h-6 text-(--grass-11) bg-(--grass-3)/60
|
|
139
|
+
hover:bg-(--grass-3) dark:bg-(--grass-4)/80 dark:hover:bg-(--grass-3) font-semibold
|
|
140
|
+
active:bg-(--grass-5) dark:active:bg-(--grass-4)
|
|
141
|
+
border-(--green-6) border hover:shadow-xs`;
|
|
142
|
+
|
|
143
|
+
if (runCell) {
|
|
144
|
+
return (
|
|
145
|
+
<div className="flex">
|
|
146
|
+
<Button
|
|
147
|
+
variant="text"
|
|
148
|
+
size={size}
|
|
149
|
+
disabled={isLoading}
|
|
150
|
+
onClick={onAccept}
|
|
151
|
+
className={`${baseClasses} rounded-r-none ${buttonStyles}`}
|
|
152
|
+
>
|
|
153
|
+
Accept
|
|
154
|
+
{acceptShortcut && (
|
|
155
|
+
<MinimalHotkeys className="ml-1 inline" shortcut={acceptShortcut} />
|
|
156
|
+
)}
|
|
157
|
+
</Button>
|
|
158
|
+
<Tooltip content="Accept and run cell">
|
|
159
|
+
<Button
|
|
160
|
+
variant="text"
|
|
161
|
+
size={size}
|
|
162
|
+
disabled={isLoading}
|
|
163
|
+
onClick={handleAcceptAndRun}
|
|
164
|
+
className={`${baseClasses} rounded-l-none px-1.5 ${playButtonStyles}`}
|
|
165
|
+
>
|
|
166
|
+
<PlayIcon className="h-2.5 w-2.5 mt-0.5" />
|
|
167
|
+
</Button>
|
|
168
|
+
</Tooltip>
|
|
169
|
+
</div>
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return (
|
|
174
|
+
<Button
|
|
175
|
+
variant="text"
|
|
176
|
+
size={size}
|
|
177
|
+
disabled={isLoading}
|
|
178
|
+
onClick={onAccept}
|
|
179
|
+
className={`${baseClasses} rounded px-3 ${buttonStyles}`}
|
|
180
|
+
>
|
|
181
|
+
Accept
|
|
182
|
+
{acceptShortcut && (
|
|
183
|
+
<MinimalHotkeys className="ml-1 inline" shortcut={acceptShortcut} />
|
|
184
|
+
)}
|
|
185
|
+
</Button>
|
|
186
|
+
);
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export const RejectCompletionButton: React.FC<{
|
|
190
|
+
onDecline: () => void;
|
|
191
|
+
size?: "xs" | "sm";
|
|
192
|
+
className?: string;
|
|
193
|
+
declineShortcut?: string;
|
|
194
|
+
}> = ({ onDecline, size = "sm", className, declineShortcut }) => {
|
|
195
|
+
return (
|
|
196
|
+
<Button
|
|
197
|
+
variant="text"
|
|
198
|
+
size={size}
|
|
199
|
+
onClick={onDecline}
|
|
200
|
+
className={`h-6 text-(--red-10) bg-(--red-3)/60 hover:bg-(--red-3)
|
|
201
|
+
dark:bg-(--red-4)/80 dark:hover:bg-(--red-3) rounded px-3 font-semibold
|
|
202
|
+
active:bg-(--red-5) dark:active:bg-(--red-4)
|
|
203
|
+
border-(--red-6) border hover:shadow-xs ${className}`}
|
|
204
|
+
>
|
|
205
|
+
Reject
|
|
206
|
+
{declineShortcut && (
|
|
207
|
+
<MinimalHotkeys className="ml-1 inline" shortcut={declineShortcut} />
|
|
208
|
+
)}
|
|
209
|
+
</Button>
|
|
210
|
+
);
|
|
211
|
+
};
|
|
@@ -67,6 +67,7 @@ export interface CellEditorProps
|
|
|
67
67
|
// DOM node where the editorView will be mounted
|
|
68
68
|
editorViewParentRef?: React.RefObject<HTMLDivElement | null>;
|
|
69
69
|
showHiddenCode: (opts?: { focus?: boolean }) => void;
|
|
70
|
+
outputArea?: "above" | "below";
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
const CellEditorInternal = ({
|
|
@@ -88,6 +89,7 @@ const CellEditorInternal = ({
|
|
|
88
89
|
languageAdapter,
|
|
89
90
|
setLanguageAdapter,
|
|
90
91
|
showLanguageToggles = true,
|
|
92
|
+
outputArea,
|
|
91
93
|
}: CellEditorProps) => {
|
|
92
94
|
const [aiCompletionCell, setAiCompletionCell] = useAtom(aiCompletionCellAtom);
|
|
93
95
|
const deleteCell = useDeleteCellCallback();
|
|
@@ -407,6 +409,7 @@ const CellEditorInternal = ({
|
|
|
407
409
|
<AiCompletionEditor
|
|
408
410
|
enabled={aiCompletionCell?.cellId === cellId}
|
|
409
411
|
initialPrompt={aiCompletionCell?.initialPrompt}
|
|
412
|
+
triggerImmediately={aiCompletionCell?.triggerImmediately}
|
|
410
413
|
currentCode={editorViewRef.current?.state.doc.toString() ?? code}
|
|
411
414
|
currentLanguageAdapter={languageAdapter}
|
|
412
415
|
declineChange={useEvent(() => {
|
|
@@ -433,6 +436,8 @@ const CellEditorInternal = ({
|
|
|
433
436
|
editorViewRef.current?.focus();
|
|
434
437
|
setAiCompletionCell(null);
|
|
435
438
|
})}
|
|
439
|
+
runCell={handleRunCell}
|
|
440
|
+
outputArea={outputArea}
|
|
436
441
|
>
|
|
437
442
|
<div className="relative w-full" {...navigationProps}>
|
|
438
443
|
{showHideButton && (
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/* Copyright 2024 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import { useAtomValue } from "jotai";
|
|
4
|
+
import { DatabaseZapIcon, RefreshCwIcon, Trash2Icon } from "lucide-react";
|
|
5
|
+
import React, { useState } from "react";
|
|
6
|
+
import { useLocale } from "react-aria";
|
|
7
|
+
import { Spinner } from "@/components/icons/spinner";
|
|
8
|
+
import { Button } from "@/components/ui/button";
|
|
9
|
+
import { ConfirmationButton } from "@/components/ui/confirmation-button";
|
|
10
|
+
import { toast } from "@/components/ui/use-toast";
|
|
11
|
+
import { cacheInfoAtom } from "@/core/cache/requests";
|
|
12
|
+
import { useRequestClient } from "@/core/network/requests";
|
|
13
|
+
import { useAsyncData } from "@/hooks/useAsyncData";
|
|
14
|
+
import { cn } from "@/utils/cn";
|
|
15
|
+
import { formatBytes, formatTime } from "@/utils/formatting";
|
|
16
|
+
import { prettyNumber } from "@/utils/numbers";
|
|
17
|
+
import { PanelEmptyState } from "./empty-state";
|
|
18
|
+
|
|
19
|
+
const CachePanel = () => {
|
|
20
|
+
const { clearCache, getCacheInfo } = useRequestClient();
|
|
21
|
+
const cacheInfo = useAtomValue(cacheInfoAtom);
|
|
22
|
+
const [purging, setPurging] = useState(false);
|
|
23
|
+
const { locale } = useLocale();
|
|
24
|
+
|
|
25
|
+
const { isPending, isFetching, refetch } = useAsyncData(async () => {
|
|
26
|
+
await getCacheInfo();
|
|
27
|
+
// Artificially spin the icon if the request is really fast
|
|
28
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
29
|
+
}, []);
|
|
30
|
+
|
|
31
|
+
const handlePurge = async () => {
|
|
32
|
+
try {
|
|
33
|
+
setPurging(true);
|
|
34
|
+
await clearCache();
|
|
35
|
+
toast({
|
|
36
|
+
title: "Cache purged",
|
|
37
|
+
description: "All cached data has been cleared",
|
|
38
|
+
});
|
|
39
|
+
// Request updated cache info after purge
|
|
40
|
+
refetch();
|
|
41
|
+
} catch (err) {
|
|
42
|
+
toast({
|
|
43
|
+
title: "Error",
|
|
44
|
+
description:
|
|
45
|
+
err instanceof Error ? err.message : "Failed to purge cache",
|
|
46
|
+
variant: "danger",
|
|
47
|
+
});
|
|
48
|
+
} finally {
|
|
49
|
+
setPurging(false);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// Show spinner only on initial load
|
|
54
|
+
if (isPending && !cacheInfo) {
|
|
55
|
+
return <Spinner size="medium" centered={true} />;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const refreshButton = (
|
|
59
|
+
<Button variant="outline" size="sm" onClick={refetch} disabled={isFetching}>
|
|
60
|
+
{isFetching ? (
|
|
61
|
+
<Spinner size="small" className="w-4 h-4 mr-2" />
|
|
62
|
+
) : (
|
|
63
|
+
<RefreshCwIcon className="w-4 h-4 mr-2" />
|
|
64
|
+
)}
|
|
65
|
+
Refresh
|
|
66
|
+
</Button>
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
if (!cacheInfo) {
|
|
70
|
+
return (
|
|
71
|
+
<PanelEmptyState
|
|
72
|
+
title="No cache data"
|
|
73
|
+
description="Cache information is not available."
|
|
74
|
+
icon={<DatabaseZapIcon />}
|
|
75
|
+
action={refreshButton}
|
|
76
|
+
/>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const totalHits = cacheInfo.hits;
|
|
81
|
+
const totalMisses = cacheInfo.misses;
|
|
82
|
+
const totalTime = cacheInfo.time;
|
|
83
|
+
const diskTotal = cacheInfo.disk_total;
|
|
84
|
+
const diskToFree = cacheInfo.disk_to_free;
|
|
85
|
+
|
|
86
|
+
const totalRequests = totalHits + totalMisses;
|
|
87
|
+
const hitRate = totalRequests > 0 ? (totalHits / totalRequests) * 100 : 0;
|
|
88
|
+
|
|
89
|
+
// Show empty state if no cache activity
|
|
90
|
+
if (totalRequests === 0) {
|
|
91
|
+
return (
|
|
92
|
+
<PanelEmptyState
|
|
93
|
+
title="No cache activity"
|
|
94
|
+
description="The cache has not been used yet. Cached functions will appear here once they are executed."
|
|
95
|
+
icon={<DatabaseZapIcon />}
|
|
96
|
+
action={refreshButton}
|
|
97
|
+
/>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<div className="flex flex-col h-full overflow-auto">
|
|
103
|
+
<div className="flex flex-col gap-4 p-4 h-full">
|
|
104
|
+
{/* Header with Refresh Button */}
|
|
105
|
+
<div className="flex items-center justify-end">
|
|
106
|
+
<Button
|
|
107
|
+
variant="ghost"
|
|
108
|
+
size="icon"
|
|
109
|
+
className="h-6 w-6"
|
|
110
|
+
onClick={refetch}
|
|
111
|
+
disabled={isFetching}
|
|
112
|
+
>
|
|
113
|
+
<RefreshCwIcon
|
|
114
|
+
className={cn(
|
|
115
|
+
"h-4 w-4 text-muted-foreground hover:text-foreground",
|
|
116
|
+
isFetching && "animate-[spin_0.5s]",
|
|
117
|
+
)}
|
|
118
|
+
/>
|
|
119
|
+
</Button>
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
{/* Statistics Section */}
|
|
123
|
+
<div className="space-y-3">
|
|
124
|
+
<h3 className="text-sm font-semibold text-foreground">Statistics</h3>
|
|
125
|
+
<div className="grid grid-cols-2 gap-3">
|
|
126
|
+
<StatCard
|
|
127
|
+
label="Time saved"
|
|
128
|
+
value={formatTime(totalTime, locale)}
|
|
129
|
+
description="Total execution time saved"
|
|
130
|
+
/>
|
|
131
|
+
<StatCard
|
|
132
|
+
label="Hit rate"
|
|
133
|
+
value={
|
|
134
|
+
totalRequests > 0 ? `${prettyNumber(hitRate, locale)}%` : "—"
|
|
135
|
+
}
|
|
136
|
+
description={`${prettyNumber(totalHits, locale)} hits / ${prettyNumber(totalRequests, locale)} total`}
|
|
137
|
+
/>
|
|
138
|
+
<StatCard
|
|
139
|
+
label="Cache hits"
|
|
140
|
+
value={prettyNumber(totalHits, locale)}
|
|
141
|
+
description="Successful cache retrievals"
|
|
142
|
+
/>
|
|
143
|
+
<StatCard
|
|
144
|
+
label="Cache misses"
|
|
145
|
+
value={prettyNumber(totalMisses, locale)}
|
|
146
|
+
description="Cache not found"
|
|
147
|
+
/>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
|
|
151
|
+
{/* Storage Section */}
|
|
152
|
+
{diskTotal > 0 && (
|
|
153
|
+
<div className="space-y-3 pt-2 border-t">
|
|
154
|
+
<h3 className="text-sm font-semibold text-foreground">Storage</h3>
|
|
155
|
+
<div className="grid grid-cols-1 gap-3">
|
|
156
|
+
<StatCard
|
|
157
|
+
label="Disk usage"
|
|
158
|
+
value={formatBytes(diskTotal, locale)}
|
|
159
|
+
description={
|
|
160
|
+
diskToFree > 0
|
|
161
|
+
? `${formatBytes(diskToFree, locale)} can be freed`
|
|
162
|
+
: "Cache storage on disk"
|
|
163
|
+
}
|
|
164
|
+
/>
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
)}
|
|
168
|
+
|
|
169
|
+
<div className="my-auto" />
|
|
170
|
+
|
|
171
|
+
{/* Actions Section */}
|
|
172
|
+
<div className="pt-2 border-t">
|
|
173
|
+
<ConfirmationButton
|
|
174
|
+
title="Purge cache?"
|
|
175
|
+
description="This will permanently delete all cached data. This action cannot be undone."
|
|
176
|
+
confirmText="Purge"
|
|
177
|
+
destructive={true}
|
|
178
|
+
onConfirm={handlePurge}
|
|
179
|
+
>
|
|
180
|
+
<Button
|
|
181
|
+
variant="outlineDestructive"
|
|
182
|
+
size="xs"
|
|
183
|
+
disabled={purging}
|
|
184
|
+
className="w-full"
|
|
185
|
+
>
|
|
186
|
+
{purging ? (
|
|
187
|
+
<Spinner size="small" className="w-3 h-3 mr-2" />
|
|
188
|
+
) : (
|
|
189
|
+
<Trash2Icon className="w-3 h-3 mr-2" />
|
|
190
|
+
)}
|
|
191
|
+
Purge Cache
|
|
192
|
+
</Button>
|
|
193
|
+
</ConfirmationButton>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
);
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
const StatCard: React.FC<{
|
|
201
|
+
label: string;
|
|
202
|
+
value: string;
|
|
203
|
+
description?: string;
|
|
204
|
+
}> = ({ label, value, description }) => {
|
|
205
|
+
return (
|
|
206
|
+
<div className="flex flex-col gap-1 p-3 rounded-lg border bg-card">
|
|
207
|
+
<span className="text-xs text-muted-foreground">{label}</span>
|
|
208
|
+
<span className="text-lg font-semibold">{value}</span>
|
|
209
|
+
{description && (
|
|
210
|
+
<span className="text-xs text-muted-foreground">{description}</span>
|
|
211
|
+
)}
|
|
212
|
+
</div>
|
|
213
|
+
);
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
export default CachePanel;
|
|
@@ -18,7 +18,9 @@ export const PanelEmptyState = ({
|
|
|
18
18
|
<div className="mx-6 my-6 flex flex-col gap-2">
|
|
19
19
|
<div className="flex flex-row gap-2 items-center">
|
|
20
20
|
{icon &&
|
|
21
|
-
React.cloneElement(icon, {
|
|
21
|
+
React.cloneElement(icon, {
|
|
22
|
+
className: "text-accent-foreground flex-shrink-0",
|
|
23
|
+
})}
|
|
22
24
|
<span className="mt-1 text-accent-foreground">{title}</span>
|
|
23
25
|
</div>
|
|
24
26
|
<span className="text-muted-foreground text-sm">{description}</span>
|