@marimo-team/frontend 0.16.0-dev96986 → 0.16.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/assets/{ConnectedDataExplorerComponent-CNLoZkWr.js → ConnectedDataExplorerComponent-2wVcyvDj.js} +1 -1
- package/dist/assets/{ImageComparisonComponent-SX7fDaTK.js → ImageComparisonComponent-D2j6i0hv.js} +1 -1
- package/dist/assets/{VegaLite-MJUW3b7C.js → VegaLite-BckFaf2D.js} +1 -1
- package/dist/assets/{_baseEach-9_logFrf.js → _baseEach-CvTX9w0Y.js} +1 -1
- package/dist/assets/_baseMap-CtlwA90f.js +1 -0
- package/dist/assets/{_baseUniq-C5LFcyNC.js → _baseUniq-BKktIGQ1.js} +1 -1
- package/dist/assets/{_createAggregator-ZRm2b6Zm.js → _createAggregator-C5CVY-0t.js} +1 -1
- package/dist/assets/{agent-panel-BBd11wNX.js → agent-panel-RGLNjkYe.js} +1 -1
- package/dist/assets/{any-language-editor-DwAaEQfS.js → any-language-editor-DjuXwGCA.js} +1 -1
- package/dist/assets/{architectureDiagram-W76B3OCA-BJmVXUoW.js → architectureDiagram-W76B3OCA-Dyj4ds_R.js} +1 -1
- package/dist/assets/{between-horizontal-start-KiwU-a3C.js → between-horizontal-start-Dt2aKpPf.js} +1 -1
- package/dist/assets/{blockDiagram-QIGZ2CNN-DzxZjE7B.js → blockDiagram-QIGZ2CNN-o-i7DDvN.js} +1 -1
- package/dist/assets/{c4Diagram-FPNF74CW-DjmldG_J.js → c4Diagram-FPNF74CW-DGHEwWrx.js} +1 -1
- package/dist/assets/channel-Co6iMgWq.js +1 -0
- package/dist/assets/{chat-panel-DgJZr0eS.js → chat-panel-9alr8FS4.js} +1 -1
- package/dist/assets/{chunk-4BX2VUAB-EUTQThiZ.js → chunk-4BX2VUAB-BJecb-Ri.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-DZAiDJxy.js → chunk-55IACEB6-CAATkc4w.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-Bd0Czs-J.js → chunk-FMBD7UC4-DPuNbQ-f.js} +1 -1
- package/dist/assets/{chunk-K7UQS3LO-DEKMIknX.js → chunk-K7UQS3LO-C8TWVLiH.js} +1 -1
- package/dist/assets/{chunk-QN33PNHL-E0jwHU_n.js → chunk-QN33PNHL-DiZZ09q4.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-BzaIHJbq.js → chunk-QZHKN3VN-BIUM7usu.js} +1 -1
- package/dist/assets/{chunk-TVAH2DTR-CZFYvqnm.js → chunk-TVAH2DTR-vGTArPBG.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-BNqnFjtv.js → chunk-TZMSLE5B-D2KRqp_x.js} +1 -1
- package/dist/assets/{circle-play-D3J_mYrF.js → circle-play-cjeNez0N.js} +1 -1
- package/dist/assets/classDiagram-KNZD7YFC-BbJ0rY3y.js +1 -0
- package/dist/assets/classDiagram-v2-RKCZMP56-BbJ0rY3y.js +1 -0
- package/dist/assets/{clear-button-ifzRuAR3.js → clear-button-C97JtAez.js} +1 -1
- package/dist/assets/clone-BMP0PsTa.js +1 -0
- package/dist/assets/{command-palette-D2fdVSET.js → command-palette-B93Pjcky.js} +1 -1
- package/dist/assets/{common-Ku-cF_2J.js → common-Du9rSOwD.js} +1 -1
- package/dist/assets/{compile-BgZlHW1c.js → compile-CZXqyOxa.js} +1 -1
- package/dist/assets/{cose-bilkent-S5V4N54A-CVM83SqK.js → cose-bilkent-S5V4N54A-CqUN5Y9b.js} +1 -1
- package/dist/assets/{dagre-5GWH7T2D-ouQPkxT3.js → dagre-5GWH7T2D-RJqTI9DM.js} +1 -1
- package/dist/assets/{data-grid-overlay-editor-B47j5GJJ.js → data-grid-overlay-editor-DZN0q1LV.js} +1 -1
- package/dist/assets/{datasources-panel-Bt41Zir-.js → datasources-panel-v7H3cR0p.js} +1 -1
- package/dist/assets/{dependency-graph-panel-CZC_B7pK.js → dependency-graph-panel-CEog_O7V.js} +1 -1
- package/dist/assets/{diagram-N5W7TBWH-CQ817ZdR.js → diagram-N5W7TBWH-D-l4zZ9d.js} +1 -1
- package/dist/assets/{diagram-QEK2KX5R-DOK_psUO.js → diagram-QEK2KX5R-CCOmBUt-.js} +1 -1
- package/dist/assets/{diagram-S2PKOQOG-CVljmOW8.js → diagram-S2PKOQOG-C_I_9jnZ.js} +1 -1
- package/dist/assets/{documentation-panel-C7yIvGg1.js → documentation-panel-C1BtMZ3M.js} +1 -1
- package/dist/assets/{edit-page-CyTMQV2u.js → edit-page-B-oevUZ9.js} +3 -3
- package/dist/assets/{ellipsis-vertical-C7FjlUsY.js → ellipsis-vertical-BEb-J8z6.js} +1 -1
- package/dist/assets/{empty-state-DIOGM_CU.js → empty-state-C99UyDE3.js} +1 -1
- package/dist/assets/{erDiagram-AWTI2OKA-DYu8cEdc.js → erDiagram-AWTI2OKA-BePOLi5M.js} +1 -1
- package/dist/assets/{error-panel-Ddb8RkFG.js → error-panel-Bs34jXFh.js} +1 -1
- package/dist/assets/{file-explorer-panel-Oy9DbyFP.js → file-explorer-panel-Ck6UL861.js} +1 -1
- package/dist/assets/{flowDiagram-PVAE7QVJ-CmvW5iTb.js → flowDiagram-PVAE7QVJ-BgjFu5l7.js} +1 -1
- package/dist/assets/{ganttDiagram-OWAHRB6G-BaKQlCaT.js → ganttDiagram-OWAHRB6G-YOPb3XSV.js} +1 -1
- package/dist/assets/{gitGraphDiagram-NY62KEGX-CWO24eP6.js → gitGraphDiagram-NY62KEGX-CGhqaDTy.js} +1 -1
- package/dist/assets/{glide-data-editor-CNDLEJ9a.js → glide-data-editor-9QUH6iso.js} +4 -4
- package/dist/assets/{graph-BZKTtxsc.js → graph-DQQFGrho.js} +1 -1
- package/dist/assets/{home-page-Bvwppn9N.js → home-page-DRKpPCrF.js} +1 -1
- package/dist/assets/{index-CZaurnA9.js → index-2252nrk6.js} +1 -1
- package/dist/assets/{index-BJVyzkx5.js → index-Aeo6WiK7.js} +1 -1
- package/dist/assets/{index-0XOUPdwT.js → index-B8jXZ12t.js} +1 -1
- package/dist/assets/{index-WXJFkQHg.js → index-BAbIIxHU.js} +1 -1
- package/dist/assets/{index-Brf2DwUM.js → index-BJNCMUmG.js} +1 -1
- package/dist/assets/{index-D-tZfElD.js → index-BW3k9Gss.js} +1 -1
- package/dist/assets/{index-DkntzpX4.js → index-BjgnbONl.js} +1 -1
- package/dist/assets/{index-BH7f3aiU.js → index-BprjMYH5.js} +1 -1
- package/dist/assets/{index-zrSUQXha.js → index-C1ez98sk.js} +1 -1
- package/dist/assets/{index-D3PqGupX.js → index-C2MD0vgD.js} +1 -1
- package/dist/assets/{index-PmY0x4Zd.js → index-C7CoaNFb.js} +124 -124
- package/dist/assets/{index-DZhOPkOB.js → index-CFKO7WXI.js} +1 -1
- package/dist/assets/{index-qE8lHQ-N.js → index-CUFv_thQ.js} +1 -1
- package/dist/assets/{index-CXrWwFX6.js → index-C_tkBKNO.js} +1 -1
- package/dist/assets/{index-B_d_JZGI.js → index-CfaDbEdi.js} +1 -1
- package/dist/assets/{index-BgXbBA39.js → index-ClzeQrN7.js} +1 -1
- package/dist/assets/{index-DCkzth56.js → index-DdnKZNxM.js} +1 -1
- package/dist/assets/{index-DFrGFNW1.js → index-G5QZppK2.js} +1 -1
- package/dist/assets/{index-DmgwT3sx.js → index-SGLNXrGP.js} +1 -1
- package/dist/assets/{index-CerjupfZ.js → index-aE43R74q.js} +1 -1
- package/dist/assets/infoDiagram-STP46IZ2-CJLOpSAf.js +2 -0
- package/dist/assets/{isEmpty-D1t7Gran.js → isEmpty-D-4c7sMv.js} +1 -1
- package/dist/assets/{journeyDiagram-BIP6EPQ6-D4Rp6H_h.js → journeyDiagram-BIP6EPQ6-C94u3Mv3.js} +1 -1
- package/dist/assets/{kanban-definition-6OIFK2YF-DFt9DftA.js → kanban-definition-6OIFK2YF-BEXYFzz7.js} +1 -1
- package/dist/assets/{layout-D8WXi2_g.js → layout-Bz2BJ2ru.js} +1 -1
- package/dist/assets/{linear-BwY8e5hA.js → linear-D8s7K76e.js} +1 -1
- package/dist/assets/{links-4B6ldZ5P.js → links-BpXlz1GG.js} +1 -1
- package/dist/assets/{logs-panel-Dxiyt7dO.js → logs-panel-DC7wpmPz.js} +1 -1
- package/dist/assets/{markdown-renderer-VDu-NBKB.js → markdown-renderer-DRdSWR9X.js} +3 -3
- package/dist/assets/{mermaid-B-O-Puyi.js → mermaid-Y3x4hmD0.js} +1 -1
- package/dist/assets/{mermaid.core-BFFCqfOn.js → mermaid.core-DzthE35Y.js} +4 -4
- package/dist/assets/{min-DtVSfYKl.js → min-BBO3-1Hg.js} +1 -1
- package/dist/assets/{mindmap-definition-Q6HEUPPD-kyvIY8Dg.js → mindmap-definition-Q6HEUPPD-DktvuLe1.js} +1 -1
- package/dist/assets/{number-overlay-editor-GjLB2UK4.js → number-overlay-editor-BEfwI1IT.js} +1 -1
- package/dist/assets/{outline-panel-CMJjOoN7.js → outline-panel-CdsnAy2w.js} +1 -1
- package/dist/assets/{packages-panel-nfXB-bKW.js → packages-panel-DiTA-d_D.js} +1 -1
- package/dist/assets/{pieDiagram-ADFJNKIX-D8JFQcWR.js → pieDiagram-ADFJNKIX-DQDNQ-de.js} +1 -1
- package/dist/assets/{quadrantDiagram-LMRXKWRM-Nf8GzxXG.js → quadrantDiagram-LMRXKWRM-0kgIXc2-.js} +1 -1
- package/dist/assets/{react-plotly-CnW9p7ZA.js → react-plotly-DJqqfM7c.js} +1 -1
- package/dist/assets/{requirementDiagram-4UW4RH46-CCUxF8BZ.js → requirementDiagram-4UW4RH46-B5rb0ypd.js} +1 -1
- package/dist/assets/{run-page-Bl4p3AbZ.js → run-page-CFmLrv1R.js} +1 -1
- package/dist/assets/{sankeyDiagram-GR3RE2ED-Sr8kDwP1.js → sankeyDiagram-GR3RE2ED-Dom7IlnF.js} +1 -1
- package/dist/assets/{scratchpad-panel-Ja1Mu-W3.js → scratchpad-panel-CuHWpHO8.js} +1 -1
- package/dist/assets/{secrets-panel-B-3fcSyP.js → secrets-panel-CfHc5YD0.js} +1 -1
- package/dist/assets/{sequenceDiagram-C3RYC4MD-CBJ152Q3.js → sequenceDiagram-C3RYC4MD-PNJWXQbw.js} +1 -1
- package/dist/assets/{slides-component-DGtsVP5o.js → slides-component-CJgaTRZ0.js} +1 -1
- package/dist/assets/{snippets-panel-ClNnwKBM.js → snippets-panel-B2EC1txM.js} +1 -1
- package/dist/assets/{sortBy-D47H6Vyl.js → sortBy-DZnlX29-.js} +1 -1
- package/dist/assets/{state-B_RCHTH5.js → state-CWict9RU.js} +1 -1
- package/dist/assets/{stateDiagram-KXAO66HF-BlBFSAZr.js → stateDiagram-KXAO66HF-BE58aJnr.js} +1 -1
- package/dist/assets/stateDiagram-v2-UMBNRL4Z-CdThjimL.js +1 -0
- package/dist/assets/{storage-BNcWOH3-.js → storage-DRaR04wR.js} +3 -3
- package/dist/assets/{terminal-CATzv5Hd.js → terminal-BX3Su5q7.js} +1 -1
- package/dist/assets/{time-CsYqILfB.js → time-hUzZfpNE.js} +1 -1
- package/dist/assets/{timeline-definition-XQNQX7LJ-CGrhjuAs.js → timeline-definition-XQNQX7LJ-CqQP9t51.js} +1 -1
- package/dist/assets/{tracing-DUbJtOyq.js → tracing-B10Q1n-L.js} +2 -2
- package/dist/assets/{tracing-panel-DmzqPUtc.js → tracing-panel-Du8WCnno.js} +2 -2
- package/dist/assets/{trash-rxdjLzkf.js → trash-B81GTiv6.js} +1 -1
- package/dist/assets/{tree-C2Ul1h1C.js → tree-6vW2ogkh.js} +1 -1
- package/dist/assets/{treemap-75Q7IDZK-N9hyUpyj.js → treemap-75Q7IDZK-CdwDwwsz.js} +1 -1
- package/dist/assets/{variable-panel-BbgupOdG.js → variable-panel-D5qgJI7k.js} +1 -1
- package/dist/assets/{vega-component-CR_MHOBT.js → vega-component-DJaJWMJM.js} +1 -1
- package/dist/assets/{xychartDiagram-6GGTOJPD-jdLZsMb2.js → xychartDiagram-6GGTOJPD-WFtXqaM9.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/src/core/ai/staged-cells.ts +34 -1
- package/src/core/cells/__tests__/add-missing-import.test.ts +67 -22
- package/src/core/cells/add-missing-import.ts +24 -7
- package/src/core/cells/cells.ts +26 -27
- package/dist/assets/_baseMap-NzEbKt5c.js +0 -1
- package/dist/assets/channel-DHcKBVM4.js +0 -1
- package/dist/assets/classDiagram-KNZD7YFC-D-xwLnlX.js +0 -1
- package/dist/assets/classDiagram-v2-RKCZMP56-D-xwLnlX.js +0 -1
- package/dist/assets/clone-CSxIll62.js +0 -1
- package/dist/assets/infoDiagram-STP46IZ2-CAuVVehw.js +0 -2
- package/dist/assets/stateDiagram-v2-UMBNRL4Z-DbA-iToo.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as O,r as u,d as v,bV as T,bW as D,bX as G,bY as R,bZ as q,b_ as P,j as e,aC as $,a5 as U,T as Y,a3 as Z,Y as _,a4 as z,b$ as F,a6 as E,Z as H,c0 as W,c1 as h,V as C,b8 as X,b9 as A,a as J,c2 as K,ak as L,c3 as Q,__tla as ee}from"./index-
|
|
1
|
+
import{c as O,r as u,d as v,bV as T,bW as D,bX as G,bY as R,bZ as q,b_ as P,j as e,aC as $,a5 as U,T as Y,a3 as Z,Y as _,a4 as z,b$ as F,a6 as E,Z as H,c0 as W,c1 as h,V as C,b8 as X,b9 as A,a as J,c2 as K,ak as L,c3 as Q,__tla as ee}from"./index-C7CoaNFb.js";import{V as re,C as te}from"./common-Du9rSOwD.js";import{s as b}from"./sortBy-DZnlX29-.js";import{a as ae,__tla as oe}from"./edit-page-B-oevUZ9.js";import{P as se}from"./empty-state-C99UyDE3.js";import"./_baseEach-CvTX9w0Y.js";import"./_baseMap-CtlwA90f.js";import"./links-BpXlz1GG.js";import{__tla as ie}from"./storage-DRaR04wR.js";import"./index-Aeo6WiK7.js";import"./index-CfaDbEdi.js";import"./index-BjgnbONl.js";import"./index-CUFv_thQ.js";import"./index-DdnKZNxM.js";import"./index-C_tkBKNO.js";import"./index-BJNCMUmG.js";import"./index-CFKO7WXI.js";import"./index-aE43R74q.js";import"./index-BAbIIxHU.js";import"./index-ClzeQrN7.js";import"./index-G5QZppK2.js";import"./index-C2MD0vgD.js";import"./apl-CXdQSnD-.js";import"./asciiarmor-D5V0T9Cu.js";import"./asn1-DWPaVWf6.js";import"./brainfuck-CtZaYBKt.js";import"./cobol-stawOqaz.js";import"./clike-BgBwzOhw.js";import"./clojure-DiuoqK-z.js";import"./css-ZjFoif2m.js";import"./cmake-DXn5xaP-.js";import"./coffeescript-BTDxI-eT.js";import"./commonlisp-vq6DHwts.js";import"./cypher-gJDei3ni.js";import"./python-DD-Q2bae.js";import"./crystal-CRzZ78HM.js";import"./d-BShv7fp-.js";import"./diff-UJJ5BM9S.js";import"./dtd-DI9Herc-.js";import"./dylan-DkEP81N9.js";import"./ecl-DPFc0Uaf.js";import"./eiffel-DR5c0IrL.js";import"./elm-DompmV0j.js";import"./erlang-BuqgqA5h.js";import"./factor-CFXhaUWb.js";import"./simple-mode-C3vEBAcb.js";import"./forth-POgR1ypr.js";import"./fortran-DL7KluxX.js";import"./mllike-3c2dg9RT.js";import"./gas-bV0CklSb.js";import"./gherkin-B6X1vGSW.js";import"./groovy-DnIzCrpZ.js";import"./haskell-CLQs6EAM.js";import"./haxe-D25e-2l-.js";import"./idl-pcmmZuaN.js";import"./javascript-BpzJj0-u.js";import"./jinja2-DhgKlfW7.js";import"./julia-DjdwvFuI.js";import"./livescript-HO6ttBFx.js";import"./lua-8DXOpKDz.js";import"./mirc-DkvFAiy5.js";import"./mathematica-IIbmv7SK.js";import"./modelica-DSrSSXCg.js";import"./mumps-zvxmGV4l.js";import"./mbox-z_N2Mo3d.js";import"./nsis-BvKfQ9lQ.js";import"./ntriples-BSwWqoLa.js";import"./octave-C4hdQ5Hf.js";import"./oz-qQq7irPq.js";import"./pascal-CafrKXZF.js";import"./perl-tdMlh9QA.js";import"./pig-CwGJVRC4.js";import"./powershell-D1ly3AHC.js";import"./properties-_nPj978X.js";import"./protobuf-B4y9do6W.js";import"./pug-BTvK5tSS.js";import"./puppet-Bc-yJKzi.js";import"./q-B0kTJ4cI.js";import"./r-BA4EbLKE.js";import"./rpm-DI_rRufH.js";import"./ruby-CR-u2WLS.js";import"./sas-Bqaci40L.js";import"./scheme-qjP0V5Ag.js";import"./shell-BLav31RL.js";import"./sieve-r025o_jW.js";import"./smalltalk-C7J3IyEP.js";import"./sparql-BRLJFz69.js";import"./stylus-Bdo_Aemu.js";import"./swift-B_XXVlXX.js";import"./verilog-B4LBqg_1.js";import"./tcl-B2fODqDH.js";import"./textile-BuVhTOzU.js";import"./toml-wcPdHu67.js";import"./troff-Ce85hlLp.js";import"./ttcn-BxnYHtq8.js";import"./ttcn-cfg-CKJxb-l2.js";import"./turtle-BkSuIpt-.js";import"./webidl-CGwyPRYs.js";import"./vb-BHgjm0DN.js";import"./vbscript-Dawdd5GZ.js";import"./velocity-BdD_26Jv.js";import"./vhdl-CWWH2SUo.js";import"./xquery-CVDBqZPY.js";import"./yacas-I8QjZlxf.js";import"./z80-D8p3gKXp.js";import"./mscgen-B2igx18G.js";import"./index-C1ez98sk.js";import"./trash-B81GTiv6.js";import"./_createAggregator-C5CVY-0t.js";import{__tla as le}from"./loro_wasm_bg-C1ks32Vm.js";let k,me=Promise.all([(()=>{try{return ee}catch{}})(),(()=>{try{return oe}catch{}})(),(()=>{try{return ie}catch{}})(),(()=>{try{return le}catch{}})()]).then(async()=>{const B=O("square-equal",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 10h10",key:"1101jm"}],["path",{d:"M7 14h10",key:"1mhdw3"}]]),f="name",g="type-value",x="defs-refs",S=[{id:f,accessorFn:r=>[r.name,r.declaredBy],enableSorting:!0,sortingFn:"alphanumeric",header:({column:r})=>e.jsx(h,{header:"Name",column:r}),cell:({getValue:r})=>{const[t,s]=r();return e.jsx(re,{name:t,declaredBy:s})}},{id:g,accessorFn:r=>[r.dataType,r.value],enableSorting:!0,sortingFn:"alphanumeric",header:({column:r})=>e.jsx(h,{header:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{children:"Type"}),e.jsx("span",{children:"Value"})]}),column:r}),cell:({getValue:r})=>{const[t,s]=r();return e.jsxs("div",{className:"max-w-[150px]",children:[e.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap text-muted-foreground font-mono text-xs",children:t}),e.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap",title:s??"",children:s})]})}},{id:x,accessorFn:r=>[r.declaredBy,r.usedBy,r.name,r.declaredByNames,r.usedByNames],enableSorting:!0,sortingFn:"basic",header:({column:r})=>e.jsx(h,{header:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{children:"Declared By"}),e.jsx("span",{children:"Used By"})]}),column:r}),cell:({getValue:r})=>{const[t,s,i]=r(),l=m=>{const c=X(m);c&&A(c,i)};return e.jsxs("div",{className:"flex flex-col gap-1 py-1",children:[e.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-center",children:[e.jsx("span",{title:"Declared by",children:e.jsx(B,{className:"w-3.5 h-3.5 text-muted-foreground"})}),t.length===1?e.jsx(C,{variant:"focus",cellId:t[0],skipScroll:!0,onClick:()=>l(t[0])}):e.jsx("div",{className:"text-destructive flex flex-row gap-2",children:t.slice(0,3).map((m,c)=>e.jsxs("span",{className:"flex",children:[e.jsx(C,{variant:"focus",cellId:m,skipScroll:!0,className:"whitespace-nowrap text-destructive",onClick:()=>l(m)},m),c<t.length-1&&", "]},m))})]}),e.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-baseline",children:[e.jsx("span",{title:"Used by",children:e.jsx(ae,{className:"w-3.5 h-3.5 text-muted-foreground"})}),e.jsx(te,{maxCount:3,cellIds:s,skipScroll:!0,onClick:l})]})]})}}],j=u.memo(({className:r,cellIds:t,variables:s})=>{const[i,l]=v.useState([]),[m,c]=v.useState(""),y=T(),{locale:I}=D(),w=u.useMemo(()=>{const o=a=>{const p=y[a];return W(p)?`cell-${t.indexOf(a)}`:p??`cell-${t.indexOf(a)}`};return Object.values(s).map(a=>({...a,declaredByNames:a.declaredBy.map(o),usedByNames:a.usedBy.map(o)}))},[s,y,t]),V=u.useMemo(()=>{const o=new Map;return t.forEach((a,p)=>o.set(a,p)),(function({variables:a,sort:p,cellIdToIndex:M}){p||(p={id:x,desc:!1});let n=[];switch(p.id){case f:n=b(a,d=>d.name);break;case g:n=b(a,d=>d.dataType);break;case x:n=b(a,d=>M.get(d.declaredBy[0]))}return p.desc?n.reverse():n})({variables:w,sort:i[0],cellIdToIndex:o})},[w,i,t]),N=G({data:V,columns:S,getCoreRowModel:P(),onGlobalFilterChange:c,getFilteredRowModel:q(),enableFilters:!0,enableGlobalFilter:!0,enableColumnPinning:!1,getColumnCanGlobalFilter:o=>o.columnDef.enableGlobalFilter??!0,globalFilterFn:"auto",manualSorting:!0,locale:I,onSortingChange:l,getSortedRowModel:R(),state:{sorting:i,globalFilter:m}});return e.jsxs(e.Fragment,{children:[e.jsx($,{className:"w-full",placeholder:"Search",value:m,onChange:o=>c(o.target.value)}),e.jsxs(U,{className:Y("w-full text-sm flex-1 border-separate border-spacing-0",r),children:[e.jsx(Z,{children:e.jsx(_,{className:"whitespace-nowrap text-xs",children:N.getFlatHeaders().map(o=>e.jsx(z,{className:"sticky top-0 bg-background border-b",children:F(o.column.columnDef.header,o.getContext())},o.id))})}),e.jsx(E,{children:N.getRowModel().rows.map(o=>e.jsx(_,{className:"hover:bg-accent",children:o.getVisibleCells().map(a=>e.jsx(H,{className:"border-b",children:F(a.column.columnDef.cell,a.getContext())},a.id))},o.id))})]})]})});j.displayName="VariableTable",k=()=>{const r=J.c(4),t=K(),s=L();if(Object.keys(t).length===0){let l;return r[0]===Symbol.for("react.memo_cache_sentinel")?(l=e.jsx(se,{title:"No variables",description:"Global variables will appear here.",icon:e.jsx(Q,{})}),r[0]=l):l=r[0],l}let i;return r[1]!==s.inOrderIds||r[2]!==t?(i=e.jsx(j,{className:"flex-1",cellIds:s.inOrderIds,variables:t}),r[1]=s.inOrderIds,r[2]=t,r[3]=i):i=r[3],i}});export{me as __tla,k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dM as K,dN as D,a as E,b as F,dO as G,dP as W,j as g,E as $,u as C,r as j,dQ as T,cM as N,dR as R,L as M,ct as z,dS as q,dT as B,aI as Q,dU as U,aB as J,aD as X}from"./index-
|
|
1
|
+
import{dM as K,dN as D,a as E,b as F,dO as G,dP as W,j as g,E as $,u as C,r as j,dQ as T,cM as N,dR as R,L as M,ct as z,dS as q,dT as B,aI as Q,dU as U,aB as J,aD as X}from"./index-C7CoaNFb.js";import{M as y}from"./compile-CZXqyOxa.js";import{a as Y}from"./VegaLite-BckFaf2D.js";import"./time-hUzZfpNE.js";import"./timer-Bqd5yn_a.js";import"./linear-D8s7K76e.js";import"./init-DLRA0X12.js";import"./range-CtcPcB_L.js";import"./zoom-COrs4lFh.js";import"./ordinal-DDUp3AbE.js";import"./colors-bszWmPJw.js";import"./step-BwsUM5iJ.js";import"./arc-Cuwikxov.js";import"./index-BEQfoZiP.js";import"./index-B8jXZ12t.js";const V=new Set(["boxplot","errorband","errorbar"]),S={getMarkType(t){const e=typeof t=="string"?t:t.type;if(V.has(e))throw new Error("Not supported");return e},isInteractive(t){const e=typeof t=="string"?t:t.type;return!V.has(e)},makeClickable(t){const e=typeof t=="string"?t:t.type;return e in y?typeof t=="string"?{type:t,cursor:"pointer",tooltip:!0}:{...t,type:e,cursor:"pointer",tooltip:!0}:t},getOpacity:t=>typeof t=="string"?null:"opacity"in t&&typeof t.opacity=="number"?t.opacity:null},tt=new Set(["color","fill","fillOpacity","opacity","shape","size"]);function et(t,e,r,i){const u={and:r.map(d=>({param:d}))};if(t==="opacity"){const d=S.getOpacity(i)||1;return{...e,opacity:{condition:{test:u,value:d},value:d/5}}}return e}const w={point:t=>t==null?"select_point":`select_point_${t}`,interval:t=>t==null?"select_interval":`select_interval_${t}`,legendSelection:t=>`legend_selection_${t}`,HIGHLIGHT:"highlight",PAN_ZOOM:"pan_zoom",hasPoint:t=>t.some(e=>e.startsWith("select_point")),hasInterval:t=>t.some(e=>e.startsWith("select_interval")),hasLegend:t=>t.some(e=>e.startsWith("legend_selection")),hasPanZoom:t=>t.some(e=>e.startsWith("pan_zoom"))},P={highlight:()=>({name:w.HIGHLIGHT,select:{type:"point",on:"mouseover"}}),interval:(t,e)=>({name:w.interval(e),select:{type:"interval",encodings:Z(t),mark:{fill:"#669EFF",fillOpacity:.07,stroke:"#669EFF",strokeOpacity:.4},on:"[mousedown[!event.metaKey], mouseup] > mousemove[!event.metaKey]",translate:"[mousedown[!event.metaKey], mouseup] > mousemove[!event.metaKey]"}}),point:(t,e)=>({name:w.point(e),select:{type:"point",encodings:Z(t),on:"click[!event.metaKey]"}}),legend:t=>({name:w.legendSelection(t),select:{type:"point",fields:[t]},bind:"legend"}),panZoom:()=>({name:w.PAN_ZOOM,bind:"scales",select:{type:"interval",on:"[mousedown[event.metaKey], window:mouseup] > window:mousemove!",translate:"[mousedown[event.metaKey], window:mouseup] > window:mousemove!",zoom:"wheel![event.metaKey]"}})};function Z(t){switch(S.getMarkType(t.mark)){case y.image:case y.trail:return;case y.area:case y.arc:return["color"];case y.bar:{const e=(function(r){var d,l;if(!r||!("mark"in r))return;const i=(d=r.encoding)==null?void 0:d.x,u=(l=r.encoding)==null?void 0:l.y;if(i&&"type"in i&&i.type==="nominal")return"vertical";if(u&&"type"in u&&u.type==="nominal"||i&&"aggregate"in i)return"horizontal";if(u&&"aggregate"in u)return"vertical"})(t);return e==="horizontal"?["y"]:e==="vertical"?["x"]:void 0}case y.circle:case y.geoshape:case y.line:case y.point:case y.rect:case y.rule:case y.square:case y.text:case y.tick:return["x","y"]}}function A(t){return"params"in t&&t.params&&t.params.length>0?t.params.filter(e=>e!=null&&"select"in e&&e.select!==void 0).map(e=>e.name):"layer"in t?[...new Set(t.layer.flatMap(A))]:[]}function at(t,e){var f,v;let{chartSelection:r=!0,fieldSelection:i=!0}=e;if(!r&&!i)return t;if(((f=t.params)==null?void 0:f.some(c=>c.bind==="legend"))&&(i=!1),((v=t.params)==null?void 0:v.some(c=>!c.bind))&&(r=!1),"vconcat"in t){const c=t.vconcat.map(o=>"mark"in o?_(o):o);return{...t,vconcat:c}}if("hconcat"in t){const c=t.hconcat.map(o=>"mark"in o?_(o):o);return{...t,hconcat:c}}if("layer"in t){const c=t.layer.map((o,p)=>{if(!("mark"in o))return o;let s=o;return s=L(s,r,p),s=_(s),p===0&&(s=H(s)),s});return{...t,layer:c}}if(!("mark"in t)||!S.isInteractive(t.mark))return t;let l=t;return l=(function(c,o){if(o===!1)return c;let p=(function(h){if(!h||!("encoding"in h))return[];const{encoding:b}=h;return b?Object.entries(b).flatMap(a=>{const[n,m]=a;return m&&tt.has(n)?"field"in m&&typeof m.field=="string"?[m.field]:"condition"in m&&m.condition&&typeof m.condition=="object"&&"field"in m.condition&&m.condition.field&&typeof m.condition.field=="string"?[m.condition.field]:[]:[]}):[]})(c);Array.isArray(o)&&(p=p.filter(h=>o.includes(h)));const s=p.map(h=>P.legend(h)),x=[...c.params||[],...s];return{...c,params:x}})(l,i),l=L(l,r,void 0),l=_(l),l=H(l),l}function L(t,e,r){if(e===!1)return t;let i;try{i=S.getMarkType(t.mark)}catch{return t}if(i==="geoshape")return t;const u=e===!0?(function(f){switch(f){case"arc":case"area":return["point"];case"text":case"bar":default:return["point","interval"];case"line":return}})(i):[e];if(!u)return t;const d=u.map(f=>f==="interval"?P.interval(t,r):P.point(t,r)),l=[...t.params||[],...d];return{...t,params:l}}function H(t){let e;try{e=S.getMarkType(t.mark)}catch{}if(e==="geoshape")return t;const r=t.params||[];return r.some(i=>i.bind==="scales")?t:{...t,params:[...r,P.panZoom()]}}function _(t){const e="encoding"in t?t.encoding:void 0,r=t.params||[],i=r.map(u=>u.name);return r.length===0?t:S.isInteractive(t.mark)?{...t,mark:S.makeClickable(t.mark),encoding:et("opacity",e||{},i,t.mark)}:t}G("arrow",W);const nt=t=>{const e=E.c(11),{value:r,setValue:i,chartSelection:u,fieldSelection:d,spec:l}=t;let f,v;e[0]!==l?(f=async()=>(async function(s){if(!s)return s;const x="datasets"in s?{...s.datasets}:{},h=async a=>{if(!a)return a;if("layer"in a){const k=await Promise.all(a.layer.map(h));a={...a,layer:k}}if("hconcat"in a){const k=await Promise.all(a.hconcat.map(h));a={...a,hconcat:k}}if("vconcat"in a){const k=await Promise.all(a.vconcat.map(h));a={...a,vconcat:k}}if("spec"in a&&(a={...a,spec:await h(a.spec)}),!a.data||!("url"in a.data))return a;let n;try{n=K(a.data.url)}catch{return a}const m=await D(n.href,a.data.format);return x[n.pathname]=m,{...a,data:{name:n.pathname}}},b=await h(s);return Object.keys(x).length===0?b:{...b,datasets:x}})(l),v=[l],e[0]=l,e[1]=f,e[2]=v):(f=e[1],v=e[2]);const{data:c,error:o}=F(f,v);if(o){let s;return e[3]!==o?(s=g.jsx($,{error:o}),e[3]=o,e[4]=s):s=e[4],s}if(!c)return null;let p;return e[5]!==u||e[6]!==d||e[7]!==c||e[8]!==i||e[9]!==r?(p=g.jsx(rt,{value:r,setValue:i,chartSelection:u,fieldSelection:d,spec:c}),e[5]=u,e[6]=d,e[7]=c,e[8]=i,e[9]=r,e[10]=p):p=e[10],p},rt=({value:t,setValue:e,chartSelection:r,fieldSelection:i,spec:u})=>{const{theme:d}=C(),l=j.useRef(void 0),[f,v]=j.useState(),c=T(u),o=j.useMemo(()=>at((function(n){return n.data&&"url"in n.data&&(n.data.url=K(n.data.url).href),n})(c),{chartSelection:r,fieldSelection:i}),[c,r,i]),p=j.useMemo(()=>A(o),[o]),s=N(n=>{e({...t,...n})}),x=T(p),h=j.useMemo(()=>x.reduce((n,m)=>(w.PAN_ZOOM===m||(n[m]=R((k,I)=>{M.debug("[Vega signal]",k,I);let O=z.mapValues(I,st);O=z.mapValues(O,ot),s({[k]:O})},100)),n),{}),[x,s]),b=N(n=>{M.error(n),M.debug(o),v(n)}),a=N(n=>{M.debug("[Vega view] created",n),l.current=n,v(void 0)});return g.jsxs(g.Fragment,{children:[f&&g.jsxs(q,{variant:"destructive",children:[g.jsx(B,{children:f.message}),g.jsx("div",{className:"text-md",children:f.stack})]}),g.jsxs("div",{className:"relative",onPointerDown:Q.stopPropagation(),children:[g.jsx(Y,{spec:o,theme:d==="dark"?"dark":void 0,actions:it,signalListeners:h,onError:b,onNewView:a}),(()=>{const n=[];return w.hasPoint(p)&&n.push(["Point selection","click to select a point; hold shift for multi-select"]),w.hasInterval(p)&&n.push(["Interval selection","click and drag to select an interval"]),w.hasLegend(p)&&n.push(["Legend selection","click to select a legend item; hold shift for multi-select"]),w.hasPanZoom(p)&&n.push(["Pan","hold the meta key and drag"],["Zoom","hold the meta key and scroll"]),n.length===0?null:g.jsx(J,{delayDuration:300,side:"left",content:g.jsx("div",{className:"text-xs flex flex-col",children:n.map((m,k)=>g.jsxs("div",{children:[g.jsxs("span",{className:"font-bold tracking-wide",children:[m[0],":"]})," ",m[1]]},k))}),children:g.jsx(X,{className:"absolute bottom-1 right-0 m-2 h-4 w-4 cursor-help text-muted-foreground hover:text-foreground"})})})()]})]})},it={source:!1,compiled:!1};function ot(t){return t instanceof Set?[...t]:t}function st(t){return Array.isArray(t)?t.map(e=>e instanceof Date&&U(e)?new Date(e).getTime():e):t}export{nt as default};
|
package/dist/assets/{xychartDiagram-6GGTOJPD-jdLZsMb2.js → xychartDiagram-6GGTOJPD-WFtXqaM9.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var G,j,Q,K,q,Z,J,tt,it,et;import{_ as a,s as hi,g as oi,t as It,q as ri,a as li,b as ci,l as $t,K as gi,d as ui,z as xi,G as ft,F as Bt,H as di,M as pi,h as fi,ac as mi}from"./mermaid.core-
|
|
1
|
+
var G,j,Q,K,q,Z,J,tt,it,et;import{_ as a,s as hi,g as oi,t as It,q as ri,a as li,b as ci,l as $t,K as gi,d as ui,z as xi,G as ft,F as Bt,H as di,M as pi,h as fi,ac as mi}from"./mermaid.core-DzthE35Y.js";import"./transform-D9VCJYws.js";import{i as yi}from"./init-DLRA0X12.js";import{o as bi}from"./ordinal-DDUp3AbE.js";import{r as Ai}from"./range-CtcPcB_L.js";import{l as zt}from"./linear-D8s7K76e.js";import{l as Ot}from"./step-BwsUM5iJ.js";import"./index-C7CoaNFb.js";import"./isEmpty-D-4c7sMv.js";import"./timer-Bqd5yn_a.js";function mt(){var e,t,i=bi().unknown(void 0),s=i.domain,n=i.range,c=0,g=1,p=!1,d=0,_=0,L=.5;function S(){var y=s().length,E=g<c,D=E?g:c,P=E?c:g;e=(P-D)/Math.max(1,y-d+2*_),p&&(e=Math.floor(e)),D+=(P-D-e*(y-d))*L,t=e*(1-d),p&&(D=Math.round(D),t=Math.round(t));var M=Ai(y).map(function(f){return D+e*f});return n(E?M.reverse():M)}return delete i.unknown,i.domain=function(y){return arguments.length?(s(y),S()):s()},i.range=function(y){return arguments.length?([c,g]=y,c=+c,g=+g,S()):[c,g]},i.rangeRound=function(y){return[c,g]=y,c=+c,g=+g,p=!0,S()},i.bandwidth=function(){return t},i.step=function(){return e},i.round=function(y){return arguments.length?(p=!!y,S()):p},i.padding=function(y){return arguments.length?(d=Math.min(1,_=+y),S()):d},i.paddingInner=function(y){return arguments.length?(d=Math.min(1,y),S()):d},i.paddingOuter=function(y){return arguments.length?(_=+y,S()):_},i.align=function(y){return arguments.length?(L=Math.max(0,Math.min(1,y)),S()):L},i.copy=function(){return mt(s(),[c,g]).round(p).paddingInner(d).paddingOuter(_).align(L)},yi.apply(S(),arguments)}var yt=(function(){var e=a(function(h,b,u,x){for(u=u||{},x=h.length;x--;u[h[x]]=b);return u},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],n=[1,5],c=[1,6],g=[1,7],p=[1,5,10,12,14,16,18,19,21,23,34,35,36],d=[1,25],_=[1,26],L=[1,28],S=[1,29],y=[1,30],E=[1,31],D=[1,32],P=[1,33],M=[1,34],f=[1,35],k=[1,36],l=[1,37],z=[1,43],O=[1,42],Y=[1,47],F=[1,50],r=[1,10,12,14,16,18,19,21,23,34,35,36],v=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],C=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],T=[1,64],st={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:a(function(h,b,u,x,w,o,nt){var m=o.length-1;switch(w){case 5:x.setOrientation(o[m]);break;case 9:x.setDiagramTitle(o[m].text.trim());break;case 12:x.setLineData({text:"",type:"text"},o[m]);break;case 13:x.setLineData(o[m-1],o[m]);break;case 14:x.setBarData({text:"",type:"text"},o[m]);break;case 15:x.setBarData(o[m-1],o[m]);break;case 16:this.$=o[m].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=o[m].trim(),x.setAccDescription(this.$);break;case 19:case 27:this.$=o[m-1];break;case 20:this.$=[Number(o[m-2]),...o[m]];break;case 21:this.$=[Number(o[m])];break;case 22:x.setXAxisTitle(o[m]);break;case 23:x.setXAxisTitle(o[m-1]);break;case 24:x.setXAxisTitle({type:"text",text:""});break;case 25:x.setXAxisBand(o[m]);break;case 26:x.setXAxisRangeData(Number(o[m-2]),Number(o[m]));break;case 28:this.$=[o[m-2],...o[m]];break;case 29:this.$=[o[m]];break;case 30:x.setYAxisTitle(o[m]);break;case 31:x.setYAxisTitle(o[m-1]);break;case 32:x.setYAxisTitle({type:"text",text:""});break;case 33:x.setYAxisRangeData(Number(o[m-2]),Number(o[m]));break;case 37:case 38:this.$={text:o[m],type:"text"};break;case 39:this.$={text:o[m],type:"markdown"};break;case 40:this.$=o[m];break;case 41:this.$=o[m-1]+""+o[m]}},"anonymous"),table:[e(t,i,{3:1,4:2,7:4,5:s,34:n,35:c,36:g}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,34:n,35:c,36:g}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:n,35:c,36:g}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(p,[2,34]),e(p,[2,35]),e(p,[2,36]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,34:n,35:c,36:g}),{1:[2,3]},e(p,[2,5]),e(t,[2,7],{4:22,34:n,35:c,36:g}),{11:23,37:24,38:d,39:_,40:27,41:L,42:S,43:y,44:E,45:D,46:P,47:M,48:f,49:k,50:l},{11:39,13:38,24:z,27:O,29:40,30:41,37:24,38:d,39:_,40:27,41:L,42:S,43:y,44:E,45:D,46:P,47:M,48:f,49:k,50:l},{11:45,15:44,27:Y,33:46,37:24,38:d,39:_,40:27,41:L,42:S,43:y,44:E,45:D,46:P,47:M,48:f,49:k,50:l},{11:49,17:48,24:F,37:24,38:d,39:_,40:27,41:L,42:S,43:y,44:E,45:D,46:P,47:M,48:f,49:k,50:l},{11:52,17:51,24:F,37:24,38:d,39:_,40:27,41:L,42:S,43:y,44:E,45:D,46:P,47:M,48:f,49:k,50:l},{20:[1,53]},{22:[1,54]},e(r,[2,18]),{1:[2,2]},e(r,[2,8]),e(r,[2,9]),e(v,[2,37],{40:55,41:L,42:S,43:y,44:E,45:D,46:P,47:M,48:f,49:k,50:l}),e(v,[2,38]),e(v,[2,39]),e(C,[2,40]),e(C,[2,42]),e(C,[2,43]),e(C,[2,44]),e(C,[2,45]),e(C,[2,46]),e(C,[2,47]),e(C,[2,48]),e(C,[2,49]),e(C,[2,50]),e(C,[2,51]),e(r,[2,10]),e(r,[2,22],{30:41,29:56,24:z,27:O}),e(r,[2,24]),e(r,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:d,39:_,40:27,41:L,42:S,43:y,44:E,45:D,46:P,47:M,48:f,49:k,50:l},e(r,[2,11]),e(r,[2,30],{33:60,27:Y}),e(r,[2,32]),{31:[1,61]},e(r,[2,12]),{17:62,24:F},{25:63,27:T},e(r,[2,14]),{17:65,24:F},e(r,[2,16]),e(r,[2,17]),e(C,[2,41]),e(r,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(r,[2,31]),{27:[1,69]},e(r,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(r,[2,15]),e(r,[2,26]),e(r,[2,27]),{11:59,32:72,37:24,38:d,39:_,40:27,41:L,42:S,43:y,44:E,45:D,46:P,47:M,48:f,49:k,50:l},e(r,[2,33]),e(r,[2,19]),{25:73,27:T},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:a(function(h,b){if(!b.recoverable){var u=new Error(h);throw u.hash=b,u}this.trace(h)},"parseError"),parse:a(function(h){var b=this,u=[0],x=[],w=[null],o=[],nt=this.table,m="",rt=0,Lt=0,ni=o.slice.call(arguments,1),R=Object.create(this.lexer),N={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(N.yy[dt]=this.yy[dt]);R.setInput(h,N.yy),N.yy.lexer=R,N.yy.parser=this,R.yylloc===void 0&&(R.yylloc={});var pt=R.yylloc;o.push(pt);var ai=R.options&&R.options.ranges;function Pt(){var B;return typeof(B=x.pop()||R.lex()||1)!="number"&&(B instanceof Array&&(B=(x=B).pop()),B=b.symbols_[B]||B),B}typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,a(function(B){u.length=u.length-2*B,w.length=w.length-B,o.length=o.length-B},"popStack"),a(Pt,"lex");for(var I,V,$,vt,lt,W,Et,ct,H={};;){if(V=u[u.length-1],this.defaultActions[V]?$=this.defaultActions[V]:(I==null&&(I=Pt()),$=nt[V]&&nt[V][I]),$===void 0||!$.length||!$[0]){var Mt="";for(lt in ct=[],nt[V])this.terminals_[lt]&<>2&&ct.push("'"+this.terminals_[lt]+"'");Mt=R.showPosition?"Parse error on line "+(rt+1)+`:
|
|
2
2
|
`+R.showPosition()+`
|
|
3
3
|
Expecting `+ct.join(", ")+", got '"+(this.terminals_[I]||I)+"'":"Parse error on line "+(rt+1)+": Unexpected "+(I==1?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Mt,{text:R.match,token:this.terminals_[I]||I,line:R.yylineno,loc:pt,expected:ct})}if($[0]instanceof Array&&$.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+I);switch($[0]){case 1:u.push(I),w.push(R.yytext),o.push(R.yylloc),u.push($[1]),I=null,Lt=R.yyleng,m=R.yytext,rt=R.yylineno,pt=R.yylloc;break;case 2:if(W=this.productions_[$[1]][1],H.$=w[w.length-W],H._$={first_line:o[o.length-(W||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(W||1)].first_column,last_column:o[o.length-1].last_column},ai&&(H._$.range=[o[o.length-(W||1)].range[0],o[o.length-1].range[1]]),(vt=this.performAction.apply(H,[m,Lt,rt,N.yy,$[1],w,o].concat(ni)))!==void 0)return vt;W&&(u=u.slice(0,-1*W*2),w=w.slice(0,-1*W),o=o.slice(0,-1*W)),u.push(this.productions_[$[1]][0]),w.push(H.$),o.push(H._$),Et=nt[u[u.length-2]][u[u.length-1]],u.push(Et);break;case 3:return!0}}return!0},"parse")},ot=(function(){return{EOF:1,parseError:a(function(h,b){if(!this.yy.parser)throw new Error(h);this.yy.parser.parseError(h,b)},"parseError"),setInput:a(function(h,b){return this.yy=b||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:a(function(){var h=this._input[0];return this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h,h.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:a(function(h){var b=h.length,u=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var x=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),u.length-1&&(this.yylineno-=u.length-1);var w=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:u?(u.length===x.length?this.yylloc.first_column:0)+x[x.length-u.length].length-u[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[w[0],w[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:a(function(h){this.unput(this.match.slice(h))},"less"),pastInput:a(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var h=this.pastInput(),b=new Array(h.length+1).join("-");return h+this.upcomingInput()+`
|
package/dist/index.html
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
<marimo-server-token data-token="{{ server_token }}" hidden></marimo-server-token>
|
|
60
60
|
<!-- /TODO -->
|
|
61
61
|
<title>{{ title }}</title>
|
|
62
|
-
<script type="module" crossorigin src="./assets/index-
|
|
62
|
+
<script type="module" crossorigin src="./assets/index-C7CoaNFb.js"></script>
|
|
63
63
|
<link rel="stylesheet" crossorigin href="./assets/index-DadI618h.css">
|
|
64
64
|
</head>
|
|
65
65
|
<body>
|
package/package.json
CHANGED
|
@@ -10,7 +10,12 @@ import { useDeleteCellCallback } from "@/components/editor/cell/useDeleteCell";
|
|
|
10
10
|
import { CellId } from "@/core/cells/ids";
|
|
11
11
|
import { createReducerAndAtoms } from "@/utils/createReducer";
|
|
12
12
|
import { Logger } from "@/utils/Logger";
|
|
13
|
-
import {
|
|
13
|
+
import { maybeAddMarimoImport } from "../cells/add-missing-import";
|
|
14
|
+
import {
|
|
15
|
+
type CreateNewCellAction,
|
|
16
|
+
cellHandleAtom,
|
|
17
|
+
useCellActions,
|
|
18
|
+
} from "../cells/cells";
|
|
14
19
|
import type { LanguageAdapterType } from "../codemirror/language/types";
|
|
15
20
|
import { updateEditorCodeFromPython } from "../codemirror/language/utils";
|
|
16
21
|
import type { JotaiStore } from "../state/jotai";
|
|
@@ -113,6 +118,8 @@ export function useStagedCells(store: JotaiStore) {
|
|
|
113
118
|
cellCreationStream.current = new CellCreationStream(
|
|
114
119
|
createStagedCell,
|
|
115
120
|
updateStagedCell,
|
|
121
|
+
addStagedCell,
|
|
122
|
+
createNewCell,
|
|
116
123
|
);
|
|
117
124
|
break;
|
|
118
125
|
case "text-delta":
|
|
@@ -168,13 +175,20 @@ class CellCreationStream {
|
|
|
168
175
|
|
|
169
176
|
private onCreateCell: (code: string) => CellId;
|
|
170
177
|
private onUpdateCell: (opts: UpdateStagedCellAction) => void;
|
|
178
|
+
private addStagedCell: (payload: { cellId: CellId }) => void;
|
|
179
|
+
private createNewCell: (opts: CreateNewCellAction) => void;
|
|
180
|
+
private hasMarimoImport = false;
|
|
171
181
|
|
|
172
182
|
constructor(
|
|
173
183
|
onCreateCell: (code: string) => CellId,
|
|
174
184
|
onUpdateCell: (opts: UpdateStagedCellAction) => void,
|
|
185
|
+
addStagedCell: (payload: { cellId: CellId }) => void,
|
|
186
|
+
createNewCell: (opts: CreateNewCellAction) => void,
|
|
175
187
|
) {
|
|
176
188
|
this.onCreateCell = onCreateCell;
|
|
177
189
|
this.onUpdateCell = onUpdateCell;
|
|
190
|
+
this.addStagedCell = addStagedCell;
|
|
191
|
+
this.createNewCell = createNewCell;
|
|
178
192
|
}
|
|
179
193
|
|
|
180
194
|
stream(chunk: TextDeltaChunk) {
|
|
@@ -187,6 +201,7 @@ class CellCreationStream {
|
|
|
187
201
|
// For each parsed cell, we either update an existing staged cell or create a new one.
|
|
188
202
|
for (const [idx, cell] of completionCells.entries()) {
|
|
189
203
|
if (idx < this.createdCells.length) {
|
|
204
|
+
this.addMarimoImport(cell.language);
|
|
190
205
|
const existingCell = this.createdCells[idx];
|
|
191
206
|
this.createdCells[idx] = { ...existingCell, cell };
|
|
192
207
|
this.onUpdateCell({
|
|
@@ -201,6 +216,24 @@ class CellCreationStream {
|
|
|
201
216
|
}
|
|
202
217
|
}
|
|
203
218
|
|
|
219
|
+
/** Add a marimo import if the cell is SQL or Markdown and we haven't added it yet. */
|
|
220
|
+
private addMarimoImport(language: LanguageAdapterType) {
|
|
221
|
+
if (this.hasMarimoImport || language === "python") {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
const cellId = maybeAddMarimoImport({
|
|
226
|
+
autoInstantiate: false,
|
|
227
|
+
createNewCell: this.createNewCell,
|
|
228
|
+
fromCellId: this.createdCells[0]?.cellId,
|
|
229
|
+
before: true,
|
|
230
|
+
});
|
|
231
|
+
if (cellId) {
|
|
232
|
+
this.addStagedCell({ cellId });
|
|
233
|
+
}
|
|
234
|
+
this.hasMarimoImport = true;
|
|
235
|
+
}
|
|
236
|
+
|
|
204
237
|
stop() {
|
|
205
238
|
// Clear all state
|
|
206
239
|
this.buffer = "";
|
|
@@ -1,18 +1,35 @@
|
|
|
1
1
|
/* Copyright 2024 Marimo. All rights reserved. */
|
|
2
2
|
|
|
3
3
|
import { createStore } from "jotai";
|
|
4
|
-
import { describe, expect, it, vi } from "vitest";
|
|
4
|
+
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
|
+
import { MockNotebook } from "@/__mocks__/notebook";
|
|
6
|
+
import { MockRequestClient } from "@/__mocks__/requests";
|
|
7
|
+
import { store } from "@/core/state/jotai";
|
|
5
8
|
import { variablesAtom } from "@/core/variables/state";
|
|
6
9
|
import type { Variables } from "@/core/variables/types";
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
import {
|
|
11
|
+
maybeAddAltairImport,
|
|
12
|
+
maybeAddMarimoImport,
|
|
13
|
+
maybeAddMissingImport,
|
|
14
|
+
} from "../add-missing-import";
|
|
15
|
+
import { notebookAtom } from "../cells";
|
|
10
16
|
import type { CellId } from "../ids";
|
|
11
|
-
import type { CellData } from "../types";
|
|
12
17
|
|
|
13
|
-
|
|
18
|
+
// Mock the getRequestClient function
|
|
19
|
+
const mockRequestClient = MockRequestClient.create();
|
|
20
|
+
vi.mock("@/core/network/requests", () => ({
|
|
21
|
+
getRequestClient: () => mockRequestClient,
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
const Cell1 = "1" as CellId;
|
|
25
|
+
const Cell2 = "2" as CellId;
|
|
14
26
|
|
|
15
27
|
describe("maybeAddMissingImport", () => {
|
|
28
|
+
beforeEach(() => {
|
|
29
|
+
store.set(variablesAtom, {} as Variables);
|
|
30
|
+
store.set(notebookAtom, MockNotebook.notebookState({ cellData: {} }));
|
|
31
|
+
});
|
|
32
|
+
|
|
16
33
|
it("should not add an import if the variable is already in the variables state", () => {
|
|
17
34
|
const appStore = createStore();
|
|
18
35
|
appStore.set(variablesAtom, { mo: {} } as Variables);
|
|
@@ -36,14 +53,14 @@ describe("maybeAddMissingImport", () => {
|
|
|
36
53
|
(code) => {
|
|
37
54
|
const appStore = createStore();
|
|
38
55
|
appStore.set(variablesAtom, {} as Variables);
|
|
39
|
-
appStore.set(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
56
|
+
appStore.set(
|
|
57
|
+
notebookAtom,
|
|
58
|
+
MockNotebook.notebookState({
|
|
59
|
+
cellData: {
|
|
60
|
+
[Cell1]: { code: code },
|
|
61
|
+
},
|
|
62
|
+
}),
|
|
63
|
+
);
|
|
47
64
|
const onAddImport = vi.fn();
|
|
48
65
|
maybeAddMissingImport({
|
|
49
66
|
moduleName: "marimo",
|
|
@@ -58,14 +75,14 @@ describe("maybeAddMissingImport", () => {
|
|
|
58
75
|
it("should add an import if the variable is not in the variables state and the import statement does not exist in the notebook", () => {
|
|
59
76
|
const appStore = createStore();
|
|
60
77
|
appStore.set(variablesAtom, {} as Variables);
|
|
61
|
-
appStore.set(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
78
|
+
appStore.set(
|
|
79
|
+
notebookAtom,
|
|
80
|
+
MockNotebook.notebookState({
|
|
81
|
+
cellData: {
|
|
82
|
+
[Cell1]: { code: "mo.md('hello')" },
|
|
83
|
+
},
|
|
84
|
+
}),
|
|
85
|
+
);
|
|
69
86
|
const onAddImport = vi.fn();
|
|
70
87
|
maybeAddMissingImport({
|
|
71
88
|
moduleName: "marimo",
|
|
@@ -75,4 +92,32 @@ describe("maybeAddMissingImport", () => {
|
|
|
75
92
|
});
|
|
76
93
|
expect(onAddImport).toHaveBeenCalledWith("import marimo as mo");
|
|
77
94
|
});
|
|
95
|
+
|
|
96
|
+
it("should not create a new cell if import already exists due to skipIfCodeExists", () => {
|
|
97
|
+
const addImports = [maybeAddMarimoImport, maybeAddAltairImport];
|
|
98
|
+
for (const addImport of addImports) {
|
|
99
|
+
store.set(variablesAtom, {} as Variables);
|
|
100
|
+
store.set(
|
|
101
|
+
notebookAtom,
|
|
102
|
+
MockNotebook.notebookState({
|
|
103
|
+
cellData: {
|
|
104
|
+
[Cell1]: { code: "import marimo as mo" },
|
|
105
|
+
[Cell2]: { code: "import altair as alt" },
|
|
106
|
+
},
|
|
107
|
+
}),
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
const createNewCell = vi.fn();
|
|
111
|
+
const result = addImport({
|
|
112
|
+
autoInstantiate: false,
|
|
113
|
+
createNewCell,
|
|
114
|
+
fromCellId: Cell1,
|
|
115
|
+
before: false,
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
// Should not create a new cell since the import already exists
|
|
119
|
+
expect(createNewCell).not.toHaveBeenCalled();
|
|
120
|
+
expect(result).toBeNull();
|
|
121
|
+
}
|
|
122
|
+
});
|
|
78
123
|
});
|
|
@@ -47,27 +47,40 @@ export function maybeAddMissingImport({
|
|
|
47
47
|
return true;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Adds a marimo import to the notebook if not already present.
|
|
52
|
+
* @param autoInstantiate Whether to automatically run the cell.
|
|
53
|
+
* @param createNewCell The function to create a new cell.
|
|
54
|
+
* @param fromCellId The cell to add the import to.
|
|
55
|
+
* @param before Whether to add the import before or after the cell.
|
|
56
|
+
*
|
|
57
|
+
* Returns the ID of the new cell if added, otherwise null.
|
|
58
|
+
*/
|
|
50
59
|
export function maybeAddMarimoImport({
|
|
51
60
|
autoInstantiate,
|
|
52
61
|
createNewCell,
|
|
53
62
|
fromCellId,
|
|
63
|
+
before,
|
|
54
64
|
}: {
|
|
55
65
|
autoInstantiate: boolean;
|
|
56
66
|
createNewCell: CellActions["createNewCell"];
|
|
57
67
|
fromCellId?: CellId | null;
|
|
58
|
-
|
|
68
|
+
before?: boolean;
|
|
69
|
+
}): CellId | null {
|
|
59
70
|
const client = getRequestClient();
|
|
60
|
-
|
|
71
|
+
let newCellId: CellId | null = null;
|
|
72
|
+
const added = maybeAddMissingImport({
|
|
61
73
|
moduleName: "marimo",
|
|
62
74
|
variableName: "mo",
|
|
63
75
|
onAddImport: (importStatement) => {
|
|
64
|
-
|
|
76
|
+
newCellId = CellId.create();
|
|
65
77
|
createNewCell({
|
|
66
78
|
cellId: fromCellId ?? "__end__",
|
|
67
|
-
before: false,
|
|
79
|
+
before: before ?? false,
|
|
68
80
|
code: importStatement,
|
|
69
81
|
lastCodeRun: autoInstantiate ? importStatement : undefined,
|
|
70
82
|
newCellId: newCellId,
|
|
83
|
+
skipIfCodeExists: true,
|
|
71
84
|
autoFocus: false,
|
|
72
85
|
});
|
|
73
86
|
if (autoInstantiate) {
|
|
@@ -78,6 +91,7 @@ export function maybeAddMarimoImport({
|
|
|
78
91
|
}
|
|
79
92
|
},
|
|
80
93
|
});
|
|
94
|
+
return added ? newCellId : null;
|
|
81
95
|
}
|
|
82
96
|
|
|
83
97
|
export function maybeAddAltairImport({
|
|
@@ -88,19 +102,21 @@ export function maybeAddAltairImport({
|
|
|
88
102
|
autoInstantiate: boolean;
|
|
89
103
|
createNewCell: CellActions["createNewCell"];
|
|
90
104
|
fromCellId?: CellId | null;
|
|
91
|
-
}):
|
|
105
|
+
}): CellId | null {
|
|
92
106
|
const client = getRequestClient();
|
|
93
|
-
|
|
107
|
+
let newCellId: CellId | null = null;
|
|
108
|
+
const added = maybeAddMissingImport({
|
|
94
109
|
moduleName: "altair",
|
|
95
110
|
variableName: "alt",
|
|
96
111
|
onAddImport: (importStatement) => {
|
|
97
|
-
|
|
112
|
+
newCellId = CellId.create();
|
|
98
113
|
createNewCell({
|
|
99
114
|
cellId: fromCellId ?? "__end__",
|
|
100
115
|
before: false,
|
|
101
116
|
code: importStatement,
|
|
102
117
|
lastCodeRun: autoInstantiate ? importStatement : undefined,
|
|
103
118
|
newCellId: newCellId,
|
|
119
|
+
skipIfCodeExists: true,
|
|
104
120
|
autoFocus: false,
|
|
105
121
|
});
|
|
106
122
|
if (autoInstantiate) {
|
|
@@ -111,4 +127,5 @@ export function maybeAddAltairImport({
|
|
|
111
127
|
}
|
|
112
128
|
},
|
|
113
129
|
});
|
|
130
|
+
return added ? newCellId : null;
|
|
114
131
|
}
|
package/src/core/cells/cells.ts
CHANGED
|
@@ -145,6 +145,31 @@ export function initialNotebookState(): NotebookState {
|
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
+
export interface CreateNewCellAction {
|
|
149
|
+
/** The target cell ID to create a new cell relative to. Can be:
|
|
150
|
+
* - A CellId string for an existing cell
|
|
151
|
+
* - "__end__" to append at the end of the first column
|
|
152
|
+
* - {type: "__end__", columnId} to append at the end of a specific column
|
|
153
|
+
*/
|
|
154
|
+
cellId: CellId | "__end__" | { type: "__end__"; columnId: CellColumnId };
|
|
155
|
+
/** Whether to insert before (true) or after (false) the target cell */
|
|
156
|
+
before: boolean;
|
|
157
|
+
/** Initial code content for the new cell */
|
|
158
|
+
code?: string;
|
|
159
|
+
/** The last executed code for the new cell */
|
|
160
|
+
lastCodeRun?: string;
|
|
161
|
+
/** Timestamp of the last execution */
|
|
162
|
+
lastExecutionTime?: number;
|
|
163
|
+
/** Optional custom ID for the new cell. Auto-generated if not provided */
|
|
164
|
+
newCellId?: CellId;
|
|
165
|
+
/** Whether to focus the new cell after creation */
|
|
166
|
+
autoFocus?: boolean;
|
|
167
|
+
/** If true, skip creation if code already exists */
|
|
168
|
+
skipIfCodeExists?: boolean;
|
|
169
|
+
/** Hide the code in the new cell. This will be initially shown until the cell is blurred for the first time. */
|
|
170
|
+
hideCode?: boolean;
|
|
171
|
+
}
|
|
172
|
+
|
|
148
173
|
/**
|
|
149
174
|
* Actions and reducer for the notebook state.
|
|
150
175
|
*/
|
|
@@ -154,33 +179,7 @@ const {
|
|
|
154
179
|
useActions,
|
|
155
180
|
valueAtom: notebookAtom,
|
|
156
181
|
} = createReducerAndAtoms(initialNotebookState, {
|
|
157
|
-
createNewCell: (
|
|
158
|
-
state,
|
|
159
|
-
action: {
|
|
160
|
-
/** The target cell ID to create a new cell relative to. Can be:
|
|
161
|
-
* - A CellId string for an existing cell
|
|
162
|
-
* - "__end__" to append at the end of the first column
|
|
163
|
-
* - {type: "__end__", columnId} to append at the end of a specific column
|
|
164
|
-
*/
|
|
165
|
-
cellId: CellId | "__end__" | { type: "__end__"; columnId: CellColumnId };
|
|
166
|
-
/** Whether to insert before (true) or after (false) the target cell */
|
|
167
|
-
before: boolean;
|
|
168
|
-
/** Initial code content for the new cell */
|
|
169
|
-
code?: string;
|
|
170
|
-
/** The last executed code for the new cell */
|
|
171
|
-
lastCodeRun?: string;
|
|
172
|
-
/** Timestamp of the last execution */
|
|
173
|
-
lastExecutionTime?: number;
|
|
174
|
-
/** Optional custom ID for the new cell. Auto-generated if not provided */
|
|
175
|
-
newCellId?: CellId;
|
|
176
|
-
/** Whether to focus the new cell after creation */
|
|
177
|
-
autoFocus?: boolean;
|
|
178
|
-
/** If true, skip creation if code already exists */
|
|
179
|
-
skipIfCodeExists?: boolean;
|
|
180
|
-
/** Hide the code in the new cell. This will be initially shown until the cell is blurred for the first time. */
|
|
181
|
-
hideCode?: boolean;
|
|
182
|
-
},
|
|
183
|
-
) => {
|
|
182
|
+
createNewCell: (state, action: CreateNewCellAction) => {
|
|
184
183
|
const {
|
|
185
184
|
cellId,
|
|
186
185
|
before,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as m}from"./_baseEach-9_logFrf.js";import{A as s}from"./index-PmY0x4Zd.js";function e(r,o){var a=-1,t=s(r)?Array(r.length):[];return m(r,function(n,f,i){t[++a]=o(n,f,i)}),t}export{e as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{U as r,C as s}from"./mermaid.core-BFFCqfOn.js";const n=(a,o)=>r.lang.round(s.parse(a)[o]);export{n as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s,c as t,a,C as o}from"./chunk-K7UQS3LO-DEKMIknX.js";import{_ as i}from"./mermaid.core-BFFCqfOn.js";import"./transform-D9VCJYws.js";import"./chunk-FMBD7UC4-Bd0Czs-J.js";import"./chunk-55IACEB6-DZAiDJxy.js";import"./chunk-QN33PNHL-E0jwHU_n.js";import"./index-PmY0x4Zd.js";import"./step-BwsUM5iJ.js";import"./isEmpty-D1t7Gran.js";import"./timer-Bqd5yn_a.js";var e={parser:a,get db(){return new o},renderer:t,styles:s,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{e as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s,c as t,a,C as o}from"./chunk-K7UQS3LO-DEKMIknX.js";import{_ as i}from"./mermaid.core-BFFCqfOn.js";import"./transform-D9VCJYws.js";import"./chunk-FMBD7UC4-Bd0Czs-J.js";import"./chunk-55IACEB6-DZAiDJxy.js";import"./chunk-QN33PNHL-E0jwHU_n.js";import"./index-PmY0x4Zd.js";import"./step-BwsUM5iJ.js";import"./isEmpty-D1t7Gran.js";import"./timer-Bqd5yn_a.js";var e={parser:a,get db(){return new o},renderer:t,styles:s,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{e as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as n}from"./_baseUniq-C5LFcyNC.js";function o(r){return n(r,4)}export{o as c};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{_ as o,l as e,K as s,d as p,L as m}from"./mermaid.core-BFFCqfOn.js";import{p as n}from"./treemap-75Q7IDZK-N9hyUpyj.js";import"./index-PmY0x4Zd.js";import"./transform-D9VCJYws.js";import"./timer-Bqd5yn_a.js";import"./step-BwsUM5iJ.js";import"./isEmpty-D1t7Gran.js";import"./_baseEach-9_logFrf.js";import"./_baseUniq-C5LFcyNC.js";import"./min-DtVSfYKl.js";import"./_baseMap-NzEbKt5c.js";import"./clone-CSxIll62.js";import"./_createAggregator-ZRm2b6Zm.js";var d={parse:o(async r=>{const t=await n("info",r);e.debug(t)},"parse")},g={version:m.version+""},v={parser:d,db:{getVersion:o(()=>g.version,"getVersion")},renderer:{draw:o((r,t,i)=>{e.debug(`rendering info diagram
|
|
2
|
-
`+r);const a=s(t);p(a,100,400,!0),a.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${i}`)},"draw")}};export{v as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as t,b as a,a as e,S as o}from"./chunk-TVAH2DTR-CZFYvqnm.js";import{_ as s}from"./mermaid.core-BFFCqfOn.js";import"./transform-D9VCJYws.js";import"./chunk-55IACEB6-DZAiDJxy.js";import"./chunk-QN33PNHL-E0jwHU_n.js";import"./index-PmY0x4Zd.js";import"./step-BwsUM5iJ.js";import"./isEmpty-D1t7Gran.js";import"./timer-Bqd5yn_a.js";var i={parser:e,get db(){return new o(2)},renderer:a,styles:t,init:s(r=>{r.state||(r.state={}),r.state.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{i as diagram};
|