@marimo-team/islands 0.17.0 → 0.17.1
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/{fullscreen-blsKUrtN.js → Combination-De9yoNY5.js} +132 -69
- package/dist/{ConnectedDataExplorerComponent-DJEUH6Bb.js → ConnectedDataExplorerComponent-DuvpJOKp.js} +45 -44
- package/dist/{ImageComparisonComponent-D4Tv9QzJ.js → ImageComparisonComponent--etUl2pp.js} +2 -2
- package/dist/{_baseIsEqual-CN4oFUZ4.js → _baseIsEqual-BFlyFUxC.js} +1 -1
- package/dist/{_basePickBy-CzSvE_-f.js → _basePickBy-gCCvtjgp.js} +3 -3
- package/dist/{_baseProperty-DbbUiyUD.js → _baseProperty-BuqBC0Ie.js} +5 -5
- package/dist/{_baseUniq-DwoC-LVO.js → _baseUniq-CKN9mEDq.js} +5 -5
- package/dist/any-language-editor-Du2Q_6IK.js +156 -0
- package/dist/apl-CUm2DGqh.js +4 -0
- package/dist/{arc-B1iVbHTB.js → arc-C_O2hc-b.js} +2 -2
- package/dist/architecture-O4VJ6CD3-PFw3eFBY.js +21 -0
- package/dist/{architectureDiagram-W76B3OCA-CoBORy6u.js → architectureDiagram-W76B3OCA-CrK99pJi.js} +38 -37
- package/dist/asciiarmor-lqJ78U01.js +4 -0
- package/dist/asn1-CjwpSTlW.js +4 -0
- package/dist/assets/__vite-browser-external-DHoMWs4M.js +1 -0
- package/dist/assets/{worker-vPn7gxWj.js → worker-B6tH8gPO.js} +3 -3
- package/dist/{blockDiagram-QIGZ2CNN-0yzoLIar.js → blockDiagram-QIGZ2CNN-BJOEyO6w.js} +47 -46
- package/dist/brainfuck-ClvDI1dq.js +4 -0
- package/dist/{button-DcnBVpVa.js → button-ADXOb_gX.js} +27 -27
- package/dist/{c4Diagram-FPNF74CW-CKsIA_DD.js → c4Diagram-FPNF74CW-7Pz_X9wF.js} +12 -11
- package/dist/{channel-3LVvQZcD.js → channel-X-wRUxX6.js} +1 -1
- package/dist/{check-D7ifz5op.js → check-COlaG7Ss.js} +1 -1
- package/dist/{chunk-3AY6CYHV-B2C-aVc3.js → chunk-3AY6CYHV-BQH2fFpA.js} +10 -10
- package/dist/{chunk-4BX2VUAB-DEd4VI9L.js → chunk-4BX2VUAB-D-QtDCKM.js} +1 -1
- package/dist/{chunk-4KMFLZZN-DnvP3O4K.js → chunk-4KMFLZZN-BirZvvJS.js} +13 -13
- package/dist/{chunk-55IACEB6-BcCzwOOl.js → chunk-55IACEB6-DjtPYZKs.js} +1 -1
- package/dist/{chunk-6OXUPJBA-eNAAfJ3Q.js → chunk-6OXUPJBA-CTnnqlzw.js} +7 -7
- package/dist/{chunk-7GE3RBXV-CSAeQvLz.js → chunk-7GE3RBXV-CT47hCrL.js} +1 -1
- package/dist/{chunk-ABZYJK2D-CZcb_1iM.js → chunk-ABZYJK2D-B6ZsU6SR.js} +484 -1039
- package/dist/{chunk-BN7GFLIU-pBc5O5Rh.js → chunk-BN7GFLIU-DYWEsrG4.js} +1 -1
- package/dist/{chunk-CVBHYZKI-CivHZg9P.js → chunk-CVBHYZKI-BuzDGXz0.js} +1 -1
- package/dist/{chunk-CXMOBAN2-Dd0E6qb0.js → chunk-CXMOBAN2-Bas2S5w1.js} +6 -6
- package/dist/{chunk-EXTU4WIE-GQ2ZWfJo.js → chunk-EXTU4WIE-DXwNSukz.js} +2 -2
- package/dist/{chunk-FMBD7UC4-C6YcisV6.js → chunk-FMBD7UC4-CYKEpuPr.js} +1 -1
- package/dist/{chunk-JA3XYJ7Z-DYeQaT57.js → chunk-JA3XYJ7Z-DcxfkcDC.js} +4 -4
- package/dist/{chunk-JEIROHC2-B-EZMP4V.js → chunk-JEIROHC2-C01ZIcIG.js} +1 -1
- package/dist/{chunk-K7UQS3LO-DENzlS-M.js → chunk-K7UQS3LO-CmbT97MV.js} +7 -7
- package/dist/{chunk-KMC2YHZD-SckhHdEh.js → chunk-KMC2YHZD-D64m-1E1.js} +1 -1
- package/dist/{chunk-QN33PNHL-Cjq5b604.js → chunk-QN33PNHL-DjB0j8Dr.js} +2 -2
- package/dist/{chunk-QYVHNE3D-CNUuivie.js → chunk-QYVHNE3D-VA4W4oxG.js} +2 -2
- package/dist/{chunk-QZHKN3VN-DugEU_bA.js → chunk-QZHKN3VN-KT0fl3Em.js} +1 -1
- package/dist/{chunk-S3R3BYOJ-itCT6Vif.js → chunk-S3R3BYOJ-C5zmcMvn.js} +6 -6
- package/dist/{chunk-T44TD3VJ-BLdfTX8J.js → chunk-T44TD3VJ-BMOgu-Hk.js} +1 -1
- package/dist/{chunk-TVAH2DTR-BOnwF9d8.js → chunk-TVAH2DTR-eKm8SKnH.js} +6 -6
- package/dist/{chunk-TZMSLE5B-DGs66AlL.js → chunk-TZMSLE5B-CQxFRiI2.js} +3 -3
- package/dist/{chunk-WFRQ32O7-CPsipkmJ.js → chunk-WFRQ32O7-Dg51o277.js} +1 -1
- package/dist/{chunk-WFWHJNB7-Cmed18Pk.js → chunk-WFWHJNB7-DVLO98ge.js} +1 -1
- package/dist/{chunk-XRWGC2XP-DH5GDaY8.js → chunk-XRWGC2XP-UNFKdWQh.js} +1 -1
- package/dist/{chunk-ZPAFE4SF-DPDwaqZm.js → chunk-ZPAFE4SF-DbCSwfLK.js} +1 -1
- package/dist/classDiagram-KNZD7YFC-HUFFxNdk.js +40 -0
- package/dist/classDiagram-v2-RKCZMP56-Dw7Acmuf.js +40 -0
- package/dist/{click-outside-container-CL_FkgGY.js → click-outside-container-2BH589Bq.js} +2 -2
- package/dist/{clike-DYfRWWXk.js → clike-CytFO-kN.js} +1 -1
- package/dist/clojure-8GefCgPe.js +4 -0
- package/dist/{clone-Msbhmn2a.js → clone-CCgVUJ6x.js} +1 -1
- package/dist/cmake-yAhT9H0F.js +4 -0
- package/dist/cobol-BmltueOY.js +4 -0
- package/dist/coffeescript-C7KEQBcH.js +4 -0
- package/dist/commonlisp-CNbiJRU-.js +4 -0
- package/dist/{constants-BCOEQoEQ.js → constants-BaCMVd12.js} +3 -3
- package/dist/{copy-BkZ8PkBM.js → copy-GNcK40wy.js} +2 -2
- package/dist/{cose-bilkent-S5V4N54A-BZnbwyVD.js → cose-bilkent-S5V4N54A-BnvuJG6Y.js} +3 -3
- package/dist/crystal-OdjZZ8bc.js +4 -0
- package/dist/css-DhTxMmL_.js +5 -0
- package/dist/cypher-CgN8E3YI.js +4 -0
- package/dist/d-g41sJcBC.js +4 -0
- package/dist/{dagre-5GWH7T2D-BGaiSZZO.js → dagre-5GWH7T2D-rn7tZYaQ.js} +37 -36
- package/dist/{dagre-pyfDIOWJ.js → dagre-Bghq6VKO.js} +13 -13
- package/dist/{data-grid-overlay-editor-867aBz0Y.js → data-grid-overlay-editor-B4_Caieu.js} +4 -4
- package/dist/{diagram-N5W7TBWH-CzLE0jZB.js → diagram-N5W7TBWH-lbF94o-g.js} +41 -40
- package/dist/{diagram-QEK2KX5R-AGS60xEZ.js → diagram-QEK2KX5R-CKBhSzsO.js} +35 -34
- package/dist/{diagram-S2PKOQOG-BxRoG6yW.js → diagram-S2PKOQOG-161_1f53.js} +35 -34
- package/dist/diff-ViRYYhhg.js +4 -0
- package/dist/{dist-PGgOcwbF.js → dist-28HYzERB.js} +2 -2
- package/dist/{dist-CfQHSIQC.js → dist-4dtbqf8A.js} +3 -3
- package/dist/{dist-CYhQCVru.js → dist-71jYYbWP.js} +2 -2
- package/dist/{dist-Cacac5HV.js → dist-B8Pbw5ln.js} +2 -2
- package/dist/{dist-z_iuDES7.js → dist-BAqp4Vtl.js} +1 -1
- package/dist/{dist-RwqAqkpG.js → dist-BBhmkni2.js} +1 -1
- package/dist/{dist-DMxl6Qbu.js → dist-BNRdMfJH.js} +2 -2
- package/dist/{dist-Doiq_KIP.js → dist-BSyYM1Gi.js} +6 -6
- package/dist/{dist-NUdHX0XE.js → dist-BYHiiJB-.js} +2 -2
- package/dist/{dist-B0YD1aXi.js → dist-B_wjJqqS.js} +2 -2
- package/dist/{dist-DBhEu3-F.js → dist-BaPjLM6s.js} +1 -1
- package/dist/dist-BfJO8Bm9.js +12 -0
- package/dist/{dist-BFkr6kAQ.js → dist-BqdQPWpQ.js} +2 -2
- package/dist/{dist-DlHkZUnY.js → dist-C2IEc8og.js} +5 -5
- package/dist/{dist-DS6nuHYK.js → dist-C9-uHBqC.js} +1 -1
- package/dist/{dist-B1Dv8Sdk.js → dist-CJb8EiFO.js} +3 -3
- package/dist/dist-CLuF3AtO.js +6 -0
- package/dist/{dist-CId4IPXu.js → dist-CNAkUyxv.js} +1 -1
- package/dist/{dist-RdxOJbBw.js → dist-CNvMOZu9.js} +2 -2
- package/dist/{dist-C7zhQ7K0.js → dist-CPNnKuPh.js} +1 -1
- package/dist/{dist-ivwkJchV.js → dist-CTIyD_KU.js} +3 -3
- package/dist/dist-CU04U4NL.js +10 -0
- package/dist/{dist-D-3fICwh.js → dist-CWh5ZwcC.js} +2 -2
- package/dist/{dist-d5NxvX2s.js → dist-CWqB4bg8.js} +3 -3
- package/dist/{dist-biZ846D9.js → dist-CtOeHDJp.js} +5 -5
- package/dist/{dist-BL2DSY0P.js → dist-Cw0F6l-7.js} +1 -1
- package/dist/{dist-wHVprCkn.js → dist-CwZcC4om.js} +1 -1
- package/dist/dist-DNUT6b47.js +6 -0
- package/dist/{dist-CZq5-ZyD.js → dist-Da046MhT.js} +1 -1
- package/dist/{dist-reo2kYlN.js → dist-DaTVdKJa.js} +2 -2
- package/dist/dist-DbAb2sY7.js +6 -0
- package/dist/dist-DiDFQ2Rk.js +6 -0
- package/dist/{dist-BpzZrRd6.js → dist-DlK420ke.js} +1 -1
- package/dist/{dist-CvyfRaIr.js → dist-Drf3cyIW.js} +3 -3
- package/dist/{dist-2Ne-33Xy.js → dist-DxESp2-T.js} +3 -3
- package/dist/{dist-CkvGMBAS.js → dist-DzJem5xc.js} +1 -1
- package/dist/{dist-y8uoXYaE.js → dist-O0zVziwn.js} +3 -3
- package/dist/dist-SNAyAOJ-.js +6 -0
- package/dist/{dist-BhVFggab.js → dist-_4cudra1.js} +3 -3
- package/dist/dist-cbW5xJNV.js +6 -0
- package/dist/dist-h8eGLSbK.js +10 -0
- package/dist/{dist-CBhnQKQ4.js → dist-xLN9qCAp.js} +3 -3
- package/dist/{dockerfile-sZMPcXVY.js → dockerfile-Cmlcqk35.js} +1 -1
- package/dist/dtd-RplB6hDg.js +4 -0
- package/dist/dylan-BX8KJufP.js +4 -0
- package/dist/ecl-CWtLaNMH.js +4 -0
- package/dist/eiffel-C-mlZPMn.js +4 -0
- package/dist/elm-CWp06vcb.js +4 -0
- package/dist/{erDiagram-AWTI2OKA-CTxzb-U8.js → erDiagram-AWTI2OKA-BU7Qig7n.js} +30 -29
- package/dist/erlang-pfp22AZM.js +4 -0
- package/dist/error-banner-BAWlXn49.js +1012 -0
- package/dist/{esm-CAWW9sum.js → esm-AtKNNGYO.js} +1 -1
- package/dist/esm-B2pocBPL.js +26 -0
- package/dist/{esm-BdiY4QsX.js → esm-Oo8OvZ6m.js} +110 -110
- package/dist/{esm-YY5zh7KV.js → esm-YVnxJqkD.js} +20 -20
- package/dist/{factor-CRFTmP_a.js → factor-BZnBK3CG.js} +1 -1
- package/dist/factor-CEn53jua.js +5 -0
- package/dist/{flowDiagram-PVAE7QVJ-Dck2hiJe.js → flowDiagram-PVAE7QVJ-JKJebWeY.js} +39 -38
- package/dist/{formats-BnqXUb1V.js → formats-DOEuF6TR.js} +8 -8
- package/dist/forth-CL8vu_y8.js +4 -0
- package/dist/fortran-DsmXkYtE.js +4 -0
- package/dist/{ganttDiagram-OWAHRB6G-AWzfzpup.js → ganttDiagram-OWAHRB6G-BvWRfg05.js} +17 -16
- package/dist/gas-mYt9Rtlx.js +4 -0
- package/dist/gherkin-DHNCKBNj.js +4 -0
- package/dist/gitGraph-ZV4HHKMB-Cpd6k0O8.js +21 -0
- package/dist/{gitGraphDiagram-NY62KEGX-GyNboWSV.js → gitGraphDiagram-NY62KEGX-VEJJBf5L.js} +35 -34
- package/dist/{glide-data-editor-DHuN8kQ8.js → glide-data-editor-Bne10icG.js} +87 -85
- package/dist/{graphlib-hb3zmtVD.js → graphlib-DRS8CrjA.js} +5 -5
- package/dist/groovy-DzRtOS5a.js +4 -0
- package/dist/haskell-Bl9iT_Mp.js +4 -0
- package/dist/haxe-DqA0ED6k.js +5 -0
- package/dist/{hotkeys-Ct2T3e9O.js → hotkeys-DVxFjl2s.js} +12 -0
- package/dist/idl-WU2hil4i.js +4 -0
- package/dist/info-63CPKGFF-CG-xzUJo.js +21 -0
- package/dist/infoDiagram-STP46IZ2-zoRBGoup.js +45 -0
- package/dist/invariant-D3JoRb4I.js +6 -0
- package/dist/{isEmpty--odfYjh1.js → isEmpty-Do_v2sls.js} +2 -2
- package/dist/{isSymbol-Cb1f2HgO.js → isSymbol-CtkA8Y0a.js} +1 -1
- package/dist/javascript-QY2BGJeV.js +5 -0
- package/dist/jinja2-Czleq7Sk.js +4 -0
- package/dist/{journeyDiagram-BIP6EPQ6-TmXYCUbT.js → journeyDiagram-BIP6EPQ6-CsgEQgxh.js} +10 -9
- package/dist/julia-Dru3Qi0y.js +4 -0
- package/dist/{kanban-definition-6OIFK2YF-B6ozleHo.js → kanban-definition-6OIFK2YF-Bi8Ete2P.js} +42 -41
- package/dist/{katex-mPzRsXEy.js → katex-C-g3rKKt.js} +1 -1
- package/dist/{label-VVRKZmrP.js → label-BiVIU_wb.js} +245 -243
- package/dist/{line-C6-zz71o.js → line-B7-GoF1m.js} +3 -3
- package/dist/{linear-iebAbJVD.js → linear-DeGGALuc.js} +4 -4
- package/dist/livescript-Dxqi_HLT.js +4 -0
- package/dist/{loader-CM0VALo9.js → loader-BBqwtZWj.js} +3 -3
- package/dist/lua-ByH1cUQZ.js +4 -0
- package/dist/main.js +11785 -11529
- package/dist/mathematica-CWJIFuES.js +4 -0
- package/dist/mbox-qhPIGaUI.js +4 -0
- package/dist/{memoize-DYoRBSLn.js → memoize-D7eDkf3R.js} +1 -1
- package/dist/{merge-BjuR6j_w.js → merge-C_6cGM6o.js} +1 -1
- package/dist/{mermaid-YPPMBmhk.js → mermaid-BmtvsZ2m.js} +323 -321
- package/dist/{mermaid-parser.core-BLkyTSZj.js → mermaid-parser.core-geyG_6o0.js} +8 -8
- package/dist/{mhchem-Dw7wvXtr.js → mhchem-OhAaJ0fA.js} +1 -1
- package/dist/{min-B_i2ahn4.js → min-Dwa_NbP6.js} +7 -7
- package/dist/{mindmap-definition-Q6HEUPPD-F6-JnXwq.js → mindmap-definition-Q6HEUPPD-B-wmX1oG.js} +29 -28
- package/dist/mirc-yYcXhXBY.js +4 -0
- package/dist/mllike-BfT_Nl9x.js +6 -0
- package/dist/modelica-lVDtz1Rm.js +4 -0
- package/dist/mscgen-DvwdD1QJ.js +6 -0
- package/dist/mumps-BiY3GwKd.js +4 -0
- package/dist/{now-CwRqw0nS.js → now-DumxsrcX.js} +1 -1
- package/dist/{nsis-BWJEeUyS.js → nsis-D4bLR_Y1.js} +1 -1
- package/dist/nsis-Dk18Sq_4.js +5 -0
- package/dist/ntriples-Cj-8VqKF.js +4 -0
- package/dist/{number-overlay-editor-CeyruAX4.js → number-overlay-editor-D6r-48ka.js} +2 -2
- package/dist/octave-BgFAaYjU.js +4 -0
- package/dist/once-3OSMKEsL.js +74 -0
- package/dist/{ordinal-BXk5xAj2.js → ordinal-DpEbSVPc.js} +1 -1
- package/dist/oz-IsEG1I1m.js +4 -0
- package/dist/packet-HUATNLJX-Cafuo3IG.js +21 -0
- package/dist/pascal-BVf7FtIE.js +4 -0
- package/dist/perl-BM0-y4mZ.js +4 -0
- package/dist/pie-WTHONI2E-BE0pHBwB.js +21 -0
- package/dist/{pieDiagram-ADFJNKIX-C5dSQVCn.js → pieDiagram-ADFJNKIX-C3GvPNUL.js} +40 -39
- package/dist/pig-CLBjzQmc.js +4 -0
- package/dist/powershell-B_qvE33J.js +4 -0
- package/dist/{precisionRound-DbP73hkf.js → precisionRound-7YYJq2rW.js} +1 -1
- package/dist/properties-CUTpsH2y.js +4 -0
- package/dist/protobuf-DqCP8a-0.js +4 -0
- package/dist/pug-BvexKkw4.js +5 -0
- package/dist/{pug-PJh82u1M.js → pug-Dv3gE36O.js} +1 -1
- package/dist/puppet-CoIi0R3f.js +4 -0
- package/dist/purify.es-CrfFzTyi.js +536 -0
- package/dist/python-C-11-YMh.js +5 -0
- package/dist/q-CCVgEip7.js +4 -0
- package/dist/{quadrantDiagram-LMRXKWRM-DlahxNiy.js → quadrantDiagram-LMRXKWRM-DPXwGNVa.js} +8 -7
- package/dist/r-CIdR0Sfs.js +4 -0
- package/dist/radar-NJJJXTRR-0adgjw0u.js +21 -0
- package/dist/{range-DxfkexCE.js → range-CIbLpsrs.js} +3 -3
- package/dist/{react-plotly-D_IAfR8f.js → react-plotly-DYyvxcRD.js} +1 -1
- package/dist/{requirementDiagram-4UW4RH46-DTkinyvU.js → requirementDiagram-4UW4RH46-Cs3Hqnm0.js} +24 -23
- package/dist/rpm-Dwvm039g.js +5 -0
- package/dist/ruby-DpTnO5gb.js +4 -0
- package/dist/{sankeyDiagram-GR3RE2ED-CsLnEnnq.js → sankeyDiagram-GR3RE2ED-Be1d_Xf7.js} +7 -6
- package/dist/sas-CK9boxgv.js +4 -0
- package/dist/scheme-Y1aYL-Qq.js +4 -0
- package/dist/{sequenceDiagram-C3RYC4MD-BdEOR6SC.js → sequenceDiagram-C3RYC4MD-lbtovKTa.js} +14 -13
- package/dist/shell-D3eXGsHd.js +4 -0
- package/dist/sieve-BdwSFdWJ.js +4 -0
- package/dist/{slides-component-2bbal1YJ.js → slides-component-BoeQU7-s.js} +999 -998
- package/dist/smalltalk-BTYJquCm.js +4 -0
- package/dist/sparql-CYF0g4Cc.js +4 -0
- package/dist/{src-DZkaBUmt.js → src-BTqT1mA1.js} +1 -1
- package/dist/{stateDiagram-KXAO66HF-DQLH2jhP.js → stateDiagram-KXAO66HF-BmbR-Rol.js} +40 -39
- package/dist/stateDiagram-v2-UMBNRL4Z-DdJ7qVWc.js +39 -0
- package/dist/{step-IHYrujTc.js → step-2RJrMSSG.js} +1 -1
- package/dist/stex-CyWhoWHt.js +5 -0
- package/dist/style.css +1 -1
- package/dist/stylus-BBiKaI2h.js +4 -0
- package/dist/swift-COb15qFR.js +4 -0
- package/dist/tcl-Jik1LXu9.js +4 -0
- package/dist/textile-BFHPD3wr.js +4 -0
- package/dist/{time-CFkXkVrt.js → time-BB30r1tK.js} +4 -4
- package/dist/{timeline-definition-XQNQX7LJ-bToVq14i.js → timeline-definition-XQNQX7LJ-1mv5caPW.js} +16 -15
- package/dist/{toNumber-EFF1Z9T1.js → toNumber-D3Ystr3y.js} +2 -2
- package/dist/{toString-C2mCkasT.js → toString-CbuxCRDG.js} +2 -2
- package/dist/toml-Brp9fBXs.js +4 -0
- package/dist/treemap-75Q7IDZK-CyBT8_Wh.js +21 -0
- package/dist/troff-CcZRW4vg.js +4 -0
- package/dist/ttcn-Bz_6ifRd.js +4 -0
- package/dist/ttcn-cfg-v-yi2rKc.js +4 -0
- package/dist/turtle-CDOsZYhB.js +4 -0
- package/dist/{types-CRXV0KD5.js → types-BPohCsA7.js} +141 -210
- package/dist/{useAsyncData-uMVTsDI9.js → useAsyncData-DHBqeb9a.js} +3 -2
- package/dist/{useDateFormatter-Dcz7jstn.js → useDateFormatter-BkbjKw83.js} +9 -9
- package/dist/useIframeCapabilities-BEvvwlwt.js +46 -0
- package/dist/{useTheme-NbEx-ZNV.js → useTheme-CnMbo-iq.js} +23 -23
- package/dist/vb-CL7fRwRw.js +4 -0
- package/dist/vbscript-CR2xfxpw.js +4 -0
- package/dist/{vega-component-hegVmfuS.js → vega-component-BfFcXZxw.js} +40 -39
- package/dist/{vega-loader.browser.module-DcW8jnKp.js → vega-loader.browser.module-CFMtdrNw.js} +3 -3
- package/dist/velocity-CfuZoxPt.js +4 -0
- package/dist/verilog-CySTkzw_.js +4 -0
- package/dist/vhdl-Dvcd8KHW.js +4 -0
- package/dist/webidl-tbJt7sKk.js +4 -0
- package/dist/xquery-DJQVztyc.js +4 -0
- package/dist/{xychartDiagram-6GGTOJPD-C7Bhm_yt.js → xychartDiagram-6GGTOJPD-njc-naaw.js} +23 -22
- package/dist/yacas-BbgBReEH.js +4 -0
- package/dist/z80-DPyb8VGz.js +4 -0
- package/package.json +10 -6
- package/src/components/app-config/ai-config.tsx +1 -3
- package/src/components/app-config/common.tsx +14 -0
- package/src/components/app-config/data-form.tsx +282 -0
- package/src/components/app-config/user-config-form.tsx +36 -223
- package/src/components/chat/acp/__tests__/state.test.ts +75 -2
- package/src/components/chat/acp/agent-panel.tsx +143 -89
- package/src/components/chat/acp/blocks.tsx +77 -34
- package/src/components/chat/acp/state.ts +5 -1
- package/src/components/chat/acp/thread.tsx +12 -1
- package/src/components/chat/chat-panel.tsx +38 -5
- package/src/components/chat/chat-utils.ts +5 -1
- package/src/components/chat/markdown-renderer.css +1 -0
- package/src/components/chat/tool-call-accordion.tsx +7 -1
- package/src/components/data-table/charts/__tests__/storage.test.ts +12 -6
- package/src/components/data-table/charts/charts.tsx +8 -2
- package/src/components/data-table/charts/storage.ts +1 -1
- package/src/components/data-table/column-wrapping/feature.ts +2 -0
- package/src/components/data-table/columns.tsx +10 -2
- package/src/components/data-table/renderers.tsx +3 -2
- package/src/components/editor/Output.tsx +28 -24
- package/src/components/editor/actions/useCellActionButton.tsx +20 -4
- package/src/components/editor/ai/add-cell-with-ai.tsx +17 -3
- package/src/components/editor/ai/ai-completion-editor.tsx +79 -32
- package/src/components/editor/ai/completion-handlers.tsx +26 -7
- package/src/components/editor/cell/StagedAICell.tsx +81 -12
- package/src/components/editor/cell/code/cell-editor.tsx +2 -3
- package/src/components/editor/cell/useRunCells.ts +62 -30
- package/src/components/editor/chrome/panels/cache-panel.tsx +2 -2
- package/src/components/editor/chrome/panels/packages-panel.tsx +1 -1
- package/src/components/editor/chrome/state.ts +1 -1
- package/src/components/editor/chrome/wrapper/app-chrome.tsx +2 -0
- package/src/components/editor/chrome/wrapper/minimap.tsx +2 -0
- package/src/components/editor/chrome/wrapper/pending-ai-cells.tsx +108 -0
- package/src/components/editor/chrome/wrapper/sidebar.tsx +1 -1
- package/src/components/editor/code/readonly-diff.tsx +49 -0
- package/src/components/editor/columns/storage.ts +1 -1
- package/src/components/editor/errors/fix-mode.ts +6 -1
- package/src/components/editor/inputs/Inputs.styles.ts +1 -1
- package/src/components/editor/output/CalloutOutput.tsx +1 -1
- package/src/components/editor/output/HtmlOutput.tsx +3 -2
- package/src/components/editor/output/JsonOutput.tsx +6 -1
- package/src/components/editor/output/MarimoTracebackOutput.tsx +59 -45
- package/src/components/editor/output/__tests__/HtmlOutput.test.tsx +134 -0
- package/src/components/editor/output/__tests__/traceback.test.tsx +8 -1
- package/src/components/editor/output/useWrapText.ts +6 -1
- package/src/components/editor/package-alert.tsx +34 -32
- package/src/components/editor/renderers/vertical-layout/vertical-layout-wrapper.tsx +5 -2
- package/src/components/home/state.ts +3 -2
- package/src/components/scratchpad/scratchpad-history.ts +6 -1
- package/src/components/slides/slides-component.tsx +25 -21
- package/src/components/ui/confirmation-button.tsx +1 -1
- package/src/components/ui/context-menu.tsx +14 -4
- package/src/components/ui/dropdown-menu.tsx +14 -4
- package/src/components/ui/fullscreen.tsx +115 -1
- package/src/components/ui/popover.tsx +11 -3
- package/src/components/ui/range-slider.tsx +1 -1
- package/src/components/ui/select.tsx +7 -3
- package/src/components/ui/slider.tsx +1 -1
- package/src/components/ui/tooltip.tsx +10 -3
- package/src/core/ai/__tests__/staged-cells.test.ts +189 -64
- package/src/core/ai/config.ts +6 -2
- package/src/core/ai/context/providers/__tests__/__snapshots__/cell-output.test.ts.snap +17 -0
- package/src/core/ai/context/providers/__tests__/cell-output.test.ts +194 -10
- package/src/core/ai/context/providers/cell-output.ts +170 -112
- package/src/core/ai/context/providers/tables.ts +2 -2
- package/src/core/ai/staged-cells.ts +32 -16
- package/src/core/ai/state.ts +2 -1
- package/src/core/ai/tools/__tests__/edit-notebook-tool.test.ts +556 -0
- package/src/core/ai/tools/__tests__/registry.test.ts +12 -4
- package/src/core/ai/tools/__tests__/run-cells-tool.test.ts +450 -0
- package/src/core/ai/tools/__tests__/utils.test.ts +87 -0
- package/src/core/ai/tools/base.ts +31 -8
- package/src/core/ai/tools/edit-notebook-tool.ts +239 -0
- package/src/core/ai/tools/registry.ts +13 -6
- package/src/core/ai/tools/run-cells-tool.ts +233 -0
- package/src/core/ai/tools/sample-tool.ts +10 -8
- package/src/core/ai/tools/utils.ts +23 -0
- package/src/core/cells/__tests__/cells.test.ts +19 -1
- package/src/core/cells/__tests__/session.test.ts +20 -3
- package/src/core/cells/cells.ts +12 -7
- package/src/core/cells/session.ts +1 -1
- package/src/core/codemirror/ai/resources.ts +13 -2
- package/src/core/codemirror/copilot/state.ts +4 -2
- package/src/core/codemirror/language/__tests__/extension.test.ts +10 -2
- package/src/core/codemirror/language/languages/markdown.ts +16 -153
- package/src/core/codemirror/language/languages/python.ts +12 -7
- package/src/core/codemirror/language/languages/sql/sql-mode.ts +6 -1
- package/src/core/codemirror/language/languages/sql/sql.ts +20 -293
- package/src/core/codemirror/language/panel/markdown.tsx +2 -1
- package/src/core/codemirror/language/panel/panel.tsx +1 -1
- package/src/core/codemirror/lsp/federated-lsp.ts +1 -1
- package/src/core/codemirror/lsp/transports.ts +7 -13
- package/src/core/config/config-schema.ts +4 -1
- package/src/core/hotkeys/hotkeys.ts +12 -0
- package/src/core/lsp/__tests__/transport.test.ts +233 -0
- package/src/core/lsp/transport.ts +139 -0
- package/src/core/rtc/state.ts +6 -1
- package/src/core/vscode/is-in-vscode.ts +9 -0
- package/src/core/wasm/store.ts +1 -1
- package/src/css/app/Cell.css +31 -0
- package/src/css/globals.css +5 -0
- package/src/hooks/useIframeCapabilities.ts +14 -0
- package/src/hooks/useLocalStorage.ts +1 -1
- package/src/plugins/core/RenderHTML.tsx +65 -5
- package/src/plugins/core/__test__/RenderHTML.test.ts +25 -23
- package/src/plugins/core/__test__/renderHTML-sanitization.test.tsx +131 -0
- package/src/plugins/core/__test__/sanitize.test.ts +465 -0
- package/src/plugins/core/registerReactComponent.tsx +14 -1
- package/src/plugins/core/sanitize.ts +76 -0
- package/src/plugins/impl/DataTablePlugin.tsx +1 -0
- package/src/plugins/impl/FileBrowserPlugin.tsx +1 -3
- package/src/plugins/impl/FileUploadPlugin.tsx +1 -3
- package/src/plugins/impl/__tests__/DateTimePickerPlugin.test.tsx +8 -1
- package/src/plugins/impl/__tests__/DropdownPlugin.test.tsx +6 -0
- package/src/plugins/impl/__tests__/MultiSelectPlugin.test.ts +8 -1
- package/src/plugins/impl/__tests__/NumberPlugin.test.tsx +3 -0
- package/src/plugins/impl/plotly/parse-from-template.ts +1 -1
- package/src/utils/__tests__/arrays.test.ts +42 -0
- package/src/utils/__tests__/capabilities.test.ts +453 -0
- package/src/utils/__tests__/formatting.test.ts +13 -13
- package/src/utils/__tests__/local-storage.test.ts +1 -1
- package/src/utils/__tests__/storage.test.ts +21 -21
- package/src/utils/arrays.ts +25 -0
- package/src/utils/capabilities.ts +114 -0
- package/src/utils/numbers.ts +2 -2
- package/src/utils/{storage.ts → storage/jotai.ts} +16 -4
- package/src/utils/storage/storage.ts +57 -0
- package/src/utils/{localStorage.ts → storage/typed.ts} +22 -12
- package/dist/any-language-editor-CEXn1vFs.js +0 -156
- package/dist/apl-DuVfHsPc.js +0 -4
- package/dist/architecture-O4VJ6CD3-lp-opOaL.js +0 -21
- package/dist/asciiarmor-qIVWsi4F.js +0 -4
- package/dist/asn1-BjPqARr7.js +0 -4
- package/dist/assets/__vite-browser-external-lX-sn9m2.js +0 -1
- package/dist/brainfuck-DPGTVfkE.js +0 -4
- package/dist/classDiagram-KNZD7YFC-azuS_99k.js +0 -39
- package/dist/classDiagram-v2-RKCZMP56-CQpyQQOR.js +0 -39
- package/dist/clojure-ATksAecl.js +0 -4
- package/dist/cmake-CWylaz2C.js +0 -4
- package/dist/cobol-BiLLCZIQ.js +0 -4
- package/dist/coffeescript-Ca4jipi8.js +0 -4
- package/dist/commonlisp-BwFjyEC7.js +0 -4
- package/dist/crystal-BhUsQHbh.js +0 -4
- package/dist/css-Cf4wlIyV.js +0 -5
- package/dist/cypher-Dj8Hzgxa.js +0 -4
- package/dist/d-DZI7tbTy.js +0 -4
- package/dist/diff-WQISUHG5.js +0 -4
- package/dist/dist-BawZu0ix.js +0 -10
- package/dist/dist-BiOF7987.js +0 -6
- package/dist/dist-Cs3McXEj.js +0 -6
- package/dist/dist-D3aaithT.js +0 -6
- package/dist/dist-DELcMSpJ.js +0 -6
- package/dist/dist-Dgts3WXd.js +0 -6
- package/dist/dist-DtpUiDG_.js +0 -6
- package/dist/dist-ZjnJq_jD.js +0 -10
- package/dist/dist-mof3iuBu.js +0 -12
- package/dist/dtd-B2M8dhfC.js +0 -4
- package/dist/dylan-CU3Vt8SC.js +0 -4
- package/dist/ecl-B8ESAVq4.js +0 -4
- package/dist/eiffel-DDfMIKeA.js +0 -4
- package/dist/elm-Bj6rj8jf.js +0 -4
- package/dist/erlang-BxyshZUq.js +0 -4
- package/dist/error-banner-npbEfanI.js +0 -1012
- package/dist/esm-svAVli9f.js +0 -26
- package/dist/factor-CYk6XT8r.js +0 -5
- package/dist/forth-fcoJkd-f.js +0 -4
- package/dist/fortran-IxZHu4wc.js +0 -4
- package/dist/gas-B8rmKcim.js +0 -4
- package/dist/gherkin-BTm-jIdJ.js +0 -4
- package/dist/gitGraph-ZV4HHKMB-DFg_OLQb.js +0 -21
- package/dist/groovy-01kRHFMD.js +0 -4
- package/dist/haskell-B3PhE05w.js +0 -4
- package/dist/haxe-DEoAm8oA.js +0 -5
- package/dist/idl-DsDJU9cV.js +0 -4
- package/dist/info-63CPKGFF-D3DZmDBa.js +0 -21
- package/dist/infoDiagram-STP46IZ2-ec08vi_U.js +0 -44
- package/dist/javascript-gwczVhuU.js +0 -5
- package/dist/jinja2-AkZRdFk3.js +0 -4
- package/dist/julia-_s6qe3bf.js +0 -4
- package/dist/livescript-CwPHQdv5.js +0 -4
- package/dist/lua-s7nRxkCP.js +0 -4
- package/dist/mathematica-Ci36yd1q.js +0 -4
- package/dist/mbox-DbOYMNCO.js +0 -4
- package/dist/mirc-VmNe8AwF.js +0 -4
- package/dist/mllike-BdD7SJEa.js +0 -6
- package/dist/modelica-BA4VqzC3.js +0 -4
- package/dist/mscgen-DF-5WHJm.js +0 -6
- package/dist/mumps-c_Uia_QN.js +0 -4
- package/dist/nsis-BAANGODV.js +0 -5
- package/dist/ntriples-Bslqh2Ki.js +0 -4
- package/dist/octave-DYn5ltia.js +0 -4
- package/dist/oz-B_N-StZq.js +0 -4
- package/dist/packet-HUATNLJX-CkqjFdAv.js +0 -21
- package/dist/pascal-DU4CtAUu.js +0 -4
- package/dist/perl-Bae6k32u.js +0 -4
- package/dist/pie-WTHONI2E-D0rWwX5P.js +0 -21
- package/dist/pig-DSIxUEgX.js +0 -4
- package/dist/powershell-31lcPgIF.js +0 -4
- package/dist/properties-lmYbntDG.js +0 -4
- package/dist/protobuf-BTYoCEpV.js +0 -4
- package/dist/pug-DMFM7zzO.js +0 -5
- package/dist/puppet-B0ub07d-.js +0 -4
- package/dist/python-C4jT87Nt.js +0 -5
- package/dist/q-YbPYlqRI.js +0 -4
- package/dist/r-OfNu6HAI.js +0 -4
- package/dist/radar-NJJJXTRR-Bxqv4O5a.js +0 -21
- package/dist/rpm-D_3b5peD.js +0 -5
- package/dist/ruby-CehsJy_T.js +0 -4
- package/dist/sas-DwQHzPoF.js +0 -4
- package/dist/scheme-B6ArxiQu.js +0 -4
- package/dist/shell-AHmQgDfc.js +0 -4
- package/dist/sieve-CgodKOcx.js +0 -4
- package/dist/smalltalk-BeFzDkbo.js +0 -4
- package/dist/sparql-BWxq-Lnx.js +0 -4
- package/dist/stateDiagram-v2-UMBNRL4Z-D9v8fKjF.js +0 -38
- package/dist/stex-Dvaq0qsm.js +0 -5
- package/dist/stylus-Ge0ofWlZ.js +0 -4
- package/dist/swift-CjQfbVxV.js +0 -4
- package/dist/tcl-CAGDF11K.js +0 -4
- package/dist/textile-CrXreJtf.js +0 -4
- package/dist/toml-AdLXKwEi.js +0 -4
- package/dist/treemap-75Q7IDZK-Da9Jv6a_.js +0 -21
- package/dist/troff-C-LaM2ex.js +0 -4
- package/dist/ttcn-DTclUi6T.js +0 -4
- package/dist/ttcn-cfg-BtBPbmLX.js +0 -4
- package/dist/turtle-BODDDg5O.js +0 -4
- package/dist/vb-Cb1HQHii.js +0 -4
- package/dist/vbscript-CpXOP4wZ.js +0 -4
- package/dist/velocity-Dz0rBQIk.js +0 -4
- package/dist/verilog-6Di9aLKw.js +0 -4
- package/dist/vhdl-BRNesXYc.js +0 -4
- package/dist/webidl-BpRNYIYn.js +0 -4
- package/dist/xquery-DXWcJ7b6.js +0 -4
- package/dist/yacas-DbSARPz4.js +0 -4
- package/dist/z80-DzslPj_l.js +0 -4
- package/src/core/codemirror/language/__tests__/ast.test.ts +0 -124
- package/src/core/codemirror/language/utils/ast.ts +0 -84
- package/src/core/codemirror/language/utils/quotes.ts +0 -18
- /package/dist/{_arrayReduce-CVwxyrBP.js → _arrayReduce-Cd9xQjbl.js} +0 -0
- /package/dist/{_baseSlice-OgpvpOOJ.js → _baseSlice-CE9WsQZm.js} +0 -0
- /package/dist/{_hasUnicode-BgIggCqE.js → _hasUnicode-DkEebvtD.js} +0 -0
- /package/dist/{apl-CEHentF4.js → apl-aGhy11IM.js} +0 -0
- /package/dist/{array-aAxy08hN.js → array-DYSXIreg.js} +0 -0
- /package/dist/{asciiarmor-DURYiCS0.js → asciiarmor-DJKJ3Gkn.js} +0 -0
- /package/dist/{asn1-ETAiEoXY.js → asn1-C6f5IeNs.js} +0 -0
- /package/dist/{asterisk-DTpbbXPb.js → asterisk-DB1poX9_.js} +0 -0
- /package/dist/{brainfuck-BWQep-SA.js → brainfuck-Ch9vjun0.js} +0 -0
- /package/dist/{chunk-57QY23SG-0TxCfmy_.js → chunk-57QY23SG-BpXU7ph4.js} +0 -0
- /package/dist/{clike-bzZTreP4.js → clike-Bc2PZzZQ.js} +0 -0
- /package/dist/{clojure-BzFapDkA.js → clojure-B_lpr3zt.js} +0 -0
- /package/dist/{cmake-DvlbIC8x.js → cmake-DaocNF4I.js} +0 -0
- /package/dist/{cobol-BrEI4cPR.js → cobol-suTPtt7c.js} +0 -0
- /package/dist/{coffeescript-B6cvu8mO.js → coffeescript-CPLIvtqJ.js} +0 -0
- /package/dist/{colors-Cr_mZ2aH.js → colors-BXlG8Lmz.js} +0 -0
- /package/dist/{common-keywords-WqQm7W8t.js → common-keywords-Bhll7O3b.js} +0 -0
- /package/dist/{commonlisp-BIT8PQqi.js → commonlisp-BqM3qFK7.js} +0 -0
- /package/dist/{crystal-B_UcPArT.js → crystal-AsSFu4ke.js} +0 -0
- /package/dist/{css-dHbnt_zl.js → css-Df7Sdeyh.js} +0 -0
- /package/dist/{cypher-Dh3FOpL7.js → cypher-CaVKL6Gu.js} +0 -0
- /package/dist/{cytoscape.esm-BTpRoPd2.js → cytoscape.esm-BFEMljQI.js} +0 -0
- /package/dist/{d-CQD1IHee.js → d-DCGWK7NQ.js} +0 -0
- /package/dist/{defaultLocale-BAgEOGks.js → defaultLocale-CYgZlqDF.js} +0 -0
- /package/dist/{defaultLocale-471SYAPk.js → defaultLocale-Cto8YOmX.js} +0 -0
- /package/dist/{diff-CpF_IDx0.js → diff-CsxOM4Tr.js} +0 -0
- /package/dist/{dist-CK8Gj3GX.js → dist-C76MUPD3.js} +0 -0
- /package/dist/{dtd-DYoNpy6c.js → dtd-Dwr0Jmks.js} +0 -0
- /package/dist/{duckdb-keywords-CdIsl9L0.js → duckdb-keywords-7wAWf848.js} +0 -0
- /package/dist/{dylan-Bc_2G1E-.js → dylan-A7-ZBSey.js} +0 -0
- /package/dist/{ebnf-jGVT_YpN.js → ebnf-9_SaGDUz.js} +0 -0
- /package/dist/{ecl-UIU-P-Ar.js → ecl-BzJVIQDc.js} +0 -0
- /package/dist/{eiffel-C90Oyuix.js → eiffel-CO9eC_Op.js} +0 -0
- /package/dist/{elm-B9fWSySj.js → elm-CVAWj8SB.js} +0 -0
- /package/dist/{emotion-is-prop-valid.esm-BHMWayAG.js → emotion-is-prop-valid.esm-C3Yi5GQt.js} +0 -0
- /package/dist/{erlang-Ccff0UAn.js → erlang-DWbZP546.js} +0 -0
- /package/dist/{fcl-CGR8NxAg.js → fcl-CM9t2iay.js} +0 -0
- /package/dist/{forth-U1ROGcBY.js → forth-BTYqUuu3.js} +0 -0
- /package/dist/{fortran-3nOkjDmc.js → fortran-DgAjHcCq.js} +0 -0
- /package/dist/{gas-B_4H5FzV.js → gas-BjDSWPZd.js} +0 -0
- /package/dist/{gherkin-B0eru5Uz.js → gherkin-ClRqqpKv.js} +0 -0
- /package/dist/{groovy-dqjtZUVf.js → groovy-BzNjnc8x.js} +0 -0
- /package/dist/{haskell-DFzCCQzo.js → haskell-DLdk34Jq.js} +0 -0
- /package/dist/{haxe-Da8Pj5RT.js → haxe-l6gaY_IS.js} +0 -0
- /package/dist/{http-1HACL_9s.js → http-6Qg7z_h2.js} +0 -0
- /package/dist/{idl-D3NXs5iM.js → idl-hlWT4D26.js} +0 -0
- /package/dist/{init-D6eDd7H0.js → init-tZ42Torz.js} +0 -0
- /package/dist/{isArrayLikeObject-BlvK28do.js → isArrayLikeObject-DU5MCuQM.js} +0 -0
- /package/dist/{javascript-BfCTmOnk.js → javascript-DGukg1sB.js} +0 -0
- /package/dist/{jinja2-gBHAxUdF.js → jinja2-DI5k_Er3.js} +0 -0
- /package/dist/{julia-bG-6nJ-_.js → julia-BvDZDiIT.js} +0 -0
- /package/dist/{katex-mkWmhPUh.js → katex-DgfMWJY9.js} +0 -0
- /package/dist/{livescript-BlsRC8UJ.js → livescript-2YMQfkfI.js} +0 -0
- /package/dist/{lua-BbDC0_5w.js → lua-DIUrQRfA.js} +0 -0
- /package/dist/{main-Czi9-LVy.js → main-BMTpe7M0.js} +0 -0
- /package/dist/{marked.esm-DJM8la36.js → marked.esm-DkVwEwtO.js} +0 -0
- /package/dist/{math-C7wLpe9K.js → math-qsHyz2Eo.js} +0 -0
- /package/dist/{mathematica-YZTe3-PF.js → mathematica-Dqmg_BwL.js} +0 -0
- /package/dist/{mbox-CY5idp08.js → mbox-Cng-P-F1.js} +0 -0
- /package/dist/{mirc-CbQuFZKk.js → mirc-CNDqOVhQ.js} +0 -0
- /package/dist/{mllike-DsbHMX-5.js → mllike-C1n2UDyX.js} +0 -0
- /package/dist/{modelica-CQuvsOQk.js → modelica-QqQC2pFj.js} +0 -0
- /package/dist/{mscgen-LIpBP9VR.js → mscgen-C3fl8uhp.js} +0 -0
- /package/dist/{mumps-Ct5NXoaG.js → mumps-BeCUbMej.js} +0 -0
- /package/dist/{nginx-Dvc62C8z.js → nginx-ejv7DsBz.js} +0 -0
- /package/dist/{node-sql-parser-BqKV-TpL.js → node-sql-parser-CoPWN4hn.js} +0 -0
- /package/dist/{ntriples-jVkxWUuv.js → ntriples-CUgUpcma.js} +0 -0
- /package/dist/{octave-jGOImUB0.js → octave-BD652tGl.js} +0 -0
- /package/dist/{oz-Y0FKDMS2.js → oz-DrRsFa0K.js} +0 -0
- /package/dist/{pascal-BaLtPWWB.js → pascal-hpcx9sVn.js} +0 -0
- /package/dist/{path-VDkDgx1I.js → path-Bbv2tLY1.js} +0 -0
- /package/dist/{perl-CjfE0JLo.js → perl-DW8XHeFc.js} +0 -0
- /package/dist/{pig-DE4epV99.js → pig-Cv7Nxbfo.js} +0 -0
- /package/dist/{powershell-BZx53Ujw.js → powershell-Dr7WZMDU.js} +0 -0
- /package/dist/{prop-types-0wNc-99T.js → prop-types-Bd16OEUP.js} +0 -0
- /package/dist/{properties-CLyCG5C-.js → properties-D-qJDXAM.js} +0 -0
- /package/dist/{protobuf-BjBBs_V4.js → protobuf-B48QZbd3.js} +0 -0
- /package/dist/{puppet-ZImLuomA.js → puppet-15JDyiY2.js} +0 -0
- /package/dist/{python-C9YN71pR.js → python-DWkQA94h.js} +0 -0
- /package/dist/{q-CMoUHJ5Q.js → q-BzRpKgfd.js} +0 -0
- /package/dist/{r-DILmKWWW.js → r-dcNRe_Q8.js} +0 -0
- /package/dist/{range-PcytnUSJ.js → range-CQvYp_qE.js} +0 -0
- /package/dist/{rpm-fpIsm1Kr.js → rpm-Djl3Dsf1.js} +0 -0
- /package/dist/{ruby-BuiQI41h.js → ruby-Dd2CZTip.js} +0 -0
- /package/dist/{sas-C76sJ1zF.js → sas-DYF5_Iqu.js} +0 -0
- /package/dist/{scheme-DHjM-txv.js → scheme-YtWcji1H.js} +0 -0
- /package/dist/{shell--7NmGJ9p.js → shell-C3uC3Y0Z.js} +0 -0
- /package/dist/{sieve-DaPvBv1M.js → sieve-DHB17sQG.js} +0 -0
- /package/dist/{simple-mode-BP3Jd4vf.js → simple-mode-BMmwP_vI.js} +0 -0
- /package/dist/{smalltalk-KPvwrjCs.js → smalltalk-Y5v1Np3H.js} +0 -0
- /package/dist/{solr-PvZUtEDb.js → solr-DvRJLlRD.js} +0 -0
- /package/dist/{sparql-CXSUIQer.js → sparql-BEt3GJwM.js} +0 -0
- /package/dist/{spreadsheet-DPJdGPkx.js → spreadsheet-Dp4B9_rc.js} +0 -0
- /package/dist/{sql-Dp4ZLSIa.js → sql-DBsUs8nQ.js} +0 -0
- /package/dist/{stex-CeXW4zzk.js → stex-C6-x52ei.js} +0 -0
- /package/dist/{stylus-BXcmrg9w.js → stylus-DroA8via.js} +0 -0
- /package/dist/{swift-DD8I7hKP.js → swift-DR0x1ESK.js} +0 -0
- /package/dist/{tcl-B9Lp4GtA.js → tcl-BeuTFc_c.js} +0 -0
- /package/dist/{textile-qdiY0teq.js → textile-C0ikhHN3.js} +0 -0
- /package/dist/{tiddlywiki-t32lkubq.js → tiddlywiki-C_2Nvsgu.js} +0 -0
- /package/dist/{tiki-B0qKrSMl.js → tiki-CKQlhmQQ.js} +0 -0
- /package/dist/{timer-CzOhIJuk.js → timer-CcUhugb0.js} +0 -0
- /package/dist/{toml-eSl4PUAH.js → toml-BqNUJWRI.js} +0 -0
- /package/dist/{treemap-BpgMKHv-.js → treemap-BYLUKIzA.js} +0 -0
- /package/dist/{troff-105XJOEu.js → troff-DkK0f2ZH.js} +0 -0
- /package/dist/{tslib.es6-DofFyd9S.js → tslib.es6-3ZL768sZ.js} +0 -0
- /package/dist/{ttcn-1_BxDcM8.js → ttcn-Bf8vrg-_.js} +0 -0
- /package/dist/{ttcn-cfg-Cn_XgXiw.js → ttcn-cfg-DjCKzd95.js} +0 -0
- /package/dist/{turtle-BI6LyfEu.js → turtle-SSc84S9m.js} +0 -0
- /package/dist/{vb-BecoBfmr.js → vb-CQ6DC3cL.js} +0 -0
- /package/dist/{vbscript-De-zpA4i.js → vbscript-Dw0gFssg.js} +0 -0
- /package/dist/{velocity-DhlYJTrD.js → velocity-BvJQyBmj.js} +0 -0
- /package/dist/{verilog-BDZgxDOW.js → verilog-CKGAvQjj.js} +0 -0
- /package/dist/{vhdl-CV0OKTbp.js → vhdl-B40_x6fM.js} +0 -0
- /package/dist/{webidl-BOM1Fs0O.js → webidl-Bi9hczCv.js} +0 -0
- /package/dist/{xquery-CltP_CGh.js → xquery-DwWUXvP3.js} +0 -0
- /package/dist/{yacas-Dch4E2Dg.js → yacas-ClUs0mmH.js} +0 -0
- /package/dist/{z80-B5Yly27o.js → z80-DPC4UGzR.js} +0 -0
- /package/dist/{zod-ChY6miG5.js → zod-mAEs2ITo.js} +0 -0
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
/* Copyright 2024 Marimo. All rights reserved. */
|
|
2
|
+
import { describe, expect, test } from "vitest";
|
|
3
|
+
import { sanitizeHtml } from "../sanitize";
|
|
4
|
+
|
|
5
|
+
describe("sanitizeHtml", () => {
|
|
6
|
+
test("renders basic HTML", () => {
|
|
7
|
+
const html = "<h1>Hello World</h1>";
|
|
8
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`"<h1>Hello World</h1>"`);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test("renders nested HTML", () => {
|
|
12
|
+
const html = "<div><p>Paragraph</p><span>Span</span></div>";
|
|
13
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
14
|
+
`"<div><p>Paragraph</p><span>Span</span></div>"`,
|
|
15
|
+
);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test("removes script tags", () => {
|
|
19
|
+
const html = "<div>Hello</div><script>alert('XSS')</script>";
|
|
20
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`"<div>Hello</div>"`);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test("removes inline script in onclick", () => {
|
|
24
|
+
const html = "<button onclick=\"alert('XSS')\">Click me</button>";
|
|
25
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
26
|
+
`"<button>Click me</button>"`,
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test("removes javascript: protocol in href", () => {
|
|
31
|
+
const html = "<a href=\"javascript:alert('XSS')\">Link</a>";
|
|
32
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
33
|
+
`"<a target="_self">Link</a>"`,
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test("removes onerror attribute", () => {
|
|
38
|
+
const html = '<img src="x" onerror="alert(\'XSS\')" />';
|
|
39
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`"<img src="x">"`);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test("keeps form tags but removes action attribute", () => {
|
|
43
|
+
const html = '<form action="/submit"><input type="text"/></form>';
|
|
44
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
45
|
+
`"<form action="/submit"><input type="text"></form>"`,
|
|
46
|
+
);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test("removes iframe tags", () => {
|
|
50
|
+
const html = '<iframe src="https://evil.com"></iframe>';
|
|
51
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`""`);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test("removes embed tags", () => {
|
|
55
|
+
const html = '<embed src="https://evil.com" />';
|
|
56
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`""`);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test("removes object tags", () => {
|
|
60
|
+
const html = '<object data="https://evil.com"></object>';
|
|
61
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`""`);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
test("preserves safe anchor with target=_blank", () => {
|
|
65
|
+
const html = '<a href="https://example.com" target="_blank">Link</a>';
|
|
66
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
67
|
+
`"<a href="https://example.com" target="_blank" rel="noopener">Link</a>"`,
|
|
68
|
+
);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test("adds target=_self to anchor without target", () => {
|
|
72
|
+
const html = '<a href="https://example.com">Link</a>';
|
|
73
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
74
|
+
`"<a href="https://example.com" target="_self">Link</a>"`,
|
|
75
|
+
);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
test("preserves target=_self on anchor", () => {
|
|
79
|
+
const html = '<a href="https://example.com" target="_self">Link</a>';
|
|
80
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
81
|
+
`"<a href="https://example.com" target="_self">Link</a>"`,
|
|
82
|
+
);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test("preserves target=_parent on anchor", () => {
|
|
86
|
+
const html = '<a href="https://example.com" target="_parent">Link</a>';
|
|
87
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
88
|
+
`"<a href="https://example.com" target="_parent">Link</a>"`,
|
|
89
|
+
);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
test("preserves SVG elements", () => {
|
|
93
|
+
const html =
|
|
94
|
+
'<svg width="100" height="100"><circle cx="50" cy="50" r="40" /></svg>';
|
|
95
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
96
|
+
`"<svg width="100" height="100"><circle cx="50" cy="50" r="40"></circle></svg>"`,
|
|
97
|
+
);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
test("removes script from SVG", () => {
|
|
101
|
+
const html = '<svg><script>alert("XSS")</script><circle r="10" /></svg>';
|
|
102
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
103
|
+
`"<svg><circle r="10"></circle></svg>"`,
|
|
104
|
+
);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
test("preserves MathML", () => {
|
|
108
|
+
const html = "<math><mi>x</mi><mo>=</mo><mn>2</mn></math>";
|
|
109
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
110
|
+
`"<math><mi>x</mi><mo>=</mo><mn>2</mn></math>"`,
|
|
111
|
+
);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
test("preserves custom marimo elements", () => {
|
|
115
|
+
const html = '<marimo-slider value="50"></marimo-slider>';
|
|
116
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
117
|
+
`"<marimo-slider value="50"></marimo-slider>"`,
|
|
118
|
+
);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
test("preserves marimo elements with valid naming", () => {
|
|
122
|
+
const html = "<marimo-custom-element></marimo-custom-element>";
|
|
123
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
124
|
+
`"<marimo-custom-element></marimo-custom-element>"`,
|
|
125
|
+
);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
test("removes invalid custom elements (not marimo-*)", () => {
|
|
129
|
+
const html = "<custom-element>Content</custom-element>";
|
|
130
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`"Content"`);
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
test("keeps style tags with FORCE_BODY", () => {
|
|
134
|
+
const html = "<style>body { color: red; }</style><p>Text</p>";
|
|
135
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
136
|
+
`"<style>body { color: red; }</style><p>Text</p>"`,
|
|
137
|
+
);
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
test("removes link tags", () => {
|
|
141
|
+
const html = '<link rel="stylesheet" href="evil.css" /><p>Text</p>';
|
|
142
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`"<p>Text</p>"`);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
test("removes meta tags", () => {
|
|
146
|
+
const html = '<meta http-equiv="refresh" content="0;url=evil.com" />';
|
|
147
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`""`);
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
test("removes base tags", () => {
|
|
151
|
+
const html = '<base href="https://evil.com" /><p>Text</p>';
|
|
152
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`"<p>Text</p>"`);
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
test("preserves safe HTML entities", () => {
|
|
156
|
+
const html = "<p><div> & "quotes"</p>";
|
|
157
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
158
|
+
`"<p><div> & "quotes"</p>"`,
|
|
159
|
+
);
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
test("preserves data attributes", () => {
|
|
163
|
+
const html = '<div data-id="123" data-name="test">Content</div>';
|
|
164
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
165
|
+
`"<div data-id="123" data-name="test">Content</div>"`,
|
|
166
|
+
);
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
test("preserves aria attributes", () => {
|
|
170
|
+
const html = '<button aria-label="Close" aria-hidden="true">X</button>';
|
|
171
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
172
|
+
`"<button aria-label="Close" aria-hidden="true">X</button>"`,
|
|
173
|
+
);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
test("preserves class and id attributes", () => {
|
|
177
|
+
const html = '<div id="main" class="container primary">Content</div>';
|
|
178
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
179
|
+
`"<div id="main" class="container primary">Content</div>"`,
|
|
180
|
+
);
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
test("removes dangerous event handlers", () => {
|
|
184
|
+
const html =
|
|
185
|
+
'<div onload="alert(1)" onmouseover="alert(2)" onfocus="alert(3)">Text</div>';
|
|
186
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`"<div>Text</div>"`);
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
test("handles empty string", () => {
|
|
190
|
+
const html = "";
|
|
191
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`""`);
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
test("handles text without tags", () => {
|
|
195
|
+
const html = "Just plain text";
|
|
196
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`"Just plain text"`);
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
test("handles malformed HTML", () => {
|
|
200
|
+
const html = "<div><p>Unclosed div";
|
|
201
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
202
|
+
`"<div><p>Unclosed div</p></div>"`,
|
|
203
|
+
);
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
test("removes data URIs with javascript", () => {
|
|
207
|
+
const html = '<a href="data:text/html,<script>alert(1)</script>">Link</a>';
|
|
208
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
209
|
+
`"<a target="_self">Link</a>"`,
|
|
210
|
+
);
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
test("preserves safe data URIs", () => {
|
|
214
|
+
const html = '<img src="data:image/png;base64,iVBORw0KGgo=" />';
|
|
215
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
216
|
+
`"<img src="data:image/png;base64,iVBORw0KGgo=">"`,
|
|
217
|
+
);
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
test("removes srcdoc attribute from iframe", () => {
|
|
221
|
+
const html = '<iframe srcdoc="<script>alert(1)</script>"></iframe>';
|
|
222
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`""`);
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
test("handles complex nested structure", () => {
|
|
226
|
+
const html = `
|
|
227
|
+
<div class="container">
|
|
228
|
+
<header>
|
|
229
|
+
<h1>Title</h1>
|
|
230
|
+
<nav><a href="/home">Home</a></nav>
|
|
231
|
+
</header>
|
|
232
|
+
<main>
|
|
233
|
+
<article>
|
|
234
|
+
<p>Content</p>
|
|
235
|
+
</article>
|
|
236
|
+
</main>
|
|
237
|
+
</div>
|
|
238
|
+
`;
|
|
239
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`
|
|
240
|
+
"
|
|
241
|
+
<div class="container">
|
|
242
|
+
<header>
|
|
243
|
+
<h1>Title</h1>
|
|
244
|
+
<nav><a href="/home" target="_self">Home</a></nav>
|
|
245
|
+
</header>
|
|
246
|
+
<main>
|
|
247
|
+
<article>
|
|
248
|
+
<p>Content</p>
|
|
249
|
+
</article>
|
|
250
|
+
</main>
|
|
251
|
+
</div>
|
|
252
|
+
"
|
|
253
|
+
`);
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
test("keeps marquee and blink tags (not considered dangerous by DOMPurify)", () => {
|
|
257
|
+
const html = "<marquee>Scrolling text</marquee><blink>Blinking</blink>";
|
|
258
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
259
|
+
`"<marquee>Scrolling text</marquee><blink>Blinking</blink>"`,
|
|
260
|
+
);
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
test("preserves table structures", () => {
|
|
264
|
+
const html = "<table><tr><td>Cell 1</td><td>Cell 2</td></tr></table>";
|
|
265
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
266
|
+
`"<table><tbody><tr><td>Cell 1</td><td>Cell 2</td></tr></tbody></table>"`,
|
|
267
|
+
);
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
test("removes xml-stylesheet processing instructions", () => {
|
|
271
|
+
const html =
|
|
272
|
+
'<?xml-stylesheet href="evil.xsl" type="text/xsl"?><div>Text</div>';
|
|
273
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`"<div>Text</div>"`);
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
test("removes use element from SVG", () => {
|
|
277
|
+
const html = '<svg><use xlink:href="#icon"></use></svg>';
|
|
278
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`"<svg></svg>"`);
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
test("removes javascript in SVG href", () => {
|
|
282
|
+
const html =
|
|
283
|
+
'<svg><a href="javascript:alert(1)"><text>Click</text></a></svg>';
|
|
284
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
285
|
+
`"<svg><a><text>Click</text></a></svg>"`,
|
|
286
|
+
);
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
test("preserves img with valid src", () => {
|
|
290
|
+
const html = '<img src="https://example.com/image.png" alt="Image" />';
|
|
291
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
292
|
+
`"<img src="https://example.com/image.png" alt="Image">"`,
|
|
293
|
+
);
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
test("handles multiple scripts interleaved", () => {
|
|
297
|
+
const html =
|
|
298
|
+
"<div>Text1</div><script>evil1()</script><p>Text2</p><script>evil2()</script>";
|
|
299
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
300
|
+
`"<div>Text1</div><p>Text2</p>"`,
|
|
301
|
+
);
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
test("removes frameset and frame tags", () => {
|
|
305
|
+
const html = '<frameset><frame src="page.html" /></frameset>';
|
|
306
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`""`);
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
test("handles vbscript: protocol", () => {
|
|
310
|
+
const html = '<a href="vbscript:msgbox()">Link</a>';
|
|
311
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
312
|
+
`"<a target="_self">Link</a>"`,
|
|
313
|
+
);
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
test("removes autofocus and onfocus from input", () => {
|
|
317
|
+
const html = '<input type="hidden" autofocus onfocus="alert(1)" />';
|
|
318
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`"<input type="hidden">"`);
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
test("removes formaction attribute", () => {
|
|
322
|
+
const html = '<button formaction="javascript:alert(1)">Click</button>';
|
|
323
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
324
|
+
`"<button>Click</button>"`,
|
|
325
|
+
);
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
test("handles nested script-like content", () => {
|
|
329
|
+
const html = "<div><script>alert(1)</script></div>";
|
|
330
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
331
|
+
`"<div><script>alert(1)</script></div>"`,
|
|
332
|
+
);
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
test("preserves valid inline styles", () => {
|
|
336
|
+
const html = '<div style="color: blue; font-size: 14px;">Styled</div>';
|
|
337
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
338
|
+
`"<div style="color: blue; font-size: 14px;">Styled</div>"`,
|
|
339
|
+
);
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
test("keeps expression() in styles (legacy IE only)", () => {
|
|
343
|
+
const html = '<div style="width: expression(alert(1));">Text</div>';
|
|
344
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
345
|
+
`"<div style="width: expression(alert(1));">Text</div>"`,
|
|
346
|
+
);
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
test("keeps moz-binding in styles (legacy Firefox only)", () => {
|
|
350
|
+
const html = '<div style="-moz-binding: url(xss.xml#xss)">Text</div>';
|
|
351
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
352
|
+
`"<div style="-moz-binding: url(xss.xml#xss)">Text</div>"`,
|
|
353
|
+
);
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
test("preserves title and alt attributes", () => {
|
|
357
|
+
const html = '<img src="pic.jpg" alt="Picture" title="A nice picture" />';
|
|
358
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
359
|
+
`"<img src="pic.jpg" alt="Picture" title="A nice picture">"`,
|
|
360
|
+
);
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
test("handles multiple targets on links", () => {
|
|
364
|
+
const html = '<a href="/" target="_top">Link</a>';
|
|
365
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
366
|
+
`"<a href="/" target="_top">Link</a>"`,
|
|
367
|
+
);
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
test("removes on* attributes comprehensively", () => {
|
|
371
|
+
const html =
|
|
372
|
+
'<div onabort="alert(1)" onblur="alert(2)" onchange="alert(3)" ondblclick="alert(4)">Text</div>';
|
|
373
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`"<div>Text</div>"`);
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
test("removes SVG foreignObject", () => {
|
|
377
|
+
const html =
|
|
378
|
+
"<svg><foreignObject><body><p>Text</p></body></foreignObject></svg>";
|
|
379
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`"<svg></svg>"`);
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
test("removes xlink:href with javascript in SVG", () => {
|
|
383
|
+
const html = '<svg><a xlink:href="javascript:alert(1)">Click</a></svg>';
|
|
384
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
385
|
+
`"<svg><a>Click</a></svg>"`,
|
|
386
|
+
);
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
test("preserves role attributes", () => {
|
|
390
|
+
const html = '<div role="button" tabindex="0">Clickable</div>';
|
|
391
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
392
|
+
`"<div role="button" tabindex="0">Clickable</div>"`,
|
|
393
|
+
);
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
test("handles HTML comments", () => {
|
|
397
|
+
const html = "<!-- Comment --><p>Text</p>";
|
|
398
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`"<p>Text</p>"`);
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
test("removes conditional comments", () => {
|
|
402
|
+
const html = "<!--[if IE]><script>alert(1)</script><![endif]--><p>Text</p>";
|
|
403
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`"<p>Text</p>"`);
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
test("preserves pre and code elements", () => {
|
|
407
|
+
const html = "<pre><code>const x = 1;</code></pre>";
|
|
408
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
409
|
+
`"<pre><code>const x = 1;</code></pre>"`,
|
|
410
|
+
);
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
test("handles mixed content with scripts", () => {
|
|
414
|
+
const html =
|
|
415
|
+
"<div><p>Safe</p><script>evil()</script><p>More safe</p></div>";
|
|
416
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
417
|
+
`"<div><p>Safe</p><p>More safe</p></div>"`,
|
|
418
|
+
);
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
test("preserves video and audio elements", () => {
|
|
422
|
+
const html = '<video src="video.mp4" controls></video>';
|
|
423
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
424
|
+
`"<video src="video.mp4" controls=""></video>"`,
|
|
425
|
+
);
|
|
426
|
+
});
|
|
427
|
+
|
|
428
|
+
test("handles source elements in video", () => {
|
|
429
|
+
const html =
|
|
430
|
+
'<video controls><source src="video.mp4" type="video/mp4" /></video>';
|
|
431
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
432
|
+
`"<video controls=""><source src="video.mp4" type="video/mp4"></video>"`,
|
|
433
|
+
);
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
test("removes import statement in style", () => {
|
|
437
|
+
const html = '<style>@import url("evil.css");</style>';
|
|
438
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
439
|
+
`"<style>@import url("evil.css");</style>"`,
|
|
440
|
+
);
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
test("handles HTML5 semantic elements", () => {
|
|
444
|
+
const html =
|
|
445
|
+
"<article><section><header>Title</header><footer>Footer</footer></section></article>";
|
|
446
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
447
|
+
`"<article><section><header>Title</header><footer>Footer</footer></section></article>"`,
|
|
448
|
+
);
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
test("preserves canvas element", () => {
|
|
452
|
+
const html = '<canvas id="myCanvas" width="200" height="100"></canvas>';
|
|
453
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
454
|
+
`"<canvas id="myCanvas" width="200" height="100"></canvas>"`,
|
|
455
|
+
);
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
test("handles details and summary elements", () => {
|
|
459
|
+
const html =
|
|
460
|
+
"<details><summary>Click me</summary><p>Hidden content</p></details>";
|
|
461
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
462
|
+
`"<details><summary>Click me</summary><p>Hidden content</p></details>"`,
|
|
463
|
+
);
|
|
464
|
+
});
|
|
465
|
+
});
|
|
@@ -362,7 +362,20 @@ export function registerReactComponent<T>(plugin: IPlugin<T, unknown>): void {
|
|
|
362
362
|
* Get the children of the element as React nodes.
|
|
363
363
|
*/
|
|
364
364
|
private getChildren(): React.ReactNode {
|
|
365
|
-
|
|
365
|
+
// We don't sanitize the HTML here because it could be an iframe inside of tabs or accordions
|
|
366
|
+
// If we have multiple children, we need to render each one separately
|
|
367
|
+
if (this.children.length === 0) {
|
|
368
|
+
return null;
|
|
369
|
+
}
|
|
370
|
+
if (this.children.length === 1) {
|
|
371
|
+
return renderHTML({ html: this.innerHTML, alwaysSanitizeHtml: false });
|
|
372
|
+
}
|
|
373
|
+
// Multiple children - render each one
|
|
374
|
+
return Array.from(this.children).map((child, index) => (
|
|
375
|
+
<React.Fragment key={index}>
|
|
376
|
+
{renderHTML({ html: child.outerHTML, alwaysSanitizeHtml: false })}
|
|
377
|
+
</React.Fragment>
|
|
378
|
+
));
|
|
366
379
|
}
|
|
367
380
|
|
|
368
381
|
/**
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/* Copyright 2024 Marimo. All rights reserved. */
|
|
2
|
+
import DOMPurify, { type Config } from "dompurify";
|
|
3
|
+
import { atom, useAtomValue } from "jotai";
|
|
4
|
+
import { hasRunAnyCellAtom } from "@/components/editor/cell/useRunCells";
|
|
5
|
+
import { getInitialAppMode } from "@/core/mode";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Whether to sanitize the html.
|
|
9
|
+
* When running as an app or with auto_instantiate enabled
|
|
10
|
+
* we ignore sanitization because they should be treated as a website.
|
|
11
|
+
*/
|
|
12
|
+
const sanitizeHtmlAtom = atom<boolean>((get) => {
|
|
13
|
+
const hasRunAnyCell = get(hasRunAnyCellAtom);
|
|
14
|
+
|
|
15
|
+
// If a user has specifically run at least one cell, we don't need to sanitize.
|
|
16
|
+
// HTML needs to be rich to allow for interactive widgets and other dynamic content.
|
|
17
|
+
if (hasRunAnyCell) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const isInAppMode = getInitialAppMode() === "read";
|
|
22
|
+
// Apps need to run javascript and load external resources.
|
|
23
|
+
if (isInAppMode) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return true;
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Whether to sanitize the html.
|
|
32
|
+
*/
|
|
33
|
+
export function useSanitizeHtml() {
|
|
34
|
+
return useAtomValue(sanitizeHtmlAtom);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// preserve target=_blank https://github.com/cure53/DOMPurify/issues/317#issuecomment-912474068
|
|
38
|
+
const TEMPORARY_ATTRIBUTE = "data-temp-href-target";
|
|
39
|
+
DOMPurify.addHook("beforeSanitizeAttributes", (node) => {
|
|
40
|
+
if (node.tagName === "A") {
|
|
41
|
+
if (!node.hasAttribute("target")) {
|
|
42
|
+
node.setAttribute("target", "_self");
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (node.hasAttribute("target")) {
|
|
46
|
+
node.setAttribute(TEMPORARY_ATTRIBUTE, node.getAttribute("target") || "");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
DOMPurify.addHook("afterSanitizeAttributes", (node) => {
|
|
52
|
+
if (node.tagName === "A" && node.hasAttribute(TEMPORARY_ATTRIBUTE)) {
|
|
53
|
+
node.setAttribute("target", node.getAttribute(TEMPORARY_ATTRIBUTE) || "");
|
|
54
|
+
node.removeAttribute(TEMPORARY_ATTRIBUTE);
|
|
55
|
+
if (node.getAttribute("target") === "_blank") {
|
|
56
|
+
node.setAttribute("rel", "noopener");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* This removes script tags, form tags, iframe tags, and other potentially dangerous tags
|
|
63
|
+
*/
|
|
64
|
+
export function sanitizeHtml(html: string) {
|
|
65
|
+
const sanitizationOptions: Config = {
|
|
66
|
+
// Default to permit HTML, SVG and MathML, this limits to HTML only
|
|
67
|
+
USE_PROFILES: { html: true, svg: true, mathMl: true },
|
|
68
|
+
// glue elements like style, script or others to document.body and prevent unintuitive browser behavior in several edge-cases
|
|
69
|
+
FORCE_BODY: true,
|
|
70
|
+
CUSTOM_ELEMENT_HANDLING: {
|
|
71
|
+
tagNameCheck: /^marimo-[A-Za-z][\w-]*$/,
|
|
72
|
+
attributeNameCheck: /^[A-Za-z][\w-]*$/,
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
return DOMPurify.sanitize(html, sanitizationOptions);
|
|
76
|
+
}
|
|
@@ -475,9 +475,7 @@ export const FileBrowser = ({
|
|
|
475
475
|
selected
|
|
476
476
|
</span>
|
|
477
477
|
<button
|
|
478
|
-
className={cn(
|
|
479
|
-
"text-xs text-destructive hover:underline cursor-pointer",
|
|
480
|
-
)}
|
|
478
|
+
className={cn("text-xs text-destructive hover:underline")}
|
|
481
479
|
onClick={() => setValue([])}
|
|
482
480
|
type="button"
|
|
483
481
|
>
|
|
@@ -210,9 +210,7 @@ export const FileUpload = (props: FileUploadProps): JSX.Element => {
|
|
|
210
210
|
</Tooltip>
|
|
211
211
|
|
|
212
212
|
<button
|
|
213
|
-
className={cn(
|
|
214
|
-
"text-xs cursor-pointer text-destructive hover:underline",
|
|
215
|
-
)}
|
|
213
|
+
className={cn("text-xs text-destructive hover:underline")}
|
|
216
214
|
onClick={() => setValue([])}
|
|
217
215
|
type="button"
|
|
218
216
|
>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/* Copyright 2024 Marimo. All rights reserved. */
|
|
2
2
|
|
|
3
3
|
import { render } from "@testing-library/react";
|
|
4
|
-
import { describe, expect, it } from "vitest";
|
|
4
|
+
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
|
+
import { initialModeAtom } from "@/core/mode";
|
|
6
|
+
import { store } from "@/core/state/jotai";
|
|
5
7
|
import type { IPluginProps } from "../../types";
|
|
6
8
|
import { DateTimePickerPlugin } from "../DateTimePickerPlugin";
|
|
7
9
|
|
|
@@ -13,6 +15,11 @@ interface DateTimeData {
|
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
describe("DateTimePickerPlugin", () => {
|
|
18
|
+
beforeEach(() => {
|
|
19
|
+
vi.resetAllMocks();
|
|
20
|
+
store.set(initialModeAtom, "edit");
|
|
21
|
+
});
|
|
22
|
+
|
|
16
23
|
it("should render when initial value is not provided", () => {
|
|
17
24
|
const plugin = new DateTimePickerPlugin();
|
|
18
25
|
// Create a host element as required by IPluginProps
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
import { fireEvent, render, screen } from "@testing-library/react";
|
|
4
4
|
import { beforeAll, describe, expect, it, vi } from "vitest";
|
|
5
5
|
import type { z } from "zod";
|
|
6
|
+
import { initialModeAtom } from "@/core/mode";
|
|
7
|
+
import { store } from "@/core/state/jotai";
|
|
6
8
|
import type { IPluginProps } from "../../types";
|
|
7
9
|
import { DropdownPlugin } from "../DropdownPlugin";
|
|
8
10
|
|
|
@@ -24,6 +26,10 @@ beforeAll(() => {
|
|
|
24
26
|
});
|
|
25
27
|
|
|
26
28
|
describe("DropdownPlugin", () => {
|
|
29
|
+
beforeAll(() => {
|
|
30
|
+
store.set(initialModeAtom, "edit");
|
|
31
|
+
});
|
|
32
|
+
|
|
27
33
|
describe("searchable dropdown", () => {
|
|
28
34
|
it("renders SearchableSelect when searchable is true", () => {
|
|
29
35
|
const plugin = new DropdownPlugin();
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
/* Copyright 2024 Marimo. All rights reserved. */
|
|
2
|
-
import { expect, it } from "vitest";
|
|
2
|
+
import { beforeEach, expect, it, vi } from "vitest";
|
|
3
|
+
import { initialModeAtom } from "@/core/mode";
|
|
4
|
+
import { store } from "@/core/state/jotai";
|
|
3
5
|
import { multiselectFilterFn } from "../multiselectFilterFn";
|
|
4
6
|
|
|
5
7
|
function filterOptions(filter: string, items: string[]) {
|
|
6
8
|
return items.filter((option) => multiselectFilterFn(option, filter));
|
|
7
9
|
}
|
|
8
10
|
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
vi.resetAllMocks();
|
|
13
|
+
store.set(initialModeAtom, "edit");
|
|
14
|
+
});
|
|
15
|
+
|
|
9
16
|
it("can filter to relevant words", () => {
|
|
10
17
|
const options = ["a", "b", "c", "foo", "bar", "foo bar", "foobar"];
|
|
11
18
|
|
|
@@ -3,12 +3,15 @@
|
|
|
3
3
|
import { act, render } from "@testing-library/react";
|
|
4
4
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
5
|
import type { z } from "zod";
|
|
6
|
+
import { initialModeAtom } from "@/core/mode";
|
|
7
|
+
import { store } from "@/core/state/jotai";
|
|
6
8
|
import type { IPluginProps } from "../../types";
|
|
7
9
|
import { NumberPlugin } from "../NumberPlugin";
|
|
8
10
|
|
|
9
11
|
describe("NumberPlugin", () => {
|
|
10
12
|
beforeEach(() => {
|
|
11
13
|
vi.useFakeTimers();
|
|
14
|
+
store.set(initialModeAtom, "edit");
|
|
12
15
|
});
|
|
13
16
|
|
|
14
17
|
afterEach(() => {
|